marketplacepos 5.38.3 → 5.38.5

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 (37) hide show
  1. package/Marketplace/{chunk-7POQ3C3K.js → chunk-2TKPU2N4.js} +1 -1
  2. package/Marketplace/{chunk-S6WP72HC.js → chunk-2WJSVVRH.js} +1 -1
  3. package/Marketplace/{chunk-3PJZW7HF.js → chunk-3DTDXKFQ.js} +1 -1
  4. package/Marketplace/{chunk-XYZPGDD2.js → chunk-5UFM4R4N.js} +1 -1
  5. package/Marketplace/{chunk-KVKFKGDQ.js → chunk-5V2G4JZI.js} +1 -1
  6. package/Marketplace/{chunk-AHACTT37.js → chunk-7C76K4Q5.js} +1 -1
  7. package/Marketplace/{chunk-AVI5X2TT.js → chunk-A7JDRCKV.js} +1 -1
  8. package/Marketplace/{chunk-CZUJNA5G.js → chunk-AFZJSPWS.js} +1 -1
  9. package/Marketplace/{chunk-NEXCPJGQ.js → chunk-BMAYZLH7.js} +1 -1
  10. package/Marketplace/{chunk-G6T2QL55.js → chunk-CNWJBMIQ.js} +1 -1
  11. package/Marketplace/{chunk-CBHXQUMA.js → chunk-ESWJCZZP.js} +1 -1
  12. package/Marketplace/{chunk-VOXQUD5E.js → chunk-GH55WYGY.js} +1 -1
  13. package/Marketplace/{chunk-7CDZNNWL.js → chunk-HO5MJE26.js} +1 -1
  14. package/Marketplace/{chunk-LRHLOGXM.js → chunk-J7TJEZXH.js} +1 -1
  15. package/Marketplace/{chunk-F7NU25EB.js → chunk-K2UZHZCJ.js} +1 -1
  16. package/Marketplace/{chunk-4AOCYXXV.js → chunk-KOM5ZICH.js} +1 -1
  17. package/Marketplace/{chunk-B5LX5TOF.js → chunk-LW76SQFU.js} +1 -1
  18. package/Marketplace/{chunk-ZYWCWZDR.js → chunk-N7YYFKGG.js} +1 -1
  19. package/Marketplace/{chunk-HAUNYMEG.js → chunk-OKLT6GH5.js} +1 -1
  20. package/Marketplace/{chunk-WFEOCQ7B.js → chunk-ONI2IMCW.js} +1 -1
  21. package/Marketplace/{chunk-Z3KIQHIK.js → chunk-OTYDLADB.js} +1 -1
  22. package/Marketplace/{chunk-JIBVE3DE.js → chunk-OWSO46ZD.js} +1 -1
  23. package/Marketplace/{chunk-K5ZBGZ47.js → chunk-RGTAWKII.js} +1 -1
  24. package/Marketplace/{chunk-W3X2KRUQ.js → chunk-RY2ZOZ3A.js} +1 -1
  25. package/Marketplace/{chunk-HLBD2ZRF.js → chunk-T5BCWPOW.js} +1 -1
  26. package/Marketplace/{chunk-PG3IYBPX.js → chunk-UNM4PZPP.js} +1 -1
  27. package/Marketplace/{chunk-ZS3HQV2S.js → chunk-UWAJCC5U.js} +1 -1
  28. package/Marketplace/{chunk-OOJNZDBG.js → chunk-VMAJA64B.js} +1 -1
  29. package/Marketplace/{chunk-4FI4YSVV.js → chunk-VSXHWRNT.js} +2 -2
  30. package/Marketplace/{chunk-5RI4KPF6.js → chunk-WBKPCUZ2.js} +1 -1
  31. package/Marketplace/{chunk-VSJIQ3SX.js → chunk-WK577OZB.js} +1 -1
  32. package/Marketplace/{chunk-ZHN24KZM.js → chunk-XIUYKYPU.js} +1 -1
  33. package/Marketplace/{chunk-OJVDCT5U.js → chunk-XJLNBLYY.js} +2 -2
  34. package/Marketplace/{chunk-UPZ35RUO.js → chunk-YT4PFZ7J.js} +1 -1
  35. package/Marketplace/index.html +2 -2
  36. package/Marketplace/{main-TARO2A2O.js → main-KYXOLZYL.js} +1 -1
  37. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as xe,b as Ce}from"./chunk-UIM3W5B7.js";import{a as ne}from"./chunk-BVIRHZTZ.js";import{a as ge,b as ue}from"./chunk-YXFTLQ5M.js";import{b as se}from"./chunk-LOJPRXKZ.js";import{a as de}from"./chunk-VGXQU74M.js";import{a as pe}from"./chunk-RIHLYYZU.js";import{j as le}from"./chunk-3PJZW7HF.js";import{d as _e,h as me}from"./chunk-ITTRZMEX.js";import{r as ae,s as ce}from"./chunk-TMFFA26Y.js";import{b as J,h as Q,m as ee,y as te}from"./chunk-DPLEMBB4.js";import{c as ie,e as oe,f as re}from"./chunk-PXB4YEY3.js";import{d as Z,f as q,g as K,i as X,m as Y,n as G}from"./chunk-GPEVUTDI.js";import{$c as H,Dc as b,Eb as z,Ec as s,Fc as V,Gc as y,Ic as k,Jc as O,Ka as $,Kb as p,Kc as D,Na as B,Qc as u,Wb as m,Zc as N,_c as R,ad as w,bc as v,ca as W,cc as P,ec as E,f as L,fc as M,gc as a,hc as _,ic as I,jc as C,kc as h,lc as U,mc as f,ob as S,qb as r,rc as T,sc as o,vc as A,wb as F,ya as d,za as g}from"./chunk-T5ONJF63.js";var j=t=>[t],fe=t=>({"text-decoration-line-through":t}),Te=t=>({"ms-10":t}),be=t=>({"text-danger":t}),ye=t=>({"bg-gradient-warning":t});function Se(t,c){if(t&1){let e=f();a(0,"mat-slide-toggle",13),T("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),a(1,"small",14),s(2),_()()}if(t&2){let e=o();r(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function ve(t,c){if(t&1){let e=f();a(0,"th")(1,"input",16),D("ngModelChange",function(n){d(e);let l=o(2);return O(l.checkboxState,n)||(l.checkboxState=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);r(),k("ngModel",e.checkboxState)}}function Ie(t,c){if(t&1&&(p(0,ve,2,1,"ng-template",15),a(1,"th",11),s(2,"POS"),_()),t&2){let e=o();m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function we(t,c){if(t&1&&(C(0),a(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),a(5,"div",21),s(6),N(7,"stringLimit"),_()()()(),h()),t&2){let e=c.$implicit;r(3),m("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),m("src",e==null?null:e.Img,S),r(2),y(" ",H(7,3,e.Name,20)," ")}}function Fe(t,c){t&1&&U(0)}function Pe(t,c){if(t&1&&(C(0),p(1,Fe,1,0,"ng-container",33),h()),t&2){o();let e=b(7);r(),m("ngTemplateOutlet",e)}}function Ee(t,c){t&1&&U(0)}function Me(t,c){if(t&1&&p(0,Ee,1,0,"ng-container",33),t&2){o(2);let e=b(7);m("ngTemplateOutlet",e)}}function Ve(t,c){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let e=o(4);m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function ke(t,c){if(t&1){let e=f();C(0),a(1,"input",34),D("ngModelChange",function(n){d(e);let l=o(4).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(4).$implicit,l=o();return g(l.onCheckboxStateProduct(n.ID))}),_(),h()}if(t&2){let e=o(4).$implicit;r(),k("ngModel",e.selected),m("disabled",!(e!=null&&e.Category))}}function Oe(t,c){if(t&1&&p(0,ke,2,2,"ng-container",22),t&2){let e=o(3).$implicit;m("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function De(t,c){if(t&1){let e=f();C(0),a(1,"img",35),T("click",function(n){d(e);let l=o(3).$implicit,x=o();return g(x.onZoomImage(n,l==null?null:l.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;r(),A("src",e==null?null:e.ThumbnailUrl,S)}}function Ne(t,c){t&1&&I(0,"img",36)}function $e(t,c){if(t&1&&(C(0),a(1,"td",28)(2,"div",29),p(3,Pe,2,1,"ng-container",30)(4,Ve,1,3,"ng-template",null,0,w)(6,Oe,1,1,"ng-template",null,1,w),a(8,"div",26),p(9,De,2,1,"ng-container",30)(10,Ne,1,0,"ng-template",null,2,w),_()()(),a(12,"td",31)(13,"div"),s(14),_(),a(15,"small",32),s(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,l=o();r(),m("rowSpan",n==null?null:n.Variants.length),r(2),m("ngIf",l.table=="inventory")("ngIfElse",e),r(5),m("ngClass",u(10,Te,(n==null||n.Variants==null?null:n.Variants.length)<=1)),r(),m("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),r(3),m("rowSpan",n==null?null:n.Variants.length),r(2),V(n==null?null:n.Name),r(),m("ngClass",u(12,be,!(n!=null&&n.Category))),r(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function Be(t,c){if(t&1&&(a(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),S)}}function Ue(t,c){if(t&1){let e=f();a(0,"input",40),D("ngModelChange",function(n){d(e);let l=o(3).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),m("disabled",!(i!=null&&i.Category))}}function Re(t,c){if(t&1&&(a(0,"td",38),p(1,Ue,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);r(),m("ngIf",i.printPOS(e)>=0||i.table=="price")}}function je(t,c){if(t&1&&(p(0,Re,2,1,"ng-template",15),a(1,"td",24),s(2),N(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);m("ngxPermissionsOnly",u(4,j,i.rolePriceEdit)),r(2),V(R(3,2,i.printPOS(e)))}}function Le(t,c){if(t&1){let e=f();C(0),a(1,"td",41),T("click",function(){d(e);let n=o().$implicit,l=o().$implicit,x=o().$implicit,he=o();return g(he.openTableDialog(x.Name,l,n.ID,x.ChannelItemID))}),a(2,"div",29)(3,"div",42),s(4),N(5,"number"),_(),a(6,"a",43),T("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=c.$implicit,i=o(2).$implicit,n=o(2);r(),m("ngClass",u(5,ye,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1)),r(3),y(" ",R(5,3,n.printItem(e))," "),r(2),m("href",e.Url,S)}}function We(t,c){t&1&&(a(0,"td",44)(1,"div",29)(2,"span"),s(3,"X"),_()()())}function ze(t,c){if(t&1&&p(0,Le,8,7,"ng-container",30)(1,We,4,0,"ng-template",null,3,w),t&2){let e=c.$implicit,i=b(2),n=o().$implicit,l=o(2);m("ngIf",l.getItemFromChannel(n,e))("ngIfElse",i)}}function Ae(t,c){if(t&1&&(a(0,"tr"),p(1,$e,17,14,"ng-container",22),a(2,"td",23),s(3),_(),a(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),a(8,"div",21),p(9,Be,2,1,"a",27),_()()(),p(10,je,4,6),E(11,ze,3,2,null,null,P),_()),t&2){let e=c.$implicit,i=c.$index,n=o().$implicit,l=o();r(),m("ngIf",i==0),r(2),V(e==null?null:e.Model),r(2),m("matTooltip",e.Discontinued?l.discontinuedVariantMsg:""),r(),m("ngClass",u(7,fe,e.Discontinued)),r(),y(" ",e.Code," "),r(2),v(n.Category?9:-1),r(),v(l.hiddenIPOSInventory()==!1?10:-1),r(),M(l.channel)}}function He(t,c){if(t&1&&(a(0,"tbody"),E(1,Ae,13,9,"tr",null,P),_()),t&2){let e=c.$implicit;r(),M(e.Variants)}}var ht=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=ne.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new $,this.destroy$=new L,this.toggle=new $,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(l=>(l.selected=n.selected,l)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(l=>ie.IsNotEmpty(i.LocationID)?l.LocationID==i.LocationID:l.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}openTableDialog(e,i,n,l){this.dialog.open(xe,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:l}}).afterClosed().pipe(W(this.destroy$)).subscribe(x=>{x!=null&&this.onSubmit.emit(x)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(F(_e),F(de),F(le))}}static{this.\u0275cmp=z({type:t,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(i,n){i&1&&(a(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,Se,3,1,"mat-slide-toggle",9),_()(),a(9,"th",10),s(10,"Variant"),_(),a(11,"th",11),s(12,"SKU"),_(),p(13,Ie,3,3)(14,we,8,6,"ng-container",12),_()(),E(15,He,3,0,"tbody",null,P),_()()),i&2&&(r(8),v(n.showProductToggle?8:-1),r(5),v(n.hiddenIPOSInventory()==!1?13:-1),r(),m("ngForOf",n.channel),r(),M(n.data))},dependencies:[G,Z,q,K,X,Y,te,J,Q,ee,ue,ge,me,pe,se,re,oe,ce,ae,Ce],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]})}}return t})();export{ht as a};
1
+ import{a as xe,b as Ce}from"./chunk-UIM3W5B7.js";import{a as ne}from"./chunk-BVIRHZTZ.js";import{a as ge,b as ue}from"./chunk-YXFTLQ5M.js";import{b as se}from"./chunk-LOJPRXKZ.js";import{a as de}from"./chunk-VGXQU74M.js";import{a as pe}from"./chunk-RIHLYYZU.js";import{j as le}from"./chunk-3DTDXKFQ.js";import{d as _e,h as me}from"./chunk-ITTRZMEX.js";import{r as ae,s as ce}from"./chunk-TMFFA26Y.js";import{b as J,h as Q,m as ee,y as te}from"./chunk-DPLEMBB4.js";import{c as ie,e as oe,f as re}from"./chunk-PXB4YEY3.js";import{d as Z,f as q,g as K,i as X,m as Y,n as G}from"./chunk-GPEVUTDI.js";import{$c as H,Dc as b,Eb as z,Ec as s,Fc as V,Gc as y,Ic as k,Jc as O,Ka as $,Kb as p,Kc as D,Na as B,Qc as u,Wb as m,Zc as N,_c as R,ad as w,bc as v,ca as W,cc as P,ec as E,f as L,fc as M,gc as a,hc as _,ic as I,jc as C,kc as h,lc as U,mc as f,ob as S,qb as r,rc as T,sc as o,vc as A,wb as F,ya as d,za as g}from"./chunk-T5ONJF63.js";var j=t=>[t],fe=t=>({"text-decoration-line-through":t}),Te=t=>({"ms-10":t}),be=t=>({"text-danger":t}),ye=t=>({"bg-gradient-warning":t});function Se(t,c){if(t&1){let e=f();a(0,"mat-slide-toggle",13),T("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),a(1,"small",14),s(2),_()()}if(t&2){let e=o();r(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function ve(t,c){if(t&1){let e=f();a(0,"th")(1,"input",16),D("ngModelChange",function(n){d(e);let l=o(2);return O(l.checkboxState,n)||(l.checkboxState=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);r(),k("ngModel",e.checkboxState)}}function Ie(t,c){if(t&1&&(p(0,ve,2,1,"ng-template",15),a(1,"th",11),s(2,"POS"),_()),t&2){let e=o();m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function we(t,c){if(t&1&&(C(0),a(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),a(5,"div",21),s(6),N(7,"stringLimit"),_()()()(),h()),t&2){let e=c.$implicit;r(3),m("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),m("src",e==null?null:e.Img,S),r(2),y(" ",H(7,3,e.Name,20)," ")}}function Fe(t,c){t&1&&U(0)}function Pe(t,c){if(t&1&&(C(0),p(1,Fe,1,0,"ng-container",33),h()),t&2){o();let e=b(7);r(),m("ngTemplateOutlet",e)}}function Ee(t,c){t&1&&U(0)}function Me(t,c){if(t&1&&p(0,Ee,1,0,"ng-container",33),t&2){o(2);let e=b(7);m("ngTemplateOutlet",e)}}function Ve(t,c){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let e=o(4);m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function ke(t,c){if(t&1){let e=f();C(0),a(1,"input",34),D("ngModelChange",function(n){d(e);let l=o(4).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(4).$implicit,l=o();return g(l.onCheckboxStateProduct(n.ID))}),_(),h()}if(t&2){let e=o(4).$implicit;r(),k("ngModel",e.selected),m("disabled",!(e!=null&&e.Category))}}function Oe(t,c){if(t&1&&p(0,ke,2,2,"ng-container",22),t&2){let e=o(3).$implicit;m("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function De(t,c){if(t&1){let e=f();C(0),a(1,"img",35),T("click",function(n){d(e);let l=o(3).$implicit,x=o();return g(x.onZoomImage(n,l==null?null:l.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;r(),A("src",e==null?null:e.ThumbnailUrl,S)}}function Ne(t,c){t&1&&I(0,"img",36)}function $e(t,c){if(t&1&&(C(0),a(1,"td",28)(2,"div",29),p(3,Pe,2,1,"ng-container",30)(4,Ve,1,3,"ng-template",null,0,w)(6,Oe,1,1,"ng-template",null,1,w),a(8,"div",26),p(9,De,2,1,"ng-container",30)(10,Ne,1,0,"ng-template",null,2,w),_()()(),a(12,"td",31)(13,"div"),s(14),_(),a(15,"small",32),s(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,l=o();r(),m("rowSpan",n==null?null:n.Variants.length),r(2),m("ngIf",l.table=="inventory")("ngIfElse",e),r(5),m("ngClass",u(10,Te,(n==null||n.Variants==null?null:n.Variants.length)<=1)),r(),m("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),r(3),m("rowSpan",n==null?null:n.Variants.length),r(2),V(n==null?null:n.Name),r(),m("ngClass",u(12,be,!(n!=null&&n.Category))),r(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function Be(t,c){if(t&1&&(a(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),S)}}function Ue(t,c){if(t&1){let e=f();a(0,"input",40),D("ngModelChange",function(n){d(e);let l=o(3).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),m("disabled",!(i!=null&&i.Category))}}function Re(t,c){if(t&1&&(a(0,"td",38),p(1,Ue,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);r(),m("ngIf",i.printPOS(e)>=0||i.table=="price")}}function je(t,c){if(t&1&&(p(0,Re,2,1,"ng-template",15),a(1,"td",24),s(2),N(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);m("ngxPermissionsOnly",u(4,j,i.rolePriceEdit)),r(2),V(R(3,2,i.printPOS(e)))}}function Le(t,c){if(t&1){let e=f();C(0),a(1,"td",41),T("click",function(){d(e);let n=o().$implicit,l=o().$implicit,x=o().$implicit,he=o();return g(he.openTableDialog(x.Name,l,n.ID,x.ChannelItemID))}),a(2,"div",29)(3,"div",42),s(4),N(5,"number"),_(),a(6,"a",43),T("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=c.$implicit,i=o(2).$implicit,n=o(2);r(),m("ngClass",u(5,ye,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1)),r(3),y(" ",R(5,3,n.printItem(e))," "),r(2),m("href",e.Url,S)}}function We(t,c){t&1&&(a(0,"td",44)(1,"div",29)(2,"span"),s(3,"X"),_()()())}function ze(t,c){if(t&1&&p(0,Le,8,7,"ng-container",30)(1,We,4,0,"ng-template",null,3,w),t&2){let e=c.$implicit,i=b(2),n=o().$implicit,l=o(2);m("ngIf",l.getItemFromChannel(n,e))("ngIfElse",i)}}function Ae(t,c){if(t&1&&(a(0,"tr"),p(1,$e,17,14,"ng-container",22),a(2,"td",23),s(3),_(),a(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),a(8,"div",21),p(9,Be,2,1,"a",27),_()()(),p(10,je,4,6),E(11,ze,3,2,null,null,P),_()),t&2){let e=c.$implicit,i=c.$index,n=o().$implicit,l=o();r(),m("ngIf",i==0),r(2),V(e==null?null:e.Model),r(2),m("matTooltip",e.Discontinued?l.discontinuedVariantMsg:""),r(),m("ngClass",u(7,fe,e.Discontinued)),r(),y(" ",e.Code," "),r(2),v(n.Category?9:-1),r(),v(l.hiddenIPOSInventory()==!1?10:-1),r(),M(l.channel)}}function He(t,c){if(t&1&&(a(0,"tbody"),E(1,Ae,13,9,"tr",null,P),_()),t&2){let e=c.$implicit;r(),M(e.Variants)}}var ht=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=ne.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new $,this.destroy$=new L,this.toggle=new $,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(l=>(l.selected=n.selected,l)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(l=>ie.IsNotEmpty(i.LocationID)?l.LocationID==i.LocationID:l.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}openTableDialog(e,i,n,l){this.dialog.open(xe,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:l}}).afterClosed().pipe(W(this.destroy$)).subscribe(x=>{x!=null&&this.onSubmit.emit(x)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(F(_e),F(de),F(le))}}static{this.\u0275cmp=z({type:t,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(i,n){i&1&&(a(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,Se,3,1,"mat-slide-toggle",9),_()(),a(9,"th",10),s(10,"Variant"),_(),a(11,"th",11),s(12,"SKU"),_(),p(13,Ie,3,3)(14,we,8,6,"ng-container",12),_()(),E(15,He,3,0,"tbody",null,P),_()()),i&2&&(r(8),v(n.showProductToggle?8:-1),r(5),v(n.hiddenIPOSInventory()==!1?13:-1),r(),m("ngForOf",n.channel),r(),M(n.data))},dependencies:[G,Z,q,K,X,Y,te,J,Q,ee,ue,ge,me,pe,se,re,oe,ce,ae,Ce],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]})}}return t})();export{ht as a};
@@ -1 +1 @@
1
- import{b as Qt}from"./chunk-TB6SAKPJ.js";import{a as Xt,b as Jt}from"./chunk-3NDNZO2L.js";import"./chunk-PUJ4JVT2.js";import{b as Wt}from"./chunk-PXU3DWYL.js";import"./chunk-AL3REAHH.js";import"./chunk-UDOCTVWA.js";import{a as Yt,b as Ht}from"./chunk-OLSC6KHB.js";import"./chunk-GBD4FIF3.js";import{a as $t,b as Lt}from"./chunk-COBHWPGI.js";import{a as ct,b as Rt,c as Bt,d as mt,e as pt}from"./chunk-ZS3HQV2S.js";import"./chunk-LLZSSV5A.js";import"./chunk-CRC6ZWYT.js";import"./chunk-CLKCSTGQ.js";import{a as jt}from"./chunk-7TWBIV3T.js";import"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as Gt}from"./chunk-62PFQNHJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{d as L,e as R}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-3PJZW7HF.js";import{e as et}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as Ut,n as Vt}from"./chunk-ITTRZMEX.js";import{r as Mt,s as Dt}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as K,e as lt,h as V,i as Y,l as ft,m as Et,n as H,p as X,q as Nt,r as J,s as Pt,t as kt,u as Ot,x as Q,y as tt,z as $}from"./chunk-DPLEMBB4.js";import{b as wt,c as h}from"./chunk-PXB4YEY3.js";import{g as U,j as T,n as S}from"./chunk-GPEVUTDI.js";import{Eb as v,Ec as _,Fc as rt,Gc as q,Ic as It,Jc as Ft,K as Tt,Ka as P,Kb as f,Kc as At,M as St,Na as _t,Oc as x,Pc as at,Wb as m,Z,Zc as b,_c as y,bc as g,cc as k,ea as A,ec as O,fc as w,gc as p,hc as l,ic as d,ja as E,jc as M,kc as D,mc as W,pa as u,qb as s,rc as I,sc as r,v as F,xa as N,ya as G,za as j}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var z=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(z||{});var it=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(it||{});var ht=(()=>{class e{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(Q)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(F(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.map(o=>(i=o?.multi_lang?.find(a=>a.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(a=>(n=a?.multi_lang?.find(C=>C.language=="id"),a.name=n?.value,a)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(lt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let a=this.formBuilder.group({unit:new ft(null),value:new ft(null,n)});i.addControl(JSON.stringify(o.attribute_id),a)}else i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.attribute_id||C.mandatory)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(a=>i[o.attribute_id]?.findIndex(C=>C==a.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):h.IsNotEmpty(i[o.attribute_id])&&(o.attribute_value_list=[{value_id:0,name:i[o.attribute_id]}]);break;default:o.attribute_value_list=o.attribute_value_list.filter(a=>a.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(t,i){let n=[];return h.IsNotEmpty(t)&&(n=[{value_id:0,original_value_name:JSON.stringify(t),value_unit:i}]),n}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Ct=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(Ct||{});var gt=()=>[];function ee(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function ie(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(4,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function oe(e,c){if(e&1&&d(0,"input",8),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ne(e,c){if(e&1&&(p(0,"option",15),_(1),l()),e&2){let t=c.$implicit;m("value",t),s(),rt(t)}}function re(e,c){if(e&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),_(4,"Unit"),l(),O(5,ne,2,2,"option",15,k),l()()),e&2){let t=r(3).$implicit;m("formGroupName",t.attribute_id),s(),m("placeholder","Isi "+(t==null?null:t.name)),s(2),m("value",null),s(2),w(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function ae(e,c){if(e&1&&d(0,"input",11),e&2){let t=r(3).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function le(e,c){if(e&1&&f(0,re,7,3,"div",10)(1,ae,1,2,"input",11),e&2){let t=r(2).$implicit,i=r(2);g((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ce(e,c){if(e&1&&d(0,"datepicker",9),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)}}function me(e,c){if(e&1&&f(0,oe,1,2,"input",8)(1,le,2,1)(2,ce,1,1,"datepicker",9),e&2){let t,i=r().$implicit,n=r(2);g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function pe(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function se(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function ue(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,ee,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,ie,1,5,"ng-select",6)(6,me,3,1)(7,pe,1,4,"ng-select",7)(8,se,1,4,"ng-select",7),l()),e&2){let t,i=c.$implicit,n=r(2);s(2),g(i.mandatory?2:-1),s(2),q(" ",i==null?null:i.name," "),s(),g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function de(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ue,9,3,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var qt=(()=>{class e{constructor(){this.formCategoryService=u(ht),this.attributesChanges=new P,this.inputType=z,this.formatType=it,this.validationType=Ct}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(A(t=>{this.form=this.formCategoryService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[x([ht]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){i&1&&(f(0,de,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,kt,Ot,K,Pt,V,Y,X,J,Nt,jt,Jt,Xt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]})}}return e})();var bt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q),this.uploadProductService=u(pt)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(Tt(o=>this.uploadProductService.selectedProduct$.pipe(F(a=>(o=this.mappingAttributeSalesProperty(o,a),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(lt.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.id)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(a=>i[o.id]?.includes(a.id)):o.values=o.values.filter(a=>a.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function _e(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function fe(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function he(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&d(0,"input",8),e&2){let t=r().$implicit;m("formControlName",t.id)("placeholder",t==null?null:t.name)}}function ge(e,c){if(e&1&&(p(0,"small",5),_(1),l()),e&2){let t=r().$implicit;s(),q(" ",t==null?null:t.name," is mandatory ")}}function be(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,_e,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,fe,1,4,"ng-select",6)(6,he,1,3,"ng-select",7)(7,Ce,1,2,"input",8)(8,ge,2,1,"small",5),l()),e&2){let t=c.$implicit;s(2),g(t.is_required?2:-1),s(2),q(" ",t==null?null:t.name," "),s(),g(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),s(3),g(t.is_required?8:-1)}}function ye(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,be,9,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var zt=(()=>{class e{constructor(){this.tiktokAttributeFormService=u(bt),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(F(t=>t.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),A(t=>{this.form=this.tiktokAttributeFormService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([bt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){i&1&&(f(0,ye,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,K,V,Y,X,J,tt],encapsulation:2})}}return e})();var yt=(()=>{class e{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(F(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Zt=(()=>{class e{constructor(){this.wooAttributeFormService=u(yt),this.channelId=_t(),this.categoryId=_t(),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([yt]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),_(3,"Atribut"),l(),p(4,"ng-select",3),b(5,"async"),I("change",function(a){return n.onSelectAttribute(a)}),l()()()),i&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,T,tt,R,L,$],encapsulation:2})}}return e})();var vt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(F(o=>o))}createFormGroup(t){let i=this.formBuilder.group({});return t.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(t={}){return Object.values(t).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function ve(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),_(2),l(),d(3,"ng-select",5),l()),e&2){let t=c.$implicit;s(2),q(" ",t==null?null:t.variant," "),s(),m("formControlName",t.variant)("items",t.values)("placeholder","Pilih "+(t==null?null:t.variant))}}function xe(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ve,4,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var Kt=(()=>{class e{constructor(){this.tokpedAttrFormService=u(vt),this.attributesChanges=new P}ngOnInit(){}ngOnChanges(t){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let t=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{t=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([vt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){i&1&&(f(0,xe,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,V,Y,X,J],encapsulation:2})}}return e})();var xt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:t}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function Te(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),_(5," Brand "),l(),d(6,"input",5),l(),p(7,"div",6)(8,"div",4),_(9," Product Type "),l(),d(10,"input",7),l(),p(11,"div",6)(12,"div",4),_(13," Status "),l(),d(14,"ng-select",8),l()()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(13),m("items",t.Options.StatusOptions)}}var te=(()=>{class e{constructor(){this.attributesChanges=new P,this.shopifyFormService=u(xt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(St(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[x([xt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){i&1&&(f(0,Te,15,2,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,$,H,K,V,Y,X,J,R,L],encapsulation:2})}}return e})();function Se(e,c){if(e&1&&(p(0,"div",6),d(1,"app-product-card",9),l()),e&2){let t=c.$implicit;s(),m("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Ie(e,c){if(e&1){let t=W();M(0),p(1,"mat-checkbox",21),At("ngModelChange",function(n){G(t);let o=r().$implicit;return Ft(o.selected,n)||(o.selected=n),j(n)}),I("ngModelChange",function(){let n=G(t).ngIf,o=r(),a=o.$implicit,C=o.$index,ot=r();return j(ot.onSelectChannel(a,C,n))}),l(),D()}if(e&2){let t=r().$implicit;s(),It("ngModel",t.selected)}}function Fe(e,c){if(e&1&&(p(0,"div",18),d(1,"input",22),l()),e&2){let t=r().$implicit,i=r();m("matTooltip",t.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Ae(e,c){if(e&1){let t=W();p(0,"app-channel-category-select",23),I("selectedCategory",function(n){G(t);let o=r().$index,a=r();return j(a.onCategoryChange(o,n))}),l()}if(e&2){let t=r().$implicit,i=r();m("disabled",!t.selected||t.selected&&t.type==i.channelType.Lazada)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Ee(e,c){if(e&1){let t=W();p(0,"shopee-attribute-form",27),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function Ne(e,c){if(e&1){let t=W();p(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Pe(e,c){if(e&1){let t=W();p(0,"wooocommerce-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function ke(e,c){if(e&1){let t=W();p(0,"tokopedia-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Oe(e,c){if(e&1&&(p(0,"div",20)(1,"div",24),f(2,Ee,1,3,"shopee-attribute-form",25)(3,Ne,1,2,"tiktok-attribute-form",26)(4,Pe,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),l()()),e&2){let t,i=r().$implicit,n=r();s(2),g((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Tokopedia?5:-1)}}function we(e,c){if(e&1){let t=W();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),I("attributesChanges",function(n){G(t);let o=r().$index,a=r();return j(a.onAttributesChange(o,n))}),l()()()}if(e&2){let t=r().$implicit;s(2),m("channelId",t.id)}}function Me(e,c){if(e&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),f(6,Ie,2,1,"ng-container",14),b(7,"async"),l(),p(8,"div"),d(9,"app-channel-logo",15),l(),p(10,"div",16)(11,"span"),_(12),l()()()(),p(13,"div",12)(14,"div",17),f(15,Fe,2,1,"div",18)(16,Ae,1,4,"app-channel-category-select",19),l()()(),f(17,Oe,6,1,"div",20)(18,we,3,1,"div",20),l()()),e&2){let t=c.$implicit,i=r();s(6),m("ngIf",y(7,8,i.defaultCategories$)),s(3),m("typeId",t.type)("showChannelName",!1),s(),m("matTooltip",t.name)("matTooltipShowDelay",2500),s(2),rt(t.name),s(3),g(t.type==i.channelType.Shopify||t.type==i.channelType.Plugo?15:16),s(2),g(t.categoryId&&i.channelType.Lazada!=t.type&&t.selected?17:i.channelType.Shopify==t.type&&t.selected?18:-1)}}var zo=(()=>{class e{constructor(){this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=wt,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(Z(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.categoryId=i,o.attributes=[]),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.attributes=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((a,C)=>{if(C==i&&t.selected){let ot=this.findCategoryByChannelId(t.id,n);a.categoryId=ot?.DefaultCategoryID}return C==i&&!t.selected&&(a.categoryId=null),a}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-product-upload"]],features:[x([ct,Rt,Bt,mt])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),d(3,"i",2),_(4," Upload "),l()(),p(5,"content")(6,"div",3)(7,"h3",4),_(8,"Product To Upload"),l(),p(9,"div",5),O(10,Se,2,7,"div",6,k),b(12,"async"),l(),p(13,"h3",7),_(14,"Channel To Upload"),l(),O(15,Me,19,10,"div",8,k),l()()()),i&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),w(y(12,3,n.selectedProducts$)),s(5),w(n.channelProductUploads())}},dependencies:[S,U,T,Wt,Vt,Ut,Ht,Yt,Lt,$t,tt,V,Et,Dt,Mt,qt,zt,Zt,Kt,te,Gt,Qt],encapsulation:2})}}return e})();export{zo as ProductUploadComponent};
1
+ import{b as Qt}from"./chunk-TB6SAKPJ.js";import{a as Xt,b as Jt}from"./chunk-3NDNZO2L.js";import"./chunk-PUJ4JVT2.js";import{b as Wt}from"./chunk-PXU3DWYL.js";import"./chunk-AL3REAHH.js";import"./chunk-UDOCTVWA.js";import{a as Yt,b as Ht}from"./chunk-OLSC6KHB.js";import"./chunk-GBD4FIF3.js";import{a as $t,b as Lt}from"./chunk-COBHWPGI.js";import{a as ct,b as Rt,c as Bt,d as mt,e as pt}from"./chunk-UWAJCC5U.js";import"./chunk-LLZSSV5A.js";import"./chunk-CRC6ZWYT.js";import"./chunk-CLKCSTGQ.js";import{a as jt}from"./chunk-7TWBIV3T.js";import"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as Gt}from"./chunk-62PFQNHJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{d as L,e as R}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-3DTDXKFQ.js";import{e as et}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as Ut,n as Vt}from"./chunk-ITTRZMEX.js";import{r as Mt,s as Dt}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as K,e as lt,h as V,i as Y,l as ft,m as Et,n as H,p as X,q as Nt,r as J,s as Pt,t as kt,u as Ot,x as Q,y as tt,z as $}from"./chunk-DPLEMBB4.js";import{b as wt,c as h}from"./chunk-PXB4YEY3.js";import{g as U,j as T,n as S}from"./chunk-GPEVUTDI.js";import{Eb as v,Ec as _,Fc as rt,Gc as q,Ic as It,Jc as Ft,K as Tt,Ka as P,Kb as f,Kc as At,M as St,Na as _t,Oc as x,Pc as at,Wb as m,Z,Zc as b,_c as y,bc as g,cc as k,ea as A,ec as O,fc as w,gc as p,hc as l,ic as d,ja as E,jc as M,kc as D,mc as W,pa as u,qb as s,rc as I,sc as r,v as F,xa as N,ya as G,za as j}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var z=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(z||{});var it=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(it||{});var ht=(()=>{class e{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(Q)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(F(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.map(o=>(i=o?.multi_lang?.find(a=>a.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(a=>(n=a?.multi_lang?.find(C=>C.language=="id"),a.name=n?.value,a)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(lt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let a=this.formBuilder.group({unit:new ft(null),value:new ft(null,n)});i.addControl(JSON.stringify(o.attribute_id),a)}else i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.attribute_id||C.mandatory)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(a=>i[o.attribute_id]?.findIndex(C=>C==a.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):h.IsNotEmpty(i[o.attribute_id])&&(o.attribute_value_list=[{value_id:0,name:i[o.attribute_id]}]);break;default:o.attribute_value_list=o.attribute_value_list.filter(a=>a.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(t,i){let n=[];return h.IsNotEmpty(t)&&(n=[{value_id:0,original_value_name:JSON.stringify(t),value_unit:i}]),n}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Ct=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(Ct||{});var gt=()=>[];function ee(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function ie(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(4,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function oe(e,c){if(e&1&&d(0,"input",8),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ne(e,c){if(e&1&&(p(0,"option",15),_(1),l()),e&2){let t=c.$implicit;m("value",t),s(),rt(t)}}function re(e,c){if(e&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),_(4,"Unit"),l(),O(5,ne,2,2,"option",15,k),l()()),e&2){let t=r(3).$implicit;m("formGroupName",t.attribute_id),s(),m("placeholder","Isi "+(t==null?null:t.name)),s(2),m("value",null),s(2),w(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function ae(e,c){if(e&1&&d(0,"input",11),e&2){let t=r(3).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function le(e,c){if(e&1&&f(0,re,7,3,"div",10)(1,ae,1,2,"input",11),e&2){let t=r(2).$implicit,i=r(2);g((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ce(e,c){if(e&1&&d(0,"datepicker",9),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)}}function me(e,c){if(e&1&&f(0,oe,1,2,"input",8)(1,le,2,1)(2,ce,1,1,"datepicker",9),e&2){let t,i=r().$implicit,n=r(2);g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function pe(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function se(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function ue(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,ee,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,ie,1,5,"ng-select",6)(6,me,3,1)(7,pe,1,4,"ng-select",7)(8,se,1,4,"ng-select",7),l()),e&2){let t,i=c.$implicit,n=r(2);s(2),g(i.mandatory?2:-1),s(2),q(" ",i==null?null:i.name," "),s(),g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function de(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ue,9,3,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var qt=(()=>{class e{constructor(){this.formCategoryService=u(ht),this.attributesChanges=new P,this.inputType=z,this.formatType=it,this.validationType=Ct}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(A(t=>{this.form=this.formCategoryService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[x([ht]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){i&1&&(f(0,de,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,kt,Ot,K,Pt,V,Y,X,J,Nt,jt,Jt,Xt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]})}}return e})();var bt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q),this.uploadProductService=u(pt)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(Tt(o=>this.uploadProductService.selectedProduct$.pipe(F(a=>(o=this.mappingAttributeSalesProperty(o,a),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(lt.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.id)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(a=>i[o.id]?.includes(a.id)):o.values=o.values.filter(a=>a.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function _e(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function fe(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function he(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&d(0,"input",8),e&2){let t=r().$implicit;m("formControlName",t.id)("placeholder",t==null?null:t.name)}}function ge(e,c){if(e&1&&(p(0,"small",5),_(1),l()),e&2){let t=r().$implicit;s(),q(" ",t==null?null:t.name," is mandatory ")}}function be(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,_e,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,fe,1,4,"ng-select",6)(6,he,1,3,"ng-select",7)(7,Ce,1,2,"input",8)(8,ge,2,1,"small",5),l()),e&2){let t=c.$implicit;s(2),g(t.is_required?2:-1),s(2),q(" ",t==null?null:t.name," "),s(),g(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),s(3),g(t.is_required?8:-1)}}function ye(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,be,9,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var zt=(()=>{class e{constructor(){this.tiktokAttributeFormService=u(bt),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(F(t=>t.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),A(t=>{this.form=this.tiktokAttributeFormService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([bt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){i&1&&(f(0,ye,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,K,V,Y,X,J,tt],encapsulation:2})}}return e})();var yt=(()=>{class e{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(F(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Zt=(()=>{class e{constructor(){this.wooAttributeFormService=u(yt),this.channelId=_t(),this.categoryId=_t(),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([yt]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),_(3,"Atribut"),l(),p(4,"ng-select",3),b(5,"async"),I("change",function(a){return n.onSelectAttribute(a)}),l()()()),i&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,T,tt,R,L,$],encapsulation:2})}}return e})();var vt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(F(o=>o))}createFormGroup(t){let i=this.formBuilder.group({});return t.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(t={}){return Object.values(t).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function ve(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),_(2),l(),d(3,"ng-select",5),l()),e&2){let t=c.$implicit;s(2),q(" ",t==null?null:t.variant," "),s(),m("formControlName",t.variant)("items",t.values)("placeholder","Pilih "+(t==null?null:t.variant))}}function xe(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ve,4,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var Kt=(()=>{class e{constructor(){this.tokpedAttrFormService=u(vt),this.attributesChanges=new P}ngOnInit(){}ngOnChanges(t){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let t=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{t=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([vt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){i&1&&(f(0,xe,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,V,Y,X,J],encapsulation:2})}}return e})();var xt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:t}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function Te(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),_(5," Brand "),l(),d(6,"input",5),l(),p(7,"div",6)(8,"div",4),_(9," Product Type "),l(),d(10,"input",7),l(),p(11,"div",6)(12,"div",4),_(13," Status "),l(),d(14,"ng-select",8),l()()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(13),m("items",t.Options.StatusOptions)}}var te=(()=>{class e{constructor(){this.attributesChanges=new P,this.shopifyFormService=u(xt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(St(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[x([xt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){i&1&&(f(0,Te,15,2,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,$,H,K,V,Y,X,J,R,L],encapsulation:2})}}return e})();function Se(e,c){if(e&1&&(p(0,"div",6),d(1,"app-product-card",9),l()),e&2){let t=c.$implicit;s(),m("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Ie(e,c){if(e&1){let t=W();M(0),p(1,"mat-checkbox",21),At("ngModelChange",function(n){G(t);let o=r().$implicit;return Ft(o.selected,n)||(o.selected=n),j(n)}),I("ngModelChange",function(){let n=G(t).ngIf,o=r(),a=o.$implicit,C=o.$index,ot=r();return j(ot.onSelectChannel(a,C,n))}),l(),D()}if(e&2){let t=r().$implicit;s(),It("ngModel",t.selected)}}function Fe(e,c){if(e&1&&(p(0,"div",18),d(1,"input",22),l()),e&2){let t=r().$implicit,i=r();m("matTooltip",t.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Ae(e,c){if(e&1){let t=W();p(0,"app-channel-category-select",23),I("selectedCategory",function(n){G(t);let o=r().$index,a=r();return j(a.onCategoryChange(o,n))}),l()}if(e&2){let t=r().$implicit,i=r();m("disabled",!t.selected||t.selected&&t.type==i.channelType.Lazada)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Ee(e,c){if(e&1){let t=W();p(0,"shopee-attribute-form",27),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function Ne(e,c){if(e&1){let t=W();p(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Pe(e,c){if(e&1){let t=W();p(0,"wooocommerce-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function ke(e,c){if(e&1){let t=W();p(0,"tokopedia-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Oe(e,c){if(e&1&&(p(0,"div",20)(1,"div",24),f(2,Ee,1,3,"shopee-attribute-form",25)(3,Ne,1,2,"tiktok-attribute-form",26)(4,Pe,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),l()()),e&2){let t,i=r().$implicit,n=r();s(2),g((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Tokopedia?5:-1)}}function we(e,c){if(e&1){let t=W();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),I("attributesChanges",function(n){G(t);let o=r().$index,a=r();return j(a.onAttributesChange(o,n))}),l()()()}if(e&2){let t=r().$implicit;s(2),m("channelId",t.id)}}function Me(e,c){if(e&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),f(6,Ie,2,1,"ng-container",14),b(7,"async"),l(),p(8,"div"),d(9,"app-channel-logo",15),l(),p(10,"div",16)(11,"span"),_(12),l()()()(),p(13,"div",12)(14,"div",17),f(15,Fe,2,1,"div",18)(16,Ae,1,4,"app-channel-category-select",19),l()()(),f(17,Oe,6,1,"div",20)(18,we,3,1,"div",20),l()()),e&2){let t=c.$implicit,i=r();s(6),m("ngIf",y(7,8,i.defaultCategories$)),s(3),m("typeId",t.type)("showChannelName",!1),s(),m("matTooltip",t.name)("matTooltipShowDelay",2500),s(2),rt(t.name),s(3),g(t.type==i.channelType.Shopify||t.type==i.channelType.Plugo?15:16),s(2),g(t.categoryId&&i.channelType.Lazada!=t.type&&t.selected?17:i.channelType.Shopify==t.type&&t.selected?18:-1)}}var zo=(()=>{class e{constructor(){this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=wt,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(Z(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.categoryId=i,o.attributes=[]),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.attributes=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((a,C)=>{if(C==i&&t.selected){let ot=this.findCategoryByChannelId(t.id,n);a.categoryId=ot?.DefaultCategoryID}return C==i&&!t.selected&&(a.categoryId=null),a}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-product-upload"]],features:[x([ct,Rt,Bt,mt])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),d(3,"i",2),_(4," Upload "),l()(),p(5,"content")(6,"div",3)(7,"h3",4),_(8,"Product To Upload"),l(),p(9,"div",5),O(10,Se,2,7,"div",6,k),b(12,"async"),l(),p(13,"h3",7),_(14,"Channel To Upload"),l(),O(15,Me,19,10,"div",8,k),l()()()),i&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),w(y(12,3,n.selectedProducts$)),s(5),w(n.channelProductUploads())}},dependencies:[S,U,T,Wt,Vt,Ut,Ht,Yt,Lt,$t,tt,V,Et,Dt,Mt,qt,zt,Zt,Kt,te,Gt,Qt],encapsulation:2})}}return e})();export{zo as ProductUploadComponent};
@@ -1 +1 @@
1
- import{a as Q}from"./chunk-5XVUQWLZ.js";import"./chunk-77IUCPIQ.js";import{a as K}from"./chunk-ZD5LURJS.js";import{a as Oe,b as ke}from"./chunk-OE2JYQHN.js";import"./chunk-PUJ4JVT2.js";import"./chunk-LLZSSV5A.js";import"./chunk-CRC6ZWYT.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as Z,b as Ve}from"./chunk-CVQMAWML.js";import"./chunk-LEHTNMIE.js";import"./chunk-CH2MLZU7.js";import{a as O}from"./chunk-F7NU25EB.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as de,b as pe,d as me,e as Re}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as se}from"./chunk-3PJZW7HF.js";import{e as D}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as M,n as Le}from"./chunk-ITTRZMEX.js";import{r as Ne,s as Pe}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as oe,h as re,m as ae,o as le,t as Ee,u as Te,y as De,z as Me}from"./chunk-DPLEMBB4.js";import{c as W}from"./chunk-PXB4YEY3.js";import{E as B,F as Ie,H as P,J as he,d as ue,f as Y,g as E,j as we,k as T,l as F,n as ge}from"./chunk-GPEVUTDI.js";import{$c as I,Dc as z,Eb as x,Ec as r,Fb as ne,Fc as d,Gc as V,Ic as y,Jc as C,Kb as f,Kc as S,Pc as U,Qc as A,Wb as p,Z as Ce,Zc as _,_b as xe,_c as L,ad as J,ea as Se,gc as i,hc as n,ic as N,ja as ce,jc as j,ka as ie,kc as q,mc as R,oa as be,ob as H,qb as l,rc as w,sc as v,v as ye,wb as h,ya as c,za as u}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var We=(()=>{class o{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Inventory Sync ",Url:"/menu/log/inventory"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"},{Title:"Origin Order API",Url:"/menu/log/origin-order-api"}]}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=x({type:o,selectors:[["app-logs"]],standalone:!1,decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(a,t){a&1&&(i(0,"nav",0)(1,"div",1)(2,"div"),N(3,"nav-tab",2),n()()(),N(4,"router-outlet")),a&2&&(l(3),p("Tabs",t.ObjectlogTabs))},dependencies:[Ie,Oe],encapsulation:2})}}return o})();var X=(()=>{class o{constructor(){}get Data(){return this._Data}set Data(e){this._Data=e}Fill(e){return this._Data.find(a=>a._id==e)}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275prov=ce({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var et=()=>["/menu/log/order/detail-user"],tt=o=>({ID:o}),it=o=>({"bg-warning":o});function nt(o,g){if(o&1&&(i(0,"span",22),N(1,"img",23),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),V(" ",e.Name," ")}}function ot(o,g){o&1&&(i(0,"th",27)(1,"span",33),r(2," Response Body Warning "),n()())}function rt(o,g){o&1&&(i(0,"th")(1,"span",33),r(2," Number Override "),n()())}function at(o,g){if(o&1&&(i(0,"td",27)(1,"span",36),r(2),n()()),o&2){let e=v().$implicit;l(),p("ngClass",A(2,it,e.responseBodyWarning!=null)),l(),d(e.responseBodyWarning)}}function lt(o,g){if(o&1&&(i(0,"td"),r(1),n()),o&2){let e=v().$implicit;l(),V(" ",e.ResponseBodyWarningReference," ")}}function st(o,g){if(o&1&&(i(0,"tr")(1,"td")(2,"a",34),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n(),i(11,"td",27)(12,"span",35),r(13),n()(),f(14,at,3,4,"td",29)(15,lt,2,1,"td",30),n()),o&2){let e=g.$implicit,a=v(2);l(2),p("routerLink",U(14,et))("queryParams",A(15,tt,e.ID)),l(),V(" ",I(4,11,e.Created,"dd MMM yyyy HH:mm:ss")," "),l(3),d(e.MarketTypeString),l(2),d(e.POSActionTypeString),l(2),d(e.Number),l(2),xe(e.ResponseCode===200||e.ResponseCode===202?"bg-success":"bg-warning"),l(),V(" ",e.ResponseCode," "),l(),p("ngIf",a.responseBodyWarningVisible),l(),p("ngIf",a.responseBodyWarningVisible)}}function dt(o,g){if(o&1){let e=R();j(0),i(1,"div",24)(2,"table",25)(3,"thead")(4,"tr",26)(5,"th"),r(6,"Date"),n(),i(7,"th"),r(8,"Channel"),n(),i(9,"th"),r(10,"Actions"),n(),i(11,"th"),r(12,"Number"),n(),i(13,"th",27)(14,"span",28),r(15," Response Code "),n()(),f(16,ot,3,0,"th",29)(17,rt,3,0,"th",30),n()(),i(18,"tbody"),f(19,st,16,17,"tr",31),n()(),i(20,"mat-paginator",32),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(16),p("ngIf",e.responseBodyWarningVisible),l(),p("ngIf",e.responseBodyWarningVisible),l(2),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function pt(o,g){o&1&&(i(0,"div",37),N(1,"app-empty-state"),n())}var qe=(()=>{class o{constructor(e,a,t,m){this.http=e,this._RawLogService=a,this.route=t,this.authService=m,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""},this.responseBodyWarningVisible=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.route.queryParams.subscribe(e=>{this.responseCode=e.responseCode,this.responseCode!=null?this.Load(e):this.Load()})}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(e){this.filter.Number=e,this.http.post("/api/Orders/Get",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){t._source.log.responseBodyWarning!=null&&(this.responseBodyWarningVisible=!0);let m={ID:t._id,Created:t._source["@timestamp_received"],shopId:t._source.shopId,MarketTypeString:t._source.log.type,POSActionTypeString:t._source.message,Number:t._source.log.number,ResponseCode:t._source.log.responseCode,responseBodyWarning:t._source.log.responseBodyWarning,ResponseBodyWarningReference:t._source.log.ResponseBodyWarningReference};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(B),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-order"]],standalone:!1,decls:43,vars:15,consts:[["EMPTY_STATE",""],["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[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,"mt-5"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["id","listresponseBodyWarning"],["value","number-override"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],["class","text-center",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"],[1,"text-white","p-2","rounded","response-desc",3,"ngClass"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.Number,s)||(t.Number=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"filters")(2,"div")(3,"label",2),r(4,"Channel"),n(),i(5,"ng-select",3),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(6,nt,3,3,"ng-template",4),n()(),i(7,"div",5)(8,"label",2),r(9,"Action"),n(),i(10,"ng-select",6),S("ngModelChange",function(s){return c(m),C(t.filter.ActionType,s)||(t.filter.ActionType=s),u(s)}),n()(),i(11,"div",5)(12,"label",7),r(13,"From/To"),n(),i(14,"div",8)(15,"datepicker",9),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(16,"div")(17,"datepicker",10),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(18,"div",5)(19,"label",11),r(20,"Response Code"),n(),i(21,"input",12),S("ngModelChange",function(s){return c(m),C(t.filter.StatusCode,s)||(t.filter.StatusCode=s),u(s)}),n()(),i(22,"div",5)(23,"label",11),r(24,"Response Body Warning"),n(),i(25,"input",13),S("ngModelChange",function(s){return c(m),C(t.filter.responseBodyWarning,s)||(t.filter.responseBodyWarning=s),u(s)}),n(),i(26,"datalist",14),N(27,"option",15),n()(),i(28,"div",5)(29,"label",11),r(30,"Page Number"),n(),i(31,"input",16),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(32,"div",5)(33,"label",11),r(34,"Page Size"),n(),i(35,"input",17),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()(),i(36,"content")(37,"div",18)(38,"div",19)(39,"div",20),f(40,dt,21,6,"ng-container",21)(41,pt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(42);y("text",t.Number),l(5),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(5),p("clearable",!0)("items",t.ActionTypeList),y("ngModel",t.filter.ActionType),l(5),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.StatusCode),l(4),y("ngModel",t.filter.responseBodyWarning),l(6),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[ue,Y,E,Ee,Te,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,Ne,T],encapsulation:2})}}return o})();var mt=o=>({"bg-gradient-warning":o}),ct=()=>["/menu/log/inventory/sync-inventory/detail"],ut=o=>({ID:o});function gt(o,g){if(o&1&&(i(0,"span",19),N(1,"img",20),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),V(" ",e.Name," ")}}function ht(o,g){if(o&1&&(i(0,"tr",26)(1,"td")(2,"a",27),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n(),i(11,"td"),r(12),n()()),o&2){let e=g.$implicit;p("ngClass",A(11,mt,e.ResponseCode==400)),l(2),p("routerLink",U(13,ct))("queryParams",A(14,ut,e.ID)),l(),V(" ",I(4,8,e.Created,"dd MMM yyyy HH:mm")," "),l(3),d(e.channelName),l(2),d(e.Sku),l(2),d(e.Stock),l(2),d(e.ResponseCode)}}function ft(o,g){if(o&1){let e=R();j(0),i(1,"div",21)(2,"table",22)(3,"thead")(4,"tr",23)(5,"th"),r(6,"Created"),n(),i(7,"th"),r(8,"Channel"),n(),i(9,"th"),r(10,"SKU"),n(),i(11,"th"),r(12,"Stock"),n(),i(13,"th"),r(14,"Response code"),n()()(),i(15,"tbody"),f(16,ht,13,16,"tr",24),n()(),i(17,"mat-paginator",25),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(16),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function vt(o,g){o&1&&(i(0,"div",28),N(1,"app-empty-state"),n())}var Ge=(()=>{class o{constructor(e,a,t){this.http=e,this._RawLogService=a,this.authService=t,this.Result=Array(),this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load(),this.channelOptions=this.authService.getChannels()}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(e=>{this.filter=e.Filter,this.ActionTypeList=e.Options.ActionTypeList,this.Get()})}Get(e){e!=null&&(this.filter.Sku=e),this.http.post("api/Inventory/GetLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){let m={ID:t._source.log.id,Created:t._source["@timestamp_received"],channelName:t._source.log.channelName,Sku:t._source.log.sku,Stock:t._source.log.stock,ResponseCode:t._source.log.responseCode};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-inventory-log"]],standalone:!1,decls:33,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Inventory Sync","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-success"],["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,"mt-5"],[1,"fw-bold","mb-1"],[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","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"ngClass"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.filter.Sku,s)||(t.filter.Sku=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"actions")(2,"a",2),r(3," Order Inventory Sync Job "),n()(),i(4,"filters")(5,"div",3)(6,"div")(7,"label",4),r(8,"Channel"),n(),i(9,"ng-select",5),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(10,gt,3,3,"ng-template",6),n()(),i(11,"div",7)(12,"label",8),r(13,"From/To"),n(),i(14,"div",9)(15,"datepicker",10),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(16,"div")(17,"datepicker",11),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(18,"div",7)(19,"label",12),r(20,"Page Number"),n(),i(21,"input",13),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(22,"div",7)(23,"label",12),r(24,"Page Size"),n(),i(25,"input",14),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()()(),i(26,"content")(27,"div",15)(28,"div",16)(29,"div",17),f(30,ft,18,4,"ng-container",18)(31,vt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(32);y("text",t.filter.Sku),l(9),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[ue,Y,E,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,T],encapsulation:2})}}return o})();var _t=()=>["/menu/log/rawlog/detail"],yt=o=>({ID:o});function Ct(o,g){if(o&1&&(i(0,"span",17),N(1,"img",18),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),V(" ",e.Name," ")}}function St(o,g){if(o&1&&(i(0,"tr")(1,"td")(2,"a",25),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n()()),o&2){let e=g.$implicit;l(2),p("routerLink",U(9,_t))("queryParams",A(10,yt,e.id)),l(),V(" ",I(4,6,e.Created,"dd MMM yyyy HH:mm:ss")," "),l(3),d(e.type),l(2),d(e.number),l(2),d(e.message)}}function bt(o,g){if(o&1){let e=R();j(0),i(1,"div",19)(2,"table",20)(3,"thead",21)(4,"tr")(5,"th",22),r(6,"Date"),n(),i(7,"th"),r(8,"Type"),n(),i(9,"th"),r(10,"Number"),n(),i(11,"th"),r(12,"Message"),n()()(),i(13,"tbody"),f(14,St,11,12,"tr",23),n()(),i(15,"mat-paginator",24),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(14),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function xt(o,g){o&1&&(i(0,"div",26),N(1,"app-empty-state"),n())}var He=(()=>{class o{constructor(e,a,t){this.http=e,this._RawLogService=a,this.authService=t,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(e){this.filter.Number=e,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){let m={id:t._id,message:t._source.message,responseCode:t._source.log.responseCode,processTypeString:t._source.log.processType,type:t._source.log.type,number:t._source.log.number,Created:t._source["@timestamp_received"]};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-raw-log"]],standalone:!1,decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Webhook Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[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,"mt-5"],[1,"fw-bold","mb-1"],[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","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.filter.Number,s)||(t.filter.Number=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"filters")(2,"div")(3,"label",2),r(4,"Channel"),n(),i(5,"ng-select",3),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(6,Ct,3,3,"ng-template",4),n()(),i(7,"div",5)(8,"label",6),r(9,"From/To"),n(),i(10,"div",7)(11,"datepicker",8),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(12,"div")(13,"datepicker",9),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(14,"div",5)(15,"label",10),r(16,"Page Number"),n(),i(17,"input",11),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(18,"div",5)(19,"label",10),r(20,"Page Size"),n(),i(21,"input",12),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()(),i(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),f(26,bt,16,4,"ng-container",16)(27,xt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(28);y("text",t.filter.Number),l(5),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[Y,E,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,T],encapsulation:2})}}return o})();function wt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function It(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var ze=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailChannelWebhook",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=W.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=W.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-raw-detail"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,wt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,It,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(I(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[E,P,M,F,T],encapsulation:2})}}return o})();function Et(o,g){if(o&1&&(i(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),r(4,"General"),n()(),i(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),r(10,"Date"),n(),i(11,"div")(12,"span"),r(13),_(14,"date"),n()()()(),i(15,"div",6)(16,"div",12)(17,"label"),r(18,"SKU"),n(),i(19,"div")(20,"span"),r(21),n()()()(),i(22,"div",6)(23,"div",12)(24,"label"),r(25,"Channel"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",6)(30,"div",12)(31,"label"),r(32,"Response Code"),n(),i(33,"div")(34,"span"),r(35),n()()()()()()()()),o&2){let e=v();l(13),d(I(14,4,e.data.Created,"dd MMM yyyy")),l(8),d(e.data.Sku),l(7),d(e.data.ChannelName),l(7),d(e.data.ResponseCode)}}var Ue=(()=>{class o{constructor(e,a,t){this.route=e,this.http=a,this._RawLogService=t,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(m=>{this.ID=m.ID,this.Load()})}ngOnInit(){}Load(){var e={ID:this.ID};this.http.post("/api/Inventory/GetInventoryLogDeatil",e).subscribe(a=>{this.data.Created=a.hits[0]._source["@timestamp_received"],this.data.Sku=a.hits[0]._source.log.sku,this.data.ChannelName=a.hits[0]._source.log.channelName,this.data.ResponseCode=a.hits[0]._source.log.responseCode,this.request=W.IsNotEmpty(a.hits[0]?._source.log?.request)?JSON.parse(a.hits[0]?._source?.log?.request):"",this.response=a.hits[0]._source.log.response})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D),h(X))}}static{this.\u0275cmp=x({type:o,selectors:[["app-inventory-detail"]],standalone:!1,decls:30,vars:7,consts:[["headerTitle","Product Inventory Sync Detail",3,"hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory/sync-inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3),f(7,Et,36,7,"div",4),n(),i(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),r(13,"Request"),n()(),i(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),r(18),_(19,"json"),n()()()()()(),i(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),r(24,"Response"),n()(),i(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),r(29),n()()()()()()()()()()),a&2&&(p("hideSearchBox",!0)("hideSearchDropdown",!0),l(7),p("ngIf",t.data),l(11),d(L(19,5,t.request)),l(11),d(t.response))},dependencies:[E,P,M,F,T],encapsulation:2})}}return o})();function Tt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function Dt(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var Je=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailChannelWebhook",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=W.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=W.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-orderdetail"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,Tt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,Dt,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(I(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[E,P,M,F,T],encapsulation:2})}}return o})();var Mt=()=>["/menu/log/exception/detail"],Rt=o=>({ID:o});function Nt(o,g){if(o&1&&(i(0,"tr")(1,"td",12),N(2,"img",13),n(),i(3,"td"),r(4),_(5,"date"),n(),i(6,"td")(7,"a",14),r(8),n()(),i(9,"td")(10,"div",15),r(11),n(),i(12,"div"),r(13),n()()()),o&2){let e=g.$implicit;l(2),p("src",e.logo,H),l(2),d(I(5,7,e.date,"dd-MM-yyyy hh:mm:ss")),l(3),p("routerLink",U(10,Mt))("queryParams",A(11,Rt,e.id)),l(),V(" ",e.number," "),l(3),d(e.message),l(2),d(e.stackTrace)}}function Pt(o,g){if(o&1){let e=R();j(0),i(1,"mat-paginator",16),w("page",function(t){c(e);let m=v(2);return u(m.onPaginationChange(t))}),n(),q()}if(o&2){let e=v(2);l(),p("length",e.pageTotal)("pageSize",e.pageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function Lt(o,g){if(o&1&&(j(0),i(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),r(6,"Channel"),n(),i(7,"th",9),r(8,"Date"),n(),i(9,"th"),r(10,"Number"),n(),i(11,"th"),r(12,"Exception"),n()()(),i(13,"tbody"),f(14,Nt,14,13,"tr",10),n()(),f(15,Pt,2,3,"ng-container",11),n(),q()),o&2){let e=v();l(14),p("ngForOf",e.exceptions),l(),p("ngIf",(e.exceptions==null?null:e.exceptions.length)>0)}}function Ot(o,g){o&1&&(i(0,"div",17),N(1,"app-empty-state"),n())}var Ye=(()=>{class o{constructor(e){this.http=e,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(e=>{this.exceptions=e.hits.map(a=>({id:a._id,logo:W.getChannelLogoByName(a._source.error?.Type),number:a._source.error.number,date:a._source["@timestamp_received"],stackTrace:a._source.error.stackTrace,message:a._source.message,requestJSON:a._source?.error?.requestJSON})),this.pageTotal=e.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getData()}static{this.\u0275fac=function(a){return new(a||o)(h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-exception-log"]],standalone:!1,decls:8,vars:2,consts:[["EMPTY_STATE",""],["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","140px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-center"],[2,"width","25px",3,"src"],[3,"routerLink","queryParams"],[1,"fw-bold"],[3,"page","length","pageSize","pageIndex"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1&&(i(0,"mainpanel",1)(1,"content")(2,"div",2)(3,"div",3)(4,"div",4),f(5,Lt,16,2,"ng-container",5)(6,Ot,2,0,"ng-template",null,0,J),n()()()()()),a&2){let m=z(7);l(5),p("ngIf",t.exceptions.length>0)("ngIfElse",m)}},dependencies:[Y,E,P,M,Z,K,T],encapsulation:2})}}return o})();var Ke=(()=>{class o{constructor(e){this.httpService=e}getExceptionDetail(e){return this.httpService.post("/api/Orders/GetDetailException",{ID:e}).pipe(ye(t=>t?.hits[0]?._source))}static{this.\u0275fac=function(a){return new(a||o)(be(D))}}static{this.\u0275prov=ce({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();function Vt(o,g){if(o&1&&(i(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),r(6,"General"),n()(),i(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),r(12,"Date"),n(),i(13,"div")(14,"span"),r(15),_(16,"date"),n()()()(),i(17,"div",9)(18,"div",10)(19,"label"),r(20,"Number"),n(),i(21,"div")(22,"span"),r(23),n()()()(),i(24,"div",9)(25,"div",10)(26,"label"),r(27,"Type"),n(),i(28,"div")(29,"span"),r(30),n()()()(),i(31,"div",9)(32,"div",10)(33,"label"),r(34,"ShopID"),n(),i(35,"div")(36,"span"),r(37),n()()()()()()()()(),i(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),r(43,"Request"),n()(),i(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),r(48),_(49,"json"),n()()()()()(),i(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),r(54,"Exception"),n()(),i(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),r(59),n(),i(60,"pre"),r(61),n()()()()()()()()),o&2){let e=g.ngIf;l(15),d(I(16,7,e["@timestamp"],"dd MMM yyyy HH:mm:ss")),l(8),d(e==null||e.error==null?null:e.error.number),l(7),d(e==null||e.error==null?null:e.error.Type),l(7),d(e==null?null:e.shopId),l(11),d(L(49,10,e==null||e.error==null?null:e.error.requestJSON)),l(11),d(e==null?null:e.message),l(2),d(e==null||e.error==null?null:e.error.stackTrace)}}var Ze=(()=>{class o{constructor(e,a){this.activatedRoute=e,this.exceptionService=a,this.invoiceNumber=""}ngOnInit(){let e=this.activatedRoute.snapshot.queryParams;this.getExceptionDetail(e?.ID)}getExceptionDetail(e){this.exceptionDetail$=this.exceptionService.getExceptionDetail(e).pipe(Se(a=>{this.invoiceNumber=a?.error?.number}),Ce(1))}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(Ke))}}static{this.\u0275cmp=x({type:o,selectors:[["app-exception-detail"]],standalone:!1,decls:4,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"],[1,"fw-bold"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"content"),f(2,Vt,62,12,"div",1),_(3,"async"),n()()),a&2&&(p("headerTitle","Order #"+t.invoiceNumber)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),p("ngIf",L(3,4,t.exceptionDetail$)))},dependencies:[E,M,we,F,T],encapsulation:2})}}return o})();function Wt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function Bt(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var Qe=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailSyncOrder",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=W.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=W.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-orderdetail-user"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,Wt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,Bt,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(I(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[E,P,M,F,T],encapsulation:2})}}return o})();var At=[{path:"",component:We,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:qe,canActivate:[O],data:{title:"Order Log"}},{path:"inventory/sync-inventory",component:Ge,canActivate:[O],data:{title:"Product Inventory Sync"}},{path:"rawlog",component:He,canActivate:[O],data:{title:"Raw Log"}},{path:"rawlog/detail",component:ze,canActivate:[O],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",component:Ue,canActivate:[O],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",component:Je,canActivate:[O],data:{title:"Order Details"}},{path:"order/detail-user",component:Qe,canActivate:[O],data:{title:"Order User Details"}},{path:"exception",component:Ye,canActivate:[O],data:{title:"Exception Log"}},{path:"exception/detail",component:Ze,canActivate:[O],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-662ELWF5.js").then(o=>o.InventoryAsyncLogComponent),canActivate:[O],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-PZTMYAA7.js").then(o=>o.InventoryAsyncDetailComponent),canActivate:[O],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-OOJNZDBG.js").then(o=>o.ChannelLogComponent)},canActivate:[O],data:{title:"Authorization Log"}},{path:"origin-order-api",loadComponent(){return import("./chunk-KVKFKGDQ.js").then(o=>o.OrderApiLogComponent)},canActivate:[O],data:{title:"Order Detail Log"}}]}],Xe=(()=>{class o{static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275mod=ne({type:o})}static{this.\u0275inj=ie({imports:[ge,he.forChild(At)]})}}return o})();var $e=(()=>{class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=ne({type:o});static \u0275inj=ie({})}return o})();var en=(()=>{class o{static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275mod=ne({type:o})}static{this.\u0275inj=ie({imports:[ge,De,Me,Xe,he,Le,$e,Ve,Re,ke,Q,Pe]})}}return o})();export{en as LogsModule};
1
+ import{a as Q}from"./chunk-5XVUQWLZ.js";import"./chunk-77IUCPIQ.js";import{a as K}from"./chunk-ZD5LURJS.js";import{a as Oe,b as ke}from"./chunk-OE2JYQHN.js";import"./chunk-PUJ4JVT2.js";import"./chunk-LLZSSV5A.js";import"./chunk-CRC6ZWYT.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as Z,b as Ve}from"./chunk-CVQMAWML.js";import"./chunk-LEHTNMIE.js";import"./chunk-CH2MLZU7.js";import{a as O}from"./chunk-K2UZHZCJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as de,b as pe,d as me,e as Re}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as se}from"./chunk-3DTDXKFQ.js";import{e as D}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as M,n as Le}from"./chunk-ITTRZMEX.js";import{r as Ne,s as Pe}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as oe,h as re,m as ae,o as le,t as Ee,u as Te,y as De,z as Me}from"./chunk-DPLEMBB4.js";import{c as W}from"./chunk-PXB4YEY3.js";import{E as B,F as Ie,H as P,J as he,d as ue,f as Y,g as E,j as we,k as T,l as F,n as ge}from"./chunk-GPEVUTDI.js";import{$c as I,Dc as z,Eb as x,Ec as r,Fb as ne,Fc as d,Gc as V,Ic as y,Jc as C,Kb as f,Kc as S,Pc as U,Qc as A,Wb as p,Z as Ce,Zc as _,_b as xe,_c as L,ad as J,ea as Se,gc as i,hc as n,ic as N,ja as ce,jc as j,ka as ie,kc as q,mc as R,oa as be,ob as H,qb as l,rc as w,sc as v,v as ye,wb as h,ya as c,za as u}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var We=(()=>{class o{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Inventory Sync ",Url:"/menu/log/inventory"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"},{Title:"Origin Order API",Url:"/menu/log/origin-order-api"}]}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=x({type:o,selectors:[["app-logs"]],standalone:!1,decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(a,t){a&1&&(i(0,"nav",0)(1,"div",1)(2,"div"),N(3,"nav-tab",2),n()()(),N(4,"router-outlet")),a&2&&(l(3),p("Tabs",t.ObjectlogTabs))},dependencies:[Ie,Oe],encapsulation:2})}}return o})();var X=(()=>{class o{constructor(){}get Data(){return this._Data}set Data(e){this._Data=e}Fill(e){return this._Data.find(a=>a._id==e)}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275prov=ce({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var et=()=>["/menu/log/order/detail-user"],tt=o=>({ID:o}),it=o=>({"bg-warning":o});function nt(o,g){if(o&1&&(i(0,"span",22),N(1,"img",23),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),V(" ",e.Name," ")}}function ot(o,g){o&1&&(i(0,"th",27)(1,"span",33),r(2," Response Body Warning "),n()())}function rt(o,g){o&1&&(i(0,"th")(1,"span",33),r(2," Number Override "),n()())}function at(o,g){if(o&1&&(i(0,"td",27)(1,"span",36),r(2),n()()),o&2){let e=v().$implicit;l(),p("ngClass",A(2,it,e.responseBodyWarning!=null)),l(),d(e.responseBodyWarning)}}function lt(o,g){if(o&1&&(i(0,"td"),r(1),n()),o&2){let e=v().$implicit;l(),V(" ",e.ResponseBodyWarningReference," ")}}function st(o,g){if(o&1&&(i(0,"tr")(1,"td")(2,"a",34),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n(),i(11,"td",27)(12,"span",35),r(13),n()(),f(14,at,3,4,"td",29)(15,lt,2,1,"td",30),n()),o&2){let e=g.$implicit,a=v(2);l(2),p("routerLink",U(14,et))("queryParams",A(15,tt,e.ID)),l(),V(" ",I(4,11,e.Created,"dd MMM yyyy HH:mm:ss")," "),l(3),d(e.MarketTypeString),l(2),d(e.POSActionTypeString),l(2),d(e.Number),l(2),xe(e.ResponseCode===200||e.ResponseCode===202?"bg-success":"bg-warning"),l(),V(" ",e.ResponseCode," "),l(),p("ngIf",a.responseBodyWarningVisible),l(),p("ngIf",a.responseBodyWarningVisible)}}function dt(o,g){if(o&1){let e=R();j(0),i(1,"div",24)(2,"table",25)(3,"thead")(4,"tr",26)(5,"th"),r(6,"Date"),n(),i(7,"th"),r(8,"Channel"),n(),i(9,"th"),r(10,"Actions"),n(),i(11,"th"),r(12,"Number"),n(),i(13,"th",27)(14,"span",28),r(15," Response Code "),n()(),f(16,ot,3,0,"th",29)(17,rt,3,0,"th",30),n()(),i(18,"tbody"),f(19,st,16,17,"tr",31),n()(),i(20,"mat-paginator",32),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(16),p("ngIf",e.responseBodyWarningVisible),l(),p("ngIf",e.responseBodyWarningVisible),l(2),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function pt(o,g){o&1&&(i(0,"div",37),N(1,"app-empty-state"),n())}var qe=(()=>{class o{constructor(e,a,t,m){this.http=e,this._RawLogService=a,this.route=t,this.authService=m,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""},this.responseBodyWarningVisible=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.route.queryParams.subscribe(e=>{this.responseCode=e.responseCode,this.responseCode!=null?this.Load(e):this.Load()})}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(e){this.filter.Number=e,this.http.post("/api/Orders/Get",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){t._source.log.responseBodyWarning!=null&&(this.responseBodyWarningVisible=!0);let m={ID:t._id,Created:t._source["@timestamp_received"],shopId:t._source.shopId,MarketTypeString:t._source.log.type,POSActionTypeString:t._source.message,Number:t._source.log.number,ResponseCode:t._source.log.responseCode,responseBodyWarning:t._source.log.responseBodyWarning,ResponseBodyWarningReference:t._source.log.ResponseBodyWarningReference};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(B),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-order"]],standalone:!1,decls:43,vars:15,consts:[["EMPTY_STATE",""],["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[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,"mt-5"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["id","listresponseBodyWarning"],["value","number-override"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],["class","text-center",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"],[1,"text-white","p-2","rounded","response-desc",3,"ngClass"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.Number,s)||(t.Number=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"filters")(2,"div")(3,"label",2),r(4,"Channel"),n(),i(5,"ng-select",3),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(6,nt,3,3,"ng-template",4),n()(),i(7,"div",5)(8,"label",2),r(9,"Action"),n(),i(10,"ng-select",6),S("ngModelChange",function(s){return c(m),C(t.filter.ActionType,s)||(t.filter.ActionType=s),u(s)}),n()(),i(11,"div",5)(12,"label",7),r(13,"From/To"),n(),i(14,"div",8)(15,"datepicker",9),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(16,"div")(17,"datepicker",10),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(18,"div",5)(19,"label",11),r(20,"Response Code"),n(),i(21,"input",12),S("ngModelChange",function(s){return c(m),C(t.filter.StatusCode,s)||(t.filter.StatusCode=s),u(s)}),n()(),i(22,"div",5)(23,"label",11),r(24,"Response Body Warning"),n(),i(25,"input",13),S("ngModelChange",function(s){return c(m),C(t.filter.responseBodyWarning,s)||(t.filter.responseBodyWarning=s),u(s)}),n(),i(26,"datalist",14),N(27,"option",15),n()(),i(28,"div",5)(29,"label",11),r(30,"Page Number"),n(),i(31,"input",16),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(32,"div",5)(33,"label",11),r(34,"Page Size"),n(),i(35,"input",17),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()(),i(36,"content")(37,"div",18)(38,"div",19)(39,"div",20),f(40,dt,21,6,"ng-container",21)(41,pt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(42);y("text",t.Number),l(5),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(5),p("clearable",!0)("items",t.ActionTypeList),y("ngModel",t.filter.ActionType),l(5),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.StatusCode),l(4),y("ngModel",t.filter.responseBodyWarning),l(6),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[ue,Y,E,Ee,Te,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,Ne,T],encapsulation:2})}}return o})();var mt=o=>({"bg-gradient-warning":o}),ct=()=>["/menu/log/inventory/sync-inventory/detail"],ut=o=>({ID:o});function gt(o,g){if(o&1&&(i(0,"span",19),N(1,"img",20),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),V(" ",e.Name," ")}}function ht(o,g){if(o&1&&(i(0,"tr",26)(1,"td")(2,"a",27),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n(),i(11,"td"),r(12),n()()),o&2){let e=g.$implicit;p("ngClass",A(11,mt,e.ResponseCode==400)),l(2),p("routerLink",U(13,ct))("queryParams",A(14,ut,e.ID)),l(),V(" ",I(4,8,e.Created,"dd MMM yyyy HH:mm")," "),l(3),d(e.channelName),l(2),d(e.Sku),l(2),d(e.Stock),l(2),d(e.ResponseCode)}}function ft(o,g){if(o&1){let e=R();j(0),i(1,"div",21)(2,"table",22)(3,"thead")(4,"tr",23)(5,"th"),r(6,"Created"),n(),i(7,"th"),r(8,"Channel"),n(),i(9,"th"),r(10,"SKU"),n(),i(11,"th"),r(12,"Stock"),n(),i(13,"th"),r(14,"Response code"),n()()(),i(15,"tbody"),f(16,ht,13,16,"tr",24),n()(),i(17,"mat-paginator",25),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(16),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function vt(o,g){o&1&&(i(0,"div",28),N(1,"app-empty-state"),n())}var Ge=(()=>{class o{constructor(e,a,t){this.http=e,this._RawLogService=a,this.authService=t,this.Result=Array(),this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load(),this.channelOptions=this.authService.getChannels()}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(e=>{this.filter=e.Filter,this.ActionTypeList=e.Options.ActionTypeList,this.Get()})}Get(e){e!=null&&(this.filter.Sku=e),this.http.post("api/Inventory/GetLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){let m={ID:t._source.log.id,Created:t._source["@timestamp_received"],channelName:t._source.log.channelName,Sku:t._source.log.sku,Stock:t._source.log.stock,ResponseCode:t._source.log.responseCode};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-inventory-log"]],standalone:!1,decls:33,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Inventory Sync","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-success"],["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,"mt-5"],[1,"fw-bold","mb-1"],[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","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"ngClass"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.filter.Sku,s)||(t.filter.Sku=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"actions")(2,"a",2),r(3," Order Inventory Sync Job "),n()(),i(4,"filters")(5,"div",3)(6,"div")(7,"label",4),r(8,"Channel"),n(),i(9,"ng-select",5),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(10,gt,3,3,"ng-template",6),n()(),i(11,"div",7)(12,"label",8),r(13,"From/To"),n(),i(14,"div",9)(15,"datepicker",10),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(16,"div")(17,"datepicker",11),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(18,"div",7)(19,"label",12),r(20,"Page Number"),n(),i(21,"input",13),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(22,"div",7)(23,"label",12),r(24,"Page Size"),n(),i(25,"input",14),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()()(),i(26,"content")(27,"div",15)(28,"div",16)(29,"div",17),f(30,ft,18,4,"ng-container",18)(31,vt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(32);y("text",t.filter.Sku),l(9),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[ue,Y,E,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,T],encapsulation:2})}}return o})();var _t=()=>["/menu/log/rawlog/detail"],yt=o=>({ID:o});function Ct(o,g){if(o&1&&(i(0,"span",17),N(1,"img",18),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),V(" ",e.Name," ")}}function St(o,g){if(o&1&&(i(0,"tr")(1,"td")(2,"a",25),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n()()),o&2){let e=g.$implicit;l(2),p("routerLink",U(9,_t))("queryParams",A(10,yt,e.id)),l(),V(" ",I(4,6,e.Created,"dd MMM yyyy HH:mm:ss")," "),l(3),d(e.type),l(2),d(e.number),l(2),d(e.message)}}function bt(o,g){if(o&1){let e=R();j(0),i(1,"div",19)(2,"table",20)(3,"thead",21)(4,"tr")(5,"th",22),r(6,"Date"),n(),i(7,"th"),r(8,"Type"),n(),i(9,"th"),r(10,"Number"),n(),i(11,"th"),r(12,"Message"),n()()(),i(13,"tbody"),f(14,St,11,12,"tr",23),n()(),i(15,"mat-paginator",24),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(14),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function xt(o,g){o&1&&(i(0,"div",26),N(1,"app-empty-state"),n())}var He=(()=>{class o{constructor(e,a,t){this.http=e,this._RawLogService=a,this.authService=t,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(e){this.filter.Number=e,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){let m={id:t._id,message:t._source.message,responseCode:t._source.log.responseCode,processTypeString:t._source.log.processType,type:t._source.log.type,number:t._source.log.number,Created:t._source["@timestamp_received"]};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-raw-log"]],standalone:!1,decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Webhook Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[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,"mt-5"],[1,"fw-bold","mb-1"],[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","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.filter.Number,s)||(t.filter.Number=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"filters")(2,"div")(3,"label",2),r(4,"Channel"),n(),i(5,"ng-select",3),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(6,Ct,3,3,"ng-template",4),n()(),i(7,"div",5)(8,"label",6),r(9,"From/To"),n(),i(10,"div",7)(11,"datepicker",8),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(12,"div")(13,"datepicker",9),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(14,"div",5)(15,"label",10),r(16,"Page Number"),n(),i(17,"input",11),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(18,"div",5)(19,"label",10),r(20,"Page Size"),n(),i(21,"input",12),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()(),i(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),f(26,bt,16,4,"ng-container",16)(27,xt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(28);y("text",t.filter.Number),l(5),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[Y,E,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,T],encapsulation:2})}}return o})();function wt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function It(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var ze=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailChannelWebhook",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=W.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=W.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-raw-detail"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,wt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,It,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(I(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[E,P,M,F,T],encapsulation:2})}}return o})();function Et(o,g){if(o&1&&(i(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),r(4,"General"),n()(),i(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),r(10,"Date"),n(),i(11,"div")(12,"span"),r(13),_(14,"date"),n()()()(),i(15,"div",6)(16,"div",12)(17,"label"),r(18,"SKU"),n(),i(19,"div")(20,"span"),r(21),n()()()(),i(22,"div",6)(23,"div",12)(24,"label"),r(25,"Channel"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",6)(30,"div",12)(31,"label"),r(32,"Response Code"),n(),i(33,"div")(34,"span"),r(35),n()()()()()()()()),o&2){let e=v();l(13),d(I(14,4,e.data.Created,"dd MMM yyyy")),l(8),d(e.data.Sku),l(7),d(e.data.ChannelName),l(7),d(e.data.ResponseCode)}}var Ue=(()=>{class o{constructor(e,a,t){this.route=e,this.http=a,this._RawLogService=t,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(m=>{this.ID=m.ID,this.Load()})}ngOnInit(){}Load(){var e={ID:this.ID};this.http.post("/api/Inventory/GetInventoryLogDeatil",e).subscribe(a=>{this.data.Created=a.hits[0]._source["@timestamp_received"],this.data.Sku=a.hits[0]._source.log.sku,this.data.ChannelName=a.hits[0]._source.log.channelName,this.data.ResponseCode=a.hits[0]._source.log.responseCode,this.request=W.IsNotEmpty(a.hits[0]?._source.log?.request)?JSON.parse(a.hits[0]?._source?.log?.request):"",this.response=a.hits[0]._source.log.response})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D),h(X))}}static{this.\u0275cmp=x({type:o,selectors:[["app-inventory-detail"]],standalone:!1,decls:30,vars:7,consts:[["headerTitle","Product Inventory Sync Detail",3,"hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory/sync-inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3),f(7,Et,36,7,"div",4),n(),i(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),r(13,"Request"),n()(),i(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),r(18),_(19,"json"),n()()()()()(),i(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),r(24,"Response"),n()(),i(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),r(29),n()()()()()()()()()()),a&2&&(p("hideSearchBox",!0)("hideSearchDropdown",!0),l(7),p("ngIf",t.data),l(11),d(L(19,5,t.request)),l(11),d(t.response))},dependencies:[E,P,M,F,T],encapsulation:2})}}return o})();function Tt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function Dt(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var Je=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailChannelWebhook",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=W.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=W.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-orderdetail"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,Tt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,Dt,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(I(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[E,P,M,F,T],encapsulation:2})}}return o})();var Mt=()=>["/menu/log/exception/detail"],Rt=o=>({ID:o});function Nt(o,g){if(o&1&&(i(0,"tr")(1,"td",12),N(2,"img",13),n(),i(3,"td"),r(4),_(5,"date"),n(),i(6,"td")(7,"a",14),r(8),n()(),i(9,"td")(10,"div",15),r(11),n(),i(12,"div"),r(13),n()()()),o&2){let e=g.$implicit;l(2),p("src",e.logo,H),l(2),d(I(5,7,e.date,"dd-MM-yyyy hh:mm:ss")),l(3),p("routerLink",U(10,Mt))("queryParams",A(11,Rt,e.id)),l(),V(" ",e.number," "),l(3),d(e.message),l(2),d(e.stackTrace)}}function Pt(o,g){if(o&1){let e=R();j(0),i(1,"mat-paginator",16),w("page",function(t){c(e);let m=v(2);return u(m.onPaginationChange(t))}),n(),q()}if(o&2){let e=v(2);l(),p("length",e.pageTotal)("pageSize",e.pageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function Lt(o,g){if(o&1&&(j(0),i(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),r(6,"Channel"),n(),i(7,"th",9),r(8,"Date"),n(),i(9,"th"),r(10,"Number"),n(),i(11,"th"),r(12,"Exception"),n()()(),i(13,"tbody"),f(14,Nt,14,13,"tr",10),n()(),f(15,Pt,2,3,"ng-container",11),n(),q()),o&2){let e=v();l(14),p("ngForOf",e.exceptions),l(),p("ngIf",(e.exceptions==null?null:e.exceptions.length)>0)}}function Ot(o,g){o&1&&(i(0,"div",17),N(1,"app-empty-state"),n())}var Ye=(()=>{class o{constructor(e){this.http=e,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(e=>{this.exceptions=e.hits.map(a=>({id:a._id,logo:W.getChannelLogoByName(a._source.error?.Type),number:a._source.error.number,date:a._source["@timestamp_received"],stackTrace:a._source.error.stackTrace,message:a._source.message,requestJSON:a._source?.error?.requestJSON})),this.pageTotal=e.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getData()}static{this.\u0275fac=function(a){return new(a||o)(h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-exception-log"]],standalone:!1,decls:8,vars:2,consts:[["EMPTY_STATE",""],["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","140px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-center"],[2,"width","25px",3,"src"],[3,"routerLink","queryParams"],[1,"fw-bold"],[3,"page","length","pageSize","pageIndex"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1&&(i(0,"mainpanel",1)(1,"content")(2,"div",2)(3,"div",3)(4,"div",4),f(5,Lt,16,2,"ng-container",5)(6,Ot,2,0,"ng-template",null,0,J),n()()()()()),a&2){let m=z(7);l(5),p("ngIf",t.exceptions.length>0)("ngIfElse",m)}},dependencies:[Y,E,P,M,Z,K,T],encapsulation:2})}}return o})();var Ke=(()=>{class o{constructor(e){this.httpService=e}getExceptionDetail(e){return this.httpService.post("/api/Orders/GetDetailException",{ID:e}).pipe(ye(t=>t?.hits[0]?._source))}static{this.\u0275fac=function(a){return new(a||o)(be(D))}}static{this.\u0275prov=ce({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();function Vt(o,g){if(o&1&&(i(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),r(6,"General"),n()(),i(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),r(12,"Date"),n(),i(13,"div")(14,"span"),r(15),_(16,"date"),n()()()(),i(17,"div",9)(18,"div",10)(19,"label"),r(20,"Number"),n(),i(21,"div")(22,"span"),r(23),n()()()(),i(24,"div",9)(25,"div",10)(26,"label"),r(27,"Type"),n(),i(28,"div")(29,"span"),r(30),n()()()(),i(31,"div",9)(32,"div",10)(33,"label"),r(34,"ShopID"),n(),i(35,"div")(36,"span"),r(37),n()()()()()()()()(),i(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),r(43,"Request"),n()(),i(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),r(48),_(49,"json"),n()()()()()(),i(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),r(54,"Exception"),n()(),i(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),r(59),n(),i(60,"pre"),r(61),n()()()()()()()()),o&2){let e=g.ngIf;l(15),d(I(16,7,e["@timestamp"],"dd MMM yyyy HH:mm:ss")),l(8),d(e==null||e.error==null?null:e.error.number),l(7),d(e==null||e.error==null?null:e.error.Type),l(7),d(e==null?null:e.shopId),l(11),d(L(49,10,e==null||e.error==null?null:e.error.requestJSON)),l(11),d(e==null?null:e.message),l(2),d(e==null||e.error==null?null:e.error.stackTrace)}}var Ze=(()=>{class o{constructor(e,a){this.activatedRoute=e,this.exceptionService=a,this.invoiceNumber=""}ngOnInit(){let e=this.activatedRoute.snapshot.queryParams;this.getExceptionDetail(e?.ID)}getExceptionDetail(e){this.exceptionDetail$=this.exceptionService.getExceptionDetail(e).pipe(Se(a=>{this.invoiceNumber=a?.error?.number}),Ce(1))}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(Ke))}}static{this.\u0275cmp=x({type:o,selectors:[["app-exception-detail"]],standalone:!1,decls:4,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"],[1,"fw-bold"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"content"),f(2,Vt,62,12,"div",1),_(3,"async"),n()()),a&2&&(p("headerTitle","Order #"+t.invoiceNumber)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),p("ngIf",L(3,4,t.exceptionDetail$)))},dependencies:[E,M,we,F,T],encapsulation:2})}}return o})();function Wt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function Bt(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var Qe=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailSyncOrder",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=W.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=W.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-orderdetail-user"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,Wt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,Bt,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(I(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[E,P,M,F,T],encapsulation:2})}}return o})();var At=[{path:"",component:We,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:qe,canActivate:[O],data:{title:"Order Log"}},{path:"inventory/sync-inventory",component:Ge,canActivate:[O],data:{title:"Product Inventory Sync"}},{path:"rawlog",component:He,canActivate:[O],data:{title:"Raw Log"}},{path:"rawlog/detail",component:ze,canActivate:[O],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",component:Ue,canActivate:[O],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",component:Je,canActivate:[O],data:{title:"Order Details"}},{path:"order/detail-user",component:Qe,canActivate:[O],data:{title:"Order User Details"}},{path:"exception",component:Ye,canActivate:[O],data:{title:"Exception Log"}},{path:"exception/detail",component:Ze,canActivate:[O],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-662ELWF5.js").then(o=>o.InventoryAsyncLogComponent),canActivate:[O],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-PZTMYAA7.js").then(o=>o.InventoryAsyncDetailComponent),canActivate:[O],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-VMAJA64B.js").then(o=>o.ChannelLogComponent)},canActivate:[O],data:{title:"Authorization Log"}},{path:"origin-order-api",loadComponent(){return import("./chunk-5V2G4JZI.js").then(o=>o.OrderApiLogComponent)},canActivate:[O],data:{title:"Order Detail Log"}}]}],Xe=(()=>{class o{static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275mod=ne({type:o})}static{this.\u0275inj=ie({imports:[ge,he.forChild(At)]})}}return o})();var $e=(()=>{class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=ne({type:o});static \u0275inj=ie({})}return o})();var en=(()=>{class o{static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275mod=ne({type:o})}static{this.\u0275inj=ie({imports:[ge,De,Me,Xe,he,Le,$e,Ve,Re,ke,Q,Pe]})}}return o})();export{en as LogsModule};
@@ -1 +1 @@
1
- import{j as l}from"./chunk-3PJZW7HF.js";import{b as c}from"./chunk-BUFEIJAI.js";import{G as a}from"./chunk-GPEVUTDI.js";import{ja as n,oa as r}from"./chunk-T5ONJF63.js";var v=(()=>{class e{constructor(o,t,i){this.toastr=o,this.authService=t,this.router=i}canActivate(o,t){let i=JSON.parse(window.localStorage.getItem("user")),u=new Date,s=!1;if(i!=null){let p=new Date(i.Token.expiredAt);u<p?s=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return s}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(t){return new(t||e)(r(c),r(l),r(a))}}static{this.\u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{v as a};
1
+ import{j as l}from"./chunk-3DTDXKFQ.js";import{b as c}from"./chunk-BUFEIJAI.js";import{G as a}from"./chunk-GPEVUTDI.js";import{ja as n,oa as r}from"./chunk-T5ONJF63.js";var v=(()=>{class e{constructor(o,t,i){this.toastr=o,this.authService=t,this.router=i}canActivate(o,t){let i=JSON.parse(window.localStorage.getItem("user")),u=new Date,s=!1;if(i!=null){let p=new Date(i.Token.expiredAt);u<p?s=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return s}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(t){return new(t||e)(r(c),r(l),r(a))}}static{this.\u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{v as a};