package com.discord.widgets.guildscheduledevent; import androidx.core.app.FrameMetricsAggregator; import c0.z.d.o; import com.discord.api.channel.Channel; import com.discord.api.guildscheduledevent.GuildScheduledEvent; import com.discord.api.permission.Permission; import com.discord.models.guild.Guild; import com.discord.stores.StoreChannels; import com.discord.stores.StoreGuildScheduledEvents; import com.discord.stores.StoreGuilds; import com.discord.stores.StorePermissions; import com.discord.stores.StoreUserSettings; import com.discord.stores.StoreVoiceChannelSelected; import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilities; import com.discord.utilities.permissions.PermissionUtils; import com.discord.widgets.guildscheduledevent.GuildScheduledEventDetailsViewModel; import kotlin.jvm.functions.Function0; /* compiled from: GuildScheduledEventDetailsViewModel.kt */ public final class GuildScheduledEventDetailsViewModel$Companion$observeStores$1 extends o implements Function0 { public final /* synthetic */ StoreChannels $channelsStore; public final /* synthetic */ long $guildScheduledEventId; public final /* synthetic */ StoreGuildScheduledEvents $guildScheduledEventsStore; public final /* synthetic */ StoreGuilds $guildsStore; public final /* synthetic */ StorePermissions $permissionsStore; public final /* synthetic */ StoreVoiceChannelSelected $selectedVoiceChannelStore; public final /* synthetic */ StoreUserSettings $userSettingsStore; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public GuildScheduledEventDetailsViewModel$Companion$observeStores$1(StoreGuildScheduledEvents storeGuildScheduledEvents, long j, StoreChannels storeChannels, StoreGuilds storeGuilds, StoreVoiceChannelSelected storeVoiceChannelSelected, StorePermissions storePermissions, StoreUserSettings storeUserSettings) { super(0); this.$guildScheduledEventsStore = storeGuildScheduledEvents; this.$guildScheduledEventId = j; this.$channelsStore = storeChannels; this.$guildsStore = storeGuilds; this.$selectedVoiceChannelStore = storeVoiceChannelSelected; this.$permissionsStore = storePermissions; this.$userSettingsStore = storeUserSettings; } @Override // kotlin.jvm.functions.Function0 /* renamed from: invoke */ public final GuildScheduledEventDetailsViewModel.StoreState mo17invoke() { Channel channel; boolean z2; GuildScheduledEvent findEventFromStore$default = StoreGuildScheduledEvents.findEventFromStore$default(this.$guildScheduledEventsStore, this.$guildScheduledEventId, null, 2, null); if (findEventFromStore$default == null) { return new GuildScheduledEventDetailsViewModel.StoreState(null, null, null, false, false, false, false, null, false, FrameMetricsAggregator.EVERY_DURATION, null); } Long b = findEventFromStore$default.b(); if (b != null) { channel = this.$channelsStore.getChannel(b.longValue()); } else { channel = null; } Guild guild = this.$guildsStore.getGuild(findEventFromStore$default.f()); Long valueOf = Long.valueOf(this.$selectedVoiceChannelStore.getSelectedVoiceChannelId()); boolean isRsvpedToEvent = this.$guildScheduledEventsStore.isRsvpedToEvent(findEventFromStore$default.f(), this.$guildScheduledEventId); GuildScheduledEventUtilities.Companion companion = GuildScheduledEventUtilities.Companion; boolean canShareEvent$default = GuildScheduledEventUtilities.Companion.canShareEvent$default(companion, findEventFromStore$default.b(), findEventFromStore$default.f(), this.$channelsStore, this.$guildsStore, null, null, 48, null); boolean canStartEvent = companion.canStartEvent(findEventFromStore$default.f(), findEventFromStore$default.b(), this.$channelsStore, this.$permissionsStore); Long b2 = findEventFromStore$default.b(); if (b2 != null) { z2 = PermissionUtils.can(Permission.CONNECT, this.$permissionsStore.getPermissionsByChannel().get(Long.valueOf(b2.longValue()))); } else { z2 = false; } return new GuildScheduledEventDetailsViewModel.StoreState(findEventFromStore$default, channel, guild, isRsvpedToEvent, canShareEvent$default, canStartEvent, this.$userSettingsStore.getIsDeveloperMode(), valueOf, z2); } }