import{b as l,e as u,u as g}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d14.js";import{j as e}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d15.js";import{I as a,_ as d}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d17.js";import{r as n}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1.js";import{d as E}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1155.js";import{V as f}from"./v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d12.js";async function L(t){const{session:s}=l.getState(),{config:i}=u.getState(),r=g.getState().language;if(t.length===0)return a({type:"Error",message:r.nenhumCtsSelecionado,position:"top-right"});const m=s.is_premium?t:t.slice(0,5);s.is_premium||a({type:"Info",message:r.limite_de_5,position:"top-right"});const p={contacts:m.filter(o=>!o.id.includes("@lid")).map(o=>({id:o.id.replace("@c.us","").replace("@g.us",""),name:o.name})),labelName:i.primeiroNome};try{const o=await fetch(`${f.backend_utils}api/XLSX/envioEmMassa`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(!o.ok)throw new Error("Erro ao enviar dados para o servidor");const c=await o.json();E(c.XLSXbase64,`${i.primeiroNome}_EnvioEmMassa.xlsx`)}catch(o){console.error("Erro ao enviar dados para o servidor:",o),a({type:"Error",message:r.erroEnvio,position:"top-right"})}}const _=n.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_3_40_a1f3a86e-ffe7-4e8d-af35-2585c84ec3d1201.js")),[]));function b({list:t}){return e.jsx(n.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(_,{list:t})})}export{L as E,b as I};
