Don't miss out
Subscribe to QuickBooks and
get 90% off for 6 months Claim now
MAY SALE
' + 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); return ( pbis_countdown_translations.global.forEach((title) => { pbis_banner.querySelector( '.pbis_banner__countdown-item[data-interval="' + title + '"] .pbis_banner__countdown-number' ).innerHTML = (eval(title) > 0 ? eval(title) : 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"); }), 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(); } }