"use strict";var e=require('./../../ext-esm/tslib/tslib.es6.js'),o=require("react/jsx-runtime"),s=require("react"),i=require("classnames"),c=require("@material-ui/core"),r=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/MoreApp.js");var n=require("../../utils/main.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=t(i),a=c.makeStyles((function(e){return{iconWrapper:{color:e.palette.primary.text6,cursor:"pointer",paddingLeft:4,display:"flex",alignItems:"center","&:hover":{color:e.palette.primary.contrastText}},tooltip:{color:e.palette.primary.text6,backgroundColor:"rgba(20, 20, 20, 0.5)"}}}));module.exports=function(i){var t=i.children,l=i.classes,p=void 0===l?{}:l,d=i.dataTestId,m=i.IconComponent,j=void 0===m?function(){return o.jsx(r.CopyIcon,{size:16})}:m,q=i.tooltipProps,I=void 0===q?{title:"Copied",placement:"bottom",delay:1500}:q,f=s.useState(!1),C=f[0],b=f[1],x=a();return s.useEffect((function(){var e=setTimeout((function(){b(!1)}),I.delay);return function(){return clearTimeout(e)}}),[C]),o.jsx(c.Tooltip,e.__assign({classes:{tooltip:u.default(x.tooltip,p.tooltip),popper:p.tooltipPopper},title:I.title,open:C,disableFocusListener:!0,disableHoverListener:!0,placement:I.placement},{children:o.jsx("span",e.__assign({className:u.default(x.iconWrapper,p.iconWrapper),onClick:function(){b(!0),n.copyToClipboard(t)}},{children:o.jsx(j,{className:p.icon,"data-testid":d})}))}))};
