package d0;

import dn.p;
import java.util.ArrayList;
import java.util.List;
import rm.n0;
import rm.y;
import tp.m0;
import y0.m;
import y0.p0;
import y0.q1;
import y0.s3;
import y0.y3;

/* loaded from: classes.dex */
public abstract class f {

    /* loaded from: classes.dex */
    static final class a extends kotlin.coroutines.jvm.internal.l implements p {

        /* renamed from: p, reason: collision with root package name */
        int f15708p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ j f15709q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ q1 f15710r;

        /* JADX INFO: Access modifiers changed from: package-private */
        /* renamed from: d0.f$a$a, reason: collision with other inner class name */
        /* loaded from: classes.dex */
        public static final class C0345a implements wp.f {

            /* renamed from: p, reason: collision with root package name */
            final /* synthetic */ List f15711p;

            /* renamed from: q, reason: collision with root package name */
            final /* synthetic */ q1 f15712q;

            C0345a(List list, q1 q1Var) {
                this.f15711p = list;
                this.f15712q = q1Var;
            }

            @Override // wp.f
            /* renamed from: b, reason: merged with bridge method [inline-methods] */
            public final Object emit(i iVar, vm.d dVar) {
                if (iVar instanceof d) {
                    this.f15711p.add(iVar);
                } else if (iVar instanceof e) {
                    this.f15711p.remove(((e) iVar).a());
                }
                this.f15712q.setValue(kotlin.coroutines.jvm.internal.b.a(!this.f15711p.isEmpty()));
                return n0.f34904a;
            }
        }

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(j jVar, q1 q1Var, vm.d dVar) {
            super(2, dVar);
            this.f15709q = jVar;
            this.f15710r = q1Var;
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final vm.d create(Object obj, vm.d dVar) {
            return new a(this.f15709q, this.f15710r, dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            Object f10;
            f10 = wm.d.f();
            int i10 = this.f15708p;
            if (i10 == 0) {
                y.b(obj);
                ArrayList arrayList = new ArrayList();
                wp.e a10 = this.f15709q.a();
                C0345a c0345a = new C0345a(arrayList, this.f15710r);
                this.f15708p = 1;
                if (a10.collect(c0345a, this) == f10) {
                    return f10;
                }
            } else {
                if (i10 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                y.b(obj);
            }
            return n0.f34904a;
        }

        @Override // dn.p
        public final Object invoke(m0 m0Var, vm.d dVar) {
            return ((a) create(m0Var, dVar)).invokeSuspend(n0.f34904a);
        }
    }

    public static final y3 a(j jVar, y0.m mVar, int i10) {
        if (y0.p.H()) {
            y0.p.Q(-1805515472, i10, -1, "androidx.compose.foundation.interaction.collectIsFocusedAsState (FocusInteraction.kt:64)");
        }
        Object f10 = mVar.f();
        m.a aVar = y0.m.f51621a;
        if (f10 == aVar.a()) {
            f10 = s3.d(Boolean.FALSE, null, 2, null);
            mVar.I(f10);
        }
        q1 q1Var = (q1) f10;
        int i11 = i10 & 14;
        boolean z10 = ((i11 ^ 6) > 4 && mVar.R(jVar)) || (i10 & 6) == 4;
        Object f11 = mVar.f();
        if (z10 || f11 == aVar.a()) {
            f11 = new a(jVar, q1Var, null);
            mVar.I(f11);
        }
        p0.d(jVar, (p) f11, mVar, i11);
        if (y0.p.H()) {
            y0.p.P();
        }
        return q1Var;
    }
}
