package B;

import D.C0135f;
import G.C0227b;
import K.AbstractC0454g0;
import K.AbstractC0467n;
import M2.AbstractC0535o0;
import T0.AbstractC0602m;
import T0.C0594e;
import X0.AbstractC0808v;
import Z0.C0864e;
import a.AbstractC0872a;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import b1.C1187b;
import com.debridstream.tv.HomeSection;
import f1.C2013a;
import f1.C2024l;
import f1.C2028p;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import w4.C3137A;
import x.EnumC3207z0;
import x4.AbstractC3251q;
import x4.AbstractC3252r;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class h1 implements J4.c {

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

    public /* synthetic */ h1(int i6) {
        this.f306a = i6;
    }

    /* JADX WARN: Removed duplicated region for block: B:28:0x0106  */
    /* JADX WARN: Removed duplicated region for block: B:84:0x025e  */
    @Override // J4.c
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invoke(Object obj) {
        int iOffsetByCodePoints;
        T0.G g6;
        String str;
        C3137A c3137a = C3137A.f25453a;
        int i6 = 1;
        switch (this.f306a) {
            case 0:
                return ((g1) obj).f287e;
            case 1:
                return ((g1) obj).f285c;
            case 2:
                return ((g1) obj).f288f;
            case 3:
                B2.o it = (B2.o) obj;
                kotlin.jvm.internal.o.h(it, "it");
                return it;
            case 4:
                List list = (List) obj;
                return new D.H(((Number) list.get(0)).intValue(), ((Number) list.get(1)).intValue());
            case 5:
                return c3137a;
            case 6:
                List list2 = (List) obj;
                return new E.D(((Number) list2.get(0)).intValue(), ((Number) list2.get(1)).intValue());
            case 7:
                ((Integer) obj).getClass();
                E.r rVar = E.F.f985a;
                return x4.y.f26065a;
            case 8:
                ((Integer) obj).getClass();
                E.r rVar2 = E.F.f985a;
                return -1;
            case 9:
                List list3 = (List) obj;
                Object obj2 = list3.get(0);
                kotlin.jvm.internal.o.f(obj2, "null cannot be cast to non-null type kotlin.Int");
                int iIntValue = ((Integer) obj2).intValue();
                Object obj3 = list3.get(1);
                kotlin.jvm.internal.o.f(obj3, "null cannot be cast to non-null type kotlin.Float");
                return new C0227b(iIntValue, ((Float) obj3).floatValue(), new C0135f(list3, i6));
            case 10:
                Q4.m[] mVarArr = Q0.y.f5862a;
                ((Q0.A) obj).g(Q0.w.f5839e, c3137a);
                return c3137a;
            case 11:
                int i7 = AbstractC0467n.f3934a;
                return c3137a;
            case 12:
                return c3137a;
            case 13:
                V.W w6 = (V.W) obj;
                String str2 = w6.f7013g.f6510b;
                long j4 = w6.f7012f;
                int i8 = T0.N.f6482c;
                int i9 = (int) (j4 & 4294967295L);
                if (i9 > 0) {
                    T1.h hVarN = AbstractC0454g0.n();
                    if (hVarN == null) {
                        iOffsetByCodePoints = i9 <= 0 ? -1 : Character.offsetByCodePoints(str2, i9, -1);
                    } else {
                        int iB = hVarN.b(str2, i9 - 1);
                        if (iB >= 0) {
                            iOffsetByCodePoints = iB;
                        } else if (i9 > 0) {
                            iOffsetByCodePoints = Character.offsetByCodePoints(str2, i9, -1);
                        }
                    }
                }
                if (iOffsetByCodePoints == -1) {
                    return null;
                }
                return new C0864e(((int) (w6.f7012f & 4294967295L)) - iOffsetByCodePoints, 0);
            case 14:
                V.W w7 = (V.W) obj;
                String str3 = w7.f7013g.f6510b;
                long j6 = w7.f7012f;
                int i10 = T0.N.f6482c;
                int iJ = AbstractC0454g0.j((int) (j6 & 4294967295L), str3);
                if (iJ != -1) {
                    return new C0864e(0, iJ - ((int) (w7.f7012f & 4294967295L)));
                }
                return null;
            case 15:
                V.W w8 = (V.W) obj;
                Integer numE = w8.e();
                if (numE == null) {
                    return null;
                }
                int iIntValue2 = numE.intValue();
                long j7 = w8.f7012f;
                int i11 = T0.N.f6482c;
                return new C0864e(((int) (4294967295L & j7)) - iIntValue2, 0);
            case 16:
                V.W w9 = (V.W) obj;
                Integer numD = w9.d();
                if (numD == null) {
                    return null;
                }
                int iIntValue3 = numD.intValue();
                long j8 = w9.f7012f;
                int i12 = T0.N.f6482c;
                return new C0864e(0, iIntValue3 - ((int) (4294967295L & j8)));
            case 17:
                V.W w10 = (V.W) obj;
                Integer numC = w10.c();
                if (numC == null) {
                    return null;
                }
                int iIntValue4 = numC.intValue();
                long j9 = w10.f7012f;
                int i13 = T0.N.f6482c;
                return new C0864e(((int) (4294967295L & j9)) - iIntValue4, 0);
            case 18:
                V.W w11 = (V.W) obj;
                Integer numB = w11.b();
                if (numB == null) {
                    return null;
                }
                int iIntValue5 = numB.intValue();
                long j10 = w11.f7012f;
                int i14 = T0.N.f6482c;
                return new C0864e(0, iIntValue5 - ((int) (4294967295L & j10)));
            case 19:
                List list4 = (List) obj;
                Object obj4 = list4.get(1);
                kotlin.jvm.internal.o.f(obj4, "null cannot be cast to non-null type kotlin.Boolean");
                EnumC3207z0 enumC3207z0 = ((Boolean) obj4).booleanValue() ? EnumC3207z0.f25984a : EnumC3207z0.f25985b;
                Object obj5 = list4.get(0);
                kotlin.jvm.internal.o.f(obj5, "null cannot be cast to non-null type kotlin.Float");
                return new K.P0(enumC3207z0, ((Float) obj5).floatValue());
            case 20:
                C0594e c0594e = (C0594e) obj;
                Object obj6 = c0594e.f6503a;
                if (obj6 instanceof AbstractC0602m) {
                    kotlin.jvm.internal.o.f(obj6, "null cannot be cast to non-null type androidx.compose.ui.text.LinkAnnotation");
                    T0.M mA = ((AbstractC0602m) obj6).a();
                    if (mA != null && (mA.f6477a != null || mA.f6478b != null || mA.f6479c != null || mA.f6480d != null)) {
                        Object obj7 = c0594e.f6503a;
                        kotlin.jvm.internal.o.f(obj7, "null cannot be cast to non-null type androidx.compose.ui.text.LinkAnnotation");
                        T0.M mA2 = ((AbstractC0602m) obj7).a();
                        if (mA2 == null || (g6 = mA2.f6477a) == null) {
                            g6 = new T0.G(0L, 0L, (X0.I) null, (X0.C) null, (X0.D) null, (AbstractC0808v) null, (String) null, 0L, (C2013a) null, (C2028p) null, (C1187b) null, 0L, (C2024l) null, (p0.W) null, 65535);
                        }
                        return AbstractC3252r.x(c0594e, new C0594e(c0594e.f6504b, c0594e.f6505c, g6));
                    }
                }
                return AbstractC3252r.x(c0594e);
            case 21:
                ((Q0.A) obj).g(Q0.w.f5819A, c3137a);
                return c3137a;
            case 22:
                Integer num = (Integer) obj;
                num.intValue();
                return num;
            case 23:
                Context context = (Context) obj;
                List<ResolveInfo> listQueryIntentActivities = context.getPackageManager().queryIntentActivities(new Intent().setAction("android.intent.action.PROCESS_TEXT").setType("text/plain"), 0);
                ArrayList arrayList = new ArrayList(listQueryIntentActivities.size());
                int size = listQueryIntentActivities.size();
                for (int i15 = 0; i15 < size; i15++) {
                    ResolveInfo resolveInfo = listQueryIntentActivities.get(i15);
                    ResolveInfo resolveInfo2 = resolveInfo;
                    if (!context.getPackageName().equals(resolveInfo2.activityInfo.packageName)) {
                        ActivityInfo activityInfo = resolveInfo2.activityInfo;
                        if (activityInfo.exported && ((str = activityInfo.permission) == null || context.checkSelfPermission(str) == 0)) {
                            arrayList.add(resolveInfo);
                        }
                    }
                }
                return arrayList;
            case 24:
                String it2 = (String) obj;
                kotlin.jvm.internal.o.h(it2, "it");
                String lowerCase = it2.toLowerCase(Locale.ROOT);
                kotlin.jvm.internal.o.g(lowerCase, "toLowerCase(...)");
                if (lowerCase.length() <= 0) {
                    return lowerCase;
                }
                StringBuilder sb = new StringBuilder();
                sb.append((Object) AbstractC0872a.e0(lowerCase.charAt(0)));
                String strSubstring = lowerCase.substring(1);
                kotlin.jvm.internal.o.g(strSubstring, "substring(...)");
                sb.append(strSubstring);
                return sb.toString();
            case 25:
                X2.h it3 = (X2.h) obj;
                kotlin.jvm.internal.o.h(it3, "it");
                return it3.f8591a + "_" + it3.f8592b;
            case 26:
                String it4 = (String) obj;
                kotlin.jvm.internal.o.h(it4, "it");
                float f6 = AbstractC0535o0.f4860g;
                return AbstractC3251q.m0(S4.p.d1(it4, new String[]{" "}, 6), " ", null, null, new h1(24), 30);
            case 27:
                X2.h it5 = (X2.h) obj;
                kotlin.jvm.internal.o.h(it5, "it");
                return it5.f8592b;
            case 28:
                HomeSection it6 = (HomeSection) obj;
                kotlin.jvm.internal.o.h(it6, "it");
                return it6.getId();
            default:
                kotlin.jvm.internal.o.h((HomeSection) obj, "it");
                return "section";
        }
    }

    public /* synthetic */ h1(int i6, D.w wVar) {
        this.f306a = 5;
    }
}
