(function e(t, n, r) { function s(o, u) { if (!n[o]) { if (!t[o]) { var a = typeof require == "function" && require; if (!u && a) return a(o, !0); if (i) return i(o, !0); var f = new Error("Cannot find module '" + o + "'"); throw f.code = "MODULE_NOT_FOUND", f } var l = n[o] = {exports: {}}; t[o][0].call(l.exports, function (e) { var n = t[o][1][e]; return s(n ? n : e) }, l, l.exports, e, t, n, r) } return n[o].exports } var i = typeof require == "function" && require; for (var o = 0; o < r.length; o++) s(r[o]); return s })({ 1: [function (require, module, exports) { function CookieBar() { "use strict"; var bOptIn; var bOptOut; var container; var xhr; var eventListenersSet = false; function initialise() { findContainer(); createXhr(); loadPanel() } function addEventListeners() { bOptIn.addEventListener("click", onOptIn); bOptOut.addEventListener("click", onOptOut); eventListenersSet = true } function removeEventListeners() { if (eventListenersSet) { bOptIn.removeEventListener("click", onOptIn); bOptOut.removeEventListener("click", onOptOut); eventListenersSet = false } } function findContainer() { container = document.querySelector("#a3prompt") } function findButtons() { bOptIn = document.querySelector("#cookie-opt-in"); bOptOut = document.querySelector("#cookie-opt-out") } function createXhr() { xhr = new XMLHttpRequest } function loadPanel() { xhr.onreadystatechange = function () { if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) { container.innerHTML = xhr.responseText; findButtons(); addEventListeners(); window.setTimeout(showPanel, 2e3) } }; xhr.open("GET", "/ajax/cookies/prompt"); xhr.send() } function showPanel() { container.classList.remove("hide") } function hidePanel() { removeEventListeners(); container.classList.add("hide") } function onOptIn() { xhr.onreadystatechange = function () { }; xhr.open("GET", "/ajax/cookies/opt-in"); xhr.send(); hidePanel() } function onOptOut() { xhr.onreadystatechange = function () { }; xhr.open("GET", "/ajax/cookies/opt-out"); xhr.send(); hidePanel() } initialise() } module.exports = CookieBar }, {}], 2: [function (require, module, exports) { "use strict"; var CookieBar = require("./CookieBar"); document.addEventListener("DOMContentLoaded", function () { if (document.getElementById("a3prompt")) { CookieBar() } }) }, {"./CookieBar": 1}] }, {}, [2]);