marketplacepos 5.41.4 → 5.41.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 (40) hide show
  1. package/Marketplace/{chunk-FX6CFPPN.js → chunk-2BV355IK.js} +1 -1
  2. package/Marketplace/{chunk-AIIRPK4M.js → chunk-2VSUESZZ.js} +1 -1
  3. package/Marketplace/{chunk-HUMGZRJQ.js → chunk-56WGJNPW.js} +1 -1
  4. package/Marketplace/{chunk-B54QGLED.js → chunk-5DX5OS45.js} +2 -2
  5. package/Marketplace/{chunk-SL4ID42P.js → chunk-5LUTNBYZ.js} +1 -1
  6. package/Marketplace/{chunk-G5CQLP7H.js → chunk-64MZV5WU.js} +1 -1
  7. package/Marketplace/{chunk-LEMNVA5V.js → chunk-67JBJ45X.js} +1 -1
  8. package/Marketplace/{chunk-S7LCZRSD.js → chunk-6ZUAJPGL.js} +1 -1
  9. package/Marketplace/{chunk-7G53KEUW.js → chunk-72DJCVV6.js} +1 -1
  10. package/Marketplace/{chunk-VDSO2BHA.js → chunk-A5LJ5SMN.js} +1 -1
  11. package/Marketplace/{chunk-5FEQZAWX.js → chunk-BFYBCKXD.js} +1 -1
  12. package/Marketplace/{chunk-SZ6MQ6EW.js → chunk-BTYHZ3BG.js} +1 -1
  13. package/Marketplace/{chunk-HMB7FZD7.js → chunk-CCX62ZEW.js} +1 -1
  14. package/Marketplace/{chunk-DVE7IIN7.js → chunk-CGVOFFIH.js} +1 -1
  15. package/Marketplace/{chunk-BG6DO7RW.js → chunk-CNL3HZIH.js} +1 -1
  16. package/Marketplace/{chunk-L4JWBBBC.js → chunk-E2FP3UH3.js} +1 -1
  17. package/Marketplace/{chunk-LFJIZAV2.js → chunk-FBBW443I.js} +1 -1
  18. package/Marketplace/{chunk-3CZJUTLZ.js → chunk-FMUQPVVH.js} +1 -1
  19. package/Marketplace/{chunk-REYGC4GG.js → chunk-HDF7PEIR.js} +1 -1
  20. package/Marketplace/{chunk-O5SSMLCS.js → chunk-HGCZ7LIZ.js} +1 -1
  21. package/Marketplace/{chunk-HNYOBOEW.js → chunk-HIY3ODHB.js} +2 -2
  22. package/Marketplace/{chunk-TXPNZLOJ.js → chunk-J4K6QW3J.js} +1 -1
  23. package/Marketplace/{chunk-7P3SGW2P.js → chunk-JNXB7GCX.js} +1 -1
  24. package/Marketplace/{chunk-EYNCNJ3I.js → chunk-JPIOBYM7.js} +1 -1
  25. package/Marketplace/{chunk-UUUVVJG4.js → chunk-LIWNKZGW.js} +1 -1
  26. package/Marketplace/{chunk-LJTMOYLO.js → chunk-MZBZH6JP.js} +1 -1
  27. package/Marketplace/{chunk-KC2DJUBC.js → chunk-NN2JDRQD.js} +1 -1
  28. package/Marketplace/{chunk-4S4G5UPJ.js → chunk-PGHURUHZ.js} +1 -1
  29. package/Marketplace/{chunk-YPM6IC2W.js → chunk-PYD2QHHH.js} +1 -1
  30. package/Marketplace/{chunk-QJFAPDI7.js → chunk-QJIMFZTN.js} +1 -1
  31. package/Marketplace/{chunk-GCJBQRHI.js → chunk-QQJN7OGE.js} +1 -1
  32. package/Marketplace/{chunk-742J5UZZ.js → chunk-U2V4KOQS.js} +1 -1
  33. package/Marketplace/{chunk-Y7VC2AGS.js → chunk-VGEOTRB7.js} +1 -1
  34. package/Marketplace/{chunk-KOJ2R5XW.js → chunk-VQ4QGCSU.js} +1 -1
  35. package/Marketplace/{chunk-E3HHEPKQ.js → chunk-W7OL4JR7.js} +1 -1
  36. package/Marketplace/{chunk-K3FQGMAY.js → chunk-WKHHCF3P.js} +1 -1
  37. package/Marketplace/{chunk-OAVAVDIP.js → chunk-YCPKCFMZ.js} +1 -1
  38. package/Marketplace/index.html +2 -2
  39. package/Marketplace/{main-5HHAD6NX.js → main-UY5LIWLP.js} +1 -1
  40. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as M}from"./chunk-E3HHEPKQ.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as B}from"./chunk-K3FQGMAY.js";import{a as Ve,b as Te}from"./chunk-ICSMRW7O.js";import{a as be,b as Fe}from"./chunk-YXFTLQ5M.js";import{a as ye}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as ve}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as Ce,b as ue,d as fe,e as xe}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{a as se,l as he}from"./chunk-LEMNVA5V.js";import{b as _e,e as me}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as Se,l as Pe,m as Ie,n as we}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as ie,c as oe,h as ae,m as re,o as le,y as ce}from"./chunk-DPLEMBB4.js";import{c as pe,e as de,f as ge}from"./chunk-PXB4YEY3.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-GPEVUTDI.js";import{$c as Z,Dc as H,Eb as z,Ec as d,Fc as R,G as W,Gc as b,Ic as I,Jc as w,Kb as h,Kc as y,Oc as J,Qc as F,Wb as p,Z as A,Zc as v,_c as V,ad as Q,bc as S,cc as N,ea as $,ec as k,fc as L,gc as a,hc as c,ic as P,jc as G,kc as q,mc as f,ob as T,pa as j,qb as l,rc as C,sc as r,vc as K,wb as u,ya as _,za as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var U=i=>[i],Re=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(a(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),p("src",e==null?null:e.Img,T),l(),b(" ",e.Name," ")}}function We(i,s){if(i&1){let e=f();a(0,"button",16),C("click",function(){_(e);let t=r().ngIf,o=r(2);return m(o.updateStock(t))}),P(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let e=f();a(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),a(3,"button",14),C("click",function(){_(e);let t=r(2);return m(t.openExportDialog())}),P(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),p("ngIf",n.productService.hasSelectionVariant(e))}}function $e(i,s){if(i&1){let e=f();a(0,"th")(1,"input",32),C("change",function(t){_(e);let o=r().ngIf,g=r(2);return m(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function je(i,s){if(i&1){let e=f();a(0,"input",51),y("ngModelChange",function(t){_(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),C("ngModelChange",function(){_(e);let t=r(4).$implicit,o=r(3);return m(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let e=r(6);p("ngxPermissionsOnly",F(1,U,e.rolePriceEdit))}}function Ge(i,s){if(i&1){let e=f();G(0),a(1,"img",52),C("click",function(t){_(e);let o=r(3).$implicit,g=r(3);return m(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,T)}}function qe(i,s){i&1&&P(0,"img",53)}function Ke(i,s){if(i&1&&(a(0,"small",50),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function He(i,s){if(i&1&&(a(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),a(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,qe,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",48)(8,"span",49),d(9),c(),h(10,Ke,2,1,"small",50),c()),i&2){let e=H(6),n=r(2).$implicit;p("rowSpan",n.Variants.length),l(2),S((n.Variants==null?null:n.Variants.length)>1?2:-1),l(),p("ngClass",F(8,Ue,(n.Variants==null?null:n.Variants.length)<=1)),l(),p("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),p("rowSpan",n.Variants.length),l(2),R(n.Name),l(),S(n.Category?10:-1)}}function Je(i,s){if(i&1){let e=f();a(0,"input",56),y("ngModelChange",function(t){_(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Ze(i,s){if(i&1&&(a(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let e=r().$implicit;l(),S(e.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let e=r().$implicit,n=r(4);l(),p("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),T)}}function et(i,s){if(i&1){let e=f();a(0,"div",58),C("click",function(){_(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,x=r();return m(x.openTableDialog(t,o,g))}),d(1),v(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let e=f();a(0,"tr",33),h(1,He,11,10),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),a(16,"div",37)(17,"a",40),P(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=_(e).$implicit,o=r(4);return m(o.refreshPrice(t))}),P(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),S(n==0?1:-1),l(2),R(e.Model),l(2),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",F(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),p("ngxPermissionsOnly",F(14,U,t.rolePriceEdit)),l(3),S((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),p("ngClass",F(16,Be,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),S(e.Channel.length>0?15:-1),l(2),p("href",e.Channel[0]==null?null:e.Channel[0].Url,T)}}function nt(i,s){if(i&1&&k(0,tt,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function it(i,s){if(i&1){let e=f();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(t){_(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),m(t)}),C("toggleChange",function(){_(e);let t=r(2);return m(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){_(e);let t=r(2);return m(t.openModalFilter())}),P(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,nt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return m(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",F(16,U,n.rolePriceEdit)),l(4),p("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),p("src",n.selectedChannel==null?null:n.selectedChannel.Img,T),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),p("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",V(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function ot(i,s){if(i&1){let e=f();a(0,"mainpanel",2),y("textChange",function(t){_(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),m(t)}),C("onSubmit",function(){_(e);let t=r();return m(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),m(t)}),h(6,Oe,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),m(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),m(t)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,18,"content",9),v(18,"async"),c()}if(i&2){let e=r();p("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),p("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),p("ngIf",V(16,9,e.data$)),l(2),p("ngIf",V(18,11,e.data$))}}var At=(()=>{class i{constructor(e,n,t,o,g,x,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=x,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(B),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.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(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,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(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(x=>pe.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,n){let t={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",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),x=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${x}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{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()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Se),u(ye),u(ve),u(M),u(he),u(Pe),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([B,M,ne("https://res.cloudinary.com/"),D])],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,t){n&1&&(h(0,ot,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",V(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,xe,fe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],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})}}return i})();export{At as PriceSingleChannelComponent};
1
+ import{a as M}from"./chunk-W7OL4JR7.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as B}from"./chunk-WKHHCF3P.js";import{a as Ve,b as Te}from"./chunk-ICSMRW7O.js";import{a as be,b as Fe}from"./chunk-YXFTLQ5M.js";import{a as ye}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as ve}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as Ce,b as ue,d as fe,e as xe}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{a as se,l as he}from"./chunk-67JBJ45X.js";import{b as _e,e as me}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as Se,l as Pe,m as Ie,n as we}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as ie,c as oe,h as ae,m as re,o as le,y as ce}from"./chunk-DPLEMBB4.js";import{c as pe,e as de,f as ge}from"./chunk-PXB4YEY3.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-GPEVUTDI.js";import{$c as Z,Dc as H,Eb as z,Ec as d,Fc as R,G as W,Gc as b,Ic as I,Jc as w,Kb as h,Kc as y,Oc as J,Qc as F,Wb as p,Z as A,Zc as v,_c as V,ad as Q,bc as S,cc as N,ea as $,ec as k,fc as L,gc as a,hc as c,ic as P,jc as G,kc as q,mc as f,ob as T,pa as j,qb as l,rc as C,sc as r,vc as K,wb as u,ya as _,za as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var U=i=>[i],Re=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(a(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),p("src",e==null?null:e.Img,T),l(),b(" ",e.Name," ")}}function We(i,s){if(i&1){let e=f();a(0,"button",16),C("click",function(){_(e);let t=r().ngIf,o=r(2);return m(o.updateStock(t))}),P(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let e=f();a(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),a(3,"button",14),C("click",function(){_(e);let t=r(2);return m(t.openExportDialog())}),P(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),p("ngIf",n.productService.hasSelectionVariant(e))}}function $e(i,s){if(i&1){let e=f();a(0,"th")(1,"input",32),C("change",function(t){_(e);let o=r().ngIf,g=r(2);return m(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function je(i,s){if(i&1){let e=f();a(0,"input",51),y("ngModelChange",function(t){_(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),C("ngModelChange",function(){_(e);let t=r(4).$implicit,o=r(3);return m(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let e=r(6);p("ngxPermissionsOnly",F(1,U,e.rolePriceEdit))}}function Ge(i,s){if(i&1){let e=f();G(0),a(1,"img",52),C("click",function(t){_(e);let o=r(3).$implicit,g=r(3);return m(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,T)}}function qe(i,s){i&1&&P(0,"img",53)}function Ke(i,s){if(i&1&&(a(0,"small",50),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function He(i,s){if(i&1&&(a(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),a(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,qe,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",48)(8,"span",49),d(9),c(),h(10,Ke,2,1,"small",50),c()),i&2){let e=H(6),n=r(2).$implicit;p("rowSpan",n.Variants.length),l(2),S((n.Variants==null?null:n.Variants.length)>1?2:-1),l(),p("ngClass",F(8,Ue,(n.Variants==null?null:n.Variants.length)<=1)),l(),p("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),p("rowSpan",n.Variants.length),l(2),R(n.Name),l(),S(n.Category?10:-1)}}function Je(i,s){if(i&1){let e=f();a(0,"input",56),y("ngModelChange",function(t){_(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Ze(i,s){if(i&1&&(a(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let e=r().$implicit;l(),S(e.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let e=r().$implicit,n=r(4);l(),p("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),T)}}function et(i,s){if(i&1){let e=f();a(0,"div",58),C("click",function(){_(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,x=r();return m(x.openTableDialog(t,o,g))}),d(1),v(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let e=f();a(0,"tr",33),h(1,He,11,10),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),a(16,"div",37)(17,"a",40),P(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=_(e).$implicit,o=r(4);return m(o.refreshPrice(t))}),P(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),S(n==0?1:-1),l(2),R(e.Model),l(2),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",F(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),p("ngxPermissionsOnly",F(14,U,t.rolePriceEdit)),l(3),S((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),p("ngClass",F(16,Be,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),S(e.Channel.length>0?15:-1),l(2),p("href",e.Channel[0]==null?null:e.Channel[0].Url,T)}}function nt(i,s){if(i&1&&k(0,tt,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function it(i,s){if(i&1){let e=f();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(t){_(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),m(t)}),C("toggleChange",function(){_(e);let t=r(2);return m(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){_(e);let t=r(2);return m(t.openModalFilter())}),P(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,nt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return m(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",F(16,U,n.rolePriceEdit)),l(4),p("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),p("src",n.selectedChannel==null?null:n.selectedChannel.Img,T),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),p("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",V(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function ot(i,s){if(i&1){let e=f();a(0,"mainpanel",2),y("textChange",function(t){_(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),m(t)}),C("onSubmit",function(){_(e);let t=r();return m(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),m(t)}),h(6,Oe,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),m(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),m(t)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,18,"content",9),v(18,"async"),c()}if(i&2){let e=r();p("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),p("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),p("ngIf",V(16,9,e.data$)),l(2),p("ngIf",V(18,11,e.data$))}}var At=(()=>{class i{constructor(e,n,t,o,g,x,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=x,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(B),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.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(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,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(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(x=>pe.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,n){let t={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",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),x=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${x}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{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()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Se),u(ye),u(ve),u(M),u(he),u(Pe),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([B,M,ne("https://res.cloudinary.com/"),D])],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,t){n&1&&(h(0,ot,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",V(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,xe,fe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],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})}}return i})();export{At as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{a as E}from"./chunk-6NNAICJE.js";import{a as T}from"./chunk-EGTYAIU5.js";import{j as D,l as w}from"./chunk-LEMNVA5V.js";import{b as j,e as s}from"./chunk-BUFEIJAI.js";import{b as i,c as m}from"./chunk-PXB4YEY3.js";import{G as C}from"./chunk-GPEVUTDI.js";import{B as A,G as U,J as u,Qa as I,g as k,ja as p,pa as a,q as d,v as b}from"./chunk-T5ONJF63.js";var F=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var x=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var v=class{};var R=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var O=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(D.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Vt=(()=>{class r{constructor(){this.authService=a(w),this.productService=a(T),this.shoppeUploadService=a(F),this.tiktokUploadService=a(x),this.lazadaUploadService=a(H),this.tokopediaUploadService=a(R),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(O),this.toastrHandlingService=a(E),this.toastr=a(j),this.router=a(C),this.httpService=a(s),this._selectedProduct=new k(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(U(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return I(t.map(o=>{let c=new g;return c.id=o.ID,c.name=o.Name,c.type=o.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);A(e).pipe(b(o=>{let c=[];return o.forEach(f=>{c=[...c,...f]}),c})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],c=[],f=[],S=[],y=[],P=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:c.push(l);break;case i.Tokopedia:f.push(l);break;case i.WooCommerce:S.push(l);break;case i.Shopify:y.push(l);break;case i.Plugo:P.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:c},{type:i.Tokopedia,data:f},{type:i.WooCommerce,data:S},{type:i.Shopify,data:y},{type:i.Plugo,data:P}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(c));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(f));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(S));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(P));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let c=new v;c.ChannelID=o.id,c.ChannelType=o.type,c.Products=this._selectedProduct.getValue(),o.type==i.Shopify?delete c.CategoryID:c.CategoryID=o.categoryId,o.type==i.WooCommerce||o.type==i.Shopify?c.Attribute=o.attributes[0]:c.Attributes=this.formatAttributes(o.type,o.attributes),e.push(c)}),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{F as a,x as b,H as c,z as d,Vt as e};
1
+ import{a as E}from"./chunk-6NNAICJE.js";import{a as T}from"./chunk-EGTYAIU5.js";import{j as D,l as w}from"./chunk-67JBJ45X.js";import{b as j,e as s}from"./chunk-BUFEIJAI.js";import{b as i,c as m}from"./chunk-PXB4YEY3.js";import{G as C}from"./chunk-GPEVUTDI.js";import{B as A,G as U,J as u,Qa as I,g as k,ja as p,pa as a,q as d,v as b}from"./chunk-T5ONJF63.js";var F=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var x=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var v=class{};var R=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var O=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(D.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Vt=(()=>{class r{constructor(){this.authService=a(w),this.productService=a(T),this.shoppeUploadService=a(F),this.tiktokUploadService=a(x),this.lazadaUploadService=a(H),this.tokopediaUploadService=a(R),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(O),this.toastrHandlingService=a(E),this.toastr=a(j),this.router=a(C),this.httpService=a(s),this._selectedProduct=new k(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(U(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return I(t.map(o=>{let c=new g;return c.id=o.ID,c.name=o.Name,c.type=o.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);A(e).pipe(b(o=>{let c=[];return o.forEach(f=>{c=[...c,...f]}),c})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],c=[],f=[],S=[],y=[],P=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:c.push(l);break;case i.Tokopedia:f.push(l);break;case i.WooCommerce:S.push(l);break;case i.Shopify:y.push(l);break;case i.Plugo:P.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:c},{type:i.Tokopedia,data:f},{type:i.WooCommerce,data:S},{type:i.Shopify,data:y},{type:i.Plugo,data:P}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(c));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(f));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(S));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(P));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let c=new v;c.ChannelID=o.id,c.ChannelType=o.type,c.Products=this._selectedProduct.getValue(),o.type==i.Shopify?delete c.CategoryID:c.CategoryID=o.categoryId,o.type==i.WooCommerce||o.type==i.Shopify?c.Attribute=o.attributes[0]:c.Attributes=this.formatAttributes(o.type,o.attributes),e.push(c)}),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{F as a,x as b,H as c,z as d,Vt as e};
@@ -1 +1 @@
1
- import{a as Y}from"./chunk-GCJBQRHI.js";import{e as J}from"./chunk-6IAGGRZN.js";import{j as H}from"./chunk-LEMNVA5V.js";import{b as j,e as F}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import{m as G,n as U}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as B,h as D,m as I,y as R}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{j as P,l as W,n as k}from"./chunk-GPEVUTDI.js";import{Eb as x,Ec as i,Fc as E,Ic as C,Jc as b,Kb as M,Kc as _,Lc as T,Mc as V,Nc as v,Qa as h,Wb as f,Z as y,Zc as S,_c as w,bc as O,gc as e,hc as t,ic as A,mc as L,pa as u,qb as d,rc as g,sc as N,ya as s,za as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function z(n,q){if(n&1&&(e(0,"pre",21),i(1),S(2,"json"),t()),n&2){N();let l=v(25);d(),E(w(2,1,l))}}function K(n,q){n&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var ce=(()=>{class n{constructor(){this.httpService=u(F),this.toastr=u(j),this.selectedChannel=h(null),this.orderNumber=h(null)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.orderLog$=this.httpService.post(H.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(y(1))}copyToClipboard(l){if(!l)return;let p=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(p),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-order-api"]],decls:40,vars:9,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","orderLogText"],[1,"text-center","my-12","text-muted"]],template:function(p,r){if(p&1){let a=L();e(0,"mainpanel",0)(1,"actions")(2,"button",1),g("click",function(){return s(a),m(r.fetchLog())}),A(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Order API activities. "),t()(),e(15,"div",9)(16,"channel-select-options",10),_("ngModelChange",function(o){return s(a),b(r.selectedChannel,o)||(r.selectedChannel=o),m(o)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),_("ngModelChange",function(o){return s(a),b(r.orderNumber,o)||(r.orderNumber=o),m(o)}),t()()()()(),T(25),S(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),g("click",function(){s(a);let o=v(25);return m(r.copyToClipboard(o))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),M(38,z,3,3,"pre",21)(39,K,2,0,"p",22),t()()()()()()()()()}if(p&2){f("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),C("ngModel",r.selectedChannel),d(8),C("ngModel",r.orderNumber),d();let a=V(w(26,6,r.orderLog$));d(8),f("disabled",!a),d(5),O(a?38:39)}},dependencies:[k,P,W,U,G,J,R,B,D,I,Y],encapsulation:2})}}return n})();export{ce as OrderApiComponent};
1
+ import{a as Y}from"./chunk-QQJN7OGE.js";import{e as J}from"./chunk-6IAGGRZN.js";import{j as H}from"./chunk-67JBJ45X.js";import{b as j,e as F}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import{m as G,n as U}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as B,h as D,m as I,y as R}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{j as P,l as W,n as k}from"./chunk-GPEVUTDI.js";import{Eb as x,Ec as i,Fc as E,Ic as C,Jc as b,Kb as M,Kc as _,Lc as T,Mc as V,Nc as v,Qa as h,Wb as f,Z as y,Zc as S,_c as w,bc as O,gc as e,hc as t,ic as A,mc as L,pa as u,qb as d,rc as g,sc as N,ya as s,za as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function z(n,q){if(n&1&&(e(0,"pre",21),i(1),S(2,"json"),t()),n&2){N();let l=v(25);d(),E(w(2,1,l))}}function K(n,q){n&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var ce=(()=>{class n{constructor(){this.httpService=u(F),this.toastr=u(j),this.selectedChannel=h(null),this.orderNumber=h(null)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.orderLog$=this.httpService.post(H.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(y(1))}copyToClipboard(l){if(!l)return;let p=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(p),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-order-api"]],decls:40,vars:9,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","orderLogText"],[1,"text-center","my-12","text-muted"]],template:function(p,r){if(p&1){let a=L();e(0,"mainpanel",0)(1,"actions")(2,"button",1),g("click",function(){return s(a),m(r.fetchLog())}),A(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Order API activities. "),t()(),e(15,"div",9)(16,"channel-select-options",10),_("ngModelChange",function(o){return s(a),b(r.selectedChannel,o)||(r.selectedChannel=o),m(o)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),_("ngModelChange",function(o){return s(a),b(r.orderNumber,o)||(r.orderNumber=o),m(o)}),t()()()()(),T(25),S(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),g("click",function(){s(a);let o=v(25);return m(r.copyToClipboard(o))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),M(38,z,3,3,"pre",21)(39,K,2,0,"p",22),t()()()()()()()()()}if(p&2){f("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),C("ngModel",r.selectedChannel),d(8),C("ngModel",r.orderNumber),d();let a=V(w(26,6,r.orderLog$));d(8),f("disabled",!a),d(5),O(a?38:39)}},dependencies:[k,P,W,U,G,J,R,B,D,I,Y],encapsulation:2})}}return n})();export{ce as OrderApiComponent};
@@ -1,2 +1,2 @@
1
- import"./chunk-XFCMKJV6.js";import{a as ke}from"./chunk-5FEQZAWX.js";import{a as Ge}from"./chunk-77IUCPIQ.js";import"./chunk-OAS72QB2.js";import"./chunk-PQ6Z7K5L.js";import"./chunk-MS4AQ6UA.js";import{b as We}from"./chunk-OLSC6KHB.js";import{b as He}from"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{b as je}from"./chunk-M3SJUKTG.js";import{c as Fe}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as p}from"./chunk-YPM6IC2W.js";import"./chunk-Q72ZXPDP.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import{a as $e}from"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as we,d as Ee,e as A}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{a as T,b as xe,d as Se,l as Oe}from"./chunk-LEMNVA5V.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{a as De,h as Ve,k as q,n as Ue}from"./chunk-ITTRZMEX.js";import{r as Re,s as R}from"./chunk-TMFFA26Y.js";import{B as Ae,M as G,m as Pe,n as ze,q as Ne,u as Be,v as Le}from"./chunk-WAW37FIG.js";import{h as ve,m as Me,y as L,z as ye}from"./chunk-DPLEMBB4.js";import{e as Ie,f as Te}from"./chunk-PXB4YEY3.js";import{F as _e,H as be,I as Ce,J as W,a as me,d as pe,f as ge,g as he,j as fe,k as ue,n as v}from"./chunk-GPEVUTDI.js";import{Ac as ce,Dc as z,Eb as b,Ec as m,Fb as u,Fc as C,G as Y,Gb as ae,Gc as I,Ka as E,Kb as g,La as X,M as J,Oa as ee,Q as Z,Wa as te,Wb as s,Xb as oe,Yb as D,Zc as j,_b as F,_c as H,ad as N,bc as re,ca as K,f as $,gc as r,hc as l,ic as _,jc as k,ka as f,kc as P,mc as le,md as B,ob as ie,pa as h,qb as o,rc as S,sc as d,v as w,vb as ne,wb as x,ya as M,yc as se,za as y,zc as de}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var V=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[T.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:[T.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[T.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[T.channelView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",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=${xe.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var qe="mat-badge-content",tt=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275cmp=b({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},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, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.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%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.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, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.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, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.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, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
2
- `],encapsulation:2,changeDetection:0})}return e})(),Qe=(()=>{class e{_ngZone=h(X);_elementRef=h(ee);_ariaDescriber=h(Ae);_renderer=h(ne);_animationMode=h(te,{optional:!0});_idGenerator=h(Le);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=h(Ne);_document=h(me);constructor(){let t=h(Pe);t.load(tt),t.load(ze)}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 t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(qe),this._animationMode==="NoopAnimations"&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):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(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${qe}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&D("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",B],disabled:[2,"matBadgeDisabled","disabled",B],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",B]}})}return e})(),Ye=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=u({type:e});static \u0275inj=f({imports:[Be,G,G]})}return e})();function nt(e,a){if(e&1&&(k(0),r(1,"p",23),m(2),l(),P()),e&2){let t=d(3).$implicit;o(2),I(" ",t.Title," ")}}function at(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(3).$implicit;o(),C(t.Title)}}function ot(e,a){if(e&1&&(r(0,"a",22),_(1,"i"),g(2,nt,3,1,"ng-container",20)(3,at,2,1,"ng-template",null,1,N),l()),e&2){let t=z(4),i=d(2).$implicit;s("href",i.Url,ie),o(),F(i.Icon),o(),s("ngIf",i.Badge)("ngIfElse",t)}}function rt(e,a){if(e&1&&(k(0),g(1,ot,5,5,"a",21),P()),e&2){let t=d().$implicit;o(),s("ngxPermissionsOnly",t.Roles)}}function lt(e,a){if(e&1&&(r(0,"p",23),m(1),l()),e&2){let t=d(4).$implicit;o(),I(" ",t.Title," ")}}function st(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(4).$implicit;o(),C(t.Title)}}function dt(e,a){if(e&1&&(k(0),g(1,lt,2,1,"p",23),j(2,"async"),g(3,st,2,1,"p"),P()),e&2){let t=d(4);o(),re(H(2,1,t.notifications$)!=0?1:3)}}function ct(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(3).$implicit;o(),C(t.Title)}}function mt(e,a){if(e&1&&(r(0,"a",25),_(1,"i"),g(2,dt,4,3,"ng-container",20)(3,ct,2,1,"ng-template",null,2,N),l()),e&2){let t=z(4),i=d(2).$implicit,n=d();s("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),o(),F(i.Icon),o(),s("ngIf",i.Badge)("ngIfElse",t)}}function pt(e,a){if(e&1&&g(0,mt,5,6,"a",24),e&2){let t=d().$implicit;s("ngxPermissionsOnly",t.Roles)}}function gt(e,a){if(e&1&&(r(0,"li",19),g(1,rt,2,1,"ng-container",20)(2,pt,1,1,"ng-template",null,0,N),l()),e&2){let t=a.$implicit,i=z(3);o(),s("ngIf",t.ExternalLink)("ngIfElse",i)}}var Je=(()=>{class e{constructor(t,i,n,c){this.toggleSidebarService=t,this.notificationService=i,this.decodeTokenService=n,this.authService=c,this.Menu={},this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new V().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(w(t=>t.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(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)(x(De),x(ke),x(Se),x(Oe))}}static{this.\u0275cmp=b({type:e,selectors:[["app-menu"]],standalone:!1,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(i,n){i&1&&(r(0,"div",3),j(1,"async"),r(2,"div",4)(3,"button",5),S("click",function(){return n.onCallapseSidebar()}),_(4,"i",6),l(),r(5,"div",7)(6,"div",8)(7,"a",9),m(8),l(),r(9,"div",10)(10,"div",11),m(11),l(),_(12,"div",12),r(13,"a",13),S("click",function(){return n.onLogout()}),_(14,"i",14),m(15,"\xA0 "),r(16,"span"),m(17," Log Out"),l()()()()(),r(18,"div",15)(19,"ul",16),g(20,gt,4,2,"li",17),l()()(),r(21,"div",18),_(22,"router-outlet"),l()()),i&2&&(D("nav-open",H(1,7,n.toggleState$)),o(2),s("ngClass",n.isCollapseSidebar?"collapses":""),o(2),s("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),o(4),I(" ",n.storeName," "),o(3),I(" ",n.token==null?null:n.token.LID," "),o(9),s("ngForOf",n.Menu))},dependencies:[pe,ge,he,_e,be,Ce,Re,Qe,Ie,fe],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}}"]})}}return e})();var ht=[{path:"",component:Je,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-E6HA2AGS.js").then(e=>e.DashboardModule),canActivate:[p],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-O5SSMLCS.js").then(e=>e.ProductModule),canActivate:[p],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-G5CQLP7H.js").then(e=>e.InventoryRoutingModule),canActivate:[p],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-L4JWBBBC.js").then(e=>e.PriceRoutingModule),canActivate:[p],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-HNYOBOEW.js").then(e=>e.OrdersModule),canActivate:[p],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-KOJ2R5XW.js").then(e=>e.ReportModule),canActivate:[p],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-QJFAPDI7.js").then(e=>e.LogisticModule),canActivate:[p],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-LFJIZAV2.js").then(e=>e.ChannelsModule),canActivate:[p],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-S7LCZRSD.js").then(e=>e.LogsModule),canActivate:[p],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-3CZJUTLZ.js").then(e=>e.NotificationModule),canActivate:[p],data:{title:"Push Notification"}},{path:"json-api",loadChildren:()=>import("./chunk-742J5UZZ.js").then(e=>e.routes),canActivate:[p],data:{title:"Json API"}}]}],Ze=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({imports:[W.forChild(ht),W]})}}return e})();var ut=["selectId"];function _t(e,a){if(e&1&&(r(0,"span",3),m(1),l()),e&2){let t=a.item,i=d();s("title",t[i.bindLabel]),o(),C(t[i.bindLabel])}}var Ke=(()=>{class e{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,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 Q,this.selectedChange=new E,this.selectedLabel=new E,this.onOpen=new E}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(i,n){if(i&1&&se(ut,7),i&2){let c;de(c=ce())&&(n.ngSelectElement=c.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"},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(i,n){if(i&1){let c=le();r(0,"ng-select",1,0),S("clear",function(){return M(c),y(n.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return M(c),y(n.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return M(c),y(n.onOpenSelect())})("change",function(et){return M(c),y(n.onSelectChange(et))}),g(2,_t,2,2,"ng-template",2),l()}i&2&&(oe("width",n.width),s("appendTo",n.parent)("disabled",n.disabled)("virtualScroll",!0)("typeahead",n.ngSelectInfiniteScroll.input$)("items",n.ngSelectInfiniteScroll.bufferData)("bindLabel",n.bindLabel)("bindValue",n.bindValue)("placeholder",n.placeholder)("ngModel",n.selected)("clearable",n.clearable))},dependencies:[v,A,Ee,we,L,ve,Me],encapsulation:2})}}return e})(),Q=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new $,this._destroy$=new $,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(J(200),Z(),w(a=>(a&&(a=a.toLowerCase()),this.filterData(a))),Y(a=>a!==void 0),K(this._destroy$)).subscribe(a=>{this._dataBuffer=a.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(a){let t=-1,i;return this._data.filter(c=>(i=JSON.stringify(c).toLowerCase(),t=i.indexOf(a),t!==-1||a==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(a){this._data=a||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(a,t){if(Ge.IsNotEmpty(a)){let i=this._data.filter(n=>n[t].toString().toLowerCase().indexOf(a)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(a){this._bufferSize=a}onScrollToEnd(){this.fetchMore()}fetchMore(){let a=this._dataBuffer.length,t=this._data.slice(a,this._bufferSize+a);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(t)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var Xe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({imports:[v,L,Ve,Fe,He,$e,je,We,R,q,Ke,A,ye]})}}return e})();var an=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({providers:[ue],imports:[v,Ze,Ue,R,Xe,Ye,Te.forChild()]})}}return e})();export{an as MenuModule};
1
+ import"./chunk-XFCMKJV6.js";import{a as ke}from"./chunk-BFYBCKXD.js";import{a as Ge}from"./chunk-77IUCPIQ.js";import"./chunk-OAS72QB2.js";import"./chunk-PQ6Z7K5L.js";import"./chunk-MS4AQ6UA.js";import{b as We}from"./chunk-OLSC6KHB.js";import{b as He}from"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{b as je}from"./chunk-M3SJUKTG.js";import{c as Fe}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as p}from"./chunk-PYD2QHHH.js";import"./chunk-Q72ZXPDP.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import{a as $e}from"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as we,d as Ee,e as A}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{a as T,b as xe,d as Se,l as Oe}from"./chunk-67JBJ45X.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{a as De,h as Ve,k as q,n as Ue}from"./chunk-ITTRZMEX.js";import{r as Re,s as R}from"./chunk-TMFFA26Y.js";import{B as Ae,M as G,m as Pe,n as ze,q as Ne,u as Be,v as Le}from"./chunk-WAW37FIG.js";import{h as ve,m as Me,y as L,z as ye}from"./chunk-DPLEMBB4.js";import{e as Ie,f as Te}from"./chunk-PXB4YEY3.js";import{F as _e,H as be,I as Ce,J as W,a as me,d as pe,f as ge,g as he,j as fe,k as ue,n as v}from"./chunk-GPEVUTDI.js";import{Ac as ce,Dc as z,Eb as b,Ec as m,Fb as u,Fc as C,G as Y,Gb as ae,Gc as I,Ka as E,Kb as g,La as X,M as J,Oa as ee,Q as Z,Wa as te,Wb as s,Xb as oe,Yb as D,Zc as j,_b as F,_c as H,ad as N,bc as re,ca as K,f as $,gc as r,hc as l,ic as _,jc as k,ka as f,kc as P,mc as le,md as B,ob as ie,pa as h,qb as o,rc as S,sc as d,v as w,vb as ne,wb as x,ya as M,yc as se,za as y,zc as de}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var V=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[T.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:[T.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[T.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[T.channelView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",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=${xe.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var qe="mat-badge-content",tt=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275cmp=b({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},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, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.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%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.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, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.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, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.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, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
2
+ `],encapsulation:2,changeDetection:0})}return e})(),Qe=(()=>{class e{_ngZone=h(X);_elementRef=h(ee);_ariaDescriber=h(Ae);_renderer=h(ne);_animationMode=h(te,{optional:!0});_idGenerator=h(Le);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=h(Ne);_document=h(me);constructor(){let t=h(Pe);t.load(tt),t.load(ze)}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 t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(qe),this._animationMode==="NoopAnimations"&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):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(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${qe}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&D("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",B],disabled:[2,"matBadgeDisabled","disabled",B],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",B]}})}return e})(),Ye=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=u({type:e});static \u0275inj=f({imports:[Be,G,G]})}return e})();function nt(e,a){if(e&1&&(k(0),r(1,"p",23),m(2),l(),P()),e&2){let t=d(3).$implicit;o(2),I(" ",t.Title," ")}}function at(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(3).$implicit;o(),C(t.Title)}}function ot(e,a){if(e&1&&(r(0,"a",22),_(1,"i"),g(2,nt,3,1,"ng-container",20)(3,at,2,1,"ng-template",null,1,N),l()),e&2){let t=z(4),i=d(2).$implicit;s("href",i.Url,ie),o(),F(i.Icon),o(),s("ngIf",i.Badge)("ngIfElse",t)}}function rt(e,a){if(e&1&&(k(0),g(1,ot,5,5,"a",21),P()),e&2){let t=d().$implicit;o(),s("ngxPermissionsOnly",t.Roles)}}function lt(e,a){if(e&1&&(r(0,"p",23),m(1),l()),e&2){let t=d(4).$implicit;o(),I(" ",t.Title," ")}}function st(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(4).$implicit;o(),C(t.Title)}}function dt(e,a){if(e&1&&(k(0),g(1,lt,2,1,"p",23),j(2,"async"),g(3,st,2,1,"p"),P()),e&2){let t=d(4);o(),re(H(2,1,t.notifications$)!=0?1:3)}}function ct(e,a){if(e&1&&(r(0,"p"),m(1),l()),e&2){let t=d(3).$implicit;o(),C(t.Title)}}function mt(e,a){if(e&1&&(r(0,"a",25),_(1,"i"),g(2,dt,4,3,"ng-container",20)(3,ct,2,1,"ng-template",null,2,N),l()),e&2){let t=z(4),i=d(2).$implicit,n=d();s("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),o(),F(i.Icon),o(),s("ngIf",i.Badge)("ngIfElse",t)}}function pt(e,a){if(e&1&&g(0,mt,5,6,"a",24),e&2){let t=d().$implicit;s("ngxPermissionsOnly",t.Roles)}}function gt(e,a){if(e&1&&(r(0,"li",19),g(1,rt,2,1,"ng-container",20)(2,pt,1,1,"ng-template",null,0,N),l()),e&2){let t=a.$implicit,i=z(3);o(),s("ngIf",t.ExternalLink)("ngIfElse",i)}}var Je=(()=>{class e{constructor(t,i,n,c){this.toggleSidebarService=t,this.notificationService=i,this.decodeTokenService=n,this.authService=c,this.Menu={},this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new V().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(w(t=>t.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(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)(x(De),x(ke),x(Se),x(Oe))}}static{this.\u0275cmp=b({type:e,selectors:[["app-menu"]],standalone:!1,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(i,n){i&1&&(r(0,"div",3),j(1,"async"),r(2,"div",4)(3,"button",5),S("click",function(){return n.onCallapseSidebar()}),_(4,"i",6),l(),r(5,"div",7)(6,"div",8)(7,"a",9),m(8),l(),r(9,"div",10)(10,"div",11),m(11),l(),_(12,"div",12),r(13,"a",13),S("click",function(){return n.onLogout()}),_(14,"i",14),m(15,"\xA0 "),r(16,"span"),m(17," Log Out"),l()()()()(),r(18,"div",15)(19,"ul",16),g(20,gt,4,2,"li",17),l()()(),r(21,"div",18),_(22,"router-outlet"),l()()),i&2&&(D("nav-open",H(1,7,n.toggleState$)),o(2),s("ngClass",n.isCollapseSidebar?"collapses":""),o(2),s("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),o(4),I(" ",n.storeName," "),o(3),I(" ",n.token==null?null:n.token.LID," "),o(9),s("ngForOf",n.Menu))},dependencies:[pe,ge,he,_e,be,Ce,Re,Qe,Ie,fe],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}}"]})}}return e})();var ht=[{path:"",component:Je,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-E6HA2AGS.js").then(e=>e.DashboardModule),canActivate:[p],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-HGCZ7LIZ.js").then(e=>e.ProductModule),canActivate:[p],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-64MZV5WU.js").then(e=>e.InventoryRoutingModule),canActivate:[p],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-E2FP3UH3.js").then(e=>e.PriceRoutingModule),canActivate:[p],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-HIY3ODHB.js").then(e=>e.OrdersModule),canActivate:[p],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-VQ4QGCSU.js").then(e=>e.ReportModule),canActivate:[p],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-QJIMFZTN.js").then(e=>e.LogisticModule),canActivate:[p],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-FBBW443I.js").then(e=>e.ChannelsModule),canActivate:[p],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-6ZUAJPGL.js").then(e=>e.LogsModule),canActivate:[p],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-FMUQPVVH.js").then(e=>e.NotificationModule),canActivate:[p],data:{title:"Push Notification"}},{path:"json-api",loadChildren:()=>import("./chunk-U2V4KOQS.js").then(e=>e.routes),canActivate:[p],data:{title:"Json API"}}]}],Ze=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({imports:[W.forChild(ht),W]})}}return e})();var ut=["selectId"];function _t(e,a){if(e&1&&(r(0,"span",3),m(1),l()),e&2){let t=a.item,i=d();s("title",t[i.bindLabel]),o(),C(t[i.bindLabel])}}var Ke=(()=>{class e{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,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 Q,this.selectedChange=new E,this.selectedLabel=new E,this.onOpen=new E}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(i,n){if(i&1&&se(ut,7),i&2){let c;de(c=ce())&&(n.ngSelectElement=c.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"},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(i,n){if(i&1){let c=le();r(0,"ng-select",1,0),S("clear",function(){return M(c),y(n.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return M(c),y(n.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return M(c),y(n.onOpenSelect())})("change",function(et){return M(c),y(n.onSelectChange(et))}),g(2,_t,2,2,"ng-template",2),l()}i&2&&(oe("width",n.width),s("appendTo",n.parent)("disabled",n.disabled)("virtualScroll",!0)("typeahead",n.ngSelectInfiniteScroll.input$)("items",n.ngSelectInfiniteScroll.bufferData)("bindLabel",n.bindLabel)("bindValue",n.bindValue)("placeholder",n.placeholder)("ngModel",n.selected)("clearable",n.clearable))},dependencies:[v,A,Ee,we,L,ve,Me],encapsulation:2})}}return e})(),Q=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new $,this._destroy$=new $,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(J(200),Z(),w(a=>(a&&(a=a.toLowerCase()),this.filterData(a))),Y(a=>a!==void 0),K(this._destroy$)).subscribe(a=>{this._dataBuffer=a.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(a){let t=-1,i;return this._data.filter(c=>(i=JSON.stringify(c).toLowerCase(),t=i.indexOf(a),t!==-1||a==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(a){this._data=a||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(a,t){if(Ge.IsNotEmpty(a)){let i=this._data.filter(n=>n[t].toString().toLowerCase().indexOf(a)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(a){this._bufferSize=a}onScrollToEnd(){this.fetchMore()}fetchMore(){let a=this._dataBuffer.length,t=this._data.slice(a,this._bufferSize+a);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(t)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var Xe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({imports:[v,L,Ve,Fe,He,$e,je,We,R,q,Ke,A,ye]})}}return e})();var an=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=u({type:e})}static{this.\u0275inj=f({providers:[ue],imports:[v,Ze,Ue,R,Xe,Ye,Te.forChild()]})}}return e})();export{an as MenuModule};
@@ -1 +1 @@
1
- import{a as ke}from"./chunk-GCJBQRHI.js";import{a as De}from"./chunk-OAS72QB2.js";import{a as W}from"./chunk-XHAXYWZ7.js";import{a as Oe,b as Ve,c as Ne,d as J}from"./chunk-K3FQGMAY.js";import{a as Te}from"./chunk-PPDHTO44.js";import{a as we}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-ICSMRW7O.js";import"./chunk-YXFTLQ5M.js";import"./chunk-OLSC6KHB.js";import{a as Fe}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as ve,b as Ie,c as ye}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as Me}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{a as ue,l as xe}from"./chunk-LEMNVA5V.js";import{b as he,e as ge}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as Pe,m as be,n as Se}from"./chunk-ITTRZMEX.js";import{r as A,s as j}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as _e,h as R,m as L,y as $}from"./chunk-DPLEMBB4.js";import{c as U,e as Ce,f as fe}from"./chunk-PXB4YEY3.js";import{d as se,f as k,g as me,j as pe,m as de,n as B}from"./chunk-GPEVUTDI.js";import{$c as ce,Dc as z,Eb as N,Ec as p,Fc as re,G as K,Gc as f,Ic as D,Jc as O,Ka as ee,Kb as u,Kc as V,Oc as ae,Qa as te,Qc as w,Rc as le,Wb as s,Z as G,Zb as ne,Zc as b,_c as y,ad as H,bc as ie,cc as M,ea as Y,ec as E,fc as T,gc as o,hc as a,ic as P,jc as S,kc as v,mc as I,ob as F,pa as Q,qb as r,rc as h,sc as m,v as q,vc as oe,wb as x,ya as g,za as C}from"./chunk-T5ONJF63.js";import{a as X,b as Z}from"./chunk-K2H6WANG.js";var We=(n,c)=>({color:n,"font-weight":c});function Ke(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();ne(le(7,We,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var Be=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=N({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},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(i,t){i&1&&(o(0,"mat-radio-group",0),h("ngModelChange",function(d){return t.change(d)}),u(1,Ke,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[B,k,ye,ve,Ie,$,R,L,j,A],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--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}"]})}}return n})();var Re=n=>[n],Ge=n=>({"text-decoration-line-through":n}),ze=n=>({"border-bottom":n}),He=n=>({"bg-gradient-warning":n});function Je(n,c){if(n&1){let e=I();S(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),V("ngModelChange",function(t){g(e);let l=m();return O(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),C(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),V("modelChange",function(t){g(e);let l=m();return O(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),C(t)}),a()(),v()}if(n&2){let e=m();r(4),s("multiple",!0),D("ngModel",e.searchFilter.ListChannelID),r(4),D("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function Xe(n,c){if(n&1){let e=I();o(0,"button",27),h("click",function(){g(e);let t=m().ngIf,l=m();return C(l.onUpdateItems(t))}),P(1,"i",28),p(2," Update "),a()}}function Ze(n,c){if(n&1&&(S(0),o(1,"div",4),u(2,Xe,3,0,"button",26),a(),v()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function qe(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),P(2,"img",30),o(3,"div",31),p(4),b(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,F),r(2),f(" ",ce(5,3,e.Name,20)," ")}}function Ye(n,c){if(n&1){let e=I();o(0,"th")(1,"input",32),V("ngModelChange",function(t){g(e);let l=m();return O(l.checkboxState,t)||(l.checkboxState=t),C(t)}),h("ngModelChange",function(){g(e);let t=m();return C(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),D("ngModel",e.checkboxState)}}function Qe(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function et(n,c){if(n&1){let e=I();o(0,"img",47),h("click",function(t){g(e);let l=m(3).$implicit,d=m(2);return C(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;oe("src",e==null?null:e.ImageUrl,F)}}function tt(n,c){n&1&&P(0,"img",48)}function nt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function it(n,c){if(n&1&&(S(0),o(1,"td",42),u(2,et,1,1,"img",43)(3,tt,1,0,"ng-template",null,0,H),a(),o(5,"td",44)(6,"h5",45),p(7),a(),u(8,nt,2,1,"small",46),a(),v()),n&2){let e=z(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",w(7,ze,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),re(t==null?null:t.Name),r(),ie(t!=null&&t.Category?8:-1)}}function ot(n,c){if(n&1){let e=I();o(0,"td",49)(1,"input",32),V("ngModelChange",function(t){g(e);let l=m().$implicit;return O(l.selected,t)||(l.selected=t),C(t)}),a()()}if(n&2){let e=m().$implicit;r(),D("ngModel",e.selected)}}function rt(n,c){if(n&1){let e=I();S(0),o(1,"td",51),p(2),b(3,"number"),a(),o(4,"td",52),h("click",function(){let t=g(e).$implicit,l=m(2).$implicit,d=m().$implicit,_=m(2);return C(_.openTableDialog(l,d,t))}),o(5,"div",53)(6,"div",54),p(7),b(8,"number"),a(),o(9,"a",55),h("click",function(t){return g(e),C(t==null?null:t.stopPropagation())}),P(10,"i",40),a()()(),v()}if(n&2){let e=c.$implicit;r(2),f(" ",y(3,4,e.PriceExpected)," "),r(2),s("ngClass",w(8,He,e.Price!=e.PriceExpected)),r(3),f(" ",y(8,6,e.Price)," "),r(2),s("href",e.Url,F)}}function at(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function lt(n,c){if(n&1&&(S(0),u(1,rt,11,10,"ng-container",50)(2,at,4,0,"ng-template",null,1,H),v()),n&2){let e=c.$implicit,i=z(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function ct(n,c){if(n&1&&(o(0,"tr"),u(1,it,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),P(10,"i",40),a()()()(),u(11,ot,2,1,"ng-template",19)(12,lt,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",w(8,Ge,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F),r(2),s("ngxPermissionsOnly",w(10,Re,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function st(n,c){if(n&1&&(o(0,"tbody"),E(1,ct,13,12,"tr",null,M),a()),n&2){let e=c.$implicit;r(),T(e.Variants)}}function mt(n,c){if(n&1&&(S(0),E(1,st,3,0,"tbody",null,M),v()),n&2){let e=c.ngIf;r(),T(e)}}var qt=(()=>{class n{constructor(e,i,t,l,d,_,Le){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=_,this.paginationService=Le,this.infinitePagination=Q(J),this.searchFilter=new we,this.checkboxState=!1,this.rolePriceEdit=ue.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=te([]),this.filterTypeOptions=[{Key:W.ALL,Value:"All"},{Key:W.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 e=this.searchFilter.ListChannelID,i=[];U.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(G(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=W.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),G(1))}onSelectAllData(){this.data$=this.data$.pipe(q(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=Z(X({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(_=>_.ID),d={ListChannelID:this.channelOptions.filter(_=>_.selected).map(_=>_.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:_=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:_=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(De,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(K(t=>U.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t){let l=JSON.parse(JSON.stringify(e));this.dialog.open(Oe,{data:{Name:i.Name,Variant:l,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(K(_=>U.IsNotEmpty(_))).subscribe(_=>{this.updateProductPrice(_,t)})}updateProductPrice(e,i){let t={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",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ee,{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(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(x(ge),x(he),x(Pe),x(Fe),x(xe),x(Me),x(Te))}}static{this.\u0275cmp=N({type:n,selectors:[["app-custom-channel-price"]],features:[ae([J])],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(i,t){i&1&&(o(0,"mainpanel",2),h("onSubmit",function(d){return t.onFilter(d)}),o(1,"filters"),u(2,Je,9,4,"ng-container",3),b(3,"async"),a(),o(4,"actions")(5,"div",4),u(6,Ze,3,1,"ng-container",3),b(7,"async"),o(8,"button",5),h("click",function(){return t.openExportDialog()}),P(9,"i",6),o(10,"span"),p(11,"Export"),a()()()(),o(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),E(21,qe,6,6,"th",15,M),a(),o(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),a()(),o(27,"th",17),p(28,"Variant"),a(),o(29,"th",18),p(30,"SKU"),a(),u(31,Ye,2,1,"ng-template",19),E(32,Qe,7,0,null,null,M),a()(),u(34,mt,3,0,"ng-container",3),b(35,"async"),a(),o(36,"infinite-paginator",20),b(37,"async"),h("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),a()()()()()()()),i&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",y(3,13,t.loader$)),r(4),s("ngIf",y(7,15,t.data$)),r(15),T(t.channels()),r(10),s("ngxPermissionsOnly",w(21,Re,t.rolePriceEdit)),r(),T(t.channels()),r(2),s("ngIf",y(35,17,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",y(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[B,se,k,me,pe,de,Se,be,$,_e,R,L,Ne,Be,j,A,Ve,fe,Ce,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}"]})}}return n})();export{qt as CustomChannelPriceComponent};
1
+ import{a as ke}from"./chunk-QQJN7OGE.js";import{a as De}from"./chunk-OAS72QB2.js";import{a as W}from"./chunk-XHAXYWZ7.js";import{a as Oe,b as Ve,c as Ne,d as J}from"./chunk-WKHHCF3P.js";import{a as Te}from"./chunk-PPDHTO44.js";import{a as we}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-ICSMRW7O.js";import"./chunk-YXFTLQ5M.js";import"./chunk-OLSC6KHB.js";import{a as Fe}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as ve,b as Ie,c as ye}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as Me}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{a as ue,l as xe}from"./chunk-67JBJ45X.js";import{b as he,e as ge}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as Pe,m as be,n as Se}from"./chunk-ITTRZMEX.js";import{r as A,s as j}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as _e,h as R,m as L,y as $}from"./chunk-DPLEMBB4.js";import{c as U,e as Ce,f as fe}from"./chunk-PXB4YEY3.js";import{d as se,f as k,g as me,j as pe,m as de,n as B}from"./chunk-GPEVUTDI.js";import{$c as ce,Dc as z,Eb as N,Ec as p,Fc as re,G as K,Gc as f,Ic as D,Jc as O,Ka as ee,Kb as u,Kc as V,Oc as ae,Qa as te,Qc as w,Rc as le,Wb as s,Z as G,Zb as ne,Zc as b,_c as y,ad as H,bc as ie,cc as M,ea as Y,ec as E,fc as T,gc as o,hc as a,ic as P,jc as S,kc as v,mc as I,ob as F,pa as Q,qb as r,rc as h,sc as m,v as q,vc as oe,wb as x,ya as g,za as C}from"./chunk-T5ONJF63.js";import{a as X,b as Z}from"./chunk-K2H6WANG.js";var We=(n,c)=>({color:n,"font-weight":c});function Ke(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();ne(le(7,We,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var Be=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=N({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},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(i,t){i&1&&(o(0,"mat-radio-group",0),h("ngModelChange",function(d){return t.change(d)}),u(1,Ke,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[B,k,ye,ve,Ie,$,R,L,j,A],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--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}"]})}}return n})();var Re=n=>[n],Ge=n=>({"text-decoration-line-through":n}),ze=n=>({"border-bottom":n}),He=n=>({"bg-gradient-warning":n});function Je(n,c){if(n&1){let e=I();S(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),V("ngModelChange",function(t){g(e);let l=m();return O(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),C(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),V("modelChange",function(t){g(e);let l=m();return O(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),C(t)}),a()(),v()}if(n&2){let e=m();r(4),s("multiple",!0),D("ngModel",e.searchFilter.ListChannelID),r(4),D("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function Xe(n,c){if(n&1){let e=I();o(0,"button",27),h("click",function(){g(e);let t=m().ngIf,l=m();return C(l.onUpdateItems(t))}),P(1,"i",28),p(2," Update "),a()}}function Ze(n,c){if(n&1&&(S(0),o(1,"div",4),u(2,Xe,3,0,"button",26),a(),v()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function qe(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),P(2,"img",30),o(3,"div",31),p(4),b(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,F),r(2),f(" ",ce(5,3,e.Name,20)," ")}}function Ye(n,c){if(n&1){let e=I();o(0,"th")(1,"input",32),V("ngModelChange",function(t){g(e);let l=m();return O(l.checkboxState,t)||(l.checkboxState=t),C(t)}),h("ngModelChange",function(){g(e);let t=m();return C(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),D("ngModel",e.checkboxState)}}function Qe(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function et(n,c){if(n&1){let e=I();o(0,"img",47),h("click",function(t){g(e);let l=m(3).$implicit,d=m(2);return C(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;oe("src",e==null?null:e.ImageUrl,F)}}function tt(n,c){n&1&&P(0,"img",48)}function nt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function it(n,c){if(n&1&&(S(0),o(1,"td",42),u(2,et,1,1,"img",43)(3,tt,1,0,"ng-template",null,0,H),a(),o(5,"td",44)(6,"h5",45),p(7),a(),u(8,nt,2,1,"small",46),a(),v()),n&2){let e=z(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",w(7,ze,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),re(t==null?null:t.Name),r(),ie(t!=null&&t.Category?8:-1)}}function ot(n,c){if(n&1){let e=I();o(0,"td",49)(1,"input",32),V("ngModelChange",function(t){g(e);let l=m().$implicit;return O(l.selected,t)||(l.selected=t),C(t)}),a()()}if(n&2){let e=m().$implicit;r(),D("ngModel",e.selected)}}function rt(n,c){if(n&1){let e=I();S(0),o(1,"td",51),p(2),b(3,"number"),a(),o(4,"td",52),h("click",function(){let t=g(e).$implicit,l=m(2).$implicit,d=m().$implicit,_=m(2);return C(_.openTableDialog(l,d,t))}),o(5,"div",53)(6,"div",54),p(7),b(8,"number"),a(),o(9,"a",55),h("click",function(t){return g(e),C(t==null?null:t.stopPropagation())}),P(10,"i",40),a()()(),v()}if(n&2){let e=c.$implicit;r(2),f(" ",y(3,4,e.PriceExpected)," "),r(2),s("ngClass",w(8,He,e.Price!=e.PriceExpected)),r(3),f(" ",y(8,6,e.Price)," "),r(2),s("href",e.Url,F)}}function at(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function lt(n,c){if(n&1&&(S(0),u(1,rt,11,10,"ng-container",50)(2,at,4,0,"ng-template",null,1,H),v()),n&2){let e=c.$implicit,i=z(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function ct(n,c){if(n&1&&(o(0,"tr"),u(1,it,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),P(10,"i",40),a()()()(),u(11,ot,2,1,"ng-template",19)(12,lt,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",w(8,Ge,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F),r(2),s("ngxPermissionsOnly",w(10,Re,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function st(n,c){if(n&1&&(o(0,"tbody"),E(1,ct,13,12,"tr",null,M),a()),n&2){let e=c.$implicit;r(),T(e.Variants)}}function mt(n,c){if(n&1&&(S(0),E(1,st,3,0,"tbody",null,M),v()),n&2){let e=c.ngIf;r(),T(e)}}var qt=(()=>{class n{constructor(e,i,t,l,d,_,Le){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=_,this.paginationService=Le,this.infinitePagination=Q(J),this.searchFilter=new we,this.checkboxState=!1,this.rolePriceEdit=ue.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=te([]),this.filterTypeOptions=[{Key:W.ALL,Value:"All"},{Key:W.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 e=this.searchFilter.ListChannelID,i=[];U.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(G(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=W.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),G(1))}onSelectAllData(){this.data$=this.data$.pipe(q(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=Z(X({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(_=>_.ID),d={ListChannelID:this.channelOptions.filter(_=>_.selected).map(_=>_.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:_=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:_=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(De,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(K(t=>U.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t){let l=JSON.parse(JSON.stringify(e));this.dialog.open(Oe,{data:{Name:i.Name,Variant:l,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(K(_=>U.IsNotEmpty(_))).subscribe(_=>{this.updateProductPrice(_,t)})}updateProductPrice(e,i){let t={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",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ee,{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(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(x(ge),x(he),x(Pe),x(Fe),x(xe),x(Me),x(Te))}}static{this.\u0275cmp=N({type:n,selectors:[["app-custom-channel-price"]],features:[ae([J])],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(i,t){i&1&&(o(0,"mainpanel",2),h("onSubmit",function(d){return t.onFilter(d)}),o(1,"filters"),u(2,Je,9,4,"ng-container",3),b(3,"async"),a(),o(4,"actions")(5,"div",4),u(6,Ze,3,1,"ng-container",3),b(7,"async"),o(8,"button",5),h("click",function(){return t.openExportDialog()}),P(9,"i",6),o(10,"span"),p(11,"Export"),a()()()(),o(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),E(21,qe,6,6,"th",15,M),a(),o(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),a()(),o(27,"th",17),p(28,"Variant"),a(),o(29,"th",18),p(30,"SKU"),a(),u(31,Ye,2,1,"ng-template",19),E(32,Qe,7,0,null,null,M),a()(),u(34,mt,3,0,"ng-container",3),b(35,"async"),a(),o(36,"infinite-paginator",20),b(37,"async"),h("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),a()()()()()()()),i&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",y(3,13,t.loader$)),r(4),s("ngIf",y(7,15,t.data$)),r(15),T(t.channels()),r(10),s("ngxPermissionsOnly",w(21,Re,t.rolePriceEdit)),r(),T(t.channels()),r(2),s("ngIf",y(35,17,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",y(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[B,se,k,me,pe,de,Se,be,$,_e,R,L,Ne,Be,j,A,Ve,fe,Ce,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}"]})}}return n})();export{qt as CustomChannelPriceComponent};
@@ -1 +1 @@
1
- import{a as C}from"./chunk-7477X7LJ.js";import{a as h,b as y}from"./chunk-OE2JYQHN.js";import{a as r}from"./chunk-YPM6IC2W.js";import"./chunk-LEMNVA5V.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-PXB4YEY3.js";import{F as v,J as o,n}from"./chunk-GPEVUTDI.js";import{Eb as l,Fb as s,Oc as f,Wb as u,gc as c,hc as d,ic as i,ka as m,qb as p}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-OAVAVDIP.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-UUUVVJG4.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-DVE7IIN7.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};
1
+ import{a as C}from"./chunk-7477X7LJ.js";import{a as h,b as y}from"./chunk-OE2JYQHN.js";import{a as r}from"./chunk-PYD2QHHH.js";import"./chunk-67JBJ45X.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-PXB4YEY3.js";import{F as v,J as o,n}from"./chunk-GPEVUTDI.js";import{Eb as l,Fb as s,Oc as f,Wb as u,gc as c,hc as d,ic as i,ka as m,qb as p}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-YCPKCFMZ.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-LIWNKZGW.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-CGVOFFIH.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};
@@ -1,3 +1,3 @@
1
- import{e as te}from"./chunk-BUFEIJAI.js";import{a as ze,b as ge,c as Ge,d as Ve,e as me,f as Ke,g as Ae,h as qe,i as q,j as we,k as C}from"./chunk-V5WYSCVT.js";import{b as fe,c as ee,d as Ze}from"./chunk-PXB4YEY3.js";import{G as $e,L as Je,n as Ue,o as We,p as He}from"./chunk-GPEVUTDI.js";import{F as je,Fb as W,G as Ne,La as F,O as ue,T as Be,Va as U,Z as de,aa as _,ba as he,bd as Le,c as g,cd as Fe,ea as V,f as Y,gd as K,j as _e,ja as k,k as xe,ka as M,ma as E,n as z,o as Q,oa as h,p as x,pa as L,q as G,qa as Me,ua as pe,v as D,w as Oe}from"./chunk-T5ONJF63.js";import{a as le,i as I}from"./chunk-K2H6WANG.js";var Se=function(t){return t.dashboardView="Dashboard",t.report="Report",t.outlet="Outlet",t.price="Price",t.channelView="ChannelView",t.channelAdd="ChannelAdd",t.channelEdit="ChannelEdit",t.channelDelete="ChannelDelete",t.orderView="OrderView",t.downloadOrder="DownloadOrder",t}(Se||{});var Xe={production:!0,version:"5.41.4",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 Ye=(()=>{class t{static{this.SubmitConfig="/api/Channel/SubmitConfig"}static{this.PosAccountTest="/api/POSAccount/Test"}static{this.PosAccountRemove="/api/POSAccount/Remove"}static{this.PosAccountGetConfig="/api/ChannelLoader/GetConfig"}static{this.ChannelGetLastSyncByID="/api/Channel/GetLastSyncByID"}static{this.GetChannel="/api/Channel/GetChannel"}static{this.GetChannelLoader="/api/ChannelLoader/GetChannelLoader"}static{this.TestShopID="/api/Channel/TestShopID"}static{this.UpdateChannelIndex="/api/Channel/UpdateChannelIndex"}static{this.DeleteChannel="/api/Channel/DeleteChannel"}static{this.GetRegisterByOutletName="/api/Channel/GetRegistersByOutletOrder"}static{this.GetChannelRowCount="/api/Channel/GetCountChannel"}static{this.GetChannelWarehouse="/api/Channel/GetChannelWarehouseLocation"}static{this.UnSynchronizedWarehouse="/api/Channel/UnSynchronizedWarehouse"}static{this.GetChannelDetail="/api/ChannelLoader/GetChannelView"}static{this.GetOrderPreview="/api/Orders/Preview"}static{this.GetOrderPreviewV2="/api/Orders/PreviewV2"}static{this.GetDownloadOrder="/api/Orders/Download"}static{this.GetDownloadOrderV2="/api/Orders/DownloadV2"}static{this.ShopeeV2_URL="/api/ChannelAuthorization/ShopeeV2_URL"}static{this.Tiktok_URL="/api/ChannelAuthorization/Tiktok_URL"}static{this.Lazada_URL="/api/ChannelAuthorization/Lazada_URL"}static{this.AddTokopedia="/api/ChannelAdd/Tokopedia"}static{this.AddShopify="/api/ChannelAdd/AddShopify"}static{this.AddWoocommerce="/api/ChannelAdd/AddWooCommerce"}static{this.AddPlugo="/api/ChannelAdd/Plugo"}static{this.UploadPlugoProduct="/api/product/plugo/AddProduct"}static{this.RefreshToken="/api/RefreshToken"}static{this.RefreshInventory="/api/Inventory/RefreshInventory"}static{this.GetOrderApiLog="/api/Orders/GetOrderDetailByChannel"}static{this.GetEscrowDetail="/api/Orders/GetEscrowDetail"}static{this.DetachVariant="/api/product/DetachVariant"}static{this.GetProductApiLog="/api/Product/GetProductDetailBySKU"}}return t})();var St="firebase",vt="11.10.0";q(St,vt,"app");var H=new Le("ANGULARFIRE2_VERSION");var Qe=(t,a)=>{let e=a?[a]:qe(),n=[];return e.forEach(r=>{r.container.getProvider(t).instances.forEach(i=>{n.includes(i)||n.push(i)})}),n},ve=function(t){return t[t.SILENT=0]="SILENT",t[t.WARN=1]="WARN",t[t.VERBOSE=2]="VERBOSE",t}(ve||{}),_n=K()&&typeof Zone<"u"?ve.WARN:ve.SILENT;var ne=class{zone;delegate;constructor(a,e=xe){this.zone=a,this.delegate=e}now(){return this.delegate.now()}schedule(a,e,n){let r=this.zone,o=function(i){r?r.runGuarded(()=>{a.apply(this,[i])}):a.apply(this,[i])};return this.delegate.schedule(o,e,n)}},ke=(()=>{class t{outsideAngular;insideAngular;constructor(){let e=L(F);this.outsideAngular=e.runOutsideAngular(()=>new ne(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new ne(typeof Zone>"u"?void 0:Zone.current,_e))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var It=new Map,bt={activated:!1,tokenObservers:[]},Et={initialized:!1,enabled:!1};function T(t){return It.get(t)||Object.assign({},bt)}function rt(){return Et}var yt="https://content-firebaseappcheck.googleapis.com/v1";var Ct="exchangeDebugToken",et={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Hn=24*60*60*1e3;var Ee=class{constructor(a,e,n,r,o){if(this.operation=a,this.retryPolicy=e,this.getWaitDuration=n,this.lowerBound=r,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=r,r>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(a){return I(this,null,function*(){this.stop();try{this.pending=new ge,this.pending.promise.catch(e=>{}),yield Tt(this.getNextRun(a)),this.pending.resolve(),yield this.pending.promise,this.pending=new ge,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(a){if(a)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function Tt(t){return new Promise(a=>{setTimeout(a,t)})}var Pt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},j=new Ve("appCheck","AppCheck",Pt);function ot(t){if(!T(t).activated)throw j.create("use-before-activation",{appName:t.name})}function it(n,r){return I(this,arguments,function*({url:t,body:a},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let f=yield i.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let s={method:"POST",body:JSON.stringify(a),headers:o},l;try{l=yield fetch(t,s)}catch(f){throw j.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw j.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw j.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw j.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:c.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function at(t,a){let{projectId:e,appId:n,apiKey:r}=t.options;return{url:`${yt}/projects/${e}/apps/${n}:${Ct}?key=${r}`,body:{debug_token:a}}}var Dt="firebase-app-check-database",Rt=1,ye="firebase-app-check-store";var re=null;function _t(){return re||(re=new Promise((t,a)=>{try{let e=indexedDB.open(Dt,Rt);e.onsuccess=n=>{t(n.target.result)},e.onerror=n=>{var r;a(j.create("storage-open",{originalErrorMessage:(r=n.target.error)===null||r===void 0?void 0:r.message}))},e.onupgradeneeded=n=>{let r=n.target.result;switch(n.oldVersion){case 0:r.createObjectStore(ye,{keyPath:"compositeKey"})}}}catch(e){a(j.create("storage-open",{originalErrorMessage:e?.message}))}}),re)}function xt(t,a){return Ot(jt(t),a)}function Ot(t,a){return I(this,null,function*(){let n=(yield _t()).transaction(ye,"readwrite"),o=n.objectStore(ye).put({compositeKey:t,value:a});return new Promise((i,s)=>{o.onsuccess=l=>{i()},n.onerror=l=>{var c;s(j.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function jt(t){return`${t.options.appId}-${t.name}`}var J=new Ke("@firebase/app-check");function Ie(t,a){return Ge()?xt(t,a).catch(e=>{J.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function st(){return rt().enabled}function ct(){return I(this,null,function*(){let t=rt();if(t.enabled&&t.token)return t.token.promise;throw Error(`
1
+ import{e as te}from"./chunk-BUFEIJAI.js";import{a as ze,b as ge,c as Ge,d as Ve,e as me,f as Ke,g as Ae,h as qe,i as q,j as we,k as C}from"./chunk-V5WYSCVT.js";import{b as fe,c as ee,d as Ze}from"./chunk-PXB4YEY3.js";import{G as $e,L as Je,n as Ue,o as We,p as He}from"./chunk-GPEVUTDI.js";import{F as je,Fb as W,G as Ne,La as F,O as ue,T as Be,Va as U,Z as de,aa as _,ba as he,bd as Le,c as g,cd as Fe,ea as V,f as Y,gd as K,j as _e,ja as k,k as xe,ka as M,ma as E,n as z,o as Q,oa as h,p as x,pa as L,q as G,qa as Me,ua as pe,v as D,w as Oe}from"./chunk-T5ONJF63.js";import{a as le,i as I}from"./chunk-K2H6WANG.js";var Se=function(t){return t.dashboardView="Dashboard",t.report="Report",t.outlet="Outlet",t.price="Price",t.channelView="ChannelView",t.channelAdd="ChannelAdd",t.channelEdit="ChannelEdit",t.channelDelete="ChannelDelete",t.orderView="OrderView",t.downloadOrder="DownloadOrder",t}(Se||{});var Xe={production:!0,version:"5.41.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 Ye=(()=>{class t{static{this.SubmitConfig="/api/Channel/SubmitConfig"}static{this.PosAccountTest="/api/POSAccount/Test"}static{this.PosAccountRemove="/api/POSAccount/Remove"}static{this.PosAccountGetConfig="/api/ChannelLoader/GetConfig"}static{this.ChannelGetLastSyncByID="/api/Channel/GetLastSyncByID"}static{this.GetChannel="/api/Channel/GetChannel"}static{this.GetChannelLoader="/api/ChannelLoader/GetChannelLoader"}static{this.TestShopID="/api/Channel/TestShopID"}static{this.UpdateChannelIndex="/api/Channel/UpdateChannelIndex"}static{this.DeleteChannel="/api/Channel/DeleteChannel"}static{this.GetRegisterByOutletName="/api/Channel/GetRegistersByOutletOrder"}static{this.GetChannelRowCount="/api/Channel/GetCountChannel"}static{this.GetChannelWarehouse="/api/Channel/GetChannelWarehouseLocation"}static{this.UnSynchronizedWarehouse="/api/Channel/UnSynchronizedWarehouse"}static{this.GetChannelDetail="/api/ChannelLoader/GetChannelView"}static{this.GetOrderPreview="/api/Orders/Preview"}static{this.GetOrderPreviewV2="/api/Orders/PreviewV2"}static{this.GetDownloadOrder="/api/Orders/Download"}static{this.GetDownloadOrderV2="/api/Orders/DownloadV2"}static{this.ShopeeV2_URL="/api/ChannelAuthorization/ShopeeV2_URL"}static{this.Tiktok_URL="/api/ChannelAuthorization/Tiktok_URL"}static{this.Lazada_URL="/api/ChannelAuthorization/Lazada_URL"}static{this.AddTokopedia="/api/ChannelAdd/Tokopedia"}static{this.AddShopify="/api/ChannelAdd/AddShopify"}static{this.AddWoocommerce="/api/ChannelAdd/AddWooCommerce"}static{this.AddPlugo="/api/ChannelAdd/Plugo"}static{this.UploadPlugoProduct="/api/product/plugo/AddProduct"}static{this.RefreshToken="/api/RefreshToken"}static{this.RefreshInventory="/api/Inventory/RefreshInventory"}static{this.GetOrderApiLog="/api/Orders/GetOrderDetailByChannel"}static{this.GetEscrowDetail="/api/Orders/GetEscrowDetail"}static{this.DetachVariant="/api/product/DetachVariant"}static{this.GetProductApiLog="/api/Product/GetProductDetailBySKU"}}return t})();var St="firebase",vt="11.10.0";q(St,vt,"app");var H=new Le("ANGULARFIRE2_VERSION");var Qe=(t,a)=>{let e=a?[a]:qe(),n=[];return e.forEach(r=>{r.container.getProvider(t).instances.forEach(i=>{n.includes(i)||n.push(i)})}),n},ve=function(t){return t[t.SILENT=0]="SILENT",t[t.WARN=1]="WARN",t[t.VERBOSE=2]="VERBOSE",t}(ve||{}),_n=K()&&typeof Zone<"u"?ve.WARN:ve.SILENT;var ne=class{zone;delegate;constructor(a,e=xe){this.zone=a,this.delegate=e}now(){return this.delegate.now()}schedule(a,e,n){let r=this.zone,o=function(i){r?r.runGuarded(()=>{a.apply(this,[i])}):a.apply(this,[i])};return this.delegate.schedule(o,e,n)}},ke=(()=>{class t{outsideAngular;insideAngular;constructor(){let e=L(F);this.outsideAngular=e.runOutsideAngular(()=>new ne(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new ne(typeof Zone>"u"?void 0:Zone.current,_e))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var It=new Map,bt={activated:!1,tokenObservers:[]},Et={initialized:!1,enabled:!1};function T(t){return It.get(t)||Object.assign({},bt)}function rt(){return Et}var yt="https://content-firebaseappcheck.googleapis.com/v1";var Ct="exchangeDebugToken",et={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Hn=24*60*60*1e3;var Ee=class{constructor(a,e,n,r,o){if(this.operation=a,this.retryPolicy=e,this.getWaitDuration=n,this.lowerBound=r,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=r,r>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(a){return I(this,null,function*(){this.stop();try{this.pending=new ge,this.pending.promise.catch(e=>{}),yield Tt(this.getNextRun(a)),this.pending.resolve(),yield this.pending.promise,this.pending=new ge,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(a){if(a)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function Tt(t){return new Promise(a=>{setTimeout(a,t)})}var Pt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},j=new Ve("appCheck","AppCheck",Pt);function ot(t){if(!T(t).activated)throw j.create("use-before-activation",{appName:t.name})}function it(n,r){return I(this,arguments,function*({url:t,body:a},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let f=yield i.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let s={method:"POST",body:JSON.stringify(a),headers:o},l;try{l=yield fetch(t,s)}catch(f){throw j.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw j.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw j.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw j.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:c.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function at(t,a){let{projectId:e,appId:n,apiKey:r}=t.options;return{url:`${yt}/projects/${e}/apps/${n}:${Ct}?key=${r}`,body:{debug_token:a}}}var Dt="firebase-app-check-database",Rt=1,ye="firebase-app-check-store";var re=null;function _t(){return re||(re=new Promise((t,a)=>{try{let e=indexedDB.open(Dt,Rt);e.onsuccess=n=>{t(n.target.result)},e.onerror=n=>{var r;a(j.create("storage-open",{originalErrorMessage:(r=n.target.error)===null||r===void 0?void 0:r.message}))},e.onupgradeneeded=n=>{let r=n.target.result;switch(n.oldVersion){case 0:r.createObjectStore(ye,{keyPath:"compositeKey"})}}}catch(e){a(j.create("storage-open",{originalErrorMessage:e?.message}))}}),re)}function xt(t,a){return Ot(jt(t),a)}function Ot(t,a){return I(this,null,function*(){let n=(yield _t()).transaction(ye,"readwrite"),o=n.objectStore(ye).put({compositeKey:t,value:a});return new Promise((i,s)=>{o.onsuccess=l=>{i()},n.onerror=l=>{var c;s(j.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function jt(t){return`${t.options.appId}-${t.name}`}var J=new Ke("@firebase/app-check");function Ie(t,a){return Ge()?xt(t,a).catch(e=>{J.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function st(){return rt().enabled}function ct(){return I(this,null,function*(){let t=rt();if(t.enabled&&t.token)return t.token.promise;throw Error(`
2
2
  Can't get debug token in production mode.
3
3
  `)})}var Nt={error:"UNKNOWN_ERROR"};function Bt(t){return ze.encodeString(JSON.stringify(t),!1)}function Ce(t,a=!1,e=!1){return I(this,null,function*(){let n=t.app;ot(n);let r=T(n),o=r.token,i;if(o&&!Z(o)&&(r.token=void 0,o=void 0),!o){let c=yield r.cachedTokenPromise;c&&(Z(c)?o=c:yield Ie(n,void 0))}if(!a&&o&&Z(o))return{token:o.token};let s=!1;if(st())try{r.exchangeTokenPromise||(r.exchangeTokenPromise=it(at(n,yield ct()),t.heartbeatServiceProvider).finally(()=>{r.exchangeTokenPromise=void 0}),s=!0);let c=yield r.exchangeTokenPromise;return yield Ie(n,c),r.token=c,{token:c.token}}catch(c){return c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?J.warn(c.message):e&&J.error(c),be(c)}try{r.exchangeTokenPromise||(r.exchangeTokenPromise=r.provider.getToken().finally(()=>{r.exchangeTokenPromise=void 0}),s=!0),o=yield T(n).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?J.warn(c.message):e&&J.error(c),i=c}let l;return o?i?Z(o)?l={token:o.token,internalError:i}:l=be(i):(l={token:o.token},r.token=o,yield Ie(n,o)):l=be(i),s&&Ut(n,l),l})}function Mt(t){return I(this,null,function*(){let a=t.app;ot(a);let{provider:e}=T(a);if(st()){let n=yield ct(),{token:r}=yield it(at(a,n),t.heartbeatServiceProvider);return{token:r}}else{let{token:n}=yield e.getToken();return{token:n}}})}function Lt(t,a,e,n){let{app:r}=t,o=T(r),i={next:e,error:n,type:a};if(o.tokenObservers=[...o.tokenObservers,i],o.token&&Z(o.token)){let s=o.token;Promise.resolve().then(()=>{e({token:s.token}),tt(t)}).catch(()=>{})}o.cachedTokenPromise.then(()=>tt(t))}function lt(t,a){let e=T(t),n=e.tokenObservers.filter(r=>r.next!==a);n.length===0&&e.tokenRefresher&&e.tokenRefresher.isRunning()&&e.tokenRefresher.stop(),e.tokenObservers=n}function tt(t){let{app:a}=t,e=T(a),n=e.tokenRefresher;n||(n=Ft(t),e.tokenRefresher=n),!n.isRunning()&&e.isTokenAutoRefreshEnabled&&n.start()}function Ft(t){let{app:a}=t;return new Ee(()=>I(null,null,function*(){let e=T(a),n;if(e.token?n=yield Ce(t,!0):n=yield Ce(t),n.error)throw n.error;if(n.internalError)throw n.internalError}),()=>!0,()=>{let e=T(a);if(e.token){let n=e.token.issuedAtTimeMillis+(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)*.5+3e5,r=e.token.expireTimeMillis-5*60*1e3;return n=Math.min(n,r),Math.max(0,n-Date.now())}else return 0},et.RETRIAL_MIN_WAIT,et.RETRIAL_MAX_WAIT)}function Ut(t,a){let e=T(t).tokenObservers;for(let n of e)try{n.type==="EXTERNAL"&&a.error!=null?n.error(a.error):n.next(a)}catch{}}function Z(t){return t.expireTimeMillis-Date.now()>0}function be(t){return{token:Bt(Nt),error:t}}var Te=class{constructor(a,e){this.app=a,this.heartbeatServiceProvider=e}_delete(){let{tokenObservers:a}=T(this.app);for(let e of a)lt(this.app,e.next);return Promise.resolve()}};function Wt(t,a){return new Te(t,a)}function Ht(t){return{getToken:a=>Ce(t,a),getLimitedUseToken:()=>Mt(t),addTokenListener:a=>Lt(t,"INTERNAL",a),removeTokenListener:a=>lt(t.app,a)}}var $t="@firebase/app-check",zt="0.10.1";var Gt="app-check",nt="app-check-internal";function Vt(){Ae(new me(Gt,t=>{let a=t.getProvider("app").getImmediate(),e=t.getProvider("heartbeat");return Wt(a,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,a,e)=>{t.getProvider(nt).initialize()})),Ae(new me(nt,t=>{let a=t.getProvider("app-check").getImmediate();return Ht(a)},"PUBLIC").setInstantiationMode("EXPLICIT")),q($t,zt)}Vt();var Kt="app-check";var oe=class{constructor(){return Qe(Kt)}};var qt=["localhost","0.0.0.0","127.0.0.1"],rr=typeof window<"u"&&qt.includes(window.location.hostname);var y=function(t){return t.USER="user",t.CHANNELS="channels",t.AUTHORIZATION="Authorization",t.INTERCOM="Intercom",t}(y||{});var ut=(()=>{class t{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 r=e.split(".")[0].replace("-","+").replace("_","/"),o=JSON.parse(window.atob(r)),s=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(s));return l.header=o,l}catch{return!1}}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Xt="firebase",Yt="11.10.0";C.registerVersion(Xt,Yt,"app-compat");var Qt=["ngOnDestroy"],ht=(t,a,e,n={})=>new Proxy(t,{get:(r,o)=>e.runOutsideAngular(()=>{if(t[o])return n?.spy?.get&&n.spy.get(o,t[o]),t[o];if(Qt.indexOf(o)>-1)return()=>{};let i=a.toPromise().then(s=>{let l=s?.[o];return typeof l=="function"?l.bind(s):l?.then?l.then(c=>e.run(()=>c)):e.run(()=>l)});return new Proxy(()=>{},{get:(s,l)=>i[l],apply:(s,l,c)=>i.then(d=>{let u=d?.(...c);return n?.spy?.apply&&n.spy.apply(o,c,u),u})})})});var ie=class{constructor(a){return a}},ae=new E("angularfire2.app.options"),se=new E("angularfire2.app.name");function Pe(t,a,e){let n=typeof e=="string"&&e||"[DEFAULT]",r=typeof e=="object"&&e||{};r.name=r.name||n;let i=C.apps.filter(s=>s&&s.name===r.name)[0]||a.runOutsideAngular(()=>C.initializeApp(t,r));try{if(JSON.stringify(t)!==JSON.stringify(i.options)){let s=!!module.hot;en("error",`${i.name} Firebase App already initialized with different options${s?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ie(i)}var en=(t,...a)=>{K()&&typeof console<"u"&&console[t](...a)},tn={provide:ie,useFactory:Pe,deps:[ae,F,[new Me,se]]},Xo=(()=>{class t{static initializeApp(e,n){return{ngModule:t,providers:[{provide:ae,useValue:e},{provide:se,useValue:n}]}}constructor(e){C.registerVersion("angularfire",H.full,"core"),C.registerVersion("angularfire",H.full,"app-compat"),C.registerVersion("angular",Fe.full,e.toString())}static \u0275fac=function(n){return new(n||t)(h(U))};static \u0275mod=W({type:t});static \u0275inj=M({providers:[tn]})}return t})();function pt(t,a,e,n,r){let[,o,i]=globalThis.\u0275AngularfireInstanceCache.find(s=>s[0]===t)||[];if(o)return nn(r,i)||(dt("error",`${a} was already initialized on the ${e} Firebase App with different settings.${rn?" You may need to reload as Firebase is not HMR aware.":""}`),dt("warn",{is:r,was:i})),o;{let s=n();return globalThis.\u0275AngularfireInstanceCache.push([t,s,r]),s}}function nn(t,a){try{return t.toString()===a.toString()}catch{return t===a}}var rn=typeof module<"u"&&!!module.hot,dt=(t,...a)=>{K()&&typeof console<"u"&&console[t](...a)};globalThis.\u0275AngularfireInstanceCache||=[];var on=new E("angularfire2.auth.use-emulator"),an=new E("angularfire2.auth.settings"),sn=new E("angularfire2.auth.tenant-id"),cn=new E("angularfire2.auth.langugage-code"),ln=new E("angularfire2.auth.use-device-language"),un=new E("angularfire.auth.persistence"),dn=(t,a,e,n,r,o,i,s)=>pt(`${t.name}.auth`,"AngularFireAuth",t.name,()=>{let l=a.runOutsideAngular(()=>t.auth());if(e&&l.useEmulator(...e),n&&(l.tenantId=n),l.languageCode=r,o&&l.useDeviceLanguage(),i)for(let[c,d]of Object.entries(i))l.settings[c]=d;return s&&l.setPersistence(s),l},[e,n,r,o,i,s]),De=(()=>{class t{injector=L(pe);authState;idToken;user;idTokenResult;credential;constructor(e,n,r,o,i,s,l,c,d,u,p,f){let $=new Y,N=G(void 0).pipe(z(i.outsideAngular),_(()=>o.runOutsideAngular(()=>import("./chunk-IIJMZKPL.js"))),D(()=>Pe(e,o,n)),D(P=>dn(P,o,s,c,d,u,l,p)),de({bufferSize:1,refCount:!1}));if(He(r))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=G(null);else{N.pipe(Be()).subscribe();let P=N.pipe(_(A=>A.getRedirectResult().then(R=>R,()=>null)),Je(this.injector),de({bufferSize:1,refCount:!1})),X=N.pipe(_(A=>new g(R=>({unsubscribe:o.runOutsideAngular(()=>A.onAuthStateChanged(B=>R.next(B),B=>R.error(B),()=>R.complete()))})))),ce=N.pipe(_(A=>new g(R=>({unsubscribe:o.runOutsideAngular(()=>A.onIdTokenChanged(B=>R.next(B),B=>R.error(B),()=>R.complete()))}))));this.authState=P.pipe(he(X),Q(i.outsideAngular),z(i.insideAngular)),this.user=P.pipe(he(ce),Q(i.outsideAngular),z(i.insideAngular)),this.idToken=this.user.pipe(_(A=>A?x(A.getIdToken()):G(null))),this.idTokenResult=this.user.pipe(_(A=>A?x(A.getIdTokenResult()):G(null))),this.credential=je(P,$,this.authState.pipe(Ne(A=>!A))).pipe(D(A=>A?.user?A:null),Q(i.outsideAngular),z(i.insideAngular))}return ht(this,N,o,{spy:{apply:(P,X,ce)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&ce.then(A=>$.next(A))}}})}static \u0275fac=function(n){return new(n||t)(h(ae),h(se,8),h(U),h(F),h(ke),h(on,8),h(an,8),h(sn,8),h(cn,8),h(ln,8),h(un,8),h(oe,8))};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"any"})}return t})(),pi=(()=>{class t{constructor(){C.registerVersion("angularfire",H.full,"auth-compat")}static \u0275fac=function(n){return new(n||t)};static \u0275mod=W({type:t});static \u0275inj=M({providers:[De]})}return t})();function m(t,a,e,n){return new Promise((r,o)=>{t||o("IndexedDB not available");let i=t.open(a,e),s;i.onsuccess=l=>{s=i.result,r(s)},i.onerror=l=>{o(`IndexedDB error: ${i.error}`)},typeof n=="function"&&(i.onupgradeneeded=l=>{n(l,s)})})}function ft(t,a,e,n,r){if(!t)return;let o=t.open(a,e);o.onupgradeneeded=i=>{let s=i.target.result;n.forEach(c=>{if(!s.objectStoreNames.contains(c.store)){let d=s.createObjectStore(c.store,c.storeConfig);c.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let l=r&&r();l&&Object.keys(l).map(c=>parseInt(c,10)).filter(c=>c>i.oldVersion).sort((c,d)=>c-d).forEach(c=>{l[c](s,o.transaction)}),s.close()},o.onsuccess=i=>{i.target.result.close()}}function pn(t,a,e){if(!t||!a||!e)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(n=>{try{let r=a+1,o=indexedDB.open(t,r);o.onupgradeneeded=i=>{let s=i.target.result;s.deleteObjectStore(e),s.close(),console.log("onupgradeneeded"),n.next(!0),n.complete()},o.onerror=i=>n.error(i)}catch(r){n.error(r)}})}function fn(t,a){return t.objectStoreNames.contains(a)}function b(t,a,e){t||e("You need to use the openDatabase function to create a database before you query it!"),fn(t,a)||e(`objectStore does not exists: ${a}`)}function S(t,a){let e=t.transaction(a.storeName,a.dbMode);return e.onerror=a.error,e.onabort=a.abort,e}function v(t,a,e,n){return{storeName:a,dbMode:t,error:r=>{e(r)},abort:r=>{e(r)}}}var w=function(t){return t.readonly="readonly",t.readwrite="readwrite",t}(w||{}),gt=new E(null),Re=(()=>{class t{constructor(e,n){if(this.dbConfig=e,this.platformId=n,!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!e.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=We(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,ft(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),m(this.indexedDB,e.name).then(r=>{r.version!==e.version&&(this.dbConfig.version=r.version)}))}createObjectStore(e,n){let r=[e];ft(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,r,n)}add(e,n,r){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let l=S(i,v(w.readwrite,e,d=>o.error(d))).objectStore(e),c=r?l.add(n,r):l.add(n);c.onsuccess=d=>I(this,null,function*(){let u=d.target.result,p=l.get(u);p.onsuccess=f=>{o.next(f.target.result),o.complete()}})}).catch(i=>o.error(i))})}bulkAdd(e,n){let r=new Promise((o,i)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=S(s,v(w.readwrite,e,o,i)).objectStore(e),d=n.map(u=>new Promise((p,f)=>{let $=u.key;delete u.key;let N=$?c.add(u,$):c.add(u);N.onsuccess=P=>{let X=P.target.result;p(X)}}));o(Promise.all(d))}).catch(s=>i(s))});return x(r)}bulkDelete(e,n){let r=n.map(o=>new Promise((i,s)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(l=>{let c=S(l,v(w.readwrite,e,s,i));c.objectStore(e).delete(o),c.oncomplete=()=>{this.getAll(e).pipe(ue(1)).subscribe(u=>{i(u)})}}).catch(l=>s(l))}));return x(Promise.all(r))}getByKey(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{let l=S(o,v(w.readonly,e,r.error)).objectStore(e).get(n);l.onsuccess=c=>{r.next(c.target.result),r.complete()},l.onerror=c=>{r.error(c)}}).catch(o=>r.error(o))})}bulkGet(e,n){let r=n.map(o=>this.getByKey(e,o));return new g(o=>{Oe(r).subscribe(i=>{o.next(i),o.complete()})})}getByID(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,c=>r.error(c));let l=S(o,v(w.readonly,e,r.error,r.next)).objectStore(e).get(n);l.onsuccess=c=>{r.next(c.target.result)}}).catch(o=>r.error(o))})}getByIndex(e,n,r){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,e,u=>o.error(u));let d=S(i,v(w.readonly,e,o.error)).objectStore(e).index(n).get(r);d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}getAll(e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{b(r,e,l=>n.error(l));let s=S(r,v(w.readonly,e,n.error,n.next)).objectStore(e).getAll();s.onerror=l=>{n.error(l)},s.onsuccess=({target:{result:l}})=>{n.next(l),n.complete()}}).catch(r=>n.error(r))})}update(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,c=>r.error(c));let s=S(o,v(w.readwrite,e,c=>r.error(c))).objectStore(e),l=s.put(n);l.onsuccess=c=>I(this,null,function*(){let d=c.target.result,u=s.get(d);u.onsuccess=p=>{r.next(p.target.result),r.complete()}})}).catch(o=>r.error(o))})}delete(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,l=>r.error(l));let i=S(o,v(w.readwrite,e,l=>r.error(l)));i.objectStore(e).delete(n),i.oncomplete=()=>{this.getAll(e).pipe(ue(1)).subscribe(l=>{r.next(l),r.complete()})}}).catch(o=>r.error(o))})}deleteByKey(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,l=>r.error(l));let i=S(o,v(w.readwrite,e,l=>r.error(l))),s=i.objectStore(e);i.oncomplete=()=>{r.next(!0),r.complete()},s.delete(n)}).catch(o=>r.error(o))})}clear(e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{b(r,e,s=>n.error(s));let o=S(r,v(w.readwrite,e,s=>n.error(s)));o.objectStore(e).clear(),o.oncomplete=()=>{n.next(!0),n.complete()}}).catch(r=>n.error(r))})}deleteDatabase(){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>I(this,null,function*(){yield n.close();let r=this.indexedDB.deleteDatabase(this.dbConfig.name);r.onsuccess=()=>{e.next(!0),e.complete()},r.onerror=o=>e.error(o),r.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(n=>e.error(n))})}openCursor(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,c=>r.error(c));let s=S(o,v(w.readonly,e,r.error)).objectStore(e),l=n===void 0?s.openCursor():s.openCursor(n);l.onsuccess=c=>{r.next(c),r.complete()}}).catch(o=>r.error(o))})}openCursorByIndex(e,n,r,o=w.readonly){let i=new Y;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{b(s,e,p=>{i.error(p)});let u=S(s,v(o,e,p=>{i.error(p)},()=>{i.next()})).objectStore(e).index(n).openCursor(r);u.onsuccess=p=>{i.next(p)}}).catch(s=>i.error(s)),i}getAllByIndex(e,n,r){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{b(s,e,p=>i.error(p));let u=S(s,v(w.readonly,e,i.error)).objectStore(e).index(n).openCursor(r);u.onsuccess=p=>{let f=p.target.result;f?(o.push(f.value),f.continue()):(i.next(o),i.complete())}}).catch(s=>i.error(s))})}getAllKeysByIndex(e,n,r){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{b(s,e,p=>i.error(p));let u=S(s,v(w.readonly,e,i.error)).objectStore(e).index(n).openKeyCursor(r);u.onsuccess=p=>{let f=p.target.result;f?(o.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(i.next(o),i.complete())}}).catch(s=>i.error(s))})}count(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{b(o,e,c=>r.error(c));let l=S(o,v(w.readonly,e,r.error)).objectStore(e).count(n);l.onerror=c=>r.error(c),l.onsuccess=c=>{r.next(c.target.result),r.complete()}}).catch(o=>r.error(o))})}countByIndex(e,n,r){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,e,u=>o.error(u));let d=S(i,v(w.readonly,e,o.error)).objectStore(e).index(n).count(r);d.onerror=u=>o.error(u),d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}deleteObjectStore(e){return pn(this.dbConfig.name,++this.dbConfig.version,e)}}return t.\u0275fac=function(e){return new(e||t)(h(gt),h(U))},t.\u0275prov=k({token:t,factory:t.\u0275fac}),t})(),ki=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[Re,{provide:gt,useValue:e}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=W({type:t}),t.\u0275inj=M({imports:[[Ue]]}),t})();var mt=(()=>{class t{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let r=this.getKey(n);return this.db.add(this.DATABASE,e,r).pipe(D(o=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case fe.Lazada:n="Lazada";break;case fe.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}static{this.\u0275fac=function(n){return new(n||t)(h(Re))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var At=(()=>{class t{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=le(le({},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 ee.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var wt=(()=>{class t{constructor(){this.httpService=L(te)}refreshToken(){return this.httpService.get(Ye.RefreshToken).pipe(V(e=>{this.updateTokenInLocalStorage(e)}))}updateTokenInLocalStorage(e){this.saveUserToLocalStorage(e),this.saveChannelsToLocalStorage(e.Channels)}saveUserToLocalStorage(e){let n=JSON.stringify(e);localStorage.setItem(y.USER,n)}getUser(){let e=localStorage.getItem(y.USER);return e?JSON.parse(e):null}saveChannelsToLocalStorage(e){let n=JSON.stringify(e);localStorage.setItem(y.CHANNELS,n)}getChannels(){let e=localStorage.getItem(y.CHANNELS);return e?JSON.parse(e):[]}clearStorage(){localStorage.removeItem(y.USER),localStorage.removeItem(y.CHANNELS)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Hi=(()=>{class t{constructor(e,n,r,o,i,s,l,c){this.httpService=e,this.tokenDecodeService=n,this.afAuth=r,this.ngxPermission=o,this.localDataService=i,this.router=s,this.intercomService=l,this.tokenService=c}login(e){return this.httpService.post("/api/token/Login",e).pipe(V(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(Xe.news).pipe(D(e=>e?.items?.map(n=>n?.properties)))}loginWithGoogle(e,n){e.preventDefault();let r=new we;return r.setCustomParameters({prompt:"select_account"}),x(this.afAuth.signInWithPopup(r)).pipe(D(o=>o.credential),D(o=>o.idToken),_(o=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:o,Host:n}))),V(o=>{this.setLocalStorage(o,n,null),this.loadPermissions()}))}setLocalStorage(e,n,r){this.tokenService.updateTokenInLocalStorage(e),localStorage.setItem(y.AUTHORIZATION,JSON.stringify({Host:n,username:r})),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem(y.USER);if(ee.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}redirectUrl(){return I(this,null,function*(){let e=null;return(yield this.ngxPermission.hasPermission(Se.dashboardView))?e="/menu/dashboard":e="/menu/products/status",e})}getChannels(){return this.tokenService.getChannels()}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=this.tokenService.getUser(),n=new Date;if(e!=null){let r=new Date(e.Token.expiredAt);return n<r?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem(y.AUTHORIZATION);this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.tokenService.clearStorage(),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}static{this.\u0275fac=function(n){return new(n||t)(h(te),h(ut),h(De),h(Ze),h(mt),h($e),h(At),h(wt))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();export{Se as a,Xe as b,y as c,ut as d,Xo as e,pi as f,ki as g,mt as h,At as i,Ye as j,wt as k,Hi as l};