import{j as e,_ as h,ah as p,y as u,Q as j,I as g}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080910.js";import{u as N}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080919.js";import{o as f,a9 as v,a2 as y}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080923.js";import{a as i}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508094.js";import{a as b}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b2250809112.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080918.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508098.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b2250809.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508095.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508097.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508096.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508092.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508093.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508099.js";const _=i.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b2250809219.js")),[]));function t({model:s,val:o}){return e.jsx(i.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(_,{model:s,val:o})})}function T(){const{language:s}=N(),{open:o}=f(),{activePerfil:a,updateActivePerfil:l}=v(),n=async r=>{if(await y("perfilDoContato")===!0)return;const m=(a.valNegocio?a.valNegocio:[]).filter(x=>x.id!==r);l("valNegocio",m),g({type:"Success",message:s.deletedValue,position:"top-right"})},c=e.jsx("div",{className:"my-6 p-4 border-dotted border rounded-lg text-center",children:s.noneValueAdded}),d=e.jsx(e.Fragment,{children:(a.valNegocio?a.valNegocio:[]).map(r=>e.jsxs("tr",{className:"hover:bg-base-200 cursor-pointer",children:[e.jsx("td",{className:"rounded-l-lg",children:e.jsx("div",{className:"flex justify-center",children:e.jsx("span",{className:"block max-w-[130px]",children:r.descricao})})}),e.jsx("td",{children:r.data}),e.jsx("td",{children:r.hora}),e.jsx("td",{children:parseFloat(r.valor).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})}),e.jsx("td",{className:"rounded-r-lg",children:e.jsxs("div",{className:"flex justify-center gap-2",children:[e.jsx("span",{className:"pulse",onClick:()=>o(e.jsx(t,{model:"Edit",val:r})),children:e.jsx(p,{className:"h-5 w-5"})}),e.jsx("span",{className:"pulse",onClick:()=>n(r.id),children:e.jsx(b,{className:"h-5 w-5"})})]})})]}))});return e.jsxs("div",{className:"w-[600px] grid gap-4",children:[e.jsx(u,{children:s.businessValue}),e.jsxs("div",{className:"overflow-auto",style:{maxHeight:"calc(100vh - 300px)"},children:[e.jsxs("table",{className:"table text-center",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:s.description}),e.jsx("th",{children:s.date}),e.jsx("th",{children:s.hour}),e.jsx("th",{children:s.value}),e.jsx("th",{children:s.agendamento_table_acao})]})}),e.jsx("tbody",{children:(a.valNegocio?a.valNegocio:[]).length>0&&d})]}),(a.valNegocio?a.valNegocio:[]).length<=0&&c]}),e.jsx("div",{className:"flex justify-end py-3",children:e.jsx(j,{name:s.create,funcao:()=>o(e.jsx(t,{model:"Create"}))})})]})}export{T as default};
