package com.android.billingclient.api; import android.text.TextUtils; import com.android.billingclient.api.f; import com.google.android.gms.internal.play_billing.zzaa; import com.google.android.gms.internal.play_billing.zzai; import java.util.ArrayList; import java.util.List; /* loaded from: classes.dex */ public class c { /* renamed from: a, reason: collision with root package name */ private boolean f3934a; /* renamed from: b, reason: collision with root package name */ private String f3935b; /* renamed from: c, reason: collision with root package name */ private String f3936c; /* renamed from: d, reason: collision with root package name */ private C0063c f3937d; /* renamed from: e, reason: collision with root package name */ private zzai f3938e; /* renamed from: f, reason: collision with root package name */ private ArrayList f3939f; /* renamed from: g, reason: collision with root package name */ private boolean f3940g; public static class a { /* renamed from: a, reason: collision with root package name */ private String f3941a; /* renamed from: b, reason: collision with root package name */ private String f3942b; /* renamed from: c, reason: collision with root package name */ private List f3943c; /* renamed from: d, reason: collision with root package name */ private ArrayList f3944d; /* renamed from: e, reason: collision with root package name */ private boolean f3945e; /* renamed from: f, reason: collision with root package name */ private C0063c.a f3946f; /* synthetic */ a(n1.r rVar) { C0063c.a a10 = C0063c.a(); C0063c.a.b(a10); this.f3946f = a10; } public c a() { ArrayList arrayList = this.f3944d; boolean z10 = (arrayList == null || arrayList.isEmpty()) ? false : true; List list = this.f3943c; boolean z11 = (list == null || list.isEmpty()) ? false : true; if (!z10 && !z11) { throw new IllegalArgumentException("Details of the products must be provided."); } if (z10 && z11) { throw new IllegalArgumentException("Set SkuDetails or ProductDetailsParams, not both."); } n1.x xVar = null; if (!z10) { b bVar = (b) this.f3943c.get(0); for (int i10 = 0; i10 < this.f3943c.size(); i10++) { b bVar2 = (b) this.f3943c.get(i10); if (bVar2 == null) { throw new IllegalArgumentException("ProductDetailsParams cannot be null."); } if (i10 != 0 && !bVar2.b().e().equals(bVar.b().e()) && !bVar2.b().e().equals("play_pass_subs")) { throw new IllegalArgumentException("All products should have same ProductType."); } } String h10 = bVar.b().h(); for (b bVar3 : this.f3943c) { if (!bVar.b().e().equals("play_pass_subs") && !bVar3.b().e().equals("play_pass_subs") && !h10.equals(bVar3.b().h())) { throw new IllegalArgumentException("All products must have the same package name."); } } } else { if (this.f3944d.contains(null)) { throw new IllegalArgumentException("SKU cannot be null."); } if (this.f3944d.size() > 1) { androidx.appcompat.app.m.a(this.f3944d.get(0)); throw null; } } c cVar = new c(xVar); if (z10) { androidx.appcompat.app.m.a(this.f3944d.get(0)); throw null; } cVar.f3934a = z11 && !((b) this.f3943c.get(0)).b().h().isEmpty(); cVar.f3935b = this.f3941a; cVar.f3936c = this.f3942b; cVar.f3937d = this.f3946f.a(); ArrayList arrayList2 = this.f3944d; cVar.f3939f = arrayList2 != null ? new ArrayList(arrayList2) : new ArrayList(); cVar.f3940g = this.f3945e; List list2 = this.f3943c; cVar.f3938e = list2 != null ? zzai.zzj(list2) : zzai.zzk(); return cVar; } public a b(List list) { this.f3943c = new ArrayList(list); return this; } } public static final class b { /* renamed from: a, reason: collision with root package name */ private final f f3947a; /* renamed from: b, reason: collision with root package name */ private final String f3948b; public static class a { /* renamed from: a, reason: collision with root package name */ private f f3949a; /* renamed from: b, reason: collision with root package name */ private String f3950b; /* synthetic */ a(n1.s sVar) { } public b a() { zzaa.zzc(this.f3949a, "ProductDetails is required for constructing ProductDetailsParams."); if (this.f3949a.f() != null) { zzaa.zzc(this.f3950b, "offerToken is required for constructing ProductDetailsParams for subscriptions."); } return new b(this, null); } public a b(String str) { if (TextUtils.isEmpty(str)) { throw new IllegalArgumentException("offerToken can not be empty"); } this.f3950b = str; return this; } public a c(f fVar) { this.f3949a = fVar; if (fVar.c() != null) { fVar.c().getClass(); f.b c10 = fVar.c(); if (c10.b() != null) { this.f3950b = c10.b(); } } return this; } } /* synthetic */ b(a aVar, n1.t tVar) { this.f3947a = aVar.f3949a; this.f3948b = aVar.f3950b; } public static a a() { return new a(null); } public final f b() { return this.f3947a; } public final String c() { return this.f3948b; } } /* renamed from: com.android.billingclient.api.c$c, reason: collision with other inner class name */ public static class C0063c { /* renamed from: a, reason: collision with root package name */ private String f3951a; /* renamed from: b, reason: collision with root package name */ private String f3952b; /* renamed from: c, reason: collision with root package name */ private int f3953c = 0; /* renamed from: com.android.billingclient.api.c$c$a */ public static class a { /* renamed from: a, reason: collision with root package name */ private String f3954a; /* renamed from: b, reason: collision with root package name */ private String f3955b; /* renamed from: c, reason: collision with root package name */ private boolean f3956c; /* renamed from: d, reason: collision with root package name */ private int f3957d = 0; /* synthetic */ a(n1.u uVar) { } static /* synthetic */ a b(a aVar) { aVar.f3956c = true; return aVar; } public C0063c a() { n1.v vVar = null; boolean z10 = (TextUtils.isEmpty(this.f3954a) && TextUtils.isEmpty(null)) ? false : true; boolean isEmpty = true ^ TextUtils.isEmpty(this.f3955b); if (z10 && isEmpty) { throw new IllegalArgumentException("Please provide Old SKU purchase information(token/id) or original external transaction id, not both."); } if (!this.f3956c && !z10 && !isEmpty) { throw new IllegalArgumentException("Old SKU purchase information(token/id) or original external transaction id must be provided."); } C0063c c0063c = new C0063c(vVar); c0063c.f3951a = this.f3954a; c0063c.f3953c = this.f3957d; c0063c.f3952b = this.f3955b; return c0063c; } } /* synthetic */ C0063c(n1.v vVar) { } public static a a() { return new a(null); } final int b() { return this.f3953c; } final String c() { return this.f3951a; } final String d() { return this.f3952b; } } /* synthetic */ c(n1.x xVar) { } public static a a() { return new a(null); } public final int b() { return this.f3937d.b(); } public final String c() { return this.f3935b; } public final String d() { return this.f3936c; } public final String e() { return this.f3937d.c(); } public final String f() { return this.f3937d.d(); } public final ArrayList g() { ArrayList arrayList = new ArrayList(); arrayList.addAll(this.f3939f); return arrayList; } public final List h() { return this.f3938e; } public final boolean p() { return this.f3940g; } final boolean q() { return (this.f3935b == null && this.f3936c == null && this.f3937d.d() == null && this.f3937d.b() == 0 && !this.f3934a && !this.f3940g) ? false : true; } }