marketplacepos 3.13.0 → 3.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/Marketplace/{chunk-AZMGWQHI.js → chunk-44NPBPWD.js} +1 -1
  2. package/Marketplace/{chunk-RUBFBYVI.js → chunk-4IP4M4HU.js} +1 -1
  3. package/Marketplace/{chunk-27IRFADU.js → chunk-7GGXFJTH.js} +1 -1
  4. package/Marketplace/{chunk-CW5KDBLU.js → chunk-7Q56WDU6.js} +1 -1
  5. package/Marketplace/{chunk-WLSW7EOC.js → chunk-CBQON7JZ.js} +1 -1
  6. package/Marketplace/{chunk-AKIUNZCW.js → chunk-CJTMR3XH.js} +1 -1
  7. package/Marketplace/{chunk-ZIWIIY7R.js → chunk-DIUAKNJ7.js} +1 -1
  8. package/Marketplace/{chunk-GY7H2DNW.js → chunk-GIZWO6Z7.js} +1 -1
  9. package/Marketplace/{chunk-PVQ2T5XH.js → chunk-IOH6ZWW2.js} +1 -1
  10. package/Marketplace/{chunk-7OJNNBCN.js → chunk-ISHKU4HS.js} +1 -1
  11. package/Marketplace/{chunk-RSTDY3BK.js → chunk-IXXBZERD.js} +1 -1
  12. package/Marketplace/{chunk-B6W4BWFY.js → chunk-JAFFZL32.js} +1 -1
  13. package/Marketplace/{chunk-ENYT723T.js → chunk-JODEGY3A.js} +1 -1
  14. package/Marketplace/{chunk-52ZJ2S2T.js → chunk-KYHILYCS.js} +1 -1
  15. package/Marketplace/{chunk-2KLUGZKI.js → chunk-O2A46B27.js} +1 -1
  16. package/Marketplace/{chunk-5US3733H.js → chunk-O7ORKR43.js} +1 -1
  17. package/Marketplace/chunk-OQANLBWC.js +3 -0
  18. package/Marketplace/{chunk-M3P5OJ7T.js → chunk-RVULTBBA.js} +1 -1
  19. package/Marketplace/{chunk-HMAXDG3A.js → chunk-T6ZAW4FG.js} +1 -1
  20. package/Marketplace/{chunk-H6JEFAAC.js → chunk-TZKWQXOG.js} +1 -1
  21. package/Marketplace/{chunk-II3E425T.js → chunk-VTTUEN2J.js} +1 -1
  22. package/Marketplace/{chunk-XT632VDA.js → chunk-WBRE5DAH.js} +1 -1
  23. package/Marketplace/{chunk-VW2YGC3V.js → chunk-Y4G6RN56.js} +1 -1
  24. package/Marketplace/{chunk-ZIAISN44.js → chunk-Y7E7FG5M.js} +1 -1
  25. package/Marketplace/index.html +2 -2
  26. package/Marketplace/{main-NPVQUDS5.js → main-A3GNL4C4.js} +1 -1
  27. package/package.json +1 -1
  28. package/Marketplace/chunk-HW7H3ISH.js +0 -3
@@ -1 +1 @@
1
- import{g as c}from"./chunk-PVQ2T5XH.js";import{b as a}from"./chunk-IPX66YIX.js";import{$ as s,ca as o}from"./chunk-77JORVC2.js";var d=(()=>{let e=class e{constructor(i,t){this.toastr=i,this.authService=t}canActivate(i,t){let n=JSON.parse(window.localStorage.getItem("user")),l=new Date;if(n!=null){let p=new Date(n.Token.expiredAt);return l<p?!0:(this.onTokenExpired(),!1)}else return this.onTokenExpired(),!1}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired").onShown.subscribe(()=>this.authService.logout())}};e.\u0275fac=function(t){return new(t||e)(o(a),o(c))},e.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{d as a};
1
+ import{g as c}from"./chunk-IOH6ZWW2.js";import{b as a}from"./chunk-IPX66YIX.js";import{$ as s,ca as o}from"./chunk-77JORVC2.js";var d=(()=>{let e=class e{constructor(i,t){this.toastr=i,this.authService=t}canActivate(i,t){let n=JSON.parse(window.localStorage.getItem("user")),l=new Date;if(n!=null){let p=new Date(n.Token.expiredAt);return l<p?!0:(this.onTokenExpired(),!1)}else return this.onTokenExpired(),!1}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired").onShown.subscribe(()=>this.authService.logout())}};e.\u0275fac=function(t){return new(t||e)(o(a),o(c))},e.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{d as a};
@@ -1 +1 @@
1
- import{a as B}from"./chunk-AKIUNZCW.js";import{a as vt}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-N23ZYP7G.js";import{a as dt,b as ft,d as ut,e as gt}from"./chunk-2Y4N4NSS.js";import{g as st}from"./chunk-PVQ2T5XH.js";import{e as at}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{l as k,m as ht}from"./chunk-PIDUM6XT.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{h as lt,k as mt,u as ct}from"./chunk-F5YRASNU.js";import{c as pt}from"./chunk-2UXFUEON.js";import{Eb as K,Fb as l,Ga as W,Gb as s,Ha as H,Hb as x,Ia as m,Ja as v,Jb as Q,Kb as X,Lb as Y,Ob as Z,Pb as tt,Q as j,Qb as et,T as q,V as U,Wb as d,Xb as _,Ya as u,Yb as S,Zb as it,_a as p,aa as I,bd as rt,c as z,ed as F,ga as y,gd as R,ha as N,kb as r,lb as o,mb as D,nb as g,oa as b,ob as h,pa as E,pc as nt,q as C,qb as G,rc as ot,sc as T,tb as V,vb as f,vc as w,wc as M,yb as J,yc as P,zc as L}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var Et=(t,e)=>({"bg-gradient-danger":t,"bg-gradient-warning":e}),Dt=()=>["/menu/notification/detail"],Tt=t=>({ID:t});function wt(t,e){if(t&1&&(r(0,"span",14),D(1,"img",15),o(),l(2)),t&2){let n=e.item;m(),p("src",n.Img,H)("alt",n.Name),m(),x(" ",n.Name," ")}}function Mt(t,e){if(t&1&&(g(0),l(1),d(2,"number"),r(3,"span"),l(4,"s"),o(),h()),t&2){let n=f().$implicit;m(),x(" ",S(2,1,n.DurationInSecond,"1.1-1")," ")}}function Pt(t,e){t&1&&l(0," - ")}function Lt(t,e){if(t&1&&(g(0),r(1,"tr",16)(2,"td")(3,"a",17),D(4,"img",18),r(5,"span"),l(6),o()()(),r(7,"td")(8,"b"),l(9),o(),D(10,"div",19),o(),r(11,"td"),u(12,Mt,5,4,"ng-container",20)(13,Pt,1,0,"ng-template",null,0,it),o(),r(15,"td"),l(16),o(),r(17,"td"),l(18),d(19,"date"),o()(),h()),t&2){let n=e.$implicit,a=K(14);m(),p("ngClass",et(14,Et,n.Status==1,n.Status==0)),m(2),p("routerLink",Z(17,Dt))("queryParams",tt(18,Tt,n.ID)),m(),J("src",n.Img,H),m(2),s(n.Name),m(3),s(n.Label),m(),p("innerHTML",n.Message,W),m(2),p("ngIf",n.DurationInSecond)("ngIfElse",a),m(4),s(n.StatusLabel),m(2),s(S(19,11,n.Created,"dd MMM yyyy HH:mm"))}}function Ft(t,e){if(t&1){let n=G();g(0),r(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),d(4,"async"),d(5,"async"),V("total",function(){b(n);let i=f(2);return E(i.getRowCount())})("next",function(){b(n);let i=f(2);return E(i.onNextPage())})("previous",function(){b(n);let i=f(2);return E(i.onPreviousPage())}),o()()(),h()}if(t&2){let n=f().ngIf,a=f();m(3),p("filter",a.filter)("totaldata",n==null?null:n.length)("paginationTotal",_(4,4,a.rowCount$))("hasClicked",_(5,6,a.rowCount$))}}function Rt(t,e){if(t&1&&(g(0),u(1,Ft,6,8,"ng-container",13),h()),t&2){let n=e.ngIf;m(),p("ngIf",n.length>0)}}var _t=(()=>{let e=class e{constructor(a,i,c){this.http=a,this.notificationService=i,this.authService=c,this.filter=new vt,this.destroy$=new z,this.channelOptions=c.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(U(this.destroy$)).subscribe(a=>{a.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(a=>{this.filter=a.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let a={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",a).pipe(C(i=>i.Data),C(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),j(1))}setTimeToSecond(a){return a=a.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),a}setChannelLogoToNotifications(a){return a=a.map(i=>(i.Img=pt.getChannelLogoByTypeId(i.TypeID),i)),a}onNextPage(){this.filter.PageNumber+=1,this.getNotifications()}onPreviousPage(){this.filter.PageNumber-=1,this.getNotifications()}getRowCount(){let a={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",a).pipe(C(i=>i.Count),j(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};e.\u0275fac=function(i){return new(i||e)(v(at),v(B),v(st))},e.\u0275cmp=y({type:e,selectors:[["app-notification"]],decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,c){i&1&&(r(0,"mainpanel",1),V("onSubmit",function(){return c.onFilter()}),r(1,"filters")(2,"div")(3,"h6",2),l(4,"Channel"),o(),r(5,"ng-select",3),Y("ngModelChange",function(O){return X(c.filter.ChannelID,O)||(c.filter.ChannelID=O),O}),u(6,wt,3,3,"ng-template",4),o()()(),r(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),l(16,"Channel"),o(),r(17,"th"),l(18,"Process"),o(),r(19,"th"),l(20,"Duration"),o(),r(21,"th"),l(22,"Status"),o(),r(23,"th"),l(24,"Created"),o()()(),r(25,"tbody"),u(26,Lt,20,20,"ng-container",12),d(27,"async"),o()()()()(),u(28,Rt,2,1,"ng-container",13),d(29,"async"),o()()()),i&2&&(m(5),p("clearable",!0)("items",c.channelOptions),Q("ngModel",c.filter.ChannelID),m(21),p("ngForOf",_(27,5,c.notifications$)),m(2),p("ngIf",_(29,7,c.notifications$)))},dependencies:[nt,ot,T,ut,dt,ft,lt,mt,k,F,$,w,P,M]});let t=e;return t})();function Bt(t,e){if(t&1&&(r(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),l(4,"Perflog"),o()(),r(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),l(9),o()()()()()()),t&2){let n=f().ngIf;m(9),s(n.Perflog)}}function kt(t,e){if(t&1&&(g(0),r(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),l(5,"StackTrace"),o()(),r(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),l(10),o()()()()()(),h()),t&2){let n=f().ngIf;m(10),s(n==null?null:n.StackTrace)}}function $t(t,e){if(t&1&&(g(0),r(1,"mainpanel",1)(2,"actions")(3,"a",2),l(4,"Back"),o()(),r(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),l(12,"General"),o()(),r(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),l(18,"Created Date"),o(),r(19,"div")(20,"span"),l(21),d(22,"date"),o()()()(),r(23,"div",10)(24,"div",11)(25,"label"),l(26,"Status"),o(),r(27,"div")(28,"span"),l(29),o()()()()(),r(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),l(34,"Duration"),o(),r(35,"div")(36,"span"),l(37),d(38,"number"),o()()()(),r(39,"div",10)(40,"div",11)(41,"label"),l(42,"Label"),o(),r(43,"div")(44,"span"),l(45),o()()()()()()()()(),r(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),l(51,"Message"),o()(),r(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),l(56),o()()()()()(),u(57,Bt,10,1,"div",16)(58,kt,11,1,"ng-container",0),o()()()(),h()),t&2){let n=e.ngIf;m(),p("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),s(S(22,10,n.Created,"dd MMM yyyy HH:mm:ss")),m(8),s(n.StatusLabel),m(8),x("",S(38,13,n.DurationInSecond,"1.1-1")," s"),m(8),s(n.Label),m(11),s(n.Message),m(),p("ngIf",n==null?null:n.Perflog),m(),p("ngIf",n==null?null:n.StackTrace)}}var Ct=(()=>{let e=class e{constructor(a,i){this.activatedRoute=a,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(q(a=>{let i=a.ID;return this.notificationService.getNotificationDetail(i).pipe(C(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};e.\u0275fac=function(i){return new(i||e)(v(rt),v(B))},e.\u0275cmp=y({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,c){i&1&&(u(0,$t,59,16,"ng-container",0),d(1,"async")),i&2&&p("ngIf",_(1,1,c.notification$))},dependencies:[T,k,F,w,P,M]});let t=e;return t})();var Ot=[{path:"",component:_t},{path:"detail",component:Ct}],St=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=N({type:e}),e.\u0275inj=I({imports:[L,R.forChild(Ot)]});let t=e;return t})();var de=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=N({type:e}),e.\u0275inj=I({imports:[L,St,gt,ct,ht,R,$]});let t=e;return t})();export{de as NotificationModule};
1
+ import{a as B}from"./chunk-CJTMR3XH.js";import{a as vt}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-N23ZYP7G.js";import{a as dt,b as ft,d as ut,e as gt}from"./chunk-2Y4N4NSS.js";import{g as st}from"./chunk-IOH6ZWW2.js";import{e as at}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{l as k,m as ht}from"./chunk-PIDUM6XT.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{h as lt,k as mt,u as ct}from"./chunk-F5YRASNU.js";import{c as pt}from"./chunk-2UXFUEON.js";import{Eb as K,Fb as l,Ga as W,Gb as s,Ha as H,Hb as x,Ia as m,Ja as v,Jb as Q,Kb as X,Lb as Y,Ob as Z,Pb as tt,Q as j,Qb as et,T as q,V as U,Wb as d,Xb as _,Ya as u,Yb as S,Zb as it,_a as p,aa as I,bd as rt,c as z,ed as F,ga as y,gd as R,ha as N,kb as r,lb as o,mb as D,nb as g,oa as b,ob as h,pa as E,pc as nt,q as C,qb as G,rc as ot,sc as T,tb as V,vb as f,vc as w,wc as M,yb as J,yc as P,zc as L}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var Et=(t,e)=>({"bg-gradient-danger":t,"bg-gradient-warning":e}),Dt=()=>["/menu/notification/detail"],Tt=t=>({ID:t});function wt(t,e){if(t&1&&(r(0,"span",14),D(1,"img",15),o(),l(2)),t&2){let n=e.item;m(),p("src",n.Img,H)("alt",n.Name),m(),x(" ",n.Name," ")}}function Mt(t,e){if(t&1&&(g(0),l(1),d(2,"number"),r(3,"span"),l(4,"s"),o(),h()),t&2){let n=f().$implicit;m(),x(" ",S(2,1,n.DurationInSecond,"1.1-1")," ")}}function Pt(t,e){t&1&&l(0," - ")}function Lt(t,e){if(t&1&&(g(0),r(1,"tr",16)(2,"td")(3,"a",17),D(4,"img",18),r(5,"span"),l(6),o()()(),r(7,"td")(8,"b"),l(9),o(),D(10,"div",19),o(),r(11,"td"),u(12,Mt,5,4,"ng-container",20)(13,Pt,1,0,"ng-template",null,0,it),o(),r(15,"td"),l(16),o(),r(17,"td"),l(18),d(19,"date"),o()(),h()),t&2){let n=e.$implicit,a=K(14);m(),p("ngClass",et(14,Et,n.Status==1,n.Status==0)),m(2),p("routerLink",Z(17,Dt))("queryParams",tt(18,Tt,n.ID)),m(),J("src",n.Img,H),m(2),s(n.Name),m(3),s(n.Label),m(),p("innerHTML",n.Message,W),m(2),p("ngIf",n.DurationInSecond)("ngIfElse",a),m(4),s(n.StatusLabel),m(2),s(S(19,11,n.Created,"dd MMM yyyy HH:mm"))}}function Ft(t,e){if(t&1){let n=G();g(0),r(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),d(4,"async"),d(5,"async"),V("total",function(){b(n);let i=f(2);return E(i.getRowCount())})("next",function(){b(n);let i=f(2);return E(i.onNextPage())})("previous",function(){b(n);let i=f(2);return E(i.onPreviousPage())}),o()()(),h()}if(t&2){let n=f().ngIf,a=f();m(3),p("filter",a.filter)("totaldata",n==null?null:n.length)("paginationTotal",_(4,4,a.rowCount$))("hasClicked",_(5,6,a.rowCount$))}}function Rt(t,e){if(t&1&&(g(0),u(1,Ft,6,8,"ng-container",13),h()),t&2){let n=e.ngIf;m(),p("ngIf",n.length>0)}}var _t=(()=>{let e=class e{constructor(a,i,c){this.http=a,this.notificationService=i,this.authService=c,this.filter=new vt,this.destroy$=new z,this.channelOptions=c.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(U(this.destroy$)).subscribe(a=>{a.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(a=>{this.filter=a.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let a={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",a).pipe(C(i=>i.Data),C(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),j(1))}setTimeToSecond(a){return a=a.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),a}setChannelLogoToNotifications(a){return a=a.map(i=>(i.Img=pt.getChannelLogoByTypeId(i.TypeID),i)),a}onNextPage(){this.filter.PageNumber+=1,this.getNotifications()}onPreviousPage(){this.filter.PageNumber-=1,this.getNotifications()}getRowCount(){let a={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",a).pipe(C(i=>i.Count),j(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};e.\u0275fac=function(i){return new(i||e)(v(at),v(B),v(st))},e.\u0275cmp=y({type:e,selectors:[["app-notification"]],decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,c){i&1&&(r(0,"mainpanel",1),V("onSubmit",function(){return c.onFilter()}),r(1,"filters")(2,"div")(3,"h6",2),l(4,"Channel"),o(),r(5,"ng-select",3),Y("ngModelChange",function(O){return X(c.filter.ChannelID,O)||(c.filter.ChannelID=O),O}),u(6,wt,3,3,"ng-template",4),o()()(),r(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),l(16,"Channel"),o(),r(17,"th"),l(18,"Process"),o(),r(19,"th"),l(20,"Duration"),o(),r(21,"th"),l(22,"Status"),o(),r(23,"th"),l(24,"Created"),o()()(),r(25,"tbody"),u(26,Lt,20,20,"ng-container",12),d(27,"async"),o()()()()(),u(28,Rt,2,1,"ng-container",13),d(29,"async"),o()()()),i&2&&(m(5),p("clearable",!0)("items",c.channelOptions),Q("ngModel",c.filter.ChannelID),m(21),p("ngForOf",_(27,5,c.notifications$)),m(2),p("ngIf",_(29,7,c.notifications$)))},dependencies:[nt,ot,T,ut,dt,ft,lt,mt,k,F,$,w,P,M]});let t=e;return t})();function Bt(t,e){if(t&1&&(r(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),l(4,"Perflog"),o()(),r(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),l(9),o()()()()()()),t&2){let n=f().ngIf;m(9),s(n.Perflog)}}function kt(t,e){if(t&1&&(g(0),r(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),l(5,"StackTrace"),o()(),r(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),l(10),o()()()()()(),h()),t&2){let n=f().ngIf;m(10),s(n==null?null:n.StackTrace)}}function $t(t,e){if(t&1&&(g(0),r(1,"mainpanel",1)(2,"actions")(3,"a",2),l(4,"Back"),o()(),r(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),l(12,"General"),o()(),r(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),l(18,"Created Date"),o(),r(19,"div")(20,"span"),l(21),d(22,"date"),o()()()(),r(23,"div",10)(24,"div",11)(25,"label"),l(26,"Status"),o(),r(27,"div")(28,"span"),l(29),o()()()()(),r(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),l(34,"Duration"),o(),r(35,"div")(36,"span"),l(37),d(38,"number"),o()()()(),r(39,"div",10)(40,"div",11)(41,"label"),l(42,"Label"),o(),r(43,"div")(44,"span"),l(45),o()()()()()()()()(),r(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),l(51,"Message"),o()(),r(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),l(56),o()()()()()(),u(57,Bt,10,1,"div",16)(58,kt,11,1,"ng-container",0),o()()()(),h()),t&2){let n=e.ngIf;m(),p("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),s(S(22,10,n.Created,"dd MMM yyyy HH:mm:ss")),m(8),s(n.StatusLabel),m(8),x("",S(38,13,n.DurationInSecond,"1.1-1")," s"),m(8),s(n.Label),m(11),s(n.Message),m(),p("ngIf",n==null?null:n.Perflog),m(),p("ngIf",n==null?null:n.StackTrace)}}var Ct=(()=>{let e=class e{constructor(a,i){this.activatedRoute=a,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(q(a=>{let i=a.ID;return this.notificationService.getNotificationDetail(i).pipe(C(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};e.\u0275fac=function(i){return new(i||e)(v(rt),v(B))},e.\u0275cmp=y({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,c){i&1&&(u(0,$t,59,16,"ng-container",0),d(1,"async")),i&2&&p("ngIf",_(1,1,c.notification$))},dependencies:[T,k,F,w,P,M]});let t=e;return t})();var Ot=[{path:"",component:_t},{path:"detail",component:Ct}],St=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=N({type:e}),e.\u0275inj=I({imports:[L,R.forChild(Ot)]});let t=e;return t})();var de=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=N({type:e}),e.\u0275inj=I({imports:[L,St,gt,ct,ht,R,$]});let t=e;return t})();export{de as NotificationModule};
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-FX43R2N5.js";import{a as he,b as Ce,d as fe,e as xe}from"./chunk-2Y4N4NSS.js";import{a as $}from"./chunk-BSBYMQ7J.js";import{a as Ve,b as j,c as De}from"./chunk-BRTVFFDI.js";import"./chunk-662E5VTA.js";import{a as Te,c as Ee}from"./chunk-NNPT3RN6.js";import{a as Fe,b as Me}from"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import{a as Pe}from"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as ge}from"./chunk-PVQ2T5XH.js";import{b as le,e as re}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as ye,k as Ie,l as we,m as be}from"./chunk-PIDUM6XT.js";import{t as Se,u as ve}from"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{b as se,c as pe,h as ce,k as me,m as _e,u as de}from"./chunk-F5YRASNU.js";import{c as D,f as ue}from"./chunk-2UXFUEON.js";import{B as z,Eb as O,Fb as c,Gb as V,Ha as F,Hb as P,Ia as s,Ib as Z,Ja as T,Jb as I,Kb as w,Lb as b,Mb as X,Nb as q,Pb as k,Q as G,Wb as h,X as B,Xb as f,Ya as u,Yb as N,Zb as U,_a as m,da as H,fb as v,ga as Y,gb as L,ib as A,jb as W,kb as o,lb as l,mb as x,nb as M,oa as _,ob as E,pa as d,pc as J,qb as y,rc as ee,sc as te,tb as S,vb as r,vc as ne,wc as ie,yb as K,yc as ae,zc as oe}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var Re=n=>({"text-decoration-line-through":n}),Be=n=>({"ms-10":n}),Le=n=>({"bg-gradient-warning":n});function Ae(n,p){if(n&1){let e=y();o(0,"button",37),S("click",function(){_(e);let t=r().ngIf,a=r(2);return d(a.updateStock(t))}),x(1,"i",38),c(2," Update "),l()}}function We(n,p){if(n&1&&(o(0,"div"),u(1,Ae,3,0,"button",36),l()),n&2){let e=p.ngIf,i=r(2);s(),m("ngIf",i.productService.hasSelectionVariant(e))}}function Oe(n,p){if(n&1&&(o(0,"span",39),x(1,"img",40),l(),c(2)),n&2){let e=p.item;s(),m("src",e==null?null:e.Img,F),s(),P(" ",e.Name," ")}}function Ue(n,p){n&1&&(o(0,"div",41)(1,"span"),c(2," showing only different stock, please press next to populate more data "),l()())}function $e(n,p){if(n&1){let e=y();o(0,"th")(1,"input",42),b("ngModelChange",function(t){_(e);let a=r(2);return w(a.checkboxState,t)||(a.checkboxState=t),d(t)}),S("ngModelChange",function(){let t=_(e).ngIf,a=r(2);return d(a.onCheckboxStateChange(t))}),l()()}if(n&2){let e=r(2);s(),I("ngModel",e.checkboxState)}}function je(n,p){n&1&&(o(0,"th",33),c(1," Reserved "),l())}function Qe(n,p){}function ze(n,p){if(n&1){let e=y();o(0,"input",61),b("ngModelChange",function(t){_(e);let a=r(3).$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),S("ngModelChange",function(){_(e);let t=r(3).$implicit,a=r(2);return d(a.onCheckboxStateProduct(t))}),l()}if(n&2){let e=r(3).$implicit;I("ngModel",e.selected)}}function Ge(n,p){if(n&1){let e=y();o(0,"img",62),S("click",function(t){_(e);let a=r(3).$implicit,C=r(2);return d(C.onZoomImage(t,a==null?null:a.ImageUrl))}),l()}if(n&2){let e=r(3).$implicit;K("src",e==null?null:e.ThumbnailUrl,F)}}function He(n,p){n&1&&x(0,"img",58)}function Ye(n,p){if(n&1&&(x(0,"br"),o(1,"div",63),x(2,"i",64),o(3,"small"),c(4),l()()),n&2){let e=r(3).$implicit;s(4),P("(",e==null?null:e.Category,")")}}function Ke(n,p){if(n&1&&(o(0,"td",54)(1,"div",15),u(2,ze,1,1,"input",55),o(3,"div",56),u(4,Ge,1,1,"img",57)(5,He,1,0,"img",58),l()()(),o(6,"td",59)(7,"span",60),c(8),l(),u(9,Ye,5,1),l()),n&2){let e=r(2).$implicit,i=r(2);m("rowSpan",e==null?null:e.Variants.length),s(2),v(e.Variants.length>1?2:-1),s(),m("ngClass",k(7,Be,e.Variants.length<=1)),s(),v(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),V(e==null?null:e.Name),s(),v(e.CategoryID!==null&&e.CategoryID!=i.guidEmpty?9:-1)}}function Ze(n,p){if(n&1){let e=y();o(0,"input",42),b("ngModelChange",function(t){_(e);let a=r(2).$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),l()}if(n&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Xe(n,p){if(n&1&&u(0,Ze,1,1,"input",48),n&2){let e=r().$implicit;v((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(n,p){if(n&1){let e=y();o(0,"input",42),b("ngModelChange",function(t){_(e);let a=r().$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),l()}if(n&2){let e=r().$implicit;I("ngModel",e.selected)}}function Je(n,p){n&1&&(o(0,"div",65),c(1," Not Found "),l())}function et(n,p){if(n&1&&(o(0,"div")(1,"span",66),c(2),h(3,"number"),l(),c(4," => "),o(5,"span",67),c(6),h(7,"number"),l()()),n&2){let e=r().$implicit;s(2),P(" ",f(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),V(f(7,4,e==null?null:e.Inventory))}}function tt(n,p){if(n&1&&(c(0),h(1,"number")),n&2){let e=r().$implicit;P(" ",f(1,1,e==null?null:e.Inventory)," ")}}function nt(n,p){if(n&1&&(M(0),o(1,"div",68)(2,"a",69),x(3,"i",70),l()(),E()),n&2){let e=r().$implicit,i=r(3);s(2),m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F)}}function it(n,p){if(n&1){let e=y();o(0,"span",75),S("click",function(){let t=_(e).ngIf,a=r(2).$implicit,C=r().$implicit,g=r(2);return d(g.openTableDialog(C,a,t))}),c(1),h(2,"number"),l()}if(n&2){let e=r(2).$implicit;s(),P(" ",f(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function at(n,p){if(n&1){let e=y();o(0,"td",71)(1,"div",49)(2,"div"),u(3,it,3,3,"span",72),h(4,"async"),l(),o(5,"div",68)(6,"a",69),x(7,"i",70),l()(),o(8,"div",68)(9,"span",73),S("click",function(){_(e);let t=r().$implicit,a=r(3);return d(a.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",74),l()()()()}if(n&2){let e=r().$implicit,i=r(3);m("ngClass",k(5,Le,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",f(4,3,i.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,F)}}function ot(n,p){if(n&1&&(M(0),o(1,"span",76),c(2),h(3,"number"),l(),E()),n&2){let e=r(2).$implicit;s(2),P(" (",f(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function lt(n,p){n&1&&c(0," - ")}function rt(n,p){if(n&1&&(M(0),o(1,"td",45),u(2,ot,4,3,"ng-container",53)(3,lt,1,0,"ng-template",null,1,U),l(),E()),n&2){let e=O(4),i=r().$implicit;s(2),m("ngIf",i==null||i.Channel[0]==null?null:i.Channel[0].InventoryReserved)("ngIfElse",e)}}function st(n,p){n&1&&(M(0),c(1," - "),E())}function pt(n,p){if(n&1&&(o(0,"span",77),h(1,"date"),c(2),h(3,"date"),l()),n&2){let e=r().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),P(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function ct(n,p){if(n&1&&(o(0,"tr"),u(1,Ke,10,9),o(2,"td",44),c(3),l(),o(4,"td",45)(5,"span",46),c(6),l()(),o(7,"td",47),u(8,Xe,1,1)(9,qe,1,1,"input",48),l(),o(10,"td")(11,"div",49),u(12,Je,2,0,"div",50)(13,et,8,6,"div")(14,tt,2,3)(15,nt,4,1,"ng-container",5),l()(),u(16,at,11,7,"td",51)(17,rt,5,2,"ng-container",5),o(18,"td",52),u(19,st,2,0,"ng-container",53)(20,pt,4,8,"ng-template",null,0,U),l()()),n&2){let e=p.$implicit,i=p.index,t=O(21),a=r(3);s(),v(i==0?1:-1),s(2),V(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?a.discontinuedVariantMsg:"")("ngClass",k(14,Re,e.Discontinued)),s(),V(e==null?null:e.Code),s(2),v((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),v((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),v((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",a.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==a.minDate)("ngIfElse",t)}}function mt(n,p){if(n&1&&(o(0,"tbody"),A(1,Qe,0,0,null,null,L),u(3,ct,22,16,"tr",43),l()),n&2){let e=p.$implicit;s(),W(e.Variants),s(2),m("ngForOf",e.Variants)}}function _t(n,p){if(n&1){let e=y();o(0,"mainpanel",3),S("onSubmit",function(t){_(e);let a=r();return d(a.onSearch(t))}),o(1,"actions")(2,"div",4),u(3,We,2,1,"div",5),h(4,"async"),l()(),o(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),l(),o(9,"ng-select",7),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.ChannelID,t)||(a.searchFilter.ChannelID=t),d(t)}),u(10,Oe,3,2,"ng-template",8),l()(),o(11,"div",9)(12,"label",10),c(13,"PageNumber"),l(),o(14,"input",11),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.PageNumber,t)||(a.searchFilter.PageNumber=t),d(t)}),l()(),o(15,"div",9)(16,"label",12),c(17,"Page Size"),l(),o(18,"input",13),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.RowCount,t)||(a.searchFilter.RowCount=t),d(t)}),l()(),o(19,"div",9)(20,"label",14),c(21,"Quantity From - To"),l(),o(22,"div",15)(23,"input",16),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.QuantityFrom,t)||(a.searchFilter.QuantityFrom=t),d(t)}),l(),c(24," - "),o(25,"input",17),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.QuantityTo,t)||(a.searchFilter.QuantityTo=t),d(t)}),l()()()(),o(26,"content")(27,"div",18)(28,"div",19)(29,"div",20),u(30,Ue,3,0,"div",21),o(31,"table",22)(32,"thead",23)(33,"tr")(34,"th",24),c(35," Product "),x(36,"br"),o(37,"mat-slide-toggle",25),S("toggleChange",function(){_(e);let t=r();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),o(38,"small",14),c(39,"FILTER DIFFERENT INVENTORY"),l()()(),o(40,"th",26),c(41,"Variant"),l(),o(42,"th",27),c(43,"SKU"),l(),u(44,$e,2,1,"th",5),h(45,"async"),o(46,"th",28),c(47,"POS"),l(),o(48,"th",29)(49,"div",30),S("click",function(){_(e);let t=r();return d(t.openModalFilter())}),x(50,"img",31),o(51,"span",32),c(52),h(53,"stringLimit"),l()()(),u(54,je,2,0,"th",33),o(55,"th",34),c(56,"Last Sync"),l()()(),A(57,mt,4,1,"tbody",null,L),h(59,"async"),l(),o(60,"infinite-paginator",35),h(61,"async"),S("onNextPage",function(){_(e);let t=r();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r();return d(t.onLastPage())})("onGetRowCount",function(){_(e);let t=r();return d(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()()()()}if(n&2){let e=r();m("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),m("ngIf",f(4,24,e.products$)),s(6),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),s(5),I("ngModel",e.searchFilter.PageNumber),s(4),I("ngModel",e.searchFilter.RowCount),s(5),I("ngModel",e.searchFilter.QuantityFrom),s(2),I("ngModel",e.searchFilter.QuantityTo),s(5),m("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),m("ngIf",f(45,26,e.products$)),s(5),m("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?e.selectedChannel==null?null:e.selectedChannel.Name:""),s(),m("src",e.selectedChannel==null?null:e.selectedChannel.Img,F),s(2),Z(" ",N(53,28,e.selectedChannel==null?null:e.selectedChannel.Name,13),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?"...":""," "),s(2),v(e.isShowReservedColumn?54:-1),s(3),W(f(59,31,e.products$)),s(3),m("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",f(61,33,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.goToLastPage())}}var Gt=(()=>{let p=class p{constructor(i,t,a,C,g,Q,ke,Ne){this.http=i,this.toastr=t,this.dialog=a,this.productService=C,this.authService=g,this.biggerPictureService=Q,this.inventoryService=ke,this.mainPanelService=Ne,this.infinitePagination=H(j),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=D.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=D.GuidEMpty,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(B(i=>{this.checkShowReservedColumn(i)}),G())}checkShowReservedColumn(i){let t=0,a;i.forEach(C=>{a=C.Variants.find(g=>D.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),a&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(i=>{this.searchFilter={RowCount:i.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:i.Filter.ChannelID},this.initSelectedChannel(),this.infinitePagination.reloadPagination(this.searchFilter),this.showToastrMarketplaceInactive(!i.Filter.IsMarketplaceAppActive)}))}showToastrMarketplaceInactive(i){i&&this.toastr.warning(`Automatic inventory sync disabled.
1
+ import{a as R}from"./chunk-FX43R2N5.js";import{a as he,b as Ce,d as fe,e as xe}from"./chunk-2Y4N4NSS.js";import{a as $}from"./chunk-BSBYMQ7J.js";import{a as Ve,b as j,c as De}from"./chunk-BRTVFFDI.js";import"./chunk-662E5VTA.js";import{a as Te,c as Ee}from"./chunk-NNPT3RN6.js";import{a as Fe,b as Me}from"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import{a as Pe}from"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as ge}from"./chunk-IOH6ZWW2.js";import{b as le,e as re}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as ye,k as Ie,l as we,m as be}from"./chunk-PIDUM6XT.js";import{t as Se,u as ve}from"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{b as se,c as pe,h as ce,k as me,m as _e,u as de}from"./chunk-F5YRASNU.js";import{c as D,f as ue}from"./chunk-2UXFUEON.js";import{B as z,Eb as O,Fb as c,Gb as V,Ha as F,Hb as P,Ia as s,Ib as Z,Ja as T,Jb as I,Kb as w,Lb as b,Mb as X,Nb as q,Pb as k,Q as G,Wb as h,X as B,Xb as f,Ya as u,Yb as N,Zb as U,_a as m,da as H,fb as v,ga as Y,gb as L,ib as A,jb as W,kb as o,lb as l,mb as x,nb as M,oa as _,ob as E,pa as d,pc as J,qb as y,rc as ee,sc as te,tb as S,vb as r,vc as ne,wc as ie,yb as K,yc as ae,zc as oe}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var Re=n=>({"text-decoration-line-through":n}),Be=n=>({"ms-10":n}),Le=n=>({"bg-gradient-warning":n});function Ae(n,p){if(n&1){let e=y();o(0,"button",37),S("click",function(){_(e);let t=r().ngIf,a=r(2);return d(a.updateStock(t))}),x(1,"i",38),c(2," Update "),l()}}function We(n,p){if(n&1&&(o(0,"div"),u(1,Ae,3,0,"button",36),l()),n&2){let e=p.ngIf,i=r(2);s(),m("ngIf",i.productService.hasSelectionVariant(e))}}function Oe(n,p){if(n&1&&(o(0,"span",39),x(1,"img",40),l(),c(2)),n&2){let e=p.item;s(),m("src",e==null?null:e.Img,F),s(),P(" ",e.Name," ")}}function Ue(n,p){n&1&&(o(0,"div",41)(1,"span"),c(2," showing only different stock, please press next to populate more data "),l()())}function $e(n,p){if(n&1){let e=y();o(0,"th")(1,"input",42),b("ngModelChange",function(t){_(e);let a=r(2);return w(a.checkboxState,t)||(a.checkboxState=t),d(t)}),S("ngModelChange",function(){let t=_(e).ngIf,a=r(2);return d(a.onCheckboxStateChange(t))}),l()()}if(n&2){let e=r(2);s(),I("ngModel",e.checkboxState)}}function je(n,p){n&1&&(o(0,"th",33),c(1," Reserved "),l())}function Qe(n,p){}function ze(n,p){if(n&1){let e=y();o(0,"input",61),b("ngModelChange",function(t){_(e);let a=r(3).$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),S("ngModelChange",function(){_(e);let t=r(3).$implicit,a=r(2);return d(a.onCheckboxStateProduct(t))}),l()}if(n&2){let e=r(3).$implicit;I("ngModel",e.selected)}}function Ge(n,p){if(n&1){let e=y();o(0,"img",62),S("click",function(t){_(e);let a=r(3).$implicit,C=r(2);return d(C.onZoomImage(t,a==null?null:a.ImageUrl))}),l()}if(n&2){let e=r(3).$implicit;K("src",e==null?null:e.ThumbnailUrl,F)}}function He(n,p){n&1&&x(0,"img",58)}function Ye(n,p){if(n&1&&(x(0,"br"),o(1,"div",63),x(2,"i",64),o(3,"small"),c(4),l()()),n&2){let e=r(3).$implicit;s(4),P("(",e==null?null:e.Category,")")}}function Ke(n,p){if(n&1&&(o(0,"td",54)(1,"div",15),u(2,ze,1,1,"input",55),o(3,"div",56),u(4,Ge,1,1,"img",57)(5,He,1,0,"img",58),l()()(),o(6,"td",59)(7,"span",60),c(8),l(),u(9,Ye,5,1),l()),n&2){let e=r(2).$implicit,i=r(2);m("rowSpan",e==null?null:e.Variants.length),s(2),v(e.Variants.length>1?2:-1),s(),m("ngClass",k(7,Be,e.Variants.length<=1)),s(),v(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),V(e==null?null:e.Name),s(),v(e.CategoryID!==null&&e.CategoryID!=i.guidEmpty?9:-1)}}function Ze(n,p){if(n&1){let e=y();o(0,"input",42),b("ngModelChange",function(t){_(e);let a=r(2).$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),l()}if(n&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Xe(n,p){if(n&1&&u(0,Ze,1,1,"input",48),n&2){let e=r().$implicit;v((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(n,p){if(n&1){let e=y();o(0,"input",42),b("ngModelChange",function(t){_(e);let a=r().$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),l()}if(n&2){let e=r().$implicit;I("ngModel",e.selected)}}function Je(n,p){n&1&&(o(0,"div",65),c(1," Not Found "),l())}function et(n,p){if(n&1&&(o(0,"div")(1,"span",66),c(2),h(3,"number"),l(),c(4," => "),o(5,"span",67),c(6),h(7,"number"),l()()),n&2){let e=r().$implicit;s(2),P(" ",f(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),V(f(7,4,e==null?null:e.Inventory))}}function tt(n,p){if(n&1&&(c(0),h(1,"number")),n&2){let e=r().$implicit;P(" ",f(1,1,e==null?null:e.Inventory)," ")}}function nt(n,p){if(n&1&&(M(0),o(1,"div",68)(2,"a",69),x(3,"i",70),l()(),E()),n&2){let e=r().$implicit,i=r(3);s(2),m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F)}}function it(n,p){if(n&1){let e=y();o(0,"span",75),S("click",function(){let t=_(e).ngIf,a=r(2).$implicit,C=r().$implicit,g=r(2);return d(g.openTableDialog(C,a,t))}),c(1),h(2,"number"),l()}if(n&2){let e=r(2).$implicit;s(),P(" ",f(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function at(n,p){if(n&1){let e=y();o(0,"td",71)(1,"div",49)(2,"div"),u(3,it,3,3,"span",72),h(4,"async"),l(),o(5,"div",68)(6,"a",69),x(7,"i",70),l()(),o(8,"div",68)(9,"span",73),S("click",function(){_(e);let t=r().$implicit,a=r(3);return d(a.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",74),l()()()()}if(n&2){let e=r().$implicit,i=r(3);m("ngClass",k(5,Le,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",f(4,3,i.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,F)}}function ot(n,p){if(n&1&&(M(0),o(1,"span",76),c(2),h(3,"number"),l(),E()),n&2){let e=r(2).$implicit;s(2),P(" (",f(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function lt(n,p){n&1&&c(0," - ")}function rt(n,p){if(n&1&&(M(0),o(1,"td",45),u(2,ot,4,3,"ng-container",53)(3,lt,1,0,"ng-template",null,1,U),l(),E()),n&2){let e=O(4),i=r().$implicit;s(2),m("ngIf",i==null||i.Channel[0]==null?null:i.Channel[0].InventoryReserved)("ngIfElse",e)}}function st(n,p){n&1&&(M(0),c(1," - "),E())}function pt(n,p){if(n&1&&(o(0,"span",77),h(1,"date"),c(2),h(3,"date"),l()),n&2){let e=r().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),P(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function ct(n,p){if(n&1&&(o(0,"tr"),u(1,Ke,10,9),o(2,"td",44),c(3),l(),o(4,"td",45)(5,"span",46),c(6),l()(),o(7,"td",47),u(8,Xe,1,1)(9,qe,1,1,"input",48),l(),o(10,"td")(11,"div",49),u(12,Je,2,0,"div",50)(13,et,8,6,"div")(14,tt,2,3)(15,nt,4,1,"ng-container",5),l()(),u(16,at,11,7,"td",51)(17,rt,5,2,"ng-container",5),o(18,"td",52),u(19,st,2,0,"ng-container",53)(20,pt,4,8,"ng-template",null,0,U),l()()),n&2){let e=p.$implicit,i=p.index,t=O(21),a=r(3);s(),v(i==0?1:-1),s(2),V(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?a.discontinuedVariantMsg:"")("ngClass",k(14,Re,e.Discontinued)),s(),V(e==null?null:e.Code),s(2),v((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),v((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),v((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",a.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==a.minDate)("ngIfElse",t)}}function mt(n,p){if(n&1&&(o(0,"tbody"),A(1,Qe,0,0,null,null,L),u(3,ct,22,16,"tr",43),l()),n&2){let e=p.$implicit;s(),W(e.Variants),s(2),m("ngForOf",e.Variants)}}function _t(n,p){if(n&1){let e=y();o(0,"mainpanel",3),S("onSubmit",function(t){_(e);let a=r();return d(a.onSearch(t))}),o(1,"actions")(2,"div",4),u(3,We,2,1,"div",5),h(4,"async"),l()(),o(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),l(),o(9,"ng-select",7),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.ChannelID,t)||(a.searchFilter.ChannelID=t),d(t)}),u(10,Oe,3,2,"ng-template",8),l()(),o(11,"div",9)(12,"label",10),c(13,"PageNumber"),l(),o(14,"input",11),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.PageNumber,t)||(a.searchFilter.PageNumber=t),d(t)}),l()(),o(15,"div",9)(16,"label",12),c(17,"Page Size"),l(),o(18,"input",13),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.RowCount,t)||(a.searchFilter.RowCount=t),d(t)}),l()(),o(19,"div",9)(20,"label",14),c(21,"Quantity From - To"),l(),o(22,"div",15)(23,"input",16),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.QuantityFrom,t)||(a.searchFilter.QuantityFrom=t),d(t)}),l(),c(24," - "),o(25,"input",17),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.QuantityTo,t)||(a.searchFilter.QuantityTo=t),d(t)}),l()()()(),o(26,"content")(27,"div",18)(28,"div",19)(29,"div",20),u(30,Ue,3,0,"div",21),o(31,"table",22)(32,"thead",23)(33,"tr")(34,"th",24),c(35," Product "),x(36,"br"),o(37,"mat-slide-toggle",25),S("toggleChange",function(){_(e);let t=r();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),o(38,"small",14),c(39,"FILTER DIFFERENT INVENTORY"),l()()(),o(40,"th",26),c(41,"Variant"),l(),o(42,"th",27),c(43,"SKU"),l(),u(44,$e,2,1,"th",5),h(45,"async"),o(46,"th",28),c(47,"POS"),l(),o(48,"th",29)(49,"div",30),S("click",function(){_(e);let t=r();return d(t.openModalFilter())}),x(50,"img",31),o(51,"span",32),c(52),h(53,"stringLimit"),l()()(),u(54,je,2,0,"th",33),o(55,"th",34),c(56,"Last Sync"),l()()(),A(57,mt,4,1,"tbody",null,L),h(59,"async"),l(),o(60,"infinite-paginator",35),h(61,"async"),S("onNextPage",function(){_(e);let t=r();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r();return d(t.onLastPage())})("onGetRowCount",function(){_(e);let t=r();return d(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()()()()}if(n&2){let e=r();m("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),m("ngIf",f(4,24,e.products$)),s(6),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),s(5),I("ngModel",e.searchFilter.PageNumber),s(4),I("ngModel",e.searchFilter.RowCount),s(5),I("ngModel",e.searchFilter.QuantityFrom),s(2),I("ngModel",e.searchFilter.QuantityTo),s(5),m("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),m("ngIf",f(45,26,e.products$)),s(5),m("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?e.selectedChannel==null?null:e.selectedChannel.Name:""),s(),m("src",e.selectedChannel==null?null:e.selectedChannel.Img,F),s(2),Z(" ",N(53,28,e.selectedChannel==null?null:e.selectedChannel.Name,13),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?"...":""," "),s(2),v(e.isShowReservedColumn?54:-1),s(3),W(f(59,31,e.products$)),s(3),m("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",f(61,33,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.goToLastPage())}}var Gt=(()=>{let p=class p{constructor(i,t,a,C,g,Q,ke,Ne){this.http=i,this.toastr=t,this.dialog=a,this.productService=C,this.authService=g,this.biggerPictureService=Q,this.inventoryService=ke,this.mainPanelService=Ne,this.infinitePagination=H(j),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=D.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=D.GuidEMpty,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(B(i=>{this.checkShowReservedColumn(i)}),G())}checkShowReservedColumn(i){let t=0,a;i.forEach(C=>{a=C.Variants.find(g=>D.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),a&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(i=>{this.searchFilter={RowCount:i.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:i.Filter.ChannelID},this.initSelectedChannel(),this.infinitePagination.reloadPagination(this.searchFilter),this.showToastrMarketplaceInactive(!i.Filter.IsMarketplaceAppActive)}))}showToastrMarketplaceInactive(i){i&&this.toastr.warning(`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(i=>i.ID==this.searchFilter.ChannelID)}onSearch(i){this.searchFilter.text=i,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(i){let t=this.productService.selectedVariantProduct(i);if(t.length>0){let a=t.map(g=>({ID:g.ID,Code:g.Code,Inventory:g.Inventory})),C={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",C).subscribe(g=>{this.searchFilter.PageNumber=1,this.infinitePagination.reloadPagination(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(g)})}}handlingUpdateStock(i){if(i[0]?.StatusProduct){let t=i[0].StatusProduct.Fail_list,a=i[0].StatusProduct.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",a,t)}else this.toastr.error(i[0]?.Exception,"Error")}refreshInventory(i,t,a,C){let g={ChannelItemID:i,ChannelVariationID:t,ChannelID:a,VariantID:C};this.http.post("/api/Inventory/RefreshInventoryChannel",g).subscribe(Q=>{this.toastr.success("Successfully updated","Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onCheckboxStateProduct(i){i.Variants=i.Variants.map(t=>(t.Inventory>=0&&(t.selected=i.selected),t))}onCheckboxStateChange(i){i=i.map(t=>(t.Variants=t.Variants.map(a=>(a.selected=this.checkboxState,a)),t))}openTableDialog(i,t,a){this.dialog.open(Ve,{data:{Name:i.Name,Variant:t,ChannelID:t?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:i.ChannelItemID}}).afterClosed().pipe(z(g=>D.IsNotEmpty(g))).subscribe(g=>{this.updateItemAfterDialog(g,a)})}updateItemAfterDialog(i,t){let a={ID:i.ChannelID,ChannelItemID:i.ChannelItemID,ChannelVariantID:i.ChannelVariationID,NewQuantity:parseFloat(i.Inventory),VariantID:i.ID,SKU:i.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(C=>{this.searchFilter.PageNumber=1,this.infinitePagination.reloadPagination(this.searchFilter),this.handlingUpdateStock([C])})}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=$.DIFFERENCE:this.searchFilter.filterModel=$.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}onLastPage(){let i={ChannelID:this.searchFilter.ChannelID,PageNumber:1};this.http.post(`${this.rowCountApi}`,i).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.infinitePagination.onLastPage(this.searchFilter,t.Total)}})}onZoomImage(i,t){this.biggerPictureService.openBiggerPicture(i,t)}};p.\u0275fac=function(t){return new(t||p)(T(re),T(le),T(ye),T(Te),T(ge),T(Pe),T(R),T(Ie))},p.\u0275cmp=Y({type:p,selectors:[["app-single-channel-comparison"]],standalone:!0,features:[X([j,R]),q],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","ng-select",1,"fw-bold"],["id","ng-select","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text","mt-3",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"me-2"],[2,"width","18px",3,"src"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"align-middle"],["type","checkbox",3,"ngModel"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],["type","checkbox",1,"me-3",3,"ngModel"],[3,"ngClass"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-end",3,"ngClass"],["class","cursor",3,"click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"cursor",3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(t,a){t&1&&(u(0,_t,62,35,"mainpanel",2),h(1,"async")),t&2&&m("ngIf",f(1,1,a.loader$))},dependencies:[oe,J,ee,te,ne,ae,ie,be,we,xe,fe,he,Ce,de,pe,_e,se,ce,me,Ee,De,ue,Me,Fe,ve,Se],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let n=p;return n})();export{Gt as SingleChannelComparisonComponent};
@@ -1 +1 @@
1
- import{a as b}from"./chunk-CVLA5R75.js";import{a as h,b as P}from"./chunk-TX43EE6N.js";import{a as C}from"./chunk-N23ZYP7G.js";import{c as M}from"./chunk-DXJFMERC.js";import{b as O}from"./chunk-7NWB2VB2.js";import"./chunk-IP2WADIR.js";import"./chunk-MEGPKKGI.js";import{e as s}from"./chunk-2Y4N4NSS.js";import{a as p}from"./chunk-M3P5OJ7T.js";import"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import"./chunk-PVQ2T5XH.js";import"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{m as u}from"./chunk-PIDUM6XT.js";import{u as f}from"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{u as g}from"./chunk-F5YRASNU.js";import"./chunk-2UXFUEON.js";import{aa as e,cd as l,ga as d,gd as m,ha as r,mb as c,zc as i}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var _=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=d({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(n,v){n&1&&c(0,"router-outlet")},dependencies:[l],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=t;return o})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-RUBFBYVI.js").then(o=>o.StatusModule),canActivate:[p]},{path:"download",loadChildren:()=>import("./chunk-ENYT723T.js").then(o=>o.DownloadModule),canActivate:[p]}]}],w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,m.forChild(y)]});let o=t;return o})();var W=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,m,w,f,u,s,O,C,M,h,P,b]});let o=t;return o})();export{W as ProductModule};
1
+ import{a as b}from"./chunk-CVLA5R75.js";import{a as h,b as P}from"./chunk-TX43EE6N.js";import{a as C}from"./chunk-N23ZYP7G.js";import{c as M}from"./chunk-DXJFMERC.js";import{b as O}from"./chunk-7NWB2VB2.js";import"./chunk-IP2WADIR.js";import"./chunk-MEGPKKGI.js";import{e as s}from"./chunk-2Y4N4NSS.js";import{a as p}from"./chunk-RVULTBBA.js";import"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import"./chunk-IOH6ZWW2.js";import"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{m as u}from"./chunk-PIDUM6XT.js";import{u as f}from"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{u as g}from"./chunk-F5YRASNU.js";import"./chunk-2UXFUEON.js";import{aa as e,cd as l,ga as d,gd as m,ha as r,mb as c,zc as i}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var _=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=d({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(n,v){n&1&&c(0,"router-outlet")},dependencies:[l],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=t;return o})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-4IP4M4HU.js").then(o=>o.StatusModule),canActivate:[p]},{path:"download",loadChildren:()=>import("./chunk-JODEGY3A.js").then(o=>o.DownloadModule),canActivate:[p]}]}],w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,m.forChild(y)]});let o=t;return o})();var W=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,m,w,f,u,s,O,C,M,h,P,b]});let o=t;return o})();export{W as ProductModule};
@@ -1,4 +1,4 @@
1
- import{a as Se}from"./chunk-BMPACBBM.js";import{a as ke,b as Me,c as Ji,d as Oe,e as Xi}from"./chunk-F2CKDRNC.js";import{a as Pe}from"./chunk-FCVAME75.js";import{a as nn}from"./chunk-CP7VAKTQ.js";import{a as dn}from"./chunk-LIS3LB3F.js";import{f as on,g as ln,h as sn,i as cn,j as pn}from"./chunk-7GNI4BOW.js";import"./chunk-OFRBPREK.js";import{a as un,b as hn,c as _n,d as fn,e as gn,f as Cn,g as yn}from"./chunk-DZHNXVSW.js";import"./chunk-3LRKHZJF.js";import{a as en,b as tn}from"./chunk-7CEWM7GE.js";import{a as ve}from"./chunk-CVLA5R75.js";import{b as mn}from"./chunk-7NWB2VB2.js";import{b as an}from"./chunk-IP2WADIR.js";import"./chunk-MEGPKKGI.js";import{a as Ee,b as De,c as Ui,d as ye,e as Yi}from"./chunk-2Y4N4NSS.js";import{a as $e}from"./chunk-M3P5OJ7T.js";import{a as vn,b as Sn}from"./chunk-2GZOVNPU.js";import{a as Bi}from"./chunk-662E5VTA.js";import{a as rn}from"./chunk-NNPT3RN6.js";import"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import"./chunk-AAIK6JQ3.js";import{f as We,g as Ce}from"./chunk-PVQ2T5XH.js";import{b as it,e as X}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{b as Ki,d as nt,e as $i,f as qi,g as Zi,l as se,m as Qi}from"./chunk-PIDUM6XT.js";import{t as Gi,u as ji}from"./chunk-43TMSPFC.js";import{P as zi}from"./chunk-4TYJR476.js";import{a as Wi,b as jt,c as ge,h as ne,k as ae,m as Ie,u as Kt}from"./chunk-F5YRASNU.js";import{b as B,c as U}from"./chunk-2UXFUEON.js";import{$ as Ve,$a as ki,Ab as Ft,Ac as Yt,B as xi,Bb as Rt,Ca as Nt,Cb as ot,Db as lt,Eb as z,Fb as d,Gb as S,Ha as K,Hb as O,Ia as s,Ib as Li,Ja as w,Jb as P,Kb as L,La as Di,Lb as N,Mb as Ht,Nb as G,Oa as Vt,Ob as _e,Pa as At,Pb as oe,Pc as Fi,Q as vt,Qb as te,Qc as St,T as Ti,Tb as Ni,Tc as st,Ua as ci,Ub as Vi,Uc as Ri,Va as he,Wb as H,Wc as bt,X as mt,Xa as Ge,Xb as j,Ya as g,Yb as ie,Za as R,Zb as le,_ as Ii,_a as m,aa as de,ab as Mi,bd as zt,c as li,ca as xe,cb as Q,cd as Hi,da as Lt,ed as Te,fc as Ai,ga as V,gc as F,gd as Gt,ha as me,hc as Re,ia as Je,kb as o,lb as l,mb as C,na as Ei,nb as E,nc as et,oa as _,ob as D,pa as f,pb as je,pc as tt,q as pe,qa as re,qb as M,ra as si,rc as J,sa as ue,sc as q,tb as b,tc as Wt,uc as Bt,vb as p,vc as Ut,w as wi,wb as Xe,wc as Z,xb as Ke,ya as ze,yb as Oi,yc as fe,za as ee,zb as Pi,zc as He}from"./chunk-77JORVC2.js";import{a as Qe,b as bi}from"./chunk-CRRJCY55.js";var bn=(()=>{let r=class r{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[Bi.downloadOrder]}]}ngOnInit(){}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=V({type:r,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(i,n){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),l()()(),C(4,"router-outlet")),i&2&&(s(3),m("Tabs",n.ObjectOrderTabs)("usePermissions",!0))},dependencies:[en,Hi]});let a=r;return a})();var wn=(()=>{let r=class r{constructor(){}convertToCSV(t,i){let n;if(typeof t=="string")n=t;else{var c=typeof t=="object"?t:JSON.parse(t);n=this.transformToCSVStringFormat(c)}this.downloadCSV(n,i)}transformToCSVStringFormat(t){if(!t||!t.length)return;let i=",",n=Object.keys(t[0]);return t.map(h=>n.map(u=>{let v=h[u]===null||h[u]===void 0?"":h[u];return v=v instanceof Date?v.toLocaleString():v.toString().replace(/"/g,'""'),v.search(/("|,|\n)/g)>=0&&(v=`"${v}"`),v}).join(i)).join(`
1
+ import{a as Se}from"./chunk-BMPACBBM.js";import{a as ke,b as Me,c as Ji,d as Oe,e as Xi}from"./chunk-F2CKDRNC.js";import{a as Pe}from"./chunk-FCVAME75.js";import{a as nn}from"./chunk-CP7VAKTQ.js";import{a as dn}from"./chunk-LIS3LB3F.js";import{f as on,g as ln,h as sn,i as cn,j as pn}from"./chunk-7GNI4BOW.js";import"./chunk-OFRBPREK.js";import{a as un,b as hn,c as _n,d as fn,e as gn,f as Cn,g as yn}from"./chunk-DZHNXVSW.js";import"./chunk-3LRKHZJF.js";import{a as en,b as tn}from"./chunk-7CEWM7GE.js";import{a as ve}from"./chunk-CVLA5R75.js";import{b as mn}from"./chunk-7NWB2VB2.js";import{b as an}from"./chunk-IP2WADIR.js";import"./chunk-MEGPKKGI.js";import{a as Ee,b as De,c as Ui,d as ye,e as Yi}from"./chunk-2Y4N4NSS.js";import{a as $e}from"./chunk-RVULTBBA.js";import{a as vn,b as Sn}from"./chunk-2GZOVNPU.js";import{a as Bi}from"./chunk-662E5VTA.js";import{a as rn}from"./chunk-NNPT3RN6.js";import"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import"./chunk-AAIK6JQ3.js";import{f as We,g as Ce}from"./chunk-IOH6ZWW2.js";import{b as it,e as X}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{b as Ki,d as nt,e as $i,f as qi,g as Zi,l as se,m as Qi}from"./chunk-PIDUM6XT.js";import{t as Gi,u as ji}from"./chunk-43TMSPFC.js";import{P as zi}from"./chunk-4TYJR476.js";import{a as Wi,b as jt,c as ge,h as ne,k as ae,m as Ie,u as Kt}from"./chunk-F5YRASNU.js";import{b as B,c as U}from"./chunk-2UXFUEON.js";import{$ as Ve,$a as ki,Ab as Ft,Ac as Yt,B as xi,Bb as Rt,Ca as Nt,Cb as ot,Db as lt,Eb as z,Fb as d,Gb as S,Ha as K,Hb as O,Ia as s,Ib as Li,Ja as w,Jb as P,Kb as L,La as Di,Lb as N,Mb as Ht,Nb as G,Oa as Vt,Ob as _e,Pa as At,Pb as oe,Pc as Fi,Q as vt,Qb as te,Qc as St,T as Ti,Tb as Ni,Tc as st,Ua as ci,Ub as Vi,Uc as Ri,Va as he,Wb as H,Wc as bt,X as mt,Xa as Ge,Xb as j,Ya as g,Yb as ie,Za as R,Zb as le,_ as Ii,_a as m,aa as de,ab as Mi,bd as zt,c as li,ca as xe,cb as Q,cd as Hi,da as Lt,ed as Te,fc as Ai,ga as V,gc as F,gd as Gt,ha as me,hc as Re,ia as Je,kb as o,lb as l,mb as C,na as Ei,nb as E,nc as et,oa as _,ob as D,pa as f,pb as je,pc as tt,q as pe,qa as re,qb as M,ra as si,rc as J,sa as ue,sc as q,tb as b,tc as Wt,uc as Bt,vb as p,vc as Ut,w as wi,wb as Xe,wc as Z,xb as Ke,ya as ze,yb as Oi,yc as fe,za as ee,zb as Pi,zc as He}from"./chunk-77JORVC2.js";import{a as Qe,b as bi}from"./chunk-CRRJCY55.js";var bn=(()=>{let r=class r{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[Bi.downloadOrder]}]}ngOnInit(){}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=V({type:r,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(i,n){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),l()()(),C(4,"router-outlet")),i&2&&(s(3),m("Tabs",n.ObjectOrderTabs)("usePermissions",!0))},dependencies:[en,Hi]});let a=r;return a})();var wn=(()=>{let r=class r{constructor(){}convertToCSV(t,i){let n;if(typeof t=="string")n=t;else{var c=typeof t=="object"?t:JSON.parse(t);n=this.transformToCSVStringFormat(c)}this.downloadCSV(n,i)}transformToCSVStringFormat(t){if(!t||!t.length)return;let i=",",n=Object.keys(t[0]);return t.map(h=>n.map(u=>{let v=h[u]===null||h[u]===void 0?"":h[u];return v=v instanceof Date?v.toLocaleString():v.toString().replace(/"/g,'""'),v.search(/("|,|\n)/g)>=0&&(v=`"${v}"`),v}).join(i)).join(`
2
2
  `)}downloadCSV(t,i){var n=new Blob([t],{type:"text/csv;charset=utf8;"}),c=document.createElement("a");c.setAttribute("href",window.URL.createObjectURL(n)),c.setAttribute("download",i),document.body.appendChild(c),c.click(),document.body.removeChild(c)}};r.\u0275fac=function(i){return new(i||r)},r.\u0275prov=Ve({token:r,factory:r.\u0275fac,providedIn:"root"});let a=r;return a})();var ut=(()=>{let r=class r{constructor(t,i,n,c){this.http=t,this.dialog=i,this.toastr=n,this.exportService=c}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(t){return this.http.post("/api/orders/GetNewOrder",t).pipe(pe(i=>i.Data))}getTotalNewOrders(t,i,n){let c={ListChannelID:t,From:i,To:n};return this.http.post("/api/orders/GetCountNewOrder",c).pipe(pe(h=>h.Count))}exportOrders(t,i){return this.http.post("api/Orders/ExportOrder",t).pipe(mt(n=>{this.exportService.convertToCSV(n,i)}))}};r.\u0275fac=function(i){return new(i||r)(xe(X),xe(nt),xe(it),xe(wn))},r.\u0275prov=Ve({token:r,factory:r.\u0275fac});let a=r;return a})();var qt=(()=>{let r=class r{constructor(t,i){this.http=t,this.toastr=i}acceptTokopediaOrders(t){return this.http.post("/api/Orders/AcceptOrderTokopedia",t).pipe(mt(i=>{this.tokopediaAcceptOrderHandler(i)}))}tokopediaAcceptOrderHandler(t){let i=t.filter(c=>c.Status==!1),n=t.filter(c=>c.Status==!0);if(i.length==0&&n.length>0){let c=`<ol>${this.generateSuccessMessage(n)}</ol>`;this.toastr.success(c,"Success",{enableHtml:!0})}else if(i.length>0&&n.length>0){let c=`<ol>
3
3
  ${this.generateSuccessMessage(n)}
4
4
  ${this.generateErrorMessage(i)}
@@ -1 +1 @@
1
- import{a as te}from"./chunk-AZMGWQHI.js";import{a as ee}from"./chunk-WJI6JIBR.js";import{a as x}from"./chunk-BSBYMQ7J.js";import{b as N,c as ne}from"./chunk-BRTVFFDI.js";import"./chunk-2GZOVNPU.js";import"./chunk-662E5VTA.js";import{a as Z}from"./chunk-NNPT3RN6.js";import"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as J}from"./chunk-PVQ2T5XH.js";import{b as j,e as G}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as q,l as X,m as Y}from"./chunk-PIDUM6XT.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{c as W,h as z,k as H,m as K,u as Q}from"./chunk-F5YRASNU.js";import{c as $}from"./chunk-2UXFUEON.js";import{B as D,Fb as I,Ia as u,Ja as g,Jb as w,Kb as P,Lb as M,Mb as R,Nb as O,Wb as S,X as V,Xb as v,Ya as C,_a as d,da as T,ga as F,kb as l,lb as c,mb as E,nb as L,oa as s,ob as B,pa as p,qb as y,sc as A,tb as f,vb as o,vc as k,zc as U}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";function ie(a,r){if(a&1){let i=y();l(0,"button",14),f("click",function(){s(i);let t=o().ngIf,n=o(2);return p(n.onUpdateItems(t))}),E(1,"i",15),I(2," Update "),c()}}function ae(a,r){if(a&1&&(l(0,"actions")(1,"div",12),C(2,ie,3,0,"button",13),c()()),a&2){let i=r.ngIf,e=o(2);u(2),d("ngIf",e.productService.hasSelectionVariant(i))}}function oe(a,r){if(a&1){let i=y();L(0),l(1,"app-table",16),f("onToggle",function(t){s(i);let n=o(2);return p(n.onShowDifferenceStock(t))})("onSubmit",function(t){let n=s(i).ngIf,h=o(2);return p(h.updateStockByVariant(t,n))}),c(),B()}if(a&2){let i=r.ngIf,e=o(2);u(),d("data",i)("channel",e.channelOptions)("showProductToggle",!0)("filter",e.searchFilter)}}function re(a,r){if(a&1){let i=y();l(0,"mainpanel",1),f("onSubmit",function(t){s(i);let n=o();return p(n.onSearch(t))}),C(1,ae,3,1,"actions",2),S(2,"async"),l(3,"filters")(4,"div")(5,"label",3),I(6,"PageNumber"),c(),l(7,"input",4),M("ngModelChange",function(t){s(i);let n=o();return P(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),p(t)}),c()(),l(8,"div",5)(9,"label",6),I(10,"Page Size"),c(),l(11,"input",7),M("ngModelChange",function(t){s(i);let n=o();return P(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),p(t)}),c()()(),l(12,"content")(13,"div",8)(14,"div",9)(15,"div",10),C(16,oe,2,4,"ng-container",2),S(17,"async"),l(18,"infinite-paginator",11),S(19,"async"),f("onNextPage",function(){s(i);let t=o();return p(t.paginationService.onNextPage(t.searchFilter))})("onLastPage",function(){s(i);let t=o();return p(t.onLastPage())})("onGetRowCount",function(){s(i);let t=o();return p(t.paginationService.getRowCount(t.searchFilter))}),c()()()()()()}if(a&2){let i=o();d("pageData",i.pageData)("hideSearchBox",!1)("textButton","Search"),u(),d("ngIf",v(2,13,i.paginationService.data$)),u(6),w("ngModel",i.searchFilter.PageNumber),u(4),w("ngModel",i.searchFilter.RowCount),u(5),d("ngIf",v(17,15,i.paginationService.data$)),u(2),d("totalData",i.paginationService.totalData())("hideCount",i.paginationService.hideCount())("rowCount",v(19,17,i.paginationService.totalRowCount$))("pageNumber",i.paginationService.pageNumber())("disableNextButton",i.paginationService.disableNextButton())("goToLastPage",i.paginationService.goToLastPage())}}var De=(()=>{let r=class r{constructor(e,t,n,h,_){this.http=e,this.toastr=t,this.dialog=n,this.productService=h,this.authService=_,this.paginationService=T(N),this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(V(e=>{e.Filter={PageNumber:e.Filter.PageNumber,filterModel:x.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updateStock(e,t){let n=this.productService.selectedVariantProduct(e);if(n.length>0){let _=n.map(m=>({ID:m.ID,Code:m.Code,Inventory:m.Inventory}));var h=t.filter(m=>m.selected).map(m=>m.ID);let b={ListChannelID:h,List:_};this.http.post("/api/Inventory/UpdateChannel",b).subscribe(m=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+b.List.length+" variants in "+b.ListChannelID.length+" channels","Success")})}}updateStockByVariant(e,t){let n={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",n).subscribe(h=>{let _=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") inventory in "+_.Name+" to "+n.NewQuantity,"Success")})}onShowDifferenceStock(e){e?this.searchFilter.filterModel=x.DIFFERENCE:this.searchFilter.filterModel=x.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(ee,{data:{selectedItems:t,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(D(n=>$.IsNotEmpty(n))).subscribe(n=>{this.updateStock(e,n)})}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.onLastPage(this.searchFilter,e)}})}};r.\u0275fac=function(t){return new(t||r)(g(G),g(j),g(q),g(Z),g(J))},r.\u0275cmp=F({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[R([N]),O],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"onSubmit","pageData","hideSearchBox","textButton"],[4,"ngIf"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","filter"]],template:function(t,n){t&1&&(C(0,re,20,19,"mainpanel",0),S(1,"async")),t&2&&d("ngIf",v(1,1,n.loader$))},dependencies:[U,A,k,Y,X,te,Q,W,K,z,H,ne],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let a=r;return a})();export{De as MultiChannelComparison};
1
+ import{a as te}from"./chunk-44NPBPWD.js";import{a as ee}from"./chunk-WJI6JIBR.js";import{a as x}from"./chunk-BSBYMQ7J.js";import{b as N,c as ne}from"./chunk-BRTVFFDI.js";import"./chunk-2GZOVNPU.js";import"./chunk-662E5VTA.js";import{a as Z}from"./chunk-NNPT3RN6.js";import"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as J}from"./chunk-IOH6ZWW2.js";import{b as j,e as G}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as q,l as X,m as Y}from"./chunk-PIDUM6XT.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{c as W,h as z,k as H,m as K,u as Q}from"./chunk-F5YRASNU.js";import{c as $}from"./chunk-2UXFUEON.js";import{B as D,Fb as I,Ia as u,Ja as g,Jb as w,Kb as P,Lb as M,Mb as R,Nb as O,Wb as S,X as V,Xb as v,Ya as C,_a as d,da as T,ga as F,kb as l,lb as c,mb as E,nb as L,oa as s,ob as B,pa as p,qb as y,sc as A,tb as f,vb as o,vc as k,zc as U}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";function ie(a,r){if(a&1){let i=y();l(0,"button",14),f("click",function(){s(i);let t=o().ngIf,n=o(2);return p(n.onUpdateItems(t))}),E(1,"i",15),I(2," Update "),c()}}function ae(a,r){if(a&1&&(l(0,"actions")(1,"div",12),C(2,ie,3,0,"button",13),c()()),a&2){let i=r.ngIf,e=o(2);u(2),d("ngIf",e.productService.hasSelectionVariant(i))}}function oe(a,r){if(a&1){let i=y();L(0),l(1,"app-table",16),f("onToggle",function(t){s(i);let n=o(2);return p(n.onShowDifferenceStock(t))})("onSubmit",function(t){let n=s(i).ngIf,h=o(2);return p(h.updateStockByVariant(t,n))}),c(),B()}if(a&2){let i=r.ngIf,e=o(2);u(),d("data",i)("channel",e.channelOptions)("showProductToggle",!0)("filter",e.searchFilter)}}function re(a,r){if(a&1){let i=y();l(0,"mainpanel",1),f("onSubmit",function(t){s(i);let n=o();return p(n.onSearch(t))}),C(1,ae,3,1,"actions",2),S(2,"async"),l(3,"filters")(4,"div")(5,"label",3),I(6,"PageNumber"),c(),l(7,"input",4),M("ngModelChange",function(t){s(i);let n=o();return P(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),p(t)}),c()(),l(8,"div",5)(9,"label",6),I(10,"Page Size"),c(),l(11,"input",7),M("ngModelChange",function(t){s(i);let n=o();return P(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),p(t)}),c()()(),l(12,"content")(13,"div",8)(14,"div",9)(15,"div",10),C(16,oe,2,4,"ng-container",2),S(17,"async"),l(18,"infinite-paginator",11),S(19,"async"),f("onNextPage",function(){s(i);let t=o();return p(t.paginationService.onNextPage(t.searchFilter))})("onLastPage",function(){s(i);let t=o();return p(t.onLastPage())})("onGetRowCount",function(){s(i);let t=o();return p(t.paginationService.getRowCount(t.searchFilter))}),c()()()()()()}if(a&2){let i=o();d("pageData",i.pageData)("hideSearchBox",!1)("textButton","Search"),u(),d("ngIf",v(2,13,i.paginationService.data$)),u(6),w("ngModel",i.searchFilter.PageNumber),u(4),w("ngModel",i.searchFilter.RowCount),u(5),d("ngIf",v(17,15,i.paginationService.data$)),u(2),d("totalData",i.paginationService.totalData())("hideCount",i.paginationService.hideCount())("rowCount",v(19,17,i.paginationService.totalRowCount$))("pageNumber",i.paginationService.pageNumber())("disableNextButton",i.paginationService.disableNextButton())("goToLastPage",i.paginationService.goToLastPage())}}var De=(()=>{let r=class r{constructor(e,t,n,h,_){this.http=e,this.toastr=t,this.dialog=n,this.productService=h,this.authService=_,this.paginationService=T(N),this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(V(e=>{e.Filter={PageNumber:e.Filter.PageNumber,filterModel:x.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updateStock(e,t){let n=this.productService.selectedVariantProduct(e);if(n.length>0){let _=n.map(m=>({ID:m.ID,Code:m.Code,Inventory:m.Inventory}));var h=t.filter(m=>m.selected).map(m=>m.ID);let b={ListChannelID:h,List:_};this.http.post("/api/Inventory/UpdateChannel",b).subscribe(m=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+b.List.length+" variants in "+b.ListChannelID.length+" channels","Success")})}}updateStockByVariant(e,t){let n={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",n).subscribe(h=>{let _=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") inventory in "+_.Name+" to "+n.NewQuantity,"Success")})}onShowDifferenceStock(e){e?this.searchFilter.filterModel=x.DIFFERENCE:this.searchFilter.filterModel=x.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(ee,{data:{selectedItems:t,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(D(n=>$.IsNotEmpty(n))).subscribe(n=>{this.updateStock(e,n)})}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.onLastPage(this.searchFilter,e)}})}};r.\u0275fac=function(t){return new(t||r)(g(G),g(j),g(q),g(Z),g(J))},r.\u0275cmp=F({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[R([N]),O],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"onSubmit","pageData","hideSearchBox","textButton"],[4,"ngIf"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","filter"]],template:function(t,n){t&1&&(C(0,re,20,19,"mainpanel",0),S(1,"async")),t&2&&d("ngIf",v(1,1,n.loader$))},dependencies:[U,A,k,Y,X,te,Q,W,K,z,H,ne],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let a=r;return a})();export{De as MultiChannelComparison};
@@ -1 +1 @@
1
- import{a as Q}from"./chunk-LIS3LB3F.js";import{a as Y}from"./chunk-AZMGWQHI.js";import{a as X}from"./chunk-WJI6JIBR.js";import{b as V,c as Z}from"./chunk-BRTVFFDI.js";import"./chunk-2GZOVNPU.js";import"./chunk-662E5VTA.js";import{a as J}from"./chunk-NNPT3RN6.js";import"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as H}from"./chunk-PVQ2T5XH.js";import{b as O,e as U}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as K,l as q,m as z}from"./chunk-PIDUM6XT.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{c as k,h as j,k as G,m as W,u as $}from"./chunk-F5YRASNU.js";import"./chunk-2UXFUEON.js";import{B as F,Fb as _,Ia as m,Ja as d,Jb as S,Kb as v,Lb as y,Mb as E,Nb as R,Q as T,Wb as C,X as D,Xb as x,Ya as w,_a as h,da as M,ga as N,kb as a,lb as p,mb as b,oa as l,pa as c,qb as I,sc as L,tb as g,vb as o,vc as A,zc as B}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";function ee(r,s){if(r&1){let n=I();a(0,"button",15),g("click",function(){l(n);let t=o().ngIf,i=o(2);return c(i.onUpdateItems(t))}),b(1,"i",16),_(2," Update "),p()}}function te(r,s){if(r&1&&(a(0,"div"),w(1,ee,3,0,"button",14),p()),r&2){let n=s.ngIf,e=o(2);m(),h("ngIf",e.productService.hasSelectionVariant(n))}}function ie(r,s){if(r&1){let n=I();a(0,"mainpanel",1),g("onSubmit",function(t){l(n);let i=o();return c(i.onSearch(t))}),a(1,"actions")(2,"div",2),w(3,te,2,1,"div",3),C(4,"async"),a(5,"button",4),g("click",function(){l(n);let t=o();return c(t.openExportDialog())}),b(6,"i",5),a(7,"span"),_(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),_(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){l(n);let i=o();return v(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),c(t)}),p()(),a(14,"div",8)(15,"label",6),_(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){l(n);let i=o();return v(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),c(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),C(23,"async"),g("onToggle",function(t){l(n);let i=o();return c(i.onShowDifferencePrice(t))})("onSubmit",function(t){l(n);let i=o();return c(i.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),C(25,"async"),g("onNextPage",function(){l(n);let t=o();return c(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){l(n);let t=o();return c(t.onLastPage())})("onGetRowCount",function(){l(n);let t=o();return c(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let n=s.ngIf,e=o();h("textButton","Search"),m(3),h("ngIf",x(4,14,e.data$)),m(10),S("ngModel",e.searchFilter.PageNumber),m(4),S("ngModel",e.searchFilter.RowCount),m(5),h("showProductToggle",!0)("data",x(23,16,e.data$))("channel",e.channelOptions)("filter",n.Filter),m(2),h("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",x(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.goToLastPage())}}var Se=(()=>{let s=class s{constructor(e,t,i,P,f){this.http=e,this.toastr=t,this.dialog=i,this.productService=P,this.authService=f,this.infinitePagination=M(V),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(D(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let t=this.productService.selectedVariantProduct(e);if(t.length>0){let P=t.map(u=>({ID:u.ID,Code:u.Code,Price:u.UnitPrice}));var i=this.channelOptions.filter(u=>u.selected).map(u=>u.ID);let f={ListChannelID:i,ListPrice:P};this.http.post("/api/Price/UpdateChannel",f).subscribe(u=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+f.ListPrice.length+" items in "+f.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(i=>{let P=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+P.Name+" to "+t.Price,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(X,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(F(i=>i!==void 0)).subscribe(i=>{this.channelOptions=i,this.updatePrice(e)})}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.infinitePagination.onLastPage(this.searchFilter,e)}})}openExportDialog(){this.dialog.open(Q,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(t){return new(t||s)(d(U),d(O),d(K),d(J),d(H))},s.\u0275cmp=N({type:s,selectors:[["app-price-pos-channel"]],standalone:!0,features:[E([V]),R],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","filter"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(t,i){t&1&&(w(0,ie,26,20,"mainpanel",0),C(1,"async")),t&2&&h("ngIf",x(1,1,i.loader$))},dependencies:[B,L,A,$,k,W,j,G,Z,z,q,Y],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let r=s;return r})();export{Se as PricePosChannelComponent};
1
+ import{a as Q}from"./chunk-LIS3LB3F.js";import{a as Y}from"./chunk-44NPBPWD.js";import{a as X}from"./chunk-WJI6JIBR.js";import{b as V,c as Z}from"./chunk-BRTVFFDI.js";import"./chunk-2GZOVNPU.js";import"./chunk-662E5VTA.js";import{a as J}from"./chunk-NNPT3RN6.js";import"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as H}from"./chunk-IOH6ZWW2.js";import{b as O,e as U}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as K,l as q,m as z}from"./chunk-PIDUM6XT.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{c as k,h as j,k as G,m as W,u as $}from"./chunk-F5YRASNU.js";import"./chunk-2UXFUEON.js";import{B as F,Fb as _,Ia as m,Ja as d,Jb as S,Kb as v,Lb as y,Mb as E,Nb as R,Q as T,Wb as C,X as D,Xb as x,Ya as w,_a as h,da as M,ga as N,kb as a,lb as p,mb as b,oa as l,pa as c,qb as I,sc as L,tb as g,vb as o,vc as A,zc as B}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";function ee(r,s){if(r&1){let n=I();a(0,"button",15),g("click",function(){l(n);let t=o().ngIf,i=o(2);return c(i.onUpdateItems(t))}),b(1,"i",16),_(2," Update "),p()}}function te(r,s){if(r&1&&(a(0,"div"),w(1,ee,3,0,"button",14),p()),r&2){let n=s.ngIf,e=o(2);m(),h("ngIf",e.productService.hasSelectionVariant(n))}}function ie(r,s){if(r&1){let n=I();a(0,"mainpanel",1),g("onSubmit",function(t){l(n);let i=o();return c(i.onSearch(t))}),a(1,"actions")(2,"div",2),w(3,te,2,1,"div",3),C(4,"async"),a(5,"button",4),g("click",function(){l(n);let t=o();return c(t.openExportDialog())}),b(6,"i",5),a(7,"span"),_(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),_(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){l(n);let i=o();return v(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),c(t)}),p()(),a(14,"div",8)(15,"label",6),_(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){l(n);let i=o();return v(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),c(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),C(23,"async"),g("onToggle",function(t){l(n);let i=o();return c(i.onShowDifferencePrice(t))})("onSubmit",function(t){l(n);let i=o();return c(i.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),C(25,"async"),g("onNextPage",function(){l(n);let t=o();return c(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){l(n);let t=o();return c(t.onLastPage())})("onGetRowCount",function(){l(n);let t=o();return c(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let n=s.ngIf,e=o();h("textButton","Search"),m(3),h("ngIf",x(4,14,e.data$)),m(10),S("ngModel",e.searchFilter.PageNumber),m(4),S("ngModel",e.searchFilter.RowCount),m(5),h("showProductToggle",!0)("data",x(23,16,e.data$))("channel",e.channelOptions)("filter",n.Filter),m(2),h("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",x(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.goToLastPage())}}var Se=(()=>{let s=class s{constructor(e,t,i,P,f){this.http=e,this.toastr=t,this.dialog=i,this.productService=P,this.authService=f,this.infinitePagination=M(V),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(D(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let t=this.productService.selectedVariantProduct(e);if(t.length>0){let P=t.map(u=>({ID:u.ID,Code:u.Code,Price:u.UnitPrice}));var i=this.channelOptions.filter(u=>u.selected).map(u=>u.ID);let f={ListChannelID:i,ListPrice:P};this.http.post("/api/Price/UpdateChannel",f).subscribe(u=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+f.ListPrice.length+" items in "+f.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(i=>{let P=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+P.Name+" to "+t.Price,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(X,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(F(i=>i!==void 0)).subscribe(i=>{this.channelOptions=i,this.updatePrice(e)})}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.infinitePagination.onLastPage(this.searchFilter,e)}})}openExportDialog(){this.dialog.open(Q,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(t){return new(t||s)(d(U),d(O),d(K),d(J),d(H))},s.\u0275cmp=N({type:s,selectors:[["app-price-pos-channel"]],standalone:!0,features:[E([V]),R],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","filter"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(t,i){t&1&&(w(0,ie,26,20,"mainpanel",0),C(1,"async")),t&2&&h("ngIf",x(1,1,i.loader$))},dependencies:[B,L,A,$,k,W,j,G,Z,z,q,Y],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let r=s;return r})();export{Se as PricePosChannelComponent};