local function o(o)local G=0 for o,m in pairs(o)do G+=1 end return G end local function G(o,G,m)local O=o[G]if not O then O={}o[G]=O end O[m]=m.Character or true end local m={player=function(o)return ZoneController._getZonesAndPlayers(activeZones,activeZonesTotalVolume,true,o)end;localPlayer=function(o)local m={}local O=ZoneController.getTouchingZones(localPlayer,true,o)for o,O in pairs(O)do if O.activeTriggers.localPlayer then G(m,O,localPlayer)end end return m end}
-- LOCAL FUNCTIONS
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
	occupantsDict[occupant] = (occupant.Character or true)
end

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