package d.k.b;

import android.animation.Animator;
import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import com.ifpdos.udi.service.core.pc.R;
import d.k.b.a0;
import d.m.e;
import d.n.a.b;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;

/* JADX INFO: loaded from: classes.dex */
public class m implements ComponentCallbacks, View.OnCreateContextMenuListener, d.m.h, d.m.z, d.q.c {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final Object f3035f = new Object();
    public boolean A;
    public boolean B;
    public int C;
    public a0 D;
    public x<?> E;
    public m G;
    public int H;
    public int I;
    public String J;
    public boolean K;
    public boolean L;
    public boolean M;
    public boolean O;
    public ViewGroup P;
    public View Q;
    public boolean R;
    public b T;
    public boolean U;
    public float V;
    public LayoutInflater W;
    public boolean X;
    public d.m.i Z;

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    public u0 f3036a0;

    /* JADX INFO: renamed from: c0, reason: collision with root package name */
    public d.q.b f3038c0;

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    public final ArrayList<d> f3039d0;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public Bundle f3041n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public SparseArray<Parcelable> f3042o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public Bundle f3043p;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public Bundle f3045r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public m f3046s;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public int f3048u;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public boolean f3050w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public boolean f3051x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public boolean f3052y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public boolean f3053z;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public int f3040m = -1;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public String f3044q = UUID.randomUUID().toString();

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public String f3047t = null;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public Boolean f3049v = null;
    public a0 F = new b0();
    public boolean N = true;
    public boolean S = true;
    public e.b Y = e.b.RESUMED;

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    public d.m.m<d.m.h> f3037b0 = new d.m.m<>();

    public class a extends t {
        public a() {
        }

        @Override // d.k.b.t
        public View b(int i2) {
            View view = m.this.Q;
            if (view != null) {
                return view.findViewById(i2);
            }
            StringBuilder sbF = g.a.a.a.a.F("Fragment ");
            sbF.append(m.this);
            sbF.append(" does not have a view");
            throw new IllegalStateException(sbF.toString());
        }

        @Override // d.k.b.t
        public boolean c() {
            return m.this.Q != null;
        }
    }

    public static class b {
        public View a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public Animator f3054b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public boolean f3055c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        public int f3056d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        public int f3057e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public int f3058f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        public int f3059g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        public int f3060h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        public ArrayList<String> f3061i;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        public ArrayList<String> f3062j;

        /* JADX INFO: renamed from: k, reason: collision with root package name */
        public Object f3063k;

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        public Object f3064l;

        /* JADX INFO: renamed from: m, reason: collision with root package name */
        public Object f3065m;

        /* JADX INFO: renamed from: n, reason: collision with root package name */
        public float f3066n;

        /* JADX INFO: renamed from: o, reason: collision with root package name */
        public View f3067o;

        /* JADX INFO: renamed from: p, reason: collision with root package name */
        public e f3068p;

        /* JADX INFO: renamed from: q, reason: collision with root package name */
        public boolean f3069q;

        public b() {
            Object obj = m.f3035f;
            this.f3063k = obj;
            this.f3064l = obj;
            this.f3065m = obj;
            this.f3066n = 1.0f;
            this.f3067o = null;
        }
    }

    public static class c extends RuntimeException {
        public c(String str, Exception exc) {
            super(str, exc);
        }
    }

    public static abstract class d {
        public abstract void a();
    }

    public interface e {
    }

    public m() {
        new AtomicInteger();
        this.f3039d0 = new ArrayList<>();
        this.Z = new d.m.i(this);
        this.f3038c0 = new d.q.b(this);
    }

    public final boolean A() {
        m mVar = this.G;
        return mVar != null && (mVar.f3051x || mVar.A());
    }

    @Deprecated
    public void B() {
        this.O = true;
    }

    @Deprecated
    public void C(int i2, int i3, Intent intent) {
        if (a0.M(2)) {
            Log.v("FragmentManager", "Fragment " + this + " received the following in onActivityResult(): requestCode: " + i2 + " resultCode: " + i3 + " data: " + intent);
        }
    }

    @Deprecated
    public void D() {
        this.O = true;
    }

    public void E(Context context) {
        this.O = true;
        x<?> xVar = this.E;
        if ((xVar == null ? null : xVar.f3168f) != null) {
            this.O = false;
            D();
        }
    }

    @Deprecated
    public void F() {
    }

    public boolean G() {
        return false;
    }

    public void H(Bundle bundle) {
        Parcelable parcelable;
        this.O = true;
        if (bundle != null && (parcelable = bundle.getParcelable(n.FRAGMENTS_TAG)) != null) {
            this.F.Y(parcelable);
            this.F.m();
        }
        a0 a0Var = this.F;
        if (a0Var.f2905p >= 1) {
            return;
        }
        a0Var.m();
    }

    public Animation I() {
        return null;
    }

    public Animator J() {
        return null;
    }

    public View K(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        return null;
    }

    public void L() {
        this.O = true;
    }

    public void M() {
        this.O = true;
    }

    public LayoutInflater N(Bundle bundle) {
        return m();
    }

    public void O() {
    }

    @Deprecated
    public void P() {
        this.O = true;
    }

    public void Q(AttributeSet attributeSet, Bundle bundle) {
        this.O = true;
        x<?> xVar = this.E;
        if ((xVar == null ? null : xVar.f3168f) != null) {
            this.O = false;
            P();
        }
    }

    public void R() {
    }

    public void S() {
    }

    public void T() {
    }

    @Deprecated
    public void U() {
    }

    public void V(Bundle bundle) {
    }

    public void W() {
        this.O = true;
    }

    public void X() {
        this.O = true;
    }

    public void Y() {
    }

    public void Z(Bundle bundle) {
        this.O = true;
    }

    public t a() {
        return new a();
    }

    public boolean a0(MenuItem menuItem) {
        if (this.K) {
            return false;
        }
        if (G()) {
            return true;
        }
        return this.F.l(menuItem);
    }

    public void b(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
        String str2;
        printWriter.print(str);
        printWriter.print("mFragmentId=#");
        printWriter.print(Integer.toHexString(this.H));
        printWriter.print(" mContainerId=#");
        printWriter.print(Integer.toHexString(this.I));
        printWriter.print(" mTag=");
        printWriter.println(this.J);
        printWriter.print(str);
        printWriter.print("mState=");
        printWriter.print(this.f3040m);
        printWriter.print(" mWho=");
        printWriter.print(this.f3044q);
        printWriter.print(" mBackStackNesting=");
        printWriter.println(this.C);
        printWriter.print(str);
        printWriter.print("mAdded=");
        printWriter.print(this.f3050w);
        printWriter.print(" mRemoving=");
        printWriter.print(this.f3051x);
        printWriter.print(" mFromLayout=");
        printWriter.print(this.f3052y);
        printWriter.print(" mInLayout=");
        printWriter.println(this.f3053z);
        printWriter.print(str);
        printWriter.print("mHidden=");
        printWriter.print(this.K);
        printWriter.print(" mDetached=");
        printWriter.print(this.L);
        printWriter.print(" mMenuVisible=");
        printWriter.print(this.N);
        printWriter.print(" mHasMenu=");
        printWriter.println(false);
        printWriter.print(str);
        printWriter.print("mRetainInstance=");
        printWriter.print(this.M);
        printWriter.print(" mUserVisibleHint=");
        printWriter.println(this.S);
        if (this.D != null) {
            printWriter.print(str);
            printWriter.print("mFragmentManager=");
            printWriter.println(this.D);
        }
        if (this.E != null) {
            printWriter.print(str);
            printWriter.print("mHost=");
            printWriter.println(this.E);
        }
        if (this.G != null) {
            printWriter.print(str);
            printWriter.print("mParentFragment=");
            printWriter.println(this.G);
        }
        if (this.f3045r != null) {
            printWriter.print(str);
            printWriter.print("mArguments=");
            printWriter.println(this.f3045r);
        }
        if (this.f3041n != null) {
            printWriter.print(str);
            printWriter.print("mSavedFragmentState=");
            printWriter.println(this.f3041n);
        }
        if (this.f3042o != null) {
            printWriter.print(str);
            printWriter.print("mSavedViewState=");
            printWriter.println(this.f3042o);
        }
        if (this.f3043p != null) {
            printWriter.print(str);
            printWriter.print("mSavedViewRegistryState=");
            printWriter.println(this.f3043p);
        }
        m mVarD = this.f3046s;
        if (mVarD == null) {
            a0 a0Var = this.D;
            mVarD = (a0Var == null || (str2 = this.f3047t) == null) ? null : a0Var.f2892c.d(str2);
        }
        if (mVarD != null) {
            printWriter.print(str);
            printWriter.print("mTarget=");
            printWriter.print(mVarD);
            printWriter.print(" mTargetRequestCode=");
            printWriter.println(this.f3048u);
        }
        printWriter.print(str);
        printWriter.print("mPopDirection=");
        printWriter.println(p());
        if (g() != 0) {
            printWriter.print(str);
            printWriter.print("getEnterAnim=");
            printWriter.println(g());
        }
        if (j() != 0) {
            printWriter.print(str);
            printWriter.print("getExitAnim=");
            printWriter.println(j());
        }
        if (q() != 0) {
            printWriter.print(str);
            printWriter.print("getPopEnterAnim=");
            printWriter.println(q());
        }
        if (r() != 0) {
            printWriter.print(str);
            printWriter.print("getPopExitAnim=");
            printWriter.println(r());
        }
        if (this.P != null) {
            printWriter.print(str);
            printWriter.print("mContainer=");
            printWriter.println(this.P);
        }
        if (this.Q != null) {
            printWriter.print(str);
            printWriter.print("mView=");
            printWriter.println(this.Q);
        }
        if (d() != null) {
            printWriter.print(str);
            printWriter.print("mAnimatingAway=");
            printWriter.println(d());
        }
        if (f() != null) {
            d.n.a.a.b(this).a(str, fileDescriptor, printWriter, strArr);
        }
        printWriter.print(str);
        printWriter.println("Child " + this.F + ":");
        this.F.y(g.a.a.a.a.t(str, "  "), fileDescriptor, printWriter, strArr);
    }

    public void b0(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        this.F.T();
        this.B = true;
        this.f3036a0 = new u0(this, getViewModelStore());
        View viewK = K(layoutInflater, viewGroup, bundle);
        this.Q = viewK;
        if (viewK == null) {
            if (this.f3036a0.f3140m != null) {
                throw new IllegalStateException("Called getViewLifecycleOwner() but onCreateView() returned null");
            }
            this.f3036a0 = null;
        } else {
            this.f3036a0.b();
            this.Q.setTag(R.id.view_tree_lifecycle_owner, this.f3036a0);
            this.Q.setTag(R.id.view_tree_view_model_store_owner, this.f3036a0);
            this.Q.setTag(R.id.view_tree_saved_state_registry_owner, this.f3036a0);
            this.f3037b0.g(this.f3036a0);
        }
    }

    public final b c() {
        if (this.T == null) {
            this.T = new b();
        }
        return this.T;
    }

    public void c0() {
        this.F.w(1);
        if (this.Q != null) {
            u0 u0Var = this.f3036a0;
            u0Var.b();
            if (u0Var.f3140m.f3190b.compareTo(e.b.CREATED) >= 0) {
                this.f3036a0.a(e.a.ON_DESTROY);
            }
        }
        this.f3040m = 1;
        this.O = false;
        L();
        if (!this.O) {
            throw new y0(g.a.a.a.a.s("Fragment ", this, " did not call through to super.onDestroyView()"));
        }
        b.C0042b c0042b = ((d.n.a.b) d.n.a.a.b(this)).f3212b;
        int iJ = c0042b.f3214d.j();
        for (int i2 = 0; i2 < iJ; i2++) {
            Objects.requireNonNull(c0042b.f3214d.k(i2));
        }
        this.B = false;
    }

    public View d() {
        b bVar = this.T;
        if (bVar == null) {
            return null;
        }
        return bVar.a;
    }

    public void d0() {
        onLowMemory();
        this.F.p();
    }

    public final a0 e() {
        if (this.E != null) {
            return this.F;
        }
        throw new IllegalStateException(g.a.a.a.a.s("Fragment ", this, " has not been attached yet."));
    }

    public boolean e0(MenuItem menuItem) {
        if (this.K) {
            return false;
        }
        return this.F.r(menuItem);
    }

    public final boolean equals(Object obj) {
        return super.equals(obj);
    }

    public Context f() {
        x<?> xVar = this.E;
        if (xVar == null) {
            return null;
        }
        return xVar.f3169m;
    }

    public boolean f0(Menu menu) {
        if (this.K) {
            return false;
        }
        return false | this.F.v(menu);
    }

    public int g() {
        b bVar = this.T;
        if (bVar == null) {
            return 0;
        }
        return bVar.f3056d;
    }

    public final Context g0() {
        Context contextF = f();
        if (contextF != null) {
            return contextF;
        }
        throw new IllegalStateException(g.a.a.a.a.s("Fragment ", this, " not attached to a context."));
    }

    @Override // d.m.h
    public d.m.e getLifecycle() {
        return this.Z;
    }

    @Override // d.q.c
    public final d.q.a getSavedStateRegistry() {
        return this.f3038c0.f3360b;
    }

    @Override // d.m.z
    public d.m.y getViewModelStore() {
        if (this.D == null) {
            throw new IllegalStateException("Can't access ViewModels from detached fragment");
        }
        if (n() == 1) {
            throw new IllegalStateException("Calling getViewModelStore() before a Fragment reaches onCreate() when using setMaxLifecycle(INITIALIZED) is not supported");
        }
        d0 d0Var = this.D.J;
        d.m.y yVar = d0Var.f2965f.get(this.f3044q);
        if (yVar != null) {
            return yVar;
        }
        d.m.y yVar2 = new d.m.y();
        d0Var.f2965f.put(this.f3044q, yVar2);
        return yVar2;
    }

    public Object h() {
        b bVar = this.T;
        if (bVar == null) {
            return null;
        }
        Objects.requireNonNull(bVar);
        return null;
    }

    public final View h0() {
        View view = this.Q;
        if (view != null) {
            return view;
        }
        throw new IllegalStateException(g.a.a.a.a.s("Fragment ", this, " did not return a View from onCreateView() or this was called before onCreateView()."));
    }

    public final int hashCode() {
        return super.hashCode();
    }

    public void i() {
        b bVar = this.T;
        if (bVar == null) {
            return;
        }
        Objects.requireNonNull(bVar);
    }

    public void i0(View view) {
        c().a = view;
    }

    public int j() {
        b bVar = this.T;
        if (bVar == null) {
            return 0;
        }
        return bVar.f3057e;
    }

    public void j0(int i2, int i3, int i4, int i5) {
        if (this.T == null && i2 == 0 && i3 == 0 && i4 == 0 && i5 == 0) {
            return;
        }
        c().f3056d = i2;
        c().f3057e = i3;
        c().f3058f = i4;
        c().f3059g = i5;
    }

    public Object k() {
        b bVar = this.T;
        if (bVar == null) {
            return null;
        }
        Objects.requireNonNull(bVar);
        return null;
    }

    public void k0(Animator animator) {
        c().f3054b = animator;
    }

    public void l() {
        b bVar = this.T;
        if (bVar == null) {
            return;
        }
        Objects.requireNonNull(bVar);
    }

    public void l0(Bundle bundle) {
        a0 a0Var = this.D;
        if (a0Var != null) {
            if (a0Var == null ? false : a0Var.Q()) {
                throw new IllegalStateException("Fragment already added and state has been saved");
            }
        }
        this.f3045r = bundle;
    }

    @Deprecated
    public LayoutInflater m() {
        x<?> xVar = this.E;
        if (xVar == null) {
            throw new IllegalStateException("onGetLayoutInflater() cannot be executed until the Fragment is attached to the FragmentManager.");
        }
        LayoutInflater layoutInflaterE = xVar.e();
        layoutInflaterE.setFactory2(this.F.f2895f);
        return layoutInflaterE;
    }

    public void m0(View view) {
        c().f3067o = null;
    }

    public final int n() {
        e.b bVar = this.Y;
        return (bVar == e.b.INITIALIZED || this.G == null) ? bVar.ordinal() : Math.min(bVar.ordinal(), this.G.n());
    }

    public void n0(boolean z2) {
        c().f3069q = z2;
    }

    public final a0 o() {
        a0 a0Var = this.D;
        if (a0Var != null) {
            return a0Var;
        }
        throw new IllegalStateException(g.a.a.a.a.s("Fragment ", this, " not associated with a fragment manager."));
    }

    public void o0(e eVar) {
        c();
        e eVar2 = this.T.f3068p;
        if (eVar == eVar2) {
            return;
        }
        if (eVar != null && eVar2 != null) {
            throw new IllegalStateException("Trying to set a replacement startPostponedEnterTransition on " + this);
        }
        if (eVar != null) {
            ((a0.n) eVar).f2925c++;
        }
    }

    @Override // android.content.ComponentCallbacks
    public void onConfigurationChanged(Configuration configuration) {
        this.O = true;
    }

    @Override // android.view.View.OnCreateContextMenuListener
    public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
        x<?> xVar = this.E;
        n nVar = xVar == null ? null : (n) xVar.f3168f;
        if (nVar == null) {
            throw new IllegalStateException(g.a.a.a.a.s("Fragment ", this, " not attached to an activity."));
        }
        nVar.onCreateContextMenu(contextMenu, view, contextMenuInfo);
    }

    @Override // android.content.ComponentCallbacks
    public void onLowMemory() {
        this.O = true;
    }

    public boolean p() {
        b bVar = this.T;
        if (bVar == null) {
            return false;
        }
        return bVar.f3055c;
    }

    public void p0(boolean z2) {
        if (this.T == null) {
            return;
        }
        c().f3055c = z2;
    }

    public int q() {
        b bVar = this.T;
        if (bVar == null) {
            return 0;
        }
        return bVar.f3058f;
    }

    public void q0() {
        if (this.T != null) {
            Objects.requireNonNull(c());
        }
    }

    public int r() {
        b bVar = this.T;
        if (bVar == null) {
            return 0;
        }
        return bVar.f3059g;
    }

    public Object s() {
        b bVar = this.T;
        if (bVar == null) {
            return null;
        }
        Object obj = bVar.f3064l;
        if (obj != f3035f) {
            return obj;
        }
        k();
        return null;
    }

    public final Resources t() {
        return g0().getResources();
    }

    public String toString() {
        StringBuilder sb = new StringBuilder(128);
        sb.append(getClass().getSimpleName());
        sb.append("{");
        sb.append(Integer.toHexString(System.identityHashCode(this)));
        sb.append("}");
        sb.append(" (");
        sb.append(this.f3044q);
        if (this.H != 0) {
            sb.append(" id=0x");
            sb.append(Integer.toHexString(this.H));
        }
        if (this.J != null) {
            sb.append(" tag=");
            sb.append(this.J);
        }
        sb.append(")");
        return sb.toString();
    }

    public Object u() {
        b bVar = this.T;
        if (bVar == null) {
            return null;
        }
        Object obj = bVar.f3063k;
        if (obj != f3035f) {
            return obj;
        }
        h();
        return null;
    }

    public Object v() {
        b bVar = this.T;
        if (bVar == null) {
            return null;
        }
        Objects.requireNonNull(bVar);
        return null;
    }

    public Object w() {
        b bVar = this.T;
        if (bVar == null) {
            return null;
        }
        Object obj = bVar.f3065m;
        if (obj != f3035f) {
            return obj;
        }
        v();
        return null;
    }

    public final String x(int i2) {
        return t().getString(i2);
    }

    public final boolean y() {
        return this.C > 0;
    }

    public boolean z() {
        b bVar = this.T;
        return false;
    }
}
