import{j as s,V as w,al as U,Z as y}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9910.js";import{a as d}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c994.js";import{D as C,a as S,p as T}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9923.js";import{u as q}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9919.js";import{U as D}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9972.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9918.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c996.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c998.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c99.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c995.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c997.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c999.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c992.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c993.js";function z({userId:n}){const{variaveisWA:t}=C(),{userTabs:o,setNewUser:p,setRemoveUser:h}=S(),{language:r}=q(),{close:x}=T(),u=D(),[f,g]=d.useState(""),[l,j]=d.useState([]),v=async e=>{e.chats.find(i=>i.id===n)?h(n,!1,e.id):p(n,e.id)},b=s.jsxs("div",{className:"p-4 flex flex-col gap-2",children:[s.jsx("span",{children:r.emptyAba}),s.jsx(w,{name:r.create,funcao:()=>{x(),u()}})]}),A=s.jsx("div",{className:"p-4 text-center",children:s.jsx("span",{children:r.notFound})}),c=s.jsx(U,{filtragem:e=>{let a=[];o.forEach(i=>{var m;(m=i.tag)!=null&&m.toUpperCase().includes(e.toUpperCase())&&a.push(i)}),j(a),g(e)},placeholder:r.pesquisarAbas,dependenciasADD:[o],btnClear:!0}),N=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(y,{id:"user_tab&"+a,estado:!!e.chats.find(i=>i.id===n),checkedUpdade:()=>{v(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 f.length>0&&l.length===0?s.jsxs("div",{children:[c,A]}):o.length>0?s.jsxs("div",{children:[c,N]}):b}export{z as default};
