File "stripe-button.61d93594d6b7865f8b3f.bundle.min.js"

Full Path: /home/rrterraplen/public_html/wp-content-20241221212636/plugins/elementor-pro/assets/js/stripe-button.61d93594d6b7865f8b3f.bundle.min.js
File size: 1.97 KB
MIME-type: text/plain
Charset: utf-8

/*! elementor-pro - v3.26.0 - 17-12-2024 */
"use strict";(self.webpackChunkelementor_pro=self.webpackChunkelementor_pro||[]).push([[857],{9036:(e,t,r)=>{var s=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=s(r(1234));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}}]);