package b6; import e6.m; import f6.e; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import l6.n; import l6.o; /* loaded from: classes2.dex */ public class h { /* renamed from: a, reason: collision with root package name */ private final o f3274a; /* renamed from: b, reason: collision with root package name */ private final w6.a f3275b; /* renamed from: c, reason: collision with root package name */ private final w6.e f3276c; /* renamed from: d, reason: collision with root package name */ private final w6.f f3277d; /* renamed from: e, reason: collision with root package name */ private final f6.f f3278e; /* renamed from: f, reason: collision with root package name */ private final t6.f f3279f; /* renamed from: g, reason: collision with root package name */ private final w6.b f3280g; /* renamed from: h, reason: collision with root package name */ private final w6.d f3281h = new w6.d(); /* renamed from: i, reason: collision with root package name */ private final w6.c f3282i = new w6.c(); /* renamed from: j, reason: collision with root package name */ private final y.e f3283j; public static class a extends RuntimeException { public a(String str) { super(str); } } public static final class b extends a { public b() { super("Failed to find image header parser."); } } public static class c extends a { public c(Class cls, Class cls2) { super("Failed to find any ModelLoaders for model: " + cls + " and data: " + cls2); } public c(Object obj) { super("Failed to find any ModelLoaders registered for model class: " + obj.getClass()); } public c(Object obj, List list) { super("Found ModelLoaders for model class: " + list + ", but none that handle this specific model instance: " + obj); } } public static class d extends a { public d(Class cls) { super("Failed to find result encoder for resource class: " + cls + ", 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."); } } public static class e extends a { public e(Class cls) { super("Failed to find source encoder for data class: " + cls); } } public h() { y.e e10 = c7.a.e(); this.f3283j = e10; this.f3274a = new o(e10); this.f3275b = new w6.a(); this.f3276c = new w6.e(); this.f3277d = new w6.f(); this.f3278e = new f6.f(); this.f3279f = new t6.f(); this.f3280g = new w6.b(); r(Arrays.asList("Gif", "Bitmap", "BitmapDrawable")); } private List a(Class cls, Class cls2, Class cls3) { ArrayList arrayList = new ArrayList(); for (Class cls4 : this.f3276c.d(cls, cls2)) { for (Class cls5 : this.f3279f.b(cls4, cls3)) { arrayList.add(new h6.b(cls, cls4, cls5, this.f3276c.c(cls, cls4), this.f3279f.a(cls4, cls5), this.f3283j)); } } return arrayList; } public h b(Class cls, e6.d dVar) { this.f3275b.a(cls, dVar); return this; } public h c(Class cls, m mVar) { this.f3277d.a(cls, mVar); return this; } public h d(Class cls, Class cls2, e6.l lVar) { f("legacy_append", cls, cls2, lVar); return this; } public h e(Class cls, Class cls2, n nVar) { this.f3274a.c(cls, cls2, nVar); return this; } public h f(String str, Class cls, Class cls2, e6.l lVar) { this.f3276c.b(str, lVar, cls, cls2); return this; } public List g() { List b10 = this.f3280g.b(); if (b10.isEmpty()) { throw new b(); } return b10; } public h6.g h(Class cls, Class cls2, Class cls3) { h6.g b10 = this.f3282i.b(cls, cls2, cls3); if (this.f3282i.c(b10)) { return null; } if (b10 == null) { List a10 = a(cls, cls2, cls3); b10 = a10.isEmpty() ? null : new h6.g(cls, cls2, cls3, a10, this.f3283j); this.f3282i.d(cls, cls2, cls3, b10); } return b10; } public List i(Object obj) { return this.f3274a.e(obj); } public List j(Class cls, Class cls2, Class cls3) { List a10 = this.f3281h.a(cls, cls2, cls3); if (a10 == null) { a10 = new ArrayList(); Iterator it = this.f3274a.d(cls).iterator(); while (it.hasNext()) { for (Class cls4 : this.f3276c.d((Class) it.next(), cls2)) { if (!this.f3279f.b(cls4, cls3).isEmpty() && !a10.contains(cls4)) { a10.add(cls4); } } } this.f3281h.b(cls, cls2, cls3, Collections.unmodifiableList(a10)); } return a10; } public m k(h6.h hVar) { m b10 = this.f3277d.b(hVar.d()); if (b10 != null) { return b10; } throw new d(hVar.d()); } public f6.e l(Object obj) { return this.f3278e.a(obj); } public e6.d m(Object obj) { e6.d b10 = this.f3275b.b(obj.getClass()); if (b10 != null) { return b10; } throw new e(obj.getClass()); } public boolean n(h6.h hVar) { return this.f3277d.b(hVar.d()) != null; } public h o(e6.f fVar) { this.f3280g.a(fVar); return this; } public h p(e.a aVar) { this.f3278e.b(aVar); return this; } public h q(Class cls, Class cls2, t6.e eVar) { this.f3279f.c(cls, cls2, eVar); return this; } public final h r(List list) { ArrayList arrayList = new ArrayList(list.size()); arrayList.add("legacy_prepend_all"); Iterator it = list.iterator(); while (it.hasNext()) { arrayList.add((String) it.next()); } arrayList.add("legacy_append"); this.f3276c.e(arrayList); return this; } }