var css = document.createElement('style');
css.type = 'text/css';
var styles = `.newsletter-popup-message {
position: fixed;
top: -30%;
left: 0;
background: #ffffffe0;
z-index: 9999;
margin: auto;
right: 0;
bottom: 0;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
width: 90%;
height: max-content;
max-width: 410px;
font-size: 20px;
flex-direction: column;
padding: 19px 20px;
font-weight: 400;
font-family: sans-serif;
box-shadow: 0px 0px 15px -6px #000;
color: #5e5e5e;
}
@media (min-width: 576px) {
.min-height-list {
min-height: calc(268px + 26rem);
}
}
@media (max-width: 575px) {
.min-height-list {
min-height: 250px;
}
}
.newsletter-popup-message i {
font-size: 60px;
}
.newsletter-popup-message strong {
font-weight: 700;
text-transform: uppercase;
}
#sib-container input:-ms-input-placeholder {
text-align: left;
font-family: "Open Sans",helvetica,arial,sans-serif;
color: #c0ccda;
}
.sib-form #nl-toggle-button:before {
content: "\\f053";
font-family: "Icons";
color: #000;
display: flex;
width: 100%;
height: 100%;
background: #ead6bc;
position: absolute;
left: 0;
top: 0;
border-radius: 0 10px 10px 0;
justify-content: center;
align-items: center;
font-size: 20px;
opacity: 0;
transition: all 250ms ease-in-out;
}
.sib-form.active #nl-toggle-button:before {
opacity: 1;
}
#sib-container input::placeholder {
text-align: left;
font-family: "Open Sans",helvetica,arial,sans-serif;
color: #c0ccda;
}
#sib-form .g-recaptcha {
display: none;
}
@media (max-width: 799px) {
.sib-form #nl-toggle-button {
display: none;
}
#sib-container {
max-width: initial;
border-radius: 0px;
}
div#sib-form {
margin: 0 0 2px 0 !important;
}
div#sib-form-container {
padding: 0 10px;
}
}
@media (min-width: 992px) {
.sib-form {
bottom: 25px;
}
}
@media (min-width: 800px) and (max-width: 991px) {
.sib-form {
bottom: 62px;
}
}
@media (min-width: 800px) {
#sib-container {
max-width: 420px;
border-radius: 8px;
}
.sib-form {
position: fixed;
z-index: 999;
left: -420px;
transition: all 250ms ease-in-out;
}
.sib-form.active {
left: 5px;
}
}
.sib-form .sib-form-block {
padding: 0 5px;
}
#nl-toggle-button {
position: absolute;
background: #ead6bc;
right: -66px;
top: 92px;
font-size: 13px;
font-weight: 900;
text-transform: uppercase;
padding: 13px 7px 8px 13px;
line-height: 16px;
letter-spacing: -0.4px;
border-radius: 0 10px 10px 0;
}`;
if (css.styleSheet) css.styleSheet.cssText = styles;
else css.appendChild(document.createTextNode(styles));
document.getElementsByTagName("head")[0].appendChild(css);
const newsletterButton = document.getElementById("newsletter-send-button");
if (newsletterButton) {
newsletterButton.setAttribute("onclick", "executeCaptcha");
}
const sibForm = document.getElementById("sib-form");
let acceptConsentMessageAdded = false;
sibForm.addEventListener("submit", function(event) {
const isConsented = vueApp.$store.getters.isConsented("media.reCaptcha") === true;
if (isConsented) {
localStorage.setItem('formSubmitted', true);
document.getElementById('sib-form-wrapper').style.display = 'none';
console.log("test");
showPopup();
event.preventDefault();
setTimeout(function() {
sibForm.submit();
}, 4000);
}
if (!isConsented && !acceptConsentMessageAdded) {
event.preventDefault();
addConsentMessage();
}
});
function addConsentMessage() {
const errorMessageContent = document.getElementById("sib-form-error-message-content");
if (errorMessageContent) {
errorMessageContent.textContent += 'Um die Newsletter-Anmeldung abzuschicken, müssen Sie den Google reCAPTCHA-Cookie akzeptieren. Öffnen Sie die Datenschutzeinstellungen links unten auf der Seite und klicken Sie auf "Weitere Einstellungen". Aktivieren Sie den reCAPTCHA-Cookie im Bereich "Externe Medien" und speichern Sie die Einstellungen.';
acceptConsentMessageAdded = true;
}
}
var formSubmitted = localStorage.getItem('formSubmitted');
console.log("formSubmitted: ", formSubmitted);
if (formSubmitted !== "true") {
document.getElementById('sib-form-wrapper').style.display = 'block';
console.log("form not submitted");
}
function showPopup() {
const popup = document.createElement('div');
popup.className = 'newsletter-popup-message';
popup.innerHTML = ` `;
document.body.appendChild(popup);
setTimeout(function() {
popup.remove();
}, 4000);
}
window.REQUIRED_CODE_ERROR_MESSAGE = 'Wählen Sie bitte einen Ländervorwahl aus.';
window.LOCALE = 'de';
window.EMAIL_INVALID_MESSAGE = window.SMS_INVALID_MESSAGE = "Die eingegebenen Informationen sind nicht gültig. Bitte überprüfen Sie das Feldformat und versuchen Sie es erneut.";
window.REQUIRED_ERROR_MESSAGE = "Dieses Feld darf nicht leer sein. ";
window.GENERIC_INVALID_MESSAGE = "Die eingegebenen Informationen sind nicht gültig. Bitte überprüfen Sie das Feldformat und versuchen Sie es erneut.";
window.translation = {
common: {
selectedList: '{quantity} Liste ausgewählt',
selectedLists: '{quantity} Listen ausgewählt'
}
};
var AUTOHIDE = Boolean(1);
const button = document.getElementById("nl-toggle-button");
const form = document.getElementsByClassName("sib-form")[0];
const buttonPressed = (e) => {
form.classList.toggle("active");
}
button.addEventListener("click", buttonPressed);