{"version":3,"sources":["Shared/Static/js/cookieBanner.js"],"names":["define","require","$","cookieBannerName","cookieBannerDuration","createCookie","name","value","days","expires","date","Date","setTime","getTime","toUTCString","document","cookie","nameEQ","ca","split","i","length","c","charAt","substring","indexOf","readCookie","show","displayCookieBanner","on","hide","removeCookieBanner"],"mappings":"AAAAA,OAAO,SAAUC,SACb,IAAIC,EAAID,QAAQ,UAEZE,EAAmB,gBACnBC,EAAuB,IAqB3B,SAASC,EAAaC,EAAMC,EAAOC,GAC/B,IAAIC,EAAU,GACd,GAAID,EAAM,CACN,IAAIE,EAAO,IAAIC,KACfD,EAAKE,QAAQF,EAAKG,UAAoB,GAAPL,EAAY,GAAK,GAAK,KACrDC,EAAU,aAAeC,EAAKI,cAElCC,SAASC,OAASV,EAAO,IAAMC,EAAQE,EAAU,WA1BrDP,EAAE,WACsC,YA4BxC,SAAoBI,GAGhB,IAFA,IAAIW,EAASX,EAAO,IAChBY,EAAKH,SAASC,OAAOG,MAAM,KACtBC,EAAI,EAAGA,EAAIF,EAAGG,OAAQD,IAAK,CAEhC,IADA,IAAIE,EAAIJ,EAAGE,GACW,KAAfE,EAAEC,OAAO,IAAWD,EAAIA,EAAEE,UAAU,EAAGF,EAAED,QAChD,GAAyB,GAArBC,EAAEG,QAAQR,GAAc,OAAOK,EAAEE,UAAUP,EAAOI,OAAQC,EAAED,QAEpE,OAAO,KApCHK,CAAWvB,IASnB,WACID,EAAE,kBAAkByB,OAThBC,GAGJ1B,EAAE,mBAAmB2B,GAAG,QAAS,YASrC,WACIxB,EAAaF,EAAkB,WAAYC,GAC3CF,EAAE,kBAAkB4B,OAVhBC","file":"cookieBanner.js","sourcesContent":["define(function (require) {\r\n var $ = require(\"jquery\");\r\n\r\n var cookieBannerName = \"cookie-banner\";\r\n var cookieBannerDuration = 365;\r\n\r\n $(function () {\r\n if (readCookie(cookieBannerName) != \"accepted\") {\r\n displayCookieBanner();\r\n }\r\n\r\n $(\"#accept-cookies\").on(\"click\", function () {\r\n removeCookieBanner();\r\n });\r\n });\r\n\r\n function displayCookieBanner() {\r\n $(\"#cookie-banner\").show();\r\n }\r\n\r\n function removeCookieBanner() {\r\n createCookie(cookieBannerName, \"accepted\", cookieBannerDuration);\r\n $(\"#cookie-banner\").hide();\r\n }\r\n\r\n function createCookie(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 function readCookie(name) {\r\n var nameEQ = name + \"=\";\r\n var ca = document.cookie.split(';');\r\n for (var i = 0; i < ca.length; i++) {\r\n var c = ca[i];\r\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\r\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\r\n }\r\n return null;\r\n }\r\n\r\n function eraseCookie(name) {\r\n createCookie(name, \"\", -1);\r\n }\r\n});"]}