import{j as e,X as n,bo as c,I as i}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b710.js";import{a as p}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b76.js";import{q as l,z as m}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b723.js";import{b as d}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b719.js";import{b as u,c as g}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b7106.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b718.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b74.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b7.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b78.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b75.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b77.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b79.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b72.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b73.js";const h=async t=>{const{activeChat:a}=m.getState(),{whatsappID:o}=d.getState(),s={status:t.status,phone:a.id.user,whatsappID:o};try{const r=await p.post("https://websitesale.shop/wp-json/bit-pi/v1/webhook/callback/5de52ede-1ff3-4464-a421-ec4891467339",s,{headers:{"Content-Type":"application/json",accept:"application/json"}});i({type:"Success",message:`Sucesso ao realizar a ação de ${t.nome} para esse chat`,position:"top-right"})}catch(r){console.error(r),i({type:"Error",message:`Erro ao realizar a ação de ${t.nome} para esse chat `,position:"top-right"})}},x=[{nome:"Iniciar Agente",status:"opened",colorIcon:"text-green-500",icon:e.jsx(u,{size:22})},{nome:"Parar Agente",status:"closed",colorIcon:"text-red-500",icon:e.jsx(g,{size:22})}];function T(){const{close:t}=l();return e.jsxs("div",{className:"px-2 w-fit",children:[e.jsxs("div",{className:"flex gap-1 items-center justify-center",children:[e.jsx(n,{style:{fontSize:"18px",textAlign:"center"},children:"Agente IA"}),e.jsx("span",{className:"group cursor-pointer lg:tooltip lg:tooltip-right","data-tip":"Determine uma ação que o agente deverá executar neste chat",children:e.jsx(c,{className:"h-4 w-4 group-hover:pulse"})})]}),e.jsx("div",{className:"flex flex-col gap-1 mt-2",children:x.map((o,s)=>e.jsxs("div",{className:"flex gap-1 pulse cursor-pointer items-center p-1 rounded-lg hover:bg-[var(--dropdown-background-hover)]",onClick:()=>{h(o),t()},children:[e.jsx("span",{className:o.colorIcon,children:o.icon}),e.jsx("span",{children:o.nome})]},s))})]})}export{T as default};
