package d3;

import com.google.android.gms.internal.measurement.C0615b3;
import com.google.android.gms.internal.measurement.T2;
import com.google.android.gms.internal.measurement.V2;
import d5.AbstractC0844a;
import e0.C0853a;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import m4.InterfaceC1168d;
import q1.InterfaceC1454k;
import q1.InterfaceC1456m;
import u0.C1579o;
import u1.C1590a;
import v1.C1670a;
import x1.C1710a;
import x7.C1731g;
import x7.C1734j;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class C implements G, g3.g, InterfaceC1168d, InterfaceC1454k {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final /* synthetic */ int f11430q;

    public /* synthetic */ C(int i) {
        this.f11430q = i;
    }

    public static ArrayList e(List list) {
        P6.g.e(list, "protocols");
        ArrayList arrayList = new ArrayList();
        for (Object obj : list) {
            if (((k7.x) obj) != k7.x.f14194r) {
                arrayList.add(obj);
            }
        }
        ArrayList arrayList2 = new ArrayList(B6.m.a0(arrayList));
        int size = arrayList.size();
        int i = 0;
        while (i < size) {
            Object obj2 = arrayList.get(i);
            i++;
            arrayList2.add(((k7.x) obj2).f14201q);
        }
        return arrayList2;
    }

    public static byte[] f(List list) {
        P6.g.e(list, "protocols");
        C1731g c1731g = new C1731g();
        ArrayList arrayListE = e(list);
        int size = arrayListE.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayListE.get(i);
            i++;
            String str = (String) obj;
            c1731g.u0(str.length());
            c1731g.z0(str);
        }
        return c1731g.V(c1731g.f18765r);
    }

    public static n6.b h(int i, int i5, int i8, int i9) {
        if ((i9 & 2) != 0) {
            i5 = i;
        }
        if ((i9 & 4) != 0) {
            i8 = i;
        }
        return new n6.b(i, i5, i8);
    }

    public static x7.x j(String str, boolean z8) {
        P6.g.e(str, "<this>");
        C1734j c1734j = y7.c.f19041a;
        C1731g c1731g = new C1731g();
        c1731g.z0(str);
        return y7.c.d(c1731g, z8);
    }

    public static x7.x m(File file) {
        String str = x7.x.f18797r;
        String string = file.toString();
        P6.g.d(string, "toString(...)");
        return j(string, false);
    }

    public static boolean n() {
        return "Dalvik".equals(System.getProperty("java.vm.name"));
    }

    @Override // m4.InterfaceC1168d
    public String b() {
        return null;
    }

    @Override // d3.G
    public Object c() {
        switch (this.f11430q) {
            case n4.u0.f15495q /* 0 */:
                List list = I.f11534a;
                T2.f9683r.get();
                return (String) V2.f9720Z.b();
            case 1:
                List list2 = I.f11534a;
                T2.f9683r.get();
                Long l8 = (Long) V2.i.b();
                l8.getClass();
                return l8;
            case 2:
                List list3 = I.f11534a;
                T2.f9683r.get();
                return (String) V2.f9738j.b();
            case 3:
                List list4 = I.f11534a;
                T2.f9683r.get();
                return Integer.valueOf((int) ((Long) V2.f9734g0.b()).longValue());
            case 4:
                List list5 = I.f11534a;
                T2.f9683r.get();
                return Integer.valueOf((int) ((Long) V2.f9716U.b()).longValue());
            case 5:
                List list6 = I.f11534a;
                T2.f9683r.get();
                Boolean bool = (Boolean) V2.f9725c.b();
                bool.getClass();
                return bool;
            default:
                List list7 = I.f11534a;
                Boolean bool2 = (Boolean) C0615b3.f9823b.b();
                bool2.getClass();
                return bool2;
        }
    }

    @Override // q1.InterfaceC1454k
    public InterfaceC1456m g(C1579o c1579o) {
        List list;
        String str = c1579o.f17358n;
        if (str != null) {
            list = c1579o.f17361q;
            switch (str) {
                case "application/dvbsubs":
                    return new s1.h(list);
                case "application/pgs":
                    return new C2.a(22);
                case "application/x-mp4-vtt":
                    return new T0.v(1);
                case "text/vtt":
                    return new C0853a(28);
                case "application/x-quicktime-tx3g":
                    return new C1710a(list);
                case "text/x-ssa":
                    return new C1590a(list);
                case "application/vobsub":
                    return new C2.a(list);
                case "application/x-subrip":
                    return new C1670a();
                case "application/ttml+xml":
                    return new w1.e();
            }
        }
        throw new IllegalArgumentException(AbstractC0844a.x("Unsupported MIME type: ", str));
    }

    @Override // q1.InterfaceC1454k
    public int i(C1579o c1579o) {
        String str = c1579o.f17358n;
        if (str != null) {
            switch (str) {
                case "application/dvbsubs":
                case "application/pgs":
                case "application/x-mp4-vtt":
                    return 2;
                case "text/vtt":
                    return 1;
                case "application/x-quicktime-tx3g":
                    return 2;
                case "text/x-ssa":
                    return 1;
                case "application/vobsub":
                    return 2;
                case "application/x-subrip":
                case "application/ttml+xml":
                    return 1;
            }
        }
        throw new IllegalArgumentException(AbstractC0844a.x("Unsupported MIME type: ", str));
    }

    @Override // g3.g
    public g3.o k(Object obj) {
        return W2.g.p(Boolean.TRUE);
    }

    @Override // q1.InterfaceC1454k
    public boolean l(C1579o c1579o) {
        String str = c1579o.f17358n;
        return Objects.equals(str, "text/x-ssa") || Objects.equals(str, "text/vtt") || Objects.equals(str, "application/x-mp4-vtt") || Objects.equals(str, "application/x-subrip") || Objects.equals(str, "application/x-quicktime-tx3g") || Objects.equals(str, "application/pgs") || Objects.equals(str, "application/vobsub") || Objects.equals(str, "application/dvbsubs") || Objects.equals(str, "application/ttml+xml");
    }

    @Override // m4.InterfaceC1168d
    public void a() {
    }

    @Override // m4.InterfaceC1168d
    public void d(long j8, String str) {
    }
}
