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K,EAAAA,eAAAA,SAA0BgE,EAAAA,aAAAA,SAAwB/D,EAAAA,yBAAAA,QACnHrB,aAAasG,GACbA,EAAI7G,WAAWwO,GAAa,GAAQ,KACpCN,EAAcjC,EAAOI,KACfJ,EAAOK,OAAS2B,IAAehC,EAAOI,IAAO6B,EApClD,IAoC2EjC,EAAOI,KAlC/E,MAmCJ9L,aAAasG,GACbA,EAAI7G,WAAWwO,GAAa,GAAO,KACnCN,EAAcjC,EAAOI,KAGtB8B,GAAMzB,EAAKtH,IACV+I,EAAKzB,EAAKtH,EACVpE,SAAS2N,gBAAgBC,MAAMC,YAAY,aAAe,GAAE7N,SAAS2N,gBAAgBG,mBAEtFV,GAAM1B,EAAKnK,IACV6L,EAAK1B,EAAKnK,EACVvB,SAAS2N,gBAAgBC,MAAMC,YAAY,YAAc,GAAE7N,SAAS2N,gBAAgBI,kBAE5F,IAOO,IAAIlB,GAAe,KAC1BI,EAAaF,EAAMiB,YAAY,IAEhCC,QAAQlB,E","sources":["webpack://Bucklers Hard/./node_modules/debounce/index.js","webpack://Bucklers Hard/./src/js/keyboard-accessibility-check.js","webpack://Bucklers Hard/./src/js/main-navigation.js","webpack://Bucklers Hard/./node_modules/tornis/src/tornis.js","webpack://Bucklers Hard/./src/js/scrolling.js"],"sourcesContent":["/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate){\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n };\n\n var debounced = function(){\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n \n debounced.flush = function() {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n \n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n};\n\n// Adds compatibility for ES modules\ndebounce.debounce = debounce;\n\nmodule.exports = debounce;\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});","// *****************************\r\n// ***** Main Navigation *****\r\n// *****************************\r\n\r\nimport { debounce } from 'debounce';\r\nimport { breakPoint } from './config';\r\nimport { Collapse as bootstrapCollapse } from 'bootstrap';\r\nimport { keyboardControl } from './keyboard-accessibility-check';\r\n\r\nlet isMobile = true,\r\n m = null, // main nav system\r\n s = null, // header search system\r\n fm = []; // desktop feature menu system\r\n\r\nexport const mainNavigation = {\r\n active: false\r\n}\r\nexport const desktopFeatureNavigation = {\r\n active: false,\r\n index: 0\r\n}\r\n\r\nclass AccessibleList {\r\n constructor(el) {\r\n this.el = el;\r\n this.tabIndex = 0;\r\n this.items = [...this.el.querySelectorAll('a')];\r\n this.itemsCount = this.items.length;\r\n this.updateTabIndexes(0);\r\n // focus behaviour\r\n for(let x = 0, l = this.items.length; x < l; x++) {\r\n this.items[x].onfocus = () => {\r\n if(this.tabIndex != x) {\r\n this.tabIndex = x;\r\n this.updateTabIndexes();\r\n }\r\n };\r\n }\r\n }\r\n updateTabIndexes(setFocus = false) {\r\n for(let x = 0, l = this.items.length; x < l; x++) {\r\n this.items[x].setAttribute('tabIndex', x == this.tabIndex ? '0' : '-1');\r\n }\r\n if(setFocus) this.items[this.tabIndex].focus();\r\n }\r\n nav(mode) {\r\n if(mode) {\r\n this.tabIndex+=1;\r\n if(this.tabIndex >= this.itemsCount) this.tabIndex = 0;\r\n } else {\r\n this.tabIndex-=1;\r\n if(this.tabIndex < 0) this.tabIndex = this.itemsCount - 1;\r\n }\r\n this.updateTabIndexes(true);\r\n }\r\n}\r\n\r\nclass menu {\r\n constructor(wrapper, toggleButton) {\r\n this.wrapper = wrapper;\r\n this.toggleButton = toggleButton;\r\n this.expanded = false;\r\n this.mobileTabElements = [...this.wrapper.querySelectorAll('#full-menu--feature-links li:first-child a, .menu-section > a, .menu-section > button, #full-menu--mobile-search input, #full-menu--social-links li:first-child a, #full-menu--mobile-search button')];\r\n this.desktopTabElements = [...this.wrapper.querySelectorAll('#full-menu--feature-links li:first-child a, .menu-section:not(.d-lg-none) > a, .menu-section:not(.d-lg-none) .collapse ul li:first-child a, #full-menu--social-links li:first-child a')];\r\n this.tabElementIndex = -1;\r\n this.tabElementSubIndex = -1;\r\n this.sections = [];\r\n [...this.wrapper.querySelectorAll('.menu-section')].forEach((s) => {\r\n this.sections.push(new menuSection(s));\r\n });\r\n // accessible lists\r\n this.accessibleLists = [];\r\n [...this.wrapper.querySelectorAll('.menu-accessible-list')].forEach((l) => {\r\n this.accessibleLists.push(new AccessibleList(l));\r\n });\r\n }\r\n show() {\r\n // close headerSearch if necessary\r\n if(s && s.active) s.hide();\r\n // close desktopFeatureMenu if necessary\r\n if(desktopFeatureNavigation.active) {\r\n fm[desktopFeatureNavigation.index].hide();\r\n }\r\n // open menu\r\n this.expanded = true;\r\n mainNavigation.active = true;\r\n this.toggleButton.setAttribute('aria-expanded', true);\r\n this.wrapper.setAttribute('aria-hidden', false);\r\n window.requestAnimationFrame(() => {\r\n document.body.classList.add('menu-active');\r\n this.tabElementIndex = 0;\r\n this.wrapper.ontransitionend = (e) => {\r\n if(e.target == this.wrapper) this.showTransitionEnd();\r\n };\r\n });\r\n }\r\n showTransitionEnd() {\r\n // focus on first menu item if keyboard control\r\n if(keyboardControl.active) {\r\n if(isMobile) {\r\n this.mobileTabElements[0].focus();\r\n } else {\r\n this.desktopTabElements[0].focus();\r\n }\r\n }\r\n this.wrapper.ontransitionend = null;\r\n }\r\n hide(doFocus = false) {\r\n this.expanded = false;\r\n mainNavigation.active = false;\r\n this.tabElementIndex = -1;\r\n this.toggleButton.setAttribute('aria-expanded', false);\r\n document.body.classList.remove('menu-active');\r\n this.wrapper.ontransitionend = (e) => {\r\n if(e.target == this.wrapper) this.hideTransitionEnd(doFocus);\r\n };\r\n }\r\n hideTransitionEnd(doFocus = false) {\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n if(keyboardControl.active && doFocus) this.toggleButton.focus();\r\n this.wrapper.ontransitionend = null;\r\n }\r\n}\r\n\r\nclass menuSection {\r\n constructor(el) {\r\n this.wrapper = el;\r\n this.collapseToggle = el.querySelector('button[data-bs-toggle=\"collapse\"]');\r\n this.collapseContent = el.querySelector('.collapse');\r\n this.firstOption = el.querySelector('ul li a');\r\n // add listeners for expansion to add class to parent wrapper\r\n if(this.collapseContent != null) {\r\n this.collapseContent.addEventListener('show.bs.collapse', () => {\r\n this.wrapper.classList.add('expanded');\r\n });\r\n this.collapseContent.addEventListener('shown.bs.collapse', () => {\r\n if(keyboardControl.active && isMobile) this.firstOption.focus();\r\n });\r\n this.collapseContent.addEventListener('hidden.bs.collapse', () => {\r\n this.wrapper.classList.remove('expanded');\r\n });\r\n }\r\n }\r\n toMobile() {\r\n if(this.collapseContent != null) {\r\n let bsCollapse = bootstrapCollapse.getOrCreateInstance(this.collapseContent);\r\n bsCollapse.hide();\r\n this.collapseToggle.removeAttribute('disabled');\r\n }\r\n }\r\n toDesktop() {\r\n if(this.collapseContent != null) {\r\n let bsCollapse = bootstrapCollapse.getOrCreateInstance(this.collapseContent);\r\n bsCollapse.show();\r\n this.collapseToggle.setAttribute('disabled', 'disabled');\r\n }\r\n }\r\n}\r\n\r\nconst findMenu = document.querySelector('#full-menu');\r\nif(findMenu != null) {\r\n\r\n // create instance of menu\r\n\r\n m = new menu(findMenu, document.querySelector('.header--menu-toggle button'));\r\n\r\n // menu toggle functionality\r\n\r\n m.toggleButton.addEventListener('click', () => {\r\n if (!m.expanded) {\r\n // open menu\r\n m.show();\r\n } else {\r\n // close menu\r\n m.hide();\r\n }\r\n });\r\n\r\n // add keyboard accessibility\r\n\r\n const navTabElements = (mode) => {\r\n let tabElements = isMobile ? m.mobileTabElements : m.desktopTabElements,\r\n tabElementsLength = tabElements.length,\r\n lastIndex = tabElementsLength - 1;\r\n if(mode) {\r\n // move to next tab element\r\n m.tabElementIndex = m.tabElementIndex == lastIndex ? 0 : m.tabElementIndex + 1;\r\n } else {\r\n // move to previous tab element\r\n m.tabElementIndex = m.tabElementIndex == 0 ? lastIndex : m.tabElementIndex - 1;\r\n }\r\n if(keyboardControl.active) tabElements[m.tabElementIndex].focus();\r\n };\r\n\r\n // mobile menu\r\n for(let x = 0, l = m.mobileTabElements.length; x < l; x++) {\r\n m.mobileTabElements[x].addEventListener('keydown', (e) => {\r\n if(isMobile) {\r\n switch (e.key) {\r\n // ESCAPE jumps out a level\r\n case 'Escape':\r\n if(mainNavigation.active) m.hide(true);\r\n break;\r\n case 'Left':\r\n case 'ArrowLeft':\r\n e.preventDefault();\r\n navTabElements(false);\r\n break;\r\n case 'Tab':\r\n case 'Right':\r\n case 'ArrowRight':\r\n e.preventDefault();\r\n navTabElements(true);\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n // desktop menu\r\n for(let x = 0, l = m.desktopTabElements.length; x < l; x++) {\r\n m.desktopTabElements[x].addEventListener('keydown', (e) => {\r\n if(!isMobile) {\r\n switch (e.key) {\r\n // ESCAPE jumps out a level\r\n case 'Escape':\r\n if(!isMobile && mainNavigation.active) m.hide(true);\r\n break;\r\n case 'Left':\r\n case 'ArrowLeft':\r\n e.preventDefault();\r\n navTabElements(false);\r\n break;\r\n case 'Tab':\r\n case 'Right':\r\n case 'ArrowRight':\r\n e.preventDefault();\r\n navTabElements(true);\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n // accessible lists\r\n for(let x = 0, lx = m.accessibleLists.length; x < lx; x++) {\r\n for(let y = 0, ly = m.accessibleLists[x].items.length; y < ly; y++) {\r\n m.accessibleLists[x].items[y].addEventListener('keydown', (e) => {\r\n let isTabElement = y == 0; // look for tabbable element which already has some listeners\r\n switch (e.key) {\r\n // ESCAPE jumps out a level\r\n case 'Escape':\r\n e.preventDefault();\r\n if(isMobile) {\r\n m.mobileTabElements[m.tabElementIndex].focus();\r\n } else {\r\n if(!isTabElement && mainNavigation.active) m.hide(true); // only if not the tabbable element\r\n }\r\n break;\r\n case 'Up':\r\n case 'ArrowUp':\r\n e.preventDefault();\r\n m.accessibleLists[x].nav(false);\r\n break;\r\n case 'Down':\r\n case 'ArrowDown':\r\n e.preventDefault();\r\n m.accessibleLists[x].nav(true);\r\n break;\r\n case 'Left':\r\n case 'ArrowLeft':\r\n e.preventDefault();\r\n if(!isTabElement) navTabElements(false); // only if not the tabbable element\r\n break;\r\n case 'Tab':\r\n case 'Right':\r\n case 'ArrowRight':\r\n e.preventDefault();\r\n if(!isTabElement) navTabElements(true); // only if not the tabbable element\r\n break;\r\n }\r\n });\r\n }\r\n }\r\n\r\n\r\n // hide or show all menu '.collapse' elements if changing from mobile to desktop or vica versa\r\n\r\n var resize = () => {\r\n let prev = isMobile;\r\n isMobile = window.innerWidth < breakPoint.LG;\r\n if (isMobile && !prev) {\r\n // collapse all menu sections and enable toggles\r\n m.sections.forEach((s) => {s.toMobile()});\r\n if(m.expanded) m.hide(true);\r\n desktopFeatureNavigation.active = false;\r\n } else if (!isMobile && prev) {\r\n // expanded all menu sections and disable toggles\r\n m.sections.forEach((s) => {s.toDesktop()});\r\n if(m.expanded) m.hide(true);\r\n }\r\n };\r\n\r\n resize();\r\n window.addEventListener('resize', () => {\r\n debounce(resize(), 200);\r\n });\r\n\r\n}\r\n\r\n// ***************************\r\n// ***** Header Search *****\r\n// ***************************\r\n\r\nexport const headerSearch = {\r\n active: false\r\n}\r\n\r\nclass HeaderSearchSystem {\r\n\r\n constructor(showBtn, wrapper, closeBtn, searchField) {\r\n this.showBtn = showBtn;\r\n this.wrapper = wrapper;\r\n this.closeBtn = closeBtn;\r\n this.searchField = searchField;\r\n this.active = false;\r\n // remove 'hidden' attribute\r\n this.wrapper.removeAttribute('hidden');\r\n // triggers\r\n this.showBtn.onclick = () => {\r\n // close menu if necessary\r\n if(m && m.expanded) m.hide();\r\n // open search\r\n if(!this.active) {\r\n this.show();\r\n } else if(sideHeaderLayout) {\r\n this.hide();\r\n }\r\n };\r\n this.closeBtn.onclick = () => {\r\n if(this.active) this.hide();\r\n };\r\n // ESC key closes search\r\n this.wrapper.addEventListener('keydown', (e) => {\r\n switch (e.key) {\r\n // ESCAPE jumps out a level\r\n case 'Escape':\r\n if(this.active) {\r\n e.preventDefault();\r\n this.hide(true);\r\n }\r\n break;\r\n }\r\n });\r\n // loop the tabbing if search area is active\r\n this.closeBtn.addEventListener('keydown', (e) => {\r\n switch (e.key) {\r\n // TAB\r\n case 'Tab':\r\n if(this.active) {\r\n e.preventDefault();\r\n this.searchField.focus();\r\n }\r\n break;\r\n }\r\n });\r\n }\r\n\r\n show() {\r\n this.wrapper.ontransitionend = null;\r\n this.wrapper.setAttribute('aria-hidden', false);\r\n this.showBtn.setAttribute('aria-expanded', true);\r\n this.active = true;\r\n headerSearch.active = true;\r\n window.requestAnimationFrame(() => {\r\n this.wrapper.classList.add('search-form--active');\r\n this.searchField.focus();\r\n });\r\n }\r\n\r\n hide(doFocus = false) {\r\n this.showBtn.setAttribute('aria-expanded', false);\r\n this.active = false;\r\n headerSearch.active = false;\r\n this.wrapper.classList.remove('search-form--active');\r\n this.wrapper.ontransitionend = (e) => {\r\n if(e.target == this.wrapper) this.transitionEnd(doFocus);\r\n };\r\n }\r\n\r\n transitionEnd(doFocus = false) {\r\n this.wrapper.setAttribute('aria-hidden', true);\r\n this.wrapper.ontransitionend = null;\r\n if(doFocus) this.showBtn.focus();\r\n }\r\n}\r\n\r\nconst headerSearchOpenBtn = document.querySelector('#header--desktop-search--open-btn'),\r\n headerSearchWrapper = document.querySelector('#header--desktop-search--wrapper'),\r\n headerSearchCloseBtn = document.querySelector('#header--desktop-search--close-btn'),\r\n headerSearchField = headerSearchWrapper !== null ? headerSearchWrapper.querySelector('input[type=\"search\"]') : null;\r\n\r\nif(headerSearchOpenBtn != null && headerSearchWrapper != null && headerSearchCloseBtn != null && headerSearchField != null) {\r\n s = new HeaderSearchSystem(headerSearchOpenBtn, headerSearchWrapper, headerSearchCloseBtn, headerSearchField);\r\n}\r\n\r\n// **********************************\r\n// ***** Desktop feature menu *****\r\n// **********************************\r\n\r\nclass DesktopFeatureMenuDropdown {\r\n\r\n constructor(el, index) {\r\n this.el = el;\r\n this.index = index;\r\n this.active = false;\r\n this.toggle = el.querySelector('.header--feature-menu--dropdown--toggle');\r\n this.content = el.querySelector('.header--feature-menu--dropdown--content');\r\n this.focusItems = this.content.querySelectorAll('a, button');\r\n // toggle behaviour\r\n this.toggle.addEventListener('click', (e) => {\r\n if(this.active) {\r\n // close\r\n this.hide();\r\n } else {\r\n // open\r\n this.show();\r\n }\r\n });\r\n // keyboard control\r\n this.el.addEventListener('keydown', (e) => {\r\n if(this.active) {\r\n switch (e.key) {\r\n // ESCAPE jumps out a level\r\n case 'Escape':\r\n if(this.active) {\r\n e.preventDefault();\r\n this.hide(true);\r\n }\r\n break;\r\n case 'Left':\r\n case 'ArrowLeft':\r\n case 'Up':\r\n case 'ArrowUp':\r\n e.preventDefault();\r\n this.navFocusItems(false);\r\n break;\r\n case 'Tab':\r\n case 'Right':\r\n case 'ArrowRight':\r\n case 'Down':\r\n case 'ArrowDown':\r\n e.preventDefault();\r\n this.navFocusItems(true);\r\n break;\r\n }\r\n }\r\n });\r\n // watch for clicks elsewhere and close if necessary\r\n let $this = this;\r\n document.body.addEventListener('click', (e) => {\r\n $this.checkClickOutside(e.target);\r\n });\r\n // hide on header hide\r\n window.addEventListener('headerHide', () => {\r\n if($this.active) $this.hide();\r\n });\r\n\r\n }\r\n\r\n checkClickOutside(t) {\r\n if (this.active) {\r\n let inMenu = false;\r\n while (t != document.body) {\r\n if (t == this.el) {\r\n inMenu = true;\r\n break\r\n }\r\n t = t.parentNode;\r\n }\r\n if (!inMenu) {\r\n this.hide();\r\n }\r\n }\r\n }\r\n\r\n show() {\r\n if(mainNavigation.active) m.hide();\r\n this.toggle.setAttribute('aria-expanded',true);\r\n this.content.setAttribute('aria-hidden',false);\r\n this.active = true;\r\n desktopFeatureNavigation.active = true;\r\n desktopFeatureNavigation.index = this.index;\r\n window.requestAnimationFrame(() => {\r\n this.content.classList.add('show');\r\n this.content.ontransitionend = ((e) => {\r\n if(e.target == this.content) {\r\n this.content.ontransitionend = null;\r\n // set focus?\r\n this.focusIndex = 0;\r\n if(keyboardControl.active) {\r\n this.focusItems[0].focus();\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n hide(doFocus = false) {\r\n this.toggle.setAttribute('aria-expanded',false);\r\n this.active = false;\r\n desktopFeatureNavigation.active = false;\r\n this.content.classList.remove('show');\r\n this.content.ontransitionend = ((e) => {\r\n if(e.target == this.content) {\r\n this.content.setAttribute('aria-hidden',true);\r\n this.active = false;\r\n this.content.ontransitionend = null;\r\n if(doFocus) this.toggle.focus();\r\n }\r\n });\r\n }\r\n\r\n navFocusItems(mode) {\r\n if(mode) {\r\n this.focusIndex += 1;\r\n if(this.focusIndex >= this.focusItems.length) this.focusIndex = 0;\r\n } else {\r\n this.focusIndex -= 1;\r\n if(this.focusIndex < 0) this.focusIndex = this.focusItems.length - 1;\r\n }\r\n this.focusItems[this.focusIndex].focus();\r\n }\r\n\r\n}\r\n\r\nlet dd = document.querySelectorAll('.header--feature-menu .header--feature-menu--dropdown');\r\nif(dd != null) {\r\n [...dd].forEach((d, index) => {\r\n fm.push(new DesktopFeatureMenuDropdown(d, index));\r\n });\r\n};\r\n\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