package com.scb.phone.view.fragment.ntb.fatca; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.appcompat.widget.AppCompatButton; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.domain.interactor.FatcaQuestionnaireCase; import com.scb.phone.view.activity.BaseActivity; import com.scb.phone.view.activity.ntb.fatca.FatcaErrorActivity; import com.scb.phone.view.activity.ntb.fatca.FatcaHelpActivity; import com.scb.phone.view.adapter.deposit.FatcaQuestionnaireAdapter; import com.scb.phone.view.custom.common.CustomDialog; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.ntb.fatca.FatcaQuestionnaireFragment; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import o.C10383eCj; import o.C13396fZU; import o.C14866gag; import o.C14957gcv; import o.C15716hvG; import o.C16071kt; import o.C16552pK; import o.C7426co; import o.C7583cr; import o.HTL; import o.InterfaceC12818fIA; import o.InterfaceC13391fZD; import o.InterfaceC14894gbR; import o.InterfaceC8954dab; import o.MF; import o.Mjl; import o.QKH; import o.ZI; import o.aOA; import o.cYP; import o.hPo; import o.pug; import o.zMZ; /* loaded from: classes5.dex */ public class FatcaQuestionnaireFragment extends Hilt_FatcaQuestionnaireFragment implements cYP.HBt, FatcaQuestionnaireAdapter.RVV, FatcaQuestionnaireAdapter.LWm { private int c; private FatcaQuestionnaireAdapter d; private InterfaceC12818fIA f; @InterfaceC13391fZD public aOA fatcaQuestionPresenter; private InterfaceC8954dab.jbe h; private QKH i = new QKH(); @BindView RecyclerView questionRecyclerView; @BindView AppCompatButton submitButton; public static FatcaQuestionnaireFragment c(List list, int i) { Bundle bundle = new Bundle(); bundle.putParcelableArrayList("BUNDLE_FATCA_QUESTIONNAIRE_LIST", (ArrayList) list); bundle.putInt("BUNDLE_FATCA_TYPE", i); FatcaQuestionnaireFragment fatcaQuestionnaireFragment = new FatcaQuestionnaireFragment(); fatcaQuestionnaireFragment.setArguments(bundle); return fatcaQuestionnaireFragment; } /* JADX WARN: Multi-variable type inference failed */ @Override // com.scb.phone.view.fragment.ntb.fatca.Hilt_FatcaQuestionnaireFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment public void onAttach(Context context) { super.onAttach(context); if (context instanceof InterfaceC12818fIA) { this.f = (InterfaceC12818fIA) context; } if (context instanceof InterfaceC8954dab.jbe) { this.h = (InterfaceC8954dab.jbe) context; } } @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559650, viewGroup, false); ((BaseFragment) this).a = ButterKnife.c(this, inflate); this.fatcaQuestionPresenter.e((aOA) this); if (getArguments() != null) { final ArrayList parcelableArrayList = getArguments().getParcelableArrayList("BUNDLE_FATCA_QUESTIONNAIRE_LIST"); int i = getArguments().getInt("BUNDLE_FATCA_TYPE"); this.c = i; aOA aoa = this.fatcaQuestionPresenter; aoa.c = i; if (i == 1 || i == 2 || i == 3 || i == 5) { zMZ zmz = aoa.a; String name = HTL.SINGLE_FROM_OPEN_ACCOUNT.name(); C14957gcv.e(name, ""); zmz.d.e(name); } aOA aoa2 = this.fatcaQuestionPresenter; if (parcelableArrayList != null) { aoa2.b = parcelableArrayList; ZI.IeS ieS = new ZI.IeS(parcelableArrayList) { // from class: o.aOz private List d; @Override // o.ZI.IeS public final void e(Object obj) { ((cYP.HBt) obj).b(this.d); } { this.d = parcelableArrayList; } }; if (aoa2.f != 0) { ieS.e(aoa2.f); } } } this.submitButton.setEnabled(false); int i2 = this.c; if (i2 != 0) { if (i2 == 1) { v("mfonboard_answerfatca"); } else if (i2 == 2) { this.i.e("etb"); } else if (i2 == 3) { c("scbsonboard_answerfatca", new pug("source", "scbs")); } else if (i2 == 4) { this.i.e("your_loan"); } else if (i2 == 5) { C15716hvG.RVV rvv = C15716hvG.d; C15716hvG c15716hvG = new C15716hvG(); c15716hvG.d("source", "investment"); g(new C13396fZU("investment_onboard_answerfatca", c15716hvG)); } return inflate; } InterfaceC8954dab.jbe jbeVar = this.h; String e = jbeVar != null ? jbeVar.e() : "ekyc"; QKH qkh = this.i; String e2 = this.fatcaQuestionPresenter.a.d.e(); qkh.d("source", e); if ("touchpoint".equals(e)) { qkh.d("customer_group", e2); } QKH qkh2 = this.i; if (getActivity() != null) { qkh2.c(((BaseActivity) getActivity()).scbAnalytics, "ekyc_answerfatca"); } return inflate; } @Override // com.scb.phone.view.adapter.deposit.FatcaQuestionnaireAdapter.RVV public final void d(int i, String str) { int i2 = this.c; if (i2 == 0) { a(i, "scbs"); } else if (i2 == 4) { a(i, "your_loan"); } startActivity(FatcaHelpActivity.ajA_(getContext(), str)); } private void a(int i, String str) { this.i.e(str); if (i == 0) { QKH qkh = this.i; if (getActivity() != null) { qkh.c(((BaseActivity) getActivity()).scbAnalytics, "ekyc_fatca1moreinfo"); return; } return; } if (i == 1) { QKH qkh2 = this.i; if (getActivity() != null) { qkh2.c(((BaseActivity) getActivity()).scbAnalytics, "ekyc_fatca2moreinfo"); return; } return; } if (i == 2) { QKH qkh3 = this.i; if (getActivity() != null) { qkh3.c(((BaseActivity) getActivity()).scbAnalytics, "ekyc_fatca3moreinfo"); } } } @Override // o.cYP.HBt public final void a() { InterfaceC12818fIA interfaceC12818fIA = this.f; if (interfaceC12818fIA != null) { interfaceC12818fIA.h(); } } @Override // o.cYP.HBt public final void d() { if (getActivity() != null) { Intent intent = new Intent(new Intent(getContext(), (Class) FatcaErrorActivity.class)); intent.putExtra("EXTRA_TITLE", R.string.fatca_error_open_account_title); intent.putExtra("EXTRA_FATCA_TYPE", this.c); startActivity(intent); getActivity().finish(); } } @Override // com.scb.phone.view.adapter.deposit.FatcaQuestionnaireAdapter.LWm public final void c(boolean z) { this.submitButton.setEnabled(z); } @OnClick public void onSubmitButtonClick() { ((CustomDialog) CustomDialog.e(new Object[]{CustomDialog.b(getContext()).c(R.string.fatca_answer_confirm_title).d(R.string.fatca_answer_confirm_message), Integer.valueOf(R.string.cancel), new DialogInterface.OnClickListener() { // from class: o.fqw @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }})).aoT_(R.string.ok, new DialogInterface.OnClickListener(this) { // from class: o.fqv private FatcaQuestionnaireFragment e; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { FatcaQuestionnaireFragment.awj_(this.e, dialogInterface); } { this.e = this; } }).show(); int i = this.c; if (i == 0) { c("ekyc_confirmfatca", this.h.e()); } else if (i == 4) { c("ekyc_confirmfatca", "your_loan"); } } private void c(String str, String str2) { this.i.c(); if (str2 != null) { QKH qkh = this.i; String e = this.fatcaQuestionPresenter.a.d.e(); qkh.d("source", str2); if ("touchpoint".equals(str2)) { qkh.d("customer_group", e); } } QKH qkh2 = this.i; if (getActivity() != null) { qkh2.c(((BaseActivity) getActivity()).scbAnalytics, str); } } public static /* synthetic */ void awj_(FatcaQuestionnaireFragment fatcaQuestionnaireFragment, DialogInterface dialogInterface) { int i = fatcaQuestionnaireFragment.c; byte b = 0; if (i == 0) { fatcaQuestionnaireFragment.c("ekyc_fatcaconfirmed", fatcaQuestionnaireFragment.h.e()); } else if (i == 1) { fatcaQuestionnaireFragment.v("mfonboard_fatcaconfirmed"); } else if (i == 3) { fatcaQuestionnaireFragment.c("scbsonboard_fatcaconfirmed", new pug("source", "scbs")); } else if (i == 4) { fatcaQuestionnaireFragment.c("ekyc_fatcaconfirmed", "your_loan"); } else if (i == 5) { C15716hvG.RVV rvv = C15716hvG.d; C15716hvG c15716hvG = new C15716hvG(); c15716hvG.d("source", "investment"); fatcaQuestionnaireFragment.g(new C13396fZU("investment_onboard_fatcaconfirmed", c15716hvG)); } final aOA aoa = fatcaQuestionnaireFragment.fatcaQuestionPresenter; HashMap hashMap = fatcaQuestionnaireFragment.d.c; if (aoa.f != 0) { aoa.f.y(); } int i2 = aoa.c; if (i2 == 0) { C16552pK c16552pK = aoa.d; C7583cr b2 = C16552pK.b(aoa.b, hashMap); C7426co e = C7426co.e(); e.g = b2; aoa.e.d(e); FatcaQuestionnaireCase fatcaQuestionnaireCase = aoa.e; fatcaQuestionnaireCase.d(fatcaQuestionnaireCase.i, new aOA.Sts(aoa, b)); } else if (i2 == 1) { C16552pK c16552pK2 = aoa.d; aoa.e.c(C16552pK.b(aoa.b, hashMap)); FatcaQuestionnaireCase fatcaQuestionnaireCase2 = aoa.e; fatcaQuestionnaireCase2.d(fatcaQuestionnaireCase2.i, new aOA.Sts(aoa, b)); } else if (i2 == 2) { C16552pK c16552pK3 = aoa.d; aoa.e.e(C16552pK.b(aoa.b, hashMap)); FatcaQuestionnaireCase fatcaQuestionnaireCase3 = aoa.e; fatcaQuestionnaireCase3.d(fatcaQuestionnaireCase3.i, new aOA.Sts(aoa, b)); } else if (i2 == 3) { C16552pK c16552pK4 = aoa.d; aoa.g.e(C16552pK.b(aoa.b, hashMap)); Mjl mjl = aoa.g; mjl.d(mjl.i, new aOA.Sts(aoa, b)); } else if (i2 == 4) { C16552pK c16552pK5 = aoa.d; C7583cr b3 = C16552pK.b(aoa.b, hashMap); C7426co e2 = C7426co.e(); e2.g = b3; aoa.e.b(e2); FatcaQuestionnaireCase fatcaQuestionnaireCase4 = aoa.e; fatcaQuestionnaireCase4.d(fatcaQuestionnaireCase4.i, new aOA.Sts(aoa, b)); } else if (i2 == 5) { C16552pK c16552pK6 = aoa.d; C7583cr b4 = C16552pK.b(aoa.b, hashMap); C16071kt c16071kt = aoa.i; InterfaceC14894gbR interfaceC14894gbR = new InterfaceC14894gbR(aoa) { // from class: o.aOw private aOA b; @Override // o.InterfaceC14894gbR public final Object invoke(Object obj) { return aOA.d(this.b); } { this.b = aoa; } }; InterfaceC14894gbR interfaceC14894gbR2 = new InterfaceC14894gbR(aoa) { // from class: o.aOF private aOA d; @Override // o.InterfaceC14894gbR public final Object invoke(Object obj) { return aOA.c(this.d, (Throwable) obj); } { this.d = aoa; } }; C14957gcv.e(interfaceC14894gbR, ""); C14957gcv.e(interfaceC14894gbR2, ""); C14957gcv.e(b4, ""); c16071kt.b(c16071kt.d, interfaceC14894gbR, interfaceC14894gbR2, new hPo.Sts(b4)); } dialogInterface.dismiss(); } @Override // o.cYP.HBt public final void b(List list) { this.d = new FatcaQuestionnaireAdapter(list, this, this); RecyclerView recyclerView = this.questionRecyclerView; getContext(); recyclerView.setLayoutManager(new LinearLayoutManager(1, false)); this.questionRecyclerView.d(new C10383eCj(), -1); this.questionRecyclerView.setAdapter(this.d); this.questionRecyclerView.setNestedScrollingEnabled(false); } }