!function(o){window.BorlabsCookie=function(){"use strict";var e="data-cookie-accordion",t="data-cookie-accordion-parent",n="data-cookie-accordion-status",i="data-cookie-accordion-target",a="#BorlabsCookieBox input[type='checkbox']",s="#BorlabsCookieBox",c="#BorlabsCookieBoxWrap",r="data-borlabs-cookie-group",l="#BorlabsCookieBox input[type='checkbox'][name='cookieGroup[]']",d="data-cookie-accept",h="data-cookie-accept-all",u="data-cookie-back",b="data-cookie-individual",k="data-cookie-refuse",p="data-borlabs-cookie-preference",f=".borlabs-cookie-preference",v="data-borlabs-cookie-switch",g="._brlbs-btn-switch-status",m="data-borlabs-cookie-unblock",C="data-borlabs-cookie-type",x="data-borlabs-cookie-id",y="data-borlabs-script-blocker-id",w="data-borlabs-script-blocker-js-handle",B="input[type='checkbox'][name='unblockAll']",L="data-borlabs-cookie-uid",_="data-borlabs-cookie-consent-history",O=".BorlabsCookie",I,j={},S={},T={},D={},P={scriptBlockerId:{},jsHandle:{}},A=!1,H={consents:{},expires:null,uid:null,version:null},N="borlabs-cookie",R=function(e,t,n){return"about:blank"!==window.location.href&&(I=o.extend({ajaxURL:"",language:"en",animation:"1",animationDelay:"",animationIn:"fadeIn",animationOut:"fadeOut",blockContent:"",boxLayout:"box",boxLayoutAdvanced:"0",automaticCookieDomainAndPath:"",cookieDomain:"",cookiePath:"",cookieLifetime:"365",crossDomainCookie:[],cookieBeforeConsent:"",cookiesForBots:"1",cookieVersion:"1",hideCookieBoxOnPages:[],respectDoNotTrack:"",reloadAfterConsent:"",showCookieBox:"1",cookieBoxIntegration:"javascript",ignorePreSelectStatus:"1",cookies:[]},e),j=t,S=n,Y(),_o(),null===H.uid&&(H.uid=co()),I.cookieBeforeConsent&&("function"==typeof Object?0===Object.entries(H.consents).length&&xo():console.log("Cookie before consent not supported in IE 11.")),U(),o(document).on("click","["+m+"]",bo),o(document).on("click","["+p+"]",z),o(document).on("click",f,z),o(document).on("change","["+v+"]",q),o("["+_+"]").length&&yo(),Bo(),o("["+L+"]").length&&o("["+L+"]").each(function(){o(this).html(H.uid)}),!0)},U=function(){o(c).length&&"SCRIPT"===o(c)[0].tagName&&o("body").append(o(c).html()),o(document).on("click","["+d+"]",function(){Q(),J()}),o(document).on("click","["+h+"]",function(){V()}),o(document).on("click","["+u+"]",function(){E()}),o(document).on("click","["+b+"]",function(){M()}),o(document).on("click","["+k+"]",function(){var e=[];o(l+":checked").each(function(){-1===e.indexOf(this.value)&&(o(this).trigger("click"),e.push(this.value))}),Q(),J()}),$(),W(),F(),!0===K()?(ro(),lo(),ho()):I.showCookieBox&&(0===I.hideCookieBoxOnPages.length||-1===I.hideCookieBoxOnPages.indexOf(window.location.protocol+"//"+window.location.hostname+window.location.pathname)?I.cookiesForBots&&/bot|googlebot|crawler|spider|robot|crawling/i.test(navigator.userAgent.toLowerCase())?(Z(I.cookies,!1),ro(),lo(),ho()):I.respectDoNotTrack&&void 0!==navigator.doNotTrack&&"1"===navigator.doNotTrack?(Z({essential:I.cookies.essential},!1),ro(),lo(),ho()):G(!0):(ro(),lo(),ho()))},G=function(e){if(o("body").addClass("borlabs-position-fix"),void 0===e&&(e=!1),Object.keys(H.consents).length)o("["+r+"]").each(function(){-1===Object.keys(H.consents).indexOf(this.dataset.borlabsCookieGroup)&&o(this).addClass("borlabs-hide")});else{var t=o(l),n=null;t.length&&t.each(function(){n=this.value,"1"===I.boxLayoutAdvanced&&"1"===I.ignorePreSelectStatus&&!1===A&&"essential"!==n&&(o(this).prop("checked",!1),o(a+"[name='cookies["+n+"][]']").prop("checked",!1).change())})}return I.blockContent?(o(s+" > div").addClass("_brlbs-block-content"),I.animation?(o(s+" > div").addClass("_brlbs-bg-animation"),setTimeout(function(){o(s+" > div").addClass("_brlbs-bg-dark")},25)):o(s+" > div").addClass("_brlbs-bg-dark")):o("._brlbs-"+I.boxLayout+"-wrap").addClass("_brlbs-position-fixed"),o(s+" > div").removeClass("borlabs-hide"),o(s+" > div").addClass("show-cookie-box"),I.animation&&o(s+" ._brlbs-"+I.boxLayout).addClass("animated "+I.animationIn+(e&&I.animationDelay?" delay-1s":"")),!0},J=function(){return I.animation&&(o(s+" ._brlbs-"+I.boxLayout).removeClass("delay-1s "),o(s+" ._brlbs-"+I.boxLayout).removeClass(I.animationIn),o(s+" ._brlbs-"+I.boxLayout).addClass(I.animationOut)),o(s+" > div").addClass("borlabs-hide"),I.blockContent?o(s+" > div").removeClass("_brlbs-bg-dark"):o("._brlbs-"+I.boxLayout+"-wrap").addClass("_brlbs-position-fixed"),setTimeout(function(){o("._brlbs-"+I.boxLayout+"-wrap").removeAttr("style"),o("._brlbs-"+I.boxLayout+" .cookie-box .container").removeAttr("style"),o("._brlbs-"+I.boxLayout+" .cookie-preference .container").removeAttr("style"),I.animation&&(o("._brlbs-"+I.boxLayout).removeClass("animated"),o("._brlbs-"+I.boxLayout).removeClass("delay-1s"),o("._brlbs-"+I.boxLayout).removeClass(I.animationIn),o("._brlbs-"+I.boxLayout).removeClass(I.animationOut)),o(s+" > div").removeClass("show-cookie-box"),I.blockContent&&o(s+" > div").removeClass("_brlbs-block-content")},I.animation?1e3:0),o("body").removeClass("borlabs-position-fix"),!0},M=function(){var e=o(l),t=null,n=null;e.length&&e.each(function(){t=this.value,Object.keys(H.consents).length?!1===A&&(void 0!==H.consents[t]?(o(this).prop("checked",!0),o(this).change(),(n=o(a+"[name='cookies["+t+"][]']")).each(function(){-1!==H.consents[t].indexOf(this.value)?o(this).prop("checked",!0):o(this).prop("checked",!1),o(this).change()})):(o(this).prop("checked",!1),o(this).change(),o(a+"[name='cookies["+t+"][]']").prop("checked",!1).change())):("1"===I.ignorePreSelectStatus&&!1===A&&(o(this).prop("checked",!1),o(s+" ["+r+"='"+this.value+"']").addClass("borlabs-hide")),o(this).change(),(n=o(a+"[name='cookies["+t+"][]']")).each(function(){"1"===I.ignorePreSelectStatus&&!1===A&&o(this).prop("checked",!1),o(this).change()}))}),o("._brlbs-"+I.boxLayout+" .cookie-box .container").animate({height:0,opacity:0},function(){o("._brlbs-"+I.boxLayout+"-wrap").animate({width:"100vw",maxWidth:"box"===I.boxLayout?"768px":"100%"},"box"===I.boxLayout?400:0,function(){var e=o("._brlbs-"+I.boxLayout+" .cookie-preference .container")[0].scrollHeight;o("._brlbs-"+I.boxLayout+" .cookie-preference .container").animate({height:"80vh",maxHeight:e,opacity:1})})})},E=function(){o("._brlbs-"+I.boxLayout+" .cookie-preference .container").animate({height:0,opacity:0},function(){o("._brlbs-"+I.boxLayout+"-wrap").animate({maxWidth:"box"===I.boxLayout?"375px":"100%"},"box"===I.boxLayout?400:0,function(){var e=o("._brlbs-"+I.boxLayout+" .cookie-box .container")[0].scrollHeight+"px";o("._brlbs-"+I.boxLayout+" .cookie-box .container").animate({height:e,opacity:1})})})},z=function(e){return void 0!==e&&e.preventDefault(),o("._brlbs-"+I.boxLayout+" .cookie-box .container").css("height",0),o("._brlbs-"+I.boxLayout+" .cookie-box .container").css("opacity",0),o("._brlbs-"+I.boxLayout+"-wrap").css({width:"100vw",maxWidth:"box"===I.boxLayout?"768px":"100%"}),G(!1),setTimeout(function(){M()},500),!0},$=function(){o("["+e+"]").on("click","["+i+"]",function(){var i=o(this).closest("["+e+"]");i.find("["+t+"]:visible").length&&(i.find("["+n+"='hide']").addClass("borlabs-hide"),i.find("["+n+"='show']").removeClass("borlabs-hide"),i.find("["+t+"]:visible").slideUp()),i.find("["+t+"='"+this.dataset.cookieAccordionTarget+"']:hidden").length&&(o(this).children("["+n+"='show']").addClass("borlabs-hide"),o(this).children("["+n+"='hide']").removeClass("borlabs-hide"),i.find("["+t+"='"+this.dataset.cookieAccordionTarget+"']").slideDown())})},V=function(){var e=o(l),t=null,n=null;e.length&&e.each(function(){t=this.value,o(this).prop("checked",!0),o(this).change(),(n=o(a+"[name='cookies["+t+"][]']")).each(function(){o(this).prop("checked",!0),o(this).change()})}),Q(),J()},W=function(){o(document).on("click",l,function(){A=!0,this.checked?(o(a+"[name='cookies["+this.value+"][]']").prop("checked",!0).change(),o(l+"[value='"+this.value+"']").prop("checked",!0),o(s+" ["+r+"='"+this.value+"']").length&&o(s+" ["+r+"='"+this.value+"']").removeClass("borlabs-hide")):(o(a+"[name='cookies["+this.value+"][]']").prop("checked",!1).change(),o(l+"[value='"+this.value+"']").prop("checked",!1),o(s+" ["+r+"='"+this.value+"']").length&&o(s+" ["+r+"='"+this.value+"']").addClass("borlabs-hide"))})},F=function(){o(document).on("click",a+"[name^='cookies']",function(){A=!0,this.checked&&(o(l+"[value='"+this.dataset.cookieGroup+"']").prop("checked",!0).change(),o(s+" ["+r+"='"+this.dataset.cookieGroup+"']").length&&o(s+" ["+r+"='"+this.dataset.cookieGroup+"']").removeClass("borlabs-hide"))})},q=function(){!0===this.checked?(o(this).parent().parent().children(g).children().last().css("display","none"),o(this).parent().parent().children(g).children().first().css("display","inline-block")):(o(this).parent().parent().children(g).children().first().css("display","none"),o(this).parent().parent().children(g).children().last().css("display","inline-block"))},Q=function(){var e={essential:I.cookies.essential},t=o(l+":checked"),n=o(a+"[name^='cookies']:checked");if(t.length&&(t.each(function(){this.value.length&&new RegExp(/^[a-z-_]{3,}$/).test(this.value)&&"essential"!==this.value&&(e[this.value]=[])}),n.length&&n.each(function(){this.value.length&&"string"==typeof this.dataset.cookieGroup&&new RegExp(/^[a-z-_]{3,}$/).test(this.value)&&new RegExp(/^[a-z-_]{3,}$/).test(this.dataset.cookieGroup)&&e[this.dataset.cookieGroup].push(this.value)})),Object.keys(H.consents).length)for(var i in H.consents)if(void 0!==e[i])for(var s in H.consents[i])-1===e[i].indexOf(H.consents[i][s])&&uo(i,H.consents[i][s]);else if(void 0!==j[i])for(var c in j[i])uo(i,c);Z(e,!1),"1"!==I.reloadAfterConsent&&(ro(),lo(),ho())},K=function(){var o=!1;return"string"==typeof H.version&&H.version===I.cookieVersion&&(o=!0),o},X=function(o,e){var t={name:"",value:""};if(void 0===e&&(e=!1),e&&(o=o.replace("*","")),document.cookie.length)for(var n,i=decodeURIComponent(document.cookie).split(";"),a=0;a0&&location.reload(!0)})},yo=function(){o.ajax(I.ajaxURL,{type:"POST",data:{action:"borlabs_cookie_handler",type:"consent_history",language:I.language,uid:H.uid}}).done(function(e){(e=o.parseJSON(e)).length&&o.each(e,function(e,t){o("["+_+"] table").append(""+t.stamp+""+t.version+""+t.consent+"")})})},wo=function(){if(I.crossDomainCookie.length)for(var e in I.crossDomainCookie){var t=I.crossDomainCookie[e];o("body").append('')}},Bo=function(){o(O+" [name^='borlabsCookie']").each(function(){ao(this.value)?this.checked=!0:this.checked=!1,o(this).change()}),o(document).on("change",O+" [name^='borlabsCookie']",function(){this.checked?no(this.dataset.cookieGroup,this.value):io(this.dataset.cookieGroup,this.value)})},Lo,_o=function(){if(Object.keys(j).length)for(var o in j)if(Object.keys(j[o]).length)for(var e in j[o])if(void 0!==j[o][e].settings&&void 0!==j[o][e].settings.blockCookiesBeforeConsent&&"1"===j[o][e].settings.blockCookiesBeforeConsent&&void 0!==j[o][e].cookieNameList&&!1===ao(e))for(var t in j[o][e].cookieNameList)oo(t,null,-1!==t.indexOf("*"))};return{addConsent:no,allocateScriptBlockerToContentBlocker:function(o,e,t){"scriptBlockerId"!==t&&"jsHandle"!==t||(void 0===D[o]&&(D[o]={scriptBlockerId:[],jsHandle:[]}),-1===D[o][t].indexOf(e)&&D[o][t].push(e))},checkCookieConsent:ao,checkCookieGroupConsent:function(o){var e=!1;return void 0!==H.consents[o]&&(e=!0),e},deleteCookie:oo,getCookie:Y,hideCookieBox:J,init:R,initConsentHistoryTable:yo,initSwitchConsentButtonStatus:Bo,openCookiePreference:z,removeConsent:io,showCookieBox:G,unblockContentId:function(e){o("["+C+"='content-blocker']["+x+"='"+e+"']").each(function(){ko(o(this).parents(".BorlabsCookie"))})},unblockScriptBlockerId:fo,unblockScriptBlockerJSHandle:vo}}()}(jQuery);