dealpos 25.32.1 → 25.32.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 (73) hide show
  1. package/browser/{chunk-WMOWM6XW.js → chunk-25QFQDV7.js} +1 -1
  2. package/browser/{chunk-KBE7CFXH.js → chunk-2PTTCVFQ.js} +1 -1
  3. package/browser/{chunk-RJVF37GS.js → chunk-3H43P5YA.js} +1 -1
  4. package/browser/{chunk-MW5P4LM5.js → chunk-3M2BUDUB.js} +1 -1
  5. package/browser/{chunk-ZSBJ4BDP.js → chunk-3SRUJJ6G.js} +1 -1
  6. package/browser/{chunk-6ZHV4H72.js → chunk-47TF4O2L.js} +1 -1
  7. package/browser/{chunk-DWBSJPMC.js → chunk-5GH2UM6Y.js} +1 -1
  8. package/browser/{chunk-TUL555Y3.js → chunk-5KFKRR6I.js} +1 -1
  9. package/browser/{chunk-3BKJB4EB.js → chunk-5XRERMVQ.js} +1 -1
  10. package/browser/{chunk-DDVWUPV6.js → chunk-6DCFTPUD.js} +1 -1
  11. package/browser/{chunk-WP4PM74K.js → chunk-6DO5AW57.js} +1 -1
  12. package/browser/{chunk-4O6KU55Y.js → chunk-6KABYQ7Y.js} +2 -2
  13. package/browser/{chunk-LB5S2KZX.js → chunk-6THPJHMQ.js} +1 -1
  14. package/browser/{chunk-KFV3U2MG.js → chunk-6ZKXKIPB.js} +1 -1
  15. package/browser/{chunk-RDARJWEZ.js → chunk-7P2INFVM.js} +1 -1
  16. package/browser/{chunk-5MDQYEMB.js → chunk-7UEXOSTA.js} +1 -1
  17. package/browser/{chunk-BL367NTS.js → chunk-ADUMDXZG.js} +1 -1
  18. package/browser/{chunk-RTJEAKQW.js → chunk-AIJM455Q.js} +1 -1
  19. package/browser/{chunk-PGQ4D2W6.js → chunk-AVIHEFZ3.js} +1 -1
  20. package/browser/{chunk-A7WBJIJP.js → chunk-C7SBDH6E.js} +1 -1
  21. package/browser/{chunk-6S6Q7SED.js → chunk-CU7IWKXB.js} +1 -1
  22. package/browser/{chunk-UFHFKY4U.js → chunk-DGM743IJ.js} +1 -1
  23. package/browser/{chunk-JCJZ6B6B.js → chunk-F2V3ZAGL.js} +1 -1
  24. package/browser/{chunk-4D6P6ZN5.js → chunk-F4Y6BS2M.js} +1 -1
  25. package/browser/{chunk-DZG3LGZ3.js → chunk-GDXXQ6LD.js} +1 -1
  26. package/browser/{chunk-LWWP5RGP.js → chunk-GX3N6CKR.js} +1 -1
  27. package/browser/{chunk-GPYDY4KE.js → chunk-H42QJQ56.js} +1 -1
  28. package/browser/{chunk-XDPWF5CB.js → chunk-HCGM3SVB.js} +1 -1
  29. package/browser/{chunk-GFYZWIV4.js → chunk-HDG7HN7O.js} +1 -1
  30. package/browser/{chunk-RVN4YQAX.js → chunk-HIFPWLFR.js} +1 -1
  31. package/browser/{chunk-SL4VOAHY.js → chunk-K6KQDJU7.js} +2 -2
  32. package/browser/chunk-KMVCVCCD.js +1 -0
  33. package/browser/{chunk-CZ7F77ZP.js → chunk-KR3JCXDQ.js} +1 -1
  34. package/browser/{chunk-HT7MBQYU.js → chunk-KWLJQH42.js} +1 -1
  35. package/browser/{chunk-N66KZGXZ.js → chunk-L7235LXI.js} +1 -1
  36. package/browser/{chunk-B7VLDW2D.js → chunk-LTIAN3DJ.js} +1 -1
  37. package/browser/{chunk-JY4TU5LB.js → chunk-MLEZTHWZ.js} +1 -1
  38. package/browser/{chunk-QUWHJ3A2.js → chunk-MMCM7B5Z.js} +2 -2
  39. package/browser/{chunk-I33SFWJL.js → chunk-MZDT5S4Y.js} +1 -1
  40. package/browser/{chunk-MA64N42O.js → chunk-NT3GFLD4.js} +1 -1
  41. package/browser/{chunk-DJA3CX47.js → chunk-O36QNAMF.js} +1 -1
  42. package/browser/{chunk-MBSLDPJK.js → chunk-OAJ5KECL.js} +1 -1
  43. package/browser/{chunk-WFX2XCFO.js → chunk-OI47XFJO.js} +1 -1
  44. package/browser/{chunk-UZGPU4VW.js → chunk-PYX4Z6HP.js} +1 -1
  45. package/browser/{chunk-KU2S24JO.js → chunk-Q6DGG2JP.js} +1 -1
  46. package/browser/{chunk-3IE46WQL.js → chunk-QB74573V.js} +2 -2
  47. package/browser/{chunk-RSSYP5IL.js → chunk-QLTG2D75.js} +1 -1
  48. package/browser/{chunk-PFK4WL2H.js → chunk-QSFZXQNP.js} +1 -1
  49. package/browser/{chunk-OM6SJITM.js → chunk-QZC2AATI.js} +1 -1
  50. package/browser/{chunk-PKRNN3GZ.js → chunk-R3SYCIJT.js} +1 -1
  51. package/browser/{chunk-42NI5Y2B.js → chunk-R5GVVUMP.js} +1 -1
  52. package/browser/{chunk-JDMYDBXN.js → chunk-RACFHMSM.js} +1 -1
  53. package/browser/{chunk-ZNWP7UK2.js → chunk-S2GLPFVJ.js} +1 -1
  54. package/browser/{chunk-F6ZI74HP.js → chunk-SPYVACLB.js} +1 -1
  55. package/browser/{chunk-6VQ2WO2R.js → chunk-SVPBMCHF.js} +1 -1
  56. package/browser/{chunk-3HGB2KX7.js → chunk-TKRCAX4C.js} +1 -1
  57. package/browser/{chunk-BAW2PCX4.js → chunk-TNKIGPBP.js} +1 -1
  58. package/browser/{chunk-EAPNMYHA.js → chunk-TYEOX5VV.js} +1 -1
  59. package/browser/{chunk-K25WE32L.js → chunk-U6GZZKLZ.js} +1 -1
  60. package/browser/{chunk-RAKPTR5Z.js → chunk-UIL2X6EZ.js} +1 -1
  61. package/browser/chunk-UILC7AVT.js +125 -0
  62. package/browser/{chunk-GLZMFXE6.js → chunk-W5XUYOZS.js} +2 -2
  63. package/browser/{chunk-ERJFDQFX.js → chunk-WGKL5OIB.js} +1 -1
  64. package/browser/{chunk-GGEENO4M.js → chunk-WPFM3ZGY.js} +1 -1
  65. package/browser/{chunk-VVYAL6Y7.js → chunk-XBEEV2NG.js} +1 -1
  66. package/browser/{chunk-APVQGR37.js → chunk-XV2R2LYT.js} +1 -1
  67. package/browser/{chunk-WYO3ICL4.js → chunk-XVW4JKBX.js} +1 -1
  68. package/browser/{chunk-LQKZB5PG.js → chunk-ZZ33EHCQ.js} +1 -1
  69. package/browser/index.html +2 -2
  70. package/browser/{main-Q6EK5PKL.js → main-KYIE53MH.js} +2 -2
  71. package/package.json +1 -1
  72. package/browser/chunk-IHY7TFGQ.js +0 -125
  73. package/browser/chunk-SG2RKHTW.js +0 -1
@@ -1 +1 @@
1
- import{c as F,d as H}from"./chunk-PGQ4D2W6.js";import{a as N,b as P}from"./chunk-VFMAQOEX.js";import{ja as E}from"./chunk-WUSKRV4R.js";import{D as k,h as j,o as A}from"./chunk-J577JGRK.js";import{a as G}from"./chunk-EQ6536VC.js";import{$a as p,Fa as v,Ib as u,Jb as i,Qb as _,Rb as w,Wd as s,Xc as M,Y as g,ad as x,ca as S,d as f,db as a,ec as h,fa as b,gc as T,hd as $,ja as I,kb as y,na as C,o as O,qb as d,vb as m,xc as D,yc as L}from"./chunk-ONCTFURX.js";var c=class l{http=C(s);onOpenTreeSelector$=new f;outletGroups$=this.onOpenTreeSelector$.pipe(S(e=>e.length?O(e):this.http.get("/API/outlet/ActiveOptions"),[]),g(1));constructor(){}loadOutletGroups(){this.onOpenTreeSelector$.next()}static \u0275fac=function(t){return new(t||l)};static \u0275prov=I({token:l,factory:l.\u0275fac,providedIn:"root"})};function q(l,e){if(l&1&&(u(0,"div"),h(1),i()),l&2){let t=w();p(),T(" ",t.selectedOutletGroupLabel," ")}}function z(l,e){l&1&&(u(0,"label",4),h(1,"Outlet Group"),i())}var R=class l{constructor(e,t){this.http=e;this.outletGroup=t}outletGroups=[];showClear=!1;showLabel=!1;selectedOutletGroup;selectedOutletGroupID;selectedOutletGroupIDChange=new v;selectedOutletGroupLabel;isLoadOutletGroups=!1;top=0;outletGroups$;ngAfterViewInit(){let e=document.querySelector("body");this.top=e.getBoundingClientRect().top*-1}ngOnInit(){this.outletGroups.length>0&&(G.IsEmpty(this.selectedOutletGroupID)&&(this.selectedOutletGroupID=this.outletGroups[0]?.key),this.selectedOutletGroup=this.findSelectedOutletGroup(this.outletGroups,this.selectedOutletGroupID),this.generateLabelSelectedOutletGroup(this.selectedOutletGroup)),this.outletGroups$=this.outletGroup.outletGroups$.pipe(b(e=>{console.log(e),this.selectedOutletGroup=this.findSelectedOutletGroup(e,this.selectedOutletGroupID),this.generateLabelSelectedOutletGroup(this.selectedOutletGroup)}))}onSelectOutletGroup(e){this.selectedOutletGroup=e,this.generateLabelSelectedOutletGroup(this.selectedOutletGroup),this.selectedOutletGroupID=e?.key,this.selectedOutletGroupIDChange.emit(this.selectedOutletGroupID)}generateLabelSelectedOutletGroup(e){if(e){let t=[];this.selectedOutletGroupLabel="";do t=[...t,e.label],e=e.parent;while(e!==void 0);this.selectedOutletGroupLabel=t.reverse().join("/")}else this.selectedOutletGroupLabel="Select OutletGroup"}findSelectedOutletGroup(e,t){if(G.IsNotEmpty(t))for(let o of e){if(o.key===t)return o;{o.children=o.children?o.children:[],o.children=o.children.map(n=>(n.parent=o,n));let r=this.findSelectedOutletGroup(o.children,t);if(r)return r}}else return null}loadOutletGroups(){let e=document.querySelector(".p-overlay.p-component"),t=this.top+e.getBoundingClientRect().top,o=e.getAttribute("style")||"";e.setAttribute("style",`${o} top: ${t+this.top}px;`),this.outletGroup.loadOutletGroups()}onClear(){this.selectedOutletGroupID=null,this.selectedOutletGroupIDChange.emit(this.selectedOutletGroupID)}static \u0275fac=function(t){return new(t||l)(a(s),a(c))};static \u0275cmp=y({type:l,selectors:[["POS-outlet-group-tree-select"]],inputs:{outletGroups:"outletGroups",showClear:"showClear",showLabel:"showLabel",selectedOutletGroupID:"selectedOutletGroupID"},outputs:{selectedOutletGroupIDChange:"selectedOutletGroupIDChange"},decls:5,vars:6,consts:[["variant","on",1,"w-full","md:w-80"],["appendTo","body","inputId","selectOutletGroup","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","inputId","selectOutletGroup",3,"click","ngModelChange","onClear","options","ngModel","showClear"],["pTemplate","value"],["for","selectOutletGroup",4,"ngIf"],["for","selectOutletGroup"]],template:function(t,o){t&1&&(u(0,"p-floatlabel",0)(1,"p-treeSelect",1),D(2,"async"),_("click",function(){return o.loadOutletGroups()})("ngModelChange",function(n){return o.onSelectOutletGroup(n)})("onClear",function(){return o.onClear()}),d(3,q,2,1,"ng-template",2),i(),d(4,z,2,0,"label",3),i()),t&2&&(p(),m("options",L(2,4,o.outletGroups$))("ngModel",o.selectedOutletGroup)("showClear",o.showClear),p(3),m("ngIf",o.showLabel))},dependencies:[$,M,x,H,F,E,k,j,A,P,N],styles:[".p-overlay.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important}"]})};export{R as a};
1
+ import{c as F,d as H}from"./chunk-AVIHEFZ3.js";import{a as N,b as P}from"./chunk-VFMAQOEX.js";import{ja as E}from"./chunk-WUSKRV4R.js";import{D as k,h as j,o as A}from"./chunk-J577JGRK.js";import{a as G}from"./chunk-EQ6536VC.js";import{$a as p,Fa as v,Ib as u,Jb as i,Qb as _,Rb as w,Wd as s,Xc as M,Y as g,ad as x,ca as S,d as f,db as a,ec as h,fa as b,gc as T,hd as $,ja as I,kb as y,na as C,o as O,qb as d,vb as m,xc as D,yc as L}from"./chunk-ONCTFURX.js";var c=class l{http=C(s);onOpenTreeSelector$=new f;outletGroups$=this.onOpenTreeSelector$.pipe(S(e=>e.length?O(e):this.http.get("/API/outlet/ActiveOptions"),[]),g(1));constructor(){}loadOutletGroups(){this.onOpenTreeSelector$.next()}static \u0275fac=function(t){return new(t||l)};static \u0275prov=I({token:l,factory:l.\u0275fac,providedIn:"root"})};function q(l,e){if(l&1&&(u(0,"div"),h(1),i()),l&2){let t=w();p(),T(" ",t.selectedOutletGroupLabel," ")}}function z(l,e){l&1&&(u(0,"label",4),h(1,"Outlet Group"),i())}var R=class l{constructor(e,t){this.http=e;this.outletGroup=t}outletGroups=[];showClear=!1;showLabel=!1;selectedOutletGroup;selectedOutletGroupID;selectedOutletGroupIDChange=new v;selectedOutletGroupLabel;isLoadOutletGroups=!1;top=0;outletGroups$;ngAfterViewInit(){let e=document.querySelector("body");this.top=e.getBoundingClientRect().top*-1}ngOnInit(){this.outletGroups.length>0&&(G.IsEmpty(this.selectedOutletGroupID)&&(this.selectedOutletGroupID=this.outletGroups[0]?.key),this.selectedOutletGroup=this.findSelectedOutletGroup(this.outletGroups,this.selectedOutletGroupID),this.generateLabelSelectedOutletGroup(this.selectedOutletGroup)),this.outletGroups$=this.outletGroup.outletGroups$.pipe(b(e=>{console.log(e),this.selectedOutletGroup=this.findSelectedOutletGroup(e,this.selectedOutletGroupID),this.generateLabelSelectedOutletGroup(this.selectedOutletGroup)}))}onSelectOutletGroup(e){this.selectedOutletGroup=e,this.generateLabelSelectedOutletGroup(this.selectedOutletGroup),this.selectedOutletGroupID=e?.key,this.selectedOutletGroupIDChange.emit(this.selectedOutletGroupID)}generateLabelSelectedOutletGroup(e){if(e){let t=[];this.selectedOutletGroupLabel="";do t=[...t,e.label],e=e.parent;while(e!==void 0);this.selectedOutletGroupLabel=t.reverse().join("/")}else this.selectedOutletGroupLabel="Select OutletGroup"}findSelectedOutletGroup(e,t){if(G.IsNotEmpty(t))for(let o of e){if(o.key===t)return o;{o.children=o.children?o.children:[],o.children=o.children.map(n=>(n.parent=o,n));let r=this.findSelectedOutletGroup(o.children,t);if(r)return r}}else return null}loadOutletGroups(){let e=document.querySelector(".p-overlay.p-component"),t=this.top+e.getBoundingClientRect().top,o=e.getAttribute("style")||"";e.setAttribute("style",`${o} top: ${t+this.top}px;`),this.outletGroup.loadOutletGroups()}onClear(){this.selectedOutletGroupID=null,this.selectedOutletGroupIDChange.emit(this.selectedOutletGroupID)}static \u0275fac=function(t){return new(t||l)(a(s),a(c))};static \u0275cmp=y({type:l,selectors:[["POS-outlet-group-tree-select"]],inputs:{outletGroups:"outletGroups",showClear:"showClear",showLabel:"showLabel",selectedOutletGroupID:"selectedOutletGroupID"},outputs:{selectedOutletGroupIDChange:"selectedOutletGroupIDChange"},decls:5,vars:6,consts:[["variant","on",1,"w-full","md:w-80"],["appendTo","body","inputId","selectOutletGroup","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","inputId","selectOutletGroup",3,"click","ngModelChange","onClear","options","ngModel","showClear"],["pTemplate","value"],["for","selectOutletGroup",4,"ngIf"],["for","selectOutletGroup"]],template:function(t,o){t&1&&(u(0,"p-floatlabel",0)(1,"p-treeSelect",1),D(2,"async"),_("click",function(){return o.loadOutletGroups()})("ngModelChange",function(n){return o.onSelectOutletGroup(n)})("onClear",function(){return o.onClear()}),d(3,q,2,1,"ng-template",2),i(),d(4,z,2,0,"label",3),i()),t&2&&(p(),m("options",L(2,4,o.outletGroups$))("ngModel",o.selectedOutletGroup)("showClear",o.showClear),p(3),m("ngIf",o.showLabel))},dependencies:[$,M,x,H,F,E,k,j,A,P,N],styles:[".p-overlay.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important}"]})};export{R as a};
@@ -1 +1 @@
1
- import{c as N}from"./chunk-RDARJWEZ.js";import"./chunk-JDMYDBXN.js";import{a as D}from"./chunk-EQ6536VC.js";import"./chunk-LQKZB5PG.js";import{$ as _,$a as l,Ga as P,Ib as o,Jb as e,Kb as u,N as b,Ob as S,Od as G,Qb as I,Rb as f,Wd as j,Xc as A,Y as m,aa as s,ad as E,c as p,db as d,ec as a,fa as y,fc as x,hd as R,kb as w,n as v,qb as g,va as C,vb as c,wa as O,xc as L,yb as M,yc as k}from"./chunk-ONCTFURX.js";import"./chunk-7DCB7DB2.js";function T(r,n){r&1&&(o(0,"div",21)(1,"span",22),a(2,"Latitude and Longitude is empty, please allow your browser location permission!"),e(),o(3,"a",23),a(4,"Click here to learn how to manually activate the location permission"),e()())}function z(r,n){if(r&1){let t=S();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"h3",4),a(4,"Geo Fencing"),e(),o(5,"p",5),a(6,"You are about to sign-in from this location"),e(),o(7,"div",6)(8,"div",7)(9,"div",8)(10,"span",9),a(11,"LAT"),e(),o(12,"span",10),a(13),e()(),o(14,"div",8)(15,"span",11),a(16,"LONG"),e(),o(17,"span",12),a(18),e()()(),o(19,"button",13),I("click",function(){C(t);let h=f();return O(h.proceed())}),a(20,"Proceed"),e()(),g(21,T,5,0,"div",14),e(),o(22,"div",15),u(23,"img",16),e()(),o(24,"div",17)(25,"div",18)(26,"div")(27,"span"),a(28,"powered by :"),e(),u(29,"a",19)(30,"img",20),e()()()()}if(r&2){let t=n.ngIf,i=f();l(2),M(t.latitude&&t.longitude?i.centerGeoPanelStyle:""),l(11),x(t.latitude),l(5),x(t.longitude),l(),c("disabled",!(t.latitude&&t.longitude)),l(2),c("ngIf",!(t.latitude&&t.longitude))}}var Z=class r{constructor(n,t,i,h){this.ngZone=n;this.auth=t;this.http=i;this.router=h}centerGeoPanelStyle="display: flex; flex-direction: column; justify-content: center;";latLong$;ngOnInit(){this.checkOnRefreshPage(),document.body.classList.add("login-body");let n=v(navigator.permissions.query({name:"geolocation"})).pipe(s(t=>new p(i=>{i.next(t.state),t.onchange=()=>this.ngZone.run(()=>i.next(t.state))})),m(1));this.latLong$=n.pipe(s(()=>new p(t=>{navigator.geolocation.getCurrentPosition(i=>this.ngZone.run(()=>{t.next({latitude:i.coords.latitude.toString(),longitude:i.coords.longitude.toString()}),t.complete()}),()=>this.ngZone.run(()=>{t.next({latitude:"",longitude:""}),t.complete()}),{enableHighAccuracy:!0,maximumAge:0,timeout:8e3})})),_({latitude:"",longitude:""}),m(1))}ngOnDestroy(){document.body.classList.remove("login-body")}checkOnRefreshPage(){D.IsEmpty(this.auth.loginResponse)&&this.router.navigate(["/"])}proceed(){this.latLong$.pipe(s(n=>this.http.post("/api/Authentication/LoginGeoRestriction",{UserID:this.auth.loginResponse.UserID,Latitude:n.latitude,Longitude:n.longitude})),y(n=>this.auth.saveLoginConfigToStorage(n)),s(()=>this.router.navigate([this.auth.getRedirectUrl()])),b(1)).subscribe()}static \u0275fac=function(t){return new(t||r)(d(P),d(N),d(j),d(G))};static \u0275cmp=w({type:r,selectors:[["POS-auth-geolocation"]],decls:2,vars:3,consts:[["class","container-fluid",4,"ngIf"],[1,"container-fluid"],[1,"row","bg-white","mx-auto","totp-pane"],[1,"col-md-7","order-md-first","order-last","form-pane"],[1,"text-start"],[1,"text-start","mb-7"],[1,"d-flex","flex-column","flex-md-row",2,"column-gap","10px"],[1,"latlong-container","d-flex","flex-grow-1"],[1,"flex-grow-1","text-start","d-flex"],[1,"lat-label","fw-bold"],[1,"ps-5","lat-value","flex-grow-1","d-flex","align-items-center"],[1,"long-label","fw-bold"],[1,"ps-5","long-value","flex-grow-1","d-flex","align-items-center"],[1,"btn","btn-success","mt-5","mx-auto","mx-md-0","mt-md-0","w-25","w-md-100",3,"click","disabled"],["class","text-start mt-7",4,"ngIf"],[1,"col-md-5","order-md-last","order-first","border-start","border-secondary","d-flex","align-items-center","justify-content-center","img-pane","py-6"],["src","https://res.cloudinary.com/pos/image/upload/v1685343992/POS/Images/geolocation-map.png",1,"border-0","w-100"],[1,"fixed-bottom"],[1,"d-flex","justify-content-start","mb-11","mx-11","footer-mobile"],["target","_blank","href","http://www.dealpos.com"],["src","//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png",1,"ms-3","border-0"],[1,"text-start","mt-7"],[1,"text-danger"],["href","https://support.dealpos.com/en/articles/7963864-enable-location-services-for-several-browser","target","_blank",1,"d-block"]],template:function(t,i){t&1&&(g(0,z,31,6,"div",0),L(1,"async")),t&2&&c("ngIf",k(1,1,i.latLong$))},dependencies:[R,A,E],styles:["input[type=submit][_ngcontent-%COMP%]{font-size:1.125rem;width:11.25rem;font-family:Roboto Slab,serif}.totp-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:140px}@media (max-width: 768px){.totp-pane[_ngcontent-%COMP%]{margin-top:0}}.form-pane[_ngcontent-%COMP%]{padding:2rem}@media (max-width: 768px){.form-pane[_ngcontent-%COMP%]{padding:50px 24px 30px}}@media (max-width: 768px){.img-pane[_ngcontent-%COMP%]{border:0px!important}}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;width:325px;font-family:monospace;background:transparent;z-index:1;position:relative}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:none!important}.otp-container[_ngcontent-%COMP%] .stripe[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;font-family:monospace;position:absolute;padding-top:6px;z-index:0;bottom:0;left:14px}.latlong-container[_ngcontent-%COMP%]{background:#fff;border:1px solid #000000;border-radius:5px}.latlong-container[_ngcontent-%COMP%] .lat-label[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{display:inline-block;padding:12px;border-right:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{border-left:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .lat-value[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-value[_ngcontent-%COMP%]{background:#d9d9d94d}"]})};export{Z as AuthGeolocationComponent};
1
+ import{c as N}from"./chunk-7P2INFVM.js";import"./chunk-RACFHMSM.js";import{a as D}from"./chunk-EQ6536VC.js";import"./chunk-ZZ33EHCQ.js";import{$ as _,$a as l,Ga as P,Ib as o,Jb as e,Kb as u,N as b,Ob as S,Od as G,Qb as I,Rb as f,Wd as j,Xc as A,Y as m,aa as s,ad as E,c as p,db as d,ec as a,fa as y,fc as x,hd as R,kb as w,n as v,qb as g,va as C,vb as c,wa as O,xc as L,yb as M,yc as k}from"./chunk-ONCTFURX.js";import"./chunk-7DCB7DB2.js";function T(r,n){r&1&&(o(0,"div",21)(1,"span",22),a(2,"Latitude and Longitude is empty, please allow your browser location permission!"),e(),o(3,"a",23),a(4,"Click here to learn how to manually activate the location permission"),e()())}function z(r,n){if(r&1){let t=S();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"h3",4),a(4,"Geo Fencing"),e(),o(5,"p",5),a(6,"You are about to sign-in from this location"),e(),o(7,"div",6)(8,"div",7)(9,"div",8)(10,"span",9),a(11,"LAT"),e(),o(12,"span",10),a(13),e()(),o(14,"div",8)(15,"span",11),a(16,"LONG"),e(),o(17,"span",12),a(18),e()()(),o(19,"button",13),I("click",function(){C(t);let h=f();return O(h.proceed())}),a(20,"Proceed"),e()(),g(21,T,5,0,"div",14),e(),o(22,"div",15),u(23,"img",16),e()(),o(24,"div",17)(25,"div",18)(26,"div")(27,"span"),a(28,"powered by :"),e(),u(29,"a",19)(30,"img",20),e()()()()}if(r&2){let t=n.ngIf,i=f();l(2),M(t.latitude&&t.longitude?i.centerGeoPanelStyle:""),l(11),x(t.latitude),l(5),x(t.longitude),l(),c("disabled",!(t.latitude&&t.longitude)),l(2),c("ngIf",!(t.latitude&&t.longitude))}}var Z=class r{constructor(n,t,i,h){this.ngZone=n;this.auth=t;this.http=i;this.router=h}centerGeoPanelStyle="display: flex; flex-direction: column; justify-content: center;";latLong$;ngOnInit(){this.checkOnRefreshPage(),document.body.classList.add("login-body");let n=v(navigator.permissions.query({name:"geolocation"})).pipe(s(t=>new p(i=>{i.next(t.state),t.onchange=()=>this.ngZone.run(()=>i.next(t.state))})),m(1));this.latLong$=n.pipe(s(()=>new p(t=>{navigator.geolocation.getCurrentPosition(i=>this.ngZone.run(()=>{t.next({latitude:i.coords.latitude.toString(),longitude:i.coords.longitude.toString()}),t.complete()}),()=>this.ngZone.run(()=>{t.next({latitude:"",longitude:""}),t.complete()}),{enableHighAccuracy:!0,maximumAge:0,timeout:8e3})})),_({latitude:"",longitude:""}),m(1))}ngOnDestroy(){document.body.classList.remove("login-body")}checkOnRefreshPage(){D.IsEmpty(this.auth.loginResponse)&&this.router.navigate(["/"])}proceed(){this.latLong$.pipe(s(n=>this.http.post("/api/Authentication/LoginGeoRestriction",{UserID:this.auth.loginResponse.UserID,Latitude:n.latitude,Longitude:n.longitude})),y(n=>this.auth.saveLoginConfigToStorage(n)),s(()=>this.router.navigate([this.auth.getRedirectUrl()])),b(1)).subscribe()}static \u0275fac=function(t){return new(t||r)(d(P),d(N),d(j),d(G))};static \u0275cmp=w({type:r,selectors:[["POS-auth-geolocation"]],decls:2,vars:3,consts:[["class","container-fluid",4,"ngIf"],[1,"container-fluid"],[1,"row","bg-white","mx-auto","totp-pane"],[1,"col-md-7","order-md-first","order-last","form-pane"],[1,"text-start"],[1,"text-start","mb-7"],[1,"d-flex","flex-column","flex-md-row",2,"column-gap","10px"],[1,"latlong-container","d-flex","flex-grow-1"],[1,"flex-grow-1","text-start","d-flex"],[1,"lat-label","fw-bold"],[1,"ps-5","lat-value","flex-grow-1","d-flex","align-items-center"],[1,"long-label","fw-bold"],[1,"ps-5","long-value","flex-grow-1","d-flex","align-items-center"],[1,"btn","btn-success","mt-5","mx-auto","mx-md-0","mt-md-0","w-25","w-md-100",3,"click","disabled"],["class","text-start mt-7",4,"ngIf"],[1,"col-md-5","order-md-last","order-first","border-start","border-secondary","d-flex","align-items-center","justify-content-center","img-pane","py-6"],["src","https://res.cloudinary.com/pos/image/upload/v1685343992/POS/Images/geolocation-map.png",1,"border-0","w-100"],[1,"fixed-bottom"],[1,"d-flex","justify-content-start","mb-11","mx-11","footer-mobile"],["target","_blank","href","http://www.dealpos.com"],["src","//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png",1,"ms-3","border-0"],[1,"text-start","mt-7"],[1,"text-danger"],["href","https://support.dealpos.com/en/articles/7963864-enable-location-services-for-several-browser","target","_blank",1,"d-block"]],template:function(t,i){t&1&&(g(0,z,31,6,"div",0),L(1,"async")),t&2&&c("ngIf",k(1,1,i.latLong$))},dependencies:[R,A,E],styles:["input[type=submit][_ngcontent-%COMP%]{font-size:1.125rem;width:11.25rem;font-family:Roboto Slab,serif}.totp-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:140px}@media (max-width: 768px){.totp-pane[_ngcontent-%COMP%]{margin-top:0}}.form-pane[_ngcontent-%COMP%]{padding:2rem}@media (max-width: 768px){.form-pane[_ngcontent-%COMP%]{padding:50px 24px 30px}}@media (max-width: 768px){.img-pane[_ngcontent-%COMP%]{border:0px!important}}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;width:325px;font-family:monospace;background:transparent;z-index:1;position:relative}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:none!important}.otp-container[_ngcontent-%COMP%] .stripe[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;font-family:monospace;position:absolute;padding-top:6px;z-index:0;bottom:0;left:14px}.latlong-container[_ngcontent-%COMP%]{background:#fff;border:1px solid #000000;border-radius:5px}.latlong-container[_ngcontent-%COMP%] .lat-label[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{display:inline-block;padding:12px;border-right:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{border-left:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .lat-value[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-value[_ngcontent-%COMP%]{background:#d9d9d94d}"]})};export{Z as AuthGeolocationComponent};
@@ -1,4 +1,4 @@
1
- import{a as uo}from"./chunk-TK5H65DN.js";import{a as fi,b as Bt}from"./chunk-F6GAPEFT.js";import{a as hi}from"./chunk-6L6CIH5M.js";import{a as Do}from"./chunk-SHUBTJHC.js";import{e as Co}from"./chunk-E3JITLPA.js";import{b as bo}from"./chunk-P26RMRRL.js";import{d as yo}from"./chunk-W6YT427L.js";import{a as _o}from"./chunk-HDGIKSKP.js";import{a as go}from"./chunk-M55SSU2Z.js";import{a as me,b as Te,e as Oo}from"./chunk-Y2E4CRUL.js";import{a as co,b as So,c as Po}from"./chunk-JBHXY6BO.js";import{a as mo}from"./chunk-SDFVKBAE.js";import{a as Io}from"./chunk-XA77ZHST.js";import{b as dn,c as lo}from"./chunk-WROWBLUN.js";import{a as po}from"./chunk-2FE7KKYN.js";import{b as ao}from"./chunk-HOF45FIG.js";import{a as Jn}from"./chunk-FTFXCI5W.js";import{a as Pt,b as Ci,c as vi,d as _i}from"./chunk-KTUSLTKU.js";import{a as fo}from"./chunk-UD3ICZLV.js";import{b as ho}from"./chunk-M5TUQ4TJ.js";import{g as so}from"./chunk-AUEGBPEP.js";import{a as vo}from"./chunk-2PI2ZGEL.js";import{a as Mo}from"./chunk-7CXNVAHO.js";import{a as $e}from"./chunk-3PXI2XBC.js";import{a as gi,b as be}from"./chunk-BQUYCJJJ.js";import{a as mn,b as Ht,c as pn}from"./chunk-ONRHFWPY.js";import{d as ui}from"./chunk-UAWD35O3.js";import{p as Yn}from"./chunk-MC6ZRPRO.js";import{d as zn}from"./chunk-GQZZBFFT.js";import{a as tt,b as st,c as xe}from"./chunk-HT35KHLT.js";import{h as Kn}from"./chunk-2PXEEOUO.js";import{a as Xn,b as bt}from"./chunk-C7X4JG6F.js";import{C as K,D as Z,E as yt,J as oo,K as X,L as ve,O as ro,u as Y,v as ce,w as Ie}from"./chunk-KMVWE6IR.js";import{ga as mi,ha as Lt}from"./chunk-4IJDCXOA.js";import{G as St,O as di,P as Q,g as eo,n as pi,o as to,q as io,u as no}from"./chunk-QMH4FATM.js";import{a as et}from"./chunk-3X3O55NN.js";import{a as Fn,c as Ln}from"./chunk-GIKR6Y2K.js";import{d as _t,e as Zn}from"./chunk-P67FCS5T.js";import{a as ye,b as $n}from"./chunk-SRELAFRM.js";import{a as ne}from"./chunk-2FWFPV5I.js";import{D as li,c as Oe,e as si,h as Ce,i as Hn,k as Bn,l as ze,n as jn,o as De,p as Qn,s as vt,v as Un,w as Wn,y as Gn,z as qn}from"./chunk-J577JGRK.js";import{a as h,d as ci}from"./chunk-EQ6536VC.js";import{a as Vn}from"./chunk-LQKZB5PG.js";import{$ as Xt,$a as l,$b as Ft,$c as En,Ac as Ct,Db as E,Dc as Pe,E as oe,Eb as gt,Gb as ft,Hb as ht,I as Ze,Ia as ti,Ib as a,Ja as cn,Jb as s,Kb as _,Lb as B,M as dt,Ma as re,Mb as j,N as He,Nb as ri,Nc as Ge,Ob as I,Od as Nn,Pd as An,Q as ke,Qb as b,Rb as d,Rd as kn,Td as H,Uc as Fe,Va as We,Wa as ut,Wc as he,Wd as Me,Xa as Pn,Xc as ae,Y as Ve,Yc as In,Zb as kt,Zc as xn,_b as Vt,_c as Tn,aa as z,ad as qe,b as Yt,cd as Xe,d as Ae,da as Se,db as S,dc as U,e as fe,ec as m,ed as J,fa as se,fc as D,gc as P,hc as ai,hd as le,ib as ii,ic as Dn,ja as x,jc as k,k as mt,ka as ei,kb as R,kc as N,lb as ni,lc as V,ma as g,n as bn,na as w,o as Re,p as pt,pc as F,q as Kt,qb as f,qc as Be,r as Zt,rd as wn,sc as Mn,t as q,u as Ue,ub as On,v as Sn,va as C,vb as p,vd as Rn,wa as v,xc as y,yc as M,zb as oi,zc as te}from"./chunk-ONCTFURX.js";import{a as zt,h as Ke}from"./chunk-7DCB7DB2.js";var it=class{constructor(e){this.roleService=e;e&&this.setRole()}_Retrieve;_DateEditor;_NumberEditor;_PriceVisible;_UnitPriceEditor;_PricebookSelector;_Cost;_Return;_Discount;_SalesPerson;_PriceMinimum;_Payment;_CreditSalesLock;_CustomerInputLock;_PaymentCodeLock;_Shipping;_Tax;_DeleteItem;_BundlingPrice;_EmailRestriction;_ParkedDeletionAuthorized;_SellEditor;_ContactCreate;_PrepaidPackageCreate;_Order;_Reprint;_Contacts;_ContactsCreate;_InventoryView;_DebtView;_ClearCart;_SellDelete;_DeliveryEditor;_CouponInputLock;_Park;_Commission;setRole(){this._Retrieve=this.roleService.sell.RetrieveR,this._DateEditor=this.roleService.global.Date,this._NumberEditor=this.roleService.sell.Number,this._PriceVisible=this.roleService.sell.PriceVisible,this._SalesPerson=this.roleService.sell.SalesPerson,this._UnitPriceEditor=this.roleService.sell.UnitPriceEditor,this._PricebookSelector=this.roleService.sell.PricebookSelector,this._Cost=this.roleService.product.Cost,this._Return=this.roleService.sell.Return,this._Discount=this.roleService.sell.Discount,this._PriceMinimum=this.roleService.sell.PriceMinimum,this._Payment=this.roleService.sell.Payment,this._CreditSalesLock=this.roleService.sell.CreditSalesLock,this._CustomerInputLock=this.roleService.sell.CustomerInputLock,this._PaymentCodeLock=this.roleService.sell.PaymentCodeLock,this._Shipping=this.roleService.sell.Shipping,this._Tax=this.roleService.sell.Tax,this._DeleteItem=this.roleService.sell.DeleteItem,this._BundlingPrice=this.roleService.sell.BundlingPrice,this._EmailRestriction=this.roleService.sell.Email,this._SellEditor=this.roleService.sell.Edit,this._ContactCreate=this.roleService.contact.Create,this._PrepaidPackageCreate=this.roleService.prepaidPackage.Create,this._Order=this.roleService.order.View,this._Contacts=this.roleService.contact.View,this._ContactsCreate=this.roleService.contact.Create,this._InventoryView=this.roleService.inventory.View,this._DebtView=this.roleService.debt.View,this._ClearCart=this.roleService.sell.DeleteItem,this._SellDelete=this.roleService.sell.Delete,this._DeliveryEditor=this.roleService.logistic.Edit,this._Reprint=this.roleService.order.Print,this._CouponInputLock=this.roleService.sell.CouponInputLock,this._Park=this.roleService.sell.Park,this._Commission=this.roleService.product.CommissionView}get Park(){return this._Park}get CouponInputLock(){return this._CouponInputLock}set CouponInputLock(e){this._CouponInputLock=e}get Retrieve(){return this._Retrieve}get DateEditor(){return this._DateEditor}set DateEditor(e){this._DateEditor=e}get NumberEditor(){return this._NumberEditor}set NumberEditor(e){this._NumberEditor=e}get PriceVisible(){return this._PriceVisible}get UnitPriceEditor(){return this._UnitPriceEditor}set UnitPriceEditor(e){this._UnitPriceEditor=e}get PricebookSelector(){return this._PricebookSelector}set PricebookSelector(e){this._PricebookSelector=e}get Cost(){return this._Cost}get Return(){return this._Return}set Return(e){this._Return=e}get Discount(){return this._Discount}set Discount(e){this._Discount=e}get SalesPerson(){return this._SalesPerson}get PriceMinimum(){return this._PriceMinimum}get Payment(){return this._Payment}get CreditSalesLock(){return this._CreditSalesLock}get CustomerInputLock(){return this._CustomerInputLock}get PaymentCodeLock(){return this._PaymentCodeLock}get Shipping(){return this._Shipping}get Tax(){return this._Tax}set Tax(e){this._Tax=e}get DeleteItem(){return this._DeleteItem}set DeleteItem(e){this._DeleteItem=e}get BundlingPrice(){return this._BundlingPrice}get Email(){return this._EmailRestriction}get ParkedDeletionAuthorized(){return this._ParkedDeletionAuthorized}set ParkedDeletionAuthorized(e){this._ParkedDeletionAuthorized=e}get SellEditor(){return this._SellEditor}get PrepaidPackageCreate(){return this._PrepaidPackageCreate}get Order(){return this._Order}get Reprint(){return this._Reprint}get Contacts(){return this._Contacts}get ContactsCreate(){return this._ContactsCreate}get InventoryView(){return this._InventoryView}get DebtView(){return this._DebtView}get ClearCartRestriction(){return this._ClearCart}get SellDelete(){return this._SellDelete}get DeliveryEditor(){return this._DeliveryEditor}get Commission(){return this._Commission}};var jt=class{DeliveryEntityID;Type;NewOrderID;constructor(){this.DeliveryEntityID="",this.Type=3}};var G=class{Order;Invoice;Shipping;Action;Payments;Items;CartItems;ContactName;SplitParkLabel;get cartQuantity(){let e=0;for(let t of this.CartItems)e+=t.Quantity;return e}constructor(){this.Order=new dn,this.Invoice=new Ht,this.Shipping=new pn,this.Action=new jt,this.Payments=Array(),this.Items=Array(),this.CartItems=Array(),this.ContactName=""}get TotalPaidAmount(){let e=0;return this.Payments.forEach(t=>{e+=t.PaidAmount}),e}get RedeemableAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID!=1);return this.GetAmountByCart(e)}get TotalQuantity(){let e=0;return this.CartItems.forEach(t=>{t.PromotionGift||(e+=t.Quantity)}),e}get CashOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==1);return this.GetAmountByCart(e)}get PointOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==2);return this.GetAmountByCart(e)}get PrepaidPackageItem(){return this.CartItems.filter(t=>t.Variant.TypeID==10)}GetAmountByCart(e){let t=0;return e.forEach(i=>{t+=i.Total}),t=t*(100-this.Order.Discount)/100,t=t*(100-this.Order.Discount2)/100,t}getRewards(){return this.CartItems.filter(t=>t.PromotionGift)}};Ke([tt(()=>dn)],G.prototype,"Order",2),Ke([tt(()=>Ht)],G.prototype,"Invoice",2),Ke([tt(()=>pn)],G.prototype,"Shipping",2),Ke([tt(()=>jt)],G.prototype,"Action",2),Ke([tt(()=>$e)],G.prototype,"Payments",2),Ke([tt(()=>gi)],G.prototype,"Items",2),Ke([tt(()=>be)],G.prototype,"CartItems",2);var yi=class{Success;Message;message;ObjectID;SalesOrderID;OutDeliveryID;Contact;LoyaltyPoint;InvoiceNumber;Creator;OrderTimeString;PrintMode;PaymentStateID;PaymentStateLabel;Final;constructor(){this.Success=!0,this.Message="",this.ObjectID="",this.SalesOrderID="",this.OutDeliveryID="",this.Contact=null,this.LoyaltyPoint="",this.InvoiceNumber="",this.Creator="",this.OrderTimeString="",this.PrintMode=0,this.PaymentStateID=0,this.PaymentStateLabel="",this.Final=0}};var Ot=class n{constructor(e,t,i,o){this.httpService=e;this._localDataService=t;this._onlineStatusService=i;this._toastrService=o;this._onlineStatusService.getOnlineStatus$().subscribe(r=>{this.isOnline=r})}_Data=new fe(null);Data$=this._Data.pipe(ke(),oe(e=>e!==null));isOnline;get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}getSalesOrderPrint(e){return this.httpService.post("/API/POS/GetSalesOrderPrint",{TemplateID:e})}submitOrder(e,t){let i=this.generatePOSDataForSubmission(e,this.isOnline);if(this.isOnline)return this.submitOnline(i).pipe(this.handleTimeOutError(i));if(t.ModuleSell.EnableOfflineTransaction)return this._localDataService.syncOrder(i).pipe(q(()=>this.generateCompleteData(i)));this._toastrService.warning("Offline order is not Supported!","Info!")}uploadOfflineOrder(e){return this._localDataService.uploadSingleOrder(e).pipe(Ze(t=>t?.message?.includes("objectStore does not exists")?this.submitOnline(e):pt(()=>t)))}submitOnline(e){return this.httpService.post(Q.SubmitOrder,e,Vn.pos.submitOrderTimeout)}handleTimeOutError(e){return Yt(Ze(t=>{if(t instanceof Zt||t?.name=="TimeoutError"){let i=this.generateCompleteData(e);this.pushNewValue(i)}throw t}))}generatePOSDataForSubmission(e,t=!0){let i=Object.assign(new G,e);i.Items=[],i.Order.CustomerID==null&&(i.Order.CustomerID=h.GuidEmpty),i.Order.SalesID==null&&(i.Order.SalesID=h.GuidEmpty);let o=1;i.Payments=i.Payments.map(c=>(c.Date=i.Order.Date,c.Index=o,o++,delete c.TypeID,c));let r=1;for(let c of i.CartItems){let u=new gi;u.ID=c.ID,u.VariantID=c.VariantID,u.Quantity=c.Quantity,u.Cost=c.Cost,u.Price=c.Price,u.Discount=c.Discount,u.DiscountAmount=c.DiscountAmount,u.Note=c.Note,u.Taxable=c.Variant.Taxable,u.LoyaltyPoint=c.LoyaltyPoint,u.UnitCost=c.Cost,u.UnitPrice=c.Price,u.UnitPriceOriginal=c.UnitPriceOriginal,u.UnitExpense=c.UnitExpense,u.EntityID=c.EntityID,u.Index=r,u.UnitQuantity=c.UnitQuantity,u.PriceTypeID=c.PriceTypeID,u.PriceNote=c.PriceNote,u.Splited=c.SplitQuantity>0,u.SplitQuantity=c.SplitQuantity,u.InventoryTypeID=c.Variant.TypeID,u.SalesID="",u.Serial=c.Serial,c.SalesID&&(u.SalesID=c.SalesID),delete c.CouponDiscount,i.Items.push(u),r++}return t?(delete i.CartItems,delete i.Order.ClientTimestamp):i.Order.ClientTimestamp=new Date,i}generateCompleteData(e){let t=new yi;return t.InvoiceNumber=e.Order.Number,t.OrderTimeString=new Date().toString(),t.PaymentStateID=e.Action?.Type,t.PaymentStateLabel="Offline",t.Success=!0,t.OutDeliveryID=e.Action.DeliveryEntityID,t}GetReturnInvoice(e,t){return this.httpService.get(Q.ReturInvoice,[{key:"EntityID",value:t},{key:"Number",value:e}])}GetInvoiceBySoID(e){return this.httpService.get(Q.GetPOSDataByID,[{key:"ID",value:e}])}UploadCSV(e,t){let i={CartItems:e,EntityID:t};return this.httpService.post(Q.UploadCsv,i)}sendEmail(e,t){return new Promise((i,o)=>{this._localDataService.isProductFromServer().subscribe(r=>{if(r){let c={invoiceID:t,email:e};this.httpService.post(Q.SendInvoiceEmail,c).subscribe({next:u=>{i(u)},error:u=>{o(u)}})}else o(X.wrongOfflineAction)})})}sendWhatsaap(e,t){let i={InvoiceID:e,PhoneNumber:t};return this.httpService.post(Q.SendInvoiceWhatsapp,i)}createCustomerByInvoice(e,t){let i={InvoiceID:e,Mobile:t};return this.httpService.post(Q.CreateCustomerInvoice,i)}saveCommission(e,t){let i={SOID:e,commission:t};return this.httpService.POSText("/API/Transaction/SetCommission",i)}generateReceiptA4(e){let t={ID:e};return this.httpService.post(Q.InvoiceA4,t)}getVacant(e){return this.httpService.get(Q.GetVacant,[{key:"EntityID",value:e}])}static \u0275fac=function(t){return new(t||n)(g(Me),g(ve),g(me),g(H))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var $=class n{constructor(e,t,i){this._localDataService=e;this._onlineStatusService=t;this._httpService=i;this._onlineStatusService.getOnlineStatus$().subscribe(o=>{this.isOnline=o})}_Data=new fe(null);Data$=this._Data.asObservable().pipe(oe(e=>e!==null),ke());isOnline;get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}requestObservable(){return this.isOnline?this._httpService.get(Q.GetPOSStorage).pipe(q(e=>({data:e,type:"Online"}))):this._localDataService.getPOSStorage().pipe(oe(e=>e!=null),q(e=>({data:e,type:"Offline"})))}getOutletName(e){return this.Data.Entities.find(i=>i.ID==e)?.Name}static \u0275fac=function(t){return new(t||n)(g(ve),g(me),g(Me))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var _e=class n{constructor(e){this.roleService=e;this.pushNewValue(new it(e))}_Data=new fe(new it(null));get Data(){return this._Data.value}Data$=this._Data.asObservable();pushNewValue(e){this._Data.next(e)}static \u0275fac=function(t){return new(t||n)(g(ci))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var Wt=class{ID;Code;EntityID;Name;Description;Start;StartDisplay;State;Open;CashierID;OpeningCash;EntityName;LoginID;Active;CustomerDisplayEnabled;OvoConfigurationID;CustomerDisplayID;ListImage;Suspended};var Wo=n=>({active:n}),Go=n=>({gray:n});function qo(n,e){if(n&1){let t=I();a(0,"span",17),b("click",function(o){C(t);let r=d().$implicit;return d().closeRegister(r),v(o.stopPropagation())}),s()}}function $o(n,e){n&1&&(a(0,"div")(1,"span",18),m(2,"VACANT"),s()())}function Jo(n,e){if(n&1&&(a(0,"div")(1,"span",19),_(2,"i",20),a(3,"font"),m(4),s()(),a(5,"span",21),_(6,"i",22),a(7,"font"),m(8),s()()()),n&2){let t=d().$implicit;l(4),D(t.LoginID),l(4),P("",t.StartDisplay.split(" ")[3]," - Now")}}function zo(n,e){if(n&1){let t=I();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"h5",12),b("click",function(){let o=C(t).$implicit,r=d();return v(r.select(o))}),a(4,"span"),_(5,"i",13),m(6),y(7,"limitTo"),s(),f(8,qo,1,0,"span",14),s(),a(9,"div",15),b("click",function(){let o=C(t).$implicit,r=d();return v(r.select(o))}),f(10,$o,3,0,"div",16)(11,Jo,9,2,"div",16),s()()()()}if(n&2){let t=e.$implicit,i=d();l(),p("ngClass",t.Active?"active":""),l(),p("ngClass",F(11,Wo,(t==null?null:t.ID)==(i.selectedRegister==null?null:i.selectedRegister.ID))),l(),p("ngClass",F(13,Go,t!=i.selectedRegister)),l(3),D(te(7,8,t.Name,15)),l(2),p("ngIf",t.State!="Close"),l(),p("ngSwitch",t.State),l(),p("ngSwitchCase","Close"),l(),p("ngSwitchCase","Open")}}var bi=class n{constructor(e,t,i,o,r){this._dialogRef=e;this._outletService=t;this._posService=i;this._userRoleService=o;this.router=r}originalSelectedRegister=null;registers;searchInput="";selectedRegister=new Wt;modalConfig=new K;role;get AppConfigJSON(){return this._posService.Data.AppConfigJSON}destroy$=new Ae;ngOnInit(){this.subscribeToObsChanges(),this.initModalConfig()}subscribeToObsChanges(){this._posService.Data$.pipe(Se(this.destroy$)).subscribe(e=>{this.registers=e.Registers}),this._outletService.Data$.pipe(Se(this.destroy$)).subscribe(e=>{this.selectedRegister=this.findOutletRegisterById(e.RegisterID),this.originalSelectedRegister=this.selectedRegister?zt({},this.selectedRegister):null}),this._userRoleService.Data$.pipe(Se(this.destroy$)).subscribe(e=>{this.role=e})}findOutletRegisterById(e){let t=this.registers.find(i=>i.ID===e);return t||new Wt}initModalConfig(){this.modalConfig.hideClose=!1,this.modalConfig.hideCancel=!1,this.modalConfig.bodyScrollable=!0,this.modalConfig.title="Choose an outlet"}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}close(){this._dialogRef.close()}onOk(){if(this.selectedRegister.ID==null){alert("Please select a register first!");return}this._outletService.pushNewRegister(this.selectedRegister),this._dialogRef.close({selectedRegister:this.selectedRegister,openStartingCashDialog:this.selectedRegister.ID!=this.originalSelectedRegister?.ID})}select(e){if(this.AppConfigJSON.ModuleShift.Closure.Enabled)if(this.selectedRegister.ID!=null&&this.selectedRegister.Open&&e.CashierID==null)confirm("You already have an active register with "+this.selectedRegister.Name+`!
1
+ import{a as uo}from"./chunk-TK5H65DN.js";import{a as fi,b as Bt}from"./chunk-F6GAPEFT.js";import{a as hi}from"./chunk-6L6CIH5M.js";import{a as Do}from"./chunk-SHUBTJHC.js";import{e as Co}from"./chunk-E3JITLPA.js";import{b as bo}from"./chunk-P26RMRRL.js";import{d as yo}from"./chunk-W6YT427L.js";import{a as _o}from"./chunk-HDGIKSKP.js";import{a as go}from"./chunk-M55SSU2Z.js";import{a as me,b as Te,e as Oo}from"./chunk-Y2E4CRUL.js";import{a as co,b as So,c as Po}from"./chunk-JBHXY6BO.js";import{a as mo}from"./chunk-SDFVKBAE.js";import{a as Io}from"./chunk-XA77ZHST.js";import{b as dn,c as lo}from"./chunk-WROWBLUN.js";import{a as po}from"./chunk-2FE7KKYN.js";import{b as ao}from"./chunk-HOF45FIG.js";import{a as Jn}from"./chunk-FTFXCI5W.js";import{a as Pt,b as Ci,c as vi,d as _i}from"./chunk-KTUSLTKU.js";import{a as fo}from"./chunk-UD3ICZLV.js";import{b as ho}from"./chunk-M5TUQ4TJ.js";import{g as so}from"./chunk-AUEGBPEP.js";import{a as vo}from"./chunk-2PI2ZGEL.js";import{a as Mo}from"./chunk-7CXNVAHO.js";import{a as $e}from"./chunk-3PXI2XBC.js";import{a as gi,b as be}from"./chunk-BQUYCJJJ.js";import{a as mn,b as Ht,c as pn}from"./chunk-ONRHFWPY.js";import{d as ui}from"./chunk-UAWD35O3.js";import{p as Yn}from"./chunk-MC6ZRPRO.js";import{d as zn}from"./chunk-GQZZBFFT.js";import{a as tt,b as st,c as xe}from"./chunk-HT35KHLT.js";import{h as Kn}from"./chunk-2PXEEOUO.js";import{a as Xn,b as bt}from"./chunk-C7X4JG6F.js";import{C as K,D as Z,E as yt,J as oo,K as X,L as ve,O as ro,u as Y,v as ce,w as Ie}from"./chunk-KMVWE6IR.js";import{ga as mi,ha as Lt}from"./chunk-4IJDCXOA.js";import{G as St,O as di,P as Q,g as eo,n as pi,o as to,q as io,u as no}from"./chunk-QMH4FATM.js";import{a as et}from"./chunk-3X3O55NN.js";import{a as Fn,c as Ln}from"./chunk-GIKR6Y2K.js";import{d as _t,e as Zn}from"./chunk-P67FCS5T.js";import{a as ye,b as $n}from"./chunk-SRELAFRM.js";import{a as ne}from"./chunk-2FWFPV5I.js";import{D as li,c as Oe,e as si,h as Ce,i as Hn,k as Bn,l as ze,n as jn,o as De,p as Qn,s as vt,v as Un,w as Wn,y as Gn,z as qn}from"./chunk-J577JGRK.js";import{a as h,d as ci}from"./chunk-EQ6536VC.js";import{a as Vn}from"./chunk-ZZ33EHCQ.js";import{$ as Xt,$a as l,$b as Ft,$c as En,Ac as Ct,Db as E,Dc as Pe,E as oe,Eb as gt,Gb as ft,Hb as ht,I as Ze,Ia as ti,Ib as a,Ja as cn,Jb as s,Kb as _,Lb as B,M as dt,Ma as re,Mb as j,N as He,Nb as ri,Nc as Ge,Ob as I,Od as Nn,Pd as An,Q as ke,Qb as b,Rb as d,Rd as kn,Td as H,Uc as Fe,Va as We,Wa as ut,Wc as he,Wd as Me,Xa as Pn,Xc as ae,Y as Ve,Yc as In,Zb as kt,Zc as xn,_b as Vt,_c as Tn,aa as z,ad as qe,b as Yt,cd as Xe,d as Ae,da as Se,db as S,dc as U,e as fe,ec as m,ed as J,fa as se,fc as D,gc as P,hc as ai,hd as le,ib as ii,ic as Dn,ja as x,jc as k,k as mt,ka as ei,kb as R,kc as N,lb as ni,lc as V,ma as g,n as bn,na as w,o as Re,p as pt,pc as F,q as Kt,qb as f,qc as Be,r as Zt,rd as wn,sc as Mn,t as q,u as Ue,ub as On,v as Sn,va as C,vb as p,vd as Rn,wa as v,xc as y,yc as M,zb as oi,zc as te}from"./chunk-ONCTFURX.js";import{a as zt,h as Ke}from"./chunk-7DCB7DB2.js";var it=class{constructor(e){this.roleService=e;e&&this.setRole()}_Retrieve;_DateEditor;_NumberEditor;_PriceVisible;_UnitPriceEditor;_PricebookSelector;_Cost;_Return;_Discount;_SalesPerson;_PriceMinimum;_Payment;_CreditSalesLock;_CustomerInputLock;_PaymentCodeLock;_Shipping;_Tax;_DeleteItem;_BundlingPrice;_EmailRestriction;_ParkedDeletionAuthorized;_SellEditor;_ContactCreate;_PrepaidPackageCreate;_Order;_Reprint;_Contacts;_ContactsCreate;_InventoryView;_DebtView;_ClearCart;_SellDelete;_DeliveryEditor;_CouponInputLock;_Park;_Commission;setRole(){this._Retrieve=this.roleService.sell.RetrieveR,this._DateEditor=this.roleService.global.Date,this._NumberEditor=this.roleService.sell.Number,this._PriceVisible=this.roleService.sell.PriceVisible,this._SalesPerson=this.roleService.sell.SalesPerson,this._UnitPriceEditor=this.roleService.sell.UnitPriceEditor,this._PricebookSelector=this.roleService.sell.PricebookSelector,this._Cost=this.roleService.product.Cost,this._Return=this.roleService.sell.Return,this._Discount=this.roleService.sell.Discount,this._PriceMinimum=this.roleService.sell.PriceMinimum,this._Payment=this.roleService.sell.Payment,this._CreditSalesLock=this.roleService.sell.CreditSalesLock,this._CustomerInputLock=this.roleService.sell.CustomerInputLock,this._PaymentCodeLock=this.roleService.sell.PaymentCodeLock,this._Shipping=this.roleService.sell.Shipping,this._Tax=this.roleService.sell.Tax,this._DeleteItem=this.roleService.sell.DeleteItem,this._BundlingPrice=this.roleService.sell.BundlingPrice,this._EmailRestriction=this.roleService.sell.Email,this._SellEditor=this.roleService.sell.Edit,this._ContactCreate=this.roleService.contact.Create,this._PrepaidPackageCreate=this.roleService.prepaidPackage.Create,this._Order=this.roleService.order.View,this._Contacts=this.roleService.contact.View,this._ContactsCreate=this.roleService.contact.Create,this._InventoryView=this.roleService.inventory.View,this._DebtView=this.roleService.debt.View,this._ClearCart=this.roleService.sell.DeleteItem,this._SellDelete=this.roleService.sell.Delete,this._DeliveryEditor=this.roleService.logistic.Edit,this._Reprint=this.roleService.order.Print,this._CouponInputLock=this.roleService.sell.CouponInputLock,this._Park=this.roleService.sell.Park,this._Commission=this.roleService.product.CommissionView}get Park(){return this._Park}get CouponInputLock(){return this._CouponInputLock}set CouponInputLock(e){this._CouponInputLock=e}get Retrieve(){return this._Retrieve}get DateEditor(){return this._DateEditor}set DateEditor(e){this._DateEditor=e}get NumberEditor(){return this._NumberEditor}set NumberEditor(e){this._NumberEditor=e}get PriceVisible(){return this._PriceVisible}get UnitPriceEditor(){return this._UnitPriceEditor}set UnitPriceEditor(e){this._UnitPriceEditor=e}get PricebookSelector(){return this._PricebookSelector}set PricebookSelector(e){this._PricebookSelector=e}get Cost(){return this._Cost}get Return(){return this._Return}set Return(e){this._Return=e}get Discount(){return this._Discount}set Discount(e){this._Discount=e}get SalesPerson(){return this._SalesPerson}get PriceMinimum(){return this._PriceMinimum}get Payment(){return this._Payment}get CreditSalesLock(){return this._CreditSalesLock}get CustomerInputLock(){return this._CustomerInputLock}get PaymentCodeLock(){return this._PaymentCodeLock}get Shipping(){return this._Shipping}get Tax(){return this._Tax}set Tax(e){this._Tax=e}get DeleteItem(){return this._DeleteItem}set DeleteItem(e){this._DeleteItem=e}get BundlingPrice(){return this._BundlingPrice}get Email(){return this._EmailRestriction}get ParkedDeletionAuthorized(){return this._ParkedDeletionAuthorized}set ParkedDeletionAuthorized(e){this._ParkedDeletionAuthorized=e}get SellEditor(){return this._SellEditor}get PrepaidPackageCreate(){return this._PrepaidPackageCreate}get Order(){return this._Order}get Reprint(){return this._Reprint}get Contacts(){return this._Contacts}get ContactsCreate(){return this._ContactsCreate}get InventoryView(){return this._InventoryView}get DebtView(){return this._DebtView}get ClearCartRestriction(){return this._ClearCart}get SellDelete(){return this._SellDelete}get DeliveryEditor(){return this._DeliveryEditor}get Commission(){return this._Commission}};var jt=class{DeliveryEntityID;Type;NewOrderID;constructor(){this.DeliveryEntityID="",this.Type=3}};var G=class{Order;Invoice;Shipping;Action;Payments;Items;CartItems;ContactName;SplitParkLabel;get cartQuantity(){let e=0;for(let t of this.CartItems)e+=t.Quantity;return e}constructor(){this.Order=new dn,this.Invoice=new Ht,this.Shipping=new pn,this.Action=new jt,this.Payments=Array(),this.Items=Array(),this.CartItems=Array(),this.ContactName=""}get TotalPaidAmount(){let e=0;return this.Payments.forEach(t=>{e+=t.PaidAmount}),e}get RedeemableAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID!=1);return this.GetAmountByCart(e)}get TotalQuantity(){let e=0;return this.CartItems.forEach(t=>{t.PromotionGift||(e+=t.Quantity)}),e}get CashOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==1);return this.GetAmountByCart(e)}get PointOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==2);return this.GetAmountByCart(e)}get PrepaidPackageItem(){return this.CartItems.filter(t=>t.Variant.TypeID==10)}GetAmountByCart(e){let t=0;return e.forEach(i=>{t+=i.Total}),t=t*(100-this.Order.Discount)/100,t=t*(100-this.Order.Discount2)/100,t}getRewards(){return this.CartItems.filter(t=>t.PromotionGift)}};Ke([tt(()=>dn)],G.prototype,"Order",2),Ke([tt(()=>Ht)],G.prototype,"Invoice",2),Ke([tt(()=>pn)],G.prototype,"Shipping",2),Ke([tt(()=>jt)],G.prototype,"Action",2),Ke([tt(()=>$e)],G.prototype,"Payments",2),Ke([tt(()=>gi)],G.prototype,"Items",2),Ke([tt(()=>be)],G.prototype,"CartItems",2);var yi=class{Success;Message;message;ObjectID;SalesOrderID;OutDeliveryID;Contact;LoyaltyPoint;InvoiceNumber;Creator;OrderTimeString;PrintMode;PaymentStateID;PaymentStateLabel;Final;constructor(){this.Success=!0,this.Message="",this.ObjectID="",this.SalesOrderID="",this.OutDeliveryID="",this.Contact=null,this.LoyaltyPoint="",this.InvoiceNumber="",this.Creator="",this.OrderTimeString="",this.PrintMode=0,this.PaymentStateID=0,this.PaymentStateLabel="",this.Final=0}};var Ot=class n{constructor(e,t,i,o){this.httpService=e;this._localDataService=t;this._onlineStatusService=i;this._toastrService=o;this._onlineStatusService.getOnlineStatus$().subscribe(r=>{this.isOnline=r})}_Data=new fe(null);Data$=this._Data.pipe(ke(),oe(e=>e!==null));isOnline;get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}getSalesOrderPrint(e){return this.httpService.post("/API/POS/GetSalesOrderPrint",{TemplateID:e})}submitOrder(e,t){let i=this.generatePOSDataForSubmission(e,this.isOnline);if(this.isOnline)return this.submitOnline(i).pipe(this.handleTimeOutError(i));if(t.ModuleSell.EnableOfflineTransaction)return this._localDataService.syncOrder(i).pipe(q(()=>this.generateCompleteData(i)));this._toastrService.warning("Offline order is not Supported!","Info!")}uploadOfflineOrder(e){return this._localDataService.uploadSingleOrder(e).pipe(Ze(t=>t?.message?.includes("objectStore does not exists")?this.submitOnline(e):pt(()=>t)))}submitOnline(e){return this.httpService.post(Q.SubmitOrder,e,Vn.pos.submitOrderTimeout)}handleTimeOutError(e){return Yt(Ze(t=>{if(t instanceof Zt||t?.name=="TimeoutError"){let i=this.generateCompleteData(e);this.pushNewValue(i)}throw t}))}generatePOSDataForSubmission(e,t=!0){let i=Object.assign(new G,e);i.Items=[],i.Order.CustomerID==null&&(i.Order.CustomerID=h.GuidEmpty),i.Order.SalesID==null&&(i.Order.SalesID=h.GuidEmpty);let o=1;i.Payments=i.Payments.map(c=>(c.Date=i.Order.Date,c.Index=o,o++,delete c.TypeID,c));let r=1;for(let c of i.CartItems){let u=new gi;u.ID=c.ID,u.VariantID=c.VariantID,u.Quantity=c.Quantity,u.Cost=c.Cost,u.Price=c.Price,u.Discount=c.Discount,u.DiscountAmount=c.DiscountAmount,u.Note=c.Note,u.Taxable=c.Variant.Taxable,u.LoyaltyPoint=c.LoyaltyPoint,u.UnitCost=c.Cost,u.UnitPrice=c.Price,u.UnitPriceOriginal=c.UnitPriceOriginal,u.UnitExpense=c.UnitExpense,u.EntityID=c.EntityID,u.Index=r,u.UnitQuantity=c.UnitQuantity,u.PriceTypeID=c.PriceTypeID,u.PriceNote=c.PriceNote,u.Splited=c.SplitQuantity>0,u.SplitQuantity=c.SplitQuantity,u.InventoryTypeID=c.Variant.TypeID,u.SalesID="",u.Serial=c.Serial,c.SalesID&&(u.SalesID=c.SalesID),delete c.CouponDiscount,i.Items.push(u),r++}return t?(delete i.CartItems,delete i.Order.ClientTimestamp):i.Order.ClientTimestamp=new Date,i}generateCompleteData(e){let t=new yi;return t.InvoiceNumber=e.Order.Number,t.OrderTimeString=new Date().toString(),t.PaymentStateID=e.Action?.Type,t.PaymentStateLabel="Offline",t.Success=!0,t.OutDeliveryID=e.Action.DeliveryEntityID,t}GetReturnInvoice(e,t){return this.httpService.get(Q.ReturInvoice,[{key:"EntityID",value:t},{key:"Number",value:e}])}GetInvoiceBySoID(e){return this.httpService.get(Q.GetPOSDataByID,[{key:"ID",value:e}])}UploadCSV(e,t){let i={CartItems:e,EntityID:t};return this.httpService.post(Q.UploadCsv,i)}sendEmail(e,t){return new Promise((i,o)=>{this._localDataService.isProductFromServer().subscribe(r=>{if(r){let c={invoiceID:t,email:e};this.httpService.post(Q.SendInvoiceEmail,c).subscribe({next:u=>{i(u)},error:u=>{o(u)}})}else o(X.wrongOfflineAction)})})}sendWhatsaap(e,t){let i={InvoiceID:e,PhoneNumber:t};return this.httpService.post(Q.SendInvoiceWhatsapp,i)}createCustomerByInvoice(e,t){let i={InvoiceID:e,Mobile:t};return this.httpService.post(Q.CreateCustomerInvoice,i)}saveCommission(e,t){let i={SOID:e,commission:t};return this.httpService.POSText("/API/Transaction/SetCommission",i)}generateReceiptA4(e){let t={ID:e};return this.httpService.post(Q.InvoiceA4,t)}getVacant(e){return this.httpService.get(Q.GetVacant,[{key:"EntityID",value:e}])}static \u0275fac=function(t){return new(t||n)(g(Me),g(ve),g(me),g(H))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var $=class n{constructor(e,t,i){this._localDataService=e;this._onlineStatusService=t;this._httpService=i;this._onlineStatusService.getOnlineStatus$().subscribe(o=>{this.isOnline=o})}_Data=new fe(null);Data$=this._Data.asObservable().pipe(oe(e=>e!==null),ke());isOnline;get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}requestObservable(){return this.isOnline?this._httpService.get(Q.GetPOSStorage).pipe(q(e=>({data:e,type:"Online"}))):this._localDataService.getPOSStorage().pipe(oe(e=>e!=null),q(e=>({data:e,type:"Offline"})))}getOutletName(e){return this.Data.Entities.find(i=>i.ID==e)?.Name}static \u0275fac=function(t){return new(t||n)(g(ve),g(me),g(Me))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var _e=class n{constructor(e){this.roleService=e;this.pushNewValue(new it(e))}_Data=new fe(new it(null));get Data(){return this._Data.value}Data$=this._Data.asObservable();pushNewValue(e){this._Data.next(e)}static \u0275fac=function(t){return new(t||n)(g(ci))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var Wt=class{ID;Code;EntityID;Name;Description;Start;StartDisplay;State;Open;CashierID;OpeningCash;EntityName;LoginID;Active;CustomerDisplayEnabled;OvoConfigurationID;CustomerDisplayID;ListImage;Suspended};var Wo=n=>({active:n}),Go=n=>({gray:n});function qo(n,e){if(n&1){let t=I();a(0,"span",17),b("click",function(o){C(t);let r=d().$implicit;return d().closeRegister(r),v(o.stopPropagation())}),s()}}function $o(n,e){n&1&&(a(0,"div")(1,"span",18),m(2,"VACANT"),s()())}function Jo(n,e){if(n&1&&(a(0,"div")(1,"span",19),_(2,"i",20),a(3,"font"),m(4),s()(),a(5,"span",21),_(6,"i",22),a(7,"font"),m(8),s()()()),n&2){let t=d().$implicit;l(4),D(t.LoginID),l(4),P("",t.StartDisplay.split(" ")[3]," - Now")}}function zo(n,e){if(n&1){let t=I();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"h5",12),b("click",function(){let o=C(t).$implicit,r=d();return v(r.select(o))}),a(4,"span"),_(5,"i",13),m(6),y(7,"limitTo"),s(),f(8,qo,1,0,"span",14),s(),a(9,"div",15),b("click",function(){let o=C(t).$implicit,r=d();return v(r.select(o))}),f(10,$o,3,0,"div",16)(11,Jo,9,2,"div",16),s()()()()}if(n&2){let t=e.$implicit,i=d();l(),p("ngClass",t.Active?"active":""),l(),p("ngClass",F(11,Wo,(t==null?null:t.ID)==(i.selectedRegister==null?null:i.selectedRegister.ID))),l(),p("ngClass",F(13,Go,t!=i.selectedRegister)),l(3),D(te(7,8,t.Name,15)),l(2),p("ngIf",t.State!="Close"),l(),p("ngSwitch",t.State),l(),p("ngSwitchCase","Close"),l(),p("ngSwitchCase","Open")}}var bi=class n{constructor(e,t,i,o,r){this._dialogRef=e;this._outletService=t;this._posService=i;this._userRoleService=o;this.router=r}originalSelectedRegister=null;registers;searchInput="";selectedRegister=new Wt;modalConfig=new K;role;get AppConfigJSON(){return this._posService.Data.AppConfigJSON}destroy$=new Ae;ngOnInit(){this.subscribeToObsChanges(),this.initModalConfig()}subscribeToObsChanges(){this._posService.Data$.pipe(Se(this.destroy$)).subscribe(e=>{this.registers=e.Registers}),this._outletService.Data$.pipe(Se(this.destroy$)).subscribe(e=>{this.selectedRegister=this.findOutletRegisterById(e.RegisterID),this.originalSelectedRegister=this.selectedRegister?zt({},this.selectedRegister):null}),this._userRoleService.Data$.pipe(Se(this.destroy$)).subscribe(e=>{this.role=e})}findOutletRegisterById(e){let t=this.registers.find(i=>i.ID===e);return t||new Wt}initModalConfig(){this.modalConfig.hideClose=!1,this.modalConfig.hideCancel=!1,this.modalConfig.bodyScrollable=!0,this.modalConfig.title="Choose an outlet"}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}close(){this._dialogRef.close()}onOk(){if(this.selectedRegister.ID==null){alert("Please select a register first!");return}this._outletService.pushNewRegister(this.selectedRegister),this._dialogRef.close({selectedRegister:this.selectedRegister,openStartingCashDialog:this.selectedRegister.ID!=this.originalSelectedRegister?.ID})}select(e){if(this.AppConfigJSON.ModuleShift.Closure.Enabled)if(this.selectedRegister.ID!=null&&this.selectedRegister.Open&&e.CashierID==null)confirm("You already have an active register with "+this.selectedRegister.Name+`!
2
2
  Do you want to end your session?`)&&(this.close(),this.router.navigate(["menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}}));else if(!e.Open||this.selectedRegister.ID==e.ID)this.selectedRegister=e;else{if(this.role.SellEditor==!1){alert("You cannot end shift for Register "+e.Name+" - Unauthorized Access");return}alert("This Register has already active register, Are you sure you want to end this register?"),this.close(),this.router.navigate(["/menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}})}else this.selectedRegister=e}closeRegister(e){let t=this.selectedRegister.ID;if(this.role.SellEditor==!1){alert("You cannot end shift for Register "+e.Name+" - Unauthorized Access");return}t==e.ID?this.router.navigate(["/menu/Shift/Main/My_Shift"]):this.router.navigate(["/menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}}),this.close()}static \u0275fac=function(t){return new(t||n)(S(Y),S(ee),S($),S(_e),S(Nn))};static \u0275cmp=R({type:n,selectors:[["pos-modal-register"]],standalone:!1,decls:12,vars:7,consts:[[3,"onOk","onCancel","onClose","config"],[1,"ms-0","mb-8",2,"width","200px",3,"hidden"],[1,"input-group","mb-3"],[1,"input-group-text","txtFilter"],["aria-hidden","true",1,"fa","fa-magnifying-glass"],["data-cy","SearchOutlet","type","text","placeholder","Filter by Name","aria-label","Search",1,"txtFilter","form-control","border-start-0",3,"ngModelChange","ngModel"],[1,"container"],[1,"row",2,"width","600px"],["class","col-4","data-cy","registers",4,"ngFor","ngForOf"],["data-cy","registers",1,"col-4"],[1,"card","border-0",3,"ngClass"],[1,"card-body","p-0",3,"ngClass"],[1,"card-title","mb-0",3,"click","ngClass"],[1,"fa-solid","fa-house","pe-1","fs-6"],["class","fa fa-xmark-circle fa-lg position-absolute","style","text-shadow: 0 1px 0 #afafaf; right: 5px; top: 16px;",3,"click",4,"ngIf"],[1,"card-text","px-0","py-2",3,"click","ngSwitch"],[4,"ngSwitchCase"],[1,"fa","fa-xmark-circle","fa-lg","position-absolute",2,"text-shadow","0 1px 0 #afafaf","right","5px","top","16px",3,"click"],[1,"idle"],[1,"cashier"],["aria-hidden","true",1,"fa","fa-user","pe-2"],[1,"open"],["aria-hidden","true",1,"fa-regular","fa-clock","pe-2"]],template:function(t,i){t&1&&(a(0,"modal-material",0),b("onOk",function(){return i.onOk()})("onCancel",function(){return i.close()})("onClose",function(){return i.close()}),a(1,"content")(2,"div",1)(3,"div",2)(4,"span",3),_(5,"i",4),s(),a(6,"input",5),V("ngModelChange",function(r){return N(i.searchInput,r)||(i.searchInput=r),r}),s()()(),a(7,"div",6)(8,"div",7),f(9,zo,12,15,"div",8),y(10,"FilterByName"),s()()(),_(11,"footer"),s()),t&2&&(p("config",i.modalConfig),l(2),p("hidden",i.registers.length<=6),l(4),k("ngModel",i.searchInput),l(3),p("ngForOf",te(10,4,i.registers,i.searchInput)))},dependencies:[Fe,he,ae,In,xn,Oe,Ce,De,Z,pi,no],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.col-4[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{width:180px;min-height:95px;margin-right:17px;margin-bottom:17px;position:relative}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]{display:block;outline:0;border:1px solid #B1AAAA;border-radius:5px;cursor:pointer}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{height:30px;border-radius:4px;padding:5px 10px;color:#fff;background:#b1aaaa;overflow:hidden}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] h5[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]:hover, .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.active[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.vacant[_ngcontent-%COMP%]{background:#ffffe1;border:1px solid #89b03e}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]:hover > h5[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.active[_ngcontent-%COMP%] > h5[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.vacant[_ngcontent-%COMP%] > h5[_ngcontent-%COMP%]{background:#89b03e}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover{border:1px solid #c9302c}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover > h6[_ngcontent-%COMP%]{background:#c9302c!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#c9302c}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover{background:#fff}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]{border:1px solid #f6a828}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%]{background:#f6a828!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]:hover{border:1px solid #f6a828;background:#fff}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]:hover > strong[_ngcontent-%COMP%]{background:#f6a828!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#f6a828}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] div[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.75rem!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{height:80px;padding:15px 10px;position:relative}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-weight:400;font-size:.875rem;width:100%;margin-bottom:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{margin-top:-10px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-child{margin-bottom:0}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{text-align:center;position:absolute;bottom:0;right:0;width:auto;background-color:#b1aaaa;border-radius:3px;padding:2px 5px;color:#fff;display:none!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.idle[_ngcontent-%COMP%]{display:block;font-size:1.25rem;text-align:center}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{position:absolute;width:27px;height:28px;cursor:pointer;top:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:last-of-type{right:-5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:nth-last-of-type(2){right:15px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{bottom:20px;right:5px;position:absolute}.col-4[_ngcontent-%COMP%] .duration[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{border:1px solid!important;position:absolute;bottom:-3px;left:58px;background:#fff;border-radius:5px}"]})};var Yo=["inputCash"],Si=class n{constructor(e,t){this.dialogRef=e;this.data=t;this.generateModalTitle$.subscribe()}registerService=w(ee);loadPOSService=w($);register=this.registerService.Data;username=this.loadPOSService?.Data?.UserName;amount=re(0);config=new K;currentRegisterName;generateModalTitle$=this.registerService.Data$.pipe(oe(e=>h.IsNotEmpty(e)),se(()=>{let e=this.registerService.getOutletRegister(),t=e?.Name?.length>18?`${e?.Name?.substring(0,18)}...`:e?.Name;this.config.title="Open Shift",this.currentRegisterName=t}),ye());today=new Date;inputCashEl;ngOnInit(){this.config.customWidth="350px",this.config.hideCancel=!0}ngAfterViewInit(){this.inputCashEl?.nativeElement?.focus()}onOk(){this.dialogRef.close({amount:this.amount()})}static \u0275fac=function(t){return new(t||n)(S(Y),S(ce))};static \u0275cmp=R({type:n,selectors:[["POS-modal-opening-cash"]],viewQuery:function(t,i){if(t&1&&kt(Yo,5),t&2){let o;Vt(o=Ft())&&(i.inputCashEl=o.first)}},standalone:!1,decls:25,vars:8,consts:[["inputCash",""],[3,"onOk","onCancel","onClose","config"],[1,"table","fs-5","text"],[1,"py-3"],[1,"text-end","pe-3"],[1,"py-4"],[1,"text-end"],["data-cy","InputCash","autoNum","",1,"border","form-control-lg","text-end","w-100",3,"ngModelChange","ngModel"]],template:function(t,i){if(t&1){let o=I();a(0,"modal-material",1),b("onOk",function(){return C(o),v(i.onOk())})("onCancel",function(){return C(o),v(i.dialogRef.close())})("onClose",function(){return C(o),v(i.dialogRef.close())}),a(1,"content")(2,"table",2)(3,"tr")(4,"td",3),m(5,"Outlet Register"),s(),a(6,"td",4),m(7),s()(),a(8,"tr")(9,"td",5),m(10,"Current User"),s(),a(11,"td",4),m(12),s()(),a(13,"tr")(14,"td",5),m(15,"Starting Time"),s(),a(16,"td",4),m(17),y(18,"date"),s()(),a(19,"tr")(20,"td",3),m(21,"Starting Cash"),s(),a(22,"td",6)(23,"input",7,0),V("ngModelChange",function(c){return C(o),N(i.amount,c)||(i.amount=c),v(c)}),s()()()()()()}t&2&&(p("config",i.config),l(7),D(i.currentRegisterName),l(5),D(i.username),l(5),D(te(18,5,i.today,"EEEE, HH:mm")),l(6),k("ngModel",i.amount))},dependencies:[Oe,Ce,De,Z,bt,Xe],styles:[".table-title-width[_ngcontent-%COMP%]{width:120px}"]})};var Pi=class{OrderNumberElement;InvoiceNumberElement;NewOrderID};var Dt=class n{constructor(e,t,i){this._httpService=e;this._onlineStatusService=t;this._localDataService=i;this._onlineStatusService.getOnlineStatus$().subscribe(o=>{this.isOnline=o})}isOnline;GenerateNumber(e,t){if(this.isOnline)return this._httpService.get(Q.GenerateNumber,[{key:"EntityID",value:e},{key:"TypeID",value:1}]);{let i=new Pi;return h.IsNotEmpty(t.NumberElement)&&(t.NumberElement.Seed+=1),h.IsNotEmpty(t.InvoiceNumberElement)&&(t.InvoiceNumberElement.Seed+=1),i.InvoiceNumberElement=t.InvoiceNumberElement,i.OrderNumberElement=t.NumberElement,i.NewOrderID=h.Guid_NewGuid(),Re(i)}}findRegisterById(e){return new Promise(t=>{this._localDataService.isConfigFromServer().subscribe(i=>{i?this._httpService.get(Q.GetRegisterInfo,[{key:"RegisterID",value:e}]).subscribe(o=>{t(o)}):this._localDataService.findRegisterByID(e).subscribe(o=>{t(o)})})})}recordOpeningCash(e){return console.log(e,"recordOpeningCash"),Kt(this._httpService.post("/API/POS/RecordOpeningCash",e))}static \u0275fac=function(t){return new(t||n)(g(Me),g(me),g(ve))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var ee=class n{constructor(e,t,i,o,r,c){this._signalRClientService=e;this._matDialog=t;this._posHttpResponseService=i;this._CoreHttpService=o;this._toastrService=r;this._roleService=c}_Data=new fe(null);Data$=this._Data.asObservable().pipe(oe(e=>e!==null),ke());get Data(){return this._Data.value}getSalesname(e){return this.Data&&this.Data.ListSales?this._Data.value.ListSales.find(t=>t.ID==e)?.Name:""}setActiveRegisterFromOptions(e,t){let o=this._posHttpResponseService.Data.AppConfigJSON.ModuleShift.Closure.Enabled;if(e.length>1){let r=e.find(c=>c.LoginID==t);if(r)this.pushNewRegister(r);else{let c=this.getOutletRegisterFromLocalStorage(),u=this.Data?.RegisterID?this.Data.RegisterID:c?.ID;h.IsEmpty(u)?this.openChooseRegisterModal():o?this.openChooseRegisterModal():this.initRegisterFromLocalStorage()}}e.length==1&&(this.pushNewRegister(e[0]),h.IsEmpty(e[0].LoginID)&&h.IsEmpty(e[0].CashierID)&&this.openOpeningCashModal(e[0].ID)),e.length==0&&this._toastrService.warning("You do not have access to any OUTLET","Warning")}openChooseRegisterModal(){this._matDialog.open(bi,{id:"registerModal",disableClose:!0}).afterClosed().pipe(oe(e=>h.IsNotEmpty(e?.selectedRegister))).subscribe(e=>{e.selectedRegister&&this.openOpeningCashModal(e.selectedRegister.ID)})}openOpeningCashModal(e){this._posHttpResponseService.Data.AppConfigJSON.ModuleShift.Closure.Enabled&&this._matDialog.open(Si,{disableClose:!0}).afterClosed().pipe(oe(o=>h.IsNotEmpty(o))).subscribe(o=>{let r={RegisterID:e,OpAmount:o.amount};this._CoreHttpService.recordOpeningCash(r)})}initRegisterFromLocalStorage(){if(this._roleService.Data.DeleteItem==!1){let t=this.getOutletRegisterFromLocalStorage();t&&this.pushNewRegister(t)}}pushNewRegister(e){let t=this._Data.value,i=t?t.RegisterID:null;i!=e.ID&&this._CoreHttpService.findRegisterById(e.ID).then(o=>{o.RegisterCode=e.Code,o.DefaultPrintTemplate=o.PrintTemplate,this._signalRClientService.SubscribeGroup(o.RegisterID,i),this.saveOutletRegisterToLocalStorage(e),this.pushNewValue(o)})}getOutletRegister(){let e=this.Data.RegisterID;return this._posHttpResponseService.Data.Registers.find(o=>o.ID==e)}pushNewValue(e){this._Data.next(e)}saveOutletRegisterToLocalStorage(e){if(this._roleService.Data.DeleteItem==!1){let i=JSON.stringify(e);localStorage.setItem("outlet_register",i)}}getOutletRegisterFromLocalStorage(){let e=this._roleService.Data.DeleteItem,t=localStorage.getItem("outlet_register"),i=null;return t&&(e?localStorage.removeItem("outlet_register"):i=JSON.parse(t)),i}findOutletRegisterById(e){return this._posHttpResponseService.Data.Registers.find(o=>o.ID===e)}static \u0275fac=function(t){return new(t||n)(g(et),g(Ie),g($),g(Dt),g(H),g(_e))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var Oi=class{RegisterID;Number;Amount;TransactionID};var Mt=class{GroupID;Method;Data};var Di=class{Status;InvoiceID;LoyaltyPoint;diff};var Mi=class{GopayQr};var qt=(r=>(r[r.cash=1]="cash",r[r.card=2]="card",r[r.emoney=3]="emoney",r[r.other=4]="other",r[r.ECR=99]="ECR",r))(qt||{});var L=class n{constructor(e,t,i){this._OrderHttpService=e;this._customerHttpService=t;this._toastrService=i}_Data=new fe(new G);transaction_id;Data$=this._Data.asObservable();get Data(){return this._Data.value}pushNewValue(e){if(e)this._Data.next(e);else{let t=this.Data;this._Data.next(t)}}submitOrder(e){return new Promise((t,i)=>{this.checkTransactionId(),this._OrderHttpService.submitOrder(this.Data,e).subscribe({next:o=>{t(o)},error:o=>{this.Data.Items=[],i(o)}})})}uploadOfflineOrder(){return this.checkTransactionId(),this._OrderHttpService.uploadOfflineOrder(this.Data)}checkTransactionId(){let t=this.Data.Payments.find(i=>i.TypeID==3);h.IsNotEmpty(t)&&h.IsEmpty(this.transaction_id)&&this._toastrService.warning("Midtrans transaction_id is empty. Please verify manually!","Mobile Payment Failure")}updateCustomerID(e){return this.Data.Order.CustomerID=e,this.pushNewValue(this.Data),new Promise((t,i)=>{this._customerHttpService.GetPrivilegeByID(e,this.Data.Order.EntityID).subscribe({next:o=>{this._customerHttpService.Data=o,this.pushNewValue(this.Data),t(o)},error:o=>{this.Data.Order.CustomerID=null,this.Data.ContactName=null;let r=o.error?.Message;o.status==409?this._toastrService.warning(r,"Warning"):this._toastrService.error(r,`API Error - ${o.status}`),i(o)}})})}static \u0275fac=function(t){return new(t||n)(g(Ot),g(Te),g(H))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ii=class{Name;Quantity;Discount;DiscountAmount;Price;UnitQuantity};var xi=class{Items;AmountSummary;GopayQr;Number;Customer;SalesName;CurrencySymbol;FinalAmount};var Ti=class n{_state=re(this.initCustomerDisplayState());isEnabled=Ge(()=>this._state()?.enabled);connect(){let t={enabled:!0,timestamp:new Date().toDateString()};localStorage.setItem("customerDisplay",JSON.stringify(t)),this._state.set(t)}initCustomerDisplayState(){let e=localStorage.getItem("customerDisplay"),t={enabled:!1,timestamp:""};return h.IsNotEmpty(e)&&(t=JSON.parse(e)),t}disconnect(){let t={enabled:!1,timestamp:new Date().toDateString()};localStorage.setItem("customerDisplay",JSON.stringify(t)),this._state.set(t)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var ue=class{Amount;CurrencySymbol;Label;Type;constructor(e,t,i,o){this.Amount=e,this.CurrencySymbol=t,this.Label=i,this.Type=o}};var ot=class{ModuleSell;ApplicationLoyalty;ApplicationMath;CoreDefaults;ModuleDelivery;ApplicationParkAndRetrieve;ApplicationRegisterClosure;PaymentConfigGopay;PaymentConfigLink;PrintConfigInvoice;CorePrint;PaymentConfigEmpatKali;ApplicationSettings;PrintConfigGeneral;ModuleProducts;ModuleContact;ApplicationTransactionNumbering;ModuleOrders;ModuleShift;ModuleBuy;ModuleAdjustment;TadaCouponVisible;CouponRedemptionType;ProviderOption};var ie=class n{constructor(e,t,i,o){this._orderDataService=e;this._posService=t;this.POSMATH=i;this.decimalPipe=o;this._orderDataService.Data$.pipe(z(r=>this._posService.Data$.pipe(q(c=>({appConfig:c.AppConfigJSON,salesOrder:r}))))).subscribe(r=>{this.salesOrderData=r.salesOrder,this.appConfigJSON=r.appConfig,this.calculateDiscountAmount(),this.pushNewValue(this.grandTotal)})}_Data=new fe(0);Data$=this._Data.asObservable().pipe(ke());tax=new uo;discountAfterTax=0;currencySymbol="Rp";get Data(){return this._Data.value}salesOrderData=new G;appConfigJSON=new ot;pushNewValue(e){this._Data.next(e)}get grandTotal(){let e=this.TotalAfterSurcharge;return isNaN(e)?0:e}setDecimalDigit(e){let t=this.decimalPipe.transform(e,"1.0-4");return e=parseFloat(t.split(",").join("")),e}get TotalAfterTax(){let e=this.TaxAmount,t=this.TotalBeforeTax+e;return t=this.POSMATH.Round(t,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm),t}get TotalBeforeTax(){let e=this.tax?.CalculationTypeID===1,t=0;return e?t=this.DiscountTotal-this.TaxAmount:t=this.DiscountTotal,t}get TotalAfterSurcharge(){let e=this.TotalAfterTax+this.SurchargeAmount;return this.POSMATH.Round(e,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm)}get TotalAfterDiscountTaxable(){return this.GrossTotalTaxable-this.DiscountTotal}get TaxAmount(){if(this.tax!=null){let e=0,t=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.DecimalPlaceValue,i=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.RoundAlgorithm,o=this.GrossTotalTaxable;return this.tax.CalculationTypeID==1?e=this.tax.Rate/(100+this.tax.Rate)*o:e=this.tax.Rate/100*o,e=this.POSMATH.Round(e,t,i),e}else return 0}get SurchargeAmount(){return this.TotalAfterTax*this.salesOrderData.Invoice.SurchargePcg/100}get Discount1Amount(){return this.GrossTotal*this.salesOrderData.Order.Discount/100}get AfterDiscount1Amount(){return this.GrossTotal-this.Discount1Amount}get Discount2Amount(){return this.AfterDiscount1Amount*this.salesOrderData.Order.Discount2/100}get AfterDiscount2Amount(){return this.AfterDiscount1Amount-this.Discount2Amount}get DiscountTotal(){return this.AfterDiscount2Amount-this.salesOrderData.Order.DiscountAmount}calculateDiscountAmount(){let e=this.salesOrderData.Order.DiscountAmount,t=0;this.AfterDiscount2Amount>=0&&e>0&&e>this.AfterDiscount2Amount&&(t=this.AfterDiscount2Amount),t!==0&&t<=e&&this.GrossTotal!==0&&(e=t),this.salesOrderData.Order.DiscountAmount=e}get GrossTotal(){return this.sum(this.salesOrderData.CartItems,"Total")}get GrossTotalTaxable(){let e=this.salesOrderData.CartItems.filter(i=>i.Taxable),t=this.sum(e,"Total");if(e.length!==0){let i=this.calculateDiscountTaxableItem(e);t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t=t-i}return t}calculateDiscountTaxableItem(e){let t=this.GrossTotal,i=this.salesOrderData.Order.DiscountAmount,o=0,r=0,c=0,u=0;for(let O of e)o=O.getItemAfterDiscount/t,r=o*i,u=r*O.Quantity,c+=u;return c}get GrossTotalNonTaxable(){let e=this.salesOrderData.CartItems.filter(i=>i.Taxable==!1),t=this.sum(e,"Total");return t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t=t-this.salesOrderData.Order.DiscountAmount,t}sum(e,t){let i=e.reduce((o,r)=>o+r[t],0);return i=this.setDecimalDigit(i),i}GetPointOnlyAmount(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID==2);return this.GetAmountByCart(e)}GetCashOnlyAmount(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID==1);return this.GetAmountByCart(e)}GetCashAndPointAmountCart(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID!=1);return this.GetAmountByCart(e)}GetAmountByCart(e){let t=this.sum(e,"Total");return t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t}calculateGrossTotal(e){return this.sum(e,"Total")}static \u0275fac=function(t){return new(t||n)(g(L),g($),g(go),g(J))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ei=class n{constructor(e,t,i,o){this._invoiceCalculatorService=e;this._decimalPipe=t;this._poshttpResponseService=i;this._orderService=o;this._poshttpResponseService.Data$.pipe(ye()).subscribe(r=>{this.appConfig=r.AppConfigJSON})}appConfig=new ot;generateAmountSummary(){let e=[];this.isUseTax()?e=this.generateSummaryTax():e=this.generateSummaryNonTax();let t=this.generateSurchargeSummary();return t&&e.push(...t),e}generateSummaryTax(){let e=this._invoiceCalculatorService.tax?.CalculationTypeID,t=[];return e==1?t=this.generateSummaryTaxInclude():t=this.generateSummaryTaxExclude(),t}generateSummaryNonTax(){let e=[],t=this.generateCartItemAmount();if(e.push(t),this.isDiscounted()){let i=this.generateDiscountSummary(),o=this.generateAmountTotal("Total");e.push(...i,o)}return e}generateSummaryTaxInclude(){let e=[];return this.isTaxReserveSequence()?e=this.generateTaxIncludeReserveSequence():e=this.generateTaxIncludeNormalSequence(),e}generateTaxIncludeReserveSequence(){let e=[];if(this.isTaxDetailVisible()==!1){let r=this._invoiceCalculatorService.TotalBeforeTax,c=this.isDiscounted()?"Amount":"Before Tax",u=this.isDiscounted()?this._invoiceCalculatorService.GrossTotal:r,O=new ue(u,this.currencySymbol,c,2);e.push(O)}if(this.isDiscounted()){let r=this.generateDiscountSummary(),c=this.generateBeforeTaxSummary();e.push(...r,c)}let i=this.generateTax(),o=this.generateAmountTotal();return e.push(...i,o),e}generateTaxIncludeNormalSequence(){let e=[],t=this.generateCartItemAmount();if(e.push(t),this.isDiscounted()){let o=this.generateDiscountSummary(),r=this.generateSummarySubTotal();e.push(...o,r)}let i=this.generateTax();if(e.push(...i),this.isTaxDetailVisible()==!1){let o=this.generateBeforeTaxSummary();e.push(o)}return e}generateSummaryTaxExclude(){let e=[],t=this.generateCartItemAmount(!0);if(e.push(t),this.isDiscounted()){let c=this.generateDiscountSummary(),u=this.generateSummarySubTotal();e.push(...c,u)}let i=this.generateTax(),o=this._invoiceCalculatorService.TotalAfterTax,r=new ue(o,this.currencySymbol,"Total",1);return e.push(...i,r),e}generateAmountTotal(e="Total Amount"){let t=this._invoiceCalculatorService.Data;return new ue(t,this.currencySymbol,e,1)}generateSummarySubTotal(){let e=this._invoiceCalculatorService.TotalAfterTax;return new ue(e,this.currencySymbol,"SubTotal",1)}generateBeforeTaxSummary(){let e=this._invoiceCalculatorService.TotalBeforeTax;return new ue(e,this.currencySymbol,"Before Tax",2)}isTaxDetailVisible(){return this.appConfig.PrintConfigInvoice?.Footer?.TaxDetailVisible}isUseTax(){let e=this._invoiceCalculatorService.tax;return e?.PrintVisible&&e?.Rate!=0}generateTax(){let e=[],t=this.isTaxDetailVisible(),i=t?2:1,o=this._invoiceCalculatorService.tax;if(t){let r=this.appConfig.PrintConfigInvoice.Footer.TaxableSales,c=this.calculateTaxableSales(),u=new ue(c,this.currencySymbol,r,i);e.push(u)}if(o.TypeID==2){let r=this.generateTaxTypeMultiple();e.push(...r)}else{let r=this.generateSingleTaxSummary(o.Label,this._invoiceCalculatorService.TaxAmount,i);e.push(r)}if(t){let r=this.appConfig.PrintConfigInvoice.Footer.TaxExemptSales,c=this._invoiceCalculatorService.GrossTotalNonTaxable,u=new ue(c,this.currencySymbol,r,i);e.push(u);let O=this.appConfig.PrintConfigInvoice.Footer.LabelWithZeroAmount;if(O){let A=new ue(0,this.currencySymbol,O,i);e.push(A)}}return e}generateCartItemAmount(e=!1){let t=this.isDiscounted()||e?this._invoiceCalculatorService.GrossTotal:this._invoiceCalculatorService.TotalAfterTax;return new ue(t,this.currencySymbol,"Amount",1)}get currencySymbol(){return this._invoiceCalculatorService.currencySymbol}generateDiscountSummary(){let e=[];if(this._invoiceCalculatorService.Discount1Amount!=0){let t=this._decimalPipe.transform(this._orderService.Data.Order.Discount),o=this.checkDiscountIgnoreDecimal(t)?"{0}":"{0} ({1}%)";e.push(new ue(this._invoiceCalculatorService.Discount1Amount*-1,this._invoiceCalculatorService.currencySymbol,h.StringFormat(o,this.appConfig.CorePrint.Alias.Discount1,t),1))}if(this._invoiceCalculatorService.Discount2Amount!=0){let t=this._decimalPipe.transform(this._orderService.Data.Order.Discount2),o=this.checkDiscountIgnoreDecimal(t)?"{0}":"{0} ({1}%)";e.push(new ue(this._invoiceCalculatorService.Discount2Amount*-1,this._invoiceCalculatorService.currencySymbol,h.StringFormat(o,this.appConfig.CorePrint.Alias.Discount2,t),1))}return this._orderService.Data.Order.DiscountAmount!=0&&this.appConfig.PrintConfigInvoice.ItemsFooter.DiscountAmountVisible&&e.push(new ue(this._orderService.Data.Order.DiscountAmount*-1,this._invoiceCalculatorService.currencySymbol,"Discount ("+this._invoiceCalculatorService.currencySymbol+")",1)),e}calculateTaxableSales(){let e=this._invoiceCalculatorService.tax,t=this._invoiceCalculatorService.TaxAmount,i=this._invoiceCalculatorService.GrossTotalTaxable;return e.Rate==0?0:e.CalculationTypeID==1?i-t:i}generateTaxTypeMultiple(){let e=this.appConfig.PrintConfigInvoice.Footer.TaxDetailVisible?2:1,t=[],i=this._invoiceCalculatorService.tax;var o=this._invoiceCalculatorService.TaxAmount;if(i.TypeID==2){let r=i?.Components?i?.Components:[],c=this._invoiceCalculatorService.GrossTotalTaxable,u=this.calculateTotalRate(r);r.forEach(O=>{if(i.CalculationTypeID==0){let A=O.Rate/100*c;t=[...t,this.generateSingleTaxSummary(O.Label,A,e)],i.MultipleTaxTypeID==1&&(c+=A)}else{let A=O.Rate/u*o;t=[...t,this.generateSingleTaxSummary(O.Label,A,e)]}})}else t=[...t,this.generateSingleTaxSummary(i.Label,o,e)];return t}calculateTotalRate(e){let t=0;return e&&e.length>0&&(t=e.map(i=>i.Rate).reduce((i,o)=>i+o)),t}generateSingleTaxSummary(e,t,i){let o=this._invoiceCalculatorService.currencySymbol;return new ue(t,o,e,i)}generateSurchargeSummary(){if(this._invoiceCalculatorService.SurchargeAmount==0)return;let e=[],t=this.appConfig.CorePrint,i=t&&t.Alias.SurchargePcg?t.Alias.SurchargePcg:"Surcharge";e.push(new ue(this._invoiceCalculatorService.SurchargeAmount,this._invoiceCalculatorService.currencySymbol,h.StringFormat("{0} ({1}%)",i,this._decimalPipe.transform(this._orderService.Data?.Invoice.SurchargePcg)),1));let o=this.generateAmountTotal();return e.push(o),e}checkDiscountIgnoreDecimal(e){let i=this.appConfig.PrintConfigInvoice.Footer.DiscountIgnoredDecimal,o=parseFloat(e)%1,r=!1;return o!==0&&i&&(r=!0),r}isDiscounted(){let e=this._invoiceCalculatorService.Discount1Amount,t=this._invoiceCalculatorService.Discount2Amount,i=this._orderService.Data.Order.DiscountAmount,o=!1;return(e!=0||t!=0||i!=0)&&(o=!0),o}isTaxReserveSequence(){let e=this._invoiceCalculatorService.tax,t=!!e,i=t?e.CalculationTypeID:null,o=this.appConfig.PrintConfigInvoice.ItemsFooter.TaxIncludeBeforeTotalAmount;return t&&i===1&&o}static \u0275fac=function(t){return new(t||n)(g(ie),g(J),g($),g(L))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var rt=class n{constructor(e,t,i,o){this._receiptCalculatorService=e;this._cashierCalculatorService=t;this._signal=i;this._customerHttpService=o;this.broadcastOrderUpdate$.subscribe()}_salesOrderDataModelService=w(L);_outletService=w(ee);displayService=w(Ti);localdata=w(ve);orderDataModel;broadcastOrderUpdate$=Ue([this._salesOrderDataModelService.Data$,this.localdata.isStoreOrderInServer(),$n(this.displayService.isEnabled)]).pipe(Sn(([e,t,i])=>{let o=this._outletService?.Data?.RegisterID;if(t&&i&&o){this.orderDataModel=e;let r=this.ConstructCartModelForCustomerDisplay(),c=new Mt;return c.GroupID=o+"_Subscriber",c.Method="POSCartAmountUpdated",c.Data=r,this._signal.broadcast(c).pipe(Ze(u=>(console.log(u),mt)))}else return mt}),Ze(e=>(console.log(e),mt)),ye());ConstructCartModelForCustomerDisplay(){let e=this._customerHttpService.Data,t=new xi;t.Number=this.orderDataModel.Order.Number,t.Items=Array();for(let i of this.orderDataModel.CartItems){let o=new Ii;o.Name=i.Variant.Name,o.Discount=i.Discount,o.DiscountAmount=i.DiscountAmount,o.Price=i.Price,o.Quantity=i.Quantity,o.UnitQuantity=i.UnitQuantity,t.Items.push(o)}return h.IsNotEmpty(this.orderDataModel.Order.SalesID)?t.SalesName=this._outletService.getSalesname(this.orderDataModel.Order.SalesID):t.SalesName="",h.IsNotEmpty(this.orderDataModel.Order.CustomerID)&&h.IsNotEmpty(e)&&(t.Customer=new Pt,t.Customer.Email=e.Email,t.Customer.Mobile=e.Mobile,t.Customer.Name=this.orderDataModel.ContactName),t.CurrencySymbol=this._cashierCalculatorService.currencySymbol,t.FinalAmount=this._cashierCalculatorService.Data,t.AmountSummary=this._receiptCalculatorService.generateAmountSummary(),t}BroadcastStateToCustomerDisplay(e,t="",i="",o=0){let r=new Di;r.Status=e,r.InvoiceID=t,r.LoyaltyPoint=i,r.diff=o;let c=new Mt;return c.GroupID=this._outletService.Data.RegisterID+"_Subscriber",c.Method="POSStateUpdated",c.Data=r,this.displayService.isEnabled()?this.localdata.isStoreOrderInServer().pipe(z(u=>u?this._signal.broadcast(c):Re(X.offlineMode))):mt}BroadcastQRToCustomerDisplay(e){let t=new Mi;t.GopayQr=e;let i=new Mt;return i.GroupID=this._outletService.Data.RegisterID+"_Subscriber",i.Method="POSQRPaymentActivated",i.Data=t,this.displayService.isEnabled()?this.localdata.isStoreOrderInServer().pipe(z(o=>o?this._signal.broadcast(i):Re(X.offlineMode))):mt}static \u0275fac=function(t){return new(t||n)(g(Ei),g(ie),g(et),g(Te))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var wi=class n{constructor(e){this.httpService=e}VerifyPayment(e,t){let i=this.getVerifyPaymentUrl(t);return this.httpService.post(i,e)}getVerifyPaymentUrl(e){let t;switch(e){case 0:t=Q.GopayVerifyPayment;break;case 1:t=Q.BcaVerifyPayment;break}return t}generateLink(e){return this.httpService.post(Q.GenerateLink,e)}generateQRCode(e,t){return this.httpService.post(e,t)}static \u0275fac=function(t){return new(t||n)(g(Me))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var It=class n{constructor(e,t,i,o,r){this._posHubService=e;this._orderDataService=t;this._PaymentHttpService=i;this._InvoicecashierCalculatorService=o;this._toastrService=r}transactionId;qrPaymentMethodID;QRCodeHttpResponse;_paymentMethod;get paymentMethod(){return this._paymentMethod}resetPaymentMethod(){this._paymentMethod=null}onQRPaymentComplete(e,t){return new Promise((i,o)=>{if(e.transaction_id!==this.transactionId){let c=`transaction_id: ${e.transaction_id} / gross_amount: ${e.gross_amount}`;o({header:"Invalid QR Payment",message:c});return}if(e.gross_amount!==this._InvoicecashierCalculatorService.Data){let c=`paid_amount: ${e.gross_amount} vs invoice_amount: ${this._InvoicecashierCalculatorService.Data}`;o({header:"Invalid QR Payment",message:c});return}let r=this._orderDataService.Data.Order.Number;if(e.order_id.includes(r)==!1){let c=`Order ID: ${e.order_id} vs Order Number: ${r}`;o({header:"Invalid QR Payment",message:c});return}if(e.transaction_status!=="settlement"){let c=`Transaction status is ${e.transaction_status}`;o({header:"Invalid QR Payment",message:c});return}this.validateEMoneyPayment(t).subscribe(c=>{i(c)})})}generateNewPayment(e,t){let i=this._orderDataService.Data;h.IsEmpty(this.qrPaymentMethodID)&&alert("QR PaymentMethod.ID is not available!");let o=new $e;return o.PaidAmount=t,o.Amount=t,o.Date=i.Order.Date,o.MethodID=this.qrPaymentMethodID,o.Code=e,h.IsEmpty(e)&&this._toastrService.warning("Midtrans transaction_id is empty. Please verify manually!","Mobile Payment Failure"),o}sendStateCompleteToCustomerDisplay(e){this._posHubService.BroadcastStateToCustomerDisplay(1,e.ObjectID,e.LoyaltyPoint,0).subscribe()}generateQR(e,t){this._paymentMethod=t,this.qrPaymentMethodID=t.ID;let i=this.getServiceUrl(t.EMoneyTypeID);return this._PaymentHttpService.generateQRCode(i,e).pipe(q(c=>(c=this.manipulateBCAQrisImg(c,t.EMoneyTypeID),this.transactionId=c.Transaction_id,this.QRCodeHttpResponse=c,this._orderDataService.transaction_id=c.Transaction_id,this.sendQRToCustomerDisplay(c.Url),c)))}sendQRToCustomerDisplay(e){this._posHubService.BroadcastQRToCustomerDisplay(e).subscribe()}validateEMoneyPayment(e){if(h.IsNotEmpty(this.transactionId)){let t=this._InvoicecashierCalculatorService.Data,i=this._paymentMethod?.EMoneyTypeID,o=this.generatePaymentVerificationData(t,i);return this._PaymentHttpService.VerifyPayment(o,i).pipe(z(r=>(this.updatePosDataForSubmission(t),bn(this._orderDataService.submitOrder(e)).pipe(se(c=>{this.sendStateCompleteToCustomerDisplay(c)})))))}else{let t=new Error("Transaction ID is Empty");throw pt(()=>t)}}generatePaymentVerificationData(e,t){let i=this._orderDataService.Data,o=new Oi;return o.Number=i.Order.Number,o.Amount=e,o.TransactionID=this.transactionId,o.RegisterID=i.Order.RegisterID,t==1&&(o.Number=this.QRCodeHttpResponse.Number),o}updatePosDataForSubmission(e){let t=this._orderDataService.Data,i=this.generateNewPayment(this.transactionId,e),o=[];o.push(i),t.Invoice.Due=null,t.Action.Type=3,t.Order.InvoicedStateID=3,t.Payments=o,this._orderDataService.pushNewValue(t)}getServiceUrl(e){let t;switch(e){case 0:t=Q.GenerateGopayQrCode;break;case 1:t=Q.GenerateBcaQrCode;break}return t}manipulateBCAQrisImg(e,t){return t==1&&(e.Url=`data:image/png;base64, ${e.Url}`),e}clearTransactionID(){this.transactionId=null,this._orderDataService.transaction_id=null,this.QRCodeHttpResponse=null}getTransactionId(){return this.transactionId}static \u0275fac=function(t){return new(t||n)(g(rt),g(L),g(wi),g(ie),g(H))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var xt=class{CommissionID;ReturNumber;parkTemporaryItem;posState;InputTextValue;constructor(){this.posState=0,this.CommissionID="",this.ReturNumber="",this.parkTemporaryItem=[],this.InputTextValue=""}};var Ri=class n{constructor(e,t,i){this._promotionEventService=e;this._dialogRef=t;this.data=i;this.modalConfig=new K,this.modalConfig.hideCancel=!0,this.modalConfig.hideClose=!0,this.modalConfig.headerType=ne.Warning,this.modalConfig.title="Promotion Requirement unfulfilled!",this.modalConfig.customWidth="350px",this.modalConfig.okText="Ok",this.selectedPromotion=e.selectedPromotion}modalConfig;selectedPromotion;onOk(){this._promotionEventService.restoreOrder(),this._dialogRef.close()}static \u0275fac=function(t){return new(t||n)(S(we),S(Y),S(ce))};static \u0275cmp=R({type:n,selectors:[["POS-modal-promotion-confirm"]],standalone:!1,decls:9,vars:4,consts:[[3,"onOk","config"],[1,"fst-italic","text-danger","mb-3"],[1,"mb-0"]],template:function(t,i){t&1&&(a(0,"modal-material",0),b("onOk",function(){return i.onOk()}),a(1,"content")(2,"div")(3,"h5"),m(4),s(),a(5,"p",1),m(6),s(),a(7,"p",2),m(8),s()()()()),t&2&&(p("config",i.modalConfig),l(4),D(i.selectedPromotion==null?null:i.selectedPromotion.Name),l(2),D(i.selectedPromotion==null?null:i.selectedPromotion.Description),l(2),D(i.data==null?null:i.data.message))},dependencies:[Z],encapsulation:2})};var Ni=class extends be{};function ir(n,e){if(n&1&&(a(0,"span",8),m(1),y(2,"number"),s()),n&2){let t=d(2);l(),P("-",M(2,1,t.coupon.Amount),"%")}}function nr(n,e){if(n&1&&(a(0,"span",8),m(1),y(2,"number"),s()),n&2){let t=d(2);l(),P(" -",M(2,1,t.coupon.Amount)," ")}}function or(n,e){if(n&1){let t=I();a(0,"button",12),b("click",function(){C(t);let o=d().$implicit,r=d();return v(r.onRemoveCouponDiscount(o))}),m(1," Remove "),s()}}function rr(n,e){if(n&1){let t=I();a(0,"button",13),b("click",function(){C(t);let o=d().$implicit,r=d();return v(r.onApplyCouponDiscount(o))}),m(1," Apply "),s()}if(n&2){let t=d(2);p("disabled",t.hasAppliedCouponDiscount())}}function ar(n,e){if(n&1&&(a(0,"tr")(1,"td"),m(2),s(),a(3,"td"),m(4),s(),a(5,"td",7),m(6),y(7,"number"),s(),a(8,"td",7),f(9,ir,3,3,"span",8)(10,nr,3,3,"span",8),s(),a(11,"td",9),f(12,or,2,0,"button",10)(13,rr,2,1,"button",11),s()()),n&2){let t=e.$implicit,i=d();l(2),D(t==null||t.Variant==null?null:t.Variant.Name),l(2),D(t==null||t.Variant==null?null:t.Variant.Code),l(2),D(M(7,5,t.UnitPrice)),l(3),E((i.coupon==null||i.coupon.Requirement==null?null:i.coupon.Requirement.Type)==i.couponType.DiscountPercentage?9:10),l(3),E((t==null?null:t.CouponDiscount)>0?12:13)}}var Ai=class n{constructor(e){this.data=e;this.coupon=this.data.coupon,this.initModalConfig(),this.initEligibleItems()}dialogRef=w(Y);config;eligibleItems=re([]);coupon;couponType=fi;hasAppliedCouponDiscount=re(!1);initModalConfig(){this.config=new K,this.config.title="Choose Item to Apply Discount",this.config.hideFooter=!0}initEligibleItems(){let e=this.data.coupon?.ApplyToProduct.map(t=>t.ID);e&&(this.eligibleItems.update(()=>this.data.cartItems.filter(i=>e.includes(i.VariantID))),this.hasAppliedCouponDiscount.update(()=>this.eligibleItems().some(t=>t.CouponDiscount>0)))}onApplyCouponDiscount(e){let t=[e];this.hasAppliedCouponDiscount.update(()=>!0),this.dialogRef.close(t)}onRemoveCouponDiscount(e){this.eligibleItems.update(t=>{let i=t.findIndex(o=>o.VariantID===e.VariantID);return i>-1&&(t[i].Discount=0,t[i].CouponDiscount=0),t}),this.hasAppliedCouponDiscount.update(()=>!1)}onClose(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(S(ce))};static \u0275cmp=R({type:n,selectors:[["app-modal-coupon-selected-item"]],decls:20,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container"],[1,"row"],[1,"col-12"],[1,"table","table-bordered"],[1,"thead-light"],["scope","col"],[1,"text-end"],[1,"text-danger"],[1,"text-center"],[1,"btn","btn-sm","btn-danger"],[1,"btn","btn-sm","btn-success",3,"disabled"],[1,"btn","btn-sm","btn-danger",3,"click"],[1,"btn","btn-sm","btn-success",3,"click","disabled"]],template:function(t,i){t&1&&(a(0,"modal-material",0),b("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),a(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"table",4)(6,"thead",5)(7,"tr")(8,"th",6),m(9,"Name"),s(),a(10,"th",6),m(11,"Code"),s(),a(12,"th",6),m(13,"Price"),s(),a(14,"th",6),m(15,"Discount"),s(),_(16,"th",6),s()(),a(17,"tbody"),ft(18,ar,14,7,"tr",null,gt),s()()()()()()()),t&2&&(p("config",i.config),l(18),ht(i.eligibleItems()))},dependencies:[le,J,yt,Z],encapsulation:2})};var ki=class{Code;Provider;EntityID;Customer;ShoppingCart};var Vi=class n{salesOrderService=w(L);registerService=w(ee);customerService=w(Te);orderCalculator=w(ie);generateRedeemCouponDto(e,t){let i=new ki,o=this.registerService.Data?.EntityID;return i.Code=e,i.Provider=t,i.ShoppingCart={Amount:this.orderCalculator.Data,Items:this.generateItems()},i.EntityID=o,i.Customer=this.generateCustomer(t),i}generateItems(){return this.salesOrderService.Data.CartItems.map(i=>({Price:i.Price,Quantity:i.Quantity,VariantID:i.VariantID,Code:i?.Variant?.Code}))}generateCustomer(e){let t=this.customerService.Data,i=this.salesOrderService?.Data?.Order?.CustomerID,o=null;return h.IsNotEmpty(i)&&(o={Phone:t.Mobile,Email:t.Email},e==="Internal"&&(o=zt({ID:i},o))),o}static \u0275fac=function(t){return new(t||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var Et=class n{constructor(e,t,i,o,r,c){this._httpService=e;this._orderDataService=t;this._userRoleService=i;this.toastr=o;this._invoiceCalculatorService=r;this.promotionCouponFactoryService=c;this.subscribeToObservable()}dialog=w(Ie);role;originalRoleData;_coupon;get coupon(){return this._coupon}subscribeToObservable(){this._userRoleService.Data$.subscribe(e=>{this.role=e,h.IsEmpty(this.originalRoleData)&&(this.originalRoleData=xe(it,e))})}RedeemCoupon(e,t,i=!0){let o=this.promotionCouponFactoryService.generateRedeemCouponDto(e,"Internal");this._httpService.post(Q.ValidateInternalCoupon,o).subscribe({next:r=>{switch(this._orderDataService.Data.Order.PromotionCoupon=e,this._orderDataService.Data.Order.PromotionNote=t,this._orderDataService.Data.Order.CouponType=1,r.Requirement?.Type){case 1:this.HandleDiscountPercentage(r,i);break;case 2:this.HandleDiscountAmount(r);break;case 3:this.HandleReturn();break;case 4:this.HandleParkedDeletion();break;case 5:this.HandleFullAccess(),i&&this.toastr.success("You now have Full Access for this Order!","Coupon Applied");break}this._coupon=r},error:r=>{this.resetAppliedCoupon(),this.removeAppliedCoupon(!1)}})}resetAppliedCoupon(){if(h.IsNotEmpty(this.coupon)){let e=this.coupon?.Requirement?.EmptyCartOnApplyCoupon;switch(this.coupon.Requirement?.Type){case 2:this.HandleDiscountAmount(this.coupon,!0),this.removeAppliedCoupon();break;case 1:this.HandleDiscountPercentage(this.coupon,!1,!0),this.removeAppliedCoupon();break;case 5:e?this.handleConfigEmptyItemsOnRemoveCoupon():this.resetRoleAfterAppliedCoupon();break;case 4:e?this.handleConfigEmptyItemsOnRemoveCoupon():this.HandleParkedDeletion(!0);break;case 3:this.HandleReturn(!0),this.removeAppliedCoupon();break}}}resetAppliedCouponDiscount(){if(this.coupon){switch(this.coupon.Requirement?.Type){case 1:this.HandleDiscountPercentage(this._coupon,!1,!0);break;case 2:this.HandleDiscountAmount(this._coupon,!0);break}this.removeAppliedCoupon()}}HandleDiscountPercentage(e,t,i=!1){e.Amount>0?e.Requirement?.MaximumDiscount>0?this.applyConfigMaxDiscount(e,i):e.Requirement?.FullPriceProductOnly?this.applyFullPriceDisc(e,t,i):this.applyDiscountPercentage(e,t,i):(this.role.Discount=i?this.originalRoleData.Discount:!0,this._userRoleService.pushNewValue(this.role))}applyFullPriceDisc(e,t,i=!1){let o=this._orderDataService.Data,r=this.filterItemWithDisc(o.CartItems),c=this.filterItemWithCouponDisc(o.CartItems);if(i)c.length>0?(o.CartItems=this.resetItemsDisc(o.CartItems),this._orderDataService.pushNewValue()):this.applyDiscountPercentage(e,!1,i);else if(r.length>0){let u=this.filterItemWithoutDisc(o.CartItems);u.length>0?this.applyConfigItemsScope(e,u).subscribe(O=>{let A=this.applyItemsDisc(O,e);o.CartItems=this.updateCartItems(A,e),this._orderDataService.pushNewValue(o),this.showToastr(e)}):(this.removeAppliedCoupon(),t=!1,this._orderDataService.pushNewValue())}else this.applyDiscountPercentage(e,!0,i)}updateCartItems(e,t){let o=this._orderDataService.Data.CartItems.map(r=>{let c=e.find(u=>u.VariantID==r.VariantID);return c||r});return o=this.applyOneOfFirstQuantity(o,t),o}applyOneOfFirstQuantity(e,t){if(t?.Requirement?.RequirementDiscountType==2){let i=e.findIndex(o=>o.CouponDiscount>0);if(e[i].Quantity>1){let o=st(be,e[i]);o.Quantity=1,e[i].Quantity=e[i].Quantity-1,e[i].CouponDiscount=0,e[i].Discount=0,e[i].DiscountAmount=0,e.push(o)}}return e}filterItemWithDisc(e){return e.filter(i=>i.Discount>0||i.DiscountAmount>0||i.Price!=i?.Variant?.UnitPrice||h.IsNotEmpty(i.PriceBookID)||i.PriceTypeID==2)}filterItemWithoutDisc(e){return e.filter(i=>this.itemConditionFullPriceOnly(i))}filterItemWithCouponDisc(e){return e.filter(i=>i.CouponDiscount>0)}applyDiscountPercentage(e,t,i=!1){let o=this._orderDataService.Data.Order.CustomerDiscountRate,r=e.Amount;if(i){let c=this._orderDataService.Data;this._orderDataService.Data.Order.Discount=0,c.CartItems=this.resetItemsDisc(c.CartItems),this._orderDataService.pushNewValue(c)}else r>=o?e.ApplyToProduct?.length>0?this.applyDiscountRequiredItems(e):(this._orderDataService.Data.Order.Discount=e.Amount,this._orderDataService.pushNewValue(),this.showToastr(e)):(this.toastr.warning("Member discount is applied because member discount is greater than Coupon Discount","Warning"),this.resetAppliedCouponDiscount())}applyDiscountRequiredItems(e){let i=this._orderDataService.Data.CartItems.filter(o=>e.ApplyToProduct.map(r=>r.ID)?.includes(o.VariantID));this.applyConfigItemsScope(e,i).subscribe(o=>{let r=o.map(u=>(u.Discount=e.Amount,u.CouponDiscount=e.Amount,u)),c=this.updateCartItems(r,e);this._orderDataService.Data.CartItems=c,this._orderDataService.pushNewValue(),this.showToastr(e)})}showToastr(e){e.Requirement?.Notify&&this.toastr.success(e.Requirement?.Notify,"Coupon Applied")}applyConfigMaxDiscount(e,t=!1){let i=this._orderDataService.Data.CartItems;e.Requirement?.FullPriceProductOnly&&(i=i.filter(o=>this.itemConditionFullPriceOnly(o))),this.applyConfigItemsScope(e,i).subscribe(o=>{this.applyMaxDiscount(e,o,t)})}applyConfigItemsScope(e,t){let i=e.Requirement?.RequirementDiscountType;return i==1||i==2?this.dialog.open(Ai,{data:{coupon:e,cartItems:t}}).afterClosed().pipe(se(r=>{let O=this._orderDataService.Data.CartItems.some(A=>A.CouponDiscount>0);!r&&!O&&this.resetAppliedCouponDiscount()}),oe(r=>!!r)):Re(t)}applyMaxDiscount(e,t,i){let o=this._invoiceCalculatorService.calculateGrossTotal(t),r=this._orderDataService.Data,c=o*e.Amount/100,u=e.Requirement?.MaximumDiscount;if(c>=u)r.Order.DiscountAmount=i?0:u;else{r.Order.DiscountAmount==u&&(r.Order.DiscountAmount=0);let O=i?this.resetItemsDisc(t):this.applyItemsDisc(t,e);r.CartItems=this.updateCartItems(O,e)}this._orderDataService.pushNewValue(r)}resetItemsDisc(e){return this.coupon.Requirement.RequirementDiscountType==2?e=this.resetConfigOneOfFirstQuantity(e):e=e.map(t=>(t.CouponDiscount>0&&(t.Discount=0,t.DiscountAmount=0,t.CouponDiscount=0),t)),e}resetConfigOneOfFirstQuantity(e){let t=e.findIndex(i=>i.CouponDiscount>0);if(t!==-1){let i=e.findIndex(o=>o.CouponDiscount==0&&e[t]?.VariantID==o?.VariantID);i!==-1?(e.splice(t,1),e[i].Quantity+=1):(e[t].CouponDiscount=0,e[t].Discount=0,e[t].DiscountAmount=0)}return e}applyItemsDisc(e,t){return t.ApplyToProduct?.length>0?e=this.applyDiscByVariant(e,t):e=e.map(i=>(this.itemConditionFullPriceOnly(i)&&(i.Discount=t.Amount,i.CouponDiscount=t.Amount),i)),e}applyDiscByVariant(e,t){return e=e.map(i=>(t.ApplyToProduct.find(r=>r.ID==i.VariantID)&&this.itemConditionFullPriceOnly(i)&&(i.Discount=t.Amount,i.CouponDiscount=t.Amount),i)),e}itemConditionFullPriceOnly(e){return(e.Discount==0||e.CouponDiscount>0)&&e.DiscountAmount==0&&e.Price==e?.Variant?.UnitPrice&&h.IsEmpty(e.PriceBookID)}HandleDiscountAmount(e,t=!1){e.Amount>0?(e.ApplyToProduct?.length>0?this.applyDiscountInItem(e,t):(t?this._orderDataService.Data.Order.DiscountAmount=0:(this._orderDataService.Data.Order.DiscountAmount=e.Amount,this.toastr.success(e?.Requirement?.Notify,"Coupon Applied")),this._orderDataService.pushNewValue()),this.resetCustomerPoint(t)):(this.role.Discount=t?this.originalRoleData.Discount:!0,this._userRoleService.pushNewValue(this.role))}applyDiscountInItem(e,t=!1){let i=this._orderDataService.Data;if(t)i.CartItems=this.resetItemsDisc(i.CartItems);else{let r=i.CartItems.filter(c=>e.ApplyToProduct.map(u=>u.ID)?.includes(c.VariantID));this.applyConfigItemsScope(e,r).subscribe(c=>{let u=c.map(O=>(O.DiscountAmount=e.Amount,O.CouponDiscount=e.Amount,O));i.CartItems=this.updateCartItems(u,e),this._orderDataService.pushNewValue(i),this.showToastr(e)})}}resetCustomerPoint(e){if(!e){let t=this._orderDataService.Data;t.Order.PointUsed=0}}HandleReturn(e=!1){this.role.Return=e?this.originalRoleData.Return:!0,this._userRoleService.pushNewValue(this.role)}HandleParkedDeletion(e=!1){this.role.ParkedDeletionAuthorized=e?this.originalRoleData.ParkedDeletionAuthorized:!0,this._userRoleService.pushNewValue(this.role),e?this.removeAppliedCoupon():this.toastr.success("You Have Access to delete park and delete item when retrieve!","Coupon Applied")}HandleFullAccess(){this.role.UnitPriceEditor=!0,this.role.Discount=!0,this.role.Return=!0,this.role.Tax=!1,this.role.NumberEditor=!0,this.role.DateEditor=!0,this.role.PricebookSelector=!0,this.role.DeleteItem=!0,this.role.ParkedDeletionAuthorized=!0,this._userRoleService.pushNewValue(this.role)}resetRoleAfterAppliedCoupon(e=!0){let t=xe(it,this.originalRoleData);this.role.UnitPriceEditor=t.UnitPriceEditor,this.role.Discount=t.Discount,this.role.Return=t.Return,this.role.Tax=t.Tax,this.role.NumberEditor=t.NumberEditor,this.role.DateEditor=t.DateEditor,this.role.PricebookSelector=t.PricebookSelector,this.role.ParkedDeletionAuthorized=t.ParkedDeletionAuthorized,this.role.DeleteItem=t.DeleteItem,this._userRoleService.pushNewValue(this.role),this.removeAppliedCoupon(e)}handleConfigEmptyItemsOnRemoveCoupon(){this._orderDataService.Data.CartItems?.length>0?this.dialog.open(po,{data:{title:"Empty Cart",message:"The cart will be cleared after removing the full access coupon. Are you sure?",headerType:ne.Warning,okText:"Yes",cancelText:"No"}}).afterClosed().pipe(oe(t=>t)).subscribe(()=>{this.clearCouponOnEmptyCart()}):this.clearCouponOnEmptyCart()}clearCouponOnEmptyCart(){let e=this._coupon?.Requirement?.Type,t=this._orderDataService.Data;t.Order.Discount=0,t.Order.Discount2=0,t.Order.DiscountAmount=0,t.CartItems=[],this._orderDataService.pushNewValue(t),this.clearCartItemsInLocalStorage(),e==5?this.resetRoleAfterAppliedCoupon():e==4&&this.HandleParkedDeletion(!0)}clearCartItemsInLocalStorage(){if(localStorage.getItem("cart_items"))try{localStorage.removeItem("cart_items")}catch(t){console.error("Error clearing cart items from localStorage:",t)}}removeAppliedCoupon(e=!0){let t=this._orderDataService.Data;t.Order.PromotionCoupon=null,t.Order.PromotionNote=null,this._coupon=null,this._orderDataService.pushNewValue(),e&&this.toastr.warning("Coupon Cancelled","Warning")}static \u0275fac=function(t){return new(t||n)(g(Me),g(L),g(_e),g(H),g(ie),g(Vi))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var wt=class n{constructor(e,t,i,o,r,c,u,O,A){this.variantService=e;this._posService=t;this._orderDataService=i;this.toastr=o;this._orderProcessorService=r;this._customerHttpService=c;this.promotionCouponService=u;this.userRoleService=O;this.decimalPipe=A;this.subscribeToObservable()}salesOrderData;appConfigJson;entityID;audio=new Audio;subscribeToObservable(){this._posService.Data$.subscribe(e=>{this.appConfigJson=e.AppConfigJSON}),this._orderDataService.Data$.subscribe(e=>{this.salesOrderData=e,this.entityID=e.Order.EntityID})}addCartItemById(e,t,i=!0){return new Promise((o,r)=>{this.variantService.findVariantByID(e,this.entityID,i).then(c=>{this.createNewCartItem(c,t),o(c)}).catch(c=>{r(c)})})}addCartItemByCode(e){return new Promise((t,i)=>{let o=this.appConfigJson.ModuleSell.DigitalScale;o.Digit>0&&h.IsNotEmpty(o.Regex)&&e.length==o.Digit?this.parseDigitalScaleBarcodeWithRegex(e,o).then(c=>{c||(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.findVariantByCode(e).then(u=>t(u)).catch(u=>i(u)))}):this.findVariantByCode(e).then(c=>t(c)).catch(c=>i(c))})}findVariantByCode(e){let t=this.appConfigJson.ModuleSell.BarcodeSerialEnabled;return new Promise((i,o)=>{this.variantService.findVariantByCode(e,this.entityID,t).then(r=>{i(r),this.createNewCartItem(r)}).catch(r=>{this.playBellRing(),o(r)})})}addItemBySerial(e){this.variantService.findVariantBySerial(e,this.entityID).subscribe(t=>{let i=this.salesOrderData.CartItems;if(i.length>0){let o,r=[],c=i.findIndex(u=>u.Variant.ID==t.ID);r=[],c!==-1?(o=i[c].Serial?.findIndex(u=>u.Number==e),r=[...i[c].Serial?i[c].Serial:[]],o==-1?(r.push({Number:e,Quantity:1}),i[c].Quantity=r.length):r.length>0?r[o].Quantity+=1:(r=[{Number:e,Quantity:1}],this.addNewSerials(t,e)),i[c].Serial=[...r],i[c].Quantity=i[c].calculateSerialQty(),this.updateCartItem(i[c],c)):this.addNewSerials(t,e)}else this.addNewSerials(t,e)})}addNewSerials(e,t){e.Serial=[{Number:t,Quantity:1}],this.createNewCartItem(e)}playBellRing(){this.audio.src="//res.cloudinary.com/pos/video/upload/v1659947782/POS/Music/bell_ring.mp3",this.audio.load(),this.audio.play()}updateCartItem(e,t){this.salesOrderData.CartItems[t]=e,this._orderDataService.pushNewValue(this.salesOrderData),this.applyCustomerPoint(),this.reApplyPromotionCoupon(),this.saveItemsToLocalStorage()}deleteCartItem(e){this.salesOrderData.CartItems=this.salesOrderData.CartItems.filter(t=>t!==e),this._orderDataService.pushNewValue(this.salesOrderData),this.applyCustomerPoint(),this.reApplyPromotionCoupon()}parseDigitalScaleBarcodeWithRegex(e,t){return new Promise(i=>{let o=this.appConfigJson.ModuleSell.BarcodeSerialEnabled,r=new RegExp(t.Regex),c=e.match(r);if(console.log(c),h.IsNotEmpty(c)){let u=c[1],O=parseFloat(c[2]);console.log(O,"productQuantity"),O=O/t.QuantityDivider,this.variantService.findVariantByCode(u,this.entityID,o).then(A=>{this.createNewCartItem(A,null,O),i(!0)}).catch(()=>{i(!1)})}else i(!1)})}createNewCartItem(e,t,i){let o=new be,r=this.appConfigJson.ModuleSell.ProductNotes.CopyProductDescription,c=this.appConfigJson.ModuleSell.ProductNotes.CopyPromotionName;o.patchByVariant(e,r,c),o=this.applyReward(o,t),h.IsEmpty(t)&&(o=this.applyPriceBook(o)),this.validateCartItem(o)&&(o.Quantity=i||o.Quantity,t?.PromotionType==2?this.handlingPromotionQuantity(o):this.pushNewItemToArray(o,o.PromotionGift),this.applyCustomerPoint()),this.addAvailableComponent(o)}applyCustomerPoint(){let e=this.salesOrderData.Order.CustomerID,t=h.IsEmpty(e);this._orderProcessorService.reedemPointToDiscount(t)}handlingPromotionQuantity(e){let t=xe(be,this.salesOrderData.CartItems),i=t.findIndex(o=>o.VariantID==e.VariantID&&o.PromotionGift);i!==-1?t[i].Quantity+=e.Quantity?e.Quantity:1:t=[...t,e],this.salesOrderData.CartItems=t,this._orderDataService.pushNewValue(this.salesOrderData)}applyPromotionProduct(e){let t=e.Variant.DiscountAmount;return t&&(e.Price=e.UnitPriceOriginal-t),e}applyReward(e,t){if(t){let i=this.appConfigJson.ModuleSell.ProductNotes.CopyPromotionName;e.Discount=t.Discount,e.Price=t.OriginalPrice;let o=t.OriginalPrice-t.UnitPrice;e.Price=e.UnitPriceOriginal-o,e.UnitPrice=e.UnitPriceOriginal-o,e.PromotionGift=!0,e.PromotionID=t.PromotionID,e.Quantity=t.Quantity?t.Quantity:1,e.PriceTypeID=3,e.Cost+=t.ExtraCost,e.UnitCost+=t.ExtraCost,e.PriceNote=t.PromotionName,i&&(e.Note=`${e.Note?e.Note:""} ${t.PromotionName} `)}return e}addAvailableComponent(e){let t=e.Price!=0,i=this.appConfigJson.ModuleSell.SellProductComponentDefaultPrice,o=e.Variant;if(o.Component!=null&&o.Component.length>0)for(let r of o.Component){let c=new Ni;c.patchByVariant(r),c.Quantity=e.Quantity*r.Quantity,t&&!i&&(r.UnitPrice=0),c.Price=r.UnitPrice,this.pushNewItemToArray(c)}}pushNewItemToArray(e,t=!1){let i=this.salesOrderData.CartItems.findIndex(o=>o.VariantID==e.VariantID);if(e=this.applyPromotionProduct(e),i==-1||t)this.salesOrderData.CartItems.push(e);else{let o=this.appConfigJson.ModuleSell.QuickKey.NewRowBehaviour;if(o==2)this.salesOrderData.CartItems.push(e);else if(o==1)this._orderProcessorService.Data.posState==4?this.salesOrderData.CartItems.push(e):this.addingQuantityItem(i,e);else{if(!this.validatePrepaidPackage(e,i)){this.toastr.error("This prepaid package is already in the cart while editing. Please remove it first before adding again.","Cannot Add Item");return}this.addingQuantityItem(i,e)}}this._orderDataService.pushNewValue(this.salesOrderData),this.saveItemsToLocalStorage(),this.reApplyPromotionCoupon()}saveItemsToLocalStorage(){if(!this.userRoleService.Data.DeleteItem){let i=this._orderDataService.Data.CartItems;try{localStorage.setItem("cart_items",JSON.stringify(i))}catch(o){console.error("Error saving cart items to localStorage:",o)}}}clearCartItemsInLocalStorage(){if(!this.userRoleService.Data.DeleteItem)try{localStorage.removeItem("cart_items")}catch(t){console.error("Error clearing cart items from localStorage:",t)}}validatePrepaidPackage(e,t){let i=this.salesOrderData.CartItems[t],o=this._orderProcessorService.Data.posState,r=e.Variant.TypeID==10,c=h.IsNotEmpty(i.ID),u=!0;return o==2&&r&&c&&(u=!1),u}reApplyPromotionCoupon(){let e=this.salesOrderData.Order.CouponProvider,t=e=="Internal"||h.IsEmpty(e),i=this.salesOrderData.Order.PromotionCoupon,o=this.salesOrderData.Order.PromotionNote;h.IsNotEmpty(i)&&t&&this.promotionCouponService.RedeemCoupon(i,o,!1)}addingQuantityItem(e,t){let i=this.salesOrderData.CartItems.filter(u=>u.VariantID==t.VariantID),o=i.length,r=i.find(u=>!u.PromotionGift);this.salesOrderData.CartItems[e].PromotionGift&&o==1?this.salesOrderData.CartItems.push(t):(r.Quantity+=t.Quantity,r=this.applyPromotionProduct(r)),r&&(r=this.applyPriceBook(r))}validateCartItem(e){return e.Variant.CategoryTypeID==-1?(this.toastr.info(e.Variant.Name+" cannot be sold, check Category "+e.Variant.CategoryName+" settings","info"),!1):!(!this.validatePriceMinimum(e)||!this.validateSerialItem(e))}validatePriceMinimum(e){let t=!0,i=this.userRoleService.Data.PriceMinimum,o=this.appConfigJson.ModuleSell.ProductDialog.PriceMinimumTypeID;if(i){let r=0;switch(o){case 1:r=e.UnitPrice;break;case 2:r=e.UnitCost;break;case 3:r=e.UnitPriceMinimum;break}if(e.Price<r){t=!1;let c=h.StringFormat("You have no right to sell this item lower than {0}",this.decimalPipe.transform(r));alert(c)}}return t}validateSerialItem(e){let t=!0;if(e?.Serial?.length>0&&e.Variant.TypeID==4&&e.Quantity>0){let i=0;e?.Serial?.forEach(o=>{i+=o.Quantity}),i!=e.Quantity&&(this.toastr.error("Serial must be equal with the quantity","Error"),t=!1)}return t}applyPriceBook(e){let t=e.Variant.PriceBook!=null?e.Variant.PriceBook:[],i=this.findCustomerPricebook(t);if(t&&t.length!==0){let o=t.sort(function(r,c){return c.MinimumQuantity-r.MinimumQuantity}).filter(r=>e.Quantity>=r.MinimumQuantity&&r.MinimumQuantity!=0);o.length>0||h.IsNotEmpty(i)?h.IsNotEmpty(i)?e=this.applyPricebookToItem(e,i):e=this.applyPricebookToItem(e,o[0]):e=this.resetAppliedPricebook(e)}return e}resetAppliedPricebook(e){let i=(e?.Variant?.PriceBook).find(o=>o.ID==e.PriceBookID);return h.IsNotEmpty(i)&&(e.Discount=e.Variant.PriceDiscount,e.PriceBookID=h.GuidEmpty,e.Price=e.Variant.UnitPrice,e.UnitPrice=e.Variant.UnitPrice,e.PriceTypeID=0,e=this.applyPromotionProduct(e),e=this.removePromotionNote(e)),e}removePromotionNote(e){let t=this.appConfigJson.ModuleSell.ProductNotes;if(this.appConfigJson?.ModuleSell?.Pricebook?.PricebookVisible&&(e.Note=e.Note?.replace(e.PriceNote,""),e.PriceNote=""),t.CopyPromotionName){let o=e.Variant?.PriceNote;e.Note=`${o||""} ${e.Note?e.Note:""}`,e.PriceNote=o}return e}applyPricebookToItem(e,t){return e.Discount=t.PriceDiscount,e.UnitPrice=t.UnitPrice,e.PriceBookID=t.ID,e.Price=t.UnitPrice,e.PriceTypeID=2,e=this.assignItemNote(e,t),e}assignItemNote(e,t){return this.appConfigJson?.ModuleSell?.Pricebook?.PricebookVisible?(e.Note?.includes(e.PriceNote)?e.Note=e.Note?.replace(e.PriceNote,t.Name):e.Note=`${t.Name} ${e.Note?e.Note:""}`,e.PriceNote=t.Name):(e.Note="",e.PriceNote=""),e}findCustomerPricebook(e=[]){let t=this._customerHttpService.Data,i;return t&&(i=e.find(o=>o.ID==t.PricebookID)),i}static \u0275fac=function(t){return new(t||n)(g(mo),g($),g(L),g(H),g(Je),g(Te),g(Et),g(_e),g(J))};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};function cr(n,e){if(n&1&&(a(0,"div",9)(1,"div",4),_(2,"input",10),s()()),n&2){let t=d();l(2),p("formControl",t.searchControl)}}function mr(n,e){if(n&1){let t=I();a(0,"tr")(1,"td"),m(2),s(),a(3,"td"),m(4),s(),a(5,"td",11),m(6),y(7,"number"),s(),a(8,"td",11),m(9),y(10,"number"),s(),a(11,"td",12)(12,"button",13),b("click",function(){let o=C(t).$implicit,r=d();return v(r.onSelectReward(o))}),m(13,"Apply"),s()()()}if(n&2){let t=e.$implicit;l(2),D(t.VariantName),l(2),D(t.VariantCode),l(2),D(M(7,4,t.OriginalPrice)),l(3),D(M(10,6,t.UnitPrice))}}var Li=class n{constructor(e,t,i,o,r,c){this._dialogRef=e;this._matDialog=t;this._shoppingCartService=i;this._promotionEventService=o;this._toastr=r;this.data=c;this.selectedPromotion=this._promotionEventService.selectedPromotion}modalConfig=new K;selectedPromotion;rewards$;searchControl=new ze;ngOnInit(){this.modalConfig.title="Select a Reward",this.modalConfig.hideFooter=!0,this.initRewards(!0)}initRewards(e){this.rewards$=this.searchControl.valueChanges.pipe(Xt(""),dt(e?0:500),ke(),z(t=>{let i;return i=Re(this.data.rewards).pipe(q(o=>o.filter(r=>this.findKeywordInValue(t,r?.VariantCode)||this.findKeywordInValue(t,r?.VariantName)))),e=!0,i}))}findKeywordInValue(e,t){return t?.toUpperCase()?.indexOf(e?.toUpperCase())>-1}onSelectReward(e){e.PromotionType=this.data.promotion.TypeID,this._shoppingCartService.addCartItemById(e.VariantID,e,!0).then(()=>{this._matDialog.closeAll(),this._promotionEventService.pushNewValue(this._promotionEventService.Data),this.showToastAppliedPromo()})}showToastAppliedPromo(){this._toastr.success("Applied "+this.selectedPromotion.Name+" to order!","Applied successfully!")}close(){this._dialogRef.close()}static \u0275fac=function(t){return new(t||n)(S(Y),S(Ie),S(wt),S(we),S(H),S(ce))};static \u0275cmp=R({type:n,selectors:[["POS-modal-select-item"]],standalone:!1,decls:22,vars:9,consts:[[3,"onCancel","onClose","config"],[1,"container"],["class","row mb-3",4,"ngIf"],[1,"row"],[1,"col-12"],[1,"table","table-bordered"],[1,"thead-light"],["scope","col"],[4,"ngFor","ngForOf"],[1,"row","mb-3"],["type","text","placeholder","Type to filter reward",1,"form-control",3,"formControl"],[1,"text-end"],[1,"text-center"],[1,"btn","btn-sm","btn-success",3,"click"]],template:function(t,i){t&1&&(a(0,"modal-material",0),b("onCancel",function(){return i.close()})("onClose",function(){return i.close()}),a(1,"content")(2,"div",1),f(3,cr,3,1,"div",2),a(4,"div",3)(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr")(9,"th",7),m(10,"Name"),s(),a(11,"th",7),m(12,"Code"),s(),a(13,"th",7),m(14,"Price"),s(),a(15,"th",7),m(16,"Promo"),s(),_(17,"th",7),s()(),a(18,"tbody"),f(19,mr,14,8,"tr",8),y(20,"async"),y(21,"sortBy"),s()()()()()()()),t&2&&(p("config",i.modalConfig),l(3),p("ngIf",(i.data==null||i.data.rewards==null?null:i.data.rewards.length)>5),l(16),p("ngForOf",Ct(21,5,M(20,3,i.rewards$),"desc","VariantCode")))},dependencies:[he,ae,Oe,Ce,vt,Z,qe,J,St],styles:[".table-scroll[_ngcontent-%COMP%]{max-height:400px;overflow-y:auto}table[_ngcontent-%COMP%]{max-width:600px!important;overflow-x:hidden}"]})};function pr(n,e){if(n&1&&(B(0),a(1,"div",13)(2,"div",7),_(3,"input",14),s()(),j()),n&2){let t=d();l(3),p("formControl",t.searchCtrl)}}function dr(n,e){n&1&&(B(0),a(1,"th",15),m(2,"Qty"),s(),j())}function ur(n,e){n&1&&_(0,"th",10)}function gr(n,e){if(n&1){let t=I();B(0),a(1,"td")(2,"input",17),V("ngModelChange",function(o){C(t);let r=d().$implicit;return N(r.Quantity,o)||(r.Quantity=o),v(o)}),s()(),j()}if(n&2){let t=d().$implicit;l(2),k("ngModel",t.Quantity)}}function fr(n,e){if(n&1){let t=I();a(0,"td",18)(1,"button",19),b("click",function(){C(t);let o=d().$implicit,r=d();return v(r.onApplyReward(o))}),m(2,"Apply"),s()()}}function hr(n,e){if(n&1&&(a(0,"tr")(1,"td"),m(2),s(),a(3,"td"),m(4),s(),a(5,"td",16),m(6),y(7,"number"),s(),a(8,"td",16),m(9),y(10,"number"),s(),f(11,gr,3,1,"ng-container",11)(12,fr,3,0,"ng-template",null,1,Pe),s()),n&2){let t=e.$implicit,i=U(13),o=d();l(2),D(t.VariantName),l(2),D(t.VariantCode),l(2),D(M(7,6,t.OriginalPrice)),l(3),D(M(10,8,t.UnitPrice)),l(2),p("ngIf",o.rewardQuantity>1)("ngIfElse",i)}}var Hi=class n{constructor(e,t,i,o,r,c){this.data=e;this.shoppingCartService=t;this.promotionEventService=i;this.dialogRef=o;this.matDialog=r;this.toastr=c;this.searchCtrl=new ze,this.rewardQuantity=e.rewardQuantity,this.sourceRewards=[...e.rewards]}modalConfig;rewards$;rewardQuantity;rewards;sourceRewards=[];searchCtrl;ngOnInit(){this.initModalConfig(),this.initSearchCtrl(!0)}initModalConfig(){this.modalConfig=new K,this.modalConfig.title="Select a Reward",this.rewardQuantity<2&&(this.modalConfig.hideFooter=!0)}initSearchCtrl(e){this.rewards$=this.searchCtrl.valueChanges.pipe(Xt(""),dt(e?0:500),ke(),z(t=>{let i;return i=Re(this.sourceRewards).pipe(q(o=>(o.length===1&&(o[0].Quantity=this.rewardQuantity),o)),q(o=>o.filter(r=>this.findKeywordInValue(t,r?.VariantCode)||this.findKeywordInValue(t,r?.VariantName)))),e=!1,i}),se(t=>{this.rewards=t}))}findKeywordInValue(e,t){return t?.toUpperCase()?.indexOf(e.toUpperCase())>-1}onApplyReward(e){this.addRewardToShoppingCart(e)}onClose(){this.dialogRef.close()}onOk(){this.calculateRewardQty()>this.rewardQuantity?this.toastr.warning("Product reward exceeds the maximum amount earned","Warning"):[...this.rewards].filter(i=>i.Quantity>0).forEach(i=>{this.addRewardToShoppingCart(i)})}calculateRewardQty(){let e=0;return this.rewards.forEach(t=>{e+=t.Quantity?t.Quantity:0}),e}addRewardToShoppingCart(e){e.PromotionType=this.data.promotion.TypeID,this.shoppingCartService.addCartItemById(e.VariantID,e,!0).then(()=>{this.matDialog.closeAll(),this.promotionEventService.pushNewValue(this.promotionEventService.Data)})}static \u0275fac=function(t){return new(t||n)(S(ce),S(wt),S(we),S(Y),S(Ie),S(H))};static \u0275cmp=R({type:n,selectors:[["app-modal-quantity-reward"]],standalone:!1,decls:27,vars:12,consts:[["APPLY",""],["APPLY_BUTTON",""],[3,"onCancel","onOk","onClose","config"],[1,"ms-3"],[1,"container"],[4,"ngIf"],[1,"row","table-scroll"],[1,"col-12"],[1,"table","table-bordered"],[1,"thead-light"],["scope","col"],[4,"ngIf","ngIfElse"],[4,"ngFor","ngForOf"],[1,"row","mb-3"],["type","text","placeholder","Type to filter reward",1,"form-control",3,"formControl"],["scope","col",2,"width","66px"],[1,"text-end"],["type","text","autoNum","","min","0",1,"form-control",3,"ngModelChange","ngModel"],[1,"text-center"],[1,"btn","btn-sm","btn-success",3,"click"]],template:function(t,i){if(t&1){let o=I();a(0,"modal-material",2),b("onCancel",function(){return C(o),v(i.onClose())})("onOk",function(){return C(o),v(i.onOk())})("onClose",function(){return C(o),v(i.onClose())}),a(1,"header")(2,"small",3),m(3),s()(),a(4,"content")(5,"div",4),f(6,pr,4,1,"ng-container",5),a(7,"div",6)(8,"div",7)(9,"table",8)(10,"thead",9)(11,"tr")(12,"th",10),m(13,"Name"),s(),a(14,"th",10),m(15,"Code"),s(),a(16,"th",10),m(17,"Price"),s(),a(18,"th",10),m(19,"Promo"),s(),f(20,dr,3,0,"ng-container",11)(21,ur,1,0,"ng-template",null,0,Pe),s()(),a(23,"tbody"),f(24,hr,14,10,"tr",12),y(25,"async"),y(26,"sortBy"),s()()()()()()()}if(t&2){let o=U(22);p("config",i.modalConfig),l(3),P(" ( ",i.rewardQuantity," products reward ) "),l(3),p("ngIf",(i.sourceRewards==null?null:i.sourceRewards.length)>5),l(14),p("ngIf",i.rewardQuantity>1)("ngIfElse",o),l(4),p("ngForOf",Ct(26,8,M(25,6,i.rewards$),"desc","VariantCode"))}},dependencies:[he,ae,Oe,Ce,De,vt,Z,bt,qe,J,St],encapsulation:2})};var we=class n{constructor(e,t,i,o,r,c,u,O,A){this._orderDataService=e;this._outletService=t;this._invoiceCalculatorService=i;this._dialog=o;this._httpService=r;this._posService=c;this._toastr=u;this._signalrService=O;this.decimalPipe=A;this.previousQuantity=0,this.previousTotalEligible=0,this.subscribeNotification(),this._posService.Data$.subscribe(W=>{this.taxes=W.Taxes}),this._outletService.Data$.subscribe(W=>{this.loadPromotions(W.Promotion)}),this._orderDataService.Data$.pipe(oe(W=>{this.salesOrderData=W;let ge=this.calculateOrderReward(W.getRewards()),an=this.calculateOrderReward(this.previousRewards);return this.previousQuantity!=W.TotalQuantity||an<ge||this.isRestroreOrder}),dt(100)).subscribe(W=>{this.isRestroreOrder=!1,this.checkQtyPromotion(),this.applyQuantityPromotion(),this.previousRewards=[...W.getRewards()]}),this._invoiceCalculatorService.Data$.subscribe(W=>{this.checkEligiblePromotionWithMinSpend()})}_Data=new fe([]);get Data(){return this._Data.getValue()}Data$=this._Data.asObservable();selectedPromotion=null;onClickToastPromo=new Ae;previousQuantity;salesOrderData;orderDataBeforePromotion;taxes=[];previousTotalEligible;previousRewards=[];isRestroreOrder=!1;calculateOrderReward(e){let t=0;return e.length>0&&(t=e.map(i=>i.Quantity).reduce((i,o)=>i+o)),t}checkQtyPromotion(){let e=this._orderDataService.Data;this.checkEligibleQtyPromotion(e.CartItems),this.checkEligibleTierPromotion(e.CartItems),this.previousQuantity=e.TotalQuantity}subscribeNotification(){this._signalrService.OnPromotionEventChange.pipe(ye(),z(()=>{let e=this._outletService.Data?.RegisterID;return this.getPromotions(e)})).subscribe(()=>{this._toastr.info("Promotion Event Updated","Promotion Update")})}getPromotions(e){return this._httpService.get(Q.GetListPromotion,[{key:"RegisterID",value:e}]).pipe(se(t=>{this.loadPromotions(t)}))}loadPromotions(e){let t=this.getPromotionDesc(e);this.pushNewValue(t),this.checkQtyPromotion(),this.checkEligiblePromotionWithMinSpend()}pushNewValue(e){this.showToastEligiblePromotion(),this._Data.next(e)}checkSelectedPromotionRequirement(e){this.selectedPromotion!=null&&this.selectedPromotion.TypeID==e&&this.Data.find(i=>i.ID===this.selectedPromotion.ID)?.Eligible===!1&&(this._dialog.open(Ri,{id:"modal-promotion-confirm",data:{message:"Order will be restored to before the promotion is applied"},disableClose:!0}),this.isRestroreOrder=!0)}restoreOrder(){this._orderDataService.pushNewValue(this.orderDataBeforePromotion),this.selectedPromotion=null}getPromotionDesc(e=[]){return e?.map(i=>(i.Description=this.generatePromotionDesc(i),i))}checkEligiblePromotionWithMinSpend(){let e=this._invoiceCalculatorService.Data,t=this.Data?.filter(o=>(o.TypeID===1||o.TypeID==3)&&!this.checkExpiredPromotion(o)).map(o=>(e>=o.MinimumAmount?o.Eligible=!0:o.Eligible=!1,o)),i=this.mappingEligiblePromotion(t);this.pushNewValue(i),this.checkSelectedPromotionRequirement(1),this.checkSelectedPromotionRequirement(3)}checkEligibleQtyPromotion(e){let t=0,i=this.Data?.filter(r=>r.TypeID===2&&!this.checkExpiredPromotion(r)).map(r=>(r.Eligible=!1,r.ListVariant.length>0?(t=this.getQuantityByRequirementType(e,"variant",r.ListVariant),t>=r.MinimumAmount&&(r.Eligible=!0)):r.ListCategory.length>0?(t=this.getQuantityByRequirementType(e,"category",r.ListCategory),t>=r.MinimumAmount&&(r.Eligible=!0)):this.salesOrderData.TotalQuantity>=r.MinimumAmount&&(r.Eligible=!0),r)),o=this.mappingEligiblePromotion(i);this.pushNewValue(o)}checkEligibleTierPromotion(e){let t,i=this.Data?.filter(r=>r.TypeID===5&&!this.checkExpiredPromotion(r)).map(r=>(r.Eligible=!1,r.ListVariant.length>0?t=this.getQuantityByRequirementType(e,"variant",r.ListVariant):r.ListCategory.length>0?t=this.getQuantityByRequirementType(e,"category",r.ListCategory):t=this.salesOrderData.TotalQuantity,r.PromotionTieredQuantity.forEach(c=>{t>=c.Quantity&&(r.Eligible=!0)}),r)),o=this.mappingEligiblePromotion(i);this.pushNewValue(o)}getQuantityByRequirementType(e,t,i){let o=0,r;return t=="variant"?e.forEach(c=>{r=i.findIndex(u=>u.ID===c.VariantID),r!==-1&&(o+=c.Quantity)}):e.forEach(c=>{c.Variant&&(r=i.findIndex(u=>u.ID===c.Variant.CategoryID),r!==-1&&(o+=c.Quantity))}),o}mappingEligiblePromotion(e=[]){let t=this.Data;if(e?.length>0){let i;t=this.Data?.map(o=>(i=e.findIndex(r=>r.ID==o.ID),i!==-1&&(o=e[i]),o))}return t}checkExpiredPromotion(e){let t=new Date,i=new Date(e.StartDate),r=(h.IsEmpty(e.StartTime)?"00:00:00":e.StartTime).split(":").map(A=>parseInt(A));i.setHours(r[0],r[1],r[2]);let c=new Date(e.ExpirationDate),O=(h.IsEmpty(e.EndTime)?"23:59:59":e.EndTime).split(":").map(A=>parseInt(A));return c.setHours(O[0],O[1],O[2]),!(t.getTime()>=i.getTime()&&t.getTime()<=c.getTime())}showToastEligiblePromotion(){let e=this.getTotalEligiblePromotion(),t=h.IsNotEmpty(this.salesOrderData.Order.ID);this.previousTotalEligible!==e&&e>0&&!t&&this._toastr.info(e+" promotion(s) can be applied!","Promo available!",{timeOut:2e4}).onTap.pipe(He(1)).subscribe(()=>{this.onClickToastPromo.next(!0)}),this.previousTotalEligible=e}getTotalEligiblePromotion(){return this.Data?.filter(t=>t.Eligible).length}generatePromotionDesc(e){let t="";switch(e.TypeID){case 2:t+="Minimum "+this.decimalPipe.transform(e.MinimumAmount)+" ",e.ListVariant.length>0?(t=t+" piece of ",t+=this.generateItemListDescription(e.ListVariant)):e.ListCategory.length>0?(t+="from category ",t+=this.generateItemListDescription(e.ListCategory)):t+="items";break;case 1:t+="Minimum spend Rp. "+this.decimalPipe.transform(e.MinimumAmount);break;case 3:t+=`Apply
3
3
  ${e.Discount1!==0?"discount1 = "+e.Discount1+"%":""}
4
4
  ${e.Discount1!==0&&e.Discount2!==0?" and ":""}
@@ -1,4 +1,4 @@
1
- import{a as Ct}from"./chunk-ENRRUPSB.js";import{a as pt,b as ct,c as ut,d as dt,e as _t,f as gt}from"./chunk-SQZWHGDQ.js";import{a as mt}from"./chunk-3L47WAT5.js";import{a as yt}from"./chunk-MMQDVSYE.js";import{a as bt,b as xt,c as It,d as wt}from"./chunk-SEUYLSG6.js";import{a as ft}from"./chunk-YBH7C53G.js";import{b as Fe}from"./chunk-I6HQHZRF.js";import{a as Pe}from"./chunk-PEI67MDS.js";import{b as ht}from"./chunk-GGEENO4M.js";import{a as Ve,c as Ee}from"./chunk-HLZJPEJB.js";import{a as te}from"./chunk-O4T67QQ3.js";import{$ as rt,B as tt,E as nt,N as it,P as Ne,Q as ot,S as ke,T as ce,U as at,X as Ae,ca as lt,e as Ye,fa as st,ja as H,ka as M,la as Oe,s as pe,sa as ue,t as q,v as Xe,w as et}from"./chunk-WUSKRV4R.js";import{D as Je,a as Se,g as je,h as Ze,o as We}from"./chunk-J577JGRK.js";import{$a as p,$b as y,$c as X,Ba as Ke,Db as $e,Dc as K,Fa as P,Ga as qe,Ib as _,Jb as g,Kb as S,Kc as h,Lb as k,Lc as L,Ma as G,Mb as O,Nb as F,Nc as _e,Ob as v,Oc as Ge,Qb as C,Rb as s,Uc as W,Wc as ve,Xc as J,Yb as T,Zb as $,_b as b,_c as Y,db as de,dc as le,ec as R,fc as Q,gc as me,hd as ee,ia as ye,ja as ne,jc as Ie,ka as ie,kb as j,kc as we,lb as ae,lc as Ce,na as oe,nc as se,ob as Z,oc as Te,pc as V,qb as u,qc as Re,rc as Ue,ua as xe,ub as f,va as d,vb as l,wa as m,wb as He,yb as re,za as U,zb as D}from"./chunk-ONCTFURX.js";import{a as fe,b as be}from"./chunk-7DCB7DB2.js";var Ft=["clearicon"],Lt=["incrementbuttonicon"],Dt=["decrementbuttonicon"],Mt=["input"];function Bt(t,r){if(t&1){let e=v();_(0,"TimesIcon",7),C("click",function(){d(e);let n=s(2);return m(n.clear())}),g()}t&2&&(l("ngClass","p-inputnumber-clear-icon"),f("data-pc-section","clearIcon"))}function $t(t,r){}function Rt(t,r){t&1&&u(0,$t,0,0,"ng-template")}function Nt(t,r){if(t&1){let e=v();_(0,"span",8),C("click",function(){d(e);let n=s(2);return m(n.clear())}),u(1,Rt,1,0,null,9),g()}if(t&2){let e=s(2);f("data-pc-section","clearIcon"),p(),l("ngTemplateOutlet",e.clearIconTemplate||e._clearIconTemplate)}}function At(t,r){if(t&1&&(k(0),u(1,Bt,1,2,"TimesIcon",5)(2,Nt,2,2,"span",6),O()),t&2){let e=s();p(),l("ngIf",!e.clearIconTemplate&&!e._clearIconTemplate),p(),l("ngIf",e.clearIconTemplate||e._clearIconTemplate)}}function zt(t,r){if(t&1&&S(0,"span",13),t&2){let e=s(2);l("ngClass",e.incrementButtonIcon),f("data-pc-section","incrementbuttonicon")}}function Qt(t,r){t&1&&S(0,"AngleUpIcon"),t&2&&f("data-pc-section","incrementbuttonicon")}function Kt(t,r){}function qt(t,r){t&1&&u(0,Kt,0,0,"ng-template")}function Ht(t,r){if(t&1&&(k(0),u(1,Qt,1,1,"AngleUpIcon",2)(2,qt,1,0,null,9),O()),t&2){let e=s(2);p(),l("ngIf",!e.incrementButtonIconTemplate&&!e._incrementButtonIconTemplate),p(),l("ngTemplateOutlet",e.incrementButtonIconTemplate||e._incrementButtonIconTemplate)}}function Ut(t,r){if(t&1&&S(0,"span",13),t&2){let e=s(2);l("ngClass",e.decrementButtonIcon),f("data-pc-section","decrementbuttonicon")}}function Gt(t,r){t&1&&S(0,"AngleDownIcon"),t&2&&f("data-pc-section","decrementbuttonicon")}function jt(t,r){}function Zt(t,r){t&1&&u(0,jt,0,0,"ng-template")}function Wt(t,r){if(t&1&&(k(0),u(1,Gt,1,1,"AngleDownIcon",2)(2,Zt,1,0,null,9),O()),t&2){let e=s(2);p(),l("ngIf",!e.decrementButtonIconTemplate&&!e._decrementButtonIconTemplate),p(),l("ngTemplateOutlet",e.decrementButtonIconTemplate||e._decrementButtonIconTemplate)}}function Jt(t,r){if(t&1){let e=v();_(0,"span",10)(1,"button",11),C("mousedown",function(n){d(e);let o=s();return m(o.onUpButtonMouseDown(n))})("mouseup",function(){d(e);let n=s();return m(n.onUpButtonMouseUp())})("mouseleave",function(){d(e);let n=s();return m(n.onUpButtonMouseLeave())})("keydown",function(n){d(e);let o=s();return m(o.onUpButtonKeyDown(n))})("keyup",function(){d(e);let n=s();return m(n.onUpButtonKeyUp())}),u(2,zt,1,2,"span",12)(3,Ht,3,2,"ng-container",2),g(),_(4,"button",11),C("mousedown",function(n){d(e);let o=s();return m(o.onDownButtonMouseDown(n))})("mouseup",function(){d(e);let n=s();return m(n.onDownButtonMouseUp())})("mouseleave",function(){d(e);let n=s();return m(n.onDownButtonMouseLeave())})("keydown",function(n){d(e);let o=s();return m(o.onDownButtonKeyDown(n))})("keyup",function(){d(e);let n=s();return m(n.onDownButtonKeyUp())}),u(5,Ut,1,2,"span",12)(6,Wt,3,2,"ng-container",2),g()()}if(t&2){let e=s();f("data-pc-section","buttonGroup"),p(),D(e.incrementButtonClass),l("ngClass",e._incrementButtonClass)("disabled",e.disabled),f("aria-hidden",!0)("data-pc-section","incrementbutton"),p(),l("ngIf",e.incrementButtonIcon),p(),l("ngIf",!e.incrementButtonIcon),p(),D(e.decrementButtonClass),l("ngClass",e._decrementButtonClass)("disabled",e.disabled),f("aria-hidden",!0)("data-pc-section","decrementbutton"),p(),l("ngIf",e.decrementButtonIcon),p(),l("ngIf",!e.decrementButtonIcon)}}function Yt(t,r){if(t&1&&S(0,"span",13),t&2){let e=s(2);l("ngClass",e.incrementButtonIcon),f("data-pc-section","incrementbuttonicon")}}function Xt(t,r){t&1&&S(0,"AngleUpIcon"),t&2&&f("data-pc-section","incrementbuttonicon")}function en(t,r){}function tn(t,r){t&1&&u(0,en,0,0,"ng-template")}function nn(t,r){if(t&1&&(k(0),u(1,Xt,1,1,"AngleUpIcon",2)(2,tn,1,0,null,9),O()),t&2){let e=s(2);p(),l("ngIf",!e.incrementButtonIconTemplate&&!e._incrementButtonIconTemplate),p(),l("ngTemplateOutlet",e.incrementButtonIconTemplate||e._incrementButtonIconTemplate)}}function on(t,r){if(t&1){let e=v();_(0,"button",11),C("mousedown",function(n){d(e);let o=s();return m(o.onUpButtonMouseDown(n))})("mouseup",function(){d(e);let n=s();return m(n.onUpButtonMouseUp())})("mouseleave",function(){d(e);let n=s();return m(n.onUpButtonMouseLeave())})("keydown",function(n){d(e);let o=s();return m(o.onUpButtonKeyDown(n))})("keyup",function(){d(e);let n=s();return m(n.onUpButtonKeyUp())}),u(1,Yt,1,2,"span",12)(2,nn,3,2,"ng-container",2),g()}if(t&2){let e=s();D(e.incrementButtonClass),l("ngClass",e._incrementButtonClass)("disabled",e.disabled),f("aria-hidden",!0)("data-pc-section","incrementbutton"),p(),l("ngIf",e.incrementButtonIcon),p(),l("ngIf",!e.incrementButtonIcon)}}function an(t,r){if(t&1&&S(0,"span",13),t&2){let e=s(2);l("ngClass",e.decrementButtonIcon),f("data-pc-section","decrementbuttonicon")}}function rn(t,r){t&1&&S(0,"AngleDownIcon"),t&2&&f("data-pc-section","decrementbuttonicon")}function ln(t,r){}function sn(t,r){t&1&&u(0,ln,0,0,"ng-template")}function pn(t,r){if(t&1&&(k(0),u(1,rn,1,1,"AngleDownIcon",2)(2,sn,1,0,null,9),O()),t&2){let e=s(2);p(),l("ngIf",!e.decrementButtonIconTemplate&&!e._decrementButtonIconTemplate),p(),l("ngTemplateOutlet",e.decrementButtonIconTemplate||e._decrementButtonIconTemplate)}}function cn(t,r){if(t&1){let e=v();_(0,"button",11),C("mousedown",function(n){d(e);let o=s();return m(o.onDownButtonMouseDown(n))})("mouseup",function(){d(e);let n=s();return m(n.onDownButtonMouseUp())})("mouseleave",function(){d(e);let n=s();return m(n.onDownButtonMouseLeave())})("keydown",function(n){d(e);let o=s();return m(o.onDownButtonKeyDown(n))})("keyup",function(){d(e);let n=s();return m(n.onDownButtonKeyUp())}),u(1,an,1,2,"span",12)(2,pn,3,2,"ng-container",2),g()}if(t&2){let e=s();D(e.decrementButtonClass),l("ngClass",e._decrementButtonClass)("disabled",e.disabled),f("aria-hidden",!0)("data-pc-section","decrementbutton"),p(),l("ngIf",e.decrementButtonIcon),p(),l("ngIf",!e.decrementButtonIcon)}}var un=({dt:t})=>`
1
+ import{a as Ct}from"./chunk-ENRRUPSB.js";import{a as pt,b as ct,c as ut,d as dt,e as _t,f as gt}from"./chunk-SQZWHGDQ.js";import{a as mt}from"./chunk-3L47WAT5.js";import{a as yt}from"./chunk-MMQDVSYE.js";import{a as bt,b as xt,c as It,d as wt}from"./chunk-SEUYLSG6.js";import{a as ft}from"./chunk-YBH7C53G.js";import{b as Fe}from"./chunk-I6HQHZRF.js";import{a as Pe}from"./chunk-PEI67MDS.js";import{b as ht}from"./chunk-WPFM3ZGY.js";import{a as Ve,c as Ee}from"./chunk-HLZJPEJB.js";import{a as te}from"./chunk-O4T67QQ3.js";import{$ as rt,B as tt,E as nt,N as it,P as Ne,Q as ot,S as ke,T as ce,U as at,X as Ae,ca as lt,e as Ye,fa as st,ja as H,ka as M,la as Oe,s as pe,sa as ue,t as q,v as Xe,w as et}from"./chunk-WUSKRV4R.js";import{D as Je,a as Se,g as je,h as Ze,o as We}from"./chunk-J577JGRK.js";import{$a as p,$b as y,$c as X,Ba as Ke,Db as $e,Dc as K,Fa as P,Ga as qe,Ib as _,Jb as g,Kb as S,Kc as h,Lb as k,Lc as L,Ma as G,Mb as O,Nb as F,Nc as _e,Ob as v,Oc as Ge,Qb as C,Rb as s,Uc as W,Wc as ve,Xc as J,Yb as T,Zb as $,_b as b,_c as Y,db as de,dc as le,ec as R,fc as Q,gc as me,hd as ee,ia as ye,ja as ne,jc as Ie,ka as ie,kb as j,kc as we,lb as ae,lc as Ce,na as oe,nc as se,ob as Z,oc as Te,pc as V,qb as u,qc as Re,rc as Ue,ua as xe,ub as f,va as d,vb as l,wa as m,wb as He,yb as re,za as U,zb as D}from"./chunk-ONCTFURX.js";import{a as fe,b as be}from"./chunk-7DCB7DB2.js";var Ft=["clearicon"],Lt=["incrementbuttonicon"],Dt=["decrementbuttonicon"],Mt=["input"];function Bt(t,r){if(t&1){let e=v();_(0,"TimesIcon",7),C("click",function(){d(e);let n=s(2);return m(n.clear())}),g()}t&2&&(l("ngClass","p-inputnumber-clear-icon"),f("data-pc-section","clearIcon"))}function $t(t,r){}function Rt(t,r){t&1&&u(0,$t,0,0,"ng-template")}function Nt(t,r){if(t&1){let e=v();_(0,"span",8),C("click",function(){d(e);let n=s(2);return m(n.clear())}),u(1,Rt,1,0,null,9),g()}if(t&2){let e=s(2);f("data-pc-section","clearIcon"),p(),l("ngTemplateOutlet",e.clearIconTemplate||e._clearIconTemplate)}}function At(t,r){if(t&1&&(k(0),u(1,Bt,1,2,"TimesIcon",5)(2,Nt,2,2,"span",6),O()),t&2){let e=s();p(),l("ngIf",!e.clearIconTemplate&&!e._clearIconTemplate),p(),l("ngIf",e.clearIconTemplate||e._clearIconTemplate)}}function zt(t,r){if(t&1&&S(0,"span",13),t&2){let e=s(2);l("ngClass",e.incrementButtonIcon),f("data-pc-section","incrementbuttonicon")}}function Qt(t,r){t&1&&S(0,"AngleUpIcon"),t&2&&f("data-pc-section","incrementbuttonicon")}function Kt(t,r){}function qt(t,r){t&1&&u(0,Kt,0,0,"ng-template")}function Ht(t,r){if(t&1&&(k(0),u(1,Qt,1,1,"AngleUpIcon",2)(2,qt,1,0,null,9),O()),t&2){let e=s(2);p(),l("ngIf",!e.incrementButtonIconTemplate&&!e._incrementButtonIconTemplate),p(),l("ngTemplateOutlet",e.incrementButtonIconTemplate||e._incrementButtonIconTemplate)}}function Ut(t,r){if(t&1&&S(0,"span",13),t&2){let e=s(2);l("ngClass",e.decrementButtonIcon),f("data-pc-section","decrementbuttonicon")}}function Gt(t,r){t&1&&S(0,"AngleDownIcon"),t&2&&f("data-pc-section","decrementbuttonicon")}function jt(t,r){}function Zt(t,r){t&1&&u(0,jt,0,0,"ng-template")}function Wt(t,r){if(t&1&&(k(0),u(1,Gt,1,1,"AngleDownIcon",2)(2,Zt,1,0,null,9),O()),t&2){let e=s(2);p(),l("ngIf",!e.decrementButtonIconTemplate&&!e._decrementButtonIconTemplate),p(),l("ngTemplateOutlet",e.decrementButtonIconTemplate||e._decrementButtonIconTemplate)}}function Jt(t,r){if(t&1){let e=v();_(0,"span",10)(1,"button",11),C("mousedown",function(n){d(e);let o=s();return m(o.onUpButtonMouseDown(n))})("mouseup",function(){d(e);let n=s();return m(n.onUpButtonMouseUp())})("mouseleave",function(){d(e);let n=s();return m(n.onUpButtonMouseLeave())})("keydown",function(n){d(e);let o=s();return m(o.onUpButtonKeyDown(n))})("keyup",function(){d(e);let n=s();return m(n.onUpButtonKeyUp())}),u(2,zt,1,2,"span",12)(3,Ht,3,2,"ng-container",2),g(),_(4,"button",11),C("mousedown",function(n){d(e);let o=s();return m(o.onDownButtonMouseDown(n))})("mouseup",function(){d(e);let n=s();return m(n.onDownButtonMouseUp())})("mouseleave",function(){d(e);let n=s();return m(n.onDownButtonMouseLeave())})("keydown",function(n){d(e);let o=s();return m(o.onDownButtonKeyDown(n))})("keyup",function(){d(e);let n=s();return m(n.onDownButtonKeyUp())}),u(5,Ut,1,2,"span",12)(6,Wt,3,2,"ng-container",2),g()()}if(t&2){let e=s();f("data-pc-section","buttonGroup"),p(),D(e.incrementButtonClass),l("ngClass",e._incrementButtonClass)("disabled",e.disabled),f("aria-hidden",!0)("data-pc-section","incrementbutton"),p(),l("ngIf",e.incrementButtonIcon),p(),l("ngIf",!e.incrementButtonIcon),p(),D(e.decrementButtonClass),l("ngClass",e._decrementButtonClass)("disabled",e.disabled),f("aria-hidden",!0)("data-pc-section","decrementbutton"),p(),l("ngIf",e.decrementButtonIcon),p(),l("ngIf",!e.decrementButtonIcon)}}function Yt(t,r){if(t&1&&S(0,"span",13),t&2){let e=s(2);l("ngClass",e.incrementButtonIcon),f("data-pc-section","incrementbuttonicon")}}function Xt(t,r){t&1&&S(0,"AngleUpIcon"),t&2&&f("data-pc-section","incrementbuttonicon")}function en(t,r){}function tn(t,r){t&1&&u(0,en,0,0,"ng-template")}function nn(t,r){if(t&1&&(k(0),u(1,Xt,1,1,"AngleUpIcon",2)(2,tn,1,0,null,9),O()),t&2){let e=s(2);p(),l("ngIf",!e.incrementButtonIconTemplate&&!e._incrementButtonIconTemplate),p(),l("ngTemplateOutlet",e.incrementButtonIconTemplate||e._incrementButtonIconTemplate)}}function on(t,r){if(t&1){let e=v();_(0,"button",11),C("mousedown",function(n){d(e);let o=s();return m(o.onUpButtonMouseDown(n))})("mouseup",function(){d(e);let n=s();return m(n.onUpButtonMouseUp())})("mouseleave",function(){d(e);let n=s();return m(n.onUpButtonMouseLeave())})("keydown",function(n){d(e);let o=s();return m(o.onUpButtonKeyDown(n))})("keyup",function(){d(e);let n=s();return m(n.onUpButtonKeyUp())}),u(1,Yt,1,2,"span",12)(2,nn,3,2,"ng-container",2),g()}if(t&2){let e=s();D(e.incrementButtonClass),l("ngClass",e._incrementButtonClass)("disabled",e.disabled),f("aria-hidden",!0)("data-pc-section","incrementbutton"),p(),l("ngIf",e.incrementButtonIcon),p(),l("ngIf",!e.incrementButtonIcon)}}function an(t,r){if(t&1&&S(0,"span",13),t&2){let e=s(2);l("ngClass",e.decrementButtonIcon),f("data-pc-section","decrementbuttonicon")}}function rn(t,r){t&1&&S(0,"AngleDownIcon"),t&2&&f("data-pc-section","decrementbuttonicon")}function ln(t,r){}function sn(t,r){t&1&&u(0,ln,0,0,"ng-template")}function pn(t,r){if(t&1&&(k(0),u(1,rn,1,1,"AngleDownIcon",2)(2,sn,1,0,null,9),O()),t&2){let e=s(2);p(),l("ngIf",!e.decrementButtonIconTemplate&&!e._decrementButtonIconTemplate),p(),l("ngTemplateOutlet",e.decrementButtonIconTemplate||e._decrementButtonIconTemplate)}}function cn(t,r){if(t&1){let e=v();_(0,"button",11),C("mousedown",function(n){d(e);let o=s();return m(o.onDownButtonMouseDown(n))})("mouseup",function(){d(e);let n=s();return m(n.onDownButtonMouseUp())})("mouseleave",function(){d(e);let n=s();return m(n.onDownButtonMouseLeave())})("keydown",function(n){d(e);let o=s();return m(o.onDownButtonKeyDown(n))})("keyup",function(){d(e);let n=s();return m(n.onDownButtonKeyUp())}),u(1,an,1,2,"span",12)(2,pn,3,2,"ng-container",2),g()}if(t&2){let e=s();D(e.decrementButtonClass),l("ngClass",e._decrementButtonClass)("disabled",e.disabled),f("aria-hidden",!0)("data-pc-section","decrementbutton"),p(),l("ngIf",e.decrementButtonIcon),p(),l("ngIf",!e.decrementButtonIcon)}}var un=({dt:t})=>`
2
2
  .p-inputnumber {
3
3
  display: inline-flex;
4
4
  position: relative;
@@ -1 +1 @@
1
- import{a as O}from"./chunk-I33SFWJL.js";import{h as Q,i as z}from"./chunk-GGEENO4M.js";import"./chunk-6S6Q7SED.js";import{b as H}from"./chunk-APVQGR37.js";import"./chunk-GDLTEIKV.js";import"./chunk-PNVRIGOW.js";import"./chunk-KMVWE6IR.js";import{ga as j,ha as q}from"./chunk-4IJDCXOA.js";import"./chunk-QMH4FATM.js";import"./chunk-SRELAFRM.js";import"./chunk-O4T67QQ3.js";import{a as S}from"./chunk-2FWFPV5I.js";import"./chunk-WUSKRV4R.js";import{D as B,c as k,h as F,o as L}from"./chunk-J577JGRK.js";import"./chunk-RDARJWEZ.js";import"./chunk-JDMYDBXN.js";import"./chunk-EQ6536VC.js";import"./chunk-LQKZB5PG.js";import{$a as s,$b as b,Ib as n,Jb as o,Ma as _,Md as P,Ob as w,Qb as v,Rb as l,Td as V,Uc as R,Wd as N,Xc as A,Zb as y,_b as D,db as g,dc as M,ec as r,hd as E,jc as u,kb as T,kc as h,lc as f,ob as W,pc as I,qb as C,va as m,vb as d,wa as c}from"./chunk-ONCTFURX.js";import"./chunk-7DCB7DB2.js";var Y=["textReceiptCtrl"],G=p=>({"is-invalid":p});function J(p,x){p&1&&(n(0,"small"),r(1,"The text you entered exceeds the maximum allowed size when encoded for WhatsApp."),o())}function K(p,x){if(p&1&&(n(0,"div",25),C(1,J,2,0,"small",26),o()),p&2){let t=l(2);s(),d("ngIf",t.textReceiptInvalidState())}}function X(p,x){if(p&1){let t=w();n(0,"mainpanel-cmp",2)(1,"actions")(2,"button",3),v("click",function(){m(t);let e=l();return c(e.onSubmit("Setup/Configuration/WhatsappConfigurationV2"))}),r(3," Save "),o()(),n(4,"content")(5,"div",4)(6,"div",5)(7,"div",6)(8,"h5"),r(9,"WhatsApp Invoice Settings"),o(),n(10,"i"),r(11," Configure the Twilio settings required to send invoices to customers via WhatsApp. "),o()(),n(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"input",11),f("ngModelChange",function(e){m(t);let a=l();return h(a.formData.WhatsappConfig.AccountSID,e)||(a.formData.WhatsappConfig.AccountSID=e),c(e)}),o(),n(17,"label"),r(18,"Account SID"),o()()(),n(19,"div",9)(20,"div",12)(21,"input",13),f("ngModelChange",function(e){m(t);let a=l();return h(a.formData.WhatsappConfig.AuthToken,e)||(a.formData.WhatsappConfig.AuthToken=e),c(e)}),o(),n(22,"label"),r(23,"Auth Token"),o()()()(),n(24,"div",8)(25,"div",9)(26,"div",14)(27,"input",15),f("ngModelChange",function(e){m(t);let a=l();return h(a.formData.WhatsappConfig.ContentTemplateSID,e)||(a.formData.WhatsappConfig.ContentTemplateSID=e),c(e)}),o(),n(28,"label"),r(29,"Content Template SID"),o()()(),n(30,"div",9)(31,"div",16)(32,"input",17),f("ngModelChange",function(e){m(t);let a=l();return h(a.formData.WhatsappConfig.From,e)||(a.formData.WhatsappConfig.From=e),c(e)}),o(),n(33,"label"),r(34,"From"),o()()()()()(),n(35,"div",5)(36,"div",6)(37,"h5"),r(38,"Whatsapp Receipt Settings"),o(),n(39,"i"),r(40," You can use variables like Number, Currency, Amount, ReceiptLink, and Brand. Please refer this "),n(41,"a",18),r(42,"Article"),o(),r(43," for more information. "),o()(),n(44,"div",7)(45,"div",8)(46,"div",19)(47,"div",20)(48,"textarea",21,0),f("ngModelChange",function(e){m(t);let a=l();return h(a.formData.WhatsappConfig.TextReceipt,e)||(a.formData.WhatsappConfig.TextReceipt=e),c(e)}),v("ngModelChange",function(){m(t);let e=l();return c(e.onTextReceiptChange())}),o(),n(50,"label",22),r(51,"Customize E-Receipt Template"),o(),n(52,"div",23),C(53,K,2,1,"div",24),o()()()()()()()()()}if(p&2){let t=M(49),i=l();d("pageData",i.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),s(2),d("disabled",i.textReceiptInvalidState()),s(14),u("ngModel",i.formData.WhatsappConfig.AccountSID),s(5),u("ngModel",i.formData.WhatsappConfig.AuthToken),s(6),u("ngModel",i.formData.WhatsappConfig.ContentTemplateSID),s(5),u("ngModel",i.formData.WhatsappConfig.From),s(16),u("ngModel",i.formData.WhatsappConfig.TextReceipt),d("ngClass",I(11,G,(i.textReceiptInvalidState()||t.invalid)&&(t.dirty||t.touched))),s(5),d("ngIf",(i.textReceiptInvalidState()||t.invalid)&&(t.dirty||t.touched))}}var U=class p extends O{constructor(t,i,e,a){super(t,i,"Setup/ConfigurationLoader/WhatsappConfigurationV2",e);this.httpService=i;this.activatedRoute=e;this.toaster=a}textReceiptCtrl;maxTextLength=1920;textReceiptInvalidState=_(!1);encodeLength=_(0);postBindForm(t){this.validateTextReceipt(),this.initReceiptTemplateCtrl()}initReceiptTemplateCtrl(){setTimeout(()=>{this.textReceiptCtrl.control.markAllAsTouched()})}validateTextReceipt(){if(!this.formData?.WhatsappConfig?.TextReceipt){this.textReceiptInvalidState.set(!1);return}let t=this.formData.WhatsappConfig?.TextReceipt,i=encodeURIComponent(t)?.length;this.encodeLength.set(i);let e=i>this.maxTextLength;this.textReceiptInvalidState.set(e)}onTextReceiptChange(){if(this.validateTextReceipt(),this.textReceiptCtrl){let t=this.textReceiptInvalidState()||this.textReceiptCtrl.invalid;this.textReceiptInvalidState.set(t)}}onSubmitSuccess(t){t?.MessageWarning?this.toaster.warning(t.MessageWarning,S.Warning):this.toaster.success("Config has been updated succesfully!",S.Success)}static \u0275fac=function(i){return new(i||p)(g(H),g(N),g(P),g(V))};static \u0275cmp=T({type:p,selectors:[["app-whatsapp"]],viewQuery:function(i,e){if(i&1&&y(Y,5),i&2){let a;D(a=b())&&(e.textReceiptCtrl=a.first)}},features:[W],decls:1,vars:1,consts:[["textReceiptCtrl","ngModel"],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button","role","button",1,"btn","btn-success",3,"click","disabled"],[1,"container-fluid","py-5","bg-light-white"],[1,"row","border-bottom","mt-12","ms-2"],[1,"col-md-2"],[1,"col-md-10","mb-5"],[1,"row"],[1,"col-6"],["matTooltip","The unique identifier for your Twilio account, used for authenticating API requests.","matTooltipPosition","above",1,"form-floating-outline"],["type","text","id","AccountSID","name","AccountSID","placeholder","Account SID",1,"form-control",3,"ngModelChange","ngModel"],["matTooltip","The authentication token for secure access to the Twilio API.","matTooltipPosition","above",1,"form-floating-outline"],["type","text","name","AuthToken","placeholder","Auth Token",1,"form-control",3,"ngModelChange","ngModel"],["matTooltip","The unique identifier for the WhatsApp message template to format your invoice content.","matTooltipPosition","above",1,"form-floating-outline"],["type","text","id","ContentTemplateSID","name","ContentTemplateSID","placeholder","Content Template SID",1,"form-control",3,"ngModelChange","ngModel"],["matTooltip","The Twilio-approved WhatsApp number from which invoices will be sent to customers.","matTooltipPosition","above",1,"form-floating-outline"],["type","text","name","From","placeholder","From",1,"form-control",3,"ngModelChange","ngModel"],["href","https://support.dealpos.com/en/articles/10574504-send-customer-invoice-via-whatsapp-receipt-by-whatsapp","target","_blank"],[1,"col-md-12"],[1,"form-floating-outline"],["name","ProductDescription","rows","15","id","ProductDescription","placeholder","Template","matTooltipPosition","above","matTooltip","Customize the e-receipt message sent to the customer's WhatsApp (validation based on encoded byte length)",1,"form-control",3,"ngModelChange","ngModel","ngClass"],["for","ProductDescription"],[1,"d-flex","justify-content-between","mt-1"],["class","text-danger",4,"ngIf"],[1,"text-danger"],[4,"ngIf"]],template:function(i,e){i&1&&C(0,X,54,13,"mainpanel-cmp",1),i&2&&d("ngIf",e.formData)},dependencies:[E,R,A,z,Q,B,k,F,L,q,j],encapsulation:2})};export{U as WhatsappComponent};
1
+ import{a as O}from"./chunk-MZDT5S4Y.js";import{h as Q,i as z}from"./chunk-WPFM3ZGY.js";import"./chunk-CU7IWKXB.js";import{b as H}from"./chunk-XV2R2LYT.js";import"./chunk-GDLTEIKV.js";import"./chunk-PNVRIGOW.js";import"./chunk-KMVWE6IR.js";import{ga as j,ha as q}from"./chunk-4IJDCXOA.js";import"./chunk-QMH4FATM.js";import"./chunk-SRELAFRM.js";import"./chunk-O4T67QQ3.js";import{a as S}from"./chunk-2FWFPV5I.js";import"./chunk-WUSKRV4R.js";import{D as B,c as k,h as F,o as L}from"./chunk-J577JGRK.js";import"./chunk-7P2INFVM.js";import"./chunk-RACFHMSM.js";import"./chunk-EQ6536VC.js";import"./chunk-ZZ33EHCQ.js";import{$a as s,$b as b,Ib as n,Jb as o,Ma as _,Md as P,Ob as w,Qb as v,Rb as l,Td as V,Uc as R,Wd as N,Xc as A,Zb as y,_b as D,db as g,dc as M,ec as r,hd as E,jc as u,kb as T,kc as h,lc as f,ob as W,pc as I,qb as C,va as m,vb as d,wa as c}from"./chunk-ONCTFURX.js";import"./chunk-7DCB7DB2.js";var Y=["textReceiptCtrl"],G=p=>({"is-invalid":p});function J(p,x){p&1&&(n(0,"small"),r(1,"The text you entered exceeds the maximum allowed size when encoded for WhatsApp."),o())}function K(p,x){if(p&1&&(n(0,"div",25),C(1,J,2,0,"small",26),o()),p&2){let t=l(2);s(),d("ngIf",t.textReceiptInvalidState())}}function X(p,x){if(p&1){let t=w();n(0,"mainpanel-cmp",2)(1,"actions")(2,"button",3),v("click",function(){m(t);let e=l();return c(e.onSubmit("Setup/Configuration/WhatsappConfigurationV2"))}),r(3," Save "),o()(),n(4,"content")(5,"div",4)(6,"div",5)(7,"div",6)(8,"h5"),r(9,"WhatsApp Invoice Settings"),o(),n(10,"i"),r(11," Configure the Twilio settings required to send invoices to customers via WhatsApp. "),o()(),n(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"input",11),f("ngModelChange",function(e){m(t);let a=l();return h(a.formData.WhatsappConfig.AccountSID,e)||(a.formData.WhatsappConfig.AccountSID=e),c(e)}),o(),n(17,"label"),r(18,"Account SID"),o()()(),n(19,"div",9)(20,"div",12)(21,"input",13),f("ngModelChange",function(e){m(t);let a=l();return h(a.formData.WhatsappConfig.AuthToken,e)||(a.formData.WhatsappConfig.AuthToken=e),c(e)}),o(),n(22,"label"),r(23,"Auth Token"),o()()()(),n(24,"div",8)(25,"div",9)(26,"div",14)(27,"input",15),f("ngModelChange",function(e){m(t);let a=l();return h(a.formData.WhatsappConfig.ContentTemplateSID,e)||(a.formData.WhatsappConfig.ContentTemplateSID=e),c(e)}),o(),n(28,"label"),r(29,"Content Template SID"),o()()(),n(30,"div",9)(31,"div",16)(32,"input",17),f("ngModelChange",function(e){m(t);let a=l();return h(a.formData.WhatsappConfig.From,e)||(a.formData.WhatsappConfig.From=e),c(e)}),o(),n(33,"label"),r(34,"From"),o()()()()()(),n(35,"div",5)(36,"div",6)(37,"h5"),r(38,"Whatsapp Receipt Settings"),o(),n(39,"i"),r(40," You can use variables like Number, Currency, Amount, ReceiptLink, and Brand. Please refer this "),n(41,"a",18),r(42,"Article"),o(),r(43," for more information. "),o()(),n(44,"div",7)(45,"div",8)(46,"div",19)(47,"div",20)(48,"textarea",21,0),f("ngModelChange",function(e){m(t);let a=l();return h(a.formData.WhatsappConfig.TextReceipt,e)||(a.formData.WhatsappConfig.TextReceipt=e),c(e)}),v("ngModelChange",function(){m(t);let e=l();return c(e.onTextReceiptChange())}),o(),n(50,"label",22),r(51,"Customize E-Receipt Template"),o(),n(52,"div",23),C(53,K,2,1,"div",24),o()()()()()()()()()}if(p&2){let t=M(49),i=l();d("pageData",i.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),s(2),d("disabled",i.textReceiptInvalidState()),s(14),u("ngModel",i.formData.WhatsappConfig.AccountSID),s(5),u("ngModel",i.formData.WhatsappConfig.AuthToken),s(6),u("ngModel",i.formData.WhatsappConfig.ContentTemplateSID),s(5),u("ngModel",i.formData.WhatsappConfig.From),s(16),u("ngModel",i.formData.WhatsappConfig.TextReceipt),d("ngClass",I(11,G,(i.textReceiptInvalidState()||t.invalid)&&(t.dirty||t.touched))),s(5),d("ngIf",(i.textReceiptInvalidState()||t.invalid)&&(t.dirty||t.touched))}}var U=class p extends O{constructor(t,i,e,a){super(t,i,"Setup/ConfigurationLoader/WhatsappConfigurationV2",e);this.httpService=i;this.activatedRoute=e;this.toaster=a}textReceiptCtrl;maxTextLength=1920;textReceiptInvalidState=_(!1);encodeLength=_(0);postBindForm(t){this.validateTextReceipt(),this.initReceiptTemplateCtrl()}initReceiptTemplateCtrl(){setTimeout(()=>{this.textReceiptCtrl.control.markAllAsTouched()})}validateTextReceipt(){if(!this.formData?.WhatsappConfig?.TextReceipt){this.textReceiptInvalidState.set(!1);return}let t=this.formData.WhatsappConfig?.TextReceipt,i=encodeURIComponent(t)?.length;this.encodeLength.set(i);let e=i>this.maxTextLength;this.textReceiptInvalidState.set(e)}onTextReceiptChange(){if(this.validateTextReceipt(),this.textReceiptCtrl){let t=this.textReceiptInvalidState()||this.textReceiptCtrl.invalid;this.textReceiptInvalidState.set(t)}}onSubmitSuccess(t){t?.MessageWarning?this.toaster.warning(t.MessageWarning,S.Warning):this.toaster.success("Config has been updated succesfully!",S.Success)}static \u0275fac=function(i){return new(i||p)(g(H),g(N),g(P),g(V))};static \u0275cmp=T({type:p,selectors:[["app-whatsapp"]],viewQuery:function(i,e){if(i&1&&y(Y,5),i&2){let a;D(a=b())&&(e.textReceiptCtrl=a.first)}},features:[W],decls:1,vars:1,consts:[["textReceiptCtrl","ngModel"],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button","role","button",1,"btn","btn-success",3,"click","disabled"],[1,"container-fluid","py-5","bg-light-white"],[1,"row","border-bottom","mt-12","ms-2"],[1,"col-md-2"],[1,"col-md-10","mb-5"],[1,"row"],[1,"col-6"],["matTooltip","The unique identifier for your Twilio account, used for authenticating API requests.","matTooltipPosition","above",1,"form-floating-outline"],["type","text","id","AccountSID","name","AccountSID","placeholder","Account SID",1,"form-control",3,"ngModelChange","ngModel"],["matTooltip","The authentication token for secure access to the Twilio API.","matTooltipPosition","above",1,"form-floating-outline"],["type","text","name","AuthToken","placeholder","Auth Token",1,"form-control",3,"ngModelChange","ngModel"],["matTooltip","The unique identifier for the WhatsApp message template to format your invoice content.","matTooltipPosition","above",1,"form-floating-outline"],["type","text","id","ContentTemplateSID","name","ContentTemplateSID","placeholder","Content Template SID",1,"form-control",3,"ngModelChange","ngModel"],["matTooltip","The Twilio-approved WhatsApp number from which invoices will be sent to customers.","matTooltipPosition","above",1,"form-floating-outline"],["type","text","name","From","placeholder","From",1,"form-control",3,"ngModelChange","ngModel"],["href","https://support.dealpos.com/en/articles/10574504-send-customer-invoice-via-whatsapp-receipt-by-whatsapp","target","_blank"],[1,"col-md-12"],[1,"form-floating-outline"],["name","ProductDescription","rows","15","id","ProductDescription","placeholder","Template","matTooltipPosition","above","matTooltip","Customize the e-receipt message sent to the customer's WhatsApp (validation based on encoded byte length)",1,"form-control",3,"ngModelChange","ngModel","ngClass"],["for","ProductDescription"],[1,"d-flex","justify-content-between","mt-1"],["class","text-danger",4,"ngIf"],[1,"text-danger"],[4,"ngIf"]],template:function(i,e){i&1&&C(0,X,54,13,"mainpanel-cmp",1),i&2&&d("ngIf",e.formData)},dependencies:[E,R,A,z,Q,B,k,F,L,q,j],encapsulation:2})};export{U as WhatsappComponent};
@@ -1,4 +1,4 @@
1
- import{b as bt}from"./chunk-X3ZDNOUY.js";import{a as ze,b as Oe,c as Be,d as Ve,e as Pe}from"./chunk-NKQB5VVU.js";import{a as _t,b as yt,c as wt,d as Ct}from"./chunk-DWBSJPMC.js";import{d as ft}from"./chunk-7OMZTXCR.js";import{d as mt,e as He}from"./chunk-SEUYLSG6.js";import{b as $e}from"./chunk-YBH7C53G.js";import{b as gt}from"./chunk-I6HQHZRF.js";import{b as pt,e as ut}from"./chunk-GGEENO4M.js";import{a as te,b as _,c as ht}from"./chunk-GDLTEIKV.js";import{a as dt,d as ct}from"./chunk-HLZJPEJB.js";import{a as ee,b as m}from"./chunk-O4T67QQ3.js";import{T as Se,U as be,ca as Z,da as lt,ea as Le,fa as rt,ga as st,ja as X,ka as $,sa as Y}from"./chunk-WUSKRV4R.js";import{D as Te,a as ue,g as nt,h as ot,o as at}from"./chunk-J577JGRK.js";import{$a as s,$b as g,$c as U,Ba as Ue,Db as se,Dc as me,Fa as x,Ga as _e,Gb as Xe,Hb as Ye,Ib as y,Ic as Fe,Jb as w,Ka as he,Kb as S,Kc as f,Lb as k,Lc as O,Mb as M,Nb as C,Ob as q,Pb as et,Qb as z,Rb as p,Uc as pe,Wc as it,Xc as ve,Yb as b,Za as Je,Zb as P,_b as h,_c as xe,d as ie,db as H,dc as Me,ec as we,fc as Ce,hd as J,ia as ne,id as fe,ja as A,ka as oe,kb as E,lb as ae,mb as ye,na as L,nc as W,ob as F,pb as Ze,pc as Q,qb as c,qc as G,sc as De,tc as ce,ua as We,ub as I,uc as ge,va as K,vb as r,vc as tt,wa as N,xa as j,xb as le,yb as re,za as R,zb as D}from"./chunk-ONCTFURX.js";import{a as ke,b as qe}from"./chunk-7DCB7DB2.js";var vt=(()=>{class t extends te{pathId;ngOnInit(){this.pathId="url(#"+Z()+")"}static \u0275fac=(()=>{let e;return function(n){return(e||(e=R(t)))(n||t)}})();static \u0275cmp=E({type:t,selectors:[["FilterIcon"]],features:[F],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M8.64708 14H5.35296C5.18981 13.9979 5.03395 13.9321 4.91858 13.8167C4.8032 13.7014 4.73745 13.5455 4.73531 13.3824V7L0.329431 0.98C0.259794 0.889466 0.217389 0.780968 0.20718 0.667208C0.19697 0.553448 0.219379 0.439133 0.271783 0.337647C0.324282 0.236453 0.403423 0.151519 0.500663 0.0920138C0.597903 0.0325088 0.709548 0.000692754 0.823548 0H13.1765C13.2905 0.000692754 13.4021 0.0325088 13.4994 0.0920138C13.5966 0.151519 13.6758 0.236453 13.7283 0.337647C13.7807 0.439133 13.8031 0.553448 13.7929 0.667208C13.7826 0.780968 13.7402 0.889466 13.6706 0.98L9.26472 7V13.3824C9.26259 13.5455 9.19683 13.7014 9.08146 13.8167C8.96609 13.9321 8.81022 13.9979 8.64708 14ZM5.97061 12.7647H8.02943V6.79412C8.02878 6.66289 8.07229 6.53527 8.15296 6.43177L11.9412 1.23529H2.05884L5.86355 6.43177C5.94422 6.53527 5.98773 6.66289 5.98708 6.79412L5.97061 12.7647Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,n){i&1&&(j(),y(0,"svg",0)(1,"g"),S(2,"path",1),w(),y(3,"defs")(4,"clipPath",2),S(5,"rect",3),w()()()),i&2&&(D(n.getClassNames()),I("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role),s(),I("clip-path",n.pathId),s(3),r("id",n.pathId))},encapsulation:2})}return t})();var xt=(()=>{class t extends te{pathId;ngOnInit(){this.pathId="url(#"+Z()+")"}static \u0275fac=(()=>{let e;return function(n){return(e||(e=R(t)))(n||t)}})();static \u0275cmp=E({type:t,selectors:[["FilterSlashIcon"]],features:[F],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M13.4994 0.0920138C13.5967 0.151519 13.6758 0.236453 13.7283 0.337647C13.7807 0.439133 13.8031 0.553448 13.7929 0.667208C13.7827 0.780968 13.7403 0.889466 13.6707 0.98L11.406 4.06823C11.3099 4.19928 11.1656 4.28679 11.005 4.3115C10.8444 4.33621 10.6805 4.2961 10.5495 4.2C10.4184 4.1039 10.3309 3.95967 10.3062 3.79905C10.2815 3.63843 10.3216 3.47458 10.4177 3.34353L11.9412 1.23529H7.41184C7.24803 1.23529 7.09093 1.17022 6.97509 1.05439C6.85926 0.938558 6.79419 0.781457 6.79419 0.617647C6.79419 0.453837 6.85926 0.296736 6.97509 0.180905C7.09093 0.0650733 7.24803 0 7.41184 0H13.1765C13.2905 0.000692754 13.4022 0.0325088 13.4994 0.0920138ZM4.20008 0.181168H4.24126L13.2013 9.03411C13.3169 9.14992 13.3819 9.3069 13.3819 9.47058C13.3819 9.63426 13.3169 9.79124 13.2013 9.90705C13.1445 9.96517 13.0766 10.0112 13.0016 10.0423C12.9266 10.0735 12.846 10.0891 12.7648 10.0882C12.6836 10.0886 12.6032 10.0728 12.5283 10.0417C12.4533 10.0106 12.3853 9.96479 12.3283 9.90705L9.3142 6.92587L9.26479 6.99999V13.3823C9.26265 13.5455 9.19689 13.7014 9.08152 13.8167C8.96615 13.9321 8.81029 13.9979 8.64714 14H5.35302C5.18987 13.9979 5.03401 13.9321 4.91864 13.8167C4.80327 13.7014 4.73751 13.5455 4.73537 13.3823V6.99999L0.329492 1.02117C0.259855 0.930634 0.21745 0.822137 0.207241 0.708376C0.197031 0.594616 0.21944 0.480301 0.271844 0.378815C0.324343 0.277621 0.403484 0.192687 0.500724 0.133182C0.597964 0.073677 0.709609 0.041861 0.823609 0.0411682H3.86243C3.92448 0.0461551 3.9855 0.060022 4.04361 0.0823446C4.10037 0.10735 4.15311 0.140655 4.20008 0.181168ZM8.02949 6.79411C8.02884 6.66289 8.07235 6.53526 8.15302 6.43176L8.42478 6.05293L3.55773 1.23529H2.0589L5.84714 6.43176C5.92781 6.53526 5.97132 6.66289 5.97067 6.79411V12.7647H8.02949V6.79411Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,n){i&1&&(j(),y(0,"svg",0)(1,"g"),S(2,"path",1),w(),y(3,"defs")(4,"clipPath",2),S(5,"rect",3),w()()()),i&2&&(D(n.getClassNames()),I("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role),s(),I("clip-path",n.pathId),s(3),r("id",n.pathId))},encapsulation:2})}return t})();var Tt=(()=>{class t extends te{pathId;ngOnInit(){this.pathId="url(#"+Z()+")"}static \u0275fac=(()=>{let e;return function(n){return(e||(e=R(t)))(n||t)}})();static \u0275cmp=E({type:t,selectors:[["PlusIcon"]],features:[F],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M7.67742 6.32258V0.677419C7.67742 0.497757 7.60605 0.325452 7.47901 0.198411C7.35197 0.0713707 7.17966 0 7 0C6.82034 0 6.64803 0.0713707 6.52099 0.198411C6.39395 0.325452 6.32258 0.497757 6.32258 0.677419V6.32258H0.677419C0.497757 6.32258 0.325452 6.39395 0.198411 6.52099C0.0713707 6.64803 0 6.82034 0 7C0 7.17966 0.0713707 7.35197 0.198411 7.47901C0.325452 7.60605 0.497757 7.67742 0.677419 7.67742H6.32258V13.3226C6.32492 13.5015 6.39704 13.6725 6.52358 13.799C6.65012 13.9255 6.82106 13.9977 7 14C7.17966 14 7.35197 13.9286 7.47901 13.8016C7.60605 13.6745 7.67742 13.5022 7.67742 13.3226V7.67742H13.3226C13.5022 7.67742 13.6745 7.60605 13.8016 7.47901C13.9286 7.35197 14 7.17966 14 7C13.9977 6.82106 13.9255 6.65012 13.799 6.52358C13.6725 6.39704 13.5015 6.32492 13.3226 6.32258H7.67742Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,n){i&1&&(j(),y(0,"svg",0)(1,"g"),S(2,"path",1),w(),y(3,"defs")(4,"clipPath",2),S(5,"rect",3),w()()()),i&2&&(D(n.getClassNames()),I("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role),s(),I("clip-path",n.pathId),s(3),r("id",n.pathId))},encapsulation:2})}return t})();var St=(()=>{class t extends te{pathId;ngOnInit(){this.pathId="url(#"+Z()+")"}static \u0275fac=(()=>{let e;return function(n){return(e||(e=R(t)))(n||t)}})();static \u0275cmp=E({type:t,selectors:[["TrashIcon"]],features:[F],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.44802 13.9955H10.552C10.8056 14.0129 11.06 13.9797 11.3006 13.898C11.5412 13.8163 11.7632 13.6877 11.9537 13.5196C12.1442 13.3515 12.2995 13.1473 12.4104 12.9188C12.5213 12.6903 12.5858 12.442 12.6 12.1884V4.36041H13.4C13.5591 4.36041 13.7117 4.29722 13.8243 4.18476C13.9368 4.07229 14 3.91976 14 3.76071C14 3.60166 13.9368 3.44912 13.8243 3.33666C13.7117 3.22419 13.5591 3.16101 13.4 3.16101H12.0537C12.0203 3.1557 11.9863 3.15299 11.952 3.15299C11.9178 3.15299 11.8838 3.1557 11.8503 3.16101H11.2285C11.2421 3.10893 11.2487 3.05513 11.248 3.00106V1.80966C11.2171 1.30262 10.9871 0.828306 10.608 0.48989C10.229 0.151475 9.73159 -0.0236625 9.22402 0.00257442H4.77602C4.27251 -0.0171866 3.78126 0.160868 3.40746 0.498617C3.03365 0.836366 2.807 1.30697 2.77602 1.80966V3.00106C2.77602 3.0556 2.78346 3.10936 2.79776 3.16101H0.6C0.521207 3.16101 0.443185 3.17652 0.37039 3.20666C0.297595 3.2368 0.231451 3.28097 0.175736 3.33666C0.120021 3.39235 0.0758251 3.45846 0.0456722 3.53121C0.0155194 3.60397 0 3.68196 0 3.76071C0 3.83946 0.0155194 3.91744 0.0456722 3.9902C0.0758251 4.06296 0.120021 4.12907 0.175736 4.18476C0.231451 4.24045 0.297595 4.28462 0.37039 4.31476C0.443185 4.3449 0.521207 4.36041 0.6 4.36041H1.40002V12.1884C1.41426 12.442 1.47871 12.6903 1.58965 12.9188C1.7006 13.1473 1.85582 13.3515 2.04633 13.5196C2.23683 13.6877 2.45882 13.8163 2.69944 13.898C2.94005 13.9797 3.1945 14.0129 3.44802 13.9955ZM2.60002 4.36041H11.304V12.1884C11.304 12.5163 10.952 12.7961 10.504 12.7961H3.40002C2.97602 12.7961 2.60002 12.5163 2.60002 12.1884V4.36041ZM3.95429 3.16101C3.96859 3.10936 3.97602 3.0556 3.97602 3.00106V1.80966C3.97602 1.48183 4.33602 1.20197 4.77602 1.20197H9.24802C9.66403 1.20197 10.048 1.48183 10.048 1.80966V3.00106C10.0473 3.05515 10.054 3.10896 10.0678 3.16101H3.95429ZM5.57571 10.997C5.41731 10.995 5.26597 10.9311 5.15395 10.8191C5.04193 10.7071 4.97808 10.5558 4.97601 10.3973V6.77517C4.97601 6.61612 5.0392 6.46359 5.15166 6.35112C5.26413 6.23866 5.41666 6.17548 5.57571 6.17548C5.73476 6.17548 5.8873 6.23866 5.99976 6.35112C6.11223 6.46359 6.17541 6.61612 6.17541 6.77517V10.3894C6.17647 10.4688 6.16174 10.5476 6.13208 10.6213C6.10241 10.695 6.05841 10.762 6.00261 10.8186C5.94682 10.8751 5.88035 10.92 5.80707 10.9506C5.73378 10.9813 5.65514 10.9971 5.57571 10.997ZM7.99968 10.8214C8.11215 10.9339 8.26468 10.997 8.42373 10.997C8.58351 10.9949 8.73604 10.93 8.84828 10.8163C8.96052 10.7025 9.02345 10.5491 9.02343 10.3894V6.77517C9.02343 6.61612 8.96025 6.46359 8.84778 6.35112C8.73532 6.23866 8.58278 6.17548 8.42373 6.17548C8.26468 6.17548 8.11215 6.23866 7.99968 6.35112C7.88722 6.46359 7.82404 6.61612 7.82404 6.77517V10.3973C7.82404 10.5564 7.88722 10.7089 7.99968 10.8214Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,n){i&1&&(j(),y(0,"svg",0)(1,"g"),S(2,"path",1),w(),y(3,"defs")(4,"clipPath",2),S(5,"rect",3),w()()()),i&2&&(D(n.getClassNames()),I("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role),s(),I("clip-path",n.pathId),s(3),r("id",n.pathId))},encapsulation:2})}return t})();var Pt=["input"],$t=(t,l,e,i,n)=>({"p-radiobutton p-component":!0,"p-radiobutton-checked":t,"p-disabled":l,"p-variant-filled":e,"p-radiobutton-sm p-inputfield-sm":i,"p-radiobutton-lg p-inputfield-lg":n}),Ht=({dt:t})=>`
1
+ import{b as bt}from"./chunk-X3ZDNOUY.js";import{a as ze,b as Oe,c as Be,d as Ve,e as Pe}from"./chunk-NKQB5VVU.js";import{a as _t,b as yt,c as wt,d as Ct}from"./chunk-5GH2UM6Y.js";import{d as ft}from"./chunk-7OMZTXCR.js";import{d as mt,e as He}from"./chunk-SEUYLSG6.js";import{b as $e}from"./chunk-YBH7C53G.js";import{b as gt}from"./chunk-I6HQHZRF.js";import{b as pt,e as ut}from"./chunk-WPFM3ZGY.js";import{a as te,b as _,c as ht}from"./chunk-GDLTEIKV.js";import{a as dt,d as ct}from"./chunk-HLZJPEJB.js";import{a as ee,b as m}from"./chunk-O4T67QQ3.js";import{T as Se,U as be,ca as Z,da as lt,ea as Le,fa as rt,ga as st,ja as X,ka as $,sa as Y}from"./chunk-WUSKRV4R.js";import{D as Te,a as ue,g as nt,h as ot,o as at}from"./chunk-J577JGRK.js";import{$a as s,$b as g,$c as U,Ba as Ue,Db as se,Dc as me,Fa as x,Ga as _e,Gb as Xe,Hb as Ye,Ib as y,Ic as Fe,Jb as w,Ka as he,Kb as S,Kc as f,Lb as k,Lc as O,Mb as M,Nb as C,Ob as q,Pb as et,Qb as z,Rb as p,Uc as pe,Wc as it,Xc as ve,Yb as b,Za as Je,Zb as P,_b as h,_c as xe,d as ie,db as H,dc as Me,ec as we,fc as Ce,hd as J,ia as ne,id as fe,ja as A,ka as oe,kb as E,lb as ae,mb as ye,na as L,nc as W,ob as F,pb as Ze,pc as Q,qb as c,qc as G,sc as De,tc as ce,ua as We,ub as I,uc as ge,va as K,vb as r,vc as tt,wa as N,xa as j,xb as le,yb as re,za as R,zb as D}from"./chunk-ONCTFURX.js";import{a as ke,b as qe}from"./chunk-7DCB7DB2.js";var vt=(()=>{class t extends te{pathId;ngOnInit(){this.pathId="url(#"+Z()+")"}static \u0275fac=(()=>{let e;return function(n){return(e||(e=R(t)))(n||t)}})();static \u0275cmp=E({type:t,selectors:[["FilterIcon"]],features:[F],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M8.64708 14H5.35296C5.18981 13.9979 5.03395 13.9321 4.91858 13.8167C4.8032 13.7014 4.73745 13.5455 4.73531 13.3824V7L0.329431 0.98C0.259794 0.889466 0.217389 0.780968 0.20718 0.667208C0.19697 0.553448 0.219379 0.439133 0.271783 0.337647C0.324282 0.236453 0.403423 0.151519 0.500663 0.0920138C0.597903 0.0325088 0.709548 0.000692754 0.823548 0H13.1765C13.2905 0.000692754 13.4021 0.0325088 13.4994 0.0920138C13.5966 0.151519 13.6758 0.236453 13.7283 0.337647C13.7807 0.439133 13.8031 0.553448 13.7929 0.667208C13.7826 0.780968 13.7402 0.889466 13.6706 0.98L9.26472 7V13.3824C9.26259 13.5455 9.19683 13.7014 9.08146 13.8167C8.96609 13.9321 8.81022 13.9979 8.64708 14ZM5.97061 12.7647H8.02943V6.79412C8.02878 6.66289 8.07229 6.53527 8.15296 6.43177L11.9412 1.23529H2.05884L5.86355 6.43177C5.94422 6.53527 5.98773 6.66289 5.98708 6.79412L5.97061 12.7647Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,n){i&1&&(j(),y(0,"svg",0)(1,"g"),S(2,"path",1),w(),y(3,"defs")(4,"clipPath",2),S(5,"rect",3),w()()()),i&2&&(D(n.getClassNames()),I("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role),s(),I("clip-path",n.pathId),s(3),r("id",n.pathId))},encapsulation:2})}return t})();var xt=(()=>{class t extends te{pathId;ngOnInit(){this.pathId="url(#"+Z()+")"}static \u0275fac=(()=>{let e;return function(n){return(e||(e=R(t)))(n||t)}})();static \u0275cmp=E({type:t,selectors:[["FilterSlashIcon"]],features:[F],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M13.4994 0.0920138C13.5967 0.151519 13.6758 0.236453 13.7283 0.337647C13.7807 0.439133 13.8031 0.553448 13.7929 0.667208C13.7827 0.780968 13.7403 0.889466 13.6707 0.98L11.406 4.06823C11.3099 4.19928 11.1656 4.28679 11.005 4.3115C10.8444 4.33621 10.6805 4.2961 10.5495 4.2C10.4184 4.1039 10.3309 3.95967 10.3062 3.79905C10.2815 3.63843 10.3216 3.47458 10.4177 3.34353L11.9412 1.23529H7.41184C7.24803 1.23529 7.09093 1.17022 6.97509 1.05439C6.85926 0.938558 6.79419 0.781457 6.79419 0.617647C6.79419 0.453837 6.85926 0.296736 6.97509 0.180905C7.09093 0.0650733 7.24803 0 7.41184 0H13.1765C13.2905 0.000692754 13.4022 0.0325088 13.4994 0.0920138ZM4.20008 0.181168H4.24126L13.2013 9.03411C13.3169 9.14992 13.3819 9.3069 13.3819 9.47058C13.3819 9.63426 13.3169 9.79124 13.2013 9.90705C13.1445 9.96517 13.0766 10.0112 13.0016 10.0423C12.9266 10.0735 12.846 10.0891 12.7648 10.0882C12.6836 10.0886 12.6032 10.0728 12.5283 10.0417C12.4533 10.0106 12.3853 9.96479 12.3283 9.90705L9.3142 6.92587L9.26479 6.99999V13.3823C9.26265 13.5455 9.19689 13.7014 9.08152 13.8167C8.96615 13.9321 8.81029 13.9979 8.64714 14H5.35302C5.18987 13.9979 5.03401 13.9321 4.91864 13.8167C4.80327 13.7014 4.73751 13.5455 4.73537 13.3823V6.99999L0.329492 1.02117C0.259855 0.930634 0.21745 0.822137 0.207241 0.708376C0.197031 0.594616 0.21944 0.480301 0.271844 0.378815C0.324343 0.277621 0.403484 0.192687 0.500724 0.133182C0.597964 0.073677 0.709609 0.041861 0.823609 0.0411682H3.86243C3.92448 0.0461551 3.9855 0.060022 4.04361 0.0823446C4.10037 0.10735 4.15311 0.140655 4.20008 0.181168ZM8.02949 6.79411C8.02884 6.66289 8.07235 6.53526 8.15302 6.43176L8.42478 6.05293L3.55773 1.23529H2.0589L5.84714 6.43176C5.92781 6.53526 5.97132 6.66289 5.97067 6.79411V12.7647H8.02949V6.79411Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,n){i&1&&(j(),y(0,"svg",0)(1,"g"),S(2,"path",1),w(),y(3,"defs")(4,"clipPath",2),S(5,"rect",3),w()()()),i&2&&(D(n.getClassNames()),I("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role),s(),I("clip-path",n.pathId),s(3),r("id",n.pathId))},encapsulation:2})}return t})();var Tt=(()=>{class t extends te{pathId;ngOnInit(){this.pathId="url(#"+Z()+")"}static \u0275fac=(()=>{let e;return function(n){return(e||(e=R(t)))(n||t)}})();static \u0275cmp=E({type:t,selectors:[["PlusIcon"]],features:[F],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M7.67742 6.32258V0.677419C7.67742 0.497757 7.60605 0.325452 7.47901 0.198411C7.35197 0.0713707 7.17966 0 7 0C6.82034 0 6.64803 0.0713707 6.52099 0.198411C6.39395 0.325452 6.32258 0.497757 6.32258 0.677419V6.32258H0.677419C0.497757 6.32258 0.325452 6.39395 0.198411 6.52099C0.0713707 6.64803 0 6.82034 0 7C0 7.17966 0.0713707 7.35197 0.198411 7.47901C0.325452 7.60605 0.497757 7.67742 0.677419 7.67742H6.32258V13.3226C6.32492 13.5015 6.39704 13.6725 6.52358 13.799C6.65012 13.9255 6.82106 13.9977 7 14C7.17966 14 7.35197 13.9286 7.47901 13.8016C7.60605 13.6745 7.67742 13.5022 7.67742 13.3226V7.67742H13.3226C13.5022 7.67742 13.6745 7.60605 13.8016 7.47901C13.9286 7.35197 14 7.17966 14 7C13.9977 6.82106 13.9255 6.65012 13.799 6.52358C13.6725 6.39704 13.5015 6.32492 13.3226 6.32258H7.67742Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,n){i&1&&(j(),y(0,"svg",0)(1,"g"),S(2,"path",1),w(),y(3,"defs")(4,"clipPath",2),S(5,"rect",3),w()()()),i&2&&(D(n.getClassNames()),I("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role),s(),I("clip-path",n.pathId),s(3),r("id",n.pathId))},encapsulation:2})}return t})();var St=(()=>{class t extends te{pathId;ngOnInit(){this.pathId="url(#"+Z()+")"}static \u0275fac=(()=>{let e;return function(n){return(e||(e=R(t)))(n||t)}})();static \u0275cmp=E({type:t,selectors:[["TrashIcon"]],features:[F],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.44802 13.9955H10.552C10.8056 14.0129 11.06 13.9797 11.3006 13.898C11.5412 13.8163 11.7632 13.6877 11.9537 13.5196C12.1442 13.3515 12.2995 13.1473 12.4104 12.9188C12.5213 12.6903 12.5858 12.442 12.6 12.1884V4.36041H13.4C13.5591 4.36041 13.7117 4.29722 13.8243 4.18476C13.9368 4.07229 14 3.91976 14 3.76071C14 3.60166 13.9368 3.44912 13.8243 3.33666C13.7117 3.22419 13.5591 3.16101 13.4 3.16101H12.0537C12.0203 3.1557 11.9863 3.15299 11.952 3.15299C11.9178 3.15299 11.8838 3.1557 11.8503 3.16101H11.2285C11.2421 3.10893 11.2487 3.05513 11.248 3.00106V1.80966C11.2171 1.30262 10.9871 0.828306 10.608 0.48989C10.229 0.151475 9.73159 -0.0236625 9.22402 0.00257442H4.77602C4.27251 -0.0171866 3.78126 0.160868 3.40746 0.498617C3.03365 0.836366 2.807 1.30697 2.77602 1.80966V3.00106C2.77602 3.0556 2.78346 3.10936 2.79776 3.16101H0.6C0.521207 3.16101 0.443185 3.17652 0.37039 3.20666C0.297595 3.2368 0.231451 3.28097 0.175736 3.33666C0.120021 3.39235 0.0758251 3.45846 0.0456722 3.53121C0.0155194 3.60397 0 3.68196 0 3.76071C0 3.83946 0.0155194 3.91744 0.0456722 3.9902C0.0758251 4.06296 0.120021 4.12907 0.175736 4.18476C0.231451 4.24045 0.297595 4.28462 0.37039 4.31476C0.443185 4.3449 0.521207 4.36041 0.6 4.36041H1.40002V12.1884C1.41426 12.442 1.47871 12.6903 1.58965 12.9188C1.7006 13.1473 1.85582 13.3515 2.04633 13.5196C2.23683 13.6877 2.45882 13.8163 2.69944 13.898C2.94005 13.9797 3.1945 14.0129 3.44802 13.9955ZM2.60002 4.36041H11.304V12.1884C11.304 12.5163 10.952 12.7961 10.504 12.7961H3.40002C2.97602 12.7961 2.60002 12.5163 2.60002 12.1884V4.36041ZM3.95429 3.16101C3.96859 3.10936 3.97602 3.0556 3.97602 3.00106V1.80966C3.97602 1.48183 4.33602 1.20197 4.77602 1.20197H9.24802C9.66403 1.20197 10.048 1.48183 10.048 1.80966V3.00106C10.0473 3.05515 10.054 3.10896 10.0678 3.16101H3.95429ZM5.57571 10.997C5.41731 10.995 5.26597 10.9311 5.15395 10.8191C5.04193 10.7071 4.97808 10.5558 4.97601 10.3973V6.77517C4.97601 6.61612 5.0392 6.46359 5.15166 6.35112C5.26413 6.23866 5.41666 6.17548 5.57571 6.17548C5.73476 6.17548 5.8873 6.23866 5.99976 6.35112C6.11223 6.46359 6.17541 6.61612 6.17541 6.77517V10.3894C6.17647 10.4688 6.16174 10.5476 6.13208 10.6213C6.10241 10.695 6.05841 10.762 6.00261 10.8186C5.94682 10.8751 5.88035 10.92 5.80707 10.9506C5.73378 10.9813 5.65514 10.9971 5.57571 10.997ZM7.99968 10.8214C8.11215 10.9339 8.26468 10.997 8.42373 10.997C8.58351 10.9949 8.73604 10.93 8.84828 10.8163C8.96052 10.7025 9.02345 10.5491 9.02343 10.3894V6.77517C9.02343 6.61612 8.96025 6.46359 8.84778 6.35112C8.73532 6.23866 8.58278 6.17548 8.42373 6.17548C8.26468 6.17548 8.11215 6.23866 7.99968 6.35112C7.88722 6.46359 7.82404 6.61612 7.82404 6.77517V10.3973C7.82404 10.5564 7.88722 10.7089 7.99968 10.8214Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,n){i&1&&(j(),y(0,"svg",0)(1,"g"),S(2,"path",1),w(),y(3,"defs")(4,"clipPath",2),S(5,"rect",3),w()()()),i&2&&(D(n.getClassNames()),I("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role),s(),I("clip-path",n.pathId),s(3),r("id",n.pathId))},encapsulation:2})}return t})();var Pt=["input"],$t=(t,l,e,i,n)=>({"p-radiobutton p-component":!0,"p-radiobutton-checked":t,"p-disabled":l,"p-variant-filled":e,"p-radiobutton-sm p-inputfield-sm":i,"p-radiobutton-lg p-inputfield-lg":n}),Ht=({dt:t})=>`
2
2
  .p-radiobutton {
3
3
  position: relative;
4
4
  display: inline-flex;
@@ -1,4 +1,4 @@
1
- import{a as Be}from"./chunk-JLWKTGB2.js";import{a as pt,b as cn}from"./chunk-VOJVVXFT.js";import{a as xe}from"./chunk-QWOCCKBV.js";import{a as mn}from"./chunk-Z5E7LHAD.js";import{a as pn}from"./chunk-KNWBJFC5.js";import{a as sn}from"./chunk-I33SFWJL.js";import{a as ln}from"./chunk-FYGGG2XY.js";import{a as te,b as ne}from"./chunk-IC6A5ZGJ.js";import{b as rn}from"./chunk-R5NT3ETF.js";import{a as ee}from"./chunk-7CXNVAHO.js";import"./chunk-BYXBJQAS.js";import{a as Zt}from"./chunk-2MKL5ANY.js";import{a as on,b as an}from"./chunk-ENRRUPSB.js";import{b as qt,c as jt,d as Qt,e as zt}from"./chunk-N67NWGYA.js";import{a as Jt,b as nn}from"./chunk-I6HQHZRF.js";import{a as Xt}from"./chunk-PEI67MDS.js";import{h as en,i as tn}from"./chunk-GGEENO4M.js";import"./chunk-6S6Q7SED.js";import{b as Wt}from"./chunk-APVQGR37.js";import"./chunk-GDLTEIKV.js";import"./chunk-PNVRIGOW.js";import{K as Ae,w as Gt}from"./chunk-KMVWE6IR.js";import{ga as J,ha as X}from"./chunk-4IJDCXOA.js";import{H as Re,O as ce,P as Yt,o as Kt}from"./chunk-QMH4FATM.js";import"./chunk-SRELAFRM.js";import{a as st}from"./chunk-O4T67QQ3.js";import{a as ve}from"./chunk-2FWFPV5I.js";import{C as lt,G as we,ca as $t,ja as rt,k as Lt,ka as Ve,r as Nt,s as ye,sa as Ut,t as Ht,u as Z}from"./chunk-WUSKRV4R.js";import{D as Bt}from"./chunk-J577JGRK.js";import"./chunk-RDARJWEZ.js";import"./chunk-JDMYDBXN.js";import{a as Pe,d as A}from"./chunk-EQ6536VC.js";import"./chunk-LQKZB5PG.js";import{$a as l,$b as F,$c as $,Db as _,Dc as E,Eb as Ce,Fa as le,Fb as Tt,Gb as se,Hb as pe,Ib as o,Ja as h,Jb as a,Kb as p,Kc as fe,Lb as Ie,Lc as wt,Ma as nt,Mb as Se,Md as Ot,Nb as M,Ob as N,Oc as Vt,Od as Rt,Pd as j,Qb as O,Rb as d,Rd as Q,Sb as ot,Tb as at,Td as At,Uc as q,Wa as vt,Wc as kt,Wd as Oe,Xc as H,Y as _t,Yb as G,Zb as de,_b as D,_c as Dt,aa as tt,ad as Ft,cd as me,db as re,dc as I,ec as m,ed as Y,fa as bt,fc as y,gc as V,hc as It,hd as C,ia as gt,id as Me,ja as Ct,jc as St,ka as ht,kb as g,kc as Et,lb as yt,lc as Pt,na as v,nc as Ee,ob as Te,oc as k,pc as S,qb as u,qc as U,rc as he,t as et,ub as z,ud as Mt,va as P,vb as s,wa as w,xb as Fe,xc as b,yb as xt,yc as x,za as De,zb as it,zc as W}from"./chunk-ONCTFURX.js";import{a as ut,b as dt,j as ft}from"./chunk-7DCB7DB2.js";var un=["content"],hn=["header"],vn=["lefticon"],yn=["righticon"],xn=["closeicon"],dn=["*"];function Tn(t,r){t&1&&M(0)}function In(t,r){if(t&1&&(Ie(0),u(1,Tn,1,0,"ng-container",3),Se()),t&2){let e=d(2);l(),s("ngTemplateOutlet",e.contentTemplate||e._contentTemplate)}}function Sn(t,r){if(t&1&&(o(0,"div",1),at(1),u(2,In,2,1,"ng-container",2),a()),t&2){let e=d();s("hidden",!e.selected),z("id",e.tabView.getTabContentId(e.id))("aria-hidden",!e.selected)("aria-labelledby",e.tabView.getTabHeaderActionId(e.id))("data-pc-name","tabpanel"),l(2),s("ngIf",(e.contentTemplate||e._contentTemplate)&&(e.cache?e.loaded:e.selected))}}var En=["previousicon"],Pn=["nexticon"],wn=["navbar"],Vn=["prevBtn"],kn=["nextBtn"],Dn=["inkbar"],Fn=["elementToObserve"],Mn=t=>({"p-tablist-viewport":t}),On=(t,r)=>({"p-tab":!0,"p-tab-active":t,"p-disabled":r});function Rn(t,r){t&1&&p(0,"ChevronLeftIcon"),t&2&&z("aria-hidden",!0)}function An(t,r){}function Bn(t,r){t&1&&u(0,An,0,0,"ng-template")}function Ln(t,r){if(t&1){let e=N();o(0,"button",12,3),O("click",function(){P(e);let n=d();return w(n.navBackward())}),u(2,Rn,1,1,"ChevronLeftIcon",13)(3,Bn,1,0,null,14),a()}if(t&2){let e=d();z("tabindex",e.tabindex)("aria-label",e.prevButtonAriaLabel),l(2),s("ngIf",!e.previousIconTemplate&&!e._previousIconTemplate),l(),s("ngTemplateOutlet",e.previousIconTemplate&&e._previousIconTemplate)}}function Nn(t,r){t&1&&M(0)}function Hn(t,r){if(t&1&&u(0,Nn,1,0,"ng-container",14),t&2){let e=d(2).$implicit;s("ngTemplateOutlet",e.headerTemplate||e._headerTemplate)}}function $n(t,r){}function Un(t,r){t&1&&u(0,$n,0,0,"ng-template")}function qn(t,r){if(t&1&&u(0,Un,1,0,null,14),t&2){let e=d(3).$implicit;s("ngTemplateOutlet",e.leftIconTemplate||e._leftIconTemplate)}}function jn(t,r){if(t&1&&p(0,"span",17),t&2){let e=d(3).$implicit;s("ngClass",e.leftIcon)}}function Qn(t,r){}function zn(t,r){t&1&&u(0,Qn,0,0,"ng-template")}function Gn(t,r){if(t&1&&u(0,zn,1,0,null,14),t&2){let e=d(3).$implicit;s("ngTemplateOutlet",e.rightIconTemplate||e._rightIconTemplate)}}function Wn(t,r){if(t&1&&p(0,"span",18),t&2){let e=d(3).$implicit;s("ngClass",e.rightIcon)}}function Kn(t,r){}function Yn(t,r){t&1&&u(0,Kn,0,0,"ng-template")}function Zn(t,r){if(t&1&&u(0,Yn,1,0,null,14),t&2){let e=d(4).$implicit;s("ngTemplateOutlet",e.closeIconTemplate||e._closeIconTemplate)}}function Jn(t,r){if(t&1){let e=N();o(0,"TimesIcon",19),O("click",function(n){P(e);let c=d(4).$implicit,f=d();return w(f.close(n,c))}),a()}}function Xn(t,r){if(t&1&&u(0,Zn,1,1)(1,Jn,1,0,"TimesIcon"),t&2){let e=d(3).$implicit;_(e.closeIconTemplate||e._closeIconTemplate?0:1)}}function ei(t,r){if(t&1&&(u(0,qn,1,1)(1,jn,1,1,"span",17),m(2),u(3,Gn,1,1)(4,Wn,1,1,"span",18)(5,Xn,2,1)),t&2){let e=d(2).$implicit;_(e.leftIconTemplate||e._leftIconTemplate?0:e.leftIcon&&!e.leftIconTemplate&&!e._leftIconTemplate?1:-1),l(2),V(" ",e.header," "),l(),_(e.rightIconTemplate||e._rightIconTemplate?3:e.rightIcon&&!e.rightIconTemplate&&!e._rightIconTemplate?4:-1),l(2),_(e.closable?5:-1)}}function ti(t,r){if(t&1){let e=N();o(0,"button",15),O("click",function(n){P(e);let c=d().$implicit,f=d();return w(f.open(n,c))})("keydown",function(n){P(e);let c=d().$implicit,f=d();return w(f.onTabKeyDown(n,c))}),u(1,Hn,1,1,"ng-container")(2,ei,6,4),a(),p(3,"span",16,4)}if(t&2){let e=d(),i=e.$implicit,n=e.$index,c=d();it(i.headerStyleClass),s("ngClass",U(22,On,i.selected,i.disabled))("ngStyle",i.headerStyle)("pTooltip",i.tooltip)("tooltipPosition",i.tooltipPosition)("positionStyle",i.tooltipPositionStyle)("tooltipStyleClass",i.tooltipStyleClass)("disabled",i.disabled),z("role","tab")("id",c.getTabHeaderActionId(i.id))("aria-controls",c.getTabContentId(i.id))("aria-selected",i.selected)("tabindex",i.disabled||!i.selected?"-1":c.tabindex)("aria-disabled",i.disabled)("data-pc-index",n)("data-p-disabled",i.disabled)("data-pc-section","headeraction")("data-p-active",i.selected),l(),_(i.headerTemplate||i._headerTemplate?1:2),l(2),z("aria-hidden",!0)("data-pc-section","inkbar")}}function ni(t,r){if(t&1&&u(0,ti,5,25),t&2){let e=r.$implicit;_(e.closed?-1:0)}}function ii(t,r){}function oi(t,r){t&1&&u(0,ii,0,0,"ng-template")}function ai(t,r){if(t&1&&u(0,oi,1,0,null,14),t&2){let e=d(2);s("ngTemplateOutlet",e.nextIconTemplate||e._nextIconTemplate)}}function li(t,r){t&1&&p(0,"ChevronRightIcon"),t&2&&z("aria-hidden",!0)}function ri(t,r){if(t&1){let e=N();o(0,"button",20,5),O("click",function(){P(e);let n=d();return w(n.navForward())}),u(2,ai,1,1)(3,li,1,1,"ChevronRightIcon"),a()}if(t&2){let e=d();z("tabindex",e.tabindex)("aria-label",e.nextButtonAriaLabel),l(2),_(e.nextIconTemplate||e._nextIconTemplate?2:3)}}var si=({dt:t})=>`
1
+ import{a as Be}from"./chunk-JLWKTGB2.js";import{a as pt,b as cn}from"./chunk-VOJVVXFT.js";import{a as xe}from"./chunk-QWOCCKBV.js";import{a as mn}from"./chunk-Z5E7LHAD.js";import{a as pn}from"./chunk-KNWBJFC5.js";import{a as sn}from"./chunk-MZDT5S4Y.js";import{a as ln}from"./chunk-FYGGG2XY.js";import{a as te,b as ne}from"./chunk-IC6A5ZGJ.js";import{b as rn}from"./chunk-R5NT3ETF.js";import{a as ee}from"./chunk-7CXNVAHO.js";import"./chunk-BYXBJQAS.js";import{a as Zt}from"./chunk-2MKL5ANY.js";import{a as on,b as an}from"./chunk-ENRRUPSB.js";import{b as qt,c as jt,d as Qt,e as zt}from"./chunk-N67NWGYA.js";import{a as Jt,b as nn}from"./chunk-I6HQHZRF.js";import{a as Xt}from"./chunk-PEI67MDS.js";import{h as en,i as tn}from"./chunk-WPFM3ZGY.js";import"./chunk-CU7IWKXB.js";import{b as Wt}from"./chunk-XV2R2LYT.js";import"./chunk-GDLTEIKV.js";import"./chunk-PNVRIGOW.js";import{K as Ae,w as Gt}from"./chunk-KMVWE6IR.js";import{ga as J,ha as X}from"./chunk-4IJDCXOA.js";import{H as Re,O as ce,P as Yt,o as Kt}from"./chunk-QMH4FATM.js";import"./chunk-SRELAFRM.js";import{a as st}from"./chunk-O4T67QQ3.js";import{a as ve}from"./chunk-2FWFPV5I.js";import{C as lt,G as we,ca as $t,ja as rt,k as Lt,ka as Ve,r as Nt,s as ye,sa as Ut,t as Ht,u as Z}from"./chunk-WUSKRV4R.js";import{D as Bt}from"./chunk-J577JGRK.js";import"./chunk-7P2INFVM.js";import"./chunk-RACFHMSM.js";import{a as Pe,d as A}from"./chunk-EQ6536VC.js";import"./chunk-ZZ33EHCQ.js";import{$a as l,$b as F,$c as $,Db as _,Dc as E,Eb as Ce,Fa as le,Fb as Tt,Gb as se,Hb as pe,Ib as o,Ja as h,Jb as a,Kb as p,Kc as fe,Lb as Ie,Lc as wt,Ma as nt,Mb as Se,Md as Ot,Nb as M,Ob as N,Oc as Vt,Od as Rt,Pd as j,Qb as O,Rb as d,Rd as Q,Sb as ot,Tb as at,Td as At,Uc as q,Wa as vt,Wc as kt,Wd as Oe,Xc as H,Y as _t,Yb as G,Zb as de,_b as D,_c as Dt,aa as tt,ad as Ft,cd as me,db as re,dc as I,ec as m,ed as Y,fa as bt,fc as y,gc as V,hc as It,hd as C,ia as gt,id as Me,ja as Ct,jc as St,ka as ht,kb as g,kc as Et,lb as yt,lc as Pt,na as v,nc as Ee,ob as Te,oc as k,pc as S,qb as u,qc as U,rc as he,t as et,ub as z,ud as Mt,va as P,vb as s,wa as w,xb as Fe,xc as b,yb as xt,yc as x,za as De,zb as it,zc as W}from"./chunk-ONCTFURX.js";import{a as ut,b as dt,j as ft}from"./chunk-7DCB7DB2.js";var un=["content"],hn=["header"],vn=["lefticon"],yn=["righticon"],xn=["closeicon"],dn=["*"];function Tn(t,r){t&1&&M(0)}function In(t,r){if(t&1&&(Ie(0),u(1,Tn,1,0,"ng-container",3),Se()),t&2){let e=d(2);l(),s("ngTemplateOutlet",e.contentTemplate||e._contentTemplate)}}function Sn(t,r){if(t&1&&(o(0,"div",1),at(1),u(2,In,2,1,"ng-container",2),a()),t&2){let e=d();s("hidden",!e.selected),z("id",e.tabView.getTabContentId(e.id))("aria-hidden",!e.selected)("aria-labelledby",e.tabView.getTabHeaderActionId(e.id))("data-pc-name","tabpanel"),l(2),s("ngIf",(e.contentTemplate||e._contentTemplate)&&(e.cache?e.loaded:e.selected))}}var En=["previousicon"],Pn=["nexticon"],wn=["navbar"],Vn=["prevBtn"],kn=["nextBtn"],Dn=["inkbar"],Fn=["elementToObserve"],Mn=t=>({"p-tablist-viewport":t}),On=(t,r)=>({"p-tab":!0,"p-tab-active":t,"p-disabled":r});function Rn(t,r){t&1&&p(0,"ChevronLeftIcon"),t&2&&z("aria-hidden",!0)}function An(t,r){}function Bn(t,r){t&1&&u(0,An,0,0,"ng-template")}function Ln(t,r){if(t&1){let e=N();o(0,"button",12,3),O("click",function(){P(e);let n=d();return w(n.navBackward())}),u(2,Rn,1,1,"ChevronLeftIcon",13)(3,Bn,1,0,null,14),a()}if(t&2){let e=d();z("tabindex",e.tabindex)("aria-label",e.prevButtonAriaLabel),l(2),s("ngIf",!e.previousIconTemplate&&!e._previousIconTemplate),l(),s("ngTemplateOutlet",e.previousIconTemplate&&e._previousIconTemplate)}}function Nn(t,r){t&1&&M(0)}function Hn(t,r){if(t&1&&u(0,Nn,1,0,"ng-container",14),t&2){let e=d(2).$implicit;s("ngTemplateOutlet",e.headerTemplate||e._headerTemplate)}}function $n(t,r){}function Un(t,r){t&1&&u(0,$n,0,0,"ng-template")}function qn(t,r){if(t&1&&u(0,Un,1,0,null,14),t&2){let e=d(3).$implicit;s("ngTemplateOutlet",e.leftIconTemplate||e._leftIconTemplate)}}function jn(t,r){if(t&1&&p(0,"span",17),t&2){let e=d(3).$implicit;s("ngClass",e.leftIcon)}}function Qn(t,r){}function zn(t,r){t&1&&u(0,Qn,0,0,"ng-template")}function Gn(t,r){if(t&1&&u(0,zn,1,0,null,14),t&2){let e=d(3).$implicit;s("ngTemplateOutlet",e.rightIconTemplate||e._rightIconTemplate)}}function Wn(t,r){if(t&1&&p(0,"span",18),t&2){let e=d(3).$implicit;s("ngClass",e.rightIcon)}}function Kn(t,r){}function Yn(t,r){t&1&&u(0,Kn,0,0,"ng-template")}function Zn(t,r){if(t&1&&u(0,Yn,1,0,null,14),t&2){let e=d(4).$implicit;s("ngTemplateOutlet",e.closeIconTemplate||e._closeIconTemplate)}}function Jn(t,r){if(t&1){let e=N();o(0,"TimesIcon",19),O("click",function(n){P(e);let c=d(4).$implicit,f=d();return w(f.close(n,c))}),a()}}function Xn(t,r){if(t&1&&u(0,Zn,1,1)(1,Jn,1,0,"TimesIcon"),t&2){let e=d(3).$implicit;_(e.closeIconTemplate||e._closeIconTemplate?0:1)}}function ei(t,r){if(t&1&&(u(0,qn,1,1)(1,jn,1,1,"span",17),m(2),u(3,Gn,1,1)(4,Wn,1,1,"span",18)(5,Xn,2,1)),t&2){let e=d(2).$implicit;_(e.leftIconTemplate||e._leftIconTemplate?0:e.leftIcon&&!e.leftIconTemplate&&!e._leftIconTemplate?1:-1),l(2),V(" ",e.header," "),l(),_(e.rightIconTemplate||e._rightIconTemplate?3:e.rightIcon&&!e.rightIconTemplate&&!e._rightIconTemplate?4:-1),l(2),_(e.closable?5:-1)}}function ti(t,r){if(t&1){let e=N();o(0,"button",15),O("click",function(n){P(e);let c=d().$implicit,f=d();return w(f.open(n,c))})("keydown",function(n){P(e);let c=d().$implicit,f=d();return w(f.onTabKeyDown(n,c))}),u(1,Hn,1,1,"ng-container")(2,ei,6,4),a(),p(3,"span",16,4)}if(t&2){let e=d(),i=e.$implicit,n=e.$index,c=d();it(i.headerStyleClass),s("ngClass",U(22,On,i.selected,i.disabled))("ngStyle",i.headerStyle)("pTooltip",i.tooltip)("tooltipPosition",i.tooltipPosition)("positionStyle",i.tooltipPositionStyle)("tooltipStyleClass",i.tooltipStyleClass)("disabled",i.disabled),z("role","tab")("id",c.getTabHeaderActionId(i.id))("aria-controls",c.getTabContentId(i.id))("aria-selected",i.selected)("tabindex",i.disabled||!i.selected?"-1":c.tabindex)("aria-disabled",i.disabled)("data-pc-index",n)("data-p-disabled",i.disabled)("data-pc-section","headeraction")("data-p-active",i.selected),l(),_(i.headerTemplate||i._headerTemplate?1:2),l(2),z("aria-hidden",!0)("data-pc-section","inkbar")}}function ni(t,r){if(t&1&&u(0,ti,5,25),t&2){let e=r.$implicit;_(e.closed?-1:0)}}function ii(t,r){}function oi(t,r){t&1&&u(0,ii,0,0,"ng-template")}function ai(t,r){if(t&1&&u(0,oi,1,0,null,14),t&2){let e=d(2);s("ngTemplateOutlet",e.nextIconTemplate||e._nextIconTemplate)}}function li(t,r){t&1&&p(0,"ChevronRightIcon"),t&2&&z("aria-hidden",!0)}function ri(t,r){if(t&1){let e=N();o(0,"button",20,5),O("click",function(){P(e);let n=d();return w(n.navForward())}),u(2,ai,1,1)(3,li,1,1,"ChevronRightIcon"),a()}if(t&2){let e=d();z("tabindex",e.tabindex)("aria-label",e.nextButtonAriaLabel),l(2),_(e.nextIconTemplate||e._nextIconTemplate?2:3)}}var si=({dt:t})=>`
2
2
  .p-tabs {
3
3
  display: flex;
4
4
  flex-direction: column;