marketplacepos 5.38.1 → 5.38.2
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 +8 -8
- package/Marketplace/chunk-2FSWKVW2.js +5 -0
- package/Marketplace/{chunk-VAPIXIJ3.js → chunk-2UZPOENK.js} +1 -1
- package/Marketplace/chunk-2WX4KRTS.js +1 -0
- package/Marketplace/{chunk-LQFYLU4B.js → chunk-3FCJ4HSW.js} +1 -1
- package/Marketplace/chunk-3H6MA53M.js +1 -0
- package/Marketplace/{chunk-AKJ4I7KF.js → chunk-3S7C3CCV.js} +1 -1
- package/Marketplace/{chunk-WNAVUGZ4.js → chunk-3SYZKYR6.js} +1 -1
- package/Marketplace/{chunk-WMO2ROK4.js → chunk-4BKQVHMV.js} +1 -1
- package/Marketplace/{chunk-SD7UKXTX.js → chunk-4YVLPJDF.js} +1 -1
- package/Marketplace/{chunk-AI4XRCAL.js → chunk-5JWYKH72.js} +1 -1
- package/Marketplace/{chunk-XOT2SZPE.js → chunk-5SXUJ5XH.js} +4 -4
- package/Marketplace/{chunk-4JRXTPAH.js → chunk-634DNHPF.js} +1 -1
- package/Marketplace/chunk-66YHNWRR.js +1 -0
- package/Marketplace/{chunk-KII7SEQ6.js → chunk-67IT7XVS.js} +1 -1
- package/Marketplace/chunk-6BGGLLB3.js +1 -0
- package/Marketplace/{chunk-VGXNA5KN.js → chunk-7Q6UDUDK.js} +1 -1
- package/Marketplace/chunk-7SLPBFFW.js +1 -0
- package/Marketplace/{chunk-77IUCPIQ.js → chunk-ACIMXBIC.js} +1 -1
- package/Marketplace/chunk-AHLRE6UG.js +1 -0
- package/Marketplace/{chunk-3NMGN7IE.js → chunk-APOFECEW.js} +1 -1
- package/Marketplace/chunk-B2EMWVNF.js +1 -0
- package/Marketplace/chunk-BLEP5X4N.js +1 -0
- package/Marketplace/chunk-BTW46HYC.js +3 -0
- package/Marketplace/{chunk-XBPJY5X4.js → chunk-CDAB4RAT.js} +1 -1
- package/Marketplace/chunk-CDNNFRZK.js +1 -0
- package/Marketplace/{chunk-WHFC7TE4.js → chunk-CHBBBCQU.js} +1 -1
- package/Marketplace/{chunk-6HVHZ3HN.js → chunk-CXIBIPS5.js} +1 -1
- package/Marketplace/chunk-D7HXHNZ2.js +1 -0
- package/Marketplace/{chunk-WQ6TZ4KW.js → chunk-DWDTKK42.js} +1 -1
- package/Marketplace/chunk-E7PTAPC2.js +1 -0
- package/Marketplace/{chunk-23MIIDCT.js → chunk-EAU6FVQT.js} +1 -1
- package/Marketplace/chunk-ECT4LXWX.js +1 -0
- package/Marketplace/{chunk-K64ATXFK.js → chunk-ELDNUVIH.js} +1 -1
- package/Marketplace/chunk-EU2KAMEK.js +1 -0
- package/Marketplace/chunk-F7GZCBBK.js +1 -0
- package/Marketplace/chunk-FDTSK7U4.js +1 -0
- package/Marketplace/{chunk-VYKDVKG3.js → chunk-FFM752SB.js} +1 -1
- package/Marketplace/{chunk-WBVTRQFG.js → chunk-FMXSAVJ5.js} +1 -1
- package/Marketplace/{chunk-UOAYF4SW.js → chunk-FZDXTSZF.js} +1 -1
- package/Marketplace/chunk-FZZFKUA6.js +1 -0
- package/Marketplace/chunk-GCECFUOP.js +1 -0
- package/Marketplace/chunk-GJ35EMJI.js +1 -0
- package/Marketplace/{chunk-PF4F4EAR.js → chunk-GJLXEA4Q.js} +1 -1
- package/Marketplace/chunk-GQH7OSVY.js +1 -0
- package/Marketplace/{chunk-ARIW575T.js → chunk-HCZDLZLY.js} +1 -1
- package/Marketplace/chunk-HP3XWVNT.js +1 -0
- package/Marketplace/{chunk-OS53H77X.js → chunk-HPX77FXZ.js} +1 -1
- package/Marketplace/{chunk-5WNSX64O.js → chunk-HSHDGVNA.js} +1 -1
- package/Marketplace/{chunk-RNWWVG3M.js → chunk-I44JKLRE.js} +1 -1
- package/Marketplace/{chunk-VOISFPEM.js → chunk-I5QRFRRD.js} +1 -1
- package/Marketplace/chunk-IFLSHEST.js +1 -0
- package/Marketplace/{chunk-T7KM2WP6.js → chunk-IPYYFOPE.js} +1 -1
- package/Marketplace/{chunk-4W7MIJDZ.js → chunk-IQEG7SF6.js} +1 -1
- package/Marketplace/chunk-ISBNY3BW.js +1 -0
- package/Marketplace/chunk-IURGBAYA.js +1 -0
- package/Marketplace/{chunk-B5JAZPVU.js → chunk-IZCEOKBE.js} +1 -1
- package/Marketplace/{chunk-ER4ENBJB.js → chunk-JAC62SW3.js} +1 -1
- package/Marketplace/{chunk-HPS3WVU5.js → chunk-JNXIAVS4.js} +1 -1
- package/Marketplace/{chunk-EXFL3GUX.js → chunk-K7HUCVG7.js} +1 -1
- package/Marketplace/chunk-KEJE3NY3.js +2 -0
- package/Marketplace/chunk-KESNVJB4.js +1 -0
- package/Marketplace/chunk-KFBOPHX3.js +1 -0
- package/Marketplace/chunk-KLK56V5W.js +5 -0
- package/Marketplace/{chunk-7M4RYU7S.js → chunk-KP7SEM5B.js} +1 -1
- package/Marketplace/chunk-L532YTS3.js +1 -0
- package/Marketplace/{chunk-HREGLBCD.js → chunk-LHKT5TT3.js} +2 -2
- package/Marketplace/{chunk-TTAS23MO.js → chunk-LIQRQYKZ.js} +1 -1
- package/Marketplace/{chunk-EQ2ZKEVE.js → chunk-LLXJSB37.js} +1 -1
- package/Marketplace/{chunk-67USXWWF.js → chunk-LWDDTE3V.js} +1 -1
- package/Marketplace/chunk-LWGJZHI6.js +1 -0
- package/Marketplace/chunk-LXSQIECO.js +1 -0
- package/Marketplace/{chunk-K5CKXDIJ.js → chunk-MFZLTVCS.js} +1 -1
- package/Marketplace/chunk-N5FUA6YZ.js +8 -0
- package/Marketplace/chunk-N5J4Q6XU.js +1 -0
- package/Marketplace/{chunk-VKJAFLQ6.js → chunk-NB5JKHKF.js} +1 -1
- package/Marketplace/chunk-NLMYFEYT.js +1 -0
- package/Marketplace/{chunk-OM7KOQLP.js → chunk-NQV7LHIV.js} +1 -1
- package/Marketplace/chunk-ODYALJ4L.js +1 -0
- package/Marketplace/chunk-OQ6GAJZC.js +1 -0
- package/Marketplace/chunk-OQCIFQ6E.js +1 -0
- package/Marketplace/{chunk-2NECQ3RY.js → chunk-PHCYCYXH.js} +1 -1
- package/Marketplace/{chunk-AFMNWVBL.js → chunk-PQZGUDGJ.js} +1 -1
- package/Marketplace/{chunk-R5IDWUP6.js → chunk-PRVOIBMJ.js} +1 -1
- package/Marketplace/chunk-PW42BQIY.js +1 -0
- package/Marketplace/chunk-RH3MWQCS.js +1 -0
- package/Marketplace/chunk-RP5BC3NS.js +1 -0
- package/Marketplace/{chunk-5UHZLNDT.js → chunk-RTUTYVTE.js} +1 -1
- package/Marketplace/chunk-RXP4QJHL.js +2 -0
- package/Marketplace/{chunk-WYOXUN3H.js → chunk-S4HBPSOW.js} +1 -1
- package/Marketplace/chunk-S6JH7OX2.js +1 -0
- package/Marketplace/chunk-SG52OFBZ.js +1 -0
- package/Marketplace/chunk-SNSUFM3F.js +1 -0
- package/Marketplace/{chunk-BSATGCWC.js → chunk-SZ22GHDY.js} +1 -1
- package/Marketplace/chunk-T2QY5RTH.js +1 -0
- package/Marketplace/{chunk-OBN6RKRH.js → chunk-TCRZNHID.js} +1 -1
- package/Marketplace/{chunk-V5WYSCVT.js → chunk-TGMCGROM.js} +1 -1
- package/Marketplace/{chunk-5BTJTFLF.js → chunk-THCM5TEN.js} +1 -1
- package/Marketplace/chunk-TO3EP6I2.js +1 -0
- package/Marketplace/chunk-U5FRJVIW.js +2 -0
- package/Marketplace/chunk-UPA7TFVG.js +2 -0
- package/Marketplace/{chunk-X3VJPR2I.js → chunk-UX7JCPZZ.js} +1 -1
- package/Marketplace/{chunk-4RAOUTR2.js → chunk-V27YSSV4.js} +1 -1
- package/Marketplace/{chunk-N253NBCW.js → chunk-V6IICLFE.js} +1 -1
- package/Marketplace/chunk-VFLAHRB4.js +7 -0
- package/Marketplace/chunk-VHIGKLLN.js +5 -0
- package/Marketplace/chunk-VQIOJJQU.js +1 -0
- package/Marketplace/{chunk-ORPJLSXE.js → chunk-WAGDS532.js} +1 -1
- package/Marketplace/chunk-WLZKVYHT.js +1 -0
- package/Marketplace/{chunk-JSPVOV7M.js → chunk-XMUA7ACY.js} +1 -1
- package/Marketplace/{chunk-L6W6BJ3T.js → chunk-YNZOWISG.js} +1 -1
- package/Marketplace/{chunk-TY4H2W6F.js → chunk-YOGRCIUI.js} +1 -1
- package/Marketplace/chunk-YZTAHFSS.js +1 -0
- package/Marketplace/chunk-ZBQYXB3O.js +1 -0
- package/Marketplace/{chunk-5Z63CRGG.js → chunk-ZEAT7ZWR.js} +1 -1
- package/Marketplace/chunk-ZJ33U67R.js +1 -0
- package/Marketplace/chunk-ZNZULA6U.js +1 -0
- package/Marketplace/{chunk-E24BKGBJ.js → chunk-ZUFLZMHT.js} +1 -1
- package/Marketplace/{chunk-74NNHYZD.js → chunk-ZX5YQUYQ.js} +1 -1
- package/Marketplace/index.html +3 -2
- package/Marketplace/main-NTODVC3B.js +1 -0
- package/Marketplace/{styles-6IZYQNTO.css → styles-FQFG5OHY.css} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-2NNAGGBO.js +0 -1
- package/Marketplace/chunk-3F5YNXJZ.js +0 -1
- package/Marketplace/chunk-52GRE6TF.js +0 -2
- package/Marketplace/chunk-5F7JXOEW.js +0 -1
- package/Marketplace/chunk-5WY7E5DR.js +0 -1
- package/Marketplace/chunk-6A4PYMCJ.js +0 -1
- package/Marketplace/chunk-AGZELPLU.js +0 -1
- package/Marketplace/chunk-AUFEVLWI.js +0 -1
- package/Marketplace/chunk-B6POIFQM.js +0 -2
- package/Marketplace/chunk-DG3PIXFJ.js +0 -1
- package/Marketplace/chunk-DKSZXAZP.js +0 -1
- package/Marketplace/chunk-EIQCOZF5.js +0 -7
- package/Marketplace/chunk-EQD3IUMF.js +0 -1
- package/Marketplace/chunk-FT2CIUVJ.js +0 -1
- package/Marketplace/chunk-FXY6M473.js +0 -2
- package/Marketplace/chunk-HA5WIDED.js +0 -1
- package/Marketplace/chunk-HHYTW3RN.js +0 -1
- package/Marketplace/chunk-I6PVQBH3.js +0 -1
- package/Marketplace/chunk-IGY25UKT.js +0 -1
- package/Marketplace/chunk-IIJMZKPL.js +0 -1
- package/Marketplace/chunk-JLKZR2QZ.js +0 -1
- package/Marketplace/chunk-K2H6WANG.js +0 -1
- package/Marketplace/chunk-KACPPB3G.js +0 -1
- package/Marketplace/chunk-LVN6OVH5.js +0 -2
- package/Marketplace/chunk-NEP7KI3U.js +0 -5
- package/Marketplace/chunk-ONK4P7TL.js +0 -1
- package/Marketplace/chunk-OVYL7SOO.js +0 -4
- package/Marketplace/chunk-PDUGX4DM.js +0 -1
- package/Marketplace/chunk-PYZWE4VU.js +0 -1
- package/Marketplace/chunk-QAEN52IK.js +0 -3
- package/Marketplace/chunk-QCLSHTFL.js +0 -8
- package/Marketplace/chunk-QEMI6GLH.js +0 -1
- package/Marketplace/chunk-QXEKSQSM.js +0 -1
- package/Marketplace/chunk-R6B6DIG3.js +0 -1
- package/Marketplace/chunk-T7WMTOQA.js +0 -1
- package/Marketplace/chunk-TA3GQMN7.js +0 -1
- package/Marketplace/chunk-TW6IUVEY.js +0 -1
- package/Marketplace/chunk-UJLJ2U37.js +0 -1
- package/Marketplace/chunk-W6T7TOHE.js +0 -1
- package/Marketplace/chunk-XR4JKTPA.js +0 -1
- package/Marketplace/chunk-YQSHLQDX.js +0 -2
- package/Marketplace/chunk-YTSQ3LOF.js +0 -1
- package/Marketplace/chunk-ZCK76CIK.js +0 -5
- package/Marketplace/main-IKF2QRKL.js +0 -1
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as we,b as Pe,c as ze}from"./chunk-WHFC7TE4.js";import{a as X}from"./chunk-52GRE6TF.js";import"./chunk-77IUCPIQ.js";import"./chunk-WBVTRQFG.js";import{a as Je}from"./chunk-BVIRHZTZ.js";import{a as oe,b as le,c as yt}from"./chunk-OM7KOQLP.js";import"./chunk-MS4AQ6UA.js";import{a as me}from"./chunk-6HVHZ3HN.js";import{b as Lt}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import{a as At,b as Rt,c as Wt,d as Bt,e as zt,f as Gt,g as jt}from"./chunk-VAPIXIJ3.js";import"./chunk-3NMGN7IE.js";import{a as xt,b as wt}from"./chunk-ARIW575T.js";import"./chunk-OVYL7SOO.js";import"./chunk-B5JAZPVU.js";import{a as Ht,b as Ut}from"./chunk-RNWWVG3M.js";import"./chunk-OS53H77X.js";import{a as pe,b as bt}from"./chunk-5BTJTFLF.js";import{a as Ft}from"./chunk-T7KM2WP6.js";import{i as It,j as Nt,k as Mt,l as Ot,m as kt}from"./chunk-VOISFPEM.js";import"./chunk-UOAYF4SW.js";import{a as Pt}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as $}from"./chunk-5WNSX64O.js";import{b as Vt}from"./chunk-WYOXUN3H.js";import{b as Et}from"./chunk-23MIIDCT.js";import{a as vt,b as Tt,c as Dt}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import{a as re}from"./chunk-74NNHYZD.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as ne,b as ae,c as dt,d as J,e as ct}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{g as se,j as K}from"./chunk-QAEN52IK.js";import{b as be,e as W}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{b as gt,d as xe,e as ut,f as ft,g as St,l as j,m as Ct}from"./chunk-XOT2SZPE.js";import{r as _t,s as ht}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as Be,c as q,h as z,m as G,o as ie,y as st}from"./chunk-AI4XRCAL.js";import{b as P,c as I}from"./chunk-W6T7TOHE.js";import{E as Re,F as mt,H as Y,J as We,d as pt,f as A,g as R,j as Ce,k as V,m as U,n as ye}from"./chunk-B6POIFQM.js";import{Aa as Ye,B as Ze,Ba as qe,Dc as O,Eb as L,Ec as l,Fb as Ae,Fc as u,G as et,Gc as w,Ic as C,Jc as y,Kb as g,Kc as b,Mc as ot,Nc as ee,Oc as lt,Pc as te,Qa as nt,Wb as s,Xc as E,Yc as M,Z as he,Zc as F,_c as B,aa as tt,bc as Ke,ea as Le,gc as i,hc as a,ic as f,ja as Ve,jc as T,ka as Fe,kc as D,mc as N,oa as ge,ob as k,qb as o,rc as x,sc as d,v as H,vc as at,wb as v,wc as rt,xa as it,ya as _,za as h}from"./chunk-EIQCOZF5.js";import{a as Xe,b as Qe}from"./chunk-K2H6WANG.js";var Yt=(()=>{class n{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:[Je.downloadOrder]},{Title:"Log",Url:"/menu/Order/Download_Order_Log",Permissions:[Je.downloadOrder]}]}ngOnInit(){}static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275cmp=L({type:n,selectors:[["app-orders"]],standalone:!1,decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(r,t){r&1&&(i(0,"nav",0)(1,"div",1)(2,"div"),f(3,"nav-tab",2),a()()(),f(4,"router-outlet")),r&2&&(o(3),s("Tabs",t.ObjectOrderTabs)("usePermissions",!0))},dependencies:[xt,mt],encapsulation:2})}}return n})();var Ge=(()=>{class n{constructor(e,r){this.http=e,this.toastr=r}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(Le(r=>{this.tokopediaAcceptOrderHandler(r)}))}tokopediaAcceptOrderHandler(e){let r=e.filter(p=>p.Status==!1),t=e.filter(p=>p.Status==!0);if(r.length==0&&t.length>0){let p=`<ol>${this.generateSuccessMessage(t)}</ol>`;this.toastr.success(p,"Success",{enableHtml:!0})}else if(r.length>0&&t.length>0){let p=`<ol>
|
|
2
|
-
${this.generateSuccessMessage(t)}
|
|
3
|
-
${this.generateErrorMessage(r)}
|
|
4
|
-
</ol>`;this.toastr.warning(p,"Warning",{enableHtml:!0})}else{let p=`<ol>${this.generateErrorMessage(r)}</ol>`;this.toastr.error(p,"Error",{enableHtml:!0})}}generateSuccessMessage(e){let r="";return e.forEach(t=>{r+=`<li><b>${t.OrderNumber}</b> was successfully Accept</li>`}),r}generateErrorMessage(e){let r="";return e.forEach(t=>{r+=`<li><b>${t.OrderNumber}</b> ${t.Message}</li>`}),r}static{this.\u0275fac=function(r){return new(r||n)(ge(W),ge(be))}}static{this.\u0275prov=Ve({token:n,factory:n.\u0275fac})}}return n})();function oi(n,c){if(n&1){let e=N();T(0),i(1,"button",20),x("click",function(){_(e);let t=d().ngIf,p=d();return h(p.onAcceptOrder(t))}),f(2,"i",21),l(3," Accept "),a(),D()}}function li(n,c){if(n&1&&(T(0),g(1,oi,4,0,"ng-container",3),D()),n&2){let e=d();o(),s("ngIf",e.isTokopediaAvailable&&e.isTokopediaSelected)}}function pi(n,c){if(n&1&&(i(0,"span",22),f(1,"img",23),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k),o(),w(" ",e.Name," ")}}function mi(n,c){if(n&1){let e=N();T(0),i(1,"th",35)(2,"input",36),b("ngModelChange",function(t){_(e);let p=d(3);return y(p.isCheckAll,t)||(p.isCheckAll=t),h(t)}),x("ngModelChange",function(){_(e);let t=d(2).ngIf,p=d();return h(p.onSelectAllOrderData(t))}),a()(),D()}if(n&2){let e=d(3);o(2),C("ngModel",e.isCheckAll)}}function si(n,c){if(n&1){let e=N();T(0),i(1,"input",36),b("ngModelChange",function(t){_(e);let p=d(2).$implicit;return y(p.selected,t)||(p.selected=t),h(t)}),x("ngModelChange",function(){_(e);let t=d(4).ngIf,p=d();return h(p.onSelectOrderData(t))}),a(),D()}if(n&2){let e=d(2).$implicit;o(),C("ngModel",e.selected)}}function di(n,c){if(n&1&&(T(0),i(1,"td"),g(2,si,2,1,"ng-container",3),a(),D()),n&2){let e=d().$implicit,r=d(3);o(2),s("ngIf",e.Type==r.tokopediaType)}}function ci(n,c){if(n&1&&(T(0),i(1,"span"),l(2),a(),D()),n&2){let e=d().$implicit;o(2),u(e.Number)}}function _i(n,c){if(n&1&&(i(0,"a",38),l(1),a()),n&2){let e=d().$implicit,r=d(3);s("href",r.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+e.ID,k),o(),u(e.Number)}}function hi(n,c){if(n&1&&(i(0,"tr"),g(1,di,3,1,"ng-container",3),i(2,"td"),l(3),a(),i(4,"td"),g(5,ci,3,1,"ng-container",24)(6,_i,2,2,"ng-template",null,1,B),a(),i(8,"td"),l(9),a(),i(10,"td"),l(11),E(12,"date"),a(),i(13,"td"),f(14,"app-channel-logo",37),a()()),n&2){let e=c.$implicit,r=O(7),t=d(3);o(),s("ngIf",t.isTokopediaAvailable),o(2),u(e.Outlet),o(2),s("ngIf",e.ID==t.guidEmpty)("ngIfElse",r),o(4),u(e.Customer),o(2),u(F(12,7,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.Type)}}function gi(n,c){if(n&1){let e=N();T(0),i(1,"div",25)(2,"table",26),x("matSortChange",function(t){_(e);let p=d(2);return h(p.onSort(t))}),i(3,"thead",27)(4,"tr",28),g(5,mi,3,1,"ng-container",3),i(6,"th",29),l(7,"Outlet"),a(),i(8,"th",30),l(9,"Order number"),a(),i(10,"th"),l(11,"Customer"),a(),i(12,"th",31),l(13," Created On "),a(),i(14,"th",32),l(15,"Channel"),a()()(),i(16,"tbody"),g(17,hi,15,10,"tr",33),a()(),i(18,"app-mat-paginator-no-count",34),E(19,"async"),E(20,"async"),x("total",function(){_(e);let t=d(2);return h(t.getPaginatonTotal())})("next",function(){_(e);let t=d(2);return h(t.onNextPage())})("previous",function(){_(e);let t=d(2);return h(t.onPreviousPage())}),a()(),D()}if(n&2){let e,r=d().ngIf,t=d();o(5),s("ngIf",t.isTokopediaAvailable&&r),o(12),s("ngForOf",r),o(),s("filter",t.filter)("totaldata",(e=M(19,5,t.newOrdersData$))==null?null:e.length)("paginationTotal",M(20,7,t.paginationTotal$))}}function ui(n,c){if(n&1&&(T(0),g(1,gi,21,9,"ng-container",24),D()),n&2){let e=c.ngIf;d();let r=O(36);o(),s("ngIf",(e==null?null:e.length)>0)("ngIfElse",r)}}function fi(n,c){n&1&&(i(0,"div",39),f(1,"app-empty-state"),a())}var Kt=(()=>{class n{constructor(e,r,t,p){this.localDataService=e,this.orderService=r,this.acceptOrderService=t,this.authService=p,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=I.GuidEMpty,this.tokopediaType=P.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}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.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(he()),this.newOrdersData$=this.sourceObs$.pipe(Le(r=>{r.filter(p=>p.Type==P.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID,this.filter.From,this.filter.To).pipe(he())}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(t=>t.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(e){e=e.map(r=>(r.Type==P.Tokopedia&&(r.selected=this.isCheckAll),r)),this.onSelectOrderData(e)}onAcceptOrder(e){let r=this.getSelectedTokopediaOrders(e);this.acceptOrderService.acceptTokopediaOrders(r).subscribe(t=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(e){return e.filter(t=>t.selected).map(t=>t.Number)}onSort(e){if(e.direction==""){this.newOrdersData$=this.sourceObs$;return}if(e.active=="created"){let r=e.direction=="asc";this.newOrdersData$=this.newOrdersData$.pipe(H(t=>(t=t.sort((p,S)=>I.compare(p.Created,S.Created,r)),t)))}}static{this.\u0275fac=function(r){return new(r||n)(v(se),v(we),v(Ge),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-new-order"]],standalone:!1,decls:37,vars:15,consts:[["EMPTY_STATE",""],["NOT_EMPTY",""],["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"onSubmit","hideSearchBox"],[4,"ngIf"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],["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,"total","next","previous","filter","totaldata","paginationTotal"],[2,"width","5px"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"typeId"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,t){if(r&1){let p=N();i(0,"mainpanel",2),x("onSubmit",function(){return _(p),h(t.getNewOrders())}),i(1,"actions"),g(2,li,2,1,"ng-container",3),E(3,"async"),i(4,"a",4),f(5,"i",5),i(6,"span"),l(7,"Visit our Fulfillment Display System"),a()()(),i(8,"filters")(9,"div")(10,"label",6),l(11,"Channel"),a(),i(12,"ng-select",7),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(13,pi,3,2,"ng-template",8),a()(),i(14,"div",9)(15,"label",10),l(16,"Page Number"),a(),i(17,"input",11),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(18,"div",9)(19,"label",10),l(20,"Page Size"),a(),i(21,"input",12),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(22,"div",9)(23,"label",13),l(24,"From/To"),a(),i(25,"div",14)(26,"datepicker",15),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(27,"div")(28,"datepicker",16),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(29,"content")(30,"div",17)(31,"div",18)(32,"div",19),g(33,ui,2,2,"ng-container",3),E(34,"async"),g(35,fi,2,0,"ng-template",null,0,B),a()()()()()}r&2&&(s("hideSearchBox",!0),o(2),s("ngIf",M(3,11,t.newOrdersData$)),o(10),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",M(34,13,t.newOrdersData$)))},dependencies:[A,R,q,ie,Be,z,G,j,J,ne,ae,$,pe,me,oe,le,X,Ce,V],encapsulation:2})}}return n})();var Si=()=>["/menu/Order"];function Ci(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),l(4),E(5,"number"),a(),i(6,"td"),l(7),E(8,"number"),a()()),n&2){let e=c.$implicit;o(2),u(e.Code),o(2),u(M(5,3,e.Quantity)),o(3),u(M(8,5,e.Price))}}function yi(n,c){if(n&1&&(i(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),l(5,"Outlet Info"),a()(),i(6,"div",4)(7,"div",9),l(8," Outlet : "),a(),i(9,"div",9),l(10),a()(),i(11,"div",4)(12,"div",9),l(13," Date : "),a(),i(14,"div",9),l(15),E(16,"date"),a()(),i(17,"div",4)(18,"div",9),l(19," Status : "),a(),i(20,"div",9),l(21),a()(),i(22,"div",4)(23,"div",9),l(24," Tax Type : "),a(),i(25,"div",9),l(26),a()(),i(27,"div",4)(28,"div",9),l(29," Due Date : "),a(),i(30,"div",9),l(31),E(32,"date"),a()()(),i(33,"div",6)(34,"div",7)(35,"h3",8),l(36,"Customer Info"),a()(),i(37,"div",4)(38,"div",9),l(39," Name : "),a(),i(40,"div",9),l(41),a()(),i(42,"div",4)(43,"div",9),l(44," Email : "),a(),i(45,"div",9),l(46),a()(),i(47,"div",4)(48,"div",9),l(49," Mobile : "),a(),i(50,"div",9),l(51),a()()()(),i(52,"div",10)(53,"h3",11),l(54,"Products Sold"),a(),i(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),l(60,"Code"),a(),i(61,"th"),l(62,"Quantity"),a(),i(63,"th"),l(64,"Price"),a()()(),i(65,"tbody"),g(66,Ci,9,7,"tr",16),a()()()()()),n&2){let e=d();o(10),w(" ",e.model.Outlet," "),o(5),w(" ",F(16,9,e.model.Date,"dd MMM yyyy")," "),o(6),w(" ",e.model.Delivery," "),o(5),w(" ",e.model.TaxType," "),o(5),w(" ",F(32,12,e.model.DueDate,"dd MMM yyyy")," "),o(10),w(" ",e.model.Customer.Name," "),o(5),w(" ",e.model.Customer.Email," "),o(5),w(" ",e.model.Customer.Mobile," "),o(15),s("ngForOf",e.model.Variants)}}var Jt=(()=>{class n{constructor(e,r){this.http=e,this.url=r,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(r=>{this.model=r})}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(Re))}}static{this.\u0275cmp=L({type:n,selectors:[["app-detail-order"]],standalone:!1,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(r,t){r&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),a()(),i(4,"content")(5,"div",2),g(6,yi,67,15,"div",3),a()()()),r&2&&(s("headerTitle","Order #"+t.number)("hideSearchBox",!0)("hideSearchDropdown",!0),o(2),s("routerLink",ee(5,Si)),o(4),s("ngIf",t.model))},dependencies:[A,R,j,Y,U,V],encapsulation:2})}}return n})();var $t=(()=>{class n{constructor(e){this.dialogRef=e,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}static{this.\u0275fac=function(r){return new(r||n)(v(gt))}}static{this.\u0275cmp=L({type:n,selectors:[["app-print-tokopedia"]],standalone:!1,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,"ngModelChange","ngModel"],[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(r,t){r&1&&(i(0,"div",0)(1,"h2",1),l(2,"Cetak label pesanan"),a(),i(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),l(7,"Kamu akan mencetak label yang berisi detail pesanan"),a(),i(8,"div",5)(9,"mat-checkbox",6),b("ngModelChange",function(S){return y(t.tandaiSudahDicetak,S)||(t.tandaiSudahDicetak=S),S}),a(),i(10,"span",7),l(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),a()()()()(),i(12,"mat-dialog-actions",8)(13,"button",9),x("click",function(){return t.onCancel()}),l(14,"Cancel"),a(),i(15,"button",10),x("click",function(){return t.onPrint()}),l(16,"Cetak Pesanan"),a()()()),r&2&&(o(9),C("ngModel",t.tandaiSudahDicetak))},dependencies:[z,G,Ht,ft,ut],encapsulation:2})}}return n})();var He=(()=>{class n{constructor(e,r,t){this.http=e,this.toastr=r,this.dialog=t}getTokopediaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/Tokopedia/Multiple",{Orders:e}).pipe(H(r=>(r=r.map(t=>(t.ChannelType=P.Tokopedia,t)),r)))}getTiktokShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/TIktok/Multiple",{Orders:e}).pipe(H(r=>(r=r.map(t=>(t.ChannelType=P.Tiktok,t)),r)))}getShopeeShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/shopee/Multiple",{Orders:e}).pipe(H(r=>(r=r.map(t=>(t.ChannelType=P.Shopee,t)),r)))}getLazadaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/lazada/Multiple",{Orders:e}).pipe(H(r=>(r=r.map(t=>(t.ChannelType=P.Lazada,t)),r)))}printShippingLabelTokopedia(e){let r={OrderNumber:e,Printed:!0};this.dialog.open($t).afterClosed().pipe(et(t=>t!==void 0),tt(t=>(r.Printed=t,this.http.post("api/v1/Shippinglabel/Tokopedia",r)))).subscribe(t=>{let p=window.open("about:blank","_blank");p.document.write(t.File),p.document.close()})}printShippingLabelTiktok(e,r){let t={ShopID:r,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Tiktok",t).subscribe(p=>{p.data!=null?window.open(p.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(e,r){let t={ShopID:r,OrderNumber:e};this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",t).subscribe(p=>{var S=Uint8Array.from(atob(p.File),Ee=>Ee.charCodeAt(0)),m=new Blob([S],{type:"octet/stream"});I.openDownloadFile(m,`${e}.pdf`)})}printShippingLabelLazada(e,r){let t={ShopID:r,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",t).subscribe(p=>{p.result.data!=null?window.open(p.result.data.pdf_url,"_blank"):this.toastr.error(p.message,"Cannot Print")})}static{this.\u0275fac=function(r){return new(r||n)(ge(W),ge(be),ge(xe))}}static{this.\u0275prov=Ve({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var de=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}(de||{});var De=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.TIKTOK="https://res.cloudinary.com/pos/image/upload/v1645761565/icons/Marketplace%20logo/tiktok-logo.png",n}(De||{});function xi(n,c){if(n&1&&(T(0),i(1,"div",36)(2,"div",12)(3,"div",37),l(4),a()(),i(5,"div",12)(6,"div",37),l(7),a()()(),D()),n&2){let e=d();o(4),w(" ",e.recipient==null?null:e.recipient.City," "),o(3),w(" ",e.recipient==null?null:e.recipient.District," ")}}function wi(n,c){if(n&1&&(T(0),i(1,"div")(2,"span",15),l(3,"Berat: "),a(),i(4,"span",18),l(5),a()(),D()),n&2){let e=d();o(5),w("",e.shippingLabel==null?null:e.shippingLabel.Weight," gr")}}function vi(n,c){if(n&1&&(T(0),i(1,"div",38)(2,"span",14),l(3,"Batas Kirim:"),a(),i(4,"span",18),l(5),E(6,"date"),a()(),D()),n&2){let e=d();o(5),u(F(6,1,e.logistic==null?null:e.logistic.Batas_kirim,"dd-MM-yyy"))}}function Ti(n,c){if(n&1&&(T(0),i(1,"div",38)(2,"span",14),l(3,"No.Pesanan:"),a(),i(4,"span",18),l(5),a()(),D()),n&2){let e=d();o(5),u(e.shippingLabel==null?null:e.shippingLabel.OrderNumber)}}function Di(n,c){if(n&1&&(i(0,"tr")(1,"td",39),l(2),a(),i(3,"td"),l(4),a(),i(5,"td"),l(6),a(),i(7,"td"),l(8),E(9,"number"),a()()),n&2){let e=c.$implicit,r=c.index;o(2),u(r+1),o(2),u(e.Product_Name),o(2),u(e.SKU),o(2),u(M(9,4,e.Quantity))}}var Ue=(()=>{class n{constructor(){this.minDate=I.MinDate,this.channelType=P}ngOnChanges(e){e.shippingLabel&&e.shippingLabel.currentValue&&(this.initShippingLabel(),this.getShippingLogo(),this.getChannelLogo())}ngAfterViewInit(){this.initBarcodeConfig()}getChannelLogo(){switch(this.shippingLabel.ChannelType){case P.Tokopedia:this.marketplaceLogo=De.TOKOPEDIA;break;case P.Shopee:this.marketplaceLogo=De.SHOPEE;break;case P.Lazada:this.marketplaceLogo=De.LAZADA;break;case P.Tiktok:this.marketplaceLogo=De.TIKTOK;break}}getShippingLogo(){let e=this.shippingLabel.Logistic.Logistic_Name;e=e?.toLowerCase(),e.includes("anteraja")?this.shippingLogo=de.ANTERAJA:e.includes("grabexpress")?this.shippingLogo=de.GRAB:e.includes("jne")?this.shippingLogo=de.JNE:e.includes("gosend")?this.shippingLogo=de.GOSEND:e.includes("j&t")||e.includes("jnt")?this.shippingLogo=de.JNT:e.includes("sicepat")?this.shippingLogo=de.SICEPAT:e.includes("spx")?this.shippingLogo=de.SPX:(e.includes("lex")||e.includes("lx")||e.includes("lazada express"))&&(this.shippingLogo=de.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(I.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})}I.IsNotEmpty(this.shippingLabel?.OrderNumber)&&JsBarcode(`#NO${this.id}`,this.shippingLabel?.OrderNumber,{displayValue:!1,width:this.shippingLabel?.OrderNumber.length>15?.5:1,height:40})}static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275cmp=L({type:n,selectors:[["app-shipping-label"]],inputs:{shippingLabel:"shippingLabel",id:"id"},features:[it],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",2,"max-width","200px","word-wrap","break-word"],[1,"fs-6"],[1,"fs-6",2,"word-wrap","break-word","max-width","160px"],[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(r,t){r&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),f(6,"img",5),a(),i(7,"div")(8,"h4"),l(9),a()(),i(10,"div"),f(11,"img",5),a()()()(),i(12,"div",6),f(13,"hr"),a(),i(14,"div",7)(15,"div",3)(16,"div",8)(17,"span",9),l(18),a(),i(19,"span"),l(20),a()()()(),i(21,"div",7)(22,"div",10),Ye(),f(23,"svg",11),a()(),qe(),i(24,"div",6),f(25,"hr"),a(),i(26,"div",2)(27,"div",12)(28,"div",13)(29,"div",14),l(30,"Penerima: "),a(),i(31,"div",15),l(32),a()(),i(33,"div",16)(34,"span",15),l(35,"Alamat Pengiriman:"),a(),i(36,"div",17),l(37),a()()(),i(38,"div",12)(39,"div",13)(40,"div",14),l(41,"Pengirim: "),a(),i(42,"div")(43,"div",15),l(44),a(),i(45,"div",18),l(46),a(),i(47,"div",19),l(48),a()()(),f(49,"div"),a()(),g(50,xi,8,2,"ng-container",20),i(51,"div",21)(52,"div",22)(53,"div",15),l(54,"CASHLESS"),a()(),i(55,"div",23)(56,"small",24),l(57,"Penjual tidak perlu membayar ongkos kirim ke kurir"),a()()(),i(58,"div",25)(59,"div",26)(60,"div",27),g(61,wi,6,1,"ng-container",20),i(62,"div")(63,"span",15),l(64,"COD: "),a(),i(65,"span",18),l(66),E(67,"number"),a()()(),g(68,vi,7,4,"ng-container",20)(69,Ti,6,1,"ng-container",20),a(),i(70,"div",28),Ye(),f(71,"svg",29),a()()(),qe(),i(72,"div",25)(73,"div",3)(74,"table",30)(75,"thead")(76,"tr")(77,"th",31),l(78,"No."),a(),i(79,"th",32),l(80,"Nama Produk"),a(),i(81,"th",33),l(82,"SKU"),a(),i(83,"th",34),l(84,"Qty"),a()()(),i(85,"tbody"),g(86,Di,10,6,"tr",35),a()()()()()),r&2&&(o(6),s("src",t.marketplaceLogo,k),o(3),u(t.logistic==null?null:t.logistic.Service),o(2),s("src",t.shippingLogo,k),o(7),w(" ",(t.shippingLabel==null?null:t.shippingLabel.ChannelType)==(t.channelType==null?null:t.channelType.Tokopedia)?"Kode Booking: ":"No. Resi: "," "),o(2),u(t.logistic==null?null:t.logistic.Resi_Number),o(3),s("id","RESI"+t.id),o(9),u(t.recipient==null?null:t.recipient.Name),o(5),w(" ",t.recipient==null?null:t.recipient.Address," "),o(7),u(t.store==null?null:t.store.Name),o(2),u(t.store==null?null:t.store.Phone),o(2),w(" ",t.store==null?null:t.store.Address," "),o(2),s("ngIf",(t.recipient==null?null:t.recipient.City)&&(t.recipient==null?null:t.recipient.District)),o(11),s("ngIf",t.shippingLabel==null?null:t.shippingLabel.Weight),o(5),w("Rp. ",t.shippingLabel!=null&&t.shippingLabel.IsCOD?M(67,18,t.shippingLabel==null||t.shippingLabel.SummaryPrice==null?null:t.shippingLabel.SummaryPrice.Total):0,""),o(2),s("ngIf",(t.logistic==null?null:t.logistic.Batas_kirim)&&(t.logistic==null?null:t.logistic.Batas_kirim)!==t.minDate),o(),s("ngIf",t.shippingLabel==null?null:t.shippingLabel.OrderNumber),o(2),s("id","NO"+t.id),o(15),s("ngForOf",t.products))},dependencies:[ye,A,R,U,V],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}"]})}}return n})();var Pi=()=>["/menu/Order/detail"],Ii=(n,c)=>({Number:n,Outlet:c});function Ni(n,c){if(n&1){let e=N();T(0),i(1,"button",21),x("click",function(){_(e);let t=d();return h(t.onPrintMultipleShippingLabel())}),f(2,"i",22),i(3,"span"),l(4,"Print Shipping Label"),a()(),D()}}function Mi(n,c){if(n&1&&(i(0,"span",23),f(1,"img",24),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k)("alt",e.Name),o(),w(" ",e.Name," ")}}function Oi(n,c){if(n&1){let e=N();T(0),i(1,"input",31),b("ngModelChange",function(t){_(e);let p=d().$implicit;return y(p.Selected,t)||(p.Selected=t),h(t)}),x("ngModelChange",function(){_(e);let t=d(3).ngIf,p=d();return h(p.onSelectReadyToShip(t))}),a(),D()}if(n&2){let e=d().$implicit;o(),C("ngModel",e.Selected)}}function ki(n,c){if(n&1&&(i(0,"a",44),l(1),a()),n&2){let e=d().$implicit;s("routerLink",ee(3,Pi))("queryParams",te(4,Ii,e.Number,e.Outlet)),o(),u(e.Number)}}function Li(n,c){if(n&1&&(i(0,"a",45),l(1),a()),n&2){let e=d().$implicit,r=d(3);s("href",r.domain+e.ID,k),o(),u(e.Number)}}function Vi(n,c){if(n&1){let e=N();i(0,"a",46),x("click",function(){_(e);let t=d().$implicit,p=d(3);return h(p.onPrintShippingLabel(t.Number,t.ShopID,t.TypeID))}),f(1,"i",47),a()}}function Fi(n,c){if(n&1&&(i(0,"tr")(1,"td"),g(2,Oi,2,1,"ng-container",4),a(),i(3,"td"),l(4),a(),i(5,"td"),g(6,ki,2,7,"a",39)(7,Li,2,2,"a",40),a(),i(8,"td"),l(9),a(),i(10,"td"),l(11),E(12,"number"),a(),i(13,"td"),l(14),E(15,"date"),a(),i(16,"td"),f(17,"app-channel-logo",41),a(),i(18,"td",42),g(19,Vi,2,0,"a",43),a()()),n&2){let e=c.$implicit,r=d(3);o(2),s("ngIf",e.TypeID==r.channelType.Shopee||e.TypeID==r.channelType.Tokopedia||e.TypeID==r.channelType.Tiktok),o(2),u(e.Outlet),o(2),s("ngIf",r.guidEmpty==e.ID),o(),s("ngIf",r.guidEmpty!=e.ID),o(2),u(e.Customer),o(2),u(M(12,9,e.Amount)),o(3),u(F(15,11,e.Date,"dd MMM yyyy")),o(3),s("typeId",e.TypeID),o(2),s("ngIf",e.TypeID==r.channelType.Shopee||e.TypeID==r.channelType.Tokopedia||e.TypeID==r.channelType.Tiktok||e.TypeID==r.channelType.Lazada)}}function Ai(n,c){if(n&1){let e=N();T(0),i(1,"div",26)(2,"table",27),x("matSortChange",function(t){_(e);let p=d(2);return h(p.onSort(t))}),i(3,"thead",28)(4,"tr",29)(5,"th",30)(6,"input",31),b("ngModelChange",function(t){_(e);let p=d(2);return y(p.isCheckAll,t)||(p.isCheckAll=t),h(t)}),x("ngModelChange",function(){_(e);let t=d().ngIf,p=d();return h(p.onSelectAllReadyToShip(t))}),a()(),i(7,"th",32),l(8,"Outlet"),a(),i(9,"th",33),l(10,"Order number"),a(),i(11,"th"),l(12,"Customer"),a(),i(13,"th",34),l(14,"Amount"),a(),i(15,"th",35),l(16,"Date"),a(),i(17,"th",36),l(18,"Channel"),a(),f(19,"th",37),a()(),i(20,"tbody"),g(21,Fi,20,14,"tr",20),a()(),i(22,"app-mat-paginator-no-count",38),E(23,"async"),E(24,"async"),x("total",function(){_(e);let t=d(2);return h(t.getRowCount())})("next",function(){_(e);let t=d(2);return h(t.NextPage())})("previous",function(){_(e);let t=d(2);return h(t.PreviousPage())}),a()(),D()}if(n&2){let e,r=d().ngIf,t=d();o(6),C("ngModel",t.isCheckAll),o(15),s("ngForOf",r),o(),s("filter",t.filter)("totaldata",(e=M(23,5,t.readyToShip$))==null?null:e.length)("paginationTotal",M(24,7,t.paginationTotal$))}}function Ri(n,c){if(n&1&&(T(0),g(1,Ai,25,9,"ng-container",25),D()),n&2){let e=c.ngIf;d();let r=O(35);o(),s("ngIf",e.length>0)("ngIfElse",r)}}function Wi(n,c){n&1&&(i(0,"div",48),f(1,"app-empty-state"),a())}function Bi(n,c){n&1&&(T(0),i(1,"div",50),l(2,"\xA0"),a(),D())}function zi(n,c){if(n&1&&(T(0),f(1,"app-shipping-label",49),g(2,Bi,3,0,"ng-container",4),D()),n&2){let e=c.$implicit,r=c.index,t=d();o(),s("shippingLabel",e)("id",r),o(),s("ngIf",r!==(t.shippingLabels==null?null:t.shippingLabels.length)-1)}}var Xt=(()=>{class n{constructor(e,r,t,p,S,m){this.http=e,this.localDataService=r,this.dialog=t,this.shippingLabelService=p,this.datePipe=S,this.authService=m,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.channelType=P,this.guidEmpty=I.GuidEMpty,this.selectedReadyToShip=[],this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}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.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.getReadyToShip()})}getReadyToShip(e){var r={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",r).pipe(H(t=>t.Data),he(1)),this.readyToShip$=this.sourceObs$}onPrintMultipleShippingLabel(){let e=this.filterReadyToShipByChannel(this.selectedReadyToShip,P.Tokopedia),r=this.filterReadyToShipByChannel(this.selectedReadyToShip,P.Shopee),t=this.filterReadyToShipByChannel(this.selectedReadyToShip,P.Tiktok),p=[];e.length>0&&p.push(this.shippingLabelService.getTokopediaShippingLabel(this.shippingLabelPayload(e))),r.length>0&&p.push(this.shippingLabelService.getShopeeShippingLabel(this.shippingLabelPayload(r))),t.length>0&&p.push(this.shippingLabelService.getTiktokShippingLabel(this.shippingLabelPayload(t))),Ze(p).pipe(H(S=>S.reduce((m,Ee)=>m.concat(Ee),[]))).subscribe({next:S=>{this.shippingLabels=S,this.printShippingLabel()}})}filterReadyToShipByChannel(e,r){return e.filter(t=>t.TypeID==r)}shippingLabelPayload(e){return e.map(r=>({ShopID:r.ShopID,OrderNumber:r.Number}))}printShippingLabel(){setTimeout(()=>{this.setPdfname(),window.print()},500)}onPrintShippingLabel(e,r,t){switch(t){case P.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e);break;case P.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e,r);break;case P.Shopee:this.shippingLabelService.printShippingLabelShopee(e,r);break;case P.Lazada:this.shippingLabelService.printShippingLabelLazada(e,r);break}}setPdfname(){if(this.selectedReadyToShip.length>1){let e=new Date,r=this.datePipe.transform(e,"dd-MM-yyyy"),t=this.datePipe.transform(e,"HH-mm");document.title=`ShippingLabel_${r}_${t}`}else{let e=this.selectedReadyToShip[0].Number;document.title=`ShippingLabel_${e}`}}getSelectedReadyToShip(e){return e.filter(r=>r.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(H(r=>r?.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 r=e.direction=="asc";this.readyToShip$=this.readyToShip$.pipe(H(t=>t.sort((p,S)=>I.compare(p.Date,S.Date,r))))}}onSelectReadyToShip(e){this.selectedReadyToShip=this.getSelectedReadyToShip(e)}onSelectAllReadyToShip(e){e=e.map(r=>((r.TypeID==P.Tokopedia||r.TypeID==P.Shopee||r.TypeID==P.Lazada)&&(r.Selected=this.isCheckAll),r)),this.selectedReadyToShip=this.getSelectedReadyToShip(e)}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(se),v(xe),v(He),v(V),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-ready-to-ship"]],standalone:!1,decls:38,vars:13,consts:[["EMPTY_STATE",""],["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],[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"],[2,"width","18px",3,"src","alt"],[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,"ngModelChange","ngModel"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","date",2,"width","130px"],[2,"width","114px"],[2,"width","10px"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[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(r,t){if(r&1){let p=N();i(0,"mainpanel",1),x("onSubmit",function(m){return _(p),h(t.getReadyToShip(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()(),g(6,Ni,5,0,"ng-container",4),a(),i(7,"filters")(8,"div")(9,"label",5),l(10,"Channel"),a(),i(11,"ng-select",6),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(12,Mi,3,3,"ng-template",7),a()(),i(13,"div",8)(14,"label",9),l(15,"Page Number"),a(),i(16,"input",10),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(17,"div",8)(18,"label",9),l(19,"Page Size"),a(),i(20,"input",11),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(21,"div",8)(22,"label",12),l(23,"From/To"),a(),i(24,"div",13)(25,"datepicker",14),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(26,"div")(27,"datepicker",15),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(28,"content")(29,"div",16)(30,"div",17)(31,"div",18),g(32,Ri,2,2,"ng-container",4),E(33,"async"),g(34,Wi,2,0,"ng-template",null,0,B),a()()()()(),i(36,"div",19),g(37,zi,3,3,"ng-container",20),a()}r&2&&(o(6),s("ngIf",t.selectedReadyToShip.length>0),o(5),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",M(33,11,t.readyToShip$)),o(5),s("ngForOf",t.shippingLabels))},dependencies:[A,R,q,ie,Be,z,G,j,Y,J,ne,ae,$,pe,me,oe,le,X,Ue,Ce,U,V],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}}"]})}}return n})();var Gi=()=>["/menu/Order/detail"],ji=(n,c)=>({Number:n,Outlet:c});function Hi(n,c){if(n&1&&(i(0,"span",19),f(1,"img",20),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k)("alt",e.Name),o(),w(" ",e.Name," ")}}function Ui(n,c){if(n&1&&(i(0,"a",35),l(1),a()),n&2){let e=d().$implicit;s("routerLink",ee(3,Gi))("queryParams",te(4,ji,e.Number,e.Outlet)),o(),u(e.Number)}}function Yi(n,c){if(n&1&&(i(0,"a",36),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.domain+e.ID,k),o(),u(e.Number)}}function qi(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,Ui,2,7,"a",32)(5,Yi,2,2,"a",33),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),f(15,"app-channel-logo",34),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(F(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.TypeID)}}function Ki(n,c){if(n&1){let e=N();T(0),i(1,"div",21)(2,"table",22),x("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),l(6,"Outlet"),a(),i(7,"th",26),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",27),l(12,"Amount"),a(),i(13,"th",28),l(14," Created On "),a(),i(15,"th",29),l(16,"Channel"),a()()(),i(17,"tbody"),g(18,qi,16,12,"tr",30),a()(),i(19,"app-mat-paginator-no-count",31),x("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(18),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function Ji(n,c){n&1&&(i(0,"div",37),f(1,"app-empty-state"),a())}var Qt=(()=>{class n{constructor(e,r,t){this.http=e,this.localDataService=r,this.authService=t,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=P,this.channelOptions=this.authService.getChannels()}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.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(e){return e==I.GuidEMpty}Get(e){var r={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",r).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.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(r=>{this.paginationTotal=r.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 r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(se),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-shipped"]],standalone:!1,decls:34,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[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,"total","next","previous","filter","totaldata","paginationTotal"],[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(r,t){if(r&1){let p=N();i(0,"mainpanel",1),x("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),a(),i(10,"ng-select",5),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(11,Hi,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),a(),i(15,"input",9),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),a(),i(19,"input",10),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(20,"div",7)(21,"label",11),l(22,"From/To"),a(),i(23,"div",12)(24,"datepicker",13),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(25,"div")(26,"datepicker",14),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),g(31,Ki,20,4,"ng-container",18)(32,Ji,2,0,"ng-template",null,0,B),a()()()()()}if(r&2){let p=O(33);o(10),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,q,ie,z,G,j,Y,J,ne,ae,$,pe,me,oe,le,X,U,V],encapsulation:2})}}return n})();var $i=()=>["/menu/Order/detail"],Xi=(n,c)=>({Number:n,Outlet:c});function Qi(n,c){if(n&1&&(i(0,"span",19),f(1,"img",20),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k)("alt",e.Name),o(),w(" ",e.Name," ")}}function Zi(n,c){if(n&1&&(i(0,"a",35),l(1),a()),n&2){let e=d().$implicit;s("routerLink",ee(3,$i))("queryParams",te(4,Xi,e.Number,e.Outlet)),o(),u(e.Number)}}function en(n,c){if(n&1&&(i(0,"a",36),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.customerInfoUrl+e.ID,k),o(),u(e.Number)}}function tn(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,Zi,2,7,"a",32)(5,en,2,2,"a",33),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),f(15,"app-channel-logo",34),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(F(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.TypeID)}}function nn(n,c){if(n&1){let e=N();T(0),i(1,"div",21)(2,"table",22),x("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),l(6,"Outlet"),a(),i(7,"th",26),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",27),l(12,"Amount"),a(),i(13,"th",28),l(14," Created On "),a(),i(15,"th",29),l(16,"Channel"),a()()(),i(17,"tbody"),g(18,tn,16,12,"tr",30),a()(),i(19,"app-mat-paginator-no-count",31),x("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(18),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function an(n,c){n&1&&(i(0,"div",37),f(1,"app-empty-state"),a())}var Zt=(()=>{class n{constructor(e,r){this.http=e,this.authService=r,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=P,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==I.GuidEMpty}getChannelLogo(e){return I.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.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var r={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 ",r).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.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(r=>{this.paginationTotal=r.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 r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-delivered"]],standalone:!1,decls:34,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[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,"total","next","previous","filter","totaldata","paginationTotal"],[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(r,t){if(r&1){let p=N();i(0,"mainpanel",1),x("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),a(),i(10,"ng-select",5),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(11,Qi,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),a(),i(15,"input",9),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),a(),i(19,"input",10),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(20,"div",7)(21,"label",11),l(22,"From/To"),a(),i(23,"div",12)(24,"datepicker",13),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(25,"div")(26,"datepicker",14),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),g(31,nn,20,4,"ng-container",18)(32,an,2,0,"ng-template",null,0,B),a()()()()()}if(r&2){let p=O(33);o(10),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,q,ie,z,G,j,Y,J,ne,ae,$,pe,me,oe,le,X,U,V],encapsulation:2})}}return n})();var rn=()=>["/menu/Order/detail"],on=(n,c)=>({Number:n,Outlet:c});function ln(n,c){if(n&1&&(i(0,"span",21),f(1,"img",22),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k)("alt",e.Name),o(),w(" ",e.Name," ")}}function pn(n,c){if(n&1&&(i(0,"a",38),l(1),a()),n&2){let e=d().$implicit;s("routerLink",ee(3,rn))("queryParams",te(4,on,e.Number,e.Outlet)),o(),u(e.Number)}}function mn(n,c){if(n&1&&(i(0,"a",39),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.domain+e.ID,k),o(),u(e.Number)}}function sn(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,pn,2,7,"a",35)(5,mn,2,2,"a",36),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),l(15),a(),i(16,"td"),f(17,"app-channel-logo",37),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,8,e.Amount)),o(3),u(F(13,10,e.Created,"dd MMM yyyy HH:mm")),o(3),u(e.State),o(2),s("typeId",e.TypeID)}}function dn(n,c){if(n&1){let e=N();T(0),i(1,"div",23)(2,"table",24),x("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",25)(4,"tr",26)(5,"th",27),l(6,"Outlet"),a(),i(7,"th",28),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",29),l(12,"Amount"),a(),i(13,"th",30),l(14," Created On "),a(),i(15,"th",31),l(16,"Status"),a(),i(17,"th",32),l(18,"Channel"),a()()(),i(19,"tbody"),g(20,sn,18,13,"tr",33),a()(),i(21,"app-mat-paginator-no-count",34),x("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(20),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function cn(n,c){n&1&&(i(0,"div",40),f(1,"app-empty-state"),a())}var ei=(()=>{class n{constructor(e,r,t,p){this.http=e,this.localDataService=r,this.authService=t,this.dialog=p,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==I.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.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var r={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",r).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}openExportDialog(){this.dialog.open(Lt,{data:{title:"Export Order All",pageNumber:this.filter.PageNumber,rowCount:this.filter.PageSize,filterExport:this.filter,getRowCountApi:"orders/GetRowCount",exportApi:"orders/GetExportAll"}}).afterClosed().subscribe()}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(r=>{this.paginationTotal=r.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 r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(se),v(K),v(xe))}}static{this.\u0275cmp=L({type:n,selectors:[["app-all-order"]],standalone:!1,decls:38,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[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,"total","next","previous","filter","totaldata","paginationTotal"],[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(r,t){if(r&1){let p=N();i(0,"mainpanel",1),x("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()(),i(6,"button",4),x("click",function(){return _(p),h(t.openExportDialog())}),f(7,"i",5),i(8,"span"),l(9,"Export"),a()()(),i(10,"filters")(11,"div")(12,"label",6),l(13,"Channel"),a(),i(14,"ng-select",7),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(15,ln,3,3,"ng-template",8),a()(),i(16,"div",9)(17,"label",10),l(18,"Page Number"),a(),i(19,"input",11),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(20,"div",9)(21,"label",10),l(22,"Page Size"),a(),i(23,"input",12),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(24,"div",9)(25,"label",13),l(26,"From/To"),a(),i(27,"div",14)(28,"datepicker",15),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(29,"div")(30,"datepicker",16),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(31,"content")(32,"div",17)(33,"div",18)(34,"div",19),g(35,dn,22,4,"ng-container",20)(36,cn,2,0,"ng-template",null,0,B),a()()()()()}if(r&2){let p=O(37);o(14),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,q,ie,z,G,j,Y,J,ne,ae,$,pe,me,oe,le,X,U,V],encapsulation:2})}}return n})();var _n=()=>["/menu/Order/detail"],hn=(n,c)=>({Number:n,Outlet:c});function gn(n,c){if(n&1&&(i(0,"span",20),f(1,"img",21),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k)("alt",e.Name),o(),w(" ",e.Name," ")}}function un(n,c){if(n&1&&(i(0,"a",36),l(1),a()),n&2){let e=d().$implicit;s("routerLink",ee(3,_n))("queryParams",te(4,hn,e.Number,e.Outlet)),o(),u(e.Number)}}function fn(n,c){if(n&1&&(i(0,"a",37),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.domain+e.ID,k),o(),u(e.Number)}}function Sn(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,un,2,7,"a",33)(5,fn,2,2,"a",34),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),f(15,"app-channel-logo",35),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(F(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.TypeID)}}function Cn(n,c){if(n&1){let e=N();T(0),i(1,"div",22)(2,"table",23),x("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",24)(4,"tr",25)(5,"th",26),l(6,"Outlet"),a(),i(7,"th",27),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",28),l(12,"Amount"),a(),i(13,"th",29),l(14," Created On "),a(),i(15,"th",30),l(16,"Channel"),a()()(),i(17,"tbody"),g(18,Sn,16,12,"tr",31),a()(),i(19,"app-mat-paginator-no-count",32),x("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(18),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function yn(n,c){n&1&&(i(0,"div",38),f(1,"app-empty-state"),a())}var ti=(()=>{class n{constructor(e,r,t){this.http=e,this.localDataService=r,this.authService=t,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],Note:"",From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==I.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.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var r={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 ",r).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.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(r=>{this.paginationTotal=r.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(e){return I.getChannelLogoByTypeId(e)}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(se),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-cancelled"]],standalone:!1,decls:38,vars:11,consts:[["EMPTY_STATE",""],["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","Note",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[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,"total","next","previous","filter","totaldata","paginationTotal"],[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(r,t){if(r&1){let p=N();i(0,"mainpanel",1),x("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),a(),i(10,"ng-select",5),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(11,gn,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),a(),i(15,"input",9),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),a(),i(19,"input",10),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(20,"div",7)(21,"label",8),l(22,"Note"),a(),i(23,"input",11),b("ngModelChange",function(m){return _(p),y(t.filter.Note,m)||(t.filter.Note=m),h(m)}),a()(),i(24,"div",7)(25,"label",12),l(26,"From/To"),a(),i(27,"div",13)(28,"datepicker",14),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(29,"div")(30,"datepicker",15),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(31,"content")(32,"div",16)(33,"div",17)(34,"div",18),g(35,Cn,20,4,"ng-container",19)(36,yn,2,0,"ng-template",null,0,B),a()()()()()}if(r&2){let p=O(37);o(10),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(4),C("ngModel",t.filter.Note),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,q,ie,z,G,j,Y,J,ne,ae,$,pe,me,oe,le,X,U,V],encapsulation:2})}}return n})();var bn=(n,c)=>({"over-due-today":n,"over-due":c}),xn=n=>({"over-due":n});function wn(n,c){n&1&&(T(0),i(1,"a",19),l(2," Download V2 "),a(),D())}function vn(n,c){if(n&1){let e=N();T(0),i(1,"div",20)(2,"button",21),x("click",function(){_(e),d();let t=O(12);return h(t.previous())}),l(3," Back "),a(),i(4,"button",22),x("click",function(){_(e);let t=d(),p=O(12);return h(t.onNext(p))}),l(5," Next "),a()(),D()}if(n&2){let e=d();o(4),s("disabled",e.checkDisabledNextFilter())}}function Tn(n,c){if(n&1){let e=N();T(0),i(1,"button",23),x("click",function(){_(e);let t=d(),p=O(12);return h(t.onNext(p))}),l(2," Next "),a(),D()}if(n&2){let e=d();o(),s("disabled",e.checkDisabledNextFilter())}}function Dn(n,c){if(n&1){let e=N();T(0),i(1,"button",24),x("click",function(){_(e);let t=d(),p=O(12);return h(t.onNew(p))}),f(2,"i",25),l(3," New "),a(),D()}}function En(n,c){n&1&&(f(0,"i",26),i(1,"span"),l(2,"Filter"),a())}function Pn(n,c){if(n&1&&(i(0,"ng-option",36),f(1,"img",37),l(2),a()),n&2){let e=c.$implicit;s("value",e.ID),o(),s("src",e==null?null:e.Img,k),o(),w("",e.Name," ")}}function In(n,c){if(n&1){let e=N();i(0,"div",32)(1,"div",28)(2,"h5"),l(3,"Type"),a(),i(4,"p",29),l(5," Select Type want to download "),a()(),i(6,"div",28)(7,"div",38)(8,"div")(9,"mat-radio-group",39),b("ngModelChange",function(t){_(e);let p=d(2);return y(p.downloadType,t)||(p.downloadType=t),h(t)}),i(10,"mat-radio-button",40),l(11," Orders "),a(),i(12,"mat-radio-button",41),l(13," Disbursement "),a()()()(),i(14,"div",42)(15,"div",43),f(16,"i",44),a(),i(17,"p",45),l(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(n&2){let e=d(2);o(9),C("ngModel",e.downloadType),o(),s("value",!1),o(2),s("value",!0)}}function Nn(n,c){n&1&&(i(0,"p",29),l(1," Select Disbursement date "),i(2,"span",46),l(3,"(payment date / order complete date)"),a(),l(4," of the channel you want to download (Max 1 Week). "),a())}function Mn(n,c){n&1&&(i(0,"p",29),l(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function On(n,c){if(n&1){let e=N();T(0),i(1,"div",47)(2,"app-timepicker",48),b("timeChange",function(t){_(e);let p=d(2);return y(p.timeFrom,t)||(p.timeFrom=t),h(t)}),a(),i(3,"span",49),l(4,"-"),a(),i(5,"app-timepicker",48),b("timeChange",function(t){_(e);let p=d(2);return y(p.timeTo,t)||(p.timeTo=t),h(t)}),a()(),D()}if(n&2){let e=d(2);o(2),C("time",e.timeFrom),o(3),C("time",e.timeTo)}}function kn(n,c){if(n&1){let e=N();i(0,"div",27)(1,"div",8)(2,"div",7)(3,"div",28)(4,"h5"),l(5,"Select a Channel"),a(),i(6,"p",29),l(7," Select Channel want to download order "),a()(),i(8,"div",28)(9,"ng-select",30),b("ngModelChange",function(t){_(e);let p=d();return y(p.channelID,t)||(p.channelID=t),h(t)}),x("ngModelChange",function(){_(e);let t=d();return h(t.onSelectChannel())}),g(10,Pn,3,3,"ng-option",31),a()()(),g(11,In,19,3,"div",32),E(12,"async"),i(13,"div",32)(14,"div",28)(15,"h5"),l(16,"Date Range"),a(),g(17,Nn,5,0,"p",29)(18,Mn,2,0,"p",29),a(),i(19,"div",28)(20,"div",8)(21,"mat-date-range-input",33)(22,"input",34),b("ngModelChange",function(t){_(e);let p=d();return y(p.startDate,t)||(p.startDate=t),h(t)}),x("click",function(){_(e);let t=O(25);return h(t.open())}),a(),i(23,"input",35),b("ngModelChange",function(t){_(e);let p=d();return y(p.endDate,t)||(p.endDate=t),h(t)}),x("click",function(){_(e);let t=O(25);return h(t.open())})("ngModelChange",function(){_(e);let t=d();return h(t.onFilterDateChange())}),a()(),f(24,"mat-date-range-picker",null,1),a(),g(26,On,6,2,"ng-container",5),a()()()()}if(n&2){let e,r=O(25),t=d();o(9),s("clearable",!1),C("ngModel",t.channelID),o(),s("ngForOf",t.channelOptions),o(),Ke((e=M(12,9,t.channelDetail$))!=null&&e.ServiceFeeWriteOff?11:-1),o(6),Ke(t.downloadType()&&(t.currentChannel==null?null:t.currentChannel.TypeID)==t.channelType.Tokopedia?17:18),o(4),s("rangePicker",r),o(),C("ngModel",t.startDate),o(),C("ngModel",t.endDate),o(3),s("ngIf",t.showTimePicker)}}function Ln(n,c){n&1&&(f(0,"i",50),i(1,"span"),l(2,"Preview"),a())}function Vn(n,c){if(n&1&&(i(0,"th",72),l(1),a()),n&2){let e=d(3);o(),w(" ",e.currentChannel?"Created Date":"Last Status Update"," ")}}function Fn(n,c){if(n&1&&(i(0,"td"),l(1),E(2,"date"),a()),n&2){let e=d().$implicit;o(),w(" ",F(2,1,e.Date,"dd MMM yyyy HH:mm:ss")," ")}}function An(n,c){if(n&1&&(i(0,"span"),l(1),a()),n&2){let e=d().$implicit;o(),w(" ",e.ActionString," ")}}function Rn(n,c){if(n&1&&(i(0,"li"),l(1),a()),n&2){let e=c.$implicit;o(),w(" ",e," ")}}function Wn(n,c){if(n&1&&(i(0,"ul",77),g(1,Rn,2,1,"li",73),a()),n&2){let e=d().$implicit;o(),s("ngForOf",e.ActionString)}}function Bn(n,c){if(n&1&&(i(0,"span",78),f(1,"i",79),a()),n&2){let e=d().$implicit;rt("title","Delivery : ",e.DeliveryState,`
|
|
5
|
-
Payment : `,e.PaymentState,"")}}function zn(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),l(4),a(),g(5,Fn,3,4,"td",5),i(6,"td")(7,"span"),l(8),a(),l(9),a(),i(10,"td",74)(11,"span"),l(12),a(),l(13),a(),i(14,"td"),g(15,An,2,1,"span",5)(16,Wn,2,1,"ul",75),a(),i(17,"td"),g(18,Bn,2,3,"span",76),a()()),n&2){let e=c.$implicit,r=c.index,t=d(4);o(2),u(r+1),o(2),u(e.Number),o(),s("ngIf",(t.currentChannel==null?null:t.currentChannel.TypeID)!=t.channelType.Shopee&&(t.currentChannel==null?null:t.currentChannel.TypeID)!==t.channelType.Tiktok),o(3),w("",e.ChannelStatus," - "),o(),w("",e.ChannelStatusDescription," "),o(),s("ngClass",te(12,bn,(e==null?null:e.Action)==t.actionPreviewOrder.Update,(e==null?null:e.Action)==t.actionPreviewOrder.New))("matTooltip",e.POSStatus==91||e.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),o(2),w("",e.POSStatus," - "),o(),w("",e.POSStatusDescription," "),o(2),s("ngIf",e.ActionString.length==1),o(),s("ngIf",e.ActionString.length>1),o(2),s("ngIf",e.ChannelStatus!=99&&e.POSStatus!=99)}}function Gn(n,c){if(n&1&&(T(0),g(1,zn,19,15,"tr",73),D()),n&2){let e=d(3);o(),s("ngForOf",e.displayedPreviewData)}}function jn(n,c){n&1&&(i(0,"tr",80)(1,"td",81)(2,"div",82),f(3,"i",83),a(),i(4,"h4",84),l(5," There is no order to processed "),a()()())}function Hn(n,c){if(n&1){let e=N();i(0,"div",52)(1,"div",53)(2,"div",54)(3,"div",55)(4,"div")(5,"ul",56)(6,"li",57)(7,"button",58),x("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.ALL))}),l(8),a()(),i(9,"li",59)(10,"button",60),x("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.SYNC))}),l(11),a()(),i(12,"li",59)(13,"button",61),x("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.WRONG))}),l(14),a()(),i(15,"li",59)(16,"button",62),x("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.UNSYNC))}),l(17),a()()()(),i(18,"div")(19,"button",63),x("click",function(){_(e);let t=d(2);return h(t.exportOrders())}),f(20,"i",64),i(21,"span"),l(22,"Export"),a()()()()(),i(23,"table",65)(24,"thead",66)(25,"tr"),f(26,"th",67),i(27,"th",68),l(28,"Number"),a(),g(29,Vn,2,1,"th",69),i(30,"th",70),l(31,"Channel Status"),a(),i(32,"th",70),l(33,"POS Status"),a(),i(34,"th"),l(35,"Action"),a(),f(36,"th",67),a()(),i(37,"tbody"),g(38,Gn,2,1,"ng-container",71)(39,jn,6,0,"ng-template",null,2,B),a()()()()}if(n&2){let e=O(40),r=d(2);o(7),s("ngClass",r.pillStatus=="all"?"btn-secondary text-white":"btn-outline-dark"),o(),w(" All (",r.allData,") "),o(2),s("ngClass",r.pillStatus=="sync"?"btn-success":"btn-outline-success"),o(),w(" Existing (",r.syncData,") "),o(2),s("ngClass",r.pillStatus=="wrong"?"btn-warning text-white":"btn-outline-warning"),o(),w(" Wrong Status (",r.wrongData,") "),o(2),s("ngClass",r.pillStatus=="unsync"?"btn-danger":"btn-outline-danger"),o(),w(" Missing (",r.unsyncData,") "),o(12),s("ngIf",(r.currentChannel==null?null:r.currentChannel.TypeID)!=r.channelType.Shopee&&(r.currentChannel==null?null:r.currentChannel.TypeID)!==r.channelType.Tiktok),o(9),s("ngIf",r.displayedPreviewData.length>0)("ngIfElse",e)}}function Un(n,c){if(n&1&&g(0,Hn,41,11,"div",51),n&2){let e=d();s("ngIf",e.currentState=="preview")}}function Yn(n,c){n&1&&(f(0,"i",85),i(1,"span"),l(2,"Finish"),a())}function qn(n,c){if(n&1&&(i(0,"tr",87)(1,"td"),l(2),a(),i(3,"td"),l(4),a(),i(5,"td"),l(6),a(),i(7,"td"),l(8),a()()),n&2){let e=c.$implicit,r=c.index;s("ngClass",lt(5,xn,e.Exception)),o(2),u(r+1),o(2),u(e.Number),o(2),u(e.Status),o(2),u(e.Exception)}}function Kn(n,c){if(n&1&&(T(0),g(1,qn,9,7,"tr",86),D()),n&2){let e=d(3);o(),s("ngForOf",e.downloadData)}}function Jn(n,c){n&1&&(i(0,"tr",80)(1,"td",81)(2,"div",82),f(3,"i",83),a(),i(4,"h4",84),l(5," There is no order to processed "),a()()())}function $n(n,c){if(n&1&&(i(0,"div",52)(1,"div",53)(2,"table",65)(3,"thead",66)(4,"tr"),f(5,"th",67),i(6,"th"),l(7,"Order Number"),a(),i(8,"th"),l(9,"Status"),a(),i(10,"th"),l(11,"Exception"),a()()(),i(12,"tbody"),g(13,Kn,2,1,"ng-container",71)(14,Jn,6,0,"ng-template",null,3,B),a()()()()),n&2){let e=O(15),r=d(2);o(13),s("ngIf",(r.downloadData==null?null:r.downloadData.length)>0)("ngIfElse",e)}}function Xn(n,c){if(n&1&&g(0,$n,16,2,"div",51),n&2){let e=d();s("ngIf",e.currentState=="finish")}}function Qn(n,c){n&1&&(i(0,"h6"),l(1,"1"),a())}function Zn(n,c){n&1&&(i(0,"h6"),l(1,"2"),a())}function ea(n,c){n&1&&(i(0,"h6"),l(1,"3"),a())}var Z=function(n){return n.ALL="all",n.SYNC="sync",n.WRONG="wrong",n.UNSYNC="unsync",n}(Z||{}),ii=(()=>{class n{constructor(e,r,t,p,S,m,Ee){this.http=e,this.toastr=r,this.datePipe=t,this.url=p,this.productService=S,this.orderService=m,this.authService=Ee,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=P,this.previewStatus=Z,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=Pe,this.cacheKey="",this.showTimePicker=!1,this.downloadType=nt(!1),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initTimeFilter(),this.url.queryParams.subscribe(e=>{this.channelID=e.ChannelID,this.startDate=new Date(e.Date),this.endDate=new Date(e.Date)})}initTimeFilter(){this.timeFrom="00:00",this.timeTo="23:59"}onDownload(e){let r={ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData,IsDisbursement:this.downloadType(),cacheKey:this.cacheKey};this.http.post("/api/Orders/Download",r).subscribe(t=>{this.downloadData=t.Body,this.onStepperNext(e)})}onPreview(e){if(!this.validateDatePreview())return;let r={ID:this.channelID,From:this.startDate,To:this.endDate,IsDisbursement:this.downloadType()};this.showTimePicker&&(r=Qe(Xe({},r),{TimeFrom:this.timeFrom+":00",TimeTo:this.timeTo+":00"})),this.http.post("/api/Orders/Preview",r).subscribe(t=>{if(t.Data.length==0){this.toastrEmptyPreview();return}this.cacheKey=t.cacheKey,this.previewData=t.Data,this.groupingPreviewData(),this.filterPreviewData(Z.ALL),this.initLengthStatusData(),this.onStepperNext(e)})}toastrEmptyPreview(){let e=this.datePipe.transform(this.startDate,"dd MMM yyyy"),r=this.datePipe.transform(this.endDate,"dd MMM yyyy"),t=this.showTimePicker?this.timeFrom+":00":"",p=this.showTimePicker?this.timeTo+":00":"";this.toastr.info(`There is no orders from ${e} ${t} to ${r} ${p}!`,"No Orders!")}validateDatePreview(){let e=!0;return this.downloadType()==!0?I.getDaysDiff(this.startDate,this.endDate)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Failed"),e=!1):I.getDaysDiff(this.startDate,this.endDate)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),e=!1),e}onSelectChannel(){this.currentChannel=this.channelOptions.find(e=>e.ID==this.channelID),this.initGetChannelDetail()}initGetChannelDetail(){this.currentChannel.TypeID==P.Tokopedia?this.channelDetail$=this.http.post("/api/ChannelLoader/GetChannelView",{ID:this.currentChannel.ID}).pipe(H(e=>e?.Model),he(1)):this.channelDetail$=null}setPageTitle(e){this.pageTitle=`
|
|
6
|
-
${e} (${this.getDateTitle()})
|
|
7
|
-
`}getDateTitle(){let e=I.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),r=this.datePipe.transform(this.startDate,e),t=this.datePipe.transform(this.endDate,"dd MMM yyyy");return`${e==null?"":r+"-"} ${t}`}onNew(e){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",this.channelDetail$=null,e.reset()}groupingPreviewData(){let e=this.filterDataByStatus(Z.UNSYNC),r=this.filterDataByStatus(Z.WRONG),t=[];this.currentChannel.TypeID==P.Tokopedia&&(t=this.filterDataByStatus(Z.SYNC)),this.downloadedPreviewData=[...t,...e,...r]}filterDataByStatus(e){let r=[];switch(e){case Z.ALL:r=this.previewData;break;case Z.SYNC:r=this.previewData.filter(t=>t.Action==Pe.DoNothing);break;case Z.WRONG:r=this.previewData.filter(t=>t.Action==Pe.Update);break;case Z.UNSYNC:r=this.previewData.filter(t=>t.Action==Pe.New);break}return r}filterPreviewData(e){this.pillStatus=e,this.displayedPreviewData=this.filterDataByStatus(e)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(Z.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(Z.SYNC).length,this.unsyncData=this.filterDataByStatus(Z.UNSYNC).length}getTypeID(){var e=this.channelOptions.find(r=>r.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 r=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${r?.Name}`);break;case"finish":this.setPageTitle("Download");break}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let e=!I.isValidDate(this.startDate)||!I.isValidDate(this.endDate),r=I.IsEmpty(this.channelID);return e||r}exportOrders(){let e={ID:this.channelID,From:this.startDate,To:this.endDate},r=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(e,r).subscribe()}onFilterDateChange(){let e=1;this.startDate&&this.endDate&&(e=I.getDaysDiff(this.startDate,this.endDate)),this.showTimePicker=e==0}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(be),v(V),v(Re),v(Pt),v(we),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-download"]],standalone:!1,features:[ot([{provide:At,useValue:{displayDefaultIndicatorType:!1}}])],decls:25,vars:13,consts:[["stepper",""],["picker",""],["EMPTY",""],["EMPTY_DOWNLOAD",""],[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectionChange","ngClass"],["state","filter",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","preview",3,"editable","completed"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],["routerLink","/menu/Order/Download",1,"btn","btn-outline-secondary","btn-fill","me-3"],[1,"btn-group","me-3"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"fa-solid","fa-filter","me-3"],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[1,"mt-8"],[3,"timeChange","time"],[1,"mx-4"],[1,"fa-solid","fa-file","me-3"],["class","row pt-2",4,"ngIf"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["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"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"]],template:function(r,t){if(r&1){let p=N();i(0,"mainpanel",4)(1,"actions"),g(2,wn,3,0,"ng-container",5)(3,vn,6,1,"ng-container",5)(4,Tn,3,1,"ng-container",5)(5,Dn,4,0,"ng-container",5),a(),i(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"mat-stepper",10,0),x("selectionChange",function(m){return _(p),h(t.stepChange(m))})("selectionChange",function(m){return _(p),h(t.onStepperChange(m))}),i(13,"mat-step",11),g(14,En,3,0,"ng-template",12)(15,kn,27,11,"ng-template",13),a(),i(16,"mat-step",14),g(17,Ln,3,0,"ng-template",12)(18,Un,1,1,"ng-template",13),a(),i(19,"mat-step",15),g(20,Yn,3,0,"ng-template",12)(21,Xn,1,1,"ng-template",13),a(),g(22,Qn,2,0,"ng-template",16)(23,Zn,2,0,"ng-template",17)(24,ea,2,0,"ng-template",18),a()()()()()()()}if(r&2){let p=O(12);s("headerTitle",t.pageTitle)("description",t.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),o(2),s("ngIf",t.currentState=="filter"),o(),s("ngIf",t.currentState=="preview"),o(),s("ngIf",t.currentState=="filter"),o(),s("ngIf",t.currentState=="finish"),o(6),at("ngClass","last-edited-step-"+p.selectedIndex),o(2),s("editable",t.currentState!="finish")("completed",!1),o(3),s("editable",t.currentState!="finish")("completed",!1)}},dependencies:[pt,A,R,q,z,G,j,Y,J,dt,It,Nt,Mt,Ot,zt,Rt,Gt,Wt,Bt,_t,ze,vt,Tt,Ce,V],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{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-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}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
|
|
8
|
-
`],encapsulation:2})}}return n})();var ta=[{path:"",component:Yt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:Kt,canActivate:[re],data:{title:"New Order"}},{path:"detail",component:Jt,canActivate:[re],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Xt,canActivate:[re],data:{title:"Ready To Ship"}},{path:"Shipped",component:Qt,canActivate:[re],data:{title:"Shipped"}},{path:"Delivered",component:Zt,canActivate:[re],data:{title:"Delivered"}},{path:"All",component:ei,canActivate:[re],data:{title:"All Order"}},{path:"Cancelled",component:ti,canActivate:[re],data:{title:"Cancelled"}},{path:"Download/V1",component:ii,canActivate:[re],data:{title:"Download V1"}},{path:"Download",loadComponent(){return import("./chunk-ZCK76CIK.js").then(n=>n.DownloadV2Component)},canActivate:[re],data:{title:"Download"}},{path:"Download_Order_Log",loadComponent:()=>import("./chunk-AUFEVLWI.js").then(n=>n.DownloadOrderLogComponent),canActivate:[re],data:{title:"Download Order Log"}},{path:"Download_Order_Log/Detail",loadComponent:()=>import("./chunk-ONK4P7TL.js").then(n=>n.DownloadOrderDetailComponent),canActivate:[re],data:{title:"Download Order Log Detail"}}]}],ni=(()=>{class n{static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275mod=Ae({type:n})}static{this.\u0275inj=Fe({imports:[ye,We.forChild(ta)]})}}return n})();var lo=(()=>{class n{static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275mod=Ae({type:n})}static{this.\u0275inj=Fe({providers:[we,Ge,He],imports:[ye,st,ni,wt,Ct,Vt,We,ct,kt,Ft,$,jt,ht,bt,Ut,St,Et,yt,X,Ue,ze,Dt]})}}return n})();export{lo as OrdersModule};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as h,b as f}from"./chunk-ARIW575T.js";import{a as i}from"./chunk-74NNHYZD.js";import"./chunk-QAEN52IK.js";import"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import"./chunk-W6T7TOHE.js";import{F as C,J as n,n as o}from"./chunk-B6POIFQM.js";import{Eb as l,Fb as c,Wb as s,gc as u,hc as d,ic as r,ka as p,qb as m}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var v=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,P){t&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),d()()(),r(4,"router-outlet")),t&2&&(m(3),s("Tabs",P.priceTabs))},dependencies:[o,f,h,n,C],encapsulation:2})}}return e})();var M=[{path:"",component:v,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-3F5YNXJZ.js").then(e=>e.PricePosChannelComponent)},canActivate:[i],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-5F7JXOEW.js").then(e=>e.CustomChannelPriceComponent)},canActivate:[i],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-5WY7E5DR.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[i],data:{title:"Price Single Channel Comparison"}}]}],j=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=c({type:e})}static{this.\u0275inj=p({imports:[o,n.forChild(M)]})}}return e})();export{j as PriceRoutingModule};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as pt}from"./chunk-N253NBCW.js";import{a as Ct}from"./chunk-23MIIDCT.js";import{a as mt,b as ct}from"./chunk-K5CKXDIJ.js";import{c as ft}from"./chunk-E24BKGBJ.js";import{f as ht}from"./chunk-4RAOUTR2.js";import{b as D,c as P,i as E,j as k}from"./chunk-XOT2SZPE.js";import{r as O}from"./chunk-AKJ4I7KF.js";import{h as dt,m as st}from"./chunk-AI4XRCAL.js";import{b as s,c as f}from"./chunk-W6T7TOHE.js";import{G as rt,d as W,f as B,g as K,j as ot,m as lt}from"./chunk-B6POIFQM.js";import{Dc as it,Eb as T,Ec as r,Fc as u,Gc as y,Ic as V,Jc as N,Kb as g,Kc as U,Oc as R,Qa as Z,Vb as j,Wb as d,Xc as I,Yc as x,Z as Q,_c as at,bc as z,cc as tt,ec as et,fc as nt,gc as a,hc as l,ic as _,jc as G,kc as H,mc as F,ob as b,pa as X,qb as o,rc as S,sc as h,v as q,wb as C,ya as A,za as L}from"./chunk-EIQCOZF5.js";function Mt(e,p){if(e&1&&(a(0,"mat-option",10)(1,"div",11),_(2,"img",12),a(3,"span"),r(4),l()()()),e&2){let t=p.$implicit;d("value",t.ID)("disabled",t.disabled),o(),d("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),o(),d("src",t.Img,b),o(2),u(t.Name)}}function bt(e,p){if(e&1){let t=F();a(0,"div",13)(1,"label",14),r(2,"Scan Type"),l(),a(3,"mat-radio-group",15),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.ScanFull,i)||(m.filter.ScanFull=i),L(i)}),a(4,"mat-radio-button",16),r(5," Full (Include Inactive Products) "),l(),a(6,"mat-radio-button",17),r(7," Active "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.ScanFull),o(),d("value",!0),o(2),d("value",!1)}}function Tt(e,p){e&1&&(a(0,"span"),r(1,"Never"),l())}function It(e,p){if(e&1&&(a(0,"span"),r(1),I(2,"async"),l()),e&2){let t=h(2);o(),u(x(2,1,t.lastSync$))}}function xt(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3)(2,"span",18),r(3,"Last Scan:"),l(),g(4,Tt,2,0,"span"),I(5,"async"),g(6,It,3,3,"span"),l(),a(7,"mat-radio-group",19),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.UpdatedProduct,i)||(m.filter.UpdatedProduct=i),L(i)}),a(8,"mat-radio-button",20),r(9," Scan All Products "),l(),a(10,"mat-radio-button",21),r(11),l()()()}if(e&2){let t=h();o(4),z(x(5,6,t.lastSync$)==null?4:6),o(3),V("ngModel",t.filter.UpdatedProduct),o(),d("value",!1),o(2),d("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),o(),y(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Ot(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3),r(2," Scan Option "),l(),a(3,"mat-radio-group",22),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.Async,i)||(m.filter.Async=i),L(i)}),a(4,"mat-radio-button",23),r(5," Asynchronous (Get Notified when Complete) "),l(),a(6,"mat-radio-button",24),r(7," Synchronous (Wait until Complete) "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.Async),o(),d("value",!0),o(2),d("value",!1)}}var Xt=(()=>{class e{constructor(t,n,i){this.dialogRef=t,this.data=n,this.router=i,this.channelService=X(pt),this.channelType=s,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==s.Tiktok||t.TypeID==s.Tokopedia||t.TypeID==s.Lazada||t.TypeID==s.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(q(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(n.LastSync)?f.convertToReadableDate(n.LastSync):null)),Q(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==s.Shopee||this.selectedChannel.TypeID==s.Tiktok||this.selectedChannel.TypeID==s.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=s.WooCommerce&&this.selectedChannel?.TypeID!=s.KalCare&&this.selectedChannel?.TypeID!=s.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let n;return this.channelOptions&&(n=this.channelOptions.find(i=>i.ID==t)),n}submit(){this.selectedChannel.TypeID==s.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return f.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||e)(C(D),C(P),C(rt))}}static{this.\u0275cmp=T({type:e,selectors:[["app-scan-dialog"]],standalone:!1,decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(n,i){n&1&&(a(0,"modal-material",0),S("onOk",function(){return i.submit()})("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),r(4,"Select a Channel"),l(),a(5,"mat-form-field",4)(6,"mat-select",5),U("ngModelChange",function(c){return N(i.filter.ChannelID,c)||(i.filter.ChannelID=c),c}),S("ngModelChange",function(c){return i.onSelectChannel(c)}),g(7,Mt,5,5,"mat-option",6),l()(),g(8,bt,8,3,"div",7)(9,xt,12,8,"div",8)(10,Ot,8,3,"div",9),l()()()),n&2&&(d("dynamicValidated",i.isNotEmpty(i.filter.ChannelID))("config",i.modalConfig),o(6),d("disabled",i.disabledChannelOption),V("ngModel",i.filter.ChannelID),o(),d("ngForOf",i.channelOptions),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)),o(),z(i.hasScanUpdate&&i.selectedChannel?9:-1),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)))},dependencies:[B,K,dt,st,mt,ct,ht,Ct,ft,O,k,ot],encapsulation:2})}}return e})();var v=function(e){return e.Tokopedia="https://seller.tokopedia.com",e.Shoope="https://seller.shopee.co.id",e.Tiktok="https://seller-id.tiktok.com",e.WooCommerce="https://woocommerce.dealpos.app",e.Lazada="https://sellercenter.lazada.co.id",e}(v||{});var Dt=e=>({"is-disabled":e});function Pt(e,p){if(e&1&&(G(0),a(1,"tr")(2,"td",11),r(3),l(),a(4,"td",11),r(5),l(),a(6,"td",12)(7,"p",13),r(8,"Product Not in Channel!"),l()()(),H()),e&2){let t=h().$implicit;o(3),y(" ",t==null?null:t.Model,""),o(2),y(" ",t==null?null:t.Code,"")}}function Et(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Model,"")}}function kt(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Code,"")}}function wt(e,p){if(e&1&&(a(0,"tr"),g(1,Et,2,2,"td",14)(2,kt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),_(6,"img",17),l(),a(7,"div",18),r(8),l()()(),a(9,"td",11),r(10),I(11,"number"),l(),a(12,"td",19),r(13),I(14,"number"),l(),a(15,"td",19)(16,"a",20),_(17,"i",21),a(18,"span",22),r(19,"Edit"),l()()()()),e&2){let t=p.$implicit,n=p.index,i=h(3);o(),d("ngIf",n==0),o(),d("ngIf",n==0),o(3),d("href",t.Url,b)("title",t.Title),o(),d("src",i.getChannelLogo(t.TypeID),b),o(),d("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),o(),y(" ",t.Name," "),o(2),u(x(11,12,t.Price)),o(3),u(x(14,14,t.Inventory)),o(3),d("href",i.getHyperlinkSellerCenter(t),b)("ngClass",R(16,Dt,t.TypeID==i.channelType.KalCare))("matTooltip",t.TypeID!=i.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(e,p){if(e&1&&g(0,wt,20,18,"tr",9),e&2){let t=h().$implicit;d("ngForOf",t==null?null:t.Channel)}}function Nt(e,p){if(e&1&&(G(0),g(1,Pt,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,at),H()),e&2){let t=p.$implicit,n=it(3);o(),d("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",n)}}var le=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.channelType=s,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let n="javascript:void(0)";switch(t.TypeID){case s.Shopee:n=`${v.Shoope}/portal/product/${t.ChannelItemID}`;break;case s.Tiktok:n=`${v.Tiktok}/product/edit/${t.ChannelItemID}`;break;case s.Tokopedia:n=`${v.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case s.WooCommerce:n=`${v.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case s.Lazada:n=`${v.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return n}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variant"]],standalone:!1,decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(n,i){n&1&&(a(0,"modal-material",1),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),r(6," VARIANT "),a(7,"sup"),_(8,"i",6),l()(),a(9,"th",5),r(10,"SKU"),l(),a(11,"th",5),r(12," PRODUCT "),a(13,"sup"),_(14,"i",7),l()(),a(15,"th",5),r(16,"PRICE"),l(),a(17,"th",8),r(18,"INVENTORY"),l(),_(19,"th",5),l()(),a(20,"tbody"),g(21,Nt,4,2,"ng-container",9),l()()()()),n&2&&(d("config",i.modalConfig),o(21),d("ngForOf",i.variants))},dependencies:[W,B,K,O,k,lt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]})}}return e})();var Ut=e=>({"bg-gradient-warning":e});function At(e,p){if(e&1&&(a(0,"tr",5)(1,"td"),r(2),l(),a(3,"td",6),r(4),l()()),e&2){let t=p.$implicit;d("matTooltip",t.duplicateMessage),o(2),u(t==null?null:t.Name),o(),d("ngClass",R(4,Ut,t.isDuplicate)),o(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var fe=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.variants=Z([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,n={},i=[],m=t.filter(c=>f.IsEmpty(c.ChannelVariationSKU));t.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,M,J)=>{n[c.ChannelVariationSKU]=J.filter(w=>w.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(n).forEach(c=>{n[c].length>1&&(n[c]=n[c].map((M,J,w)=>{let Y=`SKU ${M.ChannelVariationSKU} is duplicated with variant`;return w.forEach(($,vt)=>{$.Name!==M.Name&&(Y+=` ${w.length>2?$.Name+(vt!==w.length-1?",":""):$.Name}`)}),M.duplicateMessage=Y,M.isDuplicate=!0,M})),i.push(...n[c])}),i.push(...m),this.variants.set(i)}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variants"]],standalone:!1,decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(n,i){n&1&&(a(0,"modal-material",0),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),r(6,"Variant"),l(),a(7,"th",4),r(8,"SKU"),l()()(),a(9,"tbody"),et(10,At,5,6,"tr",5,tt),l()()()()),n&2&&(d("config",i.modalConfig),o(10),nt(i.variants()))},dependencies:[W,O,k],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]})}}return e})();export{Xt as a,le as b,fe as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x}from"./chunk-L6W6BJ3T.js";import"./chunk-K5XRGNWG.js";import"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";export{l as AnimationDriver,k as NoopAnimationDriver,u as \u0275Animation,q as \u0275AnimationEngine,w as \u0275AnimationRenderer,x as \u0275AnimationRendererFactory,m as \u0275AnimationStyleNormalizer,v as \u0275BaseAnimationRenderer,f as \u0275ENTER_CLASSNAME,g as \u0275LEAVE_CLASSNAME,n as \u0275NoopAnimationStyleNormalizer,p as \u0275TransitionAnimationPlayer,s as \u0275WebAnimationsDriver,r as \u0275WebAnimationsPlayer,o as \u0275WebAnimationsStyleNormalizer,j as \u0275allowPreviousPlayerStylesMerge,i as \u0275camelCaseToDashCase,d as \u0275containsElement,t as \u0275createEngine,a as \u0275getParentElement,e as \u0275invokeQuery,h as \u0275normalizeKeyframes,b as \u0275validateStyleProperty,c as \u0275validateWebAnimatableStyleProperty};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as C}from"./chunk-WMO2ROK4.js";import{a as h,b as y}from"./chunk-ARIW575T.js";import{a as r}from"./chunk-74NNHYZD.js";import"./chunk-QAEN52IK.js";import"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import"./chunk-W6T7TOHE.js";import{F as v,J as o,n}from"./chunk-B6POIFQM.js";import{Eb as l,Fb as s,Mc as f,Wb as u,gc as c,hc as d,ic as i,ka as m,qb as p}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-YTSQ3LOF.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-LVN6OVH5.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-XBPJY5X4.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-6HVHZ3HN.js";import{b as ae}from"./chunk-5BTJTFLF.js";import{a as le,b as re}from"./chunk-WYOXUN3H.js";import"./chunk-23MIIDCT.js";import"./chunk-SD7UKXTX.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-SDUUFQUI.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as X}from"./chunk-QAEN52IK.js";import{e as Q}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as ne,m as ie}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{h as H,m as U,y as G}from"./chunk-AI4XRCAL.js";import{c as K}from"./chunk-W6T7TOHE.js";import{j as V,k as J,l as W,n as k}from"./chunk-B6POIFQM.js";import{Eb as P,Ec as p,Fc as C,Gc as y,Ic as j,Jc as O,Kb as u,Kc as q,Mc as z,Wb as d,Xc as m,Yc as c,Z as M,Zc as A,aa as D,bc as R,cc as B,ec as T,fc as $,g as L,gc as i,hc as a,ic as f,ja as w,mc as F,ob as S,pa as g,qb as l,rc as v,sc as x,v as I,ya as E,za as N}from"./chunk-EIQCOZF5.js";import{a as _}from"./chunk-K2H6WANG.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function me(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function se(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td"),p(6),m(7,"json"),a(),i(8,"td"),p(9),m(10,"json"),a(),i(11,"td"),p(12),m(13,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(2),C(c(7,5,e.Request)),l(3),C(c(10,7,e.Response)),l(3),C(A(13,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function ce(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,se,14,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function de(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Oe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,me,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,ce,21,13,"div",8),m(13,"async"),u(14,de,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,oe,re,le,ae,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Oe as ChannelLogComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as Qt}from"./chunk-K64ATXFK.js";import{a as Xt,b as Jt}from"./chunk-YQSHLQDX.js";import"./chunk-OVYL7SOO.js";import{b as Wt}from"./chunk-VGXNA5KN.js";import"./chunk-KII7SEQ6.js";import"./chunk-B5JAZPVU.js";import{a as Yt,b as Ht}from"./chunk-RNWWVG3M.js";import"./chunk-OS53H77X.js";import{a as $t,b as Lt}from"./chunk-5BTJTFLF.js";import{a as ct,b as Rt,c as Bt,d as mt,e as pt}from"./chunk-LQFYLU4B.js";import"./chunk-T7KM2WP6.js";import"./chunk-VOISFPEM.js";import"./chunk-WNAVUGZ4.js";import{a as jt}from"./chunk-UOAYF4SW.js";import"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Gt}from"./chunk-67USXWWF.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{d as L,e as R}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import"./chunk-QAEN52IK.js";import{e as et}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as Ut,m as Vt}from"./chunk-XOT2SZPE.js";import{r as Mt,s as Dt}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as K,e as lt,h as V,i as Y,l as ft,m as Et,n as H,p as X,q as Nt,r as J,s as Pt,t as kt,u as Ot,x as Q,y as tt,z as $}from"./chunk-AI4XRCAL.js";import{b as wt,c as h}from"./chunk-W6T7TOHE.js";import{g as U,j as T,n as S}from"./chunk-B6POIFQM.js";import{Eb as v,Ec as _,Fc as rt,Gc as q,Ic as It,Jc as Ft,K as Tt,Ka as P,Kb as f,Kc as At,M as St,Mc as x,Na as _t,Nc as at,Wb as m,Xc as b,Yc as y,Z,bc as g,cc as k,ea as A,ec as O,fc as w,gc as p,hc as l,ic as d,ja as E,jc as M,kc as D,mc as W,pa as u,qb as s,rc as I,sc as r,v as F,xa as N,ya as G,za as j}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var z=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(z||{});var it=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(it||{});var ht=(()=>{class e{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(Q)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(F(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.map(o=>(i=o?.multi_lang?.find(a=>a.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(a=>(n=a?.multi_lang?.find(C=>C.language=="id"),a.name=n?.value,a)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(lt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let a=this.formBuilder.group({unit:new ft(null),value:new ft(null,n)});i.addControl(JSON.stringify(o.attribute_id),a)}else i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.attribute_id||C.mandatory)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(a=>i[o.attribute_id]?.findIndex(C=>C==a.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):h.IsNotEmpty(i[o.attribute_id])&&(o.attribute_value_list=[{value_id:0,name:i[o.attribute_id]}]);break;default:o.attribute_value_list=o.attribute_value_list.filter(a=>a.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(t,i){let n=[];return h.IsNotEmpty(t)&&(n=[{value_id:0,original_value_name:JSON.stringify(t),value_unit:i}]),n}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Ct=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(Ct||{});var gt=()=>[];function ee(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function ie(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(4,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function oe(e,c){if(e&1&&d(0,"input",8),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ne(e,c){if(e&1&&(p(0,"option",15),_(1),l()),e&2){let t=c.$implicit;m("value",t),s(),rt(t)}}function re(e,c){if(e&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),_(4,"Unit"),l(),O(5,ne,2,2,"option",15,k),l()()),e&2){let t=r(3).$implicit;m("formGroupName",t.attribute_id),s(),m("placeholder","Isi "+(t==null?null:t.name)),s(2),m("value",null),s(2),w(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function ae(e,c){if(e&1&&d(0,"input",11),e&2){let t=r(3).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function le(e,c){if(e&1&&f(0,re,7,3,"div",10)(1,ae,1,2,"input",11),e&2){let t=r(2).$implicit,i=r(2);g((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ce(e,c){if(e&1&&d(0,"datepicker",9),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)}}function me(e,c){if(e&1&&f(0,oe,1,2,"input",8)(1,le,2,1)(2,ce,1,1,"datepicker",9),e&2){let t,i=r().$implicit,n=r(2);g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function pe(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function se(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function ue(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,ee,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,ie,1,5,"ng-select",6)(6,me,3,1)(7,pe,1,4,"ng-select",7)(8,se,1,4,"ng-select",7),l()),e&2){let t,i=c.$implicit,n=r(2);s(2),g(i.mandatory?2:-1),s(2),q(" ",i==null?null:i.name," "),s(),g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function de(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ue,9,3,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var qt=(()=>{class e{constructor(){this.formCategoryService=u(ht),this.attributesChanges=new P,this.inputType=z,this.formatType=it,this.validationType=Ct}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(A(t=>{this.form=this.formCategoryService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[x([ht]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){i&1&&(f(0,de,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,kt,Ot,K,Pt,V,Y,X,J,Nt,jt,Jt,Xt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]})}}return e})();var bt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q),this.uploadProductService=u(pt)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(Tt(o=>this.uploadProductService.selectedProduct$.pipe(F(a=>(o=this.mappingAttributeSalesProperty(o,a),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(lt.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.id)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(a=>i[o.id]?.includes(a.id)):o.values=o.values.filter(a=>a.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function _e(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function fe(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function he(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&d(0,"input",8),e&2){let t=r().$implicit;m("formControlName",t.id)("placeholder",t==null?null:t.name)}}function ge(e,c){if(e&1&&(p(0,"small",5),_(1),l()),e&2){let t=r().$implicit;s(),q(" ",t==null?null:t.name," is mandatory ")}}function be(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,_e,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,fe,1,4,"ng-select",6)(6,he,1,3,"ng-select",7)(7,Ce,1,2,"input",8)(8,ge,2,1,"small",5),l()),e&2){let t=c.$implicit;s(2),g(t.is_required?2:-1),s(2),q(" ",t==null?null:t.name," "),s(),g(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),s(3),g(t.is_required?8:-1)}}function ye(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,be,9,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var zt=(()=>{class e{constructor(){this.tiktokAttributeFormService=u(bt),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(F(t=>t.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),A(t=>{this.form=this.tiktokAttributeFormService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([bt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){i&1&&(f(0,ye,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,K,V,Y,X,J,tt],encapsulation:2})}}return e})();var yt=(()=>{class e{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(F(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Zt=(()=>{class e{constructor(){this.wooAttributeFormService=u(yt),this.channelId=_t(),this.categoryId=_t(),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([yt]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),_(3,"Atribut"),l(),p(4,"ng-select",3),b(5,"async"),I("change",function(a){return n.onSelectAttribute(a)}),l()()()),i&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,T,tt,R,L,$],encapsulation:2})}}return e})();var vt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(F(o=>o))}createFormGroup(t){let i=this.formBuilder.group({});return t.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(t={}){return Object.values(t).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function ve(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),_(2),l(),d(3,"ng-select",5),l()),e&2){let t=c.$implicit;s(2),q(" ",t==null?null:t.variant," "),s(),m("formControlName",t.variant)("items",t.values)("placeholder","Pilih "+(t==null?null:t.variant))}}function xe(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ve,4,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var Kt=(()=>{class e{constructor(){this.tokpedAttrFormService=u(vt),this.attributesChanges=new P}ngOnInit(){}ngOnChanges(t){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let t=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{t=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([vt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){i&1&&(f(0,xe,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,V,Y,X,J],encapsulation:2})}}return e})();var xt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:t}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function Te(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),_(5," Brand "),l(),d(6,"input",5),l(),p(7,"div",6)(8,"div",4),_(9," Product Type "),l(),d(10,"input",7),l(),p(11,"div",6)(12,"div",4),_(13," Status "),l(),d(14,"ng-select",8),l()()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(13),m("items",t.Options.StatusOptions)}}var te=(()=>{class e{constructor(){this.attributesChanges=new P,this.shopifyFormService=u(xt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(St(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[x([xt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){i&1&&(f(0,Te,15,2,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,$,H,K,V,Y,X,J,R,L],encapsulation:2})}}return e})();function Se(e,c){if(e&1&&(p(0,"div",6),d(1,"app-product-card",9),l()),e&2){let t=c.$implicit;s(),m("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Ie(e,c){if(e&1){let t=W();M(0),p(1,"mat-checkbox",21),At("ngModelChange",function(n){G(t);let o=r().$implicit;return Ft(o.selected,n)||(o.selected=n),j(n)}),I("ngModelChange",function(){let n=G(t).ngIf,o=r(),a=o.$implicit,C=o.$index,ot=r();return j(ot.onSelectChannel(a,C,n))}),l(),D()}if(e&2){let t=r().$implicit;s(),It("ngModel",t.selected)}}function Fe(e,c){if(e&1&&(p(0,"div",18),d(1,"input",22),l()),e&2){let t=r().$implicit,i=r();m("matTooltip",t.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Ae(e,c){if(e&1){let t=W();p(0,"app-channel-category-select",23),I("selectedCategory",function(n){G(t);let o=r().$index,a=r();return j(a.onCategoryChange(o,n))}),l()}if(e&2){let t=r().$implicit,i=r();m("disabled",!t.selected||t.selected&&t.type==i.channelType.Lazada)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Ee(e,c){if(e&1){let t=W();p(0,"shopee-attribute-form",27),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function Ne(e,c){if(e&1){let t=W();p(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Pe(e,c){if(e&1){let t=W();p(0,"wooocommerce-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function ke(e,c){if(e&1){let t=W();p(0,"tokopedia-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Oe(e,c){if(e&1&&(p(0,"div",20)(1,"div",24),f(2,Ee,1,3,"shopee-attribute-form",25)(3,Ne,1,2,"tiktok-attribute-form",26)(4,Pe,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),l()()),e&2){let t,i=r().$implicit,n=r();s(2),g((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Tokopedia?5:-1)}}function we(e,c){if(e&1){let t=W();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),I("attributesChanges",function(n){G(t);let o=r().$index,a=r();return j(a.onAttributesChange(o,n))}),l()()()}if(e&2){let t=r().$implicit;s(2),m("channelId",t.id)}}function Me(e,c){if(e&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),f(6,Ie,2,1,"ng-container",14),b(7,"async"),l(),p(8,"div"),d(9,"app-channel-logo",15),l(),p(10,"div",16)(11,"span"),_(12),l()()()(),p(13,"div",12)(14,"div",17),f(15,Fe,2,1,"div",18)(16,Ae,1,4,"app-channel-category-select",19),l()()(),f(17,Oe,6,1,"div",20)(18,we,3,1,"div",20),l()()),e&2){let t=c.$implicit,i=r();s(6),m("ngIf",y(7,8,i.defaultCategories$)),s(3),m("typeId",t.type)("showChannelName",!1),s(),m("matTooltip",t.name)("matTooltipShowDelay",2500),s(2),rt(t.name),s(3),g(t.type==i.channelType.Shopify||t.type==i.channelType.Plugo?15:16),s(2),g(t.categoryId&&i.channelType.Lazada!=t.type&&t.selected?17:i.channelType.Shopify==t.type&&t.selected?18:-1)}}var zo=(()=>{class e{constructor(){this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=wt,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(Z(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.categoryId=i,o.attributes=[]),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.attributes=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((a,C)=>{if(C==i&&t.selected){let ot=this.findCategoryByChannelId(t.id,n);a.categoryId=ot?.DefaultCategoryID}return C==i&&!t.selected&&(a.categoryId=null),a}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-product-upload"]],features:[x([ct,Rt,Bt,mt])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),d(3,"i",2),_(4," Upload "),l()(),p(5,"content")(6,"div",3)(7,"h3",4),_(8,"Product To Upload"),l(),p(9,"div",5),O(10,Se,2,7,"div",6,k),b(12,"async"),l(),p(13,"h3",7),_(14,"Channel To Upload"),l(),O(15,Me,19,10,"div",8,k),l()()()),i&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),w(y(12,3,n.selectedProducts$)),s(5),w(n.channelProductUploads())}},dependencies:[S,U,T,Wt,Vt,Ut,Ht,Yt,Lt,$t,tt,V,Et,Dt,Mt,qt,zt,Zt,Kt,te,Gt,Qt],encapsulation:2})}}return e})();export{zo as ProductUploadComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as xe,b as Ce}from"./chunk-EQD3IUMF.js";import{a as ne}from"./chunk-BVIRHZTZ.js";import{a as ge,b as ue}from"./chunk-5Z63CRGG.js";import{b as se}from"./chunk-BSATGCWC.js";import{a as de}from"./chunk-VYKDVKG3.js";import{a as pe}from"./chunk-R5IDWUP6.js";import{j as le}from"./chunk-QAEN52IK.js";import{d as _e,g as me}from"./chunk-XOT2SZPE.js";import{r as ae,s as ce}from"./chunk-AKJ4I7KF.js";import{b as J,h as Q,m as ee,y as te}from"./chunk-AI4XRCAL.js";import{c as ie,e as oe,f as re}from"./chunk-W6T7TOHE.js";import{d as Z,f as q,g as K,i as X,m as Y,n as G}from"./chunk-B6POIFQM.js";import{Dc as b,Eb as z,Ec as s,Fc as V,Gc as y,Ic as k,Jc as O,Ka as $,Kb as p,Kc as D,Na as B,Oc as u,Wb as m,Xc as N,Yc as R,Zc as H,_c as w,bc as v,ca as W,cc as P,ec as E,f as L,fc as M,gc as a,hc as _,ic as I,jc as C,kc as h,lc as U,mc as f,ob as S,qb as r,rc as T,sc as o,vc as A,wb as F,ya as d,za as g}from"./chunk-EIQCOZF5.js";var j=t=>[t],fe=t=>({"text-decoration-line-through":t}),Te=t=>({"ms-10":t}),be=t=>({"text-danger":t}),ye=t=>({"bg-gradient-warning":t});function Se(t,c){if(t&1){let e=f();a(0,"mat-slide-toggle",13),T("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),a(1,"small",14),s(2),_()()}if(t&2){let e=o();r(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function ve(t,c){if(t&1){let e=f();a(0,"th")(1,"input",16),D("ngModelChange",function(n){d(e);let l=o(2);return O(l.checkboxState,n)||(l.checkboxState=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);r(),k("ngModel",e.checkboxState)}}function Ie(t,c){if(t&1&&(p(0,ve,2,1,"ng-template",15),a(1,"th",11),s(2,"POS"),_()),t&2){let e=o();m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function we(t,c){if(t&1&&(C(0),a(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),a(5,"div",21),s(6),N(7,"stringLimit"),_()()()(),h()),t&2){let e=c.$implicit;r(3),m("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),m("src",e==null?null:e.Img,S),r(2),y(" ",H(7,3,e.Name,20)," ")}}function Fe(t,c){t&1&&U(0)}function Pe(t,c){if(t&1&&(C(0),p(1,Fe,1,0,"ng-container",33),h()),t&2){o();let e=b(7);r(),m("ngTemplateOutlet",e)}}function Ee(t,c){t&1&&U(0)}function Me(t,c){if(t&1&&p(0,Ee,1,0,"ng-container",33),t&2){o(2);let e=b(7);m("ngTemplateOutlet",e)}}function Ve(t,c){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let e=o(4);m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function ke(t,c){if(t&1){let e=f();C(0),a(1,"input",34),D("ngModelChange",function(n){d(e);let l=o(4).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(4).$implicit,l=o();return g(l.onCheckboxStateProduct(n.ID))}),_(),h()}if(t&2){let e=o(4).$implicit;r(),k("ngModel",e.selected),m("disabled",!(e!=null&&e.Category))}}function Oe(t,c){if(t&1&&p(0,ke,2,2,"ng-container",22),t&2){let e=o(3).$implicit;m("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function De(t,c){if(t&1){let e=f();C(0),a(1,"img",35),T("click",function(n){d(e);let l=o(3).$implicit,x=o();return g(x.onZoomImage(n,l==null?null:l.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;r(),A("src",e==null?null:e.ThumbnailUrl,S)}}function Ne(t,c){t&1&&I(0,"img",36)}function $e(t,c){if(t&1&&(C(0),a(1,"td",28)(2,"div",29),p(3,Pe,2,1,"ng-container",30)(4,Ve,1,3,"ng-template",null,0,w)(6,Oe,1,1,"ng-template",null,1,w),a(8,"div",26),p(9,De,2,1,"ng-container",30)(10,Ne,1,0,"ng-template",null,2,w),_()()(),a(12,"td",31)(13,"div"),s(14),_(),a(15,"small",32),s(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,l=o();r(),m("rowSpan",n==null?null:n.Variants.length),r(2),m("ngIf",l.table=="inventory")("ngIfElse",e),r(5),m("ngClass",u(10,Te,(n==null||n.Variants==null?null:n.Variants.length)<=1)),r(),m("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),r(3),m("rowSpan",n==null?null:n.Variants.length),r(2),V(n==null?null:n.Name),r(),m("ngClass",u(12,be,!(n!=null&&n.Category))),r(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function Be(t,c){if(t&1&&(a(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),S)}}function Ue(t,c){if(t&1){let e=f();a(0,"input",40),D("ngModelChange",function(n){d(e);let l=o(3).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),m("disabled",!(i!=null&&i.Category))}}function Re(t,c){if(t&1&&(a(0,"td",38),p(1,Ue,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);r(),m("ngIf",i.printPOS(e)>=0||i.table=="price")}}function je(t,c){if(t&1&&(p(0,Re,2,1,"ng-template",15),a(1,"td",24),s(2),N(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);m("ngxPermissionsOnly",u(4,j,i.rolePriceEdit)),r(2),V(R(3,2,i.printPOS(e)))}}function Le(t,c){if(t&1){let e=f();C(0),a(1,"td",41),T("click",function(){d(e);let n=o().$implicit,l=o().$implicit,x=o().$implicit,he=o();return g(he.openTableDialog(x.Name,l,n.ID,x.ChannelItemID))}),a(2,"div",29)(3,"div",42),s(4),N(5,"number"),_(),a(6,"a",43),T("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=c.$implicit,i=o(2).$implicit,n=o(2);r(),m("ngClass",u(5,ye,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1)),r(3),y(" ",R(5,3,n.printItem(e))," "),r(2),m("href",e.Url,S)}}function We(t,c){t&1&&(a(0,"td",44)(1,"div",29)(2,"span"),s(3,"X"),_()()())}function ze(t,c){if(t&1&&p(0,Le,8,7,"ng-container",30)(1,We,4,0,"ng-template",null,3,w),t&2){let e=c.$implicit,i=b(2),n=o().$implicit,l=o(2);m("ngIf",l.getItemFromChannel(n,e))("ngIfElse",i)}}function Ae(t,c){if(t&1&&(a(0,"tr"),p(1,$e,17,14,"ng-container",22),a(2,"td",23),s(3),_(),a(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),a(8,"div",21),p(9,Be,2,1,"a",27),_()()(),p(10,je,4,6),E(11,ze,3,2,null,null,P),_()),t&2){let e=c.$implicit,i=c.$index,n=o().$implicit,l=o();r(),m("ngIf",i==0),r(2),V(e==null?null:e.Model),r(2),m("matTooltip",e.Discontinued?l.discontinuedVariantMsg:""),r(),m("ngClass",u(7,fe,e.Discontinued)),r(),y(" ",e.Code," "),r(2),v(n.Category?9:-1),r(),v(l.hiddenIPOSInventory()==!1?10:-1),r(),M(l.channel)}}function He(t,c){if(t&1&&(a(0,"tbody"),E(1,Ae,13,9,"tr",null,P),_()),t&2){let e=c.$implicit;r(),M(e.Variants)}}var ht=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=ne.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new $,this.destroy$=new L,this.toggle=new $,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(l=>(l.selected=n.selected,l)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(l=>ie.IsNotEmpty(i.LocationID)?l.LocationID==i.LocationID:l.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}openTableDialog(e,i,n,l){this.dialog.open(xe,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:l}}).afterClosed().pipe(W(this.destroy$)).subscribe(x=>{x!=null&&this.onSubmit.emit(x)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(F(_e),F(de),F(le))}}static{this.\u0275cmp=z({type:t,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(i,n){i&1&&(a(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,Se,3,1,"mat-slide-toggle",9),_()(),a(9,"th",10),s(10,"Variant"),_(),a(11,"th",11),s(12,"SKU"),_(),p(13,Ie,3,3)(14,we,8,6,"ng-container",12),_()(),E(15,He,3,0,"tbody",null,P),_()()),i&2&&(r(8),v(n.showProductToggle?8:-1),r(5),v(n.hiddenIPOSInventory()==!1?13:-1),r(),m("ngForOf",n.channel),r(),M(n.data))},dependencies:[G,Z,q,K,X,Y,te,J,Q,ee,ue,ge,me,pe,se,re,oe,ce,ae,Ce],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]})}}return t})();export{ht as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as ee}from"./chunk-B6POIFQM.js";import{B as I,F as M,Fb as Q,Gb as X,J as F,Ka as N,O as G,R as H,T as x,_ as z,aa as C,ea as j,fd as _,g as m,ja as P,ka as Y,ma as A,oa as l,p as f,pa as y,q as h,sb as J,v,x as p,xa as Z,y as U,yb as q}from"./chunk-EIQCOZF5.js";import{a as g,b as O}from"./chunk-K2H6WANG.js";var a=function(s){return s[s.Tokopedia=1]="Tokopedia",s[s.WooCommerce=2]="WooCommerce",s[s.None=3]="None",s[s.KalCare=4]="KalCare",s[s.Shopee=5]="Shopee",s[s.Tiktok=6]="Tiktok",s[s.Lazada=7]="Lazada",s[s.Shopify=8]="Shopify",s[s.Plugo=9]="Plugo",s}(a||{});var c=function(s){return s.SHOOPE="https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",s.WOOCOMMERCE="https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",s.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",s.TIKTOK="https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",s.LAZADA="https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png",s.KALCARE="https://res.cloudinary.com/pos/image/upload/v1654230268/icons/marketplace_icons/kalcare.png",s.SHOPIFY="https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png",s.PLUGO="https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico",s.PLUGONEW="https://res.cloudinary.com/pos/image/upload/v1739263497/icons/marketplace_icons/plugonew.ico",s}(c||{});var fe=(()=>{class s{static{this.GuidEMpty="00000000-0000-0000-0000-000000000000"}static{this.MinDate="0001-01-01T00:00:00"}static IsNotEmpty(e){return e!=""&&e!=s.GuidEMpty&&e!=null&&e!=null}static IsEmpty(e){return e==""||e==null||e==null||e==s.GuidEMpty}static getChannelLogoByTypeId(e){let t;switch(e){case a.Tokopedia:t=c.TOKOPEDIA;break;case a.Shopee:t=c.SHOOPE;break;case a.WooCommerce:t=c.WOOCOMMERCE;break;case a.Lazada:t=c.LAZADA;break;case a.Tiktok:t=c.TIKTOK;break;case a.KalCare:t=c.KALCARE;break;case a.Shopify:t=c.SHOPIFY;break;case a.Plugo:t=c.PLUGO;break}return t}static getChannelLogoByName(e=""){e=e.toLowerCase();let t;switch(e){case"tokopedia":t=c.TOKOPEDIA;break;case"shoppe":t=c.SHOOPE;break;case"woocommerce":t=c.WOOCOMMERCE;break;case"tiktok":t=c.TIKTOK;break;case"lazada":t=c.LAZADA;break;case"kalCare":t=c.KALCARE;break;case"plugo":t=c.PLUGO;break}return t}static getChannelName(e){let t;switch(e){case a.Shopee:t="Shopee";break;case a.Tokopedia:t="Tokopedia";break;case a.Lazada:t="Lazada";break;case a.Tiktok:t="Tiktok";break;case a.WooCommerce:t="WooCommerce";break;case a.KalCare:t="KalCare";break;case a.Plugo:t="Plugo";break}return t}static assignChannelLogo(e){return e=e.map(t=>(t.logo=this.getChannelLogoByTypeId(t.TypeID),t)),e}static getCssChannelColor(e){let t;switch(e){case a.Shopee:t="#ee4d2d";break;case a.Tokopedia:t="var(--G500,#03AC0E)";break;case a.Lazada:t="#FF00B2";break;case a.Tiktok:t="black";break;case a.WooCommerce:t="#674399";break;case a.KalCare:t="rgb(128, 188, 0)";break;case a.Plugo:t="#F2A954";break}return t}static getDaysDiff(e,t){var i=t.getTime()-e.getTime(),r=i/(1e3*60*60*24);return r}static addDays(e,t){let i=new Date(Number(e));return i.setDate(e.getDate()-t),i}static isValidDate(e){return e instanceof Date&&!isNaN(e)}static getImageInfo(e){return new Promise((t,i)=>{let r=new Image;r.src=e,r.decode().then(()=>{t({img:e,height:r.height,width:r.width})}).catch(()=>{i(new Error(`Image load error for ${e}`))})})}static formatTitleFromDate(e,t){let i=null,r=new Date(e),n=new Date(t);return r.getDate()!=n.getDate()&&(i="dd"),r.getMonth()!=n.getMonth()&&(i="dd MMM"),r.getFullYear()!=n.getFullYear()&&(i="dd MMM yyyy"),i}static openDownloadFile(e,t){var i=window.URL.createObjectURL(e),r=document.createElement("a");r.href=i,r.download=t,r.click()}static compare(e,t,i){return(e<t?-1:1)*(i?1:-1)}static isDateExpired(e){let t=new Date,i=!1;return e.getTime()<t.getTime()&&(i=!0),i}static getLabelPathTree(e){let t=[],i=e;for(;i;)t.unshift(i.label),i=i.parent;return t.join(" / ")}static searchByIdWithParentDFS(e,t){let i=[...e],r;for(typeof t=="number"?r=JSON.stringify(t):r=t;i.length>0;){let n=i.pop();if(n.id===r)return n;if(n.children&&n.children.length>0)for(let o of n.children)o.parent=n,i.push(o)}return null}static getTimeDifference(e){let t=new Date(e),i=new Date,r=Math.abs(t.getTime()-i.getTime()),n=1e3,o=6e4,d=60*o,S=24*d,ne=Math.floor(r/S),oe=Math.floor(r%S/d),ae=Math.floor(r%d/o),ce=Math.floor(r%o/n);return{days:ne,hours:oe,minutes:ae,seconds:ce}}static convertToReadableDate(e){let{days:t,hours:i,minutes:r,seconds:n}=s.getTimeDifference(e),o="";return t>0&&i>0&&r>0&&(o=`${t} days, ${i} hours and ${r} minutes ago`),t>0&&i>0&&r==0&&(o=`${t} days and ${i} hours ago`),t>0&&i==0&&(o=`${t} days ago`),t==0&&i>0&&r>0&&(o=`${i} hours and ${r} minutes ago`),t==0&&i>0&&r==0&&(o=`${i} hours ago`),t==0&&i==0&&r>0&&(o=`${r} minutes ago`),t==0&&i==0&&r==0&&n>0&&(o=`${n} seconds ago`),o}static isValidGUID(e){return/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e)}}return s})();var D={REMOVE:"remove",SHOW:"show"},ie=(()=>{class s{constructor(){this.strategiesSource=new m({}),this.strategies$=this.strategiesSource.asObservable()}static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275prov=P({token:s,factory:s.\u0275fac})}}return s})(),$=new A("USE_CONFIGURATION_STORE"),L=(()=>{class s{constructor(e=!1,t){this.isolate=e,this.configurationStore=t,this.strategiesSource=this.isolate?new m({}):this.configurationStore.strategiesSource,this.strategies$=this.strategiesSource.asObservable(),this.onAuthorisedDefaultStrategy=this.isolate?void 0:this.configurationStore.onAuthorisedDefaultStrategy,this.onUnAuthorisedDefaultStrategy=this.isolate?void 0:this.configurationStore.onUnAuthorisedDefaultStrategy}setDefaultOnAuthorizedStrategy(e){this.isolate?this.onAuthorisedDefaultStrategy=this.getDefinedStrategy(e):(this.configurationStore.onAuthorisedDefaultStrategy=this.getDefinedStrategy(e),this.onAuthorisedDefaultStrategy=this.configurationStore.onAuthorisedDefaultStrategy)}setDefaultOnUnauthorizedStrategy(e){this.isolate?this.onUnAuthorisedDefaultStrategy=this.getDefinedStrategy(e):(this.configurationStore.onUnAuthorisedDefaultStrategy=this.getDefinedStrategy(e),this.onUnAuthorisedDefaultStrategy=this.configurationStore.onUnAuthorisedDefaultStrategy)}addPermissionStrategy(e,t){this.strategiesSource.value[e]=t}getStrategy(e){return this.strategiesSource.value[e]}getAllStrategies(){return this.strategiesSource.value}getDefinedStrategy(e){if(this.strategiesSource.value[e]||this.isPredefinedStrategy(e))return e;throw new Error(`No ' ${e} ' strategy is found please define one`)}isPredefinedStrategy(e){return e===D.SHOW||e===D.REMOVE}static{this.\u0275fac=function(t){return new(t||s)(l($),l(ie))}}static{this.\u0275prov=P({token:s,factory:s.\u0275fac})}}return s})();function u(s){return typeof s=="function"}function V(s){if(Object.prototype.toString.call(s)!=="[object Object]")return!1;{let B=Object.getPrototypeOf(s);return B===null||B===Object.prototype}}function se(s){return!!s&&typeof s=="string"}function w(s){return typeof s=="boolean"}function he(s){return Object.prototype.toString.call(s)==="[object Promise]"}function T(s){return Array.isArray(s)?s.length>0:!!s}function R(s){return se(s)?[s]:s}var re=(()=>{class s{constructor(){this.permissionsSource=new m({}),this.permissions$=this.permissionsSource.asObservable()}static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275prov=P({token:s,factory:s.\u0275fac})}}return s})(),W=new A("USE_PERMISSIONS_STORE"),E=(()=>{class s{constructor(e=!1,t){this.isolate=e,this.permissionsStore=t,this.permissionsSource=this.isolate?new m({}):this.permissionsStore.permissionsSource,this.permissions$=this.permissionsSource.asObservable()}flushPermissions(){this.permissionsSource.next({})}hasPermission(e){return!e||Array.isArray(e)&&e.length===0?Promise.resolve(!0):(e=R(e),this.hasArrayPermission(e))}loadPermissions(e,t){let i=e.reduce((r,n)=>this.reducePermission(r,n,t),{});this.permissionsSource.next(i)}addPermission(e,t){if(Array.isArray(e)){let i=e.reduce((r,n)=>this.reducePermission(r,n,t),this.permissionsSource.value);this.permissionsSource.next(i)}else{let i=this.reducePermission(this.permissionsSource.value,e,t);this.permissionsSource.next(i)}}removePermission(e){let t=g({},this.permissionsSource.value);delete t[e],this.permissionsSource.next(t)}getPermission(e){return this.permissionsSource.value[e]}getPermissions(){return this.permissionsSource.value}reducePermission(e,t,i){return i&&u(i)?O(g({},e),{[t]:{name:t,validationFunction:i}}):O(g({},e),{[t]:{name:t}})}hasArrayPermission(e){let t=e.map(i=>{if(this.hasPermissionValidationFunction(i)){let r=this.permissionsSource.value[i].validationFunction,n=g({},this.permissionsSource.value);return h(null).pipe(v(()=>r(i,n)),C(o=>w(o)?h(o):o),F(()=>h(!1)))}return h(!!this.permissionsSource.value[i])});return f(t).pipe(U(),x(i=>i!==!1,!1),v(i=>i!==!1)).toPromise().then(i=>i)}hasPermissionValidationFunction(e){return!!this.permissionsSource.value[e]&&!!this.permissionsSource.value[e].validationFunction&&u(this.permissionsSource.value[e].validationFunction)}static{this.\u0275fac=function(t){return new(t||s)(l(W),l(re))}}static{this.\u0275prov=P({token:s,factory:s.\u0275fac})}}return s})(),b=class{constructor(){this.rolesSource=new m({}),this.roles$=this.rolesSource.asObservable()}},K=new A("USE_ROLES_STORE"),k=(()=>{class s{constructor(e=!1,t,i){this.isolate=e,this.rolesStore=t,this.permissionsService=i,this.rolesSource=this.isolate?new m({}):this.rolesStore.rolesSource,this.roles$=this.rolesSource.asObservable()}addRole(e,t){let i=O(g({},this.rolesSource.value),{[e]:{name:e,validationFunction:t}});this.rolesSource.next(i)}addRoleWithPermissions(e,t){this.permissionsService.addPermission(t),this.addRole(e,t)}addRoles(e){Object.keys(e).forEach((t,i)=>{this.addRole(t,e[t])})}addRolesWithPermissions(e){Object.keys(e).forEach((t,i)=>{this.addRoleWithPermissions(t,e[t])})}flushRoles(){this.rolesSource.next({})}flushRolesAndPermissions(){this.flushRoles(),this.permissionsService.flushPermissions()}removeRole(e){let t=g({},this.rolesSource.value);delete t[e],this.rolesSource.next(t)}getRoles(){return this.rolesSource.value}getRole(e){return this.rolesSource.value[e]}hasOnlyRoles(e){return!e||Array.isArray(e)&&e.length===0?Promise.resolve(!0):(e=R(e),Promise.all([this.hasRoleKey(e),this.hasRolePermission(this.rolesSource.value,e)]).then(([i,r])=>i||r))}hasRoleKey(e){let t=e.map(i=>{if(!!this.rolesSource.value[i]&&!!this.rolesSource.value[i].validationFunction&&u(this.rolesSource.value[i].validationFunction)&&!he(this.rolesSource.value[i].validationFunction)){let n=this.rolesSource.value[i].validationFunction,o=g({},this.rolesSource.value);return h(null).pipe(v(()=>n(i,o)),C(d=>w(d)?h(d):d),F(()=>h(!1)))}return h(!1)});return f(t).pipe(U(),x(i=>i!==!1,!1),v(i=>i!==!1)).toPromise().then(i=>i)}hasRolePermission(e,t){return f(t).pipe(p(i=>e[i]&&Array.isArray(e[i].validationFunction)?f(e[i].validationFunction).pipe(p(r=>this.permissionsService.hasPermission(r)),H(r=>r===!0)):h(!1)),x(i=>i===!0,!1)).toPromise()}static{this.\u0275fac=function(t){return new(t||s)(l(K),l(b),l(E))}}static{this.\u0275prov=P({token:s,factory:s.\u0275fac})}}return s})(),Re=(()=>{class s{constructor(){this.permissionsAuthorized=new N,this.permissionsUnauthorized=new N,this.firstMergeUnusedRun=1,this.permissionsService=y(E),this.configurationService=y(L),this.rolesService=y(k),this.viewContainer=y(q),this.changeDetector=y(_),this.templateRef=y(J)}ngOnInit(){this.viewContainer.clear(),this.initPermissionSubscription=this.validateExceptOnlyPermissions()}ngOnChanges(e){let t=e.ngxPermissionsOnly,i=e.ngxPermissionsExcept;if(t||i){if(t&&t.firstChange||i&&i.firstChange)return;M(this.permissionsService.permissions$,this.rolesService.roles$).pipe(z(this.firstMergeUnusedRun),G(1)).subscribe(()=>{if(T(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(T(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}}ngOnDestroy(){this.initPermissionSubscription&&this.initPermissionSubscription.unsubscribe()}validateExceptOnlyPermissions(){return M(this.permissionsService.permissions$,this.rolesService.roles$).pipe(z(this.firstMergeUnusedRun)).subscribe(()=>{if(T(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(T(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}validateExceptAndOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsExcept),this.rolesService.hasOnlyRoles(this.ngxPermissionsExcept)]).then(([e,t])=>{if(e||t){this.handleUnauthorisedPermission(this.ngxPermissionsExceptElse||this.ngxPermissionsElse);return}if(this.ngxPermissionsOnly)throw!1;this.handleAuthorisedPermission(this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef)}).catch(()=>{this.ngxPermissionsOnly?this.validateOnlyPermissions():this.handleAuthorisedPermission(this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef)})}validateOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsOnly),this.rolesService.hasOnlyRoles(this.ngxPermissionsOnly)]).then(([e,t])=>{e||t?this.handleAuthorisedPermission(this.ngxPermissionsOnlyThen||this.ngxPermissionsThen||this.templateRef):this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)}).catch(()=>{this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)})}handleUnauthorisedPermission(e){if(!(w(this.currentAuthorizedState)&&!this.currentAuthorizedState)){if(this.currentAuthorizedState=!1,this.permissionsUnauthorized.emit(),this.getUnAuthorizedStrategyInput()){this.applyStrategyAccordingToStrategyType(this.getUnAuthorizedStrategyInput());return}this.configurationService.onUnAuthorisedDefaultStrategy&&!this.elseBlockDefined()?this.applyStrategy(this.configurationService.onUnAuthorisedDefaultStrategy):this.showTemplateBlockInView(e)}}handleAuthorisedPermission(e){if(!(w(this.currentAuthorizedState)&&this.currentAuthorizedState)){if(this.currentAuthorizedState=!0,this.permissionsAuthorized.emit(),this.getAuthorizedStrategyInput()){this.applyStrategyAccordingToStrategyType(this.getAuthorizedStrategyInput());return}this.configurationService.onAuthorisedDefaultStrategy&&!this.thenBlockDefined()?this.applyStrategy(this.configurationService.onAuthorisedDefaultStrategy):this.showTemplateBlockInView(e)}}applyStrategyAccordingToStrategyType(e){if(se(e)){this.applyStrategy(e);return}if(u(e)){this.showTemplateBlockInView(this.templateRef),e(this.templateRef);return}}showTemplateBlockInView(e){this.viewContainer.clear(),e&&(this.viewContainer.createEmbeddedView(e),this.changeDetector.markForCheck())}getAuthorisedTemplates(){return this.ngxPermissionsOnlyThen||this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef}elseBlockDefined(){return!!this.ngxPermissionsExceptElse||!!this.ngxPermissionsElse}thenBlockDefined(){return!!this.ngxPermissionsExceptThen||!!this.ngxPermissionsThen}getAuthorizedStrategyInput(){return this.ngxPermissionsOnlyAuthorisedStrategy||this.ngxPermissionsExceptAuthorisedStrategy||this.ngxPermissionsAuthorisedStrategy}getUnAuthorizedStrategyInput(){return this.ngxPermissionsOnlyUnauthorisedStrategy||this.ngxPermissionsExceptUnauthorisedStrategy||this.ngxPermissionsUnauthorisedStrategy}applyStrategy(e){if(e===D.SHOW){this.showTemplateBlockInView(this.templateRef);return}if(e===D.REMOVE){this.viewContainer.clear();return}let t=this.configurationService.getStrategy(e);this.showTemplateBlockInView(this.templateRef),t(this.templateRef)}static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275dir=X({type:s,selectors:[["","ngxPermissionsOnly",""],["","ngxPermissionsExcept",""]],inputs:{ngxPermissionsOnly:"ngxPermissionsOnly",ngxPermissionsOnlyThen:"ngxPermissionsOnlyThen",ngxPermissionsOnlyElse:"ngxPermissionsOnlyElse",ngxPermissionsExcept:"ngxPermissionsExcept",ngxPermissionsExceptElse:"ngxPermissionsExceptElse",ngxPermissionsExceptThen:"ngxPermissionsExceptThen",ngxPermissionsThen:"ngxPermissionsThen",ngxPermissionsElse:"ngxPermissionsElse",ngxPermissionsOnlyAuthorisedStrategy:"ngxPermissionsOnlyAuthorisedStrategy",ngxPermissionsOnlyUnauthorisedStrategy:"ngxPermissionsOnlyUnauthorisedStrategy",ngxPermissionsExceptUnauthorisedStrategy:"ngxPermissionsExceptUnauthorisedStrategy",ngxPermissionsExceptAuthorisedStrategy:"ngxPermissionsExceptAuthorisedStrategy",ngxPermissionsUnauthorisedStrategy:"ngxPermissionsUnauthorisedStrategy",ngxPermissionsAuthorisedStrategy:"ngxPermissionsAuthorisedStrategy"},outputs:{permissionsAuthorized:"permissionsAuthorized",permissionsUnauthorized:"permissionsUnauthorized"},standalone:!1,features:[Z]})}}return s})(),ue="default";var te=(()=>{class s{constructor(e,t,i){this.permissionsService=e,this.rolesService=t,this.router=i}canActivate(e,t){return this.hasPermissions(e,t)}canActivateChild(e,t){return this.hasPermissions(e,t)}canLoad(e){return this.hasPermissions(e)}canMatch(e){return this.hasPermissions(e)}hasPermissions(e,t){let i=e&&e.data?e.data.permissions:{},r=this.transformPermission(i,e,t);return this.isParameterAvailable(r.except)?this.passingExceptPermissionsValidation(r,e,t):this.isParameterAvailable(r.only)?this.passingOnlyPermissionsValidation(r,e,t):!0}transformPermission(e,t,i){let r=u(e.only)?e.only(t,i):R(e.only),n=u(e.except)?e.except(t,i):R(e.except),o=e.redirectTo;return{only:r,except:n,redirectTo:o}}isParameterAvailable(e){return!!e&&e.length>0}passingExceptPermissionsValidation(e,t,i){if(e.redirectTo&&(u(e.redirectTo)||V(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo))){let r="";return f(e.except).pipe(p(n=>I([this.permissionsService.hasPermission(n),this.rolesService.hasOnlyRoles(n)]).pipe(j(o=>{o.every(S=>S===!1)||(r=n)}))),x(n=>n.some(o=>o===!0),!1),p(n=>r?(this.handleRedirectOfFailedPermission(e,r,t,i),h(!1)):!n&&e.only?this.onlyRedirectCheck(e,t,i):h(!n))).toPromise()}return Promise.all([this.permissionsService.hasPermission(e.except),this.rolesService.hasOnlyRoles(e.except)]).then(([r,n])=>r||n?(e.redirectTo&&this.redirectToAnotherRoute(e.redirectTo,t,i),!1):e.only?this.checkOnlyPermissions(e,t,i):!0)}redirectToAnotherRoute(e,t,i,r){let n=u(e)?e(r,t,i):e;if(this.isRedirectionWithParameters(n)){n.navigationCommands=this.transformNavigationCommands(n.navigationCommands,t,i),n.navigationExtras=this.transformNavigationExtras(n.navigationExtras,t,i),this.router.navigate(n.navigationCommands,n.navigationExtras);return}Array.isArray(n)?this.router.navigate(n):this.router.navigate([n])}isRedirectionWithParameters(e){return V(e)&&(!!e.navigationCommands||!!e.navigationExtras)}transformNavigationCommands(e,t,i){return u(e)?e(t,i):e}transformNavigationExtras(e,t,i){return u(e)?e(t,i):e}onlyRedirectCheck(e,t,i){let r="";return f(e.only).pipe(p(n=>I([this.permissionsService.hasPermission(n),this.rolesService.hasOnlyRoles(n)]).pipe(j(o=>{o.every(S=>S===!1)&&(r=n)}))),x(n=>u(e.redirectTo)?n.some(o=>o===!0):n.every(o=>o===!1),!1),p(n=>u(e.redirectTo)?n?h(!0):(this.handleRedirectOfFailedPermission(e,r,t,i),h(!1)):(r&&this.handleRedirectOfFailedPermission(e,r,t,i),h(!n)))).toPromise()}handleRedirectOfFailedPermission(e,t,i,r){this.isFailedPermissionPropertyOfRedirectTo(e,t)?this.redirectToAnotherRoute(e.redirectTo[t],i,r,t):u(e.redirectTo)?this.redirectToAnotherRoute(e.redirectTo,i,r,t):this.redirectToAnotherRoute(e.redirectTo[ue],i,r,t)}isFailedPermissionPropertyOfRedirectTo(e,t){return!!e.redirectTo&&e.redirectTo[t]}checkOnlyPermissions(e,t,i){let r=g({},e);return Promise.all([this.permissionsService.hasPermission(r.only),this.rolesService.hasOnlyRoles(r.only)]).then(([n,o])=>n||o?!0:(r.redirectTo&&this.redirectToAnotherRoute(r.redirectTo,t,i),!1))}passingOnlyPermissionsValidation(e,t,i){return u(e.redirectTo)||V(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo)?this.onlyRedirectCheck(e,t,i):this.checkOnlyPermissions(e,t,i)}static{this.\u0275fac=function(t){return new(t||s)(l(E),l(k),l(ee))}}static{this.\u0275prov=P({token:s,factory:s.\u0275fac})}}return s})();var be=(()=>{class s{static forRoot(e={}){return{ngModule:s,providers:[re,b,ie,E,te,k,L,{provide:W,useValue:e.permissionsIsolate},{provide:K,useValue:e.rolesIsolate},{provide:$,useValue:e.configurationIsolate}]}}static forChild(e={}){return{ngModule:s,providers:[{provide:W,useValue:e.permissionsIsolate},{provide:K,useValue:e.rolesIsolate},{provide:$,useValue:e.configurationIsolate},L,E,k,te]}}static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275mod=Q({type:s})}static{this.\u0275inj=Y({})}}return s})();export{c as a,a as b,fe as c,E as d,Re as e,be as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as _}from"./chunk-4JRXTPAH.js";import"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import{l as A,m as L}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import"./chunk-AI4XRCAL.js";import{E as R,H as b,J as M,g as I,j as g,k as x,l as D,m as E,n as C}from"./chunk-B6POIFQM.js";import{Eb as h,Ec as o,Fc as p,Gc as S,Kb as f,Wb as c,Xc as l,Yc as s,Z as y,Zc as v,gc as i,hc as n,qb as a,v as u,wb as m}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";function P(r,B){if(r&1&&(i(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"h5"),o(6,"General"),n()(),i(7,"div",8)(8,"div",9)(9,"div",10)(10,"div",11)(11,"label"),o(12,"Created"),n(),i(13,"div")(14,"span"),o(15),l(16,"date"),n()()()(),i(17,"div",10)(18,"div",11)(19,"label"),o(20,"Duration"),n(),i(21,"div")(22,"span"),o(23),l(24,"number"),n()()()(),i(25,"div",10)(26,"div",11)(27,"label"),o(28,"Response Code"),n(),i(29,"div")(30,"span"),o(31),n()()()()()()()()(),i(32,"div",4)(33,"div",10)(34,"div",6)(35,"div",7)(36,"h5"),o(37,"Request"),n()(),i(38,"div",8)(39,"div",12)(40,"div",13)(41,"pre"),o(42),l(43,"json"),n()()()()()(),i(44,"div",10)(45,"div",6)(46,"div",7)(47,"h5"),o(48,"Response"),n()(),i(49,"div",8)(50,"div",14)(51,"div",13)(52,"pre"),o(53),l(54,"json"),n()()()()()()()()),r&2){let e=B.ngIf;a(15),p(v(16,5,e==null?null:e._source["@timestamp"],"dd MMM yyyy HH:mm:ss")),a(8),S("",v(24,8,e==null?null:e.DurationInSecond,"1.1-1")," s"),a(8),p(e==null?null:e.respCode),a(11),p(s(43,11,e==null?null:e.req)),a(11),p(s(54,13,e==null?null:e.res))}}var $=(()=>{class r{constructor(e,t){this.inventoryAsyncServiceLog=e,this.activatedRoute=t}ngOnInit(){let e=this.activatedRoute.snapshot.queryParams;this.initInventoryLog(e?.ID)}initInventoryLog(e){this.inventoryLog$=this.inventoryAsyncServiceLog.getInventoryAsyncLogDetail(e).pipe(u(t=>{let d=JSON.parse(t.hits[0]._source?.log?.response);return t.hits[0].DurationInSecond=parseInt(d.Duration)/1e3,t.hits[0].respCode=d?.StatusCode,t.hits[0].req=JSON.parse(t.hits[0]._source?.log?.request),t.hits[0].res=d,t?.hits[0]}),y(1))}static{this.\u0275fac=function(t){return new(t||r)(m(_),m(R))}}static{this.\u0275cmp=h({type:r,selectors:[["app-inventory-async-detail"]],decls:7,vars:5,consts:[["headerTitle","Product Inventory Sync Detail",3,"hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"]],template:function(t,d){t&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),o(3,"Back"),n()(),i(4,"content"),f(5,P,55,15,"div",2),l(6,"async"),n()()),t&2&&(c("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),c("ngIf",s(6,3,d.inventoryLog$)))},dependencies:[C,I,g,D,E,x,L,A,M,b],encapsulation:2})}}return r})();export{$ as InventoryAsyncDetailComponent};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as se}from"./chunk-OVYL7SOO.js";import{a as E}from"./chunk-T7KM2WP6.js";import{a as ne,b as S,c as re,d as de,e as le,f as H,g as ce,h as pe,m as f}from"./chunk-VOISFPEM.js";import{a as ae,b as T}from"./chunk-BSATGCWC.js";import{b as oe,d as x}from"./chunk-VKJAFLQ6.js";import{a as I}from"./chunk-R5IDWUP6.js";import{a as ee,b as te,f as ie}from"./chunk-4RAOUTR2.js";import{a as X}from"./chunk-AI4XRCAL.js";import{c as Z}from"./chunk-W6T7TOHE.js";import{g as v,j as W,n as w}from"./chunk-B6POIFQM.js";import{Dc as A,Eb as b,Ec as U,Fb as D,Fc as G,Ka as N,Kb as h,Mc as q,Vb as P,Wb as n,Xb as V,Xc as J,Yc as K,ca as Y,f as F,fd as Q,g as B,gc as d,hc as s,ic as g,ja as j,jc as R,ka as y,kc as z,mc as _,qb as r,rc as m,sc as C,vc as $,wb as p,xa as L,ya as l,za as c}from"./chunk-EIQCOZF5.js";var O=(()=>{class t{constructor(){this._calendarHeaderConfig=new B({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=j({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ce=["class","component ts"];function ke(t,k){if(t&1){let e=_();d(0,"button",3),m("click",function(){l(e);let a=C(2);return c(a.todayClicked())}),g(1,"i",4),s()}}function Me(t,k){if(t&1){let e=_();d(0,"button",5),m("click",function(){l(e);let a=C(2);return c(a.clearClicked())}),g(1,"i",6),s()}}function ye(t,k){if(t&1&&(R(0),h(1,ke,2,0,"button",1)(2,Me,2,0,"button",2),z()),t&2){let e=k.ngIf;r(),n("ngIf",!e.hideBtnToday),r(),n("ngIf",!e.hideBtnClear)}}var ue=(()=>{class t{constructor(e,i,a,o,u){this._datePicker=e,this._calendar=i,this._dateAdapter=a,this.calendarService=o,this._destroyed=new F,i.stateChanges.pipe(Y(this._destroyed)).subscribe(M=>u.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(p(H),p(le),p(S),p(O),p(Q))}}static{this.\u0275cmp=b({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[L],attrs:Ce,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,a){i&1&&(d(0,"mat-calendar-header"),h(1,ye,3,2,"ng-container",0),J(2,"async"),s()),i&2&&(r(),n("ngIf",K(2,1,a.calendarConfig$)))},dependencies:[v,oe,de,W],encapsulation:2})}}return t})(),he=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=D({type:t})}static{this.\u0275inj=y({providers:[f],imports:[w,x,E,f,I,T]})}}return t})();function be(t,k){if(t&1&&(d(0,"mat-label",6)(1,"span"),U(2),s()()),t&2){let e=C();n("show",e.placeholder),r(2),G(e.placeholder)}}var De={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},et=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=ue,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new N,this.minDate=Z.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(p(O))}}static{this.\u0275cmp=b({type:t,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[q([{provide:S,useClass:se,deps:[ne]},{provide:re,useValue:De},{provide:X,multi:!0,useExisting:t}])],decls:6,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","",3,"for"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,a){if(i&1){let o=_();d(0,"mat-form-field",1),h(1,be,3,2,"mat-label",2),d(2,"input",3),m("dateChange",function(M){return l(o),c(a.change(M.value))})("click",function(){l(o);let M=A(5);return c(M.open())}),s(),g(3,"mat-datepicker-toggle",4),d(4,"mat-datepicker",5,0),m("opened",function(){return l(o),c(a.onOpenDatepicker())})("closed",function(){return l(o),c(a.onCloseDatepicker())}),s()()}if(i&2){let o=A(5);V("width",a.width||100,"%"),n("disabled",a.disabled)("appearance",a.appearance),r(),n("ngIf",a.isFloatingLabel&&a.placeholder),r(),$("placeholder",a.placeholder||""),n("matDatepicker",o)("min",a.minDateValidation)("max",a.maxDateValidation)("value",a.date==a.minDate?null:a.date)("disabled",a.disabled)("readonly",a.readOnly),P("data-cy",a.data_cy),r(),V("display",a.displayToggle?"unset":"none"),n("for",o),r(),n("calendarHeaderComponent",a.headerComponent)}},dependencies:[v,H,ce,pe,ie,ee,te,ae],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
2
|
-
`],encapsulation:2})}}return t})(),tt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=D({type:t})}static{this.\u0275inj=y({providers:[f],imports:[w,x,E,f,I,T,he]})}}return t})();export{et as a,tt as b};
|