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