package com.scb.phone.view.fragment.ndidcommon; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.CheckBox; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.constraintlayout.widget.ConstraintLayout; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnCheckedChanged; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.activity.ndidcommon.NdidCommonSelectIdpListActivity; import com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.ndidcommon.NdidCommonSelectIdpFragment; import java.util.List; import o.C0979Sw; import o.C0982Sz; import o.C11560ehe; import o.C14881gav; import o.C14957gcv; import o.C3172asW; import o.C4269bV; import o.C6744cbG; import o.Heg; import o.InterfaceC0834Plv; import o.InterfaceC13391fZD; import o.InterfaceC9502dku; import o.MYp; import o.SA; import o.SB; import o.ZI; import o.huo; import o.pug; /* loaded from: classes5.dex */ public final class NdidCommonSelectIdpFragment extends Hilt_NdidCommonSelectIdpFragment implements InterfaceC9502dku.HBt { public static final HBt d = new HBt(0); @BindView public Button btNext; private C0982Sz c; @BindView public CheckBox cbConsent; @BindView public ConstraintLayout csTermCondition; private SA f; private huo h; @InterfaceC13391fZD public C6744cbG idpPresenter; @BindView public CustomSpinnerWithTitle idpSpinner; private Sts j; @BindView public RelativeLayout rlLayoutSpinnerMark; @BindView public TextView tvAgreeTermsConditionTextView; @BindView public TextView tvPlaceholder; @BindView public TextView tvSelectedIdp; @BindView public TextView tvTermsConditionHeader; /* loaded from: classes5.dex */ public interface Sts { void a(SB sb); void e(C0979Sw c0979Sw); } /* JADX WARN: Multi-variable type inference failed */ @Override // com.scb.phone.view.fragment.ndidcommon.Hilt_NdidCommonSelectIdpFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment public final void onAttach(Context context) { C14957gcv.e(context, ""); super.onAttach(context); if (context instanceof Sts) { this.j = (Sts) context; } } @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); View inflate = layoutInflater.inflate(R.layout.2131559779, viewGroup, false); ((BaseFragment) this).a = ButterKnife.c(this, inflate); huo registerForActivityResult = registerForActivityResult(new C11560ehe.Sts(), new InterfaceC0834Plv(this) { // from class: o.fpz private NdidCommonSelectIdpFragment a; @Override // o.InterfaceC0834Plv public final void d(Object obj) { NdidCommonSelectIdpFragment.d(this.a, (Heg) obj); } { this.a = this; } }); C14957gcv.c(registerForActivityResult, ""); this.h = registerForActivityResult; return inflate; } @Override // androidx.fragment.app.Fragment public final void onViewCreated(View view, Bundle bundle) { C14957gcv.e(view, ""); super.onViewCreated(view, bundle); C6744cbG c6744cbG = this.idpPresenter; final C6744cbG c6744cbG2 = null; if (c6744cbG == null) { C14957gcv.a(""); c6744cbG = null; } c6744cbG.e((C6744cbG) this); Bundle arguments = getArguments(); if (arguments != null) { this.f = (SA) arguments.getParcelable("EXTRA_NDID_DATA"); this.c = (C0982Sz) arguments.getParcelable("EXTRA_IDP_LIST"); } C6744cbG c6744cbG3 = this.idpPresenter; if (c6744cbG3 != null) { c6744cbG2 = c6744cbG3; } else { C14957gcv.a(""); } SA sa = this.f; final C0982Sz c0982Sz = this.c; if (c0982Sz != null) { if (c6744cbG2.b == null) { c6744cbG2.b = c0982Sz; } else { ZI.IeS ieS = new ZI.IeS(c6744cbG2) { // from class: o.cbI private C6744cbG c; @Override // o.ZI.IeS public final void e(Object obj) { C6744cbG.d(this.c, (InterfaceC9502dku.HBt) obj); } { this.c = c6744cbG2; } }; if (c6744cbG2.f != 0) { ieS.e(c6744cbG2.f); } } ZI.IeS ieS2 = new ZI.IeS(c6744cbG2, c0982Sz) { // from class: o.cbJ private C6744cbG d; private C0982Sz e; @Override // o.ZI.IeS public final void e(Object obj) { C6744cbG.e(this.d, this.e, (InterfaceC9502dku.HBt) obj); } { this.d = c6744cbG2; this.e = c0982Sz; } }; if (c6744cbG2.f != 0) { ieS2.e(c6744cbG2.f); } } if (sa != null && C14881gav.b(c6744cbG2.e, sa.c)) { ZI.IeS ieS3 = new ZI.IeS() { // from class: o.cbF @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9502dku.HBt) obj).b(); } }; if (c6744cbG2.f != 0) { ieS3.e(c6744cbG2.f); } } String d2 = c6744cbG2.c.f.c.d(); C14957gcv.c((Object) d2, ""); if (C14957gcv.b((Object) d2, (Object) "NDID")) { ZI.IeS ieS4 = new ZI.IeS() { // from class: o.cbL @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9502dku.HBt) obj).e(); } }; if (c6744cbG2.f != 0) { ieS4.e(c6744cbG2.f); } } v("ndid_common_idp_partner_selection_load"); c("ndid_rp_verifying_partner", new pug("feature", "open_account")); } @Override // o.InterfaceC9502dku.HBt public final void e(List list) { C14957gcv.e(list, ""); CustomSpinnerWithTitle customSpinnerWithTitle = this.idpSpinner; if (customSpinnerWithTitle == null) { C14957gcv.a(""); customSpinnerWithTitle = null; } customSpinnerWithTitle.b(); customSpinnerWithTitle.setItems(list, true, false); customSpinnerWithTitle.setMandatory(true); customSpinnerWithTitle.setOnCustomSpinnerWithTitleCompletion(new IeS(customSpinnerWithTitle, this)); } /* loaded from: classes5.dex */ public static final class IeS implements CustomSpinnerWithTitle.LWm { private CustomSpinnerWithTitle a; private NdidCommonSelectIdpFragment d; @Override // com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle.LWm public final void bn_() { } IeS(CustomSpinnerWithTitle customSpinnerWithTitle, NdidCommonSelectIdpFragment ndidCommonSelectIdpFragment) { this.a = customSpinnerWithTitle; this.d = ndidCommonSelectIdpFragment; } @Override // com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle.LWm public final void bo_() { SA sa; List list; if (((MYp) this.a.c.e()).c.getSelectedItemPosition() <= 0 || (sa = this.d.f) == null || sa.t == null) { return; } NdidCommonSelectIdpFragment ndidCommonSelectIdpFragment = this.d; CustomSpinnerWithTitle customSpinnerWithTitle = this.a; final C6744cbG c6744cbG = ndidCommonSelectIdpFragment.idpPresenter; SB sb = null; if (c6744cbG == null) { C14957gcv.a(""); c6744cbG = null; } int selectedItemPosition = ((MYp) customSpinnerWithTitle.c.e()).c.getSelectedItemPosition() - 1; C0982Sz c0982Sz = c6744cbG.b; if (c0982Sz != null && (list = c0982Sz.a) != null) { sb = list.get(selectedItemPosition); } c6744cbG.d = sb; ZI.IeS ieS = new ZI.IeS(c6744cbG) { // from class: o.cbO private C6744cbG c; @Override // o.ZI.IeS public final void e(Object obj) { C6744cbG.b(this.c, (InterfaceC9502dku.HBt) obj); } { this.c = c6744cbG; } }; if (c6744cbG.f != 0) { ieS.e(c6744cbG.f); } } } @Override // o.InterfaceC9502dku.HBt public final void d(boolean z) { Button button = this.btNext; if (button == null) { C14957gcv.a(""); button = null; } button.setEnabled(z); } @Override // o.InterfaceC9502dku.HBt public final void b(C0979Sw c0979Sw) { Sts sts; if (c0979Sw == null || (sts = this.j) == null) { return; } sts.e(c0979Sw); } @Override // o.InterfaceC9502dku.HBt public final void a(SB sb) { Sts sts; if (sb == null || (sts = this.j) == null) { return; } sts.a(sb); } @Override // o.InterfaceC9502dku.HBt public final void c(String str) { C14957gcv.e(str, ""); c("ndid_common_idp_partner_selection_click", new pug("bank_name", str)); } @Override // o.InterfaceC9502dku.HBt public final void b() { CheckBox checkBox = this.cbConsent; if (checkBox == null) { C14957gcv.a(""); checkBox = null; } checkBox.setText(C3172asW.qI_(getString(R.string.ndid_level_up_idp_select), 0)); } @Override // o.InterfaceC9502dku.HBt public final void e() { CustomSpinnerWithTitle customSpinnerWithTitle = this.idpSpinner; RelativeLayout relativeLayout = null; if (customSpinnerWithTitle == null) { C14957gcv.a(""); customSpinnerWithTitle = null; } customSpinnerWithTitle.setVisibility(8); RelativeLayout relativeLayout2 = this.rlLayoutSpinnerMark; if (relativeLayout2 != null) { relativeLayout = relativeLayout2; } else { C14957gcv.a(""); } relativeLayout.setVisibility(0); } @Override // o.InterfaceC9502dku.HBt public final void a(C0982Sz c0982Sz) { C14957gcv.e(c0982Sz, ""); Context context = getContext(); if (context != null) { huo huoVar = this.h; if (huoVar == null) { C14957gcv.a(""); huoVar = null; } NdidCommonSelectIdpListActivity.HBt hBt = NdidCommonSelectIdpListActivity.l; C14957gcv.e(context, ""); C14957gcv.e(c0982Sz, ""); Intent putExtra = new Intent(context, (Class) NdidCommonSelectIdpListActivity.class).putExtra("EXTRA_IDP_LIST", c0982Sz); C14957gcv.c(putExtra, ""); huoVar.d(putExtra, null); } } @Override // o.InterfaceC9502dku.HBt public final void a(String str) { C14957gcv.e(str, ""); TextView textView = this.tvPlaceholder; TextView textView2 = null; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setVisibility(8); TextView textView3 = this.tvSelectedIdp; if (textView3 != null) { textView2 = textView3; } else { C14957gcv.a(""); } textView2.setText(str); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroy() { C6744cbG c6744cbG = this.idpPresenter; huo huoVar = null; if (c6744cbG == null) { C14957gcv.a(""); c6744cbG = null; } c6744cbG.w_(); this.j = null; huo huoVar2 = this.h; if (huoVar2 == null) { C14957gcv.a(""); } else { huoVar = huoVar2; } huoVar.e(); super.onDestroy(); } @OnClick public final void onNextButtonClick() { v("ndid_common_idp_partner_selection_next"); final C6744cbG c6744cbG = this.idpPresenter; if (c6744cbG == null) { C14957gcv.a(""); c6744cbG = null; } SA sa = this.f; if (sa != null && C14957gcv.b(sa.t, Boolean.TRUE)) { ZI.IeS ieS = new ZI.IeS(c6744cbG) { // from class: o.cbK private C6744cbG c; @Override // o.ZI.IeS public final void e(Object obj) { C6744cbG.c(this.c, (InterfaceC9502dku.HBt) obj); } { this.c = c6744cbG; } }; if (c6744cbG.f != 0) { ieS.e(c6744cbG.f); return; } return; } if (c6744cbG.f != 0) { c6744cbG.f.y(); } SB sb = c6744cbG.d; if (sb != null) { c6744cbG.c.c(new C4269bV(sa != null ? sa.u : null, sb.m, sb.a, sb.g, sb.h, sb.j, sb.f, sb.e, c6744cbG.h), new C6744cbG.IeS(c6744cbG), new C6744cbG.RVV(c6744cbG)); } } @OnClick public final void onClickNavigateToSelectIdpListPage() { final C6744cbG c6744cbG = this.idpPresenter; if (c6744cbG == null) { C14957gcv.a(""); c6744cbG = null; } ZI.IeS ieS = new ZI.IeS(c6744cbG) { // from class: o.cbN private C6744cbG e; @Override // o.ZI.IeS public final void e(Object obj) { C6744cbG.e(this.e, (InterfaceC9502dku.HBt) obj); } { this.e = c6744cbG; } }; if (c6744cbG.f != 0) { ieS.e(c6744cbG.f); } } /* loaded from: classes5.dex */ public static final class HBt { private HBt() { } public /* synthetic */ HBt(byte b) { this(); } } public static /* synthetic */ void d(NdidCommonSelectIdpFragment ndidCommonSelectIdpFragment, Heg heg) { Bundle extras; Bundle extras2; C14957gcv.e(ndidCommonSelectIdpFragment, ""); C14957gcv.e(heg, ""); if (heg.e == -1) { NdidCommonSelectIdpListActivity.HBt hBt = NdidCommonSelectIdpListActivity.l; Intent intent = heg.b; C6744cbG c6744cbG = null; SB sb = (intent == null || (extras2 = intent.getExtras()) == null) ? null : (SB) extras2.getParcelable("EXTRA_SELECTED_IDP"); NdidCommonSelectIdpListActivity.HBt hBt2 = NdidCommonSelectIdpListActivity.l; Intent intent2 = heg.b; C0982Sz c0982Sz = (intent2 == null || (extras = intent2.getExtras()) == null) ? null : (C0982Sz) extras.getParcelable("EXTRA_IDP_LIST_UPDATE"); final C6744cbG c6744cbG2 = ndidCommonSelectIdpFragment.idpPresenter; if (c6744cbG2 == null) { C14957gcv.a(""); c6744cbG2 = null; } c6744cbG2.d = sb; ZI.IeS ieS = new ZI.IeS(c6744cbG2) { // from class: o.cbQ private C6744cbG b; @Override // o.ZI.IeS public final void e(Object obj) { C6744cbG.a(this.b, (InterfaceC9502dku.HBt) obj); } { this.b = c6744cbG2; } }; if (c6744cbG2.f != 0) { ieS.e(c6744cbG2.f); } if (c0982Sz != null) { C6744cbG c6744cbG3 = ndidCommonSelectIdpFragment.idpPresenter; if (c6744cbG3 != null) { c6744cbG = c6744cbG3; } else { C14957gcv.a(""); } C14957gcv.e(c0982Sz, ""); c6744cbG.b = c0982Sz; } } } @OnCheckedChanged public final void onConsentChecked(final boolean z) { SA sa = this.f; if (sa == null || sa.t == null) { return; } final C6744cbG c6744cbG = this.idpPresenter; if (c6744cbG == null) { C14957gcv.a(""); c6744cbG = null; } c6744cbG.a = z; ZI.IeS ieS = new ZI.IeS(z, c6744cbG) { // from class: o.cbM private C6744cbG a; private boolean c; @Override // o.ZI.IeS public final void e(Object obj) { C6744cbG.e(this.c, this.a, (InterfaceC9502dku.HBt) obj); } { this.c = z; this.a = c6744cbG; } }; if (c6744cbG.f != 0) { ieS.e(c6744cbG.f); } } }