package com.google.android.material.datepicker;

import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.Arrays;

/* JADX INFO: compiled from: CalendarConstraints.java */
/* JADX INFO: loaded from: classes.dex */
public final class a implements Parcelable {
    public static final Parcelable.Creator<a> CREATOR = new C0048a();

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private final l f3818e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private final l f3819f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private final c f3820g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private l f3821h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private final int f3822i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private final int f3823j;

    /* JADX INFO: renamed from: com.google.android.material.datepicker.a$a, reason: collision with other inner class name */
    /* JADX INFO: compiled from: CalendarConstraints.java */
    class C0048a implements Parcelable.Creator<a> {
        C0048a() {
        }

        @Override // android.os.Parcelable.Creator
        /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
        public a createFromParcel(Parcel parcel) {
            return new a((l) parcel.readParcelable(l.class.getClassLoader()), (l) parcel.readParcelable(l.class.getClassLoader()), (c) parcel.readParcelable(c.class.getClassLoader()), (l) parcel.readParcelable(l.class.getClassLoader()), null);
        }

        @Override // android.os.Parcelable.Creator
        /* JADX INFO: renamed from: b, reason: merged with bridge method [inline-methods] */
        public a[] newArray(int i3) {
            return new a[i3];
        }
    }

    /* JADX INFO: compiled from: CalendarConstraints.java */
    public static final class b {

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        static final long f3824e = s.a(l.k(1900, 0).f3902j);

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        static final long f3825f = s.a(l.k(2100, 11).f3902j);

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private long f3826a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private long f3827b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private Long f3828c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private c f3829d;

        b(a aVar) {
            this.f3826a = f3824e;
            this.f3827b = f3825f;
            this.f3829d = f.j(Long.MIN_VALUE);
            this.f3826a = aVar.f3818e.f3902j;
            this.f3827b = aVar.f3819f.f3902j;
            this.f3828c = Long.valueOf(aVar.f3821h.f3902j);
            this.f3829d = aVar.f3820g;
        }

        public a a() {
            Bundle bundle = new Bundle();
            bundle.putParcelable("DEEP_COPY_VALIDATOR_KEY", this.f3829d);
            l lVarL = l.l(this.f3826a);
            l lVarL2 = l.l(this.f3827b);
            c cVar = (c) bundle.getParcelable("DEEP_COPY_VALIDATOR_KEY");
            Long l2 = this.f3828c;
            return new a(lVarL, lVarL2, cVar, l2 == null ? null : l.l(l2.longValue()), null);
        }

        public b b(long j3) {
            this.f3828c = Long.valueOf(j3);
            return this;
        }
    }

    /* JADX INFO: compiled from: CalendarConstraints.java */
    public interface c extends Parcelable {
        boolean e(long j3);
    }

    /* synthetic */ a(l lVar, l lVar2, c cVar, l lVar3, C0048a c0048a) {
        this(lVar, lVar2, cVar, lVar3);
    }

    @Override // android.os.Parcelable
    public int describeContents() {
        return 0;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof a)) {
            return false;
        }
        a aVar = (a) obj;
        return this.f3818e.equals(aVar.f3818e) && this.f3819f.equals(aVar.f3819f) && androidx.core.util.c.a(this.f3821h, aVar.f3821h) && this.f3820g.equals(aVar.f3820g);
    }

    public int hashCode() {
        return Arrays.hashCode(new Object[]{this.f3818e, this.f3819f, this.f3821h, this.f3820g});
    }

    l n(l lVar) {
        return lVar.compareTo(this.f3818e) < 0 ? this.f3818e : lVar.compareTo(this.f3819f) > 0 ? this.f3819f : lVar;
    }

    public c o() {
        return this.f3820g;
    }

    l p() {
        return this.f3819f;
    }

    int q() {
        return this.f3823j;
    }

    l r() {
        return this.f3821h;
    }

    l s() {
        return this.f3818e;
    }

    int t() {
        return this.f3822i;
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i3) {
        parcel.writeParcelable(this.f3818e, 0);
        parcel.writeParcelable(this.f3819f, 0);
        parcel.writeParcelable(this.f3821h, 0);
        parcel.writeParcelable(this.f3820g, 0);
    }

    private a(l lVar, l lVar2, c cVar, l lVar3) {
        this.f3818e = lVar;
        this.f3819f = lVar2;
        this.f3821h = lVar3;
        this.f3820g = cVar;
        if (lVar3 != null && lVar.compareTo(lVar3) > 0) {
            throw new IllegalArgumentException("start Month cannot be after current Month");
        }
        if (lVar3 != null && lVar3.compareTo(lVar2) > 0) {
            throw new IllegalArgumentException("current Month cannot be after end Month");
        }
        this.f3823j = lVar.t(lVar2) + 1;
        this.f3822i = (lVar2.f3899g - lVar.f3899g) + 1;
    }
}
