function CookieBar() {
  const [lang, setLang] = React.useState(window.ISOGetLang ? window.ISOGetLang() : 'NL');
  const [open, setOpen] = React.useState(false);
  React.useEffect(() => {
    const onLang = () => setLang(window.ISOGetLang ? window.ISOGetLang() : 'NL');
    window.addEventListener('iso-lang', onLang);
    let stored = null;
    try { stored = localStorage.getItem('iso-cookie-consent'); } catch (e) {}
    if (!stored) setOpen(true);
    return () => window.removeEventListener('iso-lang', onLang);
  }, []);
  const decide = (value) => {
    try { localStorage.setItem('iso-cookie-consent', value); } catch (e) {}
    setOpen(false);
    window.dispatchEvent(new CustomEvent('iso-cookie-consent', { detail: value }));
  };
  if (!open) return null;
  const btn = {
    fontFamily: 'var(--font-body)', fontSize: 15, borderRadius: 'var(--radius-pill)',
    padding: '11px 20px', cursor: 'pointer', border: '1px solid var(--ink-800)', whiteSpace: 'nowrap',
  };
  return React.createElement('div', {
    role: 'dialog', 'aria-label': 'Cookievoorkeuren',
    style: {
      position: 'fixed', left: 16, right: 16, bottom: 16, zIndex: 9000, background: '#fff',
      border: '1px solid var(--ink-200, rgba(0,0,0,0.12))', borderRadius: 16,
      boxShadow: '0 18px 48px rgba(0,0,0,0.18)', padding: '20px 22px',
      maxWidth: 720, margin: '0 auto', display: 'flex', flexWrap: 'wrap', gap: 16,
      alignItems: 'center', justifyContent: 'space-between',
    },
  },
    React.createElement('div', { style: { flex: '1 1 320px', minWidth: 260 } },
      React.createElement('div', { style: { fontFamily: 'var(--font-display)', fontSize: 19, marginBottom: 6, color: 'var(--ink-900, #111)' } }, 'Cookies op deze website'),
      React.createElement('p', { style: { margin: 0, fontSize: 14, lineHeight: 1.55, color: 'var(--ink-600, #555)' } },
        'Wij gebruiken functionele cookies om de site te laten werken. Met uw toestemming plaatsen wij ook analytische cookies om te zien hoe de site wordt gebruikt.')),
    React.createElement('div', { style: { display: 'flex', gap: 10, flexWrap: 'wrap' } },
      React.createElement('button', {
        type: 'button', onClick: () => decide('necessary'),
        style: Object.assign({}, btn, { background: 'none', color: 'var(--ink-800, #222)' }),
      }, 'Alleen noodzakelijk'),
      React.createElement('button', {
        type: 'button', onClick: () => decide('all'),
        style: Object.assign({}, btn, { background: 'var(--ink-900, #111)', borderColor: 'var(--ink-900, #111)', color: '#fff' }),
      }, 'Alles accepteren'))
  );
}
Object.assign(window, { CookieBar });
