(()=>{vare,t,n,r;functiono(e,t,n){returntine?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}newfunctione(t,n){varr=this;!function(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}(this,e),o(this,"setupStripe",(function(){returnr.stripe=Stripe(r.key),r.stripeConnect&&(r.stripe.stripeAccount=r.stripeConnect),r})),o(this,"handle",(function(){vare={type:"alipay",amount:document.querySelector('meta[name="amount"]').content,currency:document.querySelector('meta[name="currency"]').content,redirect:{return_url:document.querySelector('meta[name="return-url"]').content}};document.getElementById("pay-now").addEventListener("click",(function(t){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),r.stripe.createSource(e).then((function(e){if(e.hasOwnProperty("source"))returnwindow.location=e.source.redirect.url;document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.errors.textContent="",this.errors.textContent=e.error.message,this.errors.hidden=!1}))}))})),this.key=t,this.stripeConnect=n,this.errors=document.getElementById("errors")}(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void0===t?void0:t.content)&&void0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void0===r?void0:r.content)&&void0!==n?n:"").setupStripe().handle()})();