import{r as o,h as r,H as m}from"./p-d55626d1.js";import{c as a}from"./p-2fd22ed9.js";import"./p-0bc4f624.js";import"./p-9bfc48ee.js";import{r as s}from"./p-097729d8.js";import{a as e}from"./p-c1c5b589.js";import{s as t}from"./p-62c3d279.js";import{d as i}from"./p-c7f96882.js";const p=class{constructor(r){o(this,r),this.formId="register"}async formEventHandler({detail:o}){o.formId==this.formId&&((await a.client.mutate({mutation:t(i),variables:{data:{email:o.email.value,password:o.password.value,passwordConfirm:o.passwordConfirm.value}}})).data.userRegister?this.onSuccess?this.onSuccess():s.router.push("/login"):this.onFail&&this.onFail())}componentWillLoad(){e.identity&&s.router.push("/")}render(){return r(m,null,r("corejam-box",{p:8,max:"md",mx:"auto",px:4,lgPx:0,flex:!0,justify:"between",mb:24},r("corejam-box",{w:"5",mx:"auto"},r("corejam-form-container",{name:this.formId},r("corejam-box",null,r("corejam-form-input",{required:!0,name:"email",type:"email",formId:this.formId,label:"Email"}),r("corejam-box",null,r("corejam-form-input",{name:"password",type:"password",formId:this.formId,label:"Password"})),r("corejam-box",null,r("corejam-form-input",{name:"passwordConfirm",type:"password",formId:this.formId,label:"Confirm Password"})),r("corejam-box",null,r("corejam-form-input",{type:"checkbox",formId:this.formId,label:"I agree to the terms & conditions"})),r("corejam-box",null,r("corejam-form-submit",{formId:this.formId},r("button",{type:"submit"},"Register"))))))))}};export{p as auth_form_register}