import{j as e}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89263.js";import{a as n}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89262.js";import{aN as l,a as b,r as v,ah as g}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892625.js";import{u as T}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89264.js";import{u as y,z as N}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89265.js";import{U as z}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892687.js";import{aq as m,H as S,D as C,K as F,E as M,aG as k}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89268.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89266.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89269.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892610.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89267.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c8926.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892620.js";const c=({id:i,name:r,estado:o,fn:t,icon:a})=>e.jsx("div",{className:"w-full",children:e.jsx("label",{htmlFor:i,children:e.jsxs("div",{className:"flex gap-1 items-center cursor-pointer",children:[e.jsx(F,{id:i,estado:o,checkedUpdade:t}),e.jsx(M,{children:r}),a]})})}),A=()=>{const{getSelecionado:i,onChangeSelecionado:r}=l(),[o,t]=n.useState([]);return n.useEffect(()=>{(async()=>t(await N.Labels("getAllLabels")))()},[]),o.map(a=>e.jsx(c,{id:a.id,name:a.name,estado:i(a.id),fn:()=>r(a.id,"labels"),icon:e.jsx(k,{size:20,style:{color:a.hexColor}})}))};function J(){const{active:i,setActive:r,getSelecionado:o,onChangeSelecionado:t}=l(),{language:a}=T(),{isBusiness:u}=y(),{activeTab:x,userTabs:d}=b(),{close:p}=v(),f=["default","labels","userTabs"],h=z();n.useEffect(()=>{x.type!=="custom"&&l.setState({selecionados:[]})},[]);const j={default:[...g,{id:6,name:"transferidos",visibility:!0}].map(s=>s.id!==1&&e.jsx(c,{id:s.name,name:a[s.name],estado:o(s.name),fn:()=>t(s.name,"default"),icon:e.jsx(m,{size:20,className:"text-[var(--primaria)]"})})),labels:e.jsx(A,{}),userTabs:d.length!==0?d.map(s=>e.jsx(c,{id:s.id,name:s.tag,estado:o(s.id),fn:()=>t(s.id,"userTabs",s.chats),icon:e.jsx(m,{size:20,className:"text-[var(--primaria)]"})})):e.jsx("div",{className:"m-auto",children:e.jsx(S,{name:a.create,funcao:()=>{p(),h()}})})};return e.jsxs("div",{className:"w-[350px] p-3",children:[e.jsx(C,{children:a.customFilter}),e.jsx("div",{className:"tabs tabs-bordered mt-4",children:f.map(s=>{if(!(!u&&s==="labels"))return e.jsxs("label",{className:"tab "+(s===i?"tab-active !border-[var(--primaria)]":""),htmlFor:s,children:[e.jsx("span",{children:a["filter_"+s]}),e.jsx("input",{id:s,type:"checkbox",checked:s===i,onChange:()=>r(s),className:"hidden"})]})})}),e.jsx("div",{className:"flex gap-1 flex-col mt-4 overflow-y-auto",style:{maxHeight:"30vh"},children:j[i]})]})}export{J as default};
