芝麻web文件管理V1.00
编辑当前文件:/home/ephorei/www/wp-content/plugins/ultimate-addons-for-gutenberg/assets/js/uagb-countdown.min.js
UAGBCountdown={elements:{},countdownInterval:{},cookie_slug:uagb_countdown_data.site_name_slug,cache:{},editorInit(e,t={},o){if(!t.timeModified){const n=new Date;n.setMilliseconds(n.getMilliseconds()+6048e5),t.endDateTime=n}this.elements[e]=this.getElement(e),this.countdownInterval[e]=setInterval(()=>{this.updateCountdown(e,t,o)},1e3)},createCookie(e,t,o,n){let i="";if(o){const s=new Date;"minutes"===n?s.setTime(s.getTime()+60*o*1e3):"hours"===n?s.setTime(s.getTime()+60*o*60*1e3):s.setTime(s.getTime()+24*o*60*60*1e3),i="; expires="+s.toGMTString()}document.cookie=this.cookie_slug+"-"+e+"="+t+i+"; path=/"},getCookie(e){const t="; "+document.cookie,o=t.split("; "+this.cookie_slug+"-"+e+"=");return 2===o.length?o.pop().split(";").shift():""},init(t,o={}){if(this.elements[t]=this.getElement(t),window?.UAGBCountdownTimeSignal||(window.UAGBCountdownTimeSignal={}),window.UAGBCountdownTimeSignal[t]=!1,void 0!==this.elements[t]){if("evergreen"===o?.timerType){var e=""!==o?.campaignID&&null!==o?.campaignID?o.campaignID:o.block_id;if(this.cache.cookie=this.getCookie(e),""!==this.cache.cookie){const s=new Date;var n=Math.floor(this.cache.cookie-s.getTime()),n=s.getTime()+n;const r=new Date(n);o.endDateTime=r.toISOString().replace(/\.\d{3}Z$/,"Z")}else{o.endDateTime=this.getEvergreenEndDate(o.evergreenDays,o.evergreenHrs,o.evergreenMinutes);const a=new Date;a.setTime(a.getTime()+24*Math.floor(o.evergreenDays)*60*60*1e3),a.setTime(a.getTime()+60*Math.floor(o.evergreenHrs)*60*1e3),a.setTime(a.getTime()+60*Math.floor(o.evergreenMinutes)*1e3),this.cache.evergreen=a.getTime()+100;n=""!==o?.resetDays&&0
{this.updateCountdown(t,o,i[e])},1e3)}},changeEndTime(e,t={},o){clearInterval(this.countdownInterval[e]),void 0!==this.elements[e]&&(this.updateCountdown(e,t,o),this.countdownInterval[e]=setInterval(()=>{this.updateCountdown(e,t,o)},1e3))},getElement(e){let t=document.querySelector(e);const o=document.querySelector('iframe[name="editor-canvas"]');return t=o&&o.contentDocument?o.contentDocument.querySelector(e):t},updateCountdown(r,a,c=null){if(c){let e,t,o;const h=c.querySelector(".wp-block-uagb-countdown__time-seconds");a?.showDays&&(e=c.querySelector(".wp-block-uagb-countdown__time-days")),a?.showHours&&(t=c.querySelector(".wp-block-uagb-countdown__time-hours")),a?.showMinutes&&(o=c.querySelector(".wp-block-uagb-countdown__time-minutes"));var l=new Date,l=new Date(a.endDateTime)-l,d=l<0,u=Math.floor(l/1e3/60/60/24);let n=Math.floor(l/1e3/60/60)%24,i=Math.floor(l/1e3/60)%60,s=Math.floor(l/1e3)%60;a?.showDays||(n+=24*u),a?.showHours||(i+=60*n),a?.showMinutes||(s+=60*i),a?.showDays&&e&&(e.innerHTML=d?0:u),a?.showHours&&t&&(t.innerHTML=d?0:n),a?.showMinutes&&o&&(o.innerHTML=d?0:i),h&&(h.innerHTML=d?0:s),d&&(clearInterval(this.countdownInterval[r]),"redirect"!==a?.timerEndAction&&"hide"!==a?.timerEndAction||!a?.isFrontend||(window.UAGBCountdownTimeSignal[r]=!0));l="spectraPageReloaded_"+r,u="true"===this.getCookie(l),r=""!==a?.resetDays&&0
c.querySelector(".wp-block-uagb-countdown__box-"+e)),w=c.querySelector(".uagb-block-countdown-innerblocks-"+a.block_id);w.style.display="block",g.forEach(e=>{e&&(e.style.display="none")})}}},getEvergreenEndDate(e,t,o){const n=new Date,i=new Date(n.getTime()+60*(24*e*60+60*t+o)*1e3);return i.toISOString().replace(/\.\d{3}Z$/,"Z")}};