package com.vinfast.companion.main.ui.testdrive.locationstep;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@kotlin.Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\n"}, d2 = {"<anonymous>", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {2, 2, 0}, xi = 48)
@kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1", f = "TestDriveLocationStepViewModel.kt", l = {148}, m = "invokeSuspend", v = 1)
@kotlin.jvm.internal.SourceDebugExtension
final class TestDriveLocationStepViewModel$getServiceCenters$1 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function2<kotlinx.coroutines.CoroutineScope, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
    java.lang.Object n;
    java.lang.Object o;
    int p;
    final /* synthetic */ com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel q;

    /* JADX INFO: renamed from: com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$2, reason: invalid class name */
    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00040\u00030\u0002H\n"}, d2 = {"<anonymous>", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lkotlinx/coroutines/flow/FlowCollector;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lcom/vinfast/companion/serviceskit/domain/model/ServiceCenter;"}, k = 3, mv = {2, 2, 0}, xi = 48)
    @kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$2", f = "TestDriveLocationStepViewModel.kt", l = {}, m = "invokeSuspend", v = 1)
    static final class AnonymousClass2 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function2<kotlinx.coroutines.flow.FlowCollector<? super java.util.List<? extends com.vinfast.companion.serviceskit.domain.model.ServiceCenter>>, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
        int n;
        final /* synthetic */ com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel o;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        AnonymousClass2(com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel testDriveLocationStepViewModel, kotlin.coroutines.Continuation continuation) {
            super(2, continuation);
            this.o = testDriveLocationStepViewModel;
        }

        /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
        public final java.lang.Object invoke(kotlinx.coroutines.flow.FlowCollector flowCollector, kotlin.coroutines.Continuation continuation) {
            return create(flowCollector, continuation).invokeSuspend(kotlin.Unit.a);
        }

        public final kotlin.coroutines.Continuation create(java.lang.Object obj, kotlin.coroutines.Continuation continuation) {
            return new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass2(this.o, continuation);
        }

        public final java.lang.Object invokeSuspend(java.lang.Object obj) {
            kotlin.coroutines.intrinsics.IntrinsicsKt.g();
            if (this.n != 0) {
                throw new java.lang.IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            kotlin.ResultKt.b(obj);
            this.o.F(com.vinfast.companion.core.base.ProgressType.ProgressDialog.b);
            return kotlin.Unit.a;
        }
    }

    /* JADX INFO: renamed from: com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$3, reason: invalid class name */
    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(d1 = {"\u0000\u0018\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\u0010\u0000\u001a\u00020\u0001*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00040\u00030\u00022\b\u0010\u0005\u001a\u0004\u0018\u00010\u0006H\n"}, d2 = {"<anonymous>", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lkotlinx/coroutines/flow/FlowCollector;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lcom/vinfast/companion/serviceskit/domain/model/ServiceCenter;", "it", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET}, k = 3, mv = {2, 2, 0}, xi = 48)
    @kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$3", f = "TestDriveLocationStepViewModel.kt", l = {}, m = "invokeSuspend", v = 1)
    static final class AnonymousClass3 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function3<kotlinx.coroutines.flow.FlowCollector<? super java.util.List<? extends com.vinfast.companion.serviceskit.domain.model.ServiceCenter>>, java.lang.Throwable, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
        int n;
        final /* synthetic */ com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel o;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        AnonymousClass3(com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel testDriveLocationStepViewModel, kotlin.coroutines.Continuation continuation) {
            super(3, continuation);
            this.o = testDriveLocationStepViewModel;
        }

        public final java.lang.Object invokeSuspend(java.lang.Object obj) {
            kotlin.coroutines.intrinsics.IntrinsicsKt.g();
            if (this.n != 0) {
                throw new java.lang.IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            kotlin.ResultKt.b(obj);
            this.o.w();
            return kotlin.Unit.a;
        }

        public final java.lang.Object invoke(kotlinx.coroutines.flow.FlowCollector flowCollector, java.lang.Throwable th, kotlin.coroutines.Continuation continuation) {
            return new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass3(this.o, continuation).invokeSuspend(kotlin.Unit.a);
        }
    }

    /* JADX INFO: renamed from: com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$4, reason: invalid class name */
    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(d1 = {"\u0000\u0018\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\u0010\u0000\u001a\u00020\u0001*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00040\u00030\u00022\u0006\u0010\u0005\u001a\u00020\u0006H\n"}, d2 = {"<anonymous>", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lkotlinx/coroutines/flow/FlowCollector;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lcom/vinfast/companion/serviceskit/domain/model/ServiceCenter;", "error", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET}, k = 3, mv = {2, 2, 0}, xi = 48)
    @kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$4", f = "TestDriveLocationStepViewModel.kt", l = {145}, m = "invokeSuspend", v = 1)
    static final class AnonymousClass4 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function3<kotlinx.coroutines.flow.FlowCollector<? super java.util.List<? extends com.vinfast.companion.serviceskit.domain.model.ServiceCenter>>, java.lang.Throwable, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
        int n;
        private /* synthetic */ java.lang.Object o;
        /* synthetic */ java.lang.Object p;
        final /* synthetic */ com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel q;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        AnonymousClass4(com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel testDriveLocationStepViewModel, kotlin.coroutines.Continuation continuation) {
            super(3, continuation);
            this.q = testDriveLocationStepViewModel;
        }

        public final java.lang.Object invokeSuspend(java.lang.Object obj) {
            kotlinx.coroutines.flow.FlowCollector flowCollector = (kotlinx.coroutines.flow.FlowCollector) this.o;
            java.lang.Throwable th = (java.lang.Throwable) this.p;
            java.lang.Object objG = kotlin.coroutines.intrinsics.IntrinsicsKt.g();
            int i = this.n;
            if (i == 0) {
                kotlin.ResultKt.b(obj);
                com.vinfast.companion.core.base.BaseViewModel.v(this.q, th, false, 2, (java.lang.Object) null);
                java.util.Collection collection = (java.util.Collection) this.q._serviceCenterLiveData.f();
                if (collection == null || collection.isEmpty()) {
                    java.util.List listO = kotlin.collections.CollectionsKt.o();
                    this.o = kotlin.coroutines.jvm.internal.SpillingKt.a(flowCollector);
                    this.p = kotlin.coroutines.jvm.internal.SpillingKt.a(th);
                    this.n = 1;
                    if (flowCollector.emit(listO, this) == objG) {
                        return objG;
                    }
                }
            } else {
                if (i != 1) {
                    throw new java.lang.IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                kotlin.ResultKt.b(obj);
            }
            return kotlin.Unit.a;
        }

        public final java.lang.Object invoke(kotlinx.coroutines.flow.FlowCollector flowCollector, java.lang.Throwable th, kotlin.coroutines.Continuation continuation) {
            com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass4 anonymousClass4 = new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass4(this.q, continuation);
            anonymousClass4.o = flowCollector;
            anonymousClass4.p = th;
            return anonymousClass4.invokeSuspend(kotlin.Unit.a);
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    TestDriveLocationStepViewModel$getServiceCenters$1(com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel testDriveLocationStepViewModel, kotlin.coroutines.Continuation continuation) {
        super(2, continuation);
        this.q = testDriveLocationStepViewModel;
    }

    public final kotlin.coroutines.Continuation create(java.lang.Object obj, kotlin.coroutines.Continuation continuation) {
        return new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1(this.q, continuation);
    }

    public final java.lang.Object invokeSuspend(java.lang.Object obj) {
        java.lang.Object objG = kotlin.coroutines.intrinsics.IntrinsicsKt.g();
        int i = this.p;
        if (i == 0) {
            kotlin.ResultKt.b(obj);
            java.lang.String strQ0 = this.q.q0();
            com.vinfast.companion.serviceskit.domain.model.Province province = (com.vinfast.companion.serviceskit.domain.model.Province) this.q._selectedProvinceLiveData.f();
            com.vinfast.companion.serviceskit.manager.ITestDriveBookingManager testDriveBookingManager = this.q.getTestDriveBookingManager();
            android.location.Location deviceLocation = this.q.getDeviceLocation();
            java.lang.Double dB = deviceLocation != null ? kotlin.coroutines.jvm.internal.Boxing.b(deviceLocation.getLatitude()) : null;
            android.location.Location deviceLocation2 = this.q.getDeviceLocation();
            final kotlinx.coroutines.flow.Flow flowB = testDriveBookingManager.B(strQ0, province, dB, deviceLocation2 != null ? kotlin.coroutines.jvm.internal.Boxing.b(deviceLocation2.getLongitude()) : null);
            final com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel testDriveLocationStepViewModel = this.q;
            kotlinx.coroutines.flow.Flow flowI = kotlinx.coroutines.flow.FlowKt.i(kotlinx.coroutines.flow.FlowKt.b0(kotlinx.coroutines.flow.FlowKt.d0(kotlinx.coroutines.flow.FlowKt.T(new kotlinx.coroutines.flow.Flow<java.util.List<? extends com.vinfast.companion.serviceskit.domain.model.ServiceCenter>>() { // from class: com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1

                /* JADX INFO: renamed from: com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2, reason: invalid class name */
                /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
                @kotlin.Metadata(k = 3, mv = {2, 2, 0}, xi = 48)
                @kotlin.jvm.internal.SourceDebugExtension
                public static final class AnonymousClass2<T> implements kotlinx.coroutines.flow.FlowCollector {
                    final /* synthetic */ kotlinx.coroutines.flow.FlowCollector a;
                    final /* synthetic */ com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel b;

                    /* JADX INFO: renamed from: com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2$1, reason: invalid class name */
                    @kotlin.Metadata(k = 3, mv = {2, 2, 0}, xi = 48)
                    @kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2", f = "TestDriveLocationStepViewModel.kt", l = {50}, m = "emit", v = 1)
                    public static final class AnonymousClass1 extends kotlin.coroutines.jvm.internal.ContinuationImpl {
                        /* synthetic */ java.lang.Object n;
                        int o;
                        java.lang.Object p;
                        java.lang.Object r;
                        java.lang.Object s;
                        java.lang.Object t;
                        int u;

                        public AnonymousClass1(kotlin.coroutines.Continuation continuation) {
                            super(continuation);
                        }

                        public final java.lang.Object invokeSuspend(java.lang.Object obj) {
                            this.n = obj;
                            this.o |= Integer.MIN_VALUE;
                            return com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.this.emit(null, this);
                        }
                    }

                    public AnonymousClass2(kotlinx.coroutines.flow.FlowCollector flowCollector, com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel testDriveLocationStepViewModel) {
                        this.a = flowCollector;
                        this.b = testDriveLocationStepViewModel;
                    }

                    /* JADX INFO: Thrown type has an unknown type hierarchy: kotlin.NoWhenBranchMatchedException */
                    /* JADX WARN: Code duplicated, block: B:7:0x0013  */
                    @Override // kotlinx.coroutines.flow.FlowCollector
                    public final java.lang.Object emit(java.lang.Object obj, kotlin.coroutines.Continuation continuation) throws kotlin.NoWhenBranchMatchedException {
                        com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1 anonymousClass1;
                        if (continuation instanceof com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1) {
                            anonymousClass1 = (com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1) continuation;
                            int i = anonymousClass1.o;
                            if ((i & Integer.MIN_VALUE) != 0) {
                                anonymousClass1.o = i - Integer.MIN_VALUE;
                            } else {
                                anonymousClass1 = new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1(continuation);
                            }
                        } else {
                            anonymousClass1 = new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1(continuation);
                        }
                        java.lang.Object obj2 = anonymousClass1.n;
                        java.lang.Object objG = kotlin.coroutines.intrinsics.IntrinsicsKt.g();
                        int i2 = anonymousClass1.o;
                        if (i2 == 0) {
                            kotlin.ResultKt.b(obj2);
                            kotlinx.coroutines.flow.FlowCollector flowCollector = this.a;
                            final java.util.Comparator comparator = 
                            /*  JADX ERROR: Method code generation error
                                jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x0043: CONSTRUCTOR (r4v0 'comparator' java.util.Comparator) =  A[DECLARE_VAR, MD:():void (m)] (LINE:68) call: com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$lambda$0$$inlined$compareByDescending$1.<init>():void type: CONSTRUCTOR in method: com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object, file: E:\ios\vf_dex\classes3.dex
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:310)
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:273)
                                	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:94)
                                	at jadx.core.dex.nodes.IBlock.generate(IBlock.java:15)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:83)
                                	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:126)
                                	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:90)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:291)
                                	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:270)
                                	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:420)
                                	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:345)
                                	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$3(ClassGen.java:299)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
                                	at java.base/java.util.ArrayList.forEach(ArrayList.java:1612)
                                	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
                                	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:261)
                                	at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.end(ReferencePipeline.java:284)
                                	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
                                	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
                                	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
                                	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
                                	at jadx.core.codegen.ClassGen.addInnerClsAndMethods(ClassGen.java:295)
                                	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:284)
                                	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:268)
                                	at jadx.core.codegen.ClassGen.addClassCode(ClassGen.java:160)
                                	at jadx.core.codegen.ClassGen.addInnerClass(ClassGen.java:320)
                                	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$3(ClassGen.java:297)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
                                	at java.base/java.util.ArrayList.forEach(ArrayList.java:1612)
                                	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
                                	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:261)
                                	at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.end(ReferencePipeline.java:284)
                                	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
                                	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
                                	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
                                	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
                                	at jadx.core.codegen.ClassGen.addInnerClsAndMethods(ClassGen.java:295)
                                	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:284)
                                	at jadx.core.codegen.InsnGen.inlineAnonymousConstructor(InsnGen.java:845)
                                	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:730)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:418)
                                	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:145)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:121)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:108)
                                	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:1143)
                                	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:910)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:422)
                                	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:145)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:121)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:108)
                                	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:1143)
                                	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:910)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:422)
                                	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:145)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:121)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:108)
                                	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:1143)
                                	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:910)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:422)
                                	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:145)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:121)
                                	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:108)
                                	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:1143)
                                	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:910)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:422)
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:303)
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:273)
                                	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:94)
                                	at jadx.core.dex.nodes.IBlock.generate(IBlock.java:15)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:83)
                                	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:126)
                                	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:90)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:66)
                                	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:291)
                                	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:270)
                                	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:420)
                                	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:345)
                                	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$3(ClassGen.java:299)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
                                	at java.base/java.util.ArrayList.forEach(ArrayList.java:1612)
                                	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
                                	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:261)
                                	at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.end(ReferencePipeline.java:284)
                                	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:571)
                                	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
                                	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
                                	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
                                	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
                                	at jadx.core.codegen.ClassGen.addInnerClsAndMethods(ClassGen.java:295)
                                	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:284)
                                	at jadx.core.codegen.ClassGen.addClassBody(ClassGen.java:268)
                                	at jadx.core.codegen.ClassGen.addClassCode(ClassGen.java:160)
                                	at jadx.core.codegen.ClassGen.makeClass(ClassGen.java:104)
                                	at jadx.core.codegen.CodeGen.wrapCodeGen(CodeGen.java:45)
                                	at jadx.core.codegen.CodeGen.generateJavaCode(CodeGen.java:34)
                                	at jadx.core.codegen.CodeGen.generate(CodeGen.java:22)
                                	at jadx.core.ProcessClass.process(ProcessClass.java:89)
                                	at jadx.core.ProcessClass.generateCode(ProcessClass.java:127)
                                	at jadx.core.dex.nodes.ClassNode.generateClassCode(ClassNode.java:405)
                                	at jadx.core.dex.nodes.ClassNode.decompile(ClassNode.java:393)
                                	at jadx.core.dex.nodes.ClassNode.getCode(ClassNode.java:343)
                                Caused by: jadx.core.utils.exceptions.JadxRuntimeException: Expected class to be processed at this point, class: com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$lambda$0$$inlined$compareByDescending$1, state: NOT_LOADED
                                	at jadx.core.dex.nodes.ClassNode.ensureProcessed(ClassNode.java:306)
                                	at jadx.core.codegen.InsnGen.inlineAnonymousConstructor(InsnGen.java:807)
                                	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:730)
                                	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:418)
                                	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:303)
                                	... 116 more
                                */
                            /*
                                this = this;
                                boolean r0 = r8 instanceof com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1
                                if (r0 == 0) goto L13
                                r0 = r8
                                com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2$1 r0 = (com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1) r0
                                int r1 = r0.o
                                r2 = -2147483648(0xffffffff80000000, float:-0.0)
                                r3 = r1 & r2
                                if (r3 == 0) goto L13
                                int r1 = r1 - r2
                                r0.o = r1
                                goto L18
                            L13:
                                com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2$1 r0 = new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2$1
                                r0.<init>(r8)
                            L18:
                                java.lang.Object r8 = r0.n
                                java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.g()
                                int r2 = r0.o
                                r3 = 1
                                if (r2 == 0) goto L39
                                if (r2 != r3) goto L31
                                java.lang.Object r6 = r0.t
                                kotlinx.coroutines.flow.FlowCollector r6 = (kotlinx.coroutines.flow.FlowCollector) r6
                                java.lang.Object r6 = r0.r
                                com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1$2$1 r6 = (com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.AnonymousClass1) r6
                                kotlin.ResultKt.b(r8)
                                goto L7d
                            L31:
                                java.lang.IllegalStateException r6 = new java.lang.IllegalStateException
                                java.lang.String r7 = "call to 'resume' before 'invoke' with coroutine"
                                r6.<init>(r7)
                                throw r6
                            L39:
                                kotlin.ResultKt.b(r8)
                                kotlinx.coroutines.flow.FlowCollector r8 = r6.a
                                r2 = r7
                                java.util.List r2 = (java.util.List) r2
                                com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$lambda$0$$inlined$compareByDescending$1 r4 = new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$lambda$0$$inlined$compareByDescending$1
                                r4.<init>()
                                com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$lambda$0$$inlined$thenBy$1 r5 = new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$lambda$0$$inlined$thenBy$1
                                r5.<init>(r4)
                                java.util.List r2 = kotlin.collections.CollectionsKt.a1(r2, r5)
                                com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel r6 = r6.b
                                com.vinfast.companion.serviceskit.domain.model.TestDriveScheduleFlow r4 = com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel.a0(r6)
                                java.util.List r6 = com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel.Y(r6, r2, r4)
                                java.lang.Object r2 = kotlin.coroutines.jvm.internal.SpillingKt.a(r7)
                                r0.p = r2
                                java.lang.Object r2 = kotlin.coroutines.jvm.internal.SpillingKt.a(r0)
                                r0.r = r2
                                java.lang.Object r7 = kotlin.coroutines.jvm.internal.SpillingKt.a(r7)
                                r0.s = r7
                                java.lang.Object r7 = kotlin.coroutines.jvm.internal.SpillingKt.a(r8)
                                r0.t = r7
                                r7 = 0
                                r0.u = r7
                                r0.o = r3
                                java.lang.Object r6 = r8.emit(r6, r0)
                                if (r6 != r1) goto L7d
                                return r1
                            L7d:
                                kotlin.Unit r6 = kotlin.Unit.a
                                return r6
                            */
                            throw new UnsupportedOperationException("Method not decompiled: com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                        }
                    }

                    @Override // kotlinx.coroutines.flow.Flow
                    public java.lang.Object a(kotlinx.coroutines.flow.FlowCollector flowCollector, kotlin.coroutines.Continuation continuation) {
                        java.lang.Object objA = flowB.a(new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1$invokeSuspend$$inlined$map$1.AnonymousClass2(flowCollector, testDriveLocationStepViewModel), continuation);
                        return objA == kotlin.coroutines.intrinsics.IntrinsicsKt.g() ? objA : kotlin.Unit.a;
                    }
                }, kotlinx.coroutines.Dispatchers.b()), new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass2(this.q, null)), new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass3(this.q, null)), new com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1.AnonymousClass4(this.q, null));
                final com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel testDriveLocationStepViewModel2 = this.q;
                kotlinx.coroutines.flow.FlowCollector flowCollector = new kotlinx.coroutines.flow.FlowCollector() { // from class: com.vinfast.companion.main.ui.testdrive.locationstep.TestDriveLocationStepViewModel$getServiceCenters$1.5
                    @Override // kotlinx.coroutines.flow.FlowCollector
                    /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
                    public final java.lang.Object emit(java.util.List list, kotlin.coroutines.Continuation continuation) {
                        testDriveLocationStepViewModel2._serviceCenterLiveData.q(list);
                        testDriveLocationStepViewModel2._selectedServiceCenterLiveData.q(kotlin.collections.CollectionsKt.s0(list));
                        testDriveLocationStepViewModel2.i0();
                        return kotlin.Unit.a;
                    }
                };
                this.n = kotlin.coroutines.jvm.internal.SpillingKt.a(strQ0);
                this.o = kotlin.coroutines.jvm.internal.SpillingKt.a(province);
                this.p = 1;
                if (flowI.a(flowCollector, this) == objG) {
                    return objG;
                }
            } else {
                if (i != 1) {
                    throw new java.lang.IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                kotlin.ResultKt.b(obj);
            }
            return kotlin.Unit.a;
        }

        public final java.lang.Object invoke(kotlinx.coroutines.CoroutineScope coroutineScope, kotlin.coroutines.Continuation continuation) {
            return create(coroutineScope, continuation).invokeSuspend(kotlin.Unit.a);
        }
    }
