"use strict";const d=require("./mergeProps-CxnHrnow.cjs.js"),U=require("./filterDOMProps-WUskt27c.cjs.js"),_=require("./useFormReset-COoih4uI.cjs.js"),v=require("./usePress-MEEljcWP.cjs.js"),F=require("./useFocusable-C7VjcJHL.cjs.js");function N(s,r,n){let{isDisabled:a=!1,isReadOnly:o=!1,value:c,name:h,form:g,children:m,"aria-label":C,"aria-labelledby":x,validationState:t="valid",isInvalid:f,onPressStart:b,onPressEnd:P,onPressChange:u,onPress:l,onPressUp:$,onClick:p}=s,y=e=>{e.stopPropagation(),r.setSelected(e.target.checked)},S=m!=null,D=C!=null||x!=null;!S&&!D&&process.env.NODE_ENV!=="production"&&console.warn("If you do not provide children, you must specify an aria-label for accessibility");let{pressProps:k,isPressed:E}=v.$f6c31cce2adf654f$export$45712eceda6fad21({onPressStart:b,onPressEnd:P,onPressChange:u,onPress:l,onPressUp:$,onClick:p,isDisabled:a}),{pressProps:q,isPressed:O}=v.$f6c31cce2adf654f$export$45712eceda6fad21({onPressStart:b,onPressEnd:P,onPressChange:u,onPressUp:$,onClick:p,onPress(e){var i;l?.(e),r.toggle(),(i=n.current)===null||i===void 0||i.focus()},isDisabled:a||o}),{focusableProps:I}=F.$f645667febf57a63$export$4c014de7c8940b4c(s,n),L=d.$3ef42575df84b30b$export$9d1611c77c2fe928(k,I),R=U.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(s,{labelable:!0});return _.$99facab73266f662$export$5add1d006293d136(n,r.defaultSelected,r.setSelected),{labelProps:d.$3ef42575df84b30b$export$9d1611c77c2fe928(q,{onClick:e=>e.preventDefault()}),inputProps:d.$3ef42575df84b30b$export$9d1611c77c2fe928(R,{"aria-invalid":f||t==="invalid"||void 0,"aria-errormessage":s["aria-errormessage"],"aria-controls":s["aria-controls"],"aria-readonly":o||void 0,onChange:y,disabled:a,...c==null?{}:{value:c},name:h,form:g,type:"checkbox",...L}),isSelected:r.isSelected,isPressed:E||O,isDisabled:a,isReadOnly:o,isInvalid:f||t==="invalid"}}exports.$d2c8e2b0480f3f34$export$cbe85ee05b554577=N;
//# sourceMappingURL=useToggle-DWRQYar0.cjs.js.map
