import{o as T,n as P,f as u,q as i,t as d,r as j,v as M,y as k,w as O,j as p,x as D,z as y,d4 as I,dO as N,dP as U}from"./index-60657852.js";import{S as E}from"./SwitchBase-3b306fc6.js";function A(t){return P("MuiSwitch",t)}const F=T("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),s=F,X=t=>{const{classes:a,edge:o,size:l,color:h,checked:w,disabled:g}=t,v={root:["root",o&&`edge${i(o)}`,`size${i(l)}`],switchBase:["switchBase",`color${i(h)}`,w&&"checked",g&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},S=D(v,A,a);return{...a,...S}},q=u("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,a)=>{const{ownerState:o}=t;return[a.root,o.edge&&a[`edge${i(o.edge)}`],a[`size${i(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)"}}}}]}),L=u(E,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,a)=>{const{ownerState:o}=t;return[a.switchBase,{[`& .${s.input}`]:a.input},o.color!=="default"&&a[`color${i(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})`:y(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(I(["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})`:y(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"?N(t.palette[a].main,.62):U(t.palette[a].main,.55)}`}},[`&.${s.checked} + .${s.track}`]:{backgroundColor:(t.vars||t).palette[a].main}}}))]}))),V=u("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,a)=>a.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}`}))),G=u("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,a)=>a.thumb})(d(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),H=j.forwardRef(function(a,o){const l=M({props:a,name:"MuiSwitch"}),{className:h,color:w="primary",edge:g=!1,size:v="medium",sx:S,slots:c={},slotProps:e={},...f}=l,r={...l,color:w,edge:g,size:v},n=X(r),b={slots:c,slotProps:e},[m,x]=k("root",{className:O(n.root,h),elementType:q,externalForwardedProps:b,ownerState:r,additionalProps:{sx:S}}),[C,B]=k("thumb",{className:n.thumb,elementType:G,externalForwardedProps:b,ownerState:r}),$=p.jsx(C,{...B}),[z,R]=k("track",{className:n.track,elementType:V,externalForwardedProps:b,ownerState:r});return p.jsxs(m,{...x,children:[p.jsx(L,{type:"checkbox",icon:$,checkedIcon:$,ref:o,ownerState:r,...f,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(r):e.switchBase},...e.input&&{input:typeof e.input=="function"?e.input(r):e.input}}}),p.jsx(z,{...R})]})}),Q=H;export{Q as S};
