/*
 * Mini-bibliothèque d'icônes SVG inspirée Lucide
 * Pas de dépendance externe — toutes les icônes sont en SVG inline
 */

const makeIcon = (paths) => ({ size = 20, color = 'currentColor', strokeWidth = 2, style = {} }) => (
  <svg
    xmlns="http://www.w3.org/2000/svg"
    width={size}
    height={size}
    viewBox="0 0 24 24"
    fill="none"
    stroke={color}
    strokeWidth={strokeWidth}
    strokeLinecap="round"
    strokeLinejoin="round"
    style={{ display: 'inline-block', flexShrink: 0, ...style }}
  >
    {paths.map((p, i) =>
      p.type === 'path' ? <path key={i} d={p.d} /> :
      p.type === 'circle' ? <circle key={i} cx={p.cx} cy={p.cy} r={p.r} /> :
      p.type === 'line' ? <line key={i} x1={p.x1} y1={p.y1} x2={p.x2} y2={p.y2} /> :
      p.type === 'rect' ? <rect key={i} x={p.x} y={p.y} width={p.w} height={p.h} rx={p.rx} /> :
      p.type === 'polyline' ? <polyline key={i} points={p.points} /> :
      p.type === 'polygon' ? <polygon key={i} points={p.points} /> :
      null
    )}
  </svg>
);

const Home = makeIcon([
  { type: 'path', d: 'M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z' },
  { type: 'polyline', points: '9 22 9 12 15 12 15 22' },
]);
const Briefcase = makeIcon([
  { type: 'rect', x: 2, y: 7, w: 20, h: 14, rx: 2 },
  { type: 'path', d: 'M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16' },
]);
const FileText = makeIcon([
  { type: 'path', d: 'M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z' },
  { type: 'polyline', points: '14 2 14 8 20 8' },
  { type: 'line', x1: 16, y1: 13, x2: 8, y2: 13 },
  { type: 'line', x1: 16, y1: 17, x2: 8, y2: 17 },
  { type: 'polyline', points: '10 9 9 9 8 9' },
]);
const Mail = makeIcon([
  { type: 'path', d: 'M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z' },
  { type: 'polyline', points: '22 6 12 13 2 6' },
]);
const Settings = makeIcon([
  { type: 'path', d: 'M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z' },
  { type: 'circle', cx: 12, cy: 12, r: 3 },
]);
const Plus = makeIcon([
  { type: 'line', x1: 12, y1: 5, x2: 12, y2: 19 },
  { type: 'line', x1: 5, y1: 12, x2: 19, y2: 12 },
]);
const ChevronLeft = makeIcon([{ type: 'polyline', points: '15 18 9 12 15 6' }]);
const ChevronRight = makeIcon([{ type: 'polyline', points: '9 18 15 12 9 6' }]);
const Search = makeIcon([
  { type: 'circle', cx: 11, cy: 11, r: 8 },
  { type: 'line', x1: 21, y1: 21, x2: 16.65, y2: 16.65 },
]);
const TrendingUp = makeIcon([
  { type: 'polyline', points: '23 6 13.5 15.5 8.5 10.5 1 18' },
  { type: 'polyline', points: '17 6 23 6 23 12' },
]);
const TrendingDown = makeIcon([
  { type: 'polyline', points: '23 18 13.5 8.5 8.5 13.5 1 6' },
  { type: 'polyline', points: '17 18 23 18 23 12' },
]);
const Calendar = makeIcon([
  { type: 'rect', x: 3, y: 4, w: 18, h: 18, rx: 2 },
  { type: 'line', x1: 16, y1: 2, x2: 16, y2: 6 },
  { type: 'line', x1: 8, y1: 2, x2: 8, y2: 6 },
  { type: 'line', x1: 3, y1: 10, x2: 21, y2: 10 },
]);
const MapPin = makeIcon([
  { type: 'path', d: 'M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z' },
  { type: 'circle', cx: 12, cy: 10, r: 3 },
]);
const User = makeIcon([
  { type: 'path', d: 'M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2' },
  { type: 'circle', cx: 12, cy: 7, r: 4 },
]);
const Phone = makeIcon([
  { type: 'path', d: 'M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z' },
]);
const Building2 = makeIcon([
  { type: 'path', d: 'M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z' },
  { type: 'path', d: 'M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2' },
  { type: 'path', d: 'M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2' },
  { type: 'path', d: 'M10 6h4' },
  { type: 'path', d: 'M10 10h4' },
  { type: 'path', d: 'M10 14h4' },
  { type: 'path', d: 'M10 18h4' },
]);
const Euro = makeIcon([
  { type: 'path', d: 'M4 10h12' },
  { type: 'path', d: 'M4 14h9' },
  { type: 'path', d: 'M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2' },
]);
const Clock = makeIcon([
  { type: 'circle', cx: 12, cy: 12, r: 10 },
  { type: 'polyline', points: '12 6 12 12 16 14' },
]);
const AlertCircle = makeIcon([
  { type: 'circle', cx: 12, cy: 12, r: 10 },
  { type: 'line', x1: 12, y1: 8, x2: 12, y2: 12 },
  { type: 'line', x1: 12, y1: 16, x2: 12.01, y2: 16 },
]);
const CheckCircle2 = makeIcon([
  { type: 'circle', cx: 12, cy: 12, r: 10 },
  { type: 'polyline', points: '8 12 11 15 16 9' },
]);
const Edit3 = makeIcon([
  { type: 'path', d: 'M12 20h9' },
  { type: 'path', d: 'M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z' },
]);
const Trash2 = makeIcon([
  { type: 'polyline', points: '3 6 5 6 21 6' },
  { type: 'path', d: 'M19 6l-2 14a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2L5 6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2' },
  { type: 'line', x1: 10, y1: 11, x2: 10, y2: 17 },
  { type: 'line', x1: 14, y1: 11, x2: 14, y2: 17 },
]);
const Copy = makeIcon([
  { type: 'rect', x: 9, y: 9, w: 13, h: 13, rx: 2 },
  { type: 'path', d: 'M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1' },
]);
const Send = makeIcon([
  { type: 'line', x1: 22, y1: 2, x2: 11, y2: 13 },
  { type: 'polygon', points: '22 2 15 22 11 13 2 9 22 2' },
]);
const Download = makeIcon([
  { type: 'path', d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' },
  { type: 'polyline', points: '7 10 12 15 17 10' },
  { type: 'line', x1: 12, y1: 15, x2: 12, y2: 3 },
]);
const Filter = makeIcon([
  { type: 'polygon', points: '22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3' },
]);
const MoreVertical = makeIcon([
  { type: 'circle', cx: 12, cy: 12, r: 1 },
  { type: 'circle', cx: 12, cy: 5, r: 1 },
  { type: 'circle', cx: 12, cy: 19, r: 1 },
]);
const Banknote = makeIcon([
  { type: 'rect', x: 2, y: 6, w: 20, h: 12, rx: 2 },
  { type: 'circle', cx: 12, cy: 12, r: 2 },
  { type: 'path', d: 'M6 12h.01M18 12h.01' },
]);
const Package = makeIcon([
  { type: 'path', d: 'M16.5 9.4l-9-5.19M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z' },
  { type: 'polyline', points: '3.27 6.96 12 12.01 20.73 6.96' },
  { type: 'line', x1: 12, y1: 22.08, x2: 12, y2: 12 },
]);
const Users = makeIcon([
  { type: 'path', d: 'M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2' },
  { type: 'circle', cx: 9, cy: 7, r: 4 },
  { type: 'path', d: 'M23 21v-2a4 4 0 0 0-3-3.87' },
  { type: 'path', d: 'M16 3.13a4 4 0 0 1 0 7.75' },
]);
const Receipt = makeIcon([
  { type: 'path', d: 'M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z' },
  { type: 'path', d: 'M16 8H8' },
  { type: 'path', d: 'M16 12H8' },
  { type: 'path', d: 'M13 16H8' },
]);
const ClipboardList = makeIcon([
  { type: 'rect', x: 8, y: 2, w: 8, h: 4, rx: 1 },
  { type: 'path', d: 'M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2' },
  { type: 'path', d: 'M12 11h4' },
  { type: 'path', d: 'M12 16h4' },
  { type: 'path', d: 'M8 11h.01' },
  { type: 'path', d: 'M8 16h.01' },
]);
const X = makeIcon([
  { type: 'line', x1: 18, y1: 6, x2: 6, y2: 18 },
  { type: 'line', x1: 6, y1: 6, x2: 18, y2: 18 },
]);
const Save = makeIcon([
  { type: 'path', d: 'M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z' },
  { type: 'polyline', points: '17 21 17 13 7 13 7 21' },
  { type: 'polyline', points: '7 3 7 8 15 8' },
]);
const PieChart = makeIcon([
  { type: 'path', d: 'M21.21 15.89A10 10 0 1 1 8 2.83' },
  { type: 'path', d: 'M22 12A10 10 0 0 0 12 2v10z' },
]);
const Activity = makeIcon([
  { type: 'polyline', points: '22 12 18 12 15 21 9 3 6 12 2 12' },
]);
const ArrowUpRight = makeIcon([
  { type: 'line', x1: 7, y1: 17, x2: 17, y2: 7 },
  { type: 'polyline', points: '7 7 17 7 17 17' },
]);
const ArrowDownRight = makeIcon([
  { type: 'line', x1: 7, y1: 7, x2: 17, y2: 17 },
  { type: 'polyline', points: '17 7 17 17 7 17' },
]);

// Expose globalement pour usage dans app.jsx
window.YESIcons = {
  Home, Briefcase, FileText, Mail, Settings, Plus, ChevronLeft, ChevronRight,
  Search, TrendingUp, TrendingDown, Calendar, MapPin, User, Phone, Building2,
  Euro, Clock, AlertCircle, CheckCircle2, Edit3, Trash2, Copy, Send, Download,
  Filter, MoreVertical, Banknote, Package, Users, Receipt, ClipboardList,
  X, Save, PieChart, Activity, ArrowUpRight, ArrowDownRight,
};
