import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/objectWithoutProperties";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{Tooltip as i}from"@material-ui/core";import{useMemo as n}from"react";import l from"classnames";import{useIsInsideIsolatedDcApp as a}from"../../components/DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import{useIsInsideDcFullscreenElem as c}from"../../components/DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import{Text as s}from"../Text/Text.js";import{DcTooltip as p}from"./DcTooltip.js";import m from"./Tooltip.scss.js";var d=["children","disabled","title","interactive","className","enterDelay","leaveDelay","enterTouchDelay","leaveTouchDelay","enterNextDelay","description","anchorEl"];function v(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function u(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?v(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):v(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var f=function(e){var v=e.children,f=e.disabled,D=e.title,y=e.interactive,b=void 0!==y&&y,h=e.className,O=e.enterDelay,j=void 0===O?100:O,P=e.leaveDelay,T=void 0===P?0:P,g=e.enterTouchDelay,w=void 0===g?700:g,N=e.leaveTouchDelay,E=void 0===N?1500:N,I=e.enterNextDelay,x=void 0===I?0:I,C=e.description,A=e.anchorEl,F=r(e,d),L=a(),z=c(),S=L&&!z?p:i,k=f||!D&&!C?"":t("div",{className:m.content,children:[D&&o(s,{size:12,className:m.title,tagName:"div",children:D}),C&&o(s,{size:12,color:"T6",tagName:"div",children:C})]}),H={disableFocusListener:f,disableHoverListener:f,disableTouchListener:f},W=n((function(){return{popper:l(m.root,h),tooltip:l(m.tooltip,C&&m.withDescription)}}),[h,C]),q=n((function(){return u(u({},A?{anchorEl:A}:{}),{},{popperOptions:{modifiers:{preventOverflow:{enabled:!0,boundariesElement:"viewport"}}}})}),[A]);return o(S,u(u(u({title:k,interactive:b,classes:W,enterDelay:j,leaveDelay:T,enterTouchDelay:w,leaveTouchDelay:E,enterNextDelay:x,PopperProps:q},H),F),{},{children:v}))};export{f as Tooltip};
//# sourceMappingURL=Tooltip.js.map
