marketplacepos 2.7.7 → 2.7.9

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 (45) hide show
  1. package/Marketplace/213.cb4351cfb44ca3bf.js +1 -0
  2. package/Marketplace/360.8279e3b4ceab63e1.js +1 -0
  3. package/Marketplace/{369.8e0f0cb3753df1cb.js → 369.0575419486a72276.js} +1 -1
  4. package/Marketplace/397.55fafd1d8945185c.js +1 -0
  5. package/Marketplace/3rdpartylicenses.txt +6 -0
  6. package/Marketplace/408.b53797a5bda9f7f8.js +1 -0
  7. package/Marketplace/46.67982fb195b43a4d.js +1 -0
  8. package/Marketplace/{512.29e1a80c0261c3fd.js → 512.6ddd3191d13695a8.js} +1 -1
  9. package/Marketplace/53.7e8bb7325980dfd5.js +1 -0
  10. package/Marketplace/655.09b1b17f23a59b7e.js +1 -0
  11. package/Marketplace/{717.26634e93ca9b60ed.js → 717.2e5a78cf17e9bed1.js} +1 -1
  12. package/Marketplace/718.78930b2d3e9fc2bd.js +1 -0
  13. package/Marketplace/{72.b0c5b137e38d6dbc.js → 72.a5fd86c341c782ab.js} +1 -1
  14. package/Marketplace/{739.a22c3c892afd39b9.js → 739.0de1f18deac0ed90.js} +1 -1
  15. package/Marketplace/82.fecf4fa3a3743326.js +1 -0
  16. package/Marketplace/87.0c53ec1547d4d5d5.js +1 -0
  17. package/Marketplace/{874.8531eff61a70fef4.js → 874.7662257927081a57.js} +1 -1
  18. package/Marketplace/877.7e5f8104980e0168.js +1 -0
  19. package/Marketplace/884.45404dc14d1585a7.js +1 -0
  20. package/Marketplace/913.6b5b3db030c3bc49.js +1 -0
  21. package/Marketplace/993.5c22ca4b00b8c459.js +1 -0
  22. package/Marketplace/997.08e3f8cf0bafff67.js +1 -0
  23. package/Marketplace/common.df21aa97084954ce.js +1 -0
  24. package/Marketplace/index.html +2 -2
  25. package/Marketplace/main.add73bc6e206d464.js +1 -0
  26. package/Marketplace/runtime.4aba70544574ad58.js +1 -0
  27. package/package.json +1 -1
  28. package/Marketplace/25.b70d86f301c02577.js +0 -1
  29. package/Marketplace/360.35d9782330672e00.js +0 -1
  30. package/Marketplace/397.5272744096b3c1f6.js +0 -1
  31. package/Marketplace/408.37b4fc08ff0dec9d.js +0 -1
  32. package/Marketplace/516.62e0aa94b5bf1d69.js +0 -1
  33. package/Marketplace/61.868e35095821a091.js +0 -1
  34. package/Marketplace/616.b7e1ec6933570169.js +0 -1
  35. package/Marketplace/643.cb4d6fbf012ab5e2.js +0 -1
  36. package/Marketplace/716.986295839ef23655.js +0 -1
  37. package/Marketplace/833.ac6eaa6a9d4889f8.js +0 -1
  38. package/Marketplace/863.8a1ee5ad77c709bd.js +0 -1
  39. package/Marketplace/877.162c86da2be22c5c.js +0 -1
  40. package/Marketplace/913.08c7bf72f6b8e4f8.js +0 -1
  41. package/Marketplace/993.2e09a35cae6cb725.js +0 -1
  42. package/Marketplace/997.6b3f954f35ff3ac0.js +0 -1
  43. package/Marketplace/common.964b6e7314a0ac53.js +0 -1
  44. package/Marketplace/main.4b854eb9a27f62ed.js +0 -1
  45. package/Marketplace/runtime.8464b07500ba30ae.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[874],{1874:(Oe,D,l)=>{l.r(D),l.d(D,{PriceModule:()=>m});var s=l(6895),N=l(7398),I=l(7481),S=l(284),p=l(4006),T=l(8796),e=l(4650);class C{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}}C.\u0275fac=function(n){return new(n||C)},C.\u0275cmp=e.Xpm({type:C,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,t){1&n&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&n&&(e.xp6(3),e.Q6J("Tabs",t.priceTabs))},dependencies:[N.e,S.lC]});var J=l(8231),M=l(6304),U=l(8505),h=l(9300),_=l(3154),v=l(1318),Z=l(7185),y=l(5412),O=l(9425),F=l(6082),k=l(6114);function E(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",16),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.openScanDialog())}),e._UZ(1,"i",17),e._uU(2," Scan Channel "),e.qZA()}}function $(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,c=e.oxw(2);return e.KtG(c.onUpdateItems(i))}),e._UZ(1,"i",19),e._uU(2," Update "),e.qZA()}}function Y(o,n){if(1&o&&(e.TgZ(0,"div"),e.YNc(1,E,3,0,"button",14),e.YNc(2,$,3,0,"button",15),e.qZA()),2&o){const t=n.ngIf,a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!a.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",a.productService.hasSelectionVariant(t))}}function K(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",20)(1,"app-table",21),e.NdJ("onToggle",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.onShowDifferencePrice(i))})("onSubmit",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.updatePriceByVariant(i))}),e.ALo(2,"async"),e.qZA()()}if(2&o){const t=e.oxw().ngIf,a=e.oxw();e.xp6(1),e.Q6J("showProductToggle",!0)("data",e.lcZ(2,4,a.paginationService.data$))("channel",t.Options.Channel)("filter",t.Filter)}}function H(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",23),e._uU(2,"?"),e.qZA()()}}function R(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&o){const t=n.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t))}}function G(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",24),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onNextPage())}),e._UZ(1,"i",25),e._uU(2," Next"),e.qZA()}}function B(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",26),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onLastPage())}),e._UZ(1,"i",27),e._uU(2," Last"),e.qZA()}}function j(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("onSubmit",function(i){e.CHM(t);const c=e.oxw();return e.KtG(c.onSearch(i))}),e.TgZ(1,"actions")(2,"div",2),e.YNc(3,Y,3,2,"div",3),e.ALo(4,"async"),e.qZA()(),e.TgZ(5,"content")(6,"div",4)(7,"div",5),e.YNc(8,K,3,6,"div",6),e.ALo(9,"async"),e.qZA(),e.TgZ(10,"div",7)(11,"div",8)(12,"div",9),e._uU(13),e.ALo(14,"number"),e.ALo(15,"async"),e.YNc(16,H,3,0,"span",10),e.YNc(17,R,3,3,"span",3),e.ALo(18,"async"),e._uU(19),e.qZA()(),e.TgZ(20,"div",11),e.YNc(21,G,3,0,"a",12),e.YNc(22,B,3,0,"a",13),e.qZA()()()()()}if(2&o){const t=e.oxw();let a;e.Q6J("pageData",t.pageData)("hideSearchDropdown",!0)("textButton","Search"),e.xp6(3),e.Q6J("ngIf",e.lcZ(4,11,t.paginationService.data$)),e.xp6(5),e.Q6J("ngIf",e.lcZ(9,13,t.paginationService.data$)),e.xp6(5),e.hij(" Showing 1 - ",e.lcZ(14,15,null==(a=e.lcZ(15,17,t.paginationService.data$))?null:a.length)," of "),e.xp6(3),e.Q6J("ngIf",t.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",!t.paginationService.hideCount&&e.lcZ(18,19,t.allDataCount$)),e.xp6(2),e.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),e.xp6(2),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}class f{constructor(n,t,a,i,c){this.http=n,this.toastr=t,this.dialog=a,this.paginationService=i,this.productService=c,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe((0,U.b)(n=>{this.channelOptions=n.Options.Channel,n.Filter={PageNumber:n.Filter.PageNumber,RowCount:n.Filter.RowCount,filterModel:1},this.searchFilter=n.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onShowDifferencePrice(n){this.searchFilter.filterModel=1,n&&(this.searchFilter.filterModel=3),this.paginationService.resetToFirstPage(this.searchFilter)}onSearch(n){this.searchFilter.text=n,this.paginationService.resetToFirstPage(this.searchFilter)}openScanDialog(){this.searchFilter.ChannelID=_.g.GuidEMpty;let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(J.j,{data:{filter:n,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,h.h)(a=>_.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{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{let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.initPageLoader(),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)}})}updatePrice(n){let t=this.productService.selectedVariantProduct(n);if(t.length>0){let i=t.map(r=>({ID:r.ID,Code:r.Code,Price:r.UnitPrice})),c={ListChannelID:this.channelOptions.filter(r=>r.selected).map(r=>r.ID),ListPrice:i};this.http.post("/api/Price/UpdateChannel",c).subscribe(r=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+c.ListPrice.length+" items in "+c.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(n){let t={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:n.Price-0,VariantID:n.ID};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(a=>{let i=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+n.ItemName+"("+n.VarName+") price in "+i.Name+" to "+t.Price,"Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onUpdateItems(n){const t=this.productService.selectedVariantProduct(n);this.dialog.open(M.j,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe((0,h.h)(a=>void 0!==a)).subscribe(a=>{this.channelOptions=a,this.updatePrice(n)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:n=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,n)}})}ngOnDestroy(){this.paginationService.destroy()}}f.\u0275fac=function(n){return new(n||f)(e.Y36(v.O),e.Y36(Z._W),e.Y36(y.uw),e.Y36(O.b),e.Y36(F.M))},f.\u0275cmp=e.Xpm({type:f,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","hideSearchDropdown","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[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"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,t){1&n&&(e.YNc(0,j,23,21,"mainpanel",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,t.loader$))},dependencies:[s.O5,I.p,k.a,s.Ov,s.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});var d=l(8705),L=l(7945),z=l(1290),Q=l(1739),w=l(1948);function W(o,n){if(1&o&&(e.TgZ(0,"mat-radio-button",3),e._uU(1),e.qZA()),2&o){const t=n.$implicit,a=n.index,i=e.oxw();e.Q6J("value",t.Key)("name",i.name)("title",i.tooltipsText[a]?i.tooltipsText[a]:""),e.xp6(1),e.hij(" ",t.Value,"")}}const X=function(o){return{"border-0 rounded":o}};class g{constructor(){this.modelChange=new e.vpe,this.border=!1,this.tooltipsText=[]}change(n){this.modelChange.emit(n)}}function ee(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",19),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onUpdateItems())}),e._UZ(1,"i",20),e._uU(2," Update "),e.qZA()}}function te(o,n){if(1&o&&(e.TgZ(0,"th",21),e._uU(1),e.qZA()),2&o){const t=n.$implicit;e.xp6(1),e.Oqu(t.Name)}}function ne(o,n){1&o&&(e.ynx(0),e.TgZ(1,"th",22),e._uU(2," Expected (POS) "),e.qZA(),e.TgZ(3,"th",22),e._uU(4," Channel "),e.qZA(),e.BQk())}function ie(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"img",34),e.NdJ("click",function(i){e.CHM(t);const c=e.oxw(3).$implicit,r=e.oxw();return e.KtG(r.onZoomImage(i,null==c?null:c.ImageUrl))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.s9C("src",null==t?null:t.ImageUrl,e.LSH)}}function oe(o,n){1&o&&e._UZ(0,"img",35)}g.\u0275fac=function(n){return new(n||g)},g.\u0275cmp=e.Xpm({type:g,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[e.jDz],decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0)(1,"mat-radio-group",1),e.NdJ("ngModelChange",function(i){return t.change(i)}),e.YNc(2,W,2,4,"mat-radio-button",2),e.qZA()()),2&n&&(e.Q6J("ngClass",e.VKq(3,X,0==t.border)),e.xp6(1),e.Q6J("ngModel",t.model),e.xp6(1),e.Q6J("ngForOf",t.options))},dependencies:[s.ez,s.mk,s.sg,w.Fk,w.VQ,w.U0,p.u5,p.JJ,p.On],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});const ae=function(o){return{"border-bottom":o}};function ce(o,n){if(1&o&&(e.ynx(0),e.TgZ(1,"td",29),e.YNc(2,ie,1,1,"img",30),e.YNc(3,oe,1,0,"ng-template",null,31,e.W1O),e.qZA(),e.TgZ(5,"td",32)(6,"h5",33),e._uU(7),e.qZA(),e._UZ(8,"br"),e.TgZ(9,"small"),e._uU(10),e.qZA()(),e.BQk()),2&o){const t=e.MAs(4),a=e.oxw().index,i=e.oxw().$implicit,c=e.oxw();e.xp6(1),e.Q6J("rowSpan",null==i?null:i.Variants.length)("ngClass",e.VKq(7,ae,a+1==c.products.length)),e.xp6(1),e.Q6J("ngIf",null==i?null:i.ImageUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",null==i?null:i.Variants.length),e.xp6(2),e.Oqu(null==i?null:i.Name),e.xp6(3),e.hij("(",null==i?null:i.Category,")")}}const re=function(o){return{"bg-gradient-warning":o}};function le(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"td",38),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"td",39),e.NdJ("click",function(){const c=e.CHM(t).$implicit,r=e.oxw(2).$implicit,b=e.oxw().$implicit,Ue=e.oxw();return e.KtG(Ue.openTableDialog(r,b,c))}),e.TgZ(5,"span",40),e._uU(6),e.ALo(7,"number"),e.qZA(),e.TgZ(8,"a",41),e.NdJ("click",function(i){return null==i?null:i.stopPropagation()}),e._UZ(9,"i",27),e.qZA()(),e.BQk()}if(2&o){const t=n.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,4,t.PriceExpected)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(8,re,t.Price!=t.PriceExpected)),e.xp6(2),e.hij(" ",e.lcZ(7,6,t.Price)," "),e.xp6(2),e.Q6J("href",t.Url,e.LSH)}}function se(o,n){1&o&&(e.TgZ(0,"td",42),e._uU(1,"X"),e.qZA(),e.TgZ(2,"td",42),e._uU(3,"X"),e.qZA())}function pe(o,n){if(1&o&&(e.ynx(0),e.YNc(1,le,10,10,"ng-container",36),e.YNc(2,se,4,0,"ng-template",null,37,e.W1O),e.BQk()),2&o){const t=n.$implicit,a=e.MAs(3),i=e.oxw().$implicit,c=e.oxw(2);e.xp6(1),e.Q6J("ngIf",c.getItemFromChannel(i,t.ID))("ngIfElse",a)}}function _e(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,ce,11,9,"ng-container",23),e.TgZ(2,"td",24),e._uU(3),e.qZA(),e.TgZ(4,"td",24)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",25)(8,"a",26),e._UZ(9,"i",27),e.qZA()()(),e.TgZ(10,"td",28)(11,"input",17),e.NdJ("ngModelChange",function(i){const r=e.CHM(t).$implicit;return e.KtG(r.selected=i)}),e.qZA()(),e.YNc(12,pe,4,2,"ng-container",18),e.qZA()}if(2&o){const t=n.$implicit,a=n.index,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",0==a),e.xp6(2),e.Oqu(null==t?null:t.Model),e.xp6(3),e.Oqu(null==t?null:t.Code),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(2),e.Q6J("hidden",null==i.searchFilter?null:i.searchFilter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",t.selected),e.xp6(1),e.Q6J("ngForOf",i.channelOptions)}}function he(o,n){if(1&o&&(e.TgZ(0,"tbody"),e.YNc(1,_e,13,7,"tr",18),e.qZA()),2&o){const t=n.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}class x{constructor(n,t,a,i,c){this.http=n,this.toastr=t,this.dialog=a,this.productService=i,this.biggerPictureService=c,this.searchFilter=new z.k,this.products=[],this.checkboxState=!1,this.initPageLoader(),this.filterTypeOptions=[{Key:d.v.ALL,Value:"All"},{Key:d.v.DIFFERENCE,Value:"Difference"}],this.filterType=d.v.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.hostName=i.getHostName()}initPageLoader(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.searchFilter.HiddenIPOSInventory=!1,this.onFilter()})}onSelectAllData(){this.products=this.products.map(n=>(n.Variants&&(n.Variants=n.Variants.map(t=>(t.selected=this.checkboxState,t))),n))}onFilter(n){this.http.post("/api/Price/GetOutletPrice",{text:n,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount}).subscribe(a=>{this.products=a.Data})}updatePrice(){let n=this.productService.selectedVariantProduct(this.products);if(n.length>0){let t=n.map(c=>c.ID),i={ListChannelID:this.channelOptions.filter(c=>c.selected).map(c=>c.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",i).subscribe({next:c=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+i.ListID.length+" items in "+i.ListChannelID.length+" channels","Success")},error:c=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(n=>(n.selected=!1,n))}getItemFromChannel(n,t){return n.Channel.find(a=>a.ChannelID==t)}onUpdateItems(){const n=this.productService.selectedVariantProduct(this.products);this.dialog.open(M.j,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe((0,h.h)(t=>_.g.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice()})}openTableDialog(n,t,a){let i=JSON.parse(JSON.stringify(n));this.dialog.open(L.k,{data:{Name:t.Name,Variant:i,ChannelID:a?.ChannelID,Table:"price",ChannelItemID:a?.ChannelItemID}}).afterClosed().pipe((0,h.h)(r=>_.g.IsNotEmpty(r))).subscribe(r=>{this.updateProductPrice(r,a)})}updateProductPrice(n,t){let a={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(i=>{t.Price=a.Price;const c=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) inventory in ${c.Name} to ${a.Price}`,"Success")})}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}}x.\u0275fac=function(n){return new(n||x)(e.Y36(v.O),e.Y36(Z._W),e.Y36(y.uw),e.Y36(F.M),e.Y36(Q.k))},x.\u0275cmp=e.Xpm({type:x,selectors:[["app-custom-channel-price"]],decls:31,vars:13,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"hidden"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle",3,"hidden"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(i){return t.onFilter(i)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Filter by"),e.qZA(),e.TgZ(6,"radio-options",2),e.NdJ("modelChange",function(i){return t.filterType=i}),e.qZA()()()(),e.TgZ(7,"actions")(8,"div",3),e.YNc(9,ee,3,0,"button",4),e.qZA()(),e.TgZ(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr"),e._UZ(18,"th",11),e.YNc(19,te,2,1,"th",12),e.qZA(),e.TgZ(20,"tr")(21,"th",13),e._uU(22,"Product"),e.qZA(),e.TgZ(23,"th",14),e._uU(24,"Variant"),e.qZA(),e.TgZ(25,"th",15),e._uU(26,"SKU"),e.qZA(),e.TgZ(27,"th",16)(28,"input",17),e.NdJ("ngModelChange",function(i){return t.checkboxState=i})("ngModelChange",function(){return t.onSelectAllData()}),e.qZA()(),e.YNc(29,ne,5,0,"ng-container",18),e.qZA()(),e.YNc(30,he,2,1,"tbody",18),e.qZA()()()()()()()),2&n&&(e.Q6J("pageData",t.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),e.xp6(6),e.Q6J("model",t.filterType)("options",t.filterTypeOptions)("border",!0),e.xp6(3),e.Q6J("ngIf",t.productService.hasSelectionVariant(t.products)),e.xp6(10),e.Q6J("ngForOf",t.channelOptions),e.xp6(8),e.Q6J("hidden",null==t.searchFilter?null:t.searchFilter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",t.checkboxState),e.xp6(1),e.Q6J("ngForOf",t.channelOptions),e.xp6(1),e.Q6J("ngForOf",t.products))},dependencies:[s.mk,s.sg,s.O5,p.Wl,p.JJ,p.On,I.p,g,s.JJ],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});var q=l(455),V=l(266);function de(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2).ngIf,c=e.oxw();return e.KtG(c.openScanDialog(i))}),e._UZ(1,"i",9),e._uU(2," Scan Channel "),e.qZA()}}function ge(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,c=e.oxw(2);return e.KtG(c.updateStock(i))}),e._UZ(1,"i",11),e._uU(2," Update "),e.qZA()}}function ue(o,n){if(1&o&&(e.TgZ(0,"actions")(1,"div",5)(2,"div"),e.YNc(3,de,3,0,"button",6),e.YNc(4,ge,3,0,"button",7),e.qZA()()()),2&o){const t=n.ngIf,a=e.oxw(2);e.xp6(3),e.Q6J("ngIf",!a.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",a.productService.hasSelectionVariant(t))}}function me(o,n){if(1&o&&(e.TgZ(0,"ng-option",32),e._UZ(1,"img",33),e._uU(2),e.qZA()),2&o){const t=n.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function Ce(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"input",53),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw(3).$implicit;return e.KtG(c.selected=i)})("ngModelChange",function(){e.CHM(t);const i=e.oxw(3).$implicit,c=e.oxw(3);return e.KtG(c.onCheckboxStateProduct(i))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.Q6J("ngModel",t.selected)}}function fe(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"img",54),e.NdJ("click",function(i){e.CHM(t);const c=e.oxw(3).$implicit,r=e.oxw(3);return e.KtG(r.onZoomImage(i,null==c?null:c.ImageUrl))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.s9C("src",t.ThumbnailUrl,e.LSH)}}function xe(o,n){1&o&&e._UZ(0,"img",55)}function Pe(o,n){if(1&o&&(e.ynx(0),e.TgZ(1,"td",46)(2,"div",47),e.YNc(3,Ce,1,1,"input",48),e.YNc(4,fe,1,1,"img",49),e.YNc(5,xe,1,0,"ng-template",null,50,e.W1O),e.qZA()(),e.TgZ(7,"td",51)(8,"span",52),e._uU(9),e.qZA(),e._UZ(10,"br"),e.TgZ(11,"small"),e._uU(12),e.qZA()(),e.BQk()),2&o){const t=e.MAs(6),a=e.oxw().$implicit,i=e.oxw().$implicit;e.xp6(1),e.Q6J("rowSpan",i.Variants.length),e.xp6(2),e.Q6J("ngIf",a.Inventory>=0||i.Variants.length>1),e.xp6(1),e.Q6J("ngIf",i.ThumbnailUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",i.Variants.length),e.xp6(2),e.Oqu(i.Name),e.xp6(3),e.hij("(",i.Category,")")}}function be(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"input",56),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw().$implicit;return e.KtG(c.selected=i)}),e.qZA()}if(2&o){const t=e.oxw().$implicit;e.Q6J("ngModel",t.selected)}}function Ie(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",57)(1,"div",58),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,c=e.oxw().$implicit,r=e.oxw(2).ngIf,b=e.oxw();return e.KtG(b.openTableDialog(i,c,r))}),e._uU(2),e.ALo(3,"number"),e.qZA()()}if(2&o){const t=e.oxw().$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t.Channel[0]?null:t.Channel[0].Price)," ")}}const Se=function(o){return{"bg-gradient-warning":o}};function Te(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,Pe,13,7,"ng-container",4),e.TgZ(2,"td",19),e._uU(3),e.qZA(),e.TgZ(4,"td",22)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",34)(8,"a",35),e._UZ(9,"i",36),e.qZA()()(),e.TgZ(10,"td",37),e.YNc(11,be,1,1,"input",38),e.qZA(),e.TgZ(12,"td",22),e._uU(13),e.ALo(14,"number"),e.qZA(),e.TgZ(15,"td",39),e.YNc(16,Ie,4,3,"div",40),e.qZA(),e.TgZ(17,"td")(18,"div",41)(19,"div",42)(20,"a",35),e._UZ(21,"i",43),e.qZA(),e._uU(22," \xa0\xa0 "),e.TgZ(23,"span",44),e.NdJ("click",function(){const c=e.CHM(t).$implicit,r=e.oxw(4);return e.KtG(r.refreshPrice(c))}),e._UZ(24,"i",45),e.qZA()()()()()}if(2&o){const t=n.$implicit,a=n.index,i=e.oxw(4);e.xp6(1),e.Q6J("ngIf",0==a),e.xp6(2),e.Oqu(t.Model),e.xp6(3),e.hij(" ",t.Code," "),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(3),e.Q6J("ngIf",t.Inventory>=0),e.xp6(2),e.hij(" ",e.lcZ(14,9,t.UnitPrice)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(11,Se,t.UnitPrice!=(null==t.Channel[0]?null:t.Channel[0].Price))),e.xp6(1),e.Q6J("ngIf",t.Channel.length>0),e.xp6(4),e.Q6J("href",null==t.Channel[0]?null:t.Channel[0].Url,e.LSH)}}function ve(o,n){if(1&o&&(e.ynx(0),e.YNc(1,Te,25,13,"tr",26),e.BQk()),2&o){const t=n.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}function Ze(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"span",59),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",60),e._uU(2,"?"),e.qZA()()}}function ye(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&o){const t=n.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Total))}}function Fe(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",64),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onNextPage())}),e._UZ(1,"i",65),e._uU(2," Next"),e.qZA()}}function we(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",66),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onLastPage())}),e._UZ(1,"i",67),e._uU(2," Last"),e.qZA()}}function Ae(o,n){if(1&o&&(e.TgZ(0,"div",61),e.YNc(1,Fe,3,0,"a",62),e.YNc(2,we,3,0,"a",63),e.qZA()),2&o){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function De(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),e._uU(7," Product "),e.TgZ(8,"div")(9,"mat-slide-toggle",17),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.toggleDifferentInventory=i)})("toggleChange",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onToggleDifferentInventory())}),e.TgZ(10,"small",18),e._uU(11,"FILTER DIFFERENT PRICE"),e.qZA()()()(),e.TgZ(12,"th",19),e._uU(13,"Variant"),e.qZA(),e.TgZ(14,"th",20),e._uU(15,"SKU"),e.qZA(),e.TgZ(16,"th")(17,"input",21),e.NdJ("change",function(i){const r=e.CHM(t).ngIf,b=e.oxw(2);return e.KtG(b.onSelectAllSKU(i.target.checked,r))}),e.qZA()(),e.TgZ(18,"th",22),e._uU(19,"POS"),e.qZA(),e.TgZ(20,"th")(21,"ng-select",23),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.searchFilter.ChannelID=i)})("change",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.search())}),e.YNc(22,me,3,3,"ng-option",24),e.qZA()(),e._UZ(23,"th",25),e.qZA()(),e.TgZ(24,"tbody"),e.YNc(25,ve,2,1,"ng-container",26),e.qZA()(),e.TgZ(26,"div",27)(27,"div",28)(28,"div",29),e._uU(29),e.ALo(30,"number"),e.YNc(31,Ze,3,0,"span",30),e.YNc(32,ye,3,3,"span",4),e.ALo(33,"async"),e._uU(34),e.qZA()(),e.YNc(35,Ae,3,2,"div",31),e.qZA()()()()}if(2&o){const t=n.ngIf,a=e.oxw().ngIf,i=e.oxw();e.xp6(9),e.Q6J("ngModel",i.toggleDifferentInventory),e.xp6(12),e.Q6J("clearable",!1)("ngModel",i.searchFilter.ChannelID),e.xp6(1),e.Q6J("ngForOf",a.Options.Channel),e.xp6(3),e.Q6J("ngForOf",t),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(30,10,null==t?null:t.length)," of "),e.xp6(2),e.Q6J("ngIf",i.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(33,12,!i.paginationService.hideCount&&i.allDataCount$)),e.xp6(2),e.hij(" records ~ ",i.paginationService.footerPageNumber," Page "),e.xp6(1),e.Q6J("ngIf",t.length>0)}}function Ne(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("textChange",function(i){e.CHM(t);const c=e.oxw();return e.KtG(c.searchFilter.text=i)})("onSubmit",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.search())}),e.TgZ(1,"filters")(2,"div",2)(3,"div")(4,"label"),e._uU(5,"Page Size"),e.qZA(),e.TgZ(6,"input",3),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw();return e.KtG(c.searchFilter.RowCount=i)}),e.qZA()()()(),e.YNc(7,ue,5,2,"actions",4),e.ALo(8,"async"),e.YNc(9,De,36,14,"content",4),e.ALo(10,"async"),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("headerTitle",t.pageTitle)("text",t.searchFilter.text),e.xp6(6),e.Q6J("ngModel",t.searchFilter.RowCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(8,5,t.paginationService.data$)),e.xp6(2),e.Q6J("ngIf",e.lcZ(10,7,t.paginationService.data$))}}class P{constructor(n,t,a,i,c,r){this.http=n,this.paginationService=t,this.toastr=a,this.dialog=i,this.productService=c,this.biggerPictureService=r,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.hostName=this.productService.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe((0,U.b)(n=>{this.searchFilter=n.Filter,this.searchFilter.filterModel=d.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}))}onToggleDifferentInventory(){this.searchFilter.filterModel=this.toggleDifferentInventory?d.v.ALL:d.v.DIFFERENCE,this.search()}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.selected=n.selected,t))}openScanDialog(n){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.g.GuidEMpty,this.dialog.open(J.j,{data:{filter:t,channelOptions:n.Options.Channel},width:"600px"}).afterClosed().pipe((0,h.h)(a=>_.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll(n)})}scanAll(n){const t=this.productService.findChannelById(this.searchFilter.ChannelID,n.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(a=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(),this.toastr.success(`Successfully scanned from ${t?.Name}`,"Success"))})}updateStock(n){let a=this.productService.selectedVariantProduct(n).map(c=>({ID:c.ID,ChannelID:c.Channel[0].ChannelID,Code:c.Code,Price:c.UnitPrice})),i={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",i).subscribe(()=>{this.search(),this.toastr.success(`Successfully updated ${i.ListPrice.length} variants in ${i.ListChannelID.length} channels`,"Success")})}refreshPrice(n){this.http.post("/api/Price/RefreshPriceChannel",{ChannelItemID:n?.Channel[0].ChannelItemID,ChannelVariationID:n?.Channel[0]?.ChannelVariationID,ChannelID:n?.Channel[0]?.ChannelID,VariantID:n.ID}).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.search()})}search(){this.paginationService.resetToFirstPage(this.searchFilter)}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:n=>{this.paginationService.getAllData(this.searchFilter,n.Total)}})}openTableDialog(n,t,a){let i=JSON.parse(JSON.stringify(n));this.dialog.open(L.k,{data:{Name:t.Name,Variant:i,ChannelID:i?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:i?.Channel[0]?.ChannelItemID}}).afterClosed().pipe((0,h.h)(r=>_.g.IsNotEmpty(r))).subscribe(r=>{this.updateItemAfterDialog(r,a,n)})}updateItemAfterDialog(n,t,a){let i={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(c=>{const r=this.productService.findChannelById(i.ID,t.Options.Channel);this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) inventory in ${r.Name} to ${i.Price}`,"Success"),a.Channel[0]&&(a.Channel[0].Price=i.Price)})}onSelectAllSKU(n,t){t=t.map(a=>(a.Variants=a.Variants.map(i=>(i.selected=n,i)),a))}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}ngOnDestroy(){this.paginationService.destroy()}}P.\u0275fac=function(n){return new(n||P)(e.Y36(v.O),e.Y36(O.b),e.Y36(Z._W),e.Y36(y.uw),e.Y36(F.M),e.Y36(Q.k))},P.\u0275cmp=e.Xpm({type:P,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[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,"ngModel","ngModelChange","toggleChange"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],["type","checkbox",1,"me-3",3,"change"],[1,"text-end"],["name","channelOption",3,"clearable","ngModel","ngModelChange","change"],[3,"value",4,"ngFor","ngForOf"],[2,"width","4%"],[4,"ngFor","ngForOf"],[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"],["class","btn-group",4,"ngIf"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-external-link-alt"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"text-end",3,"ngClass"],["class","row justify-content-end me-0",4,"ngIf"],[1,"row"],[1,"col-12","ps-0","d-flex","justify-content-between"],[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"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"row","justify-content-end","me-0"],[1,"col-8","ps-0","pe-12","text-end",2,"cursor","pointer",3,"click"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[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"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,t){1&n&&(e.YNc(0,Ne,11,9,"mainpanel",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,t.loader$))},dependencies:[s.mk,s.sg,s.O5,p.Fj,p.wV,p.Wl,p.JJ,p.On,I.p,T.w9,T.jq,q.Rr,V.gM,s.Ov,s.JJ],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}"]});var A=l(8063);const Je=[{path:"",component:C,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:f,canActivate:[A.a],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:x,canActivate:[A.a],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:P,canActivate:[A.a],data:{title:"Price Single Channel Comparison"}}]}];class u{}u.\u0275fac=function(n){return new(n||u)},u.\u0275mod=e.oAB({type:u}),u.\u0275inj=e.cJS({imports:[s.ez,S.Bz.forChild(Je)]});var Me=l(6709);class m{}m.\u0275fac=function(n){return new(n||m)},m.\u0275mod=e.oAB({type:m}),m.\u0275inj=e.cJS({imports:[s.ez,p.u5,N.Z,I.R,S.Bz,T.A0,u,p.UX,q.rP,Me.p9,V.AV,g,k.a]})}}]);
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[874],{1874:(Oe,D,l)=>{l.r(D),l.d(D,{PriceModule:()=>m});var s=l(6895),N=l(2937),I=l(7481),S=l(284),p=l(4006),T=l(8796),e=l(4650);class C{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}}C.\u0275fac=function(n){return new(n||C)},C.\u0275cmp=e.Xpm({type:C,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,t){1&n&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&n&&(e.xp6(3),e.Q6J("Tabs",t.priceTabs))},dependencies:[N.e,S.lC]});var J=l(8231),M=l(6304),U=l(8505),h=l(9300),_=l(1889),v=l(1318),Z=l(7185),y=l(5412),O=l(9425),F=l(6082),k=l(6114);function E(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",16),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.openScanDialog())}),e._UZ(1,"i",17),e._uU(2," Scan Channel "),e.qZA()}}function $(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,c=e.oxw(2);return e.KtG(c.onUpdateItems(i))}),e._UZ(1,"i",19),e._uU(2," Update "),e.qZA()}}function Y(o,n){if(1&o&&(e.TgZ(0,"div"),e.YNc(1,E,3,0,"button",14),e.YNc(2,$,3,0,"button",15),e.qZA()),2&o){const t=n.ngIf,a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!a.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",a.productService.hasSelectionVariant(t))}}function K(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",20)(1,"app-table",21),e.NdJ("onToggle",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.onShowDifferencePrice(i))})("onSubmit",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.updatePriceByVariant(i))}),e.ALo(2,"async"),e.qZA()()}if(2&o){const t=e.oxw().ngIf,a=e.oxw();e.xp6(1),e.Q6J("showProductToggle",!0)("data",e.lcZ(2,4,a.paginationService.data$))("channel",t.Options.Channel)("filter",t.Filter)}}function H(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",23),e._uU(2,"?"),e.qZA()()}}function R(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&o){const t=n.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t))}}function G(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",24),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onNextPage())}),e._UZ(1,"i",25),e._uU(2," Next"),e.qZA()}}function B(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",26),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onLastPage())}),e._UZ(1,"i",27),e._uU(2," Last"),e.qZA()}}function j(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("onSubmit",function(i){e.CHM(t);const c=e.oxw();return e.KtG(c.onSearch(i))}),e.TgZ(1,"actions")(2,"div",2),e.YNc(3,Y,3,2,"div",3),e.ALo(4,"async"),e.qZA()(),e.TgZ(5,"content")(6,"div",4)(7,"div",5),e.YNc(8,K,3,6,"div",6),e.ALo(9,"async"),e.qZA(),e.TgZ(10,"div",7)(11,"div",8)(12,"div",9),e._uU(13),e.ALo(14,"number"),e.ALo(15,"async"),e.YNc(16,H,3,0,"span",10),e.YNc(17,R,3,3,"span",3),e.ALo(18,"async"),e._uU(19),e.qZA()(),e.TgZ(20,"div",11),e.YNc(21,G,3,0,"a",12),e.YNc(22,B,3,0,"a",13),e.qZA()()()()()}if(2&o){const t=e.oxw();let a;e.Q6J("pageData",t.pageData)("hideSearchDropdown",!0)("textButton","Search"),e.xp6(3),e.Q6J("ngIf",e.lcZ(4,11,t.paginationService.data$)),e.xp6(5),e.Q6J("ngIf",e.lcZ(9,13,t.paginationService.data$)),e.xp6(5),e.hij(" Showing 1 - ",e.lcZ(14,15,null==(a=e.lcZ(15,17,t.paginationService.data$))?null:a.length)," of "),e.xp6(3),e.Q6J("ngIf",t.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",!t.paginationService.hideCount&&e.lcZ(18,19,t.allDataCount$)),e.xp6(2),e.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),e.xp6(2),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}class f{constructor(n,t,a,i,c){this.http=n,this.toastr=t,this.dialog=a,this.paginationService=i,this.productService=c,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe((0,U.b)(n=>{this.channelOptions=n.Options.Channel,n.Filter={PageNumber:n.Filter.PageNumber,RowCount:n.Filter.RowCount,filterModel:1},this.searchFilter=n.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onShowDifferencePrice(n){this.searchFilter.filterModel=1,n&&(this.searchFilter.filterModel=3),this.paginationService.resetToFirstPage(this.searchFilter)}onSearch(n){this.searchFilter.text=n,this.paginationService.resetToFirstPage(this.searchFilter)}openScanDialog(){this.searchFilter.ChannelID=_.g.GuidEMpty;let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(J.j,{data:{filter:n,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,h.h)(a=>_.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{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{let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.initPageLoader(),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)}})}updatePrice(n){let t=this.productService.selectedVariantProduct(n);if(t.length>0){let i=t.map(r=>({ID:r.ID,Code:r.Code,Price:r.UnitPrice})),c={ListChannelID:this.channelOptions.filter(r=>r.selected).map(r=>r.ID),ListPrice:i};this.http.post("/api/Price/UpdateChannel",c).subscribe(r=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+c.ListPrice.length+" items in "+c.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(n){let t={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:n.Price-0,VariantID:n.ID};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(a=>{let i=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+n.ItemName+"("+n.VarName+") price in "+i.Name+" to "+t.Price,"Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onUpdateItems(n){const t=this.productService.selectedVariantProduct(n);this.dialog.open(M.j,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe((0,h.h)(a=>void 0!==a)).subscribe(a=>{this.channelOptions=a,this.updatePrice(n)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:n=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,n)}})}ngOnDestroy(){this.paginationService.destroy()}}f.\u0275fac=function(n){return new(n||f)(e.Y36(v.O),e.Y36(Z._W),e.Y36(y.uw),e.Y36(O.b),e.Y36(F.M))},f.\u0275cmp=e.Xpm({type:f,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","hideSearchDropdown","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[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"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,t){1&n&&(e.YNc(0,j,23,21,"mainpanel",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,t.loader$))},dependencies:[s.O5,I.p,k.a,s.Ov,s.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});var d=l(8705),L=l(7945),z=l(1290),Q=l(1739),w=l(1948);function W(o,n){if(1&o&&(e.TgZ(0,"mat-radio-button",3),e._uU(1),e.qZA()),2&o){const t=n.$implicit,a=n.index,i=e.oxw();e.Q6J("value",t.Key)("name",i.name)("title",i.tooltipsText[a]?i.tooltipsText[a]:""),e.xp6(1),e.hij(" ",t.Value,"")}}const X=function(o){return{"border-0 rounded":o}};class g{constructor(){this.modelChange=new e.vpe,this.border=!1,this.tooltipsText=[]}change(n){this.modelChange.emit(n)}}function ee(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",19),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onUpdateItems())}),e._UZ(1,"i",20),e._uU(2," Update "),e.qZA()}}function te(o,n){if(1&o&&(e.TgZ(0,"th",21),e._uU(1),e.qZA()),2&o){const t=n.$implicit;e.xp6(1),e.Oqu(t.Name)}}function ne(o,n){1&o&&(e.ynx(0),e.TgZ(1,"th",22),e._uU(2," Expected (POS) "),e.qZA(),e.TgZ(3,"th",22),e._uU(4," Channel "),e.qZA(),e.BQk())}function ie(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"img",34),e.NdJ("click",function(i){e.CHM(t);const c=e.oxw(3).$implicit,r=e.oxw();return e.KtG(r.onZoomImage(i,null==c?null:c.ImageUrl))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.s9C("src",null==t?null:t.ImageUrl,e.LSH)}}function oe(o,n){1&o&&e._UZ(0,"img",35)}g.\u0275fac=function(n){return new(n||g)},g.\u0275cmp=e.Xpm({type:g,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[e.jDz],decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0)(1,"mat-radio-group",1),e.NdJ("ngModelChange",function(i){return t.change(i)}),e.YNc(2,W,2,4,"mat-radio-button",2),e.qZA()()),2&n&&(e.Q6J("ngClass",e.VKq(3,X,0==t.border)),e.xp6(1),e.Q6J("ngModel",t.model),e.xp6(1),e.Q6J("ngForOf",t.options))},dependencies:[s.ez,s.mk,s.sg,w.Fk,w.VQ,w.U0,p.u5,p.JJ,p.On],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});const ae=function(o){return{"border-bottom":o}};function ce(o,n){if(1&o&&(e.ynx(0),e.TgZ(1,"td",29),e.YNc(2,ie,1,1,"img",30),e.YNc(3,oe,1,0,"ng-template",null,31,e.W1O),e.qZA(),e.TgZ(5,"td",32)(6,"h5",33),e._uU(7),e.qZA(),e._UZ(8,"br"),e.TgZ(9,"small"),e._uU(10),e.qZA()(),e.BQk()),2&o){const t=e.MAs(4),a=e.oxw().index,i=e.oxw().$implicit,c=e.oxw();e.xp6(1),e.Q6J("rowSpan",null==i?null:i.Variants.length)("ngClass",e.VKq(7,ae,a+1==c.products.length)),e.xp6(1),e.Q6J("ngIf",null==i?null:i.ImageUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",null==i?null:i.Variants.length),e.xp6(2),e.Oqu(null==i?null:i.Name),e.xp6(3),e.hij("(",null==i?null:i.Category,")")}}const re=function(o){return{"bg-gradient-warning":o}};function le(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"td",38),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"td",39),e.NdJ("click",function(){const c=e.CHM(t).$implicit,r=e.oxw(2).$implicit,b=e.oxw().$implicit,Ue=e.oxw();return e.KtG(Ue.openTableDialog(r,b,c))}),e.TgZ(5,"span",40),e._uU(6),e.ALo(7,"number"),e.qZA(),e.TgZ(8,"a",41),e.NdJ("click",function(i){return null==i?null:i.stopPropagation()}),e._UZ(9,"i",27),e.qZA()(),e.BQk()}if(2&o){const t=n.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,4,t.PriceExpected)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(8,re,t.Price!=t.PriceExpected)),e.xp6(2),e.hij(" ",e.lcZ(7,6,t.Price)," "),e.xp6(2),e.Q6J("href",t.Url,e.LSH)}}function se(o,n){1&o&&(e.TgZ(0,"td",42),e._uU(1,"X"),e.qZA(),e.TgZ(2,"td",42),e._uU(3,"X"),e.qZA())}function pe(o,n){if(1&o&&(e.ynx(0),e.YNc(1,le,10,10,"ng-container",36),e.YNc(2,se,4,0,"ng-template",null,37,e.W1O),e.BQk()),2&o){const t=n.$implicit,a=e.MAs(3),i=e.oxw().$implicit,c=e.oxw(2);e.xp6(1),e.Q6J("ngIf",c.getItemFromChannel(i,t.ID))("ngIfElse",a)}}function _e(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,ce,11,9,"ng-container",23),e.TgZ(2,"td",24),e._uU(3),e.qZA(),e.TgZ(4,"td",24)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",25)(8,"a",26),e._UZ(9,"i",27),e.qZA()()(),e.TgZ(10,"td",28)(11,"input",17),e.NdJ("ngModelChange",function(i){const r=e.CHM(t).$implicit;return e.KtG(r.selected=i)}),e.qZA()(),e.YNc(12,pe,4,2,"ng-container",18),e.qZA()}if(2&o){const t=n.$implicit,a=n.index,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",0==a),e.xp6(2),e.Oqu(null==t?null:t.Model),e.xp6(3),e.Oqu(null==t?null:t.Code),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(2),e.Q6J("hidden",null==i.searchFilter?null:i.searchFilter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",t.selected),e.xp6(1),e.Q6J("ngForOf",i.channelOptions)}}function he(o,n){if(1&o&&(e.TgZ(0,"tbody"),e.YNc(1,_e,13,7,"tr",18),e.qZA()),2&o){const t=n.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}class x{constructor(n,t,a,i,c){this.http=n,this.toastr=t,this.dialog=a,this.productService=i,this.biggerPictureService=c,this.searchFilter=new z.k,this.products=[],this.checkboxState=!1,this.initPageLoader(),this.filterTypeOptions=[{Key:d.v.ALL,Value:"All"},{Key:d.v.DIFFERENCE,Value:"Difference"}],this.filterType=d.v.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.hostName=i.getHostName()}initPageLoader(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.searchFilter.HiddenIPOSInventory=!1,this.onFilter()})}onSelectAllData(){this.products=this.products.map(n=>(n.Variants&&(n.Variants=n.Variants.map(t=>(t.selected=this.checkboxState,t))),n))}onFilter(n){this.http.post("/api/Price/GetOutletPrice",{text:n,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount}).subscribe(a=>{this.products=a.Data})}updatePrice(){let n=this.productService.selectedVariantProduct(this.products);if(n.length>0){let t=n.map(c=>c.ID),i={ListChannelID:this.channelOptions.filter(c=>c.selected).map(c=>c.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",i).subscribe({next:c=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+i.ListID.length+" items in "+i.ListChannelID.length+" channels","Success")},error:c=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(n=>(n.selected=!1,n))}getItemFromChannel(n,t){return n.Channel.find(a=>a.ChannelID==t)}onUpdateItems(){const n=this.productService.selectedVariantProduct(this.products);this.dialog.open(M.j,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe((0,h.h)(t=>_.g.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice()})}openTableDialog(n,t,a){let i=JSON.parse(JSON.stringify(n));this.dialog.open(L.k,{data:{Name:t.Name,Variant:i,ChannelID:a?.ChannelID,Table:"price",ChannelItemID:a?.ChannelItemID}}).afterClosed().pipe((0,h.h)(r=>_.g.IsNotEmpty(r))).subscribe(r=>{this.updateProductPrice(r,a)})}updateProductPrice(n,t){let a={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(i=>{t.Price=a.Price;const c=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) inventory in ${c.Name} to ${a.Price}`,"Success")})}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}}x.\u0275fac=function(n){return new(n||x)(e.Y36(v.O),e.Y36(Z._W),e.Y36(y.uw),e.Y36(F.M),e.Y36(Q.k))},x.\u0275cmp=e.Xpm({type:x,selectors:[["app-custom-channel-price"]],decls:31,vars:13,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"hidden"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle",3,"hidden"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(i){return t.onFilter(i)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Filter by"),e.qZA(),e.TgZ(6,"radio-options",2),e.NdJ("modelChange",function(i){return t.filterType=i}),e.qZA()()()(),e.TgZ(7,"actions")(8,"div",3),e.YNc(9,ee,3,0,"button",4),e.qZA()(),e.TgZ(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr"),e._UZ(18,"th",11),e.YNc(19,te,2,1,"th",12),e.qZA(),e.TgZ(20,"tr")(21,"th",13),e._uU(22,"Product"),e.qZA(),e.TgZ(23,"th",14),e._uU(24,"Variant"),e.qZA(),e.TgZ(25,"th",15),e._uU(26,"SKU"),e.qZA(),e.TgZ(27,"th",16)(28,"input",17),e.NdJ("ngModelChange",function(i){return t.checkboxState=i})("ngModelChange",function(){return t.onSelectAllData()}),e.qZA()(),e.YNc(29,ne,5,0,"ng-container",18),e.qZA()(),e.YNc(30,he,2,1,"tbody",18),e.qZA()()()()()()()),2&n&&(e.Q6J("pageData",t.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),e.xp6(6),e.Q6J("model",t.filterType)("options",t.filterTypeOptions)("border",!0),e.xp6(3),e.Q6J("ngIf",t.productService.hasSelectionVariant(t.products)),e.xp6(10),e.Q6J("ngForOf",t.channelOptions),e.xp6(8),e.Q6J("hidden",null==t.searchFilter?null:t.searchFilter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",t.checkboxState),e.xp6(1),e.Q6J("ngForOf",t.channelOptions),e.xp6(1),e.Q6J("ngForOf",t.products))},dependencies:[s.mk,s.sg,s.O5,p.Wl,p.JJ,p.On,I.p,g,s.JJ],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});var q=l(455),V=l(266);function de(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2).ngIf,c=e.oxw();return e.KtG(c.openScanDialog(i))}),e._UZ(1,"i",9),e._uU(2," Scan Channel "),e.qZA()}}function ge(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,c=e.oxw(2);return e.KtG(c.updateStock(i))}),e._UZ(1,"i",11),e._uU(2," Update "),e.qZA()}}function ue(o,n){if(1&o&&(e.TgZ(0,"actions")(1,"div",5)(2,"div"),e.YNc(3,de,3,0,"button",6),e.YNc(4,ge,3,0,"button",7),e.qZA()()()),2&o){const t=n.ngIf,a=e.oxw(2);e.xp6(3),e.Q6J("ngIf",!a.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",a.productService.hasSelectionVariant(t))}}function me(o,n){if(1&o&&(e.TgZ(0,"ng-option",32),e._UZ(1,"img",33),e._uU(2),e.qZA()),2&o){const t=n.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function Ce(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"input",53),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw(3).$implicit;return e.KtG(c.selected=i)})("ngModelChange",function(){e.CHM(t);const i=e.oxw(3).$implicit,c=e.oxw(3);return e.KtG(c.onCheckboxStateProduct(i))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.Q6J("ngModel",t.selected)}}function fe(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"img",54),e.NdJ("click",function(i){e.CHM(t);const c=e.oxw(3).$implicit,r=e.oxw(3);return e.KtG(r.onZoomImage(i,null==c?null:c.ImageUrl))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.s9C("src",t.ThumbnailUrl,e.LSH)}}function xe(o,n){1&o&&e._UZ(0,"img",55)}function Pe(o,n){if(1&o&&(e.ynx(0),e.TgZ(1,"td",46)(2,"div",47),e.YNc(3,Ce,1,1,"input",48),e.YNc(4,fe,1,1,"img",49),e.YNc(5,xe,1,0,"ng-template",null,50,e.W1O),e.qZA()(),e.TgZ(7,"td",51)(8,"span",52),e._uU(9),e.qZA(),e._UZ(10,"br"),e.TgZ(11,"small"),e._uU(12),e.qZA()(),e.BQk()),2&o){const t=e.MAs(6),a=e.oxw().$implicit,i=e.oxw().$implicit;e.xp6(1),e.Q6J("rowSpan",i.Variants.length),e.xp6(2),e.Q6J("ngIf",a.Inventory>=0||i.Variants.length>1),e.xp6(1),e.Q6J("ngIf",i.ThumbnailUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",i.Variants.length),e.xp6(2),e.Oqu(i.Name),e.xp6(3),e.hij("(",i.Category,")")}}function be(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"input",56),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw().$implicit;return e.KtG(c.selected=i)}),e.qZA()}if(2&o){const t=e.oxw().$implicit;e.Q6J("ngModel",t.selected)}}function Ie(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",57)(1,"div",58),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,c=e.oxw().$implicit,r=e.oxw(2).ngIf,b=e.oxw();return e.KtG(b.openTableDialog(i,c,r))}),e._uU(2),e.ALo(3,"number"),e.qZA()()}if(2&o){const t=e.oxw().$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t.Channel[0]?null:t.Channel[0].Price)," ")}}const Se=function(o){return{"bg-gradient-warning":o}};function Te(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,Pe,13,7,"ng-container",4),e.TgZ(2,"td",19),e._uU(3),e.qZA(),e.TgZ(4,"td",22)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",34)(8,"a",35),e._UZ(9,"i",36),e.qZA()()(),e.TgZ(10,"td",37),e.YNc(11,be,1,1,"input",38),e.qZA(),e.TgZ(12,"td",22),e._uU(13),e.ALo(14,"number"),e.qZA(),e.TgZ(15,"td",39),e.YNc(16,Ie,4,3,"div",40),e.qZA(),e.TgZ(17,"td")(18,"div",41)(19,"div",42)(20,"a",35),e._UZ(21,"i",43),e.qZA(),e._uU(22," \xa0\xa0 "),e.TgZ(23,"span",44),e.NdJ("click",function(){const c=e.CHM(t).$implicit,r=e.oxw(4);return e.KtG(r.refreshPrice(c))}),e._UZ(24,"i",45),e.qZA()()()()()}if(2&o){const t=n.$implicit,a=n.index,i=e.oxw(4);e.xp6(1),e.Q6J("ngIf",0==a),e.xp6(2),e.Oqu(t.Model),e.xp6(3),e.hij(" ",t.Code," "),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(3),e.Q6J("ngIf",t.Inventory>=0),e.xp6(2),e.hij(" ",e.lcZ(14,9,t.UnitPrice)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(11,Se,t.UnitPrice!=(null==t.Channel[0]?null:t.Channel[0].Price))),e.xp6(1),e.Q6J("ngIf",t.Channel.length>0),e.xp6(4),e.Q6J("href",null==t.Channel[0]?null:t.Channel[0].Url,e.LSH)}}function ve(o,n){if(1&o&&(e.ynx(0),e.YNc(1,Te,25,13,"tr",26),e.BQk()),2&o){const t=n.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}function Ze(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"span",59),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",60),e._uU(2,"?"),e.qZA()()}}function ye(o,n){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&o){const t=n.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Total))}}function Fe(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",64),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onNextPage())}),e._UZ(1,"i",65),e._uU(2," Next"),e.qZA()}}function we(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",66),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onLastPage())}),e._UZ(1,"i",67),e._uU(2," Last"),e.qZA()}}function Ae(o,n){if(1&o&&(e.TgZ(0,"div",61),e.YNc(1,Fe,3,0,"a",62),e.YNc(2,we,3,0,"a",63),e.qZA()),2&o){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function De(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),e._uU(7," Product "),e.TgZ(8,"div")(9,"mat-slide-toggle",17),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.toggleDifferentInventory=i)})("toggleChange",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onToggleDifferentInventory())}),e.TgZ(10,"small",18),e._uU(11,"FILTER DIFFERENT PRICE"),e.qZA()()()(),e.TgZ(12,"th",19),e._uU(13,"Variant"),e.qZA(),e.TgZ(14,"th",20),e._uU(15,"SKU"),e.qZA(),e.TgZ(16,"th")(17,"input",21),e.NdJ("change",function(i){const r=e.CHM(t).ngIf,b=e.oxw(2);return e.KtG(b.onSelectAllSKU(i.target.checked,r))}),e.qZA()(),e.TgZ(18,"th",22),e._uU(19,"POS"),e.qZA(),e.TgZ(20,"th")(21,"ng-select",23),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw(2);return e.KtG(c.searchFilter.ChannelID=i)})("change",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.search())}),e.YNc(22,me,3,3,"ng-option",24),e.qZA()(),e._UZ(23,"th",25),e.qZA()(),e.TgZ(24,"tbody"),e.YNc(25,ve,2,1,"ng-container",26),e.qZA()(),e.TgZ(26,"div",27)(27,"div",28)(28,"div",29),e._uU(29),e.ALo(30,"number"),e.YNc(31,Ze,3,0,"span",30),e.YNc(32,ye,3,3,"span",4),e.ALo(33,"async"),e._uU(34),e.qZA()(),e.YNc(35,Ae,3,2,"div",31),e.qZA()()()()}if(2&o){const t=n.ngIf,a=e.oxw().ngIf,i=e.oxw();e.xp6(9),e.Q6J("ngModel",i.toggleDifferentInventory),e.xp6(12),e.Q6J("clearable",!1)("ngModel",i.searchFilter.ChannelID),e.xp6(1),e.Q6J("ngForOf",a.Options.Channel),e.xp6(3),e.Q6J("ngForOf",t),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(30,10,null==t?null:t.length)," of "),e.xp6(2),e.Q6J("ngIf",i.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(33,12,!i.paginationService.hideCount&&i.allDataCount$)),e.xp6(2),e.hij(" records ~ ",i.paginationService.footerPageNumber," Page "),e.xp6(1),e.Q6J("ngIf",t.length>0)}}function Ne(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("textChange",function(i){e.CHM(t);const c=e.oxw();return e.KtG(c.searchFilter.text=i)})("onSubmit",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.search())}),e.TgZ(1,"filters")(2,"div",2)(3,"div")(4,"label"),e._uU(5,"Page Size"),e.qZA(),e.TgZ(6,"input",3),e.NdJ("ngModelChange",function(i){e.CHM(t);const c=e.oxw();return e.KtG(c.searchFilter.RowCount=i)}),e.qZA()()()(),e.YNc(7,ue,5,2,"actions",4),e.ALo(8,"async"),e.YNc(9,De,36,14,"content",4),e.ALo(10,"async"),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("headerTitle",t.pageTitle)("text",t.searchFilter.text),e.xp6(6),e.Q6J("ngModel",t.searchFilter.RowCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(8,5,t.paginationService.data$)),e.xp6(2),e.Q6J("ngIf",e.lcZ(10,7,t.paginationService.data$))}}class P{constructor(n,t,a,i,c,r){this.http=n,this.paginationService=t,this.toastr=a,this.dialog=i,this.productService=c,this.biggerPictureService=r,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.hostName=this.productService.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe((0,U.b)(n=>{this.searchFilter=n.Filter,this.searchFilter.filterModel=d.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}))}onToggleDifferentInventory(){this.searchFilter.filterModel=this.toggleDifferentInventory?d.v.ALL:d.v.DIFFERENCE,this.search()}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.selected=n.selected,t))}openScanDialog(n){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.g.GuidEMpty,this.dialog.open(J.j,{data:{filter:t,channelOptions:n.Options.Channel},width:"600px"}).afterClosed().pipe((0,h.h)(a=>_.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll(n)})}scanAll(n){const t=this.productService.findChannelById(this.searchFilter.ChannelID,n.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(a=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(),this.toastr.success(`Successfully scanned from ${t?.Name}`,"Success"))})}updateStock(n){let a=this.productService.selectedVariantProduct(n).map(c=>({ID:c.ID,ChannelID:c.Channel[0].ChannelID,Code:c.Code,Price:c.UnitPrice})),i={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",i).subscribe(()=>{this.search(),this.toastr.success(`Successfully updated ${i.ListPrice.length} variants in ${i.ListChannelID.length} channels`,"Success")})}refreshPrice(n){this.http.post("/api/Price/RefreshPriceChannel",{ChannelItemID:n?.Channel[0].ChannelItemID,ChannelVariationID:n?.Channel[0]?.ChannelVariationID,ChannelID:n?.Channel[0]?.ChannelID,VariantID:n.ID}).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.search()})}search(){this.paginationService.resetToFirstPage(this.searchFilter)}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:n=>{this.paginationService.getAllData(this.searchFilter,n.Total)}})}openTableDialog(n,t,a){let i=JSON.parse(JSON.stringify(n));this.dialog.open(L.k,{data:{Name:t.Name,Variant:i,ChannelID:i?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:i?.Channel[0]?.ChannelItemID}}).afterClosed().pipe((0,h.h)(r=>_.g.IsNotEmpty(r))).subscribe(r=>{this.updateItemAfterDialog(r,a,n)})}updateItemAfterDialog(n,t,a){let i={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(c=>{const r=this.productService.findChannelById(i.ID,t.Options.Channel);this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) inventory in ${r.Name} to ${i.Price}`,"Success"),a.Channel[0]&&(a.Channel[0].Price=i.Price)})}onSelectAllSKU(n,t){t=t.map(a=>(a.Variants=a.Variants.map(i=>(i.selected=n,i)),a))}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}ngOnDestroy(){this.paginationService.destroy()}}P.\u0275fac=function(n){return new(n||P)(e.Y36(v.O),e.Y36(O.b),e.Y36(Z._W),e.Y36(y.uw),e.Y36(F.M),e.Y36(Q.k))},P.\u0275cmp=e.Xpm({type:P,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[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,"ngModel","ngModelChange","toggleChange"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],["type","checkbox",1,"me-3",3,"change"],[1,"text-end"],["name","channelOption",3,"clearable","ngModel","ngModelChange","change"],[3,"value",4,"ngFor","ngForOf"],[2,"width","4%"],[4,"ngFor","ngForOf"],[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"],["class","btn-group",4,"ngIf"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-external-link-alt"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"text-end",3,"ngClass"],["class","row justify-content-end me-0",4,"ngIf"],[1,"row"],[1,"col-12","ps-0","d-flex","justify-content-between"],[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"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"row","justify-content-end","me-0"],[1,"col-8","ps-0","pe-12","text-end",2,"cursor","pointer",3,"click"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[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"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,t){1&n&&(e.YNc(0,Ne,11,9,"mainpanel",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,t.loader$))},dependencies:[s.mk,s.sg,s.O5,p.Fj,p.wV,p.Wl,p.JJ,p.On,I.p,T.w9,T.jq,q.Rr,V.gM,s.Ov,s.JJ],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}"]});var A=l(8063);const Je=[{path:"",component:C,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:f,canActivate:[A.a],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:x,canActivate:[A.a],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:P,canActivate:[A.a],data:{title:"Price Single Channel Comparison"}}]}];class u{}u.\u0275fac=function(n){return new(n||u)},u.\u0275mod=e.oAB({type:u}),u.\u0275inj=e.cJS({imports:[s.ez,S.Bz.forChild(Je)]});var Me=l(6709);class m{}m.\u0275fac=function(n){return new(n||m)},m.\u0275mod=e.oAB({type:m}),m.\u0275inj=e.cJS({imports:[s.ez,p.u5,N.Z,I.R,S.Bz,T.A0,u,p.UX,q.rP,Me.p9,V.AV,g,k.a]})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[877],{5877:(de,N,l)=>{l.r(N),l.d(N,{LogsModule:()=>T});var r=l(6895),e=l(4650),d=l(284),I=l(2937);class f{constructor(){this.ObjectlogTabs=[{Title:"Sync Orders",Url:"/menu/log/order"},{Title:"Inventory Log ",Url:"/menu/log/inventory"},{Title:"Marketplace Webhook ",Url:"/menu/log/rawlog"},{Title:"Application Exception ",Url:"/menu/log/exception"},{Title:"Order Logs ",Url:"/menu/log/order-log"}]}ngOnInit(){}}f.\u0275fac=function(n){return new(n||f)},f.\u0275cmp=e.Xpm({type:f,selectors:[["app-logs"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,t){1&n&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&n&&(e.xp6(3),e.Q6J("Tabs",t.ObjectlogTabs))},dependencies:[d.lC,I.e]});var u=l(8063),c=l(1318);class p{constructor(){}get Data(){return this._Data}set Data(n){this._Data=n}Fill(n){return this._Data.find(t=>t._id==n)}}p.\u0275fac=function(n){return new(n||p)},p.\u0275prov=e.Yz7({token:p,factory:p.\u0275fac,providedIn:"root"});var s=l(4006),g=l(7481),_=l(8739),Z=l(8796),v=l(5585);function w(o,n){1&o&&(e.TgZ(0,"th",16),e._uU(1,"Process Code"),e.qZA())}const S=function(o,n){return{"bg-warning":o,"bg-success":n}};function x(o,n){if(1&o&&(e.TgZ(0,"td",16)(1,"span",21),e._uU(2),e.qZA()()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngClass",e.WLB(2,S,null!=t.ProcessedCode&&200!==t.ProcessedCode,null!=t.ProcessedCode&&200===t.ProcessedCode)),e.xp6(1),e.Oqu(t.ProcessedCode)}}const R=function(){return["/menu/log/order/detail"]},D=function(o){return{ID:o}};function J(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",20),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td",16)(12,"span",21),e._uU(13),e.qZA()(),e.YNc(14,x,3,5,"td",17),e.qZA()),2&o){const t=n.$implicit,a=e.oxw();e.xp6(2),e.Q6J("routerLink",e.DdM(12,R))("queryParams",e.VKq(13,D,t.ID)),e.xp6(1),e.hij(" ",e.xi3(4,9,t.Created,"dd MMM yyyy HH:mm:ss")," "),e.xp6(3),e.Oqu(t.MarketTypeString),e.xp6(2),e.Oqu(t.POSActionTypeString),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Q6J("ngClass",e.WLB(15,S,200!==t.ResponseCode,200===t.ResponseCode)),e.xp6(1),e.Oqu(t.ResponseCode),e.xp6(1),e.Q6J("ngIf",a.processedCodeVisible)}}class b{constructor(n,t,a){this.http=n,this._RawLogService=t,this.route=a,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",ProcessedCode:""},this.processedCodeVisible=!1}ngOnInit(){this.route.queryParams.subscribe(n=>{this.responseCode=n.responseCode,null!=this.responseCode?this.Load(n):this.Load()})}Load(n={}){this.http.post("/api/OrdersLoader/Get",n).subscribe(t=>{this.filter=t.Filter,this.Channel=t.Options.Channel,this.ActionTypeList=t.Options.ActionTypeList,this.Get()})}Get(n){this.filter.Number=n,this.http.post("/api/Orders/Get",this.filter).subscribe(t=>{this._RawLogService.Data=t.hits,this.Result=Array();for(let a of t.hits)a._source.log.processedCode&&(this.processedCodeVisible=!0),this.Result.push({ID:a._id,Created:a._source["@timestamp_received"],shopId:a._source.shopId,MarketTypeString:a._source.log.type,POSActionTypeString:a._source.message,Number:a._source.log.number,ResponseCode:a._source.log.responseCode,ProcessedCode:a._source.log.processedCode});this.paginationTotal=t.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}}b.\u0275fac=function(n){return new(n||b)(e.Y36(c.O),e.Y36(p),e.Y36(d.gz))},b.\u0275cmp=e.Xpm({type:b,selectors:[["app-order"]],decls:54,vars:19,consts:[["searchBoxPlaceHolder","Invoice Number..",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","text","name","StatusCode",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","StatusCode",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["class","text-center",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"],[1,"text-white","p-1","rounded","response-desc",3,"ngClass"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(i){return t.Number=i})("onSubmit",function(i){return t.Get(i)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(i){return t.filter.ChannelID=i}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Action"),e.qZA(),e.TgZ(10,"ng-select",3),e.NdJ("ngModelChange",function(i){return t.filter.ActionType=i}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"From/To"),e.qZA(),e.TgZ(14,"datepicker",4),e.NdJ("dateChange",function(i){return t.filter.From=i}),e.qZA(),e.TgZ(15,"datepicker",5),e.NdJ("dateChange",function(i){return t.filter.To=i}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Response Code"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(i){return t.filter.StatusCode=i}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Processed Code"),e.qZA(),e.TgZ(23,"input",7),e.NdJ("ngModelChange",function(i){return t.filter.ProcessedCode=i}),e.qZA()(),e.TgZ(24,"div")(25,"h6"),e._uU(26,"Page Number"),e.qZA(),e.TgZ(27,"input",8),e.NdJ("ngModelChange",function(i){return t.filter.PageNumber=i}),e.qZA()(),e.TgZ(28,"div")(29,"h6"),e._uU(30,"Page Size"),e.qZA(),e.TgZ(31,"input",9),e.NdJ("ngModelChange",function(i){return t.filter.RowCount=i}),e.qZA()()()(),e.TgZ(32,"content")(33,"div",10)(34,"div",11)(35,"div",12)(36,"div",13)(37,"table",14)(38,"thead")(39,"tr",15)(40,"th"),e._uU(41,"Date"),e.qZA(),e.TgZ(42,"th"),e._uU(43,"Channel"),e.qZA(),e.TgZ(44,"th"),e._uU(45,"Actions"),e.qZA(),e.TgZ(46,"th"),e._uU(47,"Number"),e.qZA(),e.TgZ(48,"th",16),e._uU(49,"Response Code"),e.qZA(),e.YNc(50,w,2,0,"th",17),e.qZA()(),e.TgZ(51,"tbody"),e.YNc(52,J,15,18,"tr",18),e.qZA()(),e.TgZ(53,"mat-paginator",19),e.NdJ("page",function(i){return t.changePage(i)}),e.qZA()()()()()()()),2&n&&(e.Q6J("headerTitle","Order Log")("text",t.Number),e.xp6(6),e.Q6J("clearable",!0)("items",t.Channel)("ngModel",t.filter.ChannelID),e.xp6(4),e.Q6J("clearable",!0)("items",t.ActionTypeList)("ngModel",t.filter.ActionType),e.xp6(4),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(4),e.Q6J("ngModel",t.filter.StatusCode),e.xp6(4),e.Q6J("ngModel",t.filter.ProcessedCode),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.RowCount),e.xp6(19),e.Q6J("ngIf",t.processedCodeVisible),e.xp6(2),e.Q6J("ngForOf",t.Result),e.xp6(1),e.Q6J("length",t.paginationTotal)("pageSize",t.paginationPageSize)("pageIndex",0==(null==t.filter?null:t.filter.PageNumber)?0:(null==t.filter?null:t.filter.PageNumber)-1))},dependencies:[r.mk,r.sg,r.O5,s.Fj,s.wV,s.JJ,s.On,d.rH,g.p,_.NW,Z.w9,v.Q,r.uU]});const P=function(){return["/menu/log/inventory/detail"]},k=function(o){return{ID:o}};function F(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",15),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA()()),2&o){const t=n.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(10,P))("queryParams",e.VKq(11,k,t.ID)),e.xp6(1),e.hij(" ",e.xi3(4,7,t.Created,"dd MMM yyyy HH:mm")," "),e.xp6(3),e.Oqu(t.channelName),e.xp6(2),e.Oqu(t.Sku),e.xp6(2),e.Oqu(t.Stock),e.xp6(2),e.Oqu(t.ResponseCode)}}class y{constructor(n,t){this.http=n,this._RawLogService=t,this.Result=Array(),this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load()}ngOnInit(){}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(n=>{this.filter=n.Filter,this.Channel=n.Options.Channel,this.ActionTypeList=n.Options.ActionTypeList,this.Get()})}Get(n){null!=n&&(this.filter.Sku=n),this.http.post("api/Inventory/GetLog",this.filter).subscribe(t=>{this._RawLogService.Data=t.hits,this.Result=Array();for(let a of t.hits)this.Result.push({ID:a._source.log.id,Created:a._source["@timestamp_received"],channelName:a._source.log.channelName,Sku:a._source.log.sku,Stock:a._source.log.stock,ResponseCode:a._source.log.responseCode});this.paginationTotal=t.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount,this.paginationTotal=t.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}}y.\u0275fac=function(n){return new(n||y)(e.Y36(c.O),e.Y36(p))},y.\u0275cmp=e.Xpm({type:y,selectors:[["app-inventory-log"]],decls:41,vars:13,consts:[["searchBoxPlaceHolder","Enter SKU...",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt=3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(i){return t.filter.Sku=i})("onSubmit",function(i){return t.Get(i)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(i){return t.filter.ChannelID=i}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"From/To"),e.qZA(),e.TgZ(10,"datepicker",3),e.NdJ("dateChange",function(i){return t.filter.From=i}),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(i){return t.filter.To=i}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Number"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(i){return t.filter.PageNumber=i}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Size"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(i){return t.filter.RowCount=i}),e.qZA()()()(),e.TgZ(20,"content")(21,"div",7)(22,"div",8)(23,"div",9)(24,"div",10)(25,"table",11)(26,"thead")(27,"tr",12)(28,"th"),e._uU(29,"Created"),e.qZA(),e.TgZ(30,"th"),e._uU(31,"Channel"),e.qZA(),e.TgZ(32,"th"),e._uU(33,"SKU"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Stock"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"Response code"),e.qZA()()(),e.TgZ(38,"tbody"),e.YNc(39,F,13,13,"tr",13),e.qZA()(),e.TgZ(40,"mat-paginator",14),e.NdJ("page",function(i){return t.changePage(i)}),e.qZA()()()()()()()),2&n&&(e.Q6J("headerTitle","Inventory Log")("text",t.filter.Sku),e.xp6(6),e.Q6J("clearable",!0)("items",t.Channel)("ngModel",t.filter.ChannelID),e.xp6(4),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.RowCount),e.xp6(20),e.Q6J("ngForOf",t.Result),e.xp6(1),e.Q6J("length",t.paginationTotal)("pageSize",t.paginationPageSize)("pageIndex",0==(null==t.filter?null:t.filter.PageNumber)?0:(null==t.filter?null:t.filter.PageNumber)-1))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,d.rH,g.p,_.NW,Z.w9,v.Q,r.uU]});const Q=function(){return["/menu/log/order/detail"]},Y=function(o){return{ID:o}};function z(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",16),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA()()),2&o){const t=n.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(9,Q))("queryParams",e.VKq(10,Y,t.id)),e.xp6(1),e.hij(" ",e.xi3(4,6,t.Created,"dd MMM yyyy HH:mm:ss")," "),e.xp6(3),e.Oqu(t.type),e.xp6(2),e.Oqu(t.number),e.xp6(2),e.Oqu(t.message)}}function G(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",8)(1,"div",9)(2,"div",10)(3,"table",11)(4,"thead",12)(5,"tr")(6,"th",13),e._uU(7,"Date"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Type"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Number"),e.qZA(),e.TgZ(12,"th"),e._uU(13,"Message"),e.qZA()()(),e.TgZ(14,"tbody"),e.YNc(15,z,11,12,"tr",14),e.qZA()(),e.TgZ(16,"mat-paginator",15),e.NdJ("page",function(i){e.CHM(t);const h=e.oxw();return e.KtG(h.changePage(i))}),e.qZA()()()()}if(2&o){const t=e.oxw();e.xp6(15),e.Q6J("ngForOf",t.Result),e.xp6(1),e.Q6J("length",t.paginationTotal)("pageSize",t.paginationPageSize)("pageIndex",0==(null==t.filter?null:t.filter.PageNumber)?0:(null==t.filter?null:t.filter.PageNumber)-1)}}class A{constructor(n,t){this.http=n,this._RawLogService=t,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}]}ngOnInit(){this.Load()}Load(n={}){this.http.post("/api/OrdersLoader/Get",n).subscribe(t=>{this.filter=t.Filter,this.Channel=t.Options.Channel,this.ActionTypeList=t.Options.ActionTypeList,this.Get()})}Get(n){this.filter.Number=n,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(t=>{this._RawLogService.Data=t.hits,this.Result=Array();for(let a of t.hits)this.Result.push({id:a._id,message:a._source.message,responseCode:a._source.log.responseCode,processTypeString:a._source.log.processType,type:a._source.log.type,number:a._source.log.number,Created:a._source["@timestamp_received"]});this.paginationTotal=t.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}}A.\u0275fac=function(n){return new(n||A)(e.Y36(c.O),e.Y36(p))},A.\u0275cmp=e.Xpm({type:A,selectors:[["app-raw-log"]],decls:22,vars:10,consts:[["searchBoxPlaceHolder","Invoice Number..",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(i){return t.filter.Number=i})("onSubmit",function(i){return t.Get(i)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(i){return t.filter.ChannelID=i}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"From/To"),e.qZA(),e.TgZ(10,"datepicker",3),e.NdJ("dateChange",function(i){return t.filter.From=i}),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(i){return t.filter.To=i}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Number"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(i){return t.filter.PageNumber=i}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Size"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(i){return t.filter.RowCount=i}),e.qZA()()()(),e.TgZ(20,"content"),e.YNc(21,G,17,4,"div",7),e.qZA()()),2&n&&(e.Q6J("headerTitle","Marketplace Webhook")("text",t.filter.Number),e.xp6(6),e.Q6J("clearable",!0)("items",t.Channel)("ngModel",t.filter.ChannelID),e.xp6(4),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.RowCount),e.xp6(2),e.Q6J("ngIf",t.Result.length>0))},dependencies:[r.sg,r.O5,s.Fj,s.wV,s.JJ,s.On,d.rH,g.p,_.NW,Z.w9,v.Q,r.uU]});class H{constructor(n,t){this._document=t;const a=this._textarea=this._document.createElement("textarea"),i=a.style;i.position="fixed",i.top=i.opacity="0",i.left="-999em",a.setAttribute("aria-hidden","true"),a.value=n,a.readOnly=!0,this._document.body.appendChild(a)}copy(){const n=this._textarea;let t=!1;try{if(n){const a=this._document.activeElement;n.select(),n.setSelectionRange(0,n.value.length),t=this._document.execCommand("copy"),a&&a.focus()}}catch{}return t}destroy(){const n=this._textarea;n&&(n.remove(),this._textarea=void 0)}}let B=(()=>{class o{constructor(t){this._document=t}copy(t){const a=this.beginCopy(t),i=a.copy();return a.destroy(),i}beginCopy(t){return new H(t,this._document)}}return o.\u0275fac=function(t){return new(t||o)(e.LFG(r.K0))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();const E=new e.OlP("CDK_COPY_TO_CLIPBOARD_CONFIG");let V=(()=>{class o{constructor(t,a,i){this._clipboard=t,this._ngZone=a,this.text="",this.attempts=1,this.copied=new e.vpe,this._pending=new Set,i&&null!=i.attempts&&(this.attempts=i.attempts)}copy(t=this.attempts){if(t>1){let a=t;const i=this._clipboard.beginCopy(this.text);this._pending.add(i);const h=()=>{const m=i.copy();m||!--a||this._destroyed?(this._currentTimeout=null,this._pending.delete(i),i.destroy(),this.copied.emit(m)):this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(h,1))};h()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(t=>t.destroy()),this._pending.clear(),this._destroyed=!0}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(B),e.Y36(e.R0b),e.Y36(E,8))},o.\u0275dir=e.lG2({type:o,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(t,a){1&t&&e.NdJ("click",function(){return a.copy()})},inputs:{text:["cdkCopyToClipboard","text"],attempts:["cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"}}),o})(),j=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({}),o})();function K(o,n){1&o&&e._UZ(0,"img",21)}function X(o,n){1&o&&e._UZ(0,"img",22)}function W(o,n){if(1&o&&(e.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"h5"),e._uU(4,"General"),e.qZA()(),e.TgZ(5,"div",7)(6,"div",2)(7,"div",8)(8,"div",9)(9,"label"),e._uU(10,"Date"),e.qZA(),e.TgZ(11,"div")(12,"span"),e._uU(13),e.ALo(14,"date"),e.qZA()()()(),e.TgZ(15,"div",10)(16,"div",9)(17,"label"),e._uU(18,"Market Place Type"),e.qZA(),e.YNc(19,K,1,0,"img",11),e.YNc(20,X,1,0,"img",12),e.TgZ(21,"a",13)(22,"span",14),e._uU(23),e.qZA(),e._UZ(24,"br"),e.TgZ(25,"small",15),e._uU(26),e.qZA()()()(),e.TgZ(27,"div",10)(28,"div",9)(29,"label"),e._uU(30,"Number"),e.qZA(),e.TgZ(31,"div")(32,"span"),e._uU(33),e.qZA()()()(),e.TgZ(34,"div",8)(35,"div",9)(36,"label"),e._uU(37,"Process Type"),e.qZA(),e.TgZ(38,"div")(39,"span"),e._uU(40),e.qZA()()()(),e.TgZ(41,"div",4)(42,"div",9)(43,"label"),e._uU(44,"Authorization Header"),e.qZA(),e.TgZ(45,"div")(46,"span"),e._uU(47),e.qZA()()()(),e.TgZ(48,"div",16)(49,"div",5)(50,"div",17)(51,"div",18)(52,"h3"),e._uU(53,"Request"),e.qZA()(),e.TgZ(54,"div",19)(55,"button",20),e._uU(56,"Copy to clipboard"),e.qZA()()(),e.TgZ(57,"div",7),e._uU(58),e.qZA()()()()()()()),2&o){const t=e.oxw();e.xp6(13),e.Oqu(e.xi3(14,11,t.data.Created,"dd MMM yyyy HH:mm:ss")),e.xp6(6),e.Q6J("ngIf",1==t.data.TypeID),e.xp6(1),e.Q6J("ngIf",0==t.data.TypeID),e.xp6(1),e.s9C("href",t.data.ShopLink,e.LSH),e.xp6(2),e.Oqu(t.data.ShopName),e.xp6(3),e.Oqu(t.data.ShopLink),e.xp6(7),e.Oqu(t.data._source.log.number),e.xp6(7),e.Oqu(t.data._source.log.processType),e.xp6(7),e.Oqu(t.data._source.log.authorizationHeader),e.xp6(8),e.Q6J("cdkCopyToClipboard",t.data._source.log.request),e.xp6(3),e.hij(" ",t.data._source.log.request," ")}}class q{constructor(n,t,a){this.route=n,this.http=t,this._RawLogService=a,this.route.queryParams.subscribe(i=>{let h=JSON.parse(localStorage.getItem("channel"));if(this.ID=i.ID,this.data=this._RawLogService.Fill(this.ID),this.data.Created=this.data._source["@timestamp_received"],h.length>0){const m=h.find(le=>le.ShopID==this.data._source.shopId);m?(this.data.TypeID=m.TypeID,this.data.ShopName=m.Name,this.data.ShopLink=m.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}}function $(o,n){if(1&o&&(e.TgZ(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),e._uU(4,"General"),e.qZA()(),e.TgZ(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),e._uU(10,"Date"),e.qZA(),e.TgZ(11,"div")(12,"span"),e._uU(13),e.ALo(14,"date"),e.qZA()()()(),e.TgZ(15,"div",6)(16,"div",12)(17,"label"),e._uU(18,"SKU"),e.qZA(),e.TgZ(19,"div")(20,"span"),e._uU(21),e.qZA()()()(),e.TgZ(22,"div",6)(23,"div",12)(24,"label"),e._uU(25,"Channel"),e.qZA(),e.TgZ(26,"div")(27,"span"),e._uU(28),e.qZA()()()(),e.TgZ(29,"div",6)(30,"div",12)(31,"label"),e._uU(32,"Response Code"),e.qZA(),e.TgZ(33,"div")(34,"span"),e._uU(35),e.qZA()()()()()()()()),2&o){const t=e.oxw();e.xp6(13),e.Oqu(e.xi3(14,4,t.data.Created,"dd MMM yyyy")),e.xp6(8),e.Oqu(t.data.Sku),e.xp6(7),e.Oqu(t.data.ChannelName),e.xp6(7),e.Oqu(t.data.ResponseCode)}}q.\u0275fac=function(n){return new(n||q)(e.Y36(d.gz),e.Y36(c.O),e.Y36(p))},q.\u0275cmp=e.Xpm({type:q,selectors:[["app-raw-detail"]],decls:5,vars:4,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-2"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-2"],[1,"info-label-group"],[1,"col-sm-4"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["target","_blank",3,"href"],[1,"fw-bold"],[1,"text-dark"],[1,"col-sm-12","mt-2"],[1,"card-header","d-lg-flex"],[1,"me-auto"],[1,"d-sm-block","mt-2"],[3,"cdkCopyToClipboard"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",1,"me-2"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",1,"me-2"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),e.YNc(4,W,59,14,"div",3),e.qZA()()()()),2&n&&(e.Q6J("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(4),e.Q6J("ngIf",t.data))},dependencies:[r.O5,g.p,V,r.uU]});class O{constructor(n,t,a){this.route=n,this.http=t,this._RawLogService=a,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(i=>{this.ID=i.ID,this.Load()})}ngOnInit(){}Load(){this.http.post("/api/Inventory/GetInventoryLogDeatil",{ID:this.ID}).subscribe(t=>{this.data.Created=t.hits[0]._source["@timestamp_received"],this.data.Sku=t.hits[0]._source.log.sku,this.data.ChannelName=t.hits[0]._source.log.channelName,this.data.ResponseCode=t.hits[0]._source.log.responseCode,this.request=JSON.parse(t.hits[0]._source.log.request),this.response=t.hits[0]._source.log.response})}}function ee(o,n){if(1&o&&(e.TgZ(0,"div",9)(1,"div",10)(2,"label"),e._uU(3,"Process Code"),e.qZA(),e.TgZ(4,"div")(5,"span"),e._uU(6),e.qZA()()()()),2&o){const t=e.oxw();e.xp6(6),e.Oqu(t.ProcessedCode)}}function te(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",16),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.Retry())}),e._uU(1,"Retry"),e.qZA()}}O.\u0275fac=function(n){return new(n||O)(e.Y36(d.gz),e.Y36(c.O),e.Y36(p))},O.\u0275cmp=e.Xpm({type:O,selectors:[["app-inventory-detail"]],decls:30,vars:9,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2)(6,"div",3),e.YNc(7,$,36,7,"div",4),e.qZA(),e.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),e._uU(13,"Request"),e.qZA()(),e.TgZ(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),e._uU(18),e.ALo(19,"json"),e.qZA()()()()()(),e.TgZ(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),e._uU(24,"Response"),e.qZA()(),e.TgZ(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),e._uU(29),e.qZA()()()()()()()()()()),2&n&&(e.Q6J("headerTitle","Inventory Detail")("pageData","Inventory Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(7),e.Q6J("ngIf",t.data),e.xp6(11),e.Oqu(e.lcZ(19,7,t.request)),e.xp6(11),e.Oqu(t.response))},dependencies:[r.O5,d.rH,g.p,r.Ts,r.uU]});class L{constructor(n,t){this.route=n,this.http=t,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(a=>{this.ID=a.ID,this.Load()})}ngOnInit(){}Retry(){this.http.post("/api/Orders/Retry",{Number:this.Number,ShopID:this.shopId}).subscribe(t=>{alert(JSON.stringify(t))})}Load(){this.http.post("/api/Orders/GetDetail",{ID:this.ID}).subscribe(t=>{for(let a of t.hits)this.Number=a._source.log.number,this.MarketTypeString=a._source.log.type,this.ResponseCode=a._source.log.responseCode,this.POSActionTypeString=a._source.message,this.ProcessDuration=0,this.Created=a._source["@timestamp_received"],this.request=JSON.parse(a._source.log.request),this.response=JSON.parse(a._source.log.response),this.shopId=a._source.shopId,this.ProcessedCode=a._source.log.processedCode})}}function ne(o,n){1&o&&e._UZ(0,"img",12)}function oe(o,n){1&o&&e._UZ(0,"img",13)}function ae(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td"),e.YNc(2,ne,1,0,"img",9),e.YNc(3,oe,1,0,"img",10),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td")(9,"div",11),e._uU(10),e.qZA(),e.TgZ(11,"div"),e._uU(12),e.qZA()()()),2&o){const t=n.$implicit;e.xp6(2),e.Q6J("ngIf",1==t.TypeID),e.xp6(1),e.Q6J("ngIf",0==t.TypeID),e.xp6(2),e.Oqu(t.Date),e.xp6(2),e.Oqu(t.Number),e.xp6(3),e.Oqu(t.message),e.xp6(2),e.Oqu(t.stackTrace)}}L.\u0275fac=function(n){return new(n||L)(e.Y36(d.gz),e.Y36(c.O))},L.\u0275cmp=e.Xpm({type:L,selectors:[["app-orderdetail"]],decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),e._uU(11,"General"),e.qZA()(),e.TgZ(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),e._uU(17,"Date"),e.qZA(),e.TgZ(18,"div")(19,"span"),e._uU(20),e.ALo(21,"date"),e.qZA()()()(),e.TgZ(22,"div",9)(23,"div",10)(24,"label"),e._uU(25,"Number"),e.qZA(),e.TgZ(26,"div")(27,"span"),e._uU(28),e.qZA()()()(),e.TgZ(29,"div",9)(30,"div",10)(31,"label"),e._uU(32,"Type"),e.qZA(),e.TgZ(33,"div")(34,"span"),e._uU(35),e.qZA()()()(),e.TgZ(36,"div",9)(37,"div",10)(38,"label"),e._uU(39,"Response Code"),e.qZA(),e.TgZ(40,"div")(41,"span"),e._uU(42),e.qZA()()()(),e.TgZ(43,"div",9)(44,"div",10)(45,"label"),e._uU(46,"ShopID"),e.qZA(),e.TgZ(47,"div")(48,"span"),e._uU(49),e.qZA()()()(),e.YNc(50,ee,7,1,"div",11),e.TgZ(51,"div",9)(52,"div",10)(53,"label"),e._uU(54,"Action"),e.qZA(),e.TgZ(55,"div")(56,"span"),e._uU(57),e.qZA()()()()()()()()(),e.TgZ(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),e._uU(63,"Request"),e.qZA()(),e.TgZ(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),e._uU(68),e.ALo(69,"json"),e.qZA()()(),e.TgZ(70,"actions",14),e.YNc(71,te,2,0,"a",15),e.qZA()()()(),e.TgZ(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),e._uU(76,"Response"),e.qZA()(),e.TgZ(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),e._uU(81),e.ALo(82,"json"),e.qZA()()()()()()()()()()),2&n&&(e.Q6J("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(20),e.Oqu(e.xi3(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),e.xp6(8),e.Oqu(t.Number),e.xp6(7),e.Oqu(t.MarketTypeString),e.xp6(7),e.Oqu(t.ResponseCode),e.xp6(7),e.Oqu(t.shopId),e.xp6(1),e.Q6J("ngIf",null!=t.ProcessedCode),e.xp6(7),e.Oqu(t.POSActionTypeString),e.xp6(11),e.Oqu(e.lcZ(69,17,t.request)),e.xp6(3),e.Q6J("ngIf","200"!=t.ResponseCode&&"201"!=t.ResponseCode),e.xp6(10),e.Oqu(e.lcZ(82,19,t.response)))},dependencies:[r.O5,d.rH,g.p,r.Ts,r.uU]});class U{constructor(n){this.http=n,this.Result=Array(),this.filter={RowCount:50,PageNumber:1},this.Load()}ngOnInit(){}Load(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(n=>{this.Result=Array();for(let t of n.hits)this.Result.push({TypeID:"Shopee"==t._source.error.type?0:1,Number:t._source.error.number,Date:t._source["@timestamp_received"],stackTrace:t._source.error.stackTrace,message:t._source.message});this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Load()}}U.\u0275fac=function(n){return new(n||U)(e.Y36(c.O))},U.\u0275cmp=e.Xpm({type:U,selectors:[["app-exception-log"]],decls:21,vars:5,consts:[["searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true",3,"headerTitle"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],[1,"fw-bold"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e._UZ(1,"filters"),e.TgZ(2,"content")(3,"div",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead")(9,"tr",6)(10,"th"),e._uU(11,"Channel"),e.qZA(),e.TgZ(12,"th"),e._uU(13,"Date"),e.qZA(),e.TgZ(14,"th"),e._uU(15,"Number"),e.qZA(),e.TgZ(16,"th"),e._uU(17,"Exception"),e.qZA()()(),e.TgZ(18,"tbody"),e.YNc(19,ae,13,6,"tr",7),e.qZA()(),e.TgZ(20,"mat-paginator",8),e.NdJ("page",function(i){return t.changePage(i)}),e.qZA()()()()()()()),2&n&&(e.Q6J("headerTitle","Exception Log"),e.xp6(19),e.Q6J("ngForOf",t.Result),e.xp6(1),e.Q6J("length",t.paginationTotal)("pageSize",t.paginationPageSize)("pageIndex",0==(null==t.filter?null:t.filter.PageNumber)?0:(null==t.filter?null:t.filter.PageNumber)-1))},dependencies:[r.sg,r.O5,g.p,_.NW]});var ie=l(1889);function re(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._UZ(4,"img",15),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.ALo(7,"date"),e.ALo(8,"date"),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA(),e.TgZ(13,"td"),e._uU(14),e.ALo(15,"date"),e.qZA()()),2&o){const t=n.$implicit,a=e.oxw();e.xp6(2),e.Oqu(t.ChannelName),e.xp6(2),e.Q6J("src",a.getChannelLogo(t.TypeID),e.LSH),e.xp6(2),e.AsE("",e.xi3(7,7,t.Daterange_from,"dd MMM yyyy")," - ",e.xi3(8,10,t.Daterange_to,"dd MMM yyyy"),""),e.xp6(4),e.Oqu(t.ResponseCountOrder),e.xp6(2),e.Oqu(t.UserLogin),e.xp6(2),e.hij("",e.xi3(15,13,t.Created,"dd MMM yyyy")," ")}}class M{constructor(n){this.http=n,this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load()}ngOnInit(){}Load(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(n=>{this.filter=n.Filter,this.Channel=n.Options.Channel,this.Get()})}Get(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(n=>{this.Result=n.Data,this.paginationTotal=n.Total,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}getChannelLogo(n){return ie.g.getChannelLogoByTypeId(n)}}M.\u0275fac=function(n){return new(n||M)(e.Y36(c.O))},M.\u0275cmp=e.Xpm({type:M,selectors:[["app-manual-order-log"]],decls:43,vars:13,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter SKU...",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[1,"img-logo",3,"src"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(i){return t.filter.Sku=i})("onSubmit",function(){return t.Get()}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(i){return t.filter.ChannelID=i}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"From/To"),e.qZA(),e.TgZ(10,"datepicker",3),e.NdJ("dateChange",function(i){return t.filter.From=i}),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(i){return t.filter.To=i}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Number"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(i){return t.filter.PageNumber=i}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Size"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(i){return t.filter.RowCount=i}),e.qZA()()()(),e.TgZ(20,"content")(21,"div",7)(22,"div",8)(23,"div",9)(24,"div",10)(25,"table",11)(26,"thead")(27,"tr",12)(28,"th"),e._uU(29,"Channel"),e.qZA(),e.TgZ(30,"th"),e._uU(31,"Type"),e.qZA(),e.TgZ(32,"th"),e._uU(33,"Download Date Range"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Count Order"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"User Login"),e.qZA(),e.TgZ(38,"th"),e._uU(39,"Created"),e.qZA()()(),e.TgZ(40,"tbody"),e.YNc(41,re,16,16,"tr",13),e.qZA()(),e.TgZ(42,"mat-paginator",14),e.NdJ("page",function(i){return t.changePage(i)}),e.qZA()()()()()()()),2&n&&(e.Q6J("headerTitle","Order Log")("text",t.filter.Sku),e.xp6(6),e.Q6J("clearable",!0)("items",t.Channel)("ngModel",t.filter.ChannelID),e.xp6(4),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.RowCount),e.xp6(22),e.Q6J("ngForOf",t.Result),e.xp6(1),e.Q6J("length",t.paginationTotal)("pageSize",t.paginationPageSize)("pageIndex",0==(null==t.filter?null:t.filter.PageNumber)?0:(null==t.filter?null:t.filter.PageNumber)-1))},dependencies:[r.sg,s.Fj,s.wV,s.JJ,s.On,g.p,_.NW,Z.w9,v.Q,r.uU]});const se=[{path:"",component:f,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:b,canActivate:[u.a],data:{title:"Orders Log"}},{path:"inventory",component:y,canActivate:[u.a],data:{title:"Inventory Log"}},{path:"rawlog",component:A,canActivate:[u.a],data:{title:"Raw Log"}},{path:"rawlog/detail",component:q,canActivate:[u.a],data:{title:"Raw Log Detail"}},{path:"inventory/detail",component:O,canActivate:[u.a],data:{title:"Inventory Details"}},{path:"order/detail",component:L,canActivate:[u.a],data:{title:"Order Details"}},{path:"exception",component:U,canActivate:[u.a],data:{title:"Exception Log"}},{path:"order-log",component:M,canActivate:[u.a],data:{title:"order Log"}}]}];class C{}C.\u0275fac=function(n){return new(n||C)},C.\u0275mod=e.oAB({type:C}),C.\u0275inj=e.cJS({imports:[r.ez,d.Bz.forChild(se)]});class T{}T.\u0275fac=function(n){return new(n||T)},T.\u0275mod=e.oAB({type:T}),T.\u0275inj=e.cJS({imports:[r.ez,s.u5,s.UX,C,d.Bz,g.R,j,_.TU,Z.A0,I.Z,v.Q]})}}]);