package com.linecorp.line.pay.impl.tw.biz.main; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.webkit.URLUtil; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import androidx.activity.ComponentActivity; import androidx.databinding.ViewDataBinding; import androidx.lifecycle.d1; import androidx.lifecycle.e0; import androidx.lifecycle.e1; import androidx.lifecycle.f1; import androidx.lifecycle.o0; import at0.x; import com.linecorp.line.pay.impl.legacy.util.w; import com.linecorp.line.pay.impl.store.dto.PayUserGetResDto; import com.linecorp.line.pay.impl.tw.biz.main.deck.PayIPassMainBalanceDeckView; import com.linecorp.line.pay.impl.tw.biz.transfer.PayIPassMyTransferCodeActivity; import cy0.b0; import cy0.i0; import dm3.p; import dt0.i; import em3.l0; import em3.s; import j.q; import java.util.Objects; import jp.naver.line.android.R; import jp.naver.line.android.common.view.header.HeaderButton; import kotlin.Lazy; import kotlin.LazyKt; import kotlin.Metadata; import kotlin.ResultKt; import kotlin.Unit; import lo.l; import ok.q0; import qm0.a0; import sq0.o; import um3.a2; import um3.c0; import um3.g; import um3.h0; import um3.w0; import vs0.d; import xq0.h; import zm3.t; @Metadata(bv = {}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u00012\u00020\u0002:\u0001\u0005B\u0007¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0006"}, d2 = {"Lcom/linecorp/line/pay/impl/tw/biz/main/PayIPassMainActivity;", "Lxq0/h;", "Lov0/b;", "<init>", "()V", "a", "pay-impl_release"}, k = 1, mv = {1, 6, 0}) public final class PayIPassMainActivity extends h { /* renamed from: z reason: collision with root package name */ public static final /* synthetic */ int f40698z = 0; /* renamed from: v reason: collision with root package name */ public final Lazy f40699v = new d1(l0.a(i.class), new f(this), new e(this)); /* renamed from: w reason: collision with root package name */ public final Lazy f40700w = LazyKt.lazy(new b(this)); /* renamed from: x reason: collision with root package name */ public final ay2.b f40701x = new ay2.b(); /* renamed from: y reason: collision with root package name */ public final d f40702y = new d(this); public static final class a extends WebViewClient { /* renamed from: com.linecorp.line.pay.impl.tw.biz.main.PayIPassMainActivity$a$a reason: collision with other inner class name */ public /* synthetic */ class C0486a { public static final /* synthetic */ int[] $EnumSwitchMapping$0; static { int[] iArr = new int[dt0.a.a().length]; iArr[q.e(1)] = 1; iArr[q.e(2)] = 2; iArr[q.e(3)] = 3; $EnumSwitchMapping$0 = iArr; } } @Override // android.webkit.WebViewClient public boolean shouldOverrideUrlLoading(WebView webView, String str) { int i14; boolean b14 = em3.q.b(str, webView != null ? webView.getUrl() : null); if (!b14) { boolean z14 = false; if (!(str == null || str.length() == 0)) { Context context = webView != null ? webView.getContext() : null; Activity activity = context instanceof Activity ? (Activity) context : null; if (activity == null) { return !b14; } a aVar = dt0.a.f65172a; Uri parse = Uri.parse(str); em3.q.e(parse, "parse(url)"); Objects.requireNonNull(aVar); if (aVar.a(parse)) { i14 = 1; } else { if (URLUtil.isNetworkUrl(parse.toString()) && !aVar.a(parse)) { z14 = true; } i14 = z14 ? 2 : 3; } int i15 = C0486a.$EnumSwitchMapping$0[q.e(i14)]; if (i15 == 1) { w.f(activity, str); } else if (i15 == 2) { w.b(activity, str, null, null); } else if (i15 == 3) { w.j(activity, str, null, null, null); } } } return !b14; } } public static final class b extends s implements dm3.a<o> { /* renamed from: b reason: collision with root package name */ public final /* synthetic */ PayIPassMainActivity f40703b; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public b(PayIPassMainActivity payIPassMainActivity) { super(0); this.f40703b = payIPassMainActivity; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // dm3.a public o invoke() { LayoutInflater from = LayoutInflater.from(this.f40703b); int i14 = o.f145115d; androidx.databinding.e eVar = androidx.databinding.h.f7441a; o oVar = (o) ViewDataBinding.inflateInternal(from, R.layout.pay_activity_ipass_menu, null, false, null); oVar.setLifecycleOwner(this.f40703b); return oVar; } } @wl3.e(c = "com.linecorp.line.pay.impl.tw.biz.main.PayIPassMainActivity$onCreate$1", f = "PayIPassMainActivity.kt", l = {104}, m = "invokeSuspend") public static final class c extends wl3.i implements p<h0, ul3.d<? super Unit>, Object> { /* renamed from: b reason: collision with root package name */ public int f40704b; /* renamed from: c reason: collision with root package name */ public final /* synthetic */ PayIPassMainActivity f40705c; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public c(PayIPassMainActivity payIPassMainActivity, ul3.d<? super c> dVar) { super(2, dVar); this.f40705c = payIPassMainActivity; } @Override // wl3.a public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) { return new c(this.f40705c, dVar); } /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */ @Override // dm3.p public Object invoke(h0 h0Var, ul3.d<? super Unit> dVar) { return new c(this.f40705c, dVar).invokeSuspend(Unit.INSTANCE); } @Override // wl3.a public final Object invokeSuspend(Object obj) { vl3.a aVar = vl3.a.COROUTINE_SUSPENDED; int i14 = this.f40704b; if (i14 == 0) { ResultKt.throwOnFailure(obj); PayIPassMainActivity payIPassMainActivity = this.f40705c; this.f40704b = 1; obj = PayIPassMainActivity.b9(payIPassMainActivity, this); if (obj == aVar) { return aVar; } } else if (i14 == 1) { ResultKt.throwOnFailure(obj); } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } if (!((Boolean) obj).booleanValue()) { this.f40705c.T8(new Exception(this.f40705c.getString(R.string.pay_e_unknown)), -1, -1, new q0(this.f40705c, 10)); return Unit.INSTANCE; } this.f40705c.C8(); return Unit.INSTANCE; } } public static final class d implements PayIPassMainBalanceDeckView.a { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ PayIPassMainActivity f40706a; @wl3.e(c = "com.linecorp.line.pay.impl.tw.biz.main.PayIPassMainActivity$onIPassBalanceClickListener$1$showChargeView$1", f = "PayIPassMainActivity.kt", l = {73}, m = "invokeSuspend") public static final class a extends wl3.i implements p<h0, ul3.d<? super Unit>, Object> { /* renamed from: b reason: collision with root package name */ public int f40707b; /* renamed from: c reason: collision with root package name */ public final /* synthetic */ PayIPassMainActivity f40708c; @wl3.e(c = "com.linecorp.line.pay.impl.tw.biz.main.PayIPassMainActivity$onIPassBalanceClickListener$1$showChargeView$1$1", f = "PayIPassMainActivity.kt", l = {}, m = "invokeSuspend") /* renamed from: com.linecorp.line.pay.impl.tw.biz.main.PayIPassMainActivity$d$a$a reason: collision with other inner class name */ public static final class C0487a extends wl3.i implements p<h0, ul3.d<? super Unit>, Object> { /* renamed from: b reason: collision with root package name */ public final /* synthetic */ PayIPassMainActivity f40709b; /* renamed from: c reason: collision with root package name */ public final /* synthetic */ PayUserGetResDto.Info f40710c; /* renamed from: d reason: collision with root package name */ public final /* synthetic */ i0 f40711d; /* renamed from: e reason: collision with root package name */ public final /* synthetic */ d.a f40712e; /* renamed from: f reason: collision with root package name */ public final /* synthetic */ b0 f40713f; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public C0487a(PayIPassMainActivity payIPassMainActivity, PayUserGetResDto.Info info, i0 i0Var, d.a aVar, b0 b0Var, ul3.d<? super C0487a> dVar) { super(2, dVar); this.f40709b = payIPassMainActivity; this.f40710c = info; this.f40711d = i0Var; this.f40712e = aVar; this.f40713f = b0Var; } @Override // wl3.a public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) { return new C0487a(this.f40709b, this.f40710c, this.f40711d, this.f40712e, this.f40713f, dVar); } /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */ @Override // dm3.p public Object invoke(h0 h0Var, ul3.d<? super Unit> dVar) { return new C0487a(this.f40709b, this.f40710c, this.f40711d, this.f40712e, this.f40713f, dVar).invokeSuspend(Unit.INSTANCE); } @Override // wl3.a public final Object invokeSuspend(Object obj) { ResultKt.throwOnFailure(obj); new ns0.e(this.f40709b, this.f40710c, this.f40711d, this.f40712e, this.f40713f, null, null, new a0.a(a0.c.CHARGE)).f(); return Unit.INSTANCE; } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public a(PayIPassMainActivity payIPassMainActivity, ul3.d<? super a> dVar) { super(2, dVar); this.f40708c = payIPassMainActivity; } @Override // wl3.a public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) { return new a(this.f40708c, dVar); } /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */ @Override // dm3.p public Object invoke(h0 h0Var, ul3.d<? super Unit> dVar) { return new a(this.f40708c, dVar).invokeSuspend(Unit.INSTANCE); } @Override // wl3.a public final Object invokeSuspend(Object obj) { vl3.a aVar = vl3.a.COROUTINE_SUSPENDED; int i14 = this.f40707b; if (i14 == 0) { ResultKt.throwOnFailure(obj); PayUserGetResDto.Info info = (PayUserGetResDto.Info) PayIPassMainActivity.a9(this.f40708c, new us0.q(false, null, 3)); i0 i0Var = (i0) PayIPassMainActivity.a9(this.f40708c, new us0.e(false, 1)); d.a aVar2 = (d.a) PayIPassMainActivity.a9(this.f40708c, new us0.f(false, 1)); b0 b0Var = (b0) PayIPassMainActivity.a9(this.f40708c, new us0.c(false, 1)); a2 a2Var = t.f199868a; C0487a aVar3 = new C0487a(this.f40708c, info, i0Var, aVar2, b0Var, null); this.f40707b = 1; if (g.g(a2Var, aVar3, this) == aVar) { return aVar; } } else if (i14 == 1) { ResultKt.throwOnFailure(obj); } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } return Unit.INSTANCE; } } public d(PayIPassMainActivity payIPassMainActivity) { this.f40706a = payIPassMainActivity; } @Override // com.linecorp.line.pay.impl.tw.biz.main.deck.PayIPassMainBalanceDeckView.a public void a() { g.d(e0.c(this.f40706a), w0.f166207d, 0, new a(this.f40706a, null), 2, null); } @Override // com.linecorp.line.pay.impl.tw.biz.main.deck.PayIPassMainBalanceDeckView.a public void b() { this.f40706a.startActivity(new Intent(this.f40706a, PayIPassMyTransferCodeActivity.class)); } } public static final class e extends s implements dm3.a<e1.b> { /* renamed from: b reason: collision with root package name */ public final /* synthetic */ ComponentActivity f40714b; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public e(ComponentActivity componentActivity) { super(0); this.f40714b = componentActivity; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // dm3.a public e1.b invoke() { e1.b defaultViewModelProviderFactory = this.f40714b.getDefaultViewModelProviderFactory(); em3.q.e(defaultViewModelProviderFactory, "defaultViewModelProviderFactory"); return defaultViewModelProviderFactory; } } public static final class f extends s implements dm3.a<f1> { /* renamed from: b reason: collision with root package name */ public final /* synthetic */ ComponentActivity f40715b; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public f(ComponentActivity componentActivity) { super(0); this.f40715b = componentActivity; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // dm3.a public f1 invoke() { f1 viewModelStore = this.f40715b.getViewModelStore(); em3.q.e(viewModelStore, "viewModelStore"); return viewModelStore; } } public static final Object a9(PayIPassMainActivity payIPassMainActivity, ts0.c cVar) { return payIPassMainActivity.f184379n.a(cVar); } /* JADX WARNING: Removed duplicated region for block: B:12:0x0032 */ /* JADX WARNING: Removed duplicated region for block: B:16:0x004a */ /* JADX WARNING: Removed duplicated region for block: B:17:0x004d */ /* JADX WARNING: Removed duplicated region for block: B:8:0x0024 */ public static final Object b9(PayIPassMainActivity payIPassMainActivity, ul3.d dVar) { dt0.b bVar; int i14; PayUserGetResDto.Info info; Objects.requireNonNull(payIPassMainActivity); if (dVar instanceof dt0.b) { bVar = (dt0.b) dVar; int i15 = bVar.f65175d; if ((i15 & Integer.MIN_VALUE) != 0) { bVar.f65175d = i15 - Integer.MIN_VALUE; Object obj = bVar.f65173b; vl3.a aVar = vl3.a.COROUTINE_SUSPENDED; i14 = bVar.f65175d; boolean z14 = true; if (i14 != 0) { ResultKt.throwOnFailure(obj); c0 c0Var = w0.f166207d; dt0.c cVar = new dt0.c(null); bVar.f65175d = 1; obj = g.g(c0Var, cVar, bVar); if (obj == aVar) { return aVar; } } else if (i14 == 1) { ResultKt.throwOnFailure(obj); } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } info = (PayUserGetResDto.Info) obj; if (info != null) { return Boolean.FALSE; } boolean z15 = !com.linecorp.line.pay.impl.legacy.util.i0.f(info); if (!(info.i() == hm0.o.LV2) || !z15) { z14 = false; } return Boolean.valueOf(z14); } } bVar = new dt0.b(payIPassMainActivity, dVar); Object obj2 = bVar.f65173b; vl3.a aVar2 = vl3.a.COROUTINE_SUSPENDED; i14 = bVar.f65175d; boolean z142 = true; if (i14 != 0) { } info = (PayUserGetResDto.Info) obj2; if (info != null) { } } @Override // xq0.h public void C8() { D8(false); this.f122777b.e(); this.f122777b.I(R.string.pay_ipass_main_header); HeaderButton u14 = this.f122777b.u(3, R.drawable.pay_close_black, false); if (u14 != null) { u14.setButtonOnClickListener(new uz.a(this, 4)); } c9().f145116b.setOnIPassBalanceClickListener(this.f40702y); WebView webView = c9().f145117c; WebSettings settings = webView.getSettings(); settings.setJavaScriptEnabled(true); settings.setDomStorageEnabled(true); StringBuilder sb4 = new StringBuilder(); sb4.append(settings.getUserAgentString()); sb4.append(" Line/ "); Context context = webView.getContext(); em3.q.e(context, "context"); sb4.append(((lk.c) rb.a.d(context, lk.c.D1)).a()); sb4.append(" LIFF"); settings.setUserAgentString(sb4.toString()); webView.setWebViewClient(new a()); } @Override // xq0.h, lm0.b, wp0.a public void I(int i14, int i15, Intent intent) { super.I(i14, i15, intent); qm0.d dVar = w.f40360a; if (i15 == -1) { qm0.d dVar2 = qm0.d.f133347a; } } @Override // xq0.h public void W0() { String str; i d94 = d9(); Objects.requireNonNull(d94); g.d(j2.e.g(d94), w0.f166207d, 0, new dt0.h(d94, null), 2, null); o0<String> o0Var = d94.f65193b; b0 b0Var = (b0) qm0.d.f133347a.d(fm0.a.CACHEABLE_CONFIG); if (b0Var == null || (str = l.c(b0Var, "iPassWebMenu")) == null) { str = "https://pay-webapp.line-apps-beta.com/ipass-main/menu"; } o0Var.setValue(str); if (!d9().f65192a.hasObservers()) { d9().f65192a.observe(this, new ox.p(this, 12)); d9().f65193b.observe(this, new ox.h(this, 12)); d9().f65194c.observe(this, new ox.i(this, 11)); } if (getIntent().getBooleanExtra("isShowChargeView", false)) { this.f40702y.a(); getIntent().removeExtra("isShowChargeView"); } } public final o c9() { return (o) this.f40700w.getValue(); } public final i d9() { return (i) this.f40699v.getValue(); } @Override // androidx.activity.ComponentActivity, a2.f, xq0.h, androidx.fragment.app.n, od3.e public void onCreate(Bundle bundle) { super.onCreate(bundle); dv0.s.f65387d = new x(); g.d(e0.c(this), null, 0, new c(this, null), 3, null); } @Override // xq0.h, androidx.fragment.app.n public void onDestroy() { super.onDestroy(); dv0.s.f65387d = new dv0.g(); dv0.s.b(this); this.f40701x.dispose(); } @Override // xq0.h public View y8() { View root = c9().getRoot(); em3.q.e(root, "binding.root"); return root; } }