dealpos 25.32.0 → 25.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/browser/{chunk-U4E4GFA3.js → chunk-3BKJB4EB.js} +1 -1
  2. package/browser/{chunk-NVZO3MOZ.js → chunk-3HGB2KX7.js} +1 -1
  3. package/browser/{chunk-AU5NSB5E.js → chunk-3IE46WQL.js} +2 -2
  4. package/browser/{chunk-ZTCHNGR5.js → chunk-42NI5Y2B.js} +1 -1
  5. package/browser/{chunk-7ZF6XZWY.js → chunk-4D6P6ZN5.js} +1 -1
  6. package/browser/{chunk-X7I2U4GR.js → chunk-4O6KU55Y.js} +2 -2
  7. package/browser/{chunk-DBK7DX7N.js → chunk-5MDQYEMB.js} +1 -1
  8. package/browser/{chunk-X6OU5HV5.js → chunk-6S6Q7SED.js} +1 -1
  9. package/browser/{chunk-H73MVYHX.js → chunk-6VQ2WO2R.js} +1 -1
  10. package/browser/{chunk-RIGRHB27.js → chunk-6ZHV4H72.js} +2 -2
  11. package/browser/{chunk-UWM724IJ.js → chunk-A7WBJIJP.js} +1 -1
  12. package/browser/{chunk-2SAQDBKA.js → chunk-APVQGR37.js} +1 -1
  13. package/browser/{chunk-75MGYBWY.js → chunk-B7VLDW2D.js} +1 -1
  14. package/browser/{chunk-P23T2EVP.js → chunk-BAW2PCX4.js} +1 -1
  15. package/browser/{chunk-X7J7XCND.js → chunk-BL367NTS.js} +1 -1
  16. package/browser/{chunk-EANKU65K.js → chunk-CZ7F77ZP.js} +1 -1
  17. package/browser/{chunk-QYVR6FKS.js → chunk-DDVWUPV6.js} +1 -1
  18. package/browser/{chunk-BR7ZRI7I.js → chunk-DJA3CX47.js} +1 -1
  19. package/browser/{chunk-HWY3QH6A.js → chunk-DWBSJPMC.js} +1 -1
  20. package/browser/{chunk-KO5IVQZS.js → chunk-DZG3LGZ3.js} +1 -1
  21. package/browser/{chunk-OVRODHEF.js → chunk-EAPNMYHA.js} +1 -1
  22. package/browser/{chunk-D6K7GLV2.js → chunk-ERJFDQFX.js} +1 -1
  23. package/browser/{chunk-UUN5OBN5.js → chunk-F6ZI74HP.js} +1 -1
  24. package/browser/{chunk-WMDD6KTG.js → chunk-GFYZWIV4.js} +1 -1
  25. package/browser/{chunk-Q45IFUGA.js → chunk-GGEENO4M.js} +1 -1
  26. package/browser/{chunk-CNMEDN2J.js → chunk-GLZMFXE6.js} +2 -2
  27. package/browser/{chunk-GIBMYPUI.js → chunk-GPYDY4KE.js} +1 -1
  28. package/browser/{chunk-KTYLKTKA.js → chunk-HT7MBQYU.js} +1 -1
  29. package/browser/{chunk-U6AHQ7OA.js → chunk-I33SFWJL.js} +1 -1
  30. package/browser/{chunk-26RWIMQI.js → chunk-IHY7TFGQ.js} +5 -5
  31. package/browser/{chunk-S6XWBUA5.js → chunk-JCJZ6B6B.js} +1 -1
  32. package/browser/{chunk-VUVNZP6V.js → chunk-JDMYDBXN.js} +1 -1
  33. package/browser/{chunk-35BXZ4TH.js → chunk-JY4TU5LB.js} +1 -1
  34. package/browser/{chunk-7JLLV4R2.js → chunk-K25WE32L.js} +1 -1
  35. package/browser/{chunk-YQM3WRXG.js → chunk-KBE7CFXH.js} +1 -1
  36. package/browser/{chunk-DZPKIRUW.js → chunk-KFV3U2MG.js} +1 -1
  37. package/browser/{chunk-TLVGFFQE.js → chunk-KU2S24JO.js} +1 -1
  38. package/browser/{chunk-IXN5A6FJ.js → chunk-LB5S2KZX.js} +1 -1
  39. package/browser/{chunk-5W2FAFPB.js → chunk-LQKZB5PG.js} +1 -1
  40. package/browser/{chunk-VWM4STKR.js → chunk-LWWP5RGP.js} +1 -1
  41. package/browser/{chunk-CIEKEDPX.js → chunk-MA64N42O.js} +1 -1
  42. package/browser/{chunk-KJGIGEWE.js → chunk-MBSLDPJK.js} +1 -1
  43. package/browser/{chunk-N6VH67NA.js → chunk-MW5P4LM5.js} +1 -1
  44. package/browser/{chunk-CSPZYSGN.js → chunk-N66KZGXZ.js} +1 -1
  45. package/browser/{chunk-35MHVXKF.js → chunk-OM6SJITM.js} +1 -1
  46. package/browser/{chunk-4746NLIA.js → chunk-PFK4WL2H.js} +1 -1
  47. package/browser/{chunk-DS5ZUU74.js → chunk-PGQ4D2W6.js} +1 -1
  48. package/browser/{chunk-YF5Z2Q2D.js → chunk-PKRNN3GZ.js} +1 -1
  49. package/browser/{chunk-UP2OTHWF.js → chunk-QUWHJ3A2.js} +3 -3
  50. package/browser/{chunk-TTBALV7Z.js → chunk-RAKPTR5Z.js} +1 -1
  51. package/browser/{chunk-WULI4TL4.js → chunk-RDARJWEZ.js} +1 -1
  52. package/browser/{chunk-JBDCESLL.js → chunk-RJVF37GS.js} +1 -1
  53. package/browser/{chunk-5VBPLGVM.js → chunk-RSSYP5IL.js} +1 -1
  54. package/browser/{chunk-ALON6KSY.js → chunk-RTJEAKQW.js} +1 -1
  55. package/browser/{chunk-ZB4GWUQV.js → chunk-RVN4YQAX.js} +1 -1
  56. package/browser/{chunk-7PVGAJ73.js → chunk-SG2RKHTW.js} +1 -1
  57. package/browser/{chunk-5FA5XUCV.js → chunk-SL4VOAHY.js} +2 -2
  58. package/browser/{chunk-ZYLRH43R.js → chunk-TUL555Y3.js} +1 -1
  59. package/browser/chunk-UFHFKY4U.js +2 -0
  60. package/browser/{chunk-2TWP52P7.js → chunk-UZGPU4VW.js} +1 -1
  61. package/browser/{chunk-EL2PFWZR.js → chunk-VVYAL6Y7.js} +1 -1
  62. package/browser/{chunk-YH6FQJMF.js → chunk-WFX2XCFO.js} +1 -1
  63. package/browser/{chunk-P3YO27X5.js → chunk-WMOWM6XW.js} +1 -1
  64. package/browser/{chunk-5H4KL2KJ.js → chunk-WP4PM74K.js} +1 -1
  65. package/browser/{chunk-KTMKLUKP.js → chunk-WYO3ICL4.js} +1 -1
  66. package/browser/{chunk-FWKNIZZ3.js → chunk-XDPWF5CB.js} +1 -1
  67. package/browser/{chunk-WYYDJSSS.js → chunk-ZNWP7UK2.js} +1 -1
  68. package/browser/{chunk-U765C72H.js → chunk-ZSBJ4BDP.js} +1 -1
  69. package/browser/index.html +2 -2
  70. package/browser/{main-ZYWB664N.js → main-Q6EK5PKL.js} +2 -2
  71. package/package.json +1 -1
  72. package/browser/chunk-TTISSB2D.js +0 -2
@@ -1 +1 @@
1
- import{h as z,i as S}from"./chunk-Q45IFUGA.js";import"./chunk-X6OU5HV5.js";import"./chunk-GDLTEIKV.js";import"./chunk-PNVRIGOW.js";import"./chunk-KMVWE6IR.js";import"./chunk-4IJDCXOA.js";import"./chunk-QMH4FATM.js";import"./chunk-SRELAFRM.js";import"./chunk-O4T67QQ3.js";import"./chunk-2FWFPV5I.js";import"./chunk-WUSKRV4R.js";import"./chunk-J577JGRK.js";import"./chunk-WULI4TL4.js";import"./chunk-VUVNZP6V.js";import"./chunk-EQ6536VC.js";import"./chunk-5W2FAFPB.js";import{$a as p,Ib as o,Jb as i,Kb as g,Od as x,Rd as l,db as d,ec as r,fc as v,hd as M,ka as a,kb as h,lb as s,vb as f}from"./chunk-ONCTFURX.js";import"./chunk-7DCB7DB2.js";var m=class e{constructor(n){this.router=n;console.log(this.router.getCurrentNavigation()),console.log(this.router.lastSuccessfulNavigation),this.previousPage=this.router.lastSuccessfulNavigation?.finalUrl?.root?.children?.primary?.segments?.join("/"),this.role=this.router.getCurrentNavigation()?.extras?.state.role??localStorage.getItem("role"),localStorage.setItem("role",this.role),console.log(this.previousPage)}previousPage="";role="";menuData={H:"Unauthorized"};static \u0275fac=function(t){return new(t||e)(d(x))};static \u0275cmp=h({type:e,selectors:[["POS-unauthorized"]],standalone:!1,decls:13,vars:4,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"d-flex","align-items-center","justify-content-center","mt-8",2,"height","350px"],[1,"text-center"],["src","https://res.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",2,"width","200px"],[1,"mt-2","mb-6"],[1,"fw-bold"]],template:function(t,c){t&1&&(o(0,"mainpanel-cmp",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div"),g(5,"img",3),i(),o(6,"h1",4),r(7,"You are not authorized"),i(),o(8,"p"),r(9," This page require "),o(10,"span",5),r(11),i(),r(12," role. Please contact your Administrator to gain access! "),i()()()()()),t&2&&(f("pageData",c.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),p(11),v(c.role))},dependencies:[z],encapsulation:2})};var D=[{path:"Main/Unauthorized",component:m},{path:"",redirectTo:"Main/Unauthorized",pathMatch:"full"}],u=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=s({type:e});static \u0275inj=a({imports:[l.forChild(D),l]})};var y=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=s({type:e});static \u0275inj=a({imports:[M,u,S]})};export{y as UnauthorizedModule};
1
+ import{h as z,i as S}from"./chunk-GGEENO4M.js";import"./chunk-6S6Q7SED.js";import"./chunk-GDLTEIKV.js";import"./chunk-PNVRIGOW.js";import"./chunk-KMVWE6IR.js";import"./chunk-4IJDCXOA.js";import"./chunk-QMH4FATM.js";import"./chunk-SRELAFRM.js";import"./chunk-O4T67QQ3.js";import"./chunk-2FWFPV5I.js";import"./chunk-WUSKRV4R.js";import"./chunk-J577JGRK.js";import"./chunk-RDARJWEZ.js";import"./chunk-JDMYDBXN.js";import"./chunk-EQ6536VC.js";import"./chunk-LQKZB5PG.js";import{$a as p,Ib as o,Jb as i,Kb as g,Od as x,Rd as l,db as d,ec as r,fc as v,hd as M,ka as a,kb as h,lb as s,vb as f}from"./chunk-ONCTFURX.js";import"./chunk-7DCB7DB2.js";var m=class e{constructor(n){this.router=n;console.log(this.router.getCurrentNavigation()),console.log(this.router.lastSuccessfulNavigation),this.previousPage=this.router.lastSuccessfulNavigation?.finalUrl?.root?.children?.primary?.segments?.join("/"),this.role=this.router.getCurrentNavigation()?.extras?.state.role??localStorage.getItem("role"),localStorage.setItem("role",this.role),console.log(this.previousPage)}previousPage="";role="";menuData={H:"Unauthorized"};static \u0275fac=function(t){return new(t||e)(d(x))};static \u0275cmp=h({type:e,selectors:[["POS-unauthorized"]],standalone:!1,decls:13,vars:4,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"d-flex","align-items-center","justify-content-center","mt-8",2,"height","350px"],[1,"text-center"],["src","https://res.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",2,"width","200px"],[1,"mt-2","mb-6"],[1,"fw-bold"]],template:function(t,c){t&1&&(o(0,"mainpanel-cmp",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div"),g(5,"img",3),i(),o(6,"h1",4),r(7,"You are not authorized"),i(),o(8,"p"),r(9," This page require "),o(10,"span",5),r(11),i(),r(12," role. Please contact your Administrator to gain access! "),i()()()()()),t&2&&(f("pageData",c.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),p(11),v(c.role))},dependencies:[z],encapsulation:2})};var D=[{path:"Main/Unauthorized",component:m},{path:"",redirectTo:"Main/Unauthorized",pathMatch:"full"}],u=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=s({type:e});static \u0275inj=a({imports:[l.forChild(D),l]})};var y=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=s({type:e});static \u0275inj=a({imports:[M,u,S]})};export{y as UnauthorizedModule};
@@ -1 +1 @@
1
- import{a as b}from"./chunk-VUVNZP6V.js";import{a as p,d as T,e as R}from"./chunk-EQ6536VC.js";import{Od as v,Pa as S,Qc as d,Wd as k,fa as h,id as I,ja as u,ma as c}from"./chunk-ONCTFURX.js";var U=(o=>(o[o.PAID=0]="PAID",o[o.OVERDUE=1]="OVERDUE",o[o.SELL_ONLY=2]="SELL_ONLY",o[o.SUSPENDED=3]="SUSPENDED",o))(U||{});var y=(()=>{class n{constructor(e,i){this.document=e,this.platformId=i,this.documentIsAccessible=I(this.platformId)}static getCookieRegExp(e){let i=e.replace(/([\[\]{}()|=;+?,.*^$])/gi,"\\$1");return new RegExp("(?:^"+i+"|;\\s*"+i+")=(.*?)(?:;|$)","g")}static safeDecodeURIComponent(e){try{return decodeURIComponent(e)}catch{return e}}check(e){return this.documentIsAccessible?(e=encodeURIComponent(e),n.getCookieRegExp(e).test(this.document.cookie)):!1}get(e){if(this.check(e)){e=encodeURIComponent(e);let o=n.getCookieRegExp(e).exec(this.document.cookie);return o&&o[1]?n.safeDecodeURIComponent(o[1]):""}else return""}getAll(){if(!this.documentIsAccessible)return{};let e={},i=this.document;return i.cookie&&i.cookie!==""&&i.cookie.split(";").forEach(o=>{let[a,s]=o.split("=");e[n.safeDecodeURIComponent(a.replace(/^ /,""))]=n.safeDecodeURIComponent(s)}),e}set(e,i,o,a,s,m,f,D){if(!this.documentIsAccessible)return;if(typeof o=="number"||o instanceof Date||a||s||m||f){let g={expires:o,path:a,domain:s,secure:m,sameSite:f||"Lax",partitioned:D};this.set(e,i,g);return}let l=encodeURIComponent(e)+"="+encodeURIComponent(i)+";",r=o||{};if(r.expires)if(typeof r.expires=="number"){let g=new Date(new Date().getTime()+r.expires*1e3*60*60*24);l+="expires="+g.toUTCString()+";"}else l+="expires="+r.expires.toUTCString()+";";r.path&&(l+="path="+r.path+";"),r.domain&&(l+="domain="+r.domain+";"),r.secure===!1&&r.sameSite==="None"&&(r.secure=!0,console.warn(`[ngx-cookie-service] Cookie ${e} was forced with secure flag because sameSite=None.More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`)),r.secure&&(l+="secure;"),r.sameSite||(r.sameSite="Lax"),l+="sameSite="+r.sameSite+";",r.partitioned&&(l+="Partitioned;"),this.document.cookie=l}delete(e,i,o,a,s="Lax"){if(!this.documentIsAccessible)return;let m=new Date("Thu, 01 Jan 1970 00:00:01 GMT");this.set(e,"",{expires:m,path:i,domain:o,secure:a,sameSite:s})}deleteAll(e,i,o,a="Lax"){if(!this.documentIsAccessible)return;let s=this.getAll();for(let m in s)s.hasOwnProperty(m)&&this.delete(m,e,i,o,a)}static{this.\u0275fac=function(i){return new(i||n)(c(d),c(S))}}static{this.\u0275prov=u({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var C=class n{constructor(t,e,i,o,a,s){this.httpService=t;this.cookieService=e;this.router=i;this.roleService=o;this.intercomService=a;this.fraction=s}role=[];_returnUrl;_loginResponse;_jwtToken;set returnUrl(t){this._returnUrl=t}get returnUrl(){return this._returnUrl}login(t){return this.httpService.post("/api/Login/Web",t).pipe(h(e=>{this._loginResponse=e,e.Type=="geo"||e.Type=="totp"||this.saveLoginConfigToStorage(e)}))}loginLoader(){return this.httpService.get("/api/login/Loader")}getRedirectUrl(){let t=this.getSubscriptionStatus(),e=this.getRedirectUrlByRole();return(t==2||t==3)&&(e="/menu/Profile/Main/My_Subscription"),e}getRedirectUrlByRole(){let t,e=this.roleService;return e.dashboard.View?t="/menu/Dashboard":e.product.View?t="/menu/Products":t="/menu/Sell",t}logout(){localStorage.removeItem("ConfigData"),localStorage.removeItem("Token"),localStorage.removeItem("Roles"),localStorage.removeItem("AccountInfo"),localStorage.removeItem("CloudinaryConfig"),localStorage.removeItem("SubscriptionStatus"),this.cookieService.delete("ReportFilter","/"),this.intercomService.shutdown(),this._jwtToken=null,this.roleService.resetRoles(),this.router.navigate(["/"])}refreshToken(){this.httpService.post("/API/Authentication/RefreshToken",{}).subscribe(t=>{localStorage.removeItem("Token"),localStorage.setItem("Token",t.Token),this._jwtToken=null,this.roleService.resetRoles(),this.roleService.parseJWTRoles()})}isTokenExpired(){let t=localStorage.getItem("Token");if(t){let e=p.parseJwt(t),i=this.convertUnixTimesTamp(e.exp),o=new Date;if(i.getTime()-o.getTime()>0)return!1}return!0}isInRole(t){t.forEach(e=>e(this.role))}convertUnixTimesTamp(t){return new Date(t*1e3)}saveLoginConfigToStorage(t){localStorage.setItem("quantityFraction",JSON.stringify(t.UIConfig.Fraction.Quantity)),localStorage.setItem("amountFraction",JSON.stringify(t.UIConfig.Fraction.Amount)),this.fraction.setAmountFraction(t.UIConfig.Fraction.Amount.Minimum,t.UIConfig.Fraction.Amount.Maximum),this.fraction.setQuantityFraction(t.UIConfig.Fraction.Quantity.Minimum,t.UIConfig.Fraction.Quantity.Maximum),localStorage.setItem("AccountInfo",JSON.stringify(t?.AccountInfo)),localStorage.setItem("Token",t?.Token),localStorage.setItem("TinyMCEPlugins",t?.UIConfig.TinyMCE),this.intercomService.updateLocalStorage(t?.Intercom),localStorage.setItem("CloudinaryConfig",t?.UIConfig.CloudinaryConfig),localStorage.setItem("DataDaysRange",t?.UIConfig.DataDaysRange),localStorage.setItem("SubscriptionStatus",JSON.stringify(t?.SubscriptionStatus));let e=this.getParseToken();p.IsNotEmpty(e?.NotificationOutletID)&&localStorage.setItem("NotificationOutletID",e?.NotificationOutletID),this.roleService.parseJWTRoles(),this._loginResponse=null}getParseToken(){let t=localStorage.getItem("Token");return t&&!this._jwtToken&&(this._jwtToken=p.parseJwt(t)),this._jwtToken}get loginResponse(){return this._loginResponse}getSubscriptionStatus(){let t=localStorage.getItem("SubscriptionStatus");return t?parseInt(t):null}static \u0275fac=function(e){return new(e||n)(c(k),c(y),c(v),c(T),c(b),c(R))};static \u0275prov=u({token:n,factory:n.\u0275fac,providedIn:"root"})};export{U as a,y as b,C as c};
1
+ import{a as b}from"./chunk-JDMYDBXN.js";import{a as p,d as T,e as R}from"./chunk-EQ6536VC.js";import{Od as v,Pa as S,Qc as d,Wd as k,fa as h,id as I,ja as u,ma as c}from"./chunk-ONCTFURX.js";var U=(o=>(o[o.PAID=0]="PAID",o[o.OVERDUE=1]="OVERDUE",o[o.SELL_ONLY=2]="SELL_ONLY",o[o.SUSPENDED=3]="SUSPENDED",o))(U||{});var y=(()=>{class n{constructor(e,i){this.document=e,this.platformId=i,this.documentIsAccessible=I(this.platformId)}static getCookieRegExp(e){let i=e.replace(/([\[\]{}()|=;+?,.*^$])/gi,"\\$1");return new RegExp("(?:^"+i+"|;\\s*"+i+")=(.*?)(?:;|$)","g")}static safeDecodeURIComponent(e){try{return decodeURIComponent(e)}catch{return e}}check(e){return this.documentIsAccessible?(e=encodeURIComponent(e),n.getCookieRegExp(e).test(this.document.cookie)):!1}get(e){if(this.check(e)){e=encodeURIComponent(e);let o=n.getCookieRegExp(e).exec(this.document.cookie);return o&&o[1]?n.safeDecodeURIComponent(o[1]):""}else return""}getAll(){if(!this.documentIsAccessible)return{};let e={},i=this.document;return i.cookie&&i.cookie!==""&&i.cookie.split(";").forEach(o=>{let[a,s]=o.split("=");e[n.safeDecodeURIComponent(a.replace(/^ /,""))]=n.safeDecodeURIComponent(s)}),e}set(e,i,o,a,s,m,f,D){if(!this.documentIsAccessible)return;if(typeof o=="number"||o instanceof Date||a||s||m||f){let g={expires:o,path:a,domain:s,secure:m,sameSite:f||"Lax",partitioned:D};this.set(e,i,g);return}let l=encodeURIComponent(e)+"="+encodeURIComponent(i)+";",r=o||{};if(r.expires)if(typeof r.expires=="number"){let g=new Date(new Date().getTime()+r.expires*1e3*60*60*24);l+="expires="+g.toUTCString()+";"}else l+="expires="+r.expires.toUTCString()+";";r.path&&(l+="path="+r.path+";"),r.domain&&(l+="domain="+r.domain+";"),r.secure===!1&&r.sameSite==="None"&&(r.secure=!0,console.warn(`[ngx-cookie-service] Cookie ${e} was forced with secure flag because sameSite=None.More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`)),r.secure&&(l+="secure;"),r.sameSite||(r.sameSite="Lax"),l+="sameSite="+r.sameSite+";",r.partitioned&&(l+="Partitioned;"),this.document.cookie=l}delete(e,i,o,a,s="Lax"){if(!this.documentIsAccessible)return;let m=new Date("Thu, 01 Jan 1970 00:00:01 GMT");this.set(e,"",{expires:m,path:i,domain:o,secure:a,sameSite:s})}deleteAll(e,i,o,a="Lax"){if(!this.documentIsAccessible)return;let s=this.getAll();for(let m in s)s.hasOwnProperty(m)&&this.delete(m,e,i,o,a)}static{this.\u0275fac=function(i){return new(i||n)(c(d),c(S))}}static{this.\u0275prov=u({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var C=class n{constructor(t,e,i,o,a,s){this.httpService=t;this.cookieService=e;this.router=i;this.roleService=o;this.intercomService=a;this.fraction=s}role=[];_returnUrl;_loginResponse;_jwtToken;set returnUrl(t){this._returnUrl=t}get returnUrl(){return this._returnUrl}login(t){return this.httpService.post("/api/Login/Web",t).pipe(h(e=>{this._loginResponse=e,e.Type=="geo"||e.Type=="totp"||this.saveLoginConfigToStorage(e)}))}loginLoader(){return this.httpService.get("/api/login/Loader")}getRedirectUrl(){let t=this.getSubscriptionStatus(),e=this.getRedirectUrlByRole();return(t==2||t==3)&&(e="/menu/Profile/Main/My_Subscription"),e}getRedirectUrlByRole(){let t,e=this.roleService;return e.dashboard.View?t="/menu/Dashboard":e.product.View?t="/menu/Products":t="/menu/Sell",t}logout(){localStorage.removeItem("ConfigData"),localStorage.removeItem("Token"),localStorage.removeItem("Roles"),localStorage.removeItem("AccountInfo"),localStorage.removeItem("CloudinaryConfig"),localStorage.removeItem("SubscriptionStatus"),this.cookieService.delete("ReportFilter","/"),this.intercomService.shutdown(),this._jwtToken=null,this.roleService.resetRoles(),this.router.navigate(["/"])}refreshToken(){this.httpService.post("/API/Authentication/RefreshToken",{}).subscribe(t=>{localStorage.removeItem("Token"),localStorage.setItem("Token",t.Token),this._jwtToken=null,this.roleService.resetRoles(),this.roleService.parseJWTRoles()})}isTokenExpired(){let t=localStorage.getItem("Token");if(t){let e=p.parseJwt(t),i=this.convertUnixTimesTamp(e.exp),o=new Date;if(i.getTime()-o.getTime()>0)return!1}return!0}isInRole(t){t.forEach(e=>e(this.role))}convertUnixTimesTamp(t){return new Date(t*1e3)}saveLoginConfigToStorage(t){localStorage.setItem("quantityFraction",JSON.stringify(t.UIConfig.Fraction.Quantity)),localStorage.setItem("amountFraction",JSON.stringify(t.UIConfig.Fraction.Amount)),this.fraction.setAmountFraction(t.UIConfig.Fraction.Amount.Minimum,t.UIConfig.Fraction.Amount.Maximum),this.fraction.setQuantityFraction(t.UIConfig.Fraction.Quantity.Minimum,t.UIConfig.Fraction.Quantity.Maximum),localStorage.setItem("AccountInfo",JSON.stringify(t?.AccountInfo)),localStorage.setItem("Token",t?.Token),localStorage.setItem("TinyMCEPlugins",t?.UIConfig.TinyMCE),this.intercomService.updateLocalStorage(t?.Intercom),localStorage.setItem("CloudinaryConfig",t?.UIConfig.CloudinaryConfig),localStorage.setItem("DataDaysRange",t?.UIConfig.DataDaysRange),localStorage.setItem("SubscriptionStatus",JSON.stringify(t?.SubscriptionStatus));let e=this.getParseToken();p.IsNotEmpty(e?.NotificationOutletID)&&localStorage.setItem("NotificationOutletID",e?.NotificationOutletID),this.roleService.parseJWTRoles(),this._loginResponse=null}getParseToken(){let t=localStorage.getItem("Token");return t&&!this._jwtToken&&(this._jwtToken=p.parseJwt(t)),this._jwtToken}get loginResponse(){return this._loginResponse}getSubscriptionStatus(){let t=localStorage.getItem("SubscriptionStatus");return t?parseInt(t):null}static \u0275fac=function(e){return new(e||n)(c(k),c(y),c(v),c(T),c(b),c(R))};static \u0275prov=u({token:n,factory:n.\u0275fac,providedIn:"root"})};export{U as a,y as b,C as c};