/home/crealab/riscatto.brainware.com.co/wp-content/themes/buddyboss-theme/assets/js/main.min.js
/*!
* BuddyBoss Theme JavaScript Library
* @package BuddyBoss Theme
*/
!function(p){"use strict";function e(e){var t,i,n=window.location.search.substring(1).split("&");for(i=0;i<n.length;i++)if((t=n[i].split("="))[0]===e)return void 0===t[1]||decodeURIComponent(t[1])}function i(){p(".buddypress.widget .gamipress-buddypress-user-details-listing:not(.is_loaded)").each(function(){""!==p(this).text().trim()&&(p(this).parent().append('<span class="showGamipressData" data-balloon-pos="right" data-balloon="'+bs_data.gamipress_badge_label+'"></span>'),p(this).find("img").length?p(this).parent().find(".showGamipressData").append('<img src="'+p(this).find("img").attr("src")+'"/>'):p(this).parent().find(".showGamipressData").append('<i class="bb-icon-l bb-icon-award"></i>'),p(this).parent().find(".gamipress-buddypress-user-details-listing").wrap('<div class="GamiPress-data-popup"></div>'),p(this).parent().find(".gamipress-buddypress-user-details-listing").append('<i class="bb-icon-l bb-icon-times hideGamipressData"></i>')),p(this).addClass("is_loaded")})}var t;window.BuddyBossTheme={init:function(){this.add_Class(),this.header_search(),this.Menu(),this.inputStyles(),this.sidePanel(),this.headerAside(),this.bbMasonry(),this.stickySidebars(),this.bbFitVideo(),this.LoadMorePosts(),this.jsSocial(),this.beforeLogIn(),this.bbRelatedSlider(),this.BuddyPanel_Dropdown(),this.fileUpload(),this.commentsValidate(),this.messageScroll(),p(".ld-in-focus-mode").length<=0&&this.ajax_comment(),this.DropdownToggle(),this.photoCommentFocus(),this.bpRegRequired(),this.inputFileStyle(),this.primaryNavBar(),this.forumsTopic(),this.profileFilterPoint(),this.heartbeat(),this.unReadNotifications(),this.ajaxComplete(),this.bpNavDropDown(),this.scrollToAnchor()},ajaxComplete:function(){p(document).ajaxComplete(function(e,t,i){void 0!==i.data&&"string"==typeof i.data&&0<i.data.indexOf("action=messages_get_thread_messages")&&"undefined"!=typeof wp&&void 0!==wp.heartbeat&&wp.heartbeat.connectNow()})},ajax_comment:function(){p(document).on("submit","#commentform",function(e){e.preventDefault();var t=p("#commentform"),i=p.post(t.attr("action"),t.serialize()),n=p("#commentform").find("[type='submit']").val();p("#comment").prop("disabled",!0),p("#commentform").find("[type='submit']").addClass("waiting"),p("#commentform").find("[type='submit']").prop("disabled",!0).val(bs_data.translation.comment_btn_loading),i.success(function(e,t,i){var n=p("<div></div>");n.append(e);var o="#comments",a=n.find(o);a.length<1&&(o=".comment-list",a=n.find(o));var s=a.find("li"),r=!1;s.each(function(e){var t=p(s[e]);0==p("#"+t.attr("id")).length&&(r=t.attr("id"))}),p(o).replaceWith(a);var l=p("#"+r).offset().top;p("body").hasClass("sticky-header")&&(l=p("#"+r).offset().top-p("#masthead").height()),p("body").hasClass("admin-bar")&&(l-=p("#wpadminbar").height()),r&&p("body, html").animate({scrollTop:l},600)}),i.fail(function(e){var t=p("<div></div>");t.append(e.responseText),t.find("style,meta,title,a").remove(),t=t.find(".wp-die-message p").text(),"object"==typeof bb_vue_loader&&"object"==typeof bb_vue_loader.common&&void 0!==bb_vue_loader.common.showSnackbar?bb_vue_loader.common.showSnackbar(t):alert(t)}),i.always(function(){p("#comment").prop("disabled",!1),p("#commentform").find("[type='submit']").removeClass("waiting"),p("#commentform").find("[type='submit']").prop("disabled",!1).val(n)})})},add_Class:function(){"complete"!==document.readyState&&"interactive"!==document.readyState||(document.getElementsByTagName("body")[0].className+=" bb-page-loaded");var e=document.querySelector(".bb-left-panel-mobile");e&&e.addEventListener("click",function(e){e.preventDefault();var t=document.querySelector(".bb-mobile-panel-wrapper"),i=document.body;t.classList.toggle("closed"),i.classList.toggle("bb-mobile-panel-open")}),p(".bb-close-panel").on("click",function(e){e.preventDefault(),p(".bb-mobile-panel-wrapper").addClass("closed"),p("body").removeClass("bb-mobile-panel-open")}),p(".bp-template-notice.bp-sitewide-notice").insertAfter("#masthead"),document.getElementById("learndash-page-content")&&p(".bp-template-notice.bp-sitewide-notice").prependTo("#learndash-page-content"),"bbp-topic-form"===p(".btn-new-topic").attr("data-modal-id")&&p("body").addClass("forum").find("#bbpress-forums").closest("article.type-page").addClass("type-forum"),p(".bb-sfwd-aside #masthead").hasClass("elementor-header")&&(p(".bb-toggle-panel").prependTo(".ld-course-navigation"),p(".site-header--elementor #bb-toggle-theme").length||p(".site-header--elementor .course-toggle-view").length||p(".bb-elementor-header-items").prependTo(".learndash-content-body")),p(".bb-sfwd-aside #masthead").hasClass("beaver-header")&&(p(".bb-toggle-panel").prependTo(".ld-course-navigation"),p(".bb-elementor-header-items").prependTo(".learndash-content-body")),"1"===p(".beaver-header > header").attr("data-sticky")&&p("body").addClass("beaver-sticky-header"),p(document).on("click","#members-list.item-list:not(.grid) li .has_hook_content .more-action-button",function(e){p(this).parents("li.item-entry").toggleClass("active").siblings("li").removeClass("active"),e.preventDefault()}),p(".bb-mobile-panel-inner .main-navigation a").on("click",function(e){!p(e.target).hasClass("bs-submenu-toggle")&&0<!p(e.target).parents(".bb-menu-section").length&&(p(".bb-mobile-panel-wrapper").addClass("closed"),p("body").removeClass("bb-mobile-panel-open"))})},Menu:function(){p("#activity-sub-nav").BossSocialMenu(90),p("#object-nav:not(.vertical) > ul").BossSocialMenu(90),p(".bb-footer ul.footer-menu").BossSocialMenu(90),p(".bp-navs ul.component-navigation:not(.search-nav)").BossSocialMenu(35),p(".bb-profile-grid.bb-grid .bp-navs.user-subnav ul.subnav").BossSocialMenu(90),0<p("#object-nav > ul").length&&setTimeout(function(){window.dispatchEvent(new Event("resize"))},0),p(".toggle-button").panelslider({bodyClass:"ps-active",clickClose:!0,onOpen:null}),p(document).on("click",".more-button",function(e){e.preventDefault(),p(this).toggleClass("active open").next().toggleClass("active open"),p("body").toggleClass("nav_more_option_open")}),p(document).on("click",".hideshow .sub-menu a",function(e){p("body").trigger("click");var t=p(this).parent();t.parent(".sub-menu").find("li").removeClass("current selected"),t.addClass("current selected")}),p(document).on("click",".bb-share",function(e){e.preventDefault()}),p(document).click(function(e){var t=p(".more-button, .sub-menu");t.is(e.target)||0!==t.has(e.target).length||(p(".more-button").removeClass("active open").next().removeClass("active open"),p("body").removeClass("nav_more_option_open")),(p(e.target).hasClass("bb_more_dropdown__title")||0<p(e.target).closest(".bb_more_dropdown__title").length)&&(p(".more-button").removeClass("active open").next().removeClass("active open"),p("body").removeClass("nav_more_option_open"))});var t=p("#masthead").height()+55;768<p(window).width()&&p(".site-content-grid > .bb-share-container").stick_in_parent({offset_top:t,spacer:!1});window.matchMedia("( max-width: 768px )").addEventListener("change",function(e){e.matches?p(".site-content-grid > .bb-share-container").trigger("sticky_kit:detach"):p(".site-content-grid > .bb-share-container").stick_in_parent({offset_top:t,spacer:!1})}),p(".site-content-grid > .bb-share-container").stick_in_parent({offset_top:t,spacer:!1});var e=p(document),i=p(".sticky-header .site-header"),n=p(".bb-sfwd-aside .buddypanel"),o=p(".single-sfwd-lessons .site-header"),a=p(".single-sfwd-topic .site-header"),s="has-scrolled";e.scroll(function(){i.toggleClass(s,1<=e.scrollTop()),n.toggleClass(s,5<=e.scrollTop()),o.toggleClass(s,1<=e.scrollTop()),a.toggleClass(s,1<=e.scrollTop())}),p(document).on("click",".header-aside div.menu-item-has-children > a",function(e){e.preventDefault();var t=p(this).closest("div.menu-item-has-children");t.siblings(".selected").removeClass("selected"),t.toggleClass("selected")}),p("body").mouseup(function(e){p(".header-aside div.menu-item-has-children *").is(e.target)||p(".header-aside div.menu-item-has-children").removeClass("selected")})},inputStyles:function(){var e=p('.mc4wp-form-fields input[type="submit"]');e.attr("disabled",!0),p('.mc4wp-form-fields input[type="email"]').keyup(function(){0!=p(this).val().length?e.attr("disabled",!1):e.attr("disabled",!0)}),p(".bs-bp-container-reg .field-visibility-settings input[type=radio]").each(function(){var e=p(this);p('<span class="bs-radio"></span>').insertAfter(e),e.addClass("bs-radio"),e.is(":checked")&&(e.next("span.bs-radio").addClass("on"),e.closest("label").addClass("on")),e.change(function(){e.closest("div.radio").find("span.bs-radio").removeClass("on"),e.closest("div.radio").find("label").removeClass("on"),e.next("span.bs-radio").addClass("on"),e.closest("label").addClass("on")})})},header_search:function(){p(".site-header.site-header--bb .header-search-link").on("click",function(e){e.preventDefault(),p("body").toggleClass("search-visible"),navigator.userAgent.match(/(iPod|iPhone|iPad)/)||setTimeout(function(){p("body").find(".header-search-wrap .search-field-top").focus()},90)}),p(".header-search-wrap .search-field-top").focus(function(){if(!navigator.userAgent.match(/(iPod|iPhone|iPad)/)){var e=this;setTimeout(function(){e.selectionStart=e.selectionEnd=1e4},0)}}),p(".site-header.site-header--bb .close-search").on("click",function(e){e.preventDefault(),p("body").removeClass("search-visible"),p(".header-search-wrap input.search-field-top").val("")}),p(document).click(function(e){var t=p(".header-search-wrap, .header-search-link");t.is(e.target)||0!==t.has(e.target).length||p("body").removeClass("search-visible")}),p(document).keyup(function(e){27===e.keyCode&&p("body").removeClass("search-visible")})},unReadNotifications:function(){var o=[];p(document).on("click",".action-unread",function(e){var t={action:"buddyboss_theme_unread_notification",notification_id:p(this).data("notification-id")};if(-1!==o.indexOf(p(this).data("notification-id")))return!1;o.push(p(this).data("notification-id"));var i=p(".bb-icon-bell"),n=p(i).parent().children(".count");0<n.length&&("all"!==p(this).data("notification-id")?n.html(parseInt(n.html())-1):parseInt(p("#header-notifications-dropdown-elem ul.notification-list li").length)<25?n.fadeOut():n.html(parseInt(n.html())-parseInt(p("#header-notifications-dropdown-elem ul.notification-list li").length))),("undefined"!==p(".notification-wrap.menu-item-has-children.selected ul.notification-list li").length&&1==p(".notification-wrap.menu-item-has-children.selected ul.notification-list li").length||"all"===p(this).data("notification-id"))&&p("#header-notifications-dropdown-elem ul.notification-list").html('<p class="bb-header-loader"><i class="bb-icon-loader animate-spin"></i></p>'),"all"!==p(this).data("notification-id")&&(p(this).parent().parent().fadeOut(),p(this).parent().parent().remove()),p.post(ajaxurl,t,function(e){var t=p(".bb-icon-bell"),i=p(t).parent().children(".count");1===o.length&&e.success&&void 0!==e.data&&void 0!==e.data.contents&&p("#header-notifications-dropdown-elem ul.notification-list").length&&p("#header-notifications-dropdown-elem ul.notification-list").html(e.data.contents),void 0!==e.data.total_notifications&&0<e.data.total_notifications&&0<i.length?(p(i).text(e.data.total_notifications),p(".notification-header .mark-read-all").show()):(p(i).remove(),p(".notification-header .mark-read-all").fadeOut());var n=o.indexOf(p(this).data("notification-id"));o.splice(n,1)})})},sidePanel:function(){function t(){if(p("body").hasClass("bb-buddypanel")&&p("body").hasClass("header-style-5")&&p(".buddypanel").css("height",p("html").height()-p(".site-header").height()-p("#wpadminbar").height()+"px"),p("body").hasClass("buddypanel-header")||p("body").hasClass("buddypanel-logo")){if(p(".buddypanel .site-branding").length)var e=p(".buddypanel .site-branding").outerHeight();else e=0;if(p(".buddypanel .panel-head").length)var t=p(".buddypanel .panel-head").outerHeight();else t=0;if(p(".buddypanel .buddypanel-site-icon:visible").length)var i=p(".buddypanel .buddypanel-site-icon").outerHeight();else i=0;p("body:not(.buddypanel-open) .side-panel-inner:not(.is_block)").css("height","100%").css("height","-="+(t+i+40)+"px"),p("body.buddypanel-open .side-panel-inner:not(.is_block)").css("height","100%").css("height","-="+(e+t+40)+"px")}}function e(){window.matchMedia("(pointer: coarse)").matches?p(".side-panel-inner:not(.is_block)").addClass("touch-only"):(p(".side-panel-inner:not(.is_block)").removeClass("touch-only"),p(".side-panel-inner:not(.is_block)").mousewheel(function(e){e.preventDefault(),p(".side-panel-inner").removeClass("touch-only");var t=this.scrollTop;this.scrollTop=t+e.deltaY*e.deltaFactor*-1,p("#buddypanel-menu:not(.buddypanel-menu-block)").addClass("side-panel-scroll"),p("#buddypanel-menu:not(.buddypanel-menu-block) li a").css("margin-top","-"+this.scrollTop+"px"),p("#buddypanel-menu:not(.buddypanel-menu-block) li a:after","#buddypanel-menu:not(.buddypanel-menu-block) li a:before").css("display","none"),clearTimeout(p.data(this,"scrollTimer")),p.data(this,"scrollTimer",setTimeout(function(){p("#buddypanel-menu:not(.buddypanel-menu-block)").removeClass("side-panel-scroll")},250))}))}p(".bb-toggle-panel").on("click",function(e){e.preventDefault(),p("body").addClass("buddypanel-transtioned"),p(".buddypanel").on("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){setTimeout(function(){p("body").removeClass("buddypanel-transtioned")},200)}),function(e,t,i,n,o){var a=e+"="+escape(t)+";";i&&(i instanceof Date?isNaN(i.getTime())&&(i=new Date):i=new Date((new Date).getTime()+1e3*parseInt(i)*60*60*24),a+="expires="+i.toUTCString()+";");n&&(a+="path="+n+";");o&&(a+="domain="+o+";");document.cookie=a}("buddypanel",p("body").hasClass("buddypanel-open")?(p("body").removeClass("buddypanel-open"),"closed"):(p("body").addClass("buddypanel-open"),"open"),30,"/"),0<p(".elementor-section-stretched").length&&(setTimeout(function(){p(window).trigger("resize")},300),setTimeout(function(){p(window).trigger("resize")},500)),0<p(".elementor-section[style*=width]").length&&(setTimeout(function(){p(window).trigger("resize")},300),setTimeout(function(){p(window).trigger("resize")},500)),p("side-panel-inner:not(.is_block) .bs-submenu-toggle").removeClass("bs-submenu-open"),p("side-panel-inner:not(.is_block) .sub-menu").removeClass("bb-open")}),t(),p(window).on("resize",function(){t()}),p(".bb-toggle-panel").on("click",function(e){e.preventDefault(),t(),setTimeout(function(){t()},300),setTimeout(function(){t()},600)}),e(),p(window).resize(function(){e()})},headerAside:function(){function n(){p(".user-wrap .menu-item-has-children").each(function(){var e=p(this),t=p("> .wrapper > .bb-sub-menu",e),i=e.closest(".wrapper"),n=e.position(),o=i.position(),a=n.top+o.top,s=jQuery(window).height()-a-120;t.css({"max-height":s+"px"})}),p(".user-wrap .menupop.parent").each(function(){var e=p(this),t=p("> .ab-sub-wrapper > .ab-submenu",e),i=e.position(),n=jQuery(window).height()-i.top-120;t.css({"max-height":n+"px"})})}p(".sub-menu-inner > li").each(function(){0!==p(this).find(".ab-sub-wrapper").length&&(p(this).addClass("parent"),p(this).find(".ab-sub-wrapper").addClass("wrapper"))}),n(),p(window).resize(function(){n()}),p(".user-wrap li.parent, .user-wrap .menu-item-has-children").on("mouseover",function(){var e=p(this),t=p("> .wrapper",e),i=e.position();t.css({top:i.top}),n()})},DropdownToggle:function(){jQuery(document).on("click","a.bs-dropdown-link.bb-reply-actions-button",function(e){e.preventDefault(),jQuery(this).hasClass("active")?jQuery(this).removeClass("active").next(".bb-reply-actions-dropdown").removeClass("open").closest("li").removeClass("dropdown-open"):(jQuery("a.bs-dropdown-link.bb-reply-actions-button").removeClass("active").next(".bb-reply-actions-dropdown").removeClass("open").closest("li").removeClass("dropdown-open"),jQuery(this).toggleClass("active").next(".bb-reply-actions-dropdown").toggleClass("open").closest("li").toggleClass("dropdown-open"))}),p(document).click(function(e){var t=p(".bb-reply-actions-dropdown, a.bs-dropdown-link.bb-reply-actions-button"),i=p(".forum_single_action_more-wrap");t.is(e.target)||0!==t.has(e.target).length||(p(".bb-reply-actions-dropdown").removeClass("open"),p("a.bs-dropdown-link.bb-reply-actions-button").removeClass("active").closest("li").removeClass("dropdown-open")),(p(e.target).hasClass("bb_more_dropdown__title")||0<p(e.target).closest(".bb_more_dropdown__title").length)&&(p(".bb-reply-actions-dropdown").removeClass("open"),p("a.bs-dropdown-link.bb-reply-actions-button").removeClass("active").closest("li").removeClass("dropdown-open")),i.is(e.target)||0!==i.has(e.target).length||p(".forum_single_action_wrap.is_visible").removeClass("is_visible")}),p(document).on("click",".bb-reply-actions-dropdown .bbp-reply-to-link",function(e){p(".bb-reply-actions-dropdown").removeClass("open"),p("a.bs-dropdown-link.bb-reply-actions-button").removeClass("active")}),p(document).on("click",".bs-forums-items .bbp-reply-to-link",function(e){p(this).closest(".bs-reply-list-item").addClass("in-focus")})},bbMasonry:function(){p(".bb-masonry").css("visibility","visible").masonry({itemSelector:".bb-masonry .hentry",columnWidth:".bb-masonry-sizer"})},bbSlider:function(){},stickySidebars:function(){var e=p("#masthead").outerHeight(),t=30;p("body").hasClass("sticky-header")&&p("body").hasClass("admin-bar")?t=e+62:p("body").hasClass("sticky-header")?t=e+30:p("body").hasClass("admin-bar")&&(t=62),1081<p(window).width()&&(p(".bb-sticky-sidebar").stick_in_parent({spacer:!1,offset_top:t}),p(".activity #activity-stream #bp-ajax-loader .loading").length&&p(".bb-sticky-sidebar").trigger("sticky_kit:detach"),p(".activity #buddypress").on("bp_ajax_request",'[data-bp-list="activity"]',function(){p(".bb-sticky-sidebar").stick_in_parent({spacer:!1,offset_top:t})}),p(".bb-sticky-sidebar").parent("#secondary, #user-activity").css("min-height",p(".bb-sticky-sidebar").height()));window.matchMedia("( max-width: 1081px )").addEventListener("change",function(e){e.matches?p(".bb-sticky-sidebar").trigger("sticky_kit:detach"):p(".bb-sticky-sidebar").stick_in_parent({spacer:!1,offset_top:t})}),p(window).resize(function(){p(".bb-sticky-sidebar").parent("#secondary, #user-activity").css("min-height",p(".bb-sticky-sidebar").height())}),0<p(".bb-sticky-sidebar").length&&p(document).ajaxComplete(function(e,t,i){setTimeout(function(){p(document.body).trigger("sticky_kit:recalc")},150)})},bbFitVideo:function(){0<p(".thrv-page-section .tcb-video-background-el iframe").length&&p(".thrv-page-section .tcb-video-background-el iframe").addClass("fitvidsignore"),0<p(".tutor-video-player iframe").length&&p(".tutor-video-player iframe").addClass("fitvidsignore");function i(){setTimeout(function(){var e="";0<!p(".tutor-course-details-page").length&&0<!p(".tutor-course-single-content-wrapper").length&&(e='iframe[src*="vimeo"]'),p('iframe[src*="youtube"]'+(e?","+e:"")).parent().fitVids()},300)}i(),p(document).ajaxComplete(function(){p(".elementor-popup-modal .elementor-widget-video").length||i(),p(".elementor-video-container").addClass("fitvidsignore")});p(document).on("bp_nouveau_lazy_load",function(e,t){void 0!==t&&void 0!==t.element&&"iframe"==t.element.getAttribute("data-lazy-type")&&i()})},LoadMorePosts:function(){p(document).on("click",".button-load-more-posts",function(e){e.preventDefault();var t=p(this),i=t.attr("href"),n=p(".post-grid");t.addClass("loading"),p.get(i,function(e){p(".pagination-below").remove(),p(e).find("article.status-publish").each(function(e,t){var i=p(t);n.hasClass("bb-masonry")?n.append(i).masonry("appended",i).masonry():n.append(i)}),p(".post-grid").after(p(e).find(".pagination-below")),p(".post-grid").hasClass("bb-masonry")&&p(".bb-masonry").masonry({});var t=p(e).filter("script.bb_bookmarks_bootstrap");0<t.length&&t.each(function(){p("body").append(p(this))})})}),p(document).on("scroll",function(){var e=p(".post-infinite-scroll");if(e.length){var t=e.offset();p(window).scrollTop()+p(window).height()>t.top&&(e.hasClass("loading")||e.trigger("click"))}})},postGridLoader:function(){var e=p("article.type-post").not(".first").first().clone();e.removeClass("format-quote"),e.find(".entry-meta").remove(),e.find(".mejs-offscreen").remove(),e.find(".mejs-container").remove(),e.find("img").remove(),e.find(".post-format-icon").remove(),e.find(".post-main-link").remove(),e.find(".bb-gallery-slider").replaceWith('<a href="" class="entry-media entry-img"></a>'),e.find(".entry-img").length||e.prepend('<a href="" class="entry-media entry-img"></a>');for(var t="",i=0;i<=60;i++)t+=" ";e.find(".entry-content").html("<span>"+t+"</span>"),t="";for(i=0;i<=20;i++)t+=" ";return e.find(".entry-title > a").html(t),e.addClass("loading"),e},jsSocial:function(){p(".bb-shareIcons").jsSocials({showLabel:!0,showCount:!1,shares:[{share:"facebook",label:bs_data.facebook_label},{share:"twitter",label:bs_data.twitter_label}]}),p(".jssocials-share-link").each(function(){var e=p(this).find(".jssocials-share-label").text();p(this).attr("data-balloon-pos","right"),p(this).attr("data-balloon",e),p(this).attr("aria-label",e)}),p(".post-related-posts").find("a[data-balloon-pos]").attr("data-balloon-pos","left")},beforeLogIn:function(){var t="#bp-login-widget-user-login",i="#bp-login-widget-user-pass",n=p("#bp-login-widget-submit");function e(){var e=!1;p(t+","+i).each(function(){""==p(this).val()&&(e=!0)}),e?n.removeClass("bp-login-btn-active"):n.addClass("bp-login-btn-active")}e(),p(t+", "+i).keyup(function(){e()}),setTimeout(function(){p("#bp-login-widget-user-pass").each(function(e,t){p(this).is("*:-webkit-autofill")&&n.addClass("bp-login-btn-active")})},200);var o=".bbp-login-form #user_login",a=".bbp-login-form #user_pass",s=p(".bbp-login-form #user-submit");function r(){var e=!1;p(o+","+a).each(function(){""==p(this).val()&&(e=!0)}),e?s.removeClass("bp-login-btn-active"):s.addClass("bp-login-btn-active")}r(),p(o+", "+a).keyup(function(){r()}),p('form.bbp-login-form label[for="user_pass"]').append("<span class='label-switch'></span>"),p(document).on("click","form.bbp-login-form .label-switch",function(e){var t=p(this),i=t.closest(".bbp-password").find("input#user_pass");t.toggleClass("bb-eye"),t.hasClass("bb-eye")?i.attr("type","text"):i.attr("type","password")}),p('form#bp-login-widget-form label[for="bp-login-widget-user-pass"]').append("<span class='label-switch'></span>"),p(document).on("click","form#bp-login-widget-form .label-switch",function(e){var t=p(this),i=t.closest("form").find("input#bp-login-widget-user-pass");t.toggleClass("bb-eye"),t.hasClass("bb-eye")?i.attr("type","text"):i.attr("type","password")})},bbRelatedSlider:function(){if(p("body").hasClass("has-sidebar"))var i=900;else i=544;function e(){var e="rtl"===p("html").attr("dir"),t={infinite:!1,slidesToShow:2,slidesToScroll:2,adaptiveHeight:!0,arrows:!0,prevArrow:e?'<a class="bb-slide-next"><i class="bb-icon-l bb-icon-angle-left"></i></a>':'<a class="bb-slide-prev"><i class="bb-icon-l bb-icon-angle-right"></i></a>',nextArrow:e?'<a class="bb-slide-prev"><i class="bb-icon-l bb-icon-angle-left"></i></a>':'<a class="bb-slide-next"><i class="bb-icon-l bb-icon-angle-right"></i></a>',appendArrows:".post-related-posts h3",rtl:e,responsive:[{breakpoint:i,settings:{slidesToShow:1,slidesToScroll:1}}]};p(".post-related-posts .post-grid").not(".slick-initialized").slick(t)}e(),p(window).on("resize",function(){e(),p(".post-related-posts .slick-slider").slick("reinit"),p(".post-related-posts .slick-slider").slick("resize"),p(".post-related-posts .slick-slider").slick("refresh")})},BuddyPanel_Dropdown:function(){p(".buddypanel-menu .sub-menu").each(function(){p(this).closest("li.menu-item-has-children").find("a:first").append('<i class="bb-icon-l bb-icon-angle-down bs-submenu-toggle"></i>')}),p(document).on("click",".bs-submenu-toggle",function(e){e.preventDefault(),p(this).toggleClass("bs-submenu-open").closest("a").next(".sub-menu").toggleClass("bb-open"),p(this).parent(".menu-item-has-children").toggleClass("bb-open-parent")}),p("aside.buddypanel .buddypanel-menu .current-menu-parent").find("ul.sub-menu").addClass("bb-open");var e=p(".bb-mobile-panel-inner .menu-item-has-children.current-menu-ancestor, .bb-mobile-panel-inner .menu-item-has-children.current_page_item, .bb-mobile-panel-inner .menu-item-has-children.current-menu-item, .bb-mobile-panel-inner .menu-item-has-children.current-menu-parent");e.children("ul.sub-menu").addClass("bb-open"),e.children("ul.sub-menu").prev().children(".bs-submenu-toggle").addClass("bs-submenu-open")},fileUpload:function(){p(".job-manager-form fieldset input[type=file], .ginput_container_fileupload > input[type=file], .ginput_container_post_image input[type=file]").each(function(){var e=p(this),t=e.attr("id");e.after('<label for="'+t+'">'+bs_data.translation.choose_a_file_label+"</label>")}),p(".job-manager-form fieldset input[type=file], .ginput_container_fileupload > input[type=file], .ginput_container_post_image input[type=file]").change(function(e){var t=p(this);t.next().html(t.val());0===t.val().length?t.next().html(bs_data.translation.choose_a_file_label):t.next().html(t.val().replace(/C:\\fakepath\\/i,""))})},commentsValidate:function(){jQuery.validator.addMethod("BBEmail",function(e,t){return this.optional(t)||/^([a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e)},bs_data.translation.email_validation);p("#commentform").validate({rules:{author:{required:!0,normalizer:function(e){return p.trim(e)}},email:{required:!0,BBEmail:!0},url:{url:!0},comment:{required:!0,normalizer:function(e){return p.trim(e)}}},messages:{author:"Please enter your name",email:{required:"Please enter an email address",email:"Please enter a valid email address"},url:"Please enter a valid URL e.g. http://www.mysite.com",comment:"Please fill the required field"},errorElement:"div",errorPlacement:function(e,t){t.after(e)}});p("#comment").focus(function(){p(this).parents("#respond").addClass("bb-active")}),p("#comment").blur(function(){p(this).parents("#respond").removeClass("bb-active")})},messageScroll:function(){},photoCommentFocus:function(){p(document).on("click",".bb-media-model-wrapper .bs-comment-textarea",function(e){e.preventDefault(),p(".bb-media-model-wrapper").animate({scrollTop:p(".bb-media-model-wrapper")[0].scrollHeight},"slow")})},bpRegRequired:function(){p(".bs-bp-container-reg .signup-form input").removeAttr("required")},inputFileStyle:function(){var e=document.querySelectorAll(".bb-inputfile");Array.prototype.forEach.call(e,function(e){var i=e.nextElementSibling,n=i.innerHTML;e.addEventListener("change",function(e){var t="";(t=this.files&&1<this.files.length?(this.getAttribute("data-multiple-caption")||"").replace("{count}",this.files.length):e.target.value.split("\\").pop())?i.querySelector("span").innerHTML=t:i.innerHTML=n})})},primaryNavBar:function(){function o(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return[].slice.call(e)}var a=document.getElementById("primary-navbar"),s=document.getElementById("primary-menu"),r=document.getElementById("navbar-extend"),l=document.getElementById("navbar-collapse");function t(){var e=r.children,t=0;[].concat(o(e)).forEach(function(e){e.outHTML="",s.appendChild(e)});var i=a.offsetWidth-(l.offsetWidth+30),n=(s.offsetWidth,s.children);[].concat(o(n)).forEach(function(e){t+=e.offsetWidth+(p("body").hasClass("header-style-2")?0:5),i<t&&(e.outHTML="",r.appendChild(e))}),1<=r.getElementsByTagName("li").length?l.classList.add("hasItems"):l.classList.remove("hasItems"),s.classList.remove("bb-primary-overflow")}void 0!==s&&null!=s&&(p(window).on("resize",function(){setTimeout(function(){t()},300)}),t(),setTimeout(function(){t()},300),setTimeout(function(){t()},900),p(".bb-toggle-panel").on("click",function(e){e.preventDefault(),t(),setTimeout(function(){t(),p(".post-grid").hasClass("bb-masonry")&&p(".bb-masonry").masonry({})},300),setTimeout(function(){t()},600)}))},forumsTopic:function(){var t=p("#masthead").outerHeight();768<p(window).width()&&p("#bbpress-forums .bs-topic-sidebar-inner").stick_in_parent({offset_top:t+45,spacer:!1,bottoming:!0});window.matchMedia("( max-width: 768px )").addEventListener("change",function(e){e.matches?p("#bbpress-forums .bs-topic-sidebar-inner").trigger("sticky_kit:detach"):p("#bbpress-forums .bs-topic-sidebar-inner").stick_in_parent({offset_top:t+45,spacer:!1,bottoming:!1})}),p("body .bbp-topic-form").length&&(p(document).on("keyup",".bbp-topic-form #new-post #bbp_topic_title",function(e){9!=e.which||e.shiftKey||(e.preventDefault(),p(e.target).closest(".bbp-topic-form #new-post .bbp-editor-content").focus())}),p(document).on("keyup",".bbp-topic-form #new-post .bbp-editor-content",function(e){9==e.which&&e.shiftKey&&(e.preventDefault(),p(e.target).closest(".bbp-topic-form #new-post #bbp_topic_title").focus())}),p(document).on("keyup",".bbp-topic-form #new-post #bbp_topic_tags",function(e){9==e.which&&e.shiftKey&&(e.preventDefault(),p(e.target).closest(".bbp-topic-form #new-post #bbp_editor_topic_content").focus())})),p("body .bbp-reply-form").length&&p(document).on("keyup",".bbp-reply-form #new-post #bbp_topic_tags",function(e){9==e.which&&e.shiftKey&&(e.preventDefault(),p(e.target).closest(".bbp-reply-form #new-post .bbp-editor-content").focus())});var b='<div class="bb-modal-overlay js-modal-close"></div>';p(document).on("click","a[data-modal-id]",function(e){e.preventDefault(),p("body").addClass("bb-modal-overlay-open").append(b),p(".bb-modal-overlay").fadeTo(0,1);var t=p(e.target).closest(".bb-grid"),i=p(this).attr("data-modal-id");if(1===p("body.single-forum").length&&p(e.target).parent().hasClass("bbpress-sidebar")?t=t.find("#bbpress-forums"):0<t.find("#bbpress-forums").length&&(t=p(e.target).closest("#bbpress-forums")),t.find("."+i).fadeIn(0).addClass("bb-modal-open"),t.find(".bbp-reply-form").length){t.find(".bbp-reply-form").find("#bbp_reply_to").val(0),t.find(".bbp-reply-form").find("#bbp-reply-to-user").html(t.find(t.find(".topic-lead").find(".item-meta").get(0)).find(".bbp-author-name").text());var n=t.find("#bbp_topic_id").val(),o=p("#topic-"+n+"-replies li.bs-item-wrap #bbp_topic_excerpt").val();""!=o&&(o+="...",t.find(".bbp-reply-form").find("#bbp-reply-exerpt").text(o));var a=t.find(".bbp-the-content").data("key");void 0!==window.forums_medium_reply_editor&&void 0!==window.forums_medium_reply_editor[a]&&window.forums_medium_reply_editor[a].subscribe("editableInput",function(){""!=p.trim(window.forums_medium_reply_editor[a].getContent()).replace("<p><br></p>","")?t.find(".bbp-the-content").removeClass("error"):t.find(".bbp-the-content").addClass("error")})}void 0!==window.forums_medium_topic_editor&&void 0!==window.forums_medium_topic_editor[a]&&window.forums_medium_topic_editor[a].subscribe("editableInput",function(){""!=p.trim(window.forums_medium_topic_editor[a].getContent()).replace("<p><br></p>","")?t.find(".bbp-the-content").removeClass("error"):t.find(".bbp-the-content").addClass("error")}),t.find(".bbp-topic-form").trigger("bbp_after_load_topic_form",{click_event:this}),t.find(".bbp-reply-form").trigger("bbp_after_load_reply_form",{click_event:this})}),p(document).on("click","a[data-modal-id-inline]",function(e){if(!p(this).closest(".bs-single-forum-list").hasClass("bb-single")){e.preventDefault(),p("body").addClass("bb-modal-overlay-open").append(b),p(".bb-modal-overlay").fadeTo(0,1);var t=p(this).attr("data-modal-id-inline");p("#"+t).fadeIn(0).addClass("bb-modal-open");var i=p(e.target).closest(".bb-grid");if(i.find(".bbp-reply-form").length){i.find(".bbp-reply-form").find("#bbp-reply-to-user").html(p(p(this).closest("li").find(".bs-reply-list-item").get(0)).find(".item-meta").find(".bbp-author-name").text());var n=p(this).closest(".bs-reply-list-item").find(".bbp-author-name").text().trim(),o=p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content").text().trim().substring(0,50);if(p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bb-activity-media-elem").length){var a=p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bb-activity-media-elem .document-helper-text")[0];""!==(a=p(a).text())&&(o=p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content").text().trim().replace(new RegExp(a,"g"),"").substring(0,50).trim());var s=p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bb-activity-media-elem").not(".document-activity")[0];""!==(s=p(s).text().trim())&&(o=p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content").text().trim().replace(new RegExp(s,"g"),"").substring(0,50).trim())}if(p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bb-activity-media-wrap .bp-video-thumbnail-uploader").length){var r=p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bb-activity-media-wrap")[0];""!==(r=p(r).text().trim())&&(o=p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content").text().trim().replace(new RegExp(r,"g"),"").substring(0,50).trim())}if(p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bbp-reply-revision-log").length){var l=p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content .bbp-reply-revision-log").text().trim();o=p(this).closest(".bs-reply-list-item").find(">.bbp-reply-content").text().trim().replace(new RegExp(l,"g"),"").substring(0,50).trim()}""!==n&&i.find(".bbp-reply-form").find("#bbp-reply-to-user").text(n);var d=i.find(".bbp-reply-form").find("#bbp-reply-exerpt");""!==o?(d.removeClass("show-empty"),o+="..."):d.addClass("show-empty"),d.text(o);var c=i.find(".bbp-the-content").data("key");void 0!==window.forums_medium_reply_editor&&void 0!==window.forums_medium_reply_editor[c]&&window.forums_medium_reply_editor[c].subscribe("editableInput",function(){""!=p.trim(window.forums_medium_reply_editor[c].getContent()).replace("<p><br></p>","")?i.find(".bbp-the-content").removeClass("error"):i.find(".bbp-the-content").addClass("error")})}i.find(".bbp-reply-form").trigger("bbp_after_load_inline_reply_form",{click_event:this})}}),p(document).on("click",".js-modal-close",function(e){e.preventDefault(),p(".bb-modal-box, .bb-modal-overlay").fadeOut(50,function(){p(".bb-modal-overlay").remove()}),p("body").removeClass("popup-modal-reply bb-modal-overlay-open"),p(".bs-reply-list-item.in-focus").removeClass("in-focus"),p(".bb-modal-box").removeClass("bb-modal-open"),p(this).trigger("bbp_after_close_topic_reply_form",{click_event:this})}),p(document).on("click",".bb-modal-overlay",function(e){e.preventDefault(),p("body").removeClass("bb-modal-overlay-open"),p(".bb-modal-box, .bb-modal-overlay").fadeOut(50,function(){p(".bb-modal-overlay").remove()}),p(".bb-modal-box").removeClass("bb-modal-open"),p(document).trigger("bbp_after_close_topic_reply_form_on_overlay",{click_event:this})}),e("bbp_reply_to")&&e("bbp_reply_to")&&(0<parseInt(e("bbp_reply_to"))&&p(document).find(".bbp-reply-to-link."+e("bbp_reply_to")).length?p(window).load(function(){p(".bbp-reply-to-link."+e("bbp_reply_to")).trigger("click")}):p(".bbp-topic-reply-link").trigger("click")),p(".bbp-topic-form form").length&&p(".bbp-topic-form form").find(".bp-feedback.error").length&&p(".btn-new-topic").trigger("click"),p(".bbp-topic-form form").on("keyup","#bbp_topic_title,#bbp_anonymous_author,#bbp_anonymous_email",function(e){e.preventDefault(),""===p.trim(p(this).val())?p(this).addClass("error"):p(this).removeClass("error")}),p(document).on("click",".bbp-topic-form form #bbp_topic_submit",function(e){e.preventDefault();var t=p(e.target).closest("form");if(t.hasClass("submitting"))return!1;t.addClass("submitting");var i=!0,n=!0;t.find(".bbp-form-anonymous").length&&(""===p.trim(t.find("#bbp_anonymous_author").val())?(t.find("#bbp_anonymous_author").addClass("error"),i=!1):t.find("#bbp_anonymous_author").removeClass("error"),""===p.trim(t.find("#bbp_anonymous_email").val())?(t.find("#bbp_anonymous_email").addClass("error"),i=!1):t.find("#bbp_anonymous_email").removeClass("error")),""===p.trim(t.find("#bbp_topic_title").val())?(t.find("#bbp_topic_title").addClass("error"),i=!1):t.find("#bbp_topic_title").removeClass("error");var o=t.find(".bbp_editor_topic_content").data("key"),a=!1;void 0!==window.forums_medium_topic_editor&&void 0!==window.forums_medium_topic_editor[o]&&(a=window.forums_medium_topic_editor[o]),(0<t.find("#bbp_media").length&&t.find("#bbp_document").length<=0&&t.find("#bbp_video").length<=0&&0<t.find("#bbp_media_gif").length&&""==t.find("#bbp_media").val()&&""==t.find("#bbp_media_gif").val()||0<t.find("#bbp_document").length&&t.find("#bbp_media").length<=0&&t.find("#bbp_video").length<=0&&0<t.find("#bbp_media_gif").length&&""==t.find("#bbp_document").val()&&""==t.find("#bbp_media_gif").val()||0<t.find("#bbp_video").length&&t.find("#bbp_media").length<=0&&t.find("#bbp_document").length<=0&&0<t.find("#bbp_media_gif").length&&""==t.find("#bbp_video").val()&&""==t.find("#bbp_media_gif").val()||0<t.find("#bbp_document").length&&t.find("#bbp_media_gif").length<=0&&""==t.find("#bbp_document").val()||0<t.find("#bbp_media").length&&t.find("#bbp_media_gif").length<=0&&""==t.find("#bbp_media").val()||0<t.find("#bbp_video").length&&t.find("#bbp_media_gif").length<=0&&""==t.find("#bbp_video").val()||0<t.find("#bbp_media_gif").length&&t.find("#bbp_media").length<=0&&t.find("#bbp_document").length<=0&&t.find("#bbp_video").length<=0&&""==t.find("#bbp_media_gif").val())&&(n=!1);var s="";0<t.find("#link_preview_data").length&&""!==t.find("#link_preview_data").val()&&(s=JSON.parse(t.find("#link_preview_data").val()).link_url),a&&""===p.trim(a.getContent().replace("<p><br></p>",""))&&0==n?""===s&&(t.find("#bbp_editor_topic_content").addClass("error"),i=!1):a||""!==p.trim(t.find("#bbp_topic_content").val())||0!=n?(a&&t.find("#bbp_editor_topic_content").removeClass("error"),t.find("#bbp_topic_content").removeClass("error")):""===s&&(t.find("#bbp_topic_content").addClass("error"),i=!1),i?t.submit():t.removeClass("submitting")}),p(".bbp-reply-form form #bbp_reply_submit").on("click",function(e){e.preventDefault();var t=!0,i=p(e.target).closest("form");if(i.find(".bbp-form-anonymous").length&&(""===p.trim(i.find("#bbp_anonymous_author").val())?(i.find("#bbp_anonymous_author").addClass("error"),t=!1):i.find("#bbp_anonymous_author").removeClass("error"),""===p.trim(i.find("#bbp_anonymous_email").val())?(i.find("#bbp_anonymous_email").addClass("error"),t=!1):i.find("#bbp_anonymous_email").removeClass("error")),t){i.find('input[name="bbp_topic_id"]').val();i.submit()}p("body").removeClass("popup-modal-reply"),p(".bs-reply-list-item.in-focus").removeClass("in-focus"),i.find(".bbp_topic_tags_wrapper tags tag").remove()}),p(document).keydown(function(e){if(e.ctrlKey&&13===e.keyCode){var t=p(".bbp-topic-form form"),i=p(".bbp-reply-form form");i.length&&i.find("#bbp_reply_submit").trigger("click"),t.length&&t.find("#bbp_topic_submit").trigger("click")}}),window.addReply={moveForm:function(e,t,i,n){p(".bbp-reply-form").find("#bbp_reply_to").val(t);var o,a=this,s=a.I(e),r=a.I(i),l=a.I("bbp-cancel-reply-to-link"),d=a.I("bbp_reply_to"),c=a.I("bbp_topic_id");if(s&&r&&l&&d){a.respondId=i,n=n||!1,a.I("bbp-temp-form-div")||((o=document.createElement("div")).id="bbp-temp-form-div",o.style.display="none",r.parentNode.insertBefore(o,r)),r.classList.remove("mfp-hide"),s.parentNode.appendChild(r),"undefined"!=typeof tinyMCE&&(tinyMCE.remove(),tinyMCE.init({selector:"textarea.bbp-the-content",menubar:!1,branding:!1,plugins:"image,lists,link",toolbar:"bold italic bullist numlist blockquote link"})),c&&n&&(c.value=n),d.value=t,l.style.display="",l.onclick=function(){var e=addReply,t=e.I("bbp-temp-form-div"),i=e.I(e.respondId);if(t&&i)return e.I("bbp_reply_to").value="0",i.classList.add("mfp-hide"),t.parentNode.insertBefore(i,t),t.parentNode.removeChild(t),this.style.display="none",this.onclick=null,!1};try{a.I("bbp_reply_content").focus()}catch(e){}return!1}},I:function(e){return document.getElementById(e)}}},profileFilterPoint:function(){var e=window.matchMedia("( max-width: 800px )");function t(){e.matches?p("#bp-profile-search-form-outer").prependTo("#buddypress"):p("#bp-profile-search-form-outer").prependTo("#secondary")}e.addEventListener("change",function(e){t()}),t()},heartbeat:function(){(void 0!==bs_data.show_notifications&&"1"==bs_data.show_notifications||void 0!==bs_data.show_messages&&"1"==bs_data.show_messages)&&(p(document).on("heartbeat-send",this.bpHeartbeatSend.bind(this)),p(document).on("heartbeat-tick",this.bpHeartbeatTick.bind(this)))},bpNavDropDown:function(){p("nav .bp-navs__dropdown").change(function(){window.location=p(this).find("option:selected").val()})},scrollToAnchor:function(){if(p("body").hasClass("sticky-header")&&p("body").hasClass("single-post")){var o=p("#masthead").height()+55;if(p(document).on("click",".widget_recent_comments .recentcomments > a, .widget_recent_comments .wp-block-latest-comments__comment-link, .widget.new_blog_comment.bp-latest-activities .activity-time-since",function(e){var t=p(this).attr("href"),i=t.substr(t.indexOf("#")+1),n=p("#"+i);n.length&&(e.preventDefault(),p("html,body").animate({scrollTop:n.offset().top+-o},"slow"),window.history.pushState({},"","#"+i))}),-1<window.location.href.indexOf("#comment-")){var e=window.location.href,t=e.substr(e.indexOf("#")+1),i=p("#"+t);setTimeout(function(){i.length&&p("html,body").animate({scrollTop:i.offset().top+-o},100)},100)}}},bpHeartbeatSend:function(e,t){t.customfield="",p("#buddypress").trigger("bp_heartbeat_send",t)},bpHeartbeatTick:function(e,t){this.bpInjectNotifications(e,t),p("#buddypress").trigger("bp_heartbeat_tick",t)},bpInjectNotifications:function(e,t){if(void 0!==t.unread_notifications&&""!==t.unread_notifications&&p("#header-notifications-dropdown-elem .notification-dropdown .notification-list").empty().html(t.unread_notifications),void 0!==t.unread_messages&&""!==t.unread_messages&&p("#header-messages-dropdown-elem .notification-dropdown .notification-list").empty().html(t.unread_messages),void 0!==t.total_notifications&&0<t.total_notifications){var i=p(".bb-icon-bell"),n=p(i).parent().children(".count");p(".notification-header .mark-read-all").show(),0<n.length?p(n).text(t.total_notifications):p(i).parent(":not(.group-subscription)").append('<span class="count"> '+t.total_notifications+" </span>")}else{i=p(".bb-icon-bell"),n=p(i).parent().children(".count");p(n).remove(),p(".notification-header .mark-read-all").fadeOut()}if(void 0!==t.total_unread_messages&&0===parseInt(t.total_unread_messages)){var o=p(".bb-icon-inbox");0<(a=p(o).parent().children(".count")).length&&p(a).remove(),0<(s=p(".bp-messages-nav").find(".count")).length&&s.text(t.total_unread_messages).addClass("bp-hide")}if(void 0!==t.total_unread_messages&&0<t.total_unread_messages){var a,s;o=p(".bb-icon-inbox");0<(a=p(o).parent().children(".count")).length?p(a).text(t.total_unread_messages):p(o).parent().append('<span class="count"> '+t.total_unread_messages+" </span>"),0<(s=p(".bp-messages-nav").find(".count")).length&&s.text(t.total_unread_messages).removeClass("bp-hide")}}},p(document).on("ready",function(){BuddyBossTheme.init(),p(".bp-personal-sub-tab #compose").on("click",function(){p(this).parent().toggleClass("current selected")})}),p(".ld-entry-content > .entry-content-wrap .entry-content").addClass("ld-gb-content"),p(".llms-notice > a").click(function(){p(".llms-person-login-form-wrapper").hasClass("llms-person-login-aktif")?(p(".llms-login").css("display","none"),p(".llms-person-login-form-wrapper").removeClass("llms-person-login-aktif")):p(".llms-person-login-form-wrapper").addClass("llms-person-login-aktif")}),p.fn.wrapStart=function(e){var t=this.contents().filter(function(){return 3==this.nodeType}).first(),i=t.text().replace(/\s+/g," ").replace(/^\s|\s$/g,""),n=i.split(" ",e).join(" ");t.length&&(t[0].nodeValue=i.slice(n.length),t.before("<span>"+n+"</span>"))},p("#header-my-account-menu").length&&(p("#header-my-account-menu > li").each(function(){if(p(this).hasClass("icon-added"))return p(this).closest("ul").addClass("has-icon"),!1}),p("#header-my-account-menu ul").each(function(){p(this).children("li").each(function(){if(p(this).hasClass("icon-added"))return p(this).closest("ul").addClass("has-icon"),!1})})),p(".admin-bar #wp-admin-bar-my-account-default").length&&p(".admin-bar #wp-admin-bar-my-account-default > li").each(function(){if(p(this).hasClass("menupop"))return p(this).closest("ul").addClass("has-menupop"),!1}),p(document).on("click",".forum_single_action_wrap .forum_single_action_more-wrap",function(e){var t=p(e.currentTarget).closest(".forum_single_action_wrap");t.hasClass("is_visible")?t.removeClass("is_visible"):t.addClass("is_visible")}),p(".buddypress.widget .gamipress-buddypress-user-details-listing").length&&(i(),p(document).on("click",".buddypress.widget .showGamipressData",function(){p(this).parent().find(".GamiPress-data-popup").addClass("is_active"),p(this).closest(".bb-sticky-sidebar").length&&(t=p(this).closest(".bb-sticky-sidebar").attr("style"),p(this).closest(".bb-sticky-sidebar").attr("style",""),p("body").addClass("hide-overflow"))}),p(document).on("heartbeat-tick",function(e,t){setTimeout(function(){i()},1e3)}),p(".widget div#members-list-options a").on("click",function(){setTimeout(function(){i()},3e3)}),p(document).on("click",".buddypress.widget .GamiPress-data-popup .hideGamipressData",function(){p(this).closest(".GamiPress-data-popup").removeClass("is_active"),p(this).closest(".bb-sticky-sidebar").length&&(p(this).closest(".bb-sticky-sidebar").attr("style",t),t="",p("body").removeClass("hide-overflow"))}));function n(){var e=p(window).scrollTop(),t=p("#wpadminbar").height(),i=t+p(".site-header").height()-e;t<i?(p(".buddypanel").css("top",i+"px"),p(".buddypanel").css("height",p("html").height()-p(".site-header").height()-p("#wpadminbar").height()+"px")):(p(".buddypanel").css("top",t+"px"),p(".buddypanel").css("height","100%"))}p("body").on("bbp_after_load_reply_form",function(e,t){if(p('div[data-component="activity"]').length){var i=p(t.click_event),n=i.closest(".bb-grid").find(".bbp-reply-form");if(n.length){var o=i.data("topic-id"),a=(i.data("author-name"),i.closest("li").find(".activity-discussion-title-wrap a").text());n.closest(".bb-quick-reply-form-wrap").show(),n.css({display:"block"}),n.addClass("bb-modal bb-modal-box"),n.closest(".bb-quick-reply-form-wrap").show(),n.find("#bbp_reply_to").val(0),n.find("#bbp-reply-exerpt").text(a+"..."),n.find('input[name="bbp_topic_id"]').val(o)}}}),p(document).on("bbp_after_submit_reply_form",".bbp-reply-form",function(e,t){if(t.response.success&&p('div[data-component="activity"]').length){var i=p("a[data-topic-id="+t.topic_id+"]").closest("li").find(".activity-discussion-title-wrap").clone();p("a[data-topic-id="+t.topic_id+"]").closest("li").find(".activity-discussion-title-wrap").find("a").attr("href");p(".bbp-reply-form-success-modal").find(".activity-list").html(i),setTimeout(function(){p(".bbp-reply-form-success-modal .view-reply-button a").attr("href",t.response.redirect_url),p(".bbp-reply-form-success-modal").removeAttr("style"),p(".bbp-reply-form-success-modal .bb-modal").css("z-index",999992),p(".bbp-reply-form-success").fadeIn(100)},200)}}),p("body").hasClass("header-style-5")&&!p("body").hasClass("sticky-header")&&(p(window).on("scroll",function(){n()}),p(window).on("resize",function(){n()}),p(window).on("load",function(){n()}))}(jQuery);var BBGetQueryVariable=BBGetQueryVariable||function(e,t){if("string"!=typeof e||""==e||void 0===t||""==t)return"";for(var i=e.split("&"),n=0;n<i.length;n++){var o=i[n].split("=");if(o[0]==t)return o[1]}return!1},BBGetUrlParameter=BBGetUrlParameter||function(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))};jQuery("#members-group-list").on("DOMSubtreeModified",function(){jQuery("#members-list.item-list:not(.grid) li.item-entry-header").prev("li").addClass("last-of-type")}),setTimeout(function(){jQuery(document).on("mouseover","#site-navigation #navbar-collapse #navbar-extend .menu-item-has-children, #site-navigation #primary-menu .ab-submenu .menu-item-has-children",function(){var e=jQuery(this),t=jQuery(this).children(".ab-submenu"),i=e.position();t.css({top:i.top}),jQuery("body").addClass("bb-submenu-isactive")}),jQuery(document).on("mouseleave","#site-navigation #navbar-collapse #navbar-extend .menu-item-has-children, #site-navigation #primary-menu .ab-submenu .menu-item-has-children",function(){jQuery("body").removeClass("bb-submenu-isactive")})},500);