local function U(U)if U.LocalUserId then return U.LocalUserId end if U.RobloxUser and U.RobloxUser.rbxuid then return tostring(U.RobloxUser.rbxuid)end return nil end return function(o,N,q)return function(R)local y=(R:getState()).AvatarExperience.AvatarEditor.Categories.category local G=(R:getState()).AvatarExperience.AvatarEditor.Categories.subcategory local c=U(R:getState())o(N,y,G,q,c)end end


local function getUserId(state)
	if state.LocalUserId then
		return state.LocalUserId
	end

	if state.RobloxUser and state.RobloxUser.rbxuid then
		return tostring(state.RobloxUser.rbxuid)
	end

	return nil
end

return function(analyticsFunction, value, assetTypeId)
	return function(store)
		local categoryIndex = store:getState().AvatarExperience.AvatarEditor.Categories.category
		local subcategoryIndex = store:getState().AvatarExperience.AvatarEditor.Categories.subcategory
		local userId = getUserId(store:getState())
		analyticsFunction(value, categoryIndex, subcategoryIndex, assetTypeId, userId)
	end
end
