(()=>{functione(e,n){for(vart=0;t<n.length;t++){varo=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"ino&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}varn=function(){functionn(){!function(e,n){if(!(einstanceofn))thrownewTypeError("Cannot call a class as a function")}(this,n)}vart,o,r;returnt=n,(o=[{key:"initializeWePay",value:function(){vare,n=null===(e=document.querySelector('meta[name="wepay-environment"]'))||void0===e?void0:e.content;returnWePay.set_endpoint("staging"===n?"stage":"production"),this}},{key:"showBankPopup",value:function(){vare,n;WePay.bank_account.create({client_id:null===(e=document.querySelector("meta[name=wepay-client-id]"))||void0===e?void0:e.content,email:null===(n=document.querySelector("meta[name=contact-email]"))||void0===n?void0:n.content,options:{avoidMicrodeposits:!0}},(function(e){e.error?(errors.textContent="",errors.textContent=e.error_description,errors.hidden=!1):(document.querySelector('input[name="bank_account_id"]').value=e.bank_account_id,document.getElementById("server_response").submit())}),(function(e){e.error&&(errors.textContent="",errors.textContent=e.error_description,errors.hidden=!1)}))}},{key:"handle",value:function(){this.initializeWePay().showBankPopup()}}])&&e(t.prototype,o),r&&e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),n}();document.addEventListener("DOMContentLoaded",(function(){(newn).handle()}))})();