(()=>{var t={};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(e=>{if(!e)return;const{currency:o,products:n,purchase:i,add_to_cart:r,eventsToTrack:a}=t.g._googlesitekit?.wcdata||{},c=a?.includes("add_to_cart"),s=a?.includes("purchase");if(r&&c){const{price:e}=r,n=u(e,o,r);t.g._googlesitekit?.gtagEvent?.("add_to_cart",n)}if(i&&s){const{id:e,totals:o,items:n,user_data:r}=i,a=u(o.total_price,o.currency_code,n,e,o.shipping_total,o.tax_total);t.g._googlesitekit?.gtagUserData&&r&&(a.user_data=r),t.g._googlesitekit?.gtagEvent?.("purchase",a)}const d=e("body");function u(t,e,o){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;const a={value:l(t),currency:e,items:[]};if(n&&(a.transaction_id=n),"number"==typeof i&&(a.shipping=i),"number"==typeof r&&(a.tax=r),o&&o.length)for(const t of o)a.items.push(g(t));else o&&o.id&&(a.items=[g(o)]);return a}function g(t){const{id:e,name:o,price:n,variation:i,quantity:r,categories:a}=t,c={item_id:e,item_name:o,price:l(n)};if(r&&(c.quantity=r),i&&(c.item_variant=i),a&&a?.length){let t=1;for(const e of a)c[t>1?`item_category${t}`:"item_category"]=e.name,t++}return c}function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return parseInt(t,10)/10**e}c&&(d.on("added_to_cart",(e,i,r,a)=>{if(!a?.jquery)return;const c=parseInt(a.data("product_id"),10);if(!c)return;const s=n?.find(t=>t?.id===c)||{},{price:d}=s,g=u(d,o,s);t.g._googlesitekit?.gtagEvent?.("add_to_cart",g)}),e(".products-block-post-template .product, .wc-block-product-template .product").each(function(){const i=e(this),r=parseInt(i.find("[data-product_id]").attr("data-product_id"),10);r&&i.on("click",i=>{const a=e(i.target).closest(".wc-block-components-product-button [data-product_id]");if(!a.length||!a.hasClass("add_to_cart_button")||a.hasClass("product_type_variable"))return;const c=n?.find(t=>t?.id===r)||{},{price:s}=c,d=u(s,o,c);t.g._googlesitekit?.gtagEvent?.("add_to_cart",d)})}))})(t.g.jQuery)})();
(function($){
FLTheme={
init: function(){
this._bind();
},
_bind: function(){
var self=this;
$('.navbar-toggle').on('click', this.navbarToggleClick);
if($('.fl-page-bar-nav ul.sub-menu').length!=0){
this._setupDropDowns();
this._enableTopNavDropDowns();
}
if($('.fl-page-nav ul.sub-menu').length!=0){
$(window).on('resize.fl-page-nav-sub-menu', $.throttle(500, this._enablePageNavDropDowns));
this._setupDropDowns();
this._enablePageNavDropDowns();
}
if($('.fl-page-nav ul.menu').length!=0){
$('.fl-page-nav ul.menu').find('.menu-item').on('click', '> a[href*="#"]:not([href="#"])', this._setupCurrentNavItem);
this._setupCurrentNavItem();
}
if($('.fl-page-nav-search').length!=0){
$('.fl-page-nav-search a.fa-search').on('click', this._toggleNavSearch);
}
if($('.fl-nav-vertical').length!=0){
$(window).on('resize', $.throttle(500, this._navVertical));
this._navVertical();
}
if($('.fl-fixed-width.fl-nav-vertical-right').length!=0){
$(window).on('resize', $.throttle(500, this._updateVerticalRightPos));
this._updateVerticalRightPos();
}
if($('.fl-page-nav-centered-inline-logo').length!=0){
$(window).on('resize', $.throttle(500, this._centeredInlineLogo));
this._centeredInlineLogo();
}
if($('body.fl-nav-left').length!=0){
$(window).on('resize', $.throttle(500, this._navLeft));
this._navLeft();
}
if(($('body.fl-shrink').length!=0)&&!($('html.fl-builder-edit').length!=0)){
$(window).on('resize', $.throttle(500, this._shrinkHeaderEnable));
this._shrinkHeaderInit();
this._shrinkHeaderEnable();
}
if($('.fl-page-header-fixed').length!=0){
$(window).on('resize.fl-page-header-fixed', $.throttle(500, this._enableFixedHeader));
this._enableFixedHeader();
}
if(($('body.fl-fixed-header').length!=0)&&!($('html.fl-builder-edit').length!=0)){
$(window).on('resize', $.throttle(500, this._fixedHeader));
this._fixedHeader();
}
if(($('body.fl-scroll-header').length!=0)&&!($('html.fl-builder-edit').length!=0)){
$(window).on('resize', $.throttle(500, this._scrollHeader));
this._scrollHeader();
}
if($('.fl-page-header-primary').find('li.mega-menu').length!=0){
$(window).on('resize', $.throttle(500, this._megaMenu));
this._megaMenu();
}
if($('.fl-page-header-fixed').length!=0){
$(window).on('scroll.fl-mega-menu-on-scroll', $.throttle(500, this._megaMenuOnScroll));
$(window).on('resize.fl-mega-menu-on-scroll', $.throttle(500, this._megaMenuOnScroll));
}
if($('html.fl-builder-edit').length!=0){
this._fixedHeadersWhenBuilderActive();
}
if($('body.fl-nav-mobile-offcanvas').length!=0&&! $('html.fl-builder-edit').length!=0){
$(window).on('resize', $.throttle(500, this._setupMobileNavLayout));
this._setupMobileNavLayout();
this._toggleMobileNavLayout();
}
$('body').on('click', this.closeMenu);
$('.fl-theme-menu > li:last-child').on('focusout', function (e){
if(undefined===$(e.relatedTarget)[0]||'nav-link'!==$(e.relatedTarget)[0].className){
self.closeMenu(e);
}});
if($('.fl-full-width.fl-footer-effect').length!=0){
$(window).on('resize', $.throttle(500, this._footerEffect));
this._footerEffect();
}
if($('body.fl-scroll-to-top').length!=0){
this._toTop();
}
if(typeof $('body').magnificPopup!='undefined'){
this._enableLightbox();
}
if(typeof $.fn.fitVids!='undefined'&&!$('body').hasClass('fl-builder')){
this._enableFitVids();
}
FLTheme._navBackiosFix();
this._initSmoothScroll()
},
_isMobile: function(){
if(( 'ontouchstart' in window)||(navigator.maxTouchPoints > 0)||(navigator.msMaxTouchPoints > 0) ){
return true;
}
return /Mobile|Android|Silk\/|Kindle|BlackBerry|Opera Mini|Opera Mobi|webOS/i.test(navigator.userAgent);
},
_initRetinaImages: function(){
var pixelRatio = !!window.devicePixelRatio ? window.devicePixelRatio:1;
if(pixelRatio > 1){
$('img[data-retina]').each(FLTheme._convertImageToRetina);
}},
_convertImageToRetina: function(){
var image=$(this),
tmpImage=new Image(),
src=image.attr('src'),
retinaSrc=image.data('retina')
if(typeof src=='undefined'){
src=image.data('cfsrc')
}
if(typeof src=='undefined'){
return false;
}
var type=src.split('.').pop();
if(''!=retinaSrc){
tmpImage.onload=function(){
var width=tmpImage.width,
height=tmpImage.height;
if('svg'==type){
width=image.width();
height=image.height();
}
image.width(width);
image.attr('src', retinaSrc);
};
tmpImage.src=src;
}},
_initMobileHeaderLogo: function(){
this._enableMobileLogo();
$(window).on('resize', $.proxy(this._enableMobileLogo, this) );
},
_enableMobileLogo: function(){
var win=$(window),
logoWrap=$('.fl-page-header-logo'),
logos=logoWrap.find('img[data-mobile]'),
image=null,
mobileSrc=null,
tmpImage=null;
if(0===logos.length){
return;
}
$(logos).each(function(){
tmpImage=new Image();
image=$(this);
src=image.attr('src');
width=image.data('width');
height=image.data('height');
mobileSrc=image.data('mobile');
mobileWidth=image.data('mobile-width');
mobileHeight=image.data('mobile-height')
image.attr('src', '');
image.attr('data-src', src);
if(win.width() < window.themeopts.mobile_breakpoint){
if(''!=mobileSrc){
tmpImage.onload=function(){
image.attr('src', mobileSrc);
image.attr('width', mobileWidth);
image.attr('height', mobileHeight);
image.css('width', '');
};
tmpImage.src=src;
image.show();
}}else{
if('undefined'!==typeof image.data('src')){
image.attr('src', image.data('src'));
image.attr('width', width);
image.attr('height', height);
image.css('width', width);
}}
});
},
navbarToggleClick: function(e){
var menuType=$('body').hasClass('fl-nav-mobile-offcanvas') ? 'flyout':'dropdown';
if('dropdown'===menuType){
var	navBar=$(e.target).closest('.fl-page-nav'),
targetPanel=navBar.find('.fl-page-nav-collapse');
targetPanel.toggleClass('collapse');
targetPanel.toggleClass('in');
}else if('flyout'===menuType){
$('.fl-page').toggleClass('fl-nav-offcanvas-active');
}
e.stopPropagation();
},
closeMenu: function (e){
var menuType=$('body').hasClass('fl-nav-mobile-offcanvas') ? 'flyout':'dropdown',
isDropdownMenuActive=$('.fl-page-nav-collapse').hasClass('in'),
isFlyoutMenuActive=$('.fl-page').hasClass('fl-nav-offcanvas-active'),
isMaxMegaMenu=$(e.target).is('.mega-toggle-animated-inner, .mega-menu-toggle-animated-block, .mega-toggle-animated-box, .mega-toggle-blocks-right'),
pageNav;
if(undefined===e||undefined===e.target||isMaxMegaMenu){
return;
}
if('dropdown'===menuType&&isDropdownMenuActive){
pageNav=$('.navbar-collapse.in').closest('.fl-page-nav');
pageNav.find('.navbar-toggle').trigger('click');
}else if('flyout'===menuType&&isFlyoutMenuActive){
$('.fl-offcanvas-close').trigger('click');
}},
_setupDropDowns: function(){
$('ul.sub-menu').each(function(){
$(this).closest('li').find('a').first().attr('aria-haspopup', 'true');
});
},
_enableTopNavDropDowns: function(){
var nav=$('.fl-page-bar-nav'),
navItems=nav.find(' > li'),
subToggles=nav.find('> li').has('> ul.sub-menu').find('.fl-submenu-toggle-icon');
if(FLTheme._isMobile()){
if(false!==/iPhone|iPad/i.test(navigator.userAgent) ){
navItems.hover(FLTheme._navItemMouseover, FLTheme._navItemMouseout);
}else{
navItems.hover(function(){}, FLTheme._navItemMouseout);
subToggles.on('click', FLTheme._navSubMenuToggleClick);
}}else{
navItems.hover(FLTheme._navItemMouseover, FLTheme._navItemMouseout);
}},
_navBackiosFix: function(){
ipad=(navigator.userAgent.match('iPhone|iPad')!==null&&$('.menu-item-has-children').length > 0) ? true:false;
if(false!==ipad){
window.onpageshow=function(event){
if(event.persisted){
window.location.reload()
}}
}},
_initSmoothScroll: function(){
if('undefined'===typeof FLBuilderLayout){
return;
}
if('undefined'!==typeof window.themeopts.smooth&&'disabled'===window.themeopts.smooth){
return;
}
var targetId=location.hash;
targetId=targetId.replace(/(:|\!|\.|\[|\]|,|=|@|\/)/g, "\\$1");
if(targetId&&$(targetId).length){
setTimeout(function(){
window.scrollTo(0, 0);
FLBuilderLayout._scrollToElement($(targetId));
}, 1);
}},
_enablePageNavDropDowns: function(){
var pageNav=$('.fl-page-header');
pageNav.each(FLTheme._enablePageNavDropDown);
},
_enablePageNavDropDown: function(){
var pageNav=$(this),
nav=pageNav.find('.fl-page-nav .fl-page-nav-collapse'),
navItems=nav.find('ul li'),
subToggles=nav.find('li').has('> ul.sub-menu').find('> a'),
toggleIcon=nav.find('li').has('> ul.sub-menu').find('.fl-submenu-toggle-icon'),
subMenus=nav.find('> ul > li').has('ul.sub-menu');
if($('.fl-page-nav .navbar-toggle').is(':visible') ){
navItems.off('mouseenter mouseleave');
if($('body').hasClass('fl-submenu-toggle') ){
subMenus=nav.find('> ul li').has('ul.sub-menu');
}
subMenus.find('> a').off().on('click', FLTheme._navItemClickMobile);
subMenus.find('.fl-submenu-toggle-icon').off().on('click', FLTheme._navItemClickMobile);
nav.find('.menu').on('click', '.menu-item > a[href*="#"]', FLTheme._toggleForMobile);
subToggles.off('click', FLTheme._navSubMenuToggleClick);
}else{
nav.find('a').off('click', FLTheme._navItemClickMobile);
nav.find('a').off('click', FLTheme._toggleForMobile);
nav.find('.fl-submenu-toggle-icon').off('click', FLTheme._navItemClickMobile);
nav.removeClass('in').addClass('collapse');
navItems.removeClass('fl-mobile-sub-menu-open');
navItems.find('a').width(0).width('auto');
if(FLTheme._isMobile()){
navItems.hover(function(){}, FLTheme._navItemMouseout);
subToggles.on('click', FLTheme._navSubMenuToggleClick);
}else{
navItems.keydown(function(e){
if(9===e.keyCode){
el=$(this)
focused=el.find(':focus')
if(focused.parent().is(':last-child')){
sub=focused.parent().find('ul.sub-menu').first()
mega=focused.parent().parent().parent().parent().parent().hasClass('mega-menu')
mega_last=focused.parent().parent().parent().is(':last-child')
if(sub.length > 0){
sub.trigger('mouseenter')
}else{
if(! mega||mega_last){
el.trigger('mouseleave')
}}
}
parent=focused.closest('ul.sub-menu').parent()
if(! parent.hasClass('fl-sub-menu-open')){
focused.trigger('mouseenter')
}}
});
navItems.hover(FLTheme._navItemMouseover, FLTheme._navItemMouseout);
}}
},
_navItemClickMobile: function(e){
var nav=$(this).closest('.fl-page-nav-collapse'),
parent=$(this).closest('li'),
href=$(this).attr('href'),
subMenu=parent.find('ul.sub-menu'),
toggle=$(e.target).hasClass('fl-submenu-toggle-icon'),
subChildren=null;
if(href&&'#'!==href){
var targetId=href.split('#')[1];
if($('body').find('#'+  targetId).length > 0&&parent.hasClass('fl-mobile-sub-menu-open') ){
el=$(this).parent().closest('nav').find('.navbar-toggle')
el.trigger('click');
if('undefined'!==typeof FLBuilderLayout&&('undefined'===typeof window.themeopts.smooth&&'disabled'!==window.themeopts.smooth) ){
setTimeout(function(){
window.scrollTo(0, 0);
FLBuilderLayout._scrollToElement($('#'+  targetId));
}, 1);
}}
}
if(( '#'==href||toggle)&&parent.hasClass('fl-mobile-sub-menu-open') ){
e.preventDefault();
parent.removeClass('fl-mobile-sub-menu-open');
subMenu.hide();
}
else if(!parent.hasClass('fl-mobile-sub-menu-open')){
e.preventDefault();
parent.addClass('fl-mobile-sub-menu-open');
if(toggle&&0===$('.fl-submenu-toggle').length){
subChildren=subMenu.find('li.menu-item-has-children');
subChildren.addClass('fl-mobile-sub-menu-open');
}
subMenu.fadeIn(200);
}
if($('.fl-nav-collapse-menu').length!=0){
nav.find('li.fl-mobile-sub-menu-open')
.not($(this).parents('.fl-mobile-sub-menu-open') )
.not(subChildren)
.removeClass('fl-mobile-sub-menu-open')
.find('ul.sub-menu').hide();
}
e.stopPropagation();
},
_setupCurrentNavItem: function(e){
var nav=$('.fl-page-nav .navbar-nav'),
targetId=typeof e!=='undefined' ? $(e.target).prop('hash'):window.location.hash,
targetId=targetId.replace(/(:|\!|\.|\[|\]|,|=|@|\/)/g, "\\$1"),
currentLink=targetId.length ? nav.find('a[href*=\\' + targetId + ']:not([href=\\#])'):null,
closeButton=nav.closest('.fl-page-nav').find('.fl-offcanvas-close');
if(currentLink!=null&&$('body').find(targetId).length > 0){
$('.current-menu-item').removeClass('current-menu-item');
currentLink.parent().addClass('current-menu-item');
if(closeButton){
closeButton.trigger('click');
}}
},
_navItemMouseover: function(){
if($(this).find('ul.sub-menu').length===0){
return;
}
var li=$(this),
parent=li.parent(),
subMenu=li.find('ul.sub-menu'),
subMenuWidth=subMenu.width(),
subMenuPos=0,
winWidth=$(window).width(),
spacerPos=0,
subMenuTopPos=0;
if(li.closest('.fl-sub-menu-right').length!==0){
li.addClass('fl-sub-menu-right');
}
else if($('body').hasClass('rtl')){
subMenuPos=parent.is('ul.sub-menu') ?
parent.offset().left - subMenuWidth:
li.offset().left - subMenuWidth;
if(subMenuPos <=0){
li.addClass('fl-sub-menu-right');
}}else{
subMenuPos=parent.is('ul.sub-menu') ?
parent.offset().left + (subMenuWidth * 2) :
li.offset().left + subMenuWidth;
if(subMenuPos > winWidth){
li.addClass('fl-sub-menu-right');
}}
li.addClass('fl-sub-menu-open');
if(! li.hasClass('hide-heading')){
subMenu.hide();
subMenu.stop().fadeIn(200);
}
FLTheme._hideNavSearch();
if(li.closest('.fl-page-nav-collapse').length!==0&&li.hasClass('mega-menu') ){
if(li.find('.mega-menu-spacer').length > 0){
return;
}
subMenu.first().before('<div class="mega-menu-spacer"></div>');
spacerPos=li.find('.mega-menu-spacer').offset().top;
subMenuTopPos=subMenu.first().offset().top;
li.find('.mega-menu-spacer').css('padding-top', Math.floor(parseInt(subMenuTopPos - spacerPos)) + 'px');
}},
_navItemMouseout: function(){
var li=$(this),
subMenu=li.find('ul.sub-menu');
if(! li.hasClass('hide-heading')){
subMenu.stop().fadeOut({
duration: 200,
done: FLTheme._navItemMouseoutComplete
});
}else{
FLTheme._navItemMouseoutComplete();
}},
_navItemMouseoutComplete: function(){
var li=$(this).parent();
li.removeClass('fl-sub-menu-open');
li.removeClass('fl-sub-menu-right');
if(li.find('.mega-menu-spacer').length > 0){
li.find('.mega-menu-spacer').remove();
}
$(this).show();
},
_navSubMenuToggleClick: function(e){
var li=$(this).closest('li').eq(0);
if(! li.hasClass('fl-sub-menu-open') ){
FLTheme._navItemMouseover.apply(li[0]);
e.preventDefault();
}},
_toggleForMobile: function(e){
var nav=$('.fl-page-nav .fl-page-nav-collapse'),
href=$(this).attr('href'),
hasSubmenu=$(this).closest('li').hasClass('menu-item-has-children');
if(href!=='#'){
var targetId=href.split('#')[1];
if($('body').find('#'+  targetId).length > 0&&!hasSubmenu){
if(! $.isFunction(nav.collapse)){
el=$(this).parent().closest('nav').find('.navbar-toggle')
el.trigger('click')
}else{
nav.collapse('hide');
}}
}},
_toggleNavSearch: function(e){
var form=$('.fl-page-nav-search form');
e.preventDefault();
if(form.is(':visible')){
form.stop().fadeOut(200);
}else{
form.stop().fadeIn(200);
$('body').on('click.fl-page-nav-search', FLTheme._hideNavSearch);
$('.fl-page-nav-search .fl-search-input').focus();
}},
_hideNavSearch: function(e){
var form=$('.fl-page-nav-search form');
if(e!==undefined){
if($(e.target).closest('.fl-page-nav-search').length > 0){
return;
}}
form.stop().fadeOut(200);
$('body').off('click.fl-page-nav-search');
},
_navVertical: function(){
var win=$(window);
if(win.width() >=window.themeopts.medium_breakpoint&&$('.fl-page-header-primary').hasClass('fl-page-nav-toggle-visible-always')){
$('body').toggleClass('fl-nav-vertical');
if($('body').hasClass('fl-nav-vertical-left')){
$('body').toggleClass('fl-nav-vertical-left');
}
if($('body').hasClass('fl-nav-vertical-right')){
$('body').toggleClass('fl-nav-vertical-right');
}}
},
_updateVerticalRightPos: function(){
var win=$(window).width(),
flpage=$('.fl-page').width(),
vericalRightPos=((win - flpage) / 2);
$('.fl-page-header-vertical').css('right', vericalRightPos);
},
_navLeft: function(){
var win=$(window);
if(win.width() < window.themeopts.medium_breakpoint||$('.fl-page-header-primary').hasClass('fl-page-nav-toggle-visible-always')){
$('.fl-page-header-primary .fl-page-logo-wrap').insertBefore('.fl-page-header-primary .fl-page-nav-col');
}
if(win.width() >=window.themeopts.medium_breakpoint&&!$('.fl-page-header-primary').hasClass('fl-page-nav-toggle-visible-always')){
$('.fl-page-header-primary .fl-page-nav-col').insertBefore('.fl-page-header-primary .fl-page-logo-wrap');
}
if($('.fl-page-header-fixed').length!=0&&! $('.fl-page-header-fixed').hasClass('fl-page-nav-toggle-visible-always')){
$('.fl-page-header-fixed .fl-page-fixed-nav-wrap').insertBefore('.fl-page-header-fixed .fl-page-logo-wrap');
}},
_shrinkHeaderInit: function(){
var distanceY=$(window).scrollTop(),
shrinkOn=250,
header=$('.fl-page-header');
$('body').addClass('fl-shrink-header-enabled');
if('scrollRestoration' in history){
history.scrollRestoration='manual';
}
$('.fl-page-header-logo').imagesLoaded(function(){
var logo=$('.fl-logo-img'),
logoForHeight=$('.fl-page-header-logo:visible .fl-logo-img').first();
if(! logoForHeight.length){
logoForHeight=logo.first();
}
var logoHeight=logoForHeight.length ? logoForHeight.height():0;
if('undefined'!==typeof logoForHeight.data('origHeight')){
logoHeight=parseInt(logoForHeight.data('origHeight'));
}
if(! logoHeight&&logo.length){
logoHeight=parseInt(logo.first().data('origHeight'))||46;
}
logo.css('max-height', logoHeight);
setTimeout(function(){
$('.fl-page-header').addClass('fl-shrink-header-transition');
if(distanceY > shrinkOn){
header.addClass('fl-shrink-header');
}else{
header.removeClass('fl-shrink-header');
}}, 100);
});
},
_shrinkHeaderEnable: function(){
var win=$(window);
if(win.width() >=window.themeopts.medium_breakpoint){
var header=$('.fl-page-header'),
headerHeight=header.outerHeight(),
topbar=$('.fl-page-bar'),
topbarHeight=0,
totalHeaderHeight=0;
if(topbar.length!=0){
topbarHeight      +=topbar.outerHeight();
totalHeaderHeight=topbarHeight + headerHeight;
if($('body.admin-bar').length!=0){
topbarHeight +=32;
}
header.css('top' , topbarHeight);
}else{
totalHeaderHeight=headerHeight;
}
if(header.prevAll('.fl-builder-content').length > 0){
FLTheme._initThemerLayoutFix();
totalHeaderHeight=topbar.outerHeight();
}
if($('.fl-header-padding-top-custom').length===0){
$('.fl-page').css('padding-top', totalHeaderHeight);
}
$(win).on('scroll.fl-shrink-header', FLTheme._shrinkHeader);
}else{
$('.fl-page-header').css('top', 0);
$('.fl-page').css('padding-top', 0);
$(win).off('scroll.fl-shrink-header');
}},
_shrinkHeader: function(){
var distanceY=$(this).scrollTop(),
shrinkOn=250,
header=$('.fl-page-header'),
logo=null;
$('.fl-page-header-logo').imagesLoaded(function(){
logo=$('.fl-logo-img');
var logoForHeight=$('.fl-page-header-logo:visible .fl-logo-img').first();
if(! logoForHeight.length){
logoForHeight=logo.first();
}
var origHeight=logoForHeight.length ? logoForHeight.height():(logo.first().data('origHeight')||46);
if('undefined'===typeof logo.data('origHeight')){
logo.data('origHeight', origHeight);
if(logoForHeight.length&&! logoForHeight.is(logo.first()) ){
logoForHeight.data('origHeight', origHeight);
}}
if(distanceY > shrinkOn){
header.addClass('fl-shrink-header');
}else{
header.removeClass('fl-shrink-header');
}
if('undefined'!==typeof header.data('original-top') ){
FLTheme._fixThemerLayoutOnScroll();
}});
},
_fixedHeader: function(){
var win=$(window),
header=$('.fl-page-header'),
headerHeight=0,
totalHeaderHeight=0,
bar=$('.fl-page-bar'),
barHeight=0;
if(win.width() >=window.themeopts.medium_breakpoint){
headerHeight=header.outerHeight();
if(bar.length!=0){
barHeight=bar.outerHeight();
totalHeaderHeight=barHeight + headerHeight;
if($('body.admin-bar').length!=0){
barHeight +=32;
}
if($('html.fl-builder-edit').length!=0){
var topbarHeight=topbarHeight+11;
}
header.css('top', barHeight);
}else{
totalHeaderHeight=headerHeight;
}
if(header.prevAll('.fl-builder-content').length > 0){
FLTheme._initThemerLayoutFix();
totalHeaderHeight=bar.outerHeight();
$(win).on('scroll.fl-fixed-header', FLTheme._fixThemerLayoutOnScroll);
}
if($('body.fl-scroll-header').length===0&&$('.fl-header-padding-top-custom').length===0){
$('.fl-page').css('padding-top', totalHeaderHeight);
}
$(win).trigger('scroll');
}else{
$('.fl-page-header').css('top', 0);
$('.fl-page').css('padding-top', 0);
$(win).off('scroll.fl-fixed-header');
}},
_enableFixedHeader: function(){
var win=$(window);
if(win.width() < window.themeopts.medium_breakpoint){
win.off('scroll.fl-page-header-fixed');
$('.fl-page-header-fixed').hide();
}else{
win.on('scroll.fl-page-header-fixed', FLTheme._toggleFixedHeader);
}},
_initThemerLayoutFix: function(){
var header=$('.fl-page-header'),
themerLayouts=header.prevAll('.fl-builder-content'),
themerlayoutHeight=0;
if(! themerLayouts.length){
return;
}
header.css('position', 'initial');
$.each(themerLayouts, function(){
themerlayoutHeight +=$(this).outerHeight();
});
header.data('original-top', themerlayoutHeight);
},
_fixThemerLayoutOnScroll: function(){
var distanceY=$(window).scrollTop(),
header=$('.fl-page-header'),
headerTop=header.data('original-top');
if('undefined'===typeof headerTop){
return;
}
if(distanceY >=headerTop){
header.css('position', 'fixed');
}else{
header.css('position', 'initial');
}
if('undefined'!=typeof Waypoint){
Waypoint.refreshAll();
}},
_toggleFixedHeader: function(){
var win=$(window),
fixed=$('.fl-page-header-fixed'),
fixedVisible=fixed.is(':visible'),
header=$('.fl-page-header-primary'),
headerHidden=false;
if(0===header.length){
headerHidden=win.scrollTop() > 200;
}else{
headerHidden=win.scrollTop() > header.height() + header.offset().top;
}
if(headerHidden&&!fixedVisible){
fixed.stop().fadeIn(200);
}
else if(!headerHidden&&fixedVisible){
fixed.stop().hide();
}},
_centeredInlineLogo: function(){
var win=$(window),
$logo=$('.fl-page-nav-centered-inline-logo .fl-page-header-logo').eq(0),
$inline_logo=$('.fl-logo-centered-inline .fl-page-header-logo'),
$nav=$('.fl-page-nav-centered-inline-logo .fl-page-nav .navbar-nav'),
nav_li_length=$nav.children('li').length,
logo_li_location=Math.round(nav_li_length / 2) - 1,
$header_row=$('.fl-page-nav-centered-inline-logo .fl-page-header-row');
if(win.width() >=window.themeopts.medium_breakpoint&&$inline_logo.length < 1&&!$('.fl-page-header-primary').hasClass('fl-page-nav-toggle-visible-always')){
if($logo.hasClass('fl-inline-logo-left')&&nav_li_length % 2!=0){
$nav.children('li:nth('+logo_li_location+')').before('<li class="fl-logo-centered-inline"></li>');
}else{
$nav.children('li:nth('+logo_li_location+')').after('<li class="fl-logo-centered-inline"></li>');
}
$nav.children('.fl-logo-centered-inline').append($logo);
}
if(win.width() < window.themeopts.medium_breakpoint){
$('.fl-logo-centered-inline').remove();
if($header_row.children('.fl-page-header-logo').length < 1){
$header_row.prepend($inline_logo);
}}
},
_scrollHeader: function(){
var win=$(window),
header=null,
distance=$('.fl-page-header-primary').data('fl-distance'),
headerHeight=0;
if($('.fl-page-bar').length!=0){
header=$('.fl-page-header-primary, .fl-page-bar');
}else{
header=$('.fl-page-header-primary');
}
if(win.width() >=window.themeopts.medium_breakpoint){
win.on('scroll.fl-show-header-on-scroll', function (){
if($(this).scrollTop() > distance){
header.addClass('fl-show');
}else{
header.removeClass('fl-show');
if($('.fl-responsive-nav-enabled').length){
headerHeight=$('.fl-page-header-primary').height() * 2;
if($('.fl-page-bar').length!=0){
headerHeight +=$('.fl-page-bar').height();
}
if('undefined'!==typeof $('.fl-nav-offcanvas-collapse').css('top')){
headerHeight +=parseInt($('.fl-nav-offcanvas-collapse').css('top'));
}}
if($('.fl-nav-offcanvas-active').length&&headerHeight > 0){
$('.fl-nav-offcanvas-collapse').css({
'transform':'translateY(' + headerHeight + 'px)',
'-ms-transform':'translateY(' + headerHeight + 'px)',
'-webkit-transform':'translateY(' + headerHeight + 'px)'
});
}}
});
}else{
win.off('scroll.fl-show-header-on-scroll');
$('.fl-nav-offcanvas-collapse').css('transform', '');
}},
_megaMenu: function(){
var win=$(window),
pageHeaderMenu=$('.fl-page-header'),
menuContainer=pageHeaderMenu.find('.fl-page-header-container'),
menuWidthLimit=menuContainer.outerWidth(),
megaItem=null,
megaItems=null,
megaContentWidth=0;
pageHeaderMenu.find('li.mega-menu, li.mega-menu-disabled').each(function(){
megaItem=$(this);
megaContentWidth=megaItem.find('> ul.sub-menu').outerWidth();
if(typeof megaItem.data('megamenu-width')!=='undefined'){
megaContentWidth=megaItem.data('megamenu-width');
}
if(( megaItem.hasClass('mega-menu')&&menuWidthLimit < megaContentWidth)||FLTheme._isResponsiveNavEnabled()){
megaItem.data('megamenu-width', megaContentWidth);
if(FLTheme._isResponsiveNavEnabled()){
megaItem.find('> ul.sub-menu').css('display', 'block');
}
megaItem.removeClass('mega-menu');
if(!megaItem.hasClass('mega-menu-disabled')){
megaItem.addClass('mega-menu-disabled');
}}
else if(megaItem.hasClass('mega-menu-disabled')&&menuWidthLimit >=megaContentWidth){
megaItem.find('> ul.sub-menu').css('display', '');
megaItem.removeClass('mega-menu-disabled');
if(!megaItem.hasClass('mega-menu')){
megaItem.addClass('mega-menu');
}
megaItem.addClass('mega-menu-items-' + megaItem.children('ul').children('li').length);
}});
},
_megaMenuOnScroll: function(){
var win=$(window),
pageHeaderFixed=$('.fl-page-header-fixed'),
menuContainer=pageHeaderFixed.find('.fl-page-header-container'),
fixedVisible=pageHeaderFixed.is(':visible'),
megaItem=null,
megaMenuContent=null;
if(fixedVisible){
pageHeaderFixed.find('li.mega-menu').each(function(){
megaItem=$(this);
megaMenuContent=megaItem.find('> ul.sub-menu');
if(menuContainer.outerWidth() < megaMenuContent.outerWidth()){
megaItem.removeClass('mega-menu');
if(!megaItem.hasClass('mega-menu-disabled')){
megaItem.addClass('mega-menu-disabled');
}}else{
megaItem.removeClass('mega-menu-disabled');
if(!megaItem.hasClass('mega-menu')){
megaItem.addClass('mega-menu');
}
megaItem.addClass('mega-menu-items-' + megaItem.children('ul').children('li').length);
}});
win.off('scroll.fl-mega-menu-on-scroll');
win.off('resize.fl-mega-menu-on-scroll');
}},
_fixedHeadersWhenBuilderActive: function(){
if($('body.fl-shrink').length!=0){
$('body').removeClass('fl-shrink');
}
if($('body.fl-fixed-header').length!=0){
$('body').removeClass('fl-fixed-header');
}
if($('body.fl-scroll-header').length!=0){
$('body').removeClass('fl-scroll-header');
}},
_setupMobileNavLayout: function(){
var win=$(window),
button=$('button.navbar-toggle'),
header=$('.fl-page-header:not(.fl-page-header-fixed)'),
navBar=header.find('.fl-page-nav-collapse'),
pageWrap=$('.fl-page'),
navBarTop=0,
navHeight=win.height(),
pushOpacity=$('body').hasClass('fl-offcanvas-push-opacity-left')||$('body').hasClass('fl-offcanvas-push-opacity-right'),
logoPos=header.find('.fl-page-header-logo').offset();
if(FLTheme._isResponsiveNavEnabled()&&button.is(':visible') ){
$('body').addClass('fl-responsive-nav-enabled');
button.attr('data-toggle', 'offcanvas');
navBar.addClass('fl-nav-offcanvas-collapse');
if(0===navBar.find('.fl-button-close').length){
navBar.prepend('<div class="fl-button-close"><button class="fl-offcanvas-close" aria-label="Close Menu"><i class="fas fa-times"></i></button></div>');
}
if(pushOpacity&&0===$('.fl-offcanvas-opacity').length){
pageWrap.append('<div class="fl-offcanvas-opacity"></div>');
}
if(pageWrap.height() > win.height()){
navHeight=$(document).height();
if($('body.fl-shrink').length!=0){
navHeight=navHeight - header.height();
}}
if($('body.admin-bar').length!=0){
navBarTop=$('#wpadminbar').height();
navHeight=navHeight - navBarTop;
}
if($('.fl-page-bar').length!=0&&! $('.fl-page-header').hasClass('fl-page-nav-toggle-button') ){
navBarTop=navBarTop + ($('.fl-page-bar').height() + 1);
}
if($('.fl-scroll-header').length&&win.width() >=window.themeopts.medium_breakpoint){
navBar.css('top', pageWrap.offset().top - navBarTop + 'px');
}else{
navBar.css('top', '');
}}else{
button.attr('data-toggle', 'collapse');
navBar.removeClass('fl-nav-offcanvas-collapse');
navBar.find('.fl-button-close').remove();
navBar.css('height', '');
navBar.css('top', '');
pageWrap.removeClass('fl-nav-offcanvas-active');
$('body').find('.fl-offcanvas-opacity').remove();
$('body').removeClass('fl-responsive-nav-enabled');
}},
_toggleMobileNavLayout: function(){
$('.fl-page-nav').on('click', '.fl-offcanvas-close', function(e){
$('.fl-page').toggleClass('fl-nav-offcanvas-active');
e.stopPropagation();
});
},
_footerEffect: function(){
if($(window).width() >=window.themeopts.mobile_breakpoint){
$('.fl-page').css('margin-bottom', $('.fl-page-footer-wrap').height());
}else{
$('.fl-page').css('margin-bottom', 0);
}},
_toTop: function(){
var buttons=$('#fl-to-top');
buttons.each(function(){
$(this).click(function(){
$('html,body').animate({ scrollTop: 0 }, 'linear');
return false;
});
});
$(window).scroll(function(){
if($(this).scrollTop() > window.themeopts.scrollTopPosition){
buttons.fadeIn();
}else{
buttons.fadeOut();
}});
},
_enableLightbox: function(){
var body=$('body');
if('disabled'===window.themeopts.lightbox){
return;
}
if(!body.hasClass('fl-builder')&&!body.hasClass('woocommerce')){
$('.fl-content a').filter(function(){
return /\.(png|jpg|jpeg|gif|webp)(\?.*)?$/i.test(this.href);
}).magnificPopup({
closeBtnInside: false,
type: 'image',
gallery: {
enabled: true
}});
}
if(( body.hasClass('fl-builder')||body.hasClass('fl-theme-builder-singular') )&&!body.hasClass('woocommerce')){
$('.fl-rich-text a, .fl-module-fl-post-content a').filter(function(){
return /\.(png|jpg|jpeg|gif|webp)(\?.*)?$/i.test(this.href);
}).magnificPopup({
closeBtnInside: false,
type: 'image',
gallery: {
enabled: true
}});
}},
_enableFitVids: function(){
$('.fl-post-content').fitVids();
},
_isResponsiveNavEnabled: function(){
var win=$(window);
enabled=false;
if(( $('.fl-page-nav-toggle-visible-always').length > 0)
||($('.fl-page-nav-toggle-visible-medium-mobile').length > 0&&win.width() < window.themeopts.medium_breakpoint)
||($('.fl-page-nav-toggle-visible-mobile').length > 0&&win.width() < window.themeopts.mobile_breakpoint)
){
enabled=true;
}
return enabled;
}};
$(function(){
FLTheme.init();
});
if(!($('html.fl-builder-edit').length!==0) ){
FLTheme._initMobileHeaderLogo();
}
FLTheme._initRetinaImages();
})(jQuery);