!function(e){window.BorlabsCookie=function(){"use strict";function o(e,o){if(o){var t=o.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),n=Array.from(t).filter((function(e){return 0!==e.offsetHeight})),i=n[0],a=n[n.length-1],c=9,s;("Tab"===e.key||9===e.keyCode)&&(e.shiftKey?document.activeElement===i&&(e.preventDefault(),a.focus()):document.activeElement===a&&(e.preventDefault(),i.focus()))}}function t(e){e.addEventListener("keydown",(function(t){return o(t,e)}),!0)}function n(e){e.removeEventListener("keydown",(function(t){return o(t,e)}),!0)}function i(){e(u).attr("aria-modal",!0)}function a(){e(u).attr("aria-modal",!1)}var c="data-cookie-accordion",s="data-cookie-accordion-parent",r="data-cookie-accordion-status",l="data-cookie-accordion-target",d="#BorlabsCookieBox input[type='checkbox']",u="#BorlabsCookieBox",b="#BorlabsCookieBoxWrap",h="data-borlabs-cookie-group",k="#BorlabsCookieBox input[type='checkbox'][name='cookieGroup[]']",p="data-cookie-accept",f="data-cookie-accept-all",v="data-cookie-back",m="data-cookie-individual",g="data-cookie-refuse",x="data-borlabs-cookie-preference",y=".borlabs-cookie-preference",C="data-borlabs-cookie-switch",w="._brlbs-btn-switch-status",L="data-borlabs-cookie-unblock",_="data-borlabs-cookie-type",B="data-borlabs-cookie-id",S="data-borlabs-script-blocker-id",O="data-borlabs-script-blocker-js-handle",j="input[type='checkbox'][name='unblockAll']",I="data-borlabs-cookie-uid",T="data-borlabs-cookie-consent-history",D=".BorlabsCookie",A,U,E={},P={},H={},N={},R={scriptBlockerId:{},jsHandle:{}},G=!1,J={consents:{},expires:null,uid:null,version:null},M="borlabs-cookie",z={consentSaved:null,codeUnblocked:null,codeUnblockedAfterConsent:null},q=function(o,t,n,i){return"about:blank"!==window.location.href&&(A=e.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:[]},o),U=i,E=t,P=n,z.consentSaved=document.createEvent("Event"),z.consentSaved.initEvent("borlabs-cookie-consent-saved",!0,!0),z.codeUnblocked=document.createEvent("Event"),z.codeUnblocked.initEvent("borlabs-cookie-code-unblocked",!0,!0),z.codeUnblockedAfterConsent=document.createEvent("Event"),z.codeUnblockedAfterConsent.initEvent("borlabs-cookie-code-unblocked-after-consent",!0,!0),ae(),De(),null===J.uid&&(J.uid=ke()),A.cookieBeforeConsent&&"function"==typeof Object&&(void 0===Object.entries&&(Object.entries=function(e){for(var o=Object.keys(e),t=o.length,n=new Array(t);t--;)n[t]=[o[t],e[o[t]]];return n}),0===Object.entries(J.consents).length&&Se()),$(),e(document).on("click","["+L+"]",ge),e(document).on("click","["+x+"]",Q),e(document).on("click",y,Q),e(document).on("change","["+C+"]",oe),e(document).on("keydown",(function(o){9===o.keyCode&&e(D).addClass("_brlbs-keyboard")})),e(document).on("mousedown",(function(o){e(D).is(":visible")&&e(D).removeClass("_brlbs-keyboard")})),e("body").on("focus",D+"._brlbs-keyboard input[type='checkbox']",(function(o){var t=e(o.currentTarget).closest("label");t&&e(t).addClass("_brlbs-focused")})),e(D).on("blur","input[type='checkbox']",(function(o){var t=e(o.currentTarget).closest("label");t&&e(t).removeClass("_brlbs-focused")})),e("["+T+"]").length&&Oe(),Ie(),e("["+I+"]").length&&e("["+I+"]").each((function(){e(this).html(J.uid)})),!0)},$=function(){e(b).length&&"SCRIPT"===e(b)[0].tagName&&e(b).after(e(b).html()),e(document).on("click","["+p+"]",(function(e){e.preventDefault(),te(),V()})),e(document).on("click","["+f+"]",(function(e){e.preventDefault(),X()})),e(document).on("click","["+v+"]",(function(e){e.preventDefault(),K()})),e(document).on("click","["+m+"]",(function(e){e.preventDefault(),F()})),e(document).on("click","["+g+"]",(function(o){o.preventDefault();var t=[];e(k+":checked").each((function(){-1===t.indexOf(this.value)&&(e(this).trigger("click"),t.push(this.value))})),te(),V()})),Z(),Y(),ee(),!0===ne()?(pe(),fe(),ve(),document.dispatchEvent(z.codeUnblocked),a()):A.showCookieBox?0===A.hideCookieBoxOnPages.length||-1===A.hideCookieBoxOnPages.indexOf(window.location.protocol+"//"+window.location.hostname+window.location.pathname)?A.cookiesForBots&&/bot|googlebot|crawler|spider|robot|crawling|lighthouse/i.test(navigator.userAgent.toLowerCase())?(ce(A.cookies,!1),pe(),fe(),ve(),a(),document.dispatchEvent(z.codeUnblocked)):A.respectDoNotTrack&&void 0!==navigator.doNotTrack&&"1"===navigator.doNotTrack?(ce({essential:A.cookies.essential},!1),pe(),fe(),ve(),a(),document.dispatchEvent(z.codeUnblocked)):W(!0):(pe(),fe(),ve(),a(),document.dispatchEvent(z.codeUnblocked)):a()},W=function(o){i(),e("body").addClass("borlabs-position-fix"),t(document.querySelector(".cookie-box")),void 0===o&&(o=!1);var n=e(k),a=null;return Object.keys(J.consents).length?(e("["+h+"]").each((function(){-1===Object.keys(J.consents).indexOf(this.dataset.borlabsCookieGroup)&&e(this).addClass("borlabs-hide")})),n.length&&"1"===A.boxLayoutAdvanced&&n.each((function(){a=this.value,"string"==typeof this.dataset.borlabsCookieCheckbox&&("object"==typeof J.consents[a]?e(this).prop("checked",!0):e(this).prop("checked",!1))}))):n.length&&n.each((function(){a=this.value,"1"===A.boxLayoutAdvanced&&"1"===A.ignorePreSelectStatus&&!1===G&&"essential"!==a&&(e(this).prop("checked",!1),e(d+"[name='cookies["+a+"][]']").prop("checked",!1).change())})),A.blockContent?(e(u+" > div").addClass("_brlbs-block-content"),A.animation?(e(u+" > div").addClass("_brlbs-bg-animation"),setTimeout((function(){e(u+" > div").addClass("_brlbs-bg-dark")}),25)):e(u+" > div").addClass("_brlbs-bg-dark")):e("._brlbs-"+A.boxLayout+"-wrap").addClass("_brlbs-position-fixed"),e(u+" > div").css("display",""),e(u+" > div").addClass("show-cookie-box"),A.animation&&e(u+" ._brlbs-"+A.boxLayout).addClass("animated "+A.animationIn+(o&&A.animationDelay?" delay-1s":"")),e("#CookieBoxSaveButton")[0].focus(),!0},V=function(){return a(),n(document.querySelector(".cookie-box")),A.animation&&(e(u+" ._brlbs-"+A.boxLayout).removeClass("delay-1s "),e(u+" ._brlbs-"+A.boxLayout).removeClass(A.animationIn),e(u+" ._brlbs-"+A.boxLayout).addClass(A.animationOut)),e(u+" > div").addClass("borlabs-hide"),A.blockContent?e(u+" > div").removeClass("_brlbs-bg-dark"):e("._brlbs-"+A.boxLayout+"-wrap").addClass("_brlbs-position-fixed"),setTimeout((function(){e("._brlbs-"+A.boxLayout+"-wrap").removeAttr("style"),e("._brlbs-"+A.boxLayout+" .cookie-box .container").removeAttr("style"),e("._brlbs-"+A.boxLayout+" .cookie-preference .container").removeAttr("style"),A.animation&&(e("._brlbs-"+A.boxLayout).removeClass("animated"),e("._brlbs-"+A.boxLayout).removeClass("delay-1s"),e("._brlbs-"+A.boxLayout).removeClass(A.animationIn),e("._brlbs-"+A.boxLayout).removeClass(A.animationOut)),e(u+" > div").removeClass("show-cookie-box"),A.blockContent&&e(u+" > div").removeClass("_brlbs-block-content")}),A.animation?1e3:0),e("body").removeClass("borlabs-position-fix"),!0},F=function(){n(document.querySelector(".cookie-box")),t(document.querySelector(".cookie-preference"));var o=e(k),i=null,a=null;o.length&&o.each((function(){i=this.value,Object.keys(J.consents).length?!1===G&&(void 0!==J.consents[i]?(e(this).prop("checked",!0),e(this).change(),(a=e(d+"[name='cookies["+i+"][]']")).each((function(){-1!==J.consents[i].indexOf(this.value)?e(this).prop("checked",!0):e(this).prop("checked",!1),e(this).change()}))):(e(this).prop("checked",!1),e(this).change(),e(d+"[name='cookies["+i+"][]']").prop("checked",!1).change())):("1"===A.ignorePreSelectStatus&&!1===G&&(e(this).prop("checked",!1),e(u+" ["+h+"='"+this.value+"']").addClass("borlabs-hide")),e(this).change(),(a=e(d+"[name='cookies["+i+"][]']")).each((function(){"1"===A.ignorePreSelectStatus&&!1===G&&e(this).prop("checked",!1),e(this).change()})))})),e("._brlbs-"+A.boxLayout+" .cookie-box .container").animate({height:0,opacity:0},(function(){e("._brlbs-"+A.boxLayout+" .cookie-box").attr("aria-hidden",!0),e("._brlbs-"+A.boxLayout+" .cookie-preference").attr("aria-hidden",!1),e("#CookiePrefSave")[0].focus(),e("._brlbs-"+A.boxLayout+"-wrap").animate({width:"100vw",maxWidth:"box"===A.boxLayout?"768px":"100%"},"box"===A.boxLayout?400:0,(function(){var o=e("._brlbs-"+A.boxLayout+" .cookie-preference .container")[0].scrollHeight;e("._brlbs-"+A.boxLayout+" .cookie-preference .container").animate({height:"80vh",maxHeight:o,opacity:1})}))}))},K=function(){n(document.querySelector(".cookie-preference")),e("._brlbs-"+A.boxLayout+" .cookie-preference .container").animate({height:0,opacity:0},(function(){e("._brlbs-"+A.boxLayout+" .cookie-box").attr("aria-hidden",!1),e("._brlbs-"+A.boxLayout+" .cookie-preference").attr("aria-hidden",!0),e("._brlbs-"+A.boxLayout+"-wrap").animate({maxWidth:"box"===A.boxLayout?"375px":"100%"},"box"===A.boxLayout?400:0,(function(){var o=e("._brlbs-"+A.boxLayout+" .cookie-box .container")[0].scrollHeight+"px";e("._brlbs-"+A.boxLayout+" .cookie-box .container").animate({height:o,opacity:1})})),e("#CookieBoxSaveButton")[0].focus()}))},Q=function(o){return void 0!==o&&o.preventDefault(),e("._brlbs-"+A.boxLayout+" .cookie-preference .container a["+v+"]").css("display","none"),e("._brlbs-"+A.boxLayout+" .cookie-preference .container a["+v+"] + span._brlbs-separator").css("display","none"),e("._brlbs-"+A.boxLayout+" .cookie-box .container").css("height",0),e("._brlbs-"+A.boxLayout+" .cookie-box .container").css("opacity",0),e("._brlbs-"+A.boxLayout+"-wrap").css({width:"100vw",maxWidth:"box"===A.boxLayout?"768px":"100%"}),W(!1),setTimeout((function(){F()}),500),!0},Z=function(){e("["+c+"]").on("click","["+l+"]",(function(){var o=e(this).closest("["+c+"]");o.find("["+s+"]:visible").length&&(o.find("["+r+"='hide']").addClass("borlabs-hide"),o.find("["+r+"='show']").removeClass("borlabs-hide"),o.find("["+s+"]:visible").slideUp()),o.find("["+s+"='"+this.dataset.cookieAccordionTarget+"']:hidden").length&&(e(this).children("["+r+"='show']").addClass("borlabs-hide"),e(this).children("["+r+"='hide']").removeClass("borlabs-hide"),o.find("["+s+"='"+this.dataset.cookieAccordionTarget+"']").slideDown())}))},X=function(){var o=e(k),t=null,n=null;o.length&&o.each((function(){t=this.value,e(this).prop("checked",!0),e(this).change(),(n=e(d+"[name='cookies["+t+"][]']")).each((function(){e(this).prop("checked",!0),e(this).change()}))})),te(),V()},Y=function(){e(document).on("click",k,(function(){G=!0,this.checked?(e(d+"[name='cookies["+this.value+"][]']").prop("checked",!0).change(),e(k+"[value='"+this.value+"']").prop("checked",!0),e(u+" ["+h+"='"+this.value+"']").length&&e(u+" ["+h+"='"+this.value+"']").removeClass("borlabs-hide")):(e(d+"[name='cookies["+this.value+"][]']").prop("checked",!1).change(),e(k+"[value='"+this.value+"']").prop("checked",!1),e(u+" ["+h+"='"+this.value+"']").length&&e(u+" ["+h+"='"+this.value+"']").addClass("borlabs-hide"))}))},ee=function(){e(document).on("click",d+"[name^='cookies']",(function(){G=!0,this.checked&&(e(k+"[value='"+this.dataset.cookieGroup+"']").prop("checked",!0).change(),e(u+" ["+h+"='"+this.dataset.cookieGroup+"']").length&&e(u+" ["+h+"='"+this.dataset.cookieGroup+"']").removeClass("borlabs-hide"))}))},oe=function(){!0===this.checked?(e(this).parent().parent().children(w).children().last().css("display","none"),e(this).parent().parent().children(w).children().first().css("display","inline-block")):(e(this).parent().parent().children(w).children().first().css("display","none"),e(this).parent().parent().children(w).children().last().css("display","inline-block"))},te=function(){var o={essential:A.cookies.essential},t=e(k+":checked"),n=e(d+"[name^='cookies']:checked");if(t.length&&(t.each((function(){this.value.length&&new RegExp(/^[a-z-_]{3,}$/).test(this.value)&&"essential"!==this.value&&(o[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)&&o[this.dataset.cookieGroup].push(this.value)}))),Object.keys(J.consents).length)for(var i in J.consents)if(void 0!==o[i])for(var a in J.consents[i])-1===o[i].indexOf(J.consents[i][a])&&me(i,J.consents[i][a]);else if(void 0!==E[i])for(var c in E[i])me(i,c);ce(o,!1),"1"!==A.reloadAfterConsent&&(pe(),fe(),ve(),document.dispatchEvent(z.codeUnblockedAfterConsent),document.dispatchEvent(z.codeUnblocked))},ne=function(){var e=!1;return"string"==typeof J.version&&(J.version===A.cookieVersion?e=!0:J.consents={}),e},ie=function(e,o){var t={name:"",value:""};if(void 0===o&&(o=!1),o&&(e=e.replace("*","")),document.cookie.length)for(var n=document.cookie.split(";"),i=0;i0&&location.reload(!0)}))},Oe=function(){e.ajax(A.ajaxURL,{type:"POST",data:{action:"borlabs_cookie_handler",type:"consent_history",language:A.language,uid:J.uid}}).done((function(o){(o=e.parseJSON(o)).length&&e.each(o,(function(o,t){e("["+T+"] table").append(""+t.stamp+""+t.version+""+t.consent+"")}))}))},je=function(){if(A.crossDomainCookie.length)for(var o in A.crossDomainCookie){var t=A.crossDomainCookie[o];e("body").append('')}},Ie=function(){e(D+" [name^='borlabsCookie']").each((function(){be(this.value)?this.checked=!0:this.checked=!1,e(this).change()})),e(document).on("change",D+" [name^='borlabsCookie']",(function(){this.checked?de(this.dataset.cookieGroup,this.value):ue(this.dataset.cookieGroup,this.value)}))},Te,De=function(){if(Object.keys(E).length)for(var e in E)if(Object.keys(E[e]).length)for(var o in E[e])if(void 0!==E[e][o].settings&&void 0!==E[e][o].settings.blockCookiesBeforeConsent&&"1"===E[e][o].settings.blockCookiesBeforeConsent&&void 0!==E[e][o].cookieNameList&&!1===be(o))for(var t in E[e][o].cookieNameList)se(t,null,-1!==t.indexOf("*"))},Ae;return{addConsent:de,allocateScriptBlockerToContentBlocker:function(e,o,t){"scriptBlockerId"!==t&&"jsHandle"!==t||(void 0===N[e]&&(N[e]={scriptBlockerId:[],jsHandle:[]}),-1===N[e][t].indexOf(o)&&N[e][t].push(o))},callWhenLoaded:function(e,o){var t=function(){!0===window.hasOwnProperty(e)?o(o):window.setTimeout(t,1e3)};t()},checkCookieConsent:be,checkCookieGroupConsent:function(e){var o=!1;return void 0!==J.consents[e]&&(o=!0),o},deleteCookie:se,getCookie:ae,hideCookieBox:V,init:q,initConsentHistoryTable:Oe,initSwitchConsentButtonStatus:Ie,openCookiePreference:Q,removeConsent:ue,showCookieBox:W,unblockContentId:function(o){e("["+_+"='content-blocker']["+B+"='"+o+"']").each((function(){xe(e(this).parents(".BorlabsCookie"))}))},unblockScriptBlockerId:Ce,unblockScriptBlockerJSHandle:we}}()}(jQuery);