package j2;

import Y4.C0841g;
import Y4.InterfaceC0843i;
import androidx.compose.runtime.MutableFloatState;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.State;
import androidx.navigation.C1137l;
import java.util.List;
import java.util.concurrent.CancellationException;
import m3.AbstractC2467b;
import w4.C3137A;
import x4.AbstractC3251q;

/* JADX INFO: renamed from: j2.s, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C2341s extends C4.j implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public int f19520a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public /* synthetic */ Object f19521b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ C2330h f19522c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ State f19523d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ MutableFloatState f19524e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ MutableState f19525f;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C2341s(C2330h c2330h, State state, MutableFloatState mutableFloatState, MutableState mutableState, A4.d dVar) {
        super(2, dVar);
        this.f19522c = c2330h;
        this.f19523d = state;
        this.f19524e = mutableFloatState;
        this.f19525f = mutableState;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        C2341s c2341s = new C2341s(this.f19522c, this.f19523d, this.f19524e, this.f19525f, dVar);
        c2341s.f19521b = obj;
        return c2341s;
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        return ((C2341s) create((InterfaceC0843i) obj, (A4.d) obj2)).invokeSuspend(C3137A.f25453a);
    }

    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        C1137l c1137l;
        C1137l c1137l2;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f19520a;
        C2330h c2330h = this.f19522c;
        State state = this.f19523d;
        MutableState mutableState = this.f19525f;
        try {
            if (i6 == 0) {
                AbstractC2467b.l(obj);
                InterfaceC0843i interfaceC0843i = (InterfaceC0843i) this.f19521b;
                int size = ((List) state.getValue()).size();
                MutableFloatState mutableFloatState = this.f19524e;
                if (size > 1) {
                    mutableFloatState.setFloatValue(0.0f);
                    c1137l = (C1137l) AbstractC3251q.o0((List) state.getValue());
                    kotlin.jvm.internal.o.e(c1137l);
                    c2330h.g(c1137l);
                    c2330h.g((C1137l) ((List) state.getValue()).get(((List) state.getValue()).size() - 2));
                } else {
                    c1137l = null;
                }
                C0841g c0841g = new C0841g(state, mutableState, mutableFloatState, 3);
                this.f19521b = c1137l;
                this.f19520a = 1;
                if (interfaceC0843i.collect(c0841g, this) == aVar) {
                    return aVar;
                }
                c1137l2 = c1137l;
            } else {
                if (i6 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                c1137l2 = (C1137l) this.f19521b;
                AbstractC2467b.l(obj);
            }
            if (((List) state.getValue()).size() > 1) {
                mutableState.setValue(Boolean.FALSE);
                kotlin.jvm.internal.o.e(c1137l2);
                c2330h.e(c1137l2, false);
            }
        } catch (CancellationException unused) {
            if (((List) state.getValue()).size() > 1) {
                mutableState.setValue(Boolean.FALSE);
            }
        }
        return C3137A.f25453a;
    }
}
