package com.ss.android.ugc.aweme.im.sdk.chat.feature.quickinteraction.fragment;

import X.2GO;
import X.3Q4;
import X.3S8;
import X.7he;
import X.C0988Iap;
import X.C1372Ih1;
import X.C1446IiD;
import X.C1448IiF;
import X.C1449IiG;
import X.C1450IiH;
import X.C1454IiL;
import X.C1456IiN;
import X.C1458IiP;
import X.C1797Ins;
import X.Crj;
import X.CsY;
import X.KEM;
import X.M12;
import android.os.Bundle;
import android.view.View;
import com.bytedance.covode.number.Covode;
import com.bytedance.tux.sheet.sheet.TuxSheet;
import com.ss.android.ugc.aweme.im.sdk.chat.feature.group.ui.GroupChatPanel;
import com.ss.android.ugc.aweme.im.sdk.chat.feature.group.viewmodel.GroupChatViewModel;
import com.ss.android.ugc.aweme.im.sdk.chat.feature.quickinteraction.viewmodel.GroupQuickChatRoomViewModel;
import com.ss.android.ugc.aweme.im.sdk.chat.ui.base.BaseChatPanel;
import java.io.Serializable;
import java.util.HashMap;
import kotlin.h.b.n;

public final class GroupQuickChatRoomFragment extends BaseQuickChatRoomFragment implements 2GO {
    public static final C1456IiN LJIIIZ = new C1456IiN((byte) 0);
    public C0988Iap LJIIIIZZ;
    public final Crj LJIIJ = 7he.LIZ(new C1446IiD(this));
    public final Crj LJIIJJI;
    public final Crj LJIIL;
    public HashMap LJIILIIL;

    static {
        Covode.recordClassIndex(84656);
    }

    /* access modifiers changed from: private */
    /* renamed from: LJIIJ */
    public GroupQuickChatRoomViewModel LIZ() {
        return (GroupQuickChatRoomViewModel) this.LJIIJJI.getValue();
    }

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

    public final C1797Ins LIZLLL() {
        return (C1797Ins) this.LJIIL.getValue();
    }

    public final void LJI() {
        HashMap hashMap = this.LJIILIIL;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    public final GroupChatViewModel LJIIIZ() {
        return (GroupChatViewModel) this.LJIIJ.getValue();
    }

    public final /* synthetic */ void onDestroyView() {
        super.onDestroyView();
        LJI();
    }

    public final void LIZIZ() {
        LIZ().LJIIIIZZ.observe(this, new C1449IiG(this));
    }

    public GroupQuickChatRoomFragment() {
        C1448IiF iiF = new C1448IiF(this);
        C1454IiL iiL = new C1454IiL(this);
        this.LJIIJJI = CsY.LIZ(this, KEM.LIZ.LIZ(GroupQuickChatRoomViewModel.class), new C1458IiP(iiL), iiF);
        this.LJIIL = 7he.LIZ(new C1450IiH(this));
    }

    public static final /* synthetic */ C0988Iap LIZ(GroupQuickChatRoomFragment groupQuickChatRoomFragment) {
        C0988Iap iap = groupQuickChatRoomFragment.LJIIIIZZ;
        if (iap == null) {
            n.LIZ("");
        }
        return iap;
    }

    public final BaseChatPanel LIZ(View view) {
        View view2 = view;
        M12.LIZ(view2);
        C0988Iap iap = this.LJIIIIZZ;
        if (iap == null) {
            n.LIZ("");
        }
        return new GroupChatPanel(this, view2, iap, LJIIIZ(), true);
    }

    public final void onCreate(Bundle bundle) {
        Serializable serializable;
        GroupQuickChatRoomFragment.super.onCreate(bundle);
        Bundle arguments = getArguments();
        C0988Iap iap = null;
        if (arguments != null) {
            serializable = arguments.getSerializable("key_session_info");
        } else {
            serializable = null;
        }
        if (serializable instanceof C0988Iap) {
            iap = serializable;
        }
        C0988Iap iap2 = iap;
        if (iap2 == null) {
            3Q4.LIZLLL("GroupQuickChatRoomFragment", "GroupQuickChatRoomFragment: session info is null");
            3S8.LIZ(TuxSheet.LJIJI, this);
            return;
        }
        this.LJIIIIZZ = iap2;
    }

    public final void LIZ(long j) {
        C1372Ih1 ih1 = C1372Ih1.LIZ;
        C0988Iap iap = this.LJIIIIZZ;
        if (iap == null) {
            n.LIZ("");
        }
        String conversationId = iap.getConversationId();
        C0988Iap iap2 = this.LJIIIIZZ;
        if (iap2 == null) {
            n.LIZ("");
        }
        C1372Ih1.LIZ(ih1, conversationId, iap2.getChatType(), j, "chat_panel");
    }
}
