import{m as Y,n as A,f as S,dh as D,cY as G,r as H,j as k,v as J,o as K,w as M}from"./index-c121b02d.js";import{u as Q,a as T}from"./Grow-9a484472.js";function V(s){return Y("PrivateSwitchBase",s)}A("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const W=s=>{const{classes:t,checked:d,disabled:r,edge:o}=s,c={root:["root",d&&"checked",r&&"disabled",o&&`edge${K(o)}`],input:["input"]};return M(c,V,t)},X=S(D)({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:G})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),_=H.forwardRef(function(t,d){const{autoFocus:r,checked:o,checkedIcon:c,className:y,defaultChecked:u,disabled:C,disableFocusRipple:h=!1,edge:x=!1,icon:F,id:R,inputProps:P,inputRef:I,name:z,onBlur:p,onChange:f,onFocus:m,readOnly:j,required:v=!1,tabIndex:E,type:i,value:g,...U}=t,[b,L]=Q({controlled:o,default:!!u,name:"SwitchBase",state:"checked"}),a=T(),N=e=>{m&&m(e),a&&a.onFocus&&a.onFocus(e)},q=e=>{p&&p(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:h,edge:x},w=W(l);return k.jsxs(X,{component:"span",className:J(w.root,y),centerRipple:!0,focusRipple:!h,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};
