package com.vungle.warren.model; import android.text.TextUtils; import android.util.Log; import android.util.Pair; import android.webkit.URLUtil; import com.google.android.gms.ads.RequestConfiguration; import com.google.android.gms.common.internal.ImagesContract; import com.unity3d.services.core.device.MimeTypes; import com.vungle.warren.AdConfig; import com.vungle.warren.VungleLogger; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.TreeSet; import n9.y; import org.json.JSONException; import org.json.JSONObject; /* loaded from: classes2.dex */ public class c implements Comparable { /* renamed from: b0, reason: collision with root package name */ private static final Collection f8309b0 = Arrays.asList("play_percentage", "checkpoint.0", "checkpoint.25", "checkpoint.50", "checkpoint.75", "checkpoint.100"); /* renamed from: c0, reason: collision with root package name */ private static final String[] f8310c0 = new String[0]; Map A; Map B; Map C; Map D; String E; String F; boolean G; String H; boolean I; String J; String K; boolean L; int M; String N; long O; String P; public long Q; public long V; public long W; long X; boolean Y; public boolean Z; /* renamed from: a, reason: collision with root package name */ private z4.e f8311a; /* renamed from: a0, reason: collision with root package name */ private List f8312a0; /* renamed from: b, reason: collision with root package name */ int f8313b; /* renamed from: c, reason: collision with root package name */ String f8314c; /* renamed from: d, reason: collision with root package name */ String f8315d; /* renamed from: e, reason: collision with root package name */ long f8316e; /* renamed from: f, reason: collision with root package name */ List f8317f; /* renamed from: g, reason: collision with root package name */ Map f8318g; /* renamed from: h, reason: collision with root package name */ int f8319h; /* renamed from: i, reason: collision with root package name */ String f8320i; /* renamed from: j, reason: collision with root package name */ int f8321j; /* renamed from: k, reason: collision with root package name */ int f8322k; /* renamed from: l, reason: collision with root package name */ int f8323l; /* renamed from: m, reason: collision with root package name */ String f8324m; /* renamed from: n, reason: collision with root package name */ int f8325n; /* renamed from: o, reason: collision with root package name */ int f8326o; /* renamed from: p, reason: collision with root package name */ String f8327p; /* renamed from: q, reason: collision with root package name */ String f8328q; /* renamed from: r, reason: collision with root package name */ boolean f8329r; /* renamed from: s, reason: collision with root package name */ boolean f8330s; /* renamed from: t, reason: collision with root package name */ String f8331t; /* renamed from: u, reason: collision with root package name */ String f8332u; /* renamed from: v, reason: collision with root package name */ AdConfig f8333v; /* renamed from: w, reason: collision with root package name */ int f8334w; /* renamed from: x, reason: collision with root package name */ String f8335x; /* renamed from: y, reason: collision with root package name */ String f8336y; /* renamed from: z, reason: collision with root package name */ String f8337z; c() { this.f8311a = new z4.e(); this.f8318g = new b5.h(); this.f8330s = true; this.B = new HashMap(); this.C = new HashMap(); this.D = new HashMap(); this.M = 0; this.Z = false; this.f8312a0 = new ArrayList(); } private boolean M(String str) { return (TextUtils.isEmpty(str) || y.q(str) == null) ? false : true; } public int A() { return this.M; } String B() { return this.E; } public String C() { return this.F; } public String[] D(String str) { String str2 = "Unknown TPAT Event " + str; ArrayList arrayList = (ArrayList) this.f8318g.get(str); int i10 = this.f8313b; if (i10 == 0) { if (arrayList != null) { return (String[]) arrayList.toArray(f8310c0); } VungleLogger.j(c.class.getSimpleName() + "#getTpatUrls", str2); return f8310c0; } if (i10 != 1) { throw new IllegalStateException("Unknown Advertisement Type!"); } if (str.startsWith("checkpoint")) { String[] strArr = f8310c0; a aVar = (a) this.f8317f.get(Integer.parseInt(str.split("\\.")[1]) / 25); return aVar != null ? aVar.c() : strArr; } if (arrayList != null) { return (String[]) arrayList.toArray(f8310c0); } VungleLogger.j(c.class.getSimpleName() + "#getTpatUrls", str2); return f8310c0; } public long E() { return this.O; } String F() { return this.f8324m; } public List G() { return this.f8312a0; } public boolean H() { return !TextUtils.isEmpty(this.f8328q); } public boolean I() { return this.Y; } public boolean J() { return this.f8329r; } public boolean K() { return this.L; } public boolean L() { return "native".equals(this.F); } public void N(long j10) { this.W = j10; } public void O(long j10) { this.Q = j10; } public void P(long j10) { this.V = j10 - this.Q; this.O = j10 - this.W; } public void Q(boolean z10) { this.L = z10; } public void R(String str, String str2, String str3, String str4) { if (!TextUtils.isEmpty(str)) { this.D.put("INCENTIVIZED_TITLE_TEXT", str); } if (!TextUtils.isEmpty(str2)) { this.D.put("INCENTIVIZED_BODY_TEXT", str2); } if (!TextUtils.isEmpty(str3)) { this.D.put("INCENTIVIZED_CONTINUE_TEXT", str3); } if (TextUtils.isEmpty(str4)) { return; } this.D.put("INCENTIVIZED_CLOSE_TEXT", str4); } public void S(File file) { for (Map.Entry entry : this.C.entrySet()) { String str = (String) ((Pair) entry.getValue()).first; if (M(str)) { File file2 = new File(file, URLUtil.guessFileName(str, null, null)); if (file2.exists()) { this.B.put(entry.getKey(), "file://" + file2.getPath()); } } } this.Z = true; } public void T(String str) { this.N = str; } public void U(int i10) { this.M = i10; } void V(List list) { if (list == null) { this.f8312a0.clear(); } else { this.f8312a0 = list; } } public void W(List list) { for (Map.Entry entry : this.C.entrySet()) { String str = (String) ((Pair) entry.getValue()).first; Iterator it = list.iterator(); while (true) { if (it.hasNext()) { com.vungle.warren.model.a aVar = (com.vungle.warren.model.a) it.next(); if (!TextUtils.isEmpty(aVar.f8302d) && aVar.f8302d.equals(str)) { File file = new File(aVar.f8303e); if (file.exists()) { this.B.put(entry.getKey(), "file://" + file.getPath()); } } } } } } @Override // java.lang.Comparable /* renamed from: a, reason: merged with bridge method [inline-methods] */ public int compareTo(c cVar) { if (cVar == null) { return 1; } String str = cVar.f8314c; if (str == null) { return this.f8314c == null ? 0 : 1; } String str2 = this.f8314c; if (str2 == null) { return -1; } return str2.compareTo(str); } public void b(AdConfig adConfig) { if (adConfig == null) { this.f8333v = new AdConfig(); } else { this.f8333v = adConfig; } } public z4.k c() { Map u10 = u(); z4.k kVar = new z4.k(); for (Map.Entry entry : u10.entrySet()) { kVar.r((String) entry.getKey(), (String) entry.getValue()); } VungleLogger.i(true, "Advertisement", "mraid_args", kVar.toString()); return kVar; } public AdConfig d() { return this.f8333v; } public String e() { return this.f8335x; } public boolean equals(Object obj) { String str; String str2; if (this == obj) { return true; } if (!(obj instanceof c)) { return false; } c cVar = (c) obj; if (cVar.f8313b != this.f8313b || cVar.f8319h != this.f8319h || cVar.f8321j != this.f8321j || cVar.f8322k != this.f8322k || cVar.f8323l != this.f8323l || cVar.f8325n != this.f8325n || cVar.f8326o != this.f8326o || cVar.f8329r != this.f8329r || cVar.f8330s != this.f8330s || cVar.f8334w != this.f8334w || cVar.G != this.G || cVar.I != this.I || cVar.M != this.M || (str = cVar.f8314c) == null || (str2 = this.f8314c) == null || !str.equals(str2) || !cVar.f8320i.equals(this.f8320i) || !cVar.f8324m.equals(this.f8324m) || !cVar.f8327p.equals(this.f8327p) || !cVar.f8328q.equals(this.f8328q) || !cVar.f8331t.equals(this.f8331t) || !cVar.f8332u.equals(this.f8332u) || !cVar.f8335x.equals(this.f8335x) || !cVar.f8336y.equals(this.f8336y)) { return false; } String str3 = cVar.H; if (str3 == null ? this.H != null : !str3.equals(this.H)) { return false; } if (!cVar.J.equals(this.J) || !cVar.K.equals(this.K) || cVar.f8317f.size() != this.f8317f.size()) { return false; } for (int i10 = 0; i10 < this.f8317f.size(); i10++) { if (!((a) cVar.f8317f.get(i10)).equals(this.f8317f.get(i10))) { return false; } } return this.f8318g.equals(cVar.f8318g) && cVar.X == this.X && cVar.Y == this.Y && cVar.L == this.L; } public int f() { return this.f8313b; } public String g() { String h10 = h(); String h11 = h(); if (h11 != null && h11.length() > 3) { try { JSONObject jSONObject = new JSONObject(h11.substring(3)); h10 = jSONObject.isNull("app_id") ? null : jSONObject.optString("app_id", null); } catch (JSONException e10) { Log.e("Advertisement", "JsonException : ", e10); } } return TextUtils.isEmpty(h10) ? "unknown" : h10; } public String h() { return this.f8315d; } public int hashCode() { return (((((int) ((((((((((((((((((((((((((((((((((((((((((((((((((((((((this.f8313b * 31) + com.vungle.warren.utility.l.a(this.f8314c)) * 31) + com.vungle.warren.utility.l.a(this.f8317f)) * 31) + com.vungle.warren.utility.l.a(this.f8318g)) * 31) + this.f8319h) * 31) + com.vungle.warren.utility.l.a(this.f8320i)) * 31) + this.f8321j) * 31) + this.f8322k) * 31) + this.f8323l) * 31) + com.vungle.warren.utility.l.a(this.f8324m)) * 31) + this.f8325n) * 31) + this.f8326o) * 31) + com.vungle.warren.utility.l.a(this.f8327p)) * 31) + com.vungle.warren.utility.l.a(this.f8328q)) * 31) + (this.f8329r ? 1 : 0)) * 31) + (this.f8330s ? 1 : 0)) * 31) + com.vungle.warren.utility.l.a(this.f8331t)) * 31) + com.vungle.warren.utility.l.a(this.f8332u)) * 31) + this.f8334w) * 31) + com.vungle.warren.utility.l.a(this.f8335x)) * 31) + com.vungle.warren.utility.l.a(this.f8336y)) * 31) + com.vungle.warren.utility.l.a(this.f8312a0)) * 31) + (this.G ? 1 : 0)) * 31) + com.vungle.warren.utility.l.a(this.H)) * 31) + (this.I ? 1 : 0)) * 31) + com.vungle.warren.utility.l.a(this.J)) * 31) + com.vungle.warren.utility.l.a(this.K)) * 31) + this.M) * 31) + this.X)) * 31) + (this.Y ? 1 : 0)) * 31) + (this.L ? 1 : 0); } public long i() { return this.V; } public String j() { return this.K; } public String k(boolean z10) { int i10 = this.f8313b; if (i10 == 0) { return z10 ? this.f8332u : this.f8331t; } if (i10 == 1) { return this.f8332u; } throw new IllegalArgumentException("Unknown AdType " + this.f8313b); } public String l() { return this.f8320i; } /* JADX WARN: Removed duplicated region for block: B:10:? A[RETURN, SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:8:0x001f A[ORIG_RETURN, RETURN] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public java.lang.String m() { /* r3 = this; java.lang.String r0 = r3.l() boolean r1 = android.text.TextUtils.isEmpty(r0) if (r1 != 0) goto L18 java.lang.String r1 = "\\|" java.lang.String[] r0 = r0.split(r1) int r1 = r0.length r2 = 1 if (r1 < r2) goto L18 r1 = 0 r0 = r0[r1] goto L19 L18: r0 = 0 L19: boolean r1 = android.text.TextUtils.isEmpty(r0) if (r1 == 0) goto L21 java.lang.String r0 = "unknown" L21: return r0 */ throw new UnsupportedOperationException("Method not decompiled: com.vungle.warren.model.c.m():java.lang.String"); } public List n() { return this.f8317f; } /* JADX WARN: Removed duplicated region for block: B:10:? A[RETURN, SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:8:0x001f A[ORIG_RETURN, RETURN] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public java.lang.String o() { /* r3 = this; java.lang.String r0 = r3.l() boolean r1 = android.text.TextUtils.isEmpty(r0) if (r1 != 0) goto L18 java.lang.String r1 = "\\|" java.lang.String[] r0 = r0.split(r1) int r1 = r0.length r2 = 2 if (r1 < r2) goto L18 r1 = 1 r0 = r0[r1] goto L19 L18: r0 = 0 L19: boolean r1 = android.text.TextUtils.isEmpty(r0) if (r1 == 0) goto L21 java.lang.String r0 = "unknown" L21: return r0 */ throw new UnsupportedOperationException("Method not decompiled: com.vungle.warren.model.c.o():java.lang.String"); } public boolean p() { return this.f8330s; } public String q() { return this.P; } public Map r() { HashMap hashMap = new HashMap(); int i10 = this.f8313b; if (i10 == 0) { hashMap.put(MimeTypes.BASE_TYPE_VIDEO, this.f8324m); if (!TextUtils.isEmpty(this.f8328q)) { hashMap.put("postroll", this.f8328q); } } else { if (i10 != 1) { throw new IllegalStateException("Advertisement created without adType!"); } if (!L()) { hashMap.put("template", this.f8337z); } Iterator it = this.C.entrySet().iterator(); while (it.hasNext()) { String str = (String) ((Pair) ((Map.Entry) it.next()).getValue()).first; if (M(str)) { hashMap.put(URLUtil.guessFileName(str, null, null), str); } } } return hashMap; } public long s() { return this.f8316e * 1000; } public String t() { String str = this.f8314c; return str == null ? RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED : str; } public String toString() { return "Advertisement{adType=" + this.f8313b + ", identifier='" + this.f8314c + "', appID='" + this.f8315d + "', expireTime=" + this.f8316e + ", checkpoints=" + this.f8311a.t(this.f8317f, d.f8340f) + ", winNotifications='" + TextUtils.join(",", this.f8312a0) + ", dynamicEventsAndUrls=" + this.f8311a.t(this.f8318g, d.f8341g) + ", delay=" + this.f8319h + ", campaign='" + this.f8320i + "', showCloseDelay=" + this.f8321j + ", showCloseIncentivized=" + this.f8322k + ", countdown=" + this.f8323l + ", videoUrl='" + this.f8324m + "', videoWidth=" + this.f8325n + ", videoHeight=" + this.f8326o + ", md5='" + this.f8327p + "', postrollBundleUrl='" + this.f8328q + "', ctaOverlayEnabled=" + this.f8329r + ", ctaClickArea=" + this.f8330s + ", ctaDestinationUrl='" + this.f8331t + "', ctaUrl='" + this.f8332u + "', adConfig=" + this.f8333v + ", retryCount=" + this.f8334w + ", adToken='" + this.f8335x + "', videoIdentifier='" + this.f8336y + "', templateUrl='" + this.f8337z + "', templateSettings=" + this.A + ", mraidFiles=" + this.B + ", cacheableAssets=" + this.C + ", templateId='" + this.E + "', templateType='" + this.F + "', enableOm=" + this.G + ", oMSDKExtraVast='" + this.H + "', requiresNonMarketInstall=" + this.I + ", adMarketId='" + this.J + "', bidToken='" + this.K + "', state=" + this.M + "', assetDownloadStartTime='" + this.Q + "', assetDownloadDuration='" + this.V + "', adRequestStartTime='" + this.W + "', requestTimestamp='" + this.X + "', headerBidding='" + this.L + '}'; } public Map u() { if (this.A == null) { throw new IllegalArgumentException("Advertisement does not have MRAID Arguments!"); } HashMap hashMap = new HashMap(this.A); for (Map.Entry entry : this.C.entrySet()) { hashMap.put(entry.getKey(), ((Pair) entry.getValue()).first); } if (!this.B.isEmpty()) { hashMap.putAll(this.B); } if (!this.D.isEmpty()) { hashMap.putAll(this.D); } if (!"true".equalsIgnoreCase((String) hashMap.get("START_MUTED"))) { hashMap.put("START_MUTED", (d().b() & 1) == 0 ? "false" : "true"); } return hashMap; } public boolean v() { return this.G; } public int w() { return this.f8325n > this.f8326o ? 1 : 0; } public String x() { return this.N; } public long y() { return this.X; } public int z(boolean z10) { return (z10 ? this.f8322k : this.f8321j) * 1000; } public c(z4.k kVar) { String j10; this.f8311a = new z4.e(); this.f8318g = new b5.h(); this.f8330s = true; this.B = new HashMap(); this.C = new HashMap(); this.D = new HashMap(); this.M = 0; this.Z = false; this.f8312a0 = new ArrayList(); if (m.e(kVar, "ad_markup")) { z4.k w10 = kVar.w("ad_markup"); if (m.e(w10, "adType")) { String j11 = w10.u("adType").j(); j11.hashCode(); if (j11.equals("vungle_local")) { this.f8313b = 0; this.f8328q = m.e(w10, "postBundle") ? w10.u("postBundle").j() : RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; j10 = m.e(w10, ImagesContract.URL) ? w10.u(ImagesContract.URL).j() : RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; this.A = new HashMap(); this.f8337z = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; this.E = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; this.F = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } else if (j11.equals("vungle_mraid")) { this.f8313b = 1; this.f8328q = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; if (m.e(w10, "templateSettings")) { this.A = new HashMap(); z4.k w11 = w10.w("templateSettings"); if (m.e(w11, "normal_replacements")) { for (Map.Entry entry : w11.w("normal_replacements").t()) { if (!TextUtils.isEmpty((CharSequence) entry.getKey())) { this.A.put(entry.getKey(), (entry.getValue() == null || ((z4.h) entry.getValue()).l()) ? null : ((z4.h) entry.getValue()).j()); } } } if (m.e(w11, "cacheable_replacements")) { j10 = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; for (Map.Entry entry2 : w11.w("cacheable_replacements").t()) { if (!TextUtils.isEmpty((CharSequence) entry2.getKey()) && entry2.getValue() != null && m.e((z4.h) entry2.getValue(), ImagesContract.URL) && m.e((z4.h) entry2.getValue(), "extension")) { String j12 = ((z4.h) entry2.getValue()).g().u(ImagesContract.URL).j(); this.C.put(entry2.getKey(), new Pair(j12, ((z4.h) entry2.getValue()).g().u("extension").j())); if (((String) entry2.getKey()).equalsIgnoreCase("MAIN_VIDEO")) { j10 = j12; } } } } else { j10 = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } if (m.e(w10, "templateId")) { this.E = w10.u("templateId").j(); if (m.e(w10, "template_type")) { this.F = w10.u("template_type").j(); if (!L()) { if (m.e(w10, "templateURL")) { this.f8337z = w10.u("templateURL").j(); } else { throw new IllegalArgumentException("Template URL missing!"); } } } else { throw new IllegalArgumentException("Template Type missing!"); } } else { throw new IllegalArgumentException("Missing templateID!"); } } else { throw new IllegalArgumentException("Missing template adConfig!"); } } else { throw new IllegalArgumentException("Unknown Ad Type " + j11 + "! Please add this ad type"); } if (!TextUtils.isEmpty(j10)) { this.f8324m = j10; } else { this.f8324m = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } if (m.e(w10, "deeplinkUrl")) { this.P = w10.u("deeplinkUrl").j(); } if (m.e(w10, "id")) { this.f8314c = w10.u("id").j(); if (m.e(w10, "campaign")) { this.f8320i = w10.u("campaign").j(); if (m.e(w10, "app_id")) { this.f8315d = w10.u("app_id").j(); if (m.e(w10, "expiry") && !w10.u("expiry").l()) { long i10 = w10.u("expiry").i(); if (i10 > 0) { this.f8316e = i10; } else { this.f8316e = System.currentTimeMillis() / 1000; } } else { this.f8316e = System.currentTimeMillis() / 1000; } if (m.e(w10, "notification")) { Iterator it = w10.v("notification").iterator(); while (it.hasNext()) { this.f8312a0.add(((z4.h) it.next()).j()); } } if (m.e(w10, "tpat")) { z4.k w12 = w10.w("tpat"); this.f8317f = new ArrayList(5); int i11 = this.f8313b; if (i11 != 0) { if (i11 != 1) { throw new IllegalArgumentException("Unknown Ad Type!"); } for (int i12 = 0; i12 < 5; i12++) { int i13 = i12 * 25; String format = String.format(Locale.ENGLISH, "checkpoint.%d", Integer.valueOf(i13)); this.f8317f.add(i12, m.e(w12, format) ? new a(w12.v(format), (byte) i13) : null); } } else if (m.e(w12, "play_percentage")) { z4.g v10 = w12.v("play_percentage"); for (int i14 = 0; i14 < v10.size(); i14++) { if (v10.r(i14) != null) { this.f8317f.add(new a(v10.r(i14).g())); } } Collections.sort(this.f8317f); } TreeSet treeSet = new TreeSet(w12.y()); treeSet.remove("moat"); treeSet.removeAll(f8309b0); if (!treeSet.isEmpty()) { for (String str : treeSet) { z4.g f10 = w12.u(str).f(); ArrayList arrayList = new ArrayList(); for (int i15 = 0; i15 < f10.size(); i15++) { if (f10.r(i15) != null && !"null".equalsIgnoreCase(f10.r(i15).toString())) { arrayList.add(i15, f10.r(i15).j()); } else { arrayList.add(i15, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } } this.f8318g.put(str, arrayList); } } } else { this.f8317f = new ArrayList(); } if (m.e(w10, "delay")) { this.f8319h = w10.u("delay").e(); } else { this.f8319h = 0; } if (m.e(w10, "showClose")) { this.f8321j = w10.u("showClose").e(); } else { this.f8321j = 0; } if (m.e(w10, "showCloseIncentivized")) { this.f8322k = w10.u("showCloseIncentivized").e(); } else { this.f8322k = 0; } if (m.e(w10, "countdown")) { this.f8323l = w10.u("countdown").e(); } else { this.f8323l = 0; } if (m.e(w10, "videoWidth")) { this.f8325n = w10.u("videoWidth").e(); if (m.e(w10, "videoHeight")) { this.f8326o = w10.u("videoHeight").e(); if (m.e(w10, "md5")) { this.f8327p = w10.u("md5").j(); } else { this.f8327p = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } if (m.e(w10, "cta_overlay")) { z4.k w13 = w10.w("cta_overlay"); if (m.e(w13, "enabled")) { this.f8329r = w13.u("enabled").b(); } else { this.f8329r = false; } if (m.e(w13, "click_area") && !w13.u("click_area").j().isEmpty() && w13.u("click_area").c() == 0.0d) { this.f8330s = false; } } else { this.f8329r = false; } this.f8331t = m.e(w10, "callToActionDest") ? w10.u("callToActionDest").j() : RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; String j13 = m.e(w10, "callToActionUrl") ? w10.u("callToActionUrl").j() : RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; this.f8332u = j13; if (TextUtils.isEmpty(j13)) { this.f8332u = (String) this.A.get("CTA_BUTTON_URL"); } if (m.e(w10, "retryCount")) { this.f8334w = w10.u("retryCount").e(); } else { this.f8334w = 1; } if (m.e(w10, "ad_token")) { this.f8335x = w10.u("ad_token").j(); if (m.e(w10, "video_object_id")) { this.f8336y = w10.u("video_object_id").j(); } else { this.f8336y = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } if (m.e(w10, "requires_sideloading")) { this.I = w10.u("requires_sideloading").b(); } else { this.I = false; } if (m.e(w10, "ad_market_id")) { this.J = w10.u("ad_market_id").j(); } else { this.J = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } if (m.e(w10, "bid_token")) { this.K = w10.u("bid_token").j(); } else { this.K = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } if (m.e(w10, "timestamp")) { this.X = w10.u("timestamp").i(); } else { this.X = 1L; } z4.k c10 = m.c(m.c(w10, "viewability"), "om"); this.G = m.a(c10, "is_enabled", false); this.H = m.d(c10, "extra_vast", null); this.Y = m.a(w10, "click_coordinates_enabled", false); this.f8333v = new AdConfig(); return; } throw new IllegalArgumentException("AdToken missing!"); } throw new IllegalArgumentException("Missing video height!"); } throw new IllegalArgumentException("Missing video width!"); } throw new IllegalArgumentException("Missing app Id, cannot process advertisement!"); } throw new IllegalArgumentException("Missing campaign information, cannot process advertisement!"); } throw new IllegalArgumentException("Missing identifier, cannot process advertisement!"); } throw new IllegalArgumentException("Advertisement did not contain an adType!"); } throw new IllegalArgumentException("JSON does not contain ad markup!"); } public static class a implements Comparable { /* renamed from: a, reason: collision with root package name */ @a5.c("percentage") private byte f8338a; /* renamed from: b, reason: collision with root package name */ @a5.c("urls") private String[] f8339b; public a(z4.k kVar) { if (!m.e(kVar, "checkpoint")) { throw new IllegalArgumentException("Checkpoint missing percentage!"); } this.f8338a = (byte) (kVar.u("checkpoint").d() * 100.0f); if (!m.e(kVar, "urls")) { throw new IllegalArgumentException("Checkpoint missing reporting URL!"); } z4.g v10 = kVar.v("urls"); this.f8339b = new String[v10.size()]; for (int i10 = 0; i10 < v10.size(); i10++) { if (v10.r(i10) == null || "null".equalsIgnoreCase(v10.r(i10).toString())) { this.f8339b[i10] = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } else { this.f8339b[i10] = v10.r(i10).j(); } } } @Override // java.lang.Comparable /* renamed from: a, reason: merged with bridge method [inline-methods] */ public int compareTo(a aVar) { return Float.compare(this.f8338a, aVar.f8338a); } public byte b() { return this.f8338a; } public String[] c() { return (String[]) this.f8339b.clone(); } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof a)) { return false; } a aVar = (a) obj; if (aVar.f8338a != this.f8338a || aVar.f8339b.length != this.f8339b.length) { return false; } int i10 = 0; while (true) { String[] strArr = this.f8339b; if (i10 >= strArr.length) { return true; } if (!aVar.f8339b[i10].equals(strArr[i10])) { return false; } i10++; } } public int hashCode() { int i10 = this.f8338a * 31; String[] strArr = this.f8339b; return ((i10 + strArr.length) * 31) + Arrays.hashCode(strArr); } public a(z4.g gVar, byte b10) { if (gVar.size() != 0) { this.f8339b = new String[gVar.size()]; for (int i10 = 0; i10 < gVar.size(); i10++) { this.f8339b[i10] = gVar.r(i10).j(); } this.f8338a = b10; return; } throw new IllegalArgumentException("Empty URLS!"); } } }