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O,E,C,GA5BA,EAAqB,SAAC,CAAtB,EAA2B,IAAA,EAAA,UAAA,MAAA,CAAA,GAAA,AAAA,KAAA,IAAA,SAAA,CAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAe,KAGhC,EAAQ,OAAO,cAAc,CAAC,OAAO,CAAC,GAG5C,GAAI,CAAC,GAAS,AAAU,SAAV,EACV,OAAO,KAIX,GAAI,CACA,OAAO,KAAK,KAAK,CAAC,EACtB,CAAE,MAAO,EAAG,CACR,QAAQ,GAAG,CAAC,EAChB,CAGA,OAAO,CAEX,EAQA,EAAqB,SAAC,CAAtB,EAA2B,IAAA,EAAA,UAAA,MAAA,CAAA,GAAA,AAAA,KAAA,IAAA,SAAA,CAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAQ,KAI3B,EADA,AAAU,KAAA,IAAV,EACQ,KAEA,KAAK,SAAS,CAAC,GAI3B,GAAI,CACA,OAAO,cAAc,CAAC,OAAO,CAAC,EAAK,EACvC,CAAE,MAAO,EAAG,CACR,QAAQ,GAAG,CAAC,EAChB,CAEJ,C,G,E,Q","sources":["","www.nrla.org.uk/src/js/training-programme-builder.js","www.nrla.org.uk/src/js/utils/renderTemplate.js","node_modules/@swc/helpers/esm/_sliced_to_array.js","node_modules/@swc/helpers/esm/_array_with_holes.js","node_modules/@swc/helpers/esm/_iterable_to_array_limit.js","node_modules/@swc/helpers/esm/_non_iterable_rest.js","node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js","node_modules/@swc/helpers/esm/_array_like_to_array.js","www.nrla.org.uk/src/js/utils/sessionStorage.js"],"sourcesContent":["(function () {\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequired124\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequired124\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"97vXv\", function(module, exports) {\n//------------------------------------------------------------------------------\n//\n\nvar $dVE5d = parcelRequire(\"dVE5d\");\n\nvar $kbC9w = parcelRequire(\"kbC9w\");\n//------------------------------------------------------------------------------\n//\nvar totalAllowedCourses = 4;\n//if the programme builder is not on the page then - all done\nvar programmeBuilder = document.querySelector(\".programme-builder\");\nif (programmeBuilder == null) return;\n//\nvar programmeBuilderCourses = programmeBuilder.querySelectorAll(\".programme-builder-course\");\nvar tooManyCoursesWarning = programmeBuilder.querySelector(\".too-many-courses-warning\");\n//------------------------------------------------------------------------------\n//\nvar renderProgrammeBuilderPricing = function() {\n //\n var selectedCourses = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = programmeBuilder.querySelectorAll(\".programme-builder-course[data-selected]\")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var course = _step.value;\n selectedCourses.push({\n \"courseID\": course.dataset.courseId,\n \"courseName\": course.dataset.courseName,\n \"normalPrice\": parseFloat(course.dataset.normalPrice),\n \"programmePrice\": parseFloat(course.dataset.programmePrice)\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n //store the user's latest selection into session storage (in-case they leave and come back)\n $kbC9w.set(\"programme-builder-selection\", selectedCourses.reduce(function(acc, item) {\n acc.push(item.courseID);\n return acc;\n }, []));\n //\n var selectedCoursesCount = selectedCourses.length;\n //\n var normalTotal = selectedCourses.reduce(function(acc, value) {\n return acc + value[\"normalPrice\"];\n }, 0);\n var programmeTotal = selectedCourses.reduce(function(acc, value) {\n return acc + value[\"programmePrice\"];\n }, 0);\n var totalSaved = normalTotal - programmeTotal;\n //pad the selected courses so we can see how many \"slots\" we are allowed\n for(var i = selectedCourses.length; i < totalAllowedCourses; i++)selectedCourses.push({\n \"courseName\": null\n });\n //hide the warning about too many courses if it's visible\n tooManyCoursesWarning.removeAttribute(\"data-visible\");\n //\n var programmeBuilderSelectionPanel = document.querySelector(\".programme-builder-selection\");\n programmeBuilderSelectionPanel.innerHTML = $dVE5d(\"programme-builder-selection-panel\", {\n //\n \"totalAllowedCourses\": totalAllowedCourses,\n //\n \"selectedCoursesCount\": selectedCoursesCount,\n \"selectedCourses\": selectedCourses,\n //\n \"normalTotal\": normalTotal,\n \"programmeTotal\": programmeTotal,\n \"totalSaved\": totalSaved\n });\n};\n//------------------------------------------------------------------------------\n//if the user has some previously selected course try to reload it \nif ((programmeBuilderSelection = $kbC9w.get(\"programme-builder-selection\")) !== null) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = programmeBuilderSelection[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var previouslySelectedCourse = _step.value;\n if ((previouslySelectedCourseElement = programmeBuilder.querySelector('.programme-builder-course[data-course-id=\"'.concat(previouslySelectedCourse, '\"]'))) !== null) previouslySelectedCourseElement.setAttribute(\"data-selected\", \"data-selected\");\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\n//\nrenderProgrammeBuilderPricing();\nvar _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;\ntry {\n var _loop = function() {\n var course = _step1.value;\n if (toggleSelectionButton = course.querySelector('a[data-action=\"toggle-selection\"]')) toggleSelectionButton.addEventListener(\"click\", function(event) {\n //\n event.preventDefault();\n //if we are trying to select a new course, check to see if we have enough slots\n if (!course.hasAttribute(\"data-selected\") && programmeBuilder.querySelectorAll(\".programme-builder-course[data-selected]\").length >= totalAllowedCourses) {\n tooManyCoursesWarning.setAttribute(\"data-visible\", \"data-visible\");\n return;\n }\n //\n course.toggleAttribute(\"data-selected\");\n renderProgrammeBuilderPricing();\n });\n };\n //------------------------------------------------------------------------------\n //add an event to each course to manage the user's selection\n for(var _iterator1 = programmeBuilderCourses[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true)_loop();\n //------------------------------------------------------------------------------\n} catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n} finally{\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally{\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n}\n\n});\nparcelRegister(\"dVE5d\", function(module, exports) {\n/**\r\n * Simple micro template system, based off John Resig's original function and other user contributions\r\n *\r\n * @package Mercury\r\n * @copyright 2021 National Residential Landlords Association\r\n *\r\n * For the full copyright and license information, please view the LICENSE\r\n * file that was distributed with this source code.\r\n */ //==============================================================================\n//\n\nvar $haqKc = parcelRequire(\"haqKc\");\nmodule.exports = function(template, data) {\n var template_name = \"zeno-template-cache-\" + template;\n if (typeof window[template_name] == \"undefined\") window[template_name] = $a23fb0ec03d1c4b9$var$zeno_prepare_template(document.getElementById(template).innerHTML);\n return window[template_name](data || {});\n};\n//==============================================================================\n//store all the callbacks that we want to use as filters\nwindow.zeno_filter_callbacks = {}; //!!!\n//add a function to allow adding of new filters\nfunction $a23fb0ec03d1c4b9$var$zeno_template_add_filter(name, callback) {\n if (typeof callback === \"function\") zeno_filter_callbacks[name] = callback;\n}\n//==============================================================================\n//declare some basic filters\n$a23fb0ec03d1c4b9$var$zeno_template_add_filter(\"upper\", function(value) {\n return value !== null ? value.toUpperCase() : \"\";\n});\n$a23fb0ec03d1c4b9$var$zeno_template_add_filter(\"lower\", function(value) {\n return value !== null ? value.toLowerCase() : \"\";\n});\n$a23fb0ec03d1c4b9$var$zeno_template_add_filter(\"title\", function(value) {\n return value !== null ? value.toTitleCase() : \"\";\n});\n//twig like replace filter\n$a23fb0ec03d1c4b9$var$zeno_template_add_filter(\"replace\", function(haystack, replacements) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = Object.entries(replacements)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var _step_value = (0, $haqKc._)(_step.value, 2), needle = _step_value[0], value = _step_value[1];\n haystack = haystack.replace(needle, value);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return haystack;\n});\n$a23fb0ec03d1c4b9$var$zeno_template_add_filter(\"default\", function(value, ifnull) {\n return value == \"\" ? ifnull : value;\n});\n$a23fb0ec03d1c4b9$var$zeno_template_add_filter(\"number_format\", function(value, precision, zero_value) {\n if (value === null || isNaN(value) || value == 0) return typeof zero_value !== \"undefined\" ? zero_value : null;\n return parseInt(value, 10).toFixed(0).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + (parseInt(precision, 10) > 0 ? value.toFixed(precision).slice(-(precision + 1)) || \".\" + \"0\".repeat(precision) : \"\");\n});\n//==============================================================================\n/**\r\n * Simple micro template system, based off John Resig's original function and other user contributions\r\n * @param {string} template Required - The id of the template to render\r\n * @param {object} data Optional - The data to pass into the template renderer\r\n * @return {string}\r\n */ function $a23fb0ec03d1c4b9$var$zeno_prepare_template(template) {\n //remove any whitespace characters inside our [[ and ]] operators\n template = template.replace(/\\[\\[(\\s+)/g, \"[[\");\n template = template.replace(/(\\s+)\\]\\]/g, \"]]\");\n //allow the user to set variables for use later in the template\n template = template.replace(/\\[\\[set (.+)\\]\\]/g, \"[[var $1;]]\");\n //pre-parse some common commands into \"native\" template language\n template = template.replace(/\\[\\[if([^{]+?)\\]\\]/g, \"[[ if ($1) { ]]\"); // \"[^{]\" vs \".\" to prevent it from parsing the legacy if conditions\n template = template.replace(/\\[\\[else\\]\\]/g, \"[[ } else { ]]\");\n template = template.replace(/\\[\\[endif\\]\\]/g, \"[[ } ]]\");\n //for loops\n template = template.replace(/\\[\\[for ([^\\(]+?) in (.+?)\\]\\]/g, \"[[ if (typeof $2 !== 'undefined') { for (var _$1 in $2 ) { if ($2.hasOwnProperty(_$1)) { var $1 = $2[_$1], loop = {'index':_$1}; ]]\");\n template = template.replace(/\\[\\[endfor\\]\\]/g, \"[[ }}} ]]\");\n //ternary if statements\n template = template.replace(/\\[\\[iif\\((.+?),(.+?),(.+?)\\)\\]\\]/g, \"[[p.push((($1) ? $2 : $3));]]\");\n template = template.replace(/\\[\\[iif\\((.+?),(.+?)\\)\\]\\]/g, \"[[p.push((($1) ? $2 : ''));]]\");\n //allow templates to be included from within other templates\n template = template.replace(/\\[\\[include(.+)with(.+)\\]\\]/g, \"[[p.push(zeno_template($1, $.extend({}, data, $2)));]]\");\n template = template.replace(/\\[\\[include(.+)\\]\\]/g, \"[[p.push(zeno_template($1, data));]]\");\n //condense any whitespace into a single space character\n template = template.replace(/[\\r\\t\\n]/g, \" \");\n //process any \"echo\" expressions\n template = template.replace(/\\[\\[=(.+?)\\]\\]/g, function(match, variable) {\n //process the string if it contains filters - currently only allowing 1 filter\n if ((filter = variable.match(/(.+?)\\|(.+?)\\((.+?)?\\)/)) !== null && typeof zeno_filter_callbacks[filter[2]] == \"function\") return \"',((typeof \" + filter[1] + \" !== 'undefined') ? zeno_filter_callbacks['\" + filter[2] + \"'](\" + filter[1] + (filter[3] != undefined ? \", \" + filter[3] : \"\") + \") : ''),'\";\n //just a standard expression\n return \"',((typeof \" + variable + \" !== 'undefined') ? \" + variable + \" : ''),'\";\n });\n //\n template = template.replace(/\\[\\[/g, \"');\");\n template = template.replace(/\\]\\]/g, \"p.push('\");\n try {\n var template_callback = new Function(\"data\", \"var p = [], print = function() { p.push.apply(p, arguments); }; with(data) { p.push('\" + template + \"'); } return p.join('');\");\n return template_callback;\n } catch (exception) {\n console.error(exception);\n console.error(template);\n }\n return \"\";\n} //==============================================================================\n\n});\nparcelRegister(\"haqKc\", function(module, exports) {\n\n$parcel$export(module.exports, \"_\", function () { return $c7f81dae783d026c$export$fdf2a89c76341bbf; });\n\nvar $kAoWz = parcelRequire(\"kAoWz\");\n\nvar $51zgv = parcelRequire(\"51zgv\");\n\nvar $8w5yq = parcelRequire(\"8w5yq\");\n\nvar $8YVFh = parcelRequire(\"8YVFh\");\nfunction $c7f81dae783d026c$export$fdf2a89c76341bbf(arr, i) {\n return (0, $kAoWz._array_with_holes)(arr) || (0, $51zgv._iterable_to_array_limit)(arr, i) || (0, $8YVFh._unsupported_iterable_to_array)(arr, i) || (0, $8w5yq._non_iterable_rest)();\n}\n\n});\nparcelRegister(\"kAoWz\", function(module, exports) {\n\n$parcel$export(module.exports, \"_array_with_holes\", function () { return $efca84b713134a66$export$e6256bf45c68d561; });\nfunction $efca84b713134a66$export$e6256bf45c68d561(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\n});\n\nparcelRegister(\"51zgv\", function(module, exports) {\n\n$parcel$export(module.exports, \"_iterable_to_array_limit\", function () { return $3a8866aa092b1ebb$export$2fd15edff6687200; });\nfunction $3a8866aa092b1ebb$export$2fd15edff6687200(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n try {\n for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally{\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally{\n if (_d) throw _e;\n }\n }\n return _arr;\n}\n\n});\n\nparcelRegister(\"8w5yq\", function(module, exports) {\n\n$parcel$export(module.exports, \"_non_iterable_rest\", function () { return $63359ed8917f3ec8$export$60dbc22abd7da546; });\nfunction $63359ed8917f3ec8$export$60dbc22abd7da546() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\n});\n\nparcelRegister(\"8YVFh\", function(module, exports) {\n\n$parcel$export(module.exports, \"_unsupported_iterable_to_array\", function () { return $68a0a85bb5bfa568$export$a5be06335b3a083c; });\n\nvar $822BU = parcelRequire(\"822BU\");\nfunction $68a0a85bb5bfa568$export$a5be06335b3a083c(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return (0, $822BU._array_like_to_array)(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return (0, $822BU._array_like_to_array)(o, minLen);\n}\n\n});\nparcelRegister(\"822BU\", function(module, exports) {\n\n$parcel$export(module.exports, \"_array_like_to_array\", function () { return $5d9088fdefde415d$export$79e617b1955a2616; });\nfunction $5d9088fdefde415d$export$79e617b1955a2616(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];\n return arr2;\n}\n\n});\n\n\n\n\nparcelRegister(\"kbC9w\", function(module, exports) {\n\n$parcel$export(module.exports, \"get\", function () { return $eb226e0a688f5e68$export$3988ae62b71be9a3; }, function (v) { return $eb226e0a688f5e68$export$3988ae62b71be9a3 = v; });\n$parcel$export(module.exports, \"set\", function () { return $eb226e0a688f5e68$export$adaa4cf7ef1b65be; }, function (v) { return $eb226e0a688f5e68$export$adaa4cf7ef1b65be = v; });\n/**\r\n * Get a value from the current page's session storage\r\n * @param {[type]} key [description]\r\n * @param {[type]} defaultValue [description]\r\n * @return {[type]} [description]\r\n */ var $eb226e0a688f5e68$export$3988ae62b71be9a3;\n/**\r\n * Set a value from the current page's session storage\r\n * @param {[type]} key [description]\r\n * @param {[type]} value [description]\r\n * @return {[type]} [description]\r\n */ var $eb226e0a688f5e68$export$adaa4cf7ef1b65be;\n/**\r\n * Remove a value from the current page's session storage\r\n * @param {[type]} key [description]\r\n * @return {[type]} [description]\r\n */ var $eb226e0a688f5e68$export$cd7f480d6b8286c3;\n$eb226e0a688f5e68$export$3988ae62b71be9a3 = function(key) {\n var defaultValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;\n //\n var value = window.sessionStorage.getItem(key);\n //\n if (!value || value === \"null\") return null;\n //\n try {\n return JSON.parse(value);\n } catch (e) {\n console.log(e);\n }\n //\n return defaultValue;\n};\n$eb226e0a688f5e68$export$adaa4cf7ef1b65be = function(key) {\n var value = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;\n //\n if (value === undefined) value = null;\n else value = JSON.stringify(value);\n //\n try {\n window.sessionStorage.setItem(key, value);\n } catch (e) {\n console.log(e);\n }\n};\n$eb226e0a688f5e68$export$cd7f480d6b8286c3 = function(key) {\n window.localStorage.removeItem(key);\n};\n\n});\n\n\n\nparcelRequire(\"97vXv\");\n})();\n//# sourceMappingURL=training-programme-builder.min.js.map\n","\r\n//------------------------------------------------------------------------------\r\n\r\n//\r\nconst renderTemplate = require('./utils/renderTemplate.js');\r\nconst sessionStorage = require('./utils/sessionStorage.js');\r\n\r\n//------------------------------------------------------------------------------\r\n\r\n//\r\nconst totalAllowedCourses = 4;\r\n\r\n//if the programme builder is not on the page then - all done\r\nconst programmeBuilder = document.querySelector('.programme-builder');\r\nif (programmeBuilder == null) {\r\n return;\r\n}\r\n\r\n//\r\nconst programmeBuilderCourses = programmeBuilder.querySelectorAll('.programme-builder-course');\r\nconst tooManyCoursesWarning = programmeBuilder.querySelector('.too-many-courses-warning')\r\n\r\n//------------------------------------------------------------------------------\r\n\r\n//\r\nconst renderProgrammeBuilderPricing = () => {\r\n\r\n //\r\n const selectedCourses = [];\r\n for (const course of programmeBuilder.querySelectorAll('.programme-builder-course[data-selected]')) { \r\n selectedCourses.push({'courseID' : course.dataset.courseId, 'courseName' : course.dataset.courseName, 'normalPrice' : parseFloat(course.dataset.normalPrice), 'programmePrice' : parseFloat(course.dataset.programmePrice)});\r\n }\r\n\r\n //store the user's latest selection into session storage (in-case they leave and come back)\r\n sessionStorage.set('programme-builder-selection', selectedCourses.reduce((acc, item) => {\r\n acc.push(item.courseID);\r\n return acc;\r\n }, []));\r\n\r\n //\r\n const selectedCoursesCount = selectedCourses.length;\r\n\r\n //\r\n const normalTotal = selectedCourses.reduce((acc, value) => { return acc + value['normalPrice']; }, 0);\r\n const programmeTotal = selectedCourses.reduce((acc, value) => { return acc + value['programmePrice']; }, 0);\r\n const totalSaved = (normalTotal - programmeTotal);\r\n\r\n //pad the selected courses so we can see how many \"slots\" we are allowed\r\n for (var i = selectedCourses.length; i < totalAllowedCourses; i++) {\r\n selectedCourses.push({'courseName' : null});\r\n }\r\n\r\n //hide the warning about too many courses if it's visible\r\n tooManyCoursesWarning.removeAttribute('data-visible');\r\n\r\n //\r\n const programmeBuilderSelectionPanel = document.querySelector('.programme-builder-selection');\r\n programmeBuilderSelectionPanel.innerHTML = renderTemplate('programme-builder-selection-panel', {\r\n\r\n //\r\n 'totalAllowedCourses' : totalAllowedCourses,\r\n \r\n //\r\n 'selectedCoursesCount' : selectedCoursesCount,\r\n 'selectedCourses' : selectedCourses,\r\n\r\n //\r\n 'normalTotal' : normalTotal,\r\n 'programmeTotal' : programmeTotal,\r\n 'totalSaved' : totalSaved,\r\n\r\n });\r\n\r\n}\r\n\r\n//------------------------------------------------------------------------------\r\n\r\n//if the user has some previously selected course try to reload it \r\nif ((programmeBuilderSelection = sessionStorage.get('programme-builder-selection')) !== null) {\r\n for (const previouslySelectedCourse of programmeBuilderSelection) {\r\n if ((previouslySelectedCourseElement = programmeBuilder.querySelector(`.programme-builder-course[data-course-id=\"${previouslySelectedCourse}\"]`)) !== null) {\r\n previouslySelectedCourseElement.setAttribute('data-selected', 'data-selected');\r\n }\r\n }\r\n}\r\n\r\n//\r\nrenderProgrammeBuilderPricing();\r\n\r\n//------------------------------------------------------------------------------\r\n\r\n//add an event to each course to manage the user's selection\r\nfor (const course of programmeBuilderCourses) {\r\n if ((toggleSelectionButton = course.querySelector('a[data-action=\"toggle-selection\"]'))) {\r\n toggleSelectionButton.addEventListener('click', (event) => {\r\n\r\n \t//\r\n \tevent.preventDefault();\r\n\r\n //if we are trying to select a new course, check to see if we have enough slots\r\n if (!course.hasAttribute('data-selected') && programmeBuilder.querySelectorAll('.programme-builder-course[data-selected]').length >= totalAllowedCourses) {\r\n tooManyCoursesWarning.setAttribute('data-visible', 'data-visible');\r\n return;\r\n }\r\n\r\n //\r\n course.toggleAttribute('data-selected');\r\n renderProgrammeBuilderPricing();\r\n\r\n });\r\n }\r\n}\r\n\r\n//------------------------------------------------------------------------------\r\n","/**\r\n * Simple micro template system, based off John Resig's original function and other user contributions\r\n *\r\n * @package Mercury\r\n * @copyright 2021 National Residential Landlords Association\r\n *\r\n * For the full copyright and license information, please view the LICENSE\r\n * file that was distributed with this source code.\r\n */\r\n\r\n//==============================================================================\r\n\r\n//\r\nmodule.exports = function(template, data) {\r\n var template_name = 'zeno-template-cache-' + template;\r\n if (typeof (window[template_name]) == 'undefined') {\r\n window[template_name] = zeno_prepare_template(document.getElementById(template).innerHTML);\r\n }\r\n return window[template_name](data || {});\r\n}\r\n\r\n//==============================================================================\r\n\r\n//store all the callbacks that we want to use as filters\r\nwindow.zeno_filter_callbacks = {}; //!!!\r\n\r\n//add a function to allow adding of new filters\r\nfunction zeno_template_add_filter(name, callback) {\r\n if (typeof callback === 'function') {\r\n zeno_filter_callbacks[name] = callback;\r\n }\r\n}\r\n\r\n//==============================================================================\r\n\r\n//declare some basic filters\r\nzeno_template_add_filter('upper', function(value) {\r\n return ((value !== null) ? value.toUpperCase() : '');\r\n});\r\n\r\nzeno_template_add_filter('lower', function(value) {\r\n return ((value !== null) ? value.toLowerCase() : '');\r\n});\r\n\r\nzeno_template_add_filter('title', function(value) {\r\n return ((value !== null) ? value.toTitleCase() : '');\r\n});\r\n\r\n//twig like replace filter\r\nzeno_template_add_filter('replace', function(haystack, replacements) {\r\n for (const [needle, value] of Object.entries(replacements)) {\r\n haystack = haystack.replace(needle, value);\r\n }\r\n return haystack;\r\n});\r\n\r\nzeno_template_add_filter('default', function(value, ifnull) {\r\n return ((value == '') ? ifnull : value);\r\n});\r\n\r\nzeno_template_add_filter('number_format', function(value, precision, zero_value) {\r\n if (value === null || isNaN(value) || value == 0) {\r\n return ((typeof zero_value !== 'undefined') ? zero_value : null);\r\n }\r\n return parseInt(value, 10).toFixed(0).replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',') + ((parseInt(precision, 10) > 0) ? ((value.toFixed(precision).slice(-(precision + 1))) || '.' + ('0'.repeat(precision))) : '')\r\n});\r\n\r\n//==============================================================================\r\n\r\n/**\r\n * Simple micro template system, based off John Resig's original function and other user contributions\r\n * @param {string} template Required - The id of the template to render\r\n * @param {object} data Optional - The data to pass into the template renderer\r\n * @return {string}\r\n */\r\nfunction zeno_prepare_template(template) {\r\n\r\n //remove any whitespace characters inside our [[ and ]] operators\r\n template = template.replace(/\\[\\[(\\s+)/g, \"[[\");\r\n template = template.replace(/(\\s+)\\]\\]/g, \"]]\");\r\n\r\n //allow the user to set variables for use later in the template\r\n template = template.replace(/\\[\\[set (.+)\\]\\]/g, \"[[var $1;]]\");\r\n\r\n //pre-parse some common commands into \"native\" template language\r\n template = template.replace(/\\[\\[if([^{]+?)\\]\\]/g, \"[[ if ($1) { ]]\"); // \"[^{]\" vs \".\" to prevent it from parsing the legacy if conditions\r\n template = template.replace(/\\[\\[else\\]\\]/g, \"[[ } else { ]]\");\r\n template = template.replace(/\\[\\[endif\\]\\]/g, \"[[ } ]]\");\r\n\r\n //for loops\r\n template = template.replace(/\\[\\[for ([^\\(]+?) in (.+?)\\]\\]/g, \"[[ if (typeof $2 !== 'undefined') { for (var _$1 in $2 ) { if ($2.hasOwnProperty(_$1)) { var $1 = $2[_$1], loop = {'index':_$1}; ]]\");\r\n template = template.replace(/\\[\\[endfor\\]\\]/g, \"[[ }}} ]]\");\r\n\r\n //ternary if statements\r\n template = template.replace(/\\[\\[iif\\((.+?),(.+?),(.+?)\\)\\]\\]/g, \"[[p.push((($1) ? $2 : $3));]]\");\r\n template = template.replace(/\\[\\[iif\\((.+?),(.+?)\\)\\]\\]/g, \"[[p.push((($1) ? $2 : ''));]]\");\r\n\r\n //allow templates to be included from within other templates\r\n template = template.replace(/\\[\\[include(.+)with(.+)\\]\\]/g, \"[[p.push(zeno_template($1, $.extend({}, data, $2)));]]\");\r\n template = template.replace(/\\[\\[include(.+)\\]\\]/g, \"[[p.push(zeno_template($1, data));]]\");\r\n\r\n //condense any whitespace into a single space character\r\n template = template.replace(/[\\r\\t\\n]/g, \" \");\r\n\r\n //process any \"echo\" expressions\r\n template = template.replace(/\\[\\[=(.+?)\\]\\]/g, function(match, variable) {\r\n\r\n //process the string if it contains filters - currently only allowing 1 filter\r\n if ((filter = variable.match(/(.+?)\\|(.+?)\\((.+?)?\\)/)) !== null && typeof zeno_filter_callbacks[filter[2]] == 'function') {\r\n return \"',((typeof \" + filter[1] + \" !== 'undefined') ? zeno_filter_callbacks['\" + filter[2] + \"'](\" + filter[1] + ((filter[3] != undefined) ? ', ' + filter[3] : '') + \") : ''),'\";\r\n }\r\n\r\n //just a standard expression\r\n return \"',((typeof \" + variable + \" !== 'undefined') ? \" + variable + \" : ''),'\";\r\n\r\n });\r\n\r\n //\r\n template = template.replace(/\\[\\[/g, \"');\");\r\n template = template.replace(/\\]\\]/g, \"p.push('\");\r\n\r\n try {\r\n var template_callback = new Function('data', \"var p = [], print = function() { p.push.apply(p, arguments); }; with(data) { p.push('\" + template + \"'); } return p.join('');\");\r\n return template_callback;\r\n }\r\n catch (exception) {\r\n console.error(exception);\r\n console.error(template);\r\n }\r\n\r\n return '';\r\n}\r\n\r\n//==============================================================================","import { _array_with_holes } from \"./_array_with_holes.js\";\nimport { _iterable_to_array_limit } from \"./_iterable_to_array_limit.js\";\nimport { _non_iterable_rest } from \"./_non_iterable_rest.js\";\nimport { _unsupported_iterable_to_array } from \"./_unsupported_iterable_to_array.js\";\n\nexport function _sliced_to_array(arr, i) {\n return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();\n}\nexport { _sliced_to_array as _ };\n","export function _array_with_holes(arr) {\n if (Array.isArray(arr)) return arr;\n}\nexport { _array_with_holes as _ };\n","export function _iterable_to_array_limit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\nexport { _iterable_to_array_limit as _ };\n","export function _non_iterable_rest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _non_iterable_rest as _ };\n","import { _array_like_to_array } from \"./_array_like_to_array.js\";\n\nexport function _unsupported_iterable_to_array(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _array_like_to_array(o, minLen);\n\n var n = Object.prototype.toString.call(o).slice(8, -1);\n\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);\n}\nexport { _unsupported_iterable_to_array as _ };\n","export function _array_like_to_array(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\nexport { _array_like_to_array as _ };\n","/**\r\n * Get a value from the current page's session storage\r\n * @param {[type]} key [description]\r\n * @param {[type]} defaultValue [description]\r\n * @return {[type]} [description]\r\n */\r\nmodule.exports.get = (key, defaultValue = null) => {\r\n\r\n //\r\n const value = window.sessionStorage.getItem(key);\r\n\r\n //\r\n if (!value || value === 'null') {\r\n return null;\r\n }\r\n\r\n //\r\n try {\r\n return JSON.parse(value);\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n\r\n //\r\n return defaultValue;\r\n\r\n};\r\n\r\n/**\r\n * Set a value from the current page's session storage\r\n * @param {[type]} key [description]\r\n * @param {[type]} value [description]\r\n * @return {[type]} [description]\r\n */\r\nmodule.exports.set = (key, value = null) => {\r\n\r\n //\r\n if (value === undefined) {\r\n value = null;\r\n } else {\r\n value = JSON.stringify(value);\r\n }\r\n\r\n //\r\n try {\r\n window.sessionStorage.setItem(key, value);\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n\r\n};\r\n\r\n/**\r\n * Remove a value from the current page's session storage\r\n * @param {[type]} key [description]\r\n * @return {[type]} [description]\r\n */\r\nmodule.exports.remove = (key) => {\r\n window.localStorage.removeItem(key);\r\n};\r\n"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$dVE5d","$kbC9w","programmeBuilder","document","querySelector","programmeBuilderCourses","querySelectorAll","tooManyCoursesWarning","renderProgrammeBuilderPricing","selectedCourses","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_step","_iterator","Symbol","iterator","next","done","course","value","push","dataset","courseId","courseName","parseFloat","normalPrice","programmePrice","return","reduce","acc","item","courseID","selectedCoursesCount","length","normalTotal","programmeTotal","i","removeAttribute","programmeBuilderSelectionPanel","innerHTML","programmeBuilderSelection","previouslySelectedCourse","previouslySelectedCourseElement","concat","setAttribute","_iteratorNormalCompletion1","_didIteratorError1","_iteratorError1","_step1","_iterator1","_loop","toggleSelectionButton","addEventListener","event","preventDefault","hasAttribute","toggleAttribute","$haqKc","$a23fb0ec03d1c4b9$var$zeno_template_add_filter","name","callback","zeno_filter_callbacks","template","data","template_name","$a23fb0ec03d1c4b9$var$zeno_prepare_template","replace","match","variable","filter","Function","exception","console","error","getElementById","toUpperCase","toLowerCase","toTitleCase","haystack","replacements","entries","_step_value","_","needle","ifnull","precision","zero_value","isNaN","parseInt","toFixed","slice","repeat","$c7f81dae783d026c$export$fdf2a89c76341bbf","$kAoWz","$51zgv","$8w5yq","$8YVFh","arr","_array_with_holes","_iterable_to_array_limit","_unsupported_iterable_to_array","_non_iterable_rest","$efca84b713134a66$export$e6256bf45c68d561","Array","isArray","$3a8866aa092b1ebb$export$2fd15edff6687200","_s","_e","_i","_arr","_n","_d","$63359ed8917f3ec8$export$60dbc22abd7da546","TypeError","$68a0a85bb5bfa568$export$a5be06335b3a083c","$822BU","o","minLen","_array_like_to_array","prototype","toString","constructor","from","test","$5d9088fdefde415d$export$79e617b1955a2616","len","arr2","$eb226e0a688f5e68$export$3988ae62b71be9a3","$eb226e0a688f5e68$export$adaa4cf7ef1b65be","key","defaultValue","arguments","sessionStorage","getItem","JSON","parse","log","stringify","setItem"],"version":3,"file":"training-programme-builder.min.js.map"}