function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = ["./WebSystemOutageMessaging-CNT1Y3P_.mjs","./entry.BHemiKob.js","./entry.B_nJpNyR.css","./WebSystemOutageMessaging.luOAcOhq.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } import{_ as F,B as u,aY as l,o as a,b as g,c as m,d as c,w,a as o,n as f,t as _,i as d,K as S,L as y,a6 as b,k as p,u as C,aZ as R,N as I,H as L,I as T,p as U,m as M}from"./entry.BHemiKob.js";import{_ as B}from"./WebFormFieldsNew-xX-xamgK.mjs";import{_ as N}from"./WebFormWrapper-i2i4B5RL.mjs";import{u as D}from"./useVueRecaptcha-XeO4VNK-.mjs";import{u as q}from"./dynamic-import-helper-CUkzFinH.mjs";const x=L(()=>T(()=>import("./WebSystemOutageMessaging-CNT1Y3P_.mjs"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>e.default||e)),O={props:{},async setup(e){const{$gql:s}=C(),i=await s.query("getReCAPTCHAPublicKey");return{tenantRecaptchaPublicKey:i==null?void 0:i.data}},data(){return{mode:"login",siteUser:null,loginValues:{username:"",password:""},resetPasswordValues:{email:""},error:null,showErrors:!1,loginErrors:{},resetPasswordErrors:{},processing:!1,qualifyingMembership:!1,message:null,recaptcha:null}},computed:{returnedFromSSO(){var e,s;return(s=(e=u())==null?void 0:e.query)==null?void 0:s.siteUserToken},submitDisabled(){var e,s;return this.mode==="login"&&(!((e=this.loginValues)!=null&&e.username)||!((s=this.loginValues)!=null&&s.password))||this.mode==="reset-password"&&!this.resetPasswordValues.email},loginFieldInfo(){return{rows:[{fields:{username:{type:"email_input",label:"Email",placeholder:"Enter Email",required:!0,disabled:this.processing,showErrors:this.showErrors,icon:!0},password:{type:"password",label:"Password",placeholder:"Enter Password",required:!0,disabled:this.processing,showErrors:this.showErrors,icon:!0}}}]}},resetPasswordFieldInfo(){return{rows:[{fields:{email:{type:"email_input",label:"Email",placeholder:"Enter Email",required:!0,disabled:this.processing,showErrors:this.showErrors,icon:!0}}}]}}},async mounted(){const{query:e,hash:s}=u();this.siteUser=l.getUserInfo(),l.isLoggedIn()&&(window.location=(e==null?void 0:e.redirectTo)===""||(e==null?void 0:e.redirectTo)===void 0?"/account":`${e==null?void 0:e.redirectTo}${s}`),this.recaptcha=D(this.tenantRecaptchaPublicKey),e.email&&(this.loginValues.username=e.email),e.mode==="resetPassword"&&this.setMode("reset-password")},methods:{register(){return l.getRegistrationLink()},setMode(e){this.mode=e,e==="reset-password"?this.resetPasswordValues.email=this.loginValues.username:e==="login"&&(this.loginValues.username=this.resetPasswordValues.email)},update(e,s,i){this.mode==="login"?(this.loginValues[e]=s,this.loginErrors[e]={errorObj:i}):(this.resetPasswordValues[e]=s,this.resetPasswordErrors[e]={errorObj:i})},submitForm(){this.showErrors=q(this.mode==="login"?this.loginErrors:this.resetPasswordErrors??{})>0},async handleSubmit(){try{this.error="",this.processing=!0;let e=null;if(this.mode==="login"){const s=await this.recaptcha("siteUserLogin");if(e=await l.login(this.loginValues.username,this.loginValues.password,s),e!=null&&e.error)throw new Error(e.message)}if(this.mode==="reset-password"){const s=await this.recaptcha("siteUserResetPassword");e=await l.requestPasswordReset(this.resetPasswordValues.email,u().path,s),this.message=`You will receive an email momentarily if the account exists. Check your spam folder if you don’t see the email. Contact customerservice@${this.$ss.general.rootDomain} for further assistance.`}this.processing=!1}catch(e){this.error=e,this.processing=!1}}}},W=e=>(U("data-v-aa63eff5"),e=e(),M(),e),A={key:0},K={key:1},z={class:"form-content"},H={key:0,class:"preface"},Y={key:1,class:"preface"},J={class:"submit"},Z={class:"links"},G=W(()=>o("div",{class:"consent"},[p(" By creating an account, you are agreeing to Endeavor Business Media's "),o("a",{href:"https://www.endeavorbusinessmedia.com/endeavor-terms",target:"_blank",rel:"noopener"},"Terms of Service"),p(" and "),o("a",{href:"https://www.endeavorbusinessmedia.com/privacy-policy",target:"_blank",rel:"noopener"},"Privacy Policy")],-1));function Q(e,s,i,X,r,t){var h;const P=x,E=B,v=R,k=N,V=I;return(h=e.$ss.systemOutage)!=null&&h.disableOmeda?(a(),g(P,{key:0})):(a(),m("div",{key:1,ref:"loginForm",class:"login-form",style:f({fontFamily:e.$ss.primaryFontFamily})},[c(V,null,{default:w(()=>[o("h2",{class:"title",style:f({fontFamily:e.$ss.primaryFontFamily,color:e.$ss.baseStyles.primaryColor})},[r.mode==="login"?(a(),m("span",A,"Login to "+_(e.$ss.general.siteName),1)):d("",!0),r.mode==="reset-password"?(a(),m("span",K,"Reset Password")):d("",!0)],4),o("div",z,[c(k,{error:r.error,processing:r.processing,padding:"0",message:r.message,"qualifying-membership":r.qualifyingMembership},{default:w(()=>[o("form",{class:"form",onSubmit:s[3]||(s[3]=S((...n)=>t.handleSubmit&&t.handleSubmit(...n),["prevent"]))},[r.mode==="login"&&e.$ss.memberships.siteLoginPageText?(a(),m("div",H,[o("p",null,_(e.$ss.memberships.siteLoginPageText),1)])):d("",!0),r.mode==="reset-password"?(a(),m("div",Y," Please enter your email address below to reset your password. ")):d("",!0),(a(),g(E,{key:r.mode,"field-info":r.mode==="login"?t.loginFieldInfo:t.resetPasswordFieldInfo,"field-values":r.mode==="login"?r.loginValues:r.resetPasswordValues,onUpdate:t.update},null,8,["field-info","field-values","onUpdate"])),o("div",J,[o("div",Z,[y(o("a",{onClick:s[0]||(s[0]=n=>t.setMode("reset-password"))},"Reset Password",512),[[b,r.mode==="login"]]),y(o("a",{onClick:s[1]||(s[1]=n=>t.setMode("login"))},"Return to Login",512),[[b,r.mode==="reset-password"]]),p(" | "),o("a",{class:"register",onClick:s[2]||(s[2]=(...n)=>t.register&&t.register(...n))},"Join")]),c(v,{color:e.$ss.baseStyles.primaryColor,label:r.mode==="login"?"Login":"Reset",disabled:t.submitDisabled,type:"submit",onOnClick:t.submitForm},null,8,["color","label","disabled","onOnClick"])])],32),G]),_:1},8,["error","processing","message","qualifying-membership"])])]),_:1})],4))}const oe=F(O,[["render",Q],["__scopeId","data-v-aa63eff5"]]);export{oe as default};