(()=>{const{addAction:e}=JetPlugins.hooks,{isEmpty:t}=JetFormBuilderFunctions;e("jet.fb.multistep.page.init","jet-form-builder/switch-page-on-change",function(e){const c=()=>e.changePage(!1).then(()=>{}).catch(()=>{});e.node.addEventListener("click",t=>{if("radio"!==t.target.type)return;const n=(o=t.target,o?.closest(".jet-fb-switch-page-on-change"));var o;if(!n||!e.isNodeBelongThis(n))return;const r=t.target.closest(".jet-form-builder__field-wrap");r?.querySelector(".check-mark-control")?t.target.checked&&c():setTimeout(()=>{t.target.checked&&c()},10)});const n=e.node.querySelectorAll(".jet-fb-switch-page-on-change");if(n)for(const o of n){let n=o;o.hasOwnProperty("jfbSync")||(n=o.querySelector("input, select")),n?.jfbSync&&e.isNodeBelongThis(n)&&n.jfbSync.watch(()=>{t(n.jfbSync.getValue())||c()})}})})();