import{m as A,n as D,f as S,d8 as G,cP as H,r as J,j as k,v as K,o as M,w as Q}from"./index-3141de2d.js";import{u as T,a as V}from"./Grow-e0aea29d.js";function W(s){return A("PrivateSwitchBase",s)}D("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const X=s=>{const{classes:t,checked:d,disabled:r,edge:o}=s,c={root:["root",d&&"checked",r&&"disabled",o&&`edge${M(o)}`],input:["input"]};return Q(c,W,t)},Y=S(G)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:s,ownerState:t})=>s==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:s,ownerState:t})=>s==="end"&&t.size!=="small",style:{marginRight:-12}}]}),Z=S("input",{shouldForwardProp:H})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),_=J.forwardRef(function(t,d){const{autoFocus:r,checked:o,checkedIcon:c,className:y,defaultChecked:u,disabled:C,disableFocusRipple:p=!1,edge:x=!1,icon:F,id:R,inputProps:P,inputRef:I,name:z,onBlur:h,onChange:f,onFocus:m,readOnly:j,required:v=!1,tabIndex:E,type:i,value:g,...U}=t,[b,L]=T({controlled:o,default:!!u,name:"SwitchBase",state:"checked"}),a=V(),N=e=>{m&&m(e),a&&a.onFocus&&a.onFocus(e)},q=e=>{h&&h(e),a&&a.onBlur&&a.onBlur(e)},O=e=>{if(e.nativeEvent.defaultPrevented)return;const B=e.target.checked;L(B),f&&f(e,B)};let n=C;a&&typeof n>"u"&&(n=a.disabled);const $=i==="checkbox"||i==="radio",l={...t,checked:b,disabled:n,disableFocusRipple:p,edge:x},w=X(l);return k.jsxs(Y,{component:"span",className:K(w.root,y),centerRipple:!0,focusRipple:!p,disabled:n,tabIndex:null,role:void 0,onFocus:N,onBlur:q,ownerState:l,ref:d,...U,children:[k.jsx(Z,{autoFocus:r,checked:o,defaultChecked:u,className:w.input,disabled:n,id:$?R:void 0,name:z,onChange:O,readOnly:j,ref:I,required:v,ownerState:l,tabIndex:E,type:i,...i==="checkbox"&&g===void 0?{}:{value:g},...P}),b?c:F]})}),te=_;export{te as S};
