import{a as E,g as U,r as y,u as A,f as z,T as P,j as c,c as x,s as F,h as L,b as B,m as v}from"./render-BEL5IN7j.js";import{u as H,f as I}from"./formControlState-YO0xWqIm.js";function W(e){return U("MuiFormControlLabel",e)}const l=E("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),G=e=>{const{classes:o,disabled:s,labelPlacement:r,error:p,required:m}=e,d={root:["root",s&&"disabled",`labelPlacement${L(r)}`,p&&"error",m&&"required"],label:["label",s&&"disabled"],asterisk:["asterisk",p&&"error"]};return B(d,W,o)},J=F("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[{[`& .${l.label}`]:o.label},o.root,o[`labelPlacement${L(s.labelPlacement)}`]]}})(v(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${l.disabled}`]:{cursor:"default"},[`& .${l.label}`]:{[`&.${l.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:o})=>o==="start"||o==="top"||o==="bottom",style:{marginLeft:16}}]}))),K=F("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(v(({theme:e})=>({[`&.${l.error}`]:{color:(e.vars||e).palette.error.main}}))),_=y.forwardRef(function(o,s){const r=A({props:o,name:"MuiFormControlLabel"}),{checked:p,className:m,componentsProps:d={},control:a,disabled:R,disableTypography:T,inputRef:O,label:q,labelPlacement:S="end",name:Q,onChange:V,required:$,slots:j={},slotProps:k={},value:X,...w}=r,f=H(),C=R??a.props.disabled??f?.disabled,b=$??a.props.required,g={disabled:C,required:b};["checked","name","onChange","value","inputRef"].forEach(i=>{typeof a.props[i]>"u"&&typeof r[i]<"u"&&(g[i]=r[i])});const M=I({props:r,muiFormControl:f,states:["error"]}),n={...r,disabled:C,labelPlacement:S,required:b,error:M.error},u=G(n),N={slots:j,slotProps:{...d,...k}},[D,h]=z("typography",{elementType:P,externalForwardedProps:N,ownerState:n});let t=q;return t!=null&&t.type!==P&&!T&&(t=c.jsx(D,{component:"span",...h,className:x(u.label,h?.className),children:t})),c.jsxs(J,{className:x(u.root,m),ownerState:n,ref:s,...w,children:[y.cloneElement(a,g),b?c.jsxs("div",{children:[t,c.jsxs(K,{ownerState:n,"aria-hidden":!0,className:u.asterisk,children:[" ","*"]})]}):t]})});export{_ as F};
//# sourceMappingURL=FormControlLabel-BUI234x4.js.map
