package com.ss.android.ugc.aweme.relation.auth.widget.cell;

import X.0C0;
import X.0CH;
import X.0Q2;
import X.1hK;
import X.3EX;
import X.4kD;
import X.7he;
import X.AnK;
import X.BTA;
import X.C0295Crj;
import X.C1392DXo;
import X.C1395DXr;
import X.C1826Dfy;
import X.C3053Dzl;
import X.C3054Dzm;
import X.C3055Dzn;
import X.C3057Dzp;
import X.C3058Dzq;
import X.C3059Dzr;
import X.C3060Dzs;
import X.C3157E3l;
import X.C3159E3n;
import X.C4213EdN;
import X.DYD;
import X.E4R;
import X.E4U;
import X.ESC;
import X.M12;
import X.QHW;
import X.QJt;
import X.Qeg;
import android.content.Context;
import android.view.View;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.powerlist.PowerCell;
import com.ss.android.ugc.aweme.im.sdk.u16.controller.IMUnder16ProxyImpl;
import com.ss.android.ugc.aweme.profile.model.User;
import kotlin.h.b.n;

public abstract class AuthMaFPowerCell<T extends C3060Dzs> extends PowerCell<T> {
    public final C0295Crj LIZ = 7he.LIZ(new C3058Dzq(this));
    public final C0295Crj LIZIZ = 7he.LIZ(new C3057Dzp(this));
    public C4213EdN LJIIIZ;
    public Qeg LJIIJ;
    public Qeg LJIIJJI;
    public E4R LJIIL;

    static {
        Covode.recordClassIndex(102550);
    }

    private final Fragment LIZ() {
        return (Fragment) this.LIZ.getValue();
    }

    private final 1hK LIZIZ() {
        return (1hK) this.LIZIZ.getValue();
    }

    public final int bB_() {
        return 2131558559;
    }

    public final void bD_() {
        super.bD_();
        View findViewById = this.itemView.findViewById(2131362546);
        n.LIZIZ(findViewById, "");
        this.LJIIIZ = (C4213EdN) findViewById;
        Qeg findViewById2 = this.itemView.findViewById(2131368820);
        n.LIZIZ(findViewById2, "");
        this.LJIIJ = findViewById2;
        Qeg findViewById3 = this.itemView.findViewById(2131369976);
        n.LIZIZ(findViewById3, "");
        this.LJIIJJI = findViewById3;
        View findViewById4 = this.itemView.findViewById(2131365093);
        n.LIZIZ(findViewById4, "");
        this.LJIIL = (E4R) findViewById4;
        0Q2 r2 = 0Q2.LIZ;
        View view = this.itemView;
        n.LIZIZ(view, "");
        r2.LIZIZ(view, new C3055Dzn(this));
    }

    public final void LIZ(T t, String str) {
        T t2 = t;
        String str2 = str;
        M12.LIZ(t2, str2);
        C3059Dzr dzr = t2.LIZ;
        User LIZ2 = t2.LIZ();
        new AnK(dzr.LIZ, LIZ2, dzr.LIZJ, dzr.LIZIZ, dzr.LIZLLL, Integer.valueOf(t2.LIZIZ()), str2).LIZJ();
        C3157E3l e3l = new C3157E3l();
        e3l.LIZ(dzr.LIZ);
        e3l.LJIIZILJ(dzr.LIZIZ);
        e3l.LIZ = E4U.CARD;
        e3l.LIZIZ = C3159E3n.ENTER_PROFILE;
        e3l.LIZ(LIZ2);
        e3l.LJFF();
        DYD LIZJ = C1826Dfy.LIZ.LIZJ();
        View view = this.itemView;
        n.LIZIZ(view, "");
        Context context = view.getContext();
        n.LIZIZ(context, "");
        LIZJ.LIZ(context, LIZ2, dzr.LIZ, dzr.LIZLLL, dzr.LIZIZ, dzr.LIZJ);
    }

    public final void LIZ(User user, C3059Dzr dzr) {
        boolean z;
        C1395DXr dXr;
        M12.LIZ(user, dzr);
        QJt LIZ2 = QHW.LIZ(3EX.LIZ(user.getAvatarThumb()));
        C4213EdN edN = this.LJIIIZ;
        if (edN == null) {
            n.LIZ("");
        }
        LIZ2.LJJIIZ = edN;
        LIZ2.LIZ("Widget");
        LIZ2.LIZJ();
        Qeg qeg = this.LJIIJ;
        if (qeg == null) {
            n.LIZ("");
        }
        qeg.setText(user.getNickname());
        Qeg qeg2 = this.LJIIJJI;
        if (qeg2 == null) {
            n.LIZ("");
        }
        qeg2.setText(ESC.LIZJ(user));
        View view = this.itemView;
        n.LIZIZ(view, "");
        Context context = view.getContext();
        String customVerify = user.getCustomVerify();
        String enterpriseVerifyReason = user.getEnterpriseVerifyReason();
        Qeg qeg3 = this.LJIIJJI;
        if (qeg3 == null) {
            n.LIZ("");
        }
        BTA.LIZ(context, customVerify, enterpriseVerifyReason, qeg3);
        if (IMUnder16ProxyImpl.LJ().LIZ() || 4kD.LIZ.LIZ()) {
            z = false;
            dXr = C1395DXr.FRIENDS;
        } else {
            z = true;
            dXr = C1395DXr.MESSAGE;
        }
        E4R e4r = this.LJIIL;
        if (e4r == null) {
            n.LIZ("");
        }
        C1392DXo dXo = new C1392DXo();
        1hK LIZ3 = LIZ();
        if (LIZ3 == null) {
            LIZ3 = LIZIZ();
        }
        dXo.LIZLLL = (0CH) LIZ3;
        1hK LIZ4 = LIZ();
        if (LIZ4 == null) {
            LIZ4 = LIZIZ();
        }
        dXo.LJ = (0C0) LIZ4;
        dXo.LIZ = user;
        dXo.LIZIZ = z;
        dXo.LIZ(dXr);
        dXo.LIZJ = true;
        e4r.LIZ(dXo.LIZ());
        E4R e4r2 = this.LJIIL;
        if (e4r2 == null) {
            n.LIZ("");
        }
        e4r2.setDataChangeListener(new C3054Dzm(user));
        E4R e4r3 = this.LJIIL;
        if (e4r3 == null) {
            n.LIZ("");
        }
        e4r3.setTracker(new C3053Dzl(dzr, this, user));
    }
}
