import r from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/objectWithoutProperties";import{jsx as e}from"react/jsx-runtime";import i from"classnames";import{makeStyles as a,fade as n,Tooltip as c,IconButton as l}from"@material-ui/core";import{useState as s}from"react";var p=["tooltipProps","isActive","size","variant","className","data-testid"];function u(r,o){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);o&&(e=e.filter((function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable}))),t.push.apply(t,e)}return t}function d(o){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?u(Object(e),!0).forEach((function(t){r(o,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(e,r))}))}return o}var b=a((function(r){var o=r.palette,t=o.primary.text1||"#fff",e={b08:n(t,.08),b010:n(t,.1),b012:n(t,.12),b016:n(t,.16),b020:n(t,.2)};return{root:{borderRadius:"8px !important",color:o.primary.text6,padding:6,"&:hover":{color:t,backgroundColor:e.b016,backdropFilter:"blur(2px)","&.MuiIconButton-colorPrimary":{color:o.primary.light}},"&:active":{color:t,"&.MuiIconButton-colorPrimary":{color:o.primary.light}},"&.Mui-disabled":{pointerEvents:"all",opacity:.4,color:o.primary.text1,backgroundColor:"transparent","&.MuiIconButton-colorPrimary":{color:o.primary.main}},"& .MuiSvgIcon-root":{color:"inherit",fontSize:"inherit"}},colorPrimary:{color:o.primary.main},sizeSmall:{fontSize:20,padding:6,height:32,width:32,"& .i-icon, & .i-icon > svg":{width:"20px !important",height:"20px !important"}},sizeLarge:{"&.MuiButtonBase-root":{padding:8}},contained:{backgroundColor:e.b08,backdropFilter:"blur(2px)","&:hover":{backgroundColor:e.b016}},containedDisabled:{"&.MuiButtonBase-root":{backgroundColor:e.b08}},transparent:{color:o.primary.contrastText,backgroundColor:e.b020,"&:hover":{backgroundColor:e.b010}},transparentDisabled:{"&.MuiButtonBase-root":{backgroundColor:e.b010}},tooltipPopper:{"& .MuiTooltip-tooltip":{backgroundColor:function(r){return"transparent"===r.variant?e.b020:o.background.b10}}},active:{"&.MuiButtonBase-root":{color:o.primary.main,backgroundColor:e.b012,"&.MuiIconButton-colorPrimary":{color:o.primary.main},"&.transparent":{color:o.primary.contrastText,backgroundColor:e.b020}}}}})),m={center:!1},v=function(a){var n,u,v,y=a.tooltipProps,f=void 0===y?{title:"",classes:{}}:y,g=a.isActive,P=void 0!==g&&g,h=a.size,O=void 0===h?"medium":h,k=a.variant,B=void 0===k?"default":k,j=a.className,x=a["data-testid"],z=void 0===x?"IconButton":x,C=t(a,p),M=C.classes,S=void 0===M?{}:M,w=b({variant:B}),D=s(!1),I=o(D,2),T=I[0],N=I[1],A=d(d({},S),{},{root:i(S.root,w.root,(n={},r(n,w.sizeLarge,"large"===O),r(n,w.contained,"contained"===B),r(n,w.transparent,"transparent"===B),n)),disabled:i(S.disabled,(u={},r(u,w.containedDisabled,"contained"===B),r(u,w.transparentDisabled,"transparent"===B),u)),colorPrimary:i(S.colorPrimary,w.colorPrimary),sizeSmall:i(S.sizeSmall,w.sizeSmall)});return f.title?e(c,d(d({open:T},f),{},{classes:d(d({},f.classes),{},{popper:i(w.tooltipPopper,null===(v=f.classes)||void 0===v?void 0:v.popper)}),children:e(l,d({"data-testid":z,classes:A,className:i(j,r({},w.active,P),B),onPointerOver:function(){return N(!0)},onPointerOut:function(){return N(!1)},size:O,TouchRippleProps:m},C))})):e(l,d({"data-testid":z,classes:A,className:i(j,r({},w.active,P),B),size:O,TouchRippleProps:m},C))};export{v as default};
//# sourceMappingURL=index.js.map
