local C=script.Parent.Parent.Parent local c=script.Parent.Parent.benchmarks local n=require(C.LuauPolyfill)local S=n.Object local U=n.Array return function(C,n)local O=(require(c.impl))(C,n)local w=O local p=S.keys(w)local function l(C)return U.reduce(p,function(c,n)local S=w[n]local U,O,p=S.name,S.components,S.version local l=C(O)local R,N,L,m,V,f=l.Component,l.getComponentProps,l.sampleCount,l.Provider,l.benchmarkType,l.anchorPoint c[n]={Component=R;getComponentProps=N,sampleCount=L;Provider=m,benchmarkType=V;version=p;name=U,anchorPoint=f}return c end,{})end return{createTestBlock=l}end
local rootWorkspace = script.Parent.Parent.Parent
local Benchmarks = script.Parent.Parent.benchmarks

local LuauPolyfill = require(rootWorkspace.LuauPolyfill)
local Object = LuauPolyfill.Object
local Array = LuauPolyfill.Array

return function(Roact, ReactRoblox)
	local impl = require(Benchmarks.impl)(Roact, ReactRoblox)
	local implementations = impl
	local packageNames = Object.keys(implementations)

	local function createTestBlock(fn)
		return Array.reduce(packageNames, function(testSetups, packageName)
			local implementation = implementations[packageName]
			local name, components, libraryVersion =
				implementation.name, implementation.components, implementation.version

			local componentInfo = fn(components)
			local Component, getComponentProps, sampleCount, Provider, benchmarkType, anchorPoint =
				componentInfo.Component,
				componentInfo.getComponentProps,
				componentInfo.sampleCount,
				componentInfo.Provider,
				componentInfo.benchmarkType,
				componentInfo.anchorPoint

			testSetups[packageName] = {
				Component = Component,
				getComponentProps = getComponentProps,
				sampleCount = sampleCount,
				Provider = Provider,
				benchmarkType = benchmarkType,
				version = libraryVersion,
				name = name,
				anchorPoint = anchorPoint,
			}
			return testSetups
		end, {})
	end

	return {
		createTestBlock = createTestBlock,
	}
end
