package com.discord.stores; import d0.t.n; import d0.z.d.m; import d0.z.d.o; import kotlin.Unit; import kotlin.jvm.functions.Function0; /* compiled from: StoreApplicationCommands.kt */ public final class StoreApplicationCommands$requestApplicationCommands$1 extends o implements Function0 { public final /* synthetic */ Long $applicationId; public final /* synthetic */ Long $guildId; public final /* synthetic */ int $limit; public final /* synthetic */ int $offset; public final /* synthetic */ StoreApplicationCommands this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public StoreApplicationCommands$requestApplicationCommands$1(StoreApplicationCommands storeApplicationCommands, Long l, int i, int i2, Long l2) { super(0); this.this$0 = storeApplicationCommands; this.$guildId = l; this.$offset = i; this.$limit = i2; this.$applicationId = l2; } @Override // kotlin.jvm.functions.Function0 /* renamed from: invoke */ public final void mo1invoke() { if (!StoreApplicationCommands.access$isLoadingDiscoveryCommands$p(this.this$0)) { String access$generateNonce = StoreApplicationCommands.access$generateNonce(this.this$0); StoreApplicationCommands.access$setDiscoverCommandsNonce$p(this.this$0, access$generateNonce); if (!m.areEqual(StoreApplicationCommands.access$getDiscoverGuildId$p(this.this$0), this.$guildId)) { StoreApplicationCommands storeApplicationCommands = this.this$0; StoreApplicationCommands.access$setDiscoverCommands$p(storeApplicationCommands, DiscoverCommands.copy$default(StoreApplicationCommands.access$getDiscoverCommands$p(storeApplicationCommands), n.emptyList(), 0, 0, false, false, 0, null, 126, null)); this.this$0.markChanged(StoreApplicationCommands.Companion.getDiscoverCommandsUpdate()); } StoreApplicationCommands.access$setDiscoverGuildId$p(this.this$0, this.$guildId); Long l = this.$guildId; if (l == null || l.longValue() <= 0) { Long l2 = this.$applicationId; if (l2 == null) { StoreApplicationCommands storeApplicationCommands2 = this.this$0; StoreApplicationCommands.access$handleDiscoverCommandsUpdate(storeApplicationCommands2, StoreApplicationCommands.access$getBuiltInCommandsProvider$p(storeApplicationCommands2).getBuiltInCommands()); } else if (!m.areEqual(l2, StoreApplicationCommands.access$getDiscoverApplicationId$p(this.this$0))) { StoreApplicationCommands.access$setLoadingDiscoveryCommands$p(this.this$0, true); StoreApplicationCommands.access$getApplicationCommandsViaRest(this.this$0, this.$applicationId.longValue()); } } else { StoreApplicationCommands.access$setLoadingDiscoveryCommands$p(this.this$0, true); StoreGatewayConnection.requestApplicationCommands$default(StoreApplicationCommands.access$getStoreGatewayConnection$p(this.this$0), this.$guildId.longValue(), access$generateNonce, false, null, Integer.valueOf(this.$offset), this.$limit, 8, null); } StoreApplicationCommands.access$setDiscoverApplicationId$p(this.this$0, this.$applicationId); } } }