import{r as m,j as o,o as X}from"./index-CNnTZTc7.js";const b=t=>/^\d{10}$/.test(t),P="XXX-XXX-XXXX",f=/^\(?\d{3}\)?[\s-]\d{3}[\s-]\d{4}$/i,g="Please enter your phone number",T="Please enter a valid phone number",F="_container_a0u0w_88",E="_errorText_a0u0w_92",N="_label_a0u0w_97",j="_textField_a0u0w_101",e={container:F,errorText:E,label:N,textField:j},y=({autoFocus:t,defaultValue:n,disablePattern:a=!1,error:l,id:r,labelText:c,register:i,required:x=!0,noPlaceholder:p,className:d="",value:s,setError:h,clearErrors:u})=>(m.useEffect(()=>{if(s){const _=s.replace(/-/g,"");b(_)?u(r):h(r,{type:"pattern"})}},[s]),o.jsx("div",{className:`${e.container} ${d}`,children:o.jsx(X,{autoFocus:t,defaultValue:n,error:l,errorMessage:g,errorMessagePattern:T,errorTextClassName:e.errorText,fieldClassName:e.textField,id:r,labelClassName:e.label,labelText:c,pattern:a&&f,placeholder:p?"":P,register:i,required:x,type:"text",InputProps:{maxLength:12}})}));export{y as P}; //# sourceMappingURL=index-D-NY1ncL.js.map