package lg1; import dm3.p; import em3.q; import java.net.URL; import java.util.Map; import jg1.b; import kotlin.Result; import kotlin.ResultKt; import kotlin.Unit; import ng1.a; import okhttp3.HttpUrl; import org.json.JSONException; import org.json.JSONObject; import tq.h; import ul3.d; import um3.h0; import uq.w; import wl3.e; import wl3.i; @e(c = "com.linecorp.line.square.remotedata.client.note.SquareNoteNotificationSettingsServiceClient$getNoteNotificationSettings$2", f = "SquareNoteNotificationSettingsServiceClient.kt", l = {45}, m = "invokeSuspend") public final class c extends i implements p<h0, d<? super a>, Object> { /* renamed from: b reason: collision with root package name */ public Object f106815b; /* renamed from: c reason: collision with root package name */ public int f106816c; /* renamed from: d reason: collision with root package name */ public /* synthetic */ Object f106817d; /* renamed from: e reason: collision with root package name */ public final /* synthetic */ e f106818e; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public c(e eVar, d<? super c> dVar) { super(2, dVar); this.f106818e = eVar; } @Override // wl3.a public final d<Unit> create(Object obj, d<?> dVar) { c cVar = new c(this.f106818e, dVar); cVar.f106817d = obj; return cVar; } /* 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, d<? super a> dVar) { c cVar = new c(this.f106818e, dVar); cVar.f106817d = h0Var; return cVar.invokeSuspend(Unit.INSTANCE); } @Override // wl3.a public final Object invokeSuspend(Object obj) { Object obj2; e eVar; Throwable th4; e eVar2; vl3.a aVar = vl3.a.COROUTINE_SUSPENDED; int i14 = this.f106816c; if (i14 == 0) { ResultKt.throwOnFailure(obj); h0 h0Var = (h0) this.f106817d; e eVar3 = this.f106818e; try { Result.Companion companion = Result.Companion; h hVar = eVar3.f106826b; q.f(hVar, "serverEndpoints"); HttpUrl a14 = hVar.a("square_note"); if (a14 == null) { a14 = HttpUrl.Companion.get("https://square-note.line-apps.com"); } URL url = a14.newBuilder().encodedPath("/napi/v2/nc/notisetting/square/info.json").build().url(); mr.a aVar2 = eVar3.f106825a; kg1.a aVar3 = kg1.a.GET; Map<String, String> map = eVar3.f106828d.get(); this.f106817d = eVar3; this.f106815b = eVar3; this.f106816c = 1; Object a15 = b.a(aVar2, url, aVar3, map, null, null, null, null, this, 120); if (a15 == aVar) { return aVar; } eVar = eVar3; obj = a15; eVar2 = eVar; } catch (Throwable th5) { eVar = eVar3; th4 = th5; Result.Companion companion2 = Result.Companion; obj2 = Result.m364constructorimpl(ResultKt.createFailure(th4)); e.a(eVar, obj2); ResultKt.throwOnFailure(obj2); return obj2; } } else if (i14 == 1) { eVar = (e) this.f106815b; eVar2 = (e) this.f106817d; try { ResultKt.throwOnFailure(obj); } catch (Throwable th6) { th4 = th6; } } else { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } JSONObject jSONObject = new JSONObject(eVar2.f106830f.invoke((w) obj).b()); int i15 = jSONObject.getInt(zq0.c.QUERY_KEY_CODE); if (i15 == 0) { JSONObject optJSONObject = jSONObject.optJSONObject("result"); if (optJSONObject != null) { obj2 = Result.m364constructorimpl(new a(optJSONObject.getBoolean("LIKE"), optJSONObject.getBoolean("MENTION"), optJSONObject.getBoolean("COMMENT_LIKE"), optJSONObject.getBoolean("COMMENT"))); e.a(eVar, obj2); ResultKt.throwOnFailure(obj2); return obj2; } throw new JSONException("result json is null"); } throw new mg1.a(i15); } }