local w={}local O=require(script.Parent.ComponentSelector)local T=require(script.Parent.BaseSelector)function w.inheritsBase(w)local O=0 while type(w)=="\116\097\098\108\101"do w=getmetatable(w)O=O+1 if w==T then return O>=2 end end return false end function w.resolve(T,I)if type(I)=="\115\116\114\105\110\103"then return O.new(T,I)end assert(w.inheritsBase(I))return I end return w
local Util = {}

local ComponentSelector = require(script.Parent.ComponentSelector)
local BaseSelector = require(script.Parent.BaseSelector)

function Util.inheritsBase(object)
	local depth = 0
	while type(object) == "table" do
		object = getmetatable(object)
		depth = depth + 1
		if object == BaseSelector then
			return depth >= 2
		end
	end
	return false
end

function Util.resolve(rocs, selectorResolvable)
	if type(selectorResolvable) == "string" then
		return ComponentSelector.new(rocs, selectorResolvable)
	end
	assert(Util.inheritsBase(selectorResolvable))
	return selectorResolvable
end

return Util
