import{r as t,j as e}from"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f.js";import{u as p}from"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f20.js";import{a as x}from"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f22.js";import{aj as c,D as g,H as f,Z as h,ak as j,al as b,am as v}from"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f11.js";import{o as N}from"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f66.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f8.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f19.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f7.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f6.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f10.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f23.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f4.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f3.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f2.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f9.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f45.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f46.js";import"./v_7_4_3_6_3dde09db-99f5-4187-8a7e-903456f0360f47.js";function $({notificacao:r}){const l=p(s=>s.language),o=x(s=>s.setViews),[a,m]=t.useState("");t.useEffect(()=>{let s=!0;return r.url_img&&c(r.url_img).then(u=>{s&&m(u)}),()=>{s=!1}},[r.url_img]);const n=()=>{r.redirect==="EXTERNAL"?window.open(r.link,"_blank"):(o("modal",r.id),N(r.whatsapp,r.menssage))},i=()=>{const s="h-6 w-6 text-[var(--primaria)]";switch(r.type){case"ALERT":return e.jsx(v,{className:s});case"PROMOTION":return e.jsx(b,{className:s});default:return e.jsx(j,{className:s})}},d=t.useMemo(()=>r.statement.replace(/_(.*?)_/g,'<span class="italic text-gray-800 font-medium">$1</span>').replace(/\*(.*?)\*/g,'<strong class="text-gray-900 font-bold">$1</strong>').replace(/\n/g,"<br>"),[r.statement]);return e.jsxs("div",{className:"w-full max-w-lg flex flex-col max-h-[90vh]",children:[e.jsxs("div",{className:"flex items-center gap-4 px-6 py-5 border-b border-gray-100",children:[e.jsx("div",{className:"p-2.5 rounded-full flex-shrink-0 border",style:{backgroundColor:"color-mix(in srgb, var(--primaria), transparent 90%)",borderColor:"color-mix(in srgb, var(--primaria), transparent 70%)"},children:i()}),e.jsx("div",{className:"flex-1 min-w-0 pr-8",children:e.jsx(g,{className:"text-left text-lg font-semibold text-gray-800 truncate",children:r.title})})]}),e.jsxs("div",{className:"overflow-y-auto custom-scrollbar p-6 space-y-5",children:[a&&e.jsx("div",{className:"relative w-full aspect-video rounded-lg overflow-hidden shadow-sm border border-gray-100",children:e.jsx("img",{src:a,draggable:!1,className:"w-full h-full object-cover hover:scale-105 transition-transform duration-700",alt:"Comunicado"})}),e.jsx(f,{children:e.jsx("div",{className:"text-gray-600 text-sm leading-relaxed text-justify space-y-2",dangerouslySetInnerHTML:{__html:d}})})]}),r.redirect!=="NONE"&&e.jsx("div",{className:"px-6 py-4 flex justify-end bg-gray-50/50",children:e.jsx("div",{className:"w-full sm:w-auto",children:e.jsx(h,{name:r.btnName||l.cliqueAqui,funcao:n})})})]})}export{$ as default};
