// 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_state.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 _$ChatState {
  Map<String, Set<String>> get typingUsers =>
      throw _privateConstructorUsedError;
  DateTime? get lastUpdate => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        initial,
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        loading,
    required TResult Function(List<Chat> chats,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatsLoaded,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatSelected,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        messagesLoaded,
    required TResult Function(String message,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        error,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult? Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult? Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
    required TResult orElse(),
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatInitial value) initial,
    required TResult Function(ChatLoading value) loading,
    required TResult Function(_ChatsLoaded value) chatsLoaded,
    required TResult Function(_ChatSelected value) chatSelected,
    required TResult Function(_MessagesLoaded value) messagesLoaded,
    required TResult Function(ChatError value) error,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatInitial value)? initial,
    TResult? Function(ChatLoading value)? loading,
    TResult? Function(_ChatsLoaded value)? chatsLoaded,
    TResult? Function(_ChatSelected value)? chatSelected,
    TResult? Function(_MessagesLoaded value)? messagesLoaded,
    TResult? Function(ChatError value)? error,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatInitial value)? initial,
    TResult Function(ChatLoading value)? loading,
    TResult Function(_ChatsLoaded value)? chatsLoaded,
    TResult Function(_ChatSelected value)? chatSelected,
    TResult Function(_MessagesLoaded value)? messagesLoaded,
    TResult Function(ChatError value)? error,
    required TResult orElse(),
  }) =>
      throw _privateConstructorUsedError;

  @JsonKey(ignore: true)
  $ChatStateCopyWith<ChatState> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $ChatStateCopyWith<$Res> {
  factory $ChatStateCopyWith(ChatState value, $Res Function(ChatState) then) =
      _$ChatStateCopyWithImpl<$Res, ChatState>;
  @useResult
  $Res call({Map<String, Set<String>> typingUsers, DateTime? lastUpdate});
}

/// @nodoc
class _$ChatStateCopyWithImpl<$Res, $Val extends ChatState>
    implements $ChatStateCopyWith<$Res> {
  _$ChatStateCopyWithImpl(this._value, this._then);

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

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? typingUsers = null,
    Object? lastUpdate = freezed,
  }) {
    return _then(_value.copyWith(
      typingUsers: null == typingUsers
          ? _value.typingUsers
          : typingUsers // ignore: cast_nullable_to_non_nullable
              as Map<String, Set<String>>,
      lastUpdate: freezed == lastUpdate
          ? _value.lastUpdate
          : lastUpdate // ignore: cast_nullable_to_non_nullable
              as DateTime?,
    ) as $Val);
  }
}

/// @nodoc
abstract class _$$ChatInitialImplCopyWith<$Res>
    implements $ChatStateCopyWith<$Res> {
  factory _$$ChatInitialImplCopyWith(
          _$ChatInitialImpl value, $Res Function(_$ChatInitialImpl) then) =
      __$$ChatInitialImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({Map<String, Set<String>> typingUsers, DateTime? lastUpdate});
}

/// @nodoc
class __$$ChatInitialImplCopyWithImpl<$Res>
    extends _$ChatStateCopyWithImpl<$Res, _$ChatInitialImpl>
    implements _$$ChatInitialImplCopyWith<$Res> {
  __$$ChatInitialImplCopyWithImpl(
      _$ChatInitialImpl _value, $Res Function(_$ChatInitialImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? typingUsers = null,
    Object? lastUpdate = freezed,
  }) {
    return _then(_$ChatInitialImpl(
      typingUsers: null == typingUsers
          ? _value._typingUsers
          : typingUsers // ignore: cast_nullable_to_non_nullable
              as Map<String, Set<String>>,
      lastUpdate: freezed == lastUpdate
          ? _value.lastUpdate
          : lastUpdate // ignore: cast_nullable_to_non_nullable
              as DateTime?,
    ));
  }
}

/// @nodoc

class _$ChatInitialImpl implements ChatInitial {
  const _$ChatInitialImpl(
      {final Map<String, Set<String>> typingUsers = const {}, this.lastUpdate})
      : _typingUsers = typingUsers;

  final Map<String, Set<String>> _typingUsers;
  @override
  @JsonKey()
  Map<String, Set<String>> get typingUsers {
    if (_typingUsers is EqualUnmodifiableMapView) return _typingUsers;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableMapView(_typingUsers);
  }

  @override
  final DateTime? lastUpdate;

  @override
  String toString() {
    return 'ChatState.initial(typingUsers: $typingUsers, lastUpdate: $lastUpdate)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatInitialImpl &&
            const DeepCollectionEquality()
                .equals(other._typingUsers, _typingUsers) &&
            (identical(other.lastUpdate, lastUpdate) ||
                other.lastUpdate == lastUpdate));
  }

  @override
  int get hashCode => Object.hash(runtimeType,
      const DeepCollectionEquality().hash(_typingUsers), lastUpdate);

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

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        initial,
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        loading,
    required TResult Function(List<Chat> chats,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatsLoaded,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatSelected,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        messagesLoaded,
    required TResult Function(String message,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        error,
  }) {
    return initial(typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult? Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult? Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
  }) {
    return initial?.call(typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
    required TResult orElse(),
  }) {
    if (initial != null) {
      return initial(typingUsers, lastUpdate);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatInitial value) initial,
    required TResult Function(ChatLoading value) loading,
    required TResult Function(_ChatsLoaded value) chatsLoaded,
    required TResult Function(_ChatSelected value) chatSelected,
    required TResult Function(_MessagesLoaded value) messagesLoaded,
    required TResult Function(ChatError value) error,
  }) {
    return initial(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatInitial value)? initial,
    TResult? Function(ChatLoading value)? loading,
    TResult? Function(_ChatsLoaded value)? chatsLoaded,
    TResult? Function(_ChatSelected value)? chatSelected,
    TResult? Function(_MessagesLoaded value)? messagesLoaded,
    TResult? Function(ChatError value)? error,
  }) {
    return initial?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatInitial value)? initial,
    TResult Function(ChatLoading value)? loading,
    TResult Function(_ChatsLoaded value)? chatsLoaded,
    TResult Function(_ChatSelected value)? chatSelected,
    TResult Function(_MessagesLoaded value)? messagesLoaded,
    TResult Function(ChatError value)? error,
    required TResult orElse(),
  }) {
    if (initial != null) {
      return initial(this);
    }
    return orElse();
  }
}

abstract class ChatInitial implements ChatState {
  const factory ChatInitial(
      {final Map<String, Set<String>> typingUsers,
      final DateTime? lastUpdate}) = _$ChatInitialImpl;

  @override
  Map<String, Set<String>> get typingUsers;
  @override
  DateTime? get lastUpdate;
  @override
  @JsonKey(ignore: true)
  _$$ChatInitialImplCopyWith<_$ChatInitialImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatLoadingImplCopyWith<$Res>
    implements $ChatStateCopyWith<$Res> {
  factory _$$ChatLoadingImplCopyWith(
          _$ChatLoadingImpl value, $Res Function(_$ChatLoadingImpl) then) =
      __$$ChatLoadingImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({Map<String, Set<String>> typingUsers, DateTime? lastUpdate});
}

/// @nodoc
class __$$ChatLoadingImplCopyWithImpl<$Res>
    extends _$ChatStateCopyWithImpl<$Res, _$ChatLoadingImpl>
    implements _$$ChatLoadingImplCopyWith<$Res> {
  __$$ChatLoadingImplCopyWithImpl(
      _$ChatLoadingImpl _value, $Res Function(_$ChatLoadingImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? typingUsers = null,
    Object? lastUpdate = freezed,
  }) {
    return _then(_$ChatLoadingImpl(
      typingUsers: null == typingUsers
          ? _value._typingUsers
          : typingUsers // ignore: cast_nullable_to_non_nullable
              as Map<String, Set<String>>,
      lastUpdate: freezed == lastUpdate
          ? _value.lastUpdate
          : lastUpdate // ignore: cast_nullable_to_non_nullable
              as DateTime?,
    ));
  }
}

/// @nodoc

class _$ChatLoadingImpl implements ChatLoading {
  const _$ChatLoadingImpl(
      {final Map<String, Set<String>> typingUsers = const {}, this.lastUpdate})
      : _typingUsers = typingUsers;

  final Map<String, Set<String>> _typingUsers;
  @override
  @JsonKey()
  Map<String, Set<String>> get typingUsers {
    if (_typingUsers is EqualUnmodifiableMapView) return _typingUsers;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableMapView(_typingUsers);
  }

  @override
  final DateTime? lastUpdate;

  @override
  String toString() {
    return 'ChatState.loading(typingUsers: $typingUsers, lastUpdate: $lastUpdate)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatLoadingImpl &&
            const DeepCollectionEquality()
                .equals(other._typingUsers, _typingUsers) &&
            (identical(other.lastUpdate, lastUpdate) ||
                other.lastUpdate == lastUpdate));
  }

  @override
  int get hashCode => Object.hash(runtimeType,
      const DeepCollectionEquality().hash(_typingUsers), lastUpdate);

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

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        initial,
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        loading,
    required TResult Function(List<Chat> chats,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatsLoaded,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatSelected,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        messagesLoaded,
    required TResult Function(String message,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        error,
  }) {
    return loading(typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult? Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult? Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
  }) {
    return loading?.call(typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
    required TResult orElse(),
  }) {
    if (loading != null) {
      return loading(typingUsers, lastUpdate);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatInitial value) initial,
    required TResult Function(ChatLoading value) loading,
    required TResult Function(_ChatsLoaded value) chatsLoaded,
    required TResult Function(_ChatSelected value) chatSelected,
    required TResult Function(_MessagesLoaded value) messagesLoaded,
    required TResult Function(ChatError value) error,
  }) {
    return loading(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatInitial value)? initial,
    TResult? Function(ChatLoading value)? loading,
    TResult? Function(_ChatsLoaded value)? chatsLoaded,
    TResult? Function(_ChatSelected value)? chatSelected,
    TResult? Function(_MessagesLoaded value)? messagesLoaded,
    TResult? Function(ChatError value)? error,
  }) {
    return loading?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatInitial value)? initial,
    TResult Function(ChatLoading value)? loading,
    TResult Function(_ChatsLoaded value)? chatsLoaded,
    TResult Function(_ChatSelected value)? chatSelected,
    TResult Function(_MessagesLoaded value)? messagesLoaded,
    TResult Function(ChatError value)? error,
    required TResult orElse(),
  }) {
    if (loading != null) {
      return loading(this);
    }
    return orElse();
  }
}

abstract class ChatLoading implements ChatState {
  const factory ChatLoading(
      {final Map<String, Set<String>> typingUsers,
      final DateTime? lastUpdate}) = _$ChatLoadingImpl;

  @override
  Map<String, Set<String>> get typingUsers;
  @override
  DateTime? get lastUpdate;
  @override
  @JsonKey(ignore: true)
  _$$ChatLoadingImplCopyWith<_$ChatLoadingImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatsLoadedImplCopyWith<$Res>
    implements $ChatStateCopyWith<$Res> {
  factory _$$ChatsLoadedImplCopyWith(
          _$ChatsLoadedImpl value, $Res Function(_$ChatsLoadedImpl) then) =
      __$$ChatsLoadedImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call(
      {List<Chat> chats,
      Map<String, Set<String>> typingUsers,
      DateTime? lastUpdate});
}

/// @nodoc
class __$$ChatsLoadedImplCopyWithImpl<$Res>
    extends _$ChatStateCopyWithImpl<$Res, _$ChatsLoadedImpl>
    implements _$$ChatsLoadedImplCopyWith<$Res> {
  __$$ChatsLoadedImplCopyWithImpl(
      _$ChatsLoadedImpl _value, $Res Function(_$ChatsLoadedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? chats = null,
    Object? typingUsers = null,
    Object? lastUpdate = freezed,
  }) {
    return _then(_$ChatsLoadedImpl(
      null == chats
          ? _value._chats
          : chats // ignore: cast_nullable_to_non_nullable
              as List<Chat>,
      typingUsers: null == typingUsers
          ? _value._typingUsers
          : typingUsers // ignore: cast_nullable_to_non_nullable
              as Map<String, Set<String>>,
      lastUpdate: freezed == lastUpdate
          ? _value.lastUpdate
          : lastUpdate // ignore: cast_nullable_to_non_nullable
              as DateTime?,
    ));
  }
}

/// @nodoc

class _$ChatsLoadedImpl implements _ChatsLoaded {
  const _$ChatsLoadedImpl(final List<Chat> chats,
      {final Map<String, Set<String>> typingUsers = const {}, this.lastUpdate})
      : _chats = chats,
        _typingUsers = typingUsers;

  final List<Chat> _chats;
  @override
  List<Chat> get chats {
    if (_chats is EqualUnmodifiableListView) return _chats;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_chats);
  }

  final Map<String, Set<String>> _typingUsers;
  @override
  @JsonKey()
  Map<String, Set<String>> get typingUsers {
    if (_typingUsers is EqualUnmodifiableMapView) return _typingUsers;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableMapView(_typingUsers);
  }

  @override
  final DateTime? lastUpdate;

  @override
  String toString() {
    return 'ChatState.chatsLoaded(chats: $chats, typingUsers: $typingUsers, lastUpdate: $lastUpdate)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatsLoadedImpl &&
            const DeepCollectionEquality().equals(other._chats, _chats) &&
            const DeepCollectionEquality()
                .equals(other._typingUsers, _typingUsers) &&
            (identical(other.lastUpdate, lastUpdate) ||
                other.lastUpdate == lastUpdate));
  }

  @override
  int get hashCode => Object.hash(
      runtimeType,
      const DeepCollectionEquality().hash(_chats),
      const DeepCollectionEquality().hash(_typingUsers),
      lastUpdate);

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

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        initial,
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        loading,
    required TResult Function(List<Chat> chats,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatsLoaded,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatSelected,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        messagesLoaded,
    required TResult Function(String message,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        error,
  }) {
    return chatsLoaded(chats, typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult? Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult? Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
  }) {
    return chatsLoaded?.call(chats, typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
    required TResult orElse(),
  }) {
    if (chatsLoaded != null) {
      return chatsLoaded(chats, typingUsers, lastUpdate);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatInitial value) initial,
    required TResult Function(ChatLoading value) loading,
    required TResult Function(_ChatsLoaded value) chatsLoaded,
    required TResult Function(_ChatSelected value) chatSelected,
    required TResult Function(_MessagesLoaded value) messagesLoaded,
    required TResult Function(ChatError value) error,
  }) {
    return chatsLoaded(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatInitial value)? initial,
    TResult? Function(ChatLoading value)? loading,
    TResult? Function(_ChatsLoaded value)? chatsLoaded,
    TResult? Function(_ChatSelected value)? chatSelected,
    TResult? Function(_MessagesLoaded value)? messagesLoaded,
    TResult? Function(ChatError value)? error,
  }) {
    return chatsLoaded?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatInitial value)? initial,
    TResult Function(ChatLoading value)? loading,
    TResult Function(_ChatsLoaded value)? chatsLoaded,
    TResult Function(_ChatSelected value)? chatSelected,
    TResult Function(_MessagesLoaded value)? messagesLoaded,
    TResult Function(ChatError value)? error,
    required TResult orElse(),
  }) {
    if (chatsLoaded != null) {
      return chatsLoaded(this);
    }
    return orElse();
  }
}

abstract class _ChatsLoaded implements ChatState {
  const factory _ChatsLoaded(final List<Chat> chats,
      {final Map<String, Set<String>> typingUsers,
      final DateTime? lastUpdate}) = _$ChatsLoadedImpl;

  List<Chat> get chats;
  @override
  Map<String, Set<String>> get typingUsers;
  @override
  DateTime? get lastUpdate;
  @override
  @JsonKey(ignore: true)
  _$$ChatsLoadedImplCopyWith<_$ChatsLoadedImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatSelectedImplCopyWith<$Res>
    implements $ChatStateCopyWith<$Res> {
  factory _$$ChatSelectedImplCopyWith(
          _$ChatSelectedImpl value, $Res Function(_$ChatSelectedImpl) then) =
      __$$ChatSelectedImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call(
      {Chat chat,
      List<Message> messages,
      Map<String, Set<String>> typingUsers,
      DateTime? lastUpdate});

  $ChatCopyWith<$Res> get chat;
}

/// @nodoc
class __$$ChatSelectedImplCopyWithImpl<$Res>
    extends _$ChatStateCopyWithImpl<$Res, _$ChatSelectedImpl>
    implements _$$ChatSelectedImplCopyWith<$Res> {
  __$$ChatSelectedImplCopyWithImpl(
      _$ChatSelectedImpl _value, $Res Function(_$ChatSelectedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? chat = null,
    Object? messages = null,
    Object? typingUsers = null,
    Object? lastUpdate = freezed,
  }) {
    return _then(_$ChatSelectedImpl(
      null == chat
          ? _value.chat
          : chat // ignore: cast_nullable_to_non_nullable
              as Chat,
      null == messages
          ? _value._messages
          : messages // ignore: cast_nullable_to_non_nullable
              as List<Message>,
      typingUsers: null == typingUsers
          ? _value._typingUsers
          : typingUsers // ignore: cast_nullable_to_non_nullable
              as Map<String, Set<String>>,
      lastUpdate: freezed == lastUpdate
          ? _value.lastUpdate
          : lastUpdate // ignore: cast_nullable_to_non_nullable
              as DateTime?,
    ));
  }

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

/// @nodoc

class _$ChatSelectedImpl implements _ChatSelected {
  const _$ChatSelectedImpl(this.chat, final List<Message> messages,
      {final Map<String, Set<String>> typingUsers = const {}, this.lastUpdate})
      : _messages = messages,
        _typingUsers = typingUsers;

  @override
  final Chat chat;
  final List<Message> _messages;
  @override
  List<Message> get messages {
    if (_messages is EqualUnmodifiableListView) return _messages;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_messages);
  }

  final Map<String, Set<String>> _typingUsers;
  @override
  @JsonKey()
  Map<String, Set<String>> get typingUsers {
    if (_typingUsers is EqualUnmodifiableMapView) return _typingUsers;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableMapView(_typingUsers);
  }

  @override
  final DateTime? lastUpdate;

  @override
  String toString() {
    return 'ChatState.chatSelected(chat: $chat, messages: $messages, typingUsers: $typingUsers, lastUpdate: $lastUpdate)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatSelectedImpl &&
            (identical(other.chat, chat) || other.chat == chat) &&
            const DeepCollectionEquality().equals(other._messages, _messages) &&
            const DeepCollectionEquality()
                .equals(other._typingUsers, _typingUsers) &&
            (identical(other.lastUpdate, lastUpdate) ||
                other.lastUpdate == lastUpdate));
  }

  @override
  int get hashCode => Object.hash(
      runtimeType,
      chat,
      const DeepCollectionEquality().hash(_messages),
      const DeepCollectionEquality().hash(_typingUsers),
      lastUpdate);

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

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        initial,
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        loading,
    required TResult Function(List<Chat> chats,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatsLoaded,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatSelected,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        messagesLoaded,
    required TResult Function(String message,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        error,
  }) {
    return chatSelected(chat, messages, typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult? Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult? Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
  }) {
    return chatSelected?.call(chat, messages, typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
    required TResult orElse(),
  }) {
    if (chatSelected != null) {
      return chatSelected(chat, messages, typingUsers, lastUpdate);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatInitial value) initial,
    required TResult Function(ChatLoading value) loading,
    required TResult Function(_ChatsLoaded value) chatsLoaded,
    required TResult Function(_ChatSelected value) chatSelected,
    required TResult Function(_MessagesLoaded value) messagesLoaded,
    required TResult Function(ChatError value) error,
  }) {
    return chatSelected(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatInitial value)? initial,
    TResult? Function(ChatLoading value)? loading,
    TResult? Function(_ChatsLoaded value)? chatsLoaded,
    TResult? Function(_ChatSelected value)? chatSelected,
    TResult? Function(_MessagesLoaded value)? messagesLoaded,
    TResult? Function(ChatError value)? error,
  }) {
    return chatSelected?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatInitial value)? initial,
    TResult Function(ChatLoading value)? loading,
    TResult Function(_ChatsLoaded value)? chatsLoaded,
    TResult Function(_ChatSelected value)? chatSelected,
    TResult Function(_MessagesLoaded value)? messagesLoaded,
    TResult Function(ChatError value)? error,
    required TResult orElse(),
  }) {
    if (chatSelected != null) {
      return chatSelected(this);
    }
    return orElse();
  }
}

abstract class _ChatSelected implements ChatState {
  const factory _ChatSelected(final Chat chat, final List<Message> messages,
      {final Map<String, Set<String>> typingUsers,
      final DateTime? lastUpdate}) = _$ChatSelectedImpl;

  Chat get chat;
  List<Message> get messages;
  @override
  Map<String, Set<String>> get typingUsers;
  @override
  DateTime? get lastUpdate;
  @override
  @JsonKey(ignore: true)
  _$$ChatSelectedImplCopyWith<_$ChatSelectedImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$MessagesLoadedImplCopyWith<$Res>
    implements $ChatStateCopyWith<$Res> {
  factory _$$MessagesLoadedImplCopyWith(_$MessagesLoadedImpl value,
          $Res Function(_$MessagesLoadedImpl) then) =
      __$$MessagesLoadedImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call(
      {Chat chat,
      List<Message> messages,
      Map<String, Set<String>> typingUsers,
      DateTime? lastUpdate});

  $ChatCopyWith<$Res> get chat;
}

/// @nodoc
class __$$MessagesLoadedImplCopyWithImpl<$Res>
    extends _$ChatStateCopyWithImpl<$Res, _$MessagesLoadedImpl>
    implements _$$MessagesLoadedImplCopyWith<$Res> {
  __$$MessagesLoadedImplCopyWithImpl(
      _$MessagesLoadedImpl _value, $Res Function(_$MessagesLoadedImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? chat = null,
    Object? messages = null,
    Object? typingUsers = null,
    Object? lastUpdate = freezed,
  }) {
    return _then(_$MessagesLoadedImpl(
      null == chat
          ? _value.chat
          : chat // ignore: cast_nullable_to_non_nullable
              as Chat,
      null == messages
          ? _value._messages
          : messages // ignore: cast_nullable_to_non_nullable
              as List<Message>,
      typingUsers: null == typingUsers
          ? _value._typingUsers
          : typingUsers // ignore: cast_nullable_to_non_nullable
              as Map<String, Set<String>>,
      lastUpdate: freezed == lastUpdate
          ? _value.lastUpdate
          : lastUpdate // ignore: cast_nullable_to_non_nullable
              as DateTime?,
    ));
  }

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

/// @nodoc

class _$MessagesLoadedImpl implements _MessagesLoaded {
  const _$MessagesLoadedImpl(this.chat, final List<Message> messages,
      {final Map<String, Set<String>> typingUsers = const {}, this.lastUpdate})
      : _messages = messages,
        _typingUsers = typingUsers;

  @override
  final Chat chat;
  final List<Message> _messages;
  @override
  List<Message> get messages {
    if (_messages is EqualUnmodifiableListView) return _messages;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_messages);
  }

  final Map<String, Set<String>> _typingUsers;
  @override
  @JsonKey()
  Map<String, Set<String>> get typingUsers {
    if (_typingUsers is EqualUnmodifiableMapView) return _typingUsers;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableMapView(_typingUsers);
  }

  @override
  final DateTime? lastUpdate;

  @override
  String toString() {
    return 'ChatState.messagesLoaded(chat: $chat, messages: $messages, typingUsers: $typingUsers, lastUpdate: $lastUpdate)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$MessagesLoadedImpl &&
            (identical(other.chat, chat) || other.chat == chat) &&
            const DeepCollectionEquality().equals(other._messages, _messages) &&
            const DeepCollectionEquality()
                .equals(other._typingUsers, _typingUsers) &&
            (identical(other.lastUpdate, lastUpdate) ||
                other.lastUpdate == lastUpdate));
  }

  @override
  int get hashCode => Object.hash(
      runtimeType,
      chat,
      const DeepCollectionEquality().hash(_messages),
      const DeepCollectionEquality().hash(_typingUsers),
      lastUpdate);

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

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        initial,
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        loading,
    required TResult Function(List<Chat> chats,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatsLoaded,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatSelected,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        messagesLoaded,
    required TResult Function(String message,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        error,
  }) {
    return messagesLoaded(chat, messages, typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult? Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult? Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
  }) {
    return messagesLoaded?.call(chat, messages, typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
    required TResult orElse(),
  }) {
    if (messagesLoaded != null) {
      return messagesLoaded(chat, messages, typingUsers, lastUpdate);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatInitial value) initial,
    required TResult Function(ChatLoading value) loading,
    required TResult Function(_ChatsLoaded value) chatsLoaded,
    required TResult Function(_ChatSelected value) chatSelected,
    required TResult Function(_MessagesLoaded value) messagesLoaded,
    required TResult Function(ChatError value) error,
  }) {
    return messagesLoaded(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatInitial value)? initial,
    TResult? Function(ChatLoading value)? loading,
    TResult? Function(_ChatsLoaded value)? chatsLoaded,
    TResult? Function(_ChatSelected value)? chatSelected,
    TResult? Function(_MessagesLoaded value)? messagesLoaded,
    TResult? Function(ChatError value)? error,
  }) {
    return messagesLoaded?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatInitial value)? initial,
    TResult Function(ChatLoading value)? loading,
    TResult Function(_ChatsLoaded value)? chatsLoaded,
    TResult Function(_ChatSelected value)? chatSelected,
    TResult Function(_MessagesLoaded value)? messagesLoaded,
    TResult Function(ChatError value)? error,
    required TResult orElse(),
  }) {
    if (messagesLoaded != null) {
      return messagesLoaded(this);
    }
    return orElse();
  }
}

abstract class _MessagesLoaded implements ChatState {
  const factory _MessagesLoaded(final Chat chat, final List<Message> messages,
      {final Map<String, Set<String>> typingUsers,
      final DateTime? lastUpdate}) = _$MessagesLoadedImpl;

  Chat get chat;
  List<Message> get messages;
  @override
  Map<String, Set<String>> get typingUsers;
  @override
  DateTime? get lastUpdate;
  @override
  @JsonKey(ignore: true)
  _$$MessagesLoadedImplCopyWith<_$MessagesLoadedImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ChatErrorImplCopyWith<$Res>
    implements $ChatStateCopyWith<$Res> {
  factory _$$ChatErrorImplCopyWith(
          _$ChatErrorImpl value, $Res Function(_$ChatErrorImpl) then) =
      __$$ChatErrorImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call(
      {String message,
      Map<String, Set<String>> typingUsers,
      DateTime? lastUpdate});
}

/// @nodoc
class __$$ChatErrorImplCopyWithImpl<$Res>
    extends _$ChatStateCopyWithImpl<$Res, _$ChatErrorImpl>
    implements _$$ChatErrorImplCopyWith<$Res> {
  __$$ChatErrorImplCopyWithImpl(
      _$ChatErrorImpl _value, $Res Function(_$ChatErrorImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = null,
    Object? typingUsers = null,
    Object? lastUpdate = freezed,
  }) {
    return _then(_$ChatErrorImpl(
      null == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String,
      typingUsers: null == typingUsers
          ? _value._typingUsers
          : typingUsers // ignore: cast_nullable_to_non_nullable
              as Map<String, Set<String>>,
      lastUpdate: freezed == lastUpdate
          ? _value.lastUpdate
          : lastUpdate // ignore: cast_nullable_to_non_nullable
              as DateTime?,
    ));
  }
}

/// @nodoc

class _$ChatErrorImpl implements ChatError {
  const _$ChatErrorImpl(this.message,
      {final Map<String, Set<String>> typingUsers = const {}, this.lastUpdate})
      : _typingUsers = typingUsers;

  @override
  final String message;
  final Map<String, Set<String>> _typingUsers;
  @override
  @JsonKey()
  Map<String, Set<String>> get typingUsers {
    if (_typingUsers is EqualUnmodifiableMapView) return _typingUsers;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableMapView(_typingUsers);
  }

  @override
  final DateTime? lastUpdate;

  @override
  String toString() {
    return 'ChatState.error(message: $message, typingUsers: $typingUsers, lastUpdate: $lastUpdate)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ChatErrorImpl &&
            (identical(other.message, message) || other.message == message) &&
            const DeepCollectionEquality()
                .equals(other._typingUsers, _typingUsers) &&
            (identical(other.lastUpdate, lastUpdate) ||
                other.lastUpdate == lastUpdate));
  }

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

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

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        initial,
    required TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        loading,
    required TResult Function(List<Chat> chats,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatsLoaded,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        chatSelected,
    required TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        messagesLoaded,
    required TResult Function(String message,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)
        error,
  }) {
    return error(message, typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult? Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult? Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult? Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult? Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
  }) {
    return error?.call(message, typingUsers, lastUpdate);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        initial,
    TResult Function(
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        loading,
    TResult Function(List<Chat> chats, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        chatsLoaded,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        chatSelected,
    TResult Function(Chat chat, List<Message> messages,
            Map<String, Set<String>> typingUsers, DateTime? lastUpdate)?
        messagesLoaded,
    TResult Function(String message, Map<String, Set<String>> typingUsers,
            DateTime? lastUpdate)?
        error,
    required TResult orElse(),
  }) {
    if (error != null) {
      return error(message, typingUsers, lastUpdate);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(ChatInitial value) initial,
    required TResult Function(ChatLoading value) loading,
    required TResult Function(_ChatsLoaded value) chatsLoaded,
    required TResult Function(_ChatSelected value) chatSelected,
    required TResult Function(_MessagesLoaded value) messagesLoaded,
    required TResult Function(ChatError value) error,
  }) {
    return error(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(ChatInitial value)? initial,
    TResult? Function(ChatLoading value)? loading,
    TResult? Function(_ChatsLoaded value)? chatsLoaded,
    TResult? Function(_ChatSelected value)? chatSelected,
    TResult? Function(_MessagesLoaded value)? messagesLoaded,
    TResult? Function(ChatError value)? error,
  }) {
    return error?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(ChatInitial value)? initial,
    TResult Function(ChatLoading value)? loading,
    TResult Function(_ChatsLoaded value)? chatsLoaded,
    TResult Function(_ChatSelected value)? chatSelected,
    TResult Function(_MessagesLoaded value)? messagesLoaded,
    TResult Function(ChatError value)? error,
    required TResult orElse(),
  }) {
    if (error != null) {
      return error(this);
    }
    return orElse();
  }
}

abstract class ChatError implements ChatState {
  const factory ChatError(final String message,
      {final Map<String, Set<String>> typingUsers,
      final DateTime? lastUpdate}) = _$ChatErrorImpl;

  String get message;
  @override
  Map<String, Set<String>> get typingUsers;
  @override
  DateTime? get lastUpdate;
  @override
  @JsonKey(ignore: true)
  _$$ChatErrorImplCopyWith<_$ChatErrorImpl> get copyWith =>
      throw _privateConstructorUsedError;
}
