package h3;

import androidx.compose.runtime.MutableIntState;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.State;
import com.debridstream.tv.HomeSection;
import java.util.HashMap;
import java.util.List;
import w4.C3137A;
import x4.AbstractC3251q;
import x4.AbstractC3252r;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class T4 implements J4.a {

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final /* synthetic */ MutableState f17431k;
    public final /* synthetic */ MutableState l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final /* synthetic */ MutableIntState f17432m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final /* synthetic */ MutableIntState f17433n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final /* synthetic */ Object f17434o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final /* synthetic */ Object f17435p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final /* synthetic */ Object f17436q;

    public /* synthetic */ T4(List list, V4.C c6, List list2, MutableIntState mutableIntState, State state, MutableState mutableState, MutableIntState mutableIntState2, State state2, MutableState mutableState2, MutableState mutableState3, MutableIntState mutableIntState3, MutableIntState mutableIntState4, C2220x4 c2220x4) {
        this.f17425b = list;
        this.f17434o = c6;
        this.f17435p = list2;
        this.f17426c = mutableIntState;
        this.f17427d = state;
        this.f17428e = mutableState;
        this.f17429f = mutableIntState2;
        this.f17430j = state2;
        this.f17431k = mutableState2;
        this.l = mutableState3;
        this.f17432m = mutableIntState3;
        this.f17433n = mutableIntState4;
        this.f17436q = c2220x4;
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // J4.a
    public final Object invoke() {
        C3137A c3137a = C3137A.f25453a;
        Object obj = this.f17435p;
        Object obj2 = this.f17434o;
        Object obj3 = this.f17436q;
        MutableIntState mutableIntState = this.f17432m;
        MutableState mutableState = this.l;
        MutableIntState mutableIntState2 = this.f17433n;
        MutableState mutableState2 = this.f17431k;
        State state = this.f17430j;
        List list = this.f17425b;
        MutableIntState mutableIntState3 = this.f17429f;
        MutableState mutableState3 = this.f17428e;
        State state2 = this.f17427d;
        MutableIntState mutableIntState4 = this.f17426c;
        switch (this.f17424a) {
            case 0:
                float f6 = n5.f18281a;
                HashMap map = (HashMap) obj3;
                if (mutableIntState4.getIntValue() == -1) {
                    n5.t(mutableState3, false);
                    if (!((List) state2.getValue()).isEmpty()) {
                        mutableIntState4.setIntValue(-2);
                        mutableIntState3.setIntValue(L4.a.v(mutableIntState3.getIntValue(), 0, AbstractC3252r.A((List) state2.getValue())));
                        mutableIntState.setIntValue(0);
                        mutableIntState2.setIntValue(0);
                    } else {
                        mutableIntState4.setIntValue(0);
                        int iA = Y4.a(list, map, state, 0);
                        mutableIntState.setIntValue(iA);
                        mutableIntState2.setIntValue(iA);
                    }
                } else if (mutableIntState4.getIntValue() != -2) {
                    n5.s((MutableState) obj2, (MutableState) obj);
                    n5.r(mutableState2, mutableState);
                    int intValue = mutableIntState4.getIntValue();
                    int intValue2 = mutableIntState2.getIntValue();
                    HomeSection homeSection = (HomeSection) AbstractC3251q.h0(intValue, list);
                    if (homeSection != null) {
                        map.put(homeSection.getId(), Integer.valueOf(intValue2));
                    }
                    boolean z6 = mutableIntState4.getIntValue() >= AbstractC3252r.A(list);
                    n5.t(mutableState3, z6);
                    int intValue3 = z6 ? 0 : mutableIntState4.getIntValue() + 1;
                    mutableIntState4.setIntValue(intValue3);
                    int iA2 = Y4.a(list, map, state, intValue3);
                    mutableIntState.setIntValue(iA2);
                    mutableIntState2.setIntValue(iA2);
                } else {
                    n5.r(mutableState2, mutableState);
                    n5.t(mutableState3, false);
                    mutableIntState4.setIntValue(0);
                    int iA3 = Y4.a(list, map, state, 0);
                    mutableIntState.setIntValue(iA3);
                    mutableIntState2.setIntValue(iA3);
                }
                break;
            default:
                float f7 = n5.f18281a;
                if (mutableIntState4.getIntValue() != -2) {
                    HomeSection homeSection2 = (HomeSection) AbstractC3251q.h0(mutableIntState4.getIntValue(), list);
                    if (homeSection2 != null) {
                        int i6 = ((Boolean) ((J4.c) state.getValue()).invoke(homeSection2)).booleanValue() ? 19 : 30;
                        int i7 = homeSection2.getItems().size() > i6 ? i6 : -1;
                        if (((Boolean) mutableState2.getValue()).booleanValue() && i7 >= 0) {
                            n5.s(mutableState, mutableState2);
                            mutableIntState.setIntValue(0);
                            mutableIntState2.setIntValue(i7);
                            V4.E.y((V4.C) obj2, null, null, new X4((C2220x4) obj3, homeSection2, i7, null), 3);
                        } else {
                            n5.s(mutableState, mutableState2);
                            List listV = (List) obj;
                            if (listV.isEmpty()) {
                                listV = n5.v(i6, homeSection2.getItems(), homeSection2.getId());
                            }
                            if (!listV.isEmpty()) {
                                mutableIntState.setIntValue(mutableIntState2.getIntValue());
                                mutableIntState2.setIntValue(mutableIntState2.getIntValue() <= 0 ? 0 : mutableIntState2.getIntValue() - 1);
                            }
                        }
                    }
                } else if (((List) state2.getValue()).size() > 0 && !((Boolean) mutableState3.getValue()).booleanValue() && mutableIntState3.getIntValue() > 0) {
                    mutableIntState3.setIntValue(mutableIntState3.getIntValue() - 1);
                }
                break;
        }
        return c3137a;
    }

    public /* synthetic */ T4(List list, MutableIntState mutableIntState, MutableState mutableState, State state, MutableIntState mutableIntState2, MutableIntState mutableIntState3, MutableIntState mutableIntState4, HashMap map, State state2, MutableState mutableState2, MutableState mutableState3, MutableState mutableState4, MutableState mutableState5) {
        this.f17425b = list;
        this.f17426c = mutableIntState;
        this.f17428e = mutableState;
        this.f17427d = state;
        this.f17429f = mutableIntState2;
        this.f17432m = mutableIntState3;
        this.f17433n = mutableIntState4;
        this.f17436q = map;
        this.f17430j = state2;
        this.f17431k = mutableState2;
        this.l = mutableState3;
        this.f17434o = mutableState4;
        this.f17435p = mutableState5;
    }
}
