/*
 =======================================================================*\
|| ###################################################################### ||
|| # 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.hv=((d,f,h)=>{function l(a){var b=d(".humanverify.humanverify_image");if(0<b.length)m(b),a&&b.find(".imageregt").trigger("focus");else if(0<d(".js-humanverify-recaptcha2").length)window.grecaptcha&&grecaptcha.ready(()=>{grecaptcha.reset()});else if(b=d(".js-humanverify-recaptcha3-response"),0<b.length)b.val("");else{d(".js-humanverify-turnstile-response").each((e,k)=>{f.ready("hvlibraryready").then(()=>{let g=d(k).data("cfwidgetid");g&&turnstile.reset(g)})});var c=d(".humanverify.humanverify_question");
0<c.length&&h.render({template:"humanverify",data:{action:"register"},success:e=>{e=d(e.template);c.replaceWith(e);a&&e.find(".answer").trigger("focus")}})}}function n(a){let b=d(".humanverify_image",a);d(".imagereg, .refresh_imagereg",b).offon("click",()=>m(b)).removeClass("h-hide")}function m(a){h.ajax({call:"/ajax/api/hv/generateToken",success:function(b){b=b.hash;d("input.hash",a).val(b);d(".imagereg",a).attr("src",pageData.baseurl+"/hv/image?hash="+b);d(".imageregt",a).val("")},api_error:()=>
{}});return!1}function p(a){f.ready("hvlibraryready").then(()=>{let b=a.find(".js-humanverify-turnstile-response"),c=turnstile.render(b.get(0),{});b.data("cfwidgetid",c)})}function q(a,b){try{f.ready("hvlibraryready").then(()=>{grecaptcha.execute(a.data("key"),{action:a.data("action")}).then(c=>{a.val(c);b.trigger("submit")})})}catch(c){f.dialogtools.error("error",["phrase_passthrough",c])}}window.recaptcha2callback=a=>{d(".js-humanverify-recaptcha2-response").val(a)};window.hvlibraryready=a=>{f.ready("hvlibraryready").resolve()};
return{reset:l,resetOnError:function(a,b,c){return h.hasError(a,/^humanverify_.*/)?(c.after_error=h.runBeforeCallback(c.after_error,function(){l(!0)}),h.showApiError(a,b,c),!1):!0},initForm:function(a,b){let c=a.find(".js-humanverify-recaptcha3-response");if(0<c.length){let e=f.ensureFun(b);b=(k,...g)=>""==c.val()?(q(c,a),!1):e(k,...g)}p(a);n(a);a.on("submit",b)},initAjaxForm:function(a,b){let c=a.find(".js-humanverify-recaptcha3-response");if(0<c.length){let e=f.ensureFun(b.beforeSubmit);b.beforeSubmit=
(k,g,r)=>{if(!1===e(k,g,r))return!1;if(""!=c.val())return!0;q(c,g);return!1}}p(a);n(a);h.initForm(a,b)}}})(jQuery,vBulletin,vBulletin.ajaxtools);
