package com.ss.android.ugc.aweme.discover.ui.bottomsheet.filter.powerlist;

import X.0CH;
import X.0HH;
import X.2Pr;
import X.3D4;
import X.3Yi;
import X.4HR;
import X.4hP;
import X.7he;
import X.A8K;
import X.A8L;
import X.A8M;
import X.A8N;
import X.A8O;
import X.A8P;
import X.A8Q;
import X.A8R;
import X.A8S;
import X.AOI;
import X.AOJ;
import X.AOK;
import X.AOL;
import X.AOM;
import X.AON;
import X.AOO;
import X.AOP;
import X.ARD;
import X.ARE;
import X.AVK;
import X.Crj;
import X.Csa;
import X.Csw;
import X.Csy;
import X.Ct1;
import X.Cuh;
import X.Cv8;
import X.Cvh;
import X.CwK;
import X.CwU;
import X.Cwc;
import X.Cwf;
import X.D1G;
import X.DaP;
import X.KEM;
import X.LsC;
import X.LsD;
import X.LsE;
import X.LsF;
import X.Lsh;
import X.M12;
import X.PHD;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.bytedance.assem.arch.viewModel.AssemViewModel;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.powerlist.PowerCell;
import com.ss.android.ugc.aweme.discover.ui.bottomsheet.filter.SearchFilterViewModel;
import java.util.Map;
import kotlin.h.b.n;

public final class SwitchCell extends PowerCell<AOM> implements ARE {
    public final Csa LIZ;
    public final Crj LIZIZ;

    static {
        Covode.recordClassIndex(65794);
    }

    private final 3Yi LIZIZ() {
        return (3Yi) this.LIZIZ.getValue();
    }

    public final SearchFilterViewModel LIZ() {
        return (SearchFilterViewModel) this.LIZ.getValue();
    }

    public final 0CH getActualLifecycleOwner() {
        ARD.LIZIZ(this);
        return this;
    }

    public final Cv8 getActualLifecycleOwnerHolder() {
        ARD.LIZ(this);
        return this;
    }

    public final 4hP getActualReceiver() {
        ARD.LIZLLL(this);
        return this;
    }

    public final Cuh<4hP> getActualReceiverHolder() {
        ARD.LIZJ(this);
        return this;
    }

    public final 0CH getHostLifecycleOwner() {
        M12.LIZ(this);
        return null;
    }

    public final 0CH getOwnLifecycleOwner() {
        ARD.LJ(this);
        return this;
    }

    public final 4hP getReceiverForHostVM() {
        M12.LIZ(this);
        return null;
    }

    public final boolean getUniqueOnlyDefault() {
        return ARD.LJFF(this);
    }

    public SwitchCell() {
        Csa csa;
        Csw csw = Csw.LIZ;
        D1G LIZ2 = KEM.LIZ.LIZ(SearchFilterViewModel.class);
        A8R a8r = new A8R(LIZ2);
        A8S a8s = A8S.INSTANCE;
        if (n.LIZ(csw, Csw.LIZ)) {
            csa = new Csa(LIZ2, a8r, AOK.INSTANCE, new A8L(this), new A8K(this), AOP.INSTANCE, a8s);
        } else if (n.LIZ(csw, Csy.LIZ)) {
            csa = new Csa(LIZ2, a8r, AOL.INSTANCE, new A8N(this), new A8M(this), AOO.INSTANCE, a8s);
        } else if (csw != null && !n.LIZ(csw, Ct1.LIZ)) {
            throw new IllegalArgumentException("Don't support this VMScope: " + csw + " there");
        } else {
            csa = new Csa(LIZ2, a8r, AOJ.INSTANCE, new A8Q(this), new A8O(this), new A8P(this), a8s);
        }
        this.LIZ = csa;
        this.LIZIZ = 7he.LIZ(new AON(this));
    }

    public final View LIZ(ViewGroup viewGroup) {
        M12.LIZ(viewGroup);
        View LIZ2 = 0HH.LIZ(LayoutInflater.from(viewGroup.getContext()), 2131561127, viewGroup, false);
        n.LIZIZ(LIZ2, "");
        return LIZ2;
    }

    public final /* synthetic */ void LIZ(DaP daP) {
        Boolean bool;
        AOM aom = (AOM) daP;
        M12.LIZ(aom);
        SwitchCell.super.LIZ(aom);
        LIZIZ().setTitle(aom.LIZ.getName());
        if (aom.LIZ.getDescription() != null) {
            LIZIZ().setSubtitle(aom.LIZ.getDescription());
        }
        3Yi LIZIZ2 = LIZIZ();
        View view = this.itemView;
        n.LIZIZ(view, "");
        Context context = view.getContext();
        n.LIZIZ(context, "");
        3D4 r3 = new 3D4(context);
        SearchFilterViewModel LIZ2 = LIZ();
        AVK avk = aom.LIZ;
        M12.LIZ(avk);
        Map<AVK, Boolean> map = LIZ2.LJII;
        if (map != null) {
            bool = map.get(avk);
        } else {
            bool = null;
        }
        boolean z = true;
        if (!n.LIZ(bool, true)) {
            z = false;
        }
        r3.LIZJ(z);
        r3.LIZ(new AOI(r3, this, aom));
        LIZIZ2.setAccessory(r3);
    }

    public final <S extends 4HR> void subscribe(AssemViewModel<S> assemViewModel, Cvh<S> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super S, 2Pr> lsD) {
        M12.LIZ(assemViewModel, cvh, lsD);
        ARD.LIZ(this, assemViewModel, cvh, lsC, lsD);
    }

    public final <S extends 4HR, A> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, Cvh<CwK<A>> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super A, 2Pr> lsD) {
        M12.LIZ(assemViewModel, phd, cvh, lsD);
        ARD.LIZ(this, assemViewModel, phd, cvh, lsC, lsD);
    }

    public final <S extends 4HR, A> void selectSubscribeOnAsync(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, Cvh<CwK<A>> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super A, 2Pr> lsD) {
        M12.LIZ(assemViewModel, phd, cvh, lsD);
        ARD.LIZIZ(this, assemViewModel, phd, cvh, lsC, lsD);
    }

    public final <S extends 4HR, A, B> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, Cvh<CwU<A, B>> cvh, LsC<? super Throwable, 2Pr> lsC, LsE<? super 4hP, ? super A, ? super B, 2Pr> lsE) {
        M12.LIZ(assemViewModel, phd, phd2, cvh, lsE);
        ARD.LIZ(this, assemViewModel, phd, phd2, cvh, lsC, lsE);
    }

    public final <S extends 4HR, A, B, C> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, PHD<S, ? extends C> phd3, Cvh<Cwc<A, B, C>> cvh, LsC<? super Throwable, 2Pr> lsC, LsF<? super 4hP, ? super A, ? super B, ? super C, 2Pr> lsF) {
        LsF<? super 4hP, ? super A, ? super B, ? super C, 2Pr> lsF2 = lsF;
        AssemViewModel<S> assemViewModel2 = assemViewModel;
        PHD<S, ? extends A> phd4 = phd;
        PHD<S, ? extends B> phd5 = phd2;
        PHD<S, ? extends C> phd6 = phd3;
        Cvh<Cwc<A, B, C>> cvh2 = cvh;
        M12.LIZ(assemViewModel2, phd4, phd5, phd6, cvh2, lsF2);
        ARD.LIZ(this, assemViewModel2, phd4, phd5, phd6, cvh2, lsC, lsF2);
    }

    public final <S extends 4HR, A, B, C, D> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, PHD<S, ? extends C> phd3, PHD<S, ? extends D> phd4, Cvh<Cwf<A, B, C, D>> cvh, LsC<? super Throwable, 2Pr> lsC, Lsh<? super 4hP, ? super A, ? super B, ? super C, ? super D, 2Pr> lsh) {
        Lsh<? super 4hP, ? super A, ? super B, ? super C, ? super D, 2Pr> lsh2 = lsh;
        AssemViewModel<S> assemViewModel2 = assemViewModel;
        PHD<S, ? extends A> phd5 = phd;
        PHD<S, ? extends B> phd6 = phd2;
        PHD<S, ? extends C> phd7 = phd3;
        PHD<S, ? extends D> phd8 = phd4;
        Cvh<Cwf<A, B, C, D>> cvh2 = cvh;
        M12.LIZ(assemViewModel2, phd5, phd6, phd7, phd8, cvh2, lsh2);
        ARD.LIZ(this, assemViewModel2, phd5, phd6, phd7, phd8, cvh2, lsC, lsh2);
    }
}
