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BAAiB,iCAEhDD,GAAuBA,EAAqBhB,KAAK,IACjDgB,EAAqBhB,KAAK,GACrBW,iBAAiB,SAAS,WACvBH,IACAV,IAAkBW,MAAMM,OAAS,QAK7CtH,SAASwH,iBAAiB,sCAAuCjB,KAAK,GACjEW,iBAAiB,SAAS,WACvBvB,IACAiB,OAGR5G,SAASkG,eAAe,uBACnBgB,iBAAiB,SAAS,WACvBvB,IACAiB,OAGR5G,SAASkG,eAAe,gCACnBgB,iBAAiB,SAAS,WACvBN,IACAR,IACIpG,SAASkG,eAAe,yBAA0BuB,aAAa,WAC/D9B,KAGA,EAAAC,EAAA,sCACA,0BAzFZ8B,O","sources":["webpack://gak.frontend/./ReskinScripts/cookie-consent.js","webpack://gak.frontend/./ReskinScripts/tracking-scripts.js","webpack://gak.frontend/webpack/bootstrap","webpack://gak.frontend/webpack/runtime/define property getters","webpack://gak.frontend/webpack/runtime/hasOwnProperty shorthand","webpack://gak.frontend/./ReskinScripts/cookie-banner.ts"],"sourcesContent":["var CookieConsentService = {\r\n CookieConsentKey: \"\",\r\n EnableImpliedCookieConsent: false,\r\n didConsentToAllCookies: function () {\r\n //Logic shared with MvcExtensions.DidConsentToCookie\r\n //Please keep in sync\r\n \r\n if (this.CookieConsentKey === \"\") {\r\n //console.log(\"Cookie consent key was not set\");\r\n return false;\r\n }\r\n\r\n var cookieSettings = this.getCookieSettings();\r\n\r\n var didConsent = cookieSettings.didConsentToAllManually ||\r\n (this.EnableImpliedCookieConsent && cookieSettings.didConsentImplicitly && !cookieSettings.didConsentToEssentialManually);\r\n return didConsent;\r\n },\r\n shouldShowCookieBanner: function () {\r\n var cookieSettings = this.getCookieSettings();\r\n\r\n return (this.EnableImpliedCookieConsent && cookieSettings.shouldShowImpliedCookieBanner) ||\r\n (!this.EnableImpliedCookieConsent && cookieSettings.shouldShowCookieBanner);\r\n },\r\n clearAllCookiesIfConsentNotGiven: function () {\r\n //Clearing all cookies but consent cookie and essential cookies\r\n var cookieSettings = this.getCookieSettings();\r\n\r\n if (!this.didConsentToAllCookies()) {\r\n var cookies = document.cookie.split(\";\");\r\n for (var cookie in cookies) {\r\n if (cookie !== this.CookieConsentKey && cookieSettings.essentialCookies.indexOf(cookie) == -1) {\r\n deleteCookie(cookie);\r\n }\r\n }\r\n }\r\n },\r\n getCookieSettings: function () {\r\n //Logic shared with MvcExtensions.DidConsentToCookie\r\n //Please keep in sync\r\n var result = {\r\n didConsentImplicitly: this.EnableImpliedCookieConsent,\r\n didConsentToAllManually: false,\r\n didConsentToEssentialManually: false,\r\n shouldShowCookieBanner: true,\r\n shouldShowImpliedCookieBanner: true,\r\n essentialCookies: [\"pdt\", \"GAK_ShoppinBasket\", \"GAK_CookieConsent\", \"GAK_SearchRef\",\r\n \"GAK_VoucherPromoPopup\", \"LocationId\", \"ChannelID\", \"__RequestVerificationToken\",\r\n \"GAK_FinanceOptions\", \"amazon-pay-connectedAuth\", \"apay-session-set\",\r\n \"GAK_FE_Email\", \".AspNet.ApplicationCookie\"]\r\n };\r\n\r\n ///Returning boolValue if it's a bool, fallbackBool otherwise\r\n function getSafeBool(boolValue, fallbackBool) {\r\n if (typeof (boolValue) === \"boolean\") {\r\n return boolValue;\r\n }\r\n\r\n return fallbackBool;\r\n }\r\n\r\n try {\r\n var consentCookie = unescape(getCookie(this.CookieConsentKey));\r\n var cookieObj = JSON.parse(consentCookie);\r\n\r\n if (cookieObj === true) {\r\n result.didConsentImplicitly = true;\r\n result.didConsentToAllManually = false;\r\n result.didConsentToEssentialManually = true;\r\n result.shouldShowCookieBanner = false;\r\n result.shouldShowImpliedCookieBanner = false;\r\n }\r\n else if (cookieObj != null && typeof (cookieObj) === \"object\") {\r\n result.didConsentImplicitly = getSafeBool(cookieObj.didConsentImplicitly, result.didConsentImplicitly);\r\n result.didConsentToAllManually = getSafeBool(cookieObj.didConsentToAllManually, result.didConsentToAllManually);\r\n result.didConsentToEssentialManually = getSafeBool(cookieObj.didConsentToEssentialManually, result.didConsentToEssentialManually);\r\n result.shouldShowCookieBanner = getSafeBool(cookieObj.shouldShowCookieBanner, result.shouldShowCookieBanner);\r\n result.shouldShowImpliedCookieBanner = getSafeBool(cookieObj.shouldShowImpliedCookieBanner, result.shouldShowImpliedCookieBanner);\r\n }\r\n\r\n } catch (e) {\r\n //In case of exception assume cookie doesn't exist\r\n //Nothing to do\r\n }\r\n\r\n return result;\r\n },\r\n onManuallyConsentToAllCookies: function () {\r\n var settings = CookieConsentService.getCookieSettings();\r\n settings.didConsentToAllManually = true;\r\n settings.didConsentImplicitly = true;\r\n settings.shouldShowCookieBanner = false;\r\n settings.shouldShowImpliedCookieBanner = false;\r\n\r\n CookieConsentService.saveCookieConsent(settings);\r\n },\r\n onManuallyConsentToEssentialCookies: function () {\r\n var settings = CookieConsentService.getCookieSettings();\r\n settings.didConsentToAllManually = false;\r\n settings.didConsentToEssentialManually = true;\r\n settings.didConsentImplicitly = true;\r\n settings.shouldShowCookieBanner = false;\r\n settings.shouldShowImpliedCookieBanner = false;\r\n\r\n CookieConsentService.saveCookieConsent(settings);\r\n },\r\n onHideImpliedConsentBanner: function () {\r\n var settings = CookieConsentService.getCookieSettings();\r\n settings.didConsentImplicitly = true;\r\n settings.shouldShowImpliedCookieBanner = false;\r\n\r\n CookieConsentService.saveCookieConsent(settings);\r\n },\r\n onRevokeConsent: function () {\r\n confirm(\"Checkout cannot work without cookies.</br>Are you sure you want to revoke your cookie consent?\",\r\n function (didConfirm) {\r\n if (didConfirm) {\r\n var settings = CookieConsentService.getCookieSettings();\r\n settings.didConsentToAllManually = false;\r\n settings.didConsentImplicitly = false;\r\n settings.shouldShowCookieBanner = true;\r\n settings.shouldShowImpliedCookieBanner = true;\r\n\r\n CookieConsentService.saveCookieConsent(settings);\r\n }\r\n },\r\n \"Cookie consent\",\r\n \"REVOKE CONSENT\",\r\n \"CANCEL\");\r\n },\r\n saveCookieConsent: function (consentSettings) {\r\n if (this.CookieConsentKey === \"\") {\r\n //console.log(\"Cookie consent key was not set\");\r\n return;\r\n }\r\n\r\n var settingsJson = JSON.stringify(consentSettings);\r\n\r\n //Checking if settings changed\r\n //If changed, cookie will be set and page reloaded\r\n var consentCookie = getCookie(this.CookieConsentKey);\r\n if (settingsJson !== consentCookie) {\r\n setCookie(this.CookieConsentKey, settingsJson, 730);\r\n }\r\n },\r\n showConsentModal: function () {\r\n var message = \"This feature is not available without cookie consent.\" +\r\n \"<a href='/en/cookie-policy' class='btn btn-link' style='padding-top:0;'>Learn more</a>\";\r\n var title = \"Consent to cookies\";\r\n\r\n confirm(message, function (didNotConsent) {\r\n //We're inversing button names and hence meaning so that Consent is shown as blue (ie: safe option)\r\n if (!didNotConsent) {\r\n CookieConsentService.onManuallyConsentToAllCookies();\r\n }\r\n },\r\n title,\r\n \"CLOSE\",\r\n \"ACCEPT & CLOSE\",\r\n //Hiding close button for express consent\r\n //Putting back close button will also need extra work since \r\n //close and 'Consent to cookies' will have same meaning\r\n false);\r\n }\r\n};\r\n\r\n//Cookie consent bindings\r\n\r\n//Preventing redirect\r\n\r\nfunction ConsentBinding(event) {\r\n //TODO: improve on design so that instead of refresh we redirect to basket/account login\r\n if (!CookieConsentService.didConsentToAllCookies()) {\r\n //Preventing redirect\r\n event.preventDefault();\r\n\r\n CookieConsentService.showConsentModal();\r\n }\r\n}\r\n\r\n//document.getElementById(\"basketLink\").addEventListener(ConsentBinding);\r\n//document.getElementById(\"accountLoginLink\").addEventListener(ConsentBinding);\r\n\r\n//End - cookie consent bindings\r\nconst deleteCookie = (name) => {\r\n document.cookie = name + \"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;\";\r\n};\r\n\r\nfunction getCookie(cookieName) {\r\n let cookie = {};\r\n document.cookie.split(';').forEach(function (el) {\r\n let [key, value] = el.split('=');\r\n cookie[key.trim()] = value;\r\n })\r\n return cookie[cookieName];\r\n}\r\n\r\nfunction setCookie(name, value, days) {\r\n var expires = \"\";\r\n if (days) {\r\n var date = new Date();\r\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\r\n expires = \"; expires=\" + date.toUTCString();\r\n }\r\n document.cookie = name + \"=\" + (value || \"\") + expires + \"; path=/\";\r\n}\r\n\r\n\r\n\r\nexport { CookieConsentService }\r\n\r\n","var GoogleScriptsService = {\r\n addTagManager: function (id) {\r\n addScriptOnHead(`(function (w, d, s, l, i) {\r\n w[l] = w[l] || []; w[l].push({\r\n 'gtm.start':\r\n new Date().getTime(), event: 'gtm.js'\r\n }); var f = d.getElementsByTagName(s)[0],\r\n j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =\r\n '//www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);\r\n })(window, document, 'script', 'dataLayer', '${id}');`);\r\n },\r\n addOptmise: function (analyticsId, optmiseId) {\r\n //addScriptOnHead(`(function (i, s, o, g, r, a, m) {\r\n // i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {\r\n // (i[r].q = i[r].q || []).push(arguments)\r\n // }, i[r].l = 1 * new Date(); a = s.createElement(o),\r\n // m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)\r\n //})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');\r\n\r\n //ga('create', '${analyticsId}', 'auto');\r\n //ga('require', '${optmiseId}');`);\r\n },\r\n addConversionPage: function (paymentAmount) {\r\n addScriptOnBody(`gtag('event', 'conversion', {\r\n 'send_to': 'AW-1071972399/zlivCL7EpLoBEK-AlP8D',\r\n 'value': ${paymentAmount},\r\n 'currency': 'GBP',\r\n 'transaction_id': ''\r\n });`);\r\n },\r\n //commented as it was causing page flickers\r\n addAntiFlicker: function (id) {\r\n //addScriptOnHead(`(function(a,s,y,n,c,h,i,d,e){s.className += ' ' + y; h.start=1*new Date;\r\n // h.end=i=function(){s.className = s.className.replace(RegExp(' ?' + y), '')};\r\n // (a[n]=a[n]||[]).hide=h;setTimeout(function(){i(); h.end=null},c);h.timeout=c;\r\n // })(window,document.documentElement,'async-hide','dataLayer',4000,{'${id}': true});`);\r\n },\r\n consentGranted: function () {\r\n gtag('consent', 'update', {\r\n 'ad_storage': 'granted',\r\n 'analytics_storage': 'granted',\r\n 'security_storage': 'granted'\r\n });\r\n\r\n addScriptOnHead(`window.dataLayer.push({\r\n 'event': 'cookieConsent',\r\n 'consentStatus': true\r\n })`);\r\n\r\n },\r\n consentRevoked: function () {\r\n gtag('consent', 'update', {\r\n 'ad_storage': 'denied',\r\n 'analytics_storage': 'denied',\r\n 'security_storage': 'granted'\r\n });\r\n\r\n addScriptOnHead(`window.dataLayer.push({\r\n 'event': 'cookieConsent',\r\n 'consentStatus': false\r\n })`);\r\n\r\n },\r\n pushEvent: function (event) {\r\n window.dataLayer = window.dataLayer || [];\r\n window.dataLayer.push(event);\r\n }\r\n}\r\n\r\nvar FacebookScriptsService = {\r\n addFacebookTracking: function (isSearch) {\r\n addScriptOnBodyTop(`!function (f, b, e, v, n, t, s) {\r\n if (f.fbq) return; n = f.fbq = function () {\r\n n.callMethod ?\r\n n.callMethod.apply(n, arguments) : n.queue.push(arguments)\r\n };\r\n if (!f._fbq) f._fbq = n; n.push = n; n.loaded = !0; n.version = '2.0';\r\n n.queue = []; t = b.createElement(e); t.async = !0;\r\n t.src = v; s = b.getElementsByTagName(e)[0];\r\n s.parentNode.insertBefore(t, s)\r\n }(window, document, 'script',\r\n 'https://connect.facebook.net/en_US/fbevents.js');\r\n fbq('init', '1755089831374739');\r\n fbq('track', 'PageView');`);\r\n },\r\n addFacebookEvent: function (event) {\r\n addScriptOnBody(`fbq('track', '${event}');`);\r\n },\r\n getFbq: function () {\r\n return fbq;\r\n }\r\n}\r\n\r\nvar BingScriptsService = {\r\n addBingTracking: function () {\r\n addScriptOnBody(`(function (w, d, t, r, u) { var f, n, i; w[u] = w[u] || [], f = function () { var o = { ti: \"5296147\" }; \r\n o.q = w[u], w[u] = new UET(o), w[u].push(\"pageLoad\") }, n = d.createElement(t), n.src = r, n.async = 1, n.onload = n.onreadystatechange = function () {\r\n var s = this.readyState; s && s !== \"loaded\" && s !== \"complete\" || (f(), n.onload = n.onreadystatechange = null) }, i = d.getElementsByTagName(t)[0], i.parentNode.insertBefore(n, i)\r\n })(window, document, \"script\", \"//bat.bing.com/bat.js\", \"uetq\");`)\r\n }\r\n}\r\n\r\nvar addScriptOnHead = function (script) {\r\n document.head.appendChild(createScriptElement(script));\r\n}\r\n\r\nvar addScriptOnBody = function (script) {\r\n document.body.appendChild(createScriptElement(script));\r\n}\r\n\r\n\r\nvar addScriptOnBodyTop = function (script) {\r\n document.body.insertBefore(createScriptElement(script), document.body.firstChild);\r\n}\r\n\r\nfunction createScriptElement(script) {\r\n var addDataLayer = document.createElement(\"script\");\r\n\r\n var dataLayerData = document.createTextNode(script);\r\n\r\n addDataLayer.appendChild(dataLayerData);\r\n return addDataLayer;\r\n}\r\n\r\nexport { GoogleScriptsService, FacebookScriptsService, BingScriptsService }","// 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","// 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))","import { CookieConsentService } from \"./cookie-consent.js\";\r\nimport { GoogleScriptsService, FacebookScriptsService, BingScriptsService } from \"./tracking-scripts.js\";\r\n\r\ndeclare var cookieBannerParams: any;\r\n\r\nwindow.addEventListener('load', function () {\r\n CookieConsentService.CookieConsentKey = cookieBannerParams.CookieConsentKey;\r\n CookieConsentService.EnableImpliedCookieConsent = cookieBannerParams.EnableImpliedCookieConsent;\r\n CookieConsentService.clearAllCookiesIfConsentNotGiven();\r\n\r\n CookieBanner_BindEvents();\r\n})\r\n\r\nfunction acceptAllCookies() {\r\n CookieConsentService.onManuallyConsentToAllCookies();\r\n GoogleScriptsService.consentGranted();\r\n //FacebookScriptsService.addFacebookTracking();\r\n //FacebookScriptsService.addFacebookEvent(\"search\");\r\n if (cookieBannerParams.RenderDDASalesEventSnippetPaymentAmountHasValue) {\r\n GoogleScriptsService.addConversionPage((cookieBannerParams.RenderDDASalesEventSnippetPaymentAmount.Value.ToString(\"f2\")));\r\n }\r\n\r\n document.getElementById(\"cookieConsentOptional\")!.setAttribute(\"checked\", \"true\");\r\n toggleHidden();\r\n}\r\n\r\nfunction getCookieBanner() {\r\n return document.getElementsByClassName('cookie-banner')!.item(0)! as HTMLElement;\r\n}\r\n\r\nfunction toggleHidden() {\r\n var cookieBanner = getCookieBanner();\r\n if (!cookieBanner.classList.contains(\"hidden\")) {\r\n cookieBanner.classList.toggle(\"hidden\");\r\n }\r\n};\r\n\r\nfunction hideCustomiseCookiesModal() {\r\n (window as any).ARIAmodal.closeModal();\r\n}\r\n\r\nfunction showCustomiseCookiesModal() {\r\n var modal = document.getElementById(\"customiseCookiesModal\")!;\r\n modal.style.display = \"block\";\r\n}\r\n\r\nfunction CookieBanner_BindEvents() {\r\n if (CookieConsentService.shouldShowCookieBanner()) {\r\n var cookieBanner = getCookieBanner();\r\n if (cookieBanner.classList.contains(\"hidden\")) {\r\n cookieBanner.classList.remove(\"hidden\");\r\n }\r\n } else {\r\n toggleHidden();\r\n }\r\n\r\n var customiseCookies = document.getElementById(\"customiseCookies\");\r\n if (customiseCookies) {\r\n customiseCookies.addEventListener(\"click\", function () {\r\n showCustomiseCookiesModal();\r\n if (cookieBannerParams.TargetIsMobile) {\r\n\r\n getCookieBanner().style.zIndex = \"-1\";\r\n }\r\n });\r\n }\r\n\r\n var manageCookieConsent = document.querySelectorAll('[data-id=manageCookieConsent]');\r\n\r\n if (manageCookieConsent && manageCookieConsent!.item(0)) {\r\n manageCookieConsent!.item(0)!\r\n .addEventListener(\"click\", function () {\r\n showCustomiseCookiesModal();\r\n getCookieBanner().style.zIndex = \"-1\";\r\n });\r\n }\r\n \r\n\r\n document.querySelectorAll('[id=buttonAcceptAllCookiesConsent]')!.item(0)!\r\n .addEventListener(\"click\", function () {\r\n acceptAllCookies();\r\n hideCustomiseCookiesModal();\r\n });\r\n\r\n document.getElementById(\"buttonCookieConsent\")!\r\n .addEventListener(\"click\", function () {\r\n acceptAllCookies();\r\n hideCustomiseCookiesModal();\r\n });\r\n\r\n document.getElementById(\"buttonSelectedCookiesConsent\")!\r\n .addEventListener(\"click\", function () {\r\n hideCustomiseCookiesModal();\r\n toggleHidden();\r\n if (document.getElementById(\"cookieConsentOptional\")!.getAttribute(\"checked\")) {\r\n acceptAllCookies();\r\n }\r\n else {\r\n CookieConsentService.onManuallyConsentToEssentialCookies();\r\n GoogleScriptsService.consentRevoked();\r\n }\r\n });\r\n}"],"names":["CookieConsentService","CookieConsentKey","EnableImpliedCookieConsent","didConsentToAllCookies","this","cookieSettings","getCookieSettings","didConsentToAllManually","didConsentImplicitly","didConsentToEssentialManually","shouldShowCookieBanner","shouldShowImpliedCookieBanner","clearAllCookiesIfConsentNotGiven","cookies","document","cookie","split","essentialCookies","indexOf","deleteCookie","result","getSafeBool","boolValue","fallbackBool","consentCookie","unescape","getCookie","cookieObj","JSON","parse","e","onManuallyConsentToAllCookies","settings","saveCookieConsent","onManuallyConsentToEssentialCookies","onHideImpliedConsentBanner","onRevokeConsent","confirm","didConfirm","consentSettings","settingsJson","stringify","name","value","expires","date","Date","setTime","getTime","toUTCString","showConsentModal","didNotConsent","cookieName","forEach","el","key","trim","GoogleScriptsService","addTagManager","id","addScriptOnHead","addOptmise","analyticsId","optmiseId","addConversionPage","paymentAmount","addScriptOnBody","addAntiFlicker","consentGranted","gtag","consentRevoked","pushEvent","event","window","dataLayer","push","script","head","appendChild","createScriptElement","body","addDataLayer","createElement","dataLayerData","createTextNode","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","d","definition","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","acceptAllCookies","C","cookieBannerParams","RenderDDASalesEventSnippetPaymentAmountHasValue","RenderDDASalesEventSnippetPaymentAmount","Value","ToString","getElementById","setAttribute","toggleHidden","getCookieBanner","getElementsByClassName","item","cookieBanner","classList","contains","toggle","hideCustomiseCookiesModal","ARIAmodal","closeModal","showCustomiseCookiesModal","style","display","addEventListener","remove","customiseCookies","TargetIsMobile","zIndex","manageCookieConsent","querySelectorAll","getAttribute","CookieBanner_BindEvents"],"sourceRoot":""}