jQuery(function(e){function i(){e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function c(){e("form.activate-jetpack").submit()}function t(){wp.ajax.post("setup_wizard_check_jetpack").then(function(e){if(!e||!e.is_active||"yes"===e.is_active)return c();setTimeout(t,3e3)}).fail(function(){c()})}e(".button-next").on("click",function(){var c=e(this).parents("form").get(0);return("function"!=typeof c.checkValidity||c.checkValidity())&&i(),!0}),e(".wc-wizard-services").on("change",".wc-wizard-service-enable input",function(){e(this).is(":checked")?e(this).closest(".wc-wizard-service-toggle").removeClass("disabled"):e(this).closest(".wc-wizard-service-toggle").addClass("disabled")}),e(".wc-wizard-services").on("click",".wc-wizard-service-enable",function(i){i.stopPropagation();var c=e(this).find(".wc-wizard-service-toggle input");c.prop("checked",!c.prop("checked")).change()}),e(".wc-wizard-services-list-toggle").on("change",".wc-wizard-service-enable input",function(){e(this).closest(".wc-wizard-services").find(".wc-wizard-service-item").slideToggle().css("display","flex")}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-select .method",function(i){var c=e(this).parent("div"),t=i.target.value,n=c.find(".shipping-method-description");n.find("p").hide(),n.find("p."+t).show();var s=c.find(".shipping-method-settings");s.find("div").hide(),s.find("div."+t).show()}),e(".button-jetpack-connect").on("click",function(e){if(i(),"no"===wc_setup_params.pending_jetpack_install)return!0;e.preventDefault(),t()})});