package 㿎;

import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import ඓ.ⁱ.K.ඓ.C1252;
import ඓ.K.K.K.C1293;
import 㿎.C2667;
import 㿎.ሽ.C2540;

/* renamed from: 㿎.ト  reason: contains not printable characters */
/* compiled from: Request */
public final class C2644 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final C2667 f8982;

    /* renamed from: ඓ  reason: contains not printable characters */
    public final Map<Class<?>, Object> f8983;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final String f8984;

    /* renamed from: K  reason: contains not printable characters */
    public final C2531 f8985;

    /* renamed from: 㴹  reason: contains not printable characters */
    public volatile C2663 f8986;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final AbstractC2651 f8987;

    public C2644(C2645 k) {
        this.f8985 = k.f8991;
        this.f8984 = k.f8990;
        this.f8982 = k.f8988.m7003();
        this.f8987 = k.f8992;
        this.f8983 = C2540.m6648(k.f8989);
    }

    public String toString() {
        StringBuilder r0 = C1293.m3416("Request{method=");
        r0.append(this.f8984);
        r0.append(", url=");
        r0.append(this.f8985);
        r0.append(", tags=");
        r0.append(this.f8983);
        r0.append('}');
        return r0.toString();
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public C2645 m6961() {
        return new C2645(this);
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m6962() {
        return this.f8985.f8540.equals("https");
    }

    /* renamed from: K  reason: contains not printable characters */
    public C2663 m6963() {
        C2663 r0 = this.f8986;
        if (r0 != null) {
            return r0;
        }
        C2663 r02 = C2663.m6990(this.f8982);
        this.f8986 = r02;
        return r02;
    }

    /* renamed from: 㿎.ト$K  reason: contains not printable characters */
    /* compiled from: Request */
    public static class C2645 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public C2667.C2668 f8988;

        /* renamed from: ඓ  reason: contains not printable characters */
        public Map<Class<?>, Object> f8989;

        /* renamed from: ῲ  reason: contains not printable characters */
        public String f8990;

        /* renamed from: K  reason: contains not printable characters */
        public C2531 f8991;

        /* renamed from: 㸾  reason: contains not printable characters */
        public AbstractC2651 f8992;

        public C2645() {
            this.f8989 = Collections.emptyMap();
            this.f8990 = "GET";
            this.f8988 = new C2667.C2668();
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2645 m6968(C2531 r2) {
            if (r2 != null) {
                this.f8991 = r2;
                return this;
            }
            throw new NullPointerException("url == null");
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2645 m6965(String str) {
            if (str != null) {
                if (str.regionMatches(true, 0, "ws:", 0, 3)) {
                    StringBuilder r0 = C1293.m3416("http:");
                    r0.append(str.substring(3));
                    str = r0.toString();
                } else if (str.regionMatches(true, 0, "wss:", 0, 4)) {
                    StringBuilder r02 = C1293.m3416("https:");
                    r02.append(str.substring(4));
                    str = r02.toString();
                }
                m6968(C2531.m6582(str));
                return this;
            }
            throw new NullPointerException("url == null");
        }

        public C2645(C2644 r3) {
            Map<Class<?>, Object> map;
            this.f8989 = Collections.emptyMap();
            this.f8991 = r3.f8985;
            this.f8990 = r3.f8984;
            this.f8992 = r3.f8987;
            if (r3.f8983.isEmpty()) {
                map = Collections.emptyMap();
            } else {
                map = new LinkedHashMap<>(r3.f8983);
            }
            this.f8989 = map;
            this.f8988 = r3.f8982.m6997();
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2645 m6966(String str, String str2) {
            C2667.C2668 k = this.f8988;
            k.m6998(str, str2);
            k.m6999(str);
            k.f9081.add(str);
            k.f9081.add(str2.trim());
            return this;
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2645 m6969(C2667 r1) {
            this.f8988 = r1.m6997();
            return this;
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2645 m6967(String str, AbstractC2651 r4) {
            if (str == null) {
                throw new NullPointerException("method == null");
            } else if (str.length() == 0) {
                throw new IllegalArgumentException("method.length() == 0");
            } else if (r4 == null || C1252.m3330(str)) {
                if (r4 == null) {
                    if (str.equals("POST") || str.equals("PUT") || str.equals("PATCH") || str.equals("PROPPATCH") || str.equals("REPORT")) {
                        throw new IllegalArgumentException(C1293.m3413("method ", str, " must have a request body."));
                    }
                }
                this.f8990 = str;
                this.f8992 = r4;
                return this;
            } else {
                throw new IllegalArgumentException(C1293.m3413("method ", str, " must not have a request body."));
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2645 m6964(Object obj) {
            if (obj == null) {
                this.f8989.remove(Object.class);
            } else {
                if (this.f8989.isEmpty()) {
                    this.f8989 = new LinkedHashMap();
                }
                this.f8989.put(Object.class, Object.class.cast(obj));
            }
            return this;
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2644 m6970() {
            if (this.f8991 != null) {
                return new C2644(this);
            }
            throw new IllegalStateException("url == null");
        }
    }
}
