/* ============================================================
components.jsx — Primitivos de UI compartilhados
============================================================ */
const { useState, useRef, useEffect } = React;
/* ---------- Ícones (stroke geométrico) ---------- */
const ICONS = {
user: 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM5 20a7 7 0 0 1 14 0',
grid: 'M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z',
cart: 'M3 4h2l2.4 11.2A2 2 0 0 0 9.36 17h7.7a2 2 0 0 0 1.96-1.6L20.5 8H6M9 21h.01M17 21h.01',
doc: 'M7 3h7l5 5v13H7zM14 3v5h5',
check: 'M5 13l4 4L19 7',
arrowR: 'M5 12h14M13 6l6 6-6 6',
arrowL: 'M19 12H5M11 6l-6 6 6 6',
plus: 'M12 5v14M5 12h14',
minus: 'M5 12h14',
trash: 'M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13',
edit: 'M4 20h4L18.5 9.5a2.1 2.1 0 0 0-3-3L5 17v3z',
whatsapp: 'M20 12a8 8 0 0 1-11.8 7L4 20l1.1-4A8 8 0 1 1 20 12ZM8.5 8.5c-.3 0-.7.1-.9.5-.3.4-1 1-1 2.3s1 2.7 1.2 2.9c.1.2 2 3.1 4.9 4.2 2.4.9 2.9.8 3.4.7.6-.1 1.7-.7 2-1.4.2-.7.2-1.2.2-1.4-.1-.1-.3-.2-.6-.4l-2-1c-.3-.1-.5-.1-.7.1l-.7.9c-.1.2-.3.2-.5.1-.7-.3-1.5-.6-2.4-1.6-.7-.7-1.1-1.5-1.3-1.8-.1-.2 0-.4.1-.5l.5-.5c.1-.2.2-.3.3-.5.1-.2 0-.4 0-.5l-.8-2c-.2-.5-.4-.5-.6-.5Z',
mail: 'M3 6h18v12H3zM3 7l9 6 9-6',
download: 'M12 3v12M7 11l5 5 5-5M5 21h14',
copy: 'M9 9h11v11H9zM5 15H4V4h11v1',
qr: 'M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h3v3h-3zM20 14v6M17 20h3',
x: 'M6 6l12 12M18 6L6 18',
clock: 'M12 7v5l3 2M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z',
spark: 'M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z',
money: 'M12 7v10M9.5 9.2c0-1 .9-1.7 2.5-1.7s2.5.8 2.5 1.8c0 2.4-5 1.3-5 3.6 0 1 1 1.8 2.5 1.8s2.5-.7 2.5-1.7M3 5h18v14H3z',
layers: 'M12 3l9 5-9 5-9-5 9-5ZM3 14l9 5 9-5',
search: 'M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3',
pin: 'M12 21s7-5.2 7-11a7 7 0 1 0-14 0c0 5.8 7 11 7 11ZM12 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z',
building: 'M4 21V5l8-2v18M12 21V9l6 2v10M3 21h18M8 8v.01M8 12v.01M8 16v.01',
chevD: 'M6 9l6 6 6-6',
send: 'M22 2L11 13M22 2l-7 20-4-9-9-4 20-7Z',
lock: 'M6 11h12v9H6zM9 11V8a3 3 0 0 1 6 0v3',
bolt: 'M13 2L4 14h7l-1 8 9-12h-7l1-8Z',
};
function Icon({ name, size = 20, stroke = 2, fill, style, ...rest }) {
const filled = name === 'whatsapp';
return (
);
}
/* ---------- Logo: imagem (logos.js) OU texto (kit de revenda) ---------- */
function BrandLogo({ dark = false, height = 30 }) {
const b = window.BRANDING || {};
const img = dark ? window.LOGO_DARK : window.LOGO_LIGHT;
if (b.usarLogoImagem !== false && img) {
// logoEscala: multiplicador p/ logos "empilhados" (emblema + texto) ficarem maiores
const esc = b.logoEscala || 1;
return ;
}
const t = b.logoTexto || { linha1: (b.empresa && b.empresa.nome) || 'Sua', linha2: 'Empresa' };
const txtColor = dark ? '#15171c' : 'var(--text)';
const subColor = dark ? '#6b7180' : 'var(--text-3)';
return (