import{cG as P,cF as R,f as u,cH as r,cI as d,r as M,cJ as j,cK as k,cL as I,j as p,cM as N,o as f,cN as O,dH as D,dA as U}from"./index-7414fd54.js";import{S as A}from"./SwitchBase-c8eea343.js";function E(t){return R("MuiSwitch",t)}const F=P("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),s=F,H=t=>{const{classes:a,edge:o,size:l,color:h,checked:w,disabled:g}=t,S={root:["root",o&&`edge${r(o)}`,`size${r(l)}`],switchBase:["switchBase",`color${r(h)}`,w&&"checked",g&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},v=N(S,E,a);return{...a,...v}},L=u("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,a)=>{const{ownerState:o}=t;return[a.root,o.edge&&a[`edge${r(o.edge)}`],a[`size${r(o.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${s.thumb}`]:{width:16,height:16},[`& .${s.switchBase}`]:{padding:4,[`&.${s.checked}`]:{transform:"translateX(16px)"}}}}]}),X=u(A,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,a)=>{const{ownerState:o}=t;return[a.switchBase,{[`& .${s.input}`]:a.input},o.color!=="default"&&a[`color${r(o.color)}`]]}})(d(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${s.checked}`]:{transform:"translateX(20px)"},[`&.${s.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${s.checked} + .${s.track}`]:{opacity:.5},[`&.${s.disabled} + .${s.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${s.input}`]:{left:"-100%",width:"300%"}})),d(({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:f(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(O(["light"])).map(([a])=>({props:{color:a},style:{[`&.${s.checked}`]:{color:(t.vars||t).palette[a].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[a].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:f(t.palette[a].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${s.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${a}DisabledColor`]:`${t.palette.mode==="light"?D(t.palette[a].main,.62):U(t.palette[a].main,.55)}`}},[`&.${s.checked} + .${s.track}`]:{backgroundColor:(t.vars||t).palette[a].main}}}))]}))),G=u("span",{name:"MuiSwitch",slot:"Track"})(d(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`}))),J=u("span",{name:"MuiSwitch",slot:"Thumb"})(d(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),K=M.forwardRef(function(a,o){const l=j({props:a,name:"MuiSwitch"}),{className:h,color:w="primary",edge:g=!1,size:S="medium",sx:v,slots:c={},slotProps:e={},...y}=l,i={...l,color:w,edge:g,size:S},n=H(i),b={slots:c,slotProps:e},[m,x]=k("root",{className:I(n.root,h),elementType:L,externalForwardedProps:b,ownerState:i,additionalProps:{sx:v}}),[C,B]=k("thumb",{className:n.thumb,elementType:J,externalForwardedProps:b,ownerState:i}),$=p.jsx(C,{...B}),[z,T]=k("track",{className:n.track,elementType:G,externalForwardedProps:b,ownerState:i});return p.jsxs(m,{...x,children:[p.jsx(X,{type:"checkbox",icon:$,checkedIcon:$,ref:o,ownerState:i,...y,classes:{...n,root:n.switchBase},slots:{...c.switchBase&&{root:c.switchBase},...c.input&&{input:c.input}},slotProps:{...e.switchBase&&{root:typeof e.switchBase=="function"?e.switchBase(i):e.switchBase},...e.input&&{input:typeof e.input=="function"?e.input(i):e.input}}}),p.jsx(z,{...T})]})}),Q=K;export{Q as S};
