import{j as e,as as v,aj as w,D as N,v as b,b as y,I as C,aA as A,aB as L}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e10.js";import{a as M}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e4.js";import{u as _}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e19.js";import{u as k}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e27.js";import{u as T}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e21.js";import{A as E,L as S}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e5.js";import{a as H}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e75.js";import{a as I}from"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e107.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e18.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e8.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e7.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e6.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e9.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e22.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e2.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e3.js";import"./v_7_4_0_1_4b8cc392-a410-45f6-b662-85abdad9c03e46.js";function ee(){var c,d;const{setViewContatos:l}=T(),{agrupamentos:a,setAgrupamentos:m}=k(),{language:t}=_(),[o,x]=M.useState(0),h=s=>{y({content:e.jsxs(e.Fragment,{children:[" ",t.deseja_deletar," "," ",e.jsx("strong",{style:{color:s.color},children:s.name}),"? "]}),confirmText:t.confirm,submit:()=>{C({type:"Success",message:t.agrupamento_deletado,position:"top-right"});const r=a.filter(i=>i.id!==s.id);m([...r])}})},u=s=>{l({isOpen:!1,type:"edit",content:s})},g=e.jsx("div",{className:"flex flex-col w-[235px] overflow-y-auto overflow-x-hidden ",style:{maxHeight:"calc(100vh - 240px)"},children:a.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:()=>x(r),children:[e.jsx("span",{children:e.jsx(v,{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:()=>u(s),children:e.jsx(w,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})}),e.jsx("span",{className:"pulse cursor-pointer",onClick:i=>{i.stopPropagation(),h(s)},children:e.jsx(I,{className:"w-5 h-5 text-[var(--panel-header-icon)]"})})]})]},r))}),j=({index:s,key:r,style:i})=>{var p;const n=(p=a[o])==null?void 0:p.chats[s];if(n)return e.jsx("li",{style:i,children:e.jsxs("div",{className:"flex gap-1 items-center px-2",children:[e.jsx("span",{children:n.id.length>16?e.jsx(A,{className:"h-5 w-5 text-[var(--icon)]"}):e.jsx(L,{className:"h-5 w-5 text-[var(--icon)]"})}),e.jsx("span",{className:"font-bold text-base overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]",children:n.name}),e.jsx("span",{children:n.id})]})},n.id)},f=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(E,{children:({width:s,height:r})=>{var i;return e.jsx(S,{width:s,height:r,rowCount:a[o]?(i=a[o])==null?void 0:i.chats.length:0,rowHeight:25,rowRenderer:j})}})})});return e.jsxs("div",{style:{height:"calc(100vh - 110px)"},children:[e.jsx(N,{children:t.organiza_cts}),e.jsxs("div",{className:"flex gap-2 items-center p-2",children:[e.jsx(b,{children:t.agrupamentos_salvos}),e.jsx("span",{className:"pulse cursor-pointer lg:tooltip lg:tooltip-right","data-tip":t.voltar,onClick:()=>l({isOpen:!1,type:"create",content:[]}),children:e.jsx(H,{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:[a.length!==0&&e.jsxs("span",{className:"indicator-item badge bg-[var(--primaria)] text-[var(--letra)] font-medium",children:["+",a.length]}),e.jsx("span",{className:"p-2 text-xl",children:t.agrupamentos_criados})]}),a.length!==0?g:e.jsx("div",{className:"p-4 border-dotted border rounded-lg text-center mt-2 border-[var(--terciaria)]",children:t.nenhum_agrupamento})]}),e.jsx("div",{className:"flex flex-col gap-4 justify-start",children:a.length!==0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"indicator",children:[((c=a[o])==null?void 0:c.chats.length)!==0&&e.jsxs("span",{className:"indicator-item badge bg-[var(--primaria)] text-[var(--letra)] font-medium",children:["+",(d=a[o])==null?void 0:d.chats.length]}),e.jsx("span",{className:"p-2 text-xl",children:t.cts_selecionados})]}),f]}):null})]})]})}export{ee as default};
