import{__rest as o,__assign as r}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as t}from"react/jsx-runtime";import a from"classnames";import{makeStyles as i,Tooltip as e,IconButton as n}from"@material-ui/core";import{useState as l}from"react";var s=i((function(o){return{root:{borderRadius:"8px !important",color:o.palette.primary.text6,padding:6,"&:hover":{color:"#FFFFFF",backgroundColor:"rgba(255, 255, 255, 0.16)",backdropFilter:"blur(2px)","&.MuiIconButton-colorPrimary":{color:o.palette.primary.light}},"&:active":{color:"#FFFFFF","&.MuiIconButton-colorPrimary":{color:o.palette.primary.light}},"&.Mui-disabled":{pointerEvents:"all",opacity:.4,color:"#FFFFFF",backgroundColor:"transparent","&.MuiIconButton-colorPrimary":{color:o.palette.primary.main}},"& .MuiSvgIcon-root":{color:"inherit",fontSize:"inherit"},"& .MuiTouchRipple-child":{borderRadius:8,backgroundColor:"rgba(255, 255, 255, 0.16)"}},colorPrimary:{color:o.palette.primary.main},sizeSmall:{fontSize:20,padding:6,height:32,width:32,"& .i-icon, & .i-icon > svg":{width:20,height:20}},sizeLarge:{"&.MuiButtonBase-root":{padding:8}},contained:{backgroundColor:"rgba(255, 255, 255, 0.08)",backdropFilter:"blur(2px)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"}},containedDisabled:{"&.MuiButtonBase-root":{backgroundColor:"rgba(255, 255, 255, 0.08)"}},transparent:{color:o.palette.primary.contrastText,backgroundColor:"rgba(255, 255, 255, 0.2)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},transparentDisabled:{"&.MuiButtonBase-root":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},tooltipPopper:{"& .MuiTooltip-tooltip":{backgroundColor:function(r){return"transparent"===r.variant?"rgba(255, 255, 255, 0.2)":o.palette.background.b10}}},active:{"&.MuiButtonBase-root":{color:o.palette.primary.main,backgroundColor:"rgba(255, 255, 255, 0.12)","&.MuiIconButton-colorPrimary":{color:o.palette.primary.main},"&.transparent":{color:o.palette.primary.contrastText,backgroundColor:"rgba(255, 255, 255, 0.2)"}}}}})),c=function(i){var c,d,p,u,m,b=i.tooltipProps,g=void 0===b?{title:"",classes:{}}:b,v=i.isActive,F=void 0!==v&&v,y=i.size,h=void 0===y?"medium":y,k=i.variant,f=void 0===k?"default":k,B=i.className,P=i["data-testid"],z=void 0===P?"IconButton":P,C=o(i,["tooltipProps","isActive","size","variant","className","data-testid"]),M=C.classes,x=void 0===M?{}:M,I=s({variant:f}),S=l(!1),D=S[0],N=S[1],T=r(r({},x),{root:a(x.root,I.root,(c={},c[I.sizeLarge]="large"===h,c[I.contained]="contained"===f,c[I.transparent]="transparent"===f,c)),disabled:a(x.disabled,(d={},d[I.containedDisabled]="contained"===f,d[I.transparentDisabled]="transparent"===f,d)),colorPrimary:a(x.colorPrimary,I.colorPrimary),sizeSmall:a(x.sizeSmall,I.sizeSmall)});return g.title?t(e,r({open:D},g,{classes:r(r({},g.classes),{popper:a(I.tooltipPopper,null===(m=g.classes)||void 0===m?void 0:m.popper)}),children:t(n,r({"data-testid":z,classes:T,className:a(B,(p={},p[I.active]=F,p),f),onPointerOver:function(){return N(!0)},onPointerOut:function(){return N(!1)},size:h},C))})):t(n,r({"data-testid":z,classes:T,className:a(B,(u={},u[I.active]=F,u),f),size:h},C))};export{c as default};
