// SealBadge — monogram badge for agency / linguist / AI seals.
// Used on map pins (as tiny mark), inside reader drawer, on doc cards.
function SealBadge({ code, sm, title }) {
  const agencies = (window.PERICOPE_DATA && window.PERICOPE_DATA.AGENCIES) || [];
  const a = agencies.find(x => x.code === code);
  if (!a && code !== 'ai' && code !== 'reviewer') return null;

  const cls = ['seal', code, sm?'sm':''].filter(Boolean).join(' ');
  let mono, label;
  if (code === 'ai')      { mono = 'AI'; label = 'AI first pass'; }
  else if (code === 'reviewer') { mono = 'Lg'; label = 'Linguist reviewed'; }
  else { mono = a.mono; label = a.name; }

  // Biblica: use the real logo image instead of a monogram
  const monoNode = code === 'bib'
    ? React.createElement('span', { className: 'mono mono-img' },
        React.createElement('img', { src: (window.__resources && window.__resources.biblicaLogo) || 'assets/biblica-logo.png', alt: 'Biblica' }))
    : React.createElement('span', { className: 'mono' }, mono);

  return React.createElement('span', {
    className: cls,
    title: title || label,
  },
    monoNode,
    sm ? null : label
  );
}
Object.assign(window, { SealBadge });
