(()=>{functione(e,t){for(varn=0;n<t.length;n++){vara=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"ina&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}functiont(e,t,n){returntine?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}varn=function(){functionn(e,a){varr=this;!function(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}(this,n),t(this,"handleAuthorization",(function(){vare=$("#my-card"),t={};t.clientKey=r.publicKey,t.apiLoginID=r.loginId;varn={};n.cardNumber=e.CardJs("cardNumber").replace(/[^\d]/g,""),n.month=e.CardJs("expiryMonth").replace(/[^\d]/g,""),n.year=e.CardJs("expiryYear").replace(/[^\d]/g,""),n.cardCode=document.getElementById("cvv").value.replace(/[^\d]/g,"");vara={};returna.authData=t,a.cardData=n,document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),Accept.dispatchData(a,r.responseHandler),!1})),t(this,"responseHandler",(function(e){if("Error"===e.messages.resultCode){$("#errors").show().html("<p>"+e.messages.message[0].code+": "+e.messages.message[0].text+"</p>"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}elseif("Ok"===e.messages.resultCode){document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue;vart=document.querySelector("input[name=token-billing-checkbox]:checked");t&&(document.getElementById("store_card").value=t.value),document.getElementById("server_response").submit()}return!1})),t(this,"handle",(function(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){returne.addEventListener("click",(function(e){document.getElementById("save-card--container").style.display="none",document.getElementById("authorize--credit-card-container").style.display="none",document.getElementById("token").value=e.target.dataset.token}))}));vare=document.getElementById("toggle-payment-with-credit-card");e&&e.addEventListener("click",(function(){document.getElementById("save-card--container").style.display="grid",document.getElementById("authorize--credit-card-container").style.display="flex",document.getElementById("token").value=null}));vart=document.getElementById("pay-now");returnt&&t.addEventListener("click",(function(e){vart=document.getElementById("token");t.value?r.handlePayNowAction(t.value):r.handleAuthorization()})),r})),this.publicKey=e,this.loginId=a,this.cardHolderName=document.getElementById("cardholder_name")}vara,r,o;returna=n,(r=[{key:"handlePayNowAction",value:function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),document.getElementById("token").value=e,document.getElementById("server_response").submit()}}])&&e(a.prototype,r),o&&e(a,o),Object.defineProperty(a,"prototype",{writable:!1}),n}();newn(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()})();