package v52; import android.app.Application; import android.os.Build; import androidx.lifecycle.o0; import androidx.lifecycle.w0; import com.linecorp.line.constants.BuildConfig; import com.linecorp.linepay.jp.kyc.impl.common.PayUserInfo; import com.linecorp.linepay.jp.kyc.impl.digitalid.recoverykyc.dto.PayRecoveryKycAppVersionReqDto; import com.linecorp.linepay.jp.kyc.impl.digitalid.recoverykyc.dto.PayRecoveryKycAppVersionResDto; import com.linecorp.linepay.jp.kyc.impl.digitalid.recoverykyc.dto.PayRecoveryKycCheckResDto; import com.linecorp.linepay.jp.kyc.impl.digitalid.recoverykyc.dto.PayRecoveryKycKyclpResDto; import com.linecorp.linepay.jp.kyc.impl.digitalid.recoverykyc.dto.PayRecoveryKycScopeResDto; import com.linecorp.linepay.jp.kyc.impl.digitalid.recoverykyc.dto.PayRecoveryKycStartResDto; import dm3.p; import em3.q; import em3.s; import gb.g; import hm0.o; import hq3.a0; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.concurrent.TimeUnit; import kotlin.Lazy; import kotlin.LazyKt; import kotlin.Pair; import kotlin.ResultKt; import kotlin.Unit; import n52.a; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; import pd3.a; import ql3.u; import sm3.r; import tv2.e0; import um3.h0; import vl3.f; import w52.a; import wl3.i; public final class c extends androidx.lifecycle.b { /* renamed from: c reason: collision with root package name */ public final Application f170277c; /* renamed from: d reason: collision with root package name */ public final o0<Boolean> f170278d = new o0<>(Boolean.FALSE); /* renamed from: e reason: collision with root package name */ public final o0<b> f170279e = new o0<>(); /* renamed from: f reason: collision with root package name */ public final o0<a> f170280f = new o0<>(); /* renamed from: g reason: collision with root package name */ public final o0<Pair<String, Boolean>> f170281g = new o0<>(); /* renamed from: h reason: collision with root package name */ public final g f170282h; /* renamed from: i reason: collision with root package name */ public final Lazy f170283i; /* renamed from: j reason: collision with root package name */ public final String f170284j; /* renamed from: k reason: collision with root package name */ public o f170285k; /* renamed from: l reason: collision with root package name */ public final Lazy f170286l; public /* synthetic */ class a { public static final /* synthetic */ int[] $EnumSwitchMapping$0; static { int[] iArr = new int[PayRecoveryKycCheckResDto.a.values().length]; iArr[PayRecoveryKycCheckResDto.a.INVALID_ACCOUNT.ordinal()] = 1; iArr[PayRecoveryKycCheckResDto.a.NEED_CANCEL_INSURANCE.ordinal()] = 2; iArr[PayRecoveryKycCheckResDto.a.OTHER_KYC_IN_PROGRESS.ordinal()] = 3; iArr[PayRecoveryKycCheckResDto.a.IN_PROGRESS.ordinal()] = 4; iArr[PayRecoveryKycCheckResDto.a.READY.ordinal()] = 5; $EnumSwitchMapping$0 = iArr; } } @wl3.e(c = "com.linecorp.linepay.jp.kyc.impl.digitalid.recoverykyc.PayRecoveryKycViewModel", f = "PayRecoveryKycViewModel.kt", l = {191}, m = "getKyclp") public static final class b extends wl3.c { /* renamed from: b reason: collision with root package name */ public Object f170287b; /* renamed from: c reason: collision with root package name */ public /* synthetic */ Object f170288c; /* renamed from: d reason: collision with root package name */ public final /* synthetic */ c f170289d; /* renamed from: e reason: collision with root package name */ public int f170290e; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public b(c cVar, ul3.d<? super b> dVar) { super(dVar); this.f170289d = cVar; } @Override // wl3.a public final Object invokeSuspend(Object obj) { this.f170288c = obj; this.f170290e |= Integer.MIN_VALUE; return this.f170289d.Y5(false, this); } } @wl3.e(c = "com.linecorp.linepay.jp.kyc.impl.digitalid.recoverykyc.PayRecoveryKycViewModel$getScopesAndPostEnable$1", f = "PayRecoveryKycViewModel.kt", l = {139, 148, 151, 154}, m = "invokeSuspend") /* renamed from: v52.c$c reason: collision with other inner class name */ public static final class C3064c extends i implements p<h0, ul3.d<? super Unit>, Object> { /* renamed from: b reason: collision with root package name */ public Object f170291b; /* renamed from: c reason: collision with root package name */ public int f170292c; /* renamed from: d reason: collision with root package name */ public final /* synthetic */ c f170293d; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public C3064c(c cVar, ul3.d<? super C3064c> dVar) { super(2, dVar); this.f170293d = cVar; } @Override // wl3.a public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) { return new C3064c(this.f170293d, 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 C3064c(this.f170293d, dVar).invokeSuspend(Unit.INSTANCE); } /* JADX WARNING: Removed duplicated region for block: B:29:0x00b3 A[RETURN] */ /* JADX WARNING: Removed duplicated region for block: B:32:0x00bc */ /* JADX WARNING: Removed duplicated region for block: B:34:0x00bf */ @Override // wl3.a public final Object invokeSuspend(Object obj) { List list; vl3.a aVar = vl3.a.COROUTINE_SUSPENDED; int i14 = this.f170292c; if (i14 == 0) { ResultKt.throwOnFailure(obj); this.f170293d.d6(true); list = new ArrayList(); w52.c a64 = this.f170293d.a6(); this.f170291b = list; this.f170292c = 1; Objects.requireNonNull(a64); ul3.i iVar = new ul3.i(f.b(this)); a64.f176234b.f(a64.f176233a).b1(new w52.e(iVar, 3)); obj = iVar.a(); if (obj == aVar) { return aVar; } } else if (i14 == 1) { list = (List) this.f170291b; ResultKt.throwOnFailure(obj); } else if (i14 == 2) { ResultKt.throwOnFailure(obj); c cVar = this.f170293d; this.f170291b = null; this.f170292c = 3; obj = c.S5(cVar, this); if (obj == aVar) { return aVar; } if (!((Boolean) obj).booleanValue()) { } } else if (i14 == 3) { ResultKt.throwOnFailure(obj); if (!((Boolean) obj).booleanValue()) { return Unit.INSTANCE; } c cVar2 = this.f170293d; this.f170292c = 4; if (cVar2.Y5(false, this) == aVar) { return aVar; } this.f170293d.d6(false); return Unit.INSTANCE; } else if (i14 == 4) { try { ResultKt.throwOnFailure(obj); this.f170293d.d6(false); } catch (Exception e14) { c.U5(this.f170293d, e14); } return Unit.INSTANCE; } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } for (T t14 : ((PayRecoveryKycScopeResDto) obj).f49172b) { if (!t14.f49144b) { list.add(t14.f49143a); } } if (!list.isEmpty()) { w52.c a65 = this.f170293d.a6(); List<String> J0 = u.J0(list); this.f170291b = null; this.f170292c = 2; if (a65.a(J0, this) == aVar) { return aVar; } } c cVar3 = this.f170293d; this.f170291b = null; this.f170292c = 3; obj = c.S5(cVar3, this); if (obj == aVar) { } if (!((Boolean) obj).booleanValue()) { } } } public static final class d extends s implements dm3.a<n52.b> { /* renamed from: b reason: collision with root package name */ public final /* synthetic */ c f170294b; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public d(c cVar) { super(0); this.f170294b = cVar; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // dm3.a public n52.b invoke() { return new n52.b(this.f170294b.f170277c, 1); } } public static final class e extends s implements dm3.a<w52.c> { /* renamed from: b reason: collision with root package name */ public final /* synthetic */ c f170295b; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public e(c cVar) { super(0); this.f170295b = cVar; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // dm3.a public w52.c invoke() { return new w52.c(this.f170295b.f170284j); } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public c(Application application, w0 w0Var) { super(application); q.f(application, "app"); q.f(w0Var, "savedStateHandle"); this.f170277c = application; d62.a aVar = d62.a.f62806a; this.f170282h = d62.a.a(application); this.f170283i = LazyKt.lazy(new d(this)); String str = (String) w0Var.f8045a.get("linepay.bundle.extra.pay_recovery_kyc_transactionId"); this.f170284j = str == null ? "" : str; this.f170285k = o.UNSPECIFIED; this.f170286l = LazyKt.lazy(new e(this)); um3.g.d(j2.e.g(this), um3.w0.f166207d, 0, new d(this, null), 2, null); } /* JADX WARNING: Removed duplicated region for block: B:12:0x0037 */ /* JADX WARNING: Removed duplicated region for block: B:16:0x0073 */ /* JADX WARNING: Removed duplicated region for block: B:27:0x0098 */ /* JADX WARNING: Removed duplicated region for block: B:8:0x0025 */ public static final Object S5(c cVar, ul3.d dVar) { e eVar; int i14; int i15; Objects.requireNonNull(cVar); if (dVar instanceof e) { eVar = (e) dVar; int i16 = eVar.f170302e; if ((i16 & Integer.MIN_VALUE) != 0) { eVar.f170302e = i16 - Integer.MIN_VALUE; Object obj = eVar.f170300c; vl3.a aVar = vl3.a.COROUTINE_SUSPENDED; i14 = eVar.f170302e; if (i14 != 0) { ResultKt.throwOnFailure(obj); w52.c a64 = cVar.a6(); eVar.f170299b = cVar; eVar.f170302e = 1; Objects.requireNonNull(a64); ul3.i iVar = new ul3.i(f.b(eVar)); a64.f176234b.e(a64.f176233a).b1(new w52.e(iVar, 5)); obj = iVar.a(); if (obj == aVar) { return aVar; } } else if (i14 == 1) { cVar = (c) eVar.f170299b; ResultKt.throwOnFailure(obj); } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } i15 = a.$EnumSwitchMapping$0[((PayRecoveryKycCheckResDto) obj).f49162a.ordinal()]; if (i15 != 1) { cVar.f170280f.postValue(a.ACCOUNT_ERROR); } else if (i15 == 2) { cVar.f170280f.postValue(a.OLD_ACCOUNT_IS_USING_LINE_INSURANCE); } else if (i15 == 3) { cVar.f170280f.postValue(a.OTHER_KYC_IN_PROGRESS); } else if (i15 == 4) { cVar.e6(b.IN_PROGRESS); } else if (i15 == 5) { return Boolean.TRUE; } cVar.d6(false); return Boolean.FALSE; } } eVar = new e(cVar, dVar); Object obj2 = eVar.f170300c; vl3.a aVar2 = vl3.a.COROUTINE_SUSPENDED; i14 = eVar.f170302e; if (i14 != 0) { } i15 = a.$EnumSwitchMapping$0[((PayRecoveryKycCheckResDto) obj2).f49162a.ordinal()]; if (i15 != 1) { } cVar.d6(false); return Boolean.FALSE; } /* JADX WARNING: Removed duplicated region for block: B:12:0x0032 */ /* JADX WARNING: Removed duplicated region for block: B:8:0x0024 */ public static final Object T5(c cVar, ul3.d dVar) { f fVar; int i14; Objects.requireNonNull(cVar); if (dVar instanceof f) { fVar = (f) dVar; int i15 = fVar.f170305d; if ((i15 & Integer.MIN_VALUE) != 0) { fVar.f170305d = i15 - Integer.MIN_VALUE; Object obj = fVar.f170303b; vl3.a aVar = vl3.a.COROUTINE_SUSPENDED; i14 = fVar.f170305d; if (i14 != 0) { ResultKt.throwOnFailure(obj); fVar.f170305d = 1; obj = ((fm0.e) rb.a.d(cVar.f170277c, fm0.e.f72501z0)).Z0(fVar); if (obj == aVar) { return aVar; } } else if (i14 == 1) { ResultKt.throwOnFailure(obj); } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } PayUserInfo payUserInfo = (PayUserInfo) new e0(new e0.a()).a(PayUserInfo.class).a((String) obj); Objects.requireNonNull(payUserInfo, "PayUserInfo should not be null!"); return payUserInfo; } } fVar = new f(cVar, dVar); Object obj2 = fVar.f170303b; vl3.a aVar2 = vl3.a.COROUTINE_SUSPENDED; i14 = fVar.f170305d; if (i14 != 0) { } PayUserInfo payUserInfo2 = (PayUserInfo) new e0(new e0.a()).a(PayUserInfo.class).a((String) obj2); Objects.requireNonNull(payUserInfo2, "PayUserInfo should not be null!"); return payUserInfo2; } public static final void U5(c cVar, Exception exc) { Objects.requireNonNull(cVar); exc.toString(); cVar.d6(false); if (exc instanceof a.C1937a) { a.C1937a aVar = (a.C1937a) exc; if (aVar.f115963c == 503 && aVar.f115962b == 1) { cVar.e6(b.UPDATE); return; } cVar.f170280f.postValue(a.COMMON_ERROR); return; } cVar.f170280f.postValue(a.COMMON_ERROR); } public static final void V5(c cVar) { String u14 = ((pd3.a) cVar.f170282h.f76083a).u(a.b.RECOVERY_KYC); String str = ""; if (u14 == null) { u14 = str; } w52.a aVar = w52.a.f176229a; String str2 = cVar.f170284j; q.f(str2, "transactionId"); HttpLoggingInterceptor httpLoggingInterceptor = w52.a.f176231c; httpLoggingInterceptor.level(HttpLoggingInterceptor.Level.NONE); OkHttpClient.Builder builder = new OkHttpClient.Builder(); TimeUnit timeUnit = TimeUnit.SECONDS; OkHttpClient build = builder.connectTimeout(5, timeUnit).readTimeout(70, timeUnit).addInterceptor(new w52.b(str2, u14)).addInterceptor(httpLoggingInterceptor).build(); a0.b bVar = new a0.b(); d62.a aVar2 = d62.a.f62806a; int i14 = a.C3187a.$EnumSwitchMapping$0[d62.a.f62807b.ordinal()]; if (i14 == 1) { str = "https://kyc-digital-id-client-gw.line-apps-beta.com"; } else if (i14 == 2) { str = "https://kyc-digital-id-client-gw.line-apps-rc.com"; } else if (i14 == 3) { str = "https://kyc-digital-id-client-gw.line-apps.com"; } bVar.b(str); bVar.d(build); bVar.f83690d.add(new lq3.a(new e0(new e0.a()), false, false, false)); w52.a.f176230b = (w52.d) bVar.c().b(w52.d.class); } /* JADX WARNING: Removed duplicated region for block: B:12:0x0036 */ /* JADX WARNING: Removed duplicated region for block: B:16:0x007f */ /* JADX WARNING: Removed duplicated region for block: B:17:0x0087 */ /* JADX WARNING: Removed duplicated region for block: B:8:0x0024 */ public static final Object W5(c cVar, ul3.d dVar) { g gVar; Object obj; int i14; Objects.requireNonNull(cVar); if (dVar instanceof g) { gVar = (g) dVar; int i15 = gVar.f170309e; if ((i15 & Integer.MIN_VALUE) != 0) { gVar.f170309e = i15 - Integer.MIN_VALUE; obj = gVar.f170307c; vl3.a aVar = vl3.a.COROUTINE_SUSPENDED; i14 = gVar.f170309e; if (i14 != 0) { ResultKt.throwOnFailure(obj); w52.c a64 = cVar.a6(); gVar.f170306b = cVar; gVar.f170309e = 1; Objects.requireNonNull(a64); ul3.i iVar = new ul3.i(f.b(gVar)); String str = Build.VERSION.RELEASE; String str2 = BuildConfig.VERSION_NAME; q.e(str, "osVersion"); q.e(str2, "appVersion"); a64.f176234b.c(a64.f176233a, new PayRecoveryKycAppVersionReqDto("ANDROID", str, str2)).b1(new w52.e(iVar, 1)); obj = iVar.a(); if (obj == aVar) { return aVar; } } else if (i14 == 1) { cVar = (c) gVar.f170306b; ResultKt.throwOnFailure(obj); } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } if (!((PayRecoveryKycAppVersionResDto) obj).f49159a) { return Boolean.TRUE; } cVar.e6(b.UPDATE); return Boolean.FALSE; } } gVar = new g(cVar, dVar); obj = gVar.f170307c; vl3.a aVar2 = vl3.a.COROUTINE_SUSPENDED; i14 = gVar.f170309e; if (i14 != 0) { } if (!((PayRecoveryKycAppVersionResDto) obj).f49159a) { } } /* JADX WARNING: Removed duplicated region for block: B:12:0x0036 */ /* JADX WARNING: Removed duplicated region for block: B:8:0x0024 */ public static final Object X5(c cVar, ul3.d dVar) { h hVar; int i14; Objects.requireNonNull(cVar); if (dVar instanceof h) { hVar = (h) dVar; int i15 = hVar.f170313e; if ((i15 & Integer.MIN_VALUE) != 0) { hVar.f170313e = i15 - Integer.MIN_VALUE; Object obj = hVar.f170311c; vl3.a aVar = vl3.a.COROUTINE_SUSPENDED; i14 = hVar.f170313e; if (i14 != 0) { ResultKt.throwOnFailure(obj); w52.c a64 = cVar.a6(); hVar.f170310b = cVar; hVar.f170313e = 1; Objects.requireNonNull(a64); ul3.i iVar = new ul3.i(f.b(hVar)); a64.f176234b.a(a64.f176233a).b1(new w52.e(iVar, 2)); obj = iVar.a(); if (obj == aVar) { return aVar; } } else if (i14 == 1) { cVar = (c) hVar.f170310b; ResultKt.throwOnFailure(obj); } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } cVar.Z5().c("PAY_RECOVERY_KYC_RETURN_URL", ((PayRecoveryKycStartResDto) obj).f49177b, String.class); return Unit.INSTANCE; } } hVar = new h(cVar, dVar); Object obj2 = hVar.f170311c; vl3.a aVar2 = vl3.a.COROUTINE_SUSPENDED; i14 = hVar.f170313e; if (i14 != 0) { } cVar.Z5().c("PAY_RECOVERY_KYC_RETURN_URL", ((PayRecoveryKycStartResDto) obj2).f49177b, String.class); return Unit.INSTANCE; } /* JADX WARNING: Removed duplicated region for block: B:12:0x0033 */ /* JADX WARNING: Removed duplicated region for block: B:18:0x006d */ /* JADX WARNING: Removed duplicated region for block: B:20:0x0073 */ /* JADX WARNING: Removed duplicated region for block: B:8:0x0021 */ public final Object Y5(boolean z14, ul3.d<? super Unit> dVar) { b bVar; int i14; c cVar; String str; if (dVar instanceof b) { bVar = (b) dVar; int i15 = bVar.f170290e; if ((i15 & Integer.MIN_VALUE) != 0) { bVar.f170290e = i15 - Integer.MIN_VALUE; Object obj = bVar.f170288c; vl3.a aVar = vl3.a.COROUTINE_SUSPENDED; i14 = bVar.f170290e; if (i14 != 0) { ResultKt.throwOnFailure(obj); w52.c a64 = a6(); bVar.f170287b = this; bVar.f170290e = 1; Objects.requireNonNull(a64); ul3.i iVar = new ul3.i(f.b(bVar)); a64.f176234b.b(a64.f176233a, z14).b1(new w52.e(iVar, 5)); obj = iVar.a(); if (obj == aVar) { return aVar; } cVar = this; } else if (i14 == 1) { cVar = (c) bVar.f170287b; ResultKt.throwOnFailure(obj); } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } str = ((PayRecoveryKycKyclpResDto) obj).f49168a; if (r.u(str)) { cVar.g6(str, true); return Unit.INSTANCE; } throw new RuntimeException("the url of kyclp should not be blank!"); } } bVar = new b(this, dVar); Object obj2 = bVar.f170288c; vl3.a aVar2 = vl3.a.COROUTINE_SUSPENDED; i14 = bVar.f170290e; if (i14 != 0) { } str = ((PayRecoveryKycKyclpResDto) obj2).f49168a; if (r.u(str)) { } } public final n52.b Z5() { return (n52.b) this.f170283i.getValue(); } public final w52.c a6() { return (w52.c) this.f170286l.getValue(); } public final void b6() { um3.g.d(j2.e.g(this), um3.w0.f166207d, 0, new C3064c(this, null), 2, null); } public final void d6(boolean z14) { if (this.f170285k == o.LV2) { this.f170278d.postValue(Boolean.valueOf(z14)); } } public final void e6(b bVar) { q.f(bVar, "screenType"); this.f170279e.postValue(bVar); } public final void f6() { String str = (String) Z5().b("PAY_RECOVERY_KYC_RETURN_URL", null, String.class); if (str == null) { str = ""; } g6(str, true); } public final void g6(String str, boolean z14) { q.f(str, zq0.c.QUERY_KEY_URL); this.f170281g.postValue(new Pair<>(str, Boolean.valueOf(z14))); } }