discord-jadx/app/src/main/java/com/discord/widgets/chat/list/sheet/WidgetApplicationCommandBot...

39 lines
1.6 KiB
Java

package com.discord.widgets.chat.list.sheet;
import com.discord.api.commands.ApplicationCommandValue;
import d0.g0.w;
import d0.z.d.m;
import java.util.ArrayList;
import java.util.List;
/* compiled from: WidgetApplicationCommandBottomSheetViewModel.kt */
public final class WidgetApplicationCommandBottomSheetViewModelKt {
public static final List<ApplicationCommandValue> flattenOptions(ApplicationCommandValue applicationCommandValue) {
m.checkNotNullParameter(applicationCommandValue, "$this$flattenOptions");
List<ApplicationCommandValue> b = applicationCommandValue.b();
if (b == null || b.isEmpty()) {
return d0.t.m.listOf(applicationCommandValue);
}
ArrayList arrayList = new ArrayList();
List<ApplicationCommandValue> b2 = applicationCommandValue.b();
if (b2 != null) {
for (ApplicationCommandValue applicationCommandValue2 : b2) {
arrayList.addAll(flattenOptions(applicationCommandValue2));
}
}
return arrayList;
}
public static final List<ApplicationCommandValue> flattenOptions(List<ApplicationCommandValue> list) {
m.checkNotNullParameter(list, "$this$flattenOptions");
ArrayList arrayList = new ArrayList();
for (ApplicationCommandValue applicationCommandValue : list) {
arrayList.addAll(flattenOptions(applicationCommandValue));
}
return arrayList;
}
public static final String toStringTruncateZeroDecimal(Object obj) {
return obj instanceof Number ? w.removeSuffix(obj.toString(), ".0") : String.valueOf(obj);
}
}