package com.bytedance.android.livesdk.impl.revenue.subscription.ui;

import X.05A;
import X.0AA;
import X.0AP;
import X.0HH;
import X.0Uo;
import X.0cm;
import X.0dA;
import X.0dh;
import X.0yx;
import X.1hK;
import X.1jk;
import X.2sG;
import X.2sR;
import X.3Ok;
import X.7vl;
import X.BRR;
import X.C1430G2l;
import X.C1781GFy;
import X.C2297GZu;
import X.C3028Glh;
import X.C3491GtA;
import X.C4100H7d;
import X.C5629HmY;
import X.C5633Hmc;
import X.C6455Hzs;
import X.Crj;
import X.GDG;
import X.GKZ;
import X.GL6;
import X.GL7;
import X.GL9;
import X.GLF;
import X.GLL;
import X.GLO;
import X.GLQ;
import X.GLR;
import X.GLS;
import X.GLT;
import X.K4r;
import X.M12;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.bytedance.android.livesdk.LiveDialogFragment;
import com.bytedance.android.livesdk.api.revenue.subscription.ISubscribeService;
import com.bytedance.android.livesdk.impl.revenue.subscription.api.SubscribeApi;
import com.bytedance.android.livesdk.livesetting.model.LiveSubscribeLynxMap;
import com.bytedance.android.livesdk.livesetting.other.LiveSubscribeNoteEntranceSetting;
import com.bytedance.android.livesdk.livesetting.other.subscribe.LiveSubscriptionSetting;
import com.bytedance.android.livesdk.subscribe.model.GetSubInfoResponse;
import com.bytedance.android.livesdk.subscribe.model.PayPalBindInfo;
import com.bytedance.android.livesdk.subscribe.model.SubSettingStatus;
import com.bytedance.android.livesdk.subscribe.model.invite.SubInvitationEntrancePrompt;
import com.bytedance.android.livesdk.ui.BaseFragment;
import com.bytedance.android.livesdkapi.host.IHostSubscription;
import com.bytedance.covode.number.Covode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import kotlin.h.b.n;

public final class SubscriptionSettingFragment extends BaseFragment implements C5633Hmc {
    public static final GDG LJ = new GDG((byte) 0);
    public String LIZ = "";
    public GetSubInfoResponse LIZIZ;
    public String LIZJ;
    public String LIZLLL;
    public boolean LJFF;
    public final Crj LJI = 7vl.LIZ(GKZ.LIZ);
    public boolean LJII;
    public HashMap LJIIIIZZ;

    static {
        Covode.recordClassIndex(16918);
    }

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

    public final LiveSubscribeLynxMap LIZIZ() {
        return (LiveSubscribeLynxMap) this.LJI.getValue();
    }

    public final boolean LIZ() {
        return n.LIZ(this.LIZ, "live_take_page");
    }

    public final void LIZ(boolean z) {
        GetSubInfoResponse getSubInfoResponse = this.LIZIZ;
        if (getSubInfoResponse != null) {
            LIZ(getSubInfoResponse, z);
            PayPalBindInfo payPalBindInfo = getSubInfoResponse.LJIIIIZZ;
            if (C1430G2l.LIZ(payPalBindInfo != null ? Boolean.valueOf(payPalBindInfo.LJ) : null)) {
                LJ();
            }
            if (!this.LJFF) {
                LIZLLL();
                this.LJFF = true;
            }
            LJI();
        }
    }

    public final void LIZ(BRR brr) {
        List<LiveDialogFragment> LJFF2;
        0AA fragmentManager;
        1hK activity;
        K4r k4r;
        String LJFF3;
        0AA fragmentManager2;
        List<Object> LJFF4;
        M12.LIZ(brr);
        String str = brr.LIZ;
        boolean z = false;
        String str2 = null;
        switch (str.hashCode()) {
            case -1809547272:
                if (!str.equals("anchor_subscribe_emotes_status_change")) {
                    return;
                }
                break;
            case -1714027576:
                if (!str.equals("anchor_subscribe_community_status_change")) {
                    return;
                }
                break;
            case -1710760782:
                if (str.equals("open_native_subscription_settings")) {
                    IHostSubscription LIZ2 = 0cm.LIZ(IHostSubscription.class);
                    K4r k4r2 = brr.LIZIZ;
                    if (k4r2 != null) {
                        str2 = k4r2.LJFF("type");
                    }
                    if (str2 != null) {
                        int hashCode = str2.hashCode();
                        if (hashCode != 106852524) {
                            if (hashCode == 110066619 && str2.equals("fullscreen")) {
                                String str3 = this.LIZLLL;
                                if (str3 != null && str3.equals("creator_tools_page") && (activity = getActivity()) != null && LIZ2 != null) {
                                    n.LIZIZ(activity, "");
                                    Context baseContext = activity.getBaseContext();
                                    n.LIZIZ(baseContext, "");
                                    LIZ2.LIZ(baseContext);
                                    return;
                                }
                                return;
                            }
                        } else if (str2.equals("popup")) {
                            LiveDialogFragment previewSubscriptionSettingDialog = 0cm.LIZ(ISubscribeService.class).getPreviewSubscriptionSettingDialog(0, "live_take_page");
                            0AA fragmentManager3 = getFragmentManager();
                            if (!(fragmentManager3 == null || (LJFF2 = fragmentManager3.LJFF()) == null)) {
                                for (LiveDialogFragment liveDialogFragment : LJFF2) {
                                    if (liveDialogFragment instanceof PreviewSubscriptionSettingDialog) {
                                        if (!liveDialogFragment.LJIIJ() && (fragmentManager = getFragmentManager()) != null) {
                                            0AP LIZ3 = fragmentManager.LIZ();
                                            LIZ3.LIZJ(liveDialogFragment);
                                            LIZ3.LIZJ();
                                        }
                                        z = true;
                                    }
                                }
                                if (z) {
                                    return;
                                }
                            }
                            0AA fragmentManager4 = getFragmentManager();
                            if (fragmentManager4 != null && previewSubscriptionSettingDialog != null) {
                                n.LIZIZ(fragmentManager4, "");
                                C1430G2l.LIZ(previewSubscriptionSettingDialog, fragmentManager4, "");
                                return;
                            }
                            return;
                        }
                    }
                    1hK activity2 = getActivity();
                    if (activity2 != null && LIZ2 != null) {
                        n.LIZIZ(activity2, "");
                        Context baseContext2 = activity2.getBaseContext();
                        n.LIZIZ(baseContext2, "");
                        LIZ2.LIZ(baseContext2);
                        return;
                    }
                    return;
                }
                return;
            case -57187985:
                if (str.equals("anchor_subscribe_note_status_change") && !LIZ()) {
                    this.LJII = true;
                    LIZIZ(false);
                    return;
                }
                return;
            case 1514286020:
                if (str.equals("close_native_subscription_settings") && (k4r = brr.LIZIZ) != null && (LJFF3 = k4r.LJFF("type")) != null && LJFF3.hashCode() == 106852524 && LJFF3.equals("popup") && (fragmentManager2 = getFragmentManager()) != null && (LJFF4 = fragmentManager2.LJFF()) != null) {
                    for (Object obj : LJFF4) {
                        if ((obj instanceof SubscriptionSettingFragment) && (getParentFragment() instanceof LiveDialogFragment)) {
                            LiveDialogFragment parentFragment = getParentFragment();
                            Objects.requireNonNull(parentFragment, "null cannot be cast to non-null type com.bytedance.android.livesdk.LiveDialogFragment");
                            LiveDialogFragment liveDialogFragment2 = parentFragment;
                            if (liveDialogFragment2.LJIIJ()) {
                                liveDialogFragment2.dismiss();
                            }
                        }
                    }
                    return;
                }
                return;
            case 1836714626:
                if (!str.equals("anchor_subscribe_badge_status_change")) {
                    return;
                }
                break;
            default:
                return;
        }
        LIZIZ(true);
    }

    private final void LJ() {
        ((SubscribeApi) 0yx.LIZ().LIZ(SubscribeApi.class)).getPaypalBindingUrl("").LIZ(new C6455Hzs()).LIZ(new GLO(this), GLT.LIZ);
    }

    private final void LJFF() {
        String str;
        C3491GtA LIZ2 = C3491GtA.LJFF.LIZ("livesdk_anchor_subscription_page_show");
        LIZ(LIZ2);
        LIZLLL(LIZ2);
        LIZJ(LIZ2);
        LIZIZ(LIZ2);
        if (LIZ()) {
            str = "live_take_page";
        } else {
            str = "creator_tools_page";
        }
        LIZ2.LIZ("show_entrance", str);
        GetSubInfoResponse getSubInfoResponse = this.LIZIZ;
        int i = 1;
        if (getSubInfoResponse == null || !getSubInfoResponse.LIZ) {
            i = 0;
        }
        LIZ2.LIZ("is_opt_in", i);
        LIZ2.LIZLLL();
    }

    public final void onDestroyView() {
        super.onDestroyView();
        C5629HmY.LIZIZ("open_native_subscription_settings", (C5633Hmc) this);
        C5629HmY.LIZIZ("close_native_subscription_settings", (C5633Hmc) this);
        C5629HmY.LIZIZ("anchor_subscribe_badge_status_change", (C5633Hmc) this);
        C5629HmY.LIZIZ("anchor_subscribe_emotes_status_change", (C5633Hmc) this);
        C5629HmY.LIZIZ("anchor_subscribe_note_status_change", (C5633Hmc) this);
        C5629HmY.LIZIZ("anchor_subscribe_community_status_change", (C5633Hmc) this);
        HashMap hashMap = this.LJIIIIZZ;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    private final void LJI() {
        String str;
        Integer num;
        Integer num2;
        SubSettingStatus subSettingStatus;
        SubSettingStatus subSettingStatus2;
        C3491GtA LIZ2 = C3491GtA.LJFF.LIZ("livesdk_subscribe_under_review");
        LIZ(LIZ2);
        LIZLLL(LIZ2);
        LIZJ(LIZ2);
        LIZIZ(LIZ2);
        LIZ2.LIZLLL();
        String str2 = this.LIZ;
        2sR<Boolean> r0 = C1781GFy.LJJLIIIIJ;
        n.LIZIZ(r0, "");
        Object LIZ3 = r0.LIZ();
        n.LIZIZ(LIZ3, "");
        if (((Boolean) LIZ3).booleanValue()) {
            str = "open";
        } else {
            str = "close";
        }
        GetSubInfoResponse getSubInfoResponse = this.LIZIZ;
        Boolean bool = null;
        if (getSubInfoResponse == null || (subSettingStatus2 = getSubInfoResponse.LIZIZ) == null) {
            num = null;
        } else {
            num = Integer.valueOf(subSettingStatus2.LIZ);
        }
        String LIZ4 = LIZ(num);
        GetSubInfoResponse getSubInfoResponse2 = this.LIZIZ;
        if (getSubInfoResponse2 == null || (subSettingStatus = getSubInfoResponse2.LIZJ) == null) {
            num2 = null;
        } else {
            num2 = Integer.valueOf(subSettingStatus.LIZ);
        }
        String LIZ5 = LIZ(num2);
        GetSubInfoResponse getSubInfoResponse3 = this.LIZIZ;
        if (getSubInfoResponse3 != null) {
            bool = Boolean.valueOf(getSubInfoResponse3.LJFF);
        }
        GLF.LIZ(str2, str, LIZ4, LIZ5, bool);
    }

    public final void LIZJ() {
        2sR<Boolean> r0 = C1781GFy.LLZLL;
        n.LIZIZ(r0, "");
        if (!((Boolean) r0.LIZ()).booleanValue()) {
            View LIZ2 = LIZ(2131363636);
            n.LIZIZ(LIZ2, "");
            LIZ2.setVisibility(0);
            return;
        }
        View LIZ3 = LIZ(2131363636);
        n.LIZIZ(LIZ3, "");
        LIZ3.setVisibility(8);
    }

    private final void LIZLLL() {
        int i;
        C5629HmY.LIZ("open_native_subscription_settings", (C5633Hmc) this);
        C5629HmY.LIZ("close_native_subscription_settings", (C5633Hmc) this);
        C5629HmY.LIZ("anchor_subscribe_badge_status_change", (C5633Hmc) this);
        C5629HmY.LIZ("anchor_subscribe_emotes_status_change", (C5633Hmc) this);
        C5629HmY.LIZ("anchor_subscribe_note_status_change", (C5633Hmc) this);
        C5629HmY.LIZ("anchor_subscribe_community_status_change", (C5633Hmc) this);
        LIZ(2131370810).setOnCheckedChangeListener(new GL9(this));
        if (!LIZ()) {
            C1430G2l.LIZIZ(LIZ(2131370815));
            ((LinearLayout) LIZ(2131370815)).setOnClickListener(new GLS(this));
            05A LIZ2 = LIZ(2131367389);
            n.LIZIZ(LIZ2, "");
            ViewGroup.LayoutParams layoutParams = LIZ2.getLayoutParams();
            if (layoutParams instanceof RelativeLayout.LayoutParams) {
                RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) layoutParams;
                layoutParams2.addRule(12);
                layoutParams2.removeRule(3);
            }
            05A LIZ3 = LIZ(2131367389);
            n.LIZIZ(LIZ3, "");
            LIZ3.setLayoutParams(layoutParams);
        }
        C1430G2l.LIZIZ(LIZ(2131363732));
        ConstraintLayout LIZ4 = LIZ(2131366209);
        n.LIZIZ(LIZ4, "");
        int i2 = 0;
        if (LiveSubscribeNoteEntranceSetting.INSTANCE.getValue()) {
            i = 0;
        } else {
            i = 8;
        }
        LIZ4.setVisibility(i);
        ConstraintLayout LIZ5 = LIZ(2131366182);
        n.LIZIZ(LIZ5, "");
        if (LiveSubscriptionSetting.INSTANCE.getValue().LIZ != 1) {
            i2 = 8;
        }
        LIZ5.setVisibility(i2);
        LIZ(2131370824).setOnClickListener(new GL6(this));
        LJFF();
    }

    public final C3491GtA LIZIZ(C3491GtA gtA) {
        gtA.LIZ("click_position", this.LIZ);
        return gtA;
    }

    public final void LIZ(String str) {
        C2297GZu.LIZ.LIZ(getContext(), str, "sub_config", LIZ());
    }

    private final void LIZJ(boolean z) {
        C3491GtA LIZ2 = C3491GtA.LJFF.LIZ("livesdk_subscription_invitation_plan_show");
        LIZ(LIZ2);
        LIZ2.LIZ("has_red_dot", z ? 1 : 0);
        LIZ2.LIZ("event_page", this.LIZ);
        LIZ2.LIZLLL();
    }

    public final C3491GtA LIZ(C3491GtA gtA) {
        C3028Glh LIZIZ2 = C4100H7d.LIZ().LIZIZ();
        n.LIZIZ(LIZIZ2, "");
        gtA.LJII(String.valueOf(LIZIZ2.LIZJ()));
        return gtA;
    }

    public final C3491GtA LIZLLL(C3491GtA gtA) {
        Integer num;
        SubSettingStatus subSettingStatus;
        GetSubInfoResponse getSubInfoResponse = this.LIZIZ;
        if (getSubInfoResponse == null || (subSettingStatus = getSubInfoResponse.LIZIZ) == null) {
            num = null;
        } else {
            num = Integer.valueOf(subSettingStatus.LIZ);
        }
        gtA.LIZ("badge_status", LIZ(num));
        return gtA;
    }

    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        Bundle arguments = getArguments();
        if (arguments != null) {
            String string = arguments.getString("arg_enter_from");
            if (string == null) {
                n.LIZIZ();
            }
            this.LIZ = string;
        }
        LIZIZ(false);
    }

    public final LayoutInflater onGetLayoutInflater(Bundle bundle) {
        LayoutInflater cloneInContext = SubscriptionSettingFragment.super.onGetLayoutInflater(bundle).cloneInContext(0dh.LIZ(getActivity()));
        n.LIZIZ(cloneInContext, "");
        return cloneInContext;
    }

    private final int LIZIZ(int i) {
        2sR<List<String>> r0 = C1781GFy.LJJLIIIJJIZ;
        n.LIZIZ(r0, "");
        List list = (List) r0.LIZ();
        if (list.contains("103")) {
            return 0;
        }
        if (i == 1) {
            ArrayList arrayList = new ArrayList();
            arrayList.addAll(list);
            arrayList.add("103");
            2sR<List<String>> r02 = C1781GFy.LJJLIIIJJIZ;
            n.LIZIZ(r02, "");
            r02.LIZ(arrayList);
        }
        return i;
    }

    public final C3491GtA LIZJ(C3491GtA gtA) {
        Integer num;
        SubSettingStatus subSettingStatus;
        GetSubInfoResponse getSubInfoResponse = this.LIZIZ;
        if (getSubInfoResponse == null || (subSettingStatus = getSubInfoResponse.LIZJ) == null) {
            num = null;
        } else {
            num = Integer.valueOf(subSettingStatus.LIZ);
        }
        gtA.LIZ("emote_status", LIZ(num));
        return gtA;
    }

    private final void LIZIZ(boolean z) {
        GLF.LIZ();
        C3028Glh LIZIZ2 = C4100H7d.LIZ().LIZIZ();
        n.LIZIZ(LIZIZ2, "");
        0Uo LIZ2 = LIZIZ2.LIZ();
        n.LIZIZ(LIZ2, "");
        ((SubscribeApi) 0yx.LIZ().LIZ(SubscribeApi.class)).getSubscribeInfo(true, LIZ2.getSecUid()).LIZ(new C6455Hzs()).LIZ(new GLL(this, z), GLQ.LIZ);
    }

    private final void LIZLLL(boolean z) {
        String str;
        Boolean bool;
        String str2;
        C3491GtA LIZ2 = C3491GtA.LJFF.LIZ("livesdk_bind_paypal_page_show");
        LIZ(LIZ2);
        LIZIZ(LIZ2);
        LIZ2.LIZ("has_paypal_account", z ? 1 : 0);
        if (LIZ()) {
            str = "live_take";
        } else {
            str = "creator_tool";
        }
        LIZ2.LIZ("popup_entrance", str);
        GetSubInfoResponse getSubInfoResponse = this.LIZIZ;
        if (getSubInfoResponse != null) {
            bool = Boolean.valueOf(getSubInfoResponse.LIZ);
        } else {
            bool = null;
        }
        if (C1430G2l.LIZ(bool)) {
            str2 = "pass";
        } else {
            str2 = "under_review";
        }
        LIZ2.LIZ("review_status", str2);
        LIZ2.LIZLLL();
    }

    private final void LIZJ(int i) {
        if (i == 0) {
            1jk LIZ2 = LIZ(2131363637);
            n.LIZIZ(LIZ2, "");
            LIZ2.setVisibility(8);
        } else if (i == 1) {
            1jk LIZ3 = LIZ(2131363637);
            n.LIZIZ(LIZ3, "");
            LIZ3.setVisibility(0);
            LIZ(2131363637).setText(2131830427);
            LIZ(2131363637).setTextColor(0dA.LIZ(getView(), 2130971316));
        } else if (i == 2) {
            1jk LIZ4 = LIZ(2131363637);
            n.LIZIZ(LIZ4, "");
            LIZ4.setVisibility(0);
            LIZ(2131363637).setText(2131830428);
            LIZ(2131363637).setTextColor(0dA.LIZ(getView(), 2130971312));
        } else if (i == 3) {
            1jk LIZ5 = LIZ(2131363637);
            n.LIZIZ(LIZ5, "");
            LIZ5.setVisibility(0);
            LIZ(2131363637).setText(2131830429);
            LIZ(2131363637).setTextColor(0dA.LIZ(getView(), 2130971338));
        }
    }

    private final void LIZ(List<SubInvitationEntrancePrompt> list) {
        boolean z;
        String str;
        String str2;
        String str3;
        if (list != null) {
            2sG r3 = new 2sG();
            Long l = null;
            r3.element = null;
            SubInvitationEntrancePrompt subInvitationEntrancePrompt = null;
            SubInvitationEntrancePrompt subInvitationEntrancePrompt2 = null;
            for (SubInvitationEntrancePrompt subInvitationEntrancePrompt3 : list) {
                int i = subInvitationEntrancePrompt3.LIZJ;
                if (i == 1) {
                    subInvitationEntrancePrompt = subInvitationEntrancePrompt3;
                } else if (i == 2) {
                    subInvitationEntrancePrompt2 = subInvitationEntrancePrompt3;
                }
            }
            3Ok r2 = new 3Ok();
            r2.element = false;
            if (subInvitationEntrancePrompt == null || (str3 = subInvitationEntrancePrompt.LIZIZ) == null || str3.length() == 0) {
                z = true;
            } else {
                z = false;
            }
            if (!z) {
                2sR<Long> r0 = C1781GFy.LJJLIIIJLJLI;
                n.LIZIZ(r0, "");
                Object LIZ2 = r0.LIZ();
                if (subInvitationEntrancePrompt != null) {
                    l = Long.valueOf(subInvitationEntrancePrompt.LIZ);
                }
                if (!n.LIZ(LIZ2, l)) {
                    r3.element = subInvitationEntrancePrompt;
                    View LIZ3 = LIZ(2131366148);
                    n.LIZIZ(LIZ3, "");
                    LIZ3.setVisibility(0);
                    1jk LIZ4 = LIZ(2131372037);
                    n.LIZIZ(LIZ4, "");
                    if (subInvitationEntrancePrompt == null || (str2 = subInvitationEntrancePrompt.LIZIZ) == null) {
                        str2 = "";
                    }
                    LIZ4.setText(str2);
                    r2.element = true;
                    LIZJ(r2.element);
                    LIZ(2131366199).setOnClickListener(new GL7(this, r3, r2));
                }
            }
            1jk LIZ5 = LIZ(2131372037);
            n.LIZIZ(LIZ5, "");
            if (subInvitationEntrancePrompt2 == null || (str = subInvitationEntrancePrompt2.LIZIZ) == null) {
                str = "";
            }
            LIZ5.setText(str);
            View LIZ6 = LIZ(2131366148);
            n.LIZIZ(LIZ6, "");
            LIZ6.setVisibility(8);
            r2.element = false;
            LIZJ(r2.element);
            LIZ(2131366199).setOnClickListener(new GL7(this, r3, r2));
        }
    }

    public final String LIZ(Integer num) {
        if (num == null) {
            return "null";
        }
        if (num.intValue() == 1) {
            return "pass";
        }
        if (num.intValue() == 2) {
            return "failed";
        }
        if (num.intValue() == 3) {
            return "under_review";
        }
        return "null";
    }

    public final void onViewCreated(View view, Bundle bundle) {
        M12.LIZ(view);
        super.onViewCreated(view, bundle);
        if (!LIZ()) {
            C1430G2l.LIZIZ(LIZ(2131362569));
            ((FrameLayout) LIZ(2131362569)).setOnClickListener(new GLR(this));
        }
        LIZJ();
        LIZ(false);
    }

    private final void LIZ(int i, boolean z) {
        2sR<Integer> r0 = C1781GFy.LLZLLIL;
        n.LIZIZ(r0, "");
        Integer num = (Integer) r0.LIZ();
        if (num == null || num.intValue() != 1) {
            LIZJ(i);
            2sR<Integer> r1 = C1781GFy.LLZLLIL;
            n.LIZIZ(r1, "");
            r1.LIZ(Integer.valueOf(i));
        } else if (i != 1) {
            LIZJ(i);
            2sR<Integer> r12 = C1781GFy.LLZLLIL;
            n.LIZIZ(r12, "");
            r12.LIZ(Integer.valueOf(i));
        } else {
            if (!z) {
                LIZJ(0);
            } else {
                LIZJ(1);
            }
            2sR<Integer> r13 = C1781GFy.LLZLLIL;
            n.LIZIZ(r13, "");
            r13.LIZ(1);
        }
    }

    private final void LIZ(1jk r3, int i) {
        if (i == 1) {
            r3.setText(2131830427);
            r3.setTextColor(0dA.LIZ(getView(), 2130971316));
        } else if (i == 2) {
            r3.setText(2131830428);
            r3.setTextColor(0dA.LIZ(getView(), 2130971312));
        } else if (i != 3) {
            r3.setText("");
        } else {
            r3.setText(2131830429);
            r3.setTextColor(0dA.LIZ(getView(), 2130971338));
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:12:0x00fc  */
    /* JADX WARNING: Removed duplicated region for block: B:19:0x013a  */
    /* JADX WARNING: Removed duplicated region for block: B:23:0x0142  */
    /* JADX WARNING: Removed duplicated region for block: B:26:0x0153  */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x0178  */
    /* JADX WARNING: Removed duplicated region for block: B:75:0x0268  */
    /* JADX WARNING: Removed duplicated region for block: B:76:0x0276  */
    /* JADX WARNING: Removed duplicated region for block: B:78:0x0289  */
    /* JADX WARNING: Removed duplicated region for block: B:79:0x0299  */
    /* JADX WARNING: Removed duplicated region for block: B:84:? A[RETURN, SYNTHETIC] */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    private final void LIZ(com.bytedance.android.livesdk.subscribe.model.GetSubInfoResponse r10, boolean r11) {
        /*
            r9 = this;
            r0 = 2131362599(0x7f0a0327, float:1.8344983E38)
            android.view.View r1 = r9.LIZ((int) r0)
            android.widget.LinearLayout r1 = (android.widget.LinearLayout) r1
            X.GLC r0 = new X.GLC
            r0.<init>(r9, r10)
            r1.setOnClickListener(r0)
            r0 = 2131364523(0x7f0a0aab, float:1.8348885E38)
            android.view.View r1 = r9.LIZ((int) r0)
            android.widget.LinearLayout r1 = (android.widget.LinearLayout) r1
            X.GLB r0 = new X.GLB
            r0.<init>(r9)
            r1.setOnClickListener(r0)
            r0 = 2131366209(0x7f0a1141, float:1.8352305E38)
            android.view.View r1 = r9.LIZ((int) r0)
            androidx.constraintlayout.widget.ConstraintLayout r1 = (androidx.constraintlayout.widget.ConstraintLayout) r1
            X.GLA r0 = new X.GLA
            r0.<init>(r9, r10)
            r1.setOnClickListener(r0)
            r0 = 2131366182(0x7f0a1126, float:1.835225E38)
            android.view.View r1 = r9.LIZ((int) r0)
            androidx.constraintlayout.widget.ConstraintLayout r1 = (androidx.constraintlayout.widget.ConstraintLayout) r1
            X.GLJ r0 = new X.GLJ
            r0.<init>(r9)
            r1.setOnClickListener(r0)
            com.bytedance.android.livesdk.subscribe.model.SubSettingStatus r0 = r10.LJ
            int r0 = r0.LIZ
            r9.LIZ((int) r0, (boolean) r11)
            com.bytedance.ies.sdk.datachannel.DataChannelGlobal r2 = com.bytedance.ies.sdk.datachannel.DataChannelGlobal.LIZLLL
            java.lang.Class<X.HED> r1 = X.HED.class
            boolean r0 = r10.LIZ
            java.lang.Integer r0 = java.lang.Integer.valueOf(r0)
            r2.LIZ(r1, r0)
            boolean r0 = r10.LIZ
            r5 = 2131364524(0x7f0a0aac, float:1.8348887E38)
            r1 = 2131362600(0x7f0a0328, float:1.8344985E38)
            r4 = 1
            r3 = 0
            java.lang.String r2 = ""
            if (r0 == 0) goto L_0x02e0
            X.2sR<java.lang.Boolean> r0 = X.C1781GFy.LJJLIIIJJI
            kotlin.h.b.n.LIZIZ(r0, r2)
            java.lang.Object r0 = r0.LIZ()
            kotlin.h.b.n.LIZIZ(r0, r2)
            java.lang.Boolean r0 = (java.lang.Boolean) r0
            boolean r0 = r0.booleanValue()
            if (r0 == 0) goto L_0x02c6
            android.view.View r0 = r9.LIZ((int) r1)
            X.1jk r0 = (X.1jk) r0
            kotlin.h.b.n.LIZIZ(r0, r2)
            r9.LIZ((X.1jk) r0, (int) r4)
            android.view.View r1 = r9.LIZ((int) r5)
            X.1jk r1 = (X.1jk) r1
            kotlin.h.b.n.LIZIZ(r1, r2)
            com.bytedance.android.livesdk.subscribe.model.SubSettingStatus r0 = r10.LIZJ
            int r0 = r0.LIZ
            r9.LIZ((X.1jk) r1, (int) r0)
            X.2sR<java.lang.Boolean> r1 = X.C1781GFy.LJJLIIIJJI
            kotlin.h.b.n.LIZIZ(r1, r2)
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r3)
            r1.LIZ(r0)
        L_0x00a2:
            r0 = 2131368074(0x7f0a188a, float:1.8356088E38)
            android.view.View r1 = r9.LIZ((int) r0)
            X.1jk r1 = (X.1jk) r1
            kotlin.h.b.n.LIZIZ(r1, r2)
            com.bytedance.android.livesdk.subscribe.model.SubSettingStatus r0 = r10.LIZLLL
            int r0 = r0.LIZ
            int r0 = r9.LIZIZ((int) r0)
            r9.LIZ((X.1jk) r1, (int) r0)
            r5 = 2131370810(0x7f0a233a, float:1.8361637E38)
            android.view.View r1 = r9.LIZ((int) r5)
            X.041 r1 = (X.041) r1
            kotlin.h.b.n.LIZIZ(r1, r2)
            boolean r0 = r10.LIZ
            if (r0 == 0) goto L_0x02c3
            X.2sR<java.lang.Boolean> r0 = X.C1781GFy.LJJLIIIIJ
            kotlin.h.b.n.LIZIZ(r0, r2)
            java.lang.Object r0 = r0.LIZ()
            kotlin.h.b.n.LIZIZ(r0, r2)
            java.lang.Boolean r0 = (java.lang.Boolean) r0
            boolean r0 = r0.booleanValue()
            if (r0 == 0) goto L_0x02c3
            r0 = 1
        L_0x00de:
            r1.setChecked(r0)
            android.view.View r1 = r9.LIZ((int) r5)
            X.1Mb r1 = (X.1Mb) r1
            kotlin.h.b.n.LIZIZ(r1, r2)
            boolean r0 = r10.LIZ
            r1.setClickable(r0)
            boolean r1 = r10.LIZ
            r6 = 2131372167(0x7f0a2887, float:1.836439E38)
            r5 = 2131372064(0x7f0a2820, float:1.836418E38)
            r0 = 2131370811(0x7f0a233b, float:1.836164E38)
            if (r1 == 0) goto L_0x0299
            android.view.View r0 = r9.LIZ((int) r0)
            android.widget.FrameLayout r0 = (android.widget.FrameLayout) r0
            kotlin.h.b.n.LIZIZ(r0, r2)
            r0.setClickable(r3)
            android.view.View r1 = r9.LIZ((int) r5)
            X.1jk r1 = (X.1jk) r1
            r0 = 2131099750(0x7f060066, float:1.7811862E38)
            int r0 = X.0b0.LIZIZ(r0)
            r1.setTextColor(r0)
            android.view.View r1 = r9.LIZ((int) r6)
            X.1jk r1 = (X.1jk) r1
            r0 = 2131099758(0x7f06006e, float:1.7811878E38)
            int r0 = X.0b0.LIZIZ(r0)
            r1.setTextColor(r0)
        L_0x0128:
            boolean r0 = r9.LJII
            if (r0 == 0) goto L_0x013d
            boolean r0 = r9.LIZ()
            if (r0 != 0) goto L_0x013d
            r9.LJII = r3
            com.bytedance.android.livesdk.subscribe.model.SubSettingStatus r0 = r10.LIZLLL
            int r1 = r0.LIZ
            if (r1 == r4) goto L_0x0289
            r0 = 3
            if (r1 == r0) goto L_0x0279
        L_0x013d:
            com.bytedance.android.livesdk.subscribe.model.invite.SubInvitationEntrance r0 = r10.LJIIIZ
            r5 = 0
            if (r0 == 0) goto L_0x0276
            boolean r0 = r0.LIZIZ
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r0)
        L_0x0148:
            boolean r1 = X.C1430G2l.LIZ((java.lang.Boolean) r0)
            r6 = 8
            r0 = 2131366199(0x7f0a1137, float:1.8352285E38)
            if (r1 == 0) goto L_0x0268
            android.view.View r0 = r9.LIZ((int) r0)
            androidx.constraintlayout.widget.ConstraintLayout r0 = (androidx.constraintlayout.widget.ConstraintLayout) r0
            kotlin.h.b.n.LIZIZ(r0, r2)
            r0.setVisibility(r3)
            com.bytedance.android.livesdk.subscribe.model.invite.SubInvitationEntrance r0 = r10.LJIIIZ
            if (r0 == 0) goto L_0x0265
            java.util.List<com.bytedance.android.livesdk.subscribe.model.invite.SubInvitationEntrancePrompt> r0 = r0.LIZLLL
        L_0x0165:
            r9.LIZ((java.util.List<com.bytedance.android.livesdk.subscribe.model.invite.SubInvitationEntrancePrompt>) r0)
        L_0x0168:
            boolean r0 = r10.LJI
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r0)
            boolean r0 = X.C1430G2l.LIZ((java.lang.Boolean) r0)
            if (r0 == 0) goto L_0x0196
            com.bytedance.android.livesdk.subscribe.model.PayPalBindInfo r0 = r10.LJIIIIZZ
            if (r0 == 0) goto L_0x0196
            com.bytedance.android.livesdk.subscribe.model.PayPalBindInfo r0 = r10.LJIIIIZZ
            if (r0 == 0) goto L_0x0262
            boolean r0 = r0.LJ
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r0)
        L_0x0182:
            boolean r0 = X.C1430G2l.LIZ((java.lang.Boolean) r0)
            if (r0 == 0) goto L_0x0196
            com.bytedance.android.livesdk.subscribe.model.PayPalBindInfo r0 = r10.LJIIIIZZ
            if (r0 == 0) goto L_0x0196
            java.lang.String r0 = r0.LIZ
            if (r0 == 0) goto L_0x0196
            boolean r0 = kotlin.o.y.LIZ(r0)
            if (r0 == 0) goto L_0x0197
        L_0x0196:
            return
        L_0x0197:
            com.bytedance.android.livesdk.subscribe.model.PayPalBindInfo r0 = r10.LJIIIIZZ
            if (r0 == 0) goto L_0x01c8
            boolean r0 = r0.LIZJ
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r0)
        L_0x01a1:
            boolean r0 = X.C1430G2l.LIZ((java.lang.Boolean) r0)
            r1 = 2131367389(0x7f0a15dd, float:1.8354698E38)
            if (r0 == 0) goto L_0x01ca
            X.2sR<java.lang.Boolean> r0 = X.C1781GFy.LLZIL
            kotlin.h.b.n.LIZIZ(r0, r2)
            java.lang.Object r0 = r0.LIZ()
            java.lang.Boolean r0 = (java.lang.Boolean) r0
            boolean r0 = r0.booleanValue()
            if (r0 != 0) goto L_0x01ca
            android.view.View r0 = r9.LIZ((int) r1)
            X.05A r0 = (X.05A) r0
            kotlin.h.b.n.LIZIZ(r0, r2)
            r0.setVisibility(r6)
            return
        L_0x01c8:
            r0 = r5
            goto L_0x01a1
        L_0x01ca:
            android.view.View r0 = r9.LIZ((int) r1)
            X.05A r0 = (X.05A) r0
            kotlin.h.b.n.LIZIZ(r0, r2)
            r0.setVisibility(r3)
            android.text.SpannableStringBuilder r6 = new android.text.SpannableStringBuilder
            r6.<init>()
            com.bytedance.android.livesdk.subscribe.model.PayPalBindInfo r0 = r10.LJIIIIZZ
            if (r0 == 0) goto L_0x01e1
            java.lang.String r5 = r0.LIZ
        L_0x01e1:
            r6.append(r5)
            com.bytedance.android.livesdk.subscribe.model.PayPalBindInfo r0 = r10.LJIIIIZZ
            if (r0 == 0) goto L_0x0260
            java.lang.String r0 = r0.LIZ
            if (r0 == 0) goto L_0x0260
            int r7 = r0.length()
        L_0x01f0:
            com.bytedance.android.livesdk.subscribe.model.PayPalBindInfo r0 = r10.LJIIIIZZ
            if (r0 == 0) goto L_0x022a
            java.lang.String r8 = r0.LIZIZ
            if (r8 == 0) goto L_0x022a
            java.lang.String r1 = java.lang.String.valueOf(r8)
            java.lang.String r0 = " "
            java.lang.String r0 = r0.concat(r1)
            r6.append(r0)
            X.GL8 r1 = new X.GL8
            r1.<init>(r9, r6, r10, r7)
            int r0 = r8.length()
            int r0 = r0 + r7
            int r0 = r0 + r4
            r5 = 34
            r6.setSpan(r1, r7, r0, r5)
            android.text.style.ForegroundColorSpan r1 = new android.text.style.ForegroundColorSpan
            r0 = 2131099722(0x7f06004a, float:1.7811805E38)
            int r0 = X.0b0.LIZIZ(r0)
            r1.<init>(r0)
            int r0 = r8.length()
            int r0 = r0 + r7
            int r0 = r0 + r4
            r6.setSpan(r1, r7, r0, r5)
        L_0x022a:
            r4 = 2131371820(0x7f0a272c, float:1.8363686E38)
            android.view.View r1 = r9.LIZ((int) r4)
            X.1jk r1 = (X.1jk) r1
            kotlin.h.b.n.LIZIZ(r1, r2)
            android.text.method.MovementMethod r0 = android.text.method.LinkMovementMethod.getInstance()
            r1.setMovementMethod(r0)
            android.view.View r0 = r9.LIZ((int) r4)
            X.1jk r0 = (X.1jk) r0
            kotlin.h.b.n.LIZIZ(r0, r2)
            r0.setHighlightColor(r3)
            android.view.View r0 = r9.LIZ((int) r4)
            X.1jk r0 = (X.1jk) r0
            kotlin.h.b.n.LIZIZ(r0, r2)
            r0.setText(r6)
            com.bytedance.android.livesdk.subscribe.model.PayPalBindInfo r0 = r10.LJIIIIZZ
            if (r0 == 0) goto L_0x025b
            boolean r3 = r0.LIZJ
        L_0x025b:
            r9.LIZLLL((boolean) r3)
            goto L_0x0196
        L_0x0260:
            r7 = 0
            goto L_0x01f0
        L_0x0262:
            r0 = r5
            goto L_0x0182
        L_0x0265:
            r0 = r5
            goto L_0x0165
        L_0x0268:
            android.view.View r0 = r9.LIZ((int) r0)
            androidx.constraintlayout.widget.ConstraintLayout r0 = (androidx.constraintlayout.widget.ConstraintLayout) r0
            kotlin.h.b.n.LIZIZ(r0, r2)
            r0.setVisibility(r6)
            goto L_0x0168
        L_0x0276:
            r0 = r5
            goto L_0x0148
        L_0x0279:
            X.1hK r1 = r9.getActivity()
            r0 = 2131830443(0x7f1126ab, float:1.9293883E38)
            java.lang.String r0 = r9.getString(r0)
            X.C1313Fz8.LIZ((android.app.Activity) r1, (java.lang.CharSequence) r0)
            goto L_0x013d
        L_0x0289:
            X.1hK r1 = r9.getActivity()
            r0 = 2131830442(0x7f1126aa, float:1.9293881E38)
            java.lang.String r0 = r9.getString(r0)
            X.C1313Fz8.LIZ((android.app.Activity) r1, (java.lang.CharSequence) r0)
            goto L_0x013d
        L_0x0299:
            android.view.View r1 = r9.LIZ((int) r0)
            android.widget.FrameLayout r1 = (android.widget.FrameLayout) r1
            X.GLN r0 = X.GLN.LIZ
            r1.setOnClickListener(r0)
            android.view.View r1 = r9.LIZ((int) r5)
            X.1jk r1 = (X.1jk) r1
            r5 = 2131099752(0x7f060068, float:1.7811866E38)
            int r0 = X.0b0.LIZIZ(r5)
            r1.setTextColor(r0)
            android.view.View r1 = r9.LIZ((int) r6)
            X.1jk r1 = (X.1jk) r1
            int r0 = X.0b0.LIZIZ(r5)
            r1.setTextColor(r0)
            goto L_0x0128
        L_0x02c3:
            r0 = 0
            goto L_0x00de
        L_0x02c6:
            android.view.View r0 = r9.LIZ((int) r1)
            X.1jk r0 = (X.1jk) r0
            kotlin.h.b.n.LIZIZ(r0, r2)
            r9.LIZ((X.1jk) r0, (int) r3)
            android.view.View r0 = r9.LIZ((int) r5)
            X.1jk r0 = (X.1jk) r0
            kotlin.h.b.n.LIZIZ(r0, r2)
            r9.LIZ((X.1jk) r0, (int) r3)
            goto L_0x00a2
        L_0x02e0:
            android.view.View r1 = r9.LIZ((int) r1)
            X.1jk r1 = (X.1jk) r1
            kotlin.h.b.n.LIZIZ(r1, r2)
            com.bytedance.android.livesdk.subscribe.model.SubSettingStatus r0 = r10.LIZIZ
            int r0 = r0.LIZ
            r9.LIZ((X.1jk) r1, (int) r0)
            android.view.View r1 = r9.LIZ((int) r5)
            X.1jk r1 = (X.1jk) r1
            kotlin.h.b.n.LIZIZ(r1, r2)
            com.bytedance.android.livesdk.subscribe.model.SubSettingStatus r0 = r10.LIZJ
            int r0 = r0.LIZ
            r9.LIZ((X.1jk) r1, (int) r0)
            goto L_0x00a2
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.livesdk.impl.revenue.subscription.ui.SubscriptionSettingFragment.LIZ(com.bytedance.android.livesdk.subscribe.model.GetSubInfoResponse, boolean):void");
    }

    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        M12.LIZ(layoutInflater);
        return 0HH.LIZ(layoutInflater, 2131561779, viewGroup, false);
    }
}
