package XnFJ5_9;

import com.wang.avi.BuildConfig;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
/* compiled from: CacheControl.java */
/* loaded from: classes.dex */
public final class Xgtqvk_8 {

    /* renamed from: FSaI4_7  reason: collision with root package name */
    public final boolean f3410FSaI4_7;

    /* renamed from: IFxWkV_5  reason: collision with root package name */
    public final boolean f3411IFxWkV_5;

    /* renamed from: IMuAHx_6  reason: collision with root package name */
    public final boolean f3412IMuAHx_6;
    public final int KQgRr5e_0;
    @Nullable

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public String f1753KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final boolean f1754KQgRr5e_0;

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public final int f3413Mqv2r_3;

    /* renamed from: Mqv2r_3  reason: collision with other field name */
    public final boolean f1755Mqv2r_3;
    public final int PGPF6hQ_2;

    /* renamed from: PGPF6hQ_2  reason: collision with other field name */
    public final boolean f1756PGPF6hQ_2;
    public final int QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public final boolean f1757QxJ9d_1;

    /* renamed from: X6FRs_4  reason: collision with root package name */
    public final boolean f3414X6FRs_4;

    /* compiled from: CacheControl.java */
    /* loaded from: classes.dex */
    public static final class KQgRr5e_0 {

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public boolean f1758KQgRr5e_0;

        /* renamed from: Mqv2r_3  reason: collision with root package name */
        public boolean f3415Mqv2r_3;

        /* renamed from: PGPF6hQ_2  reason: collision with other field name */
        public boolean f1759PGPF6hQ_2;

        /* renamed from: QxJ9d_1  reason: collision with other field name */
        public boolean f1760QxJ9d_1;

        /* renamed from: X6FRs_4  reason: collision with root package name */
        public boolean f3416X6FRs_4;
        public int KQgRr5e_0 = -1;
        public int QxJ9d_1 = -1;
        public int PGPF6hQ_2 = -1;

        public KQgRr5e_0 KQgRr5e_0() {
            this.f1758KQgRr5e_0 = true;
            return this;
        }

        public KQgRr5e_0 QxJ9d_1() {
            this.f1759PGPF6hQ_2 = true;
            return this;
        }

        public KQgRr5e_0 KQgRr5e_0(int i, TimeUnit timeUnit) {
            if (i >= 0) {
                long seconds = timeUnit.toSeconds(i);
                this.QxJ9d_1 = seconds > 2147483647L ? Integer.MAX_VALUE : (int) seconds;
                return this;
            }
            throw new IllegalArgumentException("maxStale < 0: " + i);
        }

        /* renamed from: KQgRr5e_0  reason: collision with other method in class */
        public Xgtqvk_8 m816KQgRr5e_0() {
            return new Xgtqvk_8(this);
        }
    }

    static {
        KQgRr5e_0 kQgRr5e_0 = new KQgRr5e_0();
        kQgRr5e_0.KQgRr5e_0();
        kQgRr5e_0.m816KQgRr5e_0();
        KQgRr5e_0 kQgRr5e_02 = new KQgRr5e_0();
        kQgRr5e_02.QxJ9d_1();
        kQgRr5e_02.KQgRr5e_0(Integer.MAX_VALUE, TimeUnit.SECONDS);
        kQgRr5e_02.m816KQgRr5e_0();
    }

    public Xgtqvk_8(boolean z, boolean z2, int i, int i2, boolean z3, boolean z4, boolean z5, int i3, int i4, boolean z6, boolean z7, boolean z8, @Nullable String str) {
        this.f1754KQgRr5e_0 = z;
        this.f1757QxJ9d_1 = z2;
        this.KQgRr5e_0 = i;
        this.QxJ9d_1 = i2;
        this.f1756PGPF6hQ_2 = z3;
        this.f1755Mqv2r_3 = z4;
        this.f3414X6FRs_4 = z5;
        this.PGPF6hQ_2 = i3;
        this.f3413Mqv2r_3 = i4;
        this.f3411IFxWkV_5 = z6;
        this.f3412IMuAHx_6 = z7;
        this.f3410FSaI4_7 = z8;
        this.f1753KQgRr5e_0 = str;
    }

    public boolean IFxWkV_5() {
        return this.f3411IFxWkV_5;
    }

    public int KQgRr5e_0() {
        return this.KQgRr5e_0;
    }

    public boolean Mqv2r_3() {
        return this.f1754KQgRr5e_0;
    }

    /* renamed from: PGPF6hQ_2  reason: collision with other method in class */
    public boolean m814PGPF6hQ_2() {
        return this.f3414X6FRs_4;
    }

    /* renamed from: QxJ9d_1  reason: collision with other method in class */
    public boolean m815QxJ9d_1() {
        return this.f1755Mqv2r_3;
    }

    public boolean X6FRs_4() {
        return this.f1757QxJ9d_1;
    }

    public String toString() {
        String str = this.f1753KQgRr5e_0;
        if (str != null) {
            return str;
        }
        String m812KQgRr5e_0 = m812KQgRr5e_0();
        this.f1753KQgRr5e_0 = m812KQgRr5e_0;
        return m812KQgRr5e_0;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public boolean m813KQgRr5e_0() {
        return this.f1756PGPF6hQ_2;
    }

    public int PGPF6hQ_2() {
        return this.f3413Mqv2r_3;
    }

    public int QxJ9d_1() {
        return this.PGPF6hQ_2;
    }

    /* JADX WARN: Removed duplicated region for block: B:15:0x0041  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static Xgtqvk_8 KQgRr5e_0(SI64pbG_23 sI64pbG_23) {
        int i;
        int i2;
        String str;
        SI64pbG_23 sI64pbG_232 = sI64pbG_23;
        int KQgRr5e_02 = sI64pbG_23.KQgRr5e_0();
        int i3 = 0;
        boolean z = true;
        String str2 = null;
        boolean z2 = false;
        boolean z3 = false;
        int i4 = -1;
        int i5 = -1;
        boolean z4 = false;
        boolean z5 = false;
        boolean z6 = false;
        int i6 = -1;
        int i7 = -1;
        boolean z7 = false;
        boolean z8 = false;
        boolean z9 = false;
        while (i3 < KQgRr5e_02) {
            String KQgRr5e_03 = sI64pbG_232.KQgRr5e_0(i3);
            String QxJ9d_1 = sI64pbG_232.QxJ9d_1(i3);
            if (KQgRr5e_03.equalsIgnoreCase("Cache-Control")) {
                if (str2 == null) {
                    str2 = QxJ9d_1;
                    for (i = 0; i < QxJ9d_1.length(); i = i2) {
                        int KQgRr5e_04 = XnFJ5_9.Ft6VRog_36.Xgtqvk_8.X6FRs_4.KQgRr5e_0(QxJ9d_1, i, "=,;");
                        String trim = QxJ9d_1.substring(i, KQgRr5e_04).trim();
                        if (KQgRr5e_04 == QxJ9d_1.length() || QxJ9d_1.charAt(KQgRr5e_04) == ',' || QxJ9d_1.charAt(KQgRr5e_04) == ';') {
                            i2 = KQgRr5e_04 + 1;
                            str = null;
                        } else {
                            int QxJ9d_12 = XnFJ5_9.Ft6VRog_36.Xgtqvk_8.X6FRs_4.QxJ9d_1(QxJ9d_1, KQgRr5e_04 + 1);
                            if (QxJ9d_12 < QxJ9d_1.length() && QxJ9d_1.charAt(QxJ9d_12) == '\"') {
                                int i8 = QxJ9d_12 + 1;
                                int KQgRr5e_05 = XnFJ5_9.Ft6VRog_36.Xgtqvk_8.X6FRs_4.KQgRr5e_0(QxJ9d_1, i8, "\"");
                                str = QxJ9d_1.substring(i8, KQgRr5e_05);
                                i2 = KQgRr5e_05 + 1;
                            } else {
                                i2 = XnFJ5_9.Ft6VRog_36.Xgtqvk_8.X6FRs_4.KQgRr5e_0(QxJ9d_1, QxJ9d_12, ",;");
                                str = QxJ9d_1.substring(QxJ9d_12, i2).trim();
                            }
                        }
                        if ("no-cache".equalsIgnoreCase(trim)) {
                            z2 = true;
                        } else if ("no-store".equalsIgnoreCase(trim)) {
                            z3 = true;
                        } else if ("max-age".equalsIgnoreCase(trim)) {
                            i4 = XnFJ5_9.Ft6VRog_36.Xgtqvk_8.X6FRs_4.KQgRr5e_0(str, -1);
                        } else if ("s-maxage".equalsIgnoreCase(trim)) {
                            i5 = XnFJ5_9.Ft6VRog_36.Xgtqvk_8.X6FRs_4.KQgRr5e_0(str, -1);
                        } else if ("private".equalsIgnoreCase(trim)) {
                            z4 = true;
                        } else if ("public".equalsIgnoreCase(trim)) {
                            z5 = true;
                        } else if ("must-revalidate".equalsIgnoreCase(trim)) {
                            z6 = true;
                        } else if ("max-stale".equalsIgnoreCase(trim)) {
                            i6 = XnFJ5_9.Ft6VRog_36.Xgtqvk_8.X6FRs_4.KQgRr5e_0(str, Integer.MAX_VALUE);
                        } else if ("min-fresh".equalsIgnoreCase(trim)) {
                            i7 = XnFJ5_9.Ft6VRog_36.Xgtqvk_8.X6FRs_4.KQgRr5e_0(str, -1);
                        } else if ("only-if-cached".equalsIgnoreCase(trim)) {
                            z7 = true;
                        } else if ("no-transform".equalsIgnoreCase(trim)) {
                            z8 = true;
                        } else if ("immutable".equalsIgnoreCase(trim)) {
                            z9 = true;
                        }
                    }
                    i3++;
                    sI64pbG_232 = sI64pbG_23;
                }
            } else if (!KQgRr5e_03.equalsIgnoreCase("Pragma")) {
                i3++;
                sI64pbG_232 = sI64pbG_23;
            }
            z = false;
            while (i < QxJ9d_1.length()) {
            }
            i3++;
            sI64pbG_232 = sI64pbG_23;
        }
        return new Xgtqvk_8(z2, z3, i4, i5, z4, z5, z6, i6, i7, z7, z8, z9, !z ? null : str2);
    }

    public Xgtqvk_8(KQgRr5e_0 kQgRr5e_0) {
        this.f1754KQgRr5e_0 = kQgRr5e_0.f1758KQgRr5e_0;
        this.f1757QxJ9d_1 = kQgRr5e_0.f1760QxJ9d_1;
        this.KQgRr5e_0 = kQgRr5e_0.KQgRr5e_0;
        this.QxJ9d_1 = -1;
        this.f1756PGPF6hQ_2 = false;
        this.f1755Mqv2r_3 = false;
        this.f3414X6FRs_4 = false;
        this.PGPF6hQ_2 = kQgRr5e_0.QxJ9d_1;
        this.f3413Mqv2r_3 = kQgRr5e_0.PGPF6hQ_2;
        this.f3411IFxWkV_5 = kQgRr5e_0.f1759PGPF6hQ_2;
        this.f3412IMuAHx_6 = kQgRr5e_0.f3415Mqv2r_3;
        this.f3410FSaI4_7 = kQgRr5e_0.f3416X6FRs_4;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public final String m812KQgRr5e_0() {
        StringBuilder sb = new StringBuilder();
        if (this.f1754KQgRr5e_0) {
            sb.append("no-cache, ");
        }
        if (this.f1757QxJ9d_1) {
            sb.append("no-store, ");
        }
        if (this.KQgRr5e_0 != -1) {
            sb.append("max-age=");
            sb.append(this.KQgRr5e_0);
            sb.append(", ");
        }
        if (this.QxJ9d_1 != -1) {
            sb.append("s-maxage=");
            sb.append(this.QxJ9d_1);
            sb.append(", ");
        }
        if (this.f1756PGPF6hQ_2) {
            sb.append("private, ");
        }
        if (this.f1755Mqv2r_3) {
            sb.append("public, ");
        }
        if (this.f3414X6FRs_4) {
            sb.append("must-revalidate, ");
        }
        if (this.PGPF6hQ_2 != -1) {
            sb.append("max-stale=");
            sb.append(this.PGPF6hQ_2);
            sb.append(", ");
        }
        if (this.f3413Mqv2r_3 != -1) {
            sb.append("min-fresh=");
            sb.append(this.f3413Mqv2r_3);
            sb.append(", ");
        }
        if (this.f3411IFxWkV_5) {
            sb.append("only-if-cached, ");
        }
        if (this.f3412IMuAHx_6) {
            sb.append("no-transform, ");
        }
        if (this.f3410FSaI4_7) {
            sb.append("immutable, ");
        }
        if (sb.length() == 0) {
            return BuildConfig.FLAVOR;
        }
        sb.delete(sb.length() - 2, sb.length());
        return sb.toString();
    }
}
