function Table.deepCopy(o,p)p=p or{}if p[o]then return p[o]end if type(o)=="\116\097\098\108\101"then local O={}p[o]=O for o,K in pairs(o)do O[Table.deepCopy(o,p)]=Table.deepCopy(K,p)end return setmetatable(O,Table.deepCopy(getmetatable(o),p))else return o end end

function Table.deepCopy(target, _context)
	_context = _context or {}
	if _context[target] then
		return _context[target]
	end

	if type(target) == "table" then
		local new = {}
		_context[target] = new
		for index, value in pairs(target) do
			new[Table.deepCopy(index, _context)] = Table.deepCopy(value, _context)
		end
		return setmetatable(new, Table.deepCopy(getmetatable(target), _context))
	else
		return target
	end
end
