import{q as T,k as D,r as I,_ as A,b as d,j as f,o as R,c as M,z as _,v as O,B as V,R as X,t as Y,w as z}from"./index-G4l7qcMm.js";import{u as Z,b as W,g as ee}from"./Input-BJwdycW3.js";import{S as oe}from"./Stack-Cwu0vGSf.js";function se(e){return T("PrivateSwitchBase",e)}D("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const te=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],ae=e=>{const{classes:o,checked:a,disabled:r,edge:t}=e,s={root:["root",a&&"checked",r&&"disabled",t&&`edge${_(t)}`],input:["input"]};return O(s,se,o)},le=R(V,{name:"MuiSwitchBase"})(({ownerState:e})=>d({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),re=R("input",{name:"MuiSwitchBase",shouldForwardProp:X})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),he=I.forwardRef(function(o,a){const{autoFocus:r,checked:t,checkedIcon:s,className:g,defaultChecked:x,disabled:p,disableFocusRipple:C=!1,edge:L=!1,icon:S,id:w,inputProps:v,inputRef:q,name:$,onBlur:m,onChange:P,onFocus:b,readOnly:B,required:N=!1,tabIndex:k,type:n,value:h}=o,i=A(o,te),[u,H]=Z({controlled:t,default:!!x,name:"SwitchBase",state:"checked"}),c=W(),G=l=>{b&&b(l),c&&c.onFocus&&c.onFocus(l)},J=l=>{m&&m(l),c&&c.onBlur&&c.onBlur(l)},K=l=>{if(l.nativeEvent.defaultPrevented)return;const U=l.target.checked;H(U),P&&P(l,U)};let y=p;c&&typeof y>"u"&&(y=c.disabled);const Q=n==="checkbox"||n==="radio",j=d({},o,{checked:u,disabled:y,disableFocusRipple:C,edge:L}),E=ae(j);return f.jsxs(le,d({component:"span",className:M(E.root,g),centerRipple:!0,focusRipple:!C,disabled:y,tabIndex:null,role:void 0,onFocus:G,onBlur:J,ownerState:j,ref:a},i,{children:[f.jsx(re,d({autoFocus:r,checked:t,defaultChecked:x,className:E.input,disabled:y,id:Q?w:void 0,name:$,onChange:K,readOnly:B,ref:q,required:N,ownerState:j,tabIndex:k,type:n},n==="checkbox"&&h===void 0?{}:{value:h},v)),u?s:S]}))});function ne(e){return T("MuiFormControlLabel",e)}const F=D("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),ie=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],ce=e=>{const{classes:o,disabled:a,labelPlacement:r,error:t,required:s}=e,g={root:["root",a&&"disabled",`labelPlacement${_(r)}`,t&&"error",s&&"required"],label:["label",a&&"disabled"],asterisk:["asterisk",t&&"error"]};return O(g,ne,o)},de=R("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:a}=e;return[{[`& .${F.label}`]:o.label},o.root,o[`labelPlacement${_(a.labelPlacement)}`]]}})(({theme:e,ownerState:o})=>d({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${F.disabled}`]:{cursor:"default"}},o.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},o.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},o.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${F.label}`]:{[`&.${F.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),ue=R("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(({theme:e})=>({[`&.${F.error}`]:{color:(e.vars||e).palette.error.main}})),fe=I.forwardRef(function(o,a){var r,t;const s=Y({props:o,name:"MuiFormControlLabel"}),{className:g,componentsProps:x={},control:p,disabled:C,disableTypography:L,label:S,labelPlacement:w="end",required:v,slotProps:q={}}=s,$=A(s,ie),m=W(),P=(r=C??p.props.disabled)!=null?r:m?.disabled,b=v??p.props.required,B={disabled:P,required:b};["checked","name","onChange","value","inputRef"].forEach(u=>{typeof p.props[u]>"u"&&typeof s[u]<"u"&&(B[u]=s[u])});const N=ee({props:s,muiFormControl:m,states:["error"]}),k=d({},s,{disabled:P,labelPlacement:w,required:b,error:N.error}),n=ce(k),h=(t=q.typography)!=null?t:x.typography;let i=S;return i!=null&&i.type!==z&&!L&&(i=f.jsx(z,d({component:"span"},h,{className:M(n.label,h?.className),children:i}))),f.jsxs(de,d({className:M(n.root,g),ownerState:k,ref:a},$,{children:[I.cloneElement(p,B),b?f.jsxs(oe,{display:"block",children:[i,f.jsxs(ue,{ownerState:k,"aria-hidden":!0,className:n.asterisk,children:[" ","*"]})]}):i]}))});export{fe as F,he as S,F as f};
