import{j as e}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0286.js";import{R as s}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b028.js";import{a}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0282.js";import{a as _}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02831.js";import{n as r,u as f}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02821.js";import{_ as l}from"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0288.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02855.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02857.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0287.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02838.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0285.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0284.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0283.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b0289.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02810.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02833.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02856.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02858.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02861.js";import"./v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02820.js";const g=a.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02880.js")),[]));function b(){return e.jsx(a.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(g,{})})}const x=a.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02881.js")),[]));function j(){return e.jsx(a.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(x,{})})}const v=a.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02882.js")),[]));function y(){return e.jsx(a.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(v,{})})}const L=a.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02883.js")),[]));function C(){return e.jsx(a.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(L,{})})}const c=document.createElement("section");c.setAttribute("data-id","FilterChat");const m=document.createElement("section");m.setAttribute("data-id","Menu");const p=document.createElement("section");p.setAttribute("data-id","SearchCamp");const u=document.createElement("section");u.setAttribute("data-id","Notification_Inbox");const h=()=>{r.getState().getSeletor("chatFilters",d=>{d.forEach(t=>{t.id==="all-filter"||t.id==="labels-filter"?t.addEventListener("click",()=>{f.getState().setActiveTab({id:1,type:"tab"})}):t.addEventListener("click",()=>{f.getState().setActiveTab({id:0,type:"default-filter"})})})})},S=[{father:()=>r.getState().getSeletor("menu_whats"),children:m,type:"prepend"},{father:()=>r.getState().getSeletor("searchCamp"),children:p,type:"appendChild"},{father:()=>r.getState().getSeletor("trasferidos"),children:c,type:"appendChild"},{father:()=>r.getState().getSeletor("notification"),children:u,type:"insertAdjacentElement"}];function K(){const d=_(t=>t.inbox.active);return a.useEffect(()=>{S.map(({father:t,children:i,type:n})=>{switch(n){case"prepend":t()?.prepend(i);break;case"insert":let o=t();o.innerHTML="",o.prepend(i);break;case"insertAdjacentElement":t()?.insertAdjacentElement("afterend",i);break;default:t()?.appendChild(i);break}}),r.getState().getSeletor("chatList",t=>{new MutationObserver(n=>{n[0].addedNodes.length!==0&&setTimeout(()=>{const{father:o,children:E}=S[1];o()?.prepend(E)},150)}).observe(t,{childList:!0})}),r.getState().getSeletor("side",t=>{new MutationObserver(n=>{n[0]?.removedNodes[0]?.className===r.getState().getListElement("chatFiltersContainer","div_filters")&&(h(),r.getState().getSeletor("trasferidos")?.appendChild(c))}).observe(t,{childList:!0})}),h()},[]),e.jsxs(e.Fragment,{children:[s.createPortal(e.jsx(j,{}),m),s.createPortal(e.jsx(y,{}),p),s.createPortal(e.jsx(b,{}),c),s.createPortal(d?e.jsx(C,{}):null,u)]})}export{K as default};
