package com.bumptech.glide; import com.bumptech.glide.load.ImageHeaderParser; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import o.Box; import o.C0780Okt; import o.C1050UnO; import o.C1239YsJ; import o.C15764iRy; import o.C2582ahN; import o.C9585dmX; import o.HuZ; import o.KFY; import o.KOW; import o.Kpr; import o.QMg; import o.RDy; import o.SCe; import o.Vzp; import o.gaU; import o.gya; import o.iYP; import o.nuW; import o.rIx; import o.raY; import o.yBU; /* loaded from: classes.dex */ public final class Registry { public final C0780Okt a; private final KFY b; public final Kpr c; public final gya d; public final C15764iRy e; private final QMg f; private final C9585dmX g = new C9585dmX(); private final HuZ h = new HuZ(); private final KOW i; private final RDy.Sts> j; public Registry() { RDy.Sts> a = C1050UnO.a(); this.j = a; this.f = new QMg(a); this.d = new gya(); this.b = new KFY(); this.c = new Kpr(); this.e = new C15764iRy(); this.i = new KOW(); this.a = new C0780Okt(); List asList = Arrays.asList("Animation", "Bitmap", "BitmapDrawable"); ArrayList arrayList = new ArrayList(asList.size()); arrayList.add("legacy_prepend_all"); Iterator it = asList.iterator(); while (it.hasNext()) { arrayList.add((String) it.next()); } arrayList.add("legacy_append"); KFY kfy = this.b; synchronized (kfy) { ArrayList arrayList2 = new ArrayList(kfy.c); kfy.c.clear(); Iterator it2 = arrayList.iterator(); while (it2.hasNext()) { kfy.c.add((String) it2.next()); } for (String str : arrayList2) { if (!arrayList.contains(str)) { kfy.c.add(str); } } } } public final Registry d(Class cls, gaU gau) { gya gyaVar = this.d; synchronized (gyaVar) { gyaVar.a.add(new gya.Sts<>(cls, gau)); } return this; } public final Registry b(String str, Class cls, Class cls2, iYP iyp) { KFY kfy = this.b; synchronized (kfy) { kfy.a(str).add(new KFY.IeS<>(cls, cls2, iyp)); } return this; } public final Registry e(Class cls, nuW nuw) { Kpr kpr = this.c; synchronized (kpr) { kpr.e.add(new Kpr.LWm<>(cls, nuw)); } return this; } public final Registry b(Box.HBt hBt) { C15764iRy c15764iRy = this.e; synchronized (c15764iRy) { c15764iRy.d.put(hBt.a(), hBt); } return this; } public final Registry a(Class cls, Class cls2, yBU ybu) { KOW kow = this.i; synchronized (kow) { kow.c.add(new KOW.RVV<>(cls, cls2, ybu)); } return this; } public final Registry d(ImageHeaderParser imageHeaderParser) { C0780Okt c0780Okt = this.a; synchronized (c0780Okt) { c0780Okt.b.add(imageHeaderParser); } return this; } public final Registry c(Class cls, Class cls2, rIx rix) { QMg qMg = this.f; synchronized (qMg) { Vzp vzp = qMg.c; synchronized (vzp) { Vzp.RVV rvv = new Vzp.RVV<>(cls, cls2, rix); List> list = vzp.d; list.add(list.size(), rvv); } qMg.e.a.clear(); } return this; } public final C1239YsJ b(Class cls, Class cls2, Class cls3) { C1239YsJ a = this.h.a(cls, cls2, cls3); if (HuZ.c(a)) { return null; } if (a == null) { ArrayList arrayList = new ArrayList(); for (Class cls4 : this.b.d(cls, cls2)) { for (Class cls5 : this.i.e(cls4, cls3)) { arrayList.add(new C2582ahN(cls, cls4, cls5, this.b.a(cls, cls4), this.i.b(cls4, cls5), this.j)); } } a = arrayList.isEmpty() ? null : new C1239YsJ<>(cls, cls2, cls3, arrayList, this.j); HuZ huZ = this.h; synchronized (huZ.c) { huZ.c.put(new raY(cls, cls2, cls3), a == null ? HuZ.e : a); } } return a; } public final List> d(Class cls, Class cls2, Class cls3) { List> c = this.g.c(cls, cls2, cls3); if (c == null) { c = new ArrayList<>(); Iterator> it = this.f.c(cls).iterator(); while (it.hasNext()) { for (Class cls4 : this.b.d(it.next(), cls2)) { if (!this.i.e(cls4, cls3).isEmpty() && !c.contains(cls4)) { c.add(cls4); } } } C9585dmX c9585dmX = this.g; List> unmodifiableList = Collections.unmodifiableList(c); synchronized (c9585dmX.c) { c9585dmX.c.put(new raY(cls, cls2, cls3), unmodifiableList); } } return c; } /* loaded from: classes.dex */ public static class NoModelLoaderAvailableException extends MissingComponentException { /* JADX WARN: Illegal instructions before constructor call */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public NoModelLoaderAvailableException(java.lang.Object r3) { /* r2 = this; java.lang.StringBuilder r0 = new java.lang.StringBuilder java.lang.String r1 = "Failed to find any ModelLoaders registered for model class: " r0.(r1) java.lang.Class r3 = r3.getClass() r0.append(r3) java.lang.String r3 = r0.toString() r2.(r3) return */ throw new UnsupportedOperationException("Method not decompiled: com.bumptech.glide.Registry.NoModelLoaderAvailableException.(java.lang.Object):void"); } /* JADX WARN: Illegal instructions before constructor call */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public NoModelLoaderAvailableException(M r3, java.util.List> r4) { /* r2 = this; java.lang.StringBuilder r0 = new java.lang.StringBuilder java.lang.String r1 = "Found ModelLoaders for model class: " r0.(r1) r0.append(r4) java.lang.String r4 = ", but none that handle this specific model instance: " r0.append(r4) r0.append(r3) java.lang.String r3 = r0.toString() r2.(r3) return */ throw new UnsupportedOperationException("Method not decompiled: com.bumptech.glide.Registry.NoModelLoaderAvailableException.(java.lang.Object, java.util.List):void"); } /* JADX WARN: Illegal instructions before constructor call */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public NoModelLoaderAvailableException(java.lang.Class r3, java.lang.Class r4) { /* r2 = this; java.lang.StringBuilder r0 = new java.lang.StringBuilder java.lang.String r1 = "Failed to find any ModelLoaders for model: " r0.(r1) r0.append(r3) java.lang.String r3 = " and data: " r0.append(r3) r0.append(r4) java.lang.String r3 = r0.toString() r2.(r3) return */ throw new UnsupportedOperationException("Method not decompiled: com.bumptech.glide.Registry.NoModelLoaderAvailableException.(java.lang.Class, java.lang.Class):void"); } } /* loaded from: classes.dex */ public static class NoResultEncoderAvailableException extends MissingComponentException { /* JADX WARN: Illegal instructions before constructor call */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public NoResultEncoderAvailableException(java.lang.Class r3) { /* r2 = this; java.lang.StringBuilder r0 = new java.lang.StringBuilder java.lang.String r1 = "Failed to find result encoder for resource class: " r0.(r1) r0.append(r3) java.lang.String r3 = ", you may need to consider registering a new Encoder for the requested type or DiskCacheStrategy.DATA/DiskCacheStrategy.NONE if caching your transformed resource is unnecessary." r0.append(r3) java.lang.String r3 = r0.toString() r2.(r3) return */ throw new UnsupportedOperationException("Method not decompiled: com.bumptech.glide.Registry.NoResultEncoderAvailableException.(java.lang.Class):void"); } } /* loaded from: classes.dex */ public static class NoSourceEncoderAvailableException extends MissingComponentException { public NoSourceEncoderAvailableException(Class cls) { super("Failed to find source encoder for data class: ".concat(String.valueOf(cls))); } } /* loaded from: classes.dex */ public static class MissingComponentException extends RuntimeException { public MissingComponentException(String str) { super(str); } } /* loaded from: classes.dex */ public static final class NoImageHeaderParserException extends MissingComponentException { public NoImageHeaderParserException() { super("Failed to find image header parser."); } } public final List> b(Model model) { List b = this.f.b(model.getClass()); if (b.isEmpty()) { throw new NoModelLoaderAvailableException(model); } int size = b.size(); List> emptyList = Collections.emptyList(); boolean z = true; for (int i = 0; i < size; i++) { SCe sCe = (SCe) b.get(i); if (sCe.d(model)) { if (z) { emptyList = new ArrayList<>(size - i); z = false; } emptyList.add(sCe); } } if (emptyList.isEmpty()) { throw new NoModelLoaderAvailableException(model, (List>) b); } return emptyList; } }