package j$.time.chrono;

import j$.time.LocalDate;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.util.Objects;

/* JADX INFO: loaded from: classes2.dex */
public final class B extends AbstractC2284c {
    private static final long serialVersionUID = 1300372329181994526L;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final transient LocalDate f19129a;

    B(LocalDate localDate) {
        Objects.requireNonNull(localDate, "isoDate");
        this.f19129a = localDate;
    }

    @Override // j$.time.chrono.AbstractC2284c, j$.time.chrono.ChronoLocalDate
    public final int hashCode() {
        z.f19186d.getClass();
        return this.f19129a.hashCode() ^ (-1990173233);
    }

    @Override // j$.time.chrono.ChronoLocalDate
    public final k i() {
        return z.f19186d;
    }

    @Override // j$.time.chrono.ChronoLocalDate
    public final l u() {
        return V() >= 1 ? C.ROC : C.BEFORE_ROC;
    }

    @Override // j$.time.temporal.n
    public final j$.time.temporal.x l(j$.time.temporal.s sVar) {
        if (!(sVar instanceof j$.time.temporal.a)) {
            return sVar.J(this);
        }
        if (!f(sVar)) {
            throw new j$.time.temporal.w(j$.time.d.a("Unsupported field: ", sVar));
        }
        j$.time.temporal.a aVar = (j$.time.temporal.a) sVar;
        int i6 = A.f19128a[aVar.ordinal()];
        if (i6 == 1 || i6 == 2 || i6 == 3) {
            return this.f19129a.l(sVar);
        }
        if (i6 != 4) {
            return z.f19186d.W(aVar);
        }
        j$.time.temporal.x xVarB = j$.time.temporal.a.YEAR.B();
        return j$.time.temporal.x.j(1L, V() <= 0 ? (-xVarB.e()) + 1912 : xVarB.d() - 1911);
    }

    @Override // j$.time.temporal.n
    public final long g(j$.time.temporal.s sVar) {
        if (sVar instanceof j$.time.temporal.a) {
            int i6 = A.f19128a[((j$.time.temporal.a) sVar).ordinal()];
            if (i6 == 4) {
                int iV = V();
                if (iV < 1) {
                    iV = 1 - iV;
                }
                return iV;
            }
            LocalDate localDate = this.f19129a;
            if (i6 == 5) {
                return ((((long) V()) * 12) + ((long) localDate.b0())) - 1;
            }
            if (i6 == 6) {
                return V();
            }
            if (i6 != 7) {
                return localDate.g(sVar);
            }
            return V() < 1 ? 0 : 1;
        }
        return sVar.r(this);
    }

    private int V() {
        return this.f19129a.c0() - 1911;
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x004b  */
    @Override // j$.time.chrono.AbstractC2284c, j$.time.chrono.ChronoLocalDate, j$.time.temporal.m
    /* JADX INFO: renamed from: Y, reason: merged with bridge method [inline-methods] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final B a(long j4, j$.time.temporal.s sVar) {
        if (sVar instanceof j$.time.temporal.a) {
            j$.time.temporal.a aVar = (j$.time.temporal.a) sVar;
            if (g(aVar) == j4) {
                return this;
            }
            int[] iArr = A.f19128a;
            int i6 = iArr[aVar.ordinal()];
            LocalDate localDate = this.f19129a;
            if (i6 == 4) {
                int iA = z.f19186d.W(aVar).a(j4, aVar);
                int i7 = iArr[aVar.ordinal()];
                if (i7 == 4) {
                    return b0(localDate.u0(V() >= 1 ? iA + 1911 : 1912 - iA));
                }
                if (i7 == 6) {
                    return b0(localDate.u0(iA + 1911));
                }
                if (i7 == 7) {
                    return b0(localDate.u0(1912 - V()));
                }
            } else {
                if (i6 == 5) {
                    z.f19186d.W(aVar).b(j4, aVar);
                    return b0(localDate.n0(j4 - (((((long) V()) * 12) + ((long) localDate.b0())) - 1)));
                }
                if (i6 == 6 || i6 == 7) {
                }
            }
            return b0(localDate.a(j4, sVar));
        }
        return (B) super.a(j4, sVar);
    }

    @Override // j$.time.chrono.AbstractC2284c, j$.time.chrono.ChronoLocalDate, j$.time.temporal.m
    /* JADX INFO: renamed from: h */
    public final j$.time.temporal.m m(LocalDate localDate) {
        return (B) super.m(localDate);
    }

    @Override // j$.time.chrono.ChronoLocalDate
    public final ChronoLocalDate m(j$.time.temporal.o oVar) {
        return (B) super.m(oVar);
    }

    @Override // j$.time.chrono.ChronoLocalDate
    public final ChronoLocalDate N(j$.time.temporal.r rVar) {
        return (B) super.N(rVar);
    }

    @Override // j$.time.chrono.AbstractC2284c
    final ChronoLocalDate U(long j4) {
        return b0(this.f19129a.p0(j4));
    }

    @Override // j$.time.chrono.AbstractC2284c
    final ChronoLocalDate J(long j4) {
        return b0(this.f19129a.n0(j4));
    }

    @Override // j$.time.chrono.AbstractC2284c
    final ChronoLocalDate B(long j4) {
        return b0(this.f19129a.m0(j4));
    }

    @Override // j$.time.chrono.AbstractC2284c, j$.time.chrono.ChronoLocalDate, j$.time.temporal.m
    public final ChronoLocalDate b(long j4, j$.time.temporal.v vVar) {
        return (B) super.b(j4, vVar);
    }

    @Override // j$.time.chrono.AbstractC2284c, j$.time.chrono.ChronoLocalDate, j$.time.temporal.m
    public final j$.time.temporal.m b(long j4, j$.time.temporal.v vVar) {
        return (B) super.b(j4, vVar);
    }

    @Override // j$.time.chrono.AbstractC2284c, j$.time.chrono.ChronoLocalDate, j$.time.temporal.m
    public final ChronoLocalDate c(long j4, j$.time.temporal.v vVar) {
        return (B) super.c(j4, vVar);
    }

    @Override // j$.time.chrono.AbstractC2284c, j$.time.chrono.ChronoLocalDate, j$.time.temporal.m
    public final j$.time.temporal.m c(long j4, j$.time.temporal.v vVar) {
        return (B) super.c(j4, vVar);
    }

    private B b0(LocalDate localDate) {
        return localDate.equals(this.f19129a) ? this : new B(localDate);
    }

    @Override // j$.time.chrono.ChronoLocalDate
    public final long toEpochDay() {
        return this.f19129a.toEpochDay();
    }

    @Override // j$.time.chrono.AbstractC2284c, j$.time.chrono.ChronoLocalDate
    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof B) {
            return this.f19129a.equals(((B) obj).f19129a);
        }
        return false;
    }

    private void readObject(ObjectInputStream objectInputStream) throws InvalidObjectException {
        throw new InvalidObjectException("Deserialization via serialization delegate");
    }

    private Object writeReplace() {
        return new D((byte) 7, this);
    }

    @Override // j$.time.chrono.ChronoLocalDate
    public final InterfaceC2285d L(j$.time.l lVar) {
        return C2287f.B(this, lVar);
    }
}
