"use strict";(self.webpackChunkflow_web_extension=self.webpackChunkflow_web_extension||[]).push([["35825"],{887126:function(e,t,r){r.r(t),r.d(t,{HoverTextTranslate:()=>C});var n=r(652983),o=r(468461),u=r(975858),a=r(610676),s=r(42804),l=r(61565),c=["block","flow-root","grid","list-item","flex","-webkit-box"],i=e=>{var t=getComputedStyle(e).getPropertyValue("display"),r="br"===e.tagName.toLowerCase()||c.includes(t)||t.includes("table");return{display:t,isBlockOrTableDisplay:r}},v=e=>{for(var t=null==e?void 0:e.parentElement,r=0;r<5;r++){if(!t)return null;var{isBlockOrTableDisplay:n}=i(t);if(n)return t;t=null==t?void 0:t.parentElement}},d=e=>e.querySelector(".".concat(s.H2)),m=e=>!!e.querySelector(".".concat(a.nm)),T=(e,t)=>{var r=m(e),n=d(e);!(r||e.classList.contains(s.H2)||e.classList.contains(a.Ru)||n)&&(t.current=setTimeout(()=>{(0,l.Cy)(e),(0,u._E)()},200))},f=r(349779),E=r(871296),L=r(918721),_=r(210331),p=r(922683),y=r(851562),C=()=>{var e=(0,n.useRef)(),t=(0,n.useRef)(null),r=(0,n.useRef)(null),[u,a]=(0,n.useState)(!1),[s]=(0,y.e)("hoverTranslateSetting"),l=s===E.o6.TRANSLATE_DIRECTLY||u,c=(0,L.eQ)(),d=()=>{r.current&&clearTimeout(r.current),t.current=null,e.current&&e.current.removeEventListener("mouseleave",d)},m=(0,o.Z)(n=>{if(n.target){var o=n.target;if(o instanceof HTMLElement){e.current=o,e.current.addEventListener("mouseleave",d);var{isBlockOrTableDisplay:u}=i(o);if(o.childNodes.length>0&&Array.from(o.childNodes).some(e=>{var t=e.textContent;return e.nodeType===Node.TEXT_NODE&&t&&/\S/.test(t)})){if(u)t.current=o,l&&T(o,r);else{var a=v(o);t.current=a,a&&l&&T(a,r)}}}}},300),C=(0,n.useCallback)(e=>{if(!e.repeat){var n=(0,p.C)(e),o=n.replace(/\+/g,"");s===E.o6.TRANSLATE_BY_COMMAND&&o===(0,_.DQ)(_.q_.Command)||s===E.o6.TRANSLATE_BY_OPTION&&o===(0,_.DQ)(_.q_.Option)||s===E.o6.TRANSLATE_BY_CUSTOM_SHORTCUT&&[n,o].includes(c[f.j.HoverTextTranslate].key)?(t.current&&T(t.current,r),a(!0)):a(!1)}},[s,c]),k=()=>{a(!1)};return(0,n.useEffect)(()=>(document.addEventListener("mouseover",m),document.addEventListener("keydown",C),document.addEventListener("keyup",k),()=>{document.removeEventListener("mouseover",m),document.removeEventListener("keydown",C),document.removeEventListener("keyup",k),e.current&&e.current.removeEventListener("mouseleave",d)}),[m,C,k,d]),null}}}]);
//# sourceMappingURL=hover-text-translate.js.map