/*
 =======================================================================*\
|| ###################################################################### ||
|| # 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([],[]);vBulletin.ensureObj("oauth");
vBulletin.oauth=$.extend(vBulletin.oauth,((c,r,g,n)=>{let p=!1;setTimeout(()=>{vBulletin.ready("oauth").resolve()},1);return{init:function(t,f){function k(){let a=r.getAjaxBaseurl()+"/oauth2/start-token-refresh?provider="+d,b=new BroadcastChannel(d);n.popupWindow(a,d,500,700);return(new Promise((e,h)=>{c(b).on("message",e)})).then(()=>{b.close()})}function u(a){return k().then(()=>{g.ajax({call:"/oauth2/login?provider="+d,data:{url:location.href,userid:pageData.userid},success:b=>{a.trigger("vb-login",
b)}})})}function q(a){c(`.js-${d}-show-on-unlink`).toggleClass("h-hide",!a);c(`.js-${d}-hide-on-unlink`).toggleClass("h-hide",a)}p=!0;const d=t.replace(/[^\w\-\.]/g,"_"),v=d;c(()=>{c(`.js-oauth2-signinbutton[data-provider="${d}"]`).offon("click."+v,a=>{a.preventDefault();let b=c(a.currentTarget).data("action");"link"==b?k().then(()=>{g.ajax({call:`/ajax/api/${d}.externallogin/linkCurrentUser`,title_phrase:f.connect_to_provider,success:()=>{q(!1)}})}):"unlink"==b?g.ajax({call:`/ajax/api/${d}.externallogin/unlinkCurrentUser`,
title_phrase:f.disconnect_from_provider||f.after_unlink_title,success:()=>{n.alert(f.after_unlink_title,f.after_unlink_body);q(!0)}}):"login"==b?(c("#lnkLoginSignupMenu").trigger("click"),u(c(a.currentTarget))):"register"==b?k().then(()=>{location.reload()}):"register-remove"==b&&g.ajax({call:`/ajax/api/${d}.externallogin/forgetRegistrationData`,success:function(e){location.reload()}})});setTimeout(()=>{let a=c(`.js-${d}-register-data`);if(0<a.length&&!a.data("register-init")){let b=a.data("username"),
e=a.data("email"),h=c("#regDataUsername"),l=c("#regDataEmail"),m=c("#regDataEmailConfirm");b&&0<h.length&&0==h.val()&&h.val(b);e&&0<l.length&&0==l.val()&&0<m.length&&0==m.val()&&(l.val(e),m.val(e));a.data("register-init",!0)}},412)})},initialized:()=>p}})(jQuery,vBulletin,vBulletin.ajaxtools,vBulletin.dialogtools));
