local function W(W)if not type(W)=="\115\116\114\105\110\103"then warn(string.format("\069\120\112\101\099\116\101\100 \115\116\097\099\107 \116\111 \098\101 \097 \115\116\114\105\110\103\044 \114\101\099\101\105\118\101\100 \058 \037\115",type(W)))return tostring(W)end local T=string.gsub(W,"\080\108\097\121\101\114\115\037\046\091\094\046\093\043\037\046","\080\108\097\121\101\114\115\046\060\080\108\097\121\101\114\062\046")return T end local T={}T.__index=T function T.new(W)if not W then W=Networking.new()end local X={_googleAnalyticsReporter=ReporterGoogleAnalytics.new({networking=W}),_playFabReporter=ReporterPlayFab.new()}setmetatable(X,T)return X end

local function removePlayerNameFromStack(stack)
	-- in order to generalize the data so that errors are properly grouped,
	--  we must strip out any personal information from the callstack.
	if not type(stack) == "string" then
		warn(string.format("Expected stack to be a string, received : %s", type(stack)))
		return tostring(stack)
	end

	local sanitizedStack = string.gsub(stack, "Players%.[^.]+%.", "Players.<Player>.")
	return sanitizedStack
end



local ErrorReporter = {}
ErrorReporter.__index = ErrorReporter

function ErrorReporter.new(networkingImpl)
	if not networkingImpl then
		networkingImpl = Networking.new()
	end

	local er = {
		-- reporter implementations
		_googleAnalyticsReporter = ReporterGoogleAnalytics.new({
			networking = networkingImpl,
		}),
		_playFabReporter = ReporterPlayFab.new(),
	}
	setmetatable(er, ErrorReporter)

	return er
end

