package com.scb.phone.view.fragment.prepaid.traveltab; import android.content.Context; import android.content.DialogInterface; import android.graphics.PorterDuff; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.TextView; import androidx.appcompat.widget.SwitchCompat; 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.BaseActivity; import com.scb.phone.view.activity.prepaid.PrepaidDetailsActivity; import com.scb.phone.view.custom.common.CustomDialog; import com.scb.phone.view.fragment.BaseFragment; import com.scb.phone.view.fragment.prepaid.traveltab.PrepaidTravelServicesTabFragment; import java.util.Collections; import java.util.List; import o.AbstractC14961gcz; import o.C1049Un; import o.C14957gcv; import o.C15296gmk; import o.C15873jM; import o.C7724cti; import o.C8979db; import o.C9138de; import o.C9977du; import o.Dwh; import o.InterfaceC12860fJd; import o.InterfaceC13391fZD; import o.InterfaceC13393fZL; import o.InterfaceC14890gbN; import o.InterfaceC9517dlI; import o.Qnw; import o.ZI; import o.fZZ; import o.gjJ; import o.nMh; import o.pqR; /* loaded from: classes5.dex */ public final class PrepaidTravelServicesTabFragment extends Hilt_PrepaidTravelServicesTabFragment implements InterfaceC9517dlI.Sts, PrepaidDetailsActivity.Sts { private final InterfaceC13393fZL c; @BindView public ConstraintLayout csLayoutBlockOnlinePaymentSection; @BindView public ConstraintLayout csLayoutDomesticAndInternationalSection; private C1049Un d; private InterfaceC12860fJd h; @BindView public ImageView ivArrow; @BindView public ImageView ivCardLock; @BindView public ImageView ivReloadBlockOnlinePayment; @BindView public ImageView ivResetCardPin; @InterfaceC13391fZD public C7724cti presenter; @BindView public SwitchCompat toggleCardLock; @BindView public SwitchCompat toggleDomesticLock; @BindView public SwitchCompat toggleInternationalLock; @BindView public TextView tvCardAllowTag; @BindView public TextView tvCardLockTemporary; @BindView public TextView tvResetCardPin; @BindView public TextView tvRetrieveDataError; @BindView public View viewNoData; public PrepaidTravelServicesTabFragment() { IeS ieS = IeS.e; C14957gcv.e(ieS, ""); this.c = new fZZ(ieS); } /* loaded from: classes5.dex */ public static final class RVV { private RVV() { } public /* synthetic */ RVV(byte b) { this(); } } @Override // androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); return layoutInflater.inflate(R.layout.2131559826, viewGroup, false); } @Override // androidx.fragment.app.Fragment public final void onViewCreated(View view, Bundle bundle) { C1049Un c1049Un; C14957gcv.e(view, ""); super.onViewCreated(view, bundle); ((BaseFragment) this).a = ButterKnife.c(this, view); C7724cti c7724cti = this.presenter; C7724cti c7724cti2 = null; if (c7724cti == null) { C14957gcv.a(""); c7724cti = null; } c7724cti.e((C7724cti) this); Bundle arguments = getArguments(); if (arguments == null || (c1049Un = (C1049Un) arguments.getParcelable("ARGS_PREPAID_CARD_DISPLAY")) == null) { return; } C14957gcv.c(c1049Un, ""); this.d = c1049Un; C7724cti c7724cti3 = this.presenter; if (c7724cti3 == null) { C14957gcv.a(""); c7724cti3 = null; } c7724cti3.b(c1049Un.d, c1049Un.a, c1049Un.b, c1049Un.s); C7724cti c7724cti4 = this.presenter; if (c7724cti4 != null) { c7724cti2 = c7724cti4; } else { C14957gcv.a(""); } c7724cti2.c(c1049Un.d); } /* JADX WARN: Multi-variable type inference failed */ @Override // com.scb.phone.view.fragment.prepaid.traveltab.Hilt_PrepaidTravelServicesTabFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment public final void onAttach(Context context) { C14957gcv.e(context, ""); super.onAttach(context); this.h = (InterfaceC12860fJd) context; } @Override // com.scb.phone.view.activity.prepaid.PrepaidDetailsActivity.Sts public final void b(C1049Un c1049Un) { C14957gcv.e(c1049Un, ""); this.d = c1049Un; C7724cti c7724cti = this.presenter; C7724cti c7724cti2 = null; if (c7724cti == null) { C14957gcv.a(""); c7724cti = null; } c7724cti.b(c1049Un.d, c1049Un.a, c1049Un.b, c1049Un.s); C7724cti c7724cti3 = this.presenter; if (c7724cti3 != null) { c7724cti2 = c7724cti3; } else { C14957gcv.a(""); } c7724cti2.c(c1049Un.d); Dwh dwh = (Dwh) this.c.e(); if (getActivity() != null) { dwh.c(((BaseActivity) getActivity()).scbAnalytics, "planetscb_summary_service_screen"); } } @Override // o.InterfaceC9517dlI.Sts public final void j() { k(); } @Override // o.InterfaceC9517dlI.Sts public final void f() { k(); } private final void k() { Context context = getContext(); TextView textView = null; if (context != null) { ImageView imageView = this.ivCardLock; if (imageView == null) { C14957gcv.a(""); imageView = null; } imageView.setColorFilter(nMh.getColor(context, R.color.f3092131099816), PorterDuff.Mode.SRC_IN); TextView textView2 = this.tvCardLockTemporary; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setTextColor(nMh.getColor(context, R.color.f2982131099805)); } SwitchCompat switchCompat = this.toggleCardLock; if (switchCompat == null) { C14957gcv.a(""); switchCompat = null; } switchCompat.setEnabled(true); TextView textView3 = this.tvCardAllowTag; if (textView3 != null) { textView = textView3; } else { C14957gcv.a(""); } textView.setVisibility(8); } @Override // o.InterfaceC9517dlI.Sts public final void h() { Context context = getContext(); TextView textView = null; if (context != null) { ImageView imageView = this.ivCardLock; if (imageView == null) { C14957gcv.a(""); imageView = null; } imageView.setColorFilter(nMh.getColor(context, R.color.f3412131099849), PorterDuff.Mode.SRC_IN); TextView textView2 = this.tvCardLockTemporary; if (textView2 == null) { C14957gcv.a(""); textView2 = null; } textView2.setTextColor(nMh.getColor(context, R.color.f3412131099849)); } SwitchCompat switchCompat = this.toggleCardLock; if (switchCompat == null) { C14957gcv.a(""); switchCompat = null; } switchCompat.setEnabled(false); TextView textView3 = this.tvCardAllowTag; if (textView3 == null) { C14957gcv.a(""); textView3 = null; } textView3.setVisibility(0); TextView textView4 = this.tvCardAllowTag; if (textView4 != null) { textView = textView4; } else { C14957gcv.a(""); } textView.setText(getString(R.string.prepaid_tab_travel_service_lock_card_inactive)); } @Override // o.InterfaceC9517dlI.Sts public final void i() { ConstraintLayout constraintLayout = this.csLayoutBlockOnlinePaymentSection; if (constraintLayout == null) { C14957gcv.a(""); constraintLayout = null; } constraintLayout.setVisibility(0); } @Override // o.InterfaceC9517dlI.Sts public final void b() { ConstraintLayout constraintLayout = this.csLayoutBlockOnlinePaymentSection; if (constraintLayout == null) { C14957gcv.a(""); constraintLayout = null; } constraintLayout.setVisibility(8); } @Override // o.InterfaceC9517dlI.Sts public final void d(boolean z) { SwitchCompat switchCompat = this.toggleDomesticLock; if (switchCompat == null) { C14957gcv.a(""); switchCompat = null; } switchCompat.setChecked(z); } @Override // o.InterfaceC9517dlI.Sts public final void b(boolean z) { SwitchCompat switchCompat = this.toggleInternationalLock; if (switchCompat == null) { C14957gcv.a(""); switchCompat = null; } switchCompat.setChecked(z); } @Override // o.InterfaceC9517dlI.Sts public final void e(String str, String str2) { C14957gcv.e(str, ""); C14957gcv.e(str2, ""); C1049Un c1049Un = this.d; C1049Un c1049Un2 = null; if (c1049Un == null) { C14957gcv.a(""); c1049Un = null; } C14957gcv.e(str, ""); c1049Un.a = str; C1049Un c1049Un3 = this.d; if (c1049Un3 == null) { C14957gcv.a(""); c1049Un3 = null; } C14957gcv.e(str2, ""); c1049Un3.b = str2; C15296gmk b = C15296gmk.b(); C1049Un c1049Un4 = this.d; if (c1049Un4 == null) { C14957gcv.a(""); } else { c1049Un2 = c1049Un4; } b.e(c1049Un2); } @Override // o.InterfaceC9517dlI.Sts public final void a(String str) { C14957gcv.e(str, ""); TextView textView = this.tvRetrieveDataError; View view = null; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setText(str); textView.setVisibility(0); ImageView imageView = this.ivReloadBlockOnlinePayment; if (imageView == null) { C14957gcv.a(""); imageView = null; } imageView.setVisibility(0); View view2 = this.viewNoData; if (view2 != null) { view = view2; } else { C14957gcv.a(""); } view.setVisibility(0); } @Override // o.InterfaceC9517dlI.Sts public final void c() { TextView textView = this.tvRetrieveDataError; View view = null; if (textView == null) { C14957gcv.a(""); textView = null; } textView.setVisibility(8); ImageView imageView = this.ivReloadBlockOnlinePayment; if (imageView == null) { C14957gcv.a(""); imageView = null; } imageView.setVisibility(8); View view2 = this.viewNoData; if (view2 != null) { view = view2; } else { C14957gcv.a(""); } view.setVisibility(8); } @Override // o.InterfaceC9517dlI.Sts public final void g() { ConstraintLayout constraintLayout = this.csLayoutDomesticAndInternationalSection; if (constraintLayout == null) { C14957gcv.a(""); constraintLayout = null; } constraintLayout.setVisibility(0); } @Override // o.InterfaceC9517dlI.Sts public final void d() { ConstraintLayout constraintLayout = this.csLayoutDomesticAndInternationalSection; if (constraintLayout == null) { C14957gcv.a(""); constraintLayout = null; } constraintLayout.setVisibility(8); } @Override // o.InterfaceC9517dlI.Sts public final void e(boolean z) { SwitchCompat switchCompat = this.toggleCardLock; if (switchCompat == null) { C14957gcv.a(""); switchCompat = null; } switchCompat.setChecked(z); } @Override // o.InterfaceC9517dlI.Sts public final void e() { Context context = getContext(); if (context != null) { ImageView imageView = this.ivResetCardPin; TextView textView = null; if (imageView == null) { C14957gcv.a(""); imageView = null; } imageView.setColorFilter(nMh.getColor(context, R.color.f3092131099816), PorterDuff.Mode.SRC_IN); ImageView imageView2 = this.ivArrow; if (imageView2 == null) { C14957gcv.a(""); imageView2 = null; } imageView2.setColorFilter(nMh.getColor(context, R.color.f1852131099685), PorterDuff.Mode.SRC_IN); TextView textView2 = this.tvResetCardPin; if (textView2 != null) { textView = textView2; } else { C14957gcv.a(""); } textView.setTextColor(nMh.getColor(context, R.color.f2982131099805)); } } @Override // o.InterfaceC9517dlI.Sts public final void a() { Context context = getContext(); if (context != null) { ImageView imageView = this.ivResetCardPin; TextView textView = null; if (imageView == null) { C14957gcv.a(""); imageView = null; } imageView.setColorFilter(nMh.getColor(context, R.color.f3412131099849), PorterDuff.Mode.SRC_IN); ImageView imageView2 = this.ivArrow; if (imageView2 == null) { C14957gcv.a(""); imageView2 = null; } imageView2.setColorFilter(nMh.getColor(context, R.color.f3412131099849), PorterDuff.Mode.SRC_IN); TextView textView2 = this.tvResetCardPin; if (textView2 != null) { textView = textView2; } else { C14957gcv.a(""); } textView.setTextColor(nMh.getColor(context, R.color.f3412131099849)); } } @Override // o.InterfaceC9517dlI.Sts public final void b(String str, String str2, String str3, String str4) { C14957gcv.e(str, ""); C14957gcv.e(str2, ""); C14957gcv.e(str3, ""); C14957gcv.e(str4, ""); DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener(this) { // from class: o.ful private PrepaidTravelServicesTabFragment b; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { PrepaidTravelServicesTabFragment.c(this.b); } { this.b = this; } }; CustomDialog b = CustomDialog.b(getContext()); if (gjJ.a(str)) { b.mTitleTextView.setVisibility(0); b.mTitleTextView.setText(str); } if (gjJ.a(str2)) { b.mTextTextView.setVisibility(0); b.mTextTextView.setText(str2); } b.aoU_(str3, onClickListener).aoO_(str4, new DialogInterface.OnClickListener() { // from class: o.fuo @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }).show(); } @Override // o.InterfaceC9517dlI.Sts public final void l() { InterfaceC12860fJd interfaceC12860fJd = this.h; C1049Un c1049Un = null; if (interfaceC12860fJd == null) { C14957gcv.a(""); interfaceC12860fJd = null; } C1049Un c1049Un2 = this.d; if (c1049Un2 == null) { C14957gcv.a(""); } else { c1049Un = c1049Un2; } String str = c1049Un.i; interfaceC12860fJd.j(); } @OnCheckedChanged public final void onCardLockToggleChanged(CompoundButton compoundButton, boolean z) { C14957gcv.e(compoundButton, ""); if (compoundButton.isPressed()) { boolean z2 = !z; compoundButton.setChecked(z2); final C7724cti c7724cti = this.presenter; if (c7724cti == null) { C14957gcv.a(""); c7724cti = null; } c7724cti.c = "TEMP_CARD"; if (z2) { ZI.IeS ieS = new ZI.IeS(c7724cti) { // from class: o.ctu private C7724cti d; @Override // o.ZI.IeS public final void e(Object obj) { C7724cti.h(this.d, (InterfaceC9517dlI.Sts) obj); } { this.d = c7724cti; } }; if (c7724cti.f != 0) { ieS.e(c7724cti.f); return; } return; } ZI.IeS ieS2 = new ZI.IeS(c7724cti) { // from class: o.ctx private C7724cti b; @Override // o.ZI.IeS public final void e(Object obj) { C7724cti.f(this.b, (InterfaceC9517dlI.Sts) obj); } { this.b = c7724cti; } }; if (c7724cti.f != 0) { ieS2.e(c7724cti.f); } } } @OnCheckedChanged public final void onDomesticToggleChanged(CompoundButton compoundButton, boolean z) { C14957gcv.e(compoundButton, ""); if (compoundButton.isPressed()) { boolean z2 = !z; compoundButton.setChecked(z2); final C7724cti c7724cti = this.presenter; if (c7724cti == null) { C14957gcv.a(""); c7724cti = null; } c7724cti.c = "DOMESTIC"; if (z2) { ZI.IeS ieS = new ZI.IeS(c7724cti) { // from class: o.ctp private C7724cti a; @Override // o.ZI.IeS public final void e(Object obj) { C7724cti.o(this.a, (InterfaceC9517dlI.Sts) obj); } { this.a = c7724cti; } }; if (c7724cti.f != 0) { ieS.e(c7724cti.f); return; } return; } ZI.IeS ieS2 = new ZI.IeS(c7724cti) { // from class: o.cts private C7724cti d; @Override // o.ZI.IeS public final void e(Object obj) { C7724cti.m(this.d, (InterfaceC9517dlI.Sts) obj); } { this.d = c7724cti; } }; if (c7724cti.f != 0) { ieS2.e(c7724cti.f); } } } @OnCheckedChanged public final void onInternationalToggleChanged(CompoundButton compoundButton, boolean z) { C14957gcv.e(compoundButton, ""); if (compoundButton.isPressed()) { boolean z2 = !z; compoundButton.setChecked(z2); final C7724cti c7724cti = this.presenter; if (c7724cti == null) { C14957gcv.a(""); c7724cti = null; } c7724cti.c = "INTERNATIONAL"; if (z2) { ZI.IeS ieS = new ZI.IeS(c7724cti) { // from class: o.ctr private C7724cti d; @Override // o.ZI.IeS public final void e(Object obj) { C7724cti.b(new Object[]{this.d, (InterfaceC9517dlI.Sts) obj}, 1230545254, -1230545254, (int) System.currentTimeMillis()); } { this.d = c7724cti; } }; if (c7724cti.f != 0) { ieS.e(c7724cti.f); return; } return; } ZI.IeS ieS2 = new ZI.IeS(c7724cti) { // from class: o.ctq private C7724cti c; @Override // o.ZI.IeS public final void e(Object obj) { C7724cti.k(this.c, (InterfaceC9517dlI.Sts) obj); } { this.c = c7724cti; } }; if (c7724cti.f != 0) { ieS2.e(c7724cti.f); } } } @OnClick public final void onReloadBlockOnlinePaymentClicked() { C7724cti c7724cti = this.presenter; C1049Un c1049Un = null; if (c7724cti == null) { C14957gcv.a(""); c7724cti = null; } C1049Un c1049Un2 = this.d; if (c1049Un2 == null) { C14957gcv.a(""); } else { c1049Un = c1049Un2; } String str = c1049Un.i; C14957gcv.e(str, ""); if (c7724cti.f != 0) { c7724cti.f.y(); } C15873jM c15873jM = c7724cti.e; C7724cti.LWm lWm = new C7724cti.LWm(c7724cti); C7724cti.RVV rvv = new C7724cti.RVV(c7724cti); List singletonList = Collections.singletonList(new C8979db(str)); C14957gcv.c(singletonList, ""); C9138de c9138de = new C9138de(singletonList); C14957gcv.e(lWm, ""); C14957gcv.e(rvv, ""); C14957gcv.e(c9138de, ""); c15873jM.b(c15873jM.b, lWm, rvv, new Qnw.RVV(c9138de)); } @OnClick public final void navigateToResetPin() { C1049Un c1049Un = this.d; InterfaceC12860fJd interfaceC12860fJd = null; if (c1049Un == null) { C14957gcv.a(""); c1049Un = null; } if (c1049Un.d.contains("RESET_PIN")) { Dwh dwh = (Dwh) this.c.e(); if (getActivity() != null) { dwh.c(((BaseActivity) getActivity()).scbAnalytics, "planetscb_prepaid_resetpin"); } InterfaceC12860fJd interfaceC12860fJd2 = this.h; if (interfaceC12860fJd2 == null) { C14957gcv.a(""); } else { interfaceC12860fJd = interfaceC12860fJd2; } interfaceC12860fJd.h(); } } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroyView() { C7724cti c7724cti = this.presenter; if (c7724cti == null) { C14957gcv.a(""); c7724cti = null; } c7724cti.w_(); super.onDestroyView(); } /* loaded from: classes5.dex */ static final class IeS extends AbstractC14961gcz implements InterfaceC14890gbN { public static final IeS e = new IeS(); @Override // o.InterfaceC14890gbN public final /* synthetic */ Dwh invoke() { return new Dwh(); } IeS() { super(0); } } public static /* synthetic */ void c(PrepaidTravelServicesTabFragment prepaidTravelServicesTabFragment) { String str; String str2; String e; String e2; String str3; C14957gcv.e(prepaidTravelServicesTabFragment, ""); C7724cti c7724cti = prepaidTravelServicesTabFragment.presenter; String str4 = null; if (c7724cti == null) { C14957gcv.a(""); c7724cti = null; } C1049Un c1049Un = prepaidTravelServicesTabFragment.d; if (c1049Un == null) { C14957gcv.a(""); c1049Un = null; } String str5 = c1049Un.i; C14957gcv.e(str5, ""); if (c7724cti.f != 0) { c7724cti.f.y(); } C15873jM c15873jM = c7724cti.e; C7724cti.Sts sts = new C7724cti.Sts(c7724cti); C7724cti.HBt hBt = new C7724cti.HBt(c7724cti); String str6 = c7724cti.c; if (C14957gcv.b((Object) str6, (Object) "DOMESTIC")) { e = C7724cti.e(!c7724cti.d); e2 = C7724cti.e(c7724cti.b); str3 = "ONSHORE"; } else if (C14957gcv.b((Object) str6, (Object) "INTERNATIONAL")) { e = C7724cti.e(c7724cti.d); e2 = C7724cti.e(!c7724cti.b); str3 = "OFFSHORE"; } else { str = null; str2 = null; C9977du c9977du = new C9977du(str5, str4, str2, str); C14957gcv.e(sts, ""); C14957gcv.e(hBt, ""); C14957gcv.e(c9977du, ""); c15873jM.b(c15873jM.e, sts, hBt, new pqR.RVV(c9977du)); } String str7 = str3; str2 = e2; str4 = e; str = str7; C9977du c9977du2 = new C9977du(str5, str4, str2, str); C14957gcv.e(sts, ""); C14957gcv.e(hBt, ""); C14957gcv.e(c9977du2, ""); c15873jM.b(c15873jM.e, sts, hBt, new pqR.RVV(c9977du2)); } public static final PrepaidTravelServicesTabFragment d(C1049Un c1049Un) { C14957gcv.e(c1049Un, ""); PrepaidTravelServicesTabFragment prepaidTravelServicesTabFragment = new PrepaidTravelServicesTabFragment(); Bundle bundle = new Bundle(); bundle.putParcelable("ARGS_PREPAID_CARD_DISPLAY", c1049Un); prepaidTravelServicesTabFragment.setArguments(bundle); return prepaidTravelServicesTabFragment; } static { new RVV((byte) 0); } }