local G=game:GetService("\082\117\110\083\101\114\118\105\099\101")local r=require(script.Shared:WaitForChild("\085\116\105\108"))if G:IsServer()==false then error("\067\109\100\114 \115\101\114\118\101\114 \109\111\100\117\108\101 \105\115 \115\111\109\101\104\111\119 \114\117\110\110\105\110\103 \111\110 \097 \099\108\105\101\110\116\033")end local m do m=setmetatable({ReplicatedRoot=nil,RemoteFunction=nil,RemoteEvent=nil;Util=r;DefaultCommandsFolder=script.BuiltInCommands},{__index=function(G,r)local m=G.Registry[r]if m and type(m)=="\102\117\110\099\116\105\111\110"then return function(r,...)return m(G.Registry,...)end end end})m.Registry=(require(script.Shared.Registry))(m)m.Dispatcher=(require(script.Shared.Dispatcher))(m);(require(script.Initialize))(m)end m.RemoteFunction.OnServerInvoke=function(G,r,U)if#r>100000 then return"\073\110\112\117\116 \116\111\111 \108\111\110\103"end return m.Dispatcher:EvaluateAndRun(r,G,U)end return m
local RunService = game:GetService("RunService")
local Util = require(script.Shared:WaitForChild("Util"))

if RunService:IsServer() == false then
	error("Cmdr server module is somehow running on a client!")
end

local Cmdr do
	Cmdr = setmetatable({
		ReplicatedRoot = nil;
		RemoteFunction = nil;
		RemoteEvent = nil;
		Util = Util;
		DefaultCommandsFolder = script.BuiltInCommands;
	}, {
		__index = function (self, k)
			local r = self.Registry[k]
			if r and type(r) == "function" then
				return function (_, ...)
					return r(self.Registry, ...)
				end
			end
		end
	})

	Cmdr.Registry = require(script.Shared.Registry)(Cmdr)
	Cmdr.Dispatcher = require(script.Shared.Dispatcher)(Cmdr)

	require(script.Initialize)(Cmdr)
end

-- Handle command invocations from the clients.
Cmdr.RemoteFunction.OnServerInvoke = function (player, text, options)
	if #text > 100_000 then
		return "Input too long"
	end

	return Cmdr.Dispatcher:EvaluateAndRun(text, player, options)
end

return Cmdr