­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ (()=>{"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"),i=parseInt(n.data("max_repeat")),a=n.find(".ff-t-cell:first-child .ff-el-input--content > input").length;if(!(i&&i<=a)){i&&i-a==1&&n.find(".repeat-plus").hide();var r=t.closest("div"),o=r.index(),l=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"),i=n.attr("tabindex"),a=n.clone(),r={value:"",id:"ffrpt-"+(new Date).getTime()+e};i&&(r.tabIndex=parseInt(i)+l),a.prop(r),a.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),i=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=i.index(),n=jQuery(this).find(".ff-el-form-control:eq("+e+")");i.siblings().length&&(t=n.remove().length)}),t&&i.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("repeater-container-names-update",function(e,t){var n=t.attr("data-root_name"),i=0;t.find(".ff_repeater_cont_row").each(function(e,t){jQuery(this).find(".ff-el-form-control").each(function(t,a){var r=jQuery(a);0==e&&(i=r.attr("tabindex")),r.prop({name:n+"["+e+"][]"}),r.attr("data-name",n+"_"+t+"_"+e),i&&r.attr("tabindex",i)})})}),e.on("click",".js-repeater .repeat-plus",function(e){var t=jQuery(this),n=t.closest("table"),i=t.closest("tr"),a=parseInt(n.attr("data-max_repeat")),r=n.find("tbody tr").length;if(a&&r==a)n.addClass("repeat-maxed");else{var o=i.clone();o.find("td").each(function(e,t){var n=jQuery(this).find(".ff-el-form-control:last-child"),i="ffrpt-"+(new Date).getTime()+e,a={value:n.attr("data-default")||"",id:i};n.prop(a);var r=n.attr("data-mask");r&&n.mask(r)}),o.insertAfter(i);var l=n.attr("data-root_name"),s=0;n.find("tbody tr").each(function(e,t){jQuery(this).find(".ff-el-form-control").each(function(t,n){var i=jQuery(n);0==e&&(s=i.attr("tabindex")),i.prop({name:l+"["+e+"][]"}),i.attr("data-name",l+"_"+t+"_"+e),s&&i.attr("tabindex",s)})}),o.find(".ff-el-form-control")[0].focus(),n.trigger("repeat_change"),a&&r+1==a&&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 i=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:i+"["+e+"][]"})})}),n.trigger("repeat_change")}}),e.on("click",".js-container-repeat-buttons .repeat-plus",function(t){var n=jQuery(this),i=n.closest(".ff-repeater-container"),a=n.closest(".ff_repeater_cont_row"),r=parseInt(i.attr("data-max_repeat")),o=i.find(".ff_repeater_cont_row").length;if(r&&o==r)i.addClass("repeat-maxed");else{var l=a.clone();l.find(".ff_repeater_cell").each(function(e,t){var n=jQuery(this).find(".ff-el-form-control:last-child"),i="ffrpt-"+(new Date).getTime()+e,a={value:n.attr("data-default")||"",id:i};n.prop(a);var r=n.attr("data-mask");r&&n.mask(r),jQuery(this).find("label").attr("for",i)}),l.insertAfter(a),e.trigger("repeater-container-names-update",[i]),l.find(".ff-el-form-control")[0].focus(),i.trigger("repeat_change"),r&&o+1==r&&i.addClass("repeat-maxed")}}),e.on("click",".js-container-repeat-buttons .repeat-minus",function(t){var n=jQuery(this),i=n.closest(".ff-repeater-container"),a=n.closest(".ff_repeater_cont_row");i.find(".ff_repeater_cont_row").length>1&&(a.remove(),i.removeClass("repeat-maxed"),e.trigger("repeater-container-names-update",[i]),i.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,a){var o=RegExp(e,n);return t.set(o,a||t.get(e)),i(o,r.prototype)}function o(e,n){var i=t.get(n);return Object.keys(i).reduce(function(t,n){var a=i[n];if("number"==typeof a)t[n]=e[a];else{for(var r=0;void 0===e[a[r]]&&r+1]+)(>|$)/g,function(e,t,n){if(""===n)return e;var i=r[t];return Array.isArray(i)?"$"+i.join("$"):"number"==typeof i?"$"+i:""}))}if("function"==typeof i){var l=this;return e[Symbol.replace].call(this,n,function(){var e=arguments;return"object"!=a(e[e.length-1])&&(e=[].slice.call(e)).push(o(e,l)),i.apply(this,e)})}return e[Symbol.replace].call(this,n,i)},n.apply(this,arguments)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){return a="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},a(e)}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,r=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw r}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);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,i=(null===(t=String(e).match(n(/^\/(.*)\/([gimsuy]*)$/,{body:1,flags:2})))||void 0===t?void 0:t.groups)||{},a=i.body,r=i.flags;return a?(r=r||"g",RegExp(a,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}}])&&l(e.prototype,t),i&&l(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}();const c=function(e,t,n){var i="."+n.form_instance;(function(){var a=this,r={},o={},l=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){for(var i=arguments.length,r=new Array(i),o=0;o0&&(i&&clearTimeout(i),i=setTimeout(function(){t.trigger("reInitRangeSliders")},50))})):a.removeClass("ff_cond_v").addClass("ff_excluded").slideUp(200)}),t.trigger("do_calculation"),t.trigger("ff_render_dynamic_smartcodes",t)},c=function(){var n={};return e.each(r,function(i,a){var r=a.prop("type")||a.attr("data-type");if("radio"==r)n[i]="",a.each(function(t,a){e(a).is(":checked")&&(n[i]=e(a).val())});else if("checkbox"==r)i=i.replace("[]",""),n[i]=[],a.each(function(t,a){e(a).is(":checked")&&n[i].push(e(a).val())});else if("select-multiple"==r){i=i.replace("[]","");var o=a.val();n[i]=o||[]}else if("file"==r){var l="";t.find("input[name="+i+"]").closest(".ff-el-input--content").find(".ff-uploaded-list").find(".ff-upload-preview[data-src]").each(function(t,n){l+=e(this).data("src")}),n[i]=l}else n[i]=a.val()}),n},u=function(t){var n=e(i),a=e("[data-name='"+t+"']",n);return(a=(a=a.length?a:e("[name='"+t+"']",n)).length?a:e("[data-condition_field_name='"+t+"']",n)).length?a:e("[name='"+t+"[]']",n)};return{init:function(){if(n.conditionals){e.each(n.conditionals,function(t,n){t&&("group"==n.type&&n.condition_groups?e.each(n.condition_groups,function(t,n){e.each(n.rules,function(e,t){var n=u(t.field);r[n.prop("name")]=n})}):e.each(n.conditions,function(e,t){var n=u(t.field);r[n.prop("name")]=n}))}),o=c();var i=new f(n.conditionals,o);e.each(r,function(e,n){n.on("keyup change",function(){t.hasClass("ff_force_hide")||t.hasClass("ff_submitting")||(o=c(),i.setFormData(o),setTimeout(function(){l(i.getCalculatedStatuses())},0))})}),jQuery(document.body).on("fluentform_reset",function(e,n){n&&n.length&&n[0]===t[0]&&!t.hasClass("ff_force_hide")&&setTimeout(function(){o=c(),i.setFormData(o),s(i.getCalculatedStatuses())},0)}),setTimeout(function(){s(i.getCalculatedStatuses())},0)}}}})().init()};function u(e){return u="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},u(e)}function d(e){return d="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},d(e)}function p(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e)||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 m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n",{value:t,text:t}))}),i.attr("disabled",!1).val(n[e])})})}else a.each(n,function(n,i){t.$theForm.find('[name="'.concat(e,"[").concat(n,']"]')).val(i).change()})}else if("[object Array]"===i){var s=t.$theForm.find("[name=".concat(e,"]"));if("file"===(s=(s=s.length?s:t.$theForm.find("[data-name=".concat(e,"]"))).length?s:t.$theForm.find("[name=".concat(e,"\\[\\]]"))).attr("type"))t.addFilesToElement(s,n);else if(s.prop("multiple"))if(a.isFunction(window.Choices)){var f=s.data("choicesjs");f&&r.push({handler:f,values:n})}else s.val(n).change();else if("repeater_field"===s.attr("data-type")){var c=s.find("tbody"),u=s.attr("data-name");a.each(n,function(e,t){0!=e?c.find("tr:last").clone().appendTo(c).find(".ff-el-form-control").each(function(n,i){var r="ffrpt-"+(new Date).getTime()+n;a(i).val(t[n]),a(i).attr({id:r,name:"".concat(u,"[").concat(e,"][]"),value:t[n]}).change()}):c.find("tr:first .ff-el-form-control").each(function(e,n){a(n).val(t[e]).change()})})}else"repeater_container"===s.attr("data-type")?(a.each(n,function(e,t){if(0!==e){var n=s.find(".ff_repeater_cont_row:first").clone();n.find(".ff_repeater_cell").each(function(n,i){var r=a(this).find(".ff-el-form-control:last-child"),o="ffrpt-"+(new Date).getTime()+"_"+e+"_"+n,l={value:t[n]||"",id:o};r.prop(l),a(this).find("label").attr("for",o)}),n.insertAfter(s.find(".ff_repeater_cont_row:last"))}else s.find(".ff_repeater_cont_row:first .ff-el-form-control").each(function(e,n){a(n).val(t[e]).change()})}),t.$theForm.trigger("repeater-container-names-update",[s]),s.trigger("repeat_change")):s.each(function(e,t){-1!==a.inArray(a(t).val(),n)&&a(t).prop("checked",!0).change()})}else{var d=t.$theForm.find("[name=".concat(e,"]"));if(d.hasClass("fluentform-post-content")&&window.wp&&window.wp.editor){var p=d.attr("id");window.tinymce.get(p).setContent(n)}if("undefined"!=typeof flatpickr&&d.prop("_flatpickr")){var m=d.prop("_flatpickr");m&&(m.config.altInput?m.setDate(n,!0):d.val(n).trigger("change"))}if("radio"===d.prop("type")||"checkbox"===d.prop("type"))a("[name=".concat(e,'][value="').concat(n,'"]')).prop("checked",!0).change(),t.$theForm.find("[name=".concat(e,'][value="').concat(n,'"]')).prop("checked",!0).change(),d.closest(".ff-el-group").find(".ff-el-ratings").length&&t.$theForm.find("[name=".concat(e,'][value="').concat(n,'"]')).closest("label").trigger("mouseenter");else{d.hasClass("ff_has_multi_select")&&d.data("choicesjs")&&(d.data("choicesjs").removeActiveItems(n),d.data("choicesjs").setChoiceByValue(n));var h=d.closest(".ff-el-group").find(".fluentform-signature-pad");if(h.length){var v=h[0].getContext("2d"),g=new Image;g.src=n,g.onload=function(){v.drawImage(g,0,0)}}d.val(n).change()}}}}),r.length>0)for(var o=0;o0?i.css({transition:"width ".concat(n,"ms ease-in-out")}):i.css({transition:"none"}),i[0]&&i[0].offsetHeight,i.css("width",a+"%"),new Promise(function(e){var t=!1,a=setTimeout(function(){t||(t=!0,e())},(n||0)+120);i.one("transitionend webkitTransitionEnd oTransitionEnd",function(){t||(t=!0,clearTimeout(a),e())})})}},{key:"registerStepNavigators",value:function(e){var t=this.$,n=this;this.handleFocus(e),t(this.formSelector).on("click",".fluentform-step .step-nav button, .fluentform-step .step-nav img",function(i){var a=t(this).data("action"),r="next",o=t(this).closest(".fluentform-step"),l=n.getFormInstance();if("next"===a){try{var s=o.find(":input").not(":button").filter(function(e,n){return!t(n).closest(".has-conditions").hasClass("ff_excluded")});s.length&&l.validate(s),n.activeStep++}catch(i){if(!(i instanceof window.ffValidationError))throw i;return l.showErrorMessages(i.messages),void l.scrollToFirstError(350)}n.$theForm.trigger("ff_to_next_page",n.activeStep),t(document).trigger("ff_to_next_page",{step:n.activeStep,form:n.$theForm});var f=n.$theForm.find(".fluentform-step");n.$theForm.trigger("ff_render_dynamic_smartcodes",t(f[n.activeStep]))}else n.activeStep--,r="prev",n.$theForm.trigger("ff_to_prev_page",n.activeStep),t(document).trigger("ff_to_prev_page",{step:n.activeStep,form:n.$theForm});var c="yes"!=n.$theForm.find(".ff-step-container").attr("data-disable_auto_focus");n.updateSlider(n.activeStep,e,c,r).then(function(){n.handleFocus(e)}).catch(function(e){console.error("An error occurred during the slider update:",e)})})}},{key:"updateSlider",value:function(e,t){var n=this,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"next",r=this.$,o=this;return new Promise(function(l){r("div"+n.formSelector+"_errors").empty(),n.activeStep=e;var s=n.$theForm.find(".ff-step-titles li"),f=n.$theForm.find(".fluentform-step"),c=f.length;if(!window.ff_disable_auto_step&&c){var u=o.$theForm.find(".fluentform-step").index(o.$theForm.find(".fluentform-step.active"));if("prev"===a||u>-1&&n.activeStep0&&n.isStepAllFieldsHidden(r(f[n.activeStep]));)n.activeStep--;else for(;n.activeStep0?50:ta&&n div").length-1,u=o.$theForm.find(".fluentform-step.active > .ff_excluded").length;if(o.$theForm.find(".fluentform-step.active > .ff-t-container").length&&(s-=o.$theForm.find(".fluentform-step.active > .ff-t-container").length,s+=o.$theForm.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > div").length,u+=o.$theForm.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > .ff_excluded").length,o.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded").length&&(u-=o.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded").length,u-=o.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > .ff_excluded").length,u+=o.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > div").length)),s===u){var d="prev"===a?o.activeStep-1:o.activeStep+1;if(d>=0&&d1&&void 0!==arguments[1]&&arguments[1],r="yes"!=n.$theForm.find(".ff-step-container").attr("data-disable_auto_focus");if(!n.isInitialLoad)if(r){var o=i.find("input, .ff-custom_html, select, textarea, button, a").filter(":visible");o.length&&a&&setTimeout(function(){o.first().focus()},e+50),n.isInitialLoad=!1}else{var l;!(null===(l=window.fluentFormVars)||void 0===l||!l.step_change_focus)&&setTimeout(function(){t("".concat(n.formSelector," .fluentform-step.active")).attr("tabindex","-1").focus().removeAttr("tabindex")},e),n.isInitialLoad=!1}};n.$theForm.off("keydown.stepNavigation").on("keydown.stepNavigation",function(e){if(!i&&(" "===e.key||32===e.keyCode)){var a=t("".concat(n.formSelector," .fluentform-step.active .ff-btn-next")),r=t("".concat(n.formSelector," .fluentform-step.active .ff-btn-prev"));return document.activeElement===a[0]?(e.preventDefault(),void a.click()):document.activeElement===r[0]?(e.preventDefault(),void r.click()):void 0}}),this.$theForm.on("ff_to_next_page ff_to_prev_page",function(){i=!0,setTimeout(function(){i=!1,a(n.$theForm.find(".fluentform-step.active"),!0)},e+50)}),"yes"!==this.$theForm.find(".ff-step-container").attr("data-disable_auto_focus")&&0!==n.$theForm.find(".fluentform-step").index(n.$theForm.find(".fluentform-step.active"))&&!this.isInitialLoad&&a(t("".concat(this.formSelector," .fluentform-step.active")),!0),this.isInitialLoad=!1}},{key:"saveStepData",value:function(e,t){var n=this.$,i=e.find(":input").filter(function(e,t){return!n(t).closest(".has-conditions").hasClass("ff_excluded")});i.filter(function(e,t){var i=n(t);return i.parents().hasClass("ff_repeater_table")&&"select"==i.attr("type")&&!i.val()}).prepend("