package G4;

import E4.k;
import P2.C0253j;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

/* JADX INFO: loaded from: classes.dex */
public final class d {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final long f2971d = TimeUnit.HOURS.toMillis(24);

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final long f2972e = TimeUnit.MINUTES.toMillis(30);

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

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f2975c;

    public d() {
        if (C0253j.f5414s == null) {
            Pattern pattern = k.f2206c;
            C0253j.f5414s = new C0253j(5);
        }
        C0253j c0253j = C0253j.f5414s;
        if (k.f2207d == null) {
            k.f2207d = new k(c0253j);
        }
        this.f2973a = k.f2207d;
    }

    public final synchronized long a(int i) {
        if (!(i == 429 || (i >= 500 && i < 600))) {
            return f2971d;
        }
        double dPow = Math.pow(2.0d, this.f2975c);
        this.f2973a.getClass();
        return (long) Math.min(dPow + ((long) (Math.random() * 1000.0d)), f2972e);
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x001b  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final synchronized boolean b() {
        boolean z8;
        if (this.f2975c != 0) {
            this.f2973a.f2208a.getClass();
            z8 = System.currentTimeMillis() > this.f2974b;
        }
        return z8;
    }

    public final synchronized void c() {
        this.f2975c = 0;
    }

    public final synchronized void d(int i) {
        if ((i >= 200 && i < 300) || i == 401 || i == 404) {
            c();
            return;
        }
        this.f2975c++;
        long jA = a(i);
        this.f2973a.f2208a.getClass();
        this.f2974b = System.currentTimeMillis() + jA;
    }
}
