'"()/\\|:;=@%&\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("#"+i+"_suggestion").remove(),e.parent().append('")},empty(){p("#"+i+"_suggestion").remove()}})}}),p(s).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(o){"function"==typeof d.Choices&&(o=o?.length?o:p(s)).find(".wpforms-field-select-style-modern .choicesjs-select, .wpforms-field-payment-select .choicesjs-select").each(function(e,t){var r,a,i;p(t).data("choicesjs")||WPFormsUtils.triggerEvent(o,"wpformsBeforeLoadElementChoices",[t]).isDefaultPrevented()||(r=d.wpforms_choicesjs_config||{},a=p(t).data("search-enabled"),i=p(t).data("remove-items-enabled"),r.searchEnabled=void 0===a||a,r.removeItems=void 0===i||i,r.removeItemButton=r.removeItems,r.allowHTML=!0,r.callbackOnInit=function(){let t=this,r=p(t.passedElement.element),e=t.input?.element,a=p(e),i=r.data("size-class"),o=r.attr("id"),s=this.dropdown.element.querySelector('[role="listbox"]'),n=this.passedElement.element.multiple;var l;t.containerOuter&&t.containerOuter.element&&o&&n&&(t.containerOuter.element.setAttribute("aria-haspopup","listbox"),t.containerOuter.element.setAttribute("aria-labelledby",o)),e&&s&&(l="choices-listbox-"+this.passedElement.element.id,s.id=l,e.setAttribute("aria-controls",l),e.setAttribute("aria-owns",l)),t.passedElement.element.addEventListener("showDropdown",()=>{e&&n&&e.focus()}),r.removeAttr("hidden").addClass(t.config.classNames.input+"--hidden"),i&&p(t.containerOuter.element).addClass(i),r.prop("multiple")&&(a.data("placeholder",a.attr("placeholder")).css("width","auto"),t.getValue(!0).length&&a.removeAttr("placeholder"),a.css("width","1ch")),r.on("change",function(){r.prop("multiple")&&(t.getValue(!0).length?a.removeAttr("placeholder"):a.attr("placeholder",a.data("placeholder")).css("width","auto"));var e=r.closest("form").data("validator");e&&e.element(r)})},r.callbackOnCreateTemplates=function(){let r=p(this.passedElement.element);return{option(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")&&null!=e.customProperties&&(t.dataset.amount=e.customProperties),t}}},p(t).data("choicesjs",new Choices(t,r)))})},bindChoicesJS(){p(s).on("click",".choices",function(e){var t=p(this),r=t.find("select").data("choicesjs");r&&t.hasClass("is-open")&&(e.target.classList.contains("choices__inner")||e.target.classList.contains("choices__arrow"))&&r.hideDropdown()})},bindUIActions(){var e=p(s);e.on("click",".wpforms-page-button",function(e){e.preventDefault(),m.pagebreakNav(this)});let t;e.on("change input",".wpforms-payment-price",function(){clearTimeout(t),t=setTimeout(()=>{m.amountTotal(this,!0)},0)});let r;e.on("change","select.wpforms-payment-quantity",function(){clearTimeout(r),r=setTimeout(()=>{m.amountTotal(this,!0),m.updateOrderSummaryItemQuantity(p(this))},0)}),e.on("input",".wpforms-payment-user-input",function(){var e=p(this),t=e.val();e.val(t.replace(/[^0-9.,]/g,""))}),e.on("focusout",".wpforms-payment-user-input",function(){var e=p(this),t=e.val();if(!t)return t;t=m.amountSanitize(t),t=m.amountFormat(t);e.val(t)});let a;e.on("wpformsProcessConditionals",function(e,t){clearTimeout(a),a=setTimeout(()=>{m.amountTotal(t,!0)},0)}),e.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(s).on("change",".wpforms-field-rating-item input",function(){var e=p(this),t=e.closest(".wpforms-field-rating-items").find(".wpforms-field-rating-item");e.focus(),t.removeClass("hover selected"),e.parent().prevAll().addBack().addClass("selected")}),p(function(){p(".wpforms-field-rating-item input:checked").trigger("change")}),e.on("keydown",".wpforms-image-choices-item label",function(e){var t=p(this);if(t.closest(".wpforms-field").hasClass("wpforms-conditional-hide"))return e.preventDefault(),!1;32===e.keyCode&&(t.find("input").trigger("click"),e.preventDefault())}),m.bindOtherOptionActions(),d.document.documentMode&&e.on("click",".wpforms-image-choices-item img",function(){p(this).closest("label").find("input").trigger("click")}),e.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))}}),e.on("input",".wpforms-field-file-upload",function(){var e=p(this),t=e.closest("form.wpforms-form").find('.wpforms-field-file-upload input:not(".dropzone-input")');let a=0,r=Number(wpforms_settings.post_max_size),i=''+wpforms_settings.val_post_max_size+"
";e=e.closest("form.wpforms-form").find(".wpforms-submit-container");let o=e.find("button.wpforms-submit"),s=e.prev();var n=o.closest("form"),l=n.find(".wpforms-page-next:visible");0!==n.find(".wpforms-page-indicator").length&&0!==l.length&&(o=l),t.each(function(){var e=p(this);let t=0;for(var r=e[0].files.length;t{errorMsg}