marketplacepos 3.22.3 → 3.22.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/Marketplace/{chunk-7244E2TD.js → chunk-2CBSLHN2.js} +1 -1
  2. package/Marketplace/{chunk-NPDBUADH.js → chunk-2D322U5L.js} +1 -1
  3. package/Marketplace/{chunk-LSXEWTLP.js → chunk-3WBUGZES.js} +1 -1
  4. package/Marketplace/{chunk-Q7IOXBZX.js → chunk-4GHLPHQ6.js} +1 -1
  5. package/Marketplace/{chunk-EMO3QL6Q.js → chunk-4HCEWP6Y.js} +3 -3
  6. package/Marketplace/{chunk-YFL4FUJ5.js → chunk-4IATSEYC.js} +1 -1
  7. package/Marketplace/{chunk-KOPHQT52.js → chunk-4NLEKWDS.js} +1 -1
  8. package/Marketplace/chunk-574Y2ITQ.js +1 -0
  9. package/Marketplace/chunk-5OHPBQ35.js +1 -0
  10. package/Marketplace/chunk-5PVNP2BP.js +1 -0
  11. package/Marketplace/chunk-64G3XLI6.js +1 -0
  12. package/Marketplace/{chunk-2UKRBTWA.js → chunk-6UBPPQKL.js} +1 -1
  13. package/Marketplace/{chunk-O53NO6NZ.js → chunk-6XCZEL6G.js} +1 -1
  14. package/Marketplace/chunk-7LZ5ZSXM.js +1 -0
  15. package/Marketplace/{chunk-U7ZZQR5Y.js → chunk-A3QMF6VI.js} +1 -1
  16. package/Marketplace/{chunk-DR4IU4JY.js → chunk-AMSVLO4N.js} +1 -1
  17. package/Marketplace/{chunk-RDHVV7FZ.js → chunk-B5PFUQJP.js} +1 -1
  18. package/Marketplace/chunk-B63CUEEJ.js +1 -0
  19. package/Marketplace/{chunk-57D743TM.js → chunk-BANQL6CA.js} +1 -1
  20. package/Marketplace/{chunk-TU5BCTYG.js → chunk-CZ2Q7KYV.js} +2 -2
  21. package/Marketplace/chunk-FDJ53QZD.js +1 -0
  22. package/Marketplace/{chunk-JP44SOP7.js → chunk-GPE5CZJG.js} +1 -1
  23. package/Marketplace/{chunk-CODNZKCM.js → chunk-IUKHWWDP.js} +1 -1
  24. package/Marketplace/{chunk-NYDPS33K.js → chunk-LB6JFX4H.js} +1 -1
  25. package/Marketplace/{chunk-XB345KSK.js → chunk-LJHZMQZD.js} +1 -1
  26. package/Marketplace/{chunk-XL7EOUKR.js → chunk-LJKXNEGZ.js} +1 -1
  27. package/Marketplace/{chunk-2EQSQQSG.js → chunk-LW27GPBD.js} +1 -1
  28. package/Marketplace/{chunk-RZB553M3.js → chunk-MVMY5DLY.js} +1 -1
  29. package/Marketplace/{chunk-UN2U4YFQ.js → chunk-N3TTJVBG.js} +1 -1
  30. package/Marketplace/{chunk-EW5A6GIY.js → chunk-OXWBU2ND.js} +1 -1
  31. package/Marketplace/{chunk-ZRPSM5PK.js → chunk-PNVJ62RQ.js} +1 -1
  32. package/Marketplace/{chunk-OOUAVE3Y.js → chunk-PWUUHYDL.js} +2 -2
  33. package/Marketplace/{chunk-LERYKH6W.js → chunk-Q7V6SRNY.js} +1 -1
  34. package/Marketplace/{chunk-52SSIH5R.js → chunk-QU6ZSDJT.js} +1 -1
  35. package/Marketplace/{chunk-RI7RZYID.js → chunk-RGOGXUFL.js} +1 -1
  36. package/Marketplace/{chunk-CM7FKNYB.js → chunk-S726QPK5.js} +1 -1
  37. package/Marketplace/{chunk-GCMMLBGS.js → chunk-TZ24K7DJ.js} +1 -1
  38. package/Marketplace/{chunk-F5WRNHLB.js → chunk-URF7IVW3.js} +1 -1
  39. package/Marketplace/chunk-UV2W7NZ7.js +2 -0
  40. package/Marketplace/{chunk-CYIQCMZY.js → chunk-VI2E5WY5.js} +1 -1
  41. package/Marketplace/{chunk-S2I5R6LZ.js → chunk-WIJYURXT.js} +1 -1
  42. package/Marketplace/{chunk-N42YDQZA.js → chunk-WNUERYHI.js} +1 -1
  43. package/Marketplace/{chunk-3QG5QJ5P.js → chunk-XFTUE2ST.js} +1 -1
  44. package/Marketplace/{chunk-SFD25F67.js → chunk-XXO2VPRJ.js} +1 -1
  45. package/Marketplace/{chunk-MGJYDGNK.js → chunk-Y47DOHWC.js} +1 -1
  46. package/Marketplace/{chunk-LZSQNKJV.js → chunk-YE4MDSZA.js} +1 -1
  47. package/Marketplace/{chunk-FMK7E67O.js → chunk-YTQRMWPG.js} +1 -1
  48. package/Marketplace/{chunk-YIB7FZAQ.js → chunk-ZFQW5CVZ.js} +1 -1
  49. package/Marketplace/chunk-ZFY4S6PF.js +1 -0
  50. package/Marketplace/index.html +2 -2
  51. package/Marketplace/{main-5MXBT3XM.js → main-SCP4MGRP.js} +1 -1
  52. package/package.json +1 -1
  53. package/Marketplace/chunk-37V5CJJ5.js +0 -1
  54. package/Marketplace/chunk-44YUSAMN.js +0 -1
  55. package/Marketplace/chunk-6SF7AUOH.js +0 -1
  56. package/Marketplace/chunk-DWXQR4WL.js +0 -1
  57. package/Marketplace/chunk-F2YSYX6S.js +0 -8
  58. package/Marketplace/chunk-OSSJKXND.js +0 -1
  59. package/Marketplace/chunk-WGPP5ACW.js +0 -1
  60. package/Marketplace/chunk-XZT3BIW4.js +0 -1
  61. package/Marketplace/chunk-Y2T3CEPZ.js +0 -1
@@ -1 +1 @@
1
- import{a as v,b}from"./chunk-UN2U4YFQ.js";import{a as r}from"./chunk-Q7IOXBZX.js";import"./chunk-EMO3QL6Q.js";import"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import"./chunk-6SF7AUOH.js";import{n as h,r as i}from"./chunk-OVEJFFL6.js";import{Cd as o,Gb as u,Sb as d,Tb as C,Ub as a,jb as s,ka as l,ta as m,ua as c,vc as f}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var T=(()=>{let e=class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-KOPHQT52.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-YFL4FUJ5.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-NPDBUADH.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
1
+ import{a as v,b}from"./chunk-N3TTJVBG.js";import{a as r}from"./chunk-4GHLPHQ6.js";import"./chunk-4HCEWP6Y.js";import"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import"./chunk-64G3XLI6.js";import{n as h,r as i}from"./chunk-OVEJFFL6.js";import{Cd as o,Gb as u,Sb as d,Tb as C,Ub as a,jb as s,ka as l,ta as m,ua as c,vc as f}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var T=(()=>{let e=class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-4NLEKWDS.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-4IATSEYC.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-2D322U5L.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
@@ -1 +1 @@
1
- import{a as N}from"./chunk-WTR5UFZI.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-RDHVV7FZ.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-DR4IU4JY.js";import{a as De}from"./chunk-N6IHFFFZ.js";import{a as Ve,b as Te}from"./chunk-PD4CUVAW.js";import"./chunk-GCKSYCMI.js";import{a as be}from"./chunk-YIB7FZAQ.js";import"./chunk-ADRVUMMW.js";import{a as Fe}from"./chunk-3QG5QJ5P.js";import"./chunk-HCDKYABV.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-CCXKODFV.js";import{i as ue}from"./chunk-EMO3QL6Q.js";import{b as de,e as ge}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-BSN7ZAXG.js";import{c as me,e as he,f as Ce}from"./chunk-6SF7AUOH.js";import"./chunk-OVEJFFL6.js";import{$b as u,Bd as E,Cd as ie,Da as _,Ea as m,Eb as h,G as A,Gb as p,Gc as v,Hc as T,Ic as X,Id as ae,Jc as Y,Nb as S,Ob as k,Qb as L,Rb as R,Sb as o,Tb as c,Ub as P,Vb as q,Wb as K,Yb as x,Z as $,bc as r,ea as j,ec as H,gb as D,jb as l,kb as f,mc as J,nc as d,oc as B,pa as z,pc as F,rc as I,sc as w,sd as ee,ta as G,tc as y,uc as Z,vc as Q,vd as te,xc as V,yd as ne}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=_e.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
1
+ import{a as N}from"./chunk-WTR5UFZI.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-B5PFUQJP.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-AMSVLO4N.js";import{a as De}from"./chunk-N6IHFFFZ.js";import{a as Ve,b as Te}from"./chunk-PD4CUVAW.js";import"./chunk-GCKSYCMI.js";import{a as be}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as Fe}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-CCXKODFV.js";import{i as ue}from"./chunk-4HCEWP6Y.js";import{b as de,e as ge}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-BSN7ZAXG.js";import{c as me,e as he,f as Ce}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as u,Bd as E,Cd as ie,Da as _,Ea as m,Eb as h,G as A,Gb as p,Gc as v,Hc as T,Ic as X,Id as ae,Jc as Y,Nb as S,Ob as k,Qb as L,Rb as R,Sb as o,Tb as c,Ub as P,Vb as q,Wb as K,Yb as x,Z as $,bc as r,ea as j,ec as H,gb as D,jb as l,kb as f,mc as J,nc as d,oc as B,pa as z,pc as F,rc as I,sc as w,sd as ee,ta as G,tc as y,uc as Z,vc as Q,vd as te,xc as V,yd as ne}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=_e.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import"./chunk-Y2T3CEPZ.js";import{a as Ue}from"./chunk-U7ZZQR5Y.js";import{a as Ke}from"./chunk-6U6JR5K6.js";import"./chunk-44YUSAMN.js";import{a as E}from"./chunk-BVIRHZTZ.js";import"./chunk-F5WRNHLB.js";import"./chunk-XL7EOUKR.js";import{b as Je}from"./chunk-JXTGH22T.js";import{c as Ze}from"./chunk-ADRVUMMW.js";import{b as Ye}from"./chunk-BQ7NR3ET.js";import{c as qe}from"./chunk-UMNGKENU.js";import{a as f}from"./chunk-Q7IOXBZX.js";import{g as Qe}from"./chunk-HCDKYABV.js";import{a as Be,d as Re,e as $}from"./chunk-CCXKODFV.js";import{a as Pe,b as ze,i as Le}from"./chunk-EMO3QL6Q.js";import"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{a as Ve,g as He,j as J,n as Ge}from"./chunk-BO4PPSB5.js";import{t as We,u as F}from"./chunk-HUUFOAKH.js";import{F as je,K as Z,u as $e,x as Fe}from"./chunk-E5GGIVK7.js";import{h as Ee,m as De,y as U,z as ke}from"./chunk-BSN7ZAXG.js";import{e as Ne,f as Ae}from"./chunk-6SF7AUOH.js";import{n as Te,p as Oe,q as we,r as Y}from"./chunk-OVEJFFL6.js";import{$b as O,Bb as me,Cd as M,Da as I,Ea as T,Eb as h,G as ee,Gb as d,Gc as q,Hb as pe,Hc as Q,Ib as z,Jc as R,Kb as G,M as te,Na as re,Nb as ge,Pa as P,R as ie,Sb as l,Tb as s,Ub as b,Uc as be,Va as le,Vb as N,Wb as A,Yb as he,bc as c,bd as V,ca as ne,f as H,gb as se,gd as Ce,hc as fe,ic as ue,jb as r,jc as _e,ka as u,kb as g,ld as ve,mc as L,nc as p,oc as y,pa as x,pc as w,qb as de,sb as ce,sd as ye,ta as v,ua as _,ud as Me,v as k,va as ae,vc as B,vd as Se,yd as xe,za as oe,zd as Ie}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var j=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[E.dashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/Order",Roles:[E.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[E.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[E.channelView]},{Icon:"fas fa-file-alt",Title:"Dev Logs",Url:"/menu/log",Roles:[]},{Icon:"fas fa-bell",Title:"Notification",Url:"/menu/notification",Badge:!0,Roles:[]},{Icon:"fa-solid fa-wand-magic-sparkles",Title:"What`s New",Url:`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${Pe.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var rt=0,Xe="mat-badge-content",W=new Set,lt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-component"]],standalone:!0,features:[B],decls:0,vars:0,template:function(n,a){},styles:[".mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color);color:var(--mat-badge-text-color);font-family:var(--mat-badge-text-font);font-weight:var(--mat-badge-text-weight);border-radius:var(--mat-badge-container-shape)}.cdk-high-contrast-active .mat-badge-content{outline:solid 1px;border-radius:0}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color);color:var(--mat-badge-disabled-state-text-color)}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, unset);min-height:var(--mat-badge-small-size-container-size, unset);line-height:var(--mat-badge-legacy-small-size-container-size, var(--mat-badge-small-size-container-size));padding:var(--mat-badge-small-size-container-padding);font-size:var(--mat-badge-small-size-text-size);margin:var(--mat-badge-small-size-container-offset)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, unset);min-height:var(--mat-badge-container-size, unset);line-height:var(--mat-badge-legacy-container-size, var(--mat-badge-container-size));padding:var(--mat-badge-container-padding);font-size:var(--mat-badge-text-size);margin:var(--mat-badge-container-offset)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, unset);min-height:var(--mat-badge-large-size-container-size, unset);line-height:var(--mat-badge-legacy-large-size-container-size, var(--mat-badge-large-size-container-size));padding:var(--mat-badge-large-size-container-padding);font-size:var(--mat-badge-large-size-text-size);margin:var(--mat-badge-large-size-container-offset)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset)}"],encapsulation:2,changeDetection:0});let t=e;return t})(),et=(()=>{let e=class e{get color(){return this._color}set color(i){this._setColor(i),this._color=i}get content(){return this._content}set content(i){this._updateRenderedContent(i)}get description(){return this._description}set description(i){this._updateDescription(i)}constructor(i,n,a,m,S){this._ngZone=i,this._elementRef=n,this._ariaDescriber=a,this._renderer=m,this._animationMode=S,this._color="primary",this.overlap=!0,this.position="above after",this.size="medium",this._id=rt++,this._isInitialized=!1,this._interactivityChecker=x(Fe),this._document=x(ve);let C=x(be);if(!W.has(C)){W.add(C);let X=Ce(lt,{environmentInjector:x(oe)});C.onDestroy(()=>{W.delete(C),W.size===0&&X.destroy()})}}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let i=this._renderer.createElement("span"),n="mat-badge-active";return i.setAttribute("id",`mat-badge-content-${this._id}`),i.setAttribute("aria-hidden","true"),i.classList.add(Xe),this._animationMode==="NoopAnimations"&&i.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(i),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{i.classList.add(n)})}):i.classList.add(n),i}_updateRenderedContent(i){let n=`${i??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateDescription(i){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!i||this._isHostInteractive())&&this._removeInlineDescription(),this._description=i,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,i):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(i){let n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),i&&n.add(`mat-badge-${i}`)}_clearExistingBadges(){let i=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Xe}`);for(let n of Array.from(i))n!==this._badgeElement&&n.remove()}};e.\u0275fac=function(n){return new(n||e)(g(ce),g(re),g($e),g(de),g(le,8))},e.\u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,a){n&2&&z("mat-badge-overlap",a.overlap)("mat-badge-above",a.isAbove())("mat-badge-below",!a.isAbove())("mat-badge-before",!a.isAfter())("mat-badge-after",a.isAfter())("mat-badge-small",a.size==="small")("mat-badge-medium",a.size==="medium")("mat-badge-large",a.size==="large")("mat-badge-hidden",a.hidden||!a.content)("mat-badge-disabled",a.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",V],disabled:[2,"matBadgeDisabled","disabled",V],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",V]},standalone:!0,features:[me]});let t=e;return t})(),tt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[je,Z,Z]});let t=e;return t})();function dt(t,e){if(t&1&&(N(0),l(1,"p",23),p(2),s(),A()),t&2){let o=c(3).$implicit;r(2),w(" ",o.Title," ")}}function ct(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function mt(t,e){if(t&1&&(l(0,"a",22),b(1,"i"),h(2,dt,3,1,"ng-container",20)(3,ct,2,1,"ng-template",null,1,R),s()),t&2){let o=L(4),i=c(2).$implicit;d("href",i.Url,se),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function pt(t,e){if(t&1&&(N(0),h(1,mt,5,5,"a",21),A()),t&2){let o=c().$implicit;r(),d("ngxPermissionsOnly",o.Roles)}}function gt(t,e){if(t&1&&(l(0,"p",23),p(1),s()),t&2){let o=c(4).$implicit;r(),w(" ",o.Title," ")}}function ht(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(4).$implicit;r(),y(o.Title)}}function ft(t,e){if(t&1&&(N(0),h(1,gt,2,1,"p",23),q(2,"async"),h(3,ht,2,1,"p"),A()),t&2){let o=c(4);r(),ge(Q(2,1,o.notifications$)!=0?1:3)}}function ut(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function _t(t,e){if(t&1&&(l(0,"a",25),b(1,"i"),h(2,ft,4,3,"ng-container",20)(3,ut,2,1,"ng-template",null,2,R),s()),t&2){let o=L(4),i=c(2).$implicit,n=c();d("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function bt(t,e){if(t&1&&h(0,_t,5,6,"a",24),t&2){let o=c().$implicit;d("ngxPermissionsOnly",o.Roles)}}function Ct(t,e){if(t&1&&(l(0,"li",19),h(1,pt,2,1,"ng-container",20)(2,bt,1,1,"ng-template",null,0,R),s()),t&2){let o=e.$implicit,i=L(3);r(),d("ngIf",o.ExternalLink)("ngIfElse",i)}}var it=(()=>{let e=class e{constructor(i,n,a,m){this.toggleSidebarService=i,this.notificationService=n,this.decodeTokenService=a,this.authService=m,this.Menu={},this.isCollapseSidebar=!1,this.token=a.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new j().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(k(i=>i.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(i){if(i){let n,a=i.split(" ");return a.length==1?n=a[0].substring(0,2):n=a.shift().charAt(0)+a.pop().charAt(0),n}}};e.\u0275fac=function(n){return new(n||e)(g(Ve),g(Ue),g(ze),g(Le))},e.\u0275cmp=v({type:e,selectors:[["app-menu"]],decls:23,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(n,a){n&1&&(l(0,"div",3),q(1,"async"),l(2,"div",4)(3,"button",5),O("click",function(){return a.onCallapseSidebar()}),b(4,"i",6),s(),l(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),l(9,"div",10)(10,"div",11),p(11),s(),b(12,"div",12),l(13,"a",13),O("click",function(){return a.onLogout()}),b(14,"i",14),p(15,"\xA0 "),l(16,"span"),p(17," Log Out"),s()()()()(),l(18,"div",15)(19,"ul",16),h(20,Ct,4,2,"li",17),s()()(),l(21,"div",18),b(22,"router-outlet"),s()()),n&2&&(z("nav-open",Q(1,7,a.toggleState$)),r(2),d("ngClass",a.isCollapseSidebar?"collapses":""),r(2),d("ngClass",a.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),r(4),w(" ",a.storeName," "),r(3),w(" ",a.token==null?null:a.token.LID," "),r(9),d("ngForOf",a.Menu))},dependencies:[ye,Me,Se,Te,Oe,we,We,et,Ne,xe],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]});let t=e;return t})();var vt=[{path:"",component:it,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-EW5A6GIY.js").then(t=>t.DashboardModule),canActivate:[f],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-N42YDQZA.js").then(t=>t.ProductModule),canActivate:[f],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-MGJYDGNK.js").then(t=>t.InventoryRoutingModule),canActivate:[f],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-7244E2TD.js").then(t=>t.PriceRoutingModule),canActivate:[f],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-TU5BCTYG.js").then(t=>t.OrdersModule),canActivate:[f],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-2EQSQQSG.js").then(t=>t.ReportModule),canActivate:[f],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-37V5CJJ5.js").then(t=>t.LogisticModule),canActivate:[f],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-F2YSYX6S.js").then(t=>t.ChannelsModule),canActivate:[f],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-LERYKH6W.js").then(t=>t.LogsModule),canActivate:[f],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-RZB553M3.js").then(t=>t.NotificationModule),canActivate:[f],data:{title:"Push Notification"}}]}],nt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[Y.forChild(vt),Y]});let t=e;return t})();var Mt=["selectId"];function St(t,e){if(t&1&&(l(0,"span",3),p(1),s()),t&2){let o=e.item,i=c();d("title",o[i.bindLabel]),r(),y(o[i.bindLabel])}}var at=(()=>{let e=class e{set items(i){this.ngSelectInfiniteScroll.data=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(i){this._selected=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new K,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(i){i?(this.selectedChange.emit(i[this.bindValue]),this.selectedLabel.emit(i[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(n,a){if(n&1&&fe(Mt,7),n&2){let m;ue(m=_e())&&(a.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[B],decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(n,a){if(n&1){let m=he();l(0,"ng-select",1,0),O("clear",function(){return I(m),T(a.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return I(m),T(a.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return I(m),T(a.onOpenSelect())})("change",function(C){return I(m),T(a.onSelectChange(C))}),h(2,St,2,2,"ng-template",2),s()}n&2&&(pe("width",a.width),d("appendTo",a.parent)("disabled",a.disabled)("virtualScroll",!0)("typeahead",a.ngSelectInfiniteScroll.input$)("items",a.ngSelectInfiniteScroll.bufferData)("bindLabel",a.bindLabel)("bindValue",a.bindValue)("placeholder",a.placeholder)("ngModel",a.selected)("clearable",a.clearable))},dependencies:[M,$,Re,Be,U,Ee,De]});let t=e;return t})(),K=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new H,this._destroy$=new H,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(te(200),ie(),k(e=>(e&&(e=e.toLowerCase()),this.filterData(e))),ee(e=>e!==void 0),ne(this._destroy$)).subscribe(e=>{this._dataBuffer=e.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(e){let o=-1,i;return this._data.filter(a=>(i=JSON.stringify(a).toLowerCase(),o=i.indexOf(e),o!==-1||e==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(e){this._data=e||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(e,o){if(Ke.IsNotEmpty(e)){let i=this._data.filter(n=>n[o].toString().toLowerCase().indexOf(e)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(e){this._bufferSize=e}onScrollToEnd(){this.fetchMore()}fetchMore(){let e=this._dataBuffer.length,o=this._data.slice(e,this._bufferSize+e);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(o)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var ot=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[M,U,He,qe,Ze,Qe,Ye,Je,F,J,at,$,ke]});let t=e;return t})();var _n=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({providers:[Ie],imports:[M,nt,Ge,F,ot,tt,Ae.forChild()]});let t=e;return t})();export{_n as MenuModule};
1
+ import"./chunk-B63CUEEJ.js";import{a as Ue}from"./chunk-A3QMF6VI.js";import{a as Ke}from"./chunk-6U6JR5K6.js";import"./chunk-7LZ5ZSXM.js";import{a as E}from"./chunk-BVIRHZTZ.js";import"./chunk-URF7IVW3.js";import"./chunk-LJKXNEGZ.js";import{b as Je}from"./chunk-JXTGH22T.js";import{c as Ze}from"./chunk-ADRVUMMW.js";import{b as Ye}from"./chunk-BQ7NR3ET.js";import{c as qe}from"./chunk-UMNGKENU.js";import{a as f}from"./chunk-4GHLPHQ6.js";import{g as Qe}from"./chunk-HCDKYABV.js";import{a as Be,d as Re,e as $}from"./chunk-CCXKODFV.js";import{a as Pe,b as ze,i as Le}from"./chunk-4HCEWP6Y.js";import"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{a as Ve,g as He,j as J,n as Ge}from"./chunk-BO4PPSB5.js";import{t as We,u as F}from"./chunk-HUUFOAKH.js";import{F as je,K as Z,u as $e,x as Fe}from"./chunk-E5GGIVK7.js";import{h as Ee,m as De,y as U,z as ke}from"./chunk-BSN7ZAXG.js";import{e as Ne,f as Ae}from"./chunk-64G3XLI6.js";import{n as Te,p as Oe,q as we,r as Y}from"./chunk-OVEJFFL6.js";import{$b as O,Bb as me,Cd as M,Da as I,Ea as T,Eb as h,G as ee,Gb as d,Gc as q,Hb as pe,Hc as Q,Ib as z,Jc as R,Kb as G,M as te,Na as re,Nb as ge,Pa as P,R as ie,Sb as l,Tb as s,Ub as b,Uc as be,Va as le,Vb as N,Wb as A,Yb as he,bc as c,bd as V,ca as ne,f as H,gb as se,gd as Ce,hc as fe,ic as ue,jb as r,jc as _e,ka as u,kb as g,ld as ve,mc as L,nc as p,oc as y,pa as x,pc as w,qb as de,sb as ce,sd as ye,ta as v,ua as _,ud as Me,v as k,va as ae,vc as B,vd as Se,yd as xe,za as oe,zd as Ie}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var j=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[E.dashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/Order",Roles:[E.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[E.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[E.channelView]},{Icon:"fas fa-file-alt",Title:"Dev Logs",Url:"/menu/log",Roles:[]},{Icon:"fas fa-bell",Title:"Notification",Url:"/menu/notification",Badge:!0,Roles:[]},{Icon:"fa-solid fa-wand-magic-sparkles",Title:"What`s New",Url:`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${Pe.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var rt=0,Xe="mat-badge-content",W=new Set,lt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-component"]],standalone:!0,features:[B],decls:0,vars:0,template:function(n,a){},styles:[".mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color);color:var(--mat-badge-text-color);font-family:var(--mat-badge-text-font);font-weight:var(--mat-badge-text-weight);border-radius:var(--mat-badge-container-shape)}.cdk-high-contrast-active .mat-badge-content{outline:solid 1px;border-radius:0}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color);color:var(--mat-badge-disabled-state-text-color)}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, unset);min-height:var(--mat-badge-small-size-container-size, unset);line-height:var(--mat-badge-legacy-small-size-container-size, var(--mat-badge-small-size-container-size));padding:var(--mat-badge-small-size-container-padding);font-size:var(--mat-badge-small-size-text-size);margin:var(--mat-badge-small-size-container-offset)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, unset);min-height:var(--mat-badge-container-size, unset);line-height:var(--mat-badge-legacy-container-size, var(--mat-badge-container-size));padding:var(--mat-badge-container-padding);font-size:var(--mat-badge-text-size);margin:var(--mat-badge-container-offset)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, unset);min-height:var(--mat-badge-large-size-container-size, unset);line-height:var(--mat-badge-legacy-large-size-container-size, var(--mat-badge-large-size-container-size));padding:var(--mat-badge-large-size-container-padding);font-size:var(--mat-badge-large-size-text-size);margin:var(--mat-badge-large-size-container-offset)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset)}"],encapsulation:2,changeDetection:0});let t=e;return t})(),et=(()=>{let e=class e{get color(){return this._color}set color(i){this._setColor(i),this._color=i}get content(){return this._content}set content(i){this._updateRenderedContent(i)}get description(){return this._description}set description(i){this._updateDescription(i)}constructor(i,n,a,m,S){this._ngZone=i,this._elementRef=n,this._ariaDescriber=a,this._renderer=m,this._animationMode=S,this._color="primary",this.overlap=!0,this.position="above after",this.size="medium",this._id=rt++,this._isInitialized=!1,this._interactivityChecker=x(Fe),this._document=x(ve);let C=x(be);if(!W.has(C)){W.add(C);let X=Ce(lt,{environmentInjector:x(oe)});C.onDestroy(()=>{W.delete(C),W.size===0&&X.destroy()})}}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let i=this._renderer.createElement("span"),n="mat-badge-active";return i.setAttribute("id",`mat-badge-content-${this._id}`),i.setAttribute("aria-hidden","true"),i.classList.add(Xe),this._animationMode==="NoopAnimations"&&i.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(i),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{i.classList.add(n)})}):i.classList.add(n),i}_updateRenderedContent(i){let n=`${i??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateDescription(i){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!i||this._isHostInteractive())&&this._removeInlineDescription(),this._description=i,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,i):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(i){let n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),i&&n.add(`mat-badge-${i}`)}_clearExistingBadges(){let i=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Xe}`);for(let n of Array.from(i))n!==this._badgeElement&&n.remove()}};e.\u0275fac=function(n){return new(n||e)(g(ce),g(re),g($e),g(de),g(le,8))},e.\u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,a){n&2&&z("mat-badge-overlap",a.overlap)("mat-badge-above",a.isAbove())("mat-badge-below",!a.isAbove())("mat-badge-before",!a.isAfter())("mat-badge-after",a.isAfter())("mat-badge-small",a.size==="small")("mat-badge-medium",a.size==="medium")("mat-badge-large",a.size==="large")("mat-badge-hidden",a.hidden||!a.content)("mat-badge-disabled",a.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",V],disabled:[2,"matBadgeDisabled","disabled",V],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",V]},standalone:!0,features:[me]});let t=e;return t})(),tt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[je,Z,Z]});let t=e;return t})();function dt(t,e){if(t&1&&(N(0),l(1,"p",23),p(2),s(),A()),t&2){let o=c(3).$implicit;r(2),w(" ",o.Title," ")}}function ct(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function mt(t,e){if(t&1&&(l(0,"a",22),b(1,"i"),h(2,dt,3,1,"ng-container",20)(3,ct,2,1,"ng-template",null,1,R),s()),t&2){let o=L(4),i=c(2).$implicit;d("href",i.Url,se),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function pt(t,e){if(t&1&&(N(0),h(1,mt,5,5,"a",21),A()),t&2){let o=c().$implicit;r(),d("ngxPermissionsOnly",o.Roles)}}function gt(t,e){if(t&1&&(l(0,"p",23),p(1),s()),t&2){let o=c(4).$implicit;r(),w(" ",o.Title," ")}}function ht(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(4).$implicit;r(),y(o.Title)}}function ft(t,e){if(t&1&&(N(0),h(1,gt,2,1,"p",23),q(2,"async"),h(3,ht,2,1,"p"),A()),t&2){let o=c(4);r(),ge(Q(2,1,o.notifications$)!=0?1:3)}}function ut(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function _t(t,e){if(t&1&&(l(0,"a",25),b(1,"i"),h(2,ft,4,3,"ng-container",20)(3,ut,2,1,"ng-template",null,2,R),s()),t&2){let o=L(4),i=c(2).$implicit,n=c();d("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function bt(t,e){if(t&1&&h(0,_t,5,6,"a",24),t&2){let o=c().$implicit;d("ngxPermissionsOnly",o.Roles)}}function Ct(t,e){if(t&1&&(l(0,"li",19),h(1,pt,2,1,"ng-container",20)(2,bt,1,1,"ng-template",null,0,R),s()),t&2){let o=e.$implicit,i=L(3);r(),d("ngIf",o.ExternalLink)("ngIfElse",i)}}var it=(()=>{let e=class e{constructor(i,n,a,m){this.toggleSidebarService=i,this.notificationService=n,this.decodeTokenService=a,this.authService=m,this.Menu={},this.isCollapseSidebar=!1,this.token=a.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new j().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(k(i=>i.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(i){if(i){let n,a=i.split(" ");return a.length==1?n=a[0].substring(0,2):n=a.shift().charAt(0)+a.pop().charAt(0),n}}};e.\u0275fac=function(n){return new(n||e)(g(Ve),g(Ue),g(ze),g(Le))},e.\u0275cmp=v({type:e,selectors:[["app-menu"]],decls:23,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(n,a){n&1&&(l(0,"div",3),q(1,"async"),l(2,"div",4)(3,"button",5),O("click",function(){return a.onCallapseSidebar()}),b(4,"i",6),s(),l(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),l(9,"div",10)(10,"div",11),p(11),s(),b(12,"div",12),l(13,"a",13),O("click",function(){return a.onLogout()}),b(14,"i",14),p(15,"\xA0 "),l(16,"span"),p(17," Log Out"),s()()()()(),l(18,"div",15)(19,"ul",16),h(20,Ct,4,2,"li",17),s()()(),l(21,"div",18),b(22,"router-outlet"),s()()),n&2&&(z("nav-open",Q(1,7,a.toggleState$)),r(2),d("ngClass",a.isCollapseSidebar?"collapses":""),r(2),d("ngClass",a.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),r(4),w(" ",a.storeName," "),r(3),w(" ",a.token==null?null:a.token.LID," "),r(9),d("ngForOf",a.Menu))},dependencies:[ye,Me,Se,Te,Oe,we,We,et,Ne,xe],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]});let t=e;return t})();var vt=[{path:"",component:it,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-OXWBU2ND.js").then(t=>t.DashboardModule),canActivate:[f],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-WNUERYHI.js").then(t=>t.ProductModule),canActivate:[f],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-Y47DOHWC.js").then(t=>t.InventoryRoutingModule),canActivate:[f],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-2CBSLHN2.js").then(t=>t.PriceRoutingModule),canActivate:[f],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-CZ2Q7KYV.js").then(t=>t.OrdersModule),canActivate:[f],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-LW27GPBD.js").then(t=>t.ReportModule),canActivate:[f],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-FDJ53QZD.js").then(t=>t.LogisticModule),canActivate:[f],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-UV2W7NZ7.js").then(t=>t.ChannelsModule),canActivate:[f],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-Q7V6SRNY.js").then(t=>t.LogsModule),canActivate:[f],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-MVMY5DLY.js").then(t=>t.NotificationModule),canActivate:[f],data:{title:"Push Notification"}}]}],nt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[Y.forChild(vt),Y]});let t=e;return t})();var Mt=["selectId"];function St(t,e){if(t&1&&(l(0,"span",3),p(1),s()),t&2){let o=e.item,i=c();d("title",o[i.bindLabel]),r(),y(o[i.bindLabel])}}var at=(()=>{let e=class e{set items(i){this.ngSelectInfiniteScroll.data=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(i){this._selected=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new K,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(i){i?(this.selectedChange.emit(i[this.bindValue]),this.selectedLabel.emit(i[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(n,a){if(n&1&&fe(Mt,7),n&2){let m;ue(m=_e())&&(a.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[B],decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(n,a){if(n&1){let m=he();l(0,"ng-select",1,0),O("clear",function(){return I(m),T(a.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return I(m),T(a.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return I(m),T(a.onOpenSelect())})("change",function(C){return I(m),T(a.onSelectChange(C))}),h(2,St,2,2,"ng-template",2),s()}n&2&&(pe("width",a.width),d("appendTo",a.parent)("disabled",a.disabled)("virtualScroll",!0)("typeahead",a.ngSelectInfiniteScroll.input$)("items",a.ngSelectInfiniteScroll.bufferData)("bindLabel",a.bindLabel)("bindValue",a.bindValue)("placeholder",a.placeholder)("ngModel",a.selected)("clearable",a.clearable))},dependencies:[M,$,Re,Be,U,Ee,De]});let t=e;return t})(),K=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new H,this._destroy$=new H,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(te(200),ie(),k(e=>(e&&(e=e.toLowerCase()),this.filterData(e))),ee(e=>e!==void 0),ne(this._destroy$)).subscribe(e=>{this._dataBuffer=e.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(e){let o=-1,i;return this._data.filter(a=>(i=JSON.stringify(a).toLowerCase(),o=i.indexOf(e),o!==-1||e==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(e){this._data=e||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(e,o){if(Ke.IsNotEmpty(e)){let i=this._data.filter(n=>n[o].toString().toLowerCase().indexOf(e)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(e){this._bufferSize=e}onScrollToEnd(){this.fetchMore()}fetchMore(){let e=this._dataBuffer.length,o=this._data.slice(e,this._bufferSize+e);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(o)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var ot=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[M,U,He,qe,Ze,Qe,Ye,Je,F,J,at,$,ke]});let t=e;return t})();var _n=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({providers:[Ie],imports:[M,nt,Ge,F,ot,tt,Ae.forChild()]});let t=e;return t})();export{_n as MenuModule};
@@ -1 +1 @@
1
- import{i as c}from"./chunk-EMO3QL6Q.js";import{b as a}from"./chunk-4SAJUEHO.js";import{ja as s,oa as o}from"./chunk-PQDPS2ID.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{i as c}from"./chunk-4HCEWP6Y.js";import{b as a}from"./chunk-4SAJUEHO.js";import{ja as s,oa as o}from"./chunk-PQDPS2ID.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,4 +1,4 @@
1
- import{e as Y}from"./chunk-4SAJUEHO.js";import{a as He,b as de,c as We,d as $e,e as he,f as ze,g as pe,h as Ke,i as V,j as fe,k as T}from"./chunk-KCDL7SWP.js";import{b as ue,c as $,d as Ge}from"./chunk-6SF7AUOH.js";import{o as Le}from"./chunk-OVEJFFL6.js";import{Cd as Be,Ed as Ne,F as De,Fd as Fe,G as xe,Kc as Oe,Lc as Me,O as se,U as Re,Ua as H,Yc as le,Z as ae,aa as x,ba as ce,c as g,ea as G,f as X,j as Te,ja as A,k as Ee,ka as F,ma as C,n as B,o as N,oa as h,p as R,pa as _e,q as K,qa as je,sb as W,ua as L,v as y,w as Pe}from"./chunk-PQDPS2ID.js";import{a as ie,i as I}from"./chunk-GNOSNGXM.js";var Ve={production:!0,version:"3.22.3",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var mt="firebase",wt="10.12.1";V(mt,wt,"app");var U=new Oe("ANGULARFIRE2_VERSION");var vt=(r,o)=>{let t=o?[o]:Ke(),e=[];return t.forEach(n=>{n.container.getProvider(r).instances.forEach(s=>{e.includes(s)||e.push(s)})}),e},q=class{constructor(){return vt(St)}},St="app-check";function ge(){}var Q=class{zone;delegate;constructor(o,t=Ee){this.zone=o,this.delegate=t}now(){return this.delegate.now()}schedule(o,t,e){let n=this.zone,i=function(s){n.runGuarded(()=>{o.apply(this,[s])})};return this.delegate.schedule(i,t,e)}},me=class{zone;task=null;constructor(o){this.zone=o}call(o,t){let e=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",ge,{},ge,ge)),t.pipe(G({next:e,complete:e,error:e})).subscribe(o).add(e)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},qe=(()=>{class r{ngZone;outsideAngular;insideAngular;constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new Q(Zone.current)),this.insideAngular=t.run(()=>new Q(Zone.current,Te)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(e){return new(e||r)(h(W))};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();function kt(){let r=globalThis.\u0275AngularFireScheduler;if(!r)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
2
- provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);return r}function Ue(r){return At(kt())(r)}function At(r){return function(t){return t=t.lift(new me(r.ngZone)),t.pipe(N(r.outsideAngular),B(r.insideAngular))}}var Je=(()=>{let o=class o{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let n=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return n||[]}ParseToken(e){try{let i=e.split(".")[0].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(i)),c=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(c));return l.header=s,l}catch{return!1}}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var yt=new Map,Ct={activated:!1,tokenObservers:[]},Tt={initialized:!1,enabled:!1};function E(r){return yt.get(r)||Object.assign({},Ct)}function et(){return Tt}var Et="https://content-firebaseappcheck.googleapis.com/v1";var Pt="exchangeDebugToken",Ze={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Ao=24*60*60*1e3;var ve=class{constructor(o,t,e,n,i){if(this.operation=o,this.retryPolicy=t,this.getWaitDuration=e,this.lowerBound=n,this.upperBound=i,this.pending=null,this.nextErrorWaitInterval=n,n>i)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(o){return I(this,null,function*(){this.stop();try{this.pending=new de,this.pending.promise.catch(t=>{}),yield Dt(this.getNextRun(o)),this.pending.resolve(),yield this.pending.promise,this.pending=new de,this.pending.promise.catch(t=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(t){this.retryPolicy(t)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(o){if(o)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}};function Dt(r){return new Promise(o=>{setTimeout(o,r)})}var xt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},j=new $e("appCheck","AppCheck",xt);function tt(r){if(!E(r).activated)throw j.create("use-before-activation",{appName:r.name})}function nt(e,n){return I(this,arguments,function*({url:r,body:o},t){let i={"Content-Type":"application/json"},s=t.getImmediate({optional:!0});if(s){let f=yield s.getHeartbeatsHeader();f&&(i["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(o),headers:i},c;try{c=yield fetch(r,a)}catch(f){throw j.create("fetch-network-error",{originalErrorMessage:f?.message})}if(c.status!==200)throw j.create("fetch-status-error",{httpStatus:c.status});let l;try{l=yield c.json()}catch(f){throw j.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=l.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw j.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function rt(r,o){let{projectId:t,appId:e,apiKey:n}=r.options;return{url:`${Et}/projects/${t}/apps/${e}:${Pt}?key=${n}`,body:{debug_token:o}}}var Rt="firebase-app-check-database",_t=1,Se="firebase-app-check-store";var ee=null;function jt(){return ee||(ee=new Promise((r,o)=>{try{let t=indexedDB.open(Rt,_t);t.onsuccess=e=>{r(e.target.result)},t.onerror=e=>{var n;o(j.create("storage-open",{originalErrorMessage:(n=e.target.error)===null||n===void 0?void 0:n.message}))},t.onupgradeneeded=e=>{let n=e.target.result;switch(e.oldVersion){case 0:n.createObjectStore(Se,{keyPath:"compositeKey"})}}}catch(t){o(j.create("storage-open",{originalErrorMessage:t?.message}))}}),ee)}function Ot(r,o){return Mt(Bt(r),o)}function Mt(r,o){return I(this,null,function*(){let e=(yield jt()).transaction(Se,"readwrite"),i=e.objectStore(Se).put({compositeKey:r,value:o});return new Promise((s,a)=>{i.onsuccess=c=>{s()},e.onerror=c=>{var l;a(j.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})})}function Bt(r){return`${r.options.appId}-${r.name}`}var ke=new ze("@firebase/app-check");function we(r,o){return We()?Ot(r,o).catch(t=>{ke.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function ot(){return et().enabled}function it(){return I(this,null,function*(){let r=et();if(r.enabled&&r.token)return r.token.promise;throw Error(`
1
+ import{e as Y}from"./chunk-4SAJUEHO.js";import{a as We,b as de,c as He,d as ze,e as he,f as $e,g as pe,h as Ke,i as V,j as fe,k as T}from"./chunk-KCDL7SWP.js";import{b as ue,c as z,d as Ge}from"./chunk-64G3XLI6.js";import{o as Fe}from"./chunk-OVEJFFL6.js";import{Cd as Be,Ed as Le,F as De,Fd as Ne,G as xe,Kc as Oe,Lc as Me,O as se,U as Re,Ua as W,Yc as le,Z as ae,aa as x,ba as ce,c as g,ea as G,f as X,j as Te,ja as A,k as Ee,ka as N,ma as y,n as B,o as L,oa as h,p as R,pa as _e,q as K,qa as je,sb as H,ua as F,v as I,w as Pe}from"./chunk-PQDPS2ID.js";import{a as ie,i as C}from"./chunk-GNOSNGXM.js";var Ve={production:!0,version:"3.22.5",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var mt="firebase",wt="10.12.1";V(mt,wt,"app");var U=new Oe("ANGULARFIRE2_VERSION");var St=(r,o)=>{let t=o?[o]:Ke(),e=[];return t.forEach(n=>{n.container.getProvider(r).instances.forEach(s=>{e.includes(s)||e.push(s)})}),e},q=class{constructor(){return St(vt)}},vt="app-check";function ge(){}var Q=class{zone;delegate;constructor(o,t=Ee){this.zone=o,this.delegate=t}now(){return this.delegate.now()}schedule(o,t,e){let n=this.zone,i=function(s){n.runGuarded(()=>{o.apply(this,[s])})};return this.delegate.schedule(i,t,e)}},me=class{zone;task=null;constructor(o){this.zone=o}call(o,t){let e=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",ge,{},ge,ge)),t.pipe(G({next:e,complete:e,error:e})).subscribe(o).add(e)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},qe=(()=>{class r{ngZone;outsideAngular;insideAngular;constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new Q(Zone.current)),this.insideAngular=t.run(()=>new Q(Zone.current,Te)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(e){return new(e||r)(h(H))};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();function kt(){let r=globalThis.\u0275AngularFireScheduler;if(!r)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
2
+ provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);return r}function Ue(r){return At(kt())(r)}function At(r){return function(t){return t=t.lift(new me(r.ngZone)),t.pipe(L(r.outsideAngular),B(r.insideAngular))}}var Je=(()=>{let o=class o{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let n=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return n||[]}ParseToken(e){try{let i=e.split(".")[0].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(i)),c=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(c));return l.header=s,l}catch{return!1}}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var It=new Map,yt={activated:!1,tokenObservers:[]},Tt={initialized:!1,enabled:!1};function E(r){return It.get(r)||Object.assign({},yt)}function et(){return Tt}var Et="https://content-firebaseappcheck.googleapis.com/v1";var Pt="exchangeDebugToken",Ze={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Ao=24*60*60*1e3;var Se=class{constructor(o,t,e,n,i){if(this.operation=o,this.retryPolicy=t,this.getWaitDuration=e,this.lowerBound=n,this.upperBound=i,this.pending=null,this.nextErrorWaitInterval=n,n>i)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(o){return C(this,null,function*(){this.stop();try{this.pending=new de,this.pending.promise.catch(t=>{}),yield Dt(this.getNextRun(o)),this.pending.resolve(),yield this.pending.promise,this.pending=new de,this.pending.promise.catch(t=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(t){this.retryPolicy(t)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(o){if(o)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}};function Dt(r){return new Promise(o=>{setTimeout(o,r)})}var xt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},j=new ze("appCheck","AppCheck",xt);function tt(r){if(!E(r).activated)throw j.create("use-before-activation",{appName:r.name})}function nt(e,n){return C(this,arguments,function*({url:r,body:o},t){let i={"Content-Type":"application/json"},s=t.getImmediate({optional:!0});if(s){let f=yield s.getHeartbeatsHeader();f&&(i["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(o),headers:i},c;try{c=yield fetch(r,a)}catch(f){throw j.create("fetch-network-error",{originalErrorMessage:f?.message})}if(c.status!==200)throw j.create("fetch-status-error",{httpStatus:c.status});let l;try{l=yield c.json()}catch(f){throw j.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=l.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw j.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function rt(r,o){let{projectId:t,appId:e,apiKey:n}=r.options;return{url:`${Et}/projects/${t}/apps/${e}:${Pt}?key=${n}`,body:{debug_token:o}}}var Rt="firebase-app-check-database",_t=1,ve="firebase-app-check-store";var ee=null;function jt(){return ee||(ee=new Promise((r,o)=>{try{let t=indexedDB.open(Rt,_t);t.onsuccess=e=>{r(e.target.result)},t.onerror=e=>{var n;o(j.create("storage-open",{originalErrorMessage:(n=e.target.error)===null||n===void 0?void 0:n.message}))},t.onupgradeneeded=e=>{let n=e.target.result;switch(e.oldVersion){case 0:n.createObjectStore(ve,{keyPath:"compositeKey"})}}}catch(t){o(j.create("storage-open",{originalErrorMessage:t?.message}))}}),ee)}function Ot(r,o){return Mt(Bt(r),o)}function Mt(r,o){return C(this,null,function*(){let e=(yield jt()).transaction(ve,"readwrite"),i=e.objectStore(ve).put({compositeKey:r,value:o});return new Promise((s,a)=>{i.onsuccess=c=>{s()},e.onerror=c=>{var l;a(j.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})})}function Bt(r){return`${r.options.appId}-${r.name}`}var ke=new $e("@firebase/app-check");function we(r,o){return He()?Ot(r,o).catch(t=>{ke.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function ot(){return et().enabled}function it(){return C(this,null,function*(){let r=et();if(r.enabled&&r.token)return r.token.promise;throw Error(`
3
3
  Can't get debug token in production mode.
4
- `)})}var Nt={error:"UNKNOWN_ERROR"};function Ft(r){return He.encodeString(JSON.stringify(r),!1)}function Ae(r,o=!1){return I(this,null,function*(){let t=r.app;tt(t);let e=E(t),n=e.token,i;if(n&&!J(n)&&(e.token=void 0,n=void 0),!n){let c=yield e.cachedTokenPromise;c&&(J(c)?n=c:yield we(t,void 0))}if(!o&&n&&J(n))return{token:n.token};let s=!1;if(ot()){e.exchangeTokenPromise||(e.exchangeTokenPromise=nt(rt(t,yield it()),r.heartbeatServiceProvider).finally(()=>{e.exchangeTokenPromise=void 0}),s=!0);let c=yield e.exchangeTokenPromise;return yield we(t,c),e.token=c,{token:c.token}}try{e.exchangeTokenPromise||(e.exchangeTokenPromise=e.provider.getToken().finally(()=>{e.exchangeTokenPromise=void 0}),s=!0),n=yield E(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"?ke.warn(c.message):ke.error(c),i=c}let a;return n?i?J(n)?a={token:n.token,internalError:i}:a=Ye(i):(a={token:n.token},e.token=n,yield we(t,n)):a=Ye(i),s&&$t(t,a),a})}function Lt(r){return I(this,null,function*(){let o=r.app;tt(o);let{provider:t}=E(o);if(ot()){let e=yield it(),{token:n}=yield nt(rt(o,e),r.heartbeatServiceProvider);return{token:n}}else{let{token:e}=yield t.getToken();return{token:e}}})}function Ht(r,o,t,e){let{app:n}=r,i=E(n),s={next:t,error:e,type:o};if(i.tokenObservers=[...i.tokenObservers,s],i.token&&J(i.token)){let a=i.token;Promise.resolve().then(()=>{t({token:a.token}),Xe(r)}).catch(()=>{})}i.cachedTokenPromise.then(()=>Xe(r))}function st(r,o){let t=E(r),e=t.tokenObservers.filter(n=>n.next!==o);e.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=e}function Xe(r){let{app:o}=r,t=E(o),e=t.tokenRefresher;e||(e=Wt(r),t.tokenRefresher=e),!e.isRunning()&&t.isTokenAutoRefreshEnabled&&e.start()}function Wt(r){let{app:o}=r;return new ve(()=>I(this,null,function*(){let t=E(o),e;if(t.token?e=yield Ae(r,!0):e=yield Ae(r),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let t=E(o);if(t.token){let e=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,n=t.token.expireTimeMillis-5*60*1e3;return e=Math.min(e,n),Math.max(0,e-Date.now())}else return 0},Ze.RETRIAL_MIN_WAIT,Ze.RETRIAL_MAX_WAIT)}function $t(r,o){let t=E(r).tokenObservers;for(let e of t)try{e.type==="EXTERNAL"&&o.error!=null?e.error(o.error):e.next(o)}catch{}}function J(r){return r.expireTimeMillis-Date.now()>0}function Ye(r){return{token:Ft(Nt),error:r}}var be=class{constructor(o,t){this.app=o,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:o}=E(this.app);for(let t of o)st(this.app,t.next);return Promise.resolve()}};function zt(r,o){return new be(r,o)}function Kt(r){return{getToken:o=>Ae(r,o),getLimitedUseToken:()=>Lt(r),addTokenListener:o=>Ht(r,"INTERNAL",o),removeTokenListener:o=>st(r.app,o)}}var Gt="@firebase/app-check",Vt="0.8.4";var qt="app-check",Qe="app-check-internal";function Ut(){pe(new he(qt,r=>{let o=r.getProvider("app").getImmediate(),t=r.getProvider("heartbeat");return zt(o,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,o,t)=>{r.getProvider(Qe).initialize()})),pe(new he(Qe,r=>{let o=r.getProvider("app-check").getImmediate();return Kt(o)},"PUBLIC").setInstantiationMode("EXPLICIT")),V(Gt,Vt)}Ut();var Jt=["localhost","0.0.0.0","127.0.0.1"],jo=typeof window<"u"&&Jt.includes(window.location.hostname);var Xt="firebase",Yt="10.12.1";T.registerVersion(Xt,Yt,"app-compat");var Qt=["ngOnDestroy"],ct=(r,o,t,e={})=>new Proxy(r,{get:(n,i)=>t.runOutsideAngular(()=>{if(r[i])return e?.spy?.get&&e.spy.get(i,r[i]),r[i];if(Qt.indexOf(i)>-1)return()=>{};let s=o.toPromise().then(a=>{let c=a?.[i];return typeof c=="function"?c.bind(a):c?.then?c.then(l=>t.run(()=>l)):t.run(()=>c)});return new Proxy(()=>{},{get:(a,c)=>s[c],apply:(a,c,l)=>s.then(d=>{let u=d?.(...l);return e?.spy?.apply&&e.spy.apply(i,l,u),u})})})});var te=class{constructor(o){return o}},ne=new C("angularfire2.app.options"),re=new C("angularfire2.app.name");function Ie(r,o,t){let e=typeof t=="string"&&t||"[DEFAULT]",n=typeof t=="object"&&t||{};n.name=n.name||e;let s=T.apps.filter(a=>a&&a.name===n.name)[0]||o.runOutsideAngular(()=>T.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(s.options)){let a=!!module.hot;en("error",`${s.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new te(s)}var en=(r,...o)=>{le()&&typeof console<"u"&&console[r](...o)},tn={provide:te,useFactory:Ie,deps:[ne,W,[new je,re]]},Ko=(()=>{class r{static initializeApp(t,e){return{ngModule:r,providers:[{provide:ne,useValue:t},{provide:re,useValue:e}]}}constructor(t){T.registerVersion("angularfire",U.full,"core"),T.registerVersion("angularfire",U.full,"app-compat"),T.registerVersion("angular",Me.full,t.toString())}static \u0275fac=function(e){return new(e||r)(h(H))};static \u0275mod=L({type:r});static \u0275inj=F({providers:[tn]})}return r})();function lt(r,o,t,e,n){let[,i,s]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(i)return nn(n,s)||(at("error",`${o} was already initialized on the ${t} Firebase App with different settings.${rn?" You may need to reload as Firebase is not HMR aware.":""}`),at("warn",{is:n,was:s})),i;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([r,a,n]),a}}function nn(r,o){try{return r.toString()===o.toString()}catch{return r===o}}var rn=typeof module<"u"&&!!module.hot,at=(r,...o)=>{le()&&typeof console<"u"&&console[r](...o)};globalThis.\u0275AngularfireInstanceCache||=[];var on=new C("angularfire2.auth.use-emulator"),sn=new C("angularfire2.auth.settings"),an=new C("angularfire2.auth.tenant-id"),cn=new C("angularfire2.auth.langugage-code"),ln=new C("angularfire2.auth.use-device-language"),un=new C("angularfire.auth.persistence"),dn=(r,o,t,e,n,i,s,a)=>lt(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let c=o.runOutsideAngular(()=>r.auth());if(t&&c.useEmulator(...t),e&&(c.tenantId=e),c.languageCode=n,i&&c.useDeviceLanguage(),s)for(let[l,d]of Object.entries(s))c.settings[l]=d;return a&&c.setPersistence(a),c},[t,e,n,i,s,a]),ye=(()=>{class r{authState;idToken;user;idTokenResult;credential;constructor(t,e,n,i,s,a,c,l,d,u,p,f){let z=new X,O=K(void 0).pipe(B(s.outsideAngular),x(()=>i.runOutsideAngular(()=>import("./chunk-F4WIW6HA.js"))),y(()=>Ie(t,i,e)),y(P=>dn(P,i,a,l,d,u,c,p)),ae({bufferSize:1,refCount:!1}));if(Fe(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=K(null);else{O.pipe(Re()).subscribe();let P=O.pipe(x(w=>w.getRedirectResult().then(D=>D,()=>null)),Ue,ae({bufferSize:1,refCount:!1})),Z=O.pipe(x(w=>new g(D=>({unsubscribe:i.runOutsideAngular(()=>w.onAuthStateChanged(M=>D.next(M),M=>D.error(M),()=>D.complete()))})))),oe=O.pipe(x(w=>new g(D=>({unsubscribe:i.runOutsideAngular(()=>w.onIdTokenChanged(M=>D.next(M),M=>D.error(M),()=>D.complete()))}))));this.authState=P.pipe(ce(Z),N(s.outsideAngular),B(s.insideAngular)),this.user=P.pipe(ce(oe),N(s.outsideAngular),B(s.insideAngular)),this.idToken=this.user.pipe(x(w=>w?R(w.getIdToken()):K(null))),this.idTokenResult=this.user.pipe(x(w=>w?R(w.getIdTokenResult()):K(null))),this.credential=De(P,z,this.authState.pipe(xe(w=>!w))).pipe(y(w=>w?.user?w:null),N(s.outsideAngular),B(s.insideAngular))}return ct(this,O,i,{spy:{apply:(P,Z,oe)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&oe.then(w=>z.next(w))}}})}static \u0275fac=function(e){return new(e||r)(h(ne),h(re,8),h(H),h(W),h(qe),h(on,8),h(sn,8),h(an,8),h(cn,8),h(ln,8),h(un,8),h(q,8))};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),ii=(()=>{class r{constructor(){T.registerVersion("angularfire",U.full,"auth-compat")}static \u0275fac=function(e){return new(e||r)};static \u0275mod=L({type:r});static \u0275inj=F({providers:[ye]})}return r})();function m(r,o,t,e){return new Promise((n,i)=>{r||i("IndexedDB not available");let s=r.open(o,t),a;s.onsuccess=c=>{a=s.result,n(a)},s.onerror=c=>{i(`IndexedDB error: ${s.error}`)},typeof e=="function"&&(s.onupgradeneeded=c=>{e(c,a)})})}function ut(r,o,t,e,n){if(!r)return;let i=r.open(o,t);i.onupgradeneeded=s=>{let a=s.target.result;e.forEach(l=>{if(!a.objectStoreNames.contains(l.store)){let d=a.createObjectStore(l.store,l.storeConfig);l.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let c=n&&n();c&&Object.keys(c).map(l=>parseInt(l,10)).filter(l=>l>s.oldVersion).sort((l,d)=>l-d).forEach(l=>{c[l](a,i.transaction)}),a.close()},i.onsuccess=s=>{s.target.result.close()}}function pn(r,o,t){if(!r||!o||!t)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(e=>{try{let n=o+1,i=indexedDB.open(r,n);i.onupgradeneeded=s=>{let a=s.target.result;a.deleteObjectStore(t),a.close(),console.log("onupgradeneeded"),e.next(!0),e.complete()},i.onerror=s=>e.error(s)}catch(n){e.error(n)}})}function fn(r,o){return r.objectStoreNames.contains(o)}function b(r,o,t){r||t("You need to use the openDatabase function to create a database before you query it!"),fn(r,o)||t(`objectStore does not exists: ${o}`)}function S(r,o){let t=r.transaction(o.storeName,o.dbMode);return t.onerror=o.error,t.onabort=o.abort,t}function k(r,o,t,e){return{storeName:o,dbMode:r,error:n=>{t(n)},abort:n=>{t(n)}}}var v=function(r){return r.readonly="readonly",r.readwrite="readwrite",r}(v||{}),dt=new C(null),Ce=(()=>{class r{constructor(t,e){if(this.dbConfig=t,this.platformId=e,!t.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!t.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Ne(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,ut(this.indexedDB,t.name,t.version,t.objectStoresMeta,t.migrationFactory),m(this.indexedDB,t.name).then(n=>{n.version!==t.version&&(this.dbConfig.version=n.version)}))}createObjectStore(t,e){let n=[t];ut(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,e)}add(t,e,n){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=S(s,k(v.readwrite,t,d=>i.error(d))).objectStore(t),l=n?c.add(e,n):c.add(e);l.onsuccess=d=>I(this,null,function*(){let u=d.target.result,p=c.get(u);p.onsuccess=f=>{i.next(f.target.result),i.complete()}})}).catch(s=>i.error(s))})}bulkAdd(t,e){let n=new Promise((i,s)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let l=S(a,k(v.readwrite,t,i,s)).objectStore(t),d=e.map(u=>new Promise((p,f)=>{let z=u.key;delete u.key;let O=z?l.add(u,z):l.add(u);O.onsuccess=P=>{let Z=P.target.result;p(Z)}}));i(Promise.all(d))}).catch(a=>s(a))});return R(n)}bulkDelete(t,e){let n=e.map(i=>new Promise((s,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(c=>{let l=S(c,k(v.readwrite,t,a,s));l.objectStore(t).delete(i),l.oncomplete=()=>{this.getAll(t).pipe(se(1)).subscribe(u=>{s(u)})}}).catch(c=>a(c))}));return R(Promise.all(n))}getByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let c=S(i,k(v.readonly,t,n.error)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result),n.complete()},c.onerror=l=>{n.error(l)}}).catch(i=>n.error(i))})}bulkGet(t,e){let n=e.map(i=>this.getByKey(t,i));return new g(i=>{Pe(n).subscribe(s=>{i.next(s),i.complete()})})}getByID(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let c=S(i,k(v.readonly,t,n.error,n.next)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result)}}).catch(i=>n.error(i))})}getByIndex(t,e,n){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{b(s,t,u=>i.error(u));let d=S(s,k(v.readonly,t,i.error)).objectStore(t).index(e).get(n);d.onsuccess=u=>{i.next(u.target.result),i.complete()}}).catch(s=>i.error(s))})}getAll(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{b(n,t,c=>e.error(c));let a=S(n,k(v.readonly,t,e.error,e.next)).objectStore(t).getAll();a.onerror=c=>{e.error(c)},a.onsuccess=({target:{result:c}})=>{e.next(c),e.complete()}}).catch(n=>e.error(n))})}update(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let a=S(i,k(v.readwrite,t,l=>n.error(l))).objectStore(t),c=a.put(e);c.onsuccess=l=>I(this,null,function*(){let d=l.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(i=>n.error(i))})}delete(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,c=>n.error(c));let s=S(i,k(v.readwrite,t,c=>n.error(c)));s.objectStore(t).delete(e),s.oncomplete=()=>{this.getAll(t).pipe(se(1)).subscribe(c=>{n.next(c),n.complete()})}}).catch(i=>n.error(i))})}deleteByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,c=>n.error(c));let s=S(i,k(v.readwrite,t,c=>n.error(c))),a=s.objectStore(t);s.oncomplete=()=>{n.next(!0),n.complete()},a.delete(e)}).catch(i=>n.error(i))})}clear(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{b(n,t,a=>e.error(a));let i=S(n,k(v.readwrite,t,a=>e.error(a)));i.objectStore(t).clear(),i.oncomplete=()=>{e.next(!0),e.complete()}}).catch(n=>e.error(n))})}deleteDatabase(){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(e=>I(this,null,function*(){yield e.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{t.next(!0),t.complete()},n.onerror=i=>t.error(i),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(e=>t.error(e))})}openCursor(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let a=S(i,k(v.readonly,t,n.error)).objectStore(t),c=e===void 0?a.openCursor():a.openCursor(e);c.onsuccess=l=>{n.next(l),n.complete()}}).catch(i=>n.error(i))})}openCursorByIndex(t,e,n,i=v.readonly){let s=new X;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,t,p=>{s.error(p)});let u=S(a,k(i,t,p=>{s.error(p)},()=>{s.next()})).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{s.next(p)}}).catch(a=>s.error(a)),s}getAllByIndex(t,e,n){let i=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,t,p=>s.error(p));let u=S(a,k(v.readonly,t,s.error)).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(i.push(f.value),f.continue()):(s.next(i),s.complete())}}).catch(a=>s.error(a))})}getAllKeysByIndex(t,e,n){let i=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,t,p=>s.error(p));let u=S(a,k(v.readonly,t,s.error)).objectStore(t).index(e).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(i.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(s.next(i),s.complete())}}).catch(a=>s.error(a))})}count(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let c=S(i,k(v.readonly,t,n.error)).objectStore(t).count(e);c.onerror=l=>n.error(l),c.onsuccess=l=>{n.next(l.target.result),n.complete()}}).catch(i=>n.error(i))})}countByIndex(t,e,n){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{b(s,t,u=>i.error(u));let d=S(s,k(v.readonly,t,i.error)).objectStore(t).index(e).count(n);d.onerror=u=>i.error(u),d.onsuccess=u=>{i.next(u.target.result),i.complete()}}).catch(s=>i.error(s))})}deleteObjectStore(t){return pn(this.dbConfig.name,++this.dbConfig.version,t)}}return r.\u0275fac=function(t){return new(t||r)(h(dt),h(H))},r.\u0275prov=A({token:r,factory:r.\u0275fac}),r})(),pi=(()=>{class r{static forRoot(t){return{ngModule:r,providers:[Ce,{provide:dt,useValue:t}]}}}return r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=L({type:r}),r.\u0275inj=F({imports:[[Be]]}),r})();var ht=(()=>{let o=class o{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let i=this.getKey(n);return this.db.add(this.DATABASE,e,i).pipe(y(s=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case ue.Lazada:n="Lazada";break;case ue.Tokopedia:n="Tokopedia";break}return n}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}};o.\u0275fac=function(n){return new(n||o)(h(Ce))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var pt=(()=>{let o=class o{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let n={Enabled:!0};e&&(n=ie(ie({},n),e)),localStorage.setItem("Intercom",JSON.stringify(n))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return $.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var ft=(()=>{let o=class o{};o.SubmitConfig="/api/Channel/SubmitConfig",o.PosAccountTest="/api/POSAccount/Test",o.PosAccountRemove="/api/POSAccount/Remove",o.PosAccountGetConfig="/api/ChannelLoader/GetConfig",o.ChannelGetLastSyncByID="/api/Channel/GetLastSyncByID",o.GetChannel="/api/Channel/GetChannel",o.GetChannelLoader="/api/ChannelLoader/GetChannelLoader",o.TestShopID="/api/Channel/TestShopID",o.UpdateChannelIndex="/api/Channel/UpdateChannelIndex",o.DeleteChannel="/api/Channel/DeleteChannel",o.GetRegisterByOutletName="/api/Channel/GetRegistersByOutletOrder",o.GetChannelRowCount="/api/Channel/GetCountChannel",o.GetChannelWarehouse="/api/Channel/GetChannelWarehouseLocation",o.UnSynchronizedWarehouse="/api/Channel/UnSynchronizedWarehouse",o.GetChannelDetail="/api/ChannelLoader/GetChannelView",o.GetOrderPreview="/api/Orders/Preview",o.GetOrderPreviewV2="/api/Orders/PreviewV2",o.GetDownloadOrder="/api/Orders/Download",o.GetDownloadOrderV2="/api/Orders/DownloadV2";let r=o;return r})();var gt=(()=>{let o=class o{constructor(){this.httpService=_e(Y)}update(e){if(e)this.updateLocalStorage(e);else{let n={RowCount:500,PageNumber:1};this.httpService.post(ft.GetChannel,n).pipe(y(i=>i?.Data)).subscribe(i=>{this.updateLocalStorage(i)})}}getChannels(){let e=localStorage.getItem("channels");return e?JSON.parse(e):[]}updateLocalStorage(e){let n=this.mappingChannelLocalStorage(e);localStorage.setItem("channels",JSON.stringify(n))}mappingChannelLocalStorage(e){return e.map(i=>({ID:i.ID,Name:i.Name,TypeID:i.TypeID,Img:$.getChannelLogoByTypeId(i.TypeID)}))}clearLocalStorage(){localStorage.removeItem("channels")}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var ji=(()=>{let o=class o{constructor(e,n,i,s,a,c,l,d){this.httpService=e,this.tokenDecodeService=n,this.afAuth=i,this.ngxPermission=s,this.localDataService=a,this.router=c,this.intercomService=l,this.updateChannelStorageService=d}login(e){return this.httpService.post("/api/token/Login",e).pipe(G(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(Ve.news).pipe(y(e=>e?.items?.map(n=>n?.properties)))}loginWithGoogle(e,n){e.preventDefault();let i=new fe;return i.setCustomParameters({prompt:"select_account"}),R(this.afAuth.signInWithPopup(i)).pipe(y(s=>s.credential),y(s=>s.idToken),x(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:n}))),G(s=>{this.setLocalStorage(s,n,null),this.loadPermissions()}))}setLocalStorage(e,n,i){localStorage.setItem("user",JSON.stringify(e)),localStorage.setItem("Authorization",JSON.stringify({Host:n,username:i})),this.updateChannelStorageService.update(e.Channels),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem("user");if($.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}getChannels(){return this.updateChannelStorageService.getChannels()}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=JSON.parse(window.localStorage.getItem("user")),n=new Date;if(e!=null){let i=new Date(e.Token.expiredAt);return n<i?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem("Authorization");this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,localStorage.removeItem("user"),this.updateChannelStorageService.clearLocalStorage(),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}};o.\u0275fac=function(n){return new(n||o)(h(Y),h(Je),h(ye),h(Ge),h(ht),h(Le),h(pt),h(gt))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();export{Ve as a,Je as b,Ko as c,ii as d,pi as e,ht as f,ft as g,gt as h,ji as i};
4
+ `)})}var Lt={error:"UNKNOWN_ERROR"};function Nt(r){return We.encodeString(JSON.stringify(r),!1)}function Ae(r,o=!1){return C(this,null,function*(){let t=r.app;tt(t);let e=E(t),n=e.token,i;if(n&&!J(n)&&(e.token=void 0,n=void 0),!n){let c=yield e.cachedTokenPromise;c&&(J(c)?n=c:yield we(t,void 0))}if(!o&&n&&J(n))return{token:n.token};let s=!1;if(ot()){e.exchangeTokenPromise||(e.exchangeTokenPromise=nt(rt(t,yield it()),r.heartbeatServiceProvider).finally(()=>{e.exchangeTokenPromise=void 0}),s=!0);let c=yield e.exchangeTokenPromise;return yield we(t,c),e.token=c,{token:c.token}}try{e.exchangeTokenPromise||(e.exchangeTokenPromise=e.provider.getToken().finally(()=>{e.exchangeTokenPromise=void 0}),s=!0),n=yield E(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"?ke.warn(c.message):ke.error(c),i=c}let a;return n?i?J(n)?a={token:n.token,internalError:i}:a=Ye(i):(a={token:n.token},e.token=n,yield we(t,n)):a=Ye(i),s&&zt(t,a),a})}function Ft(r){return C(this,null,function*(){let o=r.app;tt(o);let{provider:t}=E(o);if(ot()){let e=yield it(),{token:n}=yield nt(rt(o,e),r.heartbeatServiceProvider);return{token:n}}else{let{token:e}=yield t.getToken();return{token:e}}})}function Wt(r,o,t,e){let{app:n}=r,i=E(n),s={next:t,error:e,type:o};if(i.tokenObservers=[...i.tokenObservers,s],i.token&&J(i.token)){let a=i.token;Promise.resolve().then(()=>{t({token:a.token}),Xe(r)}).catch(()=>{})}i.cachedTokenPromise.then(()=>Xe(r))}function st(r,o){let t=E(r),e=t.tokenObservers.filter(n=>n.next!==o);e.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=e}function Xe(r){let{app:o}=r,t=E(o),e=t.tokenRefresher;e||(e=Ht(r),t.tokenRefresher=e),!e.isRunning()&&t.isTokenAutoRefreshEnabled&&e.start()}function Ht(r){let{app:o}=r;return new Se(()=>C(this,null,function*(){let t=E(o),e;if(t.token?e=yield Ae(r,!0):e=yield Ae(r),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let t=E(o);if(t.token){let e=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,n=t.token.expireTimeMillis-5*60*1e3;return e=Math.min(e,n),Math.max(0,e-Date.now())}else return 0},Ze.RETRIAL_MIN_WAIT,Ze.RETRIAL_MAX_WAIT)}function zt(r,o){let t=E(r).tokenObservers;for(let e of t)try{e.type==="EXTERNAL"&&o.error!=null?e.error(o.error):e.next(o)}catch{}}function J(r){return r.expireTimeMillis-Date.now()>0}function Ye(r){return{token:Nt(Lt),error:r}}var be=class{constructor(o,t){this.app=o,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:o}=E(this.app);for(let t of o)st(this.app,t.next);return Promise.resolve()}};function $t(r,o){return new be(r,o)}function Kt(r){return{getToken:o=>Ae(r,o),getLimitedUseToken:()=>Ft(r),addTokenListener:o=>Wt(r,"INTERNAL",o),removeTokenListener:o=>st(r.app,o)}}var Gt="@firebase/app-check",Vt="0.8.4";var qt="app-check",Qe="app-check-internal";function Ut(){pe(new he(qt,r=>{let o=r.getProvider("app").getImmediate(),t=r.getProvider("heartbeat");return $t(o,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,o,t)=>{r.getProvider(Qe).initialize()})),pe(new he(Qe,r=>{let o=r.getProvider("app-check").getImmediate();return Kt(o)},"PUBLIC").setInstantiationMode("EXPLICIT")),V(Gt,Vt)}Ut();var Jt=["localhost","0.0.0.0","127.0.0.1"],jo=typeof window<"u"&&Jt.includes(window.location.hostname);var Xt="firebase",Yt="10.12.1";T.registerVersion(Xt,Yt,"app-compat");var Qt=["ngOnDestroy"],ct=(r,o,t,e={})=>new Proxy(r,{get:(n,i)=>t.runOutsideAngular(()=>{if(r[i])return e?.spy?.get&&e.spy.get(i,r[i]),r[i];if(Qt.indexOf(i)>-1)return()=>{};let s=o.toPromise().then(a=>{let c=a?.[i];return typeof c=="function"?c.bind(a):c?.then?c.then(l=>t.run(()=>l)):t.run(()=>c)});return new Proxy(()=>{},{get:(a,c)=>s[c],apply:(a,c,l)=>s.then(d=>{let u=d?.(...l);return e?.spy?.apply&&e.spy.apply(i,l,u),u})})})});var te=class{constructor(o){return o}},ne=new y("angularfire2.app.options"),re=new y("angularfire2.app.name");function Ce(r,o,t){let e=typeof t=="string"&&t||"[DEFAULT]",n=typeof t=="object"&&t||{};n.name=n.name||e;let s=T.apps.filter(a=>a&&a.name===n.name)[0]||o.runOutsideAngular(()=>T.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(s.options)){let a=!!module.hot;en("error",`${s.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new te(s)}var en=(r,...o)=>{le()&&typeof console<"u"&&console[r](...o)},tn={provide:te,useFactory:Ce,deps:[ne,H,[new je,re]]},Ko=(()=>{class r{static initializeApp(t,e){return{ngModule:r,providers:[{provide:ne,useValue:t},{provide:re,useValue:e}]}}constructor(t){T.registerVersion("angularfire",U.full,"core"),T.registerVersion("angularfire",U.full,"app-compat"),T.registerVersion("angular",Me.full,t.toString())}static \u0275fac=function(e){return new(e||r)(h(W))};static \u0275mod=F({type:r});static \u0275inj=N({providers:[tn]})}return r})();function lt(r,o,t,e,n){let[,i,s]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(i)return nn(n,s)||(at("error",`${o} was already initialized on the ${t} Firebase App with different settings.${rn?" You may need to reload as Firebase is not HMR aware.":""}`),at("warn",{is:n,was:s})),i;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([r,a,n]),a}}function nn(r,o){try{return r.toString()===o.toString()}catch{return r===o}}var rn=typeof module<"u"&&!!module.hot,at=(r,...o)=>{le()&&typeof console<"u"&&console[r](...o)};globalThis.\u0275AngularfireInstanceCache||=[];var on=new y("angularfire2.auth.use-emulator"),sn=new y("angularfire2.auth.settings"),an=new y("angularfire2.auth.tenant-id"),cn=new y("angularfire2.auth.langugage-code"),ln=new y("angularfire2.auth.use-device-language"),un=new y("angularfire.auth.persistence"),dn=(r,o,t,e,n,i,s,a)=>lt(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let c=o.runOutsideAngular(()=>r.auth());if(t&&c.useEmulator(...t),e&&(c.tenantId=e),c.languageCode=n,i&&c.useDeviceLanguage(),s)for(let[l,d]of Object.entries(s))c.settings[l]=d;return a&&c.setPersistence(a),c},[t,e,n,i,s,a]),Ie=(()=>{class r{authState;idToken;user;idTokenResult;credential;constructor(t,e,n,i,s,a,c,l,d,u,p,f){let $=new X,O=K(void 0).pipe(B(s.outsideAngular),x(()=>i.runOutsideAngular(()=>import("./chunk-F4WIW6HA.js"))),I(()=>Ce(t,i,e)),I(P=>dn(P,i,a,l,d,u,c,p)),ae({bufferSize:1,refCount:!1}));if(Ne(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=K(null);else{O.pipe(Re()).subscribe();let P=O.pipe(x(w=>w.getRedirectResult().then(D=>D,()=>null)),Ue,ae({bufferSize:1,refCount:!1})),Z=O.pipe(x(w=>new g(D=>({unsubscribe:i.runOutsideAngular(()=>w.onAuthStateChanged(M=>D.next(M),M=>D.error(M),()=>D.complete()))})))),oe=O.pipe(x(w=>new g(D=>({unsubscribe:i.runOutsideAngular(()=>w.onIdTokenChanged(M=>D.next(M),M=>D.error(M),()=>D.complete()))}))));this.authState=P.pipe(ce(Z),L(s.outsideAngular),B(s.insideAngular)),this.user=P.pipe(ce(oe),L(s.outsideAngular),B(s.insideAngular)),this.idToken=this.user.pipe(x(w=>w?R(w.getIdToken()):K(null))),this.idTokenResult=this.user.pipe(x(w=>w?R(w.getIdTokenResult()):K(null))),this.credential=De(P,$,this.authState.pipe(xe(w=>!w))).pipe(I(w=>w?.user?w:null),L(s.outsideAngular),B(s.insideAngular))}return ct(this,O,i,{spy:{apply:(P,Z,oe)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&oe.then(w=>$.next(w))}}})}static \u0275fac=function(e){return new(e||r)(h(ne),h(re,8),h(W),h(H),h(qe),h(on,8),h(sn,8),h(an,8),h(cn,8),h(ln,8),h(un,8),h(q,8))};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),ii=(()=>{class r{constructor(){T.registerVersion("angularfire",U.full,"auth-compat")}static \u0275fac=function(e){return new(e||r)};static \u0275mod=F({type:r});static \u0275inj=N({providers:[Ie]})}return r})();function m(r,o,t,e){return new Promise((n,i)=>{r||i("IndexedDB not available");let s=r.open(o,t),a;s.onsuccess=c=>{a=s.result,n(a)},s.onerror=c=>{i(`IndexedDB error: ${s.error}`)},typeof e=="function"&&(s.onupgradeneeded=c=>{e(c,a)})})}function ut(r,o,t,e,n){if(!r)return;let i=r.open(o,t);i.onupgradeneeded=s=>{let a=s.target.result;e.forEach(l=>{if(!a.objectStoreNames.contains(l.store)){let d=a.createObjectStore(l.store,l.storeConfig);l.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let c=n&&n();c&&Object.keys(c).map(l=>parseInt(l,10)).filter(l=>l>s.oldVersion).sort((l,d)=>l-d).forEach(l=>{c[l](a,i.transaction)}),a.close()},i.onsuccess=s=>{s.target.result.close()}}function pn(r,o,t){if(!r||!o||!t)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(e=>{try{let n=o+1,i=indexedDB.open(r,n);i.onupgradeneeded=s=>{let a=s.target.result;a.deleteObjectStore(t),a.close(),console.log("onupgradeneeded"),e.next(!0),e.complete()},i.onerror=s=>e.error(s)}catch(n){e.error(n)}})}function fn(r,o){return r.objectStoreNames.contains(o)}function b(r,o,t){r||t("You need to use the openDatabase function to create a database before you query it!"),fn(r,o)||t(`objectStore does not exists: ${o}`)}function v(r,o){let t=r.transaction(o.storeName,o.dbMode);return t.onerror=o.error,t.onabort=o.abort,t}function k(r,o,t,e){return{storeName:o,dbMode:r,error:n=>{t(n)},abort:n=>{t(n)}}}var S=function(r){return r.readonly="readonly",r.readwrite="readwrite",r}(S||{}),dt=new y(null),ye=(()=>{class r{constructor(t,e){if(this.dbConfig=t,this.platformId=e,!t.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!t.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Le(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,ut(this.indexedDB,t.name,t.version,t.objectStoresMeta,t.migrationFactory),m(this.indexedDB,t.name).then(n=>{n.version!==t.version&&(this.dbConfig.version=n.version)}))}createObjectStore(t,e){let n=[t];ut(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,e)}add(t,e,n){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=v(s,k(S.readwrite,t,d=>i.error(d))).objectStore(t),l=n?c.add(e,n):c.add(e);l.onsuccess=d=>C(this,null,function*(){let u=d.target.result,p=c.get(u);p.onsuccess=f=>{i.next(f.target.result),i.complete()}})}).catch(s=>i.error(s))})}bulkAdd(t,e){let n=new Promise((i,s)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let l=v(a,k(S.readwrite,t,i,s)).objectStore(t),d=e.map(u=>new Promise((p,f)=>{let $=u.key;delete u.key;let O=$?l.add(u,$):l.add(u);O.onsuccess=P=>{let Z=P.target.result;p(Z)}}));i(Promise.all(d))}).catch(a=>s(a))});return R(n)}bulkDelete(t,e){let n=e.map(i=>new Promise((s,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(c=>{let l=v(c,k(S.readwrite,t,a,s));l.objectStore(t).delete(i),l.oncomplete=()=>{this.getAll(t).pipe(se(1)).subscribe(u=>{s(u)})}}).catch(c=>a(c))}));return R(Promise.all(n))}getByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let c=v(i,k(S.readonly,t,n.error)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result),n.complete()},c.onerror=l=>{n.error(l)}}).catch(i=>n.error(i))})}bulkGet(t,e){let n=e.map(i=>this.getByKey(t,i));return new g(i=>{Pe(n).subscribe(s=>{i.next(s),i.complete()})})}getByID(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let c=v(i,k(S.readonly,t,n.error,n.next)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result)}}).catch(i=>n.error(i))})}getByIndex(t,e,n){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{b(s,t,u=>i.error(u));let d=v(s,k(S.readonly,t,i.error)).objectStore(t).index(e).get(n);d.onsuccess=u=>{i.next(u.target.result),i.complete()}}).catch(s=>i.error(s))})}getAll(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{b(n,t,c=>e.error(c));let a=v(n,k(S.readonly,t,e.error,e.next)).objectStore(t).getAll();a.onerror=c=>{e.error(c)},a.onsuccess=({target:{result:c}})=>{e.next(c),e.complete()}}).catch(n=>e.error(n))})}update(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let a=v(i,k(S.readwrite,t,l=>n.error(l))).objectStore(t),c=a.put(e);c.onsuccess=l=>C(this,null,function*(){let d=l.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(i=>n.error(i))})}delete(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,c=>n.error(c));let s=v(i,k(S.readwrite,t,c=>n.error(c)));s.objectStore(t).delete(e),s.oncomplete=()=>{this.getAll(t).pipe(se(1)).subscribe(c=>{n.next(c),n.complete()})}}).catch(i=>n.error(i))})}deleteByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,c=>n.error(c));let s=v(i,k(S.readwrite,t,c=>n.error(c))),a=s.objectStore(t);s.oncomplete=()=>{n.next(!0),n.complete()},a.delete(e)}).catch(i=>n.error(i))})}clear(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{b(n,t,a=>e.error(a));let i=v(n,k(S.readwrite,t,a=>e.error(a)));i.objectStore(t).clear(),i.oncomplete=()=>{e.next(!0),e.complete()}}).catch(n=>e.error(n))})}deleteDatabase(){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(e=>C(this,null,function*(){yield e.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{t.next(!0),t.complete()},n.onerror=i=>t.error(i),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(e=>t.error(e))})}openCursor(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let a=v(i,k(S.readonly,t,n.error)).objectStore(t),c=e===void 0?a.openCursor():a.openCursor(e);c.onsuccess=l=>{n.next(l),n.complete()}}).catch(i=>n.error(i))})}openCursorByIndex(t,e,n,i=S.readonly){let s=new X;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,t,p=>{s.error(p)});let u=v(a,k(i,t,p=>{s.error(p)},()=>{s.next()})).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{s.next(p)}}).catch(a=>s.error(a)),s}getAllByIndex(t,e,n){let i=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,t,p=>s.error(p));let u=v(a,k(S.readonly,t,s.error)).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(i.push(f.value),f.continue()):(s.next(i),s.complete())}}).catch(a=>s.error(a))})}getAllKeysByIndex(t,e,n){let i=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,t,p=>s.error(p));let u=v(a,k(S.readonly,t,s.error)).objectStore(t).index(e).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(i.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(s.next(i),s.complete())}}).catch(a=>s.error(a))})}count(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let c=v(i,k(S.readonly,t,n.error)).objectStore(t).count(e);c.onerror=l=>n.error(l),c.onsuccess=l=>{n.next(l.target.result),n.complete()}}).catch(i=>n.error(i))})}countByIndex(t,e,n){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{b(s,t,u=>i.error(u));let d=v(s,k(S.readonly,t,i.error)).objectStore(t).index(e).count(n);d.onerror=u=>i.error(u),d.onsuccess=u=>{i.next(u.target.result),i.complete()}}).catch(s=>i.error(s))})}deleteObjectStore(t){return pn(this.dbConfig.name,++this.dbConfig.version,t)}}return r.\u0275fac=function(t){return new(t||r)(h(dt),h(W))},r.\u0275prov=A({token:r,factory:r.\u0275fac}),r})(),pi=(()=>{class r{static forRoot(t){return{ngModule:r,providers:[ye,{provide:dt,useValue:t}]}}}return r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=F({type:r}),r.\u0275inj=N({imports:[[Be]]}),r})();var ht=(()=>{let o=class o{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let i=this.getKey(n);return this.db.add(this.DATABASE,e,i).pipe(I(s=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case ue.Lazada:n="Lazada";break;case ue.Tokopedia:n="Tokopedia";break}return n}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}};o.\u0275fac=function(n){return new(n||o)(h(ye))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var pt=(()=>{let o=class o{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let n={Enabled:!0};e&&(n=ie(ie({},n),e)),localStorage.setItem("Intercom",JSON.stringify(n))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return z.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var ft=(()=>{let o=class o{};o.SubmitConfig="/api/Channel/SubmitConfig",o.PosAccountTest="/api/POSAccount/Test",o.PosAccountRemove="/api/POSAccount/Remove",o.PosAccountGetConfig="/api/ChannelLoader/GetConfig",o.ChannelGetLastSyncByID="/api/Channel/GetLastSyncByID",o.GetChannel="/api/Channel/GetChannel",o.GetChannelLoader="/api/ChannelLoader/GetChannelLoader",o.TestShopID="/api/Channel/TestShopID",o.UpdateChannelIndex="/api/Channel/UpdateChannelIndex",o.DeleteChannel="/api/Channel/DeleteChannel",o.GetRegisterByOutletName="/api/Channel/GetRegistersByOutletOrder",o.GetChannelRowCount="/api/Channel/GetCountChannel",o.GetChannelWarehouse="/api/Channel/GetChannelWarehouseLocation",o.UnSynchronizedWarehouse="/api/Channel/UnSynchronizedWarehouse",o.GetChannelDetail="/api/ChannelLoader/GetChannelView",o.GetOrderPreview="/api/Orders/Preview",o.GetOrderPreviewV2="/api/Orders/PreviewV2",o.GetDownloadOrder="/api/Orders/Download",o.GetDownloadOrderV2="/api/Orders/DownloadV2",o.ShopeeV2_URL="/api/ChannelAuthorization/ShopeeV2_URL",o.Tiktok_URL="/api/ChannelAuthorization/Tiktok_URL",o.Lazada_URL="/api/ChannelAuthorization/Lazada_URL",o.AddTokopedia="/api/ChannelAdd/Tokopedia",o.AddShopify="/api/ChannelAdd/AddShopify",o.AddWoocommerce="/api/ChannelAdd/AddWooCommerce",o.AddPlugo="/api/ChannelAdd/Plugo",o.UploadPlugoProduct="/api/product/plugo/AddProduct";let r=o;return r})();var gt=(()=>{let o=class o{constructor(){this.httpService=_e(Y)}update(e){if(e)this.updateLocalStorage(e);else{let n={RowCount:500,PageNumber:1};this.httpService.post(ft.GetChannel,n).pipe(I(i=>i?.Data)).subscribe(i=>{this.updateLocalStorage(i)})}}getChannels(){let e=localStorage.getItem("channels");return e?JSON.parse(e):[]}updateLocalStorage(e){let n=this.mappingChannelLocalStorage(e);localStorage.setItem("channels",JSON.stringify(n))}mappingChannelLocalStorage(e){return e.map(i=>({ID:i.ID,Name:i.Name,TypeID:i.TypeID,Img:z.getChannelLogoByTypeId(i.TypeID)}))}clearLocalStorage(){localStorage.removeItem("channels")}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var ji=(()=>{let o=class o{constructor(e,n,i,s,a,c,l,d){this.httpService=e,this.tokenDecodeService=n,this.afAuth=i,this.ngxPermission=s,this.localDataService=a,this.router=c,this.intercomService=l,this.updateChannelStorageService=d}login(e){return this.httpService.post("/api/token/Login",e).pipe(G(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(Ve.news).pipe(I(e=>e?.items?.map(n=>n?.properties)))}loginWithGoogle(e,n){e.preventDefault();let i=new fe;return i.setCustomParameters({prompt:"select_account"}),R(this.afAuth.signInWithPopup(i)).pipe(I(s=>s.credential),I(s=>s.idToken),x(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:n}))),G(s=>{this.setLocalStorage(s,n,null),this.loadPermissions()}))}setLocalStorage(e,n,i){localStorage.setItem("user",JSON.stringify(e)),localStorage.setItem("Authorization",JSON.stringify({Host:n,username:i})),this.updateChannelStorageService.update(e.Channels),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem("user");if(z.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}getChannels(){return this.updateChannelStorageService.getChannels()}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=JSON.parse(window.localStorage.getItem("user")),n=new Date;if(e!=null){let i=new Date(e.Token.expiredAt);return n<i?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem("Authorization");this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,localStorage.removeItem("user"),this.updateChannelStorageService.clearLocalStorage(),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}};o.\u0275fac=function(n){return new(n||o)(h(Y),h(Je),h(Ie),h(Ge),h(ht),h(Fe),h(pt),h(gt))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();export{Ve as a,Je as b,Ko as c,ii as d,pi as e,ht as f,ft as g,gt as h,ji as i};
@@ -1 +1 @@
1
- import"./chunk-GCMMLBGS.js";import{a as Ue}from"./chunk-44YUSAMN.js";import{a as X}from"./chunk-XHAXYWZ7.js";import{a as Ae,b as We,c as te}from"./chunk-RDHVV7FZ.js";import{a as xe}from"./chunk-BVIRHZTZ.js";import{a as $e}from"./chunk-2UKRBTWA.js";import{a as Ne}from"./chunk-7KG3DC5J.js";import{b as Re}from"./chunk-DR4IU4JY.js";import{a as Le}from"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as ke}from"./chunk-YIB7FZAQ.js";import"./chunk-ADRVUMMW.js";import{a as De,b as Oe,c as Ve}from"./chunk-UMNGKENU.js";import{a as Be}from"./chunk-3QG5QJ5P.js";import"./chunk-HCDKYABV.js";import{a as ye,b as Ie,d as we,e as Fe}from"./chunk-CCXKODFV.js";import{i as K}from"./chunk-EMO3QL6Q.js";import{b as Pe,e as be}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Me,m as Ee,n as Te}from"./chunk-BO4PPSB5.js";import{t as H,u as J}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{a as Ce,b as fe,h as k,m as B,y as L}from"./chunk-BSN7ZAXG.js";import{c as G,e as Se,f as ve}from"./chunk-6SF7AUOH.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as he,Cd as N,Da as C,Ea as f,Eb as u,G as Z,Gb as s,Gc as y,Hc as T,Ic as de,Jb as ce,Jc as ee,Ma as Y,Nb as W,Ob as R,Pa as re,Qb as $,Rb as U,Sb as r,Tb as l,Ub as P,Vb as I,Wb as w,Yb as b,Z as q,bc as m,ea as ae,ec as se,gb as S,jb as c,kb as v,mc as Q,nc as p,oc as me,pa as A,pc as x,rc as F,sc as M,sd as _e,ta as D,tc as E,uc as j,ud as z,v as oe,vc as O,vd as ue,xb as le,xc as V,yc as pe,yd as ge}from"./chunk-PQDPS2ID.js";import{a as ne,b as ie}from"./chunk-GNOSNGXM.js";var qe=(n,a)=>({color:n,"font-weight":a});function Ye(n,a){if(n&1&&(r(0,"mat-radio-button",2),p(1),l()),n&2){let i=a.$implicit,o=a.index,e=m();ce(pe(7,qe,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),c(),x("",i.Value," ")}}var Ge=(()=>{let a=class a{constructor(){this.disabled=!1,this.modelChange=new re,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[O],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,t){e&1&&(r(0,"mat-radio-group",0),g("ngModelChange",function(_){return t.change(_)}),u(1,Ye,2,10,"mat-radio-button",1),l()),e&2&&(s("disabled",t.disabled)("ngModel",t.model),c(),s("ngForOf",t.options))},dependencies:[N,z,Ve,De,Oe,L,k,B,J,H],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let n=a;return n})();function Qe(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l()),n&2){let i=a.item;c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," ")}}function et(n,a){if(n&1){let i=b();r(0,"span",6),g("click",function(){C(i);let e=m(),t=e.item,d=e.clear;return f(d(t))}),p(1,"x"),l()}}function tt(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l(),u(4,et,2,0,"span",5)),n&2){let i=a.item,o=m();c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," "),c(),W(o.clearable()?4:-1)}}var Ke=(()=>{let a=class a{constructor(){this.authService=A(K),this.multiple=Y(!1),this.clearable=Y(!0),this.options=this.authService.getChannels(),this.onChange=o=>{}}onChannelChange(o){this.onChange(o)}writeValue(o){this.selectedChannels=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},standalone:!0,features:[j([{provide:Ce,multi:!0,useExisting:a}]),O],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(e,t){e&1&&(r(0,"ng-select",0),E("ngModelChange",function(_){return M(t.selectedChannels,_)||(t.selectedChannels=_),_}),g("ngModelChange",function(_){return t.onChannelChange(_)}),u(1,Qe,4,2,"ng-template",1)(2,tt,5,3,"ng-template",2),l()),e&2&&(s("clearable",t.clearable())("items",t.options),F("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[N,Fe,we,ye,Ie,L,k,B]});let n=a;return n})();var He=n=>[n],nt=n=>({"text-decoration-line-through":n}),it=n=>({"border-bottom":n}),ot=n=>({"bg-gradient-warning":n});function at(n,a){if(n&1){let i=b();I(0),r(1,"div")(2,"label",21),p(3,"Channel"),l(),r(4,"channel-select-options",22),E("ngModelChange",function(e){C(i);let t=m();return M(t.searchFilter.ListChannelID,e)||(t.searchFilter.ListChannelID=e),f(e)}),l()(),r(5,"div",23)(6,"label",24),p(7,"Filter by"),l(),r(8,"lib-radio-options",25),E("modelChange",function(e){C(i);let t=m();return M(t.searchFilter.filterModel,e)||(t.searchFilter.filterModel=e),f(e)}),l()(),w()}if(n&2){let i=m();c(4),s("multiple",!0),F("ngModel",i.searchFilter.ListChannelID),c(4),F("model",i.searchFilter.filterModel),s("options",i.filterTypeOptions)}}function rt(n,a){if(n&1){let i=b();r(0,"button",27),g("click",function(){C(i);let e=m().ngIf,t=m();return f(t.onUpdateItems(e))}),P(1,"i",28),p(2," Update "),l()}}function lt(n,a){if(n&1&&(I(0),r(1,"div",4),u(2,rt,3,0,"button",26),l(),w()),n&2){let i=a.ngIf,o=m();c(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function ct(n,a){if(n&1&&(r(0,"th",15)(1,"div",29),P(2,"img",30),r(3,"div",31),p(4),y(5,"stringLimit"),l()()()),n&2){let i=a.$implicit;c(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),c(),s("src",i==null?null:i.Img,S),c(2),x(" ",de(5,3,i.Name,20)," ")}}function st(n,a){if(n&1){let i=b();r(0,"th")(1,"input",32),E("ngModelChange",function(e){C(i);let t=m();return M(t.checkboxState,e)||(t.checkboxState=e),f(e)}),g("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),l()()}if(n&2){let i=m();c(),F("ngModel",i.checkboxState)}}function mt(n,a){n&1&&(r(0,"th",33)(1,"span"),p(2,"Expected"),l(),r(3,"span",34),p(4,"(POS)"),l()(),r(5,"th",33),p(6,"Channel"),l())}function pt(n,a){if(n&1){let i=b();r(0,"img",47),g("click",function(e){C(i);let t=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,t==null?null:t.ImageUrl))}),l()}if(n&2){let i=m(3).$implicit;se("src",i==null?null:i.ImageUrl,S)}}function dt(n,a){n&1&&P(0,"img",48)}function _t(n,a){if(n&1&&(r(0,"small",46),p(1),l()),n&2){let i=m(3).$implicit;c(),x("(",i==null?null:i.Category,")")}}function ut(n,a){if(n&1&&(I(0),r(1,"td",42),u(2,pt,1,1,"img",43)(3,dt,1,0,"ng-template",null,0,ee),l(),r(5,"td",44)(6,"h5",45),p(7),l(),u(8,_t,2,1,"small",46),l(),w()),n&2){let i=Q(4),o=m().$index,e=m().$implicit,t=m().ngIf;c(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",V(7,it,o+1==t.length)),c(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),c(3),s("rowSpan",e==null?null:e.Variants.length),c(2),me(e==null?null:e.Name),c(),W(e!=null&&e.Category?8:-1)}}function gt(n,a){if(n&1){let i=b();r(0,"td",49)(1,"input",32),E("ngModelChange",function(e){C(i);let t=m().$implicit;return M(t.selected,e)||(t.selected=e),f(e)}),l()()}if(n&2){let i=m().$implicit;c(),F("ngModel",i.selected)}}function ht(n,a){if(n&1){let i=b();I(0),r(1,"td",51),p(2),y(3,"number"),l(),r(4,"td",52),g("click",function(){let e=C(i).$implicit,t=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(t,d,e))}),r(5,"div",53)(6,"div",54),p(7),y(8,"number"),l(),r(9,"a",55),g("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),P(10,"i",40),l()()(),w()}if(n&2){let i=a.$implicit;c(2),x(" ",T(3,4,i.PriceExpected)," "),c(2),s("ngClass",V(8,ot,i.Price!=i.PriceExpected)),c(3),x(" ",T(8,6,i.Price)," "),c(2),s("href",i.Url,S)}}function Ct(n,a){n&1&&(r(0,"td",56),p(1," X "),l(),r(2,"td",56),p(3," X "),l())}function ft(n,a){if(n&1&&(I(0),u(1,ht,11,10,"ng-container",50)(2,Ct,4,0,"ng-template",null,1,ee),w()),n&2){let i=a.$implicit,o=Q(3),e=m().$implicit,t=m(3);c(),s("ngIf",t.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function xt(n,a){if(n&1&&(r(0,"tr"),u(1,ut,9,9,"ng-container",3),r(2,"td",35),p(3),l(),r(4,"td",36)(5,"div",37)(6,"div",38),p(7),l(),r(8,"div",31)(9,"a",39),P(10,"i",40),l()()()(),u(11,gt,2,1,"ng-template",19)(12,ft,4,2,"ng-container",41),l()),n&2){let i=a.$implicit,o=a.$index,e=m(3);c(),s("ngIf",o==0),c(2),x(" ",i==null?null:i.Model," "),c(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),c(2),s("ngClass",V(8,nt,i.Discontinued)),c(),x(" ",i==null?null:i.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),S),c(2),s("ngxPermissionsOnly",V(10,He,e.rolePriceEdit)),c(),s("ngForOf",e.channels())}}function Pt(n,a){if(n&1&&(r(0,"tbody"),$(1,xt,13,12,"tr",null,R),l()),n&2){let i=a.$implicit;c(),U(i.Variants)}}function bt(n,a){if(n&1&&(I(0),$(1,Pt,3,0,"tbody",null,R),w()),n&2){let i=a.ngIf;c(),U(i)}}var xn=(()=>{let a=class a{constructor(o,e,t,d,_,h,Je){this.http=o,this.toastr=e,this.dialog=t,this.productService=d,this.authService=_,this.biggerPictureService=h,this.paginationService=Je,this.infinitePagination=A(te),this.searchFilter=new Ne,this.checkboxState=!1,this.rolePriceEdit=xe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=le([]),this.filterTypeOptions=[{Key:X.ALL,Value:"All"},{Key:X.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let o=this.searchFilter.ListChannelID,e=[];G.IsEmpty(o)||o?.length==0?e=this.channelOptions:e=this.channelOptions.filter(t=>o.findIndex(d=>d==t.ID)>-1),this.channels.update(()=>e)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ae(o=>{this.searchFilter=o.Filter,this.searchFilter.filterModel=X.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),q(1))}onSelectAllData(){this.data$=this.data$.pipe(oe(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e=ie(ne({},this.searchFilter),{text:o,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let t=e.map(h=>h.ID),_={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(t=>t.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Ue,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(Z(t=>G.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(o)})}openTableDialog(o,e,t){let d=JSON.parse(JSON.stringify(o));this.dialog.open(Ae,{data:{Name:e.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(Z(h=>G.IsNotEmpty(h))).subscribe(h=>{this.updateProductPrice(h,t)})}updateProductPrice(o,e){let t={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(d=>{e.Price=t.Price;let _=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Re,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};a.\u0275fac=function(e){return new(e||a)(v(be),v(Pe),v(Me),v(ke),v(K),v(Be),v($e))},a.\u0275cmp=D({type:a,selectors:[["app-custom-channel-price"]],standalone:!0,features:[j([te]),O],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["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"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,t){e&1&&(r(0,"mainpanel",2),g("onSubmit",function(_){return t.onFilter(_)}),r(1,"filters"),u(2,at,9,4,"ng-container",3),y(3,"async"),l(),r(4,"actions")(5,"div",4),u(6,lt,3,1,"ng-container",3),y(7,"async"),r(8,"button",5),g("click",function(){return t.openExportDialog()}),P(9,"i",6),r(10,"span"),p(11,"Export"),l()()()(),r(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),$(21,ct,6,6,"th",15,R),l(),r(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),l()(),r(27,"th",17),p(28,"Variant"),l(),r(29,"th",18),p(30,"SKU"),l(),u(31,st,2,1,"ng-template",19),$(32,mt,7,0,null,null,R),l()(),u(34,bt,3,0,"ng-container",3),y(35,"async"),l(),r(36,"infinite-paginator",20),y(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),l()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),c(2),s("ngIf",T(3,13,t.loader$)),c(4),s("ngIf",T(7,15,t.data$)),c(15),U(t.channels()),c(10),s("ngxPermissionsOnly",V(21,He,t.rolePriceEdit)),c(),U(t.channels()),c(2),s("ngIf",T(35,17,t.data$)),c(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",T(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[N,_e,z,ue,ge,he,Te,Ee,L,fe,k,B,We,Ge,J,H,Le,ve,Se,Ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let n=a;return n})();export{xn as CustomChannelPriceComponent};
1
+ import"./chunk-TZ24K7DJ.js";import{a as Ue}from"./chunk-7LZ5ZSXM.js";import{a as X}from"./chunk-XHAXYWZ7.js";import{a as Ae,b as We,c as te}from"./chunk-B5PFUQJP.js";import{a as xe}from"./chunk-BVIRHZTZ.js";import{a as $e}from"./chunk-6UBPPQKL.js";import{a as Ne}from"./chunk-7KG3DC5J.js";import{b as Re}from"./chunk-AMSVLO4N.js";import{a as Le}from"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as ke}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as De,b as Oe,c as Ve}from"./chunk-UMNGKENU.js";import{a as Be}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as ye,b as Ie,d as we,e as Fe}from"./chunk-CCXKODFV.js";import{i as K}from"./chunk-4HCEWP6Y.js";import{b as Pe,e as be}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Me,m as Ee,n as Te}from"./chunk-BO4PPSB5.js";import{t as H,u as J}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{a as Ce,b as fe,h as k,m as B,y as L}from"./chunk-BSN7ZAXG.js";import{c as G,e as Se,f as ve}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as he,Cd as N,Da as C,Ea as f,Eb as u,G as Z,Gb as s,Gc as y,Hc as T,Ic as de,Jb as ce,Jc as ee,Ma as Y,Nb as W,Ob as R,Pa as re,Qb as $,Rb as U,Sb as r,Tb as l,Ub as P,Vb as I,Wb as w,Yb as b,Z as q,bc as m,ea as ae,ec as se,gb as S,jb as c,kb as v,mc as Q,nc as p,oc as me,pa as A,pc as x,rc as F,sc as M,sd as _e,ta as D,tc as E,uc as j,ud as z,v as oe,vc as O,vd as ue,xb as le,xc as V,yc as pe,yd as ge}from"./chunk-PQDPS2ID.js";import{a as ne,b as ie}from"./chunk-GNOSNGXM.js";var qe=(n,a)=>({color:n,"font-weight":a});function Ye(n,a){if(n&1&&(r(0,"mat-radio-button",2),p(1),l()),n&2){let i=a.$implicit,o=a.index,e=m();ce(pe(7,qe,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),c(),x("",i.Value," ")}}var Ge=(()=>{let a=class a{constructor(){this.disabled=!1,this.modelChange=new re,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[O],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,t){e&1&&(r(0,"mat-radio-group",0),g("ngModelChange",function(_){return t.change(_)}),u(1,Ye,2,10,"mat-radio-button",1),l()),e&2&&(s("disabled",t.disabled)("ngModel",t.model),c(),s("ngForOf",t.options))},dependencies:[N,z,Ve,De,Oe,L,k,B,J,H],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let n=a;return n})();function Qe(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l()),n&2){let i=a.item;c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," ")}}function et(n,a){if(n&1){let i=b();r(0,"span",6),g("click",function(){C(i);let e=m(),t=e.item,d=e.clear;return f(d(t))}),p(1,"x"),l()}}function tt(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l(),u(4,et,2,0,"span",5)),n&2){let i=a.item,o=m();c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," "),c(),W(o.clearable()?4:-1)}}var Ke=(()=>{let a=class a{constructor(){this.authService=A(K),this.multiple=Y(!1),this.clearable=Y(!0),this.options=this.authService.getChannels(),this.onChange=o=>{}}onChannelChange(o){this.onChange(o)}writeValue(o){this.selectedChannels=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},standalone:!0,features:[j([{provide:Ce,multi:!0,useExisting:a}]),O],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(e,t){e&1&&(r(0,"ng-select",0),E("ngModelChange",function(_){return M(t.selectedChannels,_)||(t.selectedChannels=_),_}),g("ngModelChange",function(_){return t.onChannelChange(_)}),u(1,Qe,4,2,"ng-template",1)(2,tt,5,3,"ng-template",2),l()),e&2&&(s("clearable",t.clearable())("items",t.options),F("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[N,Fe,we,ye,Ie,L,k,B]});let n=a;return n})();var He=n=>[n],nt=n=>({"text-decoration-line-through":n}),it=n=>({"border-bottom":n}),ot=n=>({"bg-gradient-warning":n});function at(n,a){if(n&1){let i=b();I(0),r(1,"div")(2,"label",21),p(3,"Channel"),l(),r(4,"channel-select-options",22),E("ngModelChange",function(e){C(i);let t=m();return M(t.searchFilter.ListChannelID,e)||(t.searchFilter.ListChannelID=e),f(e)}),l()(),r(5,"div",23)(6,"label",24),p(7,"Filter by"),l(),r(8,"lib-radio-options",25),E("modelChange",function(e){C(i);let t=m();return M(t.searchFilter.filterModel,e)||(t.searchFilter.filterModel=e),f(e)}),l()(),w()}if(n&2){let i=m();c(4),s("multiple",!0),F("ngModel",i.searchFilter.ListChannelID),c(4),F("model",i.searchFilter.filterModel),s("options",i.filterTypeOptions)}}function rt(n,a){if(n&1){let i=b();r(0,"button",27),g("click",function(){C(i);let e=m().ngIf,t=m();return f(t.onUpdateItems(e))}),P(1,"i",28),p(2," Update "),l()}}function lt(n,a){if(n&1&&(I(0),r(1,"div",4),u(2,rt,3,0,"button",26),l(),w()),n&2){let i=a.ngIf,o=m();c(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function ct(n,a){if(n&1&&(r(0,"th",15)(1,"div",29),P(2,"img",30),r(3,"div",31),p(4),y(5,"stringLimit"),l()()()),n&2){let i=a.$implicit;c(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),c(),s("src",i==null?null:i.Img,S),c(2),x(" ",de(5,3,i.Name,20)," ")}}function st(n,a){if(n&1){let i=b();r(0,"th")(1,"input",32),E("ngModelChange",function(e){C(i);let t=m();return M(t.checkboxState,e)||(t.checkboxState=e),f(e)}),g("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),l()()}if(n&2){let i=m();c(),F("ngModel",i.checkboxState)}}function mt(n,a){n&1&&(r(0,"th",33)(1,"span"),p(2,"Expected"),l(),r(3,"span",34),p(4,"(POS)"),l()(),r(5,"th",33),p(6,"Channel"),l())}function pt(n,a){if(n&1){let i=b();r(0,"img",47),g("click",function(e){C(i);let t=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,t==null?null:t.ImageUrl))}),l()}if(n&2){let i=m(3).$implicit;se("src",i==null?null:i.ImageUrl,S)}}function dt(n,a){n&1&&P(0,"img",48)}function _t(n,a){if(n&1&&(r(0,"small",46),p(1),l()),n&2){let i=m(3).$implicit;c(),x("(",i==null?null:i.Category,")")}}function ut(n,a){if(n&1&&(I(0),r(1,"td",42),u(2,pt,1,1,"img",43)(3,dt,1,0,"ng-template",null,0,ee),l(),r(5,"td",44)(6,"h5",45),p(7),l(),u(8,_t,2,1,"small",46),l(),w()),n&2){let i=Q(4),o=m().$index,e=m().$implicit,t=m().ngIf;c(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",V(7,it,o+1==t.length)),c(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),c(3),s("rowSpan",e==null?null:e.Variants.length),c(2),me(e==null?null:e.Name),c(),W(e!=null&&e.Category?8:-1)}}function gt(n,a){if(n&1){let i=b();r(0,"td",49)(1,"input",32),E("ngModelChange",function(e){C(i);let t=m().$implicit;return M(t.selected,e)||(t.selected=e),f(e)}),l()()}if(n&2){let i=m().$implicit;c(),F("ngModel",i.selected)}}function ht(n,a){if(n&1){let i=b();I(0),r(1,"td",51),p(2),y(3,"number"),l(),r(4,"td",52),g("click",function(){let e=C(i).$implicit,t=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(t,d,e))}),r(5,"div",53)(6,"div",54),p(7),y(8,"number"),l(),r(9,"a",55),g("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),P(10,"i",40),l()()(),w()}if(n&2){let i=a.$implicit;c(2),x(" ",T(3,4,i.PriceExpected)," "),c(2),s("ngClass",V(8,ot,i.Price!=i.PriceExpected)),c(3),x(" ",T(8,6,i.Price)," "),c(2),s("href",i.Url,S)}}function Ct(n,a){n&1&&(r(0,"td",56),p(1," X "),l(),r(2,"td",56),p(3," X "),l())}function ft(n,a){if(n&1&&(I(0),u(1,ht,11,10,"ng-container",50)(2,Ct,4,0,"ng-template",null,1,ee),w()),n&2){let i=a.$implicit,o=Q(3),e=m().$implicit,t=m(3);c(),s("ngIf",t.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function xt(n,a){if(n&1&&(r(0,"tr"),u(1,ut,9,9,"ng-container",3),r(2,"td",35),p(3),l(),r(4,"td",36)(5,"div",37)(6,"div",38),p(7),l(),r(8,"div",31)(9,"a",39),P(10,"i",40),l()()()(),u(11,gt,2,1,"ng-template",19)(12,ft,4,2,"ng-container",41),l()),n&2){let i=a.$implicit,o=a.$index,e=m(3);c(),s("ngIf",o==0),c(2),x(" ",i==null?null:i.Model," "),c(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),c(2),s("ngClass",V(8,nt,i.Discontinued)),c(),x(" ",i==null?null:i.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),S),c(2),s("ngxPermissionsOnly",V(10,He,e.rolePriceEdit)),c(),s("ngForOf",e.channels())}}function Pt(n,a){if(n&1&&(r(0,"tbody"),$(1,xt,13,12,"tr",null,R),l()),n&2){let i=a.$implicit;c(),U(i.Variants)}}function bt(n,a){if(n&1&&(I(0),$(1,Pt,3,0,"tbody",null,R),w()),n&2){let i=a.ngIf;c(),U(i)}}var xn=(()=>{let a=class a{constructor(o,e,t,d,_,h,Je){this.http=o,this.toastr=e,this.dialog=t,this.productService=d,this.authService=_,this.biggerPictureService=h,this.paginationService=Je,this.infinitePagination=A(te),this.searchFilter=new Ne,this.checkboxState=!1,this.rolePriceEdit=xe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=le([]),this.filterTypeOptions=[{Key:X.ALL,Value:"All"},{Key:X.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let o=this.searchFilter.ListChannelID,e=[];G.IsEmpty(o)||o?.length==0?e=this.channelOptions:e=this.channelOptions.filter(t=>o.findIndex(d=>d==t.ID)>-1),this.channels.update(()=>e)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ae(o=>{this.searchFilter=o.Filter,this.searchFilter.filterModel=X.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),q(1))}onSelectAllData(){this.data$=this.data$.pipe(oe(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e=ie(ne({},this.searchFilter),{text:o,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let t=e.map(h=>h.ID),_={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(t=>t.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Ue,{data:{title:"Updating Price",selectedItems:e,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(Z(t=>G.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(o)})}openTableDialog(o,e,t){let d=JSON.parse(JSON.stringify(o));this.dialog.open(Ae,{data:{Name:e.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(Z(h=>G.IsNotEmpty(h))).subscribe(h=>{this.updateProductPrice(h,t)})}updateProductPrice(o,e){let t={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(d=>{e.Price=t.Price;let _=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Re,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};a.\u0275fac=function(e){return new(e||a)(v(be),v(Pe),v(Me),v(ke),v(K),v(Be),v($e))},a.\u0275cmp=D({type:a,selectors:[["app-custom-channel-price"]],standalone:!0,features:[j([te]),O],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["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"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,t){e&1&&(r(0,"mainpanel",2),g("onSubmit",function(_){return t.onFilter(_)}),r(1,"filters"),u(2,at,9,4,"ng-container",3),y(3,"async"),l(),r(4,"actions")(5,"div",4),u(6,lt,3,1,"ng-container",3),y(7,"async"),r(8,"button",5),g("click",function(){return t.openExportDialog()}),P(9,"i",6),r(10,"span"),p(11,"Export"),l()()()(),r(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),$(21,ct,6,6,"th",15,R),l(),r(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),l()(),r(27,"th",17),p(28,"Variant"),l(),r(29,"th",18),p(30,"SKU"),l(),u(31,st,2,1,"ng-template",19),$(32,mt,7,0,null,null,R),l()(),u(34,bt,3,0,"ng-container",3),y(35,"async"),l(),r(36,"infinite-paginator",20),y(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),l()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),c(2),s("ngIf",T(3,13,t.loader$)),c(4),s("ngIf",T(7,15,t.data$)),c(15),U(t.channels()),c(10),s("ngxPermissionsOnly",V(21,He,t.rolePriceEdit)),c(),U(t.channels()),c(2),s("ngIf",T(35,17,t.data$)),c(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",T(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[N,_e,z,ue,ge,he,Te,Ee,L,fe,k,B,We,Ge,J,H,Le,ve,Se,Ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let n=a;return n})();export{xn as CustomChannelPriceComponent};
@@ -1 +1 @@
1
- import{a as Z}from"./chunk-GCMMLBGS.js";import{a as Y}from"./chunk-44YUSAMN.js";import{b as ee,c as V}from"./chunk-RDHVV7FZ.js";import"./chunk-BVIRHZTZ.js";import{b as X}from"./chunk-DR4IU4JY.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as Q}from"./chunk-YIB7FZAQ.js";import"./chunk-ADRVUMMW.js";import"./chunk-3QG5QJ5P.js";import"./chunk-HCDKYABV.js";import{i as q}from"./chunk-EMO3QL6Q.js";import{b as $,e as H}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as z,m as J,n as K}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as U,h as j,m as k,o as G,y as W}from"./chunk-BSN7ZAXG.js";import"./chunk-6SF7AUOH.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as I,Cd as O,Da as s,Ea as l,Eb as w,G as F,Gb as P,Gc as C,Hc as x,Sb as a,Tb as m,Ub as b,Yb as S,Z as T,bc as o,ea as M,jb as u,kb as h,nc as f,pa as N,rc as v,sc as y,ta as E,tc as D,uc as R,vc as L,vd as A,yd as B}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";function te(r,c){if(r&1){let i=S();a(0,"button",15),g("click",function(){s(i);let e=o().ngIf,n=o(2);return l(n.onUpdateItems(e))}),b(1,"i",16),f(2," Update "),m()}}function ie(r,c){if(r&1&&(a(0,"div"),w(1,te,3,0,"button",14),m()),r&2){let i=c.ngIf,t=o(2);u(),P("ngIf",t.productService.hasSelectionVariant(i))}}function ne(r,c){if(r&1){let i=S();a(0,"mainpanel",1),g("onSubmit",function(e){s(i);let n=o();return l(n.onSearch(e))}),a(1,"actions")(2,"div",2),w(3,ie,2,1,"div",3),C(4,"async"),a(5,"button",4),g("click",function(){s(i);let e=o();return l(e.openExportDialog())}),b(6,"i",5),a(7,"span"),f(8,"Export"),m()()()(),a(9,"filters")(10,"div")(11,"label",6),f(12,"Page Number"),m(),a(13,"input",7),D("ngModelChange",function(e){s(i);let n=o();return y(n.searchFilter.PageNumber,e)||(n.searchFilter.PageNumber=e),l(e)}),m()(),a(14,"div",8)(15,"label",6),f(16,"Page Size"),m(),a(17,"input",7),D("ngModelChange",function(e){s(i);let n=o();return y(n.searchFilter.RowCount,e)||(n.searchFilter.RowCount=e),l(e)}),m()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),C(23,"async"),g("onToggle",function(e){s(i);let n=o();return l(n.onShowDifferencePrice(e))})("onSubmit",function(e){s(i);let n=o();return l(n.updatePriceByVariant(e))}),m(),a(24,"infinite-paginator",13),C(25,"async"),g("onNextPage",function(){s(i);let e=o();return l(e.infinitePagination.onNextPage(e.searchFilter))})("onLastPage",function(){s(i);let e=o();return l(e.infinitePagination.onLastPage(e.searchFilter))})("onGetRowCount",function(){s(i);let e=o();return l(e.infinitePagination.getRowCount(e.searchFilter))}),m()()()()()()}if(r&2){let i=o();P("textButton","Search"),u(3),P("ngIf",x(4,14,i.data$)),u(10),v("ngModel",i.searchFilter.PageNumber),u(4),v("ngModel",i.searchFilter.RowCount),u(5),P("showProductToggle",!0)("data",x(23,16,i.data$))("channel",i.channelOptions)("hiddenIPOSInventory",!1),u(2),P("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(25,18,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var ve=(()=>{let c=class c{constructor(t,e,n,_,d,p){this.http=t,this.toastr=e,this.dialog=n,this.productService=_,this.authService=d,this.decimalPipe=p,this.infinitePagination=N(V),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),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(M(t=>{t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1},this.searchFilter=t.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(t){this.searchFilter.filterModel=1,t&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(t){this.searchFilter.text=t,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(t){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let _=e.map(p=>({ID:p.ID,Code:p.Code,Price:p.UnitPrice}));var n=this.channelOptions.filter(p=>p.selected).map(p=>p.ID);let d={ListChannelID:n,ListPrice:_};this.http.post("/api/Price/UpdateChannel",d).subscribe(p=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+d.ListPrice.length+" items in "+d.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(t){let e={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post("/api/Price/UpdatePriceByID",e).subscribe(n=>{let _=this.productService.findChannelById(e.ID,this.channelOptions),d=e.Price?this.decimalPipe.transform(e.Price):e.Price;this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") price in "+_.Name+" to "+d,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(t){let e=this.productService.selectedVariantProduct(t);this.dialog.open(Y,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(F(n=>n!==void 0)).subscribe(n=>{this.channelOptions=n,this.updatePrice(t)})}openExportDialog(){this.dialog.open(X,{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()}};c.\u0275fac=function(e){return new(e||c)(h(H),h($),h(z),h(Q),h(q),h(I))},c.\u0275cmp=E({type:c,selectors:[["app-price-pos-channel"]],standalone:!0,features:[R([V,I]),L],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","hiddenIPOSInventory"],[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(e,n){e&1&&(w(0,ne,26,20,"mainpanel",0),C(1,"async")),e&2&&P("ngIf",x(1,1,n.loader$))},dependencies:[O,A,B,W,U,G,j,k,ee,K,J,Z],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let r=c;return r})();export{ve as PricePosChannelComponent};
1
+ import{a as Z}from"./chunk-TZ24K7DJ.js";import{a as Y}from"./chunk-7LZ5ZSXM.js";import{b as ee,c as V}from"./chunk-B5PFUQJP.js";import"./chunk-BVIRHZTZ.js";import{b as X}from"./chunk-AMSVLO4N.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as Q}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{i as q}from"./chunk-4HCEWP6Y.js";import{b as $,e as H}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as z,m as J,n as K}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as U,h as j,m as k,o as G,y as W}from"./chunk-BSN7ZAXG.js";import"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as I,Cd as O,Da as s,Ea as l,Eb as w,G as F,Gb as P,Gc as C,Hc as x,Sb as a,Tb as m,Ub as b,Yb as S,Z as T,bc as o,ea as M,jb as u,kb as h,nc as f,pa as N,rc as v,sc as y,ta as E,tc as D,uc as R,vc as L,vd as A,yd as B}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";function te(r,c){if(r&1){let i=S();a(0,"button",15),g("click",function(){s(i);let e=o().ngIf,n=o(2);return l(n.onUpdateItems(e))}),b(1,"i",16),f(2," Update "),m()}}function ie(r,c){if(r&1&&(a(0,"div"),w(1,te,3,0,"button",14),m()),r&2){let i=c.ngIf,t=o(2);u(),P("ngIf",t.productService.hasSelectionVariant(i))}}function ne(r,c){if(r&1){let i=S();a(0,"mainpanel",1),g("onSubmit",function(e){s(i);let n=o();return l(n.onSearch(e))}),a(1,"actions")(2,"div",2),w(3,ie,2,1,"div",3),C(4,"async"),a(5,"button",4),g("click",function(){s(i);let e=o();return l(e.openExportDialog())}),b(6,"i",5),a(7,"span"),f(8,"Export"),m()()()(),a(9,"filters")(10,"div")(11,"label",6),f(12,"Page Number"),m(),a(13,"input",7),D("ngModelChange",function(e){s(i);let n=o();return y(n.searchFilter.PageNumber,e)||(n.searchFilter.PageNumber=e),l(e)}),m()(),a(14,"div",8)(15,"label",6),f(16,"Page Size"),m(),a(17,"input",7),D("ngModelChange",function(e){s(i);let n=o();return y(n.searchFilter.RowCount,e)||(n.searchFilter.RowCount=e),l(e)}),m()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),C(23,"async"),g("onToggle",function(e){s(i);let n=o();return l(n.onShowDifferencePrice(e))})("onSubmit",function(e){s(i);let n=o();return l(n.updatePriceByVariant(e))}),m(),a(24,"infinite-paginator",13),C(25,"async"),g("onNextPage",function(){s(i);let e=o();return l(e.infinitePagination.onNextPage(e.searchFilter))})("onLastPage",function(){s(i);let e=o();return l(e.infinitePagination.onLastPage(e.searchFilter))})("onGetRowCount",function(){s(i);let e=o();return l(e.infinitePagination.getRowCount(e.searchFilter))}),m()()()()()()}if(r&2){let i=o();P("textButton","Search"),u(3),P("ngIf",x(4,14,i.data$)),u(10),v("ngModel",i.searchFilter.PageNumber),u(4),v("ngModel",i.searchFilter.RowCount),u(5),P("showProductToggle",!0)("data",x(23,16,i.data$))("channel",i.channelOptions)("hiddenIPOSInventory",!1),u(2),P("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(25,18,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var ve=(()=>{let c=class c{constructor(t,e,n,_,d,p){this.http=t,this.toastr=e,this.dialog=n,this.productService=_,this.authService=d,this.decimalPipe=p,this.infinitePagination=N(V),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),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(M(t=>{t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1},this.searchFilter=t.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(t){this.searchFilter.filterModel=1,t&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(t){this.searchFilter.text=t,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(t){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let _=e.map(p=>({ID:p.ID,Code:p.Code,Price:p.UnitPrice}));var n=this.channelOptions.filter(p=>p.selected).map(p=>p.ID);let d={ListChannelID:n,ListPrice:_};this.http.post("/api/Price/UpdateChannel",d).subscribe(p=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+d.ListPrice.length+" items in "+d.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(t){let e={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post("/api/Price/UpdatePriceByID",e).subscribe(n=>{let _=this.productService.findChannelById(e.ID,this.channelOptions),d=e.Price?this.decimalPipe.transform(e.Price):e.Price;this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") price in "+_.Name+" to "+d,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(t){let e=this.productService.selectedVariantProduct(t);this.dialog.open(Y,{data:{title:"Updating Price",selectedItems:e,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(F(n=>n!==void 0)).subscribe(n=>{this.channelOptions=n,this.updatePrice(t)})}openExportDialog(){this.dialog.open(X,{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()}};c.\u0275fac=function(e){return new(e||c)(h(H),h($),h(z),h(Q),h(q),h(I))},c.\u0275cmp=E({type:c,selectors:[["app-price-pos-channel"]],standalone:!0,features:[R([V,I]),L],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","hiddenIPOSInventory"],[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(e,n){e&1&&(w(0,ne,26,20,"mainpanel",0),C(1,"async")),e&2&&P("ngIf",x(1,1,n.loader$))},dependencies:[O,A,B,W,U,G,j,k,ee,K,J,Z],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let r=c;return r})();export{ve as PricePosChannelComponent};