import{j as e}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89263.js";import{a as g}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89262.js";import{u as f}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89264.js";import{u as j}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892632.js";import{u as v}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c8926139.js";import{bZ as w,ax as N,E as b,D as y,C,I as A}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89268.js";import{V as L}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c8926252.js";import{A as _,L as k}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892612.js";import{a as E}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c8926172.js";import{a as T}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c8926125.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89265.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89266.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c892625.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";function Q(){const{setViewContatos:n}=v(),{agrupamentos:t,setAgrupamentos:c}=j(),{language:a}=f(),[o,d]=g.useState(0),p=s=>{C({content:e.jsxs(e.Fragment,{children:[" ",a.deseja_deletar," "," ",e.jsx("strong",{style:{color:s.color},children:s.name}),"? "]}),confirmText:a.confirm,submit:()=>{A({type:"Success",message:a.agrupamento_deletado,position:"top-right"});const r=t.filter(l=>l.id!==s.id);c([...r])}})},m=s=>{n({isOpen:!1,type:"edit",content:s})},x=e.jsx("div",{className:"flex flex-col w-[235px] overflow-y-auto overflow-x-hidden ",style:{maxHeight:"calc(100vh - 240px)"},children:t.map((s,r)=>e.jsxs("div",{className:"flex gap-1 items-center border-b border-base-300 cursor-pointer hover:bg-base-300 p-1 px-2 rounded "+(o===r?"!bg-base-300":void 0),onClick:()=>d(r),children:[e.jsx("span",{children:e.jsx(w,{className:"w-5h-5",style:{color:s.color}})}),e.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap w-[150px]",children:s.name}),e.jsxs("span",{className:"flex w-[25px] justify-between",children:[e.jsx("span",{className:"pulse cursor-pointer",onClick:()=>m(s),children:e.jsx(N,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})}),e.jsx("span",{className:"pulse cursor-pointer",onClick:l=>{l.stopPropagation(),p(s)},children:e.jsx(T,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})})]})]},r))}),h=({index:s,key:r,style:l})=>{const i=t[o]?.chats[s];if(i)return e.jsx("li",{style:l,children:e.jsxs("div",{className:"flex gap-1 items-center px-2",children:[e.jsx(L,{id:i.id}),e.jsx("span",{className:"font-bold text-base overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]",children:i.name}),e.jsx("span",{children:i.id.includes("@")?i.id.split("@")[0]:i.id})]})},i.id)},u=e.jsx("div",{className:"w-full pt-2",children:e.jsx("ul",{className:"gap-2 overflow-y-auto overflow-x-hidden justify-center",style:{maxHeight:"calc(100vh - 240px)",height:"calc(100vh - 240px)",width:"350px"},children:e.jsx(_,{children:({width:s,height:r})=>e.jsx(k,{width:s,height:r,rowCount:t[o]?t[o]?.chats.length:0,rowHeight:25,rowRenderer:h})})})});return e.jsxs("div",{style:{height:"calc(100vh - 110px)"},children:[e.jsx(b,{children:a.organiza_cts}),e.jsxs("div",{className:"flex gap-2 items-center p-2",children:[e.jsx(y,{children:a.agrupamentos_salvos}),e.jsx("span",{className:"pulse cursor-pointer lg:tooltip lg:tooltip-right","data-tip":a.voltar,onClick:()=>n({isOpen:!1,type:"create",content:[]}),children:e.jsx(E,{className:"w-6 h-6 text-[var(--primaria)]",strokeWidth:1})})]}),e.jsxs("div",{className:"flex pt-4 gap-12",children:[e.jsxs("div",{className:"flex flex-col gap-4 justify-start",children:[e.jsxs("div",{className:"indicator",children:[t.length!==0&&e.jsxs("span",{className:"indicator-item badge bg-[var(--primaria)] text-[var(--letra)] font-medium",children:["+",t.length]}),e.jsx("span",{className:"p-2 text-xl",children:a.agrupamentos_criados})]}),t.length!==0?x:e.jsx("div",{className:"p-4 border-dotted border rounded-lg text-center mt-2 border-[var(--terciaria)]",children:a.nenhum_agrupamento})]}),e.jsx("div",{className:"flex flex-col gap-4 justify-start",children:t.length!==0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"indicator",children:[t[o]?.chats.length!==0&&e.jsxs("span",{className:"indicator-item badge bg-[var(--primaria)] text-[var(--letra)] font-medium",children:["+",t[o]?.chats.length]}),e.jsx("span",{className:"p-2 text-xl",children:a.cts_selecionados})]}),u]}):null})]})]})}export{Q as default};
