package com.discord.widgets.captcha; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import com.discord.app.AppFragment; import com.discord.stores.StoreNotices; import com.discord.stores.StoreStream; import com.discord.utilities.captcha.CaptchaErrorBody; import com.discord.widgets.captcha.WidgetCaptchaBottomSheet; import d0.t.u; import d0.z.d.a0; import d0.z.d.m; import d0.z.d.o; import java.util.Iterator; import java.util.List; import kotlin.jvm.functions.Function0; import kotlin.jvm.functions.Function1; import kotlin.jvm.functions.Function2; /* compiled from: WidgetCaptchaBottomSheet.kt */ public final class WidgetCaptchaBottomSheet$Companion$enqueue$captchaNotice$1 extends o implements Function1 { public final /* synthetic */ CaptchaErrorBody $error; public final /* synthetic */ Function0 $onCaptchaAttemptFailed; public final /* synthetic */ Function2 $onCaptchaPayloadReceived; public final /* synthetic */ String $requestKey; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public WidgetCaptchaBottomSheet$Companion$enqueue$captchaNotice$1(String str, CaptchaErrorBody captchaErrorBody, Function0 function0, Function2 function2) { super(1); this.$requestKey = str; this.$error = captchaErrorBody; this.$onCaptchaAttemptFailed = function0; this.$onCaptchaPayloadReceived = function2; } /* Return type fixed from 'java.lang.Object' to match base method */ /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */ @Override // kotlin.jvm.functions.Function1 public /* bridge */ /* synthetic */ Boolean invoke(FragmentActivity fragmentActivity) { return Boolean.valueOf(invoke(fragmentActivity)); } public final boolean invoke(FragmentActivity fragmentActivity) { Object obj; m.checkNotNullParameter(fragmentActivity, "appActivity"); WidgetCaptchaBottomSheet.Companion companion = WidgetCaptchaBottomSheet.Companion; FragmentManager supportFragmentManager = fragmentActivity.getSupportFragmentManager(); m.checkNotNullExpressionValue(supportFragmentManager, "appActivity.supportFragmentManager"); companion.show(supportFragmentManager, this.$requestKey, this.$error, this.$onCaptchaAttemptFailed); StoreNotices.markSeen$default(StoreStream.Companion.getNotices(), "captcha notice", 0, 2, null); FragmentManager supportFragmentManager2 = fragmentActivity.getSupportFragmentManager(); m.checkNotNullExpressionValue(supportFragmentManager2, "appActivity.supportFragmentManager"); List fragments = supportFragmentManager2.getFragments(); m.checkNotNullExpressionValue(fragments, "appActivity.supportFragmentManager.fragments"); Iterator it = fragments.iterator(); while (true) { if (!it.hasNext()) { obj = null; break; } obj = it.next(); if (u.contains(WidgetCaptchaBottomSheet.access$getResolvableFragments$cp(), a0.getOrCreateKotlinClass(((Fragment) obj).getClass()))) { break; } } Fragment fragment = (Fragment) obj; if (fragment == null) { return true; } WidgetCaptchaBottomSheet.Companion.registerForResult((AppFragment) fragment, this.$requestKey, this.$onCaptchaPayloadReceived); return true; } }