"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),e=require("react"),k=require("react-tiny-popover"),q=require("../../utils/useIsMobile.cjs.js"),j=require("../../src/components/ComplexTooltip/complexTooltip.module.css"),y=require("./components/ComplexTooltipContent/ComplexTooltipContent.cjs.js"),O=({trigger:n,title:p,description:m,link:v,transformMode:u="relative",transform:b={top:0,left:0},style:f="light",isBlurred:C=!1,children:c,positions:T=["top","bottom","left","right"],onClose:s})=>{const[M,i]=e.useState(!1),t=e.useRef(null),r=e.useCallback(()=>{t.current&&clearTimeout(t.current),t.current=setTimeout(()=>i(!0),200)},[]),o=e.useCallback(()=>{t.current=setTimeout(()=>{i(!1),s==null||s()},200)},[s]),a=e.useCallback(()=>i(h=>!h),[]),d=e.useMemo(()=>n==="hover"?{onMouseEnter:r,onMouseLeave:o}:{onClick:a},[n,r,o,a]),x=e.useMemo(()=>n==="hover"?{onMouseEnter:r,onMouseLeave:o}:{},[n,r,o]);return e.useEffect(()=>()=>{t.current&&clearTimeout(t.current)},[]),q.useIsMobile()?c:l.jsx(k.Popover,{isOpen:M,positions:T,padding:8,onClickOutside:o,containerClassName:j.popover,transformMode:u,transform:u==="absolute"?b:void 0,containerStyle:{pointerEvents:u==="absolute"?"none":"auto"},content:l.jsx(y.ComplexTooltipContent,{title:p,description:m,link:v,style:f,isBlurred:C,onClose:o,...x}),children:l.jsx("div",{...d,children:c})})};exports.ComplexTooltip=O;
