File "countdown.2b0535b147c43fcf8244.bundle.min.js"
Full path: /home/kosmetik/public_html/wp-content/plugins/elementor-pro/assets/js/countdown.2b0535b147c43fcf8244.bundle.min.js
File
size: 2.77 B
MIME-type: text/plain
Charset: utf-8
Download Open Edit Advanced Editor Back
/*! elementor-pro - v3.3.0 - 06-06-2021 */
(self.webpackChunkelementor_pro=self.webpackChunkelementor_pro||[]).push([[804],{7097:(e,t,n)=>{"use strict";var a=n(7971);n(7394)(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(4176));n(4321),n(6139),n(1954);var r=elementorModules.frontend.handlers.Base.extend({cache:null,cacheElements:function cacheElements(){var e=this.$element.find(".elementor-countdown-wrapper");this.cache={$countDown:e,timeInterval:null,elements:{$countdown:e.find(".elementor-countdown-wrapper"),$daysSpan:e.find(".elementor-countdown-days"),$hoursSpan:e.find(".elementor-countdown-hours"),$minutesSpan:e.find(".elementor-countdown-minutes"),$secondsSpan:e.find(".elementor-countdown-seconds"),$expireMessage:e.parent().find(".elementor-countdown-expire--message")},data:{id:this.$element.data("id"),endTime:new Date(1e3*e.data("date")),actions:e.data("expire-actions"),evergreenInterval:e.data("evergreen-interval")}}},onInit:function onInit(){elementorModules.frontend.handlers.Base.prototype.onInit.apply(this,arguments),this.cacheElements(),0<this.cache.data.evergreenInterval&&(this.cache.data.endTime=this.getEvergreenDate()),this.initializeClock()},updateClock:function updateClock(){var e=this,t=this.getTimeRemaining(this.cache.data.endTime);jQuery.each(t.parts,(function(t){var n=e.cache.elements["$"+t+"Span"],a=this.toString();1===a.length&&(a=0+a),n.length&&n.text(a)})),t.total<=0&&(clearInterval(this.cache.timeInterval),this.runActions())},initializeClock:function initializeClock(){var e=this;this.updateClock(),this.cache.timeInterval=setInterval((function(){e.updateClock()}),1e3)},runActions:function runActions(){var e=this;e.$element.trigger("countdown_expire",e.$element),this.cache.data.actions&&this.cache.data.actions.forEach((function(t){switch(t.type){case"hide":e.cache.$countDown.hide();break;case"redirect":t.redirect_url&&(window.location.href=t.redirect_url);break;case"message":e.cache.elements.$expireMessage.show()}}))},getTimeRemaining:function getTimeRemaining(e){var t=e-new Date,n=Math.floor(t/1e3%60),a=Math.floor(t/1e3/60%60),i=Math.floor(t/36e5%24),r=Math.floor(t/864e5);return(r<0||i<0||a<0)&&(n=a=i=r=0),{total:t,parts:{days:r,hours:i,minutes:a,seconds:n}}},getEvergreenDate:function getEvergreenDate(){var e=this,t=this.cache.data.id,n=this.cache.data.evergreenInterval,a=t+"-evergreen_due_date",r=t+"-evergreen_interval",o={dueDate:localStorage.getItem(a),interval:localStorage.getItem(r)},c=function initEvergreen(){var t=new Date;return e.cache.data.endTime=t.setSeconds(t.getSeconds()+n),localStorage.setItem(a,e.cache.data.endTime),localStorage.setItem(r,n),e.cache.data.endTime};return null===o.dueDate&&null===o.interval||null!==o.dueDate&&n!==(0,i.default)(o.interval,10)?c():o.dueDate>0&&(0,i.default)(o.interval,10)===n?o.dueDate:void 0}});t.default=r}}]);