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

import android.os.SystemClock;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

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

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final sy0 f15889b;

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final LinkedHashMap f15891d = new LinkedHashMap();

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final boolean f15892e = ((Boolean) n7.y.f31093e.f31096c.b(ao.C7)).booleanValue();

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public boolean f15894g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public long f15895h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public long f15896i;

    public qy0(i8.c cVar, sy0 sy0Var, zw0 zw0Var, re1 re1Var) {
        this.f15888a = cVar;
        this.f15889b = sy0Var;
        this.f15893f = zw0Var;
        this.f15890c = re1Var;
    }

    public final synchronized void a(List list) {
        ((i8.d) this.f15888a).getClass();
        this.f15896i = SystemClock.elapsedRealtime();
        Iterator it = list.iterator();
        while (it.hasNext()) {
            wa1 wa1Var = (wa1) it.next();
            String str = wa1Var.f18011u;
            if (!TextUtils.isEmpty(str)) {
                this.f15891d.put(wa1Var, new py0(str, wa1Var.f17972a0, Integer.MAX_VALUE, 0L, null));
            }
        }
    }

    public final synchronized void b(eb1 eb1Var, wa1 wa1Var, com.google.common.util.concurrent.w wVar, qe1 qe1Var) {
        za1 za1Var = eb1Var.f10746b.f10364b;
        ((i8.d) this.f15888a).getClass();
        long jElapsedRealtime = SystemClock.elapsedRealtime();
        String str = wa1Var.f18011u;
        if (str != null) {
            this.f15891d.put(wa1Var, new py0(str, wa1Var.f17972a0, 9, 0L, null));
            ih1.z1(wVar, new oy0(this, jElapsedRealtime, za1Var, wa1Var, str, qe1Var, eb1Var), b30.f9365g);
        }
    }

    public final synchronized void c(wa1 wa1Var) {
        py0 py0Var = (py0) this.f15891d.get(wa1Var);
        if (py0Var == null || this.f15894g) {
            return;
        }
        py0Var.f15549c = 8;
    }

    public final synchronized String d() {
        ArrayList arrayList;
        try {
            arrayList = new ArrayList();
            Iterator it = this.f15891d.entrySet().iterator();
            while (it.hasNext()) {
                py0 py0Var = (py0) ((Map.Entry) it.next()).getValue();
                if (py0Var.f15549c != Integer.MAX_VALUE) {
                    arrayList.add(py0Var.toString());
                }
            }
        } catch (Throwable th) {
            throw th;
        }
        return TextUtils.join("_", arrayList);
    }

    public final synchronized void zzd(@Nullable wa1 wa1Var) {
        try {
            ((i8.d) this.f15888a).getClass();
            this.f15895h = SystemClock.elapsedRealtime() - this.f15896i;
            if (wa1Var != null) {
                this.f15893f.c(wa1Var);
            }
            this.f15894g = true;
        } catch (Throwable th) {
            throw th;
        }
    }
}
