import{j as e}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f5.js";import{r as i}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f.js";import{ac as j,n as E}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f23.js";import{u as v}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f4.js";import{al as b,af as p,ax as u,ac as g}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f7.js";import{W as w}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f2.js";import{c as y}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f107.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f3.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f9.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f10.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f20.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f8.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f6.js";function U({onSelect:r,btnCancel:d=!1,labelsRM:f=[]}){const{variaveisWA:o}=j(),{close:l}=E(),{language:n}=v(),[c,x]=i.useState([]),[m,h]=i.useState([]);return i.useEffect(()=>{(async()=>{try{const t=(await w.Labels("getAllLabels")).filter(s=>f.includes(s.id)===!1);x(t)}catch(a){console.error("Erro ao buscar labels:",a)}})()},[]),e.jsx("div",{style:{position:"initial"},children:e.jsx("ul",{className:"overflow-hidden flex "+o.modalOptions.content2,children:e.jsxs("div",{className:o.modalOptions.content3,children:[e.jsx(b,{filtragem:a=>{let t=[];c.forEach(s=>{s.name?.toUpperCase().includes(a.toUpperCase())&&t.push(s)}),h(t)},placeholder:n.pesquisarEtiquetas,dependenciasADD:[c],btnClear:!0}),e.jsxs("div",{className:"max-w-[300px] overflow-x-hidden overflow-y-auto "+o.listagem.content1,style:{maxHeight:"calc(100vh - 63px)"},children:[d&&e.jsx(p,{content:n.cancelSelection,icon:e.jsx(y,{className:"w-5 h-5 text-red-500"}),setFunction:()=>{r(""),l()},stroke:"1"}),m.slice().sort((a,t)=>a.name.localeCompare(t.name)).map((a,t)=>e.jsx(p,{content:a.name,icon:e.jsx(u,{className:"w-5 h-5",style:{color:a.hexColor}}),setFunction:()=>{r(a.id),l()},stroke:"1"},t)),m.length===0&&e.jsx(g,{icon:e.jsx(u,{className:"w-5 h-5 text-[var(--primaria)]"}),title:"Nenhuma Etiqueta foi Encontrada",description:"Nenhuma Etiqueta foi criada. Crie uma para começar a utilizár essa funcionalidade"})]})]})})})}export{U as default};
