/*
 =======================================================================*\
|| ###################################################################### ||
|| # 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(["create_a_blog","error_creating_user_blog_channel","select_a_blog"],[]);
(function(a,d,h){function p(q){let g=f=>location.href="{0}/new-content/{1}".format(pageData.baseurl,f),k=a(this).closest(".canvas-widget").data("blog-channel-id");d.AJAX({call:"/ajax/api/user/getGitCanStart",data:{parentNodeId:k},success:function(f){let l=f.length;if(1<l){let e=a("#user-blogs-dialog"),b=a("select.custom-dropdown",e);for(let c of f)a("<option />").val(c.nodeid).html(c.title).appendTo(b);h.openModalDialog(e,{title:"select_a_blog",onOpen:()=>{b.removeClass("h-hide").selectBox();a(".btnContinue",
e).offon("click",()=>{g(b.val())});a(".btnCancel",e).offon("click",()=>{e.dialog("close")})},onAfterClose:()=>{b.selectBox("destroy").find("option").remove()}})}else 1==l?g(f[0].nodeid):d.AJAX({call:"/ajax/api/blog/canCreateBlog",data:{parentid:k},success:function(e){let b=a("#create-blog-dialog");$form=a("form",b);h.openModalDialog(b,{title:"create_a_blog",onOpen:()=>{$form.trigger("reset");a(".btnContinue",b).offon("click",()=>{d.AJAX({call:"/create-content/blog",data:d.getFormData($form,0),success:c=>
g(c.nodeid),error_phrase:"error_creating_user_blog_channel"});return!1});a(".btnCancel",b).offon("click",()=>{b.dialog("close")});a(".blog-adv-settings",b).offon("click",c=>{let m=d.getFormData($form,0);c=new URL(c.currentTarget);let n=c.searchParams;n.append("blogtitle",a.trim(m.title));n.append("blogdesc",a.trim(m.description));location.href=c;return!1})}})},title_phrase:"create_a_blog"})},error_phrase:"error_fetching_user_blog_channels"})}if(!d.pageHasSelectors([".bloghome-widget"]))return!1;a(function(){a(".bloghome-widget").offon("click",
".conversation-toolbar .new-conversation-btn",p);d.memberChannel.initFlexGridAdjustments(a(".bloghome-widget"))})})(jQuery,vBulletin,vBulletin.dialogtools);
