package com.ss.android.ugc.aweme.commercialize.profile;

import X.0CB;
import X.0CH;
import X.2UX;
import X.2nK;
import X.6Is;
import X.AiA;
import X.C2640Kw3;
import X.C2645Kw8;
import X.C2648KwB;
import X.C2650KwD;
import X.C2682Kwj;
import X.C3290LFp;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.AwemeRawAd;
import kotlin.h.b.n;

public final class AdNewFakePopUpWebPageWidget extends AbsAdProfileWidget implements 6Is {
    public static final C2650KwD LJIIL = new C2650KwD((byte) 0);
    public C2640Kw3 LJIIIZ;
    public String LJIIJ;
    public long LJIIJJI;
    public final C2682Kwj LJIILIIL = new C2682Kwj(this);
    public final C2648KwB LJIILJJIL = new C2648KwB(this);
    public final C2645Kw8 LJIILL = new C2645Kw8(this);

    static {
        Covode.recordClassIndex(59416);
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        super.onStateChanged(r1, r2);
    }

    private final boolean LJ() {
        AwemeRawAd awemeRawAd;
        String str;
        AwemeRawAd awemeRawAd2;
        AiA fakeAuthor;
        AwemeRawAd awemeRawAd3;
        Aweme aweme = this.LIZ;
        Boolean bool = null;
        if (aweme != null) {
            awemeRawAd = aweme.getAwemeRawAd();
        } else {
            awemeRawAd = null;
        }
        if (C3290LFp.LJI(awemeRawAd)) {
            return false;
        }
        Aweme aweme2 = this.LIZ;
        if (aweme2 == null || (awemeRawAd3 = aweme2.getAwemeRawAd()) == null) {
            str = null;
        } else {
            str = awemeRawAd3.getOpenUrl();
        }
        if (!TextUtils.isEmpty(str)) {
            return false;
        }
        Aweme aweme3 = this.LIZ;
        if (!(aweme3 == null || (awemeRawAd2 = aweme3.getAwemeRawAd()) == null || (fakeAuthor = awemeRawAd2.getFakeAuthor()) == null)) {
            bool = fakeAuthor.getAutoShowWebview();
        }
        if (n.LIZ(bool, true)) {
            return true;
        }
        return false;
    }

    public final void LIZ(long j) {
        if (this.LJIIIZ != null) {
            2UX r1 = new 2UX();
            r1.LIZ("duration", j);
            2nK.LIZ("h5_stay_time", r1.LIZ);
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:63:0x0110, code lost:
        if (kotlin.h.b.n.LIZ(r3, "app") != false) goto L_0x0112;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZ(boolean r14) {
        /*
            r13 = this;
            r12 = 769(0x301, float:1.078E-42)
            com.bytedance.frameworks.apm.trace.MethodCollector.i(r12)
            r4 = 8
            r5 = 1
            r3 = 0
            if (r14 == 0) goto L_0x01a4
            androidx.fragment.app.Fragment r0 = r13.LJII
            if (r0 == 0) goto L_0x01a1
            X.1hK r7 = r0.getActivity()
        L_0x0013:
            r1 = 0
            java.lang.String r2 = ""
            if (r7 == 0) goto L_0x00c5
            androidx.fragment.app.Fragment r0 = r13.LJII
            if (r0 == 0) goto L_0x00c5
            android.content.Context r0 = r0.getContext()
            if (r0 == 0) goto L_0x00c5
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r13.LIZ
            if (r0 == 0) goto L_0x019e
            com.ss.android.ugc.aweme.feed.model.AwemeRawAd r0 = r0.getAwemeRawAd()
            if (r0 == 0) goto L_0x019e
            java.lang.String r0 = r0.getSource()
        L_0x0030:
            boolean r0 = android.text.TextUtils.isEmpty(r0)
            if (r0 != 0) goto L_0x018b
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r13.LIZ
            if (r0 == 0) goto L_0x0188
            com.ss.android.ugc.aweme.feed.model.AwemeRawAd r0 = r0.getAwemeRawAd()
            if (r0 == 0) goto L_0x0188
            java.lang.String r8 = r0.getSource()
        L_0x0044:
            X.KwD r9 = LJIIL
            X.D4I r6 = new X.D4I
            r6.<init>()
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r13.LIZ
            if (r0 == 0) goto L_0x005b
            com.ss.android.ugc.aweme.feed.model.AwemeRawAd r0 = r0.getAwemeRawAd()
            if (r0 == 0) goto L_0x005b
            java.lang.String r0 = r0.getWebUrl()
            if (r0 != 0) goto L_0x005c
        L_0x005b:
            r0 = r2
        L_0x005c:
            r6.LIZ(r0)
            androidx.fragment.app.Fragment r0 = r13.LJII
            r6.LIZ(r0)
            int r0 = X.4CM.LIZ()
            r6.LIZ(r0)
            if (r8 != 0) goto L_0x006e
            r8 = r2
        L_0x006e:
            r6.LIZIZ(r8)
            com.ss.android.ugc.aweme.feed.model.Aweme r11 = r13.LIZ
            android.os.Bundle r10 = new android.os.Bundle
            r10.<init>()
            androidx.fragment.app.Fragment r0 = r13.LJII
            if (r0 == 0) goto L_0x0082
            android.content.Context r8 = r0.getContext()
            if (r8 != 0) goto L_0x0165
        L_0x0082:
            r6.LIZ(r10)
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r13.LIZ
            if (r0 == 0) goto L_0x0162
            com.ss.android.ugc.aweme.feed.model.AwemeRawAd r0 = r0.getAwemeRawAd()
        L_0x008d:
            r6.LIZ(r0)
            X.KwO r11 = r6.LIZ()
            X.Kw8 r10 = r13.LJIILL
            X.Kwj r8 = r13.LJIILIIL
            X.M12.LIZ((java.lang.Object) r7, (java.lang.Object) r11)
            X.Kw3 r6 = r9.LIZIZ(r7)
            if (r6 != 0) goto L_0x00be
            X.Kw3 r6 = new X.Kw3
            r6.<init>(r7, r1)
            r0 = 2131362023(0x7f0a00e7, float:1.8343815E38)
            r6.setId(r0)
            r6.setParams(r11)
            r6.setMBehaviorCallback(r10)
            r6.setKeyDownCallBack(r8)
            android.widget.FrameLayout r0 = r9.LIZ(r7)
            if (r0 == 0) goto L_0x00be
            r0.addView(r6)
        L_0x00be:
            r13.LJIIIZ = r6
            X.KwB r0 = r13.LJIILJJIL
            r6.setTitleBarCallback(r0)
        L_0x00c5:
            r6 = 0
            r13.LJIIJJI = r6
            X.KwD r7 = LJIIL
            androidx.fragment.app.Fragment r0 = r13.LJII
            if (r0 == 0) goto L_0x015f
            X.1hK r6 = r0.getActivity()
        L_0x00d3:
            X.Kul r8 = new X.Kul
            r8.<init>()
            androidx.fragment.app.Fragment r0 = r13.LJII
            if (r0 == 0) goto L_0x015d
            android.content.Context r0 = r0.getContext()
        L_0x00e0:
            r8.LIZ((android.content.Context) r0)
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r13.LIZ
            r8.LIZ((com.ss.android.ugc.aweme.feed.model.Aweme) r0)
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r13.LIZ
            if (r0 == 0) goto L_0x015b
            com.ss.android.ugc.aweme.feed.model.AwemeRawAd r0 = r0.getAwemeRawAd()
        L_0x00f0:
            r8.LIZ((com.ss.android.ugc.aweme.feed.model.AwemeRawAd) r0)
            r8.LIZIZ((int) r4)
            boolean r0 = r13.LJ()
            if (r0 == 0) goto L_0x0151
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r13.LIZ
            if (r0 == 0) goto L_0x010a
            com.ss.android.ugc.aweme.feed.model.AwemeRawAd r0 = r0.getAwemeRawAd()
            if (r0 == 0) goto L_0x010a
            java.lang.String r3 = r0.getType()
        L_0x010a:
            java.lang.String r0 = "app"
            boolean r0 = kotlin.h.b.n.LIZ(r3, r0)
            if (r0 == 0) goto L_0x0151
        L_0x0112:
            r8.LIZ((int) r5)
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r13.LIZ
            if (r0 == 0) goto L_0x011f
            java.lang.String r0 = r0.getAid()
            if (r0 != 0) goto L_0x014f
        L_0x011f:
            r8.LIZJ(r2)
            X.KwI r3 = r8.LIZ()
            X.Kw3 r2 = r7.LIZIZ(r6)
            if (r2 == 0) goto L_0x014b
            boolean r0 = r2.LJII()
            if (r0 != 0) goto L_0x014b
            android.widget.FrameLayout r0 = r7.LIZ(r6)
            if (r0 == 0) goto L_0x013b
            r0.setVisibility(r1)
        L_0x013b:
            X.Kx8 r1 = r2.getActionMode()
            int r0 = r3.LIZLLL
            r1.LJFF = r0
            X.KwU r0 = new X.KwU
            r0.<init>(r2, r3)
            r2.LIZ((X.C4939Ls2<? extends java.lang.Object>) r0)
        L_0x014b:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r12)
            return
        L_0x014f:
            r2 = r0
            goto L_0x011f
        L_0x0151:
            boolean r0 = r13.LJ()
            if (r0 == 0) goto L_0x0159
            r5 = 5
            goto L_0x0112
        L_0x0159:
            r5 = 4
            goto L_0x0112
        L_0x015b:
            r0 = r3
            goto L_0x00f0
        L_0x015d:
            r0 = r3
            goto L_0x00e0
        L_0x015f:
            r6 = r3
            goto L_0x00d3
        L_0x0162:
            r0 = r3
            goto L_0x008d
        L_0x0165:
            kotlin.h.b.n.LIZIZ(r8, r2)
            if (r11 == 0) goto L_0x0082
            com.ss.android.ugc.aweme.feed.model.AwemeRawAd r0 = r11.getAwemeRawAd()
            if (r0 != 0) goto L_0x0172
            goto L_0x0082
        L_0x0172:
            X.Kti r0 = X.C2495Kti.LIZ
            r0.LIZ(r10, r11, r8)
            X.Kti r0 = X.C2495Kti.LIZ
            r0.LIZIZ(r10, r11, r8)
            X.Kti r0 = X.C2495Kti.LIZ
            r0.LIZJ(r10, r11, r8)
            X.Kti r0 = X.C2495Kti.LIZ
            r0.LIZ(r10, r8)
            goto L_0x0082
        L_0x0188:
            r8 = r3
            goto L_0x0044
        L_0x018b:
            com.ss.android.ugc.aweme.feed.model.Aweme r0 = r13.LIZ
            if (r0 == 0) goto L_0x019b
            com.ss.android.ugc.aweme.feed.model.AwemeRawAd r0 = r0.getAwemeRawAd()
            if (r0 == 0) goto L_0x019b
            java.lang.String r8 = r0.getWebTitle()
            if (r8 != 0) goto L_0x0044
        L_0x019b:
            r8 = r2
            goto L_0x0044
        L_0x019e:
            r0 = r3
            goto L_0x0030
        L_0x01a1:
            r7 = r3
            goto L_0x0013
        L_0x01a4:
            X.KwD r2 = LJIIL
            androidx.fragment.app.Fragment r0 = r13.LJII
            if (r0 == 0) goto L_0x01ae
            X.1hK r3 = r0.getActivity()
        L_0x01ae:
            X.Kw3 r1 = r2.LIZIZ(r3)
            if (r1 == 0) goto L_0x01ce
            boolean r0 = r1.LJII()
            if (r0 != r5) goto L_0x01ca
            r1.LIZ((boolean) r5)
            android.widget.FrameLayout r0 = r2.LIZ(r3)
            if (r0 == 0) goto L_0x01ca
            r0.setVisibility(r4)
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r12)
            return
        L_0x01ca:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r12)
            return
        L_0x01ce:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r12)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.commercialize.profile.AdNewFakePopUpWebPageWidget.LIZ(boolean):void");
    }
}
