package I2;

import com.revenuecat.purchases.common.diagnostics.DiagnosticsEntry;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/* JADX INFO: renamed from: I2.t, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0335t {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f2659a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final String f2660b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final String f2661c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final C0334s f2662d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final ArrayList f2663e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final C0332p f2664f;

    public C0335t(JSONObject jSONObject) throws JSONException {
        this.f2659a = jSONObject.optString("basePlanId");
        String strOptString = jSONObject.optString("offerId");
        this.f2660b = true == strOptString.isEmpty() ? null : strOptString;
        this.f2661c = jSONObject.getString("offerIdToken");
        this.f2662d = new C0334s(jSONObject.getJSONArray("pricingPhases"));
        JSONObject jSONObjectOptJSONObject = jSONObject.optJSONObject("installmentPlanDetails");
        this.f2664f = jSONObjectOptJSONObject != null ? new C0332p(jSONObjectOptJSONObject) : null;
        JSONObject jSONObjectOptJSONObject2 = jSONObject.optJSONObject("transitionPlanDetails");
        if (jSONObjectOptJSONObject2 != null) {
            jSONObjectOptJSONObject2.getString("productId");
            jSONObjectOptJSONObject2.optString("title");
            jSONObjectOptJSONObject2.optString(DiagnosticsEntry.NAME_KEY);
            jSONObjectOptJSONObject2.optString("description");
            jSONObjectOptJSONObject2.optString("basePlanId");
            JSONObject jSONObjectOptJSONObject3 = jSONObjectOptJSONObject2.optJSONObject("pricingPhase");
            if (jSONObjectOptJSONObject3 != null) {
                jSONObjectOptJSONObject3.optString("billingPeriod");
                jSONObjectOptJSONObject3.optString("priceCurrencyCode");
                jSONObjectOptJSONObject3.optString("formattedPrice");
                jSONObjectOptJSONObject3.optLong("priceAmountMicros");
                jSONObjectOptJSONObject3.optInt("recurrenceMode");
                jSONObjectOptJSONObject3.optInt("billingCycleCount");
            }
        }
        ArrayList arrayList = new ArrayList();
        JSONArray jSONArrayOptJSONArray = jSONObject.optJSONArray("offerTags");
        if (jSONArrayOptJSONArray != null) {
            for (int i6 = 0; i6 < jSONArrayOptJSONArray.length(); i6++) {
                arrayList.add(jSONArrayOptJSONArray.getString(i6));
            }
        }
        this.f2663e = arrayList;
    }
}
