import{r as o,h as r}from"./p-9576a29b.js";import{c as e}from"./p-d8e783d1.js";import"./p-0bc4f624.js";import"./p-17b7253a.js";import"./p-b423423b.js";import"./p-a6974d5a.js";import{a}from"./p-539e53cb.js";import{a as m}from"./p-c7f96882.js";const t=class{constructor(r){o(this,r),this.profileFormId="profile"}async formEventHandler({detail:o}){if(o.formId==this.profileFormId)return this.updateProfile(o)}async updateProfile(o){const r={};Object.keys(o).map((e=>{o[e].key&&(r[o[e].key]=o[e].value)})),await e.client.mutate(m,{userInput:r})}render(){var o,e;return(null===(o=a.identity)||void 0===o?void 0:o.user)?r("corejam-box",{max:"xl",mx:"auto",mt:12,px:4,lgPx:0},r("corejam-box",{mb:16},r("corejam-type",{as:"h2",size:"3xl",align:"center",weight:"bold"},"My Account")),r("corejam-box",{flex:!0},r("corejam-box",{w:3,pt:8,bWidthTop:1,bColor:"gray-500",mr:24},r("corejam-box",{flex:!0,direction:"col"},r("corejam-box",{mb:4},r("corejam-base-link",{href:"#",class:"py-4 mb-1"},"Account details")),r("corejam-box",{mb:4},r("corejam-base-link",{href:"#",class:"py-4 mb-1"},"Settings")))),r("corejam-box",{w:9,pt:8,bWidthTop:1,bColor:"gray-500"},r("corejam-form-container",{name:this.profileFormId},r("corejam-box",{flex:!0,mb:8},r("corejam-box",{w:6,pl:4},r("corejam-form-input",{name:"email",type:"email",formId:this.profileFormId,required:!0,label:"Email Address",value:null===(e=a.identity)||void 0===e?void 0:e.user.email,placeholder:"Email"}))),r("corejam-form-submit",{formId:this.profileFormId},r("corejam-type",{size:"sm",weight:"bold",transform:"uppercase",decoration:"underline"},"Save"))),r("auth-reset-password-form",null)))):r("div",null,"Login")}};export{t as auth_account}