import{j as s,a2 as C,as as U,a5 as S}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab710.js";import{a as h}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab74.js";import{A as T,b as _,p as q,y as E}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab723.js";import{u as F}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab719.js";import{U as I}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab771.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab718.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab76.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab78.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab75.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab77.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab79.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab72.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab73.js";function Q(){var m;const{variaveisWA:t}=T(),{userTabs:o,setNewUser:u,setRemoveUser:x}=_(),{language:r}=F(),{close:f}=q(),c=(m=E().activeChat)==null?void 0:m.id,n=c.server==="@lid"?c._serialized:c.user,v=I(),[g,j]=h.useState(""),[l,b]=h.useState([]),A=async e=>{e.chats.find(i=>i.id===n)?x(n,!1,e.id):u(n,e.id)},N=s.jsxs("div",{className:"p-4 flex flex-col gap-2",children:[s.jsx("span",{children:r.emptyAba}),s.jsx(C,{name:r.create,funcao:()=>{f(),v()}})]}),w=s.jsx("div",{className:"p-4 text-center",children:s.jsx("span",{children:r.notFound})}),d=s.jsx(U,{filtragem:e=>{let a=[];o.forEach(i=>{var p;(p=i.tag)!=null&&p.toUpperCase().includes(e.toUpperCase())&&a.push(i)}),b(a),j(e)},placeholder:r.pesquisarAbas,dependenciasADD:[o],btnClear:!0}),y=s.jsx("div",{className:t.modalOptions.content3+"overflow-auto max-w-[350px]",style:{maxHeight:"calc(100vh - 200px)"},children:l.slice().sort((e,a)=>e.tag.localeCompare(a.tag)).map((e,a)=>s.jsx("div",{className:t.listagem.content1+"hoverShadown",children:s.jsx("li",{tabIndex:1,className:t.listagem.content2,"data-animate-dropdown-item":"true",style:{opacity:1},children:s.jsx("label",{htmlFor:"user_tab&"+a,children:s.jsxs("div",{className:t.listagem.content3,children:[s.jsx("div",{className:t.listagem.content4,children:s.jsx(S,{id:"user_tab&"+a,estado:!!e.chats.find(i=>i.id===n),checkedUpdade:()=>{A(e)}})}),s.jsxs("span",{className:t.listagem.content5+" flex",children:[s.jsx("span",{className:"pr-1 overflow-hidden text-ellipsis whitespace-nowrap",children:e.tag}),s.jsx("span",{className:t.aba+"tam-aba bg-[var(--primaria)] !text-[var(--letra)]",children:e.chats.length})]})]})})})},a))});return g.length>0&&l.length===0?s.jsxs("div",{children:[d,w]}):o.length>0?s.jsxs("div",{children:[d,y]}):N}export{Q as default};
