1import{cb as C}from"./chunk-L6EN2BW6.js";import{b as w,k as R}from"./chunk-RI5I43BI.js";import{a as E}from"./chunk-SXGFXLNS.js";import{a as U,d as I,k as d}from"./chunk-XUZPMCRD.js";import{j as N}from"./chunk-Y52XVX6B.js";import{g as y,h as b}from"./chunk-D3VLNOII.js";import{H as u,He as v,R as h,d as n,sa as f,v as m,va as t,w as S}from"./chunk-ADQO3XXX.js";import{m as p}from"./chunk-3JMZ37NM.js";var L="onlineRegisterUser",k=(()=>{let s=class s{constructor(e,r,i,o,c,g,l,O){this.cmsService=e,this.membershipSetupService=r,this.routingService=i,this.configService=o,this.loggerFactory=c,this.windowRef=g,this.sessionStorageService=l,this.identityService=O,this.registeredUser=new n(null),this.registeredCountryName=new n(""),this.registeredCountryUrl=new n(""),this.registeredPassword="",this.windowRef.isBrowser()&&this.registeredUser.next(this.sessionStorageService.retrieve(L)),this.registeredUser$=this.registeredUser.asObservable(),this.registeredCountryName$=this.registeredCountryName.asObservable(),this.registeredCountryUrl$=this.registeredCountryUrl.asObservable(),this.logger=this.loggerFactory.getLogger("SipOnlineRegisterService")}completeOnlineRegistration(e,r,i){i&&(this.registeredCountryName.next(i.countryName),this.registeredCountryUrl.next(i.countryUrl)),this.sessionStorageService.store(L,e),this.registeredUser.next(e),this.registeredPassword=r;let o=I.ONLINE_REGISTER_CONFIRMATION,c={addressSuccess:(e?.defaultAddress?.postalCode?.length>0).toString()},g=new URLSearchParams(c).toString(),l=`${o}?${g}`;this.routingService.goByUrl(l,{replaceUrl:!0}).then()}getRegisteredUserMembershipImage(){return S([this.registeredUser$.pipe(u(e=>!!e)),this.membershipSetupService.getProductImages()]).pipe(m(([e,r])=>{let i=r.images.find(o=>o.key===e.memberType);return i?{code:i.value.code,src:i.value.url,url:i.value.url,altText:i.value.altText,mime:i.value.mime}:null}))}isOnlineRegisterPage(){return this.cmsService.getCurrentPage().pipe(u(e=>!!e),m(e=>(e.pageId?.endsWith(d.PAGE_ID_SUFFIX_ONLINE)??!1)||(e.label?.endsWith(d.PAGE_ID_SUFFIX_ONLINE)??!1)))}autoLogin(){return p(this,null,function*(){if(!(yield this.configService.getBooleanConfig(N).pipe(h(1)).toPromise()))return!1;let e=this.registeredUser.value?.memberEmail,r=this.registeredPassword;if(!e||!r)return this.logger.error("Auto-login: Enabled but user credentials are missing"),!1;try{yield this.identityService.loginWithCredentials(e,r,{suppressLoginErrorMessage:!0,absolutelyDoNotRedirect:!0})}catch{this.logger.warn("Auto-login: failed to log in with credentials")}return yield this.identityService.isUserLoggedIn().pipe(h(1)).toPromise()})}};s.\u0275fac=function(r){return new(r||s)(t(E),t(w),t(U),t(b),t(y),t(v),t(C),t(R))},s.\u0275prov=f({token:s,factory:s.\u0275fac,providedIn:"root"});let a=s;return a})();export{k 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.