marketplacepos 3.4.2 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/3rdpartylicenses.txt +5 -0
- package/Marketplace/{chunk-VJLQRARA.js → chunk-475WOA53.js} +1 -1
- package/Marketplace/chunk-4KXF5ZA2.js +1 -0
- package/Marketplace/{chunk-CVIYGYJG.js → chunk-4PT4476L.js} +1 -1
- package/Marketplace/{chunk-VLWVI7LT.js → chunk-4TMYOD6O.js} +1 -1
- package/Marketplace/{chunk-4ZIFLVEZ.js → chunk-5ANLTFUN.js} +1 -1
- package/Marketplace/{chunk-LHYUY4OW.js → chunk-5XDVKUH7.js} +1 -1
- package/Marketplace/{chunk-NLUIK3SD.js → chunk-5ZN2BVWB.js} +1 -1
- package/Marketplace/chunk-7K45EX2D.js +1 -0
- package/Marketplace/{chunk-WT7HH4UV.js → chunk-AFXFMUBY.js} +1 -1
- package/Marketplace/{chunk-JD4NX6LL.js → chunk-AG7HK2U3.js} +1 -1
- package/Marketplace/{chunk-APSB364O.js → chunk-APUQGD5I.js} +1 -1
- package/Marketplace/{chunk-OGA3XTQE.js → chunk-BHYFVY4A.js} +1 -1
- package/Marketplace/{chunk-HMATF4RH.js → chunk-BZKS3OOQ.js} +1 -1
- package/Marketplace/{chunk-Y4RCGXQK.js → chunk-DLMJHJC2.js} +1 -1
- package/Marketplace/{chunk-FJAD3LVA.js → chunk-E6VM4GK2.js} +1 -1
- package/Marketplace/{chunk-3FA5VSAY.js → chunk-EI6G5GIB.js} +1 -1
- package/Marketplace/{chunk-PASXSTSS.js → chunk-GSRXSBIM.js} +1 -1
- package/Marketplace/{chunk-XG47KOUR.js → chunk-GYBKA75Z.js} +1 -1
- package/Marketplace/{chunk-45BCCCD5.js → chunk-H6D6Q2L2.js} +1 -1
- package/Marketplace/{chunk-WL3GCHJ5.js → chunk-HI7WYFPY.js} +1 -1
- package/Marketplace/{chunk-2PR23CRN.js → chunk-HUCFUCCO.js} +1 -1
- package/Marketplace/{chunk-EIQQEQMI.js → chunk-IEBL2FLF.js} +1 -1
- package/Marketplace/{chunk-NQ5YXCPF.js → chunk-IHM35ILL.js} +1 -1
- package/Marketplace/{chunk-DH7A3MMY.js → chunk-IM76S6ZZ.js} +1 -1
- package/Marketplace/{chunk-HIQEVY5J.js → chunk-IMXSLLAA.js} +1 -1
- package/Marketplace/chunk-IU6HPLQ3.js +1 -0
- package/Marketplace/{chunk-EGVKBYT5.js → chunk-J6UEWWQX.js} +1 -1
- package/Marketplace/{chunk-OHLIZGJ7.js → chunk-JF3MRSX7.js} +1 -1
- package/Marketplace/{chunk-XNEL4SD6.js → chunk-KKKJRBXL.js} +1 -1
- package/Marketplace/{chunk-QZHSCJJ5.js → chunk-KRXW5FTG.js} +1 -1
- package/Marketplace/{chunk-I5WJTOZD.js → chunk-L5URITG7.js} +1 -1
- package/Marketplace/{chunk-BJCKTMTZ.js → chunk-LBMDUJHZ.js} +1 -1
- package/Marketplace/{chunk-JDAC3DI7.js → chunk-LDVARU5U.js} +1 -1
- package/Marketplace/{chunk-CB54UHPH.js → chunk-LWKBNKVO.js} +1 -1
- package/Marketplace/{chunk-LUN7S6P4.js → chunk-MGOWDXUM.js} +1 -1
- package/Marketplace/{chunk-WAE5XPQ6.js → chunk-MZEDRDUX.js} +1 -1
- package/Marketplace/{chunk-KHQYY4CP.js → chunk-NB75ACST.js} +1 -1
- package/Marketplace/{chunk-QXKJ6AH2.js → chunk-NLTXIY5M.js} +1 -1
- package/Marketplace/{chunk-CNK2ETMZ.js → chunk-NWCS6OKR.js} +1 -1
- package/Marketplace/{chunk-H5BAFHZZ.js → chunk-OULCNSCZ.js} +1 -1
- package/Marketplace/{chunk-X6OLODND.js → chunk-OVPZBBEC.js} +2 -2
- package/Marketplace/{chunk-TKW6MA5X.js → chunk-OYMJWISR.js} +1 -1
- package/Marketplace/{chunk-CAF3EESF.js → chunk-PFX4CZVM.js} +1 -1
- package/Marketplace/{chunk-4FIQ677Y.js → chunk-Q5ZWBTZ2.js} +1 -1
- package/Marketplace/{chunk-5LIHLHZ2.js → chunk-QKOBK5RO.js} +1 -1
- package/Marketplace/{chunk-IKBHUDBF.js → chunk-RKNA2RX4.js} +1 -1
- package/Marketplace/chunk-RPMRAFUY.js +39 -0
- package/Marketplace/{chunk-RUG3NZNS.js → chunk-RWEMXJWP.js} +1 -1
- package/Marketplace/{chunk-WGNBD2TG.js → chunk-RWRP376T.js} +5 -5
- package/Marketplace/{chunk-Q27U6EXR.js → chunk-TP2HONHJ.js} +1 -1
- package/Marketplace/{chunk-KS42UW22.js → chunk-TRRI6HFB.js} +1 -1
- package/Marketplace/{chunk-7O2LUPOW.js → chunk-UCSWGVFE.js} +1 -1
- package/Marketplace/{chunk-QA6BHZKW.js → chunk-UFNZF4K5.js} +1 -1
- package/Marketplace/{chunk-MPXURNR4.js → chunk-URBKK5K6.js} +1 -1
- package/Marketplace/{chunk-6H6S75XM.js → chunk-USCL6HQE.js} +1 -1
- package/Marketplace/{chunk-CLLCMDP4.js → chunk-WB4KZY2I.js} +1 -1
- package/Marketplace/{chunk-TEIBLAW7.js → chunk-XEVR4BVC.js} +2 -2
- package/Marketplace/{chunk-ENUKURHL.js → chunk-XTLLDXB7.js} +1 -1
- package/Marketplace/{chunk-HO6I7ZN6.js → chunk-Y2IG7JAU.js} +1 -1
- package/Marketplace/{chunk-GPNYP6CI.js → chunk-YIPITET7.js} +1 -1
- package/Marketplace/{chunk-TFM4P7KH.js → chunk-YN7U2IRK.js} +1 -1
- package/Marketplace/{chunk-LC5NUVMA.js → chunk-ZJHL6VDX.js} +1 -1
- package/Marketplace/{chunk-EBAG6BIX.js → chunk-ZP6L6END.js} +1 -1
- package/Marketplace/{chunk-DANZQU6U.js → chunk-ZPR2KAKZ.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-MTBOIFWC.js → main-WKNVNRPA.js} +1 -1
- package/Marketplace/media/color-3LUHUBGQ.png +0 -0
- package/Marketplace/media/hue-RMMBQOAC.png +0 -0
- package/Marketplace/styles-ISUUHHCL.css +1 -0
- package/package.json +1 -1
- package/Marketplace/chunk-ANO5F2BV.js +0 -8
- package/Marketplace/chunk-FWUAZZDI.js +0 -1
- package/Marketplace/chunk-JIRDXTRJ.js +0 -1
- package/Marketplace/chunk-TZO7ICWB.js +0 -1
- package/Marketplace/styles-JRURH5LL.css +0 -1
- /package/Marketplace/{chunk-7G5B67SI.js → chunk-F7MYTDP3.js} +0 -0
- /package/Marketplace/{chunk-SZQIM5RM.js → chunk-GV43X5PS.js} +0 -0
- /package/Marketplace/{chunk-4YO3BZ5L.js → chunk-KSBVZVMH.js} +0 -0
- /package/Marketplace/{chunk-DILTMQOY.js → chunk-NXHVARCF.js} +0 -0
- /package/Marketplace/{chunk-HPDCVTZM.js → chunk-OKO7WTOG.js} +0 -0
- /package/Marketplace/{polyfills-WRDNL3NI.js → polyfills-STQSWRUI.js} +0 -0
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"marketplacepos","version":"3.
|
|
1
|
+
{"name":"marketplacepos","version":"3.5.1"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as At}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-PASXSTSS.js";import{a as re}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-Q27U6EXR.js";import{b as J}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-JDAC3DI7.js";import{a as te,b as ie,c as ct,d as ne,e as ht}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-OHLIZGJ7.js";import{a as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-5LIHLHZ2.js";import{a as me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WL3GCHJ5.js";import{d as bt,e as yt,f as Tt,g as wt,k as Dt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-KHQYY4CP.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-CVIYGYJG.js";import{a as It,b as Pt,c as Nt,d as Mt,e as Ot,f as kt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-QXKJ6AH2.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-2PR23CRN.js";import{c as rt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-TEIBLAW7.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-JD4NX6LL.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-I5WJTOZD.js";import{a as Y}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-CAF3EESF.js";import{b as Et}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-7O2LUPOW.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-HO6I7ZN6.js";import{a as Lt,b as Ft}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-6H6S75XM.js";import{a as at}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-DILTMQOY.js";import{a as xt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-VJLQRARA.js";import{a as ut,c as ve,e as ft,f as St,g as Ct}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-GPNYP6CI.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-LUN7S6P4.js";import{a as gt,b as _t}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WAE5XPQ6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EIQQEQMI.js";import{b as pe,e as L}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-DANZQU6U.js";import{b as vt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-FJAD3LVA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-Y4RCGXQK.js";import{a as ee,b as ot,c as q,d as lt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-LHYUY4OW.js";import{a as de}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-XG47KOUR.js";import{t as mt,u as st,v as j,w as dt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EGVKBYT5.js";import{T as pt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-CNK2ETMZ.js";import{b as Re,c as U,h as z,k as $,m as Z,u as nt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-OGA3XTQE.js";import{b as D,c as w}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-SZQIM5RM.js";import{$ as ke,$a as y,$b as Fe,Ab as b,B as Je,Bb as N,Cb as F,Ea as p,Ec as Ae,Fa as v,Fc as it,Hc as Q,Jb as R,Jc as Ve,Na as s,P as we,S as We,Ta as _,Vb as tt,W as Se,Xb as A,Ya as t,Yb as V,Za as a,_ as he,_a as f,ab as T,ac as k,ba as W,cb as I,cc as H,da as O,dc as Ce,ea as Le,gb as g,ha as Ke,ia as S,ib as d,ja as C,ka as Be,la as He,lb as Ue,mb as Xe,nb as P,ob as m,pb as u,q as B,qb as x,sb as Qe,tb as Ze,ub as K,vb as et,w as Ye,wb as X,ya as M}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WGNBD2TG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-HPDCVTZM.js";var Vt=(()=>{let l=class l{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[at.downloadOrder]}]}ngOnInit(){}};l.\u0275fac=function(i){return new(i||l)},l.\u0275cmp=O({type:l,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(i,r){i&1&&(t(0,"nav",0)(1,"div",1)(2,"div"),f(3,"nav-tab",2),a()()(),f(4,"router-outlet")),i&2&&(p(3),s("Tabs",r.ObjectOrderTabs)("usePermissions",!0))},dependencies:[gt,it]});let n=l;return n})();var Rt=(()=>{let l=class l{constructor(){}convertToCSV(e,i){let r;if(typeof e=="string")r=e;else{var c=typeof e=="object"?e:JSON.parse(e);r=this.transformToCSVStringFormat(c)}this.downloadCSV(r,i)}transformToCSVStringFormat(e){if(!e||!e.length)return;let i=",",r=Object.keys(e[0]);return e.map(h=>r.map(E=>{let le=h[E]===null||h[E]===void 0?"":h[E];return le=le instanceof Date?le.toLocaleString():le.toString().replace(/"/g,'""'),le.search(/("|,|\n)/g)>=0&&(le=`"${le}"`),le}).join(i)).join(`
|
|
2
|
-
`)}downloadCSV(e,i){var r=new Blob([e],{type:"text/csv;charset=utf8;"}),c=document.createElement("a");c.setAttribute("href",window.URL.createObjectURL(r)),c.setAttribute("download",i),document.body.appendChild(c),c.click(),document.body.removeChild(c)}};l.\u0275fac=function(i){return new(i||l)},l.\u0275prov=he({token:l,factory:l.\u0275fac,providedIn:"root"});let n=l;return n})();var xe=(()=>{let l=class l{constructor(e,i,r,c){this.http=e,this.dialog=i,this.toastr=r,this.exportService=c}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(e){return this.http.post("/api/orders/GetNewOrder",e).pipe(B(i=>i.Data))}getTotalNewOrders(e,i,r){let c={ListChannelID:e,From:i,To:r};return this.http.post("/api/orders/GetCountNewOrder",c).pipe(B(h=>h.Count))}exportOrders(e,i){return this.http.post("api/Orders/ExportOrder",e).pipe(Se(r=>{this.exportService.convertToCSV(r,i)}))}};l.\u0275fac=function(i){return new(i||l)(W(L),W(ve),W(pe),W(Rt))},l.\u0275prov=he({token:l,factory:l.\u0275fac});let n=l;return n})();var $e=(()=>{let l=class l{constructor(e,i){this.http=e,this.toastr=i}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(Se(i=>{this.tokopediaAcceptOrderHandler(i)}))}tokopediaAcceptOrderHandler(e){let i=e.filter(c=>c.Status==!1),r=e.filter(c=>c.Status==!0);if(i.length==0&&r.length>0){let c=`<ol>${this.generateSuccessMessage(r)}</ol>`;this.toastr.success(c,"Success",{enableHtml:!0})}else if(i.length>0&&r.length>0){let c=`<ol>
|
|
3
|
-
${this.generateSuccessMessage(r)}
|
|
4
|
-
${this.generateErrorMessage(i)}
|
|
5
|
-
</ol>`;this.toastr.warning(c,"Warning",{enableHtml:!0})}else{let c=`<ol>${this.generateErrorMessage(i)}</ol>`;this.toastr.error(c,"Error",{enableHtml:!0})}}generateSuccessMessage(e){let i="";return e.forEach(r=>{i+=`<li><b>${r.OrderNumber}</b> was successfully Accept</li>`}),i}generateErrorMessage(e){let i="";return e.forEach(r=>{i+=`<li><b>${r.OrderNumber}</b> ${r.Message}</li>`}),i}};l.\u0275fac=function(i){return new(i||l)(W(L),W(pe))},l.\u0275prov=he({token:l,factory:l.\u0275fac});let n=l;return n})();var $t=(()=>{let l=class l{constructor(e){this.dialogRef=e,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}};l.\u0275fac=function(i){return new(i||l)(v(ut))},l.\u0275cmp=O({type:l,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModel","ngModelChange"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(i,r){i&1&&(t(0,"div",0)(1,"h2",1),m(2,"Cetak label pesanan"),a(),t(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),m(7,"Kamu akan mencetak label yang berisi detail pesanan"),a(),t(8,"div",5)(9,"mat-checkbox",6),g("ngModelChange",function(h){return r.tandaiSudahDicetak=h}),a(),t(10,"span",7),m(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),a()()()()(),t(12,"mat-dialog-actions",8)(13,"button",9),g("click",function(){return r.onCancel()}),m(14,"Cancel"),a(),t(15,"button",10),g("click",function(){return r.onPrint()}),m(16,"Cetak Pesanan"),a()()()),i&2&&(p(9),s("ngModel",r.tandaiSudahDicetak))},dependencies:[z,$,Lt,St,ft]});let n=l;return n})();var be=(()=>{let l=class l{constructor(e,i,r){this.http=e,this.toastr=i,this.dialog=r}getTokopediaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/Tokopedia/Multiple",{Orders:e}).pipe(B(i=>(i=i.map(r=>(r.ChannelType=D.Tokopedia,r)),i)))}getShopeeShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/shopee/Multiple",{Orders:e}).pipe(B(i=>(i=i.map(r=>(r.ChannelType=D.ShopeeV2,r)),i)))}getLazadaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/lazada/Multiple",{Orders:e}).pipe(B(i=>(i=i.map(r=>(r.ChannelType=D.Lazada,r)),i)))}printShippingLabelTokopedia(e){let i={OrderNumber:e,Printed:!0};this.dialog.open($t).afterClosed().pipe(Je(r=>r!==void 0),We(r=>(i.Printed=r,this.http.post("api/v1/Shippinglabel/Tokopedia",i)))).subscribe(r=>{let c=window.open("about:blank","_blank");c.document.write(r),c.document.close()})}printShippingLabelTiktok(e,i){let r={ShopID:i,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Tiktok",r).subscribe(c=>{c.data!=null?window.open(c.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(e,i){let r={ShopID:i,OrderNumber:e};this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",r).subscribe(c=>{var h=Uint8Array.from(atob(c),le=>le.charCodeAt(0)),E=new Blob([h],{type:"octet/stream"});w.openDownloadFile(E,`${e}.pdf`)})}printShippingLabelLazada(e,i){let r={ShopID:i,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",r).subscribe(c=>{c.result.data!=null?window.open(c.result.data.pdf_url,"_blank"):this.toastr.error(c.message,"Cannot Print")})}};l.\u0275fac=function(i){return new(i||l)(W(L),W(pe),W(ve))},l.\u0275prov=he({token:l,factory:l.\u0275fac,providedIn:"root"});let n=l;return n})();function Zt(n,l){if(n&1){let o=I();y(0),t(1,"button",13),g("click",function(){S(o);let i=d().ngIf,r=d();return C(r.onAcceptOrder(i))}),f(2,"i",14),m(3," Accept "),a(),T()}}function ei(n,l){if(n&1&&(y(0),_(1,Zt,4,0,"ng-container",1),T()),n&2){let o=d();p(1),s("ngIf",o.isTokopediaAvailable&&o.isTokopediaSelected)}}function ti(n,l){if(n&1&&(t(0,"span",15),f(1,"img",16),a(),m(2)),n&2){let o=l.item;p(1),s("src",o.img,M),p(1),x(" ",o.Name," ")}}function ii(n,l){if(n&1){let o=I();y(0),t(1,"th",28)(2,"input",29),g("ngModelChange",function(i){S(o);let r=d(3);return C(r.isCheckAll=i)})("ngModelChange",function(){S(o);let i=d(2).ngIf,r=d();return C(r.onSelectAllOrderData(i))}),a()(),T()}if(n&2){let o=d(3);p(2),s("ngModel",o.isCheckAll)}}function ni(n,l){if(n&1){let o=I();y(0),t(1,"input",29),g("ngModelChange",function(i){S(o);let r=d(2).$implicit;return C(r.selected=i)})("ngModelChange",function(){S(o);let i=d(4).ngIf,r=d();return C(r.onSelectOrderData(i))}),a(),T()}if(n&2){let o=d(2).$implicit;p(1),s("ngModel",o.selected)}}function ai(n,l){if(n&1&&(y(0),t(1,"td"),_(2,ni,2,1,"ng-container",1),a(),T()),n&2){let o=d().$implicit,e=d(3);p(2),s("ngIf",o.Type==e.tokopediaType)}}function ri(n,l){if(n&1&&(y(0),t(1,"span"),m(2),a(),T()),n&2){let o=d().$implicit;p(2),u(o.Number)}}function oi(n,l){if(n&1&&(t(0,"a",32),m(1),a()),n&2){let o=d().$implicit,e=d(3);s("href",e.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+o.ID,M),p(1),u(o.Number)}}function li(n,l){if(n&1&&(t(0,"tr"),_(1,ai,3,1,"ng-container",1),t(2,"td"),m(3),a(),t(4,"td"),_(5,ri,3,1,"ng-container",17)(6,oi,2,2,"ng-template",null,30,R),a(),t(8,"td"),m(9),a(),t(10,"td"),m(11),b(12,"date"),a(),t(13,"td"),f(14,"app-channel-logo",31),a()()),n&2){let o=l.$implicit,e=P(7),i=d(3);p(1),s("ngIf",i.isTokopediaAvailable),p(2),u(o.Outlet),p(2),s("ngIf",o.ID==i.guidEmpty)("ngIfElse",e),p(4),u(o.Customer),p(2),u(F(12,7,o.Created,"dd MMM yyyy HH:mm")),p(3),s("typeId",o.Type)}}function pi(n,l){if(n&1){let o=I();y(0),t(1,"div",18)(2,"table",19),g("matSortChange",function(i){S(o);let r=d(2);return C(r.onSort(i))}),t(3,"thead",20)(4,"tr",21),_(5,ii,3,1,"ng-container",1),t(6,"th",22),m(7,"Outlet"),a(),t(8,"th",23),m(9,"Order number"),a(),t(10,"th"),m(11,"Customer"),a(),t(12,"th",24),m(13,"Created On"),a(),t(14,"th",25),m(15,"Channel"),a()()(),t(16,"tbody"),_(17,li,15,10,"tr",26),a()(),t(18,"app-mat-paginator-no-count",27),g("total",function(){S(o);let i=d(2);return C(i.getPaginatonTotal())})("next",function(){S(o);let i=d(2);return C(i.onNextPage())})("previous",function(){S(o);let i=d(2);return C(i.onPreviousPage())}),b(19,"async"),b(20,"async"),a()(),T()}if(n&2){let o=d().ngIf,e=d(),i;p(5),s("ngIf",e.isTokopediaAvailable&&o),p(12),s("ngForOf",o),p(1),s("filter",e.filter)("totaldata",(i=N(19,5,e.newOrdersData$))==null?null:i.length)("paginationTotal",N(20,7,e.paginationTotal$))}}function mi(n,l){if(n&1&&(y(0),_(1,pi,21,9,"ng-container",17),T()),n&2){let o=l.ngIf;d();let e=P(31);p(1),s("ngIf",(o==null?null:o.length)>0)("ngIfElse",e)}}function si(n,l){n&1&&(t(0,"div",33),f(1,"app-empty-state"),a())}var Gt=(()=>{let l=class l{constructor(e,i,r,c,h,E){this.localDataService=e,this.channelService=i,this.orderService=r,this.toastr=c,this.acceptOrderService=h,this.shippingLabelService=E,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=w.GuidEMpty,this.tokopediaType=D.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.channels=e.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.getNewOrders()})}getNewOrders(){let e={PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.orderService.getNewOrders(e).pipe(we()),this.newOrdersData$=this.sourceObs$.pipe(Se(i=>{i.filter(c=>c.Type==D.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID,this.filter.From,this.filter.To).pipe(we())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(e){this.isTokopediaSelected=!1,e.filter(r=>r.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(e){e=e.map(i=>(i.Type==D.Tokopedia&&(i.selected=this.isCheckAll),i)),this.onSelectOrderData(e)}onAcceptOrder(e){let i=this.getSelectedTokopediaOrders(e);this.acceptOrderService.acceptTokopediaOrders(i).subscribe(r=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(e){return e.filter(r=>r.selected).map(r=>r.Number)}onSort(e){if(e.direction==""){this.newOrdersData$=this.sourceObs$;return}if(e.active=="created"){let i=e.direction=="asc";this.newOrdersData$=this.newOrdersData$.pipe(B(r=>(r=r.sort((c,h)=>w.compare(c.Created,h.Created,i)),r)))}}};l.\u0275fac=function(i){return new(i||l)(v(me),v(re),v(xe),v(pe),v($e),v(be))},l.\u0275cmp=O({type:l,selectors:[["app-new-order"]],decls:32,vars:15,consts:[["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"hideSearchBox","onSubmit"],[4,"ngIf"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],["EMPTY_STATE",""],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-check"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],["NOT_EMPTY",""],[3,"typeId"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(i,r){i&1&&(t(0,"mainpanel",0),g("onSubmit",function(){return r.getNewOrders()}),t(1,"actions"),_(2,ei,2,1,"ng-container",1),b(3,"async"),a(),t(4,"filters")(5,"div",2)(6,"div")(7,"h6"),m(8,"Channel"),a(),t(9,"ng-select",3),g("ngModelChange",function(h){return r.filter.ListChannelID=h}),_(10,ti,3,2,"ng-template",4),a()(),t(11,"div")(12,"h6"),m(13,"Page Number"),a(),t(14,"input",5),g("ngModelChange",function(h){return r.filter.PageNumber=h}),a()(),t(15,"div")(16,"h6"),m(17,"Page Size"),a(),t(18,"input",6),g("ngModelChange",function(h){return r.filter.PageSize=h}),a()(),t(19,"div")(20,"h6"),m(21,"From/To"),a(),t(22,"datepicker",7),g("dateChange",function(h){return r.filter.From=h}),a(),t(23,"datepicker",8),g("dateChange",function(h){return r.filter.To=h}),a()()()(),t(24,"content")(25,"div",9)(26,"div",10)(27,"div",11),_(28,mi,2,2,"ng-container",1),b(29,"async"),_(30,si,2,0,"ng-template",null,12,R),a()()()()()),i&2&&(s("hideSearchBox",!0),p(2),s("ngIf",N(3,11,r.newOrdersData$)),p(7),s("clearable",!0)("multiple",!0)("items",r.channels)("ngModel",r.filter.ListChannelID),p(5),s("ngModel",r.filter.PageNumber),p(4),s("ngModel",r.filter.PageSize),p(4),s("date",r.filter.From),p(1),s("date",r.filter.To),p(5),s("ngIf",N(29,13,r.newOrdersData$)))},dependencies:[A,V,U,Z,Re,z,$,j,q,ee,Y,ne,ae,te,ie,J,Fe,k]});let n=l;return n})();function di(n,l){if(n&1&&(t(0,"tr")(1,"td"),m(2),a(),t(3,"td"),m(4),b(5,"number"),a(),t(6,"td"),m(7),b(8,"number"),a()()),n&2){let o=l.$implicit;p(2),u(o.Code),p(2),u(N(5,3,o.Quantity)),p(3),u(N(8,5,o.Price))}}function ci(n,l){if(n&1&&(t(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),m(5,"Outlet Info"),a()(),t(6,"div",4)(7,"div",9),m(8," Outlet : "),a(),t(9,"div",9),m(10),a()(),t(11,"div",4)(12,"div",9),m(13," Date : "),a(),t(14,"div",9),m(15),b(16,"date"),a()(),t(17,"div",4)(18,"div",9),m(19," Status : "),a(),t(20,"div",9),m(21),a()(),t(22,"div",4)(23,"div",9),m(24," Tax Type : "),a(),t(25,"div",9),m(26),a()(),t(27,"div",4)(28,"div",9),m(29," Due Date : "),a(),t(30,"div",9),m(31),b(32,"date"),a()()(),t(33,"div",6)(34,"div",7)(35,"h3",8),m(36,"Customer Info"),a()(),t(37,"div",4)(38,"div",9),m(39," Name : "),a(),t(40,"div",9),m(41),a()(),t(42,"div",4)(43,"div",9),m(44," Email : "),a(),t(45,"div",9),m(46),a()(),t(47,"div",4)(48,"div",9),m(49," Mobile : "),a(),t(50,"div",9),m(51),a()()()(),t(52,"div",10)(53,"h3",11),m(54,"Products Sold"),a(),t(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),m(60,"Code"),a(),t(61,"th"),m(62,"Quantity"),a(),t(63,"th"),m(64,"Price"),a()()(),t(65,"tbody"),_(66,di,9,7,"tr",16),a()()()()()),n&2){let o=d();p(10),x(" ",o.model.Outlet," "),p(5),x(" ",F(16,9,o.model.Date,"dd MMM yyyy")," "),p(6),x(" ",o.model.Delivery," "),p(5),x(" ",o.model.TaxType," "),p(5),x(" ",F(32,12,o.model.DueDate,"dd MMM yyyy")," "),p(10),x(" ",o.model.Customer.Name," "),p(5),x(" ",o.model.Customer.Email," "),p(5),x(" ",o.model.Customer.Mobile," "),p(15),s("ngForOf",o.model.Variants)}}var hi=()=>["/menu/Order"],Bt=(()=>{let l=class l{constructor(e,i){this.http=e,this.url=i,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){var e={Number:this.number,Outlet:this.outlet};this.http.post("/api/orders/GetInvoiceDetail",e).subscribe(i=>{this.model=i})}};l.\u0275fac=function(i){return new(i||l)(v(L),v(Ae))},l.\u0275cmp=O({type:l,selectors:[["app-detail-order"]],decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],["class","row",4,"ngIf"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(i,r){i&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),m(3,"Back"),a()(),t(4,"content")(5,"div",2),_(6,ci,67,15,"div",3),a()()()),i&2&&(s("headerTitle","Order #"+r.number)("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("routerLink",K(5,hi)),p(4),s("ngIf",r.model))},dependencies:[A,V,j,Q,H,k]});let n=l;return n})();var se=function(n){return n.SPX="https://res.cloudinary.com/pos/image/upload/v1698216798/APP/Print%20Shipping%20Label/SPX_Logo.png",n.SICEPAT="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/SiCepat_Logo.png",n.JNT="https://res.cloudinary.com/pos/image/upload/v1698216792/APP/Print%20Shipping%20Label/J_T_Logo.png",n.ANTERAJA="https://res.cloudinary.com/pos/image/upload/v1698218271/APP/Print%20Shipping%20Label/anteraja_Logo.png",n.JNE="https://res.cloudinary.com/pos/image/upload/v1698216791/APP/Print%20Shipping%20Label/JNE_Logo.png",n.GRAB="https://res.cloudinary.com/pos/image/upload/v1698216794/APP/Print%20Shipping%20Label/GrabExpress_Logo.png",n.GOSEND="https://res.cloudinary.com/pos/image/upload/v1698218375/APP/Print%20Shipping%20Label/Gosend_Logo.png",n.LAZADA_EXPRESS="https://res.cloudinary.com/pos/image/upload/v1698914677/icons/Marketplace%20logo/lazada-Logistics.png",n}(se||{});var Oe=function(n){return n.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/Tokopedia_Logo.png",n.SHOPEE="https://res.cloudinary.com/pos/image/upload/v1698219243/APP/Print%20Shipping%20Label/shopee-logo.png",n.LAZADA="https://res.cloudinary.com/pos/image/upload/v1698912333/icons/Marketplace%20logo/Lazada_icon.png",n}(Oe||{});function gi(n,l){if(n&1&&(y(0),t(1,"div",35)(2,"div",12)(3,"div",36),m(4),a()(),t(5,"div",12)(6,"div",36),m(7),a()()(),T()),n&2){let o=d();p(4),x(" ",o.recipient==null?null:o.recipient.City," "),p(3),x(" ",o.recipient==null?null:o.recipient.District," ")}}function _i(n,l){if(n&1&&(y(0),t(1,"div")(2,"span",15),m(3,"Berat: "),a(),t(4,"span",18),m(5),a()(),T()),n&2){let o=d();p(5),x("",o.shippingLabel==null?null:o.shippingLabel.Weight," gr")}}function ui(n,l){if(n&1&&(y(0),t(1,"div",37)(2,"span",14),m(3,"Batas Kirim:"),a(),t(4,"span",18),m(5),b(6,"date"),a()(),T()),n&2){let o=d();p(5),u(F(6,1,o.logistic==null?null:o.logistic.Batas_kirim,"dd-MM-yyy"))}}function fi(n,l){if(n&1&&(y(0),t(1,"div",37)(2,"span",14),m(3,"No.Pesanan:"),a(),t(4,"span",18),m(5),a()(),T()),n&2){let o=d();p(5),u(o.shippingLabel==null?null:o.shippingLabel.OrderNumber)}}function Si(n,l){if(n&1&&(t(0,"tr")(1,"td",38),m(2),a(),t(3,"td"),m(4),a(),t(5,"td"),m(6),a(),t(7,"td"),m(8),b(9,"number"),a()()),n&2){let o=l.$implicit,e=l.index;p(2),u(e+1),p(2),u(o.Product_Name),p(2),u(o.SKU),p(2),u(N(9,4,o.Quantity))}}var Ge=(()=>{let l=class l{constructor(){this.minDate=w.MinDate,this.channelType=D}ngOnChanges(e){e.shippingLabel&&e.shippingLabel.currentValue&&(this.initShippingLabel(),this.getShippingLogo(),this.getChannelLogo())}ngAfterViewInit(){this.initBarcodeConfig()}getChannelLogo(){switch(this.shippingLabel.ChannelType){case D.Tokopedia:this.marketplaceLogo=Oe.TOKOPEDIA;break;case D.ShopeeV2:this.marketplaceLogo=Oe.SHOPEE;break;case D.Lazada:this.marketplaceLogo=Oe.LAZADA;break}}getShippingLogo(){let e=this.shippingLabel.Logistic.Logistic_Name;e=e?.toLowerCase(),e.includes("anteraja")?this.shippingLogo=se.ANTERAJA:e.includes("grabexpress")?this.shippingLogo=se.GRAB:e.includes("jne")?this.shippingLogo=se.JNE:e.includes("gosend")?this.shippingLogo=se.GOSEND:e.includes("j&t")?this.shippingLogo=se.JNT:e.includes("sicepat")?this.shippingLogo=se.SICEPAT:e.includes("spx")?this.shippingLogo=se.SPX:e.includes("lex")&&(this.shippingLogo=se.LAZADA_EXPRESS)}initShippingLabel(){this.recipient=this.shippingLabel.Recipient,this.store=this.shippingLabel.Store,this.products=this.shippingLabel.Products,this.logistic=this.shippingLabel.Logistic}initBarcodeConfig(){if(w.IsNotEmpty(this.logistic?.Resi_Number)){let e=this.logistic?.Resi_Number;JsBarcode(`#RESI${this.id}`,this.logistic?.Resi_Number,{displayValue:!1,width:e.length>15?1:1.5,height:40})}w.IsNotEmpty(this.shippingLabel?.OrderNumber)&&JsBarcode(`#NO${this.id}`,this.shippingLabel?.OrderNumber,{displayValue:!1,width:this.shippingLabel?.OrderNumber.length>15?.5:1,height:40})}};l.\u0275fac=function(i){return new(i||l)},l.\u0275cmp=O({type:l,selectors:[["app-shipping-label"]],inputs:{shippingLabel:"shippingLabel",id:"id"},standalone:!0,features:[Ke,Ze],decls:87,vars:20,consts:[[1,"label-container"],[2,"border","1px solid","padding","12px"],[1,"row","mb-2"],[1,"col-12"],[1,"d-flex","align-items-center","justify-content-between"],["width","105px",1,"border-0",3,"src"],[1,"mb-4"],[1,"row","mb-1"],[1,"text-center","fw-bold","border","p-2","fs-5","border-dark"],[1,"me-2"],[1,"col-12","text-center"],[3,"id"],[1,"col-6"],[1,"d-flex"],[1,"fw-bold","fs-6","me-1"],[1,"fw-bold","fs-6"],[1,"mt-2"],[1,"mb-0","fs-6"],[1,"fs-6"],[4,"ngIf"],[1,"row","px-6"],[1,"col-5","border","border-dark","border-end-0","text-center","p-2"],[1,"col-7","border","border-dark","p-2","text-center","fs-6"],[1,"fst-italic"],[1,"row"],[1,"col-5","pt-4",2,"padding-right","0px"],[1,"d-flex","justify-content-between"],[1,"col-7","text-center"],[1,"mt-1",3,"id"],[1,"table","table-sm","fs-6"],[1,"text-center",2,"width","5px"],[2,"width","150px"],[2,"width","50px"],[2,"width","25px"],[4,"ngFor","ngForOf"],[1,"row","mb-4"],[1,"text-center","fw-bold","border","p-2","fs-6","border-dark","text-uppercase"],[1,"mt-4"],[1,"text-center"]],template:function(i,r){i&1&&(t(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),f(6,"img",5),a(),t(7,"div")(8,"h4"),m(9),a()(),t(10,"div"),f(11,"img",5),a()()()(),t(12,"div",6),f(13,"hr"),a(),t(14,"div",7)(15,"div",3)(16,"div",8)(17,"span",9),m(18),a(),t(19,"span"),m(20),a()()()(),t(21,"div",7)(22,"div",10),Be(),f(23,"svg",11),a()(),He(),t(24,"div",6),f(25,"hr"),a(),t(26,"div",2)(27,"div",12)(28,"div",13)(29,"div",14),m(30,"Penerima: "),a(),t(31,"div",15),m(32),a()(),t(33,"div",16)(34,"span",15),m(35,"Alamat Pengiriman:"),a(),t(36,"div",17),m(37),a()()(),t(38,"div",12)(39,"div",13)(40,"div",14),m(41,"Pengirim: "),a(),t(42,"div")(43,"div",15),m(44),a(),t(45,"div",18),m(46),a(),t(47,"div",18),m(48),a()()(),f(49,"div"),a()(),_(50,gi,8,2,"ng-container",19),t(51,"div",20)(52,"div",21)(53,"div",15),m(54,"CASHLESS"),a()(),t(55,"div",22)(56,"small",23),m(57,"Penjual tidak perlu membayar ongkos kirim ke kurir"),a()()(),t(58,"div",24)(59,"div",25)(60,"div",26),_(61,_i,6,1,"ng-container",19),t(62,"div")(63,"span",15),m(64,"COD: "),a(),t(65,"span",18),m(66),b(67,"number"),a()()(),_(68,ui,7,4,"ng-container",19)(69,fi,6,1,"ng-container",19),a(),t(70,"div",27),Be(),f(71,"svg",28),a()()(),He(),t(72,"div",24)(73,"div",3)(74,"table",29)(75,"thead")(76,"tr")(77,"th",30),m(78,"No."),a(),t(79,"th",31),m(80,"Nama Produk"),a(),t(81,"th",32),m(82,"SKU"),a(),t(83,"th",33),m(84,"Qty"),a()()(),t(85,"tbody"),_(86,Si,10,6,"tr",34),a()()()()()),i&2&&(p(6),s("src",r.marketplaceLogo,M),p(3),u(r.logistic==null?null:r.logistic.Service),p(2),s("src",r.shippingLogo,M),p(7),x(" ",(r.shippingLabel==null?null:r.shippingLabel.ChannelType)==(r.channelType==null?null:r.channelType.Tokopedia)?"Kode Booking: ":"No. Resi: "," "),p(2),u(r.logistic==null?null:r.logistic.Resi_Number),p(3),s("id","RESI"+r.id),p(9),u(r.recipient==null?null:r.recipient.Name),p(5),x(" ",r.recipient==null?null:r.recipient.Address," "),p(7),u(r.store==null?null:r.store.Name),p(2),u(r.store==null?null:r.store.Phone),p(2),u(r.store==null?null:r.store.Address),p(2),s("ngIf",(r.recipient==null?null:r.recipient.City)&&(r.recipient==null?null:r.recipient.District)),p(11),s("ngIf",r.shippingLabel==null?null:r.shippingLabel.Weight),p(5),x("Rp. ",r.shippingLabel!=null&&r.shippingLabel.IsCOD?N(67,18,r.shippingLabel==null||r.shippingLabel.SummaryPrice==null?null:r.shippingLabel.SummaryPrice.Total):0,""),p(2),s("ngIf",(r.logistic==null?null:r.logistic.Batas_kirim)&&(r.logistic==null?null:r.logistic.Batas_kirim)!==r.minDate),p(1),s("ngIf",r.shippingLabel==null?null:r.shippingLabel.OrderNumber),p(2),s("id","NO"+r.id),p(15),s("ngForOf",r.products))},dependencies:[Ce,A,V,H,k],styles:[".table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border:none!important}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:capitalize;padding:4px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:none!important;padding:2px 2px 2px 5px!important;font-size:10px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.4509803922)}.label-container[_ngcontent-%COMP%]{width:465px;float:left}hr[_ngcontent-%COMP%]{opacity:.8;margin:0}"]});let n=l;return n})();function vi(n,l){if(n&1){let o=I();y(0),t(1,"button",15),g("click",function(){S(o);let i=d();return C(i.onPrintMultipleShippingLabel())}),f(2,"i",16),t(3,"span"),m(4,"Print Shipping Label"),a()(),T()}}function xi(n,l){if(n&1&&(t(0,"span",17),f(1,"img",18),a(),m(2)),n&2){let o=l.item;p(1),s("src",o.img,M),p(1),x(" ",o.Name," ")}}function bi(n,l){if(n&1){let o=I();y(0),t(1,"input",25),g("ngModelChange",function(i){S(o);let r=d().$implicit;return C(r.Selected=i)})("ngModelChange",function(){S(o);let i=d(3).ngIf,r=d();return C(r.onSelectReadyToShip(i))}),a(),T()}if(n&2){let o=d().$implicit;p(1),s("ngModel",o.Selected)}}var yi=()=>["/menu/Order/detail"],Ti=(n,l)=>({Number:n,Outlet:l});function wi(n,l){if(n&1&&(t(0,"a",38),m(1),a()),n&2){let o=d().$implicit;s("routerLink",K(3,yi))("queryParams",X(4,Ti,o.Number,o.Outlet)),p(1),u(o.Number)}}function Di(n,l){if(n&1&&(t(0,"a",39),m(1),a()),n&2){let o=d().$implicit,e=d(3);s("href",e.domain+o.ID,M),p(1),u(o.Number)}}function Ei(n,l){if(n&1){let o=I();t(0,"a",40),g("click",function(){S(o);let i=d().$implicit,r=d(3);return C(r.onPrintShippingLabel(i.Number,i.ShopID,i.TypeID))}),f(1,"i",41),a()}}function Ii(n,l){if(n&1&&(t(0,"tr")(1,"td"),_(2,bi,2,1,"ng-container",1),a(),t(3,"td"),m(4),a(),t(5,"td"),_(6,wi,2,7,"a",33)(7,Di,2,2,"a",34),a(),t(8,"td"),m(9),a(),t(10,"td"),m(11),b(12,"number"),a(),t(13,"td"),m(14),b(15,"date"),a(),t(16,"td"),f(17,"app-channel-logo",35),a(),t(18,"td",36),_(19,Ei,2,0,"a",37),a()()),n&2){let o=l.$implicit,e=d(3);p(2),s("ngIf",o.TypeID==e.channelType.ShopeeV2||o.TypeID==e.channelType.Tokopedia||o.TypeID==e.channelType.Tiktok),p(2),u(o.Outlet),p(2),s("ngIf",e.guidEmpty==o.ID),p(1),s("ngIf",e.guidEmpty!=o.ID),p(2),u(o.Customer),p(2),u(N(12,9,o.Amount)),p(3),u(F(15,11,o.Date,"dd MMM yyyy HH:mm")),p(3),s("typeId",o.TypeID),p(2),s("ngIf",o.TypeID==e.channelType.ShopeeV2||o.TypeID==e.channelType.Tokopedia||o.TypeID==e.channelType.Tiktok||o.TypeID==e.channelType.Lazada)}}function Pi(n,l){if(n&1){let o=I();y(0),t(1,"div",20)(2,"table",21),g("matSortChange",function(i){S(o);let r=d(2);return C(r.onSort(i))}),t(3,"thead",22)(4,"tr",23)(5,"th",24)(6,"input",25),g("ngModelChange",function(i){S(o);let r=d(2);return C(r.isCheckAll=i)})("ngModelChange",function(){S(o);let i=d().ngIf,r=d();return C(r.onSelectAllReadyToShip(i))}),a()(),t(7,"th",26),m(8,"Outlet"),a(),t(9,"th",27),m(10,"Order number"),a(),t(11,"th"),m(12,"Customer"),a(),t(13,"th",28),m(14,"Amount"),a(),t(15,"th",29),m(16,"Date"),a(),t(17,"th",30),m(18,"Channel"),a(),f(19,"th",31),a()(),t(20,"tbody"),_(21,Ii,20,14,"tr",14),a()(),t(22,"app-mat-paginator-no-count",32),g("total",function(){S(o);let i=d(2);return C(i.getRowCount())})("next",function(){S(o);let i=d(2);return C(i.NextPage())})("previous",function(){S(o);let i=d(2);return C(i.PreviousPage())}),b(23,"async"),b(24,"async"),a()(),T()}if(n&2){let o=d().ngIf,e=d(),i;p(6),s("ngModel",e.isCheckAll),p(15),s("ngForOf",o),p(1),s("filter",e.filter)("totaldata",(i=N(23,5,e.readyToShip$))==null?null:i.length)("paginationTotal",N(24,7,e.paginationTotal$))}}function Ni(n,l){if(n&1&&(y(0),_(1,Pi,25,9,"ng-container",19),T()),n&2){let o=l.ngIf;d();let e=P(30);p(1),s("ngIf",o.length>0)("ngIfElse",e)}}function Mi(n,l){n&1&&(t(0,"div",42),f(1,"app-empty-state"),a())}function Oi(n,l){n&1&&(y(0),t(1,"div",44),m(2,"\xA0"),a(),T())}function ki(n,l){if(n&1&&(y(0),f(1,"app-shipping-label",43),_(2,Oi,3,0,"ng-container",1),T()),n&2){let o=l.$implicit,e=l.index,i=d();p(1),s("shippingLabel",o)("id",e),p(1),s("ngIf",e!==(i.shippingLabels==null?null:i.shippingLabels.length)-1)}}var Ht=(()=>{let l=class l{constructor(e,i,r,c,h,E){this.http=e,this.localDataService=i,this.dialog=r,this.channelService=c,this.shippingLabelService=h,this.datePipe=E,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.channelType=D,this.guidEmpty=w.GuidEMpty,this.selectedReadyToShip=[],this.isCheckAll=!1}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.channels=e.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.getReadyToShip()})}getReadyToShip(e){var i={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.http.post("api/orders/GetReadyToShip",i).pipe(B(r=>r.Data),we(1)),this.readyToShip$=this.sourceObs$}onPrintMultipleShippingLabel(){let e=this.filterReadyToShipByChannel(this.selectedReadyToShip,D.Tokopedia),i=this.filterReadyToShipByChannel(this.selectedReadyToShip,D.ShopeeV2),r=[];e.length>0&&r.push(this.shippingLabelService.getTokopediaShippingLabel(this.shippingLabelPayload(e))),i.length>0&&r.push(this.shippingLabelService.getShopeeShippingLabel(this.shippingLabelPayload(i))),Ye(r).pipe(B(c=>c.reduce((h,E)=>h.concat(E),[]))).subscribe({next:c=>{this.shippingLabels=c,this.printShippingLabel()}})}filterReadyToShipByChannel(e,i){return e.filter(r=>r.TypeID==i)}shippingLabelPayload(e){return e.map(i=>({ShopID:i.ShopID,OrderNumber:i.Number}))}printShippingLabel(){setTimeout(()=>{this.setPdfname(),window.print()},500)}onPrintShippingLabel(e,i,r){switch(r){case D.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e);break;case D.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e,i);break;case D.ShopeeV2:this.shippingLabelService.printShippingLabelShopee(e,i);break;case D.Lazada:this.shippingLabelService.printShippingLabelLazada(e,i);break}}setPdfname(){if(this.selectedReadyToShip.length>1){let e=new Date,i=this.datePipe.transform(e,"dd-MM-yyyy"),r=this.datePipe.transform(e,"HH-mm");document.title=`ShippingLabel_${i}_${r}`}else{let e=this.selectedReadyToShip[0].Number;document.title=`ShippingLabel_${e}`}}getSelectedReadyToShip(e){return e.filter(i=>i.Selected)}getRowCount(){var e={PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.paginationTotal$=this.http.post("api/orders/GetRowCount",e).pipe(B(i=>i?.Total))}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getReadyToShip()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getReadyToShip()}onSort(e){if(e.direction==""){this.readyToShip$=this.sourceObs$;return}if(e.active=="date"){let i=e.direction=="asc";this.readyToShip$=this.readyToShip$.pipe(B(r=>r.sort((c,h)=>w.compare(c.Date,h.Date,i))))}}onSelectReadyToShip(e){this.selectedReadyToShip=this.getSelectedReadyToShip(e)}onSelectAllReadyToShip(e){e=e.map(i=>((i.TypeID==D.Tokopedia||i.TypeID==D.ShopeeV2||i.TypeID==D.Lazada)&&(i.Selected=this.isCheckAll),i)),this.selectedReadyToShip=this.getSelectedReadyToShip(e)}};l.\u0275fac=function(i){return new(i||l)(v(L),v(me),v(ve),v(re),v(be),v(k))},l.\u0275cmp=O({type:l,selectors:[["app-ready-to-ship"]],decls:33,vars:13,consts:[["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],[4,"ngIf"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],["EMPTY_STATE",""],[1,"print_containers"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","date",2,"width","130px"],[2,"width","114px"],[2,"width","10px"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"shippingLabel","id"],[1,"page-break"]],template:function(i,r){i&1&&(t(0,"mainpanel",0),g("onSubmit",function(h){return r.getReadyToShip(h)}),t(1,"actions"),_(2,vi,5,0,"ng-container",1),a(),t(3,"filters")(4,"div",2)(5,"div")(6,"h6"),m(7,"Channel"),a(),t(8,"ng-select",3),g("ngModelChange",function(h){return r.filter.ListChannelID=h}),_(9,xi,3,2,"ng-template",4),a()(),t(10,"div")(11,"h6"),m(12,"Page Number"),a(),t(13,"input",5),g("ngModelChange",function(h){return r.filter.PageNumber=h}),a()(),t(14,"div")(15,"h6"),m(16,"Page Size"),a(),t(17,"input",6),g("ngModelChange",function(h){return r.filter.PageSize=h}),a()(),t(18,"div")(19,"h6"),m(20,"From/To"),a(),t(21,"datepicker",7),g("dateChange",function(h){return r.filter.From=h}),a(),t(22,"datepicker",8),g("dateChange",function(h){return r.filter.To=h}),a()()()(),t(23,"content")(24,"div",9)(25,"div",10)(26,"div",11),_(27,Ni,2,2,"ng-container",1),b(28,"async"),_(29,Mi,2,0,"ng-template",null,12,R),a()()()()(),t(31,"div",13),_(32,ki,3,3,"ng-container",14),a()),i&2&&(p(2),s("ngIf",r.selectedReadyToShip.length>0),p(6),s("clearable",!0)("multiple",!0)("items",r.channels)("ngModel",r.filter.ListChannelID),p(5),s("ngModel",r.filter.PageNumber),p(4),s("ngModel",r.filter.PageSize),p(4),s("date",r.filter.From),p(1),s("date",r.filter.To),p(5),s("ngIf",N(28,11,r.readyToShip$)),p(5),s("ngForOf",r.shippingLabels))},dependencies:[A,V,U,Z,Re,z,$,j,Q,q,ee,Y,ne,ae,te,ie,J,Ge,Fe,H,k],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block}}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]});let n=l;return n})();function Li(n,l){if(n&1&&(t(0,"span",13),f(1,"img",14),a(),m(2)),n&2){let o=l.item;p(1),s("src",o.img,M),p(1),x(" ",o.Name," ")}}var Fi=()=>["/menu/Order/detail"],Ai=(n,l)=>({Number:n,Outlet:l});function Vi(n,l){if(n&1&&(t(0,"a",29),m(1),a()),n&2){let o=d().$implicit;s("routerLink",K(3,Fi))("queryParams",X(4,Ai,o.Number,o.Outlet)),p(1),u(o.Number)}}function Ri(n,l){if(n&1&&(t(0,"a",30),m(1),a()),n&2){let o=d().$implicit,e=d(2);s("href",e.domain+o.ID,M),p(1),u(o.Number)}}function zi(n,l){if(n&1&&(t(0,"tr")(1,"td"),m(2),a(),t(3,"td"),_(4,Vi,2,7,"a",26)(5,Ri,2,2,"a",27),a(),t(6,"td"),m(7),a(),t(8,"td"),m(9),b(10,"number"),a(),t(11,"td"),m(12),b(13,"date"),a(),t(14,"td"),f(15,"app-channel-logo",28),a()()),n&2){let o=l.$implicit,e=d(2);p(2),u(o.Outlet),p(2),s("ngIf",e.hasGuidEmpty(o.ID)),p(1),s("ngIf",!e.hasGuidEmpty(o.ID)),p(2),u(o.Customer),p(2),u(N(10,7,o.Amount)),p(3),u(F(13,9,o.Created,"dd MMM yyyy HH:mm")),p(3),s("typeId",o.TypeID)}}function $i(n,l){if(n&1){let o=I();y(0),t(1,"div",15)(2,"table",16),g("matSortChange",function(i){S(o);let r=d();return C(r.onSort(i))}),t(3,"thead",17)(4,"tr",18)(5,"th",19),m(6,"Outlet"),a(),t(7,"th",20),m(8,"Order number"),a(),t(9,"th"),m(10,"Customer"),a(),t(11,"th",21),m(12,"Amount"),a(),t(13,"th",22),m(14,"Created On"),a(),t(15,"th",23),m(16,"Channel"),a()()(),t(17,"tbody"),_(18,zi,16,12,"tr",24),a()(),t(19,"app-mat-paginator-no-count",25),g("total",function(){S(o);let i=d();return C(i.StoreRowsCountAPIResult())})("next",function(){S(o);let i=d();return C(i.NextPage())})("previous",function(){S(o);let i=d();return C(i.PreviousPage())}),a()(),T()}if(n&2){let o=d();p(18),s("ngForOf",o.data),p(1),s("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function ji(n,l){n&1&&(t(0,"div",31),f(1,"app-empty-state"),a())}var Ut=(()=>{let l=class l{constructor(e,i,r){this.http=e,this.localDataService=i,this.channelService=r,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=D}ngOnInit(){this.Load()}getChannelLogo(e){return w.getChannelLogoByTypeId(e)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.channels=e.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(e){return e==w.GuidEMpty}Get(e){var i={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetShipped",i).subscribe(r=>{this.data=r.Data,this.sourceData=[...r.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Unpaid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(i=>{this.paginationTotal=i.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let i=e.direction=="asc";this.data=this.data.sort((r,c)=>w.compare(r.Created,c.Created,i))}}};l.\u0275fac=function(i){return new(i||l)(v(L),v(me),v(re))},l.\u0275cmp=O({type:l,selectors:[["app-shipped"]],decls:28,vars:10,consts:[["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(i,r){if(i&1&&(t(0,"mainpanel",0),g("onSubmit",function(h){return r.Get(h)}),t(1,"filters")(2,"div",1)(3,"div")(4,"h6"),m(5,"Channel"),a(),t(6,"ng-select",2),g("ngModelChange",function(h){return r.filter.ListChannelID=h}),_(7,Li,3,2,"ng-template",3),a()(),t(8,"div")(9,"h6"),m(10,"Page Number"),a(),t(11,"input",4),g("ngModelChange",function(h){return r.filter.PageNumber=h}),a()(),t(12,"div")(13,"h6"),m(14,"Page Size"),a(),t(15,"input",5),g("ngModelChange",function(h){return r.filter.PageSize=h}),a()(),t(16,"div")(17,"h6"),m(18,"From/To"),a(),t(19,"datepicker",6),g("dateChange",function(h){return r.filter.From=h}),a(),t(20,"datepicker",7),g("dateChange",function(h){return r.filter.To=h}),a()()()(),t(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),_(25,$i,20,4,"ng-container",11)(26,ji,2,0,"ng-template",null,12,R),a()()()()()),i&2){let c=P(27);p(6),s("clearable",!0)("multiple",!0)("items",r.channels)("ngModel",r.filter.ListChannelID),p(5),s("ngModel",r.filter.PageNumber),p(4),s("ngModel",r.filter.PageSize),p(4),s("date",r.filter.From),p(1),s("date",r.filter.To),p(5),s("ngIf",r.data&&r.data.length>0)("ngIfElse",c)}},dependencies:[A,V,U,Z,z,$,j,Q,q,ee,Y,ne,ae,te,ie,J,H,k]});let n=l;return n})();function Gi(n,l){if(n&1&&(t(0,"span",13),f(1,"img",14),a(),m(2)),n&2){let o=l.item;p(1),s("src",o.img,M),p(1),x(" ",o.Name," ")}}var Bi=()=>["/menu/Order/detail"],Hi=(n,l)=>({Number:n,Outlet:l});function Ui(n,l){if(n&1&&(t(0,"a",29),m(1),a()),n&2){let o=d().$implicit;s("routerLink",K(3,Bi))("queryParams",X(4,Hi,o.Number,o.Outlet)),p(1),u(o.Number)}}function qi(n,l){if(n&1&&(t(0,"a",30),m(1),a()),n&2){let o=d().$implicit,e=d(2);s("href",e.customerInfoUrl+o.ID,M),p(1),u(o.Number)}}function Yi(n,l){if(n&1&&(t(0,"tr")(1,"td"),m(2),a(),t(3,"td"),_(4,Ui,2,7,"a",26)(5,qi,2,2,"a",27),a(),t(6,"td"),m(7),a(),t(8,"td"),m(9),b(10,"number"),a(),t(11,"td"),m(12),b(13,"date"),a(),t(14,"td"),f(15,"app-channel-logo",28),a()()),n&2){let o=l.$implicit,e=d(2);p(2),u(o.Outlet),p(2),s("ngIf",e.hasGuidEmpty(o.ID)),p(1),s("ngIf",!e.hasGuidEmpty(o.ID)),p(2),u(o.Customer),p(2),u(N(10,7,o.Amount)),p(3),u(F(13,9,o.Created,"dd MMM yyyy HH:mm")),p(3),s("typeId",o.TypeID)}}function Ji(n,l){if(n&1){let o=I();y(0),t(1,"div",15)(2,"table",16),g("matSortChange",function(i){S(o);let r=d();return C(r.onSort(i))}),t(3,"thead",17)(4,"tr",18)(5,"th",19),m(6,"Outlet"),a(),t(7,"th",20),m(8,"Order number"),a(),t(9,"th"),m(10,"Customer"),a(),t(11,"th",21),m(12,"Amount"),a(),t(13,"th",22),m(14,"Created On"),a(),t(15,"th",23),m(16,"Channel"),a()()(),t(17,"tbody"),_(18,Yi,16,12,"tr",24),a()(),t(19,"app-mat-paginator-no-count",25),g("total",function(){S(o);let i=d();return C(i.StoreRowsCountAPIResult())})("next",function(){S(o);let i=d();return C(i.NextPage())})("previous",function(){S(o);let i=d();return C(i.PreviousPage())}),a()(),T()}if(n&2){let o=d();p(18),s("ngForOf",o.data),p(1),s("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function Wi(n,l){n&1&&(t(0,"div",31),f(1,"app-empty-state"),a())}var qt=(()=>{let l=class l{constructor(e,i,r){this.http=e,this.authService=i,this.channelService=r,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=D}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==w.GuidEMpty}getChannelLogo(e){return w.getChannelLogoByTypeId(e)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.channels=e.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var i={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetDelivered ",i).subscribe(r=>{this.data=r.Data,this.sourceData=[...r.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Paid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(i=>{this.paginationTotal=i.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let i=e.direction=="asc";this.data=this.data.sort((r,c)=>w.compare(r.Created,c.Created,i))}}};l.\u0275fac=function(i){return new(i||l)(v(L),v(rt),v(re))},l.\u0275cmp=O({type:l,selectors:[["app-delivered"]],decls:28,vars:11,consts:[["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(i,r){if(i&1&&(t(0,"mainpanel",0),g("onSubmit",function(h){return r.Get(h)}),t(1,"filters")(2,"div",1)(3,"div")(4,"h6"),m(5,"Channel"),a(),t(6,"ng-select",2),g("ngModelChange",function(h){return r.filter.ListChannelID=h}),_(7,Gi,3,2,"ng-template",3),a()(),t(8,"div")(9,"h6"),m(10,"Page Number"),a(),t(11,"input",4),g("ngModelChange",function(h){return r.filter.PageNumber=h}),a()(),t(12,"div")(13,"h6"),m(14,"Page Size"),a(),t(15,"input",5),g("ngModelChange",function(h){return r.filter.PageSize=h}),a()(),t(16,"div")(17,"h6"),m(18,"From/To"),a(),t(19,"datepicker",6),g("dateChange",function(h){return r.filter.From=h}),a(),t(20,"datepicker",7),g("dateChange",function(h){return r.filter.To=h}),a()()()(),t(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),_(25,Ji,20,4,"ng-container",11)(26,Wi,2,0,"ng-template",null,12,R),a()()()()()),i&2){let c=P(27);s("hideSearchBox",!0),p(6),s("clearable",!0)("multiple",!0)("items",r.channels)("ngModel",r.filter.ListChannelID),p(5),s("ngModel",r.filter.PageNumber),p(4),s("ngModel",r.filter.PageSize),p(4),s("date",r.filter.From),p(1),s("date",r.filter.To),p(5),s("ngIf",r.data&&r.data.length>0)("ngIfElse",c)}},dependencies:[A,V,U,Z,z,$,j,Q,q,ee,Y,ne,ae,te,ie,J,H,k]});let n=l;return n})();function Ki(n,l){if(n&1&&(t(0,"span",13),f(1,"img",14),a(),m(2)),n&2){let o=l.item;p(1),s("src",o.img,M),p(1),x(" ",o.Name," ")}}var Xi=()=>["/menu/Order/detail"],Qi=(n,l)=>({Number:n,Outlet:l});function Zi(n,l){if(n&1&&(t(0,"a",30),m(1),a()),n&2){let o=d().$implicit;s("routerLink",K(3,Xi))("queryParams",X(4,Qi,o.Number,o.Outlet)),p(1),u(o.Number)}}function en(n,l){if(n&1&&(t(0,"a",31),m(1),a()),n&2){let o=d().$implicit,e=d(2);s("href",e.domain+o.ID,M),p(1),u(o.Number)}}function tn(n,l){if(n&1&&(t(0,"tr")(1,"td"),m(2),a(),t(3,"td"),_(4,Zi,2,7,"a",27)(5,en,2,2,"a",28),a(),t(6,"td"),m(7),a(),t(8,"td"),m(9),b(10,"number"),a(),t(11,"td"),m(12),b(13,"date"),a(),t(14,"td"),m(15),a(),t(16,"td"),f(17,"app-channel-logo",29),a()()),n&2){let o=l.$implicit,e=d(2);p(2),u(o.Outlet),p(2),s("ngIf",e.hasGuidEmpty(o.ID)),p(1),s("ngIf",!e.hasGuidEmpty(o.ID)),p(2),u(o.Customer),p(2),u(N(10,8,o.Amount)),p(3),u(F(13,10,o.Created,"dd MMM yyyy HH:mm")),p(3),u(o.State),p(2),s("typeId",o.TypeID)}}function nn(n,l){if(n&1){let o=I();y(0),t(1,"div",15)(2,"table",16),g("matSortChange",function(i){S(o);let r=d();return C(r.onSort(i))}),t(3,"thead",17)(4,"tr",18)(5,"th",19),m(6,"Outlet"),a(),t(7,"th",20),m(8,"Order number"),a(),t(9,"th"),m(10,"Customer"),a(),t(11,"th",21),m(12,"Amount"),a(),t(13,"th",22),m(14,"Created On"),a(),t(15,"th",23),m(16,"Status"),a(),t(17,"th",24),m(18,"Channel"),a()()(),t(19,"tbody"),_(20,tn,18,13,"tr",25),a()(),t(21,"app-mat-paginator-no-count",26),g("total",function(){S(o);let i=d();return C(i.StoreRowsCountAPIResult())})("next",function(){S(o);let i=d();return C(i.NextPage())})("previous",function(){S(o);let i=d();return C(i.PreviousPage())}),a()(),T()}if(n&2){let o=d();p(20),s("ngForOf",o.data),p(1),s("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function an(n,l){n&1&&(t(0,"div",32),f(1,"app-empty-state"),a())}var Yt=(()=>{let l=class l{constructor(e,i,r){this.http=e,this.localDataService=i,this.channelService=r,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==w.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.channels=e.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var i={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetAll ",i).subscribe(r=>{this.data=r.Data,this.sourceData=[...r.Data],this.totaldata=this.data.length})}changePage(e){this.filter=e,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(i=>{this.paginationTotal=i.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let i=e.direction=="asc";this.data=this.data.sort((r,c)=>w.compare(r.Created,c.Created,i))}}};l.\u0275fac=function(i){return new(i||l)(v(L),v(me),v(re))},l.\u0275cmp=O({type:l,selectors:[["app-all-order"]],decls:28,vars:10,consts:[["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","135px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(i,r){if(i&1&&(t(0,"mainpanel",0),g("onSubmit",function(h){return r.Get(h)}),t(1,"filters")(2,"div",1)(3,"div")(4,"h6"),m(5,"Channel"),a(),t(6,"ng-select",2),g("ngModelChange",function(h){return r.filter.ListChannelID=h}),_(7,Ki,3,2,"ng-template",3),a()(),t(8,"div")(9,"h6"),m(10,"Page Number"),a(),t(11,"input",4),g("ngModelChange",function(h){return r.filter.PageNumber=h}),a()(),t(12,"div")(13,"h6"),m(14,"Page Size"),a(),t(15,"input",5),g("ngModelChange",function(h){return r.filter.PageSize=h}),a()(),t(16,"div")(17,"h6"),m(18,"From/To"),a(),t(19,"datepicker",6),g("dateChange",function(h){return r.filter.From=h}),a(),t(20,"datepicker",7),g("dateChange",function(h){return r.filter.To=h}),a()()()(),t(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),_(25,nn,22,4,"ng-container",11)(26,an,2,0,"ng-template",null,12,R),a()()()()()),i&2){let c=P(27);p(6),s("clearable",!0)("multiple",!0)("items",r.channels)("ngModel",r.filter.ListChannelID),p(5),s("ngModel",r.filter.PageNumber),p(4),s("ngModel",r.filter.PageSize),p(4),s("date",r.filter.From),p(1),s("date",r.filter.To),p(5),s("ngIf",r.data&&r.data.length>0)("ngIfElse",c)}},dependencies:[A,V,U,Z,z,$,j,Q,q,ee,Y,ne,ae,te,ie,J,H,k]});let n=l;return n})();function rn(n,l){if(n&1&&(t(0,"span",14),f(1,"img",15),a(),m(2)),n&2){let o=l.item;p(1),s("src",o.img,M),p(1),x(" ",o.Name," ")}}var on=()=>["/menu/Order/detail"],ln=(n,l)=>({Number:n,Outlet:l});function pn(n,l){if(n&1&&(t(0,"a",30),m(1),a()),n&2){let o=d().$implicit;s("routerLink",K(3,on))("queryParams",X(4,ln,o.Number,o.Outlet)),p(1),u(o.Number)}}function mn(n,l){if(n&1&&(t(0,"a",31),m(1),a()),n&2){let o=d().$implicit,e=d(2);s("href",e.domain+o.ID,M),p(1),u(o.Number)}}function sn(n,l){if(n&1&&(t(0,"tr")(1,"td"),m(2),a(),t(3,"td"),_(4,pn,2,7,"a",27)(5,mn,2,2,"a",28),a(),t(6,"td"),m(7),a(),t(8,"td"),m(9),b(10,"number"),a(),t(11,"td"),m(12),b(13,"date"),a(),t(14,"td"),f(15,"app-channel-logo",29),a()()),n&2){let o=l.$implicit,e=d(2);p(2),u(o.Outlet),p(2),s("ngIf",e.hasGuidEmpty(o.ID)),p(1),s("ngIf",!e.hasGuidEmpty(o.ID)),p(2),u(o.Customer),p(2),u(N(10,7,o.Amount)),p(3),u(F(13,9,o.Created,"dd MMM yyyy HH:mm")),p(3),s("typeId",o.TypeID)}}function dn(n,l){if(n&1){let o=I();y(0),t(1,"div",16)(2,"table",17),g("matSortChange",function(i){S(o);let r=d();return C(r.onSort(i))}),t(3,"thead",18)(4,"tr",19)(5,"th",20),m(6,"Outlet"),a(),t(7,"th",21),m(8,"Order number"),a(),t(9,"th"),m(10,"Customer"),a(),t(11,"th",22),m(12,"Amount"),a(),t(13,"th",23),m(14,"Created On"),a(),t(15,"th",24),m(16,"Channel"),a()()(),t(17,"tbody"),_(18,sn,16,12,"tr",25),a()(),t(19,"app-mat-paginator-no-count",26),g("total",function(){S(o);let i=d();return C(i.StoreRowsCountAPIResult())})("next",function(){S(o);let i=d();return C(i.NextPage())})("previous",function(){S(o);let i=d();return C(i.PreviousPage())}),a()(),T()}if(n&2){let o=d();p(18),s("ngForOf",o.data),p(1),s("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function cn(n,l){n&1&&(t(0,"div",32),f(1,"app-empty-state"),a())}var Jt=(()=>{let l=class l{constructor(e,i,r){this.http=e,this.localDataService=i,this.channelService=r,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],Note:"",From:null,To:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==w.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.channels=e.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var i={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,Note:this.filter.Note,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetCancelled ",i).subscribe(r=>{this.data=r.Data,this.sourceData=[...r.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!0,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(i=>{this.paginationTotal=i.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(e){return w.getChannelLogoByTypeId(e)}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let i=e.direction=="asc";this.data=this.data.sort((r,c)=>w.compare(r.Created,c.Created,i))}}};l.\u0275fac=function(i){return new(i||l)(v(L),v(me),v(re))},l.\u0275cmp=O({type:l,selectors:[["app-cancelled"]],decls:32,vars:11,consts:[["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["type","text","name","Note",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(i,r){if(i&1&&(t(0,"mainpanel",0),g("onSubmit",function(h){return r.Get(h)}),t(1,"filters")(2,"div",1)(3,"div")(4,"h6"),m(5,"Channel"),a(),t(6,"ng-select",2),g("ngModelChange",function(h){return r.filter.ListChannelID=h}),_(7,rn,3,2,"ng-template",3),a()(),t(8,"div")(9,"h6"),m(10,"Page Number"),a(),t(11,"input",4),g("ngModelChange",function(h){return r.filter.PageNumber=h}),a()(),t(12,"div")(13,"h6"),m(14,"Page Size"),a(),t(15,"input",5),g("ngModelChange",function(h){return r.filter.PageSize=h}),a()(),t(16,"div")(17,"h6"),m(18,"Note"),a(),t(19,"input",6),g("ngModelChange",function(h){return r.filter.Note=h}),a()(),t(20,"div")(21,"h6"),m(22,"From/To"),a(),t(23,"datepicker",7),g("dateChange",function(h){return r.filter.From=h}),a(),t(24,"datepicker",8),g("dateChange",function(h){return r.filter.To=h}),a()()()(),t(25,"content")(26,"div",9)(27,"div",10)(28,"div",11),_(29,dn,20,4,"ng-container",12)(30,cn,2,0,"ng-template",null,13,R),a()()()()()),i&2){let c=P(31);p(6),s("clearable",!0)("multiple",!0)("items",r.channels)("ngModel",r.filter.ListChannelID),p(5),s("ngModel",r.filter.PageNumber),p(4),s("ngModel",r.filter.PageSize),p(4),s("ngModel",r.filter.Note),p(4),s("date",r.filter.From),p(1),s("date",r.filter.To),p(5),s("ngIf",r.data&&r.data.length>0)("ngIfElse",c)}},dependencies:[A,V,U,Z,z,$,j,Q,q,ee,Y,ne,ae,te,ie,J,H,k]});let n=l;return n})();var Te=function(n){return n[n.DoNothing=0]="DoNothing",n[n.New=1]="New",n[n.Update=2]="Update",n}(Te||{});function hn(n,l){if(n&1){let o=I();y(0),t(1,"div",28)(2,"button",29),g("click",function(){S(o),d();let i=P(11);return C(i.previous())}),m(3," Back "),a(),t(4,"button",30),g("click",function(){S(o);let i=d(),r=P(11);return C(i.onNext(r))}),m(5," Next "),a(),t(6,"button",31),f(7,"b",32),a(),t(8,"ul",33)(9,"li",34)(10,"a",35),g("click",function(){S(o);let i=d();return C(i.exportOrders())}),m(11," Export "),a()()()(),T()}if(n&2){let o=d();p(4),s("disabled",o.checkDisabledNextFilter())}}function gn(n,l){if(n&1){let o=I();t(0,"button",36),g("click",function(){S(o);let i=d(),r=P(11);return C(i.onNext(r))}),m(1," Next "),a()}if(n&2){let o=d();s("disabled",o.checkDisabledNextFilter())}}function _n(n,l){if(n&1){let o=I();t(0,"button",37),g("click",function(){S(o);let i=d(),r=P(11);return C(i.onNew(r))}),f(1,"i",38),m(2," New "),a()}}function un(n,l){n&1&&m(0,"Filter")}function fn(n,l){if(n&1&&(t(0,"ng-option",39),f(1,"img",40),m(2),a()),n&2){let o=l.$implicit;s("value",o.ID),p(1),Ue("src",o.Img,M),p(1),x("",o.Name," ")}}function Sn(n,l){n&1&&m(0,"Preview")}function Cn(n,l){if(n&1&&(t(0,"th",58),m(1),a()),n&2){let o=d(2);p(1),u(o.getTypeID()==0?"Last Status Update":"Created Date")}}function vn(n,l){if(n&1&&(t(0,"td"),m(1),b(2,"date"),a()),n&2){let o=d().$implicit;p(1),x(" ",F(2,1,o.Date,"dd MMM yyyy HH:mm:ss"),"")}}function xn(n,l){if(n&1&&(t(0,"span"),m(1),a()),n&2){let o=d().$implicit;p(1),x(" ",o.ActionString," ")}}function bn(n,l){if(n&1&&(t(0,"li"),m(1),a()),n&2){let o=l.$implicit;p(1),x("",o," ")}}function yn(n,l){if(n&1&&(t(0,"ul",63),_(1,bn,2,1,"li",59),a()),n&2){let o=d().$implicit;p(1),s("ngForOf",o.ActionString)}}function Tn(n,l){if(n&1&&(t(0,"span",64),f(1,"i",65),a()),n&2){let o=d().$implicit;Xe("title","Delivery : ",o.DeliveryState,`
|
|
6
|
-
Payment : `,o.PaymentState,"")}}var wn=(n,l)=>({"over-due-today":n,"over-due":l});function Dn(n,l){if(n&1&&(t(0,"tr")(1,"td"),m(2),a(),t(3,"td"),m(4),a(),_(5,vn,3,4,"td",1),t(6,"td")(7,"span"),m(8),a(),m(9),a(),t(10,"td",60)(11,"span"),m(12),a(),m(13),a(),t(14,"td"),_(15,xn,2,1,"span",1)(16,yn,2,1,"ul",61),a(),t(17,"td"),_(18,Tn,2,2,"span",62),a()()),n&2){let o=l.$implicit,e=l.index,i=d(3);p(2),u(e+1),p(2),u(o.Number),p(1),s("ngIf",i.getTypeID()!=i.channelType.ShopeeV2),p(3),x("",o.ChannelStatus," - "),p(1),u(o.ChannelStatusDescription),p(1),s("ngClass",X(12,wn,(o==null?null:o.Action)==i.actionPreviewOrder.Update,(o==null?null:o.Action)==i.actionPreviewOrder.New))("matTooltip",o.POSStatus==91||o.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),p(2),x("",o.POSStatus," - "),p(1),x("",o.POSStatusDescription," "),p(2),s("ngIf",o.ActionString.length==1),p(1),s("ngIf",o.ActionString.length>1),p(2),s("ngIf",o.ChannelStatus!=99&&o.POSStatus!=99)}}function En(n,l){if(n&1&&(y(0),_(1,Dn,19,15,"tr",59),T()),n&2){let o=d(2);p(1),s("ngForOf",o.displayedPreviewData)}}function In(n,l){n&1&&(t(0,"tr",66)(1,"td",67)(2,"div",68),f(3,"i",69),a(),t(4,"h4",70),m(5,"There is no order to processed"),a()()())}function Pn(n,l){if(n&1){let o=I();t(0,"div",41)(1,"div",42)(2,"div",43)(3,"ul",44)(4,"li",45)(5,"button",46),g("click",function(){S(o);let i=d();return C(i.filterPreviewData(i.previewStatus.ALL))}),m(6),a()(),t(7,"li",45)(8,"button",47),g("click",function(){S(o);let i=d();return C(i.filterPreviewData(i.previewStatus.SYNC))}),m(9),a()(),t(10,"li",45)(11,"button",48),g("click",function(){S(o);let i=d();return C(i.filterPreviewData(i.previewStatus.WRONG))}),m(12),a()(),t(13,"li",45)(14,"button",49),g("click",function(){S(o);let i=d();return C(i.filterPreviewData(i.previewStatus.UNSYNC))}),m(15),a()()()(),t(16,"table",50)(17,"thead",51)(18,"tr"),f(19,"th",52),t(20,"th",53),m(21,"Number"),a(),_(22,Cn,2,1,"th",54),t(23,"th",55),m(24,"Channel Status"),a(),t(25,"th",55),m(26,"POS Status"),a(),t(27,"th"),m(28,"Action"),a(),f(29,"th",52),a()(),t(30,"tbody"),_(31,En,2,1,"ng-container",56)(32,In,6,0,"ng-template",null,57,R),a()()()()}if(n&2){let o=P(33),e=d();p(5),s("ngClass",e.pillStatus=="all"?"btn-secondary text-white":"btn-outline-dark"),p(1),x("All (",e.allData,")"),p(2),s("ngClass",e.pillStatus=="sync"?"btn-success":"btn-outline-success"),p(1),x("Existing (",e.syncData,")"),p(2),s("ngClass",e.pillStatus=="wrong"?"btn-warning text-white":"btn-outline-warning"),p(1),x("Wrong Status (",e.wrongData,")"),p(2),s("ngClass",e.pillStatus=="unsync"?"btn-danger":"btn-outline-danger"),p(1),x("Missing (",e.unsyncData,")"),p(7),s("ngIf",e.getTypeID()!=e.channelType.ShopeeV2),p(9),s("ngIf",e.displayedPreviewData.length>0)("ngIfElse",o)}}function Nn(n,l){n&1&&m(0,"Finish")}var Mn=n=>({"over-due":n});function On(n,l){if(n&1&&(t(0,"tr",73)(1,"td"),m(2),a(),t(3,"td"),m(4),a(),t(5,"td"),m(6),a(),t(7,"td"),m(8),a()()),n&2){let o=l.$implicit,e=l.index;s("ngClass",et(5,Mn,o.Exception)),p(2),u(e+1),p(2),u(o.Number),p(2),u(o.Status),p(2),u(o.Exception)}}function kn(n,l){if(n&1&&(y(0),_(1,On,9,7,"tr",72),T()),n&2){let o=d(2);p(1),s("ngForOf",o.downloadData)}}function Ln(n,l){n&1&&(t(0,"tr",66)(1,"td",67)(2,"div",68),f(3,"i",69),a(),t(4,"h4",70),m(5,"There is no order to processed"),a()()())}function Fn(n,l){if(n&1&&(t(0,"div",41)(1,"div",42)(2,"table",50)(3,"thead",51)(4,"tr"),f(5,"th",52),t(6,"th"),m(7,"Order Number"),a(),t(8,"th"),m(9,"Status"),a(),t(10,"th"),m(11,"Exception"),a()()(),t(12,"tbody"),_(13,kn,2,1,"ng-container",56)(14,Ln,6,0,"ng-template",null,71,R),a()()()()),n&2){let o=P(15),e=d();p(13),s("ngIf",(e.downloadData==null?null:e.downloadData.length)>0)("ngIfElse",o)}}function An(n,l){n&1&&f(0,"i",74)}function Vn(n,l){n&1&&f(0,"i",75)}function Rn(n,l){n&1&&f(0,"i",76)}var oe=function(n){return n.ALL="all",n.SYNC="sync",n.WRONG="wrong",n.UNSYNC="unsync",n}(oe||{}),Wt=(()=>{let l=class l{constructor(e,i,r,c,h,E){this.http=e,this.toastr=i,this.datePipe=r,this.url=c,this.productService=h,this.orderService=E,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=D,this.previewStatus=oe,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=Te}ngOnInit(){this.initPageLoader(),this.url.queryParams.subscribe(e=>{this.channelID=e.ChannelID,this.startDate=new Date(e.Date),this.endDate=new Date(e.Date)})}initPageLoader(){this.productService.loader().subscribe(e=>{this.channelOptions=e.Options.Channel})}onDownload(e){let i={ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData};this.http.post("/api/Orders/Download",i).subscribe(r=>{this.downloadData=r.Body,this.onStepperNext(e)})}onPreview(e){if(!this.validateDatePreview())return;let i={ID:this.channelID,From:this.startDate,To:this.endDate};this.http.post("/api/Orders/Preview",i).subscribe(r=>{if(r.length==0){this.toastrEmptyPreview();return}this.previewData=r,this.groupingPreviewData(),this.filterPreviewData(oe.ALL),this.initLengthStatusData(),this.onStepperNext(e)})}toastrEmptyPreview(){this.toastr.info("There is no orders from "+this.datePipe.transform(this.startDate,"dd MMM yyyy")+" to "+this.datePipe.transform(this.endDate,"dd MMM yyyy")+" !","No Orders!")}validateDatePreview(){let e=!0;return w.getDaysDiff(this.startDate,this.endDate)>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),e=!1),e}setPageTitle(e){this.pageTitle=`
|
|
7
|
-
${e} (${this.getDateTitle()})
|
|
8
|
-
`}getDateTitle(){let e=w.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),i=this.datePipe.transform(this.startDate,e),r=this.datePipe.transform(this.endDate,"dd MMM yyyy");return`${e==null?"":i+"-"} ${r}`}onNew(e){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",e.reset()}groupingPreviewData(){let e=this.filterDataByStatus(oe.UNSYNC),i=this.filterDataByStatus(oe.WRONG);this.downloadedPreviewData=[...e,...i]}filterDataByStatus(e){let i=[];switch(e){case oe.ALL:i=this.previewData;break;case oe.SYNC:i=this.previewData.filter(r=>r.Action==Te.DoNothing);break;case oe.WRONG:i=this.previewData.filter(r=>r.Action==Te.Update);break;case oe.UNSYNC:i=this.previewData.filter(r=>r.Action==Te.New);break}return i}filterPreviewData(e){this.pillStatus=e,this.displayedPreviewData=this.filterDataByStatus(e)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(oe.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(oe.SYNC).length,this.unsyncData=this.filterDataByStatus(oe.UNSYNC).length}getTypeID(){var e=this.channelOptions.find(i=>i.ID==this.channelID)?.TypeID;return e??0}onStepperChange(e){this.currentState=e.selectedStep.state}onStepperNext(e){e.selected.completed=!0,e.next()}onNext(e){switch(this.currentState){case"filter":this.onPreview(e);break;case"preview":this.onDownload(e);break}}stepChange(e){switch(e?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let i=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${i?.Name}`);break;case"finish":this.setPageTitle("Download");break}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let e=!w.isValidDate(this.startDate)||!w.isValidDate(this.endDate),i=w.IsEmpty(this.channelID);return e||i}exportOrders(){let e={ID:this.channelID,From:this.startDate,To:this.endDate},i=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(e,i).subscribe()}};l.\u0275fac=function(i){return new(i||l)(v(L),v(pe),v(k),v(Ae),v(xt),v(xe))},l.\u0275cmp=O({type:l,selectors:[["app-download"]],features:[Qe([{provide:It,useValue:{displayDefaultIndicatorType:!1}}])],decls:47,vars:20,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2","type","button",3,"disabled","click",4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2",3,"click",4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["labelPosition","bottom","linear","",1,"w-100","stepper-download",3,"ngClass","selectionChange"],["stepper",""],["state","filter",3,"editable","completed"],["matStepLabel",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body",3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-1rem"],["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",""],["state","preview",3,"editable","completed"],["class","row pt-2",4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","border-end-0",3,"disabled","click"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end",2,"min-width","85px !important"],[1,"dropdown-item"],[3,"click"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"disabled","click"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"nav","nav-pills"],[1,"nav-item","mx-3"],[1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["EMPTY",""],["width","15%"],[4,"ngFor","ngForOf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],["EMPTY_DOWNLOAD",""],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"fa-solid","fa-filter"],[1,"fa-solid","fa-file"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(i,r){if(i&1){let c=I();t(0,"mainpanel",0)(1,"actions"),_(2,hn,12,1,"ng-container",1)(3,gn,2,1,"button",2)(4,_n,3,0,"button",3),a(),t(5,"content")(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7)(10,"mat-stepper",8,9),g("selectionChange",function(E){return r.stepChange(E)})("selectionChange",function(E){return r.onStepperChange(E)}),t(12,"mat-step",10),_(13,un,1,0,"ng-template",11),t(14,"div",12)(15,"div",6)(16,"div",5)(17,"div",13)(18,"h5"),m(19,"Select a Channel"),a(),t(20,"p",14),m(21,"Select Channel want to download order"),a()(),t(22,"div",13)(23,"ng-select",15),g("ngModelChange",function(E){return r.channelID=E}),_(24,fn,3,3,"ng-option",16),a()()(),t(25,"div",17)(26,"div",13)(27,"h5"),m(28,"Date Range"),a(),t(29,"p",14),m(30,"Select transaction date of the channel you want to download (Max 2 Weeks)"),a()(),t(31,"div",13)(32,"div",6)(33,"mat-date-range-input",18)(34,"input",19),g("ngModelChange",function(E){return r.startDate=E})("click",function(){S(c);let E=P(37);return C(E.open())}),a(),t(35,"input",20),g("ngModelChange",function(E){return r.endDate=E})("click",function(){S(c);let E=P(37);return C(E.open())}),a()(),f(36,"mat-date-range-picker",null,21),a()()()()()(),t(38,"mat-step",22),_(39,Sn,1,0,"ng-template",11)(40,Pn,34,11,"div",23),a(),t(41,"mat-step",24),_(42,Nn,1,0,"ng-template",11)(43,Fn,16,2,"div",23),a(),_(44,An,1,0,"ng-template",25)(45,Vn,1,0,"ng-template",26)(46,Rn,1,0,"ng-template",27),a()()()()()()()}if(i&2){let c=P(11),h=P(37);s("headerTitle",r.pageTitle)("description",r.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("ngIf",r.currentState=="preview"),p(1),s("ngIf",r.currentState=="filter"),p(1),s("ngIf",r.currentState=="finish"),p(6),Ue("ngClass","last-edited-step-"+c.selectedIndex),p(2),s("editable",r.currentState!="finish")("completed",!1),p(11),s("clearable",!1)("ngModel",r.channelID),p(1),s("ngForOf",r.channelOptions),p(9),s("rangePicker",h),p(1),s("ngModel",r.startDate),p(1),s("ngModel",r.endDate),p(3),s("editable",r.currentState!="finish")("completed",!1),p(2),s("ngIf",r.currentState=="preview"),p(3),s("ngIf",r.currentState=="finish")}},dependencies:[tt,A,V,U,z,$,j,q,ot,Tt,bt,yt,wt,Mt,Pt,Ot,Nt,mt,k],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}"]});let n=l;return n})();var zn=[{path:"",component:Vt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:Gt,canActivate:[de],data:{title:"New Order"}},{path:"detail",component:Bt,canActivate:[de],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Ht,canActivate:[de],data:{title:"Ready To Ship"}},{path:"Shipped",component:Ut,canActivate:[de],data:{title:"Shipped"}},{path:"Delivered",component:qt,canActivate:[de],data:{title:"Delivered"}},{path:"All",component:Yt,canActivate:[de],data:{title:"All Order"}},{path:"Cancelled",component:Jt,canActivate:[de],data:{title:"Cancelled"}},{path:"Download",component:Wt,canActivate:[de],data:{title:"Download"}}]}],Kt=(()=>{let l=class l{};l.\u0275fac=function(i){return new(i||l)},l.\u0275mod=Le({type:l}),l.\u0275inj=ke({imports:[Ce,Ve.forChild(zn)]});let n=l;return n})();var zr=(()=>{let l=class l{};l.\u0275fac=function(i){return new(i||l)},l.\u0275mod=Le({type:l}),l.\u0275inj=ke({providers:[xe,$e,be],imports:[Ce,nt,Kt,_t,dt,Et,Ve,lt,Dt,pt,Y,kt,st,ht,Ft,Ct,vt,ct,At,J,Ge]});let n=l;return n})();export{zr as OrdersModule};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as h}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-PASXSTSS.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-JDAC3DI7.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-KHQYY4CP.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-HO6I7ZN6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-LUN7S6P4.js";import{b as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WAE5XPQ6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EIQQEQMI.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-Y4RCGXQK.js";import{a as f}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-XG47KOUR.js";import{w as l}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EGVKBYT5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-CNK2ETMZ.js";import{u as d}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-OGA3XTQE.js";import{$ as r,Fc as s,Jc as m,_a as c,da as a,dc as n,ea as i}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WGNBD2TG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-HPDCVTZM.js";var C=(()=>{let t=class t{constructor(){}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=a({type:t,selectors:[["app-report"]],decls:1,vars:0,template:function(e,O){e&1&&c(0,"router-outlet")},dependencies:[s],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]});let o=t;return o})();var y=[{path:"",component:C,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WT7HH4UV.js").then(o=>o.OrderModule),canActivate:[f]}]}],g=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,m.forChild(y)]});let o=t;return o})();var z=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,u,g,d,l,m,h]});let o=t;return o})();export{z as ReportModule};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-I5WJTOZD.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-HPDCVTZM.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ht,c as H,d as Qt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-X6OLODND.js";import{a as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-4YO3BZ5L.js";import{a as U}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-5LIHLHZ2.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WL3GCHJ5.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.4.2/Marketplace/chunk-KHQYY4CP.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-CVIYGYJG.js";import{a as Z,b as _t}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-NLUIK3SD.js";import{a as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-CB54UHPH.js";import{b as Wt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-7O2LUPOW.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-HO6I7ZN6.js";import{a as Yt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-4FIQ677Y.js";import{a as D}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-APSB364O.js";import{a as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-VJLQRARA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-45BCCCD5.js";import{c as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-GPNYP6CI.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-LUN7S6P4.js";import{a as Rt,b as Bt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-WAE5XPQ6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EIQQEQMI.js";import{b as A,e as R}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-DANZQU6U.js";import{a as Kt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-4ZIFLVEZ.js";import{a as $t,b as jt,c as Gt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-LC5NUVMA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-FJAD3LVA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-Y4RCGXQK.js";import{a as et,c as J,d as Vt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-LHYUY4OW.js";import{a as Y}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-XG47KOUR.js";import{t as ut,u as Lt,v as k,w as At}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-EGVKBYT5.js";import{T as Ut}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-CNK2ETMZ.js";import{b as Et,c as X,h as B,k as $,u as kt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-OGA3XTQE.js";import{b as tt,c as g}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-SZQIM5RM.js";import{$ as wt,$a as I,$b as st,Ab as F,B as b,Bb as N,Cb as Ot,Ea as c,Ec as pt,Fa as P,Fc as Nt,Hc as mt,Jb as W,Jc as Tt,Na as d,S as K,Ta as S,U as lt,W as yt,Xb as T,Ya as a,Yb as E,Za as l,_a as C,ab as y,ac as Ft,c as bt,cb as x,cc as dt,da as M,dc as Dt,ea as Mt,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.4.2/Marketplace/chunk-WGNBD2TG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.2/Marketplace/chunk-HPDCVTZM.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}}).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}}).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};
|