package com.vinfast.companion.serviceskit.data.repository;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes6.dex */
@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>", "", "Lkotlinx/coroutines/flow/FlowCollector;", "", "Lcom/vinfast/companion/serviceskit/domain/model/ServiceCenter;"}, k = 3, mv = {2, 2, 0}, xi = 48)
@kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProvider$getServiceCenters$1", f = "TestDriveRepositoryProvider.kt", l = {91, 98}, m = "invokeSuspend", v = 1)
@kotlin.jvm.internal.SourceDebugExtension
final class TestDriveRepositoryProvider$getServiceCenters$1 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> {
    java.lang.Object n;
    java.lang.Object o;
    int p;
    private /* synthetic */ java.lang.Object q;
    final /* synthetic */ com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProvider r;
    final /* synthetic */ java.lang.String s;
    final /* synthetic */ com.vinfast.companion.serviceskit.domain.model.Province t;
    final /* synthetic */ java.lang.Double u;
    final /* synthetic */ java.lang.Double v;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    TestDriveRepositoryProvider$getServiceCenters$1(com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProvider testDriveRepositoryProvider, java.lang.String str, com.vinfast.companion.serviceskit.domain.model.Province province, java.lang.Double d, java.lang.Double d2, kotlin.coroutines.Continuation continuation) {
        super(2, continuation);
        this.r = testDriveRepositoryProvider;
        this.s = str;
        this.t = province;
        this.u = d;
        this.v = d2;
    }

    /* 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) {
        com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProvider$getServiceCenters$1 testDriveRepositoryProvider$getServiceCenters$1 = new com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProvider$getServiceCenters$1(this.r, this.s, this.t, this.u, this.v, continuation);
        testDriveRepositoryProvider$getServiceCenters$1.q = obj;
        return testDriveRepositoryProvider$getServiceCenters$1;
    }

    /* JADX WARN: Code restructure failed: missing block: B:24:0x009f, code lost:
    
        if (r0.emit(r3, r11) == r1) goto L25;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.Object invokeSuspend(java.lang.Object r13) {
        /*
            r12 = this;
            java.lang.Object r0 = r12.q
            kotlinx.coroutines.flow.FlowCollector r0 = (kotlinx.coroutines.flow.FlowCollector) r0
            java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.g()
            int r2 = r12.p
            r3 = 0
            r4 = 2
            r5 = 1
            if (r2 == 0) goto L2d
            if (r2 == r5) goto L28
            if (r2 != r4) goto L20
            java.lang.Object r0 = r12.o
            java.util.List r0 = (java.util.List) r0
            java.lang.Object r12 = r12.n
            com.vinfast.companion.core.base.BaseResponse r12 = (com.vinfast.companion.core.base.BaseResponse) r12
            kotlin.ResultKt.b(r13)
            goto La2
        L20:
            java.lang.IllegalStateException r12 = new java.lang.IllegalStateException
            java.lang.String r13 = "call to 'resume' before 'invoke' with coroutine"
            r12.<init>(r13)
            throw r12
        L28:
            kotlin.ResultKt.b(r13)
            r11 = r12
            goto L53
        L2d:
            kotlin.ResultKt.b(r13)
            com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProvider r13 = r12.r
            com.vinfast.companion.serviceskit.data.api.TestDriveApi r6 = com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProvider.a(r13)
            java.lang.String r7 = r12.s
            com.vinfast.companion.serviceskit.domain.model.Province r13 = r12.t
            if (r13 == 0) goto L42
            java.lang.String r13 = r13.getId()
            r8 = r13
            goto L43
        L42:
            r8 = r3
        L43:
            java.lang.Double r9 = r12.u
            java.lang.Double r10 = r12.v
            r12.q = r0
            r12.p = r5
            r11 = r12
            java.lang.Object r13 = r6.K(r7, r8, r9, r10, r11)
            if (r13 != r1) goto L53
            goto La1
        L53:
            com.vinfast.companion.core.base.BaseResponse r13 = (com.vinfast.companion.core.base.BaseResponse) r13
            java.lang.Object r12 = r13.a()
            java.util.List r12 = (java.util.List) r12
            if (r12 == 0) goto L84
            com.vinfast.companion.serviceskit.domain.model.Province r2 = r11.t
            java.util.ArrayList r3 = new java.util.ArrayList
            r5 = 10
            int r5 = kotlin.collections.CollectionsKt.z(r12, r5)
            r3.<init>(r5)
            java.util.Iterator r12 = r12.iterator()
        L6e:
            boolean r5 = r12.hasNext()
            if (r5 == 0) goto L84
            java.lang.Object r5 = r12.next()
            com.vinfast.companion.serviceskit.domain.response.ServiceCenterTestDriveDto r5 = (com.vinfast.companion.serviceskit.domain.response.ServiceCenterTestDriveDto) r5
            com.vinfast.companion.serviceskit.domain.model.ServiceCenter$CREATOR r6 = com.vinfast.companion.serviceskit.domain.model.ServiceCenter.INSTANCE
            com.vinfast.companion.serviceskit.domain.model.ServiceCenter r5 = r6.b(r5, r2)
            r3.add(r5)
            goto L6e
        L84:
            kotlin.jvm.internal.Intrinsics.i(r3)
            java.lang.Object r12 = kotlin.coroutines.jvm.internal.SpillingKt.a(r0)
            r11.q = r12
            java.lang.Object r12 = kotlin.coroutines.jvm.internal.SpillingKt.a(r13)
            r11.n = r12
            java.lang.Object r12 = kotlin.coroutines.jvm.internal.SpillingKt.a(r3)
            r11.o = r12
            r11.p = r4
            java.lang.Object r12 = r0.emit(r3, r11)
            if (r12 != r1) goto La2
        La1:
            return r1
        La2:
            kotlin.Unit r12 = kotlin.Unit.a
            return r12
        */
        throw new UnsupportedOperationException("Method not decompiled: com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProvider$getServiceCenters$1.invokeSuspend(java.lang.Object):java.lang.Object");
    }
}
