package V;

import F1.AbstractC0174c;
import android.os.Build;
import android.view.textclassifier.TextClassification;
import android.view.textclassifier.TextClassifier;
import android.view.textclassifier.TextSelection;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: renamed from: V.t, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0625t extends C4.j implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public e5.c f7155a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public C0626u f7156b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public CharSequence f7157c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public long f7158d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f7159e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public /* synthetic */ Object f7160f;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final /* synthetic */ CharSequence f7161j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final /* synthetic */ long f7162k;
    public final /* synthetic */ C0626u l;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0625t(CharSequence charSequence, long j4, C0626u c0626u, A4.d dVar) {
        super(2, dVar);
        this.f7161j = charSequence;
        this.f7162k = j4;
        this.l = c0626u;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        C0625t c0625t = new C0625t(this.f7161j, this.f7162k, this.l, dVar);
        c0625t.f7160f = obj;
        return c0625t;
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        return ((C0625t) create(G1.c.k(obj), (A4.d) obj2)).invokeSuspend(C3137A.f25453a);
    }

    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        long j4;
        e5.c cVar;
        CharSequence charSequence;
        TextSelection textSelectionL;
        C0626u c0626u;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f7159e;
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            TextClassifier textClassifierK = G1.c.k(this.f7160f);
            AbstractC0174c.z();
            long j6 = this.f7162k;
            int iF = T0.N.f(j6);
            int iE = T0.N.e(j6);
            CharSequence charSequence2 = this.f7161j;
            TextSelection.Request.Builder builderK = AbstractC0174c.k(charSequence2, iF, iE);
            C0626u c0626u2 = this.l;
            TextSelection.Request.Builder defaultLocales = builderK.setDefaultLocales(c0626u2.b());
            int i7 = Build.VERSION.SDK_INT;
            if (i7 >= 31) {
                defaultLocales.setIncludeTextClassification(true);
            }
            TextSelection textSelectionSuggestSelection = textClassifierK.suggestSelection(defaultLocales.build());
            long jG = android.support.v4.media.session.b.g(textSelectionSuggestSelection.getSelectionStartIndex(), textSelectionSuggestSelection.getSelectionEndIndex());
            if (i7 < 31 || textSelectionSuggestSelection.getTextClassification() == null) {
                this.f7158d = jG;
                this.f7159e = 2;
                if (C0626u.a(this.l, this.f7161j, jG, textClassifierK, this) != aVar) {
                    j4 = jG;
                }
            } else {
                this.f7160f = textSelectionSuggestSelection;
                e5.c cVar2 = c0626u2.f7169e;
                this.f7155a = cVar2;
                this.f7156b = c0626u2;
                this.f7157c = charSequence2;
                this.f7158d = jG;
                this.f7159e = 1;
                if (cVar2.e(this) != aVar) {
                    cVar = cVar2;
                    charSequence = charSequence2;
                    textSelectionL = textSelectionSuggestSelection;
                    c0626u = c0626u2;
                    j4 = jG;
                    TextClassification textClassification = textSelectionL.getTextClassification();
                    kotlin.jvm.internal.o.e(textClassification);
                    c0626u.f7171g.setValue(new U(charSequence, j4, textClassification));
                }
            }
            return aVar;
        }
        if (i6 == 1) {
            j4 = this.f7158d;
            charSequence = this.f7157c;
            c0626u = this.f7156b;
            cVar = this.f7155a;
            textSelectionL = G1.c.l(this.f7160f);
            AbstractC2467b.l(obj);
            try {
                TextClassification textClassification2 = textSelectionL.getTextClassification();
                kotlin.jvm.internal.o.e(textClassification2);
                c0626u.f7171g.setValue(new U(charSequence, j4, textClassification2));
            } finally {
                cVar.g(null);
            }
        } else {
            if (i6 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            j4 = this.f7158d;
            AbstractC2467b.l(obj);
        }
        return new T0.N(j4);
    }
}
