1var FOXIZ_MAIN_SCRIPT=(function(Module,$){'use strict';Module.initParams=function(){this.yesStorage=this.isStorageAvailable();this.themeSettings=typeof foxizParams!=='undefined'?foxizParams:{};this.galleriesData=typeof foxizGalleriesData!=='undefined'?foxizGalleriesData:{};this.ajaxURL=typeof foxizCoreParams!=='undefined'?foxizCoreParams.ajaxurl||'':'';this.ajaxData={};this.siteAccessFlag=!1;this._document=$(document);this._body=$('body');this._window=$(window);this.html=$('html, body');this.outerHTML=$('html');this.iOS=/(iPad|iPhone|iPod)/g.test(navigator.userAgent);this.wPoint={};this.sticky={};this.eSticky={};this.YTPlayers={};this.articleData=[];this.readIndicatorPercent=0;this.isProgress=!1;this.readIndicator=$('#reading-progress');this.popupNewsletterEl=$('#rb-popup-newsletter');this.personalizeUID=(typeof FOXIZ_CORE_SCRIPT!=="undefined"&&FOXIZ_CORE_SCRIPT.personalizeUID!==undefined)?FOXIZ_CORE_SCRIPT.personalizeUID:'u0'} 2Module.init=function(){this.initParams();this.syncLayoutLike();this.topSpacing();this.siteAccessDetector();this.headerDropdown();this.mobileCollapse();this.initSubMenuPos();this.privacyTrigger();this.popupNewsletter();this.documentClick();this.backTop();this.readIndicatorInit();this.fontResizer();this.breakingNews();this.sequentialGalleryDisplay();this.sliders();this.carousels();this.liveSearch();this.personalizeBlocks();this.personalizeCategories();this.likeToggle();this.singleInfiniteLoadNext();this.loginPopup();this.popupTemplate();this.loadYoutubeIframe();this.browserResize();this.footerSlideUp();this.cartNotification();this.newsNotification();this.tocToggle();this.delayLoad();this.showPostComment();this.replyReview();this.paginationNextPrev();this.paginationLoadMore();this.paginationInfinite();this.productQuantity();this.readingCollect();this.liveBlog();this.neededReloadFuncs()} 3Module.neededReloadFuncs=function(){this.hoverTipsy();this.scrollToComment();this.usersRating();this.singleGallery();this.floatingVideo();this.videoPreview();this.floatingVideoRemove();this.scrollTableContent();this.singleScrollRefresh();this.playerAutoPlay();this.hoverEffects();this.highlightShares();this.galleryLightbox();this.singleFeaturedLightbox();this.accordion();this.resIframeClassic();this.taxBasedAccordion();this.scrollBarSlider()} 4Module.reInitAll=function(){this._window.trigger('load');this.syncLayoutLike();if(typeof FOXIZ_PERSONALIZE!=='undefined'){FOXIZ_PERSONALIZE.syncPersonalizeLayout()} 5if(typeof RB_REACTION!=='undefined'){RB_REACTION.syncReactLayout()} 6this.neededReloadFuncs();Waypoint.refreshAll()} 7Module.reloadBlockFunc=function(){this._window.trigger('load');if(typeof FOXIZ_PERSONALIZE!=='undefined'){FOXIZ_PERSONALIZE.syncLayoutBookmarks()} 8this.syncLayoutLike();this.videoPreview();this.hoverTipsy();Waypoint.refreshAll()} 9Module.initElementor=function(){if('undefined'!==typeof initDarkMode&&!FOXIZ_MAIN_SCRIPT.editorDarkModeInit){FOXIZ_MAIN_SCRIPT.editorDarkModeInit=!0;initDarkMode()} 10FOXIZ_MAIN_SCRIPT.breakingNews();FOXIZ_MAIN_SCRIPT.carousels();FOXIZ_MAIN_SCRIPT.sliders()} 11Module.isRTL=function(){return this._body.hasClass('rtl')} 12Module.animationFrame=function(callback){const func=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||this.animationFrameFallback
13func.call(window,callback)} 14Module.animationFrameFallback=function(callback){window.setTimeout(callback,1000/60)} 15Module.isStorageAvailable=function(){let storage;try{storage=window.localStorage;storage.setItem('__rbStorageSet','x');storage.removeItem('__rbStorageSet');return!0}catch(e){return!1}} 16Module.setStorage=function(key,data){this.yesStorage&&localStorage.setItem(key,typeof data==='string'?data:JSON.stringify(data))} 17Module.getStorage=function(key,defaultValue){if(!this.yesStorage)return null;const data=localStorage.getItem(key);if(data===null)return defaultValue;try{return JSON.parse(data)}catch(e){return data}} 18Module.deleteStorage=function(key){this.yesStorage&&localStorage.removeItem(key)} 19Module.SetTTLStorage=function(id,value,ttl){const data={value:value,ttl:Date.now()+ttl*3600000};this.setStorage(id,data)} 20Module.getTTLStorage=function(id){const data=this.getStorage(id);if(data&&Date.now()<=data.ttl){return data.value} 21this.deleteStorage(id);return null};Module.delayLoad=function(){const self=this;setTimeout(function(){self.stickyNavBar();self.stickyHeaderBuilder()},100)} 22Module.browserResize=function(){const self=this;self._window.on('resize',function(){self.topSpacing();self.calcSubMenuPos()})} 23Module.hoverTipsy=function(){if(!$.fn.rbTipsy){return!1} 24this._body.find('[data-copy]').rbTipsy({title:'data-copy',fade:!0,opacity:1,trigger:'hover',gravity:'s'});if(window.innerWidth>1024){this._body.find('#site-header [data-title]').rbTipsy({title:'data-title',fade:!0,opacity:1,trigger:'hover',gravity:'n'});this._body.find('.site-wrap [data-title]').rbTipsy({title:'data-title',fade:!0,opacity:1,trigger:'hover',gravity:'s'})}} 25Module.fontResizer=function(){const self=this;let size=self.yesStorage?sessionStorage.getItem('rubyResizerStep'):1;self._body.on('click','.font-resizer-trigger',function(e){e.preventDefault();e.stopPropagation();size++;if(3<size){size=1;self._body.removeClass('medium-entry-size big-entry-size')}else{if(2==size){self._body.addClass('medium-entry-size').removeClass('big-entry-size')}else{self._body.addClass('big-entry-size').removeClass('medium-entry-size')}} 26self.yesStorage&&sessionStorage.setItem('rubyResizerStep',size)})} 27Module.hoverEffects=function(){const selectors=$('.effect-fadeout');if(selectors.length===0){return} 28selectors.off('mouseenter mouseleave').on('mouseenter',function(e){e.stopPropagation();const target=$(this);if(!target.hasClass('activated')){target.addClass('activated')}}).on('mouseleave',function(){$(this).removeClass('activated')})} 29Module.videoPreview=function(){let playPromise;$('.preview-trigger').on('mouseenter',function(){const target=$(this);const wrap=target.find('.preview-video');if(!wrap.hasClass('video-added')){const video='<video preload="auto" muted loop><source src="'+wrap.data('source')+'" type="'+wrap.data('type')+'"></video>';wrap.append(video).addClass('video-added')} 30target.addClass('show-preview');wrap.css('z-index',3);const el=target.find('video')[0];if(el){playPromise=el.play()}}).on('mouseleave',function(){const target=$(this);target.find('.preview-video').css('z-index',1);const el=target.find('video')[0];if(el&&playPromise!==undefined){playPromise.then(_=>{el.pause()}).catch()}})} 31Module.playerAutoPlay=function(){const self=this;const items=$('.is-autoplay');const nonResIframe=$('.entry-content > iframe');if(items!=null&&items.length>0){items.each(function(){const el=$(this);if(!el.hasClass('is-loaded')){self.wPoint['iframe']=new Waypoint({element:el,handler:function(){const iframe=el.find('iframe');self.initAutoPlay(iframe);el.addClass('is-loaded');this.destroy()},offset:'60%'})}})} 32if(nonResIframe!=null&&nonResIframe.length>0){nonResIframe.each(function(){const el=$(this);if(!el.hasClass('is-loaded')){const iURL=el.attr('src');if(iURL.indexOf('youtube.com')>0||iURL.indexOf('youtu.be')>0||iURL.indexOf('vimeo.com')>0){el.wrap('<div class="rb-ires is-loaded"></div>')}}})}} 33Module.initAutoPlay=function(item){if(item.length>0&&undefined!==item[0]){const src=item[0].src;if(src.indexOf('?')>-1){item[0].src+="&autoplay=1"}else{item[0].src+="?autoplay=1"}}} 34Module.tocToggle=function(){this._document.on('click','.toc-toggle',function(e){e.preventDefault();e.stopPropagation();const target=$(this);const content=target.parents('.ruby-table-contents').find('.toc-content');content.toggle(200);target.toggleClass('activate')}
34)};Module.headerDropdown=function(){const self=this;$('.more-trigger').on('click',function(e){e.preventDefault();e.stopPropagation();self.calcSubMenuPos();const target=$(this);const holder=target.parents('.header-wrap').find('.more-section-outer');if(!holder.hasClass('dropdown-activated')){self._body.find('.dropdown-activated').removeClass('dropdown-activated');holder.addClass('dropdown-activated')}else{holder.removeClass('dropdown-activated')} 35if(target.hasClass('search-btn')){setTimeout(function(){holder.find('input[type="text"]').focus()},150)} 36return!1});$('.search-trigger').on('click',function(e){e.preventDefault();e.stopPropagation();const holder=$(this).parent('.header-dropdown-outer');if(!holder.hasClass('dropdown-activated')){self._body.find('.dropdown-activated').removeClass('dropdown-activated');holder.addClass('dropdown-activated');setTimeout(function(){holder.find('input[type="text"]').focus()},150)}else{holder.removeClass('dropdown-activated')} 37return!1});$('.dropdown-trigger').on('click',function(e){e.preventDefault();e.stopPropagation();const holder=$(this).parent('.header-dropdown-outer');if(!holder.hasClass('dropdown-activated')){self._body.find('.dropdown-activated').removeClass('dropdown-activated');holder.addClass('dropdown-activated')}else{holder.removeClass('dropdown-activated')}})} 38Module.topSpacing=function(){const self=this;if(self._body.hasClass('top-spacing')){const height=$('.top-site-ad').outerHeight();$('.site-outer').css('margin-top',height)}} 39Module.documentClick=function(){const self=this;const wrapper=$('.more-section-outer, .header-dropdown-outer, .mobile-collapse, .mfp-wrap');const inlineSearchForm=$('.is-form-layout');document.addEventListener('click',function(e){if(!wrapper.is(e.target)&&wrapper.has(e.target).length===0){wrapper.removeClass('dropdown-activated');self.outerHTML.removeClass('collapse-activated')} 40if(!inlineSearchForm.is(e.target)&&inlineSearchForm.has(e.target).length===0){inlineSearchForm.find('.live-search-response').fadeOut(500)}})} 41Module.initSubMenuPos=function(){const self=this;let trigger=!1;setTimeout(function(){self.calcSubMenuPos()},1000);$('.menu-has-child-mega').on('mouseenter',function(){if(!trigger){self.calcSubMenuPos()} 42trigger=!0})} 43Module.calcSubMenuPos=function(){if(window.outerWidth<1025){return!1} 44const self=this;const megaParents=$('.menu-has-child-mega');const headerWrapper=$('#site-header');if(megaParents.length>0){megaParents.each(function(){const item=$(this);item.find('.mega-dropdown').css({'width':self._body.width(),'left':-item.offset().left,});item.addClass('mega-menu-loaded')})} 45if(headerWrapper.length>0){let headerLeftOffset=headerWrapper.offset().left;let headerWidth=headerWrapper.width();let headerRightOffset=headerLeftOffset+headerWidth;const flexDropdown=$('.flex-dropdown');const subElements=$('ul.sub-menu');if(subElements.length>0){subElements.each(function(){const item=$(this);let itemLeftOffset=item.offset().left;let itemRightOffset=itemLeftOffset+item.width()+100;if(itemRightOffset>headerRightOffset){item.addClass('left-direction')}})} 46if(flexDropdown.length>0){flexDropdown.each(function(){const item=$(this);const parentItem=item.parent();if(parentItem.hasClass('is-child-wide')||item.hasClass('mega-has-left')){return} 47const itemWidth=item.width();const itemHalfWidth=itemWidth/2;const parentItemOffset=parentItem.offset().left;const parentHalfWidth=parentItem.width()/2;const parentItemCenterOffset=parentItemOffset+parentHalfWidth;const rightSpacing=headerRightOffset-parentItemCenterOffset;const leftSpacing=parentItemCenterOffset-headerLeftOffset;if(itemWidth>=headerWidth){item.css({'width':headerWidth-2,'left':-parentItemOffset})}else if(itemHalfWidth>rightSpacing){item.css({'right':-rightSpacing+parentHalfWidth+1,'left':'auto',})}else if(itemHalfWidth>leftSpacing){item.css({'left':-leftSpacing+parentHalfWidth+1,'right':'auto',})}else{item.css({'right':'auto','left':-itemHalfWidth+parentHalfWidth,})}})}}} 48Module.stickyNavBar=function(){const self=this;if(self._body.hasClass('elementor-editor-active')){return!1} 49self.sticky.section=$('#sticky-holder');self.sticky.outer=$('#navbar-outer');if((!self._body.hasClass('is-mstick')&&!self._body.hasClass('yes-tstick'))||self.sticky.outer.length<1||self.sticky.section.length<1){return!1} 50self.sticky.smartSticky=!!self._body.hasClass('is-smart-sticky');self.sticky.isSticky=!1;self.sticky.lastScroll=0;if(self._body.hasClass('yes-tstick')){self.sticky.isTitleSticky=!0}else{self.sticky.isTitleSticky=0} 51self.sticky.additionalOffset=200;if(window.innerWidth>1024){if(self.sticky.isTitleSticky){self.sticky.additionalOffset=450}else{self.sticky.additionalOffset=0}} 52if(self._body.hasClass('admin-bar')){self.sticky.adminBarSpacing=32}else{self.sticky.adminBarSpacing=0} 53self.sticky.topOffset=self.sticky.section.offset().top;self.sticky.stickySectionHeight=self.sticky.section.outerHeight();self.sticky.outer.css('min-height',self.sticky.outer.outerHeight());self.sticky.activatePos=self.sticky.topOffset+1+self.sticky.stickySectionHeight+self.sticky.additionalOffset;self.sticky.deactivePos=self.sticky.topOffset-self.sticky.adminBarSpacing+self.sticky.additionalOffset;if(window.addEventListener){if(self.sticky.smartSticky){window.addEventListener('scroll',function(){self.animationFrame(self.initSmartStickyNavBar.bind(self))},!1)}else{window.addEventListener('scroll',function(){self.animationFrame(self.initStickyNavBar.bind(self))},!1)}} 54self._window.on('unstickMenu',function(){self.sticky.outer.css('min-height',self.sticky.outer.outerHeight());self.sticky.stickySectionHeight=self.sticky.section.outerHeight();self.sticky.topOffset=self.sticky.section.offset().top;self.sticky.activatePos=self.sticky.topOffset+1+self.sticky.stickySectionHeight+self.sticky.additionalOffset;self.sticky.deactivePos=self.sticky.topOffset-self.sticky.adminBarSpacing+self.sticky.additionalOffset})} 55Module.initStickyNavBar=function(){const self=this;const scroll=self._window.scrollTop();if(!self.sticky.isSticky&&scroll>self.sticky.activatePos){self.sticky.isSticky=!0;self._body.addClass('stick-animated sticky-on');self.sticky.stickAnimatedTimeout=setTimeout(function(){self._body.removeClass('stick-animated')},200)}else if(self.sticky.isSticky&&scroll<=self.sticky.deactivePos){self.sticky.isSticky=!1;self._body.removeClass('sticky-on stick-animated');self._window.trigger('unstickMenu')}} 56Module.initSmartStickyNavBar=function(){const self=this;const scroll=self._window.scrollTop();if(!self.sticky.isSticky&&scroll>self.sticky.activatePos&&scroll<self.sticky.lastScroll){self.sticky.isSticky=!0;self._body.addClass('stick-animated sticky-on');self.sticky.stickAnimatedTimeout=setTimeout(function(){self._body.removeClass('stick-animated')},200)}else if(self.sticky.isSticky&&(scroll<=self.sticky.deactivePos||scroll>self.sticky.lastScroll)){self.sticky.isSticky=!1;self._body.removeClass('sticky-on stick-animated');
56if(scroll<=self.sticky.deactivePos){self._window.trigger('unstickESection')}} 57self.sticky.lastScroll=scroll} 58Module.stickyHeaderBuilder=function(){const self=this;if(self._body.hasClass('elementor-editor-active')){return!1} 59let stickySection=$('.header-template .e-section-sticky').first();const hasTitleSticky=$('body.single-post #s-title-sticky').first();if(stickySection.length<1){return!1} 60if(hasTitleSticky.length>0){self._body.addClass('yes-tstick');self.eSticky.isTitleSticky=!0}else{self.eSticky.isTitleSticky=0} 61self.eSticky.additionalOffset=200;if(window.innerWidth>1024){if(self.eSticky.isTitleSticky){self.eSticky.additionalOffset=450}else{self.eSticky.additionalOffset=0}} 62self.eSticky.smartSticky=!!stickySection.hasClass('is-smart-sticky');if(window.innerWidth<=1024){stickySection.removeClass('e-section-sticky');stickySection=$('#header-template-holder').addClass('e-section-sticky')} 63self.eSticky.section=stickySection;self.eSticky.outer=stickySection.parent();self.eSticky.adminBarSpacing=0;self.eSticky.isSticky=!1;self.eSticky.lastScroll=0;self.eSticky.stickySectionHeight=stickySection.outerHeight();self.eSticky.topOffset=stickySection.offset().top;if(self._body.hasClass('admin-bar')){self.eSticky.adminBarSpacing=32} 64self.eSticky.outer.css('min-height',self.eSticky.outer.outerHeight());self.eSticky.activatePos=self.eSticky.topOffset+1+self.eSticky.stickySectionHeight+self.eSticky.additionalOffset;self.eSticky.deactivePos=self.eSticky.topOffset-self.eSticky.adminBarSpacing+self.eSticky.additionalOffset;if(window.addEventListener){if(self.eSticky.smartSticky){window.addEventListener('scroll',function(){self.animationFrame(self.initSmartStickyESection.bind(self))},!1)}else{window.addEventListener('scroll',function(){self.animationFrame(self.initStickyESection.bind(self))},!1)}} 65self._window.on('unstickESection',function(){self.eSticky.outer.css('min-height',self.eSticky.outer.outerHeight());self.eSticky.stickySectionHeight=self.eSticky.section.outerHeight();self.eSticky.topOffset=self.eSticky.section.offset().top;self.eSticky.activatePos=self.eSticky.topOffset+1+self.eSticky.stickySectionHeight+self.eSticky.additionalOffset;self.eSticky.deactivePos=self.eSticky.topOffset-self.eSticky.adminBarSpacing+self.eSticky.additionalOffset})} 66Module.initStickyESection=function(){const self=this;const scroll=self._window.scrollTop();if(!self.eSticky.isSticky&&scroll>self.eSticky.activatePos){self.eSticky.isSticky=!0;self._body.addClass('stick-animated sticky-on');self.eSticky.stickAnimatedTimeout=setTimeout(function(){self._body.removeClass('stick-animated')},200)}else if(self.eSticky.isSticky&&scroll<=self.eSticky.deactivePos){self.eSticky.isSticky=!1;self._body.removeClass('sticky-on stick-animated');self._window.trigger('unstickESection')}} 67Module.initSmartStickyESection=function(){const self=this;const scroll=self._window.scrollTop();if(!self.eSticky.isSticky&&scroll>self.eSticky.activatePos&&scroll<self.eSticky.lastScroll){self.eSticky.isSticky=!0;self._body.addClass('stick-animated sticky-on');self.eSticky.stickAnimatedTimeout=setTimeout(function(){self._body.removeClass('stick-animated')},200)}else if(self.eSticky.isSticky&&(scroll<=self.eSticky.deactivePos||scroll>self.eSticky.lastScroll)){self.eSticky.isSticky=!1;self._body.removeClass('sticky-on stick-animated');if(scroll<=self.eSticky.deactivePos){self._window.trigger('unstickESection')}} 68self.eSticky.lastScroll=scroll} 69Module.mobileCollapse=function(){const self=this;const $mobileMenuTrigger=$('.mobile-menu-trigger');const $outerHTML=self.outerHTML;const $mobileSearchForm=$outerHTML.find('.mobile-search-form input[type="text"]');$mobileMenuTrigger.on('click',function(e){e.preventDefault();e.stopPropagation();const target=$(this);if(target.hasClass('mobile-search-icon')){setTimeout(function(){$mobileSearchForm.focus()},100)} 70const isCollapseActivated=$outerHTML.hasClass('collapse-activated');$outerHTML.toggleClass('collapse-activated',!isCollapseActivated)})} 71Module.privacyTrigger=function(){const self=this;$('#privacy-trigger').on('click',function(e){e.preventDefault();e.stopPropagation();self.setStorage('RubyPrivacyAllowed','1');
71$('#rb-privacy').slideUp(200,function(){$(this).remove()});return!1})} 72Module.backTop=function(){if(this._body.hasClass('is-backtop')){$().UItoTop({text:'<i class="rbi rbi-darrow-top"></i>',})}} 73Module.loginPopup=function(){const self=this;const form=$('#rb-user-popup-form');if(form.length<1){return!1} 74this._document.on('click','.login-toggle',(e)=>{e.preventDefault();e.stopPropagation();$.magnificPopup.open({type:'inline',preloader:!1,removalDelay:400,showCloseBtn:!0,closeBtnInside:!0,closeOnBgClick:!1,items:{src:form,type:'inline'},mainClass:'rb-popup-center',closeMarkup:'<span class="close-popup-btn mfp-close"><span class="close-icon"></span></span>',fixedBgPos:!0,fixedContentPos:!0,callbacks:{open:()=>self.reloadCaptchaPopups()}})})};Module.popupTemplate=function(){const templateCache={};this._document.on('click','.popup-trigger-btn',(e)=>{e.preventDefault();e.stopPropagation();const target=$(e.target);const templateID=target.data('trigger')||'';const position=target.data('position')||'';if(!templateCache[templateID]){const template=$(`#tmpl-${templateID}`);if(template.length===0){return} 75templateCache[templateID]=template.html()} 76$.magnificPopup.open({type:'inline',preloader:!1,removalDelay:400,showCloseBtn:!0,closeBtnInside:!0,closeOnBgClick:!0,allowHTMLInTemplate:!0,items:{src:templateCache[templateID],type:'inline'},mainClass:`is-template-popup popup-${templateID} ${position}`,closeMarkup:'<span class="close-popup-btn mfp-close"><span class="close-icon"></span></span>',fixedBgPos:!0,fixedContentPos:!0,callbacks:{open:()=>self.reloadCaptchaPopups()},})})};Module.popupNewsletter=function(){const self=this;if(self.popupNewsletterEl.length>0){const display=self.popupNewsletterEl.data('display');self.newsletterExpired=self.popupNewsletterEl.data('expired');self.newsletterDisplayOffset=self.popupNewsletterEl.data('offset');const delay=self.popupNewsletterEl.data('delay');const oldExpired=self.getStorage('RubyNewsletterExpired');if(self.newsletterExpired===0){self.deleteStorage('RubyNewsletter')} 77if(!oldExpired||self.newsletterExpired!==oldExpired){self.setStorage('RubyNewsletterExpired',self.newsletterExpired);self.deleteStorage('RubyNewsletter')} 78if(!self.getTTLStorage('RubyNewsletter')){if(!display||'scroll'===display){if(window.addEventListener){window.addEventListener('scroll',function(){self.animationFrame(self.scrollPopupNewsletter.bind(self))},!1)}}else{setTimeout(function(){self.popupNewsletterInit()},delay)}}}} 79Module.scrollPopupNewsletter=function(){const self=this;if(!self.newsletterPopupFlag&&self._window.scrollTop()>self.newsletterDisplayOffset){self.newsletterPopupFlag=!0;self.popupNewsletterInit()}} 80Module.popupNewsletterInit=function(){const self=this;if(self.siteAccessFlag){return} 81if(!self.popupNewsletterEl.hasClass('is-pos-fixed')){$.magnificPopup.open({type:'inline',preloader:!1,closeBtnInside:!0,removalDelay:400,showCloseBtn:!0,closeOnBgClick:!1,disableOn:1024,items:{src:'#rb-popup-newsletter',type:'inline'},mainClass:'rb-popup-center',fixedBgPos:!0,fixedContentPos:!0,closeMarkup:'<span class="close-popup-btn mfp-close"><span class="close-icon"></span></span>',callbacks:{open:()=>self.reloadCaptchaPopups(),close:function(){if(self.siteAccessFlag){return} 82self.SetTTLStorage('RubyNewsletter',1,self.newsletterExpired*24)}}})}else{self.popupNewsletterEl.removeClass('is-hidden');setTimeout(()=>{self.popupNewsletterEl.addClass('yes-show')},10);const closeBtn=self.popupNewsletterEl.find('.close-popup-btn');closeBtn.on('click',function(){self.SetTTLStorage('RubyNewsletter',1,self.newsletterExpired*24);self.popupNewsletterEl.removeClass('yes-show');setTimeout(()=>{self.popupNewsletterEl.addClass('is-hidden')},400)})}} 83Module.footerSlideUp=function(){const target=$('#footer-slideup');if(target.length>0){const self=this;self.footerSlideUpExpired=target.data('expired');const delay=target.data('delay');const oldExpired=self.getStorage('footerSlideUpExpired');if(!oldExpired||self.footerSlideUpExpired!=oldExpired){self.setStorage('footerSlideUpExpired',self.footerSlideUpExpired);self.deleteStorage('footerSlideUp')} 84if(!self.getTTLStorage('footerSlideUp')){setTimeout(function(){self.footerSlideUpInit()},delay)} 85setTimeout(function(){self.footerSlideUpToggle()},delay)}} 86Module.footerSlideUpToggle=function(){const self=this;$('.slideup-toggle').off('click').on('click',function(e){e.preventDefault();e.stopPropagation();self.footerSlideUpInit();return!1})} 87Module.footerSlideUpInit=function(){if(this._body.hasClass('yes-f-slideup')){this._body.removeClass('yes-f-slideup');this.SetTTLStorage('footerSlideUp',1,this.footerSlideUpExpired*24)}else{this._body.addClass('yes-f-slideup');this.deleteStorage('footerSlideUp')}} 88Module.loadYoutubeIframe=function(){const self=this;const blockPlaylist=$('.yt-playlist');if(blockPlaylist.length>0){const tag=document.createElement('script');tag.src="//www.youtube.com/iframe_api";const firstScriptTag=document.getElementsByTagName('script')[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag)} 89window.onYouTubeIframeAPIReady=function(){$('.yt-playlist').each(function(){const target=$(this);const iframe=target.find('.yt-player');const videoID=target.data('id');const blockID=target.data('block');self.YTPlayers[blockID]=new YT.Player(iframe.get(0),{height:'540',width:'960',videoId:videoID,events:{'onReady':self.videoPlayToggle,'onStateChange':self.videoPlayToggle}})});$('.plist-item').on('click',function(e){e.preventDefault();e.stopPropagation();const target=$(this);const wrapper=target.closest('.yt-playlist');const currentBlockID=wrapper.data('block');const videoID=target.data('id');const title=target.find('.plist-item-title').text();const meta=target.data('index');
89Object.keys(self.YTPlayers).forEach(function(id){self.YTPlayers[id].pauseVideo()});self.YTPlayers[currentBlockID].loadVideoById({'videoId':videoID});wrapper.find('.yt-trigger').addClass('is-playing');wrapper.find('.play-title').hide().text(title).fadeIn(200);wrapper.find('.video-index').text(meta)})}} 90Module.videoPlayToggle=function(){const players=FOXIZ_MAIN_SCRIPT.YTPlayers;$('.yt-trigger').on('click',function(e){e.preventDefault();e.stopPropagation();const target=$(this);const currentBlockID=target.closest('.yt-playlist').data('block');const currentState=players[currentBlockID].getPlayerState();const isPlaying=[1,3].includes(currentState);if(!isPlaying){players[currentBlockID].playVideo();target.addClass('is-playing')}else{players[currentBlockID].pauseVideo();target.removeClass('is-playing')}})} 91Module.showPostComment=function(){const self=this;this._document.on('click','.smeta-sec .meta-comment',function(e){e.stopPropagation();const commentBtn=$('.show-post-comment');if(commentBtn.length>0){self.html.animate({scrollTop:commentBtn.offset().top},300);commentBtn.trigger('click')}});this._document.on('click','.show-post-comment',function(e){e.preventDefault();e.stopPropagation();const target=$(this);const wrap=target.parent();target.fadeOut(200,function(){target.remove();wrap.find('.is-invisible').removeClass('is-invisible');wrap.next('.comment-holder').removeClass('is-hidden')})})} 92Module.scrollTableContent=function(){const self=this;const behavior=self._body.hasClass('toc-smooth')?'smooth':'instant';self._document.on('click','.anchor-link',function(e){e.stopPropagation();const targetClass=$(this).data('index');if(!targetClass)return;let $scrollElement=$(`.${targetClass}`);if(!$scrollElement.length){const $parentContainer=$(this).closest('.s-ct');if($parentContainer.length){$scrollElement=$parentContainer.find('.restrict-box, .continue-reading-btn').first()}} 93if(!$scrollElement.length)return;setTimeout(()=>{window.scrollTo({top:$scrollElement.offset().top,behavior:behavior,})},10)})};Module.scrollToComment=function(){const self=this;const hash=window.location.hash;if(hash==='#respond'||hash.startsWith('#comment')){const commentBtn=$('.show-post-comment').first();if(commentBtn.length===0){return} 94self.html.animate({scrollTop:commentBtn.offset().top-200},400);commentBtn.trigger('click')}} 95Module.replyReview=function(){this._document.on('click','.comment-reply-link',function(){const target=$(this);const wrapper=target.parents('.rb-reviews-area');const cancelLink=$('#cancel-comment-reply-link');if(wrapper.length>0){wrapper.find('.rb-form-rating').addClass('is-hidden');cancelLink.on('click',function(){wrapper.find('.rb-form-rating').removeClass('is-hidden')})}})} 96Module.usersRating=function(){const self=this;const reviewsForm=self._body.find('.rb-reviews-form');if(reviewsForm.length>0){reviewsForm.each(function(){const reviewForm=$(this);if(!reviewForm.hasClass('is-loaded')){reviewForm.addClass('is-loaded');const ratingForm=reviewForm.find('.rb-form-rating');const selection=reviewForm.find('.rb-rating-selection');const text=reviewForm.find('.rating-alert').html();let ratingValue=null;selection.val('');selection.hide();selection.before('<div class="rb-review-stars">\ 97 <span>\ 98 <a class="star" data-rating="1" href="#"><i class="rbi rbi-star-o"></i></a>\ 99 <a class="star" data-rating="2" href="#"><i class="rbi rbi-star-o"></i></a>\ 100 <a class="star" data-rating="3" href="#"><i class="rbi rbi-star-o"></i></a>\ 101 <a class="star" data-rating="4" href="#"><i class="rbi rbi-star-o"></i></a>\ 102 <a class="star" data-rating="5" href="#"><i class="rbi rbi-star-o"></i></a>\ 103 </span>\ 104 </div>');ratingForm.on('click','a.star',function(e){e.preventDefault();e.stopPropagation();const star=$(this);ratingValue=star.data('rating');star.siblings('a').removeClass('active');star.addClass('active');ratingForm.addClass('selected')});reviewForm.on('click','#respond #submit',function(){selection.val(ratingValue);if(!selection.val()){window.alert(text);return!1}})}})}} 105Module.readIndicatorInit=function(){const self=this;if(!self._body.hasClass('single')||self.readIndicator.length<1){return!1} 106let content=$('.entry-content').first();if(!content.length)return!1;self.indicatorTop=content.offset().top;self.indicatorHeight=content.outerHeight(!0)-self._window.height();setTimeout(function(){self.indicatorTop=content.offset().top;self.indicatorHeight=content.outerHeight(!0)-self._window.height()},1000) 107if(window.addEventListener){window.addEventListener('scroll',function(){self.animationFrame(self.readIndicatorCalc.bind(self))},!1)}} 108Module.readIndicatorCalc=function(){const self=this;const scroll=self._window.scrollTop();self.readIndicatorPercent=Math.min(((scroll-self.indicatorTop)/self.indicatorHeight)*100,100);if(self.readIndicatorPercent<=100){self.readIndicator.css('width',self.readIndicatorPercent+'%')}} 109Module.breakingNews=function(){const self=this;const breakingNews=$('.breaking-news-slider') 110if(breakingNews.length<1){return!1} 111breakingNews.each(function(){const el=$(this);let params={slidesPerView:1,loop:!0,} 112if(el.data('play')){params.autoplay={delay:el.data('speed')||self.themeSettings.sliderSpeed,stopOnLastSlide:!1,disableOnInteraction:self.isElementorEditor?!0:(window.outerWidth<1025),pauseOnMouseEnter:!0}} 113params.navigation={nextEl:el.find('.breaking-news-next')[0],prevEl:el.find('.breaking-news-prev')[0]} 114new RBSwiper(this,params)})} 115Module.sliders=function(){const self=this;const sliders=$('.post-slider');if(sliders.length<1){return!1} 116sliders.each(function(){const slider=$(this);let params={grabCursor:!0,allowTouchMove:!0,effect:self.themeSettings.sliderEffect,loop:!0,} 117if(slider.data('play')){params.autoplay={delay:slider.data('speed')||self.themeSettings.sliderSpeed,stopOnLastSlide:!0,disableOnInteraction:self.isElementorEditor?!0:(window.outerWidth<1025),pauseOnMouseEnter:!0}} 118params.pagination={el:slider.find('.slider-pagination')[0],clickable:!0,};params.navigation={nextEl:slider.find('.slider-next')[0],prevEl:slider.find('.slider-prev')[0]} 119new RBSwiper(this,params)})} 120Module.carousels=function(){const self=this;const carousels=$('.post-carousel');if(carousels.length<1){return!1} 121carousels.each(function(){const carousel=$(this);let params={grabCursor:!0,allowTouchMove:!0,freeMode:!1,loop:!0} 122params.slidesPerView=carousel.data('mcol');params.spaceBetween=carousel.data('mgap');params.centeredSlides=carousel.data('centered');params.navigation={nextEl:carousel.find('.slider-next')[0],prevEl:carousel.find('.slider-prev')[0]} 123if(carousel.find('.slider-pagination')[0]){params.pagination={el:carou
123sel.find('.slider-pagination')[0],type:'bullets',clickable:!0,}} 124if(carousel.data('play')){params.autoplay={delay:carousel.data('speed')||self.themeSettings.sliderSpeed,stopOnLastSlide:!1,disableOnInteraction:self.isElementorEditor?!0:(window.outerWidth<1025),pauseOnMouseEnter:!0}} 125if(carousel.data('fmode')){params.freeMode=!0} 126params.breakpoints={768:{slidesPerView:carousel.data('tcol'),spaceBetween:carousel.data('tgap')},1025:{slidesPerView:carousel.data('col'),spaceBetween:carousel.data('gap')},1500:{slidesPerView:carousel.data('wcol'),spaceBetween:carousel.data('gap')}};params.on={afterInit:function(swiper){const wrap=$(swiper.$wrapperEl);$(swiper.$wrapperEl).find('.p-box').css('height',wrap.height())},resize:function(swiper){const wrap=$(swiper.$wrapperEl);$(swiper.$wrapperEl).find('.p-box').css('height',wrap.height())},};new RBSwiper(this,params)})} 127Module.singleGallery=function(){const self=this;const gallerySections=self._body.find('.featured-gallery-wrap');if(gallerySections.length===0){return} 128gallerySections.each(function(){const section=$(this);if(!section.hasClass('is-loaded')){const index=section.data('gallery');const sliderEl=section.find('.gallery-slider').attr('id');const sliderNavEl=section.find('.gallery-slider-nav').attr('id');const carouselEl=section.find('.gallery-carousel').attr('id');const coverflowEL=section.find('.gallery-coverflow').attr('id');if(sliderEl&&sliderNavEl){const navEl=$('#'+sliderNavEl);const navSlidesCount=navEl.find('.swiper-slide').length;const shouldLoopNav=navSlidesCount>=6;const viewSlides=Math.min(navSlidesCount,6);if(!shouldLoopNav){navEl.css('max-width',`${navSlidesCount * 125}px`)} 129const galleryNav=new RBSwiper('#'+sliderNavEl,{spaceBetween:15,slidesPerView:viewSlides,freeMode:self.themeSettings.sliderFMode,grabCursor:!0,loop:shouldLoopNav,watchSlidesVisibility:shouldLoopNav,watchSlidesProgress:!0,on:{init:function(){$(this.$wrapperEl).removeClass('pre-load')},},});const gallerySlider=new RBSwiper('#'+sliderEl,{spaceBetween:0,grabCursor:!0,loop:!0,pagination:{el:'.swiper-pagination-'+index,type:'progressbar',clickable:!0,},on:{init:function(){section.addClass('is-loaded')},},thumbs:{swiper:galleryNav}});gallerySlider.on('slideChange',function(){const index=this.activeIndex;if(index){const label=$(this.$el).next().find('.current-slider-count');label.fadeOut(0,function(){$(this).html(index<=label.data('total')?index:1).fadeIn(50)})}})} 130if('undefined'!==typeof carouselEl){new RBSwiper('#'+carouselEl,{spaceBetween:20,slidesPerView:'auto',freeMode:self.themeSettings.sliderFMode,loop:!1,grabCursor:!0,scrollbar:{el:'.swiper-scrollbar-'+index,hide:!0,},on:{init:function(){$(this.$wrapperEl).removeClass('pre-load');section.addClass('is-loaded')},},})} 131if('undefined'!==typeof coverflowEL){new RBSwiper('#'+coverflowEL,{effect:"coverflow",grabCursor:!0,centeredSlides:!0,slidesPerView:1.2,coverflowEffect:{rotate:50,stretch:0,depth:250,modifier:1,slideShadows:!0,},breakpoints:{768:{slidesPerView:3}},on:{init:function(){$(this.$wrapperEl).removeClass('pre-load');section.addClass('is-loaded')},},pagination:{el:'.swiper-pagination-'+index,clickable:!0,},})}}})} 132Module.scrollBarSlider=function(){const self=this;const items=$('.gb-slider-scrollbar');if(!items.length)return;items.each(function(index,itemEl){if($(itemEl).hasClass('is-loaded'))return;const autoplay=$(itemEl).data('autoplay')===1;const caption=$(itemEl).closest('.gb-image-slider').find('.gb-image-caption');const scrollbarEl=$(itemEl).find('.swiper-scrollbar')[0];$(itemEl).find('.swiper-wrapper').children().addClass('swiper-slide');const updateCaption=(swiper)=>{const captionText=$(swiper.slides[swiper.activeIndex]).find('.wp-element-caption').html()||'';caption.fadeOut(150,()=>caption.html(captionText).fadeIn(200))};new RBSwiper(itemEl,{slidesPerView:1,loop:!1,grabCursor:!0,autoplay:autoplay?{delay:self.themeSettings.sliderSpeed||5000,disableOnInteraction:self.isElementorEditor?!0:window.outerWidth<1025,}:!1,scrollbar:{el:scrollbarEl,hide:!1,},on:{init(){$(itemEl).removeClass('pre-load').addClass('is-loaded');updateCaption(this)},slideChange(){updateCaption(this)},},})})};Module.highlightShares=function(){const self=this;if(!self.themeSettings.highlightShares||(window.matchMedia&&window.matchMedia('(pointer: coarse)').matches)){return} 133const config={selectableElements:['.is-highlight-shares'],twitterUsername:self.themeSettings.twitterName,facebook:!!self.themeSettings.highlightShareFacebook,twitter:!!self.themeSettings.highlightShareTwitter};const extra=self.themeSettings.highlightShareReddit?[{icon:'<i class="rbi rbi-reddit"></i>',url:'https://reddit.com/submit?url=PAGE_URL&title=TEXT_SELECTION'}]:[];Sharect.config(config).appendCustomShareButtons(extra).init()} 134Module.floatingVideo=function(){const self=this;const floating=$('.floating-video').not('.is-loaded');if(floating.length===0||window.outerWidth<1025){return!1} 135self.wPoint['Floating']=new Waypoint({element:floating,offset:-floating.height(),handler:function(direction){self._body.find('.floating-video').addClass('is-loaded').removeClass('floating-activated');self._body.find('.floating-close').remove();if('down'==direction){this.element.addClass(' floating-activated');this.element.find('.float-holder').prepend('<a class="floating-close close-popup-btn" href="#"><span class="close-icon"></span></a>')}}})} 136Module.floatingVideoRemove=function(){const self=this;self._body.on('click','.floating-close',function(e){e.preventDefault();e.stopPropagation();self._body.find('.floating-video').removeClass('floating-activated');self.wPoint['Floating'].destroy()})} 137Module.siteAccessDetector=function(){const self=this;const method=self.themeSettings?.adDetectorMethod;if(!method||self.siteAccessFlag||self.crwDetect()){return} 138setTimeout(()=>{if(self.siteAccessFlag)return;switch(parseInt(method)){case 1:self.baitElementDetector();break;case 2:self.externalScriptDetector();break;case 3:self.combinedDetector();break}},1500)};Module.baitElementDetector=function(){const self=this;const bait=self.createBaitElement();document.body.appendChild(bait);setTimeout(()=>{const isBlocked=self.checkBaitElement(bait);bait.remove();if(isBlocked){self.siteAccessFlag=!0;$.magnificPopup.close();setTimeout(()=>{self.siteAccessNotification()},200)}},100)};Module.externalScriptDetector=function(){const self=this;const testUrl='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';const script=document.createElement('script');script.src=testUrl;script.async=!0;let completed=!1;const complete=(blocked)=>{if(completed)return;completed=!0;script.remove();if(blocked){self.siteAccessFlag=!0;$.magnificPopup.close();setTimeout(()=>{self.siteAccessNotification()},200)}};script.onerror=()=>complete(!0);script.onload=()=>complete(!1);setTimeout(()=>complete(!0),5000);document.head.appendChild(script)};Module.combinedDetector=function(){const self=this;const bait=self.createBaitElement();document.body.appendChild(bait);setTimeout(()=>{const baitBlocked=self.checkBaitElement(bait);bait.remove();if(baitBlocked){self.siteAccessFlag=!0;$.magnificPopup.close();setTimeout(()=>{self.siteAccessNotification()},200);return} 139self.externalScriptDetector()},100)};Module.createBaitElement=function(){const container=document.createElement('div');container.id='rb-adcheck';container.setAttribute('aria-hidden','true');container.style.cssText='position:absolute;bottom:0;left:0;z-index:-1;pointer-events:none;overflow:hidden;';const inner=document.createElement('div');inner.id='google_ads_iframe_test';inner.className='adsbygoogle ad-slot adbanner ads-banner banner_ad ad-placeholder pub_300x250 textads adsbox';inner.setAttribute('data-ad-slot','test');inner.style.cssText='width:300px;height:250px;background:transparent;';container.appendChild(inner);return container};Module.checkBaitElement=function(container){const inner=container.querySelector('.adsbygoogle');if(!inner||!document.body.contains(inner)){return!0} 140const style=window.getComputedStyle(inner);const rect=inner.getBoundingClientRect();return(rect.height<1||rect.width<1||style.display==='none'||style.visibility==='hidden'||parseFloat(style.opacity)===0||inner.offsetParent===null)};Module.siteAccessNotification=function(){$.magnificPopup.open({type:'inline',preloader:!1,showCloseBtn:!1,closeBtnInside:!1,enableEscapeKey:!1,closeOnBgClick:!1,removalDelay:9999999,items:{src:$('#tmpl-rb-site-access').html(),type:'inline'},mainClass:'rb-popup-center site-access-popup',fixedBgPos:!0,fixedContentPos:!0,});window.addEventListener('contextmenu',event=>event.preventDefault())} 141Module.galleryLightbox=function(){const self=this;if(!self.galleriesData){return} 142$('.gallery-popup-trigger').on('click',function(e){e.preventDefault();e.stopPropagation();const target=$(this);const slideIndex=target.data('index');$.magnificPopup.open({type:'inline',mainClass:'rb-gallery-popup rb-popup-center',closeMarkup:'<button title="%title%" class="mfp-close mfp-button"><i class="rbi rbi-close"></i></button>',closeOnBgClick:!1,removalDelay:400,showCloseBtn:!0,fixedBgPos:!0,fixedContentPos:!0,preloader:!1,gallery:{enabled:!0,preload:[0,2],arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-button mfp-arrow-%dir%"><i class="rbi rbi-%dir%"></i></button>',tCounter:'<span>%curr% / %total%</span>'},callbacks:{open:function(){let itemsArray=Object.values(self.galleriesData);let targetIndex=itemsArray.findIndex(item=>item.key===slideIndex);if(targetIndex!==-1){$.magnificPopup.instance.goTo(targetIndex)}},change:function(){let imgContainer=$('.gallery-popup-content');let loader=imgContainer.find('.rb-loader');let img=imgContainer.find('img');loader.show();if(!img.length){loader.hide();return} 143let loaderTimeout=setTimeout(()=>{loader.fadeIn(200)},300);img.on('load',function(){clearTimeout(loaderTimeout);loader.hide()}).on('error',function(){clearTimeout(loaderTimeout);loader.hide()})},afterClose:function(){$.magnificPopup.instance.popupsCache={}},buildControls:function(){if(this.arrowLeft&&this.arrowRight){this.contentContainer.find('.gallery-popup-nav').append(this.arrowLeft.add(this.arrowRight))}}},inline:{markup:'<div class="gallery-popup-header light-scheme">'+'<div class="mfp-counter"></div><div class="mfp-title h5"></div>'+'<div class="popup-header-right"><div class="mfp-close"></div></div>'+'</div><div class="gallery-popup-nav"></div>'+'<div class="gallery-popup-content"><i class="rb-loader"></i>'+'<div class="gallery-popup-image mfp-image"></div>'+'<div class="gallery-popup-entry light-scheme">'+'<div class="h4 mfp-excerpt"></div>'+'<div class="description-text mfp-description"></div>'+'</div>'+'</div>'},items:Object.values(self.galleriesData)});return!1})};Module.singleFeaturedLightbox=function(){$('.featured-lightbox-trigger').on('click',function(e){e.preventDefault();e.stopPropagation();const trigger=$(this);const source='<img src="'+trigger.data('source')+'" alt="'+$(this).find('img').attr('alt')+'">';const caption=trigger.data('caption');const attribution=trigger.data('attribution');$.magnificPopup.open({mainClass:'rb-popup-center popup-no-overflow',closeOnBgClick:!0,removalDelay:400,showCloseBtn:!0,fixedBgPos:!0,fixedContentPos:!0,preloader:!1,closeMarkup:'<button title="%title%" class="mfp-close rb-popup-close"><i class="rbi rbi-close"></i></button>',callbacks:{afterClose:function(){$.magnificPopup.instance.popupsCache={}},},inline:{markup:'<div class="featured-popup-image"><div class="mfp-source"></div>'+'<div class="mfp-close rb-popup-close"></div></div>'+'<div class="gallery-popup-entry light-scheme">'+'<div class="h4 mfp-excerpt"></div>'+'<div class="description-text mfp-description"></div>'+'</div>'},items:{source:source,excerpt:caption,description:attribution,},})})} 144Module.paginationNextPrev=function(){const self=this;self._body.on('click','.pagination-trigger',function(e){e.preventDefault();e.stopPropagation();const paginationTrigger=$(this);if(paginationTrigger.hasClass('is-disable')){return} 145const block=paginationTrigger.parents('.block-wrap');const uuid=block.attr('id');if(!self.ajaxData[uuid]){self.ajaxData[uuid]=self.getBlockSettings(uuid)} 146if(self.ajaxData[uuid]&&self.ajaxData[uuid].processing){return} 147self.ajaxData[uuid].processing=!0;const type=paginationTrigger.data('type');self.ajaxStartAnimation(block,'replace');self.ajaxReplaceLoad(block,uuid,type)})} 148Module.ajaxReplaceLoad=function(block,uuid,type){const self=this;if(!self.ajaxData[uuid].paged){self.ajaxData[uuid].paged=1} 149if('prev'===type){self.ajaxData[uuid].page_next=parseInt(self.ajaxData[uuid].paged)-1}else{self.ajaxData[uuid].page_next=parseInt(self.ajaxData[uuid].paged)+1}
150const cacheID=self.cacheData.getCacheID(uuid,self.ajaxData[uuid].page_next);if(self.cacheData.exist(cacheID)){const cache=self.cacheData.get(cacheID);if('undefined'!==typeof cache.paged){self.ajaxData[uuid].paged=cache.paged} 151setTimeout(function(){self.ajaxRenderHTML(block,uuid,cache,'replace')},200)}else{$.ajax({type:'GET',url:self.ajaxURL,data:{action:'rblivep',data:self.ajaxData[uuid]},success:function(response){response=JSON.parse(JSON.stringify(response));if('undefined'!==typeof response.paged){self.ajaxData[uuid].paged=response.paged} 152self.cacheData.set(cacheID,response);self.ajaxRenderHTML(block,uuid,response,'replace')}})}} 153Module.paginationLoadMore=function(){const self=this;self._body.on('click','.loadmore-trigger',function(e){e.preventDefault();e.stopPropagation();const paginationTrigger=$(this);if(paginationTrigger.hasClass('is-disable')){return} 154const block=paginationTrigger.parents('.block-wrap');const uuid=block.attr('id');if(!self.ajaxData[uuid]){self.ajaxData[uuid]=self.getBlockSettings(uuid)} 155if(self.ajaxData[uuid]&&self.ajaxData[uuid].processing){return} 156self.ajaxData[uuid].processing=!0;self.ajaxStartAnimation(block,'append');self.ajaxAppendLoad(block,uuid)})} 157Module.paginationInfinite=function(){const self=this;const infiniteElements=$('.pagination-infinite');if(infiniteElements.length>0){infiniteElements.each(function(){const paginationTrigger=$(this);if(!paginationTrigger.hasClass('is-disable')){const block=paginationTrigger.parents('.block-wrap');if((block.hasClass('is-hoz-scroll')||block.hasClass('is-mhoz-scroll')||block.hasClass('is-thoz-scroll'))&&window.outerWidth<1025){paginationTrigger.addClass('is-disable');return} 158const uuid=block.attr('id');const wPointID='infinite'+uuid;if(!self.ajaxData[uuid]){self.ajaxData[uuid]=self.getBlockSettings(uuid)} 159const params={element:paginationTrigger,offset:'120%',handler:function(direction){if(self.ajaxData[uuid]&&self.ajaxData[uuid].processing){return} 160if('down'==direction){self.ajaxData[uuid].processing=!0;self.ajaxStartAnimation(block,'append');self.ajaxAppendLoad(block,uuid)}}} 161self.wPoint[wPointID]=new Waypoint(params)}})}} 162Module.ajaxAppendLoad=function(block,uuid){const self=this;if(!self.ajaxData[uuid].paged){self.ajaxData[uuid].paged=1} 163if(self.ajaxData[uuid].paged>=self.ajaxData[uuid].page_max){return} 164self.ajaxData[uuid].page_next=parseInt(self.ajaxData[uuid].paged)+1;$.ajax({type:'GET',url:self.ajaxURL,data:{action:'rblivep',data:self.ajaxData[uuid]},success:function(response){response=JSON.parse(JSON.stringify(response));if('undefined'!==typeof response.paged){self.ajaxData[uuid].paged=response.paged} 165if('undefined'!==typeof response.notice){response.content=response.content+response.notice} 166self.ajaxRenderHTML(block,uuid,response,'append')}})} 167Module.liveSearch=function(){const liveSearch=$('.live-search-form');if(liveSearch.length===0){return} 168const self=this;liveSearch.each(function(){const liveSearchEl=$(this);const input=liveSearchEl.find('input[type="text"]');const responseWrap=liveSearchEl.find('.live-search-response');const animation=liveSearchEl.find('.live-search-animation');const limit=liveSearchEl.data('limit');const search=liveSearchEl.data('search');const follow=liveSearchEl.data('follow');const tax=liveSearchEl.data('tax');const dsource=liveSearchEl.data('dsource');const ptype=liveSearchEl.data('ptype');input.attr('autocomplete','off');input.on('focus',function(){const param=$(this).val();if(param&&!responseWrap.is(':empty')){responseWrap.css('height','auto').fadeIn(200)}});const delay=(function(){let timer=0;return function(callback,ms){clearTimeout(timer);timer=setTimeout(callback,ms)}})();input.keyup(function(){const param=$(this).val();delay(function(){if(param){liveSearchEl.addClass('search-loading');setTimeout(function(){animation.fadeIn(100)},120);$.ajax({type:'GET',url:self.ajaxURL,data:{action:'rbsearch',s:param,limit:limit,search:search,follow:follow,tax:tax,dsource:dsource,ptype:ptype,},success:function(data){data=$.parseJSON(JSON.stringify(data));animation.fadeOut(200);setTimeout(function(){liveSearchEl.removeClass('search-loading')},200);responseWrap.hide().empty().css('height',responseWrap.height());responseWrap.html(data);if('category'===search&&follow&&typeof FOXIZ_PERSONALIZE!=='undefined'){FOXIZ_PERSONALIZE.syncLayoutCategories()} 169responseWrap.css('height','auto').fadeIn(200)}})}else{responseWrap.fadeOut(200,function(){responseWrap.empty().css('height','auto')})}},300)})})} 170Module.personalizeBlocks=function(){const self=this;const elements=$('.is-ajax-block');if(elements.length>0){const blockRequests=elements.map(function(){const block=$(this);const uuid=block.attr('id');if(!self.ajaxData[uuid]){self.ajaxData[uuid]=self.getBlockSettings(uuid)} 171if(self.ajaxData[uuid].content_source&&self.ajaxData[uuid].content_source==='recommended'&&typeof foxizQueriedIDs!=='undefined'&&foxizQueriedIDs.data){self.ajaxData[uuid].post_not_in=foxizQueriedIDs.data} 172self.ajaxData[uuid].uID=self.getStorage('RBUUID','0');return $.ajax({type:'GET',url:self.ajaxURL,data:{action:'rbpersonalizeb',data:self.ajaxData[uuid]}})});Promise.all(blockRequests).then(responses=>
172{responses.forEach((response,index)=>{const block=$(elements[index]);block.html(response).fadeIn(200);block.dequeue()});self.reloadBlockFunc()})}};Module.personalizeCategories=function(){const self=this;const elements=$('.is-ajax-categories');if(elements.length>0){const categoryRequests=elements.map(function(){const block=$(this);const uuid=block.attr('id');if(!self.ajaxData[uuid]){self.ajaxData[uuid]=self.getBlockSettings(uuid)} 173return $.ajax({type:'GET',url:self.ajaxURL,data:{action:'rbpersonalizecat',data:self.ajaxData[uuid]}})});Promise.all(categoryRequests).then(responses=>{responses.forEach((response,index)=>{const block=$(elements[index]);block.html(response).fadeIn(200);block.dequeue()});if(typeof FOXIZ_PERSONALIZE!=='undefined'){FOXIZ_PERSONALIZE.syncLayoutCategories()} 174self.reloadBlockFunc()})}};Module.readingCollect=function(){const self=this;if(self.themeSettings.yesReadingHis===undefined){return} 175$.ajax({type:'GET',url:self.ajaxURL,data:{action:'rbcollect',id:self.themeSettings.yesReadingHis}})};Module.newsNotification=function(){const notificationWrapper=$('.rb-notification');if(notificationWrapper.length<1){return!1} 176const self=this;const storageKey=this.personalizeUID+'-notification';const dot=$('.notification-info');let reload=notificationWrapper.data('interval');if(!reload||isNaN(reload)||reload<=0){reload=15} 177function countNewPosts(currentIds,viewedIds){if(!currentIds)return 0;if(!viewedIds)return currentIds.split(',').length;const current=currentIds.split(',');const viewed=viewedIds.split(',');let count=0;for(let i=0;i<current.length;i++){if(viewed.indexOf(current[i])===-1){count++}} 178return count} 179const cached=self.getStorage(storageKey);if(cached&&cached.content){notificationWrapper.append(cached.content);const newCount=countNewPosts(cached.ids,cached.viewedIds);if(newCount>0){dot.append(newCount);dot.css('opacity',1)}} 180$('.notification-trigger').on('click',function(){dot.css('opacity',0).empty();const current=self.getStorage(storageKey);if(current&¤t.ids){current.viewedIds=current.ids;self.setStorage(storageKey,current)}});const isExpired=!cached||!cached.ttl||Date.now()>cached.ttl;if(isExpired){$.ajax({type:'GET',url:self.ajaxURL,data:{action:'rbnotification'},success:function(response){response=$.parseJSON(JSON.stringify(response));const newIds=response.ids||'';const oldIds=cached?(cached.ids||''):'';const viewedIds=cached?(cached.viewedIds||''):'';self.setStorage(storageKey,{content:response.content,count:response.count,ids:newIds,viewedIds:viewedIds,ttl:Date.now()+reload*60000});if(!cached||newIds!==oldIds){notificationWrapper.empty().append(response.content);dot.empty();const newCount=countNewPosts(newIds,viewedIds);if(newCount>0){dot.append(newCount);dot.css('opacity',1)}}}})}};Module.cacheData={data:{},get:function(id){return this.data[id]},set:function(id,data){this.remove(id);this.data[id]=data},remove:function(id){delete this.data[id]},getCacheID:function(blockID,currentPage){return JSON.stringify('RB_'+blockID+'_'+currentPage)},exist:function(id){return this.data.hasOwnProperty(id)&&this.data[id]!==null}} 181Module.ajaxStartAnimation=function(block,action){const inner=block.find('.block-inner');block.find('.pagination-trigger').addClass('is-disable');inner.stop();if('replace'===action){inner.css('min-height',inner.outerHeight());inner.fadeTo('200',0.05);inner.after('<i class="rb-loader loader-absolute"></i>')}else{block.find('.loadmore-trigger').addClass('loading');block.find('.rb-loader').css({'display':'block'}).delay(200).animate({opacity:1},200)}} 182Module.ajaxRenderHTML=function(block,uuid,response,action){const self=this;block.delay(50).queue(function(){const uuid=block.attr('id');const inner=block.find('.block-inner');block.find('.pagination-trigger').removeClass('is-disable');inner.stop();if('replace'===action){inner.html(response.content);block.find('.rb-loader').animate({opacity:0}
182,200,function(){$(this).remove()}) 183inner.css('min-height','');inner.fadeTo(200,1)}else{const content=$(response.content);inner.append(content);content.addClass('is-invisible');content.addClass('opacity-animate');block.find('.rb-loader').animate({opacity:0},200,function(){$(this).css({'display':'none'})});setTimeout(function(){content.removeClass('is-invisible')},200);block.find('.loadmore-trigger').removeClass('loading')} 184self.ajaxTriggerState(block,uuid);self.ajaxData[uuid].processing=!1;block.dequeue();self.reloadBlockFunc()})} 185Module.ajaxTriggerState=function(block,uuid){const self=this;block.find('.pagination-trigger').removeClass('is-disable');if(self.ajaxData[uuid].paged<2){block.find('[data-type="prev"]').addClass('is-disable')}else if(self.ajaxData[uuid].paged>=self.ajaxData[uuid].page_max){block.find('[data-type="next"]').addClass('is-disable');block.find('.loadmore-trigger').addClass('is-disable').hide();block.find('.pagination-infinite').addClass('is-disable').hide()}} 186Module.getBlockSettings=function(uuid){const settings=typeof window[uuid]!=='undefined'?window[uuid]:undefined;return this.cleanNull(settings)} 187Module.cleanNull=function(data){if(typeof data==='string'){return data} 188if(data&&typeof data==='object'){Object.keys(data).forEach(key=>{if(data[key]===''||data[key]===null){delete data[key]}})} 189return data};Module.singleInfiniteLoadNext=function(){const infiniteWrapper=$('#single-post-infinite');const self=this;if(!infiniteWrapper.length||self.disabledLoadNext()){return} 190self.singleLoadNextCounter=1;self.singleLoadNextLimit=self.themeSettings?.singleLoadNextLimit?parseInt(self.themeSettings.singleLoadNextLimit,10):20;const infiniteLoadPoint=$('#single-infinite-point');const animationIcon=infiniteLoadPoint.find('.rb-loader');const rootURL=new URL(window.location.href);const rootGetParams=rootURL.searchParams;const loadNextParams={element:infiniteLoadPoint,offset:'125%',handler:function(direction){if(self.ajaxData.singleProcessing||direction==='up'||self.singleLoadNextCounter>self.singleLoadNextLimit){return} 191const nextPostURL=new URL(infiniteWrapper.data('nextposturl'));nextPostURL.searchParams.set('rbsnp','1');if(rootGetParams){rootGetParams.forEach((value,key)=>{if(key!=='rbsnp'&&'p'!==key){nextPostURL.searchParams.set(key,value)}})} 192self.ajaxData.singleProcessing=!0;animationIcon.css('display','block').animate({opacity:1},200);$.ajax({type:'GET',url:nextPostURL.toString(),dataType:'html',success:function(response){response=$('<div id="temp-dom"></div>').append($.parseHTML(response)).find('.single-post-outer');const nextPostURL=response.data('nextposturl');if(nextPostURL){infiniteWrapper.data('nextposturl',nextPostURL)}else{infiniteWrapper.removeAttr('id');infiniteLoadPoint.remove()} 193animationIcon.animate({opacity:0}
193,200).delay(200).css('display','none');infiniteWrapper.append(response);self.ajaxData.singleProcessing=!1;self.singleLoadNextCounter++;setTimeout(function(){self.reInitAll();if(typeof FOXIZ_CORE_SCRIPT!=='undefined'){FOXIZ_CORE_SCRIPT.loadGoogleAds(response);FOXIZ_CORE_SCRIPT.loadInstagram(response);FOXIZ_CORE_SCRIPT.loadTwttr()}},1)}})}};self.wPoint.ajaxSingleNextPosts=new Waypoint(loadNextParams)};Module.singleScrollRefresh=function(){const infiniteWrapper=$('#single-post-infinite');if(!infiniteWrapper.length){return} 194const self=this;self.articleData=[];const articleOuter=infiniteWrapper.find('.single-post-outer');if(articleOuter.length>0){self.inviewPostID=articleOuter.eq(0).data('postid');articleOuter.each(function(){const article=$(this);const itemData={postID:article.data('postid'),postURL:article.data('postlink'),postTitle:article.find('h1.s-title').text(),shareList:article.find('.sticky-share-list-buffer').html(),top:article.offset().top,bottom:article.offset().top+article.outerHeight(!0)};if(self.readIndicator.length>0){const content=article.find('.rbct').eq(0);itemData.indicatorTop=content.offset().top;itemData.indicatorHeight=content.outerHeight(!0)-self._window.height()} 195self.articleData.push(itemData)});const onScroll=()=>{self.animationFrame(self.scrollToUpdateArticle.bind(self))};if(window.addEventListener){window.addEventListener('scroll',onScroll,!1)}}} 196Module.scrollToUpdateArticle=function(){const self=this;const scroll=self._window.scrollTop();self.articleData.every(article=>{if(scroll>(article.top+5)&&scroll<(article.bottom-5)){if(article.indicatorTop){self.readIndicatorPercent=Math.min(((scroll-article.indicatorTop)/article.indicatorHeight)*100,100);if(self.readIndicatorPercent<=100){self.readIndicator.css('width',`${self.readIndicatorPercent}%`)}} 197if(article.postID!==self.inviewPostID){self.inviewPostID=article.postID;if(article.postURL){history.replaceState(null,null,article.postURL)} 198document.title=article.postTitle;$('.single-post-outer').removeClass('activated');$('[data-postid="'+article.postID+'"]').addClass('activated');$('#s-title-sticky .sticky-title').hide().html(article.postTitle).fadeIn(300);$('#s-title-sticky .sticky-share-list').html(article.shareList);self._body.find('.floating-video').removeClass('floating-activated');if(typeof FOXIZ_CORE_SCRIPT!=='undefined'){FOXIZ_CORE_SCRIPT.updateGA(article)}} 199return!1} 200return!0})} 201Module.crwDetect=function(){const botPatterns=[/alexa|altavista|ask jeeves|attentio|baiduspider|bingbot|chtml generic|crawler|fastmobilecrawl|feedfetcher-google|firefly|froogle|gigabot|googlebot|googlebot-mobile|heritrix|httrack|ia_archiver|irlbot|iescholar|infoseek|jumpbot|linkcheck|lycos|mediapartners|mediobot|motionbot|msnbot|mshots|openbot|pss-webkit-request|pythumbnail|scooter|slurp|snapbot|spider|taptubot|technoratisnoop|teoma|twiceler|yahooseeker|yahooysmcm|yammybot|ahrefsbot|pingdom.com_bot|kraken|yandexbot|twitterbot|tweetmemebot|openhosebot|queryseekerspider|linkdexbot|grokkit-crawler|livelapbot|germcrawler|domaintunocrawler|grapeshotcrawler|cloudflare-alwaysonline/i];const userAgent=navigator.userAgent;return botPatterns.some(pattern=>pattern.test(userAgent))};Module.disabledLoadNext=function(){if(this.themeSettings.crwLoadNext){return!1} 202return this.crwDetect()} 203Module.productQuantity=function(){this._document.on('click','.quantity .quantity-btn',function(e){e.preventDefault();e.stopPropagation();const button=$(this);const input=button.parent().find('input');let step=1;let min=1;let max=9999;let value_old=parseInt(input.val());let value_new=parseInt(input.val());if(input.attr('step')){step=parseInt(input.attr('step'))} 204if(input.attr('min')){min=parseInt(input.attr('min'))} 205if(input.attr('max')){max=parseInt(input.attr('max'))} 206if(button.hasClass('up')){if(value_old<max){value_new=value_old+step}else{value_new=1}}else if(button.hasClass('down')){if(value_old>min){value_new=value_old-step}else{value_new=0}} 207if(!input.attr('disabled')){input.val(value_new).change()}})} 208Module.cartNotification=function(){const self=this;const element=$('#add-cart-popup');self._body.on('added_to_cart',function(){element.fadeIn(200);self.cartNotificationTimeOut=setTimeout(function(){element.fadeOut(200)},5000);self.hoveringNotification(element)})} 209Module.hoveringNotification=function(element){const self=this;element.on('mouseenter',function(){clearTimeout(self.cartNotificationTimeOut)});element.on('mouseleave',function(){setTimeout(function(){element.fadeOut(200)},1500)})} 210Module.likeToggle=function(){const self=this;let reaction='';self._body.on('click','.like-trigger, .dislike-trigger',function(e){e.preventDefault();e.stopPropagation();const target=$(this);const wrap=target.parent('[data-like]');const pid=wrap.data('like');if(!pid||self.isProgress)return;self.isProgress=!0;const storageKey=self.getLikeKey(pid);const isLike=target.hasClass('like-trigger');const isDislike=target.hasClass('dislike-trigger');const sibEl=target.siblings();const likeCountEl=wrap.find('.like-count');const dislikeCountEl=wrap.find('.dislike-count');let likeCountText=likeCountEl.text();let dislikeCountText=dislikeCountEl.text();if(isLike){if(!target.hasClass('triggered')){reaction='like';if(!/[kKmM]/.test(likeCountText)){likeCountText=parseInt(likeCountText);if(isNaN(likeCountText)){likeCountText=0} 211likeCountEl.text(likeCountText+1)} 212target.addClass('triggered');if(sibEl.hasClass('triggered')){sibEl.removeClass('triggered');if(!/[kKmM]/.test(dislikeCountText)){dislikeCountText=parseInt(dislikeCountText)-1;
212if(isNaN(dislikeCountText)||dislikeCountText<1){dislikeCountText=''} 213dislikeCountEl.text(dislikeCountText)}} 214self.setStorage(storageKey,'like')}else{reaction='rmlike';if(!/[kKmM]/.test(likeCountText)){likeCountText=parseInt(likeCountText)-1;if(isNaN(likeCountText)||likeCountText<1){likeCountText=''} 215likeCountEl.text(likeCountText)} 216target.removeClass('triggered');self.deleteStorage(storageKey)}}else if(isDislike){if(!target.hasClass('triggered')){reaction='dislike';if(!/[kKmM]/.test(dislikeCountText)){dislikeCountText=parseInt(dislikeCountText);if(isNaN(dislikeCountText)){dislikeCountText=0} 217dislikeCountEl.text(dislikeCountText+1)} 218target.addClass('triggered');if(sibEl.hasClass('triggered')){sibEl.removeClass('triggered');if(!/[kKmM]/.test(likeCountText)){likeCountText=parseInt(likeCountText)-1;if(isNaN(likeCountText)||likeCountText<1){likeCountText=''} 219likeCountEl.text(likeCountText)}} 220self.setStorage(storageKey,'dislike')}else{reaction='rmdislike';if(!/[kKmM]/.test(dislikeCountText)){likeCountText=parseInt(likeCountText)-1;if(isNaN(likeCountText)||likeCountText<1){likeCountText=''} 221dislikeCountEl.text(likeCountText)} 222target.removeClass('triggered');self.deleteStorage(storageKey)}} 223$.ajax({type:'GET',url:self.ajaxURL,data:{uuid:self.personalizeUID,action:'rbvoting',value:reaction,pid:pid,},complete:()=>{self.isProgress=!1}})})} 224Module.syncLayoutLike=function(){this.isProgress=!0;const likeElements=document.querySelectorAll('[data-like]:not(.loaded)');const jsCount=this._body.hasClass('is-jscount');let count,countEl;for(const el of likeElements){el.classList.add('loaded');const key=this.getLikeKey(el.getAttribute('data-like'));const triggered=this.getStorage(key);if(!triggered)continue;const likeEl=el.querySelector('.el-like');const dislikeEl=el.querySelector('.el-dislike');if(!likeEl||!dislikeEl)continue;if(triggered==='like'){likeEl.classList.add('triggered');countEl=jsCount?likeEl.querySelector('.like-count'):null;if(countEl){count=parseInt(countEl.textContent.trim())||0;countEl.textContent=count+1}}else if(triggered==='dislike'){dislikeEl.classList.add('triggered');countEl=jsCount?dislikeEl.querySelector('.dislike-count'):null;if(countEl){count=parseInt(countEl.textContent.trim())||0;countEl.textContent=count+1}}} 225this.isProgress=!1};Module.getLikeKey=function(id){return this.personalizeUID+'-like-'+id} 226Module.liveBlog=function(){const self=this;const liveEntry=$('.rb-live-entry');if(liveEntry.length===0){return!1} 227let intervalId;let delayTimeoutId;const interval=Math.min(1800,Math.max(15,this.themeSettings.liveInterval||1800));const liveSwitcher=$('#live-interval-switcher');const storedSetting=this.getStorage('liveIntervalCheckbox');const startInterval=()=>{clearInterval(intervalId);intervalId=setInterval(()=>this.updateLiveBlog(liveEntry),interval*1000)};const stopAll=()=>{clearInterval(intervalId);clearTimeout(delayTimeoutId)};const handleToggle=()=>{stopAll();if(liveSwitcher.prop('checked')){delayTimeoutId=setTimeout(()=>{this.updateLiveBlog(liveEntry);startInterval()},3000);self.setStorage('liveIntervalCheckbox','yes')}else{self.setStorage('liveIntervalCheckbox','no')}};if(storedSetting!==null){liveSwitcher.prop('checked',storedSetting==='yes')}else{self.setStorage('liveIntervalCheckbox','yes')} 228if(liveSwitcher.prop('checked')){startInterval()} 229liveSwitcher.on('change',handleToggle)};Module.updateLiveBlog=function(liveEntry){const self=this;const liveURL=new URL(window.location.href);liveURL.searchParams.set('rblive','1');$.ajax({type:'GET',url:liveURL.toString(),dataType:'html',success:function(response){response=$('<div id="temp-dom"></div>').append($.parseHTML(response)).find('#rb-live-content');liveEntry.html(response.html());const liveCountElement=liveEntry.prev().find('.live-count');if(liveCountElement.length){liveCountElement.text(response.data('total'))} 230setTimeout(function(){self.reInitAll();if(typeof FOXIZ_CORE_SCRIPT!=='undefined'){FOXIZ_CORE_SCRIPT.loadGoogleAds(response);FOXIZ_CORE_SCRIPT.loadInstagram(response);FOXIZ_CORE_SCRIPT.loadTwttr()}},1)}})} 231Module.accordion=function(){$('.gb-accordion').each(function(){const accordion=$(this);if(accordion.hasClass('yesLoaded'))return;accordion.addClass('yesLoaded');const accordionItems=accordion.find('.gb-accordion-item');
231if(accordion.hasClass('yes-open')){accordionItems.first().addClass('active').find('.accordion-item-content').css('display','block')} 232accordion.on('click','.accordion-item-header',function(e){e.preventDefault();const header=$(this);const item=header.closest('.gb-accordion-item');const content=item.find('.accordion-item-content');if(item.hasClass('active')){item.removeClass('active');content.stop().slideUp(200)}else{const activeItem=accordionItems.filter('.active');activeItem.removeClass('active').find('.accordion-item-content').stop().slideUp(200);item.addClass('active');content.stop().slideDown(200)}})})};Module.resIframeClassic=function(){if(!document.body.classList.contains('res-iframe-classic'))return 233const iframes=document.querySelectorAll('.rbct iframe');iframes.forEach(iframe=>{const parent=iframe.parentElement;const grandParent=parent.parentElement;const greatGrandParent=grandParent.parentElement;if([parent,grandParent,greatGrandParent].some(element=>{const classNames=Array.from(element.classList);return classNames.some(className=>className.indexOf('wp-block')!==-1)}))return;if(!iframe.parentElement.classList.contains('rb-video-ires')){if(iframe.src.includes('youtube.com')||iframe.src.includes('youtu.be')||iframe.src.includes('vimeo.com')||iframe.src.includes('dailymotion.com')){iframe.parentElement.classList.add('rb-video-ires')}}})} 234Module.taxBasedAccordion=function(){const self=this;$('.block-tax-accordion').each(function(){const accordion=$(this);if(accordion.hasClass('is-loaded')){return} 235accordion.addClass('is-loaded');const accordionItems=accordion.find('.tax-accordion-item');const lastOpenedTab=self.getStorage(accordion.attr('id')+'_lastOpenedTab',null);if(lastOpenedTab){const tabToOpen=accordion.find('[data-tab="'+lastOpenedTab+'"] .tax-accordion-sub');if(tabToOpen.length!==0){tabToOpen.show()}} 236accordionItems.each(function(){const item=$(this);const trigger=item.find('.tax-accordion-trigger');const subMenu=item.find('.tax-accordion-sub');trigger.click(function(){if(!subMenu.is(':visible')){accordion.find('.tax-accordion-sub').not(subMenu).slideUp()} 237subMenu.slideToggle(function(){if(subMenu.is(':visible')){self.setStorage(accordion.attr('id')+'_lastOpenedTab',item.attr('data-tab'))}else{self.deleteStorage(accordion.attr('id')+'_lastOpenedTab')}})})})})};Module.sequentialGalleryDisplay=function(){const galleries=Array.from(document.querySelectorAll('.gallery-animated'));galleries.forEach(gallery=>{const images=Array.from(gallery.querySelectorAll('.e-gallery-item'));new Waypoint({element:gallery,handler:function(direction){if(direction==='down'){images.forEach((image,index)=>{requestAnimationFrame(()=>{setTimeout(()=>{image.classList.add('gallery-visible')},index*120)})});this.destroy()}},offset:'90%'})})};Module.reloadCaptchaPopups=function(delay=50){setTimeout(()=>{const $content=$($.magnificPopup?.instance?.content||[]);if(!$content.length)return;const removeDuplicateCaptchas=form=>{const seen=new Set();$(form).find('.g-recaptcha, .h-captcha, .cf-turnstile, .turnstile-widget, .frc-captcha, [data-arkose-public-key], .arkose-enforcement, .geetest_holder, .geetest_panel').each(function(){const cls=this.className;const type=['g-recaptcha','h-captcha','cf-turnstile','turnstile-widget','frc-captcha','arkose','geetest'].find(t=>cls.includes(t)||$(this).data('arkose-public-key')||$(this).hasClass('arkose-enforcement'));if(!type)return;const key=`${type}`;if(seen.has(key)){$(this).remove()}else{seen.add(key)}})};try{$content.find('form').each(function(){removeDuplicateCaptchas(this)});if(typeof grecaptcha!=='undefined'&&grecaptcha?.reset){$content.find('.g-recaptcha').each(function(){const wid=this.dataset.widgetId;if(wid){try{grecaptcha.reset(Number(wid))}catch{}}})} 238if(typeof turnstile!=='undefined'&&turnstile?.reset){$content.find('.cf-turnstile, .turnstile-widget').each(function(){const iframe=this.querySelector('iframe');const wid=iframe?.dataset?.wid;if(wid){try{turnstile.reset(wid)}catch{}}})} 239if(typeof hcaptcha!=='undefined'&&hcaptcha?.reset){$content.find('.h-captcha').each(function(){const wid=this.dataset.widgetId;if(wid){try{hcaptcha.reset(Number(wid))}catch{}}})} 240if(typeof friendlycaptcha!=='undefined'&&friendlycaptcha?.widget){$content.find('.frc-captcha').each(function(){const stored=$(this).data('frc-widget');if(stored?.reset){try{stored.reset()}catch{}}})} 241if(window?.arkose?.reset||typeof ECArkose!=='undefined'){const $arkoseEls=$content.find('[data-arkose-public-key], .arkose-enforcement');if($arkoseEls.length){try{window?.arkose?.reset?.();ECArkose?.reset?.()}catch{}}} 242if(typeof initGeetest!=='undefined'||typeof GeetInit!=='undefined'){$content.find('.geetest_holder, .geetest_panel').each(function(){const inst=this.geetestInstance;if(inst?.reset){try{inst.reset()}catch{}}})}}catch(err){}},delay)};return Module}(FOXIZ_MAIN_SCRIPT||{},jQuery))
243jQuery(document).ready(function($){FOXIZ_MAIN_SCRIPT.init()});jQuery(window).on('elementor/frontend/init',function(){if(typeof elementorFrontend!=='undefined'&&typeof elementorFrontend.isEditMode==='function'&&elementorFrontend.isEditMode()){FOXIZ_MAIN_SCRIPT.isElementorEditor=!0;FOXIZ_MAIN_SCRIPT.editorDarkModeInit=!1;elementorFrontend.hooks.addAction('frontend/element_ready/widget',FOXIZ_MAIN_SCRIPT.initElementor)}}) 244;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.