/* global React */
// Icons — Lucide-style thin stroke, 1.5px
// Export each icon as a window-scoped component.

const _i = (paths, view = "0 0 24 24") => function Icon(props) {
  const { size = 18, color = "currentColor", strokeWidth = 1.5, ...rest } = props || {};
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg" width={size} height={size}
      viewBox={view} fill="none" stroke={color}
      strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"
      {...rest}
    >
      {paths}
    </svg>
  );
};

const IconCheck      = _i(<polyline points="20 6 9 17 4 12" />);
const IconArrowRight = _i(<><line x1="5" y1="12" x2="19" y2="12" /><polyline points="12 5 19 12 12 19" /></>);
const IconArrowDown  = _i(<><line x1="12" y1="5" x2="12" y2="19" /><polyline points="19 12 12 19 5 12" /></>);
const IconChevDown   = _i(<polyline points="6 9 12 15 18 9" />);
const IconChevLeft   = _i(<polyline points="15 18 9 12 15 6" />);
const IconChevRight  = _i(<polyline points="9 18 15 12 9 6" />);
const IconSearch     = _i(<><circle cx="11" cy="11" r="7" /><line x1="21" y1="21" x2="16.65" y2="16.65" /></>);
const IconClose      = _i(<><line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" /></>);
const IconCalendar   = _i(<><rect x="3" y="4" width="18" height="18" rx="2" /><line x1="16" y1="2" x2="16" y2="6" /><line x1="8" y1="2" x2="8" y2="6" /><line x1="3" y1="10" x2="21" y2="10" /></>);
const IconClock      = _i(<><circle cx="12" cy="12" r="9" /><polyline points="12 7 12 12 15 14" /></>);
const IconPhone      = _i(<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.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.1 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z" />);
const IconMail       = _i(<><rect x="2.5" y="4.5" width="19" height="15" rx="2" /><polyline points="3 6 12 13 21 6" /></>);
const IconMap        = _i(<><polygon points="3 6 9 4 15 6 21 4 21 18 15 20 9 18 3 20 3 6" /><line x1="9" y1="4" x2="9" y2="18" /><line x1="15" y1="6" x2="15" y2="20" /></>);
const IconUser       = _i(<><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" /><circle cx="12" cy="7" r="4" /></>);
const IconHeart      = _i(<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 1 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" />);
const IconBrain      = _i(<><path d="M9.5 2a3.5 3.5 0 0 1 3.5 3.5v13A3.5 3.5 0 0 1 6 18.5v0a3.5 3.5 0 0 1-2.5-3.5v-2a3 3 0 0 1 0-6v-1A3.5 3.5 0 0 1 7 2.5 3.5 3.5 0 0 1 9.5 2z" /><path d="M14.5 2a3.5 3.5 0 0 0-3.5 3.5v13a3.5 3.5 0 0 0 7 .5v0a3.5 3.5 0 0 0 2.5-3.5v-2a3 3 0 0 0 0-6v-1A3.5 3.5 0 0 0 17 2.5 3.5 3.5 0 0 0 14.5 2z" /></>);
const IconActivity   = _i(<polyline points="22 12 18 12 15 21 9 3 6 12 2 12" />);
const IconScissors   = _i(<><circle cx="6" cy="6" r="3" /><circle cx="6" cy="18" r="3" /><line x1="20" y1="4" x2="8.12" y2="15.88" /><line x1="14.47" y1="14.48" x2="20" y2="20" /><line x1="8.12" y1="8.12" x2="12" y2="12" /></>);
const IconEye        = _i(<><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" /><circle cx="12" cy="12" r="3" /></>);
const IconStethoscope= _i(<><path d="M11 2v2a5 5 0 0 1-5 5 5 5 0 0 1-5-5V2" transform="translate(2.5, 0)" /><path d="M9 14a4 4 0 0 0 4 4 4 4 0 0 0 4-4V9" /><circle cx="17" cy="7" r="2.5" /></>);
const IconLungs      = _i(<><path d="M6.5 22a3.5 3.5 0 0 1-3.5-3.5V9.5C3 6.5 5.5 5 8 5h0v3a3 3 0 0 1-3 3v6a2 2 0 0 0 4 0v-9" /><path d="M17.5 22a3.5 3.5 0 0 0 3.5-3.5V9.5C21 6.5 18.5 5 16 5h0v3a3 3 0 0 0 3 3v6a2 2 0 0 1-4 0v-9" /></>);
const IconDroplet    = _i(<path d="M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z" />);
const IconBolt       = _i(<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />);
const IconScan       = _i(<><path d="M3 7V5a2 2 0 0 1 2-2h2" /><path d="M17 3h2a2 2 0 0 1 2 2v2" /><path d="M21 17v2a2 2 0 0 1-2 2h-2" /><path d="M7 21H5a2 2 0 0 1-2-2v-2" /><line x1="7" y1="12" x2="17" y2="12" /></>);
const IconBeaker     = _i(<><path d="M4.5 3h15" /><path d="M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3" /><line x1="6" y1="10" x2="18" y2="10" /></>);
const IconPill       = _i(<><path d="M10.5 20.5a4.5 4.5 0 0 1-3.18-1.32l-3.5-3.5a4.5 4.5 0 0 1 6.36-6.36l3.5 3.5a4.5 4.5 0 0 1 0 6.36 4.5 4.5 0 0 1-3.18 1.32z" transform="rotate(-45 12 12)" /></>);
const IconBuilding   = _i(<><rect x="4" y="2" width="16" height="20" rx="1" /><line x1="9" y1="6" x2="9" y2="6.01" /><line x1="15" y1="6" x2="15" y2="6.01" /><line x1="9" y1="11" x2="9" y2="11.01" /><line x1="15" y1="11" x2="15" y2="11.01" /><line x1="9" y1="16" x2="9" y2="16.01" /><line x1="15" y1="16" x2="15" y2="16.01" /></>);
const IconBookOpen   = _i(<><path d="M2 4h6a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H2z" /><path d="M22 4h-6a3 3 0 0 0-3 3v13a2 2 0 0 1 2-2h7z" /></>);
const IconShield     = _i(<path d="M12 2l8 4v6c0 5-3.5 9.5-8 10-4.5-.5-8-5-8-10V6z" />);
const IconGlobe      = _i(<><circle cx="12" cy="12" r="9" /><line x1="3" y1="12" x2="21" y2="12" /><path d="M12 3a14 14 0 0 1 0 18" /><path d="M12 3a14 14 0 0 0 0 18" /></>);
const IconLink       = _i(<><path d="M10 13a5 5 0 0 0 7.07 0l3-3a5 5 0 1 0-7.07-7.07l-1.5 1.5" /><path d="M14 11a5 5 0 0 0-7.07 0l-3 3a5 5 0 1 0 7.07 7.07l1.5-1.5" /></>);
const IconChart      = _i(<><line x1="18" y1="20" x2="18" y2="10" /><line x1="12" y1="20" x2="12" y2="4" /><line x1="6" y1="20" x2="6" y2="14" /></>);
const IconDownload   = _i(<><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><polyline points="7 10 12 15 17 10" /><line x1="12" y1="15" x2="12" y2="3" /></>);
const IconLinkedin   = _i(<><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-4 0v7h-4v-7a6 6 0 0 1 6-6z" /><rect x="2" y="9" width="4" height="12" /><circle cx="4" cy="4" r="2" /></>);
const IconFacebook   = _i(<path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z" />);
const IconYoutube    = _i(<><path d="M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z" /><polygon points="9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02" /></>);
const IconMenu       = _i(<><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="18" x2="21" y2="18" /></>);
const IconStar       = _i(<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />);
const IconHand       = _i(<><path d="M18 11V6a2 2 0 0 0-4 0v6" /><path d="M14 10V4a2 2 0 0 0-4 0v8" /><path d="M10 10.5V6a2 2 0 0 0-4 0v8" /><path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15" /></>);
const IconAlert      = _i(<><circle cx="12" cy="12" r="9" /><line x1="12" y1="8" x2="12" y2="12" /><line x1="12" y1="16" x2="12.01" y2="16" /></>);

// Map pole id → icon component (for cards & filters)
const POLE_ICONS = {
  "Urgences & Réanimation":              IconActivity,
  "Cardio-Métabolisme":                  IconHeart,
  "Digestif Médico-Chirurgical":         IconScissors,
  "Cardiovasc., Thoracique, Tête & Cou": IconLungs,
  "Néphro-Urologique":                   IconDroplet,
  "Oncologie":                           IconBolt,
  "Médecine Interne":                    IconStethoscope,
  "Locomoteur & Neurochirurgical":       IconBrain,
  "Plateau technique":                   IconScan,
  "Check-up":                            IconShield,
};

Object.assign(window, {
  IconCheck, IconArrowRight, IconArrowDown, IconChevDown, IconChevLeft, IconChevRight,
  IconSearch, IconClose, IconCalendar, IconClock, IconPhone, IconMail, IconMap,
  IconUser, IconHeart, IconBrain, IconActivity, IconScissors, IconEye, IconStethoscope,
  IconLungs, IconDroplet, IconBolt, IconScan, IconBeaker, IconPill, IconBuilding,
  IconBookOpen, IconShield, IconGlobe, IconLink, IconChart, IconDownload,
  IconLinkedin, IconFacebook, IconYoutube, IconMenu, IconStar, IconHand, IconAlert,
  POLE_ICONS,
});
