import { localized, msg } from "@lit/localize"; import { customElement, property, state } from "lit/decorators.js"; import AuthService, { type AuthState, type LoggedInEventDetail, } from "@/utils/AuthService"; import LiteElement, { html } from "@/utils/LiteElement"; @localized() @customElement("btrix-sign-up") export class SignUp extends LiteElement { @property({ type: Object }) authState?: AuthState; @state() isSignedUpWithoutAuth?: boolean; render() { return html`
${this.isSignedUpWithoutAuth ? html`

${msg( "Click the link in the verification email we sent you to log in.", )}

` : html`

${msg("Sign up")}

`}
`; } private onSubmit() { if (this.authState) { this.dispatchEvent(AuthService.createLogOutEvent({ redirect: false })); } } private onAuthenticated(event: CustomEvent) { this.dispatchEvent( AuthService.createLoggedInEvent({ ...event.detail, firstLogin: true, }), ); } private onUnauthenticated() { this.isSignedUpWithoutAuth = true; } }