(()=>{var i,a;window.shiptastic=window.shiptastic||{},window.shiptastic.admin=window.shiptastic.admin||{},i=jQuery,(a=window.shiptastic).admin.wizard={params:{},init:function(){var d=a.admin.wizard;d.params=wc_shiptastic_admin_wizard_params,i(document).on("submit",".wc-shiptastic-wizard-form",d.onSubmit)},onSubmit:function(d){var t=a.admin.wizard,n=i(this),s=n.find(".wc-shiptastic-error-wrapper"),o=i("#wc-shiptastic-wizard-links").find(".button-submit"),e=n.serialize();return s.find(".notice").remove(),n.addClass("loading"),n.find(":input:not(.disabled):not([type=hidden])").prop("disabled",!0),o.prop("disabled",!0).addClass("loading"),i.ajax({type:"POST",url:t.params.ajax_url,data:e,dataType:"json"}).done((function(i){n.removeClass("loading"),n.find(":input:not(.disabled):not([type=hidden])").prop("disabled",!1),o.prop("disabled",!1).removeClass("loading"),window.location=i.redirect})).fail((function(a){n.removeClass("loading"),n.find(":input:not(.disabled):not([type=hidden])").prop("disabled",!1),o.prop("disabled",!1).removeClass("loading");try{var d=JSON.parse(a.responseText)}catch(i){d={}}i.each(d.data,(function(i,a){s.append('<div class="notice notice-error"><p>'+a.message+"</p></div>")})),s[0].scrollIntoView({behavior:"smooth",block:"start"})})),!1}},i(document).ready((function(){a.admin.wizard.init()})),((window.wcShiptastic=window.wcShiptastic||{}).static=window.wcShiptastic.static||{})["admin-wizard"]={}})();