package com.discord.stores; import android.content.Context; import com.discord.models.domain.ModelChannelFollowerStats; import com.discord.models.domain.ModelChannelFollowerStatsDto; import com.discord.stores.StoreChannelFollowerStats; import com.discord.utilities.error.Error; import com.discord.utilities.rest.RestAPI; import com.discord.utilities.rx.ObservableExtensionsKt; import d0.z.d.m; import d0.z.d.o; import kotlin.Unit; import kotlin.jvm.functions.Function0; import kotlin.jvm.functions.Function1; /* compiled from: StoreChannelFollowerStats.kt */ public final class StoreChannelFollowerStats$fetchIfNonexistingOrStale$1 extends o implements Function0 { public final /* synthetic */ long $channelId; public final /* synthetic */ StoreChannelFollowerStats this$0; /* compiled from: StoreChannelFollowerStats.kt */ /* renamed from: com.discord.stores.StoreChannelFollowerStats$fetchIfNonexistingOrStale$1$1 reason: invalid class name */ public static final class AnonymousClass1 extends o implements Function1 { public final /* synthetic */ StoreChannelFollowerStats$fetchIfNonexistingOrStale$1 this$0; /* compiled from: StoreChannelFollowerStats.kt */ /* renamed from: com.discord.stores.StoreChannelFollowerStats$fetchIfNonexistingOrStale$1$1$1 reason: invalid class name */ public static final class AnonymousClass1 extends o implements Function0 { public final /* synthetic */ ModelChannelFollowerStatsDto $channelFollowerStats; public final /* synthetic */ AnonymousClass1 this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public AnonymousClass1(AnonymousClass1 r1, ModelChannelFollowerStatsDto modelChannelFollowerStatsDto) { super(0); this.this$0 = r1; this.$channelFollowerStats = modelChannelFollowerStatsDto; } @Override // kotlin.jvm.functions.Function0 /* renamed from: invoke */ public final void mo1invoke() { StoreChannelFollowerStats$fetchIfNonexistingOrStale$1 storeChannelFollowerStats$fetchIfNonexistingOrStale$1 = this.this$0.this$0; StoreChannelFollowerStats.access$handleChannelFollowerStatsFetchSuccess(storeChannelFollowerStats$fetchIfNonexistingOrStale$1.this$0, storeChannelFollowerStats$fetchIfNonexistingOrStale$1.$channelId, ModelChannelFollowerStats.Companion.fromResponse(this.$channelFollowerStats)); } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public AnonymousClass1(StoreChannelFollowerStats$fetchIfNonexistingOrStale$1 storeChannelFollowerStats$fetchIfNonexistingOrStale$1) { super(1); this.this$0 = storeChannelFollowerStats$fetchIfNonexistingOrStale$1; } /* 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(ModelChannelFollowerStatsDto modelChannelFollowerStatsDto) { invoke(modelChannelFollowerStatsDto); return Unit.a; } public final void invoke(ModelChannelFollowerStatsDto modelChannelFollowerStatsDto) { StoreChannelFollowerStats.access$getDispatcher$p(this.this$0.this$0).schedule(new AnonymousClass1(this, modelChannelFollowerStatsDto)); } } /* compiled from: StoreChannelFollowerStats.kt */ /* renamed from: com.discord.stores.StoreChannelFollowerStats$fetchIfNonexistingOrStale$1$2 reason: invalid class name */ public static final class AnonymousClass2 extends o implements Function1 { public final /* synthetic */ StoreChannelFollowerStats$fetchIfNonexistingOrStale$1 this$0; /* compiled from: StoreChannelFollowerStats.kt */ /* renamed from: com.discord.stores.StoreChannelFollowerStats$fetchIfNonexistingOrStale$1$2$1 reason: invalid class name */ public static final class AnonymousClass1 extends o implements Function0 { public final /* synthetic */ AnonymousClass2 this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public AnonymousClass1(AnonymousClass2 r1) { super(0); this.this$0 = r1; } @Override // kotlin.jvm.functions.Function0 /* renamed from: invoke */ public final void mo1invoke() { StoreChannelFollowerStats$fetchIfNonexistingOrStale$1 storeChannelFollowerStats$fetchIfNonexistingOrStale$1 = this.this$0.this$0; StoreChannelFollowerStats.access$handleChannelFollowerStatsFetchFailed(storeChannelFollowerStats$fetchIfNonexistingOrStale$1.this$0, storeChannelFollowerStats$fetchIfNonexistingOrStale$1.$channelId); } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public AnonymousClass2(StoreChannelFollowerStats$fetchIfNonexistingOrStale$1 storeChannelFollowerStats$fetchIfNonexistingOrStale$1) { super(1); this.this$0 = storeChannelFollowerStats$fetchIfNonexistingOrStale$1; } /* 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(Error error) { invoke(error); return Unit.a; } public final void invoke(Error error) { m.checkNotNullParameter(error, "it"); StoreChannelFollowerStats.access$getDispatcher$p(this.this$0.this$0).schedule(new AnonymousClass1(this)); } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public StoreChannelFollowerStats$fetchIfNonexistingOrStale$1(StoreChannelFollowerStats storeChannelFollowerStats, long j) { super(0); this.this$0 = storeChannelFollowerStats; this.$channelId = j; } @Override // kotlin.jvm.functions.Function0 /* renamed from: invoke */ public final void mo1invoke() { boolean z2 = StoreChannelFollowerStats.access$isExisting(this.this$0, this.$channelId) && !StoreChannelFollowerStats.access$isStale(this.this$0, this.$channelId); StoreChannelFollowerStats.ChannelFollowerStatData channelFollowerStatData = (StoreChannelFollowerStats.ChannelFollowerStatData) StoreChannelFollowerStats.access$getChannelFollowerStatsState$p(this.this$0).get(Long.valueOf(this.$channelId)); boolean z3 = (channelFollowerStatData != null ? channelFollowerStatData.getFetchState() : null) == StoreChannelFollowerStats.FetchState.FETCHING; if (!z2 && !z3) { StoreChannelFollowerStats.access$handleChannelFollowerStatsFetchStart(this.this$0, this.$channelId); ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().getChannelFollowerStats(this.$channelId), false, 1, null), this.this$0.getClass(), (Context) null, (Function1) null, new AnonymousClass2(this), (Function0) null, (Function0) null, new AnonymousClass1(this), 54, (Object) null); } } }