import{At as e,mt as t}from"./vendor-react-N_fu9J_Y.js";import{f as n,i as r,o as i,r as a,u as o,v as s}from"./form-validators-DVrEJWWZ.js";import{n as c}from"./Password-BexcB0yA.js";import"./TextInput-B8GMW7H1.js";var l=e(),u=e=>{let{confirmationField:u=!1,removeValidationErrorOnChange:d=!0,fieldProps:f,inputProps:p,beforeSlot:m,afterSlot:h,required:g=!0,initialValue:_,validation:v}=e,y=s(),{t:b}=t(),x=e=>{if(y.setValue(`email`,e.currentTarget.value.trim()),d){let t=e.currentTarget.value;i(t)===void 0&&y.setError(p?.field||`email`,void 0)}p?.onChange&&p.onChange(e)},S=u?`email-confirm`:`email`,C=()=>v||(u?r:g?c([a,i]):i);return(0,l.jsxs)(n,{label:u?b(`account.emailconfirmation`,`Email confirmation`):b(`global.email`,`Email`),required:g,id:S,...f,children:[m,(0,l.jsx)(o,{id:S,initialValue:_||``,autoComplete:S,field:S,validate:C(),validateOnBlur:!0,...p,onChange:u?void 0:x}),h]})};export{u as t};