marketplacepos 6.31.0 → 6.31.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/Marketplace/{chunk-TTNG3MHW.js → chunk-3YEPZOWW.js} +1 -1
  2. package/Marketplace/{chunk-ZWW4JHZV.js → chunk-45SZYPN7.js} +1 -1
  3. package/Marketplace/{chunk-S5FQJLG5.js → chunk-46MLNUK6.js} +1 -1
  4. package/Marketplace/{chunk-7LJVTZAG.js → chunk-4NLZR5G6.js} +1 -1
  5. package/Marketplace/{chunk-QJ4D3KFN.js → chunk-54E2GKVP.js} +1 -1
  6. package/Marketplace/{chunk-E2UCWDAO.js → chunk-56UQOJHL.js} +1 -1
  7. package/Marketplace/{chunk-JOQC5TET.js → chunk-5GMAPKUT.js} +1 -1
  8. package/Marketplace/{chunk-MV6SQJHJ.js → chunk-6MA3X2DS.js} +1 -1
  9. package/Marketplace/{chunk-F5RRHQJJ.js → chunk-6VEA6GG4.js} +1 -1
  10. package/Marketplace/{chunk-N2HFKC4A.js → chunk-743ML6A7.js} +1 -1
  11. package/Marketplace/{chunk-YGVY3X52.js → chunk-7J6UH2BT.js} +1 -1
  12. package/Marketplace/{chunk-MYDVMG67.js → chunk-ASKT24WA.js} +1 -1
  13. package/Marketplace/{chunk-NWPQV6XP.js → chunk-B7PRYIER.js} +1 -1
  14. package/Marketplace/{chunk-M63VP7TS.js → chunk-BDL6VX7O.js} +1 -1
  15. package/Marketplace/{chunk-OH43UVFL.js → chunk-BGTQQCDH.js} +1 -1
  16. package/Marketplace/{chunk-HZKA6DGO.js → chunk-BY4A7KFT.js} +1 -1
  17. package/Marketplace/{chunk-UJFPQVWX.js → chunk-CMN6WQRQ.js} +1 -1
  18. package/Marketplace/{chunk-KI4TY5N5.js → chunk-DEC7P5YC.js} +1 -1
  19. package/Marketplace/{chunk-HD5N3GUK.js → chunk-DENZQL5X.js} +1 -1
  20. package/Marketplace/{chunk-PXM25OET.js → chunk-DGZJ7ASC.js} +1 -1
  21. package/Marketplace/{chunk-H6XSK7GB.js → chunk-DVTJ5IUH.js} +1 -1
  22. package/Marketplace/{chunk-II7DLNVF.js → chunk-FUPT6QVP.js} +1 -1
  23. package/Marketplace/{chunk-TW6YICUO.js → chunk-H3AJTV7H.js} +1 -1
  24. package/Marketplace/{chunk-BMX7EBGZ.js → chunk-HDPVYUNM.js} +1 -1
  25. package/Marketplace/{chunk-FFU3JAIJ.js → chunk-JURDZGFU.js} +1 -1
  26. package/Marketplace/{chunk-UZQ5WKV4.js → chunk-JVVN7I3K.js} +1 -1
  27. package/Marketplace/{chunk-AEACJ7IT.js → chunk-KCPD4Z3X.js} +1 -1
  28. package/Marketplace/{chunk-ULBNBY4R.js → chunk-KS63PJZE.js} +1 -1
  29. package/Marketplace/{chunk-SSK4EUDM.js → chunk-KYZGVVJM.js} +1 -1
  30. package/Marketplace/{chunk-3I7S5TZI.js → chunk-LALJHEQ4.js} +1 -1
  31. package/Marketplace/{chunk-EBCT2DN2.js → chunk-LHRO7M7M.js} +1 -1
  32. package/Marketplace/{chunk-DEC32FB2.js → chunk-LTFRIYVD.js} +1 -1
  33. package/Marketplace/{chunk-Q5H2PXZY.js → chunk-NFKQXOQD.js} +1 -1
  34. package/Marketplace/{chunk-LFRV2RDU.js → chunk-NZ77VVLC.js} +1 -1
  35. package/Marketplace/{chunk-46ZRW5ZA.js → chunk-OFLYY6SE.js} +1 -1
  36. package/Marketplace/{chunk-TWWHVZXS.js → chunk-OQ3SGN6B.js} +1 -1
  37. package/Marketplace/{chunk-ATZHWHIP.js → chunk-PKEJBTNO.js} +1 -1
  38. package/Marketplace/{chunk-O6RJOU3C.js → chunk-RQUENCBZ.js} +1 -1
  39. package/Marketplace/{chunk-OESZXCMJ.js → chunk-SHPCIBEX.js} +1 -1
  40. package/Marketplace/{chunk-Z445HYT7.js → chunk-SS5GOXIZ.js} +1 -1
  41. package/Marketplace/{chunk-IPMCCZZW.js → chunk-T7PNPUCK.js} +1 -1
  42. package/Marketplace/{chunk-BXBABE4R.js → chunk-UCBUYDAK.js} +1 -1
  43. package/Marketplace/{chunk-GJAJLHPZ.js → chunk-UZG65BH3.js} +1 -1
  44. package/Marketplace/{chunk-VDNUDZOQ.js → chunk-VB4EKTTU.js} +1 -1
  45. package/Marketplace/{chunk-LAIRVUNP.js → chunk-VDFAJSCS.js} +1 -1
  46. package/Marketplace/{chunk-7P7PKIQT.js → chunk-VL3JT6OI.js} +1 -1
  47. package/Marketplace/{chunk-6T2JNOIL.js → chunk-VSOZTJLX.js} +2 -2
  48. package/Marketplace/{chunk-UR7KQQE3.js → chunk-VU5XZQJM.js} +1 -1
  49. package/Marketplace/{chunk-ZKMREYB7.js → chunk-W7G4WIRL.js} +1 -1
  50. package/Marketplace/{chunk-BRMEWMES.js → chunk-X77IQNIG.js} +1 -1
  51. package/Marketplace/{chunk-R2KLMLVT.js → chunk-XTQO7LQT.js} +1 -1
  52. package/Marketplace/{chunk-TYR2ZFLG.js → chunk-Y5TU2325.js} +1 -1
  53. package/Marketplace/{chunk-5SV6WZXH.js → chunk-YHFFMWT4.js} +1 -1
  54. package/Marketplace/{chunk-42YIIYI7.js → chunk-YKBRWOO3.js} +1 -1
  55. package/Marketplace/{chunk-FYUBZFJK.js → chunk-YN6BGZZ6.js} +1 -1
  56. package/Marketplace/{chunk-JMO7SQDX.js → chunk-ZNL4R4ZY.js} +1 -1
  57. package/Marketplace/{chunk-N77Q2Q3K.js → chunk-ZNUU6KNL.js} +1 -1
  58. package/Marketplace/{chunk-33TDKUXQ.js → chunk-ZPKMQUVX.js} +1 -1
  59. package/Marketplace/index.html +2 -2
  60. package/Marketplace/{main-W5NHRKAQ.js → main-STZJXPG6.js} +2 -2
  61. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as we}from"./chunk-SEB36UUD.js";import{a as Ie,b as Me}from"./chunk-IBZCREPJ.js";import{a as ye,b as Se}from"./chunk-Y5RUW5VE.js";import{a as ve}from"./chunk-7ES2Z445.js";import{a as he,b as ue,c as Ce,g as xe,i as fe,j as be}from"./chunk-NIRJAWTX.js";import{a as ge}from"./chunk-RDXDKWLL.js";import{b as Te}from"./chunk-A32JPG5P.js";import{a as ae}from"./chunk-JY726AM5.js";import{b as pe}from"./chunk-47Z3CNAW.js";import{a as E}from"./chunk-ZSUWHVKX.js";import{h as de}from"./chunk-VDNUDZOQ.js";import{a as le,b as re,c as ce}from"./chunk-7R55YTL6.js";import{c as Z}from"./chunk-NNVT5X6O.js";import{b as se,h as me,m as _e,z as V}from"./chunk-BUBQQEYA.js";import{D as oe,y as ie}from"./chunk-4NAKX6WQ.js";import{Ca as B,E as G,Eb as D,Ga as b,Jc as A,Kb as T,Lc as L,Nc as Y,Oc as m,Pc as M,Qc as F,Sc as j,Tc as z,Uc as W,Yc as J,_ as K,bc as p,bd as k,cd as Q,d as q,dc as g,ec as I,fc as X,gc as y,hc as S,ic as s,jc as l,kb as v,kc as d,kd as O,lc as w,ld as H,mb as r,md as ee,na as f,od as te,rc as R,sc as x,sd as ne,ua as h,va as u,wd as P,xc as C,zc as a}from"./chunk-ZPV56E2J.js";import{a as U,b as $}from"./chunk-66YHNWRR.js";function ke(t,c){if(t&1){let e=x();l(0,"span")(1,"mat-checkbox",4),C("change",function(n){h(e);let o=a();return u(o.onSelectAll(n==null?null:n.checked))}),l(2,"h5",5),m(3,"Select All"),d()()()}}function Ee(t,c){if(t&1){let e=x();l(0,"li")(1,"mat-checkbox",6),C("change",function(n){let o=h(e).$implicit,_=a();return u(_.onChannelChange(o,n.checked))}),l(2,"div",7),w(3,"img",8),l(4,"h5",9),m(5),d()()()()}if(t&2){let e=c.$implicit;r(),s("checked",e.selected),r(2),s("src",e.Img,v),r(2),M(e.Name)}}var mt=(()=>{class t{constructor(){this.data=f(ue),this.dialogRef=f(he),this.channels=b([]),this.getSelectedChannel=ne(()=>this.channels().filter(e=>e.selected)),this.selectedItems=this.data.selectedItems,this.channels.set(this.data.channels)}ngOnInit(){this.initModalConfig()}initModalConfig(){let e=this.data.title?this.data.title:"Updating Inventory";this.modalConfig=new fe,this.modalConfig.title=e}onSelectAll(e){this.channels.update(i=>i.map(n=>$(U({},n),{selected:e})))}onOk(){this.dialogRef.close(this.channels())}onClose(){this.dialogRef.close()}onChannelChange(e,i){this.channels.update(n=>n.map(o=>o.ID===e.ID?$(U({},o),{selected:i}):o))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-modal-update-channels"]],decls:7,vars:3,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[2,"overflow-y","auto","max-height","28rem"],[1,"no-bullet",2,"margin-bottom","0px !important","overflow","hidden"],["color","primary",1,"me-6",3,"change"],[1,"fw-light"],["color","primary",3,"change","checked"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src"],[1,"fw-light","ms-2","my-auto"]],template:function(i,n){i&1&&(l(0,"modal-material",0),C("onOk",function(){return n.onOk()})("onClose",function(){return n.onClose()})("onCancel",function(){return n.onClose()}),l(1,"div",1)(2,"div",2),p(3,ke,4,0,"span"),l(4,"ul",3),y(5,Ee,6,3,"li",null,I),d()()()()),i&2&&(s("dynamicValidated",n.getSelectedChannel().length>0)("config",n.modalConfig),r(3),g(n.channels().length>1?3:-1),r(2),S(n.channels()))},dependencies:[be,we,V],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"],changeDetection:0})}}return t})();var N=t=>[t],De=(t,c)=>({"bg-gradient-warning":t,"cell-hover pointer":c});function Oe(t,c){if(t&1){let e=x();l(0,"mat-slide-toggle",10),C("toggleChange",function(){h(e);let n=a();return u(n.onToggle())}),l(1,"small",11),m(2),d()()}if(t&2){let e=a();s("checked",e.toggleStatus()),r(2),F(" ",e.productToggleTitle()?e.productToggleTitle():"FILTER DIFFERENT INVENTORY"," ")}}function Ve(t,c){if(t&1){let e=x();l(0,"th")(1,"input",13),C("change",function(n){h(e);let o=a(2);return o.checkboxState.set(n.target.checked),u(o.onCheckboxStateChange())}),d()()}if(t&2){let e=a(2);r(),s("checked",e.checkboxState())}}function Ne(t,c){if(t&1&&(T(0,Ve,2,1,"ng-template",12),l(1,"th",8),m(2,"POS"),d()),t&2){let e=a();s("ngxPermissionsOnly",k(1,N,e.rolePriceEdit))}}function Ue(t,c){if(t&1&&(l(0,"th",9)(1,"div",14)(2,"div",15),w(3,"img",16),l(4,"div",17),m(5),O(6,"stringLimit"),d()()()()),t&2){let e=c.$implicit;r(2),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,v),r(2),F(" ",ee(6,3,e.Name,20)," ")}}function $e(t,c){t&1&&R(0)}function Be(t,c){if(t&1&&T(0,$e,1,0,"ng-container",28),t&2){a(2);let e=A(5);s("ngTemplateOutlet",e)}}function Re(t,c){if(t&1&&T(0,Be,1,1,"ng-template",12),t&2){let e=a(4);s("ngxPermissionsOnly",k(1,N,e.roleInventoryUpdate))}}function Ae(t,c){t&1&&R(0)}function Le(t,c){if(t&1&&T(0,Ae,1,0,"ng-container",28),t&2){a(2);let e=A(5);s("ngTemplateOutlet",e)}}function je(t,c){if(t&1&&T(0,Le,1,1,"ng-template",12),t&2){let e=a(4);s("ngxPermissionsOnly",k(1,N,e.rolePriceEdit))}}function ze(t,c){if(t&1){let e=x();l(0,"div")(1,"input",29),W("ngModelChange",function(n){h(e);let o=a(4).$implicit;return z(o.selected,n)||(o.selected=n),u(n)}),C("ngModelChange",function(){h(e);let n=a(4).$implicit,o=a();return u(o.onCheckboxStateProduct(n.ID))}),d()()}if(t&2){let e=a(4).$implicit;r(),j("ngModel",e.selected),s("disabled",!(e!=null&&e.Category))}}function We(t,c){if(t&1&&p(0,ze,2,2,"div"),t&2){let e=a(3).$implicit;g((e==null||e.Variants==null?null:e.Variants.length)>1?0:-1)}}function He(t,c){if(t&1){let e=x();l(0,"img",30),C("click",function(n){h(e);let o=a(3).$implicit,_=a();return u(_.onZoomImage(n,o==null?null:o.ImageUrl))}),d()}if(t&2){let e=a(3).$implicit;s("src",J(e==null?null:e.ThumbnailUrl),v)}}function Ze(t,c){t&1&&w(0,"img",25)}function qe(t,c){if(t&1&&(l(0,"td",22)(1,"div",23),p(2,Re,1,3,null,12)(3,je,1,3,null,12),T(4,We,1,1,"ng-template",null,0,te),l(6,"div"),p(7,He,1,2,"img",24)(8,Ze,1,0,"img",25),d()()(),l(9,"td",26)(10,"div"),m(11),d(),l(12,"small",27),m(13),d()()),t&2){let e=a(2).$implicit,i=a();s("rowSpan",e==null?null:e.Variants.length),r(2),g(i.table()=="inventory"?2:3),r(5),g(e!=null&&e.ThumbnailUrl?7:8),r(2),s("rowSpan",e==null?null:e.Variants.length),r(2),M(e==null?null:e.Name),r(),L("text-danger",!(e!=null&&e.Category)),r(),F("(",e!=null&&e.Category?e==null?null:e.Category:"Not Found In POS",")")}}function Ge(t,c){if(t&1&&(l(0,"a",21),w(1,"i",31),d()),t&2){let e=a().$implicit,i=a(2);s("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),v)}}function Ke(t,c){if(t&1){let e=x();l(0,"input",34),W("ngModelChange",function(n){h(e);let o=a(3).$implicit;return z(o.selected,n)||(o.selected=n),u(n)}),d()}if(t&2){let e=a(3).$implicit,i=a().$implicit;j("ngModel",e.selected),s("disabled",!(i!=null&&i.Category))}}function Xe(t,c){if(t&1&&(l(0,"td",32),p(1,Ke,1,2,"input",33),d()),t&2){let e=a(2).$implicit,i=a(2);r(),g(i.printPOS(e)>=0||i.table()=="price"?1:-1)}}function Ye(t,c){if(t&1&&(T(0,Xe,2,1,"ng-template",12),l(1,"td",19),m(2),O(3,"number"),d()),t&2){let e=a().$implicit,i=a(2);s("ngxPermissionsOnly",k(4,N,i.rolePriceEdit)),r(2),M(H(3,2,i.printPOS(e)))}}function Je(t,c){if(t&1){let e=x();l(0,"td",37),C("click",function(){h(e);let n=a().$implicit,o=a().$implicit,_=a().$implicit,Fe=a();return u(Fe.onUpdateData(_.Name,o,n.ID,_.ChannelItemID))}),l(1,"div",38)(2,"div",39),m(3),O(4,"number"),d(),l(5,"a",40),C("click",function(n){return h(e),u(n==null?null:n.stopPropagation())}),w(6,"i",31),d()()()}if(t&2){let e=c,i=a(2).$implicit,n=a(2);Y(Q(6,De,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table()=="price"||n.hasInventoryEdit()&&n.table()=="inventory")),r(3),F(" ",H(4,4,n.printItem(e))," "),r(2),s("href",e.Url,v)}}function Qe(t,c){t&1&&(l(0,"td",36)(1,"div",38)(2,"span"),m(3,"X"),d()()())}function et(t,c){if(t&1&&p(0,Je,7,9,"td",35)(1,Qe,4,0,"td",36),t&2){let e,i=c.$implicit,n=a().$implicit,o=a(2);g((e=o.getItemFromChannel(n,i))?0:1,e)}}function tt(t,c){if(t&1&&(l(0,"tr"),p(1,qe,14,8),l(2,"td",18),m(3),d(),l(4,"td",19)(5,"div",20)(6,"div"),m(7),d(),l(8,"div",17),p(9,Ge,2,1,"a",21),d()()(),p(10,Ye,4,6),y(11,et,2,1,null,null,I),d()),t&2){let e=c.$implicit,i=c.$index,n=a().$implicit,o=a();r(),g(i==0?1:-1),r(2),M(e==null?null:e.Model),r(2),s("matTooltip",e.Discontinued?o.discontinuedVariantMsg:""),r(),L("text-decoration-line-through",e.Discontinued),r(),F(" ",e.Code," "),r(2),g(n.Category?9:-1),r(),g(o.hiddenIPOSInventory()==!1?10:-1),r(),S(o.channel())}}function nt(t,c){if(t&1&&(l(0,"tbody"),y(1,tt,13,8,"tr",null,I),d()),t&2){let e=c.$implicit;r(),S(e.Variants)}}var Bt=(()=>{class t{constructor(){this.dialog=f(Ce),this.biggerPictureService=f(ve),this.authService=f(de),this.permissionsService=f(le),this.table=P(void 0),this.channel=P(void 0),this.showProductToggle=P(!1),this.productToggleTitle=P(void 0),this.hiddenIPOSInventory=P(!1),this.toggleStatus=b(!1),this.stockHeader=b(void 0),this.checkboxState=b(!1),this.rolePriceEdit=E.PriceUpdate,this.roleInventoryUpdate=E.InventoryUpdate,this.hasPriceEdit=b(!1),this.hasInventoryEdit=b(!1),this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new B,this.destroy$=new q,this.toggle=new B,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles();let e=this.table();e=="inventory"?this.stockHeader.set("Stock"):e=="price"&&this.stockHeader.set("Price")}initRoles(){this.permissionsService.hasPermission(E.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e)),this.permissionsService.hasPermission(E.PriceUpdate).then(e=>this.hasPriceEdit.set(e))}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(o=>(o.selected=n.selected,o)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState(),i)),e))}getItemFromChannel(e,i){return e.Channel.find(o=>Z.IsNotEmpty(i.LocationID)?o.LocationID==i.LocationID:o.ChannelID==i.ID)}printItem(e){let i=this.table();if(i=="inventory")return e.Inventory;if(i=="price")return e.Price}onUpdateData(e,i,n,o){let _=this.table();this.hasPriceEdit()&&_=="price"&&this.onOpenDialogUpdate(e,i,n,o),this.hasInventoryEdit()&&_=="inventory"&&this.onOpenDialogUpdate(e,i,n,o)}onOpenDialogUpdate(e,i,n,o){this.dialog.open(Ie,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table(),ChannelItemID:o}}).afterClosed().pipe(G(_=>Z.IsNotEmpty(_)),K(this.destroy$)).subscribe(_=>{this.onSubmit.emit(_)})}printPOS(e){let i=this.table();return i=="inventory"?e.Inventory?e.Inventory:0:i=="price"?e.UnitPrice:null}onToggle(){this.toggleStatus.update(e=>!e),this.toggle.emit(this.toggleStatus())}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-table"]],inputs:{data:"data",table:[1,"table"],channel:[1,"channel"],showProductToggle:[1,"showProductToggle"],productToggleTitle:[1,"productToggleTitle"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:18,vars:2,consts:[["checkbox_update",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px",3,"checked"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],["scope","col"],[2,"width","200px",3,"toggleChange","checked"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"change","checked"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[1,"border","rounded","w-img","cursor-pointer",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"class"],[1,"table-white","text-center",2,"color","red"],[1,"p-0",3,"click"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"]],template:function(i,n){i&1&&(l(0,"div",1)(1,"table",2)(2,"thead",3)(3,"tr")(4,"th",4)(5,"div",5)(6,"div"),m(7,"Product"),d(),p(8,Oe,3,2,"mat-slide-toggle",6),d()(),l(9,"th",7),m(10,"Variant"),d(),l(11,"th",8),m(12,"SKU"),d(),p(13,Ne,3,3),y(14,Ue,7,6,"th",9,X),d()(),y(16,nt,3,0,"tbody",null,I),d()()),i&2&&(r(8),g(n.showProductToggle()?8:-1),r(5),g(n.hiddenIPOSInventory()==!1?13:-1),r(),S(n.channel()),r(2),S(n.data))},dependencies:[V,se,me,_e,Se,ye,xe,ae,Te,ce,re,ge,pe,ie,Me,oe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"],changeDetection:0})}}return t})();export{mt as a,Bt as b};
1
+ import{a as we}from"./chunk-SEB36UUD.js";import{a as Ie,b as Me}from"./chunk-IBZCREPJ.js";import{a as ye,b as Se}from"./chunk-Y5RUW5VE.js";import{a as ve}from"./chunk-7ES2Z445.js";import{a as he,b as ue,c as Ce,g as xe,i as fe,j as be}from"./chunk-NIRJAWTX.js";import{a as ge}from"./chunk-RDXDKWLL.js";import{b as Te}from"./chunk-A32JPG5P.js";import{a as ae}from"./chunk-JY726AM5.js";import{b as pe}from"./chunk-47Z3CNAW.js";import{a as E}from"./chunk-ZSUWHVKX.js";import{h as de}from"./chunk-VB4EKTTU.js";import{a as le,b as re,c as ce}from"./chunk-7R55YTL6.js";import{c as Z}from"./chunk-NNVT5X6O.js";import{b as se,h as me,m as _e,z as V}from"./chunk-BUBQQEYA.js";import{D as oe,y as ie}from"./chunk-4NAKX6WQ.js";import{Ca as B,E as G,Eb as D,Ga as b,Jc as A,Kb as T,Lc as L,Nc as Y,Oc as m,Pc as M,Qc as F,Sc as j,Tc as z,Uc as W,Yc as J,_ as K,bc as p,bd as k,cd as Q,d as q,dc as g,ec as I,fc as X,gc as y,hc as S,ic as s,jc as l,kb as v,kc as d,kd as O,lc as w,ld as H,mb as r,md as ee,na as f,od as te,rc as R,sc as x,sd as ne,ua as h,va as u,wd as P,xc as C,zc as a}from"./chunk-ZPV56E2J.js";import{a as U,b as $}from"./chunk-66YHNWRR.js";function ke(t,c){if(t&1){let e=x();l(0,"span")(1,"mat-checkbox",4),C("change",function(n){h(e);let o=a();return u(o.onSelectAll(n==null?null:n.checked))}),l(2,"h5",5),m(3,"Select All"),d()()()}}function Ee(t,c){if(t&1){let e=x();l(0,"li")(1,"mat-checkbox",6),C("change",function(n){let o=h(e).$implicit,_=a();return u(_.onChannelChange(o,n.checked))}),l(2,"div",7),w(3,"img",8),l(4,"h5",9),m(5),d()()()()}if(t&2){let e=c.$implicit;r(),s("checked",e.selected),r(2),s("src",e.Img,v),r(2),M(e.Name)}}var mt=(()=>{class t{constructor(){this.data=f(ue),this.dialogRef=f(he),this.channels=b([]),this.getSelectedChannel=ne(()=>this.channels().filter(e=>e.selected)),this.selectedItems=this.data.selectedItems,this.channels.set(this.data.channels)}ngOnInit(){this.initModalConfig()}initModalConfig(){let e=this.data.title?this.data.title:"Updating Inventory";this.modalConfig=new fe,this.modalConfig.title=e}onSelectAll(e){this.channels.update(i=>i.map(n=>$(U({},n),{selected:e})))}onOk(){this.dialogRef.close(this.channels())}onClose(){this.dialogRef.close()}onChannelChange(e,i){this.channels.update(n=>n.map(o=>o.ID===e.ID?$(U({},o),{selected:i}):o))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-modal-update-channels"]],decls:7,vars:3,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[2,"overflow-y","auto","max-height","28rem"],[1,"no-bullet",2,"margin-bottom","0px !important","overflow","hidden"],["color","primary",1,"me-6",3,"change"],[1,"fw-light"],["color","primary",3,"change","checked"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src"],[1,"fw-light","ms-2","my-auto"]],template:function(i,n){i&1&&(l(0,"modal-material",0),C("onOk",function(){return n.onOk()})("onClose",function(){return n.onClose()})("onCancel",function(){return n.onClose()}),l(1,"div",1)(2,"div",2),p(3,ke,4,0,"span"),l(4,"ul",3),y(5,Ee,6,3,"li",null,I),d()()()()),i&2&&(s("dynamicValidated",n.getSelectedChannel().length>0)("config",n.modalConfig),r(3),g(n.channels().length>1?3:-1),r(2),S(n.channels()))},dependencies:[be,we,V],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"],changeDetection:0})}}return t})();var N=t=>[t],De=(t,c)=>({"bg-gradient-warning":t,"cell-hover pointer":c});function Oe(t,c){if(t&1){let e=x();l(0,"mat-slide-toggle",10),C("toggleChange",function(){h(e);let n=a();return u(n.onToggle())}),l(1,"small",11),m(2),d()()}if(t&2){let e=a();s("checked",e.toggleStatus()),r(2),F(" ",e.productToggleTitle()?e.productToggleTitle():"FILTER DIFFERENT INVENTORY"," ")}}function Ve(t,c){if(t&1){let e=x();l(0,"th")(1,"input",13),C("change",function(n){h(e);let o=a(2);return o.checkboxState.set(n.target.checked),u(o.onCheckboxStateChange())}),d()()}if(t&2){let e=a(2);r(),s("checked",e.checkboxState())}}function Ne(t,c){if(t&1&&(T(0,Ve,2,1,"ng-template",12),l(1,"th",8),m(2,"POS"),d()),t&2){let e=a();s("ngxPermissionsOnly",k(1,N,e.rolePriceEdit))}}function Ue(t,c){if(t&1&&(l(0,"th",9)(1,"div",14)(2,"div",15),w(3,"img",16),l(4,"div",17),m(5),O(6,"stringLimit"),d()()()()),t&2){let e=c.$implicit;r(2),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,v),r(2),F(" ",ee(6,3,e.Name,20)," ")}}function $e(t,c){t&1&&R(0)}function Be(t,c){if(t&1&&T(0,$e,1,0,"ng-container",28),t&2){a(2);let e=A(5);s("ngTemplateOutlet",e)}}function Re(t,c){if(t&1&&T(0,Be,1,1,"ng-template",12),t&2){let e=a(4);s("ngxPermissionsOnly",k(1,N,e.roleInventoryUpdate))}}function Ae(t,c){t&1&&R(0)}function Le(t,c){if(t&1&&T(0,Ae,1,0,"ng-container",28),t&2){a(2);let e=A(5);s("ngTemplateOutlet",e)}}function je(t,c){if(t&1&&T(0,Le,1,1,"ng-template",12),t&2){let e=a(4);s("ngxPermissionsOnly",k(1,N,e.rolePriceEdit))}}function ze(t,c){if(t&1){let e=x();l(0,"div")(1,"input",29),W("ngModelChange",function(n){h(e);let o=a(4).$implicit;return z(o.selected,n)||(o.selected=n),u(n)}),C("ngModelChange",function(){h(e);let n=a(4).$implicit,o=a();return u(o.onCheckboxStateProduct(n.ID))}),d()()}if(t&2){let e=a(4).$implicit;r(),j("ngModel",e.selected),s("disabled",!(e!=null&&e.Category))}}function We(t,c){if(t&1&&p(0,ze,2,2,"div"),t&2){let e=a(3).$implicit;g((e==null||e.Variants==null?null:e.Variants.length)>1?0:-1)}}function He(t,c){if(t&1){let e=x();l(0,"img",30),C("click",function(n){h(e);let o=a(3).$implicit,_=a();return u(_.onZoomImage(n,o==null?null:o.ImageUrl))}),d()}if(t&2){let e=a(3).$implicit;s("src",J(e==null?null:e.ThumbnailUrl),v)}}function Ze(t,c){t&1&&w(0,"img",25)}function qe(t,c){if(t&1&&(l(0,"td",22)(1,"div",23),p(2,Re,1,3,null,12)(3,je,1,3,null,12),T(4,We,1,1,"ng-template",null,0,te),l(6,"div"),p(7,He,1,2,"img",24)(8,Ze,1,0,"img",25),d()()(),l(9,"td",26)(10,"div"),m(11),d(),l(12,"small",27),m(13),d()()),t&2){let e=a(2).$implicit,i=a();s("rowSpan",e==null?null:e.Variants.length),r(2),g(i.table()=="inventory"?2:3),r(5),g(e!=null&&e.ThumbnailUrl?7:8),r(2),s("rowSpan",e==null?null:e.Variants.length),r(2),M(e==null?null:e.Name),r(),L("text-danger",!(e!=null&&e.Category)),r(),F("(",e!=null&&e.Category?e==null?null:e.Category:"Not Found In POS",")")}}function Ge(t,c){if(t&1&&(l(0,"a",21),w(1,"i",31),d()),t&2){let e=a().$implicit,i=a(2);s("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),v)}}function Ke(t,c){if(t&1){let e=x();l(0,"input",34),W("ngModelChange",function(n){h(e);let o=a(3).$implicit;return z(o.selected,n)||(o.selected=n),u(n)}),d()}if(t&2){let e=a(3).$implicit,i=a().$implicit;j("ngModel",e.selected),s("disabled",!(i!=null&&i.Category))}}function Xe(t,c){if(t&1&&(l(0,"td",32),p(1,Ke,1,2,"input",33),d()),t&2){let e=a(2).$implicit,i=a(2);r(),g(i.printPOS(e)>=0||i.table()=="price"?1:-1)}}function Ye(t,c){if(t&1&&(T(0,Xe,2,1,"ng-template",12),l(1,"td",19),m(2),O(3,"number"),d()),t&2){let e=a().$implicit,i=a(2);s("ngxPermissionsOnly",k(4,N,i.rolePriceEdit)),r(2),M(H(3,2,i.printPOS(e)))}}function Je(t,c){if(t&1){let e=x();l(0,"td",37),C("click",function(){h(e);let n=a().$implicit,o=a().$implicit,_=a().$implicit,Fe=a();return u(Fe.onUpdateData(_.Name,o,n.ID,_.ChannelItemID))}),l(1,"div",38)(2,"div",39),m(3),O(4,"number"),d(),l(5,"a",40),C("click",function(n){return h(e),u(n==null?null:n.stopPropagation())}),w(6,"i",31),d()()()}if(t&2){let e=c,i=a(2).$implicit,n=a(2);Y(Q(6,De,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table()=="price"||n.hasInventoryEdit()&&n.table()=="inventory")),r(3),F(" ",H(4,4,n.printItem(e))," "),r(2),s("href",e.Url,v)}}function Qe(t,c){t&1&&(l(0,"td",36)(1,"div",38)(2,"span"),m(3,"X"),d()()())}function et(t,c){if(t&1&&p(0,Je,7,9,"td",35)(1,Qe,4,0,"td",36),t&2){let e,i=c.$implicit,n=a().$implicit,o=a(2);g((e=o.getItemFromChannel(n,i))?0:1,e)}}function tt(t,c){if(t&1&&(l(0,"tr"),p(1,qe,14,8),l(2,"td",18),m(3),d(),l(4,"td",19)(5,"div",20)(6,"div"),m(7),d(),l(8,"div",17),p(9,Ge,2,1,"a",21),d()()(),p(10,Ye,4,6),y(11,et,2,1,null,null,I),d()),t&2){let e=c.$implicit,i=c.$index,n=a().$implicit,o=a();r(),g(i==0?1:-1),r(2),M(e==null?null:e.Model),r(2),s("matTooltip",e.Discontinued?o.discontinuedVariantMsg:""),r(),L("text-decoration-line-through",e.Discontinued),r(),F(" ",e.Code," "),r(2),g(n.Category?9:-1),r(),g(o.hiddenIPOSInventory()==!1?10:-1),r(),S(o.channel())}}function nt(t,c){if(t&1&&(l(0,"tbody"),y(1,tt,13,8,"tr",null,I),d()),t&2){let e=c.$implicit;r(),S(e.Variants)}}var Bt=(()=>{class t{constructor(){this.dialog=f(Ce),this.biggerPictureService=f(ve),this.authService=f(de),this.permissionsService=f(le),this.table=P(void 0),this.channel=P(void 0),this.showProductToggle=P(!1),this.productToggleTitle=P(void 0),this.hiddenIPOSInventory=P(!1),this.toggleStatus=b(!1),this.stockHeader=b(void 0),this.checkboxState=b(!1),this.rolePriceEdit=E.PriceUpdate,this.roleInventoryUpdate=E.InventoryUpdate,this.hasPriceEdit=b(!1),this.hasInventoryEdit=b(!1),this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new B,this.destroy$=new q,this.toggle=new B,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles();let e=this.table();e=="inventory"?this.stockHeader.set("Stock"):e=="price"&&this.stockHeader.set("Price")}initRoles(){this.permissionsService.hasPermission(E.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e)),this.permissionsService.hasPermission(E.PriceUpdate).then(e=>this.hasPriceEdit.set(e))}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(o=>(o.selected=n.selected,o)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState(),i)),e))}getItemFromChannel(e,i){return e.Channel.find(o=>Z.IsNotEmpty(i.LocationID)?o.LocationID==i.LocationID:o.ChannelID==i.ID)}printItem(e){let i=this.table();if(i=="inventory")return e.Inventory;if(i=="price")return e.Price}onUpdateData(e,i,n,o){let _=this.table();this.hasPriceEdit()&&_=="price"&&this.onOpenDialogUpdate(e,i,n,o),this.hasInventoryEdit()&&_=="inventory"&&this.onOpenDialogUpdate(e,i,n,o)}onOpenDialogUpdate(e,i,n,o){this.dialog.open(Ie,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table(),ChannelItemID:o}}).afterClosed().pipe(G(_=>Z.IsNotEmpty(_)),K(this.destroy$)).subscribe(_=>{this.onSubmit.emit(_)})}printPOS(e){let i=this.table();return i=="inventory"?e.Inventory?e.Inventory:0:i=="price"?e.UnitPrice:null}onToggle(){this.toggleStatus.update(e=>!e),this.toggle.emit(this.toggleStatus())}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-table"]],inputs:{data:"data",table:[1,"table"],channel:[1,"channel"],showProductToggle:[1,"showProductToggle"],productToggleTitle:[1,"productToggleTitle"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:18,vars:2,consts:[["checkbox_update",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px",3,"checked"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],["scope","col"],[2,"width","200px",3,"toggleChange","checked"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"change","checked"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[1,"border","rounded","w-img","cursor-pointer",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"class"],[1,"table-white","text-center",2,"color","red"],[1,"p-0",3,"click"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"]],template:function(i,n){i&1&&(l(0,"div",1)(1,"table",2)(2,"thead",3)(3,"tr")(4,"th",4)(5,"div",5)(6,"div"),m(7,"Product"),d(),p(8,Oe,3,2,"mat-slide-toggle",6),d()(),l(9,"th",7),m(10,"Variant"),d(),l(11,"th",8),m(12,"SKU"),d(),p(13,Ne,3,3),y(14,Ue,7,6,"th",9,X),d()(),y(16,nt,3,0,"tbody",null,I),d()()),i&2&&(r(8),g(n.showProductToggle()?8:-1),r(5),g(n.hiddenIPOSInventory()==!1?13:-1),r(),S(n.channel()),r(2),S(n.data))},dependencies:[V,se,me,_e,Se,ye,xe,ae,Te,ce,re,ge,pe,ie,Me,oe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"],changeDetection:0})}}return t})();export{mt as a,Bt as b};
@@ -1 +1 @@
1
- import{a as ut}from"./chunk-IPMCCZZW.js";import"./chunk-6GSJBXEE.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-3BV4FPZE.js";import{a as mt}from"./chunk-7KG3DC5J.js";import{a as dt}from"./chunk-TWRFL73R.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import{b as ct}from"./chunk-MYDVMG67.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{e as pt}from"./chunk-KXLYQDZR.js";import{b as st}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-SPNVH2ST.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-VDNUDZOQ.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import{c as et}from"./chunk-NNVT5X6O.js";import{h as at,m as rt,z as lt}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as it}from"./chunk-45DFJJAO.js";import{e as nt,g as ot}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B as Z,D as tt,z as Y}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as k,Ga as R,Nc as W,Oc as r,Pc as S,Qc as D,Sc as j,Tc as q,Uc as A,V as v,Vc as U,Wc as G,Xc as I,Yc as J,_ as F,ad as K,bc as h,bd as Q,cd as X,d as V,dc as g,fc as H,gc as O,hc as z,ic as f,jb as $,jc as o,kb as B,kc as a,kd as p,lc as b,ld as _,mb as l,md as M,na as N,sc as w,t as C,ua as m,va as d,xc as T,zc as s}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as L,b as P}from"./chunk-66YHNWRR.js";var ft=(i,c)=>({"bg-gradient-danger":i,"bg-gradient-warning":c}),_t=()=>["/menu/products/status/notification/detail"],Ct=i=>({ID:i});function ht(i,c){if(i&1&&(r(0),p(1,"number"),o(2,"span"),r(3,"s"),a()),i&2){let t=s().$implicit;D(" ",M(1,1,t.DurationInSecond,"1.1-1")," ")}}function gt(i,c){i&1&&r(0," - ")}function St(i,c){if(i&1&&(o(0,"tr")(1,"td")(2,"a",12),b(3,"img",13),o(4,"span"),r(5),a()()(),o(6,"td")(7,"b"),r(8),a(),b(9,"div",14),a(),o(10,"td"),h(11,ht,4,4)(12,gt,1,0),a(),o(13,"td"),r(14),a(),o(15,"td"),r(16),p(17,"date"),a()()),i&2){let t=c.$implicit;W(X(15,ft,t.Status==1,t.Status==0)),l(2),f("routerLink",K(18,_t))("queryParams",Q(19,Ct,t.ID)),l(),f("src",J(t.Img),B),l(2),S(t.Name),l(3),S(t.Label),l(),f("innerHTML",t.Message,$),l(2),g(t.DurationInSecond?11:12),l(3),S(t.StatusLabel),l(2),D(" ",M(17,12,t.Created,"dd MMM yyyy HH:mm")," ")}}function xt(i,c){if(i&1){let t=w();o(0,"div",5)(1,"div",15)(2,"app-custom-paginator",16),p(3,"async"),p(4,"async"),T("total",function(){m(t);let n=s(2);return d(n.getRowCount())})("next",function(){m(t);let n=s(2);return d(n.getNotifications())})("previous",function(){m(t);let n=s(2);return d(n.getNotifications())}),a()()()}if(i&2){let t=s(),e=s(),n=I(8);l(2),f("filter",n)("totaldata",t==null?null:t.length)("paginationTotal",_(3,4,e.rowCount$))("hasClicked",_(4,6,e.rowCount$))}}function yt(i,c){i&1&&h(0,xt,5,8,"div",5),i&2&&g(c.length>0?0:-1)}var zt=(()=>{class i{constructor(){this.http=N(it),this.notificationService=N(ct),this.filter=R(new mt),this.destroy$=new V}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(F(this.destroy$)).subscribe(t=>{t.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(t=>{this.filter.set(t.Filter),this.filter.update(e=>P(L({},e),{PageSize:t.Filter.RowCount})),this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let t=this.filter(),e={ChannelID:t.ChannelID,RowCount:t.PageSize,PageNumber:t.PageNumber};this.notifications$=this.http.post("/api/notification/Get",e).pipe(C(n=>n.Data),C(n=>(n=this.setChannelLogoToNotifications(n),n=this.setTimeToSecond(n),n)),v(1))}setTimeToSecond(t){return t=t.map(e=>(e.DurationInSecond=parseInt(e.Duration)/1e3,e)),t}setChannelLogoToNotifications(t){return t=t.map(e=>(e.Img=et.getChannelLogoByTypeId(e.TypeID),e)),t}getRowCount(){let e={ChannelID:this.filter().ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",e).pipe(C(n=>n.Count),v(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-notification"]],decls:34,vars:7,consts:[["headerTitle","Product Scan Job","hideSearchBox","true",3,"onSubmit"],["routerLink","/menu/products/status/notificationV2",1,"btn","btn-outline-secondary","btn-lg"],[1,"mb-2"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[3,"class"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,n){if(e&1){let u=w();o(0,"mainpanel",0),T("onSubmit",function(){return m(u),d(n.onFilter())}),o(1,"actions")(2,"a",1),r(3," Scan History "),a()(),o(4,"filters")(5,"div")(6,"h6",2),r(7,"Channel"),a(),U(8),o(9,"app-channel-options-v2",3),A("ngModelChange",function(y){m(u);let E=I(8);return q(E.ChannelID,y)||(E.ChannelID=y),d(y)}),a()()(),o(10,"content")(11,"div",4)(12,"div",5)(13,"div",6)(14,"div",7)(15,"table",8)(16,"thead",9)(17,"tr",10)(18,"th"),r(19,"Channel"),a(),o(20,"th"),r(21,"Process"),a(),o(22,"th"),r(23,"Duration"),a(),o(24,"th"),r(25,"Status"),a(),o(26,"th"),r(27,"Created"),a()()(),o(28,"tbody"),O(29,St,18,21,"tr",11,H),p(31,"async"),a()()()()(),h(32,yt,1,1),p(33,"async"),a()()()}if(e&2){let u;l(8);let x=G(n.filter());l(),j("ngModel",x.ChannelID),l(20),z(_(31,3,n.notifications$)),l(3),g((u=_(33,5,n.notifications$))?32:-1,u)}},dependencies:[lt,at,rt,st,dt,pt,ot,nt,ut,Y,Z,tt],encapsulation:2,changeDetection:0})}}return i})();export{zt as NotificationComponent};
1
+ import{a as ut}from"./chunk-T7PNPUCK.js";import"./chunk-6GSJBXEE.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-3BV4FPZE.js";import{a as mt}from"./chunk-7KG3DC5J.js";import{a as dt}from"./chunk-TWRFL73R.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import{b as ct}from"./chunk-ASKT24WA.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{e as pt}from"./chunk-KXLYQDZR.js";import{b as st}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-SPNVH2ST.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-VB4EKTTU.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import{c as et}from"./chunk-NNVT5X6O.js";import{h as at,m as rt,z as lt}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as it}from"./chunk-45DFJJAO.js";import{e as nt,g as ot}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B as Z,D as tt,z as Y}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as k,Ga as R,Nc as W,Oc as r,Pc as S,Qc as D,Sc as j,Tc as q,Uc as A,V as v,Vc as U,Wc as G,Xc as I,Yc as J,_ as F,ad as K,bc as h,bd as Q,cd as X,d as V,dc as g,fc as H,gc as O,hc as z,ic as f,jb as $,jc as o,kb as B,kc as a,kd as p,lc as b,ld as _,mb as l,md as M,na as N,sc as w,t as C,ua as m,va as d,xc as T,zc as s}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as L,b as P}from"./chunk-66YHNWRR.js";var ft=(i,c)=>({"bg-gradient-danger":i,"bg-gradient-warning":c}),_t=()=>["/menu/products/status/notification/detail"],Ct=i=>({ID:i});function ht(i,c){if(i&1&&(r(0),p(1,"number"),o(2,"span"),r(3,"s"),a()),i&2){let t=s().$implicit;D(" ",M(1,1,t.DurationInSecond,"1.1-1")," ")}}function gt(i,c){i&1&&r(0," - ")}function St(i,c){if(i&1&&(o(0,"tr")(1,"td")(2,"a",12),b(3,"img",13),o(4,"span"),r(5),a()()(),o(6,"td")(7,"b"),r(8),a(),b(9,"div",14),a(),o(10,"td"),h(11,ht,4,4)(12,gt,1,0),a(),o(13,"td"),r(14),a(),o(15,"td"),r(16),p(17,"date"),a()()),i&2){let t=c.$implicit;W(X(15,ft,t.Status==1,t.Status==0)),l(2),f("routerLink",K(18,_t))("queryParams",Q(19,Ct,t.ID)),l(),f("src",J(t.Img),B),l(2),S(t.Name),l(3),S(t.Label),l(),f("innerHTML",t.Message,$),l(2),g(t.DurationInSecond?11:12),l(3),S(t.StatusLabel),l(2),D(" ",M(17,12,t.Created,"dd MMM yyyy HH:mm")," ")}}function xt(i,c){if(i&1){let t=w();o(0,"div",5)(1,"div",15)(2,"app-custom-paginator",16),p(3,"async"),p(4,"async"),T("total",function(){m(t);let n=s(2);return d(n.getRowCount())})("next",function(){m(t);let n=s(2);return d(n.getNotifications())})("previous",function(){m(t);let n=s(2);return d(n.getNotifications())}),a()()()}if(i&2){let t=s(),e=s(),n=I(8);l(2),f("filter",n)("totaldata",t==null?null:t.length)("paginationTotal",_(3,4,e.rowCount$))("hasClicked",_(4,6,e.rowCount$))}}function yt(i,c){i&1&&h(0,xt,5,8,"div",5),i&2&&g(c.length>0?0:-1)}var zt=(()=>{class i{constructor(){this.http=N(it),this.notificationService=N(ct),this.filter=R(new mt),this.destroy$=new V}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(F(this.destroy$)).subscribe(t=>{t.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(t=>{this.filter.set(t.Filter),this.filter.update(e=>P(L({},e),{PageSize:t.Filter.RowCount})),this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let t=this.filter(),e={ChannelID:t.ChannelID,RowCount:t.PageSize,PageNumber:t.PageNumber};this.notifications$=this.http.post("/api/notification/Get",e).pipe(C(n=>n.Data),C(n=>(n=this.setChannelLogoToNotifications(n),n=this.setTimeToSecond(n),n)),v(1))}setTimeToSecond(t){return t=t.map(e=>(e.DurationInSecond=parseInt(e.Duration)/1e3,e)),t}setChannelLogoToNotifications(t){return t=t.map(e=>(e.Img=et.getChannelLogoByTypeId(e.TypeID),e)),t}getRowCount(){let e={ChannelID:this.filter().ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",e).pipe(C(n=>n.Count),v(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-notification"]],decls:34,vars:7,consts:[["headerTitle","Product Scan Job","hideSearchBox","true",3,"onSubmit"],["routerLink","/menu/products/status/notificationV2",1,"btn","btn-outline-secondary","btn-lg"],[1,"mb-2"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[3,"class"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,n){if(e&1){let u=w();o(0,"mainpanel",0),T("onSubmit",function(){return m(u),d(n.onFilter())}),o(1,"actions")(2,"a",1),r(3," Scan History "),a()(),o(4,"filters")(5,"div")(6,"h6",2),r(7,"Channel"),a(),U(8),o(9,"app-channel-options-v2",3),A("ngModelChange",function(y){m(u);let E=I(8);return q(E.ChannelID,y)||(E.ChannelID=y),d(y)}),a()()(),o(10,"content")(11,"div",4)(12,"div",5)(13,"div",6)(14,"div",7)(15,"table",8)(16,"thead",9)(17,"tr",10)(18,"th"),r(19,"Channel"),a(),o(20,"th"),r(21,"Process"),a(),o(22,"th"),r(23,"Duration"),a(),o(24,"th"),r(25,"Status"),a(),o(26,"th"),r(27,"Created"),a()()(),o(28,"tbody"),O(29,St,18,21,"tr",11,H),p(31,"async"),a()()()()(),h(32,yt,1,1),p(33,"async"),a()()()}if(e&2){let u;l(8);let x=G(n.filter());l(),j("ngModel",x.ChannelID),l(20),z(_(31,3,n.notifications$)),l(3),g((u=_(33,5,n.notifications$))?32:-1,u)}},dependencies:[lt,at,rt,st,dt,pt,ot,nt,ut,Y,Z,tt],encapsulation:2,changeDetection:0})}}return i})();export{zt as NotificationComponent};
@@ -1 +1 @@
1
- import{h as u}from"./chunk-VDNUDZOQ.js";import{a as p}from"./chunk-7R55YTL6.js";import{b as c}from"./chunk-45DFJJAO.js";import{d as l}from"./chunk-OF426VSL.js";import{ia as a,ma as t}from"./chunk-ZPV56E2J.js";var S=(()=>{class e{constructor(o,i,r,s){this.toastr=o,this.authService=i,this.router=r,this.permissionService=s}canActivate(o,i){let r=JSON.parse(window.localStorage.getItem("user")),s=new Date,n=!1;if(r!=null){let h=new Date(r?.Token?.expiredAt);s<h?n=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return n}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(i){return new(i||e)(t(c),t(u),t(l),t(p))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{S as a};
1
+ import{h as u}from"./chunk-VB4EKTTU.js";import{a as p}from"./chunk-7R55YTL6.js";import{b as c}from"./chunk-45DFJJAO.js";import{d as l}from"./chunk-OF426VSL.js";import{ia as a,ma as t}from"./chunk-ZPV56E2J.js";var S=(()=>{class e{constructor(o,i,r,s){this.toastr=o,this.authService=i,this.router=r,this.permissionService=s}canActivate(o,i){let r=JSON.parse(window.localStorage.getItem("user")),s=new Date,n=!1;if(r!=null){let h=new Date(r?.Token?.expiredAt);s<h?n=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return n}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(i){return new(i||e)(t(c),t(u),t(l),t(p))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{S as a};
@@ -1 +1 @@
1
- import{a as n}from"./chunk-S5FQJLG5.js";import{a as s}from"./chunk-J3PHESB2.js";import"./chunk-RDXDKWLL.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-VDNUDZOQ.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import"./chunk-45DFJJAO.js";import{c as m,g as c}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as i,ic as r,jc as p,kc as l,lc as o,mb as a}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var u=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Multi Channel Row Comparison",Url:"/menu/price/update"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=i({type:e,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,C){t&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),l()()(),o(4,"router-outlet")),t&2&&(a(3),r("Tabs",C.priceTabs))},dependencies:[s,c,m],encapsulation:2,changeDetection:0})}}return e})();var S=[{path:"",component:u,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-FFU3JAIJ.js").then(e=>e.PricePosChannelComponent)},canActivate:[n],data:{title:"Global Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-QJ4D3KFN.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[n],data:{title:"Price Single Channel Comparison"}},{path:"update",loadComponent(){return import("./chunk-Q5H2PXZY.js").then(e=>e.PriceUpdateComponent)},canActivate:[n],data:{title:"Multi Channel Row Comparison"}}]}];export{S as routes};
1
+ import{a as n}from"./chunk-46MLNUK6.js";import{a as s}from"./chunk-J3PHESB2.js";import"./chunk-RDXDKWLL.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-VB4EKTTU.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import"./chunk-45DFJJAO.js";import{c as m,g as c}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as i,ic as r,jc as p,kc as l,lc as o,mb as a}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var u=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Multi Channel Row Comparison",Url:"/menu/price/update"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=i({type:e,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,C){t&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),l()()(),o(4,"router-outlet")),t&2&&(a(3),r("Tabs",C.priceTabs))},dependencies:[s,c,m],encapsulation:2,changeDetection:0})}}return e})();var S=[{path:"",component:u,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-JURDZGFU.js").then(e=>e.PricePosChannelComponent)},canActivate:[n],data:{title:"Global Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-54E2GKVP.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[n],data:{title:"Price Single Channel Comparison"}},{path:"update",loadComponent(){return import("./chunk-NFKQXOQD.js").then(e=>e.PriceUpdateComponent)},canActivate:[n],data:{title:"Multi Channel Row Comparison"}}]}];export{S as routes};
@@ -1 +1 @@
1
- import{a as Te}from"./chunk-LZ4OSFKB.js";import{a as D}from"./chunk-ISMIPSYN.js";import{a as Fe,b as we,c as be,d as B,e as L}from"./chunk-IBZCREPJ.js";import{a as fe}from"./chunk-IPMCCZZW.js";import"./chunk-6GSJBXEE.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-3BV4FPZE.js";import{a as ye}from"./chunk-MU7RI22T.js";import{a as Pe,b as ve}from"./chunk-Y5RUW5VE.js";import{c as xe,d as Se}from"./chunk-52BVJZIG.js";import"./chunk-VINT75RU.js";import{a as ue}from"./chunk-7ES2Z445.js";import"./chunk-CHCLLSOR.js";import"./chunk-72AE6737.js";import"./chunk-SBLTWRFW.js";import{a as ge}from"./chunk-SSK4EUDM.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-MYDVMG67.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{e as he}from"./chunk-KXLYQDZR.js";import{a as me,b as Ce}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import{c as pe}from"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-WU3SNCIC.js";import"./chunk-A32JPG5P.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{a as ae}from"./chunk-ZSUWHVKX.js";import{h as oe}from"./chunk-VDNUDZOQ.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import{b as ne,c as ie}from"./chunk-7R55YTL6.js";import{c as Y}from"./chunk-NNVT5X6O.js";import{b as re,c as le,h as ce,m as se,o as _e,z as de}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as ee,e as te}from"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{D as I,K as X,z as Q}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{$c as J,E as q,Eb as W,Ga as S,Kb as T,Lc as k,Oc as m,Pc as O,Qc as w,Sc as R,Tc as $,Uc as U,V as G,Yc as j,aa as K,bc as g,bd as V,dc as u,ec as E,gc as M,hc as N,ic as p,jc as a,kb as b,kc as l,kd as v,lc as P,ld as F,mb as c,md as Z,na as x,sc as f,ua as _,va as d,xc as C,zc as r}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as z,b as H}from"./chunk-66YHNWRR.js";var A=i=>[i];function Ve(i,s){if(i&1){let e=f();a(0,"button",13),C("click",function(){_(e);let t=r(),n=r(2);return d(n.updateStock(t))}),P(1,"i",14),m(2," Update "),l()}}function Ie(i,s){if(i&1){let e=f();a(0,"div",8),g(1,Ve,3,0,"button",10),a(2,"button",11),C("click",function(){_(e);let t=r(2);return d(t.openExportDialog())}),P(3,"i",12),a(4,"span"),m(5,"Export"),l()()()}if(i&2){let e=r(2);c(),u(e.productService.hasSelectionVariant(s)?1:-1)}}function De(i,s){if(i&1){let e=f();a(0,"th")(1,"input",28),C("change",function(t){_(e);let n=r(),h=r(2);return d(h.onSelectAllSKU(t.target.checked,n))}),l()()}}function Ee(i,s){if(i&1){let e=f();a(0,"input",45),U("ngModelChange",function(t){_(e);let n=r(4).$implicit;return $(n.selected,t)||(n.selected=t),d(t)}),C("ngModelChange",function(){_(e);let t=r(4).$implicit,n=r(3);return d(n.onCheckboxStateProduct(t))}),l()}if(i&2){let e=r(4).$implicit;R("ngModel",e.selected)}}function Me(i,s){if(i&1&&T(0,Ee,1,1,"ng-template",22),i&2){let e=r(6);p("ngxPermissionsOnly",V(1,A,e.rolePriceEdit))}}function Ne(i,s){if(i&1){let e=f();a(0,"img",46),C("click",function(t){_(e);let n=r(3).$implicit,h=r(3);return d(h.onZoomImage(t,n==null?null:n.ImageUrl))}),l()}if(i&2){let e=r(3).$implicit;p("src",j(e.ThumbnailUrl),b)}}function ke(i,s){i&1&&P(0,"img",41)}function Oe(i,s){if(i&1&&(a(0,"small",44),m(1),l()),i&2){let e=r(3).$implicit;c(),w("(",e.Category,")")}}function Re(i,s){if(i&1&&(a(0,"td",39)(1,"div",31),g(2,Me,1,3,null,22),a(3,"div"),g(4,Ne,1,2,"img",40)(5,ke,1,0,"img",41),l()()(),a(6,"td",42)(7,"span",43),m(8),l(),g(9,Oe,2,1,"small",44),l()),i&2){let e=r(2).$implicit;p("rowSpan",e.Variants.length),c(2),u((e.Variants==null?null:e.Variants.length)>1?2:-1),c(2),u(e.ThumbnailUrl?4:5),c(2),p("rowSpan",e.Variants.length),c(2),O(e.Name),c(),u(e.Category?9:-1)}}function $e(i,s){if(i&1){let e=f();a(0,"input",49),U("ngModelChange",function(t){_(e);let n=r(2).$implicit;return $(n.selected,t)||(n.selected=t),d(t)}),l()}if(i&2){let e=r(2).$implicit;R("ngModel",e.selected)}}function Ue(i,s){if(i&1&&(a(0,"td",47),g(1,$e,1,1,"input",48),l()),i&2){let e=r().$implicit;c(),u(e.UnitPrice>=0?1:-1)}}function Be(i,s){i&1&&(a(0,"div",32),m(1," Not Found "),l())}function Le(i,s){if(i&1&&(a(0,"div"),m(1),v(2,"number"),l()),i&2){let e=r().$implicit;c(),w(" ",F(2,1,e.UnitPrice)," ")}}function Ae(i,s){if(i&1&&(a(0,"div",33)(1,"a",35),P(2,"i",50),l()()),i&2){let e=r().$implicit,o=r(4);c(),p("href",o.hostName()+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),b)}}function ze(i,s){if(i&1){let e=f();a(0,"div",51),C("click",function(){_(e);let t=r().$implicit,n=r().$implicit,h=r(2),y=r();return d(y.openTableDialog(t,n,h))}),m(1),v(2,"number"),l()}if(i&2){let e=r().$implicit;c(),w(" ",F(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function He(i,s){if(i&1){let e=f();a(0,"tr",29),g(1,Re,10,6),a(2,"td",20),m(3),l(),a(4,"td",23)(5,"span",30),m(6),l()(),T(7,Ue,2,1,"ng-template",22),a(8,"td",23)(9,"div",31),g(10,Be,2,0,"div",32),g(11,Le,3,3,"div"),g(12,Ae,3,1,"div",33),l()(),a(13,"td",23)(14,"div",31),g(15,ze,3,3,"div",34),a(16,"div",33)(17,"a",35),P(18,"i",36),l()(),a(19,"div",33)(20,"div",37),C("click",function(){let t=_(e).$implicit,n=r(4);return d(n.refreshPrice(t))}),P(21,"i",38),l()()()()()}if(i&2){let e=s.$implicit,o=s.$index,t=r(4);c(),u(o==0?1:-1),c(2),O(e.Model),c(2),k("text-decoration-line-through",e.Discontinued),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),c(),w(" ",e.Code," "),c(),p("ngxPermissionsOnly",V(14,A,t.rolePriceEdit)),c(3),u((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),c(),k("bg-gradient-warning",e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price)),c(2),u(e.Channel.length>0?15:-1),c(2),p("href",e.Channel[0]==null?null:e.Channel[0].Url,b)}}function qe(i,s){if(i&1&&M(0,He,22,16,"tr",29,E),i&2){let e=s.$implicit;N(e.Variants)}}function Ge(i,s){if(i&1){let e=f();a(0,"div",9)(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr")(5,"th",18),m(6," Product "),a(7,"div")(8,"mat-slide-toggle",19),C("ngModelChange",function(t){_(e);let n=r(2);return d(n.toggleDifferentInventory.set(t))})("toggleChange",function(){_(e);let t=r(2);return d(t.onToggleDifferentInventory())}),a(9,"small",6),m(10,"FILTER DIFFERENT PRICE"),l()()()(),a(11,"th",20),m(12,"Variant"),l(),a(13,"th",21),m(14,"SKU"),l(),T(15,De,2,0,"ng-template",22),a(16,"th",23),m(17,"POS"),l(),a(18,"th",23)(19,"div",24),C("click",function(){_(e);let t=r(2);return d(t.openModalFilter())}),P(20,"img",25),a(21,"span",26),m(22),v(23,"stringLimit"),l()()()()(),a(24,"tbody"),M(25,qe,2,0,null,null,E),l()(),a(27,"infinite-paginator",27),v(28,"async"),C("onNextPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onNextPage(t.searchFilter()))})("onLastPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onLastPage(t.searchFilter()))})("onGetRowCount",function(){_(e);let t=r(2);return d(t.infinitePagination.getRowCount(t.searchFilter()))}),l()()()}if(i&2){let e,o,t,n=r(2);c(8),p("ngModel",n.toggleDifferentInventory()),c(7),p("ngxPermissionsOnly",V(16,A,n.rolePriceEdit)),c(4),p("matTooltip",((e=n.selectedChannel())==null||e.Name==null?null:e.Name.length)>=20?(e=n.selectedChannel())==null?null:e.Name:""),c(),p("src",(o=n.selectedChannel())==null?null:o.Img,b),c(2),w(" ",Z(23,11,(t=n.selectedChannel())==null?null:t.Name,20)," "),c(3),N(s),c(2),p("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",F(28,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function Ke(i,s){if(i&1){let e=f();a(0,"mainpanel",1),C("textChange",function(t){_(e);let n=r();return d(n.updateFilter("text",t))})("onSubmit",function(){_(e);let t=r();return d(t.onSearch())}),a(1,"filters")(2,"div",2)(3,"label",3),m(4,"Channel"),l(),a(5,"app-channel-options-v2",4),C("ngModelChange",function(t){_(e);let n=r();return d(n.updateFilter("ChannelID",t))}),l()(),a(6,"div",2)(7,"filter-query-type",5),C("numberFilterComparatorChange",function(t){_(e);let n=r();return d(n.updateFilter("NumberFilterComparator",t))})("searchTypeChange",function(t){_(e);let n=r();return d(n.updateFilter("SearchType",t))}),l()(),a(8,"div",2)(9,"label",6),m(10,"Page Number"),l(),a(11,"input",7),C("ngModelChange",function(t){_(e);let n=r();return d(n.updateFilter("PageNumber",t))}),l()(),a(12,"div")(13,"label",6),m(14,"Page Size"),l(),a(15,"input",7),C("ngModelChange",function(t){_(e);let n=r();return d(n.updateFilter("RowCount",t))}),l()()(),a(16,"actions"),g(17,Ie,6,1,"div",8),v(18,"async"),l(),a(19,"content"),g(20,Ge,29,18,"div",9),v(21,"async"),l()()}if(i&2){let e,o,t=s,n=r();p("headerTitle",n.pageTitle())("text",n.searchFilter().text)("searchBoxPlaceHolder",n.searchPlaceholder()),c(5),p("ngModel",n.searchFilter().ChannelID),c(2),p("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions)("numberFilterComparator",n.searchFilter().NumberFilterComparator)("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions)("searchType",n.searchFilter().SearchType),c(4),p("ngModel",n.searchFilter().PageNumber),c(4),p("ngModel",n.searchFilter().RowCount),c(2),u((e=F(18,12,n.data$))?17:-1,e),c(3),u((o=F(21,14,n.data$))?20:-1,o)}}var Tt=(()=>{class i{constructor(){this.http=x(te),this.toastr=x(ee),this.dialog=x(pe),this.productService=x(ge),this.biggerPictureService=x(ue),this.authService=x(oe),this.mainPanelService=x(me),this.decimalPipe=x(I),this.placeholderService=x(xe),this.infinitePagination=x(B),this.updateResHandling=x(L),this.pageTitle=S("Price Single Channel Comparison"),this.toggleDifferentInventory=S(!1),this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.searchFilter=S({}),this.hostName=S(""),this.rolePriceEdit=ae.PriceUpdate,this.channelOptions=S([]),this.selectedChannel=S(null),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.searchPlaceholder=S("Search ...");let e=this.authService;this.hostName.set(this.authService.getDomain()),this.data$=this.infinitePagination.data$.pipe(G(1)),this.channelOptions.set(e.getChannels())}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(K(e=>{this.searchFilter.set(e.Filter),this.searchFilter.update(o=>(o.filterModel=D.ALL,o)),this.initSearchPlaceholder(),this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter().SearchType,this.searchFilter().NumberFilterComparator))}onToggleDifferentInventory(){this.toggleDifferentInventory()?this.searchFilter.update(e=>(e.filterModel=D.ALL,e)):this.searchFilter.update(e=>(e.filterModel=D.DIFFERENCE,e)),this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(o=>(o.selected=e.selected,o))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(h=>({ID:h.ID,ChannelID:h.Channel[0].ChannelID,Code:h.Code,Price:h.UnitPrice})),n={ListChannelID:[this.searchFilter().ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",n).subscribe(h=>{this.onSearch(),this.handlingUpdateStock(h.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let o=e.failure_list,t=e.success_list;this.updateResHandling.responseHandling(t,o,"Price")}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let o={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",o).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel(),this.initSearchPlaceholder()}openTableDialog(e,o,t){let n=JSON.parse(JSON.stringify(e));this.dialog.open(Fe,{data:{Name:o.Name,Variant:n,ChannelID:n?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:n?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(q(y=>Y.IsNotEmpty(y))).subscribe(y=>{this.updateItemAfterDialog(y,e)})}updateItemAfterDialog(e,o){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(n=>{let h=this.productService.findChannelById(t.ID,this.channelOptions()),y=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${h.Name} to ${y}`,"Success"),this.infinitePagination.reloadPagination(this.searchFilter())})}initSelectedChannel(){this.selectedChannel.set(this.channelOptions().find(e=>e.ID==this.searchFilter().ChannelID))}onSelectAllSKU(e,o){o=o.map(t=>(t.Variants=t.Variants.map(n=>(n.selected=e,n)),t))}onZoomImage(e,o){this.biggerPictureService.openBiggerPicture(e,o)}openExportDialog(){this.dialog.open(ye,{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()}updateFilter(e,o){this.searchFilter.update(t=>H(z({},t),{[e]:o}))}static{this.\u0275fac=function(o){return new(o||i)}}static{this.\u0275cmp=W({type:i,selectors:[["app-price-single-channel"]],features:[J([B,Te,X("https://resc.cloudinary.com/"),I,L])],decls:2,vars:3,consts:[[1,"single-price",3,"headerTitle","text","searchBoxPlaceHolder"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text","searchBoxPlaceHolder"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"d-flex"],[1,"container-fluid","mt-5"],[1,"btn","btn-success"],[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,"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"],[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"],[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"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"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","8px"],[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","8px",3,"click","src"],[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(o,t){if(o&1&&(g(0,Ke,22,16,"mainpanel",0),v(1,"async")),o&2){let n;u((n=F(1,1,t.loader$))?0:-1,n)}},dependencies:[Ce,de,le,_e,re,ce,se,be,ie,ne,ve,Pe,fe,he,Se,we,Q,I],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}"]})}}return i})();export{Tt as PriceSingleChannelComponent};
1
+ import{a as Te}from"./chunk-LZ4OSFKB.js";import{a as D}from"./chunk-ISMIPSYN.js";import{a as Fe,b as we,c as be,d as B,e as L}from"./chunk-IBZCREPJ.js";import{a as fe}from"./chunk-T7PNPUCK.js";import"./chunk-6GSJBXEE.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-3BV4FPZE.js";import{a as ye}from"./chunk-MU7RI22T.js";import{a as Pe,b as ve}from"./chunk-Y5RUW5VE.js";import{c as xe,d as Se}from"./chunk-52BVJZIG.js";import"./chunk-VINT75RU.js";import{a as ue}from"./chunk-7ES2Z445.js";import"./chunk-CHCLLSOR.js";import"./chunk-72AE6737.js";import"./chunk-SBLTWRFW.js";import{a as ge}from"./chunk-KYZGVVJM.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-ASKT24WA.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{e as he}from"./chunk-KXLYQDZR.js";import{a as me,b as Ce}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import{c as pe}from"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-WU3SNCIC.js";import"./chunk-A32JPG5P.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{a as ae}from"./chunk-ZSUWHVKX.js";import{h as oe}from"./chunk-VB4EKTTU.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import{b as ne,c as ie}from"./chunk-7R55YTL6.js";import{c as Y}from"./chunk-NNVT5X6O.js";import{b as re,c as le,h as ce,m as se,o as _e,z as de}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as ee,e as te}from"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{D as I,K as X,z as Q}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{$c as J,E as q,Eb as W,Ga as S,Kb as T,Lc as k,Oc as m,Pc as O,Qc as w,Sc as R,Tc as $,Uc as U,V as G,Yc as j,aa as K,bc as g,bd as V,dc as u,ec as E,gc as M,hc as N,ic as p,jc as a,kb as b,kc as l,kd as v,lc as P,ld as F,mb as c,md as Z,na as x,sc as f,ua as _,va as d,xc as C,zc as r}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as z,b as H}from"./chunk-66YHNWRR.js";var A=i=>[i];function Ve(i,s){if(i&1){let e=f();a(0,"button",13),C("click",function(){_(e);let t=r(),n=r(2);return d(n.updateStock(t))}),P(1,"i",14),m(2," Update "),l()}}function Ie(i,s){if(i&1){let e=f();a(0,"div",8),g(1,Ve,3,0,"button",10),a(2,"button",11),C("click",function(){_(e);let t=r(2);return d(t.openExportDialog())}),P(3,"i",12),a(4,"span"),m(5,"Export"),l()()()}if(i&2){let e=r(2);c(),u(e.productService.hasSelectionVariant(s)?1:-1)}}function De(i,s){if(i&1){let e=f();a(0,"th")(1,"input",28),C("change",function(t){_(e);let n=r(),h=r(2);return d(h.onSelectAllSKU(t.target.checked,n))}),l()()}}function Ee(i,s){if(i&1){let e=f();a(0,"input",45),U("ngModelChange",function(t){_(e);let n=r(4).$implicit;return $(n.selected,t)||(n.selected=t),d(t)}),C("ngModelChange",function(){_(e);let t=r(4).$implicit,n=r(3);return d(n.onCheckboxStateProduct(t))}),l()}if(i&2){let e=r(4).$implicit;R("ngModel",e.selected)}}function Me(i,s){if(i&1&&T(0,Ee,1,1,"ng-template",22),i&2){let e=r(6);p("ngxPermissionsOnly",V(1,A,e.rolePriceEdit))}}function Ne(i,s){if(i&1){let e=f();a(0,"img",46),C("click",function(t){_(e);let n=r(3).$implicit,h=r(3);return d(h.onZoomImage(t,n==null?null:n.ImageUrl))}),l()}if(i&2){let e=r(3).$implicit;p("src",j(e.ThumbnailUrl),b)}}function ke(i,s){i&1&&P(0,"img",41)}function Oe(i,s){if(i&1&&(a(0,"small",44),m(1),l()),i&2){let e=r(3).$implicit;c(),w("(",e.Category,")")}}function Re(i,s){if(i&1&&(a(0,"td",39)(1,"div",31),g(2,Me,1,3,null,22),a(3,"div"),g(4,Ne,1,2,"img",40)(5,ke,1,0,"img",41),l()()(),a(6,"td",42)(7,"span",43),m(8),l(),g(9,Oe,2,1,"small",44),l()),i&2){let e=r(2).$implicit;p("rowSpan",e.Variants.length),c(2),u((e.Variants==null?null:e.Variants.length)>1?2:-1),c(2),u(e.ThumbnailUrl?4:5),c(2),p("rowSpan",e.Variants.length),c(2),O(e.Name),c(),u(e.Category?9:-1)}}function $e(i,s){if(i&1){let e=f();a(0,"input",49),U("ngModelChange",function(t){_(e);let n=r(2).$implicit;return $(n.selected,t)||(n.selected=t),d(t)}),l()}if(i&2){let e=r(2).$implicit;R("ngModel",e.selected)}}function Ue(i,s){if(i&1&&(a(0,"td",47),g(1,$e,1,1,"input",48),l()),i&2){let e=r().$implicit;c(),u(e.UnitPrice>=0?1:-1)}}function Be(i,s){i&1&&(a(0,"div",32),m(1," Not Found "),l())}function Le(i,s){if(i&1&&(a(0,"div"),m(1),v(2,"number"),l()),i&2){let e=r().$implicit;c(),w(" ",F(2,1,e.UnitPrice)," ")}}function Ae(i,s){if(i&1&&(a(0,"div",33)(1,"a",35),P(2,"i",50),l()()),i&2){let e=r().$implicit,o=r(4);c(),p("href",o.hostName()+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),b)}}function ze(i,s){if(i&1){let e=f();a(0,"div",51),C("click",function(){_(e);let t=r().$implicit,n=r().$implicit,h=r(2),y=r();return d(y.openTableDialog(t,n,h))}),m(1),v(2,"number"),l()}if(i&2){let e=r().$implicit;c(),w(" ",F(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function He(i,s){if(i&1){let e=f();a(0,"tr",29),g(1,Re,10,6),a(2,"td",20),m(3),l(),a(4,"td",23)(5,"span",30),m(6),l()(),T(7,Ue,2,1,"ng-template",22),a(8,"td",23)(9,"div",31),g(10,Be,2,0,"div",32),g(11,Le,3,3,"div"),g(12,Ae,3,1,"div",33),l()(),a(13,"td",23)(14,"div",31),g(15,ze,3,3,"div",34),a(16,"div",33)(17,"a",35),P(18,"i",36),l()(),a(19,"div",33)(20,"div",37),C("click",function(){let t=_(e).$implicit,n=r(4);return d(n.refreshPrice(t))}),P(21,"i",38),l()()()()()}if(i&2){let e=s.$implicit,o=s.$index,t=r(4);c(),u(o==0?1:-1),c(2),O(e.Model),c(2),k("text-decoration-line-through",e.Discontinued),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),c(),w(" ",e.Code," "),c(),p("ngxPermissionsOnly",V(14,A,t.rolePriceEdit)),c(3),u((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),c(),k("bg-gradient-warning",e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price)),c(2),u(e.Channel.length>0?15:-1),c(2),p("href",e.Channel[0]==null?null:e.Channel[0].Url,b)}}function qe(i,s){if(i&1&&M(0,He,22,16,"tr",29,E),i&2){let e=s.$implicit;N(e.Variants)}}function Ge(i,s){if(i&1){let e=f();a(0,"div",9)(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr")(5,"th",18),m(6," Product "),a(7,"div")(8,"mat-slide-toggle",19),C("ngModelChange",function(t){_(e);let n=r(2);return d(n.toggleDifferentInventory.set(t))})("toggleChange",function(){_(e);let t=r(2);return d(t.onToggleDifferentInventory())}),a(9,"small",6),m(10,"FILTER DIFFERENT PRICE"),l()()()(),a(11,"th",20),m(12,"Variant"),l(),a(13,"th",21),m(14,"SKU"),l(),T(15,De,2,0,"ng-template",22),a(16,"th",23),m(17,"POS"),l(),a(18,"th",23)(19,"div",24),C("click",function(){_(e);let t=r(2);return d(t.openModalFilter())}),P(20,"img",25),a(21,"span",26),m(22),v(23,"stringLimit"),l()()()()(),a(24,"tbody"),M(25,qe,2,0,null,null,E),l()(),a(27,"infinite-paginator",27),v(28,"async"),C("onNextPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onNextPage(t.searchFilter()))})("onLastPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onLastPage(t.searchFilter()))})("onGetRowCount",function(){_(e);let t=r(2);return d(t.infinitePagination.getRowCount(t.searchFilter()))}),l()()()}if(i&2){let e,o,t,n=r(2);c(8),p("ngModel",n.toggleDifferentInventory()),c(7),p("ngxPermissionsOnly",V(16,A,n.rolePriceEdit)),c(4),p("matTooltip",((e=n.selectedChannel())==null||e.Name==null?null:e.Name.length)>=20?(e=n.selectedChannel())==null?null:e.Name:""),c(),p("src",(o=n.selectedChannel())==null?null:o.Img,b),c(2),w(" ",Z(23,11,(t=n.selectedChannel())==null?null:t.Name,20)," "),c(3),N(s),c(2),p("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",F(28,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function Ke(i,s){if(i&1){let e=f();a(0,"mainpanel",1),C("textChange",function(t){_(e);let n=r();return d(n.updateFilter("text",t))})("onSubmit",function(){_(e);let t=r();return d(t.onSearch())}),a(1,"filters")(2,"div",2)(3,"label",3),m(4,"Channel"),l(),a(5,"app-channel-options-v2",4),C("ngModelChange",function(t){_(e);let n=r();return d(n.updateFilter("ChannelID",t))}),l()(),a(6,"div",2)(7,"filter-query-type",5),C("numberFilterComparatorChange",function(t){_(e);let n=r();return d(n.updateFilter("NumberFilterComparator",t))})("searchTypeChange",function(t){_(e);let n=r();return d(n.updateFilter("SearchType",t))}),l()(),a(8,"div",2)(9,"label",6),m(10,"Page Number"),l(),a(11,"input",7),C("ngModelChange",function(t){_(e);let n=r();return d(n.updateFilter("PageNumber",t))}),l()(),a(12,"div")(13,"label",6),m(14,"Page Size"),l(),a(15,"input",7),C("ngModelChange",function(t){_(e);let n=r();return d(n.updateFilter("RowCount",t))}),l()()(),a(16,"actions"),g(17,Ie,6,1,"div",8),v(18,"async"),l(),a(19,"content"),g(20,Ge,29,18,"div",9),v(21,"async"),l()()}if(i&2){let e,o,t=s,n=r();p("headerTitle",n.pageTitle())("text",n.searchFilter().text)("searchBoxPlaceHolder",n.searchPlaceholder()),c(5),p("ngModel",n.searchFilter().ChannelID),c(2),p("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions)("numberFilterComparator",n.searchFilter().NumberFilterComparator)("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions)("searchType",n.searchFilter().SearchType),c(4),p("ngModel",n.searchFilter().PageNumber),c(4),p("ngModel",n.searchFilter().RowCount),c(2),u((e=F(18,12,n.data$))?17:-1,e),c(3),u((o=F(21,14,n.data$))?20:-1,o)}}var Tt=(()=>{class i{constructor(){this.http=x(te),this.toastr=x(ee),this.dialog=x(pe),this.productService=x(ge),this.biggerPictureService=x(ue),this.authService=x(oe),this.mainPanelService=x(me),this.decimalPipe=x(I),this.placeholderService=x(xe),this.infinitePagination=x(B),this.updateResHandling=x(L),this.pageTitle=S("Price Single Channel Comparison"),this.toggleDifferentInventory=S(!1),this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.searchFilter=S({}),this.hostName=S(""),this.rolePriceEdit=ae.PriceUpdate,this.channelOptions=S([]),this.selectedChannel=S(null),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.searchPlaceholder=S("Search ...");let e=this.authService;this.hostName.set(this.authService.getDomain()),this.data$=this.infinitePagination.data$.pipe(G(1)),this.channelOptions.set(e.getChannels())}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(K(e=>{this.searchFilter.set(e.Filter),this.searchFilter.update(o=>(o.filterModel=D.ALL,o)),this.initSearchPlaceholder(),this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter().SearchType,this.searchFilter().NumberFilterComparator))}onToggleDifferentInventory(){this.toggleDifferentInventory()?this.searchFilter.update(e=>(e.filterModel=D.ALL,e)):this.searchFilter.update(e=>(e.filterModel=D.DIFFERENCE,e)),this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(o=>(o.selected=e.selected,o))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(h=>({ID:h.ID,ChannelID:h.Channel[0].ChannelID,Code:h.Code,Price:h.UnitPrice})),n={ListChannelID:[this.searchFilter().ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",n).subscribe(h=>{this.onSearch(),this.handlingUpdateStock(h.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let o=e.failure_list,t=e.success_list;this.updateResHandling.responseHandling(t,o,"Price")}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let o={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",o).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel(),this.initSearchPlaceholder()}openTableDialog(e,o,t){let n=JSON.parse(JSON.stringify(e));this.dialog.open(Fe,{data:{Name:o.Name,Variant:n,ChannelID:n?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:n?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(q(y=>Y.IsNotEmpty(y))).subscribe(y=>{this.updateItemAfterDialog(y,e)})}updateItemAfterDialog(e,o){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(n=>{let h=this.productService.findChannelById(t.ID,this.channelOptions()),y=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${h.Name} to ${y}`,"Success"),this.infinitePagination.reloadPagination(this.searchFilter())})}initSelectedChannel(){this.selectedChannel.set(this.channelOptions().find(e=>e.ID==this.searchFilter().ChannelID))}onSelectAllSKU(e,o){o=o.map(t=>(t.Variants=t.Variants.map(n=>(n.selected=e,n)),t))}onZoomImage(e,o){this.biggerPictureService.openBiggerPicture(e,o)}openExportDialog(){this.dialog.open(ye,{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()}updateFilter(e,o){this.searchFilter.update(t=>H(z({},t),{[e]:o}))}static{this.\u0275fac=function(o){return new(o||i)}}static{this.\u0275cmp=W({type:i,selectors:[["app-price-single-channel"]],features:[J([B,Te,X("https://resc.cloudinary.com/"),I,L])],decls:2,vars:3,consts:[[1,"single-price",3,"headerTitle","text","searchBoxPlaceHolder"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text","searchBoxPlaceHolder"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"d-flex"],[1,"container-fluid","mt-5"],[1,"btn","btn-success"],[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,"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"],[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"],[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"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"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","8px"],[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","8px",3,"click","src"],[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(o,t){if(o&1&&(g(0,Ke,22,16,"mainpanel",0),v(1,"async")),o&2){let n;u((n=F(1,1,t.loader$))?0:-1,n)}},dependencies:[Ce,de,le,_e,re,ce,se,be,ie,ne,ve,Pe,fe,he,Se,we,Q,I],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}"]})}}return i})();export{Tt as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-DCKVIQWI.js";import"./chunk-4VNQYYVV.js";import{a as n}from"./chunk-S5FQJLG5.js";import"./chunk-NIRJAWTX.js";import"./chunk-7KKV4BRH.js";import"./chunk-VDNUDZOQ.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import"./chunk-45DFJJAO.js";import{c as a}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as r,lc as i}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var p=(()=>{class t{static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=r({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(e,c){e&1&&i(0,"router-outlet")},dependencies:[a],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media(min-width:1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return t})();var h=[{path:"",component:p,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-3I7S5TZI.js").then(t=>t.routes),canActivate:[n,o]},{path:"download",loadChildren:()=>import("./chunk-MV6SQJHJ.js").then(t=>t.routes),canActivate:[n,o]},{path:"upload",loadComponent:()=>import("./chunk-33TDKUXQ.js").then(t=>t.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[n,o]}]}];export{h as routes};
1
+ import{a as o}from"./chunk-DCKVIQWI.js";import"./chunk-4VNQYYVV.js";import{a as n}from"./chunk-46MLNUK6.js";import"./chunk-NIRJAWTX.js";import"./chunk-7KKV4BRH.js";import"./chunk-VB4EKTTU.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import"./chunk-45DFJJAO.js";import{c as a}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as r,lc as i}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var p=(()=>{class t{static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=r({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(e,c){e&1&&i(0,"router-outlet")},dependencies:[a],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media(min-width:1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return t})();var h=[{path:"",component:p,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-LALJHEQ4.js").then(t=>t.routes),canActivate:[n,o]},{path:"download",loadChildren:()=>import("./chunk-6MA3X2DS.js").then(t=>t.routes),canActivate:[n,o]},{path:"upload",loadComponent:()=>import("./chunk-ZPKMQUVX.js").then(t=>t.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[n,o]}]}];export{h as routes};
@@ -1 +1 @@
1
- import{a as Nt}from"./chunk-MU7RI22T.js";import"./chunk-Y5RUW5VE.js";import{c as yt,d as vt}from"./chunk-52BVJZIG.js";import"./chunk-VINT75RU.js";import{e as bt}from"./chunk-OESZXCMJ.js";import"./chunk-GIPWMAZL.js";import{a as St}from"./chunk-7ES2Z445.js";import{a as xt}from"./chunk-OPRZQ3AF.js";import"./chunk-SSQ23ZNC.js";import"./chunk-CHCLLSOR.js";import"./chunk-72AE6737.js";import"./chunk-SBLTWRFW.js";import{a as Pt}from"./chunk-KMCVYMXQ.js";import{a as ft}from"./chunk-SSK4EUDM.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-BKR7YPEW.js";import"./chunk-MYDVMG67.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import"./chunk-KXLYQDZR.js";import{b as gt}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import{c as Ct}from"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-A32JPG5P.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import{b as ht}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{a as z}from"./chunk-ZSUWHVKX.js";import{h as dt}from"./chunk-VDNUDZOQ.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import{a as G}from"./chunk-P5OAPFNC.js";import{b as ct,c as st}from"./chunk-7R55YTL6.js";import{c as N}from"./chunk-NNVT5X6O.js";import{b as pt,h as _t,m as mt,z as ut}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as rt,e as U}from"./chunk-45DFJJAO.js";import{d as lt}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{D as at,z as ot}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{E as V,Eb as et,Ga as P,I as q,Kb as A,Oc as d,Pc as it,Qc as y,Sc as $,T as J,Tc as L,Uc as W,V as Z,_ as Q,aa as k,ba as Y,bc as _,bd as R,cc as nt,d as K,dc as m,e as j,fc as I,gc as F,hc as T,ia as X,ic as p,jc as o,kb as v,kc as l,kd as b,lc as g,ld as S,ma as tt,mb as r,na as C,pc as D,qc as B,sc as f,t as w,ua as u,va as h,xc as x,zc as s}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as M,b as E}from"./chunk-66YHNWRR.js";var wt=(()=>{class e{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new j(null),this.destroy$=new K,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,i){i==0?this.disableNextButton=!0:this.disableNextButton=!(i<t.RowCount*t.PageNumber)}reloadPagination(t){N.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,i){t.RowCount=i,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new j(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(Q(this.destroy$),V(t=>t!=null),q(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(w(i=>i.Data))),Y(this.pagination$),J((t,i)=>{let[n,a]=t,[O]=i;return a.PageNumber==1?[O,a]:[n.concat(O),a]}),k(([t,i])=>{this.setPageNumberFooter(i),this.setPaginationButtonState(i,t.length)}),w(([t])=>t),Z())}static{this.\u0275fac=function(i){return new(i||e)(tt(U))}}static{this.\u0275prov=X({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var H=e=>[e];function Ft(e,c){if(e&1){let t=f();o(0,"button",11),x("click",function(){u(t);let n=s(3);return h(n.uploadMultipleProduct())}),g(1,"i",12),d(2),l()}if(e&2){let t,i=s(3);r(2),y(" upload (",(t=i.selectedProducts())==null?null:t.length,") ")}}function Tt(e,c){if(e&1&&(D(0),_(1,Ft,3,1,"button",10),B()),e&2){let t=s(2);r(),m(t.hasSelectionProduct()?1:-1)}}function Ot(e,c){e&1&&(D(0),g(1,"th",19),B())}function Mt(e,c){if(e&1){let t=f();o(0,"td",25)(1,"input",26),W("ngModelChange",function(n){u(t);let a=s(3).$implicit;return L(a.selected,n)||(a.selected=n),h(n)}),x("ngModelChange",function(){u(t);let n=s(4),a=s(3);return h(a.onSelectProduct(n))}),l()()}if(e&2){let t=s(3).$implicit;p("rowSpan",t==null?null:t.Variants.length),r(),$("ngModel",t.selected)}}function Et(e,c){if(e&1&&(D(0),_(1,Mt,2,2,"td",25),B()),e&2){let t=s().$index;r(),m(t==0?1:-1)}}function Vt(e,c){if(e&1){let t=f();o(0,"img",33),x("click",function(n){u(t);let a=s(3).$implicit,O=s(4);return h(O.onZoomImage(n,a==null?null:a.ImageUrl))}),l()}if(e&2){let t=s(3).$implicit;p("src",t==null?null:t.ImageUrl,v)}}function kt(e,c){e&1&&g(0,"img",29)}function At(e,c){if(e&1&&(o(0,"td",25)(1,"div",27),_(2,Vt,1,1,"img",28)(3,kt,1,0,"img",29),l()(),o(4,"td",30)(5,"h4",31)(6,"span",32),d(7),l()()()),e&2){let t=s(2).$implicit;p("rowSpan",t==null?null:t.Variants.length),r(2),m(t!=null&&t.ImageUrl?2:3),r(2),p("rowSpan",t==null?null:t.Variants.length),r(2),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),r(),y(" ",t==null?null:t.Name," ")}}function Dt(e,c){if(e&1&&(o(0,"div")(1,"a",21),g(2,"img",34),l()()),e&2){let t=c.$implicit;r(),p("href",t.URL,v),r(),p("src",t.Img,v)("matTooltip",t.Name)}}function Bt(e,c){if(e&1&&(o(0,"div"),g(1,"img",34),l()),e&2){let t=c.$implicit;r(),p("src",t.Img,v)("matTooltip",t.Name)}}function $t(e,c){if(e&1&&(o(0,"tr"),A(1,Et,2,1,"ng-container",2),_(2,At,8,5),o(3,"td"),d(4),l(),o(5,"td")(6,"span"),d(7),l(),o(8,"span",20)(9,"a",21),g(10,"i",22),l()()(),o(11,"td",23)(12,"div",24),F(13,Dt,3,3,"div",null,I),l()(),o(15,"td",23)(16,"div",24),F(17,Bt,2,2,"div",null,I),l()()()),e&2){let t=c.$implicit,i=c.$index,n=s(5);r(),p("ngxPermissionsOnly",R(5,H,n.uploadProductRole)),r(),m(i==0?2:-1),r(2),y(" ",t.Name," "),r(3),y(" ",t.Code," "),r(2),p("href",n.hostName()+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),v),r(4),T(t==null?null:t.Available),r(4),T(t==null?null:t.NotAvailable)}}function Lt(e,c){if(e&1&&F(0,$t,19,7,"tr",null,I),e&2){let t=c.$implicit;T(t.Variants)}}function Rt(e,c){e&1&&(o(0,"tbody"),F(1,Lt,2,0,null,null,I),l()),e&2&&(r(),T(c))}function Ut(e,c){if(e&1&&(o(0,"div",8)(1,"table",13)(2,"thead",14)(3,"tr"),A(4,Ot,2,0,"ng-container",2),o(5,"th",15),d(6," Product "),l(),o(7,"th",16),d(8,"Variant"),l(),o(9,"th",16),d(10,"SKU"),l(),o(11,"th",17),d(12,"Available In"),l(),o(13,"th",18),d(14,"Not Available In"),l()()(),_(15,Rt,3,0,"tbody"),b(16,"async"),l()()),e&2){let t,i=s(2);r(4),p("ngxPermissionsOnly",R(4,H,i.uploadProductRole)),r(11),m((t=S(16,2,i.data$))?15:-1,t)}}function jt(e,c){e&1&&(o(0,"div",9),g(1,"app-empty-state"),l())}function Wt(e,c){if(e&1){let t=f();o(0,"span",42),x("click",function(){u(t);let n=s(4);return h(n.getRowCount())}),o(1,"i",43),d(2,"?"),l()()}}function Gt(e,c){if(e&1&&(o(0,"span"),d(1),b(2,"number"),l()),e&2){let t=c;r(),it(S(2,1,t==null?null:t.Count))}}function zt(e,c){if(e&1){let t=f();o(0,"a",44),x("click",function(){u(t);let n=s(4);return h(n.onNextPage())}),g(1,"i",45),d(2," Next"),l()}}function Ht(e,c){if(e&1){let t=f();o(0,"a",46),x("click",function(){u(t);let n=s(4);return h(n.onLastPage())}),g(1,"i",47),d(2," Last"),l()}}function Kt(e,c){if(e&1&&(o(0,"div",35)(1,"div",36)(2,"div",37),d(3),b(4,"number"),_(5,Wt,3,0,"span",38),_(6,Gt,3,3,"span"),b(7,"async"),d(8),l()(),o(9,"div",39),_(10,zt,3,0,"a",40),_(11,Ht,3,0,"a",41),l()()),e&2){let t,i=s(),n=s(2);r(3),y(" Showing 1 - ",S(4,6,i==null?null:i.length)," of "),r(2),m(n.paginationService.hideCount?5:-1),r(),m((t=!n.paginationService.hideCount&&S(7,8,n.rowCount$))?6:-1,t),r(2),y(" records ~ ",n.paginationService.footerPageNumber," Page "),r(2),m(n.paginationService.disableNextButton&&!n.paginationService.goToLastPage?10:-1),r(),m(n.paginationService.disableNextButton&&!n.paginationService.goToLastPage?11:-1)}}function qt(e,c){if(e&1&&_(0,Kt,12,10,"div",35),e&2){let t=c;m((t==null?null:t.length)>0?0:-1)}}function Jt(e,c){if(e&1){let t=f();o(0,"mainpanel",1),x("onSubmit",function(n){u(t);let a=s();return h(a.searchProduct(n))}),o(1,"actions"),A(2,Tt,2,1,"ng-container",2),o(3,"button",3),x("click",function(){u(t);let n=s();return h(n.openExportDialog())}),g(4,"i",4),o(5,"span"),d(6,"Export"),l()()(),o(7,"filters")(8,"filter-query-type",5),W("numberFilterComparatorChange",function(n){u(t);let a=s();return L(a.searchFilter().NumberFilterComparator,n)||(a.searchFilter().NumberFilterComparator=n),h(n)})("searchTypeChange",function(n){u(t);let a=s();return L(a.searchFilter().SearchType,n)||(a.searchFilter().SearchType=n),h(n)}),l()(),o(9,"content")(10,"div",6)(11,"div",7),_(12,Ut,17,6,"div",8),b(13,"async"),nt(14,jt,2,0,"div",9),l(),_(15,qt,1,1),b(16,"async"),l()()()}if(e&2){let t,i,n=c,a=s();p("searchBoxPlaceHolder",a.searchPlaceholder()),r(2),p("ngxPermissionsOnly",R(12,H,a.uploadProductRole)),r(6),p("numberFilterComparatorOptions",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions),$("numberFilterComparator",a.searchFilter().NumberFilterComparator),p("searchTypeOptions",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions),$("searchType",a.searchFilter().SearchType),r(4),m(((t=S(13,8,a.data$))==null?null:t.length)>0?12:14),r(3),m((i=S(16,10,a.data$))?15:-1,i)}}var Te=(()=>{class e{constructor(){this.http=C(U),this.dialog=C(Ct),this.toastr=C(rt),this.route=C(lt),this.productService=C(ft),this.paginationService=C(wt),this.biggerPictureService=C(St),this.authService=C(dt),this.uploadProductService=C(bt),this.placeholderService=C(yt),this.loaderAPI="product/Load",this.notChannelAPI="product/GetNotInChannelV2",this.searchFilter=P({}),this.hostName=P(""),this.hasSelectionProduct=P(!1),this.selectedProducts=P([]),this.channelOptions=P([]),this.scanProductRole=z.ProductScan,this.uploadProductRole=z.ProductUpload,this.searchPlaceholder=P("Search ...");let t=this.authService;this.channelOptions.set(t.getChannels()),this.hostName.set(this.authService.getDomain())}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(k(t=>{this.searchFilter.set(t.Filter),this.paginationService.reloadPagination(t.Filter),this.initSearchPlaceholder()}))}initSearchPlaceholder(){let t=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(t.SearchType,t.NumberFilterComparator))}iniData(){this.data$=this.paginationService.data$.pipe(w(t=>(t=t.map(i=>(i.Variants=i.Variants.map(n=>(n.Available=this.productService.sortChannel(n.Available),n.NotAvailable=this.productService.sortChannel(n.NotAvailable),n.Available=this.assignLogoChannel(n.Available),n.NotAvailable=this.assignLogoChannel(n.NotAvailable),n)),i.Channel=i?.Variants[0]?.Available,i)),t)))}assignLogoChannel(t){return t=t.map(i=>(i.Img=N.getChannelLogoByTypeId(i.TypeID),i)),t}searchProduct(t){this.searchFilter.update(i=>E(M({},i),{text:t})),this.paginationService.reloadPagination(this.searchFilter()),this.initSearchPlaceholder()}scanAllProduct(){let t=this.searchFilter(),i=this.productService.findChannelById(t.ChannelID,this.channelOptions());this.productService.scanAll(t.ChannelID,t.ScanFull,t.UpdatedProduct,t.Async).subscribe(n=>{t.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,i,!t.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter()));t.ChannelID=N.GuidEMpty,this.dialog.open(xt,{data:{filter:t,channelOptions:this.channelOptions()},width:"600px"}).afterClosed().pipe(V(n=>N.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.update(a=>E(M({},a),{ChannelID:n.ChannelID,ScanFull:n.ScanFull,UpdatedProduct:n.UpdatedProduct,Async:n.Async})),this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1;let t=this.searchFilter(),i={text:t.text,NumberFilterComparator:t.NumberFilterComparator,SearchType:t.SearchType};this.rowCount$=this.http.post(G.GetNotInChannelRowCount,i)}onNextPage(){this.paginationService.onNextPage(this.searchFilter())}onLastPage(){let t=this.searchFilter(),i={text:t.text,NumberFilterComparator:t.NumberFilterComparator,SearchType:t.SearchType};this.http.post(G.GetNotInChannelRowCount,i).subscribe({next:n=>{this.searchFilter.update(a=>E(M({},a),{PageNumber:1})),this.paginationService.getAllData(this.searchFilter(),n.Count)}})}onZoomImage(t,i){this.biggerPictureService.openBiggerPicture(t,i)}onSelectProduct(t){this.hasSelectionProduct.set(this.productService.hasSelection(t)),this.selectedProducts.set(this.productService.selectedProduct(t))}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts()),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){let t=this.searchFilter();this.dialog.open(Nt,{data:{title:"Export Not In Channel",pageNumber:t.PageNumber,rowCount:t.RowCount,filterExport:t,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=et({type:e,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"searchBoxPlaceHolder"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","searchBoxPlaceHolder"],[4,"ngxPermissionsOnly"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"btn","btn-light","shadow","rounded","ms-2"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[2,"width","10px"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(i,n){if(i&1&&(_(0,Jt,17,14,"mainpanel",0),b(1,"async")),i&2){let a;m((a=S(1,1,n.loader$))?0:-1,a)}},dependencies:[gt,st,ct,vt,ut,pt,_t,mt,ht,Pt,ot,at],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media(min-width:1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}}return e})();export{Te as NotInChannelComponent};
1
+ import{a as Nt}from"./chunk-MU7RI22T.js";import"./chunk-Y5RUW5VE.js";import{c as yt,d as vt}from"./chunk-52BVJZIG.js";import"./chunk-VINT75RU.js";import{e as bt}from"./chunk-SHPCIBEX.js";import"./chunk-GIPWMAZL.js";import{a as St}from"./chunk-7ES2Z445.js";import{a as xt}from"./chunk-OPRZQ3AF.js";import"./chunk-SSQ23ZNC.js";import"./chunk-CHCLLSOR.js";import"./chunk-72AE6737.js";import"./chunk-SBLTWRFW.js";import{a as Pt}from"./chunk-KMCVYMXQ.js";import{a as ft}from"./chunk-KYZGVVJM.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-BKR7YPEW.js";import"./chunk-ASKT24WA.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import"./chunk-KXLYQDZR.js";import{b as gt}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import{c as Ct}from"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-A32JPG5P.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import{b as ht}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{a as z}from"./chunk-ZSUWHVKX.js";import{h as dt}from"./chunk-VB4EKTTU.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import{a as G}from"./chunk-P5OAPFNC.js";import{b as ct,c as st}from"./chunk-7R55YTL6.js";import{c as N}from"./chunk-NNVT5X6O.js";import{b as pt,h as _t,m as mt,z as ut}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as rt,e as U}from"./chunk-45DFJJAO.js";import{d as lt}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{D as at,z as ot}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{E as V,Eb as et,Ga as P,I as q,Kb as A,Oc as d,Pc as it,Qc as y,Sc as $,T as J,Tc as L,Uc as W,V as Z,_ as Q,aa as k,ba as Y,bc as _,bd as R,cc as nt,d as K,dc as m,e as j,fc as I,gc as F,hc as T,ia as X,ic as p,jc as o,kb as v,kc as l,kd as b,lc as g,ld as S,ma as tt,mb as r,na as C,pc as D,qc as B,sc as f,t as w,ua as u,va as h,xc as x,zc as s}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as M,b as E}from"./chunk-66YHNWRR.js";var wt=(()=>{class e{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new j(null),this.destroy$=new K,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,i){i==0?this.disableNextButton=!0:this.disableNextButton=!(i<t.RowCount*t.PageNumber)}reloadPagination(t){N.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,i){t.RowCount=i,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new j(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(Q(this.destroy$),V(t=>t!=null),q(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(w(i=>i.Data))),Y(this.pagination$),J((t,i)=>{let[n,a]=t,[O]=i;return a.PageNumber==1?[O,a]:[n.concat(O),a]}),k(([t,i])=>{this.setPageNumberFooter(i),this.setPaginationButtonState(i,t.length)}),w(([t])=>t),Z())}static{this.\u0275fac=function(i){return new(i||e)(tt(U))}}static{this.\u0275prov=X({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var H=e=>[e];function Ft(e,c){if(e&1){let t=f();o(0,"button",11),x("click",function(){u(t);let n=s(3);return h(n.uploadMultipleProduct())}),g(1,"i",12),d(2),l()}if(e&2){let t,i=s(3);r(2),y(" upload (",(t=i.selectedProducts())==null?null:t.length,") ")}}function Tt(e,c){if(e&1&&(D(0),_(1,Ft,3,1,"button",10),B()),e&2){let t=s(2);r(),m(t.hasSelectionProduct()?1:-1)}}function Ot(e,c){e&1&&(D(0),g(1,"th",19),B())}function Mt(e,c){if(e&1){let t=f();o(0,"td",25)(1,"input",26),W("ngModelChange",function(n){u(t);let a=s(3).$implicit;return L(a.selected,n)||(a.selected=n),h(n)}),x("ngModelChange",function(){u(t);let n=s(4),a=s(3);return h(a.onSelectProduct(n))}),l()()}if(e&2){let t=s(3).$implicit;p("rowSpan",t==null?null:t.Variants.length),r(),$("ngModel",t.selected)}}function Et(e,c){if(e&1&&(D(0),_(1,Mt,2,2,"td",25),B()),e&2){let t=s().$index;r(),m(t==0?1:-1)}}function Vt(e,c){if(e&1){let t=f();o(0,"img",33),x("click",function(n){u(t);let a=s(3).$implicit,O=s(4);return h(O.onZoomImage(n,a==null?null:a.ImageUrl))}),l()}if(e&2){let t=s(3).$implicit;p("src",t==null?null:t.ImageUrl,v)}}function kt(e,c){e&1&&g(0,"img",29)}function At(e,c){if(e&1&&(o(0,"td",25)(1,"div",27),_(2,Vt,1,1,"img",28)(3,kt,1,0,"img",29),l()(),o(4,"td",30)(5,"h4",31)(6,"span",32),d(7),l()()()),e&2){let t=s(2).$implicit;p("rowSpan",t==null?null:t.Variants.length),r(2),m(t!=null&&t.ImageUrl?2:3),r(2),p("rowSpan",t==null?null:t.Variants.length),r(2),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),r(),y(" ",t==null?null:t.Name," ")}}function Dt(e,c){if(e&1&&(o(0,"div")(1,"a",21),g(2,"img",34),l()()),e&2){let t=c.$implicit;r(),p("href",t.URL,v),r(),p("src",t.Img,v)("matTooltip",t.Name)}}function Bt(e,c){if(e&1&&(o(0,"div"),g(1,"img",34),l()),e&2){let t=c.$implicit;r(),p("src",t.Img,v)("matTooltip",t.Name)}}function $t(e,c){if(e&1&&(o(0,"tr"),A(1,Et,2,1,"ng-container",2),_(2,At,8,5),o(3,"td"),d(4),l(),o(5,"td")(6,"span"),d(7),l(),o(8,"span",20)(9,"a",21),g(10,"i",22),l()()(),o(11,"td",23)(12,"div",24),F(13,Dt,3,3,"div",null,I),l()(),o(15,"td",23)(16,"div",24),F(17,Bt,2,2,"div",null,I),l()()()),e&2){let t=c.$implicit,i=c.$index,n=s(5);r(),p("ngxPermissionsOnly",R(5,H,n.uploadProductRole)),r(),m(i==0?2:-1),r(2),y(" ",t.Name," "),r(3),y(" ",t.Code," "),r(2),p("href",n.hostName()+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),v),r(4),T(t==null?null:t.Available),r(4),T(t==null?null:t.NotAvailable)}}function Lt(e,c){if(e&1&&F(0,$t,19,7,"tr",null,I),e&2){let t=c.$implicit;T(t.Variants)}}function Rt(e,c){e&1&&(o(0,"tbody"),F(1,Lt,2,0,null,null,I),l()),e&2&&(r(),T(c))}function Ut(e,c){if(e&1&&(o(0,"div",8)(1,"table",13)(2,"thead",14)(3,"tr"),A(4,Ot,2,0,"ng-container",2),o(5,"th",15),d(6," Product "),l(),o(7,"th",16),d(8,"Variant"),l(),o(9,"th",16),d(10,"SKU"),l(),o(11,"th",17),d(12,"Available In"),l(),o(13,"th",18),d(14,"Not Available In"),l()()(),_(15,Rt,3,0,"tbody"),b(16,"async"),l()()),e&2){let t,i=s(2);r(4),p("ngxPermissionsOnly",R(4,H,i.uploadProductRole)),r(11),m((t=S(16,2,i.data$))?15:-1,t)}}function jt(e,c){e&1&&(o(0,"div",9),g(1,"app-empty-state"),l())}function Wt(e,c){if(e&1){let t=f();o(0,"span",42),x("click",function(){u(t);let n=s(4);return h(n.getRowCount())}),o(1,"i",43),d(2,"?"),l()()}}function Gt(e,c){if(e&1&&(o(0,"span"),d(1),b(2,"number"),l()),e&2){let t=c;r(),it(S(2,1,t==null?null:t.Count))}}function zt(e,c){if(e&1){let t=f();o(0,"a",44),x("click",function(){u(t);let n=s(4);return h(n.onNextPage())}),g(1,"i",45),d(2," Next"),l()}}function Ht(e,c){if(e&1){let t=f();o(0,"a",46),x("click",function(){u(t);let n=s(4);return h(n.onLastPage())}),g(1,"i",47),d(2," Last"),l()}}function Kt(e,c){if(e&1&&(o(0,"div",35)(1,"div",36)(2,"div",37),d(3),b(4,"number"),_(5,Wt,3,0,"span",38),_(6,Gt,3,3,"span"),b(7,"async"),d(8),l()(),o(9,"div",39),_(10,zt,3,0,"a",40),_(11,Ht,3,0,"a",41),l()()),e&2){let t,i=s(),n=s(2);r(3),y(" Showing 1 - ",S(4,6,i==null?null:i.length)," of "),r(2),m(n.paginationService.hideCount?5:-1),r(),m((t=!n.paginationService.hideCount&&S(7,8,n.rowCount$))?6:-1,t),r(2),y(" records ~ ",n.paginationService.footerPageNumber," Page "),r(2),m(n.paginationService.disableNextButton&&!n.paginationService.goToLastPage?10:-1),r(),m(n.paginationService.disableNextButton&&!n.paginationService.goToLastPage?11:-1)}}function qt(e,c){if(e&1&&_(0,Kt,12,10,"div",35),e&2){let t=c;m((t==null?null:t.length)>0?0:-1)}}function Jt(e,c){if(e&1){let t=f();o(0,"mainpanel",1),x("onSubmit",function(n){u(t);let a=s();return h(a.searchProduct(n))}),o(1,"actions"),A(2,Tt,2,1,"ng-container",2),o(3,"button",3),x("click",function(){u(t);let n=s();return h(n.openExportDialog())}),g(4,"i",4),o(5,"span"),d(6,"Export"),l()()(),o(7,"filters")(8,"filter-query-type",5),W("numberFilterComparatorChange",function(n){u(t);let a=s();return L(a.searchFilter().NumberFilterComparator,n)||(a.searchFilter().NumberFilterComparator=n),h(n)})("searchTypeChange",function(n){u(t);let a=s();return L(a.searchFilter().SearchType,n)||(a.searchFilter().SearchType=n),h(n)}),l()(),o(9,"content")(10,"div",6)(11,"div",7),_(12,Ut,17,6,"div",8),b(13,"async"),nt(14,jt,2,0,"div",9),l(),_(15,qt,1,1),b(16,"async"),l()()()}if(e&2){let t,i,n=c,a=s();p("searchBoxPlaceHolder",a.searchPlaceholder()),r(2),p("ngxPermissionsOnly",R(12,H,a.uploadProductRole)),r(6),p("numberFilterComparatorOptions",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions),$("numberFilterComparator",a.searchFilter().NumberFilterComparator),p("searchTypeOptions",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions),$("searchType",a.searchFilter().SearchType),r(4),m(((t=S(13,8,a.data$))==null?null:t.length)>0?12:14),r(3),m((i=S(16,10,a.data$))?15:-1,i)}}var Te=(()=>{class e{constructor(){this.http=C(U),this.dialog=C(Ct),this.toastr=C(rt),this.route=C(lt),this.productService=C(ft),this.paginationService=C(wt),this.biggerPictureService=C(St),this.authService=C(dt),this.uploadProductService=C(bt),this.placeholderService=C(yt),this.loaderAPI="product/Load",this.notChannelAPI="product/GetNotInChannelV2",this.searchFilter=P({}),this.hostName=P(""),this.hasSelectionProduct=P(!1),this.selectedProducts=P([]),this.channelOptions=P([]),this.scanProductRole=z.ProductScan,this.uploadProductRole=z.ProductUpload,this.searchPlaceholder=P("Search ...");let t=this.authService;this.channelOptions.set(t.getChannels()),this.hostName.set(this.authService.getDomain())}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(k(t=>{this.searchFilter.set(t.Filter),this.paginationService.reloadPagination(t.Filter),this.initSearchPlaceholder()}))}initSearchPlaceholder(){let t=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(t.SearchType,t.NumberFilterComparator))}iniData(){this.data$=this.paginationService.data$.pipe(w(t=>(t=t.map(i=>(i.Variants=i.Variants.map(n=>(n.Available=this.productService.sortChannel(n.Available),n.NotAvailable=this.productService.sortChannel(n.NotAvailable),n.Available=this.assignLogoChannel(n.Available),n.NotAvailable=this.assignLogoChannel(n.NotAvailable),n)),i.Channel=i?.Variants[0]?.Available,i)),t)))}assignLogoChannel(t){return t=t.map(i=>(i.Img=N.getChannelLogoByTypeId(i.TypeID),i)),t}searchProduct(t){this.searchFilter.update(i=>E(M({},i),{text:t})),this.paginationService.reloadPagination(this.searchFilter()),this.initSearchPlaceholder()}scanAllProduct(){let t=this.searchFilter(),i=this.productService.findChannelById(t.ChannelID,this.channelOptions());this.productService.scanAll(t.ChannelID,t.ScanFull,t.UpdatedProduct,t.Async).subscribe(n=>{t.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,i,!t.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter()));t.ChannelID=N.GuidEMpty,this.dialog.open(xt,{data:{filter:t,channelOptions:this.channelOptions()},width:"600px"}).afterClosed().pipe(V(n=>N.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.update(a=>E(M({},a),{ChannelID:n.ChannelID,ScanFull:n.ScanFull,UpdatedProduct:n.UpdatedProduct,Async:n.Async})),this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1;let t=this.searchFilter(),i={text:t.text,NumberFilterComparator:t.NumberFilterComparator,SearchType:t.SearchType};this.rowCount$=this.http.post(G.GetNotInChannelRowCount,i)}onNextPage(){this.paginationService.onNextPage(this.searchFilter())}onLastPage(){let t=this.searchFilter(),i={text:t.text,NumberFilterComparator:t.NumberFilterComparator,SearchType:t.SearchType};this.http.post(G.GetNotInChannelRowCount,i).subscribe({next:n=>{this.searchFilter.update(a=>E(M({},a),{PageNumber:1})),this.paginationService.getAllData(this.searchFilter(),n.Count)}})}onZoomImage(t,i){this.biggerPictureService.openBiggerPicture(t,i)}onSelectProduct(t){this.hasSelectionProduct.set(this.productService.hasSelection(t)),this.selectedProducts.set(this.productService.selectedProduct(t))}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts()),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){let t=this.searchFilter();this.dialog.open(Nt,{data:{title:"Export Not In Channel",pageNumber:t.PageNumber,rowCount:t.RowCount,filterExport:t,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=et({type:e,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"searchBoxPlaceHolder"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","searchBoxPlaceHolder"],[4,"ngxPermissionsOnly"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"btn","btn-light","shadow","rounded","ms-2"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[2,"width","10px"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(i,n){if(i&1&&(_(0,Jt,17,14,"mainpanel",0),b(1,"async")),i&2){let a;m((a=S(1,1,n.loader$))?0:-1,a)}},dependencies:[gt,st,ct,vt,ut,pt,_t,mt,ht,Pt,ot,at],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media(min-width:1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}}return e})();export{Te as NotInChannelComponent};
@@ -1 +1 @@
1
- import{a as w}from"./chunk-S5FQJLG5.js";import{a as y}from"./chunk-J3PHESB2.js";import"./chunk-RDXDKWLL.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-VDNUDZOQ.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import"./chunk-45DFJJAO.js";import{c as b,e as h}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as p,Oc as s,Qc as f,bd as v,fc as u,gc as m,hc as c,ic as l,jc as t,kc as n,lc as i,mb as r}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var g=e=>[e];function S(e,D){if(e&1&&(t(0,"a",8),s(1),n()),e&2){let o=D.$implicit;l("routerLink",v(2,g,o.url)),r(),f(" ",o.title)}}var C=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=p({type:e,selectors:[["app-download"]],decls:13,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[1,"dropdown-item",3,"routerLink"]],template:function(a,d){a&1&&(t(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),n()(),t(4,"div")(5,"div",3)(6,"a",4),i(7,"i",5),n(),t(8,"div",6)(9,"div",7),m(10,S,2,4,"a",8,u),n()()()()(),i(12,"router-outlet")),a&2&&(r(3),l("Tabs",d.tabs),r(7),c(d.moreMenu))},dependencies:[y,h,b],encapsulation:2,changeDetection:0})}}return e})();var _=[{path:"",component:C,children:[{path:"by-url",loadComponent(){return import("./chunk-F5RRHQJJ.js").then(e=>e.ByUrlComponent)},data:{title:"Download Product By Url"},canActivate:[w]},{pathMatch:"full",path:"",redirectTo:"by-url"}]}];export{_ as routes};
1
+ import{a as w}from"./chunk-46MLNUK6.js";import{a as y}from"./chunk-J3PHESB2.js";import"./chunk-RDXDKWLL.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-VB4EKTTU.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import"./chunk-45DFJJAO.js";import{c as b,e as h}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as p,Oc as s,Qc as f,bd as v,fc as u,gc as m,hc as c,ic as l,jc as t,kc as n,lc as i,mb as r}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var g=e=>[e];function S(e,D){if(e&1&&(t(0,"a",8),s(1),n()),e&2){let o=D.$implicit;l("routerLink",v(2,g,o.url)),r(),f(" ",o.title)}}var C=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=p({type:e,selectors:[["app-download"]],decls:13,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[1,"dropdown-item",3,"routerLink"]],template:function(a,d){a&1&&(t(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),n()(),t(4,"div")(5,"div",3)(6,"a",4),i(7,"i",5),n(),t(8,"div",6)(9,"div",7),m(10,S,2,4,"a",8,u),n()()()()(),i(12,"router-outlet")),a&2&&(r(3),l("Tabs",d.tabs),r(7),c(d.moreMenu))},dependencies:[y,h,b],encapsulation:2,changeDetection:0})}}return e})();var _=[{path:"",component:C,children:[{path:"by-url",loadComponent(){return import("./chunk-6VEA6GG4.js").then(e=>e.ByUrlComponent)},data:{title:"Download Product By Url"},canActivate:[w]},{pathMatch:"full",path:"",redirectTo:"by-url"}]}];export{_ as routes};
@@ -1,3 +1,3 @@
1
- import{a as z,b as q,c as J,d as K,e as Q,f as X}from"./chunk-WMYEGCCH.js";import{b as G}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-RBYZVK4L.js";import"./chunk-QGNTUEVO.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{h as F}from"./chunk-VDNUDZOQ.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import{c as H,h as $,m as W,z as j}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as A}from"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{$c as P,Eb as E,Ga as b,Jc as w,Kb as x,Kc as R,Oc as l,Pc as V,bc as y,dc as v,fc as D,gc as T,hc as N,ia as I,ic as m,jb as B,jc as o,kc as r,lc as g,mb as p,mc as h,na as S,nc as C,oc as M,sc as _,tc as L,ua as d,va as u,vd as O,wd as U,xc as f,zc as c}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as k}from"./chunk-66YHNWRR.js";var Z=(()=>{class e{constructor(){this.httpService=S(A)}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function ne(e,s){if(e&1&&(h(0,"th"),l(1),C()),e&2){let t=s.$implicit;p(),V(t.column)}}function ie(e,s){if(e&1&&(h(0,"td"),M(1,"span",4),C()),e&2){let t=s.$implicit,n=c().$implicit;p(),L("innerHTML",n[t.prop],B)}}function oe(e,s){if(e&1&&(h(0,"tr"),T(1,ie,2,1,"td",null,D),C()),e&2){let t=s.$implicit,n=c();R("background-color",t.Status>200?"#F4D6D5":"#DEE9C9"),p(),N(n.configs())}}var ee=(()=>{class e{constructor(){this.configs=U([]),this.data=U([]),this.status=U(void 0),this.eventClose=O({alias:"onClose"})}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=E({type:e,selectors:[["app-response-api-list"]],inputs:{configs:[1,"configs"],data:[1,"data"],status:[1,"status"]},outputs:{eventClose:"onClose"},decls:9,vars:0,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[3,"background-color"],[3,"innerHTML"]],template:function(n,i){n&1&&(h(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),T(4,ne,2,1,"th",null,D),C()(),h(6,"tbody"),T(7,oe,3,2,"tr",3,D),C()()()),n&2&&(p(4),N(i.configs()),p(3),N(i.data()))},encapsulation:2,changeDetection:0})}}return e})();function re(e,s){if(e&1){let t=_();o(0,"button",17),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onNewStepperState(a))}),g(1,"i",18),l(2," New "),r()}}function ae(e,s){if(e&1){let t=_();o(0,"button",17),f("click",function(){d(t),c();let i=w(11);return u(i.previous())}),l(1," Back "),r()}}function le(e,s){if(e&1){let t=_();o(0,"button",19),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onStepperNext(a))}),l(1," Next "),r()}}function se(e,s){if(e&1){let t=_();o(0,"button",20),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onSubmit(a))}),l(1," Download "),r()}if(e&2){let t=c();m("disabled",!t.urls)}}function pe(e,s){e&1&&(g(0,"i",21),o(1,"span"),l(2,"Instruction"),r())}function ce(e,s){e&1&&(o(0,"div",22)(1,"div",23)(2,"div",24)(3,"h4",25),l(4,"Note"),r()(),o(5,"div",26)(6,"ol",27)(7,"li"),l(8," Use this form to Download Products from Tokopedia using product URL "),r(),o(9,"li"),l(10," Copy Product URL from "),o(11,"a",28),l(12,"https://seller.tokopedia.com/ "),r(),l(13," and paste in this form "),r(),o(14,"li"),l(15," Use New Line when you want to input several product URLs "),r()()()()())}function me(e,s){e&1&&(g(0,"i",29),o(1,"span"),l(2,"Download"),r())}function de(e,s){if(e&1){let t=_();o(0,"div",22)(1,"textarea",30),f("ngModelChange",function(i){d(t);let a=c();return u(a.urls.set(i))}),r()()}if(e&2){let t=c();p(),m("placeholder",t.urlPlaceholder)("ngModel",t.urls())}}function ue(e,s){e&1&&(g(0,"i",31),o(1,"span"),l(2,"Finish"),r())}function _e(e,s){if(e&1&&(o(0,"div",22),g(1,"app-response-api-list",32),r()),e&2){let t=c();p(),m("data",t.downloadResponses())("configs",t.configs)}}function fe(e,s){e&1&&(o(0,"h6"),l(1,"1"),r())}function ge(e,s){e&1&&(o(0,"h6"),l(1,"2"),r())}function he(e,s){e&1&&(o(0,"h6"),l(1,"3"),r())}var Fe=(()=>{class e{constructor(){this.downloadService=S(Z),this.authService=S(F),this.urls=b(null),this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=b([]),this.stepperState=b("DOWNLOAD"),this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
1
+ import{a as z,b as q,c as J,d as K,e as Q,f as X}from"./chunk-WMYEGCCH.js";import{b as G}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-RBYZVK4L.js";import"./chunk-QGNTUEVO.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{h as F}from"./chunk-VB4EKTTU.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import{c as H,h as $,m as W,z as j}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as A}from"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{$c as P,Eb as E,Ga as b,Jc as w,Kb as x,Kc as R,Oc as l,Pc as V,bc as y,dc as v,fc as D,gc as T,hc as N,ia as I,ic as m,jb as B,jc as o,kc as r,lc as g,mb as p,mc as h,na as S,nc as C,oc as M,sc as _,tc as L,ua as d,va as u,vd as O,wd as U,xc as f,zc as c}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as k}from"./chunk-66YHNWRR.js";var Z=(()=>{class e{constructor(){this.httpService=S(A)}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function ne(e,s){if(e&1&&(h(0,"th"),l(1),C()),e&2){let t=s.$implicit;p(),V(t.column)}}function ie(e,s){if(e&1&&(h(0,"td"),M(1,"span",4),C()),e&2){let t=s.$implicit,n=c().$implicit;p(),L("innerHTML",n[t.prop],B)}}function oe(e,s){if(e&1&&(h(0,"tr"),T(1,ie,2,1,"td",null,D),C()),e&2){let t=s.$implicit,n=c();R("background-color",t.Status>200?"#F4D6D5":"#DEE9C9"),p(),N(n.configs())}}var ee=(()=>{class e{constructor(){this.configs=U([]),this.data=U([]),this.status=U(void 0),this.eventClose=O({alias:"onClose"})}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=E({type:e,selectors:[["app-response-api-list"]],inputs:{configs:[1,"configs"],data:[1,"data"],status:[1,"status"]},outputs:{eventClose:"onClose"},decls:9,vars:0,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[3,"background-color"],[3,"innerHTML"]],template:function(n,i){n&1&&(h(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),T(4,ne,2,1,"th",null,D),C()(),h(6,"tbody"),T(7,oe,3,2,"tr",3,D),C()()()),n&2&&(p(4),N(i.configs()),p(3),N(i.data()))},encapsulation:2,changeDetection:0})}}return e})();function re(e,s){if(e&1){let t=_();o(0,"button",17),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onNewStepperState(a))}),g(1,"i",18),l(2," New "),r()}}function ae(e,s){if(e&1){let t=_();o(0,"button",17),f("click",function(){d(t),c();let i=w(11);return u(i.previous())}),l(1," Back "),r()}}function le(e,s){if(e&1){let t=_();o(0,"button",19),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onStepperNext(a))}),l(1," Next "),r()}}function se(e,s){if(e&1){let t=_();o(0,"button",20),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onSubmit(a))}),l(1," Download "),r()}if(e&2){let t=c();m("disabled",!t.urls)}}function pe(e,s){e&1&&(g(0,"i",21),o(1,"span"),l(2,"Instruction"),r())}function ce(e,s){e&1&&(o(0,"div",22)(1,"div",23)(2,"div",24)(3,"h4",25),l(4,"Note"),r()(),o(5,"div",26)(6,"ol",27)(7,"li"),l(8," Use this form to Download Products from Tokopedia using product URL "),r(),o(9,"li"),l(10," Copy Product URL from "),o(11,"a",28),l(12,"https://seller.tokopedia.com/ "),r(),l(13," and paste in this form "),r(),o(14,"li"),l(15," Use New Line when you want to input several product URLs "),r()()()()())}function me(e,s){e&1&&(g(0,"i",29),o(1,"span"),l(2,"Download"),r())}function de(e,s){if(e&1){let t=_();o(0,"div",22)(1,"textarea",30),f("ngModelChange",function(i){d(t);let a=c();return u(a.urls.set(i))}),r()()}if(e&2){let t=c();p(),m("placeholder",t.urlPlaceholder)("ngModel",t.urls())}}function ue(e,s){e&1&&(g(0,"i",31),o(1,"span"),l(2,"Finish"),r())}function _e(e,s){if(e&1&&(o(0,"div",22),g(1,"app-response-api-list",32),r()),e&2){let t=c();p(),m("data",t.downloadResponses())("configs",t.configs)}}function fe(e,s){e&1&&(o(0,"h6"),l(1,"1"),r())}function ge(e,s){e&1&&(o(0,"h6"),l(1,"2"),r())}function he(e,s){e&1&&(o(0,"h6"),l(1,"3"),r())}var Fe=(()=>{class e{constructor(){this.downloadService=S(Z),this.authService=S(F),this.urls=b(null),this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=b([]),this.stepperState=b("DOWNLOAD"),this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
2
2
  https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=b(this.authService.getDomain())}onStepperChange(t){this.stepperState.set(t.selectedStep.state)}onSubmit(t){let i=(this.urls()??"").split(/\r?\n/).filter(a=>a.trim());this.downloadService.download(i).subscribe(a=>{this.downloadResponses.set(a),this.mappingLinkToProduct(),this.onStepperNext(t)})}mappingLinkToProduct(){let t=this.currentDomain(),n=this.downloadResponses().map(i=>{let a=k({},i);return a.Name=a?.Name?`<a href="${t}/menu/Products/Catalog/Products/Info?ID=${a.ID}" target="_blank">${a?.Name}</a>`:"-",a});this.downloadResponses.set(n)}onNewStepperState(t){this.downloadResponses.set([]),this.urls.set(null),this.stepperState.set("DOWNLOAD"),t.reset(),this.onStepperNext(t)}onStepperNext(t){t.selected.completed=!0,t.next()}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=E({type:e,selectors:[["app-by-url"]],features:[P([{provide:z,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"disabled"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(n,i){if(n&1){let a=_();o(0,"mainpanel",1)(1,"actions"),y(2,re,3,0,"button",2),y(3,ae,2,0,"button",2),y(4,le,2,0,"button",3),y(5,se,2,1,"button",4),r(),o(6,"content")(7,"div",5)(8,"div",6)(9,"div",7)(10,"mat-stepper",8,0),f("selectionChange",function(te){return d(a),u(i.onStepperChange(te))}),o(12,"mat-step",9),x(13,pe,3,0,"ng-template",10)(14,ce,16,0,"ng-template",11),r(),o(15,"mat-step",12),x(16,me,3,0,"ng-template",10)(17,de,2,2,"ng-template",11),r(),o(18,"mat-step",13),x(19,ue,3,0,"ng-template",10)(20,_e,2,2,"ng-template",11),r(),x(21,fe,2,0,"ng-template",14)(22,ge,2,0,"ng-template",15)(23,he,2,0,"ng-template",16),r()()()()()()}n&2&&(m("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),v(i.stepperState()=="FINISH"?2:-1),p(),v(i.stepperState()=="DOWNLOAD"?3:-1),p(),v(i.stepperState()=="GUIDE"?4:-1),p(),v(i.stepperState()=="DOWNLOAD"?5:-1),p(5),m("selectedIndex",1),p(2),m("editable",i.stepperState()!="FINISH")("completed",!0),p(3),m("editable",i.stepperState()!="FINISH")("completed",!1))},dependencies:[G,X,Q,q,K,j,H,$,W,ee,J],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
3
3
  `],encapsulation:2,changeDetection:0})}}return e})();export{Fe as ByUrlComponent};
@@ -1 +1 @@
1
- import{b as O}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{h as N}from"./chunk-VDNUDZOQ.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as C}from"./chunk-45DFJJAO.js";import{b as T}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B as b,C as y,z as g}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as S,Ga as x,Oc as r,Pc as d,bc as f,dc as E,ia as v,ic as u,jc as t,kc as i,kd as s,lc as D,ld as h,mb as o,md as I,na as p,t as m}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var M=(()=>{class a{constructor(){this.httpService=p(C)}getExceptionDetail(e){return this.httpService.post("/api/Orders/GetDetailException",{ID:e}).pipe(m(n=>n?.hits[0]?._source))}static{this.\u0275fac=function(l){return new(l||a)}}static{this.\u0275prov=v({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();function B(a,w){if(a&1&&(t(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"h5"),r(6,"General"),i()(),t(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"label"),r(12,"Date"),i(),t(13,"div")(14,"span"),r(15),s(16,"date"),i()()()(),t(17,"div",8)(18,"div",9)(19,"label"),r(20,"Number"),i(),t(21,"div")(22,"span"),r(23),i()()()(),t(24,"div",8)(25,"div",9)(26,"label"),r(27,"Channel Name"),i(),t(28,"div")(29,"span"),r(30),i()()()(),t(31,"div",8)(32,"div",9)(33,"label"),r(34,"ShopID"),i(),t(35,"div")(36,"span"),r(37),i()()()(),t(38,"div",8)(39,"div",9)(40,"label"),r(41,"Channel ID"),i(),t(42,"div")(43,"span"),r(44),i()()()()()()()()(),t(45,"div",10)(46,"div",8)(47,"div",4)(48,"div",5)(49,"h5"),r(50,"Request"),i()(),t(51,"div",6)(52,"pre"),r(53),s(54,"json"),i()()()(),t(55,"div",8)(56,"div",11)(57,"div",5)(58,"h5"),r(59,"Stack Trace"),i()(),t(60,"div",6),D(61,"pre",12),i()(),t(62,"div",13)(63,"div",5)(64,"h5"),r(65,"Exception Message"),i()(),t(66,"div",6)(67,"pre"),r(68),s(69,"json"),i()()()()()()),a&2){let e=w;o(15),d(I(16,8,e["@timestamp"],"dd MMM yyyy HH:mm:ss")),o(8),d(e==null||e.error==null?null:e.error.number),o(7),d(e==null?null:e.channelName),o(7),d(e==null?null:e.shopId),o(7),d(e==null?null:e.message),o(9),d(h(54,11,e==null||e.error==null?null:e.error.request)),o(8),u("textContent",e==null||e.error==null?null:e.error.stackTrace),o(7),d(h(69,13,e==null||e.error==null?null:e.error.response))}}var K=(()=>{class a{constructor(){this.activatedRoute=p(T),this.exceptionService=p(M),this.authService=p(N),this.invoiceNumber="",this.channelName="",this.logo=null,this.channelOptions=x(this.authService.getChannels()),this.headerTitle="Order"}parseJsonSafe(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}ngOnInit(){let e=this.activatedRoute.snapshot.queryParams;this.exceptionDetail$=this.exceptionService.getExceptionDetail(e?.ID).pipe(m(l=>{let n=l;return n?.error?.number?this.headerTitle="Order #"+n.error.number:this.headerTitle="Order",{"@timestamp":n["@timestamp"]||n["@timestamp_received"],error:{number:n?.error?.number,stackTrace:n?.error?.stackTrace,request:this.parseJsonSafe(n?.error?.request),response:this.parseJsonSafe(n?.error?.response)},channelName:n?.channelId!=null?this.channelOptions().find(c=>c.ID===n?.channelId)?.Name:n?.shopId,shopId:n?.shopId,message:n?.message}}))}static{this.\u0275fac=function(l){return new(l||a)}}static{this.\u0275cmp=S({type:a,selectors:[["app-exception-detail"]],decls:4,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"card","mb-2"],[3,"textContent"],[1,"card","mt-7"]],template:function(l,n){if(l&1&&(t(0,"mainpanel",0)(1,"content"),f(2,B,70,15,"div",1),s(3,"async"),i()()),l&2){let c;u("headerTitle",n.headerTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),o(2),E((c=h(3,4,n.exceptionDetail$))?2:-1,c)}},dependencies:[O,g,y,b],encapsulation:2,changeDetection:0})}}return a})();export{K as ExceptionDetailComponent};
1
+ import{b as O}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{h as N}from"./chunk-VB4EKTTU.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as C}from"./chunk-45DFJJAO.js";import{b as T}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B as b,C as y,z as g}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as S,Ga as x,Oc as r,Pc as d,bc as f,dc as E,ia as v,ic as u,jc as t,kc as i,kd as s,lc as D,ld as h,mb as o,md as I,na as p,t as m}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var M=(()=>{class a{constructor(){this.httpService=p(C)}getExceptionDetail(e){return this.httpService.post("/api/Orders/GetDetailException",{ID:e}).pipe(m(n=>n?.hits[0]?._source))}static{this.\u0275fac=function(l){return new(l||a)}}static{this.\u0275prov=v({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();function B(a,w){if(a&1&&(t(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"h5"),r(6,"General"),i()(),t(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"label"),r(12,"Date"),i(),t(13,"div")(14,"span"),r(15),s(16,"date"),i()()()(),t(17,"div",8)(18,"div",9)(19,"label"),r(20,"Number"),i(),t(21,"div")(22,"span"),r(23),i()()()(),t(24,"div",8)(25,"div",9)(26,"label"),r(27,"Channel Name"),i(),t(28,"div")(29,"span"),r(30),i()()()(),t(31,"div",8)(32,"div",9)(33,"label"),r(34,"ShopID"),i(),t(35,"div")(36,"span"),r(37),i()()()(),t(38,"div",8)(39,"div",9)(40,"label"),r(41,"Channel ID"),i(),t(42,"div")(43,"span"),r(44),i()()()()()()()()(),t(45,"div",10)(46,"div",8)(47,"div",4)(48,"div",5)(49,"h5"),r(50,"Request"),i()(),t(51,"div",6)(52,"pre"),r(53),s(54,"json"),i()()()(),t(55,"div",8)(56,"div",11)(57,"div",5)(58,"h5"),r(59,"Stack Trace"),i()(),t(60,"div",6),D(61,"pre",12),i()(),t(62,"div",13)(63,"div",5)(64,"h5"),r(65,"Exception Message"),i()(),t(66,"div",6)(67,"pre"),r(68),s(69,"json"),i()()()()()()),a&2){let e=w;o(15),d(I(16,8,e["@timestamp"],"dd MMM yyyy HH:mm:ss")),o(8),d(e==null||e.error==null?null:e.error.number),o(7),d(e==null?null:e.channelName),o(7),d(e==null?null:e.shopId),o(7),d(e==null?null:e.message),o(9),d(h(54,11,e==null||e.error==null?null:e.error.request)),o(8),u("textContent",e==null||e.error==null?null:e.error.stackTrace),o(7),d(h(69,13,e==null||e.error==null?null:e.error.response))}}var K=(()=>{class a{constructor(){this.activatedRoute=p(T),this.exceptionService=p(M),this.authService=p(N),this.invoiceNumber="",this.channelName="",this.logo=null,this.channelOptions=x(this.authService.getChannels()),this.headerTitle="Order"}parseJsonSafe(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}ngOnInit(){let e=this.activatedRoute.snapshot.queryParams;this.exceptionDetail$=this.exceptionService.getExceptionDetail(e?.ID).pipe(m(l=>{let n=l;return n?.error?.number?this.headerTitle="Order #"+n.error.number:this.headerTitle="Order",{"@timestamp":n["@timestamp"]||n["@timestamp_received"],error:{number:n?.error?.number,stackTrace:n?.error?.stackTrace,request:this.parseJsonSafe(n?.error?.request),response:this.parseJsonSafe(n?.error?.response)},channelName:n?.channelId!=null?this.channelOptions().find(c=>c.ID===n?.channelId)?.Name:n?.shopId,shopId:n?.shopId,message:n?.message}}))}static{this.\u0275fac=function(l){return new(l||a)}}static{this.\u0275cmp=S({type:a,selectors:[["app-exception-detail"]],decls:4,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"card","mb-2"],[3,"textContent"],[1,"card","mt-7"]],template:function(l,n){if(l&1&&(t(0,"mainpanel",0)(1,"content"),f(2,B,70,15,"div",1),s(3,"async"),i()()),l&2){let c;u("headerTitle",n.headerTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),o(2),E((c=h(3,4,n.exceptionDetail$))?2:-1,c)}},dependencies:[O,g,y,b],encapsulation:2,changeDetection:0})}}return a})();export{K as ExceptionDetailComponent};
@@ -1 +1 @@
1
- import{a as ge}from"./chunk-IPMCCZZW.js";import"./chunk-6GSJBXEE.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-3BV4FPZE.js";import{a as me}from"./chunk-7KG3DC5J.js";import{a as ue}from"./chunk-TWRFL73R.js";import{a as pe}from"./chunk-7ES2Z445.js";import{a as se}from"./chunk-KMCVYMXQ.js";import{a as E}from"./chunk-SSK4EUDM.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-MYDVMG67.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{b as ce}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import{a as oe,b as ae,c as re,g as I,h as le,i as B,j as de}from"./chunk-NIRJAWTX.js";import{a as ie}from"./chunk-RDXDKWLL.js";import"./chunk-SPNVH2ST.js";import{b as ne}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-VDNUDZOQ.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import{c as P}from"./chunk-NNVT5X6O.js";import{h as ee,m as te,z as F}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as Q,e as X}from"./chunk-45DFJJAO.js";import{e as Y}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{D as q,F as K,L as J}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Cd as H,Eb as b,Ga as x,Lc as V,Oc as d,Pc as D,Qc as k,Rc as j,Sc as $,Tc as Z,Uc as z,Vc as A,Wc as G,Xb as N,Xc as W,bc as g,dc as h,ec as U,fc as T,gc as y,hc as w,ic as m,jc as a,kb as L,kc as r,kd as R,lc as u,ld as O,mb as o,na as s,sc as M,ua as _,va as v,wd as S,xc as C,zc as p}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var Ce=(()=>{class i{constructor(){this.data=s(ae),this.dialogRef=s(oe),this.modalConfig=x(new B)}ngOnInit(){let e=new B;e.title="Delete Variant",e.okText="Delete",e.cancelText="Cancel",e.headerType=le.Error,e.customWidth="450px",this.modalConfig.set(e)}onConfirm(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["app-modal-confirm-delete"]],decls:10,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],["content","",1,"p-3"]],template:function(t,n){t&1&&(a(0,"modal-material",0),C("onOk",function(){return n.onConfirm()})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),a(1,"div",1)(2,"p"),d(3,"Are you sure to delete Variant "),a(4,"strong"),d(5),r(),d(6," from Product "),a(7,"strong"),d(8),r(),d(9,"?"),r()()()),t&2&&(m("config",n.modalConfig()),o(5),D(n.data==null?null:n.data.variantName),o(3),D(n.data==null?null:n.data.productName))},dependencies:[K,I,de],styles:[".modal-material mat-dialog-actions{margin-top:0!important}"]})}}return i})();function _e(i,c){if(i&1){let e=M();a(0,"img",15),C("click",function(n){_(e);let l=p();return v(l.onZoomImage(n))}),r()}if(i&2){let e=p();m("ngSrc",e.image)("fill",!0)}}function ve(i,c){i&1&&u(0,"img",7),i&2&&m("fill",!0)}function xe(i,c){if(i&1&&(a(0,"div",10),u(1,"i",16),a(2,"span"),d(3),r()()),i&2){let e=p();o(3),D(e.code)}}function be(i,c){if(i&1&&(a(0,"div",11),d(1),R(2,"number"),r()),i&2){let e=p();o(),k("",O(2,1,e.totalChannel())," Listing")}}function De(i,c){if(i&1&&(a(0,"div",23),d(1),R(2,"number"),r()),i&2){p();let e=W(7);o(),k(" (",O(2,1,e)," Listing) ")}}function Se(i,c){if(i&1){let e=M();a(0,"div",27)(1,"div",28),d(2),r(),a(3,"div",29)(4,"a",30),u(5,"i",31),r(),a(6,"a",32),C("click",function(){let n=_(e).$implicit,l=p(2);return v(l.onDeleteVariant(n.ID,n.Name))}),u(7,"i",33),r()()()}if(i&2){let e=c.$implicit,t=c.$index,n=p().$implicit;V("border-bottom",t!==(n==null?null:n.Variants.length)-1),o(2),j(" ",e.ProductName," - ",e.Name," "),o(2),m("href",e.URL,L)}}function ye(i,c){if(i&1&&(a(0,"div",17)(1,"h2",18)(2,"button",19)(3,"div",20),u(4,"img",21),a(5,"span",22),d(6),r(),A(7),g(8,De,3,3,"div",23),r()()(),a(9,"div",24)(10,"div",25),y(11,Se,8,5,"div",26,U),r()()()),i&2){let e,t=c.$implicit,n=c.$index,l=p();V("border-bottom-0",l.channels().length-1==n),o(),m("id","heading"+n+l.id()),o(),N("data-bs-target","#collapse"+n+l.id())("aria-controls","#collapse"+n+l.id()),o(2),m("src",l.getChannelLogo(t.TypeID),L),o(),m("matTooltip",(t==null||t.ChannelName==null?null:t.ChannelName.length)>30?t==null?null:t.ChannelName:""),o(),D(t==null?null:t.ChannelName),o();let f=G(t==null||t.Variants==null?null:t.Variants.length);o(),h(f>1&&((e=l.channels())==null?null:e.length)>1?8:-1),o(),m("id","collapse"+n+l.id()),N("aria-labelledby","heading"+n+l.id()),o(2),w(t==null?null:t.Variants)}}var fe=(()=>{class i{constructor(){this.biggerPictureService=s(pe),this.productService=s(E),this.cdr=s(H),this.toastr=s(Q),this.dialog=s(re),this.totalChannel=S(0),this.imageForZoom=S(void 0),this.title=S(void 0),this.channels=S(void 0),this.id=S(void 0)}getChannelLogo(e){return P.getChannelLogoByTypeId(e)}onZoomImage(e){this.biggerPictureService.openBiggerPicture(e,this.imageForZoom())}onDeleteVariant(e,t){this.dialog.open(Ce,{data:{variantName:t,productName:this.title()}}).afterClosed().subscribe(l=>{l&&this.productService.deleteSingleVariantID(e).subscribe({next:()=>{this.toastr.success(`Variant "${t}" has been deleted successfully.`,"Deleted"),setTimeout(()=>window.location.reload(),1500)},error:()=>{this.toastr.error(`Failed to delete variant "${t}". Please try again.`,"Error")}})})}updateTotalChannel(){this.cdr.markForCheck()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["app-duplicate-product-card"]],inputs:{image:"image",code:"code",totalChannel:[1,"totalChannel"],imageForZoom:[1,"imageForZoom"],title:[1,"title"],channels:[1,"channels"],id:[1,"id"]},decls:17,vars:4,consts:[[1,"card"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[1,"rounded","imgUpload","float-left","cursor-pointer",3,"ngSrc","fill"],["ngSrc","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload",3,"fill"],[1,"col-8","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle"],[1,"description"],[1,"fs-5"],[1,"card-footer",2,"padding-left","0px","padding-right","0px"],["id","accordionParent",1,"accordion","accordion-flush"],[1,"accordion-item","border-start-0","border-end-0",3,"border-bottom-0"],[1,"rounded","imgUpload","float-left","cursor-pointer",3,"click","ngSrc","fill"],[1,"fa","fa-barcode","me-2"],[1,"accordion-item","border-start-0","border-end-0"],[1,"accordion-header",3,"id"],["type","button","data-bs-toggle","collapse","aria-expanded","true",1,"accordion-button","collapsed",2,"height","40px"],[1,"d-flex","align-items-center","justify-content-start","w-100"],["alt","",1,"channel-logo",3,"src"],[1,"fs-4","ps-4","text-ellipsis",2,"max-width","13vw",3,"matTooltip"],[1,"fs-4","ms-2"],["data-bs-parent","#accordionParent",1,"accordion-collapse","collapse",3,"id"],[1,"accordion-body",2,"padding-top","0px","padding-bottom","0px"],[1,"d-flex","justify-content-between","align-items-center","py-4",3,"border-bottom"],[1,"d-flex","justify-content-between","align-items-center","py-4"],[1,"text-ellipsis"],[1,"d-flex","align-items-center","gap-3"],["target","_blank",1,"text-secondary",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],["href","javascript:void(0)","title","Delete variant",1,"text-danger",3,"click"],[1,"fa-solid","fa-trash-can"]],template:function(t,n){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),g(6,_e,1,2,"img",6)(7,ve,1,1,"img",7),r()()(),a(8,"div",8)(9,"h4",9),d(10),r(),g(11,xe,4,1,"div",10),g(12,be,3,3,"div",11),r()()(),a(13,"div",12)(14,"div",13),y(15,ye,13,12,"div",14,T),r()()()),t&2&&(o(6),h(n.image?6:7),o(4),k(" ",n.title()," "),o(),h(n.code?11:-1),o(),h(n.totalChannel()?12:-1),o(3),w(n.channels()))},dependencies:[F,ie,ne,I,J,q],styles:[`.productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down}.channel-logo[_ngcontent-%COMP%]{width:18px;height:18px}.accordion-button[_ngcontent-%COMP%]{background-color:#ededed69!important}.accordion-button[_ngcontent-%COMP%]:not(.collapsed){background-color:#ededed69!important;color:#333}.accordion-button[_ngcontent-%COMP%]:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.accordion-button[_ngcontent-%COMP%]:focus{box-shadow:none!important}.card[_ngcontent-%COMP%]{margin-bottom:0!important}`],changeDetection:0})}}return i})();function we(i,c){if(i&1&&(a(0,"div",8),u(1,"app-duplicate-product-card",11),r()),i&2){let e=c.$implicit,t=c.$index;o(),m("imageForZoom",e.ImageUrl)("title",e.Name)("code",e.Code)("id",t)("image",e.ThumbnailURL)("channels",e.Channels)("totalChannel",e.Total)}}function Me(i,c){i&1&&(a(0,"div",9),u(1,"app-empty-state"),r())}function Pe(i,c){if(i&1){let e=M();a(0,"div",10)(1,"div",12)(2,"app-custom-paginator",13),C("next",function(){_(e);let n=p();return v(n.getProducts())})("previous",function(){_(e);let n=p();return v(n.getProducts())})("total",function(){_(e);let n=p();return v(n.getRowCount())}),r()()()}if(i&2){let e,t=p();o(2),m("filter",t.searchFilter)("totaldata",(e=t.products())==null?null:e.length)("paginationTotal",t.rowCount())("hasClicked",t.hasClickedRowCount())}}var ut=(()=>{class i{constructor(){this.httpService=s(X),this.productService=s(E),this.searchFilter=x(new me),this.products=x([]),this.rowCount=x(0),this.hasClickedRowCount=x(!1),this.getPageLoader()}getPageLoader(){this.productService.loader().subscribe(e=>{this.searchFilter.set(e.Filter),this.searchFilter.update(t=>(t.PageSize=e.Filter.RowCount,t)),this.getProducts()})}getProducts(){let e={ListChannelID:this.searchFilter().ListChannelID,RowCount:this.searchFilter().RowCount,PageNumber:this.searchFilter().PageNumber,text:this.searchFilter().text};this.httpService.post("/api/product/GetDuplicateInChannel",e).subscribe(t=>{this.products.set(t.Data)})}onSearch(e){this.searchFilter.update(t=>(t.text=e,t)),this.hasClickedRowCount.set(!1),this.getProducts()}onClearFilter(){this.searchFilter.update(e=>(e.ChannelID=P.GuidEMpty,e))}getChannelLogo(e){return P.getChannelLogoByTypeId(e)}getRowCount(){let e={text:this.searchFilter().text,ChannelID:this.searchFilter().ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",e).subscribe(t=>{this.hasClickedRowCount.set(!0),this.rowCount.set(t.Total)})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["app-duplicate-sku"]],decls:19,vars:4,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["routerLink","/menu/products/status/duplicate-sku/table",1,"btn","btn-outline-secondary","btn-lg","d-flex","align-items-center","gap-2"],[1,"fa-solid","fa-table"],["container",""],[1,"mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-8","mx-1"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[3,"imageForZoom","title","code","id","image","channels","totalChannel"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(t,n){if(t&1&&(a(0,"mainpanel",0),C("onSubmit",function(f){return n.onSearch(f)}),a(1,"actions")(2,"a",1),u(3,"i",2),a(4,"span"),d(5,"Table View"),r()()(),a(6,"filters")(7,"div",3)(8,"div")(9,"h6",4),d(10,"Channel"),r(),a(11,"app-channel-options-v2",5),z("ngModelChange",function(f){return Z(n.searchFilter().ListChannelID,f)||(n.searchFilter().ListChannelID=f),f}),r()()()(),a(12,"content")(13,"div",6)(14,"div",7),y(15,we,2,7,"div",8,T),g(17,Me,2,0,"div",9),r(),g(18,Pe,3,4,"div",10),r()()()),t&2){let l;o(11),m("multiple",!0),$("ngModel",n.searchFilter().ListChannelID),o(4),w(n.products()),o(2),h(n.products().length==0?17:-1),o(),h(((l=n.products())==null?null:l.length)>0?18:-1)}},dependencies:[ce,Y,ge,F,ee,te,fe,se,ue],encapsulation:2,changeDetection:0})}}return i})();export{ut as DuplicateSkuComponent};
1
+ import{a as ge}from"./chunk-T7PNPUCK.js";import"./chunk-6GSJBXEE.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-3BV4FPZE.js";import{a as me}from"./chunk-7KG3DC5J.js";import{a as ue}from"./chunk-TWRFL73R.js";import{a as pe}from"./chunk-7ES2Z445.js";import{a as se}from"./chunk-KMCVYMXQ.js";import{a as E}from"./chunk-KYZGVVJM.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-ASKT24WA.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{b as ce}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import{a as oe,b as ae,c as re,g as I,h as le,i as B,j as de}from"./chunk-NIRJAWTX.js";import{a as ie}from"./chunk-RDXDKWLL.js";import"./chunk-SPNVH2ST.js";import{b as ne}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-VB4EKTTU.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import{c as P}from"./chunk-NNVT5X6O.js";import{h as ee,m as te,z as F}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as Q,e as X}from"./chunk-45DFJJAO.js";import{e as Y}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{D as q,F as K,L as J}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Cd as H,Eb as b,Ga as x,Lc as V,Oc as d,Pc as D,Qc as k,Rc as j,Sc as $,Tc as Z,Uc as z,Vc as A,Wc as G,Xb as N,Xc as W,bc as g,dc as h,ec as U,fc as T,gc as y,hc as w,ic as m,jc as a,kb as L,kc as r,kd as R,lc as u,ld as O,mb as o,na as s,sc as M,ua as _,va as v,wd as S,xc as C,zc as p}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var Ce=(()=>{class i{constructor(){this.data=s(ae),this.dialogRef=s(oe),this.modalConfig=x(new B)}ngOnInit(){let e=new B;e.title="Delete Variant",e.okText="Delete",e.cancelText="Cancel",e.headerType=le.Error,e.customWidth="450px",this.modalConfig.set(e)}onConfirm(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["app-modal-confirm-delete"]],decls:10,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],["content","",1,"p-3"]],template:function(t,n){t&1&&(a(0,"modal-material",0),C("onOk",function(){return n.onConfirm()})("onCancel",function(){return n.onCancel()})("onClose",function(){return n.onCancel()}),a(1,"div",1)(2,"p"),d(3,"Are you sure to delete Variant "),a(4,"strong"),d(5),r(),d(6," from Product "),a(7,"strong"),d(8),r(),d(9,"?"),r()()()),t&2&&(m("config",n.modalConfig()),o(5),D(n.data==null?null:n.data.variantName),o(3),D(n.data==null?null:n.data.productName))},dependencies:[K,I,de],styles:[".modal-material mat-dialog-actions{margin-top:0!important}"]})}}return i})();function _e(i,c){if(i&1){let e=M();a(0,"img",15),C("click",function(n){_(e);let l=p();return v(l.onZoomImage(n))}),r()}if(i&2){let e=p();m("ngSrc",e.image)("fill",!0)}}function ve(i,c){i&1&&u(0,"img",7),i&2&&m("fill",!0)}function xe(i,c){if(i&1&&(a(0,"div",10),u(1,"i",16),a(2,"span"),d(3),r()()),i&2){let e=p();o(3),D(e.code)}}function be(i,c){if(i&1&&(a(0,"div",11),d(1),R(2,"number"),r()),i&2){let e=p();o(),k("",O(2,1,e.totalChannel())," Listing")}}function De(i,c){if(i&1&&(a(0,"div",23),d(1),R(2,"number"),r()),i&2){p();let e=W(7);o(),k(" (",O(2,1,e)," Listing) ")}}function Se(i,c){if(i&1){let e=M();a(0,"div",27)(1,"div",28),d(2),r(),a(3,"div",29)(4,"a",30),u(5,"i",31),r(),a(6,"a",32),C("click",function(){let n=_(e).$implicit,l=p(2);return v(l.onDeleteVariant(n.ID,n.Name))}),u(7,"i",33),r()()()}if(i&2){let e=c.$implicit,t=c.$index,n=p().$implicit;V("border-bottom",t!==(n==null?null:n.Variants.length)-1),o(2),j(" ",e.ProductName," - ",e.Name," "),o(2),m("href",e.URL,L)}}function ye(i,c){if(i&1&&(a(0,"div",17)(1,"h2",18)(2,"button",19)(3,"div",20),u(4,"img",21),a(5,"span",22),d(6),r(),A(7),g(8,De,3,3,"div",23),r()()(),a(9,"div",24)(10,"div",25),y(11,Se,8,5,"div",26,U),r()()()),i&2){let e,t=c.$implicit,n=c.$index,l=p();V("border-bottom-0",l.channels().length-1==n),o(),m("id","heading"+n+l.id()),o(),N("data-bs-target","#collapse"+n+l.id())("aria-controls","#collapse"+n+l.id()),o(2),m("src",l.getChannelLogo(t.TypeID),L),o(),m("matTooltip",(t==null||t.ChannelName==null?null:t.ChannelName.length)>30?t==null?null:t.ChannelName:""),o(),D(t==null?null:t.ChannelName),o();let f=G(t==null||t.Variants==null?null:t.Variants.length);o(),h(f>1&&((e=l.channels())==null?null:e.length)>1?8:-1),o(),m("id","collapse"+n+l.id()),N("aria-labelledby","heading"+n+l.id()),o(2),w(t==null?null:t.Variants)}}var fe=(()=>{class i{constructor(){this.biggerPictureService=s(pe),this.productService=s(E),this.cdr=s(H),this.toastr=s(Q),this.dialog=s(re),this.totalChannel=S(0),this.imageForZoom=S(void 0),this.title=S(void 0),this.channels=S(void 0),this.id=S(void 0)}getChannelLogo(e){return P.getChannelLogoByTypeId(e)}onZoomImage(e){this.biggerPictureService.openBiggerPicture(e,this.imageForZoom())}onDeleteVariant(e,t){this.dialog.open(Ce,{data:{variantName:t,productName:this.title()}}).afterClosed().subscribe(l=>{l&&this.productService.deleteSingleVariantID(e).subscribe({next:()=>{this.toastr.success(`Variant "${t}" has been deleted successfully.`,"Deleted"),setTimeout(()=>window.location.reload(),1500)},error:()=>{this.toastr.error(`Failed to delete variant "${t}". Please try again.`,"Error")}})})}updateTotalChannel(){this.cdr.markForCheck()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["app-duplicate-product-card"]],inputs:{image:"image",code:"code",totalChannel:[1,"totalChannel"],imageForZoom:[1,"imageForZoom"],title:[1,"title"],channels:[1,"channels"],id:[1,"id"]},decls:17,vars:4,consts:[[1,"card"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[1,"rounded","imgUpload","float-left","cursor-pointer",3,"ngSrc","fill"],["ngSrc","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload",3,"fill"],[1,"col-8","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle"],[1,"description"],[1,"fs-5"],[1,"card-footer",2,"padding-left","0px","padding-right","0px"],["id","accordionParent",1,"accordion","accordion-flush"],[1,"accordion-item","border-start-0","border-end-0",3,"border-bottom-0"],[1,"rounded","imgUpload","float-left","cursor-pointer",3,"click","ngSrc","fill"],[1,"fa","fa-barcode","me-2"],[1,"accordion-item","border-start-0","border-end-0"],[1,"accordion-header",3,"id"],["type","button","data-bs-toggle","collapse","aria-expanded","true",1,"accordion-button","collapsed",2,"height","40px"],[1,"d-flex","align-items-center","justify-content-start","w-100"],["alt","",1,"channel-logo",3,"src"],[1,"fs-4","ps-4","text-ellipsis",2,"max-width","13vw",3,"matTooltip"],[1,"fs-4","ms-2"],["data-bs-parent","#accordionParent",1,"accordion-collapse","collapse",3,"id"],[1,"accordion-body",2,"padding-top","0px","padding-bottom","0px"],[1,"d-flex","justify-content-between","align-items-center","py-4",3,"border-bottom"],[1,"d-flex","justify-content-between","align-items-center","py-4"],[1,"text-ellipsis"],[1,"d-flex","align-items-center","gap-3"],["target","_blank",1,"text-secondary",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],["href","javascript:void(0)","title","Delete variant",1,"text-danger",3,"click"],[1,"fa-solid","fa-trash-can"]],template:function(t,n){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),g(6,_e,1,2,"img",6)(7,ve,1,1,"img",7),r()()(),a(8,"div",8)(9,"h4",9),d(10),r(),g(11,xe,4,1,"div",10),g(12,be,3,3,"div",11),r()()(),a(13,"div",12)(14,"div",13),y(15,ye,13,12,"div",14,T),r()()()),t&2&&(o(6),h(n.image?6:7),o(4),k(" ",n.title()," "),o(),h(n.code?11:-1),o(),h(n.totalChannel()?12:-1),o(3),w(n.channels()))},dependencies:[F,ie,ne,I,J,q],styles:[`.productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down}.channel-logo[_ngcontent-%COMP%]{width:18px;height:18px}.accordion-button[_ngcontent-%COMP%]{background-color:#ededed69!important}.accordion-button[_ngcontent-%COMP%]:not(.collapsed){background-color:#ededed69!important;color:#333}.accordion-button[_ngcontent-%COMP%]:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.accordion-button[_ngcontent-%COMP%]:focus{box-shadow:none!important}.card[_ngcontent-%COMP%]{margin-bottom:0!important}`],changeDetection:0})}}return i})();function we(i,c){if(i&1&&(a(0,"div",8),u(1,"app-duplicate-product-card",11),r()),i&2){let e=c.$implicit,t=c.$index;o(),m("imageForZoom",e.ImageUrl)("title",e.Name)("code",e.Code)("id",t)("image",e.ThumbnailURL)("channels",e.Channels)("totalChannel",e.Total)}}function Me(i,c){i&1&&(a(0,"div",9),u(1,"app-empty-state"),r())}function Pe(i,c){if(i&1){let e=M();a(0,"div",10)(1,"div",12)(2,"app-custom-paginator",13),C("next",function(){_(e);let n=p();return v(n.getProducts())})("previous",function(){_(e);let n=p();return v(n.getProducts())})("total",function(){_(e);let n=p();return v(n.getRowCount())}),r()()()}if(i&2){let e,t=p();o(2),m("filter",t.searchFilter)("totaldata",(e=t.products())==null?null:e.length)("paginationTotal",t.rowCount())("hasClicked",t.hasClickedRowCount())}}var ut=(()=>{class i{constructor(){this.httpService=s(X),this.productService=s(E),this.searchFilter=x(new me),this.products=x([]),this.rowCount=x(0),this.hasClickedRowCount=x(!1),this.getPageLoader()}getPageLoader(){this.productService.loader().subscribe(e=>{this.searchFilter.set(e.Filter),this.searchFilter.update(t=>(t.PageSize=e.Filter.RowCount,t)),this.getProducts()})}getProducts(){let e={ListChannelID:this.searchFilter().ListChannelID,RowCount:this.searchFilter().RowCount,PageNumber:this.searchFilter().PageNumber,text:this.searchFilter().text};this.httpService.post("/api/product/GetDuplicateInChannel",e).subscribe(t=>{this.products.set(t.Data)})}onSearch(e){this.searchFilter.update(t=>(t.text=e,t)),this.hasClickedRowCount.set(!1),this.getProducts()}onClearFilter(){this.searchFilter.update(e=>(e.ChannelID=P.GuidEMpty,e))}getChannelLogo(e){return P.getChannelLogoByTypeId(e)}getRowCount(){let e={text:this.searchFilter().text,ChannelID:this.searchFilter().ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",e).subscribe(t=>{this.hasClickedRowCount.set(!0),this.rowCount.set(t.Total)})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["app-duplicate-sku"]],decls:19,vars:4,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["routerLink","/menu/products/status/duplicate-sku/table",1,"btn","btn-outline-secondary","btn-lg","d-flex","align-items-center","gap-2"],[1,"fa-solid","fa-table"],["container",""],[1,"mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-8","mx-1"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[3,"imageForZoom","title","code","id","image","channels","totalChannel"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(t,n){if(t&1&&(a(0,"mainpanel",0),C("onSubmit",function(f){return n.onSearch(f)}),a(1,"actions")(2,"a",1),u(3,"i",2),a(4,"span"),d(5,"Table View"),r()()(),a(6,"filters")(7,"div",3)(8,"div")(9,"h6",4),d(10,"Channel"),r(),a(11,"app-channel-options-v2",5),z("ngModelChange",function(f){return Z(n.searchFilter().ListChannelID,f)||(n.searchFilter().ListChannelID=f),f}),r()()()(),a(12,"content")(13,"div",6)(14,"div",7),y(15,we,2,7,"div",8,T),g(17,Me,2,0,"div",9),r(),g(18,Pe,3,4,"div",10),r()()()),t&2){let l;o(11),m("multiple",!0),$("ngModel",n.searchFilter().ListChannelID),o(4),w(n.products()),o(2),h(n.products().length==0?17:-1),o(),h(((l=n.products())==null?null:l.length)>0?18:-1)}},dependencies:[ce,Y,ge,F,ee,te,fe,se,ue],encapsulation:2,changeDetection:0})}}return i})();export{ut as DuplicateSkuComponent};