"use strict";var blogbull=blogbull||{};blogbull.PreLoader={init:function(){let a=document.querySelector("#wpi-preloader");a&&(a.classList.add("wpi-preloader-exit"),setTimeout(function(){a.style.display="none"},1e3))}},blogbull.currentClock={init:function(){0c?"0"+c:c,d=10>d?"0"+d:d;let f=""+b+":"+c+":"+d+" "+e+"";document.getElementsByClassName("wpi-display-clock")[0].innerHTML=f},1e3)}},blogbull.slider={init:function(){this.bannerSlider(),this.popularSlider(),this.widgetSlider()},bannerSlider:function(){new Swiper(".site-banner-hero",{slidesPerView:"1",loop:3<=document.querySelectorAll(".swiper-slide").length,spaceBetween:24,direction:"horizontal",speed:800,autoplay:{delay:5e3},navigation:{nextEl:".banner-slider-next",prevEl:".banner-slider-prev"},breakpoints:{640:{slidesPerView:2},992:{slidesPerView:3},1400:{slidesPerView:4}}})},popularSlider:function(){let a=document.querySelector(".wpi-popular-init");if(a){let b,c=a.getAttribute("data-slider")||{};c&&(b=JSON.parse(c));new Swiper(a,b)}},widgetSlider:function(){let a=document.querySelectorAll(".wpi-swiper-init");a&&a.forEach(function(a){let b=a.parentNode,c=b.querySelector(".widget-slider-next"),d=b.querySelector(".widget-slider-prev"),e=b.querySelector(".wpi-widget-pagination"),f={slidesPerView:1,loop:3<=document.querySelectorAll(".swiper-slide").length,lazyloading:!0,navigation:{nextEl:c,prevEl:d},pagination:{el:e,clickable:!0}},g=a.getAttribute("data-slider")||{};if(g)var h=JSON.parse(g);let i={...f,...h},j=new Swiper(a,i),k=a.clientWidth;500>k&&(j.params.slidesPerView=1,j.update())})}},blogbull.setBackgroundImage={init:function(){let a=document.querySelectorAll(".entry-background-image");a&&a.forEach(function(a){let b=a.querySelector("img");if(b){let c=b.getAttribute("src");c&&(a.style.backgroundImage="url("+c+")",b.style.display="none")}});let b=document.querySelectorAll(".data-bg");b.forEach(function(a){let b=a.getAttribute("data-background");b&&(a.style.backgroundImage="url("+b+")")})}},blogbull.displayClock={init:function(){0c?"0"+c:c,d=10>d?"0"+d:d;let f=""+b+":"+c+":"+d+" "+e+"";document.getElementsByClassName("wpi-current-time")[0].innerHTML=f},1e3)}},blogbull.ProgressBar={init:function(){const a=document.getElementById("progressBar");if(a){const b=document.body.scrollHeight-window.innerHeight,c=window.scrollY;a.style.width=100*(c/b)+"%",window.addEventListener("scroll",function(){const c=window.scrollY;a.style.width=100*(c/b)+"%"})}}},blogbull.scrollToTop={init:function(){(this.scrollToTopBtn=document.getElementById("scrollToTopBtn"),!!this.scrollToTopBtn)&&(this.progressCircle=document.getElementById("progressCircle"),!!this.progressCircle)&&(this.progressCircle=this.progressCircle.querySelector("circle"),this.progressCircle&&(this.radius=this.progressCircle.r.baseVal.value,this.circumference=2*Math.PI*this.radius,this.progressCircle.style.strokeDasharray=`${this.circumference} ${this.circumference}`,this.progressCircle.style.strokeDashoffset=this.circumference,window.addEventListener("scroll",this.handleScroll.bind(this)),this.scrollToTopBtn.addEventListener("click",this.scrollToTop.bind(this))))},handleScroll:function(){this.scrollToTopBtn&&this.progressCircle&&(this.scrollToTopBtn.style.display=100{const b=a.querySelectorAll(".tabbed-widget-header .tabbed-header-item"),c=a.querySelectorAll(".tabbed-widget-content .tabbed-content-item");b.forEach(d=>{d.addEventListener("click",function(){const d=this.getAttribute("tab-data");b.forEach(a=>a.classList.remove("active")),c.forEach(a=>a.classList.remove("active")),this.classList.add("active"),a.querySelector(`.content-${d}`).classList.add("active")})})})}};function blogbullDomReady(a){return"function"==typeof a?"interactive"===document.readyState||"complete"===document.readyState?a():void document.addEventListener("DOMContentLoaded",a,!1):void 0}blogbullDomReady(function(){blogbull.currentClock.init(),blogbull.slider.init(),blogbull.setBackgroundImage.init(),blogbull.displayClock.init(),blogbull.scrollToTop.init(),blogbull.tabbedWidget.init()}),window.addEventListener("load",function(){blogbull.PreLoader.init()}),window.addEventListener("scroll",function(){blogbull.ProgressBar.init()}),function(){const a="wpi-ticker-init",b=document.querySelectorAll(`.${"wpi-ticker-init"}`);if(0===b.length)return;const c=function(){b.forEach(b=>{const c=b.getAttribute("data-news-ticker-speed"),d=isNaN(parseInt(c))?8e3:parseInt(c),e=new Swiper(b,{wrapperClass:`${a}-wrapper`,slideClass:`${a}-item`,scrollbar:!1,direction:"horizontal",slidesPerView:"auto",speed:d,initialSlide:0,loop:3<=document.querySelectorAll(".swiper-slide").length,parallax:!1,spaceBetween:0,allowTouchMove:!1,waitForTransition:!1,watchSlidesProgress:!1,autoplay:{delay:0,disableOnInteraction:!1}}),f=new IntersectionObserver(a=>{a.forEach(a=>{a.isIntersecting?e.autoplay.start():e.autoplay.stop()})},{threshold:0});f.observe(b)})};document.addEventListener("DOMContentLoaded",()=>{c()})}();