(()=>{vare,t,n,o,r,i;functiona(e){returna="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(e){returntypeofe}:function(e){returne&&"function"==typeofSymbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeofe},a(e)}functionu(e,t){for(varn=0;n<t.length;n++){varo=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"ino&&(o.writable=!0),Object.defineProperty(e,d(o.key),o)}}functionc(e,t,n){returnt&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}functionl(e,t,n){return(t=d(t))ine?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}functiond(e){vart=function(e,t){if("object"!==a(e)||null===e)returne;varn=e[Symbol.toPrimitive];if(void0!==n){varo=n.call(e,t||"default");if("object"!==a(o))returno;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===a(t)?t:String(t)}vars=c((functione(t,n){varo=this;!function(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}(this,e),l(this,"setupStripe",(function(){returno.stripeConnect?o.stripe=Stripe(o.key,{stripeAccount:o.stripeConnect}):o.stripe=Stripe(o.key),o})),l(this,"payment_data",void0),l(this,"handle",(function(){o.onlyAuthorization?document.getElementById("authorize-bacs").addEventListener("click",(function(e){document.getElementById("authorize-bacs").disabled=!0,document.querySelector("#authorize-bacs > svg").classList.remove("hidden"),document.querySelector("#authorize-bacs > span").classList.add("hidden"),location.href=document.querySelector("meta[name=stripe-redirect-url]").content})):(o.payNowButton=document.getElementById("pay-now"),document.getElementById("pay-now").addEventListener("click",(function(e){o.payNowButton.disabled=!0,o.payNowButton.querySelector("svg").classList.remove("hidden"),o.payNowButton.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()})),o.payment_data=Array.from(document.getElementsByClassName("toggle-payment-with-token")),o.payment_data.length>0?o.payment_data.forEach((function(e){returne.addEventListener("click",(function(e){document.querySelector("input[name=token]").value=e.target.dataset.token}))})):(o.errors.textContent=document.querySelector("meta[name=translation-payment-method-required]").content,o.errors.hidden=!1,o.payNowButton.disabled=!0,o.payNowButton.querySelector("span").classList.remove("hidden"),o.payNowButton.querySelector("svg").classList.add("hidden")))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n,this.onlyAuthorization=p})),y=null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void0===t?void0:t.content)&&void0!==e?e:"",m=null!==(n=null===(o=document.querySelector('meta[name="stripe-account-id"]'))||void0===o?void0:o.content)&&void0!==n?n:"",p=null!==(r=null===(i=document.querySelector('meta[name="only-authorization"]'))||void0===i?void0:i.content)&&void0!==r?r:"";news(y,m).setupStripe().handle()})();