// 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 'payment_form_bloc.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 _$PaymentFormEvent {
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) setOrder,
    required TResult Function(PaymentMethod paymentMethod) setPaymentMethod,
    required TResult Function() submitted,
    required TResult Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )
    submittedSplitBill,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? setOrder,
    TResult? Function(PaymentMethod paymentMethod)? setPaymentMethod,
    TResult? Function()? submitted,
    TResult? Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )?
    submittedSplitBill,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? setOrder,
    TResult Function(PaymentMethod paymentMethod)? setPaymentMethod,
    TResult Function()? submitted,
    TResult Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )?
    submittedSplitBill,
    required TResult orElse(),
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_SetOrder value) setOrder,
    required TResult Function(_SetPayment value) setPaymentMethod,
    required TResult Function(_Submitted value) submitted,
    required TResult Function(_SubmittedSplitBill value) submittedSplitBill,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_SetOrder value)? setOrder,
    TResult? Function(_SetPayment value)? setPaymentMethod,
    TResult? Function(_Submitted value)? submitted,
    TResult? Function(_SubmittedSplitBill value)? submittedSplitBill,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_SetOrder value)? setOrder,
    TResult Function(_SetPayment value)? setPaymentMethod,
    TResult Function(_Submitted value)? submitted,
    TResult Function(_SubmittedSplitBill value)? submittedSplitBill,
    required TResult orElse(),
  }) => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $PaymentFormEventCopyWith<$Res> {
  factory $PaymentFormEventCopyWith(
    PaymentFormEvent value,
    $Res Function(PaymentFormEvent) then,
  ) = _$PaymentFormEventCopyWithImpl<$Res, PaymentFormEvent>;
}

/// @nodoc
class _$PaymentFormEventCopyWithImpl<$Res, $Val extends PaymentFormEvent>
    implements $PaymentFormEventCopyWith<$Res> {
  _$PaymentFormEventCopyWithImpl(this._value, this._then);

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

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc
abstract class _$$SetOrderImplCopyWith<$Res> {
  factory _$$SetOrderImplCopyWith(
    _$SetOrderImpl value,
    $Res Function(_$SetOrderImpl) then,
  ) = __$$SetOrderImplCopyWithImpl<$Res>;
  @useResult
  $Res call({Order order});

  $OrderCopyWith<$Res> get order;
}

/// @nodoc
class __$$SetOrderImplCopyWithImpl<$Res>
    extends _$PaymentFormEventCopyWithImpl<$Res, _$SetOrderImpl>
    implements _$$SetOrderImplCopyWith<$Res> {
  __$$SetOrderImplCopyWithImpl(
    _$SetOrderImpl _value,
    $Res Function(_$SetOrderImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({Object? order = null}) {
    return _then(
      _$SetOrderImpl(
        null == order
            ? _value.order
            : order // ignore: cast_nullable_to_non_nullable
                  as Order,
      ),
    );
  }

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @override
  @pragma('vm:prefer-inline')
  $OrderCopyWith<$Res> get order {
    return $OrderCopyWith<$Res>(_value.order, (value) {
      return _then(_value.copyWith(order: value));
    });
  }
}

/// @nodoc

class _$SetOrderImpl implements _SetOrder {
  const _$SetOrderImpl(this.order);

  @override
  final Order order;

  @override
  String toString() {
    return 'PaymentFormEvent.setOrder(order: $order)';
  }

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

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

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$SetOrderImplCopyWith<_$SetOrderImpl> get copyWith =>
      __$$SetOrderImplCopyWithImpl<_$SetOrderImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) setOrder,
    required TResult Function(PaymentMethod paymentMethod) setPaymentMethod,
    required TResult Function() submitted,
    required TResult Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )
    submittedSplitBill,
  }) {
    return setOrder(order);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? setOrder,
    TResult? Function(PaymentMethod paymentMethod)? setPaymentMethod,
    TResult? Function()? submitted,
    TResult? Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )?
    submittedSplitBill,
  }) {
    return setOrder?.call(order);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? setOrder,
    TResult Function(PaymentMethod paymentMethod)? setPaymentMethod,
    TResult Function()? submitted,
    TResult Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )?
    submittedSplitBill,
    required TResult orElse(),
  }) {
    if (setOrder != null) {
      return setOrder(order);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_SetOrder value) setOrder,
    required TResult Function(_SetPayment value) setPaymentMethod,
    required TResult Function(_Submitted value) submitted,
    required TResult Function(_SubmittedSplitBill value) submittedSplitBill,
  }) {
    return setOrder(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_SetOrder value)? setOrder,
    TResult? Function(_SetPayment value)? setPaymentMethod,
    TResult? Function(_Submitted value)? submitted,
    TResult? Function(_SubmittedSplitBill value)? submittedSplitBill,
  }) {
    return setOrder?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_SetOrder value)? setOrder,
    TResult Function(_SetPayment value)? setPaymentMethod,
    TResult Function(_Submitted value)? submitted,
    TResult Function(_SubmittedSplitBill value)? submittedSplitBill,
    required TResult orElse(),
  }) {
    if (setOrder != null) {
      return setOrder(this);
    }
    return orElse();
  }
}

abstract class _SetOrder implements PaymentFormEvent {
  const factory _SetOrder(final Order order) = _$SetOrderImpl;

  Order get order;

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$SetOrderImplCopyWith<_$SetOrderImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$SetPaymentImplCopyWith<$Res> {
  factory _$$SetPaymentImplCopyWith(
    _$SetPaymentImpl value,
    $Res Function(_$SetPaymentImpl) then,
  ) = __$$SetPaymentImplCopyWithImpl<$Res>;
  @useResult
  $Res call({PaymentMethod paymentMethod});

  $PaymentMethodCopyWith<$Res> get paymentMethod;
}

/// @nodoc
class __$$SetPaymentImplCopyWithImpl<$Res>
    extends _$PaymentFormEventCopyWithImpl<$Res, _$SetPaymentImpl>
    implements _$$SetPaymentImplCopyWith<$Res> {
  __$$SetPaymentImplCopyWithImpl(
    _$SetPaymentImpl _value,
    $Res Function(_$SetPaymentImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({Object? paymentMethod = null}) {
    return _then(
      _$SetPaymentImpl(
        null == paymentMethod
            ? _value.paymentMethod
            : paymentMethod // ignore: cast_nullable_to_non_nullable
                  as PaymentMethod,
      ),
    );
  }

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @override
  @pragma('vm:prefer-inline')
  $PaymentMethodCopyWith<$Res> get paymentMethod {
    return $PaymentMethodCopyWith<$Res>(_value.paymentMethod, (value) {
      return _then(_value.copyWith(paymentMethod: value));
    });
  }
}

/// @nodoc

class _$SetPaymentImpl implements _SetPayment {
  const _$SetPaymentImpl(this.paymentMethod);

  @override
  final PaymentMethod paymentMethod;

  @override
  String toString() {
    return 'PaymentFormEvent.setPaymentMethod(paymentMethod: $paymentMethod)';
  }

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

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

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$SetPaymentImplCopyWith<_$SetPaymentImpl> get copyWith =>
      __$$SetPaymentImplCopyWithImpl<_$SetPaymentImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) setOrder,
    required TResult Function(PaymentMethod paymentMethod) setPaymentMethod,
    required TResult Function() submitted,
    required TResult Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )
    submittedSplitBill,
  }) {
    return setPaymentMethod(paymentMethod);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? setOrder,
    TResult? Function(PaymentMethod paymentMethod)? setPaymentMethod,
    TResult? Function()? submitted,
    TResult? Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )?
    submittedSplitBill,
  }) {
    return setPaymentMethod?.call(paymentMethod);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? setOrder,
    TResult Function(PaymentMethod paymentMethod)? setPaymentMethod,
    TResult Function()? submitted,
    TResult Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )?
    submittedSplitBill,
    required TResult orElse(),
  }) {
    if (setPaymentMethod != null) {
      return setPaymentMethod(paymentMethod);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_SetOrder value) setOrder,
    required TResult Function(_SetPayment value) setPaymentMethod,
    required TResult Function(_Submitted value) submitted,
    required TResult Function(_SubmittedSplitBill value) submittedSplitBill,
  }) {
    return setPaymentMethod(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_SetOrder value)? setOrder,
    TResult? Function(_SetPayment value)? setPaymentMethod,
    TResult? Function(_Submitted value)? submitted,
    TResult? Function(_SubmittedSplitBill value)? submittedSplitBill,
  }) {
    return setPaymentMethod?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_SetOrder value)? setOrder,
    TResult Function(_SetPayment value)? setPaymentMethod,
    TResult Function(_Submitted value)? submitted,
    TResult Function(_SubmittedSplitBill value)? submittedSplitBill,
    required TResult orElse(),
  }) {
    if (setPaymentMethod != null) {
      return setPaymentMethod(this);
    }
    return orElse();
  }
}

abstract class _SetPayment implements PaymentFormEvent {
  const factory _SetPayment(final PaymentMethod paymentMethod) =
      _$SetPaymentImpl;

  PaymentMethod get paymentMethod;

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$SetPaymentImplCopyWith<_$SetPaymentImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$SubmittedImplCopyWith<$Res> {
  factory _$$SubmittedImplCopyWith(
    _$SubmittedImpl value,
    $Res Function(_$SubmittedImpl) then,
  ) = __$$SubmittedImplCopyWithImpl<$Res>;
}

/// @nodoc
class __$$SubmittedImplCopyWithImpl<$Res>
    extends _$PaymentFormEventCopyWithImpl<$Res, _$SubmittedImpl>
    implements _$$SubmittedImplCopyWith<$Res> {
  __$$SubmittedImplCopyWithImpl(
    _$SubmittedImpl _value,
    $Res Function(_$SubmittedImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc

class _$SubmittedImpl implements _Submitted {
  const _$SubmittedImpl();

  @override
  String toString() {
    return 'PaymentFormEvent.submitted()';
  }

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

  @override
  int get hashCode => runtimeType.hashCode;

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) setOrder,
    required TResult Function(PaymentMethod paymentMethod) setPaymentMethod,
    required TResult Function() submitted,
    required TResult Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )
    submittedSplitBill,
  }) {
    return submitted();
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? setOrder,
    TResult? Function(PaymentMethod paymentMethod)? setPaymentMethod,
    TResult? Function()? submitted,
    TResult? Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )?
    submittedSplitBill,
  }) {
    return submitted?.call();
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? setOrder,
    TResult Function(PaymentMethod paymentMethod)? setPaymentMethod,
    TResult Function()? submitted,
    TResult Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )?
    submittedSplitBill,
    required TResult orElse(),
  }) {
    if (submitted != null) {
      return submitted();
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_SetOrder value) setOrder,
    required TResult Function(_SetPayment value) setPaymentMethod,
    required TResult Function(_Submitted value) submitted,
    required TResult Function(_SubmittedSplitBill value) submittedSplitBill,
  }) {
    return submitted(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_SetOrder value)? setOrder,
    TResult? Function(_SetPayment value)? setPaymentMethod,
    TResult? Function(_Submitted value)? submitted,
    TResult? Function(_SubmittedSplitBill value)? submittedSplitBill,
  }) {
    return submitted?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_SetOrder value)? setOrder,
    TResult Function(_SetPayment value)? setPaymentMethod,
    TResult Function(_Submitted value)? submitted,
    TResult Function(_SubmittedSplitBill value)? submittedSplitBill,
    required TResult orElse(),
  }) {
    if (submitted != null) {
      return submitted(this);
    }
    return orElse();
  }
}

abstract class _Submitted implements PaymentFormEvent {
  const factory _Submitted() = _$SubmittedImpl;
}

/// @nodoc
abstract class _$$SubmittedSplitBillImplCopyWith<$Res> {
  factory _$$SubmittedSplitBillImplCopyWith(
    _$SubmittedSplitBillImpl value,
    $Res Function(_$SubmittedSplitBillImpl) then,
  ) = __$$SubmittedSplitBillImplCopyWithImpl<$Res>;
  @useResult
  $Res call({SplitType? splitType, String? customerId, String? customerName});
}

/// @nodoc
class __$$SubmittedSplitBillImplCopyWithImpl<$Res>
    extends _$PaymentFormEventCopyWithImpl<$Res, _$SubmittedSplitBillImpl>
    implements _$$SubmittedSplitBillImplCopyWith<$Res> {
  __$$SubmittedSplitBillImplCopyWithImpl(
    _$SubmittedSplitBillImpl _value,
    $Res Function(_$SubmittedSplitBillImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? splitType = freezed,
    Object? customerId = freezed,
    Object? customerName = freezed,
  }) {
    return _then(
      _$SubmittedSplitBillImpl(
        splitType: freezed == splitType
            ? _value.splitType
            : splitType // ignore: cast_nullable_to_non_nullable
                  as SplitType?,
        customerId: freezed == customerId
            ? _value.customerId
            : customerId // ignore: cast_nullable_to_non_nullable
                  as String?,
        customerName: freezed == customerName
            ? _value.customerName
            : customerName // ignore: cast_nullable_to_non_nullable
                  as String?,
      ),
    );
  }
}

/// @nodoc

class _$SubmittedSplitBillImpl implements _SubmittedSplitBill {
  const _$SubmittedSplitBillImpl({
    this.splitType,
    this.customerId,
    this.customerName,
  });

  @override
  final SplitType? splitType;
  @override
  final String? customerId;
  @override
  final String? customerName;

  @override
  String toString() {
    return 'PaymentFormEvent.submittedSplitBill(splitType: $splitType, customerId: $customerId, customerName: $customerName)';
  }

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

  @override
  int get hashCode =>
      Object.hash(runtimeType, splitType, customerId, customerName);

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$SubmittedSplitBillImplCopyWith<_$SubmittedSplitBillImpl> get copyWith =>
      __$$SubmittedSplitBillImplCopyWithImpl<_$SubmittedSplitBillImpl>(
        this,
        _$identity,
      );

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(Order order) setOrder,
    required TResult Function(PaymentMethod paymentMethod) setPaymentMethod,
    required TResult Function() submitted,
    required TResult Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )
    submittedSplitBill,
  }) {
    return submittedSplitBill(splitType, customerId, customerName);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(Order order)? setOrder,
    TResult? Function(PaymentMethod paymentMethod)? setPaymentMethod,
    TResult? Function()? submitted,
    TResult? Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )?
    submittedSplitBill,
  }) {
    return submittedSplitBill?.call(splitType, customerId, customerName);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(Order order)? setOrder,
    TResult Function(PaymentMethod paymentMethod)? setPaymentMethod,
    TResult Function()? submitted,
    TResult Function(
      SplitType? splitType,
      String? customerId,
      String? customerName,
    )?
    submittedSplitBill,
    required TResult orElse(),
  }) {
    if (submittedSplitBill != null) {
      return submittedSplitBill(splitType, customerId, customerName);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_SetOrder value) setOrder,
    required TResult Function(_SetPayment value) setPaymentMethod,
    required TResult Function(_Submitted value) submitted,
    required TResult Function(_SubmittedSplitBill value) submittedSplitBill,
  }) {
    return submittedSplitBill(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_SetOrder value)? setOrder,
    TResult? Function(_SetPayment value)? setPaymentMethod,
    TResult? Function(_Submitted value)? submitted,
    TResult? Function(_SubmittedSplitBill value)? submittedSplitBill,
  }) {
    return submittedSplitBill?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_SetOrder value)? setOrder,
    TResult Function(_SetPayment value)? setPaymentMethod,
    TResult Function(_Submitted value)? submitted,
    TResult Function(_SubmittedSplitBill value)? submittedSplitBill,
    required TResult orElse(),
  }) {
    if (submittedSplitBill != null) {
      return submittedSplitBill(this);
    }
    return orElse();
  }
}

abstract class _SubmittedSplitBill implements PaymentFormEvent {
  const factory _SubmittedSplitBill({
    final SplitType? splitType,
    final String? customerId,
    final String? customerName,
  }) = _$SubmittedSplitBillImpl;

  SplitType? get splitType;
  String? get customerId;
  String? get customerName;

  /// Create a copy of PaymentFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$SubmittedSplitBillImplCopyWith<_$SubmittedSplitBillImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
mixin _$PaymentFormState {
  Order get order => throw _privateConstructorUsedError;
  List<OrderItem> get pendingItems => throw _privateConstructorUsedError;
  Option<Either<OrderFailure, Payment>> get failureOrPayment =>
      throw _privateConstructorUsedError;
  Option<Either<OrderFailure, Payment>> get failureOrPaymentSplitBill =>
      throw _privateConstructorUsedError;
  PaymentMethod? get paymentMethod => throw _privateConstructorUsedError;
  bool get isSubmitting => throw _privateConstructorUsedError;

  /// Idempotency key untuk payment submission.
  /// Di-generate saat user tap "Bayar", dipakai ulang saat retry,
  /// di-clear setelah sukses.
  String? get idempotencyKey => throw _privateConstructorUsedError;

  /// Idempotency key untuk split bill submission.
  String? get splitBillIdempotencyKey => throw _privateConstructorUsedError;

  /// Create a copy of PaymentFormState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  $PaymentFormStateCopyWith<PaymentFormState> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $PaymentFormStateCopyWith<$Res> {
  factory $PaymentFormStateCopyWith(
    PaymentFormState value,
    $Res Function(PaymentFormState) then,
  ) = _$PaymentFormStateCopyWithImpl<$Res, PaymentFormState>;
  @useResult
  $Res call({
    Order order,
    List<OrderItem> pendingItems,
    Option<Either<OrderFailure, Payment>> failureOrPayment,
    Option<Either<OrderFailure, Payment>> failureOrPaymentSplitBill,
    PaymentMethod? paymentMethod,
    bool isSubmitting,
    String? idempotencyKey,
    String? splitBillIdempotencyKey,
  });

  $OrderCopyWith<$Res> get order;
  $PaymentMethodCopyWith<$Res>? get paymentMethod;
}

/// @nodoc
class _$PaymentFormStateCopyWithImpl<$Res, $Val extends PaymentFormState>
    implements $PaymentFormStateCopyWith<$Res> {
  _$PaymentFormStateCopyWithImpl(this._value, this._then);

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

  /// Create a copy of PaymentFormState
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? order = null,
    Object? pendingItems = null,
    Object? failureOrPayment = null,
    Object? failureOrPaymentSplitBill = null,
    Object? paymentMethod = freezed,
    Object? isSubmitting = null,
    Object? idempotencyKey = freezed,
    Object? splitBillIdempotencyKey = freezed,
  }) {
    return _then(
      _value.copyWith(
            order: null == order
                ? _value.order
                : order // ignore: cast_nullable_to_non_nullable
                      as Order,
            pendingItems: null == pendingItems
                ? _value.pendingItems
                : pendingItems // ignore: cast_nullable_to_non_nullable
                      as List<OrderItem>,
            failureOrPayment: null == failureOrPayment
                ? _value.failureOrPayment
                : failureOrPayment // ignore: cast_nullable_to_non_nullable
                      as Option<Either<OrderFailure, Payment>>,
            failureOrPaymentSplitBill: null == failureOrPaymentSplitBill
                ? _value.failureOrPaymentSplitBill
                : failureOrPaymentSplitBill // ignore: cast_nullable_to_non_nullable
                      as Option<Either<OrderFailure, Payment>>,
            paymentMethod: freezed == paymentMethod
                ? _value.paymentMethod
                : paymentMethod // ignore: cast_nullable_to_non_nullable
                      as PaymentMethod?,
            isSubmitting: null == isSubmitting
                ? _value.isSubmitting
                : isSubmitting // ignore: cast_nullable_to_non_nullable
                      as bool,
            idempotencyKey: freezed == idempotencyKey
                ? _value.idempotencyKey
                : idempotencyKey // ignore: cast_nullable_to_non_nullable
                      as String?,
            splitBillIdempotencyKey: freezed == splitBillIdempotencyKey
                ? _value.splitBillIdempotencyKey
                : splitBillIdempotencyKey // ignore: cast_nullable_to_non_nullable
                      as String?,
          )
          as $Val,
    );
  }

  /// Create a copy of PaymentFormState
  /// with the given fields replaced by the non-null parameter values.
  @override
  @pragma('vm:prefer-inline')
  $OrderCopyWith<$Res> get order {
    return $OrderCopyWith<$Res>(_value.order, (value) {
      return _then(_value.copyWith(order: value) as $Val);
    });
  }

  /// Create a copy of PaymentFormState
  /// with the given fields replaced by the non-null parameter values.
  @override
  @pragma('vm:prefer-inline')
  $PaymentMethodCopyWith<$Res>? get paymentMethod {
    if (_value.paymentMethod == null) {
      return null;
    }

    return $PaymentMethodCopyWith<$Res>(_value.paymentMethod!, (value) {
      return _then(_value.copyWith(paymentMethod: value) as $Val);
    });
  }
}

/// @nodoc
abstract class _$$PaymentFormStateImplCopyWith<$Res>
    implements $PaymentFormStateCopyWith<$Res> {
  factory _$$PaymentFormStateImplCopyWith(
    _$PaymentFormStateImpl value,
    $Res Function(_$PaymentFormStateImpl) then,
  ) = __$$PaymentFormStateImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({
    Order order,
    List<OrderItem> pendingItems,
    Option<Either<OrderFailure, Payment>> failureOrPayment,
    Option<Either<OrderFailure, Payment>> failureOrPaymentSplitBill,
    PaymentMethod? paymentMethod,
    bool isSubmitting,
    String? idempotencyKey,
    String? splitBillIdempotencyKey,
  });

  @override
  $OrderCopyWith<$Res> get order;
  @override
  $PaymentMethodCopyWith<$Res>? get paymentMethod;
}

/// @nodoc
class __$$PaymentFormStateImplCopyWithImpl<$Res>
    extends _$PaymentFormStateCopyWithImpl<$Res, _$PaymentFormStateImpl>
    implements _$$PaymentFormStateImplCopyWith<$Res> {
  __$$PaymentFormStateImplCopyWithImpl(
    _$PaymentFormStateImpl _value,
    $Res Function(_$PaymentFormStateImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of PaymentFormState
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? order = null,
    Object? pendingItems = null,
    Object? failureOrPayment = null,
    Object? failureOrPaymentSplitBill = null,
    Object? paymentMethod = freezed,
    Object? isSubmitting = null,
    Object? idempotencyKey = freezed,
    Object? splitBillIdempotencyKey = freezed,
  }) {
    return _then(
      _$PaymentFormStateImpl(
        order: null == order
            ? _value.order
            : order // ignore: cast_nullable_to_non_nullable
                  as Order,
        pendingItems: null == pendingItems
            ? _value._pendingItems
            : pendingItems // ignore: cast_nullable_to_non_nullable
                  as List<OrderItem>,
        failureOrPayment: null == failureOrPayment
            ? _value.failureOrPayment
            : failureOrPayment // ignore: cast_nullable_to_non_nullable
                  as Option<Either<OrderFailure, Payment>>,
        failureOrPaymentSplitBill: null == failureOrPaymentSplitBill
            ? _value.failureOrPaymentSplitBill
            : failureOrPaymentSplitBill // ignore: cast_nullable_to_non_nullable
                  as Option<Either<OrderFailure, Payment>>,
        paymentMethod: freezed == paymentMethod
            ? _value.paymentMethod
            : paymentMethod // ignore: cast_nullable_to_non_nullable
                  as PaymentMethod?,
        isSubmitting: null == isSubmitting
            ? _value.isSubmitting
            : isSubmitting // ignore: cast_nullable_to_non_nullable
                  as bool,
        idempotencyKey: freezed == idempotencyKey
            ? _value.idempotencyKey
            : idempotencyKey // ignore: cast_nullable_to_non_nullable
                  as String?,
        splitBillIdempotencyKey: freezed == splitBillIdempotencyKey
            ? _value.splitBillIdempotencyKey
            : splitBillIdempotencyKey // ignore: cast_nullable_to_non_nullable
                  as String?,
      ),
    );
  }
}

/// @nodoc

class _$PaymentFormStateImpl implements _PaymentFormState {
  _$PaymentFormStateImpl({
    required this.order,
    required final List<OrderItem> pendingItems,
    required this.failureOrPayment,
    required this.failureOrPaymentSplitBill,
    this.paymentMethod,
    this.isSubmitting = false,
    this.idempotencyKey,
    this.splitBillIdempotencyKey,
  }) : _pendingItems = pendingItems;

  @override
  final Order order;
  final List<OrderItem> _pendingItems;
  @override
  List<OrderItem> get pendingItems {
    if (_pendingItems is EqualUnmodifiableListView) return _pendingItems;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_pendingItems);
  }

  @override
  final Option<Either<OrderFailure, Payment>> failureOrPayment;
  @override
  final Option<Either<OrderFailure, Payment>> failureOrPaymentSplitBill;
  @override
  final PaymentMethod? paymentMethod;
  @override
  @JsonKey()
  final bool isSubmitting;

  /// Idempotency key untuk payment submission.
  /// Di-generate saat user tap "Bayar", dipakai ulang saat retry,
  /// di-clear setelah sukses.
  @override
  final String? idempotencyKey;

  /// Idempotency key untuk split bill submission.
  @override
  final String? splitBillIdempotencyKey;

  @override
  String toString() {
    return 'PaymentFormState(order: $order, pendingItems: $pendingItems, failureOrPayment: $failureOrPayment, failureOrPaymentSplitBill: $failureOrPaymentSplitBill, paymentMethod: $paymentMethod, isSubmitting: $isSubmitting, idempotencyKey: $idempotencyKey, splitBillIdempotencyKey: $splitBillIdempotencyKey)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$PaymentFormStateImpl &&
            (identical(other.order, order) || other.order == order) &&
            const DeepCollectionEquality().equals(
              other._pendingItems,
              _pendingItems,
            ) &&
            (identical(other.failureOrPayment, failureOrPayment) ||
                other.failureOrPayment == failureOrPayment) &&
            (identical(
                  other.failureOrPaymentSplitBill,
                  failureOrPaymentSplitBill,
                ) ||
                other.failureOrPaymentSplitBill == failureOrPaymentSplitBill) &&
            (identical(other.paymentMethod, paymentMethod) ||
                other.paymentMethod == paymentMethod) &&
            (identical(other.isSubmitting, isSubmitting) ||
                other.isSubmitting == isSubmitting) &&
            (identical(other.idempotencyKey, idempotencyKey) ||
                other.idempotencyKey == idempotencyKey) &&
            (identical(
                  other.splitBillIdempotencyKey,
                  splitBillIdempotencyKey,
                ) ||
                other.splitBillIdempotencyKey == splitBillIdempotencyKey));
  }

  @override
  int get hashCode => Object.hash(
    runtimeType,
    order,
    const DeepCollectionEquality().hash(_pendingItems),
    failureOrPayment,
    failureOrPaymentSplitBill,
    paymentMethod,
    isSubmitting,
    idempotencyKey,
    splitBillIdempotencyKey,
  );

  /// Create a copy of PaymentFormState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$PaymentFormStateImplCopyWith<_$PaymentFormStateImpl> get copyWith =>
      __$$PaymentFormStateImplCopyWithImpl<_$PaymentFormStateImpl>(
        this,
        _$identity,
      );
}

abstract class _PaymentFormState implements PaymentFormState {
  factory _PaymentFormState({
    required final Order order,
    required final List<OrderItem> pendingItems,
    required final Option<Either<OrderFailure, Payment>> failureOrPayment,
    required final Option<Either<OrderFailure, Payment>>
    failureOrPaymentSplitBill,
    final PaymentMethod? paymentMethod,
    final bool isSubmitting,
    final String? idempotencyKey,
    final String? splitBillIdempotencyKey,
  }) = _$PaymentFormStateImpl;

  @override
  Order get order;
  @override
  List<OrderItem> get pendingItems;
  @override
  Option<Either<OrderFailure, Payment>> get failureOrPayment;
  @override
  Option<Either<OrderFailure, Payment>> get failureOrPaymentSplitBill;
  @override
  PaymentMethod? get paymentMethod;
  @override
  bool get isSubmitting;

  /// Idempotency key untuk payment submission.
  /// Di-generate saat user tap "Bayar", dipakai ulang saat retry,
  /// di-clear setelah sukses.
  @override
  String? get idempotencyKey;

  /// Idempotency key untuk split bill submission.
  @override
  String? get splitBillIdempotencyKey;

  /// Create a copy of PaymentFormState
  /// with the given fields replaced by the non-null parameter values.
  @override
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$PaymentFormStateImplCopyWith<_$PaymentFormStateImpl> get copyWith =>
      throw _privateConstructorUsedError;
}
