export const fetchAvatars = async ({
  api,
  itemId,
  collaborators
}) => {
  const usersApi = api.getUsersAPI(false);
  const avatarUrlMap = {};
  const avatarPromises = collaborators.map(async collab => {
    if (!collab?.accessible_by) return;
    const {
      accessible_by: {
        id: userId
      }
    } = collab;
    try {
      const url = await usersApi.getAvatarUrlWithAccessToken(userId.toString(), itemId);
      avatarUrlMap[userId] = url;
    } catch {
      avatarUrlMap[userId] = null;
    }
  });
  await Promise.all(avatarPromises);
  return avatarUrlMap;
};
//# sourceMappingURL=fetchAvatars.js.map