import{r,j as t}from"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a71.js";import{u as j,f as g,s as E,c as y,o as _,b as h}from"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7110.js";import{c as f}from"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a718.js";import{_ as p}from"./v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a7111.js";const L=f()(e=>({modalEmoji:null,options:{},childrenRef:null,offset:0,auxFunc:{mounted:null,desmouted:null},open:(a,n,s,i=10,o={mounted:null,desmouted:null})=>e(c=>(o.mounted&&o.mounted(),c.childrenRef!==s&&c.auxFunc.desmouted&&c.auxFunc.desmouted(),{modalEmoji:a,options:n,childrenRef:s,offset:i,auxFunc:o})),close:()=>e(a=>(a.auxFunc.desmouted&&a.auxFunc.desmouted(),{modalEmoji:null,options:{}}))}));function R(){const{modalEmoji:e,options:a,childrenRef:n,offset:s,close:i}=L(),{refs:o,floatingStyles:c,update:x,elements:u}=j({...a,middleware:[g({padding:5}),E({padding:5}),y({apply({availableWidth:d,availableHeight:l,elements:m}){Object.assign(m.floating.style,{maxWidth:`${d}px`,maxHeight:`${l}px`})}}),_(s)]});return r.useLayoutEffect(()=>{if(e&&u.reference&&u.floating)return h(u.reference,u.floating,x)},[e,u,x]),r.useLayoutEffect(()=>{const d=l=>{const m=document.querySelector(".iziToast-wrapper");o.floating.current&&!o.floating.current.contains(l.target)&&!n.contains(l.target)&&(!m||!m.contains(l.target))&&!document.querySelector("#pane-side ._21S-L span")?.contains(l.target)&&i()};return n&&(o.setReference(n),document.addEventListener("click",d)),()=>{document.removeEventListener("click",d)}},[e,n]),e&&t.jsx("section",{"data-id":"Modal Emoji",children:t.jsx("div",{ref:o.setFloating,role:"tooltip",className:"z-[9999]",style:c,children:t.jsx("div",{className:"py-[9px] overflow-visible text-left bg-[var(--dropdown-background)] rounded-2xl shadow-2xl",style:{position:"initial",maxWidth:"100vw"},role:"application",children:t.jsx("ul",{"data-testid":"attach-menu-popup",children:t.jsx("div",{className:"py-[3px]",children:e})})})})})}const z=()=>f()((e,a)=>({emojiArea:null})),w=f()((e,a)=>({container:{},getContainer:n=>{const{container:s}=a();if(s[n])return s[n];{const i=z();return e(o=>({container:{...o.container,[n]:i}})),i}},deleteContainer:n=>e(s=>{const i={...s.container};return delete i[n],{container:i}})})),v=r.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a71108.js")),[]));function C({id:e}){return t.jsx(r.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(v,{id:e})})}const b=r.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a71111.js")),[]));function I({id:e}){return t.jsx(r.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(b,{id:e})})}const A=r.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_28_54378c94-eda0-47d4-8f59-c666edac6a71113.js")),[]));function M({id:e}){return t.jsx(r.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(A,{id:e})})}export{I,R as M,M as T,L as a,C as b,w as u};
