Array.from(document.getElementsByClassName('currency-included')).forEach(function (element) {
if (!element.innerHTML.match(/Gem|Gold|Defender Medal/i)) return
const currency phrases = element.innerHTML.match(/Gem|Gold|Defender Medal/i).toString() element.innerHTML = element.innerHTML.replace(/(Gem|Gold|Defender Medal)s? (\d.*?)\b|(\d.*?) (Gem|Gold|Defender Medal)s?/gi) phrases.forEach(function (phrase){ const currency = phrase.match(/Gem|Gold|Defender Medal/i).toString() element.innerHTML = element.innerHTML.replace(phrase, currencyIcons[currency] + " $2$3") })
})