marketplacepos 5.50.2 → 5.50.3
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 +26 -26
- package/Marketplace/{chunk-2DZHA445.js → chunk-2FB6QJKT.js} +1 -1
- package/Marketplace/{chunk-7K6U3ABQ.js → chunk-2OKZEOBU.js} +1 -1
- package/Marketplace/{chunk-WG34QKGX.js → chunk-3PUUKJCQ.js} +1 -1
- package/Marketplace/{chunk-LQUMSCFQ.js → chunk-3YUIOGNI.js} +1 -1
- package/Marketplace/{chunk-DYTXOFIM.js → chunk-53ZGHR7J.js} +1 -1
- package/Marketplace/chunk-5NWJOQN5.js +1 -0
- package/Marketplace/{chunk-TH27YE6R.js → chunk-6MUVEZMQ.js} +1 -1
- package/Marketplace/{chunk-JUWHPFPW.js → chunk-7E4ZSLPD.js} +1 -1
- package/Marketplace/{chunk-3TK5BYAY.js → chunk-7VJ22OLT.js} +1 -1
- package/Marketplace/{chunk-XF4A775R.js → chunk-CBULW22C.js} +1 -1
- package/Marketplace/{chunk-CZICXKFA.js → chunk-CFJAZJYY.js} +1 -1
- package/Marketplace/{chunk-VFZ76Z6T.js → chunk-CGDIULPW.js} +1 -1
- package/Marketplace/{chunk-5NJAMQES.js → chunk-CQBHWYUO.js} +1 -1
- package/Marketplace/{chunk-7XA3VQEB.js → chunk-DIDUSCV7.js} +1 -1
- package/Marketplace/{chunk-WXXGLR46.js → chunk-EV6TBBSW.js} +1 -1
- package/Marketplace/{chunk-TVFILHVN.js → chunk-FBXKHJ2G.js} +1 -1
- package/Marketplace/{chunk-OUYOKQ57.js → chunk-FDVRSAF3.js} +1 -1
- package/Marketplace/{chunk-KUPGF23P.js → chunk-FO75JP2L.js} +1 -1
- package/Marketplace/{chunk-WCX3T6LK.js → chunk-FPJTI4LM.js} +1 -1
- package/Marketplace/{chunk-BGJEGBP5.js → chunk-FS3VTRY2.js} +1 -1
- package/Marketplace/{chunk-ZLNNQRTE.js → chunk-HAZ7U3MT.js} +1 -1
- package/Marketplace/chunk-HHDJUCIT.js +1 -0
- package/Marketplace/{chunk-B5BQZD66.js → chunk-HMDHDMIC.js} +1 -1
- package/Marketplace/{chunk-TLCH5ENB.js → chunk-JEJHGIUU.js} +1 -1
- package/Marketplace/{chunk-GRVGKVD6.js → chunk-JG7M73IA.js} +1 -1
- package/Marketplace/{chunk-GD6ZN56B.js → chunk-JLDXWNDU.js} +1 -1
- package/Marketplace/{chunk-U7FIZHGC.js → chunk-KDJVMFOK.js} +1 -1
- package/Marketplace/{chunk-PRM7MTFP.js → chunk-KKQ32Z72.js} +1 -1
- package/Marketplace/{chunk-DQXBBV26.js → chunk-KMNWLBEP.js} +1 -1
- package/Marketplace/{chunk-G3KVHCET.js → chunk-KNE2UYQ2.js} +1 -1
- package/Marketplace/{chunk-TUJBAZ5Q.js → chunk-MYJZFEAZ.js} +1 -1
- package/Marketplace/{chunk-4NT5VNJW.js → chunk-MZWP4SZF.js} +2 -2
- package/Marketplace/{chunk-YYKWI27U.js → chunk-N4MYHIMN.js} +1 -1
- package/Marketplace/{chunk-SS4PLPBF.js → chunk-NGQFZI6A.js} +1 -1
- package/Marketplace/{chunk-TG7XOXCH.js → chunk-PFP5WMC3.js} +1 -1
- package/Marketplace/{chunk-OWLZQ5WE.js → chunk-PHVEBMTE.js} +1 -1
- package/Marketplace/{chunk-CHGAMAQX.js → chunk-QJH7APJQ.js} +1 -1
- package/Marketplace/{chunk-ZD5PSX3I.js → chunk-QJU2YGUH.js} +1 -1
- package/Marketplace/{chunk-KA2HPWPG.js → chunk-QWEMPIP7.js} +1 -1
- package/Marketplace/{chunk-YBRWFONB.js → chunk-QZMWXAUJ.js} +1 -1
- package/Marketplace/{chunk-EKYPWTJN.js → chunk-RRRPWDKB.js} +1 -1
- package/Marketplace/{chunk-42GDFAAQ.js → chunk-S2ZFBPPJ.js} +1 -1
- package/Marketplace/{chunk-QB7PXKAO.js → chunk-TOPYLZOF.js} +1 -1
- package/Marketplace/{chunk-FUBZ75C7.js → chunk-UMJVPGHV.js} +1 -1
- package/Marketplace/{chunk-A4UF2QH6.js → chunk-UWKDFRVX.js} +1 -1
- package/Marketplace/{chunk-QSW7O4GN.js → chunk-VA7NXG7X.js} +1 -1
- package/Marketplace/{chunk-XCJ5XRFI.js → chunk-X2WAAZ7G.js} +1 -1
- package/Marketplace/{chunk-PQM7IB5J.js → chunk-XCGXT3P7.js} +1 -1
- package/Marketplace/{chunk-YQKEWN54.js → chunk-XMU7MXAM.js} +1 -1
- package/Marketplace/{chunk-ELAPYSP6.js → chunk-XYRET5HT.js} +1 -1
- package/Marketplace/{chunk-F24YPKYG.js → chunk-XYZI7ZXN.js} +1 -1
- package/Marketplace/{chunk-7AJN7ECH.js → chunk-YCKLOFMA.js} +1 -1
- package/Marketplace/{chunk-EDGT4W2Q.js → chunk-YDNXBOLU.js} +1 -1
- package/Marketplace/{chunk-EU324R5S.js → chunk-YEU5TPRD.js} +1 -1
- package/Marketplace/{chunk-6LXQMIYX.js → chunk-YQPAS2RI.js} +1 -1
- package/Marketplace/{chunk-2UKRRVAM.js → chunk-ZLJBRQ5V.js} +1 -1
- package/Marketplace/{chunk-RNJHJCHP.js → chunk-ZM7ND6FE.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-G6GGJLGW.js → main-7TBLEURN.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-UQ7PDZO3.js +0 -1
- /package/Marketplace/{chunk-FDGH6XKK.js → chunk-CIVDQKQZ.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ne,b as Fe}from"./chunk-RIIIECQH.js";import{a as Pe}from"./chunk-JWDQVXQP.js";import{a as Ee,b as Ve}from"./chunk-K5WSFDNA.js";import{a as De}from"./chunk-TVFILHVN.js";import{a as j}from"./chunk-L6CRWJ2O.js";import{a as Ae}from"./chunk-PV4OJSZI.js";import"./chunk-FSOZOROI.js";import"./chunk-VYI7JYH5.js";import"./chunk-BZWZ64N5.js";import{a as Me}from"./chunk-WG34QKGX.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as Le}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as Te}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as ke}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{a as Se,c as we,e as ve,f as ye,g as xe}from"./chunk-IA7NJXJD.js";import{a as be}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as _e}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-7K6U3ABQ.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as x}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as d,c as A}from"./chunk-UPRDDI4K.js";import{A as z,b as ge,c as fe,h as W,m as R,o as Ce}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as M,e as O}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as ue,B as he,w as me,y as de}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Cc as te,Dc as ie,Ec as ne,G,Hb as N,Ia as B,Mc as oe,Nc as m,Oc as P,Pc as E,Rc as S,Sc as w,Tc as v,Uc as re,Vc as ae,Wc as F,Z as J,_c as le,aa as X,ac as k,ad as pe,cc as T,dc as Z,fc as $,gc as ee,hc as y,ic as o,id as V,jc as r,jd as I,kc as _,kd as se,ma as D,mb as Y,ob as c,pd as ce,ra as C,rc as L,v as K,wc as b,ya as h,yc as f,za as g}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as Q,b as q}from"./chunk-66YHNWRR.js";var Ie=(()=>{let l=class l{constructor(){this.http=C(O),this.toastr=C(M)}printTokopediaShippingLabel(e,t=!1){let i={OrderNumber:e,Printed:t};return this.http.post(x.TokopediaPrintShippingLabel,i)}printTiktokShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.TiktokPrintShippingLabel,i)}printShopeeShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.ShopeePrintShippingLabel,i).pipe(K(p=>(p&&(p.Number=e),p)))}printLazadaShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.LazadaPrintShippingLabel,i)}handleShippingLabelResponse(e,t){switch(t){case d.Tokopedia:let u=window.open("about:blank","_blank");u.document.write(e.File),u.document.close();break;case d.Tiktok:e.data!=null?window.open(e.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print");break;case d.Shopee:var i=Uint8Array.from(atob(e.File),s=>s.charCodeAt(0)),p=new Blob([i],{type:"octet/stream"});A.openDownloadFile(p,`${e?.Number}.pdf`);break;case d.Lazada:e?.result?.data!=null?window.open(e?.result?.data?.pdf_url,"_blank"):this.toastr.error(e.message,"Cannot Print");break}}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=D({token:l,factory:l.\u0275fac,providedIn:"root"});let a=l;return a})();var Oe=(()=>{let l=class l{constructor(){this.dialogRef=C(Se),this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=N({type:l,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"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(t,i){t&1&&(o(0,"div",0)(1,"h2",1),m(2,"Cetak label pesanan"),r(),o(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),m(7,"Kamu akan mencetak label yang berisi detail pesanan"),r(),o(8,"div",5)(9,"mat-checkbox",6),v("ngModelChange",function(u){return w(i.tandaiSudahDicetak,u)||(i.tandaiSudahDicetak=u),u}),r(),o(10,"span",7),m(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),r()()()()(),o(12,"mat-dialog-actions",8)(13,"button",9),b("click",function(){return i.onCancel()}),m(14,"Cancel"),r(),o(15,"button",10),b("click",function(){return i.onPrint()}),m(16,"Cetak Pesanan"),r()()()),t&2&&(c(9),S("ngModel",i.tandaiSudahDicetak))},dependencies:[z,W,R,xe,ye,ve],encapsulation:2});let a=l;return a})();var U=(()=>{let l=class l{constructor(){this.httpService=C(O),this.shippingLabelService=C(Ie),this.toastrService=C(M),this.dialog=C(we)}printShippingLabel(e){switch(e?.MarketType){case d.Shopee:this.shippingLabelService.printShopeeShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Shopee));break;case d.Tiktok:this.shippingLabelService.printTiktokShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Tiktok));break;case d.Tokopedia:this.dialog.open(Oe).afterClosed().pipe(G(t=>A.IsNotEmpty(t)),X(t=>this.shippingLabelService.printTokopediaShippingLabel(e.Number,t))).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Tokopedia));break;case d.Lazada:this.shippingLabelService.printLazadaShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Lazada));break;case d.Shopify:this.toastrService.error("Shopify not supported","Error Not supported");break}}printMultipleShippingLabel(e){let t=e.map(p=>({OrderNumber:p.Number,ShopID:p.ShopID})),i="";switch(e[0]?.MarketType){case d.Shopee:i=x.ShopeePrintMultipleShippingLabel;break;case d.Tiktok:i=x.TiktokPrintMultipleShippingLabel;break;case d.Lazada:i=x.LazadaPrintMultipleShippingLabel;break}this.httpService.post(i,t).subscribe(p=>{var u=Uint8Array.from(atob(p.File),We=>We.charCodeAt(0)),s=new Blob([u],{type:"octet/stream"});A.openDownloadFile(s,`${p?.Name}.pdf`)})}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=D({token:l,factory:l.\u0275fac});let a=l;return a})();var ze=["contextMenu"],Be=a=>({"td-cell-hover":a});function je(a,l){if(a&1){let n=L();o(0,"button",20),b("click",function(){h(n);let t=f(),i=F(0);return g(t.onDowloadShippingLabel(i))}),_(1,"i",21),o(2,"span"),m(3,"Download Shipping Label"),r()()}}function He(a,l){if(a&1){let n=L();o(0,"input",47),v("ngModelChange",function(t){h(n);let i=f().$implicit;return w(i.selected,t)||(i.selected=t),g(t)}),b("ngModelChange",function(){h(n);let t=f(3),i=F(0);return g(t.onSelectOrders(i))}),r()}if(a&2){let n=f().$implicit,e=f(2);S("ngModel",n.selected),y("disabled",e.selectedChannelType()!=null&&e.selectedChannelType()!=n.MarketType)}}function Ue(a,l){if(a&1&&_(0,"variants-dropdown",39),a&2){let n=f().$implicit;y("variants",n==null?null:n.Variants)}}function Qe(a,l){if(a&1&&_(0,"variant-with-image",40),a&2){let n=f().$implicit;y("variant",n==null?null:n.Variants[0])}}function qe(a,l){if(a&1&&(o(0,"span"),m(1),r()),a&2){let n=f().$implicit;c(),E("(",n.LogisticService==null?null:n.LogisticService.Option,")")}}function Ke(a,l){if(a&1){let n=L();o(0,"button",48),b("click",function(){h(n);let t=f().$implicit,i=f(2);return g(i.onPrintShippingLabel(t))}),_(1,"i",49),r()}}function Ge(a,l){if(a&1){let n=L();o(0,"tr")(1,"td"),k(2,He,1,2,"input",31),r(),o(3,"td")(4,"div",32),_(5,"img",33),V(6,"channelImage"),o(7,"div",34)(8,"div"),m(9),r(),o(10,"small",35)(11,"span"),m(12),r()()()()(),o(13,"td")(14,"div",36)(15,"div"),_(16,"order-link",37),r(),o(17,"small"),m(18),V(19,"date"),r(),_(20,"br"),o(21,"small"),_(22,"i",38),m(23),r()()(),o(24,"td"),k(25,Ue,1,1,"variants-dropdown",39)(26,Qe,1,1,"variant-with-image",40),r(),o(27,"td",41),m(28),V(29,"number"),r(),o(30,"td",42),b("mouseenter",function(t){let i=h(n).$implicit,p=f(2);return g(p.onMouseEnter(t,i))}),o(31,"div",43)(32,"div",36)(33,"div",44)(34,"span"),m(35),r(),k(36,qe,2,1,"span"),r(),o(37,"small"),m(38),r()()()(),o(39,"td",45),k(40,Ke,2,0,"button",46),r()()}if(a&2){let n=l.$implicit,e=f(2);c(2),T((n==null?null:n.MarketType)!=e.channelType.WooCommerce?2:-1),c(3),y("src",I(6,16,n==null?null:n.MarketType),Y)("alt",n==null||n.Variants[0]==null?null:n.Variants[0].Name),c(4),P(n.Outlet),c(3),P(n.ChannelName),c(4),y("order",n),c(2),E(" ",se(19,18,n==null?null:n.Created,"dd/MM/yyyy HH:mm:ss")," "),c(5),E(" ",n.Customer," "),c(),oe(pe(23,Be,(n.Variants==null?null:n.Variants.length)>1)),c(),T((n.Variants==null?null:n.Variants.length)>1?25:26),c(3),P(I(29,21,n.Amount)),c(7),P(n.LogisticService!=null&&n.LogisticService.Name?n.LogisticService==null?null:n.LogisticService.Name:"-"),c(),T(n.LogisticService!=null&&n.LogisticService.Option&&(n.LogisticService==null?null:n.LogisticService.Option)!="Default"?36:-1),c(2),E(" ",n.ReferenceNumber?n.ReferenceNumber:"-"," "),c(2),T((n==null?null:n.MarketType)!=e.channelType.WooCommerce?40:-1)}}function Je(a,l){if(a&1){let n=L();o(0,"div",17)(1,"table",22)(2,"thead",23)(3,"tr",24),_(4,"th",25),o(5,"th",26),m(6,"Outlet"),r(),o(7,"th",26),m(8,"Number"),r(),o(9,"th"),m(10,"Items"),r(),o(11,"th",27),m(12,"Amount"),r(),o(13,"th",28),m(14,"Shipping"),r(),_(15,"th",29),r()(),o(16,"tbody"),$(17,Ge,41,25,"tr",null,Z),r()(),o(19,"app-custom-paginator",30),b("next",function(){h(n);let t=f();return g(t.initAwaitingCollection())})("previous",function(){h(n);let t=f();return g(t.initAwaitingCollection())}),r()()}if(a&2){let n=f(),e=F(0);c(17),ee(e),c(2),y("filter",n.filter())("totaldata",e==null?null:e.length)}}function Xe(a,l){a&1&&(o(0,"div",18),_(1,"app-empty-state"),r())}var Jt=(()=>{let l=class l{constructor(){this.printShippingService=C(U),this.orderService=C(j),this.toastr=C(M),this.fulfillmentService=C(Ne),this.channelType=d,this.selectedOrders=B([]),this.selectedChannelType=ce(()=>{let e=null;return this.selectedOrders().length>0&&(e=this.selectedOrders()[0].MarketType),e}),this.filter=B({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"},{id:"fulfillment",label:"Set Fulfillment",icon:"fa-solid fa-truck"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(t=>q(Q({},t),{From:e})),this.initAwaitingCollection()}initAwaitingCollection(){this.awaitingCollections$=this.orderService.getAwaitingCollectionOrders(this.filter()).pipe(J(1))}onPrintShippingLabel(e){this.printShippingService.printShippingLabel(e)}onSelectOrders(e){let t=e.filter(i=>i.selected);this.selectedOrders.set(t)}onDowloadShippingLabel(e){e=e.map(t=>(t.selected=!1,t)),this.printShippingService.printMultipleShippingLabel(this.selectedOrders()),this.selectedOrders.set([])}onSetFulfillment(e){this.fulfillmentService.setFulfillmentOrder(e).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initAwaitingCollection()})}refreshShippingAndRefNumber(e){this.orderService.refreshShippingCourier(e.ShopID,e.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initAwaitingCollection()})}onMouseEnter(e,t){(!t.LogisticService?.Name||!t.ReferenceNumber)&&this.contextMenuEl.show(e,t)}onSelectContextItem(e){e.item?.id==="refresh"?this.refreshShippingAndRefNumber(e.data):this.onSetFulfillment(e.data)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=N({type:l,selectors:[["app-awaiting-collection"]],viewQuery:function(t,i){if(t&1&&te(ze,5),t&2){let p;ie(p=ne())&&(i.contextMenuEl=p.first)}},features:[le([j,U])],decls:37,vars:13,consts:[["contextMenu",""],["headerTitle","Awaiting Collection","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-3"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[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,"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"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrow-down-to-line","me-3"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","150px"],[2,"width","50px"],["rowCountApi","/api/orders/awaitingcollectioncount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModel","disabled"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[3,"mouseenter"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"text-end","td-cell-hover"],["type","button","aria-label","Print order","title","Print","matTooltip","Download shipping label",1,"btn","p-0","border-0","bg-transparent"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],["type","button","aria-label","Print order","title","Print","matTooltip","Download shipping label",1,"btn","p-0","border-0","bg-transparent",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrow-down-to-line"]],template:function(t,i){if(t&1){let p=L();re(0),V(1,"async"),o(2,"mainpanel",1),b("onSubmit",function(){return h(p),g(i.initAwaitingCollection())}),v("textChange",function(s){return h(p),w(i.filter().Number,s)||(i.filter().Number=s),g(s)}),o(3,"actions"),k(4,je,4,0,"button",2),o(5,"a",3),_(6,"i",4),o(7,"span"),m(8,"Order Fulfillment Display"),r()()(),o(9,"filters")(10,"div")(11,"label",5),m(12,"Channel"),r(),o(13,"app-channel-options-v2",6),v("ngModelChange",function(s){return h(p),w(i.filter().ListChannelID,s)||(i.filter().ListChannelID=s),g(s)}),r()(),o(14,"div",7)(15,"label",5),m(16,"From/To"),r(),o(17,"div",8)(18,"datepicker",9),v("dateChange",function(s){return h(p),w(i.filter().From,s)||(i.filter().From=s),g(s)}),r()(),o(19,"div")(20,"datepicker",10),v("dateChange",function(s){return h(p),w(i.filter().To,s)||(i.filter().To=s),g(s)}),r()()(),o(21,"div",7)(22,"label",11),m(23,"Page Number"),r(),o(24,"input",12),v("ngModelChange",function(s){return h(p),w(i.filter().PageNumber,s)||(i.filter().PageNumber=s),g(s)}),r()(),o(25,"div",7)(26,"label",11),m(27,"Page Size"),r(),o(28,"input",13),v("ngModelChange",function(s){return h(p),w(i.filter().PageSize,s)||(i.filter().PageSize=s),g(s)}),r()()(),o(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),k(33,Je,20,2,"div",17)(34,Xe,2,0,"div",18),r()()()()(),o(35,"app-context-menu",19,0),b("onSelectItem",function(s){return h(p),g(i.onSelectContextItem(s))}),r()}if(t&2){let p=ae(I(1,10,i.awaitingCollections$));c(2),S("text",i.filter().Number),c(2),T(i.selectedOrders().length>0?4:-1),c(9),y("multiple",!0),S("ngModel",i.filter().ListChannelID),c(5),S("date",i.filter().From),c(2),S("date",i.filter().To),c(4),S("ngModel",i.filter().PageNumber),c(4),S("ngModel",i.filter().PageSize),c(5),T((p==null?null:p.length)>0?33:34),c(2),y("items",i.contextMenuItems)}},dependencies:[he,ke,Te,Le,z,fe,Ce,ge,W,R,Ee,Ve,Ae,be,_e,De,Fe,Me,me,ue,de,Pe],encapsulation:2});let a=l;return a})();export{Jt as AwaitingCollectionComponent};
|
|
1
|
+
import{a as Ne,b as Fe}from"./chunk-RIIIECQH.js";import{a as Pe}from"./chunk-JWDQVXQP.js";import{a as Ee,b as Ve}from"./chunk-K5WSFDNA.js";import{a as De}from"./chunk-FBXKHJ2G.js";import{a as j}from"./chunk-L6CRWJ2O.js";import{a as Ae}from"./chunk-PV4OJSZI.js";import"./chunk-FSOZOROI.js";import"./chunk-VYI7JYH5.js";import"./chunk-BZWZ64N5.js";import{a as Me}from"./chunk-3PUUKJCQ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as Le}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as Te}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as ke}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{a as Se,c as we,e as ve,f as ye,g as xe}from"./chunk-IA7NJXJD.js";import{a as be}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as _e}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as x}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as d,c as A}from"./chunk-UPRDDI4K.js";import{A as z,b as ge,c as fe,h as W,m as R,o as Ce}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as M,e as O}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as ue,B as he,w as me,y as de}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Cc as te,Dc as ie,Ec as ne,G,Hb as N,Ia as B,Mc as oe,Nc as m,Oc as P,Pc as E,Rc as S,Sc as w,Tc as v,Uc as re,Vc as ae,Wc as F,Z as J,_c as le,aa as X,ac as k,ad as pe,cc as T,dc as Z,fc as $,gc as ee,hc as y,ic as o,id as V,jc as r,jd as I,kc as _,kd as se,ma as D,mb as Y,ob as c,pd as ce,ra as C,rc as L,v as K,wc as b,ya as h,yc as f,za as g}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as Q,b as q}from"./chunk-66YHNWRR.js";var Ie=(()=>{let l=class l{constructor(){this.http=C(O),this.toastr=C(M)}printTokopediaShippingLabel(e,t=!1){let i={OrderNumber:e,Printed:t};return this.http.post(x.TokopediaPrintShippingLabel,i)}printTiktokShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.TiktokPrintShippingLabel,i)}printShopeeShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.ShopeePrintShippingLabel,i).pipe(K(p=>(p&&(p.Number=e),p)))}printLazadaShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.LazadaPrintShippingLabel,i)}handleShippingLabelResponse(e,t){switch(t){case d.Tokopedia:let u=window.open("about:blank","_blank");u.document.write(e.File),u.document.close();break;case d.Tiktok:e.data!=null?window.open(e.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print");break;case d.Shopee:var i=Uint8Array.from(atob(e.File),s=>s.charCodeAt(0)),p=new Blob([i],{type:"octet/stream"});A.openDownloadFile(p,`${e?.Number}.pdf`);break;case d.Lazada:e?.result?.data!=null?window.open(e?.result?.data?.pdf_url,"_blank"):this.toastr.error(e.message,"Cannot Print");break}}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=D({token:l,factory:l.\u0275fac,providedIn:"root"});let a=l;return a})();var Oe=(()=>{let l=class l{constructor(){this.dialogRef=C(Se),this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=N({type:l,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"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(t,i){t&1&&(o(0,"div",0)(1,"h2",1),m(2,"Cetak label pesanan"),r(),o(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),m(7,"Kamu akan mencetak label yang berisi detail pesanan"),r(),o(8,"div",5)(9,"mat-checkbox",6),v("ngModelChange",function(u){return w(i.tandaiSudahDicetak,u)||(i.tandaiSudahDicetak=u),u}),r(),o(10,"span",7),m(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),r()()()()(),o(12,"mat-dialog-actions",8)(13,"button",9),b("click",function(){return i.onCancel()}),m(14,"Cancel"),r(),o(15,"button",10),b("click",function(){return i.onPrint()}),m(16,"Cetak Pesanan"),r()()()),t&2&&(c(9),S("ngModel",i.tandaiSudahDicetak))},dependencies:[z,W,R,xe,ye,ve],encapsulation:2});let a=l;return a})();var U=(()=>{let l=class l{constructor(){this.httpService=C(O),this.shippingLabelService=C(Ie),this.toastrService=C(M),this.dialog=C(we)}printShippingLabel(e){switch(e?.MarketType){case d.Shopee:this.shippingLabelService.printShopeeShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Shopee));break;case d.Tiktok:this.shippingLabelService.printTiktokShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Tiktok));break;case d.Tokopedia:this.dialog.open(Oe).afterClosed().pipe(G(t=>A.IsNotEmpty(t)),X(t=>this.shippingLabelService.printTokopediaShippingLabel(e.Number,t))).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Tokopedia));break;case d.Lazada:this.shippingLabelService.printLazadaShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Lazada));break;case d.Shopify:this.toastrService.error("Shopify not supported","Error Not supported");break}}printMultipleShippingLabel(e){let t=e.map(p=>({OrderNumber:p.Number,ShopID:p.ShopID})),i="";switch(e[0]?.MarketType){case d.Shopee:i=x.ShopeePrintMultipleShippingLabel;break;case d.Tiktok:i=x.TiktokPrintMultipleShippingLabel;break;case d.Lazada:i=x.LazadaPrintMultipleShippingLabel;break}this.httpService.post(i,t).subscribe(p=>{var u=Uint8Array.from(atob(p.File),We=>We.charCodeAt(0)),s=new Blob([u],{type:"octet/stream"});A.openDownloadFile(s,`${p?.Name}.pdf`)})}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=D({token:l,factory:l.\u0275fac});let a=l;return a})();var ze=["contextMenu"],Be=a=>({"td-cell-hover":a});function je(a,l){if(a&1){let n=L();o(0,"button",20),b("click",function(){h(n);let t=f(),i=F(0);return g(t.onDowloadShippingLabel(i))}),_(1,"i",21),o(2,"span"),m(3,"Download Shipping Label"),r()()}}function He(a,l){if(a&1){let n=L();o(0,"input",47),v("ngModelChange",function(t){h(n);let i=f().$implicit;return w(i.selected,t)||(i.selected=t),g(t)}),b("ngModelChange",function(){h(n);let t=f(3),i=F(0);return g(t.onSelectOrders(i))}),r()}if(a&2){let n=f().$implicit,e=f(2);S("ngModel",n.selected),y("disabled",e.selectedChannelType()!=null&&e.selectedChannelType()!=n.MarketType)}}function Ue(a,l){if(a&1&&_(0,"variants-dropdown",39),a&2){let n=f().$implicit;y("variants",n==null?null:n.Variants)}}function Qe(a,l){if(a&1&&_(0,"variant-with-image",40),a&2){let n=f().$implicit;y("variant",n==null?null:n.Variants[0])}}function qe(a,l){if(a&1&&(o(0,"span"),m(1),r()),a&2){let n=f().$implicit;c(),E("(",n.LogisticService==null?null:n.LogisticService.Option,")")}}function Ke(a,l){if(a&1){let n=L();o(0,"button",48),b("click",function(){h(n);let t=f().$implicit,i=f(2);return g(i.onPrintShippingLabel(t))}),_(1,"i",49),r()}}function Ge(a,l){if(a&1){let n=L();o(0,"tr")(1,"td"),k(2,He,1,2,"input",31),r(),o(3,"td")(4,"div",32),_(5,"img",33),V(6,"channelImage"),o(7,"div",34)(8,"div"),m(9),r(),o(10,"small",35)(11,"span"),m(12),r()()()()(),o(13,"td")(14,"div",36)(15,"div"),_(16,"order-link",37),r(),o(17,"small"),m(18),V(19,"date"),r(),_(20,"br"),o(21,"small"),_(22,"i",38),m(23),r()()(),o(24,"td"),k(25,Ue,1,1,"variants-dropdown",39)(26,Qe,1,1,"variant-with-image",40),r(),o(27,"td",41),m(28),V(29,"number"),r(),o(30,"td",42),b("mouseenter",function(t){let i=h(n).$implicit,p=f(2);return g(p.onMouseEnter(t,i))}),o(31,"div",43)(32,"div",36)(33,"div",44)(34,"span"),m(35),r(),k(36,qe,2,1,"span"),r(),o(37,"small"),m(38),r()()()(),o(39,"td",45),k(40,Ke,2,0,"button",46),r()()}if(a&2){let n=l.$implicit,e=f(2);c(2),T((n==null?null:n.MarketType)!=e.channelType.WooCommerce?2:-1),c(3),y("src",I(6,16,n==null?null:n.MarketType),Y)("alt",n==null||n.Variants[0]==null?null:n.Variants[0].Name),c(4),P(n.Outlet),c(3),P(n.ChannelName),c(4),y("order",n),c(2),E(" ",se(19,18,n==null?null:n.Created,"dd/MM/yyyy HH:mm:ss")," "),c(5),E(" ",n.Customer," "),c(),oe(pe(23,Be,(n.Variants==null?null:n.Variants.length)>1)),c(),T((n.Variants==null?null:n.Variants.length)>1?25:26),c(3),P(I(29,21,n.Amount)),c(7),P(n.LogisticService!=null&&n.LogisticService.Name?n.LogisticService==null?null:n.LogisticService.Name:"-"),c(),T(n.LogisticService!=null&&n.LogisticService.Option&&(n.LogisticService==null?null:n.LogisticService.Option)!="Default"?36:-1),c(2),E(" ",n.ReferenceNumber?n.ReferenceNumber:"-"," "),c(2),T((n==null?null:n.MarketType)!=e.channelType.WooCommerce?40:-1)}}function Je(a,l){if(a&1){let n=L();o(0,"div",17)(1,"table",22)(2,"thead",23)(3,"tr",24),_(4,"th",25),o(5,"th",26),m(6,"Outlet"),r(),o(7,"th",26),m(8,"Number"),r(),o(9,"th"),m(10,"Items"),r(),o(11,"th",27),m(12,"Amount"),r(),o(13,"th",28),m(14,"Shipping"),r(),_(15,"th",29),r()(),o(16,"tbody"),$(17,Ge,41,25,"tr",null,Z),r()(),o(19,"app-custom-paginator",30),b("next",function(){h(n);let t=f();return g(t.initAwaitingCollection())})("previous",function(){h(n);let t=f();return g(t.initAwaitingCollection())}),r()()}if(a&2){let n=f(),e=F(0);c(17),ee(e),c(2),y("filter",n.filter())("totaldata",e==null?null:e.length)}}function Xe(a,l){a&1&&(o(0,"div",18),_(1,"app-empty-state"),r())}var Jt=(()=>{let l=class l{constructor(){this.printShippingService=C(U),this.orderService=C(j),this.toastr=C(M),this.fulfillmentService=C(Ne),this.channelType=d,this.selectedOrders=B([]),this.selectedChannelType=ce(()=>{let e=null;return this.selectedOrders().length>0&&(e=this.selectedOrders()[0].MarketType),e}),this.filter=B({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"},{id:"fulfillment",label:"Set Fulfillment",icon:"fa-solid fa-truck"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(t=>q(Q({},t),{From:e})),this.initAwaitingCollection()}initAwaitingCollection(){this.awaitingCollections$=this.orderService.getAwaitingCollectionOrders(this.filter()).pipe(J(1))}onPrintShippingLabel(e){this.printShippingService.printShippingLabel(e)}onSelectOrders(e){let t=e.filter(i=>i.selected);this.selectedOrders.set(t)}onDowloadShippingLabel(e){e=e.map(t=>(t.selected=!1,t)),this.printShippingService.printMultipleShippingLabel(this.selectedOrders()),this.selectedOrders.set([])}onSetFulfillment(e){this.fulfillmentService.setFulfillmentOrder(e).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initAwaitingCollection()})}refreshShippingAndRefNumber(e){this.orderService.refreshShippingCourier(e.ShopID,e.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initAwaitingCollection()})}onMouseEnter(e,t){(!t.LogisticService?.Name||!t.ReferenceNumber)&&this.contextMenuEl.show(e,t)}onSelectContextItem(e){e.item?.id==="refresh"?this.refreshShippingAndRefNumber(e.data):this.onSetFulfillment(e.data)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=N({type:l,selectors:[["app-awaiting-collection"]],viewQuery:function(t,i){if(t&1&&te(ze,5),t&2){let p;ie(p=ne())&&(i.contextMenuEl=p.first)}},features:[le([j,U])],decls:37,vars:13,consts:[["contextMenu",""],["headerTitle","Awaiting Collection","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-3"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[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,"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"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrow-down-to-line","me-3"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","150px"],[2,"width","50px"],["rowCountApi","/api/orders/awaitingcollectioncount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModel","disabled"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[3,"mouseenter"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"text-end","td-cell-hover"],["type","button","aria-label","Print order","title","Print","matTooltip","Download shipping label",1,"btn","p-0","border-0","bg-transparent"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],["type","button","aria-label","Print order","title","Print","matTooltip","Download shipping label",1,"btn","p-0","border-0","bg-transparent",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrow-down-to-line"]],template:function(t,i){if(t&1){let p=L();re(0),V(1,"async"),o(2,"mainpanel",1),b("onSubmit",function(){return h(p),g(i.initAwaitingCollection())}),v("textChange",function(s){return h(p),w(i.filter().Number,s)||(i.filter().Number=s),g(s)}),o(3,"actions"),k(4,je,4,0,"button",2),o(5,"a",3),_(6,"i",4),o(7,"span"),m(8,"Order Fulfillment Display"),r()()(),o(9,"filters")(10,"div")(11,"label",5),m(12,"Channel"),r(),o(13,"app-channel-options-v2",6),v("ngModelChange",function(s){return h(p),w(i.filter().ListChannelID,s)||(i.filter().ListChannelID=s),g(s)}),r()(),o(14,"div",7)(15,"label",5),m(16,"From/To"),r(),o(17,"div",8)(18,"datepicker",9),v("dateChange",function(s){return h(p),w(i.filter().From,s)||(i.filter().From=s),g(s)}),r()(),o(19,"div")(20,"datepicker",10),v("dateChange",function(s){return h(p),w(i.filter().To,s)||(i.filter().To=s),g(s)}),r()()(),o(21,"div",7)(22,"label",11),m(23,"Page Number"),r(),o(24,"input",12),v("ngModelChange",function(s){return h(p),w(i.filter().PageNumber,s)||(i.filter().PageNumber=s),g(s)}),r()(),o(25,"div",7)(26,"label",11),m(27,"Page Size"),r(),o(28,"input",13),v("ngModelChange",function(s){return h(p),w(i.filter().PageSize,s)||(i.filter().PageSize=s),g(s)}),r()()(),o(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),k(33,Je,20,2,"div",17)(34,Xe,2,0,"div",18),r()()()()(),o(35,"app-context-menu",19,0),b("onSelectItem",function(s){return h(p),g(i.onSelectContextItem(s))}),r()}if(t&2){let p=ae(I(1,10,i.awaitingCollections$));c(2),S("text",i.filter().Number),c(2),T(i.selectedOrders().length>0?4:-1),c(9),y("multiple",!0),S("ngModel",i.filter().ListChannelID),c(5),S("date",i.filter().From),c(2),S("date",i.filter().To),c(4),S("ngModel",i.filter().PageNumber),c(4),S("ngModel",i.filter().PageSize),c(5),T((p==null?null:p.length)>0?33:34),c(2),y("items",i.contextMenuItems)}},dependencies:[he,ke,Te,Le,z,fe,Ce,ge,W,R,Ee,Ve,Ae,be,_e,De,Fe,Me,me,ue,de,Pe],encapsulation:2});let a=l;return a})();export{Jt as AwaitingCollectionComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ae,b as ce,d as pe}from"./chunk-BZWZ64N5.js";import{b as se}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import{c as le}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as ie}from"./chunk-ZSUWHVKX.js";import{h as te}from"./chunk-
|
|
1
|
+
import{a as ae,b as ce,d as pe}from"./chunk-BZWZ64N5.js";import{b as se}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import{c as le}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as ie}from"./chunk-ZSUWHVKX.js";import{h as te}from"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import{b as Z,c as ee}from"./chunk-NB2H6KA7.js";import{b as g,c as Q}from"./chunk-UPRDDI4K.js";import{A as re,h as ne,m as oe}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as X,e as Y}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{w as q}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as B,Ic as E,Nb as u,Nc as c,Oc as h,Pc as H,Rc as T,Sc as O,Tc as P,Uc as z,Vc as J,Wc as j,Z as x,aa as I,ac as k,ad as G,cc as F,ea as D,ec as R,fc as K,gc as V,hc as m,ic as o,id as S,jc as l,jd as f,kc as W,ld as N,mb as U,ob as a,oc as $,pc as A,q as M,ra as _,rc as v,v as C,wc as b,ya as L,yc as p,za as y}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var me=t=>[t];function de(t,s){if(t&1&&(o(0,"span",14),W(1,"img",15),l(),o(2,"span"),c(3),l()),t&2){let r=s.item;a(),m("src",r.Img,U)("alt",r.Name),a(2),H(" ",r.Name," ")}}function ge(t,s){if(t&1){let r=v();$(0),z(1),S(2,"async"),o(3,"a",16),b("click",function(){L(r);let e=j(1),n=p();return y(n.submitLogistics(e))}),c(4,"Submit"),l(),A()}if(t&2){let r=p();a(),J(f(2,0,r.logisticServices$))}}function he(t,s){}function _e(t,s){if(t&1){let r=v();o(0,"ng-select",18),P("ngModelChange",function(e){L(r);let n=p(2).$implicit;return O(n.ProductSKU,e)||(n.ProductSKU=e),y(e)}),l()}if(t&2){let r=p(),i=p().$implicit;T("ngModel",i.ProductSKU),m("items",r)}}function ue(t,s){if(t&1&&(o(0,"span"),c(1),l()),t&2){let r=p(2).$implicit;a(),h(r.ProductSKU||"-")}}function Se(t,s){if(t&1&&u(0,he,0,0,"ng-template",17)(1,_e,1,2,"ng-template",null,0,N)(3,ue,2,1,"ng-template",null,1,N),t&2){let r=E(2),i=E(4),e=p(2);m("ngxPermissionsOnly",G(3,me,e.logisticEditRole))("ngxPermissionsOnlyThen",r)("ngxPermissionsOnlyElse",i)}}function fe(t,s){if(t&1&&(o(0,"tr")(1,"td"),c(2),l(),o(3,"td"),c(4),l(),o(5,"td"),c(6),l(),o(7,"td"),k(8,Se,5,5),S(9,"async"),l()()),t&2){let r,i=s.$implicit,e=p();a(2),h(i.Name),a(2),h(i.Service),a(2),h(i.TypeString),a(2),F((r=f(9,4,e.logisticOptions$))?8:-1,r)}}var Re=(()=>{let s=class s{constructor(){this.http=_(Y),this.toastr=_(X),this.authService=_(te),this.filter={ChannelID:""},this.logisticEditRole=ie.LogisticUpdate,this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let i=[g.WooCommerce,g.Lazada,g.Shopify,g.Plugo,g.Tokopedia];this.channelOptions=this.channelOptions.map(e=>(i.forEach(n=>{e.TypeID===n&&(e.disabled=!0)}),e))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(i=>{this.filter=i.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(x(1))}submitLogistics(i){this.clonedLogisticServices$.pipe(C(e=>i.map(n=>(e.findIndex(d=>d.Name===n.Name&&d.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),I(e=>this.http.post("/api/Logistic/Submit",e))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(C(i=>i.map(e=>(e.ProductSKU=Q.IsEmpty(e.ProductSKU)?null:e.ProductSKU,e))),D(i=>{let e=JSON.parse(JSON.stringify(i));this.clonedLogisticServices$=M(e)}),x(1))}iniTitle(){let i=this.channelOptions.find(e=>e.ID==this.filter.ChannelID);this.channelName=i?i.Name:null}};s.\u0275fac=function(e){return new(e||s)},s.\u0275cmp=B({type:s,selectors:[["app-logistic"]],decls:29,vars:8,consts:[["thenBlock",""],["elseBlock",""],["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngxPermissionsOnly"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(e,n){e&1&&(o(0,"mainpanel",2),b("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",3),c(4,"Select a Channel"),l(),o(5,"ng-select",4),P("ngModelChange",function(d){return O(n.filter.ChannelID,d)||(n.filter.ChannelID=d),d}),u(6,de,4,3,"ng-template",5),l()()(),o(7,"actions"),u(8,ge,5,3,"ng-container",6),l(),o(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10)(14,"table",11)(15,"thead",12)(16,"tr",13)(17,"th"),c(18,"Logistic"),l(),o(19,"th"),c(20,"Service"),l(),o(21,"th"),c(22,"Type"),l(),o(23,"th"),c(24,"Logistic Service"),l()()(),o(25,"tbody"),K(26,fe,10,6,"tr",null,R),S(28,"async"),l()()()()()()()()),e&2&&(m("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),a(5),m("clearable",!1)("items",n.channelOptions),T("ngModel",n.filter.ChannelID),a(3),m("ngxPermissionsOnly",n.logisticEditRole),a(18),V(f(28,6,n.logisticServices$)))},dependencies:[se,pe,re,ne,oe,ae,ce,ee,Z,le,q],encapsulation:2});let t=s;return t})();export{Re as LogisticComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ye}from"./chunk-YKKHSYDW.js";import{a as de,b as he}from"./chunk-Z3PLQ27X.js";import"./chunk-VG66LDXQ.js";import{e as me}from"./chunk-
|
|
1
|
+
import{a as ye}from"./chunk-YKKHSYDW.js";import{a as de,b as he}from"./chunk-Z3PLQ27X.js";import"./chunk-VG66LDXQ.js";import{e as me}from"./chunk-KNE2UYQ2.js";import"./chunk-TQROQOXU.js";import{a as ge}from"./chunk-IQGRGC3E.js";import{c as Ce,d as be}from"./chunk-TUY6YGYA.js";import"./chunk-76AVMRJU.js";import{a as W}from"./chunk-KOQLZV3N.js";import"./chunk-6F37VT6M.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import"./chunk-BKR7YPEW.js";import"./chunk-BZWZ64N5.js";import{a as xe}from"./chunk-3PUUKJCQ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import{a as ce}from"./chunk-GNXSEYJF.js";import{a as ue}from"./chunk-7KG3DC5J.js";import{a as fe}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as _e}from"./chunk-27DIE2YS.js";import{a as pe}from"./chunk-FPJTI4LM.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import{a as re}from"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import{e as le}from"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import{a as at}from"./chunk-3NCMRK7E.js";import{a as ne}from"./chunk-JLDXWNDU.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import{g as st}from"./chunk-C4MTEDSW.js";import{b as L,c as ae,d as Ct,e as $}from"./chunk-JMRRXRKO.js";import{b as se}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{c as oe,h as ie}from"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import{P as _t,Q as Qt,ha as H,la as qt,ma as ft,ua as Kt}from"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as it}from"./chunk-ZSUWHVKX.js";import{h as Jt}from"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as Wt}from"./chunk-AGBJEXIM.js";import{b as Ht,c as $t}from"./chunk-NB2H6KA7.js";import{b as ut,c as g}from"./chunk-UPRDDI4K.js";import{A as ee,c as Yt,h as Xt,m as te}from"./chunk-6UM4NHOR.js";import{a as Rt}from"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as zt,e as Gt}from"./chunk-D6JH2KV4.js";import{b as jt,d as ot}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as mt,q as Dt,s as Bt,t as Nt,v as At}from"./chunk-CGSMHTKB.js";import{c as ht,d as gt,f as et,g as Lt,i as nt,k as Ut,m as Zt}from"./chunk-XBIHN6D3.js";import{$c as Ft,Aa as w,Ab as Tt,Bc as Q,Dc as q,Ec as K,Fd as tt,G as F,Gd as j,Hb as I,Ia as M,Lb as k,Lc as Y,Mb as wt,Mc as T,Nb as P,Nc as b,Oc as U,Pa as V,Pc as O,Rc as Z,Sc as z,Tc as X,_b as S,_c as G,aa as ct,ac as f,ad as E,bd as Mt,cc as C,dd as kt,ec as It,fc as Pt,gc as Ot,hc as l,ic as c,jc as d,kc as u,lb as vt,lc as D,ld as Et,ma as bt,mc as B,nc as N,ob as r,oc as A,pa as yt,pc as R,pd as Vt,qc as pt,ra as h,rc as v,sc as J,tb as dt,ub as St,wc as x,ya as p,yc as a,za as m}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var Oe=["data-p-icon","exclamation-triangle"],ve=(()=>{class e extends at{pathId;onInit(){this.pathId="url(#"+L()+")"}static \u0275fac=(()=>{let t;return function(n){return(t||(t=V(e)))(n||e)}})();static \u0275cmp=I({type:e,selectors:[["","data-p-icon","exclamation-triangle"]],features:[k],attrs:Oe,decls:7,vars:2,consts:[["d","M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z","fill","currentColor"],["d","M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z","fill","currentColor"],["d","M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(o,n){o&1&&(w(),D(0,"g"),N(1,"path",0)(2,"path",1)(3,"path",2),B(),D(4,"defs")(5,"clipPath",3),N(6,"rect",4),B()()),o&2&&(S("clip-path",n.pathId),r(5),J("id",n.pathId))},encapsulation:2})}return e})();var Fe=["data-p-icon","info-circle"],Se=(()=>{class e extends at{pathId;onInit(){this.pathId="url(#"+L()+")"}static \u0275fac=(()=>{let t;return function(n){return(t||(t=V(e)))(n||e)}})();static \u0275cmp=I({type:e,selectors:[["","data-p-icon","info-circle"]],features:[k],attrs:Fe,decls:5,vars:2,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(o,n){o&1&&(w(),D(0,"g"),N(1,"path",0),B(),D(2,"defs")(3,"clipPath",1),N(4,"rect",2),B()()),o&2&&(S("clip-path",n.pathId),r(3),J("id",n.pathId))},encapsulation:2})}return e})();var Te=`
|
|
2
2
|
.p-toast {
|
|
3
3
|
width: dt('toast.width');
|
|
4
4
|
white-space: pre-line;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as qe}from"./chunk-MSSRROS6.js";import{a as J}from"./chunk-ISMIPSYN.js";import"./chunk-7T5DBPDP.js";import"./chunk-OH5T7D7O.js";import"./chunk-DE3FRI5N.js";import{a as E}from"./chunk-A6SP65CH.js";import{a as je,b as ze,c as Ge,d as Y,e as ee}from"./chunk-C67KF7MG.js";import{a as Re,b as Ne,c as Le}from"./chunk-FMZLGD5H.js";import{a as Qe}from"./chunk-TYSM3R5E.js";import{a as $e,b as He}from"./chunk-JKRELT7N.js";import"./chunk-WTHYLNPX.js";import{c as Ue,d as We}from"./chunk-TUY6YGYA.js";import"./chunk-76AVMRJU.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import{e as Oe}from"./chunk-BZWZ64N5.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as Ae}from"./chunk-DLHIDOS3.js";import{a as Be}from"./chunk-WCX3T6LK.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-GD6ZN56B.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{a as Ee,b as ke}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{a as Te,b as Pe,c as De,i as Me,j as Ve}from"./chunk-IA7NJXJD.js";import{a as Fe}from"./chunk-UEXWQT5J.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as Ie}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as X}from"./chunk-ZSUWHVKX.js";import{h as xe}from"./chunk-7K6U3ABQ.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as Z}from"./chunk-AGBJEXIM.js";import{a as ue,b as he,c as ge}from"./chunk-NB2H6KA7.js";import{c as y}from"./chunk-UPRDDI4K.js";import{A as be,b as fe,c as Se,h as ye,m as ve,o as we}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as pe,e as me}from"./chunk-D6JH2KV4.js";import{e as _e,g as Ce}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as de,B as Q,q as ce,w as $,y as H}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as se,G as j,Hb as O,Ia as M,Mc as ie,Nb as B,Nc as m,Oc as L,Pc as I,Rc as F,Sc as T,Tc as P,Uc as oe,Vc as ae,Wc as le,Xc as re,Z as R,_c as W,ac as u,ad as D,cc as h,dc as G,ea as z,fc as q,gc as K,hc as g,ic as a,id as f,jc as r,jd as b,kc as v,kd as V,mb as N,ob as s,oc as A,pc as U,ra as S,rc as w,v as k,wc as x,ya as _,yc as l,za as C}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as ne}from"./chunk-66YHNWRR.js";var Ye=()=>["/menu/order/download"];function Je(i,c){if(i&1&&(a(0,"li",4)(1,"div"),m(2," The last time you manually download your order is on "),a(3,"span",8),m(4),f(5,"date"),r()(),a(6,"div",9),m(7),r()()),i&2){l();let e=le(0);s(4),I(" ",V(5,2,e==null?null:e.OrderDownloadLatestOn,"dd MMM yyyy HH:mm")," "),s(3),I("(",e==null?null:e.calculatedDate,")")}}function et(i,c){i&1&&(a(0,"li",4),m(1," The last time you manually download your order is on (-) "),r())}var Ke=(()=>{let c=class c{constructor(){this.dialogRef=S(Te),this.data=S(Pe),this.modalConfig=new Me,this.inventoryService=S(E),this.lastDownloadInfo$=this.inventoryService.getLastInfoDownloadInventory(this.data.channelId).pipe(k(n=>{let t=n.OrderDownloadLatestOn!=y.MinDate,o=null,p=null;return t&&(o=new Date(n.OrderDownloadLatestOn),p=y.convertToReadableDate(o)),{OrderDownloadLatestOn:o,calculatedDate:p}}),R(1)),this.selectedProducts=M(this.data.selectedProducts||[]),this.modalConfig.title="Manual Inventory Sync",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}onUpdate(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}};c.\u0275fac=function(t){return new(t||c)},c.\u0275cmp=O({type:c,selectors:[["app-dialog-update-product-info"]],features:[W([E])],decls:16,vars:8,consts:[[3,"onCancel","config"],["content",""],[1,"container"],[1,"mt-8"],[1,"lh-base"],["footer",""],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","routerLink"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","keyup.F2"],[1,"fw-bold","me-1"],[1,"fw-bold"]],template:function(t,o){if(t&1){let p=w();oe(0),f(1,"async"),a(2,"modal-material",0),x("onCancel",function(){return _(p),C(o.onCancel())}),a(3,"div",1)(4,"div",2)(5,"h4"),m(6),r(),a(7,"div",3)(8,"ul"),u(9,Je,8,5,"li",4)(10,et,2,0,"li",4),r()()()(),a(11,"div",5)(12,"a",6),x("click",function(){return _(p),C(o.onCancel())}),m(13," Download "),r(),a(14,"button",7),x("click",function(){return _(p),C(o.onUpdate())})("keyup.F2",function(){return _(p),C(o.onUpdate())}),m(15," Update Anyway "),r()()()}if(t&2){let p=ae(b(1,4,o.lastDownloadInfo$));s(2),g("config",o.modalConfig),s(4),I("",o.selectedProducts().length," Product(s) will be updated."),s(3),h(p!=null&&p.OrderDownloadLatestOn?9:10),s(3),g("routerLink",se(7,Ye))}},dependencies:[Ve,Q,Ce,_e,$,H],encapsulation:2});let i=c;return i})();var te=i=>[i],tt=i=>({"text-decoration-line-through":i}),nt=i=>({"me-10":i}),it=i=>({"bg-gradient-warning":i}),ot=i=>({cursor:i});function at(i,c){if(i&1){let e=w();a(0,"button",37),x("click",function(){_(e);let t=l(),o=l(2);return C(o.onScanInventory(t))}),v(1,"i",38),m(2,"Refresh "),r()}}function lt(i,c){if(i&1){let e=w();a(0,"div",35)(1,"button",39),x("click",function(){_(e);let t=l(),o=l(2);return C(o.onOpenDialogUpdateStockInfo(t))}),v(2,"i",40),m(3," Update "),r(),v(4,"button",41),a(5,"ul",42)(6,"a",43),x("click",function(){_(e);let t=l(3);return C(t.openExportDialog())}),v(7,"i",44),a(8,"span"),m(9,"Export"),r()()()()}}function rt(i,c){if(i&1){let e=w();a(0,"button",45),x("click",function(){_(e);let t=l(3);return C(t.openExportDialog())}),v(1,"i",44),a(2,"span"),m(3,"Export"),r()()}}function st(i,c){if(i&1&&(a(0,"div"),u(1,at,3,0,"button",34),u(2,lt,10,0,"div",35)(3,rt,4,0,"button",36),r()),i&2){let e=c,n=l(2);s(),h(n.productService.hasSelectionVariant(e)?1:-1),s(),h(n.productService.hasSelectionVariant(e)?2:3)}}function ct(i,c){i&1&&(a(0,"div",18)(1,"span"),m(2," showing only different stock, please press next to populate more data "),r()())}function dt(i,c){if(i&1){let e=w();a(0,"th")(1,"input",46),P("ngModelChange",function(t){_(e);let o=l(3);return T(o.checkboxState,t)||(o.checkboxState=t),C(t)}),x("ngModelChange",function(){let t=_(e),o=l(3);return C(o.onCheckboxStateChange(t))}),r()()}if(i&2){let e=l(3);s(),F("ngModel",e.checkboxState)}}function pt(i,c){if(i&1&&(A(0),u(1,dt,2,1,"th"),f(2,"async"),U()),i&2){let e,n=l(2);s(),h((e=b(2,1,n.products$))?1:-1,e)}}function mt(i,c){i&1&&(a(0,"th",31),m(1," Reserved "),r())}function _t(i,c){if(i&1){let e=w();a(0,"input",63),P("ngModelChange",function(t){_(e);let o=l(4).$implicit;return T(o.selected,t)||(o.selected=t),C(t)}),x("ngModelChange",function(){_(e);let t=l(4).$implicit,o=l(2);return C(o.onCheckboxStateProduct(t))}),r()}if(i&2){let e=l(4).$implicit;F("ngModel",e.selected)}}function Ct(i,c){if(i&1&&(A(0),a(1,"div",61),u(2,_t,1,1,"input",62),r(),U()),i&2){let e=l(3).$implicit;s(),g("ngClass",D(2,nt,e.Variants.length<=1)),s(),h(e.Variants.length>1?2:-1)}}function ut(i,c){if(i&1){let e=w();a(0,"img",64),x("click",function(t){_(e);let o=l(3).$implicit,p=l(2);return C(p.onZoomImage(t,o==null?null:o.ImageUrl))}),r()}if(i&2){let e=l(3).$implicit;g("src",re(e==null?null:e.ThumbnailUrl),N)}}function ht(i,c){i&1&&v(0,"img",58)}function gt(i,c){if(i&1&&(v(0,"br"),a(1,"div",65),v(2,"i",66),a(3,"small"),m(4),r()()),i&2){let e=l(3).$implicit;s(4),I("(",e==null?null:e.Category,")")}}function xt(i,c){if(i&1&&(a(0,"td",56)(1,"div",12),B(2,Ct,3,4,"ng-container",25),a(3,"div"),u(4,ut,1,2,"img",57)(5,ht,1,0,"img",58),r()()(),a(6,"td",59)(7,"span",60),m(8),r(),u(9,gt,5,1),r()),i&2){let e=l(2).$implicit,n=l(2);g("rowSpan",e==null?null:e.Variants.length),s(2),g("ngxPermissionsOnly",D(6,te,n.inventoryUpdateRole)),s(2),h(e!=null&&e.ThumbnailUrl?4:5),s(2),g("rowSpan",e==null?null:e.Variants.length),s(2),L(e==null?null:e.Name),s(),h(e.CategoryID!==null&&e.CategoryID!=n.guidEmpty?9:-1)}}function ft(i,c){if(i&1){let e=w();a(0,"input",46),P("ngModelChange",function(t){_(e);let o=l(3).$implicit;return T(o.selected,t)||(o.selected=t),C(t)}),r()}if(i&2){let e=l(3).$implicit;F("ngModel",e.selected)}}function St(i,c){if(i&1&&u(0,ft,1,1,"input",68),i&2){let e=l(2).$implicit;h((e==null?null:e.Inventory)<=1e5?0:-1)}}function yt(i,c){if(i&1){let e=w();a(0,"input",46),P("ngModelChange",function(t){_(e);let o=l(2).$implicit;return T(o.selected,t)||(o.selected=t),C(t)}),r()}if(i&2){let e=l(2).$implicit;F("ngModel",e.selected)}}function vt(i,c){if(i&1&&(A(0),a(1,"td",67),u(2,St,1,1)(3,yt,1,1,"input",68),r(),U()),i&2){let e=l().$implicit;s(2),h((e==null?null:e.Channel[0].TypeID)==1?2:(e==null?null:e.Inventory)>=0?3:-1)}}function wt(i,c){i&1&&(a(0,"div",51),m(1," Not Found "),r())}function bt(i,c){if(i&1&&(a(0,"div")(1,"span",69),m(2),f(3,"number"),r(),m(4," => "),a(5,"span",70),m(6),f(7,"number"),r()()),i&2){let e=l().$implicit;s(2),I(" ",b(3,2,e==null||e.I==null?null:e.I.Available)),s(4),L(b(7,4,e==null?null:e.Inventory))}}function It(i,c){if(i&1&&(m(0),f(1,"number")),i&2){let e=l().$implicit;I(" ",b(1,1,e==null?null:e.Inventory)," ")}}function Ft(i,c){if(i&1&&(a(0,"div",52)(1,"a",71),v(2,"i",72),r()()),i&2){let e=l().$implicit,n=l(3);s(),g("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),N)}}function Tt(i,c){if(i&1){let e=w();a(0,"span",76),x("click",function(){_(e);let t=l(2).$implicit,o=l().$implicit,p=l(2);return C(p.openTableDialog(o,t))}),m(1),f(2,"number"),r()}if(i&2){let e=l(2).$implicit,n=l(3);ie(D(5,ot,n.hasInventoryEdit())),s(),I(" ",b(2,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function Pt(i,c){if(i&1){let e=w();a(0,"td",53)(1,"div",50)(2,"div"),u(3,Tt,3,7,"span",73),f(4,"async"),r(),a(5,"div",52)(6,"a",71),v(7,"i",72),r()(),a(8,"div",52)(9,"span",74),x("click",function(){_(e);let t=l().$implicit,o=l(3);return C(o.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),v(10,"i",75),r()()()()}if(i&2){let e,n=l().$implicit,t=l(3);g("ngClass",D(5,it,(n==null?null:n.Inventory)!=(n==null||n.Channel[0]==null?null:n.Channel[0].Inventory))),s(3),h((e=b(4,3,t.products$))?3:-1,e),s(3),g("href",n==null||n.Channel[0]==null?null:n.Channel[0].Url,N)}}function Dt(i,c){if(i&1&&(a(0,"span",77),m(1),f(2,"number"),r()),i&2){let e=l(2).$implicit;s(),I(" (",b(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function Mt(i,c){i&1&&m(0," - ")}function Vt(i,c){if(i&1&&(a(0,"td",48),u(1,Dt,3,3,"span",77)(2,Mt,1,0),r()),i&2){let e=l().$implicit;s(),h(!(e==null||e.Channel[0]==null)&&e.Channel[0].InventoryReserved?1:2)}}function Et(i,c){i&1&&m(0," - ")}function kt(i,c){if(i&1&&(a(0,"span",55),f(1,"date"),m(2),f(3,"date"),r()),i&2){let e=l().$implicit;g("matTooltip",V(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",V(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function Rt(i,c){if(i&1&&(a(0,"tr"),u(1,xt,10,8),a(2,"td",47),m(3),r(),a(4,"td",48)(5,"span",49),m(6),r()(),B(7,vt,4,1,"ng-container",25),a(8,"td")(9,"div",50),u(10,wt,2,0,"div",51),u(11,bt,8,6,"div"),u(12,It,2,3),u(13,Ft,3,1,"div",52),r()(),u(14,Pt,11,7,"td",53),u(15,Vt,3,1,"td",48),a(16,"td",54),u(17,Et,1,0)(18,kt,4,8,"span",55),r()()),i&2){let e=c.$implicit,n=c.$index,t=l(3);s(),h(n==0?1:-1),s(2),L(e==null?null:e.Model),s(2),g("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",D(13,tt,e.Discontinued)),s(),L(e==null?null:e.Code),s(),g("ngxPermissionsOnly",D(15,te,t.inventoryUpdateRole)),s(3),h((e==null?null:e.I)==null?10:-1),s(),h((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?11:-1),s(),h((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?12:-1),s(),h((e==null?null:e.I)!=null?13:-1),s(),h(e!=null&&e.Channel?14:-1),s(),h(t.isShowReservedColumn?15:-1),s(2),h((e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==t.minDate?17:18)}}function Nt(i,c){if(i&1&&(a(0,"tbody"),q(1,Rt,19,17,"tr",null,G),r()),i&2){let e=c.$implicit;s(),K(e.Variants)}}function Lt(i,c){if(i&1){let e=w();a(0,"mainpanel",1),x("onSubmit",function(t){_(e);let o=l();return C(o.onSearch(t))}),a(1,"actions")(2,"div",2),u(3,st,4,2,"div"),f(4,"async"),r()(),a(5,"filters")(6,"div",3)(7,"label",4),m(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",5),x("onChannelChange",function(t){_(e);let o=l();return C(o.onChannelChange(t))}),r()(),a(10,"div",3)(11,"filter-query-type",6),P("numberFilterComparatorChange",function(t){_(e);let o=l();return T(o.searchFilter.NumberFilterComparator,t)||(o.searchFilter.NumberFilterComparator=t),C(t)})("searchTypeChange",function(t){_(e);let o=l();return T(o.searchFilter.SearchType,t)||(o.searchFilter.SearchType=t),C(t)}),r()(),a(12,"div",3)(13,"label",7),m(14,"PageNumber"),r(),a(15,"input",8),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),C(t)}),r()(),a(16,"div",3)(17,"label",9),m(18,"Page Size"),r(),a(19,"input",10),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),C(t)}),r()(),a(20,"div")(21,"label",11),m(22,"Quantity From - To"),r(),a(23,"div",12)(24,"input",13),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.QuantityFrom,t)||(o.searchFilter.QuantityFrom=t),C(t)}),r(),m(25," - "),a(26,"input",14),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.QuantityTo,t)||(o.searchFilter.QuantityTo=t),C(t)}),r()()()(),a(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),u(31,ct,3,0,"div",18),a(32,"table",19),x("matSortChange",function(t){_(e);let o=l();return C(o.onSortVariant(t))}),a(33,"thead",20)(34,"tr")(35,"th",21),m(36," Product "),v(37,"br"),a(38,"mat-slide-toggle",22),x("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,C(t.onShowDifferenceStock())}),a(39,"small",11),m(40,"FILTER DIFFERENT INVENTORY"),r()()(),a(41,"th",23),m(42,"Variant"),r(),a(43,"th",24),m(44,"SKU"),r(),B(45,pt,3,3,"ng-container",25),a(46,"th",26),m(47," POS "),r(),a(48,"th",27)(49,"div",28),x("click",function(){_(e);let t=l();return C(t.openModalFilter())}),v(50,"img",29),a(51,"span",30),m(52),f(53,"stringLimit"),r()()(),u(54,mt,2,0,"th",31),a(55,"th",32),m(56,"Last Sync"),r()()(),q(57,Nt,3,0,"tbody",null,G),f(59,"async"),r(),a(60,"infinite-paginator",33),f(61,"async"),x("onNextPage",function(){_(e);let t=l();return C(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return C(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return C(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(i&2){let e,n,t,o,p=c,d=l();g("hideSearchBox",!1)("searchBoxPlaceHolder",d.searchPlaceholder()),s(3),h((e=b(4,24,d.products$))?3:-1,e),s(6),g("ngModel",(d.searchFilter==null?null:d.searchFilter.LocationID)||(d.searchFilter==null?null:d.searchFilter.ChannelID)),s(2),g("numberFilterComparatorOptions",p==null||p.Options==null?null:p.Options.SearchComparatorTypeOptions),F("numberFilterComparator",d.searchFilter.NumberFilterComparator),g("searchTypeOptions",p==null||p.Options==null?null:p.Options.SearchSKUOnlyOrSKUNameOptions),F("searchType",d.searchFilter.SearchType),s(4),F("ngModel",d.searchFilter.PageNumber),s(4),F("ngModel",d.searchFilter.RowCount),s(5),F("ngModel",d.searchFilter.QuantityFrom),s(2),F("ngModel",d.searchFilter.QuantityTo),s(5),h((d.searchFilter==null?null:d.searchFilter.filterModel)==3?31:-1),s(14),g("ngxPermissionsOnly",D(33,te,d.inventoryUpdateRole)),s(4),g("matTooltip",((n=d.channelIdentity())==null||n.label==null?null:n.label.length)>13?(n=d.channelIdentity())==null?null:n.label:""),s(),g("src",(t=d.channelIdentity())==null?null:t.img,N),s(2),I(" ",V(53,26,(o=d.channelIdentity())==null?null:o.label,13)," "),s(2),h(d.isShowReservedColumn?54:-1),s(3),K(b(59,29,d.products$)),s(3),g("totalData",d.infinitePagination.totalData())("hideCount",d.infinitePagination.hideCount())("rowCount",b(61,31,d.infinitePagination.totalRowCount$))("pageNumber",d.infinitePagination.pageNumber())("disableNextButton",d.infinitePagination.disableNextButton())("goToLastPage",d.infinitePagination.isLastPage())}}var Ln=(()=>{let c=class c{constructor(){this.http=S(me),this.toastr=S(pe),this.dialog=S(De),this.productService=S(Be),this.authService=S(xe),this.biggerPictureService=S(Ae),this.mainPanelService=S(Ee),this.placeholderService=S(Ue),this.infinitePagination=S(Y),this.ngxPermissionsService=S(ue),this.updateResHandling=S(ee),this.inventoryService=S(E),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=y.MinDate,this.isShowReservedColumn=!0,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.guidEmpty=y.GuidEMpty,this.selectedChannel=M(null),this.channelIdentity=M({img:null,label:null}),this.inventoryUpdateRole=X.InventoryUpdate,this.hasInventoryEdit=M(!0),this.searchPlaceholder=M("Search ...")}ngOnInit(){this.initRoles(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe(z(n=>{this.checkShowReservedColumn(n)}),k(n=>(n=this.calculateAvailableStock(n),n)),R(1)),this.products$=this.sourceObs$}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(R(1),z(n=>{this.searchFilter={RowCount:n.Filter?.PageSize,filterModel:1,PageNumber:1,ChannelID:n.Filter?.ChannelID,LocationID:n.Filter?.LocationID,NumberFilterComparator:n.Filter?.NumberFilterComparator,SearchType:n.Filter?.SearchType},this.initReloadData(),this.initSearchPlaceholder(),this.showToastrMarketplaceInactive(!n.Filter.IsMarketplaceAppActive)}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}initRoles(){this.ngxPermissionsService.hasPermission(X.InventoryUpdate).then(n=>this.hasInventoryEdit.set(n))}calculateAvailableStock(n){return n.map(o=>(o.totalAvailable=o.Variants.reduce((p,d)=>(p+=d.I?.Available||0,p),0),o))}checkShowReservedColumn(n){let t=0,o;n.forEach(p=>{o=p.Variants.find(d=>y.IsNotEmpty(d?.Channel[0]?.InventoryReserved)),o&&(t+=1)}),this.isShowReservedColumn=t>0}onChannelChange(n){let t=Object.assign({},n);this.selectedChannel.set(t),y.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let n=Object.assign({},this.selectedChannel());y.IsNotEmpty(n.parent)?(this.searchFilter.LocationID=n.id,this.searchFilter.ChannelID=n?.parent?.id,n.label=n?.parent?.label+" - "+n?.label,n.img=y.getChannelLogoByTypeId(n?.parent?.typeid)):(this.searchFilter.LocationID=null,n.img=y.getChannelLogoByTypeId(n?.typeid),this.searchFilter.ChannelID=n?.id,this.selectedChannel.set(n)),this.channelIdentity.update(()=>({img:n.img,label:n.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(n){n&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
1
|
+
import{a as qe}from"./chunk-MSSRROS6.js";import{a as J}from"./chunk-ISMIPSYN.js";import"./chunk-7T5DBPDP.js";import"./chunk-OH5T7D7O.js";import"./chunk-DE3FRI5N.js";import{a as E}from"./chunk-A6SP65CH.js";import{a as je,b as ze,c as Ge,d as Y,e as ee}from"./chunk-C67KF7MG.js";import{a as Re,b as Ne,c as Le}from"./chunk-FMZLGD5H.js";import{a as Qe}from"./chunk-TYSM3R5E.js";import{a as $e,b as He}from"./chunk-JKRELT7N.js";import"./chunk-WTHYLNPX.js";import{c as Ue,d as We}from"./chunk-TUY6YGYA.js";import"./chunk-76AVMRJU.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import{e as Oe}from"./chunk-BZWZ64N5.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as Ae}from"./chunk-DLHIDOS3.js";import{a as Be}from"./chunk-FPJTI4LM.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-JLDXWNDU.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{a as Ee,b as ke}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{a as Te,b as Pe,c as De,i as Me,j as Ve}from"./chunk-IA7NJXJD.js";import{a as Fe}from"./chunk-UEXWQT5J.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as Ie}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as X}from"./chunk-ZSUWHVKX.js";import{h as xe}from"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as Z}from"./chunk-AGBJEXIM.js";import{a as ue,b as he,c as ge}from"./chunk-NB2H6KA7.js";import{c as y}from"./chunk-UPRDDI4K.js";import{A as be,b as fe,c as Se,h as ye,m as ve,o as we}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as pe,e as me}from"./chunk-D6JH2KV4.js";import{e as _e,g as Ce}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as de,B as Q,q as ce,w as $,y as H}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as se,G as j,Hb as O,Ia as M,Mc as ie,Nb as B,Nc as m,Oc as L,Pc as I,Rc as F,Sc as T,Tc as P,Uc as oe,Vc as ae,Wc as le,Xc as re,Z as R,_c as W,ac as u,ad as D,cc as h,dc as G,ea as z,fc as q,gc as K,hc as g,ic as a,id as f,jc as r,jd as b,kc as v,kd as V,mb as N,ob as s,oc as A,pc as U,ra as S,rc as w,v as k,wc as x,ya as _,yc as l,za as C}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as ne}from"./chunk-66YHNWRR.js";var Ye=()=>["/menu/order/download"];function Je(i,c){if(i&1&&(a(0,"li",4)(1,"div"),m(2," The last time you manually download your order is on "),a(3,"span",8),m(4),f(5,"date"),r()(),a(6,"div",9),m(7),r()()),i&2){l();let e=le(0);s(4),I(" ",V(5,2,e==null?null:e.OrderDownloadLatestOn,"dd MMM yyyy HH:mm")," "),s(3),I("(",e==null?null:e.calculatedDate,")")}}function et(i,c){i&1&&(a(0,"li",4),m(1," The last time you manually download your order is on (-) "),r())}var Ke=(()=>{let c=class c{constructor(){this.dialogRef=S(Te),this.data=S(Pe),this.modalConfig=new Me,this.inventoryService=S(E),this.lastDownloadInfo$=this.inventoryService.getLastInfoDownloadInventory(this.data.channelId).pipe(k(n=>{let t=n.OrderDownloadLatestOn!=y.MinDate,o=null,p=null;return t&&(o=new Date(n.OrderDownloadLatestOn),p=y.convertToReadableDate(o)),{OrderDownloadLatestOn:o,calculatedDate:p}}),R(1)),this.selectedProducts=M(this.data.selectedProducts||[]),this.modalConfig.title="Manual Inventory Sync",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}onUpdate(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}};c.\u0275fac=function(t){return new(t||c)},c.\u0275cmp=O({type:c,selectors:[["app-dialog-update-product-info"]],features:[W([E])],decls:16,vars:8,consts:[[3,"onCancel","config"],["content",""],[1,"container"],[1,"mt-8"],[1,"lh-base"],["footer",""],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","routerLink"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","keyup.F2"],[1,"fw-bold","me-1"],[1,"fw-bold"]],template:function(t,o){if(t&1){let p=w();oe(0),f(1,"async"),a(2,"modal-material",0),x("onCancel",function(){return _(p),C(o.onCancel())}),a(3,"div",1)(4,"div",2)(5,"h4"),m(6),r(),a(7,"div",3)(8,"ul"),u(9,Je,8,5,"li",4)(10,et,2,0,"li",4),r()()()(),a(11,"div",5)(12,"a",6),x("click",function(){return _(p),C(o.onCancel())}),m(13," Download "),r(),a(14,"button",7),x("click",function(){return _(p),C(o.onUpdate())})("keyup.F2",function(){return _(p),C(o.onUpdate())}),m(15," Update Anyway "),r()()()}if(t&2){let p=ae(b(1,4,o.lastDownloadInfo$));s(2),g("config",o.modalConfig),s(4),I("",o.selectedProducts().length," Product(s) will be updated."),s(3),h(p!=null&&p.OrderDownloadLatestOn?9:10),s(3),g("routerLink",se(7,Ye))}},dependencies:[Ve,Q,Ce,_e,$,H],encapsulation:2});let i=c;return i})();var te=i=>[i],tt=i=>({"text-decoration-line-through":i}),nt=i=>({"me-10":i}),it=i=>({"bg-gradient-warning":i}),ot=i=>({cursor:i});function at(i,c){if(i&1){let e=w();a(0,"button",37),x("click",function(){_(e);let t=l(),o=l(2);return C(o.onScanInventory(t))}),v(1,"i",38),m(2,"Refresh "),r()}}function lt(i,c){if(i&1){let e=w();a(0,"div",35)(1,"button",39),x("click",function(){_(e);let t=l(),o=l(2);return C(o.onOpenDialogUpdateStockInfo(t))}),v(2,"i",40),m(3," Update "),r(),v(4,"button",41),a(5,"ul",42)(6,"a",43),x("click",function(){_(e);let t=l(3);return C(t.openExportDialog())}),v(7,"i",44),a(8,"span"),m(9,"Export"),r()()()()}}function rt(i,c){if(i&1){let e=w();a(0,"button",45),x("click",function(){_(e);let t=l(3);return C(t.openExportDialog())}),v(1,"i",44),a(2,"span"),m(3,"Export"),r()()}}function st(i,c){if(i&1&&(a(0,"div"),u(1,at,3,0,"button",34),u(2,lt,10,0,"div",35)(3,rt,4,0,"button",36),r()),i&2){let e=c,n=l(2);s(),h(n.productService.hasSelectionVariant(e)?1:-1),s(),h(n.productService.hasSelectionVariant(e)?2:3)}}function ct(i,c){i&1&&(a(0,"div",18)(1,"span"),m(2," showing only different stock, please press next to populate more data "),r()())}function dt(i,c){if(i&1){let e=w();a(0,"th")(1,"input",46),P("ngModelChange",function(t){_(e);let o=l(3);return T(o.checkboxState,t)||(o.checkboxState=t),C(t)}),x("ngModelChange",function(){let t=_(e),o=l(3);return C(o.onCheckboxStateChange(t))}),r()()}if(i&2){let e=l(3);s(),F("ngModel",e.checkboxState)}}function pt(i,c){if(i&1&&(A(0),u(1,dt,2,1,"th"),f(2,"async"),U()),i&2){let e,n=l(2);s(),h((e=b(2,1,n.products$))?1:-1,e)}}function mt(i,c){i&1&&(a(0,"th",31),m(1," Reserved "),r())}function _t(i,c){if(i&1){let e=w();a(0,"input",63),P("ngModelChange",function(t){_(e);let o=l(4).$implicit;return T(o.selected,t)||(o.selected=t),C(t)}),x("ngModelChange",function(){_(e);let t=l(4).$implicit,o=l(2);return C(o.onCheckboxStateProduct(t))}),r()}if(i&2){let e=l(4).$implicit;F("ngModel",e.selected)}}function Ct(i,c){if(i&1&&(A(0),a(1,"div",61),u(2,_t,1,1,"input",62),r(),U()),i&2){let e=l(3).$implicit;s(),g("ngClass",D(2,nt,e.Variants.length<=1)),s(),h(e.Variants.length>1?2:-1)}}function ut(i,c){if(i&1){let e=w();a(0,"img",64),x("click",function(t){_(e);let o=l(3).$implicit,p=l(2);return C(p.onZoomImage(t,o==null?null:o.ImageUrl))}),r()}if(i&2){let e=l(3).$implicit;g("src",re(e==null?null:e.ThumbnailUrl),N)}}function ht(i,c){i&1&&v(0,"img",58)}function gt(i,c){if(i&1&&(v(0,"br"),a(1,"div",65),v(2,"i",66),a(3,"small"),m(4),r()()),i&2){let e=l(3).$implicit;s(4),I("(",e==null?null:e.Category,")")}}function xt(i,c){if(i&1&&(a(0,"td",56)(1,"div",12),B(2,Ct,3,4,"ng-container",25),a(3,"div"),u(4,ut,1,2,"img",57)(5,ht,1,0,"img",58),r()()(),a(6,"td",59)(7,"span",60),m(8),r(),u(9,gt,5,1),r()),i&2){let e=l(2).$implicit,n=l(2);g("rowSpan",e==null?null:e.Variants.length),s(2),g("ngxPermissionsOnly",D(6,te,n.inventoryUpdateRole)),s(2),h(e!=null&&e.ThumbnailUrl?4:5),s(2),g("rowSpan",e==null?null:e.Variants.length),s(2),L(e==null?null:e.Name),s(),h(e.CategoryID!==null&&e.CategoryID!=n.guidEmpty?9:-1)}}function ft(i,c){if(i&1){let e=w();a(0,"input",46),P("ngModelChange",function(t){_(e);let o=l(3).$implicit;return T(o.selected,t)||(o.selected=t),C(t)}),r()}if(i&2){let e=l(3).$implicit;F("ngModel",e.selected)}}function St(i,c){if(i&1&&u(0,ft,1,1,"input",68),i&2){let e=l(2).$implicit;h((e==null?null:e.Inventory)<=1e5?0:-1)}}function yt(i,c){if(i&1){let e=w();a(0,"input",46),P("ngModelChange",function(t){_(e);let o=l(2).$implicit;return T(o.selected,t)||(o.selected=t),C(t)}),r()}if(i&2){let e=l(2).$implicit;F("ngModel",e.selected)}}function vt(i,c){if(i&1&&(A(0),a(1,"td",67),u(2,St,1,1)(3,yt,1,1,"input",68),r(),U()),i&2){let e=l().$implicit;s(2),h((e==null?null:e.Channel[0].TypeID)==1?2:(e==null?null:e.Inventory)>=0?3:-1)}}function wt(i,c){i&1&&(a(0,"div",51),m(1," Not Found "),r())}function bt(i,c){if(i&1&&(a(0,"div")(1,"span",69),m(2),f(3,"number"),r(),m(4," => "),a(5,"span",70),m(6),f(7,"number"),r()()),i&2){let e=l().$implicit;s(2),I(" ",b(3,2,e==null||e.I==null?null:e.I.Available)),s(4),L(b(7,4,e==null?null:e.Inventory))}}function It(i,c){if(i&1&&(m(0),f(1,"number")),i&2){let e=l().$implicit;I(" ",b(1,1,e==null?null:e.Inventory)," ")}}function Ft(i,c){if(i&1&&(a(0,"div",52)(1,"a",71),v(2,"i",72),r()()),i&2){let e=l().$implicit,n=l(3);s(),g("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),N)}}function Tt(i,c){if(i&1){let e=w();a(0,"span",76),x("click",function(){_(e);let t=l(2).$implicit,o=l().$implicit,p=l(2);return C(p.openTableDialog(o,t))}),m(1),f(2,"number"),r()}if(i&2){let e=l(2).$implicit,n=l(3);ie(D(5,ot,n.hasInventoryEdit())),s(),I(" ",b(2,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function Pt(i,c){if(i&1){let e=w();a(0,"td",53)(1,"div",50)(2,"div"),u(3,Tt,3,7,"span",73),f(4,"async"),r(),a(5,"div",52)(6,"a",71),v(7,"i",72),r()(),a(8,"div",52)(9,"span",74),x("click",function(){_(e);let t=l().$implicit,o=l(3);return C(o.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),v(10,"i",75),r()()()()}if(i&2){let e,n=l().$implicit,t=l(3);g("ngClass",D(5,it,(n==null?null:n.Inventory)!=(n==null||n.Channel[0]==null?null:n.Channel[0].Inventory))),s(3),h((e=b(4,3,t.products$))?3:-1,e),s(3),g("href",n==null||n.Channel[0]==null?null:n.Channel[0].Url,N)}}function Dt(i,c){if(i&1&&(a(0,"span",77),m(1),f(2,"number"),r()),i&2){let e=l(2).$implicit;s(),I(" (",b(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function Mt(i,c){i&1&&m(0," - ")}function Vt(i,c){if(i&1&&(a(0,"td",48),u(1,Dt,3,3,"span",77)(2,Mt,1,0),r()),i&2){let e=l().$implicit;s(),h(!(e==null||e.Channel[0]==null)&&e.Channel[0].InventoryReserved?1:2)}}function Et(i,c){i&1&&m(0," - ")}function kt(i,c){if(i&1&&(a(0,"span",55),f(1,"date"),m(2),f(3,"date"),r()),i&2){let e=l().$implicit;g("matTooltip",V(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",V(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function Rt(i,c){if(i&1&&(a(0,"tr"),u(1,xt,10,8),a(2,"td",47),m(3),r(),a(4,"td",48)(5,"span",49),m(6),r()(),B(7,vt,4,1,"ng-container",25),a(8,"td")(9,"div",50),u(10,wt,2,0,"div",51),u(11,bt,8,6,"div"),u(12,It,2,3),u(13,Ft,3,1,"div",52),r()(),u(14,Pt,11,7,"td",53),u(15,Vt,3,1,"td",48),a(16,"td",54),u(17,Et,1,0)(18,kt,4,8,"span",55),r()()),i&2){let e=c.$implicit,n=c.$index,t=l(3);s(),h(n==0?1:-1),s(2),L(e==null?null:e.Model),s(2),g("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",D(13,tt,e.Discontinued)),s(),L(e==null?null:e.Code),s(),g("ngxPermissionsOnly",D(15,te,t.inventoryUpdateRole)),s(3),h((e==null?null:e.I)==null?10:-1),s(),h((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?11:-1),s(),h((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?12:-1),s(),h((e==null?null:e.I)!=null?13:-1),s(),h(e!=null&&e.Channel?14:-1),s(),h(t.isShowReservedColumn?15:-1),s(2),h((e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==t.minDate?17:18)}}function Nt(i,c){if(i&1&&(a(0,"tbody"),q(1,Rt,19,17,"tr",null,G),r()),i&2){let e=c.$implicit;s(),K(e.Variants)}}function Lt(i,c){if(i&1){let e=w();a(0,"mainpanel",1),x("onSubmit",function(t){_(e);let o=l();return C(o.onSearch(t))}),a(1,"actions")(2,"div",2),u(3,st,4,2,"div"),f(4,"async"),r()(),a(5,"filters")(6,"div",3)(7,"label",4),m(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",5),x("onChannelChange",function(t){_(e);let o=l();return C(o.onChannelChange(t))}),r()(),a(10,"div",3)(11,"filter-query-type",6),P("numberFilterComparatorChange",function(t){_(e);let o=l();return T(o.searchFilter.NumberFilterComparator,t)||(o.searchFilter.NumberFilterComparator=t),C(t)})("searchTypeChange",function(t){_(e);let o=l();return T(o.searchFilter.SearchType,t)||(o.searchFilter.SearchType=t),C(t)}),r()(),a(12,"div",3)(13,"label",7),m(14,"PageNumber"),r(),a(15,"input",8),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),C(t)}),r()(),a(16,"div",3)(17,"label",9),m(18,"Page Size"),r(),a(19,"input",10),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),C(t)}),r()(),a(20,"div")(21,"label",11),m(22,"Quantity From - To"),r(),a(23,"div",12)(24,"input",13),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.QuantityFrom,t)||(o.searchFilter.QuantityFrom=t),C(t)}),r(),m(25," - "),a(26,"input",14),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.QuantityTo,t)||(o.searchFilter.QuantityTo=t),C(t)}),r()()()(),a(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),u(31,ct,3,0,"div",18),a(32,"table",19),x("matSortChange",function(t){_(e);let o=l();return C(o.onSortVariant(t))}),a(33,"thead",20)(34,"tr")(35,"th",21),m(36," Product "),v(37,"br"),a(38,"mat-slide-toggle",22),x("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,C(t.onShowDifferenceStock())}),a(39,"small",11),m(40,"FILTER DIFFERENT INVENTORY"),r()()(),a(41,"th",23),m(42,"Variant"),r(),a(43,"th",24),m(44,"SKU"),r(),B(45,pt,3,3,"ng-container",25),a(46,"th",26),m(47," POS "),r(),a(48,"th",27)(49,"div",28),x("click",function(){_(e);let t=l();return C(t.openModalFilter())}),v(50,"img",29),a(51,"span",30),m(52),f(53,"stringLimit"),r()()(),u(54,mt,2,0,"th",31),a(55,"th",32),m(56,"Last Sync"),r()()(),q(57,Nt,3,0,"tbody",null,G),f(59,"async"),r(),a(60,"infinite-paginator",33),f(61,"async"),x("onNextPage",function(){_(e);let t=l();return C(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return C(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return C(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(i&2){let e,n,t,o,p=c,d=l();g("hideSearchBox",!1)("searchBoxPlaceHolder",d.searchPlaceholder()),s(3),h((e=b(4,24,d.products$))?3:-1,e),s(6),g("ngModel",(d.searchFilter==null?null:d.searchFilter.LocationID)||(d.searchFilter==null?null:d.searchFilter.ChannelID)),s(2),g("numberFilterComparatorOptions",p==null||p.Options==null?null:p.Options.SearchComparatorTypeOptions),F("numberFilterComparator",d.searchFilter.NumberFilterComparator),g("searchTypeOptions",p==null||p.Options==null?null:p.Options.SearchSKUOnlyOrSKUNameOptions),F("searchType",d.searchFilter.SearchType),s(4),F("ngModel",d.searchFilter.PageNumber),s(4),F("ngModel",d.searchFilter.RowCount),s(5),F("ngModel",d.searchFilter.QuantityFrom),s(2),F("ngModel",d.searchFilter.QuantityTo),s(5),h((d.searchFilter==null?null:d.searchFilter.filterModel)==3?31:-1),s(14),g("ngxPermissionsOnly",D(33,te,d.inventoryUpdateRole)),s(4),g("matTooltip",((n=d.channelIdentity())==null||n.label==null?null:n.label.length)>13?(n=d.channelIdentity())==null?null:n.label:""),s(),g("src",(t=d.channelIdentity())==null?null:t.img,N),s(2),I(" ",V(53,26,(o=d.channelIdentity())==null?null:o.label,13)," "),s(2),h(d.isShowReservedColumn?54:-1),s(3),K(b(59,29,d.products$)),s(3),g("totalData",d.infinitePagination.totalData())("hideCount",d.infinitePagination.hideCount())("rowCount",b(61,31,d.infinitePagination.totalRowCount$))("pageNumber",d.infinitePagination.pageNumber())("disableNextButton",d.infinitePagination.disableNextButton())("goToLastPage",d.infinitePagination.isLastPage())}}var Ln=(()=>{let c=class c{constructor(){this.http=S(me),this.toastr=S(pe),this.dialog=S(De),this.productService=S(Be),this.authService=S(xe),this.biggerPictureService=S(Ae),this.mainPanelService=S(Ee),this.placeholderService=S(Ue),this.infinitePagination=S(Y),this.ngxPermissionsService=S(ue),this.updateResHandling=S(ee),this.inventoryService=S(E),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=y.MinDate,this.isShowReservedColumn=!0,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.guidEmpty=y.GuidEMpty,this.selectedChannel=M(null),this.channelIdentity=M({img:null,label:null}),this.inventoryUpdateRole=X.InventoryUpdate,this.hasInventoryEdit=M(!0),this.searchPlaceholder=M("Search ...")}ngOnInit(){this.initRoles(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe(z(n=>{this.checkShowReservedColumn(n)}),k(n=>(n=this.calculateAvailableStock(n),n)),R(1)),this.products$=this.sourceObs$}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(R(1),z(n=>{this.searchFilter={RowCount:n.Filter?.PageSize,filterModel:1,PageNumber:1,ChannelID:n.Filter?.ChannelID,LocationID:n.Filter?.LocationID,NumberFilterComparator:n.Filter?.NumberFilterComparator,SearchType:n.Filter?.SearchType},this.initReloadData(),this.initSearchPlaceholder(),this.showToastrMarketplaceInactive(!n.Filter.IsMarketplaceAppActive)}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}initRoles(){this.ngxPermissionsService.hasPermission(X.InventoryUpdate).then(n=>this.hasInventoryEdit.set(n))}calculateAvailableStock(n){return n.map(o=>(o.totalAvailable=o.Variants.reduce((p,d)=>(p+=d.I?.Available||0,p),0),o))}checkShowReservedColumn(n){let t=0,o;n.forEach(p=>{o=p.Variants.find(d=>y.IsNotEmpty(d?.Channel[0]?.InventoryReserved)),o&&(t+=1)}),this.isShowReservedColumn=t>0}onChannelChange(n){let t=Object.assign({},n);this.selectedChannel.set(t),y.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let n=Object.assign({},this.selectedChannel());y.IsNotEmpty(n.parent)?(this.searchFilter.LocationID=n.id,this.searchFilter.ChannelID=n?.parent?.id,n.label=n?.parent?.label+" - "+n?.label,n.img=y.getChannelLogoByTypeId(n?.parent?.typeid)):(this.searchFilter.LocationID=null,n.img=y.getChannelLogoByTypeId(n?.typeid),this.searchFilter.ChannelID=n?.id,this.selectedChannel.set(n)),this.channelIdentity.update(()=>({img:n.img,label:n.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(n){n&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
2
2
|
Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(n){this.searchFilter.text=n,this.setChannelFilter(),this.initReloadData(),this.initSearchPlaceholder()}openModalFilter(){this.mainPanelService.openModalFilter()}onOpenDialogUpdateStockInfo(n){let t=this.productService.selectedVariantProduct(n);this.dialog.open(Ke,{data:{channelId:t[0]?.Channel[0]?.ChannelID,selectedProducts:t}}).afterClosed().pipe(j(o=>o===!0)).subscribe(()=>{this.updateStock(t)})}updateStock(n){if(n.length>0){let t=this.searchFilter.LocationID,o=n.map(d=>ne({ChannelItemID:d?.Channel[0]?.ChannelItemID,ChannelVariationID:d?.Channel[0]?.ChannelVariationID,Inventory:d.Inventory},y.IsNotEmpty(t)&&{LocationID:t})),p={ListChannelID:[this.searchFilter.ChannelID],List:o};this.http.post(Z.UpdateInventoryChannel,p).subscribe(d=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(d)})}}handlingUpdateStock(n){if(n[0]?.Response){let t=n[0]?.Response?.Fail_list,o=n[0]?.Response?.Success_list;this.updateResHandling.responseHandling(o,t,"Stock")}else this.toastr.error(n[0]?.Exception,"Error")}refreshInventory(n,t,o,p){let d={ChannelItemID:n,ChannelVariationID:t,ChannelID:o,VariantID:p};this.http.post("/api/Inventory/RefreshInventoryChannel",d).subscribe(Ot=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.Inventory>=0&&(t.selected=n.selected),t))}onCheckboxStateChange(n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=this.checkboxState,o)),t))}openTableDialog(n,t){this.hasInventoryEdit()&&this.dialog.open(je,{data:{Name:n.Name,Variant:t,ChannelID:t?.Channel[0]?.ChannelID,Table:"inventory",ChannelItemID:n.ChannelItemID}}).afterClosed().pipe(j(p=>y.IsNotEmpty(p))).subscribe(p=>{this.updateItemAfterDialog(p)})}updateItemAfterDialog(n){let t=n.InventoryMultiwarehouse[0]?.LocationID,o={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:n?.Inventory,VariantID:n.ID,SKU:n?.Sku,LocationID:t};this.http.post(Z.UpdateUpdateQuantityByItem,o).subscribe(p=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([p])})}onScanInventory(n){let t=this.productService.selectedVariantProduct(n);this.inventoryService.refreshInventory(t).subscribe(()=>{this.initReloadData(),this.toastr.success("Inventory refreshed successfully","Success")})}openExportDialog(){this.dialog.open(Qe,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=J.DIFFERENCE:this.searchFilter.filterModel=J.ALL,this.initReloadData()}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}onSortVariant(n){if(n.direction==""){this.products$=this.sourceObs$;return}this.products$=this.products$.pipe(k(t=>t.map(o=>(o.Variants=o.Variants.sort((p,d)=>y.compare(p.I?.Available,d.I?.Available,n.direction==="asc")),o)).sort((o,p)=>y.compare(o.totalAvailable,p.totalAvailable,n.direction==="asc"))))}};c.\u0275fac=function(t){return new(t||c)},c.\u0275cmp=O({type:c,selectors:[["app-single-channel-comparison"]],features:[W([Y,E,ee])],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"hideSearchBox","searchBoxPlaceHolder"],["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"d-flex"],[1,"mb-5"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],[4,"ngxPermissionsOnly"],["scope","col","mat-sort-header","Available","arrowPosition","before",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["matTooltip","Fetch the latest stock directly from the channel",1,"btn","btn-outline-dark","me-3"],[1,"btn-group"],[1,"btn","btn-outline-secondary","shadow","rounded"],["matTooltip","Fetch the latest stock directly from the channel",1,"btn","btn-outline-dark","me-3",3,"click"],[1,"fa-solid","fa-arrows-rotate","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-success","btn-sm","dropdown-toggle","border-start"],[1,"dropdown-menu","dropdown-menu-end","pointer"],["role","button",1,"dropdown-item","cursor-pointer","fs-5",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[1,"text-center"],["matTooltipShowDelay","500",3,"matTooltip"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[3,"ngClass"],["type","checkbox",1,"me-3",3,"ngModel"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["title","Stock Available"],["title","Inventory below minimum inventory"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[3,"class"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[3,"click"],[1,"text-danger"]],template:function(t,o){if(t&1&&(u(0,Lt,62,35,"mainpanel",0),f(1,"async")),t&2){let p;h((p=b(1,1,o.loader$))?0:-1,p)}},dependencies:[Q,ce,ke,Oe,be,Se,we,fe,ye,ve,Ge,ge,he,He,$e,Fe,Ie,Le,Re,Ne,qe,We,$,de,H,ze],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let i=c;return i})();export{Ln as SingleChannelComparisonComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as pe}from"./chunk-JWDQVXQP.js";import{a as de,b as me}from"./chunk-K5WSFDNA.js";import{a as ce}from"./chunk-
|
|
1
|
+
import{a as pe}from"./chunk-JWDQVXQP.js";import{a as de,b as me}from"./chunk-K5WSFDNA.js";import{a as ce}from"./chunk-FBXKHJ2G.js";import{a as P}from"./chunk-L6CRWJ2O.js";import{a as se}from"./chunk-PV4OJSZI.js";import{a as le}from"./chunk-3PUUKJCQ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as oe}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as ae}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as re}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as ne}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as ie}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as te,c as Y,h as Z,m as $,o as ee}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as Q,B as X,w as J,y as K}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as U,Hb as D,Ia as F,Mc as z,Nc as l,Oc as w,Pc as x,Rc as f,Sc as S,Tc as C,Uc as A,Vc as R,Wc as H,_c as j,ac as b,ad as q,cc as V,dc as I,fc as B,gc as k,hc as g,ic as t,id as y,jc as i,jd as E,kc as _,kd as G,mb as W,ob as r,ra as O,rc as M,wc as T,ya as s,yc as h,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as L,b as N}from"./chunk-66YHNWRR.js";var ue=()=>[],_e=a=>({"td-cell-hover":a});function ge(a,p){if(a&1&&_(0,"variants-dropdown",31),a&2){let e=h().$implicit;g("variants",e==null?null:e.Variants)}}function he(a,p){if(a&1&&_(0,"variant-with-image",32),a&2){let e=h().$implicit;g("variant",e==null?null:e.Variants[0])}}function fe(a,p){if(a&1&&(t(0,"span"),l(1),i()),a&2){let e=h().$implicit;r(),x("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(a,p){if(a&1&&(t(0,"tr")(1,"td")(2,"div",24),_(3,"img",25),y(4,"channelImage"),t(5,"div",26)(6,"div"),l(7),i(),t(8,"small",27)(9,"span"),l(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div"),_(14,"order-link",29),i(),t(15,"small"),l(16),y(17,"date"),i(),_(18,"br"),t(19,"small"),_(20,"i",30),l(21),i()()(),t(22,"td"),b(23,ge,1,1,"variants-dropdown",31)(24,he,1,1,"variant-with-image",32),i(),t(25,"td",33),l(26),y(27,"number"),i(),t(28,"td")(29,"div",28)(30,"div",34)(31,"span"),l(32),i(),b(33,fe,2,1,"span"),i(),t(34,"small"),l(35),i()()()()),a&2){let e=p.$implicit;r(3),g("src",E(4,14,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),r(4),w(e.Outlet),r(3),w(e.ChannelName),r(4),g("order",e),r(2),x(" ",G(17,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),r(5),x(" ",e.Customer," "),r(),z(q(21,_e,(e.Variants==null?null:e.Variants.length)>1)),r(),V((e.Variants==null?null:e.Variants.length)>1?23:24),r(3),w(E(27,19,e.Amount)),r(6),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),r(),V(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?33:-1),r(2),x(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function Ce(a,p){if(a&1){let e=M();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Outlet"),i(),t(6,"th",20),l(7,"Number"),i(),t(8,"th"),l(9,"Items"),i(),t(10,"th",21),l(11,"Amount"),i(),t(12,"th",22),l(13,"Shipping"),i()()(),t(14,"tbody"),B(15,Se,36,23,"tr",null,I),i()(),t(17,"app-custom-paginator",23),T("next",function(){s(e);let m=h();return c(m.initShippedOrders())})("previous",function(){s(e);let m=h();return c(m.initShippedOrders())}),i()()}if(a&2){let e=h(),d=H(0);r(15),k(d),r(2),g("filter",e.filter())("totaldata",d==null?null:d.length)}}function ve(a,p){a&1&&(t(0,"div",16),_(1,"app-empty-state"),i())}var Re=(()=>{let p=class p{constructor(){this.orderService=O(P),this.filter=F({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:d=>{this.initFromDate(d)},error:d=>{console.error("Error fetching default date:",d),this.initFromDate(null)}})}initFromDate(d){this.filter.update(m=>N(L({},m),{From:d})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}};p.\u0275fac=function(m){return new(m||p)},p.\u0275cmp=D({type:p,selectors:[["app-shipped"]],features:[j([P])],decls:34,vars:12,consts:[["headerTitle","Shipped","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[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,"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,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["rowCountApi","/api/orders/shippedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"d-flex","align-items-end","gap-2"]],template:function(m,o){if(m&1){let u=M();A(0),y(1,"async"),t(2,"mainpanel",0),T("onSubmit",function(){return s(u),c(o.initShippedOrders())}),C("textChange",function(n){return s(u),S(o.filter().Number,n)||(o.filter().Number=n),c(n)}),t(3,"actions")(4,"a",1),_(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),i(),t(12,"app-channel-options-v2",4),C("ngModelChange",function(n){return s(u),S(o.filter().ListChannelID,n)||(o.filter().ListChannelID=n),c(n)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),C("dateChange",function(n){return s(u),S(o.filter().From,n)||(o.filter().From=n),c(n)}),i()(),t(18,"div")(19,"datepicker",8),C("dateChange",function(n){return s(u),S(o.filter().To,n)||(o.filter().To=n),c(n)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),C("ngModelChange",function(n){return s(u),S(o.filter().PageNumber,n)||(o.filter().PageNumber=n),c(n)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),C("ngModelChange",function(n){return s(u),S(o.filter().PageSize,n)||(o.filter().PageSize=n),c(n)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),b(32,Ce,18,2,"div",15)(33,ve,2,0,"div",16),i()()()()()}if(m&2){let u=R(E(1,8,o.shippedOrders$)||U(11,ue));r(2),f("text",o.filter().Number),r(10),g("multiple",!0),f("ngModel",o.filter().ListChannelID),r(5),f("date",o.filter().From),r(2),f("date",o.filter().To),r(4),f("ngModel",o.filter().PageNumber),r(4),f("ngModel",o.filter().PageSize),r(5),V(u.length>0?32:33)}},dependencies:[X,re,ae,oe,te,Y,ee,Z,$,de,me,se,ne,ie,ce,le,J,Q,K,pe],encapsulation:2});let a=p;return a})();export{Re as ShippedComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as zt}from"./chunk-E7LOFZQV.js";import"./chunk-YLQBIIZH.js";import{b as Xt}from"./chunk-7T5DBPDP.js";import"./chunk-OH5T7D7O.js";import{a as Kt,b as Jt}from"./chunk-FH2KAM6J.js";import{a as Yt}from"./chunk-YKKHSYDW.js";import{a as Ht}from"./chunk-WTHYLNPX.js";import{a as ct,b as Gt,c as jt,d as mt,e as pt}from"./chunk-G3KVHCET.js";import"./chunk-TQROQOXU.js";import{a as Wt}from"./chunk-IQGRGC3E.js";import{d as R,e as B}from"./chunk-BZWZ64N5.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-DLHIDOS3.js";import"./chunk-WCX3T6LK.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-GD6ZN56B.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as Bt}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as Rt}from"./chunk-UEXWQT5J.js";import{b as qt,c as Qt}from"./chunk-RPHZK33A.js";import"./chunk-3SCX7IMW.js";import"./chunk-JHSG3KRS.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as $t}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-ZSUWHVKX.js";import"./chunk-7K6U3ABQ.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as Ct,c as h}from"./chunk-UPRDDI4K.js";import{A as et,B as $,c as tt,e as nt,h as L,i as W,l as st,m as Mt,n as Y,q as H,r as wt,s as X,t as Vt,u as Ut,v as Lt,z as K}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as Dt,e as Z}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as A,w as S}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$ as Pt,$c as lt,Hb as x,K as At,M as Ft,Nc as f,Oa as D,Oc as at,Pc as q,Rc as Et,Sc as Nt,Tc as Ot,Z as z,_c as I,ac as C,ca as ht,cc as g,dc as w,ea as E,f as St,fc as V,gc as U,hc as d,ic as c,id as v,jc as s,jd as T,kc as _,ma as N,ob as p,ra as u,rc as j,tb as M,td as kt,ud as b,v as P,wc as F,ya as O,yc as l,za as k}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var J=(function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t})(J||{});var it=(function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t})(it||{});var ot=(function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t})(ot||{});var gt=class extends st{setValue(r,i){if(r instanceof Date){let n=Math.floor(r.getTime()/1e3);super.setValue(n,i)}else super.setValue(r,i)}},bt=(()=>{let r=class r{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(K)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(P(e=>this.setLabelToIndonesian(e)))}setLabelToIndonesian(n=[]){let e,a;return n=n.map(o=>(e=o?.multi_lang?.find(m=>m.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(m=>(a=m?.multi_lang?.find(y=>y.language=="id"),m.name=a?.value,m)),o.name=e?.value?e?.value:o.name,o)),n}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{if(a=[],o.mandatory&&a.push(nt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==J.FREE_TEXT_FILED){let m=this.formBuilder.group({unit:new st(null),value:new st(null,a)});e.addControl(JSON.stringify(o.attribute_id),m)}else o?.attribute_info?.input_type==J.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ot.VALIDATOR_DATE_TYPE?e.addControl(JSON.stringify(o.attribute_id),new gt(null,a)):e.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,a))}),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.attribute_id||y.mandatory)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>{switch(o.attribute_info.input_type){case J.MULTI_COMBO_BOX:h.IsNotEmpty(e[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(m=>e[o.attribute_id]?.findIndex(y=>y==m.value_id)!=-1):o.attribute_value_list=[];break;case J.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]?.value,e[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ot.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(e[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(m=>m.value_id==e[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,e){let a=[];if(h.IsNotEmpty(n)){let o={value_id:0,original_value_name:JSON.stringify(n)};h.IsNotEmpty(e)&&(o.value_unit=e),a=[o]}return a}setSelectedDateAttr(n){let e=[];return h.IsNotEmpty(n)&&(e=[{value_id:0,original_value_name:JSON.stringify(n)}]),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var yt=()=>[];function ne(t,r){t&1&&(c(0,"span",4),f(1,"*"),s())}function re(t,r){if(t&1&&_(0,"ng-select",5),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(4,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function ae(t,r){if(t&1&&_(0,"input",7),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function le(t,r){if(t&1&&(c(0,"option",14),f(1),s()),t&2){let i=r.$implicit;d("value",i),p(),at(i)}}function se(t,r){if(t&1&&(c(0,"div",9),_(1,"input",11),c(2,"select",12)(3,"option",13),f(4,"Unit"),s(),V(5,le,2,2,"option",14,w),s()()),t&2){let i=l(3).$implicit;d("formGroupName",i.attribute_id),p(),d("placeholder","Isi "+(i==null?null:i.name)),p(2),d("value",null),p(2),U(i==null||i.attribute_info==null?null:i.attribute_info.attribute_unit_list)}}function ce(t,r){if(t&1&&_(0,"input",10),t&2){let i=l(3).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function me(t,r){if(t&1&&C(0,se,7,3,"div",9)(1,ce,1,2,"input",10),t&2){let i=l(2).$implicit,n=l(2);g((i==null||i.attribute_info==null?null:i.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,r){if(t&1&&_(0,"datepicker",8),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)}}function de(t,r){if(t&1&&C(0,ae,1,2,"input",7)(1,me,2,1)(2,pe,1,1,"datepicker",8),t&2){let i,n=l().$implicit,e=l(2);g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===e.validationType.VALIDATOR_STRING_TYPE?0:i===e.validationType.VALIDATOR_FLOAT_TYPE?1:i===e.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ue(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function _e(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function fe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ne,2,0,"span",4),c(3,"span"),f(4),s()(),C(5,re,1,5,"ng-select",5)(6,de,3,1)(7,ue,1,4,"ng-select",6)(8,_e,1,4,"ng-select",6),s()),t&2){let i,n=r.$implicit,e=l(2);p(2),g(n.mandatory?2:-1),p(2),q(" ",n==null?null:n.name," "),p(),g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===e.inputType.MULTI_COMBO_BOX?5:i===e.inputType.FREE_TEXT_FILED?6:i===e.inputType.SINGLE_COMBO_BOX?7:8)}}function he(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,fe,9,3,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var Zt=(()=>{let r=class r{constructor(){this.formCategoryService=u(bt),this.channelType=b(void 0),this.categoryId=b(void 0),this.channelId=b(void 0),this.channelProductUpload=b(void 0),this.attributesChanges=new M,this.inputType=J,this.formatType=it,this.validationType=ot}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:n,channelId:e,channelType:this.channelType()}).pipe(E(a=>{this.form=this.formCategoryService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{e=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[I([bt]),D],decls:2,vars:3,consts:[[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(e,a){if(e&1&&(C(0,he,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,Ut,Lt,tt,Vt,L,W,H,X,wt,Ht,Qt,qt,S],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{--mat-icon-button-state-layer-size: 36px}"]});let t=r;return t})();var Q=(function(t){return t.TIKTOK_SHOP="TIKTOK_SHOP",t.TOKOPEDIA="TOKOPEDIA",t})(Q||{});var vt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K),this.uploadProductService=u(pt)}getAttributes(n,e){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(At(o=>this.uploadProductService.selectedProduct$.pipe(P(m=>(o=this.mappingAttributeSalesProperty(o,m),o)))))}mappingAttributeSalesProperty(n,e){let a=0;return n.filter(o=>(o.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(e),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(n){let e=!1,a=[];return n.forEach(o=>{o.Variants&&a.push(o.Variants.length)}),e=a.some(o=>o>1),e}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{a=[],o.is_required&&a.push(nt.required),e.addControl(o.id,this.formBuilder.control(null,a))}),e.addControl("listingPlatform",this.formBuilder.control([Q.TIKTOK_SHOP,Q.TOKOPEDIA],[nt.required])),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.id)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(m=>e[o.id]?.includes(m.id)):o.values=o.values.filter(m=>m.id==e[o.id]):e[o.id]&&(o.values=[{id:null,name:e[o.id]}]),o)).filter(o=>o?.values?.length>0)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Ce(t,r){t&1&&(c(0,"small",5),f(1," Platform is required "),s())}function ge(t,r){t&1&&(c(0,"span",5),f(1,"*"),s())}function be(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ye(t,r){if(t&1&&_(0,"ng-select",7),t&2){let i=l().$implicit;d("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ve(t,r){if(t&1&&_(0,"input",8),t&2){let i=l().$implicit;d("formControlName",i.id)("placeholder",i==null?null:i.name)}}function Te(t,r){if(t&1&&(c(0,"small",5),f(1),s()),t&2){let i=l().$implicit;p(),q(" ",i==null?null:i.name," is mandatory ")}}function xe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ge,2,0,"span",5),c(3,"span"),f(4),s()(),C(5,be,1,4,"ng-select",6)(6,ye,1,3,"ng-select",7)(7,ve,1,2,"input",8),C(8,Te,2,1,"small",5),s()),t&2){let i=r.$implicit;p(2),g(i.is_required?2:-1),p(2),q(" ",i==null?null:i.name," "),p(),g(i.is_multiple_selection?5:i.values!==null&&i.values.length>0?6:7),p(3),g(i.is_required?8:-1)}}function Ie(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),f(5," Platform Options"),s()(),_(6,"ng-select",4),C(7,Ce,2,0,"small",5),s(),V(8,xe,9,4,"div",2,w),s()()),t&2){let i,n=l();d("formGroup",n.form),p(6),d("multiple",!0)("items",n.platformOptions)("clearable",!1),p(),g(!(n.form==null||(i=n.form.get("listingPlatform").errors)==null)&&i.required?7:-1),p(),U(r)}}var te=(()=>{let r=class r{constructor(){this.tiktokAttributeFormService=u(vt),this.channelId=b(void 0),this.categoryId=b(void 0),this.platformChange=kt({alias:"onPlatformChanges"}),this.formSubscription=new St,this.attributesChanges=new M,this.platformOptions=[{label:"TikTok Shop",value:Q.TIKTOK_SHOP},{label:"Tokopedia",value:Q.TOKOPEDIA}]}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(e,n).pipe(P(a=>a.filter(o=>!(o.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(o.values)||o.values?.length==0)&&o.is_customizable==!1))),E(a=>{this.form=this.tiktokAttributeFormService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.form.valueChanges.pipe(ht(this.formSubscription)).subscribe(a=>{delete a.listingPlatform,e=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)}),this.form.get("listingPlatform").valueChanges.pipe(Pt(this.form.get("listingPlatform").value),ht(this.formSubscription)).subscribe(a=>{this.platformChange.emit(a)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[I([vt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[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(e,a){if(e&1&&(C(0,Ie,10,5,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,tt,L,W,H,X,et,S],encapsulation:2});let t=r;return t})();var Tt=(()=>{let r=class r{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(n,e){return this.woocommerceUploadService.getAttributes(n,e).pipe(P(a=>a.map(o=>({key:o.name,label:o.name}))))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var ee=(()=>{let r=class r{constructor(){this.wooAttributeFormService=u(Tt),this.channelId=b(),this.categoryId=b(),this.attributesChanges=new M}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([Tt]),D],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(e,a){e&1&&(c(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),s(),c(4,"ng-select",3),v(5,"async"),F("change",function(m){return a.onSelectAttribute(m)}),s()()()),e&2&&(p(4),d("items",T(5,1,a.attributes$)))},dependencies:[A,et,B,R,$,S],encapsulation:2});let t=r;return t})();var xt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n,e){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(P(o=>o))}createFormGroup(n){let e=this.formBuilder.group({});return n.forEach(a=>{e.addControl(a.variant,this.formBuilder.control(null))}),e}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Se(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),f(2),s(),_(3,"ng-select",4),s()),t&2){let i=r.$implicit;p(2),q(" ",i==null?null:i.variant," "),p(),d("formControlName",i.variant)("items",i.values)("placeholder","Pilih "+(i==null?null:i.variant))}}function Ae(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,Se,4,4,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var ie=(()=>{let r=class r{constructor(){this.tokpedAttrFormService=u(xt),this.channelId=b(void 0),this.categoryId=b(void 0),this.attributesChanges=new M}ngOnInit(){}ngOnChanges(n){let e=this.categoryId(),a=this.channelId();h.IsNotEmpty(e)&&h.IsNotEmpty(a)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(a,e).pipe(E(o=>{this.form=this.tokpedAttrFormService.createFormGroup(o),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(e=>{n=this.tokpedAttrFormService.convertAttributes(e),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([xt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(e,a){if(e&1&&(C(0,Ae,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,L,W,H,X,S],encapsulation:2});let t=r;return t})();var It=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(E(a=>(a.Options.StatusOptions=a.Options.Status.map(o=>({id:o,name:o})),a)))}createFormGroup(n){let e=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(o=>{e.addControl(o,this.formBuilder.control(null))}),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Fe(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4," Brand "),s(),_(5,"input",4),s(),c(6,"div",5)(7,"div",3),f(8," Product Type "),s(),_(9,"input",6),s(),c(10,"div",5)(11,"div",3),f(12," Status "),s(),_(13,"ng-select",7),s()()()),t&2){let i=l();d("formGroup",i.form),p(13),d("items",r.Options.StatusOptions)}}var oe=(()=>{let r=class r{constructor(){this.channelId=b(void 0),this.attributesChanges=new M,this.shopifyFormService=u(It)}ngOnChanges(n){n.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(E(e=>{this.form=this.shopifyFormService.createFormGroup(e),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([It]),D],decls:2,vars:3,consts:[[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(e,a){if(e&1&&(C(0,Fe,14,2,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,$,Y,tt,L,W,H,X,B,R,S],encapsulation:2});let t=r;return t})();function Pe(t,r){if(t&1&&(c(0,"div",6),_(1,"app-product-card",9),s()),t&2){let i=r.$implicit;p(),d("productId",i==null?null:i.ID)("title",i==null?null:i.Name)("image",i==null?null:i.ThumbnailUrl)("description",(i==null||i.Variants==null?null:i.Variants.length)>1?(i==null||i.Variants==null?null:i.Variants.length)+" Variants":null)("imageForZoom",i==null?null:i.ImageUrl)("code",i==null||i.Variants[0]==null?null:i.Variants[0].Code)("showFooter",!1)}}function Ee(t,r){if(t&1){let i=j();c(0,"mat-checkbox",21),Ot("ngModelChange",function(e){O(i);let a=l().$implicit;return Nt(a.selected,e)||(a.selected=e),k(e)}),F("ngModelChange",function(){let e=O(i),a=l(),o=a.$implicit,m=a.$index,y=l();return k(y.onSelectChannel(o,m,e))}),s()}if(t&2){let i=l().$implicit;Et("ngModel",i.selected)}}function Ne(t,r){if(t&1&&(c(0,"div",18),_(1,"input",22),s()),t&2){let i=l().$implicit,n=l();d("matTooltip",i.type==n.channelType.Shopify||i.type==n.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":i.type==n.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Oe(t,r){if(t&1){let i=j();c(0,"app-channel-category-select",23),F("selectedCategory",function(e){O(i);let a=l().$index,o=l();return k(o.onCategoryChange(a,e))}),s()}if(t&2){let i=l().$implicit,n=l();d("disabled",!i.selected||i.selected&&i.type==n.channelType.Lazada)("channelId",i.id)("channelType",i.type)("categoryId",i.categoryId)}}function ke(t,r){if(t&1){let i=j();c(0,"shopee-attribute-form",27),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)("channelType",i.type)}}function De(t,r){if(t&1){let i=j();c(0,"tiktok-attribute-form",28),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))})("onPlatformChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onPlatformChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Me(t,r){if(t&1){let i=j();c(0,"wooocommerce-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function we(t,r){if(t&1){let i=j();c(0,"tokopedia-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Ve(t,r){if(t&1&&(c(0,"div",20)(1,"div",24),C(2,ke,1,3,"shopee-attribute-form",25)(3,De,1,2,"tiktok-attribute-form",26)(4,Me,1,2,"wooocommerce-attribute-form",26)(5,we,1,2,"tokopedia-attribute-form",26),s()()),t&2){let i,n=l().$implicit,e=l();p(2),g((i=n.type)===e.channelType.Shopee?2:i===e.channelType.Tiktok?3:i===e.channelType.WooCommerce?4:i===e.channelType.Tokopedia?5:-1)}}function Ue(t,r){if(t&1){let i=j();c(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),F("attributesChanges",function(e){O(i);let a=l().$index,o=l();return k(o.onAttributesChange(a,e))}),s()()()}if(t&2){let i=l().$implicit;p(2),d("channelId",i.id)}}function Le(t,r){if(t&1&&(c(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),C(6,Ee,1,1,"mat-checkbox",14),v(7,"async"),s(),c(8,"div"),_(9,"app-channel-logo",15),s(),c(10,"div",16)(11,"span"),f(12),s()()()(),c(13,"div",12)(14,"div",17),C(15,Ne,2,1,"div",18)(16,Oe,1,4,"app-channel-category-select",19),s()()(),C(17,Ve,6,1,"div",20)(18,Ue,3,1,"div",20),s()()),t&2){let i,n=r.$implicit,e=l();p(6),g((i=T(7,8,e.defaultCategories$))?6:-1,i),p(3),d("typeId",n.type)("showChannelName",!1),p(),d("matTooltip",n.name)("matTooltipShowDelay",2500),p(2),at(n.name),p(3),g(n.type==e.channelType.Shopify||n.type==e.channelType.Plugo||n.type==e.channelType.ShopifyV2?15:16),p(2),g(n.categoryId&&e.channelType.Lazada!=n.type&&n.selected?17:(e.channelType.Shopify==n.type||n.type==e.channelType.ShopifyV2)&&n.selected?18:-1)}}var en=(()=>{let r=class r{constructor(){this.toastr=u(Dt),this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ct,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(z(1))}onCategoryChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.categoryId=e,o.attributes=[]),o)))}onPlatformChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onAttributesChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.attributes=e),o)))}tiktokPlatformChanges(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onSelectChannel(n,e,a){this.channelProductUploads.update(o=>o.map((m,y)=>{if(y==e&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);m.categoryId=_t?.DefaultCategoryID}return y==e&&!n.selected&&(m.categoryId=null),m}))}findCategoryByChannelId(n,e){return e.find(a=>a.ID===n)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(e=>e.type==Ct.Tiktok&&h.IsNotEmpty(e?.categoryId)?e.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["app-product-upload"]],features:[I([ct,Gt,jt,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"],["color","primary",1,"example-margin",3,"ngModel"],[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","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(e,a){if(e&1&&(c(0,"mainpanel",0)(1,"actions")(2,"button",1),F("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),s()(),c(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),s(),c(9,"div",5),V(10,Pe,2,7,"div",6,w),v(12,"async"),s(),c(13,"h3",7),f(14,"Channel To Upload"),s(),V(15,Le,19,10,"div",8,w),s()()()),e&2){let o;d("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),d("disabled",((o=a.channelProductUploads())==null?null:o.length)==0),p(8),U(T(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[A,Xt,Bt,Jt,Kt,Yt,et,L,Mt,Rt,$t,te,ee,ie,oe,Wt,zt,Zt,S],encapsulation:2});let t=r;return t})();export{en as ProductUploadComponent};
|
|
1
|
+
import{a as zt}from"./chunk-E7LOFZQV.js";import"./chunk-YLQBIIZH.js";import{b as Xt}from"./chunk-7T5DBPDP.js";import"./chunk-OH5T7D7O.js";import{a as Kt,b as Jt}from"./chunk-FH2KAM6J.js";import{a as Yt}from"./chunk-YKKHSYDW.js";import{a as Ht}from"./chunk-WTHYLNPX.js";import{a as ct,b as Gt,c as jt,d as mt,e as pt}from"./chunk-KNE2UYQ2.js";import"./chunk-TQROQOXU.js";import{a as Wt}from"./chunk-IQGRGC3E.js";import{d as R,e as B}from"./chunk-BZWZ64N5.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-DLHIDOS3.js";import"./chunk-FPJTI4LM.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-JLDXWNDU.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as Bt}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as Rt}from"./chunk-UEXWQT5J.js";import{b as qt,c as Qt}from"./chunk-RPHZK33A.js";import"./chunk-3SCX7IMW.js";import"./chunk-JHSG3KRS.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as $t}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-ZSUWHVKX.js";import"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as Ct,c as h}from"./chunk-UPRDDI4K.js";import{A as et,B as $,c as tt,e as nt,h as L,i as W,l as st,m as Mt,n as Y,q as H,r as wt,s as X,t as Vt,u as Ut,v as Lt,z as K}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as Dt,e as Z}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as A,w as S}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$ as Pt,$c as lt,Hb as x,K as At,M as Ft,Nc as f,Oa as D,Oc as at,Pc as q,Rc as Et,Sc as Nt,Tc as Ot,Z as z,_c as I,ac as C,ca as ht,cc as g,dc as w,ea as E,f as St,fc as V,gc as U,hc as d,ic as c,id as v,jc as s,jd as T,kc as _,ma as N,ob as p,ra as u,rc as j,tb as M,td as kt,ud as b,v as P,wc as F,ya as O,yc as l,za as k}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var J=(function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t})(J||{});var it=(function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t})(it||{});var ot=(function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t})(ot||{});var gt=class extends st{setValue(r,i){if(r instanceof Date){let n=Math.floor(r.getTime()/1e3);super.setValue(n,i)}else super.setValue(r,i)}},bt=(()=>{let r=class r{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(K)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(P(e=>this.setLabelToIndonesian(e)))}setLabelToIndonesian(n=[]){let e,a;return n=n.map(o=>(e=o?.multi_lang?.find(m=>m.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(m=>(a=m?.multi_lang?.find(y=>y.language=="id"),m.name=a?.value,m)),o.name=e?.value?e?.value:o.name,o)),n}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{if(a=[],o.mandatory&&a.push(nt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==J.FREE_TEXT_FILED){let m=this.formBuilder.group({unit:new st(null),value:new st(null,a)});e.addControl(JSON.stringify(o.attribute_id),m)}else o?.attribute_info?.input_type==J.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ot.VALIDATOR_DATE_TYPE?e.addControl(JSON.stringify(o.attribute_id),new gt(null,a)):e.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,a))}),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.attribute_id||y.mandatory)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>{switch(o.attribute_info.input_type){case J.MULTI_COMBO_BOX:h.IsNotEmpty(e[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(m=>e[o.attribute_id]?.findIndex(y=>y==m.value_id)!=-1):o.attribute_value_list=[];break;case J.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]?.value,e[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ot.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(e[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(m=>m.value_id==e[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,e){let a=[];if(h.IsNotEmpty(n)){let o={value_id:0,original_value_name:JSON.stringify(n)};h.IsNotEmpty(e)&&(o.value_unit=e),a=[o]}return a}setSelectedDateAttr(n){let e=[];return h.IsNotEmpty(n)&&(e=[{value_id:0,original_value_name:JSON.stringify(n)}]),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var yt=()=>[];function ne(t,r){t&1&&(c(0,"span",4),f(1,"*"),s())}function re(t,r){if(t&1&&_(0,"ng-select",5),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(4,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function ae(t,r){if(t&1&&_(0,"input",7),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function le(t,r){if(t&1&&(c(0,"option",14),f(1),s()),t&2){let i=r.$implicit;d("value",i),p(),at(i)}}function se(t,r){if(t&1&&(c(0,"div",9),_(1,"input",11),c(2,"select",12)(3,"option",13),f(4,"Unit"),s(),V(5,le,2,2,"option",14,w),s()()),t&2){let i=l(3).$implicit;d("formGroupName",i.attribute_id),p(),d("placeholder","Isi "+(i==null?null:i.name)),p(2),d("value",null),p(2),U(i==null||i.attribute_info==null?null:i.attribute_info.attribute_unit_list)}}function ce(t,r){if(t&1&&_(0,"input",10),t&2){let i=l(3).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function me(t,r){if(t&1&&C(0,se,7,3,"div",9)(1,ce,1,2,"input",10),t&2){let i=l(2).$implicit,n=l(2);g((i==null||i.attribute_info==null?null:i.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,r){if(t&1&&_(0,"datepicker",8),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)}}function de(t,r){if(t&1&&C(0,ae,1,2,"input",7)(1,me,2,1)(2,pe,1,1,"datepicker",8),t&2){let i,n=l().$implicit,e=l(2);g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===e.validationType.VALIDATOR_STRING_TYPE?0:i===e.validationType.VALIDATOR_FLOAT_TYPE?1:i===e.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ue(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function _e(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function fe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ne,2,0,"span",4),c(3,"span"),f(4),s()(),C(5,re,1,5,"ng-select",5)(6,de,3,1)(7,ue,1,4,"ng-select",6)(8,_e,1,4,"ng-select",6),s()),t&2){let i,n=r.$implicit,e=l(2);p(2),g(n.mandatory?2:-1),p(2),q(" ",n==null?null:n.name," "),p(),g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===e.inputType.MULTI_COMBO_BOX?5:i===e.inputType.FREE_TEXT_FILED?6:i===e.inputType.SINGLE_COMBO_BOX?7:8)}}function he(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,fe,9,3,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var Zt=(()=>{let r=class r{constructor(){this.formCategoryService=u(bt),this.channelType=b(void 0),this.categoryId=b(void 0),this.channelId=b(void 0),this.channelProductUpload=b(void 0),this.attributesChanges=new M,this.inputType=J,this.formatType=it,this.validationType=ot}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:n,channelId:e,channelType:this.channelType()}).pipe(E(a=>{this.form=this.formCategoryService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{e=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[I([bt]),D],decls:2,vars:3,consts:[[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(e,a){if(e&1&&(C(0,he,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,Ut,Lt,tt,Vt,L,W,H,X,wt,Ht,Qt,qt,S],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{--mat-icon-button-state-layer-size: 36px}"]});let t=r;return t})();var Q=(function(t){return t.TIKTOK_SHOP="TIKTOK_SHOP",t.TOKOPEDIA="TOKOPEDIA",t})(Q||{});var vt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K),this.uploadProductService=u(pt)}getAttributes(n,e){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(At(o=>this.uploadProductService.selectedProduct$.pipe(P(m=>(o=this.mappingAttributeSalesProperty(o,m),o)))))}mappingAttributeSalesProperty(n,e){let a=0;return n.filter(o=>(o.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(e),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(n){let e=!1,a=[];return n.forEach(o=>{o.Variants&&a.push(o.Variants.length)}),e=a.some(o=>o>1),e}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{a=[],o.is_required&&a.push(nt.required),e.addControl(o.id,this.formBuilder.control(null,a))}),e.addControl("listingPlatform",this.formBuilder.control([Q.TIKTOK_SHOP,Q.TOKOPEDIA],[nt.required])),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.id)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(m=>e[o.id]?.includes(m.id)):o.values=o.values.filter(m=>m.id==e[o.id]):e[o.id]&&(o.values=[{id:null,name:e[o.id]}]),o)).filter(o=>o?.values?.length>0)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Ce(t,r){t&1&&(c(0,"small",5),f(1," Platform is required "),s())}function ge(t,r){t&1&&(c(0,"span",5),f(1,"*"),s())}function be(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ye(t,r){if(t&1&&_(0,"ng-select",7),t&2){let i=l().$implicit;d("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ve(t,r){if(t&1&&_(0,"input",8),t&2){let i=l().$implicit;d("formControlName",i.id)("placeholder",i==null?null:i.name)}}function Te(t,r){if(t&1&&(c(0,"small",5),f(1),s()),t&2){let i=l().$implicit;p(),q(" ",i==null?null:i.name," is mandatory ")}}function xe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ge,2,0,"span",5),c(3,"span"),f(4),s()(),C(5,be,1,4,"ng-select",6)(6,ye,1,3,"ng-select",7)(7,ve,1,2,"input",8),C(8,Te,2,1,"small",5),s()),t&2){let i=r.$implicit;p(2),g(i.is_required?2:-1),p(2),q(" ",i==null?null:i.name," "),p(),g(i.is_multiple_selection?5:i.values!==null&&i.values.length>0?6:7),p(3),g(i.is_required?8:-1)}}function Ie(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),f(5," Platform Options"),s()(),_(6,"ng-select",4),C(7,Ce,2,0,"small",5),s(),V(8,xe,9,4,"div",2,w),s()()),t&2){let i,n=l();d("formGroup",n.form),p(6),d("multiple",!0)("items",n.platformOptions)("clearable",!1),p(),g(!(n.form==null||(i=n.form.get("listingPlatform").errors)==null)&&i.required?7:-1),p(),U(r)}}var te=(()=>{let r=class r{constructor(){this.tiktokAttributeFormService=u(vt),this.channelId=b(void 0),this.categoryId=b(void 0),this.platformChange=kt({alias:"onPlatformChanges"}),this.formSubscription=new St,this.attributesChanges=new M,this.platformOptions=[{label:"TikTok Shop",value:Q.TIKTOK_SHOP},{label:"Tokopedia",value:Q.TOKOPEDIA}]}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(e,n).pipe(P(a=>a.filter(o=>!(o.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(o.values)||o.values?.length==0)&&o.is_customizable==!1))),E(a=>{this.form=this.tiktokAttributeFormService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.form.valueChanges.pipe(ht(this.formSubscription)).subscribe(a=>{delete a.listingPlatform,e=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)}),this.form.get("listingPlatform").valueChanges.pipe(Pt(this.form.get("listingPlatform").value),ht(this.formSubscription)).subscribe(a=>{this.platformChange.emit(a)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[I([vt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[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(e,a){if(e&1&&(C(0,Ie,10,5,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,tt,L,W,H,X,et,S],encapsulation:2});let t=r;return t})();var Tt=(()=>{let r=class r{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(n,e){return this.woocommerceUploadService.getAttributes(n,e).pipe(P(a=>a.map(o=>({key:o.name,label:o.name}))))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var ee=(()=>{let r=class r{constructor(){this.wooAttributeFormService=u(Tt),this.channelId=b(),this.categoryId=b(),this.attributesChanges=new M}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([Tt]),D],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(e,a){e&1&&(c(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),s(),c(4,"ng-select",3),v(5,"async"),F("change",function(m){return a.onSelectAttribute(m)}),s()()()),e&2&&(p(4),d("items",T(5,1,a.attributes$)))},dependencies:[A,et,B,R,$,S],encapsulation:2});let t=r;return t})();var xt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n,e){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(P(o=>o))}createFormGroup(n){let e=this.formBuilder.group({});return n.forEach(a=>{e.addControl(a.variant,this.formBuilder.control(null))}),e}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Se(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),f(2),s(),_(3,"ng-select",4),s()),t&2){let i=r.$implicit;p(2),q(" ",i==null?null:i.variant," "),p(),d("formControlName",i.variant)("items",i.values)("placeholder","Pilih "+(i==null?null:i.variant))}}function Ae(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,Se,4,4,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var ie=(()=>{let r=class r{constructor(){this.tokpedAttrFormService=u(xt),this.channelId=b(void 0),this.categoryId=b(void 0),this.attributesChanges=new M}ngOnInit(){}ngOnChanges(n){let e=this.categoryId(),a=this.channelId();h.IsNotEmpty(e)&&h.IsNotEmpty(a)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(a,e).pipe(E(o=>{this.form=this.tokpedAttrFormService.createFormGroup(o),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(e=>{n=this.tokpedAttrFormService.convertAttributes(e),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([xt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(e,a){if(e&1&&(C(0,Ae,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,L,W,H,X,S],encapsulation:2});let t=r;return t})();var It=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(E(a=>(a.Options.StatusOptions=a.Options.Status.map(o=>({id:o,name:o})),a)))}createFormGroup(n){let e=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(o=>{e.addControl(o,this.formBuilder.control(null))}),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Fe(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4," Brand "),s(),_(5,"input",4),s(),c(6,"div",5)(7,"div",3),f(8," Product Type "),s(),_(9,"input",6),s(),c(10,"div",5)(11,"div",3),f(12," Status "),s(),_(13,"ng-select",7),s()()()),t&2){let i=l();d("formGroup",i.form),p(13),d("items",r.Options.StatusOptions)}}var oe=(()=>{let r=class r{constructor(){this.channelId=b(void 0),this.attributesChanges=new M,this.shopifyFormService=u(It)}ngOnChanges(n){n.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(E(e=>{this.form=this.shopifyFormService.createFormGroup(e),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([It]),D],decls:2,vars:3,consts:[[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(e,a){if(e&1&&(C(0,Fe,14,2,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,$,Y,tt,L,W,H,X,B,R,S],encapsulation:2});let t=r;return t})();function Pe(t,r){if(t&1&&(c(0,"div",6),_(1,"app-product-card",9),s()),t&2){let i=r.$implicit;p(),d("productId",i==null?null:i.ID)("title",i==null?null:i.Name)("image",i==null?null:i.ThumbnailUrl)("description",(i==null||i.Variants==null?null:i.Variants.length)>1?(i==null||i.Variants==null?null:i.Variants.length)+" Variants":null)("imageForZoom",i==null?null:i.ImageUrl)("code",i==null||i.Variants[0]==null?null:i.Variants[0].Code)("showFooter",!1)}}function Ee(t,r){if(t&1){let i=j();c(0,"mat-checkbox",21),Ot("ngModelChange",function(e){O(i);let a=l().$implicit;return Nt(a.selected,e)||(a.selected=e),k(e)}),F("ngModelChange",function(){let e=O(i),a=l(),o=a.$implicit,m=a.$index,y=l();return k(y.onSelectChannel(o,m,e))}),s()}if(t&2){let i=l().$implicit;Et("ngModel",i.selected)}}function Ne(t,r){if(t&1&&(c(0,"div",18),_(1,"input",22),s()),t&2){let i=l().$implicit,n=l();d("matTooltip",i.type==n.channelType.Shopify||i.type==n.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":i.type==n.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Oe(t,r){if(t&1){let i=j();c(0,"app-channel-category-select",23),F("selectedCategory",function(e){O(i);let a=l().$index,o=l();return k(o.onCategoryChange(a,e))}),s()}if(t&2){let i=l().$implicit,n=l();d("disabled",!i.selected||i.selected&&i.type==n.channelType.Lazada)("channelId",i.id)("channelType",i.type)("categoryId",i.categoryId)}}function ke(t,r){if(t&1){let i=j();c(0,"shopee-attribute-form",27),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)("channelType",i.type)}}function De(t,r){if(t&1){let i=j();c(0,"tiktok-attribute-form",28),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))})("onPlatformChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onPlatformChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Me(t,r){if(t&1){let i=j();c(0,"wooocommerce-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function we(t,r){if(t&1){let i=j();c(0,"tokopedia-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Ve(t,r){if(t&1&&(c(0,"div",20)(1,"div",24),C(2,ke,1,3,"shopee-attribute-form",25)(3,De,1,2,"tiktok-attribute-form",26)(4,Me,1,2,"wooocommerce-attribute-form",26)(5,we,1,2,"tokopedia-attribute-form",26),s()()),t&2){let i,n=l().$implicit,e=l();p(2),g((i=n.type)===e.channelType.Shopee?2:i===e.channelType.Tiktok?3:i===e.channelType.WooCommerce?4:i===e.channelType.Tokopedia?5:-1)}}function Ue(t,r){if(t&1){let i=j();c(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),F("attributesChanges",function(e){O(i);let a=l().$index,o=l();return k(o.onAttributesChange(a,e))}),s()()()}if(t&2){let i=l().$implicit;p(2),d("channelId",i.id)}}function Le(t,r){if(t&1&&(c(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),C(6,Ee,1,1,"mat-checkbox",14),v(7,"async"),s(),c(8,"div"),_(9,"app-channel-logo",15),s(),c(10,"div",16)(11,"span"),f(12),s()()()(),c(13,"div",12)(14,"div",17),C(15,Ne,2,1,"div",18)(16,Oe,1,4,"app-channel-category-select",19),s()()(),C(17,Ve,6,1,"div",20)(18,Ue,3,1,"div",20),s()()),t&2){let i,n=r.$implicit,e=l();p(6),g((i=T(7,8,e.defaultCategories$))?6:-1,i),p(3),d("typeId",n.type)("showChannelName",!1),p(),d("matTooltip",n.name)("matTooltipShowDelay",2500),p(2),at(n.name),p(3),g(n.type==e.channelType.Shopify||n.type==e.channelType.Plugo||n.type==e.channelType.ShopifyV2?15:16),p(2),g(n.categoryId&&e.channelType.Lazada!=n.type&&n.selected?17:(e.channelType.Shopify==n.type||n.type==e.channelType.ShopifyV2)&&n.selected?18:-1)}}var en=(()=>{let r=class r{constructor(){this.toastr=u(Dt),this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ct,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(z(1))}onCategoryChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.categoryId=e,o.attributes=[]),o)))}onPlatformChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onAttributesChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.attributes=e),o)))}tiktokPlatformChanges(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onSelectChannel(n,e,a){this.channelProductUploads.update(o=>o.map((m,y)=>{if(y==e&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);m.categoryId=_t?.DefaultCategoryID}return y==e&&!n.selected&&(m.categoryId=null),m}))}findCategoryByChannelId(n,e){return e.find(a=>a.ID===n)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(e=>e.type==Ct.Tiktok&&h.IsNotEmpty(e?.categoryId)?e.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["app-product-upload"]],features:[I([ct,Gt,jt,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"],["color","primary",1,"example-margin",3,"ngModel"],[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","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(e,a){if(e&1&&(c(0,"mainpanel",0)(1,"actions")(2,"button",1),F("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),s()(),c(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),s(),c(9,"div",5),V(10,Pe,2,7,"div",6,w),v(12,"async"),s(),c(13,"h3",7),f(14,"Channel To Upload"),s(),V(15,Le,19,10,"div",8,w),s()()()),e&2){let o;d("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),d("disabled",((o=a.channelProductUploads())==null?null:o.length)==0),p(8),U(T(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[A,Xt,Bt,Jt,Kt,Yt,et,L,Mt,Rt,$t,te,ee,ie,oe,Wt,zt,Zt,S],encapsulation:2});let t=r;return t})();export{en as ProductUploadComponent};
|