-- Decompiled with the Synapse X Luau decompiler.

client = nil;
service = nil;
return function(p1)
	local l__Time__1 = p1.Time;
	local v2 = service.New("Sound");
	v2.Volume = 0.25;
	v2.Looped = false;
	local u1 = nil;
	local u2 = require(script:FindFirstChild("Visualizer"));
	local v3 = {
		Name = "Audio Player", 
		Title = "Audio Player", 
		Size = { 410, 400 }, 
		MinSize = { 410, 245 }, 
		icon = "http://www.roblox.com/asset/?id=7032721624", 
		Position = UDim2.new(0, 10, 1, -410)
	};
	local function u3()
		if u1 then
			u1:UnlinkFromSound();
			u1:Destroy();
			u1 = nil;
		end;
		if u2 then
			u2 = nil;
		end;
		if v2 then
			v2:Stop();
			v2:Destroy();
		end;
	end;
	function v3.OnClose()
		u3();
	end;
	local v4 = client.UI.Make("Window", v3);
	v4.gTable:Ready();
	local v5 = {
		Text = ""
	};
	local u4 = false;
	local u5 = nil;
	function v5.OnClick()
		if u4 then
			v2.Volume = 0.25;
			u5.Image = "rbxassetid://1638551696";
			u4 = false;
			return;
		end;
		v2.Volume = 0;
		u5.Image = "rbxassetid://1638584675";
		u4 = true;
	end;
	u5 = v4:AddTitleButton(v5):Add("ImageLabel", {
		Size = UDim2.new(0, 20, 0, 20), 
		Position = UDim2.new(0, 5, 0, 0), 
		Image = "rbxassetid://1638551696", 
		BackgroundTransparency = 1
	});
	local v6 = v4:Add("Frame", {
		Size = UDim2.new(1, 0, 0, 50), 
		Position = UDim2.new(0, 0, 0, 30), 
		BackgroundTransparency = 1, 
		TextScaled = true
	});
	local u6 = nil;
	local u7 = {};
	local u8 = nil;
	local u9 = v4:Add("TextLabel", {
		Text = "Audio Player", 
		Size = UDim2.new(1, 0, 0, 20), 
		BackgroundTransparency = 1, 
		TextScaled = true, 
		ToolTip = "Audio Player"
	});
	local u10 = nil;
	local u11 = false;
	local v7 = v4:Add("TabFrame", {
		Size = UDim2.new(1, 0, 1, -165), 
		Position = UDim2.new(0, 0, 0, 90)
	});
	local v8 = v7:NewTab("Game", {
		Text = "Game", 
		OnFocus = function()
			u10 = u7.Game or {};
		end
	});
	local v9 = v7:NewTab("Adonis", {
		Text = "Adonis", 
		OnFocus = function()
			u10 = u7.Adonis or {};
		end
	});
	local v10 = {
		Visible = false, 
		Size = UDim2.new(1, 0, 1, 0), 
		Position = UDim2.new(0, 0, 0, 0), 
		BackgroundTransparency = 0, 
		ZIndex = 10000
	};
	local v11 = {};
	local v12 = {
		Class = "TextButton", 
		Text = "Cancel", 
		Position = UDim2.new(0, 5, 1, -35), 
		Size = UDim2.new(0.5, -5, 0, 30), 
		BackgroundTransparency = 0, 
		ZIndex = 10003
	};
	local u12 = nil;
	function v12.OnClicked()
		u12.Visible = false;
	end;
	v11[1] = {
		Class = "TextLabel", 
		Text = "New Custom Playlist string:", 
		Position = UDim2.new(0, 5, 0, 5), 
		Size = UDim2.new(1, -10, 0, 30), 
		BackgroundTransparency = 0, 
		ZIndex = 10001
	};
	v11[2] = {
		Class = "TextButton", 
		Text = "Add", 
		Position = UDim2.new(0.5, 5, 1, -35), 
		Size = UDim2.new(0.5, -10, 0, 30), 
		BackgroundTransparency = 0, 
		ZIndex = 10002, 
		OnClicked = function()

		end
	};
	v11[3] = v12;
	v10.Children = v11;
	u12 = v7:Add("Frame", v10);
	local v13 = {
		Position = UDim2.new(0, 5, 0, 40), 
		Size = UDim2.new(1, -10, 1, -80), 
		TextWrapped = true, 
		ClearTextOnFocus = false, 
		PlaceholderText = "NAME:ID, SECOND:12398801, HeavyIsDead:4881542521", 
		ZIndex = 10004
	};
	local function u13(p2, p3)
		local v14 = 0;
		u6 = nil;
		if u7 and u7[p2.Name] then
			u7[p2.Name] = nil;
		end;
		if u8 then
			u8:Disconnect();
		end;
		p2:ClearAllChildren();
		local v15 = p2:Add("ScrollingFrame", {
			Size = UDim2.new(1, 0, 1, 1), 
			Position = UDim2.new(0, 0, 0, 0), 
			BackgroundColor3 = Color3.new(0.235294, 0.235294, 0.235294), 
			BackgroundTransparency = 1
		});
		local v16 = v15:Add("TextLabel", {
			Text = "Loading nothing yet!", 
			ToolTip = "Never gonna give you up, Never gonna let you down...", 
			BackgroundTransparency = 0, 
			Size = UDim2.new(1, 0, 1, 0), 
			Position = UDim2.new(0, 0, 0, 0), 
			ZIndex = 69420
		});
		u7[p2.Name] = {};
		for v17, v18 in next, p3 or {} do
			if type(v18) == "table" then
				v16.Text = "Loading tracks (" .. v17 .. "/" .. #p3 .. ")";
				local v19, v20 = pcall(function()
					return service.MarketplaceService:GetProductInfo(v18.ID, Enum.InfoType.Asset);
				end);
				if v20.AssetTypeId == 3 then
					table.insert(u7[p2.Name], v18);
					local v21 = {
						Text = "  " .. v14 + 1 .. ") " .. (v19 and v20.Name or "[ERROR] " .. v18.Name), 
						ToolTip = "Name: " .. v18.Name .. " | ID: " .. v18.ID, 
						Size = UDim2.new(1, 0, 0, 25), 
						Position = UDim2.new(0, 0, 0, v14 * 25)
					};
					if v14 % 2 == 0 then
						local v22 = 0;
					else
						v22 = 0.2;
					end;
					v21.BackgroundTransparency = v22;
					v21.TextXAlignment = "Left";
					function v21.OnClicked(p4)
						if u6 and u6.Button then
							u6.Button.BackgroundTransparency = 0;
						end;
						p4.BackgroundTransparency = 0.5;
						v2:Stop();
						v2.SoundId = "http://www.roblox.com/asset/?id=" .. v18.ID;
						v2:Play();
						u9.Text = v19 and v20.Name or v18.Name;
						u6 = {
							ID = v18.ID, 
							Name = v18.Name, 
							Button = p4, 
							Index = v17
						};
					end;
					v15:Add("TextButton", v21);
				end;
			end;
			v14 = v14 + 1;
		end;
		u8 = v2.Ended:Connect(function()
			if u10 and u6 then
				if u11 then
					local v23 = nil;
					while true do
						v23 = math.random(#u10);
						if v23 ~= u6.Index then
							break;
						end;
						if #u10 <= 1 then
							break;
						end;					
					end;
					local v24 = u10[v23];
					if v24 then
						v2:Stop();
						v2.SoundId = "http://www.roblox.com/asset/?id=" .. v24.ID;
						v2:Play();
						local v25, v26 = pcall(function()
							return service.MarketplaceService:GetProductInfo(v24.ID, Enum.InfoType.Asset);
						end);
						u9.Text = v25 and v26.Name or "[ERROR] " .. v24.Name;
						u6 = {
							ID = v24.ID, 
							Name = v24.Name, 
							Button = nil, 
							Index = v23
						};
						return;
					end;
				else
					local v27 = u10[u6.Index + 1];
					if v27 then
						v2:Stop();
						v2.SoundId = "http://www.roblox.com/asset/?id=" .. v27.ID;
						v2:Play();
						local v28, v29 = pcall(function()
							return service.MarketplaceService:GetProductInfo(v27.ID, Enum.InfoType.Asset);
						end);
						u9.Text = v28 and v29.Name or "[ERROR] " .. v27.Name;
						u6 = {
							ID = v27.ID, 
							Name = v27.Name, 
							Button = nil, 
							Index = u6.Index + 1
						};
					end;
				end;
			end;
		end);
		v16:Destroy();
		v15:ResizeCanvas(false, true);
	end;
	local u14 = v7:NewTab("Custom", {
		Text = "Custom", 
		OnFocus = function()
			u10 = u7.Custom or {};
		end
	});
	function v13.TextChanged(p5, p6, p7)
		client.Variables.Playlist = {
			Playlist = {}
		};
		for v30, v31 in pairs(client.Variables.Playlist.Playlist) do
			client.Variables.Playlist.Playlist[v30] = nil;
		end;
		for v32, v33 in next, string.split(string.gsub(p5, " ", ""), ",") do
			local v34 = string.split(v33, ":");
			table.insert(client.Variables.Playlist.Playlist, #client.Variables.Playlist.Playlist + 1, {
				Name = tostring(v34[1]), 
				ID = tonumber(v34[2])
			});
		end;
		u12.Visible = false;
		u13(u14, client.Variables.Playlist.Playlist or {});
		u10 = u7.Custom or {};
	end;
	local v35 = u12:Add("TextBox", v13);
	v35.BackgroundColor3 = v35.BackgroundColor3:lerp(Color3.new(1, 1, 1), 0.1);
	u12.BackgroundColor3 = u12.BackgroundColor3:lerp(Color3.new(1, 1, 1), 0.05);
	local v36 = v4:Add("Frame", {
		Size = UDim2.new(1, 0, 0, 75), 
		Position = UDim2.new(0, 0, 1, -75), 
		BackgroundColor3 = Color3.new(0.235294, 0.235294, 0.235294), 
		BackgroundTransparency = 0
	});
	local v37 = {
		Text = "Load playlist", 
		ToolTip = "Create a new custom playlist from a string.", 
		BackgroundTransparency = 0, 
		Size = UDim2.new(0, 100, 0, 30), 
		Position = UDim2.new(0, 5, 1, -70)
	};
	function v37.OnClicked()
		v35.Text = "";
		u12.Visible = true;
		u14:FocusTab();
		u10 = u7.Custom or {};
	end;
	local v38 = v36:Add("TextButton", v37);
	local v39 = {
		Text = "Save playlist", 
		ToolTip = "Save your custom playlist to the games datastore.", 
		BackgroundTransparency = 0, 
		Size = UDim2.new(0, 100, 0, 30), 
		Position = UDim2.new(1, -105, 1, -70)
	};
	local u15 = v7:NewTab("Personal", {
		Text = "Personal", 
		OnFocus = function()
			u10 = u7.Personal or {};
		end
	});
	function v39.OnClicked()
		u15:FocusTab();
		if client.Variables.Playlist.Playlist ~= nil and client.Variables.Playlist.Playlist ~= {} then
			client.Functions.UpdatePlaylist(client.Variables.Playlist);
			u13(u15, client.Functions.Playlist().Playlist or {});
		else
			print("[ERROR] Cannot update empty Playlist");
		end;
		u10 = u7.Personal or {};
	end;
	local v40 = v36:Add("TextButton", v39);
	local v41 = v36:Add("TextLabel", {
		Text = "  ID: ", 
		ToolTip = "ID: The Sound ID from the roblox catalogue.", 
		BackgroundTransparency = 0, 
		Size = UDim2.new(0, 120, 0, 30), 
		Position = UDim2.new(0, 5, 1, -35), 
		TextXAlignment = "Left", 
		Children = {
			TextBox = {
				Text = "", 
				PlaceholderText = "4881542521", 
				Size = UDim2.new(0, 80, 1, 0), 
				Position = UDim2.new(1, -90, 0, 0), 
				BackgroundTransparency = 1, 
				TextXAlignment = "Right", 
				TextChanged = function(p8, p9, p10)
					if p9 then
						v2:Stop();
						v2.SoundId = "http://www.roblox.com/asset/?id=" .. p8;
						v2:Play();
					end;
				end
			}
		}
	});
	local v42 = v36:Add("TextLabel", {
		Text = "  Vol: ", 
		ToolTip = "Volume: How loud the audio will play (0 to 10).", 
		BackgroundTransparency = 0, 
		Size = UDim2.new(0, 60, 0, 30), 
		Position = UDim2.new(0, 130, 1, -35), 
		TextXAlignment = "Left", 
		Children = {
			TextBox = {
				Text = "", 
				PlaceholderText = "1", 
				Size = UDim2.new(0, 40, 1, 0), 
				Position = UDim2.new(1, -50, 0, 0), 
				BackgroundTransparency = 1, 
				TextXAlignment = "Right", 
				TextChanged = function(p11, p12, p13)
					if p12 then
						v2.Volume = p11;
					end;
				end
			}
		}
	});
	local v43 = v36:Add("TextLabel", {
		Text = "  Pos: ", 
		ToolTip = "Position: Set the audio's position (In seconds).", 
		BackgroundTransparency = 0, 
		Size = UDim2.new(0, 60, 0, 30), 
		Position = UDim2.new(1, -205, 1, -35), 
		TextXAlignment = "Left", 
		Children = {
			TextBox = {
				Text = "", 
				PlaceholderText = "0", 
				Size = UDim2.new(0, 40, 1, 0), 
				Position = UDim2.new(1, -50, 0, 0), 
				BackgroundTransparency = 1, 
				TextXAlignment = "Right", 
				TextChanged = function(p14, p15, p16)
					if p15 then
						v2:Stop();
						v2.TimePosition = p14;
						v2:Play();
					end;
				end
			}
		}
	});
	local v44 = v36:Add("TextButton", {
		Text = "\226\151\128\239\184\143", 
		TextSize = 15, 
		ToolTip = "Back: Go back to the last played track.", 
		BackgroundTransparency = 0, 
		Size = UDim2.new(0, 30, 0, 30), 
		Position = UDim2.new(1, -140, 1, -35), 
		TextXAlignment = "Center", 
		OnClick = function()
			if u10 and u6 then
				if u11 then
					local v45 = nil;
					while true do
						v45 = math.random(#u10);
						if v45 ~= u6.Index then
							break;
						end;
						if #u10 <= 1 then
							break;
						end;					
					end;
					local v46 = u10[v45];
					if v46 then
						v2:Stop();
						v2.SoundId = "http://www.roblox.com/asset/?id=" .. v46.ID;
						v2:Play();
						local v47, v48 = pcall(function()
							return service.MarketplaceService:GetProductInfo(v46.ID, Enum.InfoType.Asset);
						end);
						u9.Text = v47 and v48.Name or "[ERROR] " .. v46.Name;
						u6 = {
							ID = v46.ID, 
							Name = v46.Name, 
							Button = nil, 
							Index = v45
						};
						return;
					end;
				else
					local v49 = u10[u6.Index - 1];
					if v49 then
						v2:Stop();
						v2.SoundId = "http://www.roblox.com/asset/?id=" .. v49.ID;
						v2:Play();
						local v50, v51 = pcall(function()
							return service.MarketplaceService:GetProductInfo(v49.ID, Enum.InfoType.Asset);
						end);
						u9.Text = v50 and v51.Name or "[ERROR] " .. v49.Name;
						u6 = {
							ID = v49.ID, 
							Name = v49.Name, 
							Button = nil, 
							Index = u6.Index - 1
						};
					end;
				end;
			end;
		end
	});
	local v52 = v36:Add("TextButton", {
		Text = "\226\143\175\239\184\143", 
		TextSize = 15, 
		ToolTip = "Pause/Play: Control the tracks playing state.", 
		BackgroundTransparency = 0, 
		Size = UDim2.new(0, 30, 0, 30), 
		Position = UDim2.new(1, -105, 1, -35), 
		TextXAlignment = "Center", 
		OnClick = function()
			if v2.Playing then
				v2:Pause();
				return;
			end;
			v2:Resume();
		end
	});
	local v53 = v36:Add("TextButton", {
		Text = "\226\150\182\239\184\143", 
		TextSize = 15, 
		ToolTip = "Forward: Skip to the next track.", 
		BackgroundTransparency = 0, 
		Size = UDim2.new(0, 30, 0, 30), 
		Position = UDim2.new(1, -70, 1, -35), 
		TextXAlignment = "Center", 
		OnClick = function()
			if u10 and u6 then
				if u11 then
					local v54 = nil;
					while true do
						v54 = math.random(#u10);
						if v54 ~= u6.Index then
							break;
						end;
						if #u10 <= 1 then
							break;
						end;					
					end;
					local v55 = u10[v54];
					if v55 then
						v2:Stop();
						v2.SoundId = "http://www.roblox.com/asset/?id=" .. v55.ID;
						v2:Play();
						local v56, v57 = pcall(function()
							return service.MarketplaceService:GetProductInfo(v55.ID, Enum.InfoType.Asset);
						end);
						u9.Text = v56 and v57.Name or "[ERROR] " .. v55.Name;
						u6 = {
							ID = v55.ID, 
							Name = v55.Name, 
							Button = nil, 
							Index = v54
						};
						return;
					end;
				else
					local v58 = u10[u6.Index + 1];
					if v58 then
						v2:Stop();
						v2.SoundId = "http://www.roblox.com/asset/?id=" .. v58.ID;
						v2:Play();
						local v59, v60 = pcall(function()
							return service.MarketplaceService:GetProductInfo(v58.ID, Enum.InfoType.Asset);
						end);
						u9.Text = v59 and v60.Name or "[ERROR] " .. v58.Name;
						u6 = {
							ID = v58.ID, 
							Name = v58.Name, 
							Button = nil, 
							Index = u6.Index + 1
						};
					end;
				end;
			end;
		end
	});
	local u16 = nil;
	local u17 = nil;
	local v61 = {
		Text = "\240\159\148\128", 
		TextSize = 15, 
		ToolTip = "Shuffle: Randomly pick between.", 
		BackgroundTransparency = 0, 
		Size = UDim2.new(0, 30, 0, 30), 
		Position = UDim2.new(1, -35, 1, -35), 
		TextXAlignment = "Center"
	};
	local function u18()
		if not u11 then
			u16.BackgroundColor3 = u17;
			return;
		end;
		u16.BackgroundColor3 = Color3.new(0, 1, 0.6);
	end;
	function v61.OnClick()
		u11 = not u11;
		u18();
	end;
	u16 = v36:Add("TextButton", v61);
	u17 = u16.BackgroundColor3;
	v2.Parent = v6;
	u2.new(v6, 400):LinkToSound(v2);
	local function v62(p17)
		p17:Add("TextLabel", {
			Text = "Waiting in queue to load tracks...", 
			ToolTip = "Never gonna give you up, Never gonna let you down...", 
			BackgroundTransparency = 0, 
			Size = UDim2.new(1, 0, 1, 0), 
			Position = UDim2.new(0, 0, 0, 0), 
			ZIndex = 69420
		});
	end;
	v62(u15);
	v62(v8);
	v62(v9);
	u13(u15, client.Functions.Playlist().Playlist or {});
	u13(v8, client.Remote.Get("Variable", "MusicList") or {});
	u13(v9, client.Remote.Get("Variable", "MusicList") or {});
	u10 = u7.Personal or {};
end;