import{r as t,c as i,h as e,g as s}from"./p-3b76effa.js";import"./p-d7ac2f15.js";import{T as a,f as n}from"./p-18ca1c85.js";class r{constructor(e){t(this,e),this.submitLabel="LOGIN",this.forgotPasswordLabel="PASSWORD FORGOTTEN?",this.language="en",this.type="name-password",this.translate=a.instance,this.formSubmit=i(this,"formSubmit",7)}componentWillLoad(){this.data=n.loginForm.data.attributes,this.definitions=n.loginForm.data.meta.definitions}componentDidLoad(){this.host.getElementsByTagName("ema-form")[0].addEventListener("formSubmit",t=>{this.loginHandler(t)})}componentDidUnload(){this.host.getElementsByTagName("ema-form")[0].removeEventListener("formSubmit",this.loginHandler)}loginHandler(t){t.preventDefault(),this.formSubmit.emit(t.detail)}alterForm(t){"email-password"===t&&(this.definitions.username.label="EMAIL ADDRESS",this.definitions.username.constraints={email:{message:"^"+this.translate.get("EMAIL ERROR")},presence:!0})}render(){return this.alterForm(this.type),e("ema-form",{"data-json":JSON.stringify(this.data),"definitions-json":JSON.stringify(this.definitions),language:this.language,"submit-label":this.submitLabel,"submit-error":this.submitError})}get host(){return s(this)}static get style(){return":root{--ema-color:#343a40;--ema-primary:#007bff;--ema-secondary:#6c757d;--ema-success:#28a745;--ema-info:#17a2b8;--ema-warning:#ffc107;--ema-danger:#dc3545;--ema-light:#f8f9fa;--ema-dark:#343a40;--ema-background:#fff;--ema-background-diap:rgba(29,29,29,0.97);--ema-border-color:#c5c9cd;--ema-border:1px solid #c5c9cd;--ema-border-radius:3px 3px 3px 3px;--ema-box-shadow:1px 1px 10px 1px #ccc;--ema-margin:0.25rem;--ema-margin-sm:0.5rem;--ema-margin-md:1rem;--ema-margin-lg:1.5rem;--ema-margin-xl:2rem;--ema-padding:0.25rem;--ema-padding-sm:0.5rem;--ema-padding-md:1rem;--ema-padding-lg:1.5rem;--ema-padding-xl:2rem;--ema-gray-100:#f8f9fa;--ema-gray-200:#e9ecef;--ema-gray-300:#dee2e6;--ema-gray-400:#ced4da;--ema-gray-500:#adb5bd;--ema-gray-600:#868e96;--ema-gray-700:#495057;--ema-gray-800:#343a40;--ema-gray-900:#212529}ema-login-form .forgot{margin-top:15px}ema-login-form .error{color:red;margin-top:15px}"}}export{r as ema_login_form};