/*! * gdpr-cookie - A jQuery plugin to manage cookie settings in compliance with EU law * Copyright (c) 2018 Martijn Saly * Licensed under the MIT license: * http://www.opensource.org/licenses/mit-license.php * Version: 0.2.0 */ ;(function(root,factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);} else if(typeof module==="object"&&module.exports){module.exports=function(root,jQuery){if(jQuery===undefined){if(typeof window!=="undefined"){jQuery=require("jquery");} else{jQuery=require("jquery")(root);}} factory(jQuery);return jQuery;};} else{factory(root.jQuery);}}(this,function($){"use strict";var settings,showing=false,display,isAdvanced=false,seenAdvanced=false;var setCookie=function(name,value,expires){var d=new Date();d.setTime(d.getTime()+expires*24*60*60*1000);document.cookie=name+"="+value+";expires="+d.toUTCString()+";path=/";return getCookie(name);};var getCookie=function(name){var ca=decodeURIComponent(document.cookie).split(";");name+="=";for(var i=0;i=0;});return preferences;};$.gdprcookie={};$.gdprcookie.init=function(options){var defaultSettings={cookieTypes:[{type:"Essential",value:"essential",description:"These are cookies that are essential for the website to work correctly.",checked:true,},{type:"Website",value:"preferences",description:"These are cookies that are related to your site preferences, e.g. remembering your username, site colours, etc.",checked:true,},{type:"Analytics",value:"analytics",description:"Cookies related to site visits, browser types, etc.",checked:true,},{type:"Marketing",value:"marketing",description:"Cookies related to marketing, e.g. newsletters, social media, etc",checked:true,}],title:"",subtitle:"Select cookies to accept",message:"We use cookies to ensure that we give you the best experience on our website.
By continuing to use our site, you accept our cookie policy Terms",submessage:"Please uncheck the cookies you don't like.",delay:600,expires:1,cookieName:"cookieControlPrefs",acceptReload:false,acceptBeforeAdvanced:["essential"],acceptAfterAdvanced:["essential"],allowUnadvanced:false,switchAdvanced:false,acceptBtnLabel:"Accept cookies",advancedBtnLabel:"Customize cookies",unadvancedBtnLabel:"Back",customShowMessage:undefined,customHideMessage:undefined,customShowChecks:undefined,customHideChecks:undefined};settings=$.extend(defaultSettings,window.GdprCookieSettings,options);settings.message=String(settings.message);settings.delay=Math.max(0,+settings.delay)||0;settings.expires=Math.round(Math.min(Math.max(0,+settings.expires),730))||0;if(Array.isArray(settings.cookieTypes)){settings.cookieTypes=settings.cookieTypes.filter(function(cookieType){return $.isPlainObject(cookieType);});if(!settings.cookieTypes.length){settings.cookieTypes=defaultSettings.cookieTypes;}} else{settings.cookieTypes=defaultSettings.cookieTypes;} settings.cookieName=validateCookieName(String(settings.cookieName||""))||"cookieControlPrefs";var coerce=(function(){var values=settings.cookieTypes.map(function(cookieType){return cookieType.value;}),exists=function(item){return values.indexOf(item)>=0;};return function(setting){setting=typeof setting==="string"?[setting]:setting;return Array.isArray(setting)?setting.map(String).filter(exists):undefined;};}());settings.acceptBeforeAdvanced=coerce(settings.acceptBeforeAdvanced);settings.acceptAfterAdvanced=coerce(settings.acceptAfterAdvanced);$(function(){display();});};display=function(alwaysShow){if(showing){return;} var body=$("body"),myCookiePrefs=getPreferences();var elements={container:undefined,introContainer:undefined,types:undefined,typesContainer:undefined,buttons:{accept:undefined,advanced:undefined},allChecks:[],nonessentialChecks:[]};var hide=function(canreload){if(elements.container){if($.isFunction(settings.customHideMessage)){settings.customHideMessage.call(elements.container,elements.container);showing=false;} else{elements.container.fadeOut("fast",function(){$(this).remove();showing=false;});}} if(canreload&&settings.acceptReload){document.location.reload();}};if(!Array.isArray(myCookiePrefs)||!myCookiePrefs.length){myCookiePrefs=undefined;} if(alwaysShow||!myCookiePrefs){elements.types=$("