// Primus IQ — URL Input Modal const spInputShell = (children, onClose) => (
{children}
); const spFieldLabel = { fontSize: 11, fontWeight: 700, color: 'var(--mute)', letterSpacing: '0.08em', textTransform: 'uppercase', marginBottom: 6, display: 'block', }; const spTextField = { width: '100%', height: 40, padding: '0 12px', borderRadius: 9, border: '1px solid var(--line-2)', fontSize: 13, fontFamily: 'inherit', outline: 'none', color: 'var(--ink)', background: 'white', boxSizing: 'border-box', }; const UrlInputModal = ({ open, onClose, onConfirm }) => { const [url, setUrl] = React.useState(''); const [title, setTitle] = React.useState(''); React.useEffect(() => { if (open) { setUrl(''); setTitle(''); } }, [open]); if (!open) return null; const trimmed = url.trim(); const ready = /^https?:\/\/.+/i.test(trimmed); const submit = () => { if (ready) onConfirm({ url: trimmed, title: title.trim() }); }; return spInputShell((
e.stopPropagation()} style={{ width: 560, maxWidth: '94%', background: 'var(--bg-card)', borderRadius: 18, boxShadow: '0 30px 80px rgba(26,22,20,0.30), 0 0 0 1px var(--line)', animation: 'rise 0.22s ease-out', display: 'flex', flexDirection: 'column', overflow: 'hidden', }}>

Add a URL

The link is saved as a reference for the research pipeline to fetch.
setUrl(e.target.value)} onKeyDown={e => { if (e.key === 'Enter') submit(); }} placeholder="https://example.com/report" style={spTextField} /> {trimmed && !ready &&
Enter a full URL starting with http:// or https://
}
setTitle(e.target.value)} placeholder="e.g. World Bank GDP outlook" style={spTextField} />
), onClose); }; Object.assign(window, { UrlInputModal, });