var a=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var F=(t,e)=>{for(var o in e)a(t,o,{get:e[o],enumerable:!0})},I=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of R(e))!h.call(t,r)&&r!==o&&a(t,r,{get:()=>e[r],enumerable:!(i=y(e,r))||i.enumerable});return t};var k=t=>I(a({},"__esModule",{value:!0}),t);var E={};F(E,{default:()=>S});module.exports=k(E);var l=require("@chakra-ui/react"),p=require("react"),s=require("react-hook-form"),n=require("react/jsx-runtime"),G=({name:t,acceptedFileTypes:e,control:o,renderChild:i,schema:r})=>{let u=(0,p.useRef)(),{field:{ref:d,value:f,onChange:m,...v},fieldState:{invalid:c,error:P}}=(0,s.useController)({name:t,control:o,rules:{validate:r.validateSync}}),C=i({click:()=>u.current.click(),image:f,error:c});return(0,p.useEffect)(()=>{},[f]),(0,n.jsx)(l.FormControl,{isInvalid:c,children:(0,n.jsxs)(l.InputGroup,{children:[(0,n.jsx)("input",{type:"file",accept:e,name:t,ref:u,...v,inputRef:d,style:{display:"none"},onChange:g=>m(g.target.files[0])}),C]})})},S=G;
