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

import X.070;
import X.0A9;
import X.0AA;
import X.0Bv;
import X.0CH;
import X.0HH;
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.BTH;
import X.C04;
import X.C08;
import X.C09;
import X.C0A;
import X.C0C;
import X.C0D;
import X.C0E;
import X.C0I;
import X.C0J;
import X.C0L;
import X.C0M;
import X.C0N;
import X.C0O;
import X.C0P;
import X.C0Q;
import X.C1835Aid;
import X.C3074B6g;
import X.C5339By3;
import X.C5432BzY;
import X.C6474CbG;
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.DV0;
import X.DV9;
import X.DVU;
import X.HeD;
import X.KEM;
import X.Ls2;
import X.LsC;
import X.LsD;
import X.LsE;
import X.LsF;
import X.Lsh;
import X.M12;
import X.OQM;
import X.PHD;
import android.content.Context;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.covode.number.Covode;
import com.bytedance.jedi.arch.JediViewModel;
import com.ss.android.ugc.aweme.ecommerce.delivery.vm.DeliveryPanelViewModel;
import kotlin.h.b.n;

public final class LogisticSelectFragment extends Fragment implements B1N<C1835Aid>, 5vY {
    public static final C0Q LIZIZ = new C0Q((byte) 0);
    public final C1835Aid LIZ = new C1835Aid();
    public final Crj LIZJ;
    public final Crj LIZLLL;
    public final Ls2<2Pr> LJ;
    public SparseArray LJFF;

    static {
        Covode.recordClassIndex(69939);
    }

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

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

    public final LogisticAdapter LIZJ() {
        return (LogisticAdapter) this.LIZLLL.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 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 void onDestroyView() {
        LogisticSelectFragment.super.onDestroyView();
        0AA fragmentManager = getFragmentManager();
        if (fragmentManager != null) {
            Ls2<2Pr> ls2 = this.LJ;
            if (ls2 != null) {
                ls2 = new C0P(ls2);
            }
            fragmentManager.LIZIZ((0A9) ls2);
        }
        SparseArray sparseArray = this.LJFF;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public LogisticSelectFragment() {
        D1G LIZ2 = KEM.LIZ.LIZ(DeliveryPanelViewModel.class);
        this.LIZJ = 7he.LIZ(new C3074B6g(this, LIZ2, LIZ2));
        this.LIZLLL = 7he.LIZ(new C0J(this));
        this.LJ = new C0A(this);
    }

    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);
    }

    /* JADX WARNING: type inference failed for: r1v4, types: [android.view.View, java.lang.Object, X.CbG] */
    /* JADX WARNING: type inference failed for: r0v5, types: [android.view.View$OnClickListener, X.C09] */
    public final void onViewCreated(View view, Bundle bundle) {
        M12.LIZ(view);
        LogisticSelectFragment.super.onViewCreated(view, bundle);
        OQM LIZ2 = LIZ(2131371248);
        n.LIZIZ(LIZ2, "");
        ImageView startBtn = LIZ2.getStartBtn();
        n.LIZIZ(startBtn, "");
        startBtn.setVisibility(8);
        LIZ(2131371248).setOnTitleBarClickListener(new C08(this));
        ? r1 = (C6474CbG) LIZ(2131362796);
        n.LIZIZ(r1, "");
        r1.setOnClickListener(new C09(this));
        Context context = getContext();
        if (context != null) {
            RecyclerView LIZ3 = LIZ(2131369388);
            n.LIZIZ(LIZ3, "");
            LIZ3.setAdapter(LIZJ());
            RecyclerView LIZ4 = LIZ(2131369388);
            n.LIZIZ(LIZ4, "");
            LIZ4.setLayoutManager(new LinearLayoutManager());
            LIZ(2131369388).LIZ(new BTH(070.LIZJ(context, 2131099719), 0, HeD.LIZIZ(context, 16.0f), 2));
        }
        0AA fragmentManager = getFragmentManager();
        if (fragmentManager != null) {
            Ls2<2Pr> ls2 = this.LJ;
            if (ls2 != null) {
                ls2 = new C0P(ls2);
            }
            fragmentManager.LIZ((0A9) ls2);
        }
        DV0.LIZ(this, LIZIZ(), C0M.LIZ, new C0D(this));
        DV0.LIZ(this, LIZIZ(), C0N.LIZ, new C5339By3(this));
        DV0.LIZ(this, LIZIZ(), C0I.LIZ, new C0E(this));
        DV0.LIZ(this, LIZIZ(), C5432BzY.LIZ, new C04(this));
        DV0.LIZ(this, LIZIZ(), C0O.LIZ, C0L.LIZ, new C0C(this));
        LIZIZ().LIZ(getContext());
    }

    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 0HH.LIZ(layoutInflater, 2131559057, viewGroup, false);
    }

    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);
    }
}
