local m=script.Parent.Parent return function(Y)local n=require(m.Bundles)local k=n.data local h=n.themeSystem local P=n.Fusion local A=P.New local L=P.Children local u=P.Value local K=P.Computed local X=P.Observer local V=require(m.simpleElements)local S=V.UICorner local s=V.UIPadding local g=require(m.utilities)local p=g.get local c=g.typecheck local O=g.animate local l=g.customFont local o,G=c(Y,{Text="";Visible=false},{Y.Visible and""or"\086\105\115\105\098\108\101"})assert(o,table.concat(G,"\n"))local b=k.find("\115\101\108\101\099\116\101\100\084\097\098")local J=k.find("\115\101\097\114\099\104\084\101\120\116")local N=k.add(Y)local t=Y.Parent local j=Y.Text local a=Y.Visible or u(true)local F=u(p(b.string)==(p(N.tab)).uid);(X(b.string)):onChange(function()F:set(p(b.string)==(p(N.tab)).uid)end)local U=O(function()return p(F)and 0 or 1 end,40,1);(A("\070\114\097\109\101"))({Visible=K(function()if p(J.string)~=""and not string.find((p(j)):lower(),(p(J.string)):lower())or not p(a)then return false end return true end);Size=UDim2.new(1,0,0,36),Parent=t;BackgroundTransparency=U,BackgroundColor3=h.background2,[L]={S(6),s(0,8);(A("\084\101\120\116\076\097\098\101\108"))({FontFace=l("\077\111\110\116\115\101\114\114\097\116",Enum.FontWeight.Bold);RichText=true,TextScaled=true,BackgroundTransparency=1;TextTransparency=U;Size=UDim2.new(1,0,0,18);Position=UDim2.new(0,0,.5,0),AnchorPoint=Vector2.new(0,.5),TextXAlignment=Enum.TextXAlignment.Left,TextColor3=h.text,Text=K(function()return p(j)end),[L]={(A("\085\073\084\101\120\116\083\105\122\101\067\111\110\115\116\114\097\105\110\116"))({MinTextSize=1,MaxTextSize=18})}})}})local E={}function E.SetText(Y,m)local n,k=c({SetText=m},{SetText=""})assert(n,table.concat(k,"\n"))j:set(m)end function E.Visible(m)a:set(true)end function E.Invisible(m)a:set(false)end return E end
local darius = script.Parent.Parent
return function(property)
	local bundles = require(darius.Bundles)
	local data = bundles.data
	local theme = bundles.themeSystem
	local fusion = bundles.Fusion
		local new = fusion.New
		local children = fusion.Children
		local value = fusion.Value
		local computed = fusion.Computed
		local observe = fusion.Observer

	local simpleElements = require(darius.simpleElements)
	local UICorner = simpleElements.UICorner
	local UIPadding = simpleElements.UIPadding

	local utilities = require(darius.utilities)
	local get = utilities.get
	local typecheck = utilities.typecheck
	local animate = utilities.animate
	local customFont = utilities.customFont

	-- Typecheck

	local didPass, failedItems = typecheck(property,{
		Text = "",
		Visible = false
	},{
		property.Visible and "" or "Visible"
	})
	assert(didPass, table.concat(failedItems, "\n"))

	-- Data

	local selectedTab = data.find("selectedTab")
	local searchText = data.find("searchText")
	local label = data.add(property)

	-- Properties

	local _parent = property.Parent
	local text = property.Text
	local visible = property.Visible or value(true)

	-- Variables

	local isSelected = value(get(selectedTab.string) == get(label.tab).uid)
	observe(selectedTab.string):onChange(function()
		isSelected:set(get(selectedTab.string) == get(label.tab).uid)
	end)
	local selectedAnimation = animate(function()
		return get(isSelected) and 0 or 1
	end, 40, 1)

	-- Label

	new "Frame" {
		Visible = computed(function()
			if get(searchText.string) ~= "" and not string.find(get(text):lower(), get(searchText.string):lower()) or not get(visible) then
				return false
			end
			return true
		end),
		Size = UDim2.new(1,0,0,36),
		Parent = _parent,
		BackgroundTransparency = selectedAnimation,
		BackgroundColor3 = theme.background2,

		[children] = {
			UICorner(6),
			UIPadding(0,8),
			new "TextLabel" {
				FontFace = customFont("Montserrat", Enum.FontWeight.Bold),
				RichText = true,
				TextScaled = true,
				BackgroundTransparency = 1,
				TextTransparency = selectedAnimation,
				Size = UDim2.new(1,-0,0,18),
				Position = UDim2.new(0,0,0.5,0),
				AnchorPoint = Vector2.new(0,0.5),
				TextXAlignment = Enum.TextXAlignment.Left,

				TextColor3 = theme.text,
				Text = computed(function()
					return get(text)
				end),

				[children] = {
					new "UITextSizeConstraint" {
						MinTextSize = 1,
						MaxTextSize = 18
					}
				}
			}
		}
	}

	local returnFunctions = {}
	function returnFunctions:SetText(newText)
		local _didPass, _failedItems = typecheck({['SetText'] = newText}, {SetText = ""})
		assert(_didPass, table.concat(_failedItems, "\n"))

		text:set(newText)
	end
	function returnFunctions:Visible()
		visible:set(true)
	end
	function returnFunctions:Invisible()
		visible:set(false)
	end
	return returnFunctions
end