package com.strmr.ps.background;

import android.util.Log;
import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.s38;
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\u000e\n\u0002\b\u0002\u0010\u0002\u001a\u0004\u0018\u00010\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "", "<anonymous>", "(Lak1;)Ljava/lang/String;"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.background.CatalogRefreshWorker$doWork$failCount$1$1$1", f = "CatalogRefreshWorker.kt", i = {}, l = {50}, m = "invokeSuspend", n = {}, s = {})
final class f extends SuspendLambda implements gr3<ak1, Continuation<? super String>, Object> {
    public int a;
    public final /* synthetic */ CatalogRefreshWorker b;
    public final /* synthetic */ KFunction c;
    public final /* synthetic */ String d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public f(CatalogRefreshWorker catalogRefreshWorker, KFunction kFunction, String str, Continuation continuation) {
        super(2, continuation);
        this.b = catalogRefreshWorker;
        this.c = kFunction;
        this.d = str;
    }

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

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        return ((f) 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;
        try {
            if (i != 0) {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                return null;
            }
            s38.b(obj);
            gr3 gr3Var = (gr3) this.c;
            this.a = 1;
            Object objInvoke = gr3Var.invoke(Boxing.boxBoolean(false), this);
            if (objInvoke != ck1Var) {
                objInvoke = e6a.a;
            }
            if (objInvoke == ck1Var) {
                return ck1Var;
            }
            return null;
        } catch (Exception e) {
            StringBuilder sb = new StringBuilder("Catalog refresh failed for ");
            String str = this.d;
            sb.append(str);
            Log.e("CatalogRefreshWorker", sb.toString(), e);
            return str;
        }
    }
}
