package com.discord.widgets.channels.memberlist; import com.airbnb.lottie.parser.AnimatableValueParser; import com.discord.api.channel.Channel; import com.discord.api.role.GuildRole; import com.discord.models.domain.ModelApplicationStream; import com.discord.models.guild.Guild; import com.discord.models.member.GuildMember; import com.discord.models.presence.Presence; import com.discord.models.user.User; import com.discord.stores.StoreApplicationStreaming; import com.discord.stores.StoreChannelMembers; import com.discord.stores.StoreChannels; import com.discord.stores.StoreGuilds; import com.discord.stores.StorePermissions; import com.discord.stores.StoreThreadMembers; import com.discord.stores.StoreUser; import com.discord.stores.StoreUserPresence; import com.discord.stores.StoreUserRelationships; import com.discord.utilities.lazy.memberlist.ChannelMemberList; import com.discord.widgets.channels.memberlist.PrivateChannelMemberListService; import com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel; import d0.z.d.m; import j0.k.b; import java.util.Map; import java.util.Set; import rx.Observable; import rx.functions.Func2; import rx.functions.Func5; import rx.functions.Func8; /* compiled from: WidgetChannelMembersListViewModel.kt */ public final class WidgetChannelMembersListViewModel$Companion$observeStoreState$1 implements b> { public final /* synthetic */ Observable $isPanelOpenObservable; public final /* synthetic */ PrivateChannelMemberListService $privateChannelMemberListService; public final /* synthetic */ StoreApplicationStreaming $storeApplicationStreaming; public final /* synthetic */ StoreChannelMembers $storeChannelMembers; public final /* synthetic */ StoreChannels $storeChannels; public final /* synthetic */ StoreGuilds $storeGuilds; public final /* synthetic */ StorePermissions $storePermissions; public final /* synthetic */ StoreUserPresence $storePresence; public final /* synthetic */ StoreThreadMembers $storeThreadMembers; public final /* synthetic */ StoreUser $storeUser; public final /* synthetic */ StoreUserRelationships $storeUserRelationships; /* compiled from: WidgetChannelMembersListViewModel.kt */ /* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$1 reason: invalid class name */ public static final class AnonymousClass1 implements b { public static final AnonymousClass1 INSTANCE = new AnonymousClass1(); public final WidgetChannelMembersListViewModel.StoreState.None call(Boolean bool) { m.checkNotNullExpressionValue(bool, "isPanelOpen"); return new WidgetChannelMembersListViewModel.StoreState.None(bool.booleanValue()); } } /* compiled from: WidgetChannelMembersListViewModel.kt */ /* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$2 reason: invalid class name */ public static final class AnonymousClass2 implements Func2 { public final /* synthetic */ WidgetChannelMembersListViewModel$Companion$observeStoreState$1 this$0; public AnonymousClass2(WidgetChannelMembersListViewModel$Companion$observeStoreState$1 widgetChannelMembersListViewModel$Companion$observeStoreState$1) { this.this$0 = widgetChannelMembersListViewModel$Companion$observeStoreState$1; } public final WidgetChannelMembersListViewModel.StoreState.Private call(PrivateChannelMemberListService.State state, Boolean bool) { m.checkNotNullExpressionValue(bool, "isPanelOpen"); return new WidgetChannelMembersListViewModel.StoreState.Private(bool.booleanValue(), state.getChannel(), state.getUsers(), state.getPresences(), state.getApplicationStreams(), this.this$0.$storeUserRelationships.getRelationships()); } } /* compiled from: WidgetChannelMembersListViewModel.kt */ /* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$3 reason: invalid class name */ public static final class AnonymousClass3 implements b> { public final /* synthetic */ Channel $channel; public final /* synthetic */ WidgetChannelMembersListViewModel$Companion$observeStoreState$1 this$0; /* compiled from: WidgetChannelMembersListViewModel.kt */ /* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$3$1 reason: invalid class name */ public static final class AnonymousClass1 implements b { public static final AnonymousClass1 INSTANCE = new AnonymousClass1(); public final WidgetChannelMembersListViewModel.StoreState.None call(Boolean bool) { m.checkNotNullExpressionValue(bool, "isPanelOpen"); return new WidgetChannelMembersListViewModel.StoreState.None(bool.booleanValue()); } } /* compiled from: WidgetChannelMembersListViewModel.kt */ /* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$3$2 reason: invalid class name */ public static final class AnonymousClass2 implements Func5, Guild, WidgetChannelMembersListViewModel.StoreState.Guild> { public final /* synthetic */ Channel $parentChannel; public AnonymousClass2(Channel channel) { this.$parentChannel = channel; } public final WidgetChannelMembersListViewModel.StoreState.Guild call(Long l, ChannelMemberList channelMemberList, Boolean bool, Map map, Guild guild) { m.checkNotNullExpressionValue(bool, "isPanelOpen"); boolean booleanValue = bool.booleanValue(); Channel channel = this.$parentChannel; m.checkNotNullExpressionValue(channelMemberList, "channelMemberList"); m.checkNotNullExpressionValue(map, "roles"); return new WidgetChannelMembersListViewModel.StoreState.Guild(booleanValue, channel, guild, channelMemberList, l, map); } /* 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, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object] */ @Override // rx.functions.Func5 public /* bridge */ /* synthetic */ WidgetChannelMembersListViewModel.StoreState.Guild call(Long l, ChannelMemberList channelMemberList, Boolean bool, Map map, Guild guild) { return call(l, channelMemberList, bool, (Map) map, guild); } } /* compiled from: WidgetChannelMembersListViewModel.kt */ /* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$3$3 reason: invalid class name */ public static final class AnonymousClass3 implements Func8, Boolean, Map, Map, Guild, Map, Map, Map, WidgetChannelMembersListViewModel.StoreState.Thread> { public final /* synthetic */ AnonymousClass3 this$0; public AnonymousClass3(AnonymousClass3 r1) { this.this$0 = r1; } public final WidgetChannelMembersListViewModel.StoreState.Thread call(Set set, Boolean bool, Map map, Map map2, Guild guild, Map map3, Map map4, Map map5) { m.checkNotNullExpressionValue(bool, "isPanelOpen"); boolean booleanValue = bool.booleanValue(); Channel channel = this.this$0.$channel; m.checkNotNullExpressionValue(map, "roles"); m.checkNotNullExpressionValue(map2, "guildMembers"); m.checkNotNullExpressionValue(map3, "users"); m.checkNotNullExpressionValue(map4, "presences"); m.checkNotNullExpressionValue(map5, "streams"); m.checkNotNullExpressionValue(set, "threadMembers"); return new WidgetChannelMembersListViewModel.StoreState.Thread(booleanValue, channel, guild, map, map2, map3, map4, map5, set); } /* 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, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object] */ @Override // rx.functions.Func8 public /* bridge */ /* synthetic */ WidgetChannelMembersListViewModel.StoreState.Thread call(Set set, Boolean bool, Map map, Map map2, Guild guild, Map map3, Map map4, Map map5) { return call((Set) set, bool, (Map) map, (Map) map2, guild, map3, (Map) map4, map5); } } public AnonymousClass3(WidgetChannelMembersListViewModel$Companion$observeStoreState$1 widgetChannelMembersListViewModel$Companion$observeStoreState$1, Channel channel) { this.this$0 = widgetChannelMembersListViewModel$Companion$observeStoreState$1; this.$channel = channel; } public final Observable call(Channel channel) { if (channel == null) { return this.this$0.$isPanelOpenObservable.F(AnonymousClass1.INSTANCE); } if (AnimatableValueParser.d1(channel)) { Observable observePermissionsForChannel = this.this$0.$storePermissions.observePermissionsForChannel(channel.h()); Observable observeChannelMemberList = this.this$0.$storeChannelMembers.observeChannelMemberList(channel.f(), channel.h()); WidgetChannelMembersListViewModel$Companion$observeStoreState$1 widgetChannelMembersListViewModel$Companion$observeStoreState$1 = this.this$0; return Observable.g(observePermissionsForChannel, observeChannelMemberList, widgetChannelMembersListViewModel$Companion$observeStoreState$1.$isPanelOpenObservable, widgetChannelMembersListViewModel$Companion$observeStoreState$1.$storeGuilds.observeRoles(this.$channel.f()), this.this$0.$storeGuilds.observeGuild(this.$channel.f()), new AnonymousClass2(channel)); } Observable> observeThreadMembers = this.this$0.$storeThreadMembers.observeThreadMembers(this.$channel.h()); WidgetChannelMembersListViewModel$Companion$observeStoreState$1 widgetChannelMembersListViewModel$Companion$observeStoreState$12 = this.this$0; return Observable.d(observeThreadMembers, widgetChannelMembersListViewModel$Companion$observeStoreState$12.$isPanelOpenObservable, widgetChannelMembersListViewModel$Companion$observeStoreState$12.$storeGuilds.observeRoles(this.$channel.f()), this.this$0.$storeGuilds.observeGuildMembers(this.$channel.f()), this.this$0.$storeGuilds.observeGuild(this.$channel.f()), this.this$0.$storeUser.observeAllUsers(), this.this$0.$storePresence.observeAllPresences(), this.this$0.$storeApplicationStreaming.observeStreamsByUser(), new AnonymousClass3(this)); } } /* compiled from: WidgetChannelMembersListViewModel.kt */ /* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$4 reason: invalid class name */ public static final class AnonymousClass4 implements Func5, Long, ChannelMemberList, Boolean, WidgetChannelMembersListViewModel.StoreState.Guild> { public final /* synthetic */ Channel $channel; public AnonymousClass4(Channel channel) { this.$channel = channel; } public final WidgetChannelMembersListViewModel.StoreState.Guild call(Guild guild, Map map, Long l, ChannelMemberList channelMemberList, Boolean bool) { m.checkNotNullExpressionValue(bool, "isPanelOpen"); boolean booleanValue = bool.booleanValue(); Channel channel = this.$channel; m.checkNotNullExpressionValue(channelMemberList, "channelMemberList"); m.checkNotNullExpressionValue(map, "guildRoles"); return new WidgetChannelMembersListViewModel.StoreState.Guild(booleanValue, channel, guild, channelMemberList, l, map); } /* 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, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object] */ @Override // rx.functions.Func5 public /* bridge */ /* synthetic */ WidgetChannelMembersListViewModel.StoreState.Guild call(Guild guild, Map map, Long l, ChannelMemberList channelMemberList, Boolean bool) { return call(guild, (Map) map, l, channelMemberList, bool); } } public WidgetChannelMembersListViewModel$Companion$observeStoreState$1(Observable observable, PrivateChannelMemberListService privateChannelMemberListService, StoreUserRelationships storeUserRelationships, StoreChannels storeChannels, StorePermissions storePermissions, StoreChannelMembers storeChannelMembers, StoreGuilds storeGuilds, StoreThreadMembers storeThreadMembers, StoreUser storeUser, StoreUserPresence storeUserPresence, StoreApplicationStreaming storeApplicationStreaming) { this.$isPanelOpenObservable = observable; this.$privateChannelMemberListService = privateChannelMemberListService; this.$storeUserRelationships = storeUserRelationships; this.$storeChannels = storeChannels; this.$storePermissions = storePermissions; this.$storeChannelMembers = storeChannelMembers; this.$storeGuilds = storeGuilds; this.$storeThreadMembers = storeThreadMembers; this.$storeUser = storeUser; this.$storePresence = storeUserPresence; this.$storeApplicationStreaming = storeApplicationStreaming; } public final Observable call(Channel channel) { return channel == null ? this.$isPanelOpenObservable.F(AnonymousClass1.INSTANCE) : AnimatableValueParser.t1(channel) ? Observable.j(this.$privateChannelMemberListService.observeStateForGroupDm(channel), this.$isPanelOpenObservable, new AnonymousClass2(this)) : AnimatableValueParser.A1(channel) ? this.$storeChannels.observeChannel(channel.r()).Y(new AnonymousClass3(this, channel)) : Observable.g(this.$storeGuilds.observeGuild(channel.f()), this.$storeGuilds.observeRoles(channel.f()), this.$storePermissions.observePermissionsForChannel(channel.h()), this.$storeChannelMembers.observeChannelMemberList(channel.f(), channel.h()), this.$isPanelOpenObservable, new AnonymousClass4(channel)); } }