// Lightweight stroke icons inspired by Lucide / Phosphor.
const Icon = ({ d, size = 16, fill = "none", stroke = "currentColor", strokeWidth = 1.5, children, viewBox = "0 0 24 24", style }) => (
  <svg
    width={size}
    height={size}
    viewBox={viewBox}
    fill={fill}
    stroke={stroke}
    strokeWidth={strokeWidth}
    strokeLinecap="round"
    strokeLinejoin="round"
    style={{ flexShrink: 0, ...style }}
  >
    {d ? <path d={d} /> : children}
  </svg>
);

const I = {
  // brand mark — interlocking link/api glyph
  Logo: ({ size = 22, color = "currentColor" }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none">
      <path d="M5 9.5C5 7 7 5 9.5 5h2A4.5 4.5 0 0 1 16 9.5" stroke={color} strokeWidth="1.8" strokeLinecap="round" />
      <path d="M19 14.5c0 2.5-2 4.5-4.5 4.5h-2A4.5 4.5 0 0 1 8 14.5" stroke={color} strokeWidth="1.8" strokeLinecap="round" />
      <circle cx="12" cy="12" r="1.6" fill={color} />
    </svg>
  ),

  Search: () => <Icon><circle cx="11" cy="11" r="7" /><path d="m20 20-3.5-3.5" /></Icon>,
  Command: () => <Icon><path d="M9 6V4.5A2.5 2.5 0 1 0 6.5 7H8m1-1v12m0-12h6m0 0v12m0-12h1.5A2.5 2.5 0 1 1 17.5 7H16m-7 11v1.5A2.5 2.5 0 1 1 6.5 17H8m1 1h6m0 0v1.5a2.5 2.5 0 1 0 2.5-2.5H16" /></Icon>,
  Sparkle: () => <Icon><path d="M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1" /></Icon>,
  Send: () => <Icon><path d="M4 12 20 4l-3 16-4-7-9-1Z" /></Icon>,
  ArrowUp: () => <Icon><path d="M12 19V5m-6 6 6-6 6 6" /></Icon>,
  Plus: () => <Icon><path d="M12 5v14M5 12h14" /></Icon>,
  Link: () => <Icon><path d="M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 1 0-5.66-5.66l-1 1" /><path d="M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 1 0 5.66 5.66l1-1" /></Icon>,
  Bolt: () => <Icon><path d="M13 2 4 14h7l-1 8 9-12h-7l1-8Z" /></Icon>,
  Chart: () => <Icon><path d="M3 3v18h18M7 14l3-3 3 3 5-5" /></Icon>,
  Globe: () => <Icon><circle cx="12" cy="12" r="9" /><path d="M3 12h18M12 3a13 13 0 0 1 0 18M12 3a13 13 0 0 0 0 18" /></Icon>,
  Key: () => <Icon><circle cx="8" cy="15" r="4" /><path d="m11 12 9-9m-3 3 2 2m-4 0 2 2" /></Icon>,
  Settings: () => <Icon><circle cx="12" cy="12" r="3" /><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3h.1a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8v.1a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z" /></Icon>,
  Code: () => <Icon><path d="m9 18-6-6 6-6m6 0 6 6-6 6" /></Icon>,
  Bell: () => <Icon><path d="M6 8a6 6 0 1 1 12 0c0 7 3 9 3 9H3s3-2 3-9M10 21a2 2 0 0 0 4 0" /></Icon>,
  Filter: () => <Icon><path d="M3 5h18l-7 9v6l-4-2v-4L3 5Z" /></Icon>,
  Calendar: () => <Icon><rect x="3" y="5" width="18" height="16" rx="2" /><path d="M3 9h18M8 3v4M16 3v4" /></Icon>,
  Check: () => <Icon><path d="m5 12 5 5L20 7" /></Icon>,
  Spinner: () => <Icon><path d="M12 3a9 9 0 1 0 9 9" /></Icon>,
  Copy: () => <Icon><rect x="8" y="8" width="12" height="12" rx="2" /><path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" /></Icon>,
  External: () => <Icon><path d="M14 5h5v5M19 5l-9 9M19 13v6H5V5h6" /></Icon>,
  Dot: () => <Icon><circle cx="12" cy="12" r="3" fill="currentColor" stroke="none" /></Icon>,
  Up: () => <Icon><path d="m18 15-6-6-6 6" /></Icon>,
  Down: () => <Icon><path d="m6 9 6 6 6-6" /></Icon>,
  Right: () => <Icon><path d="m9 6 6 6-6 6" /></Icon>,
  Megaphone: () => <Icon><path d="M3 11v2a3 3 0 0 0 3 3l2 5 3-1-1.5-4 7-2V8L8 11H6a3 3 0 0 0-3 0Z" /></Icon>,
  Users: () => <Icon><circle cx="9" cy="8" r="3" /><path d="M3 20a6 6 0 0 1 12 0" /><circle cx="17" cy="9" r="2.5" /><path d="M21 19a4 4 0 0 0-5-3.9" /></Icon>,
  Atom: () => <Icon><circle cx="12" cy="12" r="2" /><path d="M3 12a9 5 0 0 0 18 0M3 12a9 5 0 0 1 18 0M12 3a5 9 0 0 0 0 18M12 3a5 9 0 0 1 0 18" /></Icon>,
  Tools: () => <Icon><path d="M14.7 6.3a4 4 0 1 0-5.4 5.4l-6.6 6.6 2.6 2.6 6.6-6.6a4 4 0 0 0 5.4-5.4l-2.5 2.5-2.6-2.6 2.5-2.5Z" /></Icon>,
  Database: () => <Icon><ellipse cx="12" cy="5" rx="8" ry="3" /><path d="M4 5v14a8 3 0 0 0 16 0V5M4 12a8 3 0 0 0 16 0" /></Icon>,
  History: () => <Icon><path d="M3 12a9 9 0 1 0 3-6.7L3 8" /><path d="M3 3v5h5M12 7v5l3 2" /></Icon>,
  CornerDown: () => <Icon><path d="M9 10v6h12V4" /></Icon>,
  Mic: () => <Icon><rect x="9" y="3" width="6" height="12" rx="3" /><path d="M5 11a7 7 0 0 0 14 0M12 18v3" /></Icon>,
  Github: () => <Icon><path d="M9 19c-4 1.5-4-2-6-2.5M15 22v-4a3 3 0 0 0-1-2.3c3-.4 6-1.5 6-6.5a5 5 0 0 0-1.4-3.5 5 5 0 0 0-.1-3.5S17 1 14 3a13 13 0 0 0-7 0C4 1 3 2 3 2a5 5 0 0 0-.1 3.5A5 5 0 0 0 1.5 9c0 5 3 6 6 6.5A3 3 0 0 0 6.5 18v4" /></Icon>,
  Refresh: () => <Icon><path d="M3 12a9 9 0 0 1 14.6-7L21 8M21 3v5h-5M21 12a9 9 0 0 1-14.6 7L3 16M3 21v-5h5" /></Icon>,
  Cart: () => <Icon><circle cx="9" cy="20" r="1.5" /><circle cx="17" cy="20" r="1.5" /><path d="M3 4h2l3 12h11l2-8H6" /></Icon>,
  Paperclip: () => <Icon><path d="M21 12 12.5 20.5a5 5 0 0 1-7-7L14 5a3.5 3.5 0 1 1 5 5l-8.5 8.5a2 2 0 0 1-3-3l8-8" /></Icon>,
  Zap: () => <Icon><path d="M13 2 4 14h7l-1 8 9-12h-7l1-8Z" /></Icon>,
  Hash: () => <Icon><path d="M5 9h14M5 15h14M10 3 8 21M16 3l-2 18" /></Icon>,
  Slash: () => <Icon><path d="m16 4-8 16" /></Icon>,
  Arrow: () => <Icon><path d="M5 12h14m-6-6 6 6-6 6" /></Icon>,
};

window.I = I;
window.Icon = Icon;
