"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("react/jsx-runtime"),a=require("react"),l=require("classnames"),i=require("@material-ui/core"),o=require("./style.css.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(e),n=s(t),d=s(l),b=["root","track","switchBase"];function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){c.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h=i.makeStyles((function(e){return{root:{width:60,height:40,padding:13,"&.MuiSwitch-sizeSmall":{width:52,height:36,padding:13},"& .MuiSwitch-switchBase":{padding:10}},switchBase:{padding:10,color:"#03BCD4","&.MuiIconButton-root:hover":{backgroundColor:"rgba(3, 188, 212, 0.08)"}},switchBaseDisabled:{color:"#196069 !important"},track:{backgroundColor:"#196069 !important",opacity:"1 !important",border:"none"},trackDisabled:{backgroundColor:"#223D40 !important",opacity:"1 !important",border:"none"},switchBaseDisabledNoLabels:{color:"#545454 !important"},trackDisabledNoLabels:{backgroundColor:"#3D3D3D !important",opacity:"1 !important",border:"none"},label:{display:"flex",justifyContent:"center",flexDirection:"column",fontSize:"16px",lineHeight:"22px",color:e.palette.primary.text7,margin:"8px 0px",cursor:"pointer"},labelSmall:{fontSize:"14px",lineHeight:"20px"},disabledLabel:{cursor:"default",color:"#808080"},activeLabel:{color:e.palette.primary.text1}}})),f=a.forwardRef((function(e,t){var a,l,s=e.title,p=e.leftLabel,f=e.rightLabel,m=e.checked,g=e.onChange,y=e.disabled,j=e.size,w=e.className,x=e.rightLabelTooltip,D=e.leftLabelTooltip,L=e.customClasses,O=e["data-testid"],k=h(),v=p&&f,C=L||{},S=C.root,B=C.track,P=C.switchBase,N=n.default(C,b);return r.jsxs("div",{className:w,children:[s&&r.jsx("div",{className:o.switchControlTitle,children:s}),r.jsxs(i.Grid,{component:"label",container:!0,alignItems:"center",spacing:0,children:[p&&r.jsx(i.Grid,{item:!0,children:r.jsx(i.Tooltip,{title:null!=D?D:"",children:r.jsx(i.Typography,{variant:"body2",className:d.default(k.label,"small"===j&&k.labelSmall,(!m||!f)&&!y&&k.activeLabel,y&&k.disabledLabel),children:p})})}),r.jsx(i.Grid,{item:!0,children:r.jsx(i.Switch,{"data-testid":"".concat(O,"_switch_").concat(m),ref:t,checked:m,onChange:g,color:"primary",disabled:y,classes:u({root:d.default(k.root,S),switchBase:d.default((a={},c.default(a,k.switchBase,v||m&&!y),c.default(a,k.switchBaseDisabled,y&&(v||m)),c.default(a,k.switchBaseDisabledNoLabels,!v&&y&&!m),a),P),track:d.default((l={},c.default(l,k.track,v||m&&!y),c.default(l,k.trackDisabled,y&&(v||m)),c.default(l,k.trackDisabledNoLabels,!v&&y&&!m),l),B)},N),size:j})}),f&&r.jsx(i.Grid,{item:!0,children:r.jsx(i.Tooltip,{title:null!=x?x:"",children:r.jsx(i.Typography,{variant:"body2",className:d.default(k.label,"small"===j&&k.labelSmall,(m||!p)&&!y&&k.activeLabel,y&&k.disabledLabel),children:f})})})]})]})}));f.defaultProps={title:"",leftLabel:"",rightLabel:"",disabled:!1,size:"medium",className:"",customClasses:{},rightLabelTooltip:"",leftLabelTooltip:"","data-testid":"SwitchControlComponent"},exports.SwitchControlComponent=f,exports.default=f;
//# sourceMappingURL=index.js.map
