package com.bytedance.android.live.liveinteract.multiguestv3.widget;

import X.2Pr;
import X.2fU;
import X.6Is;
import X.7Vw;
import X.7he;
import X.7vl;
import X.AnonymousClass0AA;
import X.AnonymousClass0CB;
import X.AnonymousClass0CH;
import X.AnonymousClass0HH;
import X.AnonymousClass0UO;
import X.AnonymousClass1JF;
import X.AnonymousClass1JN;
import X.AnonymousClass1US;
import X.AnonymousClass1WJ;
import X.AnonymousClass1X3;
import X.AnonymousClass2C2;
import X.AnonymousClass2C3;
import X.C07930Ul;
import X.C10000b0;
import X.C10180bI;
import X.C11100cm;
import X.C11170ct;
import X.C11180cu;
import X.C11190cv;
import X.C14250hr;
import X.C14680iY;
import X.C14780ii;
import X.C19320q2;
import X.C19950r3;
import X.C20070rF;
import X.C20100rI;
import X.C20260rY;
import X.C20850sV;
import X.C20980si;
import X.C20990sj;
import X.C21000sk;
import X.C21010sl;
import X.C21020sm;
import X.C21030sn;
import X.C21040so;
import X.C21140sy;
import X.C21810u3;
import X.C22120uY;
import X.C22310ur;
import X.C22760va;
import X.C22770vb;
import X.C22780vc;
import X.C22820vg;
import X.C24150xp;
import X.C24190xt;
import X.C24290y3;
import X.C31161Lu;
import X.C31861Om;
import X.C33431Un;
import X.C33641Vi;
import X.C34011Wt;
import X.C34131Xf;
import X.C34151Xh;
import X.C34161Xi;
import X.C34171Xj;
import X.C34181Xk;
import X.C34191Xl;
import X.C34201Xm;
import X.C34361Yc;
import X.C41491kh;
import X.C41721l4;
import X.C42531mN;
import X.C42541mO;
import X.C515122b;
import X.C516022k;
import X.C516122l;
import X.C516222m;
import X.C516922t;
import X.C517022u;
import X.C53922Bi;
import X.Crj;
import X.Fv7;
import X.Fx3;
import X.Fz8;
import X.G0S;
import X.G2l;
import X.GNd;
import X.GQb;
import X.Gc2;
import X.GiY;
import X.HG2;
import X.HHj;
import X.HK2;
import X.HK3;
import X.Hzs;
import X.IKf;
import X.IKg;
import X.IKi;
import X.LsC;
import X.M12;
import X.PMk;
import X.PMp;
import X.PgU;
import X.Po7;
import X.TBq;
import android.app.Activity;
import android.content.Context;
import android.os.Message;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.view.SurfaceView;
import android.widget.FrameLayout;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import com.bytedance.android.live.base.model.user.User;
import com.bytedance.android.live.broadcast.api.IBroadcastService;
import com.bytedance.android.live.design.app.LiveDialog;
import com.bytedance.android.live.liveinteract.api.LinkMicGuestWidget;
import com.bytedance.android.live.liveinteract.multiguestv3.dialog.MultiGuestV3GuestConfirmAudioGoLiveDialog;
import com.bytedance.android.live.liveinteract.multilive.guset.dialog.MultiLiveGuestUserInfoDialog;
import com.bytedance.android.live.liveinteract.multilive.guset.fragment.MultiGuestPreviewFragment;
import com.bytedance.android.live.liveinteract.multilive.guset.fragment.MultiGuestUserInfoFragment;
import com.bytedance.android.livesdk.LiveDialogFragment;
import com.bytedance.android.livesdk.chatroom.model.interact.LinkPlayerInfo;
import com.bytedance.android.livesdk.chatroom.model.multilive.MultiLiveLayoutInfo;
import com.bytedance.android.livesdk.livesetting.broadcast.LiveBroadcastAgeThresholdSetting;
import com.bytedance.android.livesdk.livesetting.linkmic.LiveAudienceLinkmicLowestAgeSetting;
import com.bytedance.android.livesdk.ui.BaseFragment;
import com.bytedance.android.livesdkapi.depend.model.live.Room;
import com.bytedance.common.utility.collection.WeakHandler;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.datachannel.DataChannel;
import com.bytedance.ies.sdk.widgets.WidgetExtendsKt;
import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import kotlin.h.b.n;
import kotlin.o.y;

public final class MultiGuestV3GuestWidget extends LinkMicGuestWidget implements C42531mN, WeakHandler.IHandler, 6Is {
    public static final /* synthetic */ PMp[] LIZIZ;
    public static final C20980si LJFF = new C20980si((byte) 0);
    public C515122b LIZJ;
    public C19950r3 LIZLLL = C19950r3.SEND_REQUEST;
    public C22120uY LJ;
    public WeakReference<MultiLiveGuestUserInfoDialog> LJI;
    public MultiGuestV3GuestConfirmAudioGoLiveDialog LJII;
    public MultiGuestV3GuestConfirmAudioGoLiveDialog LJIIIIZZ;
    public LiveDialog LJIIIZ;
    public WeakHandler LJIIJ;
    public Runnable LJIIJJI;
    public Room LJIIL;
    public final LsC<GQb, 2Pr> LJIILIIL = new C516022k(this);
    public final C14680iY LJIILJJIL = new C14680iY("DATA_MULTI_LIVE_DEEP_LINK_ENTER_ROOM");
    public final C14680iY LJIILL = new C14680iY("MULTI_GUEST_DATA_HOLDER");
    public final Crj LJIILLIIL = 7vl.LIZ(new C516122l(this));
    public C34011Wt LJIIZILJ = new C34011Wt(false);
    public final Crj LJIJ = 7he.LIZ(new C516222m(this));
    public boolean LJIJI;
    public final FrameLayout LJIJJ;

    private final C20850sV LJIILJJIL() {
        return (C20850sV) this.LJIJ.getValue();
    }

    public final void LIZ(C22780vc r1) {
        M12.LIZ(r1);
    }

    public final void LIZ(Throwable th) {
        Gc2.LIZ(this, th);
    }

    public final void LIZ(List list) {
    }

    public final void LIZIZ(String str) {
        M12.LIZ(str);
    }

    public final void LIZIZ(String str, SurfaceView surfaceView) {
        M12.LIZ(str, surfaceView);
    }

    public final GNd LJIIIZ() {
        return null;
    }

    public final C33641Vi LJIILIIL() {
        return (C33641Vi) this.LJIILL.LIZ(this, LIZIZ[1]);
    }

    public final int getLayoutId() {
        return 2131562101;
    }

    public final void onStateChanged(AnonymousClass0CH r1, AnonymousClass0CB r2) {
        super.onStateChanged(r1, r2);
    }

    public final C19950r3 LJIIIIZZ() {
        return this.LIZLLL;
    }

    public final void LIZ(boolean z) {
        this.LJIJI = z;
    }

    public final boolean LIZ(Runnable runnable, boolean z) {
        C31861Om LIZ = C31861Om.LIZ();
        n.LIZIZ(LIZ, "");
        Integer num = (Integer) LIZ.LJIILIIL;
        if (num == null || 2 != num.intValue()) {
            return false;
        }
        if (z) {
            HK2 hk2 = new HK2(getContext());
            hk2.LIZIZ(2131833955);
            hk2.LIZ(2131834141, new C20990sj(this, runnable), false);
            hk2.LIZIZ(2131833718, C21000sk.LIZ, false);
            LIZ(hk2.LIZ());
            return true;
        }
        LIZ(runnable);
        return true;
    }

    public final void LIZ(Runnable runnable) {
        this.LJIIJJI = runnable;
        C515122b r2 = this.LIZJ;
        if (r2 != null) {
            r2.LIZJ("live_end", false);
        }
        C24150xp.LIZLLL.LIZIZ("live_over");
        C24150xp.LIZLLL.LIZ("live_over");
    }

    /* JADX WARNING: Code restructure failed: missing block: B:9:0x001d, code lost:
        r2 = r2.LJJ;
     */
    /* JADX WARNING: Removed duplicated region for block: B:11:0x0021  */
    /* JADX WARNING: Removed duplicated region for block: B:14:0x0028  */
    /* JADX WARNING: Removed duplicated region for block: B:17:0x002f  */
    /* JADX WARNING: Removed duplicated region for block: B:30:0x0053  */
    /* JADX WARNING: Removed duplicated region for block: B:66:? A[RETURN, SYNTHETIC] */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZ(java.util.List<? extends X.Po7> r9, java.lang.String r10, X.Ppr r11, int r12) {
        /*
            r8 = this;
            X.0r3 r3 = r8.LIZLLL
            X.0r3 r2 = X.C19950r3.GO_LIVE
            r0 = 0
            r7 = 0
            r4 = r9
            r5 = r10
            if (r3 == r2) goto L_0x003c
            if (r11 == 0) goto L_0x0031
            long r2 = r11.LIZJ
        L_0x000f:
            java.lang.Long r2 = java.lang.Long.valueOf(r2)
            if (r2 == 0) goto L_0x0019
            long r0 = r2.longValue()
        L_0x0019:
            X.22b r2 = r8.LIZJ
            if (r2 == 0) goto L_0x002f
            X.1X6 r2 = r2.LJJ
            if (r2 == 0) goto L_0x002f
            X.1X3 r6 = r2.LIZ((long) r0)
        L_0x0025:
            r3 = 0
            if (r6 == 0) goto L_0x002a
            X.1Xf r7 = r6.LJ
        L_0x002a:
            r2 = r8
            r2.LIZ((boolean) r3, (java.util.List<? extends X.Po7>) r4, (java.lang.String) r5, (X.AnonymousClass1X3) r6, (X.C34131Xf) r7)
            return
        L_0x002f:
            r6 = r7
            goto L_0x0025
        L_0x0031:
            X.0qD r2 = X.C33641Vi.LJJJ
            X.1Vi r2 = r2.LIZ()
            if (r2 == 0) goto L_0x0019
            long r2 = r2.LJJIJIIJIL
            goto L_0x000f
        L_0x003c:
            X.0r3 r3 = r8.LIZLLL
            X.0r3 r2 = X.C19950r3.GO_LIVE
            if (r3 != r2) goto L_0x00c0
            if (r11 == 0) goto L_0x007b
            long r2 = r11.LIZJ
        L_0x0046:
            java.lang.Long r2 = java.lang.Long.valueOf(r2)
            if (r2 == 0) goto L_0x0050
            long r0 = r2.longValue()
        L_0x0050:
            r2 = 1
            if (r12 != r2) goto L_0x00c0
            X.22b r2 = r8.LIZJ
            if (r2 == 0) goto L_0x0079
            X.1X7 r2 = r2.LJIL
            if (r2 == 0) goto L_0x0079
            X.0sX r1 = r2.LIZIZ(r0)
        L_0x005f:
            boolean r0 = r8.LJFF()
            if (r0 == 0) goto L_0x0068
            r8.LJI()
        L_0x0068:
            boolean r0 = r1 instanceof X.C34131Xf
            if (r0 == 0) goto L_0x0086
            X.0r3 r0 = X.C19950r3.GO_LIVE
            r8.LIZ((X.C19950r3) r0)
            X.1Xf r1 = (X.C34131Xf) r1
            r0 = 15
            LIZ((com.bytedance.android.live.liveinteract.multiguestv3.widget.MultiGuestV3GuestWidget) r8, (java.util.List) r7, (java.lang.String) r7, (X.C34131Xf) r1, (int) r0)
            return
        L_0x0079:
            r1 = r7
            goto L_0x005f
        L_0x007b:
            X.0qD r2 = X.C33641Vi.LJJJ
            X.1Vi r2 = r2.LIZ()
            if (r2 == 0) goto L_0x0050
            long r2 = r2.LJJIJIIJIL
            goto L_0x0046
        L_0x0086:
            boolean r0 = r1 instanceof X.AnonymousClass1X5
            if (r0 == 0) goto L_0x0092
            X.22b r0 = r8.LIZJ
            if (r0 == 0) goto L_0x0091
            r0.LJIIJJI()
        L_0x0091:
            return
        L_0x0092:
            boolean r0 = r1 instanceof X.C34141Xg
            if (r0 == 0) goto L_0x00bb
            com.bytedance.android.live.liveinteract.multiguestv3.dialog.MultiGuestV3GuestConfirmAudioGoLiveDialog r0 = r8.LJIIIIZZ
            if (r0 == 0) goto L_0x009d
            X.G2l.LIZIZ(r0)
        L_0x009d:
            r8.LJI()
            android.content.Context r0 = r8.context
            if (r0 == 0) goto L_0x00ba
            com.bytedance.android.live.liveinteract.multiguestv3.dialog.MultiGuestV3GuestConfirmAudioGoLiveDialog r2 = new com.bytedance.android.live.liveinteract.multiguestv3.dialog.MultiGuestV3GuestConfirmAudioGoLiveDialog
            android.content.Context r1 = r8.context
            java.lang.String r0 = ""
            kotlin.h.b.n.LIZIZ(r1, r0)
            X.22v r0 = new X.22v
            r0.<init>(r8)
            r2.<init>(r1, r0)
            r8.LJIIIIZZ = r2
            LIZ((com.bytedance.android.live.liveinteract.multiguestv3.dialog.MultiGuestV3GuestConfirmAudioGoLiveDialog) r2)
        L_0x00ba:
            return
        L_0x00bb:
            r0 = 24
            LIZ((com.bytedance.android.live.liveinteract.multiguestv3.widget.MultiGuestV3GuestWidget) r8, (java.util.List) r4, (java.lang.String) r5, (X.C34131Xf) r7, (int) r0)
        L_0x00c0:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.live.liveinteract.multiguestv3.widget.MultiGuestV3GuestWidget.LIZ(java.util.List, java.lang.String, X.Ppr, int):void");
    }

    public final void LIZ(String str, SurfaceView surfaceView) {
        C34011Wt r2 = this.LJIIZILJ;
        if (r2 != null) {
            r2.LIZ(true, false);
        }
    }

    public final void LIZ(MultiLiveLayoutInfo multiLiveLayoutInfo) {
        String name;
        M12.LIZ(multiLiveLayoutInfo);
        TBq LIZ = C20260rY.LIZJ.LIZ().LIZ(multiLiveLayoutInfo.LIZIZ, multiLiveLayoutInfo.LIZJ);
        if (LIZ != null && (name = LIZ.name()) != null) {
            C20260rY.LIZJ.LIZ().LJI().LIZ(name);
        }
    }

    public final void LIZ(boolean z, boolean z2) {
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference;
        LiveDialogFragment liveDialogFragment;
        DialogFragment dialogFragment;
        if (!z && (weakReference = this.LJI) != null && (liveDialogFragment = (LiveDialogFragment) weakReference.get()) != null && liveDialogFragment.LJIIJ()) {
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJI;
            if (!(weakReference2 == null || (dialogFragment = (DialogFragment) weakReference2.get()) == null)) {
                dialogFragment.dismiss();
            }
            if (z2) {
                String LIZ = C10000b0.LIZ(2131830517);
                n.LIZIZ(LIZ, "");
                LIZJ(LIZ);
                return;
            }
            String LIZ2 = C10000b0.LIZ(2131828338);
            n.LIZIZ(LIZ2, "");
            LIZJ(LIZ2);
        }
    }

    public final void LIZ(String str) {
        List<IKi> list;
        Boolean bool;
        super.LIZ(str);
        IKg LIZ = IKf.LIZ(str);
        C515122b r3 = this.LIZJ;
        if (r3 != null) {
            if (!(LIZ == null || (list = LIZ.LJ) == null)) {
                for (IKi iKi : list) {
                    C33641Vi r1 = r3.LJ;
                    if (r1 == null) {
                        n.LIZ("");
                    }
                    Boolean bool2 = null;
                    if (r1 != null) {
                        n.LIZIZ(iKi, "");
                        bool = r1.LIZJ(iKi.LIZ());
                    } else {
                        bool = null;
                    }
                    if (!n.LIZ(bool, Boolean.valueOf(iKi.LJIILL))) {
                        C33641Vi r2 = r3.LJ;
                        if (r2 == null) {
                            n.LIZ("");
                        } else {
                            n.LIZIZ(iKi, "");
                            String LIZ2 = iKi.LIZ();
                            n.LIZIZ(LIZ2, "");
                            r2.LIZ(LIZ2, iKi.LJIILL);
                        }
                        n.LIZIZ(iKi, "");
                        String LIZ3 = iKi.LIZ();
                        n.LIZIZ(LIZ3, "");
                        r3.LJJIIJZLJL.LIZJ(AnonymousClass2C3.class, new C22820vg(LIZ3, iKi.LJIILL));
                    }
                    C33641Vi r12 = r3.LJ;
                    if (r12 == null) {
                        n.LIZ("");
                    } else {
                        n.LIZIZ(iKi, "");
                        bool2 = r12.LJ(iKi.LIZ());
                    }
                    if (!n.LIZ(bool2, Boolean.valueOf(iKi.LJIILJJIL))) {
                        C33641Vi r22 = r3.LJ;
                        if (r22 == null) {
                            n.LIZ("");
                        } else {
                            n.LIZIZ(iKi, "");
                            String LIZ4 = iKi.LIZ();
                            n.LIZIZ(LIZ4, "");
                            r22.LIZIZ(LIZ4, iKi.LJIILJJIL);
                        }
                        n.LIZIZ(iKi, "");
                        String LIZ5 = iKi.LIZ();
                        n.LIZIZ(LIZ5, "");
                        r3.LJJIIJZLJL.LIZJ(AnonymousClass2C2.class, new C22770vb(LIZ5, iKi.LJIILJJIL));
                    }
                    C33641Vi r23 = r3.LJ;
                    if (r23 == null) {
                        n.LIZ("");
                    }
                    n.LIZIZ(iKi, "");
                    String LIZ6 = iKi.LIZ();
                    n.LIZIZ(LIZ6, "");
                    r23.LIZ(LIZ6, iKi.LJIIJJI);
                    n.LIZ(iKi.LIZ(), r3.LJIL());
                }
            }
            C42531mN r0 = r3.LJJIJIIJI;
            if (r0 != null) {
                r0.LJII();
            }
        }
        GiY.LIZ().LJFF = str;
        C14250hr.LIZIZ().sendSeiToSDK(str);
    }

    public final void LJII() {
        C34011Wt r0 = this.LJIIZILJ;
        if (r0 != null) {
            r0.LIZ();
        }
    }

    private final AnonymousClass0AA LJIILL() {
        DataChannel dataChannel = this.dataChannel;
        if (dataChannel != null) {
            return (AnonymousClass0AA) dataChannel.LIZIZ(HG2.class);
        }
        return null;
    }

    public final void LJ() {
        C34011Wt r2 = this.LJIIZILJ;
        if (r2 != null) {
            r2.LIZ(true, false);
        }
    }

    public final String LJIIL() {
        return getClass().getName();
    }

    public final void onDetachWidget() {
        MultiGuestV3GuestWidget.super.onDetachWidget();
        C515122b r1 = this.LIZJ;
        if (r1 != null) {
            r1.LJIILLIIL();
            r1.LJJIIJZLJL.LIZIZ(r1);
        }
    }

    public final void LIZLLL() {
        Runnable runnable = this.LJIIJJI;
        if (runnable != null) {
            runnable.run();
        }
        this.LJIIJJI = null;
        C34011Wt r2 = this.LJIIZILJ;
        if (r2 != null) {
            r2.LIZ(false, true);
        }
    }

    public final void LJIIJ() {
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference;
        DialogFragment dialogFragment;
        if (LJFF() && this.LIZLLL == C19950r3.GO_LIVE && (weakReference = this.LJI) != null && (dialogFragment = (DialogFragment) weakReference.get()) != null) {
            dialogFragment.dismiss();
        }
    }

    static {
        Class<MultiGuestV3GuestWidget> cls = MultiGuestV3GuestWidget.class;
        Covode.recordClassIndex(8557);
        LIZIZ = new PMp[]{new PMk(cls, "mDeepLinkEnterMultiLiveRoomHandler", "getMDeepLinkEnterMultiLiveRoomHandler()Lcom/bytedance/android/live/liveinteract/multilive/guset/model/DeepLinkEnterMultiLiveRoomDataHandler;", 0), new PMk(cls, "mMultiGuestDataHolder", "getMMultiGuestDataHolder()Lcom/bytedance/android/live/liveinteract/multiguest/opt/business/MultiGuestDataHolder;", 0)};
    }

    public final void LIZJ() {
        HK2 hk2 = new HK2(this.context);
        hk2.LIZIZ(2131833953);
        hk2.LIZ(2131834141, C21010sl.LIZ, false);
        HK3 LIZ = hk2.LIZ();
        n.LIZIZ(LIZ, "");
        LIZ.show();
        2fU.LIZ.LIZ(LIZ);
        C515122b r1 = this.LIZJ;
        if (r1 != null) {
            r1.LIZJ("leave_with_money_not_enough", false);
        }
    }

    public final boolean LJFF() {
        LiveDialogFragment liveDialogFragment;
        Fragment fragment;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference = this.LJI;
        if (weakReference == null || (liveDialogFragment = (LiveDialogFragment) weakReference.get()) == null || !liveDialogFragment.LJIIJ()) {
            return false;
        }
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJI;
        if (weakReference2 == null || (multiLiveGuestUserInfoDialog = (MultiLiveGuestUserInfoDialog) weakReference2.get()) == null) {
            fragment = null;
        } else {
            fragment = multiLiveGuestUserInfoDialog.LJ;
        }
        if (fragment instanceof MultiGuestUserInfoFragment) {
            return true;
        }
        return false;
    }

    public final void LJI() {
        LiveDialogFragment liveDialogFragment;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference;
        DialogFragment dialogFragment;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJI;
        if (weakReference2 != null && (liveDialogFragment = (LiveDialogFragment) weakReference2.get()) != null && liveDialogFragment.LJIIJ() && (weakReference = this.LJI) != null && (dialogFragment = (DialogFragment) weakReference.get()) != null) {
            dialogFragment.dismiss();
        }
    }

    public final void LJIIJJI() {
        MultiGuestV3GuestConfirmAudioGoLiveDialog multiGuestV3GuestConfirmAudioGoLiveDialog = this.LJII;
        if (multiGuestV3GuestConfirmAudioGoLiveDialog != null) {
            G2l.LIZIZ(multiGuestV3GuestConfirmAudioGoLiveDialog);
        }
        if (this.context != null) {
            Context context = this.context;
            n.LIZIZ(context, "");
            MultiGuestV3GuestConfirmAudioGoLiveDialog multiGuestV3GuestConfirmAudioGoLiveDialog2 = new MultiGuestV3GuestConfirmAudioGoLiveDialog(context, new C516922t(this), C517022u.LIZ);
            this.LJII = multiGuestV3GuestConfirmAudioGoLiveDialog2;
            LIZ(multiGuestV3GuestConfirmAudioGoLiveDialog2);
        }
    }

    public final void onPause() {
        WeakHandler weakHandler;
        C515122b r0 = this.LIZJ;
        if (r0 != null) {
            r0.LJIILJJIL();
        }
        C515122b r02 = this.LIZJ;
        if (!(r02 == null || !r02.LJIIIZ() || (weakHandler = this.LJIIJ) == null)) {
            weakHandler.sendEmptyMessageDelayed(140000, 180000);
        }
        AnonymousClass1JN r03 = (AnonymousClass1JN) C41491kh.LIZ.LIZIZ("MULTI_GUEST_REVIEW_MANAGER");
        if (r03 != null) {
            r03.LIZLLL();
        }
        super.onPause();
    }

    public final void LIZIZ() {
        Object obj;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference;
        DialogFragment dialogFragment;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog;
        LiveDialogFragment liveDialogFragment;
        DataChannel dataChannel = this.dataChannel;
        Fragment fragment = null;
        if (dataChannel != null) {
            obj = dataChannel.LIZIZ(Fx3.class);
        } else {
            obj = null;
        }
        if (!n.LIZ(obj, true)) {
            if (this.LJIIIZ == null) {
                C31161Lu r2 = new C31161Lu(this.context);
                r2.LIZJ(2131828992);
                r2.LIZ(2131830035, (C11170ct) C34191Xl.LIZ);
                this.LJIIIZ = r2.LIZIZ();
            }
            LiveDialog liveDialog = this.LJIIIZ;
            if (liveDialog != null) {
                LIZ(liveDialog);
            }
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJI;
            if (weakReference2 == null || (liveDialogFragment = (LiveDialogFragment) weakReference2.get()) == null || liveDialogFragment.LJIIJ()) {
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference3 = this.LJI;
                if (!(weakReference3 == null || (multiLiveGuestUserInfoDialog = (MultiLiveGuestUserInfoDialog) weakReference3.get()) == null)) {
                    fragment = multiLiveGuestUserInfoDialog.LJ;
                }
                if ((fragment instanceof MultiGuestPreviewFragment) && (weakReference = this.LJI) != null && (dialogFragment = (DialogFragment) weakReference.get()) != null) {
                    dialogFragment.dismiss();
                }
            }
        }
    }

    public final void onResume() {
        LiveDialogFragment liveDialogFragment;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference;
        Fragment fragment;
        super.onResume();
        WeakHandler weakHandler = this.LJIIJ;
        Object obj = null;
        if (weakHandler != null) {
            weakHandler.removeCallbacksAndMessages((Object) null);
        }
        C515122b r1 = this.LIZJ;
        if (r1 != null) {
            r1.LJIILIIL();
        }
        ((HHj) PgU.LIZIZ(1, TimeUnit.SECONDS).LIZ(new Hzs()).LIZ(WidgetExtendsKt.autoDispose(this))).LIZ(new C34151Xh(this), C34161Xi.LIZ);
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJI;
        if (!(weakReference2 == null || (liveDialogFragment = (LiveDialogFragment) weakReference2.get()) == null || !liveDialogFragment.LJIIJ())) {
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference3 = this.LJI;
            if (weakReference3 != null) {
                obj = weakReference3.get();
            }
            if (!(!(obj instanceof MultiLiveGuestUserInfoDialog) || (weakReference = this.LJI) == null || (fragment = (Fragment) weakReference.get()) == null)) {
                fragment.onResume();
            }
        }
        C24150xp.LIZJ();
        AnonymousClass1JN r0 = (AnonymousClass1JN) C41491kh.LIZ.LIZIZ("MULTI_GUEST_REVIEW_MANAGER");
        if (r0 != null) {
            r0.LJ();
        }
    }

    public final void LIZ() {
        C515122b r2 = this.LIZJ;
        if (r2 != null) {
            r2.LIZJ("rtc_error", false);
        }
    }

    public final void onDestroy() {
        LiveDialogFragment liveDialogFragment;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference;
        DialogFragment dialogFragment;
        C24190xt.LIZ("LinkIn_Guest_Widget_onDestroy");
        C33641Vi LJIILIIL2 = LJIILIIL();
        if (LJIILIIL2 != null) {
            LJIILIIL2.LJJIJLIJ = null;
        }
        C20850sV LJIILJJIL2 = LJIILJJIL();
        if (LJIILJJIL2.LIZ) {
            LJIILJJIL2.LIZ();
        }
        if (!C21140sy.LIZIZ(this.LJIIL)) {
            C24150xp.LIZ();
        }
        if (GiY.LIZ().LJJIFFI > 0) {
            C24150xp.LIZLLL((String) null);
        }
        GiY.LIZ().LIZ(false);
        C515122b r0 = this.LIZJ;
        if (r0 != null) {
            r0.f_();
        }
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJI;
        if (!(weakReference2 == null || (liveDialogFragment = (LiveDialogFragment) weakReference2.get()) == null || !liveDialogFragment.LJIIJ() || (weakReference = this.LJI) == null || (dialogFragment = (DialogFragment) weakReference.get()) == null)) {
            dialogFragment.dismiss();
        }
        DataChannel dataChannel = this.dataChannel;
        if (dataChannel != null) {
            dataChannel.LIZIZ(this);
        }
        LiveDialog liveDialog = this.LJIIIZ;
        if (liveDialog != null && liveDialog.isShowing()) {
            LiveDialog liveDialog2 = this.LJIIIZ;
            if (liveDialog2 != null) {
                liveDialog2.dismiss();
            }
            this.LJIIIZ = null;
        }
        MultiGuestV3GuestConfirmAudioGoLiveDialog multiGuestV3GuestConfirmAudioGoLiveDialog = this.LJII;
        if (multiGuestV3GuestConfirmAudioGoLiveDialog != null) {
            G2l.LIZIZ(multiGuestV3GuestConfirmAudioGoLiveDialog);
        }
        MultiGuestV3GuestConfirmAudioGoLiveDialog multiGuestV3GuestConfirmAudioGoLiveDialog2 = this.LJIIIIZZ;
        if (multiGuestV3GuestConfirmAudioGoLiveDialog2 != null) {
            G2l.LIZIZ(multiGuestV3GuestConfirmAudioGoLiveDialog2);
        }
        C34011Wt r02 = this.LJIIZILJ;
        if (r02 != null) {
            r02.LJ();
        }
        this.LJIIZILJ = null;
        C20070rF LIZ = AnonymousClass1WJ.LJFF.LIZ();
        if (LIZ != null) {
            LIZ.LIZ();
        }
        MultiGuestV3GuestWidget.super.onDestroy();
    }

    /* JADX WARNING: type inference failed for: r4v1, types: [X.0CH] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onCreate() {
        /*
            r6 = this;
            com.bytedance.android.live.liveinteract.multiguestv3.widget.MultiGuestV3GuestWidget.super.onCreate()
            java.lang.String r0 = "LinkIn_Guest_Widget_onCreate"
            X.C24190xt.LIZ((java.lang.String) r0)
            com.bytedance.ies.sdk.datachannel.DataChannel r1 = r6.dataChannel
            r0 = 0
            if (r1 == 0) goto L_0x0015
            java.lang.Class<X.Fv7> r0 = X.Fv7.class
            java.lang.Object r0 = r1.LIZIZ(r0)
            com.bytedance.android.livesdkapi.depend.model.live.Room r0 = (com.bytedance.android.livesdkapi.depend.model.live.Room) r0
        L_0x0015:
            r6.LJIIL = r0
            X.0sV r4 = r6.LJIILJJIL()
            com.bytedance.ies.sdk.datachannel.DataChannel r3 = r4.LIZIZ
            X.0CH r2 = r4.LIZLLL
            java.lang.Class<X.2Bl> r1 = X.C53952Bl.class
            X.210 r0 = new X.210
            r0.<init>(r4)
            r3.LIZ(r2, r1, r0)
            X.0CH r2 = r4.LIZLLL
            java.lang.Class<X.2D7> r1 = X.AnonymousClass2D7.class
            X.211 r0 = new X.211
            r0.<init>(r4)
            r3.LIZ(r2, r1, r0)
            com.bytedance.ies.sdk.datachannel.DataChannel r2 = r6.dataChannel
            java.lang.Class<X.2AX> r1 = X.AnonymousClass2AX.class
            X.LsC<X.GQb, X.2Pr> r0 = r6.LJIILIIL
            r2.LIZ(r6, r1, r0)
            java.lang.Class<X.2Be> r1 = X.C53882Be.class
            X.22n r0 = new X.22n
            r0.<init>(r6)
            r2.LIZ(r6, r1, r0)
            java.lang.Class<X.2BY> r1 = X.AnonymousClass2BY.class
            X.22o r0 = new X.22o
            r0.<init>(r6)
            r2.LIZ(r6, r1, r0)
            r4 = r6
            java.lang.Class<X.GwK> r1 = X.GwK.class
            X.22p r0 = new X.22p
            r0.<init>(r6)
            r2.LIZIZ(r4, r1, r0)
            java.lang.Class<X.2Bl> r1 = X.C53952Bl.class
            X.22q r0 = new X.22q
            r0.<init>(r6)
            r2.LIZ(r6, r1, r0)
            java.lang.Class<X.2Bm> r1 = X.C53962Bm.class
            X.22r r0 = new X.22r
            r0.<init>(r6)
            r2.LIZ(r6, r1, r0)
            com.bytedance.android.livesdkapi.depend.model.live.Room r2 = r6.LJIIL
            java.lang.String r5 = ""
            if (r2 == 0) goto L_0x0083
            X.22b r1 = new X.22b
            com.bytedance.ies.sdk.datachannel.DataChannel r0 = r6.dataChannel
            kotlin.h.b.n.LIZIZ(r0, r5)
            r1.<init>(r2, r0)
            r6.LIZJ = r1
        L_0x0083:
            X.22b r0 = r6.LIZJ
            if (r0 == 0) goto L_0x0099
            X.1Wt r3 = r6.LJIIZILJ
            if (r3 == 0) goto L_0x0099
            com.bytedance.ies.sdk.datachannel.DataChannel r2 = r6.dataChannel
            kotlin.h.b.n.LIZIZ(r2, r5)
            X.1Un r1 = r0.LIZJ()
            android.widget.FrameLayout r0 = r6.LJIJJ
            r3.LIZ(r2, r1, r0, r4)
        L_0x0099:
            X.22b r1 = r6.LIZJ
            if (r1 == 0) goto L_0x00a1
            r0 = r6
            r1.LIZ((X.C42531mN) r0)
        L_0x00a1:
            com.bytedance.common.utility.collection.WeakHandler r1 = new com.bytedance.common.utility.collection.WeakHandler
            r0 = r6
            r1.<init>(r0)
            r6.LJIIJ = r1
            X.1Om r1 = X.C31861Om.LIZ()
            r2 = 0
            java.lang.Integer r0 = java.lang.Integer.valueOf(r2)
            r1.LIZ((java.lang.Integer) r0)
            X.0iY r1 = r6.LJIILJJIL
            X.PMp[] r0 = LIZIZ
            r0 = r0[r2]
            java.lang.Object r0 = r1.LIZ(r6, r0)
            X.1Yc r0 = (X.C34361Yc) r0
            if (r0 == 0) goto L_0x00c6
            r0.LIZ()
        L_0x00c6:
            com.bytedance.android.livesdkapi.depend.model.live.Room r5 = r6.LJIIL
            X.0Uq r0 = X.C07990Ur.LIZ
            com.bytedance.android.live.base.model.user.User r3 = r0.LIZ()
            android.content.Context r2 = r6.context
            X.22s r0 = new X.22s
            r0.<init>(r6)
            X.M12.LIZ(r0)
            if (r5 == 0) goto L_0x00de
            if (r3 == 0) goto L_0x00de
            if (r2 != 0) goto L_0x0112
        L_0x00de:
            java.lang.StringBuilder r1 = new java.lang.StringBuilder
            java.lang.String r0 = "get null: "
            r1.<init>(r0)
            r1.append(r5)
            java.lang.String r0 = ", "
            r1.append(r0)
            r1.append(r3)
            r0 = 32
            r1.append(r0)
            r1.append(r2)
            java.lang.String r1 = r1.toString()
            java.lang.String r0 = "MultiGuestFeedbackController"
            X.C24190xt.LIZ((java.lang.String) r0, (java.lang.String) r1)
        L_0x0101:
            X.0um r3 = X.C34411Yh.LJIIJ
            com.bytedance.ies.sdk.datachannel.DataChannel r2 = r6.dataChannel
            com.bytedance.android.livesdkapi.depend.model.live.Room r1 = r6.LJIIL
            r0 = 1
            X.0ue r0 = r3.LIZ(r2, r1, r4, r0)
            if (r0 == 0) goto L_0x0111
            r0.LIZ()
        L_0x0111:
            return
        L_0x0112:
            X.1WJ r1 = new X.1WJ
            r1.<init>(r5, r3, r2, r0)
            X.1kh r0 = X.C41491kh.LIZ
            r0.LIZ(r1, (java.lang.String) null)
            com.bytedance.android.livesdk.livesetting.linkmic.multilive.MultiGuestDisconnectFeedbackSetting r0 = com.bytedance.android.livesdk.livesetting.linkmic.multilive.MultiGuestDisconnectFeedbackSetting.INSTANCE
            boolean r0 = r0.enableDisconnectAfterFeedback()
            if (r0 == 0) goto L_0x0101
            X.1WG r1 = r1.LIZIZ
            java.lang.String r0 = "Multi_guest_feedback_submit"
            X.HmY.LIZ(r0, r1)
            goto L_0x0101
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.live.liveinteract.multiguestv3.widget.MultiGuestV3GuestWidget.onCreate():void");
    }

    public final void LIZ(C19950r3 r1) {
        M12.LIZ(r1);
        this.LIZLLL = r1;
    }

    public static void LIZ(HK3 hk3) {
        hk3.show();
        2fU.LIZ.LIZ(hk3);
    }

    public static void LIZ(LiveDialog liveDialog) {
        liveDialog.show();
        2fU.LIZ.LIZ(liveDialog);
    }

    private final void LIZJ(String str) {
        C31161Lu r2 = new C31161Lu(this.context);
        r2.LJIJI = true;
        r2.LJIJ = false;
        r2.LIZ((CharSequence) str);
        r2.LIZ(2131830035, (C11170ct) C34201Xm.LIZ);
        LIZ(r2.LIZIZ());
    }

    public final void LIZIZ(Throwable th) {
        M12.LIZ(th);
        G0S.LIZ(this.context, th);
        C515122b r2 = this.LIZJ;
        if (r2 != null) {
            r2.LIZJ("join_channel_error", false);
        }
    }

    public final void handleMsg(Message message) {
        C515122b r2;
        M12.LIZ(message);
        if (isViewValid() && 140000 == message.what && (r2 = this.LIZJ) != null) {
            r2.LIZJ("leave_with_background", false);
        }
    }

    public static void LIZ(MultiGuestV3GuestConfirmAudioGoLiveDialog multiGuestV3GuestConfirmAudioGoLiveDialog) {
        multiGuestV3GuestConfirmAudioGoLiveDialog.show();
        2fU.LIZ.LIZ(multiGuestV3GuestConfirmAudioGoLiveDialog);
    }

    public final void LIZIZ(List<? extends LinkPlayerInfo> list) {
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference;
        LiveDialogFragment liveDialogFragment;
        DataChannel dataChannel;
        M12.LIZ(list);
        if (isViewValid() && (weakReference = this.LJI) != null && (liveDialogFragment = (LiveDialogFragment) weakReference.get()) != null && liveDialogFragment.LJIIJ() && (dataChannel = this.dataChannel) != null) {
            dataChannel.LIZJ(C53922Bi.class, list);
        }
    }

    public MultiGuestV3GuestWidget(FrameLayout frameLayout) {
        M12.LIZ(frameLayout);
        this.LJIJJ = frameLayout;
    }

    public final void LIZIZ(boolean z) {
        C34361Yc LIZ = C34361Yc.LIZIZ.LIZ();
        if (LIZ != null) {
            LIZ.LIZJ();
        }
        C20100rI[] r4 = (C20100rI[]) this.LJIILLIIL.getValue();
        int length = r4.length;
        int i = 0;
        while (i < length) {
            if (!r4[i].LIZ()) {
                i++;
            } else {
                return;
            }
        }
        if (z) {
            this.LJ = null;
        }
        this.LIZLLL = C19950r3.SEND_REQUEST;
        C515122b r0 = this.LIZJ;
        if (r0 != null) {
            r0.LIZ(0);
        }
    }

    public final void LIZ(C19320q2 r12) {
        Room room;
        M12.LIZ(r12);
        Throwable th = r12.LIZ;
        if (!(th instanceof AnonymousClass1JF)) {
            G0S.LIZ(this.context, th);
            return;
        }
        AnonymousClass1JF r1 = (AnonymousClass1JF) th;
        switch (r1.getErrorCode()) {
            case 20048:
                String LIZ = C10000b0.LIZ(2131829361);
                n.LIZIZ(LIZ, "");
                String LIZ2 = AnonymousClass0HH.LIZ(LIZ, Arrays.copyOf(new Object[]{String.valueOf(LiveAudienceLinkmicLowestAgeSetting.INSTANCE.getValue())}, 1));
                n.LIZIZ(LIZ2, "");
                HK2 hk2 = new HK2(getContext());
                hk2.LJIIIZ = true;
                hk2.LIZIZ = LIZ2;
                hk2.LIZ(2131833777, new C21030sn(this), false);
                hk2.LIZIZ(2131833778, C21040so.LIZ, false);
                LIZ(hk2.LIZ());
                C24290y3.LIZ();
                return;
            case 31002:
                AnonymousClass0UO.LIZIZ.LIZ(r1.getExtra(), 7Vw.class);
                return;
            case 31011:
                C515122b r0 = this.LIZJ;
                if (r0 != null) {
                    r0.LJIILL();
                    return;
                }
                return;
            case 4003036:
                Fz8.LIZ(C10000b0.LJ(), C10000b0.LIZ(2131829489), 0);
                return;
            case 4003037:
                C515122b r2 = this.LIZJ;
                if (r2 != null) {
                    r2.LIZ(this.context, C14780ii.BAN_FOR_BROADCASTING);
                    return;
                }
                return;
            case 4003088:
                int i = r12.LIZIZ;
                Activity LIZ3 = C10180bI.LIZ(this.context);
                if (LIZ3 != null) {
                    n.LIZIZ(LIZ3, "");
                    ((IBroadcastService) C11100cm.LIZ(IBroadcastService.class)).showGuideBirthdayEditDialog(LIZ3, "live_co_host", C24290y3.LIZLLL(i), new C34181Xk(this, i));
                    C24290y3.LIZIZ(i);
                    return;
                }
                return;
            case 4003089:
                int i2 = r12.LIZIZ;
                SpannableString spannableString = new SpannableString(C10000b0.LIZ(2131828211));
                spannableString.setSpan(new ForegroundColorSpan(C10000b0.LIZIZ(2131100680)), 0, spannableString.length(), 33);
                DataChannel dataChannel = this.dataChannel;
                User user = null;
                if (dataChannel != null) {
                    room = (Room) dataChannel.LIZIZ(Fv7.class);
                } else {
                    room = null;
                }
                C31161Lu r8 = new C31161Lu(this.context);
                r8.LJIJI = false;
                r8.LJIJ = false;
                r8.LIZJ = C10000b0.LIZ(2131828213, String.valueOf(LiveBroadcastAgeThresholdSetting.INSTANCE.getValue()));
                String LIZ4 = C10000b0.LIZ(2131828212);
                n.LIZIZ(LIZ4, "");
                String LIZ5 = y.LIZ(LIZ4, "{username}", "%s");
                Object[] objArr = new Object[1];
                if (room != null) {
                    user = room.getOwner();
                }
                objArr[0] = C07930Ul.LIZ(user);
                String LIZ6 = AnonymousClass0HH.LIZ(LIZ5, Arrays.copyOf(objArr, 1));
                n.LIZIZ(LIZ6, "");
                r8.LIZ((CharSequence) LIZ6);
                r8.LIZ(2131829017, (C11170ct) new C34171Xj(i2));
                LiveDialog LIZIZ2 = r8.LIZIZ();
                C11190cv r13 = new C11190cv();
                r13.LIZ = spannableString;
                r13.LIZIZ = new C21020sm(this, LIZIZ2, i2);
                LIZIZ2.LIZ((C11180cu) r13.LIZ());
                LIZ(LIZIZ2);
                C24290y3.LIZ(i2);
                return;
            default:
                G0S.LIZ(this.context, th);
                return;
        }
    }

    public final void LIZ(C34131Xf r18) {
        Room room;
        int i;
        int i2;
        DialogFragment dialogFragment;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog2;
        Integer num;
        C33431Un LIZJ2;
        LiveDialogFragment liveDialogFragment;
        Fragment fragment;
        Fragment fragment2;
        DialogFragment dialogFragment2;
        BaseFragment baseFragment;
        Boolean bool;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog3;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog4;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog5;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog6;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog7;
        DialogFragment dialogFragment3;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog8;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference = this.LJI;
        Fragment fragment3 = null;
        C34131Xf r2 = r18;
        if (!(weakReference == null || (liveDialogFragment = (LiveDialogFragment) weakReference.get()) == null || !liveDialogFragment.LJIIJ())) {
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJI;
            if (weakReference2 == null || (multiLiveGuestUserInfoDialog8 = (MultiLiveGuestUserInfoDialog) weakReference2.get()) == null) {
                fragment = null;
            } else {
                fragment = multiLiveGuestUserInfoDialog8.LJ;
            }
            if (fragment instanceof MultiGuestUserInfoFragment) {
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference3 = this.LJI;
                if (!(weakReference3 == null || (dialogFragment3 = (DialogFragment) weakReference3.get()) == null)) {
                    dialogFragment3.dismiss();
                }
            } else {
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference4 = this.LJI;
                if (weakReference4 == null || (multiLiveGuestUserInfoDialog7 = (MultiLiveGuestUserInfoDialog) weakReference4.get()) == null) {
                    fragment2 = null;
                } else {
                    fragment2 = multiLiveGuestUserInfoDialog7.LJ;
                }
                if (fragment2 instanceof MultiGuestPreviewFragment) {
                    WeakReference<MultiLiveGuestUserInfoDialog> weakReference5 = this.LJI;
                    if (weakReference5 == null || (multiLiveGuestUserInfoDialog6 = (MultiLiveGuestUserInfoDialog) weakReference5.get()) == null) {
                        baseFragment = null;
                    } else {
                        baseFragment = multiLiveGuestUserInfoDialog6.LJ;
                    }
                    Objects.requireNonNull(baseFragment, "null cannot be cast to non-null type com.bytedance.android.live.liveinteract.multilive.guset.fragment.MultiGuestPreviewFragment");
                    BaseFragment baseFragment2 = baseFragment;
                    if (baseFragment2 != null) {
                        bool = Boolean.valueOf(baseFragment2.isViewValid());
                    } else {
                        bool = null;
                    }
                    if (bool.booleanValue()) {
                        this.LIZLLL = C19950r3.GO_LIVE;
                        WeakReference<MultiLiveGuestUserInfoDialog> weakReference6 = this.LJI;
                        if (!(weakReference6 == null || (multiLiveGuestUserInfoDialog5 = (MultiLiveGuestUserInfoDialog) weakReference6.get()) == null)) {
                            multiLiveGuestUserInfoDialog5.LIZ(this.LIZLLL, this.LJ);
                        }
                        WeakReference<MultiLiveGuestUserInfoDialog> weakReference7 = this.LJI;
                        if (!(weakReference7 == null || (multiLiveGuestUserInfoDialog4 = (MultiLiveGuestUserInfoDialog) weakReference7.get()) == null)) {
                            multiLiveGuestUserInfoDialog4.LIZ((AnonymousClass1X3) null, r2);
                        }
                        WeakReference<MultiLiveGuestUserInfoDialog> weakReference8 = this.LJI;
                        if (!(weakReference8 == null || (multiLiveGuestUserInfoDialog3 = (MultiLiveGuestUserInfoDialog) weakReference8.get()) == null)) {
                            fragment3 = multiLiveGuestUserInfoDialog3.LJ;
                        }
                        Objects.requireNonNull(fragment3, "null cannot be cast to non-null type com.bytedance.android.live.liveinteract.multilive.guset.fragment.MultiGuestPreviewFragment");
                        ((MultiGuestPreviewFragment) fragment3).LIZJ();
                        return;
                    }
                }
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference9 = this.LJI;
                if (!(weakReference9 == null || (dialogFragment2 = (DialogFragment) weakReference9.get()) == null)) {
                    dialogFragment2.dismiss();
                }
            }
        }
        this.LIZLLL = C19950r3.GO_LIVE;
        C515122b r3 = this.LIZJ;
        if (r3 != null) {
            room = r3.LIZJ;
        } else {
            room = null;
        }
        C515122b r32 = this.LIZJ;
        if (r32 == null || (LIZJ2 = r32.LIZJ()) == null) {
            i = 0;
        } else {
            i = LIZJ2.LJI();
        }
        C42541mO r5 = new C42541mO(room, false, (List<? extends Po7>) null, "", i, this.dataChannel);
        C22120uY r33 = this.LJ;
        if (r33 == null || (num = r33.LIZ) == null) {
            i2 = -1;
        } else {
            i2 = num.intValue();
        }
        C22120uY r11 = new C22120uY(Integer.valueOf(i2), 1, 0, 0, 12);
        C22310ur r6 = MultiLiveGuestUserInfoDialog.LJIIIIZZ;
        DataChannel dataChannel = this.dataChannel;
        n.LIZIZ(dataChannel, "");
        this.LJI = new WeakReference<>(r6.LIZ(dataChannel, (AnonymousClass1US) r5, (WeakReference<C41721l4>) new WeakReference(this.LIZJ), this.LIZLLL, r11, "anchor_permit"));
        AnonymousClass0AA LJIILL2 = LJIILL();
        if (LJIILL2 != null) {
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference10 = this.LJI;
            if (!(weakReference10 == null || (multiLiveGuestUserInfoDialog2 = (MultiLiveGuestUserInfoDialog) weakReference10.get()) == null)) {
                multiLiveGuestUserInfoDialog2.LIZ(this.LIZLLL, this.LJ);
            }
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference11 = this.LJI;
            if (!(weakReference11 == null || (multiLiveGuestUserInfoDialog = (MultiLiveGuestUserInfoDialog) weakReference11.get()) == null)) {
                multiLiveGuestUserInfoDialog.LIZ((AnonymousClass1X3) null, r2);
            }
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference12 = this.LJI;
            if (!(weakReference12 == null || (dialogFragment = (DialogFragment) weakReference12.get()) == null)) {
                dialogFragment.show(LJIILL2, "MultiLiveGuestUserInfoDialog");
            }
        }
        C21810u3.LIZIZ.LIZ("guest_apply_anchor", "0");
    }

    public static /* synthetic */ void LIZ(MultiGuestV3GuestWidget multiGuestV3GuestWidget, List list, String str, C34131Xf r9, int i) {
        List list2 = list;
        String str2 = str;
        C34131Xf r5 = null;
        if ((i & 2) != 0) {
            list2 = null;
        }
        if ((i & 4) != 0) {
            str2 = null;
        }
        if ((i & 16) == 0) {
            r5 = r9;
        }
        multiGuestV3GuestWidget.LIZ(false, (List<? extends Po7>) list2, str2, (AnonymousClass1X3) null, r5);
    }

    private final void LIZ(boolean z, List<? extends Po7> list, String str, AnonymousClass1X3 r18, C34131Xf r19) {
        Room room;
        int i;
        int i2;
        DialogFragment dialogFragment;
        Fragment fragment;
        AnonymousClass1US r2;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog2;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog3;
        Integer num;
        LiveDialogFragment liveDialogFragment;
        C33431Un LIZJ2;
        C515122b r1 = this.LIZJ;
        MultiGuestUserInfoFragment multiGuestUserInfoFragment = null;
        if (r1 != null) {
            room = r1.LIZJ;
        } else {
            room = null;
        }
        C515122b r22 = this.LIZJ;
        if (r22 == null || (LIZJ2 = r22.LIZJ()) == null) {
            i = 0;
        } else {
            i = LIZJ2.LJI();
        }
        C42541mO r6 = new C42541mO(room, false, list, str, i, this.dataChannel);
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference = this.LJI;
        if (weakReference == null || (liveDialogFragment = (LiveDialogFragment) weakReference.get()) == null || !liveDialogFragment.LJIIJ()) {
            C22120uY r23 = this.LJ;
            if (r23 == null || (num = r23.LIZ) == null) {
                i2 = -1;
            } else {
                i2 = num.intValue();
            }
            C22120uY r7 = new C22120uY(Integer.valueOf(i2), 1, 0, 0, 12);
            C22310ur r8 = MultiLiveGuestUserInfoDialog.LJIIIIZZ;
            DataChannel dataChannel = this.dataChannel;
            n.LIZIZ(dataChannel, "");
            this.LJI = new WeakReference<>(r8.LIZ(dataChannel, (AnonymousClass1US) r6, (WeakReference<C41721l4>) new WeakReference(this.LIZJ), this.LIZLLL, r7, "anchor_invite"));
            AnonymousClass0AA LJIILL2 = LJIILL();
            if (LJIILL2 != null) {
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJI;
                if (!(weakReference2 == null || (multiLiveGuestUserInfoDialog3 = (MultiLiveGuestUserInfoDialog) weakReference2.get()) == null)) {
                    multiLiveGuestUserInfoDialog3.LIZ(this.LIZLLL, this.LJ);
                }
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference3 = this.LJI;
                if (!(weakReference3 == null || (multiLiveGuestUserInfoDialog2 = (MultiLiveGuestUserInfoDialog) weakReference3.get()) == null)) {
                    multiLiveGuestUserInfoDialog2.LIZ(r18, r19);
                }
                if (!C20260rY.LIZJ.LIZ().LIZ(this.LJ) || this.LIZLLL != C19950r3.SEND_REQUEST) {
                    WeakReference<MultiLiveGuestUserInfoDialog> weakReference4 = this.LJI;
                    if (weakReference4 != null && (dialogFragment = (DialogFragment) weakReference4.get()) != null) {
                        dialogFragment.show(LJIILL2, "MultiLiveGuestUserInfoDialog");
                        return;
                    }
                    return;
                }
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference5 = this.LJI;
                if (weakReference5 == null || (multiLiveGuestUserInfoDialog = (MultiLiveGuestUserInfoDialog) weakReference5.get()) == null) {
                    fragment = null;
                } else {
                    fragment = multiLiveGuestUserInfoDialog.LJ();
                }
                if (fragment instanceof MultiGuestUserInfoFragment) {
                    multiGuestUserInfoFragment = fragment;
                }
                MultiGuestUserInfoFragment multiGuestUserInfoFragment2 = multiGuestUserInfoFragment;
                if (multiGuestUserInfoFragment2 != null) {
                    Context context = getContext();
                    n.LIZIZ(context, "");
                    M12.LIZ(context);
                    C31861Om LIZ = C31861Om.LIZ();
                    n.LIZIZ(LIZ, "");
                    Integer num2 = (Integer) LIZ.LJIILIIL;
                    C19950r3 r24 = multiGuestUserInfoFragment2.LJIIIIZZ;
                    if (r24 != null && C22760va.LIZIZ[r24.ordinal()] == 1 && num2 != null && num2.intValue() == 0 && (r2 = multiGuestUserInfoFragment2.LJIIIZ) != null && !r2.LJ()) {
                        multiGuestUserInfoFragment2.LIZ(context, 0);
                    }
                }
            }
        }
    }
}
