(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function n(e,n,a){var i;return i=function(e,n){if("object"!=t(e)||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var i=a.call(e,n||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(n,"string"),(n="symbol"==t(i)?i:String(i))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function a(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n",{value:e,text:e}))})),a.attr("disabled",!1).val(e[t])}))}))}else jQuery.each(e,(function(e,n){jQuery('[name="'.concat(t,"[").concat(e,']"]')).val(n).change()}))}else if("[object Array]"===n){var s=jQuery("[name=".concat(t,"]"));if("file"==(s=(s=s.length?s:jQuery("[data-name=".concat(t,"]"))).length?s:jQuery("[name=".concat(t,"\\[\\]]"))).attr("type"))j(s,e);else if(s.prop("multiple"))if(i.isFunction(window.Choices)){var l=s.data("choicesjs");a.push({handler:l,values:e})}else s.val(e).change();else if("repeater_field"===s.attr("data-type")){var c=s.find("tbody"),d=s.attr("data-name");jQuery.each(e,(function(t,e){0!=t?c.find("tr:last").clone().appendTo(c).find(".ff-el-form-control").each((function(n,a){var r="ffrpt-"+(new Date).getTime()+n;i(a).val(e[n]),i(a).attr({id:r,name:"".concat(d,"[").concat(t,"][]"),value:e[n]}).change()})):c.find("tr:first .ff-el-form-control").each((function(t,n){i(n).val(e[t]).change()}))}))}else s.each((function(t,n){-1!=jQuery.inArray(i(n).val(),e)&&i(n).prop("checked",!0).change()}))}else{var u=jQuery("[name=".concat(t,"]"));if(u.hasClass("fluentform-post-content")&&window.wp&&window.wp.editor){var p=u.attr("id");window.tinymce.get(p).setContent(e)}if("undefined"!=typeof flatpickr&&u.prop("_flatpickr")){var v=u.prop("_flatpickr");v&&(v.config.altInput?v.setDate(e,!0):u.val(e).trigger("change"))}if("radio"===u.prop("type")||"checkbox"===u.prop("type"))jQuery("[name=".concat(t,'][value="').concat(e,'"]')).prop("checked",!0).change();else{var m=u.closest(".ff-el-group").find(".fluentform-signature-pad");if(m.length){var _=m[0].getContext("2d"),h=new Image;h.src=e,h.onload=function(){_.drawImage(h,0,0)}}u.val(e).change()}}}})),a.length>0)for(var r=0;r2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"next";return new Promise((function(v){i("div"+o+"_errors").empty(),s=t;var m=r.find(".ff-step-body"),_=r.find(".ff-step-titles li"),g=r.find(".fluentform-step"),y=g.length;g.removeClass("active"),i(g[s]).addClass("active"),_.removeClass("ff_active ff_completed"),i.each(a(Array(s).keys()),(function(t){i(i(_[t])).addClass("ff_completed")})),i(_[s]).addClass("ff_active");var b,w=u?{right:-100*s+"%"}:{left:-100*s+"%"};switch(i(g[s]).closest(".ff-step-container").data("animation_type")){case"slide":m.css("transition","all ".concat(f,"ms")),m.css(w),b=new Promise((function(t){return setTimeout(t,f)}));break;case"fade":m.css("transition","all ".concat(f,"ms")),m.css(function(t){for(var a=1;ao&&n div").length-1,n=r.find(".fluentform-step.active > .ff_excluded").length;if(r.find(".fluentform-step.active > .ff-t-container").length&&(e-=r.find(".fluentform-step.active > .ff-t-container").length,e+=r.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > div").length,n+=r.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > .ff_excluded").length,r.find(".fluentform-step.active > .ff-t-container.ff_excluded").length&&(n-=r.find(".fluentform-step.active > .ff-t-container.ff_excluded").length,n-=r.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > .ff_excluded").length,n+=r.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > div").length)),e===n)return t.find(".step-nav button[data-action="+d+"], .step-nav img[data-action="+d+"]").click(),void v()}r.find(".fluentform-step.active").find('.step-nav button[data-action="next"]').css("visibility","visible"),r.find(".fluentform-step.active").find('.step-nav button[data-action="prev"]').css("visibility","visible"),r.find(".fluentform-step.active").find('.step-nav img[data-action="next"]').css("visibility","visible"),r.find(".fluentform-step.active").find('.step-nav img[data-action="prev"]').css("visibility","visible"),v()}))}))},b=!0;function w(t){var e=!1;function n(){return r.find(".fluentform-step").index(r.find(".fluentform-step.active"))}function a(){return r.find(".fluentform-step").length}function f(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a="yes"!=r.find(".ff-step-container").attr("data-disable_auto_focus");if(!b)if(a){var f=e.find("input, select, textarea, button, a").filter(":visible");f.length&&n&&setTimeout((function(){f.first().focus()}),t+50),b=!1}else setTimeout((function(){i("".concat(o," .fluentform-step.active")).attr("tabindex","-1").focus().removeAttr("tabindex")}),t),b=!1}function s(){e=!0,setTimeout((function(){e=!1,f(r.find(".fluentform-step.active"),!0)}),t+50)}function l(t,r){if(!e){var f=n(),l=0===f,c=f===a()-1;if(!("prev"===r&&l||"next"===r&&c)){t.preventDefault(),t.stopPropagation();var d="prev"===r?".ff-btn-prev":".ff-btn-next",u=i("".concat(o," .fluentform-step.active")).find(".step-nav ".concat(d));u.length&&(u.click(),s())}}}r.off("keydown.stepNavigation").on("keydown.stepNavigation",(function(t){if(!e&&("Tab"===t.key||9===t.keyCode)){var r=i("".concat(o," .fluentform-step.active")).find("input, select, textarea, button, a").filter(":visible"),f=r.first(),s=r.last(),c=n(),d=0===c,u=c===a()-1;t.shiftKey?document.activeElement===f[0]&&(d||l(t,"prev")):document.activeElement===s[0]&&(u||l(t,"next"))}})),r.on("ff_to_next_page ff_to_prev_page",(function(){s()})),"yes"!=r.find(".ff-step-container").attr("data-disable_auto_focus")&&0!==n()&&!b&&f(i("".concat(o," .fluentform-step.active")),!0),b=!1}var x=function(t,e){var n=t.find(":input").filter((function(t,e){return!i(e).closest(".has-conditions").hasClass("ff_excluded")}));n.filter((function(t,e){var n=i(e);return n.parents().hasClass("ff_repeater_table")&&"select"==n.attr("type")&&!n.val()})).prepend("