function setupSpammerCheck(){function r(){n++;n>=i&&window.clearInterval(t);isSpammer()&&(document.querySelector(".g-recaptcha").remove(),document.querySelector(".efund-recaptcha-wrapper").classList.add("captcha-blocked"),window.clearInterval(t))}let n=0,i=10,t=window.setInterval(r,1e3)}function isHeroShotMultiPanel(){return document.getElementById("panelAmount")}function resetSubmit(n){const t=document.getElementById("mainSubmit");document.getElementById("disableDonations")||(t.disabled=!1);getBrowser()==="Edge"?t.style.display="block":t.querySelector(".btn-text").style.display="block";n.querySelector(".btn-spinner").classList.remove("show-spinner")}function preventDoubleSubmit(n){const t=n.querySelector("#mainSubmit");t.disabled=!0;getBrowser()==="Internet Explorer"||getBrowser()==="Edge"?t.style.display="none":t.querySelector(".btn-text").style.display="none";n.querySelector(".btn-spinner").classList.add("show-spinner")}function popupPreventDoubleSubmit(n){n.querySelector('input[type="submit"]')&&(n.querySelector('input[type="submit"]').disabled=!0);n.querySelector('button[type="submit"]')&&(n.querySelector('button[type="submit"]').disabled=!0);n.querySelector(".popup-spinner").classList.add("show-spinner")}function popupResetSubmit(n){n.querySelector('input[type="submit"]').disabled=!1;n.querySelector(".popup-spinner").classList.remove("show-spinner")}function panelPreventDoubleSubmit(n){let t=n.closest(".panel");t&&(t.querySelectorAll(".reload-btn").forEach(n=>{n.disabled=!0}),t.querySelectorAll(".dash-btn").forEach(n=>{n.disabled=!0}),t.querySelector(".popup-spinner").classList.add("show-spinner"))}function changeModalView(n){const t=n.slice(1);let i=document.getElementById(t),r=document.querySelectorAll(".popup-view-container");r.forEach(n=>{n.classList.remove("show")});i.classList.add("show")}function createResendConfirmEmailSubmit(){document.getElementById("ResendConfirmEmailForm")&&document.getElementById("ResendConfirmEmailForm").addEventListener("submit",function(n){n.preventDefault();let t=serializeForm(this),i=this.action;popupPreventDoubleSubmit(this.closest(".efund-modal"));fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}).then(n=>n.text().then(function(n){document.getElementById("resendConfirmEmail-popup").innerHTML=n;createForgotPasswordSubmit();popupResetSubmit(document.getElementById("resendConfirmEmail-popup").closest(".efund-modal"))})).catch(n=>{console.log(n)})})}function createForgotPasswordSubmit(){document.getElementById("ForgotPasswordForm")&&document.getElementById("ForgotPasswordForm").addEventListener("submit",function(n){n.preventDefault();let t=serializeForm(this),i=this.action;popupPreventDoubleSubmit(this.closest(".efund-modal"));fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}).then(n=>n.text().then(function(n){document.getElementById("forgotPassword-popup").innerHTML=n;createForgotPasswordSubmit();popupResetSubmit(document.getElementById("forgotPassword-popup").closest(".efund-modal"))})).catch(n=>{console.log(n)})})}function setupSelectedPaymentOption(n){document.querySelectorAll(".efund_PaymentOptionItem").forEach(t=>{const i=n.value;i&&i!="0"&&parseFloat(i)===parseFloat(t.getAttribute("data-amount"))&&(document.querySelectorAll(".efund_PaymentOptionItem").forEach(n=>{n.classList.remove("selectedOption")}),t.classList.add("selectedOption"),document.getElementById("OtherAmount").value="",document.getElementById("OtherAmount").parentNode.querySelector("label").classList.remove("moveUp"),document.getElementById("CoverFee")&&updateCoverFeeLabel(n.value))})}function setupSelectedOtherAmount(){if(document.getElementById("OtherAmount")){const n=document.getElementById("OtherAmount").value;n&&n!="0"&&document.querySelectorAll(".efund_PaymentOptionItem").forEach(n=>{n.classList.remove("selectedOption")})}}function addModalLock(){let n=bootstrap.Modal;n.Default.locked=!1;let t=n.prototype.hide;n.prototype.lock=function(){this._config.locked=!0};n.prototype.unlock=function(){this._config.locked=!1};n.prototype.hide=function(){this._config.locked||t.apply(this,arguments)}}function resetFieldAndLabel(n){n.value="";n.classList.remove("valid");n.parentNode.querySelector("label").classList.remove("moveUp")}function resetFieldToSpecificValue(n,t){n.value=t;n.classList.remove("valid")}function moveLabelUp(n){let t=n.value.trim();if(t.length>0){let t=n.parentNode.querySelector("label");t&&t.getAttribute("for")===n.getAttribute("id")&&t.classList.add("moveUp")}}function moveAllLabelsUp(){document.querySelectorAll("textarea.form-control, input.form-control").forEach(n=>{moveLabelUp(n)})}function handleCompanyClick(){document.getElementById("panelFirstLastName").style.display="none";document.getElementById("panelOtherName")&&(document.getElementById("panelOtherName").style.display="none");document.getElementById("panelEmployOcc")&&(document.getElementById("panelEmployOcc").style.display="none");document.getElementById("panelOtherEmployer")&&(document.getElementById("panelOtherEmployer").style.display="none");document.getElementById("panelEmployerLocation")&&(document.getElementById("panelEmployerLocation").style.display="none");document.getElementById("panelEmployerLocationOther")&&(document.getElementById("panelEmployerLocationOther").style.display="none");fadeIn(document.getElementById("panelCompanyName"),"fast");document.querySelector(".two-contributor-title")&&document.querySelectorAll(".two-contributor-title").forEach(n=>{n.style.display="none"});document.getElementById("CompanyDonation").value="t";document.getElementById("SecondDonation")&&(document.getElementById("SecondDonation").value="f");document.getElementById("btnCompany").disabled=!0;document.getElementById("btnPersonal").disabled=!1;document.getElementById("btnSecond")&&(document.getElementById("btnSecond").disabled=!1);document.getElementById("NameFirst").required=!1;document.getElementById("NameLast").required=!1;document.getElementById("NameCompany").required=!0;document.getElementById("NameFirstOther")&&(document.getElementById("NameFirstOther").required=!1);document.getElementById("NameLastOther")&&(document.getElementById("NameLastOther").required=!1);document.getElementById("CompanyType")&&(document.getElementById("CompanyType").required=!0,updatePAC_IDRequirement(!0));document.getElementById("AuthAgentFirstName")&&updateAuthAgentRequirement(!0);document.getElementById("CompanyDisclaimerAgree")&&(document.getElementById("CompanyDisclaimerAgree").required=!0);setEmploymentRequired(!1);setEmploymentOtherRequired(!1);document.getElementById("CCAddressDifferent").textContent="My credit card address is different than my business address.";document.getElementById("AddressTitle")&&(document.getElementById("AddressTitle").textContent="Company address");updateMaxAmountAndValidations();document.getElementById("CoverFee")&&validateCoverFee();handleHeroShotMaxAmountValidation();checkCoupleDecimalAmountValidation(document.getElementById("Amount").value)}function handleIndividualClick(){fadeIn(document.getElementById("panelFirstLastName"),"fast");document.getElementById("panelOtherName")&&(document.getElementById("panelOtherName").style.display="none");document.getElementById("panelEmployOcc")&&fadeIn(document.getElementById("panelEmployOcc"),"fast");document.getElementById("panelEmployerLocation")&&fadeIn(document.getElementById("panelEmployerLocation"),"fast");document.getElementById("panelOtherEmployer")&&(document.getElementById("panelOtherEmployer").style.display="none");document.getElementById("panelEmployerLocationOther")&&(document.getElementById("panelEmployerLocationOther").style.display="none");document.getElementById("panelCompanyName")&&(document.getElementById("panelCompanyName").style.display="none");document.querySelector(".two-contributor-title")&&document.querySelectorAll(".two-contributor-title").forEach(n=>{n.style.display="none"});document.getElementById("CompanyDonation")&&(document.getElementById("CompanyDonation").value="f");document.getElementById("SecondDonation")&&(document.getElementById("SecondDonation").value="f");document.getElementById("btnCompany")&&(document.getElementById("btnCompany").disabled=!1);document.getElementById("btnSecond")&&(document.getElementById("btnSecond").disabled=!1);document.getElementById("NameCompany")&&(document.getElementById("NameCompany").required=!1);document.getElementById("NameFirstOther")&&(document.getElementById("NameFirstOther").required=!1);document.getElementById("NameLastOther")&&(document.getElementById("NameLastOther").required=!1);document.getElementById("CompanyType")&&(document.getElementById("CompanyType").required=!1,updatePAC_IDRequirement(!1));document.getElementById("AuthAgentFirstName")&&updateAuthAgentRequirement(!1);document.getElementById("CompanyDisclaimerAgree")&&(document.getElementById("CompanyDisclaimerAgree").required=!1);document.getElementById("btnPersonal")&&(document.getElementById("btnPersonal").disabled=!0);document.getElementById("NameFirst")&&(document.getElementById("NameFirst").required=!0);document.getElementById("NameLast")&&(document.getElementById("NameLast").required=!0);document.getElementById("CCAddressDifferent")&&(document.getElementById("CCAddressDifferent").textContent="My credit card address is different than my home address.");isOccupationRequired()?setEmploymentRequired(!0):setEmploymentRequired(!1);setEmploymentOtherRequired(!1);document.getElementById("hdnAddressTitle")&&document.getElementById("AddressTitle")&&(document.getElementById("AddressTitle").textContent=document.getElementById("hdnAddressTitle").value);updateMaxAmountAndValidations();document.getElementById("CoverFee")&&validateCoverFee();handleHeroShotMaxAmountValidation();checkCoupleDecimalAmountValidation(document.getElementById("Amount").value)}function updateAuthAgentRequirement(n){let i=document.getElementById("AuthAgentLastName"),r=document.getElementById("AuthAgentFirstName"),t=document.getElementById("ResponsibleOfficerTitle");if(i&&r){let u=document.getElementById("panelAuthAgentCondition").textContent.trim();if(u==="LLC"){let f=document.getElementById("CompanyType"),u=!0;f&&(u=f.value==="LLC");i.required=u&&n;r.required=u&&n;t&&(t.required=u&&n);n&&(u?(fadeIn(document.getElementById("panelAuthAgent"),"fast"),t&&fadeIn(document.getElementById("panelAuthAgentTitle"),"fast")):(fadeOut(document.getElementById("panelAuthAgent"),"fast"),t&&fadeOut(document.getElementById("panelAuthAgentTitle"),"fast")))}else i.required=n,r.required=n,t&&(t.required=n)}}function updatePAC_IDRequirement(n){let t=document.getElementById("PAC_ID");if(t){let r=document.getElementById("CompanyType"),i=!0;r&&(i=r.value==="PAC");t.required=i&&n;n&&(i?(fadeIn(document.getElementById("panelPAC_ID"),"fast"),fadeIn(t,"fast")):(fadeOut(document.getElementById("panelPAC_ID"),"fast"),fadeOut(t,"fast")))}}function isOccupationRequired(){return document.getElementById("Occupation")&&isEmploymentPanelVisible()&&doesAmountExceedOccupationMin()}function isEmploymentPanelVisible(){return document.getElementById("panelEmployOcc")&&getComputedStyle(document.getElementById("panelEmployOcc")).getPropertyValue("display")!=="none"}function doesAmountExceedOccupationMin(){return getTotalWithIterations()>=getOccupationMin()}function getOccupationMin(){return document.getElementById("Occupation").hasAttribute("requireamount")?parseFloat(document.getElementById("Occupation").getAttribute("requireamount")):0}function handleCoupleClick(){document.getElementById("panelEmployOcc")&&fadeIn(document.getElementById("panelEmployOcc"),"fast");document.getElementById("panelOtherEmployer")&&fadeIn(document.getElementById("panelOtherEmployer"),"fast");document.querySelector(".two-contributor-title")&&document.querySelectorAll(".two-contributor-title").forEach(n=>{fadeIn(n,"fast")});document.getElementById("panelCompanyName")&&(document.getElementById("panelCompanyName").style.display="none");document.getElementById("CompanyDonation")&&(document.getElementById("CompanyDonation").value="f");document.getElementById("btnCompany")&&(document.getElementById("btnCompany").disabled=!1);document.getElementById("NameCompany")&&(document.getElementById("NameCompany").required=!1);document.getElementById("CompanyType")&&(document.getElementById("CompanyType").required=!1,updatePAC_IDRequirement(!1));document.getElementById("AuthAgentFirstName")&&updateAuthAgentRequirement(!1);document.getElementById("CompanyDisclaimerAgree")&&(document.getElementById("CompanyDisclaimerAgree").required=!1);fadeIn(document.getElementById("panelFirstLastName"),"fast");fadeIn(document.getElementById("panelOtherName"),"fast");document.getElementById("SecondDonation").value="t";document.getElementById("btnPersonal").disabled=!1;document.getElementById("btnSecond").disabled=!0;document.getElementById("NameFirst").required=!0;document.getElementById("NameLast").required=!0;document.getElementById("NameFirstOther").required=!0;document.getElementById("NameLastOther").required=!0;document.getElementById("CCAddressDifferent").textContent="My credit card address is different than my home address.";isOccupationRequired()?(setEmploymentRequired(!0),setEmploymentOtherRequired(!0)):(setEmploymentRequired(!1),setEmploymentOtherRequired(!1));document.getElementById("hdnAddressTitle")&&document.getElementById("AddressTitle")&&(document.getElementById("AddressTitle").textContent=document.getElementById("hdnAddressTitle").value);updateMaxAmountAndValidations();document.getElementById("CoverFee")&&validateCoverFee();handleHeroShotMaxAmountValidation();checkCoupleDecimalAmountValidation(document.getElementById("Amount").value)}function handleHeroShotMaxAmountValidation(){document.getElementById("amount-error")&&(document.getElementById("amount-error").style.display=doesExceedMaxWithIterations()?"block":"none")}function doesExceedMaxWithIterations(){return getTotalWithIterations()>getAccountMax()}function getTotalWithIterations(){let n=getIterations(),t=parseFloat(document.getElementById("Amount").value);if(document.getElementById("GiveAmount")&&document.getElementById("GiveAmount").value!=""){const i=parseFloat(document.getElementById("GiveAmount").value)||0;return i*(n-1)+t}return t*n}function getIterations(){return document.getElementById("Iterations")?document.getElementById("Iterations").value>1?parseInt(document.getElementById("Iterations").value):1:1}function updateMaxAmountAndValidations(){updateAccountMax();updateMaxMessages();validateOtherAmountMax()}function updateMaxMessages(){let n=getAccountMax().toFixed(2),t=getAccountMin().toFixed(2),i="";if(document.getElementById("coupleMaxOverride")){let i=document.getElementById("trans-validate34").getAttribute("translate-base");if(i!==undefined&&i!==null&&i!==""){let r=i.replace("{data-translate-1}",t).replace("{data-translate-2}",n);document.getElementById("trans-validate34").innerHTML=r}}else{let i=document.getElementById("trans-validate8").getAttribute("translate-base");if(i!==undefined&&i!==null&&i!==""){let r=i.replace("{data-translate-1}",t).replace("{data-translate-2}",n);document.getElementById("trans-validate8").innerHTML=r}}i!=""&&document.getElementById("OtherAmount").setAttribute("title",i);updateMaxMessage(document.getElementById("trans-validate-11"));updateMaxMessage(document.getElementById("trans-validate-21"));updateMaxMessage(document.getElementById("total-amount-max-error"));updateMaxMessage(document.getElementById("cover-fee-error"));updateMaxMessage(document.getElementById("amount-error"))}function updateMaxMessage(n){if(n){let i=getAccountMax().toFixed(2),t=n.getAttribute("translate-base");t!==undefined&&t!==null&&t!==""&&(n.innerHTML=t.replace("{data-translate-1}",i))}}function validateOtherAmountMax(){if(document.querySelector(".efundForm")){let n=document.getElementById("OtherAmount");validateInput(n);updateInputValidationStyle(n);document.getElementById("Amount").dispatchEvent(new Event("change"));document.getElementById("CoverFee")&&validateCoverFee()}}function HideRecurringMessages(){document.getElementById("weeklyMessage")&&(document.getElementById("weeklyMessage").style.display="none");document.getElementById("monthlyMessage")&&(document.getElementById("monthlyMessage").style.display="none");document.getElementById("quarterlyMessage")&&(document.getElementById("quarterlyMessage").style.display="none");document.getElementById("annuallyMessage")&&(document.getElementById("annuallyMessage").style.display="none")}function DisableRecurringOptions(){document.getElementById("btnOneTime")&&(document.getElementById("btnOneTime").disabled=!1);document.getElementById("btnWeekly")&&(document.getElementById("btnWeekly").disabled=!1);document.getElementById("btnMonthly")&&(document.getElementById("btnMonthly").disabled=!1);document.getElementById("btnQuarterly")&&(document.getElementById("btnQuarterly").disabled=!1);document.getElementById("btnAnnually")&&(document.getElementById("btnAnnually").disabled=!1)}function HandleOneTimeClick(){document.querySelectorAll(".efund_RecurringDonation").length>0&&document.querySelectorAll(".efund_RecurringDonation").forEach(n=>{n.style.display="none"});document.getElementById("efund-recurring-instructions")&&(document.getElementById("efund-recurring-instructions").style.display="none");document.getElementById("panelMonthlyDonation")&&(document.getElementById("panelMonthlyDonation").style.display="none");HideRecurringMessages();document.getElementById("Iterations")&&(document.getElementById("Iterations").required=!1,document.getElementById("Iterations").removeAttribute("pattern"),document.getElementById("Iterations").value="1");document.getElementById("RecurringChoice")&&(document.getElementById("RecurringChoice").value="");DisableRecurringOptions();document.getElementById("btnOneTime")&&(document.getElementById("btnOneTime").disabled=!0);document.getElementById("ppNavButton")&&fadeIn(document.getElementById("ppNavButton"),"fast");document.getElementById("btnPayPal")&&enablePayPal();googleAllowed&&toggleGooglePayContainers(!0)}function HandleWeeklyClick(n){HandleRecurringClick(document.getElementById("weeklyMessage"),document.getElementById("btnWeekly"),document.getElementById("trans-weeks").textContent,"Weekly",n)}function HandleMonthlyClick(n){HandleRecurringClick(document.getElementById("monthlyMessage"),document.getElementById("btnMonthly"),document.getElementById("trans-months").textContent,"Monthly",n)}function HandleQuarterlyClick(n){HandleRecurringClick(document.getElementById("quarterlyMessage"),document.getElementById("btnQuarterly"),document.getElementById("trans-quarters").textContent,"Quarterly",n)}function HandleAnnuallyClick(n){HandleRecurringClick(document.getElementById("annuallyMessage"),document.getElementById("btnAnnually"),document.getElementById("trans-years").textContent,"Annually",n)}function HandleRecurringClick(n,t,i,r,u){toggleGooglePayContainers(!1);document.querySelectorAll(".efund_RecurringDonation").forEach(n=>{fadeIn(n,"fast")});document.getElementById("efund-recurring-instructions")&&fadeIn(document.getElementById("efund-recurring-instructions"),"fast");document.getElementById("panelMonthlyDonation")&&fadeIn(document.getElementById("panelMonthlyDonation"),"fast");HideRecurringMessages();fadeIn(n,"fast");document.getElementById("Iterations").required=!0;DisableRecurringOptions();t.disabled=!0;document.getElementById("IterationsLabel").textContent=i;document.getElementById("RecurringChoice").value=r;disableNonRecurringPaymentMethods();document.getElementById("Iterations").getAttribute("continuous-recurring")==="true"?document.getElementById("Iterations").value="1":u&&(document.getElementById("Iterations").value="",document.getElementById("Iterations").classList.remove("valid"))}function SetupRecurring(n){if(document.getElementById("RecurringChoice")){let t=document.getElementById("RecurringChoice");if(t.value!==undefined)if(t.value===""&&document.getElementById("RecurringChoice").getAttribute("force-recurring")==="true"&&(document.getElementById("btnWeekly")?(document.getElementById("RecurringChoice").value="Weekly",document.getElementById("Iterations").value=""):document.getElementById("btnMonthly")?(document.getElementById("RecurringChoice").value="Monthly",document.getElementById("Iterations").value=""):document.getElementById("btnQuarterly")?(document.getElementById("RecurringChoice").value="Quarterly",document.getElementById("Iterations").value=""):document.getElementById("btnAnnually")?(document.getElementById("RecurringChoice").value="Annually",document.getElementById("Iterations").value=""):n&&(document.getElementById("weeklyMessage")?(document.getElementById("RecurringChoice").value="Weekly",document.getElementById("Iterations").value=""):document.getElementById("monthlyMessage")?(document.getElementById("RecurringChoice").value="Monthly",document.getElementById("Iterations").value=""):document.getElementById("quarterlyMessage")?(document.getElementById("RecurringChoice").value="Quarterly",document.getElementById("Iterations").value=""):document.getElementById("annuallyMessage")&&(document.getElementById("RecurringChoice").value="Annually",document.getElementById("Iterations").value=""))),t.value!==""){let n=!0;t.value==="Monthly"?HandleMonthlyClick(n):t.value==="Weekly"?HandleWeeklyClick(n):t.value==="Quarterly"?HandleQuarterlyClick(n):t.value==="Annually"&&HandleAnnuallyClick(n)}else{if(document.querySelector("#efund-recurring-btns input.btn.btn-default")){let n=document.querySelector("#efund-recurring-btns input.btn.btn-default").getAttribute("id");n==="btnOneTime"?HandleOneTimeClick():n==="btnWeekly"?HandleWeeklyClick(!0):n==="btnMonthly"?HandleMonthlyClick(!0):n==="btnQuarterly"?HandleQuarterlyClick(!0):n==="btnAnnually"&&HandleAnnuallyClick(!0)}document.getElementById("btnOneTime")&&document.getElementById("btnOneTime").disabled===!0&&(document.getElementById("Iterations").value="1")}}}function handleCreditCardClick(){document.getElementById("btnVenmo")&&hideVenmoTab();document.getElementById("ACHDonation")&&(document.getElementById("ACHDonation").value="False");document.getElementById("RoutingNumber")&&(document.getElementById("RoutingNumber").required=!1,document.getElementById("RoutingNumber").value="");document.getElementById("AccountNumber")&&(document.getElementById("AccountNumber").required=!1,document.getElementById("AccountNumber").value="");document.getElementById("ApplePayDonation")&&(document.getElementById("ApplePayDonation").value="False");document.getElementById("GooglePayDonation")&&(document.getElementById("GooglePayDonation").value="False");document.getElementById("btnACH")&&validateAndUpdateACHInputs();document.getElementById("ach-opt")&&(document.getElementById("ach-opt").style.display="none");document.getElementById("btnACH")&&(document.getElementById("btnACH").disabled=!1);document.getElementById("ach-error")&&(document.getElementById("ach-error").style.display="none");document.getElementById("CCNumber")&&(document.getElementById("CCNumber").required=!0,document.getElementById("ExpDate").required=!0);document.getElementById("CCSecurity")&&document.getElementById("CCSecurity").getAttribute("rerequire")==="true"&&(document.getElementById("CCSecurity").required=!0);document.getElementById("paypal-tab-content")&&(document.getElementById("paypal-tab-content").style.display="none");document.getElementById("creditcard-opt")&&fadeIn(document.getElementById("creditcard-opt"),"fast");document.getElementById("btnCreditCard")&&(document.getElementById("btnCreditCard").disabled=!0);document.getElementById("btnPayPal")&&(document.getElementById("btnPayPal").disabled=!1);document.getElementById("mainSubmit")&&(document.getElementById("mainSubmit").disabled=document.getElementById("disableDonations")?!0:!1);showRecaptcha()}function handleACHClick(){document.getElementById("btnVenmo")&&hideVenmoTab();document.getElementById("ACHDonation").value="True";document.getElementById("CCNumber").required=!1;document.getElementById("ExpDate").required=!1;document.getElementById("CCSecurity").required=!1;document.getElementById("CCNumber").value="";document.getElementById("ExpDate").value="";document.getElementById("CCSecurity").value="";let n=document.getElementById("CCAddressDifferent");n?.checked&&n.click();document.getElementById("ApplePayDonation")&&(document.getElementById("ApplePayDonation").value="False");document.getElementById("GooglePayDonation")&&(document.getElementById("GooglePayDonation").value="False");document.getElementById("RoutingNumber").required=!0;document.getElementById("AccountNumber").required=!0;document.getElementById("creditcard-opt").style.display="none";validateAndUpdateCreditCardInputs();document.getElementById("paypal-tab-content")&&(document.getElementById("paypal-tab-content").style.display="none");fadeIn(document.getElementById("ach-opt"),"fast");document.getElementById("btnCreditCard")&&(document.getElementById("btnCreditCard").disabled=!1);document.getElementById("btnPayPal")&&(document.getElementById("btnPayPal").disabled=!1);document.getElementById("btnACH")&&(document.getElementById("btnACH").disabled=!0);document.getElementById("mainSubmit").disabled=document.getElementById("disableDonations")?!0:!1;showRecaptcha()}function handlePayPalClick(){document.getElementById("btnVenmo")&&hideVenmoTab();document.getElementById("ACHDonation")&&(document.getElementById("ACHDonation").value="False");document.getElementById("ApplePayDonation")&&(document.getElementById("ApplePayDonation").value="False");document.getElementById("GooglePayDonation")&&(document.getElementById("GooglePayDonation").value="False");document.getElementById("RoutingNumber")&&(document.getElementById("RoutingNumber").required=!1,document.getElementById("RoutingNumber").value="");document.getElementById("AccountNumber")&&(document.getElementById("AccountNumber").required=!1,document.getElementById("AccountNumber").value="");document.getElementById("btnACH")&&validateAndUpdateACHInputs();document.getElementById("ach-opt")&&(document.getElementById("ach-opt").style.display="none");document.getElementById("btnACH")&&(document.getElementById("btnACH").disabled=!1);document.getElementById("CCNumber").required=!1;document.getElementById("ExpDate").required=!1;document.getElementById("CCSecurity").required=!1;document.getElementById("CCNumber").value="";document.getElementById("ExpDate").value="";document.getElementById("CCSecurity").value="";let n=document.getElementById("CCAddressDifferent");n?.checked&&n.click();document.getElementById("creditcard-opt").style.display="none";fadeIn(document.getElementById("paypal-tab-content"),"fast");document.getElementById("btnCreditCard").disabled=!1;document.getElementById("btnPayPal").disabled=!0;document.getElementById("mainSubmit").disabled=!0;document.getElementById("btnPayPal")&&(updatePayPalStatus(),resetPayPalContainer());hideRecaptcha();validateAndUpdateCreditCardInputs();updateFieldErrors()}function handleVenmoClick(){showVenmoTab();document.getElementById("ACHDonation")&&(document.getElementById("ACHDonation").value="False");document.getElementById("ApplePayDonation")&&(document.getElementById("ApplePayDonation").value="False");document.getElementById("GooglePayDonation")&&(document.getElementById("GooglePayDonation").value="False");document.getElementById("RoutingNumber")&&(document.getElementById("RoutingNumber").required=!1,document.getElementById("RoutingNumber").value="");document.getElementById("AccountNumber")&&(document.getElementById("AccountNumber").required=!1,document.getElementById("AccountNumber").value="");document.getElementById("btnACH")&&validateAndUpdateACHInputs();document.getElementById("ach-opt")&&(document.getElementById("ach-opt").style.display="none");document.getElementById("btnACH")&&(document.getElementById("btnACH").disabled=!1);document.getElementById("CCNumber").required=!1;document.getElementById("ExpDate").required=!1;document.getElementById("CCSecurity").required=!1;document.getElementById("CCNumber").value="";document.getElementById("ExpDate").value="";document.getElementById("CCSecurity").value="";let n=document.getElementById("CCAddressDifferent");n?.checked&&n.click();document.getElementById("creditcard-opt").style.display="none";document.getElementById("paypal-tab-content")&&(document.getElementById("paypal-tab-content").style.display="none");document.getElementById("btnCreditCard").disabled=!1;document.getElementById("btnPayPal")&&(document.getElementById("btnPayPal").disabled=!1);document.getElementById("btnACH")&&(document.getElementById("btnACH").disabled=!1);document.getElementById("btnPayPal")&&resetPayPalContainer();hideRecaptcha();validateAndUpdateCreditCardInputs();updateFieldErrors()}function validateAndUpdateACHInputs(){validateAndUpdateInput(document.getElementById("RoutingNumber"));validateAndUpdateInput(document.getElementById("AccountNumber"))}function validateAndUpdateCreditCardInputs(){validateAndUpdateInput(document.getElementById("CCNumber"));validateAndUpdateInput(document.getElementById("ExpDate"));validateAndUpdateInput(document.getElementById("CCSecurity"))}function hideRecaptcha(){document.querySelector(".g-recaptcha")&&(document.querySelector(".g-recaptcha").style.display="none",hideRecaptchaError())}function showRecaptcha(){document.querySelector(".g-recaptcha")&&(document.querySelector(".g-recaptcha").style.display="block")}function disableFormSubmit(){document.getElementById("mainSubmit").disabled=!0}function enableFormSubmit(){document.getElementById("disableDonations")||(document.getElementById("mainSubmit").disabled=!1)}function showVenmoTab(){document.getElementById("btnVenmo").disabled=!0;fadeIn(document.getElementById("venmo-tab-content"),"fast");disableFormSubmit()}function hideVenmoTab(){document.getElementById("btnVenmo").disabled=!1;document.getElementById("venmo-tab-content").style.display="none";enableFormSubmit();resetVenmo()}function resetVenmo(){resetVenmoValues();resetVenmoTabContent()}function resetVenmoValues(){document.getElementById("BraintreeNonce").value="";document.getElementById("VenmoId").value="";document.getElementById("VenmoDonation").value="False"}function resetVenmoTabContent(){document.getElementById("venmo-column").disabled=!1;document.getElementById("venmo-message-error").style.display="none"}function updateDecoyAddress(){document.getElementById("decoy-address")&&(document.getElementById("decoy-address").value=document.getElementById("StreetAddress").value);document.getElementById("apple-decoy-address")&&(document.getElementById("apple-decoy-address").value=document.getElementById("apple-address").value)}function updateRealAddress(){document.getElementById("decoy-address")&&(document.getElementById("StreetAddress").value=document.getElementById("decoy-address").value);document.getElementById("apple-decoy-address")&&(document.getElementById("apple-address").value=document.getElementById("apple-decoy-address").value)}function initAutocomplete(){autocomplete=new google.maps.places.Autocomplete(document.getElementById("decoy-address"),{types:["geocode"]});autocomplete.setFields(["address_components","geometry","icon","name"]);autocomplete.addListener("place_changed",fillInAddress);document.getElementById("decoy-address")&&document.getElementById("decoy-address").setAttribute("placeholder","")}function fillInAddress(){let n=autocomplete.getPlace();document.querySelectorAll(".address-field").forEach(n=>{n.value=""});for(let t of n.address_components){let n=t.types[0];if(googleComponentForm[n]){let i=t[googleComponentForm[n]];document.querySelectorAll(".address-field").forEach(t=>{t.getAttribute("data-address-component")===n&&(t.value=i)})}}let t=n.address_components[0].short_name,i=n.address_components[1].long_name;document.getElementById("decoy-address").value=t+" "+i;document.querySelectorAll(".address-field").forEach(n=>{validateInput(n),updateInputValidationStyle(n)});document.querySelectorAll(".address-field").forEach(n=>{n.closest(".efund-form-group").querySelector(".form-label").classList.add("moveUp")});document.getElementById("Retired")&&document.getElementById("Retired").dispatchEvent(new Event("focus"))}function updateCvvCleave(n,t){return t!=null&&(t.destroy(),t=null),new Cleave("#CCSecurity",{blocks:[n],numericOnly:!0})}function addCleaveToZip(n){replaceMaxlengthWithCleave(n,{blocks:[5],numericOnly:!0})}function replaceMaxlengthWithCleave(n,t){document.getElementById(n)&&(document.getElementById(n).removeAttribute("maxlength"),new Cleave("#"+n,t))}function updatePhoneCleave(n,t){let r="";n.getAttribute("data-old-value")!=undefined&&(r=n.getAttribute("data-old-value"));let i=n.value;if(t!=null&&(i=t.getRawValue()),r.length!=i.length){n.setAttribute("data-old-value",i);const r=t.getRawValue();t!=null&&(t.destroy(),t=null);t=r.length===0||r[0]==="1"||r[0]==="+"?new Cleave("#Phone",{delimiters:[" (",") ","-"],blocks:[1,3,3,4],numericOnly:!0}):new Cleave("#Phone",{delimiters:["(",") ","-"],blocks:[0,3,3,4],numericOnly:!0})}return t}function updateApplePhoneCleave(n,t){let r="";n.getAttribute("data-old-value")!=undefined&&(r=n.getAttribute("data-old-value"));let i=n.value;if(t!=null&&(i=t.getRawValue()),r.length!=i.length){n.setAttribute("data-old-value",i);const r=t.getRawValue();t!=null&&(t.destroy(),t=null);t=r.length===0||r[0]==="1"||r[0]==="+"?new Cleave("#ApplePhone",{delimiters:[" (",") ","-"],blocks:[1,3,3,4],numericOnly:!0}):new Cleave("#ApplePhone",{delimiters:["(",") ","-"],blocks:[0,3,3,4],numericOnly:!0})}return t}function getCvvLengthFromCCNumber(n){return/^3[47]/.test(n)?4:3}function getCCLengthFromCCNumber(n){return/^3[47]/.test(n)?17:19}function showCCIcon(n){let t=n.value.trim().replace(/\D/g,""),i;i=t.length===0?"generic-cc-small":/^3[47]/.test(t)?"amex-cc-small":/^3[089]/.test(t)?"diners-club-cc-small":t.startsWith("4")?"visa-cc-small":/^5[1-5]/.test(t)?"mastercard-cc-small":t.startsWith("6")?"discover-cc-small":"generic-cc-small";n.closest(".efund-form-group")&&n.closest(".efund-form-group").querySelector(".cc-icon img").setAttribute("src","/images/credit-cards/"+i+".png")}function allowDecimalNumber(n,t){if(/\./.test(n.value)||t.keyCode!==190)[46,8,9,27,13,110].indexOf(t.keyCode)!==-1||t.keyCode===65&&(t.ctrlKey===!0||t.metaKey===!0)||t.keyCode>=35&&t.keyCode<=40||(t.shiftKey||t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105)&&t.preventDefault()}function limitTwoDecimal(n){let t=n.value;t&&parseFloat(t)%1!=0&&(n.value=t.match(/^\d+\.?\d{0,2}/)[0])}function clearNumberField(n){(n.value===""||n.value==="0")&&(n.value="")}function updateCoverFeeLabel(n){let t=document.getElementById("RequiredCoverFeeText");if(t){let i=document.getElementById("CoverFee");i.checked||(i.checked=!0,i.dispatchEvent(new Event("change")));let r=document.getElementById("trans-coverfee").textContent;r=r.replace("{data-translate-1}",(addCoverFee(n)-n).toFixed(2));t.innerHTML=r}else{let i=document.getElementById("CoverFee").checked?"":"d-none",t=document.getElementById("trans-checkbox4").textContent;t=i===""?document.getElementById("trans-checkbox5").textContent:n>0?t.replace("{data-translate-1}",(addCoverFee(n)-n).toFixed(2)):t.replace(" (+${data-translate-1})","");document.getElementById("cover-fee-label").innerHTML='<span class="checkbox-button-circle"><i class="fa fa-check '+i+'" aria-hidden="true"><\/i><\/span>'+t}}function updateAccountMax(){const n=document.getElementById("OtherAmount"),t=n.getAttribute("data-individual-max");let i=t;document.getElementById("btnSecond")&&document.getElementById("btnSecond").disabled===!0&&(i=(2*parseFloat(t)).toFixed(2));n.setAttribute("max",i)}function getAccountMax(){return parseFloat(document.getElementById("OtherAmount").getAttribute("max"))}function getAccountMin(){return parseFloat(document.getElementById("OtherAmount").getAttribute("min"))}function addCoverFee(n){let t=(parseFloat(n)+parseFloat(document.getElementById("PerTransaction").value))/(1-.01*parseFloat(document.getElementById("DiscountRate").value));return t.toFixed(2)}function applyFactors(n){return factorCoverFee(n)}function factorCoverFee(n){return document.getElementById("CoverFee")&&document.getElementById("CoverFee").checked&&n>0&&(n=addCoverFee(n)),n}function updateTotalAmount(n){document.getElementById("BaseAmount").value=n;document.getElementById("CoverFee")&&(updateCoverFeeLabel(n),n=factorCoverFee(n),validateCoverFee(n));document.getElementById("Amount").value=n;document.getElementById("Amount").dispatchEvent(new Event("change"));checkCoupleDecimalAmountValidation(document.getElementById("Amount").value);updateSubmitButtonTextWithAmount(document.getElementById("Amount").value)}function updateSubmitButtonTextWithAmount(n){if(parseFloat(n)>0){let t=parseFloat(n).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",");document.querySelector("#mainSubmit .btn-text").textContent=document.getElementById("mainSubmit").value+" $"+t;document.querySelector(".venmo-summary-total-value")&&(document.querySelector(".venmo-summary-total-value").textContent=t)}else document.querySelector("#mainSubmit .btn-text").textContent=document.getElementById("mainSubmit").value,document.querySelector(".venmo-summary-total-value")&&(document.querySelector(".venmo-summary-total-value").textContent="0")}function disableAmountAffectors(){document.getElementById("OtherAmount")&&(document.getElementById("OtherAmount").disabled=!0,document.getElementById("OtherAmountLabel").style.backgroundColor="#EEE");document.querySelectorAll(".efund_PaymentOptionItem").forEach(n=>{n.classList.add("disable-click")});document.querySelectorAll("#efund-recurring-btns .efund_choice").forEach(n=>{n.classList.add("disable-click")});document.querySelectorAll(".qty-field").forEach(n=>{n.classList.add("disable-click")});document.querySelectorAll(".qty-btn").forEach(n=>{n.classList.add("disable-click")});document.getElementById("ticket-tab-btn")&&document.getElementById("ticket-tab-btn").classList.add("disable-click");document.getElementById("contribution-tab-btn")&&document.getElementById("contribution-tab-btn").classList.add("disable-click");document.getElementById("OtherTicketAmount")&&(document.getElementById("OtherTicketAmount").disabled=!0,document.getElementById("OtherTicketAmountLabel").style.backgroundColor="#EEE");document.getElementById("cover-fee-button")&&document.getElementById("cover-fee-button").classList.add("disable-click");document.getElementById("cancel-contribution-btn")&&(document.getElementById("cancel-contribution-btn").style.display="none");document.getElementById("btnCreditCard")&&document.getElementById("btnCreditCard").classList.add("disable-click");document.getElementById("btnACH")&&document.getElementById("btnACH").classList.add("disable-click");document.getElementById("btnPayPal")&&document.getElementById("btnPayPal").classList.add("disable-click")}function disableNonRecurringPaymentMethods(){document.getElementById("paypal-tab-content")&&disablePayPal()}function isACHSelected(){return document.getElementById("ACHDonation").value==="True"}function ACHBraintreeCapture(n){try{let t=document.getElementById("BraintreeClientToken").value;braintree.client.create({authorization:t},function(t,i){if(t){handleACHException(t,n,"ACHBraintreeCapture","braintree.client.create","There was an error creating the Client");return}braintree.usBankAccount.create({client:i},function(t,i){if(t){handleACHException(t,n,"ACHBraintreeCapture","braintree.usBankAccount.create","There was an error creating the USBankAccount instance.");return}let r={accountNumber:document.getElementById("AccountNumber").value,routingNumber:document.getElementById("RoutingNumber").value,accountType:"checking",ownershipType:document.getElementById("CompanyDonation").value==="t"?"business":"personal",billingAddress:{streetAddress:document.getElementById("StreetAddress").value,extendedAddress:"",locality:document.getElementById("City").value,region:document.getElementById("StreetState").value,postalCode:document.getElementById("StreetZip").value}};r.ownershipType==="personal"?(r.firstName=document.getElementById("NameFirst").value,r.lastName=document.getElementById("NameLast").value):r.businessName=document.getElementById("NameCompany").value;i.tokenize({bankDetails:r,mandateText:'By clicking ["Checkout"], I authorize Braintree, a service of PayPal, on behalf of [your business name here] (i) to verify my bank account information using bank information and consumer reports and (ii) to debit my bank account.'},function(t,i){if(t){handleACHException(t,n,"ACHBraintreeCapture","usBankAccountInstance.tokenize","There was an error tokenizing the bank details");return}document.getElementById("BraintreeNonce").value=i.nonce;n(!0)})})})}catch(t){handleACHException(t,n,"ACHBraintreeCapture","catch","An error occurred with ACH")}}function handleACHException(n,t,i,r,u){console.error(u,n);resetSubmit(document.querySelector(".efundForm"));fadeIn(document.getElementById("ach-error"),"fast");t(!1)}function handlePostValidation(n,t){n.getAttribute("id")==="mainSubmit"&&document.getElementById("RoutingNumber")&&isACHSelected()&&document.getElementById("BraintreeNonce").value===""?(t.preventDefault(),preventDoubleSubmit(document.querySelector(".efundForm")),ACHBraintreeCapture(function(t){t&&(resetSubmit(document.querySelector(".efundForm")),n.dispatchEvent(new Event("click")))})):n.getAttribute("id")==="mainSubmit"&&document.getElementById("RoutingNumber")&&isACHSelected()&&(n.closest(".efundForm").submit(),n.disabled=!0,getBrowser()==="Edge"?n.style.display="none":n.querySelector(".btn-text").style.display="none",n.querySelector(".btn-spinner").classList.add("show-spinner"))}function validateInputsFromPaymentInfo(){let n=!0;if(validateInput(document.getElementById("NameFirst"))&&validateInput(document.getElementById("NameLast"))||(document.getElementById("apple-popup-name").style.display="flex",document.getElementById("AppleNameFirst").value=document.getElementById("NameFirst").value,document.getElementById("AppleNameFirst").required=!0,document.getElementById("AppleNameFirst").dispatchEvent(new Event("change")),document.getElementById("AppleNameLast").value=document.getElementById("NameLast").value,document.getElementById("AppleNameLast").required=!0,document.getElementById("AppleNameLast").dispatchEvent(new Event("change")),n=!1),document.getElementById("Phone")&&!validateInput(document.getElementById("Phone"))&&(document.getElementById("apple-popup-phone").style.display="flex",document.getElementById("ApplePhone").value=document.getElementById("Phone").value,document.getElementById("Phone").required&&(document.getElementById("ApplePhone").required=!0),document.getElementById("ApplePhone").dispatchEvent(new Event("change")),n=!1),!validateInput(document.getElementById("StreetAddress"))||!validateInput(document.getElementById("City"))||!validateInput(document.getElementById("StreetState"))||!validateInput(document.getElementById("StreetZip"))){document.getElementById("apple-popup-address").style.display="block";document.getElementById("AppleAddress").value=document.getElementById("StreetAddress").value;document.getElementById("AppleAddress").required=!0;document.getElementById("AppleAddress").dispatchEvent(new Event("change"));document.getElementById("AppleCity").value=document.getElementById("City").value;document.getElementById("AppleCity").required=!0;document.getElementById("AppleCity").dispatchEvent(new Event("change"));let t=document.getElementById("StreetState").value;t||(t=document.getElementById("DefaultState").value);document.getElementById("AppleState").value=t;document.getElementById("AppleState").required=!0;document.getElementById("AppleState").dispatchEvent(new Event("change"));document.getElementById("AppleZip").value=document.getElementById("StreetZip").value;document.getElementById("AppleZip").required=!0;document.getElementById("AppleZip").dispatchEvent(new Event("change"));n=!1}return n}function handleDefaultPayConfirmationClick(n){n.disabled=!0;validateApplePayConfirm()?(document.getElementById("apple-popup-name").style.display=="flex"&&(document.getElementById("NameFirst").value=document.getElementById("AppleNameFirst").value,document.getElementById("NameFirst").dispatchEvent(new Event("change")),document.getElementById("NameLast").value=document.getElementById("AppleNameLast").value,document.getElementById("NameLast").dispatchEvent(new Event("change"))),document.getElementById("apple-popup-phone").style.display=="flex"&&(document.getElementById("Phone").value=document.getElementById("ApplePhone").value,document.getElementById("Phone").dispatchEvent(new Event("change"))),document.getElementById("apple-popup-address").style.display=="block"&&(document.getElementById("StreetAddress").value=document.getElementById("AppleAddress").value,document.getElementById("StreetAddress").dispatchEvent(new Event("change")),document.getElementById("City").value=document.getElementById("AppleCity").value,document.getElementById("City").dispatchEvent(new Event("change")),document.getElementById("StreetState").value=document.getElementById("AppleState").value,document.getElementById("StreetState").dispatchEvent(new Event("change")),document.getElementById("StreetZip").value=document.getElementById("AppleZip").value,document.getElementById("StreetZip").dispatchEvent(new Event("change"))),document.querySelector(".efundForm").submit()):n.disabled=!1}function showPaymentInfoConfirmPopup(){const n=new bootstrap.Modal(document.getElementById("modal-oneclick-container"),{});n.show();changeModalView("#apple-pay-popup")}function toggleDefaultPaymentContainers(n){defaultShown=n;n?(document.getElementById("panelEmployOcc")||fadeOut(document.getElementById("section-personal"),"fast"),document.querySelectorAll(".default-pay-show").forEach(n=>{fadeIn(n,"fast")}),document.querySelectorAll(".default-pay-hide").forEach(n=>{fadeOut(n,"fast")})):(appleShown&&toggleApplePayContainers(!1),googleShown&&toggleGooglePayContainers(!1),document.getElementById("section-personal")&&fadeIn(document.getElementById("section-personal"),"fast"),document.querySelectorAll(".default-pay-show").forEach(n=>{fadeOut(n,"fast")}),document.querySelectorAll(".default-pay-hide").forEach(n=>{fadeIn(n,"fast")}))}async function isApplePayAllowed(){if(document.getElementById("disableDonations"))return!1;let n=document.getElementById("panelMerchant")?.textContent?.trim(),t=document.getElementById("panelPartner")?.textContent?.trim();if(!n||!t)return!1;const i=new URLSearchParams(window.location.search).get("achonly");if(i!="true"&&!isIframe()&&window.ApplePaySession?.supportsVersion(4)){let i=(await window.ApplePaySession.applePayCapabilities(t))?.paymentCredentialStatus;if(n=="V2DKXMZBHML7E")return console.log(i),i!="applePayUnsupported";if(i=="paymentCredentialsAvailable")return!0;if(i=="paymentCredentialStatusUnknown"||i=="paymentCredentialsUnavailable"||i=="applePayUnsupported")return!1}return!1}async function setupApplePay(){if(!await isApplePayAllowed()){toggleApplePayContainers(!1);return}try{let t=paypal.Applepay(),n=await t.config();if(!n.isEligible){toggleApplePayContainers(!1);return}document.querySelector("apple-pay-button").addEventListener("click",async function(){if(document.getElementById("section-amount")&&!validateAmount(document.querySelector(".efundForm"))){document.getElementById("section-amount").scrollIntoView({behavior:"smooth"});return}payWithApplePay(this,n)});toggleApplePayContainers(!0)}catch(n){toggleApplePayContainers(!1);handleApplePayException(n,"payWithApplePay","catch","There was an error paying with Apple Pay")}}function handleApplePaySetupException(n,t,i,r){console.error(r,n);toggleApplePayContainers(!1);document.getElementById("hide-default-pay").style.display="none"}function payWithApplePay(n,t){if(validateAndLogApplePayForm(n))try{let i=paypal.Applepay(),r=generateApplePaymentRequest(t),n=new ApplePaySession(4,r);n.onvalidatemerchant=t=>{i.validateMerchant({validationUrl:t.validationURL,displayName:document.getElementById("AccountName").value.substring(0,64)}).then(t=>{n.completeMerchantValidation(t.merchantSession)}).catch(t=>{handleApplePayException(t,"payWithApplePay","session.onvalidatemerchant","There was an error validating merchant"),n.abort()})};n.onpaymentauthorized=t=>{let u=parseFloat(document.getElementById("Amount").value),r="";document.getElementById("panelMerchant")&&(r=document.getElementById("panelMerchant").textContent.trim());let f=document.getElementById("panelAppleEndPoint").textContent.trim();fetch(`${f}/PayPal/orders/create/${r}/${u}/true`,{method:"post"}).then(n=>n.text()).then(r=>{if(!r||r=="-1"){console.log("Failed to create order");n.completePayment(ApplePaySession.STATUS_FAILURE);return}document.getElementById("PayPalOrderID").value=r;i.confirmOrder({orderId:r,token:t.payment.token,billingContact:t.payment.billingContact}).then(i=>{document.getElementById("BraintreeNonce").value=JSON.stringify(i.approveApplePayPayment.payment_source.apple_pay.card),n.completePayment(ApplePaySession.STATUS_SUCCESS),toggleGooglePayContainers(!1),googleAllowed=!1,fadeOut(document.getElementById("apple-pay-failure"),"fast"),document.getElementById("ApplePayDonation").value="True",fillInfoFromApplePay(t.payment.billingContact,t.payment.shippingContact),updateFieldsOnSubmit(),disableAmountAffectors(),validateInputsFromPaymentInfo()?document.querySelector(".efundForm").submit():(fadeOut(document.querySelector(".btn-hide-default-pay"),"fast"),showPaymentInfoConfirmPopup())}).catch(t=>{t&&(console.error("Error confirming order with applepay token"),console.error(t),n.completePayment(ApplePaySession.STATUS_FAILURE))})}).catch(t=>{console.log("Throw in create order"),console.log(t),n.completePayment(ApplePaySession.STATUS_FAILURE)})};n.begin()}catch(i){handleApplePayException(i,"payWithApplePay","catch","There was an error paying with Apple Pay")}}function handleApplePayException(n,t,i,r){console.error(r,n);fadeIn(document.getElementById("apple-pay-failure"),"fast")}function generateApplePaymentRequest(n){let t=parseFloat(document.getElementById("Amount").value);return{countryCode:n.countryCode,currencyCode:"USD",merchantCapabilities:n.merchantCapabilities,supportedNetworks:n.supportedNetworks,total:{label:"eFund Connect",amount:t},requiredShippingContactFields:["phone","email"],requiredBillingContactFields:["name","postalAddress"]}}function fillInfoFromApplePay(n,t){document.getElementById("NameFirst").value=n.givenName;document.getElementById("NameLast").value=n.familyName;document.getElementById("StreetAddress").value=n.addressLines[0];document.getElementById("City").value=n.locality;let i=n.administrativeArea;i=i?i.toUpperCase():"";document.getElementById("StreetState").value=i;document.getElementById("StreetZip").value=n.postalCode;updateDecoyAddress();document.getElementById("Email").value=t.emailAddress;document.getElementById("Phone").value=t.phoneNumber;document.getElementById("Phone").dispatchEvent(new Event("input"));document.getElementById("Phone").dispatchEvent(new Event("change"))}function toggleApplePayContainers(n){appleShown=n;n?(toggleDefaultPaymentContainers(!0),document.querySelectorAll(".apple-pay-show").forEach(n=>{fadeIn(n,"fast")}),document.querySelectorAll(".apple-pay-hide").forEach(n=>{fadeOut(n,"fast")})):(toggleDefaultPaymentContainers(googleShown),document.querySelectorAll(".apple-pay-show").forEach(n=>{fadeOut(n,"fast")}),document.querySelectorAll(".apple-pay-hide").forEach(n=>{fadeIn(n,"fast")}))}async function toggleApplePayFromServerData(){const n=document.getElementById("ApplePayDonation").value==="False",t=Boolean(document.getElementById("CCNumber").value);await isApplePayAllowed()&&n&&t&&toggleApplePayContainers(!1)}function getGoogleIsReadyToPayRequest(n){return{...baseRequest,...{allowedPaymentMethods:n,existingPaymentMethodRequired:!0}}}async function getGooglePayConfig(){try{if(allowedGooglePaymentMethods==null||merchantInfo==null){const n=await paypal.Googlepay().config();allowedGooglePaymentMethods=n.allowedPaymentMethods;merchantInfo=n.merchantInfo;merchantInfo.merchantName=document.getElementById("AccountName").value.substring(0,64);n.isEligible||(googleAllowed=!1,toggleGooglePayContainers(!1));baseRequest.apiVersion=n.apiVersion;baseRequest.apiVersionMinor=n.apiVersionMinor}}catch{googleAllowed=!1;toggleGooglePayContainers(!1)}return{allowedGooglePaymentMethods,merchantInfo}}async function getGooglePaymentDataRequest(){const n=Object.assign({},baseRequest),{allowedGooglePaymentMethods:t,merchantInfo:i}=await getGooglePayConfig();return n.allowedPaymentMethods=t,n.transactionInfo=getGoogleTransactionInfo(),n.merchantInfo=i,n.callbackIntents=["PAYMENT_AUTHORIZATION"],n.shippingAddressRequired=!0,n.shippingAddressParameters={},n.shippingAddressParameters.allowedCountryCodes=["US"],n.shippingAddressParameters.phoneNumberRequired=!0,n.emailRequired=!0,n}function onGooglePaymentAuthorized(n){return new Promise(function(t){processGooglePayment(n).then(function(){t({transactionState:"SUCCESS"})}).catch(function(){t({transactionState:"ERROR"})})})}function getGooglePaymentsClient(){if(paymentsClient===null){let n="";if(document.getElementById("panelEnvironment")&&(n=document.getElementById("panelEnvironment").textContent.trim().toUpperCase()),!n){googleAllowed=!1;toggleGooglePayContainers(!1);return}paymentsClient=new google.payments.api.PaymentsClient({environment:n,merchantInfo:merchantInfo,paymentDataCallbacks:{onPaymentAuthorized:onGooglePaymentAuthorized}})}return paymentsClient}function isGooglePayAllowed(){if(googleAllowed){if(document.getElementById("disableDonations"))return googleAllowed=!1;let n="";if(document.getElementById("panelMerchant")&&(n=document.getElementById("panelMerchant").textContent.trim()),n||(googleAllowed=!1),n!="8BPNHZDCXQ8G4"&&n!="V2DKXMZBHML7E"&&(googleAllowed=!1),document.getElementById("panelEnvironment")||(googleAllowed=!1),googleAllowed){const n=new URLSearchParams(window.location.search).get("achonly");googleAllowed=n!="true"&&!isIframe()}}return googleAllowed||toggleGooglePayContainers(!1),googleAllowed}function ShowGoogleOverride(){googleAllowed=!0;googleButtonExists||addGooglePayButton()}async function onGooglePayLoaded(){if(isGooglePayAllowed()){const{allowedGooglePaymentMethods:t}=await getGooglePayConfig(),i=getGooglePaymentsClient();let n=getGoogleIsReadyToPayRequest(t);console.log("iRTP Request PayLoad");console.log(n);i.isReadyToPay(n).then(function(n){console.log("iRTP Response");console.log(n);n.result&&n.paymentMethodPresent?addGooglePayButton():(googleAllowed=!1,toggleGooglePayContainers(!1))}).catch(function(n){googleAllowed=!1;toggleGooglePayContainers(!1);console.error(n)})}}function addGooglePayButton(){const n=getGooglePaymentsClient(),t=n.createButton({buttonType:"plain",onClick:onGooglePaymentButtonClicked,allowedPaymentMethods:allowedGooglePaymentMethods,buttonSizeMode:"fill",buttonRadius:0});document.getElementById("google-pay-submit").appendChild(t);googleButtonExists=!0;toggleGooglePayContainers(!0)}function getGoogleTransactionInfo(){let n=parseFloat(document.getElementById("Amount").value);return{countryCode:"US",currencyCode:"USD",totalPriceStatus:"FINAL",totalPrice:n.toString(),totalPriceLabel:"eFund Connect"}}async function onGooglePaymentButtonClicked(){if(document.getElementById("section-amount")&&!validateAmount(document.querySelector(".efundForm"))){document.getElementById("section-amount").scrollIntoView({behavior:"smooth"});return}if(document.getElementById("GooglePayDonation").value==="True"&&document.getElementById("BraintreeNonce").value){showPaymentInfoConfirmPopup();return}if(validateAndLogGooglePayForm(document.getElementById("google-pay-submit"))){const n=await getGooglePaymentDataRequest(),t=getGooglePaymentsClient();t.loadPaymentData(n)}}async function processGooglePayment(n){try{let t=-1,u=parseFloat(document.getElementById("Amount").value),r="";document.getElementById("panelMerchant")&&(r=document.getElementById("panelMerchant").textContent.trim());let f=document.getElementById("panelAppleEndPoint").textContent.trim(),e=await fetch(`${f}/PayPal/orders/create/${r}/${u}/false`,{method:"post"});if(t=await e.text(),!t||t=="-1")return console.log("Failed to create order"),{transactionState:"ERROR"};document.getElementById("PayPalOrderID").value=t;toggleApplePayContainers(!1);const i=await paypal.Googlepay().confirmOrder({orderId:t,paymentMethodData:n.paymentMethodData});return document.getElementById("BraintreeNonce").value=JSON.stringify(i.payment_source.google_pay.card),fillInfoFromGooglePay(n),updateFieldsOnSubmit(),disableAmountAffectors(),document.getElementById("GooglePayDonation").value="True",i.status==="APPROVED"?(validateInputsFromPaymentInfo()?document.querySelector(".efundForm").submit():(fadeOut(document.querySelector(".btn-hide-default-pay"),"fast"),showPaymentInfoConfirmPopup()),{transactionState:"SUCCESS"}):i.status==="PAYER_ACTION_REQUIRED"?(paypal.Googlepay().initiatePayerAction({orderId:t}),{transactionState:"SUCCESS"}):{transactionState:"ERROR",error:{reason:"PAYMENT_DATA_INVALID",message:"Failed to authorize payment. Try another card",intent:"PAYMENT_AUTHORIZATION"}}}catch(t){return console.error(t),{transactionState:"ERROR",error:{message:t.message}}}}function fillInfoFromGooglePay(n){let t=n.paymentMethodData.info.billingAddress.name.split(" ");document.getElementById("NameFirst").value=t[0];t.length>1&&(document.getElementById("NameLast").value=t[t.length-1]);document.getElementById("StreetAddress").value=n.paymentMethodData.info.billingAddress.address1;document.getElementById("City").value=n.paymentMethodData.info.billingAddress.locality;let i=n.paymentMethodData.info.billingAddress.administrativeArea;i=i?i.toUpperCase():"";document.getElementById("StreetState").value=i;document.getElementById("StreetZip").value=n.paymentMethodData.info.billingAddress.postalCode;updateDecoyAddress();document.getElementById("Email").value=n.email;document.getElementById("Phone").value=n.shippingAddress.phoneNumber;document.getElementById("Phone").dispatchEvent(new Event("input"));document.getElementById("Phone").dispatchEvent(new Event("change"))}function toggleGooglePayContainers(n){googleAllowed?googleShown=n&&googleButtonExists:(googleShown=!1,n=!1);n?(toggleDefaultPaymentContainers(!0),document.querySelectorAll(".google-pay-show").forEach(n=>{fadeIn(n,"fast")}),document.querySelectorAll(".google-pay-hide").forEach(n=>{fadeOut(n,"fast")})):(toggleDefaultPaymentContainers(appleShown),document.querySelectorAll(".google-pay-show").forEach(n=>{fadeOut(n,"fast")}),document.querySelectorAll(".google-pay-hide").forEach(n=>{fadeIn(n,"fast")}))}function toggleGooglePayFromServerData(){const n=document.getElementById("GooglePayDonation").value==="False",t=Boolean(document.getElementById("CCNumber").value);isGooglePayAllowed()&&n&&t&&toggleGooglePayContainers(!1)}function isRetired(){return document.getElementById("Retired")?.checked}function isRetiredOther(){return document.getElementById("RetiredOther")?.checked}function updateRequireAmount(){isOccupationRequired()?(setEmploymentRequired(!0),document.getElementById("SecondDonation")&&document.getElementById("SecondDonation").value=="t"&&setEmploymentOtherRequired(!0)):(setEmploymentRequired(!1),document.getElementById("SecondDonation")&&document.getElementById("SecondDonation").value=="t"&&setEmploymentOtherRequired(!1))}function setEmploymentRequired(n){isRetired()||forceEmploymentRequired(n)}function setEmploymentOtherRequired(n){isRetiredOther()||forceEmploymentOtherRequired(n)}function forceEmploymentRequired(n){document.getElementById("donor-dashboard")?document.querySelectorAll(".employment-field").forEach(t=>{t.getAttribute("data-required")==="true"&&(t.required=n)}):(document.getElementById("Employer")&&(document.getElementById("Employer").required=n),document.getElementById("Occupation")&&(document.getElementById("Occupation").required=n),document.getElementById("EmployerCity")&&(document.getElementById("EmployerCity").required=n,document.getElementById("EmployerState").required=n))}function forceEmploymentOtherRequired(n){document.getElementById("EmployerOther")&&(document.getElementById("EmployerOther").required=n);document.getElementById("OccupationOther")&&(document.getElementById("OccupationOther").required=n);document.getElementById("EmployerCityOther")&&(document.getElementById("EmployerCityOther").required=n)}function resizeRecurringButtons(){let f,n,t,e,i,r,u;f=window.location.href.indexOf("lang=sp")>-1?120:84;n=document.getElementById("efund-recurring-btns");t=n.clientWidth-(parseInt(getComputedStyle(n).getPropertyValue("padding-left"))+parseInt(getComputedStyle(n).getPropertyValue("padding-right")));e=Math.floor(t/f);i=n.querySelectorAll(".btn-wrapper").length;i<=e?(r=Math.floor(t/i)-.5,u=t,n.querySelector(".btn").style.height="44px"):(r=Math.floor(t/2),u=Math.floor(t/2),n.querySelector(".btn").style.height="54px");n.querySelectorAll(".btn-wrapper").forEach(n=>{n.style.width=r.toString()+"px"});document.querySelector(".efund_RecurringDonation").style.width=u.toString()+"px"}function customCheck(n){n.checked?n.parentNode.querySelector("label").classList.add("show-check"):n.parentNode.querySelector("label").classList.remove("show-check")}function reduceLabelSize(n){let t=n.querySelector(".form-label");if(t){let i=n.querySelector(".form-control"),u=getWidth(t),r;r=i.classList.contains("invalid")||n.querySelector(".more-info-btn")?getWidth(i)-36:getWidth(i);let f=i&&u>=r;f?(t.classList.add("reduced-label-size"),(i.classList.contains("invalid")||n.querySelector(".more-info-btn"))&&t.classList.add("label-spacing-right")):t.classList.remove("reduced-label-size")}}function getWidth(n){if(isHidden(n)){let t=n.cloneNode(!0);document.querySelector("body").appendChild(t);let i=t.offsetWidth;return t.remove(),i}return n.offsetWidth}function isHidden(n){return n.offsetParent===null}function getBrowser(){try{let n=navigator.userAgent,i=!!window.opr&&!!opr.addons||!!window.opera||n.indexOf(" OPR/")>-1;if(i)return"Opera";if(typeof InstallTrigger!="undefined"||n.indexOf("FxiOS")>-1)return"Firefox";if(/constructor/i.test(window.HTMLElement)||function(n){return n.toString()==="[object SafariRemoteNotification]"}(!window.safari||safari?.pushNotification)||n.indexOf("Safari")>-1&&n.indexOf("Chrome")===-1&&n.indexOf("CriOS")===-1&&n.indexOf("FxiOS")===-1)return"Safari";let t=!!document?.documentMode;if(t)return"Internet Explorer";if(!t&&!!window.StyleMedia)return"Edge";let r=!!window.chrome&&(!!window.chrome.webstore||!!window.chrome.runtime);if(r||n.indexOf("CriOS")>-1)return"Chrome";if(window.CSS)return"Blink"}catch{return"Unknown"}return"Unknown"}function isMobile(){try{let n=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series([46])0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br([ev])w|bumb|bw-([nu])|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do([cp])o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly([-_])|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-([mpt])|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c([- _agpst])|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac([ -/])|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja([tv])a|jbro|jemu|jigs|kddi|keji|kgt([ /])|klon|kpt |kwc-|kyo([ck])|le(no|xi)|lg( g|\/([klu])|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t([- ov])|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30([02])|n50([025])|n7(0([01])|10)|ne(([cm])-|on|tf|wf|wg|wt)|nok([6i])|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan([adt])|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c([-01])|47|mc|nd|ri)|sgh-|shar|sie([-m])|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel([im])|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c([- ])|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t.substr(0,4)))&&(n=!0)}(navigator?.userAgent||window?.opera),n}catch{return!1}}function isSmallScreen(){return viewportWidth()<992}function isIframe(){return window.location!==window.parent.location}function updateFieldsOnSubmit(){document.getElementById("btnCompany")&&handleCompanyFieldsOnSubmit();updateSelectedQuestionValues()}function handleCompanyFieldsOnSubmit(){isCompanyDonor()||clearCompanyFields()}function isCompanyDonor(){return document.getElementById("btnCompany").disabled}function clearCompanyFields(){document.querySelectorAll('#panelCompanyName input[type="text"]').forEach(n=>{n.value=""})}function updateSelectedQuestionValues(){document.querySelector(".selected-question-field-display")&&(resetSelectedQuestionFields(),document.querySelectorAll(".selected-question-field-display").forEach((n,t)=>{n.checked&&fillFirstEmptySelectedQuestion(t)}),removeEmptySelectedQuestionFields())}function resetSelectedQuestionFields(){const t=document.querySelectorAll(".selected-question-field-display").length,n=document.querySelector(".selected-question-values-wrapper");n.innerHTML="";for(let i=0;i<t;i++){const t='<input class="selected-question-field-value" id="SelectedQuestionValue'+i+'" name="Donation.SelectedQuestions['+i+']" type="text" value="">';n.insertAdjacentHTML("beforeend",t)}}function findFirstEmptySelectedQuestion(n){return n.findIndex(n=>n.value==="")}function fillFirstEmptySelectedQuestion(n){const t=document.querySelectorAll(".selected-question-field-value"),i=Array.from(t),r=findFirstEmptySelectedQuestion(i),u=t[r];u.value=n}function removeEmptySelectedQuestionFields(){document.querySelectorAll(".selected-question-field-value").forEach(n=>{n.value===""&&n.remove()})}function newPostAction(){return{callbacks:[],add:function(n){this.callbacks.push(n)},execute:function(){for(let n of this.callbacks)n();this.callbacks=[]}}}function updateFieldErrors(n){let t=document.querySelectorAll('.error:not([style*="display: none"])');if(t.length===0){document.getElementById("field-error").innerHTML="";document.getElementById("field-error").style.display="none";return}if(n){if(t.length===1){const n=t[0],r=n.getAttribute("data-errorfor");let i;i=r?document.querySelector('label[for="'+r+'"]')?.textContent:null;const u=n.textContent==="Please fill out this field."&&i?"Please fill out the "+i+" field.":n.textContent;document.getElementById("field-error").innerHTML=u}else document.getElementById("field-error").innerHTML=document.getElementById("trans-validate33").textContent;fadeIn(document.getElementById("field-error"),"fast")}}function validateAndLogForm(n){let t=n.closest("form");return validateEntireForm(t)?!0:(updateFieldErrors(!0),scrollToFirstError(),!1)}function scrollToFirstError(){if(document.querySelector(".efund-tooltip.error")){const n=getFirstVisibleElement(document.querySelectorAll(".efund-tooltip.error"));isInViewport(n)||n.scrollIntoView(!1)}}function getFirstVisibleElement(n){for(let t of n)if(t.offsetWidth>0||t.offsetHeight>0)return t}function validateAndLogApplePayForm(n){let t=n.closest("form");return validateApplePayForm(t)?(fadeOut(document.getElementById("submit-error"),"fast"),!0):(isSmallScreen()&&fadeIn(document.getElementById("submit-error"),"fast"),scrollToFirstError(),!1)}function validateAndLogGooglePayForm(n){let t=n.closest("form");return validateGooglePayForm(t)?(fadeOut(document.getElementById("submit-error"),"fast"),!0):(isSmallScreen()&&fadeIn(document.getElementById("submit-error"),"fast"),scrollToFirstError(),!1)}function validateEntireForm(n){let t=validateFormExceptInputs(n);return validateInputs(n)&&t}function isFormValid(n){return updateRealAddress(),areInputsValid(n)&&isAmountValid(n)&&areCheckboxesValid(n)&&isGoogleCaptchaValid(n)&&isCoverFeeValid()}function validateFormExceptInputs(n){let t=!validateAmount(n)+!validateAllCheckboxes(n)+!validateGoogleCaptcha(n)+!validateCoverFee()+validateIsSpammer();return t==0}function validateIsSpammer(){let n=newPostAction();return isSpammer()&&(document.getElementById("submit-error").style.display="block"),n.execute(),isSpammer()}function isSpammer(){return!!document.querySelector(".antigate_solver")}function isValidRecaptchaStructure(n){if(n.children.length===2&&n.children[0].classList.contains("g-recaptcha")){const t=n.children[0];if(t.children.length===0||t.children.length===2&&t.children[0].children.length===2&&t.children[0].children[0].children.length===1)return!0}return!1}function validateApplePayConfirm(){return validateApplePayName()&&validateApplePayPhone()&&validateApplePayAddress()}function validateApplePayName(){return document.getElementById("apple-popup-name").style.display=="flex"&&(!validateInput(document.getElementById("AppleNameFirst"))||!validateInput(document.getElementById("AppleNameLast")))?!1:!0}function validateApplePayPhone(){return document.getElementById("apple-popup-phone").style.display=="flex"&&!validateInput(document.getElementById("ApplePhone"))?!1:!0}function validateApplePayAddress(){return document.getElementById("apple-popup-address").style.display=="block"&&(!validateInput(document.getElementById("AppleAddress"))||!validateInput(document.getElementById("AppleCity"))||!validateInput(document.getElementById("AppleState"))||!validateInput(document.getElementById("AppleZip")))?!1:!0}function validateApplePayForm(n){let t=validateFormExceptInputs(n);return validateApplePayInputs(n)&&t}function validateApplePayInputs(n){let t=!0;return n.querySelectorAll(".form-control").forEach(n=>{n.closest(".apple-pay-hide")||n.closest(".default-pay-hide")||(validateInput(n)||(t=!1),updateInputValidationStyle(n))}),t}function validateGooglePayForm(n){let t=validateFormExceptInputs(n);return validateGooglePayInputs(n)&&t}function validateGooglePayInputs(n){let t=!0;return n.querySelectorAll(".form-control").forEach(n=>{n.closest(".google-pay-hide")||n.closest(".default-pay-hide")||(validateInput(n)||(t=!1),updateInputValidationStyle(n))}),t}function validateInputs(n,t){t===undefined&&(t=!1);let i=".form-control";t===!0&&(i+=":visible");let r=!0;return n.querySelectorAll(i).forEach(n=>{validateInput(n)||(r=!1),updateInputValidationStyle(n)}),r}function areInputsValid(n,t){t===undefined&&(t=!1);let i=".form-control";t===!0&&(i+=":visible");let r=n.querySelectorAll(i);for(let n of r)if(!isInputValid(n))return!1;return!0}function validateAmount(n){let t=newPostAction(),i=isAmountValid(n,t);return t.execute(),i}function isAmountValid(n,t){t=t||newPostAction();let r=!0,i=n.querySelector("#Amount")?.getAttribute("value");return i===undefined?r:(i=i!==null?parseFloat(i):i,i?document.getElementById("btnSecond")&&isCoupleDecimalAmountOdd(i)&&(r=!1,t.add(function(){handleInvalidCoupleDecimalAmount(i)})):(r=!1,t.add(function(){fadeIn(document.getElementById("missing-amount"),"fast")})),r)}function isCoupleDecimalAmountOdd(n){return document.getElementById("btnSecond").disabled===!0&&n*100%2!=0}function checkCoupleDecimalAmountValidation(n){return document.getElementById("btnSecond")&&isCoupleDecimalAmountOdd(n)?(handleInvalidCoupleDecimalAmount(n),!1):(handleValidCoupleDecimalAmount(n),!0)}function handleInvalidCoupleDecimalAmount(){fadeIn(document.getElementById("odd-decimal-amount"),"fast")}function handleValidCoupleDecimalAmount(){fadeOut(document.getElementById("odd-decimal-amount"),"fast")}function validateAllCheckboxes(n){let t=!0;return n.querySelectorAll(".checkbox").forEach(n=>{validateCheckbox(n)||(t=!1),updateInputValidationStyle(n)}),t}function areCheckboxesValid(n){let t=!0;return n.querySelectorAll(".checkbox").forEach(n=>{isRequiredCheckbox(n)||(t=!1)}),t}function validateGoogleCaptcha(n){let t=newPostAction(),i=isGoogleCaptchaValid(n,t);return t.execute(),i}function isGoogleCaptchaValid(n,t){t=t||newPostAction();let i=!0;return shouldUseCaptcha()?(document.querySelector(".captcha-blocked")&&(console.log("captcha blocked"),i=!1,t.add(function(){fadeIn(document.getElementById("recaptcha-error"),"fast")})),n.querySelectorAll(".g-recaptcha").forEach(function(){let n=grecaptcha.getResponse();n==""?(i=!1,t.add(function(){fadeIn(document.getElementById("recaptcha-error"),"fast")})):t.add(function(){document.getElementById("CaptchaResponseToken").value=n})})):(hideRecaptchaError(),updateFieldErrors(!1)),i}function shouldUseCaptcha(){const n=document.getElementById("btnPayPal")?document.getElementById("btnPayPal").disabled:!1,t=document.getElementById("btnVenmo")?document.getElementById("btnVenmo").disabled:!1;return!(n||t||googleShown||appleShown)}function validateCoverFee(n){let t=newPostAction(),i=isCoverFeeValid(n,t);return t.execute(),i}function isCoverFeeValid(n,t){if(t=t||newPostAction(),n===undefined&&document.getElementById("Amount")&&(n=document.getElementById("Amount").value),document.getElementById("CoverFee")){if(document.getElementById("CoverFee").checked&&n>getAccountMax())return t.add(function(){document.getElementById("cover-fee-error").style.display="block"}),!1;t.add(function(){document.getElementById("cover-fee-error").style.display="none"})}return!0}function validateCheckbox(n){let t=newPostAction(),i=isRequiredCheckbox(n,t);return t.execute(),i}function isRequiredCheckbox(n,t){return(t=t||newPostAction(),!n.checked&&(n.getAttribute("required")||n.getAttribute("required")===""))?(t.add(function(){n.setAttribute("data-validate","fail");n.setAttribute("data-validate-message",document.getElementById("trans-validate17").textContent)}),!1):(t.add(function(){n.removeAttribute("data-validate")}),!0)}function validateInput(n){let t=newPostAction(),i=isInputValid(n,t);return t.execute(),i}function validateAndUpdateInput(n){validateInput(n);updateInputValidationStyle(n)}function isInputValid(n,t){t=t||newPostAction();let r,i=(n.value||"").trim();return i?(n.getAttribute("id")!=="ExpDate"&&hasDangerousCharacters(i)?(r=!1,n.title="Please remove the following characters: %+&/`‘’<>“”"):r=n.getAttribute("id")==="Iterations"?isValidIterations(parseInt(i),t):n.getAttribute("id")==="StreetZip"?isValidZip(i,document.getElementById("StreetState").value):n.getAttribute("id")==="AppleZip"?isValidZip(i,document.getElementById("AppleState").value):n.getAttribute("id")==="CCNumber"?isValidCC(i,t):n.getAttribute("id")==="RoutingNumber"?isValidRoutingNumber(i):n.getAttribute("id")==="ExpDate"?isValidExpDate(i):n.getAttribute("type")==="number"?isValidNumber(i):n.getAttribute("type")==="email"?isValidEmail(i):isValidTextField(n,i),!r)?(t.add(function(){n.setAttribute("data-validate","fail");n.getAttribute("id")==="OtherAmount"&&(document.getElementById("coupleMaxOverride")?n.setAttribute("title",document.getElementById("trans-validate34").textContent):n.setAttribute("title",document.getElementById("trans-validate8").textContent),document.getElementById("btnPayPal")&&resetPayPalContainer());n.setAttribute("data-validate-message",n.getAttribute("title"))}),r):(t.add(function(){n.setAttribute("data-validate","pass")}),r):n.hasAttribute("required")?(t.add(function(){n.setAttribute("data-validate","fail");n.nodeName==="SELECT"?n.setAttribute("data-validate-message",document.getElementById("trans-validate29").textContent):n.setAttribute("data-validate-message",document.getElementById("trans-validate1").textContent)}),!1):(t.add(function(){n.removeAttribute("data-validate")}),!0)}function isValidTextField(n,t){let r=n.getAttribute("maxlength"),u=n.getAttribute("minlength"),i,f=t.length;return n.hasAttribute("pattern")&&(i=new RegExp(n.getAttribute("pattern"))),!(r&&f>r)&&!(u&&f<u)&&!(i&&!i.test(t))}function hasDangerousCharacters(n){return!/^[^%+&/\\`‘’'"“”<>]*$/.test(n.toString())}function isValidNumber(n){let t=getAccountMax(),i=getAccountMin();return!(t&&parseFloat(n)>parseFloat(t))&&!(i&&parseFloat(n)<parseFloat(i-.001))}function isValidEmail(n){let t=n.split("."),i=t[t.length];return i.length>=2}function isValidZip(n,t){if(!/\d{5}/.test(n)||!t)return!1;let i=n.slice(0,3);switch(t){case"AL":return i>=350&&i<=352||i>=354&&i<=369;case"AK":return i>=995&&i<=999;case"AZ":return i>=850&&i<=853||i>=855&&i<=857||i>=859&&i<=860||i>=863&&i<=865;case"AR":return i>=716&&i<=729;case"CA":return i>=900&&i<=908||i>=910&&i<=928||i>=930&&i<=961;case"CO":return i>=800&&i<=816;case"CT":return i>=60&&n<=6389||n>=6391&&i<=69;case"DE":return i>=197&&i<=199;case"DC":return i==200||i>=202&&i<=205||i==569;case"FL":return i>=320&&i<=339||i==341||i==342||i==344||i==346||i==347||i==349;case"GA":return i>=300&&i<=319||i==398||i==399;case"HI":return i==967||i==968;case"ID":return i>=832&&i<=838;case"IL":return i>=600&&i<=620||i>=622&&i<=629;case"IN":return i>=460&&i<=479;case"IA":return i>=500&&i<=516||i>=520&&i<=528;case"KS":return i>=660&&i<=662||i>=664&&i<=679;case"KY":return i>=400&&i<=427;case"LA":return i==700||i==701||i>=703&&i<=708||i>=710&&i<=714;case"ME":return i>=39&&i<=49;case"MD":return i>=206&&i<=212||i>=214&&i<=219;case"MA":return i>=10&&i<=27||i==55;case"MI":return i>=480&&i<=499;case"MN":return i==550||i==551||i>=553&&i<=567;case"MS":return i>=386&&i<=397;case"MO":return i==630||i==631||i>=633&&i<=641||i>=644&&i<=658;case"MT":return i>=590&&i<=599;case"NE":return i==680||i==681||i>=683&&i<=693;case"NV":return i>=889&&i<=891||i>=893&&i<=895||i==897||i==898;case"NH":return i>=30&&i<=38;case"NJ":return i>=70&&i<=89;case"NM":return i==870||i==871||i>=873&&i<=875||i>=877&&i<=884;case"NY":return i==5||n==6390||i>=100&&i<=149;case"NC":return i>=270&&i<=289;case"ND":return i>=580&&i<=588;case"OH":return i>=430&&i<=459;case"OK":return i==730||i==731||i>=734&&i<=741||i>=743&&i<=749;case"OR":return i>=970&&i<=979;case"PA":return i>=150&&i<=196;case"RI":return i==28||i==29;case"SC":return i>=290&&i<=299;case"SD":return i>=570&&i<=577;case"TN":return i>=370&&i<=385;case"TX":return i==733||i>=750&&i<=770||i>=772&&i<=799;case"UT":return i>=840&&i<=847;case"VT":return i>=50&&i<=54||i>=56&&i<=59;case"VA":return i==201||i>=220&&i<=246;case"WA":return i>=980&&i<=986||i>=988&&i<=994;case"WV":return i>=247&&i<=268;case"WI":return i>=530&&i<=532||i==534||i==535||i>=537&&i<=549;case"WY":return i>=820&&i<=831||i==834;case"AS":return n==96799;case"FM":return i==969;case"GU":return i==969;case"MH":return i==969;case"MP":return i==969;case"PW":return i==969;case"PR":return i==6||i==7||i==9;case"VI":return i==8;case"AA":return i==340;case"AE":return i>=90&&i<=98;case"AP":return i>=962&&i<=966;default:return!1}}function isValidCC(n,t){t=t||newPostAction();let i=n.replace(/\D/g,"");if(/^3[47]/.test(i)){if(i.length!==15)return t.add(function(){document.getElementById("CCNumber").setAttribute("title",document.getElementById("trans-validate35").textContent)}),!1}else if(i.length!==16)return t.add(function(){document.getElementById("CCNumber").setAttribute("title",document.getElementById("trans-validate36").textContent)}),!1;return!/^5[45]/.test(i)&&!passesChecksum(i)?(t.add(function(){document.getElementById("CCNumber").setAttribute("title",document.getElementById("trans-validate37").textContent)}),!1):!0}function isValidRoutingNumber(n){let t=n.replace(/\D/g,"");return t.length===9}function passesChecksum(n){let t=n.split("").reverse().map(function(n,t){return t%2==1?n*2:parseInt(n)}).map(function(n){return n>9?n-9:n}).reduce(function(n,t){return n+t})%10;return t===0}function ACHChecksum(n){let t=n.split("").map(function(n,t){return t%3==0?3*n:t%3==1?7*n:parseInt(n)}).reduce(function(n,t){return n+t})%10;return t===0}function isValidExpDate(n){return/^(0[1-9]|1[012])\/\d{2}$/.test(n)&&isFutureDate(n)}function isFutureDate(n){let u=parseInt(n.replace(/\D/g,"").slice(0,2)),t=parseInt(n.replace(/\D/g,"").slice(2))+2e3,i=new Date,f=i.getMonth()+1,r=i.getFullYear();return t>r||t===r&&u>=f}function isValidRecurringTotal(n,t){if(t=t||newPostAction(),document.getElementById("Amount").value){if(n>32e3)return t.add(function(){document.getElementById("Iterations").setAttribute("title",document.getElementById("trans-validate10").textContent)}),!1;if(document.getElementById("GiveAmount")?.value){let r=0,i=applyFactors(parseFloat(document.getElementById("GiveAmount").value)),u=parseFloat(document.getElementById("Amount").value);u>i&&(r=u-i);let f=n*i;if(parseFloat(r)+parseFloat(f)>getAccountMax())return t.add(function(){document.getElementById("Iterations").setAttribute("title",document.getElementById("trans-validate11").textContent)}),!1}else if(n*document.getElementById("Amount").value>getAccountMax())return t.add(function(){document.getElementById("Iterations").setAttribute("title",document.getElementById("trans-validate21").textContent)}),!1}return!0}function isValidIterations(n,t){if(t=t||newPostAction(),n===0)return t.add(function(){document.getElementById("Iterations").setAttribute("title",document.getElementById("trans-validate18").textContent)}),!1;if(document.getElementById("ExpDate").value){let i,u,e,r,f=document.getElementById("ExpDate").value,o=0,c=parseInt(f.replace(/\D/g,"").slice(0,2))-1,l=parseInt(f.replace(/\D/g,"").slice(2))+2e3,s=new Date(l,c+1,0),h=new Date;if(document.getElementById("btnWeekly")?.getAttribute("disabled")?(r="weeks",i=7):document.getElementById("btnMonthly")?.getAttribute("disabled")?(r="months",i=30):document.getElementById("btnQuarterly")?.getAttribute("disabled")?(r="quarters",i=90):document.getElementById("btnAnnually")?.getAttribute("disabled")?(r="years",i=365):i=1,u=i*864e5,e=u*n,o=Math.floor((s.getTime()-h.getTime())/u),h.getTime()+e>s.getTime())return t.add(function(){document.getElementById("Iterations").setAttribute("title",n+" "+r+" of recurring donations are not allowed since your credit card will expire on "+f+". Please adjust your number of recurring payments to a maximum of "+o)}),!1}return isValidRecurringTotal(n,t)}function runIterationsValidation(){document.getElementById("Iterations")?.value&&(validateInput(document.getElementById("Iterations")),updateInputValidationStyle(document.getElementById("Iterations")))}function updateInputValidationStyle(n){if(n){let t=document.getElementById(n.id).parentNode,r=t.querySelector(".error-icon"),u=t.querySelector(".more-info-btn"),i;i=n.getAttribute("id")==="OtherAmount"?document.querySelector(".efund_PaymentOptionList .error"):t.querySelector(".error");n.getAttribute("data-validate")==="pass"?updateValidInputStyle(n,r,u,i):n.getAttribute("data-validate")==="fail"?updateInvalidInputStyle(n,t,r,u,i):updateEmptyValidInputStyle(n,r,u,i)}}function updateValidInputStyle(n,t,i,r){n.classList.add("valid");n.classList.remove("invalid");r&&r.remove();t&&t.remove();i&&i.classList.remove("red")}function updateInvalidInputStyle(n,t,i,r,u){n.classList.remove("valid");n.classList.add("invalid");u&&u.remove();const e=n.hasAttribute("id")?'data-errorfor="'+n.getAttribute("id")+'" ':"";let f="<div "+e+'class="efund-tooltip error"><p>'+n.getAttribute("data-validate-message")+"<\/p><\/div>";if(n.getAttribute("id")==="OtherAmount"?document.querySelector(".efund_PaymentOptionList").insertAdjacentHTML("beforeend",f):t.insertAdjacentHTML("beforeend",f),r)r.classList.add("red");else if(!i){let i='<i class="fa fa-exclamation-circle error-icon" aria-hidden="true"><\/i>';n.id==="OtherAmount"?document.getElementById("OtherAmount").parentNode.insertAdjacentHTML("beforeend",i):t.insertAdjacentHTML("beforeend",i)}}function updateEmptyValidInputStyle(n,t,i,r){n.classList.remove("valid");n.classList.remove("invalid");r&&r.remove();t&&t.remove();i&&i.classList.remove("red")}function hideRecaptchaError(){document.getElementById("recaptcha-error")&&(document.getElementById("recaptcha-error").style.display="none")}function viewportWidth(){let n=window,t="inner";return"innerWidth"in window||(t="client",n=document.documentElement||document.body),n[t+"Width"]}function serializeForm(n){const t=new FormData(n),i=[...t.entries()];return i.map(n=>`${encodeURIComponent(n[0])}=${encodeURIComponent(n[1])}`).join("&")}function fadeIn(n){n&&(n.style.display=n.classList.contains("row")?"flex":"block")}function fadeOut(n){n&&(n.style.display="none")}function isInViewport(n){const t=n.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function resetPayPalContainer(){document.getElementById("paypal-column")&&(document.getElementById("paypal-column").style.display="block");document.getElementById("paypal-message")&&(document.getElementById("paypal-message").style.display="none")}function updatePayPalStatus(){getPayPalActions!==undefined&&(isFormValid(document.querySelector(".efundForm"))?getPayPalActions().enable():getPayPalActions().disable())}function checkIfEndField(n){var t,i;t=n.offsetLeft-28;i=n.parentNode.offsetWidth-(n.offsetLeft+n.offsetWidth)+28;t<10?n.classList.add("row-start"):n.classList.remove("row-start");i<35?n.classList.add("row-end"):n.classList.remove("row-end")}function handleAmountChangeWithMerch(){updateDisplayedTotalAmount(document.getElementById("Amount").value);document.querySelectorAll(".qty-field").forEach(n=>{checkQtyMax(n)});doesExceedMax()?(document.getElementById("total-amount-max-error").style.display="block",document.getElementById("total-amount-max-error-hero-1")&&isHeroShotMultiPanel()&&(document.getElementById("total-amount-max-error-hero-1").style.display="block")):(document.getElementById("total-amount-max-error").style.display="none",document.getElementById("total-amount-max-error-hero-1")&&isHeroShotMultiPanel()&&(document.getElementById("total-amount-max-error-hero-1").style.display="none"));document.getElementById("total-amount-min-error").style.display=doesFailMin()?"block":"none";parseFloat(document.getElementById("Amount").value)&&(document.getElementById("missing-amount").style.display="none");updateRequireAmount();document.getElementById("btnPayPal")&&(updatePayPalStatus(),document.getElementById("btnPayPal")&&resetPayPalContainer());updateFieldErrors()}function updateFieldsIfProductServerData(){const n=document.getElementById("MerchandiseJSON").value;if(n){const t=JSON.parse(n);updateFieldsFromProductServerData(t)}}function updateFieldsFromProductServerData(n){updateProductsFromServerData(n);updateGiveAmountFromProductServerData(n)}function updateProductsFromServerData(n){haveNonzeroProductQuantities(n)&&updateProductQuantityFields(n);updateProductVariants(n)}function updateGiveAmountFromProductServerData(n){if(haveNonzeroProductAmounts(n)){const t=calculateGiveAmountFromProductsAmount(n);t>0&&(document.getElementById("GiveAmount").value=t,setupSelectedPaymentOption(document.getElementById("GiveAmount")),setupSelectedOtherAmount(document.getElementById("GiveAmount")))}}function haveNonzeroProductQuantities(n){const t=sumProductQuantities(n);return t>0}function sumProductQuantities(n){var t=extractproductQuantities(n);return sumElements(t)}function extractproductQuantities(n){return n.map(n=>parseInt(n.Count,10))}function sumElements(n){return n.reduce((n,t)=>n+t)}function updateProductQuantityFields(n){n.forEach(function(n,t){updateProductQuantityField(n,t)})}function updateProductQuantityField(n,t){const i=n.Count,r=document.querySelectorAll(".qty-field")[t];r.value=i}function haveNonzeroProductAmounts(n){const t=sumProductAmounts(n);return t>0}function sumProductAmounts(n){return n.reduce((n,t)=>n+t.Count*t.Amount)}function calculateGiveAmountFromProductsAmount(n){const t=sumProductAmounts(n),i=parseFloat(document.getElementById("Amount").value);return i-t}function getProductsWithVariantsSelected(n){return n.filter(hasVariantSelected)}function hasVariantSelected(n){return n.SizeOption&&n.SizeOption.length>0}function updateProductVariants(n){const t=getProductsWithVariantsSelected(n);t.forEach((n,t)=>{updateProductVariant(n,t)})}function updateProductVariant(n,t){const i=n.SizeOption,r=document.querySelectorAll(".product-variant-field")[t];r.value=i}function updateProductVariantRequire(n){const i=n.querySelector(".qty-field"),r=parseInt(i.value),t=n.querySelector(".product-variant-field");t&&(r>0?t.required=!0:(t.required=!1,t.dispatchEvent(new Event("change"))))}function updateDisplayedTotalAmount(n){const t=formatTotalAmount(n);document.getElementById("totalAmount").textContent=t}function formatTotalAmount(n){return parseFloat(n).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",")}function getDonationAmount(){return document.querySelector("li[class='efund_PaymentOptionItem selectedOption']")?document.querySelector("li[class='efund_PaymentOptionItem selectedOption']").getAttribute("data-amount"):document.getElementById("OtherAmount").value}function setupGiveAmount(){var n=getDonationAmount();(n!==""||n!==undefined)&&(document.getElementById("GiveAmount").value=n)}function changeTicketQty(n,t){var i=parseInt(t.value,10),r;r=i?n.value==="plus"?i+1:i-1:1;t.value=r.toString();t.dispatchEvent(new Event("change"))}function createTicketArr(n){return[...n].map(n=>saveProductOptions(n))}function saveProductOptions(n){const t=n.getAttribute("data-name"),i=n.getAttribute("data-amount"),r=n.querySelector(".qty-field"),u=parseInt(r.value,10)?r.value:"0",f=n.querySelector(".product-variant-field");return f?{Name:t,Amount:i,Count:u,SizeOption:f.value,hasSizeOptions:!0}:{Name:t,Amount:i,Count:u,hasSizeOptions:!1}}function sumItems(n){return n.reduce(itemReducer,0)}function itemReducer(n,t){return n+t.Amount*t.Count}function checkQtyMin(n){var i=n.parentNode,t=i.querySelector(".qty-minus");parseInt(n.value,10)?t.removeAttribute("disabled"):t.setAttribute("disabled","")}function checkQtyMax(n){var r=n.parentNode,i=r.querySelector(".qty-plus"),u=r.closest(".ticket"),e=parseFloat(u.getAttribute("data-amount")),f=parseInt(n.value,10),t=parseInt(n.getAttribute("data-max"),10),o=u.querySelector(".ticket-error");willExceedMax(e)?i.setAttribute("disabled",""):t&&f>=t?i.setAttribute("disabled",""):i.removeAttribute("disabled");o.style.display=t&&f>t?"block":"none"}function willExceedMax(n){const t=getAccountMax(),i=parseFloat(document.getElementById("BaseAmount").value),r=applyFactors(i+n);return r>t}function doesExceedMax(){const n=parseFloat(document.getElementById("Amount").value),t=getAccountMax();return n>t}function doesFailMin(){var n=document.getElementById("totalAmount"),t=parseFloat(n.value),i=parseFloat(n.getAttribute("data-min"));return t&&t<i}function resetTotalAmount(){updateTotalAmount("0");updateSubmitButtonTextWithAmount("0")}function calcAdditionalMin(n,t){return Math.max(t-n,0)}function calcTotalProductsAmount(){const n=document.querySelectorAll(".ticket"),t=createTicketArr(n);return parseFloat(sumItems(t).toFixed(2).toString())}function updateTickets(){var f=document.querySelectorAll(".ticket"),i=createTicketArr(f),e=JSON.stringify(i),n,r,t,u;document.getElementById("MerchandiseJSON").value=e;n=calcTotalProductsAmount();isNaN(n)&&(n=0);r=document.getElementById("GiveAmount");t=parseFloat(r.value);isNaN(t)&&(t=0);updateTotalAmount(n+t);u=sumProductQuantities(i);updateTotalProductsQuantity(u)}function updateTotalProductsQuantity(n){const t=document.getElementById("TotalCount");t&&(t.value=n,t.dispatchEvent(new Event("change")))}function preventRecurring(){document.getElementById("efund-recurring-btns").classList.add("prevent-recurring");const t=document.querySelectorAll("#efund-recurring-btns .btn");t.forEach(n=>{n.disabled=!0});const n=document.getElementById("Iterations");n.getAttribute("data-required")==="true"?(n.required=!1,n.disabled=!0):n.parentNode.parentNode.parentNode.style.display="none"}function allowRecurring(){document.querySelectorAll("#efund-recurring-btns.prevent-recurring").length!==0&&(document.getElementById("efund-recurring-btns").classList.remove("prevent-recurring"),document.querySelectorAll("#efund-recurring-btns .btn").forEach(n=>{n.disabled=!1}),document.querySelectorAll("#efund-recurring-btns .btn-wrapper:first-child .btn").forEach(n=>{n.disabled=!0}));const n=document.getElementById("Iterations");n.getAttribute("data-required")==="true"&&(n.required=!0,n.disabled=!1)}function showCancel(){document.getElementById("cancel-contribution-row").classList.remove("d-none")}function cancelContribution(){document.querySelector(".efund_PaymentOptionItem.selectedOption")&&document.querySelector(".efund_PaymentOptionItem.selectedOption").classList.remove("selectedOption");const n=document.getElementById("OtherAmount");n.value="";n.dispatchEvent(new Event("change"));const t=document.getElementById("GiveAmount");t.value="";t.dispatchEvent(new Event("change"));document.getElementById("Iterations").value="1";HideRecurringMessages();preventRecurring();document.getElementById("cancel-contribution-row").classList.add("d-none");enablePayPal()}var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)},CountUp=function(){function n(n,t,i){var r=this;this.target=n;this.endVal=t;this.options=i;this.version="2.0.8";this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:""};this.finalEndVal=null;this.useEasing=!0;this.countDown=!1;this.error="";this.startVal=0;this.paused=!0;this.count=function(n){r.startTime||(r.startTime=n);var t=n-r.startTime;r.remaining=r.duration-t;r.frameVal=r.useEasing?r.countDown?r.startVal-r.easingFn(t,0,r.startVal-r.endVal,r.duration):r.easingFn(t,r.startVal,r.endVal-r.startVal,r.duration):r.countDown?r.startVal-(r.startVal-r.endVal)*(t/r.duration):r.startVal+(r.endVal-r.startVal)*(t/r.duration);r.frameVal=r.countDown?r.frameVal<r.endVal?r.endVal:r.frameVal:r.frameVal>r.endVal?r.endVal:r.frameVal;r.frameVal=Number(r.frameVal.toFixed(r.options.decimalPlaces));r.printValue(r.frameVal);t<r.duration?r.rAF=requestAnimationFrame(r.count):null!==r.finalEndVal?r.update(r.finalEndVal):r.callback&&r.callback()};this.formatNumber=function(n){var s,t,f,i,h=n<0?"-":"",e,u,o;if(s=Math.abs(n).toFixed(r.options.decimalPlaces),e=(s+="").split("."),t=e[0],f=e.length>1?r.options.decimal+e[1]:"",r.options.useGrouping){for(i="",u=0,o=t.length;u<o;++u)0!==u&&u%3==0&&(i=r.options.separator+i),i=t[o-u-1]+i;t=i}return r.options.numerals&&r.options.numerals.length&&(t=t.replace(/[0-9]/g,function(n){return r.options.numerals[+n]}),f=f.replace(/[0-9]/g,function(n){return r.options.numerals[+n]})),h+r.options.prefix+t+f+r.options.suffix};this.easeOutExpo=function(n,t,i,r){return i*(1-Math.pow(2,-10*n/r))*1024/1023+t};this.options=__assign(__assign({},this.defaults),i);this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber;this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo;this.startVal=this.validateValue(this.options.startVal);this.frameVal=this.startVal;this.endVal=this.validateValue(t);this.options.decimalPlaces=Math.max(this.options.decimalPlaces);this.resetDuration();this.options.separator=String(this.options.separator);this.useEasing=this.options.useEasing;""===this.options.separator&&(this.options.useGrouping=!1);this.el="string"==typeof n?document.getElementById(n):n;this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined"}return n.prototype.determineDirectionAndSmartEasing=function(){var n=this.finalEndVal?this.finalEndVal:this.endVal,t,i;this.countDown=this.startVal>n;t=n-this.startVal;Math.abs(t)>this.options.smartEasingThreshold?(this.finalEndVal=n,i=this.countDown?1:-1,this.endVal=n+i*this.options.smartEasingAmount,this.duration=this.duration/2):(this.endVal=n,this.finalEndVal=null);this.useEasing=this.finalEndVal?!1:this.options.useEasing},n.prototype.start=function(n){this.error||(this.callback=n,this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},n.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF);this.paused=!this.paused},n.prototype.reset=function(){cancelAnimationFrame(this.rAF);this.paused=!0;this.resetDuration();this.startVal=this.validateValue(this.options.startVal);this.frameVal=this.startVal;this.printValue(this.startVal)},n.prototype.update=function(n){cancelAnimationFrame(this.rAF);this.startTime=null;this.endVal=this.validateValue(n);this.endVal!==this.frameVal&&(this.startVal=this.frameVal,this.finalEndVal||this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},n.prototype.printValue=function(n){var t=this.formattingFn(n);"INPUT"===this.el.tagName?this.el.value=t:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=t:this.el.innerHTML=t},n.prototype.ensureNumber=function(n){return"number"==typeof n&&!isNaN(n)},n.prototype.validateValue=function(n){var t=Number(n);return this.ensureNumber(t)?t:(this.error="[CountUp] invalid start or end value: "+n,null)},n.prototype.resetDuration=function(){this.startTime=null;this.duration=1e3*Number(this.options.duration);this.remaining=this.duration},n}();document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".hidden-if-no-javascript").forEach(n=>{n.classList.remove("hidden-if-no-javascript")});document.querySelector(".efundForm").addEventListener("submit",function(){preventDoubleSubmit(this)});document.querySelector("#login-popup form")&&document.querySelector("#login-popup form").addEventListener("submit",function(){const n=this.closest(".efund-modal");popupPreventDoubleSubmit(n)});document.querySelectorAll(".spinner-panel .reload-btn").forEach(n=>{n.addEventListener("click",function(){panelPreventDoubleSubmit(this)})});document.querySelectorAll(".spinner-panel form").forEach(n=>{n.addEventListener("submit",function(){panelPreventDoubleSubmit(this)})});setupSpammerCheck()});window.addEventListener("pageshow",function(n){let t=n.persisted||typeof performance!="undefined"&&window.performance.getEntriesByType("navigation")?.[0].type==="back_forward";t&&window.location.reload()});document.addEventListener("DOMContentLoaded",function(){if(document.getElementById("loginErrors")){const n=new bootstrap.Modal(document.getElementById("modal-oneclick-container"),{});n.show();changeModalView(document.querySelector(".one-click-login").getAttribute("data-view-target"))}document.querySelectorAll(".one-click-login, .modal-btn").forEach(n=>{n.addEventListener("click",function(){changeModalView(this.getAttribute("data-view-target"))})});document.getElementById("modal-oneclick-container")&&document.getElementById("modal-oneclick-container").addEventListener("click",function(n){let t=n.target;t.classList.contains("btn-change-popup")?changeModalView(t.getAttribute("data-view-target")):t.parentNode.classList.contains("btn-change-popup")&&changeModalView(t.parentNode.getAttribute("data-view-target"))});addModalLock();document.querySelectorAll(".modal-dialog").forEach(n=>{n.addEventListener("mousedown",function(){const n=new bootstrap.Modal(this.closest(".modal"),{});n.lock()})});document.querySelectorAll(".modal-dialog").forEach(n=>{n.addEventListener("mouseup",function(){const n=new bootstrap.Modal(this.closest(".modal"),{});n.unlock()})});document.querySelectorAll(".modal").forEach(n=>{n.addEventListener("mousedown",function(n){if(n.target===this){const t=new bootstrap.Modal(this,{});t.unlock()}})});createForgotPasswordSubmit();createResendConfirmEmailSubmit();document.getElementById("modal-login-container")&&document.getElementById("modal-login-container").addEventListener("d-none.bs.modal",function(){resetFieldAndLabel(document.getElementById("LoginEmail"));resetFieldAndLabel(document.getElementById("LoginPassword"))})});document.addEventListener("DOMContentLoaded",function(){function t(n,t){const i=document.getElementById(n);i.setAttribute("data-validate","fail");i.setAttribute("data-validate-message",t);updateInputValidationStyle(i)}document.getElementById("CoverFee")&&updateCoverFeeLabel(0);const n=document.getElementById("Amount");setupSelectedOtherAmount(n);setupSelectedPaymentOption(n);n&&updateTotalAmount(n.value);updateRequireAmount();document.getElementById("btnPayPal")&&resetPayPalContainer();String.prototype.startsWith||(String.prototype.startsWith=function(n,t){return t=t||0,this.indexOf(n,t)===t});getBrowser()==="Edge"&&(document.querySelectorAll(".popup-spinner").forEach(n=>{n.querySelector("img").setAttribute("src","/images/loading/spinner-green-48.gif")}),document.querySelectorAll(".btn-spinner").forEach(n=>{const t=n.closest(".efund-form-group");t.appendChild(n);n.classList.add("spinner-ie");n.querySelector("img").setAttribute("src","/images/loading/spinner-gray-32.gif")}));document.getElementById("CCNumber")&&document.getElementById("CCNumber").value!==undefined&&document.getElementById("CCNumber").value.startsWith("37")&&(document.getElementById("CCNumber").setAttribute("pattern","[0-9 ]{17}"),document.getElementById("CCSecurity").setAttribute("placeholder","•".repeat(4)),document.getElementById("CCSecurity").setAttribute("pattern","[0-9]{4}"));updateDecoyAddress();(document.getElementById("Retired")?.checked||document.querySelector("#donor-dashboard #Employer")&&document.querySelector("#donor-dashboard #Employer").value==="Retired")&&(document.querySelectorAll(".retired-toggle").forEach(n=>{n.style.display="none"}),forceEmploymentRequired(!1),document.getElementById("btn-retired-col")&&document.getElementById("btn-retired-col").classList.add("full-width"),document.querySelector("label[for='Retired']").classList.add("selected"));document.getElementById("RetiredOther")?.checked&&(document.querySelectorAll(".retired-toggle-other").forEach(n=>{n.style.display="none"}),forceEmploymentOtherRequired(!1),document.getElementById("btn-retired-col-other").classList.add("full-width"),document.querySelector("label[for='RetiredOther']").classList.add("selected"));document.getElementById("DisclaimerAgree")?.checked&&document.querySelector("label[for='DisclaimerAgree']").classList.add("selected");document.getElementById("AttendingEvent")?.checked&&document.querySelector("label[for='AttendingEvent']").classList.add("selected");document.querySelectorAll("a.disabled").forEach(n=>{n.addEventListener("click",function(n){n.preventDefault()})});let r=document.getElementById("Phone").value;r!==""&&document.getElementById("Phone").dispatchEvent(new Event("input"));document.getElementById("CustomFieldsOrder")&&(document.getElementById("CustomFieldsOrder").value=document.getElementById("CustomFieldsOrder").getAttribute("data-order"));document.querySelectorAll("input[data-fill-value]").forEach(n=>{n.value===""&&(n.value=n.getAttribute("data-fill-value"))});document.querySelector(".selected-question-field-value")&&document.querySelectorAll(".selected-question-field-value").forEach(n=>{const t=parseInt(n.value),i=document.querySelectorAll(".selected-question-field-display");if(Number.isInteger(t)&&t<i.length){const n=i[t];n.checked=!0;n.dispatchEvent(new Event("change"))}});document.getElementById("PreselectACH")&&document.getElementById("PreselectACH").value==="True"&&handleACHClick();document.getElementById("BraintreeNonce")&&(document.getElementById("BraintreeNonce").value="");const i=document.querySelector(".eFund_ErrorMessage");if(i){const n=i.innerHTML;switch(n){case"The zip code you provided does not match the credit card's reported address.":t("CCZip",n);break;case"Card Issuer Declined CVV":t("CCSecurity",n);break;case"Merchant account does not support payment instrument.":t("CCNumber",n)}}});document.addEventListener("DOMContentLoaded",function(){moveAllLabelsUp();document.querySelectorAll("input, textarea, select").forEach(n=>{n.addEventListener("focus",function(){this.parentNode.querySelector("label")&&this.parentNode.querySelector("label").classList.add("moveUp")})});document.querySelectorAll("input, textarea, select").forEach(n=>{n.addEventListener("change",function(){moveLabelUp(this)})});document.querySelectorAll("input, textarea, select").forEach(n=>{n.addEventListener("focusout",function(){if(!this.value){let n=document.getElementById(this.id);n.parentNode.querySelector("label")&&n.parentNode.querySelector("label").classList.remove("moveUp")}})});document.querySelectorAll(".modal").forEach(n=>{n.addEventListener("focus",function(n){let t=n.target;t.tagName=="INPUT"&&t.parentNode.querySelector("label").classList.add("moveUp")})});document.querySelectorAll(".modal").forEach(n=>{function t(n){let t=n.target;t.tagName=="INPUT"&&(t==document.activeElement||t.value||t.parentNode.querySelector("label").classList.remove("moveUp"))}n.addEventListener("blur",t);n.addEventListener("input",t)})});document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".two-contributor-title").forEach(n=>{n.style.display="none"});document.getElementById("AddressTitle")&&(document.getElementById("hdnAddressTitle").value=document.getElementById("AddressTitle").textContent);document.getElementById("btnCompany")&&(document.getElementById("btnCompany").addEventListener("click",function(){handleCompanyClick()}),document.getElementById("CompanyType")&&document.getElementById("CompanyType").addEventListener("change",function(){updateAuthAgentRequirement(!0);updatePAC_IDRequirement(!0)}));document.getElementById("btnPersonal")&&document.getElementById("btnPersonal").addEventListener("click",function(){handleIndividualClick()});document.getElementById("btnSecond")&&document.getElementById("btnSecond").addEventListener("click",function(){handleCoupleClick()})});document.addEventListener("DOMContentLoaded",function(){document.getElementById("CompanyDonation")&&document.getElementById("CompanyDonation").value=="t"?(document.getElementById("btnCompany").disabled=!0,document.getElementById("panelFirstLastName").style.display="none",document.getElementById("panelOtherName").style.display="none",document.getElementById("panelEmployOcc").style.display="none",document.getElementById("panelOtherEmployer").style.display="none",fadeIn(document.getElementById("panelCompanyName"),"fast"),document.getElementById("NameFirst").required=!1,document.getElementById("NameLast").required=!1,updatePAC_IDRequirement(!0),updateAuthAgentRequirement(!0),setEmploymentRequired(!1),document.getElementById("NameCompany").required=!0):document.getElementById("SecondDonation")&&document.getElementById("SecondDonation").value=="t"?(document.getElementById("btnSecond").disabled=!0,fadeIn(document.getElementById("panelFirstLastName"),"fast"),fadeIn(document.getElementById("panelOtherName"),"fast"),fadeIn(document.getElementById("panelEmployOcc"),"fast"),fadeIn(document.getElementById("panelOtherEmployer"),"fast"),document.getElementById("panelCompanyName").style.display="none",document.getElementById("NameFirst").required=!0,document.getElementById("NameLast").required=!0,document.getElementById("NameFirstOther").required=!0,document.getElementById("NameLastOther").required=!0,updatePAC_IDRequirement(!1),updateAuthAgentRequirement(!1),document.getElementById("RetiredOther").checked||(isOccupationRequired()?setEmploymentOtherRequired(!0):setEmploymentOtherRequired(!1))):(updatePAC_IDRequirement(!1),updateAuthAgentRequirement(!1),document.getElementById("btnPersonal")&&(document.getElementById("btnPersonal").disabled=!0),document.getElementById("NameFirst").required=!0,document.getElementById("NameLast").required=!0)});document.addEventListener("DOMContentLoaded",function(){document.getElementById("btnOneTime")&&document.getElementById("btnOneTime").addEventListener("click",function(){HandleOneTimeClick()});document.getElementById("btnWeekly")&&document.getElementById("btnWeekly").addEventListener("click",function(){HandleWeeklyClick(!0)});document.getElementById("btnMonthly")&&document.getElementById("btnMonthly").addEventListener("click",function(){HandleMonthlyClick(!0)});document.getElementById("btnQuarterly")&&document.getElementById("btnQuarterly").addEventListener("click",function(){HandleQuarterlyClick(!0)});document.getElementById("btnAnnually")&&document.getElementById("btnAnnually").addEventListener("click",function(){HandleAnnuallyClick(!0)});SetupRecurring(!1)});document.addEventListener("DOMContentLoaded",function(){document.getElementById("btnCreditCard")&&document.getElementById("btnCreditCard").addEventListener("click",function(){handleCreditCardClick()});document.getElementById("btnACH")&&document.getElementById("btnACH").addEventListener("click",function(){handleACHClick()});document.getElementById("btnPayPal")&&document.getElementById("btnPayPal").addEventListener("click",function(){handlePayPalClick()});document.getElementById("btnVenmo")&&document.getElementById("btnVenmo").addEventListener("click",function(){handleVenmoClick()});document.getElementById("ACHDonation")&&document.getElementById("ACHDonation").value==="True"?handleACHClick():document.getElementById("ApplePayDonation")&&document.getElementById("ApplePayDonation").value==="True"||document.getElementById("GooglePayDonation")&&document.getElementById("GooglePayDonation").value==="True"||handleCreditCardClick();document.querySelector(".btn-hide-default-pay")&&document.querySelector(".btn-hide-default-pay").addEventListener("click",function(){let n=!1;document.getElementById("section-amount")&&!validateAmount(document.querySelector(".efundForm"))&&(document.getElementById("section-amount").scrollIntoView({behavior:"smooth"}),n=!0);handleIndividualClick();handleCreditCardClick();googleAllowed=!1;toggleApplePayContainers(!1);toggleGooglePayContainers(!1);n||(document.getElementById("section-personal")?document.getElementById("section-personal").scrollIntoView({behavior:"smooth"}):document.getElementById("buttonCCPrev")&&document.getElementById("buttonCCPrev").dispatchEvent(new Event("click")))});document.getElementById("apple-pay-confirm")&&document.getElementById("apple-pay-confirm").addEventListener("click",function(){handleDefaultPayConfirmationClick(this)});document.getElementById("default-pay-confirm")&&document.getElementById("default-pay-confirm").addEventListener("click",function(){handleDefaultPayConfirmationClick(this)});document.querySelector("apple-pay-button")&&(setupApplePay(),toggleApplePayFromServerData());document.getElementById("google-pay-submit")&&(onGooglePayLoaded(),toggleGooglePayFromServerData())});document.addEventListener("DOMContentLoaded",function(){document.querySelector(".form-submit").addEventListener("click",function(){updateRealAddress()});document.getElementById("apple-pay-confirm")&&document.getElementById("apple-pay-confirm").addEventListener("click",function(){updateRealAddress()});document.getElementById("default-pay-confirm")&&document.getElementById("default-pay-confirm").addEventListener("click",function(){updateRealAddress()});document.querySelectorAll(".form-flow-btn").forEach(n=>{n.addEventListener("click",function(){updateRealAddress()})});document.getElementById("decoy-address")&&document.getElementById("decoy-address").addEventListener("focus",function(){this.getAttribute("autocomplete")==="off"&&this.setAttribute("autocomplete","nope")})});let googleComponentForm={locality:"long_name",administrative_area_level_1:"short_name",postal_code:"short_name"},autocomplete;document.addEventListener("DOMContentLoaded",function(){if(document.querySelectorAll('.form-control[type="text"]').forEach(n=>{n.addEventListener("blur",function(){this.value=this.value.trim()})}),document.getElementById("Phone")){document.getElementById("Phone").removeAttribute("maxlength");const t=document.getElementById("Phone").value;let n=t.length>0&&t[0]!="1"?new Cleave("#Phone",{delimiters:["(",") ","-"],blocks:[0,3,3,4],numericOnly:!0}):new Cleave("#Phone",{delimiters:[" (",") ","-"],blocks:[1,3,3,4],numericOnly:!0});document.getElementById("Phone").addEventListener("keyup",function(){n=updatePhoneCleave(this,n)});document.getElementById("Phone").addEventListener("input",function(){n=updatePhoneCleave(this,n);document.getElementById("Phone").value=n.properties.result})}if(document.getElementById("ApplePhone")){document.getElementById("ApplePhone").removeAttribute("maxlength");const t=document.getElementById("ApplePhone").value;let n=t.length>0&&t[0]!="1"?new Cleave("#ApplePhone",{delimiters:["(",") ","-"],blocks:[0,3,3,4],numericOnly:!0}):new Cleave("#ApplePhone",{delimiters:[" (",") ","-"],blocks:[1,3,3,4],numericOnly:!0});document.getElementById("ApplePhone").addEventListener("keyup",function(){n=updateApplePhoneCleave(this,n)});document.getElementById("ApplePhone").addEventListener("input",function(){n=updateApplePhoneCleave(this,n);document.getElementById("ApplePhone").value=n.properties.result})}if(addCleaveToZip("StreetZip"),addCleaveToZip("AppleZip"),addCleaveToZip("CCZip"),document.getElementById("CCNumber")&&(document.getElementById("CCNumber").removeAttribute("maxlength"),new Cleave("#CCNumber",{creditCard:!0})),replaceMaxlengthWithCleave("ExpDate",{date:!0,datePattern:["m","y"]}),document.getElementById("CCSecurity")){document.getElementById("CCSecurity").removeAttribute("maxlength");const t=document.getElementById("CCNumber").value,i=getCvvLengthFromCCNumber(t);let n=updateCvvCleave(i);document.getElementById("CCNumber").addEventListener("input",function(t){const r=t.target.value,i=getCvvLengthFromCCNumber(r);document.getElementById("CCSecurity").setAttribute("placeholder","•".repeat(i));document.getElementById("CCSecurity").setAttribute("pattern","[0-9]{"+i+"}");n=updateCvvCleave(i,n)})}});document.addEventListener("DOMContentLoaded",function(){document.getElementById("CCNumber")&&document.getElementById("CCNumber").addEventListener("input",function(n){const t=n.target.value,i=getCCLengthFromCCNumber(t);this.setAttribute("pattern","[0-9 ]{"+i+"}")})});document.addEventListener("DOMContentLoaded",function(){document.getElementById("CCNumber")&&document.getElementById("CCNumber").addEventListener("input",function(){showCCIcon(this)})});window.addEventListener("load",function(){document.getElementById("CCNumber")&&showCCIcon(document.getElementById("CCNumber"))});document.addEventListener("DOMContentLoaded",function(){function n(n){n.checked?(setTimeout(function(){n.checked&&fadeIn(document.getElementById("panelCCAddress"),"fast")},300),document.getElementById("CCZip").required=!0,document.getElementById("CCZip").setAttribute("rerequire","true"),document.getElementById("CCZip").setAttribute("pattern","[0-9]{5}"),document.getElementById("CCAddressDifferentColumn").classList.remove("col-md-12"),document.getElementById("CCAddressDifferentColumn").classList.add("col-md-8")):(document.getElementById("panelCCAddress").style.display="none",document.getElementById("CCZip").required=!1,document.getElementById("CCZip").removeAttribute("rerequire"),document.getElementById("CCZip").removeAttribute("pattern"),document.getElementById("CCAddressDifferentColumn").classList.add("col-md-12"),document.getElementById("CCAddressDifferentColumn").classList.remove("col-md-8"))}document.getElementById("CCAddressDifferent")&&(n(document.getElementById("CCAddressDifferent")),document.getElementById("CCAddressDifferent").addEventListener("change",function(){n(this)}))});document.addEventListener("DOMContentLoaded",function(){document.getElementById("OtherAmount")&&(document.getElementById("OtherAmount").addEventListener("keydown",function(n){allowDecimalNumber(this,n)}),document.getElementById("OtherAmount").addEventListener("input",function(){limitTwoDecimal(this)}),document.getElementById("OtherAmount").addEventListener("blur",function(){clearNumberField(this)}))});document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".numbersOnly").forEach(n=>{n.addEventListener("keydown",function(n){[46,8,9,27,13].indexOf(n.keyCode)!==-1||n.keyCode===65&&(n.ctrlKey===!0||n.metaKey===!0)||n.keyCode===86&&(n.ctrlKey===!0||n.metaKey===!0)||n.keyCode>=35&&n.keyCode<=40||(n.shiftKey||n.keyCode<48||n.keyCode>57)&&(n.keyCode<96||n.keyCode>105)&&n.preventDefault()})});document.querySelectorAll(".no-space").forEach(n=>{n.addEventListener("keydown",function(n){n.keyCode===32&&n.preventDefault()}),n.addEventListener("input",function(){this.value=this.value.replace(/\s/g,"")})})});document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".efund_PaymentOptionItem").forEach(n=>{n.addEventListener("click",function(){document.querySelectorAll(".efund_PaymentOptionItem").forEach(n=>{n.classList.remove("selectedOption")});this.classList.add("selectedOption");updateTotalAmount(this.getAttribute("data-amount"));resetFieldAndLabel(document.getElementById("OtherAmount"));document.getElementById("OtherAmount").classList.remove("invalid");document.getElementById("OtherAmount").parentNode.querySelector(".error")&&document.getElementById("OtherAmount").parentNode.querySelector(".error").remove();document.getElementById("OtherAmount").parentNode.querySelector(".error-icon")&&document.getElementById("OtherAmount").parentNode.querySelector(".error-icon").remove();document.getElementById("OtherAmount").parentNode.querySelector(".more-info-btn")&&document.getElementById("OtherAmount").parentNode.querySelector(".more-info-btn").classList.remove("red");document.getElementById("mainSubmit").removeAttribute("fromOtherAmount");validateInput(document.getElementById("OtherAmount"));updateInputValidationStyle(document.getElementById("OtherAmount"));document.getElementById("missing-amount").style.display="none";updateRequireAmount();document.getElementById("btnPayPal")&&resetPayPalContainer()})});document.getElementById("OtherAmount")&&document.getElementById("OtherAmount").addEventListener("focusout",function(){let n=this.value,t=parseFloat(n),i=!!document.getElementById("mainSubmit").getAttribute("fromOtherAmount");(n===""||isNaN(t))&&!i?this.parentNode.querySelector("label").classList.remove("moveUp"):n&&t!=0?(document.querySelectorAll(".efund_PaymentOptionItem").forEach(n=>{n.classList.remove("selectedOption")}),document.getElementById("mainSubmit").setAttribute("fromOtherAmount","true"),document.getElementById("missing-amount").style.display="none",updateTotalAmount(n)):(this.value="",this.parentNode.querySelector("label").classList.remove("moveUp"),document.querySelector("#mainSubmit .btn-text").textContent=document.getElementById("mainSubmit").value,document.querySelector(".venmo-summary-total-value")&&(document.querySelector(".venmo-summary-total-value").textContent="0"),document.getElementById("mainSubmit").removeAttribute("fromOtherAmount"),document.querySelector(".selectedOption")?updateTotalAmount(document.getElementById("Amount").value):updateTotalAmount("0"));updateRequireAmount();document.getElementById("btnPayPal")&&(updatePayPalStatus(),resetPayPalContainer());updateFieldErrors()});document.querySelectorAll(".disallow-spaces").forEach(n=>{n.addEventListener("keydown",function(n){if(n.keyCode==32)return!1})});document.getElementById("CoverFee")&&document.getElementById("CoverFee").addEventListener("change",function(){this.checked?parseFloat(document.getElementById("BaseAmount").value)>0&&updateTotalAmount(document.getElementById("BaseAmount").value):updateTotalAmount(document.getElementById("BaseAmount").value);runIterationsValidation();validateCoverFee()});document.getElementById("Iterations")&&document.getElementById("Iterations").addEventListener("change",function(){runIterationsValidation();updateRequireAmount()});document.getElementById("NumberOfGuests")&&document.getElementById("NumberOfGuests").addEventListener("change",function(){this.value==""&&(this.value="0")})});let defaultShown;let appleShown;let googleShown,googleAllowed=!0,baseRequest={apiVersion:2,apiVersionMinor:0},paymentsClient=null,allowedGooglePaymentMethods=null,merchantInfo=null;let googleButtonExists=!1;document.addEventListener("DOMContentLoaded",function(){function n(){let i,n,u,f,r;i=document.querySelectorAll(".efund_PaymentOptionItem").length+1;n=t();document.querySelector(".efund_PaymentOptionItem .efund_PaymentOptionDesc")&&(n-=1);u=i<n?i:i%n==0||(i+1)%n==0?n:i%(n-1)==0||(i+1)%(n-1)==0?n-1:n===5&&(i%(n-2)==0||(i+1)%(n-2)==0)?n-2:n;f=1/u;r=Math.floor(f*1e4)/100;document.querySelectorAll(".efund_PaymentOptionItem").forEach(n=>{n.style.width=r+"%"});document.querySelectorAll(".efund_PaymentOptionOther").forEach(n=>{n.style.width=r+"%"})}function t(){if(document.querySelector(".efund_PaymentOptionList")){let n=document.querySelector(".efund_PaymentOptionList").offsetWidth;return n<=293?2:n<=393?3:n<=513?4:5}}n();document.getElementById("OtherAmount")&&reduceLabelSize(document.getElementById("OtherAmount").closest(".efund-form-group"));window.addEventListener("load",function(){n();document.getElementById("OtherAmount")&&reduceLabelSize(document.getElementById("OtherAmount").closest(".efund-form-group"))});window.addEventListener("resize",function(){n();document.getElementById("OtherAmount")&&reduceLabelSize(document.getElementById("OtherAmount").closest(".efund-form-group"))});document.getElementById("contribution-tab-btn")&&document.getElementById("contribution-tab-btn").addEventListener("click",function(){window.setTimeout(n,400)})});document.addEventListener("DOMContentLoaded",function(){if(document.querySelector("#efund-recurring-btns .btn-wrapper")){const n=document.querySelectorAll("#efund-recurring-btns .btn-wrapper").length;document.querySelectorAll("#efund-recurring-btns .btn-wrapper")[n-1].classList.add("last")}});window.addEventListener("load",function(){document.querySelector("#efund-recurring-btns .btn-wrapper")&&resizeRecurringButtons()});window.addEventListener("resize",function(){document.querySelector("#efund-recurring-btns .btn-wrapper")&&resizeRecurringButtons()});document.addEventListener("DOMContentLoaded",function(){document.getElementById("contribution-tab-btn")&&document.getElementById("contribution-tab-btn").addEventListener("click",function(){document.querySelector("#efund-recurring-btns .btn-wrapper")&&window.setTimeout(resizeRecurringButtons,400)})});document.addEventListener("DOMContentLoaded",function(){function n(n){let t=n.closest(".checkbox-button").querySelector("label");n.checked?(t.classList.add("selected"),t.querySelector(".fa-check")&&t.querySelector(".fa-check").classList.remove("d-none")):(t.classList.remove("selected"),t.querySelector(".fa-check")&&t.querySelector(".fa-check").classList.add("d-none"))}document.querySelectorAll('.checkbox-button input[type="checkbox"]').forEach(t=>{n(t),t.addEventListener("change",function(){n(this)}),t.addEventListener("focus blur",function(){this.closest(".checkbox-button").querySelector("label").classList.add("focused")})})});document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll('.custom-check input[type="checkbox"]').forEach(n=>{customCheck(n),n.addEventListener("change",function(){customCheck(this)}),n.addEventListener("focus",function(){this.parentNode.querySelector("label").classList.add("focused")}),n.addEventListener("blur",function(){this.parentNode.querySelector("label").classList.remove("focused")})})});document.addEventListener("DOMContentLoaded",function(){document.getElementById("Retired")&&document.getElementById("Retired").addEventListener("change",function(){document.getElementById("employer-info")&&document.getElementById("employer-info").classList.add("d-none");this.checked?(document.querySelectorAll(".retired-toggle").forEach(n=>{n.style.display="none"}),forceEmploymentRequired(!1),document.getElementById("btn-retired-col")&&document.getElementById("btn-retired-col").classList.add("full-width")):(document.getElementById("btn-retired-col")&&document.getElementById("btn-retired-col").classList.remove("full-width"),setTimeout(function(){document.getElementById("Retired").checked||document.querySelectorAll(".retired-toggle").forEach(n=>{fadeIn(n,"fast")})},300),isOccupationRequired()?forceEmploymentRequired(!0):forceEmploymentRequired(!1))});document.getElementById("RetiredOther")&&document.getElementById("RetiredOther").addEventListener("change",function(){document.getElementById("employer-info-other").classList.add("d-none");this.checked?(document.querySelectorAll(".retired-toggle-other").forEach(n=>{n.style.display="none"}),forceEmploymentOtherRequired(!1),document.getElementById("btn-retired-col-other").classList.add("full-width")):(document.getElementById("btn-retired-col-other").classList.remove("full-width"),setTimeout(function(){document.getElementById("RetiredOther").checked||document.querySelectorAll(".retired-toggle-other").forEach(n=>{fadeIn(n,"fast")})},300),isOccupationRequired()?forceEmploymentOtherRequired(!0):forceEmploymentOtherRequired(!1))})});document.querySelectorAll(".more-info-btn").forEach(n=>{n.addEventListener("click",function(){let t=this.getAttribute("data-toggle"),n=document.getElementById(t).classList;n.contains("d-none")?n.remove("d-none"):n.add("d-none")})});window.addEventListener("load",function(){document.querySelectorAll(".efund-form-group").forEach(n=>{reduceLabelSize(n)})});document.getElementById("CCAddressDifferentLabel")&&document.getElementById("CCAddressDifferentLabel").addEventListener("click",function(){setTimeout(function(){reduceLabelSize(document.getElementById("CCZip").closest(".efund-form-group"))},600)});document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll("input[type='submit'], button[type='submit']").forEach(n=>{n.addEventListener("click",function(n){updateFieldsOnSubmit();updateRequireAmount();validateAndLogForm(this)?handlePostValidation(this,n):n.preventDefault(n)})});window.addEventListener("load",function(){document.getElementById("donor-dashboard")&&document.getElementById("modal-missinginfo-container")&&validateEntireForm(document.getElementById("userInfoForm"))})});document.addEventListener("DOMContentLoaded",function(){function n(n){t||(validateInput(n),updateInputValidationStyle(n),document.getElementById("btnPayPal")&&updatePayPalStatus(),updateFieldErrors())}let t=!1;document.getElementById("mainSubmit").addEventListener("mousedown",function(){t=!0});document.getElementById("mainSubmit").addEventListener("mouseup",function(){t=!1});document.querySelectorAll(".form-control").forEach(t=>{t.addEventListener("change",function(){n(this)}),t.addEventListener("blur",function(){n(this)})});document.getElementById("StreetState").addEventListener("change",function(){n(document.getElementById("StreetZip"))});document.getElementById("AppleState")&&document.getElementById("AppleState").addEventListener("change",function(){n(document.getElementById("AppleZip"))});document.querySelectorAll(".form-control").forEach(n=>{n.addEventListener("focus",function(){this.classList.remove("invalid");this.parentNode.querySelector(".error-icon")&&this.parentNode.querySelector(".error-icon").remove();this.parentNode.querySelector(".more-info-btn")&&this.parentNode.querySelector(".more-info-btn").classList.remove("red")})});document.querySelectorAll(".checkbox").forEach(n=>{n.addEventListener("click",function(){validateCheckbox(this);updateInputValidationStyle(this);document.getElementById("btnPayPal")&&updatePayPalStatus();updateFieldErrors()})})});document.addEventListener("DOMContentLoaded",function(){if(document.getElementById("Phone")){let n=document.getElementById("Phone").value;n!==""&&document.getElementById("Phone").dispatchEvent(new Event("input"))}});window.addEventListener("load",function(){document.querySelectorAll(".no-gutter-row .efund-form-col").forEach(n=>{checkIfEndField(n)})});window.addEventListener("resize",function(){document.querySelectorAll(".no-gutter-row .efund-form-col").forEach(n=>{checkIfEndField(n)})});document.getElementById("btnSecond")&&document.getElementById("btnSecond").addEventListener("click",function(){window.setTimeout(function(){checkIfEndField(document.getElementById("NameFirstOther").closest(".efund-form-col"));checkIfEndField(document.getElementById("NameLastOther").closest(".efund-form-col"))},200)});document.getElementById("achNavButton")&&document.getElementById("achNavButton").addEventListener("click",function(){window.setTimeout(function(){checkIfEndField(document.getElementById("AchRouting").closest(".efund-form-col"));checkIfEndField(document.getElementById("AchAccount").closest(".efund-form-col"))},200)});document.getElementById("modal-oneclick-container")&&document.getElementById("modal-oneclick-container").addEventListener("show.bs.modal",function(){window.setTimeout(function(){document.querySelectorAll("#apple-pay-popup .no-gutter-row .efund-form-col").forEach(n=>{checkIfEndField(n)})},200)});window.addEventListener("load",function(){function n(n,i){var e;if(document.getElementById("efund-form-col-2")&&t()>991){var o=document.getElementById("efund-form-col-1"),s=document.getElementById("efund-form-col-2"),r=o.offsetHeight,u=s.offsetHeight,f=getComputedStyle(n).getPropertyValue("height");u-f<r&&(e=Math.max(i,r-(u-f)),n.style.maxHeight=e)}}function t(){var n=window,t="inner";return"innerWidth"in window||(t="client",n=document.documentElement||document.body),n[t+"Width"]}document.querySelector(".checkbox-disclaimer-msg")&&n(document.querySelector(".checkbox-disclaimer-msg"),90)});document.addEventListener("DOMContentLoaded",function(){document.getElementById("MerchandiseJSON")&&(updateFieldsIfProductServerData(),document.querySelectorAll(".ticket .qty-field").forEach(n=>{checkQtyMin(n)}),document.querySelectorAll(".sold-out .qty-field").forEach(n=>{n.value="0"}),setupGiveAmount(),updateTickets(),updateDisplayedTotalAmount(document.getElementById("Amount").value),isNaN(parseFloat(document.getElementById("GiveAmount").value))?preventRecurring():(allowRecurring(),showCancel()),document.querySelectorAll(".efund_PaymentOptionItem").forEach(n=>{n.addEventListener("click",function(){const n=document.getElementById("GiveAmount");n.value=this.getAttribute("data-amount");n.dispatchEvent(new Event("change"));allowRecurring();showCancel()})}),document.getElementById("OtherAmount").addEventListener("blur",function(){const n=this.value;if(n!==""||!document.querySelectorAll(".selectedOption")[0]){const t=document.getElementById("GiveAmount");t.value=n;t.dispatchEvent(new Event("change"))}n!==""?(allowRecurring(),showCancel()):document.querySelectorAll(".efund_PaymentOptionItem.selectedOption").length===0&&cancelContribution()}),document.getElementById("cancel-contribution-btn").addEventListener("click",function(){cancelContribution()}),document.querySelectorAll(".qty-btn").forEach(n=>{n.addEventListener("click",function(){changeTicketQty(this,this.parentNode.querySelector(".qty-field"))})}),document.getElementById("GiveAmount").addEventListener("change",function(){updateTickets();runIterationsValidation()}),document.querySelectorAll(".ticket .qty-field").forEach(n=>{n.addEventListener("change",function(){updateTickets();checkQtyMin(this);checkQtyMax(this);runIterationsValidation();const t=n.closest(".merchandise-item");updateProductVariantRequire(t)})}),document.querySelectorAll(".ticket .product-variant-field").forEach(n=>{n.addEventListener("change",function(){updateTickets()})}),document.getElementById("Amount").addEventListener("change",function(){handleAmountChangeWithMerch()}),document.getElementById("Iterations")&&document.getElementById("Iterations").addEventListener("change",function(){handleAmountChangeWithMerch()}))});
/*!
 * cleave.js - 1.4.7
 * https://github.com/nosir/cleave.js
 * Apache License Version 2.0
 *
 * Copyright (C) 2012-2018 Max Huang https://github.com/nosir/
 */
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cleave=t():n.Cleave=t()}(this,function(){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={exports:{},id:r,loaded:!1};return n[r].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var i={};return t.m=n,t.c=i,t.p="",t(0)}([function(n,t,i){(function(t){"use strict";var r=function(n,t){var i=this;if(i.element="string"==typeof n?document.querySelector(n):"undefined"!=typeof n.length&&n.length>0?n[0]:n,!i.element)throw new Error("[cleave.js] Please check the element");t.initValue=i.element.value;i.properties=r.DefaultProperties.assign({},t);i.init()};r.prototype={init:function(){var n=this,t=n.properties;return t.numeral||t.phone||t.creditCard||t.time||t.date||0!==t.blocksLength||t.prefix?(t.maxLength=r.Util.getMaxLength(t.blocks),n.isAndroid=r.Util.isAndroid(),n.lastInputValue="",n.onChangeListener=n.onChange.bind(n),n.onKeyDownListener=n.onKeyDown.bind(n),n.onFocusListener=n.onFocus.bind(n),n.onCutListener=n.onCut.bind(n),n.onCopyListener=n.onCopy.bind(n),n.element.addEventListener("input",n.onChangeListener),n.element.addEventListener("keydown",n.onKeyDownListener),n.element.addEventListener("focus",n.onFocusListener),n.element.addEventListener("cut",n.onCutListener),n.element.addEventListener("copy",n.onCopyListener),n.initPhoneFormatter(),n.initDateFormatter(),n.initTimeFormatter(),n.initNumeralFormatter(),void((t.initValue||t.prefix&&!t.noImmediatePrefix)&&n.onInput(t.initValue))):void n.onInput(t.initValue)},initNumeralFormatter:function(){var t=this,n=t.properties;n.numeral&&(n.numeralFormatter=new r.NumeralFormatter(n.numeralDecimalMark,n.numeralIntegerScale,n.numeralDecimalScale,n.numeralThousandsGroupStyle,n.numeralPositiveOnly,n.stripLeadingZeroes,n.delimiter))},initTimeFormatter:function(){var t=this,n=t.properties;n.time&&(n.timeFormatter=new r.TimeFormatter(n.timePattern,n.timeFormat),n.blocks=n.timeFormatter.getBlocks(),n.blocksLength=n.blocks.length,n.maxLength=r.Util.getMaxLength(n.blocks))},initDateFormatter:function(){var t=this,n=t.properties;n.date&&(n.dateFormatter=new r.DateFormatter(n.datePattern),n.blocks=n.dateFormatter.getBlocks(),n.blocksLength=n.blocks.length,n.maxLength=r.Util.getMaxLength(n.blocks))},initPhoneFormatter:function(){var t=this,n=t.properties;if(n.phone)try{n.phoneFormatter=new r.PhoneFormatter(new n.root.Cleave.AsYouTypeFormatter(n.phoneRegionCode),n.delimiter)}catch(i){throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib");}},onKeyDown:function(n){var t=this,i=t.properties,u=n.which||n.keyCode,o=r.Util,f=t.element.value,e;t.hasBackspaceSupport=t.hasBackspaceSupport||8===u;!t.hasBackspaceSupport&&o.isAndroidBackspaceKeydown(t.lastInputValue,f)&&(u=8);t.lastInputValue=f;e=o.getPostDelimiter(f,i.delimiter,i.delimiters);i.postDelimiterBackspace=8===u&&e?e:!1},onChange:function(){this.onInput(this.element.value)},onFocus:function(){var t=this,n=t.properties;r.Util.fixPrefixCursor(t.element,n.prefix,n.delimiter,n.delimiters)},onCut:function(n){this.copyClipboardData(n);this.onInput("")},onCopy:function(n){this.copyClipboardData(n)},copyClipboardData:function(n){var i=this,t=i.properties,e=r.Util,u=i.element.value,f=t.copyDelimiter?u:e.stripDelimiters(u,t.delimiter,t.delimiters);try{n.clipboardData?n.clipboardData.setData("Text",f):window.clipboardData.setData("Text",f);n.preventDefault()}catch(o){}},onInput:function(n){var u=this,t=u.properties,i=r.Util,f=i.getPostDelimiter(n,t.delimiter,t.delimiters);return t.numeral||!t.postDelimiterBackspace||f||(n=i.headStr(n,n.length-t.postDelimiterBackspace.length)),t.phone?(t.result=!t.prefix||t.noImmediatePrefix&&!n.length?t.phoneFormatter.format(n):t.prefix+t.phoneFormatter.format(n).slice(t.prefix.length),void u.updateValueState()):t.numeral?(t.result=!t.prefix||t.noImmediatePrefix&&!n.length?t.numeralFormatter.format(n):t.prefix+t.numeralFormatter.format(n),void u.updateValueState()):(t.date&&(n=t.dateFormatter.getValidatedDate(n)),t.time&&(n=t.timeFormatter.getValidatedTime(n)),n=i.stripDelimiters(n,t.delimiter,t.delimiters),n=i.getPrefixStrippedValue(n,t.prefix,t.prefixLength,t.result),n=t.numericOnly?i.strip(n,/[^\d]/g):n,n=t.uppercase?n.toUpperCase():n,n=t.lowercase?n.toLowerCase():n,!t.prefix||t.noImmediatePrefix&&!n.length||(n=t.prefix+n,0!==t.blocksLength)?(t.creditCard&&u.updateCreditCardPropsByValue(n),n=i.headStr(n,t.maxLength),t.result=i.getFormattedValue(n,t.blocks,t.blocksLength,t.delimiter,t.delimiters,t.delimiterLazyShow),void u.updateValueState()):(t.result=n,void u.updateValueState()))},updateCreditCardPropsByValue:function(n){var i,f=this,t=f.properties,u=r.Util;u.headStr(t.result,4)!==u.headStr(n,4)&&(i=r.CreditCardDetector.getInfo(n,t.creditCardStrictMode),t.blocks=i.blocks,t.blocksLength=t.blocks.length,t.maxLength=u.getMaxLength(t.blocks),t.creditCardType!==i.type&&(t.creditCardType=i.type,t.onCreditCardTypeChanged.call(f,t.creditCardType)))},updateValueState:function(){var n=this,u=r.Util,t=n.properties;if(n.element){var i=n.element.selectionEnd,e=n.element.value,f=t.result;if(i=u.getNextCursorPosition(i,e,f,t.delimiter,t.delimiters),n.isAndroid)return void window.setTimeout(function(){n.element.value=f;u.setSelection(n.element,i,t.document,!1);n.callOnValueChanged()},1);n.element.value=f;u.setSelection(n.element,i,t.document,!1);n.callOnValueChanged()}},callOnValueChanged:function(){var n=this,t=n.properties;t.onValueChanged.call(n,{target:{value:t.result,rawValue:n.getRawValue()}})},setPhoneRegionCode:function(n){var t=this,i=t.properties;i.phoneRegionCode=n;t.initPhoneFormatter();t.onChange()},setRawValue:function(n){var t=this,i=t.properties;n=void 0!==n&&null!==n?n.toString():"";i.numeral&&(n=n.replace(".",i.numeralDecimalMark));i.postDelimiterBackspace=!1;t.element.value=n;t.onInput(n)},getRawValue:function(){var i=this,n=i.properties,u=r.Util,t=i.element.value;return n.rawValueTrimPrefix&&(t=u.getPrefixStrippedValue(t,n.prefix,n.prefixLength,n.result)),t=n.numeral?n.numeralFormatter.getRawValue(t):u.stripDelimiters(t,n.delimiter,n.delimiters)},getISOFormatDate:function(){var t=this,n=t.properties;return n.date?n.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var t=this,n=t.properties;return n.time?n.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var n=this;n.element.removeEventListener("input",n.onChangeListener);n.element.removeEventListener("keydown",n.onKeyDownListener);n.element.removeEventListener("focus",n.onFocusListener);n.element.removeEventListener("cut",n.onCutListener);n.element.removeEventListener("copy",n.onCopyListener)},toString:function(){return"[Cleave Object]"}};r.NumeralFormatter=i(1);r.DateFormatter=i(2);r.TimeFormatter=i(3);r.PhoneFormatter=i(4);r.CreditCardDetector=i(5);r.Util=i(6);r.DefaultProperties=i(7);("object"==typeof t&&t?t:window).Cleave=r;n.exports=r}).call(t,function(){return this}())},function(n){"use strict";var t=function(n,i,r,u,f,e,o){var s=this;s.numeralDecimalMark=n||".";s.numeralIntegerScale=i>0?i:0;s.numeralDecimalScale=r>=0?r:2;s.numeralThousandsGroupStyle=u||t.groupStyle.thousand;s.numeralPositiveOnly=!!f;s.stripLeadingZeroes=e!==!1;s.delimiter=o||""===o?o:",";s.delimiterRE=o?new RegExp("\\"+o,"g"):""};t.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"};t.prototype={getRawValue:function(n){return n.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(n){var u,r,i=this,f="";switch(n=n.replace(/[A-Za-z]/g,"").replace(i.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",i.numeralPositiveOnly?"":"-").replace("M",i.numeralDecimalMark),i.stripLeadingZeroes&&(n=n.replace(/^(-)?0+(?=\d)/,"$1")),r=n,n.indexOf(i.numeralDecimalMark)>=0&&(u=n.split(i.numeralDecimalMark),r=u[0],f=i.numeralDecimalMark+u[1].slice(0,i.numeralDecimalScale)),i.numeralIntegerScale>0&&(r=r.slice(0,i.numeralIntegerScale+("-"===n.slice(0,1)?1:0))),i.numeralThousandsGroupStyle){case t.groupStyle.lakh:r=r.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+i.delimiter);break;case t.groupStyle.wan:r=r.replace(/(\d)(?=(\d{4})+$)/g,"$1"+i.delimiter);break;case t.groupStyle.thousand:r=r.replace(/(\d)(?=(\d{3})+$)/g,"$1"+i.delimiter)}return r.toString()+(i.numeralDecimalScale>0?f.toString():"")}};n.exports=t},function(n){"use strict";var t=function(n){var t=this;t.date=[];t.blocks=[];t.datePattern=n;t.initBlocks()};t.prototype={initBlocks:function(){var n=this;n.datePattern.forEach(function(t){"Y"===t?n.blocks.push(4):n.blocks.push(2)})},getISOFormatDate:function(){var t=this,n=t.date;return n[2]?n[2]+"-"+t.addLeadingZero(n[1])+"-"+t.addLeadingZero(n[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(n){var t=this,i="";return n=n.replace(/[^\d]/g,""),t.blocks.forEach(function(r,u){if(n.length>0){var f=n.slice(0,r),e=f.slice(0,1),o=n.slice(r);switch(t.datePattern[u]){case"d":"00"===f?f="01":parseInt(e,10)>3?f="0"+e:parseInt(f,10)>31&&(f="31");break;case"m":"00"===f?f="01":parseInt(e,10)>1?f="0"+e:parseInt(f,10)>12&&(f="12")}i+=f;n=o}}),this.getFixedDateString(i)},getFixedDateString:function(n){var o,s,a,u=this,f=u.datePattern,t=[],h=0,c=0,l=0,i=0,r=0,e=0,v=!1;return 4===n.length&&"y"!==f[0].toLowerCase()&&"y"!==f[1].toLowerCase()&&(i="d"===f[0]?0:2,r=2-i,o=parseInt(n.slice(i,i+2),10),s=parseInt(n.slice(r,r+2),10),t=this.getFixedDate(o,s,0)),8===n.length&&(f.forEach(function(n,t){switch(n){case"d":h=t;break;case"m":c=t;break;default:l=t}}),e=2*l,i=h<=l?2*h:2*h+2,r=c<=l?2*c:2*c+2,o=parseInt(n.slice(i,i+2),10),s=parseInt(n.slice(r,r+2),10),a=parseInt(n.slice(e,e+4),10),v=4===n.slice(e,e+4).length,t=this.getFixedDate(o,s,a)),u.date=t,0===t.length?n:f.reduce(function(n,i){switch(i){case"d":return n+u.addLeadingZero(t[0]);case"m":return n+u.addLeadingZero(t[1]);default:return n+(v?u.addLeadingZeroForYear(t[2]):"")}},"")},getFixedDate:function(n,t,i){return n=Math.min(n,31),t=Math.min(t,12),i=parseInt(i||0,10),(t<7&&t%2==0||t>8&&t%2==1)&&(n=Math.min(n,2===t?this.isLeapYear(i)?29:28:30)),[n,t,i]},isLeapYear:function(n){return n%4==0&&n%100!=0||n%400==0},addLeadingZero:function(n){return(n<10?"0":"")+n},addLeadingZeroForYear:function(n){return(n<10?"000":n<100?"00":n<1e3?"0":"")+n}};n.exports=t},function(n){"use strict";var t=function(n,t){var i=this;i.time=[];i.blocks=[];i.timePattern=n;i.timeFormat=t;i.initBlocks()};t.prototype={initBlocks:function(){var n=this;n.timePattern.forEach(function(){n.blocks.push(2)})},getISOFormatTime:function(){var n=this,t=n.time;return t[2]?n.addLeadingZero(t[0])+":"+n.addLeadingZero(t[1])+":"+n.addLeadingZero(t[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){var n=this;return"12"===String(n.timeFormat)?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(n){var i=this,r="",t;return n=n.replace(/[^\d]/g,""),t=i.getTimeFormatOptions(),i.blocks.forEach(function(u,f){if(n.length>0){var e=n.slice(0,u),o=e.slice(0,1),s=n.slice(u);switch(i.timePattern[f]){case"h":parseInt(o,10)>t.maxHourFirstDigit?e="0"+o:parseInt(e,10)>t.maxHours&&(e=t.maxHours+"");break;case"m":case"s":parseInt(o,10)>t.maxMinutesFirstDigit?e="0"+o:parseInt(e,10)>t.maxMinutes&&(e=t.maxMinutes+"")}r+=e;n=s}}),this.getFixedTimeString(r)},getFixedTimeString:function(n){var f,e,o,i=this,c=i.timePattern,t=[],a=0,s=0,h=0,l=0,r=0,u=0;return 6===n.length&&(c.forEach(function(n,t){switch(n){case"s":a=2*t;break;case"m":s=2*t;break;case"h":h=2*t}}),u=h,r=s,l=a,f=parseInt(n.slice(l,l+2),10),e=parseInt(n.slice(r,r+2),10),o=parseInt(n.slice(u,u+2),10),t=this.getFixedTime(o,e,f)),4===n.length&&i.timePattern.indexOf("s")<0&&(c.forEach(function(n,t){switch(n){case"m":s=2*t;break;case"h":h=2*t}}),u=h,r=s,f=0,e=parseInt(n.slice(r,r+2),10),o=parseInt(n.slice(u,u+2),10),t=this.getFixedTime(o,e,f)),i.time=t,0===t.length?n:c.reduce(function(n,r){switch(r){case"s":return n+i.addLeadingZero(t[2]);case"m":return n+i.addLeadingZero(t[1]);case"h":return n+i.addLeadingZero(t[0])}},"")},getFixedTime:function(n,t,i){return i=Math.min(parseInt(i||0,10),60),t=Math.min(t,60),n=Math.min(n,60),[n,t,i]},addLeadingZero:function(n){return(n<10?"0":"")+n}};n.exports=t},function(n){"use strict";var t=function(n,t){var i=this;i.delimiter=t||""===t?t:" ";i.delimiterRE=t?new RegExp("\\"+t,"g"):"";i.formatter=n};t.prototype={setFormatter:function(n){this.formatter=n},format:function(n){var i=this;i.formatter.clear();n=n.replace(/[^\d+]/g,"");n=n.replace(/^\+/,"B").replace(/\+/g,"").replace("B","+");n=n.replace(i.delimiterRE,"");for(var r,t="",f=!1,u=0,e=n.length;u<e;u++)r=i.formatter.inputDigit(n.charAt(u)),/[\s()-]/g.test(r)?(t=r,f=!0):f||(t=r);return t=t.replace(/[()]/g,""),t=t.replace(/[\s-]/g,i.delimiter)}};n.exports=t},function(n){"use strict";var t={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4],generalStrict:[4,4,4,7]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^62\d{0,14}/},getInfo:function(n,i){var r=t.blocks,f=t.re,u,e;i=!!i;for(u in f)if(f[u].test(n))return e=i?r.generalStrict:r[u],{type:u,blocks:e};return{type:"unknown",blocks:i?r.generalStrict:r.general}}};n.exports=t},function(n){"use strict";var t={noop:function(){},strip:function(n,t){return n.replace(t,"")},getPostDelimiter:function(n,t,i){if(0===i.length)return n.slice(-t.length)===t?t:"";var r="";return i.forEach(function(t){n.slice(-t.length)===t&&(r=t)}),r},getDelimiterREByDelimiter:function(n){return new RegExp(n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(n,t,i,r,u){return t.length===n?i.length:n+this.getPositionOffset(n,t,i,r,u)},getPositionOffset:function(n,t,i,r,u){var e,o,f;return e=this.stripDelimiters(t.slice(0,n),r,u),o=this.stripDelimiters(i.slice(0,n),r,u),f=e.length-o.length,0!==f?f/Math.abs(f):0},stripDelimiters:function(n,t,i){var r=this,u;return 0===i.length?(u=t?r.getDelimiterREByDelimiter(t):"",n.replace(u,"")):(i.forEach(function(t){t.split("").forEach(function(t){n=n.replace(r.getDelimiterREByDelimiter(t),"")})}),n)},headStr:function(n,t){return n.slice(0,t)},getMaxLength:function(n){return n.reduce(function(n,t){return n+t},0)},getPrefixStrippedValue:function(n,t,i,r){if(n.slice(0,i)!==t)if(n.length<r.length)n=n.length>i?r:t;else{var u=this.getFirstDiffIndex(t,n.slice(0,i));n=t+n.slice(u,u+1)+n.slice(i+1)}return n.slice(i)},getFirstDiffIndex:function(n,t){for(var i=0;n.charAt(i)===t.charAt(i);)if(""===n.charAt(i++))return-1;return i},getFormattedValue:function(n,t,i,r,u,f){var o,e="",s=u.length>0;return 0===i?n:(t.forEach(function(t,h){if(n.length>0){var c=n.slice(0,t),l=n.slice(t);o=s?u[f?h-1:h]||o:r;f?(h>0&&(e+=o),e+=c):(e+=c,c.length===t&&h<i-1&&(e+=o));n=l}}),e)},fixPrefixCursor:function(n,t,i,r){var u,e,f;n&&(u=n.value,e=i||r[0]||" ",!n.setSelectionRange||!t||t.length+e.length<u.length||(f=2*u.length,setTimeout(function(){n.setSelectionRange(f,f)},1)))},setSelection:function(n,t,i){if(n===this.getActiveElement(i)&&!(n&&n.value.length<=t))if(n.createTextRange){var r=n.createTextRange();r.move("character",t);r.select()}else try{n.setSelectionRange(t,t)}catch(u){console.warn("The input element type does not support selection")}},getActiveElement:function(n){var t=n.activeElement;return t&&t.shadowRoot?this.getActiveElement(t.shadowRoot):t},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(n,t){return!!(this.isAndroid()&&n&&t)&&t===n.slice(0,-1)}};n.exports=t},function(n,t){(function(t){"use strict";var i={assign:function(n,i){return n=n||{},i=i||{},n.creditCard=!!i.creditCard,n.creditCardStrictMode=!!i.creditCardStrictMode,n.creditCardType="",n.onCreditCardTypeChanged=i.onCreditCardTypeChanged||function(){},n.phone=!!i.phone,n.phoneRegionCode=i.phoneRegionCode||"AU",n.phoneFormatter={},n.time=!!i.time,n.timePattern=i.timePattern||["h","m","s"],n.timeFormat=i.timeFormat||"24",n.timeFormatter={},n.date=!!i.date,n.datePattern=i.datePattern||["d","m","Y"],n.dateFormatter={},n.numeral=!!i.numeral,n.numeralIntegerScale=i.numeralIntegerScale>0?i.numeralIntegerScale:0,n.numeralDecimalScale=i.numeralDecimalScale>=0?i.numeralDecimalScale:2,n.numeralDecimalMark=i.numeralDecimalMark||".",n.numeralThousandsGroupStyle=i.numeralThousandsGroupStyle||"thousand",n.numeralPositiveOnly=!!i.numeralPositiveOnly,n.stripLeadingZeroes=i.stripLeadingZeroes!==!1,n.numericOnly=n.creditCard||n.date||!!i.numericOnly,n.uppercase=!!i.uppercase,n.lowercase=!!i.lowercase,n.prefix=n.creditCard||n.date?"":i.prefix||"",n.noImmediatePrefix=!!i.noImmediatePrefix,n.prefixLength=n.prefix.length,n.rawValueTrimPrefix=!!i.rawValueTrimPrefix,n.copyDelimiter=!!i.copyDelimiter,n.initValue=void 0!==i.initValue&&null!==i.initValue?i.initValue.toString():"",n.delimiter=i.delimiter||""===i.delimiter?i.delimiter:i.date?"/":i.time?":":i.numeral?",":(i.phone," "),n.delimiterLength=n.delimiter.length,n.delimiterLazyShow=!!i.delimiterLazyShow,n.delimiters=i.delimiters||[],n.blocks=i.blocks||[],n.blocksLength=n.blocks.length,n.root="object"==typeof t&&t?t:window,n.document=i.document||n.root.document,n.maxLength=0,n.backspace=!1,n.result="",n.onValueChanged=i.onValueChanged||function(){},n}};n.exports=i}).call(t,function(){return this}())}])})