local ____lualib = require("lualib_bundle")
local __TS__New = ____lualib.__TS__New
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local Set = ____lualib.Set
local Map = ____lualib.Map
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
local CardType = ____isaac_2Dtypescript_2Ddefinitions.CardType
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
local ItemConfigCardType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigCardType
local ItemConfigTag = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigTag
local PlayerForm = ____isaac_2Dtypescript_2Ddefinitions.PlayerForm
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
local ____cachedEnumValues = require("arrays.cachedEnumValues")
local CACHE_FLAG_VALUES = ____cachedEnumValues.CACHE_FLAG_VALUES
local ITEM_CONFIG_CARD_TYPE_VALUES = ____cachedEnumValues.ITEM_CONFIG_CARD_TYPE_VALUES
local ITEM_CONFIG_TAG_VALUES = ____cachedEnumValues.ITEM_CONFIG_TAG_VALUES
local ____cachedClasses = require("core.cachedClasses")
local itemConfig = ____cachedClasses.itemConfig
local ____constants = require("core.constants")
local FIRST_GLITCHED_COLLECTIBLE_TYPE = ____constants.FIRST_GLITCHED_COLLECTIBLE_TYPE
local QUALITIES = ____constants.QUALITIES
local ____constantsVanilla = require("core.constantsVanilla")
local VANILLA_CARD_TYPES = ____constantsVanilla.VANILLA_CARD_TYPES
local VANILLA_COLLECTIBLE_TYPES = ____constantsVanilla.VANILLA_COLLECTIBLE_TYPES
local VANILLA_PILL_EFFECTS = ____constantsVanilla.VANILLA_PILL_EFFECTS
local VANILLA_TRINKET_TYPES = ____constantsVanilla.VANILLA_TRINKET_TYPES
local ____decorators = require("decorators")
local Exported = ____decorators.Exported
local ____ISCFeature = require("enums.ISCFeature")
local ISCFeature = ____ISCFeature.ISCFeature
local ____array = require("functions.array")
local arrayRemove = ____array.arrayRemove
local getRandomArrayElement = ____array.getRandomArrayElement
local ____cards = require("functions.cards")
local getItemConfigCardType = ____cards.getItemConfigCardType
local ____collectibleTag = require("functions.collectibleTag")
local collectibleHasTag = ____collectibleTag.collectibleHasTag
local ____collectibles = require("functions.collectibles")
local collectibleHasCacheFlag = ____collectibles.collectibleHasCacheFlag
local getCollectibleQuality = ____collectibles.getCollectibleQuality
local isActiveCollectible = ____collectibles.isActiveCollectible
local isHiddenCollectible = ____collectibles.isHiddenCollectible
local isPassiveOrFamiliarCollectible = ____collectibles.isPassiveOrFamiliarCollectible
local ____flag = require("functions.flag")
local getFlagName = ____flag.getFlagName
local ____set = require("functions.set")
local getRandomSetElement = ____set.getRandomSetElement
local ____trinkets = require("functions.trinkets")
local trinketHasCacheFlag = ____trinkets.trinketHasCacheFlag
local ____types = require("functions.types")
local asCardType = ____types.asCardType
local asCollectibleType = ____types.asCollectibleType
local asPillEffect = ____types.asPillEffect
local asTrinketType = ____types.asTrinketType
local ____utils = require("functions.utils")
local assertDefined = ____utils.assertDefined
local iRange = ____utils.iRange
local ____repeat = ____utils["repeat"]
local ____itemConfigCardTypesForCards = require("sets.itemConfigCardTypesForCards")
local ITEM_CONFIG_CARD_TYPES_FOR_CARDS = ____itemConfigCardTypesForCards.ITEM_CONFIG_CARD_TYPES_FOR_CARDS
local ____ReadonlyMap = require("types.ReadonlyMap")
local ReadonlyMap = ____ReadonlyMap.ReadonlyMap
local ____Feature = require("classes.private.Feature")
local Feature = ____Feature.Feature
local CONDITIONAL_FLYING_COLLECTIBLE_TYPES = {CollectibleType.BIBLE, CollectibleType.EMPTY_VESSEL, CollectibleType.ASTRAL_PROJECTION, CollectibleType.RECALL}
local TRANSFORMATION_TO_TAG_MAP = __TS__New(ReadonlyMap, {
    {PlayerForm.GUPPY, ItemConfigTag.GUPPY},
    {PlayerForm.BEELZEBUB, ItemConfigTag.FLY},
    {PlayerForm.FUN_GUY, ItemConfigTag.MUSHROOM},
    {PlayerForm.SERAPHIM, ItemConfigTag.ANGEL},
    {PlayerForm.BOB, ItemConfigTag.BOB},
    {PlayerForm.SPUN, ItemConfigTag.SYRINGE},
    {PlayerForm.YES_MOTHER, ItemConfigTag.MOM},
    {PlayerForm.CONJOINED, ItemConfigTag.BABY},
    {PlayerForm.LEVIATHAN, ItemConfigTag.DEVIL},
    {PlayerForm.OH_CRAP, ItemConfigTag.POOP},
    {PlayerForm.BOOKWORM, ItemConfigTag.BOOK},
    {PlayerForm.SPIDER_BABY, ItemConfigTag.SPIDER}
})
--- A feature that lazy-inits and caches various arrays and sets that include both vanilla and modded
-- elements. This is useful for performance purposes (so that we do not have to reconstruct the
-- arrays/sets multiple times).
-- 
-- The modded arrays/sets are created using the functions from
-- `ISCFeature.MODDED_ELEMENT_DETECTION`.
____exports.ModdedElementSets = __TS__Class()
local ModdedElementSets = ____exports.ModdedElementSets
ModdedElementSets.name = "ModdedElementSets"
__TS__ClassExtends(ModdedElementSets, Feature)
function ModdedElementSets.prototype.____constructor(self, moddedElementDetection)
    Feature.prototype.____constructor(self)
    self.arraysInitialized = false
    self.allCollectibleTypesArray = {}
    self.allCollectibleTypesSet = __TS__New(Set)
    self.moddedCollectibleTypesArray = {}
    self.moddedCollectibleTypesSet = __TS__New(Set)
    self.allTrinketTypesArray = {}
    self.allTrinketTypesSet = __TS__New(Set)
    self.moddedTrinketTypesArray = {}
    self.moddedTrinketTypesSet = __TS__New(Set)
    self.allCardTypesArray = {}
    self.allCardTypesSet = __TS__New(Set)
    self.moddedCardTypesArray = {}
    self.moddedCardTypesSet = __TS__New(Set)
    self.allPillEffectsArray = {}
    self.allPillEffectsSet = __TS__New(Set)
    self.moddedPillEffectsArray = {}
    self.moddedPillEffectsSet = __TS__New(Set)
    self.cacheFlagToCollectibleTypesMap = __TS__New(Map)
    self.cacheFlagToTrinketTypesMap = __TS__New(Map)
    self.flyingCollectibleTypes = {}
    self.permanentFlyingCollectibleTypes = {}
    self.flyingTrinketTypes = {}
    self.tagToCollectibleTypesMap = __TS__New(Map)
    self.edenActiveCollectibleTypesSet = __TS__New(Set)
    self.edenPassiveCollectibleTypesSet = __TS__New(Set)
    self.qualityToCollectibleTypesMap = __TS__New(Map)
    self.itemConfigCardTypeToCardTypeMap = __TS__New(Map)
    self.cardTypeCardArray = {}
    self.featuresUsed = {ISCFeature.MODDED_ELEMENT_DETECTION}
    self.moddedElementDetection = moddedElementDetection
end
function ModdedElementSets.prototype.lazyInit(self)
    if self.arraysInitialized then
        return
    end
    self.arraysInitialized = true
    self:lazyInitModdedCollectibleTypes()
    self:lazyInitModdedTrinketTypes()
    self:lazyInitModdedCardTypes()
    self:lazyInitModdedPillEffects()
    self:lazyInitTagToCollectibleTypesMap()
    self:lazyInitCacheFlagToCollectibleTypesMap()
    self:lazyInitCacheFlagToTrinketTypesMap()
    self:lazyInitFlyingCollectibleTypesSet()
    self:lazyInitFlyingTrinketTypesSet()
    self:lazyInitEdenCollectibleTypesSet()
    self:lazyInitQualityToCollectibleTypesMap()
    self:lazyInitCardTypes()
end
function ModdedElementSets.prototype.lazyInitModdedCollectibleTypes(self)
    for ____, collectibleType in ipairs(VANILLA_COLLECTIBLE_TYPES) do
        local ____self_allCollectibleTypesArray_0 = self.allCollectibleTypesArray
        ____self_allCollectibleTypesArray_0[#____self_allCollectibleTypesArray_0 + 1] = collectibleType
        self.allCollectibleTypesSet:add(collectibleType)
    end
    local firstModdedCollectibleType = self.moddedElementDetection:getFirstModdedCollectibleType()
    if firstModdedCollectibleType == nil then
        return
    end
    local lastCollectibleType = self.moddedElementDetection:getLastCollectibleType()
    local moddedCollectibleTypes = iRange(nil, firstModdedCollectibleType, lastCollectibleType)
    for ____, collectibleTypeInt in ipairs(moddedCollectibleTypes) do
        local collectibleType = asCollectibleType(nil, collectibleTypeInt)
        local itemConfigItem = itemConfig:GetCollectible(collectibleType)
        if itemConfigItem ~= nil then
            local ____self_moddedCollectibleTypesArray_1 = self.moddedCollectibleTypesArray
            ____self_moddedCollectibleTypesArray_1[#____self_moddedCollectibleTypesArray_1 + 1] = collectibleType
            self.moddedCollectibleTypesSet:add(collectibleType)
            local ____self_allCollectibleTypesArray_2 = self.allCollectibleTypesArray
            ____self_allCollectibleTypesArray_2[#____self_allCollectibleTypesArray_2 + 1] = collectibleType
            self.allCollectibleTypesSet:add(collectibleType)
        end
    end
end
function ModdedElementSets.prototype.lazyInitModdedTrinketTypes(self)
    for ____, trinketType in ipairs(VANILLA_TRINKET_TYPES) do
        local ____self_allTrinketTypesArray_3 = self.allTrinketTypesArray
        ____self_allTrinketTypesArray_3[#____self_allTrinketTypesArray_3 + 1] = trinketType
        self.allTrinketTypesSet:add(trinketType)
    end
    local firstModdedTrinketType = self.moddedElementDetection:getFirstModdedTrinketType()
    if firstModdedTrinketType == nil then
        return
    end
    local lastTrinketType = self.moddedElementDetection:getLastTrinketType()
    local moddedTrinketTypes = iRange(nil, firstModdedTrinketType, lastTrinketType)
    for ____, trinketTypeInt in ipairs(moddedTrinketTypes) do
        local trinketType = asTrinketType(nil, trinketTypeInt)
        local itemConfigItem = itemConfig:GetTrinket(trinketType)
        if itemConfigItem ~= nil then
            local ____self_moddedTrinketTypesArray_4 = self.moddedTrinketTypesArray
            ____self_moddedTrinketTypesArray_4[#____self_moddedTrinketTypesArray_4 + 1] = trinketType
            self.moddedTrinketTypesSet:add(trinketType)
            local ____self_allTrinketTypesArray_5 = self.allTrinketTypesArray
            ____self_allTrinketTypesArray_5[#____self_allTrinketTypesArray_5 + 1] = trinketType
            self.allTrinketTypesSet:add(trinketType)
        end
    end
end
function ModdedElementSets.prototype.lazyInitModdedCardTypes(self)
    for ____, cardType in ipairs(VANILLA_CARD_TYPES) do
        local ____self_allCardTypesArray_6 = self.allCardTypesArray
        ____self_allCardTypesArray_6[#____self_allCardTypesArray_6 + 1] = cardType
        self.allCardTypesSet:add(cardType)
    end
    local firstModdedCardType = self.moddedElementDetection:getFirstModdedCardType()
    if firstModdedCardType == nil then
        return
    end
    local lastCardType = self.moddedElementDetection:getLastCardType()
    local moddedCardTypes = iRange(nil, firstModdedCardType, lastCardType)
    for ____, cardTypeInt in ipairs(moddedCardTypes) do
        local cardType = asCardType(nil, cardTypeInt)
        local itemConfigCard = itemConfig:GetCard(cardType)
        if itemConfigCard ~= nil then
            local ____self_moddedCardTypesArray_7 = self.moddedCardTypesArray
            ____self_moddedCardTypesArray_7[#____self_moddedCardTypesArray_7 + 1] = cardType
            self.moddedCardTypesSet:add(cardType)
            local ____self_allCardTypesArray_8 = self.allCardTypesArray
            ____self_allCardTypesArray_8[#____self_allCardTypesArray_8 + 1] = cardType
            self.allCardTypesSet:add(cardType)
        end
    end
end
function ModdedElementSets.prototype.lazyInitModdedPillEffects(self)
    for ____, pillEffect in ipairs(VANILLA_PILL_EFFECTS) do
        local ____self_allPillEffectsArray_9 = self.allPillEffectsArray
        ____self_allPillEffectsArray_9[#____self_allPillEffectsArray_9 + 1] = pillEffect
        self.allPillEffectsSet:add(pillEffect)
    end
    local firstModdedPillEffect = self.moddedElementDetection:getFirstModdedPillEffect()
    if firstModdedPillEffect == nil then
        return
    end
    local lastPillEffect = self.moddedElementDetection:getLastPillEffect()
    local moddedPillEffects = iRange(nil, firstModdedPillEffect, lastPillEffect)
    for ____, pillEffectInt in ipairs(moddedPillEffects) do
        local pillEffect = asPillEffect(nil, pillEffectInt)
        local itemConfigPillEffect = itemConfig:GetPillEffect(pillEffect)
        if itemConfigPillEffect ~= nil then
            local ____self_moddedPillEffectsArray_10 = self.moddedPillEffectsArray
            ____self_moddedPillEffectsArray_10[#____self_moddedPillEffectsArray_10 + 1] = pillEffect
            self.moddedPillEffectsSet:add(pillEffect)
            local ____self_allPillEffectsArray_11 = self.allPillEffectsArray
            ____self_allPillEffectsArray_11[#____self_allPillEffectsArray_11 + 1] = pillEffect
            self.allPillEffectsSet:add(pillEffect)
        end
    end
end
function ModdedElementSets.prototype.lazyInitTagToCollectibleTypesMap(self)
    for ____, itemConfigTag in ipairs(ITEM_CONFIG_TAG_VALUES) do
        self.tagToCollectibleTypesMap:set(itemConfigTag, {})
    end
    for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
        for ____, itemConfigTag in ipairs(ITEM_CONFIG_TAG_VALUES) do
            do
                if not collectibleHasTag(nil, collectibleType, itemConfigTag) then
                    goto __continue37
                end
                local collectibleTypes = self.tagToCollectibleTypesMap:get(itemConfigTag)
                if collectibleTypes == nil then
                    local flagName = getFlagName(nil, itemConfigTag, ItemConfigTag)
                    error("Failed to get the collectible types for item tag: " .. tostring(flagName))
                end
                collectibleTypes[#collectibleTypes + 1] = collectibleType
            end
            ::__continue37::
        end
    end
end
function ModdedElementSets.prototype.lazyInitCacheFlagToCollectibleTypesMap(self)
    for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
        local collectibleTypes = {}
        for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
            if collectibleHasCacheFlag(nil, collectibleType, cacheFlag) then
                collectibleTypes[#collectibleTypes + 1] = collectibleType
            end
        end
        self.cacheFlagToCollectibleTypesMap:set(cacheFlag, collectibleTypes)
    end
end
function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
    for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
        local trinketTypes = {}
        for ____, trinketType in ipairs(self:getTrinketTypes()) do
            if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
                trinketTypes[#trinketTypes + 1] = trinketType
            end
        end
        self.cacheFlagToTrinketTypesMap:set(cacheFlag, trinketTypes)
    end
end
function ModdedElementSets.prototype.lazyInitFlyingCollectibleTypesSet(self)
    local collectibleTypesWithFlyingCacheFlag = self:getCollectibleTypesWithCacheFlag(CacheFlag.FLYING)
    local collectibleTypesWithAllCacheFlag = self:getCollectibleTypesWithCacheFlag(CacheFlag.ALL)
    self.flyingCollectibleTypes = arrayRemove(
        nil,
        collectibleTypesWithFlyingCacheFlag,
        table.unpack(collectibleTypesWithAllCacheFlag)
    )
    self.permanentFlyingCollectibleTypes = arrayRemove(
        nil,
        self.flyingCollectibleTypes,
        table.unpack(CONDITIONAL_FLYING_COLLECTIBLE_TYPES)
    )
end
function ModdedElementSets.prototype.lazyInitFlyingTrinketTypesSet(self)
    local trinketTypesWithFlyingCacheFlag = self:getTrinketsTypesWithCacheFlag(CacheFlag.FLYING)
    local trinketTypesWithAllCacheFlag = self:getTrinketsTypesWithCacheFlag(CacheFlag.ALL)
    local trinketTypesWithAllCacheFlagThatDontGrantFlying = arrayRemove(nil, trinketTypesWithAllCacheFlag, TrinketType.AZAZELS_STUMP)
    self.flyingTrinketTypes = arrayRemove(
        nil,
        trinketTypesWithFlyingCacheFlag,
        table.unpack(trinketTypesWithAllCacheFlagThatDontGrantFlying)
    )
end
function ModdedElementSets.prototype.lazyInitEdenCollectibleTypesSet(self)
    for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
        do
            if isHiddenCollectible(nil, collectibleType) or collectibleHasTag(nil, collectibleType, ItemConfigTag.NO_EDEN) then
                goto __continue57
            end
            if isActiveCollectible(nil, collectibleType) then
                self.edenActiveCollectibleTypesSet:add(collectibleType)
            end
            if isPassiveOrFamiliarCollectible(nil, collectibleType) then
                self.edenPassiveCollectibleTypesSet:add(collectibleType)
            end
        end
        ::__continue57::
    end
end
function ModdedElementSets.prototype.lazyInitQualityToCollectibleTypesMap(self)
    for ____, quality in ipairs(QUALITIES) do
        local collectibleTypes = {}
        for ____, collectibleType in ipairs(self:getCollectibleTypes()) do
            local collectibleTypeQuality = getCollectibleQuality(nil, collectibleType)
            if collectibleTypeQuality == quality then
                collectibleTypes[#collectibleTypes + 1] = collectibleType
            end
        end
        self.qualityToCollectibleTypesMap:set(quality, collectibleTypes)
    end
end
function ModdedElementSets.prototype.lazyInitCardTypes(self)
    for ____, itemConfigCardType in ipairs(ITEM_CONFIG_CARD_TYPE_VALUES) do
        self.itemConfigCardTypeToCardTypeMap:set(itemConfigCardType, {})
    end
    for ____, cardType in ipairs(self:getCardTypes()) do
        local itemConfigCardType = getItemConfigCardType(nil, cardType)
        if itemConfigCardType ~= nil then
            local cardTypes = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
            assertDefined(
                nil,
                cardTypes,
                "Failed to get the card types for item config card type: " .. tostring(itemConfigCardType)
            )
            cardTypes[#cardTypes + 1] = cardType
            if ITEM_CONFIG_CARD_TYPES_FOR_CARDS:has(itemConfigCardType) then
                local ____self_cardTypeCardArray_12 = self.cardTypeCardArray
                ____self_cardTypeCardArray_12[#____self_cardTypeCardArray_12 + 1] = cardType
            end
        end
    end
end
function ModdedElementSets.prototype.getCollectibleTypes(self)
    self:lazyInit()
    return self.allCollectibleTypesArray
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypes", true)
function ModdedElementSets.prototype.getCollectibleTypeSet(self)
    self:lazyInit()
    return self.allCollectibleTypesSet
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypeSet", true)
function ModdedElementSets.prototype.getModdedCollectibleTypes(self)
    self:lazyInit()
    return self.moddedCollectibleTypesArray
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleTypes", true)
function ModdedElementSets.prototype.getModdedCollectibleTypesSet(self)
    self:lazyInit()
    return self.moddedCollectibleTypesSet
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCollectibleTypesSet", true)
function ModdedElementSets.prototype.getPlayerCollectibleMap(self, player)
    local collectibleArray = self:getCollectibleTypes()
    local collectibleMap = __TS__New(Map)
    for ____, collectibleType in ipairs(collectibleArray) do
        local numCollectibles = player:GetCollectibleNum(collectibleType, true)
        if numCollectibles > 0 then
            collectibleMap:set(collectibleType, numCollectibles)
        end
    end
    if player:HasCollectible(CollectibleType.TMTRAINER) then
        local collectibleType = FIRST_GLITCHED_COLLECTIBLE_TYPE
        local itemConfigItem
        repeat
            do
                itemConfigItem = itemConfig:GetCollectible(collectibleType)
                if itemConfigItem ~= nil then
                    local hasCollectibles = player:HasCollectible(collectibleType, true)
                    if hasCollectibles then
                        collectibleMap:set(collectibleType, 1)
                    end
                end
                collectibleType = collectibleType - 1
            end
        until not (itemConfigItem ~= nil)
    end
    return collectibleMap
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectibleMap", true)
function ModdedElementSets.prototype.getTrinketTypes(self)
    self:lazyInit()
    return self.allTrinketTypesArray
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketTypes", true)
function ModdedElementSets.prototype.getTrinketTypesSet(self)
    self:lazyInit()
    return self.allTrinketTypesSet
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketTypesSet", true)
function ModdedElementSets.prototype.getModdedTrinketTypes(self)
    self:lazyInit()
    return self.moddedTrinketTypesArray
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketTypes", true)
function ModdedElementSets.prototype.getModdedTrinketTypesSet(self)
    self:lazyInit()
    return self.moddedTrinketTypesSet
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedTrinketTypesSet", true)
function ModdedElementSets.prototype.getCardTypes(self)
    self:lazyInit()
    return self.allCardTypesArray
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypes", true)
function ModdedElementSets.prototype.getCardTypesSet(self)
    self:lazyInit()
    return self.allCardTypesSet
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesSet", true)
function ModdedElementSets.prototype.getModdedCardTypes(self)
    self:lazyInit()
    return self.moddedCardTypesArray
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardTypes", true)
function ModdedElementSets.prototype.getModdedCardTypesSet(self)
    self:lazyInit()
    return self.moddedCardTypesSet
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedCardTypesSet", true)
function ModdedElementSets.prototype.getPillEffects(self)
    self:lazyInit()
    return self.allPillEffectsArray
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPillEffects", true)
function ModdedElementSets.prototype.getPillEffectsSet(self)
    self:lazyInit()
    return self.allPillEffectsSet
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPillEffectsSet", true)
function ModdedElementSets.prototype.getModdedPillEffects(self)
    self:lazyInit()
    return self.moddedPillEffectsArray
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedPillEffects", true)
function ModdedElementSets.prototype.getModdedPillEffectsSet(self)
    self:lazyInit()
    return self.moddedPillEffectsSet
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getModdedPillEffectsSet", true)
function ModdedElementSets.prototype.getCollectibleTypesWithCacheFlag(self, cacheFlag)
    self:lazyInit()
    local collectiblesSet = self.cacheFlagToCollectibleTypesMap:get(cacheFlag)
    if collectiblesSet == nil then
        return {}
    end
    return collectiblesSet
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesWithCacheFlag", true)
function ModdedElementSets.prototype.getTrinketsTypesWithCacheFlag(self, cacheFlag)
    self:lazyInit()
    local trinketTypes = self.cacheFlagToTrinketTypesMap:get(cacheFlag)
    if trinketTypes == nil then
        return {}
    end
    return trinketTypes
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getTrinketsTypesWithCacheFlag", true)
function ModdedElementSets.prototype.getPlayerCollectiblesWithCacheFlag(self, player, cacheFlag)
    local collectiblesWithCacheFlag = self:getCollectibleTypesWithCacheFlag(cacheFlag)
    local playerCollectibles = {}
    for ____, collectibleType in ipairs(collectiblesWithCacheFlag) do
        local numCollectibles = player:GetCollectibleNum(collectibleType, true)
        ____repeat(
            nil,
            numCollectibles,
            function()
                playerCollectibles[#playerCollectibles + 1] = collectibleType
            end
        )
    end
    return playerCollectibles
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesWithCacheFlag", true)
function ModdedElementSets.prototype.getPlayerTrinketsWithCacheFlag(self, player, cacheFlag)
    local trinketTypesWithCacheFlag = self:getTrinketsTypesWithCacheFlag(cacheFlag)
    local playerTrinkets = __TS__New(Map)
    for ____, trinketType in ipairs(trinketTypesWithCacheFlag) do
        local trinketMultiplier = player:GetTrinketMultiplier(trinketType)
        if trinketMultiplier > 0 then
            playerTrinkets:set(trinketType, trinketMultiplier)
        end
    end
    return playerTrinkets
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerTrinketsWithCacheFlag", true)
function ModdedElementSets.prototype.getFlyingCollectibleTypes(self, includeConditionalItems)
    self:lazyInit()
    return includeConditionalItems and self.flyingCollectibleTypes or self.permanentFlyingCollectibleTypes
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingCollectibleTypes", true)
function ModdedElementSets.prototype.getFlyingTrinketTypes(self)
    self:lazyInit()
    return self.flyingTrinketTypes
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getFlyingTrinketTypes", true)
function ModdedElementSets.prototype.getCollectibleTypesWithTag(self, itemConfigTag)
    self:lazyInit()
    local collectibleTypes = self.tagToCollectibleTypesMap:get(itemConfigTag)
    assertDefined(
        nil,
        collectibleTypes,
        ("The item config tag of " .. tostring(itemConfigTag)) .. " is not a valid value of the \"ItemConfigTag\" enum."
    )
    return collectibleTypes
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesWithTag", true)
function ModdedElementSets.prototype.getPlayerCollectiblesWithTag(self, player, itemConfigTag)
    local collectibleTypesWithTag = self:getCollectibleTypesWithTag(itemConfigTag)
    local playerCollectibles = {}
    for ____, collectibleType in ipairs(collectibleTypesWithTag) do
        local numCollectibles = player:GetCollectibleNum(collectibleType, true)
        ____repeat(
            nil,
            numCollectibles,
            function()
                playerCollectibles[#playerCollectibles + 1] = collectibleType
            end
        )
    end
    return playerCollectibles
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesWithTag", true)
function ModdedElementSets.prototype.getCollectibleTypesForTransformation(self, playerForm)
    local itemConfigTag = TRANSFORMATION_TO_TAG_MAP:get(playerForm)
    assertDefined(
        nil,
        itemConfigTag,
        ("Failed to get the collectible types for the transformation of " .. tostring(playerForm)) .. " because that transformation is not based on collectibles."
    )
    return self:getCollectibleTypesWithTag(itemConfigTag)
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesForTransformation", true)
function ModdedElementSets.prototype.getPlayerCollectiblesForTransformation(self, player, playerForm)
    local collectibleForTransformation = self:getCollectibleTypesForTransformation(playerForm)
    local playerCollectibles = {}
    for ____, collectibleType in ipairs(collectibleForTransformation) do
        local numCollectibles = player:GetCollectibleNum(collectibleType, true)
        ____repeat(
            nil,
            numCollectibles,
            function()
                playerCollectibles[#playerCollectibles + 1] = collectibleType
            end
        )
    end
    return playerCollectibles
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesForTransformation", true)
function ModdedElementSets.prototype.getEdenActiveCollectibleTypes(self)
    self:lazyInit()
    return self.edenActiveCollectibleTypesSet
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenActiveCollectibleTypes", true)
function ModdedElementSets.prototype.getEdenPassiveCollectibleTypes(self)
    self:lazyInit()
    return self.edenPassiveCollectibleTypesSet
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenPassiveCollectibleTypes", true)
function ModdedElementSets.prototype.getRandomEdenActiveCollectibleType(self, seedOrRNG, exceptions)
    if exceptions == nil then
        exceptions = {}
    end
    self:lazyInit()
    return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenActiveCollectibleType", true)
function ModdedElementSets.prototype.getRandomEdenPassiveCollectibleType(self, seedOrRNG, exceptions)
    if exceptions == nil then
        exceptions = {}
    end
    self:lazyInit()
    return getRandomSetElement(nil, self.edenPassiveCollectibleTypesSet, seedOrRNG, exceptions)
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenPassiveCollectibleType", true)
function ModdedElementSets.prototype.getCollectibleTypesOfQuality(self, quality)
    self:lazyInit()
    local collectibleTypes = self.qualityToCollectibleTypesMap:get(quality)
    assertDefined(
        nil,
        collectibleTypes,
        ("The quality of " .. tostring(quality)) .. " is not a valid quality."
    )
    return collectibleTypes
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCollectibleTypesOfQuality", true)
function ModdedElementSets.prototype.getPlayerCollectiblesOfQuality(self, player, quality)
    local collectibleTypesOfQuality = self:getCollectibleTypesOfQuality(quality)
    local playerCollectibleTypes = {}
    for ____, collectibleType in ipairs(collectibleTypesOfQuality) do
        local numCollectibles = player:GetCollectibleNum(collectibleType, true)
        ____repeat(
            nil,
            numCollectibles,
            function()
                playerCollectibleTypes[#playerCollectibleTypes + 1] = collectibleType
            end
        )
    end
    return playerCollectibleTypes
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getPlayerCollectiblesOfQuality", true)
function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
    local itemConfigCardTypes = {...}
    self:lazyInit()
    local matchingCardTypes = {}
    for ____, itemConfigCardType in ipairs(itemConfigCardTypes) do
        local cardTypes = self.itemConfigCardTypeToCardTypeMap:get(itemConfigCardType)
        assertDefined(
            nil,
            cardTypes,
            "Failed to get the card types for item config type: " .. tostring(itemConfigCardType)
        )
        for ____, cardType in ipairs(cardTypes) do
            matchingCardTypes[#matchingCardTypes + 1] = cardType
        end
    end
    return matchingCardTypes
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesOfType", true)
function ModdedElementSets.prototype.getRandomCardTypeOfType(self, itemConfigCardType, seedOrRNG, exceptions)
    if exceptions == nil then
        exceptions = {}
    end
    local cardTypes = self:getCardTypesOfType(itemConfigCardType)
    return getRandomArrayElement(nil, cardTypes, seedOrRNG, exceptions)
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCardTypeOfType", true)
function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
    if exceptions == nil then
        exceptions = {}
    end
    self:lazyInit()
    return getRandomArrayElement(nil, self.cardTypeCardArray, seedOrRNG, exceptions)
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCard", true)
function ModdedElementSets.prototype.getRandomRune(self, seedOrRNG, exceptions)
    if exceptions == nil then
        exceptions = {}
    end
    local runeCardTypes = self:getCardTypesOfType(ItemConfigCardType.RUNE)
    local ____array_13 = __TS__SparseArrayNew(table.unpack(exceptions))
    __TS__SparseArrayPush(____array_13, CardType.RUNE_SHARD)
    local runeExceptions = {__TS__SparseArraySpread(____array_13)}
    return getRandomArrayElement(nil, runeCardTypes, seedOrRNG, runeExceptions)
end
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomRune", true)
return ____exports
