"use strict";var _paq=window._paq||[];!function(o,t,n){function a(e,o,t){var a,i="";t&&((a=new Date).setTime(a.getTime()+24*t*60*60*1e3),i="; expires="+a.toUTCString()),n.cookie=e+"="+(o||"")+i+"; path=/;SameSite=Lax"}function i(){p.removeClass("is-active"),clearInterval(h)}function r(){u||(s.matomo&&(_paq.push(["trackPageView"]),_paq.push(["enableLinkTracking"]),function(){var e="//matomo.kirche-bremen.de/";_paq.push(["setTrackerUrl",e+"matomo.php"]),_paq.push(["setSiteId","1"]);var o=(t=n).createElement("script"),t=t.getElementsByTagName("script")[0];o.type="text/javascript",o.async=!0,o.defer=!0,o.src=e+"matomo.js",t.parentNode.insertBefore(o,t)}(),o(".js-google-translate").show()),u=!0)}o(n);var c,s,e,p=o(".js-cookiebar"),l=o(".js-cookiebar-bar"),u=!1,g="cookiehint",h=0;p.length&&(e=function(e){for(var o=e+"=",t=n.cookie.split(";"),a=0;a<t.length;a++){for(var i=t[a];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(o))return i.substring(o.length,i.length)}return null}(g),o(n).on("click",".js-cookiebar-optout",function(e){e.preventDefault(),s={matomo:0},o(".js-google-translate").hide(),n.cookie="googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",n.cookie=c+"=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/",t[c]=!0;e=JSON.stringify(s);a(g,e,14),i(),alert("OptOut erfolgreich")}),o(n).on("click",".js-cookiebar-cancel",function(e){e.preventDefault(),o.magnificPopup.close()}),o(n).on("click",".js-cookiebar-save",function(e){e.preventDefault(),(s={}).matomo=o("#cookiebar-check-matomo").is(":checked")?1:0,s.matomo||void 0!==_paq&&(_paq.push(["disableCookies"]),o(".js-google-translate").hide(),n.cookie="googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;");e=JSON.stringify(s);a(g,e,365),r(),o.magnificPopup.close(),i()}),o(n).on("click",".js-cookiebar-decline",function(e){e.preventDefault(),s={matomo:0},o(".js-google-translate").hide(),n.cookie="googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";e=JSON.stringify(s);a(g,e,365),i()}),o(n).on("click",".js-cookiebar-accept",function(e){e.preventDefault(),s={matomo:1};e=JSON.stringify(s);a(g,e,365),r(),i()}),null===e?(p.addClass("is-active"),p.height(l.outerHeight(!0)),h=setInterval(function(){p.height(l.outerHeight(!0))},1e3)):((s=JSON.parse(e)).matomo&&o("#cookiebar-check-matomo").prop("checked",!0),r()))}(jQuery,window,document);