local x=script.Parent local C="\"\037\115\" \105\115 \110\111\116 \097\110 \101\120\105\115\116\105\110\103 \099\108\097\115\115\047\102\111\108\100\101\114\046"local I={Folder=true,ModuleScript=true}local function N(x)local X={}local a={}function a.__index(O,a)if X[a]then return X[a]end local q=x:FindFirstChild(a)if q and(q~=script and I[q.ClassName])then X[a]=q:IsA("\077\111\100\117\108\101\083\099\114\105\112\116")and require(q)or N(q)return X[a]end error(C:format(a),2)end return setmetatable({},a)end return N(x)
local GuiLib = script.Parent
local FORMAT_STR = "\"%s\" is not an existing class/folder."

local VALID = {
	["Folder"] = true;
	["ModuleScript"] = true;
}

local function getLoaderOf(child)
	local Library = {}
	local Meta = {}
	
	function Meta:__index(key)
		if (Library[key]) then
			return Library[key]
		end
		
		local object = child:FindFirstChild(key)
		if (object and object ~= script and VALID[object.ClassName]) then
			Library[key] = object:IsA("ModuleScript") and require(object) or getLoaderOf(object)
			return Library[key]
		end
		
		error(FORMAT_STR:format(key), 2)
	end
	
	return setmetatable({}, Meta)
end

return getLoaderOf(GuiLib)