alexandroid/decompiled/jadx/sources/androidx/compose/ui/text/input/DeleteSurroundingTextInCodePointsCommand.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

104 lines
5.7 KiB
Java

package androidx.compose.ui.text.input;
import androidx.biometric.ErrorUtils$$ExternalSyntheticOutline0;
import androidx.compose.runtime.internal.StabilityInferred;
import androidx.compose.ui.text.internal.InlineClassHelperKt;
import com.amazon.alexa.redesign.view.container.CardStudioAgentSpaceMetrics;
import kotlin.Metadata;
import kotlin.jvm.internal.SourceDebugExtension;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@StabilityInferred(parameters = 1)
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0007\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\b\u0007\u0018\u00002\u00020\u0001B\u0017\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003¢\u0006\u0004\b\u0005\u0010\u0006J\u0010\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH\u0016J\u0013\u0010\u000e\u001a\u00020\u000f2\b\u0010\u0010\u001a\u0004\u0018\u00010\u0011H\u0096\u0002J\b\u0010\u0012\u001a\u00020\u0003H\u0016J\b\u0010\u0013\u001a\u00020\u0014H\u0016R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\bR\u0011\u0010\u0004\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\b¨\u0006\u0015"}, d2 = {"Landroidx/compose/ui/text/input/DeleteSurroundingTextInCodePointsCommand;", "Landroidx/compose/ui/text/input/EditCommand;", "lengthBeforeCursor", "", "lengthAfterCursor", "<init>", "(II)V", "getLengthBeforeCursor", "()I", "getLengthAfterCursor", "applyTo", "", "buffer", "Landroidx/compose/ui/text/input/EditingBuffer;", "equals", "", CardStudioAgentSpaceMetrics.DimensionValue.SCHEME_OTHER, "", "hashCode", "toString", "", "ui-text"}, k = 1, mv = {2, 0, 0}, xi = 48)
@SourceDebugExtension({"SMAP\nEditCommand.kt\nKotlin\n*S Kotlin\n*F\n+ 1 EditCommand.kt\nandroidx/compose/ui/text/input/DeleteSurroundingTextInCodePointsCommand\n+ 2 InlineClassHelper.kt\nandroidx/compose/ui/text/internal/InlineClassHelperKt\n*L\n1#1,558:1\n118#2,4:559\n*S KotlinDebug\n*F\n+ 1 EditCommand.kt\nandroidx/compose/ui/text/input/DeleteSurroundingTextInCodePointsCommand\n*L\n309#1:559,4\n*E\n"})
/* loaded from: classes13.dex */
public final class DeleteSurroundingTextInCodePointsCommand implements EditCommand {
public static final int $stable = 0;
private final int lengthAfterCursor;
private final int lengthBeforeCursor;
public DeleteSurroundingTextInCodePointsCommand(int i, int i2) {
this.lengthBeforeCursor = i;
this.lengthAfterCursor = i2;
if (i >= 0 && i2 >= 0) {
return;
}
InlineClassHelperKt.throwIllegalArgumentException("Expected lengthBeforeCursor and lengthAfterCursor to be non-negative, were " + i + " and " + i2 + " respectively.");
}
@Override // androidx.compose.ui.text.input.EditCommand
public void applyTo(@NotNull EditingBuffer buffer) {
boolean isSurrogatePair;
boolean isSurrogatePair2;
int i = this.lengthBeforeCursor;
int i2 = 0;
int i3 = 0;
int i4 = 0;
while (true) {
if (i3 < i) {
int i5 = i4 + 1;
if (buffer.getSelectionStart() <= i5) {
i4 = buffer.getSelectionStart();
break;
} else {
isSurrogatePair2 = EditCommandKt.isSurrogatePair(buffer.get$ui_text((buffer.getSelectionStart() - i5) - 1), buffer.get$ui_text(buffer.getSelectionStart() - i5));
i4 = isSurrogatePair2 ? i4 + 2 : i5;
i3++;
}
} else {
break;
}
}
int i6 = this.lengthAfterCursor;
int i7 = 0;
while (true) {
if (i2 >= i6) {
break;
}
int i8 = i7 + 1;
if (buffer.getSelectionEnd() + i8 >= buffer.getLength$ui_text()) {
i7 = buffer.getLength$ui_text() - buffer.getSelectionEnd();
break;
} else {
isSurrogatePair = EditCommandKt.isSurrogatePair(buffer.get$ui_text((buffer.getSelectionEnd() + i8) - 1), buffer.get$ui_text(buffer.getSelectionEnd() + i8));
i7 = isSurrogatePair ? i7 + 2 : i8;
i2++;
}
}
buffer.delete$ui_text(buffer.getSelectionEnd(), buffer.getSelectionEnd() + i7);
buffer.delete$ui_text(buffer.getSelectionStart() - i4, buffer.getSelectionStart());
}
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof DeleteSurroundingTextInCodePointsCommand)) {
return false;
}
DeleteSurroundingTextInCodePointsCommand deleteSurroundingTextInCodePointsCommand = (DeleteSurroundingTextInCodePointsCommand) other;
return this.lengthBeforeCursor == deleteSurroundingTextInCodePointsCommand.lengthBeforeCursor && this.lengthAfterCursor == deleteSurroundingTextInCodePointsCommand.lengthAfterCursor;
}
public final int getLengthAfterCursor() {
return this.lengthAfterCursor;
}
public final int getLengthBeforeCursor() {
return this.lengthBeforeCursor;
}
public int hashCode() {
return (this.lengthBeforeCursor * 31) + this.lengthAfterCursor;
}
@NotNull
public String toString() {
StringBuilder sb = new StringBuilder("DeleteSurroundingTextInCodePointsCommand(lengthBeforeCursor=");
sb.append(this.lengthBeforeCursor);
sb.append(", lengthAfterCursor=");
return ErrorUtils$$ExternalSyntheticOutline0.m(sb, this.lengthAfterCursor, ')');
}
}