/** * Safe wrapper around umami's programmatic `track`. The analytics script is * skipped on localhost, lazily loaded elsewhere, and routinely blocked by * content blockers, so a bare `umami.track(...)` throws a ReferenceError that * would take core actions (incrementing progress, syncing settings) down with * it. Declarative `data-umami-event` attributes are handled by the script * itself and never need this; reach for it only from event handlers. */ export const track = (event: string, data?: Record): void => { if (typeof umami !== "undefined") umami.track(event, data); };