"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styles=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")),React=_interopRequireWildcard(require("react")),_propTypes=_interopRequireDefault(require("prop-types")),_clsx=_interopRequireDefault(require("clsx")),_utils=require("@material-ui/utils"),_FormControl=require("../FormControl"),_withStyles=_interopRequireDefault(require("../styles/withStyles")),_Typography=_interopRequireDefault(require("../Typography")),_capitalize=_interopRequireDefault(require("../utils/capitalize")),styles=function(e){return{root:{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,"&$disabled":{cursor:"default"}},labelPlacementStart:{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},labelPlacementTop:{flexDirection:"column-reverse",marginLeft:16},labelPlacementBottom:{flexDirection:"column",marginLeft:16},disabled:{},label:{"&$disabled":{color:e.palette.text.disabled}}}};exports.styles=styles;var FormControlLabel=React.forwardRef(function(t,e){t.checked;var r=t.classes,l=t.className,a=t.control,o=t.disabled,i=(t.inputRef,t.label),s=t.labelPlacement,n=void 0===s?"end":s,p=(t.name,t.onChange,t.value,(0,_objectWithoutProperties2.default)(t,["checked","classes","className","control","disabled","inputRef","label","labelPlacement","name","onChange","value"])),s=(0,_FormControl.useFormControl)(),o=o,u={disabled:o=void 0===(o=void 0===o&&void 0!==a.props.disabled?a.props.disabled:o)&&s?s.disabled:o};return["checked","name","onChange","value","inputRef"].forEach(function(e){void 0===a.props[e]&&void 0!==t[e]&&(u[e]=t[e])}),React.createElement("label",(0,_extends2.default)({className:(0,_clsx.default)(r.root,l,"end"!==n&&r["labelPlacement".concat((0,_capitalize.default)(n))],o&&r.disabled),ref:e},p),React.cloneElement(a,u),React.createElement(_Typography.default,{component:"span",className:(0,_clsx.default)(r.label,o&&r.disabled)},i))});"production"!==process.env.NODE_ENV&&(FormControlLabel.propTypes={checked:_propTypes.default.bool,classes:_propTypes.default.object,className:_propTypes.default.string,control:_propTypes.default.element.isRequired,disabled:_propTypes.default.bool,inputRef:_utils.refType,label:_propTypes.default.node,labelPlacement:_propTypes.default.oneOf(["bottom","end","start","top"]),name:_propTypes.default.string,onChange:_propTypes.default.func,value:_propTypes.default.any});var _default=(0,_withStyles.default)(styles,{name:"MuiFormControlLabel"})(FormControlLabel);exports.default=_default;