import{r as s,j as r,A as d,m as f}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f6.js";import{a as u}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f622.js";import{u as x}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f620.js";import{o as g}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f666.js";import{u as b}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f646.js";import{I as i,A as y,X as h,h as N,T as v}from"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f69.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f66.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f610.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f623.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f611.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f619.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f67.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f68.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f64.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f63.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f62.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f645.js";import"./v_7_4_3_4_e110faba-0ecf-462e-819c-68342bb684f647.js";function q(){const l=x(e=>e.language),{inbox:o,setViews:n}=u(b(e=>({inbox:e.inbox.active,setViews:e.setViews})));if(!o)return null;const t=s.useMemo(()=>{let e="var(--primaria)",a=i;switch(o.type){case"ALERT":e="var(--primaria)",a=v;break;case"PROMOTION":e="var(--secundaria)",a=N;break;case"INFO":default:e="var(--primaria)",a=i;break}return{Icon:a,color:e,style:{backgroundColor:`color-mix(in srgb, ${e}, transparent 90%)`,borderColor:`color-mix(in srgb, ${e}, transparent 80%)`,color:`color-mix(in srgb, ${e}, black 40%)`},buttonStyle:{backgroundColor:e,color:"#ffffff",borderColor:e}}},[o.type]),c=s.useMemo(()=>o.statement.replace(/_(.*?)_/g,'<span class="italic font-medium opacity-90">$1</span>').replace(/\*(.*?)\*/g,'<strong class="font-bold opacity-100">$1</strong>').replace(/\n/g,"<br>"),[o.statement]),m=()=>{o.redirect==="EXTERNAL"?window.open(o.link,"_blank"):g(o.whatsapp,o.menssage)},p=e=>{e.stopPropagation(),n("inbox",o.id)};return r.jsx("div",{className:"bg-gray-200 dark:bg-neutral-800 w-full py-2 px-3",children:r.jsx(d,{mode:"wait",children:r.jsx(f.div,{initial:{opacity:0,y:-10,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.3,type:"spring",stiffness:200},className:"relative w-full border flex flex-col overflow-hidden",children:r.jsxs("div",{className:"flex p-3 gap-3 items-start",children:[r.jsx("div",{className:"flex-shrink-0 pt-0.5",children:r.jsx(t.Icon,{size:20,style:{color:t.color},className:"animate-pulse"})}),r.jsxs("div",{className:"flex-1 flex flex-col gap-2 min-w-0",children:[r.jsx("div",{className:"text-sm leading-snug",dangerouslySetInnerHTML:{__html:c}}),o.redirect!=="NONE"&&r.jsxs("button",{onClick:m,className:"self-start text-xs font-semibold px-3 py-1.5 rounded-md border flex items-center gap-1 mt-1 cursor-pointer transition-all hover:scale-105 active:scale-95",style:t.buttonStyle,children:[o.btnName||l.cliqueAqui,r.jsx(y,{size:12})]})]}),r.jsx("button",{onClick:p,className:"flex-shrink-0 -mt-1 -mr-1 p-1.5 opacity-50 hover:opacity-100 transition-opacity cursor-pointer",style:{color:t.color},children:r.jsx(h,{size:16})})]})},o.id)})})}export{q as default};
