import{j as r,A as d,m as f}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67155.js";import{r as s}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b6715.js";import{a as u}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671522.js";import{u as x}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67154.js";import{o as g}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671566.js";import{u as b}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671546.js";import{I as i,A as y,X as h,j as N,T as v}from"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67156.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67158.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671523.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67153.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67157.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67159.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671510.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b67152.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671520.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671545.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671547.js";import"./v_7_4_3_42_40a29d0b-9b36-4e19-997c-87ed486b671511.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;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};
