package B;

import F1.AbstractC0175d;
import F1.AbstractC0195y;
import F1.AbstractC0196z;
import F1.C0176e;
import android.graphics.Path;
import android.os.Build;
import android.view.View;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.SnapshotStateKt__SnapshotStateKt;
import androidx.compose.runtime.snapshots.Snapshot;
import com.debridstream.tv.R;
import java.lang.reflect.Field;
import java.util.WeakHashMap;
import p0.C2702h;

/* JADX INFO: loaded from: classes.dex */
public final class g1 {

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public static final WeakHashMap f282w = new WeakHashMap();

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final C0051b f283a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final C0051b f284b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final C0051b f285c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final C0051b f286d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final C0051b f287e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final C0051b f288f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final C0051b f289g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final C0051b f290h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final C0051b f291i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final b1 f292j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final MutableState f293k;
    public final Y0 l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final b1 f294m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final b1 f295n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final b1 f296o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final b1 f297p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final b1 f298q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final b1 f299r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final b1 f300s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final boolean f301t;

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

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final RunnableC0068j0 f303v;

    public g1(View view) {
        C0051b c0051bB = C0055d.b(4, "captionBar");
        this.f283a = c0051bB;
        C0051b c0051bB2 = C0055d.b(128, "displayCutout");
        this.f284b = c0051bB2;
        C0051b c0051bB3 = C0055d.b(8, "ime");
        this.f285c = c0051bB3;
        C0051b c0051bB4 = C0055d.b(32, "mandatorySystemGestures");
        this.f286d = c0051bB4;
        C0051b c0051bB5 = C0055d.b(2, "navigationBars");
        this.f287e = c0051bB5;
        C0051b c0051bB6 = C0055d.b(1, "statusBars");
        this.f288f = c0051bB6;
        C0051b c0051bB7 = C0055d.b(519, "systemBars");
        this.f289g = c0051bB7;
        C0051b c0051bB8 = C0055d.b(16, "systemGestures");
        this.f290h = c0051bB8;
        C0051b c0051bB9 = C0055d.b(64, "tappableElement");
        this.f291i = c0051bB9;
        b1 b1Var = new b1(new C0078o0(0, 0, 0, 0), "waterfall");
        this.f292j = b1Var;
        this.f293k = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(null, null, 2, null);
        this.l = new Y0(new Y0(c0051bB7, c0051bB3), c0051bB2);
        new Y0(new Y0(new Y0(c0051bB9, c0051bB4), c0051bB8), b1Var);
        this.f294m = C0055d.d(4, "captionBarIgnoringVisibility");
        this.f295n = C0055d.d(2, "navigationBarsIgnoringVisibility");
        this.f296o = C0055d.d(1, "statusBarsIgnoringVisibility");
        this.f297p = C0055d.d(519, "systemBarsIgnoringVisibility");
        this.f298q = C0055d.d(64, "tappableElementIgnoringVisibility");
        this.f299r = new b1(new C0078o0(0, 0, 0, 0), "imeAnimationTarget");
        this.f300s = new b1(new C0078o0(0, 0, 0, 0), "imeAnimationSource");
        Object parent = view.getParent();
        View view2 = parent instanceof View ? (View) parent : null;
        Object tag = view2 != null ? view2.getTag(R.id.consume_window_insets_tag) : null;
        Boolean bool = tag instanceof Boolean ? (Boolean) tag : null;
        this.f301t = bool != null ? bool.booleanValue() : false;
        this.f303v = new RunnableC0068j0(this);
        Field field = F1.F.f1367a;
        F1.m0 m0VarA = AbstractC0196z.a(view);
        if (m0VarA != null) {
            F1.h0 h0Var = m0VarA.f1458a;
            c0051bB.f(h0Var.q(4));
            c0051bB2.f(h0Var.q(128));
            c0051bB3.f(h0Var.q(8));
            c0051bB4.f(h0Var.q(32));
            c0051bB5.f(h0Var.q(2));
            c0051bB6.f(h0Var.q(1));
            c0051bB7.f(h0Var.q(519));
            c0051bB8.f(h0Var.q(16));
            c0051bB9.f(h0Var.q(64));
        }
    }

    public static void b(g1 g1Var, F1.m0 m0Var) {
        g1Var.f283a.g(m0Var, 0);
        g1Var.f285c.g(m0Var, 0);
        g1Var.f284b.g(m0Var, 0);
        g1Var.f287e.g(m0Var, 0);
        g1Var.f288f.g(m0Var, 0);
        g1Var.f289g.g(m0Var, 0);
        g1Var.f290h.g(m0Var, 0);
        g1Var.f291i.g(m0Var, 0);
        g1Var.f286d.g(m0Var, 0);
        g1Var.f294m.f(AbstractC0057e.J(m0Var.f1458a.h(4)));
        F1.h0 h0Var = m0Var.f1458a;
        g1Var.f295n.f(AbstractC0057e.J(h0Var.h(2)));
        g1Var.f296o.f(AbstractC0057e.J(h0Var.h(1)));
        g1Var.f297p.f(AbstractC0057e.J(h0Var.h(519)));
        g1Var.f298q.f(AbstractC0057e.J(h0Var.h(64)));
        C0176e c0176eF = h0Var.f();
        g1Var.f292j.f(AbstractC0057e.J(c0176eF != null ? c0176eF.a() : z1.b.f26268e));
        C2702h c2702h = null;
        if (c0176eF != null) {
            Path pathA = Build.VERSION.SDK_INT >= 31 ? AbstractC0175d.a(c0176eF.f1433a) : null;
            if (pathA != null) {
                c2702h = new C2702h(pathA);
            }
        }
        g1Var.f293k.setValue(c2702h);
        Snapshot.Companion.sendApplyNotifications();
    }

    public final void a(View view) {
        if (this.f302u == 0) {
            Field field = F1.F.f1367a;
            RunnableC0068j0 runnableC0068j0 = this.f303v;
            AbstractC0195y.c(view, runnableC0068j0);
            if (view.isAttachedToWindow()) {
                view.requestApplyInsets();
            }
            view.addOnAttachStateChangeListener(runnableC0068j0);
            F1.F.e(view, runnableC0068j0);
        }
        this.f302u++;
    }
}
