-- Decompiled with the Synapse X Luau decompiler.


local l__RunService__1 = game:GetService("RunService");
local l__StarterGui__2 = game:GetService("StarterGui");
local l__LocalPlayer__3 = game:GetService("Players").LocalPlayer;
local l__Shared__4 = script:WaitForChild("Shared");
local v5 = require(l__Shared__4:WaitForChild("Util"));
if l__RunService__1:IsClient() == false then
	error("Server scripts cannot require the client library. Please require the server library to use Cmdr in your own code.");
end;
local v6 = setmetatable({
	ReplicatedRoot = script, 
	RemoteFunction = script:WaitForChild("CmdrFunction"), 
	RemoteEvent = script:WaitForChild("CmdrEvent"), 
	ActivationKeys = {
		[Enum.KeyCode.F2] = true
	}, 
	Enabled = true, 
	MashToEnable = false, 
	ActivationUnlocksMouse = false, 
	HideOnLostFocus = true, 
	PlaceName = "Cmdr", 
	Util = v5, 
	Events = {}
}, {
	__index = function(p1, p2)
		local v7 = p1.Dispatcher[p2];
		if not v7 or type(v7) ~= "function" then
			return;
		end;
		return function(p3, ...)
			return v7(p1.Dispatcher, ...);
		end;
	end
});
v6.Registry = require(l__Shared__4.Registry)(v6);
v6.Dispatcher = require(l__Shared__4.Dispatcher)(v6);
if l__StarterGui__2:WaitForChild("Cmdr") and wait() and l__LocalPlayer__3:WaitForChild("PlayerGui"):FindFirstChild("Cmdr") == nil then
	l__StarterGui__2.Cmdr:Clone().Parent = l__LocalPlayer__3.PlayerGui;
end;
function v6.SetActivationKeys(p4, p5)
	p4.ActivationKeys = v5.MakeDictionary(p5);
end;
local u1 = require(script.CmdrInterface)(v6);
function v6.SetPlaceName(p6, p7)
	p6.PlaceName = p7;
	u1.Window:UpdateLabel();
end;
function v6.SetEnabled(p8, p9)
	p8.Enabled = p9;
end;
function v6.SetActivationUnlocksMouse(p10, p11)
	p10.ActivationUnlocksMouse = p11;
end;
function v6.Show(p12)
	if not p12.Enabled then
		return;
	end;
	u1.Window:Show();
end;
function v6.Hide(p13)
	u1.Window:Hide();
end;
function v6.Toggle(p14)
	if not p14.Enabled then
		return p14:Hide();
	end;
	u1.Window:SetVisible(not u1.Window:IsVisible());
end;
function v6.SetMashToEnable(p15, p16)
	p15.MashToEnable = p16;
	if p16 then
		p15:SetEnabled(false);
	end;
end;
function v6.SetHideOnLostFocus(p17, p18)
	p17.HideOnLostFocus = p18;
end;
function v6.HandleEvent(p19, p20, p21)
	p19.Events[p20] = p21;
end;
if l__RunService__1:IsServer() == false then
	v6.Registry:RegisterTypesIn(script:WaitForChild("Types"));
	v6.Registry:RegisterCommandsIn(script:WaitForChild("Commands"));
end;
v6.RemoteEvent.OnClientEvent:Connect(function(p22, ...)
	if v6.Events[p22] then
		v6.Events[p22](...);
	end;
end);
require(script.DefaultEventHandlers)(v6);
return v6;
