package com.strmr.ps.ui.tvshows;

import android.animation.ValueAnimator;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.fragment.app.o;
import androidx.fragment.app.t;
import androidx.leanback.widget.VerticalGridView;
import androidx.lifecycle.as;
import androidx.lifecycle.at;
import androidx.lifecycle.n;
import androidx.lifecycle.s;
import androidx.media3.container.NalUnitUtil;
import androidx.media3.exoplayer.analytics.AnalyticsListener;
import androidx.media3.exoplayer.rtsp.SessionDescription;
import androidx.media3.exoplayer.upstream.CmcdData;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.button.MaterialButton;
import com.strmr.ps.DetailsActivity;
import com.strmr.ps.GridActivity;
import com.strmr.ps.MainActivity;
import com.strmr.ps.R;
import com.strmr.ps.data.model.ContentItem;
import com.strmr.ps.data.model.tmdb.TMDBImages;
import com.strmr.ps.data.remote.AddonMetadataClient;
import com.strmr.ps.data.remote.RateLimiter;
import com.strmr.ps.data.remote.api.TMDBApiService;
import com.strmr.ps.data.repository.ContentImageOverrideRepository;
import com.strmr.ps.data.repository.DebridLibraryRepository;
import com.strmr.ps.data.repository.PreferencesRepository;
import com.strmr.ps.data.repository.TraktStatusProvider;
import com.strmr.ps.ui.RowPrefetchManager;
import com.strmr.ps.ui.WatchedBadgeManager;
import com.strmr.ps.ui.contextmenu.ContextMenuActionHandler;
import com.strmr.ps.ui.contextmenu.h;
import com.strmr.ps.ui.rowitems.RowItemsActivity;
import com.strmr.ps.ui.settings.SettingsActivity;
import com.strmr.ps.ui.tvshows.TvShowsFragment;
import com.strmr.ps.ui.util.DimensionScaler;
import dagger.hilt.android.AndroidEntryPoint;
import defpackage.ao2;
import defpackage.b34;
import defpackage.ci4;
import defpackage.cr4;
import defpackage.d34;
import defpackage.d75;
import defpackage.dy9;
import defpackage.e24;
import defpackage.ey9;
import defpackage.g34;
import defpackage.g88;
import defpackage.gr3;
import defpackage.hy9;
import defpackage.i24;
import defpackage.i85;
import defpackage.ika;
import defpackage.ir3;
import defpackage.iw7;
import defpackage.j65;
import defpackage.j74;
import defpackage.jka;
import defpackage.jm4;
import defpackage.ly9;
import defpackage.qq3;
import defpackage.rx4;
import defpackage.sq3;
import defpackage.st;
import defpackage.sy2;
import defpackage.u24;
import defpackage.u55;
import defpackage.v65;
import defpackage.vx8;
import defpackage.wj0;
import defpackage.wm1;
import defpackage.yh6;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Objects;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0007\u0018\u00002\u00020\u00012\u00020\u0002:\u0001\u0005B\u0007¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0006"}, d2 = {"Lcom/strmr/ps/ui/tvshows/TvShowsFragment;", "Landroidx/fragment/app/o;", "Lyh6;", "<init>", "()V", CmcdData.OBJECT_TYPE_AUDIO_ONLY, "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@AndroidEntryPoint
@vx8
public final class TvShowsFragment extends j74 implements yh6 {
    public VerticalGridView aa;
    public ProgressBar ab;
    public ImageView ac;
    public ImageView ad;
    public ImageView ae;
    public TextView af;
    public TextView ag;
    public TextView ah;
    public TextView ai;
    public TextView aj;
    public TextView ak;
    public View al;
    public View am;
    public View an;
    public e24 ao;
    public rx4 ap;
    public b34 aq;
    public g88 ar;
    public u24 as;
    public i24 at;
    public MaterialButton au;
    public MaterialButton av;
    public MaterialButton aw;
    public MaterialButton ax;
    public MaterialButton ay;
    public MaterialButton az;
    public View ba;
    public boolean bb;
    public ValueAnimator bc;
    public ValueAnimator bd;
    public View be;
    public final as f;
    public RecyclerView.v i;
    public RowPrefetchManager j;
    public TMDBApiService k;
    public RateLimiter l;
    public ContextMenuActionHandler m;
    public TraktStatusProvider n;
    public WatchedBadgeManager o;
    public DimensionScaler p;
    public PreferencesRepository q;
    public DebridLibraryRepository r;
    public AddonMetadataClient s;
    public ContentImageOverrideRepository t;
    public h u;
    public jm4 v;
    public d34 w;
    public boolean x;
    public boolean y;
    public boolean z;

    @Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0007\n\u0002\b\u0003\n\u0002\u0010\t\n\u0002\b\u0006\b\u0086\u0003\u0018\u00002\u00020\u0001R\u0014\u0010\u0003\u001a\u00020\u00028\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0003\u0010\u0004R\u0014\u0010\u0006\u001a\u00020\u00058\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0006\u0010\u0007R\u0014\u0010\b\u001a\u00020\u00058\u0002X\u0082T¢\u0006\u0006\n\u0004\b\b\u0010\u0007R\u0014\u0010\n\u001a\u00020\t8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\n\u0010\u000bR\u0014\u0010\f\u001a\u00020\t8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\f\u0010\u000bR\u0014\u0010\r\u001a\u00020\t8\u0002X\u0082T¢\u0006\u0006\n\u0004\b\r\u0010\u000bR\u0014\u0010\u000e\u001a\u00020\u00058\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u000e\u0010\u0007¨\u0006\u000f"}, d2 = {"Lcom/strmr/ps/ui/tvshows/TvShowsFragment$a;", "", "", "TAG", "Ljava/lang/String;", "", "NAV_BAR_HIDDEN_TRANSLATION_X", "F", "NAV_BAR_SHOWN_TRANSLATION_X", "", "NAV_BAR_HIDE_DURATION", "J", "NAV_BAR_SHOW_DURATION", "NAV_BAR_LAUNCH_VISIBLE_DELAY", "CONTENT_SHIFT_NAV_HIDDEN_DP", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public static final class a {
    }

    @Metadata(k = 3, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
    public /* synthetic */ class b {
        static {
            int[] iArr = new int[g88.c.values().length];
            try {
                iArr[0] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                g88.c cVar = g88.c.a;
                iArr[1] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                g88.c cVar2 = g88.c.a;
                iArr[2] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                g88.c cVar3 = g88.c.a;
                iArr[3] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                g88.c cVar4 = g88.c.a;
                iArr[4] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                g88.c cVar5 = g88.c.a;
                iArr[5] = 6;
            } catch (NoSuchFieldError unused6) {
            }
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Landroidx/fragment/app/o;", "invoke", "()Landroidx/fragment/app/o;", "cp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class c extends u55 implements qq3<o> {
        public c() {
            super(0);
        }

        @Override // defpackage.qq3
        public final Object invoke() {
            return TvShowsFragment.this;
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Ljka;", "invoke", "()Ljka;", "hp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class d extends u55 implements qq3<jka> {
        public final /* synthetic */ c a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public d(c cVar) {
            super(0);
            this.a = cVar;
        }

        @Override // defpackage.qq3
        public final Object invoke() {
            return (jka) this.a.invoke();
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Lika;", "invoke", "()Lika;", "dp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class e extends u55 implements qq3<ika> {
        public final /* synthetic */ Object a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public e(j65 j65Var) {
            super(0);
            this.a = j65Var;
        }

        /* JADX WARN: Type inference failed for: r0v0, types: [j65, java.lang.Object] */
        @Override // defpackage.qq3
        public final Object invoke() {
            return ((jka) this.a.getValue()).getViewModelStore();
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Lwm1;", "invoke", "()Lwm1;", "ep3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class f extends u55 implements qq3<wm1> {
        public final /* synthetic */ Object a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public f(j65 j65Var) {
            super(0);
            this.a = j65Var;
        }

        /* JADX WARN: Type inference failed for: r0v0, types: [j65, java.lang.Object] */
        @Override // defpackage.qq3
        public final Object invoke() {
            jka jkaVar = (jka) this.a.getValue();
            androidx.lifecycle.h hVar = jkaVar instanceof androidx.lifecycle.h ? (androidx.lifecycle.h) jkaVar : null;
            return hVar != null ? hVar.getDefaultViewModelCreationExtras() : wm1.a.b;
        }
    }

    @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0010\u0006\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lxja;", "VM", "Landroidx/lifecycle/at$c;", "invoke", "()Landroidx/lifecycle/at$c;", "fp3", "<anonymous>"}, k = 3, mv = {2, 0, 0})
    public static final class g extends u55 implements qq3<at.c> {
        public final /* synthetic */ Object b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public g(j65 j65Var) {
            super(0);
            this.b = j65Var;
        }

        /* JADX WARN: Type inference failed for: r0v0, types: [j65, java.lang.Object] */
        @Override // defpackage.qq3
        public final Object invoke() {
            at.c defaultViewModelProviderFactory;
            jka jkaVar = (jka) this.b.getValue();
            androidx.lifecycle.h hVar = jkaVar instanceof androidx.lifecycle.h ? (androidx.lifecycle.h) jkaVar : null;
            return (hVar == null || (defaultViewModelProviderFactory = hVar.getDefaultViewModelProviderFactory()) == null) ? TvShowsFragment.this.getDefaultViewModelProviderFactory() : defaultViewModelProviderFactory;
        }
    }

    public TvShowsFragment() {
        j65 j65VarB = v65.b(d75.b, new d(new c()));
        this.f = new as(iw7.a.getOrCreateKotlinClass(TvShowsViewModel.class), new e(j65VarB), new g(j65VarB), new f(j65VarB));
        this.y = true;
    }

    @Override // defpackage.yh6
    public final boolean c() {
        d34 d34Var = this.w;
        if (d34Var == null || !d34Var.o) {
            return false;
        }
        d34Var.f();
        return true;
    }

    @Override // defpackage.yh6
    public final void d() {
        if (!o().getAutoHideNavBar() || !this.bb) {
            g88 g88Var = this.ar;
            if (g88Var != null) {
                g88Var.c();
                return;
            } else {
                cr4.n("rowsDelegate");
                throw null;
            }
        }
        dy9 dy9Var = new dy9(this, 1);
        View view = this.ba;
        if (view == null) {
            return;
        }
        if (!o().getAutoHideNavBar()) {
            dy9Var.invoke();
            return;
        }
        ValueAnimator valueAnimator = this.bc;
        if (valueAnimator != null) {
            valueAnimator.cancel();
        }
        float f2 = getResources().getDisplayMetrics().density * (-25.0f);
        float translationX = view.getTranslationX();
        if (translationX == f2) {
            this.bb = false;
            l(true);
            dy9Var.invoke();
            return;
        }
        ValueAnimator valueAnimatorOfFloat = ValueAnimator.ofFloat(translationX, f2);
        valueAnimatorOfFloat.setDuration(300L);
        valueAnimatorOfFloat.setInterpolator(new DecelerateInterpolator());
        valueAnimatorOfFloat.addUpdateListener(new ey9(this, 2));
        valueAnimatorOfFloat.addListener(new ly9(this, dy9Var));
        valueAnimatorOfFloat.start();
        this.bc = valueAnimatorOfFloat;
        l(true);
    }

    public final void l(boolean z) {
        ValueAnimator valueAnimator = this.bd;
        if (valueAnimator != null) {
            valueAnimator.cancel();
        }
        View view = this.be;
        if (view == null) {
            return;
        }
        float f2 = z ? 0.0f : getResources().getDisplayMetrics().density * (-30.0f);
        float translationX = view.getTranslationX();
        if (translationX == f2) {
            return;
        }
        ValueAnimator valueAnimatorOfFloat = ValueAnimator.ofFloat(translationX, f2);
        valueAnimatorOfFloat.setDuration(z ? 300L : 1000L);
        valueAnimatorOfFloat.setInterpolator(z ? new DecelerateInterpolator() : new AccelerateInterpolator());
        valueAnimatorOfFloat.addUpdateListener(new ey9(this, 1));
        valueAnimatorOfFloat.start();
        this.bd = valueAnimatorOfFloat;
    }

    public final void m(View view) {
        FrameLayout frameLayout = (FrameLayout) view.findViewById(R.id.hero_trailer_container);
        if (frameLayout == null) {
            return;
        }
        TMDBApiService tMDBApiServiceP = p();
        AddonMetadataClient addonMetadataClient = this.s;
        if (addonMetadataClient == null) {
            cr4.n("addonMetadataClient");
            throw null;
        }
        i85 viewLifecycleOwner = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        n nVarA = s.a(viewLifecycleOwner);
        View view2 = this.am;
        if (view2 == null) {
            cr4.n("heroInfoContainer");
            throw null;
        }
        ImageView imageView = this.ac;
        if (imageView == null) {
            cr4.n("heroBackdrop");
            throw null;
        }
        ImageView imageView2 = this.ad;
        if (imageView2 == null) {
            cr4.n("heroBackdropIncoming");
            throw null;
        }
        d34 d34Var = new d34(tMDBApiServiceP, addonMetadataClient, nVarA, frameLayout, view2, imageView, imageView2);
        d34Var.h = ((long) o().getHeroTrailerDelaySeconds()) * 1000;
        d34Var.i = o().getHeroTrailerMuted();
        VerticalGridView verticalGridView = this.aa;
        if (verticalGridView == null) {
            cr4.n("contentRowsView");
            throw null;
        }
        verticalGridView.addOnScrollListener(new g34(d34Var));
        this.w = d34Var;
    }

    public final void n() {
        TMDBApiService tMDBApiServiceP = p();
        AddonMetadataClient addonMetadataClient = this.s;
        if (addonMetadataClient == null) {
            cr4.n("addonMetadataClient");
            throw null;
        }
        i85 viewLifecycleOwner = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        jm4 jm4Var = new jm4(tMDBApiServiceP, addonMetadataClient, s.a(viewLifecycleOwner), new dy9(this, 0), new sy2(13));
        jm4Var.j = o().getTrailerPreviewEnabled();
        jm4Var.k = o().getTrailerPreviewMuted();
        this.v = jm4Var;
    }

    public final PreferencesRepository o() {
        PreferencesRepository preferencesRepository = this.q;
        if (preferencesRepository != null) {
            return preferencesRepository;
        }
        cr4.n("preferencesRepository");
        throw null;
    }

    @Override // androidx.fragment.app.o
    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        cr4.g(layoutInflater, "inflater");
        return layoutInflater.inflate(R.layout.fragment_tv_shows, viewGroup, false);
    }

    @Override // androidx.fragment.app.o
    public final void onDestroyView() {
        super.onDestroyView();
        jm4 jm4Var = this.v;
        if (jm4Var != null) {
            jm4Var.c();
        }
        this.v = null;
        d34 d34Var = this.w;
        if (d34Var != null) {
            d34Var.d();
        }
        this.w = null;
        g88 g88Var = this.ar;
        if (g88Var == null) {
            cr4.n("rowsDelegate");
            throw null;
        }
        g88Var.e.removeCallbacks(g88Var.z);
        ValueAnimator valueAnimator = this.bc;
        if (valueAnimator != null) {
            valueAnimator.cancel();
        }
        this.bc = null;
        q().f();
        u24 u24Var = this.as;
        if (u24Var == null) {
            cr4.n("heroLogoLoader");
            throw null;
        }
        u24Var.a();
        e24 e24Var = this.ao;
        if (e24Var != null) {
            e24Var.c();
        } else {
            cr4.n("heroBackgroundController");
            throw null;
        }
    }

    @Override // androidx.fragment.app.o
    public final void onPause() {
        super.onPause();
        jm4 jm4Var = this.v;
        if (jm4Var != null) {
            jm4Var.p = true;
            jm4Var.f();
        }
        d34 d34Var = this.w;
        if (d34Var != null) {
            d34Var.i();
        }
    }

    @Override // androidx.fragment.app.o
    public final void onResume() {
        super.onResume();
        jm4 jm4Var = this.v;
        if (jm4Var != null) {
            jm4Var.p = false;
        }
        d34 d34Var = this.w;
        if (d34Var != null) {
            d34Var.j();
        }
        i85 viewLifecycleOwner = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        wj0.c(s.a(viewLifecycleOwner), null, null, new com.strmr.ps.ui.tvshows.d(this, null), 3);
        View view = this.an;
        if (view == null) {
            cr4.n("backgroundDimOverlay");
            throw null;
        }
        view.setAlpha(o().getBackgroundDimOpacity() / 100.0f);
        q().e();
        boolean trailerOnFocusEnabled = o().getTrailerOnFocusEnabled();
        boolean trailerPreviewEnabled = o().getTrailerPreviewEnabled();
        boolean heroTrailerEnabled = o().getHeroTrailerEnabled();
        if (trailerOnFocusEnabled != this.x) {
            this.x = trailerOnFocusEnabled;
            g88 g88Var = this.ar;
            if (g88Var == null) {
                cr4.n("rowsDelegate");
                throw null;
            }
            g88Var.f(trailerOnFocusEnabled);
            if (!trailerOnFocusEnabled) {
                jm4 jm4Var2 = this.v;
                if (jm4Var2 != null) {
                    jm4Var2.c();
                }
                this.v = null;
            } else if (this.v == null) {
                n();
            }
        }
        if (trailerPreviewEnabled != this.y) {
            this.y = trailerPreviewEnabled;
            jm4 jm4Var3 = this.v;
            if (jm4Var3 != null) {
                jm4Var3.j = trailerPreviewEnabled;
            }
        }
        if (heroTrailerEnabled != this.z) {
            this.z = heroTrailerEnabled;
            if (!heroTrailerEnabled) {
                d34 d34Var2 = this.w;
                if (d34Var2 != null) {
                    d34Var2.d();
                }
                this.w = null;
            } else if (this.w == null) {
                View viewRequireView = requireView();
                cr4.f(viewRequireView, "requireView(...)");
                m(viewRequireView);
            }
        }
        d34 d34Var3 = this.w;
        if (d34Var3 != null) {
            d34Var3.h = ((long) o().getHeroTrailerDelaySeconds()) * 1000;
            d34Var3.i = o().getHeroTrailerMuted();
        }
    }

    @Override // androidx.fragment.app.o
    public final void onViewCreated(View view, Bundle bundle) {
        cr4.g(view, "view");
        super.onViewCreated(view, bundle);
        this.aa = (VerticalGridView) view.findViewById(R.id.content_rows);
        this.ab = (ProgressBar) view.findViewById(R.id.loading_indicator);
        this.ac = (ImageView) view.findViewById(R.id.hero_backdrop);
        this.ad = (ImageView) view.findViewById(R.id.hero_backdrop_incoming);
        this.ae = (ImageView) view.findViewById(R.id.hero_logo);
        this.af = (TextView) view.findViewById(R.id.hero_title);
        this.ag = (TextView) view.findViewById(R.id.hero_metadata);
        this.ah = (TextView) view.findViewById(R.id.hero_genre_text);
        this.ai = (TextView) view.findViewById(R.id.hero_overview);
        this.aj = (TextView) view.findViewById(R.id.hero_cast);
        this.ak = (TextView) view.findViewById(R.id.hero_tagline);
        this.al = view.findViewById(R.id.ambient_background_overlay);
        this.am = view.findViewById(R.id.hero_info_container);
        this.an = view.findViewById(R.id.background_dim_overlay);
        ImageView imageView = this.ac;
        if (imageView == null) {
            cr4.n("heroBackdrop");
            throw null;
        }
        ImageView imageView2 = this.ad;
        if (imageView2 == null) {
            cr4.n("heroBackdropIncoming");
            throw null;
        }
        View view2 = this.al;
        if (view2 == null) {
            cr4.n("ambientOverlay");
            throw null;
        }
        this.ao = new e24(this, imageView, imageView2, view2, (ImageView) view.findViewById(R.id.hero_sidecar), view.findViewById(R.id.sidecar_scrim), 0);
        View view3 = this.am;
        if (view3 == null) {
            cr4.n("heroInfoContainer");
            throw null;
        }
        this.at = new i24(view3);
        this.au = (MaterialButton) view.findViewById(R.id.nav_search);
        this.av = (MaterialButton) view.findViewById(R.id.nav_home);
        this.aw = (MaterialButton) view.findViewById(R.id.nav_movies);
        this.ax = (MaterialButton) view.findViewById(R.id.nav_tv_shows);
        this.ay = (MaterialButton) view.findViewById(R.id.nav_library);
        this.az = (MaterialButton) view.findViewById(R.id.nav_settings);
        this.ba = view.findViewById(R.id.navigation_dock);
        this.be = view.findViewById(R.id.tvshows_content_container);
        i85 viewLifecycleOwner = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        final int i = 1;
        this.aq = new b34(viewLifecycleOwner, new sq3(this) { // from class: gy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.sq3
            public final Object invoke(Object obj) {
                MainActivity mainActivity;
                int i2 = i;
                e6a e6aVar = e6a.a;
                TvShowsFragment tvShowsFragment = this.b;
                switch (i2) {
                    case 0:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        if (contentItem.getItemType() == ContentItem.ItemType.TV_SHOW) {
                            i85 viewLifecycleOwner2 = tvShowsFragment.getViewLifecycleOwner();
                            cr4.f(viewLifecycleOwner2, "getViewLifecycleOwner(...)");
                            wj0.c(s.a(viewLifecycleOwner2), null, null, new jy9(contentItem, tvShowsFragment, null), 3);
                        }
                        return e6aVar;
                    case 1:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "content");
                        contentItem2.getTitle();
                        e24 e24Var = tvShowsFragment.ao;
                        if (e24Var == null) {
                            cr4.n("heroBackgroundController");
                            throw null;
                        }
                        String backdropUrl = contentItem2.getBackdropUrl();
                        if (backdropUrl == null) {
                            backdropUrl = contentItem2.getPosterUrl();
                        }
                        e24Var.e(backdropUrl, tvShowsFragment.requireContext().getDrawable(R.drawable.default_background), null);
                        d34 d34Var = tvShowsFragment.w;
                        if (d34Var != null) {
                            d34Var.h(contentItem2);
                        }
                        i24 i24Var = tvShowsFragment.at;
                        if (i24Var != null) {
                            i24Var.a(new dz5(tvShowsFragment, contentItem2, 17));
                            return e6aVar;
                        }
                        cr4.n("heroContentAnimator");
                        throw null;
                    case 2:
                        tvShowsFragment.q().m(((Integer) obj).intValue());
                        return e6aVar;
                    case 3:
                        g88.c cVar = (g88.c) obj;
                        cr4.g(cVar, "section");
                        int iOrdinal = cVar.ordinal();
                        if (iOrdinal == 0) {
                            t activity = tvShowsFragment.getActivity();
                            mainActivity = activity instanceof MainActivity ? (MainActivity) activity : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.e);
                            }
                        } else if (iOrdinal == 1) {
                            t activity2 = tvShowsFragment.getActivity();
                            mainActivity = activity2 instanceof MainActivity ? (MainActivity) activity2 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.b);
                            }
                        } else if (iOrdinal == 2) {
                            t activity3 = tvShowsFragment.getActivity();
                            mainActivity = activity3 instanceof MainActivity ? (MainActivity) activity3 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.c);
                            }
                        } else if (iOrdinal != 3) {
                            if (iOrdinal == 4) {
                                t activity4 = tvShowsFragment.getActivity();
                                mainActivity = activity4 instanceof MainActivity ? (MainActivity) activity4 : null;
                                if (mainActivity != null) {
                                    mainActivity.e(MainActivity.b.f);
                                }
                            } else {
                                if (iOrdinal != 5) {
                                    throw new io6();
                                }
                                tvShowsFragment.startActivity(new Intent(tvShowsFragment.requireContext(), (Class<?>) SettingsActivity.class));
                            }
                        }
                        return e6aVar;
                    case 4:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        List list = af1Var.b;
                        list.size();
                        x78 x78Var = af1Var.c;
                        Objects.toString(x78Var);
                        int i3 = GridActivity.f;
                        Context contextRequireContext = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext, "requireContext(...)");
                        String str = af1Var.a;
                        ArrayList arrayList = new ArrayList(list);
                        String strName = x78Var.name();
                        String str2 = af1Var.d;
                        tvShowsFragment.startActivity(GridActivity.a.b(contextRequireContext, str, arrayList, strName, n89.ab(str2) ? null : str2, "tv", af1Var.f, af1Var.g, af1Var.h, af1Var.i));
                        return e6aVar;
                    default:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        Context contextRequireContext2 = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        C0690s87.a(contextRequireContext2, contentItem3, null);
                        return e6aVar;
                }
            }
        });
        ImageView imageView3 = this.ae;
        if (imageView3 == null) {
            cr4.n("heroLogo");
            throw null;
        }
        TextView textView = this.af;
        if (textView == null) {
            cr4.n("heroTitle");
            throw null;
        }
        this.as = new u24(this, imageView3, textView);
        Context contextRequireContext = requireContext();
        cr4.f(contextRequireContext, "requireContext(...)");
        i85 viewLifecycleOwner2 = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner2, "getViewLifecycleOwner(...)");
        n nVarA = s.a(viewLifecycleOwner2);
        ContextMenuActionHandler contextMenuActionHandler = this.m;
        if (contextMenuActionHandler == null) {
            cr4.n("contextMenuActionHandler");
            throw null;
        }
        TraktStatusProvider traktStatusProvider = this.n;
        if (traktStatusProvider == null) {
            cr4.n("traktStatusProvider");
            throw null;
        }
        final int i2 = 0;
        ir3 ir3Var = new ir3(this) { // from class: fy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.ir3
            public final Object invoke(Object obj, Object obj2, Object obj3) {
                switch (i2) {
                    case 0:
                        int iIntValue = ((Integer) obj).intValue();
                        ContentItem.ItemType itemType = (ContentItem.ItemType) obj2;
                        boolean zBooleanValue = ((Boolean) obj3).booleanValue();
                        cr4.g(itemType, SessionDescription.ATTR_TYPE);
                        TvShowsFragment tvShowsFragment = this.b;
                        i85 viewLifecycleOwner3 = tvShowsFragment.getViewLifecycleOwner();
                        cr4.f(viewLifecycleOwner3, "getViewLifecycleOwner(...)");
                        wj0.c(s.a(viewLifecycleOwner3), null, null, new ky9(tvShowsFragment, iIntValue, itemType, zBooleanValue, null), 3);
                        break;
                    case 1:
                        ContentItem contentItem = (ContentItem) obj;
                        View view4 = (View) obj2;
                        boolean zBooleanValue2 = ((Boolean) obj3).booleanValue();
                        cr4.g(contentItem, "item");
                        cr4.g(view4, "cardView");
                        TvShowsFragment tvShowsFragment2 = this.b;
                        if (zBooleanValue2) {
                            jm4 jm4Var = tvShowsFragment2.v;
                            if (jm4Var != null) {
                                jm4Var.g(contentItem, view4);
                            }
                        } else {
                            jm4 jm4Var2 = tvShowsFragment2.v;
                            if (jm4Var2 != null) {
                                jm4Var2.f();
                            }
                        }
                        return e6a.a;
                    case 2:
                        String str = (String) obj;
                        cr4.g(str, "rowConfigId");
                        this.b.q().d(str, (String) obj2, (String) obj3);
                        break;
                    default:
                        ContentItem contentItem2 = (ContentItem) obj;
                        String str2 = (String) obj2;
                        TMDBImages tMDBImages = (TMDBImages) obj3;
                        cr4.g(contentItem2, "item");
                        cr4.g(str2, "imageType");
                        cr4.g(tMDBImages, "images");
                        TvShowsFragment tvShowsFragment3 = this.b;
                        if (tvShowsFragment3.isAdded() && tvShowsFragment3.getChildFragmentManager().af("image_picker") == null) {
                            ci4.a.a(contentItem2.getTmdbId(), str2, tMDBImages).show(tvShowsFragment3.getChildFragmentManager(), "image_picker");
                        }
                        return e6a.a;
                }
                return e6a.a;
            }
        };
        final int i3 = 4;
        sq3 sq3Var = new sq3(this) { // from class: gy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.sq3
            public final Object invoke(Object obj) {
                MainActivity mainActivity;
                int i22 = i3;
                e6a e6aVar = e6a.a;
                TvShowsFragment tvShowsFragment = this.b;
                switch (i22) {
                    case 0:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        if (contentItem.getItemType() == ContentItem.ItemType.TV_SHOW) {
                            i85 viewLifecycleOwner22 = tvShowsFragment.getViewLifecycleOwner();
                            cr4.f(viewLifecycleOwner22, "getViewLifecycleOwner(...)");
                            wj0.c(s.a(viewLifecycleOwner22), null, null, new jy9(contentItem, tvShowsFragment, null), 3);
                        }
                        return e6aVar;
                    case 1:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "content");
                        contentItem2.getTitle();
                        e24 e24Var = tvShowsFragment.ao;
                        if (e24Var == null) {
                            cr4.n("heroBackgroundController");
                            throw null;
                        }
                        String backdropUrl = contentItem2.getBackdropUrl();
                        if (backdropUrl == null) {
                            backdropUrl = contentItem2.getPosterUrl();
                        }
                        e24Var.e(backdropUrl, tvShowsFragment.requireContext().getDrawable(R.drawable.default_background), null);
                        d34 d34Var = tvShowsFragment.w;
                        if (d34Var != null) {
                            d34Var.h(contentItem2);
                        }
                        i24 i24Var = tvShowsFragment.at;
                        if (i24Var != null) {
                            i24Var.a(new dz5(tvShowsFragment, contentItem2, 17));
                            return e6aVar;
                        }
                        cr4.n("heroContentAnimator");
                        throw null;
                    case 2:
                        tvShowsFragment.q().m(((Integer) obj).intValue());
                        return e6aVar;
                    case 3:
                        g88.c cVar = (g88.c) obj;
                        cr4.g(cVar, "section");
                        int iOrdinal = cVar.ordinal();
                        if (iOrdinal == 0) {
                            t activity = tvShowsFragment.getActivity();
                            mainActivity = activity instanceof MainActivity ? (MainActivity) activity : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.e);
                            }
                        } else if (iOrdinal == 1) {
                            t activity2 = tvShowsFragment.getActivity();
                            mainActivity = activity2 instanceof MainActivity ? (MainActivity) activity2 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.b);
                            }
                        } else if (iOrdinal == 2) {
                            t activity3 = tvShowsFragment.getActivity();
                            mainActivity = activity3 instanceof MainActivity ? (MainActivity) activity3 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.c);
                            }
                        } else if (iOrdinal != 3) {
                            if (iOrdinal == 4) {
                                t activity4 = tvShowsFragment.getActivity();
                                mainActivity = activity4 instanceof MainActivity ? (MainActivity) activity4 : null;
                                if (mainActivity != null) {
                                    mainActivity.e(MainActivity.b.f);
                                }
                            } else {
                                if (iOrdinal != 5) {
                                    throw new io6();
                                }
                                tvShowsFragment.startActivity(new Intent(tvShowsFragment.requireContext(), (Class<?>) SettingsActivity.class));
                            }
                        }
                        return e6aVar;
                    case 4:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        List list = af1Var.b;
                        list.size();
                        x78 x78Var = af1Var.c;
                        Objects.toString(x78Var);
                        int i32 = GridActivity.f;
                        Context contextRequireContext2 = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        String str = af1Var.a;
                        ArrayList arrayList = new ArrayList(list);
                        String strName = x78Var.name();
                        String str2 = af1Var.d;
                        tvShowsFragment.startActivity(GridActivity.a.b(contextRequireContext2, str, arrayList, strName, n89.ab(str2) ? null : str2, "tv", af1Var.f, af1Var.g, af1Var.h, af1Var.i));
                        return e6aVar;
                    default:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        Context contextRequireContext22 = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext22, "requireContext(...)");
                        C0690s87.a(contextRequireContext22, contentItem3, null);
                        return e6aVar;
                }
            }
        };
        final int i4 = 5;
        sq3 sq3Var2 = new sq3(this) { // from class: gy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.sq3
            public final Object invoke(Object obj) {
                MainActivity mainActivity;
                int i22 = i4;
                e6a e6aVar = e6a.a;
                TvShowsFragment tvShowsFragment = this.b;
                switch (i22) {
                    case 0:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        if (contentItem.getItemType() == ContentItem.ItemType.TV_SHOW) {
                            i85 viewLifecycleOwner22 = tvShowsFragment.getViewLifecycleOwner();
                            cr4.f(viewLifecycleOwner22, "getViewLifecycleOwner(...)");
                            wj0.c(s.a(viewLifecycleOwner22), null, null, new jy9(contentItem, tvShowsFragment, null), 3);
                        }
                        return e6aVar;
                    case 1:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "content");
                        contentItem2.getTitle();
                        e24 e24Var = tvShowsFragment.ao;
                        if (e24Var == null) {
                            cr4.n("heroBackgroundController");
                            throw null;
                        }
                        String backdropUrl = contentItem2.getBackdropUrl();
                        if (backdropUrl == null) {
                            backdropUrl = contentItem2.getPosterUrl();
                        }
                        e24Var.e(backdropUrl, tvShowsFragment.requireContext().getDrawable(R.drawable.default_background), null);
                        d34 d34Var = tvShowsFragment.w;
                        if (d34Var != null) {
                            d34Var.h(contentItem2);
                        }
                        i24 i24Var = tvShowsFragment.at;
                        if (i24Var != null) {
                            i24Var.a(new dz5(tvShowsFragment, contentItem2, 17));
                            return e6aVar;
                        }
                        cr4.n("heroContentAnimator");
                        throw null;
                    case 2:
                        tvShowsFragment.q().m(((Integer) obj).intValue());
                        return e6aVar;
                    case 3:
                        g88.c cVar = (g88.c) obj;
                        cr4.g(cVar, "section");
                        int iOrdinal = cVar.ordinal();
                        if (iOrdinal == 0) {
                            t activity = tvShowsFragment.getActivity();
                            mainActivity = activity instanceof MainActivity ? (MainActivity) activity : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.e);
                            }
                        } else if (iOrdinal == 1) {
                            t activity2 = tvShowsFragment.getActivity();
                            mainActivity = activity2 instanceof MainActivity ? (MainActivity) activity2 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.b);
                            }
                        } else if (iOrdinal == 2) {
                            t activity3 = tvShowsFragment.getActivity();
                            mainActivity = activity3 instanceof MainActivity ? (MainActivity) activity3 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.c);
                            }
                        } else if (iOrdinal != 3) {
                            if (iOrdinal == 4) {
                                t activity4 = tvShowsFragment.getActivity();
                                mainActivity = activity4 instanceof MainActivity ? (MainActivity) activity4 : null;
                                if (mainActivity != null) {
                                    mainActivity.e(MainActivity.b.f);
                                }
                            } else {
                                if (iOrdinal != 5) {
                                    throw new io6();
                                }
                                tvShowsFragment.startActivity(new Intent(tvShowsFragment.requireContext(), (Class<?>) SettingsActivity.class));
                            }
                        }
                        return e6aVar;
                    case 4:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        List list = af1Var.b;
                        list.size();
                        x78 x78Var = af1Var.c;
                        Objects.toString(x78Var);
                        int i32 = GridActivity.f;
                        Context contextRequireContext2 = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        String str = af1Var.a;
                        ArrayList arrayList = new ArrayList(list);
                        String strName = x78Var.name();
                        String str2 = af1Var.d;
                        tvShowsFragment.startActivity(GridActivity.a.b(contextRequireContext2, str, arrayList, strName, n89.ab(str2) ? null : str2, "tv", af1Var.f, af1Var.g, af1Var.h, af1Var.i));
                        return e6aVar;
                    default:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        Context contextRequireContext22 = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext22, "requireContext(...)");
                        C0690s87.a(contextRequireContext22, contentItem3, null);
                        return e6aVar;
                }
            }
        };
        final int i5 = 0;
        sq3 sq3Var3 = new sq3(this) { // from class: gy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.sq3
            public final Object invoke(Object obj) {
                MainActivity mainActivity;
                int i22 = i5;
                e6a e6aVar = e6a.a;
                TvShowsFragment tvShowsFragment = this.b;
                switch (i22) {
                    case 0:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        if (contentItem.getItemType() == ContentItem.ItemType.TV_SHOW) {
                            i85 viewLifecycleOwner22 = tvShowsFragment.getViewLifecycleOwner();
                            cr4.f(viewLifecycleOwner22, "getViewLifecycleOwner(...)");
                            wj0.c(s.a(viewLifecycleOwner22), null, null, new jy9(contentItem, tvShowsFragment, null), 3);
                        }
                        return e6aVar;
                    case 1:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "content");
                        contentItem2.getTitle();
                        e24 e24Var = tvShowsFragment.ao;
                        if (e24Var == null) {
                            cr4.n("heroBackgroundController");
                            throw null;
                        }
                        String backdropUrl = contentItem2.getBackdropUrl();
                        if (backdropUrl == null) {
                            backdropUrl = contentItem2.getPosterUrl();
                        }
                        e24Var.e(backdropUrl, tvShowsFragment.requireContext().getDrawable(R.drawable.default_background), null);
                        d34 d34Var = tvShowsFragment.w;
                        if (d34Var != null) {
                            d34Var.h(contentItem2);
                        }
                        i24 i24Var = tvShowsFragment.at;
                        if (i24Var != null) {
                            i24Var.a(new dz5(tvShowsFragment, contentItem2, 17));
                            return e6aVar;
                        }
                        cr4.n("heroContentAnimator");
                        throw null;
                    case 2:
                        tvShowsFragment.q().m(((Integer) obj).intValue());
                        return e6aVar;
                    case 3:
                        g88.c cVar = (g88.c) obj;
                        cr4.g(cVar, "section");
                        int iOrdinal = cVar.ordinal();
                        if (iOrdinal == 0) {
                            t activity = tvShowsFragment.getActivity();
                            mainActivity = activity instanceof MainActivity ? (MainActivity) activity : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.e);
                            }
                        } else if (iOrdinal == 1) {
                            t activity2 = tvShowsFragment.getActivity();
                            mainActivity = activity2 instanceof MainActivity ? (MainActivity) activity2 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.b);
                            }
                        } else if (iOrdinal == 2) {
                            t activity3 = tvShowsFragment.getActivity();
                            mainActivity = activity3 instanceof MainActivity ? (MainActivity) activity3 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.c);
                            }
                        } else if (iOrdinal != 3) {
                            if (iOrdinal == 4) {
                                t activity4 = tvShowsFragment.getActivity();
                                mainActivity = activity4 instanceof MainActivity ? (MainActivity) activity4 : null;
                                if (mainActivity != null) {
                                    mainActivity.e(MainActivity.b.f);
                                }
                            } else {
                                if (iOrdinal != 5) {
                                    throw new io6();
                                }
                                tvShowsFragment.startActivity(new Intent(tvShowsFragment.requireContext(), (Class<?>) SettingsActivity.class));
                            }
                        }
                        return e6aVar;
                    case 4:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        List list = af1Var.b;
                        list.size();
                        x78 x78Var = af1Var.c;
                        Objects.toString(x78Var);
                        int i32 = GridActivity.f;
                        Context contextRequireContext2 = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        String str = af1Var.a;
                        ArrayList arrayList = new ArrayList(list);
                        String strName = x78Var.name();
                        String str2 = af1Var.d;
                        tvShowsFragment.startActivity(GridActivity.a.b(contextRequireContext2, str, arrayList, strName, n89.ab(str2) ? null : str2, "tv", af1Var.f, af1Var.g, af1Var.h, af1Var.i));
                        return e6aVar;
                    default:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        Context contextRequireContext22 = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext22, "requireContext(...)");
                        C0690s87.a(contextRequireContext22, contentItem3, null);
                        return e6aVar;
                }
            }
        };
        final int i6 = 2;
        ir3 ir3Var2 = new ir3(this) { // from class: fy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.ir3
            public final Object invoke(Object obj, Object obj2, Object obj3) {
                switch (i6) {
                    case 0:
                        int iIntValue = ((Integer) obj).intValue();
                        ContentItem.ItemType itemType = (ContentItem.ItemType) obj2;
                        boolean zBooleanValue = ((Boolean) obj3).booleanValue();
                        cr4.g(itemType, SessionDescription.ATTR_TYPE);
                        TvShowsFragment tvShowsFragment = this.b;
                        i85 viewLifecycleOwner3 = tvShowsFragment.getViewLifecycleOwner();
                        cr4.f(viewLifecycleOwner3, "getViewLifecycleOwner(...)");
                        wj0.c(s.a(viewLifecycleOwner3), null, null, new ky9(tvShowsFragment, iIntValue, itemType, zBooleanValue, null), 3);
                        break;
                    case 1:
                        ContentItem contentItem = (ContentItem) obj;
                        View view4 = (View) obj2;
                        boolean zBooleanValue2 = ((Boolean) obj3).booleanValue();
                        cr4.g(contentItem, "item");
                        cr4.g(view4, "cardView");
                        TvShowsFragment tvShowsFragment2 = this.b;
                        if (zBooleanValue2) {
                            jm4 jm4Var = tvShowsFragment2.v;
                            if (jm4Var != null) {
                                jm4Var.g(contentItem, view4);
                            }
                        } else {
                            jm4 jm4Var2 = tvShowsFragment2.v;
                            if (jm4Var2 != null) {
                                jm4Var2.f();
                            }
                        }
                        return e6a.a;
                    case 2:
                        String str = (String) obj;
                        cr4.g(str, "rowConfigId");
                        this.b.q().d(str, (String) obj2, (String) obj3);
                        break;
                    default:
                        ContentItem contentItem2 = (ContentItem) obj;
                        String str2 = (String) obj2;
                        TMDBImages tMDBImages = (TMDBImages) obj3;
                        cr4.g(contentItem2, "item");
                        cr4.g(str2, "imageType");
                        cr4.g(tMDBImages, "images");
                        TvShowsFragment tvShowsFragment3 = this.b;
                        if (tvShowsFragment3.isAdded() && tvShowsFragment3.getChildFragmentManager().af("image_picker") == null) {
                            ci4.a.a(contentItem2.getTmdbId(), str2, tMDBImages).show(tvShowsFragment3.getChildFragmentManager(), "image_picker");
                        }
                        return e6a.a;
                }
                return e6a.a;
            }
        };
        ContentImageOverrideRepository contentImageOverrideRepository = this.t;
        if (contentImageOverrideRepository == null) {
            cr4.n("imageOverrideRepository");
            throw null;
        }
        final int i7 = 3;
        this.u = new h(contextRequireContext, nVarA, contextMenuActionHandler, traktStatusProvider, ir3Var, sq3Var, sq3Var2, sq3Var3, ir3Var2, contentImageOverrideRepository, p(), new ir3(this) { // from class: fy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.ir3
            public final Object invoke(Object obj, Object obj2, Object obj3) {
                switch (i7) {
                    case 0:
                        int iIntValue = ((Integer) obj).intValue();
                        ContentItem.ItemType itemType = (ContentItem.ItemType) obj2;
                        boolean zBooleanValue = ((Boolean) obj3).booleanValue();
                        cr4.g(itemType, SessionDescription.ATTR_TYPE);
                        TvShowsFragment tvShowsFragment = this.b;
                        i85 viewLifecycleOwner3 = tvShowsFragment.getViewLifecycleOwner();
                        cr4.f(viewLifecycleOwner3, "getViewLifecycleOwner(...)");
                        wj0.c(s.a(viewLifecycleOwner3), null, null, new ky9(tvShowsFragment, iIntValue, itemType, zBooleanValue, null), 3);
                        break;
                    case 1:
                        ContentItem contentItem = (ContentItem) obj;
                        View view4 = (View) obj2;
                        boolean zBooleanValue2 = ((Boolean) obj3).booleanValue();
                        cr4.g(contentItem, "item");
                        cr4.g(view4, "cardView");
                        TvShowsFragment tvShowsFragment2 = this.b;
                        if (zBooleanValue2) {
                            jm4 jm4Var = tvShowsFragment2.v;
                            if (jm4Var != null) {
                                jm4Var.g(contentItem, view4);
                            }
                        } else {
                            jm4 jm4Var2 = tvShowsFragment2.v;
                            if (jm4Var2 != null) {
                                jm4Var2.f();
                            }
                        }
                        return e6a.a;
                    case 2:
                        String str = (String) obj;
                        cr4.g(str, "rowConfigId");
                        this.b.q().d(str, (String) obj2, (String) obj3);
                        break;
                    default:
                        ContentItem contentItem2 = (ContentItem) obj;
                        String str2 = (String) obj2;
                        TMDBImages tMDBImages = (TMDBImages) obj3;
                        cr4.g(contentItem2, "item");
                        cr4.g(str2, "imageType");
                        cr4.g(tMDBImages, "images");
                        TvShowsFragment tvShowsFragment3 = this.b;
                        if (tvShowsFragment3.isAdded() && tvShowsFragment3.getChildFragmentManager().af("image_picker") == null) {
                            ci4.a.a(contentItem2.getTmdbId(), str2, tMDBImages).show(tvShowsFragment3.getChildFragmentManager(), "image_picker");
                        }
                        return e6a.a;
                }
                return e6a.a;
            }
        });
        i85 viewLifecycleOwner3 = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner3, "getViewLifecycleOwner(...)");
        MaterialButton materialButton = this.au;
        if (materialButton == null) {
            cr4.n("navSearch");
            throw null;
        }
        MaterialButton materialButton2 = this.av;
        if (materialButton2 == null) {
            cr4.n("navHome");
            throw null;
        }
        MaterialButton materialButton3 = this.aw;
        if (materialButton3 == null) {
            cr4.n("navMovies");
            throw null;
        }
        MaterialButton materialButton4 = this.ax;
        if (materialButton4 == null) {
            cr4.n("navTvShows");
            throw null;
        }
        MaterialButton materialButton5 = this.ay;
        MaterialButton materialButton6 = this.az;
        if (materialButton6 == null) {
            cr4.n("navSettings");
            throw null;
        }
        g88.b bVar = new g88.b(materialButton, materialButton2, materialButton3, materialButton4, materialButton5, materialButton6);
        g88.c cVar = g88.c.d;
        VerticalGridView verticalGridView = this.aa;
        if (verticalGridView == null) {
            cr4.n("contentRowsView");
            throw null;
        }
        ProgressBar progressBar = this.ab;
        if (progressBar == null) {
            cr4.n("loadingIndicator");
            throw null;
        }
        RecyclerView.v vVar = this.i;
        if (vVar == null) {
            cr4.n("sharedViewPool");
            throw null;
        }
        RowPrefetchManager rowPrefetchManager = this.j;
        if (rowPrefetchManager == null) {
            cr4.n("rowPrefetchManager");
            throw null;
        }
        b34 b34Var = this.aq;
        if (b34Var == null) {
            cr4.n("heroSyncManager");
            throw null;
        }
        final int i8 = 1;
        gr3 gr3Var = new gr3(this) { // from class: cy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.gr3
            public final Object invoke(Object obj, Object obj2) {
                Intent intentA;
                Integer numBe;
                int iIntValue;
                String str;
                String str2;
                int i9 = i8;
                e6a e6aVar = e6a.a;
                TvShowsFragment tvShowsFragment = this.b;
                switch (i9) {
                    case 0:
                        ContentItem contentItem = (ContentItem) obj;
                        af1 af1Var = (af1) obj2;
                        cr4.g(contentItem, "item");
                        cr4.g(af1Var, "row");
                        h hVar = tvShowsFragment.u;
                        if (hVar != null) {
                            hVar.b(contentItem, af1Var);
                            return e6aVar;
                        }
                        cr4.n("contextMenuHelper");
                        throw null;
                    default:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "item");
                        cr4.g((ImageView) obj2, "posterView");
                        contentItem2.getTitle();
                        if (!contentItem2.isPlaceholder()) {
                            if (contentItem2.getItemType() == ContentItem.ItemType.CALENDAR_DAY) {
                                String calendarEpisodes = contentItem2.getCalendarEpisodes();
                                if (calendarEpisodes != null) {
                                    List listAo = n89.ao(calendarEpisodes, new String[]{"\n"}, 6);
                                    ArrayList arrayList = new ArrayList();
                                    for (Object obj3 : listAo) {
                                        if (!n89.ab((String) obj3)) {
                                            arrayList.add(obj3);
                                        }
                                    }
                                    if (!arrayList.isEmpty()) {
                                        LinkedHashSet linkedHashSet = new LinkedHashSet();
                                        ArrayList arrayList2 = new ArrayList();
                                        Iterator it = arrayList.iterator();
                                        while (it.hasNext()) {
                                            List listAo2 = n89.ao((String) it.next(), new String[]{"|"}, 6);
                                            String str3 = (String) y41.af(4, listAo2);
                                            if (str3 != null && (numBe = n89.be(str3)) != null && (iIntValue = numBe.intValue()) > 0 && linkedHashSet.add(numBe)) {
                                                ContentItem.ItemType itemType = ContentItem.ItemType.TV_SHOW;
                                                String str4 = (String) y41.af(0, listAo2);
                                                if (str4 == null) {
                                                    str4 = "";
                                                }
                                                String str5 = str4;
                                                String str6 = (String) y41.af(6, listAo2);
                                                if (str6 != null) {
                                                    if (n89.ab(str6)) {
                                                        str6 = null;
                                                    }
                                                    str = str6;
                                                } else {
                                                    str = null;
                                                }
                                                String str7 = (String) y41.af(5, listAo2);
                                                if (str7 != null) {
                                                    if (n89.ab(str7)) {
                                                        str7 = null;
                                                    }
                                                    str2 = str7;
                                                } else {
                                                    str2 = null;
                                                }
                                                arrayList2.add(new ContentItem(iIntValue, itemType, iIntValue, null, str5, null, str, str2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, -1048064, 2047, null));
                                            }
                                        }
                                        if (!arrayList2.isEmpty()) {
                                            String showTitle = contentItem2.getShowTitle();
                                            if (showTitle == null && (showTitle = contentItem2.getCalendarDayLabel()) == null) {
                                                showTitle = "Calendar";
                                            }
                                            if (tvShowsFragment.o().getPreferGridView()) {
                                                int i10 = GridActivity.f;
                                                Context contextRequireContext2 = tvShowsFragment.requireContext();
                                                cr4.f(contextRequireContext2, "requireContext(...)");
                                                intentA = GridActivity.a.b(contextRequireContext2, showTitle, arrayList2, "PORTRAIT", (AnalyticsListener.EVENT_AUDIO_DECODER_INITIALIZED & 16) != 0 ? null : "debrid_contents", null, (AnalyticsListener.EVENT_AUDIO_DECODER_INITIALIZED & 64) != 0 ? null : null, null, null, null);
                                            } else {
                                                int i11 = RowItemsActivity.f;
                                                Context contextRequireContext3 = tvShowsFragment.requireContext();
                                                cr4.f(contextRequireContext3, "requireContext(...)");
                                                intentA = RowItemsActivity.a.a(contextRequireContext3, showTitle, arrayList2);
                                            }
                                            tvShowsFragment.startActivity(intentA);
                                        }
                                    }
                                }
                            } else {
                                pw7 pw7Var = by9.a;
                                if (!by9.a(tvShowsFragment, contentItem2, tvShowsFragment.o().getPreferGridView())) {
                                    Intent intent = new Intent(tvShowsFragment.requireContext(), (Class<?>) DetailsActivity.class);
                                    intent.putExtra("content_item", contentItem2);
                                    tvShowsFragment.startActivity(intent);
                                }
                            }
                        }
                        return e6aVar;
                }
            }
        };
        final int i9 = 0;
        gr3 gr3Var2 = new gr3(this) { // from class: cy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.gr3
            public final Object invoke(Object obj, Object obj2) {
                Intent intentA;
                Integer numBe;
                int iIntValue;
                String str;
                String str2;
                int i92 = i9;
                e6a e6aVar = e6a.a;
                TvShowsFragment tvShowsFragment = this.b;
                switch (i92) {
                    case 0:
                        ContentItem contentItem = (ContentItem) obj;
                        af1 af1Var = (af1) obj2;
                        cr4.g(contentItem, "item");
                        cr4.g(af1Var, "row");
                        h hVar = tvShowsFragment.u;
                        if (hVar != null) {
                            hVar.b(contentItem, af1Var);
                            return e6aVar;
                        }
                        cr4.n("contextMenuHelper");
                        throw null;
                    default:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "item");
                        cr4.g((ImageView) obj2, "posterView");
                        contentItem2.getTitle();
                        if (!contentItem2.isPlaceholder()) {
                            if (contentItem2.getItemType() == ContentItem.ItemType.CALENDAR_DAY) {
                                String calendarEpisodes = contentItem2.getCalendarEpisodes();
                                if (calendarEpisodes != null) {
                                    List listAo = n89.ao(calendarEpisodes, new String[]{"\n"}, 6);
                                    ArrayList arrayList = new ArrayList();
                                    for (Object obj3 : listAo) {
                                        if (!n89.ab((String) obj3)) {
                                            arrayList.add(obj3);
                                        }
                                    }
                                    if (!arrayList.isEmpty()) {
                                        LinkedHashSet linkedHashSet = new LinkedHashSet();
                                        ArrayList arrayList2 = new ArrayList();
                                        Iterator it = arrayList.iterator();
                                        while (it.hasNext()) {
                                            List listAo2 = n89.ao((String) it.next(), new String[]{"|"}, 6);
                                            String str3 = (String) y41.af(4, listAo2);
                                            if (str3 != null && (numBe = n89.be(str3)) != null && (iIntValue = numBe.intValue()) > 0 && linkedHashSet.add(numBe)) {
                                                ContentItem.ItemType itemType = ContentItem.ItemType.TV_SHOW;
                                                String str4 = (String) y41.af(0, listAo2);
                                                if (str4 == null) {
                                                    str4 = "";
                                                }
                                                String str5 = str4;
                                                String str6 = (String) y41.af(6, listAo2);
                                                if (str6 != null) {
                                                    if (n89.ab(str6)) {
                                                        str6 = null;
                                                    }
                                                    str = str6;
                                                } else {
                                                    str = null;
                                                }
                                                String str7 = (String) y41.af(5, listAo2);
                                                if (str7 != null) {
                                                    if (n89.ab(str7)) {
                                                        str7 = null;
                                                    }
                                                    str2 = str7;
                                                } else {
                                                    str2 = null;
                                                }
                                                arrayList2.add(new ContentItem(iIntValue, itemType, iIntValue, null, str5, null, str, str2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, -1048064, 2047, null));
                                            }
                                        }
                                        if (!arrayList2.isEmpty()) {
                                            String showTitle = contentItem2.getShowTitle();
                                            if (showTitle == null && (showTitle = contentItem2.getCalendarDayLabel()) == null) {
                                                showTitle = "Calendar";
                                            }
                                            if (tvShowsFragment.o().getPreferGridView()) {
                                                int i10 = GridActivity.f;
                                                Context contextRequireContext2 = tvShowsFragment.requireContext();
                                                cr4.f(contextRequireContext2, "requireContext(...)");
                                                intentA = GridActivity.a.b(contextRequireContext2, showTitle, arrayList2, "PORTRAIT", (AnalyticsListener.EVENT_AUDIO_DECODER_INITIALIZED & 16) != 0 ? null : "debrid_contents", null, (AnalyticsListener.EVENT_AUDIO_DECODER_INITIALIZED & 64) != 0 ? null : null, null, null, null);
                                            } else {
                                                int i11 = RowItemsActivity.f;
                                                Context contextRequireContext3 = tvShowsFragment.requireContext();
                                                cr4.f(contextRequireContext3, "requireContext(...)");
                                                intentA = RowItemsActivity.a.a(contextRequireContext3, showTitle, arrayList2);
                                            }
                                            tvShowsFragment.startActivity(intentA);
                                        }
                                    }
                                }
                            } else {
                                pw7 pw7Var = by9.a;
                                if (!by9.a(tvShowsFragment, contentItem2, tvShowsFragment.o().getPreferGridView())) {
                                    Intent intent = new Intent(tvShowsFragment.requireContext(), (Class<?>) DetailsActivity.class);
                                    intent.putExtra("content_item", contentItem2);
                                    tvShowsFragment.startActivity(intent);
                                }
                            }
                        }
                        return e6aVar;
                }
            }
        };
        final int i10 = 2;
        sq3 sq3Var4 = new sq3(this) { // from class: gy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.sq3
            public final Object invoke(Object obj) {
                MainActivity mainActivity;
                int i22 = i10;
                e6a e6aVar = e6a.a;
                TvShowsFragment tvShowsFragment = this.b;
                switch (i22) {
                    case 0:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        if (contentItem.getItemType() == ContentItem.ItemType.TV_SHOW) {
                            i85 viewLifecycleOwner22 = tvShowsFragment.getViewLifecycleOwner();
                            cr4.f(viewLifecycleOwner22, "getViewLifecycleOwner(...)");
                            wj0.c(s.a(viewLifecycleOwner22), null, null, new jy9(contentItem, tvShowsFragment, null), 3);
                        }
                        return e6aVar;
                    case 1:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "content");
                        contentItem2.getTitle();
                        e24 e24Var = tvShowsFragment.ao;
                        if (e24Var == null) {
                            cr4.n("heroBackgroundController");
                            throw null;
                        }
                        String backdropUrl = contentItem2.getBackdropUrl();
                        if (backdropUrl == null) {
                            backdropUrl = contentItem2.getPosterUrl();
                        }
                        e24Var.e(backdropUrl, tvShowsFragment.requireContext().getDrawable(R.drawable.default_background), null);
                        d34 d34Var = tvShowsFragment.w;
                        if (d34Var != null) {
                            d34Var.h(contentItem2);
                        }
                        i24 i24Var = tvShowsFragment.at;
                        if (i24Var != null) {
                            i24Var.a(new dz5(tvShowsFragment, contentItem2, 17));
                            return e6aVar;
                        }
                        cr4.n("heroContentAnimator");
                        throw null;
                    case 2:
                        tvShowsFragment.q().m(((Integer) obj).intValue());
                        return e6aVar;
                    case 3:
                        g88.c cVar2 = (g88.c) obj;
                        cr4.g(cVar2, "section");
                        int iOrdinal = cVar2.ordinal();
                        if (iOrdinal == 0) {
                            t activity = tvShowsFragment.getActivity();
                            mainActivity = activity instanceof MainActivity ? (MainActivity) activity : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.e);
                            }
                        } else if (iOrdinal == 1) {
                            t activity2 = tvShowsFragment.getActivity();
                            mainActivity = activity2 instanceof MainActivity ? (MainActivity) activity2 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.b);
                            }
                        } else if (iOrdinal == 2) {
                            t activity3 = tvShowsFragment.getActivity();
                            mainActivity = activity3 instanceof MainActivity ? (MainActivity) activity3 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.c);
                            }
                        } else if (iOrdinal != 3) {
                            if (iOrdinal == 4) {
                                t activity4 = tvShowsFragment.getActivity();
                                mainActivity = activity4 instanceof MainActivity ? (MainActivity) activity4 : null;
                                if (mainActivity != null) {
                                    mainActivity.e(MainActivity.b.f);
                                }
                            } else {
                                if (iOrdinal != 5) {
                                    throw new io6();
                                }
                                tvShowsFragment.startActivity(new Intent(tvShowsFragment.requireContext(), (Class<?>) SettingsActivity.class));
                            }
                        }
                        return e6aVar;
                    case 4:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        List list = af1Var.b;
                        list.size();
                        x78 x78Var = af1Var.c;
                        Objects.toString(x78Var);
                        int i32 = GridActivity.f;
                        Context contextRequireContext2 = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        String str = af1Var.a;
                        ArrayList arrayList = new ArrayList(list);
                        String strName = x78Var.name();
                        String str2 = af1Var.d;
                        tvShowsFragment.startActivity(GridActivity.a.b(contextRequireContext2, str, arrayList, strName, n89.ab(str2) ? null : str2, "tv", af1Var.f, af1Var.g, af1Var.h, af1Var.i));
                        return e6aVar;
                    default:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        Context contextRequireContext22 = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext22, "requireContext(...)");
                        C0690s87.a(contextRequireContext22, contentItem3, null);
                        return e6aVar;
                }
            }
        };
        final int i11 = 3;
        sq3 sq3Var5 = new sq3(this) { // from class: gy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.sq3
            public final Object invoke(Object obj) {
                MainActivity mainActivity;
                int i22 = i11;
                e6a e6aVar = e6a.a;
                TvShowsFragment tvShowsFragment = this.b;
                switch (i22) {
                    case 0:
                        ContentItem contentItem = (ContentItem) obj;
                        cr4.g(contentItem, "item");
                        if (contentItem.getItemType() == ContentItem.ItemType.TV_SHOW) {
                            i85 viewLifecycleOwner22 = tvShowsFragment.getViewLifecycleOwner();
                            cr4.f(viewLifecycleOwner22, "getViewLifecycleOwner(...)");
                            wj0.c(s.a(viewLifecycleOwner22), null, null, new jy9(contentItem, tvShowsFragment, null), 3);
                        }
                        return e6aVar;
                    case 1:
                        ContentItem contentItem2 = (ContentItem) obj;
                        cr4.g(contentItem2, "content");
                        contentItem2.getTitle();
                        e24 e24Var = tvShowsFragment.ao;
                        if (e24Var == null) {
                            cr4.n("heroBackgroundController");
                            throw null;
                        }
                        String backdropUrl = contentItem2.getBackdropUrl();
                        if (backdropUrl == null) {
                            backdropUrl = contentItem2.getPosterUrl();
                        }
                        e24Var.e(backdropUrl, tvShowsFragment.requireContext().getDrawable(R.drawable.default_background), null);
                        d34 d34Var = tvShowsFragment.w;
                        if (d34Var != null) {
                            d34Var.h(contentItem2);
                        }
                        i24 i24Var = tvShowsFragment.at;
                        if (i24Var != null) {
                            i24Var.a(new dz5(tvShowsFragment, contentItem2, 17));
                            return e6aVar;
                        }
                        cr4.n("heroContentAnimator");
                        throw null;
                    case 2:
                        tvShowsFragment.q().m(((Integer) obj).intValue());
                        return e6aVar;
                    case 3:
                        g88.c cVar2 = (g88.c) obj;
                        cr4.g(cVar2, "section");
                        int iOrdinal = cVar2.ordinal();
                        if (iOrdinal == 0) {
                            t activity = tvShowsFragment.getActivity();
                            mainActivity = activity instanceof MainActivity ? (MainActivity) activity : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.e);
                            }
                        } else if (iOrdinal == 1) {
                            t activity2 = tvShowsFragment.getActivity();
                            mainActivity = activity2 instanceof MainActivity ? (MainActivity) activity2 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.b);
                            }
                        } else if (iOrdinal == 2) {
                            t activity3 = tvShowsFragment.getActivity();
                            mainActivity = activity3 instanceof MainActivity ? (MainActivity) activity3 : null;
                            if (mainActivity != null) {
                                mainActivity.e(MainActivity.b.c);
                            }
                        } else if (iOrdinal != 3) {
                            if (iOrdinal == 4) {
                                t activity4 = tvShowsFragment.getActivity();
                                mainActivity = activity4 instanceof MainActivity ? (MainActivity) activity4 : null;
                                if (mainActivity != null) {
                                    mainActivity.e(MainActivity.b.f);
                                }
                            } else {
                                if (iOrdinal != 5) {
                                    throw new io6();
                                }
                                tvShowsFragment.startActivity(new Intent(tvShowsFragment.requireContext(), (Class<?>) SettingsActivity.class));
                            }
                        }
                        return e6aVar;
                    case 4:
                        af1 af1Var = (af1) obj;
                        cr4.g(af1Var, "row");
                        List list = af1Var.b;
                        list.size();
                        x78 x78Var = af1Var.c;
                        Objects.toString(x78Var);
                        int i32 = GridActivity.f;
                        Context contextRequireContext2 = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext2, "requireContext(...)");
                        String str = af1Var.a;
                        ArrayList arrayList = new ArrayList(list);
                        String strName = x78Var.name();
                        String str2 = af1Var.d;
                        tvShowsFragment.startActivity(GridActivity.a.b(contextRequireContext2, str, arrayList, strName, n89.ab(str2) ? null : str2, "tv", af1Var.f, af1Var.g, af1Var.h, af1Var.i));
                        return e6aVar;
                    default:
                        ContentItem contentItem3 = (ContentItem) obj;
                        cr4.g(contentItem3, "item");
                        Context contextRequireContext22 = tvShowsFragment.requireContext();
                        cr4.f(contextRequireContext22, "requireContext(...)");
                        C0690s87.a(contextRequireContext22, contentItem3, null);
                        return e6aVar;
                }
            }
        };
        i85 viewLifecycleOwner4 = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner4, "getViewLifecycleOwner(...)");
        n nVarA2 = s.a(viewLifecycleOwner4);
        DimensionScaler dimensionScaler = this.p;
        if (dimensionScaler == null) {
            cr4.n("dimensionScaler");
            throw null;
        }
        final int i12 = 1;
        this.ar = new g88(this, viewLifecycleOwner3, bVar, cVar, verticalGridView, progressBar, vVar, rowPrefetchManager, b34Var, gr3Var, gr3Var2, sq3Var4, sq3Var5, null, nVarA2, dimensionScaler, o().getTrailerOnFocusEnabled(), ((long) o().getTrailerOnFocusDelaySeconds()) * 1000, new ir3(this) { // from class: fy9
            public final /* synthetic */ TvShowsFragment b;

            {
                this.b = this;
            }

            @Override // defpackage.ir3
            public final Object invoke(Object obj, Object obj2, Object obj3) {
                switch (i12) {
                    case 0:
                        int iIntValue = ((Integer) obj).intValue();
                        ContentItem.ItemType itemType = (ContentItem.ItemType) obj2;
                        boolean zBooleanValue = ((Boolean) obj3).booleanValue();
                        cr4.g(itemType, SessionDescription.ATTR_TYPE);
                        TvShowsFragment tvShowsFragment = this.b;
                        i85 viewLifecycleOwner32 = tvShowsFragment.getViewLifecycleOwner();
                        cr4.f(viewLifecycleOwner32, "getViewLifecycleOwner(...)");
                        wj0.c(s.a(viewLifecycleOwner32), null, null, new ky9(tvShowsFragment, iIntValue, itemType, zBooleanValue, null), 3);
                        break;
                    case 1:
                        ContentItem contentItem = (ContentItem) obj;
                        View view4 = (View) obj2;
                        boolean zBooleanValue2 = ((Boolean) obj3).booleanValue();
                        cr4.g(contentItem, "item");
                        cr4.g(view4, "cardView");
                        TvShowsFragment tvShowsFragment2 = this.b;
                        if (zBooleanValue2) {
                            jm4 jm4Var = tvShowsFragment2.v;
                            if (jm4Var != null) {
                                jm4Var.g(contentItem, view4);
                            }
                        } else {
                            jm4 jm4Var2 = tvShowsFragment2.v;
                            if (jm4Var2 != null) {
                                jm4Var2.f();
                            }
                        }
                        return e6a.a;
                    case 2:
                        String str = (String) obj;
                        cr4.g(str, "rowConfigId");
                        this.b.q().d(str, (String) obj2, (String) obj3);
                        break;
                    default:
                        ContentItem contentItem2 = (ContentItem) obj;
                        String str2 = (String) obj2;
                        TMDBImages tMDBImages = (TMDBImages) obj3;
                        cr4.g(contentItem2, "item");
                        cr4.g(str2, "imageType");
                        cr4.g(tMDBImages, "images");
                        TvShowsFragment tvShowsFragment3 = this.b;
                        if (tvShowsFragment3.isAdded() && tvShowsFragment3.getChildFragmentManager().af("image_picker") == null) {
                            ci4.a.a(contentItem2.getTmdbId(), str2, tMDBImages).show(tvShowsFragment3.getChildFragmentManager(), "image_picker");
                        }
                        return e6a.a;
                }
                return e6a.a;
            }
        }, o().getAdaptiveFocusColor(), o().getNavigationSoundsEnabled());
        this.x = o().getTrailerOnFocusEnabled();
        this.y = o().getTrailerPreviewEnabled();
        this.z = o().getHeroTrailerEnabled();
        if (this.x) {
            n();
        }
        if (this.z) {
            m(view);
        }
        g88 g88Var = this.ar;
        if (g88Var == null) {
            cr4.n("rowsDelegate");
            throw null;
        }
        g88Var.a(q().m, q().o, q().q, q().s, q().u);
        i85 viewLifecycleOwner5 = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner5, "getViewLifecycleOwner(...)");
        wj0.c(s.a(viewLifecycleOwner5), null, null, new com.strmr.ps.ui.tvshows.b(this, null), 3);
        i85 viewLifecycleOwner6 = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner6, "getViewLifecycleOwner(...)");
        wj0.c(s.a(viewLifecycleOwner6), null, null, new com.strmr.ps.ui.tvshows.d(this, null), 3);
        View view4 = this.ba;
        if (view4 == null) {
            return;
        }
        if (!o().getAutoHideNavBar()) {
            view4.setTranslationX(getResources().getDisplayMetrics().density * (-28.0f));
            return;
        }
        view4.setTranslationX(getResources().getDisplayMetrics().density * (-25.0f));
        this.bb = false;
        i85 viewLifecycleOwner7 = getViewLifecycleOwner();
        cr4.f(viewLifecycleOwner7, "getViewLifecycleOwner(...)");
        wj0.c(s.a(viewLifecycleOwner7), null, null, new com.strmr.ps.ui.tvshows.c(this, view4, null), 3);
        MaterialButton materialButton7 = this.au;
        if (materialButton7 == null) {
            cr4.n("navSearch");
            throw null;
        }
        MaterialButton materialButton8 = this.av;
        if (materialButton8 == null) {
            cr4.n("navHome");
            throw null;
        }
        MaterialButton materialButton9 = this.aw;
        if (materialButton9 == null) {
            cr4.n("navMovies");
            throw null;
        }
        MaterialButton materialButton10 = this.ax;
        if (materialButton10 == null) {
            cr4.n("navTvShows");
            throw null;
        }
        MaterialButton materialButton11 = this.ay;
        MaterialButton materialButton12 = this.az;
        if (materialButton12 == null) {
            cr4.n("navSettings");
            throw null;
        }
        ArrayList<MaterialButton> arrayListW = st.w(new MaterialButton[]{materialButton7, materialButton8, materialButton9, materialButton10, materialButton11, materialButton12});
        for (MaterialButton materialButton13 : arrayListW) {
            materialButton13.setOnFocusChangeListener(new ao2(materialButton13.getOnFocusChangeListener(), this, arrayListW, 4));
        }
    }

    public final TMDBApiService p() {
        TMDBApiService tMDBApiService = this.k;
        if (tMDBApiService != null) {
            return tMDBApiService;
        }
        cr4.n("tmdbApiService");
        throw null;
    }

    public final TvShowsViewModel q() {
        return (TvShowsViewModel) this.f.getValue();
    }

    public final void r() {
        View view = this.ba;
        if (view == null || !o().getAutoHideNavBar() || this.bb) {
            return;
        }
        ValueAnimator valueAnimator = this.bc;
        if (valueAnimator != null) {
            valueAnimator.cancel();
        }
        float f2 = getResources().getDisplayMetrics().density * (-76.0f);
        float translationX = view.getTranslationX();
        if (translationX == f2) {
            this.bb = true;
            l(false);
            return;
        }
        ValueAnimator valueAnimatorOfFloat = ValueAnimator.ofFloat(translationX, f2);
        valueAnimatorOfFloat.setDuration(1000L);
        valueAnimatorOfFloat.setInterpolator(new AccelerateInterpolator());
        valueAnimatorOfFloat.addUpdateListener(new ey9(this, 0));
        valueAnimatorOfFloat.addListener(new hy9(this));
        valueAnimatorOfFloat.start();
        this.bc = valueAnimatorOfFloat;
        l(false);
    }
}
