(function () { const POLICY_VERSION = '2026-08-01'; const CONSENT_DURATION_MS = 1000 * 60 * 60 * 24 * 182; // ~6 months, adjust here to change duration const STORAGE_KEY = 'acorn_cookie_consent'; const listeners = []; function readConsent() { try { const raw = localStorage.getItem(STORAGE_KEY); if (!raw) return null; return JSON.parse(raw); } catch (e) { return null; } } function isValid(consent) { if (!consent) return false; if (consent.policyVersion !== POLICY_VERSION) return false; if (!consent.timestamp || Date.now() - consent.timestamp > CONSENT_DURATION_MS) return false; return true; } function writeConsent(partial) { const consent = { essential: true, analytics: false, preference: false, ...partial, timestamp: Date.now(), policyVersion: POLICY_VERSION }; localStorage.setItem(STORAGE_KEY, JSON.stringify(consent)); listeners.forEach((cb) => { try { cb(consent); } catch (e) {} }); applyScripts(consent); return consent; } // Integration points: swap these for real script loaders once providers are chosen. function applyScripts(consent) { if (consent.analytics) { /* load analytics scripts here */ } else { /* stop/disable analytics scripts here */ } if (consent.preference) { /* load preference scripts here */ } else { /* stop/disable preference scripts here */ } } let openPanelFn = null; window.AcornConsent = { getConsent: readConsent, hasValidConsent: () => isValid(readConsent()), onChange: (cb) => { listeners.push(cb); }, open: () => { if (openPanelFn) openPanelFn(); }, }; const { useState, useEffect, useRef } = React; function ToggleRow({ label, status, description, checked, onChange, locked }) { return (
{label}
{locked ? {status} : }

{description}

); } function PreferencesPanel({ onClose, onSave, initial, triggerRef }) { const [analytics, setAnalytics] = useState(initial.analytics); const [preference, setPreference] = useState(initial.preference); const panelRef = useRef(null); useEffect(() => { const el = panelRef.current; if (el) { const f = el.querySelector('button, [href], input, [tabindex]'); if (f) f.focus(); } const onKey = (e) => { if (e.key === 'Escape') onClose(); }; document.addEventListener('keydown', onKey); return () => { document.removeEventListener('keydown', onKey); if (triggerRef && triggerRef.current) triggerRef.current.focus(); }; }, []); return (

Choose Your Cookie Preferences

Essential cookies keep the website working and cannot be turned off. You can choose whether Acorn may also use analytics and preference cookies.

); } function Toast({ message }) { return (
{message}
); } function CookieConsent() { const [showBanner, setShowBanner] = useState(false); const [showPanel, setShowPanel] = useState(false); const [toast, setToast] = useState(false); const bannerTriggerRef = useRef(null); useEffect(() => { setShowBanner(!isValid(readConsent())); window.AcornConsent.open = () => setShowPanel(true); }, []); const finish = (partial) => { writeConsent(partial); setShowBanner(false); setShowPanel(false); setToast(true); setTimeout(() => setToast(false), 1200); }; return ( {showBanner && (
A Quick Note About Cookies

We use essential cookies to keep the site secure. With your permission, we'd also like to use analytics and preference cookies to improve your experience.

Read our Cookie Policy
)} {showPanel && setShowPanel(false)} onSave={finish} triggerRef={bannerTriggerRef} />} {toast && }
); } const mount = document.createElement('div'); mount.id = 'acorn-cookie-consent-root'; document.body.appendChild(mount); ReactDOM.createRoot(mount).render(); })();