(() => { window.addEventListener('DOMContentLoaded', () => { const elements = document.getElementsByClassName("tapkat-total-raise"); if (elements.length === 0) { return; } fetch("https://api.tapkat.org", { method: "POST", headers: { "Content-Type": "application/json", }, body: '{"query":"query TotalRaiseScriptQuery($id: SweepstakesSlug!) { sweepstakes(id: $id) { totalDonations } }","operationName":"TotalRaiseScriptQuery","variables":{"id":"69Maq9"}}' }) .then(data => data.json()) .then(json => { let totalRaise = json.data.sweepstakes.totalDonations / 100; const formattedRaise = new Intl.NumberFormat(undefined, { style: 'currency', currency: 'USD', maximumFractionDigits: 0, minimumFractionDigits: 0, }).format(totalRaise); for (element of elements) { element.textContent = formattedRaise; } }) }); })()