­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ (()=>{"use strict";const e=function(e,t){var n=t.find(".jss-ff-el-net-promoter");n.length&&e.each(n,(function(t,n){e(n).on("click","label",(function(t){var n=e(this);n.addClass("active"),n.prevAll().removeClass("active"),n.nextAll().removeClass("active")}))}))};var t=function(e){!function(e){e.on("click",".js-repeat .repeat-plus",(function(e){var t=jQuery(this),n=t.closest(".ff-el-repeat"),a=parseInt(n.data("max_repeat")),i=n.find(".ff-t-cell:first-child .ff-el-input--content > input").length;if(!(a&&a<=i)){a&&a-i==1&&n.find(".repeat-plus").hide();var r=t.closest("div"),o=r.index(),f=t.closest(".ff-el-input--content").find(".ff-t-cell").length;t.closest(".ff-el-input--content").find(".ff-t-cell").each((function(e,t){var n=jQuery(this).find(".ff-el-form-control:last-child"),a=n.attr("tabindex"),i=n.clone(),r={value:"",id:"ffrpt-"+(new Date).getTime()+e};a&&(r.tabIndex=parseInt(a)+f),i.prop(r),i.insertAfter(n)})),r.clone().insertAfter(r),t.closest(".ff-el-input--content").find(".ff-t-cell").eq(0).find("input:eq(".concat(o+1,")")).focus()}})),e.on("click",".js-repeat .repeat-minus",(function(e){var t=!1,n=jQuery(this),a=n.closest("div");n.closest(".ff-el-repeat").find(".repeat-plus").show(),n.closest(".ff-el-input--content").find(".ff-t-cell").each((function(){var e=a.index(),n=jQuery(this).find(".ff-el-form-control:eq("+e+")");a.siblings().length&&(t=n.remove().length)})),t&&a.remove()}))}(e),function(e){var t=window.localStorage.getItem("ff_window_type");jQuery(".ff_form_preview").length&&jQuery(".ff_flexible_table").addClass(t),e.on("screen-change",(function(e,t){jQuery(".ff_form_preview").length&&("375px"===t?jQuery(".ff_flexible_table").addClass("mobile"):jQuery(".ff_flexible_table").removeClass("mobile"))})),e.on("click",".js-repeater .repeat-plus",(function(e){var t=jQuery(this),n=t.closest("table"),a=t.closest("tr"),i=parseInt(n.attr("data-max_repeat")),r=n.find("tbody tr").length;if(i&&r==i)n.addClass("repeat-maxed");else{var o=a.clone();o.find("td").each((function(e,t){var n=jQuery(this).find(".ff-el-form-control:last-child"),a="ffrpt-"+(new Date).getTime()+e,i={value:n.attr("data-default")||"",id:a};n.prop(i);var r=n.attr("data-mask");r&&n.mask(r)})),o.insertAfter(a);var f=n.attr("data-root_name"),l=0;n.find("tbody tr").each((function(e,t){jQuery(this).find(".ff-el-form-control").each((function(t,n){var a=jQuery(n);0==e&&(l=a.attr("tabindex")),a.prop({name:f+"["+e+"][]"}),a.attr("data-name",f+"_"+t+"_"+e),l&&a.attr("tabindex",l)}))})),o.find(".ff-el-form-control")[0].focus(),n.trigger("repeat_change"),i&&r+1==i&&n.addClass("repeat-maxed")}})),e.on("click",".js-repeater .repeat-minus",(function(e){var t=jQuery(this),n=t.closest("table");if(1!=n.find("tbody tr").length){t.closest("tr").remove(),n.removeClass("repeat-maxed");var a=n.attr("data-root_name");n.find("tbody tr").each((function(e,t){jQuery(this).find(".ff-el-form-control").each((function(t,n){jQuery(n).prop({name:a+"["+e+"][]"})}))})),n.trigger("repeat_change")}}))}(e),function(e){e.on("keydown",".repeat-plus",(function(e){"Enter"===e.key&&(e.preventDefault(),jQuery(this).click())})),e.on("keydown",".repeat-minus",(function(e){"Enter"===e.key&&(e.preventDefault(),jQuery(this).click())}))}(e)};function n(){n=function(e,t){return new r(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function r(e,n,i){var o=new RegExp(e,n);return t.set(o,i||t.get(e)),a(o,r.prototype)}function o(e,n){var a=t.get(n);return Object.keys(a).reduce((function(t,n){var i=a[n];if("number"==typeof i)t[n]=e[i];else{for(var r=0;void 0===e[i[r]]&&r+1]+)>/g,(function(e,t){var n=r[t];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof a){var f=this;return e[Symbol.replace].call(this,n,(function(){var e=arguments;return"object"!=i(e[e.length-1])&&(e=[].slice.call(e)).push(o(e,f)),a.apply(this,e)}))}return e[Symbol.replace].call(this,n,a)},n.apply(this,arguments)}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){for(var n=0;n"==e.operator?t&&this.parseFormattedNumericValue(n,t)>this.parseFormattedNumericValue(n,e.value):"<"==e.operator?t&&this.parseFormattedNumericValue(n,t)="==e.operator?t&&this.parseFormattedNumericValue(n,t)>=this.parseFormattedNumericValue(n,e.value):"<="==e.operator?t&&this.parseFormattedNumericValue(n,t)<=this.parseFormattedNumericValue(n,e.value):"startsWith"==e.operator?t&&t.startsWith(e.value):"endsWith"==e.operator?t&&t.endsWith(e.value):"contains"==e.operator?null!==t&&-1!=t.indexOf(e.value):"doNotContains"==e.operator?null!==t&&-1==t.indexOf(e.value):"test_regex"==e.operator&&(t=t||"",this.stringToRegex(e.value).test(t))}},{key:"stringToRegex",value:function(e){var t,a=(null===(t=String(e).match(n(/^\/(.*)\/([gimsuy]*)$/,{body:1,flags:2})))||void 0===t?void 0:t.groups)||{},i=a.body,r=a.flags;return i?(r=r||"g",RegExp(i,r)):new RegExp(e,"g")}},{key:"parseFormattedNumericValue",value:function(e,t){if(e.hasClass("ff_numeric")){var n=JSON.parse(e.attr("data-formatter"));return currency(t,n).value}return Number(t)||0}}])&&r(t.prototype,a),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();const l=function(e,t,n){var a="."+n.form_instance;(function(){var i=this,r={},o={},l=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){for(var a=arguments.length,r=new Array(a),o=0;oe.length)&&(t=e.length);for(var n=0,a=new Array(t);n",{value:t,text:t}))})),n.attr("disabled",!1).val(a[e])}))}))}else jQuery.each(a,(function(e,n){jQuery('[name="'.concat(t,"[").concat(e,']"]')).val(n).change()}))}else if("[object Array]"===i){var l=jQuery("[name=".concat(t,"]"));if("file"==(l=(l=l.length?l:jQuery("[data-name=".concat(t,"]"))).length?l:jQuery("[name=".concat(t,"\\[\\]]"))).attr("type"))x(l,a);else if(l.prop("multiple"))if(e.isFunction(window.Choices)){var s=l.data("choicesjs");o.push({handler:s,values:a})}else l.val(a).change();else if("repeater_field"===l.attr("data-type")){var c=l.find("tbody"),u=l.attr("data-name");jQuery.each(a,(function(t,n){0!=t?c.find("tr:last").clone().appendTo(c).find(".ff-el-form-control").each((function(a,i){var r="ffrpt-"+(new Date).getTime()+a;e(i).val(n[a]),e(i).attr({id:r,name:"".concat(u,"[").concat(t,"][]"),value:n[a]}).change()})):c.find("tr:first .ff-el-form-control").each((function(t,a){e(a).val(n[t]).change()}))}))}else l.each((function(t,n){-1!=jQuery.inArray(e(n).val(),a)&&e(n).prop("checked",!0).change()}))}else{var d=jQuery("[name=".concat(t,"]"));if(d.hasClass("fluentform-post-content")&&window.wp&&window.wp.editor){var p=d.attr("id");window.tinymce.get(p).setContent(a)}if("undefined"!=typeof flatpickr&&d.prop("_flatpickr")){var v=d.prop("_flatpickr");v&&(v.config.altInput?v.setDate(a,!0):d.val(a).trigger("change"))}if("radio"===d.prop("type")||"checkbox"===d.prop("type"))jQuery("[name=".concat(t,'][value="').concat(a,'"]')).prop("checked",!0).change();else{var m=d.closest(".ff-el-group").find(".fluentform-signature-pad");if(m.length){var h=m[0].getContext("2d"),g=new Image;g.src=a,g.onload=function(){h.drawImage(g,0,0)}}d.val(a).change()}}}})),o.length>0)for(var l=0;l2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"next";return new Promise((function(d){e("div"+a+"_errors").empty(),i=n;var p=t.find(".ff-step-body"),v=t.find(".ff-step-titles li"),h=t.find(".fluentform-step"),g=h.length;h.removeClass("active"),e(h[i]).addClass("active"),v.removeClass("ff_active ff_completed"),e.each(u(Array(i).keys()),(function(t){e(e(v[t])).addClass("ff_completed")})),e(v[i]).addClass("ff_active");var y,_={left:-100*i+"%"};switch(l&&(_={right:-100*i+"%"}),e(h[i]).closest(".ff-step-container").data("animation_type")){case"slide":y=p.animate(_,r).promise();break;case"fade":p.css({opacity:0}),y=p.animate(_,r).animate({opacity:1},r).promise();break;case"slide_down":p.hide(),p.css(_),y=p.slideDown(r).promise();break;default:p.css(_),y=Promise.resolve()}y.then((function(){if(f&&function(){if(!window.ff_disable_step_scroll){var n,a,i,o,f,l,s=t.find(".ff_step_start");n=window.ff_scroll_top_offset?window.ff_scroll_top_offset:s.offset().top-20,o=(i=(a=s).offset().top)+a.outerHeight(),l=(f=e(window).scrollTop())+e(window).height(),o>f&&i div").length-1,l=t.find(".fluentform-step.active > .ff_excluded").length;if(t.find(".fluentform-step.active > .ff-t-container").length&&(a-=t.find(".fluentform-step.active > .ff-t-container").length,a+=t.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > div").length,l+=t.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > .ff_excluded").length,t.find(".fluentform-step.active > .ff-t-container.ff_excluded").length&&(l-=t.find(".fluentform-step.active > .ff-t-container.ff_excluded").length,l-=t.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > .ff_excluded").length,l+=t.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > div").length)),a===l)return n.find(".step-nav button[data-action="+c+"], .step-nav img[data-action="+c+"]").click(),void d()}t.find(".fluentform-step.active").find('.step-nav button[data-action="next"]').css("visibility","visible"),t.find(".fluentform-step.active").find('.step-nav button[data-action="prev"]').css("visibility","visible"),t.find(".fluentform-step.active").find('.step-nav img[data-action="next"]').css("visibility","visible"),t.find(".fluentform-step.active").find('.step-nav img[data-action="prev"]').css("visibility","visible"),d()}))}))};function _(e){var t=e.find("input, select, textarea, button").filter(":visible"),n=t.first(),a=t.last();e.on("keydown",(function(e){("Tab"===e.key||9===e.keyCode)&&(e.shiftKey?document.activeElement===n[0]&&(a.focus(),e.preventDefault()):document.activeElement===a[0]&&(n.focus(),e.preventDefault()))}))}var b=function(t,a){var i=t.find(":input").filter((function(t,n){return!e(n).closest(".has-conditions").hasClass("ff_excluded")}));i.filter((function(t,n){var a=e(n);return a.parents().hasClass("ff_repeater_table")&&"select"==a.attr("type")&&!a.val()})).prepend("