dirtyCheck function initializes a collection of event listeners based on the beforeunload event to prevent users from leaving the page.
While it is considered unreliable (see usage notes), it works for our needs.
import { dirtyCheck } from "https://cdn.jsdelivr.net/gh/IdahoStatePolice/CDN@latest/js/Utils.js";
dirtyCheck();