"+n.settings.loader_label+"
"),n.focus_to_element(i),i.removeAttr("aria-hidden").prop("tabindex","-1").removeClass("forminator-success forminator-error").addClass("forminator-loading forminator-show")),n._form.find("button").attr("disabled",!0)},success:function(t){var e,r;!0===t.success?void 0!==t.data?(e=void 0!==t.data.paymentid,r=void 0!==t.data.paymentPlan,e&&(n.$el.find("#forminator-stripe-paymentid").val(t.data.paymentid),n.$el.find("#forminator-stripe-paymentmethod").val(n._stripeData.paymentMethod),n._stripeData.paymentid=t.data.paymentid,n._stripeData.secret=t.data.paymentsecret,n.intent)&&n.mountStripeField(t.data.paymentsecret),t.data.paymentmethod_failed&&n.$el.find("#forminator-stripe-paymentmethod").val(""),r&&(n._stripeData.paymentPlan=t.data.paymentPlan),n.intent?n.unfrozeForm(i):n.handlePayment()):n.show_error("Invalid Payment Intent ID"):n.intent?(void 0!==t.data.paymentPlan&&(n._stripeData.paymentPlan=t.data.paymentPlan),n.unfrozeForm(i)):(n.show_error(t.data.message),t.data.errors.length&&n.show_messages(t.data.errors),(e=n._form.find(".forminator-g-recaptcha")).length&&(r=(e=s(e.get(0))).data("forminator-recapchta-widget"),"invisible"===e.data("size"))&&l.grecaptcha.reset(r))},error:function(t){t=400===t.status?l.ForminatorFront.cform.upload_error:l.ForminatorFront.cform.error;n.show_error(t)}}).always(function(){n.intent||n.$el.find("#forminator-stripe-paymentmethod").val(""),n._paymentElement||n.mountStripeField()})},show_error:function(t){var e=this._form.find(".forminator-response-message");e.html(""+t+"
"),this.unfrozeForm(e)},unfrozeForm:function(t){this._form.find("button").removeAttr("disabled"),this.intent||(t.removeAttr("aria-hidden").prop("tabindex","-1").removeClass("forminator-loading forminator-accessible").addClass("forminator-error forminator-show"),this.focus_to_element(t)),this.enable_form()},enable_form:function(){var t;void 0!==this.settings.has_loader&&this.settings.has_loader&&(t=this._form.find(".forminator-response-message"),this._form.removeClass("forminator-fields-disabled"),t.removeClass("forminator-loading"))},focus_to_element:function(t){t.show(),s("html,body").animate({scrollTop:t.offset().top-(s(l).height()-t.outerHeight(!0))/2},500,function(){t.attr("tabindex")||t.attr("tabindex",-1),t.focus()})},show_messages:function(t){var i,o=this,a=o.$el.data("forminatorFrontCondition");return void 0!==a&&(this.$el.find(".forminator-error-message").remove(),i=0,t.forEach(function(t){var e,r,n=Object.keys(t),t=Object.values(t),n=a.get_form_field(n);n.length&&(0===i&&(o.$el.trigger("forminator.front.pagination.focus.input",[n]),o.focus_to_element(n)),s(n).hasClass("forminator-input-time")&&(0===(r=(e=s(n).closest(".forminator-field:not(.forminator-field--inner)")).children(".forminator-error-message")).length&&(e.append(''),r=e.children(".forminator-error-message")),r.html(t)),0===(r=(e=0===(e=s(n).closest(".forminator-field--inner")).length&&0===(e=s(n).closest(".forminator-field")).length&&1<(e=s(n).find(".forminator-field")).length?e.first():e).find(".forminator-error-message")).length&&(e.append(''),r=e.find(".forminator-error-message")),s(n).attr("aria-invalid","true"),r.html(t),e.addClass("forminator-has_error"),i++)})),this},isRelevantField:function(t,e,r,n,i){return!t||(t=s(t.target).attr("name"),!!e&&(r&&t===r||n&&t===n||e&&(t===e||t.startsWith(e+"-"))||i&&(t===i||t.startsWith(i+"-"))))},updateBillingDetails:function(t){if(!this.getStripeData("billing")||!this._paymentElement)return!0;var e=this.getStripeData("billingName"),r=this.getStripeData("billingEmail"),n=this.getStripeData("billingPhone"),i=this.getStripeData("billingAddress"),o={};if(!this.isRelevantField(t,e,r,n,i))return!0;t=this.get_field_value(e)," "!==(t=t||(this.get_field_value(e+"-first-name")||"")+" "+(this.get_field_value(e+"-last-name")||""))&&(o.name=t),e=this.get_field_value(r)||"",e&&(o.email=e),t=this.get_field_value(n)||"",t&&(o.phone=t),r={},e=this.get_field_value(i+"-street_address")||"",e&&(r.line1=e),n=this.get_field_value(i+"-address_line")||"",n&&(r.line2=n),t=this.get_field_value(i+"-city")||"",t&&(r.city=t),e=this.get_field_value(i+"-state")||"";e&&(r.state=e);n=this.get_form_field(i+"-country").find(":selected").data("country-code"),n&&(r.country=n),t=this.get_field_value(i+"-zip")||"";t&&(r.postal_code=t),Object.keys(r).length&&(o.address=r),Object.keys(o).length&&(this.billingDetails=o,this._paymentElement.update({defaultValues:{billingDetails:o}}))},handlePayment:function(){var t=s(".forminator-number--field, .forminator-currency, .forminator-calculation");t.inputmask&&t.inputmask("remove"),this._beforeSubmitCallback&&this._beforeSubmitCallback.call()},mountStripeField:function(t=null){"subscription"===t&&(t=null),this._paymentElement&&this._paymentElement.unmount();var e=this.getStripeData("fieldId"),r=this.getStripeData("key"),n={...this.getStripeData("paymentOptions")};if(null===r)return!1;this._stripe=Stripe(r);var r={...this.getStripeData("elementsOptions")},i=(t?(delete r.paymentMethodTypes,r.clientSecret=t):(r.mode="setup",r.currency=this.getStripeData("currency")||"usd"),this._elements=this._stripe.elements(r),this._paymentElement=this._elements.create("payment",n),this._paymentElement.mount("#payment-element-"+e),this);this._paymentElement.on("ready",function(t){i.updateBillingDetails()})},hideCardError:function(){var t=this.$el.find(".forminator-card-message"),e=t.find(".forminator-error-message");0===e.length&&(t.append(''),e=t.find(".forminator-error-message")),t.closest(".forminator-field").removeClass("forminator-has_error"),e.html("")},showCardError:function(t,e){var r=this.$el.find(".forminator-card-message"),n=r.find(".forminator-error-message");0===n.length&&(r.append(''),n=r.find(".forminator-error-message")),r.closest(".forminator-field").addClass("forminator-has_error"),r.closest(".forminator-field").addClass("forminator-is_filled"),n.html(t),e&&this.focus_to_element(r.closest(".forminator-field"))},getStripeData:function(t){return void 0!==this._stripeData&&void 0!==this._stripeData[t]?this._stripeData[t]:null},getObjectValue:function(t,e){return void 0!==t[e]?t[e]:null},get_form_field:function(t){var e=this.$el.find("#"+t+"-field");return e=0===e.length&&t&&0===(e=this.$el.find("input[name="+t+"]")).length&&0===(e=this.$el.find("textarea[name="+t+"]")).length&&0===(e=this.$el.find('input[name="'+t+'[]"]')).length&&0===(e=this.$el.find('select[name="'+t+'"]')).length&&0===(e=this.$el.find('select[name="'+t+'[]"]')).length?this.$el.find("#"+t):e},get_field_value:function(t){var t=this.get_form_field(t),e="",r=null;return this.field_is_radio(t)?(r=t.filter(":checked")).length&&(e=r.val()):this.field_is_checkbox(t)?t.each(function(){s(this).is(":checked")&&(e=s(this).val())}):e=!this.field_is_select(t)&&this.field_has_inputMask(t)?parseFloat(t.inputmask("unmaskedvalue")):t.val(),e},field_has_inputMask:function(t){var e=!1;return t.each(function(){if(void 0!==s(this).attr("data-inputmask"))return!(e=!0)}),e},field_is_radio:function(t){var e=!1;return t.each(function(){if("radio"===s(this).attr("type"))return!(e=!0)}),e},field_is_checkbox:function(t){var e=!1;return t.each(function(){if("checkbox"===s(this).attr("type"))return!(e=!0)}),e},field_is_select:function(t){return t.is("select")}}),s.fn[r]=function(t){return this.each(function(){s.data(this,r)||s.data(this,r,new e(this,t))})}}(jQuery,window,document),function(l,s,f){"use strict";var r="forminatorFront",n={form_type:"custom-form",rules:{},messages:{},conditions:{},inline_validation:!1,print_value:!1,chart_design:"bar",chart_options:{},forminator_fields:[],general_messages:{calculation_error:"Failed to calculate field.",payment_require_ssl_error:"SSL required to submit this form, please check your URL.",payment_require_amount_error:"PayPal amount must be greater than 0.",form_has_error:"Please correct the errors before submission."},payment_require_ssl:!1};function e(t,e){this.element=t,this.$el=l(this.element),this.forminator_selector="#"+l(this.element).attr("id")+'[data-forminator-render="'+l(this.element).data("forminator-render")+'"]',this.forminator_loader_selector='div[data-forminator-render="'+l(this.element).data("forminator-render")+'"][data-form="'+l(this.element).attr("id")+'"]',this.settings=l.extend({},n,e),void 0!==this.settings.messages&&(this.settings.messages=this.maybeParseStringToJson(this.settings.messages,"object")),void 0!==this.settings.rules&&(this.settings.rules=this.maybeParseStringToJson(this.settings.rules,"object")),void 0!==this.settings.calendar&&(this.settings.calendar=this.maybeParseStringToJson(this.settings.calendar,"array")),this._defaults=n,this._name=r,this.form_id=0,this.template_type="",this.init(),this.handleDiviPopup()}function t(){l(".forminator-custom-form").find(".forminator-label").on("click",function(t){t.preventDefault();t=l(this);t.next("#"+t.attr("for")).focus()})}l.extend(e.prototype,{init:function(){var e=this;switch(0