import{j as t,y as v,J as g,bn as N,K as S,V as p,I as u}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9910.js";import{a as b}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c994.js";import{o as C,aj as w,ac as r,a3 as y}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9923.js";import{u as _}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9919.js";import{W as d}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9918.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c998.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c99.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c995.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c997.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c996.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c999.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c992.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c993.js";function F(){const{language:e}=_(),{close:c}=C(),{contatos:l,setContatos:m}=w(),{setAutoSaveChatName:x,chatName:a}=r(),[n,h]=b.useState(a.name),f=async()=>{if(await y("contatos")===!0)return;const s=l.filter(i=>i.id!==a.number),o={id:a.number,name:n};s.push(o),d.Utils("contatoSave",o),chrome.runtime.sendMessage({action:"contatoSave",dados:o}),r.setState({chatName:{...a,name:n,number:a.number}}),m(s),c(),u({type:"Success",message:e.contatosNotifiSave,position:"top-right"})},j=async()=>{const s=l.filter(i=>i.id!==a.number),o={id:a.number,name:a.number};d.Utils("contatoSave",o),chrome.runtime.sendMessage({action:"contatoSave",dados:o}),r.setState({chatName:{...a,name:a.number,number:a.number}}),m(s),c(),u({type:"Success",message:e.contatosNotifiRM,position:"top-right"})};return t.jsxs("div",{className:"w-[450px] grid gap-4",children:[t.jsx("div",{className:"flex gap-4",children:t.jsx(v,{children:e.contatos_title})}),t.jsx(g,{children:e.contatos_text}),t.jsxs("div",{className:"form-control w-full",children:[t.jsx("label",{className:"label",children:t.jsx("span",{className:"label-text",children:e.contatos_textInp})}),t.jsx("input",{type:"text",value:n,onChange:s=>h(s.target.value),placeholder:e.contatos_placeInp,className:"input input-bordered w-full input-sm"})]}),t.jsxs("div",{className:"flex justify-between cursor-pointer items-center h-9 px-1 py-2 rounded",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs("span",{children:[e.contatos_autoSave," "]}),t.jsx("span",{className:"lg:tooltip lg:tooltip-top","data-tip":e.contatos_info,children:t.jsx(N,{className:"h-5 w-5"})})]}),t.jsx(S,{estado:a.autoSave,switchUpdate:()=>x(!a.autoSave),id:"autoSave"})]}),t.jsxs("div",{className:"flex justify-around",children:[t.jsx(p,{name:e.contatos_rm,funcao:j}),t.jsx(p,{name:e.contatos_save,funcao:f})]})]})}export{F as default};
