").addClass("yoast-measure yoast-import-failure").html(i);o.after(l)}function j(t){P(t,"import")}function k(t){P(t,"cleanup")}function S(t){u.val()===p&&(t.preventDefault(),new d(window.yoastImportData).index(window.yoastImportData.restApi.importing_endpoints.aioseo,b).then(O).catch(j))}function C(t){l.val()===p&&(t.preventDefault(),new d(window.yoastImportData).index(window.yoastImportData.restApi.cleanup_endpoints.aioseo,D).then(E).catch(k))}function T(t){var e,a,i,o=t.closest("form").find("input[type=submit]");t.on("change",(function(){""!==(e=s()(this).find("option:selected").attr("value"))?(o.prop("disabled",!1),t===u&&(a=(0,n.sprintf)(window.yoastImportData.assets.replacing_texts.select_header,s()(this).find("option:selected").text()),i=e===p?window.yoastImportData.assets.replacing_texts.plugins.aioseo:window.yoastImportData.assets.replacing_texts.plugins.other,a+="
",i.forEach((function(t){a+="- "+t.data_name+"
"+t.data_note+" "})),a+="
",I.html(a))):o.prop("disabled",!0)}))}s()((function(){c=s()("[name='clean_external']"),c.val(window.yoastImportData.assets.replacing_texts.cleanup_button),l=s()("[name='clean_external_plugin']"),m=s()(c).parents("form:first"),h=s()("[name='import_external']"),u=s()("[name='import_external_plugin']"),g=s()(h).parents("form:first"),g.after(s()("
").html("
"+window.yoastImportData.assets.note+""+window.yoastImportData.assets.cleanup_after_import_msg)),w=s()("
![]()
").addClass("yoast-import-spinner").attr("src",window.yoastImportData.assets.spinner).css({display:"inline-block","margin-left":"10px","vertical-align":"middle"}).hide(),y=s()("
").html(window.yoastImportData.assets.loading_msg_import).css({"margin-left":"5px","vertical-align":"middle"}).hide(),f=s()("").html(window.yoastImportData.assets.loading_msg_cleanup).css({"margin-left":"5px","vertical-align":"middle"}).hide(),x=s()("").addClass("dashicons dashicons-yes-alt yoast-import-success-mark").css({"margin-left":"10px","vertical-align":"middle",color:"green"}).hide(),I=s()(".yoast-import-explanation"),I.html(window.yoastImportData.assets.replacing_texts.import_explanation),_=s()(".yoast-cleanup-explanation"),_.html(window.yoastImportData.assets.replacing_texts.cleanup_explanation),u&&(T(u),u.append("").trigger("change")),l&&(T(l),l.append("").trigger("change")),g&&g.on("submit",S),m&&m.on("submit",C),s()(x).insertAfter([h,c]),s()(y).insertAfter(h),s()(f).insertAfter(c),s()(w).insertAfter([h,c])}))})();