const DEFAULT_URL_PREFIX = 'https://static.sendbird.com/sample/cover/cover_';
const getOpenChannelAvatar = channel => {
  if (channel !== null && channel !== void 0 && channel.coverUrl) {
    return channel.coverUrl;
  }
};
const getChannelAvatarSource = (channel, currentUserId) => {
  if (channel !== null && channel !== void 0 && channel.coverUrl) {
    if (!new RegExp(`^${DEFAULT_URL_PREFIX}`).test(channel.coverUrl)) {
      return channel.coverUrl;
    }
  }
  return ((channel === null || channel === void 0 ? void 0 : channel.members) || []).filter(member => member.userId !== currentUserId).map(_ref => {
    let {
      profileUrl
    } = _ref;
    return profileUrl;
  });
};
const generateDefaultAvatar = channel => {
  if (channel !== null && channel !== void 0 && channel.coverUrl) {
    if (new RegExp(`^${DEFAULT_URL_PREFIX}`).test(channel.coverUrl)) {
      return true;
    }
    return false;
  }
  return true;
};

export { getChannelAvatarSource as a, getOpenChannelAvatar as b, generateDefaultAvatar as g };
//# sourceMappingURL=utils-9e1bd161.js.map
