/* eslint-disable */ // Shared gated-PDF download modal. // Exposes window.openGatedPdf(src, title) which mounts a form modal, // and on submit triggers the actual file download. (function () { const { useState, useEffect } = React; function GatedPdfModal({ src, title, onClose }) { const [form, setForm] = useState({ fn: '', ln: '', email: '', org: '', role: 'Facilities / Operations', consent: true, newsletter: true }); const upd = (k, v) => setForm((f) => ({ ...f, [k]: v })); const valid = form.fn && form.ln && form.email.includes('@') && form.org && form.consent; useEffect(() => { const onKey = (e) => { if (e.key === 'Escape') onClose(); }; window.addEventListener('keydown', onKey); const prevOverflow = document.body.style.overflow; document.body.style.overflow = 'hidden'; return () => { window.removeEventListener('keydown', onKey); document.body.style.overflow = prevOverflow; }; }, [onClose]); const submit = () => { if (!valid) return; // Trigger download const a = document.createElement('a'); a.href = src; a.download = (src.split('/').pop() || 'document.pdf'); a.target = '_blank'; a.rel = 'noopener'; document.body.appendChild(a); a.click(); document.body.removeChild(a); onClose({ submitted: true, name: form.fn }); }; const lbl = { fontSize: 12, fontWeight: 700, color: '#1F1F1F', display: 'block', marginBottom: 4 }; const inp = { width: '100%', padding: '11px 13px', border: '1px solid #D4D4D4', borderRadius: 6, fontSize: 14, fontFamily: 'inherit', background: '#fff', outline: 'none', boxSizing: 'border-box' }; return (
Tell us a bit about you and we'll send the PDF straight to your browser.