import{j as e,_ as o,ad as E,T as C,aK as M,as as I,aL as P,at as v,H as w,I as L}from"./v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d610.js";import{a as t}from"./v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d64.js";import{u as p}from"./v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d661.js";import{u as F,b as k}from"./v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d619.js";import{az as R,b as S,z,p as O,q as U,aA as D,av as V}from"./v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d623.js";import{W as f}from"./v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d618.js";import{b as B}from"./v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d658.js";const W=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d6136.js")),[]));function q(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(W,{})})}const N=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d6137.js")),[]));function H(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(N,{})})}const K=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d6138.js")),[]));function G({setUserLabels:s,userLabels:u}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(K,{setUserLabels:s,userLabels:u})})}const J=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d6139.js")),[]));function Q(){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(J,{})})}const X=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d6140.js")),[]));function Y({userId:s}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(X,{userId:s})})}const Z=t.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_23_80f0be4c-2624-48ff-84de-a733d033e3d6141.js")),[]));function $({userId:s}){return e.jsx(t.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(Z,{userId:s})})}function ce(){const{language:s}=F(p(a=>({language:a.language}))),{pinChat:u,isPin:g}=R(p(a=>({pin:a.pin,pinChat:a.pinChat,isPin:a.isPin}))),{getUserAbasTam:h}=S(p(a=>({userTabs:a.userTabs,getUserAbasTam:a.getUserAbasTam}))),x=k(a=>a.isBusiness),m=z(a=>a.activeChat.id.user),_=z(a=>{var n,i;return(i=(n=a.activeChat)==null?void 0:n.default_id)==null?void 0:i._serialized}),A=O(a=>a.open),r=U(a=>a.open),y=async()=>{await V("clear_message")!==!0&&(await f.Msg("showClearMsg")?L({type:"Success",message:s.asMensagensApagasForamRecuperadas,position:"top-right"}):L({type:"Error",message:s.nenhumaMensagemApagadaFoiRecuperada,position:"top-right"}))},[c,b]=t.useState(null);return t.useEffect(()=>{x&&(async()=>{try{const n=await f.Labels("getAllLabels"),i=await f.Utils("getContato",_);if(i==="undefined")return;const T=i.labels.map(d=>n.find(l=>l.hexColor&&l.id===d)).filter(Boolean).map(({id:d,name:l,hexColor:j})=>({id:d,name:l,color:j,hexColor:j}));b(T)}catch(n){console.error(s.erroAoBuscarLabels,n)}})()},[_]),[{id:"init_fluxo",name:s.iniciarUmFluxoParaEsteContato,icon:e.jsx(E,{size:20}),function:a=>r(e.jsx($,{userId:m}),{placement:"bottom"},a.target,15)},{id:"fixar_chat",name:g()?s.desafixarChat:s.fixarChat,icon:e.jsx(C,{className:g()?"!text-[var(--wds-teal-500)]":"",size:20}),function:()=>u()},{id:"show_clean_messages",name:s.exibirMensagensApagadasRecente,icon:e.jsx(D,{size:20,strokeWidth:"1.8"}),function:()=>y()},{id:"traducao_com_IA",name:s.traducaoComIA,icon:e.jsx(M,{size:20}),function:()=>A(e.jsx(q,{}))},{id:"user_tabs",name:s.userTabs,icon:e.jsx(I,{size:20}),tam:h(m),function:a=>r(e.jsx(H,{}),{placement:"bottom"},a.target,15)},{id:"labels",name:s.tags,icon:c&&c.length>0?e.jsx("div",{className:"flex",children:c.map((a,n)=>e.jsx("span",{style:n!==0?{marginLeft:"-1rem"}:null,children:e.jsx(P,{size:24,style:{color:a.color}})},n))}):e.jsx(v,{size:20}),function:a=>r(e.jsx(G,{setUserLabels:b,userLabels:c}),{placement:"bottom"},a.target.parentNode.parentNode,15),disabled:!x},{id:"transferir_atendimento",name:s.transferirAtendimento,icon:e.jsx(w,{size:20}),function:a=>r(e.jsx(Q,{}),{placement:"bottom"},a.target,15)},{id:"close_atendimento",name:s.fimAtendimento_encerrar,icon:e.jsx(B,{size:20}),function:a=>r(e.jsx(Y,{userId:m}),{placement:"bottom"},a.target,15)}]}export{ce as R};
