import{j as s,J as x,Y as m,I as u,y as h,H as b}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b10.js";import{c,D as g,aG as v}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b23.js";import{u as r}from"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b19.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b18.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b8.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b4.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b5.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b7.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b6.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b9.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b2.js";import"./v_7_4_1_31_281d2484-5da9-48a8-8939-2c37d755bb5b3.js";function j(){const{activeHook:a,setDadosWebHook:o,setDadosParam:i,dispartWebhook:l}=c(),{language:t}=r(),n=()=>{if(!a.active&&!a.url.includes("https://")){u({type:"Error",message:t.webHookUrlIncorreta,position:"top-right"});return}o(a.id,"active",!a.active)};return s.jsxs("div",{className:"w-full flex flex-col gap-4",children:[s.jsx("h3",{className:"font-bold text-xl text-[var(--primary-strong)]",children:t.dadosDoWebHook}),s.jsxs("label",{className:"form-control w-full",children:[s.jsx("div",{className:"label",children:s.jsx("span",{className:"label-text",children:t.urlDoWebHook})}),s.jsx("input",{type:"text",placeholder:t.webHookPlaceHolder,className:"input input-bordered w-full input-sm",value:a.url,onChange:e=>o(a.id,"url",e.target.value)})]}),s.jsxs("div",{className:"flex gap-2 cursor-pointer items-center h-9 px-1 py-2 rounded",children:[s.jsx("span",{children:t.urlWebHookAtivo}),s.jsx(x,{estado:a.active,switchUpdate:n,id:`switch${a.id}`})]}),s.jsxs("div",{className:"collapse collapse-arrow bg-base-200",children:[s.jsx("input",{type:"radio",name:"my-accordion-2",defaultChecked:!0}),s.jsx("div",{className:"collapse-title text-xl font-medium",children:t.webHookDadosAEnviar}),s.jsx("div",{className:"collapse-content",children:a.param.map(e=>s.jsx("div",{className:"form-control",children:s.jsxs("label",{className:"cursor-pointer label justify-start gap-2",children:[s.jsx(m,{id:e.id,estado:e.active,checkedUpdade:()=>i(a.id,e.id),disabled:e.disabled}),s.jsx("span",{className:"label-text",children:t[e.id]})]})},e.id))})]}),s.jsxs("div",{className:"collapse collapse-arrow bg-base-200",children:[s.jsx("input",{type:"radio",name:"my-accordion-2"}),s.jsxs("div",{className:"collapse-title text-xl font-medium",children:[t.ultimosWebHook," ",a.sent.length," ",t.enviosMaximosWebHook]}),s.jsx("div",{className:"collapse-content",children:s.jsx("ul",{className:"flex flex-col gap-2 max-h-[300px] overflow-y-auto",children:a.sent.map(e=>s.jsx("li",{children:s.jsxs("div",{className:"flex gap-3",children:[s.jsx("span",{children:s.jsx("button",{className:"btn-daisy !btn-xs !text-[var(--letra)] "+(e.status?"btn-success":"btn-error"),children:e.code})}),s.jsx("span",{children:e.userID}),s.jsx("span",{children:e.date}),s.jsx("span",{className:"ml-3",children:s.jsx("button",{className:"btn-daisy !btn-xs !bg-[var(--primaria)] !text-[var(--letra)] pulse",onClick:()=>l(e.userID,a.id,e.eventDetails,e.id),children:t.webHookReenviar})})]})}))})})]})]})}const f="/assets/png/Arrows.chunk.png",k="/assets/png/Btrix24.chunk.png",N="/assets/png/Chatgpt.chunk.png",w="/assets/png/Erp.chunk.png",H="/assets/png/Hubspot.chunk.png",y="/assets/png/Nfe.chunk.png",W="/assets/png/Pipedrive.chunk.png",D="/assets/png/Sheets.chunk.png",I="/assets/png/Spinner.chunk.png";function z(){const{variaveisWA:a}=g(),{activeHook:o,setActiveHook:i}=c(),{language:l}=r(),n=[f,k,N,w,H,y,W,D,I].map(e=>chrome.runtime.getURL(`content/${e}`));return s.jsxs("div",{className:"w-[800px] max-h-[99vh] overflow-y-auto",children:[s.jsx(h,{children:"WebHooks"}),s.jsx(b,{children:l.webHookSubTittle}),s.jsx("div",{className:"w-full flex justify-between items-center my-4 px-2",children:n.map((e,p)=>s.jsx("div",{className:"w-16 h-16 rounded-full pulse",children:s.jsx("img",{src:e,className:"w-full h-full"},p)}))}),s.jsxs("div",{className:"flex gap-3",children:[s.jsxs("div",{className:"w-[250px] flex flex-col gap-2 aba-divisoria",children:[s.jsx("h3",{className:"font-bold text-xl text-[var(--primary-strong)] px-1",children:l.webHookEvents}),s.jsx("ul",{children:s.jsx("div",{className:a.listagem.content1+" gap-1 flex flex-col !ml-0",children:v.map(e=>s.jsx("li",{className:"hoverShadown pulse cursor-pointer px-1 py-2 rounded-md "+(o.id===e?"bg-[var(--background-default-active)]":""),onClick:()=>i(e),children:s.jsx("div",{className:"_ak8q",children:s.jsx("span",{dir:"auto",className:"x1iyjqo2 x6ikm8r x10wlt62 x1n2onr6 xlyipyv xuxw1ft x1rg5ohu _ao3e",children:l[e]})})}))})})]}),s.jsx(j,{})]})]})}export{z as default};
