"use strict";var wpforms=window.wpforms||function(n,s,p){var l={init:function(){p(l.ready),p(s).on("load",function(){"function"==typeof p.ready.then?p.ready.then(l.load):l.load()}),l.binduiactions(),l.bindoptinmonster()},ready:function(){l.clearurlquery(),l.setuserindentifier(),l.loadvalidation(),l.loaddatepicker(),l.loadtimepicker(),l.loadinputmask(),l.loadsmartphonefield(),l.loadpayments(),l.loadmailcheck(),l.loadchoicesjs(),p(".wpforms-randomize").each(function(){for(var e=p(this),t=e.children();t.length;)e.append(t.splice(math.floor(math.random()*t.length),1)[0])}),p(".wpforms-page-button").prop("disabled",!1),p(n).trigger("wpformsready")},load:function(){},clearurlquery:function(){var e=s.location,t=e.search;-1!==t.indexof("wpforms_form_id=")&&(t=t.replace(/([&?]wpforms_form_id=[0-9]*$|wpforms_form_id=[0-9]*&|[?&]wpforms_form_id=[0-9]*(?=#))/,""),history.replacestate({},null,e.origin+e.pathname+t))},loadvalidation:function(){void 0!==p.fn.validate&&(p(".wpforms-input-temp-name").each(function(e,t){var r=math.floor(9999*math.random())+1;p(this).attr("name","wpf-temp-"+r)}),p(n).on("change",".wpforms-validate input[type=url]",function(){var e=p(this).val();if(!e)return!1;"http://"!==e.substr(0,7)&&"https://"!==e.substr(0,8)&&p(this).val("https://"+e)}),p.validator.messages.required=wpforms_settings.val_required,p.validator.messages.url=wpforms_settings.val_url,p.validator.messages.email=wpforms_settings.val_email,p.validator.messages.number=wpforms_settings.val_number,void 0!==p.fn.payment&&p.validator.addmethod("creditcard",function(e,t){e=p.payment.validatecardnumber(e);return this.optional(t)||e},wpforms_settings.val_creditcard),p.validator.addmethod("extension",function(e,t,r){return r="string"==typeof r?r.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(t)||e.match(new regexp("\\.("+r+")$","i"))},wpforms_settings.val_fileextension),p.validator.addmethod("maxsize",function(e,t,r){var a,o,i=r,r=this.optional(t);if(r)return r;if(t.files&&t.files.length)for(a=0,o=t.files.length;ai)return!1;return!0},wpforms_settings.val_filesize),p.validator.methods.email=function(e,t){var r=function(e){if(254=number(r.data("password-strength-level"))},wpforms_settings.val_password_strength),p(".wpforms-validate").each(function(){var e=p(this),t=e.data("formid"),t=void 0!==s["wpforms_"+t]&&s["wpforms_"+t].hasownproperty("validate")?s["wpforms_"+t].validate:"undefined"!=typeof wpforms_validate?wpforms_validate:{errorclass:"wpforms-error",validclass:"wpforms-valid",ignore:":hidden:not(textarea.wp-editor-area), .wpforms-conditional-hide textarea.wp-editor-area",errorplacement:function(e,t){l.islikertscalefield(t)?(t.closest("table").hasclass("single-row")?t.closest(".wpforms-field"):t.closest("tr").find("th")).append(e):l.iswrappedfield(t)?t.closest(".wpforms-field").append(e):l.isdatetimefield(t)?l.datetimeerrorplacement(t,e):l.isfieldincolumn(t)?t.parent().append(e):e.insertafter(t)},highlight:function(e,t,r){var e=p(e),a=e.closest(".wpforms-field"),o=e.attr("name");("radio"===e.attr("type")||"checkbox"===e.attr("type")?a.find('input[name="'+o+'"]'):e).addclass(t).removeclass(r),a.addclass("wpforms-has-error")},unhighlight:function(e,t,r){var e=p(e),a=e.closest(".wpforms-field"),o=e.attr("name");("radio"===e.attr("type")||"checkbox"===e.attr("type")?a.find('input[name="'+o+'"]'):e).addclass(r).removeclass(t),a.removeclass("wpforms-has-error")},submithandler:function(o){function e(){var t=p(o),r=t.find(".wpforms-submit"),e=r.data("alt-text"),a=r.get(0).recaptchaid;if(t.data("token")&&0===p(".wpforms-token",t).length&&p('').val(t.data("token")).appendto(t),r.prop("disabled",!0),t.find("#wpforms-field_recaptcha-error").remove(),e&&r.text(e),!l.empty(a)||0===a)return grecaptcha.execute(a).then(null,function(e){e=null===e?"":"
"+e,t.find(".wpforms-recaptcha-container").append('"),r.prop("disabled",!1)}),!1;p(".wpforms-input-temp-name").removeattr("name"),l.formsubmit(t)}return"function"==typeof wpformsrecaptchav3execute?wpformsrecaptchav3execute(e):e()},invalidhandler:function(e,t){void 0!==t.errorlist[0]&&l.scrolltoerror(p(t.errorlist[0].element))},onkeyup:function(e,t){p(e).hasclass("wpforms-novalidate-onkeyup")||9===t.which&&""===this.elementvalue(e)||-1!==p.inarray(t.keycode,[16,17,18,20,35,36,37,38,39,40,45,144,225])||(e.name in this.submitted||e.name in this.invalid)&&this.element(e)},onfocusout:function(e){var t=!1;p(e).hasclass("wpforms-novalidate-onkeyup")&&!e.value&&(t=!0),(t=this.checkable(e)||!(e.name in this.submitted)&&this.optional(e)?t:!0)&&this.element(e)},onclick:function(e){var t=!1,r=(e||{}).type,a=p(e);-1<["checkbox","radio"].indexof(r)&&((a=a.hasclass("wpforms-likert-scale-option")?a.closest("tr"):a.closest(".wpforms-field")).find("label.wpforms-error").remove(),t=!0),t&&this.element(e)}};e.validate(t)}))},isfieldincolumn:function(e){return e.parent().hasclass("wpforms-one-half")||e.parent().hasclass("wpforms-two-fifths")||e.parent().hasclass("wpforms-one-fifth")},isdatetimefield:function(e){return e.hasclass("wpforms-timepicker")||e.hasclass("wpforms-datepicker")||e.is("select")&&e.attr("class").match(/date-month|date-day|date-year/)},iswrappedfield:function(e){return"checkbox"===e.attr("type")||"radio"===e.attr("type")||"range"===e.attr("type")||"select"===e.is("select")||e.parent().hasclass("iti")||e.hasclass("wpforms-validation-group-member")||e.hasclass("choicesjs-select")||e.hasclass("wpforms-net-promoter-score-option")},islikertscalefield:function(e){return e.hasclass("wpforms-likert-scale-option")},datetimeerrorplacement:function(e,t){var r=e.closest(".wpforms-field-row-block, .wpforms-field-date-time");r.length?r.find("label.wpforms-error").length||r.append(t):e.closest(".wpforms-field").append(t)},loaddatepicker:function(){void 0!==p.fn.flatpickr&&p(".wpforms-datepicker-wrap").each(function(){var a=p(this),e=a.find("input"),t=a.closest(".wpforms-form").data("formid"),r=a.closest(".wpforms-field").data("field-id"),r=void 0!==s["wpforms_"+t+"_"+r]&&s["wpforms_"+t+"_"+r].hasownproperty("datepicker")?s["wpforms_"+t+"_"+r].datepicker:void 0!==s["wpforms_"+t]&&s["wpforms_"+t].hasownproperty("datepicker")?s["wpforms_"+t].datepicker:"undefined"!=typeof wpforms_datepicker?wpforms_datepicker:{disablemobile:!0},o=(!r.hasownproperty("locale")&&"undefined"!=typeof wpforms_settings&&wpforms_settings.hasownproperty("locale")&&(r.locale=wpforms_settings.locale),r.wrap=!0,r.dateformat=e.data("date-format"),1===e.data("disable-past-dates")&&(r.mindate="today"),e.data("limit-days")),i=["sun","mon","tue","wed","thu","fri","sat"];o&&""!==o&&(o=o.split(","),r.disable=[function(e){for(var t in o)if(i.indexof(o[t])===e.getday())return!1;return!0}]),r.onchange=function(e,t,r){t=""===t?"none":"block";a.find(".wpforms-datepicker-clear").css("display",t)},a.flatpickr(r)})},loadtimepicker:function(){void 0!==p.fn.timepicker&&p(".wpforms-timepicker").each(function(){var e=p(this),t=e.closest(".wpforms-form").data("formid"),r=e.closest(".wpforms-field").data("field-id"),r=void 0!==s["wpforms_"+t+"_"+r]&&s["wpforms_"+t+"_"+r].hasownproperty("timepicker")?s["wpforms_"+t+"_"+r].timepicker:void 0!==s["wpforms_"+t]&&s["wpforms_"+t].hasownproperty("timepicker")?s["wpforms_"+t].timepicker:"undefined"!=typeof wpforms_timepicker?wpforms_timepicker:{scrolldefault:"now",forceroundtime:!0};e.timepicker(r)})},loadinputmask:function(){void 0!==p.fn.inputmask&&p(".wpforms-masked-input").inputmask({rightalign:!1})},loadsmartphonefield:function(){var a,e,t;void 0!==p.fn.intltelinput&&(a={},wpforms_settings.gdpr||(a.geoiplookup=l.currentiptocountry),wpforms_settings.gdpr&&(e=this.getfirstbrowserlanguage(),t=-1'"()/\\|:;=@%&\s]/gi,"").substr(0,64),a=decodeuri(t.domain).replaceall(/[<>'"()/\\|:;=@%&+_\s]/gi,"");t=''+r+"@"+a+"",t=wpforms_settings.val_email_suggestion.replace("{suggestion}",t),e.closest(".wpforms-field").find("#"+o+"_suggestion").remove(),e.parent().append('")},empty:function(){p("#"+o+"_suggestion").remove()}})}),p(n).on("click",".wpforms-field-email .mailcheck-suggestion",function(e){var t=p(this),r=t.closest(".wpforms-field"),a=t.data("id");e.preventdefault(),r.find("#"+a).val(t.text()),t.parent().remove()}))},loadchoicesjs:function(){"function"==typeof s.choices&&p(".wpforms-field-select-style-modern .choicesjs-select, .wpforms-field-payment-select .choicesjs-select").each(function(e,t){var r,a;p(t).data("choicesjs")||(r=s.wpforms_choicesjs_config||{},a=p(t).data("search-enabled"),r.searchenabled=void 0===a||a,r.callbackoninit=function(){var t=this,r=p(t.passedelement.element),a=p(t.input.element),e=r.data("size-class");r.removeattr("hidden").addclass(t.config.classnames.input+"--hidden"),e&&p(t.containerouter.element).addclass(e),r.prop("multiple")&&(a.data("placeholder",a.attr("placeholder")),t.getvalue(!0).length&&a.removeattr("placeholder")),r.on("change",function(){var e;r.prop("multiple")&&(t.getvalue(!0).length?a.removeattr("placeholder"):a.attr("placeholder",a.data("placeholder"))),(e=r.closest("form").data("validator"))&&e.element(r)})},r.callbackoncreatetemplates=function(){var r=p(this.passedelement.element);return{option:function(e){var t=choices.defaults.templates.option.call(this,e);return void 0!==e.placeholder&&!0===e.placeholder&&t.classlist.add("placeholder"),r.hasclass("wpforms-payment-price")&&void 0!==e.customproperties&&null!==e.customproperties&&(t.dataset.amount=e.customproperties),t}}},p(t).data("choicesjs",new choices(t,r)))})},binduiactions:function(){p(n).on("click",".wpforms-page-button",function(e){e.preventdefault(),l.pagebreaknav(this)}),p(n).on("change input",".wpforms-payment-price",function(){l.amounttotal(this,!0)}),p(n).on("input",".wpforms-payment-user-input",function(){var e=p(this),t=e.val();e.val(t.replace(/[^0-9.,]/g,""))}),p(n).on("focusout",".wpforms-payment-user-input",function(){var e=p(this),t=e.val();if(!t)return t;t=l.amountsanitize(t),t=l.amountformat(t);e.val(t)}),p(n).on("wpformsprocessconditionals",function(e,t){l.amounttotal(t,!0)}),p(n).on("mouseenter",".wpforms-field-rating-item",function(){p(this).parent().find(".wpforms-field-rating-item").removeclass("selected hover"),p(this).prevall().addback().addclass("hover")}).on("mouseleave",".wpforms-field-rating-item",function(){p(this).parent().find(".wpforms-field-rating-item").removeclass("selected hover"),p(this).parent().find("input:checked").parent().prevall().addback().addclass("selected")}),p(n).on("change",".wpforms-field-rating-item input",function(){var e=p(this);e.closest(".wpforms-field-rating-items").find(".wpforms-field-rating-item").removeclass("hover selected"),e.parent().prevall().addback().addclass("selected")}),p(function(){p(".wpforms-field-rating-item input:checked").trigger("change")}),p(n).on("keypress",".wpforms-image-choices-item label",function(e){var t=p(this);if(t.closest(".wpforms-field").hasclass("wpforms-conditional-hide"))return e.preventdefault(),!1;13===e.which&&p("#"+t.attr("for")).trigger("click")}),s.document.documentmode&&p(n).on("click",".wpforms-image-choices-item img",function(){p(this).closest("label").find("input").trigger("click")}),p(n).on("change",".wpforms-field-checkbox input, .wpforms-field-radio input, .wpforms-field-payment-multiple input, .wpforms-field-payment-checkbox input, .wpforms-field-gdpr-checkbox input",function(e){var t=p(this);if(t.closest(".wpforms-field").hasclass("wpforms-conditional-hide"))return e.preventdefault(),!1;switch(t.attr("type")){case"radio":t.closest("ul").find("li").removeclass("wpforms-selected").find("input[type=radio]").removeprop("checked"),t.prop("checked",!0).closest("li").addclass("wpforms-selected");break;case"checkbox":t.is(":checked")?(t.closest("li").addclass("wpforms-selected"),t.prop("checked",!0)):(t.closest("li").removeclass("wpforms-selected"),t.prop("checked",!1))}}),p(n).on("change",'.wpforms-field-file-upload input[type=file]:not(".dropzone-input")',function(){var e=p(this),t=e.closest("form.wpforms-form").find('.wpforms-field-file-upload input:not(".dropzone-input")'),a=0,r=number(wpforms_settings.post_max_size),o='
'+wpforms_settings.val_post_max_size+"
",e=e.closest("form.wpforms-form").find(".wpforms-submit-container"),i=e.find("button.wpforms-submit"),n=e.prev();t.each(function(){for(var e=p(this),t=0,r=e[0].files.length;t{errormsg}'.replace(/{errormsg}/,o)),i.prop("disabled",!0)):(n.find(".wpforms-error-container-post_max_size").remove(),i.prop("disabled",!1))}),p(n).on("change input",".wpforms-field-number-slider input[type=range]",function(e){var t=p(e.target).siblings(".wpforms-field-number-slider-hint");t.html(t.data("hint").replace("{value}",""+e.target.value+""))}),p(n).on("keydown",".wpforms-form input",function(e){var t,r;13!==e.keycode||0===(r=(t=p(this)).closest(".wpforms-page")).length||["text","tel","number","email","url","radio","checkbox"].indexof(t.attr("type"))<0||(t.hasclass("wpforms-datepicker")&&t.flatpickr("close"),e.preventdefault(),(r.hasclass("last")?r.closest(".wpforms-form").find(".wpforms-submit"):r.find(".wpforms-page-next")).trigger("click"))}),p(n).on("keypress",".wpforms-field-number input",function(e){return/^[-0-9.]+$/.test(string.fromcharcode(e.keycode||e.which))})},entrypreviewfieldpagechange:function(e,t,r){console.warn("warning! obsolete function called. function wpforms.entrypreviewfieldpagechange has been deprecated, please use the wpformsentrypreview.pagechange function instead!"),wpformsentrypreview.pagechange(e,t,r)},entrypreviewfieldupdate:function(e,t){console.warn("warning! obsolete function called. function wpforms.entrypreviewfieldupdate has been deprecated, please use the wpformsentrypreview.update function instead!"),wpformsentrypreview.update(e,t)},scrolltoerror:function(e){var t;0!==e.length&&0!==(t=0===(t=e.find(".wpforms-field.wpforms-has-error")).length?e.closest(".wpforms-field"):t).length&&void 0!==(e=t.offset())&&l.animatescrolltop(e.top-75,750).done(function(){var e=t.find(".wpforms-error").first();"function"==typeof e.focus&&e.trigger("focus")})},pagebreaknav:function(e){const t=p(e),r=t.data("action"),a=t.data("page"),o=t.closest(".wpforms-form"),i=o.find(".wpforms-page-"+a);l.savetinymce(),"next"===r&&void 0!==p.fn.validate?l.checkforinvalidfields(o,i,function(){l.navigatetopage(t,r,a,o,i)}):"prev"!==r&&"next"!==r||l.navigatetopage(t,r,a,o,i)},checkforinvalidfields:function(e,t,a){var r=e.data("validator");if(r)if(0'),r.render(t,{sitekey:e,callback:function(){wpformsrecaptchacallback(p("#"+t))}}))},amounttotal:function(e,r){r=r||!1;var a=p(e).closest(".wpforms-form"),e=l.getcurrency(),t=l.amounttotalcalc(a),t=l.amountformat(t),o="left"===e.symbol_pos?e.symbol+" "+t:t+" "+e.symbol;a.find(".wpforms-payment-total").each(function(e,t){"hidden"===p(this).attr("type")||"text"===p(this).attr("type")?(p(this).val(o),"text"===p(this).attr("type")&&r&&a.data("validator")&&p(this).valid()):p(this).text(o)})},amounttotalcalc:function(e){var a=0;return p(".wpforms-payment-price",e).each(function(){var e=0,t=p(this),r=t.attr("type");t.closest(".wpforms-field-payment-single").hasclass("wpforms-conditional-hide")||("text"===r||"hidden"===r?e=t.val():"radio"!==r&&"checkbox"!==r||!t.is(":checked")?t.is("select")&&0'+e+""):p.each(e,function(e,t){switch(e){case"header":r.prepend(t);break;case"footer":r.find(".wpforms-submit-container").before(t);break;case"recaptcha":r.find(".wpforms-recaptcha-container").append(t)}})))},clearformajaxgeneralerrors:function(e){e.find(".wpforms-error-container").remove(),e.find("#wpforms-field_recaptcha-error").remove()},displayformajaxfielderrors:function(e,t){var r;e&&e.length&&(l.empty(t)||(r=e.data("validator"))&&(r.showerrors(t),l.formhascaptcha(e)||r.focusinvalid()))},formsubmitajax:function(a){var r,t,e;return a.length?(r=a.closest(".wpforms-container"),e=a.find(".wpforms-submit-spinner"),r.css("opacity",.6),e.show(),l.clearformajaxgeneralerrors(a),(e=new formdata(a.get(0))).append("action","wpforms_submit"),e.append("page_url",s.location.href),e.append("page_title",wpforms_settings.page_title),e.append("page_id",wpforms_settings.page_id),e={type:"post",datatype:"json",url:wpforms_settings.ajaxurl,data:e,cache:!1,contenttype:!1,processdata:!1,success:function(e){e?e.data&&e.data.action_required?a.trigger("wpformsajaxsubmitactionrequired",e):e.success?(a.trigger("wpformsajaxsubmitsuccess",e),e.data&&(e.data.redirect_url?(a.trigger("wpformsajaxsubmitbeforeredirect",e),s.location=e.data.redirect_url):e.data.confirmation&&(r.html(e.data.confirmation),t=r.find("div.wpforms-confirmation-scroll"),r.trigger("wpformsajaxsubmitsuccessconfirmation",e),t.length&&l.animatescrolltop(t.offset().top-100)))):(l.resetformrecaptcha(a),l.displayformajaxerrors(a,e.data),a.trigger("wpformsajaxsubmitfailed",e)):l.consolelogajaxerror()},error:function(e,t,r){l.consolelogajaxerror(r),a.trigger("wpformsajaxsubmiterror",[e,t,r])},complete:function(e,t){e.responsejson&&e.responsejson.data&&(e.responsejson.data.action_required||"success"===t&&e.responsejson.data.redirect_url)||(l.restoresubmitbutton(a,r),a.trigger("wpformsajaxsubmitcompleted",[e,t]))}},wpformsutils.triggerevent(a,"wpformsajaxbeforesubmit",[a]).isdefaultprevented()?(l.restoresubmitbutton(a,r),p.deferred().reject()):p.ajax(e)):p.deferred().reject()},animatescrolltop:function(e,t,r){return t=t||1e3,r="function"==typeof r?r:function(){},p("html, body").animate({scrolltop:parseint(e,10)},{duration:t,complete:r}).promise()},savetinymce:function(){"undefined"!=typeof tinymce&&tinymce.triggersave()},isfunction:function(e){return!!(e&&e.constructor&&e.call&&e.apply)},comparetimesgreaterthan:function(e,t){e=e.replace(/(am|pm)/g," $1").touppercase(),t=t.replace(/(am|pm)/g," $1").touppercase();e=date.parse("01 jan 2021 "+e);return date.parse("01 jan 2021 "+t)<=e}};return l}(document,window,jquery);wpforms.init();