package g;

import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;

/* JADX INFO: loaded from: classes.dex */
public final class p extends c0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final u f6428a = u.a("application/x-www-form-urlencoded");

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final List<String> f6429b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final List<String> f6430c;

    public static final class a {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public final List<String> f6431a = new ArrayList();

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public final List<String> f6432b = new ArrayList();
    }

    public p(List<String> list, List<String> list2) {
        this.f6429b = g.i0.c.n(list);
        this.f6430c = g.i0.c.n(list2);
    }

    @Override // g.c0
    public long a() {
        return d(null, true);
    }

    @Override // g.c0
    public u b() {
        return f6428a;
    }

    @Override // g.c0
    public void c(h.g gVar) {
        d(gVar, false);
    }

    public final long d(@Nullable h.g gVar, boolean z) {
        h.f fVar = z ? new h.f() : gVar.b();
        int size = this.f6429b.size();
        for (int i2 = 0; i2 < size; i2++) {
            if (i2 > 0) {
                fVar.Z(38);
            }
            fVar.e0(this.f6429b.get(i2));
            fVar.Z(61);
            fVar.e0(this.f6430c.get(i2));
        }
        if (!z) {
            return 0L;
        }
        long j2 = fVar.f6529d;
        fVar.K();
        return j2;
    }
}
