discord-jadx/app/src/main/java/com/discord/widgets/chat/input/gifpicker/GifSearchViewModel$Companio...

69 lines
3.8 KiB
Java

package com.discord.widgets.chat.input.gifpicker;
import com.discord.models.gifpicker.dto.ModelGif;
import com.discord.stores.StoreGifPicker;
import com.discord.widgets.chat.input.gifpicker.GifSearchViewModel;
import d0.z.d.m;
import j0.k.b;
import j0.l.e.j;
import java.util.List;
import rx.Observable;
import rx.functions.Func2;
/* compiled from: GifSearchViewModel.kt */
public final class GifSearchViewModel$Companion$observeQueryState$2<T, R> implements b<String, Observable<? extends GifSearchViewModel.StoreState>> {
public final /* synthetic */ StoreGifPicker $storeGifPicker;
public final /* synthetic */ List $trendingSearchTerms;
/* compiled from: GifSearchViewModel.kt */
/* renamed from: com.discord.widgets.chat.input.gifpicker.GifSearchViewModel$Companion$observeQueryState$2$1 reason: invalid class name */
public static final class AnonymousClass1<T, R> implements b<List<? extends ModelGif>, Boolean> {
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
public final Boolean call(List<ModelGif> list) {
return Boolean.valueOf(list != StoreGifPicker.Companion.getSearchResultsLoadingList());
}
/* 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 // j0.k.b
public /* bridge */ /* synthetic */ Boolean call(List<? extends ModelGif> list) {
return call((List<ModelGif>) list);
}
}
/* compiled from: GifSearchViewModel.kt */
/* renamed from: com.discord.widgets.chat.input.gifpicker.GifSearchViewModel$Companion$observeQueryState$2$2 reason: invalid class name */
public static final class AnonymousClass2<T1, T2, R> implements Func2<List<? extends ModelGif>, List<? extends String>, GifSearchViewModel.StoreState.SearchResults> {
public final /* synthetic */ String $query;
public final /* synthetic */ GifSearchViewModel$Companion$observeQueryState$2 this$0;
public AnonymousClass2(GifSearchViewModel$Companion$observeQueryState$2 gifSearchViewModel$Companion$observeQueryState$2, String str) {
this.this$0 = gifSearchViewModel$Companion$observeQueryState$2;
this.$query = str;
}
public final GifSearchViewModel.StoreState.SearchResults call(List<ModelGif> list, List<String> list2) {
m.checkNotNullExpressionValue(list, "gifResults");
m.checkNotNullExpressionValue(list2, "searchTerms");
return new GifSearchViewModel.StoreState.SearchResults(list, list2, this.this$0.$trendingSearchTerms, this.$query);
}
/* 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] */
@Override // rx.functions.Func2
public /* bridge */ /* synthetic */ GifSearchViewModel.StoreState.SearchResults call(List<? extends ModelGif> list, List<? extends String> list2) {
return call((List<ModelGif>) list, (List<String>) list2);
}
}
public GifSearchViewModel$Companion$observeQueryState$2(List list, StoreGifPicker storeGifPicker) {
this.$trendingSearchTerms = list;
this.$storeGifPicker = storeGifPicker;
}
public final Observable<? extends GifSearchViewModel.StoreState> call(String str) {
m.checkNotNullExpressionValue(str, "query");
return str.length() == 0 ? new j(new GifSearchViewModel.StoreState.TrendingSearchTermsResults(this.$trendingSearchTerms)) : Observable.j(this.$storeGifPicker.observeGifsForSearchQuery(str).x(AnonymousClass1.INSTANCE), this.$storeGifPicker.observeSuggestedSearchTerms(str), new AnonymousClass2(this, str));
}
}