jQuery(document).ready((function($){$(document).on("click",".sn_af_run_fix",(function(t){t.preventDefault();var e=jQuery(this).data("test-id");if(!confirm("Are you sure you want to apply the fix?"))return!1;jQuery(".snautofix[data-test-id='"+e+"']").html('<div class="sn-fixer-loader">Applying the fix.</div>').show();var a={};return jQuery(".snautofix[data-test-id='"+e+"'] input").each((function(){"checkbox"==$(this).attr("type")?$(this).is(":checked")?a[$(this).attr("name")]="true":a[$(this).attr("name")]="false":a[$(this).attr("name")]=$(this).val()})),$.ajax({url:ajaxurl,type:"POST",data:{action:"sn_af_do_fix",_ajax_nonce:wf_sn_af.nonce_do_fix,test_id:e,fields:JSON.stringify(a)},success:function(t){jQuery(".snautofix[data-test-id='"+e+"']").html("<p>"+t.data+"<br><b>Please note</b>: analyze the site again to update the result and overall score.</p>")},error:function(t){jQuery(".snautofix[data-test-id='"+e+"']").html('<p>The fix could not be applied.</p><div class="error">'+t.data+"</div>")}}),!1})),$(document).on("sn_test_details_dialog_open",(function(t,e,a){data={action:"sn_af_get_fix_info",_ajax_nonce:wf_sn_af.nonce_get_fix_info,test_id:e,test_status:a},a<10&&$.get(ajaxurl,data,(function(t){t.success?content=t.data:content="Undocumented error. Unable to get fix info. Please reload the page and try again.",jQuery(".testtimedetails."+e+" .snautofix").html(content).show()}))}))}));