DON'T MISS OUT
Buy now and get 70% off for 3 months Claim offer
DON'T MISS OUT
' + t + "
" ); }), (pbis_banner_countdown_el.innerHTML = pbis_countdown_html.join("")); let pbis_countdowndate = new Date( pbis_banner.dataset.end + " 23:59:59" ).getTime(); // override countdown end date - start if (pbis_banner.dataset.countdownEnd) pbis_countdowndate = new Date( pbis_banner.dataset.countdownEnd + " 23:59:59" ).getTime(); // override countdown end date - end let now2 = new Date().getTime(), distance2 = pbis_countdowndate - now2; pbis_countdowndate && distance2 > 0 ? setInterval( (function pbis_countdown_timer() { let now = new Date().getTime(), distance = pbis_countdowndate - now, days = Math.floor(distance / 864e5), hours = Math.floor((distance % 864e5) / 36e5), mins = Math.floor((distance % 36e5) / 6e4), secs = Math.floor((distance % 6e4) / 1e3); const pad_countdown_value = (num) => { let s = "0" + num; return s.slice(s.length - 2); }; pbis_banner.classList.add('countdownStarted'); return ( pbis_countdown_translations.global.forEach((title) => { const value = eval(title); pbis_banner.querySelector( '.pbis_banner__countdown-item[data-interval="' + title + '"] .pbis_banner__countdown-number' ).innerHTML = pad_countdown_value( value > 0 ? value : 0 ); }), pbis_countdown_timer ); })(), 1e3 ) : (pbis_debug && console.log("invalid countdownStart"), pbis_banner_countdown_el.remove()); } else pbis_debug && console.log("countdownStart not yet reached"), pbis_banner_countdown_el.remove(); } else pbis_debug && console.log("pbis banner has no countdown"); } if (pbis_banner) { /* translations start */ if (pbis_banner.dataset.translation) { let pbis_translations = window[pbis_banner.dataset.translation]; if (pbis_translations) { for (let pbis_translation in pbis_translations) { let pbis_translated = pbis_translations[pbis_translation][pbis_geo]; //console.log('replace "'+pbis_translation+'" with "'+pbis_translated+'"'); if (pbis_translated && pbis_translated != "") pbis_banner.innerHTML = pbis_banner.innerHTML.replaceAll( pbis_translation, pbis_translated ); } } } pbis_banner.dataset.geo_displayed = pbis_geo; /* translations end */ console.log("pbis_banner:"), console.log(pbis_banner), (pbis_banner.innerHTML = pbis_banner.innerHTML.replace( /\/global\//g, "/" + (pbis_geo || "global") + "/" )), (pbis_banner.style.display = "flex"), document.body.classList.add("pbis_active"), pbis_set_banner_height(); let navHeight = 80; if (pbis_banner.classList.contains("urgency")) document.body.classList.add("promo-callout--urgency"); document.head.insertAdjacentHTML( "beforeend", '
' ); } else pbis_debug && console.log("no pbis banner found"); if(!pbis_banner){ // reset banner height variable if no banner is used document.documentElement.style.setProperty('--pbis_banner__height', '0px'); }; }), window.addEventListener("resize", pbis_set_banner_height), document.addEventListener("DOMContentLoaded", pbis_load_json); // sticky/expanded capabilities, to be added into main JS window.addEventListener("scroll", pbis_expanded_check); function pbis_html_encode(input) { return input.replace(/&/g, "&").replace(//g, ">"); } function pbis_expanded_check() { if (pbis_banner) { let pbis_classBefore = pbis_banner.classList.value; pbis_banner.classList.toggle("pbis_banner--sticky", window.scrollY > 5); if (pbis_banner.classList != pbis_classBefore) pbis_set_banner_height(); } }