\n\t\t\t\t\t `})),e("#paramFieldsrepeaterResult").html(o)}else if(m?.mf_redirect_params===undefined||0===Object.keys(m.mf_redirect_params).length){e(".mf-form-data-bypass-single-field").each(((e,t)=>{0!==e&&t.remove()})),e(".mf-form-data-bypass-input").val(""),e(".mf-form-data-bypass-select").html(i)}p(),c()},error:function(e){}});var _=0;e(".mf-add-rf").click((function(){var t=e("#mf-rf-single-field-copier").clone();_++,t.attr("id","mr-repeater-field-"+_),e(".mf-rf-single-field",t).attr("data-id",_),t.appendTo(e(".rf-repeaterResult"))})),e(".mf-btn-del-url-field").click((function(){e(this).parent(".mf-rf-single-field-input").remove()})),function(t){var i=e("#metform-form-modalinput-settings").attr("data-nonce"),o=e(".get-response-campaign-list");e.ajax({url:window.metform_api.resturl+"metform/v1/entries/get_response_list/"+t,type:"get",headers:{"X-WP-Nonce":i},dataType:"json",success:function(e){o.empty(),e.length&&e.forEach((e=>{o.append("")}))},error:function(e){}})}(i),function(t){var i=e(".metfrom-btn-refresh-hubsopt-list");i.addClass("mf-setting-spin");var o=e("#metform-form-modalinput-settings").attr("data-nonce"),s=e(".hubspot_forms"),a=e("#mf-hubsopt-fileds"),n=t;e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_hubspot_forms/"+n,type:"get",headers:{"X-WP-Nonce":o},dataType:"json",beforeSend:function(t){e(a).text("Please wait....")},success:function(t){if(Array.isArray(t)){var i=e(".mf_hubspot_form_guid").val();try{s.empty(),s.append(''),t.forEach((e=>{var t="";e.guid===i&&(t='selected="selected"'),s.append("")}))}catch(o){}}else s.empty(),s.append('')},error:function(e){console.log(e)},complete:function(t){i.removeClass("mf-setting-spin"),e(a).text("")}})}(i),function(t,i){var o=e(".mf_hubspot_form_guid").val(),s=e("#metform-form-modalinput-settings").attr("data-nonce");if(e("#mf-hubsopt-fileds").html("Please wait...."),"1"!==i.mf_hubspot_forms)return!1;e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+t,type:"get",headers:{"X-WP-Nonce":s},dataType:"json",success:function(a){e.ajax({url:window.metform_api.resturl+"metform/v1/forms/hubspot_form_fields/"+t,type:"post",headers:{"X-WP-Nonce":s},dataType:"json",data:{guid:o},success:function(t){var o="",s="mf_hubspot_form_field_name_";t.forEach((e=>{var t=s+e.name;if(t in i){var n="";for(const e in a){var r="";i[t]===a[e].mf_input_name&&(r='selected="selected"'),n+=``}o+="
"+e.label+"
"}})),e("#mf-hubsopt-fileds").html('
'+o+"
")},error:function(t){401===t?.responseJSON?.code?(e("#mf-hubsopt-fileds").html("Please connect your HubSpot account."),e(".hubspot_forms").empty()):e("#mf-hubsopt-fileds").html("Please click the button to fetch forms and then select a form from the list.")}})},error:function(t){e("#mf-hubsopt-fileds").html("Sorry ! Something went wrong")}})}(i,m),function(t){e("#metform_form_modal");var i,o=e("#metform-form-modalinput-settings").attr("data-nonce"),s=e(".mailchimp_list");i=t,e.ajax({url:window.metform_api.resturl+"metform/v1/entries/get_mailchimp_list/"+i,type:"get",headers:{"X-WP-Nonce":o},dataType:"json",success:function(t){try{s.empty(),t.lists.forEach((e=>{s.append("")})),1===t.lists.length?e(".mf-mailchimp-list-id").attr("value",t.lists[0].id):(r(),e(".mailchimp_list").on("change",(t=>{e(".mf-mailchimp-list-id").attr("value",t.target.value)})))}catch(i){}},error:function(e){}})}(i),function(t,i){let o=e("#mf-aweber-fields"),s=e("option:selected",this).val();if(!s)return void o.html("");o.html("Please wait....");let a=e("#metform-form-modalinput-settings").attr("data-nonce"),n="";e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+t,type:"get",headers:{"X-WP-Nonce":a},dataType:"json",success:function(r){n=r;let m=metform_api.admin_url+"admin-ajax.php",l={action:"get_aweber_custom_fields",selectedValue:s,formId:t,nonce:a};e.ajax({url:m,type:"post",data:l,headers:{"X-WP-Nonce":a},dataType:"json",success:function(e){let t=e.data;if("ok"===t.result)if(t.custom_fields.error)o.html("");else{let e,s="",a=Object.keys(n).map((function(e){return[n[e]]})),r="mf_aweber_custom_field_name_",m="mf_aweber_custom_field_label_";t.custom_fields.entries.forEach((t=>{let o;e="",a.map((s=>{o="";let a=i[r+t.id];a&&s[0].mf_input_name===a.field_key&&(o='selected="selected"'),e+=""})),s+="
";e(".mf-mailster-settings-section").html(s),function(t,i){var o=window.mf_mailster_list_id;if(e(".mf-mailster-list-id").val()==o){var s=e("#metform-form-modalinput-settings").attr("data-nonce");e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_mailster_form_data/"+i,type:"get",headers:{"X-WP-Nonce":s},dataType:"json",success:function(t){for(const[i,o]of Object.entries(t))for(const[t,i]of Object.entries(o))e("#"+t+' option[value="'+i+'"]').prop("selected",!0)},error:function(e){}})}}(0,o)},error:function(e){}})}(t,a,i)},error:function(e){}})}function L(t,i){if(v.hide(),g.hide(),y.hide(),b.hide(),k.hide(),w.hide(),x.hide(),T.hide(),X.hide(),E.hide(),Q.hide(),O.hide(),D.hide(),q.hide(),""!=t.form_title){e(".mf-form-modalinput-title").val(t.form_title),e(".mf-form-modalinput-success_message").val(t.success_message),e(".mf-entry-title-input").val("undefined"!=typeof t.entry_title&&""!=t.entry_title?t.entry_title:"undefined"==typeof t.entry_title||""==t.entry_title?"Entry # [mf_id]":""),e(".mf-form-modalinput-redirect_to").val(t.redirect_to),e(".mf-form-modalinput-success_url").val(t.success_url),e(".mf-form-modalinput-failed_cancel_url").val(t.failed_cancel_url),e(".mf-form-modalinput-limit_total_entries").val(t.limit_total_entries),e(".mf-form-email-verification-email-subject").val(t.email_verification_email_subject),e(".mf-form-email-verification-email-redirect").val(t.email_verification_confirm_redirect),e(".mf-form-email-verification-heading").val(t.email_verification_heading),e(".mf-form-email-verification-paragraph").val(t.email_verification_paragraph);let i=e(".mf-form-email-verification-enable");"1"==t.email_verification_enable?(i.attr("checked",!0),I.show()):(i.removeAttr("checked"),I.hide());let k=e(".mf_automizy_list_id");k&&k.val(t.mf_automizy_list_id);var o=e(".mf-form-modalinput-store_entries");"1"==t.store_entries?(o.attr("checked",!0),v.show()):(o.removeAttr("checked"),v.hide());var s=e(".mf-form-modalinput-hide_form_after_submission");"1"==t.hide_form_after_submission?s.attr("checked",!0):s.removeAttr("checked");var m=e(".mf-form-modalinput-require_login");"1"==t.require_login?m.attr("checked",!0):m.removeAttr("checked");var l=e(".mf-form-modalinput-quiz_result_show");"1"==t.quiz_summery?l.attr("checked",!0):l.removeAttr("checked");var f=e(".mf-form-modalinput-limit_status");"1"==t.limit_total_entries_status?f.attr("checked",!0):f.removeAttr("checked");var c=e(".mf-form-modalinput-count_views");"1"==t.count_views?c.attr("checked",!0):c.removeAttr("checked");var d=e(".mf-form-modalinput-stop_vertical_scrolling");"1"==t.mf_stop_vertical_scrolling?d.attr("checked",!0):d.removeAttr("checked");var p=e(".mf-form-modalinput-multiple_submission");"1"==t.multiple_submission?p.attr("checked",!0):p.removeAttr("checked");var u=e(".mf-form-modalinput-enable_recaptcha");"1"==t.enable_recaptcha?u.attr("checked",!0):u.removeAttr("checked");var _=e(".mf-form-modalinput-capture_user_browser_data");"1"==t.capture_user_browser_data?(_.attr("checked",!0),e("#multiple_submission").removeClass("hide_input"),e("#multiple_submission").addClass("show_input")):_.removeAttr("checked"),e(".mf-form-user-email-subject").val(t.user_email_subject),e(".mf-form-user-email-from").val(t.user_email_from),e(".mf-form-user-reply-to").val(t.user_email_reply_to),e(".mf-form-user-email-body").val(t.user_email_body);var h=e(".mf-form-user-enable");"1"==t.enable_user_notification?(h.attr("checked",!0),g.show()):(h.removeAttr("checked"),g.hide());var j=e(".mf-form-redirect-enable");"1"==t.enable_form_redirect_notification?(j.attr("checked",!0),b.show()):(j.removeAttr("checked"),b.hide());var $=e(".mf-form-user-submission-copy");"1"==t.user_email_attach_submission_copy?$.attr("checked",!0):$.removeAttr("checked"),e(".mf-form-admin-email-subject").val(t.admin_email_subject),e(".mf-form-admin-email-from").val(t.admin_email_from),e(".mf-form-admin-email-to").val(t.admin_email_to),e(".mf-form-admin-reply-to").val(t.admin_email_reply_to),e(".mf-form-admin-email-body").val(t.admin_email_body);var L=e(".mf-form-admin-enable");"1"==t.enable_admin_notification?(L.attr("checked",!0),y.show()):(L.removeAttr("checked"),y.hide());var G=e(".mf-form-admin-submission-copy");"1"==t.admin_email_attach_submission_copy?G.attr("checked",!0):G.removeAttr("checked");var J=e(".mf-form-modalinput-rest_api");"1"==t.mf_rest_api?(J.attr("checked",!0),e(".mf-rest-api").show()):(J.removeAttr("checked"),e(".mf-rest-api").hide());var M=e(".mf-form-modalinput-mail_chimp");"1"==t.mf_mail_chimp?(M.attr("checked",!0),w.show()):(M.removeAttr("checked"),w.hide());var V=e(".mf-form-modal_input-google_sheet");"1"==t.mf_google_sheet?(V.attr("checked",!0),q.show()):V.removeAttr("checked");let U=e(".mf-form-modalinput-ckit"),ue=e(".mf-form-modalinput-mail_aweber"),_e=e(".mf-form-modalinput-mail_poet");if("1"==t.mf_convert_kit?(U.attr("checked",!0),Q.show()):(U.removeAttr("checked"),Q.hide()),"1"==t.mf_mail_aweber?(ue.attr("checked",!0),O.show()):(ue.removeAttr("checked"),O.hide()),"1"==t.mf_mail_poet?(_e.attr("checked",!0),D.show()):(_e.removeAttr("checked"),D.hide()),t.ckit_opt){let i=e("select.mf-ckit-list-id").first(),o=t.mf_ckit_list_id||"";i.html(),t.ckit_opt.forEach((function(e){i.append('")})),i.val(o)}if(t.aweber_opt){let i=e("select.mf-aweber-list-id").first(),o=t.mf_aweber_list_id||"";i.html(i.find("option.mf_aweber_default_option").clone());for(let e in t.aweber_opt)i.append('");i.val(o)}if(t.mp_opt){let i=e("select.mf-mail-poet-list-id").first(),o=t.mf_mail_poet_list_id||"";i.html();for(let e in t.mp_opt)i.append('");i.val(o)}if("1"===t.mf_active_campaign){F.attr("checked",!0),R.show();let i=t.mf_active_campaign_list_id||"",o=t.mf_active_campaign_tag_id||"";e("select[name=mf_active_campaign_list_id]").val(i),e("select[name=mf_active_campaign_tag_id]").val(o)}else F.removeAttr("checked"),R.hide();var B=e(".mf-form-modalinput-get_response");"1"==t.mf_get_response?(B.attr("checked",!0),e(".mf-get_response").show()):(B.removeAttr("checked"),e(".mf-get_response").hide());var H=e(".mf-hubsopt");"1"==t.mf_hubspot?H.attr("checked",!0):H.removeAttr("checked");var K=e(".mf-hubspot-forms"),Z=e(".hubspot_forms_section");"1"==t.mf_hubspot_forms?(K.attr("checked",!0),Z.show()):(K.removeAttr("checked"),Z.hide()),e(".mf_hubspot_form_portalId").val(t.mf_hubspot_form_portalId),e(".mf_hubspot_form_guid").val(t.mf_hubspot_form_guid);var Y=e(".mf-zoho");"1"==t.mf_zoho?Y.attr("checked",!0):Y.removeAttr("checked");var ee=e(".mf-helpscout");"1"==t.mf_helpscout?(ee.attr("checked",!0),e(".helpscout_forms_section").show()):(ee.removeAttr("chekced"),e(".helpscout_forms_section").hide()),t.mf_helpscout_mailbox&&e('#mf_helpscout_mailbox option[value="'+t.mf_helpscout_mailbox+'"]').prop("selected",!0);var te=e(".mf-form-modalinput-mailster"),ie=e(".mf-mailster-settings-section");"1"==t.mf_mailster?(te.attr("checked",!0),ie.show(),e(".mf-mailster-forms").show()):(te.removeAttr("checked"),ie.hide(),e(".mf-mailster-forms").hide());var oe=e(".mf-register");1==t.mf_registration?(oe.attr("checked",!0),e(".mf_register_form_fields").show()):(oe.removeAttr("checked"),e(".mf_register_form_fields").hide());var se=e(".mf-login");1==t.mf_login?(se.attr("checked",!0),e(".mf_login_form_fields").show()):(e(".mf_login_form_fields").hide(),se.removeAttr("checked"));var ae=e(".mf-form-to-post"),ne=e(".mf-form-to-post-fields");1==t.mf_form_to_post?(ae.attr("checked",!0),ne.show()):(ae.removeAttr("checked"),ne.hide());var re=e(".mf-form-modalinput-zapier");"1"==t.mf_zapier?(re.attr("checked",!0),x.show()):(re.removeAttr("checked",!0),x.hide());var me=e(".mf-form-modalinput-slack");"1"==t.mf_slack?(me.attr("checked",!0),T.show()):(me.removeAttr("checked",!0),T.hide());var le=e(".mf-form-modalinput-fluent");if("1"==t.mf_fluent?(le.attr("checked",!0),C.show()):(le.removeAttr("checked",!0),C.hide()),"1"==t.mf_sms_user_status?(W.attr("checked",!0),z.show()):(W.removeAttr("checked",!0),z.hide()),"1"==t.mf_sms_admin_status?(S.attr("checked",!0),P.show()):(S.removeAttr("checked",!0),P.hide()),"1"==t.mf_sms_status?(N.attr("checked",!0),A.show()):(N.removeAttr("checked",!0),A.hide(),W.removeAttr("checked",!0),z.hide(),S.removeAttr("checked",!0),P.hide()),t.mf_payment_currency){e("select.mf_payment_currency").val(t.mf_payment_currency)}let he=e(".mf-form-modalinput-paypal");"1"==t.mf_paypal?(he.attr("checked",!0),X.show()):(he.removeAttr("checked",!0),X.hide());var fe=e(".mf-form-modalinput-stripe");"1"==t.mf_stripe?(fe.attr("checked",!0),E.show()):(fe.removeAttr("checked",!0),E.hide());fe=e(".mf-form-modalinput-stripe");"1"==t.mf_stripe?(fe.attr("checked",!0),E.show()):(fe.removeAttr("checked",!0),E.hide());var ce=e(".mf-form-modalinput-paypal_sandbox");"1"==t.mf_paypal_sandbox?ce.attr("checked",!0):ce.removeAttr("checked",!0);var de=e(".mf-form-modalinput-stripe_sandbox");"1"==t.mf_stripe_sandbox?de.attr("checked",!0):de.removeAttr("checked",!0);var pe=t.mf_rest_api_method&&t.mf_rest_api_method.length?t.mf_rest_api_method:"POST";e('.mf-rest-api-method option[value="'+pe+'"]').prop("selected",!0),e(".mf-rest-api-url").val(t.mf_rest_api_url),e(".mf-mailchimp-api-key").val(t.mf_mailchimp_api_key),e(".mf-mailchimp-list-id").val(t.mf_mailchimp_list_id),e(".mf-google-spreadsheets-list-id").val(t.mf_google_spreadsheets_list_id),e(".mf-google-sheets-list-id").val(t.mf_google_sheets_list_id),""==t.mf_google_spreadsheets_list_id&&e(".mf-google-spreadsheets-list-id").val(e(".mf-google-spreadsheets-list").find(":selected").val()),0!=t.mf_google_spreadsheets_list_id&&(a(),n(t.mf_google_spreadsheets_list_id),e('.mf-google-spreadsheets-list option[value="'+t.mf_google_spreadsheets_list_id+'"]').prop("selected",!0)),""==t.mf_google_sheets_list_id&&e(".mf-google-sheets-list-id").val(e(".mf-google-sheets-list").find(":selected").val()),0!=t.mf_google_sheets_list_id&&e('.mf-google-sheets-list option[value="'+t.mf_google_sheets_list_id+'"]').prop("selected",!0),""==t.mf_mailchimp_list_id&&e(".mf-mailchimp-list-id").val(e(".mailchimp_list").find(":selected").val()),0!=t.mf_mailchimp_list_id&&e('.mailchimp_list option[value="'+t.mf_get_response_list_id+'"]').prop("selected",!0),r(),e(".mf-get_response-list-id").val(t.mf_get_response_list_id),0!=t.mf_get_response_list_id&&e('.get-response-campaign-list option[value="'+t.mf_get_response_list_id+'"]').prop("selected",!0),e(".mf-zapier-web-hook").val(t.mf_zapier_webhook),e(".mf-slack-web-hook").val(t.mf_slack_webhook),e(".mf-fluent-web-hook").val(t.mf_fluent_webhook),e(".mf-sms-from").val(t.mf_sms_from),e(".mf-sms-twilio-account-sid").val(t.mf_sms_twilio_account_sid),e(".mf-sms-twilio-auth-token").val(t.mf_sms_twilio_auth_token),e(".mf-sms-user-body").val(t.mf_sms_user_body),e(".mf-sms-admin-body").val(t.mf_sms_admin_body),e(".mf-sms-admin-to").val(t.mf_sms_admin_to),e(".mf-paypal-email").val(t.mf_paypal_email),e(".mf-paypal-token").val(t.mf_paypal_token),e(".mf-stripe-image-url").val(t.mf_stripe_image_url),e(".mf-stripe-live-publishiable-key").val(t.mf_stripe_live_publishiable_key),e(".mf-stripe-live-secret-key").val(t.mf_stripe_live_secret_key),e(".mf-stripe-test-publishiable-key").val(t.mf_stripe_test_publishiable_key),e(".mf-stripe-test-secret-key").val(t.mf_stripe_test_secret_key),e(".mf-recaptcha-site-key").val(t.mf_recaptcha_site_key),e(".mf-recaptcha-secret-key").val(t.mf_recaptcha_secret_key),e("input.mf-form-modalinput-limit_status, .mf-form-modalinput-rest_api").trigger("change")}(window.mf_mailster_list_id=t.mf_mailster_list_id,e('.mf-mailster-list-id option[value="'+t.mf_mailster_list_id+'"]').prop("selected",!0),e(".mf-form-modalinput-mailster").length)&&U(e(".mf-mailster-list-id").find(":selected").val(),e("#metform_form_modal").find("form").attr("data-mf-id"))}e("input.mf-form-modalinput-store_entries").on("change",(function(){e(this).is(":checked")?v.show():e(this).is(":not(:checked)")&&v.hide()})),e("input.mf-form-modalinput-limit_status").on("change",(function(){e(this).is(":checked")?e("#limit_status").find("input").removeAttr("disabled"):e(this).is(":not(:checked)")&&e("#limit_status").find("input").attr("disabled","disabled")})),e("input.mf-form-user-enable").on("change",(function(){e(this).is(":checked")?g.show():e(this).is(":not(:checked)")&&g.hide()})),e("input.mf-form-redirect-enable").on("change",(function(){e(this).is(":checked")?(b.show(200),e("input.mf_redirect_params_status").val("true")):e(this).is(":not(:checked)")&&(b.hide(200),e("input.mf_redirect_params_status").val("false"))})),e("input.mf-form-admin-enable").on("change",(function(){e(this).is(":checked")?y.show():e(this).is(":not(:checked)")&&y.hide()})),e("input.mf-form-modalinput-rest_api").on("change",(function(){e(this).is(":checked")?k.show():e(this).is(":not(:checked)")&&k.hide()})),e("input.mf-form-modalinput-mail_chimp").on("change",(function(){e(this).is(":checked")?w.show():e(this).is(":not(:checked)")&&w.hide()})),e("input.mf-form-modal_input-google_sheet").on("change",(function(){e(this).is(":checked")?(q.show(),a()):e(this).is(":not(:checked)")&&q.hide()})),e(".mf-form-modalinput-get_response").on("change",(function(){e(this).is(":checked")?j.show():j.hide()})),e("input.mf-form-email-verification-enable").on("change",(function(){e(this).is(":checked")?I.show():e(this).is(":not(:checked)")&&I.hide()})),F.on("change",(function(){e(this).is(":checked")?R.show():R.hide()})),e("input.mf-form-modalinput-mail_aweber").on("change",(function(){e(this).is(":checked")?O.show():e(this).is(":not(:checked)")&&O.hide()})),e("input.mf-form-modalinput-mail_poet").on("change",(function(){e(this).is(":checked")?D.show():e(this).is(":not(:checked)")&&D.hide()})),e("input.mf-form-modalinput-ckit").on("change",(function(){e(this).is(":checked")?Q.show():e(this).is(":not(:checked)")&&Q.hide()})),e("input.mf-form-modalinput-zapier").on("change",(function(){e(this).is(":checked")?x.show():e(this).is(":not(:checked)")&&x.hide()})),e("input.mf-form-modalinput-slack").on("change",(function(){e(this).is(":checked")?T.show():e(this).is(":not(:checked)")&&T.hide()})),e("input.mf-form-modalinput-fluent").on("change",(function(){e(this).is(":checked")?C.show():e(this).is(":not(:checked)")&&C.hide()})),e("input.mf-form-modalinput-sms-user").on("change",(function(){e(this).is(":checked")?z.show():e(this).is(":not(:checked)")&&z.hide()})),e("input.mf-form-modalinput-sms-admin").on("change",(function(){e(this).is(":checked")?P.show():e(this).is(":not(:checked)")&&P.hide()})),e("input.mf-form-modalinput-sms").on("change",(function(){e(this).is(":checked")?A.show():e(this).is(":not(:checked)")&&(A.hide(),W.removeAttr("checked",!0),z.hide(),S.removeAttr("checked",!0),P.hide())})),e("input.mf-form-modalinput-paypal").on("change",(function(){e(this).is(":checked")?X.show():e(this).is(":not(:checked)")&&X.hide()})),e("input.mf-form-modalinput-stripe").on("change",(function(){e(this).is(":checked")?stripe.show():e(this).is(":not(:checked)")&&stripe.hide()})),e("input.mf-form-modalinput-stripe_sandbox").on("change",(function(){e(this).is(":checked")?e(".mf_stripe_sandbox").show():e(this).is(":not(:checked)")&&e(".mf_stripe_sandbox").hide()})),e(".mf-hubspot-forms").on("change",(function(){e(this).is(":checked")?e(".hubspot_forms_section").show():e(".hubspot_forms_section").hide()})),e(".mf-register").on("change",(function(){e(this).is(":checked")?e(".mf_register_form_fields").show():e(".mf_register_form_fields").hide()})),e(".mf-login").on("change",(function(){e(this).is(":checked")?e(".mf_login_form_fields").show():e(".mf_login_form_fields").hide()})),e(".mf-form-to-post").on("change",(function(){e(this).is(":checked")?e(".mf-form-to-post-fields").show():e(".mf-form-to-post-fields").hide()})),e(".mf-zoho").on("change",(function(){e(this).is(":checked")?e(".mf_zoho_forms_section").show():e(".mf_zoho_forms_section").hide()})),e(".mf-helpscout").on("change",(function(){e(this).is(":checked")?e(".helpscout_forms_section").show():e(".helpscout_forms_section").hide()})),e(".mf-form-modalinput-mailster").on("change",(function(){e(this).is(":checked")?(e(".mf-mailster-settings-section").show(),e(".mf-mailster-forms").show()):(e(".mf-mailster-settings-section").hide(),e(".mf-mailster-forms").hide())})),e(".mf-mailster-list-id").on("change",(function(){e(this).val(),e("#metform-form-modalinput-settings").attr("data-mf-id")})),e(".get-response-campaign-list").on("change",(function(){e(".mf-get_response-list-id ").val(e(this).val())})),e("input.mf-form-modalinput-capture_user_browser_data").click((function(){e(this).is(":checked")?(e("#multiple_submission").removeClass("hide_input"),e("#multiple_submission").addClass("show_input")):e(this).is(":not(:checked)")&&(e("#multiple_submission").removeClass("show_input"),e("#multiple_submission").addClass("hide_input"))})),e(".mf-settings-tab .mf-setting-nav-link").on("click",(function(t){if(!e(this).hasClass("mf-setting-nav-hidden")){t.preventDefault();var i=e(this).attr("href");window.location.hash=i,e(this).parent().addClass("nav-tab-active").siblings().removeClass("nav-tab-active"),e(i).addClass("active").siblings().removeClass("active")}})),e(".mf-setting-nav-link").on("click",(function(t){e(this).hasClass("mf-setting-nav-hidden")?t.preventDefault():(e(this).parents(".nav-tab-wrapper").find("a").removeClass("top").removeClass("bottom"),e(this).parents("li").prev().find("a").addClass("top"),e(this).parents("li").next().find("a").addClass("bottom"))}));var G=e(".mf-settings-tab .mf-setting-nav-link").eq(1).attr("href");if(window.location.hash&&(G=window.location.hash),e('.mf-settings-tab .mf-setting-nav-link[href="'+G+'"]').trigger("click"),e(window).on("resize.mfSettings",(function(){e(".mf-setting-sidebar").css("width",e(".mf-setting-sidebar-column").width())})).trigger("resize.mfSettings"),e(".mf-setting-header").length>0){var J=e(".mf-setting-header").offset().top;e(window).scroll((function(){var t=e(".mf-setting-header");e(window).scrollTop()>=J?t.addClass("fixed").css({width:jQuery(".metform-admin-container").width()}):t.removeClass("fixed").css({width:"auto"})}))}function M(){return e("#metform-form-modalinput-settings").attr("data-nonce")}function V(){return e("#mf_wp_rest_nonce").val()}let B;e(".mf-admin-single-accordion").on("click",".mf-admin-single-accordion--heading",(function(){e(this).next().slideToggle().parent().toggleClass("active").siblings().removeClass("active").find(".mf-admin-single-accordion--body").slideUp()})),e(".mf-admin-single-accordion:first-child .mf-admin-single-accordion--heading").trigger("click"),e(".mf-recaptcha-version").on("change",(function(){var t=e(this).val();e("#mf-"+t).fadeIn().siblings().hide()})),e(".mf-recaptcha-version").trigger("change"),e(".mf-form-modalinput-stripe_sandbox").on("change",(function(){var t=e(this).parents(".attr-form-group").eq(0).next(".mf-form-modalinput-stripe_sandbox_keys");e(this).is(":checked")?t.fadeIn():t.fadeOut()})),e(".mf-form-modalinput-stripe_sandbox").trigger("change"),e(document).on("click","#met_pro_aweber_authorize",(function(t){t.preventDefault();let i=e(this).closest("p.description");i.html("Wait....");var o=metform_api.admin_url+"admin-ajax.php",s={action:"get_aweber_authorization_url",api_key:e("#mf_aweber_dev_api_key").val(),api_sec:e("#mf_aweber_dev_api_sec").val()};e.ajax({url:o,method:"POST",data:s,headers:{"X-WP-Nonce":V()},dataType:"json",success:function(e){if(!0===e.success){let t='Authorize The App ';i.html(t)}else if(e.data){let t=e.data;i.html(''+t.msg+"")}},error:function(e){i.html(' ajax error occurred, please check your internet connection..')},complete:function(){}})})),e(document).on("click","#met_pro_aweber_propmpt_re_auth",(function(t){t.preventDefault(),e("#mf_aweber_dev_api_key").val("").prop("disabled",!1),e("#mf_aweber_dev_api_sec").val("").prop("disabled",!1),e(this).closest("p.description").html(' Get Re - Authorization URL ')})),e(document).on("click","#met_pro_aweber_re_authorize",(function(t){t.preventDefault();let i=e(this).closest("p.description");i.html("Wait....");let o=e("#mf_aweber_dev_api_key").val();if(!o||o.length<1)return i.html('API Key can not be empty..'),!1;var s=metform_api.admin_url+"admin-ajax.php",a={action:"get_aweber_re_authorization_url",api_key:o,api_sec:e("#mf_aweber_dev_api_sec").val()};e.ajax({url:s,method:"POST",data:a,headers:{"X-WP-Nonce":V()},dataType:"json",success:function(e){if(!0===e.success){let t=e.data;if("ok"==t.result){let e='Authorize The App ';i.html(e)}else i.html(""+t.msg+"")}else if(e.data){let t=e.data;i.html(''+t.msg+"")}},error:function(e){i.html(' ajax error occurred, please check your internet connection..')},complete:function(){}})})),e(document).on("click","#met_form_aweber_get_list",(function(t){t.preventDefault();let i=e(this),o=e("#mf_aweber_info"),s=metform_api.admin_url+"admin-ajax.php";e.ajax({url:s,method:"POST",data:{action:"get_list_lists"},headers:{"X-WP-Nonce":M()},dataType:"json",beforeSend:function(){o.html('Loading')},success:function(e){if(!0===e.success){let t=e.data,s=i.parent(".mf-input-help").siblings("select.mf-aweber-list-id"),a=s.find("option.mf_aweber_default_option").clone();if(s.html(a),t.lists)for(let e in t.lists)s.append('");o.html(""),i.parent(".mf-input-help").siblings("#mf-aweber-fields").html("")}else if(e.data){let t=e.data;o.html(''+t.msg+"")}},error:function(e){o.html(' ajax error occurred, please check your internet connection..')},complete:function(){}})})),e(".mf-aweber-list-id").on("change",(function(){let t=e("#mf-aweber-fields"),i=e("option:selected",this).val();if(!i)return void t.html("");t.html("Please wait....");let o=e("#metform-form-modalinput-settings").attr("data-nonce"),a=e("#metform_form_modal").find("form").attr("data-mf-id"),n="";e.ajax({url:window.metform_api.resturl+"metform/v1/forms/get_fields_data/"+a,type:"get",headers:{"X-WP-Nonce":o},dataType:"json",success:function(r){n=r;let m=metform_api.admin_url+"admin-ajax.php",l={action:"get_aweber_custom_fields",selectedValue:i,formId:a,nonce:o};e.ajax({url:m,type:"post",data:l,headers:{"X-WP-Nonce":o},dataType:"json",success:function(e){let i=e.data;if("ok"===i.result&&i.custom_fields){let e,o="",a=Object.keys(n).map((function(e){return[n[e]]})),r="mf_aweber_custom_field_name_",m="mf_aweber_custom_field_label_";i.custom_fields.entries.forEach((t=>{let i;e="",a.map((o=>{i="",o[0].mf_input_name===s[r+t.id]&&(i='selected="selected"'),e+=""})),o+="
"+t.name+'
"})),t.html('
'+o+"
")}},error:function(e){console.log("Error: "+e)}})},error:function(t){e("#mf-aweber-fields").html("Sorry ! Something went wrong")}})})),e(document).on("click","#met_form_mail_poet_get_list",(function(t){t.preventDefault();let i=e(this),o=e("#mf_mail_poet_info"),s=metform_api.admin_url+"admin-ajax.php";e.ajax({url:s,method:"POST",data:{action:"mail_poet_get_email_list_lists"},headers:{"X-WP-Nonce":M()},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,s=i.closest("div.mf-mail-poet").find("select");if(s.html(""),t.lists)for(let e in t.lists)s.append('");o.html("")}else if(e.data){let t=e.data;o.html(''+t.msg+"")}},error:function(e){o.html(' ajax error occurred, please check your internet connection..')},complete:function(){}})})),e(document).on("click","#met_form_ckit_get_list",(function(t){t.preventDefault();var i=metform_api.admin_url+"admin-ajax.php";let o=e(this);e.ajax({url:i,method:"POST",data:{action:"get_form_lists"},headers:{"X-WP-Nonce":M()},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,i=o.closest("div.mf-ckit").find("select");i.html(""),t.forms&&t.forms.forEach((function(e){i.append('")}))}else alert("Error occurred when trying to check for aweber authorization.")},error:function(e){},complete:function(){}})})),e(document).on("click","#met_form_act_camp_get_list",(function(t){t.preventDefault();let i=window.metform_api.resturl+"metform-pro/v1/active-campaign/email_lists",o=M(),s=e(this),a=e("#mf_act_camp_info");e.ajax({url:i,method:"GET",data:[],headers:{"X-WP-Nonce":o},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,i=s.closest("div.mf-input-group").find("select");i.html(""),t.list&&t.list.forEach((function(e){i.append('")})),a.html(e.data.msg)}else a.html(e.data.msg)},error:function(e){a.html(' ajax error occurred, please check your internet connection..')},complete:function(){}})})),e(document).on("click","#met_form_act_camp_get_tags",(function(t){t.preventDefault();let i=window.metform_api.resturl+"metform-pro/v1/active-campaign/tag_lists",o=M(),s=e(this),a=e("#mf_act_camp_tag_info");e.ajax({url:i,method:"GET",data:[],headers:{"X-WP-Nonce":o},dataType:"json",success:function(e){if(!0===e.success){let t=e.data,i=s.closest("div.mf-input-group").find("select");i.html(""),t.list&&t.list.forEach((function(e){i.append('")})),a.html(e.data.msg)}else a.html(e.data.msg)},error:function(e){a.html(' ajax error occurred, please check your internet connection..')},complete:function(){}})})),e("#mf-helpscout-btn-token").click((function(){let t=window.metform_api.resturl+"metform/v1/forms/get_helpscout_access_token/123";e.ajax({url:t,type:"get",headers:{"X-WP-Nonce":V()},success:function(e){200==e.status&&location.reload()},error:function(e){alert("Something went wrong")}})}));let H=[]}));