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,IAAI,uBAC3BpB,KAAKgE,MAAMzC,gBAAmB8C,IAC1BrE,KAAK4N,YAAYvK,QACjBrD,KAAKgE,MAAMzC,gBAAkB,IAAI,CACpC,GACH,GAEV,CAEAI,IAAAA,CAAKoM,GAAU,GACX/N,KAAK2N,QAAQzM,aAAa,iBAAiB,GAC3ClB,KAAKP,QAAS,EACd+N,EAAa/N,QAAS,EACtBO,KAAKH,QAAQsB,UAAUO,OAAO,uBAC9B1B,KAAKgE,MAAMzC,gBAAmB8C,IACvBA,EAAEC,QAAUtE,KAAKgE,OAAOhE,KAAKwB,cAAcuM,EAAQ,CAE9D,CAEAvM,aAAAA,CAAcuM,GAAU,GACpB/N,KAAKH,QAAQqB,aAAa,eAAe,GACzClB,KAAKgE,MAAMzC,gBAAkB,KAC1BwM,GAAS/N,KAAK2N,QAAQtK,OAC7B,EAGJ,MAAM2K,EAAwB5O,SAASC,cAAc,4BACjD4O,EAAsB7O,SAASC,cAAc,kBAC7C6O,EAAuB9O,SAASC,cAAc,6BAC9C8O,EAA4C,OAAxBF,EAA+BA,EAAoB5O,cAAc,wBAA0B,KAEvF,MAAzB2O,GAAwD,MAAvBC,GAAuD,MAAxBC,GAAqD,MAArBC,GAC/F,IAAIT,EAAmBM,EAAuBC,EAAqBC,EAAsBC,E","sources":["webpack://riat/./wwwroot/app/src/js/main-navigation.js","webpack://riat/./wwwroot/app/src/js/keyboard-accessibility-check.js","webpack://riat/./node_modules/tornis/src/tornis.js","webpack://riat/./wwwroot/app/src/js/scrolling.js","webpack://riat/./wwwroot/app/src/js/header-search.js"],"sourcesContent":["// *****************************\r\n// ***** Main Navigation *****\r\n// *****************************\r\nimport { breakPoint } from './config';\r\nimport { keyboardControl } from './keyboard-accessibility-check';\r\n\r\nconst $html = document.querySelector('html');\r\nlet isMobile = true,\r\n resizeTimeout = null;\r\n\r\nexport const mobileNavigation = {\r\n active: false\r\n}\r\nexport const desktopNavigation = {\r\n active: false\r\n}\r\n\r\nclass menu {\r\n\r\n constructor(wrapper, toggleButton, ul) {\r\n this.wrapper = wrapper;\r\n this.desktopSubmenuIndicator = wrapper.querySelector('.submenu--menu-indicator');\r\n this.navContent = wrapper.querySelector('nav');\r\n this.mobileToggle = toggleButton;\r\n this.ul = ul;\r\n this.expanded = false;\r\n this.hideTimeout = null;\r\n this.hideDelay = 500;\r\n this.activeItemIndex = -1;\r\n this.activeSubmenuItemIndex = -1;\r\n this.items = [];\r\n [...this.ul.querySelectorAll('.header--content--menu > nav > ul > li')].forEach(i => {\r\n let x = this.items.length;\r\n this.items[x] = new menuItem(x, i, 1);\r\n });\r\n }\r\n\r\n show() {\r\n // make menu semantically visible in both mobile and desktop versions\r\n this.expanded = true;\r\n this.wrapper.removeAttribute('aria-hidden');\r\n if(isMobile) {\r\n // mobile - animate in the menu element\r\n this.mobileToggle.setAttribute('aria-expanded', true);\r\n $html.classList.add('mobile-menu-fading');\r\n mobileNavigation.active = true;\r\n window.requestAnimationFrame(() => {\r\n $html.classList.add('mobile-menu-active');\r\n this.wrapper.ontransitionend = () => {\r\n this.transitionEnd(true);\r\n this.update(true, 0, -1);\r\n };\r\n });\r\n } else {\r\n // desktop resets\r\n mobileNavigation.active = false;\r\n window.requestAnimationFrame(() => {\r\n $html.classList.remove('mobile-menu-active');\r\n });\r\n }\r\n }\r\n\r\n hide() {\r\n if(isMobile && mobileNavigation.active) {\r\n // mobile - animate out menu element\r\n this.expanded = false;\r\n mobileNavigation.active = false;\r\n this.mobileToggle.setAttribute('aria-expanded', false);\r\n $html.classList.add('mobile-menu-fading');\r\n $html.classList.remove('mobile-menu-active');\r\n this.wrapper.ontransitionend = () => {\r\n this.transitionEnd(false);\r\n };\r\n } else {\r\n // hide menu semantically in both mobile and desktop versions\r\n this.expanded = false;\r\n this.mobileToggle.setAttribute('aria-expanded', false);\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n }\r\n }\r\n\r\n closeAllSubmenus() {\r\n for(let x = 0, l = this.items.length; x < l; x++) {\r\n if(this.items[x].hasSubmenu) {\r\n this.items[x].submenu.hide();\r\n }\r\n }\r\n this.activeItemIndex = -1;\r\n this.activeSubmenuItemIndex = -1;\r\n }\r\n\r\n transitionEnd(mode) {\r\n if(!mode) {\r\n // menu has hidden\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n }\r\n $html.classList.remove('mobile-menu-fading');\r\n this.wrapper.ontransitionend = null;\r\n }\r\n\r\n storeTriggerPositions() {\r\n for(let x = 0, l = this.items.length; x < l; x++) {\r\n if(this.items[x].button != null) {\r\n let b = this.items[x].button.getBoundingClientRect();\r\n this.items[x].buttonX = Math.floor((b.left + b.right) / 2);\r\n }\r\n }\r\n }\r\n\r\n positionSubmenu() {\r\n if(!isMobile && this.activeItemIndex > -1 && this.items[this.activeItemIndex].hasSubmenu) {\r\n let submenuEl = this.items[this.activeItemIndex].submenu.wrapper;\r\n let submenuWidth = submenuEl.offsetWidth;\r\n let submenuLeft = `clamp(var(--submenu-min-left), ${this.items[this.activeItemIndex].buttonX - (submenuWidth / 2)}px, calc((var(--submenu-min-left) + var(--submenu-width-limit)) - ${submenuWidth}px))`;\r\n submenuEl.style.setProperty('--submenu-left', submenuLeft);\r\n }\r\n }\r\n\r\n update(setFocus = false, itemIndex = -1, submenuItemIndex = -1) {\r\n if(!isMobile) this.storeTriggerPositions();\r\n if (itemIndex > -1 && submenuItemIndex > -1) {\r\n\r\n // FOCUS TARGET IS SUBMENU MENU ITEM\r\n\r\n if (isMobile && !this.expanded) this.show();\r\n // close old submenu without animation?\r\n if (this.activeItemIndex > -1 && this.activeSubmenuItemIndex > -1 && itemIndex != this.activeItemIndex && this.items[this.activeItemIndex].submenu.expanded) this.items[this.activeItemIndex].submenu.hide(isMobile);\r\n // open new submenu\r\n if (!this.items[itemIndex].submenu.expanded) this.items[itemIndex].submenu.show(isMobile || (this.activeItemIndex == -1 || this.activeSubmenuItemIndex == -1));\r\n // focus on item\r\n if (keyboardControl.active && setFocus) this.items[itemIndex].submenu.items[submenuItemIndex].focus();\r\n\r\n } else if (itemIndex > -1) {\r\n\r\n // FOCUS TARGET IS TOP-LEVEL MENU ITEM\r\n\r\n if (isMobile && !this.expanded) this.show();\r\n // close old submenu with animation?\r\n if (this.activeItemIndex > -1 && this.items[this.activeItemIndex].hasSubmenu) {\r\n if (this.items[this.activeItemIndex].submenu.expanded) this.items[this.activeItemIndex].submenu.hide(true);\r\n }\r\n // focus on item\r\n if (keyboardControl.active && setFocus) {\r\n if (this.items[itemIndex].hasSubmenu) {\r\n this.items[itemIndex].submenu.toggle.focus();\r\n } else {\r\n this.items[itemIndex].link.focus();\r\n }\r\n }\r\n\r\n } else {\r\n if (this.activeItemIndex > -1 && this.activeSubmenuItemIndex > -1 && this.items[this.activeItemIndex].submenu.expanded) this.items[this.activeItemIndex].submenu.hide(!isMobile);\r\n if (isMobile && this.expanded) {\r\n this.hide();\r\n if (keyboardControl.active && setFocus) this.mobileToggle.focus();\r\n }\r\n }\r\n // update tabIndex setting\r\n if (this.activeItemIndex != itemIndex) {\r\n if (this.activeItemIndex > -1) {\r\n if (this.items[this.activeItemIndex].hasSubmenu) {\r\n this.items[this.activeItemIndex].submenu.toggle.setAttribute('tabindex', '-1');\r\n } else {\r\n this.items[this.activeItemIndex].link.setAttribute('tabindex', '-1');\r\n }\r\n }\r\n let nextTabIndex = itemIndex;\r\n if (!isMobile && nextTabIndex == -1) nextTabIndex = 0;\r\n if (nextTabIndex > -1) {\r\n if (this.items[nextTabIndex].hasSubmenu) {\r\n this.items[nextTabIndex].submenu.toggle.setAttribute('tabindex', '0');\r\n } else {\r\n this.items[nextTabIndex].link.setAttribute('tabindex', '0');\r\n }\r\n }\r\n }\r\n // store new values\r\n this.activeItemIndex = itemIndex;\r\n this.activeSubmenuItemIndex = submenuItemIndex;\r\n // position submenu?\r\n if (this.activeItemIndex > -1) this.positionSubmenu();\r\n }\r\n}\r\n\r\nclass menuItem {\r\n constructor(itemIndex, obj, level) {\r\n this.level = level;\r\n this.index = itemIndex;\r\n this.li = obj;\r\n this.button = obj.querySelector('button.submenu--toggle');\r\n this.buttonX = 0;\r\n let sub = obj.querySelector('div.submenu');\r\n if (this.button && sub) {\r\n this.hasSubmenu = true;\r\n this.submenu = new subMenu(sub, this.button, level);\r\n } else {\r\n this.hasSubmenu = false;\r\n this.link = obj.querySelector('a');\r\n }\r\n }\r\n}\r\n\r\nclass subMenu {\r\n constructor(sub, button, level) {\r\n this.expanded = false;\r\n this.toggle = button;\r\n this.wrapper = sub;\r\n this.level = level;\r\n this.closeBtn = this.wrapper.querySelector('.submenu--close');\r\n this.inner = this.wrapper.querySelector('.submenu--content-area');\r\n this.items = [];\r\n [...this.inner.querySelectorAll('a, button')].forEach(i => {\r\n this.items.push(i);\r\n });\r\n }\r\n show(animate) {\r\n this.expanded = true;\r\n this.wrapper.removeAttribute('aria-hidden');\r\n this.toggle.setAttribute('aria-expanded', true);\r\n if(isMobile) {\r\n this.wrapper.style.maxHeight = this.inner.offsetHeight + 'px';\r\n if (animate) {\r\n this.wrapper.classList.add('animate');\r\n this.wrapper.ontransitionend = () => {\r\n this.wrapper.classList.remove('animate');\r\n if (this.level > 1 || isMobile) {\r\n this.wrapper.style.maxHeight = 'none';\r\n this.wrapper.ontransitionend = null;\r\n }\r\n };\r\n } else {\r\n this.wrapper.style.maxHeight = 'none';\r\n }\r\n } else {\r\n this.wrapper.style.maxHeight = 'none';\r\n desktopNavigation.active = true;\r\n if (animate) {\r\n window.requestAnimationFrame(() => {\r\n $html.classList.add('desktop-menu-fading');\r\n window.requestAnimationFrame(() => {\r\n $html.classList.add('desktop-menu-active');\r\n this.wrapper.ontransitionend = () => {\r\n $html.classList.remove('desktop-menu-fading');\r\n this.wrapper.ontransitionend = null;\r\n };\r\n });\r\n });\r\n } else {\r\n $html.classList.add('desktop-menu-active');\r\n }\r\n }\r\n }\r\n hide(animate) {\r\n this.expanded = false;\r\n if (isMobile) {\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n this.toggle.setAttribute('aria-expanded', false);\r\n this.wrapper.style.maxHeight = this.inner.offsetHeight + 'px';\r\n window.requestAnimationFrame(() => {\r\n this.wrapper.style.maxHeight = 0;\r\n });\r\n if (animate) {\r\n this.wrapper.classList.add('animate');\r\n this.wrapper.ontransitionend = (e) => {\r\n if(e.target == this.wrapper) this.wrapper.classList.remove('animate');\r\n };\r\n }\r\n } else {\r\n desktopNavigation.active = false;\r\n if (animate) {\r\n $html.classList.add('desktop-menu-fading');\r\n $html.classList.remove('desktop-menu-active');\r\n this.wrapper.ontransitionend = () => {\r\n this.wrapper.ontransitionend = null;\r\n $html.classList.remove('desktop-menu-fading');\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n this.toggle.setAttribute('aria-expanded', false);\r\n };\r\n } else {\r\n $html.classList.remove('desktop-menu-active');\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n this.toggle.setAttribute('aria-expanded', false);\r\n }\r\n }\r\n }\r\n}\r\n\r\n// create instance of menu\r\n\r\nif(document.querySelector('.header--content--menu') != null) {\r\n const m = new menu(document.querySelector('.header--content--menu'), document.querySelector('.header--content--menu-toggle button'), document.querySelector('.header--content--menu > nav > ul'));\r\n\r\n\r\n // mobile 'whole menu toggle' functionality\r\n\r\n m.mobileToggle.addEventListener('click', () => {\r\n if (isMobile) {\r\n if (m.expanded) {\r\n // close\r\n m.hide();\r\n } else {\r\n // open\r\n m.show();\r\n }\r\n }\r\n });\r\n\r\n // close menu if user focus moves outside\r\n\r\n const bodyClickTouch = (t) => {\r\n if (!isMobile && m.activeSubmenuItemIndex > -1) {\r\n let inMenu = false;\r\n while (t != document.body) {\r\n if (t == m.wrapper) {\r\n inMenu = true;\r\n break\r\n }\r\n t = t.parentNode;\r\n }\r\n if (!inMenu) {\r\n m.update();\r\n }\r\n }\r\n }\r\n document.body.addEventListener('click', (e) => {\r\n bodyClickTouch(e.target);\r\n });\r\n\r\n // add menu item listeners\r\n\r\n for (let x = 0, l = m.items.length; x < l; x++) {\r\n let o = m.items[x];\r\n if (o.hasSubmenu) {\r\n\r\n o.submenu.toggle.addEventListener('click', () => {\r\n clearTimeout(m.focusTimeout);\r\n m.focusTimeout = null;\r\n if (o.submenu.expanded) {\r\n m.update(true, o.index);\r\n } else {\r\n m.update(true, o.index, 0);\r\n }\r\n });\r\n \r\n o.submenu.toggle.addEventListener('focus', () => {\r\n if (m.expanded && m.activeItemIndex != o.index) {\r\n clearTimeout(m.focusTimeout);\r\n m.focusTimeout = setTimeout(() => {\r\n m.update(true, o.index);\r\n m.focusTimeout = null;\r\n }, 250);\r\n }\r\n });\r\n \r\n // add submenu expander listeners if required\r\n \r\n for (let xx = 0, ll = o.submenu.items.length; xx < ll; xx++) {\r\n let oo = o.submenu.items[xx];\r\n if (oo.hasSubmenu) {\r\n oo.submenu.toggle.addEventListener('click', () => {\r\n m.update(true, o.index, oo.index);\r\n });\r\n }\r\n }\r\n \r\n // desktop only - submenu close button\r\n \r\n o.submenu.closeBtn.addEventListener('click', () => {\r\n if (o.submenu.expanded) m.update(true, o.index);\r\n });\r\n }\r\n }\r\n\r\n // add keyboard accessibility\r\n m.ul.addEventListener('keydown', (e) => {\r\n switch (e.key) {\r\n // ESCAPE jumps out a level\r\n case 'Escape':\r\n e.preventDefault();\r\n if (m.activeSubmenuItemIndex > -1) {\r\n m.update(true, m.activeItemIndex);\r\n } else {\r\n m.update(true);\r\n }\r\n break;\r\n // DOWN / RIGHT to move through items at current level\r\n case 'Down':\r\n case 'ArrowDown':\r\n case 'Right':\r\n case 'ArrowRight':\r\n e.preventDefault();\r\n if (m.activeSubmenuItemIndex > -1) {\r\n let next = m.activeSubmenuItemIndex + 1,\r\n list = m.items[m.activeItemIndex].submenu.items;\r\n if (next >= (isMobile ? list.length - 1 : list.length)) next = 0; // don't include submenu close button in mobile mode\r\n m.update(true, m.activeItemIndex, next);\r\n } else {\r\n let next = m.activeItemIndex + 1,\r\n list = m.items;\r\n if (next >= list.length) next = 0;\r\n m.update(true, next);\r\n }\r\n break;\r\n // UP / LEFT to move backwards through items at current level\r\n case 'Up':\r\n case 'ArrowUp':\r\n case 'Left':\r\n case 'ArrowLeft':\r\n e.preventDefault();\r\n if (m.activeSubmenuItemIndex > -1) {\r\n let next = m.activeSubmenuItemIndex - 1,\r\n list = m.items[m.activeItemIndex].submenu.items;\r\n if (next < 0) next = isMobile ? list.length - 2 : list.length - 1; // don't include submenu close button in mobile mode\r\n m.update(true, m.activeItemIndex, next);\r\n } else {\r\n let next = m.activeItemIndex - 1,\r\n list = m.items;\r\n if (next < 0) next = list.length - 1;\r\n m.update(true, next);\r\n }\r\n break;\r\n // TAB close menu (if open) and move to next tab element\r\n case 'Tab':\r\n if(isMobile) {\r\n if (!m.hasSearch && m.activeItemIndex > -1) {\r\n m.hide();\r\n }\r\n } else {\r\n m.update();\r\n }\r\n break;\r\n // SPACE/ENTER/RETURN to click a item\r\n case 'Spacebar':\r\n case ' ':\r\n case 'Enter':\r\n case 'Return':\r\n e.preventDefault();\r\n if (m.activeSubmenuItemIndex > -1) {\r\n m.items[m.activeItemIndex].submenu.items[m.activeSubmenuItemIndex].click();\r\n } else {\r\n if (m.items[m.activeItemIndex].hasSubmenu) {\r\n m.items[m.activeItemIndex].submenu.toggle.click();\r\n } else {\r\n m.items[m.activeItemIndex].link.click();\r\n }\r\n }\r\n break;\r\n }\r\n });\r\n\r\n // define and trigger resize check\r\n\r\n const resize = () => {\r\n let prev = isMobile;\r\n isMobile = window.innerWidth < breakPoint.LG;\r\n if(!isMobile) {\r\n m.storeTriggerPositions();\r\n // position submenu?\r\n if (m.activeItemIndex > -1) m.positionSubmenu();\r\n }\r\n if(isMobile !== prev) {\r\n if(!isMobile) {\r\n m.show();\r\n m.update(false,1); // 'home' is hidden on desktop, so set menu to item 1 (without setting focus)\r\n } else {\r\n m.update(false);\r\n }\r\n // loop through all submenus and force close them\r\n m.items.forEach(s => {\r\n if(s.hasSubmenu) s.submenu.hide(false);\r\n });\r\n mobileNavigation.active = false;\r\n m.mobileToggle.setAttribute('aria-expanded', false);\r\n desktopNavigation.active = false;\r\n $html.classList.remove('mobile-menu-active');\r\n $html.classList.remove('desktop-menu-active');\r\n }\r\n };\r\n \r\n resize();\r\n window.addEventListener('resize', () => {\r\n clearTimeout(resizeTimeout);\r\n resizeTimeout = setTimeout(() => {\r\n resize();\r\n }, 100);\r\n });\r\n\r\n}\r\n","// keyboard control detection\r\n\r\nexport const keyboardControl = {\r\n active: false\r\n}\r\n\r\nlet accessibilityTimeout = null;\r\nconst toggleAccessibilityClass = (mode) => {\r\n clearTimeout(accessibilityTimeout);\r\n accessibilityTimeout = setTimeout(() => {\r\n document.body.classList.toggle('keyboard-control', mode);\r\n keyboardControl.active = mode;\r\n }, 100);\r\n}\r\ndocument.body.addEventListener('keydown', function(e) {\r\n switch (e.key) {\r\n case 'Escape':\r\n case 'Up':\r\n case 'ArrowUp':\r\n case 'Down':\r\n case 'ArrowDown':\r\n case 'Left':\r\n case 'ArrowLeft':\r\n case 'Tab':\r\n case 'Right':\r\n case 'ArrowRight':\r\n case 'PageUp':\r\n case 'PageDown':\r\n case 'Spacebar':\r\n case ' ':\r\n case 'Enter':\r\n case 'Return':\r\n toggleAccessibilityClass(true);\r\n break;\r\n }\r\n});\r\ndocument.body.addEventListener('mousedown', function() {\r\n toggleAccessibilityClass(false);\r\n});\r\ndocument.body.addEventListener('touchstart', function() {\r\n toggleAccessibilityClass(false);\r\n});","// Check if the module is initialised during server-side rendering\nconst isSSR = typeof window === 'undefined';\n\n/**\n * Simple throttling helper that limits a \n * function to only run once every {delay}ms\n * @param {Number} delay The delay in ms\n * @param {Function} fn the function to throttle\n */\nfunction throttled(delay, fn) {\n let lastCall = 0;\n return function(...args) {\n const now = new Date().getTime();\n if (now - lastCall < delay) {\n return;\n }\n lastCall = now;\n return fn(...args);\n };\n}\n\n/**\n * Calculates the mean value in an array\n * @param {Array} arr The array to average\n */\nfunction getMean(arr) {\n return Math.floor(arr.reduce((acc, curr) => {\n return acc + curr;\n }, 0) / arr.length);\n}\n\n/**\n * Main Tornis singleton class\n */\nclass Tornis {\n // set a whole load of initial values\n constructor() {\n\n // Exit out if this is running server-side\n if (isSSR) return;\n\n this.lastX = 0;\n this.lastY = 0;\n this.lastWidth = window.innerWidth;\n this.lastHeight = window.innerHeight;\n this.lastMouseX = 0;\n this.lastMouseY = 0;\n this.lastWindowX = window.screenX;\n this.lastWindowY = window.screenY;\n\n // device orientation\n this.lastAlpha = 0;\n this.lastBeta = 0;\n this.lastGamma = 0;\n this.currAlpha = 0;\n this.currBeta = 0;\n this.currGamma = 0;\n\n this.scrollHeight = document.body.scrollHeight;\n\n this.scrollChange = false;\n this.sizeChange = false;\n this.mouseChange = false;\n this.positionChange = false;\n this.orientationChange = false;\n this.devicePixelRatioChange = false;\n\n this.currX = 0;\n this.currY = 0;\n this.currWidth = window.innerWidth;\n this.currHeight = window.innerHeight;\n this.currMouseX = 0;\n this.currMouseY = 0;\n this.currWindowX = 0;\n \n // device pixel ratio (where able)\n this.currDevicePixelRatio = this.lastDevicePixelRatio = Math.max( window.devicePixelRatio || 1.0, 1.0 );\n \n // initialise array buffers for mouse velocity\n this.mouseXVelocity = [];\n this.mouseYVelocity = [];\n this.lastMouseXVelocity = 0;\n this.lastMouseYVelocity = 0;\n\n // initialise array buffers for window velocity\n this.windowXVelocity = [];\n this.windowYVelocity = [];\n this.lastWindowXVelocity = 0;\n this.lastWindowYVelocity = 0;\n\n\n // flag to limit rAF renders\n this.updating = false;\n\n // initialise the watched function queue\n this.callbacks = [];\n\n // bind this to ease class methods\n this.update = this.update.bind(this);\n this.handleResize = this.handleResize.bind(this);\n this.handleMouse = this.handleMouse.bind(this);\n this.handleOrientation = this.handleOrientation.bind(this);\n this.recalibrateOrientation = this.recalibrateOrientation.bind(this);\n this.formatData = this.formatData.bind(this);\n this.watch = this.watch.bind(this);\n this.unwatch = this.unwatch.bind(this);\n\n // throttled event handlers\n this.handleResize = throttled(110, this.handleResize); // resize is brutal, so throttle it more\n this.handleMouse = throttled(75, this.handleMouse);\n\n // bind event handlers to the window\n window.addEventListener('resize', this.handleResize);\n window.addEventListener('mousemove', this.handleMouse);\n window.addEventListener('deviceorientation', this.handleOrientation);\n\n // begin the update loop\n requestAnimationFrame(this.update);\n }\n\n /**\n * Event handler to capture screen size\n */\n handleResize(e) {\n this.currWidth = window.innerWidth;\n this.currHeight = window.innerHeight;\n }\n\n /**\n * Event handler to capture mouse position\n */\n handleMouse(e) {\n this.currMouseX = e.clientX;\n this.currMouseY = e.clientY;\n }\n\n /**\n * Event handler to capture device orientation\n */\n handleOrientation(e) {\n // cache initial position for calibration\n if (!this.initialAlpha) { this.initialAlpha = e.alpha; }\n if (!this.initialBeta) { this.initialBeta = e.beta; }\n if (!this.initialGamma) { this.initialGamma = e.gamma; }\n \n this.currAlpha = e.alpha;\n this.currBeta = e.beta;\n this.currGamma = e.gamma;\n }\n\n /** \n * Allow initial orientation to be reset to the last recorded values\n */\n recalibrateOrientation() {\n // cache the old values\n const calibration = {\n prev: {\n alpha: this.initialAlpha,\n beta: this.initialBeta,\n gamma: this.initialGamma,\n }\n };\n\n // reset the values to the last recorded position\n this.initialAlpha = this.lastAlpha;\n this.initialBeta = this.lastBeta;\n this.initialGamma = this.lastGamma;\n \n // add the new values to the cached calibration data\n calibration.current = {\n alpha: this.initialAlpha,\n beta: this.initialBeta,\n gamma: this.initialGamma,\n };\n\n return calibration;\n }\n\n /**\n * Returns a copy of the store data, formatted for public use\n */\n formatData() {\n return {\n scroll: {\n changed: this.scrollChange,\n left: Math.floor(this.lastX),\n right: Math.floor(this.lastX + this.lastWidth),\n top: Math.floor(this.lastY),\n bottom: Math.floor(this.lastY + this.lastHeight),\n velocity: {\n x: Math.floor(this.scrollXVelocity) || 0,\n y: Math.floor(this.scrollYVelocity) || 0\n }\n },\n size: {\n changed: this.sizeChange,\n x: Math.floor(this.lastWidth),\n y: Math.floor(this.lastHeight),\n docY: Math.floor(this.scrollHeight)\n },\n mouse: {\n changed: this.mouseChange,\n x: Math.floor(this.lastMouseX),\n y: Math.floor(this.lastMouseY),\n velocity: {\n x: Math.floor(this.lastMouseXVelocity) || 0,\n y: Math.floor(this.lastMouseYVelocity) || 0\n }\n },\n position: {\n changed: this.positionChange,\n left: Math.floor(this.lastWindowX),\n right: Math.floor(this.lastWindowX + this.lastWidth),\n top: Math.floor(this.lastWindowY),\n bottom: Math.floor(this.lastWindowY + this.lastHeight),\n velocity: {\n x: Math.floor(this.lastWindowXVelocity) || 0,\n y: Math.floor(this.lastWindowYVelocity) || 0\n }\n },\n orientation: {\n changed: this.orientationChange,\n // These values are relative to the first calibrated value\n alpha: Math.floor(this.lastAlpha - this.initialAlpha) || 0,\n beta: Math.floor(this.lastBeta - this.initialBeta) || 0,\n gamma: Math.floor(this.lastGamma - this.initialGamma) || 0\n },\n devicePixelRatio: {\n changed: this.devicePixelRatioChange,\n ratio: this.currDevicePixelRatio\n }\n };\n }\n\n /**\n * Update function to be looped by requestAnimationFrame\n */\n update() {\n const {\n currWidth,\n currHeight,\n currMouseX,\n currMouseY,\n currAlpha,\n currBeta,\n currGamma,\n currDevicePixelRatio\n } = this;\n if (this.updating) return false;\n\n // reset the flags\n this.scrollChange = this.sizeChange = this.mouseChange = this.positionChange = this.orientationChange = this.devicePixelRatioChange = false;\n\n // we need to grab a buffer of the last five values and average them\n if (this.windowXVelocity.length > 5) { this.windowXVelocity.shift(); }\n this.windowXVelocity.push(window.screenX - this.lastWindowX);\n\n // see if the average velocity changed\n if (getMean(this.windowXVelocity) != this.lastWindowXVelocity) {\n this.lastWindowXVelocity = getMean(this.windowXVelocity);\n this.positionChange = true;\n }\n\n // check window X position\n if (window.screenX != this.lastWindowX) {\n this.positionChange = true;\n this.lastWindowX = window.screenX;\n }\n\n // we need to grab a buffer of the last five values and average them\n if (this.windowYVelocity.length > 5) { this.windowYVelocity.shift(); }\n this.windowYVelocity.push(window.screenY - this.lastWindowY);\n\n // see if the average velocity changed\n if (getMean(this.windowYVelocity) != this.lastWindowYVelocity) {\n this.lastWindowYVelocity = getMean(this.windowYVelocity);\n this.positionChange = true;\n }\n\n // check window Y position\n if (window.screenY != this.lastWindowY) {\n this.positionChange = true;\n this.lastWindowY = window.screenY;\n }\n \n\n // reset scroll X velocity\n if (window.pageXOffset == this.lastX && this.scrollXVelocity != 0) {\n this.scrollXVelocity = 0;\n this.scrollChange = true;\n }\n\n // reset scroll Y velocity\n if (window.pageYOffset == this.lastY && this.scrollYVelocity != 0) {\n this.scrollYVelocity = 0;\n this.scrollChange = true;\n }\n \n // check scroll X\n if (window.pageXOffset != this.lastX) {\n this.scrollChange = true;\n this.scrollXVelocity = Math.floor(window.pageXOffset - this.lastX);\n this.lastX = window.pageXOffset;\n }\n \n // check scroll Y\n if (window.pageYOffset != this.lastY) {\n this.scrollChange = true;\n this.scrollYVelocity = Math.floor(window.pageYOffset - this.lastY);\n this.lastY = window.pageYOffset;\n }\n\n // check width\n if (currWidth != this.lastWidth) {\n this.lastWidth = currWidth;\n this.scrollHeight = document.body.scrollHeight;\n this.sizeChange = true;\n }\n\n // check height\n if (currHeight != this.lastHeight) {\n this.lastHeight = currHeight;\n this.sizeChange = true;\n }\n\n // Mouse input is throttled so in order to capture the velocity\n // we need to grab a buffer of the last five values and average them\n if (this.mouseXVelocity.length > 5) { this.mouseXVelocity.shift(); }\n this.mouseXVelocity.push(currMouseX - this.lastMouseX);\n\n // see if the average velocity changed\n if (getMean(this.mouseXVelocity) != this.lastMouseXVelocity) {\n this.lastMouseXVelocity = getMean(this.mouseXVelocity);\n this.mouseChange = true;\n }\n \n // check mouse X\n if (currMouseX != this.lastMouseX) {\n this.lastMouseX = currMouseX;\n this.mouseChange = true;\n }\n\n // grab the mouse Y velocity\n if (this.mouseYVelocity.length > 5) { this.mouseYVelocity.shift(); }\n this.mouseYVelocity.push(currMouseY - this.lastMouseY);\n\n // see if the average velocity changed\n if (getMean(this.mouseYVelocity) != this.lastMouseYVelocity) {\n this.lastMouseYVelocity = getMean(this.mouseYVelocity);\n this.mouseChange = true;\n }\n \n // check mouse y\n if (currMouseY != this.lastMouseY || getMean(this.mouseYVelocity) != 0) {\n this.lastMouseY = currMouseY;\n this.mouseChange = true;\n }\n\n // orientation\n if (currAlpha != this.lastAlpha) {\n this.lastAlpha = currAlpha;\n this.orientationChange = true;\n }\n\n if (currBeta != this.lastBeta) {\n this.lastBeta = currBeta;\n this.orientationChange = true;\n }\n\n if (currGamma != this.lastGamma) {\n this.lastGamma = currGamma;\n this.orientationChange = true;\n }\n \n // device pixel ratio, but only if the window has moved\n if ( this.positionChange || this.sizeChange )\n {\n this.currDevicePixelRatio = Math.max( window.devicePixelRatio || 1, 1 );\n \n if ( this.currDevicePixelRatio !== this.lastDevicePixelRatio )\n {\n this.devicePixelRatioChange = true;\n this.lastDevicePixelRatio = this.currDevicePixelRatio;\n }\n }\n\n // Finally, we can invoke the callbacks, but if something has changed\n if (\n this.scrollChange ||\n this.sizeChange ||\n this.mouseChange ||\n this.positionChange ||\n this.orientationChange ||\n this.devicePixelRatioChange\n ) {\n // pass the formatted data into each watched function\n this.callbacks.forEach(cb => cb(this.formatData()));\n }\n\n // reset and loop this method\n this.updating = false;\n requestAnimationFrame(this.update);\n }\n\n /**\n * Subscribes a function to the 'watched functions' list.\n * Watched functions will be automatically called on update\n * @param {Function} callback The function to call on update\n * @param {Boolean} callOnWatch Call the function on subscribe? defaults to true\n */\n watch(callback, callOnWatch = true) {\n if (typeof callback !== 'function') {\n throw new Error('Value passed to Watch is not a function');\n }\n\n // Exit out if this is running server-side\n if (isSSR) return;\n\n if (callOnWatch) {\n // get a copy of the store\n const firstRunData = this.formatData();\n\n // Most watch functions will have guard clauses that check for change\n // To cicumvent this, we simulate that all values have changed on first run\n firstRunData.scroll.changed = true;\n firstRunData.mouse.changed = true;\n firstRunData.size.changed = true;\n firstRunData.position.changed = true;\n firstRunData.orientation.changed = true;\n firstRunData.devicePixelRatio.changed = true;\n \n // run the callback using the simulated data\n callback(firstRunData);\n }\n\n // push the callback to the queue to ensure it runs on future updates\n this.callbacks.push(callback);\n }\n\n /**\n * Unsubscribe a function from the 'watched functions' list\n * @param {Function} callback The function to be removed\n */\n unwatch(callback) {\n if (typeof callback !== 'function') {\n throw new Error('The value passed to unwatch is not a function');\n }\n\n // Exit out if this is running server-side\n if (isSSR) return;\n\n // remove the callback from the list\n this.callbacks = this.callbacks.filter(cb => cb !== callback);\n }\n\n}\n\n\n// Create a singleton instance of Tornis\nconst TORNIS = new Tornis();\n\nif (!isSSR) {\n // Expose a limited set of functions to a global, in order to allow access for basic script usage with