import{j as e,u}from"./fields-wnm5Jtc6.js";import{R as p}from"./vendor-D21mNUGX.js";import{P as s}from"./index-pmrLY__j.js";import{g as f}from"./index.esm-DCQn2FO4.js";const h=({id:r,values:i,description:o,validate:t,register:n,errors:d,valueAsArray:m=!1})=>{const a=f(d,r);return e.jsxs(p.Fragment,{children:[e.jsxs("div",{className:"flex-column s-8",children:[Object.keys(i).map((c,l)=>e.jsxs("label",{className:"checkbox",htmlFor:`${r}_${l}`,children:[e.jsx("input",{name:r,value:i[c].value,defaultChecked:i[c].checked,"aria-invalid":a?"true":"false",type:"checkbox",id:`${r}_${l}`,...n(m?`${r}[]`:`${r}_${l}`,{...t})}),e.jsx("span",{children:u(c)})]})),a&&e.jsx("div",{className:"invalid-feedback",children:a.message})]}),o&&e.jsx("div",{className:"form-description",children:o}),a&&e.jsx("div",{className:"invalid-feedback",children:a.message})]})};h.propTypes={id:s.string.isRequired,description:s.string,values:s.arrayOf(s.object).isRequired,validate:s.func,register:s.func.isRequired,errors:s.array.isRequired,valueAsArray:s.bool};export{h as C};
