import{c as E,_ as S,b as d,d as v,s as R,e as k,f as A,j as M,k as t}from"./OdysseyThemeProvider-Bh0Bu-2o.js";import{r as L}from"./index-NdkWRN8K.js";import{u as w,f as U}from"./useFormControl-BMISTZuX.js";import{j as p}from"./jsx-runtime-CnH95YSl.js";import{T as F}from"./Typography-ClQ35Rr-.js";import{S as W}from"./Stack-B7OGvu7C.js";const z=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],H=o=>{const{classes:e,disabled:l,labelPlacement:n,error:a,required:r}=o,m={root:["root",l&&"disabled",`labelPlacement${k(n)}`,a&&"error",r&&"required"],label:["label",l&&"disabled"],asterisk:["asterisk",a&&"error"]};return A(m,M,e)},I=R("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:l}=o;return[{[`& .${t.label}`]:e.label},e.root,e[`labelPlacement${k(l.labelPlacement)}`]]}})(({theme:o,ownerState:e})=>d({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${t.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${t.label}`]:{[`&.${t.disabled}`]:{color:(o.vars||o).palette.text.disabled}}})),B=R("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(o,e)=>e.asterisk})(({theme:o})=>({[`&.${t.error}`]:{color:(o.vars||o).palette.error.main}})),X=L.forwardRef(function(e,l){var n,a;const r=E({props:e,name:"MuiFormControlLabel"}),{className:m,componentsProps:j={},control:i,disabled:P,disableTypography:$,label:q,labelPlacement:N="end",required:C,slotProps:_={}}=r,T=S(r,z),b=w(),y=(n=P??i.props.disabled)!=null?n:b==null?void 0:b.disabled,u=C??i.props.required,x={disabled:y,required:u};["checked","name","onChange","value","inputRef"].forEach(c=>{typeof i.props[c]>"u"&&typeof r[c]<"u"&&(x[c]=r[c])});const D=U({props:r,muiFormControl:b,states:["error"]}),f=d({},r,{disabled:y,labelPlacement:N,required:u,error:D.error}),g=H(f),h=(a=_.typography)!=null?a:j.typography;let s=q;return s!=null&&s.type!==F&&!$&&(s=p.jsx(F,d({component:"span"},h,{className:v(g.label,h==null?void 0:h.className),children:s}))),p.jsxs(I,d({className:v(g.root,m),ownerState:f,ref:l},T,{children:[L.cloneElement(i,x),u?p.jsxs(W,{display:"block",children:[s,p.jsxs(B,{ownerState:f,"aria-hidden":!0,className:g.asterisk,children:[" ","*"]})]}):s]}))});export{X as F};
