(function(){try{var g=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};g["__faroBundleId_Speechify Chrome Extension"]="13.4.1"}catch(l){}})();
import{a as E}from"./chunk-4XUNBFJC.js";import{Ic as M,Jc as P,Vc as $,Yc as v}from"./chunk-XMRXO6YU.js";import{h as x}from"./chunk-ODCFEFOB.js";import{i as l,n as w,q as R}from"./chunk-24ZZP5UQ.js";import{g as k}from"./chunk-GQY3J744.js";import{d as g,g as i,i as s,n}from"./chunk-CLPINNGF.js";n();i();var B=l.div`
  ${({isThemeSwitching:o})=>o?`* {
        transition-duration: ${M}ms !important;
        transition-property: all;
        transition-timing-function: ease;
      }`:""}
`,j=o=>{let{isThemeSwitching:e,initialized:t}=P();return t?s(B,{isThemeSwitching:e,...o}):null};n();i();var m=g(k());n();i();var U=l.div`
  position: relative;
  display: flex;
  align-items: center;
  z-index: ${v+1};
`,X=l.div`
  position: absolute;
  padding: 4px;
  border-radius: 6px;
  font-family: system-ui;
  ${R["body-7"]};
  color: ${w["icn-txt-prim-inv"]};
  display: flex;
  gap: 6px;
  white-space: nowrap;
  ${({animate:o})=>o?"transition: all 0.33s cubic-bezier(0.14, 1, 0.34, 1);":""};

  opacity: ${({visible:o})=>o?1:0};
  ${({visible:o})=>!o&&"pointer-events: none;"}

  ${({isOnTop:o})=>o?"top: -16px; left: 50%; transform: translate(-50%, -100%)":"top: 50%; transform: translateY(-50%)"};

  ${({showOnRight:o,isOnTop:e,visible:t})=>e?"":o?`left: ${t?"100%":"calc(100% - 10px)"}; margin-left: 4px;`:`right: ${t?"100%":"calc(100% + 10px)"}; margin-right: 4px;`}

  ${({isDarkMode:o})=>o?"background: #FFFFFF;":"background: #1E1E1F99; backdrop-filter: blur(24px);"};
`,h={TooltipWrapper:U,Tooltip:X};n();i();var r=g(k());var a=x(()=>({skipAnimation:!1})),A=()=>{let[o,e]=(0,r.useState)(!1),t=(0,r.useRef)(),p=(0,r.useRef)(),c=(0,r.useCallback)(()=>{let d=a.getState().skipAnimation;clearTimeout(a.getState().timeoutId),p.current=window.setTimeout(()=>{e(!0),t.current=window.setTimeout(()=>{a.setState({skipAnimation:!0})},330)},d?0:500)},[]),u=(0,r.useCallback)(()=>{clearTimeout(p.current),e(!1),a.setState({timeoutId:window.setTimeout(()=>{clearTimeout(t.current),a.setState({skipAnimation:!1})},1500)})},[]);return{showTooltip:o,onMouseEnter:c,onMouseLeave:u}};var uo=({children:o,disabled:e,text:t,visible:p=!0,forceShow:c=!1,style:u,tooltipStyle:d,className:O,isOnTop:C})=>{let F=a(f=>f.skipAnimation),I=$(f=>f.showOnRight),{onMouseLeave:N,onMouseEnter:D,showTooltip:W}=A(),L=E(),[T,y]=(0,m.useState)(!1),_=()=>y(!0);(0,m.useEffect)(()=>{T&&setTimeout(()=>{y(!1)},500)},[T]);let z=p&&(W&&!T||c)&&!e&&!!t;return s(h.TooltipWrapper,{onClick:_,onMouseLeave:N,onMouseEnter:D,style:u,className:O},s(h.Tooltip,{visible:z,"aria-roledescription":"tooltip",showOnRight:I,isOnTop:C,isDarkMode:L,style:d,animate:!F},t),o)};export{j as a,uo as b};
//# sourceMappingURL=chunk-YIDICXDP.js.map
