package com.revenuecat.purchases;

import android.os.Parcel;
import android.os.Parcelable;
import androidx.media3.exoplayer.DecoderReuseEvaluation;
import com.revenuecat.purchases.models.RawDataContainer;
import com.revenuecat.purchases.utils.JSONObjectParceler;
import java.util.Date;
import kotlin.jvm.internal.h;
import kotlin.jvm.internal.o;
import org.json.JSONObject;
import q.AbstractC2761L;
import w4.InterfaceC3141c;

/* JADX INFO: loaded from: classes3.dex */
public final class EntitlementInfo implements Parcelable, RawDataContainer<JSONObject> {
    public static final Parcelable.Creator<EntitlementInfo> CREATOR = new Creator();
    private final Date billingIssueDetectedAt;
    private final Date expirationDate;
    private final String identifier;
    private final boolean isActive;
    private final boolean isSandbox;
    private final JSONObject jsonObject;
    private final Date latestPurchaseDate;
    private final Date originalPurchaseDate;
    private final OwnershipType ownershipType;
    private final PeriodType periodType;
    private final String productIdentifier;
    private final String productPlanIdentifier;
    private final Store store;
    private final Date unsubscribeDetectedAt;
    private final VerificationResult verification;
    private final boolean willRenew;

    public static final class Creator implements Parcelable.Creator<EntitlementInfo> {
        /* JADX WARN: Can't rename method to resolve collision */
        @Override // android.os.Parcelable.Creator
        public final EntitlementInfo createFromParcel(Parcel parcel) {
            boolean z6;
            boolean z7;
            o.h(parcel, "parcel");
            String string = parcel.readString();
            boolean z8 = false;
            boolean z9 = true;
            if (parcel.readInt() != 0) {
                z6 = false;
                z8 = true;
            } else {
                z6 = false;
            }
            if (parcel.readInt() != 0) {
                z7 = true;
            } else {
                z7 = true;
                z9 = z6;
            }
            PeriodType periodTypeValueOf = PeriodType.valueOf(parcel.readString());
            Date date = (Date) parcel.readSerializable();
            Date date2 = (Date) parcel.readSerializable();
            Date date3 = (Date) parcel.readSerializable();
            Store storeValueOf = Store.valueOf(parcel.readString());
            String string2 = parcel.readString();
            boolean z10 = z7;
            String string3 = parcel.readString();
            if (parcel.readInt() == 0) {
                z10 = z6;
            }
            return new EntitlementInfo(string, z8, z9, periodTypeValueOf, date, date2, date3, storeValueOf, string2, string3, z10, (Date) parcel.readSerializable(), (Date) parcel.readSerializable(), OwnershipType.valueOf(parcel.readString()), JSONObjectParceler.INSTANCE.create(parcel), VerificationResult.valueOf(parcel.readString()));
        }

        /* JADX WARN: Can't rename method to resolve collision */
        @Override // android.os.Parcelable.Creator
        public final EntitlementInfo[] newArray(int i6) {
            return new EntitlementInfo[i6];
        }
    }

    public EntitlementInfo(String identifier, boolean z6, boolean z7, PeriodType periodType, Date latestPurchaseDate, Date originalPurchaseDate, Date date, Store store, String productIdentifier, String str, boolean z8, Date date2, Date date3, OwnershipType ownershipType, JSONObject jsonObject, VerificationResult verification) {
        o.h(identifier, "identifier");
        o.h(periodType, "periodType");
        o.h(latestPurchaseDate, "latestPurchaseDate");
        o.h(originalPurchaseDate, "originalPurchaseDate");
        o.h(store, "store");
        o.h(productIdentifier, "productIdentifier");
        o.h(ownershipType, "ownershipType");
        o.h(jsonObject, "jsonObject");
        o.h(verification, "verification");
        this.identifier = identifier;
        this.isActive = z6;
        this.willRenew = z7;
        this.periodType = periodType;
        this.latestPurchaseDate = latestPurchaseDate;
        this.originalPurchaseDate = originalPurchaseDate;
        this.expirationDate = date;
        this.store = store;
        this.productIdentifier = productIdentifier;
        this.productPlanIdentifier = str;
        this.isSandbox = z8;
        this.unsubscribeDetectedAt = date2;
        this.billingIssueDetectedAt = date3;
        this.ownershipType = ownershipType;
        this.jsonObject = jsonObject;
        this.verification = verification;
    }

    public static /* synthetic */ void getRawData$annotations() {
    }

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

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!EntitlementInfo.class.equals(obj != null ? obj.getClass() : null)) {
            return false;
        }
        o.f(obj, "null cannot be cast to non-null type com.revenuecat.purchases.EntitlementInfo");
        EntitlementInfo entitlementInfo = (EntitlementInfo) obj;
        return o.c(this.identifier, entitlementInfo.identifier) && this.isActive == entitlementInfo.isActive && this.willRenew == entitlementInfo.willRenew && this.periodType == entitlementInfo.periodType && o.c(this.latestPurchaseDate, entitlementInfo.latestPurchaseDate) && o.c(this.originalPurchaseDate, entitlementInfo.originalPurchaseDate) && o.c(this.expirationDate, entitlementInfo.expirationDate) && this.store == entitlementInfo.store && o.c(this.productIdentifier, entitlementInfo.productIdentifier) && o.c(this.productPlanIdentifier, entitlementInfo.productPlanIdentifier) && this.isSandbox == entitlementInfo.isSandbox && o.c(this.unsubscribeDetectedAt, entitlementInfo.unsubscribeDetectedAt) && o.c(this.billingIssueDetectedAt, entitlementInfo.billingIssueDetectedAt) && this.ownershipType == entitlementInfo.ownershipType && this.verification == entitlementInfo.verification;
    }

    public final Date getBillingIssueDetectedAt() {
        return this.billingIssueDetectedAt;
    }

    public final Date getExpirationDate() {
        return this.expirationDate;
    }

    public final String getIdentifier() {
        return this.identifier;
    }

    public final Date getLatestPurchaseDate() {
        return this.latestPurchaseDate;
    }

    public final Date getOriginalPurchaseDate() {
        return this.originalPurchaseDate;
    }

    public final OwnershipType getOwnershipType() {
        return this.ownershipType;
    }

    public final PeriodType getPeriodType() {
        return this.periodType;
    }

    public final String getProductIdentifier() {
        return this.productIdentifier;
    }

    public final String getProductPlanIdentifier() {
        return this.productPlanIdentifier;
    }

    public final Store getStore() {
        return this.store;
    }

    public final Date getUnsubscribeDetectedAt() {
        return this.unsubscribeDetectedAt;
    }

    public final VerificationResult getVerification() {
        return this.verification;
    }

    public final boolean getWillRenew() {
        return this.willRenew;
    }

    public int hashCode() {
        int iHashCode = (this.originalPurchaseDate.hashCode() + ((this.latestPurchaseDate.hashCode() + ((this.periodType.hashCode() + com.google.android.recaptcha.internal.a.f(com.google.android.recaptcha.internal.a.f(this.identifier.hashCode() * 31, 31, this.isActive), 31, this.willRenew)) * 31)) * 31)) * 31;
        Date date = this.expirationDate;
        int iB = AbstractC2761L.b((this.store.hashCode() + ((iHashCode + (date != null ? date.hashCode() : 0)) * 31)) * 31, 31, this.productIdentifier);
        String str = this.productPlanIdentifier;
        int iF = com.google.android.recaptcha.internal.a.f((iB + (str != null ? str.hashCode() : 0)) * 31, 31, this.isSandbox);
        Date date2 = this.unsubscribeDetectedAt;
        int iHashCode2 = (iF + (date2 != null ? date2.hashCode() : 0)) * 31;
        Date date3 = this.billingIssueDetectedAt;
        return this.ownershipType.hashCode() + ((iHashCode2 + (date3 != null ? date3.hashCode() : 0)) * 31);
    }

    public final boolean isActive() {
        return this.isActive;
    }

    public final boolean isSandbox() {
        return this.isSandbox;
    }

    public String toString() {
        return "EntitlementInfo(identifier='" + this.identifier + "', isActive=" + this.isActive + ", willRenew=" + this.willRenew + ", periodType=" + this.periodType + ", latestPurchaseDate=" + this.latestPurchaseDate + ", originalPurchaseDate=" + this.originalPurchaseDate + ", expirationDate=" + this.expirationDate + ", store=" + this.store + ", productIdentifier='" + this.productIdentifier + "', productPlanIdentifier='" + this.productPlanIdentifier + "', isSandbox=" + this.isSandbox + ", unsubscribeDetectedAt=" + this.unsubscribeDetectedAt + ", billingIssueDetectedAt=" + this.billingIssueDetectedAt + ", ownershipType=" + this.ownershipType + ", verification=" + this.verification + ')';
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel out, int i6) {
        o.h(out, "out");
        out.writeString(this.identifier);
        out.writeInt(this.isActive ? 1 : 0);
        out.writeInt(this.willRenew ? 1 : 0);
        out.writeString(this.periodType.name());
        out.writeSerializable(this.latestPurchaseDate);
        out.writeSerializable(this.originalPurchaseDate);
        out.writeSerializable(this.expirationDate);
        out.writeString(this.store.name());
        out.writeString(this.productIdentifier);
        out.writeString(this.productPlanIdentifier);
        out.writeInt(this.isSandbox ? 1 : 0);
        out.writeSerializable(this.unsubscribeDetectedAt);
        out.writeSerializable(this.billingIssueDetectedAt);
        out.writeString(this.ownershipType.name());
        JSONObjectParceler.INSTANCE.write(this.jsonObject, out, i6);
        out.writeString(this.verification.name());
    }

    @Override // com.revenuecat.purchases.models.RawDataContainer
    public JSONObject getRawData() {
        return this.jsonObject;
    }

    public /* synthetic */ EntitlementInfo(String str, boolean z6, boolean z7, PeriodType periodType, Date date, Date date2, Date date3, Store store, String str2, String str3, boolean z8, Date date4, Date date5, OwnershipType ownershipType, JSONObject jSONObject, VerificationResult verificationResult, int i6, h hVar) {
        this(str, z6, z7, periodType, date, date2, date3, store, str2, str3, z8, date4, date5, ownershipType, jSONObject, (i6 & DecoderReuseEvaluation.DISCARD_REASON_AUDIO_BYPASS_POSSIBLE) != 0 ? VerificationResult.NOT_REQUESTED : verificationResult);
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    @InterfaceC3141c
    public EntitlementInfo(String identifier, boolean z6, boolean z7, PeriodType periodType, Date latestPurchaseDate, Date originalPurchaseDate, Date date, Store store, String productIdentifier, String str, boolean z8, Date date2, Date date3, OwnershipType ownershipType, JSONObject jsonObject) {
        this(identifier, z6, z7, periodType, latestPurchaseDate, originalPurchaseDate, date, store, productIdentifier, str, z8, date2, date3, ownershipType, jsonObject, VerificationResult.NOT_REQUESTED);
        o.h(identifier, "identifier");
        o.h(periodType, "periodType");
        o.h(latestPurchaseDate, "latestPurchaseDate");
        o.h(originalPurchaseDate, "originalPurchaseDate");
        o.h(store, "store");
        o.h(productIdentifier, "productIdentifier");
        o.h(ownershipType, "ownershipType");
        o.h(jsonObject, "jsonObject");
    }
}
