package j$.time.chrono;

import j$.time.LocalDate;
import j$.time.ZoneId;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.Serializable;
import java.util.Objects;

/* JADX INFO: renamed from: j$.time.chrono.f, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes2.dex */
final class C2287f implements InterfaceC2285d, j$.time.temporal.m, j$.time.temporal.o, Serializable {
    private static final long serialVersionUID = 4556003607393004514L;

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final transient j$.time.l f19144b;

    static C2287f B(ChronoLocalDate chronoLocalDate, j$.time.l lVar) {
        return new C2287f(chronoLocalDate, lVar);
    }

    static C2287f r(k kVar, j$.time.temporal.m mVar) {
        C2287f c2287f = (C2287f) mVar;
        if (kVar.equals(c2287f.i())) {
            return c2287f;
        }
        throw new ClassCastException("Chronology mismatch, required: " + kVar.s() + ", actual: " + c2287f.i().s());
    }

    private C2287f(ChronoLocalDate chronoLocalDate, j$.time.l lVar) {
        Objects.requireNonNull(lVar, "time");
        this.f19143a = chronoLocalDate;
        this.f19144b = lVar;
    }

    private C2287f b0(j$.time.temporal.m mVar, j$.time.l lVar) {
        ChronoLocalDate chronoLocalDate = this.f19143a;
        return (chronoLocalDate == mVar && this.f19144b == lVar) ? this : new C2287f(AbstractC2284c.r(chronoLocalDate.i(), mVar), lVar);
    }

    @Override // j$.time.chrono.InterfaceC2285d
    public final ChronoLocalDate o() {
        return this.f19143a;
    }

    @Override // j$.time.chrono.InterfaceC2285d
    public final j$.time.l n() {
        return this.f19144b;
    }

    @Override // j$.time.temporal.n
    public final boolean f(j$.time.temporal.s sVar) {
        if (!(sVar instanceof j$.time.temporal.a)) {
            return sVar != null && sVar.Y(this);
        }
        j$.time.temporal.a aVar = (j$.time.temporal.a) sVar;
        return aVar.V() || aVar.d0();
    }

    @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 (((j$.time.temporal.a) sVar).d0() ? this.f19144b : this.f19143a).l(sVar);
        }
        return sVar.J(this);
    }

    @Override // j$.time.temporal.n
    public final int j(j$.time.temporal.s sVar) {
        if (sVar instanceof j$.time.temporal.a) {
            return ((j$.time.temporal.a) sVar).d0() ? this.f19144b.j(sVar) : this.f19143a.j(sVar);
        }
        return l(sVar).a(g(sVar), sVar);
    }

    @Override // j$.time.temporal.n
    public final long g(j$.time.temporal.s sVar) {
        if (sVar instanceof j$.time.temporal.a) {
            return ((j$.time.temporal.a) sVar).d0() ? this.f19144b.g(sVar) : this.f19143a.g(sVar);
        }
        return sVar.r(this);
    }

    @Override // j$.time.temporal.m
    /* JADX INFO: renamed from: h */
    public final j$.time.temporal.m m(LocalDate localDate) {
        return b0(localDate, this.f19144b);
    }

    @Override // j$.time.temporal.m
    /* JADX INFO: renamed from: Y, reason: merged with bridge method [inline-methods] */
    public final C2287f a(long j4, j$.time.temporal.s sVar) {
        boolean z6 = sVar instanceof j$.time.temporal.a;
        ChronoLocalDate chronoLocalDate = this.f19143a;
        if (z6) {
            boolean zD0 = ((j$.time.temporal.a) sVar).d0();
            j$.time.l lVar = this.f19144b;
            if (zD0) {
                return b0(chronoLocalDate, lVar.a(j4, sVar));
            }
            return b0(chronoLocalDate.a(j4, sVar), lVar);
        }
        return r(chronoLocalDate.i(), sVar.p(this, j4));
    }

    @Override // j$.time.temporal.m
    /* JADX INFO: renamed from: J, reason: merged with bridge method [inline-methods] */
    public final C2287f b(long j4, j$.time.temporal.v vVar) {
        boolean z6 = vVar instanceof j$.time.temporal.b;
        ChronoLocalDate chronoLocalDate = this.f19143a;
        if (z6) {
            int i6 = AbstractC2286e.f19142a[((j$.time.temporal.b) vVar).ordinal()];
            j$.time.l lVar = this.f19144b;
            switch (i6) {
                case 1:
                    return V(this.f19143a, 0L, 0L, 0L, j4);
                case 2:
                    C2287f c2287fB0 = b0(chronoLocalDate.b(j4 / 86400000000L, (j$.time.temporal.v) j$.time.temporal.b.DAYS), lVar);
                    return c2287fB0.V(c2287fB0.f19143a, 0L, 0L, 0L, (j4 % 86400000000L) * 1000);
                case 3:
                    C2287f c2287fB02 = b0(chronoLocalDate.b(j4 / 86400000, (j$.time.temporal.v) j$.time.temporal.b.DAYS), lVar);
                    return c2287fB02.V(c2287fB02.f19143a, 0L, 0L, 0L, (j4 % 86400000) * 1000000);
                case 4:
                    return U(j4);
                case 5:
                    return V(this.f19143a, 0L, j4, 0L, 0L);
                case 6:
                    return V(this.f19143a, j4, 0L, 0L, 0L);
                case 7:
                    C2287f c2287fB03 = b0(chronoLocalDate.b(j4 / 256, (j$.time.temporal.v) j$.time.temporal.b.DAYS), lVar);
                    return c2287fB03.V(c2287fB03.f19143a, (j4 % 256) * 12, 0L, 0L, 0L);
                default:
                    return b0(chronoLocalDate.b(j4, vVar), lVar);
            }
        }
        return r(chronoLocalDate.i(), vVar.p(this, j4));
    }

    final C2287f U(long j4) {
        return V(this.f19143a, 0L, 0L, j4, 0L);
    }

    private C2287f V(ChronoLocalDate chronoLocalDate, long j4, long j6, long j7, long j8) {
        long j9 = j4 | j6 | j7 | j8;
        j$.time.l lVarE0 = this.f19144b;
        if (j9 == 0) {
            return b0(chronoLocalDate, lVarE0);
        }
        long j10 = j6 / 1440;
        long j11 = j4 / 24;
        long j12 = (j6 % 1440) * 60000000000L;
        long j13 = ((j4 % 24) * 3600000000000L) + j12 + ((j7 % 86400) * androidx.media3.common.C.NANOS_PER_SECOND) + (j8 % 86400000000000L);
        long jM0 = lVarE0.m0();
        long j14 = j13 + jM0;
        long jFloorDiv = Math.floorDiv(j14, 86400000000000L) + j11 + j10 + (j7 / 86400) + (j8 / 86400000000000L);
        long jFloorMod = Math.floorMod(j14, 86400000000000L);
        if (jFloorMod != jM0) {
            lVarE0 = j$.time.l.e0(jFloorMod);
        }
        return b0(chronoLocalDate.b(jFloorDiv, (j$.time.temporal.v) j$.time.temporal.b.DAYS), lVarE0);
    }

    @Override // j$.time.chrono.InterfaceC2285d
    public final ChronoZonedDateTime H(ZoneId zoneId) {
        return j.B(zoneId, null, this);
    }

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

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

    final void writeExternal(ObjectOutput objectOutput) throws IOException {
        objectOutput.writeObject(this.f19143a);
        objectOutput.writeObject(this.f19144b);
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        return (obj instanceof InterfaceC2285d) && compareTo((InterfaceC2285d) obj) == 0;
    }

    public final int hashCode() {
        return this.f19143a.hashCode() ^ this.f19144b.hashCode();
    }

    public final String toString() {
        return this.f19143a.toString() + "T" + this.f19144b.toString();
    }
}
