(()=>{var e={1669:e=>{"use strict";e.exports=jQuery}},s={};function t(i){var o=s[i];if(void 0!==o)return o.exports;var n=s[i]={exports:{}};return e[i](n,n.exports,t),n.exports}var i=t(1669),o=t(1669);const n={init:function(){this.submit()},submit:function(){const e=this;i(document.body).on("submit",".edd-export-form",(function(s){s.preventDefault();const t=i(this),o=t.find('button[type="submit"]').first();if(o.hasClass("button-disabled")||o.is(":disabled"))return;const n=t.serialize();o.hasClass("button-primary")&&o.removeClass("button-primary").addClass("button-secondary"),o.attr("disabled",!0).addClass("updating-message"),t.find(".notice-wrap").remove(),t.append('<div class="notice-wrap"><div class="edd-progress"><div></div></div></div>'),e.process_step(1,n,e)}))},process_step:function(e,s,t){i.ajax({type:"POST",url:ajaxurl,data:{form:s,action:"edd_do_ajax_export",step:e},dataType:"json",success:function(e){if("done"===e.step||e.error||e.success){const s=i(".edd-export-form").find(".edd-progress").parent().parent(),t=s.find(".notice-wrap");if(s.find("button").removeClass("updating-message").addClass("updated-message"),setTimeout((function(){s.find("button").attr("disabled",!1).removeClass("updated-message")}),3e3),s.find("button .spinner").hide().css("visibility","visible"),e.error){const s=e.message;t.html('<div class="updated error"><p>'+s+"</p></div>")}else if(e.success){const s=e.message;t.html('<div id="edd-batch-success" class="updated notice"><p>'+s+"</p></div>"),e.data&&i.each(e.data,(function(e,s){i(".edd_"+e).html(s)}))}else t.remove(),window.location=e.url}else i(".edd-progress div").animate({width:e.percentage+"%"},50,(function(){})),t.process_step(parseInt(e.step),s,t)}}).fail((function(e){window.console&&window.console.log&&console.log(e)}))}};o(document).ready((function(e){n.init()}))})();