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;;ACN4B;AACC;AACA;AACD;;AAG5B;AAC6C;AAC7C;AACqC;;AAErC;AACA,MAAM8C,UAAU,GAAG,IAAI1D,2DAAU,CAAC,CAAC;AACnC;AACA,MAAM2D,MAAM,GAAG,IAAI/C,uDAAM,CAAC,CAAC,C","sources":["webpack://HCL-Block-theme/./src/modules/MobileMenu.js","webpack://HCL-Block-theme/./src/modules/Search.js","webpack://HCL-Block-theme/./css/styleRH.scss?8743","webpack://HCL-Block-theme/./css/styleSJW.scss?dfd2","webpack://HCL-Block-theme/./css/styleSW.scss?d8c1","webpack://HCL-Block-theme/./css/styleWEM.scss?07b7","webpack://HCL-Block-theme/external window \"jQuery\"","webpack://HCL-Block-theme/webpack/bootstrap","webpack://HCL-Block-theme/webpack/runtime/compat get default export","webpack://HCL-Block-theme/webpack/runtime/define property getters","webpack://HCL-Block-theme/webpack/runtime/hasOwnProperty shorthand","webpack://HCL-Block-theme/webpack/runtime/make namespace object","webpack://HCL-Block-theme/./src/index.js"],"sourcesContent":["class MobileMenu {\n constructor() {\n this.menu = document.querySelector(\".site-header__menu\")\n this.openButton = document.querySelector(\".site-header__menu-trigger\")\n this.events()\n }\n\n events() {\n this.openButton.addEventListener(\"click\", () => this.openMenu())\n }\n\n openMenu() {\n this.openButton.classList.toggle(\"fa-bars\")\n this.openButton.classList.toggle(\"fa-window-close\")\n this.menu.classList.toggle(\"site-header__menu--active\")\n }\n}\n\nexport default MobileMenu\n","import $ from \"jquery\"\r\n\r\nclass Search {\r\n // 1. describe and create/initiate our object\r\n constructor() {\r\n this.addSearchHTML()\r\n this.resultsDiv = $(\"#search-overlay__results\")\r\n this.openButton = $(\".js-search-trigger\")\r\n this.closeButton = $(\".search-overlay__close\")\r\n this.searchOverlay = $(\".search-overlay\")\r\n this.searchField = $(\"#search-term\")\r\n this.events()\r\n this.isOverlayOpen = false\r\n this.isSpinnerVisible = false\r\n this.previousValue\r\n this.typingTimer\r\n }\r\n\r\n // 2. events\r\n events() {\r\n this.openButton.on(\"click\", this.openOverlay.bind(this))\r\n this.closeButton.on(\"click\", this.closeOverlay.bind(this))\r\n $(document).on(\"keydown\", this.keyPressDispatcher.bind(this))\r\n this.searchField.on(\"keyup\", this.typingLogic.bind(this))\r\n }\r\n\r\n // 3. methods (function, action...)\r\n typingLogic() {\r\n if (this.searchField.val() != this.previousValue) {\r\n clearTimeout(this.typingTimer)\r\n\r\n if (this.searchField.val()) {\r\n if (!this.isSpinnerVisible) {\r\n this.resultsDiv.html('<div class=\"spinner-loader\"></div>')\r\n this.isSpinnerVisible = true\r\n }\r\n this.typingTimer = setTimeout(this.getResults.bind(this), 750)\r\n } else {\r\n this.resultsDiv.html(\"\")\r\n this.isSpinnerVisible = false\r\n }\r\n }\r\n\r\n this.previousValue = this.searchField.val()\r\n }\r\n\r\n getResults() {\r\n $.when($.getJSON(hclData.root_url + \"/wp-json/wp/v2/posts?search=\" + this.searchField.val()), $.getJSON(hclData.root_url + \"/wp-json/wp/v2/pages?search=\" + this.searchField.val())).then(\r\n (posts, pages) => {\r\n var combinedResults = posts[0].concat(pages[0])\r\n this.resultsDiv.html(`\r\n <h2 class=\"search-overlay__section-title\">General Information</h2>\r\n ${combinedResults.length ? '<ul class=\"link-list min-list\">' : \"<p>No general information matches that search.</p>\"}\r\n ${combinedResults.map(item => `<li><a href=\"${item.link}\">${item.title.rendered}</a></li>`).join(\"\")}\r\n ${combinedResults.length ? \"</ul>\" : \"\"}\r\n `)\r\n this.isSpinnerVisible = false\r\n },\r\n () => {\r\n this.resultsDiv.html(\"<p>Unexpected error; please try again.</p>\")\r\n }\r\n )\r\n }\r\n\r\n keyPressDispatcher(e) {\r\n if (e.keyCode == 83 && !this.isOverlayOpen && !$(\"input, textarea\").is(\":focus\")) {\r\n this.openOverlay()\r\n }\r\n\r\n if (e.keyCode == 27 && this.isOverlayOpen) {\r\n this.closeOverlay()\r\n }\r\n }\r\n\r\n openOverlay() {\r\n this.searchOverlay.addClass(\"search-overlay--active\")\r\n $(\"body\").addClass(\"body-no-scroll\")\r\n this.searchField.val(\"\")\r\n setTimeout(() => this.searchField.focus(), 301)\r\n console.log(\"our open method just ran!\")\r\n this.isOverlayOpen = true\r\n }\r\n\r\n closeOverlay() {\r\n this.searchOverlay.removeClass(\"search-overlay--active\")\r\n $(\"body\").removeClass(\"body-no-scroll\")\r\n console.log(\"our close method just ran!\")\r\n this.isOverlayOpen = false\r\n }\r\n\r\n addSearchHTML() {\r\n $(\"body\").append(`\r\n <div class=\"search-overlay\">\r\n <div class=\"search-overlay__top\">\r\n <div class=\"container\">\r\n <i class=\"fa fa-search search-overlay__icon\" aria-hidden=\"true\"></i>\r\n <input type=\"text\" class=\"search-term\" placeholder=\"What are you looking for?\" id=\"search-term\">\r\n <i class=\"fa fa-window-close search-overlay__close\" aria-hidden=\"true\"></i>\r\n </div>\r\n </div>\r\n \r\n <div class=\"container\">\r\n <div id=\"search-overlay__results\"></div>\r\n </div>\r\n\r\n </div>\r\n `)\r\n }\r\n}\r\n\r\nexport default Search\r\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"jQuery\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import \"../css/styleRH.scss\"\nimport \"../css/styleWEM.scss\"\nimport \"../css/styleSJW.scss\"\nimport \"../css/styleSW.scss\"\n\n\n// Our modules / classes\nimport MobileMenu from \"./modules/MobileMenu\"\n// import HeroSlider from \"./modules/HeroSlider\"\nimport Search from \"./modules/Search\"\n\n// Instantiate a new object using our modules/classes\nconst mobileMenu = new MobileMenu()\n// const heroSlider = new HeroSlider()\nconst search = new Search()\n\n\n"],"names":["MobileMenu","constructor","menu","document","querySelector","openButton","events","addEventListener","openMenu","classList","toggle","$","Search","addSearchHTML","resultsDiv","closeButton","searchOverlay","searchField","isOverlayOpen","isSpinnerVisible","previousValue","typingTimer","on","openOverlay","bind","closeOverlay","keyPressDispatcher","typingLogic","val","clearTimeout","html","setTimeout","getResults","when","getJSON","hclData","root_url","then","posts","pages","combinedResults","concat","length","map","item","link","title","rendered","join","e","keyCode","is","addClass","focus","console","log","removeClass","append","mobileMenu","search"],"sourceRoot":""}