package com.google.android.gms.internal.ads;

import android.content.Context;
import androidx.annotation.Nullable;
import com.google.android.gms.ads.AdFormat;
import com.google.android.gms.ads.internal.ClientApi;
import java.util.concurrent.ScheduledExecutorService;

/* JADX INFO: loaded from: classes2.dex */
public final class mf1 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Context f14106a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final q7.a f14107b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final ScheduledExecutorService f14108c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final tc1 f14109d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final ClientApi f14110e = new ClientApi();

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final pb1 f14111f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final i8.c f14112g;

    @Nullable
    private final te1 zzh;

    public mf1(Context context, q7.a aVar, ScheduledExecutorService scheduledExecutorService, tc1 tc1Var, pb1 pb1Var, i8.c cVar, @Nullable te1 te1Var) {
        this.f14106a = context;
        this.f14107b = aVar;
        this.f14108c = scheduledExecutorService;
        this.f14109d = tc1Var;
        this.f14112g = cVar;
        this.f14111f = pb1Var;
        this.zzh = te1Var;
    }

    public final ye1 a() {
        tn tnVar = ao.G;
        n7.y yVar = n7.y.f31093e;
        return new ye1(((Long) yVar.f31096c.b(tnVar)).longValue(), ((Long) yVar.f31096c.b(ao.H)).longValue(), this.f14112g);
    }

    @Nullable
    public final lf1 zza(n7.p3 p3Var, @Nullable n7.x0 x0Var) {
        AdFormat adFormat = AdFormat.getAdFormat(p3Var.f31010b);
        if (adFormat == null) {
            return null;
        }
        int iOrdinal = adFormat.ordinal();
        q7.a aVar = this.f14107b;
        if (iOrdinal == 1) {
            return new af1(this.f14110e, this.f14106a, aVar.f32214c, this.f14111f, p3Var, x0Var, this.f14108c, this.f14109d, a(), this.f14112g);
        }
        if (iOrdinal == 2) {
            return new pf1(this.f14110e, this.f14106a, aVar.f32214c, this.f14111f, p3Var, x0Var, this.f14108c, this.f14109d, a(), this.f14112g);
        }
        if (iOrdinal != 5) {
            return null;
        }
        return new we1(this.f14110e, this.f14106a, aVar.f32214c, this.f14111f, p3Var, x0Var, this.f14108c, this.f14109d, a(), this.f14112g);
    }

    @Nullable
    public final lf1 zzb(String str, n7.p3 p3Var, @Nullable n7.z0 z0Var) {
        AdFormat adFormat = AdFormat.getAdFormat(p3Var.f31010b);
        if (adFormat == null) {
            return null;
        }
        int iOrdinal = adFormat.ordinal();
        q7.a aVar = this.f14107b;
        if (iOrdinal == 1) {
            return new af1(str, this.f14110e, this.f14106a, aVar.f32214c, this.f14111f, p3Var, z0Var, this.f14108c, this.f14109d, a(), this.f14112g, this.zzh);
        }
        if (iOrdinal == 2) {
            return new pf1(str, this.f14110e, this.f14106a, aVar.f32214c, this.f14111f, p3Var, z0Var, this.f14108c, this.f14109d, a(), this.f14112g, this.zzh);
        }
        if (iOrdinal != 5) {
            return null;
        }
        return new we1(str, this.f14110e, this.f14106a, aVar.f32214c, this.f14111f, p3Var, z0Var, this.f14108c, this.f14109d, a(), this.f14112g, this.zzh);
    }
}
