mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-19 04:13:18 +01:00
192 lines
12 KiB
Java
192 lines
12 KiB
Java
package androidx.compose.ui.text.input;
|
|
|
|
import androidx.compose.runtime.Immutable;
|
|
import androidx.compose.runtime.saveable.Saver;
|
|
import androidx.compose.runtime.saveable.SaverKt;
|
|
import androidx.compose.runtime.saveable.SaverScope;
|
|
import androidx.compose.ui.text.AnnotatedString;
|
|
import androidx.compose.ui.text.NonNullValueClassSaver;
|
|
import androidx.compose.ui.text.SaversKt;
|
|
import androidx.compose.ui.text.SaversKt$$ExternalSyntheticLambda0;
|
|
import androidx.compose.ui.text.TextRange;
|
|
import androidx.compose.ui.text.TextRangeKt;
|
|
import com.amazon.alexa.redesign.view.container.CardStudioAgentSpaceMetrics;
|
|
import java.util.List;
|
|
import kotlin.Metadata;
|
|
import kotlin.collections.CollectionsKt;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Immutable
|
|
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u000f\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\b\u0007\u0018\u0000 \u001f2\u00020\u0001:\u0001\u001fB%\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\b\b\u0002\u0010\u0004\u001a\u00020\u0005\u0012\n\b\u0002\u0010\u0006\u001a\u0004\u0018\u00010\u0005¢\u0006\u0004\b\u0007\u0010\bB)\b\u0016\u0012\b\b\u0002\u0010\t\u001a\u00020\n\u0012\b\b\u0002\u0010\u0004\u001a\u00020\u0005\u0012\n\b\u0002\u0010\u0006\u001a\u0004\u0018\u00010\u0005¢\u0006\u0004\b\u0007\u0010\u000bJ-\u0010\u0015\u001a\u00020\u00002\b\b\u0002\u0010\u0002\u001a\u00020\u00032\b\b\u0002\u0010\u0004\u001a\u00020\u00052\n\b\u0002\u0010\u0006\u001a\u0004\u0018\u00010\u0005¢\u0006\u0004\b\u0016\u0010\u0017J+\u0010\u0015\u001a\u00020\u00002\u0006\u0010\t\u001a\u00020\n2\b\b\u0002\u0010\u0004\u001a\u00020\u00052\n\b\u0002\u0010\u0006\u001a\u0004\u0018\u00010\u0005¢\u0006\u0004\b\u0016\u0010\u0018J\u0013\u0010\u0019\u001a\u00020\u001a2\b\u0010\u001b\u001a\u0004\u0018\u00010\u0001H\u0096\u0002J\b\u0010\u001c\u001a\u00020\u001dH\u0016J\b\u0010\u001e\u001a\u00020\nH\u0016R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\rR\u0011\u0010\t\u001a\u00020\n8F¢\u0006\u0006\u001a\u0004\b\u000e\u0010\u000fR\u0013\u0010\u0004\u001a\u00020\u0005¢\u0006\n\n\u0002\u0010\u0012\u001a\u0004\b\u0010\u0010\u0011R\u0013\u0010\u0006\u001a\u0004\u0018\u00010\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0013\u0010\u0014¨\u0006 "}, d2 = {"Landroidx/compose/ui/text/input/TextFieldValue;", "", "annotatedString", "Landroidx/compose/ui/text/AnnotatedString;", "selection", "Landroidx/compose/ui/text/TextRange;", "composition", "<init>", "(Landroidx/compose/ui/text/AnnotatedString;JLandroidx/compose/ui/text/TextRange;Lkotlin/jvm/internal/DefaultConstructorMarker;)V", "text", "", "(Ljava/lang/String;JLandroidx/compose/ui/text/TextRange;Lkotlin/jvm/internal/DefaultConstructorMarker;)V", "getAnnotatedString", "()Landroidx/compose/ui/text/AnnotatedString;", "getText", "()Ljava/lang/String;", "getSelection-d9O1mEE", "()J", "J", "getComposition-MzsxiRA", "()Landroidx/compose/ui/text/TextRange;", "copy", "copy-3r_uNRQ", "(Landroidx/compose/ui/text/AnnotatedString;JLandroidx/compose/ui/text/TextRange;)Landroidx/compose/ui/text/input/TextFieldValue;", "(Ljava/lang/String;JLandroidx/compose/ui/text/TextRange;)Landroidx/compose/ui/text/input/TextFieldValue;", "equals", "", CardStudioAgentSpaceMetrics.DimensionValue.SCHEME_OTHER, "hashCode", "", "toString", "Companion", "ui-text"}, k = 1, mv = {2, 0, 0}, xi = 48)
|
|
@SourceDebugExtension({"SMAP\nTextFieldValue.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TextFieldValue.kt\nandroidx/compose/ui/text/input/TextFieldValue\n+ 2 Savers.kt\nandroidx/compose/ui/text/SaversKt\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,192:1\n65#2,2:193\n65#2,2:196\n1#3:195\n1#3:198\n*S KotlinDebug\n*F\n+ 1 TextFieldValue.kt\nandroidx/compose/ui/text/input/TextFieldValue\n*L\n162#1:193,2\n163#1:196,2\n162#1:195\n163#1:198\n*E\n"})
|
|
/* loaded from: classes13.dex */
|
|
public final class TextFieldValue {
|
|
public static final int $stable = 0;
|
|
|
|
/* renamed from: Companion, reason: from kotlin metadata */
|
|
@NotNull
|
|
public static final Companion INSTANCE = new Companion(null);
|
|
|
|
@NotNull
|
|
private static final Saver<TextFieldValue, Object> Saver = SaverKt.Saver(new SaversKt$$ExternalSyntheticLambda0(25), new TextFieldValue$$ExternalSyntheticLambda1(0));
|
|
|
|
@NotNull
|
|
private final AnnotatedString annotatedString;
|
|
|
|
@Nullable
|
|
private final TextRange composition;
|
|
private final long selection;
|
|
|
|
private TextFieldValue(AnnotatedString annotatedString, long j, TextRange textRange) {
|
|
this.annotatedString = annotatedString;
|
|
this.selection = TextRangeKt.m6836coerceIn8ffj60Q(j, 0, getText().length());
|
|
this.composition = textRange != null ? TextRange.m6818boximpl(TextRangeKt.m6836coerceIn8ffj60Q(textRange.getPackedValue(), 0, getText().length())) : null;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static final Object Saver$lambda$0(SaverScope saverScope, TextFieldValue textFieldValue) {
|
|
return CollectionsKt.arrayListOf(SaversKt.save(textFieldValue.annotatedString, SaversKt.getAnnotatedStringSaver(), saverScope), SaversKt.save(TextRange.m6818boximpl(textFieldValue.selection), SaversKt.getSaver(TextRange.INSTANCE), saverScope));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static final TextFieldValue Saver$lambda$1(Object obj) {
|
|
obj.getClass();
|
|
List list = (List) obj;
|
|
Object obj2 = list.get(0);
|
|
Saver<AnnotatedString, Object> annotatedStringSaver = SaversKt.getAnnotatedStringSaver();
|
|
Boolean bool = Boolean.FALSE;
|
|
TextRange textRange = null;
|
|
AnnotatedString restore = ((!Intrinsics.areEqual(obj2, bool) || (annotatedStringSaver instanceof NonNullValueClassSaver)) && obj2 != null) ? annotatedStringSaver.restore(obj2) : null;
|
|
restore.getClass();
|
|
Object obj3 = list.get(1);
|
|
Saver<TextRange, Object> saver = SaversKt.getSaver(TextRange.INSTANCE);
|
|
if ((!Intrinsics.areEqual(obj3, bool) || (saver instanceof NonNullValueClassSaver)) && obj3 != null) {
|
|
textRange = saver.restore(obj3);
|
|
}
|
|
textRange.getClass();
|
|
return new TextFieldValue(restore, textRange.getPackedValue(), (TextRange) null, 4, (DefaultConstructorMarker) null);
|
|
}
|
|
|
|
/* renamed from: copy-3r_uNRQ$default, reason: not valid java name */
|
|
public static /* synthetic */ TextFieldValue m7076copy3r_uNRQ$default(TextFieldValue textFieldValue, AnnotatedString annotatedString, long j, TextRange textRange, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
annotatedString = textFieldValue.annotatedString;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
j = textFieldValue.selection;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
textRange = textFieldValue.composition;
|
|
}
|
|
return textFieldValue.m7078copy3r_uNRQ(annotatedString, j, textRange);
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@NotNull
|
|
/* renamed from: copy-3r_uNRQ, reason: not valid java name */
|
|
public final TextFieldValue m7079copy3r_uNRQ(@NotNull String text, long selection, @Nullable TextRange composition) {
|
|
return new TextFieldValue(new AnnotatedString(text, null, 2, 0 == true ? 1 : 0), selection, composition, (DefaultConstructorMarker) null);
|
|
}
|
|
|
|
public boolean equals(@Nullable Object other) {
|
|
if (this == other) {
|
|
return true;
|
|
}
|
|
if (!(other instanceof TextFieldValue)) {
|
|
return false;
|
|
}
|
|
TextFieldValue textFieldValue = (TextFieldValue) other;
|
|
return TextRange.m6823equalsimpl0(this.selection, textFieldValue.selection) && Intrinsics.areEqual(this.composition, textFieldValue.composition) && Intrinsics.areEqual(this.annotatedString, textFieldValue.annotatedString);
|
|
}
|
|
|
|
@NotNull
|
|
public final AnnotatedString getAnnotatedString() {
|
|
return this.annotatedString;
|
|
}
|
|
|
|
@Nullable
|
|
/* renamed from: getComposition-MzsxiRA, reason: not valid java name and from getter */
|
|
public final TextRange getComposition() {
|
|
return this.composition;
|
|
}
|
|
|
|
/* renamed from: getSelection-d9O1mEE, reason: not valid java name and from getter */
|
|
public final long getSelection() {
|
|
return this.selection;
|
|
}
|
|
|
|
@NotNull
|
|
public final String getText() {
|
|
return this.annotatedString.getText();
|
|
}
|
|
|
|
public int hashCode() {
|
|
int m6831hashCodeimpl = (TextRange.m6831hashCodeimpl(this.selection) + (this.annotatedString.hashCode() * 31)) * 31;
|
|
TextRange textRange = this.composition;
|
|
return m6831hashCodeimpl + (textRange != null ? TextRange.m6831hashCodeimpl(textRange.getPackedValue()) : 0);
|
|
}
|
|
|
|
@NotNull
|
|
public String toString() {
|
|
return "TextFieldValue(text='" + ((Object) this.annotatedString) + "', selection=" + ((Object) TextRange.m6833toStringimpl(this.selection)) + ", composition=" + this.composition + ')';
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003R\u001d\u0010\u0004\u001a\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00010\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\b¨\u0006\t"}, d2 = {"Landroidx/compose/ui/text/input/TextFieldValue$Companion;", "", "<init>", "()V", "Saver", "Landroidx/compose/runtime/saveable/Saver;", "Landroidx/compose/ui/text/input/TextFieldValue;", "getSaver", "()Landroidx/compose/runtime/saveable/Saver;", "ui-text"}, k = 1, mv = {2, 0, 0}, xi = 48)
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
@NotNull
|
|
public final Saver<TextFieldValue, Object> getSaver() {
|
|
return TextFieldValue.Saver;
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
}
|
|
|
|
@NotNull
|
|
/* renamed from: copy-3r_uNRQ, reason: not valid java name */
|
|
public final TextFieldValue m7078copy3r_uNRQ(@NotNull AnnotatedString annotatedString, long selection, @Nullable TextRange composition) {
|
|
return new TextFieldValue(annotatedString, selection, composition, (DefaultConstructorMarker) null);
|
|
}
|
|
|
|
/* renamed from: copy-3r_uNRQ$default, reason: not valid java name */
|
|
public static /* synthetic */ TextFieldValue m7077copy3r_uNRQ$default(TextFieldValue textFieldValue, String str, long j, TextRange textRange, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
j = textFieldValue.selection;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
textRange = textFieldValue.composition;
|
|
}
|
|
return textFieldValue.m7079copy3r_uNRQ(str, j, textRange);
|
|
}
|
|
|
|
public /* synthetic */ TextFieldValue(String str, long j, TextRange textRange, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(str, j, textRange);
|
|
}
|
|
|
|
public /* synthetic */ TextFieldValue(AnnotatedString annotatedString, long j, TextRange textRange, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(annotatedString, j, textRange);
|
|
}
|
|
|
|
public /* synthetic */ TextFieldValue(AnnotatedString annotatedString, long j, TextRange textRange, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(annotatedString, (i & 2) != 0 ? TextRange.INSTANCE.m6835getZerod9O1mEE() : j, (i & 4) != 0 ? null : textRange, (DefaultConstructorMarker) null);
|
|
}
|
|
|
|
public /* synthetic */ TextFieldValue(String str, long j, TextRange textRange, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this((i & 1) != 0 ? "" : str, (i & 2) != 0 ? TextRange.INSTANCE.m6835getZerod9O1mEE() : j, (i & 4) != 0 ? null : textRange, (DefaultConstructorMarker) null);
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
private TextFieldValue(String str, long j, TextRange textRange) {
|
|
this(new AnnotatedString(str, null, 2, 0 == true ? 1 : 0), j, textRange, (DefaultConstructorMarker) null);
|
|
}
|
|
}
|