import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/objectWithoutProperties";import{jsxs as r,jsx as a}from"react/jsx-runtime";import{forwardRef as i}from"react";import o from"classnames";import{makeStyles as l,Grid as c,Tooltip as s,Typography as n,Switch as b}from"@material-ui/core";import d from"./style.css.js";var p=["root","track","switchBase"];function m(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 h(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?m(Object(a),!0).forEach((function(r){e(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):m(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}var u=l((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=i((function(i,l){var m,f,g=i.title,w=i.leftLabel,y=i.rightLabel,D=i.checked,L=i.onChange,O=i.disabled,k=i.size,j=i.className,v=i.rightLabelTooltip,C=i.leftLabelTooltip,x=i.customClasses,B=i["data-testid"],P=u(),S=w&&y,N=x||{},z=N.root,T=N.track,M=N.switchBase,E=t(N,p);return r("div",{className:j,children:[g&&a("div",{className:d.switchControlTitle,children:g}),r(c,{component:"label",container:!0,alignItems:"center",spacing:0,children:[w&&a(c,{item:!0,children:a(s,{title:null!=C?C:"",children:a(n,{variant:"body2",className:o(P.label,"small"===k&&P.labelSmall,(!D||!y)&&!O&&P.activeLabel,O&&P.disabledLabel),children:w})})}),a(c,{item:!0,children:a(b,{"data-testid":"".concat(B,"_switch_").concat(D),ref:l,checked:D,onChange:L,color:"primary",disabled:O,classes:h({root:o(P.root,z),switchBase:o((m={},e(m,P.switchBase,S||D&&!O),e(m,P.switchBaseDisabled,O&&(S||D)),e(m,P.switchBaseDisabledNoLabels,!S&&O&&!D),m),M),track:o((f={},e(f,P.track,S||D&&!O),e(f,P.trackDisabled,O&&(S||D)),e(f,P.trackDisabledNoLabels,!S&&O&&!D),f),T)},E),size:k})}),y&&a(c,{item:!0,children:a(s,{title:null!=v?v:"",children:a(n,{variant:"body2",className:o(P.label,"small"===k&&P.labelSmall,(D||!w)&&!O&&P.activeLabel,O&&P.disabledLabel),children:y})})})]})]})}));f.defaultProps={title:"",leftLabel:"",rightLabel:"",disabled:!1,size:"medium",className:"",customClasses:{},rightLabelTooltip:"",leftLabelTooltip:"","data-testid":"SwitchControlComponent"};export{f as SwitchControlComponent,f as default};
//# sourceMappingURL=index.js.map
