package com.strmr.ps.background;

import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.i50;
import defpackage.q07;
import defpackage.s38;
import defpackage.vx8;
import defpackage.wj0;
import defpackage.y41;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.reflect.KFunction;

/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "", "<anonymous>", "(Lak1;)I"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.background.CatalogRefreshWorker$doWork$failCount$1", f = "CatalogRefreshWorker.kt", i = {}, l = {57}, m = "invokeSuspend", n = {}, s = {})
@vx8
final class g extends SuspendLambda implements gr3<ak1, Continuation<? super Integer>, Object> {
    public int a;
    public /* synthetic */ Object b;
    public final /* synthetic */ List c;
    public final /* synthetic */ CatalogRefreshWorker d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public g(List list, CatalogRefreshWorker catalogRefreshWorker, Continuation continuation) {
        super(2, continuation);
        this.c = list;
        this.d = catalogRefreshWorker;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        g gVar = new g(this.c, this.d, continuation);
        gVar.b = obj;
        return gVar;
    }

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        return ((g) create((ak1) obj, (Continuation) obj2)).invokeSuspend(e6a.a);
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        int i = this.a;
        if (i == 0) {
            s38.b(obj);
            ak1 ak1Var = (ak1) this.b;
            List<q07> list = this.c;
            ArrayList arrayList = new ArrayList(y41.p(list, 10));
            for (q07 q07Var : list) {
                arrayList.add(wj0.a(ak1Var, null, new f(this.d, (KFunction) q07Var.b, (String) q07Var.a, null), 3));
            }
            this.a = 1;
            obj = i50.a(arrayList, this);
            if (obj == ck1Var) {
                return ck1Var;
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
        }
        Iterable iterable = (Iterable) obj;
        int i2 = 0;
        if (!(iterable instanceof Collection) || !((Collection) iterable).isEmpty()) {
            Iterator it = iterable.iterator();
            while (it.hasNext()) {
                if (((String) it.next()) != null && (i2 = i2 + 1) < 0) {
                    y41.bl();
                    throw null;
                }
            }
        }
        return Boxing.boxInt(i2);
    }
}
