1import{a as v}from"./chunk-DFSONMXZ.js";import{g as S,i as a,j as m}from"./chunk-KIX5HNJA.js";import{I as l,L as d,Q as p,R as f,g as c,n as t,v as h}from"./chunk-ITIPYTGO.js";var I=(()=>{class o{constructor(n,r){this.apiService=n,this.domClass=r,this.apiUrl=a.apiUrl,this.loginPopupSubject=new c(!1),this.loginPopup$=this.loginPopupSubject.asObservable(),this.completeProfilePopupSubject=new c(!1),this.completeProfilePopup$=this.completeProfilePopupSubject.asObservable(),this.logoutPopupSubject=new c(!1),this.logoutPopup$=this.logoutPopupSubject.asObservable(),this.loginSuccessSubject=new c(!1),this.loginSuccess$=this.loginSuccessSubject.asObservable(),this.cookieService=f(S),this.generateToken=()=>{let i={username:a.middlewareTokenUsername,password:a.middlewareTokenPassword};return this.apiService.post(`${this.apiUrl.serviceMiddleware}/v1/generatetoken`,typeof i=="string"?i:JSON.stringify(i),{}).pipe(t(this.apiService.extractTypeFromMessage),t(e=>{if(e?.isSuccess&&e?.accessToken){let s={path:"/",secure:!0,sameSite:"Strict"};this.cookieService.set("middlewareAccessToken",e.accessToken,s),e.projectId&&this.cookieService.set("middlewareProjectId",e.projectId,s),e.tenantId&&this.cookieService.set("middlewareTenantId",e.tenantId,s)}return e}))},this.loginByPhone=i=>this.apiService.post(`${this.apiUrl.serviceProfile}/ProfileAPI/Mobile/LoginByPhone`,i,{observe:"response"}),this.VerifyPhone=i=>this.apiService.post(`${this.apiUrl.serviceProfile}/ProfileAPI/Mobile/verifymobilenumber`,i,{}).pipe(t(this.apiService.extractTypeFromMessage),l(e=>e,e=>!1)),this.getUserProfile=()=>this.apiService.get(`${this.apiUrl.serviceProfile}/ProfileAPI/UserProfile`,{}).pipe(t(this.apiService.extractTypeFromMessage),t(i=>i),h(i=>[])),this.updateSocialProfile=i=>{let e=this.getAccessToken(),s=e?{Authorization:`Bearer ${e}`}:{Authorization:"Bearer"};return this.apiService.post(`${this.apiUrl.serviceProfile}/ProfileAPI/UserProfile/UpdateSocialProfileWithoutImage`,JSON.stringify(i),s).pipe(t(this.apiService.extractTypeFromMessage),l(u=>u,u=>!1))}}logout(){this.cookieService.delete("userInfo","/"),this.cookieService.delete("isProfileCompleted","/"),this.deleteTokens()}storeTokens(n,r){this.cookieService.set("accessToken",n,{path:"/",secure:!0,sameSite:"Strict"}),this.cookieService.set("refreshToken",r,{path:"/",secure:!0,sameSite:"Strict"})}deleteTokens(){this.cookieService.delete("accessToken","/"),this.cookieService.delete("refreshToken","/")}getAccessToken(){return this.cookieService.get("accessToken")}getMiddlewareAccessToken(){return this.cookieService.get("middlewareAccessToken")}getRefreshToken(){return this.cookieService.get("refreshToken")}openLogoutPopup(){this.domClass.addOverflowHidden(),this.logoutPopupSubject.next(!0)}closeLogoutPopup(){this.domClass.removeOverflowHidden(),this.logoutPopupSubject.next(!0)}openLoginPopup(){this.domClass.addOverflowHidden(),this.loginPopupSubject.next(!0)}closeLoginPopup(){this.domClass.removeOverflowHidden(),this.loginPopupSubject.next(!1)}notifyLoginSuccess(){this.loginSuccessSubject.next(!0)}resetLoginSuccess(){this.loginSuccessSubject.next(!1)}openCompleteProfilePopup(){this.domClass.addOverflowHidden(),this.completeProfilePopupSubject.next(!0)}closeCompleteProfilePopup(){this.domClass.removeOverflowHidden(),this.completeProfilePopupSubject.next(!1)}static{this.\u0275fac=function(r){return new(r||o)(p(m),p(v))}}static{this.\u0275prov=d({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{I as a};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.