package o;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.lr, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1806lr implements InterfaceC0764av {
    public final int a;
    public final int b;

    public C1806lr(int i, int i2) {
        this.a = i;
        this.b = i2;
        if (i >= 0 && i2 >= 0) {
            return;
        }
        AbstractC2228qH.a("Expected lengthBeforeCursor and lengthAfterCursor to be non-negative, were " + i + " and " + i2 + " respectively.");
    }

    @Override // o.InterfaceC0764av
    public final void a(C0860bv c0860bv) {
        int i = 0;
        int i2 = 0;
        int i3 = 0;
        while (true) {
            if (i2 < this.a) {
                int i4 = i3 + 1;
                int i5 = c0860bv.b;
                if (i5 <= i4) {
                    i3 = i5;
                    break;
                } else {
                    i3 = (Character.isHighSurrogate(c0860bv.b((i5 - i4) + (-1))) && Character.isLowSurrogate(c0860bv.b(c0860bv.b - i4))) ? i3 + 2 : i4;
                    i2++;
                }
            } else {
                break;
            }
        }
        int iB = 0;
        while (true) {
            if (i >= this.b) {
                break;
            }
            int i6 = iB + 1;
            int i7 = c0860bv.c;
            C0862bw c0862bw = c0860bv.a;
            if (i7 + i6 >= c0862bw.b()) {
                iB = c0862bw.b() - c0860bv.c;
                break;
            } else {
                iB = (Character.isHighSurrogate(c0860bv.b((c0860bv.c + i6) + (-1))) && Character.isLowSurrogate(c0860bv.b(c0860bv.c + i6))) ? iB + 2 : i6;
                i++;
            }
        }
        int i8 = c0860bv.c;
        c0860bv.a(i8, iB + i8);
        int i9 = c0860bv.b;
        c0860bv.a(i9 - i3, i9);
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof C1806lr)) {
            return false;
        }
        C1806lr c1806lr = (C1806lr) obj;
        return this.a == c1806lr.a && this.b == c1806lr.b;
    }

    public final int hashCode() {
        return (this.a * 31) + this.b;
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder("DeleteSurroundingTextInCodePointsCommand(lengthBeforeCursor=");
        sb.append(this.a);
        sb.append(", lengthAfterCursor=");
        return AbstractC2462sn.m(sb, this.b, ')');
    }
}
