marketplacepos 5.43.6 → 5.43.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/Marketplace/{chunk-E5YB37LW.js → chunk-3BYIWPKX.js} +1 -1
  2. package/Marketplace/{chunk-NH366PNR.js → chunk-3IO4ZF34.js} +1 -1
  3. package/Marketplace/{chunk-LSKUUC3C.js → chunk-3NP5TQOW.js} +1 -1
  4. package/Marketplace/{chunk-ZWWKOO6H.js → chunk-5FJUX7W5.js} +2 -2
  5. package/Marketplace/{chunk-RWBLYX7L.js → chunk-6NGH2YZQ.js} +1 -1
  6. package/Marketplace/{chunk-7XS5EOCX.js → chunk-6ZVXICIH.js} +1 -1
  7. package/Marketplace/{chunk-TFQEBAZY.js → chunk-AEJ5I5MW.js} +1 -1
  8. package/Marketplace/{chunk-BWM4D2FI.js → chunk-AOFDSBOE.js} +1 -1
  9. package/Marketplace/{chunk-5YGROVQC.js → chunk-BCH2MADE.js} +1 -1
  10. package/Marketplace/{chunk-CHVVARV6.js → chunk-DO2UECCT.js} +1 -1
  11. package/Marketplace/{chunk-GG43Z2ED.js → chunk-EBVE2XHU.js} +1 -1
  12. package/Marketplace/{chunk-J2BRIZSE.js → chunk-EHU3RPGU.js} +1 -1
  13. package/Marketplace/{chunk-IGPHCUYF.js → chunk-ESX7MIMG.js} +1 -1
  14. package/Marketplace/{chunk-SUV6UMF2.js → chunk-FHQTKJXS.js} +1 -1
  15. package/Marketplace/{chunk-746B65XK.js → chunk-FO2QLLKW.js} +2 -2
  16. package/Marketplace/{chunk-SGPYMAEM.js → chunk-FWG7M5IP.js} +1 -1
  17. package/Marketplace/{chunk-F2QW4SRK.js → chunk-FYBG3KWC.js} +1 -1
  18. package/Marketplace/{chunk-VODOESU7.js → chunk-GJUPDABG.js} +1 -1
  19. package/Marketplace/{chunk-PHZBFTWM.js → chunk-HFBAUQ7H.js} +1 -1
  20. package/Marketplace/{chunk-LOW7FAUO.js → chunk-J6UZFGNY.js} +1 -1
  21. package/Marketplace/{chunk-5MGEZJ5I.js → chunk-JJ6HE6R7.js} +1 -1
  22. package/Marketplace/{chunk-RQ2JYWLD.js → chunk-JX6HFP2Y.js} +1 -1
  23. package/Marketplace/{chunk-HX6V7ERI.js → chunk-KG47DFP5.js} +1 -1
  24. package/Marketplace/{chunk-64KV3IDA.js → chunk-KJATJWWX.js} +1 -1
  25. package/Marketplace/{chunk-UTODORSA.js → chunk-KMZPNPJF.js} +1 -1
  26. package/Marketplace/{chunk-2K3EFH3T.js → chunk-LLDNDJ7P.js} +1 -1
  27. package/Marketplace/{chunk-ZCWIQONO.js → chunk-LZYW24WA.js} +1 -1
  28. package/Marketplace/{chunk-WY7CURUT.js → chunk-O7FDRTJ2.js} +1 -1
  29. package/Marketplace/{chunk-FV47Y5BB.js → chunk-Q23GGWWT.js} +1 -1
  30. package/Marketplace/{chunk-W5FGZ3IS.js → chunk-QWJECSZK.js} +1 -1
  31. package/Marketplace/{chunk-5M2I7FEP.js → chunk-R45ORDIE.js} +1 -1
  32. package/Marketplace/{chunk-IBSUTWOW.js → chunk-RM3KYX7K.js} +1 -1
  33. package/Marketplace/{chunk-HAH7BBIR.js → chunk-SSAGHA7U.js} +1 -1
  34. package/Marketplace/{chunk-4SMRZ7AU.js → chunk-SUJBRB2D.js} +1 -1
  35. package/Marketplace/{chunk-QTZV4SID.js → chunk-TSPQ2LFF.js} +1 -1
  36. package/Marketplace/{chunk-I3FOMVSX.js → chunk-TXVG5OHR.js} +1 -1
  37. package/Marketplace/{chunk-AZ2WERIL.js → chunk-UDZIOJVC.js} +1 -1
  38. package/Marketplace/{chunk-DZ723WRM.js → chunk-UMA5ZNXQ.js} +1 -1
  39. package/Marketplace/{chunk-FWTH44TJ.js → chunk-UYLU3G52.js} +1 -1
  40. package/Marketplace/{chunk-U2FSR2L3.js → chunk-VJNZ5THR.js} +1 -1
  41. package/Marketplace/{chunk-KXPZJM2O.js → chunk-WUUXAXFO.js} +1 -1
  42. package/Marketplace/{chunk-EQN7RM2H.js → chunk-XC7L6C26.js} +1 -1
  43. package/Marketplace/{chunk-5QUVYPQN.js → chunk-YJHI5U5R.js} +1 -1
  44. package/Marketplace/{chunk-5XVZHSH3.js → chunk-ZJVWTRCI.js} +1 -1
  45. package/Marketplace/index.html +2 -2
  46. package/Marketplace/{main-VAWFX5IS.js → main-4LOUTBLN.js} +1 -1
  47. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{a as ie,b as qe}from"./chunk-YZKPQRLO.js";import{e as We,k as Le,l as Ae,m as $e,n as ze,o as Ye}from"./chunk-M5JQ7BGW.js";import{a as Ue,b as Ge,c as je,e as Ke,f as He,g as Qe}from"./chunk-6W6DKFRE.js";import"./chunk-7UHCDGAA.js";import{a as Oe,b as Ne,c as Re}from"./chunk-MHCAI6KP.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-AQTXFEBA.js";import{a as Be}from"./chunk-HAH7BBIR.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-WW22F76D.js";import"./chunk-B5VBBEEN.js";import"./chunk-E3ROEHBW.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-7SVF5UPT.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import"./chunk-CMTBBXR5.js";import{g as be,h as ee}from"./chunk-TFQEBAZY.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as Z}from"./chunk-5HO2IJ47.js";import{c as Ee,d as Pe,e as Ie}from"./chunk-5JVEEL2T.js";import{b as X,c as y}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as De,e as Te}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Fe,n as ke}from"./chunk-CLER2MX6.js";import{A as xe,c as Se,h as Ce,m as ve,x as ye}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as Me,s as Ve}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{J as we,d as W,f as B,g as L,j as q,k as J,n as F}from"./chunk-M2FCTYGU.js";import{$c as R,Ac as ce,Bc as he,Cc as ue,Fc as T,Gb as I,Gc as s,Hc as V,Ic as C,Ka as j,Kc as b,Lc as E,Mb as g,Mc as P,Oa as k,Qc as K,Ra as _,Sc as fe,Tc as _e,Yb as d,Z as z,aa as le,ad as U,bd as ge,cd as H,dc as M,ea as Y,ic as o,ja as se,jc as a,kc as S,lc as O,m as re,mc as N,oc as x,pa as v,pb as pe,rb as r,sd as Q,tc as w,uc as h,v as G,xc as de,ya as m,yc as me,za as c}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as ae,b as oe}from"./chunk-66YHNWRR.js";var et=t=>({"over-due":t});function tt(t,p){if(t&1&&(o(0,"tr",8)(1,"td"),s(2),a(),o(3,"td"),s(4),a(),o(5,"td"),s(6),a(),o(7,"td"),s(8),a()()),t&2){let e=p.$implicit,n=p.index;d("ngClass",fe(5,et,e.Exception)),r(2),V(n+1),r(2),V(e.Number),r(2),V(e.Status),r(2),V(e.Exception)}}function it(t,p){if(t&1&&(O(0),g(1,tt,9,7,"tr",7),N()),t&2){let e,n=h();r(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function nt(t,p){t&1&&(o(0,"tr",9)(1,"td",10)(2,"div",11),S(3,"i",12),a(),o(4,"h4",13),s(5," There is no order to processed "),a()()())}var Je=(()=>{class t{constructor(){this.downloadResult=k()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),S(5,"th",5),o(6,"th"),s(7,"Order Number"),a(),o(8,"th"),s(9,"Status"),a(),o(10,"th"),s(11,"Exception"),a()()(),o(12,"tbody"),g(13,it,2,1,"ng-container",6)(14,nt,6,0,"ng-template",null,0,H),a()()()()),n&2){let l,u=T(15);r(13),d("ngIf",((l=i.downloadResult())==null||l.Body==null?null:l.Body.length)>0)("ngIfElse",u)}},dependencies:[F,W,B,L],encapsulation:2})}}return t})();var A=(()=>{class t{constructor(){this.httpService=v(Te),this.toastr=v(De),this.datePipe=v(J)}gerChannelDetailById(e){return this.httpService.post(Z.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(Z.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(Z.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(Y(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):re}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),l=e.TimeFrom?e.TimeFrom:"",u=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${l} to ${i} ${u}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?y.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):y.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=y.formatTitleFromDate(new Date(e),new Date(n)),l=this.datePipe.transform(e,i),u=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":l+"-"} ${u}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=se({token:t,factory:t.\u0275fac})}}return t})();function at(t,p){if(t&1&&(o(0,"ng-option",13),S(1,"img",14),s(2),a()),t&2){let e=p.$implicit;d("value",e.ID),r(),d("src",e==null?null:e.Img,pe),r(),C("",e.Name," ")}}function ot(t,p){if(t&1){let e=x();o(0,"div",8)(1,"div",4)(2,"h5"),s(3,"Type"),a(),o(4,"p",5),s(5,"Select Type want to download"),a()(),o(6,"div",4)(7,"div",15)(8,"div")(9,"mat-radio-group",16),P("ngModelChange",function(i){m(e);let l=h();return E(l.downloadType,i)||(l.downloadType=i),c(i)}),w("ngModelChange",function(){m(e);let i=h();return c(i.onDownloadTypeChange())}),o(10,"mat-radio-button",17),s(11," Orders "),a(),o(12,"mat-radio-button",18),s(13," Disbursement "),a()()()(),o(14,"div",19)(15,"div",20),S(16,"i",21),a(),o(17,"p",22),s(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(t&2){let e=h();r(9),b("ngModel",e.downloadType),r(),d("value",!1),r(2),d("value",!0)}}function rt(t,p){t&1&&(o(0,"p",5),s(1," Select Disbursement date "),o(2,"span",23),s(3,"(payment date / order complete date)"),a(),s(4," of the channel you want to download (Max 1 Week). "),a())}function lt(t,p){t&1&&(o(0,"p",5),s(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function st(t,p){if(t&1){let e=x();o(0,"div",12)(1,"app-timepicker",24),P("timeChange",function(i){m(e);let l=h();return E(l.startTime,i)||(l.startTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onStartTimeChange())}),a(),o(2,"span",25),s(3,"-"),a(),o(4,"app-timepicker",24),P("timeChange",function(i){m(e);let l=h();return E(l.endTime,i)||(l.endTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onEndTimeChange())}),a()()}if(t&2){let e=h();r(),b("time",e.startTime),r(3),b("time",e.endTime)}}var Xe=(()=>{class t{constructor(){this.reset=k(!1),this.authService=v(ee),this.tokenService=v(be),this.downloadService=v(A),this.downloadType=_(!1),this.selectedChannelId=_(null),this.channelOptions=_(this.authService.getChannels()),this.channelType=X,this.selectedChannel=_(null),this.showTimePicker=_(!1),this.startDate=_(null),this.endDate=_(null),this.startTime=_("00:00"),this.endTime=_("23:59"),this.minDate=_(new Date),this.maxDate=_(new Date),this.filterData=new j,Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let e=this.tokenService?.getTokenValue(),n=e?.DownloadRange?JSON.parse(e?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,l=y.addDays(i,n-1);this.minDate.set(l)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(G(e=>e?.Model),z(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=y.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange"},features:[K([A,We()])],decls:27,vars:13,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let l=x();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),s(5,"Select a Channel"),a(),o(6,"p",5),s(7,"Select Channel want to download order"),a()(),o(8,"div",4)(9,"ng-select",6),P("ngModelChange",function(f){return m(l),E(i.selectedChannelId,f)||(i.selectedChannelId=f),c(f)}),w("ngModelChange",function(){return m(l),c(i.onSelectChannel())}),g(10,at,3,3,"ng-option",7),a()()(),g(11,ot,19,3,"div",8),R(12,"async"),o(13,"div",8)(14,"div",4)(15,"h5"),s(16,"Date Range"),a(),g(17,rt,5,0,"p",5)(18,lt,2,0,"p",5),a(),o(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),P("ngModelChange",function(f){return m(l),E(i.startDate,f)||(i.startDate=f),c(f)}),w("click",function(){m(l);let f=T(25);return c(f.open())}),a(),o(23,"input",11),P("ngModelChange",function(f){return m(l),E(i.endDate,f)||(i.endDate=f),c(f)}),w("click",function(){m(l);let f=T(25);return c(f.open())})("ngModelChange",function(){return m(l),c(i.onFilterDateChange())}),a()(),S(24,"mat-date-range-picker",null,0),a(),g(26,st,5,2,"div",12),a()()()()}if(n&2){let l,u,f=T(25);r(9),d("clearable",!1),b("ngModel",i.selectedChannelId),r(),d("ngForOf",i.channelOptions()),r(),M((l=U(12,11,i.channelDetail$))!=null&&l.ServiceFeeWriteOff&&((l=i.selectedChannel())==null?null:l.TypeID)==i.channelType.Tokopedia?11:-1),r(6),M(i.downloadType()&&((u=i.selectedChannel())==null?null:u.TypeID)==i.channelType.Tokopedia?17:18),r(4),d("rangePicker",f)("min",i.minDate())("max",i.maxDate()),r(),b("ngModel",i.startDate),r(),b("ngModel",i.endDate),r(3),M(i.showTimePicker()?26:-1)}},dependencies:[F,B,q,Ie,Pe,Ee,Re,Oe,Ne,xe,Se,Ce,ye,ve,qe,ze,Le,Ye,Ae,$e],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var D=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(D||{});var $=function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t}($||{});var pt=(t,p)=>({"over-due-today":t,"over-due":p});function dt(t,p){if(t&1&&(o(0,"th",21),s(1),a()),t&2){let e=h();r(),C(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function mt(t,p){if(t&1&&(o(0,"td"),s(1),R(2,"date"),a()),t&2){let e=h().$implicit;r(),C(" ",ge(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function ct(t,p){if(t&1&&(o(0,"span"),s(1),a()),t&2){let e=h().$implicit;r(),C(" ",e.ActionString," ")}}function ht(t,p){if(t&1&&(o(0,"li"),s(1),a()),t&2){let e=p.$implicit;r(),C(" ",e," ")}}function ut(t,p){if(t&1&&(o(0,"ul",27),g(1,ht,2,1,"li",22),a()),t&2){let e=h().$implicit;r(),d("ngForOf",e.ActionString)}}function ft(t,p){if(t&1&&(o(0,"span",28),S(1,"i",29),a()),t&2){let e=h().$implicit;me("title","Delivery : ",e.DeliveryState,`
1
+ import{a as ie,b as qe}from"./chunk-YZKPQRLO.js";import{e as We,k as Le,l as Ae,m as $e,n as ze,o as Ye}from"./chunk-M5JQ7BGW.js";import{a as Ue,b as Ge,c as je,e as Ke,f as He,g as Qe}from"./chunk-6W6DKFRE.js";import"./chunk-7UHCDGAA.js";import{a as Oe,b as Ne,c as Re}from"./chunk-MHCAI6KP.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-AQTXFEBA.js";import{a as Be}from"./chunk-SSAGHA7U.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-WW22F76D.js";import"./chunk-B5VBBEEN.js";import"./chunk-E3ROEHBW.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-7SVF5UPT.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import"./chunk-CMTBBXR5.js";import{g as be,h as ee}from"./chunk-AEJ5I5MW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as Z}from"./chunk-5HO2IJ47.js";import{c as Ee,d as Pe,e as Ie}from"./chunk-5JVEEL2T.js";import{b as X,c as y}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as De,e as Te}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Fe,n as ke}from"./chunk-CLER2MX6.js";import{A as xe,c as Se,h as Ce,m as ve,x as ye}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as Me,s as Ve}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{J as we,d as W,f as B,g as L,j as q,k as J,n as F}from"./chunk-M2FCTYGU.js";import{$c as R,Ac as ce,Bc as he,Cc as ue,Fc as T,Gb as I,Gc as s,Hc as V,Ic as C,Ka as j,Kc as b,Lc as E,Mb as g,Mc as P,Oa as k,Qc as K,Ra as _,Sc as fe,Tc as _e,Yb as d,Z as z,aa as le,ad as U,bd as ge,cd as H,dc as M,ea as Y,ic as o,ja as se,jc as a,kc as S,lc as O,m as re,mc as N,oc as x,pa as v,pb as pe,rb as r,sd as Q,tc as w,uc as h,v as G,xc as de,ya as m,yc as me,za as c}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as ae,b as oe}from"./chunk-66YHNWRR.js";var et=t=>({"over-due":t});function tt(t,p){if(t&1&&(o(0,"tr",8)(1,"td"),s(2),a(),o(3,"td"),s(4),a(),o(5,"td"),s(6),a(),o(7,"td"),s(8),a()()),t&2){let e=p.$implicit,n=p.index;d("ngClass",fe(5,et,e.Exception)),r(2),V(n+1),r(2),V(e.Number),r(2),V(e.Status),r(2),V(e.Exception)}}function it(t,p){if(t&1&&(O(0),g(1,tt,9,7,"tr",7),N()),t&2){let e,n=h();r(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function nt(t,p){t&1&&(o(0,"tr",9)(1,"td",10)(2,"div",11),S(3,"i",12),a(),o(4,"h4",13),s(5," There is no order to processed "),a()()())}var Je=(()=>{class t{constructor(){this.downloadResult=k()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),S(5,"th",5),o(6,"th"),s(7,"Order Number"),a(),o(8,"th"),s(9,"Status"),a(),o(10,"th"),s(11,"Exception"),a()()(),o(12,"tbody"),g(13,it,2,1,"ng-container",6)(14,nt,6,0,"ng-template",null,0,H),a()()()()),n&2){let l,u=T(15);r(13),d("ngIf",((l=i.downloadResult())==null||l.Body==null?null:l.Body.length)>0)("ngIfElse",u)}},dependencies:[F,W,B,L],encapsulation:2})}}return t})();var A=(()=>{class t{constructor(){this.httpService=v(Te),this.toastr=v(De),this.datePipe=v(J)}gerChannelDetailById(e){return this.httpService.post(Z.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(Z.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(Z.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(Y(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):re}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),l=e.TimeFrom?e.TimeFrom:"",u=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${l} to ${i} ${u}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?y.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):y.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=y.formatTitleFromDate(new Date(e),new Date(n)),l=this.datePipe.transform(e,i),u=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":l+"-"} ${u}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=se({token:t,factory:t.\u0275fac})}}return t})();function at(t,p){if(t&1&&(o(0,"ng-option",13),S(1,"img",14),s(2),a()),t&2){let e=p.$implicit;d("value",e.ID),r(),d("src",e==null?null:e.Img,pe),r(),C("",e.Name," ")}}function ot(t,p){if(t&1){let e=x();o(0,"div",8)(1,"div",4)(2,"h5"),s(3,"Type"),a(),o(4,"p",5),s(5,"Select Type want to download"),a()(),o(6,"div",4)(7,"div",15)(8,"div")(9,"mat-radio-group",16),P("ngModelChange",function(i){m(e);let l=h();return E(l.downloadType,i)||(l.downloadType=i),c(i)}),w("ngModelChange",function(){m(e);let i=h();return c(i.onDownloadTypeChange())}),o(10,"mat-radio-button",17),s(11," Orders "),a(),o(12,"mat-radio-button",18),s(13," Disbursement "),a()()()(),o(14,"div",19)(15,"div",20),S(16,"i",21),a(),o(17,"p",22),s(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(t&2){let e=h();r(9),b("ngModel",e.downloadType),r(),d("value",!1),r(2),d("value",!0)}}function rt(t,p){t&1&&(o(0,"p",5),s(1," Select Disbursement date "),o(2,"span",23),s(3,"(payment date / order complete date)"),a(),s(4," of the channel you want to download (Max 1 Week). "),a())}function lt(t,p){t&1&&(o(0,"p",5),s(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function st(t,p){if(t&1){let e=x();o(0,"div",12)(1,"app-timepicker",24),P("timeChange",function(i){m(e);let l=h();return E(l.startTime,i)||(l.startTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onStartTimeChange())}),a(),o(2,"span",25),s(3,"-"),a(),o(4,"app-timepicker",24),P("timeChange",function(i){m(e);let l=h();return E(l.endTime,i)||(l.endTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onEndTimeChange())}),a()()}if(t&2){let e=h();r(),b("time",e.startTime),r(3),b("time",e.endTime)}}var Xe=(()=>{class t{constructor(){this.reset=k(!1),this.authService=v(ee),this.tokenService=v(be),this.downloadService=v(A),this.downloadType=_(!1),this.selectedChannelId=_(null),this.channelOptions=_(this.authService.getChannels()),this.channelType=X,this.selectedChannel=_(null),this.showTimePicker=_(!1),this.startDate=_(null),this.endDate=_(null),this.startTime=_("00:00"),this.endTime=_("23:59"),this.minDate=_(new Date),this.maxDate=_(new Date),this.filterData=new j,Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let e=this.tokenService?.getTokenValue(),n=e?.DownloadRange?JSON.parse(e?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,l=y.addDays(i,n-1);this.minDate.set(l)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(G(e=>e?.Model),z(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=y.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange"},features:[K([A,We()])],decls:27,vars:13,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let l=x();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),s(5,"Select a Channel"),a(),o(6,"p",5),s(7,"Select Channel want to download order"),a()(),o(8,"div",4)(9,"ng-select",6),P("ngModelChange",function(f){return m(l),E(i.selectedChannelId,f)||(i.selectedChannelId=f),c(f)}),w("ngModelChange",function(){return m(l),c(i.onSelectChannel())}),g(10,at,3,3,"ng-option",7),a()()(),g(11,ot,19,3,"div",8),R(12,"async"),o(13,"div",8)(14,"div",4)(15,"h5"),s(16,"Date Range"),a(),g(17,rt,5,0,"p",5)(18,lt,2,0,"p",5),a(),o(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),P("ngModelChange",function(f){return m(l),E(i.startDate,f)||(i.startDate=f),c(f)}),w("click",function(){m(l);let f=T(25);return c(f.open())}),a(),o(23,"input",11),P("ngModelChange",function(f){return m(l),E(i.endDate,f)||(i.endDate=f),c(f)}),w("click",function(){m(l);let f=T(25);return c(f.open())})("ngModelChange",function(){return m(l),c(i.onFilterDateChange())}),a()(),S(24,"mat-date-range-picker",null,0),a(),g(26,st,5,2,"div",12),a()()()()}if(n&2){let l,u,f=T(25);r(9),d("clearable",!1),b("ngModel",i.selectedChannelId),r(),d("ngForOf",i.channelOptions()),r(),M((l=U(12,11,i.channelDetail$))!=null&&l.ServiceFeeWriteOff&&((l=i.selectedChannel())==null?null:l.TypeID)==i.channelType.Tokopedia?11:-1),r(6),M(i.downloadType()&&((u=i.selectedChannel())==null?null:u.TypeID)==i.channelType.Tokopedia?17:18),r(4),d("rangePicker",f)("min",i.minDate())("max",i.maxDate()),r(),b("ngModel",i.startDate),r(),b("ngModel",i.endDate),r(3),M(i.showTimePicker()?26:-1)}},dependencies:[F,B,q,Ie,Pe,Ee,Re,Oe,Ne,xe,Se,Ce,ye,ve,qe,ze,Le,Ye,Ae,$e],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var D=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(D||{});var $=function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t}($||{});var pt=(t,p)=>({"over-due-today":t,"over-due":p});function dt(t,p){if(t&1&&(o(0,"th",21),s(1),a()),t&2){let e=h();r(),C(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function mt(t,p){if(t&1&&(o(0,"td"),s(1),R(2,"date"),a()),t&2){let e=h().$implicit;r(),C(" ",ge(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function ct(t,p){if(t&1&&(o(0,"span"),s(1),a()),t&2){let e=h().$implicit;r(),C(" ",e.ActionString," ")}}function ht(t,p){if(t&1&&(o(0,"li"),s(1),a()),t&2){let e=p.$implicit;r(),C(" ",e," ")}}function ut(t,p){if(t&1&&(o(0,"ul",27),g(1,ht,2,1,"li",22),a()),t&2){let e=h().$implicit;r(),d("ngForOf",e.ActionString)}}function ft(t,p){if(t&1&&(o(0,"span",28),S(1,"i",29),a()),t&2){let e=h().$implicit;me("title","Delivery : ",e.DeliveryState,`
2
2
  Payment : `,e.PaymentState,"")}}function _t(t,p){if(t&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td"),s(4),a(),g(5,mt,3,4,"td",23),o(6,"td")(7,"span"),s(8),a(),s(9),a(),o(10,"td",24)(11,"span"),s(12),a(),s(13),a(),o(14,"td"),g(15,ct,2,1,"span",23)(16,ut,2,1,"ul",25),a(),o(17,"td"),g(18,ft,2,3,"span",26),a()()),t&2){let e,n=p.$implicit,i=p.index,l=h(2);r(2),V(i+1),r(2),V(n.Number),r(),d("ngIf",((e=l.selectedChannel())==null?null:e.TypeID)!=l.channelType.Shopee&&((e=l.selectedChannel())==null?null:e.TypeID)!==l.channelType.Tiktok),r(3),C("",n.ChannelStatus," - "),r(),C("",n.ChannelStatusDescription," "),r(),d("ngClass",_e(12,pt,(n==null?null:n.Action)==l.actionPreviewOrder.Update,(n==null?null:n.Action)==l.actionPreviewOrder.New))("matTooltip",n.POSStatus==91||n.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),r(2),C("",n.POSStatus," - "),r(),C("",n.POSStatusDescription," "),r(2),d("ngIf",n.ActionString.length==1),r(),d("ngIf",n.ActionString.length>1),r(2),d("ngIf",n.ChannelStatus!=99&&n.POSStatus!=99)}}function gt(t,p){if(t&1&&(O(0),g(1,_t,19,15,"tr",22),N()),t&2){let e=h();r(),d("ngForOf",e.displayPreviewData())}}function wt(t,p){t&1&&(o(0,"tr",30)(1,"td",31)(2,"div",32),S(3,"i",33),a(),o(4,"h4",34),s(5," There is no order to processed "),a()()())}var Ze=(()=>{class t{constructor(){this.orderPreview=k(),this.selectedChannel=k(),this.channelType=X,this.allData=_(0),this.syncData=_(0),this.wrongData=_(0),this.unsyncData=_(0),this.pillStatus=_(D.ALL),this.actionPreviewOrder=$,this.previewStatus=D,this.displayPreviewData=_([]),this.exportOrders=new j,Q(()=>{this.orderPreview()&&(this.filterPreviewData(D.ALL),this.initLengthStatusData())},{allowSignalWrites:!0})}filterPreviewData(e){this.pillStatus.update(()=>e),this.displayPreviewData.update(()=>this.filterDataByStatus(e))}initLengthStatusData(){this.wrongData.update(()=>this.filterDataByStatus(D.WRONG).length),this.syncData.update(()=>this.filterDataByStatus(D.SYNC).length),this.allData.update(()=>this.orderPreview().length),this.unsyncData.update(()=>this.filterDataByStatus(D.UNSYNC).length)}filterDataByStatus(e){let n=[];switch(e){case D.ALL:n=this.orderPreview();break;case D.SYNC:n=this.orderPreview().filter(i=>i.Action==$.DoNothing);break;case D.WRONG:n=this.orderPreview().filter(i=>i.Action==$.Update);break;case D.UNSYNC:n=this.orderPreview().filter(i=>i.Action==$.New);break}return n}onExportOrders(){this.exportOrders.emit()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["preview-step"]],inputs:{orderPreview:[1,"orderPreview"],selectedChannel:[1,"selectedChannel"]},outputs:{exportOrders:"onExportOrders"},decls:41,vars:11,consts:[["EMPTY",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["width","15%"],[4,"ngFor","ngForOf"],[4,"ngIf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1){let l=x();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div")(5,"ul",5)(6,"li",6)(7,"button",7),w("click",function(){return m(l),c(i.filterPreviewData(i.previewStatus.ALL))}),s(8),a()(),o(9,"li",8)(10,"button",9),w("click",function(){return m(l),c(i.filterPreviewData(i.previewStatus.SYNC))}),s(11),a()(),o(12,"li",8)(13,"button",10),w("click",function(){return m(l),c(i.filterPreviewData(i.previewStatus.WRONG))}),s(14),a()(),o(15,"li",8)(16,"button",11),w("click",function(){return m(l),c(i.filterPreviewData(i.previewStatus.UNSYNC))}),s(17),a()()()(),o(18,"div")(19,"button",12),w("click",function(){return m(l),c(i.onExportOrders())}),S(20,"i",13),o(21,"span"),s(22,"Export"),a()()()()(),o(23,"table",14)(24,"thead",15)(25,"tr"),S(26,"th",16),o(27,"th",17),s(28,"Number"),a(),g(29,dt,2,1,"th",18),o(30,"th",19),s(31,"Channel Status"),a(),o(32,"th",19),s(33,"POS Status"),a(),o(34,"th"),s(35,"Action"),a(),S(36,"th",16),a()(),o(37,"tbody"),g(38,gt,2,1,"ng-container",20)(39,wt,6,0,"ng-template",null,0,H),a()()()()}if(n&2){let l,u,f=T(40);r(7),d("ngClass",i.pillStatus()=="all"?"btn-secondary text-white":"btn-outline-dark"),r(),C(" All (",i.allData(),") "),r(2),d("ngClass",i.pillStatus()=="sync"?"btn-success":"btn-outline-success"),r(),C(" Existing (",i.syncData(),") "),r(2),d("ngClass",i.pillStatus()=="wrong"?"btn-warning text-white":"btn-outline-warning"),r(),C(" Wrong Status (",i.wrongData(),") "),r(2),d("ngClass",i.pillStatus()=="unsync"?"btn-danger":"btn-outline-danger"),r(),C(" Missing (",i.unsyncData(),") "),r(12),d("ngIf",((l=i.selectedChannel())==null?null:l.TypeID)!=i.channelType.Shopee&&((l=i.selectedChannel())==null?null:l.TypeID)!==i.channelType.Tiktok),r(9),d("ngIf",((u=i.displayPreviewData())==null?null:u.length)>0)("ngIfElse",f)}},dependencies:[F,W,B,L,J,Ve,Me],encapsulation:2})}}return t})();var St=["stepper"];function Ct(t,p){if(t&1){let e=x();o(0,"div",2)(1,"button",19),w("click",function(){m(e);let i=h();return c(i.onStepperBack())}),s(2," Back "),a(),o(3,"button",20),w("click",function(){m(e);let i=h();return c(i.onNextStep())}),s(4," Next "),a()()}if(t&2){let e=h();r(3),d("disabled",e.disabledNextFilter())}}function vt(t,p){if(t&1){let e=x();o(0,"button",21),w("click",function(){m(e);let i=h();return c(i.onNextStep())}),s(1," Next "),a()}if(t&2){let e=h();d("disabled",e.disabledNextFilter())}}function yt(t,p){if(t&1){let e=x();o(0,"button",22),w("click",function(){m(e);let i=h();return c(i.onNewDownload())}),S(1,"i",23),s(2," New "),a()}}function xt(t,p){t&1&&(S(0,"i",24),o(1,"span"),s(2,"Filter"),a())}function Dt(t,p){t&1&&(S(0,"i",25),o(1,"span"),s(2,"Preview"),a())}function Tt(t,p){if(t&1){let e=x();O(0),o(1,"preview-step",26),w("onExportOrders",function(){m(e);let i=h();return c(i.onExportOrders())}),a(),N()}if(t&2){let e=p.ngIf;r(),d("orderPreview",e)}}function bt(t,p){t&1&&(S(0,"i",27),o(1,"span"),s(2,"Finish"),a())}function Et(t,p){if(t&1&&(O(0),S(1,"complete-step",28),N()),t&2){let e=p.ngIf;r(),d("downloadResult",e)}}function Pt(t,p){t&1&&(o(0,"h6"),s(1,"1"),a())}function It(t,p){t&1&&(o(0,"h6"),s(1,"2"),a())}function Mt(t,p){t&1&&(o(0,"h6"),s(1,"3"),a())}var Ui=(()=>{class t{constructor(){this.downloadService=v(A),this.orderService=v(ie),this.productService=v(Be),this.authService=v(ee),this.stepperSelectedIndex=_(0),this.disabledNextFilter=_(!0),this.isResetFilter=_(!1),this.pageTitle=_("Download to POS"),this.cacheKey=_(y.GuidEMpty)}onFilterChange(e){this.filter=e,this.validateDisabledNext()}validateDisabledNext(){this.disabledNextFilter.update(()=>y.IsEmpty(this.filter?.channelId)||!y.isValidDate(this.filter.startDate)||!y.isValidDate(this.filter.endDate))}onNextStep(){switch(this.stepper.selectedIndex){case 0:this.onPreview();let e=this.productService.findChannelById(this.filter.channelId,this.authService.getChannels());this.setPageTitle(`Preview ${e?.Name}`);break;case 1:this.onDownload(),this.setPageTitle("Download");break}}onStepperNext(){this.stepper.selected.completed=!0,this.stepper.next()}onPreview(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,IsDisbursement:this.filter.downloadType};y.IsNotEmpty(this.filter.startTime)&&(e=oe(ae({},e),{TimeFrom:this.filter.startTime+":00",TimeTo:this.filter.endTime+":00"})),this.orderPreview$=this.downloadService.onPreviewOrder(e).pipe(Y(n=>{n.Data?.length>0&&(this.cacheKey.update(()=>n.CacheKey),this.onStepperNext())}),G(n=>n.Data),z(1))}onExportOrders(){let e={ID:this.filter.channelId,From:this.filter.startDate?this.filter.startDate:null,To:this.filter.endDate?this.filter.endDate:null},n=`Orders ${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)}`;this.orderService.exportOrders(e,n).subscribe()}onDownload(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,ListPreview:[],IsDisbursement:this.filter.downloadType,CacheKey:this.cacheKey()};this.downloadPreview$=this.orderPreview$.pipe(le(n=>(e.ListPreview=n,this.downloadService.getDownloadOrder(e))),Y(()=>{this.onStepperNext()}),z(1))}setPageTitle(e){this.pageTitle.update(()=>`
3
3
  ${e} (${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)})
4
4
  `)}onStepperBack(){this.stepper.previous(),this.pageTitle.update(()=>"Download to POS")}onNewDownload(){this.isResetFilter.update(()=>!0),this.stepper.reset(),this.stepperSelectedIndex.update(()=>0),this.orderPreview$=null,this.downloadPreview$=null,this.pageTitle.update(()=>"Download to POS")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["app-download-v2"]],viewQuery:function(n,i){if(n&1&&ce(St,5),n&2){let l;he(l=ue())&&(i.stepper=l.first)}},features:[K([A,ie,{provide:Ue,useValue:{displayDefaultIndicatorType:!1}}])],decls:26,vars:20,consts:[["stepper",""],[3,"hideSearchBox","hideSearchDropdown","headerTitle","description"],[1,"btn-group","me-3"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"disabled"],[1,"btn","btn-outline-secondary","btn-fill"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectedIndexChange","ngClass","selectedIndex"],["state","filter",3,"completed","editable"],["matStepLabel",""],[1,"w-100",3,"onFilterChange","reset"],["state","preview",3,"editable","completed"],[4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"fa-solid","fa-filter","me-3"],[1,"fa-solid","fa-file","me-3"],[3,"onExportOrders","orderPreview"],[1,"fa-solid","fa-flag","me-3"],[3,"downloadResult"]],template:function(n,i){if(n&1){let l=x();o(0,"mainpanel",1)(1,"actions"),g(2,Ct,5,1,"div",2)(3,vt,2,1,"button",3)(4,yt,3,0,"button",4),a(),o(5,"content")(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"mat-stepper",9,0),P("selectedIndexChange",function(f){return m(l),E(i.stepperSelectedIndex,f)||(i.stepperSelectedIndex=f),c(f)}),o(12,"mat-step",10),g(13,xt,3,0,"ng-template",11),o(14,"filter-step",12),w("onFilterChange",function(f){return m(l),c(i.onFilterChange(f))}),a()(),o(15,"mat-step",13),g(16,Dt,3,0,"ng-template",11)(17,Tt,2,1,"ng-container",14),R(18,"async"),a(),o(19,"mat-step",15),g(20,bt,3,0,"ng-template",11)(21,Et,2,1,"ng-container",14),R(22,"async"),a(),g(23,Pt,2,0,"ng-template",16)(24,It,2,0,"ng-template",17)(25,Mt,2,0,"ng-template",18),a()()()()()()()}if(n&2){let l=T(11);d("hideSearchBox",!0)("hideSearchDropdown",!0)("headerTitle",i.pageTitle())("description",i.pageTitle()),r(2),M(i.stepperSelectedIndex()==1?2:-1),r(),M(i.stepperSelectedIndex()==0?3:-1),r(),M(i.stepperSelectedIndex()==2?4:-1),r(6),de("ngClass","last-edited-step-"+l.selectedIndex),b("selectedIndex",i.stepperSelectedIndex),r(2),d("completed",!1)("editable",i.stepperSelectedIndex()!=2),r(2),d("reset",i.isResetFilter()),r(),d("editable",i.stepperSelectedIndex()!=2)("completed",!1),r(2),d("ngIf",U(18,16,i.orderPreview$)),r(4),d("ngIf",U(22,18,i.downloadPreview$))}},dependencies:[F,W,L,q,Je,Xe,Ze,Qe,Ke,Ge,He,je,ke,Fe,we],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{padding-top:.8rem;padding-bottom:.8rem}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
@@ -1,3 +1,3 @@
1
- import{a as T}from"./chunk-Z3ITXK3D.js";import{a as Qe}from"./chunk-ACIMXBIC.js";import{a as Ke,b as me,c as ze,d as Ve,e as Se,f as qe,g as ve,h as Ge,i as G,j as Ae,k as y}from"./chunk-TGMCGROM.js";import{a as Ye}from"./chunk-5HO2IJ47.js";import{b as ge,c as ee}from"./chunk-PW42BQIY.js";import{a as Xe}from"./chunk-SWQXSJ7O.js";import{a as Je}from"./chunk-AEOSNAHH.js";import{e as te}from"./chunk-JXSBFTQM.js";import{b as Ze}from"./chunk-ATZ475FN.js";import{G as We,n as $e,o as Ue,p as He}from"./chunk-M2FCTYGU.js";import{F as Oe,G as Me,Hb as U,La as L,O as ue,Ra as fe,T as Ne,Wa as $,Z as de,aa as x,ba as he,c as g,dd as Fe,ea as V,ed as Le,f as Y,id as q,j as xe,ja as k,k as Re,ka as B,ma as b,n as K,o as Q,oa as h,p as R,pa as F,q as z,qa as Be,ua as pe,v as D,w as je}from"./chunk-B7KTCPKC.js";import{a as le,i as I}from"./chunk-66YHNWRR.js";var et={production:!0,version:"5.43.6",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var wt="firebase",kt="11.10.0";G(wt,kt,"app");var H=new Fe("ANGULARFIRE2_VERSION");var tt=(r,s)=>{let e=s?[s]:Ge(),t=[];return e.forEach(n=>{n.container.getProvider(r).instances.forEach(i=>{t.includes(i)||t.push(i)})}),t},we=function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r}(we||{}),Pr=q()&&typeof Zone<"u"?we.WARN:we.SILENT;var re=class{zone;delegate;constructor(s,e=Re){this.zone=s,this.delegate=e}now(){return this.delegate.now()}schedule(s,e,t){let n=this.zone,o=function(i){n?n.runGuarded(()=>{s.apply(this,[i])}):s.apply(this,[i])};return this.delegate.schedule(o,e,t)}},ke=(()=>{class r{outsideAngular;insideAngular;constructor(){let e=F(L);this.outsideAngular=e.runOutsideAngular(()=>new re(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new re(typeof Zone>"u"?void 0:Zone.current,xe))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var It=new Map,bt={activated:!1,tokenObservers:[]},Tt={initialized:!1,enabled:!1};function C(r){return It.get(r)||Object.assign({},bt)}function it(){return Tt}var yt="https://content-firebaseappcheck.googleapis.com/v1";var Ct="exchangeDebugToken",rt={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Lr=24*60*60*1e3;var be=class{constructor(s,e,t,n,o){if(this.operation=s,this.retryPolicy=e,this.getWaitDuration=t,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(s){return I(this,null,function*(){this.stop();try{this.pending=new me,this.pending.promise.catch(e=>{}),yield Pt(this.getNextRun(s)),this.pending.resolve(),yield this.pending.promise,this.pending=new me,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(s){if(s)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function Pt(r){return new Promise(s=>{setTimeout(s,r)})}var Dt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},j=new Ve("appCheck","AppCheck",Dt);function st(r){if(!C(r).activated)throw j.create("use-before-activation",{appName:r.name})}function at(t,n){return I(this,arguments,function*({url:r,body:s},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let f=yield i.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(s),headers:o},l;try{l=yield fetch(r,a)}catch(f){throw j.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw j.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw j.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw j.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:c.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function ct(r,s){let{projectId:e,appId:t,apiKey:n}=r.options;return{url:`${yt}/projects/${e}/apps/${t}:${Ct}?key=${n}`,body:{debug_token:s}}}var _t="firebase-app-check-database",xt=1,Te="firebase-app-check-store";var ne=null;function Rt(){return ne||(ne=new Promise((r,s)=>{try{let e=indexedDB.open(_t,xt);e.onsuccess=t=>{r(t.target.result)},e.onerror=t=>{var n;s(j.create("storage-open",{originalErrorMessage:(n=t.target.error)===null||n===void 0?void 0:n.message}))},e.onupgradeneeded=t=>{let n=t.target.result;switch(t.oldVersion){case 0:n.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(e){s(j.create("storage-open",{originalErrorMessage:e?.message}))}}),ne)}function jt(r,s){return Ot(Mt(r),s)}function Ot(r,s){return I(this,null,function*(){let t=(yield Rt()).transaction(Te,"readwrite"),o=t.objectStore(Te).put({compositeKey:r,value:s});return new Promise((i,a)=>{o.onsuccess=l=>{i()},t.onerror=l=>{var c;a(j.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Mt(r){return`${r.options.appId}-${r.name}`}var Z=new qe("@firebase/app-check");function Ee(r,s){return ze()?jt(r,s).catch(e=>{Z.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function lt(){return it().enabled}function ut(){return I(this,null,function*(){let r=it();if(r.enabled&&r.token)return r.token.promise;throw Error(`
1
+ import{a as T}from"./chunk-Z3ITXK3D.js";import{a as Qe}from"./chunk-ACIMXBIC.js";import{a as Ke,b as me,c as ze,d as Ve,e as Se,f as qe,g as ve,h as Ge,i as G,j as Ae,k as y}from"./chunk-TGMCGROM.js";import{a as Ye}from"./chunk-5HO2IJ47.js";import{b as ge,c as ee}from"./chunk-PW42BQIY.js";import{a as Xe}from"./chunk-SWQXSJ7O.js";import{a as Je}from"./chunk-AEOSNAHH.js";import{e as te}from"./chunk-JXSBFTQM.js";import{b as Ze}from"./chunk-ATZ475FN.js";import{G as We,n as $e,o as Ue,p as He}from"./chunk-M2FCTYGU.js";import{F as Oe,G as Me,Hb as U,La as L,O as ue,Ra as fe,T as Ne,Wa as $,Z as de,aa as x,ba as he,c as g,dd as Fe,ea as V,ed as Le,f as Y,id as q,j as xe,ja as k,k as Re,ka as B,ma as b,n as K,o as Q,oa as h,p as R,pa as F,q as z,qa as Be,ua as pe,v as D,w as je}from"./chunk-B7KTCPKC.js";import{a as le,i as I}from"./chunk-66YHNWRR.js";var et={production:!0,version:"5.43.7",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var wt="firebase",kt="11.10.0";G(wt,kt,"app");var H=new Fe("ANGULARFIRE2_VERSION");var tt=(r,s)=>{let e=s?[s]:Ge(),t=[];return e.forEach(n=>{n.container.getProvider(r).instances.forEach(i=>{t.includes(i)||t.push(i)})}),t},we=function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r}(we||{}),Pr=q()&&typeof Zone<"u"?we.WARN:we.SILENT;var re=class{zone;delegate;constructor(s,e=Re){this.zone=s,this.delegate=e}now(){return this.delegate.now()}schedule(s,e,t){let n=this.zone,o=function(i){n?n.runGuarded(()=>{s.apply(this,[i])}):s.apply(this,[i])};return this.delegate.schedule(o,e,t)}},ke=(()=>{class r{outsideAngular;insideAngular;constructor(){let e=F(L);this.outsideAngular=e.runOutsideAngular(()=>new re(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new re(typeof Zone>"u"?void 0:Zone.current,xe))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var It=new Map,bt={activated:!1,tokenObservers:[]},Tt={initialized:!1,enabled:!1};function C(r){return It.get(r)||Object.assign({},bt)}function it(){return Tt}var yt="https://content-firebaseappcheck.googleapis.com/v1";var Ct="exchangeDebugToken",rt={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Lr=24*60*60*1e3;var be=class{constructor(s,e,t,n,o){if(this.operation=s,this.retryPolicy=e,this.getWaitDuration=t,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(s){return I(this,null,function*(){this.stop();try{this.pending=new me,this.pending.promise.catch(e=>{}),yield Pt(this.getNextRun(s)),this.pending.resolve(),yield this.pending.promise,this.pending=new me,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(s){if(s)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function Pt(r){return new Promise(s=>{setTimeout(s,r)})}var Dt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},j=new Ve("appCheck","AppCheck",Dt);function st(r){if(!C(r).activated)throw j.create("use-before-activation",{appName:r.name})}function at(t,n){return I(this,arguments,function*({url:r,body:s},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let f=yield i.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(s),headers:o},l;try{l=yield fetch(r,a)}catch(f){throw j.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw j.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw j.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw j.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:c.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function ct(r,s){let{projectId:e,appId:t,apiKey:n}=r.options;return{url:`${yt}/projects/${e}/apps/${t}:${Ct}?key=${n}`,body:{debug_token:s}}}var _t="firebase-app-check-database",xt=1,Te="firebase-app-check-store";var ne=null;function Rt(){return ne||(ne=new Promise((r,s)=>{try{let e=indexedDB.open(_t,xt);e.onsuccess=t=>{r(t.target.result)},e.onerror=t=>{var n;s(j.create("storage-open",{originalErrorMessage:(n=t.target.error)===null||n===void 0?void 0:n.message}))},e.onupgradeneeded=t=>{let n=t.target.result;switch(t.oldVersion){case 0:n.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(e){s(j.create("storage-open",{originalErrorMessage:e?.message}))}}),ne)}function jt(r,s){return Ot(Mt(r),s)}function Ot(r,s){return I(this,null,function*(){let t=(yield Rt()).transaction(Te,"readwrite"),o=t.objectStore(Te).put({compositeKey:r,value:s});return new Promise((i,a)=>{o.onsuccess=l=>{i()},t.onerror=l=>{var c;a(j.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Mt(r){return`${r.options.appId}-${r.name}`}var Z=new qe("@firebase/app-check");function Ee(r,s){return ze()?jt(r,s).catch(e=>{Z.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function lt(){return it().enabled}function ut(){return I(this,null,function*(){let r=it();if(r.enabled&&r.token)return r.token.promise;throw Error(`
2
2
  Can't get debug token in production mode.
3
3
  `)})}var Nt={error:"UNKNOWN_ERROR"};function Bt(r){return Ke.encodeString(JSON.stringify(r),!1)}function ye(r,s=!1,e=!1){return I(this,null,function*(){let t=r.app;st(t);let n=C(t),o=n.token,i;if(o&&!J(o)&&(n.token=void 0,o=void 0),!o){let c=yield n.cachedTokenPromise;c&&(J(c)?o=c:yield Ee(t,void 0))}if(!s&&o&&J(o))return{token:o.token};let a=!1;if(lt())try{n.exchangeTokenPromise||(n.exchangeTokenPromise=at(ct(t,yield ut()),r.heartbeatServiceProvider).finally(()=>{n.exchangeTokenPromise=void 0}),a=!0);let c=yield n.exchangeTokenPromise;return yield Ee(t,c),n.token=c,{token:c.token}}catch(c){return c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?Z.warn(c.message):e&&Z.error(c),Ie(c)}try{n.exchangeTokenPromise||(n.exchangeTokenPromise=n.provider.getToken().finally(()=>{n.exchangeTokenPromise=void 0}),a=!0),o=yield C(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?Z.warn(c.message):e&&Z.error(c),i=c}let l;return o?i?J(o)?l={token:o.token,internalError:i}:l=Ie(i):(l={token:o.token},n.token=o,yield Ee(t,o)):l=Ie(i),a&&Ut(t,l),l})}function Ft(r){return I(this,null,function*(){let s=r.app;st(s);let{provider:e}=C(s);if(lt()){let t=yield ut(),{token:n}=yield at(ct(s,t),r.heartbeatServiceProvider);return{token:n}}else{let{token:t}=yield e.getToken();return{token:t}}})}function Lt(r,s,e,t){let{app:n}=r,o=C(n),i={next:e,error:t,type:s};if(o.tokenObservers=[...o.tokenObservers,i],o.token&&J(o.token)){let a=o.token;Promise.resolve().then(()=>{e({token:a.token}),nt(r)}).catch(()=>{})}o.cachedTokenPromise.then(()=>nt(r))}function dt(r,s){let e=C(r),t=e.tokenObservers.filter(n=>n.next!==s);t.length===0&&e.tokenRefresher&&e.tokenRefresher.isRunning()&&e.tokenRefresher.stop(),e.tokenObservers=t}function nt(r){let{app:s}=r,e=C(s),t=e.tokenRefresher;t||(t=$t(r),e.tokenRefresher=t),!t.isRunning()&&e.isTokenAutoRefreshEnabled&&t.start()}function $t(r){let{app:s}=r;return new be(()=>I(null,null,function*(){let e=C(s),t;if(e.token?t=yield ye(r,!0):t=yield ye(r),t.error)throw t.error;if(t.internalError)throw t.internalError}),()=>!0,()=>{let e=C(s);if(e.token){let t=e.token.issuedAtTimeMillis+(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)*.5+3e5,n=e.token.expireTimeMillis-5*60*1e3;return t=Math.min(t,n),Math.max(0,t-Date.now())}else return 0},rt.RETRIAL_MIN_WAIT,rt.RETRIAL_MAX_WAIT)}function Ut(r,s){let e=C(r).tokenObservers;for(let t of e)try{t.type==="EXTERNAL"&&s.error!=null?t.error(s.error):t.next(s)}catch{}}function J(r){return r.expireTimeMillis-Date.now()>0}function Ie(r){return{token:Bt(Nt),error:r}}var Ce=class{constructor(s,e){this.app=s,this.heartbeatServiceProvider=e}_delete(){let{tokenObservers:s}=C(this.app);for(let e of s)dt(this.app,e.next);return Promise.resolve()}};function Ht(r,s){return new Ce(r,s)}function Wt(r){return{getToken:s=>ye(r,s),getLimitedUseToken:()=>Ft(r),addTokenListener:s=>Lt(r,"INTERNAL",s),removeTokenListener:s=>dt(r.app,s)}}var Kt="@firebase/app-check",zt="0.10.1";var Vt="app-check",ot="app-check-internal";function qt(){ve(new Se(Vt,r=>{let s=r.getProvider("app").getImmediate(),e=r.getProvider("heartbeat");return Ht(s,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,s,e)=>{r.getProvider(ot).initialize()})),ve(new Se(ot,r=>{let s=r.getProvider("app-check").getImmediate();return Wt(s)},"PUBLIC").setInstantiationMode("EXPLICIT")),G(Kt,zt)}qt();var Gt="app-check";var oe=class{constructor(){return tt(Gt)}};var Zt=["localhost","0.0.0.0","127.0.0.1"],en=typeof window<"u"&&Zt.includes(window.location.hostname);var Xt="firebase",Yt="11.10.0";y.registerVersion(Xt,Yt,"app-compat");var Qt=["ngOnDestroy"],pt=(r,s,e,t={})=>new Proxy(r,{get:(n,o)=>e.runOutsideAngular(()=>{if(r[o])return t?.spy?.get&&t.spy.get(o,r[o]),r[o];if(Qt.indexOf(o)>-1)return()=>{};let i=s.toPromise().then(a=>{let l=a?.[o];return typeof l=="function"?l.bind(a):l?.then?l.then(c=>e.run(()=>c)):e.run(()=>l)});return new Proxy(()=>{},{get:(a,l)=>i[l],apply:(a,l,c)=>i.then(d=>{let u=d?.(...c);return t?.spy?.apply&&t.spy.apply(o,c,u),u})})})});var ie=class{constructor(s){return s}},se=new b("angularfire2.app.options"),ae=new b("angularfire2.app.name");function Pe(r,s,e){let t=typeof e=="string"&&e||"[DEFAULT]",n=typeof e=="object"&&e||{};n.name=n.name||t;let i=y.apps.filter(a=>a&&a.name===n.name)[0]||s.runOutsideAngular(()=>y.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(i.options)){let a=!!module.hot;er("error",`${i.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ie(i)}var er=(r,...s)=>{q()&&typeof console<"u"&&console[r](...s)},tr={provide:ie,useFactory:Pe,deps:[se,L,[new Be,ae]]},Go=(()=>{class r{static initializeApp(e,t){return{ngModule:r,providers:[{provide:se,useValue:e},{provide:ae,useValue:t}]}}constructor(e){y.registerVersion("angularfire",H.full,"core"),y.registerVersion("angularfire",H.full,"app-compat"),y.registerVersion("angular",Le.full,e.toString())}static \u0275fac=function(t){return new(t||r)(h($))};static \u0275mod=U({type:r});static \u0275inj=B({providers:[tr]})}return r})();function ft(r,s,e,t,n){let[,o,i]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(o)return rr(n,i)||(ht("error",`${s} was already initialized on the ${e} Firebase App with different settings.${nr?" You may need to reload as Firebase is not HMR aware.":""}`),ht("warn",{is:n,was:i})),o;{let a=t();return globalThis.\u0275AngularfireInstanceCache.push([r,a,n]),a}}function rr(r,s){try{return r.toString()===s.toString()}catch{return r===s}}var nr=typeof module<"u"&&!!module.hot,ht=(r,...s)=>{q()&&typeof console<"u"&&console[r](...s)};globalThis.\u0275AngularfireInstanceCache||=[];var or=new b("angularfire2.auth.use-emulator"),ir=new b("angularfire2.auth.settings"),sr=new b("angularfire2.auth.tenant-id"),ar=new b("angularfire2.auth.langugage-code"),cr=new b("angularfire2.auth.use-device-language"),lr=new b("angularfire.auth.persistence"),ur=(r,s,e,t,n,o,i,a)=>ft(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let l=s.runOutsideAngular(()=>r.auth());if(e&&l.useEmulator(...e),t&&(l.tenantId=t),l.languageCode=n,o&&l.useDeviceLanguage(),i)for(let[c,d]of Object.entries(i))l.settings[c]=d;return a&&l.setPersistence(a),l},[e,t,n,o,i,a]),De=(()=>{class r{injector=F(pe);authState;idToken;user;idTokenResult;credential;constructor(e,t,n,o,i,a,l,c,d,u,p,f){let W=new Y,O=z(void 0).pipe(K(i.outsideAngular),x(()=>o.runOutsideAngular(()=>import("./chunk-GCECFUOP.js"))),D(()=>Pe(e,o,t)),D(P=>ur(P,o,a,c,d,u,l,p)),de({bufferSize:1,refCount:!1}));if(He(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=z(null);else{O.pipe(Ne()).subscribe();let P=O.pipe(x(S=>S.getRedirectResult().then(_=>_,()=>null)),Ze(this.injector),de({bufferSize:1,refCount:!1})),X=O.pipe(x(S=>new g(_=>({unsubscribe:o.runOutsideAngular(()=>S.onAuthStateChanged(M=>_.next(M),M=>_.error(M),()=>_.complete()))})))),ce=O.pipe(x(S=>new g(_=>({unsubscribe:o.runOutsideAngular(()=>S.onIdTokenChanged(M=>_.next(M),M=>_.error(M),()=>_.complete()))}))));this.authState=P.pipe(he(X),Q(i.outsideAngular),K(i.insideAngular)),this.user=P.pipe(he(ce),Q(i.outsideAngular),K(i.insideAngular)),this.idToken=this.user.pipe(x(S=>S?R(S.getIdToken()):z(null))),this.idTokenResult=this.user.pipe(x(S=>S?R(S.getIdTokenResult()):z(null))),this.credential=Oe(P,W,this.authState.pipe(Me(S=>!S))).pipe(D(S=>S?.user?S:null),Q(i.outsideAngular),K(i.insideAngular))}return pt(this,O,o,{spy:{apply:(P,X,ce)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&ce.then(S=>W.next(S))}}})}static \u0275fac=function(t){return new(t||r)(h(se),h(ae,8),h($),h(L),h(ke),h(or,8),h(ir,8),h(sr,8),h(ar,8),h(cr,8),h(lr,8),h(oe,8))};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),ui=(()=>{class r{constructor(){y.registerVersion("angularfire",H.full,"auth-compat")}static \u0275fac=function(t){return new(t||r)};static \u0275mod=U({type:r});static \u0275inj=B({providers:[De]})}return r})();function m(r,s,e,t){return new Promise((n,o)=>{r||o("IndexedDB not available");let i=r.open(s,e),a;i.onsuccess=l=>{a=i.result,n(a)},i.onerror=l=>{o(`IndexedDB error: ${i.error}`)},typeof t=="function"&&(i.onupgradeneeded=l=>{t(l,a)})})}function gt(r,s,e,t,n){if(!r)return;let o=r.open(s,e);o.onupgradeneeded=i=>{let a=i.target.result;t.forEach(c=>{if(!a.objectStoreNames.contains(c.store)){let d=a.createObjectStore(c.store,c.storeConfig);c.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let l=n&&n();l&&Object.keys(l).map(c=>parseInt(c,10)).filter(c=>c>i.oldVersion).sort((c,d)=>c-d).forEach(c=>{l[c](a,o.transaction)}),a.close()},o.onsuccess=i=>{i.target.result.close()}}function hr(r,s,e){if(!r||!s||!e)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(t=>{try{let n=s+1,o=indexedDB.open(r,n);o.onupgradeneeded=i=>{let a=i.target.result;a.deleteObjectStore(e),a.close(),console.log("onupgradeneeded"),t.next(!0),t.complete()},o.onerror=i=>t.error(i)}catch(n){t.error(n)}})}function pr(r,s){return r.objectStoreNames.contains(s)}function E(r,s,e){r||e("You need to use the openDatabase function to create a database before you query it!"),pr(r,s)||e(`objectStore does not exists: ${s}`)}function A(r,s){let e=r.transaction(s.storeName,s.dbMode);return e.onerror=s.error,e.onabort=s.abort,e}function w(r,s,e,t){return{storeName:s,dbMode:r,error:n=>{e(n)},abort:n=>{e(n)}}}var v=function(r){return r.readonly="readonly",r.readwrite="readwrite",r}(v||{}),mt=new b(null),_e=(()=>{class r{constructor(e,t){if(this.dbConfig=e,this.platformId=t,!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!e.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Ue(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,gt(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),m(this.indexedDB,e.name).then(n=>{n.version!==e.version&&(this.dbConfig.version=n.version)}))}createObjectStore(e,t){let n=[e];gt(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,t)}add(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let l=A(i,w(v.readwrite,e,d=>o.error(d))).objectStore(e),c=n?l.add(t,n):l.add(t);c.onsuccess=d=>I(this,null,function*(){let u=d.target.result,p=l.get(u);p.onsuccess=f=>{o.next(f.target.result),o.complete()}})}).catch(i=>o.error(i))})}bulkAdd(e,t){let n=new Promise((o,i)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let c=A(a,w(v.readwrite,e,o,i)).objectStore(e),d=t.map(u=>new Promise((p,f)=>{let W=u.key;delete u.key;let O=W?c.add(u,W):c.add(u);O.onsuccess=P=>{let X=P.target.result;p(X)}}));o(Promise.all(d))}).catch(a=>i(a))});return R(n)}bulkDelete(e,t){let n=t.map(o=>new Promise((i,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(l=>{let c=A(l,w(v.readwrite,e,a,i));c.objectStore(e).delete(o),c.oncomplete=()=>{this.getAll(e).pipe(ue(1)).subscribe(u=>{i(u)})}}).catch(l=>a(l))}));return R(Promise.all(n))}getByKey(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{let l=A(o,w(v.readonly,e,n.error)).objectStore(e).get(t);l.onsuccess=c=>{n.next(c.target.result),n.complete()},l.onerror=c=>{n.error(c)}}).catch(o=>n.error(o))})}bulkGet(e,t){let n=t.map(o=>this.getByKey(e,o));return new g(o=>{je(n).subscribe(i=>{o.next(i),o.complete()})})}getByID(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,c=>n.error(c));let l=A(o,w(v.readonly,e,n.error,n.next)).objectStore(e).get(t);l.onsuccess=c=>{n.next(c.target.result)}}).catch(o=>n.error(o))})}getByIndex(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{E(i,e,u=>o.error(u));let d=A(i,w(v.readonly,e,o.error)).objectStore(e).index(t).get(n);d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}getAll(e){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{E(n,e,l=>t.error(l));let a=A(n,w(v.readonly,e,t.error,t.next)).objectStore(e).getAll();a.onerror=l=>{t.error(l)},a.onsuccess=({target:{result:l}})=>{t.next(l),t.complete()}}).catch(n=>t.error(n))})}update(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,c=>n.error(c));let a=A(o,w(v.readwrite,e,c=>n.error(c))).objectStore(e),l=a.put(t);l.onsuccess=c=>I(this,null,function*(){let d=c.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(o=>n.error(o))})}delete(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,l=>n.error(l));let i=A(o,w(v.readwrite,e,l=>n.error(l)));i.objectStore(e).delete(t),i.oncomplete=()=>{this.getAll(e).pipe(ue(1)).subscribe(l=>{n.next(l),n.complete()})}}).catch(o=>n.error(o))})}deleteByKey(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,l=>n.error(l));let i=A(o,w(v.readwrite,e,l=>n.error(l))),a=i.objectStore(e);i.oncomplete=()=>{n.next(!0),n.complete()},a.delete(t)}).catch(o=>n.error(o))})}clear(e){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{E(n,e,a=>t.error(a));let o=A(n,w(v.readwrite,e,a=>t.error(a)));o.objectStore(e).clear(),o.oncomplete=()=>{t.next(!0),t.complete()}}).catch(n=>t.error(n))})}deleteDatabase(){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(t=>I(this,null,function*(){yield t.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{e.next(!0),e.complete()},n.onerror=o=>e.error(o),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(t=>e.error(t))})}openCursor(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,c=>n.error(c));let a=A(o,w(v.readonly,e,n.error)).objectStore(e),l=t===void 0?a.openCursor():a.openCursor(t);l.onsuccess=c=>{n.next(c),n.complete()}}).catch(o=>n.error(o))})}openCursorByIndex(e,t,n,o=v.readonly){let i=new Y;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,e,p=>{i.error(p)});let u=A(a,w(o,e,p=>{i.error(p)},()=>{i.next()})).objectStore(e).index(t).openCursor(n);u.onsuccess=p=>{i.next(p)}}).catch(a=>i.error(a)),i}getAllByIndex(e,t,n){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,e,p=>i.error(p));let u=A(a,w(v.readonly,e,i.error)).objectStore(e).index(t).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push(f.value),f.continue()):(i.next(o),i.complete())}}).catch(a=>i.error(a))})}getAllKeysByIndex(e,t,n){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,e,p=>i.error(p));let u=A(a,w(v.readonly,e,i.error)).objectStore(e).index(t).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(i.next(o),i.complete())}}).catch(a=>i.error(a))})}count(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,c=>n.error(c));let l=A(o,w(v.readonly,e,n.error)).objectStore(e).count(t);l.onerror=c=>n.error(c),l.onsuccess=c=>{n.next(c.target.result),n.complete()}}).catch(o=>n.error(o))})}countByIndex(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{E(i,e,u=>o.error(u));let d=A(i,w(v.readonly,e,o.error)).objectStore(e).index(t).count(n);d.onerror=u=>o.error(u),d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}deleteObjectStore(e){return hr(this.dbConfig.name,++this.dbConfig.version,e)}}return r.\u0275fac=function(e){return new(e||r)(h(mt),h($))},r.\u0275prov=k({token:r,factory:r.\u0275fac}),r})(),vi=(()=>{class r{static forRoot(e){return{ngModule:r,providers:[_e,{provide:mt,useValue:e}]}}}return r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=U({type:r}),r.\u0275inj=B({imports:[[$e]]}),r})();var St=(()=>{class r{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,t){let n=this.getKey(t);return this.db.add(this.DATABASE,e,n).pipe(D(o=>e))}getCategoriesByChannelType(e){let t=this.getKey(e);return this.db.getByKey(this.DATABASE,t)}getKey(e){let t="";switch(e){case ge.Lazada:t="Lazada";break;case ge.Tokopedia:t="Tokopedia";break}return t}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}static{this.\u0275fac=function(t){return new(t||r)(h(_e))}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var vt=(()=>{class r{inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let t={Enabled:!0};e&&(t=le(le({},t),e)),localStorage.setItem("Intercom",JSON.stringify(t))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return ee.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var At=(()=>{class r{constructor(){this.httpService=F(te),this.currentUser=fe(null),this.tokenValue=fe(null)}refreshToken(){return this.httpService.get(Ye.RefreshToken).pipe(V(e=>{this.updateTokenInLocalStorage(e)}))}updateTokenInLocalStorage(e){this.saveUserToLocalStorage(e),this.saveChannelsToLocalStorage(e.Channels)}saveUserToLocalStorage(e){let t=JSON.stringify(e);localStorage.setItem(T.USER,t)}getUser(){if(this.currentUser())return this.currentUser();{let e=localStorage.getItem(T.USER);return this.currentUser.set(e?JSON.parse(e):null),this.currentUser()}}getTokenValue(){let e=this.getUser();if(!this.tokenValue()){let t=Qe.parseJwt(e?.Token.access_token);this.tokenValue.set(t)}return this.tokenValue()}saveChannelsToLocalStorage(e){let t=JSON.stringify(e);localStorage.setItem(T.CHANNELS,t)}getChannels(){let e=localStorage.getItem(T.CHANNELS);return e?JSON.parse(e):[]}clearStorage(){localStorage.removeItem(T.USER),localStorage.removeItem(T.CHANNELS),this.currentUser.set(null),this.tokenValue.set(null)}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var $i=(()=>{class r{constructor(e,t,n,o,i,a,l,c){this.httpService=e,this.tokenDecodeService=t,this.afAuth=n,this.ngxPermission=o,this.localDataService=i,this.router=a,this.intercomService=l,this.tokenService=c}login(e){return this.httpService.post("/api/token/Login",e).pipe(V(t=>{this.setLocalStorage(t,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(et.news).pipe(D(e=>e?.items?.map(t=>t?.properties)))}loginWithGoogle(e,t){e.preventDefault();let n=new Ae;return n.setCustomParameters({prompt:"select_account"}),R(this.afAuth.signInWithPopup(n)).pipe(D(o=>o.credential),D(o=>o.idToken),x(o=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:o,Host:t}))),V(o=>{this.setLocalStorage(o,t,null),this.loadPermissions()}))}setLocalStorage(e,t,n){this.tokenService.updateTokenInLocalStorage(e),localStorage.setItem(T.AUTHORIZATION,JSON.stringify({Host:t,username:n})),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem(T.USER);if(ee.IsNotEmpty(e)){let t=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(t)}}getChannels(){return this.tokenService.getChannels()}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=this.tokenService.getUser(),t=new Date;if(e!=null){let n=new Date(e.Token.expiredAt);return t<n?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem(T.AUTHORIZATION);this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.tokenService.clearStorage(),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}static{this.\u0275fac=function(t){return new(t||r)(h(te),h(Je),h(De),h(Xe),h(St),h(We),h(vt),h(At))}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{et as a,Go as b,ui as c,vi as d,St as e,vt as f,At as g,$i as h};
@@ -1 +1 @@
1
- import{h as u}from"./chunk-TFQEBAZY.js";import{a as p}from"./chunk-SWQXSJ7O.js";import{b as l}from"./chunk-JXSBFTQM.js";import{G as c}from"./chunk-M2FCTYGU.js";import{ja as a,oa as t}from"./chunk-B7KTCPKC.js";var S=(()=>{class e{constructor(o,i,r,s){this.toastr=o,this.authService=i,this.router=r,this.permissionService=s}canActivate(o,i){let r=JSON.parse(window.localStorage.getItem("user")),s=new Date,n=!1;if(r!=null){let h=new Date(r?.Token?.expiredAt);s<h?n=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return n}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(i){return new(i||e)(t(l),t(u),t(c),t(p))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{S as a};
1
+ import{h as u}from"./chunk-AEJ5I5MW.js";import{a as p}from"./chunk-SWQXSJ7O.js";import{b as l}from"./chunk-JXSBFTQM.js";import{G as c}from"./chunk-M2FCTYGU.js";import{ja as a,oa as t}from"./chunk-B7KTCPKC.js";var S=(()=>{class e{constructor(o,i,r,s){this.toastr=o,this.authService=i,this.router=r,this.permissionService=s}canActivate(o,i){let r=JSON.parse(window.localStorage.getItem("user")),s=new Date,n=!1;if(r!=null){let h=new Date(r?.Token?.expiredAt);s<h?n=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return n}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(i){return new(i||e)(t(l),t(u),t(c),t(p))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{S as a};
@@ -1 +1 @@
1
- import{a as Y}from"./chunk-FV47Y5BB.js";import"./chunk-TFQEBAZY.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as H}from"./chunk-5HO2IJ47.js";import{e as J}from"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{b as j,e as F}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as G,n as U}from"./chunk-CLER2MX6.js";import{A as R,c as B,h as D,m as I}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as P,l as W,n as k}from"./chunk-M2FCTYGU.js";import{$c as S,Gb as x,Gc as i,Hc as E,Kc as C,Lc as b,Mb as M,Mc as _,Nc as T,Oc as V,Pc as v,Ra as h,Yb as f,Z as y,ad as w,dc as O,ic as e,jc as t,kc as A,oc as L,pa as u,rb as d,tc as g,uc as N,ya as s,za as m}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function z(n,q){if(n&1&&(e(0,"pre",21),i(1),S(2,"json"),t()),n&2){N();let l=v(25);d(),E(w(2,1,l))}}function K(n,q){n&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var ce=(()=>{class n{constructor(){this.httpService=u(F),this.toastr=u(j),this.selectedChannel=h(null),this.orderNumber=h(null)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.orderLog$=this.httpService.post(H.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(y(1))}copyToClipboard(l){if(!l)return;let p=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(p),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-order-api"]],decls:40,vars:9,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","orderLogText"],[1,"text-center","my-12","text-muted"]],template:function(p,r){if(p&1){let a=L();e(0,"mainpanel",0)(1,"actions")(2,"button",1),g("click",function(){return s(a),m(r.fetchLog())}),A(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Order API activities. "),t()(),e(15,"div",9)(16,"channel-select-options",10),_("ngModelChange",function(o){return s(a),b(r.selectedChannel,o)||(r.selectedChannel=o),m(o)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),_("ngModelChange",function(o){return s(a),b(r.orderNumber,o)||(r.orderNumber=o),m(o)}),t()()()()(),T(25),S(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),g("click",function(){s(a);let o=v(25);return m(r.copyToClipboard(o))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),M(38,z,3,3,"pre",21)(39,K,2,0,"p",22),t()()()()()()()()()}if(p&2){f("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),C("ngModel",r.selectedChannel),d(8),C("ngModel",r.orderNumber),d();let a=V(w(26,6,r.orderLog$));d(8),f("disabled",!a),d(5),O(a?38:39)}},dependencies:[k,P,W,U,G,J,R,B,D,I,Y],encapsulation:2})}}return n})();export{ce as OrderApiComponent};
1
+ import{a as Y}from"./chunk-Q23GGWWT.js";import"./chunk-AEJ5I5MW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as H}from"./chunk-5HO2IJ47.js";import{e as J}from"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{b as j,e as F}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as G,n as U}from"./chunk-CLER2MX6.js";import{A as R,c as B,h as D,m as I}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as P,l as W,n as k}from"./chunk-M2FCTYGU.js";import{$c as S,Gb as x,Gc as i,Hc as E,Kc as C,Lc as b,Mb as M,Mc as _,Nc as T,Oc as V,Pc as v,Ra as h,Yb as f,Z as y,ad as w,dc as O,ic as e,jc as t,kc as A,oc as L,pa as u,rb as d,tc as g,uc as N,ya as s,za as m}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function z(n,q){if(n&1&&(e(0,"pre",21),i(1),S(2,"json"),t()),n&2){N();let l=v(25);d(),E(w(2,1,l))}}function K(n,q){n&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var ce=(()=>{class n{constructor(){this.httpService=u(F),this.toastr=u(j),this.selectedChannel=h(null),this.orderNumber=h(null)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.orderLog$=this.httpService.post(H.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(y(1))}copyToClipboard(l){if(!l)return;let p=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(p),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-order-api"]],decls:40,vars:9,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","orderLogText"],[1,"text-center","my-12","text-muted"]],template:function(p,r){if(p&1){let a=L();e(0,"mainpanel",0)(1,"actions")(2,"button",1),g("click",function(){return s(a),m(r.fetchLog())}),A(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Order API activities. "),t()(),e(15,"div",9)(16,"channel-select-options",10),_("ngModelChange",function(o){return s(a),b(r.selectedChannel,o)||(r.selectedChannel=o),m(o)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),_("ngModelChange",function(o){return s(a),b(r.orderNumber,o)||(r.orderNumber=o),m(o)}),t()()()()(),T(25),S(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),g("click",function(){s(a);let o=v(25);return m(r.copyToClipboard(o))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),M(38,z,3,3,"pre",21)(39,K,2,0,"p",22),t()()()()()()()()()}if(p&2){f("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),C("ngModel",r.selectedChannel),d(8),C("ngModel",r.orderNumber),d();let a=V(w(26,6,r.orderLog$));d(8),f("disabled",!a),d(5),O(a?38:39)}},dependencies:[k,P,W,U,G,J,R,B,D,I,Y],encapsulation:2})}}return n})();export{ce as OrderApiComponent};
@@ -1 +1 @@
1
- import{a as oe}from"./chunk-EPVCMYCI.js";import{a as le,b as re}from"./chunk-6FY74YFQ.js";import"./chunk-7ZXNQAAU.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{b as ae}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import{h as X}from"./chunk-TFQEBAZY.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-5JVEEL2T.js";import{c as K}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as Q}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as ne,n as ie}from"./chunk-CLER2MX6.js";import{A as G,h as H,m as U}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as V,k as J,l as W,n as k}from"./chunk-M2FCTYGU.js";import{$c as m,Gb as P,Gc as p,Hc as C,Ic as y,Kc as j,Lc as O,Mb as u,Mc as q,Qc as z,Yb as d,Z as M,aa as D,ad as c,bd as A,dc as R,ec as B,g as L,gc as T,hc as $,ic as i,ja as w,jc as a,kc as f,oc as F,pa as g,pb as S,rb as l,tc as v,uc as x,v as I,ya as E,za as N}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as _}from"./chunk-66YHNWRR.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function me(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function se(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td")(6,"span",18),p(7),m(8,"json"),a()(),i(9,"td"),p(10),m(11,"json"),a(),i(12,"td"),p(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(3),C(c(8,5,e.Request)),l(3),C(c(11,7,e.Response)),l(3),C(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function ce(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,se,15,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function de(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Oe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,me,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,ce,21,13,"div",8),m(13,"async"),u(14,de,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,oe,re,le,ae,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Oe as ChannelLogComponent};
1
+ import{a as oe}from"./chunk-EPVCMYCI.js";import{a as le,b as re}from"./chunk-6FY74YFQ.js";import"./chunk-7ZXNQAAU.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{b as ae}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import{h as X}from"./chunk-AEJ5I5MW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-5JVEEL2T.js";import{c as K}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as Q}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as ne,n as ie}from"./chunk-CLER2MX6.js";import{A as G,h as H,m as U}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as V,k as J,l as W,n as k}from"./chunk-M2FCTYGU.js";import{$c as m,Gb as P,Gc as p,Hc as C,Ic as y,Kc as j,Lc as O,Mb as u,Mc as q,Qc as z,Yb as d,Z as M,aa as D,ad as c,bd as A,dc as R,ec as B,g as L,gc as T,hc as $,ic as i,ja as w,jc as a,kc as f,oc as F,pa as g,pb as S,rb as l,tc as v,uc as x,v as I,ya as E,za as N}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as _}from"./chunk-66YHNWRR.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function me(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function se(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td")(6,"span",18),p(7),m(8,"json"),a()(),i(9,"td"),p(10),m(11,"json"),a(),i(12,"td"),p(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(3),C(c(8,5,e.Request)),l(3),C(c(11,7,e.Response)),l(3),C(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function ce(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,se,15,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function de(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Oe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,me,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,ce,21,13,"div",8),m(13,"async"),u(14,de,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,oe,re,le,ae,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Oe as ChannelLogComponent};
@@ -1 +1 @@
1
- import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-A4BNLR77.js").then(t=>t.OrdersV2Component)},children:[{path:"to-ship",loadComponent(){return import("./chunk-5QUVYPQN.js").then(t=>t.ReadyToShipComponent)},title:"To Ship"},{path:"awaiting-collection",loadComponent(){return import("./chunk-2K3EFH3T.js").then(t=>t.AwaitingCollectionComponent)},title:"Awaiting Collection"},{path:"shipped",loadComponent(){return import("./chunk-IGPHCUYF.js").then(t=>t.ShippedComponent)},title:"Shipped"},{path:"completed",loadComponent(){return import("./chunk-E5YB37LW.js").then(t=>t.CompletedComponent)},title:"Completed"},{path:"all",loadComponent(){return import("./chunk-VODOESU7.js").then(t=>t.AllComponent)},title:"All Orders"},{path:"cancelled",loadComponent(){return import("./chunk-SGPYMAEM.js").then(t=>t.CancelledComponent)},title:"Cancelled"},{path:"download",loadComponent(){return import("./chunk-7XS5EOCX.js").then(t=>t.DownloadV2Component)},title:"Download"},{path:"log",loadComponent(){return import("./chunk-5XVZHSH3.js").then(t=>t.DownloadOrderLogComponent)},title:"Download Log"},{path:"",pathMatch:"full",redirectTo:"to-ship"}]}];export{o as routes};
1
+ import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-A4BNLR77.js").then(t=>t.OrdersV2Component)},children:[{path:"to-ship",loadComponent(){return import("./chunk-YJHI5U5R.js").then(t=>t.ReadyToShipComponent)},title:"To Ship"},{path:"awaiting-collection",loadComponent(){return import("./chunk-LLDNDJ7P.js").then(t=>t.AwaitingCollectionComponent)},title:"Awaiting Collection"},{path:"shipped",loadComponent(){return import("./chunk-ESX7MIMG.js").then(t=>t.ShippedComponent)},title:"Shipped"},{path:"completed",loadComponent(){return import("./chunk-3BYIWPKX.js").then(t=>t.CompletedComponent)},title:"Completed"},{path:"all",loadComponent(){return import("./chunk-GJUPDABG.js").then(t=>t.AllComponent)},title:"All Orders"},{path:"cancelled",loadComponent(){return import("./chunk-FWG7M5IP.js").then(t=>t.CancelledComponent)},title:"Cancelled"},{path:"download",loadComponent(){return import("./chunk-6ZVXICIH.js").then(t=>t.DownloadV2Component)},title:"Download"},{path:"log",loadComponent(){return import("./chunk-ZJVWTRCI.js").then(t=>t.DownloadOrderLogComponent)},title:"Download Log"},{path:"",pathMatch:"full",redirectTo:"to-ship"}]}];export{o as routes};
@@ -1 +1 @@
1
- import{b as Me}from"./chunk-PFB7XEYZ.js";import"./chunk-UEPQYAWE.js";import{a as Ae,b as Pe,c as ke,d as ie,e as oe}from"./chunk-EQN7RM2H.js";import{a as we}from"./chunk-YHKEECJR.js";import{a as Ne,b as Ue}from"./chunk-BFU7VKO3.js";import{b as Ee}from"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import"./chunk-HAH7BBIR.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-DRHWRRQV.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-IA6KOBDJ.js";import"./chunk-RECNBAEB.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-5DIRXS7I.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as Fe,b as Te}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import"./chunk-TFQEBAZY.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{d as O,e as B}from"./chunk-5JVEEL2T.js";import{b as be,c as _}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{e as K}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Se,n as Ie}from"./chunk-CLER2MX6.js";import{A as Z,B as D,c as te,e as ge,h as $,i as H,m as ye,n as q,q as z,s as J,z as Y}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as ve,s as xe}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as V,j as x,n as S}from"./chunk-M2FCTYGU.js";import{$c as g,Gb as b,Gc as u,Hc as fe,Ic as Q,K as de,Ka as w,Kc as he,Lc as _e,M as ue,Mb as h,Mc as Ce,Oa as re,Qc as v,Yb as m,Z as ee,ad as y,dc as E,ea as A,ec as j,gc as R,hc as L,ic as l,ja as P,jc as r,kc as f,lc as N,mc as U,oc as M,pa as d,rb as s,tc as C,uc as a,v as T,xa as k,ya as I,za as F}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ae=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y),this.uploadProductService=d(oe)}getAttributes(e,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:t}]).pipe(de(o=>this.uploadProductService.selectedProduct$.pipe(T(c=>(o=this.mappingAttributeSalesProperty(o,c),o)))))}mappingAttributeSalesProperty(e,t){let n=0;return e.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(t),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(e){let t=!1,n=[];return e.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),t=n.some(o=>o>1),t}createFormGroup(e){let t=this.formBuilder.group({}),n=[];return e.forEach(o=>{n=[],o.is_required&&n.push(ge.required),t.addControl(o.id,this.formBuilder.control(null,n))}),t}getFilteredAttributes(e,t){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(t),c=n.filter(W=>o.findIndex(Be=>parseInt(Be)==W.id)!=-1);return c=this.filterSelectedAttributes(c,t),c}filterSelectedAttributes(e,t){return e.map(o=>(_.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(c=>t[o.id]?.includes(c.id)):o.values=o.values.filter(c=>c.id==t[o.id]):t[o.id]&&(o.values=[{id:null,name:t[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function Ge(i,p){i&1&&(l(0,"span",5),u(1,"*"),r())}function je(i,p){if(i&1&&f(0,"ng-select",6),i&2){let e=a().$implicit;m("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Re(i,p){if(i&1&&f(0,"ng-select",7),i&2){let e=a().$implicit;m("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Le(i,p){if(i&1&&f(0,"input",8),i&2){let e=a().$implicit;m("formControlName",e.id)("placeholder",e==null?null:e.name)}}function We(i,p){if(i&1&&(l(0,"small",5),u(1),r()),i&2){let e=a().$implicit;s(),Q(" ",e==null?null:e.name," is mandatory ")}}function He(i,p){if(i&1&&(l(0,"div",3)(1,"div",4),h(2,Ge,2,0,"span",5),l(3,"span"),u(4),r()(),h(5,je,1,4,"ng-select",6)(6,Re,1,3,"ng-select",7)(7,Le,1,2,"input",8)(8,We,2,1,"small",5),r()),i&2){let e=p.$implicit;s(2),E(e.is_required?2:-1),s(2),Q(" ",e==null?null:e.name," "),s(),E(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),s(3),E(e.is_required?8:-1)}}function qe(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2),R(3,He,9,4,"div",3,j),r()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(2),L(e)}}var Ve=(()=>{class i{constructor(){this.tiktokAttributeFormService=d(ae),this.attributesChanges=new w}ngOnChanges(){_.IsNotEmpty(this.categoryId)&&_.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(T(e=>e.filter(t=>!(t.type=="PRODUCT_PROPERTY"&&(_.IsEmpty(t.values)||t.values?.length==0)&&t.is_customizable==!1))),A(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),ee(1)))}listenToFormChange(e){let t=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{t=this.tiktokAttributeFormService.getFilteredAttributes(e,n),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[v([ae]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(t,n){t&1&&(h(0,qe,5,1,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,B,O,D,q,te,$,H,z,J,Z],encapsulation:2})}}return i})();var se=(()=>{class i{constructor(){this.woocommerceUploadService=d(ie)}getAttributes(e,t){return this.woocommerceUploadService.getAttributes(e,t).pipe(T(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();var $e=(()=>{class i{constructor(){this.wooAttributeFormService=d(se),this.channelId=re(),this.categoryId=re(),this.attributesChanges=new w}ngOnChanges(){_.IsNotEmpty(this.categoryId())&&_.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[v([se]),k],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(t,n){t&1&&(l(0,"div",0)(1,"div",1)(2,"div",2),u(3,"Atribut"),r(),l(4,"ng-select",3),g(5,"async"),C("change",function(c){return n.onSelectAttribute(c)}),r()()()),t&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,x,Z,B,O,D],encapsulation:2})}}return i})();var me=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y)}getAttributes(e,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:t}]).pipe(T(o=>o))}createFormGroup(e){let t=this.formBuilder.group({});return e.forEach(n=>{t.addControl(n.variant,this.formBuilder.control(null))}),t}convertAttributes(e={}){return Object.values(e).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function ze(i,p){if(i&1&&(l(0,"div",3)(1,"div",4),u(2),r(),f(3,"ng-select",5),r()),i&2){let e=p.$implicit;s(2),Q(" ",e==null?null:e.variant," "),s(),m("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function Je(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2),R(3,ze,4,4,"div",3,j),r()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(2),L(e)}}var De=(()=>{class i{constructor(){this.tokpedAttrFormService=d(me),this.attributesChanges=new w}ngOnInit(){}ngOnChanges(e){_.IsNotEmpty(this.categoryId)&&_.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(t=>{this.form=this.tokpedAttrFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(t=>{e=this.tokpedAttrFormService.convertAttributes(t),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[v([me]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(t,n){t&1&&(h(0,Je,5,1,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,B,O,D,q,$,H,z,J],encapsulation:2})}}return i})();var pe=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(e){let t=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(o=>{t.addControl(o,this.formBuilder.control(null))}),t}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function Ye(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),u(5," Brand "),r(),f(6,"input",5),r(),l(7,"div",6)(8,"div",4),u(9," Product Type "),r(),f(10,"input",7),r(),l(11,"div",6)(12,"div",4),u(13," Status "),r(),f(14,"ng-select",8),r()()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(13),m("items",e.Options.StatusOptions)}}var Oe=(()=>{class i{constructor(){this.attributesChanges=new w,this.shopifyFormService=d(pe)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(t=>{this.form=this.shopifyFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(ue(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[v([pe]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(t,n){t&1&&(h(0,Ye,15,2,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,D,q,te,$,H,z,J,B,O],encapsulation:2})}}return i})();function Ze(i,p){if(i&1&&(l(0,"div",6),f(1,"app-product-card",9),r()),i&2){let e=p.$implicit;s(),m("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function Ke(i,p){if(i&1){let e=M();N(0),l(1,"mat-checkbox",21),Ce("ngModelChange",function(n){I(e);let o=a().$implicit;return _e(o.selected,n)||(o.selected=n),F(n)}),C("ngModelChange",function(){let n=I(e).ngIf,o=a(),c=o.$implicit,W=o.$index,X=a();return F(X.onSelectChannel(c,W,n))}),r(),U()}if(i&2){let e=a().$implicit;s(),he("ngModel",e.selected)}}function Qe(i,p){if(i&1&&(l(0,"div",18),f(1,"input",22),r()),i&2){let e=a().$implicit,t=a();m("matTooltip",e.type==t.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":e.type==t.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Xe(i,p){if(i&1){let e=M();l(0,"app-channel-category-select",23),C("selectedCategory",function(n){I(e);let o=a().$index,c=a();return F(c.onCategoryChange(o,n))}),r()}if(i&2){let e=a().$implicit,t=a();m("disabled",!e.selected||e.selected&&e.type==t.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function et(i,p){if(i&1){let e=M();l(0,"shopee-attribute-form",27),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function tt(i,p){if(i&1){let e=M();l(0,"tiktok-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function it(i,p){if(i&1){let e=M();l(0,"wooocommerce-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function ot(i,p){if(i&1){let e=M();l(0,"tokopedia-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function nt(i,p){if(i&1&&(l(0,"div",20)(1,"div",24),h(2,et,1,3,"shopee-attribute-form",25)(3,tt,1,2,"tiktok-attribute-form",26)(4,it,1,2,"wooocommerce-attribute-form",26)(5,ot,1,2,"tokopedia-attribute-form",26),r()()),i&2){let e,t=a().$implicit,n=a();s(2),E((e=t.type)===n.channelType.Shopee?2:e===n.channelType.Tiktok?3:e===n.channelType.WooCommerce?4:e===n.channelType.Tokopedia?5:-1)}}function rt(i,p){if(i&1){let e=M();l(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),C("attributesChanges",function(n){I(e);let o=a().$index,c=a();return F(c.onAttributesChange(o,n))}),r()()()}if(i&2){let e=a().$implicit;s(2),m("channelId",e.id)}}function at(i,p){if(i&1&&(l(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Ke,2,1,"ng-container",14),g(7,"async"),r(),l(8,"div"),f(9,"app-channel-logo",15),r(),l(10,"div",16)(11,"span"),u(12),r()()()(),l(13,"div",12)(14,"div",17),h(15,Qe,2,1,"div",18)(16,Xe,1,4,"app-channel-category-select",19),r()()(),h(17,nt,6,1,"div",20)(18,rt,3,1,"div",20),r()()),i&2){let e=p.$implicit,t=a();s(6),m("ngIf",y(7,8,t.defaultCategories$)),s(3),m("typeId",e.type)("showChannelName",!1),s(),m("matTooltip",e.name)("matTooltipShowDelay",2500),s(2),fe(e.name),s(3),E(e.type==t.channelType.Shopify||e.type==t.channelType.Plugo?15:16),s(2),E(e.categoryId&&t.channelType.Lazada!=e.type&&e.selected?17:t.channelType.Shopify==e.type&&e.selected?18:-1)}}var qi=(()=>{class i{constructor(){this.uploadProductService=d(oe),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=be,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ee(1))}onCategoryChange(e,t){this.channelProductUploads.update(n=>n.map((o,c)=>(c==e&&(o.categoryId=t,o.attributes=[]),o)))}onAttributesChange(e,t){this.channelProductUploads.update(n=>n.map((o,c)=>(c==e&&(o.attributes=t),o)))}onSelectChannel(e,t,n){this.channelProductUploads.update(o=>o.map((c,W)=>{if(W==t&&e.selected){let X=this.findCategoryByChannelId(e.id,n);c.categoryId=X?.DefaultCategoryID}return W==t&&!e.selected&&(c.categoryId=null),c}))}findCategoryByChannelId(e,t){return t.find(n=>n.ID===e)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["app-product-upload"]],features:[v([Ae,Pe,ke,ie])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(t,n){if(t&1&&(l(0,"mainpanel",0)(1,"actions")(2,"button",1),C("click",function(){return n.onUploadProduct()}),f(3,"i",2),u(4," Upload "),r()(),l(5,"content")(6,"div",3)(7,"h3",4),u(8,"Product To Upload"),r(),l(9,"div",5),R(10,Ze,2,7,"div",6,j),g(12,"async"),r(),l(13,"h3",7),u(14,"Channel To Upload"),r(),R(15,at,19,10,"div",8,j),r()()()),t&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),L(y(12,3,n.selectedProducts$)),s(5),L(n.channelProductUploads())}},dependencies:[S,V,x,Ee,Ie,Se,Ue,Ne,Te,Fe,Z,$,ye,xe,ve,Ve,$e,De,Oe,we,Me],encapsulation:2})}}return i})();export{qi as ProductUploadComponent};
1
+ import{b as Me}from"./chunk-PFB7XEYZ.js";import"./chunk-UEPQYAWE.js";import{a as Ae,b as Pe,c as ke,d as ie,e as oe}from"./chunk-XC7L6C26.js";import{a as we}from"./chunk-YHKEECJR.js";import{a as Ne,b as Ue}from"./chunk-BFU7VKO3.js";import{b as Ee}from"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import"./chunk-SSAGHA7U.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-DRHWRRQV.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-IA6KOBDJ.js";import"./chunk-RECNBAEB.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-5DIRXS7I.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as Fe,b as Te}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import"./chunk-AEJ5I5MW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{d as O,e as B}from"./chunk-5JVEEL2T.js";import{b as be,c as _}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{e as K}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Se,n as Ie}from"./chunk-CLER2MX6.js";import{A as Z,B as D,c as te,e as ge,h as $,i as H,m as ye,n as q,q as z,s as J,z as Y}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as ve,s as xe}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as V,j as x,n as S}from"./chunk-M2FCTYGU.js";import{$c as g,Gb as b,Gc as u,Hc as fe,Ic as Q,K as de,Ka as w,Kc as he,Lc as _e,M as ue,Mb as h,Mc as Ce,Oa as re,Qc as v,Yb as m,Z as ee,ad as y,dc as E,ea as A,ec as j,gc as R,hc as L,ic as l,ja as P,jc as r,kc as f,lc as N,mc as U,oc as M,pa as d,rb as s,tc as C,uc as a,v as T,xa as k,ya as I,za as F}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ae=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y),this.uploadProductService=d(oe)}getAttributes(e,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:t}]).pipe(de(o=>this.uploadProductService.selectedProduct$.pipe(T(c=>(o=this.mappingAttributeSalesProperty(o,c),o)))))}mappingAttributeSalesProperty(e,t){let n=0;return e.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(t),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(e){let t=!1,n=[];return e.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),t=n.some(o=>o>1),t}createFormGroup(e){let t=this.formBuilder.group({}),n=[];return e.forEach(o=>{n=[],o.is_required&&n.push(ge.required),t.addControl(o.id,this.formBuilder.control(null,n))}),t}getFilteredAttributes(e,t){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(t),c=n.filter(W=>o.findIndex(Be=>parseInt(Be)==W.id)!=-1);return c=this.filterSelectedAttributes(c,t),c}filterSelectedAttributes(e,t){return e.map(o=>(_.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(c=>t[o.id]?.includes(c.id)):o.values=o.values.filter(c=>c.id==t[o.id]):t[o.id]&&(o.values=[{id:null,name:t[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function Ge(i,p){i&1&&(l(0,"span",5),u(1,"*"),r())}function je(i,p){if(i&1&&f(0,"ng-select",6),i&2){let e=a().$implicit;m("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Re(i,p){if(i&1&&f(0,"ng-select",7),i&2){let e=a().$implicit;m("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Le(i,p){if(i&1&&f(0,"input",8),i&2){let e=a().$implicit;m("formControlName",e.id)("placeholder",e==null?null:e.name)}}function We(i,p){if(i&1&&(l(0,"small",5),u(1),r()),i&2){let e=a().$implicit;s(),Q(" ",e==null?null:e.name," is mandatory ")}}function He(i,p){if(i&1&&(l(0,"div",3)(1,"div",4),h(2,Ge,2,0,"span",5),l(3,"span"),u(4),r()(),h(5,je,1,4,"ng-select",6)(6,Re,1,3,"ng-select",7)(7,Le,1,2,"input",8)(8,We,2,1,"small",5),r()),i&2){let e=p.$implicit;s(2),E(e.is_required?2:-1),s(2),Q(" ",e==null?null:e.name," "),s(),E(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),s(3),E(e.is_required?8:-1)}}function qe(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2),R(3,He,9,4,"div",3,j),r()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(2),L(e)}}var Ve=(()=>{class i{constructor(){this.tiktokAttributeFormService=d(ae),this.attributesChanges=new w}ngOnChanges(){_.IsNotEmpty(this.categoryId)&&_.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(T(e=>e.filter(t=>!(t.type=="PRODUCT_PROPERTY"&&(_.IsEmpty(t.values)||t.values?.length==0)&&t.is_customizable==!1))),A(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),ee(1)))}listenToFormChange(e){let t=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{t=this.tiktokAttributeFormService.getFilteredAttributes(e,n),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[v([ae]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(t,n){t&1&&(h(0,qe,5,1,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,B,O,D,q,te,$,H,z,J,Z],encapsulation:2})}}return i})();var se=(()=>{class i{constructor(){this.woocommerceUploadService=d(ie)}getAttributes(e,t){return this.woocommerceUploadService.getAttributes(e,t).pipe(T(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();var $e=(()=>{class i{constructor(){this.wooAttributeFormService=d(se),this.channelId=re(),this.categoryId=re(),this.attributesChanges=new w}ngOnChanges(){_.IsNotEmpty(this.categoryId())&&_.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[v([se]),k],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(t,n){t&1&&(l(0,"div",0)(1,"div",1)(2,"div",2),u(3,"Atribut"),r(),l(4,"ng-select",3),g(5,"async"),C("change",function(c){return n.onSelectAttribute(c)}),r()()()),t&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,x,Z,B,O,D],encapsulation:2})}}return i})();var me=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y)}getAttributes(e,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:t}]).pipe(T(o=>o))}createFormGroup(e){let t=this.formBuilder.group({});return e.forEach(n=>{t.addControl(n.variant,this.formBuilder.control(null))}),t}convertAttributes(e={}){return Object.values(e).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function ze(i,p){if(i&1&&(l(0,"div",3)(1,"div",4),u(2),r(),f(3,"ng-select",5),r()),i&2){let e=p.$implicit;s(2),Q(" ",e==null?null:e.variant," "),s(),m("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function Je(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2),R(3,ze,4,4,"div",3,j),r()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(2),L(e)}}var De=(()=>{class i{constructor(){this.tokpedAttrFormService=d(me),this.attributesChanges=new w}ngOnInit(){}ngOnChanges(e){_.IsNotEmpty(this.categoryId)&&_.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(t=>{this.form=this.tokpedAttrFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(t=>{e=this.tokpedAttrFormService.convertAttributes(t),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[v([me]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(t,n){t&1&&(h(0,Je,5,1,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,B,O,D,q,$,H,z,J],encapsulation:2})}}return i})();var pe=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(e){let t=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(o=>{t.addControl(o,this.formBuilder.control(null))}),t}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function Ye(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),u(5," Brand "),r(),f(6,"input",5),r(),l(7,"div",6)(8,"div",4),u(9," Product Type "),r(),f(10,"input",7),r(),l(11,"div",6)(12,"div",4),u(13," Status "),r(),f(14,"ng-select",8),r()()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(13),m("items",e.Options.StatusOptions)}}var Oe=(()=>{class i{constructor(){this.attributesChanges=new w,this.shopifyFormService=d(pe)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(t=>{this.form=this.shopifyFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(ue(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[v([pe]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(t,n){t&1&&(h(0,Ye,15,2,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,D,q,te,$,H,z,J,B,O],encapsulation:2})}}return i})();function Ze(i,p){if(i&1&&(l(0,"div",6),f(1,"app-product-card",9),r()),i&2){let e=p.$implicit;s(),m("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function Ke(i,p){if(i&1){let e=M();N(0),l(1,"mat-checkbox",21),Ce("ngModelChange",function(n){I(e);let o=a().$implicit;return _e(o.selected,n)||(o.selected=n),F(n)}),C("ngModelChange",function(){let n=I(e).ngIf,o=a(),c=o.$implicit,W=o.$index,X=a();return F(X.onSelectChannel(c,W,n))}),r(),U()}if(i&2){let e=a().$implicit;s(),he("ngModel",e.selected)}}function Qe(i,p){if(i&1&&(l(0,"div",18),f(1,"input",22),r()),i&2){let e=a().$implicit,t=a();m("matTooltip",e.type==t.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":e.type==t.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Xe(i,p){if(i&1){let e=M();l(0,"app-channel-category-select",23),C("selectedCategory",function(n){I(e);let o=a().$index,c=a();return F(c.onCategoryChange(o,n))}),r()}if(i&2){let e=a().$implicit,t=a();m("disabled",!e.selected||e.selected&&e.type==t.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function et(i,p){if(i&1){let e=M();l(0,"shopee-attribute-form",27),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function tt(i,p){if(i&1){let e=M();l(0,"tiktok-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function it(i,p){if(i&1){let e=M();l(0,"wooocommerce-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function ot(i,p){if(i&1){let e=M();l(0,"tokopedia-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function nt(i,p){if(i&1&&(l(0,"div",20)(1,"div",24),h(2,et,1,3,"shopee-attribute-form",25)(3,tt,1,2,"tiktok-attribute-form",26)(4,it,1,2,"wooocommerce-attribute-form",26)(5,ot,1,2,"tokopedia-attribute-form",26),r()()),i&2){let e,t=a().$implicit,n=a();s(2),E((e=t.type)===n.channelType.Shopee?2:e===n.channelType.Tiktok?3:e===n.channelType.WooCommerce?4:e===n.channelType.Tokopedia?5:-1)}}function rt(i,p){if(i&1){let e=M();l(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),C("attributesChanges",function(n){I(e);let o=a().$index,c=a();return F(c.onAttributesChange(o,n))}),r()()()}if(i&2){let e=a().$implicit;s(2),m("channelId",e.id)}}function at(i,p){if(i&1&&(l(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Ke,2,1,"ng-container",14),g(7,"async"),r(),l(8,"div"),f(9,"app-channel-logo",15),r(),l(10,"div",16)(11,"span"),u(12),r()()()(),l(13,"div",12)(14,"div",17),h(15,Qe,2,1,"div",18)(16,Xe,1,4,"app-channel-category-select",19),r()()(),h(17,nt,6,1,"div",20)(18,rt,3,1,"div",20),r()()),i&2){let e=p.$implicit,t=a();s(6),m("ngIf",y(7,8,t.defaultCategories$)),s(3),m("typeId",e.type)("showChannelName",!1),s(),m("matTooltip",e.name)("matTooltipShowDelay",2500),s(2),fe(e.name),s(3),E(e.type==t.channelType.Shopify||e.type==t.channelType.Plugo?15:16),s(2),E(e.categoryId&&t.channelType.Lazada!=e.type&&e.selected?17:t.channelType.Shopify==e.type&&e.selected?18:-1)}}var qi=(()=>{class i{constructor(){this.uploadProductService=d(oe),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=be,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ee(1))}onCategoryChange(e,t){this.channelProductUploads.update(n=>n.map((o,c)=>(c==e&&(o.categoryId=t,o.attributes=[]),o)))}onAttributesChange(e,t){this.channelProductUploads.update(n=>n.map((o,c)=>(c==e&&(o.attributes=t),o)))}onSelectChannel(e,t,n){this.channelProductUploads.update(o=>o.map((c,W)=>{if(W==t&&e.selected){let X=this.findCategoryByChannelId(e.id,n);c.categoryId=X?.DefaultCategoryID}return W==t&&!e.selected&&(c.categoryId=null),c}))}findCategoryByChannelId(e,t){return t.find(n=>n.ID===e)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["app-product-upload"]],features:[v([Ae,Pe,ke,ie])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(t,n){if(t&1&&(l(0,"mainpanel",0)(1,"actions")(2,"button",1),C("click",function(){return n.onUploadProduct()}),f(3,"i",2),u(4," Upload "),r()(),l(5,"content")(6,"div",3)(7,"h3",4),u(8,"Product To Upload"),r(),l(9,"div",5),R(10,Ze,2,7,"div",6,j),g(12,"async"),r(),l(13,"h3",7),u(14,"Channel To Upload"),r(),R(15,at,19,10,"div",8,j),r()()()),t&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),L(y(12,3,n.selectedProducts$)),s(5),L(n.channelProductUploads())}},dependencies:[S,V,x,Ee,Ie,Se,Ue,Ne,Te,Fe,Z,$,ye,xe,ve,Ve,$e,De,Oe,we,Me],encapsulation:2})}}return i})();export{qi as ProductUploadComponent};
@@ -1 +1 @@
1
- import{a as se,b as ce,c as ue}from"./chunk-V5BKQSAT.js";import{a as he}from"./chunk-AZ2WERIL.js";import{a as me}from"./chunk-FV47Y5BB.js";import{a as de}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as pe}from"./chunk-EPVCMYCI.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-CMTBBXR5.js";import{a as le}from"./chunk-WPW3D4MQ.js";import"./chunk-TFQEBAZY.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as ie}from"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as te}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as oe,n as ae}from"./chunk-CLER2MX6.js";import{A as ee,c as X,h as Y,m as Z,o as $}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as ne,s as re}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as q,k as J,m as K,n as Q}from"./chunk-M2FCTYGU.js";import{$c as w,Gb as I,Gc as l,Hc as v,Ic as E,Kc as f,Lc as _,Mb as x,Mc as S,Nc as z,Oc as A,Pc as j,Qc as H,Ra as N,Rc as R,Sc as U,Yb as c,ac as W,ad as V,bd as G,dc as b,ec as D,gc as k,hc as B,ic as t,ja as O,jc as i,kc as u,oc as M,pa as y,pb as F,rb as a,tc as T,uc as h,v as L,ya as m,za as d}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var P=(()=>{class n{constructor(){this.httpService=y(te)}getShippedOrders(e){return this.httpService.post(ie.GetShipped,e).pipe(L(p=>p.Data||[]))}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275prov=O({token:n,factory:n.\u0275fac})}}return n})();var _e=()=>[],Se=n=>({"td-cell-hover":n});function ge(n,g){if(n&1&&u(0,"variants-dropdown",29),n&2){let e=h().$implicit;c("variants",e==null?null:e.Variants)}}function Ce(n,g){if(n&1&&u(0,"variant-with-image",30),n&2){let e=h().$implicit;c("variant",e==null?null:e.Variants[0])}}function ve(n,g){if(n&1&&(t(0,"span"),l(1),i()),n&2){let e=h().$implicit;a(),E("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function we(n,g){if(n&1&&(t(0,"tr")(1,"td"),l(2),i(),t(3,"td")(4,"div",25)(5,"div",26)(6,"div"),u(7,"img",27),w(8,"channelImage"),i(),t(9,"div"),u(10,"order-link",28),i()(),t(11,"small"),l(12),w(13,"date"),i()()(),t(14,"td"),l(15),i(),t(16,"td"),x(17,ge,1,1,"variants-dropdown",29)(18,Ce,1,1,"variant-with-image",30),i(),t(19,"td",31),l(20),w(21,"number"),i(),t(22,"td")(23,"div",25)(24,"div",26)(25,"span"),l(26),i(),x(27,ve,2,1,"span"),i(),t(28,"small"),l(29),i()()()()),n&2){let e=g.$implicit;a(2),v(e.Outlet),a(5),c("src",V(8,13,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(3),c("order",e),a(2),E(" ",G(13,15,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(3),v(e.Customer),a(),W(U(20,Se,(e.Variants==null?null:e.Variants.length)>1)),a(),b((e.Variants==null?null:e.Variants.length)>1?17:18),a(3),v(V(21,18,e.Amount)),a(6),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?27:-1),a(2),E(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function ye(n,g){if(n&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",21),l(7,"Number"),i(),t(8,"th",21),l(9,"Customer"),i(),t(10,"th"),l(11,"Items"),i(),t(12,"th",22),l(13,"Amount"),i(),t(14,"th",23),l(15,"Shipping"),i()()(),t(16,"tbody"),k(17,we,30,22,"tr",null,D),i()(),t(19,"app-custom-paginator",24),T("next",function(){m(e);let r=h();return d(r.initShippedOrders())})("previous",function(){m(e);let r=h();return d(r.initShippedOrders())}),i()()}if(n&2){let e=h(),p=j(0);a(17),B(p),a(2),c("filter",e.filter())("totaldata",p==null?null:p.length)}}function xe(n,g){n&1&&(t(0,"div",16),u(1,"app-empty-state"),i())}var Xe=(()=>{class n{constructor(){this.shippedService=y(P),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.shippedService.getShippedOrders(this.filter())}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275cmp=I({type:n,selectors:[["app-shipped"]],features:[H([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","100px"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[2,"width","150px"],["rowCountApi","/api/orders/shippedcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","12px","padding-bottom","2.5px",3,"src","alt"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"]],template:function(p,r){if(p&1){let s=M();z(0),w(1,"async"),t(2,"mainpanel",0),T("onSubmit",function(){return m(s),d(r.initShippedOrders())}),S("textChange",function(o){return m(s),_(r.filter().Number,o)||(r.filter().Number=o),d(o)}),t(3,"actions")(4,"a",1),u(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"From/To"),i(),t(12,"channel-select-options",4),S("ngModelChange",function(o){return m(s),_(r.filter().ListChannelID,o)||(r.filter().ListChannelID=o),d(o)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),S("dateChange",function(o){return m(s),_(r.filter().From,o)||(r.filter().From=o),d(o)}),i()(),t(18,"div")(19,"datepicker",8),S("dateChange",function(o){return m(s),_(r.filter().To,o)||(r.filter().To=o),d(o)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),S("ngModelChange",function(o){return m(s),_(r.filter().PageNumber,o)||(r.filter().PageNumber=o),d(o)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),S("ngModelChange",function(o){return m(s),_(r.filter().PageSize,o)||(r.filter().PageSize=o),d(o)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,ye,20,2,"div",15)(33,xe,2,0,"div",16),i()()()()()}if(p&2){let s=A(V(1,8,r.shippedOrders$)||R(11,_e));a(2),f("text",r.filter().Number),a(10),c("multiple",!0),f("ngModel",r.filter().ListChannelID),a(5),f("date",r.filter().From),a(2),f("date",r.filter().To),a(4),f("ngModel",r.filter().PageNumber),a(4),f("ngModel",r.filter().PageSize),a(5),b(s.length>0?32:33)}},dependencies:[Q,q,K,J,ae,oe,pe,le,ee,X,$,Y,Z,se,ce,ue,de,me,re,ne,he],encapsulation:2})}}return n})();export{Xe as ShippedComponent};
1
+ import{a as se,b as ce,c as ue}from"./chunk-V5BKQSAT.js";import{a as he}from"./chunk-UDZIOJVC.js";import{a as me}from"./chunk-Q23GGWWT.js";import{a as de}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as pe}from"./chunk-EPVCMYCI.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-CMTBBXR5.js";import{a as le}from"./chunk-WPW3D4MQ.js";import"./chunk-AEJ5I5MW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as ie}from"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as te}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as oe,n as ae}from"./chunk-CLER2MX6.js";import{A as ee,c as X,h as Y,m as Z,o as $}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as ne,s as re}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as q,k as J,m as K,n as Q}from"./chunk-M2FCTYGU.js";import{$c as w,Gb as I,Gc as l,Hc as v,Ic as E,Kc as f,Lc as _,Mb as x,Mc as S,Nc as z,Oc as A,Pc as j,Qc as H,Ra as N,Rc as R,Sc as U,Yb as c,ac as W,ad as V,bd as G,dc as b,ec as D,gc as k,hc as B,ic as t,ja as O,jc as i,kc as u,oc as M,pa as y,pb as F,rb as a,tc as T,uc as h,v as L,ya as m,za as d}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var P=(()=>{class n{constructor(){this.httpService=y(te)}getShippedOrders(e){return this.httpService.post(ie.GetShipped,e).pipe(L(p=>p.Data||[]))}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275prov=O({token:n,factory:n.\u0275fac})}}return n})();var _e=()=>[],Se=n=>({"td-cell-hover":n});function ge(n,g){if(n&1&&u(0,"variants-dropdown",29),n&2){let e=h().$implicit;c("variants",e==null?null:e.Variants)}}function Ce(n,g){if(n&1&&u(0,"variant-with-image",30),n&2){let e=h().$implicit;c("variant",e==null?null:e.Variants[0])}}function ve(n,g){if(n&1&&(t(0,"span"),l(1),i()),n&2){let e=h().$implicit;a(),E("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function we(n,g){if(n&1&&(t(0,"tr")(1,"td"),l(2),i(),t(3,"td")(4,"div",25)(5,"div",26)(6,"div"),u(7,"img",27),w(8,"channelImage"),i(),t(9,"div"),u(10,"order-link",28),i()(),t(11,"small"),l(12),w(13,"date"),i()()(),t(14,"td"),l(15),i(),t(16,"td"),x(17,ge,1,1,"variants-dropdown",29)(18,Ce,1,1,"variant-with-image",30),i(),t(19,"td",31),l(20),w(21,"number"),i(),t(22,"td")(23,"div",25)(24,"div",26)(25,"span"),l(26),i(),x(27,ve,2,1,"span"),i(),t(28,"small"),l(29),i()()()()),n&2){let e=g.$implicit;a(2),v(e.Outlet),a(5),c("src",V(8,13,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(3),c("order",e),a(2),E(" ",G(13,15,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(3),v(e.Customer),a(),W(U(20,Se,(e.Variants==null?null:e.Variants.length)>1)),a(),b((e.Variants==null?null:e.Variants.length)>1?17:18),a(3),v(V(21,18,e.Amount)),a(6),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?27:-1),a(2),E(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function ye(n,g){if(n&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",21),l(7,"Number"),i(),t(8,"th",21),l(9,"Customer"),i(),t(10,"th"),l(11,"Items"),i(),t(12,"th",22),l(13,"Amount"),i(),t(14,"th",23),l(15,"Shipping"),i()()(),t(16,"tbody"),k(17,we,30,22,"tr",null,D),i()(),t(19,"app-custom-paginator",24),T("next",function(){m(e);let r=h();return d(r.initShippedOrders())})("previous",function(){m(e);let r=h();return d(r.initShippedOrders())}),i()()}if(n&2){let e=h(),p=j(0);a(17),B(p),a(2),c("filter",e.filter())("totaldata",p==null?null:p.length)}}function xe(n,g){n&1&&(t(0,"div",16),u(1,"app-empty-state"),i())}var Xe=(()=>{class n{constructor(){this.shippedService=y(P),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.shippedService.getShippedOrders(this.filter())}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275cmp=I({type:n,selectors:[["app-shipped"]],features:[H([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","100px"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[2,"width","150px"],["rowCountApi","/api/orders/shippedcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","12px","padding-bottom","2.5px",3,"src","alt"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"]],template:function(p,r){if(p&1){let s=M();z(0),w(1,"async"),t(2,"mainpanel",0),T("onSubmit",function(){return m(s),d(r.initShippedOrders())}),S("textChange",function(o){return m(s),_(r.filter().Number,o)||(r.filter().Number=o),d(o)}),t(3,"actions")(4,"a",1),u(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"From/To"),i(),t(12,"channel-select-options",4),S("ngModelChange",function(o){return m(s),_(r.filter().ListChannelID,o)||(r.filter().ListChannelID=o),d(o)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),S("dateChange",function(o){return m(s),_(r.filter().From,o)||(r.filter().From=o),d(o)}),i()(),t(18,"div")(19,"datepicker",8),S("dateChange",function(o){return m(s),_(r.filter().To,o)||(r.filter().To=o),d(o)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),S("ngModelChange",function(o){return m(s),_(r.filter().PageNumber,o)||(r.filter().PageNumber=o),d(o)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),S("ngModelChange",function(o){return m(s),_(r.filter().PageSize,o)||(r.filter().PageSize=o),d(o)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,ye,20,2,"div",15)(33,xe,2,0,"div",16),i()()()()()}if(p&2){let s=A(V(1,8,r.shippedOrders$)||R(11,_e));a(2),f("text",r.filter().Number),a(10),c("multiple",!0),f("ngModel",r.filter().ListChannelID),a(5),f("date",r.filter().From),a(2),f("date",r.filter().To),a(4),f("ngModel",r.filter().PageNumber),a(4),f("ngModel",r.filter().PageSize),a(5),b(s.length>0?32:33)}},dependencies:[Q,q,K,J,ae,oe,pe,le,ee,X,$,Y,Z,se,ce,ue,de,me,re,ne,he],encapsulation:2})}}return n})();export{Xe as ShippedComponent};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-BWM4D2FI.js";import{a as C}from"./chunk-5KS4WK6H.js";import{a as h,b as y}from"./chunk-HYJVHRMN.js";import"./chunk-TFQEBAZY.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as v,J as o,n}from"./chunk-M2FCTYGU.js";import{Gb as l,Hb as s,Qc as f,Yb as u,ic as c,jc as d,ka as m,kc as i,rb as p}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-PHZBFTWM.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-NH366PNR.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-FWTH44TJ.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};
1
+ import{a as r}from"./chunk-AOFDSBOE.js";import{a as C}from"./chunk-5KS4WK6H.js";import{a as h,b as y}from"./chunk-HYJVHRMN.js";import"./chunk-AEJ5I5MW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as v,J as o,n}from"./chunk-M2FCTYGU.js";import{Gb as l,Hb as s,Qc as f,Yb as u,ic as c,jc as d,ka as m,kc as i,rb as p}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-HFBAUQ7H.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-3IO4ZF34.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-UYLU3G52.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};