// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark

part of 'chat_event.dart';

// **************************************************************************
// FreezedGenerator
// **************************************************************************

T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
    'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');

/// @nodoc
mixin _$ChatEvent {
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $ChatEventCopyWith<$Res> {
  factory $ChatEventCopyWith(ChatEvent value, $Res Function(ChatEvent) then) =
      _$ChatEventCopyWithImpl<$Res, ChatEvent>;
}

/// @nodoc
class _$ChatEventCopyWithImpl<$Res, $Val extends ChatEvent>
    implements $ChatEventCopyWith<$Res> {
  _$ChatEventCopyWithImpl(this._value, this._then);

  // ignore: unused_field
  final $Val _value;
  // ignore: unused_field
  final $Res Function($Val) _then;
}

/// @nodoc
abstract class _$$ChatEventStartedImplCopyWith<$Res> {
  factory _$$ChatEventStartedImplCopyWith(_$ChatEventStartedImpl value,
          $Res Function(_$ChatEventStartedImpl) then) =
      __$$ChatEventStartedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String? userId});
}

/// @nodoc
class __$$ChatEventStartedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventStartedImpl>
    implements _$$ChatEventStartedImplCopyWith<$Res> {
  __$$ChatEventStartedImplCopyWithImpl(_$ChatEventStartedImpl _value,
      $Res Function(_$ChatEventStartedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? userId = freezed,
  }) {
    return _then(_$ChatEventStartedImpl(
      userId: freezed == userId
          ? _value.userId
          : userId // ignore: cast_nullable_to_non_nullable
              as String?,
    ));
  }
}

/// @nodoc

class _$ChatEventStartedImpl implements ChatEventStarted {
  const _$ChatEventStartedImpl({this.userId});

  @override
  final String? userId;

  @override
  String toString() {
    return 'ChatEvent.started(userId: $userId)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventStartedImpl &&
            (identical(other.userId, userId) || other.userId == userId));
  }

  @override
  int get hashCode => Object.hash(runtimeType, userId);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventStartedImplCopyWith<_$ChatEventStartedImpl> get copyWith =>
      __$$ChatEventStartedImplCopyWithImpl<_$ChatEventStartedImpl>(
          this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return started(userId);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return started?.call(userId);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (started != null) {
      return started(userId);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return started(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return started?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (started != null) {
      return started(this);
    }
    return orElse();
  }
}

abstract class ChatEventStarted implements ChatEvent {
  const factory ChatEventStarted({final String? userId}) =
      _$ChatEventStartedImpl;

  String? get userId;
  @JsonKey(ignore: true)
  _$$ChatEventStartedImplCopyWith<_$ChatEventStartedImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventChatsLoadedImplCopyWith<$Res> {
  factory _$$ChatEventChatsLoadedImplCopyWith(_$ChatEventChatsLoadedImpl value,
          $Res Function(_$ChatEventChatsLoadedImpl) then) =
      __$$ChatEventChatsLoadedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String? currentUserId});
}

/// @nodoc
class __$$ChatEventChatsLoadedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventChatsLoadedImpl>
    implements _$$ChatEventChatsLoadedImplCopyWith<$Res> {
  __$$ChatEventChatsLoadedImplCopyWithImpl(_$ChatEventChatsLoadedImpl _value,
      $Res Function(_$ChatEventChatsLoadedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? currentUserId = freezed,
  }) {
    return _then(_$ChatEventChatsLoadedImpl(
      currentUserId: freezed == currentUserId
          ? _value.currentUserId
          : currentUserId // ignore: cast_nullable_to_non_nullable
              as String?,
    ));
  }
}

/// @nodoc

class _$ChatEventChatsLoadedImpl implements ChatEventChatsLoaded {
  const _$ChatEventChatsLoadedImpl({this.currentUserId});

  @override
  final String? currentUserId;

  @override
  String toString() {
    return 'ChatEvent.chatsLoaded(currentUserId: $currentUserId)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventChatsLoadedImpl &&
            (identical(other.currentUserId, currentUserId) ||
                other.currentUserId == currentUserId));
  }

  @override
  int get hashCode => Object.hash(runtimeType, currentUserId);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventChatsLoadedImplCopyWith<_$ChatEventChatsLoadedImpl>
      get copyWith =>
          __$$ChatEventChatsLoadedImplCopyWithImpl<_$ChatEventChatsLoadedImpl>(
              this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return chatsLoaded(currentUserId);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return chatsLoaded?.call(currentUserId);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (chatsLoaded != null) {
      return chatsLoaded(currentUserId);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return chatsLoaded(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return chatsLoaded?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (chatsLoaded != null) {
      return chatsLoaded(this);
    }
    return orElse();
  }
}

abstract class ChatEventChatsLoaded implements ChatEvent {
  const factory ChatEventChatsLoaded({final String? currentUserId}) =
      _$ChatEventChatsLoadedImpl;

  String? get currentUserId;
  @JsonKey(ignore: true)
  _$$ChatEventChatsLoadedImplCopyWith<_$ChatEventChatsLoadedImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventChatSelectedImplCopyWith<$Res> {
  factory _$$ChatEventChatSelectedImplCopyWith(
          _$ChatEventChatSelectedImpl value,
          $Res Function(_$ChatEventChatSelectedImpl) then) =
      __$$ChatEventChatSelectedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String chatId});
}

/// @nodoc
class __$$ChatEventChatSelectedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventChatSelectedImpl>
    implements _$$ChatEventChatSelectedImplCopyWith<$Res> {
  __$$ChatEventChatSelectedImplCopyWithImpl(_$ChatEventChatSelectedImpl _value,
      $Res Function(_$ChatEventChatSelectedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? chatId = null,
  }) {
    return _then(_$ChatEventChatSelectedImpl(
      null == chatId
          ? _value.chatId
          : chatId // ignore: cast_nullable_to_non_nullable
              as String,
    ));
  }
}

/// @nodoc

class _$ChatEventChatSelectedImpl implements ChatEventChatSelected {
  const _$ChatEventChatSelectedImpl(this.chatId);

  @override
  final String chatId;

  @override
  String toString() {
    return 'ChatEvent.chatSelected(chatId: $chatId)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventChatSelectedImpl &&
            (identical(other.chatId, chatId) || other.chatId == chatId));
  }

  @override
  int get hashCode => Object.hash(runtimeType, chatId);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventChatSelectedImplCopyWith<_$ChatEventChatSelectedImpl>
      get copyWith => __$$ChatEventChatSelectedImplCopyWithImpl<
          _$ChatEventChatSelectedImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return chatSelected(chatId);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return chatSelected?.call(chatId);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (chatSelected != null) {
      return chatSelected(chatId);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return chatSelected(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return chatSelected?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (chatSelected != null) {
      return chatSelected(this);
    }
    return orElse();
  }
}

abstract class ChatEventChatSelected implements ChatEvent {
  const factory ChatEventChatSelected(final String chatId) =
      _$ChatEventChatSelectedImpl;

  String get chatId;
  @JsonKey(ignore: true)
  _$$ChatEventChatSelectedImplCopyWith<_$ChatEventChatSelectedImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventMessagesRequestedImplCopyWith<$Res> {
  factory _$$ChatEventMessagesRequestedImplCopyWith(
          _$ChatEventMessagesRequestedImpl value,
          $Res Function(_$ChatEventMessagesRequestedImpl) then) =
      __$$ChatEventMessagesRequestedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String chatId, String? cursor});
}

/// @nodoc
class __$$ChatEventMessagesRequestedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventMessagesRequestedImpl>
    implements _$$ChatEventMessagesRequestedImplCopyWith<$Res> {
  __$$ChatEventMessagesRequestedImplCopyWithImpl(
      _$ChatEventMessagesRequestedImpl _value,
      $Res Function(_$ChatEventMessagesRequestedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? chatId = null,
    Object? cursor = freezed,
  }) {
    return _then(_$ChatEventMessagesRequestedImpl(
      null == chatId
          ? _value.chatId
          : chatId // ignore: cast_nullable_to_non_nullable
              as String,
      cursor: freezed == cursor
          ? _value.cursor
          : cursor // ignore: cast_nullable_to_non_nullable
              as String?,
    ));
  }
}

/// @nodoc

class _$ChatEventMessagesRequestedImpl implements ChatEventMessagesRequested {
  const _$ChatEventMessagesRequestedImpl(this.chatId, {this.cursor});

  @override
  final String chatId;
  @override
  final String? cursor;

  @override
  String toString() {
    return 'ChatEvent.messagesRequested(chatId: $chatId, cursor: $cursor)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventMessagesRequestedImpl &&
            (identical(other.chatId, chatId) || other.chatId == chatId) &&
            (identical(other.cursor, cursor) || other.cursor == cursor));
  }

  @override
  int get hashCode => Object.hash(runtimeType, chatId, cursor);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventMessagesRequestedImplCopyWith<_$ChatEventMessagesRequestedImpl>
      get copyWith => __$$ChatEventMessagesRequestedImplCopyWithImpl<
          _$ChatEventMessagesRequestedImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return messagesRequested(chatId, cursor);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return messagesRequested?.call(chatId, cursor);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (messagesRequested != null) {
      return messagesRequested(chatId, cursor);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return messagesRequested(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return messagesRequested?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (messagesRequested != null) {
      return messagesRequested(this);
    }
    return orElse();
  }
}

abstract class ChatEventMessagesRequested implements ChatEvent {
  const factory ChatEventMessagesRequested(final String chatId,
      {final String? cursor}) = _$ChatEventMessagesRequestedImpl;

  String get chatId;
  String? get cursor;
  @JsonKey(ignore: true)
  _$$ChatEventMessagesRequestedImplCopyWith<_$ChatEventMessagesRequestedImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventMessageReceivedImplCopyWith<$Res> {
  factory _$$ChatEventMessageReceivedImplCopyWith(
          _$ChatEventMessageReceivedImpl value,
          $Res Function(_$ChatEventMessageReceivedImpl) then) =
      __$$ChatEventMessageReceivedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({Message message});

  $MessageCopyWith<$Res> get message;
}

/// @nodoc
class __$$ChatEventMessageReceivedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventMessageReceivedImpl>
    implements _$$ChatEventMessageReceivedImplCopyWith<$Res> {
  __$$ChatEventMessageReceivedImplCopyWithImpl(
      _$ChatEventMessageReceivedImpl _value,
      $Res Function(_$ChatEventMessageReceivedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = null,
  }) {
    return _then(_$ChatEventMessageReceivedImpl(
      null == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as Message,
    ));
  }

  @override
  @pragma('vm:prefer-inline')
  $MessageCopyWith<$Res> get message {
    return $MessageCopyWith<$Res>(_value.message, (value) {
      return _then(_value.copyWith(message: value));
    });
  }
}

/// @nodoc

class _$ChatEventMessageReceivedImpl implements ChatEventMessageReceived {
  const _$ChatEventMessageReceivedImpl(this.message);

  @override
  final Message message;

  @override
  String toString() {
    return 'ChatEvent.messageReceived(message: $message)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventMessageReceivedImpl &&
            (identical(other.message, message) || other.message == message));
  }

  @override
  int get hashCode => Object.hash(runtimeType, message);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventMessageReceivedImplCopyWith<_$ChatEventMessageReceivedImpl>
      get copyWith => __$$ChatEventMessageReceivedImplCopyWithImpl<
          _$ChatEventMessageReceivedImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return messageReceived(message);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return messageReceived?.call(message);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (messageReceived != null) {
      return messageReceived(message);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return messageReceived(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return messageReceived?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (messageReceived != null) {
      return messageReceived(this);
    }
    return orElse();
  }
}

abstract class ChatEventMessageReceived implements ChatEvent {
  const factory ChatEventMessageReceived(final Message message) =
      _$ChatEventMessageReceivedImpl;

  Message get message;
  @JsonKey(ignore: true)
  _$$ChatEventMessageReceivedImplCopyWith<_$ChatEventMessageReceivedImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventMessageSentImplCopyWith<$Res> {
  factory _$$ChatEventMessageSentImplCopyWith(_$ChatEventMessageSentImpl value,
          $Res Function(_$ChatEventMessageSentImpl) then) =
      __$$ChatEventMessageSentImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String chatId, String content});
}

/// @nodoc
class __$$ChatEventMessageSentImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventMessageSentImpl>
    implements _$$ChatEventMessageSentImplCopyWith<$Res> {
  __$$ChatEventMessageSentImplCopyWithImpl(_$ChatEventMessageSentImpl _value,
      $Res Function(_$ChatEventMessageSentImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? chatId = null,
    Object? content = null,
  }) {
    return _then(_$ChatEventMessageSentImpl(
      null == chatId
          ? _value.chatId
          : chatId // ignore: cast_nullable_to_non_nullable
              as String,
      null == content
          ? _value.content
          : content // ignore: cast_nullable_to_non_nullable
              as String,
    ));
  }
}

/// @nodoc

class _$ChatEventMessageSentImpl implements ChatEventMessageSent {
  const _$ChatEventMessageSentImpl(this.chatId, this.content);

  @override
  final String chatId;
  @override
  final String content;

  @override
  String toString() {
    return 'ChatEvent.messageSent(chatId: $chatId, content: $content)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventMessageSentImpl &&
            (identical(other.chatId, chatId) || other.chatId == chatId) &&
            (identical(other.content, content) || other.content == content));
  }

  @override
  int get hashCode => Object.hash(runtimeType, chatId, content);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventMessageSentImplCopyWith<_$ChatEventMessageSentImpl>
      get copyWith =>
          __$$ChatEventMessageSentImplCopyWithImpl<_$ChatEventMessageSentImpl>(
              this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return messageSent(chatId, content);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return messageSent?.call(chatId, content);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (messageSent != null) {
      return messageSent(chatId, content);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return messageSent(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return messageSent?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (messageSent != null) {
      return messageSent(this);
    }
    return orElse();
  }
}

abstract class ChatEventMessageSent implements ChatEvent {
  const factory ChatEventMessageSent(
      final String chatId, final String content) = _$ChatEventMessageSentImpl;

  String get chatId;
  String get content;
  @JsonKey(ignore: true)
  _$$ChatEventMessageSentImplCopyWith<_$ChatEventMessageSentImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventFavoritesRequestedImplCopyWith<$Res> {
  factory _$$ChatEventFavoritesRequestedImplCopyWith(
          _$ChatEventFavoritesRequestedImpl value,
          $Res Function(_$ChatEventFavoritesRequestedImpl) then) =
      __$$ChatEventFavoritesRequestedImplCopyWithImpl<$Res>;
}

/// @nodoc
class __$$ChatEventFavoritesRequestedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventFavoritesRequestedImpl>
    implements _$$ChatEventFavoritesRequestedImplCopyWith<$Res> {
  __$$ChatEventFavoritesRequestedImplCopyWithImpl(
      _$ChatEventFavoritesRequestedImpl _value,
      $Res Function(_$ChatEventFavoritesRequestedImpl) _then)
      : super(_value, _then);
}

/// @nodoc

class _$ChatEventFavoritesRequestedImpl implements ChatEventFavoritesRequested {
  const _$ChatEventFavoritesRequestedImpl();

  @override
  String toString() {
    return 'ChatEvent.favoritesRequested()';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventFavoritesRequestedImpl);
  }

  @override
  int get hashCode => runtimeType.hashCode;

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return favoritesRequested();
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return favoritesRequested?.call();
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (favoritesRequested != null) {
      return favoritesRequested();
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return favoritesRequested(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return favoritesRequested?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (favoritesRequested != null) {
      return favoritesRequested(this);
    }
    return orElse();
  }
}

abstract class ChatEventFavoritesRequested implements ChatEvent {
  const factory ChatEventFavoritesRequested() =
      _$ChatEventFavoritesRequestedImpl;
}

/// @nodoc
abstract class _$$ChatEventTypingUpdatedImplCopyWith<$Res> {
  factory _$$ChatEventTypingUpdatedImplCopyWith(
          _$ChatEventTypingUpdatedImpl value,
          $Res Function(_$ChatEventTypingUpdatedImpl) then) =
      __$$ChatEventTypingUpdatedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String chatId, String userId, bool isTyping});
}

/// @nodoc
class __$$ChatEventTypingUpdatedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventTypingUpdatedImpl>
    implements _$$ChatEventTypingUpdatedImplCopyWith<$Res> {
  __$$ChatEventTypingUpdatedImplCopyWithImpl(
      _$ChatEventTypingUpdatedImpl _value,
      $Res Function(_$ChatEventTypingUpdatedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? chatId = null,
    Object? userId = null,
    Object? isTyping = null,
  }) {
    return _then(_$ChatEventTypingUpdatedImpl(
      null == chatId
          ? _value.chatId
          : chatId // ignore: cast_nullable_to_non_nullable
              as String,
      null == userId
          ? _value.userId
          : userId // ignore: cast_nullable_to_non_nullable
              as String,
      null == isTyping
          ? _value.isTyping
          : isTyping // ignore: cast_nullable_to_non_nullable
              as bool,
    ));
  }
}

/// @nodoc

class _$ChatEventTypingUpdatedImpl implements ChatEventTypingUpdated {
  const _$ChatEventTypingUpdatedImpl(this.chatId, this.userId, this.isTyping);

  @override
  final String chatId;
  @override
  final String userId;
  @override
  final bool isTyping;

  @override
  String toString() {
    return 'ChatEvent.typingUpdated(chatId: $chatId, userId: $userId, isTyping: $isTyping)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventTypingUpdatedImpl &&
            (identical(other.chatId, chatId) || other.chatId == chatId) &&
            (identical(other.userId, userId) || other.userId == userId) &&
            (identical(other.isTyping, isTyping) ||
                other.isTyping == isTyping));
  }

  @override
  int get hashCode => Object.hash(runtimeType, chatId, userId, isTyping);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventTypingUpdatedImplCopyWith<_$ChatEventTypingUpdatedImpl>
      get copyWith => __$$ChatEventTypingUpdatedImplCopyWithImpl<
          _$ChatEventTypingUpdatedImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return typingUpdated(chatId, userId, isTyping);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return typingUpdated?.call(chatId, userId, isTyping);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (typingUpdated != null) {
      return typingUpdated(chatId, userId, isTyping);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return typingUpdated(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return typingUpdated?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (typingUpdated != null) {
      return typingUpdated(this);
    }
    return orElse();
  }
}

abstract class ChatEventTypingUpdated implements ChatEvent {
  const factory ChatEventTypingUpdated(
          final String chatId, final String userId, final bool isTyping) =
      _$ChatEventTypingUpdatedImpl;

  String get chatId;
  String get userId;
  bool get isTyping;
  @JsonKey(ignore: true)
  _$$ChatEventTypingUpdatedImplCopyWith<_$ChatEventTypingUpdatedImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventUserStatusChangedImplCopyWith<$Res> {
  factory _$$ChatEventUserStatusChangedImplCopyWith(
          _$ChatEventUserStatusChangedImpl value,
          $Res Function(_$ChatEventUserStatusChangedImpl) then) =
      __$$ChatEventUserStatusChangedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String userId, bool isOnline, DateTime? lastSeen});
}

/// @nodoc
class __$$ChatEventUserStatusChangedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventUserStatusChangedImpl>
    implements _$$ChatEventUserStatusChangedImplCopyWith<$Res> {
  __$$ChatEventUserStatusChangedImplCopyWithImpl(
      _$ChatEventUserStatusChangedImpl _value,
      $Res Function(_$ChatEventUserStatusChangedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? userId = null,
    Object? isOnline = null,
    Object? lastSeen = freezed,
  }) {
    return _then(_$ChatEventUserStatusChangedImpl(
      null == userId
          ? _value.userId
          : userId // ignore: cast_nullable_to_non_nullable
              as String,
      null == isOnline
          ? _value.isOnline
          : isOnline // ignore: cast_nullable_to_non_nullable
              as bool,
      lastSeen: freezed == lastSeen
          ? _value.lastSeen
          : lastSeen // ignore: cast_nullable_to_non_nullable
              as DateTime?,
    ));
  }
}

/// @nodoc

class _$ChatEventUserStatusChangedImpl implements ChatEventUserStatusChanged {
  const _$ChatEventUserStatusChangedImpl(this.userId, this.isOnline,
      {this.lastSeen});

  @override
  final String userId;
  @override
  final bool isOnline;
  @override
  final DateTime? lastSeen;

  @override
  String toString() {
    return 'ChatEvent.userStatusChanged(userId: $userId, isOnline: $isOnline, lastSeen: $lastSeen)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventUserStatusChangedImpl &&
            (identical(other.userId, userId) || other.userId == userId) &&
            (identical(other.isOnline, isOnline) ||
                other.isOnline == isOnline) &&
            (identical(other.lastSeen, lastSeen) ||
                other.lastSeen == lastSeen));
  }

  @override
  int get hashCode => Object.hash(runtimeType, userId, isOnline, lastSeen);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventUserStatusChangedImplCopyWith<_$ChatEventUserStatusChangedImpl>
      get copyWith => __$$ChatEventUserStatusChangedImplCopyWithImpl<
          _$ChatEventUserStatusChangedImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return userStatusChanged(userId, isOnline, lastSeen);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return userStatusChanged?.call(userId, isOnline, lastSeen);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (userStatusChanged != null) {
      return userStatusChanged(userId, isOnline, lastSeen);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return userStatusChanged(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return userStatusChanged?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (userStatusChanged != null) {
      return userStatusChanged(this);
    }
    return orElse();
  }
}

abstract class ChatEventUserStatusChanged implements ChatEvent {
  const factory ChatEventUserStatusChanged(
      final String userId, final bool isOnline,
      {final DateTime? lastSeen}) = _$ChatEventUserStatusChangedImpl;

  String get userId;
  bool get isOnline;
  DateTime? get lastSeen;
  @JsonKey(ignore: true)
  _$$ChatEventUserStatusChangedImplCopyWith<_$ChatEventUserStatusChangedImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventRefreshPresenceImplCopyWith<$Res> {
  factory _$$ChatEventRefreshPresenceImplCopyWith(
          _$ChatEventRefreshPresenceImpl value,
          $Res Function(_$ChatEventRefreshPresenceImpl) then) =
      __$$ChatEventRefreshPresenceImplCopyWithImpl<$Res>;
}

/// @nodoc
class __$$ChatEventRefreshPresenceImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventRefreshPresenceImpl>
    implements _$$ChatEventRefreshPresenceImplCopyWith<$Res> {
  __$$ChatEventRefreshPresenceImplCopyWithImpl(
      _$ChatEventRefreshPresenceImpl _value,
      $Res Function(_$ChatEventRefreshPresenceImpl) _then)
      : super(_value, _then);
}

/// @nodoc

class _$ChatEventRefreshPresenceImpl implements ChatEventRefreshPresence {
  const _$ChatEventRefreshPresenceImpl();

  @override
  String toString() {
    return 'ChatEvent.refreshPresence()';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventRefreshPresenceImpl);
  }

  @override
  int get hashCode => runtimeType.hashCode;

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return refreshPresence();
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return refreshPresence?.call();
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (refreshPresence != null) {
      return refreshPresence();
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return refreshPresence(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return refreshPresence?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (refreshPresence != null) {
      return refreshPresence(this);
    }
    return orElse();
  }
}

abstract class ChatEventRefreshPresence implements ChatEvent {
  const factory ChatEventRefreshPresence() = _$ChatEventRefreshPresenceImpl;
}

/// @nodoc
abstract class _$$ChatEventSendTypingStatusImplCopyWith<$Res> {
  factory _$$ChatEventSendTypingStatusImplCopyWith(
          _$ChatEventSendTypingStatusImpl value,
          $Res Function(_$ChatEventSendTypingStatusImpl) then) =
      __$$ChatEventSendTypingStatusImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String chatId, bool isTyping});
}

/// @nodoc
class __$$ChatEventSendTypingStatusImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventSendTypingStatusImpl>
    implements _$$ChatEventSendTypingStatusImplCopyWith<$Res> {
  __$$ChatEventSendTypingStatusImplCopyWithImpl(
      _$ChatEventSendTypingStatusImpl _value,
      $Res Function(_$ChatEventSendTypingStatusImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? chatId = null,
    Object? isTyping = null,
  }) {
    return _then(_$ChatEventSendTypingStatusImpl(
      null == chatId
          ? _value.chatId
          : chatId // ignore: cast_nullable_to_non_nullable
              as String,
      null == isTyping
          ? _value.isTyping
          : isTyping // ignore: cast_nullable_to_non_nullable
              as bool,
    ));
  }
}

/// @nodoc

class _$ChatEventSendTypingStatusImpl implements ChatEventSendTypingStatus {
  const _$ChatEventSendTypingStatusImpl(this.chatId, this.isTyping);

  @override
  final String chatId;
  @override
  final bool isTyping;

  @override
  String toString() {
    return 'ChatEvent.sendTypingStatus(chatId: $chatId, isTyping: $isTyping)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventSendTypingStatusImpl &&
            (identical(other.chatId, chatId) || other.chatId == chatId) &&
            (identical(other.isTyping, isTyping) ||
                other.isTyping == isTyping));
  }

  @override
  int get hashCode => Object.hash(runtimeType, chatId, isTyping);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventSendTypingStatusImplCopyWith<_$ChatEventSendTypingStatusImpl>
      get copyWith => __$$ChatEventSendTypingStatusImplCopyWithImpl<
          _$ChatEventSendTypingStatusImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return sendTypingStatus(chatId, isTyping);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return sendTypingStatus?.call(chatId, isTyping);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (sendTypingStatus != null) {
      return sendTypingStatus(chatId, isTyping);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return sendTypingStatus(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return sendTypingStatus?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (sendTypingStatus != null) {
      return sendTypingStatus(this);
    }
    return orElse();
  }
}

abstract class ChatEventSendTypingStatus implements ChatEvent {
  const factory ChatEventSendTypingStatus(
          final String chatId, final bool isTyping) =
      _$ChatEventSendTypingStatusImpl;

  String get chatId;
  bool get isTyping;
  @JsonKey(ignore: true)
  _$$ChatEventSendTypingStatusImplCopyWith<_$ChatEventSendTypingStatusImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventMarkAsReadImplCopyWith<$Res> {
  factory _$$ChatEventMarkAsReadImplCopyWith(_$ChatEventMarkAsReadImpl value,
          $Res Function(_$ChatEventMarkAsReadImpl) then) =
      __$$ChatEventMarkAsReadImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String chatId, String messageId, int sequenceId});
}

/// @nodoc
class __$$ChatEventMarkAsReadImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventMarkAsReadImpl>
    implements _$$ChatEventMarkAsReadImplCopyWith<$Res> {
  __$$ChatEventMarkAsReadImplCopyWithImpl(_$ChatEventMarkAsReadImpl _value,
      $Res Function(_$ChatEventMarkAsReadImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? chatId = null,
    Object? messageId = null,
    Object? sequenceId = null,
  }) {
    return _then(_$ChatEventMarkAsReadImpl(
      null == chatId
          ? _value.chatId
          : chatId // ignore: cast_nullable_to_non_nullable
              as String,
      null == messageId
          ? _value.messageId
          : messageId // ignore: cast_nullable_to_non_nullable
              as String,
      null == sequenceId
          ? _value.sequenceId
          : sequenceId // ignore: cast_nullable_to_non_nullable
              as int,
    ));
  }
}

/// @nodoc

class _$ChatEventMarkAsReadImpl implements ChatEventMarkAsRead {
  const _$ChatEventMarkAsReadImpl(this.chatId, this.messageId, this.sequenceId);

  @override
  final String chatId;
  @override
  final String messageId;
  @override
  final int sequenceId;

  @override
  String toString() {
    return 'ChatEvent.markAsRead(chatId: $chatId, messageId: $messageId, sequenceId: $sequenceId)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventMarkAsReadImpl &&
            (identical(other.chatId, chatId) || other.chatId == chatId) &&
            (identical(other.messageId, messageId) ||
                other.messageId == messageId) &&
            (identical(other.sequenceId, sequenceId) ||
                other.sequenceId == sequenceId));
  }

  @override
  int get hashCode => Object.hash(runtimeType, chatId, messageId, sequenceId);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventMarkAsReadImplCopyWith<_$ChatEventMarkAsReadImpl> get copyWith =>
      __$$ChatEventMarkAsReadImplCopyWithImpl<_$ChatEventMarkAsReadImpl>(
          this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return markAsRead(chatId, messageId, sequenceId);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return markAsRead?.call(chatId, messageId, sequenceId);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (markAsRead != null) {
      return markAsRead(chatId, messageId, sequenceId);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return markAsRead(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return markAsRead?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (markAsRead != null) {
      return markAsRead(this);
    }
    return orElse();
  }
}

abstract class ChatEventMarkAsRead implements ChatEvent {
  const factory ChatEventMarkAsRead(
          final String chatId, final String messageId, final int sequenceId) =
      _$ChatEventMarkAsReadImpl;

  String get chatId;
  String get messageId;
  int get sequenceId;
  @JsonKey(ignore: true)
  _$$ChatEventMarkAsReadImplCopyWith<_$ChatEventMarkAsReadImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventReadReceiptReceivedImplCopyWith<$Res> {
  factory _$$ChatEventReadReceiptReceivedImplCopyWith(
          _$ChatEventReadReceiptReceivedImpl value,
          $Res Function(_$ChatEventReadReceiptReceivedImpl) then) =
      __$$ChatEventReadReceiptReceivedImplCopyWithImpl<$Res>;
  @useResult
  $Res call(
      {String chatId,
      String userId,
      String lastReadMessageId,
      int lastReadSequenceId});
}

/// @nodoc
class __$$ChatEventReadReceiptReceivedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventReadReceiptReceivedImpl>
    implements _$$ChatEventReadReceiptReceivedImplCopyWith<$Res> {
  __$$ChatEventReadReceiptReceivedImplCopyWithImpl(
      _$ChatEventReadReceiptReceivedImpl _value,
      $Res Function(_$ChatEventReadReceiptReceivedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? chatId = null,
    Object? userId = null,
    Object? lastReadMessageId = null,
    Object? lastReadSequenceId = null,
  }) {
    return _then(_$ChatEventReadReceiptReceivedImpl(
      chatId: null == chatId
          ? _value.chatId
          : chatId // ignore: cast_nullable_to_non_nullable
              as String,
      userId: null == userId
          ? _value.userId
          : userId // ignore: cast_nullable_to_non_nullable
              as String,
      lastReadMessageId: null == lastReadMessageId
          ? _value.lastReadMessageId
          : lastReadMessageId // ignore: cast_nullable_to_non_nullable
              as String,
      lastReadSequenceId: null == lastReadSequenceId
          ? _value.lastReadSequenceId
          : lastReadSequenceId // ignore: cast_nullable_to_non_nullable
              as int,
    ));
  }
}

/// @nodoc

class _$ChatEventReadReceiptReceivedImpl
    implements ChatEventReadReceiptReceived {
  const _$ChatEventReadReceiptReceivedImpl(
      {required this.chatId,
      required this.userId,
      required this.lastReadMessageId,
      required this.lastReadSequenceId});

  @override
  final String chatId;
  @override
  final String userId;
  @override
  final String lastReadMessageId;
  @override
  final int lastReadSequenceId;

  @override
  String toString() {
    return 'ChatEvent.readReceiptReceived(chatId: $chatId, userId: $userId, lastReadMessageId: $lastReadMessageId, lastReadSequenceId: $lastReadSequenceId)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventReadReceiptReceivedImpl &&
            (identical(other.chatId, chatId) || other.chatId == chatId) &&
            (identical(other.userId, userId) || other.userId == userId) &&
            (identical(other.lastReadMessageId, lastReadMessageId) ||
                other.lastReadMessageId == lastReadMessageId) &&
            (identical(other.lastReadSequenceId, lastReadSequenceId) ||
                other.lastReadSequenceId == lastReadSequenceId));
  }

  @override
  int get hashCode => Object.hash(
      runtimeType, chatId, userId, lastReadMessageId, lastReadSequenceId);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventReadReceiptReceivedImplCopyWith<
          _$ChatEventReadReceiptReceivedImpl>
      get copyWith => __$$ChatEventReadReceiptReceivedImplCopyWithImpl<
          _$ChatEventReadReceiptReceivedImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return readReceiptReceived(
        chatId, userId, lastReadMessageId, lastReadSequenceId);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return readReceiptReceived?.call(
        chatId, userId, lastReadMessageId, lastReadSequenceId);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (readReceiptReceived != null) {
      return readReceiptReceived(
          chatId, userId, lastReadMessageId, lastReadSequenceId);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return readReceiptReceived(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return readReceiptReceived?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (readReceiptReceived != null) {
      return readReceiptReceived(this);
    }
    return orElse();
  }
}

abstract class ChatEventReadReceiptReceived implements ChatEvent {
  const factory ChatEventReadReceiptReceived(
          {required final String chatId,
          required final String userId,
          required final String lastReadMessageId,
          required final int lastReadSequenceId}) =
      _$ChatEventReadReceiptReceivedImpl;

  String get chatId;
  String get userId;
  String get lastReadMessageId;
  int get lastReadSequenceId;
  @JsonKey(ignore: true)
  _$$ChatEventReadReceiptReceivedImplCopyWith<
          _$ChatEventReadReceiptReceivedImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventMessageStatusUpdatedImplCopyWith<$Res> {
  factory _$$ChatEventMessageStatusUpdatedImplCopyWith(
          _$ChatEventMessageStatusUpdatedImpl value,
          $Res Function(_$ChatEventMessageStatusUpdatedImpl) then) =
      __$$ChatEventMessageStatusUpdatedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String messageId, MessageStatus status});
}

/// @nodoc
class __$$ChatEventMessageStatusUpdatedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventMessageStatusUpdatedImpl>
    implements _$$ChatEventMessageStatusUpdatedImplCopyWith<$Res> {
  __$$ChatEventMessageStatusUpdatedImplCopyWithImpl(
      _$ChatEventMessageStatusUpdatedImpl _value,
      $Res Function(_$ChatEventMessageStatusUpdatedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? messageId = null,
    Object? status = null,
  }) {
    return _then(_$ChatEventMessageStatusUpdatedImpl(
      null == messageId
          ? _value.messageId
          : messageId // ignore: cast_nullable_to_non_nullable
              as String,
      null == status
          ? _value.status
          : status // ignore: cast_nullable_to_non_nullable
              as MessageStatus,
    ));
  }
}

/// @nodoc

class _$ChatEventMessageStatusUpdatedImpl
    implements ChatEventMessageStatusUpdated {
  const _$ChatEventMessageStatusUpdatedImpl(this.messageId, this.status);

  @override
  final String messageId;
  @override
  final MessageStatus status;

  @override
  String toString() {
    return 'ChatEvent.messageStatusUpdated(messageId: $messageId, status: $status)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventMessageStatusUpdatedImpl &&
            (identical(other.messageId, messageId) ||
                other.messageId == messageId) &&
            (identical(other.status, status) || other.status == status));
  }

  @override
  int get hashCode => Object.hash(runtimeType, messageId, status);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventMessageStatusUpdatedImplCopyWith<
          _$ChatEventMessageStatusUpdatedImpl>
      get copyWith => __$$ChatEventMessageStatusUpdatedImplCopyWithImpl<
          _$ChatEventMessageStatusUpdatedImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return messageStatusUpdated(messageId, status);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return messageStatusUpdated?.call(messageId, status);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (messageStatusUpdated != null) {
      return messageStatusUpdated(messageId, status);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return messageStatusUpdated(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return messageStatusUpdated?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (messageStatusUpdated != null) {
      return messageStatusUpdated(this);
    }
    return orElse();
  }
}

abstract class ChatEventMessageStatusUpdated implements ChatEvent {
  const factory ChatEventMessageStatusUpdated(
          final String messageId, final MessageStatus status) =
      _$ChatEventMessageStatusUpdatedImpl;

  String get messageId;
  MessageStatus get status;
  @JsonKey(ignore: true)
  _$$ChatEventMessageStatusUpdatedImplCopyWith<
          _$ChatEventMessageStatusUpdatedImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventMessageReplacedImplCopyWith<$Res> {
  factory _$$ChatEventMessageReplacedImplCopyWith(
          _$ChatEventMessageReplacedImpl value,
          $Res Function(_$ChatEventMessageReplacedImpl) then) =
      __$$ChatEventMessageReplacedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String tempId, Message realMessage});

  $MessageCopyWith<$Res> get realMessage;
}

/// @nodoc
class __$$ChatEventMessageReplacedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventMessageReplacedImpl>
    implements _$$ChatEventMessageReplacedImplCopyWith<$Res> {
  __$$ChatEventMessageReplacedImplCopyWithImpl(
      _$ChatEventMessageReplacedImpl _value,
      $Res Function(_$ChatEventMessageReplacedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? tempId = null,
    Object? realMessage = null,
  }) {
    return _then(_$ChatEventMessageReplacedImpl(
      null == tempId
          ? _value.tempId
          : tempId // ignore: cast_nullable_to_non_nullable
              as String,
      null == realMessage
          ? _value.realMessage
          : realMessage // ignore: cast_nullable_to_non_nullable
              as Message,
    ));
  }

  @override
  @pragma('vm:prefer-inline')
  $MessageCopyWith<$Res> get realMessage {
    return $MessageCopyWith<$Res>(_value.realMessage, (value) {
      return _then(_value.copyWith(realMessage: value));
    });
  }
}

/// @nodoc

class _$ChatEventMessageReplacedImpl implements ChatEventMessageReplaced {
  const _$ChatEventMessageReplacedImpl(this.tempId, this.realMessage);

  @override
  final String tempId;
  @override
  final Message realMessage;

  @override
  String toString() {
    return 'ChatEvent.messageReplaced(tempId: $tempId, realMessage: $realMessage)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventMessageReplacedImpl &&
            (identical(other.tempId, tempId) || other.tempId == tempId) &&
            (identical(other.realMessage, realMessage) ||
                other.realMessage == realMessage));
  }

  @override
  int get hashCode => Object.hash(runtimeType, tempId, realMessage);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ChatEventMessageReplacedImplCopyWith<_$ChatEventMessageReplacedImpl>
      get copyWith => __$$ChatEventMessageReplacedImplCopyWithImpl<
          _$ChatEventMessageReplacedImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return messageReplaced(tempId, realMessage);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return messageReplaced?.call(tempId, realMessage);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (messageReplaced != null) {
      return messageReplaced(tempId, realMessage);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return messageReplaced(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return messageReplaced?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (messageReplaced != null) {
      return messageReplaced(this);
    }
    return orElse();
  }
}

abstract class ChatEventMessageReplaced implements ChatEvent {
  const factory ChatEventMessageReplaced(
          final String tempId, final Message realMessage) =
      _$ChatEventMessageReplacedImpl;

  String get tempId;
  Message get realMessage;
  @JsonKey(ignore: true)
  _$$ChatEventMessageReplacedImplCopyWith<_$ChatEventMessageReplacedImpl>
      get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatEventCacheClearedImplCopyWith<$Res> {
  factory _$$ChatEventCacheClearedImplCopyWith(
          _$ChatEventCacheClearedImpl value,
          $Res Function(_$ChatEventCacheClearedImpl) then) =
      __$$ChatEventCacheClearedImplCopyWithImpl<$Res>;
}

/// @nodoc
class __$$ChatEventCacheClearedImplCopyWithImpl<$Res>
    extends _$ChatEventCopyWithImpl<$Res, _$ChatEventCacheClearedImpl>
    implements _$$ChatEventCacheClearedImplCopyWith<$Res> {
  __$$ChatEventCacheClearedImplCopyWithImpl(_$ChatEventCacheClearedImpl _value,
      $Res Function(_$ChatEventCacheClearedImpl) _then)
      : super(_value, _then);
}

/// @nodoc

class _$ChatEventCacheClearedImpl implements ChatEventCacheCleared {
  const _$ChatEventCacheClearedImpl();

  @override
  String toString() {
    return 'ChatEvent.cacheCleared()';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatEventCacheClearedImpl);
  }

  @override
  int get hashCode => runtimeType.hashCode;

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? userId) started,
    required TResult Function(String? currentUserId) chatsLoaded,
    required TResult Function(String chatId) chatSelected,
    required TResult Function(String chatId, String? cursor) messagesRequested,
    required TResult Function(Message message) messageReceived,
    required TResult Function(String chatId, String content) messageSent,
    required TResult Function() favoritesRequested,
    required TResult Function(String chatId, String userId, bool isTyping)
        typingUpdated,
    required TResult Function(String userId, bool isOnline, DateTime? lastSeen)
        userStatusChanged,
    required TResult Function() refreshPresence,
    required TResult Function(String chatId, bool isTyping) sendTypingStatus,
    required TResult Function(String chatId, String messageId, int sequenceId)
        markAsRead,
    required TResult Function(String chatId, String userId,
            String lastReadMessageId, int lastReadSequenceId)
        readReceiptReceived,
    required TResult Function(String messageId, MessageStatus status)
        messageStatusUpdated,
    required TResult Function(String tempId, Message realMessage)
        messageReplaced,
    required TResult Function() cacheCleared,
  }) {
    return cacheCleared();
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? userId)? started,
    TResult? Function(String? currentUserId)? chatsLoaded,
    TResult? Function(String chatId)? chatSelected,
    TResult? Function(String chatId, String? cursor)? messagesRequested,
    TResult? Function(Message message)? messageReceived,
    TResult? Function(String chatId, String content)? messageSent,
    TResult? Function()? favoritesRequested,
    TResult? Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult? Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult? Function()? refreshPresence,
    TResult? Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult? Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult? Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult? Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult? Function(String tempId, Message realMessage)? messageReplaced,
    TResult? Function()? cacheCleared,
  }) {
    return cacheCleared?.call();
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? userId)? started,
    TResult Function(String? currentUserId)? chatsLoaded,
    TResult Function(String chatId)? chatSelected,
    TResult Function(String chatId, String? cursor)? messagesRequested,
    TResult Function(Message message)? messageReceived,
    TResult Function(String chatId, String content)? messageSent,
    TResult Function()? favoritesRequested,
    TResult Function(String chatId, String userId, bool isTyping)?
        typingUpdated,
    TResult Function(String userId, bool isOnline, DateTime? lastSeen)?
        userStatusChanged,
    TResult Function()? refreshPresence,
    TResult Function(String chatId, bool isTyping)? sendTypingStatus,
    TResult Function(String chatId, String messageId, int sequenceId)?
        markAsRead,
    TResult Function(String chatId, String userId, String lastReadMessageId,
            int lastReadSequenceId)?
        readReceiptReceived,
    TResult Function(String messageId, MessageStatus status)?
        messageStatusUpdated,
    TResult Function(String tempId, Message realMessage)? messageReplaced,
    TResult Function()? cacheCleared,
    required TResult orElse(),
  }) {
    if (cacheCleared != null) {
      return cacheCleared();
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatEventStarted value) started,
    required TResult Function(ChatEventChatsLoaded value) chatsLoaded,
    required TResult Function(ChatEventChatSelected value) chatSelected,
    required TResult Function(ChatEventMessagesRequested value)
        messagesRequested,
    required TResult Function(ChatEventMessageReceived value) messageReceived,
    required TResult Function(ChatEventMessageSent value) messageSent,
    required TResult Function(ChatEventFavoritesRequested value)
        favoritesRequested,
    required TResult Function(ChatEventTypingUpdated value) typingUpdated,
    required TResult Function(ChatEventUserStatusChanged value)
        userStatusChanged,
    required TResult Function(ChatEventRefreshPresence value) refreshPresence,
    required TResult Function(ChatEventSendTypingStatus value) sendTypingStatus,
    required TResult Function(ChatEventMarkAsRead value) markAsRead,
    required TResult Function(ChatEventReadReceiptReceived value)
        readReceiptReceived,
    required TResult Function(ChatEventMessageStatusUpdated value)
        messageStatusUpdated,
    required TResult Function(ChatEventMessageReplaced value) messageReplaced,
    required TResult Function(ChatEventCacheCleared value) cacheCleared,
  }) {
    return cacheCleared(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatEventStarted value)? started,
    TResult? Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult? Function(ChatEventChatSelected value)? chatSelected,
    TResult? Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult? Function(ChatEventMessageReceived value)? messageReceived,
    TResult? Function(ChatEventMessageSent value)? messageSent,
    TResult? Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult? Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult? Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult? Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult? Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult? Function(ChatEventMarkAsRead value)? markAsRead,
    TResult? Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult? Function(ChatEventMessageStatusUpdated value)?
        messageStatusUpdated,
    TResult? Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult? Function(ChatEventCacheCleared value)? cacheCleared,
  }) {
    return cacheCleared?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatEventStarted value)? started,
    TResult Function(ChatEventChatsLoaded value)? chatsLoaded,
    TResult Function(ChatEventChatSelected value)? chatSelected,
    TResult Function(ChatEventMessagesRequested value)? messagesRequested,
    TResult Function(ChatEventMessageReceived value)? messageReceived,
    TResult Function(ChatEventMessageSent value)? messageSent,
    TResult Function(ChatEventFavoritesRequested value)? favoritesRequested,
    TResult Function(ChatEventTypingUpdated value)? typingUpdated,
    TResult Function(ChatEventUserStatusChanged value)? userStatusChanged,
    TResult Function(ChatEventRefreshPresence value)? refreshPresence,
    TResult Function(ChatEventSendTypingStatus value)? sendTypingStatus,
    TResult Function(ChatEventMarkAsRead value)? markAsRead,
    TResult Function(ChatEventReadReceiptReceived value)? readReceiptReceived,
    TResult Function(ChatEventMessageStatusUpdated value)? messageStatusUpdated,
    TResult Function(ChatEventMessageReplaced value)? messageReplaced,
    TResult Function(ChatEventCacheCleared value)? cacheCleared,
    required TResult orElse(),
  }) {
    if (cacheCleared != null) {
      return cacheCleared(this);
    }
    return orElse();
  }
}

abstract class ChatEventCacheCleared implements ChatEvent {
  const factory ChatEventCacheCleared() = _$ChatEventCacheClearedImpl;
}
