package d3;

import android.os.Bundle;
import java.util.EnumMap;
import java.util.Objects;

/* JADX INFO: renamed from: d3.p, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0811p {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final C0811p f12089f = new C0811p((Boolean) null, 100, (Boolean) null, (String) null);

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

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

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

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final EnumMap f12094e;

    public C0811p(Boolean bool, int i, Boolean bool2, String str) {
        EnumMap enumMap = new EnumMap(E0.class);
        this.f12094e = enumMap;
        enumMap.put(E0.f11449t, bool == null ? C0.f11431r : bool.booleanValue() ? C0.f11434u : C0.f11433t);
        this.f12090a = i;
        this.f12091b = e();
        this.f12092c = bool2;
        this.f12093d = str;
    }

    public static C0811p a(int i, Bundle bundle) {
        if (bundle == null) {
            return new C0811p((Boolean) null, i, (Boolean) null, (String) null);
        }
        EnumMap enumMap = new EnumMap(E0.class);
        for (E0 e02 : D0.DMA.f11444q) {
            enumMap.put(e02, F0.b(bundle.getString(e02.f11452q)));
        }
        return new C0811p(enumMap, i, bundle.containsKey("is_dma_region") ? Boolean.valueOf(bundle.getString("is_dma_region")) : null, bundle.getString("cps_display_str"));
    }

    public static C0811p b(String str) {
        if (str == null || str.length() <= 0) {
            return f12089f;
        }
        String[] strArrSplit = str.split(":");
        int i = Integer.parseInt(strArrSplit[0]);
        EnumMap enumMap = new EnumMap(E0.class);
        E0[] e0Arr = D0.DMA.f11444q;
        int length = e0Arr.length;
        int i5 = 1;
        int i8 = 0;
        while (i8 < length) {
            enumMap.put(e0Arr[i8], F0.c(strArrSplit[i5].charAt(0)));
            i8++;
            i5++;
        }
        return new C0811p(enumMap, i, (Boolean) null, (String) null);
    }

    public static Boolean d(Bundle bundle) {
        if (bundle == null) {
            return null;
        }
        int iOrdinal = F0.b(bundle.getString("ad_personalization")).ordinal();
        if (iOrdinal == 2) {
            return Boolean.FALSE;
        }
        if (iOrdinal != 3) {
            return null;
        }
        return Boolean.TRUE;
    }

    public final C0 c() {
        C0 c02 = (C0) this.f12094e.get(E0.f11449t);
        return c02 == null ? C0.f11431r : c02;
    }

    public final String e() {
        StringBuilder sb = new StringBuilder();
        sb.append(this.f12090a);
        for (E0 e02 : D0.DMA.f11444q) {
            sb.append(":");
            sb.append(F0.a((C0) this.f12094e.get(e02)));
        }
        return sb.toString();
    }

    public final boolean equals(Object obj) {
        if (!(obj instanceof C0811p)) {
            return false;
        }
        C0811p c0811p = (C0811p) obj;
        if (this.f12091b.equalsIgnoreCase(c0811p.f12091b) && Objects.equals(this.f12092c, c0811p.f12092c)) {
            return Objects.equals(this.f12093d, c0811p.f12093d);
        }
        return false;
    }

    public final int hashCode() {
        Boolean bool = this.f12092c;
        int i = bool == null ? 3 : true != bool.booleanValue() ? 13 : 7;
        String str = this.f12093d;
        return ((str == null ? 17 : str.hashCode()) * 137) + this.f12091b.hashCode() + (i * 29);
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder("source=");
        sb.append(F0.h(this.f12090a));
        for (E0 e02 : D0.DMA.f11444q) {
            sb.append(",");
            sb.append(e02.f11452q);
            sb.append("=");
            C0 c02 = (C0) this.f12094e.get(e02);
            if (c02 == null) {
                sb.append("uninitialized");
            } else {
                int iOrdinal = c02.ordinal();
                if (iOrdinal == 0) {
                    sb.append("uninitialized");
                } else if (iOrdinal == 1) {
                    sb.append("eu_consent_policy");
                } else if (iOrdinal == 2) {
                    sb.append("denied");
                } else if (iOrdinal == 3) {
                    sb.append("granted");
                }
            }
        }
        Boolean bool = this.f12092c;
        if (bool != null) {
            sb.append(",isDmaRegion=");
            sb.append(bool);
        }
        String str = this.f12093d;
        if (str != null) {
            sb.append(",cpsDisplayStr=");
            sb.append(str);
        }
        return sb.toString();
    }

    public C0811p(EnumMap enumMap, int i, Boolean bool, String str) {
        EnumMap enumMap2 = new EnumMap(E0.class);
        this.f12094e = enumMap2;
        enumMap2.putAll(enumMap);
        this.f12090a = i;
        this.f12091b = e();
        this.f12092c = bool;
        this.f12093d = str;
    }
}
