(()=>{var e={1669:e=>{"use strict";e.exports=jQuery},3238:(e,a,d)=>{var t=d(1669),r=d(1669);const n={inProgress:!1,init:function(){t(".edd-v3-migration-confirmation").on("change",(function(e){const a=t(this).closest(".edd-v3-migration").find("button");e.target.checked?a.removeClass("disabled").prop("disabled",!1):a.addClass("disabled").prop("disabled",!0)})),t(".edd-v3-migration").on("submit",(function(e){if(e.preventDefault(),n.inProgress)return;n.inProgress=!0;const a=t(this),d=a.find('input[name="upgrade_key"]');let r=!1;if(d.length&&d.val()&&(r=d.val()),a.find("button").removeClass("button-primary").addClass("button-secondary disabled updating-message").prop("disabled",!0),a.find("input").prop("disabled",!0),"edd-v3-migration"===a.attr("id")){t("#edd-migration-progress").removeClass("edd-hidden");const e=t("#edd-migration-progress li:not(.edd-upgrade-complete)");e.length&&!r&&(r=e.data("upgrade"))}n.processStep(r,1,a.find('input[name="_wpnonce"]').val())}))},processStep:function(e,a,d){let r={action:"edd_process_v3_upgrade",_ajax_nonce:d,upgrade_key:e,step:a};n.clearErrors(),e&&n.markUpgradeInProgress(e),t.ajax({type:"POST",data:r,url:ajaxurl,success:function(a){if(a.success){if(a.data.upgrade_completed){if(n.markUpgradeComplete(a.data.upgrade_processed),"v30_legacy_data_removed"===a.data.upgrade_processed)return void n.legacyDataRemovalComplete()}else a.data.percentage&&n.updateUpgradePercentage(a.data.upgrade_processed,a.data.percentage);a.data.next_upgrade&&"v30_legacy_data_removed"===a.data.next_upgrade&&"v30_legacy_data_removed"!==a.data.upgrade_processed?(n.inProgress=!1,n.showLegacyDataRemoval()):a.data.next_upgrade?n.processStep(a.data.next_upgrade,a.data.next_step,a.data.nonce):(n.inProgress=!1,n.stopAllSpinners())}else n.showError(e,a.data)}}).fail((e=>{}))},clearErrors:function(){t(".edd-v3-migration-error").addClass("edd-hidden").html("")},showError:function(e,a){let d=t("#edd-v3-migration");"v30_legacy_data_removed"===e&&(d=t("#edd-v3-remove-legacy-data")),d.find(".edd-v3-migration-error").html("<p>"+a+"</p>").removeClass("edd-hidden"),n.inProgress=!1,d.find("input").prop("disabled",!1),d.find("button").prop("disabled",!1).addClass("button-primary").removeClass("button-secondary disabled updating-message")},markUpgradeInProgress:function(e){const a=t("#edd-v3-migration-"+e);if(!a.length)return;const d=a.find(".dashicons");d.length&&d.removeClass("dashicons-minus").addClass("dashicons-update"),a.find(".edd-migration-percentage").removeClass("edd-hidden")},updateUpgradePercentage:function(e,a){const d=t("#edd-v3-migration-"+e);d.length&&d.find(".edd-migration-percentage-value").text(a)},markUpgradeComplete:function(e){const a=t("#edd-v3-migration-"+e);if(!a.length)return;a.addClass("edd-upgrade-complete");const d=a.find(".dashicons");d.length&&d.removeClass("dashicons-minus dashicons-update").addClass("dashicons-yes");const r=a.find(".edd-migration-status .screen-reader-text");r.length&&r.text(edd_admin_upgrade_vars.migration_complete),a.find(".edd-migration-percentage-value").text(100)},showLegacyDataRemoval:function(){t("#edd-v3-migration-button").removeClass("updating-message"),t("#edd-v3-migration-complete").removeClass("edd-hidden");const e=t("#edd-v3-remove-legacy-data");e.length&&e.removeClass("edd-hidden")},legacyDataRemovalComplete:function(){const e=t("#edd-v3-remove-legacy-data");e.length&&(e.find("form").addClass("edd-hidden"),e.find("#edd-v3-legacy-data-removal-complete").removeClass("edd-hidden"))},stopAllSpinners:function(){}};r(document).ready((function(e){n.init()}))}},a={};function d(t){var r=a[t];if(void 0!==r)return r.exports;var n=a[t]={exports:{}};return e[t](n,n.exports,d),n.exports}d.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return d.d(a,{a}),a},d.d=(e,a)=>{for(var t in a)d.o(a,t)&&!d.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},d.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{"use strict";d(3238)})()})();