/*! For license information please see eway-credit-card.js.LICENSE.txt */ !function(e){var r={};function t(s){if(r[s])return r[s].exports;var o=r[s]={i:s,l:!1,exports:{}};return e[s].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,s){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:s})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(t.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(s,o,function(r){return e[r]}.bind(null,o));return s},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="/",t(t.s=21)}({21:function(e,r,t){e.exports=t("7VQy")},"7VQy":function(e,r){function t(e,r){for(var t=0;t")})),document.getElementById("errors").innerHTML=s,document.getElementById("errors").hidden=!1}},{key:"completeAuthorization",value:function(e){e.target.parentElement.disabled=!0,document.getElementById("server-response").submit()}},{key:"completePaymentUsingToken",value:function(e){e.target.parentElement.disabled=!0,document.getElementById("server-response").submit()}},{key:"completePaymentWithoutToken",value:function(e){e.target.parentElement.disabled=!0;var r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.value),document.getElementById("server-response").submit()}},{key:"initialize",value:function(){var e=this;this.eWAY=eWAY.setupSecureField(this.groupFieldConfig,(function(r){return e.securePanelCallback(r)}))}},{key:"handle",value:function(){var e,r,t=this;this.initialize(),null===(e=document.getElementById("authorize-card"))||void 0===e||e.addEventListener("click",(function(e){return t.completeAuthorization(e)})),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("eway-secure-panel").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token,document.getElementById("pay-now").disabled=!1}))})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",(function(e){document.getElementById("eway-secure-panel").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",document.getElementById("pay-now").disabled=!0})),null===(r=document.getElementById("pay-now"))||void 0===r||r.addEventListener("click",(function(e){return document.querySelector("input[name=token]").value?t.completePaymentUsingToken(e):t.completePaymentWithoutToken(e)}))}}])&&t(r.prototype,s),o&&t(r,o),e}())).handle()}});