import{j as t,_ as f}from"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f10.js";import{a as r}from"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f4.js";import{u as g,f as E,s as y,c as _,o as h,b as L}from"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f9.js";import{c as p}from"./v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f7.js";const z=p()(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 w(){const{modalEmoji:e,options:a,childrenRef:n,offset:s,close:i}=z(),{refs:o,floatingStyles:c,update:x,elements:u}=g({...a,middleware:[E({padding:5}),y({padding:5}),_({apply({availableWidth:d,availableHeight:l,elements:m}){Object.assign(m.floating.style,{maxWidth:`${d}px`,maxHeight:`${l}px`})}}),h(s)]});return r.useLayoutEffect(()=>{if(e&&u.reference&&u.floating)return L(u.reference,u.floating,x)},[e,u,x]),r.useLayoutEffect(()=>{const d=l=>{var j;const m=document.querySelector(".iziToast-wrapper");o.floating.current&&!o.floating.current.contains(l.target)&&!n.contains(l.target)&&(!m||!m.contains(l.target))&&!((j=document.querySelector("#pane-side ._21S-L span"))!=null&&j.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 v=()=>p()((e,a)=>({emojiArea:null})),C=p()((e,a)=>({container:{},getContainer:n=>{const{container:s}=a();if(s[n])return s[n];{const i=v();return e(o=>({container:{...o.container,[n]:i}})),i}},deleteContainer:n=>e(s=>{const i={...s.container};return delete i[n],{container:i}})})),b=r.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f107.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_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f110.js")),[]));function M({id:e}){return t.jsx(r.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(A,{id:e})})}const F=r.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_18_ea7d0884-20ea-4e04-b6f3-cef449ac182f112.js")),[]));function O({id:e}){return t.jsx(r.Suspense,{fallback:t.jsx(t.Fragment,{}),children:t.jsx(F,{id:e})})}export{M as I,w as M,O as T,z as a,I as b,C as u};
