marketplacepos 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/3rdpartylicenses.txt +5 -5
- package/Marketplace/{chunk-75KTCVZF.js → chunk-233MWU5I.js} +2 -2
- package/Marketplace/chunk-2FZAKLVH.js +2 -0
- package/Marketplace/chunk-2GUSUJKR.js +2 -0
- package/Marketplace/chunk-2Y66HZFD.js +1 -0
- package/Marketplace/{chunk-FHIDET6K.js → chunk-35GLPUIA.js} +1 -1
- package/Marketplace/{chunk-TGSKHOI4.js → chunk-37HLVAAU.js} +1 -1
- package/Marketplace/chunk-3G5KO3TI.js +2 -0
- package/Marketplace/chunk-3KJSV75O.js +1 -0
- package/Marketplace/{chunk-SUBRCXIB.js → chunk-3ZNOGHL3.js} +1 -1
- package/Marketplace/chunk-4TY6WDXS.js +1 -0
- package/Marketplace/{chunk-PMCLVNMY.js → chunk-53K2CWAN.js} +1 -1
- package/Marketplace/chunk-5LICD27P.js +5 -0
- package/Marketplace/chunk-6HLIRI7N.js +1 -0
- package/Marketplace/chunk-6YFZBURX.js +1 -0
- package/Marketplace/{chunk-KLMICCVJ.js → chunk-7ARC4G4F.js} +1 -1
- package/Marketplace/{chunk-VPHHTNUD.js → chunk-AO2MXRCQ.js} +1 -1
- package/Marketplace/chunk-BUG6II55.js +1 -0
- package/Marketplace/{chunk-2NSPG6VQ.js → chunk-CIGF5YG5.js} +1 -1
- package/Marketplace/{chunk-CMHF5RTN.js → chunk-DKPFXQNF.js} +1 -1
- package/Marketplace/chunk-E64JNFG7.js +1 -0
- package/Marketplace/chunk-FBU5QXHN.js +1 -0
- package/Marketplace/chunk-FTYEJYHR.js +1 -0
- package/Marketplace/{chunk-FVAPOGDC.js → chunk-G4PZ5CPL.js} +1 -1
- package/Marketplace/chunk-HEYRRICW.js +1 -0
- package/Marketplace/chunk-HVNMMTYL.js +1 -0
- package/Marketplace/{chunk-GJLYUWSL.js → chunk-I7PLLVEH.js} +1 -1
- package/Marketplace/chunk-IM6ZDC7I.js +2 -0
- package/Marketplace/{chunk-NWWR3K33.js → chunk-IOUI2FZD.js} +1 -1
- package/Marketplace/{chunk-W5JLE65X.js → chunk-IPSBLHOU.js} +2 -2
- package/Marketplace/{chunk-3H6SWWM2.js → chunk-ISJRZPJX.js} +1 -1
- package/Marketplace/{chunk-VMNROKIK.js → chunk-JGYSNRH6.js} +1 -1
- package/Marketplace/chunk-JUIDNG6B.js +1 -0
- package/Marketplace/chunk-JWESCPR3.js +1 -0
- package/Marketplace/chunk-K5FAZTRK.js +1 -0
- package/Marketplace/{chunk-F55Q67A4.js → chunk-KDJNHDU2.js} +1 -1
- package/Marketplace/{chunk-QUDJWHMB.js → chunk-KTPCOMZ2.js} +1 -1
- package/Marketplace/{chunk-3UYUXGVK.js → chunk-M3XCT7JY.js} +1 -1
- package/Marketplace/{chunk-CQY6SBLJ.js → chunk-MBHOZDLB.js} +1 -1
- package/Marketplace/{chunk-QMFPH7XZ.js → chunk-MGVAWFYU.js} +7 -7
- package/Marketplace/{chunk-4FXEREAP.js → chunk-MIAEM23L.js} +1 -1
- package/Marketplace/chunk-MLMGMDJA.js +1 -0
- package/Marketplace/chunk-NAXDUEX4.js +1 -0
- package/Marketplace/{chunk-3EZXX4SY.js → chunk-NEAQH3FX.js} +1 -1
- package/Marketplace/chunk-PP4T4PLJ.js +1 -0
- package/Marketplace/{chunk-FKBDMXZF.js → chunk-PUSB4EIC.js} +1 -1
- package/Marketplace/chunk-Q2ZCP6BL.js +1 -0
- package/Marketplace/chunk-Q6Y22NLN.js +1 -0
- package/Marketplace/chunk-QC4HQRFC.js +1 -0
- package/Marketplace/{chunk-3S4B7FJG.js → chunk-R2U2NYVL.js} +1 -1
- package/Marketplace/chunk-SFDY7NUA.js +1 -0
- package/Marketplace/chunk-SUY2H7ZI.js +1 -0
- package/Marketplace/chunk-SY5WIR62.js +3 -0
- package/Marketplace/chunk-UTRK7TTD.js +1 -0
- package/Marketplace/chunk-UTSC6PL6.js +1 -0
- package/Marketplace/chunk-UWU5GEHX.js +1 -0
- package/Marketplace/chunk-V3NJFGV3.js +1 -0
- package/Marketplace/chunk-V752HOUZ.js +1 -0
- package/Marketplace/chunk-VX5ROJLM.js +1 -0
- package/Marketplace/chunk-W7OIIPRU.js +1 -0
- package/Marketplace/chunk-WNUGQVRM.js +5 -0
- package/Marketplace/{chunk-TXVLR2RN.js → chunk-YBAPXY6T.js} +1 -1
- package/Marketplace/chunk-YK6VKTWV.js +1 -0
- package/Marketplace/{chunk-RBJQ6EI6.js → chunk-YS2YJHB3.js} +1 -1
- package/Marketplace/{chunk-OVHULOR3.js → chunk-ZVELVZIL.js} +1 -1
- package/Marketplace/{chunk-CIUA5X4L.js → chunk-ZXU3FVPS.js} +11 -11
- package/Marketplace/index.html +2 -2
- package/Marketplace/main-ICOUGZTS.js +1 -0
- package/Marketplace/{styles-VIFLB3RD.css → styles-XDRE2JJC.css} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-266DSHGO.js +0 -1
- package/Marketplace/chunk-2FIOSKRJ.js +0 -1
- package/Marketplace/chunk-3C4XDMT2.js +0 -1
- package/Marketplace/chunk-3KDFTXQM.js +0 -1
- package/Marketplace/chunk-3URAANI6.js +0 -5
- package/Marketplace/chunk-4PPU4SZR.js +0 -1
- package/Marketplace/chunk-5A74K34K.js +0 -2
- package/Marketplace/chunk-5BFBDU4Y.js +0 -1
- package/Marketplace/chunk-5FWZE3M6.js +0 -1
- package/Marketplace/chunk-6ORFYERF.js +0 -1
- package/Marketplace/chunk-6R23WA5G.js +0 -1
- package/Marketplace/chunk-A6HOOHGI.js +0 -1
- package/Marketplace/chunk-BFSIXPYE.js +0 -1
- package/Marketplace/chunk-BNL5KXTW.js +0 -1
- package/Marketplace/chunk-CGWBESJR.js +0 -1
- package/Marketplace/chunk-D7MTVAUX.js +0 -2
- package/Marketplace/chunk-EV36IP6L.js +0 -2
- package/Marketplace/chunk-F3YY7P47.js +0 -1
- package/Marketplace/chunk-G5PYEJ6I.js +0 -1
- package/Marketplace/chunk-G6FQOKR3.js +0 -1
- package/Marketplace/chunk-GUDIOT6F.js +0 -1
- package/Marketplace/chunk-IHMSIZQP.js +0 -1
- package/Marketplace/chunk-IKMQT2F2.js +0 -1
- package/Marketplace/chunk-KJQHDPO2.js +0 -1
- package/Marketplace/chunk-KSOIRHFB.js +0 -1
- package/Marketplace/chunk-KTTSCH5B.js +0 -1
- package/Marketplace/chunk-L73KNYMB.js +0 -1
- package/Marketplace/chunk-LKBZC32T.js +0 -1
- package/Marketplace/chunk-NGLKNAAE.js +0 -5
- package/Marketplace/chunk-NHFS3EQL.js +0 -3
- package/Marketplace/chunk-NVLJ23H4.js +0 -1
- package/Marketplace/chunk-QS23P4G5.js +0 -1
- package/Marketplace/chunk-R56RSI2V.js +0 -2
- package/Marketplace/chunk-RHYOB3FA.js +0 -1
- package/Marketplace/chunk-VPZ3M3XI.js +0 -1
- package/Marketplace/chunk-VVGZ7KQX.js +0 -1
- package/Marketplace/chunk-WX2VXA4V.js +0 -1
- package/Marketplace/main-FFSPLMLV.js +0 -1
- /package/Marketplace/{chunk-T6GUYLRX.js → chunk-6RUGKYFT.js} +0 -0
- /package/Marketplace/{chunk-GWMLSBG4.js → chunk-KPTAVWMG.js} +0 -0
- /package/Marketplace/{chunk-MNDH6U5G.js → chunk-V6VYUZWG.js} +0 -0
- /package/Marketplace/{chunk-2IH2MGS7.js → chunk-ZLME6FEU.js} +0 -0
- /package/Marketplace/{polyfills-HTM62PZX.js → polyfills-L2ZK4WXQ.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ht,c as H,d as Qt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-5A74K34K.js";import{a as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-MNDH6U5G.js";import{a as U}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-3S4B7FJG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-QUDJWHMB.js";import{d as Jt,e as zt,f as Ht,g as Zt,k as qt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-3H6SWWM2.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-5BFBDU4Y.js";import{a as Z,b as _t}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-TXVLR2RN.js";import{a as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-3UYUXGVK.js";import{b as Wt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-266DSHGO.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-BNL5KXTW.js";import{a as Yt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-VPHHTNUD.js";import{a as D}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-FKBDMXZF.js";import{a as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-3EZXX4SY.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-NWWR3K33.js";import{c as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-CGWBESJR.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-6ORFYERF.js";import{a as Rt,b as Bt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-QS23P4G5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-KTTSCH5B.js";import{b as A,e as R}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-A6HOOHGI.js";import{a as Kt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-CQY6SBLJ.js";import{a as $t,b as jt,c as Gt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-KJQHDPO2.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-NVLJ23H4.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-CMHF5RTN.js";import{a as et,c as J,d as Vt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-EV36IP6L.js";import{a as Y}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-FVAPOGDC.js";import{t as ut,u as Lt,v as k,w as At}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-D7MTVAUX.js";import{T as Ut}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-IKMQT2F2.js";import{b as Et,c as X,h as B,k as $,u as kt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-KSOIRHFB.js";import{b as tt,c as g}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-GWMLSBG4.js";import{$ as wt,$a as I,B as b,Bb as F,Cb as N,Db as Ot,Ea as c,Fa as P,Fc as pt,Gc as Nt,Ic as mt,Kb as W,Kc as Tt,Na as d,S as K,Ta as S,U as lt,W as yt,Ya as a,Yb as T,Za as l,Zb as E,_a as C,ab as y,ac as st,bc as Ft,c as bt,cb as x,da as M,dc as dt,ea as Mt,ec as Dt,gb as _,ia as u,ib as p,ja as h,nb as L,ob as m,pb as ct,q as It,qb as v,ub as q,vb as nt,ya as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-QMFPH7XZ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-T6GUYLRX.js";var ce=()=>["/menu/products/download/by-url"],Xt=(()=>{let r=class r{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),C(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),m(11,"Download Product By Url"),l()()()()()(),C(12,"router-outlet")),e&2&&(c(3),d("Tabs",i.productTabs),c(7),d("routerLink",q(2,ce)))},dependencies:[Rt,Nt,mt]});let o=r;return o})();function se(o,r){if(o&1){let n=x();a(0,"button",15),_("click",function(){u(n);let e=p();return h(e.onOpenScanDialog())}),C(1,"i",16),m(2," Scan Channel "),l()}}function de(o,r){if(o&1){let n=x();a(0,"button",17),_("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(1,"i",16),m(2),l()}if(o&2){let n=p(),t;c(2),v(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function pe(o,r){if(o&1){let n=x();a(0,"button",18),_("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(1,"i",19),m(2),l()}if(o&2){let n=p(),t;c(2),v(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function me(o,r){if(o&1){let n=x();a(0,"div",20)(1,"app-product-card",21),_("onUpload",function(){let i=u(n).$implicit,s=p();return h(s.onUploadToMultipleChannel(i))})("onScan",function(){let i=u(n).$implicit,s=p();return h(s.onScanSingleProduct(i))})("onDescEvent",function(){let i=u(n).index,s=p();return h(s.onOpenDialogVariant(i))})("onCheckBoxChange",function(e){let s=u(n).$implicit;return h(s.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(1),d("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null?null:n.Variants.length)>1?(n==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function ue(o,r){o&1&&(I(0),a(1,"div",22),C(2,"app-empty-state"),l(),y())}function he(o,r){if(o&1){let n=x();I(0),a(1,"div",23)(2,"div",24)(3,"app-custom-paginator",25),_("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPrevPage())}),l()()(),y()}if(o&2){let n=p();c(3),d("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var ee=(()=>{let r=class r{constructor(t,e,i,s){this.http=t,this.toastr=e,this.dialog=i,this.productService=s,this.searchFilter=new z,this.products=[],this.rowCount=0,this.getLoaderPage()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.channelOptions=t.Options.Channel,this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(b(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(ht,{data:{title:this.products[t].Name,variants:this.products[t].Variants},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(H,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(b(i=>i!=="CANCEL"),K(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(H,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(b(s=>s!=="CANCEL"),K(s=>this.productService.uploadSingleProduct([t],s))).subscribe({next:s=>{this.getProducts()}})}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onNextPage(){this.getProducts()}onPrevPage(){this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[tt.Tokopedia,tt.Tiktok]);this.dialog.open(D,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(b(s=>g.IsNotEmpty(s))).subscribe(s=>{this.searchFilter.ChannelID=s.ChannelID,this.searchFilter.ScanFull=s.ScanFull,this.searchFilter.UpdatedProduct=s.UpdatedProduct;let f=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(f);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=g.GuidEMpty,this.dialog.open(D,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(b(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let s=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(s)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=g.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}};r.\u0275fac=function(e){return new(e||r)(P(R),P(A),P(j),P(V))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:26,vars:13,consts:[["description","All products which is already available in POS",3,"headerTitle","onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onScan","onDescEvent","onCheckBoxChange"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous"]],template:function(e,i){if(e&1){let s=x();a(0,"mainpanel",0),_("onSubmit",function(w){return i.searchProduct(w)}),a(1,"actions"),S(2,se,3,0,"button",1)(3,de,3,1,"button",2)(4,pe,3,1,"button",3),l(),a(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),m(10,"Category "),l(),a(11,"ng-select",6),_("ngModelChange",function(w){return i.searchFilter.Category=w}),l()(),a(12,"div")(13,"h6"),m(14,"Release"),l(),a(15,"mat-date-range-input",7)(16,"input",8),_("ngModelChange",function(w){return i.startDate=w})("click",function(){u(s);let w=L(19);return h(w.open())}),l(),a(17,"input",9),_("ngModelChange",function(w){return i.endDate=w})("click",function(){u(s);let w=L(19);return h(w.open())}),l()(),C(18,"mat-date-range-picker",null,10),l()()()(),a(20,"content")(21,"div",11)(22,"div",12),S(23,me,2,10,"div",13)(24,ue,3,0,"ng-container",14),l(),S(25,he,4,4,"ng-container",14),l()()()}if(e&2){let s=L(19);d("headerTitle","In POS ("+i.rowCount+")"),c(2),d("ngIf",!i.productService.hasSelection(i.products)),c(1),d("ngIf",i.productService.hasSelection(i.products)),c(1),d("ngIf",i.productService.hasSelection(i.products)),c(7),d("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(4),d("rangePicker",s),c(1),d("ngModel",i.startDate),c(1),d("ngModel",i.endDate),c(6),d("ngForOf",i.products),c(1),d("ngIf",i.products.length==0),c(1),d("ngIf",i.products.length>0)}},dependencies:[T,E,X,B,$,k,J,G,Z,U,Ht,Jt,zt,Zt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}"]});let o=r;return o})();function _e(o,r){if(o&1){let n=x();a(0,"button",13),_("click",function(){u(n);let e=p();return h(e.onOpenScanDialog())}),C(1,"i",14),m(2," Scan Channel "),l()}}function ge(o,r){if(o&1){let n=x();a(0,"button",15),_("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(1,"i",14),m(2),l()}if(o&2){let n=p();c(2),v(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function Ce(o,r){if(o&1){let n=x();a(0,"button",16),_("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(1,"i",17),m(2),l()}if(o&2){let n=p();c(2),v(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function fe(o,r){if(o&1&&(a(0,"span",18),C(1,"img",19),l(),m(2)),o&2){let n=r.item,t=p();c(1),d("src",t.getChannelLogo(n.TypeID),O),c(1),v(" ",n.Name," ")}}function Se(o,r){if(o&1){let n=x();a(0,"div")(1,"h6"),m(2,"Item ID"),l(),a(3,"input",20),_("ngModelChange",function(e){u(n);let i=p();return h(i.searchFilter.Item_id=e)}),l()()}if(o&2){let n=p();c(3),d("ngModel",n.searchFilter.Item_id)}}function xe(o,r){if(o&1){let n=x();a(0,"div",21)(1,"app-product-card",22),_("onUpload",function(){let i=u(n).$implicit,s=p();return h(s.onUploadToMultipleChannel(i))})("onDescEvent",function(){let i=u(n).index,s=p();return h(s.onOpenVariantDetail(i))})("onScan",function(){let i=u(n).$implicit,s=p();return h(s.onScanSingleProduct(i))})("onCheckBoxChange",function(e){let s=u(n).$implicit;return h(s.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(1),d("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function Pe(o,r){o&1&&(I(0),a(1,"div",23),C(2,"app-empty-state"),l(),y())}function ve(o,r){if(o&1){let n=x();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),_("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=p();c(2),d("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var ne=(()=>{let r=class r{constructor(t,e,i,s,f){this.http=t,this.dialog=e,this.toastr=i,this.productService=s,this.activateRouter=f,this.searchFilter=new z,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=g.GuidEMpty}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(g.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,e.Filter.ChannelID!=g.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(e=>{this.products=e.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let e=this.products[t].Variants;this.dialog.open(ht,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(b(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(b(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(g.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(D,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(b(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let s=this.productService.getVariantCodesProduct(t);this.scanProducts(s)})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(H,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(b(s=>s!=="CANCEL"),K(s=>this.productService.uploadSingleProduct([t],s))).subscribe({next:s=>{this.getProducts()}})}onScanMultipleProduct(){let t=this.productService.filterChannelByTypeId(this.channelOptions,[tt.Tokopedia,tt.Tiktok]);this.searchFilter.ChannelID=g.GuidEMpty;let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(D,{data:{filter:e,channelOptions:t,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(b(s=>g.IsNotEmpty(s))).subscribe(s=>{this.searchFilter.ChannelID=s.ChannelID,this.searchFilter.ScanFull=s.ScanFull,this.searchFilter.UpdatedProduct=s.UpdatedProduct;let f=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(f);this.scanProducts(w)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=g.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=g.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(H,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(b(i=>i!=="CANCEL"),K(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(t){return g.getChannelLogoByTypeId(t)}};r.\u0275fac=function(e){return new(e||r)(P(R),P(j),P(A),P(V),P(pt))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],decls:20,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"headerTitle","onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],["type","text","name","Item_id","id","Item_id",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onDescEvent","onScan","onCheckBoxChange"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),_("onSubmit",function(f){return i.searchProduct(f)}),a(1,"actions"),S(2,_e,3,0,"button",1)(3,ge,3,1,"button",2)(4,Ce,3,1,"button",3),l(),a(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),m(10,"Channel"),l(),a(11,"ng-select",6),_("ngModelChange",function(f){return i.searchFilter.ListChannelID=f})("clear",function(){return i.onClearFilterChannel()}),S(12,fe,3,2,"ng-template",7),l()(),S(13,Se,4,1,"div",8),l()()(),a(14,"content")(15,"div",9)(16,"div",10),S(17,xe,2,10,"div",11)(18,Pe,3,0,"ng-container",8),l(),S(19,ve,3,4,"div",12),l()()()),e&2&&(d("headerTitle","Sold in Channel"),c(2),d("ngIf",!i.productService.hasSelection(i.products)),c(1),d("ngIf",i.productService.hasSelection(i.products)),c(1),d("ngIf",i.productService.hasSelection(i.products)),c(7),d("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),d("ngIf",i.searchFilter.ListChannelID!=null),c(4),d("ngForOf",i.products),c(1),d("ngIf",i.products.length==0),c(1),d("ngIf",i.products==null?null:i.products.length))},dependencies:[T,E,X,B,$,k,J,et,G,Z,U],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=r;return o})();function Ie(o,r){if(o&1){let n=x();a(0,"button",10),_("click",function(){u(n);let e=p(2);return h(e.uploadMultipleProduct())}),C(1,"i",11),m(2),l()}if(o&2){let n=p(2);c(2),v(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function ye(o,r){if(o&1){let n=x();I(0),a(1,"td",27)(2,"input",28),_("ngModelChange",function(e){u(n);let i=p(2).$implicit;return h(i.selected=e)})("ngModelChange",function(){u(n);let e=p(3).ngIf,i=p(3);return h(i.onSelectProduct(e))}),l()(),y()}if(o&2){let n=p(2).$implicit;c(1),d("rowSpan",n==null?null:n.Variants.length),c(1),d("ngModel",n.selected)}}function we(o,r){if(o&1){let n=x();I(0),a(1,"img",34),_("click",function(e){u(n);let i=p(3).$implicit,s=p(4);return h(s.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),y()}if(o&2){let n=p(3).$implicit;c(1),d("src",n==null?null:n.ImageUrl,O)}}function Me(o,r){o&1&&C(0,"img",35)}function Oe(o,r){if(o&1&&(I(0),a(1,"td",27)(2,"div",29),S(3,we,2,1,"ng-container",7)(4,Me,1,0,"ng-template",null,30,W),l()(),a(6,"td",31)(7,"h4",32)(8,"span",33),m(9),l()()(),y()),o&2){let n=L(5),t=p(2).$implicit;c(1),d("rowSpan",t==null?null:t.Variants.length),c(2),d("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),d("rowSpan",t==null?null:t.Variants.length),c(2),d("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(1),v(" ",t==null?null:t.Name," ")}}function Fe(o,r){if(o&1&&(a(0,"div")(1,"a",23),C(2,"img",36),l()()),o&2){let n=r.$implicit;c(1),d("href",n.URL,O),c(1),d("src",n.Img,O)("matTooltip",n.Name)}}function De(o,r){if(o&1&&(a(0,"div"),C(1,"img",36),l()),o&2){let n=r.$implicit;c(1),d("src",n.Img,O)("matTooltip",n.Name)}}function Ne(o,r){if(o&1&&(a(0,"tr"),S(1,ye,3,2,"ng-container",20)(2,Oe,10,6,"ng-container",20),a(3,"td"),m(4),l(),a(5,"td")(6,"span"),m(7),l(),a(8,"span",22)(9,"a",23),C(10,"i",24),l()()(),a(11,"td",25)(12,"div",26),S(13,Fe,3,3,"div",21),l()(),a(14,"td",25)(15,"div",26),S(16,De,2,2,"div",21),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(1),d("ngIf",t==0),c(1),d("ngIf",t==0),c(2),v(" ",n.Name," "),c(3),v(" ",n.Code," "),c(2),d("href","https://"+e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),O),c(4),d("ngForOf",n==null?null:n.Available),c(3),d("ngForOf",n==null?null:n.NotAvailable)}}function Te(o,r){if(o&1&&(I(0),S(1,Ne,17,7,"tr",21),y()),o&2){let n=r.$implicit;c(1),d("ngForOf",n.Variants)}}function Ee(o,r){if(o&1&&(a(0,"tbody"),S(1,Te,2,1,"ng-container",21),l()),o&2){let n=r.ngIf;c(1),d("ngForOf",n)}}function ke(o,r){if(o&1&&(I(0),a(1,"div",12)(2,"table",13)(3,"thead",14)(4,"tr"),C(5,"th",15),a(6,"th",16),m(7,"Product"),l(),a(8,"th",17),m(9,"Variant"),l(),a(10,"th",17),m(11,"SKU"),l(),a(12,"th",18),m(13,"Available In"),l(),a(14,"th",19),m(15,"Not Available In"),l()()(),S(16,Ee,2,1,"tbody",20),F(17,"async"),l()(),y()),o&2){let n=p(2);c(16),d("ngIf",N(17,1,n.data$))}}function Ve(o,r){o&1&&(a(0,"div",37),C(1,"app-empty-state"),l())}function Ue(o,r){if(o&1){let n=x();a(0,"span",45),_("click",function(){u(n);let e=p(3);return h(e.getRowCount())}),a(1,"i",46),m(2,"?"),l()()}}function Le(o,r){if(o&1&&(a(0,"span"),m(1),F(2,"number"),l()),o&2){let n=r.ngIf;c(1),ct(N(2,1,n==null?null:n.Count))}}function Ae(o,r){if(o&1){let n=x();a(0,"a",47),_("click",function(){u(n);let e=p(3);return h(e.onNextPage())}),C(1,"i",48),m(2," Next"),l()}}function Re(o,r){if(o&1){let n=x();a(0,"a",49),_("click",function(){u(n);let e=p(3);return h(e.onLastPage())}),C(1,"i",50),m(2," Last"),l()}}function Be(o,r){if(o&1&&(a(0,"div",38)(1,"div",39)(2,"div",40),m(3),F(4,"number"),S(5,Ue,3,0,"span",41)(6,Le,3,3,"span",20),F(7,"async"),m(8),l()(),a(9,"div",42),S(10,Ae,3,0,"a",43)(11,Re,3,0,"a",44),l()()),o&2){let n=r.ngIf,t=p(2);c(3),v(" Showing 1 - ",N(4,6,n==null?null:n.length)," of "),c(2),d("ngIf",t.paginationService.hideCount),c(1),d("ngIf",!t.paginationService.hideCount&&N(7,8,t.rowCount$)),c(2),v(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),d("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(1),d("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function $e(o,r){if(o&1){let n=x();a(0,"mainpanel",1),_("onSubmit",function(e){u(n);let i=p();return h(i.searchProduct(e))}),a(1,"actions"),S(2,Ie,3,1,"button",2),a(3,"button",3),_("click",function(){let i=u(n).ngIf,s=p();return h(s.openScanDialog(i))}),C(4,"i",4),m(5," Scan Channel "),l()(),a(6,"content")(7,"div",5)(8,"div",6),S(9,ke,18,3,"ng-container",7),F(10,"async"),S(11,Ve,2,0,"ng-template",null,8,W),l(),S(13,Be,12,10,"div",9),F(14,"async"),l()()()}if(o&2){let n=L(12),t=p(),e;d("hideSearchDropdown",!0),c(2),d("ngIf",t.hasSelectionProduct),c(7),d("ngIf",((e=N(10,5,t.data$))==null?null:e.length)>0)("ngIfElse",n),c(4),d("ngIf",N(14,7,t.data$))}}var ie=(()=>{let r=class r{constructor(t,e,i,s,f,w){this.http=t,this.dialog=e,this.toastr=i,this.productService=s,this.paginationService=f,this.biggerPictureService=w,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[]}ngOnInit(){this.initPageLoader(),this.iniData(),this.initHostName()}initHostName(){let t=localStorage.getItem("Authorization");this.hostName=JSON.parse(t)?.Host}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(yt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(It(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=g.getChannelLogoByTypeId(e.TypeID),e)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(t){let e=this.productService.findChannelById(this.filterSearch.ChannelID,t.Options.Channel);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(i=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(i,e,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(t){let e=JSON.parse(JSON.stringify(this.filterSearch));e.ChannelID=g.GuidEMpty,this.dialog.open(D,{data:{filter:e,channelOptions:t.Options.Channel},width:"600px"}).afterClosed().pipe(b(s=>g.IsNotEmpty(s))).subscribe(s=>{this.filterSearch.ChannelID=s.ChannelID,this.filterSearch.ScanFull=s.ScanFull,this.filterSearch.UpdatedProduct=s.UpdatedProduct,this.filterSearch.Async=s.Async,this.scanAllProduct(t)})}getChannelLogoById(t){return g.getChannelLogoByTypeId(t)}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){let t=this.getUniqueChannels();t=t.map(e=>(e.ID=e.ChannelID,e)),this.dialog.open(H,{width:"700px",data:{title:"Upload Multiple Product",channels:t}}).afterClosed().pipe(b(e=>e!=="CANCEL"),K(e=>{let i=this.getSelectedProductIds();return this.productService.uploadNotInChannel(i,e)})).subscribe({next:()=>{this.paginationService.reloadPagination(this.filterSearch),this.selectedProducts=[],this.hasSelectionProduct=!1},error:e=>{this.selectedProducts=[],this.hasSelectionProduct=!1}})}getSelectedProductIds(){return this.selectedProducts.map(e=>({ID:e.ProductID}))}getUniqueChannels(){let t=[];return this.selectedProducts.forEach(e=>{t=[...t,...e.Variants[0].NotAvailable]}),t=t.filter((e,i,s)=>s.findIndex(f=>f.ChannelID==e.ChannelID)==i),t}ngOnDestroy(){this.paginationService.destroy()}};r.\u0275fac=function(e){return new(e||r)(P(R),P(j),P(A),P(V),P(Yt),P(Kt))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],["EMPTY",""],["class","d-flex justify-content-between mt-5",4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModel","ngModelChange"],[2,"padding-right","0px"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){e&1&&(S(0,$e,15,9,"mainpanel",0),F(1,"async")),e&2&&d("ngIf",N(1,1,i.loader$))},dependencies:[T,E,Et,B,$,k,ut,U,st,dt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]});let o=r;return o})();function je(o,r){if(o&1){let n=x();a(0,"button",14),_("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(1,"i",15),m(2," Scan Channel "),l()}}function Ge(o,r){if(o&1){let n=x();I(0),a(1,"button",16),_("click",function(){u(n);let e=p();return h(e.onDownloadAllProduct("SELECTED"))}),C(2,"i",17),m(3),l(),y()}if(o&2){let n=p(),t;c(3),v(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Ke(o,r){if(o&1&&(a(0,"span",18),C(1,"img",19),l(),m(2)),o&2){let n=r.item,t=p();c(1),d("src",t.getChannelLogo(n.TypeID),O),c(1),v(" ",n.Name," ")}}var Je=o=>[o],ze=()=>[];function He(o,r){if(o&1){let n=x();a(0,"div",20)(1,"app-product-card",21),_("onCheckBoxChange",function(e){let s=u(n).index,f=p();return h(f.onSelectProduct(e,s))})("onDescEvent",function(){let i=u(n).index,s=p();return h(s.onShowVariantDetail(i))})("onDownload",function(){let i=u(n).$implicit,s=p();return h(s.onDownloadProduct(i))})("onScan",function(){let i=u(n).$implicit,s=p();return h(s.onScanChannel(i))}),l()()}if(o&2){let n=r.$implicit;c(1),d("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?nt(10,Je,n==null?null:n.Channel):q(12,ze))("showCheckBox",!0)("scanButton",!0)}}function Ze(o,r){o&1&&(I(0),a(1,"div",22),C(2,"app-empty-state"),l(),y())}function qe(o,r){if(o&1){let n=x();a(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),_("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=p();c(2),d("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var oe=(()=>{let r=class r{constructor(t,e,i,s,f){this.http=t,this.dialog=e,this.productService=i,this.toastrService=s,this.activateRouter=f,this.searchFilter=new z,this.products=[],this.hasClickRowCount=!1}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(g.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){this.products=this.products.map(t=>(t.Channel=JSON.parse(JSON.stringify(this.channelOptions.find(e=>e.ID==t.ChannelID))),t)).map(t=>(t.Channel.Url=t.Url,t))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?g.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=g.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(g.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=g.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(b(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(g.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let e=this.products[t].Variant;e.length>0&&this.dialog.open(Qt,{data:{title:this.products[t].Name,variants:e},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(t){return g.getChannelLogoByTypeId(t)}};r.\u0275fac=function(e){return new(e||r)(P(R),P(j),P(V),P(A),P(pt))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],decls:32,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],["name","haveSKU",1,"form-control","h-100","pt-3","rounded",3,"ngModel","ngModelChange"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton","onCheckBoxChange","onDescEvent","onDownload","onScan"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),_("onSubmit",function(f){return i.onSearch(f)}),a(1,"actions"),S(2,je,3,0,"button",1)(3,Ge,4,1,"ng-container",2),l(),a(4,"filters")(5,"div",3)(6,"div",4)(7,"div")(8,"h6"),m(9,"Channel"),l(),a(10,"ng-select",5),_("ngModelChange",function(f){return i.searchFilter.ChannelID=f})("clear",function(){return i.onClearChannelFilter()}),S(11,Ke,3,2,"ng-template",6),l()(),a(12,"div")(13,"h6"),m(14,"SKU Assigned"),l(),a(15,"mat-radio-group",7),_("ngModelChange",function(f){return i.searchFilter.HaveSku=f}),a(16,"mat-radio-button",8),m(17," All "),l(),a(18,"mat-radio-button",8),m(19," Yes "),l(),a(20,"mat-radio-button",8),m(21," No "),l()()(),a(22,"div")(23,"h6"),m(24,"Item ID"),l(),a(25,"input",9),_("ngModelChange",function(f){return i.searchFilter.Item_id=f}),l()()()()(),a(26,"content")(27,"div",10)(28,"div",11),S(29,He,2,13,"div",12)(30,Ze,3,0,"ng-container",2),l(),S(31,qe,3,4,"div",13),l()()()),e&2&&(c(2),d("ngIf",!i.productService.hasSelection(i.products)),c(1),d("ngIf",i.productService.hasSelection(i.products)),c(7),d("clearable",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ChannelID),c(5),d("ngModel",i.searchFilter.HaveSku),c(1),d("value",0),c(2),d("value",1),c(2),d("value",2),c(5),d("ngModel",i.searchFilter.Item_id),c(4),d("ngForOf",i.products),c(1),d("ngIf",i.products.length==0),c(1),d("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[T,E,X,B,$,k,J,et,$t,jt,G,Z,U],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]});let o=r;return o})();function Ye(o,r){if(o&1&&(a(0,"span",8),C(1,"img",9),l(),m(2)),o&2){let n=r.item,t=p();c(1),d("src",t.getChannelLogo(n.TypeID),O),c(1),v(" ",n.Name," ")}}function Qe(o,r){if(o&1&&(a(0,"div",10),C(1,"app-duplicate-product-card",11),l()),o&2){let n=r.$implicit,t=r.index;c(1),d("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function We(o,r){o&1&&(I(0),a(1,"div",12),C(2,"app-empty-state"),l(),y())}function Xe(o,r){if(o&1){let n=x();I(0),a(1,"div",13)(2,"div",14)(3,"app-custom-paginator",15),_("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPrevPage())})("total",function(){u(n);let e=p();return h(e.getRowCount())}),l()()(),y()}if(o&2){let n=p();c(3),d("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var re=(()=>{let r=class r{constructor(t,e){this.httpService=t,this.productService=e,this.searchFilter=new z,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.channelOptions=t.Options.Channel,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=g.GuidEMpty}getChannelLogo(t){return g.getChannelLogoByTypeId(t)}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(P(R),P(V))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"multiple","clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous","total"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),_("onSubmit",function(f){return i.onSearch(f)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6"),m(5,"Channel"),l(),a(6,"ng-select",2),_("ngModelChange",function(f){return i.searchFilter.ListChannelID=f})("clear",function(){return i.onClearFilter()}),S(7,Ye,3,2,"ng-template",3),l()()()(),a(8,"content")(9,"div",4)(10,"div",5),S(11,Qe,2,6,"div",6)(12,We,3,0,"ng-container",7),l(),S(13,Xe,4,4,"ng-container",7),l()()()),e&2&&(c(6),d("multiple",!0)("clearable",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(5),d("ngForOf",i.products),c(1),d("ngIf",(i.products==null?null:i.products.length)==0),c(1),d("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[T,E,B,$,k,J,et,_t,G,U]});let o=r;return o})();function tn(o,r){if(o&1&&(I(0),m(1),y()),o&2){let n=p().$implicit;c(1),v(" ",n.Count," ")}}function en(o,r){if(o&1){let n=x();a(0,"span",26),_("click",function(){u(n);let e=p().$implicit,i=p(2);return h(i.getLiveProductCount(e.ID,e))}),C(1,"i",27),l()}}var nn=()=>["/menu/products/status/sold-in-channel"],ae=o=>({ID:o}),on=()=>["/menu/products/status/not-in-pos"];function rn(o,r){if(o&1){let n=x();a(0,"tr")(1,"td"),C(2,"img",16),a(3,"span",17),m(4),l()(),a(5,"td",18),S(6,tn,2,1,"ng-container",4)(7,en,2,0,"ng-template",null,19,W),l(),a(9,"td",18)(10,"a",20),m(11),F(12,"number"),l()(),a(13,"td",18)(14,"a",20),m(15),F(16,"number"),l()(),a(17,"td"),m(18),F(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),_("click",function(){let i=u(n).$implicit,s=p(2);return h(s.onScanChannel(i))}),C(23,"i",23),m(24," Scan "),l(),a(25,"button",24),_("click",function(){let i=u(n).$implicit,s=p(2);return h(s.onClearCache(i.ID))}),C(26,"i",25),m(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=L(8),e=p(2);c(2),d("src",e.getChannelLogo(n.TypeID),O),c(2),ct(n.Name),c(2),d("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),d("routerLink",q(18,nn))("queryParams",nt(19,ae,n.ID)),c(1),v(" ",N(12,11,n.SoldInChannel)," "),c(3),d("routerLink",q(21,on))("queryParams",nt(22,ae,n.ID)),c(1),v(" ",N(16,13,n.NotInPOS)," "),c(3),v("",n.LastSync?Ot(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"-"," ")}}function an(o,r){if(o&1&&(I(0),a(1,"div",6)(2,"table",7)(3,"thead",8)(4,"tr",9)(5,"th"),m(6,"Channel"),l(),a(7,"th",10),m(8,"Live Product"),l(),a(9,"th",11),m(10,"Sold In Channel"),l(),a(11,"th",12),m(12,"Product Not in POS"),l(),a(13,"th",13),m(14,"Last Sync"),l(),C(15,"th",14),l()(),a(16,"tbody"),S(17,rn,28,24,"tr",15),F(18,"async"),l()()(),y()),o&2){let n=p(),t;c(17),d("ngForOf",(t=N(18,1,n.channels$))==null?null:t.Data)}}function ln(o,r){o&1&&(a(0,"div",28),C(1,"app-empty-state"),l())}var le=(()=>{let r=class r{constructor(t,e,i){this.productService=t,this.toastr=e,this.dialog=i,this.destroy$=new bt}ngOnInit(){this.setObsProductStatistic(),this.initPageLoader()}initPageLoader(){this.productService.loader().pipe(lt(this.destroy$)).subscribe(t=>{this.channelOptions=t?.Options?.Channel})}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(lt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(D,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(b(e=>g.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(b(s=>s)).subscribe(s=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(s,i,!e.UpdatedProduct),this.initPageLoader(),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(lt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.initPageLoader(),this.setObsProductStatistic()})}getChannelLogo(t){return g.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(P(V),P(A),P(j))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY",""],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],["QUESTION",""],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(e,i){if(e&1&&(a(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),S(5,an,19,3,"ng-container",4),F(6,"async"),S(7,ln,2,0,"ng-template",null,5,W),l()()()()()),e&2){let s=L(8),f;d("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),d("ngIf",((f=N(6,4,i.channels$))==null||f.Data==null?null:f.Data.length)>0)("ngIfElse",s)}},dependencies:[T,E,k,ut,mt,U,st,dt,Ft]});let o=r;return o})();var cn=[{component:Xt,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:ee,canActivate:[Y],data:{title:"Products in POS"}},{path:"sold-in-channel",component:ne,canActivate:[Y],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:ie,canActivate:[Y],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:oe,canActivate:[Y],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:re,canActivate:[Y],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:le,canActivate:[Y],data:{title:"Channel Statistic"}}]}],xi=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=Mt({type:r}),r.\u0275inj=wt({imports:[Dt,kt,At,Lt,Vt,Wt,Gt,Bt,_t,G,Z,Tt.forChild(cn),qt,Ut]});let o=r;return o})();export{xi as StatusModule};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-QUDJWHMB.js";import{b as D,c as E}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-NWWR3K33.js";import{a as x,b as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-CGWBESJR.js";import{b as de,e as pe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-A6HOOHGI.js";import{c as fe,d as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-EV36IP6L.js";import{t as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-D7MTVAUX.js";import{b as me,h as F,k as U,u as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-KSOIRHFB.js";import{b as m,c as B}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-GWMLSBG4.js";import{$ as ie,$a as I,B as Z,Bb as q,Cb as J,Ea as s,Fa as f,H as ee,Ia as H,J as te,Kb as N,Ma as G,Na as c,Oa as oe,S as W,Ta as u,U as P,Wb as re,Ya as l,Yb as v,Za as r,Zb as A,_ as ne,_a as C,ab as M,ba as K,c as w,cb as Y,da as _,dc as se,ea as ae,ec as ce,gb as g,ia as V,ib as h,ja as $,n as Q,nb as L,ob as d,pb as y,q as X,qb as T,vb as le,ya as S}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-QMFPH7XZ.js";var b=function(i){return i.Tokopedia="https://seller.tokopedia.com",i.Shoope="https://seller.shopee.co.id",i.Tiktok="https://seller-id.tiktok.com",i.WooCommerce="https://woocommerce.dealpos.app",i.Lazada="https://sellercenter.lazada.co.id",i}(b||{});function Me(i,n){if(i&1&&(I(0),l(1,"tr")(2,"td",11),d(3),r(),l(4,"td",11),d(5),r(),l(6,"td",12)(7,"p",13),d(8,"Product Not in Channel!"),r()()(),M()),i&2){let a=h().$implicit;s(3),T(" ",a==null?null:a.Model,""),s(2),T(" ",a==null?null:a.Code,"")}}function Te(i,n){if(i&1&&(l(0,"td",11),d(1),r()),i&2){let a=h(3).$implicit;G("rowspan",a.Channel.length),s(1),T(" ",a==null?null:a.Model,"")}}function ve(i,n){if(i&1&&(l(0,"td",11),d(1),r()),i&2){let a=h(3).$implicit;G("rowspan",a.Channel.length),s(1),T(" ",a==null?null:a.Code,"")}}var xe=i=>({"is-disabled":i});function Oe(i,n){if(i&1&&(l(0,"tr"),u(1,Te,2,2,"td",14)(2,ve,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),C(6,"img",17),r(),l(7,"div",18),d(8),r()()(),l(9,"td",11),d(10),q(11,"number"),r(),l(12,"td",19),d(13),q(14,"number"),r(),l(15,"td",19)(16,"a",20),C(17,"i",21),l(18,"span",22),d(19,"Edit"),r()()()()),i&2){let a=n.$implicit,t=n.index,e=h(3);s(1),c("ngIf",t==0),s(1),c("ngIf",t==0),s(3),c("href",a.Url,S)("title",a.Title),s(1),c("src",e.getChannelLogo(a.TypeID),S),s(1),c("matTooltip",(a==null||a.Name==null?null:a.Name.length)>55?a==null?null:a.Name:""),s(1),T(" ",a.Name," "),s(2),y(J(11,12,a.Price)),s(3),y(J(14,14,a.Inventory)),s(3),c("href",e.getHyperlinkSellerCenter(a),S)("ngClass",le(16,xe,a.TypeID==e.channelType.KalCare))("matTooltip",a.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function De(i,n){if(i&1&&u(0,Oe,20,18,"tr",8),i&2){let a=h().$implicit;c("ngForOf",a==null?null:a.Channel)}}function Ee(i,n){if(i&1&&(I(0),u(1,Me,9,2,"ng-container",9)(2,De,1,1,"ng-template",null,10,N),M()),i&2){let a=n.$implicit,t=L(3);s(1),c("ngIf",!a.Channel||a.Channel.length<1)("ngIfElse",t)}}var Re=(()=>{let n=class n{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=m,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new D,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return B.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case m.ShopeeV2:e=`${b.Shoope}/portal/product/${t.ChannelItemID}`;break;case m.Tiktok:e=`${b.Tiktok}/product/edit/${t.ChannelItemID}`;break;case m.Tokopedia:e=`${b.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case m.WooCommerce:e=`${b.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case m.Lazada:e=`${b.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};n.\u0275fac=function(e){return new(e||n)(f(O),f(x))},n.\u0275cmp=_({type:n,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(l(0,"modal-material",0),g("onCancel",function(){return o.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),d(6," VARIANT "),l(7,"sup"),C(8,"i",5),r()(),l(9,"th",4),d(10,"SKU"),r(),l(11,"th",4),d(12," PRODUCT "),l(13,"sup"),C(14,"i",6),r()(),l(15,"th",4),d(16,"PRICE"),r(),l(17,"th",7),d(18,"INVENTORY"),r(),C(19,"th",4),r()(),l(20,"tbody"),u(21,Ee,4,2,"ng-container",8),r()()()()),e&2&&(c("config",o.modalConfig),s(21),c("ngForOf",o.variants))},dependencies:[re,v,A,j,E,se],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let i=n;return i})();var R=class{constructor(){this._input$=new w,this._destroy$=new w,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(ee(200),te(),X(n=>(n&&(n=n.toLowerCase()),this.filterData(n))),Z(n=>n!==void 0),P(this._destroy$)).subscribe(n=>{this._dataBuffer=n.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(n){let a=-1,t;return this._data.filter(o=>(t=JSON.stringify(o).toLowerCase(),a=t.indexOf(n),a!==-1||n==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(n){this._data=n||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(n,a){if(B.IsNotEmpty(n)){let t=this._data.filter(e=>e[a].toString().toLowerCase().indexOf(n)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(n){this._bufferSize=n}onScrollToEnd(){this.fetchMore()}fetchMore(){let n=this._dataBuffer.length,a=this._data.slice(n,this._bufferSize+n);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(a)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var be=(()=>{let n=class n{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.width="100%",this.clearable=!0,this.disabled=!1,this.ngSelectInfiniteScroll=new R,this.selectedChange=new H,this.selectedLabel=new H}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=_({type:n,selectors:[["ng-select-infinite"]],inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel"},decls:1,vars:12,consts:[[3,"disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable","appendTo","clear","scrollToEnd","change"]],template:function(e,o){e&1&&(l(0,"ng-select",0),g("clear",function(){return o.ngSelectInfiniteScroll.onClear()})("scrollToEnd",function(){return o.ngSelectInfiniteScroll.onScrollToEnd()})("change",function(k){return o.onSelectChange(k)}),r()),e&2&&(oe("width",o.width),c("disabled",o.disabled)("virtualScroll",!0)("typeahead",o.ngSelectInfiniteScroll.input$)("items",o.ngSelectInfiniteScroll.bufferData)("bindLabel",o.bindLabel)("bindValue",o.bindValue)("placeholder",o.placeholder)("ngModel",o.selected)("clearable",o.clearable)("appendTo",o.parent))},dependencies:[fe,F,U]});let i=n;return i})(),ot=(()=>{let n=class n{};n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=ae({type:n}),n.\u0275inj=ie({imports:[ce,ge,he]});let i=n;return i})();var Se=(()=>{let n=class n{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(W(o=>o!=null?Q(o):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let o={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",o).pipe(W(p=>this.LocalData.saveCategoriesByChannelType(p,t)))}};n.\u0275fac=function(e){return new(e||n)(K(ue),K(pe))},n.\u0275prov=ne({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();function Ve(i,n){if(i&1){let a=Y();I(0),l(1,"ng-select-infinite",16),g("selectedChange",function(e){V(a);let o=h().index,p=h();return $(p.onSelectCategory(e,o))}),r(),M()}if(i&2){let a=h().$implicit;s(1),c("items",a.Categories)("clearable",!1)}}function $e(i,n){if(i&1&&(l(0,"div",17),C(1,"input",18),r()),i&2){let a=h().$implicit,t=h();c("matTooltip",t.channelType.WooCommerce==a.TypeID?"":"Product Category is Harcoded, Please Change Product Category in Seller Center"),s(1),c("placeholder",t.getChannelCategory(a.TypeID))}}function Le(i,n){if(i&1){let a=Y();I(0),l(1,"tr")(2,"td",9)(3,"input",10),g("ngModelChange",function(e){let p=V(a).$implicit;return $(p.Selected=e)})("ngModelChange",function(){V(a);let e=h();return $(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",11),C(6,"img",12),l(7,"span",13),d(8),r()()(),l(9,"td"),u(10,Ve,2,2,"ng-container",14)(11,$e,2,2,"ng-template",null,15,N),r()(),M()}if(i&2){let a=n.$implicit,t=L(12);s(3),c("ngModel",a.Selected),s(3),c("src",a.Img,S),s(2),y(a.Name),s(2),c("ngIf",a.Categories.length>0)("ngIfElse",t)}}var ft=(()=>{let n=class n{constructor(t,e,o,p){this.data=t,this.channelService=e,this.dialogRef=o,this.toastrService=p,this.channelOptions=[],this.uploadResponse=[],this.channelType=m,this.enableBtnOk=!1,this.destroy$=new w,this.uploadResponse=[],this.channels=this.data.channels,this.product=t.product}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new D,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(P(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(e.channelType,o)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==t&&(o.Categories=e),o))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case m.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,o,p)=>p.findIndex(k=>e.channelType==k.channelType)==o).filter(e=>e.channelType==m.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close("CANCEL")}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==m.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case m.ShopeeV2:e="Aksesoris Fashion";break;case m.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case m.WooCommerce:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;case m.Lazada:e="Fashion Accessories / Women Accessories / Others";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};n.\u0275fac=function(e){return new(e||n)(f(O),f(Se),f(x),f(de))},n.\u0275cmp=_({type:n,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"d-flex","align-items-center"],["alt","",1,"channel-logo-size",3,"src"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["EMPTY",""],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"items","clearable","selectedChange"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,o){e&1&&(l(0,"modal-material",0),g("onOk",function(){return o.onSave()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3)(6,"input",4),g("change",function(k){return o.onSelectAllChannel(k.target.checked)}),r()(),l(7,"th",5)(8,"span",6),d(9,"CHANNEL"),r()(),l(10,"th",7)(11,"span",6),d(12,"CATEGORY"),r()()()(),l(13,"tbody"),u(14,Le,13,5,"ng-container",8),r()()()()),e&2&&(c("dynamicValidated",o.enableBtnOk)("config",o.modalConfig),s(14),c("ngForOf",o.channelOptions))},dependencies:[v,A,me,F,U,j,E,be],styles:[`input[type=checkbox]{width:15px;height:15px}img.channel-logo-size{width:24px;height:24px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
|
|
2
|
-
`],encapsulation:2});let i=n;return i})();function Ne(i,n){if(i&1&&(l(0,"tr")(1,"td"),d(2),r(),l(3,"td"),d(4),r()()),i&2){let a=n.$implicit;s(2),y(a==null?null:a.Name),s(2),y(a==null?null:a.ChannelVariationSKU)}}var _t=(()=>{let n=class n{constructor(t,e){this.data=t,this.dialogRef=e}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new D,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}};n.\u0275fac=function(e){return new(e||n)(f(O),f(x))},n.\u0275cmp=_({type:n,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(e,o){e&1&&(l(0,"modal-material",0),g("onCancel",function(){return o.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th"),d(6,"Variant"),r(),l(7,"th"),d(8,"SKU"),r()()(),l(9,"tbody"),u(10,Ne,5,2,"tr",4),r()()()()),e&2&&(c("config",o.modalConfig),s(10),c("ngForOf",o.data.variants))},dependencies:[v,E],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]});let i=n;return i})();export{Re as a,ot as b,ft as c,_t as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as q,I as B,_ as I,aa as M,b as g,ba as v,c as y,ea as k,ec as P,fc as E,m,r as C,ta as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-QMFPH7XZ.js";import{h as b}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-T6GUYLRX.js";function f(a,u,e,o){return new Promise((t,r)=>{a||r("IndexedDB not available");let n=a.open(u,e),i;n.onsuccess=c=>{i=n.result,t(i)},n.onerror=c=>{r(`IndexedDB error: ${n.error}`)},typeof o=="function"&&(n.onupgradeneeded=c=>{o(c,i)})})}function A(a,u,e,o,t){if(!a)return;let r=a.open(u,e);r.onupgradeneeded=n=>{let i=n.target.result;o.forEach(s=>{if(!i.objectStoreNames.contains(s.store)){let h=i.createObjectStore(s.store,s.storeConfig);s.storeSchema.forEach(d=>{h.createIndex(d.name,d.keypath,d.options)})}});let c=t&&t();c&&Object.keys(c).map(s=>parseInt(s,10)).filter(s=>s>n.oldVersion).sort((s,h)=>s-h).forEach(s=>{c[s](i,r.transaction)}),i.close()},r.onsuccess=n=>{n.target.result.close()}}function R(a,u,e){if(!a||!u||!e)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(o=>{try{let t=u+1,r=indexedDB.open(a,t);r.onupgradeneeded=n=>{let i=n.target.result;i.deleteObjectStore(e),i.close(),console.log("onupgradeneeded"),o.next(!0),o.complete()},r.onerror=n=>o.error(n)}catch(t){o.error(t)}})}function V(a,u){return a.objectStoreNames.contains(u)}function S(a,u,e){a||e("You need to use the openDatabase function to create a database before you query it!"),V(a,u)||e(`objectStore does not exists: ${u}`)}function p(a,u){let e=a.transaction(u.storeName,u.dbMode);return e.onerror=u.error,e.onabort=u.abort,e}function j(a,u,e,o){return{storeName:u,dbMode:a,error:t=>{e(t)},abort:t=>{e(t)}}}var x=function(a){return a.readonly="readonly",a.readwrite="readwrite",a}(x||{}),K=new M(null),_=(()=>{class a{constructor(e,o){if(this.dbConfig=e,this.platformId=o,!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!e.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=E(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,A(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),f(this.indexedDB,e.name).then(t=>{t.version!==e.version&&(this.dbConfig.version=t.version)}))}createObjectStore(e,o){let t=[e];A(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,t,o)}add(e,o,t){return new g(r=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{let c=p(n,j(x.readwrite,e,h=>r.error(h))).objectStore(e),s=t?c.add(o,t):c.add(o);s.onsuccess=h=>b(this,null,function*(){let d=h.target.result,l=c.get(d);l.onsuccess=w=>{r.next(w.target.result),r.complete()}})}).catch(n=>r.error(n))})}bulkAdd(e,o){let t=new Promise((r,n)=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let s=p(i,j(x.readwrite,e,r,n)).objectStore(e),h=o.map(d=>new Promise((l,w)=>{let D=d.key;delete d.key;let $=D?s.add(d,D):s.add(d);$.onsuccess=T=>{let F=T.target.result;l(F)}}));r(Promise.all(h))}).catch(i=>n(i))});return m(t)}bulkDelete(e,o){let t=o.map(r=>new Promise((n,i)=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(c=>{let s=p(c,j(x.readwrite,e,i,n));s.objectStore(e).delete(r),s.oncomplete=()=>{this.getAll(e).pipe(B(1)).subscribe(d=>{n(d)})}}).catch(c=>i(c))}));return m(Promise.all(t))}getByKey(e,o){return new g(t=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{let c=p(r,j(x.readonly,e,t.error)).objectStore(e).get(o);c.onsuccess=s=>{t.next(s.target.result),t.complete()},c.onerror=s=>{t.error(s)}}).catch(r=>t.error(r))})}bulkGet(e,o){let t=o.map(r=>this.getByKey(e,r));return new g(r=>{C(t).subscribe(n=>{r.next(n),r.complete()})})}getByID(e,o){return new g(t=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{S(r,e,s=>t.error(s));let c=p(r,j(x.readonly,e,t.error,t.next)).objectStore(e).get(o);c.onsuccess=s=>{t.next(s.target.result)}}).catch(r=>t.error(r))})}getByIndex(e,o,t){return new g(r=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{S(n,e,d=>r.error(d));let h=p(n,j(x.readonly,e,r.error)).objectStore(e).index(o).get(t);h.onsuccess=d=>{r.next(d.target.result),r.complete()}}).catch(n=>r.error(n))})}getAll(e){return new g(o=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(t=>{S(t,e,c=>o.error(c));let i=p(t,j(x.readonly,e,o.error,o.next)).objectStore(e).getAll();i.onerror=c=>{o.error(c)},i.onsuccess=({target:{result:c}})=>{o.next(c),o.complete()}}).catch(t=>o.error(t))})}update(e,o){return new g(t=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{S(r,e,s=>t.error(s));let i=p(r,j(x.readwrite,e,s=>t.error(s))).objectStore(e),c=i.put(o);c.onsuccess=s=>b(this,null,function*(){let h=s.target.result,d=i.get(h);d.onsuccess=l=>{t.next(l.target.result),t.complete()}})}).catch(r=>t.error(r))})}delete(e,o){return new g(t=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{S(r,e,c=>t.error(c));let n=p(r,j(x.readwrite,e,c=>t.error(c)));n.objectStore(e).delete(o),n.oncomplete=()=>{this.getAll(e).pipe(B(1)).subscribe(c=>{t.next(c),t.complete()})}}).catch(r=>t.error(r))})}deleteByKey(e,o){return new g(t=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{S(r,e,c=>t.error(c));let n=p(r,j(x.readwrite,e,c=>t.error(c))),i=n.objectStore(e);n.oncomplete=()=>{t.next(!0),t.complete()},i.delete(o)}).catch(r=>t.error(r))})}clear(e){return new g(o=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(t=>{S(t,e,i=>o.error(i));let r=p(t,j(x.readwrite,e,i=>o.error(i)));r.objectStore(e).clear(),r.oncomplete=()=>{o.next(!0),o.complete()}}).catch(t=>o.error(t))})}deleteDatabase(){return new g(e=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>b(this,null,function*(){yield o.close();let t=this.indexedDB.deleteDatabase(this.dbConfig.name);t.onsuccess=()=>{e.next(!0),e.complete()},t.onerror=r=>e.error(r),t.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(o=>e.error(o))})}openCursor(e,o){return new g(t=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{S(r,e,s=>t.error(s));let i=p(r,j(x.readonly,e,t.error)).objectStore(e),c=o===void 0?i.openCursor():i.openCursor(o);c.onsuccess=s=>{t.next(s),t.complete()}}).catch(r=>t.error(r))})}openCursorByIndex(e,o,t,r=x.readonly){let n=new y;return f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{S(i,e,l=>{n.error(l)});let d=p(i,j(r,e,l=>{n.error(l)},()=>{n.next()})).objectStore(e).index(o).openCursor(t);d.onsuccess=l=>{n.next(l)}}).catch(i=>n.error(i)),n}getAllByIndex(e,o,t){let r=[];return new g(n=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{S(i,e,l=>n.error(l));let d=p(i,j(x.readonly,e,n.error)).objectStore(e).index(o).openCursor(t);d.onsuccess=l=>{let w=l.target.result;w?(r.push(w.value),w.continue()):(n.next(r),n.complete())}}).catch(i=>n.error(i))})}getAllKeysByIndex(e,o,t){let r=[];return new g(n=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{S(i,e,l=>n.error(l));let d=p(i,j(x.readonly,e,n.error)).objectStore(e).index(o).openKeyCursor(t);d.onsuccess=l=>{let w=l.target.result;w?(r.push({primaryKey:w.primaryKey,key:w.key}),w.continue()):(n.next(r),n.complete())}}).catch(i=>n.error(i))})}count(e,o){return new g(t=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{S(r,e,s=>t.error(s));let c=p(r,j(x.readonly,e,t.error)).objectStore(e).count(o);c.onerror=s=>t.error(s),c.onsuccess=s=>{t.next(s.target.result),t.complete()}}).catch(r=>t.error(r))})}countByIndex(e,o,t){return new g(r=>{f(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{S(n,e,d=>r.error(d));let h=p(n,j(x.readonly,e,r.error)).objectStore(e).index(o).count(t);h.onerror=d=>r.error(d),h.onsuccess=d=>{r.next(d.target.result),r.complete()}}).catch(n=>r.error(n))})}deleteObjectStore(e){return R(this.dbConfig.name,++this.dbConfig.version,e)}}return a.\u0275fac=function(e){return new(e||a)(v(K),v(O))},a.\u0275prov=I({token:a,factory:a.\u0275fac}),a})(),W=(()=>{class a{static forRoot(e){return{ngModule:a,providers:[_,{provide:K,useValue:e}]}}}return a.\u0275fac=function(e){return new(e||a)},a.\u0275mod=k({type:a}),a.\u0275inj=q({imports:[[P]]}),a})();export{_ as a,W as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as U}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-SUBRCXIB.js";import{a as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-3S4B7FJG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-3H6SWWM2.js";import{a as G,b as ze}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-266DSHGO.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-BNL5KXTW.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-6ORFYERF.js";import{a as He,b as qe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-QS23P4G5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-KTTSCH5B.js";import{e as E}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-A6HOOHGI.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-NVLJ23H4.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-CMHF5RTN.js";import{a as ie,c as ne,d as Ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-EV36IP6L.js";import{a as N}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-FVAPOGDC.js";import{t as Be,u as je,v as I,w as Ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-D7MTVAUX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-IKMQT2F2.js";import{c as Q,h as X,k as ee,m as te,p as Re,q as Pe,u as ke,v as Fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-KSOIRHFB.js";import{c as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-GWMLSBG4.js";import{$ as re,$a as A,Bb as v,Cb as P,Db as x,Ea as p,Fa as h,Fc as F,Gc as Le,Ia as Ie,Ic as M,Ja as Te,Kb as q,Kc as he,Na as m,P as xe,Qa as De,Ta as f,Ub as we,W as se,Wb as Ne,Ya as e,Yb as k,Za as t,Zb as T,_ as oe,_a as C,aa as be,ab as B,ac as ge,ba as ce,bc as b,cb as R,cc as le,da as y,dc as Oe,ea as ae,ec as ue,fa as Ee,gb as u,ia as O,ib as _,ja as L,lb as Me,nb as H,ob as a,pb as c,q as me,qb as S,ub as Z,vb as j,ya as w}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-QMFPH7XZ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-T6GUYLRX.js";var Ge=(()=>{let i=class i{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Sync Inventory",Url:"/menu/log/inventory"},{Title:"Async Inventory ",Url:"/menu/log/inventory-async"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Download Order ",Url:"/menu/log/order-log"}]}ngOnInit(){}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=y({type:i,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(r,n){r&1&&(e(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),t()()(),C(4,"router-outlet")),r&2&&(p(3),m("Tabs",n.ObjectlogTabs))},dependencies:[Le,He]});let o=i;return o})();var $=(()=>{let i=class i{constructor(){}get Data(){return this._Data}set Data(d){this._Data=d}Fill(d){return this._Data.find(r=>r._id==d)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})();function at(o,i){if(o&1&&(e(0,"span",18),C(1,"img",19),t(),a(2)),o&2){let l=i.item;p(1),m("src",l.logo,w),p(1),S(" ",l.Name," ")}}function lt(o,i){o&1&&(e(0,"th",23)(1,"span",28),a(2," Response Body Warning "),t()())}var dt=o=>({"bg-warning":o});function pt(o,i){if(o&1&&(e(0,"td",23)(1,"span",31),a(2),t()()),o&2){let l=_().$implicit;p(1),m("ngClass",j(2,dt,l.responseBodyWarning!=null)),p(1),c(l.responseBodyWarning)}}var mt=()=>["/menu/log/order/detail"],st=o=>({ID:o});function ct(o,i){if(o&1&&(e(0,"tr")(1,"td")(2,"a",29),a(3),v(4,"date"),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td"),a(10),t(),e(11,"td",23)(12,"span",30),a(13),t()(),f(14,pt,3,4,"td",25),t()),o&2){let l=i.$implicit,d=_(2);p(2),m("routerLink",Z(13,mt))("queryParams",j(14,st,l.ID)),p(1),S(" ",x(4,10,l.Created,"dd MMM yyyy HH:mm:ss")," "),p(3),c(l.MarketTypeString),p(2),c(l.POSActionTypeString),p(2),c(l.Number),p(2),De(l.ResponseCode===200||l.ResponseCode===202?"bg-success":"bg-warning"),p(1),S(" ",l.ResponseCode," "),p(1),m("ngIf",d.responseBodyWarningVisible)}}function gt(o,i){if(o&1){let l=R();A(0),e(1,"div",20)(2,"table",21)(3,"thead")(4,"tr",22)(5,"th"),a(6,"Date"),t(),e(7,"th"),a(8,"Channel"),t(),e(9,"th"),a(10,"Actions"),t(),e(11,"th"),a(12,"Number"),t(),e(13,"th",23)(14,"span",24),a(15," Response Code "),t()(),f(16,lt,3,0,"th",25),t()(),e(17,"tbody"),f(18,ct,15,16,"tr",26),t()(),e(19,"mat-paginator",27),u("page",function(r){O(l);let n=_();return L(n.changePage(r))}),t()(),B()}if(o&2){let l=_();p(16),m("ngIf",l.responseBodyWarningVisible),p(2),m("ngForOf",l.Result),p(1),m("length",l.paginationTotal)("pageSize",l.paginationPageSize)("pageIndex",(l.filter==null?null:l.filter.PageNumber)==0?0:(l.filter==null?null:l.filter.PageNumber)-1)}}function ut(o,i){o&1&&(e(0,"div",32),C(1,"app-empty-state"),t())}var Ue=(()=>{let i=class i{constructor(d,r,n){this.http=d,this._RawLogService=r,this.route=n,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""},this.responseBodyWarningVisible=!1}ngOnInit(){this.route.queryParams.subscribe(d=>{this.responseCode=d.responseCode,this.responseCode!=null?this.Load(d):this.Load()})}Load(d={}){this.http.post("/api/OrdersLoader/Get",d).subscribe(r=>{this.filter=r.Filter,this.Channel=V.assignChannelLogo(r.Options.Channel),this.ActionTypeList=r.Options.ActionTypeList,this.Get()})}Get(d){this.filter.Number=d,this.http.post("/api/Orders/Get",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let n of r.hits){n._source.log.responseBodyWarning!=null&&(this.responseBodyWarningVisible=!0);let g={ID:n._id,Created:n._source["@timestamp_received"],shopId:n._source.shopId,MarketTypeString:n._source.log.type,POSActionTypeString:n._source.message,Number:n._source.log.number,ResponseCode:n._source.log.responseCode,responseBodyWarning:n._source.log.responseBodyWarning};this.Result.push(g)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(d){this.filter.PageNumber=d.pageIndex+1,this.Get()}};i.\u0275fac=function(r){return new(r||i)(h(E),h($),h(F))},i.\u0275cmp=y({type:i,selectors:[["app-order"]],decls:42,vars:15,consts:[["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","text","name","StatusCode",1,"w-100",3,"ngModel","ngModelChange"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100",3,"ngModel","ngModelChange"],["id","listresponseBodyWarning"],["value","number-override"],["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"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],["class","text-center",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"],[1,"text-white","p-2","rounded","response-desc",3,"ngClass"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,n){if(r&1&&(e(0,"mainpanel",0),u("textChange",function(s){return n.Number=s})("onSubmit",function(s){return n.Get(s)}),e(1,"filters")(2,"div",1)(3,"div")(4,"h6"),a(5,"Channel"),t(),e(6,"ng-select",2),u("ngModelChange",function(s){return n.filter.ChannelID=s}),f(7,at,3,2,"ng-template",3),t()(),e(8,"div")(9,"h6"),a(10,"Action"),t(),e(11,"ng-select",4),u("ngModelChange",function(s){return n.filter.ActionType=s}),t()(),e(12,"div")(13,"h6"),a(14,"From/To"),t(),e(15,"datepicker",5),u("dateChange",function(s){return n.filter.From=s}),t(),e(16,"datepicker",6),u("dateChange",function(s){return n.filter.To=s}),t()(),e(17,"div")(18,"h6"),a(19,"Response Code"),t(),e(20,"input",7),u("ngModelChange",function(s){return n.filter.StatusCode=s}),t()(),e(21,"div")(22,"h6"),a(23,"Response Body Warning"),t(),e(24,"input",8),u("ngModelChange",function(s){return n.filter.responseBodyWarning=s}),t(),e(25,"datalist",9),C(26,"option",10),t()(),e(27,"div")(28,"h6"),a(29,"Page Number"),t(),e(30,"input",11),u("ngModelChange",function(s){return n.filter.PageNumber=s}),t()(),e(31,"div")(32,"h6"),a(33,"Page Size"),t(),e(34,"input",12),u("ngModelChange",function(s){return n.filter.RowCount=s}),t()()()(),e(35,"content")(36,"div",13)(37,"div",14)(38,"div",15),f(39,gt,20,5,"ng-container",16)(40,ut,2,0,"ng-template",null,17,q),t()()()()()),r&2){let g=H(41);m("text",n.Number),p(6),m("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),p(5),m("clearable",!0)("items",n.ActionTypeList)("ngModel",n.filter.ActionType),p(4),m("date",n.filter.From),p(1),m("date",n.filter.To),p(4),m("ngModel",n.filter.StatusCode),p(4),m("ngModel",n.filter.responseBodyWarning),p(6),m("ngModel",n.filter.PageNumber),p(4),m("ngModel",n.filter.RowCount),p(5),m("ngIf",(n.Result==null?null:n.Result.length)>0)("ngIfElse",g)}},dependencies:[Ne,k,T,Re,Pe,Q,te,X,ee,M,I,G,ne,ie,U,z,Be,b]});let o=i;return o})();function ht(o,i){if(o&1&&(e(0,"span",13),C(1,"img",14),t(),a(2)),o&2){let l=i.item;p(1),m("src",l.logo,w),p(1),S(" ",l.Name," ")}}var ft=()=>["/menu/log/inventory/detail"],vt=o=>({ID:o});function _t(o,i){if(o&1&&(e(0,"tr")(1,"td")(2,"a",20),a(3),v(4,"date"),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td"),a(10),t(),e(11,"td"),a(12),t()()),o&2){let l=i.$implicit;p(2),m("routerLink",Z(10,ft))("queryParams",j(11,vt,l.ID)),p(1),S(" ",x(4,7,l.Created,"dd MMM yyyy HH:mm")," "),p(3),c(l.channelName),p(2),c(l.Sku),p(2),c(l.Stock),p(2),c(l.ResponseCode)}}function Ct(o,i){if(o&1){let l=R();A(0),e(1,"div",15)(2,"table",16)(3,"thead")(4,"tr",17)(5,"th"),a(6,"Created"),t(),e(7,"th"),a(8,"Channel"),t(),e(9,"th"),a(10,"SKU"),t(),e(11,"th"),a(12,"Stock"),t(),e(13,"th"),a(14,"Response code"),t()()(),e(15,"tbody"),f(16,_t,13,13,"tr",18),t()(),e(17,"mat-paginator",19),u("page",function(r){O(l);let n=_();return L(n.changePage(r))}),t()(),B()}if(o&2){let l=_();p(16),m("ngForOf",l.Result),p(1),m("length",l.paginationTotal)("pageSize",l.paginationPageSize)("pageIndex",(l.filter==null?null:l.filter.PageNumber)==0?0:(l.filter==null?null:l.filter.PageNumber)-1)}}function St(o,i){o&1&&(e(0,"div",21),C(1,"app-empty-state"),t())}var We=(()=>{let i=class i{constructor(d,r){this.http=d,this._RawLogService=r,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(d=>{this.filter=d.Filter,this.Channel=V.assignChannelLogo(d.Options.Channel),this.ActionTypeList=d.Options.ActionTypeList,this.Get()})}Get(d){d!=null&&(this.filter.Sku=d),this.http.post("api/Inventory/GetLog",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let n of r.hits){let g={ID:n._source.log.id,Created:n._source["@timestamp_received"],channelName:n._source.log.channelName,Sku:n._source.log.sku,Stock:n._source.log.stock,ResponseCode:n._source.log.responseCode};this.Result.push(g)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(d){this.filter.PageNumber=d.pageIndex+1,this.Get()}};i.\u0275fac=function(r){return new(r||i)(h(E),h($))},i.\u0275cmp=y({type:i,selectors:[["app-inventory-log"]],decls:28,vars:10,consts:[["headerTitle","Inventory Log","searchBoxPlaceHolder","Enter SKU...",3,"text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,n){if(r&1&&(e(0,"mainpanel",0),u("textChange",function(s){return n.filter.Sku=s})("onSubmit",function(s){return n.Get(s)}),e(1,"filters")(2,"div",1)(3,"div")(4,"h6"),a(5,"Channel"),t(),e(6,"ng-select",2),u("ngModelChange",function(s){return n.filter.ChannelID=s}),f(7,ht,3,2,"ng-template",3),t()(),e(8,"div")(9,"h6"),a(10,"From/To"),t(),e(11,"datepicker",4),u("dateChange",function(s){return n.filter.From=s}),t(),e(12,"datepicker",5),u("dateChange",function(s){return n.filter.To=s}),t()(),e(13,"div")(14,"h6"),a(15,"Page Number"),t(),e(16,"input",6),u("ngModelChange",function(s){return n.filter.PageNumber=s}),t()(),e(17,"div")(18,"h6"),a(19,"Page Size"),t(),e(20,"input",7),u("ngModelChange",function(s){return n.filter.RowCount=s}),t()()()(),e(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),f(25,Ct,18,4,"ng-container",11)(26,St,2,0,"ng-template",null,12,q),t()()()()()),r&2){let g=H(27);m("text",n.filter.Sku),p(6),m("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),p(5),m("date",n.filter.From),p(1),m("date",n.filter.To),p(4),m("ngModel",n.filter.PageNumber),p(4),m("ngModel",n.filter.RowCount),p(5),m("ngIf",(n.Result==null?null:n.Result.length)>0)("ngIfElse",g)}},dependencies:[k,T,Q,te,X,ee,M,I,G,ne,ie,U,z,b]});let o=i;return o})();function yt(o,i){if(o&1&&(e(0,"span",13),C(1,"img",14),t(),a(2)),o&2){let l=i.item;p(1),m("src",l.logo,w),p(1),S(" ",l.Name," ")}}var xt=()=>["/menu/log/order/detail"],bt=o=>({ID:o});function Et(o,i){if(o&1&&(e(0,"tr")(1,"td")(2,"a",21),a(3),v(4,"date"),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td"),a(10),t()()),o&2){let l=i.$implicit;p(2),m("routerLink",Z(9,xt))("queryParams",j(10,bt,l.id)),p(1),S(" ",x(4,6,l.Created,"dd MMM yyyy HH:mm:ss")," "),p(3),c(l.type),p(2),c(l.number),p(2),c(l.message)}}function It(o,i){if(o&1){let l=R();A(0),e(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr")(5,"th",18),a(6,"Date"),t(),e(7,"th"),a(8,"Type"),t(),e(9,"th"),a(10,"Number"),t(),e(11,"th"),a(12,"Message"),t()()(),e(13,"tbody"),f(14,Et,11,12,"tr",19),t()(),e(15,"mat-paginator",20),u("page",function(r){O(l);let n=_();return L(n.changePage(r))}),t()(),B()}if(o&2){let l=_();p(14),m("ngForOf",l.Result),p(1),m("length",l.paginationTotal)("pageSize",l.paginationPageSize)("pageIndex",(l.filter==null?null:l.filter.PageNumber)==0?0:(l.filter==null?null:l.filter.PageNumber)-1)}}function Tt(o,i){o&1&&(e(0,"div",22),C(1,"app-empty-state"),t())}var $e=(()=>{let i=class i{constructor(d,r){this.http=d,this._RawLogService=r,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}]}ngOnInit(){this.Load()}Load(d={}){this.http.post("/api/OrdersLoader/Get",d).subscribe(r=>{this.filter=r.Filter,this.Channel=V.assignChannelLogo(r.Options.Channel),this.ActionTypeList=r.Options.ActionTypeList,this.Get()})}Get(d){this.filter.Number=d,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let n of r.hits){let g={id:n._id,message:n._source.message,responseCode:n._source.log.responseCode,processTypeString:n._source.log.processType,type:n._source.log.type,number:n._source.log.number,Created:n._source["@timestamp_received"]};this.Result.push(g)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(d){this.filter.PageNumber=d.pageIndex+1,this.Get()}};i.\u0275fac=function(r){return new(r||i)(h(E),h($))},i.\u0275cmp=y({type:i,selectors:[["app-raw-log"]],decls:28,vars:10,consts:[["headerTitle","Channel Webhook Log","searchBoxPlaceHolder","Invoice Number..",3,"text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,n){if(r&1&&(e(0,"mainpanel",0),u("textChange",function(s){return n.filter.Number=s})("onSubmit",function(s){return n.Get(s)}),e(1,"filters")(2,"div",1)(3,"div")(4,"h6"),a(5,"Channel"),t(),e(6,"ng-select",2),u("ngModelChange",function(s){return n.filter.ChannelID=s}),f(7,yt,3,2,"ng-template",3),t()(),e(8,"div")(9,"h6"),a(10,"From/To"),t(),e(11,"datepicker",4),u("dateChange",function(s){return n.filter.From=s}),t(),e(12,"datepicker",5),u("dateChange",function(s){return n.filter.To=s}),t()(),e(13,"div")(14,"h6"),a(15,"Page Number"),t(),e(16,"input",6),u("ngModelChange",function(s){return n.filter.PageNumber=s}),t()(),e(17,"div")(18,"h6"),a(19,"Page Size"),t(),e(20,"input",7),u("ngModelChange",function(s){return n.filter.RowCount=s}),t()()()(),e(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),f(25,It,16,4,"ng-container",11)(26,Tt,2,0,"ng-template",null,12,q),t()()()()()),r&2){let g=H(27);m("text",n.filter.Number),p(6),m("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),p(5),m("date",n.filter.From),p(1),m("date",n.filter.To),p(4),m("ngModel",n.filter.PageNumber),p(4),m("ngModel",n.filter.RowCount),p(5),m("ngIf",(n.Result==null?null:n.Result.length)>0)("ngIfElse",g)}},dependencies:[k,T,Q,te,X,ee,M,I,G,ne,ie,U,z,b]});let o=i;return o})();var ye=class{constructor(i,l){this._document=l;let d=this._textarea=this._document.createElement("textarea"),r=d.style;r.position="fixed",r.top=r.opacity="0",r.left="-999em",d.setAttribute("aria-hidden","true"),d.value=i,d.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(d)}copy(){let i=this._textarea,l=!1;try{if(i){let d=this._document.activeElement;i.select(),i.setSelectionRange(0,i.value.length),l=this._document.execCommand("copy"),d&&d.focus()}}catch{}return l}destroy(){let i=this._textarea;i&&(i.remove(),this._textarea=void 0)}},Dt=(()=>{let i=class i{constructor(d){this._document=d}copy(d){let r=this.beginCopy(d),n=r.copy();return r.destroy(),n}beginCopy(d){return new ye(d,this._document)}};i.\u0275fac=function(r){return new(r||i)(ce(we))},i.\u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})(),Mt=new be("CDK_COPY_TO_CLIPBOARD_CONFIG"),Je=(()=>{let i=class i{constructor(d,r,n){this._clipboard=d,this._ngZone=r,this.text="",this.attempts=1,this.copied=new Ie,this._pending=new Set,n&&n.attempts!=null&&(this.attempts=n.attempts)}copy(d=this.attempts){if(d>1){let r=d,n=this._clipboard.beginCopy(this.text);this._pending.add(n);let g=()=>{let s=n.copy();!s&&--r&&!this._destroyed?this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(g,1)):(this._currentTimeout=null,this._pending.delete(n),n.destroy(),this.copied.emit(s))};g()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(d=>d.destroy()),this._pending.clear(),this._destroyed=!0}};i.\u0275fac=function(r){return new(r||i)(h(Dt),h(Te),h(Mt,8))},i.\u0275dir=Ee({type:i,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(r,n){r&1&&u("click",function(){return n.copy()})},inputs:{text:["cdkCopyToClipboard","text"],attempts:["cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"}});let o=i;return o})(),Ke=(()=>{let i=class i{};i.\u0275fac=function(r){return new(r||i)},i.\u0275mod=ae({type:i}),i.\u0275inj=re({});let o=i;return o})();function Nt(o,i){o&1&&C(0,"img",21)}function Ot(o,i){o&1&&C(0,"img",22)}function Lt(o,i){if(o&1&&(e(0,"div",4)(1,"div",5)(2,"div",6)(3,"h5"),a(4,"General"),t()(),e(5,"div",7)(6,"div",2)(7,"div",8)(8,"div",9)(9,"label"),a(10,"Date"),t(),e(11,"div")(12,"span"),a(13),v(14,"date"),t()()()(),e(15,"div",10)(16,"div",9)(17,"label"),a(18,"Market Place Type"),t(),f(19,Nt,1,0,"img",11)(20,Ot,1,0,"img",12),e(21,"a",13)(22,"span",14),a(23),t(),C(24,"br"),e(25,"small",15),a(26),t()()()(),e(27,"div",10)(28,"div",9)(29,"label"),a(30,"Number"),t(),e(31,"div")(32,"span"),a(33),t()()()(),e(34,"div",8)(35,"div",9)(36,"label"),a(37,"Process Type"),t(),e(38,"div")(39,"span"),a(40),t()()()(),e(41,"div",4)(42,"div",9)(43,"label"),a(44,"Authorization Header"),t(),e(45,"div")(46,"span"),a(47),t()()()(),e(48,"div",16)(49,"div",5)(50,"div",17)(51,"div",18)(52,"h3"),a(53,"Request"),t()(),e(54,"div",19)(55,"button",20),a(56,"Copy to clipboard"),t()()(),e(57,"div",7),a(58),t()()()()()()()),o&2){let l=_();p(13),c(x(14,11,l.data.Created,"dd MMM yyyy HH:mm:ss")),p(6),m("ngIf",l.data.TypeID==1),p(1),m("ngIf",l.data.TypeID==0),p(1),Me("href",l.data.ShopLink,w),p(2),c(l.data.ShopName),p(3),c(l.data.ShopLink),p(7),c(l.data._source.log.number),p(7),c(l.data._source.log.processType),p(7),c(l.data._source.log.authorizationHeader),p(8),m("cdkCopyToClipboard",l.data._source.log.request),p(3),S(" ",l.data._source.log.request," ")}}var Ye=(()=>{let i=class i{constructor(d,r,n){this.route=d,this.http=r,this._RawLogService=n,this.route.queryParams.subscribe(g=>{let s=JSON.parse(localStorage.getItem("channel"));if(this.ID=g.ID,this.data=this._RawLogService.Fill(this.ID),this.data.Created=this.data._source["@timestamp_received"],s.length>0){let pe=s.find(rt=>rt.ShopID==this.data._source.shopId);pe?(this.data.TypeID=pe.TypeID,this.data.ShopName=pe.Name,this.data.ShopLink=pe.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}};i.\u0275fac=function(r){return new(r||i)(h(F),h(E),h($))},i.\u0275cmp=y({type:i,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(r,n){r&1&&(e(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),f(4,Lt,59,14,"div",3),t()()()()),r&2&&(m("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),p(4),m("ngIf",n.data))},dependencies:[T,I,Je,b]});let o=i;return o})();function Rt(o,i){if(o&1&&(e(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),a(4,"General"),t()(),e(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),a(10,"Date"),t(),e(11,"div")(12,"span"),a(13),v(14,"date"),t()()()(),e(15,"div",6)(16,"div",12)(17,"label"),a(18,"SKU"),t(),e(19,"div")(20,"span"),a(21),t()()()(),e(22,"div",6)(23,"div",12)(24,"label"),a(25,"Channel"),t(),e(26,"div")(27,"span"),a(28),t()()()(),e(29,"div",6)(30,"div",12)(31,"label"),a(32,"Response Code"),t(),e(33,"div")(34,"span"),a(35),t()()()()()()()()),o&2){let l=_();p(13),c(x(14,4,l.data.Created,"dd MMM yyyy")),p(8),c(l.data.Sku),p(7),c(l.data.ChannelName),p(7),c(l.data.ResponseCode)}}var Ze=(()=>{let i=class i{constructor(d,r,n){this.route=d,this.http=r,this._RawLogService=n,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(g=>{this.ID=g.ID,this.Load()})}ngOnInit(){}Load(){var d={ID:this.ID};this.http.post("/api/Inventory/GetInventoryLogDeatil",d).subscribe(r=>{this.data.Created=r.hits[0]._source["@timestamp_received"],this.data.Sku=r.hits[0]._source.log.sku,this.data.ChannelName=r.hits[0]._source.log.channelName,this.data.ResponseCode=r.hits[0]._source.log.responseCode,this.request=JSON.parse(r.hits[0]._source.log.request),this.response=r.hits[0]._source.log.response})}};i.\u0275fac=function(r){return new(r||i)(h(F),h(E),h($))},i.\u0275cmp=y({type:i,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(r,n){r&1&&(e(0,"mainpanel",0)(1,"actions")(2,"a",1),a(3,"Back"),t()(),e(4,"content")(5,"div",2)(6,"div",3),f(7,Rt,36,7,"div",4),t(),e(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),a(13,"Request"),t()(),e(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),a(18),v(19,"json"),t()()()()()(),e(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),a(24,"Response"),t()(),e(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),a(29),t()()()()()()()()()()),r&2&&(m("headerTitle","Inventory Detail")("pageData","Inventory Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),p(7),m("ngIf",n.data),p(11),c(P(19,7,n.request)),p(11),c(n.response))},dependencies:[T,M,I,le,b]});let o=i;return o})();function Pt(o,i){if(o&1&&(e(0,"div",9)(1,"div",10)(2,"label"),a(3,"Process Code"),t(),e(4,"div")(5,"span"),a(6),t()()()()),o&2){let l=_();p(6),c(l.ProcessedCode)}}function kt(o,i){if(o&1){let l=R();e(0,"a",16),u("click",function(){O(l);let r=_();return L(r.Retry())}),a(1,"Retry"),t()}}var Qe=(()=>{let i=class i{constructor(d,r){this.route=d,this.http=r,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(n=>{this.ID=n.ID,this.Load()})}ngOnInit(){}Retry(){var d={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",d).subscribe(r=>{alert(JSON.stringify(r))})}Load(){var d={ID:this.ID};this.http.post("/api/Orders/GetDetail",d).subscribe(r=>{for(let n of r.hits)this.Number=n._source.log.number,this.MarketTypeString=n._source.log.type,this.ResponseCode=n._source.log.responseCode,this.POSActionTypeString=n._source.message,this.ProcessDuration=0,this.Created=n._source["@timestamp_received"],this.request=JSON.parse(n._source.log.request),this.response=JSON.parse(n._source.log.response),this.shopId=n._source.shopId,this.ProcessedCode=n._source.log.processedCode})}};i.\u0275fac=function(r){return new(r||i)(h(F),h(E))},i.\u0275cmp=y({type:i,selectors:[["app-orderdetail"]],decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(r,n){r&1&&(e(0,"mainpanel",0)(1,"actions")(2,"a",1),a(3,"Back"),t()(),e(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),a(11,"General"),t()(),e(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),a(17,"Date"),t(),e(18,"div")(19,"span"),a(20),v(21,"date"),t()()()(),e(22,"div",9)(23,"div",10)(24,"label"),a(25,"Number"),t(),e(26,"div")(27,"span"),a(28),t()()()(),e(29,"div",9)(30,"div",10)(31,"label"),a(32,"Type"),t(),e(33,"div")(34,"span"),a(35),t()()()(),e(36,"div",9)(37,"div",10)(38,"label"),a(39,"Response Code"),t(),e(40,"div")(41,"span"),a(42),t()()()(),e(43,"div",9)(44,"div",10)(45,"label"),a(46,"ShopID"),t(),e(47,"div")(48,"span"),a(49),t()()()(),f(50,Pt,7,1,"div",11),e(51,"div",9)(52,"div",10)(53,"label"),a(54,"Action"),t(),e(55,"div")(56,"span"),a(57),t()()()()()()()()(),e(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),a(63,"Request"),t()(),e(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),a(68),v(69,"json"),t()()(),e(70,"actions",14),f(71,kt,2,0,"a",15),t()()()(),e(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),a(76,"Response"),t()(),e(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),a(81),v(82,"json"),t()()()()()()()()()()),r&2&&(m("headerTitle","Order #"+n.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),p(20),c(x(21,14,n.Created,"dd MMM yyyy HH:mm:ss")),p(8),c(n.Number),p(7),c(n.MarketTypeString),p(7),c(n.ResponseCode),p(7),c(n.shopId),p(1),m("ngIf",n.ProcessedCode!=null),p(7),c(n.POSActionTypeString),p(11),c(P(69,17,n.request)),p(3),m("ngIf",n.ResponseCode!="200"&&n.ResponseCode!="201"),p(10),c(P(82,19,n.response)))},dependencies:[T,M,I,le,b]});let o=i;return o})();var Ft=()=>["/menu/log/exception/detail"],At=o=>({ID:o});function Bt(o,i){if(o&1&&(e(0,"tr")(1,"td",12),C(2,"img",13),t(),e(3,"td"),a(4),v(5,"date"),t(),e(6,"td")(7,"a",14),a(8),t()(),e(9,"td")(10,"div",15),a(11),t(),e(12,"div"),a(13),t()()()),o&2){let l=i.$implicit;p(2),m("src",l.logo,w),p(2),c(x(5,7,l.date,"dd-MM-yyyy hh:mm:ss")),p(3),m("routerLink",Z(10,Ft))("queryParams",j(11,At,l.id)),p(1),S(" ",l.number," "),p(3),c(l.message),p(2),c(l.stackTrace)}}function jt(o,i){if(o&1){let l=R();A(0),e(1,"mat-paginator",16),u("page",function(r){O(l);let n=_(2);return L(n.onPaginationChange(r))}),t(),B()}if(o&2){let l=_(2);p(1),m("length",l.pageTotal)("pageSize",l.pageSize)("pageIndex",(l.filter==null?null:l.filter.PageNumber)==0?0:(l.filter==null?null:l.filter.PageNumber)-1)}}function Vt(o,i){if(o&1&&(A(0),e(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),a(6,"Channel"),t(),e(7,"th",9),a(8,"Date"),t(),e(9,"th"),a(10,"Number"),t(),e(11,"th"),a(12,"Exception"),t()()(),e(13,"tbody"),f(14,Bt,14,13,"tr",10),t()(),f(15,jt,2,3,"ng-container",11),t(),B()),o&2){let l=_();p(14),m("ngForOf",l.exceptions),p(1),m("ngIf",(l.exceptions==null?null:l.exceptions.length)>0)}}function Ht(o,i){o&1&&(e(0,"div",17),C(1,"app-empty-state"),t())}var Xe=(()=>{let i=class i{constructor(d){this.http=d,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(d=>{this.exceptions=d.hits.map(r=>({id:r._id,logo:V.getChannelLogoByName(r._source.error?.Type),number:r._source.error.number,date:r._source["@timestamp_received"],stackTrace:r._source.error.stackTrace,message:r._source.message,requestJSON:r._source?.error?.requestJSON})),this.pageTotal=d.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(d){this.filter.PageNumber=d.pageIndex+1,this.getData()}};i.\u0275fac=function(r){return new(r||i)(h(E))},i.\u0275cmp=y({type:i,selectors:[["app-exception-log"]],decls:8,vars:2,consts:[["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","140px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-center"],[2,"width","25px",3,"src"],[3,"routerLink","queryParams"],[1,"fw-bold"],[3,"length","pageSize","pageIndex","page"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,n){if(r&1&&(e(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),f(5,Vt,16,2,"ng-container",4)(6,Ht,2,0,"ng-template",null,5,q),t()()()()()),r&2){let g=H(7);p(5),m("ngIf",n.exceptions.length>0)("ngIfElse",g)}},dependencies:[k,T,M,I,G,z,b]});let o=i;return o})();function qt(o,i){if(o&1&&(e(0,"span",13),C(1,"img",14),t(),a(2)),o&2){let l=i.item;p(1),m("src",l.logo,w),p(1),S(" ",l.Name," ")}}var zt=o=>({ID:o});function Gt(o,i){if(o&1&&(e(0,"tr")(1,"td"),a(2),t(),e(3,"td"),C(4,"img",24),t(),e(5,"td"),a(6),t(),e(7,"td",25)(8,"a",26),a(9),v(10,"number"),t()(),e(11,"td"),a(12),t(),e(13,"td"),a(14),v(15,"date"),t()()),o&2){let l=i.$implicit;p(2),c(l._source.ChannelName),p(2),m("src",l.logo,w),p(2),c(l._source.DateRange),p(2),m("queryParams",j(12,zt,l._source.ID)),p(1),S(" ",P(10,7,l._source.CountOrder)," "),p(3),c(l._source.UserLogin),p(2),S("",x(15,9,l._source["@timestamp_received"],"dd MMM yyyy hh:mm")," ")}}function Ut(o,i){if(o&1){let l=R();A(0),e(1,"div",15)(2,"table",16)(3,"thead")(4,"tr",17)(5,"th",18),a(6,"Channel"),t(),e(7,"th",19),a(8,"Type"),t(),e(9,"th",20),a(10,"Download Date Range"),t(),e(11,"th",21),a(12,"Count"),t(),e(13,"th"),a(14,"User Login"),t(),e(15,"th"),a(16,"Created"),t()()(),e(17,"tbody"),f(18,Gt,16,14,"tr",22),t()(),e(19,"mat-paginator",23),u("page",function(r){O(l);let n=_();return L(n.onPaginationChange(r))}),t()(),B()}if(o&2){let l=_();p(18),m("ngForOf",l.downloadOrders),p(1),m("length",l.paginationTotal)("pageSize",l.paginationPageSize)("pageIndex",(l.filter==null?null:l.filter.PageNumber)==0?0:(l.filter==null?null:l.filter.PageNumber)-1)}}function Wt(o,i){o&1&&(e(0,"div",27),C(1,"app-empty-state"),t())}var et=(()=>{let i=class i{constructor(d){this.http=d,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(d=>{this.filter=d.Filter,this.channels=V.assignChannelLogo(d.Options.Channel),this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(d=>{this.downloadOrders=d.hits,this.setChannelLogo(),this.paginationTotal=d.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(d=>(d.logo=V.getChannelLogoByTypeId(d._source.TypeID),d))}onPaginationChange(d){this.filter.PageNumber=d.pageIndex+1,this.getDownloadOrders()}};i.\u0275fac=function(r){return new(r||i)(h(E))},i.\u0275cmp=y({type:i,selectors:[["app-manual-order-log"]],decls:28,vars:10,consts:[["headerTitle","Download Order Log",3,"hideSearchBox","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/log/order-log/order-log-detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,n){if(r&1&&(e(0,"mainpanel",0),u("onSubmit",function(){return n.getDownloadOrders()}),e(1,"filters")(2,"div",1)(3,"div")(4,"h6"),a(5,"Channel"),t(),e(6,"ng-select",2),u("ngModelChange",function(s){return n.filter.ChannelID=s}),f(7,qt,3,2,"ng-template",3),t()(),e(8,"div")(9,"h6"),a(10,"From/To"),t(),e(11,"datepicker",4),u("dateChange",function(s){return n.filter.From=s}),t(),e(12,"datepicker",5),u("dateChange",function(s){return n.filter.To=s}),t()(),e(13,"div")(14,"h6"),a(15,"Page Number"),t(),e(16,"input",6),u("ngModelChange",function(s){return n.filter.PageNumber=s}),t()(),e(17,"div")(18,"h6"),a(19,"Page Size"),t(),e(20,"input",7),u("ngModelChange",function(s){return n.filter.RowCount=s}),t()()()(),e(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),f(25,Ut,20,4,"ng-container",11)(26,Wt,2,0,"ng-template",null,12,q),t()()()()()),r&2){let g=H(27);m("hideSearchBox",!0),p(6),m("clearable",!0)("items",n.channels)("ngModel",n.filter.ChannelID),p(5),m("date",n.filter.From),p(1),m("date",n.filter.To),p(4),m("ngModel",n.filter.PageNumber),p(4),m("ngModel",n.filter.RowCount),p(5),m("ngIf",(n.downloadOrders==null?null:n.downloadOrders.length)>0)("ngIfElse",g)}},dependencies:[k,T,Q,te,X,ee,M,I,G,ne,ie,U,z,Oe,b]});let o=i;return o})();var tt=(()=>{let i=class i{constructor(d){this.httpService=d}getExceptionDetail(d){let r="/api/Orders/GetDetailException";return this.httpService.post(r,{ID:d}).pipe(me(n=>n?.hits[0]?._source))}};i.\u0275fac=function(r){return new(r||i)(ce(E))},i.\u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})();function Jt(o,i){if(o&1&&(e(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),a(6,"General"),t()(),e(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),a(12,"Date"),t(),e(13,"div")(14,"span"),a(15),v(16,"date"),t()()()(),e(17,"div",9)(18,"div",10)(19,"label"),a(20,"Number"),t(),e(21,"div")(22,"span"),a(23),t()()()(),e(24,"div",9)(25,"div",10)(26,"label"),a(27,"Type"),t(),e(28,"div")(29,"span"),a(30),t()()()(),e(31,"div",9)(32,"div",10)(33,"label"),a(34,"ShopID"),t(),e(35,"div")(36,"span"),a(37),t()()()()()()()()(),e(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),a(43,"Request"),t()(),e(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),a(48),v(49,"json"),t()()()()()(),e(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),a(54,"Exception"),t()(),e(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),a(59),t(),e(60,"pre"),a(61),t()()()()()()()()),o&2){let l=i.ngIf;p(15),c(x(16,7,l["@timestamp"],"dd MMM yyyy HH:mm:ss")),p(8),c(l==null||l.error==null?null:l.error.number),p(7),c(l==null||l.error==null?null:l.error.Type),p(7),c(l==null?null:l.shopId),p(11),c(P(49,10,l==null||l.error==null?null:l.error.requestJSON)),p(11),c(l==null?null:l.message),p(2),c(l==null||l.error==null?null:l.error.stackTrace)}}var it=(()=>{let i=class i{constructor(d,r){this.activatedRoute=d,this.exceptionService=r,this.invoiceNumber=""}ngOnInit(){let d=this.activatedRoute.snapshot.queryParams;this.getExceptionDetail(d?.ID)}getExceptionDetail(d){this.exceptionDetail$=this.exceptionService.getExceptionDetail(d).pipe(se(r=>{this.invoiceNumber=r?.error?.number}),xe(1))}};i.\u0275fac=function(r){return new(r||i)(h(F),h(tt))},i.\u0275cmp=y({type:i,selectors:[["app-exception-detail"]],decls:4,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-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,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"],[1,"fw-bold"]],template:function(r,n){r&1&&(e(0,"mainpanel",0)(1,"content"),f(2,Jt,62,12,"div",1),v(3,"async"),t()()),r&2&&(m("headerTitle","Order #"+n.invoiceNumber)("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),m("ngIf",P(3,4,n.exceptionDetail$)))},dependencies:[T,I,ge,le,b]});let o=i;return o})();function Kt(o,i){if(o&1&&(e(0,"tr")(1,"td"),a(2),t(),e(3,"td"),a(4),t(),e(5,"td"),a(6),v(7,"date"),t(),e(8,"td"),a(9),v(10,"date"),t(),e(11,"td"),a(12),t()()),o&2){let l=i.$implicit;p(2),S(" ",l.Number," "),p(2),S(" ",l.Status," "),p(2),S(" ",x(7,5,l.Start,"HH:mm:ss:SSS")," "),p(3),S(" ",x(10,8,l.End,"HH:mm:ss:SSS")," "),p(3),S(" ",l.Exception," ")}}var nt=(()=>{let i=class i{constructor(d,r){this.route=d,this.httpService=r}ngOnInit(){this.initOrderDetails()}initOrderDetails(){let d=this.route.snapshot.queryParams;this.orderDetails$=this.httpService.post("/api/Orders/DownloadOrderLogsDetail",{ID:d.ID}).pipe(se(r=>{let n=r?.hits[0]?._source;this.headerTitle=`${n?.ChannelName} (${n?.DateRange})`}),me(r=>r?.hits[0]._source?.Detail))}};i.\u0275fac=function(r){return new(r||i)(h(F),h(E))},i.\u0275cmp=y({type:i,selectors:[["app-download-order-detail"]],decls:22,vars:7,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","200px"],[2,"width","150px"],[2,"width","100px"],[4,"ngFor","ngForOf"]],template:function(r,n){r&1&&(e(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"table",5)(7,"thead")(8,"tr",6)(9,"th",7),a(10,"Number"),t(),e(11,"th",8),a(12,"Status"),t(),e(13,"th",9),a(14,"Start Time"),t(),e(15,"th",9),a(16,"End Time"),t(),e(17,"th"),a(18,"Exception"),t()()(),e(19,"tbody"),f(20,Kt,13,11,"tr",10),v(21,"async"),t()()()()()()()()),r&2&&(m("headerTitle",n.headerTitle)("description",n.headerTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),p(20),m("ngForOf",P(21,5,n.orderDetails$)))},dependencies:[k,I,ge,b]});let o=i;return o})();var Yt=[{path:"",component:Ge,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:Ue,canActivate:[N],data:{title:"Order Log"}},{path:"inventory",component:We,canActivate:[N],data:{title:"Inventory Log"}},{path:"rawlog",component:$e,canActivate:[N],data:{title:"Raw Log"}},{path:"rawlog/detail",component:Ye,canActivate:[N],data:{title:"Raw Log Detail"}},{path:"inventory/detail",component:Ze,canActivate:[N],data:{title:"Inventory Details"}},{path:"order/detail",component:Qe,canActivate:[N],data:{title:"Order Details"}},{path:"exception",component:Xe,canActivate:[N],data:{title:"Exception Log"}},{path:"exception/detail",component:it,canActivate:[N],data:{title:"Exception Log Detail"}},{path:"order-log",component:et,canActivate:[N],data:{title:"order Log"}},{path:"order-log/order-log-detail",component:nt,canActivate:[N],data:{title:"Order Log Detail"}},{path:"inventory-async",loadComponent:()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-G6FQOKR3.js").then(o=>o.InventoryAsyncLogComponent),canActivate:[N],data:{title:"Sync Inventory Async"}},{path:"inventory-async/detail",loadComponent:()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-4FXEREAP.js").then(o=>o.InventoryAsyncDetailComponent),canActivate:[N],data:{title:"Sync Inventory Async Detail"}}]}],ot=(()=>{let i=class i{};i.\u0275fac=function(r){return new(r||i)},i.\u0275mod=ae({type:i}),i.\u0275inj=re({imports:[ue,he.forChild(Yt)]});let o=i;return o})();var En=(()=>{let i=class i{};i.\u0275fac=function(r){return new(r||i)},i.\u0275mod=ae({type:i}),i.\u0275inj=re({imports:[ue,ke,Fe,ot,he,Ve,Ke,ze,Ae,qe,U,je]});let o=i;return o})();export{En as LogsModule};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as Z,e as $,h as C}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-CMHF5RTN.js";import{J as M,O as q,U,a as _,e as b,h as p,i as w,j as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-IKMQT2F2.js";import{e as P,g as O,j as B,n as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-KSOIRHFB.js";import{$ as u,Aa as x,Fa as r,Ja as f,Ka as N,Ma as L,Pa as D,_ as A,aa as T,ba as y,c as d,db as j,ea as m,fa as E,gb as I,ha as S,j as F,sb as k}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-QMFPH7XZ.js";var K=z({passive:!0}),G=(()=>{let i=class i{constructor(e,t){this._platform=e,this._ngZone=t,this._monitoredElements=new Map}monitor(e){if(!this._platform.isBrowser)return F;let t=b(e),s=this._monitoredElements.get(t);if(s)return s.subject;let o=new d,a="cdk-text-field-autofilled",c=l=>{l.animationName==="cdk-text-field-autofill-start"&&!t.classList.contains(a)?(t.classList.add(a),this._ngZone.run(()=>o.next({target:l.target,isAutofilled:!0}))):l.animationName==="cdk-text-field-autofill-end"&&t.classList.contains(a)&&(t.classList.remove(a),this._ngZone.run(()=>o.next({target:l.target,isAutofilled:!1})))};return this._ngZone.runOutsideAngular(()=>{t.addEventListener("animationstart",c,K),t.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(t,{subject:o,unlisten:()=>{t.removeEventListener("animationstart",c,K)}}),o}stopMonitoring(e){let t=b(e),s=this._monitoredElements.get(t);s&&(s.unlisten(),s.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))}ngOnDestroy(){this._monitoredElements.forEach((e,t)=>this.stopMonitoring(t))}};i.\u0275fac=function(t){return new(t||i)(y(p),y(f))},i.\u0275prov=A({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var W=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=m({type:i}),i.\u0275inj=u({});let n=i;return n})();var ie=new T("MAT_INPUT_VALUE_ACCESSOR"),se=["button","checkbox","file","hidden","image","radio","range","reset","submit"],ne=0,re=q(class{constructor(n,i,Y,e){this._defaultErrorStateMatcher=n,this._parentForm=i,this._parentFormGroup=Y,this.ngControl=e,this.stateChanges=new d}}),He=(()=>{let i=class i extends re{get disabled(){return this._disabled}set disabled(e){this._disabled=_(e),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(e){this._id=e||this._uid}get required(){return this._required??this.ngControl?.control?.hasValidator(P.required)??!1}set required(e){this._required=_(e)}get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&w().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(e){e!==this.value&&(this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=_(e)}constructor(e,t,s,o,a,c,l,X,J,R){super(c,o,a,s),this._elementRef=e,this._platform=t,this._autofillMonitor=X,this._formField=R,this._uid=`mat-input-${ne++}`,this.focused=!1,this.stateChanges=new d,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(v=>w().has(v)),this._iOSKeyupListener=v=>{let h=v.target;!h.value&&h.selectionStart===0&&h.selectionEnd===0&&(h.setSelectionRange(1,1),h.setSelectionRange(0,0))};let g=this._elementRef.nativeElement,H=g.nodeName.toLowerCase();this._inputValueAccessor=l||g,this._previousNativeValue=this.value,this.id=this.id,t.IOS&&J.runOutsideAngular(()=>{e.nativeElement.addEventListener("keyup",this._iOSKeyupListener)}),this._isServer=!this._platform.isBrowser,this._isNativeSelect=H==="select",this._isTextarea=H==="textarea",this._isInFormField=!!R,this._isNativeSelect&&(this.controlType=g.multiple?"mat-native-select-multiple":"mat-native-select")}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._platform.IOS&&this._elementRef.nativeElement.removeEventListener("keyup",this._iOSKeyupListener)}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==null&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}_focusChanged(e){e!==this.focused&&(this.focused=e,this.stateChanges.next())}_onInput(){}_dirtyCheckNativeValue(){let e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_dirtyCheckPlaceholder(){let e=this._getPlaceholder();if(e!==this._previousPlaceholder){let t=this._elementRef.nativeElement;this._previousPlaceholder=e,e?t.setAttribute("placeholder",e):t.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){se.indexOf(this._type)>-1}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!this._isNeverEmpty()&&!this._elementRef.nativeElement.value&&!this._isBadInput()&&!this.autofilled}get shouldLabelFloat(){if(this._isNativeSelect){let e=this._elementRef.nativeElement,t=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&t&&t.label)}else return this.focused||!this.empty}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){let e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}};i.\u0275fac=function(t){return new(t||i)(r(x),r(p),r(O,10),r(B,8),r(V,8),r(U),r(ie,10),r(G),r(f),r($,8))},i.\u0275dir=E({type:i,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:18,hostBindings:function(t,s){t&1&&I("focus",function(){return s._focusChanged(!0)})("blur",function(){return s._focusChanged(!1)})("input",function(){return s._onInput()}),t&2&&(j("id",s.id)("disabled",s.disabled)("required",s.required),L("name",s.name||null)("readonly",s.readonly&&!s._isNativeSelect||null)("aria-invalid",s.empty&&s.required?null:s.errorState)("aria-required",s.required)("id",s.id),D("mat-input-server",s._isServer)("mat-mdc-form-field-textarea-control",s._isInFormField&&s._isTextarea)("mat-mdc-form-field-input-control",s._isInFormField)("mdc-text-field__input",s._isInFormField)("mat-mdc-native-select-inline",s._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly"},exportAs:["matInput"],features:[k([{provide:Z,useExisting:i}]),N,S]});let n=i;return n})(),Fe=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=m({type:i}),i.\u0275inj=u({imports:[M,C,C,W,M]});let n=i;return n})();export{ie as a,He as b,Fe as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-MNDH6U5G.js";import{a as O,b as _e,c as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-3URAANI6.js";import{a as de,b as $e}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-GJLYUWSL.js";import{b as ke}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-BFSIXPYE.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-2IH2MGS7.js";import{a as Ne,b as Oe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-2FIOSKRJ.js";import{a as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-3C4XDMT2.js";import{a as me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-VPHHTNUD.js";import{a as se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-FKBDMXZF.js";import{a as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-3EZXX4SY.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-NWWR3K33.js";import{c as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-CGWBESJR.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-6ORFYERF.js";import{a as Te,b as De}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-QS23P4G5.js";import{b as re,c as be}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-KTTSCH5B.js";import{b as B,e as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-A6HOOHGI.js";import{a as pe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-CQY6SBLJ.js";import{a as Ee,b as Fe,c as Me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-KJQHDPO2.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-NVLJ23H4.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-CMHF5RTN.js";import{d as Ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-EV36IP6L.js";import{a as le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-FVAPOGDC.js";import{t as ce,u as ye,v as z,w as we}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-D7MTVAUX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-IKMQT2F2.js";import{b as te,c as ne,h as k,k as N,m as ie,u as oe,v as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-KSOIRHFB.js";import{c as w}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-GWMLSBG4.js";import{$ as X,$a as E,B as D,Bb as P,Cb as v,Ea as l,Fa as b,Gc as Pe,Ia as xe,Kb as Z,Kc as ee,Na as s,Ta as u,W as q,Wb as $,Ya as r,Yb as A,Za as c,Zb as L,_a as x,ab as F,ac as W,cb as f,da as V,dc as U,ea as Y,ec as R,gb as g,ia as _,ib as p,ja as h,lb as Q,nb as H,ob as m,pb as T,qb as I,tb as Se,vb as y,ya as M}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-QMFPH7XZ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.5.0/Marketplace/chunk-T6GUYLRX.js";function qe(i,a){if(i&1){let n=f();r(0,"button",18),g("click",function(){_(n);let t=p(3);return h(t.openScanDialog())}),x(1,"i",19),m(2," Scan Channel "),c()}}function Xe(i,a){if(i&1){let n=f();r(0,"button",20),g("click",function(){_(n);let t=p().ngIf,o=p(2);return h(o.onUpdateItems(t))}),x(1,"i",21),m(2," Update "),c()}}function Ye(i,a){if(i&1&&(r(0,"div"),u(1,qe,3,0,"button",16)(2,Xe,3,0,"button",17),c()),i&2){let n=a.ngIf,e=p(2);l(1),s("ngIf",!e.productService.hasSelectionVariant(n)),l(1),s("ngIf",e.productService.hasSelectionVariant(n))}}function Qe(i,a){if(i&1){let n=f();r(0,"div",22)(1,"app-table",23),g("onToggle",function(t){_(n);let o=p(2);return h(o.onShowDifferencePrice(t))})("onSubmit",function(t){_(n);let o=p(2);return h(o.updatePriceByVariant(t))}),P(2,"async"),c()()}if(i&2){let n=p().ngIf,e=p();l(1),s("showProductToggle",!0)("data",v(2,4,e.paginationService.data$))("channel",n.Options.Channel)("filter",n.Filter)}}function We(i,a){if(i&1){let n=f();r(0,"span",24),g("click",function(){_(n);let t=p(2);return h(t.getRowCount())}),r(1,"i",25),m(2,"?"),c()()}}function et(i,a){if(i&1&&(r(0,"span"),m(1),P(2,"number"),c()),i&2){let n=a.ngIf;l(1),T(v(2,1,n))}}function tt(i,a){if(i&1){let n=f();r(0,"a",26),g("click",function(){_(n);let t=p(2);return h(t.onNextPage())}),x(1,"i",27),m(2," Next"),c()}}function nt(i,a){if(i&1){let n=f();r(0,"a",28),g("click",function(){_(n);let t=p(2);return h(t.onLastPage())}),x(1,"i",29),m(2," Last"),c()}}function it(i,a){if(i&1){let n=f();r(0,"mainpanel",1),g("onSubmit",function(t){_(n);let o=p();return h(o.onSearch(t))}),r(1,"actions")(2,"div",2),u(3,Ye,3,2,"div",3),P(4,"async"),c()(),r(5,"filters")(6,"div",4)(7,"div")(8,"label"),m(9,"Page Number"),c(),r(10,"input",5),g("ngModelChange",function(t){_(n);let o=p();return h(o.searchFilter.PageNumber=t)}),c()(),r(11,"div")(12,"label"),m(13,"Page Size"),c(),r(14,"input",5),g("ngModelChange",function(t){_(n);let o=p();return h(o.searchFilter.RowCount=t)}),c()()()(),r(15,"content")(16,"div",6)(17,"div",7),u(18,Qe,3,6,"div",8),P(19,"async"),c(),r(20,"div",9)(21,"div",10)(22,"div",11),m(23),P(24,"number"),P(25,"async"),u(26,We,3,0,"span",12)(27,et,3,3,"span",3),P(28,"async"),m(29),c()(),r(30,"div",13),u(31,tt,3,0,"a",14)(32,nt,3,0,"a",15),c()()()()()}if(i&2){let n=p(),e;s("pageData",n.pageData)("textButton","Search"),l(3),s("ngIf",v(4,12,n.paginationService.data$)),l(7),s("ngModel",n.searchFilter.PageNumber),l(4),s("ngModel",n.searchFilter.RowCount),l(4),s("ngIf",v(19,14,n.paginationService.data$)),l(5),I(" Showing 1 - ",v(24,16,(e=v(25,18,n.paginationService.data$))==null?null:e.length)," of "),l(3),s("ngIf",n.paginationService.hideCount),l(1),s("ngIf",!n.paginationService.hideCount&&v(28,20,n.allDataCount$)),l(2),I(" records ~ ",n.paginationService.footerPageNumber," Page "),l(2),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}var je=(()=>{let a=class a{constructor(e,t,o,d,C){this.http=e,this.toastr=t,this.dialog=o,this.paginationService=d,this.productService=C,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(q(e=>{this.channelOptions=e.Options.Channel,e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.paginationService.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}openScanDialog(){this.searchFilter.ChannelID=w.GuidEMpty;let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(se,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(D(o=>w.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.initPageLoader(),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)}})}updatePrice(e){let t=this.productService.selectedVariantProduct(e);if(t.length>0){let d=t.map(S=>({ID:S.ID,Code:S.Code,Price:S.UnitPrice}));var o=this.channelOptions.filter(S=>S.selected).map(S=>S.ID);let C={ListChannelID:o,ListPrice:d};this.http.post("/api/Price/UpdateChannel",C).subscribe(S=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+C.ListPrice.length+" items in "+C.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+d.Name+" to "+t.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(de,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(D(o=>o!==void 0)).subscribe(o=>{this.channelOptions=o,this.updatePrice(e)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}})}ngOnDestroy(){this.paginationService.destroy()}};a.\u0275fac=function(t){return new(t||a)(b(j),b(B),b(K),b(me),b(G))},a.\u0275cmp=V({type:a,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["type","number",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,o){t&1&&(u(0,it,33,22,"mainpanel",0),P(1,"async")),t&2&&s("ngIf",v(1,1,o.loader$))},dependencies:[L,ne,ie,k,N,z,he,W,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=a;return i})();function ot(i,a){if(i&1&&(r(0,"mat-radio-button",3),m(1),c()),i&2){let n=a.$implicit,e=a.index,t=p();s("value",n.Key)("name",t.name)("title",t.tooltipsText[e]?t.tooltipsText[e]:""),l(1),I(" ",n.Value,"")}}var at=i=>({"border-0 rounded":i}),ue=(()=>{let a=class a{constructor(){this.modelChange=new xe,this.border=!1,this.tooltipsText=[]}change(e){this.modelChange.emit(e)}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=V({type:a,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[Se],decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(t,o){t&1&&(r(0,"div",0)(1,"mat-radio-group",1),g("ngModelChange",function(C){return o.change(C)}),u(2,ot,2,4,"mat-radio-button",2),c()()),t&2&&(s("ngClass",y(3,at,o.border==!1)),l(1),s("ngModel",o.model),l(1),s("ngForOf",o.options))},dependencies:[R,$,A,Me,Ee,Fe,oe,k,N],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});let i=a;return i})();function pt(i,a){if(i&1){let n=f();r(0,"button",18),g("click",function(){_(n);let t=p();return h(t.onUpdateItems())}),x(1,"i",19),m(2," Update "),c()}}function mt(i,a){if(i&1&&(r(0,"th",20),m(1),c()),i&2){let n=a.$implicit;l(1),T(n.Name)}}function dt(i,a){if(i&1){let n=f();r(0,"th")(1,"input",21),g("ngModelChange",function(t){_(n);let o=p();return h(o.checkboxState=t)})("ngModelChange",function(){_(n);let t=p();return h(t.onSelectAllData())}),c()()}if(i&2){let n=p();l(1),s("ngModel",n.checkboxState)}}function _t(i,a){i&1&&(E(0),r(1,"th",22),m(2," Expected (POS) "),c(),r(3,"th",22),m(4," Channel "),c(),F())}function ht(i,a){if(i&1){let n=f();r(0,"img",35),g("click",function(t){_(n);let o=p(3).$implicit,d=p();return h(d.onZoomImage(t,o==null?null:o.ImageUrl))}),c()}if(i&2){let n=p(3).$implicit;Q("src",n==null?null:n.ImageUrl,M)}}function ut(i,a){i&1&&x(0,"img",36)}var gt=i=>({"border-bottom":i});function Ct(i,a){if(i&1&&(E(0),r(1,"td",30),u(2,ht,1,1,"img",31)(3,ut,1,0,"ng-template",null,32,Z),c(),r(5,"td",33)(6,"h5",34),m(7),c(),x(8,"br"),r(9,"small"),m(10),c()(),F()),i&2){let n=H(4),e=p().index,t=p().$implicit,o=p();l(1),s("rowSpan",t==null?null:t.Variants.length)("ngClass",y(7,gt,e+1==o.products.length)),l(1),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),l(3),s("rowSpan",t==null?null:t.Variants.length),l(2),T(t==null?null:t.Name),l(3),I("(",t==null?null:t.Category,")")}}function ft(i,a){if(i&1){let n=f();E(0),r(1,"input",21),g("ngModelChange",function(t){_(n);let o=p(2).$implicit;return h(o.selected=t)}),c(),F()}if(i&2){let n=p(2).$implicit;l(1),s("ngModel",n.selected)}}function xt(i,a){if(i&1&&(r(0,"td",37),u(1,ft,2,1,"ng-container",23),c()),i&2){let n=p().$implicit;l(1),s("ngIf",!n.Discontinued)}}var St=i=>({"bg-gradient-warning":i});function Pt(i,a){if(i&1){let n=f();E(0),r(1,"td",40),m(2),P(3,"number"),c(),r(4,"td",41),g("click",function(){let o=_(n).$implicit,d=p(2).$implicit,C=p().$implicit,S=p();return h(S.openTableDialog(d,C,o))}),r(5,"span",42),m(6),P(7,"number"),c(),r(8,"a",43),g("click",function(t){return t==null?null:t.stopPropagation()}),x(9,"i",29),c()(),F()}if(i&2){let n=a.$implicit;l(2),I(" ",v(3,4,n.PriceExpected)," "),l(2),s("ngClass",y(8,St,n.Price!=n.PriceExpected)),l(2),I(" ",v(7,6,n.Price)," "),l(2),s("href",n.Url,M)}}function vt(i,a){i&1&&(r(0,"td",44),m(1,"X"),c(),r(2,"td",44),m(3,"X"),c())}function bt(i,a){if(i&1&&(E(0),u(1,Pt,10,10,"ng-container",38)(2,vt,4,0,"ng-template",null,39,Z),F()),i&2){let n=a.$implicit,e=H(3),t=p().$implicit,o=p(2);l(1),s("ngIf",o.getItemFromChannel(t,n.ID))("ngIfElse",e)}}var It=i=>({"text-decoration-line-through":i}),ze=i=>[i];function yt(i,a){if(i&1&&(r(0,"tr"),u(1,Ct,11,9,"ng-container",23),r(2,"td",24),m(3),c(),r(4,"td",25)(5,"span",26),m(6),c(),r(7,"span",27)(8,"a",28),x(9,"i",29),c()()(),u(10,xt,2,1,"ng-template",16)(11,bt,4,2,"ng-container",17),c()),i&2){let n=a.$implicit,e=a.index,t=p(2);l(1),s("ngIf",e==0),l(2),T(n==null?null:n.Model),l(1),s("matTooltip",n.Discontinued?t.discontinuedVariantMsg:""),l(1),s("ngClass",y(8,It,n.Discontinued)),l(1),T(n==null?null:n.Code),l(2),s("href","https://"+t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),M),l(2),s("ngxPermissionsOnly",y(10,ze,t.rolePriceEdit)),l(1),s("ngForOf",t.channelOptions)}}function wt(i,a){if(i&1&&(r(0,"tbody"),u(1,yt,12,12,"tr",17),c()),i&2){let n=a.$implicit;l(1),s("ngForOf",n.Variants)}}var Ke=(()=>{let a=class a{constructor(e,t,o,d,C){this.http=e,this.toastr=t,this.dialog=o,this.productService=d,this.biggerPictureService=C,this.searchFilter=new Ve,this.products=[],this.checkboxState=!1,this.rolePriceEdit=ae.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.initPageLoader(),this.filterTypeOptions=[{Key:O.ALL,Value:"All"},{Key:O.DIFFERENCE,Value:"Difference"}],this.filterType=O.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.hostName=d.getHostName()}initPageLoader(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,this.onFilter()})}onSelectAllData(){this.products=this.products.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e))}onFilter(e){let t={text:e,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.http.post("/api/Price/GetOutletPrice",t).subscribe(o=>{this.products=o.Data})}updatePrice(){let e=this.productService.selectedVariantProduct(this.products);if(e.length>0){let t=e.map(C=>C.ID),d={ListChannelID:this.channelOptions.filter(C=>C.selected).map(C=>C.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:C=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:C=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,t){return e.Channel.find(o=>o.ChannelID==t)}onUpdateItems(){let e=this.productService.selectedVariantProduct(this.products);this.dialog.open(de,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(D(t=>w.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice()})}openTableDialog(e,t,o){let d=JSON.parse(JSON.stringify(e));this.dialog.open(_e,{data:{Name:t.Name,Variant:d,ChannelID:o?.ChannelID,Table:"price",ChannelItemID:o?.ChannelItemID}}).afterClosed().pipe(D(S=>w.IsNotEmpty(S))).subscribe(S=>{this.updateProductPrice(S,o)})}updateProductPrice(e,t){let o={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",o).subscribe(d=>{t.Price=o.Price;let C=this.productService.findChannelById(o.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${C.Name} to ${o.Price}`,"Success")})}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}};a.\u0275fac=function(t){return new(t||a)(b(j),b(B),b(K),b(G),b(pe))},a.\u0275cmp=V({type:a,selectors:[["app-custom-channel-price"]],decls:30,vars:14,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-start","border-bottom",3,"matTooltip"],[3,"ngClass"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"]],template:function(t,o){t&1&&(r(0,"mainpanel",0),g("onSubmit",function(C){return o.onFilter(C)}),r(1,"filters")(2,"div",1)(3,"div")(4,"h6"),m(5,"Filter by"),c(),r(6,"radio-options",2),g("modelChange",function(C){return o.filterType=C}),c()()()(),r(7,"actions")(8,"div",3),u(9,pt,3,0,"button",4),c()(),r(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr"),x(18,"th",11),u(19,mt,2,1,"th",12),c(),r(20,"tr")(21,"th",13),m(22,"Product"),c(),r(23,"th",14),m(24,"Variant"),c(),r(25,"th",15),m(26,"SKU"),c(),u(27,dt,2,1,"ng-template",16)(28,_t,5,0,"ng-container",17),c()(),u(29,wt,2,1,"tbody",17),c()()()()()()()),t&2&&(s("pageData",o.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(6),s("model",o.filterType)("options",o.filterTypeOptions)("border",!0),l(3),s("ngIf",o.productService.hasSelectionVariant(o.products)),l(10),s("ngForOf",o.channelOptions),l(8),s("ngxPermissionsOnly",y(12,ze,o.rolePriceEdit)),l(1),s("ngForOf",o.channelOptions),l(1),s("ngForOf",o.products))},dependencies:[$,A,L,te,k,N,z,ce,ue,re,U],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let i=a;return i})();function Tt(i,a){if(i&1){let n=f();r(0,"button",8),g("click",function(){_(n);let t=p(2).ngIf,o=p();return h(o.openScanDialog(t))}),x(1,"i",9),m(2," Scan Channel "),c()}}function Dt(i,a){if(i&1){let n=f();r(0,"button",10),g("click",function(){_(n);let t=p().ngIf,o=p(2);return h(o.updateStock(t))}),x(1,"i",11),m(2," Update "),c()}}function Vt(i,a){if(i&1&&(r(0,"actions")(1,"div",5)(2,"div"),u(3,Tt,3,0,"button",6)(4,Dt,3,0,"button",7),c()()()),i&2){let n=a.ngIf,e=p(2);l(3),s("ngIf",!e.productService.hasSelectionVariant(n)),l(1),s("ngIf",e.productService.hasSelectionVariant(n))}}function Et(i,a){if(i&1){let n=f();r(0,"th")(1,"input",32),g("change",function(t){_(n);let o=p().ngIf,d=p(2);return h(d.onSelectAllSKU(t.target.checked,o))}),c()()}}function Ft(i,a){if(i&1){let n=f();r(0,"input",52),g("ngModelChange",function(t){_(n);let o=p(4).$implicit;return h(o.selected=t)})("ngModelChange",function(){_(n);let t=p(4).$implicit,o=p(3);return h(o.onCheckboxStateProduct(t))}),c()}if(i&2){let n=p(4).$implicit;s("ngModel",n.selected)}}function Mt(i,a){if(i&1&&u(0,Ft,1,1,"input",51),i&2){let n=p(2).$implicit,e=p().$implicit;s("ngIf",n.Inventory>=0||e.Variants.length>1)}}function kt(i,a){if(i&1){let n=f();r(0,"img",53),g("click",function(t){_(n);let o=p(3).$implicit,d=p(3);return h(d.onZoomImage(t,o==null?null:o.ImageUrl))}),c()}if(i&2){let n=p(3).$implicit;Q("src",n.ThumbnailUrl,M)}}function Nt(i,a){i&1&&x(0,"img",54)}var fe=i=>[i];function Ot(i,a){if(i&1&&(E(0),r(1,"td",45)(2,"div",46),u(3,Mt,1,1,"ng-template",21)(4,kt,1,1,"img",47)(5,Nt,1,0,"ng-template",null,48,Z),c()(),r(7,"td",49)(8,"span",50),m(9),c(),x(10,"br"),r(11,"small"),m(12),c()(),F()),i&2){let n=H(6),e=p(2).$implicit,t=p(3);l(1),s("rowSpan",e.Variants.length),l(2),s("ngxPermissionsOnly",y(7,fe,t.rolePriceEdit)),l(1),s("ngIf",e.ThumbnailUrl)("ngIfElse",n),l(3),s("rowSpan",e.Variants.length),l(2),T(e.Name),l(3),I("(",e.Category,")")}}function $t(i,a){if(i&1){let n=f();r(0,"input",57),g("ngModelChange",function(t){_(n);let o=p(3).$implicit;return h(o.selected=t)}),c()}if(i&2){let n=p(3).$implicit;s("ngModel",n.selected)}}function At(i,a){if(i&1&&(E(0),u(1,$t,1,1,"input",56),F()),i&2){let n=p(2).$implicit;l(1),s("ngIf",n.Inventory>=0)}}function Lt(i,a){if(i&1&&(r(0,"td",55),u(1,At,2,1,"ng-container",4),c()),i&2){let n=p().$implicit;l(1),s("ngIf",!n.Discontinued)}}function Ut(i,a){if(i&1){let n=f();r(0,"div",58),g("click",function(){_(n);let t=p().$implicit,o=p().$implicit,d=p(2).ngIf,C=p();return h(C.openTableDialog(t,o,d))}),m(1),P(2,"number"),c()}if(i&2){let n=p().$implicit;l(1),I(" ",v(2,1,n.Channel[0]==null?null:n.Channel[0].Price)," ")}}var Rt=i=>({"text-decoration-line-through":i}),Bt=i=>({"bg-gradient-warning":i});function jt(i,a){if(i&1){let n=f();r(0,"tr"),u(1,Ot,13,9,"ng-container",4),r(2,"td",19),m(3),c(),r(4,"td",33)(5,"span",34),m(6),c(),r(7,"span",35)(8,"a",36),x(9,"i",37),c()()(),u(10,Lt,2,1,"ng-template",21),r(11,"td",22),m(12),P(13,"number"),c(),r(14,"td",38),u(15,Ut,3,3,"div",39),c(),r(16,"td")(17,"div",40)(18,"div",41)(19,"a",36),x(20,"i",42),c(),m(21," \xA0\xA0 "),r(22,"span",43),g("click",function(){let o=_(n).$implicit,d=p(4);return h(d.refreshPrice(o))}),x(23,"i",44),c()()()()()}if(i&2){let n=a.$implicit,e=a.index,t=p(4);l(1),s("ngIf",e==0),l(2),T(n.Model),l(1),s("matTooltip",n.Discontinued?t.discontinuedVariantMsg:""),l(1),s("ngClass",y(13,Rt,n.Discontinued)),l(1),I(" ",n.Code," "),l(2),s("href","https://"+t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),M),l(2),s("ngxPermissionsOnly",y(15,fe,t.rolePriceEdit)),l(2),I(" ",v(13,11,n.UnitPrice)," "),l(2),s("ngClass",y(17,Bt,n.UnitPrice!=(n.Channel[0]==null?null:n.Channel[0].Price))),l(1),s("ngIf",n.Channel.length>0),l(4),s("href",n.Channel[0]==null?null:n.Channel[0].Url,M)}}function zt(i,a){if(i&1&&(E(0),u(1,jt,24,19,"tr",26),F()),i&2){let n=a.$implicit;l(1),s("ngForOf",n.Variants)}}function Kt(i,a){if(i&1){let n=f();r(0,"span",58),g("click",function(){_(n);let t=p(3);return h(t.getRowCount())}),r(1,"i",59),m(2,"?"),c()()}}function Gt(i,a){if(i&1&&(r(0,"span"),m(1),P(2,"number"),c()),i&2){let n=a.ngIf;l(1),T(v(2,1,n.Total))}}function Jt(i,a){if(i&1){let n=f();r(0,"a",63),g("click",function(){_(n);let t=p(4);return h(t.onNextPage())}),x(1,"i",64),m(2," Next"),c()}}function Ht(i,a){if(i&1){let n=f();r(0,"a",65),g("click",function(){_(n);let t=p(4);return h(t.onLastPage())}),x(1,"i",66),m(2," Last"),c()}}function Zt(i,a){if(i&1&&(r(0,"div",60),u(1,Jt,3,0,"a",61)(2,Ht,3,0,"a",62),c()),i&2){let n=p(3);l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function qt(i,a){if(i&1){let n=f();r(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),m(7," Product "),r(8,"div")(9,"mat-slide-toggle",17),g("ngModelChange",function(t){_(n);let o=p(2);return h(o.toggleDifferentInventory=t)})("toggleChange",function(){_(n);let t=p(2);return h(t.onToggleDifferentInventory())}),r(10,"small",18),m(11,"FILTER DIFFERENT PRICE"),c()()()(),r(12,"th",19),m(13,"Variant"),c(),r(14,"th",20),m(15,"SKU"),c(),u(16,Et,2,0,"ng-template",21),r(17,"th",22),m(18,"POS"),c(),r(19,"th",22)(20,"div",23),g("click",function(){_(n);let t=p(2);return h(t.onChangeChannel())}),x(21,"img",24),m(22),c()(),x(23,"th",25),c()(),r(24,"tbody"),u(25,zt,2,1,"ng-container",26),c()(),r(26,"div",27)(27,"div",28)(28,"div",29),m(29),P(30,"number"),u(31,Kt,3,0,"span",30)(32,Gt,3,3,"span",4),P(33,"async"),m(34),c()(),u(35,Zt,3,2,"div",31),c()()()()}if(i&2){let n=a.ngIf,e=p(2);l(9),s("ngModel",e.toggleDifferentInventory),l(7),s("ngxPermissionsOnly",y(15,fe,e.rolePriceEdit)),l(4),s("matTooltip","Change "+(e.selectedChannel==null?null:e.selectedChannel.Name)),l(1),s("src",e.selectedChannel.logo,M),l(1),I(" ",e.selectedChannel!=null&&e.selectedChannel.Name?e.selectedChannel==null?null:e.selectedChannel.Name:"Choose Channel ..."," "),l(3),s("ngForOf",n),l(4),I(" Showing 1 - ",v(30,11,n==null?null:n.length)," of "),l(2),s("ngIf",e.paginationService.hideCount),l(1),s("ngIf",v(33,13,!e.paginationService.hideCount&&e.allDataCount$)),l(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),l(1),s("ngIf",n.length>0)}}function Xt(i,a){if(i&1){let n=f();r(0,"mainpanel",1),g("textChange",function(t){_(n);let o=p();return h(o.searchFilter.text=t)})("onSubmit",function(){_(n);let t=p();return h(t.search())}),r(1,"filters")(2,"div",2)(3,"div")(4,"label"),m(5,"Page Number"),c(),r(6,"input",3),g("ngModelChange",function(t){_(n);let o=p();return h(o.searchFilter.PageNumber=t)}),c()(),r(7,"div")(8,"label"),m(9,"Page Size"),c(),r(10,"input",3),g("ngModelChange",function(t){_(n);let o=p();return h(o.searchFilter.RowCount=t)}),c()()()(),u(11,Vt,5,2,"actions",4),P(12,"async"),u(13,qt,36,17,"content",4),P(14,"async"),c()}if(i&2){let n=p();s("headerTitle",n.pageTitle)("text",n.searchFilter.text),l(6),s("ngModel",n.searchFilter.PageNumber),l(4),s("ngModel",n.searchFilter.RowCount),l(1),s("ngIf",v(12,6,n.paginationService.data$)),l(2),s("ngIf",v(14,8,n.paginationService.data$))}}var Ge=(()=>{let a=class a{constructor(e,t,o,d,C,S){this.http=e,this.paginationService=t,this.toastr=o,this.dialog=d,this.productService=C,this.biggerPictureService=S,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ae.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.productService.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(q(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=O.ALL,this.paginationService.reloadPagination(this.searchFilter),this.channelOptions=e.Options.Channel,this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=O.ALL:this.searchFilter.filterModel=O.DIFFERENCE,this.search()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(t=>(t.selected=e.selected,t))}openScanDialog(e){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=w.GuidEMpty,this.dialog.open(se,{data:{filter:t,channelOptions:e.Options.Channel},width:"600px"}).afterClosed().pipe(D(o=>w.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAll(e)})}scanAll(e){let t=this.productService.findChannelById(this.searchFilter.ChannelID,e.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(o=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(),this.toastr.success(`Successfully scanned from ${t?.Name}`,"Success"))})}updateStock(e){let o=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),d={ListChannelID:[this.searchFilter.ChannelID],ListPrice:o};this.http.post("/api/Price/UpdateChannel",d).subscribe(()=>{this.search(),this.toastr.success(`Successfully updated ${d.ListPrice.length} variants in ${d.ListChannelID.length} channels`,"Success")})}refreshPrice(e){let t={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",t).subscribe(o=>{this.toastr.success("Successfully updated","Success"),this.search()})}search(){this.paginationService.reloadPagination(this.searchFilter)}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:e=>{this.paginationService.getAllData(this.searchFilter,e.Total)}})}openTableDialog(e,t,o){let d=JSON.parse(JSON.stringify(e));this.dialog.open(_e,{data:{Name:t.Name,Variant:d,ChannelID:d?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:d?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(D(S=>w.IsNotEmpty(S))).subscribe(S=>{this.updateItemAfterDialog(S,o,e)})}updateItemAfterDialog(e,t,o){let d={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",d).subscribe(C=>{let S=this.productService.findChannelById(d.ID,t.Options.Channel);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${S.Name} to ${d.Price}`,"Success"),o.Channel[0]&&(o.Channel[0].Price=d.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=w.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open($e,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe(D(e=>w.IsNotEmpty(e))).subscribe(e=>{this.selectedChannel=e,this.searchFilter.ChannelID=e.ID,this.search()})}onSelectAllSKU(e,t){t=t.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=e,d)),o))}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}ngOnDestroy(){this.paginationService.destroy()}};a.\u0275fac=function(t){return new(t||a)(b(j),b(me),b(B),b(K),b(G),b(pe))},a.\u0275cmp=V({type:a,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","checkbox",1,"me-3",3,"change"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[3,"ngClass"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-external-link-alt"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"row"],[1,"col-12","ps-0","d-flex","justify-content-between"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,o){t&1&&(u(0,Xt,15,10,"mainpanel",0),P(1,"async")),t&2&&s("ngIf",v(1,1,o.loader$))},dependencies:[$,A,L,ne,ie,te,k,N,z,Ne,ce,re,W,U],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]});let i=a;return i})();var Je=(()=>{let a=class a{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=V({type:a,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,o){t&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),x(3,"nav-tab",2),c()()(),x(4,"router-outlet")),t&2&&(l(3),s("Tabs",o.priceTabs))},dependencies:[Te,Pe]});let i=a;return i})();var Yt=[{path:"",component:Je,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:je,canActivate:[le],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:Ke,canActivate:[le],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:Ge,canActivate:[le],data:{title:"Price Single Channel Comparison"}}]}],He=(()=>{let a=class a{};a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=Y({type:a}),a.\u0275inj=X({imports:[R,ee.forChild(Yt)]});let i=a;return i})();var ci=(()=>{let a=class a{};a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=Y({type:a}),a.\u0275inj=X({imports:[R,oe,De,we,ee,Ie,He,ve,Oe,ke,ye,ue,he,be.forChild()]});let i=a;return i})();export{ci as PriceModule};
|