discord-jadx/app/src/main/java/com/discord/widgets/user/usersheet/WidgetUserSheetViewModel.java

2447 lines
115 KiB
Java

package com.discord.widgets.user.usersheet;
import a0.a.a.b;
import android.content.Context;
import androidx.annotation.MainThread;
import androidx.annotation.StringRes;
import b.d.b.a.a;
import com.discord.R;
import com.discord.api.channel.Channel;
import com.discord.api.channel.ChannelUtils;
import com.discord.api.connectedaccounts.ConnectedAccount;
import com.discord.api.permission.Permission;
import com.discord.api.role.GuildRole;
import com.discord.api.user.UserProfile;
import com.discord.api.voice.state.StageRequestToSpeakState;
import com.discord.api.voice.state.VoiceState;
import com.discord.app.AppViewModel;
import com.discord.models.domain.ModelApplicationStream;
import com.discord.models.domain.ModelUserNote;
import com.discord.models.domain.ModelUserRelationship;
import com.discord.models.guild.Guild;
import com.discord.models.member.GuildMember;
import com.discord.models.presence.Presence;
import com.discord.models.user.CoreUser;
import com.discord.models.user.MeUser;
import com.discord.models.user.User;
import com.discord.nullserializable.NullSerializable;
import com.discord.restapi.RestAPIParams;
import com.discord.simpleast.core.node.Node;
import com.discord.simpleast.core.parser.Parser;
import com.discord.stores.StoreApplicationStreamPreviews;
import com.discord.stores.StoreApplicationStreaming;
import com.discord.stores.StoreMediaSettings;
import com.discord.stores.StoreStream;
import com.discord.stores.StoreUserNotes;
import com.discord.stores.StoreUserProfile;
import com.discord.utilities.dimen.DimenUtils;
import com.discord.utilities.guilds.RoleUtils;
import com.discord.utilities.icon.IconUtils;
import com.discord.utilities.permissions.ManageUserContext;
import com.discord.utilities.permissions.PermissionUtils;
import com.discord.utilities.rest.RestAPI;
import com.discord.utilities.rx.ObservableExtensionsKt;
import com.discord.utilities.streams.StreamContext;
import com.discord.utilities.textprocessing.DiscordParser;
import com.discord.utilities.textprocessing.MessageParseState;
import com.discord.utilities.textprocessing.MessagePreprocessor;
import com.discord.utilities.textprocessing.MessageRenderContext;
import com.discord.utilities.textprocessing.node.SpoilerNode;
import com.discord.utilities.voice.PerceptualVolumeUtils;
import com.discord.widgets.stage.StageChannelAPI;
import com.discord.widgets.stage.StageRoles;
import com.discord.widgets.stage.usersheet.UserProfileStageActionsView;
import com.discord.widgets.user.presence.ModelRichPresence;
import com.discord.widgets.user.profile.UserProfileAdminView;
import com.discord.widgets.user.profile.UserProfileConnectionsView;
import com.discord.widgets.user.usersheet.UserProfileVoiceSettingsView;
import com.discord.widgets.user.usersheet.WidgetUserSheet;
import d0.g0.t;
import d0.t.n;
import d0.t.u;
import d0.z.d.m;
import d0.z.d.o;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import rx.Observable;
import rx.subjects.PublishSubject;
/* compiled from: WidgetUserSheetViewModel.kt */
public final class WidgetUserSheetViewModel extends AppViewModel<ViewState> {
public static final Companion Companion = new Companion(null);
public static final String LOCATION = "User Profile";
private final Parser<MessageRenderContext, Node<MessageRenderContext>, MessageParseState> bioParser;
private final long channelId;
private final PublishSubject<Event> eventSubject;
private Set<String> fetchedPreviews;
private final String friendToken;
private final Long guildId;
private final boolean isVoiceContext;
private StoreState mostRecentStoreState;
private boolean openPopoutLogged;
private final RestAPI restAPI;
private final RestAPI restAPISerializeNulls;
private final Set<Integer> revealedBioIndices;
private final StoreApplicationStreamPreviews storeApplicationStreamPreviews;
private final StoreApplicationStreaming storeApplicationStreaming;
private final StoreMediaSettings storeMediaSettings;
private final StoreUserNotes storeUserNotes;
private final StoreUserProfile storeUserProfile;
private final WidgetUserSheet.StreamPreviewClickBehavior streamPreviewClickBehavior;
private final long userId;
/* compiled from: WidgetUserSheetViewModel.kt */
/* renamed from: com.discord.widgets.user.usersheet.WidgetUserSheetViewModel$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function1<StoreState, Unit> {
public final /* synthetic */ WidgetUserSheetViewModel this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(WidgetUserSheetViewModel widgetUserSheetViewModel) {
super(1);
this.this$0 = widgetUserSheetViewModel;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(StoreState storeState) {
invoke(storeState);
return Unit.a;
}
public final void invoke(StoreState storeState) {
WidgetUserSheetViewModel.access$handleStoreState(this.this$0, storeState);
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static abstract class Event {
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class DismissSheet extends Event {
public static final DismissSheet INSTANCE = new DismissSheet();
private DismissSheet() {
super(null);
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class LaunchBanUser extends Event {
private final long guildId;
private final long userId;
private final String username;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public LaunchBanUser(String str, long j, long j2) {
super(null);
m.checkNotNullParameter(str, "username");
this.username = str;
this.guildId = j;
this.userId = j2;
}
public static /* synthetic */ LaunchBanUser copy$default(LaunchBanUser launchBanUser, String str, long j, long j2, int i, Object obj) {
if ((i & 1) != 0) {
str = launchBanUser.username;
}
if ((i & 2) != 0) {
j = launchBanUser.guildId;
}
if ((i & 4) != 0) {
j2 = launchBanUser.userId;
}
return launchBanUser.copy(str, j, j2);
}
public final String component1() {
return this.username;
}
public final long component2() {
return this.guildId;
}
public final long component3() {
return this.userId;
}
public final LaunchBanUser copy(String str, long j, long j2) {
m.checkNotNullParameter(str, "username");
return new LaunchBanUser(str, j, j2);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof LaunchBanUser)) {
return false;
}
LaunchBanUser launchBanUser = (LaunchBanUser) obj;
return m.areEqual(this.username, launchBanUser.username) && this.guildId == launchBanUser.guildId && this.userId == launchBanUser.userId;
}
public final long getGuildId() {
return this.guildId;
}
public final long getUserId() {
return this.userId;
}
public final String getUsername() {
return this.username;
}
public int hashCode() {
String str = this.username;
int hashCode = str != null ? str.hashCode() : 0;
return b.a(this.userId) + ((b.a(this.guildId) + (hashCode * 31)) * 31);
}
public String toString() {
StringBuilder R = a.R("LaunchBanUser(username=");
R.append(this.username);
R.append(", guildId=");
R.append(this.guildId);
R.append(", userId=");
return a.B(R, this.userId, ")");
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class LaunchDisableCommunication extends Event {
private final long guildId;
private final long userId;
public LaunchDisableCommunication(long j, long j2) {
super(null);
this.userId = j;
this.guildId = j2;
}
public static /* synthetic */ LaunchDisableCommunication copy$default(LaunchDisableCommunication launchDisableCommunication, long j, long j2, int i, Object obj) {
if ((i & 1) != 0) {
j = launchDisableCommunication.userId;
}
if ((i & 2) != 0) {
j2 = launchDisableCommunication.guildId;
}
return launchDisableCommunication.copy(j, j2);
}
public final long component1() {
return this.userId;
}
public final long component2() {
return this.guildId;
}
public final LaunchDisableCommunication copy(long j, long j2) {
return new LaunchDisableCommunication(j, j2);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof LaunchDisableCommunication)) {
return false;
}
LaunchDisableCommunication launchDisableCommunication = (LaunchDisableCommunication) obj;
return this.userId == launchDisableCommunication.userId && this.guildId == launchDisableCommunication.guildId;
}
public final long getGuildId() {
return this.guildId;
}
public final long getUserId() {
return this.userId;
}
public int hashCode() {
return b.a(this.guildId) + (b.a(this.userId) * 31);
}
public String toString() {
StringBuilder R = a.R("LaunchDisableCommunication(userId=");
R.append(this.userId);
R.append(", guildId=");
return a.B(R, this.guildId, ")");
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class LaunchEditMember extends Event {
private final long guildId;
private final long userId;
public LaunchEditMember(long j, long j2) {
super(null);
this.guildId = j;
this.userId = j2;
}
public static /* synthetic */ LaunchEditMember copy$default(LaunchEditMember launchEditMember, long j, long j2, int i, Object obj) {
if ((i & 1) != 0) {
j = launchEditMember.guildId;
}
if ((i & 2) != 0) {
j2 = launchEditMember.userId;
}
return launchEditMember.copy(j, j2);
}
public final long component1() {
return this.guildId;
}
public final long component2() {
return this.userId;
}
public final LaunchEditMember copy(long j, long j2) {
return new LaunchEditMember(j, j2);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof LaunchEditMember)) {
return false;
}
LaunchEditMember launchEditMember = (LaunchEditMember) obj;
return this.guildId == launchEditMember.guildId && this.userId == launchEditMember.userId;
}
public final long getGuildId() {
return this.guildId;
}
public final long getUserId() {
return this.userId;
}
public int hashCode() {
return b.a(this.userId) + (b.a(this.guildId) * 31);
}
public String toString() {
StringBuilder R = a.R("LaunchEditMember(guildId=");
R.append(this.guildId);
R.append(", userId=");
return a.B(R, this.userId, ")");
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class LaunchEnableCommunication extends Event {
private final long guildId;
private final long userId;
public LaunchEnableCommunication(long j, long j2) {
super(null);
this.userId = j;
this.guildId = j2;
}
public static /* synthetic */ LaunchEnableCommunication copy$default(LaunchEnableCommunication launchEnableCommunication, long j, long j2, int i, Object obj) {
if ((i & 1) != 0) {
j = launchEnableCommunication.userId;
}
if ((i & 2) != 0) {
j2 = launchEnableCommunication.guildId;
}
return launchEnableCommunication.copy(j, j2);
}
public final long component1() {
return this.userId;
}
public final long component2() {
return this.guildId;
}
public final LaunchEnableCommunication copy(long j, long j2) {
return new LaunchEnableCommunication(j, j2);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof LaunchEnableCommunication)) {
return false;
}
LaunchEnableCommunication launchEnableCommunication = (LaunchEnableCommunication) obj;
return this.userId == launchEnableCommunication.userId && this.guildId == launchEnableCommunication.guildId;
}
public final long getGuildId() {
return this.guildId;
}
public final long getUserId() {
return this.userId;
}
public int hashCode() {
return b.a(this.guildId) + (b.a(this.userId) * 31);
}
public String toString() {
StringBuilder R = a.R("LaunchEnableCommunication(userId=");
R.append(this.userId);
R.append(", guildId=");
return a.B(R, this.guildId, ")");
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class LaunchKickUser extends Event {
private final long guildId;
private final long userId;
private final String username;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public LaunchKickUser(String str, long j, long j2) {
super(null);
m.checkNotNullParameter(str, "username");
this.username = str;
this.guildId = j;
this.userId = j2;
}
public static /* synthetic */ LaunchKickUser copy$default(LaunchKickUser launchKickUser, String str, long j, long j2, int i, Object obj) {
if ((i & 1) != 0) {
str = launchKickUser.username;
}
if ((i & 2) != 0) {
j = launchKickUser.guildId;
}
if ((i & 4) != 0) {
j2 = launchKickUser.userId;
}
return launchKickUser.copy(str, j, j2);
}
public final String component1() {
return this.username;
}
public final long component2() {
return this.guildId;
}
public final long component3() {
return this.userId;
}
public final LaunchKickUser copy(String str, long j, long j2) {
m.checkNotNullParameter(str, "username");
return new LaunchKickUser(str, j, j2);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof LaunchKickUser)) {
return false;
}
LaunchKickUser launchKickUser = (LaunchKickUser) obj;
return m.areEqual(this.username, launchKickUser.username) && this.guildId == launchKickUser.guildId && this.userId == launchKickUser.userId;
}
public final long getGuildId() {
return this.guildId;
}
public final long getUserId() {
return this.userId;
}
public final String getUsername() {
return this.username;
}
public int hashCode() {
String str = this.username;
int hashCode = str != null ? str.hashCode() : 0;
return b.a(this.userId) + ((b.a(this.guildId) + (hashCode * 31)) * 31);
}
public String toString() {
StringBuilder R = a.R("LaunchKickUser(username=");
R.append(this.username);
R.append(", guildId=");
R.append(this.guildId);
R.append(", userId=");
return a.B(R, this.userId, ")");
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class LaunchMoveUser extends Event {
private final long guildId;
public LaunchMoveUser(long j) {
super(null);
this.guildId = j;
}
public static /* synthetic */ LaunchMoveUser copy$default(LaunchMoveUser launchMoveUser, long j, int i, Object obj) {
if ((i & 1) != 0) {
j = launchMoveUser.guildId;
}
return launchMoveUser.copy(j);
}
public final long component1() {
return this.guildId;
}
public final LaunchMoveUser copy(long j) {
return new LaunchMoveUser(j);
}
public boolean equals(Object obj) {
if (this != obj) {
return (obj instanceof LaunchMoveUser) && this.guildId == ((LaunchMoveUser) obj).guildId;
}
return true;
}
public final long getGuildId() {
return this.guildId;
}
public int hashCode() {
return b.a(this.guildId);
}
public String toString() {
return a.B(a.R("LaunchMoveUser(guildId="), this.guildId, ")");
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class LaunchSpectate extends Event {
private final ModelApplicationStream stream;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public LaunchSpectate(ModelApplicationStream modelApplicationStream) {
super(null);
m.checkNotNullParameter(modelApplicationStream, "stream");
this.stream = modelApplicationStream;
}
public static /* synthetic */ LaunchSpectate copy$default(LaunchSpectate launchSpectate, ModelApplicationStream modelApplicationStream, int i, Object obj) {
if ((i & 1) != 0) {
modelApplicationStream = launchSpectate.stream;
}
return launchSpectate.copy(modelApplicationStream);
}
public final ModelApplicationStream component1() {
return this.stream;
}
public final LaunchSpectate copy(ModelApplicationStream modelApplicationStream) {
m.checkNotNullParameter(modelApplicationStream, "stream");
return new LaunchSpectate(modelApplicationStream);
}
public boolean equals(Object obj) {
if (this != obj) {
return (obj instanceof LaunchSpectate) && m.areEqual(this.stream, ((LaunchSpectate) obj).stream);
}
return true;
}
public final ModelApplicationStream getStream() {
return this.stream;
}
public int hashCode() {
ModelApplicationStream modelApplicationStream = this.stream;
if (modelApplicationStream != null) {
return modelApplicationStream.hashCode();
}
return 0;
}
public String toString() {
StringBuilder R = a.R("LaunchSpectate(stream=");
R.append(this.stream);
R.append(")");
return R.toString();
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class LaunchVideoCall extends Event {
private final long channelId;
public LaunchVideoCall(long j) {
super(null);
this.channelId = j;
}
public static /* synthetic */ LaunchVideoCall copy$default(LaunchVideoCall launchVideoCall, long j, int i, Object obj) {
if ((i & 1) != 0) {
j = launchVideoCall.channelId;
}
return launchVideoCall.copy(j);
}
public final long component1() {
return this.channelId;
}
public final LaunchVideoCall copy(long j) {
return new LaunchVideoCall(j);
}
public boolean equals(Object obj) {
if (this != obj) {
return (obj instanceof LaunchVideoCall) && this.channelId == ((LaunchVideoCall) obj).channelId;
}
return true;
}
public final long getChannelId() {
return this.channelId;
}
public int hashCode() {
return b.a(this.channelId);
}
public String toString() {
return a.B(a.R("LaunchVideoCall(channelId="), this.channelId, ")");
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class LaunchVoiceCall extends Event {
private final long channelId;
public LaunchVoiceCall(long j) {
super(null);
this.channelId = j;
}
public static /* synthetic */ LaunchVoiceCall copy$default(LaunchVoiceCall launchVoiceCall, long j, int i, Object obj) {
if ((i & 1) != 0) {
j = launchVoiceCall.channelId;
}
return launchVoiceCall.copy(j);
}
public final long component1() {
return this.channelId;
}
public final LaunchVoiceCall copy(long j) {
return new LaunchVoiceCall(j);
}
public boolean equals(Object obj) {
if (this != obj) {
return (obj instanceof LaunchVoiceCall) && this.channelId == ((LaunchVoiceCall) obj).channelId;
}
return true;
}
public final long getChannelId() {
return this.channelId;
}
public int hashCode() {
return b.a(this.channelId);
}
public String toString() {
return a.B(a.R("LaunchVoiceCall(channelId="), this.channelId, ")");
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class RequestPermissionsForSpectateStream extends Event {
private final ModelApplicationStream stream;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public RequestPermissionsForSpectateStream(ModelApplicationStream modelApplicationStream) {
super(null);
m.checkNotNullParameter(modelApplicationStream, "stream");
this.stream = modelApplicationStream;
}
public static /* synthetic */ RequestPermissionsForSpectateStream copy$default(RequestPermissionsForSpectateStream requestPermissionsForSpectateStream, ModelApplicationStream modelApplicationStream, int i, Object obj) {
if ((i & 1) != 0) {
modelApplicationStream = requestPermissionsForSpectateStream.stream;
}
return requestPermissionsForSpectateStream.copy(modelApplicationStream);
}
public final ModelApplicationStream component1() {
return this.stream;
}
public final RequestPermissionsForSpectateStream copy(ModelApplicationStream modelApplicationStream) {
m.checkNotNullParameter(modelApplicationStream, "stream");
return new RequestPermissionsForSpectateStream(modelApplicationStream);
}
public boolean equals(Object obj) {
if (this != obj) {
return (obj instanceof RequestPermissionsForSpectateStream) && m.areEqual(this.stream, ((RequestPermissionsForSpectateStream) obj).stream);
}
return true;
}
public final ModelApplicationStream getStream() {
return this.stream;
}
public int hashCode() {
ModelApplicationStream modelApplicationStream = this.stream;
if (modelApplicationStream != null) {
return modelApplicationStream.hashCode();
}
return 0;
}
public String toString() {
StringBuilder R = a.R("RequestPermissionsForSpectateStream(stream=");
R.append(this.stream);
R.append(")");
return R.toString();
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class ShowFriendRequestErrorToast extends Event {
private final int abortCode;
private final String username;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ShowFriendRequestErrorToast(int i, String str) {
super(null);
m.checkNotNullParameter(str, "username");
this.abortCode = i;
this.username = str;
}
public static /* synthetic */ ShowFriendRequestErrorToast copy$default(ShowFriendRequestErrorToast showFriendRequestErrorToast, int i, String str, int i2, Object obj) {
if ((i2 & 1) != 0) {
i = showFriendRequestErrorToast.abortCode;
}
if ((i2 & 2) != 0) {
str = showFriendRequestErrorToast.username;
}
return showFriendRequestErrorToast.copy(i, str);
}
public final int component1() {
return this.abortCode;
}
public final String component2() {
return this.username;
}
public final ShowFriendRequestErrorToast copy(int i, String str) {
m.checkNotNullParameter(str, "username");
return new ShowFriendRequestErrorToast(i, str);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ShowFriendRequestErrorToast)) {
return false;
}
ShowFriendRequestErrorToast showFriendRequestErrorToast = (ShowFriendRequestErrorToast) obj;
return this.abortCode == showFriendRequestErrorToast.abortCode && m.areEqual(this.username, showFriendRequestErrorToast.username);
}
public final int getAbortCode() {
return this.abortCode;
}
public final String getUsername() {
return this.username;
}
public int hashCode() {
int i = this.abortCode * 31;
String str = this.username;
return i + (str != null ? str.hashCode() : 0);
}
public String toString() {
StringBuilder R = a.R("ShowFriendRequestErrorToast(abortCode=");
R.append(this.abortCode);
R.append(", username=");
return a.H(R, this.username, ")");
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class ShowToast extends Event {
private final int stringRes;
public ShowToast(int i) {
super(null);
this.stringRes = i;
}
public static /* synthetic */ ShowToast copy$default(ShowToast showToast, int i, int i2, Object obj) {
if ((i2 & 1) != 0) {
i = showToast.stringRes;
}
return showToast.copy(i);
}
public final int component1() {
return this.stringRes;
}
public final ShowToast copy(int i) {
return new ShowToast(i);
}
public boolean equals(Object obj) {
if (this != obj) {
return (obj instanceof ShowToast) && this.stringRes == ((ShowToast) obj).stringRes;
}
return true;
}
public final int getStringRes() {
return this.stringRes;
}
public int hashCode() {
return this.stringRes;
}
public String toString() {
return a.A(a.R("ShowToast(stringRes="), this.stringRes, ")");
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class UserNotFound extends Event {
public static final UserNotFound INSTANCE = new UserNotFound();
private UserNotFound() {
super(null);
}
}
private Event() {
}
public /* synthetic */ Event(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class StoreState {
private final boolean canDisableCommunication;
private final Channel channel;
private final Map<Long, GuildMember> computedMembers;
private final Map<Long, VoiceState> currentChannelVoiceStates;
private final Guild guild;
private final Map<Long, GuildRole> guildRoles;
/* renamed from: me reason: collision with root package name */
private final MeUser f2834me;
private final boolean muted;
private final Map<Long, VoiceState> mySelectedVoiceChannelVoiceStates;
private final StageRoles myStageRoles;
private final float outputVolume;
private final Long permissions;
private final ModelRichPresence richPresence;
private final boolean selfDeafened;
private final boolean selfMuted;
private final Channel stageChannel;
private final StreamContext streamContext;
private final User user;
private final StoreUserNotes.UserNoteState userNoteFetchState;
private final UserProfile userProfile;
private final Integer userRelationshipType;
private final StageRequestToSpeakState userRequestToSpeakState;
private final StageRoles userStageRoles;
private StoreState(User user, MeUser meUser, Channel channel, Map<Long, GuildMember> map, Map<Long, GuildRole> map2, Map<Long, VoiceState> map3, Map<Long, VoiceState> map4, boolean z2, boolean z3, boolean z4, float f, ModelRichPresence modelRichPresence, Guild guild, Long l, StreamContext streamContext, UserProfile userProfile, Integer num, StoreUserNotes.UserNoteState userNoteState, Channel channel2, StageRoles stageRoles, StageRequestToSpeakState stageRequestToSpeakState, StageRoles stageRoles2, boolean z5) {
this.user = user;
this.f2834me = meUser;
this.channel = channel;
this.computedMembers = map;
this.guildRoles = map2;
this.mySelectedVoiceChannelVoiceStates = map3;
this.currentChannelVoiceStates = map4;
this.muted = z2;
this.selfMuted = z3;
this.selfDeafened = z4;
this.outputVolume = f;
this.richPresence = modelRichPresence;
this.guild = guild;
this.permissions = l;
this.streamContext = streamContext;
this.userProfile = userProfile;
this.userRelationshipType = num;
this.userNoteFetchState = userNoteState;
this.stageChannel = channel2;
this.userStageRoles = stageRoles;
this.userRequestToSpeakState = stageRequestToSpeakState;
this.myStageRoles = stageRoles2;
this.canDisableCommunication = z5;
}
public /* synthetic */ StoreState(User user, MeUser meUser, Channel channel, Map map, Map map2, Map map3, Map map4, boolean z2, boolean z3, boolean z4, float f, ModelRichPresence modelRichPresence, Guild guild, Long l, StreamContext streamContext, UserProfile userProfile, Integer num, StoreUserNotes.UserNoteState userNoteState, Channel channel2, StageRoles stageRoles, StageRequestToSpeakState stageRequestToSpeakState, StageRoles stageRoles2, boolean z5, DefaultConstructorMarker defaultConstructorMarker) {
this(user, meUser, channel, map, map2, map3, map4, z2, z3, z4, f, modelRichPresence, guild, l, streamContext, userProfile, num, userNoteState, channel2, stageRoles, stageRequestToSpeakState, stageRoles2, z5);
}
/* renamed from: copy-U9gTzXU$default reason: not valid java name */
public static /* synthetic */ StoreState m49copyU9gTzXU$default(StoreState storeState, User user, MeUser meUser, Channel channel, Map map, Map map2, Map map3, Map map4, boolean z2, boolean z3, boolean z4, float f, ModelRichPresence modelRichPresence, Guild guild, Long l, StreamContext streamContext, UserProfile userProfile, Integer num, StoreUserNotes.UserNoteState userNoteState, Channel channel2, StageRoles stageRoles, StageRequestToSpeakState stageRequestToSpeakState, StageRoles stageRoles2, boolean z5, int i, Object obj) {
return storeState.m52copyU9gTzXU((i & 1) != 0 ? storeState.user : user, (i & 2) != 0 ? storeState.f2834me : meUser, (i & 4) != 0 ? storeState.channel : channel, (i & 8) != 0 ? storeState.computedMembers : map, (i & 16) != 0 ? storeState.guildRoles : map2, (i & 32) != 0 ? storeState.mySelectedVoiceChannelVoiceStates : map3, (i & 64) != 0 ? storeState.currentChannelVoiceStates : map4, (i & 128) != 0 ? storeState.muted : z2, (i & 256) != 0 ? storeState.selfMuted : z3, (i & 512) != 0 ? storeState.selfDeafened : z4, (i & 1024) != 0 ? storeState.outputVolume : f, (i & 2048) != 0 ? storeState.richPresence : modelRichPresence, (i & 4096) != 0 ? storeState.guild : guild, (i & 8192) != 0 ? storeState.permissions : l, (i & 16384) != 0 ? storeState.streamContext : streamContext, (i & 32768) != 0 ? storeState.userProfile : userProfile, (i & 65536) != 0 ? storeState.userRelationshipType : num, (i & 131072) != 0 ? storeState.userNoteFetchState : userNoteState, (i & 262144) != 0 ? storeState.stageChannel : channel2, (i & 524288) != 0 ? storeState.userStageRoles : stageRoles, (i & 1048576) != 0 ? storeState.userRequestToSpeakState : stageRequestToSpeakState, (i & 2097152) != 0 ? storeState.myStageRoles : stageRoles2, (i & 4194304) != 0 ? storeState.canDisableCommunication : z5);
}
public final User component1() {
return this.user;
}
public final boolean component10() {
return this.selfDeafened;
}
public final float component11() {
return this.outputVolume;
}
public final ModelRichPresence component12() {
return this.richPresence;
}
public final Guild component13() {
return this.guild;
}
public final Long component14() {
return this.permissions;
}
public final StreamContext component15() {
return this.streamContext;
}
public final UserProfile component16() {
return this.userProfile;
}
public final Integer component17() {
return this.userRelationshipType;
}
public final StoreUserNotes.UserNoteState component18() {
return this.userNoteFetchState;
}
public final Channel component19() {
return this.stageChannel;
}
public final MeUser component2() {
return this.f2834me;
}
/* renamed from: component20-twRsX-0 reason: not valid java name */
public final StageRoles m50component20twRsX0() {
return this.userStageRoles;
}
public final StageRequestToSpeakState component21() {
return this.userRequestToSpeakState;
}
/* renamed from: component22-twRsX-0 reason: not valid java name */
public final StageRoles m51component22twRsX0() {
return this.myStageRoles;
}
public final boolean component23() {
return this.canDisableCommunication;
}
public final Channel component3() {
return this.channel;
}
public final Map<Long, GuildMember> component4() {
return this.computedMembers;
}
public final Map<Long, GuildRole> component5() {
return this.guildRoles;
}
public final Map<Long, VoiceState> component6() {
return this.mySelectedVoiceChannelVoiceStates;
}
public final Map<Long, VoiceState> component7() {
return this.currentChannelVoiceStates;
}
public final boolean component8() {
return this.muted;
}
public final boolean component9() {
return this.selfMuted;
}
/* renamed from: copy-U9gTzXU reason: not valid java name */
public final StoreState m52copyU9gTzXU(User user, MeUser meUser, Channel channel, Map<Long, GuildMember> map, Map<Long, GuildRole> map2, Map<Long, VoiceState> map3, Map<Long, VoiceState> map4, boolean z2, boolean z3, boolean z4, float f, ModelRichPresence modelRichPresence, Guild guild, Long l, StreamContext streamContext, UserProfile userProfile, Integer num, StoreUserNotes.UserNoteState userNoteState, Channel channel2, StageRoles stageRoles, StageRequestToSpeakState stageRequestToSpeakState, StageRoles stageRoles2, boolean z5) {
m.checkNotNullParameter(user, "user");
m.checkNotNullParameter(meUser, "me");
m.checkNotNullParameter(map, "computedMembers");
m.checkNotNullParameter(map2, "guildRoles");
m.checkNotNullParameter(map3, "mySelectedVoiceChannelVoiceStates");
m.checkNotNullParameter(map4, "currentChannelVoiceStates");
m.checkNotNullParameter(userProfile, "userProfile");
m.checkNotNullParameter(userNoteState, "userNoteFetchState");
m.checkNotNullParameter(stageRequestToSpeakState, "userRequestToSpeakState");
return new StoreState(user, meUser, channel, map, map2, map3, map4, z2, z3, z4, f, modelRichPresence, guild, l, streamContext, userProfile, num, userNoteState, channel2, stageRoles, stageRequestToSpeakState, stageRoles2, z5);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof StoreState)) {
return false;
}
StoreState storeState = (StoreState) obj;
return m.areEqual(this.user, storeState.user) && m.areEqual(this.f2834me, storeState.f2834me) && m.areEqual(this.channel, storeState.channel) && m.areEqual(this.computedMembers, storeState.computedMembers) && m.areEqual(this.guildRoles, storeState.guildRoles) && m.areEqual(this.mySelectedVoiceChannelVoiceStates, storeState.mySelectedVoiceChannelVoiceStates) && m.areEqual(this.currentChannelVoiceStates, storeState.currentChannelVoiceStates) && this.muted == storeState.muted && this.selfMuted == storeState.selfMuted && this.selfDeafened == storeState.selfDeafened && Float.compare(this.outputVolume, storeState.outputVolume) == 0 && m.areEqual(this.richPresence, storeState.richPresence) && m.areEqual(this.guild, storeState.guild) && m.areEqual(this.permissions, storeState.permissions) && m.areEqual(this.streamContext, storeState.streamContext) && m.areEqual(this.userProfile, storeState.userProfile) && m.areEqual(this.userRelationshipType, storeState.userRelationshipType) && m.areEqual(this.userNoteFetchState, storeState.userNoteFetchState) && m.areEqual(this.stageChannel, storeState.stageChannel) && m.areEqual(this.userStageRoles, storeState.userStageRoles) && m.areEqual(this.userRequestToSpeakState, storeState.userRequestToSpeakState) && m.areEqual(this.myStageRoles, storeState.myStageRoles) && this.canDisableCommunication == storeState.canDisableCommunication;
}
public final boolean getCanDisableCommunication() {
return this.canDisableCommunication;
}
public final Channel getChannel() {
return this.channel;
}
public final Map<Long, GuildMember> getComputedMembers() {
return this.computedMembers;
}
public final Map<Long, VoiceState> getCurrentChannelVoiceStates() {
return this.currentChannelVoiceStates;
}
public final Guild getGuild() {
return this.guild;
}
public final Map<Long, GuildRole> getGuildRoles() {
return this.guildRoles;
}
public final MeUser getMe() {
return this.f2834me;
}
public final boolean getMuted() {
return this.muted;
}
public final Map<Long, VoiceState> getMySelectedVoiceChannelVoiceStates() {
return this.mySelectedVoiceChannelVoiceStates;
}
/* renamed from: getMyStageRoles-twRsX-0 reason: not valid java name */
public final StageRoles m53getMyStageRolestwRsX0() {
return this.myStageRoles;
}
public final float getOutputVolume() {
return this.outputVolume;
}
public final Long getPermissions() {
return this.permissions;
}
public final ModelRichPresence getRichPresence() {
return this.richPresence;
}
public final boolean getSelfDeafened() {
return this.selfDeafened;
}
public final boolean getSelfMuted() {
return this.selfMuted;
}
public final Channel getStageChannel() {
return this.stageChannel;
}
public final StreamContext getStreamContext() {
return this.streamContext;
}
public final User getUser() {
return this.user;
}
public final StoreUserNotes.UserNoteState getUserNoteFetchState() {
return this.userNoteFetchState;
}
public final UserProfile getUserProfile() {
return this.userProfile;
}
public final Integer getUserRelationshipType() {
return this.userRelationshipType;
}
public final StageRequestToSpeakState getUserRequestToSpeakState() {
return this.userRequestToSpeakState;
}
/* renamed from: getUserStageRoles-twRsX-0 reason: not valid java name */
public final StageRoles m54getUserStageRolestwRsX0() {
return this.userStageRoles;
}
public int hashCode() {
User user = this.user;
int i = 0;
int hashCode = (user != null ? user.hashCode() : 0) * 31;
MeUser meUser = this.f2834me;
int hashCode2 = (hashCode + (meUser != null ? meUser.hashCode() : 0)) * 31;
Channel channel = this.channel;
int hashCode3 = (hashCode2 + (channel != null ? channel.hashCode() : 0)) * 31;
Map<Long, GuildMember> map = this.computedMembers;
int hashCode4 = (hashCode3 + (map != null ? map.hashCode() : 0)) * 31;
Map<Long, GuildRole> map2 = this.guildRoles;
int hashCode5 = (hashCode4 + (map2 != null ? map2.hashCode() : 0)) * 31;
Map<Long, VoiceState> map3 = this.mySelectedVoiceChannelVoiceStates;
int hashCode6 = (hashCode5 + (map3 != null ? map3.hashCode() : 0)) * 31;
Map<Long, VoiceState> map4 = this.currentChannelVoiceStates;
int hashCode7 = (hashCode6 + (map4 != null ? map4.hashCode() : 0)) * 31;
boolean z2 = this.muted;
int i2 = 1;
if (z2) {
z2 = true;
}
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = z2 ? 1 : 0;
int i6 = (hashCode7 + i3) * 31;
boolean z3 = this.selfMuted;
if (z3) {
z3 = true;
}
int i7 = z3 ? 1 : 0;
int i8 = z3 ? 1 : 0;
int i9 = z3 ? 1 : 0;
int i10 = (i6 + i7) * 31;
boolean z4 = this.selfDeafened;
if (z4) {
z4 = true;
}
int i11 = z4 ? 1 : 0;
int i12 = z4 ? 1 : 0;
int i13 = z4 ? 1 : 0;
int floatToIntBits = (Float.floatToIntBits(this.outputVolume) + ((i10 + i11) * 31)) * 31;
ModelRichPresence modelRichPresence = this.richPresence;
int hashCode8 = (floatToIntBits + (modelRichPresence != null ? modelRichPresence.hashCode() : 0)) * 31;
Guild guild = this.guild;
int hashCode9 = (hashCode8 + (guild != null ? guild.hashCode() : 0)) * 31;
Long l = this.permissions;
int hashCode10 = (hashCode9 + (l != null ? l.hashCode() : 0)) * 31;
StreamContext streamContext = this.streamContext;
int hashCode11 = (hashCode10 + (streamContext != null ? streamContext.hashCode() : 0)) * 31;
UserProfile userProfile = this.userProfile;
int hashCode12 = (hashCode11 + (userProfile != null ? userProfile.hashCode() : 0)) * 31;
Integer num = this.userRelationshipType;
int hashCode13 = (hashCode12 + (num != null ? num.hashCode() : 0)) * 31;
StoreUserNotes.UserNoteState userNoteState = this.userNoteFetchState;
int hashCode14 = (hashCode13 + (userNoteState != null ? userNoteState.hashCode() : 0)) * 31;
Channel channel2 = this.stageChannel;
int hashCode15 = (hashCode14 + (channel2 != null ? channel2.hashCode() : 0)) * 31;
StageRoles stageRoles = this.userStageRoles;
int hashCode16 = (hashCode15 + (stageRoles != null ? stageRoles.hashCode() : 0)) * 31;
StageRequestToSpeakState stageRequestToSpeakState = this.userRequestToSpeakState;
int hashCode17 = (hashCode16 + (stageRequestToSpeakState != null ? stageRequestToSpeakState.hashCode() : 0)) * 31;
StageRoles stageRoles2 = this.myStageRoles;
if (stageRoles2 != null) {
i = stageRoles2.hashCode();
}
int i14 = (hashCode17 + i) * 31;
boolean z5 = this.canDisableCommunication;
if (!z5) {
i2 = z5 ? 1 : 0;
}
return i14 + i2;
}
public String toString() {
StringBuilder R = a.R("StoreState(user=");
R.append(this.user);
R.append(", me=");
R.append(this.f2834me);
R.append(", channel=");
R.append(this.channel);
R.append(", computedMembers=");
R.append(this.computedMembers);
R.append(", guildRoles=");
R.append(this.guildRoles);
R.append(", mySelectedVoiceChannelVoiceStates=");
R.append(this.mySelectedVoiceChannelVoiceStates);
R.append(", currentChannelVoiceStates=");
R.append(this.currentChannelVoiceStates);
R.append(", muted=");
R.append(this.muted);
R.append(", selfMuted=");
R.append(this.selfMuted);
R.append(", selfDeafened=");
R.append(this.selfDeafened);
R.append(", outputVolume=");
R.append(this.outputVolume);
R.append(", richPresence=");
R.append(this.richPresence);
R.append(", guild=");
R.append(this.guild);
R.append(", permissions=");
R.append(this.permissions);
R.append(", streamContext=");
R.append(this.streamContext);
R.append(", userProfile=");
R.append(this.userProfile);
R.append(", userRelationshipType=");
R.append(this.userRelationshipType);
R.append(", userNoteFetchState=");
R.append(this.userNoteFetchState);
R.append(", stageChannel=");
R.append(this.stageChannel);
R.append(", userStageRoles=");
R.append(this.userStageRoles);
R.append(", userRequestToSpeakState=");
R.append(this.userRequestToSpeakState);
R.append(", myStageRoles=");
R.append(this.myStageRoles);
R.append(", canDisableCommunication=");
return a.L(R, this.canDisableCommunication, ")");
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static abstract class ViewState {
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class Loaded extends ViewState {
private final UserProfileAdminView.ViewState adminViewState;
private final List<Node<MessageRenderContext>> bioAst;
private final Channel channel;
private final VoiceState channelVoiceState;
private final UserProfileConnectionsView.ViewState connectionsViewState;
private final Long currentGuildId;
private final String guildIcon;
private final String guildIconURL;
private final Long guildId;
private final GuildMember guildMember;
private final String guildName;
private final String guildSectionHeaderText;
private final boolean hasGuildMemberBio;
private final boolean hasPremiumCustomization;
private final boolean isMe;
private final boolean profileLoaded;
private final ModelRichPresence richPresence;
private final List<GuildRole> roleItems;
private final boolean showVoiceSettings;
private final UserProfileStageActionsView.ViewState stageViewState;
private final StreamContext streamContext;
private final User user;
private final boolean userInSameVoiceChannel;
private final String userNote;
private final StoreUserNotes.UserNoteState userNoteFetchState;
private final UserProfile userProfile;
private final int userRelationshipType;
private final UserProfileVoiceSettingsView.ViewState voiceSettingsViewState;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public Loaded(User user, boolean z2, boolean z3, UserProfileVoiceSettingsView.ViewState viewState, VoiceState voiceState, ModelRichPresence modelRichPresence, String str, List<GuildRole> list, UserProfileAdminView.ViewState viewState2, UserProfileStageActionsView.ViewState viewState3, Channel channel, StreamContext streamContext, String str2, String str3, int i, UserProfileConnectionsView.ViewState viewState4, StoreUserNotes.UserNoteState userNoteState, String str4, boolean z4, List<Node<MessageRenderContext>> list2, boolean z5, Long l, GuildMember guildMember, UserProfile userProfile) {
super(null);
String avatar;
m.checkNotNullParameter(user, "user");
m.checkNotNullParameter(viewState, "voiceSettingsViewState");
m.checkNotNullParameter(list, "roleItems");
m.checkNotNullParameter(viewState3, "stageViewState");
m.checkNotNullParameter(viewState4, "connectionsViewState");
m.checkNotNullParameter(userNoteState, "userNoteFetchState");
String str5 = null;
this.user = user;
this.isMe = z2;
this.showVoiceSettings = z3;
this.voiceSettingsViewState = viewState;
this.channelVoiceState = voiceState;
this.richPresence = modelRichPresence;
this.guildSectionHeaderText = str;
this.roleItems = list;
this.adminViewState = viewState2;
this.stageViewState = viewState3;
this.channel = channel;
this.streamContext = streamContext;
this.guildName = str2;
this.guildIcon = str3;
this.userRelationshipType = i;
this.connectionsViewState = viewState4;
this.userNoteFetchState = userNoteState;
this.userNote = str4;
this.userInSameVoiceChannel = z4;
this.bioAst = list2;
this.profileLoaded = z5;
this.guildId = l;
this.guildMember = guildMember;
this.userProfile = userProfile;
boolean z6 = false;
this.hasPremiumCustomization = user.getBanner() != null || ((avatar = user.getAvatar()) != null && IconUtils.INSTANCE.isImageHashAnimated(avatar));
this.currentGuildId = channel != null ? Long.valueOf(channel.f()) : l;
String bio = guildMember != null ? guildMember.getBio() : null;
this.hasGuildMemberBio = !((bio == null || bio.length() == 0) ? true : z6);
this.guildIconURL = str3 != null ? IconUtils.getForGuild$default(l, str3, null, false, Integer.valueOf(DimenUtils.dpToPixels(16)), 4, null) : str5;
}
public static /* synthetic */ Loaded copy$default(Loaded loaded, User user, boolean z2, boolean z3, UserProfileVoiceSettingsView.ViewState viewState, VoiceState voiceState, ModelRichPresence modelRichPresence, String str, List list, UserProfileAdminView.ViewState viewState2, UserProfileStageActionsView.ViewState viewState3, Channel channel, StreamContext streamContext, String str2, String str3, int i, UserProfileConnectionsView.ViewState viewState4, StoreUserNotes.UserNoteState userNoteState, String str4, boolean z4, List list2, boolean z5, Long l, GuildMember guildMember, UserProfile userProfile, int i2, Object obj) {
return loaded.copy((i2 & 1) != 0 ? loaded.user : user, (i2 & 2) != 0 ? loaded.isMe : z2, (i2 & 4) != 0 ? loaded.showVoiceSettings : z3, (i2 & 8) != 0 ? loaded.voiceSettingsViewState : viewState, (i2 & 16) != 0 ? loaded.channelVoiceState : voiceState, (i2 & 32) != 0 ? loaded.richPresence : modelRichPresence, (i2 & 64) != 0 ? loaded.guildSectionHeaderText : str, (i2 & 128) != 0 ? loaded.roleItems : list, (i2 & 256) != 0 ? loaded.adminViewState : viewState2, (i2 & 512) != 0 ? loaded.stageViewState : viewState3, (i2 & 1024) != 0 ? loaded.channel : channel, (i2 & 2048) != 0 ? loaded.streamContext : streamContext, (i2 & 4096) != 0 ? loaded.guildName : str2, (i2 & 8192) != 0 ? loaded.guildIcon : str3, (i2 & 16384) != 0 ? loaded.userRelationshipType : i, (i2 & 32768) != 0 ? loaded.connectionsViewState : viewState4, (i2 & 65536) != 0 ? loaded.userNoteFetchState : userNoteState, (i2 & 131072) != 0 ? loaded.userNote : str4, (i2 & 262144) != 0 ? loaded.userInSameVoiceChannel : z4, (i2 & 524288) != 0 ? loaded.bioAst : list2, (i2 & 1048576) != 0 ? loaded.profileLoaded : z5, (i2 & 2097152) != 0 ? loaded.guildId : l, (i2 & 4194304) != 0 ? loaded.guildMember : guildMember, (i2 & 8388608) != 0 ? loaded.userProfile : userProfile);
}
public final User component1() {
return this.user;
}
public final UserProfileStageActionsView.ViewState component10() {
return this.stageViewState;
}
public final Channel component11() {
return this.channel;
}
public final StreamContext component12() {
return this.streamContext;
}
public final String component13() {
return this.guildName;
}
public final String component14() {
return this.guildIcon;
}
public final int component15() {
return this.userRelationshipType;
}
public final UserProfileConnectionsView.ViewState component16() {
return this.connectionsViewState;
}
public final StoreUserNotes.UserNoteState component17() {
return this.userNoteFetchState;
}
public final String component18() {
return this.userNote;
}
public final boolean component19() {
return this.userInSameVoiceChannel;
}
public final boolean component2() {
return this.isMe;
}
public final List<Node<MessageRenderContext>> component20() {
return this.bioAst;
}
public final boolean component21() {
return this.profileLoaded;
}
public final Long component22() {
return this.guildId;
}
public final GuildMember component23() {
return this.guildMember;
}
public final UserProfile component24() {
return this.userProfile;
}
public final boolean component3() {
return this.showVoiceSettings;
}
public final UserProfileVoiceSettingsView.ViewState component4() {
return this.voiceSettingsViewState;
}
public final VoiceState component5() {
return this.channelVoiceState;
}
public final ModelRichPresence component6() {
return this.richPresence;
}
public final String component7() {
return this.guildSectionHeaderText;
}
public final List<GuildRole> component8() {
return this.roleItems;
}
public final UserProfileAdminView.ViewState component9() {
return this.adminViewState;
}
public final Loaded copy(User user, boolean z2, boolean z3, UserProfileVoiceSettingsView.ViewState viewState, VoiceState voiceState, ModelRichPresence modelRichPresence, String str, List<GuildRole> list, UserProfileAdminView.ViewState viewState2, UserProfileStageActionsView.ViewState viewState3, Channel channel, StreamContext streamContext, String str2, String str3, int i, UserProfileConnectionsView.ViewState viewState4, StoreUserNotes.UserNoteState userNoteState, String str4, boolean z4, List<Node<MessageRenderContext>> list2, boolean z5, Long l, GuildMember guildMember, UserProfile userProfile) {
m.checkNotNullParameter(user, "user");
m.checkNotNullParameter(viewState, "voiceSettingsViewState");
m.checkNotNullParameter(list, "roleItems");
m.checkNotNullParameter(viewState3, "stageViewState");
m.checkNotNullParameter(viewState4, "connectionsViewState");
m.checkNotNullParameter(userNoteState, "userNoteFetchState");
return new Loaded(user, z2, z3, viewState, voiceState, modelRichPresence, str, list, viewState2, viewState3, channel, streamContext, str2, str3, i, viewState4, userNoteState, str4, z4, list2, z5, l, guildMember, userProfile);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Loaded)) {
return false;
}
Loaded loaded = (Loaded) obj;
return m.areEqual(this.user, loaded.user) && this.isMe == loaded.isMe && this.showVoiceSettings == loaded.showVoiceSettings && m.areEqual(this.voiceSettingsViewState, loaded.voiceSettingsViewState) && m.areEqual(this.channelVoiceState, loaded.channelVoiceState) && m.areEqual(this.richPresence, loaded.richPresence) && m.areEqual(this.guildSectionHeaderText, loaded.guildSectionHeaderText) && m.areEqual(this.roleItems, loaded.roleItems) && m.areEqual(this.adminViewState, loaded.adminViewState) && m.areEqual(this.stageViewState, loaded.stageViewState) && m.areEqual(this.channel, loaded.channel) && m.areEqual(this.streamContext, loaded.streamContext) && m.areEqual(this.guildName, loaded.guildName) && m.areEqual(this.guildIcon, loaded.guildIcon) && this.userRelationshipType == loaded.userRelationshipType && m.areEqual(this.connectionsViewState, loaded.connectionsViewState) && m.areEqual(this.userNoteFetchState, loaded.userNoteFetchState) && m.areEqual(this.userNote, loaded.userNote) && this.userInSameVoiceChannel == loaded.userInSameVoiceChannel && m.areEqual(this.bioAst, loaded.bioAst) && this.profileLoaded == loaded.profileLoaded && m.areEqual(this.guildId, loaded.guildId) && m.areEqual(this.guildMember, loaded.guildMember) && m.areEqual(this.userProfile, loaded.userProfile);
}
public final UserProfileAdminView.ViewState getAdminViewState() {
return this.adminViewState;
}
public final List<Node<MessageRenderContext>> getBioAst() {
return this.bioAst;
}
public final Channel getChannel() {
return this.channel;
}
public final VoiceState getChannelVoiceState() {
return this.channelVoiceState;
}
public final UserProfileConnectionsView.ViewState getConnectionsViewState() {
return this.connectionsViewState;
}
public final Long getCurrentGuildId() {
return this.currentGuildId;
}
public final String getGuildIcon() {
return this.guildIcon;
}
public final String getGuildIconURL() {
return this.guildIconURL;
}
public final Long getGuildId() {
return this.guildId;
}
public final GuildMember getGuildMember() {
return this.guildMember;
}
public final String getGuildName() {
return this.guildName;
}
public final String getGuildSectionHeaderText() {
return this.guildSectionHeaderText;
}
public final boolean getHasGuildMemberBio() {
return this.hasGuildMemberBio;
}
public final boolean getHasPremiumCustomization() {
return this.hasPremiumCustomization;
}
public final Presence getPresence() {
ModelRichPresence modelRichPresence = this.richPresence;
if (modelRichPresence != null) {
return modelRichPresence.getPresence();
}
return null;
}
public final boolean getProfileLoaded() {
return this.profileLoaded;
}
public final ModelRichPresence getRichPresence() {
return this.richPresence;
}
public final List<GuildRole> getRoleItems() {
return this.roleItems;
}
public final boolean getShowVoiceSettings() {
return this.showVoiceSettings;
}
public final UserProfileStageActionsView.ViewState getStageViewState() {
return this.stageViewState;
}
public final StreamContext getStreamContext() {
return this.streamContext;
}
public final User getUser() {
return this.user;
}
public final boolean getUserInSameVoiceChannel() {
return this.userInSameVoiceChannel;
}
public final String getUserNote() {
return this.userNote;
}
public final StoreUserNotes.UserNoteState getUserNoteFetchState() {
return this.userNoteFetchState;
}
public final UserProfile getUserProfile() {
return this.userProfile;
}
public final int getUserRelationshipType() {
return this.userRelationshipType;
}
public final UserProfileVoiceSettingsView.ViewState getVoiceSettingsViewState() {
return this.voiceSettingsViewState;
}
public int hashCode() {
User user = this.user;
int i = 0;
int hashCode = (user != null ? user.hashCode() : 0) * 31;
boolean z2 = this.isMe;
int i2 = 1;
if (z2) {
z2 = true;
}
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = z2 ? 1 : 0;
int i6 = (hashCode + i3) * 31;
boolean z3 = this.showVoiceSettings;
if (z3) {
z3 = true;
}
int i7 = z3 ? 1 : 0;
int i8 = z3 ? 1 : 0;
int i9 = z3 ? 1 : 0;
int i10 = (i6 + i7) * 31;
UserProfileVoiceSettingsView.ViewState viewState = this.voiceSettingsViewState;
int hashCode2 = (i10 + (viewState != null ? viewState.hashCode() : 0)) * 31;
VoiceState voiceState = this.channelVoiceState;
int hashCode3 = (hashCode2 + (voiceState != null ? voiceState.hashCode() : 0)) * 31;
ModelRichPresence modelRichPresence = this.richPresence;
int hashCode4 = (hashCode3 + (modelRichPresence != null ? modelRichPresence.hashCode() : 0)) * 31;
String str = this.guildSectionHeaderText;
int hashCode5 = (hashCode4 + (str != null ? str.hashCode() : 0)) * 31;
List<GuildRole> list = this.roleItems;
int hashCode6 = (hashCode5 + (list != null ? list.hashCode() : 0)) * 31;
UserProfileAdminView.ViewState viewState2 = this.adminViewState;
int hashCode7 = (hashCode6 + (viewState2 != null ? viewState2.hashCode() : 0)) * 31;
UserProfileStageActionsView.ViewState viewState3 = this.stageViewState;
int hashCode8 = (hashCode7 + (viewState3 != null ? viewState3.hashCode() : 0)) * 31;
Channel channel = this.channel;
int hashCode9 = (hashCode8 + (channel != null ? channel.hashCode() : 0)) * 31;
StreamContext streamContext = this.streamContext;
int hashCode10 = (hashCode9 + (streamContext != null ? streamContext.hashCode() : 0)) * 31;
String str2 = this.guildName;
int hashCode11 = (hashCode10 + (str2 != null ? str2.hashCode() : 0)) * 31;
String str3 = this.guildIcon;
int hashCode12 = (((hashCode11 + (str3 != null ? str3.hashCode() : 0)) * 31) + this.userRelationshipType) * 31;
UserProfileConnectionsView.ViewState viewState4 = this.connectionsViewState;
int hashCode13 = (hashCode12 + (viewState4 != null ? viewState4.hashCode() : 0)) * 31;
StoreUserNotes.UserNoteState userNoteState = this.userNoteFetchState;
int hashCode14 = (hashCode13 + (userNoteState != null ? userNoteState.hashCode() : 0)) * 31;
String str4 = this.userNote;
int hashCode15 = (hashCode14 + (str4 != null ? str4.hashCode() : 0)) * 31;
boolean z4 = this.userInSameVoiceChannel;
if (z4) {
z4 = true;
}
int i11 = z4 ? 1 : 0;
int i12 = z4 ? 1 : 0;
int i13 = z4 ? 1 : 0;
int i14 = (hashCode15 + i11) * 31;
List<Node<MessageRenderContext>> list2 = this.bioAst;
int hashCode16 = (i14 + (list2 != null ? list2.hashCode() : 0)) * 31;
boolean z5 = this.profileLoaded;
if (!z5) {
i2 = z5 ? 1 : 0;
}
int i15 = (hashCode16 + i2) * 31;
Long l = this.guildId;
int hashCode17 = (i15 + (l != null ? l.hashCode() : 0)) * 31;
GuildMember guildMember = this.guildMember;
int hashCode18 = (hashCode17 + (guildMember != null ? guildMember.hashCode() : 0)) * 31;
UserProfile userProfile = this.userProfile;
if (userProfile != null) {
i = userProfile.hashCode();
}
return hashCode18 + i;
}
public final boolean isMe() {
return this.isMe;
}
public final boolean shouldShowRoles() {
Long l = this.currentGuildId;
return (this.roleItems.isEmpty() ^ true) && (l != null && (l.longValue() > 0 ? 1 : (l.longValue() == 0 ? 0 : -1)) > 0);
}
public String toString() {
StringBuilder R = a.R("Loaded(user=");
R.append(this.user);
R.append(", isMe=");
R.append(this.isMe);
R.append(", showVoiceSettings=");
R.append(this.showVoiceSettings);
R.append(", voiceSettingsViewState=");
R.append(this.voiceSettingsViewState);
R.append(", channelVoiceState=");
R.append(this.channelVoiceState);
R.append(", richPresence=");
R.append(this.richPresence);
R.append(", guildSectionHeaderText=");
R.append(this.guildSectionHeaderText);
R.append(", roleItems=");
R.append(this.roleItems);
R.append(", adminViewState=");
R.append(this.adminViewState);
R.append(", stageViewState=");
R.append(this.stageViewState);
R.append(", channel=");
R.append(this.channel);
R.append(", streamContext=");
R.append(this.streamContext);
R.append(", guildName=");
R.append(this.guildName);
R.append(", guildIcon=");
R.append(this.guildIcon);
R.append(", userRelationshipType=");
R.append(this.userRelationshipType);
R.append(", connectionsViewState=");
R.append(this.connectionsViewState);
R.append(", userNoteFetchState=");
R.append(this.userNoteFetchState);
R.append(", userNote=");
R.append(this.userNote);
R.append(", userInSameVoiceChannel=");
R.append(this.userInSameVoiceChannel);
R.append(", bioAst=");
R.append(this.bioAst);
R.append(", profileLoaded=");
R.append(this.profileLoaded);
R.append(", guildId=");
R.append(this.guildId);
R.append(", guildMember=");
R.append(this.guildMember);
R.append(", userProfile=");
R.append(this.userProfile);
R.append(")");
return R.toString();
}
}
/* compiled from: WidgetUserSheetViewModel.kt */
public static final class Uninitialized extends ViewState {
public static final Uninitialized INSTANCE = new Uninitialized();
private Uninitialized() {
super(null);
}
}
private ViewState() {
}
public /* synthetic */ ViewState(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
public final /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
public static final /* synthetic */ int[] $EnumSwitchMapping$1;
static {
StoreMediaSettings.SelfMuteFailure.values();
int[] iArr = new int[1];
$EnumSwitchMapping$0 = iArr;
iArr[StoreMediaSettings.SelfMuteFailure.CANNOT_USE_VAD.ordinal()] = 1;
WidgetUserSheet.StreamPreviewClickBehavior.values();
int[] iArr2 = new int[2];
$EnumSwitchMapping$1 = iArr2;
iArr2[WidgetUserSheet.StreamPreviewClickBehavior.TARGET_AND_LAUNCH_SPECTATE.ordinal()] = 1;
iArr2[WidgetUserSheet.StreamPreviewClickBehavior.TARGET_AND_DISMISS.ordinal()] = 2;
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public WidgetUserSheetViewModel(long j, long j2, Long l, String str, boolean z2, Observable<StoreState> observable, WidgetUserSheet.StreamPreviewClickBehavior streamPreviewClickBehavior, StoreMediaSettings storeMediaSettings, StoreApplicationStreaming storeApplicationStreaming, StoreUserNotes storeUserNotes, StoreUserProfile storeUserProfile, RestAPI restAPI, RestAPI restAPI2, StoreApplicationStreamPreviews storeApplicationStreamPreviews, Parser<MessageRenderContext, Node<MessageRenderContext>, MessageParseState> parser) {
super(ViewState.Uninitialized.INSTANCE);
m.checkNotNullParameter(observable, "storeObservable");
m.checkNotNullParameter(streamPreviewClickBehavior, "streamPreviewClickBehavior");
m.checkNotNullParameter(storeMediaSettings, "storeMediaSettings");
m.checkNotNullParameter(storeApplicationStreaming, "storeApplicationStreaming");
m.checkNotNullParameter(storeUserNotes, "storeUserNotes");
m.checkNotNullParameter(storeUserProfile, "storeUserProfile");
m.checkNotNullParameter(restAPI, "restAPI");
m.checkNotNullParameter(restAPI2, "restAPISerializeNulls");
m.checkNotNullParameter(storeApplicationStreamPreviews, "storeApplicationStreamPreviews");
m.checkNotNullParameter(parser, "bioParser");
this.userId = j;
this.channelId = j2;
this.guildId = l;
this.friendToken = str;
this.isVoiceContext = z2;
this.streamPreviewClickBehavior = streamPreviewClickBehavior;
this.storeMediaSettings = storeMediaSettings;
this.storeApplicationStreaming = storeApplicationStreaming;
this.storeUserNotes = storeUserNotes;
this.storeUserProfile = storeUserProfile;
this.restAPI = restAPI;
this.restAPISerializeNulls = restAPI2;
this.storeApplicationStreamPreviews = storeApplicationStreamPreviews;
this.bioParser = parser;
this.eventSubject = PublishSubject.k0();
this.fetchedPreviews = new LinkedHashSet();
this.revealedBioIndices = new LinkedHashSet();
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.computationLatest(observable), this, null, 2, null), WidgetUserSheetViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass1(this), 62, (Object) null);
storeUserNotes.loadNote(j);
StoreUserProfile.fetchProfile$default(storeUserProfile, j, l, false, null, 12, null);
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ WidgetUserSheetViewModel(long j, long j2, Long l, String str, boolean z2, Observable observable, WidgetUserSheet.StreamPreviewClickBehavior streamPreviewClickBehavior, StoreMediaSettings storeMediaSettings, StoreApplicationStreaming storeApplicationStreaming, StoreUserNotes storeUserNotes, StoreUserProfile storeUserProfile, RestAPI restAPI, RestAPI restAPI2, StoreApplicationStreamPreviews storeApplicationStreamPreviews, Parser parser, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(j, j2, l, str, z2, (i & 32) != 0 ? WidgetUserSheetViewModelStoreState.observeStoreState$default(WidgetUserSheetViewModelStoreState.INSTANCE, j, Long.valueOf(j2), l, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 131064, null) : observable, streamPreviewClickBehavior, (i & 128) != 0 ? StoreStream.Companion.getMediaSettings() : storeMediaSettings, (i & 256) != 0 ? StoreStream.Companion.getApplicationStreaming() : storeApplicationStreaming, (i & 512) != 0 ? StoreStream.Companion.getUsersNotes() : storeUserNotes, (i & 1024) != 0 ? StoreStream.Companion.getUserProfile() : storeUserProfile, (i & 2048) != 0 ? RestAPI.Companion.getApi() : restAPI, (i & 4096) != 0 ? RestAPI.Companion.getApiSerializeNulls() : restAPI2, (i & 8192) != 0 ? StoreStream.Companion.getApplicationStreamPreviews() : storeApplicationStreamPreviews, (i & 16384) != 0 ? DiscordParser.createParser$default(false, false, false, 4, null) : parser);
}
public static final /* synthetic */ void access$emitDismissSheetEvent(WidgetUserSheetViewModel widgetUserSheetViewModel) {
widgetUserSheetViewModel.emitDismissSheetEvent();
}
public static final /* synthetic */ void access$emitLaunchVideoCallEvent(WidgetUserSheetViewModel widgetUserSheetViewModel, long j) {
widgetUserSheetViewModel.emitLaunchVideoCallEvent(j);
}
public static final /* synthetic */ void access$emitLaunchVoiceCallEvent(WidgetUserSheetViewModel widgetUserSheetViewModel, long j) {
widgetUserSheetViewModel.emitLaunchVoiceCallEvent(j);
}
public static final /* synthetic */ void access$emitShowFriendRequestAbortToast(WidgetUserSheetViewModel widgetUserSheetViewModel, int i, String str) {
widgetUserSheetViewModel.emitShowFriendRequestAbortToast(i, str);
}
public static final /* synthetic */ void access$emitShowToastEvent(WidgetUserSheetViewModel widgetUserSheetViewModel, int i) {
widgetUserSheetViewModel.emitShowToastEvent(i);
}
public static final /* synthetic */ ViewState access$getViewState$p(WidgetUserSheetViewModel widgetUserSheetViewModel) {
return widgetUserSheetViewModel.getViewState();
}
public static final /* synthetic */ void access$handleStoreState(WidgetUserSheetViewModel widgetUserSheetViewModel, StoreState storeState) {
widgetUserSheetViewModel.handleStoreState(storeState);
}
public static final /* synthetic */ void access$updateViewState(WidgetUserSheetViewModel widgetUserSheetViewModel, ViewState viewState) {
widgetUserSheetViewModel.updateViewState(viewState);
}
private final UserProfileAdminView.ViewState createAdminViewState(Channel channel, boolean z2, boolean z3, ManageUserContext manageUserContext, VoiceState voiceState, boolean z4, boolean z5) {
boolean z6;
if (channel == null) {
return null;
}
boolean z7 = manageUserContext != null && (manageUserContext.getCanChangeNickname() || manageUserContext.getCanManageRoles());
boolean z8 = !ChannelUtils.w(channel) ? !(manageUserContext == null || !manageUserContext.getCanKick()) : !(ChannelUtils.v(channel) || !z2 || z3);
boolean z9 = z4 && manageUserContext != null && manageUserContext.getCanDisableCommunication() && !z3;
boolean w = ChannelUtils.w(channel);
boolean z10 = manageUserContext != null && manageUserContext.getCanBan();
boolean z11 = voiceState != null && manageUserContext != null && manageUserContext.getCanMute() && !ChannelUtils.z(channel);
boolean z12 = voiceState != null && voiceState.e();
boolean z13 = (voiceState == null || manageUserContext == null || !manageUserContext.getCanDeafen()) ? false : true;
boolean z14 = voiceState != null && voiceState.b();
boolean z15 = (voiceState == null || manageUserContext == null || !manageUserContext.getCanMove()) ? false : true;
Boolean[] boolArr = {Boolean.valueOf(z7), Boolean.valueOf(z8), Boolean.valueOf(z10), Boolean.valueOf(z9), Boolean.valueOf(z11), Boolean.valueOf(z13), Boolean.valueOf(z15)};
int i = 0;
while (true) {
if (i >= 7) {
z6 = false;
break;
} else if (boolArr[i].booleanValue()) {
z6 = true;
break;
} else {
i++;
}
}
return new UserProfileAdminView.ViewState(z7, z8, z9, w, z10, z11, z12, z13, z14, z15, z6, z3, z5);
}
private final List<Node<MessageRenderContext>> createAndProcessBioAstFromText(String str) {
if (str == null || t.isBlank(str)) {
return null;
}
List<Node<MessageRenderContext>> generateAst = generateAst(str);
createMessagePreprocessor().process(generateAst);
return generateAst;
}
private final UserProfileConnectionsView.ViewState createConnectionsViewState(UserProfile userProfile, boolean z2, boolean z3) {
List<ConnectedAccount> b2 = userProfile.b();
ArrayList arrayList = new ArrayList(d0.t.o.collectionSizeOrDefault(b2, 10));
for (ConnectedAccount connectedAccount : b2) {
arrayList.add(new UserProfileConnectionsView.ConnectedAccountItem(connectedAccount));
}
boolean z4 = false;
boolean z5 = !z2 && !z3;
if (z5 || (!arrayList.isEmpty())) {
z4 = true;
}
return new UserProfileConnectionsView.ViewState(z4, z5, arrayList);
}
private final MessagePreprocessor createMessagePreprocessor() {
return new MessagePreprocessor(-1, this.revealedBioIndices, null, false, null, 28, null);
}
private final Observable<Channel> createPrivateChannelWithUser(long j) {
return this.restAPI.createOrFetchDM(j);
}
public static /* synthetic */ void disconnectUser$default(WidgetUserSheetViewModel widgetUserSheetViewModel, Channel channel, int i, Object obj) {
if ((i & 1) != 0) {
channel = null;
}
widgetUserSheetViewModel.disconnectUser(channel);
}
private final void emitDismissSheetEvent() {
PublishSubject<Event> publishSubject = this.eventSubject;
publishSubject.k.onNext(Event.DismissSheet.INSTANCE);
}
private final void emitLaunchSpectateEvent(ModelApplicationStream modelApplicationStream) {
PublishSubject<Event> publishSubject = this.eventSubject;
publishSubject.k.onNext(new Event.LaunchSpectate(modelApplicationStream));
}
private final void emitLaunchVideoCallEvent(long j) {
PublishSubject<Event> publishSubject = this.eventSubject;
publishSubject.k.onNext(new Event.LaunchVideoCall(j));
}
private final void emitLaunchVoiceCallEvent(long j) {
PublishSubject<Event> publishSubject = this.eventSubject;
publishSubject.k.onNext(new Event.LaunchVoiceCall(j));
}
private final void emitRequestStreamPermissionsEvent(ModelApplicationStream modelApplicationStream) {
PublishSubject<Event> publishSubject = this.eventSubject;
publishSubject.k.onNext(new Event.RequestPermissionsForSpectateStream(modelApplicationStream));
}
private final void emitShowFriendRequestAbortToast(int i, String str) {
PublishSubject<Event> publishSubject = this.eventSubject;
publishSubject.k.onNext(new Event.ShowFriendRequestErrorToast(i, str));
}
private final void emitShowToastEvent(@StringRes int i) {
PublishSubject<Event> publishSubject = this.eventSubject;
publishSubject.k.onNext(new Event.ShowToast(i));
}
private final List<Node<MessageRenderContext>> generateAst(CharSequence charSequence) {
return Parser.parse$default(this.bioParser, charSequence, MessageParseState.Companion.getInitialState(), null, 4, null);
}
/* JADX WARNING: Code restructure failed: missing block: B:19:0x008e, code lost:
if (r3 != null) goto L_0x0095;
*/
/* JADX WARNING: Removed duplicated region for block: B:105:0x0254 */
/* JADX WARNING: Removed duplicated region for block: B:112:0x026b */
/* JADX WARNING: Removed duplicated region for block: B:115:0x0270 */
/* JADX WARNING: Removed duplicated region for block: B:121:0x0284 */
/* JADX WARNING: Removed duplicated region for block: B:124:0x0289 */
/* JADX WARNING: Removed duplicated region for block: B:125:0x028e */
/* JADX WARNING: Removed duplicated region for block: B:128:0x0293 */
/* JADX WARNING: Removed duplicated region for block: B:134:0x02a6 */
/* JADX WARNING: Removed duplicated region for block: B:142:0x02b8 A[ADDED_TO_REGION] */
/* JADX WARNING: Removed duplicated region for block: B:146:0x02c2 */
/* JADX WARNING: Removed duplicated region for block: B:149:0x02cd */
/* JADX WARNING: Removed duplicated region for block: B:150:0x02d2 */
/* JADX WARNING: Removed duplicated region for block: B:153:0x02d7 */
/* JADX WARNING: Removed duplicated region for block: B:154:0x02dc */
/* JADX WARNING: Removed duplicated region for block: B:88:0x0213 */
/* JADX WARNING: Removed duplicated region for block: B:98:0x023d */
private final void handleStoreState(StoreState storeState) {
List list;
boolean z2;
boolean z3;
String str;
Float f;
boolean z4;
boolean z5;
User user;
List<Node<MessageRenderContext>> createAndProcessBioAstFromText;
StoreUserNotes.UserNoteState userNoteFetchState;
String note;
ViewState viewState;
boolean z6;
ModelUserNote note2;
String bio;
User merge;
ModelApplicationStream stream;
String name;
List<Long> roles;
if (storeState == null) {
this.eventSubject.k.onNext(Event.UserNotFound.INSTANCE);
return;
}
User user2 = storeState.getUser();
MeUser me2 = storeState.getMe();
Channel channel = storeState.getChannel();
Map<Long, GuildMember> computedMembers = storeState.getComputedMembers();
Map<Long, GuildRole> guildRoles = storeState.getGuildRoles();
Guild guild = storeState.getGuild();
boolean z7 = false;
boolean z8 = me2.getId() == user2.getId();
boolean isSystemUser = user2.isSystemUser();
GuildMember guildMember = (GuildMember) a.e(user2, computedMembers);
GuildMember guildMember2 = computedMembers.get(Long.valueOf(me2.getId()));
if (!(guildMember == null || (roles = guildMember.getRoles()) == null)) {
ArrayList arrayList = new ArrayList();
for (Number number : roles) {
GuildRole guildRole = guildRoles.get(Long.valueOf(number.longValue()));
if (guildRole != null) {
arrayList.add(guildRole);
}
}
list = u.sortedWith(arrayList, RoleUtils.getROLE_COMPARATOR());
}
list = n.emptyList();
ManageUserContext from = (guildMember == null || guildMember2 == null || guild == null) ? null : ManageUserContext.Companion.from(guild, me2, user2, guildMember2.getRoles(), guildMember.getRoles(), storeState.getPermissions(), guildRoles);
boolean isCommunicationDisabled = guildMember != null ? guildMember.isCommunicationDisabled() : false;
boolean z9 = channel != null && channel.q() == me2.getId();
int type = ModelUserRelationship.getType(storeState.getUserRelationshipType());
VoiceState voiceState = (VoiceState) a.e(user2, storeState.getMySelectedVoiceChannelVoiceStates());
VoiceState voiceState2 = storeState.getMySelectedVoiceChannelVoiceStates().get(Long.valueOf(me2.getId()));
boolean isInSameVoiceChannel = isInSameVoiceChannel(voiceState2, voiceState);
boolean z10 = this.isVoiceContext || isInSameVoiceChannel;
boolean selfMuted = z8 ? storeState.getSelfMuted() : storeState.getMuted();
Boolean valueOf = z8 ? Boolean.valueOf(storeState.getSelfDeafened()) : null;
if (!z8) {
z3 = isSystemUser;
z2 = z10;
str = null;
f = Float.valueOf(PerceptualVolumeUtils.amplitudeToPerceptual$default(PerceptualVolumeUtils.INSTANCE, storeState.getOutputVolume(), 0.0f, 2, null));
} else {
z3 = isSystemUser;
z2 = z10;
str = null;
f = null;
}
UserProfileVoiceSettingsView.ViewState viewState2 = new UserProfileVoiceSettingsView.ViewState(selfMuted, valueOf, f);
VoiceState voiceState3 = (VoiceState) a.e(user2, storeState.getCurrentChannelVoiceStates());
if (channel != null && ChannelUtils.w(channel)) {
str = ChannelUtils.c(channel);
}
String str2 = (guild == null || (name = guild.getName()) == null) ? str : name;
UserProfileAdminView.ViewState createAdminViewState = createAdminViewState(channel, z9, z8, from, voiceState3, storeState.getCanDisableCommunication(), isCommunicationDisabled);
UserProfile userProfile = storeState.getUserProfile();
UserProfileConnectionsView.ViewState createConnectionsViewState = createConnectionsViewState(userProfile, z8, z3);
StreamContext streamContext = storeState.getStreamContext();
String encodedStreamKey = (streamContext == null || (stream = streamContext.getStream()) == null) ? null : stream.getEncodedStreamKey();
if (encodedStreamKey != null && !this.fetchedPreviews.contains(encodedStreamKey)) {
this.storeApplicationStreamPreviews.fetchStreamPreviewIfNotFetching(streamContext);
this.fetchedPreviews.add(encodedStreamKey);
}
UserProfileStageActionsView.ViewState viewState3 = new UserProfileStageActionsView.ViewState(z8, storeState.getStageChannel(), storeState.m54getUserStageRolestwRsX0(), storeState.getUserRequestToSpeakState(), isInSameVoiceChannel(voiceState2, voiceState), PermissionUtils.can(Permission.MUTE_MEMBERS, storeState.getPermissions()), false, false, 192, null);
Long l = this.guildId;
if (l != null && (l == null || l.longValue() != 0)) {
if ((guildMember != null ? guildMember.getBio() : null) == null) {
z4 = false;
z5 = !(m.areEqual(userProfile, StoreUserProfile.Companion.getEMPTY_PROFILE()) ^ true) && z4;
if (z5) {
if (user2 instanceof MeUser) {
merge = MeUser.Companion.merge((MeUser) user2, userProfile.g());
} else if (user2 instanceof CoreUser) {
merge = CoreUser.Companion.merge((CoreUser) user2, userProfile.g());
}
user = merge;
createAndProcessBioAstFromText = (guildMember != null || (bio = guildMember.getBio()) == null || !(t.isBlank(bio) ^ true)) ? null : createAndProcessBioAstFromText(bio);
if (createAndProcessBioAstFromText == null) {
String bio2 = user.getBio();
createAndProcessBioAstFromText = bio2 != null ? createAndProcessBioAstFromText(bio2) : null;
}
userNoteFetchState = storeState.getUserNoteFetchState();
if (!(userNoteFetchState instanceof StoreUserNotes.UserNoteState.Loaded)) {
userNoteFetchState = null;
}
StoreUserNotes.UserNoteState.Loaded loaded = (StoreUserNotes.UserNoteState.Loaded) userNoteFetchState;
note = (loaded != null || (note2 = loaded.getNote()) == null) ? null : note2.getNote();
viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded2 = (ViewState.Loaded) viewState;
z6 = !((loaded2 != null ? loaded2.getUserNoteFetchState() : null) instanceof StoreUserNotes.UserNoteState.Loading) && !(storeState.getUserNoteFetchState() instanceof StoreUserNotes.UserNoteState.Loading);
if (getViewState() instanceof ViewState.Uninitialized) {
if (!(note == null || note.length() == 0)) {
z7 = true;
}
}
if (z6 && !z7) {
note = null;
} else if (note == null) {
note = "";
}
updateViewState(new ViewState.Loaded(user, z8, z2, viewState2, voiceState3, storeState.getRichPresence(), str2, list, createAdminViewState, viewState3, channel, streamContext, guild != null ? guild.getName() : null, guild != null ? guild.getIcon() : null, type, createConnectionsViewState, storeState.getUserNoteFetchState(), note, isInSameVoiceChannel, createAndProcessBioAstFromText, z5, this.guildId, guildMember, storeState.getUserProfile()));
this.mostRecentStoreState = storeState;
}
user = user2;
if (guildMember != null) {
}
if (createAndProcessBioAstFromText == null) {
}
userNoteFetchState = storeState.getUserNoteFetchState();
if (!(userNoteFetchState instanceof StoreUserNotes.UserNoteState.Loaded)) {
}
StoreUserNotes.UserNoteState.Loaded loaded = (StoreUserNotes.UserNoteState.Loaded) userNoteFetchState;
if (loaded != null) {
}
viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
}
ViewState.Loaded loaded2 = (ViewState.Loaded) viewState;
if (!((loaded2 != null ? loaded2.getUserNoteFetchState() : null) instanceof StoreUserNotes.UserNoteState.Loading)) {
}
if (getViewState() instanceof ViewState.Uninitialized) {
}
if (z6) {
}
if (note == null) {
}
updateViewState(new ViewState.Loaded(user, z8, z2, viewState2, voiceState3, storeState.getRichPresence(), str2, list, createAdminViewState, viewState3, channel, streamContext, guild != null ? guild.getName() : null, guild != null ? guild.getIcon() : null, type, createConnectionsViewState, storeState.getUserNoteFetchState(), note, isInSameVoiceChannel, createAndProcessBioAstFromText, z5, this.guildId, guildMember, storeState.getUserProfile()));
this.mostRecentStoreState = storeState;
}
}
z4 = true;
if (!(m.areEqual(userProfile, StoreUserProfile.Companion.getEMPTY_PROFILE()) ^ true)) {
}
if (z5) {
}
user = user2;
if (guildMember != null) {
}
if (createAndProcessBioAstFromText == null) {
}
userNoteFetchState = storeState.getUserNoteFetchState();
if (!(userNoteFetchState instanceof StoreUserNotes.UserNoteState.Loaded)) {
}
StoreUserNotes.UserNoteState.Loaded loaded = (StoreUserNotes.UserNoteState.Loaded) userNoteFetchState;
if (loaded != null) {
}
viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
}
ViewState.Loaded loaded2 = (ViewState.Loaded) viewState;
if (!((loaded2 != null ? loaded2.getUserNoteFetchState() : null) instanceof StoreUserNotes.UserNoteState.Loading)) {
}
if (getViewState() instanceof ViewState.Uninitialized) {
}
if (z6) {
}
if (note == null) {
}
updateViewState(new ViewState.Loaded(user, z8, z2, viewState2, voiceState3, storeState.getRichPresence(), str2, list, createAdminViewState, viewState3, channel, streamContext, guild != null ? guild.getName() : null, guild != null ? guild.getIcon() : null, type, createConnectionsViewState, storeState.getUserNoteFetchState(), note, isInSameVoiceChannel, createAndProcessBioAstFromText, z5, this.guildId, guildMember, storeState.getUserProfile()));
this.mostRecentStoreState = storeState;
}
private final boolean isInSameVoiceChannel(VoiceState voiceState, VoiceState voiceState2) {
Long l = null;
Long a = voiceState2 != null ? voiceState2.a() : null;
if (voiceState != null) {
l = voiceState.a();
}
if (a == null || l == null) {
return false;
}
return m.areEqual(a, l);
}
public final void addRelationship(Integer num, String str, @StringRes int i) {
m.checkNotNullParameter(str, "username");
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(this.restAPI.addRelationship("User Profile", this.userId, num, this.friendToken), false, 1, null), this, null, 2, null), WidgetUserSheetViewModel.class, (Context) null, (Function1) null, new WidgetUserSheetViewModel$addRelationship$2(this, str), (Function0) null, (Function0) null, new WidgetUserSheetViewModel$addRelationship$1(this, i), 54, (Object) null);
}
public final void banUser() {
Channel channel;
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null && (channel = loaded.getChannel()) != null) {
User user = loaded.getUser();
this.eventSubject.k.onNext(new Event.LaunchBanUser(user.getUsername(), channel.f(), user.getId()));
}
}
public final void disableCommunication() {
Channel channel;
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null && (channel = loaded.getChannel()) != null) {
User user = loaded.getUser();
GuildMember guildMember = loaded.getGuildMember();
if (guildMember != null ? guildMember.isCommunicationDisabled() : false) {
this.eventSubject.k.onNext(new Event.LaunchEnableCommunication(user.getId(), channel.f()));
} else {
this.eventSubject.k.onNext(new Event.LaunchDisableCommunication(user.getId(), channel.f()));
}
}
}
public final void disconnectUser(Channel channel) {
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
if (channel == null) {
channel = loaded.getChannel();
}
if (channel != null) {
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(this.restAPISerializeNulls.disconnectGuildMember(channel.f(), loaded.getUser().getId(), new RestAPIParams.GuildMemberDisconnect(null, 1, null)), false, 1, null), this, null, 2, null), WidgetUserSheetViewModel.class, (Context) null, (Function1) null, new WidgetUserSheetViewModel$disconnectUser$2(this), (Function0) null, (Function0) null, new WidgetUserSheetViewModel$disconnectUser$1(this), 54, (Object) null);
}
}
}
public final void editMember() {
Channel channel;
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null && (channel = loaded.getChannel()) != null) {
this.eventSubject.k.onNext(new Event.LaunchEditMember(channel.f(), this.userId));
}
}
public final boolean getOpenPopoutLogged() {
return this.openPopoutLogged;
}
public final void guildDeafenUser() {
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
Channel channel = loaded.getChannel();
User user = loaded.getUser();
UserProfileAdminView.ViewState adminViewState = loaded.getAdminViewState();
if (channel != null && adminViewState != null) {
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(this.restAPI.changeGuildMember(channel.f(), user.getId(), RestAPIParams.GuildMember.Companion.createWithDeaf(!adminViewState.isServerDeafened())), false, 1, null), this, null, 2, null), WidgetUserSheetViewModel.class, (Context) null, (Function1) null, new WidgetUserSheetViewModel$guildDeafenUser$2(this), (Function0) null, (Function0) null, WidgetUserSheetViewModel$guildDeafenUser$1.INSTANCE, 54, (Object) null);
}
}
}
public final void guildMoveForUser() {
Channel channel;
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null && (channel = loaded.getChannel()) != null) {
this.eventSubject.k.onNext(new Event.LaunchMoveUser(channel.f()));
}
}
public final void guildMuteUser() {
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
Channel channel = loaded.getChannel();
UserProfileAdminView.ViewState adminViewState = loaded.getAdminViewState();
User user = loaded.getUser();
if (channel != null && adminViewState != null) {
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(this.restAPI.changeGuildMember(channel.f(), user.getId(), RestAPIParams.GuildMember.Companion.createWithMute(!loaded.getAdminViewState().isServerMuted())), false, 1, null), this, null, 2, null), WidgetUserSheetViewModel.class, (Context) null, (Function1) null, new WidgetUserSheetViewModel$guildMuteUser$2(this), (Function0) null, (Function0) null, WidgetUserSheetViewModel$guildMuteUser$1.INSTANCE, 54, (Object) null);
}
}
}
@MainThread
public final void handleBioIndexClicked(SpoilerNode<?> spoilerNode) {
StoreState storeState;
UserProfile userProfile;
com.discord.api.user.User g;
NullSerializable<String> d;
String a;
m.checkNotNullParameter(spoilerNode, "spoilerNode");
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null && (storeState = this.mostRecentStoreState) != null && (userProfile = storeState.getUserProfile()) != null && (g = userProfile.g()) != null && (d = g.d()) != null && (a = d.a()) != null) {
this.revealedBioIndices.add(Integer.valueOf(spoilerNode.getId()));
updateViewState(ViewState.Loaded.copy$default(loaded, null, false, false, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, false, createAndProcessBioAstFromText(a), false, null, null, null, 16252927, null));
}
}
public final void inviteUserToSpeak() {
Channel channel;
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null && (channel = loaded.getStageViewState().getChannel()) != null) {
long id2 = loaded.getUser().getId();
updateViewState(ViewState.Loaded.copy$default(loaded, null, false, false, null, null, null, null, null, null, UserProfileStageActionsView.ViewState.m45copyam1GJgw$default(loaded.getStageViewState(), false, null, null, null, false, false, false, true, 127, null), null, null, null, null, 0, null, null, null, false, null, false, null, null, null, 16776703, null));
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(StageChannelAPI.setUserSuppressedInChannel$default(StageChannelAPI.INSTANCE, channel, id2, false, 0, 8, null), false, 1, null), this, null, 2, null), WidgetUserSheetViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetUserSheetViewModel$inviteUserToSpeak$1(this), 62, (Object) null);
}
}
public final void kickUser() {
Channel channel;
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null && (channel = loaded.getChannel()) != null) {
User user = loaded.getUser();
if (ChannelUtils.w(channel)) {
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.takeSingleUntilTimeout$default(ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().removeChannelRecipient(channel.h(), user.getId()), false, 1, null), 0, false, 1, null), this, null, 2, null), (Context) null, "REST: remove group member", (Function1) null, new WidgetUserSheetViewModel$kickUser$1(this), (Function1) null, (Function0) null, (Function0) null, 117, (Object) null);
return;
}
this.eventSubject.k.onNext(new Event.LaunchKickUser(user.getUsername(), channel.f(), user.getId()));
}
}
public final void launchVideoCall() {
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(createPrivateChannelWithUser(this.userId), false, 1, null), this, null, 2, null), WidgetUserSheetViewModel.class, (Context) null, (Function1) null, new WidgetUserSheetViewModel$launchVideoCall$2(this), (Function0) null, (Function0) null, new WidgetUserSheetViewModel$launchVideoCall$1(this), 54, (Object) null);
}
public final void launchVoiceCall() {
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(createPrivateChannelWithUser(this.userId), false, 1, null), this, null, 2, null), WidgetUserSheetViewModel.class, (Context) null, (Function1) null, new WidgetUserSheetViewModel$launchVoiceCall$2(this), (Function0) null, (Function0) null, new WidgetUserSheetViewModel$launchVoiceCall$1(this), 54, (Object) null);
}
public final void moveUserToChannel(long j) {
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
Channel channel = loaded.getChannel();
User user = loaded.getUser();
if (channel != null) {
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(this.restAPI.changeGuildMember(channel.f(), user.getId(), RestAPIParams.GuildMember.Companion.createWithChannelId(j)), false, 1, null), this, null, 2, null), WidgetUserSheetViewModel.class, (Context) null, (Function1) null, new WidgetUserSheetViewModel$moveUserToChannel$2(this), (Function0) null, (Function0) null, new WidgetUserSheetViewModel$moveUserToChannel$1(this), 54, (Object) null);
}
}
}
public final Observable<Event> observeEvents() {
PublishSubject<Event> publishSubject = this.eventSubject;
m.checkNotNullExpressionValue(publishSubject, "eventSubject");
return publishSubject;
}
public final void onActivityCustomButtonClicked(Context context, long j, String str, long j2, int i) {
m.checkNotNullParameter(context, "applicationContext");
m.checkNotNullParameter(str, "sessionId");
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(this.restAPI.getActivityMetadata(j, str, j2), false, 1, null), this, null, 2, null), (Context) null, "REST: Custom Button GetActivityMetadata", (Function1) null, new WidgetUserSheetViewModel$onActivityCustomButtonClicked$1(i, context), (Function1) null, (Function0) null, (Function0) null, 117, (Object) null);
}
@MainThread
public final void onSpectatePermissionsGranted(ModelApplicationStream modelApplicationStream) {
m.checkNotNullParameter(modelApplicationStream, "stream");
StoreApplicationStreaming.targetStream$default(this.storeApplicationStreaming, modelApplicationStream.getEncodedStreamKey(), false, 2, null);
int ordinal = this.streamPreviewClickBehavior.ordinal();
if (ordinal == 0) {
emitLaunchSpectateEvent(modelApplicationStream);
} else if (ordinal == 1) {
emitDismissSheetEvent();
}
}
public final void onStreamPreviewClicked(StreamContext streamContext) {
m.checkNotNullParameter(streamContext, "streamContext");
if (streamContext.getJoinability() == StreamContext.Joinability.MISSING_PERMISSIONS) {
emitShowToastEvent(R.string.channel_locked);
} else {
emitRequestStreamPermissionsEvent(streamContext.getStream());
}
}
public final void removeRelationship(@StringRes int i) {
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(this.restAPI.removeRelationship("User Profile", this.userId), false, 1, null), this, null, 2, null), WidgetUserSheetViewModel.class, (Context) null, (Function1) null, new WidgetUserSheetViewModel$removeRelationship$2(this), (Function0) null, (Function0) null, new WidgetUserSheetViewModel$removeRelationship$1(this, i), 54, (Object) null);
}
public final void saveUserNote(Context context, String str) {
m.checkNotNullParameter(str, "noteText");
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
boolean z2 = true;
if ((!(loaded.getUserNoteFetchState() instanceof StoreUserNotes.UserNoteState.Empty) || !(!m.areEqual(str, ""))) && (!(loaded.getUserNoteFetchState() instanceof StoreUserNotes.UserNoteState.Loaded) || !(!m.areEqual(((StoreUserNotes.UserNoteState.Loaded) loaded.getUserNoteFetchState()).getNote().getNote(), str)))) {
z2 = false;
}
if (z2) {
this.storeUserNotes.saveNote(context, this.userId, str);
}
}
}
public final void setOpenPopoutLogged(boolean z2) {
this.openPopoutLogged = z2;
}
public final void setUserOutputVolume(float f) {
this.storeMediaSettings.setUserOutputVolume(this.userId, PerceptualVolumeUtils.perceptualToAmplitude$default(PerceptualVolumeUtils.INSTANCE, f, 0.0f, 2, null));
}
public final void setUserSuppressedInChannel(boolean z2) {
Channel channel;
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null && (channel = loaded.getStageViewState().getChannel()) != null) {
long id2 = loaded.getUser().getId();
updateViewState(ViewState.Loaded.copy$default(loaded, null, false, false, null, null, null, null, null, null, UserProfileStageActionsView.ViewState.m45copyam1GJgw$default(loaded.getStageViewState(), false, null, null, null, false, false, true, false, 191, null), null, null, null, null, 0, null, null, null, false, null, false, null, null, null, 16776703, null));
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(StageChannelAPI.setUserSuppressedInChannel$default(StageChannelAPI.INSTANCE, channel, id2, z2, 0, 8, null), false, 1, null), this, null, 2, null), WidgetUserSheetViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetUserSheetViewModel$setUserSuppressedInChannel$1(this), 62, (Object) null);
}
}
public final void toggleDeafen(boolean z2) {
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null && loaded.isMe() && (!m.areEqual(loaded.getVoiceSettingsViewState().isDeafened(), Boolean.valueOf(z2)))) {
this.storeMediaSettings.toggleSelfDeafened();
}
}
public final void toggleMute(boolean z2) {
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null && loaded.getVoiceSettingsViewState().isMuted() != z2) {
if (loaded.isMe()) {
StoreMediaSettings.SelfMuteFailure selfMuteFailure = this.storeMediaSettings.toggleSelfMuted();
if (selfMuteFailure != null && selfMuteFailure.ordinal() == 0) {
emitShowToastEvent(R.string.vad_permission_small);
return;
}
return;
}
this.storeMediaSettings.toggleUserMuted(this.userId);
}
}
}