package com.scb.phone.view.fragment.common; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Parcelable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.fragment.app.FragmentActivity; import butterknife.OnClick; import com.huawei.hms.support.feature.result.CommonConstant; import com.scb.phone.R; import com.scb.phone.view.activity.BaseActivity; import com.scb.phone.view.activity.HomeActivity; import com.scb.phone.view.fragment.PurchaseSuccessFragment; import com.scb.phone.view.fragment.common.ThirdPartySlipFragment; import java.util.Calendar; import java.util.List; import java.util.concurrent.Callable; import o.AbstractC13163fSk; import o.AbstractC14961gcz; import o.C0523Iq; import o.C13417fZt; import o.C14847gZv; import o.C14866gag; import o.C14957gcv; import o.C15646hS; import o.C15647hT; import o.C3533azO; import o.C3536azR; import o.EO; import o.EW; import o.EnumC1276Zl; import o.InterfaceC13391fZD; import o.InterfaceC14894gbR; import o.InterfaceC9007dbb; import o.QI; import o.QJy; import o.ZI; import o.eXH; import o.fKY; import o.fRR; import o.fSQ; import o.kqm; /* loaded from: classes5.dex */ public final class ThirdPartySlipFragment extends Hilt_ThirdPartySlipFragment implements InterfaceC9007dbb { public static final LWm d = new LWm(0); private EW f; private Bitmap g; private Throwable h; @InterfaceC13391fZD public C3533azO successPresenter; @Override // com.scb.phone.view.fragment.PurchaseSuccessFragment, com.scb.phone.view.fragment.ScreenShotFragment public final /* synthetic */ void d(EO eo, boolean z, boolean z2) { EW ew = (EW) eo; C3533azO c3533azO = this.successPresenter; if (c3533azO == null) { C14957gcv.a(""); c3533azO = null; } C3536azR c3536azR = new C3536azR(c3533azO, z, ew, z2); if (c3533azO.f != 0) { c3536azR.e(c3533azO.f); } } /* loaded from: classes5.dex */ public static final class LWm { private LWm() { } public /* synthetic */ LWm(byte b) { this(); } } @Override // com.scb.phone.view.fragment.PurchaseSuccessFragment, androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); C3533azO c3533azO = this.successPresenter; if (c3533azO == null) { C14957gcv.a(""); c3533azO = null; } c3533azO.e((C3533azO) this); l(); return super.onCreateView(layoutInflater, viewGroup, bundle); } /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Type inference failed for: r12v7, types: [android.os.Parcelable] */ @Override // androidx.fragment.app.Fragment public final void onViewCreated(View view, Bundle bundle) { C0523Iq c0523Iq; C14957gcv.e(view, ""); super.onViewCreated(view, bundle); Bundle arguments = getArguments(); if (arguments == null || !arguments.containsKey("KEY_THIRD_PARTY_SLIP_DISPLAY_ID")) { return; } C3533azO c3533azO = this.successPresenter; if (c3533azO == null) { C14957gcv.a(""); c3533azO = null; } Bundle arguments2 = getArguments(); if (arguments2 != null) { if (Build.VERSION.SDK_INT >= 33) { c0523Iq = (Parcelable) arguments2.getParcelable("KEY_THIRD_PARTY_SLIP_DISPLAY_ID", C0523Iq.class); } else { ?? parcelable = arguments2.getParcelable("KEY_THIRD_PARTY_SLIP_DISPLAY_ID"); c0523Iq = parcelable instanceof C0523Iq ? parcelable : null; } r1 = (C0523Iq) c0523Iq; } c3533azO.a = r1; if (r1 != null) { ZI.IeS ieS = new ZI.IeS() { // from class: o.azP @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9007dbb) obj).y(); } }; if (c3533azO.f != null) { ieS.e(c3533azO.f); } if (r1.e != QJy.DISPLAY) { C15647hT c15647hT = c3533azO.c; String str = r1.d; QJy qJy = r1.e; C3533azO.HBt hBt = new C3533azO.HBt(c3533azO); C3533azO.LWm lWm = new C3533azO.LWm(c3533azO); C14957gcv.e(str, ""); C14957gcv.e(qJy, ""); C14957gcv.e(hBt, ""); C14957gcv.e(lWm, ""); c15647hT.d.e(hBt, lWm, new C14847gZv.LWm(str, qJy), new C15647hT.Sts(c15647hT), c15647hT.a); return; } C15646hS c15646hS = c3533azO.e; String str2 = r1.d; C3533azO.IeS ieS2 = new C3533azO.IeS(c3533azO); C3533azO.Sts sts = new C3533azO.Sts(c3533azO); C14957gcv.e(str2, ""); C14957gcv.e(ieS2, ""); C14957gcv.e(sts, ""); c15646hS.b.e(ieS2, sts, new kqm.LWm(str2), new C15646hS.Sts(c15646hS), c15646hS.a); return; } ZI.IeS ieS3 = new ZI.IeS() { // from class: o.azQ @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9007dbb) obj).aK_(); } }; if (c3533azO.f != null) { ieS3.e(c3533azO.f); } } @Override // com.scb.phone.view.fragment.PurchaseSuccessFragment, o.cYH public final void d(EW ew) { C14957gcv.e(ew, ""); this.f = ew; C3533azO c3533azO = null; this.presenter.e(ew, (List) null); String string = getString(R.string.return_to_account_summary); C14957gcv.c((Object) string, ""); C14957gcv.e(string, ""); this.buttonReturn.setText(string); C3533azO c3533azO2 = this.successPresenter; if (c3533azO2 != null) { c3533azO = c3533azO2; } else { C14957gcv.a(""); } c3533azO.d(ew); } @Override // o.InterfaceC9007dbb public final void a(EW ew, int i) { C14957gcv.e(ew, ""); final PurchaseSuccessFragment.HBt hBt = new PurchaseSuccessFragment.HBt(this.themesSlipPresenter); PurchaseSuccessFragment.PurchaseScreenshotDisplay purchaseScreenshotDisplay = new PurchaseSuccessFragment.PurchaseScreenshotDisplay(i, ew.d(String.valueOf(Calendar.getInstance().getTimeInMillis())), ew, false, this.componentFactory, true); purchaseScreenshotDisplay.c = true; C14866gag c14866gag = C14866gag.c; final PurchaseSuccessFragment.PurchaseScreenshotDisplay purchaseScreenshotDisplay2 = purchaseScreenshotDisplay; final Context context = getContext(); AbstractC13163fSk subscribeOn = AbstractC13163fSk.fromCallable(new Callable(hBt, purchaseScreenshotDisplay2, context) { // from class: o.fKP private Context a; private fKR b; private EZ e; @Override // java.util.concurrent.Callable public final Object call() { return this.b.aAm_(this.e, this.a); } { this.b = hBt; this.e = purchaseScreenshotDisplay2; this.a = context; } }).observeOn(fRR.e()).subscribeOn(C13417fZt.b()); final IeS ieS = new IeS(this); fSQ fsq = new fSQ(ieS) { // from class: o.eNO private InterfaceC14894gbR c; @Override // o.fSQ public final void c(Object obj) { ThirdPartySlipFragment.e(this.c, obj); } { this.c = ieS; } }; final RVV rvv = new RVV(this); ((PurchaseSuccessFragment) this).c = subscribeOn.subscribe(fsq, new fSQ(rvv) { // from class: o.eNR private InterfaceC14894gbR e; @Override // o.fSQ public final void c(Object obj) { ThirdPartySlipFragment.b(this.e, obj); } { this.e = rvv; } }); } /* loaded from: classes5.dex */ static final class IeS extends AbstractC14961gcz implements InterfaceC14894gbR { private ThirdPartySlipFragment b; @Override // o.InterfaceC14894gbR public final /* synthetic */ C14866gag invoke(Bitmap bitmap) { this.b.g = bitmap; return C14866gag.c; } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ IeS(ThirdPartySlipFragment thirdPartySlipFragment) { super(1); this.b = thirdPartySlipFragment; } } /* loaded from: classes5.dex */ static final class RVV extends AbstractC14961gcz implements InterfaceC14894gbR { private ThirdPartySlipFragment c; @Override // o.InterfaceC14894gbR public final /* synthetic */ C14866gag invoke(Throwable th) { this.c.h = th; return C14866gag.c; } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ RVV(ThirdPartySlipFragment thirdPartySlipFragment) { super(1); this.c = thirdPartySlipFragment; } } @Override // com.scb.phone.view.fragment.PurchaseSuccessFragment, o.cYH public final void d(EW ew, boolean z, boolean z2) { C3533azO c3533azO = this.successPresenter; if (c3533azO == null) { C14957gcv.a(""); c3533azO = null; } C3536azR c3536azR = new C3536azR(c3533azO, z, ew, z2); if (c3533azO.f != 0) { c3536azR.e(c3533azO.f); } } @Override // o.InterfaceC9007dbb public final void arp_(final Bitmap bitmap, EW ew, boolean z) { C14957gcv.e(bitmap, ""); new PurchaseSuccessFragment.HBt(this.themesSlipPresenter); PurchaseSuccessFragment.PurchaseScreenshotDisplay purchaseScreenshotDisplay = new PurchaseSuccessFragment.PurchaseScreenshotDisplay(m(), ew.d(String.valueOf(Calendar.getInstance().getTimeInMillis())), ew, false, this.componentFactory, true); purchaseScreenshotDisplay.c = true; C14866gag c14866gag = C14866gag.c; final PurchaseSuccessFragment.PurchaseScreenshotDisplay purchaseScreenshotDisplay2 = purchaseScreenshotDisplay; final Context context = getContext(); AbstractC13163fSk subscribeOn = AbstractC13163fSk.fromCallable(new Callable(bitmap, purchaseScreenshotDisplay2, context) { // from class: o.fKO private Context c; private EZ d; private Bitmap e; @Override // java.util.concurrent.Callable public final Object call() { return fKR.aAn_(this.e, this.d, this.c); } { this.e = bitmap; this.d = purchaseScreenshotDisplay2; this.c = context; } }).observeOn(fRR.e()).subscribeOn(C13417fZt.b()); final HBt hBt = new HBt(this, z); fSQ fsq = new fSQ(hBt) { // from class: o.eNQ private InterfaceC14894gbR e; @Override // o.fSQ public final void c(Object obj) { ThirdPartySlipFragment.a(this.e, obj); } { this.e = hBt; } }; final saX sax = new saX(this); ((PurchaseSuccessFragment) this).c = subscribeOn.subscribe(fsq, new fSQ(sax) { // from class: o.eNN private InterfaceC14894gbR e; @Override // o.fSQ public final void c(Object obj) { ThirdPartySlipFragment.h(this.e, obj); } { this.e = sax; } }); } /* loaded from: classes5.dex */ static final class HBt extends AbstractC14961gcz implements InterfaceC14894gbR { private ThirdPartySlipFragment a; private boolean c; @Override // o.InterfaceC14894gbR public final /* synthetic */ C14866gag invoke(Uri uri) { this.a.b(uri.toString(), this.c); Bitmap bitmap = this.a.g; if (bitmap != null) { bitmap.recycle(); } C3533azO c3533azO = this.a.successPresenter; if (c3533azO == null) { C14957gcv.a(""); c3533azO = null; } c3533azO.d(this.a.f); return C14866gag.c; } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ HBt(ThirdPartySlipFragment thirdPartySlipFragment, boolean z) { super(1); this.a = thirdPartySlipFragment; this.c = z; } } /* loaded from: classes5.dex */ static final class saX extends AbstractC14961gcz implements InterfaceC14894gbR { private ThirdPartySlipFragment a; @Override // o.InterfaceC14894gbR public final /* synthetic */ C14866gag invoke(Throwable th) { this.a.o(); return C14866gag.c; } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ saX(ThirdPartySlipFragment thirdPartySlipFragment) { super(1); this.a = thirdPartySlipFragment; } } @Override // o.InterfaceC9007dbb public final void b(Throwable th) { C14957gcv.e(th, ""); o(); } @Override // o.InterfaceC9007dbb public final void e(final EW ew, final boolean z, final boolean z2) { C3533azO c3533azO = this.successPresenter; if (c3533azO == null) { C14957gcv.a(""); c3533azO = null; } final Bitmap bitmap = this.g; final Throwable th = this.h; if (bitmap != null) { ZI.IeS ieS = new ZI.IeS(bitmap, ew, z, z2) { // from class: o.azT private EW b; private Bitmap c; private boolean d; private boolean e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9007dbb) obj).arp_(this.c, this.b, this.e); } { this.c = bitmap; this.b = ew; this.e = z; this.d = z2; } }; if (c3533azO.f != 0) { ieS.e(c3533azO.f); return; } return; } if (th != null) { ZI.IeS ieS2 = new ZI.IeS(th) { // from class: o.azY private Throwable e; @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9007dbb) obj).b(this.e); } { this.e = th; } }; if (c3533azO.f != 0) { ieS2.e(c3533azO.f); } } } @Override // o.InterfaceC9007dbb public final void c(String str, String str2) { C14957gcv.e(str, ""); C14957gcv.e(str2, ""); eXH exh = new eXH(); exh.d("source", str); exh.d("product", "debenture"); exh.d(CommonConstant.KEY_STATUS, str2); eXH exh2 = exh; if (getActivity() != null) { exh2.c(((BaseActivity) getActivity()).scbAnalytics, "renderslip_status"); } } @Override // o.InterfaceC9007dbb public final void c(EW ew, boolean z, boolean z2) { if (ew != null) { EnumC1276Zl enumC1276Zl = ew.n; if (enumC1276Zl == null) { enumC1276Zl = EnumC1276Zl.DEFAULT; } int i = Sts.e[enumC1276Zl.ordinal()] == 1 ? R.layout.2131560126 : R.layout.2131560122; PurchaseSuccessFragment.HBt hBt = new PurchaseSuccessFragment.HBt(this.themesSlipPresenter); PurchaseSuccessFragment.PurchaseScreenshotDisplay purchaseScreenshotDisplay = new PurchaseSuccessFragment.PurchaseScreenshotDisplay(i, ew.d(String.valueOf(Calendar.getInstance().getTimeInMillis())), ew, z, this.componentFactory, z2); purchaseScreenshotDisplay.c = true; C14866gag c14866gag = C14866gag.c; AbstractC13163fSk subscribeOn = AbstractC13163fSk.fromCallable(new fKY(hBt, purchaseScreenshotDisplay, getContext())).observeOn(fRR.e()).subscribeOn(C13417fZt.b()); final ZqN zqN = new ZqN(this, z); fSQ fsq = new fSQ(zqN) { // from class: o.eNM private InterfaceC14894gbR a; @Override // o.fSQ public final void c(Object obj) { ThirdPartySlipFragment.d(this.a, obj); } { this.a = zqN; } }; final jbe jbeVar = new jbe(this); ((PurchaseSuccessFragment) this).c = subscribeOn.subscribe(fsq, new fSQ(jbeVar) { // from class: o.eNL private InterfaceC14894gbR d; @Override // o.fSQ public final void c(Object obj) { ThirdPartySlipFragment.c(this.d, obj); } { this.d = jbeVar; } }); } } /* loaded from: classes5.dex */ static final class ZqN extends AbstractC14961gcz implements InterfaceC14894gbR { private ThirdPartySlipFragment b; private boolean e; @Override // o.InterfaceC14894gbR public final /* synthetic */ C14866gag invoke(Uri uri) { this.b.b(uri.toString(), this.e); return C14866gag.c; } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ ZqN(ThirdPartySlipFragment thirdPartySlipFragment, boolean z) { super(1); this.b = thirdPartySlipFragment; this.e = z; } } /* loaded from: classes5.dex */ static final class jbe extends AbstractC14961gcz implements InterfaceC14894gbR { private ThirdPartySlipFragment b; @Override // o.InterfaceC14894gbR public final /* synthetic */ C14866gag invoke(Throwable th) { this.b.o(); return C14866gag.c; } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ jbe(ThirdPartySlipFragment thirdPartySlipFragment) { super(1); this.b = thirdPartySlipFragment; } } @Override // o.cYH public final void aK_() { FragmentActivity activity = getActivity(); if (activity != null) { Intent intent = new Intent(activity, (Class) HomeActivity.class); intent.addFlags(603979776); intent.putExtra("com.scb.phone.EXTRA_NEW_INSTANCE_LAYOUT", R.id.landing_page_tab); startActivity(intent); activity.finish(); } } @OnClick public final void onClickReturnButton() { HomeActivity.c(getContext(), true); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroyView() { C3533azO c3533azO = this.successPresenter; if (c3533azO == null) { C14957gcv.a(""); c3533azO = null; } c3533azO.w_(); super.onDestroyView(); } public static /* synthetic */ void d(InterfaceC14894gbR interfaceC14894gbR, Object obj) { C14957gcv.e(interfaceC14894gbR, ""); interfaceC14894gbR.invoke(obj); } public static /* synthetic */ void b(InterfaceC14894gbR interfaceC14894gbR, Object obj) { C14957gcv.e(interfaceC14894gbR, ""); interfaceC14894gbR.invoke(obj); } public static /* synthetic */ void e(InterfaceC14894gbR interfaceC14894gbR, Object obj) { C14957gcv.e(interfaceC14894gbR, ""); interfaceC14894gbR.invoke(obj); } public static /* synthetic */ void c(InterfaceC14894gbR interfaceC14894gbR, Object obj) { C14957gcv.e(interfaceC14894gbR, ""); interfaceC14894gbR.invoke(obj); } public static /* synthetic */ void a(InterfaceC14894gbR interfaceC14894gbR, Object obj) { C14957gcv.e(interfaceC14894gbR, ""); interfaceC14894gbR.invoke(obj); } public static /* synthetic */ void h(InterfaceC14894gbR interfaceC14894gbR, Object obj) { C14957gcv.e(interfaceC14894gbR, ""); interfaceC14894gbR.invoke(obj); } /* loaded from: classes5.dex */ public final /* synthetic */ class Sts { public static final int[] e; static { int[] iArr = new int[EnumC1276Zl.values().length]; try { iArr[EnumC1276Zl.REGEN_SLIP.ordinal()] = 1; } catch (NoSuchFieldError unused) { } e = iArr; } } }