-- Decompiled with the Synapse X Luau decompiler.


local l__HDAdminMain__1 = _G.HDAdminMain;
local v2 = {
	custom = l__HDAdminMain__1.gui.MainFrame.Pages.Settings.Custom
};
local v3 = l__HDAdminMain__1.settings.ThemeColors or { { "Red", Color3.fromRGB(150, 0, 0) }, { "Orange", Color3.fromRGB(150, 75, 0) }, { "Brown", Color3.fromRGB(120, 80, 30) }, { "Yellow", Color3.fromRGB(130, 120, 0) }, { "Green", Color3.fromRGB(0, 120, 0) }, { "Blue", Color3.fromRGB(0, 100, 150) }, { "Purple", Color3.fromRGB(100, 0, 150) }, { "Pink", Color3.fromRGB(150, 0, 100) }, { "Black", Color3.fromRGB(60, 60, 60) } };
local v4 = 6.1 / #v3;
local v5 = true;
local u1 = v2.custom["AB ThemeSelection"];
local function v6(p1, p2)
	if p1 == nil then
		for v7, v8 in pairs(v3) do
			if v8[1] == l__HDAdminMain__1.pdata.Theme then
				p1 = v8[1];
				p2 = v8[2];
				break;
			end;
		end;
	end;
	if p1 then
		local v9 = {};
		for v10, v11 in pairs(l__HDAdminMain__1.gui:GetDescendants()) do
			if v11:IsA("BoolValue") and v11.Name == "Theme" then
				table.insert(v9, v11.Parent);
			end;
		end;
		local v12, v13, v14 = pairs(v9);
		while true do
			local v15, v16 = v12(v13, v14);
			if not v15 then
				break;
			end;
			local v17 = p2;
			if v16.Theme.Value then
				local v18, v19, v20 = Color3.toHSV(p2);
				v17 = Color3.fromHSV(v18, v19, v20 * 1.35);
			end;
			if v16:IsA("TextLabel") then
				local v21, v22, v23 = Color3.toHSV(p2);
				v16.TextColor3 = Color3.fromHSV(v21, v22, v23 * 2);
			else
				v16.BackgroundColor3 = v17;
			end;		
		end;
		for v24, v25 in pairs(u1:GetChildren()) do
			if v25:IsA("TextButton") then
				if v25.Name == p1 then
					v25.BorderSizePixel = 1;
				else
					v25.BorderSizePixel = 0;
				end;
			end;
		end;
	end;
end;
for v26, v27 in pairs(v3) do
	local v28 = v27[1];
	local v29 = v27[2];
	local v30 = u1.ThemeTemplate:Clone();
	v30.Name = v28;
	v30.UIAspectRatioConstraint.AspectRatio = v4;
	v30.BackgroundColor3 = v29;
	local u2 = v5;
	v30.MouseButton1Down:Connect(function()
		if u2 then
			u2 = false;
			l__HDAdminMain__1.signals.ChangeSetting:InvokeServer({ "Theme", v28 });
			v6(v28, v29);
			u2 = true;
		end;
	end);
	v30.Visible = true;
	v30.Parent = u1;
end;
local function v31()
	for v32, v33 in pairs(v2.custom:GetChildren()) do
		local v34 = string.sub(v33.Name, 5);
		if v33:FindFirstChild("SettingValue") then
			v33.SettingName.TextLabel.Text = v34 .. ":";
			local v35 = l__HDAdminMain__1.pdata[v34];
			v33.SettingValue.TextBox.Text = tostring(v35);
			local v36 = nil;
			local v37 = nil;
			if string.sub(v34, 1, 5) == "Error" then
				v36 = "Error";
				v37 = 6;
			elseif string.sub(v34, 1, 6) == "Notice" then
				v36 = "Notice";
				v37 = 7;
			end;
			if v36 then
				local v38 = string.sub(v34, v37);
				if v38 == "SoundId" then
					v35 = "rbxassetid://" .. v35;
				end;
				l__HDAdminMain__1.audio[v36][v38] = v35;
			end;
		end;
	end;
	v6();
end;
for v39, v40 in pairs(v2.custom:GetChildren()) do
	local v41 = string.sub(v40.Name, 5);
	if v40:FindFirstChild("SettingValue") then
		local u3 = true;
		local l__TextBox__4 = v40.SettingValue.TextBox;
		local l__TextLabel__5 = v40.SettingValue.TextLabel;
		v40.SettingValue.TextBox.FocusLost:connect(function(p3)
			if u3 then
				local l__Text__42 = v40.SettingValue.TextBox.Text;
				u3 = false;
				l__TextBox__4.Visible = false;
				l__TextLabel__5.Visible = true;
				l__TextLabel__5.Text = "Loading...";
				local v43 = l__HDAdminMain__1.signals.ChangeSetting:InvokeServer({ v41, l__Text__42 });
				if v43 == "Success" then
					local v44 = nil;
					v31();
					local v45 = "Notice";
					local v46 = string.sub(v41, 1, 5);
					if v46 == "Error" or v46 == "Alert" then
						v45 = v46;
					end;
					if v41 == "Prefix" then
						l__HDAdminMain__1:GetModule("PageCommands"):CreateCommands();
					end;
					v44 = "Successfully changed '" .. v41 .. "' to '" .. l__Text__42 .. "'";
					if v45 == "Alert" then
						l__HDAdminMain__1:GetModule("cf"):CreateNewCommandMenu("settings", { "Settings Alert", v44 }, 8, true);
					else
						l__HDAdminMain__1:GetModule("Notices"):Notice(v45, "Settings", v44);
					end;
				else
					l__TextLabel__5.Text = v43;
					wait(1);
				end;
				l__TextBox__4.Visible = true;
				l__TextLabel__5.Visible = false;
				v40.SettingValue.TextBox.Text = tostring(l__HDAdminMain__1.pdata[v41]);
				u3 = true;
			end;
		end);
	end;
end;
v31();
local v47 = v2.custom["AX Restore"];
local u6 = 0;
local l__Loading__7 = v47.Loading;
v47.MouseButton1Down:Connect(function()
	if u6 < 2 then
		local v48, v49, v50 = Color3.toHSV(v47.BackgroundColor3);
		l__Loading__7.BackgroundColor3 = Color3.fromHSV(v48, v49, v50 * 0.5);
		l__Loading__7.Visible = true;
		if u6 == 0 then
			u6 = 1;
			l__Loading__7.Blocker.Visible = false;
			l__Loading__7.TextLabel.Text = "Confirm?";
			wait(1);
		elseif u6 == 1 then
			u6 = 2;
			l__Loading__7.Blocker.Visible = true;
			l__Loading__7.TextLabel.Text = "Loading...";
			local v51 = l__HDAdminMain__1.signals.RestoreDefaultSettings:InvokeServer();
			if v51 == "Success" then
				v31();
				l__HDAdminMain__1:GetModule("PageCommands"):CreateCommands();
				local v52 = l__HDAdminMain__1:GetModule("cf"):FormatNotice("RestoreDefaultSettings");
				l__HDAdminMain__1:GetModule("Notices"):Notice("Notice", v52[1], v52[2]);
			else
				v47.TextLabel.Text = v51;
			end;
			wait(1);
		end;
		u6 = 0;
		l__Loading__7.Visible = false;
		l__Loading__7.Blocker.Visible = false;
	end;
end);
local v53 = v2.custom["AZ Space"];
v2.custom.CanvasSize = UDim2.new(0, 0, 0, v53.AbsolutePosition.Y - v2.custom["AA Space"].AbsolutePosition.Y + v53.AbsoluteSize.Y * 1);
return {};
