package androidx.core.view;

import android.view.View;
import android.view.ViewGroup;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
import kotlin.jvm.functions.Function2;

/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002*\b\u0012\u0004\u0012\u00020\u00010\u0000H\u008a@"}, d2 = {"Lkotlin/sequences/g;", "Landroid/view/View;", "Lkd/e;", "<anonymous>"}, k = 3, mv = {1, 8, 0})
@DebugMetadata(c = "androidx.core.view.ViewKt$allViews$1", f = "View.kt", i = {0}, l = {410, TTAdConstant.IMAGE_URL_CODE}, m = "invokeSuspend", n = {"$this$sequence"}, s = {"L$0"})
final class ViewKt$allViews$1 extends RestrictedSuspendLambda implements Function2 {
    final /* synthetic */ View $this_allViews;
    private /* synthetic */ Object L$0;
    int label;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public ViewKt$allViews$1(View view, Continuation continuation) {
        super(continuation);
        this.$this_allViews = view;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        ViewKt$allViews$1 viewKt$allViews$1 = new ViewKt$allViews$1(this.$this_allViews, continuation);
        viewKt$allViews$1.L$0 = obj;
        return viewKt$allViews$1;
    }

    @Override // kotlin.jvm.functions.Function2
    public final Object invoke(Object obj, Object obj2) {
        return ((ViewKt$allViews$1) create((kotlin.sequences.g) obj, (Continuation) obj2)).invokeSuspend(kd.e.f29109a);
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        Object obj2;
        CoroutineSingletons coroutineSingletons = CoroutineSingletons.f29226a;
        int i10 = this.label;
        if (i10 == 0) {
            kotlin.a.d(obj);
            kotlin.sequences.g gVar = (kotlin.sequences.g) this.L$0;
            View view = this.$this_allViews;
            this.L$0 = gVar;
            this.label = 1;
            kotlin.sequences.f fVar = (kotlin.sequences.f) gVar;
            fVar.f29252b = view;
            fVar.f29251a = 3;
            fVar.f29254d = this;
            return coroutineSingletons;
        }
        kd.e eVar = kd.e.f29109a;
        if (i10 == 1) {
            kotlin.sequences.g gVar2 = (kotlin.sequences.g) this.L$0;
            kotlin.a.d(obj);
            View view2 = this.$this_allViews;
            if (view2 instanceof ViewGroup) {
                v1 v1Var = new v1((ViewGroup) view2, 0);
                this.L$0 = null;
                this.label = 2;
                gVar2.getClass();
                Iterator it = v1Var.iterator();
                kotlin.sequences.f fVar2 = (kotlin.sequences.f) gVar2;
                if (it.hasNext()) {
                    fVar2.f29253c = it;
                    fVar2.f29251a = 2;
                    fVar2.f29254d = this;
                    obj2 = coroutineSingletons;
                } else {
                    obj2 = eVar;
                }
                if (obj2 != coroutineSingletons) {
                    obj2 = eVar;
                }
                if (obj2 == coroutineSingletons) {
                    return coroutineSingletons;
                }
            }
        } else {
            if (i10 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            kotlin.a.d(obj);
        }
        return eVar;
    }
}
