Edit file File name : form-embed-wizard.min.js Content :"use strict";var WPFormsFormEmbedWizard=window.WPFormsFormEmbedWizard||function(o,t,a){var i={},n={formId:0,isBuilder:!1,isChallengeActive:!1,lastEmbedSearchPageTerm:""},r={init:function(){a(r.ready),a(t).on("load",function(){"function"==typeof a.ready.then?a.ready.then(r.load):r.load()})},ready:function(){r.initVars(),r.events()},load:function(){"1"!==wpforms_admin_form_embed_wizard.is_edit_page||n.isChallengeActive||r.initTooltip(),n.isBuilder&&r.initialStateToggle(),r.initSelectPagesChoicesJS(),a(o).on("wpformsWizardPopupClose",r.enableLetsGoButton)},initVars:function(){(i={$wizardContainer:a("#wpforms-admin-form-embed-wizard-container"),$wizard:a("#wpforms-admin-form-embed-wizard"),$contentInitial:a("#wpforms-admin-form-embed-wizard-content-initial"),$contentSelectPage:a("#wpforms-admin-form-embed-wizard-content-select-page"),$contentCreatePage:a("#wpforms-admin-form-embed-wizard-content-create-page"),$sectionBtns:a("#wpforms-admin-form-embed-wizard-section-btns"),$sectionGo:a("#wpforms-admin-form-embed-wizard-section-go"),$newPageTitle:a("#wpforms-admin-form-embed-wizard-new-page-title"),$selectPage:a("#wpforms-setting-form-embed-wizard-choicesjs-select-pages"),$videoTutorial:a("#wpforms-admin-form-embed-wizard-tutorial"),$sectionToggles:a("#wpforms-admin-form-embed-wizard-section-toggles"),$sectionGoBack:a("#wpforms-admin-form-embed-wizard-section-goback"),$shortcode:a("#wpforms-admin-form-embed-wizard-shortcode-wrap"),$shortcodeInput:a("#wpforms-admin-form-embed-wizard-shortcode"),$shortcodeCopy:a("#wpforms-admin-form-embed-wizard-shortcode-copy")}).$selectPageContainer=i.$selectPage.parents("span.choicesjs-select-wrap"),n.isBuilder="undefined"!=typeof WPFormsBuilder,n.isChallengeActive="undefined"!=typeof WPFormsChallenge,n.pagesExists=1===i.$wizard.data("pages-exists")},initSelectPagesChoicesJS:function(){var e;i.$selectPage.length<=0||(e=1===i.$selectPage.data("use_ajax"),WPForms.Admin.Builder.WPFormsChoicesJS.setup(i.$selectPage[0],{},{action:"wpforms_admin_form_embed_wizard_search_pages_choicesjs",nonce:e?wpforms_admin_form_embed_wizard.nonce:null}))},events:function(){i.$wizard.length&&i.$wizard.on("click","button",r.popupButtonsClick).on("click",".tutorial-toggle",r.tutorialToggle).on("click",".shortcode-toggle",r.shortcodeToggle).on("click",".initialstate-toggle",r.initialStateToggle).on("click",".wpforms-admin-popup-close",r.closePopup).on("click","#wpforms-admin-form-embed-wizard-shortcode-copy",r.copyShortcodeToClipboard).on("keyup","#wpforms-admin-form-embed-wizard-new-page-title",r.enableLetsGoButton)},popupButtonsClick:function(e){var o=a(e.target);if(o.length){var e=o.closest("div"),t=o.data("action")||"";switch(i.$contentInitial.hide(),t){case"select-page":i.$newPageTitle.hide(),i.$contentSelectPage.show();break;case"create-page":i.$selectPageContainer.hide(),i.$contentCreatePage.show();break;case"go":return i.$selectPageContainer.is(":visible")&&""===i.$selectPage.val()?void 0:(o.prop("disabled",!0),void r.saveFormAndRedirect())}e.hide(),e.next().fadeIn(),i.$sectionToggles.hide(),i.$sectionGoBack.fadeIn(),a.each([i.$selectPage,i.$newPageTitle],function(){this.is(":visible")&&this.trigger("focus")}),r.tutorialControl("Stop")}},tutorialToggle:function(e){e.preventDefault(),i.$shortcode.hide(),i.$videoTutorial.toggle(),"about:blank"===i.$videoTutorial.attr("src")&&i.$videoTutorial.attr("src",wpforms_admin_form_embed_wizard.video_url),i.$videoTutorial[0].src.indexOf("&autoplay=1")<0?r.tutorialControl("Play"):r.tutorialControl("Stop")},tutorialControl:function(e){var o=i.$videoTutorial[0];void 0!==o&&("Stop"!==e?o.src+=o.src.indexOf("&autoplay=1")<0?"&autoplay=1":"":o.src=o.src.replace("&autoplay=1",""))},shortcodeToggle:function(e){e.preventDefault(),i.$videoTutorial.hide(),r.tutorialControl("Stop"),i.$shortcodeInput.val('[wpforms id="'+n.formId+'" title="false"]'),i.$shortcode.toggle()},enableLetsGoButton:function(){i.$sectionGo.find("button").prop("disabled",!1)},copyShortcodeToClipboard:function(){i.$shortcodeInput.prop("disabled",!1).select().prop("disabled",!0),o.execCommand("copy");var e=i.$shortcodeCopy.find("i");e.removeClass("fa-files-o").addClass("fa-check"),t.setTimeout(function(){e.removeClass("fa-check").addClass("fa-files-o")},2500)},initialStateToggle:function(e){e&&e.preventDefault(),n.pagesExists?(i.$contentInitial.show(),i.$contentSelectPage.hide(),i.$contentCreatePage.hide(),i.$selectPageContainer.show(),i.$newPageTitle.show(),i.$sectionBtns.show(),i.$sectionGo.hide()):(i.$contentInitial.hide(),i.$contentSelectPage.hide(),i.$contentCreatePage.show(),i.$selectPageContainer.hide(),i.$newPageTitle.show(),i.$sectionBtns.hide(),i.$sectionGo.show()),i.$shortcode.hide(),i.$videoTutorial.hide(),r.tutorialControl("Stop"),i.$sectionToggles.show(),i.$sectionGoBack.hide()},saveFormAndRedirect:function(){!n.isBuilder||WPFormsBuilder.formIsSaved()?r.embedPageRedirect():n.isBuilder&&n.isChallengeActive?WPFormsBuilder.formSave().done(r.embedPageRedirect):a.confirm({title:!1,content:wpforms_builder.exit_confirm,icon:"fa fa-exclamation-circle",type:"orange",closeIcon:!0,buttons:{confirm:{text:wpforms_builder.save_embed,btnClass:"btn-confirm",keys:["enter"],action:function(){WPFormsBuilder.formSave().done(r.embedPageRedirect)}},cancel:{text:wpforms_builder.embed,action:function(){WPFormsBuilder.setCloseConfirmation(!1),r.embedPageRedirect()}}},onClose:function(){i.$sectionGo.find("button").prop("disabled",!1)}})},embedPageRedirectAjaxData:function(){var e={action:"wpforms_admin_form_embed_wizard_embed_page_url",_wpnonce:wpforms_admin_form_embed_wizard.nonce,formId:n.formId};return i.$selectPageContainer.is(":visible")&&(e.pageId=i.$selectPage.val()),i.$newPageTitle.is(":visible")&&(e.pageTitle=i.$newPageTitle.val()),e},embedPageRedirect:function(){var e=r.embedPageRedirectAjaxData();void 0!==e.pageId&&""===e.pageId||a.post(ajaxurl,e,function(e){e.success&&(t.location=e.data)})},openPopup:function(e){e=e||0,n.formId=n.isBuilder?a("#wpforms-builder-form").data("id"):e,i.$wizard.toggleClass("wpforms-challenge-popup",n.isChallengeActive),i.$wizard.find(".wpforms-admin-popup-content-regular").toggle(!n.isChallengeActive),i.$wizard.find(".wpforms-admin-popup-content-challenge").toggle(n.isChallengeActive),0===i.$selectPage.length?(i.$sectionBtns.hide(),i.$sectionGo.show()):(i.$sectionBtns.show(),i.$sectionGo.hide()),i.$newPageTitle.show(),i.$selectPageContainer.show(),i.$wizardContainer.fadeIn()},closePopup:function(){i.$wizardContainer.fadeOut(),r.initialStateToggle(),a(o).trigger("wpformsWizardPopupClose")},initTooltip:function(){if(void 0!==a.fn.tooltipster){var e=a('<span class="wpforms-admin-form-embed-wizard-dot"> </span>'),o=r.isGutenberg(),t=o?".block-editor .edit-post-header":"#wp-content-editor-tools .wpforms-insert-form-button",i={content:a("#wpforms-admin-form-embed-wizard-tooltip-content"),trigger:"custom",interactive:!0,animationDuration:0,delay:0,theme:["tooltipster-default","wpforms-admin-form-embed-wizard"],side:o?"bottom":"right",distance:3,functionReady:function(e,o){e._$tooltip.on("click","button",function(){e.close(),a(".wpforms-admin-form-embed-wizard-dot").remove()}),e.reposition()}};o||e.insertAfter(t).tooltipster(i).tooltipster("open");const n=wp.data.subscribe(function(){a(t).length&&(n(),e.insertAfter(t).tooltipster(i).tooltipster("open"))})}},isGutenberg:function(){return"undefined"!=typeof wp&&Object.prototype.hasOwnProperty.call(wp,"blocks")}};return r}(document,window,jQuery);WPFormsFormEmbedWizard.init(); Save