"use strict";!function(n,e,s,t){var a=e.BUDDYX||{};a.siteLoader=function(){n(".site-loader").addClass("loaded")},a.headerClass=function(){var e=n(s),t=n("body, .site-header-wrapper");e.scroll(function(){t.toggleClass("has-sticky-header",1<=e.scrollTop())})},a.headerScroll=function(){var e=n(".site-header-wrapper").height();n("body").hasClass("has-sticky-header")?n(".site").css("paddingTop",e+10+"px"):n(".site").css("paddingTop","0px")},a.headerSearch=function(){n(".search-icon").on("click",function(e){e.preventDefault(),n(".site-header .top-menu-search-container").toggle()}),n(s).mouseup(function(e){var t=n(".top-menu-search-container");t.is(e.target)||0!==t.has(e.target).length||t.fadeOut()}),n("#primary-menu a, .cart a.menu-icons-wrapper, .bp-icon-wrap, a.user-link, .site-sub-header a, .site-wrapper a").focusin(function(){n(".site-header .top-menu-search-container").hide()})},a.desktopMenuToggle=function(){n(".buddyx-desktop-menu #primary-menu").superfish({delay:600,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"fast",speedOut:"fast",cssArrows:!1,disableHI:!1}),n("#primary-menu a, .desktop-icons a, .bp-icon-wrap").focusin(function(){n(".user-link-wrap, .user-notifications").removeClass("active")}),n(".site-title a, .user-link-wrap .user-link, button.menu-toggle").focusin(function(){n(".user-notifications").removeClass("active")}),n(".user-link-wrap .user-link, .user-notifications .bp-icon-wrap").focusin(function(){n(this).parent().removeClass("active"),n(this).parent().addClass("active")}),n(s).on("click",".user-link-wrap .user-link, .user-notifications .bp-icon-wrap",function(e){n(".user-link-wrap").removeClass("active")}),n(".user-link-wrap ul#user-profile-menu > li:last-child a").focusout(function(){n(".user-link-wrap").removeClass("active")}),n(".buddyx-mobile-menu").focusout(function(){n(".mobile-menu-heading .close-menu").focusin()})},a.mobileNav=function(){var e=n(".menu-toggle"),t=n("body");e.on("click",function(e){e.preventDefault(),i()?a():setTimeout(function(){o()},10)}),e.on("click",function(e){e.preventDefault(),i()?a():setTimeout(function(){o()},10)}),t.on("click touchstart",".mobile-menu-close",function(){i()&&a()}),t.on("click",".menu-close",function(e){e.preventDefault(),i()&&a()}),n(s).keyup(function(e){27===e.keyCode&&i()&&a()});var a=function(){n("body").removeClass("mobile-menu-opened"),n(e).removeClass("menu-toggle-open")},o=function(){n("body").addClass("mobile-menu-opened"),n(e).addClass("menu-toggle-open")},i=function(){return n("body").hasClass("mobile-menu-opened")}},a.blogLayout=function(){n(".buddyx-article--masonry:not(.without-masonry)").isotope({itemSelector:".buddyx-article-col",percentPosition:!0,masonry:{columnWidth:".buddyx-grid-sizer"}})},a.fitVids=function(){function a(){setTimeout(function(){n('iframe[src*="youtube"], iframe[src*="vimeo"]').parent().fitVids()},300)}a(),n(s).ajaxComplete(a);n(s).on("bp_nouveau_lazy_load",function(e,t){void 0===t||void 0===t.element||"iframe"==t.element.getAttribute("data-lazy-type")&&a()})},a.stickySidebar=function(){var e=n(".site-header-wrapper").height()+54;n(".sticky-sidebar-enable .sticky-sidebar").stick_in_parent({offset_top:e,recalc_every:1})},a.roundAvatarsBodyclass=function(){n(".buddypress-wrap").hasClass("round-avatars")&&n("body").addClass("round-avatars")},a.tableDataAtt=function(){if(n("table").length){var e=n("thead th");n("tbody tr td").attr("data-attr",function(){return e.eq(n(this).index()).text()})}},a.toggleTheme=function(){n(s).on("click","#buddyx-toggle-track",function(e){e.preventDefault();var t="";n("body").hasClass("buddyx-dark-theme")?(n.removeCookie("bxtheme",{path:"/"}),n("body").removeClass("buddyx-dark-theme")):(n.cookie("bxtheme","dark",{path:"/"}),n("body").addClass("buddyx-dark-theme"),t="dark"),"undefined"!=typeof toggle_theme_ajax&&null!=toggle_theme_ajax&&toggle_theme_ajax.abort();var a={action:"buddyboss_lms_toggle_theme_color",color:t};"undefined"!=typeof toggle_theme_ajax&&null!=toggle_theme_ajax&&(toggle_theme_ajax=n.post(ajaxurl,a,function(e){}))})},a.galleryPostSlider=function(){n(".buddyx-gallery-block .gallery").each(function(){var e;e=!!n("body").hasClass("rtl"),n(".buddyx-article--default .buddyx-gallery-block .gallery").slick({infinite:!1,slidesToShow:4,slidesToScroll:1,nextArrow:'',prevArrow:'',rtl:e,responsive:[{breakpoint:768,settings:{slidesToShow:2}},{breakpoint:480,settings:{slidesToShow:1}}]}),n(".buddyx-post-section .buddyx-gallery-block .gallery").slick({infinite:!1,slidesToShow:2,slidesToScroll:1,nextArrow:'',prevArrow:'',rtl:e,responsive:[{breakpoint:480,settings:{slidesToShow:1}}]}),n(".buddyx-article--list .buddyx-gallery-block .gallery, .buddyx-article--masonry .buddyx-gallery-block .gallery, .buddyx-section-half .buddyx-gallery-block .gallery").slick({infinite:!1,slidesToShow:1,slidesToScroll:1,nextArrow:'',prevArrow:'',rtl:e})})},a.mediaPress=function(){n(".activity-update-form #whats-new-form").append(n("#mpp-activity-upload-buttons"))},n(s).ready(function(){a.headerClass(),a.headerSearch(),a.desktopMenuToggle(),a.mobileNav(),a.fitVids(),a.roundAvatarsBodyclass(),a.tableDataAtt(),a.toggleTheme(),a.galleryPostSlider(),a.mediaPress()}),n(e).resize(function(){a.headerClass()}),n(e).scroll(function(){a.headerScroll()}),n(e).load(function(){a.headerClass(),a.siteLoader(),a.stickySidebar(),a.blogLayout()})}(jQuery,window,document);