marketplacepos 2.3.8 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/Marketplace/102.635de205af00df15.js +1 -0
  2. package/Marketplace/387.04d02414af56d750.js +1 -0
  3. package/Marketplace/3rdpartylicenses.txt +25 -0
  4. package/Marketplace/402.2999196dce334514.js +1 -0
  5. package/Marketplace/455.fc7663306b753727.js +1 -0
  6. package/Marketplace/458.c769122ade2c10ed.js +1 -0
  7. package/Marketplace/472.54413a4f69aa673d.js +1 -0
  8. package/Marketplace/585.9e916b668a91cc94.js +1 -0
  9. package/Marketplace/667.81e6162196d486da.js +1 -0
  10. package/Marketplace/{767.297995f3aba0da57.js → 767.79e23997e93fb6c3.js} +1 -1
  11. package/Marketplace/801.8eb1454f763d4534.js +1 -0
  12. package/Marketplace/882.b34c3cc6e65d7a17.js +1 -0
  13. package/Marketplace/970.d0e3ee1e2aec0db5.js +1 -0
  14. package/Marketplace/assets/lbd/_sidebar-and-main-panel.scss +0 -1
  15. package/Marketplace/index.html +2 -2
  16. package/Marketplace/main.f30bf3b0f501021c.js +1 -0
  17. package/Marketplace/runtime.d01f3ddbb2b8f1f2.js +1 -0
  18. package/Marketplace/scripts.6c7ffbfab0ec93ff.js +1 -0
  19. package/Marketplace/styles.296cdf56f9059ddb.css +39 -0
  20. package/package.json +1 -1
  21. package/Marketplace/146.e83dc5a5498a6408.js +0 -1
  22. package/Marketplace/288.9b236c96f7411cc2.js +0 -1
  23. package/Marketplace/327.36b24b9d7be528d8.js +0 -1
  24. package/Marketplace/402.76aaae9b8dfdc4fd.js +0 -1
  25. package/Marketplace/458.455af1a928a7caa9.js +0 -1
  26. package/Marketplace/466.02b13502d80588a2.js +0 -1
  27. package/Marketplace/472.2a25cc631023dd9d.js +0 -1
  28. package/Marketplace/585.c93552ac67f4550c.js +0 -1
  29. package/Marketplace/61.6bf2570c9c03e65d.js +0 -1
  30. package/Marketplace/970.3f4eb2182e0ed6ff.js +0 -1
  31. package/Marketplace/main.7b5711d2efb046b5.js +0 -1
  32. package/Marketplace/runtime.60ce88a49d8b2bf5.js +0 -1
  33. package/Marketplace/scripts.512baec01df5d79f.js +0 -1
  34. package/Marketplace/styles.84477c613818f650.css +0 -39
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[667],{1667:(Ae,Tt,d)=>{d.r(Tt),d.d(Tt,{ProductModule:()=>Ne});var c=d(6895),vt=d(7398),y=d(4006),st=d(8252),t=d(4650);let Dt=(()=>{class e{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/sold-in-channel"},{Title:"Not in Channel",Url:"/menu/products/not-in-channel"},{Title:"Not in POS",Url:"/menu/products/not-in-pos"},{Title:"In POS",Url:"/menu/products/in-pos"},{Title:"Duplicate SKU",Url:"/menu/products/duplicate-sku"}]}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-products"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,o){1&n&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()()(),t._UZ(4,"router-outlet")),2&n&&(t.xp6(3),t.Q6J("Tabs",o.productTabs))},dependencies:[vt.e,st.lC],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}}"]}),e})();class dt{}var A=d(8231),m=d(5412),yt=d(3900),Ft=d(9646),Jt=d(3841),F=d(1318);let St=(()=>{class e{constructor(n,o){this.LocalData=n,this.httpService=o}getCategoriesByTypeId(n){return this.LocalData.getCategoriesByChannelType(n).pipe((0,yt.w)(o=>null!=o?(0,Ft.of)(o):this._getCategoriesByTypeID(n)))}_getCategoriesByTypeID(n){return this.httpService.post("/api/Channel/getCategoriesByTypeID",{TypeID:n}).pipe((0,yt.w)(i=>this.LocalData.saveCategoriesByChannelType(i,n)))}}return e.\u0275fac=function(n){return new(n||e)(t.LFG(Jt.T),t.LFG(F.O))},e.\u0275prov=t.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var wt=d(8966);function Et(e,a){if(1&e){const n=t.EpF();t.ynx(0),t.TgZ(1,"h5",4),t._uU(2,"Category"),t.qZA(),t.TgZ(3,"app-select-search",10),t.NdJ("onSelect",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.onSelectCategory(i))}),t.qZA(),t.BQk()}if(2&e){const n=t.oxw();t.xp6(3),t.Q6J("appearance","outline")("batchSize",30)("data",n.options)("bindLabel","Value")("bindValue","Key")("placeholder","Select Category")}}let Mt=(()=>{class e{constructor(n,o,i,l){this.data=n,this.channelCategoriesService=o,this.http=i,this.dialogRef=l,this.item=n.item,this.selectItemMissingChannel=n.selectedItemMissingChannel,this.options=[],this.optionVisible=!1}onSelectItem(n){this.selectedChannelID=n;let o=this.selectItemMissingChannel.find(i=>i.ID==n);!o||1!==o.TypeID&&7!==o.TypeID?this.optionVisible=!1:this.channelCategoriesService.getCategoriesByTypeId(o.TypeID).subscribe({next:i=>{this.options=i,this.optionVisible=!0},error:i=>{console.error(i)}})}onSelectCategory(n){this.selectedCategoryID=n}onClose(){this.dialogRef.close()}onSave(){this.selectedChannelID&&(this.selectedCategoryID||!this.optionVisible)&&this.dialogRef.close({channelID:this.selectedChannelID,categoryID:this.selectedCategoryID})}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(m.WI),t.Y36(St),t.Y36(F.O),t.Y36(m.so))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-uploadProductDialog"]],decls:16,vars:7,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0","border-top","border-bottom"],[1,"row"],[1,"col-12"],[1,"mb-3","fw-normal"],[3,"appearance","data","bindLabel","bindValue","placeholder","onSelect"],[4,"ngIf"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"],[3,"appearance","batchSize","data","bindLabel","bindValue","placeholder","onSelect"]],template:function(n,o){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t.TgZ(2,"mat-dialog-content",1)(3,"div",2)(4,"div",3)(5,"h5",4),t._uU(6,"Channel :"),t.qZA(),t.TgZ(7,"app-select-search",5),t.NdJ("onSelect",function(l){return o.onSelectItem(l)}),t.qZA()()(),t.TgZ(8,"div",2)(9,"div",3),t.YNc(10,Et,4,6,"ng-container",6),t.qZA()()(),t.TgZ(11,"mat-dialog-actions",7)(12,"button",8),t.NdJ("click",function(){return o.onClose()}),t._uU(13,"Cancel"),t.qZA(),t.TgZ(14,"button",9),t.NdJ("click",function(){return o.onSave()}),t._uU(15,"Upload"),t.qZA()()),2&n&&(t.xp6(1),t.hij("Upload ",null==o.item?null:o.item.Name,""),t.xp6(6),t.Q6J("appearance","outline")("data",o.selectItemMissingChannel)("bindLabel","Name")("bindValue","ID")("placeholder","Choose "),t.xp6(3),t.Q6J("ngIf",o.optionVisible))},dependencies:[c.O5,m.uh,m.xY,m.H8,wt.h],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),e})();var g=d(3154),L=d(266);function qt(e,a){if(1&e&&(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&e){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 Qt(e,a){if(1&e&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&e){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Model,"")}}function Lt(e,a){if(1&e&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&e){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Code,"")}}function Bt(e,a){if(1&e&&(t.TgZ(0,"tr"),t.YNc(1,Qt,2,2,"td",14),t.YNc(2,Lt,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()()),2&e){const n=a.$implicit,o=a.index,i=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",i.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,9,n.Price)),t.xp6(3),t.Oqu(t.lcZ(14,11,n.Inventory))}}function Yt(e,a){if(1&e&&t.YNc(0,Bt,15,13,"tr",8),2&e){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function Vt(e,a){if(1&e&&(t.ynx(0),t.YNc(1,qt,9,2,"ng-container",9),t.YNc(2,Yt,1,1,"ng-template",null,10,t.W1O),t.BQk()),2&e){const n=a.$implicit,o=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",o)}}let It=(()=>{class e{constructor(n){this.data=n,this.variants=n.variants,this.title=n.title}getChannelLogo(n){return g.g.getChannelLogoByTypeId(n)}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(m.WI))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-modal-variant"]],decls:23,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3","text-center"],[1,"pb-5","px-3"],[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"]],template:function(n,o){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead",3)(6,"tr")(7,"th",4),t._uU(8," VARIANT "),t.TgZ(9,"sup"),t._UZ(10,"i",5),t.qZA()(),t.TgZ(11,"th",4),t._uU(12,"SKU"),t.qZA(),t.TgZ(13,"th",4),t._uU(14," PRODUCT "),t.TgZ(15,"sup"),t._UZ(16,"i",6),t.qZA()(),t.TgZ(17,"th",4),t._uU(18,"PRICE"),t.qZA(),t.TgZ(19,"th",7),t._uU(20,"INVENTORY"),t.qZA()()(),t.TgZ(21,"tbody"),t.YNc(22,Vt,4,2,"ng-container",8),t.qZA()()()),2&n&&(t.xp6(1),t.Oqu(o.title),t.xp6(21),t.Q6J("ngForOf",o.variants))},dependencies:[c.sg,c.O5,m.uh,m.xY,L.gM,c.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0px}.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}"]}),e})();var I=d(9300),$t=d(7579),Ht=d(2722),U=d(9694),H=d(6082),j=d(7185);function Rt(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"th",13)(1,"input",14),t.NdJ("change",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.onSelectAllChannel(i.target.checked))}),t.qZA()()}}function Gt(e,a){1&e&&(t.ynx(0),t.TgZ(1,"th",15),t._uU(2,"Status"),t.qZA(),t.BQk())}function Kt(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"td",15)(1,"input",22),t.NdJ("ngModelChange",function(i){t.CHM(n);const l=t.oxw().$implicit;return t.KtG(l.Selected=i)}),t.qZA()()}if(2&e){const n=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",n.Selected)}}function jt(e,a){if(1&e){const n=t.EpF();t.ynx(0),t.TgZ(1,"app-select-search",23),t.NdJ("onSelect",function(i){t.CHM(n);const l=t.oxw().index,r=t.oxw();return t.KtG(r.onSelectCategory(i,l))}),t.qZA(),t.BQk()}if(2&e){const n=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Q6J("data",n.Categories)("batchSize",30)("disabled",o.uploadResponse.length>0)}}function zt(e,a){1&e&&(t.TgZ(0,"div",24),t._UZ(1,"input",25),t.qZA())}function Wt(e,a){if(1&e&&(t.TgZ(0,"span",29)(1,"a",30),t._UZ(2,"i",31),t.qZA()()),2&e){const n=t.oxw().$implicit;t.xp6(1),t.Q6J("href",n.URL,t.LSH)}}function Xt(e,a){if(1&e&&(t.TgZ(0,"span",32),t._uU(1," X "),t.qZA()),2&e){const n=t.oxw().$implicit;t.Q6J("matTooltip",n.Response)}}function tn(e,a){if(1&e&&(t.ynx(0),t.YNc(1,Wt,3,1,"span",27),t.YNc(2,Xt,2,1,"span",28),t.BQk()),2&e){const n=a.$implicit,o=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",n.ChannelID==o.ID&&n.Status),t.xp6(1),t.Q6J("ngIf",n.ChannelID==o.ID&&!n.Status)}}function nn(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"td",26),t.YNc(2,tn,3,2,"ng-container",7),t.qZA(),t.BQk()),2&e){const n=t.oxw(2);t.xp6(2),t.Q6J("ngForOf",n.uploadResponse)}}const Zt=function(e){return{"ps-8":e}};function en(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"tr"),t.YNc(2,Kt,2,1,"td",16),t.TgZ(3,"td",17)(4,"div",18),t._UZ(5,"img",19),t.TgZ(6,"span",20),t._uU(7),t.qZA()()(),t.TgZ(8,"td"),t.YNc(9,jt,2,3,"ng-container",10),t.YNc(10,zt,2,0,"ng-template",null,21,t.W1O),t.qZA(),t.YNc(12,nn,3,1,"ng-container",6),t.qZA(),t.BQk()),2&e){const n=a.$implicit,o=t.MAs(11),i=t.oxw();t.xp6(2),t.Q6J("ngIf",0==i.uploadResponse.length),t.xp6(1),t.Q6J("ngClass",t.VKq(7,Zt,i.uploadResponse.length>0)),t.xp6(2),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),t.xp6(3),t.Q6J("ngIf",i.uploadResponse.length>0)}}function on(e,a){1&e&&(t.TgZ(0,"span"),t._uU(1," Cancel "),t.qZA())}function an(e,a){1&e&&t._uU(0," Close ")}function ln(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",33),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onSave())}),t._uU(1," Upload "),t.qZA()}if(2&e){const n=t.oxw();t.Q6J("disabled",!n.hasSelectedChannel())}}let Ot=(()=>{class e{constructor(n,o,i,l,r){this.data=n,this.channelService=o,this.productService=i,this.dialogRef=l,this.toastrService=r,this.channelOptions=[],this.uploadResponse=[],this.destroy$=new $t.x,this.uploadResponse=[],this.title=this.data.title,this.channels=this.data.channels,this.products=this.data.products}ngOnInit(){this.initChannelOptions(),this.initCategories()}initCategories(){this.filterChannelTypeId().forEach(o=>{this.channelService.getCategoriesByTypeId(o).pipe((0,Ht.R)(this.destroy$)).subscribe(i=>{this.setCategoriesChannelOption(o,i)})})}setCategoriesChannelOption(n,o){this.channelOptions=this.channelOptions.map(i=>(i.TypeID==n&&(i.Categories=o),i))}initChannelOptions(){this.channelOptions=this.channels.map(n=>({Name:n.Name,Img:n.Img,ID:n.ID,Selected:!1,CategoryID:0,TypeID:n.TypeID,Categories:[]}))}filterChannelTypeId(){return this.data.channels.map(o=>o.TypeID).filter((o,i,l)=>l.indexOf(o)==i).filter(o=>o==U.x.Lazada||o==U.x.Tokopedia)}onSelectCategory(n,o){this.channelOptions[o].CategoryID=n}onSelectAllChannel(n){this.channelOptions=this.channelOptions.map(o=>(o.Selected=n,o))}hasSelectedChannel(){return-1!==this.channelOptions.findIndex(n=>n.Selected)}onClose(){this.dialogRef.close(this.uploadResponse.length>0)}onSave(){if(!this.validateSelectedCategory())return void this.toastrService.warning("Category is required","Warning!");const n=this.channelOptions.filter(o=>o.Selected).map(o=>({CategoryID:o.CategoryID,ChannelID:o.ID}));this.submitToServer(n)}validateSelectedCategory(){return-1==this.channelOptions.filter(o=>o.Selected).filter(o=>o.TypeID==U.x.Lazada||o.TypeID==U.x.Tokopedia).findIndex(o=>0==o.CategoryID)}submitToServer(n){this.productService.uploadToMultipleChannel(this.products,n).subscribe({next:o=>{this.uploadResponse=o,this.filterChannelOptions()},error:o=>{console.error(o)}})}filterChannelOptions(){this.channelOptions=this.channelOptions.filter(n=>-1!==this.uploadResponse.findIndex(o=>o.ChannelID==n.ID))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(m.WI),t.Y36(St),t.Y36(H.M),t.Y36(m.so),t.Y36(j._W))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-modal-uploadMultiple-product"]],decls:21,vars:10,consts:[["mat-dialog-title","",1,"pt-1","pb-1","text-center"],[1,"px-1"],[1,"table"],["style","width: 6%","class","text-center",4,"ngIf"],[2,"width","30%",3,"ngClass"],[2,"width","60%"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end","pe-8"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],[4,"ngIf","ngIfElse"],["CLOSE",""],["mat-button","","data-cy","scan","class","btn btn-success mx-3",3,"disabled","click",4,"ngIf"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[1,"text-center"],["class","text-center",4,"ngIf"],[3,"ngClass"],[1,"d-flex","align-items-center"],["alt","",1,"channel-logo",3,"src"],[1,"ms-3"],["EMPTY",""],["type","checkbox",3,"ngModel","ngModelChange"],["appearance","outline","bindLabel","Value","bindValue","Key","placeholder","Select Category",3,"data","batchSize","disabled","onSelect"],["matTooltip","Cannot choose category Product, Please change category after uploading in seller center","matTooltipPosition","above"],["type","text","disabled","","placeholder","Unavailable Category",1,"form-control","rounded",2,"height","40px"],[1,"text-center","fw-bold","fs-4"],["matTooltip","Upload Success",4,"ngIf"],["class","cursor-pointer text-danger",3,"matTooltip",4,"ngIf"],["matTooltip","Upload Success"],["target","_blank",3,"href"],[1,"fa","fa-check","text-success"],[1,"cursor-pointer","text-danger",3,"matTooltip"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"disabled","click"]],template:function(n,o){if(1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead")(6,"tr"),t.YNc(7,Rt,2,0,"th",3),t.TgZ(8,"th",4),t._uU(9," CHANNEL "),t.qZA(),t.TgZ(10,"th",5),t._uU(11,"CATEGORY"),t.qZA(),t.YNc(12,Gt,3,0,"ng-container",6),t.qZA()(),t.TgZ(13,"tbody"),t.YNc(14,en,13,9,"ng-container",7),t.qZA()()(),t.TgZ(15,"mat-dialog-actions",8)(16,"button",9),t.NdJ("click",function(){return o.onClose()}),t.YNc(17,on,2,0,"span",10),t.YNc(18,an,1,0,"ng-template",null,11,t.W1O),t.qZA(),t.YNc(20,ln,2,1,"button",12),t.qZA()),2&n){const i=t.MAs(19);t.xp6(1),t.hij(" ",o.title,"\n"),t.xp6(6),t.Q6J("ngIf",0==o.uploadResponse.length),t.xp6(1),t.Q6J("ngClass",t.VKq(8,Zt,o.uploadResponse.length>0)),t.xp6(4),t.Q6J("ngIf",o.uploadResponse.length>0),t.xp6(2),t.Q6J("ngForOf",o.channelOptions),t.xp6(3),t.Q6J("ngIf",0==o.uploadResponse.length)("ngIfElse",i),t.xp6(3),t.Q6J("ngIf",0==o.uploadResponse.length)}},dependencies:[c.mk,c.sg,c.O5,y.Wl,y.JJ,y.On,m.uh,m.xY,m.H8,L.gM,wt.h],styles:["input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}img.channel-logo[_ngcontent-%COMP%]{width:24px;height:24px}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}"]}),e})();var B=d(7481);let C,Nt,s,p,T,Z,Y,O,D,J,pt,z,w,kt,v,E,W,X,tt,nt,N,ut;const et=[];let ot,gt,R,ht,it,at,h,_,V,lt,x,q={};const f="appendChild",b="createElement",M="removeChild";function At(){const{top:e,left:a,width:n,height:o}=C.getBoundingClientRect();return`transform:translate3D(${a-(s.clientWidth-n)/2}px, ${e-(s.clientHeight-o)/2}px, 0) scale3D(${C.clientWidth/p.clientWidth}, ${C.clientHeight/p.clientHeight}, 0)`}function k(e){const a=_.length-1;if(!w){if(e>0&&h===a||e<0&&!h){if(!x.loop)return P(T,""),void setTimeout(P,9,T,`animation:${e>0?"bpl":"bpf"} .3s;transition:transform .35s`);h=e>0?-1:a+1}if(h=Math.max(0,Math.min(h+e,a)),[h-1,h,h+1].forEach(o=>{if(o=Math.max(0,Math.min(o,a)),q[o])return;const i=_[o].src,l=document[b]("IMG");l.addEventListener("load",Ut.bind(null,i)),l.src=i,q[o]=l}),q[h].complete)return mt(e);w=!0,P(v,"opacity:.4;"),s[f](v),q[h].onload=()=>{N&&mt(e)},q[h].onerror=()=>{_[h]={error:"Error loading image"},N&&mt(e)}}}function mt(e){w&&(s[M](v),w=!1);const a=_[h];if(a.error)alert(a.error);else{const n=s.querySelector("img:last-of-type");T=p=q[h],P(T,`animation:${e>0?"bpfl":"bpfr"} .35s;transition:transform .35s`),P(n,`animation:${e>0?"bpfol":"bpfor"} .35s both`),s[f](T),a.el&&(C=a.el)}V.innerHTML=`${h+1}/${_.length}`,rt(_[h].caption),ht&&ht([T,_[h]])}function _t(){let e,a;const n=.95*window.innerHeight,o=.95*window.innerWidth,i=n/o,[l,r]=x.dimensions||[1920,1080],u=r/l;u>i?(e=Math.min(r,n),a=e/u):(a=Math.min(l,o),e=a*u),O.style.cssText+=`width:${a}px;height:${e}px;`}function ft(e){~[1,4].indexOf(p.readyState)?(Q(),setTimeout(()=>{p.play()},99)):p.error?Q(e):kt=setTimeout(ft,35,e)}function $(e){x.noLoader||(e&&P(v,`top:${C.offsetTop}px;left:${C.offsetLeft}px;height:${C.clientHeight}px;width:${C.clientWidth}px`),C.parentElement[e?f:M](v),w=e)}function rt(e){e&&(W.innerHTML=e),P(E,"opacity:"+(e?"1;pointer-events:auto":"0"))}function Ut(e){!~et.indexOf(e)&&et.push(e)}function Q(e){if(w&&$(),gt&&gt(),"string"==typeof e)return xt(),x.onError?x.onError():alert(`Error: The requested ${e} could not be loaded.`);ot&&Ut(J),p.style.cssText+=At(),P(s,"opacity:1;pointer-events:auto"),R&&(R=setTimeout(R,410)),nt=!0,N=!!_,setTimeout(()=>{p.style.cssText+="transition:transform .35s;transform:none",X&&setTimeout(rt,250,X)},60)}function Ct(e){const a=e?e.target:s,n=[E,tt,Z,Y,W,at,it,v];a.blur(),!ut&&!~n.indexOf(a)&&(p.style.cssText+=At(),P(s,"pointer-events:auto"),setTimeout(xt,350),clearTimeout(R),nt=!1,ut=!0)}function xt(){if((p===O?D:p).removeAttribute("src"),document.body[M](s),s[M](p),P(s,""),P(p,""),rt(!1),N){const a=s.querySelectorAll("img");for(let n=0;n<a.length;n++)s[M](a[n]);w&&s[M](v),s[M](V),N=_=!1,q={},lt||s[M](it),lt||s[M](at),T.onload=Q,T.onerror=Q.bind(null,"image")}x.onClose&&x.onClose(),ut=w=!1}function P({style:e},a){e.cssText=a}function un(e,a){if(1&e){const n=t.EpF();t.ynx(0),t.TgZ(1,"img",18),t.NdJ("click",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.onZoomImage(i))}),t.qZA(),t.BQk()}if(2&e){const n=t.oxw();t.xp6(1),t.Q6J("src",n.image,t.LSH)}}function gn(e,a){1&e&&t._UZ(0,"img",19)}function hn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",20),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onEventDesc())}),t._UZ(1,"i",21),t.TgZ(2,"span"),t._uU(3),t.qZA()()}if(2&e){const n=t.oxw();t.xp6(3),t.Oqu(n.code)}}function mn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",20),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onEventDesc())}),t._UZ(1,"i",22),t.TgZ(2,"span"),t._uU(3),t.qZA()()}if(2&e){const n=t.oxw();t.xp6(3),t.Oqu(n.description)}}function _n(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",23)(1,"input",24),t.NdJ("change",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.onCheck(i.target.checked))}),t.qZA()()}}function fn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",25),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onDownload())}),t._UZ(1,"i",26),t._uU(2," Download "),t.qZA()}}function Cn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",25),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onUpload())}),t._UZ(1,"i",27),t._uU(2," Upload "),t.qZA()}}function xn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",28),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onScan())}),t._UZ(1,"i",29),t._uU(2," Scan "),t.qZA()}}const bn=function(e){return{"me-3":e}};function Pn(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"a",31),t._UZ(2,"img",32),t.qZA(),t.BQk()),2&e){const n=a.$implicit,o=a.index,i=t.oxw(2);t.xp6(1),t.s9C("href",n.Url,t.LSH),t.xp6(1),t.Q6J("ngClass",t.VKq(4,bn,o!=i.channels.length-1))("src",i.getChannelLogo(n),t.LSH)("matTooltip",n.Title?n.Title:n.Name)}}function Tn(e,a){if(1&e&&(t.ynx(0),t.YNc(1,Pn,3,6,"ng-container",30),t.BQk()),2&e){const n=t.oxw();t.xp6(1),t.Q6J("ngForOf",n.channels)}}const vn=function(e){return{"border-bottom pb-2":e}};function yn(e,a){if(1&e&&(t.TgZ(0,"li")(1,"div",36)(2,"div",37)(3,"a",31),t._UZ(4,"img",38),t.TgZ(5,"span",39),t._uU(6),t.qZA()()()()()),2&e){const n=a.$implicit,o=a.index,i=t.oxw(2);t.xp6(2),t.Q6J("ngClass",t.VKq(4,vn,o!=i.channels.length-1)),t.xp6(1),t.Q6J("href",n.Url,t.LSH),t.xp6(1),t.Q6J("src",i.getChannelLogo(n),t.LSH),t.xp6(2),t.Oqu(n.Title)}}function Sn(e,a){if(1&e&&(t.TgZ(0,"div",33)(1,"button",34),t._uU(2),t.qZA(),t.TgZ(3,"ul",35),t.YNc(4,yn,7,6,"li",30),t.qZA()()),2&e){const n=t.oxw();t.xp6(2),t.hij(" ",n.channels.length," CHANNELS "),t.xp6(2),t.Q6J("ngForOf",n.channels)}}let bt=(()=>{class e{constructor(){this.uploadButton=!1,this.scanButton=!1,this.showCheckBox=!1,this.downloadButton=!1,this.hasZoom=!0,this.onUploadEvent=new t.vpe,this.onScanEvent=new t.vpe,this.checkBoxChange=new t.vpe,this.onDescEvent=new t.vpe,this.onDownloadEvent=new t.vpe}onUpload(){this.onUploadEvent.emit()}onScan(){this.onScanEvent.emit()}onCheck(n){this.checkBoxChange.emit(n)}onEventDesc(){this.onDescEvent.emit()}onDownload(){this.onDownloadEvent.emit()}getChannelLogo(n){return g.g.getChannelLogoByTypeId(n.TypeID)}onZoomImage(n){this.hasZoom&&(e=>{Nt||function cn(e){let a,n;function o(u){const S=document[b]("button");return S.className=u,S.innerHTML='<svg viewBox="0 0 48 48"><path d="M28 24L47 5a3 3 0 1 0-4-4L24 20 5 1a3 3 0 1 0-4 4l19 19L1 43a3 3 0 1 0 4 4l19-19 19 19a3 3 0 0 0 4 0v-4L28 24z"/></svg>',S}function i(u,S){const K=document[b]("button");return K.className="bp-lr",K.innerHTML='<svg viewBox="0 0 129 129" height="70" fill="#fff"><path d="M88.6 121.3c.8.8 1.8 1.2 2.9 1.2s2.1-.4 2.9-1.2a4.1 4.1 0 0 0 0-5.8l-51-51 51-51a4.1 4.1 0 0 0-5.8-5.8l-54 53.9a4.1 4.1 0 0 0 0 5.8l54 53.9z"/></svg>',P(K,S),K.onclick=ke=>{ke.stopPropagation(),k(u)},K}const l=document[b]("STYLE");l.innerHTML=`#bp_caption,#bp_container{bottom:0;left:0;right:0;position:fixed;opacity:0}#bp_container>*,#bp_loader{position:absolute;right:0;z-index:10}#bp_container,#bp_caption,#bp_container svg{pointer-events:none}#bp_container{top:0;z-index:9999;background:${e&&e.overlayColor?e.overlayColor:"rgba(0,0,0,.7)"};opacity:0;transition:opacity .35s}#bp_loader{top:0;left:0;bottom:0;display:flex;align-items:center;cursor:wait;background:0;z-index:9}#bp_loader svg{width:50%;max-width:300px;max-height:50%;margin:auto;animation:bpturn 1s infinite linear}#bp_aud,#bp_container img,#bp_sv,#bp_vid{user-select:none;max-height:96%;max-width:96%;top:0;bottom:0;left:0;margin:auto;box-shadow:0 0 3em rgba(0,0,0,.4);z-index:-1}#bp_sv{background:#111}#bp_sv svg{width:66px}#bp_caption{font-size:.9em;padding:1.3em;background:rgba(15,15,15,.94);color:#fff;text-align:center;transition:opacity .3s}#bp_aud{width:650px;top:calc(50% - 20px);bottom:auto;box-shadow:none}#bp_count{left:0;right:auto;padding:14px;color:rgba(255,255,255,.7);font-size:22px;cursor:default}#bp_container button{position:absolute;border:0;outline:0;background:0;cursor:pointer;transition:all .1s}#bp_container>.bp-x{padding:0;height:41px;width:41px;border-radius:100%;top:8px;right:14px;opacity:.8;line-height:1}#bp_container>.bp-x:focus,#bp_container>.bp-x:hover{background:rgba(255,255,255,.2)}.bp-x svg,.bp-xc svg{height:21px;width:20px;fill:#fff;vertical-align:top;}.bp-xc svg{width:16px}#bp_container .bp-xc{left:2%;bottom:100%;padding:9px 20px 7px;background:#d04444;border-radius:2px 2px 0 0;opacity:.85}#bp_container .bp-xc:focus,#bp_container .bp-xc:hover{opacity:1}.bp-lr{top:50%;top:calc(50% - 130px);padding:99px 0;width:6%;background:0;border:0;opacity:.4;transition:opacity .1s}.bp-lr:focus,.bp-lr:hover{opacity:.8}@keyframes bpf{50%{transform:translatex(15px)}100%{transform:none}}@keyframes bpl{50%{transform:translatex(-15px)}100%{transform:none}}@keyframes bpfl{0%{opacity:0;transform:translatex(70px)}100%{opacity:1;transform:none}}@keyframes bpfr{0%{opacity:0;transform:translatex(-70px)}100%{opacity:1;transform:none}}@keyframes bpfol{0%{opacity:1;transform:none}100%{opacity:0;transform:translatex(-70px)}}@keyframes bpfor{0%{opacity:1;transform:none}100%{opacity:0;transform:translatex(70px)}}@keyframes bpturn{0%{transform:none}100%{transform:rotate(360deg)}}@media (max-width:600px){.bp-lr{font-size:15vw}}`,document.head[f](l),s=document[b]("DIV"),s.id="bp_container",s.onclick=Ct,pt=o("bp-x"),s[f](pt),"ontouchend"in window&&window.visualViewport&&(lt=!0,s.ontouchstart=({touches:u,changedTouches:S})=>{n=u.length>1,a=S[0].pageX},s.ontouchend=({changedTouches:u})=>{if(N&&!n&&window.visualViewport.scale<=1){let S=u[0].pageX-a;S<-30&&k(1),S>30&&k(-1)}}),T=document[b]("IMG"),Z=document[b]("VIDEO"),Z.id="bp_vid",Z.setAttribute("playsinline",!0),Z.controls=!0,Z.loop=!0,Y=document[b]("audio"),Y.id="bp_aud",Y.controls=!0,Y.loop=!0,V=document[b]("span"),V.id="bp_count",E=document[b]("DIV"),E.id="bp_caption",tt=o("bp-xc"),tt.onclick=rt.bind(null,!1),E[f](tt),W=document[b]("SPAN"),E[f](W),s[f](E),it=i(1,"transform:scalex(-1)"),at=i(-1,"left:0;right:auto"),v=document[b]("DIV"),v.id="bp_loader",v.innerHTML='<svg viewbox="0 0 32 32" fill="#fff" opacity=".8"><path d="M16 0a16 16 0 0 0 0 32 16 16 0 0 0 0-32m0 4a12 12 0 0 1 0 24 12 12 0 0 1 0-24" fill="#000" opacity=".5"/><path d="M16 0a16 16 0 0 1 16 16h-4A12 12 0 0 0 16 4z"/></svg>',O=document[b]("DIV"),O.id="bp_sv",D=document[b]("IFRAME"),D.setAttribute("allowfullscreen",!0),D.allow="autoplay; fullscreen",D.onload=()=>O[M](v),P(D,"border:0;position:absolute;height:100%;width:100%;left:0;top:0"),O[f](D),T.onload=Q,T.onerror=Q.bind(null,"image"),window.addEventListener("resize",()=>{N||w&&$(!0),p===O&&_t()}),document.addEventListener("keyup",({keyCode:u})=>{27===u&&nt&&Ct(),N&&(39===u&&k(1),37===u&&k(-1),38===u&&k(10),40===u&&k(-10))}),document.addEventListener("keydown",u=>{N&&~[37,38,39,40].indexOf(u.keyCode)&&u.preventDefault()}),document.addEventListener("focus",u=>{nt&&!s.contains(u.target)&&(u.stopPropagation(),pt.focus())},!0),Nt=!0}(e),w&&(clearTimeout(kt),xt()),x=e,z=e.ytSrc||e.vimeoSrc,gt=e.animationStart,R=e.animationEnd,ht=e.onChangeImage,C=e.el,ot=!1,X=C.getAttribute("data-caption"),e.gallery?function dn(e,a){let n=x.galleryAttribute||"data-bp";if(Array.isArray(e))h=a||0,_=e,X=e[h].caption;else{_=[].slice.call("string"==typeof e?document.querySelectorAll(`${e} [${n}]`):e);const o=_.indexOf(C);h=0===a||a?a:-1!==o?o:0,_=_.map(i=>({el:i,src:i.getAttribute(n),caption:i.getAttribute("data-caption")}))}ot=!0,J=_[h].src,!~et.indexOf(J)&&$(!0),_.length>1?(s[f](V),V.innerHTML=`${h+1}/${_.length}`,lt||(s[f](it),s[f](at))):_=!1,p=T,p.src=J}(e.gallery,e.position):z||e.iframeSrc?(p=O,function pn(){let e;const a="https://",n="autoplay=1";x.ytSrc?e=`${a}www.youtube${x.ytNoCookie?"-nocookie":""}.com/embed/${z}?html5=1&rel=0&playsinline=1&${n}`:x.vimeoSrc?e=`${a}player.vimeo.com/video/${z}?${n}`:x.iframeSrc&&(e=x.iframeSrc),P(v,""),O[f](v),D.src=e,_t(),setTimeout(Q,9)}()):e.imgSrc?(ot=!0,J=e.imgSrc,!~et.indexOf(J)&&$(!0),p=T,p.src=J):e.audio?($(!0),p=Y,p.src=e.audio,ft("audio file")):e.vidSrc?($(!0),e.dimensions&&P(Z,`width:${e.dimensions[0]}px`),function sn(e){Array.isArray(e)?(p=Z.cloneNode(),e.forEach(a=>{const n=document[b]("SOURCE");n.src=a,n.type=`video/${a.match(/.(\w+)$/)[1]}`,p[f](n)})):(p=Z,p.src=e)}(e.vidSrc),ft("video")):(p=T,p.src="IMG"===C.tagName?C.src:window.getComputedStyle(C).backgroundImage.replace(/^url|[(|)|'|"]/g,"")),s[f](p),document.body[f](s)})({el:n.target,imgSrc:this.imageForZoom,noLoader:!1})}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-product-card"]],inputs:{uploadButton:"uploadButton",scanButton:"scanButton",showCheckBox:"showCheckBox",downloadButton:"downloadButton",image:"image",title:"title",code:"code",description:"description",channels:"channels",check:"check",imageForZoom:"imageForZoom",hasZoom:"hasZoom"},outputs:{onUploadEvent:"onUpload",onScanEvent:"onScan",checkBoxChange:"onCheckBoxChange",onDescEvent:"onDescEvent",onDownloadEvent:"onDownload"},decls:26,vars:11,consts:[[1,"card",2,"margin-bottom","0px"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"col-7","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle","cursor-pointer",3,"click"],["class","description cursor-pointer",3,"click",4,"ngIf"],[1,"col-1","gx-0","d-flex","justify-content-center"],[1,"text-end"],["class","text-end gx-0",4,"ngIf"],[1,"card-footer","d-flex","justify-content-between","py-5","bg-footer","align-items-center",2,"border-top","0.1px solid rgb(220 220 220)"],["class","fs-6 btn btn-light btn-sm me-3",3,"click",4,"ngIf"],["class","fs-6 btn btn-light btn-sm",3,"click",4,"ngIf"],["DROPDOWN",""],["alt","",1,"rounded","imgUpload","float-left",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload"],[1,"description","cursor-pointer",3,"click"],[1,"fa","fa-barcode","me-2"],[1,"fa","fa-tag","me-2"],[1,"text-end","gx-0"],["type","checkbox",3,"change"],[1,"fs-6","btn","btn-light","btn-sm","me-3",3,"click"],["aria-hidden","true",1,"fa","fa-download"],["aria-hidden","true",1,"fa","fa-upload"],[1,"fs-6","btn","btn-light","btn-sm",3,"click"],[1,"fa","fa-spinner"],[4,"ngFor","ngForOf"],["target","_blank",3,"href"],["alt","",1,"img-logo",3,"ngClass","src","matTooltip"],[1,"dropdown"],["type","button","id","dropdownMenuButton1","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","fs-6","btn-sm","btn-light","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item","py-2",2,"cursor","pointer"],[3,"ngClass"],[1,"img-logo",3,"src"],[1,"ms-4"]],template:function(n,o){if(1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),t.YNc(6,un,2,1,"ng-container",6),t.YNc(7,gn,1,0,"ng-template",null,7,t.W1O),t.qZA()()(),t.TgZ(9,"div",8)(10,"h4",9),t.NdJ("click",function(){return o.onEventDesc()}),t._uU(11),t.qZA(),t.YNc(12,hn,4,1,"div",10),t.YNc(13,mn,4,1,"div",10),t.qZA(),t.TgZ(14,"div",11)(15,"div",12),t.YNc(16,_n,2,0,"div",13),t.qZA()()()(),t.TgZ(17,"div",14)(18,"div"),t.YNc(19,fn,3,0,"button",15),t.YNc(20,Cn,3,0,"button",15),t.YNc(21,xn,3,0,"button",16),t.qZA(),t.TgZ(22,"div"),t.YNc(23,Tn,2,1,"ng-container",6),t.YNc(24,Sn,5,2,"ng-template",null,17,t.W1O),t.qZA()()()),2&n){const i=t.MAs(8),l=t.MAs(25);t.xp6(6),t.Q6J("ngIf",o.image)("ngIfElse",i),t.xp6(5),t.hij(" ",o.title," "),t.xp6(1),t.Q6J("ngIf",o.code),t.xp6(1),t.Q6J("ngIf",o.description),t.xp6(3),t.Q6J("ngIf",o.showCheckBox),t.xp6(3),t.Q6J("ngIf",o.downloadButton),t.xp6(1),t.Q6J("ngIf",o.uploadButton),t.xp6(1),t.Q6J("ngIf",o.scanButton),t.xp6(2),t.Q6J("ngIf",o.channels.length<4)("ngIfElse",l)}},dependencies:[c.mk,c.sg,c.O5,L.gM],styles:[".img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100%}.bg-footer[_ngcontent-%COMP%]{background-color:#ededed69}.description[_ngcontent-%COMP%]{font-weight:300;margin-left:2px}.productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down;cursor:pointer}"]}),e})();function wn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"span",10),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.getTotal())}),t.TgZ(1,"i",11),t._uU(2,"?"),t.qZA()()}}function Mn(e,a){if(1&e&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&e){const n=t.oxw();t.xp6(1),t.Oqu(t.lcZ(2,1,n.paginationTotal))}}let Pt=(()=>{class e{constructor(){this.get=new t.vpe,this.change=new t.vpe,this.next=new t.vpe,this.previous=new t.vpe,this.total=new t.vpe,this.hasClicked=!1}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.change.emit(this.filter)}getTotal(){this.total.emit()}PreviousPage(){this.previous.emit()}NextPage(){this.next.emit()}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-custom-paginator"]],inputs:{filter:"filter",paginationTotal:"paginationTotal",totaldata:"totaldata",hasClicked:"hasClicked"},outputs:{get:"get",change:"change",next:"next",previous:"previous",total:"total"},decls:16,vars:11,consts:[[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"],[4,"ngIf"],[1,"btn-group"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"hidden","click"],[1,"fas","fa-arrow-left"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"hidden","click"],[1,"fas","fa-arrow-right"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"]],template:function(n,o){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3),t.ALo(4,"number"),t.ALo(5,"number"),t.YNc(6,wn,3,0,"span",3),t.YNc(7,Mn,3,3,"span",4),t._uU(8),t.qZA()(),t.TgZ(9,"div",5)(10,"a",6),t.NdJ("click",function(){return o.PreviousPage()}),t._UZ(11,"i",7),t._uU(12," Prev"),t.qZA(),t.TgZ(13,"a",8),t.NdJ("click",function(){return o.NextPage()}),t._UZ(14,"i",9),t._uU(15," Next"),t.qZA()()()),2&n&&(t.xp6(3),t.AsE(" Showing ",t.lcZ(4,7,o.filter.PageSize*(o.filter.PageNumber-1)+1)," - ",t.lcZ(5,9,o.filter.PageSize*(o.filter.PageNumber-1)+o.totaldata)," of "),t.xp6(3),t.Q6J("ngIf",!o.hasClicked),t.xp6(1),t.Q6J("ngIf",o.hasClicked),t.xp6(1),t.hij(" records ~ ",o.filter.PageNumber," Page "),t.xp6(2),t.Q6J("hidden",1==o.filter.PageNumber),t.xp6(3),t.Q6J("hidden",o.filter.PageSize*(o.filter.PageNumber-1)+o.totaldata==o.paginationTotal||o.totaldata<o.filter.PageSize))},dependencies:[c.O5,c.JJ]}),e})();function In(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",10),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onOpenScanDialog())}),t._UZ(1,"i",11),t._uU(2," Scan Channel "),t.qZA()}}function Zn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",12),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onScanMultipleProduct())}),t._UZ(1,"i",11),t._uU(2),t.qZA()}if(2&e){const n=t.oxw();let o;t.xp6(2),t.hij(" Scan Selected Product (",null==(o=n.productService.selectedProduct(n.products))?null:o.length,") ")}}function On(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onUploadMultipleProductSingleChannel())}),t._UZ(1,"i",14),t._uU(2," Upload Bulk "),t.qZA()}}function Nn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",15)(1,"app-product-card",16),t.NdJ("onUpload",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onUploadToMultipleChannel(l))})("onScan",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onScanSingleProduct(l))})("onDescEvent",function(){const l=t.CHM(n).index,r=t.oxw();return t.KtG(r.onOpenDialogVariant(l))})("onCheckBoxChange",function(i){const r=t.CHM(n).$implicit;return t.KtG(r.selected=i)}),t.qZA()()}if(2&e){const n=a.$implicit,o=t.oxw();t.xp6(1),t.Q6J("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)}}let kn=(()=>{class e{constructor(n,o,i,l){this.http=n,this.toastr=o,this.dialog=i,this.productService=l,this.searchFilter=new dt,this.rowCount=0,this.getLoaderPage()}getLoaderPage(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter.PageNumber=n.Filter.PageNumber,this.searchFilter.RowCount=n.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.sync=!0,this.searchFilter.PageSize=100,this.getProducts()})}getProducts(){this.http.post("/api/product/GetInPOS",this.searchFilter).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 n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=g.g.GuidEMpty,this.dialog.open(A.j,{data:{filter:n,Channel:this.channelOptions},width:"30%"}).afterClosed().pipe((0,I.h)(i=>g.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter=i,this.scanAllProduct()})}scanAllProduct(){null!=this.searchFilter.ChannelID?this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,!1).subscribe(n=>{this.getProducts();let o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(n,o,!0)}):this.toastr.error("Please Select Channel","Error")}onOpenDialogVariant(n){this.dialog.open(It,{data:{title:this.products[n].Name,variants:this.products[n].Variants},width:"45%"})}onUploadMultipleProductSingleChannel(){this.dialog.open(Mt,{width:"350px",data:{item:null,selectedItemMissingChannel:this.channelOptions}}).afterClosed().subscribe(n=>{n&&this.uploadMultipleProduct(n.channelID,n.categoryID)})}uploadMultipleProduct(n,o){const i=this.productService.selectedProduct(this.products);this.productService.uploadMultipleProduct(i,n,o).subscribe(l=>{this.getProducts();const r=this.productService.findChannelById(n,this.channelOptions);this.toastr.success(i.length>1?"Successfully uploaded "+i.length+" Product to channel "+r?.Name:r?.Name+" Successfully Created","Success")})}onUploadToMultipleChannel(n){let o=this.productService.getChannelProduct(n);n.Channel=o;let i=this.productService.filterUnselectedChannel(n,this.channelOptions);this.dialog.open(Ot,{width:"700px",data:{title:`Upload ${n.Name}`,channels:i,products:[n]}}).afterClosed().subscribe(l=>{l&&this.getProducts()})}searchProduct(n){this.searchFilter.text=n,this.getProducts()}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}onScanMultipleProduct(){let n=this.productService.filterChannelByTypeId(this.channelOptions,[U.x.Tokopedia,U.x.Tiktok]);this.dialog.open(A.j,{data:{filter:Object.assign({},this.searchFilter),Channel:n,isSingleChannel:!0,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,I.h)(i=>g.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter=i;let l=this.productService.selectedProduct(this.products),r=this.productService.getVariantCodesProducts(l);this.scanSingleProduct(r)})}onScanSingleProduct(n){this.dialog.open(A.j,{data:{filter:Object.assign({},this.searchFilter),Channel:this.channelOptions,showScanUpdateType:!1,showScanType:!1,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,I.h)(o=>g.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter=o;const i=this.productService.getVariantCodesProduct(n);this.scanSingleProduct(i)})}scanSingleProduct(n){this.productService.scanSingle(this.searchFilter.ChannelID,n).subscribe({next:o=>{if(o)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=g.g.GuidEMpty,o&&this.getProducts()},error:o=>{this.searchFilter.ChannelID=g.g.GuidEMpty}})}getVariantCode(n){let o;return n.length>1&&(o=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(o=n[0].Code),o}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(F.O),t.Y36(j._W),t.Y36(m.uw),t.Y36(H.M))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-in-pos"]],decls:12,vars:9,consts:[["hideSearchDropdown","true","hideSearchDropdown","false",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,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous"],["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,"title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onScan","onDescEvent","onCheckBoxChange"]],template:function(n,o){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return o.searchProduct(l)}),t.TgZ(1,"actions"),t.YNc(2,In,3,0,"button",1),t.YNc(3,Zn,3,1,"button",2),t.YNc(4,On,3,0,"button",3),t.qZA(),t.TgZ(5,"content")(6,"div",4)(7,"div",5),t.YNc(8,Nn,2,9,"div",6),t.qZA(),t.TgZ(9,"div",7)(10,"div",8)(11,"app-custom-paginator",9),t.NdJ("next",function(){return o.onNextPage()})("previous",function(){return o.onPrevPage()}),t.qZA()()()()()()),2&n&&(t.Q6J("headerTitle","In POS ("+o.rowCount+")"),t.xp6(2),t.Q6J("ngIf",!o.productService.hasSelection(o.products)),t.xp6(1),t.Q6J("ngIf",o.productService.hasSelection(o.products)),t.xp6(1),t.Q6J("ngIf",o.productService.hasSelection(o.products)),t.xp6(4),t.Q6J("ngForOf",o.products),t.xp6(3),t.Q6J("filter",o.searchFilter)("totaldata",null==o.products?null:o.products.length)("paginationTotal",o.rowCount)("hasClicked",!0))},dependencies:[c.sg,c.O5,B.p,bt,Pt],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}}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}"]}),e})();var ct=d(8796);function An(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",12),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onOpenScanDialog())}),t._UZ(1,"i",13),t._uU(2," Scan Channel "),t.qZA()}}function Un(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",14),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onScanSelectedProduct())}),t._UZ(1,"i",13),t._uU(2),t.qZA()}if(2&e){const n=t.oxw();t.xp6(2),t.hij(" Scan Selected Product (",n.productService.selectedProduct(n.products).length,") ")}}function Dn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",15)(1,"app-product-card",16),t.NdJ("onUpload",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onUploadToMultipleChannel(l))})("onDescEvent",function(){const l=t.CHM(n).index,r=t.oxw();return t.KtG(r.onOpenVariantDetail(l))})("onScan",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onScanSingleProduct(l))})("onCheckBoxChange",function(i){const r=t.CHM(n).$implicit;return t.KtG(r.selected=i)}),t.qZA()()}if(2&e){const n=a.$implicit,o=t.oxw();t.xp6(1),t.Q6J("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 Fn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",17)(1,"div",18)(2,"app-custom-paginator",19),t.NdJ("total",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.getRowCount())})("next",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onNextPage())})("previous",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onPreviousPage())}),t.qZA()()()}if(2&e){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)}}let Jn=(()=>{class e{constructor(n,o,i,l){this.http=n,this.dialog=o,this.toastr=i,this.productService=l,this.searchFilter=new dt,this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=g.g.GuidEMpty,this.getLoaderPage()}getLoaderPage(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.searchFilter.ChannelID=n.Filter.ChannelID,this.searchFilter.sync=!1,this.searchFilter.mode=1,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.productService.findAllSoldInChannel(this.searchFilter).subscribe(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}searchProduct(n){this.searchFilter.text=n,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(n){this.dialog.open(It,{data:{variants:this.products[n].Variants,title:this.products[n].Name},width:"45%"})}onOpenScanDialog(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=g.g.GuidEMpty,this.dialog.open(A.j,{data:{filter:n,Channel:this.channelOptions},width:"40%"}).afterClosed().pipe((0,I.h)(i=>g.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter=i,this.scanAllProduct()})}scanAllProduct(){let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct).pipe((0,I.h)(o=>o)).subscribe(o=>{this.productService.successToastrScanAllProduct(o,n,!this.searchFilter.UpdatedProduct),this.getLoaderPage()})}onScanSingleProduct(n){n.Channel=this.productService.getChannelProduct(n),this.dialog.open(A.j,{data:{filter:Object.assign({},this.searchFilter),Channel:this.channelOptions,showScanUpdateType:!1,showScanType:!1,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,I.h)(o=>g.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter=o;const i=this.productService.getVariantCodesProduct(n);this.scanSingleProduct(i)})}onUploadToMultipleChannel(n){let o=this.productService.getChannelProduct(n);n.Channel=o;let i=this.productService.filterUnselectedChannel(n,this.channelOptions);this.dialog.open(Ot,{width:"700px",data:{title:`Upload ${n.Name}`,channels:i,products:[n]}}).afterClosed().subscribe(l=>{l&&this.getProducts()})}onScanSelectedProduct(){let n=this.productService.filterChannelByTypeId(this.channelOptions,[U.x.Tokopedia,U.x.Tiktok]);this.dialog.open(A.j,{data:{filter:this.searchFilter,Channel:n,isSingleChannel:!0,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,I.h)(i=>g.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter=i;let l=this.productService.selectedProduct(this.products),r=this.productService.getVariantCodesProducts(l);this.scanSingleProduct(r)})}scanSingleProduct(n){this.productService.scanSingle(this.searchFilter.ChannelID,n).subscribe({next:o=>{if(o)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=g.g.GuidEMpty,o&&this.getProducts()},error:o=>{this.searchFilter.ChannelID=g.g.GuidEMpty}})}getVariantCode(n){let o;return n.length>1&&(o=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(o=n[0].Code),o}onClearFilterChannel(){this.searchFilter.ChannelID=g.g.GuidEMpty}onUploadMultipleProductSingleChannel(){this.dialog.open(Mt,{width:"350px",data:{item:null,selectedItemMissingChannel:this.channelOptions}}).afterClosed().subscribe(n=>{n&&this.uploadMultipleProduct(n.channelID,n.categoryID)})}uploadMultipleProduct(n,o){const i=this.productService.selectedProduct(this.products);this.productService.uploadMultipleProduct(i,n,o).subscribe(l=>{this.getProducts();const r=this.productService.findChannelById(n,this.channelOptions);this.toastr.success(i.length>1?"Successfully uploaded "+i.length+" Product to channel "+r?.Name:r?.Name+" Successfully Created","Success")})}getRowCount(){this.http.post("/api/product/GetSoldInChannelRowCount",{ChannelID:this.searchFilter.ChannelID}).subscribe(o=>{this.hasClickRowCount=!0,this.rowCount=o.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(F.O),t.Y36(m.uw),t.Y36(j._W),t.Y36(H.M))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-sold-in-channel"]],decls:19,vars:8,consts:[["headerTitle","Sold in Channel",3,"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"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"hidden","click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],[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,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onDescEvent","onScan","onCheckBoxChange"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(n,o){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return o.searchProduct(l)}),t.TgZ(1,"actions"),t.YNc(2,An,3,0,"button",1),t.YNc(3,Un,3,1,"button",2),t.TgZ(4,"button",3),t.NdJ("click",function(){return o.onUploadMultipleProductSingleChannel()}),t._UZ(5,"i",4),t._uU(6," Upload Bulk "),t.qZA()(),t.TgZ(7,"filters")(8,"div",5)(9,"div",6)(10,"div")(11,"h6"),t._uU(12,"Channel"),t.qZA(),t.TgZ(13,"ng-select",7),t.NdJ("ngModelChange",function(l){return o.searchFilter.ChannelID=l})("clear",function(){return o.onClearFilterChannel()}),t.qZA()()()()(),t.TgZ(14,"content")(15,"div",8)(16,"div",9),t.YNc(17,Dn,2,9,"div",10),t.qZA(),t.YNc(18,Fn,3,4,"div",11),t.qZA()()()),2&n&&(t.xp6(2),t.Q6J("ngIf",!o.productService.hasSelection(o.products)),t.xp6(1),t.Q6J("ngIf",o.productService.hasSelection(o.products)),t.xp6(1),t.Q6J("hidden",!o.productService.hasSelection(o.products)),t.xp6(9),t.Q6J("clearable",!0)("items",o.channelOptions)("ngModel",o.searchFilter.ChannelID==o.guidEmpty?null:o.searchFilter.ChannelID),t.xp6(4),t.Q6J("ngForOf",o.products),t.xp6(1),t.Q6J("ngIf",null==o.products?null:o.products.length))},dependencies:[c.sg,c.O5,y.JJ,y.On,B.p,ct.w9,bt,Pt],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}}"]}),e})();var En=d(8505),qn=d(4004),Qn=d(7287);function Ln(e,a){if(1&e&&(t.ynx(0),t._UZ(1,"img",24),t.BQk()),2&e){const n=t.oxw(3).$implicit;t.xp6(1),t.Q6J("src",null==n?null:n.ImageUrl,t.LSH)}}function Bn(e,a){1&e&&t._UZ(0,"img",25)}function Yn(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"td",18)(2,"div",5)(3,"div",19),t.YNc(4,Ln,2,1,"ng-container",20),t.YNc(5,Bn,1,0,"ng-template",null,21,t.W1O),t.qZA(),t.TgZ(7,"div",22)(8,"h4",23)(9,"span"),t._uU(10),t.qZA()()()()(),t.BQk()),2&e){const n=t.MAs(6),o=t.oxw(2).$implicit;t.xp6(1),t.Q6J("rowSpan",null==o?null:o.Variants.length),t.xp6(3),t.Q6J("ngIf",null==o?null:o.ImageUrl)("ngIfElse",n),t.xp6(3),t.Q6J("matTooltip",(null==o||null==o.Name?null:o.Name.length)>50?null==o?null:o.Name:""),t.xp6(3),t.Oqu(null==o?null:o.Name)}}function Vn(e,a){if(1&e&&(t.TgZ(0,"div")(1,"a",26),t._UZ(2,"img",27),t.qZA()()),2&e){const n=a.$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 $n(e,a){if(1&e&&(t.TgZ(0,"div"),t._UZ(1,"img",27),t.qZA()),2&e){const n=a.$implicit;t.xp6(1),t.Q6J("src",n.Img,t.LSH)("matTooltip",n.Name)}}function Hn(e,a){if(1&e&&(t.TgZ(0,"tr"),t.YNc(1,Yn,11,5,"ng-container",13),t.TgZ(2,"td"),t._uU(3),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td",16)(7,"div",17),t.YNc(8,Vn,3,3,"div",15),t.qZA()(),t.TgZ(9,"td",16)(10,"div",17),t.YNc(11,$n,2,2,"div",15),t.qZA()()()),2&e){const n=a.$implicit,o=a.index;t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(2),t.hij(" ",n.Name," "),t.xp6(2),t.hij(" ",n.Code," "),t.xp6(3),t.Q6J("ngForOf",null==n?null:n.Available),t.xp6(3),t.Q6J("ngForOf",null==n?null:n.NotAvailable)}}function Rn(e,a){if(1&e&&(t.ynx(0),t.YNc(1,Hn,12,5,"tr",15),t.BQk()),2&e){const n=a.$implicit;t.xp6(1),t.Q6J("ngForOf",n.Variants)}}function Gn(e,a){if(1&e&&(t.TgZ(0,"tbody"),t.YNc(1,Rn,2,1,"ng-container",15),t.qZA()),2&e){const n=a.ngIf;t.xp6(1),t.Q6J("ngForOf",n)}}function Kn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"span",35),t.NdJ("click",function(){t.CHM(n);const i=t.oxw(3);return t.KtG(i.getRowCount())}),t.TgZ(1,"i",36),t._uU(2,"?"),t.qZA()()}}function jn(e,a){if(1&e&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&e){const n=a.ngIf;t.xp6(1),t.Oqu(t.lcZ(2,1,null==n?null:n.Count))}}function zn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"a",37),t.NdJ("click",function(){t.CHM(n);const i=t.oxw(3);return t.KtG(i.onNextPage())}),t._UZ(1,"i",38),t._uU(2," Next"),t.qZA()}}function Wn(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"a",39),t.NdJ("click",function(){t.CHM(n);const i=t.oxw(3);return t.KtG(i.onLastPage())}),t._UZ(1,"i",40),t._uU(2," Last"),t.qZA()}}function Xn(e,a){if(1&e&&(t.TgZ(0,"div",28)(1,"div",29)(2,"div",30),t._uU(3),t.ALo(4,"number"),t.YNc(5,Kn,3,0,"span",31),t.YNc(6,jn,3,3,"span",13),t.ALo(7,"async"),t._uU(8),t.qZA()(),t.TgZ(9,"div",32),t.YNc(10,zn,3,0,"a",33),t.YNc(11,Wn,3,0,"a",34),t.qZA()()),2&e){const n=a.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 te(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"mainpanel",1),t.NdJ("onSubmit",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.searchProduct(i))}),t.TgZ(1,"actions")(2,"button",2),t.NdJ("click",function(){const l=t.CHM(n).ngIf,r=t.oxw();return t.KtG(r.openScanDialog(l))}),t._UZ(3,"i",3),t._uU(4," Scan Channel "),t.qZA()(),t.TgZ(5,"content")(6,"div",4)(7,"div",5)(8,"div",6)(9,"table",7)(10,"thead",8)(11,"tr")(12,"th",9),t._uU(13,"Product"),t.qZA(),t.TgZ(14,"th",10),t._uU(15,"Variant"),t.qZA(),t.TgZ(16,"th",10),t._uU(17,"SKU"),t.qZA(),t.TgZ(18,"th",11),t._uU(19,"Available In"),t.qZA(),t.TgZ(20,"th",12),t._uU(21,"Not Available In"),t.qZA()()(),t.YNc(22,Gn,2,1,"tbody",13),t.ALo(23,"async"),t.qZA()()(),t.YNc(24,Xn,12,10,"div",14),t.ALo(25,"async"),t.qZA()()()}if(2&e){const n=t.oxw();t.Q6J("hideSearchDropdown",!0),t.xp6(22),t.Q6J("ngIf",t.lcZ(23,3,n.data$)),t.xp6(2),t.Q6J("ngIf",t.lcZ(25,5,n.data$))}}let ne=(()=>{class e{constructor(n,o,i,l,r){this.http=n,this.dialog=o,this.toastr=i,this.productService=l,this.paginationService=r,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.initLoader(),this.iniData()}initLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe((0,En.b)(n=>{this.filterSearch=n.Filter,this.paginationService.resetToFirstPage(n.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe((0,qn.U)(n=>n.map(o=>(o.Variants=o.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),o))))}assignLogoChannel(n){return n.map(o=>(o.Img=g.g.getChannelLogoByTypeId(o.TypeID),o))}searchProduct(n){this.filterSearch.text=n,this.paginationService.resetToFirstPage(this.filterSearch)}scanAllProduct(n){let o=this.productService.findChannelById(this.filterSearch.ChannelID,n.Options.Channel);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,!1).subscribe(i=>{this.productService.successToastrScanAllProduct(i,o,!0),this.paginationService.resetToFirstPage(this.filterSearch)})}openScanDialog(n){this.dialog.open(A.j,{data:{filter:this.filterSearch,Channel:n.Options.Channel,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,I.h)(i=>g.g.IsNotEmpty(i))).subscribe(i=>{this.filterSearch=i,this.scanAllProduct(n)})}getChannelLogoById(n){return g.g.getChannelLogoByTypeId(n)}uploadProductToSingleChannel(n,o,i,l){let r=this.productService.findChannelById(o,l.Options.Channel);this.productService.uploadMultipleProduct([n],o,i).subscribe(u=>{this.paginationService.resetToFirstPage(l.Filter),this.toastr.success("Successfully uploaded "+n.Name+" to "+r.Name,"Success")})}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:n=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,n.Count)}})}ngOnDestroy(){this.paginationService.destroy()}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(F.O),t.Y36(m.uw),t.Y36(j._W),t.Y36(H.M),t.Y36(Qn.b))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel",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"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"ms-5",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngIf"],["class","d-flex justify-content-between mt-5",4,"ngIf"],[4,"ngFor","ngForOf"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-start",3,"rowSpan"],[1,"col-auto","ps-1"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"col","d-flex","align-items-center","ps-1",3,"matTooltip"],[1,"ms-5","d-inline","fw-normal","itemTitle"],[1,"border","rounded",2,"width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],["target","_blank",3,"href"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,o){1&n&&(t.YNc(0,te,26,7,"mainpanel",0),t.ALo(1,"async")),2&n&&t.Q6J("ngIf",t.lcZ(1,1,o.loader$))},dependencies:[c.sg,c.O5,L.gM,B.p,c.Ov,c.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}}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px;height:20px}.itemTitle[_ngcontent-%COMP%]{max-width:26vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function ee(e,a){if(1&e&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA()()),2&e){const n=a.$implicit;t.xp6(2),t.Oqu(null==n?null:n.ChannelVariationSKU),t.xp6(2),t.Oqu(null==n?null:n.Name)}}let oe=(()=>{class e{constructor(n){this.data=n}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(m.WI))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-modal-variants"]],decls:13,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3","text-center"],[1,"pb-5","mx-0","pt-2","px-10","d-flex","justify-content-center"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(n,o){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead",3)(6,"tr")(7,"th"),t._uU(8,"Variation"),t.qZA(),t.TgZ(9,"th"),t._uU(10,"SKU"),t.qZA()()(),t.TgZ(11,"tbody"),t.YNc(12,ee,5,2,"tr",4),t.qZA()()()),2&n&&(t.xp6(1),t.Oqu(null==o.data?null:o.data.title),t.xp6(11),t.Q6J("ngForOf",o.data.variants))},dependencies:[c.sg],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),e})();function ie(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",11),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.openScanDialog())}),t._UZ(1,"i",12),t._uU(2," Scan Channel "),t.qZA()}}function ae(e,a){if(1&e){const n=t.EpF();t.ynx(0),t.TgZ(1,"button",13),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onDownloadAllProduct("SELECTED"))}),t._UZ(2,"i",14),t._uU(3),t.qZA(),t.BQk()}if(2&e){const n=t.oxw();let o;t.xp6(3),t.hij(" Selected Download Product (",null==(o=n.productService.selectedProduct(n.products))?null:o.length,") ")}}function le(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onDownloadAllProduct("ALL"))}),t._UZ(1,"i",14),t._uU(2," Download "),t.qZA()}}const re=function(e){return[e]},ce=function(){return[]};function se(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",15)(1,"app-product-card",16),t.NdJ("onCheckBoxChange",function(i){const r=t.CHM(n).index,u=t.oxw();return t.KtG(u.onSelectProduct(i,r))})("onDescEvent",function(){const l=t.CHM(n).index,r=t.oxw();return t.KtG(r.onShowVariantDetail(l))})("onDownload",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onDownloadProduct(l))}),t.qZA()()}if(2&e){const n=a.$implicit;t.xp6(1),t.Q6J("title",null==n?null:n.Name)("image",null==n?null:n.Image)("code",0==(null==n||null==n.Variant?null:n.Variant.length)?null==n?null:n.ChannelItemSKU:null)("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(7,re,null==n?null:n.Channel):t.DdM(9,ce))("showCheckBox",!0)}}function de(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",17)(1,"div",18)(2,"app-custom-paginator",19),t.NdJ("total",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.getRowCount())})("next",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onNextPage())})("previous",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onPreviousPage())}),t.qZA()()()}if(2&e){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)}}let pe=(()=>{class e{constructor(n,o,i){this.http=n,this.dialog=o,this.productService=i,this.searchFilter=new dt,this.hasClickRowCount=!1}ngOnInit(){this.getPageLoader()}getPageLoader(){this.productService.loader().subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.sync=!0,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(n=>{this.products=n.Data,this.mapChannelToProduct()})}mapChannelToProduct(){this.products=this.products.map(n=>(n.Channel=this.channelOptions.find(o=>o.ID==n.ChannelID),n.Channel&&(n.Channel.Url=n.Url),n))}onSearch(n){this.searchFilter.text=n,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=g.g.GuidEMpty}onScanAll(){let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,!1).subscribe(o=>{this.productService.successToastrScanAllProduct(o,n,!0),this.getProducts()})}openScanDialog(){this.dialog.open(A.j,{data:{filter:this.searchFilter,Channel:this.channelOptions,showScanUpdateType:!1},width:"30%"}).afterClosed().pipe((0,I.h)(o=>g.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter=o,this.onScanAll()})}onDownloadAllProduct(n){let o;o="ALL"==n?this.products:this.productService.selectedProduct(this.products),o.length>0&&this.productService.downloadMultipleProduct(o).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(n,o){this.products[o].selected=n}onDownloadProduct(n){!confirm(`Are you sure you want to Retrieve product ${n?.Name} from ${n?.Channel.Name} to POS?`)||this.productService.downloadProduct(n).subscribe({next:()=>{this.getProducts()}})}onShowVariantDetail(n){let o=this.products[n].Variant;o.length>0&&this.dialog.open(oe,{data:{title:this.products[n].Name,variants:o},width:"30%"})}getRowCount(){this.http.post("/api/product/GetProductChannelNotPOSRowCount",{ChannelID:this.searchFilter.ChannelID}).subscribe(o=>{this.hasClickRowCount=!0,this.rowCount=o.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(F.O),t.Y36(m.uw),t.Y36(H.M))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-not-in-pos"]],decls:18,vars:8,consts:[["headerTitle","Not in POS","textButton","Search",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf","ngIfElse"],["DOWNLOAD_ALL",""],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],[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,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"title","image","code","description","downloadButton","channels","showCheckBox","onCheckBoxChange","onDescEvent","onDownload"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(n,o){if(1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return o.onSearch(l)}),t.TgZ(1,"actions"),t.YNc(2,ie,3,0,"button",1),t.YNc(3,ae,4,1,"ng-container",2),t.YNc(4,le,3,0,"ng-template",null,3,t.W1O),t.qZA(),t.TgZ(6,"filters")(7,"div",4)(8,"div",5)(9,"div")(10,"h6"),t._uU(11,"Channel"),t.qZA(),t.TgZ(12,"ng-select",6),t.NdJ("ngModelChange",function(l){return o.searchFilter.ChannelID=l})("clear",function(){return o.onClearChannelFilter()}),t.qZA()()()()(),t.TgZ(13,"content")(14,"div",7)(15,"div",8),t.YNc(16,se,2,10,"div",9),t.qZA(),t.YNc(17,de,3,4,"div",10),t.qZA()()()),2&n){const i=t.MAs(5);t.xp6(2),t.Q6J("ngIf",!o.productService.hasSelection(o.products)),t.xp6(1),t.Q6J("ngIf",o.productService.hasSelection(o.products))("ngIfElse",i),t.xp6(9),t.Q6J("clearable",!0)("items",o.channelOptions)("ngModel",o.searchFilter.ChannelID),t.xp6(4),t.Q6J("ngForOf",o.products),t.xp6(1),t.Q6J("ngIf",(null==o.products?null:o.products.length)>0)}},dependencies:[c.sg,c.O5,y.JJ,y.On,B.p,ct.w9,bt,Pt],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}}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]}),e})();function ue(e,a){if(1&e&&(t.ynx(0),t._UZ(1,"img",14),t.BQk()),2&e){const n=t.oxw();t.xp6(1),t.Q6J("src",n.image,t.LSH)}}function ge(e,a){1&e&&t._UZ(0,"img",15)}function he(e,a){if(1&e&&(t.TgZ(0,"div",16),t._UZ(1,"i",17),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&e){const n=t.oxw();t.xp6(3),t.Oqu(n.code)}}const me=function(e){return{"border-bottom":e}};function _e(e,a){if(1&e&&(t.ynx(0),t.TgZ(1,"div",28)(2,"div"),t._uU(3),t.qZA(),t.TgZ(4,"div")(5,"a",29),t._UZ(6,"i",30),t.qZA()()(),t.BQk()),2&e){const n=a.$implicit,o=a.index,i=t.oxw().$implicit;t.xp6(1),t.Q6J("ngClass",t.VKq(3,me,o!==(null==i?null:i.Map.length)-1)),t.xp6(2),t.hij(" ",n.Name," "),t.xp6(2),t.Q6J("href",n.URL,t.LSH)}}const fe=function(e){return{"border-bottom-0":e}};function Ce(e,a){if(1&e&&(t.TgZ(0,"div",18)(1,"h2",19)(2,"button",20)(3,"div",21),t._UZ(4,"img",22),t.TgZ(5,"span",23),t._uU(6),t.qZA(),t.TgZ(7,"span",24)(8,"h4"),t._uU(9),t.qZA()()()()(),t.TgZ(10,"div",25)(11,"div",26),t.YNc(12,_e,7,5,"ng-container",27),t.qZA()()()),2&e){const n=a.$implicit,o=a.index,i=t.oxw();t.Q6J("ngClass",t.VKq(10,fe,i.channels.length-1==o)),t.xp6(1),t.Q6J("id","heading"+o+i.code),t.xp6(1),t.uIk("data-bs-target","#collapse"+o+i.code)("aria-controls","#collapse"+o+i.code),t.xp6(2),t.Q6J("src",i.getChannelLogo(n.TypeID),t.LSH),t.xp6(2),t.Oqu(n.Name),t.xp6(3),t.hij("- ",n.Map.length," Listing"),t.xp6(1),t.Q6J("id","collapse"+o+i.code),t.uIk("aria-labelledby","heading"+o+i.code),t.xp6(2),t.Q6J("ngForOf",n.Map)}}let xe=(()=>{class e{getChannelLogo(n){return g.g.getChannelLogoByTypeId(n)}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-duplicate-product-card"]],inputs:{image:"image",title:"title",code:"code",channels:"channels"},decls:16,vars:5,consts:[[1,"card"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"col-8","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle"],["class","description",4,"ngIf"],[1,"card-footer",2,"padding-left","0px","padding-right","0px"],["id","accordionParent",1,"accordion","accordion-flush"],["class","accordion-item border-start-0 border-end-0",3,"ngClass",4,"ngFor","ngForOf"],[1,"rounded","imgUpload","float-left",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload"],[1,"description"],[1,"fa","fa-barcode","me-2"],[1,"accordion-item","border-start-0","border-end-0",3,"ngClass"],[1,"accordion-header",3,"id"],["type","button","data-bs-toggle","collapse","aria-expanded","true",1,"accordion-button","collapsed",2,"height","40px"],[1,"d-flex","align-items-center","justify-content-start","w-100"],["alt","",1,"channel-logo",3,"src"],[1,"fs-4","ps-4"],[1,"ps-2"],["data-bs-parent","#accordionParent",1,"accordion-collapse","collapse",3,"id"],[1,"accordion-body",2,"padding-top","0px","padding-bottom","0px"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","align-items-center","py-4",3,"ngClass"],["target","_blank",1,"text-secondary",3,"href"],[1,"fa","fa-external-link-alt"]],template:function(n,o){if(1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),t.YNc(6,ue,2,1,"ng-container",6),t.YNc(7,ge,1,0,"ng-template",null,7,t.W1O),t.qZA()()(),t.TgZ(9,"div",8)(10,"h4",9),t._uU(11),t.qZA(),t.YNc(12,he,4,1,"div",10),t.qZA()()(),t.TgZ(13,"div",11)(14,"div",12),t.YNc(15,Ce,13,12,"div",13),t.qZA()()()),2&n){const i=t.MAs(8);t.xp6(6),t.Q6J("ngIf",o.image)("ngIfElse",i),t.xp6(5),t.hij(" ",o.title," "),t.xp6(1),t.Q6J("ngIf",o.code),t.xp6(3),t.Q6J("ngForOf",o.channels)}},dependencies:[c.mk,c.sg,c.O5],styles:[".productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down}.channel-logo[_ngcontent-%COMP%]{width:18px;height:18px}.accordion-button[_ngcontent-%COMP%]{background-color:#ededed69!important}.accordion-button[_ngcontent-%COMP%]:not(.collapsed){background-color:#ededed69!important;color:#333}.accordion-button[_ngcontent-%COMP%]:after{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e\")}.accordion-button[_ngcontent-%COMP%]:focus{box-shadow:none!important}.card[_ngcontent-%COMP%]{margin-bottom:0!important}"]}),e})();function be(e,a){if(1&e&&(t.TgZ(0,"div",8),t._UZ(1,"app-duplicate-product-card",9),t.qZA()),2&e){const n=a.$implicit;t.xp6(1),t.Q6J("title",n.Name)("code",n.Code)("image",n.ThumbnailURL)("channels",n.Channel)}}function Pe(e,a){if(1&e&&(t.ynx(0),t.YNc(1,be,2,4,"div",7),t.BQk()),2&e){const n=t.oxw();t.xp6(1),t.Q6J("ngForOf",n.products)}}function Te(e,a){1&e&&(t.TgZ(0,"div",10)(1,"div"),t._UZ(2,"i",11),t.qZA(),t.TgZ(3,"h4",12),t._uU(4,"No product found"),t.qZA(),t.TgZ(5,"h6",13),t._uU(6,"Once you have a duplicate product"),t.qZA(),t.TgZ(7,"h6",14),t._uU(8,"you`ll see them here"),t.qZA()())}let ve=(()=>{class e{constructor(n){this.http=n,this.filter={ChannelID:""},this.getPageLoader()}getPageLoader(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.filter=n.Filter,this.Channel=n.Options.Channel,this.getData()})}getData(){this.http.post("/api/product/GetDuplicateInChannel",this.filter).subscribe(n=>{this.products=n.Data})}onClearFilter(){this.filter.ChannelID=g.g.GuidEMpty}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(F.O))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-duplicate-sku"]],decls:14,vars:6,consts:[["textButton"," Search",3,"headerTitle","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],[1,"container-fluid"],[1,"row","mt-8","mx-1"],[4,"ngIf","ngIfElse"],["EMPTY",""],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"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"]],template:function(n,o){if(1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(){return o.getData()}),t._UZ(1,"actions"),t.TgZ(2,"filters")(3,"div",1)(4,"div")(5,"h6"),t._uU(6,"Channel"),t.qZA(),t.TgZ(7,"ng-select",2),t.NdJ("ngModelChange",function(l){return o.filter.ChannelID=l})("clear",function(){return o.onClearFilter()}),t.qZA()()()(),t.TgZ(8,"content")(9,"div",3)(10,"div",4),t.YNc(11,Pe,2,1,"ng-container",5),t.YNc(12,Te,9,0,"ng-template",null,6,t.W1O),t.qZA()()()()),2&n){const i=t.MAs(13);t.Q6J("headerTitle","Duplicate Sku ("+(o.products?o.products.length:"0")+")"),t.xp6(7),t.Q6J("clearable",!0)("items",o.Channel)("ngModel",o.filter.ChannelID),t.xp6(4),t.Q6J("ngIf",(null==o.products?null:o.products.length)>0)("ngIfElse",i)}},dependencies:[c.sg,c.O5,y.JJ,y.On,B.p,ct.w9,xe]}),e})();var G=d(8063);const ye=[{path:"",component:Dt,children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:kn,canActivate:[G.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:Jn,canActivate:[G.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:ne,canActivate:[G.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:pe,canActivate:[G.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:ve,canActivate:[G.a],data:{title:"Duplicate Sku in Channel"}}]}];let Se=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[c.ez,st.Bz.forChild(ye)]}),e})();var we=d(8739),Me=d(2594);let Ie=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[c.ez,y.u5,L.AV]}),e})(),Ze=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[c.ez]}),e})(),Oe=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[c.ez,y.u5]}),e})(),Ne=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[c.ez,vt.Z,y.u5,st.Bz,Se,L.AV,B.R,ct.A0,we.TU,Me.K,Ie,Ze,Oe]}),e})()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[767],{6767:(le,Z,d)=>{d.r(Z),d.d(Z,{LogsModule:()=>re});var s=d(6895),e=d(4650),l=d(8252),v=d(7398);let y=(()=>{class o{constructor(){this.ObjectlogTabs=[{Title:"Sync Orders",Url:"/menu/log/order"},{Title:"Inventory Log ",Url:"/menu/log/inventory"},{Title:"Marketplace Webhook ",Url:"/menu/log/rawlog"},{Title:"Application Exception ",Url:"/menu/log/exception"}]}ngOnInit(){}}return o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=e.Xpm({type:o,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(t,n){1&t&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&t&&(e.xp6(3),e.Q6J("Tabs",n.ObjectlogTabs))},dependencies:[l.lC,v.e]}),o})();var c=d(1318);let m=(()=>{class o{constructor(){}get Data(){return this._Data}set Data(t){this._Data=t}Fill(t){return this._Data.find(n=>n._id==t)}}return o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var p=d(4006),u=d(7481),_=d(8739),T=d(8796),f=d(5585);const b=function(){return["/menu/log/order/detail"]},A=function(o){return{ID:o}};function q(o,r){if(1&o&&(e.TgZ(0,"tr",16)(1,"td")(2,"a",17),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=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(10,b))("queryParams",e.VKq(11,A,t.ID)),e.xp6(1),e.hij(" ",e.xi3(4,7,t.Created,"dd MMM yyyy HH:mm")," "),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.Oqu(t.ResponseCode)}}let L=(()=>{class o{constructor(t,n,i){this.http=t,this.url=n,this._RawLogService=i,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCodeList:[],From:"",To:""},this.Load()}ngOnInit(){this.maxDate=new Date}Load(){this.url.queryParamMap.subscribe(t=>{let n=t.params;this.filter.From=n.From,this.filter.To=n.To,this.filter.ChannelID=n.ChannelID,this.filter.ActionType=n.ActionType,this.http.post("/api/OrdersLoader/GetErrorLog",this.filter).subscribe(i=>{this.filter=i.Filter,this.Channel=i.Options.Channel,this.ActionTypeList=i.Options.ActionTypeList,this.Get()})})}Get(t){this.filter.Number=t,this.filter.StatusCodeList=[400,401,403,429,500,503],this.http.post("/api/Orders/GetErrorLog",this.filter).subscribe(n=>{this._RawLogService.Data=n.hits,this.Result=Array();for(let i of n.hits)this.Result.push({ID:i._id,Created:i._source["@timestamp_received"],MarketTypeString:i._source.log.type,POSActionTypeString:i._source.message,Number:i._source.log.number,ResponseCode:i._source.log.responseCode});this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}getDayDiff(t,n){return(n.getTime()-t.getTime())/864e5}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(l.gz),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-error-log"]],decls:45,vars:16,consts:[["searchBoxPlaceHolder","Invoice Number..",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","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"],["class","over-due",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[1,"over-due"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.Number=a})("onSubmit",function(a){return n.Get(a)}),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(a){return n.filter.ChannelID=a}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Action"),e.qZA(),e.TgZ(10,"ng-select",3),e.NdJ("ngModelChange",function(a){return n.filter.ActionType=a}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"From/To"),e.qZA(),e.TgZ(14,"datepicker",4),e.NdJ("dateChange",function(a){return n.filter.From=a}),e.qZA(),e.TgZ(15,"datepicker",5),e.NdJ("dateChange",function(a){return n.filter.To=a}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Number"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(a){return n.filter.PageNumber=a}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Page Size"),e.qZA(),e.TgZ(23,"input",7),e.NdJ("ngModelChange",function(a){return n.filter.RowCount=a}),e.qZA()()()(),e.TgZ(24,"content")(25,"div",8)(26,"div",9)(27,"div",10)(28,"div",11)(29,"table",12)(30,"thead")(31,"tr",13)(32,"th"),e._uU(33,"Date"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Channel"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"Actions"),e.qZA(),e.TgZ(38,"th"),e._uU(39,"Number"),e.qZA(),e.TgZ(40,"th"),e._uU(41,"Code"),e.qZA()()(),e.TgZ(42,"tbody"),e.YNc(43,q,13,13,"tr",14),e.qZA()(),e.TgZ(44,"mat-paginator",15),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Error Log")("text",n.Number),e.xp6(6),e.Q6J("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),e.xp6(4),e.Q6J("clearable",!0)("items",n.ActionTypeList)("ngModel",n.filter.ActionType),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.RowCount),e.xp6(20),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.sg,p.Fj,p.wV,p.JJ,p.On,l.yS,u.p,_.NW,T.w9,f.QB,s.uU]}),o})();var h=d(8063);const O=function(){return["/menu/log/order/detail"]},S=function(o){return{ID:o}},U=function(o,r){return{"bg-warning":o,"bg-success":r}};function I(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",17),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")(12,"span",18),e._uU(13),e.qZA()()()),2&o){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(11,O))("queryParams",e.VKq(12,S,t.ID)),e.xp6(1),e.hij(" ",e.xi3(4,8,t.Created,"dd MMM yyyy HH:mm")," "),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(14,U,200!==t.ResponseCode,200===t.ResponseCode)),e.xp6(1),e.Oqu(t.ResponseCode)}}let N=(()=>{class o{constructor(t,n,i){this.http=t,this._RawLogService=n,this.route=i,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""}}ngOnInit(){this.route.queryParams.subscribe(t=>{this.responseCode=t.responseCode,null!=this.responseCode?this.Load(t):this.Load()})}Load(t={}){this.http.post("/api/OrdersLoader/Get",t).subscribe(n=>{this.filter=n.Filter,this.Channel=n.Options.Channel,this.ActionTypeList=n.Options.ActionTypeList,this.Get()})}Get(t){this.filter.Number=t,this.http.post("/api/Orders/Get",this.filter).subscribe(n=>{this._RawLogService.Data=n.hits,this.Result=Array();for(let i of n.hits)this.Result.push({ID:i._id,Created:i._source["@timestamp_received"],shopId:i._source.shopId,MarketTypeString:i._source.log.type,POSActionTypeString:i._source.message,Number:i._source.log.number,ResponseCode:i._source.log.responseCode});this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(m),e.Y36(l.gz))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-order"]],decls:49,vars:17,consts:[["searchBoxPlaceHolder","Invoice Number..",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","text","name","StatusCode",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"],[1,"text-white","p-1","rounded","response-desc",3,"ngClass"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.Number=a})("onSubmit",function(a){return n.Get(a)}),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(a){return n.filter.ChannelID=a}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Action"),e.qZA(),e.TgZ(10,"ng-select",3),e.NdJ("ngModelChange",function(a){return n.filter.ActionType=a}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"From/To"),e.qZA(),e.TgZ(14,"datepicker",4),e.NdJ("dateChange",function(a){return n.filter.From=a}),e.qZA(),e.TgZ(15,"datepicker",5),e.NdJ("dateChange",function(a){return n.filter.To=a}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Response Code"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(a){return n.filter.StatusCode=a}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Page Number"),e.qZA(),e.TgZ(23,"input",7),e.NdJ("ngModelChange",function(a){return n.filter.PageNumber=a}),e.qZA()(),e.TgZ(24,"div")(25,"h6"),e._uU(26,"Page Size"),e.qZA(),e.TgZ(27,"input",8),e.NdJ("ngModelChange",function(a){return n.filter.RowCount=a}),e.qZA()()()(),e.TgZ(28,"content")(29,"div",9)(30,"div",10)(31,"div",11)(32,"div",12)(33,"table",13)(34,"thead")(35,"tr",14)(36,"th"),e._uU(37,"Date"),e.qZA(),e.TgZ(38,"th"),e._uU(39,"Channel"),e.qZA(),e.TgZ(40,"th"),e._uU(41,"Actions"),e.qZA(),e.TgZ(42,"th"),e._uU(43,"Number"),e.qZA(),e.TgZ(44,"th"),e._uU(45,"Code"),e.qZA()()(),e.TgZ(46,"tbody"),e.YNc(47,I,14,17,"tr",15),e.qZA()(),e.TgZ(48,"mat-paginator",16),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Order Log")("text",n.Number),e.xp6(6),e.Q6J("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),e.xp6(4),e.Q6J("clearable",!0)("items",n.ActionTypeList)("ngModel",n.filter.ActionType),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(4),e.Q6J("ngModel",n.filter.StatusCode),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.RowCount),e.xp6(20),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.mk,s.sg,p.Fj,p.wV,p.JJ,p.On,l.yS,u.p,_.NW,T.w9,f.QB,s.uU]}),o})();const D=function(){return["/menu/log/inventory/detail"]},w=function(o){return{ID:o}};function R(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",15),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA()()),2&o){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(10,D))("queryParams",e.VKq(11,w,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)}}let M=(()=>{class o{constructor(t,n){this.http=t,this._RawLogService=n,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(t=>{this.filter=t.Filter,this.Channel=t.Options.Channel,this.ActionTypeList=t.Options.ActionTypeList,this.Get()})}Get(t){null!=t&&(this.filter.Sku=t),this.http.post("api/Inventory/GetLog",this.filter).subscribe(n=>{this._RawLogService.Data=n.hits,this.Result=Array();for(let i of n.hits)this.Result.push({ID:i._source.log.id,Created:i._source["@timestamp_received"],channelName:i._source.log.channelName,Sku:i._source.log.sku,Stock:i._source.log.stock,ResponseCode:i._source.log.responseCode});this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount,this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-inventory-log"]],decls:41,vars:13,consts:[["searchBoxPlaceHolder","Enter SKU...",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt=3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.filter.Sku=a})("onSubmit",function(a){return n.Get(a)}),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(a){return n.filter.ChannelID=a}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"From/To"),e.qZA(),e.TgZ(10,"datepicker",3),e.NdJ("dateChange",function(a){return n.filter.From=a}),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(a){return n.filter.To=a}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Number"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(a){return n.filter.PageNumber=a}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Size"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(a){return n.filter.RowCount=a}),e.qZA()()()(),e.TgZ(20,"content")(21,"div",7)(22,"div",8)(23,"div",9)(24,"div",10)(25,"table",11)(26,"thead")(27,"tr",12)(28,"th"),e._uU(29,"Created"),e.qZA(),e.TgZ(30,"th"),e._uU(31,"Channel"),e.qZA(),e.TgZ(32,"th"),e._uU(33,"SKU"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Stock"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"Response code"),e.qZA()()(),e.TgZ(38,"tbody"),e.YNc(39,R,13,13,"tr",13),e.qZA()(),e.TgZ(40,"mat-paginator",14),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Inventory Log")("text",n.filter.Sku),e.xp6(6),e.Q6J("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.RowCount),e.xp6(20),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.sg,p.Fj,p.wV,p.JJ,p.On,l.yS,u.p,_.NW,T.w9,f.QB,s.uU]}),o})();const x=function(){return["/menu/log/rawlog/detail"]},J=function(o){return{ID:o}};function k(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",9),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=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(10,x))("queryParams",e.VKq(11,J,t.id)),e.xp6(1),e.hij(" ",e.xi3(4,7,t.Created,"dd MMM yyyy HH:mm")," "),e.xp6(3),e.Oqu(t.number),e.xp6(2),e.Oqu(t.type),e.xp6(2),e.Oqu(t.message),e.xp6(2),e.Oqu(t.processTypeString)}}function P(o,r){if(1&o&&(e.TgZ(0,"div",2)(1,"div",3)(2,"div",4)(3,"table",5)(4,"thead",6)(5,"tr")(6,"th",7),e._uU(7,"Date"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Number"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Type"),e.qZA(),e.TgZ(12,"th"),e._uU(13,"Status"),e.qZA(),e.TgZ(14,"th"),e._uU(15,"Process"),e.qZA()()(),e.TgZ(16,"tbody"),e.YNc(17,k,13,13,"tr",8),e.qZA()()()()()),2&o){const t=e.oxw();e.xp6(17),e.Q6J("ngForOf",t.Result)}}let F=(()=>{class o{constructor(t,n){this.http=t,this._RawLogService=n,this.Result=Array(),this.list=[],this.filter={},this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.filter={Number:"",PageNumber:1,RowCount:20,ChannelID:"",Status:""}}ngOnInit(){}Get(t){if(null!=t){let n=[];n.push(t),this.http.post("api/Orders/GetRawLog",n).subscribe(i=>{this._RawLogService.Data=i.hits,this.Result=Array();for(let a of i.hits){let g={};g=a._source.error?{id:a._id,message:a._source.message,processTypeString:a._source.error.processType,type:a._source.error.type,number:a._source.error.number,Created:a._source["@timestamp_received"]}:{id:a._id,message:a._source.message,processTypeString:a._source.log.processType,type:a._source.log.type,number:a._source.log.number,Created:a._source["@timestamp_received"]},this.Result.push(g)}})}}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-raw-log"]],decls:3,vars:3,consts:[["searchBoxPlaceHolder","Invoice Number..","hideSearchDropdown","true",3,"headerTitle","text","textChange","onSubmit"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.filter.Number=a})("onSubmit",function(a){return n.Get(a)}),e.TgZ(1,"content"),e.YNc(2,P,18,1,"div",1),e.qZA()()),2&t&&(e.Q6J("headerTitle","Raw Log")("text",n.filter.Number),e.xp6(2),e.Q6J("ngIf",n.Result.length>0))},dependencies:[s.sg,s.O5,l.yS,u.p,s.uU]}),o})();class Q{constructor(r,t){this._document=t;const n=this._textarea=this._document.createElement("textarea"),i=n.style;i.position="fixed",i.top=i.opacity="0",i.left="-999em",n.setAttribute("aria-hidden","true"),n.value=r,this._document.body.appendChild(n)}copy(){const r=this._textarea;let t=!1;try{if(r){const n=this._document.activeElement;r.select(),r.setSelectionRange(0,r.value.length),t=this._document.execCommand("copy"),n&&n.focus()}}catch{}return t}destroy(){const r=this._textarea;r&&(r.remove(),this._textarea=void 0)}}let Y=(()=>{class o{constructor(t){this._document=t}copy(t){const n=this.beginCopy(t),i=n.copy();return n.destroy(),i}beginCopy(t){return new Q(t,this._document)}}return o.\u0275fac=function(t){return new(t||o)(e.LFG(s.K0))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();const E=new e.OlP("CDK_COPY_TO_CLIPBOARD_CONFIG");let z=(()=>{class o{constructor(t,n,i){this._clipboard=t,this._ngZone=n,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 n=t;const i=this._clipboard.beginCopy(this.text);this._pending.add(i);const a=()=>{const g=i.copy();g||!--n||this._destroyed?(this._currentTimeout=null,this._pending.delete(i),i.destroy(),this.copied.emit(g)):this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(a,1))};a()}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(Y),e.Y36(e.R0b),e.Y36(E,8))},o.\u0275dir=e.lG2({type:o,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(t,n){1&t&&e.NdJ("click",function(){return n.copy()})},inputs:{text:["cdkCopyToClipboard","text"],attempts:["cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"}}),o})(),G=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({}),o})();function B(o,r){1&o&&e._UZ(0,"img",21)}function H(o,r){1&o&&e._UZ(0,"img",22)}function j(o,r){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,B,1,0,"img",11),e.YNc(20,H,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," ")}}function K(o,r){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)}}function W(o,r){if(1&o){const t=e.EpF();e.TgZ(0,"a",14),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.Retry())}),e._uU(1,"Retry"),e.qZA()}}function ee(o,r){1&o&&e._UZ(0,"img",12)}function te(o,r){1&o&&e._UZ(0,"img",13)}function ne(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td"),e.YNc(2,ee,1,0,"img",9),e.YNc(3,te,1,0,"img",10),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td")(9,"div",11),e._uU(10),e.qZA(),e.TgZ(11,"div"),e._uU(12),e.qZA()()()),2&o){const t=r.$implicit;e.xp6(2),e.Q6J("ngIf",1==t.TypeID),e.xp6(1),e.Q6J("ngIf",0==t.TypeID),e.xp6(2),e.Oqu(t.Date),e.xp6(2),e.Oqu(t.Number),e.xp6(3),e.Oqu(t.message),e.xp6(2),e.Oqu(t.stackTrace)}}const ie=[{path:"",component:y,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:N,canActivate:[h.a],data:{title:"Orders Log"}},{path:"inventory",component:M,canActivate:[h.a],data:{title:"Inventory Log"}},{path:"rawlog",component:F,canActivate:[h.a],data:{title:"Raw Log"}},{path:"rawlog/detail",component:(()=>{class o{constructor(t,n,i){this.route=t,this.http=n,this._RawLogService=i,this.route.queryParams.subscribe(a=>{let g=JSON.parse(localStorage.getItem("channel"));if(this.ID=a.ID,this.data=this._RawLogService.Fill(this.ID),this.data.Created=this.data._source["@timestamp_received"],g.length>0){const C=g.find(se=>se.ShopID==this.data._source.shopId);C?(this.data.TypeID=C.TypeID,this.data.ShopName=C.Name,this.data.ShopLink=C.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(l.gz),e.Y36(c.O),e.Y36(m))},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(t,n){1&t&&(e.TgZ(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),e.YNc(4,j,59,14,"div",3),e.qZA()()()()),2&t&&(e.Q6J("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(4),e.Q6J("ngIf",n.data))},dependencies:[s.O5,u.p,z,s.uU]}),o})(),canActivate:[h.a],data:{title:"Raw Log Detail"}},{path:"errorlog",component:L,canActivate:[h.a],data:{title:"Error Log"}},{path:"inventory/detail",component:(()=>{class o{constructor(t,n,i){this.route=t,this.http=n,this._RawLogService=i,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(a=>{this.ID=a.ID,this.Load()})}ngOnInit(){}Load(){this.http.post("/api/Inventory/GetInventoryLogDeatil",{ID:this.ID}).subscribe(n=>{this.data.Created=n.hits[0]._source["@timestamp_received"],this.data.Sku=n.hits[0]._source.log.sku,this.data.ChannelName=n.hits[0]._source.log.channelName,this.data.ResponseCode=n.hits[0]._source.log.responseCode,this.request=JSON.parse(n.hits[0]._source.log.request),this.response=n.hits[0]._source.log.response})}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(l.gz),e.Y36(c.O),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-inventory-detail"]],decls:30,vars:9,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(t,n){1&t&&(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,K,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&t&&(e.Q6J("headerTitle","Inventory Detail")("pageData","Inventory Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(7),e.Q6J("ngIf",n.data),e.xp6(11),e.Oqu(e.lcZ(19,7,n.request)),e.xp6(11),e.Oqu(n.response))},dependencies:[s.O5,l.yS,u.p,s.Ts,s.uU]}),o})(),canActivate:[h.a],data:{title:"Inventory Details"}},{path:"order/detail",component:(()=>{class o{constructor(t,n){this.route=t,this.http=n,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(i=>{this.ID=i.ID,this.Load()})}ngOnInit(){}Retry(){this.http.post("/api/Orders/Retry",{ID:this.ID}).subscribe(n=>{alert(JSON.stringify(n))})}Load(){this.http.post("/api/Orders/GetDetail",{ID:this.ID}).subscribe(n=>{for(let i of n.hits)this.Number=i._source.log.number,this.MarketTypeString=i._source.log.type,this.ResponseCode=i._source.log.responseCode,this.POSActionTypeString=i._source.message,this.ProcessDuration=0,this.Created=i._source["@timestamp_received"],this.request=JSON.parse(i._source.log.request),this.response=JSON.parse(i._source.log.response),this.shopId=i._source.shopId})}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(l.gz),e.Y36(c.O))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-orderdetail"]],decls:82,vars:20,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,"col-sm-6"],[1,"info-label-group"],[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(t,n){1&t&&(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",3)(14,"div",8)(15,"div",9)(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",8)(23,"div",9)(24,"label"),e._uU(25,"Number"),e.qZA(),e.TgZ(26,"div")(27,"span"),e._uU(28),e.qZA()()()(),e.TgZ(29,"div",8)(30,"div",9)(31,"label"),e._uU(32,"Type"),e.qZA(),e.TgZ(33,"div")(34,"span"),e._uU(35),e.qZA()()()(),e.TgZ(36,"div",8)(37,"div",9)(38,"label"),e._uU(39,"Response Code"),e.qZA(),e.TgZ(40,"div")(41,"span"),e._uU(42),e.qZA()()()(),e.TgZ(43,"div",8)(44,"div",9)(45,"label"),e._uU(46,"ShopID"),e.qZA(),e.TgZ(47,"div")(48,"span"),e._uU(49),e.qZA()()()(),e.TgZ(50,"div",8)(51,"div",9)(52,"label"),e._uU(53,"Action"),e.qZA(),e.TgZ(54,"div")(55,"span"),e._uU(56),e.qZA()()()()()()()()(),e.TgZ(57,"div",10)(58,"div",8)(59,"div",5)(60,"div",6)(61,"h5"),e._uU(62,"Request"),e.qZA()(),e.TgZ(63,"div",7)(64,"div",4)(65,"div",11)(66,"pre"),e._uU(67),e.ALo(68,"json"),e.qZA()()(),e.TgZ(69,"actions",12),e.YNc(70,W,2,0,"a",13),e.qZA()()()(),e.TgZ(71,"div",8)(72,"div",5)(73,"div",6)(74,"h5"),e._uU(75,"Response"),e.qZA()(),e.TgZ(76,"div",7)(77,"div",4)(78,"div",11)(79,"pre"),e._uU(80),e.ALo(81,"json"),e.qZA()()()()()()()()()()),2&t&&(e.Q6J("headerTitle","Order #"+n.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(20),e.Oqu(e.xi3(21,13,n.Created,"dd MMM yyyy HH:mm:ss")),e.xp6(8),e.Oqu(n.Number),e.xp6(7),e.Oqu(n.MarketTypeString),e.xp6(7),e.Oqu(n.ResponseCode),e.xp6(7),e.Oqu(n.shopId),e.xp6(7),e.Oqu(n.POSActionTypeString),e.xp6(11),e.Oqu(e.lcZ(68,16,n.request)),e.xp6(3),e.Q6J("ngIf","200"!=n.ResponseCode&&"201"!=n.ResponseCode),e.xp6(10),e.Oqu(e.lcZ(81,18,n.response)))},dependencies:[s.O5,l.yS,u.p,s.Ts,s.uU]}),o})(),canActivate:[h.a],data:{title:"Order Details"}},{path:"exception",component:(()=>{class o{constructor(t){this.http=t,this.Result=Array(),this.filter={RowCount:50,PageNumber:1},this.Load()}ngOnInit(){}Load(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(t=>{this.Result=Array();for(let n of t.hits)this.Result.push({TypeID:"Shopee"==n._source.error.type?0:1,Number:n._source.error.number,Date:n._source["@timestamp_received"],stackTrace:n._source.error.stackTrace,message:n._source.message});this.paginationTotal=t.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Load()}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-exception-log"]],decls:21,vars:5,consts:[["searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true",3,"headerTitle"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],[1,"fw-bold"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e._UZ(1,"filters"),e.TgZ(2,"content")(3,"div",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead")(9,"tr",6)(10,"th"),e._uU(11,"Channel"),e.qZA(),e.TgZ(12,"th"),e._uU(13,"Date"),e.qZA(),e.TgZ(14,"th"),e._uU(15,"Number"),e.qZA(),e.TgZ(16,"th"),e._uU(17,"Exception"),e.qZA()()(),e.TgZ(18,"tbody"),e.YNc(19,ne,13,6,"tr",7),e.qZA()(),e.TgZ(20,"mat-paginator",8),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Exception Log"),e.xp6(19),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.sg,s.O5,u.p,_.NW]}),o})(),canActivate:[h.a],data:{title:"Exception Log"}}]}];let ae=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[s.ez,l.Bz.forChild(ie)]}),o})(),re=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[s.ez,p.u5,p.UX,ae,l.Bz,u.R,G,_.TU,T.A0,f.ZU,v.Z]}),o})()}}]);
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[767],{6767:(le,Z,d)=>{d.r(Z),d.d(Z,{LogsModule:()=>re});var s=d(6895),e=d(4650),l=d(8252),v=d(7398);let y=(()=>{class o{constructor(){this.ObjectlogTabs=[{Title:"Sync Orders",Url:"/menu/log/order"},{Title:"Inventory Log ",Url:"/menu/log/inventory"},{Title:"Marketplace Webhook ",Url:"/menu/log/rawlog"},{Title:"Application Exception ",Url:"/menu/log/exception"}]}ngOnInit(){}}return o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=e.Xpm({type:o,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(t,n){1&t&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&t&&(e.xp6(3),e.Q6J("Tabs",n.ObjectlogTabs))},dependencies:[l.lC,v.e]}),o})();var c=d(1318);let m=(()=>{class o{constructor(){}get Data(){return this._Data}set Data(t){this._Data=t}Fill(t){return this._Data.find(n=>n._id==t)}}return o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var p=d(4006),u=d(7481),_=d(8739),T=d(8796),f=d(5585);const b=function(){return["/menu/log/order/detail"]},A=function(o){return{ID:o}};function q(o,r){if(1&o&&(e.TgZ(0,"tr",16)(1,"td")(2,"a",17),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=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(10,b))("queryParams",e.VKq(11,A,t.ID)),e.xp6(1),e.hij(" ",e.xi3(4,7,t.Created,"dd MMM yyyy HH:mm")," "),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.Oqu(t.ResponseCode)}}let L=(()=>{class o{constructor(t,n,i){this.http=t,this.url=n,this._RawLogService=i,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCodeList:[],From:"",To:""},this.Load()}ngOnInit(){this.maxDate=new Date}Load(){this.url.queryParamMap.subscribe(t=>{let n=t.params;this.filter.From=n.From,this.filter.To=n.To,this.filter.ChannelID=n.ChannelID,this.filter.ActionType=n.ActionType,this.http.post("/api/OrdersLoader/GetErrorLog",this.filter).subscribe(i=>{this.filter=i.Filter,this.Channel=i.Options.Channel,this.ActionTypeList=i.Options.ActionTypeList,this.Get()})})}Get(t){this.filter.Number=t,this.filter.StatusCodeList=[400,401,403,429,500,503],this.http.post("/api/Orders/GetErrorLog",this.filter).subscribe(n=>{this._RawLogService.Data=n.hits,this.Result=Array();for(let i of n.hits)this.Result.push({ID:i._id,Created:i._source["@timestamp_received"],MarketTypeString:i._source.log.type,POSActionTypeString:i._source.message,Number:i._source.log.number,ResponseCode:i._source.log.responseCode});this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}getDayDiff(t,n){return(n.getTime()-t.getTime())/864e5}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(l.gz),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-error-log"]],decls:45,vars:16,consts:[["searchBoxPlaceHolder","Invoice Number..",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","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"],["class","over-due",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[1,"over-due"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.Number=a})("onSubmit",function(a){return n.Get(a)}),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(a){return n.filter.ChannelID=a}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Action"),e.qZA(),e.TgZ(10,"ng-select",3),e.NdJ("ngModelChange",function(a){return n.filter.ActionType=a}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"From/To"),e.qZA(),e.TgZ(14,"datepicker",4),e.NdJ("dateChange",function(a){return n.filter.From=a}),e.qZA(),e.TgZ(15,"datepicker",5),e.NdJ("dateChange",function(a){return n.filter.To=a}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Number"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(a){return n.filter.PageNumber=a}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Page Size"),e.qZA(),e.TgZ(23,"input",7),e.NdJ("ngModelChange",function(a){return n.filter.RowCount=a}),e.qZA()()()(),e.TgZ(24,"content")(25,"div",8)(26,"div",9)(27,"div",10)(28,"div",11)(29,"table",12)(30,"thead")(31,"tr",13)(32,"th"),e._uU(33,"Date"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Channel"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"Actions"),e.qZA(),e.TgZ(38,"th"),e._uU(39,"Number"),e.qZA(),e.TgZ(40,"th"),e._uU(41,"Code"),e.qZA()()(),e.TgZ(42,"tbody"),e.YNc(43,q,13,13,"tr",14),e.qZA()(),e.TgZ(44,"mat-paginator",15),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Error Log")("text",n.Number),e.xp6(6),e.Q6J("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),e.xp6(4),e.Q6J("clearable",!0)("items",n.ActionTypeList)("ngModel",n.filter.ActionType),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.RowCount),e.xp6(20),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.sg,p.Fj,p.wV,p.JJ,p.On,l.yS,u.p,_.NW,T.w9,f.QB,s.uU]}),o})();var h=d(8063);const O=function(){return["/menu/log/order/detail"]},S=function(o){return{ID:o}},U=function(o,r){return{"bg-warning":o,"bg-success":r}};function I(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",17),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")(12,"span",18),e._uU(13),e.qZA()()()),2&o){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(11,O))("queryParams",e.VKq(12,S,t.ID)),e.xp6(1),e.hij(" ",e.xi3(4,8,t.Created,"dd MMM yyyy HH:mm")," "),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(14,U,200!==t.ResponseCode,200===t.ResponseCode)),e.xp6(1),e.Oqu(t.ResponseCode)}}let N=(()=>{class o{constructor(t,n,i){this.http=t,this._RawLogService=n,this.route=i,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""}}ngOnInit(){this.route.queryParams.subscribe(t=>{this.responseCode=t.responseCode,null!=this.responseCode?this.Load(t):this.Load()})}Load(t={}){this.http.post("/api/OrdersLoader/Get",t).subscribe(n=>{this.filter=n.Filter,this.Channel=n.Options.Channel,this.ActionTypeList=n.Options.ActionTypeList,this.Get()})}Get(t){this.filter.Number=t,this.http.post("/api/Orders/Get",this.filter).subscribe(n=>{this._RawLogService.Data=n.hits,this.Result=Array();for(let i of n.hits)this.Result.push({ID:i._id,Created:i._source["@timestamp_received"],shopId:i._source.shopId,MarketTypeString:i._source.log.type,POSActionTypeString:i._source.message,Number:i._source.log.number,ResponseCode:i._source.log.responseCode});this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(m),e.Y36(l.gz))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-order"]],decls:49,vars:17,consts:[["searchBoxPlaceHolder","Invoice Number..",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","text","name","StatusCode",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"],[1,"text-white","p-1","rounded","response-desc",3,"ngClass"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.Number=a})("onSubmit",function(a){return n.Get(a)}),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(a){return n.filter.ChannelID=a}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Action"),e.qZA(),e.TgZ(10,"ng-select",3),e.NdJ("ngModelChange",function(a){return n.filter.ActionType=a}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"From/To"),e.qZA(),e.TgZ(14,"datepicker",4),e.NdJ("dateChange",function(a){return n.filter.From=a}),e.qZA(),e.TgZ(15,"datepicker",5),e.NdJ("dateChange",function(a){return n.filter.To=a}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Response Code"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(a){return n.filter.StatusCode=a}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Page Number"),e.qZA(),e.TgZ(23,"input",7),e.NdJ("ngModelChange",function(a){return n.filter.PageNumber=a}),e.qZA()(),e.TgZ(24,"div")(25,"h6"),e._uU(26,"Page Size"),e.qZA(),e.TgZ(27,"input",8),e.NdJ("ngModelChange",function(a){return n.filter.RowCount=a}),e.qZA()()()(),e.TgZ(28,"content")(29,"div",9)(30,"div",10)(31,"div",11)(32,"div",12)(33,"table",13)(34,"thead")(35,"tr",14)(36,"th"),e._uU(37,"Date"),e.qZA(),e.TgZ(38,"th"),e._uU(39,"Channel"),e.qZA(),e.TgZ(40,"th"),e._uU(41,"Actions"),e.qZA(),e.TgZ(42,"th"),e._uU(43,"Number"),e.qZA(),e.TgZ(44,"th"),e._uU(45,"Code"),e.qZA()()(),e.TgZ(46,"tbody"),e.YNc(47,I,14,17,"tr",15),e.qZA()(),e.TgZ(48,"mat-paginator",16),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Order Log")("text",n.Number),e.xp6(6),e.Q6J("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),e.xp6(4),e.Q6J("clearable",!0)("items",n.ActionTypeList)("ngModel",n.filter.ActionType),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(4),e.Q6J("ngModel",n.filter.StatusCode),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.RowCount),e.xp6(20),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.mk,s.sg,p.Fj,p.wV,p.JJ,p.On,l.yS,u.p,_.NW,T.w9,f.QB,s.uU]}),o})();const D=function(){return["/menu/log/inventory/detail"]},w=function(o){return{ID:o}};function R(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",15),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA()()),2&o){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(10,D))("queryParams",e.VKq(11,w,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)}}let M=(()=>{class o{constructor(t,n){this.http=t,this._RawLogService=n,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(t=>{this.filter=t.Filter,this.Channel=t.Options.Channel,this.ActionTypeList=t.Options.ActionTypeList,this.Get()})}Get(t){null!=t&&(this.filter.Sku=t),this.http.post("api/Inventory/GetLog",this.filter).subscribe(n=>{this._RawLogService.Data=n.hits,this.Result=Array();for(let i of n.hits)this.Result.push({ID:i._source.log.id,Created:i._source["@timestamp_received"],channelName:i._source.log.channelName,Sku:i._source.log.sku,Stock:i._source.log.stock,ResponseCode:i._source.log.responseCode});this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount,this.paginationTotal=n.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-inventory-log"]],decls:41,vars:13,consts:[["searchBoxPlaceHolder","Enter SKU...",3,"headerTitle","text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt=3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.filter.Sku=a})("onSubmit",function(a){return n.Get(a)}),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(a){return n.filter.ChannelID=a}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"From/To"),e.qZA(),e.TgZ(10,"datepicker",3),e.NdJ("dateChange",function(a){return n.filter.From=a}),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(a){return n.filter.To=a}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Number"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(a){return n.filter.PageNumber=a}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Size"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(a){return n.filter.RowCount=a}),e.qZA()()()(),e.TgZ(20,"content")(21,"div",7)(22,"div",8)(23,"div",9)(24,"div",10)(25,"table",11)(26,"thead")(27,"tr",12)(28,"th"),e._uU(29,"Created"),e.qZA(),e.TgZ(30,"th"),e._uU(31,"Channel"),e.qZA(),e.TgZ(32,"th"),e._uU(33,"SKU"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Stock"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"Response code"),e.qZA()()(),e.TgZ(38,"tbody"),e.YNc(39,R,13,13,"tr",13),e.qZA()(),e.TgZ(40,"mat-paginator",14),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Inventory Log")("text",n.filter.Sku),e.xp6(6),e.Q6J("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.RowCount),e.xp6(20),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.sg,p.Fj,p.wV,p.JJ,p.On,l.yS,u.p,_.NW,T.w9,f.QB,s.uU]}),o})();const x=function(){return["/menu/log/rawlog/detail"]},J=function(o){return{ID:o}};function k(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",9),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=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(10,x))("queryParams",e.VKq(11,J,t.id)),e.xp6(1),e.hij(" ",e.xi3(4,7,t.Created,"dd MMM yyyy HH:mm")," "),e.xp6(3),e.Oqu(t.number),e.xp6(2),e.Oqu(t.type),e.xp6(2),e.Oqu(t.message),e.xp6(2),e.Oqu(t.processTypeString)}}function P(o,r){if(1&o&&(e.TgZ(0,"div",2)(1,"div",3)(2,"div",4)(3,"table",5)(4,"thead",6)(5,"tr")(6,"th",7),e._uU(7,"Date"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Number"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Type"),e.qZA(),e.TgZ(12,"th"),e._uU(13,"Status"),e.qZA(),e.TgZ(14,"th"),e._uU(15,"Process"),e.qZA()()(),e.TgZ(16,"tbody"),e.YNc(17,k,13,13,"tr",8),e.qZA()()()()()),2&o){const t=e.oxw();e.xp6(17),e.Q6J("ngForOf",t.Result)}}let F=(()=>{class o{constructor(t,n){this.http=t,this._RawLogService=n,this.Result=Array(),this.list=[],this.filter={},this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.filter={Number:"",PageNumber:1,RowCount:20,ChannelID:"",Status:""}}ngOnInit(){}Get(t){if(null!=t){let n=[];n.push(t),this.http.post("api/Orders/GetRawLog",n).subscribe(i=>{this._RawLogService.Data=i.hits,this.Result=Array();for(let a of i.hits){let g={};g=a._source.error?{id:a._id,message:a._source.message,processTypeString:a._source.error.processType,type:a._source.error.type,number:a._source.error.number,Created:a._source["@timestamp_received"]}:{id:a._id,message:a._source.message,processTypeString:a._source.log.processType,type:a._source.log.type,number:a._source.log.number,Created:a._source["@timestamp_received"]},this.Result.push(g)}})}}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-raw-log"]],decls:3,vars:3,consts:[["searchBoxPlaceHolder","Invoice Number..","hideSearchDropdown","true",3,"headerTitle","text","textChange","onSubmit"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return n.filter.Number=a})("onSubmit",function(a){return n.Get(a)}),e.TgZ(1,"content"),e.YNc(2,P,18,1,"div",1),e.qZA()()),2&t&&(e.Q6J("headerTitle","Raw Log")("text",n.filter.Number),e.xp6(2),e.Q6J("ngIf",n.Result.length>0))},dependencies:[s.sg,s.O5,l.yS,u.p,s.uU]}),o})();class Q{constructor(r,t){this._document=t;const n=this._textarea=this._document.createElement("textarea"),i=n.style;i.position="fixed",i.top=i.opacity="0",i.left="-999em",n.setAttribute("aria-hidden","true"),n.value=r,this._document.body.appendChild(n)}copy(){const r=this._textarea;let t=!1;try{if(r){const n=this._document.activeElement;r.select(),r.setSelectionRange(0,r.value.length),t=this._document.execCommand("copy"),n&&n.focus()}}catch{}return t}destroy(){const r=this._textarea;r&&(r.remove(),this._textarea=void 0)}}let Y=(()=>{class o{constructor(t){this._document=t}copy(t){const n=this.beginCopy(t),i=n.copy();return n.destroy(),i}beginCopy(t){return new Q(t,this._document)}}return o.\u0275fac=function(t){return new(t||o)(e.LFG(s.K0))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();const E=new e.OlP("CDK_COPY_TO_CLIPBOARD_CONFIG");let z=(()=>{class o{constructor(t,n,i){this._clipboard=t,this._ngZone=n,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 n=t;const i=this._clipboard.beginCopy(this.text);this._pending.add(i);const a=()=>{const g=i.copy();g||!--n||this._destroyed?(this._currentTimeout=null,this._pending.delete(i),i.destroy(),this.copied.emit(g)):this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(a,1))};a()}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(Y),e.Y36(e.R0b),e.Y36(E,8))},o.\u0275dir=e.lG2({type:o,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(t,n){1&t&&e.NdJ("click",function(){return n.copy()})},inputs:{text:["cdkCopyToClipboard","text"],attempts:["cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"}}),o})(),G=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({}),o})();function B(o,r){1&o&&e._UZ(0,"img",21)}function H(o,r){1&o&&e._UZ(0,"img",22)}function j(o,r){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,B,1,0,"img",11),e.YNc(20,H,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," ")}}function K(o,r){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)}}function W(o,r){if(1&o){const t=e.EpF();e.TgZ(0,"a",15),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.Retry())}),e._uU(1,"Retry"),e.qZA()}}function ee(o,r){1&o&&e._UZ(0,"img",12)}function te(o,r){1&o&&e._UZ(0,"img",13)}function ne(o,r){if(1&o&&(e.TgZ(0,"tr")(1,"td"),e.YNc(2,ee,1,0,"img",9),e.YNc(3,te,1,0,"img",10),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td")(9,"div",11),e._uU(10),e.qZA(),e.TgZ(11,"div"),e._uU(12),e.qZA()()()),2&o){const t=r.$implicit;e.xp6(2),e.Q6J("ngIf",1==t.TypeID),e.xp6(1),e.Q6J("ngIf",0==t.TypeID),e.xp6(2),e.Oqu(t.Date),e.xp6(2),e.Oqu(t.Number),e.xp6(3),e.Oqu(t.message),e.xp6(2),e.Oqu(t.stackTrace)}}const ie=[{path:"",component:y,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:N,canActivate:[h.a],data:{title:"Orders Log"}},{path:"inventory",component:M,canActivate:[h.a],data:{title:"Inventory Log"}},{path:"rawlog",component:F,canActivate:[h.a],data:{title:"Raw Log"}},{path:"rawlog/detail",component:(()=>{class o{constructor(t,n,i){this.route=t,this.http=n,this._RawLogService=i,this.route.queryParams.subscribe(a=>{let g=JSON.parse(localStorage.getItem("channel"));if(this.ID=a.ID,this.data=this._RawLogService.Fill(this.ID),this.data.Created=this.data._source["@timestamp_received"],g.length>0){const C=g.find(se=>se.ShopID==this.data._source.shopId);C?(this.data.TypeID=C.TypeID,this.data.ShopName=C.Name,this.data.ShopLink=C.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(l.gz),e.Y36(c.O),e.Y36(m))},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(t,n){1&t&&(e.TgZ(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),e.YNc(4,j,59,14,"div",3),e.qZA()()()()),2&t&&(e.Q6J("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(4),e.Q6J("ngIf",n.data))},dependencies:[s.O5,u.p,z,s.uU]}),o})(),canActivate:[h.a],data:{title:"Raw Log Detail"}},{path:"errorlog",component:L,canActivate:[h.a],data:{title:"Error Log"}},{path:"inventory/detail",component:(()=>{class o{constructor(t,n,i){this.route=t,this.http=n,this._RawLogService=i,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(a=>{this.ID=a.ID,this.Load()})}ngOnInit(){}Load(){this.http.post("/api/Inventory/GetInventoryLogDeatil",{ID:this.ID}).subscribe(n=>{this.data.Created=n.hits[0]._source["@timestamp_received"],this.data.Sku=n.hits[0]._source.log.sku,this.data.ChannelName=n.hits[0]._source.log.channelName,this.data.ResponseCode=n.hits[0]._source.log.responseCode,this.request=JSON.parse(n.hits[0]._source.log.request),this.response=n.hits[0]._source.log.response})}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(l.gz),e.Y36(c.O),e.Y36(m))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-inventory-detail"]],decls:30,vars:9,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(t,n){1&t&&(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,K,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&t&&(e.Q6J("headerTitle","Inventory Detail")("pageData","Inventory Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(7),e.Q6J("ngIf",n.data),e.xp6(11),e.Oqu(e.lcZ(19,7,n.request)),e.xp6(11),e.Oqu(n.response))},dependencies:[s.O5,l.yS,u.p,s.Ts,s.uU]}),o})(),canActivate:[h.a],data:{title:"Inventory Details"}},{path:"order/detail",component:(()=>{class o{constructor(t,n){this.route=t,this.http=n,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(i=>{this.ID=i.ID,this.Load()})}ngOnInit(){}Retry(){this.http.post("/api/Orders/Retry",{ID:this.ID}).subscribe(n=>{alert(JSON.stringify(n))})}Load(){this.http.post("/api/Orders/GetDetail",{ID:this.ID}).subscribe(n=>{for(let i of n.hits)this.Number=i._source.log.number,this.MarketTypeString=i._source.log.type,this.ResponseCode=i._source.log.responseCode,this.POSActionTypeString=i._source.message,this.ProcessDuration=0,this.Created=i._source["@timestamp_received"],this.request=JSON.parse(i._source.log.request),this.response=JSON.parse(i._source.log.response),this.shopId=i._source.shopId})}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(l.gz),e.Y36(c.O))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-orderdetail"]],decls:82,vars:20,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"],[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(t,n){1&t&&(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.TgZ(50,"div",9)(51,"div",10)(52,"label"),e._uU(53,"Action"),e.qZA(),e.TgZ(54,"div")(55,"span"),e._uU(56),e.qZA()()()()()()()()(),e.TgZ(57,"div",11)(58,"div",9)(59,"div",5)(60,"div",6)(61,"h5"),e._uU(62,"Request"),e.qZA()(),e.TgZ(63,"div",7)(64,"div",4)(65,"div",12)(66,"pre"),e._uU(67),e.ALo(68,"json"),e.qZA()()(),e.TgZ(69,"actions",13),e.YNc(70,W,2,0,"a",14),e.qZA()()()(),e.TgZ(71,"div",9)(72,"div",5)(73,"div",6)(74,"h5"),e._uU(75,"Response"),e.qZA()(),e.TgZ(76,"div",7)(77,"div",4)(78,"div",12)(79,"pre"),e._uU(80),e.ALo(81,"json"),e.qZA()()()()()()()()()()),2&t&&(e.Q6J("headerTitle","Order #"+n.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(20),e.Oqu(e.xi3(21,13,n.Created,"dd MMM yyyy HH:mm:ss")),e.xp6(8),e.Oqu(n.Number),e.xp6(7),e.Oqu(n.MarketTypeString),e.xp6(7),e.Oqu(n.ResponseCode),e.xp6(7),e.Oqu(n.shopId),e.xp6(7),e.Oqu(n.POSActionTypeString),e.xp6(11),e.Oqu(e.lcZ(68,16,n.request)),e.xp6(3),e.Q6J("ngIf","200"!=n.ResponseCode&&"201"!=n.ResponseCode),e.xp6(10),e.Oqu(e.lcZ(81,18,n.response)))},dependencies:[s.O5,l.yS,u.p,s.Ts,s.uU]}),o})(),canActivate:[h.a],data:{title:"Order Details"}},{path:"exception",component:(()=>{class o{constructor(t){this.http=t,this.Result=Array(),this.filter={RowCount:50,PageNumber:1},this.Load()}ngOnInit(){}Load(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(t=>{this.Result=Array();for(let n of t.hits)this.Result.push({TypeID:"Shopee"==n._source.error.type?0:1,Number:n._source.error.number,Date:n._source["@timestamp_received"],stackTrace:n._source.error.stackTrace,message:n._source.message});this.paginationTotal=t.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Load()}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(c.O))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-exception-log"]],decls:21,vars:5,consts:[["searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true",3,"headerTitle"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],[1,"fw-bold"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e._UZ(1,"filters"),e.TgZ(2,"content")(3,"div",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead")(9,"tr",6)(10,"th"),e._uU(11,"Channel"),e.qZA(),e.TgZ(12,"th"),e._uU(13,"Date"),e.qZA(),e.TgZ(14,"th"),e._uU(15,"Number"),e.qZA(),e.TgZ(16,"th"),e._uU(17,"Exception"),e.qZA()()(),e.TgZ(18,"tbody"),e.YNc(19,ne,13,6,"tr",7),e.qZA()(),e.TgZ(20,"mat-paginator",8),e.NdJ("page",function(a){return n.changePage(a)}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","Exception Log"),e.xp6(19),e.Q6J("ngForOf",n.Result),e.xp6(1),e.Q6J("length",n.paginationTotal)("pageSize",n.paginationPageSize)("pageIndex",0==(null==n.filter?null:n.filter.PageNumber)?0:(null==n.filter?null:n.filter.PageNumber)-1))},dependencies:[s.sg,s.O5,u.p,_.NW]}),o})(),canActivate:[h.a],data:{title:"Exception Log"}}]}];let ae=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[s.ez,l.Bz.forChild(ie)]}),o})(),re=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[s.ez,p.u5,p.UX,ae,l.Bz,u.R,G,_.TU,T.A0,f.ZU,v.Z]}),o})()}}]);