local M=script.Parent.Parent local B=require(M.Packages.Flipper)local f=require(M.Creator)local e=f.New local D=B.Spring.new return function(B,D,A,n)local H={}H.TitleLabel=e("\084\101\120\116\076\097\098\101\108",{FontFace=Font.new("\114\098\120\097\115\115\101\116\058\047\047\102\111\110\116\115\047\102\097\109\105\108\105\101\115\047\071\111\116\104\097\109\083\083\109\046\106\115\111\110",Enum.FontWeight.Medium,Enum.FontStyle.Normal);Text=B;TextColor3=Color3.fromRGB(240,240,240);TextSize=13,TextXAlignment=Enum.TextXAlignment.Left,Size=UDim2.new(1,0,0,14);BackgroundColor3=Color3.fromRGB(255,255,255);BackgroundTransparency=1,ThemeTag={TextColor3="\084\101\120\116"}})H.DescLabel=e("\084\101\120\116\076\097\098\101\108",{FontFace=Font.new("\114\098\120\097\115\115\101\116\058\047\047\102\111\110\116\115\047\102\097\109\105\108\105\101\115\047\071\111\116\104\097\109\083\083\109\046\106\115\111\110");Text=D,TextColor3=Color3.fromRGB(200,200,200),TextSize=12;TextWrapped=true;TextXAlignment=Enum.TextXAlignment.Left;BackgroundColor3=Color3.fromRGB(255,255,255);AutomaticSize=Enum.AutomaticSize.Y;BackgroundTransparency=1;Size=UDim2.new(1,0,0,14);ThemeTag={TextColor3="\083\117\098\084\101\120\116"}})H.LabelHolder=e("\070\114\097\109\101",{AutomaticSize=Enum.AutomaticSize.Y;BackgroundColor3=Color3.fromRGB(255,255,255);BackgroundTransparency=1,Position=UDim2.fromOffset(10,0);Size=UDim2.new(1,-28,0,0)},{e("\085\073\076\105\115\116\076\097\121\111\117\116",{SortOrder=Enum.SortOrder.LayoutOrder,VerticalAlignment=Enum.VerticalAlignment.Center});e("\085\073\080\097\100\100\105\110\103",{PaddingBottom=UDim.new(0,13);PaddingTop=UDim.new(0,13)}),H.TitleLabel;H.DescLabel})H.Border=e("\085\073\083\116\114\111\107\101",{Transparency=.5;ApplyStrokeMode=Enum.ApplyStrokeMode.Border;Color=Color3.fromRGB(0,0,0),ThemeTag={Color="\069\108\101\109\101\110\116\066\111\114\100\101\114"}})H.Frame=e("\084\101\120\116\066\117\116\116\111\110",{Size=UDim2.new(1,0,0,0);BackgroundTransparency=.89;BackgroundColor3=Color3.fromRGB(130,130,130),Parent=A;AutomaticSize=Enum.AutomaticSize.Y;Text="",LayoutOrder=7;ThemeTag={BackgroundColor3="\069\108\101\109\101\110\116",BackgroundTransparency="\069\108\101\109\101\110\116\084\114\097\110\115\112\097\114\101\110\099\121"}},{e("\085\073\067\111\114\110\101\114",{CornerRadius=UDim.new(0,4)});H.Border,H.LabelHolder})function H.SetTitle(B,M)H.TitleLabel.Text=M end function H.SetDesc(B,M)if M==nil then M=""end if M==""then H.DescLabel.Visible=false else H.DescLabel.Visible=true end H.DescLabel.Text=M end function H.Destroy(M)H.Frame:Destroy()end H:SetTitle(B)H:SetDesc(D)if n then local B=M.Themes local e,D=f.SpringMotor(f.GetThemeProperty("\069\108\101\109\101\110\116\084\114\097\110\115\112\097\114\101\110\099\121"),H.Frame,"\066\097\099\107\103\114\111\117\110\100\084\114\097\110\115\112\097\114\101\110\099\121",false,true)f.AddSignal(H.Frame.MouseEnter,function()D(f.GetThemeProperty("\069\108\101\109\101\110\116\084\114\097\110\115\112\097\114\101\110\099\121")-f.GetThemeProperty("\072\111\118\101\114\067\104\097\110\103\101"))end)f.AddSignal(H.Frame.MouseLeave,function()D(f.GetThemeProperty("\069\108\101\109\101\110\116\084\114\097\110\115\112\097\114\101\110\099\121"))end)f.AddSignal(H.Frame.MouseButton1Down,function()D(f.GetThemeProperty("\069\108\101\109\101\110\116\084\114\097\110\115\112\097\114\101\110\099\121")+f.GetThemeProperty("\072\111\118\101\114\067\104\097\110\103\101"))end)f.AddSignal(H.Frame.MouseButton1Up,function()D(f.GetThemeProperty("\069\108\101\109\101\110\116\084\114\097\110\115\112\097\114\101\110\099\121")-f.GetThemeProperty("\072\111\118\101\114\067\104\097\110\103\101"))end)end return H end
local Root = script.Parent.Parent
local Flipper = require(Root.Packages.Flipper)
local Creator = require(Root.Creator)
local New = Creator.New

local Spring = Flipper.Spring.new

return function(Title, Desc, Parent, Hover)
	local Element = {}

	Element.TitleLabel = New("TextLabel", {
		FontFace = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Medium, Enum.FontStyle.Normal),
		Text = Title,
		TextColor3 = Color3.fromRGB(240, 240, 240),
		TextSize = 13,
		TextXAlignment = Enum.TextXAlignment.Left,
		Size = UDim2.new(1, 0, 0, 14),
		BackgroundColor3 = Color3.fromRGB(255, 255, 255),
		BackgroundTransparency = 1,
		ThemeTag = {
			TextColor3 = "Text",
		},
	})

	Element.DescLabel = New("TextLabel", {
		FontFace = Font.new("rbxasset://fonts/families/GothamSSm.json"),
		Text = Desc,
		TextColor3 = Color3.fromRGB(200, 200, 200),
		TextSize = 12,
		TextWrapped = true,
		TextXAlignment = Enum.TextXAlignment.Left,
		BackgroundColor3 = Color3.fromRGB(255, 255, 255),
		AutomaticSize = Enum.AutomaticSize.Y,
		BackgroundTransparency = 1,
		Size = UDim2.new(1, 0, 0, 14),
		ThemeTag = {
			TextColor3 = "SubText",
		},
	})

	Element.LabelHolder = New("Frame", {
		AutomaticSize = Enum.AutomaticSize.Y,
		BackgroundColor3 = Color3.fromRGB(255, 255, 255),
		BackgroundTransparency = 1,
		Position = UDim2.fromOffset(10, 0),
		Size = UDim2.new(1, -28, 0, 0),
	}, {
		New("UIListLayout", {
			SortOrder = Enum.SortOrder.LayoutOrder,
			VerticalAlignment = Enum.VerticalAlignment.Center,
		}),
		New("UIPadding", {
			PaddingBottom = UDim.new(0, 13),
			PaddingTop = UDim.new(0, 13),
		}),
		Element.TitleLabel,
		Element.DescLabel,
	})

	Element.Border = New("UIStroke", {
		Transparency = 0.5,
		ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
		Color = Color3.fromRGB(0, 0, 0),
		ThemeTag = {
			Color = "ElementBorder",
		},
	})

	Element.Frame = New("TextButton", {
		Size = UDim2.new(1, 0, 0, 0),
		BackgroundTransparency = 0.89,
		BackgroundColor3 = Color3.fromRGB(130, 130, 130),
		Parent = Parent,
		AutomaticSize = Enum.AutomaticSize.Y,
		Text = "",
		LayoutOrder = 7,
		ThemeTag = {
			BackgroundColor3 = "Element",
			BackgroundTransparency = "ElementTransparency",
		},
	}, {
		New("UICorner", {
			CornerRadius = UDim.new(0, 4),
		}),
		Element.Border,
		Element.LabelHolder,
	})

	function Element:SetTitle(Set)
		Element.TitleLabel.Text = Set
	end

	function Element:SetDesc(Set)
		if Set == nil then
			Set = ""
		end
		if Set == "" then
			Element.DescLabel.Visible = false
		else
			Element.DescLabel.Visible = true
		end
		Element.DescLabel.Text = Set
	end

	function Element:Destroy()
		Element.Frame:Destroy()
	end

	Element:SetTitle(Title)
	Element:SetDesc(Desc)

	if Hover then
		local Themes = Root.Themes
		local Motor, SetTransparency = Creator.SpringMotor(
			Creator.GetThemeProperty("ElementTransparency"),
			Element.Frame,
			"BackgroundTransparency",
			false,
			true
		)

		Creator.AddSignal(Element.Frame.MouseEnter, function()
			SetTransparency(Creator.GetThemeProperty("ElementTransparency") - Creator.GetThemeProperty("HoverChange"))
		end)
		Creator.AddSignal(Element.Frame.MouseLeave, function()
			SetTransparency(Creator.GetThemeProperty("ElementTransparency"))
		end)
		Creator.AddSignal(Element.Frame.MouseButton1Down, function()
			SetTransparency(Creator.GetThemeProperty("ElementTransparency") + Creator.GetThemeProperty("HoverChange"))
		end)
		Creator.AddSignal(Element.Frame.MouseButton1Up, function()
			SetTransparency(Creator.GetThemeProperty("ElementTransparency") - Creator.GetThemeProperty("HoverChange"))
		end)
	end

	return Element
end
