marketplacepos 2.8.2 → 2.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/3.8bcc67645faedceb.js +1 -0
- package/Marketplace/{369.8c9ca2ecf6f3a760.js → 369.42e347bc0265c162.js} +1 -1
- package/Marketplace/393.8af7f5bc43371ca4.js +1 -0
- package/Marketplace/397.ca5b2d31b8a43c67.js +1 -0
- package/Marketplace/{408.c73edfe24695a688.js → 408.4699157318f765d5.js} +1 -1
- package/Marketplace/53.0935a71a693bcaa6.js +1 -0
- package/Marketplace/72.d59410fd71caf119.js +1 -0
- package/Marketplace/884.d556fd68d978ebbf.js +1 -0
- package/Marketplace/common.7ce512ca9d1674b7.js +1 -0
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main.f21ded8d313b0b60.js → main.84b8be56bd4c0c6d.js} +1 -1
- package/Marketplace/runtime.4cca186e5100bb4f.js +1 -0
- package/package.json +1 -1
- package/Marketplace/393.9113a28596b36003.js +0 -1
- package/Marketplace/397.c6768a042e8257c0.js +0 -1
- package/Marketplace/53.ab0f83f4bba76774.js +0 -1
- package/Marketplace/72.a5fd86c341c782ab.js +0 -1
- package/Marketplace/877.bab93e3da1ff1928.js +0 -1
- package/Marketplace/884.06eb48b1f2379d09.js +0 -1
- package/Marketplace/common.29d2fb726f28cde8.js +0 -1
- package/Marketplace/runtime.2d126c69c13cad80.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[53],{9053:(W,B,c)=>{c.r(B),c.d(B,{StatusModule:()=>U});var p=c(6895),t=c(4650),M=c(2937),P=c(284);const r=function(){return["/menu/products/download/by-url"]};class v{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listed SKU",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}}v.\u0275fac=function(e){return new(e||v)},v.\u0275cmp=t.Xpm({type:v,selectors:[["app-status"]],decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(e,n){1&e&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()(),t.TgZ(4,"div")(5,"div",3)(6,"a",4),t._UZ(7,"i",5),t.qZA(),t.TgZ(8,"div",6)(9,"div",7)(10,"a",8),t._uU(11,"Download Product By Url"),t.qZA()()()()()(),t._UZ(12,"router-outlet")),2&e&&(t.xp6(3),t.Q6J("Tabs",n.productTabs),t.xp6(7),t.Q6J("routerLink",t.DdM(2,r)))},dependencies:[M.e,P.lC,P.rH]});var Z=c(1290),b=c(8231),x=c(5412),s=c(1889),h=c(9694),m=(()=>{return(i=m||(m={})).Tokopedia="https://seller.tokopedia.com",i.Shoope="https://seller.shopee.co.id",i.Tiktok="https://seller-id.tiktok.com",i.WooCommerce="https://woocommerce.dealpos.app",i.Lazada="https://sellercenter.lazada.co.id",m;var i})(),u=c(6779),_=c(266),g=c(6401);function K(i,e){if(1&i&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",11),t._uU(3),t.qZA(),t.TgZ(4,"td",11),t._uU(5),t.qZA(),t.TgZ(6,"td",12)(7,"p",13),t._uU(8,"Product Not in Channel!"),t.qZA()()(),t.BQk()),2&i){const n=t.oxw().$implicit;t.xp6(3),t.hij(" ",null==n?null:n.Model,""),t.xp6(2),t.hij(" ",null==n?null:n.Code,"")}}function X(i,e){if(1&i&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&i){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Model,"")}}function tt(i,e){if(1&i&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&i){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Code,"")}}const nt=function(i){return{"is-disabled":i}};function et(i,e){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,X,2,2,"td",14),t.YNc(2,tt,2,2,"td",14),t.TgZ(3,"td",11)(4,"div",15)(5,"a",16),t._UZ(6,"img",17),t.qZA(),t.TgZ(7,"div",18),t._uU(8),t.qZA()()(),t.TgZ(9,"td",11),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",19),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",19)(16,"a",20),t._UZ(17,"i",21),t.TgZ(18,"span",22),t._uU(19,"Edit"),t.qZA()()()()),2&i){const n=e.$implicit,o=e.index,a=t.oxw(3);t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(3),t.Q6J("href",n.Url,t.LSH)("title",n.Title),t.xp6(1),t.Q6J("src",a.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.Q6J("matTooltip",(null==n||null==n.Name?null:n.Name.length)>55?null==n?null:n.Name:""),t.xp6(1),t.hij(" ",n.Name," "),t.xp6(2),t.Oqu(t.lcZ(11,12,n.Price)),t.xp6(3),t.Oqu(t.lcZ(14,14,n.Inventory)),t.xp6(3),t.Q6J("href",a.getHyperlinkSellerCenter(n),t.LSH)("ngClass",t.VKq(16,nt,n.TypeID==a.channelType.KalCare))("matTooltip",n.TypeID!=a.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function ot(i,e){if(1&i&&t.YNc(0,et,20,18,"tr",8),2&i){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function it(i,e){if(1&i&&(t.ynx(0),t.YNc(1,K,9,2,"ng-container",9),t.YNc(2,ot,1,1,"ng-template",null,10,t.W1O),t.BQk()),2&i){const n=e.$implicit,o=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",o)}}class O{constructor(e,n){this.data=e,this.dialogRef=n,this.channelType=h.x,this.variants=e.variants,this.title=e.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new u.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(e){return s.g.getChannelLogoByTypeId(e)}getHyperlinkSellerCenter(e){let n="javascript:void(0)";switch(e.TypeID){case h.x.ShopeeV2:n=`${m.Shoope}/portal/product/${e.ChannelItemID}`;break;case h.x.Tiktok:n=`${m.Tiktok}/product/edit/${e.ChannelItemID}`;break;case h.x.Tokopedia:n=`${m.Tokopedia}/edit-product/${e.ChannelItemID}`;break;case h.x.WooCommerce:n=`${m.WooCommerce}/wp-admin/post.php?post=${e.ChannelItemID}&action=edit`;break;case h.x.Lazada:n=`${m.Lazada}/apps/product/publish?productId=${e.ChannelItemID}`}return n}}O.\u0275fac=function(e){return new(e||O)(t.Y36(x.WI),t.Y36(x.so))},O.\u0275cmp=t.Xpm({type:O,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return n.dialogRef.close()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),t._uU(6," VARIANT "),t.TgZ(7,"sup"),t._UZ(8,"i",5),t.qZA()(),t.TgZ(9,"th",4),t._uU(10,"SKU"),t.qZA(),t.TgZ(11,"th",4),t._uU(12," PRODUCT "),t.TgZ(13,"sup"),t._UZ(14,"i",6),t.qZA()(),t.TgZ(15,"th",4),t._uU(16,"PRICE"),t.qZA(),t.TgZ(17,"th",7),t._uU(18,"INVENTORY"),t.qZA(),t._UZ(19,"th",4),t.qZA()(),t.TgZ(20,"tbody"),t.YNc(21,it,4,2,"ng-container",8),t.qZA()()()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(21),t.Q6J("ngForOf",n.variants))},dependencies:[p.mk,p.sg,p.O5,_.gM,g.M,p.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});var C=c(9300),G=c(7579),R=c(2722),H=c(3900),at=c(9646),lt=c(9568),w=c(1318);class N{constructor(e,n){this.LocalData=e,this.httpService=n}getCategoriesByTypeId(e,n){return this.LocalData.getCategoriesByChannelType(e).pipe((0,H.w)(o=>null!=o?(0,at.of)(o):this._getCategoriesByTypeID(e,n)))}_getCategoriesByTypeID(e,n){return this.httpService.post("/api/Channel/getCategoriesByTypeID",{TypeID:e,ID:n}).pipe((0,H.w)(a=>this.LocalData.saveCategoriesByChannelType(a,e)))}}N.\u0275fac=function(e){return new(e||N)(t.LFG(lt.T),t.LFG(w.O))},N.\u0275prov=t.Yz7({token:N,factory:N.\u0275fac,providedIn:"root"});var y=c(6082),F=c(7185),f=c(4006),rt=c(8158);function ct(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"ng-select-infinite",16),t.NdJ("selectedChange",function(a){t.CHM(n);const l=t.oxw().index,d=t.oxw();return t.KtG(d.onSelectCategory(a,l))}),t.qZA(),t.BQk()}if(2&i){const n=t.oxw().$implicit;t.xp6(1),t.Q6J("items",n.Categories)("clearable",!1)}}function st(i,e){if(1&i&&(t.TgZ(0,"div",17),t._UZ(1,"input",18),t.qZA()),2&i){const n=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Q6J("placeholder",o.getChannelCategory(n.TypeID))}}function dt(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"tr")(2,"td",9)(3,"input",10),t.NdJ("ngModelChange",function(a){const d=t.CHM(n).$implicit;return t.KtG(d.Selected=a)})("ngModelChange",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onSelectChannel())}),t.qZA()(),t.TgZ(4,"td")(5,"div",11),t._UZ(6,"img",12),t.TgZ(7,"span",13),t._uU(8),t.qZA()()(),t.TgZ(9,"td"),t.YNc(10,ct,2,2,"ng-container",14),t.YNc(11,st,2,1,"ng-template",null,15,t.W1O),t.qZA()(),t.BQk()}if(2&i){const n=e.$implicit,o=t.MAs(12);t.xp6(3),t.Q6J("ngModel",n.Selected),t.xp6(3),t.Q6J("src",n.Img,t.LSH),t.xp6(2),t.Oqu(n.Name),t.xp6(2),t.Q6J("ngIf",n.Categories.length>0)("ngIfElse",o)}}class S{constructor(e,n,o,a,l){this.data=e,this.channelService=n,this.productService=o,this.dialogRef=a,this.toastrService=l,this.channelOptions=[],this.uploadResponse=[],this.channelType=h.x,this.enableBtnOk=!1,this.destroy$=new G.x,this.uploadResponse=[],this.channels=this.data.channels,this.products=this.data.products,this.isMultipleProduct=e.multipleProduct}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new u.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(n=>{this.channelService.getCategoriesByTypeId(n.channelType,n.channelId).pipe((0,R.R)(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(n.channelType,o)})})}setCategoriesChannelOption(e,n){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==e&&(o.Categories=n),o))}initChannelOptions(){this.channelOptions=this.channels.map(e=>({Name:e.Name,Img:e.Img,ID:e.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(e.TypeID),TypeID:e.TypeID,Categories:[]}))}initDefaultChannelCategoryId(e){let n=0;return e===h.x.Lazada&&(n=6509),n}filterChannelTypeId(){return this.data.channels.map(n=>({channelType:n.TypeID,channelId:n.ID})).filter((n,o,a)=>a.findIndex(l=>n.channelType==l.channelType)==o).filter(n=>n.channelType==h.x.Tokopedia)}onSelectCategory(e,n){this.channelOptions[n].CategoryID=e,this.channelOptions[n].Selected=!0,this.onSelectChannel()}onSelectAllChannel(e){this.channelOptions=this.channelOptions.map(n=>(n.Selected=e,n)),this.enableBtnOk=e}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return-1!==this.channelOptions.findIndex(e=>e.Selected)}onClose(){this.dialogRef.close("CANCEL")}onSave(){if(!this.validateSelectedCategory())return void this.toastrService.warning("Category is required","Warning!");const e=this.channelOptions.filter(n=>n.Selected).map(n=>({CategoryID:n.CategoryID,ChannelID:n.ID}));this.submitToServer(e)}validateSelectedCategory(){return-1==this.channelOptions.filter(n=>n.Selected).filter(n=>n.TypeID==h.x.Tokopedia).findIndex(n=>0==n.CategoryID)}submitToServer(e){this.isMultipleProduct?this.uploadMultipleProduct(e):this.uploadSingleProduct(e)}uploadMultipleProduct(e){this.productService.uploadMultipleProduct(this.products,e).subscribe({next:n=>{this.dialogRef.close(n),console.log(n),this.productService.showToastrUploadMultiple(n.Message)},error:n=>{this.dialogRef.close("ERROR"),this.productService.showToastrUploadMultiple(n.error?.Message)}})}uploadSingleProduct(e){this.productService.uploadSingleProduct(this.products,e).subscribe({next:n=>{this.dialogRef.close(n),this.productService.showToastrSuccessUploadSingle(n,this.data.products[0])},error:n=>{this.dialogRef.close("ERROR"),this.productService.showToastErrorUploadSingle(n,this.data.products[0])}})}getChannelCategory(e){let n;switch(e){case h.x.ShopeeV2:n="Aksesoris Fashion";break;case h.x.Tiktok:n="Aksesoris Fashion - Aksesoris Pakaian";break;case h.x.WooCommerce:n="New Product";break;case h.x.Lazada:n="Fashion Accessories / Women Accessories / Others";break;default:n="Unavailable Category"}return n}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}S.\u0275fac=function(e){return new(e||S)(t.Y36(x.WI),t.Y36(N),t.Y36(y.M),t.Y36(x.so),t.Y36(F._W))},S.\u0275cmp=t.Xpm({type:S,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"d-flex","align-items-center"],["alt","",1,"channel-logo-size",3,"src"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["EMPTY",""],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"items","clearable","selectedChange"],["matTooltip","Product Category is Harcoded, Please Change Product Category in Seller Center","matTooltipPosition","above","matTooltipClass","custom-width-tooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return n.onSave()})("onClose",function(){return n.onClose()})("onCancel",function(){return n.onClose()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3)(6,"input",4),t.NdJ("change",function(a){return n.onSelectAllChannel(a.target.checked)}),t.qZA()(),t.TgZ(7,"th",5)(8,"span",6),t._uU(9,"CHANNEL"),t.qZA()(),t.TgZ(10,"th",7)(11,"span",6),t._uU(12,"CATEGORY"),t.qZA()()()(),t.TgZ(13,"tbody"),t.YNc(14,dt,13,5,"ng-container",8),t.qZA()()()()),2&e&&(t.Q6J("dynamicValidated",n.enableBtnOk)("config",n.modalConfig),t.xp6(14),t.Q6J("ngForOf",n.channelOptions))},dependencies:[p.sg,p.O5,f.Wl,f.JJ,f.On,_.gM,g.M,rt.R],styles:["input[type=checkbox]{width:15px;height:15px}img.channel-logo-size{width:24px;height:24px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}\n"],encapsulation:2});var I=c(7481),T=c(8796),k=c(6732),V=c(6956);function pt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",11),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onOpenScanDialog())}),t._UZ(1,"i",12),t._uU(2," Scan Channel "),t.qZA()}}function ht(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScanMultipleProduct())}),t._UZ(1,"i",12),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();let o;t.xp6(2),t.hij(" Scan (",null==(o=n.productService.selectedProduct(n.products))?null:o.length,") ")}}function ut(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",14),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onUploadMultipleProduct())}),t._UZ(1,"i",15),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();let o;t.xp6(2),t.hij(" Upload (",null==(o=n.productService.selectedProduct(n.products))?null:o.length,") ")}}function gt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",16)(1,"app-product-card",17),t.NdJ("onUpload",function(){const l=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onUploadToMultipleChannel(l))})("onScan",function(){const l=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onScanSingleProduct(l))})("onDescEvent",function(){const l=t.CHM(n).index,d=t.oxw();return t.KtG(d.onOpenDialogVariant(l))})("onCheckBoxChange",function(a){const d=t.CHM(n).$implicit;return t.KtG(d.selected=a)}),t.qZA()()}if(2&i){const n=e.$implicit,o=t.oxw();t.xp6(1),t.Q6J("productId",n.ID)("title",null==n?null:n.Name)("image",null==n?null:n.ThumbnailUrl)("description",(null==n?null:n.Variants.length)>1?(null==n?null:n.Variants.length)+" Variants":null)("channels",o.productService.getChannelProduct(n))("code",o.getVariantCode(null==n?null:n.Variants))("showCheckBox",(null==n?null:n.Channel.length)<o.channelOptions.length)("scanButton",!0)("uploadButton",null==n?null:n.hasUpload)("imageForZoom",null==n?null:n.ImageUrl)}}function _t(i,e){1&i&&(t.ynx(0),t.TgZ(1,"div",18)(2,"div"),t._UZ(3,"i",19),t.qZA(),t.TgZ(4,"h4",20),t._uU(5,"No product found"),t.qZA(),t.TgZ(6,"h6",21),t._uU(7,"Once you have a product"),t.qZA(),t.TgZ(8,"h6",22),t._uU(9,"you`ll see them here"),t.qZA()(),t.BQk())}function mt(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"div",23)(2,"div",24)(3,"app-custom-paginator",25),t.NdJ("next",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onNextPage())})("previous",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onPrevPage())}),t.qZA()()(),t.BQk()}if(2&i){const n=t.oxw();t.xp6(3),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}class D{constructor(e,n,o,a){this.http=e,this.toastr=n,this.dialog=o,this.productService=a,this.searchFilter=new Z.k,this.products=[],this.rowCount=0,this.getLoaderPage()}getLoaderPage(){this.productService.LoadInPOS().subscribe(e=>{this.channelOptions=e.Options.Channel,this.Categories=e.Options.Categories,this.searchFilter.PageNumber=e.Filter.PageNumber,this.searchFilter.RowCount=e.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=e.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}getProducts(){this.http.post("/api/product/GetInPOS",{PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category}).subscribe(n=>{this.products=n.Data,this.rowCount=null==n.Total?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=s.g.GuidEMpty,this.dialog.open(b.j,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,C.h)(o=>s.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAllProduct()})}scanAllProduct(){null!=this.searchFilter.ChannelID?this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(e,n,!this.searchFilter.UpdatedProduct)}}):this.toastr.error("Please Select Channel","Error")}onOpenDialogVariant(e){this.dialog.open(O,{data:{title:this.products[e].Name,variants:this.products[e].Variants},width:"800px"})}onUploadMultipleProduct(){let e=this.productService.selectedProduct(this.products),n=this.productService.filterUnselectedChannel(e,this.channelOptions);this.dialog.open(S,{width:"700px",data:{title:"Upload Multiple Product",channels:n,products:e,multipleProduct:!0}}).afterClosed().pipe((0,C.h)(o=>"CANCEL"!==o)).subscribe({next:o=>{this.getProducts()}})}onUploadToMultipleChannel(e){let n=this.productService.getChannelProduct(e);e.Channel=n;let o=this.productService.filterUnselectedChannel([e],this.channelOptions);this.dialog.open(S,{width:"700px",data:{title:`Upload - ${e.Name}`,channels:o,products:[e]}}).afterClosed().pipe((0,C.h)(a=>"CANCEL"!==a)).subscribe(a=>{this.getProducts()})}searchProduct(e){this.searchFilter.text=e,this.getProducts()}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}onScanMultipleProduct(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=s.g.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[h.x.Tokopedia,h.x.Tiktok]);this.dialog.open(b.j,{data:{filter:e,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,C.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct;let l=this.productService.selectedProduct(this.products),d=this.productService.getVariantCodesProducts(l);this.scanSingleProduct(d)})}onScanSingleProduct(e){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=s.g.GuidEMpty,this.dialog.open(b.j,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,C.h)(o=>s.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID;const a=this.productService.getVariantCodesProduct(e);this.scanSingleProduct(a)})}scanSingleProduct(e){this.productService.scanSingle(this.searchFilter.ChannelID,e).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${o?.Name} `,"Error")}this.searchFilter.ChannelID=s.g.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=s.g.GuidEMpty}})}getVariantCode(e){let n;return e.length>1&&(n=(e[0].model?e[0].model:"")+e[0].Code),1==e.length&&(n=e[0].Code),n}}function Ct(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onOpenScanDialog())}),t._UZ(1,"i",14),t._uU(2," Scan Channel "),t.qZA()}}function ft(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",15),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScanMultipleProduct())}),t._UZ(1,"i",14),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();t.xp6(2),t.hij(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function xt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",16),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onUploadMultipleProduct())}),t._UZ(1,"i",17),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();t.xp6(2),t.hij(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function bt(i,e){if(1&i&&(t.TgZ(0,"span",18),t._UZ(1,"img",19),t.qZA(),t._uU(2)),2&i){const n=e.item,o=t.oxw();t.xp6(1),t.Q6J("src",o.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}function Pt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div")(1,"h6"),t._uU(2,"Item ID"),t.qZA(),t.TgZ(3,"input",20),t.NdJ("ngModelChange",function(a){t.CHM(n);const l=t.oxw();return t.KtG(l.searchFilter.Item_id=a)}),t.qZA()()}if(2&i){const n=t.oxw();t.xp6(3),t.Q6J("ngModel",n.searchFilter.Item_id)}}function St(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",21)(1,"app-product-card",22),t.NdJ("onUpload",function(){const l=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onUploadToMultipleChannel(l))})("onDescEvent",function(){const l=t.CHM(n).index,d=t.oxw();return t.KtG(d.onOpenVariantDetail(l))})("onScan",function(){const l=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onScanSingleProduct(l))})("onCheckBoxChange",function(a){const d=t.CHM(n).$implicit;return t.KtG(d.selected=a)}),t.qZA()()}if(2&i){const n=e.$implicit,o=t.oxw();t.xp6(1),t.Q6J("productId",null==n?null:n.ID)("title",null==n?null:n.Name)("image",null==n?null:n.ThumbnailUrl)("description",(null==n||null==n.Variants?null:n.Variants.length)>1?(null==n||null==n.Variants?null:n.Variants.length)+" Variants":null)("channels",o.productService.getChannelProduct(n))("code",o.getVariantCode(null==n?null:n.Variants))("showCheckBox",null==n?null:n.hasScan)("scanButton",!0)("uploadButton",null==n?null:n.hasUpload)("imageForZoom",null==n?null:n.ImageUrl)}}function Tt(i,e){1&i&&(t.ynx(0),t.TgZ(1,"div",23)(2,"div"),t._UZ(3,"i",24),t.qZA(),t.TgZ(4,"h4",25),t._uU(5,"No product found"),t.qZA(),t.TgZ(6,"h6",26),t._uU(7,"Once you have a product"),t.qZA(),t.TgZ(8,"h6",27),t._uU(9,"you`ll see them here"),t.qZA()(),t.BQk())}function vt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",28)(1,"div",29)(2,"app-custom-paginator",30),t.NdJ("total",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getRowCount())})("next",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onNextPage())})("previous",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onPreviousPage())}),t.qZA()()()}if(2&i){const n=t.oxw();t.xp6(2),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}D.\u0275fac=function(e){return new(e||D)(t.Y36(w.O),t.Y36(F._W),t.Y36(x.uw),t.Y36(y.M))},D.\u0275cmp=t.Xpm({type:D,selectors:[["app-in-pos"]],decls:18,vars:10,consts:[["description","All products which is already available in POS",3,"headerTitle","onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onScan","onDescEvent","onCheckBoxChange"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],[1,"text-secondary","fw-normal","m-2"],[1,"text-secondary","fw-normal"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous"]],template:function(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(a){return n.searchProduct(a)}),t.TgZ(1,"actions"),t.YNc(2,pt,3,0,"button",1),t.YNc(3,ht,3,1,"button",2),t.YNc(4,ut,3,1,"button",3),t.qZA(),t.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),t._uU(10,"Category "),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(a){return n.searchFilter.Category=a}),t.qZA()()()()(),t.TgZ(12,"content")(13,"div",7)(14,"div",8),t.YNc(15,gt,2,10,"div",9),t.YNc(16,_t,10,0,"ng-container",10),t.qZA(),t.YNc(17,mt,4,4,"ng-container",10),t.qZA()()()),2&e&&(t.Q6J("headerTitle","In POS ("+n.rowCount+")"),t.xp6(2),t.Q6J("ngIf",!n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(7),t.Q6J("clearable",!0)("items",n.Categories)("ngModel",n.searchFilter.Category),t.xp6(4),t.Q6J("ngForOf",n.products),t.xp6(1),t.Q6J("ngIf",0==n.products.length),t.xp6(1),t.Q6J("ngIf",n.products.length>0))},dependencies:[p.sg,p.O5,f.JJ,f.On,I.p,T.w9,k.y,V.Y],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}"]});class J{constructor(e,n,o,a,l){this.http=e,this.dialog=n,this.toastr=o,this.productService=a,this.activateRouter=l,this.searchFilter=new Z.k,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=s.g.GuidEMpty}ngOnInit(){this.activateRouter.queryParams.subscribe(e=>{this.initPageLoader(e.ID?e.ID:s.g.GuidEMpty)})}initPageLoader(e){this.productService.loader(e).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,n.Filter.ChannelID!=s.g.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}getProducts(){this.productService.findAllSoldInChannel({ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id}).subscribe(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(e){this.searchFilter.text=e,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(e){this.dialog.open(O,{data:{variants:this.products[e].Variants,title:this.products[e].Name},width:"800px"})}onOpenScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=s.g.GuidEMpty,this.dialog.open(b.j,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,C.h)(o=>s.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAllProduct()})}scanAllProduct(){let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe((0,C.h)(n=>n)).subscribe(n=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(n,e,!this.searchFilter.UpdatedProduct),this.initPageLoader(s.g.GuidEMpty))})}onScanSingleProduct(e){e.Channel=this.productService.getChannelProduct(e);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(b.j,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,C.h)(o=>s.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID;const a=this.productService.getVariantCodesProduct(e);this.scanProducts(a)})}onUploadToMultipleChannel(e){let n=this.productService.getChannelProduct(e);e.Channel=n;let o=this.productService.filterUnselectedChannel([e],this.channelOptions);this.dialog.open(S,{width:"700px",data:{title:`Upload - ${e.Name}`,channels:o,products:[e]}}).afterClosed().pipe((0,C.h)(a=>"CANCEL"!==a)).subscribe({next:a=>{this.getProducts()}})}onScanMultipleProduct(){let e=this.productService.filterChannelByTypeId(this.channelOptions,[h.x.Tokopedia,h.x.Tiktok]);this.searchFilter.ChannelID=s.g.GuidEMpty;let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(b.j,{data:{filter:n,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,C.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct;let l=this.productService.selectedProduct(this.products),d=this.productService.getVariantCodesProducts(l);this.scanProducts(d)})}scanProducts(e){this.productService.scanSingle(this.searchFilter.ChannelID,e).subscribe({next:n=>{let o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);n?this.toastr.success(`Product Successfully scan with ${o?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${o?.Name} `,"Error"),this.searchFilter.ChannelID=s.g.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=s.g.GuidEMpty}})}getVariantCode(e){let n;return e.length>1&&(n=(e[0].model?e[0].model:"")+e[0].Code),1==e.length&&(n=e[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=s.g.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let e=this.productService.selectedProduct(this.products),n=this.productService.filterUnselectedChannel(e,this.channelOptions);this.dialog.open(S,{width:"700px",data:{title:"Upload Multiple Product",channels:n,products:e,multipleProduct:!0}}).afterClosed().pipe((0,C.h)(o=>"CANCEL"!==o)).subscribe({next:o=>{this.getProducts()}})}getRowCount(){this.http.post("/api/product/GetSoldInChannelRowCount",{ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text}).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(e){return s.g.getChannelLogoByTypeId(e)}}J.\u0275fac=function(e){return new(e||J)(t.Y36(w.O),t.Y36(x.uw),t.Y36(F._W),t.Y36(y.M),t.Y36(P.gz))},J.\u0275cmp=t.Xpm({type:J,selectors:[["app-sold-in-channel"]],decls:20,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"headerTitle","onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],["type","text","name","Item_id","id","Item_id",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onDescEvent","onScan","onCheckBoxChange"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],[1,"text-secondary","fw-normal","m-2"],[1,"text-secondary","fw-normal"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(a){return n.searchProduct(a)}),t.TgZ(1,"actions"),t.YNc(2,Ct,3,0,"button",1),t.YNc(3,ft,3,1,"button",2),t.YNc(4,xt,3,1,"button",3),t.qZA(),t.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),t._uU(10,"Channel"),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(a){return n.searchFilter.ListChannelID=a})("clear",function(){return n.onClearFilterChannel()}),t.YNc(12,bt,3,2,"ng-template",7),t.qZA()(),t.YNc(13,Pt,4,1,"div",8),t.qZA()()(),t.TgZ(14,"content")(15,"div",9)(16,"div",10),t.YNc(17,St,2,10,"div",11),t.YNc(18,Tt,10,0,"ng-container",8),t.qZA(),t.YNc(19,vt,3,4,"div",12),t.qZA()()()),2&e&&(t.Q6J("headerTitle","Sold in Channel"),t.xp6(2),t.Q6J("ngIf",!n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(7),t.Q6J("clearable",!0)("multiple",!0)("items",n.channelOptions)("ngModel",n.searchFilter.ListChannelID),t.xp6(2),t.Q6J("ngIf",null!=n.searchFilter.ListChannelID),t.xp6(4),t.Q6J("ngForOf",n.products),t.xp6(1),t.Q6J("ngIf",0==n.products.length),t.xp6(1),t.Q6J("ngIf",null==n.products?null:n.products.length))},dependencies:[p.sg,p.O5,f.Fj,f.JJ,f.On,I.p,T.w9,T.ir,k.y,V.Y],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});var A=c(8063),yt=c(8505),It=c(4004),Mt=c(9425),Zt=c(1739);function Ot(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"img",29),t.NdJ("click",function(a){t.CHM(n);const l=t.oxw(3).$implicit,d=t.oxw(4);return t.KtG(d.onZoomImage(a,null==l?null:l.ImageUrl))}),t.qZA(),t.BQk()}if(2&i){const n=t.oxw(3).$implicit;t.xp6(1),t.Q6J("src",null==n?null:n.ImageUrl,t.LSH)}}function wt(i,e){1&i&&t._UZ(0,"img",30)}function Nt(i,e){if(1&i&&(t.ynx(0),t.TgZ(1,"td",23)(2,"div",24),t.YNc(3,Ot,2,1,"ng-container",6),t.YNc(4,wt,1,0,"ng-template",null,25,t.W1O),t.qZA()(),t.TgZ(6,"td",26)(7,"h4",27)(8,"span",28),t._uU(9),t.qZA()()(),t.BQk()),2&i){const n=t.MAs(5),o=t.oxw(2).$implicit;t.xp6(1),t.Q6J("rowSpan",null==o?null:o.Variants.length),t.xp6(2),t.Q6J("ngIf",null==o?null:o.ImageUrl)("ngIfElse",n),t.xp6(3),t.Q6J("rowSpan",null==o?null:o.Variants.length),t.xp6(2),t.Q6J("matTooltip",(null==o||null==o.Name?null:o.Name.length)>50?null==o?null:o.Name:""),t.xp6(1),t.hij(" ",null==o?null:o.Name," ")}}function Ft(i,e){if(1&i&&(t.TgZ(0,"div")(1,"a",19),t._UZ(2,"img",31),t.qZA()()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("href",n.URL,t.LSH),t.xp6(1),t.Q6J("src",n.Img,t.LSH)("matTooltip",n.Name)}}function At(i,e){if(1&i&&(t.TgZ(0,"div"),t._UZ(1,"img",31),t.qZA()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("src",n.Img,t.LSH)("matTooltip",n.Name)}}function Ut(i,e){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,Nt,10,6,"ng-container",16),t.TgZ(2,"td"),t._uU(3),t.qZA(),t.TgZ(4,"td")(5,"span"),t._uU(6),t.qZA(),t.TgZ(7,"span",18)(8,"a",19),t._UZ(9,"i",20),t.qZA()()(),t.TgZ(10,"td",21)(11,"div",22),t.YNc(12,Ft,3,3,"div",17),t.qZA()(),t.TgZ(13,"td",21)(14,"div",22),t.YNc(15,At,2,2,"div",17),t.qZA()()()),2&i){const n=e.$implicit,o=e.index,a=t.oxw(5);t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(2),t.hij(" ",n.Name," "),t.xp6(3),t.hij(" ",n.Code," "),t.xp6(2),t.Q6J("href","https://"+a.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==n?null:n.ID),t.LSH),t.xp6(4),t.Q6J("ngForOf",null==n?null:n.Available),t.xp6(3),t.Q6J("ngForOf",null==n?null:n.NotAvailable)}}function kt(i,e){if(1&i&&(t.ynx(0),t.YNc(1,Ut,16,6,"tr",17),t.BQk()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("ngForOf",n.Variants)}}function Dt(i,e){if(1&i&&(t.TgZ(0,"tbody"),t.YNc(1,kt,2,1,"ng-container",17),t.qZA()),2&i){const n=e.ngIf;t.xp6(1),t.Q6J("ngForOf",n)}}function Jt(i,e){if(1&i&&(t.ynx(0),t.TgZ(1,"div",9)(2,"table",10)(3,"thead",11)(4,"tr")(5,"th",12),t._uU(6,"Product"),t.qZA(),t.TgZ(7,"th",13),t._uU(8,"Variant"),t.qZA(),t.TgZ(9,"th",13),t._uU(10,"SKU"),t.qZA(),t.TgZ(11,"th",14),t._uU(12,"Available In"),t.qZA(),t.TgZ(13,"th",15),t._uU(14,"Not Available In"),t.qZA()()(),t.YNc(15,Dt,2,1,"tbody",16),t.ALo(16,"async"),t.qZA()(),t.BQk()),2&i){const n=t.oxw(2);t.xp6(15),t.Q6J("ngIf",t.lcZ(16,1,n.data$))}}function Lt(i,e){1&i&&(t.TgZ(0,"div",32)(1,"div"),t._UZ(2,"i",33),t.qZA(),t.TgZ(3,"h4",34),t._uU(4,"No product found"),t.qZA(),t.TgZ(5,"h6",35),t._uU(6,"Once you have a product"),t.qZA(),t.TgZ(7,"h6",36),t._uU(8,"you`ll see them here"),t.qZA()())}function Et(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"span",44),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(3);return t.KtG(a.getRowCount())}),t.TgZ(1,"i",45),t._uU(2,"?"),t.qZA()()}}function qt(i,e){if(1&i&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&i){const n=e.ngIf;t.xp6(1),t.Oqu(t.lcZ(2,1,null==n?null:n.Count))}}function Qt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"a",46),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(3);return t.KtG(a.onNextPage())}),t._UZ(1,"i",47),t._uU(2," Next"),t.qZA()}}function Yt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"a",48),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(3);return t.KtG(a.onLastPage())}),t._UZ(1,"i",49),t._uU(2," Last"),t.qZA()}}function Bt(i,e){if(1&i&&(t.TgZ(0,"div",37)(1,"div",38)(2,"div",39),t._uU(3),t.ALo(4,"number"),t.YNc(5,Et,3,0,"span",40),t.YNc(6,qt,3,3,"span",16),t.ALo(7,"async"),t._uU(8),t.qZA()(),t.TgZ(9,"div",41),t.YNc(10,Qt,3,0,"a",42),t.YNc(11,Yt,3,0,"a",43),t.qZA()()),2&i){const n=e.ngIf,o=t.oxw(2);t.xp6(3),t.hij(" Showing 1 - ",t.lcZ(4,6,null==n?null:n.length)," of "),t.xp6(2),t.Q6J("ngIf",o.paginationService.hideCount),t.xp6(1),t.Q6J("ngIf",!o.paginationService.hideCount&&t.lcZ(7,8,o.rowCount$)),t.xp6(2),t.hij(" records ~ ",o.paginationService.footerPageNumber," Page "),t.xp6(2),t.Q6J("ngIf",o.paginationService.disableNextButton&&!o.paginationService.goToLastPage),t.xp6(1),t.Q6J("ngIf",o.paginationService.disableNextButton&&!o.paginationService.goToLastPage)}}function Rt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"mainpanel",1),t.NdJ("onSubmit",function(a){t.CHM(n);const l=t.oxw();return t.KtG(l.searchProduct(a))}),t.TgZ(1,"actions")(2,"button",2),t.NdJ("click",function(){const l=t.CHM(n).ngIf,d=t.oxw();return t.KtG(d.openScanDialog(l))}),t._UZ(3,"i",3),t._uU(4," Scan Channel "),t.qZA()(),t.TgZ(5,"content")(6,"div",4)(7,"div",5),t.YNc(8,Jt,17,3,"ng-container",6),t.ALo(9,"async"),t.YNc(10,Lt,9,0,"ng-template",null,7,t.W1O),t.qZA(),t.YNc(12,Bt,12,10,"div",8),t.ALo(13,"async"),t.qZA()()()}if(2&i){const n=t.MAs(11),o=t.oxw();t.Q6J("hideSearchDropdown",!0),t.xp6(8),t.Q6J("ngIf",t.lcZ(9,4,o.data$).length>0)("ngIfElse",n),t.xp6(4),t.Q6J("ngIf",t.lcZ(13,6,o.data$))}}class L{constructor(e,n,o,a,l,d){this.http=e,this.dialog=n,this.toastr=o,this.productService=a,this.paginationService=l,this.biggerPictureService=d,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2"}ngOnInit(){this.initPageLoader(),this.iniData(),this.initHostName()}initHostName(){const e=localStorage.getItem("Authorization");this.hostName=JSON.parse(e)?.Host}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe((0,yt.b)(e=>{this.filterSearch=e.Filter,this.paginationService.resetToFirstPage(e.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe((0,It.U)(e=>e.map(n=>(n.Variants=n.Variants.map(o=>(o.Available=this.productService.sortChannel(o.Available),o.NotAvailable=this.productService.sortChannel(o.NotAvailable),o.Available=this.assignLogoChannel(o.Available),o.NotAvailable=this.assignLogoChannel(o.NotAvailable),o)),n))))}assignLogoChannel(e){return e.map(n=>(n.Img=s.g.getChannelLogoByTypeId(n.TypeID),n))}searchProduct(e){this.filterSearch.text=e,this.paginationService.resetToFirstPage(this.filterSearch)}scanAllProduct(e){let n=this.productService.findChannelById(this.filterSearch.ChannelID,e.Options.Channel);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(o=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(o,n,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(e){let n=JSON.parse(JSON.stringify(this.filterSearch));n.ChannelID=s.g.GuidEMpty,this.dialog.open(b.j,{data:{filter:n,channelOptions:e.Options.Channel},width:"600px"}).afterClosed().pipe((0,C.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.filterSearch.ChannelID=a.ChannelID,this.filterSearch.ScanFull=a.ScanFull,this.filterSearch.UpdatedProduct=a.UpdatedProduct,this.filterSearch.Async=a.Async,this.scanAllProduct(e)})}getChannelLogoById(e){return s.g.getChannelLogoByTypeId(e)}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:e=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,e.Count)}})}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}ngOnDestroy(){this.paginationService.destroy()}}function Vt(i,e){if(1&i&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA()()),2&i){const n=e.$implicit;t.xp6(2),t.Oqu(null==n?null:n.Name),t.xp6(2),t.Oqu(null==n?null:n.ChannelVariationSKU)}}L.\u0275fac=function(e){return new(e||L)(t.Y36(w.O),t.Y36(x.uw),t.Y36(F._W),t.Y36(y.M),t.Y36(Mt.b),t.Y36(Zt.k))},L.\u0275cmp=t.Xpm({type:L,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],["EMPTY",""],["class","d-flex justify-content-between mt-5",4,"ngIf"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],[2,"padding-right","0px"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],[1,"text-secondary","fw-normal","m-2"],[1,"text-secondary","fw-normal"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,n){1&e&&(t.YNc(0,Rt,14,8,"mainpanel",0),t.ALo(1,"async")),2&e&&t.Q6J("ngIf",t.lcZ(1,1,n.loader$))},dependencies:[p.sg,p.O5,I.p,_.gM,p.Ov,p.JJ],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]});class E{constructor(e,n){this.data=e,this.dialogRef=n}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new u.O,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}}E.\u0275fac=function(e){return new(e||E)(t.Y36(x.WI),t.Y36(x.so))},E.\u0275cmp=t.Xpm({type:E,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return n.dialogRef.close()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th"),t._uU(6,"Variant"),t.qZA(),t.TgZ(7,"th"),t._uU(8,"SKU"),t.qZA()()(),t.TgZ(9,"tbody"),t.YNc(10,Vt,5,2,"tr",4),t.qZA()()()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(10),t.Q6J("ngForOf",n.data.variants))},dependencies:[p.sg,g.M],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]});var $=c(1948);function Kt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",14),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.openScanDialog())}),t._UZ(1,"i",15),t._uU(2," Scan Channel "),t.qZA()}}function $t(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"button",16),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownloadAllProduct("SELECTED"))}),t._UZ(2,"i",17),t._uU(3),t.qZA(),t.BQk()}if(2&i){const n=t.oxw();let o;t.xp6(3),t.hij(" Download (",null==(o=n.productService.selectedProduct(n.products))?null:o.length,") ")}}function Gt(i,e){if(1&i&&(t.TgZ(0,"span",18),t._UZ(1,"img",19),t.qZA(),t._uU(2)),2&i){const n=e.item,o=t.oxw();t.xp6(1),t.Q6J("src",o.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}const Ht=function(i){return[i]},jt=function(){return[]};function zt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",20)(1,"app-product-card",21),t.NdJ("onCheckBoxChange",function(a){const d=t.CHM(n).index,hn=t.oxw();return t.KtG(hn.onSelectProduct(a,d))})("onDescEvent",function(){const l=t.CHM(n).index,d=t.oxw();return t.KtG(d.onShowVariantDetail(l))})("onDownload",function(){const l=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onDownloadProduct(l))})("onScan",function(){const l=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onScanChannel(l))}),t.qZA()()}if(2&i){const n=e.$implicit;t.xp6(1),t.Q6J("showRedirectIcon",!1)("title",null==n?null:n.Name)("image",null==n?null:n.Image)("imageForZoom",null==n?null:n.Image)("code",null==n?null:n.SKU)("description",(null==n||null==n.Variant?null:n.Variant.length)>0?(null==n||null==n.Variant?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",null!=n&&n.Channel?t.VKq(10,Ht,null==n?null:n.Channel):t.DdM(12,jt))("showCheckBox",!0)("scanButton",!0)}}function Wt(i,e){1&i&&(t.ynx(0),t.TgZ(1,"div",22)(2,"div"),t._UZ(3,"i",23),t.qZA(),t.TgZ(4,"h4",24),t._uU(5,"No product found"),t.qZA(),t.TgZ(6,"h6",25),t._uU(7,"Once you have a product"),t.qZA(),t.TgZ(8,"h6",26),t._uU(9,"you`ll see them here"),t.qZA()(),t.BQk())}function Xt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",27)(1,"div",28)(2,"app-custom-paginator",29),t.NdJ("total",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getRowCount())})("next",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onNextPage())})("previous",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onPreviousPage())}),t.qZA()()()}if(2&i){const n=t.oxw();t.xp6(2),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}class q{constructor(e,n,o,a,l){this.http=e,this.dialog=n,this.productService=o,this.toastrService=a,this.activateRouter=l,this.searchFilter=new Z.k,this.products=[],this.hasClickRowCount=!1}ngOnInit(){this.activateRouter.queryParams.subscribe(e=>{this.initPageLoader(e.ID?e.ID:s.g.GuidEMpty)})}initPageLoader(e){this.productService.loader(e).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(e=>{this.products=e.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){this.products=this.products.map(e=>(e.Channel=JSON.parse(JSON.stringify(this.channelOptions.find(n=>n.ID==e.ChannelID))),e)).map(e=>(e.Channel.Url=e.Url,e))}setSkuProduct(){this.products=this.products.map(e=>(e.SKU=0==e?.Variant?.length?s.g.IsNotEmpty(e?.ChannelItemSKU)?e?.ChannelItemSKU:"SKU not assigned":e?.Variant[0]?.ChannelVariationSKU?e?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",e))}onSearch(e){this.searchFilter.text=e,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=s.g.GuidEMpty}onScanAll(){let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(s.g.GuidEMpty),this.productService.successToastrScanAllProduct(n,e,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=s.g.GuidEMpty})}openScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=s.g.GuidEMpty,this.dialog.open(b.j,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,C.h)(o=>s.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.Async=o.Async,this.onScanAll()})}onDownloadAllProduct(e){let n;n="ALL"==e?this.products:this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(e,n){this.products[n].selected=e}onDownloadProduct(e){confirm(`Are you sure you want to Retrieve product ${e?.Name} from ${e?.Channel.Name} to POS?`)&&this.productService.downloadProduct(e).subscribe({next:()=>{this.getProducts()}})}onScanChannel(e){let n=JSON.parse(JSON.stringify(e));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(o=>{o.Status?(this.initPageLoader(s.g.GuidEMpty),this.toastrService.success(`product ${e.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${e.Name} is not existed in POS`,"Error")})}onShowVariantDetail(e){let n=this.products[e].Variant;n.length>0&&this.dialog.open(E,{data:{title:this.products[e].Name,variants:n},width:"30%"})}getRowCount(){let e={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",e).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(e){return s.g.getChannelLogoByTypeId(e)}}q.\u0275fac=function(e){return new(e||q)(t.Y36(w.O),t.Y36(x.uw),t.Y36(y.M),t.Y36(F._W),t.Y36(P.gz))},q.\u0275cmp=t.Xpm({type:q,selectors:[["app-not-in-pos"]],decls:32,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],["name","haveSKU",1,"form-control","h-100","pt-3","rounded",3,"ngModel","ngModelChange"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton","onCheckBoxChange","onDescEvent","onDownload","onScan"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],[1,"text-secondary","fw-normal","m-2"],[1,"text-secondary","fw-normal"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(a){return n.onSearch(a)}),t.TgZ(1,"actions"),t.YNc(2,Kt,3,0,"button",1),t.YNc(3,$t,4,1,"ng-container",2),t.qZA(),t.TgZ(4,"filters")(5,"div",3)(6,"div",4)(7,"div")(8,"h6"),t._uU(9,"Channel"),t.qZA(),t.TgZ(10,"ng-select",5),t.NdJ("ngModelChange",function(a){return n.searchFilter.ChannelID=a})("clear",function(){return n.onClearChannelFilter()}),t.YNc(11,Gt,3,2,"ng-template",6),t.qZA()(),t.TgZ(12,"div")(13,"h6"),t._uU(14,"SKU Assigned"),t.qZA(),t.TgZ(15,"mat-radio-group",7),t.NdJ("ngModelChange",function(a){return n.searchFilter.HaveSku=a}),t.TgZ(16,"mat-radio-button",8),t._uU(17," All "),t.qZA(),t.TgZ(18,"mat-radio-button",8),t._uU(19," Yes "),t.qZA(),t.TgZ(20,"mat-radio-button",8),t._uU(21," No "),t.qZA()()(),t.TgZ(22,"div")(23,"h6"),t._uU(24,"Item ID"),t.qZA(),t.TgZ(25,"input",9),t.NdJ("ngModelChange",function(a){return n.searchFilter.Item_id=a}),t.qZA()()()()(),t.TgZ(26,"content")(27,"div",10)(28,"div",11),t.YNc(29,zt,2,13,"div",12),t.YNc(30,Wt,10,0,"ng-container",2),t.qZA(),t.YNc(31,Xt,3,4,"div",13),t.qZA()()()),2&e&&(t.xp6(2),t.Q6J("ngIf",!n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(7),t.Q6J("clearable",!0)("items",n.channelOptions)("ngModel",n.searchFilter.ChannelID),t.xp6(5),t.Q6J("ngModel",n.searchFilter.HaveSku),t.xp6(1),t.Q6J("value",0),t.xp6(2),t.Q6J("value",1),t.xp6(2),t.Q6J("value",2),t.xp6(5),t.Q6J("ngModel",n.searchFilter.Item_id),t.xp6(4),t.Q6J("ngForOf",n.products),t.xp6(1),t.Q6J("ngIf",0==n.products.length),t.xp6(1),t.Q6J("ngIf",(null==n.products?null:n.products.length)>0))},dependencies:[p.sg,p.O5,f.Fj,f.JJ,f.On,I.p,T.w9,T.ir,$.VQ,$.U0,k.y,V.Y],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]});var j=c(5631);function tn(i,e){if(1&i&&(t.TgZ(0,"span",8),t._UZ(1,"img",9),t.qZA(),t._uU(2)),2&i){const n=e.item,o=t.oxw();t.xp6(1),t.Q6J("src",o.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}function nn(i,e){if(1&i&&(t.TgZ(0,"div",10),t._UZ(1,"app-duplicate-product-card",11),t.qZA()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("image",n.ThumbnailURL)("channels",n.Channel)}}function en(i,e){1&i&&(t.ynx(0),t.TgZ(1,"div",12)(2,"div"),t._UZ(3,"i",13),t.qZA(),t.TgZ(4,"h4",14),t._uU(5,"No product found"),t.qZA(),t.TgZ(6,"h6",15),t._uU(7,"Once you have a duplicate product"),t.qZA(),t.TgZ(8,"h6",16),t._uU(9,"you`ll see them here"),t.qZA()(),t.BQk())}function on(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"div",17)(2,"div",18)(3,"app-custom-paginator",19),t.NdJ("next",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onNextPage())})("previous",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onPrevPage())})("total",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getRowCount())}),t.qZA()()(),t.BQk()}if(2&i){const n=t.oxw();t.xp6(3),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}class Q{constructor(e,n){this.httpService=e,this.productService=n,this.searchFilter=new Z.k,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader()}getPageLoader(){this.productService.loader().subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.channelOptions=e.Options.Channel,this.getProducts()})}getProducts(){this.httpService.post("/api/product/GetDuplicateInChannel",{ChannelID:this.searchFilter.ChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text}).subscribe(n=>{this.products=n.Data})}onSearch(e){this.searchFilter.text=e,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=s.g.GuidEMpty}getChannelLogo(e){return s.g.getChannelLogoByTypeId(e)}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getRowCount(){this.httpService.post("/api/product/GetDuplicateInChannelRowCount",{text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID}).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}}Q.\u0275fac=function(e){return new(e||Q)(t.Y36(w.O),t.Y36(y.M))},Q.\u0275cmp=t.Xpm({type:Q,selectors:[["app-duplicate-sku"]],decls:14,vars:6,consts:[["headerTitle","Multiple Listed SKU","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],[1,"text-secondary","fw-normal","m-2"],[1,"text-secondary","fw-normal"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous","total"]],template:function(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(a){return n.onSearch(a)}),t.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),t._uU(5,"Channel"),t.qZA(),t.TgZ(6,"ng-select",2),t.NdJ("ngModelChange",function(a){return n.searchFilter.ChannelID=a})("clear",function(){return n.onClearFilter()}),t.YNc(7,tn,3,2,"ng-template",3),t.qZA()()()(),t.TgZ(8,"content")(9,"div",4)(10,"div",5),t.YNc(11,nn,2,5,"div",6),t.YNc(12,en,10,0,"ng-container",7),t.qZA(),t.YNc(13,on,4,4,"ng-container",7),t.qZA()()()),2&e&&(t.xp6(6),t.Q6J("clearable",!0)("items",n.channelOptions)("ngModel",n.searchFilter.ChannelID),t.xp6(5),t.Q6J("ngForOf",n.products),t.xp6(1),t.Q6J("ngIf",0==(null==n.products?null:n.products.length)),t.xp6(1),t.Q6J("ngIf",(null==n.products?null:n.products.length)>0))},dependencies:[p.sg,p.O5,f.JJ,f.On,I.p,T.w9,T.ir,j._,k.y]});var an=c(8739);function ln(i,e){if(1&i&&(t.ynx(0),t._uU(1),t.BQk()),2&i){const n=t.oxw().$implicit;t.xp6(1),t.hij(" ",n.Count," ")}}function rn(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"span",25),t.NdJ("click",function(){t.CHM(n);const a=t.oxw().$implicit,l=t.oxw();return t.KtG(l.getLiveProductCount(a.ID,a))}),t._UZ(1,"i",26),t.qZA()}}const cn=function(){return["/menu/products/status/sold-in-channel"]},z=function(i){return{ID:i}},sn=function(){return["/menu/products/status/not-in-pos"]};function dn(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"tr")(1,"td"),t._UZ(2,"img",14),t.TgZ(3,"span",15),t._uU(4),t.qZA()(),t.TgZ(5,"td",16),t.YNc(6,ln,2,1,"ng-container",17),t.YNc(7,rn,2,0,"ng-template",null,18,t.W1O),t.qZA(),t.TgZ(9,"td",16)(10,"a",19),t._uU(11),t.ALo(12,"number"),t.qZA()(),t.TgZ(13,"td",16)(14,"a",19),t._uU(15),t.ALo(16,"number"),t.qZA()(),t.TgZ(17,"td"),t._uU(18),t.ALo(19,"date"),t.qZA(),t.TgZ(20,"td")(21,"div",20)(22,"button",21),t.NdJ("click",function(){const l=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onScanChannel(l))}),t._UZ(23,"i",22),t._uU(24," Scan "),t.qZA(),t.TgZ(25,"button",23),t.NdJ("click",function(){const l=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onClearCache(l.ID))}),t._UZ(26,"i",24),t._uU(27," Clear "),t.qZA()()()()}if(2&i){const n=e.$implicit,o=t.MAs(8),a=t.oxw();t.xp6(2),t.Q6J("src",a.getChannelLogo(n.TypeID),t.LSH),t.xp6(2),t.Oqu(n.Name),t.xp6(2),t.Q6J("ngIf",void 0!==n.Count)("ngIfElse",o),t.xp6(4),t.Q6J("routerLink",t.DdM(18,cn))("queryParams",t.VKq(19,z,n.ID)),t.xp6(1),t.hij(" ",t.lcZ(12,11,n.SoldInChannel)," "),t.xp6(3),t.Q6J("routerLink",t.DdM(21,sn))("queryParams",t.VKq(22,z,n.ID)),t.xp6(1),t.hij(" ",t.lcZ(16,13,n.NotInPOS)," "),t.xp6(3),t.Oqu(n.LastSync?t.xi3(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"-")}}class Y{constructor(e,n,o){this.productService=e,this.toastr=n,this.dialog=o,this.destroy$=new G.x}ngOnInit(){this.setObsProductStatistic(),this.initPageLoader()}initPageLoader(){this.productService.loader().pipe((0,R.R)(this.destroy$)).subscribe(e=>{this.channelOptions=e?.Options?.Channel})}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(e,n){this.productService.getTotalProductLive(e).pipe((0,R.R)(this.destroy$)).subscribe(o=>{n.Count=o.Count})}onScanChannel(e){this.dialog.open(b.j,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:e.ID},disabledChannelOption:!0}}).afterClosed().pipe((0,C.h)(n=>s.g.IsNotEmpty(n))).subscribe(n=>{this.scanAllProduct(e.ID,n)})}scanAllProduct(e,n){let o=this.productService.findChannelById(e,this.channelOptions);this.productService.scanAll(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async).pipe((0,C.h)(a=>a)).subscribe(a=>{n.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(a,o,!n.UpdatedProduct),this.initPageLoader(),this.setObsProductStatistic())})}onClearCache(e){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(e).pipe((0,R.R)(this.destroy$)).subscribe(o=>{this.toastr.success("Successfully cleared cache","Success"),this.initPageLoader(),this.setObsProductStatistic()})}getChannelLogo(e){return s.g.getChannelLogoByTypeId(e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}Y.\u0275fac=function(e){return new(e||Y)(t.Y36(y.M),t.Y36(F._W),t.Y36(x.uw))},Y.\u0275cmp=t.Xpm({type:Y,selectors:[["app-channel-statistic"]],decls:23,vars:5,consts:[["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[4,"ngIf","ngIfElse"],["QUESTION",""],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"]],template:function(e,n){if(1&e&&(t.TgZ(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr",7)(9,"th"),t._uU(10,"Channel"),t.qZA(),t.TgZ(11,"th",8),t._uU(12,"Live Product"),t.qZA(),t.TgZ(13,"th",9),t._uU(14,"Sold In Channel"),t.qZA(),t.TgZ(15,"th",10),t._uU(16,"Product Not in POS"),t.qZA(),t.TgZ(17,"th",11),t._uU(18,"Last Sync"),t.qZA(),t._UZ(19,"th",12),t.qZA()(),t.TgZ(20,"tbody"),t.YNc(21,dn,28,24,"tr",13),t.ALo(22,"async"),t.qZA()()()()()()()()),2&e){let o;t.Q6J("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(21),t.Q6J("ngForOf",null==(o=t.lcZ(22,3,n.channels$))?null:o.Data)}},dependencies:[p.sg,p.O5,I.p,_.gM,P.rH,p.Ov,p.JJ,p.uU]});const pn=[{component:v,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:D,canActivate:[A.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:J,canActivate:[A.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:L,canActivate:[A.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:q,canActivate:[A.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Q,canActivate:[A.a],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:Y,canActivate:[A.a],data:{title:"Channel Statistic"}}]}];class U{}U.\u0275fac=function(e){return new(e||U)},U.\u0275mod=t.oAB({type:U}),U.\u0275inj=t.cJS({imports:[p.ez,f.u5,I.R,_.AV,T.A0,an.TU,$.Fk,M.Z,j._,k.y,V.Y,P.Bz.forChild(pn)]})},2937:(W,B,c)=>{c.d(B,{Z:()=>m,e:()=>h});var p=c(6895),t=c(266),M=c(284),P=c(4954),r=c(4650);function v(u,_){if(1&u&&(r.ynx(0),r.TgZ(1,"a",6),r._uU(2),r.qZA(),r.BQk()),2&u){const g=r.oxw().$implicit;r.xp6(1),r.s9C("routerLink",g.Url),r.Q6J("title",g.Description?g.Description:""),r.xp6(1),r.hij(" ",g.Title," ")}}function Z(u,_){if(1&u&&(r.TgZ(0,"li",4),r.YNc(1,v,3,3,"ng-container",5),r.qZA()),2&u){const g=_.$implicit;r.xp6(1),r.Q6J("ngxPermissionsOnly",g.Permissions)}}function b(u,_){if(1&u&&(r.ynx(0),r.YNc(1,Z,2,1,"li",3),r.BQk()),2&u){const g=r.oxw();r.xp6(1),r.Q6J("ngForOf",g.Tabs)}}function x(u,_){if(1&u&&(r.TgZ(0,"li",4)(1,"a",6),r._uU(2),r.qZA()()),2&u){const g=_.$implicit;r.xp6(1),r.s9C("routerLink",g.Url),r.Q6J("title",g.Description?g.Description:""),r.xp6(1),r.hij(" ",g.Title," ")}}function s(u,_){if(1&u&&r.YNc(0,x,3,3,"li",3),2&u){const g=r.oxw();r.Q6J("ngForOf",g.Tabs)}}class h{constructor(){this.usePermissions=!1}}h.\u0275fac=function(_){return new(_||h)},h.\u0275cmp=r.Xpm({type:h,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs",usePermissions:"usePermissions"},decls:4,vars:2,consts:[[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],[4,"ngIf","ngIfElse"],["NOT_USE_PERMISSIONS",""],["routerLinkActive","active","class","nav-item me-6",4,"ngFor","ngForOf"],["routerLinkActive","active",1,"nav-item","me-6"],[4,"ngxPermissionsOnly"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink","title"]],template:function(_,g){if(1&_&&(r.TgZ(0,"ul",0),r.YNc(1,b,2,1,"ng-container",1),r.YNc(2,s,1,1,"ng-template",null,2,r.W1O),r.qZA()),2&_){const K=r.MAs(3);r.xp6(1),r.Q6J("ngIf",g.usePermissions)("ngIfElse",K)}},dependencies:[p.sg,p.O5,M.rH,M.Od,P.gE]});class m{}m.\u0275fac=function(_){return new(_||m)},m.\u0275mod=r.oAB({type:m}),m.\u0275inj=r.cJS({imports:[p.ez,M.Bz,t.AV,P.VI.forChild()]})}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[72],{5072:(bn,T,r)=>{r.r(T),r.d(T,{InventoryModule:()=>m});var p=r(6895),n=r(4650),S=r(284),Z=r(2937);class d{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}}d.\u0275fac=function(e){return new(e||d)},d.\u0275cmp=n.Xpm({type:d,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(e,t){1&e&&(n.TgZ(0,"nav",0)(1,"div",1)(2,"div"),n._UZ(3,"nav-tab",2),n.qZA()()(),n._UZ(4,"router-outlet")),2&e&&(n.xp6(3),n.Q6J("Tabs",t.inventoryTabs))},dependencies:[S.lC,Z.e]});var F=r(8231),L=r(6304),w=r(8505),v=r(9300),h=r(1889),C=r(8705),A=r(1318),y=r(7185),M=r(5412),N=r(9425),D=r(6082),I=r(7481),P=r(6114);function O(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"button",17),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(3);return n.KtG(o.openScanDialog())}),n._UZ(1,"i",18),n._uU(2," Scan Channel "),n.qZA()}}function Q(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"button",19),n.NdJ("click",function(){n.CHM(t);const o=n.oxw().ngIf,l=n.oxw(2);return n.KtG(l.onUpdateItems(o))}),n._UZ(1,"i",20),n._uU(2," Update "),n.qZA()}}function E(a,e){if(1&a&&(n.TgZ(0,"actions")(1,"div",14)(2,"div"),n.YNc(3,O,3,0,"button",15),n.YNc(4,Q,3,0,"button",16),n.qZA()()()),2&a){const t=e.ngIf,i=n.oxw(2);n.xp6(3),n.Q6J("ngIf",!i.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",i.productService.hasSelectionVariant(t))}}function Y(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"app-table",21),n.NdJ("onToggle",function(o){n.CHM(t);const l=n.oxw(2);return n.KtG(l.onShowDifferenceStock(o))})("onSubmit",function(o){const s=n.CHM(t).ngIf,c=n.oxw(2);return n.KtG(c.updateStockByVariant(o,s))}),n.qZA()}if(2&a){const t=e.ngIf,i=n.oxw(2);n.Q6J("data",t)("channel",i.channelOptions)("showProductToggle",!0)("filter",i.searchFilter)}}function $(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"span",22),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.getRowCount())}),n.TgZ(1,"i",23),n._uU(2,"?"),n.qZA()()}}function q(a,e){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const t=e.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,t))}}function H(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"a",24),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.nextPage())}),n._UZ(1,"i",25),n._uU(2," Next"),n.qZA()}}function V(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"a",26),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.getAllData())}),n._UZ(1,"i",27),n._uU(2," Last"),n.qZA()}}function R(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(o){n.CHM(t);const l=n.oxw();return n.KtG(l.onSearch(o))}),n.YNc(1,E,5,2,"actions",2),n.ALo(2,"async"),n.TgZ(3,"content")(4,"div",3)(5,"div",4)(6,"div",5),n.YNc(7,Y,1,4,"app-table",6),n.ALo(8,"async"),n.ynx(9),n.TgZ(10,"div",7)(11,"div",8)(12,"div",9),n._uU(13),n.ALo(14,"number"),n.ALo(15,"async"),n.YNc(16,$,3,0,"span",10),n.YNc(17,q,3,3,"span",2),n.ALo(18,"async"),n._uU(19),n.qZA()(),n.TgZ(20,"div",11),n.YNc(21,H,3,0,"a",12),n.YNc(22,V,3,0,"a",13),n.qZA()(),n.BQk(),n.qZA()()()()()}if(2&a){const t=n.oxw();let i;n.Q6J("pageData",t.pageData)("hideSearchBox",!1)("hideSearchDropdown",!0)("textButton","Search"),n.xp6(1),n.Q6J("ngIf",n.lcZ(2,12,t.paginationService.data$)),n.xp6(6),n.Q6J("ngIf",n.lcZ(8,14,t.paginationService.data$)),n.xp6(6),n.hij(" Showing 1 - ",n.lcZ(14,16,null==(i=n.lcZ(15,18,t.paginationService.data$))?null:i.length)," of "),n.xp6(3),n.Q6J("ngIf",t.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(18,20,!t.paginationService.hideCount&&t.allDataCount$)),n.xp6(2),n.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),n.xp6(2),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}class f{constructor(e,t,i,o,l){this.http=e,this.toastr=t,this.dialog=i,this.paginationService=o,this.productService=l,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe((0,w.b)(e=>{this.channelOptions=e.Options.Channel,e.Filter={PageNumber:e.Filter.PageNumber,filterModel:C.v.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory},this.searchFilter=e.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onSearch(e){this.searchFilter.text=e,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(e,t){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let l=i.map(c=>({ID:c.ID,Code:c.Code,Inventory:c.Inventory})),s={ListChannelID:t.filter(c=>c.selected).map(c=>c.ID),List:l};this.http.post("/api/Inventory/UpdateChannel",s).subscribe(c=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+s.List.length+" variants in "+s.ListChannelID.length+" channels","Success")})}}openScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(F.j,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,v.h)(i=>h.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{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.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=h.g.GuidEMpty})}updateStockByVariant(e,t){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(o=>{let l=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") inventory in "+l.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(e){this.searchFilter.filterModel=e?C.v.DIFFERENCE:C.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onUpdateItems(e){const t=this.productService.selectedVariantProduct(e);this.dialog.open(L.j,{data:{selectedItems:t,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe((0,v.h)(i=>h.g.IsNotEmpty(i))).subscribe(i=>{this.updateStock(e,i)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,{text:this.searchFilter.text})}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}})}ngOnDestroy(){this.paginationService.destroy()}}f.\u0275fac=function(e){return new(e||f)(n.Y36(A.O),n.Y36(y._W),n.Y36(M.uw),n.Y36(N.b),n.Y36(D.M))},f.\u0275cmp=n.Xpm({type:f,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",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"],[1,"d-flex"],["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-sm rounded me-3",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",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","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(e,t){1&e&&(n.YNc(0,R,23,22,"mainpanel",0),n.ALo(1,"async")),2&e&&n.Q6J("ngIf",n.lcZ(1,1,t.loader$))},dependencies:[p.O5,I.p,P.a,p.Ov,p.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});var G=r(7945),K=r(1739);class u{constructor(e){this.toastrService=e}showToastrUpdateInventory(e,t){const i=e.length>0,o=t.length>0;if(!o&&i&&this.toastrService.success(`${this.generateSuccessMessage(e.length)}`,"Success",{enableHtml:!0}),o&&i){const l=`<li>${this.generateSuccessMessage(e.length)}</li>`,s=this.generateErrorMessage(t);this.toastrService.warning(`<ol>${l} ${s}</ol>`,"Warning",{enableHtml:!0})}if(o&&!i){const l=`<ol>${this.generateErrorMessage(t)}</ol>`;this.toastrService.error(l,"Error",{enableHtml:!0})}}generateSuccessMessage(e){return`<span class="fw-bold">Successfully</span> updated ${e} variants in 1 channels`}generateErrorMessage(e=[]){let t="";return e.forEach((i,o)=>{t+=`<li><span class="fw-bold">Error</span> Updating stock for [${i.Name}] - <b>${i.Message}</b></li>`}),t}}u.\u0275fac=function(e){return new(e||u)(n.LFG(y._W))},u.\u0275prov=n.Yz7({token:u,factory:u.\u0275fac});var g=r(4006),b=r(8796),U=r(455),k=r(266);function B(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"button",33),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2).ngIf,l=n.oxw();return n.KtG(l.openScanDialog(o))}),n._UZ(1,"i",34),n._uU(2," Scan Channel "),n.qZA()}}function j(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"button",35),n.NdJ("click",function(){n.CHM(t);const o=n.oxw().ngIf,l=n.oxw(2);return n.KtG(l.updateStock(o))}),n._UZ(1,"i",36),n._uU(2," Update"),n.qZA()}}function z(a,e){if(1&a&&(n.TgZ(0,"div"),n.YNc(1,B,3,0,"button",31),n.YNc(2,j,3,0,"button",32),n.qZA()),2&a){const t=e.ngIf,i=n.oxw(2);n.xp6(1),n.Q6J("ngIf",!i.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",i.productService.hasSelectionVariant(t))}}function W(a,e){1&a&&(n.TgZ(0,"div",37)(1,"span"),n._uU(2," showing only different stock, please press next to populate more data "),n.qZA()())}function X(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"th")(1,"input",38),n.NdJ("ngModelChange",function(o){n.CHM(t);const l=n.oxw(2);return n.KtG(l.checkboxState=o)})("ngModelChange",function(){const l=n.CHM(t).ngIf,s=n.oxw(2);return n.KtG(s.onCheckboxStateChange(l))}),n.qZA()()}if(2&a){const t=n.oxw(2);n.xp6(1),n.Q6J("ngModel",t.checkboxState)}}function nn(a,e){if(1&a&&(n.TgZ(0,"ng-option",39),n._UZ(1,"img",40),n._uU(2),n.qZA()),2&a){const t=e.$implicit;n.Q6J("value",t.ID),n.xp6(1),n.s9C("src",t.Img,n.LSH),n.xp6(1),n.hij("",t.Name," ")}}function tn(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"input",64),n.NdJ("ngModelChange",function(o){n.CHM(t);const l=n.oxw(3).$implicit;return n.KtG(l.selected=o)})("ngModelChange",function(){n.CHM(t);const o=n.oxw(3).$implicit,l=n.oxw(2);return n.KtG(l.onCheckboxStateProduct(o))}),n.qZA()}if(2&a){const t=n.oxw(3).$implicit;n.Q6J("ngModel",t.selected)}}function en(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"img",65),n.NdJ("click",function(o){n.CHM(t);const l=n.oxw(3).$implicit,s=n.oxw(2);return n.KtG(s.onZoomImage(o,null==l?null:l.ImageUrl))}),n.qZA()}if(2&a){const t=n.oxw(3).$implicit;n.s9C("src",null==t?null:t.ThumbnailUrl,n.LSH)}}function an(a,e){1&a&&n._UZ(0,"img",66)}function on(a,e){if(1&a&&(n.ynx(0),n.TgZ(1,"td",55)(2,"div",56),n.YNc(3,tn,1,1,"input",57),n.YNc(4,en,1,1,"img",58),n.YNc(5,an,1,0,"ng-template",null,59,n.W1O),n.qZA()(),n.TgZ(7,"td",60)(8,"span",61),n._uU(9),n.qZA(),n._UZ(10,"br"),n.TgZ(11,"div",62),n._UZ(12,"i",63),n.TgZ(13,"small"),n._uU(14),n.qZA()()(),n.BQk()),2&a){const t=n.MAs(6),i=n.oxw().$implicit,o=n.oxw().$implicit;n.xp6(1),n.Q6J("rowSpan",null==o?null:o.Variants.length),n.xp6(2),n.Q6J("ngIf",(null==i?null:i.Inventory)>=0||o.Variants.length>1),n.xp6(1),n.Q6J("ngIf",null==o?null:o.ThumbnailUrl)("ngIfElse",t),n.xp6(3),n.Q6J("rowSpan",null==o?null:o.Variants.length),n.xp6(2),n.Oqu(null==o?null:o.Name),n.xp6(5),n.hij("(",null==o?null:o.Category,")")}}function ln(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"input",38),n.NdJ("ngModelChange",function(o){n.CHM(t);const l=n.oxw().$implicit;return n.KtG(l.selected=o)}),n.qZA()}if(2&a){const t=n.oxw().$implicit;n.Q6J("ngModel",t.selected)}}function rn(a,e){if(1&a&&(n.TgZ(0,"span")(1,"span",67),n._uU(2),n.ALo(3,"number"),n.qZA(),n._uU(4," => "),n.TgZ(5,"span",68),n._uU(6),n.ALo(7,"number"),n.qZA()()),2&a){const t=n.oxw().$implicit;n.xp6(2),n.hij(" ",n.lcZ(3,2,null==t||null==t.I?null:t.I.Available),""),n.xp6(4),n.Oqu(n.lcZ(7,4,null==t?null:t.Inventory))}}function sn(a,e){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const t=n.oxw().$implicit;n.xp6(1),n.hij(" ",n.lcZ(2,1,null==t?null:t.Inventory)," ")}}function cn(a,e){if(1&a&&(n.ynx(0),n.TgZ(1,"span",71),n._uU(2),n.ALo(3,"number"),n.qZA(),n.BQk()),2&a){const t=n.oxw(2).$implicit;n.xp6(2),n.hij(" (",n.lcZ(3,1,null==t||null==t.Channel[0]?null:t.Channel[0].InventoryReserved),") ")}}const pn=function(a){return{"bg-gradient-warning":a}};function hn(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"td",69),n.YNc(1,cn,4,3,"ng-container",3),n.TgZ(2,"span",70),n.NdJ("click",function(){n.CHM(t);const o=n.oxw().$implicit,l=n.oxw(),s=l.$implicit,c=l.ngForOf,In=n.oxw(2);return n.KtG(In.openTableDialog(s,o,c))}),n._uU(3),n.ALo(4,"number"),n.qZA()()}if(2&a){const t=n.oxw().$implicit;n.Q6J("ngClass",n.VKq(5,pn,(null==t?null:t.Inventory)!=(null==t||null==t.Channel[0]?null:t.Channel[0].Inventory))),n.xp6(1),n.Q6J("ngIf",null==t||null==t.Channel[0]?null:t.Channel[0].InventoryReserved),n.xp6(2),n.hij(" ",n.lcZ(4,3,null==t||null==t.Channel[0]?null:t.Channel[0].Inventory)," ")}}function un(a,e){1&a&&(n.ynx(0),n._uU(1," - "),n.BQk())}function gn(a,e){if(1&a&&(n.TgZ(0,"span",72),n.ALo(1,"date"),n._uU(2),n.ALo(3,"date"),n.qZA()),2&a){const t=n.oxw().$implicit;n.Q6J("matTooltip",n.xi3(1,2,null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),n.xp6(2),n.hij(" ",n.xi3(3,5,null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function _n(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"tr"),n.YNc(1,on,15,7,"ng-container",3),n.TgZ(2,"td",41),n._uU(3),n.qZA(),n.TgZ(4,"td",42)(5,"div",43)(6,"span"),n._uU(7),n.qZA(),n.TgZ(8,"span",44)(9,"a",45),n._UZ(10,"i",46),n.qZA()()()(),n.TgZ(11,"td",47),n.YNc(12,ln,1,1,"input",48),n.qZA(),n.TgZ(13,"td",42),n.YNc(14,rn,8,6,"span",3),n.YNc(15,sn,3,3,"span",3),n.qZA(),n.YNc(16,hn,5,7,"td",49),n.TgZ(17,"td",23),n.YNc(18,un,2,0,"ng-container",50),n.YNc(19,gn,4,8,"ng-template",null,51,n.W1O),n.qZA(),n.TgZ(21,"td")(22,"div",10)(23,"div",52)(24,"a",45),n._UZ(25,"i",46),n.qZA(),n._uU(26," \xa0\xa0 "),n.TgZ(27,"span",53),n.NdJ("click",function(){const l=n.CHM(t).$implicit,s=n.oxw(3);return n.KtG(s.refreshInventory(null==l||null==l.Channel[0]?null:l.Channel[0].ChannelItemID,null==l||null==l.Channel[0]?null:l.Channel[0].ChannelVariationID,null==l||null==l.Channel[0]?null:l.Channel[0].ChannelID,null==l?null:l.ID))}),n._UZ(28,"i",54),n.qZA()()()()()}if(2&a){const t=e.$implicit,i=e.index,o=n.MAs(20),l=n.oxw(3);n.xp6(1),n.Q6J("ngIf",0==i),n.xp6(2),n.Oqu(null==t?null:t.Model),n.xp6(4),n.Oqu(null==t?null:t.Code),n.xp6(2),n.Q6J("href","https://"+l.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),n.LSH),n.xp6(3),n.Q6J("ngIf",(null==t?null:t.Inventory)>=0),n.xp6(2),n.Q6J("ngIf",(null==t?null:t.Inventory)!=(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",(null==t?null:t.Inventory)==(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",null==t?null:t.Channel),n.xp6(2),n.Q6J("ngIf",(null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync)==l.minDate)("ngIfElse",o),n.xp6(6),n.Q6J("href",null==t||null==t.Channel[0]?null:t.Channel[0].Url,n.LSH)}}function mn(a,e){if(1&a&&(n.TgZ(0,"tbody"),n.YNc(1,_n,29,11,"tr",25),n.qZA()),2&a){const t=e.$implicit;n.xp6(1),n.Q6J("ngForOf",t.Variants)}}function dn(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"span",73),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.getRowCount())}),n.TgZ(1,"i",74),n._uU(2,"?"),n.qZA()()}}function Cn(a,e){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const t=e.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,null==t?null:t.Total))}}function fn(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"a",78),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(3);return n.KtG(o.onNextPage())}),n._UZ(1,"i",79),n._uU(2," Next"),n.qZA()}}function xn(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"a",80),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(3);return n.KtG(o.onLastPage())}),n._UZ(1,"i",81),n._uU(2," Last"),n.qZA()}}function vn(a,e){if(1&a&&(n.TgZ(0,"div",75),n.YNc(1,fn,3,0,"a",76),n.YNc(2,xn,3,0,"a",77),n.qZA()),2&a){const t=n.oxw(2);n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Sn(a,e){if(1&a){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(o){n.CHM(t);const l=n.oxw();return n.KtG(l.onSearch(o))}),n.TgZ(1,"actions")(2,"div",2),n.YNc(3,z,3,2,"div",3),n.ALo(4,"async"),n.qZA()(),n.TgZ(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),n._uU(10,"PageNumber"),n.qZA(),n.TgZ(11,"input",6),n.NdJ("ngModelChange",function(o){n.CHM(t);const l=n.oxw();return n.KtG(l.searchFilter.PageNumber=o)}),n.qZA()(),n.TgZ(12,"div")(13,"label",7),n._uU(14,"Page Size"),n.qZA(),n.TgZ(15,"input",8),n.NdJ("ngModelChange",function(o){n.CHM(t);const l=n.oxw();return n.KtG(l.searchFilter.RowCount=o)}),n.qZA()()()()(),n.TgZ(16,"content")(17,"div",9)(18,"div",10)(19,"div",11),n.YNc(20,W,3,0,"div",12),n.TgZ(21,"table",13)(22,"thead",14)(23,"tr")(24,"th",15),n._uU(25,"Product "),n._UZ(26,"br"),n.TgZ(27,"mat-slide-toggle",16),n.NdJ("toggleChange",function(){n.CHM(t);const o=n.oxw();return o.showDifferenceStock=!o.showDifferenceStock,n.KtG(o.onShowDifferenceStock())}),n.TgZ(28,"small",17),n._uU(29,"FILTER DIFFERENT INVENTORY"),n.qZA()()(),n.TgZ(30,"th",18),n._uU(31,"Variant"),n.qZA(),n.TgZ(32,"th",19),n._uU(33,"SKU"),n.qZA(),n.YNc(34,X,2,1,"th",3),n.ALo(35,"async"),n.TgZ(36,"th",20),n._uU(37,"POS"),n.qZA(),n.TgZ(38,"th")(39,"ng-select",21),n.NdJ("change",function(o){n.CHM(t);const l=n.oxw();return n.KtG(l.onFilterChannel(o))})("ngModelChange",function(o){n.CHM(t);const l=n.oxw();return n.KtG(l.searchFilter.ChannelID=o)}),n.YNc(40,nn,3,3,"ng-option",22),n.qZA()(),n.TgZ(41,"th",23),n._uU(42,"Last Sync"),n.qZA(),n._UZ(43,"th",24),n.qZA()(),n.YNc(44,mn,2,1,"tbody",25),n.ALo(45,"async"),n.qZA(),n.TgZ(46,"div",26)(47,"div",27)(48,"div",28),n._uU(49),n.ALo(50,"number"),n.ALo(51,"async"),n.YNc(52,dn,3,0,"span",29),n.YNc(53,Cn,3,3,"span",3),n.ALo(54,"async"),n._uU(55),n.qZA()(),n.YNc(56,vn,3,2,"div",30),n.ALo(57,"async"),n.qZA()()()()()()}if(2&a){const t=e.ngIf,i=n.oxw();let o,l;n.Q6J("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),n.xp6(3),n.Q6J("ngIf",n.lcZ(4,17,i.paginationService.data$)),n.xp6(8),n.Q6J("ngModel",i.searchFilter.PageNumber),n.xp6(4),n.Q6J("ngModel",i.searchFilter.RowCount),n.xp6(5),n.Q6J("ngIf",3==(null==i.searchFilter?null:i.searchFilter.filterModel)),n.xp6(14),n.Q6J("ngIf",n.lcZ(35,19,i.paginationService.data$)),n.xp6(5),n.Q6J("clearable",!1)("ngModel",i.searchFilter.ChannelID),n.xp6(1),n.Q6J("ngForOf",t.Options.Channel),n.xp6(4),n.Q6J("ngForOf",n.lcZ(45,21,i.paginationService.data$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(50,23,null==(o=n.lcZ(51,25,i.paginationService.data$))?null:o.length)," of "),n.xp6(3),n.Q6J("ngIf",i.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(54,27,!i.paginationService.hideCount&&i.rowCount$)),n.xp6(2),n.hij(" records ~ ",i.paginationService.footerPageNumber," Page "),n.xp6(1),n.Q6J("ngIf",(null==(l=n.lcZ(57,29,i.paginationService.data$))?null:l.length)>0)}}class x{constructor(e,t,i,o,l,s,c){this.http=e,this.toastr=t,this.dialog=i,this.paginationService=o,this.productService=l,this.biggerPictureService=s,this.inventoryService=c,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=h.g.MinDate,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=l.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe((0,w.b)(e=>{this.channelOptions=e.Options.Channel,this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID},this.paginationService.resetToFirstPage(this.searchFilter),e.Filter.IsMarketplaceAppActive||this.toastr.warning("Automatic inventory sync disabled.\n Please enable Dealpos X Marketplace Apps integration in POS Configuration","Warning")}))}onSearch(e){this.searchFilter.text=e,this.paginationService.resetToFirstPage(this.searchFilter)}onFilterChannel(e){this.searchFilter.ChannelID=e,this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(e){const t=this.productService.selectedVariantProduct(e);if(t.length>0){let i=t.map(l=>({ID:l.ID,Code:l.Code,Inventory:l.Inventory}));this.http.post("/api/Inventory/UpdateChannel",{ListChannelID:[this.searchFilter.ChannelID],List:i}).subscribe(l=>{this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(l)})}}handlingUpdateStock(e){e[0]?.StatusProduct?this.inventoryService.showToastrUpdateInventory(e[0].StatusProduct.Success_list,e[0].StatusProduct.Fail_list):this.toastr.error(e[0]?.Exception,"Error")}openScanDialog(e){const t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=h.g.GuidEMpty,this.dialog.open(F.j,{data:{filter:t,channelOptions:e.Options.Channel},width:"600px"}).afterClosed().pipe((0,v.h)(o=>h.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scannALl(e)})}scannALl(e){const t=this.productService.findChannelById(this.searchFilter.ChannelID,e.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(i=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.searchFilter.ScanFull=!1,this.initPageLoader(),this.toastr.success("Successfully scanned from "+t?.Name,"Success"))})}refreshInventory(e,t,i,o){this.http.post("/api/Inventory/RefreshInventoryChannel",{ChannelItemID:e,ChannelVariationID:t,ChannelID:i,VariantID:o}).subscribe(s=>{this.toastr.success("Successfully updated","Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onCheckboxStateProduct(e){e.Variants=e.Variants.map(t=>(t.Inventory>=0&&(t.selected=e.selected),t))}onCheckboxStateChange(e){e=e.map(t=>(t.Variants=t.Variants.map(i=>(i.selected=this.checkboxState,i)),t))}openTableDialog(e,t,i){this.dialog.open(G.k,{data:{Name:e.Name,Variant:t,ChannelID:t?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:e.ChannelItemID}}).afterClosed().pipe((0,v.h)(l=>h.g.IsNotEmpty(l))).subscribe(l=>{this.updateItemAfterDialog(l,i)})}updateItemAfterDialog(e,t){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku};const o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(l=>{this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") inventory in "+o?.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(){this.searchFilter.filterModel=this.showDifferenceStock?C.v.DIFFERENCE:C.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){const e={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,e)}onLastPage(){this.http.post(`${this.rowCountApi}`,{ChannelID:this.searchFilter.ChannelID,PageNumber:1}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t.Total)}})}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}ngOnDestroy(){this.paginationService.destroy()}}x.\u0275fac=function(e){return new(e||x)(n.Y36(A.O),n.Y36(y._W),n.Y36(M.uw),n.Y36(N.b),n.Y36(D.M),n.Y36(K.k),n.Y36(u))},x.\u0275cmp=n.Xpm({type:x,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[3,"clearable","ngModel","change","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"text-center"],[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"],["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"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"text-start"],[1,"text-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[4,"ngIf","ngIfElse"],["SYNCDATE",""],[1,"col-12","ps-0","d-flex","justify-content-between"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[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"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["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"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"cursor",3,"click"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"],[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(e,t){1&e&&(n.YNc(0,Sn,58,31,"mainpanel",0),n.ALo(1,"async")),2&e&&n.Q6J("ngIf",n.lcZ(1,1,t.loader$))},dependencies:[p.mk,p.sg,p.O5,g.Fj,g.wV,g.Wl,g.JJ,g.On,b.w9,b.jq,U.Rr,I.p,k.gM,p.Ov,p.JJ,p.uU],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});var J=r(8063);const yn=[{path:"",component:d,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:f,canActivate:[J.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:x,canActivate:[J.a],data:{title:"Inventory Comparison"}}]}];class _{}_.\u0275fac=function(e){return new(e||_)},_.\u0275mod=n.oAB({type:_}),_.\u0275inj=n.cJS({imports:[p.ez,S.Bz.forChild(yn)]});class m{}m.\u0275fac=function(e){return new(e||m)},m.\u0275mod=n.oAB({type:m}),m.\u0275inj=n.cJS({providers:[u],imports:[p.ez,_,S.Bz,Z.Z,g.u5,b.A0,U.rP,I.R,P.a,k.AV]})}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[877],{5877:(ue,M,l)=>{l.r(M),l.d(M,{LogsModule:()=>f});var r=l(6895),e=l(4650),d=l(284),w=l(2937);class v{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Sync Inventory",Url:"/menu/log/inventory"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Download Order ",Url:"/menu/log/order-log"}]}ngOnInit(){}}v.\u0275fac=function(n){return new(n||v)},v.\u0275cmp=e.Xpm({type:v,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,w.e]});var h=l(8063),C=l(1889),m=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),T=l(8739),u=l(8796),b=l(5585);function I(o,n){if(1&o&&(e.TgZ(0,"span",21),e._UZ(1,"img",22),e.qZA(),e._uU(2)),2&o){const t=n.item;e.xp6(1),e.Q6J("src",t.logo,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}function R(o,n){1&o&&(e.TgZ(0,"th",17),e._uU(1,"Process Code"),e.qZA())}const S=function(o,n){return{"bg-warning":o,"bg-success":n}};function J(o,n){if(1&o&&(e.TgZ(0,"td",17)(1,"span",24),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 D=function(){return["/menu/log/order/detail"]},P=function(o){return{ID:o}};function k(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",23),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",17)(12,"span",24),e._uU(13),e.qZA()(),e.YNc(14,J,3,5,"td",18),e.qZA()),2&o){const t=n.$implicit,a=e.oxw();e.xp6(2),e.Q6J("routerLink",e.DdM(12,D))("queryParams",e.VKq(13,P,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 y{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=C.g.assignChannelLogo(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()}}function Q(o,n){if(1&o&&(e.TgZ(0,"span",16),e._UZ(1,"img",17),e.qZA(),e._uU(2)),2&o){const t=n.item;e.xp6(1),e.Q6J("src",t.logo,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}y.\u0275fac=function(n){return new(n||y)(e.Y36(m.O),e.Y36(p),e.Y36(d.gz))},y.\u0275cmp=e.Xpm({type:y,selectors:[["app-order"]],decls:55,vars:18,consts:[["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["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"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[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.YNc(7,I,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Action"),e.qZA(),e.TgZ(11,"ng-select",4),e.NdJ("ngModelChange",function(i){return t.filter.ActionType=i}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"From/To"),e.qZA(),e.TgZ(15,"datepicker",5),e.NdJ("dateChange",function(i){return t.filter.From=i}),e.qZA(),e.TgZ(16,"datepicker",6),e.NdJ("dateChange",function(i){return t.filter.To=i}),e.qZA()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Response Code"),e.qZA(),e.TgZ(20,"input",7),e.NdJ("ngModelChange",function(i){return t.filter.StatusCode=i}),e.qZA()(),e.TgZ(21,"div")(22,"h6"),e._uU(23,"Processed Code"),e.qZA(),e.TgZ(24,"input",8),e.NdJ("ngModelChange",function(i){return t.filter.ProcessedCode=i}),e.qZA()(),e.TgZ(25,"div")(26,"h6"),e._uU(27,"Page Number"),e.qZA(),e.TgZ(28,"input",9),e.NdJ("ngModelChange",function(i){return t.filter.PageNumber=i}),e.qZA()(),e.TgZ(29,"div")(30,"h6"),e._uU(31,"Page Size"),e.qZA(),e.TgZ(32,"input",10),e.NdJ("ngModelChange",function(i){return t.filter.RowCount=i}),e.qZA()()()(),e.TgZ(33,"content")(34,"div",11)(35,"div",12)(36,"div",13)(37,"div",14)(38,"table",15)(39,"thead")(40,"tr",16)(41,"th"),e._uU(42,"Date"),e.qZA(),e.TgZ(43,"th"),e._uU(44,"Channel"),e.qZA(),e.TgZ(45,"th"),e._uU(46,"Actions"),e.qZA(),e.TgZ(47,"th"),e._uU(48,"Number"),e.qZA(),e.TgZ(49,"th",17),e._uU(50,"Response Code"),e.qZA(),e.YNc(51,R,2,0,"th",18),e.qZA()(),e.TgZ(52,"tbody"),e.YNc(53,k,15,18,"tr",19),e.qZA()(),e.TgZ(54,"mat-paginator",20),e.NdJ("page",function(i){return t.changePage(i)}),e.qZA()()()()()()()),2&n&&(e.Q6J("text",t.Number),e.xp6(6),e.Q6J("clearable",!0)("items",t.Channel)("ngModel",t.filter.ChannelID),e.xp6(5),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,T.NW,u.w9,u.ir,b.Q,r.uU]});const F=function(){return["/menu/log/inventory/detail"]},Y=function(o){return{ID:o}};function z(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",18),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,F))("queryParams",e.VKq(11,Y,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 q{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=C.g.assignChannelLogo(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()}}function G(o,n){if(1&o&&(e.TgZ(0,"span",9),e._UZ(1,"img",10),e.qZA(),e._uU(2)),2&o){const t=n.item;e.xp6(1),e.Q6J("src",t.logo,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}q.\u0275fac=function(n){return new(n||q)(e.Y36(m.O),e.Y36(p))},q.\u0275cmp=e.Xpm({type:q,selectors:[["app-inventory-log"]],decls:42,vars:12,consts:[["headerTitle","Inventory Log","searchBoxPlaceHolder","Enter SKU...",3,"text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["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,"me-2"],["alt","",2,"width","18px",3,"src"],[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.YNc(7,Q,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"From/To"),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(i){return t.filter.From=i}),e.qZA(),e.TgZ(12,"datepicker",5),e.NdJ("dateChange",function(i){return t.filter.To=i}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Number"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(i){return t.filter.PageNumber=i}),e.qZA()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Page Size"),e.qZA(),e.TgZ(20,"input",7),e.NdJ("ngModelChange",function(i){return t.filter.RowCount=i}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10)(25,"div",11)(26,"table",12)(27,"thead")(28,"tr",13)(29,"th"),e._uU(30,"Created"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Channel"),e.qZA(),e.TgZ(33,"th"),e._uU(34,"SKU"),e.qZA(),e.TgZ(35,"th"),e._uU(36,"Stock"),e.qZA(),e.TgZ(37,"th"),e._uU(38,"Response code"),e.qZA()()(),e.TgZ(39,"tbody"),e.YNc(40,z,13,13,"tr",14),e.qZA()(),e.TgZ(41,"mat-paginator",15),e.NdJ("page",function(i){return t.changePage(i)}),e.qZA()()()()()()()),2&n&&(e.Q6J("text",t.filter.Sku),e.xp6(6),e.Q6J("clearable",!0)("items",t.Channel)("ngModel",t.filter.ChannelID),e.xp6(5),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,T.NW,u.w9,u.ir,b.Q,r.uU]});const H=function(){return["/menu/log/order/detail"]},B=function(o){return{ID:o}};function j(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",19),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,H))("queryParams",e.VKq(10,B,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 E(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),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,j,11,12,"tr",17),e.qZA()(),e.TgZ(16,"mat-paginator",18),e.NdJ("page",function(i){e.CHM(t);const c=e.oxw();return e.KtG(c.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=C.g.assignChannelLogo(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(m.O),e.Y36(p))},A.\u0275cmp=e.Xpm({type:A,selectors:[["app-raw-log"]],decls:23,vars:9,consts:[["headerTitle","Channel Webhook Log","searchBoxPlaceHolder","Invoice Number..",3,"text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["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,"me-2"],["alt","",2,"width","18px",3,"src"],[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.YNc(7,G,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"From/To"),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(i){return t.filter.From=i}),e.qZA(),e.TgZ(12,"datepicker",5),e.NdJ("dateChange",function(i){return t.filter.To=i}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Number"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(i){return t.filter.PageNumber=i}),e.qZA()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Page Size"),e.qZA(),e.TgZ(20,"input",7),e.NdJ("ngModelChange",function(i){return t.filter.RowCount=i}),e.qZA()()()(),e.TgZ(21,"content"),e.YNc(22,E,17,4,"div",8),e.qZA()()),2&n&&(e.Q6J("text",t.filter.Number),e.xp6(6),e.Q6J("clearable",!0)("items",t.Channel)("ngModel",t.filter.ChannelID),e.xp6(5),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,T.NW,u.w9,u.ir,b.Q,r.uU]});class V{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 K=(()=>{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 V(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 W=new e.OlP("CDK_COPY_TO_CLIPBOARD_CONFIG");let X=(()=>{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 c=()=>{const _=i.copy();_||!--a||this._destroyed?(this._currentTimeout=null,this._pending.delete(i),i.destroy(),this.copied.emit(_)):this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(c,1))};c()}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(K),e.Y36(e.R0b),e.Y36(W,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})(),$=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({}),o})();function ee(o,n){1&o&&e._UZ(0,"img",21)}function te(o,n){1&o&&e._UZ(0,"img",22)}function ne(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,ee,1,0,"img",11),e.YNc(20,te,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 O{constructor(n,t,a){this.route=n,this.http=t,this._RawLogService=a,this.route.queryParams.subscribe(i=>{let c=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"],c.length>0){const _=c.find(ge=>ge.ShopID==this.data._source.shopId);_?(this.data.TypeID=_.TypeID,this.data.ShopName=_.Name,this.data.ShopLink=_.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}}function oe(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)}}O.\u0275fac=function(n){return new(n||O)(e.Y36(d.gz),e.Y36(m.O),e.Y36(p))},O.\u0275cmp=e.Xpm({type:O,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,ne,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,X,r.uU]});class L{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 ae(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 ie(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()}}L.\u0275fac=function(n){return new(n||L)(e.Y36(d.gz),e.Y36(m.O),e.Y36(p))},L.\u0275cmp=e.Xpm({type:L,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,oe,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 U{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 re(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td",11),e._UZ(2,"img",12),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"date"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"json"),e.qZA(),e.TgZ(11,"td")(12,"div",13),e._uU(13),e.qZA(),e.TgZ(14,"div"),e._uU(15),e.qZA()()()),2&o){const t=n.$implicit;e.xp6(2),e.Q6J("src",t.logo,e.LSH),e.xp6(2),e.Oqu(e.xi3(5,6,t.date,"dd-MM-yyyy hh:mm:ss")),e.xp6(3),e.Oqu(t.number),e.xp6(2),e.Oqu(e.lcZ(10,9,null==t?null:t.requestJSON)),e.xp6(4),e.Oqu(t.message),e.xp6(2),e.Oqu(t.stackTrace)}}function se(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"mat-paginator",14),e.NdJ("page",function(i){e.CHM(t);const c=e.oxw();return e.KtG(c.onPaginationChange(i))}),e.qZA(),e.BQk()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("length",t.pageTotal)("pageSize",t.pageSize)("pageIndex",0==(null==t.filter?null:t.filter.PageNumber)?0:(null==t.filter?null:t.filter.PageNumber)-1)}}U.\u0275fac=function(n){return new(n||U)(e.Y36(d.gz),e.Y36(m.O))},U.\u0275cmp=e.Xpm({type:U,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,ae,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,ie,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 x{constructor(n){this.http=n,this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(n=>{this.exceptions=n.hits.map(t=>({logo:C.g.getChannelLogoByName(t._source.error?.Type),number:t._source.error.number,date:t._source["@timestamp_received"],stackTrace:t._source.error.stackTrace,message:t._source.message,requestJSON:t._source?.error?.requestJSON})),this.pageTotal=n.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(n){this.filter.PageNumber=n.pageIndex+1,this.getData()}}function le(o,n){if(1&o&&(e.TgZ(0,"span",16),e._UZ(1,"img",17),e.qZA(),e._uU(2)),2&o){const t=n.item;e.xp6(1),e.Q6J("src",t.logo,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}function de(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._UZ(4,"img",18),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")," ")}}x.\u0275fac=function(n){return new(n||x)(e.Y36(m.O))},x.\u0275cmp=e.Xpm({type:x,selectors:[["app-exception-log"]],decls:23,vars:2,consts:[["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","100px"],[2,"width","200px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-center"],[2,"width","30px",3,"src"],[1,"fw-bold"],[3,"length","pageSize","pageIndex","page"]],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",7),e._uU(13,"Date"),e.qZA(),e.TgZ(14,"th"),e._uU(15,"Number"),e.qZA(),e.TgZ(16,"th"),e._uU(17,"Request JSON"),e.qZA(),e.TgZ(18,"th",8),e._uU(19,"Exception"),e.qZA()()(),e.TgZ(20,"tbody"),e.YNc(21,re,16,11,"tr",9),e.qZA()(),e.YNc(22,se,2,3,"ng-container",10),e.qZA()()()()()()),2&n&&(e.xp6(21),e.Q6J("ngForOf",t.exceptions),e.xp6(1),e.Q6J("ngIf",(null==t.exceptions?null:t.exceptions.length)>0))},dependencies:[r.sg,r.O5,g.p,T.NW,r.Ts,r.uU]});class N{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=C.g.assignChannelLogo(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 C.g.getChannelLogoByTypeId(n)}}N.\u0275fac=function(n){return new(n||N)(e.Y36(m.O))},N.\u0275cmp=e.Xpm({type:N,selectors:[["app-manual-order-log"]],decls:44,vars:12,consts:[["headerTitle","Download Order Log",3,"hideSearchBox","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["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,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"img-logo",3,"src"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("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.YNc(7,le,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"From/To"),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(i){return t.filter.From=i}),e.qZA(),e.TgZ(12,"datepicker",5),e.NdJ("dateChange",function(i){return t.filter.To=i}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Number"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(i){return t.filter.PageNumber=i}),e.qZA()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Page Size"),e.qZA(),e.TgZ(20,"input",7),e.NdJ("ngModelChange",function(i){return t.filter.RowCount=i}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10)(25,"div",11)(26,"table",12)(27,"thead")(28,"tr",13)(29,"th"),e._uU(30,"Channel"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Type"),e.qZA(),e.TgZ(33,"th"),e._uU(34,"Download Date Range"),e.qZA(),e.TgZ(35,"th"),e._uU(36,"Count Order"),e.qZA(),e.TgZ(37,"th"),e._uU(38,"User Login"),e.qZA(),e.TgZ(39,"th"),e._uU(40,"Created"),e.qZA()()(),e.TgZ(41,"tbody"),e.YNc(42,de,16,16,"tr",14),e.qZA()(),e.TgZ(43,"mat-paginator",15),e.NdJ("page",function(i){return t.changePage(i)}),e.qZA()()()()()()()),2&n&&(e.Q6J("hideSearchBox",!0),e.xp6(6),e.Q6J("clearable",!0)("items",t.Channel)("ngModel",t.filter.ChannelID),e.xp6(5),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,T.NW,u.w9,u.ir,b.Q,r.uU]});const pe=[{path:"",component:v,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:y,canActivate:[h.a],data:{title:"Order Log"}},{path:"inventory",component:q,canActivate:[h.a],data:{title:"Inventory Log"}},{path:"rawlog",component:A,canActivate:[h.a],data:{title:"Raw Log"}},{path:"rawlog/detail",component:O,canActivate:[h.a],data:{title:"Raw Log Detail"}},{path:"inventory/detail",component:L,canActivate:[h.a],data:{title:"Inventory Details"}},{path:"order/detail",component:U,canActivate:[h.a],data:{title:"Order Details"}},{path:"exception",component:x,canActivate:[h.a],data:{title:"Exception Log"}},{path:"order-log",component:N,canActivate:[h.a],data:{title:"order Log"}}]}];class Z{}Z.\u0275fac=function(n){return new(n||Z)},Z.\u0275mod=e.oAB({type:Z}),Z.\u0275inj=e.cJS({imports:[r.ez,d.Bz.forChild(pe)]});class f{}f.\u0275fac=function(n){return new(n||f)},f.\u0275mod=e.oAB({type:f}),f.\u0275inj=e.cJS({imports:[r.ez,s.u5,s.UX,Z,d.Bz,g.R,$,T.TU,u.A0,w.Z,b.Q]})}}]);
|