import{c as f}from"./chunk-HJJJ4ZT2.js";import{a as m}from"./chunk-CAGDTHS6.js";import{n as v,q as u}from"./chunk-TKVDP62Z.js";import{Hd as h,J as c,Ld as l,k as n,na as s,qa as e}from"./chunk-GJDGQISV.js";var d=class o{constructor(t,r,p,i){this.httpService=t;this.authService=r;this.httpClientService=p;this.toastr=i}port=window.location.href.split("localhost:")[1]?.split("/")[0];hostURL=t=>m.production?t:`https://localhost:${this.port}${t}`;configure2FA(t){return this.httpService.post("/api/Authentication/Setup_2FA",t)}validateCode(t,r){let p=this.authService.loginResponse?.Token,i=new h({"Content-Type":"application/json","Cache-Control":"no-cache"});i=i.append("Authorization","Bearer "+p);let S={ValidationCode:t,UserID:r};return this.httpClientService.post(this.hostURL("/api/Login/Validate_2FA "),S,{headers:i}).pipe(c(a=>(this.toastr.error(a?.error?.Message,"Error - "+a.status),n)))}disableTwoFactorAuthentication(){let t={enabled:!1};return this.httpService.post("/api/Authentication/Setup_2FA",t)}static \u0275fac=function(r){return new(r||o)(e(u),e(f),e(l),e(v))};static \u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"})};export{d as a};
