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

import X.0AA;
import X.0Gp;
import X.0HH;
import X.1Cv;
import X.1hK;
import X.2FV;
import X.2GO;
import X.2HZ;
import X.2He;
import X.2UX;
import X.2cN;
import X.2ha;
import X.2nK;
import X.2uR;
import X.3Al;
import X.3BB;
import X.3QB;
import X.3SL;
import X.3Xu;
import X.3Xx;
import X.3Yi;
import X.3Ys;
import X.3ZQ;
import X.3af;
import X.3c7;
import X.3cA;
import X.3cC;
import X.3cI;
import X.3i9;
import X.3qP;
import X.3qV;
import X.3t3;
import X.46i;
import X.46p;
import X.470;
import X.471;
import X.4Dd;
import X.4FQ;
import X.4vl;
import X.7s1;
import X.7wO;
import X.8jA;
import X.8w0;
import X.9BJ;
import X.9EH;
import X.9Ea;
import X.9HM;
import X.C1142DNy;
import X.C1170DPa;
import X.C1171DPb;
import X.C1445DZp;
import X.C1446DZq;
import X.C1448DZs;
import X.C1481DaP;
import X.C1676DdY;
import X.C3023DzH;
import X.C6239FNz;
import X.C6240FOa;
import X.C6241FOb;
import X.C6242FOc;
import X.C6243FOd;
import X.C6244FOe;
import X.C6246FOg;
import X.CYH;
import X.Cc1;
import X.CqM;
import X.DFY;
import X.DO5;
import X.DPE;
import X.DTA;
import X.EQW;
import X.ESC;
import X.F1U;
import X.F2D;
import X.F2E;
import X.F3V;
import X.FEQ;
import X.FO0;
import X.FO6;
import X.FO7;
import X.FO9;
import X.FOB;
import X.FOH;
import X.FOM;
import X.FON;
import X.FOO;
import X.FOP;
import X.FOQ;
import X.FOT;
import X.FOU;
import X.FOV;
import X.FOW;
import X.FOX;
import X.FOY;
import X.FOZ;
import X.HeD;
import X.Hx0;
import X.ISm;
import X.JMC;
import X.JtF;
import X.KDX;
import X.Lwo;
import X.Lwp;
import X.Lws;
import X.Lwt;
import X.M12;
import X.M9U;
import X.Mjy;
import X.Mk2;
import X.Mk3;
import X.OCa;
import X.OD2;
import X.OJq;
import X.OQg;
import X.OR2;
import X.Okm;
import X.PQz;
import X.PhE;
import X.PlI;
import X.QEL;
import X.Qeg;
import X.RGg;
import X.RGh;
import X.RVo;
import X.RVq;
import X.RVv;
import X.Rc9;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.DialogFragment;
import com.bytedance.bddatefmt.BDDateFormat;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.ies.powerlist.PowerCell;
import com.bytedance.router.SmartRouter;
import com.ss.android.ugc.aweme.ProfileNaviServiceImpl;
import com.ss.android.ugc.aweme.compliance.api.a;
import com.ss.android.ugc.aweme.ecommerce.ECommerceService;
import com.ss.android.ugc.aweme.out.AVExternalServiceImpl;
import com.ss.android.ugc.aweme.profile.edit.InstagramPresenter;
import com.ss.android.ugc.aweme.profile.editprofile.pronouns.ui.ProfileEditPronounsFragment;
import com.ss.android.ugc.aweme.profile.editprofile.vm.ProfileEditProfileViewModel;
import com.ss.android.ugc.aweme.profile.model.AvatarUri;
import com.ss.android.ugc.aweme.profile.model.ProfileNgoStruct;
import com.ss.android.ugc.aweme.profile.model.SpecialAccount;
import com.ss.android.ugc.aweme.profile.model.TTSeller;
import com.ss.android.ugc.aweme.profile.model.User;
import com.ss.android.ugc.aweme.profile.model.UserPronounsInfo;
import com.ss.android.ugc.aweme.services.external.IDonationService;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.regex.Pattern;
import kotlin.h.b.n;
import kotlin.o.y;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONObject;

public class ProfileEditFragment extends Hilt_ProfileEditFragment implements KDX, Lwp, RVv, DPE, FO0, F2E, CYH, 2HZ, 2GO {
    public static final boolean LIZ = false;
    public static final List<String> LJIILL = Arrays.asList(new String[]{"photo", "video", "nickname", "supported_ngo", "bio", "instagram", "twitter", "youtube", "category", "website", "bio_email"});
    public boolean LIZIZ = false;
    public 46p LIZJ;
    public int LIZLLL = 0;
    public ProfileNgoStruct LJ;
    public ProfileEditProfileViewModel LJIIIZ;
    public Mjy LJIIJ = null;
    public 1Cv LJIIJJI;
    public List<String> LJIILLIIL;
    public 2UX LJIIZILJ = new 2UX();
    public OD2 LJIJ;
    public OQg LJIJI;
    public 3c7 LJIJJ;
    public C6239FNz LJIJJLI;
    public F2D LJIL;
    public boolean LJJ;
    public User LJJI;
    public OR2 LJJIFFI;
    public boolean LJJII;
    public LinearLayout LJJIII;
    public LinearLayout LJJIIJ;
    public TextView LJJIIJZLJL;
    public 3Yi LJJIIZ;
    public 3Yi LJJIIZI;
    public 3Yi LJJIJ;
    public 3Yi LJJIJIIJI;
    public 3Yi LJJIJIIJIL;
    public 3Yi LJJIJIL;
    public 3Yi LJJIJL;
    public 3Yi LJJIJLIJ;
    public 3Yi LJJIL;
    public 3Yi LJJIZ;
    public View LJJJ;
    public 3Yi LJJJI;
    public 3Yi LJJJIL;
    public 3Yi LJJJJ;
    public C1445DZp LJJJJI;
    public Qeg LJJJJIZL;
    public Qeg LJJJJJ;
    public InstagramPresenter LJJJJJL;
    public Lwo LJJJJL;
    public RVo LJJJJLI;
    public String LJJJJLL = "";
    public boolean LJJJJZ = false;
    public User LJJJJZI;

    public int LIZIZ() {
        return 2131560803;
    }

    public Map<Integer, Object> getSubscriberEventTypes() {
        HashMap hashMap = new HashMap();
        hashMap.put(471, new Rc9(ProfileEditFragment.class, "onEditCategorySuccessEvent", Hx0.class, ThreadMode.MAIN, 0, false));
        hashMap.put(472, new Rc9(ProfileEditFragment.class, "onAppStoreLinkSuccess", Hx0.class, ThreadMode.MAIN, 0, false));
        return hashMap;
    }

    public void LIZ(View view) {
        3c7 findViewById = view.findViewById(2131367895);
        this.LJIJJ = findViewById;
        2uR r4 = new 2uR();
        3cA r1 = new 3cA();
        r1.LIZ(2131755170);
        r1.LIZIZ = true;
        r1.LIZ(new C6244FOe(this, view));
        r4.LIZ(new 3cI[]{r1});
        3cC r12 = new 3cC();
        r12.LIZ((String) getText(2131824458));
        r4.LIZ(r12);
        findViewById.setNavActions(r4);
        F2D f2d = new F2D();
        this.LJIL = f2d;
        f2d.LIZJ = this;
        this.LJIL.LIZIZ(getActivity(), this);
        C6239FNz fNz = new C6239FNz();
        this.LJIJJLI = fNz;
        fNz.LIZLLL = this;
        this.LIZJ = new 46p();
        this.LJJJJ.setVisibility(8);
    }

    public final /* synthetic */ void LIZ(String str, 3Yi r17) {
        String str2;
        SpecialAccount specialAccount;
        TTSeller seller;
        String str3 = str;
        str3.hashCode();
        int i = 0;
        char c = 65535;
        switch (str3.hashCode()) {
            case -1008549514:
                if (str3.equals("app_store_link")) {
                    c = 0;
                    break;
                }
                break;
            case -994687732:
                if (str3.equals("pronouns")) {
                    c = 1;
                    break;
                }
                break;
            case -991745245:
                if (str3.equals("youtube")) {
                    c = 2;
                    break;
                }
                break;
            case -916346253:
                if (str3.equals("twitter")) {
                    c = 3;
                    break;
                }
                break;
            case -265713450:
                if (str3.equals("username")) {
                    c = 4;
                    break;
                }
                break;
            case -180337243:
                if (str3.equals("bio_email")) {
                    c = 5;
                    break;
                }
                break;
            case 97544:
                if (str3.equals("bio")) {
                    c = 6;
                    break;
                }
                break;
            case 28903346:
                if (str3.equals("instagram")) {
                    c = 7;
                    break;
                }
                break;
            case 50511102:
                if (str3.equals("category")) {
                    c = 8;
                    break;
                }
                break;
            case 70690926:
                if (str3.equals("nickname")) {
                    c = 9;
                    break;
                }
                break;
            case 746049438:
                if (str3.equals("navi_view")) {
                    c = 10;
                    break;
                }
                break;
            case 1083235153:
                if (str3.equals("nonprofit")) {
                    c = 11;
                    break;
                }
                break;
            case 1224335515:
                if (str3.equals("website")) {
                    c = 12;
                    break;
                }
                break;
        }
        String str4 = "";
        3Yi r9 = r17;
        switch (c) {
            case 0:
                LIZLLL();
                return;
            case 1:
                if (!Cc1.LIZ(r9, 1200) && aq_() && !this.LJJJJZ) {
                    User user = this.LJJJJZI;
                    if (user == null || user.getPronounsInfo() == null || this.LJJJJZI.getPronounsInfo().getPronouns() == null) {
                        str2 = this.LJJI.getPronounsInfo().getPronouns();
                    } else {
                        str2 = this.LJJJJZI.getPronounsInfo().getPronouns();
                    }
                    F3V.LIZ.LIZ("enter_profile_pronoun", "click_pronoun", "pronoun");
                    String string = getString(2131831141);
                    if (str2 != null) {
                        str4 = str2;
                    }
                    M12.LIZ(string, str4);
                    ProfileEditPronounsFragment profileEditPronounsFragment = new ProfileEditPronounsFragment();
                    Bundle bundle = new Bundle();
                    bundle.putString("content_name", string);
                    bundle.putString("content_value", str4);
                    profileEditPronounsFragment.setArguments(bundle);
                    profileEditPronounsFragment.setUserVisibleHint(true);
                    C6240FOa fOa = new C6240FOa(this);
                    M12.LIZ(fOa);
                    profileEditPronounsFragment.LIZJ = fOa;
                    profileEditPronounsFragment.show(getActivity().getSupportFragmentManager(), "EditPronounDialog");
                    return;
                }
                return;
            case 2:
                if (getContext().getString(2131824466).equals(LIZ(this.LJJJIL))) {
                    RVo rVo = this.LJJJJLI;
                    if (!((Boolean) rVo.LJI.getValue()).booleanValue()) {
                        RVo.LIZ(rVo, new Exception("Google service is not available, aborting."), (String) null, "before_goto_URL", (8w0) null, 10);
                    } else {
                        OJq.LIZ(new RGg(rVo), "YoutubeApi");
                    }
                    LJIILL();
                } else {
                    LIZ(getResources().getString(2131834435), getResources().getString(2131834436), (DialogInterface.OnClickListener) new FOP(this));
                    i = 1;
                }
                2UX r2 = new 2UX();
                r2.LIZ("status", i);
                r2.LIZ("platform", "youtube");
                2nK.LIZ("click_social_account_bind", r2.LIZ);
                return;
            case 3:
                LJFF();
                return;
            case 4:
                LIZIZ((View) r9);
                return;
            case 5:
                if (!Cc1.LIZ(r9, 1200) && aq_()) {
                    String LIZ2 = LIZ(this.LJJIJL);
                    if (!LIZ2.equals(getString(2131824445))) {
                        str4 = LIZ2;
                    }
                    F3V.LIZ.LIZ("enter_profile_mail", "click_mail", "mail");
                    ProfileEditContentFragment LIZ3 = ProfileEditContentFragment.LIZ(getString(2131824446), str4, getResources().getString(2131824661), 0, true, (Bundle) null);
                    LIZ3.setUserVisibleHint(true);
                    LIZ3.LIZ(new C6243FOd(this));
                    LIZ3.LIZ(this);
                    LIZ3.LJII = 3QB.LIZ;
                    LIZ3.LJI = false;
                    LIZ3.show(getActivity().getSupportFragmentManager(), "EditMailDialog");
                    return;
                }
                return;
            case 6:
                if (!Cc1.LIZ(r9, 1200) && aq_() && !this.LJJJJZ) {
                    String LIZ4 = LIZ(this.LJJIJIIJIL);
                    if (!LIZ4.equals(getString(2131824439))) {
                        str4 = LIZ4;
                    }
                    F3V.LIZ.LIZ("enter_profile_bio", "click_bio", "bio");
                    ProfileEditBioFragment LIZ5 = ProfileEditBioFragment.LJIIIIZZ.LIZ(getString(2131824440), str4, EQW.LJFF.LIZ(this.LJJI, "click_save", "bio"));
                    LIZ5.setUserVisibleHint(true);
                    LIZ5.LIZ(new C6241FOb(this));
                    LIZ5.show(getActivity().getSupportFragmentManager(), "EditNicknameDialog");
                    return;
                }
                return;
            case 7:
                LJIILJJIL();
                return;
            case 8:
                SmartRouter.buildRoute(getActivity(), 3t3.LIZIZ.LIZ(3, "settings")).open();
                return;
            case 9:
                if (!Cc1.LIZ(r9, 1200) && aq_() && !this.LJJJJZ) {
                    User user2 = this.LJJI;
                    if (user2 == null || (specialAccount = user2.specialAccount) == null || (seller = specialAccount.getSeller()) == null || seller.getType() != 1 || !seller.isAllowListSeller()) {
                        this.LIZJ.LIZ(this.LJJI, new 471(this));
                        return;
                    } else {
                        ECommerceService.createIECommerceServicebyMonsterPlugin(false).showRestrictDialog(getChildFragmentManager());
                        return;
                    }
                } else {
                    return;
                }
            case 10:
                ProfileNaviServiceImpl.LIZ().LIZ(getActivity(), r9, "edit_profile_page");
                return;
            case 11:
                LJ();
                return;
            case 12:
                if (!Cc1.LIZ(r9, 1200) && aq_() && !this.LJJJJZ) {
                    String LIZ6 = LIZ(this.LJJIJIL);
                    if (LIZ6.equals(getString(2131824464))) {
                        LIZ6 = str4;
                    }
                    F3V.LIZ.LIZ("enter_profile_website", "click_website", "website");
                    ProfileEditBioUrlFragment LIZ7 = ProfileEditBioUrlFragment.LJIILL.LIZ(LIZ6, str4);
                    LIZ7.setUserVisibleHint(true);
                    LIZ7.LIZ(this);
                    C6242FOc fOc = new C6242FOc(this);
                    M12.LIZ(fOc);
                    LIZ7.LJFF = fOc;
                    LIZ7.show(getActivity().getSupportFragmentManager(), "EditWebsiteDialog");
                    return;
                }
                return;
            default:
                return;
        }
    }

    public final /* synthetic */ void LIZ(List list) {
        ProfileEditProfileViewModel profileEditProfileViewModel = this.LJIIIZ;
        C1445DZp dZp = this.LJJJJI;
        M12.LIZ(dZp, list);
        List<C1446DZq> allChunks = dZp.getAllChunks();
        n.LIZIZ(allChunks, "");
        for (C1446DZq dZq : allChunks) {
            if (dZq instanceof C1448DZs) {
                dZq.LIZLLL().LIZ();
                C1676DdY<C1481DaP> LIZLLL2 = dZq.LIZLLL();
                ArrayList arrayList = new ArrayList(9HM.LIZ(list, 10));
                Iterator it = list.iterator();
                while (it.hasNext()) {
                    arrayList.add(new DO5(((Number) it.next()).intValue()));
                }
                LIZLLL2.LIZ((Collection<? extends C1481DaP>) arrayList);
                profileEditProfileViewModel.LIZ(dZq);
            }
        }
    }

    public final boolean LIZ(IDonationService.OrganizationModel organizationModel) {
        int intValue;
        ProfileEditProfileViewModel profileEditProfileViewModel;
        C1445DZp dZp;
        if (organizationModel == null || !(organizationModel.getNgoId() == null || organizationModel.getName() == null)) {
            ProfileNgoStruct profileNgoStruct = null;
            if (organizationModel != null) {
                ProfileNgoStruct profileNgoStruct2 = new ProfileNgoStruct();
                if (organizationModel.getName() != null) {
                    profileNgoStruct2.setName(organizationModel.getName());
                    if (organizationModel.getNgoId() != null) {
                        profileNgoStruct2.setId(organizationModel.getNgoId().intValue());
                        if (organizationModel.getDonateLink() != null) {
                            profileNgoStruct2.setDonationLink(organizationModel.getDonateLink());
                        }
                        if (organizationModel.getIcon() != null) {
                            profileNgoStruct2.setIconUrl(organizationModel.getIcon().getUri());
                        }
                        profileNgoStruct = profileNgoStruct2;
                    }
                }
            }
            this.LJJJJZI.setProfileNgoStruct(profileNgoStruct);
            C6239FNz fNz = this.LJIJJLI;
            if (organizationModel == null) {
                intValue = 0;
            } else {
                intValue = organizationModel.getNgoId().intValue();
            }
            if (!fNz.LIZIZ) {
                fNz.LIZIZ = true;
                46i.LJFF().updateSupportedNgo(fNz.LIZJ, intValue, fNz.LJ);
            }
            LJIILL();
            if (DFY.LIZ.LIZ() && (profileEditProfileViewModel = this.LJIIIZ) != null && (dZp = this.LJJJJI) != null) {
                boolean z = organizationModel == null;
                M12.LIZ(dZp);
                if (!z) {
                    List<C1446DZq> allChunks = dZp.getAllChunks();
                    n.LIZIZ(allChunks, "");
                    Iterator<T> it = allChunks.iterator();
                    loop2:
                    while (true) {
                        if (!it.hasNext()) {
                            ArrayList arrayList = new ArrayList();
                            List<C1446DZq> allChunks2 = dZp.getAllChunks();
                            n.LIZIZ(allChunks2, "");
                            Iterator<T> it2 = allChunks2.iterator();
                            loop4:
                            while (true) {
                                if (!it2.hasNext()) {
                                    arrayList.add(Integer.valueOf(C1142DNy.Supporting.getId()));
                                    profileEditProfileViewModel.LJII.LIZ();
                                    2cN LIZ2 = profileEditProfileViewModel.LIZ().LIZ.LIZ(profileEditProfileViewModel.LIZ((List<Integer>) arrayList)).LIZIZ(PhE.LIZIZ(PlI.LIZJ)).LIZ(Mk2.LIZ(Mk3.LIZ)).LIZ(C1170DPa.LIZ, C1171DPb.LIZ);
                                    n.LIZIZ(LIZ2, "");
                                    4Dd.LIZ(LIZ2, profileEditProfileViewModel.LJII);
                                    break;
                                }
                                C1446DZq dZq = (C1446DZq) it2.next();
                                if (dZq instanceof C1448DZs) {
                                    for (C1481DaP daP : dZq.LIZLLL().LIZJ()) {
                                        if (!(daP instanceof DO5)) {
                                            break loop4;
                                        }
                                        arrayList.add(Integer.valueOf(((DO5) daP).LIZ));
                                    }
                                    if (dZq.LIZLLL().LIZIZ() == 0) {
                                        ((C1448DZs) dZq).LIZ(true);
                                    }
                                    dZq.LIZLLL().LIZ(new DO5(C1142DNy.Supporting.getId()));
                                }
                            }
                        } else {
                            C1446DZq dZq2 = (C1446DZq) it.next();
                            if (dZq2 instanceof C1448DZs) {
                                int size = dZq2.LIZLLL().LIZJ().size();
                                for (int i = 0; i < size; i++) {
                                    C1481DaP LIZIZ2 = dZq2.LIZLLL().LIZIZ(i);
                                    if ((LIZIZ2 instanceof DO5) && ((DO5) LIZIZ2).LIZ == C1142DNy.Supporting.getId()) {
                                        break loop2;
                                    }
                                }
                                continue;
                            }
                        }
                    }
                } else {
                    List<C1446DZq> allChunks3 = dZp.getAllChunks();
                    n.LIZIZ(allChunks3, "");
                    for (C1446DZq dZq3 : allChunks3) {
                        if (!(dZq3 instanceof C1448DZs)) {
                            break;
                        }
                        int size2 = dZq3.LIZLLL().LIZJ().size();
                        int i2 = 0;
                        while (true) {
                            if (i2 >= size2) {
                                break;
                            }
                            C1481DaP LIZIZ3 = dZq3.LIZLLL().LIZIZ(i2);
                            if ((LIZIZ3 instanceof DO5) && ((DO5) LIZIZ3).LIZ == C1142DNy.Supporting.getId()) {
                                dZq3.LIZLLL().LIZ(i2);
                                break;
                            }
                            i2++;
                        }
                        if (dZq3.LIZLLL().LIZIZ() == 0) {
                            C1448DZs dZs = (C1448DZs) dZq3;
                            if (dZs.LIZLLL != null) {
                                3Al r0 = dZs.LIZLLL;
                                if (r0 == null) {
                                    n.LIZ("");
                                }
                                dZs.e_(r0);
                            }
                        }
                    }
                }
            }
            return true;
        }
        3BB r1 = new 3BB(getActivity());
        r1.LIZIZ(2131831889);
        r1.LIZIZ();
        LIZJ(false);
        return false;
    }

    public final /* synthetic */ void LIZ(DialogInterface dialogInterface) {
        OJq.LIZ(new RVq(this.LJJJJLI), "BoltsUtils");
        dialogInterface.dismiss();
        LJIILL();
    }

    public void LIZ(String str) {
        this.LJJ = true;
        Uri parse = Uri.parse("file://".concat(String.valueOf(str)));
        QEL.LIZIZ().LJIIIIZZ().LIZ(parse);
        OCa.LIZ(this.LJIJ, parse.toString(), (int) HeD.LIZIZ(getContext(), 84.0f), (int) HeD.LIZIZ(getContext(), 84.0f));
    }

    public void LIZ(User user, int i) {
        2UX r3;
        this.LJJ = true;
        String str = "bold";
        if (i == 0) {
            LIZ(this.LJJIIZI, (CharSequence) this.LJJJJZI.getNickname(), true);
            LIZ("nickname", false, str);
        } else if (i == 2) {
            boolean isEmpty = TextUtils.isEmpty(this.LJJJJZI.getSignature());
            if (TextUtils.isEmpty(this.LJJJJZI.getSignature())) {
                str = "blank";
            }
            LIZ("bio", isEmpty, str);
            LJIJJ(this.LJJJJZI.getSignature());
        } else if (i == 4) {
            OCa.LIZ(this.LJIJ, user.getAvatarMedium());
        } else if (i == 12) {
            String str2 = "";
            LJIJ((String) PQz.fromNullable(this.LJJJJZI.getProfileNgoStruct()).transform(C6246FOg.LIZ).or(str2));
            String str3 = "remove_nonprofit_link";
            if (this.LJJJJZI.getProfileNgoStruct() != null) {
                if (this.LJ != null) {
                    str3 = "change_nonprofit_link";
                } else {
                    str3 = "add_nonprofit_link";
                }
                r3 = new 2UX();
                str2 = this.LJJJJZI.getProfileNgoStruct().getDonationLink();
            } else {
                r3 = new 2UX();
                ProfileNgoStruct profileNgoStruct = this.LJ;
                if (profileNgoStruct != null) {
                    str2 = profileNgoStruct.getDonationLink();
                }
            }
            r3.LIZ("link", str2);
            r3.LIZ("link_type", "nonprofit");
            2nK.LIZ(str3, r3.LIZ);
            LIZ(this.LJJJJZI.getProfileNgoStruct());
        } else if (i == 112) {
            if (this.LIZIZ) {
                this.LIZIZ = false;
                2UX r32 = new 2UX();
                r32.LIZ("is_success", "1");
                2nK.LIZ("ttelite_save_email", r32.LIZ);
            }
            LJIJI(user.getBioUrl());
            LJIIZILJ(user.getBioEmail());
        } else if (i == 116) {
            F3V.LIZ.LIZ(1, this.LIZLLL, (String) null);
            LJJI(this.LJJJJZI.getUniqueId());
        }
        LIZJ(false);
    }

    public final void LIZ(String str, boolean z, String str2) {
        List<String> list = this.LJIILLIIL;
        if (list != null) {
            if (z) {
                if (list.contains(str)) {
                    this.LJIILLIIL.remove(str);
                }
            } else if (!this.LJIILLIIL.contains(str)) {
                this.LJIILLIIL.add(str);
            }
            if (str.equals("bio_email")) {
                str = "email";
            }
            this.LJIIZILJ.LIZ(str, str2);
        }
    }

    public final void LIZ(Exception exc, int i) {
        if (aq_() && this.LJIJJLI != null && this.LJIL != null) {
            if (4 == i) {
                LIZJ(false);
                this.LJIL.LIZLLL();
                if ((exc instanceof JMC) && ((3qV) exc).getErrorCode() == 20022) {
                    9BJ.LIZ(getActivity(), "profile_image_setting", "review_failure");
                }
            }
            if (i == 116) {
                String str = null;
                Exception exc2 = (!(exc instanceof ExecutionException) || !(exc.getCause() instanceof JMC)) ? exc : (Exception) exc.getCause();
                if (exc2 instanceof JMC) {
                    JMC jmc = (JMC) exc2;
                    str = String.valueOf(jmc.getErrorCode());
                    FO6.LIZ(str, jmc.getErrorMsg(), this.LJJJJLL, getContext());
                    LIZJ(false);
                }
                F3V.LIZ.LIZ(0, this.LIZLLL, str);
            } else if (i != 116) {
                C3023DzH.LIZ((Context) getActivity(), (Throwable) exc, 2131831077);
            }
            3i9.LIZ(exc.getMessage(), "user");
            LIZJ(false);
            this.LJIL.LIZLLL();
            if (this.LIZIZ) {
                this.LIZIZ = false;
                2UX r2 = new 2UX();
                r2.LIZ("is_success", "0");
                2nK.LIZ("ttelite_save_email", r2.LIZ);
            }
        }
    }

    public final void LIZ(boolean z) {
        if (z) {
            3BB r1 = new 3BB(9EH.LJJIFFI.LIZ());
            r1.LIZIZ(2131834722);
            r1.LIZIZ();
            CqM.LIZ(new 3qP());
        }
    }

    public final void LIZ(String str, boolean z) {
        if (aq_()) {
            LIZJ(false);
            if (!TextUtils.isEmpty(str)) {
                3BB r1 = new 3BB(9EH.LJJIFFI.LIZ());
                r1.LIZ(str);
                r1.LIZIZ();
                if (z && getActivity() != null) {
                    getActivity().finish();
                }
            }
        }
    }

    public final void LIZ(3Yi r3, boolean z, String str) {
        List<String> list = this.LJIILLIIL;
        if (list != null) {
            if (z) {
                if (list.contains(str)) {
                    this.LJIILLIIL.remove(str);
                }
            } else if (!this.LJIILLIIL.contains(str)) {
                this.LJIILLIIL.add(str);
            }
            this.LJIIZILJ.LIZ(str, z ? "bold" : "blank");
            LIZ(r3, (CharSequence) null, this.LJIILLIIL.contains(str));
        }
    }

    public final void LJIIJ() {
        LIZJ(false);
        F2D f2d = this.LJIL;
        if (f2d != null) {
            f2d.LIZLLL();
        }
    }

    public final /* synthetic */ Object LJIIL() {
        3Yi r0 = this.LJJIIZI;
        if (r0 == null) {
            return null;
        }
        LIZIZ((View) r0);
        return null;
    }

    public void onResume() {
        ProfileEditFragment.super.onResume();
        this.LJJJJZ = a.LIZJ().LIZ(4);
    }

    private void LJIILL() {
        OQg oQg = this.LJIJI;
        if (oQg != null) {
            if (oQg.getVisibility() != 0) {
                this.LJIJI.setVisibility(0);
            }
            this.LJIJI.LIZ();
        }
    }

    public void onDestroy() {
        ProfileEditFragment.super.onDestroy();
        EventBus.LIZ().LIZIZ(this);
        46p r0 = this.LIZJ;
        if (r0 != null) {
            r0.LIZ.LIZ();
        }
        Mjy mjy = this.LJIIJ;
        if (mjy != null) {
            mjy.dispose();
        }
    }

    public void onDestroyView() {
        ProfileEditFragment.super.onDestroyView();
        F2D f2d = this.LJIL;
        if (f2d != null) {
            f2d.LIZLLL();
        }
        F2D f2d2 = this.LJIL;
        if (f2d2 != null) {
            f2d2.LIZJ = null;
        }
        C6239FNz fNz = this.LJIJJLI;
        if (fNz != null) {
            fNz.LIZLLL = null;
        }
    }

    static {
        Covode.recordClassIndex(99080);
    }

    public final void LJIIIIZZ() {
        0AA fragmentManager;
        DialogFragment selectDonationDialog = AVExternalServiceImpl.LIZ().donationService().getSelectDonationDialog(new IDonationService.OnDonationOrgChangeListener() {
            static {
                Covode.recordClassIndex(99081);
            }

            public final void onDismiss() {
            }

            public final void onShow() {
            }

            public final void onOrgSelected(IDonationService.OrganizationModel organizationModel) {
                ProfileEditFragment profileEditFragment = ProfileEditFragment.this;
                profileEditFragment.LIZ(profileEditFragment.LJJIJLIJ, (CharSequence) organizationModel.getName(), false);
                ProfileEditFragment.this.LIZ(organizationModel);
            }
        });
        if (!selectDonationDialog.isAdded() && (fragmentManager = getFragmentManager()) != null) {
            selectDonationDialog.show(fragmentManager, "profile_edit_select_donation");
        }
    }

    /* renamed from: LJIIIZ */
    public final void LJIIJJI() {
        if (aq_()) {
            if (this.LJIILLIIL != null) {
                DTA.LIZ.LIZ("leave", this.LJIIZILJ);
            }
            if (getArguments().getBoolean("change_to_ba", false)) {
                CqM.LIZ(new FEQ());
            }
            getActivity().finish();
        }
    }

    private void LIZLLL() {
        String str;
        if (ESC.LIZJ() != null && ESC.LIZJ().getAccountType() == 3) {
            2UX r2 = new 2UX();
            r2.LIZ("enter_from", "ba_profile");
            2nK.LIZ("ttelite_BA_download_click_edit", r2.LIZ);
        }
        1hK activity = getActivity();
        String LIZ2 = 7wO.LIZIZ.LIZ();
        Locale LIZ3 = 9Ea.LIZ(9EH.LJJIFFI.LIZ());
        if (LIZ3 == null || (str = LIZ3.getLanguage()) == null) {
            str = "";
        }
        SmartRouter.buildRoute(activity, y.LIZ(LIZ2, "((locale))", str, false)).open();
    }

    private void LJFF() {
        int i;
        if (getContext().getString(2131824459).equals(LIZ(this.LJJJJ))) {
            i = 0;
            this.LJJJJL.LIZ();
            LJIILL();
        } else {
            i = 1;
            LIZ(getResources().getString(2131834432), getResources().getString(2131834433), (DialogInterface.OnClickListener) new FON(this));
        }
        2UX r2 = new 2UX();
        r2.LIZ("status", i);
        r2.LIZ("platform", "twitter");
        2nK.LIZ("click_social_account_bind", r2.LIZ);
    }

    private void LJIILJJIL() {
        int i = 1;
        if (getContext().getString(2131824444).equals(LIZ(this.LJJJI))) {
            InstagramPresenter instagramPresenter = this.LJJJJJL;
            instagramPresenter.LJI = true;
            F1U f1u = new F1U(instagramPresenter.LIZJ);
            f1u.LIZ = "instagram";
            f1u.LIZJ = instagramPresenter;
            M9U.LIZ().LIZ(f1u.LIZ());
            LJIILL();
            i = 0;
        } else {
            LIZ(getResources().getString(2131834425), getResources().getString(2131834426), (DialogInterface.OnClickListener) new FOO(this));
        }
        2UX r1 = new 2UX();
        r1.LIZ("status", i);
        r1.LIZ("platform", "instagram");
        2nK.LIZ("click_social_account_bind", r1.LIZ);
    }

    public final void LJI() {
        3Yi r0 = this.LJJIIZI;
        if (r0 != null) {
            String LIZ2 = LIZ(r0);
            F3V.LIZ.LIZ("enter_profile_name", "click_name", "name");
            ProfileEditContentFragment LIZ3 = ProfileEditContentFragment.LIZ(getString(2131824452), LIZ2, "", 30, false, EQW.LJFF.LIZ(this.LJJI, "click_save", "nickname"));
            LIZ3.setUserVisibleHint(true);
            LIZ3.LIZ(new FOY(this));
            LIZ3.show(getActivity().getSupportFragmentManager(), "EditWebsiteDialog");
        }
    }

    public final /* synthetic */ void LJIILIIL() {
        int i;
        String str;
        F3V.LIZ.LIZ("replace_profile_info", "click_head", "photo");
        if (aq_() && !this.LJJJJZ) {
            if (this.LJJI.naviId != null) {
                i = 1;
            } else {
                i = 0;
            }
            M12.LIZ("replace_profile_photo", "click_head", "photo");
            2UX r1 = new 2UX();
            r1.LIZ("type", "photo");
            r1.LIZ("enter_method", "click_head");
            r1.LIZ("old_is_avatar", i);
            2nK.LIZ("replace_profile_photo", r1.LIZ);
            F2D f2d = this.LJIL;
            1hK activity = getActivity();
            OD2 od2 = this.LJIJ;
            User curUser = 46i.LJFF().getCurUser();
            User curUser2 = 46i.LJFF().getCurUser();
            if (curUser2.getBoldFields() == null || !curUser2.getBoldFields().contains("photo")) {
                str = "add";
            } else {
                str = "edit";
            }
            f2d.LIZ(activity, od2, curUser, str);
        }
    }

    private void LJ() {
        FOH foh = FOH.LIZ;
        JtF jtF = new JtF();
        jtF.LIZ("enter_from", "personal_homepage");
        jtF.LIZ("user_id", foh.LIZ());
        jtF.LIZ("enter_method", "click_edit_ngo_profile");
        2nK.LIZ("edit_nonprofit_link", jtF.LIZ);
        String LIZ2 = LIZ(this.LJJIJLIJ);
        if (LIZ2.equals(getContext().getString(2131827653))) {
            LJIIIIZZ();
            return;
        }
        String string = getResources().getString(2131827654, new Object[]{LIZ2});
        3Xu r3 = new 3Xu();
        r3.LIZ(2131827651);
        r3.LIZ(new FO9(this));
        3Xu r2 = new 3Xu();
        r2.LIZ(2131827652);
        r2.LIZ(new FOM(this));
        r2.LIZIZ(1);
        ArrayList arrayList = new ArrayList();
        arrayList.add(r3);
        arrayList.add(r2);
        3Xx r0 = new 3Xx();
        r0.LIZ(string);
        r0.LIZIZ(arrayList);
        r0.LIZIZ().show(getFragmentManager(), "nonprofit");
    }

    public final void LJII() {
        boolean z;
        String string;
        String str;
        String str2;
        Date date = new Date(this.LJJI.getHandleModified() * 1000);
        int abs = Math.abs((int) ((new Date().getTime() - date.getTime()) / 86400000));
        if (this.LIZLLL == 0) {
            F3V.LIZ.LIZ("enter_profile_username", "click_username", "username");
        }
        if (abs > 30) {
            z = true;
            string = getString(2131824481);
        } else {
            z = false;
            BDDateFormat bDDateFormat = new BDDateFormat("LL");
            Calendar instance = Calendar.getInstance();
            instance.setTime(date);
            instance.add(5, 30);
            string = getString(2131834619, new Object[]{bDDateFormat.LIZ(instance.getTime().getTime(), Locale.getDefault())});
        }
        if (this.LJJIJ != null) {
            if (!LJJIFFI(this.LJJJJLL)) {
                str = this.LJJJJLL;
            } else {
                str = "";
            }
            int i = this.LIZLLL;
            if (i == 1) {
                str2 = "personal_homepage";
            } else if (i == 2) {
                str2 = "modify_username_notify";
            } else if (i == 3) {
                str2 = "tiktok_message";
            } else {
                str2 = "edit_profile_page";
            }
            int i2 = -1;
            if (!(this.LJJI.specialAccount == null || this.LJJI.specialAccount.getSeller() == null)) {
                i2 = this.LJJI.specialAccount.getSeller().getType();
            }
            String string2 = getString(2131824463);
            String customVerify = this.LJJI.getCustomVerify();
            String enterpriseVerifyReason = this.LJJI.getEnterpriseVerifyReason();
            Integer valueOf = Integer.valueOf(i2);
            M12.LIZ(string2, str, string, str2);
            ProfileEditUsernameFragment profileEditUsernameFragment = new ProfileEditUsernameFragment();
            Bundle bundle = new Bundle();
            bundle.putString("content_name", string2);
            bundle.putString("content_value", str);
            bundle.putString("enter_from", str2);
            bundle.putBoolean("is_edit_enabled", z);
            bundle.putString("edit_hint", string);
            bundle.putInt("content_max_length", 24);
            bundle.putBoolean("is_enable_null", false);
            bundle.putString("custom_verify", customVerify);
            bundle.putString("enterprise_verify_reason", enterpriseVerifyReason);
            bundle.putString("special_account", String.valueOf(valueOf));
            profileEditUsernameFragment.setArguments(bundle);
            profileEditUsernameFragment.setUserVisibleHint(true);
            FOZ foz = new FOZ(this);
            M12.LIZ(foz);
            profileEditUsernameFragment.LIZIZ = foz;
            profileEditUsernameFragment.show(getActivity().getSupportFragmentManager(), "EditUserNameDialog");
        }
    }

    public final void LIZ() {
        if (getContext() != null) {
            LIZJ(false);
            3BB r1 = new 3BB(getContext());
            r1.LIZ(getString(2131834464));
            r1.LIZIZ();
        }
    }

    /* JADX WARNING: Can't fix incorrect switch cases order */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public void LIZJ() {
        /*
            r19 = this;
            r10 = r19
            X.OR2 r0 = new X.OR2
            r0.<init>()
            r10.LJJIFFI = r0
            com.ss.android.ugc.aweme.profile.model.User r0 = new com.ss.android.ugc.aweme.profile.model.User
            r0.<init>()
            r10.LJJJJZI = r0
            com.ss.android.ugc.aweme.IAccountUserService r0 = X.46i.LJFF()
            com.ss.android.ugc.aweme.profile.model.User r0 = r0.getCurUser()
            r10.LJJI = r0
            if (r0 != 0) goto L_0x001d
            return
        L_0x001d:
            com.ss.android.ugc.aweme.compliance.api.services.banappeal.IBanAppealService r1 = com.ss.android.ugc.aweme.compliance.api.a.LIZJ()
            r0 = 4
            boolean r0 = r1.LIZ(r0)
            r10.LJJJJZ = r0
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            java.util.List r0 = r0.boldFields
            r10.LJIILLIIL = r0
            java.lang.String r14 = "category"
            java.lang.String r9 = "supported_ngo"
            java.lang.String r13 = "bio"
            java.lang.String r8 = "nickname"
            java.lang.String r12 = "email"
            java.lang.String r11 = "blank"
            java.lang.String r7 = "bold"
            java.lang.String r6 = "website"
            java.lang.String r5 = "instagram"
            java.lang.String r4 = "twitter"
            java.lang.String r3 = "youtube"
            r15 = 1
            java.lang.String r2 = ""
            if (r0 == 0) goto L_0x0175
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            int r1 = r0.getAccountType()
            if (r1 == 0) goto L_0x0171
            if (r1 == r15) goto L_0x016d
            r0 = 2
            if (r1 == r0) goto L_0x0169
            r0 = 3
            if (r1 == r0) goto L_0x0165
            r15 = r2
        L_0x005a:
            X.2UX r1 = r10.LJIIZILJ
            java.lang.String r0 = "account_type"
            r1.LIZ(r0, r15)
            java.util.List<java.lang.String> r0 = LJIILL
            java.util.Iterator r18 = r0.iterator()
        L_0x0067:
            boolean r0 = r18.hasNext()
            if (r0 == 0) goto L_0x0175
            java.lang.Object r1 = r18.next()
            java.lang.String r1 = (java.lang.String) r1
            r1.hashCode()
            int r0 = r1.hashCode()
            switch(r0) {
                case -991745245: goto L_0x015a;
                case -916346253: goto L_0x014f;
                case -477583675: goto L_0x0144;
                case -180337243: goto L_0x0137;
                case 97544: goto L_0x012c;
                case 28903346: goto L_0x0120;
                case 50511102: goto L_0x0114;
                case 70690926: goto L_0x0108;
                case 106642994: goto L_0x00fa;
                case 112202875: goto L_0x00ec;
                case 1224335515: goto L_0x00e0;
                default: goto L_0x007d;
            }
        L_0x007d:
            r0 = -1
        L_0x007e:
            java.lang.String r17 = "is_edited"
            java.lang.String r16 = "default"
            switch(r0) {
                case 0: goto L_0x00cf;
                case 1: goto L_0x00cf;
                case 2: goto L_0x00cf;
                case 3: goto L_0x00be;
                case 4: goto L_0x00cf;
                case 5: goto L_0x00cf;
                case 6: goto L_0x00cf;
                case 7: goto L_0x00ac;
                case 8: goto L_0x0099;
                case 9: goto L_0x0086;
                case 10: goto L_0x00cf;
                default: goto L_0x0085;
            }
        L_0x0085:
            goto L_0x0067
        L_0x0086:
            X.2UX r15 = r10.LJIIZILJ
            java.util.List<java.lang.String> r0 = r10.LJIILLIIL
            boolean r0 = r0.contains(r1)
            if (r0 == 0) goto L_0x0096
        L_0x0090:
            r0 = r17
            r15.LIZ(r1, r0)
            goto L_0x0067
        L_0x0096:
            r17 = r11
            goto L_0x0090
        L_0x0099:
            X.2UX r15 = r10.LJIIZILJ
            java.util.List<java.lang.String> r0 = r10.LJIILLIIL
            boolean r0 = r0.contains(r1)
            if (r0 == 0) goto L_0x00a9
        L_0x00a3:
            r0 = r17
            r15.LIZ(r1, r0)
            goto L_0x0067
        L_0x00a9:
            r17 = r16
            goto L_0x00a3
        L_0x00ac:
            X.2UX r15 = r10.LJIIZILJ
            java.util.List<java.lang.String> r0 = r10.LJIILLIIL
            boolean r0 = r0.contains(r1)
            if (r0 == 0) goto L_0x00b8
            r16 = r7
        L_0x00b8:
            r0 = r16
            r15.LIZ(r1, r0)
            goto L_0x0067
        L_0x00be:
            X.2UX r15 = r10.LJIIZILJ
            java.util.List<java.lang.String> r0 = r10.LJIILLIIL
            boolean r0 = r0.contains(r1)
            if (r0 == 0) goto L_0x00cd
            r0 = r7
        L_0x00c9:
            r15.LIZ(r12, r0)
            goto L_0x0067
        L_0x00cd:
            r0 = r11
            goto L_0x00c9
        L_0x00cf:
            X.2UX r15 = r10.LJIIZILJ
            java.util.List<java.lang.String> r0 = r10.LJIILLIIL
            boolean r0 = r0.contains(r1)
            if (r0 == 0) goto L_0x00de
            r0 = r7
        L_0x00da:
            r15.LIZ(r1, r0)
            goto L_0x0067
        L_0x00de:
            r0 = r11
            goto L_0x00da
        L_0x00e0:
            boolean r0 = r1.equals(r6)
            if (r0 != 0) goto L_0x00e7
            goto L_0x007d
        L_0x00e7:
            r0 = 10
            r0 = 10
            goto L_0x007e
        L_0x00ec:
            java.lang.String r0 = "video"
            boolean r0 = r1.equals(r0)
            if (r0 != 0) goto L_0x00f5
            goto L_0x007d
        L_0x00f5:
            r0 = 9
            r0 = 9
            goto L_0x007e
        L_0x00fa:
            java.lang.String r0 = "photo"
            boolean r0 = r1.equals(r0)
            if (r0 != 0) goto L_0x0104
            goto L_0x007d
        L_0x0104:
            r0 = 8
            goto L_0x007e
        L_0x0108:
            boolean r0 = r1.equals(r8)
            if (r0 != 0) goto L_0x0110
            goto L_0x007d
        L_0x0110:
            r0 = 7
            r0 = 7
            goto L_0x007e
        L_0x0114:
            boolean r0 = r1.equals(r14)
            if (r0 != 0) goto L_0x011c
            goto L_0x007d
        L_0x011c:
            r0 = 6
            r0 = 6
            goto L_0x007e
        L_0x0120:
            boolean r0 = r1.equals(r5)
            if (r0 != 0) goto L_0x0128
            goto L_0x007d
        L_0x0128:
            r0 = 5
            r0 = 5
            goto L_0x007e
        L_0x012c:
            boolean r0 = r1.equals(r13)
            if (r0 != 0) goto L_0x0134
            goto L_0x007d
        L_0x0134:
            r0 = 4
            goto L_0x007e
        L_0x0137:
            java.lang.String r0 = "bio_email"
            boolean r0 = r1.equals(r0)
            if (r0 != 0) goto L_0x0141
            goto L_0x007d
        L_0x0141:
            r0 = 3
            goto L_0x007e
        L_0x0144:
            boolean r0 = r1.equals(r9)
            if (r0 != 0) goto L_0x014c
            goto L_0x007d
        L_0x014c:
            r0 = 2
            goto L_0x007e
        L_0x014f:
            boolean r0 = r1.equals(r4)
            if (r0 != 0) goto L_0x0157
            goto L_0x007d
        L_0x0157:
            r0 = 1
            goto L_0x007e
        L_0x015a:
            boolean r0 = r1.equals(r3)
            if (r0 != 0) goto L_0x0162
            goto L_0x007d
        L_0x0162:
            r0 = 0
            goto L_0x007e
        L_0x0165:
            java.lang.String r15 = "business"
            goto L_0x005a
        L_0x0169:
            java.lang.String r15 = "creator"
            goto L_0x005a
        L_0x016d:
            java.lang.String r15 = "proaccount"
            goto L_0x005a
        L_0x0171:
            java.lang.String r15 = "normal"
            goto L_0x005a
        L_0x0175:
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            java.lang.String r0 = r0.getSignature()
            boolean r0 = android.text.TextUtils.isEmpty(r0)
            r10.LIZ((java.lang.String) r13, (boolean) r0, (java.lang.String) r2)
            X.3Yi r13 = r10.LJJIIZI
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            java.lang.String r1 = r0.getNickname()
            r0 = 0
            r10.LIZ((X.3Yi) r13, (java.lang.CharSequence) r1, (boolean) r0)
            X.3Yi r0 = r10.LJJIIZI
            r10.LIZ((X.3Yi) r0, (java.lang.String) r8)
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            java.lang.String r0 = X.ESC.LIZJ(r0)
            r10.LJJI(r0)
            com.ss.android.ugc.aweme.profile.model.User r1 = r10.LJJI
            java.lang.String r13 = "pronouns"
            if (r1 == 0) goto L_0x01c8
            boolean r0 = r10.LJJJJZ
            if (r0 != 0) goto L_0x01c8
            com.ss.android.ugc.aweme.profile.model.UserPronounsInfo r0 = r1.getPronounsInfo()
            if (r0 == 0) goto L_0x01c8
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            com.ss.android.ugc.aweme.profile.model.UserPronounsInfo r0 = r0.getPronounsInfo()
            java.lang.Boolean r0 = r0.getEnableEditPronouns()
            if (r0 == 0) goto L_0x01c8
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            com.ss.android.ugc.aweme.profile.model.UserPronounsInfo r0 = r0.getPronounsInfo()
            java.lang.Boolean r0 = r0.getEnableEditPronouns()
            boolean r0 = r0.booleanValue()
            if (r0 != 0) goto L_0x0588
        L_0x01c8:
            X.3Yi r1 = r10.LJJIJIIJI
            r0 = 8
            r1.setVisibility(r0)
            X.2UX r1 = r10.LJIIZILJ
            java.lang.String r0 = "null"
            r1.LIZ(r13, r0)
        L_0x01d6:
            com.ss.android.ugc.aweme.profile.model.User r1 = r10.LJJI
            r7 = 0
            if (r1 == 0) goto L_0x0584
            java.lang.String r0 = r1.getSignature()
            r10.LJIJJ(r0)
            java.lang.String r0 = r1.getBioUrl()
            r10.LJIJI(r0)
            java.lang.String r0 = r1.getBioEmail()
            r10.LJIIZILJ(r0)
            X.3t7 r0 = r1.getBizAccountInfo()
            if (r0 == 0) goto L_0x0581
            X.3t7 r0 = r1.getBizAccountInfo()
            java.lang.String r0 = r0.getDownloadAppLinkToShowInEditProfile()
        L_0x01fe:
            r10.LJIJJLI(r0)
            java.lang.String r0 = r1.getCategory()
            r10.LJIL(r0)
            X.2kD r0 = X.2kD.LIZ
            boolean r0 = r0.LIZ()
            if (r0 == 0) goto L_0x053f
            com.ss.android.ugc.aweme.profile.model.UserBioPermission r13 = r1.getBioPermission()
            if (r13 == 0) goto L_0x0522
            X.3Yi r11 = r10.LJJIJIL
            boolean r0 = r13.getEnableUrl()
            if (r0 == 0) goto L_0x051e
            r0 = 0
        L_0x021f:
            r11.setVisibility(r0)
            X.3Yi r11 = r10.LJJIJL
            boolean r0 = r13.getEnableEmail()
            if (r0 == 0) goto L_0x051a
            r0 = 0
        L_0x022b:
            r11.setVisibility(r0)
            X.3Yi r11 = r10.LJJIL
            boolean r0 = r13.getEnableDownloadAppLink()
            if (r0 == 0) goto L_0x0516
            r0 = 0
        L_0x0237:
            r11.setVisibility(r0)
            boolean r0 = r13.getEnableUrl()
            if (r0 != 0) goto L_0x0245
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r6, r2)
        L_0x0245:
            boolean r0 = r13.getEnableEmail()
            if (r0 != 0) goto L_0x0250
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r12, r2)
        L_0x0250:
            int r6 = r1.getAccountType()
            r0 = 2
            if (r6 == r0) goto L_0x025e
            int r1 = r1.getAccountType()
            r0 = 3
            if (r1 != r0) goto L_0x0513
        L_0x025e:
            r0 = 1
        L_0x025f:
            X.3Yi r1 = r10.LJJIZ
            if (r0 == 0) goto L_0x050f
            r0 = 0
        L_0x0264:
            r1.setVisibility(r0)
            r1 = 8
        L_0x0269:
            X.3Yi r0 = r10.LJJIZ
            int r0 = r0.getVisibility()
            if (r0 != r1) goto L_0x0276
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r14, r2)
        L_0x0276:
            com.ss.android.ugc.aweme.profile.model.User r6 = r10.LJJI
            if (r6 != 0) goto L_0x04e0
            X.3Yi r0 = r10.LJJIJLIJ
            r0.setVisibility(r1)
        L_0x027f:
            boolean r0 = X.FOJ.LIZ
            if (r0 == 0) goto L_0x04d7
            X.3Yi r0 = r10.LJJIIZ
            r1 = 0
            r10.LIZ((X.3Yi) r0, (java.lang.CharSequence) r2, (boolean) r1)
            X.3Yi r0 = r10.LJJIIZ
            r0.setVisibility(r1)
            X.3Yi r1 = r10.LJJIIZ
            java.lang.String r0 = "navi_view"
            r10.LIZ((X.3Yi) r1, (java.lang.String) r0)
        L_0x0295:
            java.util.Date r6 = new java.util.Date
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            long r0 = r0.getHandleModified()
            r11 = 1000(0x3e8, double:4.94E-321)
            long r0 = r0 * r11
            r6.<init>(r0)
            java.util.Date r0 = new java.util.Date
            r0.<init>()
            long r0 = r0.getTime()
            long r11 = r6.getTime()
            long r0 = r0 - r11
            r11 = 86400000(0x5265c00, double:4.2687272E-316)
            long r0 = r0 / r11
            int r6 = (int) r0
            int r1 = java.lang.Math.abs(r6)
            r0 = 30
            if (r1 < r0) goto L_0x02d2
            int r0 = r10.LIZLLL
            if (r0 == 0) goto L_0x02d2
            r0 = 500(0x1f4, double:2.47E-321)
            X.0Gp r6 = X.0Gp.LIZ(r0)
            X.FOR r1 = new X.FOR
            r1.<init>(r10)
            java.util.concurrent.Executor r0 = X.0Gp.LIZIZ
            r6.LIZ(r1, r0, r7)
        L_0x02d2:
            com.ss.android.ugc.aweme.profile.model.User r1 = r10.LJJJJZI
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            java.lang.String r0 = r0.getSignature()
            r1.setSignature(r0)
            X.OD2 r1 = r10.LJIJ
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            com.ss.android.ugc.aweme.base.model.UrlModel r0 = r0.getAvatarMedium()
            X.OCa.LIZ(r1, r0)
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            java.lang.String r0 = r0.getInsId()
            boolean r0 = android.text.TextUtils.isEmpty(r0)
            if (r0 != 0) goto L_0x04d4
            X.3Yi r1 = r10.LJJJI
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            java.lang.String r0 = r0.getInsId()
            r6 = 1
            r10.LIZ((X.3Yi) r1, (java.lang.CharSequence) r0, (boolean) r6)
        L_0x0300:
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            java.lang.String r0 = r0.getYoutubeChannelTitle()
            boolean r0 = android.text.TextUtils.isEmpty(r0)
            if (r0 != 0) goto L_0x0317
            X.3Yi r1 = r10.LJJJIL
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            java.lang.String r0 = r0.getYoutubeChannelTitle()
            r10.LIZ((X.3Yi) r1, (java.lang.CharSequence) r0, (boolean) r6)
        L_0x0317:
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            java.lang.String r0 = r0.getTwitterName()
            boolean r0 = android.text.TextUtils.isEmpty(r0)
            if (r0 != 0) goto L_0x032e
            X.3Yi r1 = r10.LJJJJ
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            java.lang.String r0 = r0.getTwitterName()
            r10.LIZ((X.3Yi) r1, (java.lang.CharSequence) r0, (boolean) r6)
        L_0x032e:
            java.util.List<java.lang.String> r0 = r10.LJIILLIIL
            if (r0 == 0) goto L_0x0367
            X.3Yi r1 = r10.LJJIIZI
            boolean r0 = r0.contains(r8)
            r10.LIZ((X.3Yi) r1, (java.lang.CharSequence) r7, (boolean) r0)
            X.3Yi r1 = r10.LJJIJLIJ
            java.util.List<java.lang.String> r0 = r10.LJIILLIIL
            boolean r0 = r0.contains(r9)
            r10.LIZ((X.3Yi) r1, (java.lang.CharSequence) r7, (boolean) r0)
            X.3Yi r1 = r10.LJJJI
            java.util.List<java.lang.String> r0 = r10.LJIILLIIL
            boolean r0 = r0.contains(r5)
            r10.LIZ((X.3Yi) r1, (java.lang.CharSequence) r7, (boolean) r0)
            X.3Yi r1 = r10.LJJJIL
            java.util.List<java.lang.String> r0 = r10.LJIILLIIL
            boolean r0 = r0.contains(r3)
            r10.LIZ((X.3Yi) r1, (java.lang.CharSequence) r7, (boolean) r0)
            X.3Yi r1 = r10.LJJJJ
            java.util.List<java.lang.String> r0 = r10.LJIILLIIL
            boolean r0 = r0.contains(r4)
            r10.LIZ((X.3Yi) r1, (java.lang.CharSequence) r7, (boolean) r0)
        L_0x0367:
            com.ss.android.ugc.aweme.profile.model.User r7 = r10.LJJI
            X.9EH r0 = X.9EH.LJJIFFI
            boolean r0 = r0.LJIIJ()
            if (r0 != 0) goto L_0x0379
            X.DHP r0 = X.DHP.LIZ
            boolean r0 = r0.LIZIZ()
            if (r0 == 0) goto L_0x0464
        L_0x0379:
            android.view.View r0 = r10.LJJJ
            r1 = 8
            r0.setVisibility(r1)
            X.Qeg r0 = r10.LJJJJJ
            r0.setVisibility(r1)
            X.3Yi r0 = r10.LJJJJ
            r0.setVisibility(r1)
            X.3Yi r0 = r10.LJJJI
            r0.setVisibility(r1)
            X.3Yi r0 = r10.LJJJIL
            r0.setVisibility(r1)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r4, r2)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r5, r2)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r3, r2)
        L_0x03a3:
            X.DFY r0 = X.DFY.LIZ
            boolean r0 = r0.LIZ()
            if (r0 == 0) goto L_0x0463
            X.Mjy r0 = new X.Mjy
            r0.<init>()
            r10.LJIIJ = r0
            X.0Bx r2 = new X.0Bx
            X.DO3 r1 = new X.DO3
            X.Mjy r0 = r10.LJIIJ
            r1.<init>(r0)
            r2.<init>(r10, r1)
            java.lang.Class<com.ss.android.ugc.aweme.profile.editprofile.vm.ProfileEditProfileViewModel> r0 = com.ss.android.ugc.aweme.profile.editprofile.vm.ProfileEditProfileViewModel.class
            X.0Bt r0 = r2.LIZ(r0)
            com.ss.android.ugc.aweme.profile.editprofile.vm.ProfileEditProfileViewModel r0 = (com.ss.android.ugc.aweme.profile.editprofile.vm.ProfileEditProfileViewModel) r0
            r10.LJIIIZ = r0
            X.1hK r2 = r19.getActivity()
            if (r2 == 0) goto L_0x03fe
            com.ss.android.ugc.aweme.profile.editprofile.vm.ProfileEditProfileViewModel r0 = r10.LJIIIZ
            X.1Bn<java.lang.String> r1 = r0.LIZLLL
            X.2MT r0 = new X.2MT
            r0.<init>(r2)
            r1.observe(r10, r0)
            com.ss.android.ugc.aweme.profile.editprofile.vm.ProfileEditProfileViewModel r0 = r10.LJIIIZ
            X.1Bn<java.util.List<java.lang.Integer>> r1 = r0.LJ
            X.FOf r0 = new X.FOf
            r0.<init>(r10)
            r1.observe(r10, r0)
            com.ss.android.ugc.aweme.profile.editprofile.vm.ProfileEditProfileViewModel r0 = r10.LJIIIZ
            X.1Bn<java.lang.Boolean> r1 = r0.LJFF
            X.FOF r0 = new X.FOF
            r0.<init>(r10)
            r1.observe(r10, r0)
            com.ss.android.ugc.aweme.profile.editprofile.vm.ProfileEditProfileViewModel r0 = r10.LJIIIZ
            X.1Bn<java.lang.Boolean> r1 = r0.LJI
            X.FOG r0 = new X.FOG
            r0.<init>(r10)
            r1.observe(r10, r0)
        L_0x03fe:
            com.ss.android.ugc.aweme.profile.model.User r4 = r10.LJJI
            if (r4 == 0) goto L_0x0463
            X.DZp r0 = r10.LJJJJI
            X.M12.LIZ(r0, r10)
            X.0E3 r0 = r0.getAdapter()
            if (r0 == 0) goto L_0x05d3
            com.bytedance.ies.powerlist.PowerAdapter r0 = (com.bytedance.ies.powerlist.PowerAdapter) r0
            com.bytedance.ies.powerlist.PowerStub r0 = r0.LJII()
            if (r0 == 0) goto L_0x042e
            X.DVR r2 = r0.LIZLLL()
            java.util.Map r1 = r2.LIZ()
            java.lang.Class<X.DPE> r0 = X.DPE.class
            boolean r0 = r1.containsKey(r0)
            if (r0 != 0) goto L_0x05bd
            java.util.Map r1 = r2.LIZ()
            java.lang.Class<X.DPE> r0 = X.DPE.class
            r1.put(r0, r10)
        L_0x042e:
            X.DZp r3 = r10.LJJJJI
            r0 = 1
            java.lang.Class[] r2 = new java.lang.Class[r0]
            java.lang.Class<com.ss.android.ugc.aweme.profile.editprofile.advancedfeatures.powerlist.ProfileAdvancedFeaturesCell> r1 = com.ss.android.ugc.aweme.profile.editprofile.advancedfeatures.powerlist.ProfileAdvancedFeaturesCell.class
            r0 = 0
            r2[r0] = r1
            r3.LIZ((java.lang.Class<? extends com.bytedance.ies.powerlist.PowerCell<?>>[]) r2)
            X.DZp r0 = r10.LJJJJI
            r0.setLifecycleOwner(r10)
            X.DZs r1 = new X.DZs
            com.ss.android.ugc.aweme.profile.editprofile.vm.ProfileEditProfileViewModel r0 = r10.LJIIIZ
            java.util.List r0 = r0.LIZ((com.ss.android.ugc.aweme.profile.model.User) r4)
            r1.<init>(r0)
            X.DZp r0 = r10.LJJJJI
            r0.LIZ((X.C1446DZq) r1)
            X.DO6 r2 = new X.DO6
            com.ss.android.ugc.aweme.profile.editprofile.vm.ProfileEditProfileViewModel r0 = r10.LJIIIZ
            r2.<init>(r1, r0)
            X.1Cv r1 = new X.1Cv
            r1.<init>(r2)
            r10.LJIIJJI = r1
            X.DZp r0 = r10.LJJJJI
            r1.LIZ(r0)
        L_0x0463:
            return
        L_0x0464:
            com.ss.android.ugc.aweme.profile.settings.ThirdPartyBindingEntry r0 = X.FOC.LIZ()
            r0.getTwitter()
            com.ss.android.ugc.aweme.profile.settings.ThirdPartyBindingEntry r0 = X.FOC.LIZ()
            boolean r8 = r0.getIns()
            com.ss.android.ugc.aweme.profile.settings.ThirdPartyBindingEntry r0 = X.FOC.LIZ()
            boolean r6 = r0.getYoutube()
            X.3Yi r0 = r10.LJJJJ
            r1 = 8
            r0.setVisibility(r1)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r4, r2)
            if (r8 != 0) goto L_0x0493
            java.lang.String r0 = r7.getInsId()
            boolean r0 = android.text.TextUtils.isEmpty(r0)
            if (r0 != 0) goto L_0x04c9
        L_0x0493:
            X.3Yi r1 = r10.LJJJI
            r0 = 0
            r1.setVisibility(r0)
        L_0x0499:
            if (r6 != 0) goto L_0x04a5
            java.lang.String r0 = r7.getYoutubeChannelTitle()
            boolean r0 = android.text.TextUtils.isEmpty(r0)
            if (r0 != 0) goto L_0x04bc
        L_0x04a5:
            X.3Yi r1 = r10.LJJJIL
            r0 = 0
            r1.setVisibility(r0)
        L_0x04ab:
            X.3Yi r0 = r10.LJJJI
            r10.LIZ((X.3Yi) r0, (java.lang.String) r5)
            X.3Yi r0 = r10.LJJJIL
            r10.LIZ((X.3Yi) r0, (java.lang.String) r3)
            X.3Yi r0 = r10.LJJJJ
            r10.LIZ((X.3Yi) r0, (java.lang.String) r4)
            goto L_0x03a3
        L_0x04bc:
            X.3Yi r1 = r10.LJJJIL
            r0 = 8
            r1.setVisibility(r0)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r3, r2)
            goto L_0x04ab
        L_0x04c9:
            X.3Yi r0 = r10.LJJJI
            r0.setVisibility(r1)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r5, r2)
            goto L_0x0499
        L_0x04d4:
            r6 = 1
            goto L_0x0300
        L_0x04d7:
            X.3Yi r1 = r10.LJJIIZ
            r0 = 8
            r1.setVisibility(r0)
            goto L_0x0295
        L_0x04e0:
            boolean r0 = X.FOI.LIZ()
            if (r0 != 0) goto L_0x04ed
            X.3Yi r0 = r10.LJJIJLIJ
            r0.setVisibility(r1)
            goto L_0x027f
        L_0x04ed:
            X.3Yi r1 = r10.LJJIJLIJ
            r0 = 0
            r1.setVisibility(r0)
            com.ss.android.ugc.aweme.profile.model.ProfileNgoStruct r0 = r6.getProfileNgoStruct()
            r10.LIZ((com.ss.android.ugc.aweme.profile.model.ProfileNgoStruct) r0)
            com.ss.android.ugc.aweme.profile.model.ProfileNgoStruct r0 = r6.getProfileNgoStruct()
            if (r0 == 0) goto L_0x050d
            com.ss.android.ugc.aweme.profile.model.ProfileNgoStruct r0 = r6.getProfileNgoStruct()
            java.lang.String r0 = r0.getName()
        L_0x0508:
            r10.LJIJ(r0)
            goto L_0x027f
        L_0x050d:
            r0 = r7
            goto L_0x0508
        L_0x050f:
            r0 = 8
            goto L_0x0264
        L_0x0513:
            r0 = 0
            goto L_0x025f
        L_0x0516:
            r0 = 8
            goto L_0x0237
        L_0x051a:
            r0 = 8
            goto L_0x022b
        L_0x051e:
            r0 = 8
            goto L_0x021f
        L_0x0522:
            X.3Yi r0 = r10.LJJIJIL
            r11 = 8
            r0.setVisibility(r11)
            X.3Yi r0 = r10.LJJIJL
            r0.setVisibility(r11)
            X.3Yi r0 = r10.LJJIL
            r0.setVisibility(r11)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r6, r2)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r12, r2)
            goto L_0x0250
        L_0x053f:
            X.LHR r0 = X.LHR.LIZ
            boolean r0 = r0.shouldShowBioUrl()
            if (r0 == 0) goto L_0x0573
            X.3Yi r0 = r10.LJJIJIL
            r11 = 0
            r0.setVisibility(r11)
            r1 = 8
        L_0x054f:
            X.LHR r0 = X.LHR.LIZ
            boolean r0 = r0.shouldShowBioEmail()
            if (r0 == 0) goto L_0x0568
            X.3Yi r0 = r10.LJJIJL
            r0.setVisibility(r11)
        L_0x055c:
            X.3Yi r0 = r10.LJJIL
            r0.setVisibility(r1)
            X.3Yi r0 = r10.LJJIZ
            r0.setVisibility(r1)
            goto L_0x0269
        L_0x0568:
            X.3Yi r0 = r10.LJJIJL
            r0.setVisibility(r1)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r12, r2)
            goto L_0x055c
        L_0x0573:
            r11 = 0
            X.3Yi r0 = r10.LJJIJIL
            r1 = 8
            r0.setVisibility(r1)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r6, r2)
            goto L_0x054f
        L_0x0581:
            r0 = r7
            goto L_0x01fe
        L_0x0584:
            r1 = 8
            goto L_0x0276
        L_0x0588:
            com.ss.android.ugc.aweme.profile.model.User r0 = r10.LJJI
            com.ss.android.ugc.aweme.profile.model.UserPronounsInfo r0 = r0.getPronounsInfo()
            java.lang.String r15 = r0.getPronouns()
            boolean r0 = android.text.TextUtils.isEmpty(r15)
            if (r0 == 0) goto L_0x05b1
            X.3Yi r7 = r10.LJJIJIIJI
            r0 = 2131821392(0x7f110350, float:1.9275526E38)
            java.lang.String r1 = r10.getString(r0)
            r0 = 0
            r10.LIZ((X.3Yi) r7, (java.lang.CharSequence) r1, (boolean) r0)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r13, r11)
        L_0x05aa:
            X.3Yi r0 = r10.LJJIJIIJI
            r10.LIZ((X.3Yi) r0, (java.lang.String) r13)
            goto L_0x01d6
        L_0x05b1:
            X.3Yi r1 = r10.LJJIJIIJI
            r0 = 1
            r10.LIZ((X.3Yi) r1, (java.lang.CharSequence) r15, (boolean) r0)
            X.2UX r0 = r10.LJIIZILJ
            r0.LIZ(r13, r7)
            goto L_0x05aa
        L_0x05bd:
            java.lang.RuntimeException r2 = new java.lang.RuntimeException
            java.lang.StringBuilder r1 = new java.lang.StringBuilder
            java.lang.String r0 = "already contains control type :"
            r1.<init>(r0)
            java.lang.Class<X.DPE> r0 = X.DPE.class
            r1.append(r0)
            java.lang.String r0 = r1.toString()
            r2.<init>(r0)
            throw r2
        L_0x05d3:
            X.7xU r1 = new X.7xU
            java.lang.String r0 = "null cannot be cast to non-null type com.bytedance.ies.powerlist.PowerAdapter"
            r1.<init>(r0)
            throw r1
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.profile.ui.ProfileEditFragment.LIZJ():void");
    }

    public final void LIZ(PowerCell<?> powerCell) {
        this.LJIIJJI.LIZIZ(powerCell);
    }

    public void onActivityCreated(Bundle bundle) {
        ProfileEditFragment.super.onActivityCreated(bundle);
        LIZJ();
    }

    private String LJJ(String str) {
        while (str.contains("\n\n")) {
            str = str.replaceAll("\n\n", "\n");
        }
        return str;
    }

    private boolean LJJII(String str) {
        return Pattern.compile("[0-9]*").matcher(str).matches();
    }

    /* renamed from: LIZIZ */
    public final void LIZJ(boolean z) {
        OQg oQg = this.LJIJI;
        if (oQg != null) {
            if (z) {
                LJIILL();
            } else {
                oQg.setVisibility(4);
            }
        }
    }

    public final void LIZJ(String str) {
        OJq.LIZIZ(new FOW(this, str), "BoltsUtils");
    }

    public final void LJ(String str) {
        OJq.LIZIZ(new FOX(this, str), "BoltsUtils");
    }

    public final void LJFF(String str) {
        OJq.LIZIZ(new FOB(this, str), "BoltsUtils");
    }

    public final void LJI(String str) {
        OJq.LIZIZ(new FOV(this, str), "BoltsUtils");
    }

    public final String LJIIIIZZ(String str) {
        return "tiktok.com/@".concat(String.valueOf(str));
    }

    private String LIZ(3Yi r3) {
        3Ys accessory = r3.getAccessory();
        if (accessory == null || accessory.LIZJ.getLabel() == null) {
            return "";
        }
        return accessory.LIZJ.getLabel().toString();
    }

    private void LIZLLL(boolean z) {
        if (z) {
            this.LJJIII.setVisibility(0);
            this.LJJIIJ.setVisibility(8);
            LIZIZ(this.LJJIJ);
            return;
        }
        this.LJJIII.setVisibility(8);
        this.LJJIIJ.setVisibility(0);
    }

    private boolean LJJIFFI(String str) {
        if (this.LJJJJZ) {
            return false;
        }
        if (!str.matches("[0-9A-Za-z_.]*") || LJJII(str)) {
            return true;
        }
        return false;
    }

    public final /* synthetic */ void LIZIZ(DialogInterface dialogInterface) {
        InstagramPresenter instagramPresenter = this.LJJJJJL;
        instagramPresenter.LJI = false;
        instagramPresenter.LJ.updateInsId(instagramPresenter.LIZLLL, "", 0);
        dialogInterface.dismiss();
        LJIILL();
    }

    public final /* synthetic */ void LIZJ(DialogInterface dialogInterface) {
        Lwo lwo = this.LJJJJL;
        lwo.LIZLLL = false;
        Lwt.LIZ(new Lws(lwo));
        dialogInterface.dismiss();
        LJIILL();
    }

    public final /* synthetic */ void LJIIIZ(String str) {
        if (aq_()) {
            LIZJ(false);
            3af r0 = new 3af(this);
            r0.LIZ(str);
            3af.LIZ(r0);
        }
    }

    public final /* synthetic */ void LJIIJ(String str) {
        if (aq_()) {
            LIZJ(false);
            3af r0 = new 3af(this);
            r0.LIZ(str);
            3af.LIZ(r0);
        }
    }

    public final /* synthetic */ void LJIIJJI(String str) {
        if (aq_()) {
            LIZJ(false);
            3BB r1 = new 3BB(getContext());
            r1.LIZ(str);
            r1.LIZIZ();
        }
    }

    /* access modifiers changed from: private */
    /* renamed from: LIZJ */
    public void LIZIZ(View view) {
        if (!Cc1.LIZ(view, 1200) && aq_() && !this.LJJJJZ) {
            this.LIZJ.LIZ(this.LJJI, new 470(this));
        }
    }

    private void LJIIZILJ(String str) {
        if (!TextUtils.isEmpty(str)) {
            LIZ(this.LJJIJL, (CharSequence) str, false);
        } else {
            LIZ(this.LJJIJL, (CharSequence) getString(2131824445), false);
        }
        List<String> list = this.LJIILLIIL;
        if (list != null) {
            LIZ(this.LJJIJL, (CharSequence) null, list.contains("bio_email"));
        }
        LIZ(this.LJJIJL, "bio_email");
    }

    private void LJIJ(String str) {
        if (str == null || TextUtils.isEmpty(str)) {
            LIZ(this.LJJIJLIJ, (CharSequence) getString(2131827653), false);
        } else {
            LIZ(this.LJJIJLIJ, (CharSequence) str, false);
        }
        List<String> list = this.LJIILLIIL;
        if (list != null) {
            LIZ(this.LJJIJLIJ, (CharSequence) null, list.contains("supported_ngo"));
        }
        LIZ(this.LJJIJLIJ, "nonprofit");
    }

    private void LJIJI(String str) {
        if (!TextUtils.isEmpty(str)) {
            LIZ(this.LJJIJIL, (CharSequence) str, false);
        } else {
            LIZ(this.LJJIJIL, (CharSequence) getString(2131824464), false);
        }
        List<String> list = this.LJIILLIIL;
        if (list != null) {
            LIZ(this.LJJIJIL, (CharSequence) null, list.contains("website"));
        }
        LIZ(this.LJJIJIL, "website");
    }

    private void LJIJJ(String str) {
        if (!TextUtils.isEmpty(str)) {
            LIZ(this.LJJIJIIJIL, (CharSequence) str, false);
        } else {
            LIZ(this.LJJIJIIJIL, (CharSequence) getString(2131824439), false);
        }
        List<String> list = this.LJIILLIIL;
        if (list != null) {
            LIZ(this.LJJIJIIJIL, (CharSequence) null, list.contains("bio"));
        }
        LIZ(this.LJJIJIIJIL, "bio");
    }

    private void LJIJJLI(String str) {
        if (!TextUtils.isEmpty(str)) {
            LIZ(this.LJJIL, (CharSequence) str, false);
        } else {
            LIZ(this.LJJIL, (CharSequence) getString(2131820548), false);
        }
        LIZ(this.LJJIL, "app_store_link");
    }

    private void LJIL(String str) {
        if (!TextUtils.isEmpty(str)) {
            LIZ(this.LJJIZ, (CharSequence) str, false);
        } else {
            LIZ(this.LJJIZ, (CharSequence) getString(2131822543), false);
        }
        if (this.LJIILLIIL != null) {
            LIZ(this.LJJIZ, (CharSequence) null, true);
        }
        LIZ(this.LJJIZ, "category");
    }

    private void LJJI(String str) {
        this.LJJJJLL = str;
        this.LJJIIJZLJL.setText(LJIIIIZZ(str));
        LIZ(this.LJJIJ, (CharSequence) this.LJJJJLL, true);
        this.LJJIIJZLJL.setTextColor(getContext().getResources().getColor(2131099750));
        LIZLLL(LJJIFFI(this.LJJJJLL));
        LIZ(this.LJJIJ, "username");
    }

    public void LIZIZ(AvatarUri avatarUri) {
        this.LJIL.LIZLLL();
        if (this.LJIJJLI == null || avatarUri == null) {
            3BB r1 = new 3BB(getActivity());
            r1.LIZIZ(2131821268);
            r1.LIZIZ();
        }
    }

    public final void LIZLLL(String str) {
        if (getContext() != null) {
            if (TextUtils.isEmpty(str)) {
                LIZ(this.LJJJJ, (CharSequence) getContext().getString(2131824459), false);
            } else {
                LIZ(this.LJJJJ, (CharSequence) str, true);
            }
            LIZ(this.LJJJJ, TextUtils.isEmpty(str), "twitter");
            LIZJ(false);
        }
    }

    public final /* synthetic */ void LJIIL(String str) {
        UserPronounsInfo userPronounsInfo = new UserPronounsInfo();
        userPronounsInfo.setPronouns(str);
        this.LJJJJZI.setPronouns(userPronounsInfo);
        LIZ(true);
        if (!str.equals("")) {
            LIZ(this.LJJIJIIJI, (CharSequence) str, true);
            LIZ("pronouns", false, "bold");
            return;
        }
        LIZ(this.LJJIJIIJI, (CharSequence) getString(2131821392), false);
        LIZ("pronouns", true, "blank");
    }

    public final /* synthetic */ boolean LJIILL(String str) {
        String str2;
        this.LJJII = true;
        this.LJJJJZI.setBioUrl(str);
        boolean isEmpty = TextUtils.isEmpty(str);
        if (!TextUtils.isEmpty(str)) {
            str2 = "bold";
        } else {
            str2 = "blank";
        }
        LIZ("website", isEmpty, str2);
        LJIJI(str);
        return true;
    }

    @ISm(LIZ = ThreadMode.MAIN)
    public void onAppStoreLinkSuccess(Hx0 hx0) {
        JSONObject optJSONObject;
        if (hx0.LIZIZ != null && TextUtils.equals(hx0.LIZIZ.optString("eventName"), "download_app_link_success") && (optJSONObject = hx0.LIZIZ.optJSONObject("data")) != null) {
            String optString = optJSONObject.optString("android_download_app_link");
            if (TextUtils.isEmpty(optString)) {
                optString = optJSONObject.optString("ios_download_app_link");
            }
            LJIJJLI(optString);
            46i.LJFF().queryUser();
        }
    }

    @ISm(LIZ = ThreadMode.MAIN)
    public void onEditCategorySuccessEvent(Hx0 hx0) {
        JSONObject optJSONObject;
        if (hx0.LIZIZ != null && TextUtils.equals(hx0.LIZIZ.optString("eventName"), "edit_category_success") && (optJSONObject = hx0.LIZIZ.optJSONObject("data")) != null) {
            String optString = optJSONObject.optString("category_name");
            if (!TextUtils.isEmpty(optString)) {
                LJIL(optString);
                this.LJJI.setCategory(optString);
                46i.LJFF().queryUser();
            }
        }
    }

    private void LIZIZ(3Yi r7) {
        3Ys accessory = r7.getAccessory();
        if (accessory != null) {
            SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(accessory.LIZJ.getLabel());
            3ZQ r3 = new 3ZQ();
            r3.LIZ = 2131755388;
            r3.LIZIZ = 2ha.LIZ(12.0d);
            r3.LIZJ = 2ha.LIZ(12.0d);
            r3.LJ = 2130968648;
            spannableStringBuilder.clear();
            spannableStringBuilder.append("0");
            spannableStringBuilder.setSpan(r3.LIZIZ(getContext()), 0, 1, 17);
            accessory.LIZ(spannableStringBuilder);
            r7.setAccessory(accessory);
        }
    }

    public final boolean LJII(String str) {
        if (TextUtils.isEmpty(str)) {
            3BB r1 = new 3BB(getActivity());
            r1.LIZIZ(2131827584);
            r1.LIZIZ();
            LIZJ(false);
            return false;
        } else if (TextUtils.isEmpty(str.trim())) {
            3BB r12 = new 3BB(getActivity());
            r12.LIZIZ(2131827586);
            r12.LIZIZ();
            LIZJ(false);
            return false;
        } else if (!TextUtils.equals(str, 46i.LJFF().getCurUser().getNickname())) {
            this.LJJJJZI.setNickname(str);
            this.LJIJJLI.LIZIZ(str);
            LJIILL();
            return true;
        } else {
            this.LJJIFFI.LIZ = "";
            return true;
        }
    }

    public final /* synthetic */ int LJIILLIIL(String str) {
        String uniqueId;
        User curUser = 46i.LJFF().getCurUser();
        if (TextUtils.isEmpty(curUser.getUniqueId())) {
            uniqueId = curUser.getShortId();
        } else {
            uniqueId = curUser.getUniqueId();
        }
        if (str.equals(uniqueId)) {
            this.LJJIFFI.LIZJ = "";
            return 0;
        } else if (FO6.LIZ(str, getContext())) {
            LJIILL();
            this.LJIJJLI.LIZ(str);
            this.LJJJJZI.setUniqueId(str);
            return 1;
        } else {
            LIZJ(false);
            this.LJJIFFI.LIZJ = "";
            return 2;
        }
    }

    private void LIZ(ProfileNgoStruct profileNgoStruct) {
        if (profileNgoStruct == null || profileNgoStruct.getName().isEmpty()) {
            this.LJ = null;
        } else {
            this.LJ = this.LJJI.getProfileNgoStruct();
        }
    }

    public void LIZIZ(Exception exc) {
        LJIIJ();
        if (aq_() && this.LJIL != null) {
            if ((exc instanceof JMC) && ((3qV) exc).getErrorCode() == 20022) {
                9BJ.LIZ(getActivity(), "profile_image_setting", "review_failure");
            }
            C3023DzH.LIZ((Context) getActivity(), (Throwable) exc, 2131821268);
            3i9.LIZ(exc.getMessage(), "avatar");
        }
    }

    public final /* synthetic */ boolean LJIILIIL(String str) {
        if (!TextUtils.equals(str, 46i.LJFF().getCurUser().getSignature())) {
            String LJJ2 = LJJ(str);
            int length = LJJ2.length() - 1;
            if (length >= 0 && LJJ2.charAt(length) == 10) {
                LJJ2 = LJJ2.substring(0, length);
            }
            this.LJJJJZI.setSignature(LJJ2);
            this.LJJIFFI.LIZIZ = LJJ2;
            LJIILL();
            this.LJIJJLI.LIZJ(LJJ2);
            this.LJJII = true;
            return true;
        }
        this.LJJIFFI.LIZIZ = null;
        return true;
    }

    public final /* synthetic */ boolean LJIILJJIL(String str) {
        String str2;
        this.LIZIZ = true;
        if (!TextUtils.equals(str, 46i.LJFF().getCurUser().getBioEmail())) {
            String LJJ2 = LJJ(str);
            int length = LJJ2.length() - 1;
            if (length >= 0 && LJJ2.charAt(length) == 10) {
                LJJ2 = LJJ2.substring(0, length);
            }
            this.LJJII = true;
            this.LJJIFFI.LJIIJJI = LJJ2;
            LJIILL();
            this.LJJJJZI.setEmail(LJJ2);
            this.LJIJJLI.LIZ((Map<String, String>) this.LJJIFFI.LIZ());
            boolean isEmpty = TextUtils.isEmpty(LJJ2);
            if (!TextUtils.isEmpty(LJJ2)) {
                str2 = "bold";
            } else {
                str2 = "blank";
            }
            LIZ("bio_email", isEmpty, str2);
            return true;
        }
        this.LJJIFFI.LJIIJJI = null;
        return true;
    }

    public final void LIZIZ(String str) {
        if (getContext() != null) {
            if (TextUtils.isEmpty(str)) {
                LIZ(this.LJJJI, (CharSequence) getContext().getString(2131824444), false);
            } else {
                LIZ(this.LJJJI, (CharSequence) str, true);
            }
            LIZ(this.LJJJI, TextUtils.isEmpty(str), "instagram");
            LIZJ(false);
        }
    }

    private void LIZ(3Yi r3, String str) {
        3Ys accessory = r3.getAccessory();
        if (accessory != null) {
            accessory.LIZ(new FOQ(this, str, r3));
        }
    }

    public static Object LIZ(Context context, String str) {
        Object obj;
        MethodCollector.i(11582);
        if (Build.VERSION.SDK_INT > 27 || !"clipboard".equals(str)) {
            if (!2FV.LIZIZ && "connectivity".equals(str)) {
                try {
                    new 7s1().LIZ();
                    2FV.LIZIZ = true;
                    obj = context.getSystemService(str);
                } catch (Throwable unused) {
                }
            }
            obj = context.getSystemService(str);
        } else if (2FV.LIZ) {
            synchronized (ClipboardManager.class) {
                try {
                    obj = context.getSystemService(str);
                    if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
                        Field declaredField = ClipboardManager.class.getDeclaredField("mHandler");
                        declaredField.setAccessible(true);
                        declaredField.set(obj, new 2He((Handler) declaredField.get(obj)));
                    }
                } catch (Exception e) {
                    8jA.LIZ(e, "ClipboardManager Handler Reflect Fail");
                } catch (Throwable th) {
                    MethodCollector.o(11582);
                    throw th;
                }
                2FV.LIZ = false;
            }
        } else {
            obj = context.getSystemService(str);
        }
        MethodCollector.o(11582);
        return obj;
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        if (i == 1001) {
            RVo rVo = this.LJJJJLI;
            if (intent == null) {
                RVo.LIZ(rVo, new Exception("onActivityResult called with null Intent"), (String) null, "goto_URL_and_auth", (8w0) null, 10);
            } else {
                0Gp.LIZ(new RGh(rVo, intent)).LIZ(new FO7(rVo));
            }
        } else {
            if (intent == null) {
                intent = new Intent();
            }
            intent.putExtra("extras_info", EQW.LJFF.LIZ(this.LJJI, "click_save", "photo", "video"));
            boolean LIZ2 = this.LJIL.LIZ(i, i2, intent);
        }
    }

    private void LIZ(String str, String str2, DialogInterface.OnClickListener onClickListener) {
        if (this.LJFF) {
            4vl r1 = new 4vl(getActivity());
            r1.LIZIZ(str);
            r1.LIZLLL(str2);
            r1.LIZ(2131822256, onClickListener);
            4FQ.LIZ(r1.LIZ().LIZJ());
        }
    }

    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View LIZ2 = 0HH.LIZ(layoutInflater, LIZIZ(), viewGroup, false);
        this.LJIJ = LIZ2.findViewById(2131365551);
        this.LJIJI = LIZ2.findViewById(2131370625);
        this.LJJIII = (LinearLayout) LIZ2.findViewById(2131366126);
        this.LJJIIJ = (LinearLayout) LIZ2.findViewById(2131367330);
        this.LJJIIJZLJL = (TextView) LIZ2.findViewById(2131368432);
        this.LJJIIZ = LIZ2.findViewById(2131367955);
        this.LJJIIZI = LIZ2.findViewById(2131368012);
        this.LJJIJ = LIZ2.findViewById(2131372670);
        this.LJJIJIIJI = LIZ2.findViewById(2131369050);
        this.LJJIJIIJIL = LIZ2.findViewById(2131362729);
        this.LJJIJIL = LIZ2.findViewById(2131373105);
        this.LJJIJL = LIZ2.findViewById(2131367516);
        this.LJJIJLIJ = LIZ2.findViewById(2131368052);
        this.LJJIL = LIZ2.findViewById(2131362370);
        this.LJJIZ = LIZ2.findViewById(2131363172);
        this.LJJJ = LIZ2.findViewById(2131362727);
        this.LJJJI = LIZ2.findViewById(2131366087);
        this.LJJJIL = LIZ2.findViewById(2131373175);
        this.LJJJJ = LIZ2.findViewById(2131372500);
        this.LJJJJI = (C1445DZp) LIZ2.findViewById(2131362187);
        this.LJJJJIZL = LIZ2.findViewById(2131365541);
        this.LJJJJJ = LIZ2.findViewById(2131365565);
        View findViewById = LIZ2.findViewById(2131372590);
        if (findViewById != null) {
            findViewById.setOnClickListener(new FOT(this));
        }
        View findViewById2 = LIZ2.findViewById(2131367330);
        if (findViewById2 != null) {
            findViewById2.setOnClickListener(new 3SL(this));
        }
        View findViewById3 = LIZ2.findViewById(2131365854);
        if (findViewById3 != null) {
            findViewById3.setOnClickListener(new FOU(this));
        }
        if (getArguments() != null) {
            this.LIZLLL = getArguments().getInt("need_focus_id_input", 0);
        }
        LIZ(LIZ2);
        EventBus.LIZ(EventBus.LIZ(), this);
        return LIZ2;
    }

    public final void LIZ(3Yi r7, CharSequence charSequence, boolean z) {
        int i;
        3Ys accessory = r7.getAccessory();
        if (accessory != null) {
            if (charSequence == null) {
                charSequence = accessory.LIZJ.getLabel();
            }
            SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(charSequence);
            Context context = getContext();
            if (z) {
                i = 2130968666;
            } else {
                i = 2130968674;
            }
            spannableStringBuilder.setSpan(new ForegroundColorSpan(Okm.LIZ(context, i).intValue()), 0, charSequence.length(), 17);
            accessory.LIZ(spannableStringBuilder);
            r7.setAccessory(accessory);
        }
    }
}
