{"version":3,"sources":["webpack:///../node_modules/lodash/throttle.js","webpack:///./js/modules/init-system-navigation.js"],"names":["debounce","__webpack_require__","isObject","FUNC_ERROR_TEXT","module","exports","func","wait","options","leading","trailing","TypeError","maxWait","lastScroll","SystemNavigationDropdown","button","systemNav","_this","this","_classCallCheck","_defineProperty","classList","toggle","activeClass","openClass","scroll","$","window","scrollTop","remove","add","addEventListener","handleClick","throttle","handleScroll","document","ready","querySelector"],"mappings":"2FAAA,IAAAA,EAAeC,EAAQ,GACvBC,EAAeD,EAAQ,GAGvBE,EAAA,sBAgEAC,EAAAC,QAlBA,SAAAC,EAAAC,EAAAC,GACA,IAAAC,GAAA,EACAC,GAAA,EAEA,sBAAAJ,EACA,UAAAK,UAAAR,GAMA,OAJAD,EAAAM,KACAC,EAAA,YAAAD,MAAAC,UACAC,EAAA,aAAAF,MAAAE,YAEAV,EAAAM,EAAAC,EAAA,CACAE,UACAG,QAAAL,EACAG,uNC7DA,IAAIG,EAAa,EAEXC,EACJ,SAAAA,EAAYC,EAAQC,GAAW,IAAAC,EAAAC,kGAAAC,CAAAD,KAAAJ,GAAAM,EAAAF,KAAA,cAUjB,WACZD,EAAKF,OAAOM,UAAUC,OAAOL,EAAKM,aAClCN,EAAKD,UAAUK,UAAUC,OAAOL,EAAKO,aAZRJ,EAAAF,KAAA,eAehB,WACb,IAAMO,EAASC,IAAEC,QAAQC,YACrBF,IAAEC,QAAQC,YAAcf,GAAwC,IAA1Ba,IAAEC,QAAQC,aAClDX,EAAKD,UAAUK,UAAUQ,OAAOZ,EAAKM,aACrCN,EAAKD,UAAUK,UAAUQ,OAAOZ,EAAKO,WACrCP,EAAKF,OAAOM,UAAUQ,OAAOZ,EAAKM,cAElCN,EAAKD,UAAUK,UAAUS,IAAIb,EAAKM,aAEpCV,EAAaY,IAvBbP,KAAKK,YAAc,YACnBL,KAAKM,UAAY,UACjBN,KAAKH,OAASA,EACdG,KAAKF,UAAYA,EAEjBE,KAAKH,OAAOgB,iBAAiB,QAASb,KAAKc,aAC3CL,OAAOI,iBAAiB,SAAUE,IAASf,KAAKgB,aAAc,OAqBlER,IAAES,UAAUC,MAAM,WAChB,IAAMrB,EAASoB,SAASE,cAAc,kCAChCrB,EAAYmB,SAASE,cAAc,yBAE1B,OAAXtB,GAAiC,OAAdC,GAErB,IAAIF,EAAyBC,EAAQC","file":"systems-navigation-65773bce66834f6ae77f.js","sourcesContent":["var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n","import throttle from 'lodash/throttle';\r\nimport $ from 'jquery';\r\n\r\nlet lastScroll = 0;\r\n\r\nclass SystemNavigationDropdown {\r\n constructor(button, systemNav) {\r\n this.activeClass = 'is-active';\r\n this.openClass = 'is-open';\r\n this.button = button;\r\n this.systemNav = systemNav;\r\n\r\n this.button.addEventListener('click', this.handleClick);\r\n window.addEventListener('scroll', throttle(this.handleScroll, 200));\r\n }\r\n\r\n handleClick = () => {\r\n this.button.classList.toggle(this.activeClass);\r\n this.systemNav.classList.toggle(this.openClass);\r\n };\r\n\r\n handleScroll = () => {\r\n const scroll = $(window).scrollTop();\r\n if ($(window).scrollTop() > lastScroll || $(window).scrollTop() === 0) {\r\n this.systemNav.classList.remove(this.activeClass);\r\n this.systemNav.classList.remove(this.openClass);\r\n this.button.classList.remove(this.activeClass);\r\n } else {\r\n this.systemNav.classList.add(this.activeClass);\r\n }\r\n lastScroll = scroll;\r\n }\r\n}\r\n\r\n$(document).ready(() => {\r\n const button = document.querySelector('.js-system-navigation-dropdown');\r\n const systemNav = document.querySelector('.js-system-navigation');\r\n\r\n if (button !== null && systemNav !== null) {\r\n /* eslint-disable no-new */\r\n new SystemNavigationDropdown(button, systemNav);\r\n /* eslint-enable no-new */\r\n }\r\n});\r\n"],"sourceRoot":""}