local function o(o)local m=0 for o,T in pairs(o)do m+=1 end return m end local function m(o,m,T)local g=o[m]if not g then g={}o[m]=g end local z=T:IsA("\080\108\097\121\101\114")and T.Character g[T]=z or true end local T={player=function(o)return ZoneController._getZonesAndItems("\112\108\097\121\101\114",activeZones,activeZonesTotalVolume,true,o)end,localPlayer=function(o)local T={}local g=localPlayer.Character if not g then return T end local z=ZoneController.getTouchingZones(g,true,o,trackers.player)for o,g in pairs(z)do if g.activeTriggers.localPlayer then m(T,g,localPlayer)end end return T end,item=function(o)return ZoneController._getZonesAndItems("\105\116\101\109",activeZones,activeZonesTotalVolume,true,o)end}

local function dictLength(dictionary)
	local count = 0
	for _, _ in pairs(dictionary) do
		count += 1
	end
	return count
end

local function fillOccupants(zonesAndOccupantsTable, zone, occupant)
	local occupantsDict = zonesAndOccupantsTable[zone]
	if not occupantsDict then
		occupantsDict = {}
		zonesAndOccupantsTable[zone] = occupantsDict
	end
	local prevCharacter = occupant:IsA("Player") and occupant.Character
	occupantsDict[occupant] = (prevCharacter or true)
end

local heartbeatActions = {
	["player"] = function(recommendedDetection)
		return ZoneController._getZonesAndItems("player", activeZones, activeZonesTotalVolume, true, recommendedDetection)
	end,
	["localPlayer"] = function(recommendedDetection)
		local zonesAndOccupants = {}
		local character = localPlayer.Character
		if not character then
			return zonesAndOccupants
		end
		local touchingZones = ZoneController.getTouchingZones(character, true, recommendedDetection, trackers.player)
		for _, zone in pairs(touchingZones) do
			if zone.activeTriggers["localPlayer"] then
				fillOccupants(zonesAndOccupants, zone, localPlayer)
			end
		end
		return zonesAndOccupants
	end,
	["item"] = function(recommendedDetection)
		return ZoneController._getZonesAndItems("item", activeZones, activeZonesTotalVolume, true, recommendedDetection)
	end,
}


