-- Decompiled with the Synapse X Luau decompiler.


client = nil;
service = nil;
return function(p1)
	local v1 = client.UI.Make("Window", {
		Name = "Terminal", 
		Title = "Terminal", 
		Size = { 500, 300 }, 
		AllowMultiple = false, 
		OnClose = function()

		end
	});
	local v2 = v1:Add("ScrollingFrame", {
		Size = UDim2.new(1, -10, 1, -40), 
		BackgroundTransparency = 1, 
		List = {}
	});
	local v3 = v1:Add("TextBox", {
		Text = "", 
		Size = UDim2.new(1, 0, 0, 30), 
		Position = UDim2.new(0, 0, 1, -30), 
		PlaceholderText = "Enter command", 
		TextXAlignment = "Left"
	});
	local function u1(p2, p3)
		table.insert(p3, p2);
		if #p3 > 500 then
			table.remove(p3, 1);
		end;
	end;
	local u2 = {};
	v1:BindEvent(service.Events.TerminalLive, function(p4)
		local l__Type__4 = p4.Type;
		u1(p4.Data, u2);
	end);
	v3.FocusLost:connect(function(p5)
		service.Debounce("_TERMINAL_BOX_FOCUSLOST", function()
			if p5 and v3.Text ~= "" and v3.Text ~= "Enter command" then
				local l__Text__5 = v3.Text;
				v3.Text = "";
				u1(">" .. l__Text__5, u2);
				local v6 = client.Remote.Get("Terminal", l__Text__5, {
					Time = tick()
				});
				if v6 and type(v6) == "table" then
					for v7, v8 in ipairs(v6) do
						u1(v8, u2);
					end;
				end;
				v3:CaptureFocus();
			end;
			wait(0.1);
		end);
	end);
	v1:Ready();
	local v9 = 0;
	while v1.gTable.Active and wait(0.5) do
		if v9 < #u2 then
			v9 = #u2;
			v2:GenerateList(u2, nil, true);
		end;	
	end;
end;
