package com.ss.android.ugc.aweme.ecommerce.delivery;

import X.0Bv;
import X.0CH;
import X.1hK;
import X.2Pr;
import X.2cN;
import X.5Am;
import X.5An;
import X.5vY;
import X.5wO;
import X.7he;
import X.B1N;
import X.B8T;
import X.C1835Aid;
import X.C1D;
import X.C1X;
import X.C1Z;
import X.C5486C1a;
import X.C5496C1k;
import X.C5497C1l;
import X.C5942CIo;
import X.Crj;
import X.Cwt;
import X.D1G;
import X.D4t;
import X.DRZ;
import X.DUT;
import X.DUy;
import X.DUz;
import X.DV9;
import X.DVU;
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.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.bytedance.covode.number.Covode;
import com.bytedance.jedi.arch.JediViewModel;
import com.bytedance.jedi.arch.lifecycleAwareLazy;
import com.ss.android.ugc.aweme.ecommerce.ab.EComLiveDegradeExperiment;
import com.ss.android.ugc.aweme.ecommerce.common.view.CommerceBottomSheetDialogFragment;
import com.ss.android.ugc.aweme.ecommerce.delivery.vm.DeliveryPanelViewModel;
import kotlin.h.b.n;

public final class DeliveryWrapperFragment extends CommerceBottomSheetDialogFragment implements B1N<C1835Aid>, 5vY {
    public static final C5496C1k LIZIZ = new C5496C1k((byte) 0);
    public final C1835Aid LIZ = new C1835Aid();
    public final lifecycleAwareLazy LIZJ;
    public final Crj LIZLLL;
    public SparseArray LJ;

    static {
        Covode.recordClassIndex(69845);
    }

    private final C1D LJIIIZ() {
        return (C1D) this.LIZLLL.getValue();
    }

    public final View LIZ(int i) {
        if (this.LJ == null) {
            this.LJ = new SparseArray();
        }
        View view = (View) this.LJ.get(i);
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i);
        this.LJ.put(i, findViewById);
        return findViewById;
    }

    public final void LIZJ() {
        SparseArray sparseArray = this.LJ;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final DeliveryPanelViewModel LJIIIIZZ() {
        return (DeliveryPanelViewModel) this.LIZJ.getValue();
    }

    public final boolean getUniqueOnlyGlobal() {
        return true;
    }

    public final /* bridge */ /* synthetic */ 0Bv be_() {
        return this.LIZ;
    }

    public final /* bridge */ /* synthetic */ 5An getReceiver() {
        return this;
    }

    public final C5942CIo LJII() {
        return LJIIIZ();
    }

    public final 0CH getLifecycleOwner() {
        5wO.LIZJ(this);
        return this;
    }

    public final DUz getLifecycleOwnerHolder() {
        5wO.LIZ(this);
        return this;
    }

    public final DUy<DVU> getReceiverHolder() {
        5wO.LIZIZ(this);
        return this;
    }

    public final boolean LIZ() {
        return EComLiveDegradeExperiment.LIZ().getPageAnimDegrade();
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [com.ss.android.ugc.aweme.ecommerce.common.view.CommerceBottomSheetDialogFragment, com.ss.android.ugc.aweme.ecommerce.common.view.ECBaseBottomSheetDialogFragment, com.ss.android.ugc.aweme.ecommerce.delivery.DeliveryWrapperFragment] */
    public final void onDestroyView() {
        DeliveryWrapperFragment.super.onDestroyView();
        LJIIIZ().LIZLLL();
        LIZJ();
    }

    public final void onStop() {
        DeliveryWrapperFragment.super.onStop();
        LJIIIZ().LIZIZ();
    }

    public DeliveryWrapperFragment() {
        super((byte) 0);
        D1G LIZ2 = KEM.LIZ.LIZ(DeliveryPanelViewModel.class);
        C5486C1a c1a = new C5486C1a(LIZ2);
        this.LIZJ = new lifecycleAwareLazy(this, c1a, new C1X(this, c1a, LIZ2, C1Z.INSTANCE));
        this.LIZLLL = 7he.LIZ(new C5497C1l(this));
    }

    public final void onCancel(DialogInterface dialogInterface) {
        M12.LIZ(dialogInterface);
        DeliveryWrapperFragment.super.onCancel(dialogInterface);
        LJIIIZ().LJ();
    }

    public final void onCreate(Bundle bundle) {
        DeliveryWrapperFragment.super.onCreate(bundle);
        LJIIIZ().LIZ();
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.ss.android.ugc.aweme.ecommerce.common.view.ECBaseBottomSheetDialogFragment, com.ss.android.ugc.aweme.ecommerce.delivery.DeliveryWrapperFragment] */
    public final Dialog onCreateDialog(Bundle bundle) {
        Dialog onCreateDialog = DeliveryWrapperFragment.super.onCreateDialog(bundle);
        LJIIIZ().LIZ(onCreateDialog);
        return onCreateDialog;
    }

    public final void onActivityCreated(Bundle bundle) {
        DeliveryWrapperFragment.super.onActivityCreated(bundle);
        LJIIIZ().LIZJ();
        1hK activity = getActivity();
        if (activity != null) {
            C1D LJIIIZ = LJIIIZ();
            n.LIZIZ(activity, "");
            LJIIIZ.LIZ(activity, bundle);
        }
    }

    public final void onSaveInstanceState(Bundle bundle) {
        M12.LIZ(bundle);
        DeliveryWrapperFragment.super.onSaveInstanceState(bundle);
        1hK activity = getActivity();
        if (activity != null) {
            C1D LJIIIZ = LJIIIZ();
            n.LIZIZ(activity, "");
            LJIIIZ.LIZIZ(activity, bundle);
        }
    }

    public final <VM1 extends JediViewModel<S1>, S1 extends 5Am, R> R withState(VM1 vm1, LsC<? super S1, ? extends R> lsC) {
        M12.LIZ(vm1, lsC);
        return 5wO.LIZ(vm1, lsC);
    }

    public final <S extends 5Am> 2cN subscribe(JediViewModel<S> jediViewModel, DUT<S> dut, LsD<? super DVU, ? super S, 2Pr> lsD) {
        M12.LIZ(jediViewModel, dut, lsD);
        return 5wO.LIZ(this, jediViewModel, dut, lsD);
    }

    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        M12.LIZ(layoutInflater);
        return LJIIIZ().LIZ(layoutInflater, viewGroup);
    }

    public final <S extends 5Am, A> 2cN selectSubscribe(JediViewModel<S> jediViewModel, PHD<S, ? extends A> phd, DUT<DRZ<A>> dut, LsD<? super DVU, ? super A, 2Pr> lsD) {
        M12.LIZ(jediViewModel, phd, dut, lsD);
        return 5wO.LIZ(this, jediViewModel, phd, dut, lsD);
    }

    public final <S extends 5Am, A, B> 2cN selectSubscribe(JediViewModel<S> jediViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, DUT<Cwt<A, B>> dut, LsE<? super DVU, ? super A, ? super B, 2Pr> lsE) {
        M12.LIZ(jediViewModel, phd, phd2, dut, lsE);
        return 5wO.LIZ(this, jediViewModel, phd, phd2, dut, lsE);
    }

    public final <S extends 5Am, T> 2cN asyncSubscribe(JediViewModel<S> jediViewModel, PHD<S, ? extends B8T<? extends T>> phd, DUT<DRZ<B8T<T>>> dut, LsD<? super DVU, ? super Throwable, 2Pr> lsD, LsC<? super DVU, 2Pr> lsC, LsD<? super DVU, ? super T, 2Pr> lsD2) {
        M12.LIZ(jediViewModel, phd, dut);
        return 5wO.LIZ(this, jediViewModel, phd, dut, lsD, lsC, lsD2);
    }

    public final <S extends 5Am, A, B, C> 2cN selectSubscribe(JediViewModel<S> jediViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, PHD<S, ? extends C> phd3, DUT<DV9<A, B, C>> dut, LsF<? super DVU, ? super A, ? super B, ? super C, 2Pr> lsF) {
        M12.LIZ(jediViewModel, phd, phd2, phd3, dut, lsF);
        return 5wO.LIZ(this, jediViewModel, phd, phd2, phd3, dut, lsF);
    }

    public final <S extends 5Am, A, B, C, D> 2cN selectSubscribe(JediViewModel<S> jediViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, PHD<S, ? extends C> phd3, PHD<S, ? extends D> phd4, DUT<D4t<A, B, C, D>> dut, Lsh<? super DVU, ? super A, ? super B, ? super C, ? super D, 2Pr> lsh) {
        M12.LIZ(jediViewModel, phd, phd2, phd3, phd4, dut, lsh);
        return 5wO.LIZ(this, jediViewModel, phd, phd2, phd3, phd4, dut, lsh);
    }
}
