1import{a as d}from"./chunk-DLUETWD6.js";import{l as u}from"./chunk-DGVY3FNH.js";import{I as s,N as l,S as a,bc as c,ia as i,l as y}from"./chunk-IIXPTABD.js";import{a as o,b as n}from"./chunk-7CGTOI24.js";var p=class r{http=a(u);status=i(null);isSubmitting=i(!1);errorMessage=i("");modalVisible=c(()=>{let e=this.status();return e?.modalRequired===!0||e?.requiresAcknowledgement===!0});loadStatus(){return this.http.get("/api/v2/authentication/privacy-status").pipe(s(e=>this.status.set(e)))}applyFromSession(e){e?.privacyPolicy&&this.status.set(e.privacyPolicy)}accept(){return this.isSubmitting.set(!0),this.errorMessage.set(""),this.http.post("/api/v2/authentication/privacy-accept",{}).pipe(s({next:e=>{this.isSubmitting.set(!1),e.success?this.status.set(null):this.errorMessage.set(e.errorMessage??"Unable to accept the updated terms. Please try again.")},error:()=>{this.isSubmitting.set(!1),this.errorMessage.set("Unable to accept the updated terms. Please try again.")}}))}decline(){return this.isSubmitting.set(!0),this.errorMessage.set(""),this.http.post("/api/v2/authentication/privacy-decline",{}).pipe(s({next:()=>this.isSubmitting.set(!1),error:()=>{this.isSubmitting.set(!1),this.errorMessage.set("Unable to process your request. Please try again.")}}))}clear(){this.status.set(null),this.errorMessage.set("")}static \u0275fac=function(t){return new(t||r)};static \u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"})};var v=class r{http=a(u);privacyPolicyService=a(p);analyticsService=a(d);currentUser=i(null);sessionChecked=i(!1);sessionCheckFailed=i(!1);isAuthenticated=c(()=>this.currentUser()?.isAuthenticated??!1);isImpersonating=c(()=>this.currentUser()?.isImpersonating??!1);requiresPrivacyAcknowledgement=c(()=>this.currentUser()?.privacyPolicy?.requiresAcknowledgement===!0);validateSession(){return this.http.get("/api/v2/authentication/validate").pipe(s(e=>{this.currentUser.set(e),this.sessionChecked.set(!0),this.privacyPolicyService.applyFromSession(e),e.isAuthenticated&&e.userId&&(this.analyticsService.setUserId(e.userId),e.isNewRegistration&&(this.analyticsService.trackSignUp(e.userId,"register_page"),this.analyticsService.trackLogin("native",e.userId,"register_page")))}))}async logout(){try{await y(this.http.post("/api/v2/authentication/logout",{})),this.currentUser.set(null)}catch(e){throw this.currentUser.set(null),e}finally{this.privacyPolicyService.clear()}}establishSession(e){this.currentUser.set(e),e.privacyPolicy?.requiresAcknowledgement&&this.privacyPolicyService.status.set(n(o({},e.privacyPolicy),{modalRequired:!0}))}completePrivacyAcceptance(e){let t=this.currentUser();if(!t){this.privacyPolicyService.clear();return}this.currentUser.set(n(o({},t),{termsAccepted:e?new Date(e):t.termsAccepted,privacyPolicy:t.privacyPolicy?n(o({},t.privacyPolicy),{requiresAcknowledgement:!1,modalRequired:!1,hasAccepted:!0}):null})),this.privacyPolicyService.clear()}clearSession(){this.currentUser.set(null),this.privacyPolicyService.clear()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"})};export{p as a,v as b};
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.