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AEJ,GAeF,G","sources":["webpack://stdcheck-exposed-wp-theme/./themes/stdcheck-exposed/src/js/utils.js","webpack://stdcheck-exposed-wp-theme/./themes/stdcheck-exposed/src/js/psc.js"],"sourcesContent":["/**\n * Utils class for common methods.\n */\nexport function Utils() {\n /**\n * Selects a lab hours table from the page.\n *\n * @param {number} i The lab hours table to select from the page.\n * @param {string} tableSelector The table selector to get the html element\n */\n function getHoursTable(i, tableSelector) {\n return $(tableSelector).eq(i);\n }\n\n /**\n * Shows a lab hours table.\n *\n * @param {number} i The lab hours table to show on the page.\n * @param {string} tableSelector The table selector to get the html element\n */\n function showHoursTable(i, tableSelector) {\n getHoursTable(i, tableSelector).show();\n }\n\n /**\n * Hide a lab hours table.\n *\n * @param {number} i The lab hours table to hide on the page.\n * @param {string} tableSelector The table selector to get the html element\n */\n function hideHoursTable(i, tableSelector) {\n getHoursTable(i, tableSelector).hide();\n }\n\n /**\n * Add listener and action to the show/hours HTML element\n *\n * @param {string} elementClass Class selector to get the element\n * @param {string} tableSelector The table selector to get the html element\n */\n function showHoursListener(elementClass, tableSelector) {\n $(elementClass).each(function (i, elem) {\n $(elem.children[0]).on('click', function () {\n showHoursTable(i, tableSelector);\n $(elem.children[0]).hide();\n $(elem.children[1]).show();\n });\n $(elem.children[1]).on('click', function () {\n hideHoursTable(i, tableSelector);\n $(elem.children[1]).hide();\n $(elem.children[0]).show();\n });\n });\n }\n\n /**\n * Format date into AM - PM hours\n *\n * @param date\n * @returns {string}\n */\n function formatAMPM(date) {\n let hours = date.getHours();\n let minutes = date.getMinutes();\n const ampm = hours >= 12 ? 'PM' : 'AM';\n hours = hours % 12;\n hours = hours ? hours : 12; // the hour '0' should be '12'\n minutes = minutes < 10 ? '0' + minutes : minutes;\n\n return hours + ':' + minutes + ' ' + ampm;\n }\n\n return {\n showHoursListener,\n formatAMPM,\n };\n}\n","import { Utils } from './utils';\n\n$(function () {\n const labSearchInput = $('#findNearLab-zipCode');\n const utils = new Utils();\n\n utils.showHoursListener('.hours-show-hide', 'table.labHours');\n\n $('#findNearLabSubmit').on('click', submitLabSearch);\n\n labSearchInput.on('keypress', function (event) {\n if (event.key === 'Enter') {\n submitLabSearch();\n }\n });\n\n /**\n * Sets the preferred zip code into local storage then navigates to the findalab page.\n */\n function submitLabSearch() {\n const zipCode = labSearchInput.val();\n if (zipCode.length !== 5) {\n $('#findNearLabSubmitError').show();\n\n return;\n }\n window.localStorage.setItem('ngStorage-zip_code', JSON.stringify(zipCode));\n window.location.href = '/std-test-center.php';\n }\n});\n"],"names":["Utils","getHoursTable","i","tableSelector","$","eq","showHoursListener","elementClass","each","elem","children","on","show","showHoursTable","hide","hideHoursTable","formatAMPM","date","hours","getHours","minutes","getMinutes","ampm","labSearchInput","submitLabSearch","zipCode","val","length","window","localStorage","setItem","JSON","stringify","location","href","event","key"],"sourceRoot":""}