(function(){"use strict";window.kadenceCountdown={cache:{},timers:JSON.parse(kadence_blocks_countdown.timers),createCookie:function(a,b,c,d){if(c){var e=new Date;"minutes"==d?e.setTime(e.getTime()+1e3*(60*c)):"hours"==d?e.setTime(e.getTime()+1e3*(60*(60*c))):e.setTime(e.getTime()+1e3*(60*(60*(24*c))));var f="; expires="+e.toGMTString()}else var f="";document.cookie=kadence_blocks_countdown.site_slug+"-"+a+"="+b+f+"; path=/"},getCookie(a){var b="; "+document.cookie,c=b.split("; "+kadence_blocks_countdown.site_slug+"-"+a+"=");return 2==c.length?c.pop().split(";").shift():""},updateTimerInterval(a,b,c){var d=new Date,e="";if("evergreen"===window.kadenceCountdown.timers[b].type){if(""!==window.kadenceCountdown.cache[b].cookie&&(e=Math.floor(window.kadenceCountdown.cache[b].cookie-d.getTime())),!e&&window.kadenceCountdown.timers[b].strict&&"query"===window.kadenceCountdown.timers[b].evergreen&&(window.kadenceCountdown.timers[b].evergreen="",window.kadenceCountdown.cache[b].request=new XMLHttpRequest,window.kadenceCountdown.cache[b].request.open("POST",kadence_blocks_countdown.ajax_url,!0),window.kadenceCountdown.cache[b].request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),window.kadenceCountdown.cache[b].request.onload=function(){200<=this.status&&400>this.status&&(window.kadenceCountdown.cache[b].evergreen=parseInt(this.response),window.kadenceCountdown.cache[b].evergreen&&(e=Math.floor(window.kadenceCountdown.cache[b].evergreen-d.getTime()),window.kadenceCountdown.createCookie(window.kadenceCountdown.timers[b].campaign_id,window.kadenceCountdown.cache[b].evergreen,30,"days"),window.kadenceCountdown.cache[b].cookie=window.kadenceCountdown.cache[b].evergreen))},window.kadenceCountdown.cache[b].request.onerror=function(){},window.kadenceCountdown.cache[b].request.send("action=kadence_get_evergreen&nonce="+kadence_blocks_countdown.ajax_nonce+"&site_slug="+kadence_blocks_countdown.site_slug+"&reset="+window.kadenceCountdown.cache[b].reset+"&countdown_id="+window.kadenceCountdown.timers[b].campaign_id)),e||window.kadenceCountdown.timers[b].strict||!window.kadenceCountdown.timers[b].evergreen||"query"===window.kadenceCountdown.timers[b].evergreen||(e=Math.floor(window.kadenceCountdown.timers[b].evergreen-d.getTime())),!e&&window.kadenceCountdown.cache[b].evergreen&&(e=Math.floor(window.kadenceCountdown.cache[b].evergreen-d.getTime())),e&&0>e){var f=new Date;f.setTime(window.kadenceCountdown.cache[b].cookie+1e3*(60*(60*(24*Math.floor(window.kadenceCountdown.cache[b].reset)))));var g=Math.floor(f.getTime()-d.getTime());0>g&&(e="")}if(!e&&(window.kadenceCountdown.timers[b].strict&&window.kadenceCountdown.cache[b].request&&window.kadenceCountdown.cache[b].request.readyState&&4===window.kadenceCountdown.cache[b].request.readyState||!window.kadenceCountdown.timers[b].strict)){var h=new Date;h.setTime(h.getTime()+1e3*(60*(60*Math.floor(window.kadenceCountdown.timers[b].hours)))),h.setTime(h.getTime()+1e3*(60*Math.floor(window.kadenceCountdown.timers[b].minutes))),window.kadenceCountdown.cache[b].evergreen=h.getTime()+100,window.kadenceCountdown.createCookie(window.kadenceCountdown.timers[b].campaign_id,window.kadenceCountdown.cache[b].evergreen,30,"days"),e=Math.floor(h.getTime()-d.getTime());var i=new XMLHttpRequest;i.open("POST",kadence_blocks_countdown.ajax_url,!0),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.onload=function(){200<=this.status&&400>this.status},i.onerror=function(){},i.send("action=kadence_evergreen_timestamp&nonce="+kadence_blocks_countdown.ajax_nonce+"&site_slug="+kadence_blocks_countdown.site_slug+"&timestamp="+window.kadenceCountdown.cache[b].evergreen+"&countdown_id="+window.kadenceCountdown.timers[b].campaign_id)}}else e=Math.floor(window.kadenceCountdown.timers[b].timestamp-d.getTime());if(e&&0>e){if("redirect"===window.kadenceCountdown.timers[b].action)window.kadenceCountdown.timers[b].redirect&&(window.location.href=window.kadenceCountdown.timers[b].redirect);else if("hide"===window.kadenceCountdown.timers[b].action)c.style.display="none";else if("message"===window.kadenceCountdown.timers[b].action)c.querySelector(".kb-countdown-inner-first")&&(c.querySelector(".kb-countdown-inner-first").style.display="none"),c.querySelector(".kb-countdown-timer")&&(c.querySelector(".kb-countdown-timer").style.display="none"),c.querySelector(".kb-countdown-inner-second")&&(c.querySelector(".kb-countdown-inner-second").style.display="none"),c.querySelector(".kb-countdown-inner-complete")&&(c.querySelector(".kb-countdown-inner-complete").style.display="block"),c.style.opacity=1,window.kadenceCountdown.timers[b].revealOnLoad&&(c.style.height=c.scrollHeight+"px");else{if(window.kadenceCountdown.timers[b].timer){var j=window.kadenceCountdown.timers[b].dividers,k=window.kadenceCountdown.timers[b].stopWatch,l=window.kadenceCountdown.timers[b].units,m={};m.days=window.kadenceCountdown.timers[b].daysLabel,m.hours=window.kadenceCountdown.timers[b].hoursLabel,m.minutes=window.kadenceCountdown.timers[b].minutesLabel,m.seconds=window.kadenceCountdown.timers[b].secondsLabel;var n={};void 0===l||void 0===l[0]||void 0===l[0].days||l[0].days?(n.days=0,n.hours=0,n.minutes=0,n.seconds=0):void 0===l||void 0===l[0]||void 0===l[0].hours||l[0].hours?(n.hours=0,n.minutes=0,n.seconds=0):void 0===l||void 0===l[0]||void 0===l[0].minutes||l[0].minutes?(n.minutes=0,n.seconds=0):n.seconds=0;var o=window.kadenceCountdown.timers[b].preLabel?`<div class="kb-countdown-item kb-pre-timer"><span class="kb-pre-timer-inner">${window.kadenceCountdown.timers[b].preLabel}</span></div>`:"",p=window.kadenceCountdown.timers[b].postLabel?`<div class="kb-countdown-item kb-post-timer"><span class="kb-post-timer-inner">${window.kadenceCountdown.timers[b].postLabel}</span></div>`:"",q=Object.keys(n).map(a=>"seconds"!==a&&j?`<div class="kb-countdown-item kb-countdown-date-item kb-countdown-date-item-${a}"><span class="kb-countdown-number">${window.kadenceCountdown.calculateNumberDesign(n[a],k)}</span><span class="kb-countdown-label">${m[a]}</span></div><div class="kb-countdown-item kb-countdown-date-item kb-countdown-divider-item kb-countdown-divider-item-${a}"><span class="kb-countdown-number">:</span><span class="kb-countdown-label">&nbsp;</span></div>`:`<div class="kb-countdown-item kb-countdown-date-item kb-countdown-date-item-${a}"><span class="kb-countdown-number">${window.kadenceCountdown.calculateNumberDesign(n[a],k)}</span><span class="kb-countdown-label">${m[a]}</span></div>`).join(" ");a.innerHTML=o+q+p}c.style.opacity=1,window.kadenceCountdown.timers[b].revealOnLoad&&(c.style.height=c.scrollHeight+"px")}return void(window.kadenceCountdown.cache[b].interval&&clearInterval(window.kadenceCountdown.cache[b].interval))}if((e||0===e)&&window.kadenceCountdown.timers[b].timer){var j=window.kadenceCountdown.timers[b].dividers,k=window.kadenceCountdown.timers[b].stopWatch,l=window.kadenceCountdown.timers[b].units,m={};m.days=window.kadenceCountdown.timers[b].daysLabel,m.hours=window.kadenceCountdown.timers[b].hoursLabel,m.minutes=window.kadenceCountdown.timers[b].minutesLabel,m.seconds=window.kadenceCountdown.timers[b].secondsLabel;var r=Math.floor(e/3600000%24),s=Math.floor(e/1e3/60%60),t=Math.floor(e/1e3%60),n={};void 0===l||void 0===l[0]||void 0===l[0].days||l[0].days?(n.days=Math.floor(e/86400000),n.hours=r,n.minutes=s,n.seconds=t):(r=Math.floor(e/3600000),void 0===l||void 0===l[0]||void 0===l[0].hours||l[0].hours?(n.hours=r,n.minutes=s,n.seconds=t):(s=Math.floor(e/1e3/60),void 0===l||void 0===l[0]||void 0===l[0].minutes||l[0].minutes?(n.minutes=s,n.seconds=t):(t=Math.floor(e/1e3),n.seconds=t)));var o=window.kadenceCountdown.timers[b].preLabel?`<div class="kb-countdown-item kb-pre-timer"><span class="kb-pre-timer-inner">${window.kadenceCountdown.timers[b].preLabel}</span></div>`:"",p=window.kadenceCountdown.timers[b].postLabel?`<div class="kb-countdown-item kb-post-timer"><span class="kb-post-timer-inner">${window.kadenceCountdown.timers[b].postLabel}</span></div>`:"",q=Object.keys(n).map(a=>"seconds"!==a&&j?`<div class="kb-countdown-item kb-countdown-date-item kb-countdown-date-item-${a}"><span class="kb-countdown-number">${window.kadenceCountdown.calculateNumberDesign(n[a],k)}</span><span class="kb-countdown-label">${m[a]}</span></div><div class="kb-countdown-item kb-countdown-date-item kb-countdown-divider-item kb-countdown-divider-item-${a}"><span class="kb-countdown-number">:</span><span class="kb-countdown-label">&nbsp;</span></div>`:`<div class="kb-countdown-item kb-countdown-date-item kb-countdown-date-item-${a}"><span class="kb-countdown-number">${window.kadenceCountdown.calculateNumberDesign(n[a],k)}</span><span class="kb-countdown-label">${m[a]}</span></div>`).join(" ");a.innerHTML=o+q+p}if((e||0===e)&&!window.kadenceCountdown.cache[b].revealed&&(window.kadenceCountdown.cache[b].revealed=!0,c.style.opacity=1,window.kadenceCountdown.timers[b].revealOnLoad)){var u=c.closest(".kadence-pro-fixed-wrap");u&&!window.kadenceCountdown.timers[b].timer?(setTimeout(function(){c.style.height=c.scrollHeight+"px",u.style.transition="height 0.8s ease",u.style.height=Math.floor(u.scrollHeight+c.scrollHeight)+"px"},200),setTimeout(function(){var a=new CustomEvent("kadence-update-sticky");window.dispatchEvent(a),u.style.transition=""},1e3)):c.style.height=c.scrollHeight+"px"}},calculateNumberDesign(a,b=!1){return b?9<a?""+a:"0"+a:a},updateTimer(a,b,c){window.kadenceCountdown.cache[b]={},window.kadenceCountdown.cache[b].evergreen="",window.kadenceCountdown.cache[b].request="",window.kadenceCountdown.cache[b].revealed=!1,window.kadenceCountdown.cache[b].cookie="","evergreen"===window.kadenceCountdown.timers[b].type&&window.kadenceCountdown.timers[b].campaign_id&&(window.kadenceCountdown.cache[b].cookie=window.kadenceCountdown.getCookie(window.kadenceCountdown.timers[b].campaign_id)),window.kadenceCountdown.updateTimerInterval(a,b,c),window.kadenceCountdown.cache[b].interval=setInterval(function(){window.kadenceCountdown.updateTimerInterval(a,b,c)},1e3)},initTimer(){var a=document.querySelectorAll(".kb-countdown-container");if(a.length)for(var b,c=0;c<a.length;c++)if(b=a[c].getAttribute("data-id"),b&&window.kadenceCountdown.timers[b]){var d=a[c].querySelector(".kb-countdown-timer");window.kadenceCountdown.updateTimer(d,b,a[c])}}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",window.kadenceCountdown.initTimer):window.kadenceCountdown.initTimer()})();