package o;

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

    public C1314gj(C0977d7 c0977d7, int i) {
        this.a = c0977d7;
        this.b = i;
    }

    @Override // o.InterfaceC0764av
    public final void a(C0860bv c0860bv) {
        int i = c0860bv.d;
        C0977d7 c0977d7 = this.a;
        if (i != -1) {
            c0860bv.d(i, c0977d7.m, c0860bv.e);
        } else {
            c0860bv.d(c0860bv.b, c0977d7.m, c0860bv.c);
        }
        int i2 = c0860bv.b;
        int i3 = c0860bv.c;
        int i4 = i2 == i3 ? i3 : -1;
        int i5 = this.b;
        int iK = AbstractC0940cn0.k(i5 > 0 ? (i4 + i5) - 1 : (i4 + i5) - c0977d7.m.length(), 0, c0860bv.a.b());
        c0860bv.f(iK, iK);
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof C1314gj)) {
            return false;
        }
        C1314gj c1314gj = (C1314gj) obj;
        return F3.c(this.a.m, c1314gj.a.m) && this.b == c1314gj.b;
    }

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

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

    public C1314gj(String str, int i) {
        this(new C0977d7(str), i);
    }
}
