package ῲ.ᨨ.ⁱ;

/* renamed from: ῲ.ᨨ.ⁱ.㸾  reason: contains not printable characters */
/* compiled from: TextDirectionHeuristicsCompat */
public final class C1814 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public static final AbstractC1808 f6192 = new C1816(C1817.f6197, false);

    /* renamed from: ῲ  reason: contains not printable characters */
    public static final AbstractC1808 f6193 = new C1816(null, true);

    /* renamed from: K  reason: contains not printable characters */
    public static final AbstractC1808 f6194 = new C1816(null, false);

    /* renamed from: 㸾  reason: contains not printable characters */
    public static final AbstractC1808 f6195 = new C1816(C1817.f6197, true);

    /* renamed from: ῲ.ᨨ.ⁱ.㸾$ʬ  reason: contains not printable characters */
    /* compiled from: TextDirectionHeuristicsCompat */
    public interface AbstractC1815 {
        /* renamed from: K  reason: contains not printable characters */
        int m4705(CharSequence charSequence, int i, int i2);
    }

    /* renamed from: ῲ.ᨨ.ⁱ.㸾$ඓ  reason: contains not printable characters */
    /* compiled from: TextDirectionHeuristicsCompat */
    public static class C1816 extends AbstractC1819 {

        /* renamed from: ῲ  reason: contains not printable characters */
        public final boolean f6196;

        public C1816(AbstractC1815 r1, boolean z) {
            super(r1);
            this.f6196 = z;
        }

        @Override // ῲ.ᨨ.ⁱ.C1814.AbstractC1819
        /* renamed from: K  reason: contains not printable characters */
        public boolean m4706() {
            return this.f6196;
        }
    }

    /* renamed from: ῲ.ᨨ.ⁱ.㸾$ῲ  reason: contains not printable characters */
    /* compiled from: TextDirectionHeuristicsCompat */
    public static class C1817 implements AbstractC1815 {

        /* renamed from: K  reason: contains not printable characters */
        public static final C1817 f6197 = new C1817();

        @Override // ῲ.ᨨ.ⁱ.C1814.AbstractC1815
        /* renamed from: K  reason: contains not printable characters */
        public int m4707(CharSequence charSequence, int i, int i2) {
            int i3 = i2 + i;
            int i4 = 2;
            while (i < i3 && i4 == 2) {
                i4 = C1814.m4703(Character.getDirectionality(charSequence.charAt(i)));
                i++;
            }
            return i4;
        }
    }

    /* renamed from: ῲ.ᨨ.ⁱ.㸾$K  reason: contains not printable characters */
    /* compiled from: TextDirectionHeuristicsCompat */
    public static class C1818 implements AbstractC1815 {

        /* renamed from: ῲ  reason: contains not printable characters */
        public static final C1818 f6198 = new C1818(true);

        /* renamed from: K  reason: contains not printable characters */
        public final boolean f6199;

        public C1818(boolean z) {
            this.f6199 = z;
        }

        @Override // ῲ.ᨨ.ⁱ.C1814.AbstractC1815
        /* renamed from: K  reason: contains not printable characters */
        public int m4708(CharSequence charSequence, int i, int i2) {
            int i3 = i2 + i;
            boolean z = false;
            while (i < i3) {
                int r2 = C1814.m4704(Character.getDirectionality(charSequence.charAt(i)));
                if (r2 != 0) {
                    if (r2 != 1) {
                        continue;
                        i++;
                    } else if (!this.f6199) {
                        return 1;
                    }
                } else if (this.f6199) {
                    return 0;
                }
                z = true;
                i++;
            }
            if (z) {
                return this.f6199 ? 1 : 0;
            }
            return 2;
        }
    }

    /* renamed from: ῲ.ᨨ.ⁱ.㸾$㸾  reason: contains not printable characters */
    /* compiled from: TextDirectionHeuristicsCompat */
    public static abstract class AbstractC1819 implements AbstractC1808 {

        /* renamed from: K  reason: contains not printable characters */
        public final AbstractC1815 f6200;

        public AbstractC1819(AbstractC1815 r1) {
            this.f6200 = r1;
        }

        /* renamed from: K  reason: contains not printable characters */
        public abstract boolean m4709();

        /* renamed from: K  reason: contains not printable characters */
        public boolean m4710(CharSequence charSequence, int i, int i2) {
            if (charSequence == null || i < 0 || i2 < 0 || charSequence.length() - i2 < i) {
                throw new IllegalArgumentException();
            }
            AbstractC1815 r0 = this.f6200;
            if (r0 == null) {
                return m4709();
            }
            int r2 = r0.m4705(charSequence, i, i2);
            if (r2 == 0) {
                return true;
            }
            if (r2 != 1) {
                return m4709();
            }
            return false;
        }
    }

    static {
        C1818 k = C1818.f6198;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static int m4703(int i) {
        if (i != 0) {
            if (i == 1 || i == 2) {
                return 0;
            }
            switch (i) {
                case 14:
                case 15:
                    break;
                case 16:
                case 17:
                    return 0;
                default:
                    return 2;
            }
        }
        return 1;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m4704(int i) {
        if (i != 0) {
            return (i == 1 || i == 2) ? 0 : 2;
        }
        return 1;
    }
}
