package com.ss.android.ugc.aweme.detail.panel;

import X.86a;
import X.9sv;
import X.AnonymousClass2GO;
import X.AnonymousClass2HN;
import X.AnonymousClass2I7;
import X.AnonymousClass3ZQ;
import X.AnonymousClass4C5;
import X.AnonymousClass4C7;
import X.AnonymousClass4C8;
import X.AnonymousClass4CA;
import X.AnonymousClass4CB;
import X.AnonymousClass4CF;
import X.C03012Pr;
import X.C12422nK;
import X.C18812xd;
import X.Cl7;
import X.Cpk;
import X.CwZ;
import X.Cwu;
import X.DwO;
import X.Eaf;
import X.ISm;
import X.LsC;
import X.M12;
import X.OQg;
import X.OQh;
import X.Rc9;
import X.TnV;
import android.app.Activity;
import android.view.View;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.services.story.EnterStoryParam;
import java.util.Map;
import java.util.Objects;
import kotlin.h.b.n;
import org.greenrobot.eventbus.ThreadMode;

public abstract class StoryDetailFragmentPanel extends DetailFragmentPanel implements AnonymousClass2GO {
    public static final AnonymousClass4CB LIZ = new AnonymousClass4CB((byte) 0);
    public boolean LIZIZ;
    public boolean LJJIZ;
    public boolean LJJJ;

    static {
        Covode.recordClassIndex(63771);
    }

    public void LJJLJ() {
    }

    public Map<Integer, Object> getSubscriberEventTypes() {
        Map<Integer, Object> subscriberEventTypes = super.getSubscriberEventTypes();
        subscriberEventTypes.put(479, new Rc9(StoryDetailFragmentPanel.class, "onViewerListAuthPageEvent", 9sv.class, ThreadMode.MAIN, 0, false));
        subscriberEventTypes.put(480, new Rc9(StoryDetailFragmentPanel.class, "onStoryCommentBubbleItemClicked", AnonymousClass4CA.class, ThreadMode.MAIN, 0, false));
        return subscriberEventTypes;
    }

    public final void LIZJ() {
        this.LJJIZ = true;
        LLJLLL();
    }

    public final void LIZLLL() {
        this.LJJIZ = false;
        LLJZ();
    }

    public final Aweme LJJII() {
        return LLJLLIL();
    }

    public final void LJJ() {
        super.LJJ();
        this.LJJJLIIL.post(new AnonymousClass4C8(this));
    }

    public final boolean LJJLIIIJLJLI() {
        TnV tnV = this.LLIFFJFJJ;
        n.LIZIZ(tnV, "");
        return n.LIZ(tnV.getEventType(), "story_archive");
    }

    public final void LJJLIL() {
        boolean LJI = Eaf.LJI();
        DwO dwO = DwO.LIZ;
        Activity activity = this.LLL;
        n.LIZIZ(activity, "");
        dwO.LIZ(activity, new EnterStoryParam((String) null, "click_story_bottom_camera", "story", LJI, false, false, !Cpk.LIZ.LIZJ(), (String) null, 177, (AnonymousClass2HN) null));
    }

    public final void bq_() {
        if (LLJJIJIL() && this.LLL != null) {
            String string = this.LLL.getString(2131824843);
            n.LIZIZ(string, "");
            String string2 = this.LLL.getString(2131824840);
            n.LIZIZ(string2, "");
            AnonymousClass3ZQ LIZ2 = C18812xd.LIZ((LsC<? super AnonymousClass3ZQ, C03012Pr>) AnonymousClass4C7.LIZ);
            OQg oQg = this.LLIZLLLIL;
            if (oQg != null) {
                OQh oQh = new OQh();
                oQh.LIZ(LIZ2);
                oQh.LIZ(string);
                oQh.LIZ(string2);
                oQh.LJIIIZ = new AnonymousClass4C5(this);
                oQg.setStatus(oQh);
            }
            OQg oQg2 = this.LLIZLLLIL;
            n.LIZIZ(oQg2, "");
            oQg2.setVisibility(0);
            View view = this.LJIILIIL;
            n.LIZIZ(view, "");
            view.setVisibility(8);
        }
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public StoryDetailFragmentPanel(TnV tnV) {
        super(tnV);
        M12.LIZ(tnV);
    }

    @ISm(LIZ = ThreadMode.MAIN)
    public void onStoryCommentBubbleItemClicked(AnonymousClass4CA r5) {
        M12.LIZ(r5);
        if (!this.LLILLJJLI) {
            LIZ(LLJLLIL(), r5.LIZ, true, "bubble");
        }
    }

    @ISm(LIZ = ThreadMode.MAIN)
    public final void onViewerListAuthPageEvent(9sv r3) {
        if (r3 != null) {
            if (r3.LIZIZ == 1) {
                this.LJJJ = true;
                LLJLLL();
            } else if (!this.LIZIZ && !this.LJJIZ) {
                this.LJJJ = false;
                LLJZ();
            }
        }
    }

    public void onCommentListPageDialogEvent(AnonymousClass2I7 r3) {
        M12.LIZ(r3);
        Activity activity = this.LLL;
        if (activity != null && !activity.isFinishing() && r3.LIZIZ == activity.hashCode()) {
            if (r3.LIZ == 1) {
                this.LIZIZ = true;
                LLJLLL();
                return;
            }
            this.LIZIZ = false;
            LLJZ();
        }
    }

    public final void LJI(Aweme aweme) {
        int i;
        if (aweme != null) {
            if (System.currentTimeMillis() - (aweme.getCreateTime() * 1000) <= 604800000) {
                i = 1;
            } else {
                i = 0;
            }
            C12422nK.LIZ("story_bottom_camera_show", (Cwu<Object, String>[]) new Cwu[]{CwZ.LIZ(this.LLIFFJFJJ.getEventType(), "enter_from"), CwZ.LIZ(Cl7.LIZIZ(aweme), "story_collection_id"), CwZ.LIZ(Integer.valueOf(i), "is_seven_days")});
        }
    }

    public void onCommentEvent(AnonymousClass4CF r5) {
        Integer valueOf;
        String str = null;
        if (r5 != null && (valueOf = Integer.valueOf(r5.LIZ)) != null) {
            if ((valueOf.intValue() == 3 || valueOf.intValue() == 4 || valueOf.intValue() == 8) && (r5.LIZIZ instanceof Object[])) {
                Object obj = r5.LIZIZ;
                Objects.requireNonNull(obj, "null cannot be cast to non-null type kotlin.Array<*>");
                Object[] objArr = (Object[]) obj;
                if (objArr.length == 2) {
                    Aweme LLJLLIL = LLJLLIL();
                    if (LLJLLIL != null) {
                        str = LLJLLIL.getAid();
                    }
                    boolean LIZ2 = 86a.LIZ(str, (String) objArr[0]);
                }
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:14:0x0056, code lost:
        if (r1.equals("story_archive") != false) goto L_0x0073;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:16:0x005f, code lost:
        if (r1.equals("chat_list") != false) goto L_0x0073;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:18:0x0068, code lost:
        if (r1.equals("follow_request") != false) goto L_0x0073;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:20:0x0071, code lost:
        if (r1.equals("notification_page") != false) goto L_0x0073;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:21:0x0073, code lost:
        r3 = true;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZ(android.view.View r6, android.os.Bundle r7) {
        /*
            r5 = this;
            super.LIZ((android.view.View) r6, (android.os.Bundle) r7)
            androidx.fragment.app.Fragment r0 = r5.bt_()
            java.lang.String r2 = ""
            if (r0 == 0) goto L_0x002c
            X.1hK r4 = r0.getActivity()
            if (r4 == 0) goto L_0x002c
            X.TnV r0 = r5.LLIFFJFJJ
            java.lang.String r1 = r0.getEventType()
            if (r1 != 0) goto L_0x0048
        L_0x0019:
            r3 = 0
        L_0x001a:
            X.2I5 r0 = com.ss.android.ugc.aweme.homepage.api.interaction.ScrollSwitchStateManager.LJIILL
            kotlin.h.b.n.LIZIZ(r4, r2)
            com.ss.android.ugc.aweme.homepage.api.interaction.ScrollSwitchStateManager r0 = r0.LIZ(r4)
            X.1Bn r1 = r0.LIZJ
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r3)
            r1.setValue(r0)
        L_0x002c:
            X.TnV r0 = r5.LLIFFJFJJ
            kotlin.h.b.n.LIZIZ(r0, r2)
            java.lang.String r1 = r0.getFrom()
            java.lang.String r0 = "STORY_ENTRANCE_INBOX_TOP_LIST"
            boolean r0 = kotlin.h.b.n.LIZ(r0, r1)
            if (r0 == 0) goto L_0x0047
            X.T3s r1 = r5.LJJJLIIL
            X.4C9 r0 = new X.4C9
            r0.<init>(r5)
            r1.LIZ(r0)
        L_0x0047:
            return
        L_0x0048:
            int r0 = r1.hashCode()
            switch(r0) {
                case -1572049565: goto L_0x006b;
                case 505517057: goto L_0x0062;
                case 1619864869: goto L_0x0059;
                case 1837742968: goto L_0x0050;
                default: goto L_0x004f;
            }
        L_0x004f:
            goto L_0x0019
        L_0x0050:
            java.lang.String r0 = "story_archive"
            boolean r0 = r1.equals(r0)
            if (r0 == 0) goto L_0x0019
            goto L_0x0073
        L_0x0059:
            java.lang.String r0 = "chat_list"
            boolean r0 = r1.equals(r0)
            if (r0 == 0) goto L_0x0019
            goto L_0x0073
        L_0x0062:
            java.lang.String r0 = "follow_request"
            boolean r0 = r1.equals(r0)
            if (r0 == 0) goto L_0x0019
            goto L_0x0073
        L_0x006b:
            java.lang.String r0 = "notification_page"
            boolean r0 = r1.equals(r0)
            if (r0 == 0) goto L_0x0019
        L_0x0073:
            r3 = 1
            goto L_0x001a
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.detail.panel.StoryDetailFragmentPanel.LIZ(android.view.View, android.os.Bundle):void");
    }
}
