import{j as r}from"./fields-wnm5Jtc6.js";import"./vendor-D21mNUGX.js";import{P as e}from"./index-pmrLY__j.js";import{g}from"./index.esm-DCQn2FO4.js";const p=({id:s,defaultValue:l=0,description:o,validate:i,register:c,errors:n,onChangeCapture:d,disabled:a=!1})=>{const t=g(n,s);return r.jsxs("div",{className:`toggle-group ${a?"disabled":""}`,children:[r.jsxs("label",{"data-cy":`toggle-${s}`,className:"toggle",children:[r.jsx("input",{disabled:a,id:s,name:s,type:"checkbox","data-cy":`toggle-checkbox-${s}`,defaultChecked:l,onChangeCapture:d,...c(s,i)}),r.jsx("span",{className:"slider round"})]}),o&&r.jsx("span",{className:`form-description ${a?"disabled":""}`,children:o}),t&&r.jsx("div",{className:"invalid-feedback",children:t.message})]})};p.propTypes={id:e.string.isRequired,defaultValue:e.bool,description:e.string,onChangeCapture:e.func,validate:e.func,disabled:e.bool,register:e.func.isRequired,errors:e.array.isRequired};export{p as T};
