View file File name : stripe-button.2acbca466dfeb9585680.bundle.min.js Content :/*! elementor-pro - v3.21.0 - 20-05-2024 */ "use strict";(self.webpackChunkelementor_pro=self.webpackChunkelementor_pro||[]).push([[156],{7121:(e,t,r)=>{var s=r(3203);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=s(r(1699));class StripeHandler extends elementorModules.frontend.handlers.Base{getDefaultSettings(){return{selectors:{form:".elementor-stripe-form",errors:".elementor-message-danger"}}}getDefaultElements(){const e=this.getSettings();return{form:this.$element[0].querySelector(e.selectors.form),errors:this.$element[0].querySelectorAll(e.selectors.errors),post_id:this.$element.closest("[data-elementor-id]").attr("data-elementor-id")}}handleSubmit(e){if(e.preventDefault(),elementorFrontend.isEditMode())return;""!==this.elements.errors.innerHTML&&document.querySelectorAll(".elementor-stripe-error-message").forEach((e=>e.remove()));const t=this.elements.form,r=new FormData(t),s=r.get("url"),n=r.get("action"),l=parseInt(this.elements.post_id),a=r.get("widget_id"),m=r.get("custom_error_msg"),i=r.get("custom_error_msg_global"),d=r.get("custom_error_msg_payment"),c=r.get("stripe_form_submit_nonce"),u=document.URL,g="yes"===r.get("open_in_new_window")?"_blank":"_self",createErrorContainer=e=>{const r=document.createElement("div"),s=t.appendChild(r);s.className="elementor-message elementor-stripe-error-message elementor-message-danger",s.innerHTML=`${o.default.sanitize(e)}`},p={action:n,postId:l,widgetId:a,pageUrl:u,nonce:c};0<this.elements.errors.length?this.elements.errors.forEach((e=>{e.classList.remove("elementor-hidden")})):jQuery.post(s,{action:n,data:p}).done((e=>{const t=e.response.code,r=e.body&&JSON.parse(e.body);switch(t){case 200:window.open(r.url,g);break;case 401:case 403:createErrorContainer(m?d:r.error.message);break;default:createErrorContainer(m?i:r.error.message)}})).fail((()=>{createErrorContainer(m?i:result.error.message)}))}bindEvents(){this.elements.form.addEventListener("submit",(e=>this.handleSubmit(e)))}}t.default=StripeHandler}}]);