package p138.p145.p146.p151.p158;

import android.text.TextUtils;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import p138.p139.p143.p144.C2803;

/* JADX INFO: renamed from: ދ.ؠ.֏.ތ.ދ.އ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C3018 implements InterfaceC3016 {

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final Map<String, List<InterfaceC3017>> f9183;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public volatile Map<String, String> f9184;

    /* JADX INFO: renamed from: ދ.ؠ.֏.ތ.ދ.އ$֏, reason: contains not printable characters */
    public static final class C3019 {

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public static final String f9185;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public static final Map<String, List<InterfaceC3017>> f9186;

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public Map<String, List<InterfaceC3017>> f9187 = f9186;

        static {
            String property = System.getProperty("http.agent");
            if (!TextUtils.isEmpty(property)) {
                int length = property.length();
                StringBuilder sb = new StringBuilder(property.length());
                for (int i = 0; i < length; i++) {
                    char cCharAt = property.charAt(i);
                    if ((cCharAt > 31 || cCharAt == '\t') && cCharAt < 127) {
                        sb.append(cCharAt);
                    } else {
                        sb.append('?');
                    }
                }
                property = sb.toString();
            }
            f9185 = property;
            HashMap map = new HashMap(2);
            if (!TextUtils.isEmpty(f9185)) {
                map.put("User-Agent", Collections.singletonList(new C3020(f9185)));
            }
            f9186 = Collections.unmodifiableMap(map);
        }
    }

    /* JADX INFO: renamed from: ދ.ؠ.֏.ތ.ދ.އ$ؠ, reason: contains not printable characters */
    public static final class C3020 implements InterfaceC3017 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final String f9188;

        public C3020(String str) {
            this.f9188 = str;
        }

        public boolean equals(Object obj) {
            if (obj instanceof C3020) {
                return this.f9188.equals(((C3020) obj).f9188);
            }
            return false;
        }

        public int hashCode() {
            return this.f9188.hashCode();
        }

        public String toString() {
            StringBuilder sbM4889 = C2803.m4889("StringHeaderFactory{value='");
            sbM4889.append(this.f9188);
            sbM4889.append('\'');
            sbM4889.append('}');
            return sbM4889.toString();
        }

        @Override // p138.p145.p146.p151.p158.InterfaceC3017
        /* JADX INFO: renamed from: ֏ */
        public String mo5143() {
            return this.f9188;
        }
    }

    public C3018(Map<String, List<InterfaceC3017>> map) {
        this.f9183 = Collections.unmodifiableMap(map);
    }

    public boolean equals(Object obj) {
        if (obj instanceof C3018) {
            return this.f9183.equals(((C3018) obj).f9183);
        }
        return false;
    }

    public int hashCode() {
        return this.f9183.hashCode();
    }

    public String toString() {
        StringBuilder sbM4889 = C2803.m4889("LazyHeaders{headers=");
        sbM4889.append(this.f9183);
        sbM4889.append('}');
        return sbM4889.toString();
    }

    @Override // p138.p145.p146.p151.p158.InterfaceC3016
    /* JADX INFO: renamed from: ֏ */
    public Map<String, String> mo5142() {
        if (this.f9184 == null) {
            synchronized (this) {
                if (this.f9184 == null) {
                    this.f9184 = Collections.unmodifiableMap(m5144());
                }
            }
        }
        return this.f9184;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final Map<String, String> m5144() {
        HashMap map = new HashMap();
        for (Map.Entry<String, List<InterfaceC3017>> entry : this.f9183.entrySet()) {
            List<InterfaceC3017> value = entry.getValue();
            StringBuilder sb = new StringBuilder();
            int size = value.size();
            for (int i = 0; i < size; i++) {
                String strMo5143 = value.get(i).mo5143();
                if (!TextUtils.isEmpty(strMo5143)) {
                    sb.append(strMo5143);
                    if (i != value.size() - 1) {
                        sb.append(',');
                    }
                }
            }
            String string = sb.toString();
            if (!TextUtils.isEmpty(string)) {
                map.put(entry.getKey(), string);
            }
        }
        return map;
    }
}
