package z;

import Y4.InterfaceC0844j;
import androidx.compose.runtime.MutableState;
import java.util.ArrayList;
import w4.C3137A;

/* JADX INFO: renamed from: z.f, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C3286f implements InterfaceC0844j {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ ArrayList f26244b;

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

    public /* synthetic */ C3286f(ArrayList arrayList, MutableState mutableState, int i6) {
        this.f26243a = i6;
        this.f26244b = arrayList;
        this.f26245c = mutableState;
    }

    @Override // Y4.InterfaceC0844j
    public final Object emit(Object obj, A4.d dVar) {
        switch (this.f26243a) {
            case 0:
                InterfaceC3290j interfaceC3290j = (InterfaceC3290j) obj;
                boolean z6 = interfaceC3290j instanceof C3284d;
                ArrayList arrayList = this.f26244b;
                if (z6) {
                    arrayList.add(interfaceC3290j);
                } else if (interfaceC3290j instanceof C3285e) {
                    arrayList.remove(((C3285e) interfaceC3290j).f26242a);
                }
                this.f26245c.setValue(Boolean.valueOf(!arrayList.isEmpty()));
                break;
            default:
                InterfaceC3290j interfaceC3290j2 = (InterfaceC3290j) obj;
                boolean z7 = interfaceC3290j2 instanceof o;
                ArrayList arrayList2 = this.f26244b;
                if (z7) {
                    arrayList2.add(interfaceC3290j2);
                } else if (interfaceC3290j2 instanceof p) {
                    arrayList2.remove(((p) interfaceC3290j2).f26253a);
                } else if (interfaceC3290j2 instanceof n) {
                    arrayList2.remove(((n) interfaceC3290j2).f26251a);
                }
                this.f26245c.setValue(Boolean.valueOf(!arrayList2.isEmpty()));
                break;
        }
        return C3137A.f25453a;
    }
}
