import{j as e,_ as N,V as _,bc as w,aj as b,a2 as y,$ as T,U as L,ap as k,I as A}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab710.js";import{u as M}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab727.js";import{u as B}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab719.js";import{o as E}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab723.js";import{a as x}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab74.js";import{a as O}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7108.js";import{T as n}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7134.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab718.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab76.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab78.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab75.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab77.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab79.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab72.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab73.js";const C=x.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7177.js")),[]));function d({userId:a,create:i,notification:l,onBackBtnClickHnd:r}){return e.jsx(x.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(C,{userId:a,create:i,notification:l,onBackBtnClickHnd:r})})}function m({userID:a}){const{notifications:i,removeNotification:l}=M(),{language:r}=B(),{open:o}=E(),p=t=>{o(e.jsx(d,{userId:a,create:!1,notification:t,onBackBtnClickHnd:()=>o(e.jsx(m,{userID:a}))}))},u=t=>{l(t),A({type:"Success",message:r.modal_createAReminder_alertMessageRemove,position:"top-right"})},f=({notifications:t,user_id:j})=>{const h=t.filter(s=>s.user_id===j).sort((s,c)=>{if(s.timeOut!==c.timeOut)return s.timeOut?-1:1;const g=new Date(s.date+"T"+s.time),v=new Date(c.date+"T"+c.time);return g.getTime()-v.getTime()});return e.jsx("div",{className:"flex flex-col gap-2 my-4 overflow-auto",style:{maxHeight:"calc(100vh - 280px)"},children:h.slice().reverse().map(s=>e.jsxs("li",{className:"flex justify-between w-full gap-0.5 bg-[var(--background-default-active)] border-solid border border-[var(--conversation-header-border)] p-2 rounded-2xl list-none",children:[e.jsxs("div",{className:"flex flex-col w-auto gap-2 justify-center",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(T,{size:"18px",weight:"bold",children:s.title}),s.timeOut?e.jsx(n,{className:"w-5 h-5 text-red-500"}):e.jsx(n,{className:"w-5 h-5 text-yellow-500"})]}),e.jsx("span",{className:"text-base",style:{overflowWrap:"break-word"},children:s.desc}),e.jsx("span",{className:"text-xs font-bold",children:`${L.convertDate(s.date)} at ${s.time}`})]}),e.jsxs("div",{className:"flex flex-row w-auto justify-center items-center gap-1",children:[e.jsx("span",{className:"pulse cursor-pointer",onClick:()=>p(s),children:e.jsx(k,{className:"h-5 w-5"})}),e.jsx("span",{className:"pulse cursor-pointer",onClick:()=>u(s.id),children:e.jsx(O,{className:"h-5 w-5"})})]})]},s.id))})};return e.jsxs("div",{className:"w-auto min-w-[780px] max-w-[780px] flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{children:r.modal_reminder_title}),e.jsx("div",{className:"cursor-pointer lg:tooltip lg:tooltip-bottom","data-tip":r.modal_createAReminder_dataTip,children:e.jsx("span",{className:"pulse",children:e.jsx(w,{className:"h-5 w-5"})})})]}),e.jsx("div",{className:"w-full self-center",children:i.filter(t=>t.user_id===a).length>0&&e.jsx(f,{user_id:a,notifications:i.filter(t=>t.user_id===a)})}),e.jsx("div",{className:"overflow-auto",style:{maxHeight:"calc(100vh - 300px)"},children:i.filter(t=>t.user_id===a).length===0&&e.jsx(b,{title:r.modal_reminder_emptyMsg_title,description:r.modal_reminder_emptyMsg_desc,icon:e.jsx(n,{className:"w-7 h-7 text-[var(--primaria)]"})})}),e.jsx("div",{className:"flex justify-center py-3",children:e.jsx(y,{name:r.create,funcao:()=>o(e.jsx(d,{userId:a,create:!0,onBackBtnClickHnd:()=>o(e.jsx(m,{userID:a}))}))})})]})}export{m as default};
