/* Cierre de campaña + Footer + Chat flotante + Carrito */ const { Ic: I2 } = window; const DD = window.DianeryData; /* Carrito lateral */ function CartDrawer({ open, onClose }) { if (!open) return null; const lines = DD.getCartDetailed(); const total = DD.cartTotal(); const checkout = () => { if (!lines.length) return; if (!DD.getWhatsappNumber()) { window.shopToast && window.shopToast("Configura un WhatsApp en Admin → Contacto"); return; } window.open(DD.whatsappOrderUrl(), "_blank", "noopener"); }; return (
); } /* Toast simple de la tienda */ function ShopToast() { const [msg, setMsg] = React.useState(null); React.useEffect(() => { window.shopToast = (m) => { setMsg(m); clearTimeout(window.__shopToastT); window.__shopToastT = setTimeout(() => setMsg(null), 2200); }; }, []); if (!msg) return null; return
{msg}
; } function ClosingCampaign({ data }) { if (!data || !data.enabled) return null; return (
{data.kicker}

{data.title}

{data.highlightedText &&
{data.highlightedText}
}
); } /* Enlaces sin destino real → "Próximamente"; con URL real → navega normal */ function footLink(e, href) { if (!href || href === "#") { e.preventDefault(); window.shopToast && window.shopToast("Próximamente"); } } function ContactItem({ icon, label, value }) { if (!value) return null; const Icon = I2[icon]; return ( {Icon && } {label} {value} ); } function Footer({ data, brand }) { const c = data.contact || {}; const legal = data.legal || {}; const socials = (data.socialLinks || []).filter(s => I2[s.icon]); return (
{/* Columnas de enlaces */}
{brand.name}
{brand.tagline}

Detalles seleccionados a mano para tu hogar, tu mesa y tu día a día.

{data.columns.map((col, i) => (

{col.title}

))}
{/* Contacto + redes */}

{c.title || "Contacto"}

{socials.length > 0 && (

Síguenos

{socials.map((s, i) => { const Icon = I2[s.icon]; const real = s.href && s.href !== "#"; return footLink(e, s.href)}>; })}
)}
{/* Barra legal */}
{(legal.links || []).map((l, i) => footLink(e, l.href)}>{l.label})}
© {legal.year} {legal.companyName} {legal.taxId ? · {legal.taxId} : null} · Todos los derechos reservados.
); } function FloatingChat({ data }) { if (!data || !data.enabled) return null; const Icon = data.provider === "whatsapp" ? I2.whatsapp : I2.chat; const real = data.href && data.href !== "#"; const num = DD.getWhatsappNumber(); const onClick = (e) => { if (real) return; // usa el enlace configurado e.preventDefault(); if (num) window.open(`https://wa.me/${num}`, "_blank", "noopener"); else window.shopToast && window.shopToast("Configura un WhatsApp en Admin → Contacto"); }; return ( {data.label} ); } Object.assign(window, { ClosingCampaign, Footer, FloatingChat, CartDrawer, ShopToast });