import{__rest as e,__assign as o}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as r,Fragment as i}from"react/jsx-runtime";import{withStyles as n,Tooltip as l,makeStyles as s}from"@material-ui/core";import a from"prop-types";import p from"classnames";import c from"@material-ui/icons/Language";import{useDevCenterRouter as d}from"../DevCenter/DevCenterRouterContext/effects/useDevCenterRouter.js";var m=n({tooltip:{padding:"4px 8px",display:"flex",alignItems:"center"}})(l),f=s((function(e){return{root:function(e){var o=e.color;return{color:o,fontSize:"inherit",lineHeight:"inherit",letterSpacing:"0.15px",textDecoration:"none","&:hover":{color:o,textDecoration:"underline"},"&:visited":{color:o}}},disabled:{color:e.palette.primary.dark,fontSize:"inherit",lineHeight:"inherit",letterSpacing:"0.15px"},icon:{marginRight:8},buttonLink:{border:"none",background:"none",padding:0,cursor:"pointer"}}})),u=function(n){var s=n.TooltipProps,a=n.children,u=n.className,h=n.color,b=n.disabled,g=n.showTooltip,x=n.tooltipText,T=n.target,k=n.href,v=e(n,["TooltipProps","children","className","color","disabled","showTooltip","tooltipText","target","href"]),N=f({color:h}),_=d();if(b)return t(l,o({title:"Disabled",placement:"bottom-start"},{children:t("span",o({className:p(N.disabled,u)},v,{children:a}))}));var R=_&&"_self"===T?t("button",o({tabIndex:0,role:"link",className:p(N.buttonLink,N.root,u),onClick:function(e){e.metaKey||e.ctrlKey?window.open(k,"_blank"):_.push(k)}},v,{children:a})):t("a",o({className:p(N.root,u),target:T,href:k,rel:"noopener noreferrer"},v,{children:a}));return g||x?t(m,o({title:r(i,{children:[t(c,{fontSize:"small",className:N.icon}),x||k]}),placement:"bottom-start"},s,{children:R})):R};a.node.isRequired,a.string.isRequired,a.string,a.string,a.oneOf(["_self","_blank"]),a.bool,a.bool,a.string,a.shape({}),u.propTypes={children:a.node.isRequired,href:a.string.isRequired,className:a.string,color:a.string,target:a.oneOf(["_self","_blank"]),disabled:a.bool,showTooltip:a.bool,tooltipText:a.string,TooltipProps:a.shape({})},u.defaultProps={TooltipProps:{},className:"",color:"#03bcd4",target:"_blank",disabled:!1,showTooltip:!1,tooltipText:""};export{u as default};
