/*
 =======================================================================*\
|| ###################################################################### ||
|| # 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(["closed","this_topic_is_closed"],[]);
(function(b){if(!vBulletin.pageHasSelectors([".forum-channel-content-widget",".blog-channel-content-widget",".sg-channel-content-widget",".search-results-widget .topic-list-container"]))return!1;var v={};vBulletin.conversation.editTopicTitle=function(k){k=b(k.target).closest(".js-topic-item");var a=k.find(".js-topic-wrapper"),n=k.data("node-id");k.data("can-edit-title")&&!v[n]&&(v[n]="edit",0==a.find(".js-loading-icon").length&&b('<img class="loading-icon js-loading-icon" src="'+pageData.baseurl+
'/images/misc/progress.gif" />').appendTo(a),a.find(".js-loading-icon").show(),vBulletin.AJAX({call:"/create-content/loadtitleedit",data:{nodeid:n,isAjaxTemplateRender:!0},success:function(e){a.find(".js-topic-title").hide();a.find(".js-loading-icon").hide();a.find(".js-topic-title").after(e);e=a.find(".js-topic-title-edit");e.data("original-title",e.val());var q=30;a.find(".js-prefix, .js-post-icon, .js-topic-prefix, .js-go-to-first-unread").each(function(){q+=b(this).outerWidth(!0)});e.outerWidth(e.outerWidth()-
q);a.find(".js-topic-title-edit-form").on("submit",vBulletin.conversation.saveTopicTitle);e.on("blur",vBulletin.conversation.saveTopicTitle);e.trigger("select").trigger("focus")}}))};vBulletin.conversation.saveTopicTitle=function(k){k.preventDefault();var a=b(k.target).closest(".js-topic-wrapper");k=a.find(".js-topic-title-edit-form");var n=k.find(".js-node-id").val(),e=k.find(".js-topic-title-edit").val();"save"!=v[n]&&(v[n]="save",a.find(".js-topic-title-edit").data("original-title")==e?(a.find(".js-loading-icon").remove(),
a.find(".js-topic-title-edit-form").remove(),a.find(".js-topic-title").show(),v[n]=!1):(a.find(".js-loading-icon").appendTo(k).show(),vBulletin.AJAX({call:"/create-content/savetitleedit",data:{nodeid:n,title:e},success:function(q){a.find(".js-topic-title-edit-form").remove();a.find(".js-topic-title").html(q.title).show()},complete:function(){a.find(".js-loading-icon").remove();v[n]=!1}})))};vBulletin.conversation.openOrCloseTopic=function(k){k.stopPropagation();var a=b(this),n=a.closest(".js-topic-item"),
e=n.find(".js-topic-wrapper");k=n.data("node-id");var q=n.hasClass("closed");0==e.find(".js-loading-icon").length&&b('<img class="loading-icon js-loading-icon" src="'+pageData.baseurl+'/images/misc/progress.gif" />').appendTo(e);var w=e.find(".js-loading-icon");w.show();vBulletin.AJAX({call:"/ajax/api/node/"+(q?"openNode":"closeNode"),data:{nodeid:k},error_phrase:"error_open_close_topic",api_error:function(h){var g=vBulletin.ajaxtools;if(g.hasError(h,"inlinemodauth_required"))return!0;g.logApiError(h)},
complete:function(){w.hide()},success:function(h){n.toggleClass("closed",!q);h=a.attr("title")||"";var g=vBulletin.phrase.get("this_topic_is_closed");subStrIndex=h.indexOf(g);q&&0<=subStrIndex?(h=(h.slice(0,subStrIndex)+h.slice(subStrIndex+g.length)).trim(),a.attr("title",h)):!q&&0>subStrIndex&&a.attr("title",g+" "+h);h=e.find(".js-prefix");g=[];var x=vBulletin.phrase.get("closed");if(h.length){var l=h.text().trim();":"==l.charAt(l.length-1)&&(l=l.substring(0,l.length-1));0<l.length&&(g=l.split(", "));
if(!q)g.push(x);else if(0<g.length)for(l=g.length-1;0<=l;l--)g[l]==x&&g.splice(l,1)}else h=b('<span class="prefix js-prefix"></span>'),l=e.find(".js-go-to-first-unread"),l.length?h.insertAfter(l):h.prependTo(e),q||g.push(x);h.text(g.join(", ")+": ");h.toggle(0!=g.length)}})};b(function(){vBulletin.conversation=vBulletin.conversation||{};let k=vBulletin.tabtools,a=b(".channel-content-widget .channel-conversation-list-wrapper"),n=b("#media-tab",a),e,q,w=!0,h=b("#video-tab",a),g,x,l=!0,y,D,z,A,E,G;var t=
a.find(".widget-tabs-nav .ui-tabs-nav > li");let H=t.filter(".ui-tabs-active"),I=H.index(),B,C="1"==t.parent().data("allow-history"),L=new vBulletin.history.instance(C);-1==I&&(I=0,H=t.first());B=H.find("> a").attr("href");var F=function(c){return a.offset().top+(a.outerHeight()-parseFloat(a.css("border-bottom-width")))-c.height()},J=function(c,r){var u=r.filter;r.pagination&&r.pagination.setOption("context",c);u.setOption("context",c);"undefined"!=typeof u.lastFilters&&0<b(".conversation-empty:not(.h-hide)",
c).length&&delete u.lastFilters},K=function(c,r,u,f,m,p,d){p=b(".conversation-list",c);return k.newTab(c,r,u,f,m,p,d,b.noop,C)};k.initTabs(a,L,t,C,I,B,[A,D,G],!0,function(c,r,u){var f=b(u),m="#"+f.prop("id");c=B==m;"#activity-stream-tab"!=m&&"#article-tab"!=m&&z&&A.toggleNewConversations(!1);"#topic-tab"!=m&&y&&D.toggleNewConversations(!1);if("#activity-stream-tab"==m||"#article-tab"==m)z?J(f,z):(z=K(f,a,!0,!0,c,null),A=z.filter),A.applyFilters(!1,!0);else if("#subscribed-tab"==m)E?J(f,E):(E=K(f,
a,!0,!0,c,null),G=E.filter),G.applyFilters(!1,!1);else if("#topic-tab"==m)y?J(f,y):(y=K(f,a,!0,!0,c),D=y.filter),D.applyFilters(!1,!0);else if("#media-tab"==m){if(e)w=!0;else{e=b(".conversation-toolbar-wrapper.scrolltofixed-floating",n);q=new vBulletin.scrollToFixed({element:e,limit:F(e)});var p=new vBulletin.history.instance(C);if(p.isEnabled()){c=p.getState();if(!c||b.isEmptyObject(c.data))c={from:"filter",page:1,tab:m,filters:vBulletin.getSelectedFilters(b("form.toolbar-filter-overlay",f))},p.setDefaultState(c,
document.title,location.href);p.setStateChange(function(d,M,N){d=p.getState();"filter"==d.data.from&&(p.log(d.data,d.title,d.url),m!=d.data.tab?vBulletin.selectTabByIndex.call(b(r).closest(".ui-tabs-nav"),r.index()):(d=b('.media-filter-overlay input[name="filter_time"][value="{0}"]'.format(d.data.filters.filter_time),f).prop("checked",!0),d.hasClass("js-default-checked")&&d.prop("defaultChecked")?b(".filtered-by .x",f).trigger("click"):d.trigger("change",[!0])))},"filter")}B==m&&(w=!1)}w&&0==f.find(".profileMediaDetailContainer .js-album-detail",
f).length&&vBulletin.media.loadGalleryById(f.find(".js-profile-media-container"),{nodeid:-2,channelid:pageData.channelid,pageno:1,dateFilter:b(".filter-options input[name=filter_time]:checked",f).val()||"time_lastweek",perpage:"default"},{complete:function(){b(".profile-toolbar .media-toolbar-filter",n).removeClass("h-hide");q.updateLimit(F(e))}})}else if("#video-tab"==m){if(g)l=!0;else{g=b(".conversation-toolbar-wrapper.scrolltofixed-floating",h);x=new vBulletin.scrollToFixed({element:g,limit:F(g)});
p=new vBulletin.history.instance(C);if(p.isEnabled()){c=p.getState();if(!c||b.isEmptyObject(c.data))c={from:"filter",page:1,tab:m,filters:vBulletin.getSelectedFilters(b("form.toolbar-filter-overlay",f))},p.setDefaultState(c,document.title,location.href);p.setStateChange(function(d,M,N){d=p.getState();"filter"==d.data.from&&(p.log(d.data,d.title,d.url),m!=d.data.tab?vBulletin.selectTabByIndex.call(b(r).closest(".ui-tabs-nav"),r.index()):(d=b('.media-filter-overlay input[name="filter_time"][value="{0}"]'.format(d.data.filters.filter_time),
f).prop("checked",!0),d.hasClass("js-default-checked")&&d.prop("defaultChecked")?b(".filtered-by .x",f).trigger("click"):d.trigger("change",[!0])))},"filter")}B==m&&(l=!1)}l&&0==f.find(".profileMediaDetailContainer .media-video-list",f).length&&vBulletin.media.loadGalleryById(f.find(".js-profile-media-container"),{nodeid:-1,channelid:pageData.channelid,pageno:1,dateFilter:b(".filter-options input[name=filter_time]:checked",f).val()||"time_lastweek",perpage:"default"},{complete:function(){b(".profile-toolbar .media-toolbar-filter",
h).removeClass("h-hide");x.updateLimit(F(g))}})}});t=b(".conversation-list",a);vBulletin.conversation.initPollEvents(t);vBulletin.conversation.initContentEvents(t);t.off("click",".js-comment-entry__post").on("click",".js-comment-entry__post",function(c){vBulletin.conversation.postComment.apply(this,[c,function(){A.updatePageNumber(1).applyFilters(!1,!0)}])});vBulletin.conversation.bindEditFormEventHandlers("all");b(document).offon("dblclick",".js-cell-topic a",c=>c.stopPropagation());b(document).offon("dblclick",
".js-cell-topic",vBulletin.conversation.editTopicTitle);b(document).offon("dblclick",".js-open-close-topic",vBulletin.conversation.openOrCloseTopic)})})(jQuery);
