import{S as b,i as L,s as E,k as h,l as f,m as v,h as m,n as _,p as d,b as A,E as p,H as w,B as g,L as M,A as S,W as y,N as k,o as D}from"./index-e4df490d.js";function N(t){let e,o,s,a,r;return{c(){e=h("div"),o=h("div"),s=h("span"),this.h()},l(i){e=f(i,"DIV",{class:!0,style:!0});var n=v(e);o=f(n,"DIV",{class:!0});var u=v(o);s=f(u,"SPAN",{});var c=v(s);c.forEach(m),u.forEach(m),n.forEach(m),this.h()},h(){_(o,"class","tooltip svelte-9tuy8m"),_(e,"class","tooltip-container svelte-9tuy8m"),d(e,"left",t[1]+"px"),d(e,"top",t[2]+"px"),d(e,"--offset",Math.min(-10,window.innerWidth-(t[1]+t[4]+10))+"px")},m(i,n){A(i,e,n),p(e,o),p(o,s),s.innerHTML=t[0],t[7](o),a||(r=[w(e,"mouseenter",t[5]),w(e,"mouseleave",t[6])],a=!0)},p(i,[n]){n&1&&(s.innerHTML=i[0]),n&2&&d(e,"left",i[1]+"px"),n&4&&d(e,"top",i[2]+"px"),n&18&&d(e,"--offset",Math.min(-10,window.innerWidth-(i[1]+i[4]+10))+"px")},i:g,o:g,d(i){i&&m(e),t[7](null),a=!1,M(r)}}}function B(t,e,o){let{html:s=""}=e,{x:a=0}=e,{y:r=0}=e,i=1,n;function u(l){y.call(this,t,l)}function c(l){y.call(this,t,l)}function T(l){k[l?"unshift":"push"](()=>{n=l,o(3,n)})}return t.$$set=l=>{"html"in l&&o(0,s=l.html),"x"in l&&o(1,a=l.x),"y"in l&&o(2,r=l.y)},t.$$.update=()=>{t.$$.dirty&9&&s&&n&&S().then(()=>{o(4,i=n.getBoundingClientRect().width)})},[s,a,r,n,i,u,c,T]}class C extends b{constructor(e){super(),L(this,e,B,N,E,{html:0,x:1,y:2})}}function P(){D(()=>{let t,e;function o(a){if(a.target.tagName==="DATA-LSP"){clearTimeout(e),t||(t=new C({target:document.body}),t.$on("mouseenter",()=>{clearTimeout(e)}),t.$on("mouseleave",()=>{clearTimeout(e),t.$destroy(),t=null}));const r=a.target.getBoundingClientRect(),i=a.target.getAttribute("lsp"),n=(r.left+r.right)/2+window.scrollX,u=r.top+window.scrollY;t.$set({html:i,x:n,y:u})}}function s(a){a.target.tagName==="DATA-LSP"&&(e=setTimeout(()=>{t.$destroy(),t=null},200))}return window.addEventListener("mouseover",o),window.addEventListener("mouseout",s),()=>{window.removeEventListener("mouseover",o),window.removeEventListener("mouseout",s)}})}export{P as s};
