/*! For license information please see fluentform-advanced.js.LICENSE.txt */
(()=>{"use strict";var e={75251:(e,t,n)=>{var r=n(67294),a=Symbol.for("react.element"),i=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,f=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,n){var r,i={},s=null,c=null;for(r in void 0!==n&&(s=""+n),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:a,type:e,key:s,ref:c,props:i,_owner:f.current}}t.jsx=s},72408:(e,t)=>{var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,h={};function y(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||v}function g(){}function _(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||v}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=y.prototype;var b=_.prototype=new g;b.constructor=_,m(b,y.prototype),b.isPureReactComponent=!0;var x=Array.isArray,w=Object.prototype.hasOwnProperty,j={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function S(e,t,r){var a,i={},o=null,f=null;if(null!=t)for(a in void 0!==t.ref&&(f=t.ref),void 0!==t.key&&(o=""+t.key),t)w.call(t,a)&&!k.hasOwnProperty(a)&&(i[a]=t[a]);var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){for(var s=Array(l),c=0;c<l;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(a in l=e.defaultProps)void 0===i[a]&&(i[a]=l[a]);return{$$typeof:n,type:e,key:o,ref:f,props:i,_owner:j.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var E=/\/+/g;function O(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function A(e,t,a,i,o){var f=typeof e;"undefined"!==f&&"boolean"!==f||(e=null);var l=!1;if(null===e)l=!0;else switch(f){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0}}if(l)return o=o(l=e),e=""===i?"."+O(l,0):i,x(o)?(a="",null!=e&&(a=e.replace(E,"$&/")+"/"),A(o,t,a,"",(function(e){return e}))):null!=o&&(C(o)&&(o=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,a+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(E,"$&/")+"/")+e)),t.push(o)),1;if(l=0,i=""===i?".":i+":",x(e))for(var s=0;s<e.length;s++){var c=i+O(f=e[s],s);l+=A(f,t,a,c,o)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof c)for(e=c.call(e),s=0;!(f=e.next()).done;)l+=A(f=f.value,t,a,c=i+O(f,s++),o);else if("object"===f)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Q(e,t,n){if(null==e)return e;var r=[],a=0;return A(e,r,"","",(function(e){return t.call(n,e,a++)})),r}function R(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var T={current:null},F={transition:null},N={ReactCurrentDispatcher:T,ReactCurrentBatchConfig:F,ReactCurrentOwner:j};t.Children={map:Q,forEach:function(e,t,n){Q(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return Q(e,(function(){t++})),t},toArray:function(e){return Q(e,(function(e){return e}))||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=a,t.Profiler=o,t.PureComponent=_,t.StrictMode=i,t.Suspense=c,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a=m({},e.props),i=e.key,o=e.ref,f=e._owner;if(null!=t){if(void 0!==t.ref&&(o=t.ref,f=j.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(s in t)w.call(t,s)&&!k.hasOwnProperty(s)&&(a[s]=void 0===t[s]&&void 0!==l?l[s]:t[s])}var s=arguments.length-2;if(1===s)a.children=r;else if(1<s){l=Array(s);for(var c=0;c<s;c++)l[c]=arguments[c+2];a.children=l}return{$$typeof:n,type:e.type,key:i,ref:o,props:a,_owner:f}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:f,_context:e},e.Consumer=e},t.createElement=S,t.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:R}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=F.transition;F.transition={};try{e()}finally{F.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return T.current.useCallback(e,t)},t.useContext=function(e){return T.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return T.current.useDeferredValue(e)},t.useEffect=function(e,t){return T.current.useEffect(e,t)},t.useId=function(){return T.current.useId()},t.useImperativeHandle=function(e,t,n){return T.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return T.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return T.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return T.current.useMemo(e,t)},t.useReducer=function(e,t,n){return T.current.useReducer(e,t,n)},t.useRef=function(e){return T.current.useRef(e)},t.useState=function(e){return T.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return T.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return T.current.useTransition()},t.version="18.2.0"},67294:(e,t,n)=>{e.exports=n(72408)},48521:(e,t,n)=>{e.exports=n(75251)}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}(()=>{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"),r=parseInt(n.data("max_repeat")),a=n.find(".ff-t-cell:first-child .ff-el-input--content > input").length;if(!(r&&r<=a)){r&&r-a==1&&n.find(".repeat-plus").hide();var i=t.closest("div"),o=i.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"),r=n.attr("tabindex"),a=n.clone(),i={value:"",id:"ffrpt-"+(new Date).getTime()+e};r&&(i.tabIndex=parseInt(r)+f),a.prop(i),a.insertAfter(n)})),i.clone().insertAfter(i),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),r=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=r.index(),n=jQuery(this).find(".ff-el-form-control:eq("+e+")");r.siblings().length&&(t=n.remove().length)})),t&&r.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"),r=t.closest("tr"),a=parseInt(n.attr("data-max_repeat")),i=n.find("tbody tr").length;if(a&&i==a)n.addClass("repeat-maxed");else{var o=r.clone();o.find("td").each((function(e,t){var n=jQuery(this).find(".ff-el-form-control:last-child"),r="ffrpt-"+(new Date).getTime()+e,a={value:n.attr("data-default")||"",id:r};n.prop(a);var i=n.attr("data-mask");i&&n.mask(i)})),o.insertAfter(r);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 r=jQuery(n);0==e&&(l=r.attr("tabindex")),r.prop({name:f+"["+e+"][]"}),r.attr("data-name",f+"_"+t+"_"+e),l&&r.attr("tabindex",l)}))})),o.find(".ff-el-form-control")[0].focus(),n.trigger("repeat_change"),a&&i+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 r=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:r+"["+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 r(){r=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,i){var o=new RegExp(e,r);return t.set(o,i||t.get(e)),a(o,n.prototype)}function o(e,n){var r=t.get(n);return Object.keys(r).reduce((function(t,n){var a=r[n];if("number"==typeof a)t[n]=e[a];else{for(var i=0;void 0===e[a[i]]&&i+1<a.length;)i++;t[n]=e[a[i]]}return t}),Object.create(null))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=o(n,this);var r=n.indices;r&&(r.groups=o(r,this))}return n},n.prototype[Symbol.replace]=function(n,r){if("string"==typeof r){var a=t.get(this);return e[Symbol.replace].call(this,n,r.replace(/\$<([^>]+)>/g,(function(e,t){var n=a[t];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof r){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)),r.apply(this,e)}))}return e[Symbol.replace].call(this,n,r)},r.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 o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:String(t)}const l=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fields=t,this.formData=n,this.counter=0,this.field_statues={}}var t,n,a;return t=e,(n=[{key:"setFields",value:function(e){this.fields=e}},{key:"setFormData",value:function(e){this.formData=e}},{key:"getCalculatedStatuses",value:function(){for(var e=0,t=Object.keys(this.fields);e<t.length;e++){var n=t[e],r=this.fields[n];this.field_statues[n]=this.evaluate(r,n)}return this.field_statues}},{key:"evaluate",value:function(e,t){var n=this,r=!1;if(e.status){this.counter++;var a=e.type,i=1;"any"==a&&(i=0),e.conditions.forEach((function(e){var r=n.getItemEvaluateValue(e,n.formData[e.field]);r&&n.fields[e.field]&&e.field!=t&&(r=n.evaluate(n.fields[e.field],e.field)),"any"==a?r&&(i=1):!r&&i&&(i=!1)})),r=1==i}return e.status&&e.conditions.length&&!r||e.container_condition&&(r=this.evaluate(e.container_condition)),r}},{key:"getItemEvaluateValue",value:function(e,t){t=t||null;var n=jQuery("[name='".concat(e.field,"']"));return"="==e.operator?""===e.value?null===t:"object"==i(t)?null!==t&&-1!=t.indexOf(e.value):n.hasClass("ff_numeric")?this.parseFormattedNumericValue(n,t)==this.parseFormattedNumericValue(n,e.value):t==e.value:"!="==e.operator?"object"==i(t)?null!==t&&-1==t.indexOf(e.value):n.hasClass("ff_numeric")?this.parseFormattedNumericValue(n,t)!=this.parseFormattedNumericValue(n,e.value):t!=e.value:">"==e.operator?t&&this.parseFormattedNumericValue(n,t)>this.parseFormattedNumericValue(n,e.value):"<"==e.operator?t&&this.parseFormattedNumericValue(n,t)<this.parseFormattedNumericValue(n,e.value):">="==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,n=(null===(t=String(e).match(r(/^\/(.*)\/([gimsuy]*)$/,{body:1,flags:2})))||void 0===t?void 0:t.groups)||{},a=n.body,i=n.flags;return a?(i=i||"g",RegExp(a,i)):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}}])&&o(t.prototype,n),a&&o(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}();const s=function(e,t,n){var r="."+n.form_instance;(function(){var a=this,i={},o={},f=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];clearTimeout(t),t=setTimeout((function(){return e.apply(a,i)}),n)}}((function(e){s(e)}),n.debounce_time||300),s=function(n){e.each(n,(function(e,t){var n=u(e).closest(".has-conditions");t?("0px"==n.css("height")&&n.attr("style",""),n.removeClass("ff_excluded").addClass("ff_cond_v").slideDown(200)):n.removeClass("ff_cond_v").addClass("ff_excluded").slideUp(200)})),t.trigger("do_calculation")},c=function(){var n={};return e.each(i,(function(r,a){var i=a.prop("type")||a.attr("data-type");if("radio"==i)n[r]="",a.each((function(t,a){e(a).is(":checked")&&(n[r]=e(a).val())}));else if("checkbox"==i)r=r.replace("[]",""),n[r]=[],a.each((function(t,a){e(a).is(":checked")&&n[r].push(e(a).val())}));else if("select-multiple"==i){r=r.replace("[]","");var o=a.val();n[r]=o||[]}else if("file"==i){var f="";t.find("input[name="+r+"]").closest(".ff-el-input--content").find(".ff-uploaded-list").find(".ff-upload-preview[data-src]").each((function(t,n){f+=e(this).data("src")})),n[r]=f}else n[r]=a.val()})),n},u=function(t){var n=e(r),a=e("[data-name='"+t+"']",n);return(a=a.length?a:e("[name='"+t+"']",n)).length?a:e("[name='"+t+"[]']",n)};return{init:function(){if(n.conditionals){e.each(n.conditionals,(function(t,n){t&&e.each(n.conditions,(function(e,t){var n=u(t.field);i[n.prop("name")]=n}))})),o=c();var t=new l(n.conditionals,o);e.each(i,(function(e,n){n.on("keyup change",(function(){o=c(),t.setFormData(o),f(t.getCalculatedStatuses())}))})),s(t.getCalculatedStatuses())}}}})().init()};function c(e){return c="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},c(e)}var u=n(48521);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 v(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)return;if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}(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 v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t,n,r){var a=0,i="";n.stepAnimationDuration=parseInt(n.stepAnimationDuration);var o="yes"==t.find(".ff-step-container").attr("data-enable_step_data_persistency"),f=!1;o&&(f="yes"==t.find(".ff-step-container").attr("data-enable_step_page_resume"));var l=!!window.fluentFormVars.is_rtl,s=!1,c=function(){return window.fluentFormApp(t)},v=function(t){var a=t.response,i=t.step_completed,o=[];if(jQuery.each(a,(function(t,r){if(r){var a=Object.prototype.toString.call(r);if("[object Object]"===a){var i=jQuery("[data-name=".concat(t,"]"));if(i.length&&"tabular-element"===i.attr("data-type"))jQuery.each(r,(function(n,r){var a=jQuery('[name="'.concat(t,"[").concat(n,']\\[\\]"]'));a.length||(a=jQuery('[name="'.concat(t,"[").concat(n,']"]'))),jQuery.each(a,(function(t,n){var a=e(n).val();-1===jQuery.inArray(a,r)&&a!==r||e(n).prop("checked",!0).change()}))}));else if("chained-select"===i.attr("data-type")){var f={meta_key:i.find("select:first").attr("data-meta_key"),form_id:i.closest("form").attr("data-form_id"),action:"fluentform_get_chained_select_options",filter_options:"all",keys:r};jQuery.getJSON(n.ajaxUrl,f).then((function(e){jQuery.each(e,(function(e,t){var n=i.find("select[data-key='".concat(e,"']"));0!=n.attr("data-index")&&jQuery.each(t,(function(e,t){n.append(jQuery("<option />",{value:t,text:t}))})),n.attr("disabled",!1).val(r[e])}))}))}else jQuery.each(r,(function(e,n){jQuery('[name="'.concat(t,"[").concat(e,']"]')).val(n).change()}))}else if("[object Array]"===a){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"))w(l,r);else if(l.prop("multiple"))if(e.isFunction(window.Choices)){var s=l.data("choicesjs");o.push({handler:s,values:r})}else l.val(r).change();else if("repeater_field"===l.attr("data-type")){var c=l.find("tbody"),u=l.attr("data-name");jQuery.each(r,(function(t,n){0!=t?c.find("tr:last").clone().appendTo(c).find(".ff-el-form-control").each((function(r,a){var i="ffrpt-"+(new Date).getTime()+r;e(a).val(n[r]),e(a).attr({id:i,name:"".concat(u,"[").concat(t,"][]"),value:n[r]}).change()})):c.find("tr:first .ff-el-form-control").each((function(t,r){e(r).val(n[t]).change()}))}))}else l.each((function(t,n){-1!=jQuery.inArray(e(n).val(),r)&&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(r)}if("radio"===d.prop("type")||"checkbox"===d.prop("type"))jQuery("[name=".concat(t,'][value="').concat(r,'"]')).prop("checked",!0).change();else{var v=d.closest(".ff-el-group").find(".fluentform-signature-pad");if(v.length){var m=v[0].getContext("2d"),h=new Image;h.src=r,h.onload=function(){m.drawImage(h,0,0)}}d.val(r).change()}}}})),o.length>0)for(var l=0;l<o.length;l++)o[l].handler.setValue(o[l].values).change();s=!0,f&&_(i,n.stepAnimationDuration,!0).then((function(){b(e("".concat(r," .fluentform-step.active"))),g(n.stepAnimationDuration)})).catch((function(e){console.error("An error occurred during the slider update:",e)})),s=!1},m=function(t,a){0!==t.length&&(e.each(t,(function(t,n){e(n).attr("data-step-number",t)})),t.on("click",(function(t){var i=c(),o=e(this),f=0;try{var l=o.data("step-number");if(isNaN(l))return;e.each(a,(function(t,n){if(f=t,t<l){var r=e(n).find(":input").not(":button").filter((function(t,n){return!e(n).closest(".has-conditions").hasClass("ff_excluded")}));r.length&&i.validate(r)}})),_(l,n.stepAnimationDuration,!0).then((function(){b(e("".concat(r," .fluentform-step.active"))),g(n.stepAnimationDuration)})).catch((function(e){console.error("An error occurred during the slider update:",e)}))}catch(t){if(!(t instanceof window.ffValidationError))throw t;_(f,n.stepAnimationDuration,!0).then((function(){b(e("".concat(r," .fluentform-step.active"))),g(n.stepAnimationDuration)})).catch((function(e){console.error("An error occurred during the slider update:",e)})),i.showErrorMessages(t.messages),i.scrollToFirstError(350)}})))},h=function(r){if(t.find(".ff-el-progress").length){var a=r.totalSteps,i=r.activeStep,o=100/a*(i+1),f=t.find(".ff-el-progress-title li"),l=t.find(".ff-step-header .ff-el-progress-bar"),s=l.find("span");l.css({width:o+"%"}),o?l.append(s.text(parseInt(o)+"%")):s.empty();var c=n.step_text,u=e(f[i]).text();c=c.replace("%activeStep%",i+1).replace("%totalStep%",a).replace("%stepTitle%",u),t.find(".ff-el-progress-status").html(c),f.css("display","none"),e(f[i]).css("display","inline")}},y=function(n){b(e("".concat(r," .fluentform-step.active"))),e(r).on("click",".fluentform-step  .step-nav button, .fluentform-step  .step-nav img",(function(i){var o=e(this).data("action"),f="next",l=e(this).closest(".fluentform-step"),s=c();if("next"==o){try{var u=l.find(":input").not(":button").filter((function(t,n){return!e(n).closest(".has-conditions").hasClass("ff_excluded")}));u.length&&s.validate(u),a++}catch(i){if(!(i instanceof window.ffValidationError))throw i;return s.showErrorMessages(i.messages),void s.scrollToFirstError(350)}t.trigger("ff_to_next_page",a),jQuery(document).trigger("ff_to_next_page",{step:a,form:t});var d=t.find(".fluentform-step");t.trigger("ff_render_dynamic_smartcodes",e(d[a]))}else a--,f="prev",t.trigger("ff_to_prev_page",a),jQuery(document).trigger("ff_to_prev_page",{step:a,form:t});var p="yes"!=t.find(".ff-step-container").attr("data-disable_auto_focus");_(a,n,p,f).then((function(){b(e("".concat(r," .fluentform-step.active"))),g(n)})).catch((function(e){console.error("An error occurred during the slider update:",e)}))}))};function g(n){setTimeout((function(){var n=function(){var n=e("".concat(r," .fluentform-step.active")),a=null;return a=t.find(".fluentform-step").last().hasClass("active")&&n.children().not(".ff-inner_submit_container").toArray().every((function(t){return e(t).hasClass("ff_excluded")}))?n.find('button[type="submit"]').first():n.find("input, select, textarea").first(),a}();n&&n.length&&n.focus()}),n)}var _=function(n,i){var f=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"next";return new Promise((function(u){e("div"+r+"_errors").empty(),a=n;var d=t.find(".ff-step-body"),v=t.find(".ff-step-titles li"),m=t.find(".fluentform-step"),y=m.length;m.removeClass("active"),e(m[a]).addClass("active"),v.removeClass("ff_active ff_completed"),e.each(p(Array(a).keys()),(function(t){e(e(v[t])).addClass("ff_completed")})),e(v[a]).addClass("ff_active");var g,_={left:-100*a+"%"};switch(l&&(_={right:-100*a+"%"}),e(m[a]).closest(".ff-step-container").data("animation_type")){case"slide":g=d.animate(_,i).promise();break;case"fade":d.css({opacity:0}),g=d.animate(_,i).animate({opacity:1},i).promise();break;case"slide_down":d.hide(),d.css(_),g=d.slideDown(i).promise();break;default:d.css(_),g=Promise.resolve()}g.then((function(){if(f&&function(){if(!window.ff_disable_step_scroll){var n,r,a,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=(a=(r=s).offset().top)+r.outerHeight(),l=(f=e(window).scrollTop())+e(window).height(),o>f&&a<l&&!window.ff_force_scroll||e("html, body").delay(i).animate({scrollTop:n},0)}}(),!o||s||0===a||x(t,a).then((function(e){console.log(e)})),h({activeStep:a,totalSteps:y}),m.last().hasClass("active")?t.find('button[type="submit"]').css("visibility","visible"):t.find('button[type="submit"]').css("visibility","hidden"),!window.ff_disable_auto_step){var n=t.find(".fluentform-step.active"),r=t.find(".fluentform-step.active > div").length-1,l=t.find(".fluentform-step.active > .ff_excluded").length;if(t.find(".fluentform-step.active > .ff-t-container").length&&(r-=t.find(".fluentform-step.active > .ff-t-container").length,r+=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)),r===l)return n.find(".step-nav button[data-action="+c+"], .step-nav img[data-action="+c+"]").click(),void u()}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"),u()}))}))};function b(e){var t=e.find("input, select, textarea, button").filter(":visible"),n=t.first(),r=t.last();e.on("keydown",(function(e){("Tab"===e.key||9===e.keyCode)&&(e.shiftKey?document.activeElement===n[0]&&(r.focus(),e.preventDefault()):document.activeElement===r[0]&&(n.focus(),e.preventDefault()))}))}var x=function(t,r){var a=t.find(":input").filter((function(t,n){return!e(n).closest(".has-conditions").hasClass("ff_excluded")}));a.filter((function(t,n){var r=e(n);return r.parents().hasClass("ff_repeater_table")&&"select"==r.attr("type")&&!r.val()})).prepend("<option selected disabled />");var i=a.serialize();e.each(t.find("[type=file]"),(function(t,n){var r={},a=n.name+"[]";r[a]=[],e(n).closest("div").find(".ff-uploaded-list").find(".ff-upload-preview[data-src]").each((function(t,n){r[a][t]=e(this).data("src")})),e.each(r,(function(t,n){if(n.length){var r={};r[t]=n,i+="&"+e.param(r),!0}}))}));var o={active_step:r,data:i,form_id:t.data("form_id"),action:"fluentform_step_form_save_data"};return jQuery.post(n.ajaxUrl,o)},w=function(t,r){var a=t.closest(".ff-el-input--content").find(".ff-uploaded-list");e.each(r,(function(t,r){r="object"===d(r)?r:{url:r,data_src:r};var i=e("<div/>",{class:"ff-upload-preview","data-src":r.data_src,style:"border: 1px solid rgb(111, 117, 125)"}),o=e("<div/>",{class:"ff-upload-thumb"});o.append(e("<div/>",{class:"ff-upload-preview-img",style:"background-image: url('".concat(j(r.url),"');")}));var f=e("<div/>",{class:"ff-upload-details"}),l=e("<span/>",{html:n.upload_completed_txt,class:"ff-upload-progress-inline-text ff-inline-block"}),s=r.url.substring(r.url.lastIndexOf("/")+1);s.includes("-ff-")&&(s=s.substring(s.lastIndexOf("-ff-")+4));var c=e("<div/>",{class:"ff-upload-filename",html:s}),p=e((0,u.jsx)("div",{class:"ff-upload-progress-inline ff-el-progress",children:(0,u.jsx)("div",{style:"width: 100%;",class:"ff-el-progress-bar"})})),v=e("<span/>",{"data-href":"#",html:"&times;",class:"ff-upload-remove"}),m=e("<div>",{class:"ff-upload-filesize ff-inline-block",html:""}),h=e("<div>",{class:"ff-upload-error",style:"color:red;"});f.append(c,p,l,m,h,v),i.append(o,f),a.append(i)})),t.trigger("change_remaining",-r.length),t.trigger("change")},j=function(e){var t=e.split(/[#?]/)[0].split(".").pop().trim().toLowerCase();if(-1!=["jpg","jpeg","gif","png"].indexOf(t))return e;var n=document.createElement("canvas");n.width=60,n.height=60,n.style.zIndex=8,n.style.position="absolute",n.style.border="1px solid";var r=n.getContext("2d");return r.fillStyle="rgba(0, 0, 0, 0.2)",r.fillRect(0,0,60,60),r.font="13px Arial",r.fillStyle="white",r.textAlign="center",r.fillText(t,30,30,60),n.toDataURL()};return{init:function(){o&&jQuery(document).ready((function(e){jQuery.getJSON(n.ajaxUrl,{form_id:t.data("form_id"),action:"fluentform_step_form_get_data"}).then((function(e){e&&v(e)}))})),t.find(".fluentform-step:first").find('.step-nav [data-action="prev"]').remove(),function(){var r=t.find(".ff-step-body"),o=t.find(".fluentform-step"),f=o.length,l=t.find(".ff-step-titles li");i=100*f+"%",r.css({width:i}),o.css({width:100/f+"%"}),e(o[a]).addClass("active"),e(l[a]).addClass("active");var s=o.first();s.hasClass("active")&&s.find('button[data-action="next"]').css("visibility","visible"),o.length&&!o.last().hasClass("active")&&t.find('button[type="submit"]').css("visibility","hidden"),h({activeStep:a,totalSteps:f}),y(n.stepAnimationDuration),m(l,o)}(),function(){function n(e){if(1==e.closest(".fluentform-step.active").find(".ff-el-group:not(.ff_excluded):not(.ff-custom_html)").length)if(e.closest(".fluentform-step.active").find(".ff_excluded").length){var t=window.ffTransitionTimeOut||400;setTimeout((function(){e.closest(".fluentform-step.active").find(".ff-btn-next").trigger("click")}),t)}else e.closest(".fluentform-step.active").find(".ff-btn-next").trigger("click")}"yes"==t.find(".ff-step-container").attr("data-enable_auto_slider")&&(t.find(".ff-el-form-check-radio,.ff-el-net-label, .ff-el-ratings label").on("click",(function(){n(e(this))})),t.find("select").on("change",(function(){n(e(this))})))}()},updateSlider:_,populateFormDataAndSetActiveStep:v}}var h,y,g=[{type:8,token:"round",show:"round",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t||0===t||(t=2),e=parseFloat(e).toFixed(t),parseFloat(e)}},{type:0,token:"ceil",show:"ceil",value:function(e){return Math.ceil(e)}},{type:0,token:"floor",show:"floor",value:function(e){return Math.floor(e)}},{type:0,token:"abs",show:"abs",value:function(e){return Math.abs(e)}},{type:8,token:"max",show:"max",value:function(e,t){return e>t?e:t}},{type:8,token:"min",show:"min",value:function(e,t){return e<t?e:t}}];function _(e,t){var n=t.find(".ff_has_formula");if(n.length){var r={},a={};mexp.addToken(g);var i=function(){jQuery.each(n,(function(n,r){var a=jQuery(r),i=a.data("calculation_formula"),f=function(e,t){for(var n,r=[],a=RegExp(e,"g");n=a.exec(t);)delete n.input,r.push(n);return r}(/{(.*?)}/g,i),d={};jQuery.each(f,(function(e,n){var r=n[0];jQuery.each(["{input.","{select.","{checkbox.","{radio.","{repeat.","{payment."],(function(e,n){if(function(e,t){return-1!==e.indexOf(t)}(r,n)){var a=(p=r,v=new RegExp(n+"|}","g"),p.replace(v,"")),i=0;if("{select."===n)i=c(a);else if("{checkbox."===n)i=u(a);else if("{radio."===n)i=s(a);else if("{repeat."===n)i=l(a);else if("{payment."===n)i=function(e){var n=0,r=t.find(":input[data-name="+e+"]");if(r.length&&o(r)){var a=r[0].type;"radio"===a?n=s(e,!0):"hidden"===a?n=r.attr("data-payment_value"):"number"===a||"text"===a?n=window.ff_helper.numericVal(r):"checkbox"===a?n=u(e,!0):"select-one"===a&&(n=c(e,!0))}return n}(a);else{var f=t.find("input[name="+a+"]");o(f)&&(i=window.ff_helper.numericVal(f))}return d[r]=i,!1}var p,v}))})),jQuery.each(d,(function(e,t){t||(t=0),i=i.split(e).join(t)}));var p="";try{i=i.replace(/\n/g,""),p=mexp.eval(i),isNaN(p)&&(p="")}catch(e){console.log(e,r)}if("text"==a[0].type){var v=e(a),m=v.val(),h=window.ff_helper.formatCurrency(v,p);if(v.val(h).prop("defaultValue",h),""==m)return;m!=h&&v.trigger("change")}else a.text(p)}))};t.find("input[type=number],input[data-calc_value],select[data-calc_value],.ff_numeric,.ff_payment_item").on("change keyup",i),i(),t.on("do_calculation",(function(){i()}))}function o(e){return!e.closest(".ff_excluded.has-conditions").length}function f(n){var r=0,a=t.find(n);return a.closest(".ff_excluded.has-conditions").length||e.each(a,(function(t,n){var a=e(n).attr("data-calc_value");a&&!isNaN(a)&&(r+=Number(a))})),r}function l(n){var f=0,l=n.split("."),s=!1;l.length>1&&(n=l[0],s=l[1]);var c=t.find("table[data-root_name="+n+"]");if(r[n]||(r[n]=!0,c.on("repeat_change",(function(){i()}))),o(c))if(s){var u=c.find("tbody tr td:nth-child("+s+")");e.each(u,(function(t,r){var o=e(r).find(":input"),l=n+"_"+s+"_"+o.attr("id");a[l]||(a[l]=!0,o.on("change",(function(){i()})));var c=0;c="select"===o.attr("type")?parseFloat(o.find("option:selected").attr("data-calc_value")):parseFloat(o.val()),isNaN(c)||(f+=c)})),f&&(f=f.toFixed(2))}else f=c.find("tbody tr").length;return f}function s(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0,a=t.find("input[name="+e+"]:checked");return n?a.attr("data-payment_value"):(o(a)&&(r=a.attr("data-calc_value")||0),r)}function c(e){var n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t.find("select[name="+e+"] option:selected").data("payment_value"):(n=f("select[data-name="+e+"] option:selected"),t.find("select[data-name="+e+"]").attr("data-calc_value",n),n)}function u(e){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))return f("input[data-name="+e+"]:checked");var n=t.find(":input[data-name="+e+"]").data("group_id"),r=t.find('input[data-group_id="'+n+'"]:checked'),a=0;return r.each((function(e,t){var n=jQuery(t).data("payment_value");n&&(a+=parseFloat(n))})),a}}(h=jQuery)(document.body).on("fluentform_init",(function(n,r,a){if(r.attr("data-form_instance"),a){a.form_id_selector;var i="."+a.form_instance;if(function(e,t,n,r,a){var i=function(){jQuery.fn.fileupload&&(t.find('input[type="file"]').each((function(i,s){var u,d,p=e(this),v=p.closest(".ff-el-group");v.closest(".ff-column-container").is(".ff_columns_total_6, .ff_columns_total_5, .ff_columns_total_4")&&v.width()<162&&(d=v.width()),u=e("<div/>",{class:"ff-uploaded-list",style:"font-size:12px; margin-top: 15px;"+(d?"max-width:".concat(d,"px;"):"")}),p.closest("div").append(u);var m=u.width(),h=n.rules[p.prop("name")],y=h.max_file_count.value;"max_file_count"in h&&(h.max_file_count.remaining=Number(y));var g="";function _(e){var n=p.prop("name");t.trigger("show_element_error",{element:n,message:e})}function b(r,i){if(i&&i.files&&i.files.length){if(t.find(".ff-upload-preview-elem").remove(),"max_file_count"in h){e(a+"_errors").empty(),e(this).closest("div").find(".error").html("");var o=h.max_file_count.remaining;if(!o||i.files.length>o){var f="Maximum 1 file is allowed!";return f=y>1?"Maximum "+y+" files are allowed!":f,h.max_file_count&&h.max_file_count.message&&(f=h.max_file_count.message),_(f),!1}}var s=l(i.files[0],n.rules[p.prop("name")]);return!s.length||(_(s.join(", ")),!1)}}"allowed_file_types"in h?(g=h.allowed_file_types.value.join("|"),p.prop("accept","."+g.replace(/\|/g,",."))):(g=h.allowed_image_types.value.join("|"))?p.prop("accept","."+g.replace(/\|/g,",.")):p.prop("accept","image/*");var x=e(s);p.fileupload({dataType:"json",dropZone:p.closest(".ff-el-group"),url:r.ajaxUrl,formData:function(e){var t=e.serializeArray();return t.push({name:"action",value:"fluentform_file_upload"}),t.push({name:"formId",value:n.id}),t},change:b,add:function(t,n){if(b(0,n)){var a=e("<div/>",{class:"ff-upload-preview"+(d?" ff-upload-container-small-column-image":"")});n.context=a;var i=e("<div/>",{class:"ff-upload-thumb"}),l=e("<div/>",{class:"ff-upload-details"}),s=e("<div/>",{class:"ff-upload-preview-img",style:"background-image: url('".concat(o(n.files[0]),"');")}),c=e("<div>",{class:"ff-upload-error",style:"color:red;"}),p=e("<span/>",{html:r.upload_start_txt,class:"ff-upload-progress-inline-text ff-inline-block"}),v=e('\n\t\t\t\t\t\t\t\t\t<div class="ff-upload-progress-inline ff-el-progress">\n\t\t\t\t\t\t\t\t\t\t<div class="ff-el-progress-bar"></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t'),h=e("<div/>",{class:"ff-upload-filename",text:n.files[0].name}),y=e("<span/>",{"data-href":"#","data-attachment-id":"",html:"&times;",class:"ff-upload-remove"}),g=e("<div>",{class:"ff-upload-filesize ff-inline-block",html:f(n.files[0].size)});i.append(s),l.append(h,v,p,g,c,y),a.append(i,l),u.append(a),d||(m-=91),h.css({maxWidth:m+"px"}),n.submit(),n.context.addClass("ff_uploading")}},progress:function(e,t){var n=parseInt(t.loaded/t.total*100,10);t.context.find(".ff-el-progress-bar").css("width",n+"%"),t.context.find(".ff-upload-progress-inline-text").text(r.uploading_txt)},done:function(e,n){if(n.context.removeClass("ff_uploading"),n.result&&"data"in n.result&&"files"in n.result.data)"error"in n.result.data.files[0]?(_("Upload Error: "+n.result.data.files[0].error),n.context.remove()):(n.context.find(".ff-upload-progress-inline-text").text(r.upload_completed_txt),h.max_file_count.remaining-=1,n.context.attr("data-src",n.result.data.files[0].url),n.context.find(".ff-upload-remove").attr({"data-href":n.result.data.files[0].file,"data-attachment-id":n.result.data.files[0].attachment_id}),n.context.addClass("ff_uploading_complete"),t.find("input[name="+x.data("name")+"]").trigger("change"));else{var a="Sorry! The upload failed for some unknown reason.";if(n.messages){var i=Object.keys(n.messages);i.length&&(a=n.messages[i[0]])}_(a),n.context.remove()}},fail:function(t,n){var r,a,i,o,f=[];null===(r=n.context)||void 0===r||r.remove(),null!==(a=n.jqXHR)&&void 0!==a&&a.responseJSON&&null!==(i=n.jqXHR)&&void 0!==i&&i.responseJSON.errors?e.each(n.jqXHR.responseJSON.errors,(function(t,n){"object"==c(n)?e.each(n,(function(e,t){f.push(t)})):f.push(n)})):null!==(o=n.jqXHR)&&void 0!==o&&o.responseText?f.push(n.jqXHR.responseText):f.push("Something is wrong when uploading the file! Please try again"),_(f.join(", "))}}),x.on("change_remaining",(function(e,t){h.max_file_count.remaining+=t}))})),t.find(".ff_upload_btn").on("keyup",(function(t){32==t.keyCode&&e(this).siblings("input[type=file]").trigger("click")})))},o=function(e){if(e.type.match("image"))return URL.createObjectURL(e);var t=document.createElement("canvas");t.width=60,t.height=60,t.style.zIndex=8,t.style.position="absolute",t.style.border="1px solid";var n=t.getContext("2d");return n.fillStyle="rgba(0, 0, 0, 0.2)",n.fillRect(0,0,60,60),n.font="13px Arial",n.fillStyle="white",n.textAlign="center",n.fillText(e.name.substr(e.name.lastIndexOf(".")+1),30,30,60),t.toDataURL()},f=function(e){return e<1024?e+"bytes":e>=1024&&e<=1048576?(e/1024).toFixed(1)+"KB":e>1048576?(e/1048576).toFixed(1)+"MB":void 0},l=function(e,t){var n=[],r="",a="";if("allowed_file_types"in t?(r=t.allowed_file_types.value,a=t.allowed_file_types.message):"allowed_image_types"in t&&(r=t.allowed_image_types.value,a=t.allowed_image_types.message),r){var i=new RegExp("("+r.join("|")+")","i"),o=e.name.split(".").pop();o=o.toLowerCase(),i.test(o)||n.push(a)}return"max_file_size"in t&&e.size>t.max_file_size.value&&n.push(t.max_file_size.message),n};i(),t.find(".ff-uploaded-list").on("click",".ff-upload-remove",(function(t){t.preventDefault();var n=e(this),a=n.closest(".ff-uploaded-list"),i=a.closest(".ff-el-input--content").find("input[type=file]"),o=n.attr("data-href"),f=n.attr("data-attachment-id");"#"==o?(n.closest(".ff-upload-preview").remove(),a.find(".ff-upload-preview").length||a.siblings(".ff-upload-progress").addClass("ff-hidden"),i.trigger("change_remaining",1)):e.post(r.ajaxUrl,{path:o,attachment_id:f,action:"fluentform_delete_uploaded_file"}).then((function(e){n.closest(".ff-el-input--content").find("input"),i.trigger("change_remaining",1),n.closest(".ff-upload-preview").remove(),a.find(".ff-upload-preview").length||a.siblings(".ff-upload-progress").addClass("ff-hidden"),i.trigger("change")}))})),e(document.body).on("fluentform_reset",(function(){i()}))}(h,r,a,window.fluentFormVars,i),t(r),function(e,t){var n=t.find(".fluentform .js-repeat");e.each(n,(function(t,n){var r=e(n);if(r.find(".ff-t-cell").length>1){var a=r.find(".ff-el-group").height()-r.find(".ff-el-group").find(".ff-el-input--content").height();r.find(".js-repeat-buttons").css("margin-top",a+"px")}var i=r.find(".ff-el-group").find(".ff-el-input--content .ff-el-form-control").outerHeight();r.find(".ff-el-repeat-buttons").height(i)}))}(h,r),s(h,r,a,window.fluentFormVars),_(h,r),function(e,t){var n=t.find(".jss-ff-el-ratings");n.length&&e.each(n,(function(t,n){var r=e(n);r.find("label.active").prevAll().addClass("active"),r.on("mouseenter","label",(function(t){var n=e(this),r="[data-id="+n.find("input").attr("id")+"]";n.addClass("active"),n.prevAll().addClass("active"),n.nextAll().removeClass("active"),n.closest(".ff-el-input--content").find(".ff-el-rating-text").css("display","none"),n.closest(".ff-el-input--content").find(r).css("display","inline-block")})).on("click","label",(function(t){var n=e(this).find(".jss-ff-svg");n.addClass("scale"),n.addClass("scalling"),setTimeout((function(e){n.removeClass("scalling"),n.removeClass("scale")}),150)})).on("mouseleave",(function(t){var n=e(this),r="[data-id="+n.find("input:checked").attr("id")+"]",a=n.find("input:checked").parent("label");a.length?(a.addClass("active"),a.prevAll().addClass("active"),a.nextAll().removeClass("active")):n.find("label").removeClass("active"),n.closest(".ff-el-input--content").find(".ff-el-rating-text").css("display","none"),n.closest(".ff-el-input--content").find(r).css("display","inline-block")}))}))}(h,r),e(h,r),r.hasClass("ff-form-has-steps")){var o=m(h,r,window.fluentFormVars,i);o.init(),r.on("update_slider",(function(e,t){o.updateSlider(t.goBackToStep,t.animDuration,t.isScrollTop,t.actionType)}))}r.hasClass("ff_has_dynamic_smartcode")&&(r.on("ff_render_dynamic_smartcodes",(function(e,t){f(h(t))})),r.on("keyup change",":input",(function(){f(r)})),f(r))}else console.log("No Fluent form JS vars found!");function f(e){jQuery.each(e.find(".ff_dynamic_value"),(function(e,t){var n=h(t).data("ref");if("payment_summary"!=n){var a=r.find('.ff-el-form-control[name="'+n+'"]'),i=" ";a.length||(a=r.find('.ff-field_container[data-name="'+n+'"]').find("input")),a.length||((a=r.find('*[name="'+n+'"]:checked')).length||(a=r.find('*[name="'+n+'[]"]:checked'),i=", "),a.length||(a=r.find('*[name="'+n+'[]"]').find("option:selected"),i=", "));var o=[];if(!a.length){var f=r.find('.ff-el-repeater[data-name="'+n+'"] tbody tr');f.each((function(e){var t=h(this).find("input, select"),n=[];t.each((function(e){var t=h(this).val();if(t){var r=h(this).closest("td").data("label")||"Column-"+(e+1);n.push(r+": "+t)}})),n.length&&o.push("#"+(e+1)+"- "+n.join(" | "))})),f.length&&(i="<br/>")}h.each(a,(function(){var e=h(this).val(),t=h(this).closest(".ff-el-group.has-conditions").hasClass("ff_excluded");e&&!t&&o.push(e)}));var l="";l=o.length?o.join(i):h(t).data("fallback"),h(this).html(l)}else r.trigger("calculate_payment_summary",{element:h(t)})}))}})),(y=String.prototype).startsWith||(y.startsWith=function(e,t){return t=!t||t<0?0:+t,this.substring(t,t+e.length)===e}),y.endsWith||(y.endsWith=function(e,t){return(void 0===t||t>this.length)&&(t=this.length),this.substring(t-e.length,t)===e}),y.includes||(y.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)})})()})();