1import{display}from"./inactivity-prompt.js";import{cookieValue}from"./utilities.js";const inactivityCookieName="stInactivity",logOutUrl="/account/logout?timeOut=true",lastActivityKey="lastActivityTime",broadcastChannelName="inactivityBroadcastChannel",promptBroadcastKey="promptBroadcast",logOutBroadcastKey="logOutBroadcast",promptPeriodMinutes=cookieValue(inactivityCookieName),logOutPeriodMinutes=.5,minutesToMiliseconds=t=>60*t*1e3,promptPeriodMiliseconds=minutesToMiliseconds(promptPeriodMinutes),logOutPeriodMiliseconds=minutesToMiliseconds(logOutPeriodMinutes);let broadcastChannel="undefined"!=typeof BroadcastChannel?new BroadcastChannel(broadcastChannelName):null,timer;const setLastActivity=()=>{clearTimeout(timer),timer=setTimeout(checkForUserPrompt,promptPeriodMiliseconds),localStorage.setItem(lastActivityKey,Date.now())},checkForUserPrompt=()=>{var t=localStorage.getItem(lastActivityKey);t&&Date.now()-t>=promptPeriodMiliseconds&&(promptUser(),broadcastChannel)&&broadcastChannel.postMessage(promptBroadcastKey)},promptUser=()=>{display(),timer=setTimeout(checkForLogOut,logOutPeriodMiliseconds)},checkForLogOut=()=>{var t=localStorage.getItem(lastActivityKey);t&&Date.now()-t>=promptPeriodMiliseconds+logOutPeriodMiliseconds&&(logOut(),broadcastChannel)&&broadcastChannel.postMessage(logOutBroadcastKey)},logOut=()=>{window.location.href=logOutUrl},resetTimerOnInteraction=()=>window.site.doc.on("mousemove keydown scroll click",setLastActivity),resetTimerOnClick=()=>window.site.doc.on("click",setLastActivity),removeAll=()=>window.site.doc.off("mousemove keydown scroll click"),init=()=>{$("body").one("click",function(){$(".m-popup-new, .popupFade-new").remove()}),null!=cookieValue(inactivityCookieName)&&(setLastActivity(),resetTimerOnInteraction(),broadcastChannel)&&(broadcastChannel.onmessage=function(t){t.data===logOutBroadcastKey?logOut():t.data===promptBroadcastKey&&promptUser()})};export default init;export{resetTimerOnClick,removeAll,resetTimerOnInteraction}; 2//# sourceMappingURL=inactivity-monitor-97ae7655cb.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.