/*
 =======================================================================*\
|| ###################################################################### ||
|| # vBulletin 6.2.3
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2026 MH Sub I, LLC dba vBulletin. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
vBulletin.precache(["more_options","advanced_search","search","more"],[]);
vBulletin.CompMenuHorizontal=function(d,r){function k(a,c,b){a.each(function(){var e=d(this);d.each(c,function(f,g){e.is("."+g)&&(e.removeClass(g),f=e.data("removed-classes")||[],-1==d.inArray(g,f)&&f.push(g),e.data("removed-classes",f))});d.each(b,function(f,g){e.is("."+g)||(e.addClass(g),f=e.data("added-classes")||[],-1==d.inArray(g,f)&&f.push(g),e.data("added-classes",f))})})}function q(a){a.each(function(){var c=d(this),b=c.data("added-classes")||[],e=c.data("removed-classes")||[];b.length&&c.removeClass(b.join(" "));
e.length&&c.addClass(e.join(" "))})}function p(a){x.push(a)}function y(a,c,b){x.map(e=>e(a,c,b))}function t(a,c){if("dropdown"==c){var b=a.data("dropdown-icon-classes")||"",e=b?" b-comp-menu-dropdown__trigger--icon-trigger":"";e=(a.data("dropdown-trigger-classes")||"")+e;let g=a.data("dropdown-trigger-phrase")||"more_options";b='<div class="b-comp-menu-dropdown js-comp-menu-dropdown '+(a.data("dropdown-menu-classes")||"")+'"> <div class="b-comp-menu-dropdown__trigger js-comp-menu-dropdown__trigger js-button '+
e+'" tabindex="0"> <span class="'+b+' b-comp-menu-dropdown__trigger-icon"> '+vBulletin.phrase.get(g)+" </span>  </div> </div>";let h=d(b);h.insertAfter(a);y(a,h,c);b=a.find("li");e=a.find("a");d.each(["h-right","h-left"],function(l,m){a.is("."+m)&&h.addClass(m)});c=a.data("dropdown-content-classes");var f=["b-comp-menu-dropdown__content","js-comp-menu-dropdown__content"];c=c?c.split(" "):[];d.each(c,function(l,m){f.push(m)});k(a,"h-margin-top-s h-right b-comp-menu-horizontal channel-tabbar-list h-hide-on-small nav-list".split(" "),
f);k(b,["h-margin-top-xs","b-post-control"],["b-comp-menu-dropdown__content-item"]);k(e,["h-left"],["h-block"]);a.appendTo(h);vBulletin.CompMenuDropdown.init();a.data("is-dropdown-menu",1)}else vBulletin.CompMenuDropdown.updateMenuAsSelectElement(),b=a.find("li"),e=a.find("a"),q(a),q(b),q(e),b=a.closest(".js-comp-menu-dropdown"),vBulletin.CompMenuDropdown.setMenuColumnCount(b,a,1),a.removeClass("b-comp-menu-dropdown__content--left b-comp-menu-dropdown__content--right"),a.insertAfter(b),y(a,b,c),(c=
a.next(".vb-select-el"))&&c.length&&c.selectBox("destroy").remove(),b.remove(),a.data("is-dropdown-menu","")}function u(a){if(a.length){let c=d("body"),b=c.is(".l-small"),e=c.is(".l-xsmall");a.each((f,g)=>{f=d(g);g=f.find("li").not(".b-post-control--disabled").length;var h=!1;isDropdown=f.data("is-dropdown-menu");if(!(f.is(".js-comp-menu-column")||isDropdown&&f.closest(".js-comp-menu-dropdown").is(".b-comp-menu-dropdown--open"))){isDropdown&&(t(f,"horizontal"),isDropdown=!1);var l=h=!1;for(let m of[f,
f.parent()])if(m.is(".js-shrink-event-parent")&&(h=!0,"need_shrink"==r.checkElementShrinkRequirement(m))){l=!0;break}f.is(".js-comp-menu-dropdown__content--main-menu")&&!l&&(h=!0,"need_shrink"==r.checkElementShrinkRequirement(d(".js-channel-subtabbar-list"))&&(l=!0));h=h?l:"need_shrink"==r.checkElementShrinkRequirement(f)?!0:void 0}(b&&f.is(".js-comp-menu--dropdown-on-small")||e&&f.is(".js-comp-menu--dropdown-on-xsmall")||h)&&0<g?isDropdown||t(f,"dropdown"):isDropdown&&t(f,"horizontal")})}}var v=
vBulletin.ensureObj("jsexec.css_b_comp_menu_horizontal",{exec:0,init:0});v.exec++;var x=[];p(function(a,c,b){a.is(".js-comp-menu-dropdown__content--main-menu")&&("dropdown"==b?(b=a.find(".current").addClass("b-comp-menu-dropdown__content-item--current"),c.addClass("b-comp-menu-dropdown--main-menu").find(".js-comp-menu-dropdown__trigger").addClass("b-comp-menu-dropdown__trigger--icon-trigger").html('<span class="b-icon b-icon__hamburger b-comp-menu-dropdown__trigger-icon"></span>'),a.find("li").first().addClass("b-comp-menu-dropdown__content-item--divider"),
c='<li class="js-search-item b-comp-menu-dropdown__content-item--no-hover js-comp-menu-dropdown__content-maintain-menu"><form action="'+d("#searchForm").attr("action")+'" class="search-box"><input type="text" autocomplete="off" class="b-form-input__input search-term" placeholder="'+vBulletin.phrase.get("search")+'..." name="q"><button title="'+vBulletin.phrase.get("search")+'" class="search-btn b-button b-button--primary" type="submit"><span class="b-icon-fa b-icon-fa--24 fa-solid fa-magnifying-glass"></span></button></form></li><li class="js-search-item"><a href="'+
pageData.baseurl+'/search">'+vBulletin.phrase.get("advanced_search")+"</a></li>",d(c).prependTo(a),d(".js-channel-subtabbar-list li").addClass("js-subtabbar-item b-comp-menu-dropdown__content-item--indent1").insertAfter(b),d(".js-channel-subtabbar").addClass("h-hide")):(a.find("li").removeClass("b-comp-menu-dropdown__content-item--divider b-comp-menu-dropdown__content-item--current b-comp-menu-dropdown__content-item--indent1"),a.find(".js-search-item").remove(),a.find(".js-subtabbar-item").appendTo(d(".js-channel-subtabbar-list")),
d(".js-channel-subtabbar").removeClass("h-hide")))});p(function(a,c,b){a.is(".js-footer-nav-list")&&("dropdown"==b?(k(a,["h-right"],[]),k(c,[],["js-select-on-xsmall"]),c=d("<li></li>").append(c).appendTo(".js-footer-chooser-list"),a.data("vb-remove-li",c)):(a.insertAfter(".js-footer-chooser-list"),a.data("vb-remove-li").remove()))});p(function(a,c,b){"dropdown"==b?(b=a.find(".js-comp-menu--exclude-from-dropdown"),0<b.length&&(c=d("<ul />").addClass(a.get(0).className).removeClass("js-comp-menu-horizontal js-comp-menu--dropdown-on-xsmall js-comp-menu--dropdown-on-small b-comp-menu-dropdown--inactive").insertAfter(c),
Object.assign(c[0].dataset,a[0].dataset),a.data("vb-exclude-item-container",c),b.each(function(e,f){e=d(this);d("<li />").addClass("js-excluded-item-marker h-hide-imp").data("vb-excluded-item",e).insertAfter(e)}),b.appendTo(c))):(c=a.data("vb-exclude-item-container"),b=a.find(".js-excluded-item-marker"),c&&c.length&&0<c.length&&0<b.length&&(b.each(function(e,f){e=d(this);e.data("vb-excluded-item").insertAfter(e)}),b.remove(),a.data("vb-exclude-item-container",!1),c.remove()))});p(function(a,c,b){function e(n){n=
d(this).closest("li");h.removeClass("b-comp-menu-dropdown__content-item--current ui-tabs-active ui-state-active ui-state-hover ui-state-default");n.addClass("b-comp-menu-dropdown__content-item--current")}if(a.is(".js-module-tab-menu")){var f=a.closest(".widget-tabs-nav, .js-widget-tabs-nav"),g=f.find(".module-title, .js-module-title"),h=a.find("li"),l=h.filter(".ui-state-active"),m=a.find("a");f.addClass("js-widget-tabs-nav");g.addClass("js-module-title");"dropdown"==b?((a.is(".js-profile-tabs-nav")||
a.is(".js-subscribe-tabs-nav"))&&d("<div />").addClass("js-profile-menu-wrapper widget-tabs-nav").insertAfter(a).append(c).append(a),k(a,["ui-tabs-nav","ui-helper-reset","ui-helper-clearfix","ui-widget-header","ui-corner-all"],[]),k(c,[],["js-select-when-dropdown"]),k(f,["widget-tabs-nav"],["widget-tabs-nav-background"]),k(g,["module-title"],[]),k(h,"ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all ui-corner-bottom ui-corner-top ui-corner-right ui-corner-left ui-corner-br ui-corner-bl ui-corner-tr ui-corner-tl".split(" "),
[]),k(m,["ui-tabs-anchor","h-block"],[]),l.length?l.addClass("b-comp-menu-dropdown__content-item--current"):setTimeout(function(){h.filter(".ui-state-active").addClass("b-comp-menu-dropdown__content-item--current");var n=a.next(".vb-select-el"),z=0;if(n&&n.length){h.each(function(B,C){z=B;if(d(C).is(".ui-state-active"))return!1});var A=n.is(".selectBox");A&&n.selectBox("destroy");n.find(".js-noop-label").remove();n.get(0).selectedIndex=z;A&&n.selectBox()}},0),h.removeClass("ui-state-default ui-tabs-active ui-state-active ui-state-hover"),
m.off("click.vbmoduletabs").on("click.vbmoduletabs",e),c.data("add-classes-to-select-el","h-margin-vert-m h-margin-horiz-xl")):(h.filter(function(){return"true"==d(this).attr("aria-selected")}).removeClass("b-comp-menu-dropdown__content-item--current").addClass("ui-tabs-active ui-state-active"),m.off("click.vbmoduletabs"),q(f),q(g),b=a.parent(),b.is(".js-profile-menu-wrapper")&&(a.insertAfter(b),c.insertAfter(b),b.remove()))}});p(function(a,c,b){if(a.is(".js-tabbed-pane__tabs")){var e=a.find("li"),
f=e.filter(".b-tabbed-pane__tab--selected");a.find("a");"dropdown"==b?(d("<div />").addClass("js-tabbed-pane__tabs-wrapper b-tabbed-pane_tabs b-tabbed-pane__tabs--standard").insertAfter(a).append(c).append(a),k(a.parent(),[],["js-comp-menu-dropdown__content"]),k(c,[],["js-select-when-dropdown"]),k(e,[],["b-comp-menu-dropdown__content-item"]),f.addClass("b-comp-menu-dropdown__content-item--current"),c.data("add-classes-to-select-el","h-margin-horiz-xl h-margin-vert-m")):(e.removeClass("b-comp-menu-dropdown__content-item--current"),
b=a.parent(),b.is(".js-tabbed-pane__tabs-wrapper")&&(a.insertAfter(b),c.insertAfter(b),b.remove()))}});p(function(a,c,b){a.is(".js-groupblog-admin-menu")&&(a.closest(".js-blog-admin-left"),a=a.find("li").filter(".sgAdminActive, .blogAdminActive"),"dropdown"==b&&(k(c,[],["js-select-on-xsmall"]),a.addClass("b-comp-menu-dropdown__content-item--current")))});p(function(a,c,b){if(a.is(".js-sharing-menu")){var e=a.find("li");"dropdown"==b?(b=a.prevAll(".userinfo"),1==b.length&&(c.appendTo(b),a.data("vb-moved-to-userinfo",
"1")),k(a,["b-sharing-menu--horizontal"],[]),k(c,[],["h-align-bottom"]),k(e,[],["b-comp-menu-dropdown__content-item--no-hover","js-comp-menu-dropdown__content-maintain-menu"])):("1"==a.data("vb-moved-to-userinfo")&&(b=c.parent(".userinfo"),a.insertAfter(b).data("vb-moved-to-userinfo","0")),q(e))}});let w=()=>u(d(".js-comp-menu-horizontal, .js-comp-menu-column"));d(document).on("vb-tabinit",a=>{u(d(a.target).find(".js-comp-menu-horizontal, .js-comp-menu-column"))});d(function(){vBulletin.phrase.register(d("[data-dropdown-trigger-phrase]").map(function(a,
c){return d(c).data("dropdown-trigger-phrase")}).get());u(d(".js-comp-menu-horizontal, .js-comp-menu-column").filter(":not(.ui-tabs-nav)"));1>v.init&&(r.registerCallback(w),d(document).on("vb-loadnewposts vb-filterposts",w));v.init++});return{registerMenuChangeFilter:p,checkHorizontalMenuState:w,convertDropdownProgressive:function(a){if(!(1>a.$children.length||1!=a.$parent.length)){a.needsShrink=a.needsShrink||function(){return"need_shrink"==r.checkElementShrinkRequirement(a.$parent)};a.copyChild=
a.copyChild||function(g){var h=g.find("> a");g=d('<a href="#"></a>');g.html(h.html());g.attr("href",h.attr("href"));g.on("click",function(){h.trigger("click");return!1});return g};var c=a.$children.filter(function(){return""!=d(this).text()});if(!(1>c.length)){var b=a.$parent.find(".js-progressive-dropdown-menu");if(1>b.length){b=d('<li class="b-top-menu__item js-shrink-event-child js-progressive-dropdown-menu h-hide-imp"> \t<div class="b-comp-menu-dropdown b-comp-menu-dropdown--sitebuilder js-comp-menu-dropdown">\t\t<div class="b-comp-menu-dropdown__trigger js-comp-menu-dropdown__trigger js-button" tabindex="0"> \t\t\t<span class="b-icon b-icon__ellipsis b-comp-menu-dropdown__trigger-icon">'+
vBulletin.phrase.get("more")+'</span> \t\t</div> \t\t<ul class="b-comp-menu-dropdown__content js-comp-menu-dropdown__content"> \t\t</ul> \t</div> </li>');b.insertAfter(c.last());var e=b.find(".js-comp-menu-dropdown__content");c.each(function(g,h){h=d(this);var l=a.copyChild(h);d('<li class="b-comp-menu-dropdown__content-item h-hide-imp"></li>').append(l).appendTo(e).data("vb-progressive-item-num",g);h.data("vb-progressive-item-num",g)});vBulletin.CompMenuDropdown.init()}var f=b.find(".b-comp-menu-dropdown__content-item");
if(a.removeMenu||!a.needsShrink())c.removeClass("h-hide-imp"),b.addClass("h-hide-imp"),f.addClass("h-hide-imp");!a.removeMenu&&a.needsShrink()&&c.reverse().each(function(){var g=d(this),h=g.data("vb-progressive-item-num"),l=f.filter(function(){return d(this).data("vb-progressive-item-num")==h});l.removeClass("h-hide-imp b-comp-menu-dropdown__content-item--first");g.addClass("h-hide-imp");b.removeClass("h-hide-imp");if(!a.needsShrink())return l.addClass("b-comp-menu-dropdown__content-item--first"),
!1})}}}}}(jQuery,vBulletin.Responsive.Debounce);
