package androidx.compose.ui.platform;

import android.R;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.os.SystemClock;
import android.os.Trace;
import android.text.SpannableString;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import androidx.compose.ui.platform.r;
import androidx.lifecycle.n;
import com.google.android.gms.common.api.Api;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.firebase.crashlytics.internal.metadata.UserMetadata;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import o2.f;
import t3.h;

/* loaded from: classes.dex */
public final class x extends androidx.core.view.a {
    public static final d O = new d(null);
    public static final int P = 8;
    private static final androidx.collection.j Q = androidx.collection.k.a(l1.m.f27378a, l1.m.f27379b, l1.m.f27390m, l1.m.f27401x, l1.m.A, l1.m.B, l1.m.C, l1.m.D, l1.m.E, l1.m.F, l1.m.f27380c, l1.m.f27381d, l1.m.f27382e, l1.m.f27383f, l1.m.f27384g, l1.m.f27385h, l1.m.f27386i, l1.m.f27387j, l1.m.f27388k, l1.m.f27389l, l1.m.f27391n, l1.m.f27392o, l1.m.f27393p, l1.m.f27394q, l1.m.f27395r, l1.m.f27396s, l1.m.f27397t, l1.m.f27398u, l1.m.f27399v, l1.m.f27400w, l1.m.f27402y, l1.m.f27403z);
    private g A;
    private androidx.collection.l B;
    private androidx.collection.z C;
    private androidx.collection.w D;
    private androidx.collection.w E;
    private final String F;
    private final String G;
    private final y2.v H;
    private androidx.collection.y I;
    private l2 J;
    private boolean K;
    private final Runnable L;
    private final List M;
    private final dn.l N;

    /* renamed from: d, reason: collision with root package name */
    private final androidx.compose.ui.platform.r f2725d;

    /* renamed from: e, reason: collision with root package name */
    private int f2726e = Integer.MIN_VALUE;

    /* renamed from: f, reason: collision with root package name */
    private dn.l f2727f = new m();

    /* renamed from: g, reason: collision with root package name */
    private final AccessibilityManager f2728g;

    /* renamed from: h, reason: collision with root package name */
    private boolean f2729h;

    /* renamed from: i, reason: collision with root package name */
    private long f2730i;

    /* renamed from: j, reason: collision with root package name */
    private final AccessibilityManager.AccessibilityStateChangeListener f2731j;

    /* renamed from: k, reason: collision with root package name */
    private final AccessibilityManager.TouchExplorationStateChangeListener f2732k;

    /* renamed from: l, reason: collision with root package name */
    private List f2733l;

    /* renamed from: m, reason: collision with root package name */
    private final Handler f2734m;

    /* renamed from: n, reason: collision with root package name */
    private e f2735n;

    /* renamed from: o, reason: collision with root package name */
    private int f2736o;

    /* renamed from: p, reason: collision with root package name */
    private t3.h f2737p;

    /* renamed from: q, reason: collision with root package name */
    private boolean f2738q;

    /* renamed from: r, reason: collision with root package name */
    private final androidx.collection.y f2739r;

    /* renamed from: s, reason: collision with root package name */
    private final androidx.collection.y f2740s;

    /* renamed from: t, reason: collision with root package name */
    private androidx.collection.u0 f2741t;

    /* renamed from: u, reason: collision with root package name */
    private androidx.collection.u0 f2742u;

    /* renamed from: v, reason: collision with root package name */
    private int f2743v;

    /* renamed from: w, reason: collision with root package name */
    private Integer f2744w;

    /* renamed from: x, reason: collision with root package name */
    private final androidx.collection.b f2745x;

    /* renamed from: y, reason: collision with root package name */
    private final vp.d f2746y;

    /* renamed from: z, reason: collision with root package name */
    private boolean f2747z;

    /* loaded from: classes.dex */
    public static final class a implements View.OnAttachStateChangeListener {
        a() {
        }

        @Override // android.view.View.OnAttachStateChangeListener
        public void onViewAttachedToWindow(View view) {
            AccessibilityManager accessibilityManager = x.this.f2728g;
            x xVar = x.this;
            accessibilityManager.addAccessibilityStateChangeListener(xVar.f2731j);
            accessibilityManager.addTouchExplorationStateChangeListener(xVar.f2732k);
        }

        @Override // android.view.View.OnAttachStateChangeListener
        public void onViewDetachedFromWindow(View view) {
            x.this.f2734m.removeCallbacks(x.this.L);
            AccessibilityManager accessibilityManager = x.this.f2728g;
            x xVar = x.this;
            accessibilityManager.removeAccessibilityStateChangeListener(xVar.f2731j);
            accessibilityManager.removeTouchExplorationStateChangeListener(xVar.f2732k);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static final class b {

        /* renamed from: a, reason: collision with root package name */
        public static final b f2749a = new b();

        private b() {
        }

        public static final void a(t3.h hVar, o2.m mVar) {
            boolean h10;
            o2.a aVar;
            h10 = a0.h(mVar);
            if (!h10 || (aVar = (o2.a) o2.j.a(mVar.w(), o2.h.f30560a.w())) == null) {
                return;
            }
            hVar.b(new h.a(R.id.accessibilityActionSetProgress, aVar.b()));
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static final class c {

        /* renamed from: a, reason: collision with root package name */
        public static final c f2750a = new c();

        private c() {
        }

        public static final void a(t3.h hVar, o2.m mVar) {
            boolean h10;
            h10 = a0.h(mVar);
            if (h10) {
                o2.i w10 = mVar.w();
                o2.h hVar2 = o2.h.f30560a;
                o2.a aVar = (o2.a) o2.j.a(w10, hVar2.q());
                if (aVar != null) {
                    hVar.b(new h.a(R.id.accessibilityActionPageUp, aVar.b()));
                }
                o2.a aVar2 = (o2.a) o2.j.a(mVar.w(), hVar2.n());
                if (aVar2 != null) {
                    hVar.b(new h.a(R.id.accessibilityActionPageDown, aVar2.b()));
                }
                o2.a aVar3 = (o2.a) o2.j.a(mVar.w(), hVar2.o());
                if (aVar3 != null) {
                    hVar.b(new h.a(R.id.accessibilityActionPageLeft, aVar3.b()));
                }
                o2.a aVar4 = (o2.a) o2.j.a(mVar.w(), hVar2.p());
                if (aVar4 != null) {
                    hVar.b(new h.a(R.id.accessibilityActionPageRight, aVar4.b()));
                }
            }
        }
    }

    /* loaded from: classes.dex */
    public static final class d {
        private d() {
        }

        public /* synthetic */ d(kotlin.jvm.internal.k kVar) {
            this();
        }
    }

    /* loaded from: classes.dex */
    private final class e extends t3.i {
        public e() {
        }

        @Override // t3.i
        public void a(int i10, t3.h hVar, String str, Bundle bundle) {
            x.this.K(i10, hVar, str, bundle);
        }

        @Override // t3.i
        public t3.h b(int i10) {
            t3.h S = x.this.S(i10);
            x xVar = x.this;
            if (xVar.f2738q && i10 == xVar.f2736o) {
                xVar.f2737p = S;
            }
            return S;
        }

        @Override // t3.i
        public t3.h d(int i10) {
            return b(x.this.f2736o);
        }

        @Override // t3.i
        public boolean f(int i10, int i11, Bundle bundle) {
            return x.this.v0(i10, i11, bundle);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static final class f implements Comparator {

        /* renamed from: p, reason: collision with root package name */
        public static final f f2752p = new f();

        private f() {
        }

        @Override // java.util.Comparator
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public int compare(o2.m mVar, o2.m mVar2) {
            r1.i j10 = mVar.j();
            r1.i j11 = mVar2.j();
            int compare = Float.compare(j10.i(), j11.i());
            if (compare != 0) {
                return compare;
            }
            int compare2 = Float.compare(j10.l(), j11.l());
            if (compare2 != 0) {
                return compare2;
            }
            int compare3 = Float.compare(j10.e(), j11.e());
            return compare3 != 0 ? compare3 : Float.compare(j10.j(), j11.j());
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static final class g {

        /* renamed from: a, reason: collision with root package name */
        private final o2.m f2753a;

        /* renamed from: b, reason: collision with root package name */
        private final int f2754b;

        /* renamed from: c, reason: collision with root package name */
        private final int f2755c;

        /* renamed from: d, reason: collision with root package name */
        private final int f2756d;

        /* renamed from: e, reason: collision with root package name */
        private final int f2757e;

        /* renamed from: f, reason: collision with root package name */
        private final long f2758f;

        public g(o2.m mVar, int i10, int i11, int i12, int i13, long j10) {
            this.f2753a = mVar;
            this.f2754b = i10;
            this.f2755c = i11;
            this.f2756d = i12;
            this.f2757e = i13;
            this.f2758f = j10;
        }

        public final int a() {
            return this.f2754b;
        }

        public final int b() {
            return this.f2756d;
        }

        public final int c() {
            return this.f2755c;
        }

        public final o2.m d() {
            return this.f2753a;
        }

        public final int e() {
            return this.f2757e;
        }

        public final long f() {
            return this.f2758f;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static final class h implements Comparator {

        /* renamed from: p, reason: collision with root package name */
        public static final h f2759p = new h();

        private h() {
        }

        @Override // java.util.Comparator
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public int compare(o2.m mVar, o2.m mVar2) {
            r1.i j10 = mVar.j();
            r1.i j11 = mVar2.j();
            int compare = Float.compare(j11.j(), j10.j());
            if (compare != 0) {
                return compare;
            }
            int compare2 = Float.compare(j10.l(), j11.l());
            if (compare2 != 0) {
                return compare2;
            }
            int compare3 = Float.compare(j10.e(), j11.e());
            return compare3 != 0 ? compare3 : Float.compare(j11.i(), j10.i());
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static final class i implements Comparator {

        /* renamed from: p, reason: collision with root package name */
        public static final i f2760p = new i();

        private i() {
        }

        @Override // java.util.Comparator
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public int compare(rm.v vVar, rm.v vVar2) {
            int compare = Float.compare(((r1.i) vVar.c()).l(), ((r1.i) vVar2.c()).l());
            return compare != 0 ? compare : Float.compare(((r1.i) vVar.c()).e(), ((r1.i) vVar2.c()).e());
        }
    }

    /* loaded from: classes.dex */
    public /* synthetic */ class j {

        /* renamed from: a, reason: collision with root package name */
        public static final /* synthetic */ int[] f2761a;

        static {
            int[] iArr = new int[p2.a.values().length];
            try {
                iArr[p2.a.On.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[p2.a.Off.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                iArr[p2.a.Indeterminate.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            f2761a = iArr;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class k extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f2762p;

        /* renamed from: q, reason: collision with root package name */
        Object f2763q;

        /* renamed from: r, reason: collision with root package name */
        Object f2764r;

        /* renamed from: s, reason: collision with root package name */
        /* synthetic */ Object f2765s;

        /* renamed from: u, reason: collision with root package name */
        int f2767u;

        k(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f2765s = obj;
            this.f2767u |= Integer.MIN_VALUE;
            return x.this.M(this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class l extends kotlin.jvm.internal.v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        public static final l f2768p = new l();

        l() {
            super(0);
        }

        @Override // dn.a
        public final Boolean invoke() {
            return Boolean.FALSE;
        }
    }

    /* loaded from: classes.dex */
    static final class m extends kotlin.jvm.internal.v implements dn.l {
        m() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Boolean invoke(AccessibilityEvent accessibilityEvent) {
            return Boolean.valueOf(x.this.l0().getParent().requestSendAccessibilityEvent(x.this.l0(), accessibilityEvent));
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class n extends kotlin.jvm.internal.v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ k2 f2770p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ x f2771q;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        n(k2 k2Var, x xVar) {
            super(0);
            this.f2770p = k2Var;
            this.f2771q = xVar;
        }

        @Override // dn.a
        public /* bridge */ /* synthetic */ Object invoke() {
            m23invoke();
            return rm.n0.f34904a;
        }

        /* JADX WARN: Code restructure failed: missing block: B:15:0x005c, code lost:
        
            if ((r2 == com.google.android.gms.maps.model.BitmapDescriptorFactory.HUE_RED) == false) goto L21;
         */
        /* renamed from: invoke, reason: collision with other method in class */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final void m23invoke() {
            o2.m b10;
            j2.g0 q10;
            o2.g a10 = this.f2770p.a();
            o2.g e10 = this.f2770p.e();
            Float b11 = this.f2770p.b();
            Float c10 = this.f2770p.c();
            float floatValue = (a10 == null || b11 == null) ? 0.0f : ((Number) a10.c().invoke()).floatValue() - b11.floatValue();
            float floatValue2 = (e10 == null || c10 == null) ? 0.0f : ((Number) e10.c().invoke()).floatValue() - c10.floatValue();
            if (floatValue == BitmapDescriptorFactory.HUE_RED) {
            }
            int F0 = this.f2771q.F0(this.f2770p.d());
            m2 m2Var = (m2) this.f2771q.a0().c(this.f2771q.f2736o);
            if (m2Var != null) {
                x xVar = this.f2771q;
                try {
                    t3.h hVar = xVar.f2737p;
                    if (hVar != null) {
                        hVar.d0(xVar.L(m2Var));
                        rm.n0 n0Var = rm.n0.f34904a;
                    }
                } catch (IllegalStateException unused) {
                    rm.n0 n0Var2 = rm.n0.f34904a;
                }
            }
            this.f2771q.l0().invalidate();
            m2 m2Var2 = (m2) this.f2771q.a0().c(F0);
            if (m2Var2 != null && (b10 = m2Var2.b()) != null && (q10 = b10.q()) != null) {
                x xVar2 = this.f2771q;
                if (a10 != null) {
                    xVar2.f2739r.t(F0, a10);
                }
                if (e10 != null) {
                    xVar2.f2740s.t(F0, e10);
                }
                xVar2.s0(q10);
            }
            if (a10 != null) {
                this.f2770p.g((Float) a10.c().invoke());
            }
            if (e10 != null) {
                this.f2770p.h((Float) e10.c().invoke());
            }
        }
    }

    /* loaded from: classes.dex */
    static final class o extends kotlin.jvm.internal.v implements dn.l {
        o() {
            super(1);
        }

        public final void a(k2 k2Var) {
            x.this.D0(k2Var);
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((k2) obj);
            return rm.n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class p extends kotlin.jvm.internal.v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        public static final p f2773p = new p();

        p() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Boolean invoke(j2.g0 g0Var) {
            o2.i I = g0Var.I();
            boolean z10 = false;
            if (I != null && I.D()) {
                z10 = true;
            }
            return Boolean.valueOf(z10);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class q extends kotlin.jvm.internal.v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        public static final q f2774p = new q();

        q() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Boolean invoke(j2.g0 g0Var) {
            return Boolean.valueOf(g0Var.k0().q(j2.b1.a(8)));
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class r extends kotlin.jvm.internal.v implements dn.p {

        /* renamed from: p, reason: collision with root package name */
        public static final r f2775p = new r();

        /* JADX INFO: Access modifiers changed from: package-private */
        /* loaded from: classes.dex */
        public static final class a extends kotlin.jvm.internal.v implements dn.a {

            /* renamed from: p, reason: collision with root package name */
            public static final a f2776p = new a();

            a() {
                super(0);
            }

            @Override // dn.a
            /* renamed from: a, reason: merged with bridge method [inline-methods] */
            public final Float invoke() {
                return Float.valueOf(BitmapDescriptorFactory.HUE_RED);
            }
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        /* loaded from: classes.dex */
        public static final class b extends kotlin.jvm.internal.v implements dn.a {

            /* renamed from: p, reason: collision with root package name */
            public static final b f2777p = new b();

            b() {
                super(0);
            }

            @Override // dn.a
            /* renamed from: a, reason: merged with bridge method [inline-methods] */
            public final Float invoke() {
                return Float.valueOf(BitmapDescriptorFactory.HUE_RED);
            }
        }

        r() {
            super(2);
        }

        @Override // dn.p
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Integer invoke(o2.m mVar, o2.m mVar2) {
            o2.i w10 = mVar.w();
            o2.p pVar = o2.p.f30605a;
            return Integer.valueOf(Float.compare(((Number) w10.z(pVar.H(), a.f2776p)).floatValue(), ((Number) mVar2.w().z(pVar.H(), b.f2777p)).floatValue()));
        }
    }

    public x(androidx.compose.ui.platform.r rVar) {
        this.f2725d = rVar;
        Object systemService = rVar.getContext().getSystemService("accessibility");
        kotlin.jvm.internal.t.e(systemService, "null cannot be cast to non-null type android.view.accessibility.AccessibilityManager");
        AccessibilityManager accessibilityManager = (AccessibilityManager) systemService;
        this.f2728g = accessibilityManager;
        this.f2730i = 100L;
        this.f2731j = new AccessibilityManager.AccessibilityStateChangeListener() { // from class: androidx.compose.ui.platform.u
            @Override // android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener
            public final void onAccessibilityStateChanged(boolean z10) {
                x.W(x.this, z10);
            }
        };
        this.f2732k = new AccessibilityManager.TouchExplorationStateChangeListener() { // from class: androidx.compose.ui.platform.v
            @Override // android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener
            public final void onTouchExplorationStateChanged(boolean z10) {
                x.c1(x.this, z10);
            }
        };
        this.f2733l = accessibilityManager.getEnabledAccessibilityServiceList(-1);
        this.f2734m = new Handler(Looper.getMainLooper());
        this.f2735n = new e();
        this.f2736o = Integer.MIN_VALUE;
        this.f2739r = new androidx.collection.y(0, 1, null);
        this.f2740s = new androidx.collection.y(0, 1, null);
        this.f2741t = new androidx.collection.u0(0, 1, null);
        this.f2742u = new androidx.collection.u0(0, 1, null);
        this.f2743v = -1;
        this.f2745x = new androidx.collection.b(0, 1, null);
        this.f2746y = vp.g.b(1, null, null, 6, null);
        this.f2747z = true;
        this.B = androidx.collection.m.a();
        this.C = new androidx.collection.z(0, 1, null);
        this.D = new androidx.collection.w(0, 1, null);
        this.E = new androidx.collection.w(0, 1, null);
        this.F = "android.view.accessibility.extra.EXTRA_DATA_TEST_TRAVERSALBEFORE_VAL";
        this.G = "android.view.accessibility.extra.EXTRA_DATA_TEST_TRAVERSALAFTER_VAL";
        this.H = new y2.v();
        this.I = androidx.collection.m.b();
        this.J = new l2(rVar.getSemanticsOwner().a(), androidx.collection.m.a());
        rVar.addOnAttachStateChangeListener(new a());
        this.L = new Runnable() { // from class: androidx.compose.ui.platform.w
            @Override // java.lang.Runnable
            public final void run() {
                x.E0(x.this);
            }
        };
        this.M = new ArrayList();
        this.N = new o();
    }

    private static final boolean A0(o2.g gVar) {
        return (((Number) gVar.c().invoke()).floatValue() < ((Number) gVar.a().invoke()).floatValue() && !gVar.b()) || (((Number) gVar.c().invoke()).floatValue() > BitmapDescriptorFactory.HUE_RED && gVar.b());
    }

    private final boolean B0(int i10, List list) {
        boolean z10;
        k2 a10 = n2.a(list, i10);
        if (a10 != null) {
            z10 = false;
        } else {
            a10 = new k2(i10, this.M, null, null, null, null);
            z10 = true;
        }
        this.M.add(a10);
        return z10;
    }

    private final boolean C0(int i10) {
        if (!r0() || n0(i10)) {
            return false;
        }
        int i11 = this.f2736o;
        if (i11 != Integer.MIN_VALUE) {
            J0(this, i11, 65536, null, null, 12, null);
        }
        this.f2736o = i10;
        this.f2725d.invalidate();
        J0(this, i10, 32768, null, null, 12, null);
        return true;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void D0(k2 k2Var) {
        if (k2Var.W()) {
            this.f2725d.getSnapshotObserver().i(k2Var, this.N, new n(k2Var, this));
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void E0(x xVar) {
        Trace.beginSection("measureAndLayout");
        try {
            j2.j1.A(xVar.f2725d, false, 1, null);
            rm.n0 n0Var = rm.n0.f34904a;
            Trace.endSection();
            Trace.beginSection("checkForSemanticsChanges");
            try {
                xVar.P();
                Trace.endSection();
                xVar.K = false;
            } finally {
            }
        } finally {
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final int F0(int i10) {
        if (i10 == this.f2725d.getSemanticsOwner().a().o()) {
            return -1;
        }
        return i10;
    }

    private final void G0(o2.m mVar, l2 l2Var) {
        androidx.collection.z b10 = androidx.collection.o.b();
        List t10 = mVar.t();
        int size = t10.size();
        for (int i10 = 0; i10 < size; i10++) {
            o2.m mVar2 = (o2.m) t10.get(i10);
            if (a0().a(mVar2.o())) {
                if (!l2Var.a().a(mVar2.o())) {
                    s0(mVar.q());
                    return;
                }
                b10.f(mVar2.o());
            }
        }
        androidx.collection.z a10 = l2Var.a();
        int[] iArr = a10.f1350b;
        long[] jArr = a10.f1349a;
        int length = jArr.length - 2;
        if (length >= 0) {
            int i11 = 0;
            while (true) {
                long j10 = jArr[i11];
                if ((((~j10) << 7) & j10 & (-9187201950435737472L)) != -9187201950435737472L) {
                    int i12 = 8 - ((~(i11 - length)) >>> 31);
                    for (int i13 = 0; i13 < i12; i13++) {
                        if (((255 & j10) < 128) && !b10.a(iArr[(i11 << 3) + i13])) {
                            s0(mVar.q());
                            return;
                        }
                        j10 >>= 8;
                    }
                    if (i12 != 8) {
                        break;
                    }
                }
                if (i11 == length) {
                    break;
                } else {
                    i11++;
                }
            }
        }
        List t11 = mVar.t();
        int size2 = t11.size();
        for (int i14 = 0; i14 < size2; i14++) {
            o2.m mVar3 = (o2.m) t11.get(i14);
            if (a0().a(mVar3.o())) {
                Object c10 = this.I.c(mVar3.o());
                kotlin.jvm.internal.t.d(c10);
                G0(mVar3, (l2) c10);
            }
        }
    }

    private final boolean H0(AccessibilityEvent accessibilityEvent) {
        if (!p0()) {
            return false;
        }
        if (accessibilityEvent.getEventType() == 2048 || accessibilityEvent.getEventType() == 32768) {
            this.f2738q = true;
        }
        try {
            return ((Boolean) this.f2727f.invoke(accessibilityEvent)).booleanValue();
        } finally {
            this.f2738q = false;
        }
    }

    private final boolean I0(int i10, int i11, Integer num, List list) {
        if (i10 == Integer.MIN_VALUE || !p0()) {
            return false;
        }
        AccessibilityEvent R = R(i10, i11);
        if (num != null) {
            R.setContentChangeTypes(num.intValue());
        }
        if (list != null) {
            R.setContentDescription(e3.a.d(list, ",", null, null, 0, null, null, 62, null));
        }
        Trace.beginSection("sendEvent");
        try {
            return H0(R);
        } finally {
            Trace.endSection();
        }
    }

    static /* synthetic */ boolean J0(x xVar, int i10, int i11, Integer num, List list, int i12, Object obj) {
        if ((i12 & 4) != 0) {
            num = null;
        }
        if ((i12 & 8) != 0) {
            list = null;
        }
        return xVar.I0(i10, i11, num, list);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void K(int i10, t3.h hVar, String str, Bundle bundle) {
        o2.m b10;
        m2 m2Var = (m2) a0().c(i10);
        if (m2Var == null || (b10 = m2Var.b()) == null) {
            return;
        }
        String i02 = i0(b10);
        if (kotlin.jvm.internal.t.b(str, this.F)) {
            int e10 = this.D.e(i10, -1);
            if (e10 != -1) {
                hVar.t().putInt(str, e10);
                return;
            }
            return;
        }
        if (kotlin.jvm.internal.t.b(str, this.G)) {
            int e11 = this.E.e(i10, -1);
            if (e11 != -1) {
                hVar.t().putInt(str, e11);
                return;
            }
            return;
        }
        if (!b10.w().i(o2.h.f30560a.i()) || bundle == null || !kotlin.jvm.internal.t.b(str, "android.view.accessibility.extra.DATA_TEXT_CHARACTER_LOCATION_KEY")) {
            o2.i w10 = b10.w();
            o2.p pVar = o2.p.f30605a;
            if (!w10.i(pVar.C()) || bundle == null || !kotlin.jvm.internal.t.b(str, "androidx.compose.ui.semantics.testTag")) {
                if (kotlin.jvm.internal.t.b(str, "androidx.compose.ui.semantics.id")) {
                    hVar.t().putInt(str, b10.o());
                    return;
                }
                return;
            } else {
                String str2 = (String) o2.j.a(b10.w(), pVar.C());
                if (str2 != null) {
                    hVar.t().putCharSequence(str, str2);
                    return;
                }
                return;
            }
        }
        int i11 = bundle.getInt("android.view.accessibility.extra.DATA_TEXT_CHARACTER_LOCATION_ARG_START_INDEX", -1);
        int i12 = bundle.getInt("android.view.accessibility.extra.DATA_TEXT_CHARACTER_LOCATION_ARG_LENGTH", -1);
        if (i12 > 0 && i11 >= 0) {
            if (i11 < (i02 != null ? i02.length() : Api.BaseClientBuilder.API_PRIORITY_OTHER)) {
                q2.j0 e12 = n2.e(b10.w());
                if (e12 == null) {
                    return;
                }
                ArrayList arrayList = new ArrayList();
                for (int i13 = 0; i13 < i12; i13++) {
                    int i14 = i11 + i13;
                    if (i14 >= e12.l().j().length()) {
                        arrayList.add(null);
                    } else {
                        arrayList.add(a1(b10, e12.d(i14)));
                    }
                }
                hVar.t().putParcelableArray(str, (Parcelable[]) arrayList.toArray(new RectF[0]));
                return;
            }
        }
        Log.e("AccessibilityDelegate", "Invalid arguments for accessibility character locations");
    }

    private final void K0(int i10, int i11, String str) {
        AccessibilityEvent R = R(F0(i10), 32);
        R.setContentChangeTypes(i11);
        if (str != null) {
            R.getText().add(str);
        }
        H0(R);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final Rect L(m2 m2Var) {
        Rect a10 = m2Var.a();
        long x02 = this.f2725d.x0(r1.h.a(a10.left, a10.top));
        long x03 = this.f2725d.x0(r1.h.a(a10.right, a10.bottom));
        return new Rect((int) Math.floor(r1.g.m(x02)), (int) Math.floor(r1.g.n(x02)), (int) Math.ceil(r1.g.m(x03)), (int) Math.ceil(r1.g.n(x03)));
    }

    private final void L0(int i10) {
        g gVar = this.A;
        if (gVar != null) {
            if (i10 != gVar.d().o()) {
                return;
            }
            if (SystemClock.uptimeMillis() - gVar.f() <= 1000) {
                AccessibilityEvent R = R(F0(gVar.d().o()), 131072);
                R.setFromIndex(gVar.b());
                R.setToIndex(gVar.e());
                R.setAction(gVar.a());
                R.setMovementGranularity(gVar.c());
                R.getText().add(i0(gVar.d()));
                H0(R);
            }
        }
        this.A = null;
    }

    /* JADX WARN: Code restructure failed: missing block: B:154:0x0548, code lost:
    
        if (r0.containsAll(r2) != false) goto L163;
     */
    /* JADX WARN: Code restructure failed: missing block: B:155:0x054b, code lost:
    
        r22 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:171:0x05aa, code lost:
    
        if (r0 == false) goto L164;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final void M0(androidx.collection.l lVar) {
        ArrayList arrayList;
        int[] iArr;
        long[] jArr;
        char c10;
        int i10;
        int i11;
        ArrayList arrayList2;
        int[] iArr2;
        long[] jArr2;
        char c11;
        int i12;
        o2.m mVar;
        int i13;
        int i14;
        int i15;
        String str;
        ArrayList arrayList3;
        int[] iArr3;
        long[] jArr3;
        char c12;
        int i16;
        boolean g10;
        String j10;
        int g11;
        AccessibilityEvent U;
        androidx.collection.l lVar2 = lVar;
        ArrayList arrayList4 = new ArrayList(this.M);
        this.M.clear();
        int[] iArr4 = lVar2.f1339b;
        long[] jArr4 = lVar2.f1338a;
        char c13 = 2;
        int length = jArr4.length - 2;
        if (length < 0) {
            return;
        }
        int i17 = 0;
        while (true) {
            long j11 = jArr4[i17];
            if ((((~j11) << 7) & j11 & (-9187201950435737472L)) != -9187201950435737472L) {
                int i18 = 8;
                int i19 = 8 - ((~(i17 - length)) >>> 31);
                long j12 = j11;
                int i20 = 0;
                while (i20 < i19) {
                    if ((j12 & 255) < 128) {
                        int i21 = iArr4[(i17 << 3) + i20];
                        l2 l2Var = (l2) this.I.c(i21);
                        if (l2Var != null) {
                            m2 m2Var = (m2) lVar2.c(i21);
                            o2.m b10 = m2Var != null ? m2Var.b() : null;
                            if (b10 == null) {
                                g2.a.c("no value for specified key");
                                throw new rm.k();
                            }
                            Iterator it = b10.w().iterator();
                            boolean z10 = false;
                            while (it.hasNext()) {
                                Map.Entry entry = (Map.Entry) it.next();
                                Object key = entry.getKey();
                                o2.p pVar = o2.p.f30605a;
                                if (((kotlin.jvm.internal.t.b(key, pVar.k()) || kotlin.jvm.internal.t.b(entry.getKey(), pVar.I())) ? B0(i21, arrayList4) : false) || !kotlin.jvm.internal.t.b(entry.getValue(), o2.j.a(l2Var.b(), (o2.t) entry.getKey()))) {
                                    o2.t tVar = (o2.t) entry.getKey();
                                    if (kotlin.jvm.internal.t.b(tVar, pVar.v())) {
                                        Object value = entry.getValue();
                                        kotlin.jvm.internal.t.e(value, "null cannot be cast to non-null type kotlin.String");
                                        String str2 = (String) value;
                                        if (l2Var.b().i(pVar.v())) {
                                            K0(i21, i18, str2);
                                        }
                                    } else {
                                        if (kotlin.jvm.internal.t.b(tVar, pVar.B()) ? true : kotlin.jvm.internal.t.b(tVar, pVar.G())) {
                                            mVar = b10;
                                            i13 = i21;
                                            i14 = i20;
                                            J0(this, F0(i21), 2048, 64, null, 8, null);
                                            J0(this, F0(i13), 2048, 0, null, 8, null);
                                            arrayList3 = arrayList4;
                                            iArr3 = iArr4;
                                            jArr3 = jArr4;
                                            i15 = i19;
                                        } else {
                                            mVar = b10;
                                            i13 = i21;
                                            i14 = i20;
                                            int i22 = i19;
                                            if (kotlin.jvm.internal.t.b(tVar, pVar.x())) {
                                                i15 = i22;
                                                J0(this, F0(i13), 2048, 64, null, 8, null);
                                                J0(this, F0(i13), 2048, 0, null, 8, null);
                                            } else {
                                                i15 = i22;
                                                if (kotlin.jvm.internal.t.b(tVar, pVar.A())) {
                                                    o2.f fVar = (o2.f) o2.j.a(mVar.w(), pVar.y());
                                                    if (!(fVar == null ? false : o2.f.k(fVar.n(), o2.f.f30548b.g()))) {
                                                        J0(this, F0(i13), 2048, 64, null, 8, null);
                                                        J0(this, F0(i13), 2048, 0, null, 8, null);
                                                    } else if (kotlin.jvm.internal.t.b(o2.j.a(mVar.w(), pVar.A()), Boolean.TRUE)) {
                                                        AccessibilityEvent R = R(F0(i13), 4);
                                                        o2.m a10 = mVar.a();
                                                        List list = (List) o2.j.a(a10.n(), pVar.d());
                                                        String d10 = list != null ? e3.a.d(list, ",", null, null, 0, null, null, 62, null) : null;
                                                        List list2 = (List) o2.j.a(a10.n(), pVar.D());
                                                        String d11 = list2 != null ? e3.a.d(list2, ",", null, null, 0, null, null, 62, null) : null;
                                                        if (d10 != null) {
                                                            R.setContentDescription(d10);
                                                            rm.n0 n0Var = rm.n0.f34904a;
                                                        }
                                                        if (d11 != null) {
                                                            R.getText().add(d11);
                                                        }
                                                        H0(R);
                                                    } else {
                                                        J0(this, F0(i13), 2048, 0, null, 8, null);
                                                    }
                                                } else if (kotlin.jvm.internal.t.b(tVar, pVar.d())) {
                                                    int F0 = F0(i13);
                                                    Object value2 = entry.getValue();
                                                    kotlin.jvm.internal.t.e(value2, "null cannot be cast to non-null type kotlin.collections.List<kotlin.String>");
                                                    I0(F0, 2048, 4, (List) value2);
                                                } else {
                                                    str = "";
                                                    if (!kotlin.jvm.internal.t.b(tVar, pVar.g())) {
                                                        arrayList3 = arrayList4;
                                                        iArr3 = iArr4;
                                                        jArr3 = jArr4;
                                                        c12 = 2;
                                                        if (kotlin.jvm.internal.t.b(tVar, pVar.E())) {
                                                            q2.d k02 = k0(mVar.w());
                                                            if (k02 != null && (j10 = k02.j()) != null) {
                                                                str = j10;
                                                            }
                                                            long r10 = ((q2.m0) mVar.w().x(pVar.E())).r();
                                                            H0(U(F0(i13), Integer.valueOf(q2.m0.n(r10)), Integer.valueOf(q2.m0.i(r10)), Integer.valueOf(str.length()), e1(str, 100000)));
                                                            L0(mVar.o());
                                                        } else {
                                                            if (kotlin.jvm.internal.t.b(tVar, pVar.k()) ? true : kotlin.jvm.internal.t.b(tVar, pVar.I())) {
                                                                s0(mVar.q());
                                                                k2 a11 = n2.a(this.M, i13);
                                                                kotlin.jvm.internal.t.d(a11);
                                                                a11.f((o2.g) o2.j.a(mVar.w(), pVar.k()));
                                                                a11.i((o2.g) o2.j.a(mVar.w(), pVar.I()));
                                                                D0(a11);
                                                            } else {
                                                                if (kotlin.jvm.internal.t.b(tVar, pVar.i())) {
                                                                    Object value3 = entry.getValue();
                                                                    kotlin.jvm.internal.t.e(value3, "null cannot be cast to non-null type kotlin.Boolean");
                                                                    if (((Boolean) value3).booleanValue()) {
                                                                        i16 = 8;
                                                                        H0(R(F0(mVar.o()), 8));
                                                                    } else {
                                                                        i16 = 8;
                                                                    }
                                                                    J0(this, F0(mVar.o()), 2048, 0, null, 8, null);
                                                                } else {
                                                                    i16 = 8;
                                                                    o2.h hVar = o2.h.f30560a;
                                                                    if (kotlin.jvm.internal.t.b(tVar, hVar.d())) {
                                                                        List list3 = (List) mVar.w().x(hVar.d());
                                                                        List list4 = (List) o2.j.a(l2Var.b(), hVar.d());
                                                                        if (list4 != null) {
                                                                            LinkedHashSet linkedHashSet = new LinkedHashSet();
                                                                            if (list3.size() > 0) {
                                                                                android.support.v4.media.session.b.a(list3.get(0));
                                                                                throw null;
                                                                            }
                                                                            LinkedHashSet linkedHashSet2 = new LinkedHashSet();
                                                                            if (list4.size() > 0) {
                                                                                android.support.v4.media.session.b.a(list4.get(0));
                                                                                throw null;
                                                                            }
                                                                            if (linkedHashSet.containsAll(linkedHashSet2)) {
                                                                            }
                                                                            z10 = true;
                                                                        } else if (!list3.isEmpty()) {
                                                                            i19 = i15;
                                                                            i18 = 8;
                                                                            i21 = i13;
                                                                            z10 = true;
                                                                            iArr4 = iArr3;
                                                                            b10 = mVar;
                                                                            i20 = i14;
                                                                            jArr4 = jArr3;
                                                                            c13 = c12;
                                                                            arrayList4 = arrayList3;
                                                                        }
                                                                    } else {
                                                                        if (entry.getValue() instanceof o2.a) {
                                                                            Object value4 = entry.getValue();
                                                                            kotlin.jvm.internal.t.e(value4, "null cannot be cast to non-null type androidx.compose.ui.semantics.AccessibilityAction<*>");
                                                                            g10 = a0.g((o2.a) value4, o2.j.a(l2Var.b(), (o2.t) entry.getKey()));
                                                                        }
                                                                        z10 = true;
                                                                    }
                                                                }
                                                                i19 = i15;
                                                                i18 = i16;
                                                                i21 = i13;
                                                                iArr4 = iArr3;
                                                                b10 = mVar;
                                                                i20 = i14;
                                                                jArr4 = jArr3;
                                                                c13 = c12;
                                                                arrayList4 = arrayList3;
                                                            }
                                                        }
                                                    } else if (mVar.w().i(o2.h.f30560a.y())) {
                                                        q2.d k03 = k0(l2Var.b());
                                                        if (k03 == null) {
                                                            k03 = "";
                                                        }
                                                        q2.d k04 = k0(mVar.w());
                                                        str = k04 != null ? k04 : "";
                                                        CharSequence e12 = e1(str, 100000);
                                                        int length2 = k03.length();
                                                        int length3 = str.length();
                                                        g11 = jn.o.g(length2, length3);
                                                        int i23 = 0;
                                                        while (true) {
                                                            if (i23 >= g11) {
                                                                arrayList3 = arrayList4;
                                                                break;
                                                            }
                                                            arrayList3 = arrayList4;
                                                            if (k03.charAt(i23) != str.charAt(i23)) {
                                                                break;
                                                            }
                                                            i23++;
                                                            arrayList4 = arrayList3;
                                                        }
                                                        int i24 = 0;
                                                        while (i24 < g11 - i23) {
                                                            int i25 = g11;
                                                            if (k03.charAt((length2 - 1) - i24) != str.charAt((length3 - 1) - i24)) {
                                                                break;
                                                            }
                                                            i24++;
                                                            g11 = i25;
                                                        }
                                                        int i26 = (length2 - i24) - i23;
                                                        int i27 = (length3 - i24) - i23;
                                                        o2.i b11 = l2Var.b();
                                                        o2.p pVar2 = o2.p.f30605a;
                                                        boolean i28 = b11.i(pVar2.w());
                                                        iArr3 = iArr4;
                                                        boolean i29 = mVar.w().i(pVar2.w());
                                                        jArr3 = jArr4;
                                                        boolean i30 = l2Var.b().i(pVar2.g());
                                                        boolean z11 = i30 && !i28 && i29;
                                                        boolean z12 = i30 && i28 && !i29;
                                                        if (z11 || z12) {
                                                            U = U(F0(i13), 0, 0, Integer.valueOf(length3), e12);
                                                        } else {
                                                            U = R(F0(i13), 16);
                                                            U.setFromIndex(i23);
                                                            U.setRemovedCount(i26);
                                                            U.setAddedCount(i27);
                                                            U.setBeforeText(k03);
                                                            U.getText().add(e12);
                                                        }
                                                        U.setClassName("android.widget.EditText");
                                                        H0(U);
                                                        if (z11 || z12) {
                                                            long r11 = ((q2.m0) mVar.w().x(pVar2.E())).r();
                                                            U.setFromIndex(q2.m0.n(r11));
                                                            U.setToIndex(q2.m0.i(r11));
                                                            H0(U);
                                                        }
                                                    } else {
                                                        arrayList3 = arrayList4;
                                                        iArr3 = iArr4;
                                                        jArr3 = jArr4;
                                                        c12 = 2;
                                                        J0(this, F0(i13), 2048, 2, null, 8, null);
                                                    }
                                                    i16 = 8;
                                                    i19 = i15;
                                                    i18 = i16;
                                                    i21 = i13;
                                                    iArr4 = iArr3;
                                                    b10 = mVar;
                                                    i20 = i14;
                                                    jArr4 = jArr3;
                                                    c13 = c12;
                                                    arrayList4 = arrayList3;
                                                }
                                            }
                                            arrayList3 = arrayList4;
                                            iArr3 = iArr4;
                                            jArr3 = jArr4;
                                        }
                                        c12 = 2;
                                        i16 = 8;
                                        i19 = i15;
                                        i18 = i16;
                                        i21 = i13;
                                        iArr4 = iArr3;
                                        b10 = mVar;
                                        i20 = i14;
                                        jArr4 = jArr3;
                                        c13 = c12;
                                        arrayList4 = arrayList3;
                                    }
                                }
                                mVar = b10;
                                i13 = i21;
                                i14 = i20;
                                i15 = i19;
                                arrayList3 = arrayList4;
                                iArr3 = iArr4;
                                jArr3 = jArr4;
                                c12 = 2;
                                i16 = i18;
                                i19 = i15;
                                i18 = i16;
                                i21 = i13;
                                iArr4 = iArr3;
                                b10 = mVar;
                                i20 = i14;
                                jArr4 = jArr3;
                                c13 = c12;
                                arrayList4 = arrayList3;
                            }
                            o2.m mVar2 = b10;
                            i10 = i20;
                            i11 = i19;
                            arrayList2 = arrayList4;
                            iArr2 = iArr4;
                            jArr2 = jArr4;
                            c11 = c13;
                            int i31 = i21;
                            i12 = i18;
                            if (!z10) {
                                z10 = a0.l(mVar2, l2Var.b());
                            }
                            if (z10) {
                                J0(this, F0(i31), 2048, 0, null, 8, null);
                            }
                            j12 >>= i12;
                            i20 = i10 + 1;
                            i19 = i11;
                            c13 = c11;
                            i18 = i12;
                            arrayList4 = arrayList2;
                            iArr4 = iArr2;
                            jArr4 = jArr2;
                            lVar2 = lVar;
                        }
                    }
                    i10 = i20;
                    i11 = i19;
                    arrayList2 = arrayList4;
                    iArr2 = iArr4;
                    jArr2 = jArr4;
                    c11 = c13;
                    i12 = i18;
                    j12 >>= i12;
                    i20 = i10 + 1;
                    i19 = i11;
                    c13 = c11;
                    i18 = i12;
                    arrayList4 = arrayList2;
                    iArr4 = iArr2;
                    jArr4 = jArr2;
                    lVar2 = lVar;
                }
                arrayList = arrayList4;
                iArr = iArr4;
                jArr = jArr4;
                c10 = c13;
                if (i19 != i18) {
                    return;
                }
            } else {
                arrayList = arrayList4;
                iArr = iArr4;
                jArr = jArr4;
                c10 = c13;
            }
            if (i17 == length) {
                return;
            }
            i17++;
            lVar2 = lVar;
            c13 = c10;
            arrayList4 = arrayList;
            iArr4 = iArr;
            jArr4 = jArr;
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:16:0x003e, code lost:
    
        r0 = androidx.compose.ui.platform.a0.j(r8, androidx.compose.ui.platform.x.p.f2773p);
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final void N0(j2.g0 g0Var, androidx.collection.z zVar) {
        o2.i I;
        j2.g0 j10;
        if (g0Var.K0() && !this.f2725d.getAndroidViewsHandler$ui_release().getLayoutNodeToHolder().containsKey(g0Var)) {
            if (!g0Var.k0().q(j2.b1.a(8))) {
                g0Var = a0.j(g0Var, q.f2774p);
            }
            if (g0Var == null || (I = g0Var.I()) == null) {
                return;
            }
            if (!I.D() && j10 != null) {
                g0Var = j10;
            }
            int q02 = g0Var.q0();
            if (zVar.f(q02)) {
                J0(this, F0(q02), 2048, 1, null, 8, null);
            }
        }
    }

    private final boolean O(androidx.collection.l lVar, boolean z10, int i10, long j10) {
        o2.t k10;
        boolean z11;
        o2.g gVar;
        if (r1.g.j(j10, r1.g.f34318b.b()) || !r1.g.p(j10)) {
            return false;
        }
        boolean z12 = true;
        if (z10) {
            k10 = o2.p.f30605a.I();
        } else {
            if (z10) {
                throw new rm.t();
            }
            k10 = o2.p.f30605a.k();
        }
        Object[] objArr = lVar.f1340c;
        long[] jArr = lVar.f1338a;
        int length = jArr.length - 2;
        if (length >= 0) {
            int i11 = 0;
            boolean z13 = false;
            while (true) {
                long j11 = jArr[i11];
                if ((((~j11) << 7) & j11 & (-9187201950435737472L)) != -9187201950435737472L) {
                    int i12 = 8 - ((~(i11 - length)) >>> 31);
                    int i13 = 0;
                    while (i13 < i12) {
                        if ((j11 & 255) < 128 ? z12 : false) {
                            m2 m2Var = (m2) objArr[(i11 << 3) + i13];
                            if (s1.k1.e(m2Var.a()).b(j10) && (gVar = (o2.g) o2.j.a(m2Var.b().w(), k10)) != null) {
                                int i14 = gVar.b() ? -i10 : i10;
                                if (i10 == 0 && gVar.b()) {
                                    i14 = -1;
                                }
                                if (i14 < 0) {
                                    if (((Number) gVar.c().invoke()).floatValue() <= BitmapDescriptorFactory.HUE_RED) {
                                    }
                                    z13 = true;
                                } else {
                                    if (((Number) gVar.c().invoke()).floatValue() >= ((Number) gVar.a().invoke()).floatValue()) {
                                    }
                                    z13 = true;
                                }
                            }
                        }
                        j11 >>= 8;
                        i13++;
                        z12 = true;
                    }
                    if (i12 != 8) {
                        return z13;
                    }
                }
                if (i11 == length) {
                    z11 = z13;
                    break;
                }
                i11++;
                z12 = true;
            }
        } else {
            z11 = false;
        }
        return z11;
    }

    private final void O0(j2.g0 g0Var) {
        if (g0Var.K0() && !this.f2725d.getAndroidViewsHandler$ui_release().getLayoutNodeToHolder().containsKey(g0Var)) {
            int q02 = g0Var.q0();
            o2.g gVar = (o2.g) this.f2739r.c(q02);
            o2.g gVar2 = (o2.g) this.f2740s.c(q02);
            if (gVar == null && gVar2 == null) {
                return;
            }
            AccessibilityEvent R = R(q02, 4096);
            if (gVar != null) {
                R.setScrollX((int) ((Number) gVar.c().invoke()).floatValue());
                R.setMaxScrollX((int) ((Number) gVar.a().invoke()).floatValue());
            }
            if (gVar2 != null) {
                R.setScrollY((int) ((Number) gVar2.c().invoke()).floatValue());
                R.setMaxScrollY((int) ((Number) gVar2.a().invoke()).floatValue());
            }
            H0(R);
        }
    }

    private final void P() {
        Trace.beginSection("sendAccessibilitySemanticsStructureChangeEvents");
        try {
            if (p0()) {
                G0(this.f2725d.getSemanticsOwner().a(), this.J);
            }
            rm.n0 n0Var = rm.n0.f34904a;
            Trace.endSection();
            Trace.beginSection("sendSemanticsPropertyChangeEvents");
            try {
                M0(a0());
                Trace.endSection();
                Trace.beginSection("updateSemanticsNodesCopyAndPanes");
                try {
                    g1();
                } finally {
                }
            } finally {
            }
        } finally {
        }
    }

    private final boolean P0(o2.m mVar, int i10, int i11, boolean z10) {
        String i02;
        boolean h10;
        o2.i w10 = mVar.w();
        o2.h hVar = o2.h.f30560a;
        if (w10.i(hVar.x())) {
            h10 = a0.h(mVar);
            if (h10) {
                dn.q qVar = (dn.q) ((o2.a) mVar.w().x(hVar.x())).a();
                if (qVar != null) {
                    return ((Boolean) qVar.invoke(Integer.valueOf(i10), Integer.valueOf(i11), Boolean.valueOf(z10))).booleanValue();
                }
                return false;
            }
        }
        if ((i10 == i11 && i11 == this.f2743v) || (i02 = i0(mVar)) == null) {
            return false;
        }
        if (i10 < 0 || i10 != i11 || i11 > i02.length()) {
            i10 = -1;
        }
        this.f2743v = i10;
        boolean z11 = i02.length() > 0;
        H0(U(F0(mVar.o()), z11 ? Integer.valueOf(this.f2743v) : null, z11 ? Integer.valueOf(this.f2743v) : null, z11 ? Integer.valueOf(i02.length()) : null, i02));
        L0(mVar.o());
        return true;
    }

    private final boolean Q(int i10) {
        if (!n0(i10)) {
            return false;
        }
        this.f2736o = Integer.MIN_VALUE;
        this.f2737p = null;
        this.f2725d.invalidate();
        J0(this, i10, 65536, null, null, 12, null);
        return true;
    }

    private final void Q0(o2.m mVar, t3.h hVar) {
        o2.i w10 = mVar.w();
        o2.p pVar = o2.p.f30605a;
        if (w10.i(pVar.h())) {
            hVar.l0(true);
            hVar.p0((CharSequence) o2.j.a(mVar.w(), pVar.h()));
        }
    }

    private final AccessibilityEvent R(int i10, int i11) {
        m2 m2Var;
        AccessibilityEvent obtain = AccessibilityEvent.obtain(i11);
        obtain.setEnabled(true);
        obtain.setClassName("android.view.View");
        obtain.setPackageName(this.f2725d.getContext().getPackageName());
        obtain.setSource(this.f2725d, i10);
        if (p0() && (m2Var = (m2) a0().c(i10)) != null) {
            obtain.setPassword(m2Var.b().w().i(o2.p.f30605a.w()));
        }
        return obtain;
    }

    private final void R0(o2.m mVar, t3.h hVar) {
        hVar.e0(f0(mVar));
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Multi-variable type inference failed */
    public final t3.h S(int i10) {
        androidx.lifecycle.u a10;
        androidx.lifecycle.n lifecycle;
        r.b viewTreeOwners = this.f2725d.getViewTreeOwners();
        if (((viewTreeOwners == null || (a10 = viewTreeOwners.a()) == null || (lifecycle = a10.getLifecycle()) == null) ? null : lifecycle.b()) == n.b.DESTROYED) {
            return null;
        }
        t3.h U = t3.h.U();
        m2 m2Var = (m2) a0().c(i10);
        if (m2Var == null) {
            return null;
        }
        o2.m b10 = m2Var.b();
        if (i10 == -1) {
            ViewParent parentForAccessibility = this.f2725d.getParentForAccessibility();
            U.B0(parentForAccessibility instanceof View ? (View) parentForAccessibility : null);
        } else {
            o2.m r10 = b10.r();
            Integer valueOf = r10 != null ? Integer.valueOf(r10.o()) : null;
            if (valueOf == null) {
                g2.a.c("semanticsNode " + i10 + " has null parent");
                throw new rm.k();
            }
            int intValue = valueOf.intValue();
            U.C0(this.f2725d, intValue != this.f2725d.getSemanticsOwner().a().o() ? intValue : -1);
        }
        U.K0(this.f2725d, i10);
        U.d0(L(m2Var));
        y0(i10, U, b10);
        return U;
    }

    private final String T(o2.m mVar) {
        o2.i n10 = mVar.a().n();
        o2.p pVar = o2.p.f30605a;
        Collection collection = (Collection) o2.j.a(n10, pVar.d());
        boolean z10 = false;
        if (collection == null || collection.isEmpty()) {
            Collection collection2 = (Collection) o2.j.a(n10, pVar.D());
            if (collection2 == null || collection2.isEmpty()) {
                CharSequence charSequence = (CharSequence) o2.j.a(n10, pVar.g());
                if (charSequence == null || charSequence.length() == 0) {
                    z10 = true;
                }
            }
        }
        if (z10) {
            return this.f2725d.getContext().getResources().getString(l1.n.f27411h);
        }
        return null;
    }

    private final void T0(o2.m mVar, t3.h hVar) {
        hVar.L0(g0(mVar));
    }

    private final AccessibilityEvent U(int i10, Integer num, Integer num2, Integer num3, CharSequence charSequence) {
        AccessibilityEvent R = R(i10, UserMetadata.MAX_INTERNAL_KEY_SIZE);
        if (num != null) {
            R.setFromIndex(num.intValue());
        }
        if (num2 != null) {
            R.setToIndex(num2.intValue());
        }
        if (num3 != null) {
            R.setItemCount(num3.intValue());
        }
        if (charSequence != null) {
            R.getText().add(charSequence);
        }
        return R;
    }

    private final void U0(o2.m mVar, t3.h hVar) {
        q2.d h02 = h0(mVar);
        hVar.M0(h02 != null ? b1(h02) : null);
    }

    private final void V0() {
        boolean k10;
        List q10;
        int m10;
        this.D.i();
        this.E.i();
        m2 m2Var = (m2) a0().c(-1);
        o2.m b10 = m2Var != null ? m2Var.b() : null;
        kotlin.jvm.internal.t.d(b10);
        k10 = a0.k(b10);
        q10 = sm.u.q(b10);
        List Z0 = Z0(k10, q10);
        m10 = sm.u.m(Z0);
        int i10 = 1;
        if (1 > m10) {
            return;
        }
        while (true) {
            int o10 = ((o2.m) Z0.get(i10 - 1)).o();
            int o11 = ((o2.m) Z0.get(i10)).o();
            this.D.q(o10, o11);
            this.E.q(o11, o10);
            if (i10 == m10) {
                return;
            } else {
                i10++;
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void W(x xVar, boolean z10) {
        xVar.f2733l = z10 ? xVar.f2728g.getEnabledAccessibilityServiceList(-1) : sm.u.k();
    }

    /* JADX WARN: Incorrect condition in loop: B:24:0x0085 */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final List W0(boolean z10, ArrayList arrayList, androidx.collection.y yVar) {
        int m10;
        int m11;
        List q10;
        ArrayList arrayList2 = new ArrayList();
        m10 = sm.u.m(arrayList);
        int i10 = 0;
        if (m10 >= 0) {
            int i11 = 0;
            while (true) {
                o2.m mVar = (o2.m) arrayList.get(i11);
                if (i11 == 0 || !Y0(arrayList2, mVar)) {
                    r1.i j10 = mVar.j();
                    q10 = sm.u.q(mVar);
                    arrayList2.add(new rm.v(j10, q10));
                }
                if (i11 == m10) {
                    break;
                }
                i11++;
            }
        }
        sm.y.z(arrayList2, i.f2760p);
        ArrayList arrayList3 = new ArrayList();
        int size = arrayList2.size();
        for (int i12 = 0; i12 < size; i12++) {
            rm.v vVar = (rm.v) arrayList2.get(i12);
            sm.y.z((List) vVar.d(), new z(new y(z10 ? h.f2759p : f.f2752p, j2.g0.f23635a0.b())));
            arrayList3.addAll((Collection) vVar.d());
        }
        final r rVar = r.f2775p;
        sm.y.z(arrayList3, new Comparator() { // from class: androidx.compose.ui.platform.t
            @Override // java.util.Comparator
            public final int compare(Object obj, Object obj2) {
                int X0;
                X0 = x.X0(dn.p.this, obj, obj2);
                return X0;
            }
        });
        while (i10 <= m11) {
            List list = (List) yVar.c(((o2.m) arrayList3.get(i10)).o());
            if (list != null) {
                if (q0((o2.m) arrayList3.get(i10))) {
                    i10++;
                } else {
                    arrayList3.remove(i10);
                }
                arrayList3.addAll(i10, list);
                i10 += list.size();
            } else {
                i10++;
            }
        }
        return arrayList3;
    }

    private final void X(o2.m mVar, ArrayList arrayList, androidx.collection.y yVar) {
        boolean k10;
        List V0;
        k10 = a0.k(mVar);
        boolean booleanValue = ((Boolean) mVar.w().z(o2.p.f30605a.s(), l.f2768p)).booleanValue();
        if ((booleanValue || q0(mVar)) && a0().b(mVar.o())) {
            arrayList.add(mVar);
        }
        if (booleanValue) {
            int o10 = mVar.o();
            V0 = sm.c0.V0(mVar.k());
            yVar.t(o10, Z0(k10, V0));
        } else {
            List k11 = mVar.k();
            int size = k11.size();
            for (int i10 = 0; i10 < size; i10++) {
                X((o2.m) k11.get(i10), arrayList, yVar);
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final int X0(dn.p pVar, Object obj, Object obj2) {
        return ((Number) pVar.invoke(obj, obj2)).intValue();
    }

    private final int Y(o2.m mVar) {
        o2.i w10 = mVar.w();
        o2.p pVar = o2.p.f30605a;
        return (w10.i(pVar.d()) || !mVar.w().i(pVar.E())) ? this.f2743v : q2.m0.i(((q2.m0) mVar.w().x(pVar.E())).r());
    }

    private static final boolean Y0(ArrayList arrayList, o2.m mVar) {
        int m10;
        float l10 = mVar.j().l();
        float e10 = mVar.j().e();
        boolean z10 = l10 >= e10;
        m10 = sm.u.m(arrayList);
        if (m10 >= 0) {
            int i10 = 0;
            while (true) {
                r1.i iVar = (r1.i) ((rm.v) arrayList.get(i10)).c();
                if (!((z10 || ((iVar.l() > iVar.e() ? 1 : (iVar.l() == iVar.e() ? 0 : -1)) >= 0) || Math.max(l10, iVar.l()) >= Math.min(e10, iVar.e())) ? false : true)) {
                    if (i10 == m10) {
                        break;
                    }
                    i10++;
                } else {
                    arrayList.set(i10, new rm.v(iVar.o(BitmapDescriptorFactory.HUE_RED, l10, Float.POSITIVE_INFINITY, e10), ((rm.v) arrayList.get(i10)).d()));
                    ((List) ((rm.v) arrayList.get(i10)).d()).add(mVar);
                    return true;
                }
            }
        }
        return false;
    }

    private final int Z(o2.m mVar) {
        o2.i w10 = mVar.w();
        o2.p pVar = o2.p.f30605a;
        return (w10.i(pVar.d()) || !mVar.w().i(pVar.E())) ? this.f2743v : q2.m0.n(((q2.m0) mVar.w().x(pVar.E())).r());
    }

    private final List Z0(boolean z10, List list) {
        androidx.collection.y b10 = androidx.collection.m.b();
        ArrayList arrayList = new ArrayList();
        int size = list.size();
        for (int i10 = 0; i10 < size; i10++) {
            X((o2.m) list.get(i10), arrayList, b10);
        }
        return W0(z10, arrayList, b10);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final androidx.collection.l a0() {
        if (this.f2747z) {
            this.f2747z = false;
            this.B = n2.b(this.f2725d.getSemanticsOwner());
            if (p0()) {
                V0();
            }
        }
        return this.B;
    }

    private final RectF a1(o2.m mVar, r1.i iVar) {
        if (mVar == null) {
            return null;
        }
        r1.i t10 = iVar.t(mVar.s());
        r1.i i10 = mVar.i();
        r1.i p10 = t10.r(i10) ? t10.p(i10) : null;
        if (p10 == null) {
            return null;
        }
        long x02 = this.f2725d.x0(r1.h.a(p10.i(), p10.l()));
        long x03 = this.f2725d.x0(r1.h.a(p10.j(), p10.e()));
        return new RectF(r1.g.m(x02), r1.g.n(x02), r1.g.m(x03), r1.g.n(x03));
    }

    private final SpannableString b1(q2.d dVar) {
        return (SpannableString) e1(y2.a.b(dVar, this.f2725d.getDensity(), this.f2725d.getFontFamilyResolver(), this.H), 100000);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void c1(x xVar, boolean z10) {
        xVar.f2733l = xVar.f2728g.getEnabledAccessibilityServiceList(-1);
    }

    private final boolean d1(o2.m mVar, int i10, boolean z10, boolean z11) {
        androidx.compose.ui.platform.g j02;
        int i11;
        int i12;
        int o10 = mVar.o();
        Integer num = this.f2744w;
        if (num == null || o10 != num.intValue()) {
            this.f2743v = -1;
            this.f2744w = Integer.valueOf(mVar.o());
        }
        String i02 = i0(mVar);
        if ((i02 == null || i02.length() == 0) || (j02 = j0(mVar, i10)) == null) {
            return false;
        }
        int Y = Y(mVar);
        if (Y == -1) {
            Y = z10 ? 0 : i02.length();
        }
        int[] a10 = z10 ? j02.a(Y) : j02.b(Y);
        if (a10 == null) {
            return false;
        }
        int i13 = a10[0];
        int i14 = a10[1];
        if (z11 && o0(mVar)) {
            i11 = Z(mVar);
            if (i11 == -1) {
                i11 = z10 ? i13 : i14;
            }
            i12 = z10 ? i14 : i13;
        } else {
            i11 = z10 ? i14 : i13;
            i12 = i11;
        }
        this.A = new g(mVar, z10 ? 256 : 512, i10, i13, i14, SystemClock.uptimeMillis());
        P0(mVar, i11, i12, true);
        return true;
    }

    private final CharSequence e1(CharSequence charSequence, int i10) {
        boolean z10 = true;
        if (!(i10 > 0)) {
            throw new IllegalArgumentException("size should be greater than 0".toString());
        }
        if (charSequence != null && charSequence.length() != 0) {
            z10 = false;
        }
        if (z10 || charSequence.length() <= i10) {
            return charSequence;
        }
        int i11 = i10 - 1;
        if (Character.isHighSurrogate(charSequence.charAt(i11)) && Character.isLowSurrogate(charSequence.charAt(i10))) {
            i10 = i11;
        }
        CharSequence subSequence = charSequence.subSequence(0, i10);
        kotlin.jvm.internal.t.e(subSequence, "null cannot be cast to non-null type T of androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.trimToSize");
        return subSequence;
    }

    private final boolean f0(o2.m mVar) {
        o2.i w10 = mVar.w();
        o2.p pVar = o2.p.f30605a;
        p2.a aVar = (p2.a) o2.j.a(w10, pVar.G());
        o2.f fVar = (o2.f) o2.j.a(mVar.w(), pVar.y());
        boolean z10 = aVar != null;
        Boolean bool = (Boolean) o2.j.a(mVar.w(), pVar.A());
        if (bool == null) {
            return z10;
        }
        bool.booleanValue();
        return fVar != null ? o2.f.k(fVar.n(), o2.f.f30548b.g()) : false ? z10 : true;
    }

    private final void f1(int i10) {
        int i11 = this.f2726e;
        if (i11 == i10) {
            return;
        }
        this.f2726e = i10;
        J0(this, i10, 128, null, null, 12, null);
        J0(this, i11, 256, null, null, 12, null);
    }

    private final String g0(o2.m mVar) {
        o2.i w10 = mVar.w();
        o2.p pVar = o2.p.f30605a;
        Object a10 = o2.j.a(w10, pVar.B());
        p2.a aVar = (p2.a) o2.j.a(mVar.w(), pVar.G());
        o2.f fVar = (o2.f) o2.j.a(mVar.w(), pVar.y());
        if (aVar != null) {
            int i10 = j.f2761a[aVar.ordinal()];
            if (i10 == 1) {
                if ((fVar == null ? false : o2.f.k(fVar.n(), o2.f.f30548b.f())) && a10 == null) {
                    a10 = this.f2725d.getContext().getResources().getString(l1.n.f27413j);
                }
            } else if (i10 == 2) {
                if ((fVar == null ? false : o2.f.k(fVar.n(), o2.f.f30548b.f())) && a10 == null) {
                    a10 = this.f2725d.getContext().getResources().getString(l1.n.f27412i);
                }
            } else if (i10 == 3 && a10 == null) {
                a10 = this.f2725d.getContext().getResources().getString(l1.n.f27408e);
            }
        }
        Boolean bool = (Boolean) o2.j.a(mVar.w(), pVar.A());
        if (bool != null) {
            boolean booleanValue = bool.booleanValue();
            if (!(fVar == null ? false : o2.f.k(fVar.n(), o2.f.f30548b.g())) && a10 == null) {
                a10 = booleanValue ? this.f2725d.getContext().getResources().getString(l1.n.f27410g) : this.f2725d.getContext().getResources().getString(l1.n.f27409f);
            }
        }
        o2.e eVar = (o2.e) o2.j.a(mVar.w(), pVar.x());
        if (eVar != null) {
            if (eVar != o2.e.f30543d.a()) {
                if (a10 == null) {
                    jn.e c10 = eVar.c();
                    float b10 = ((((Number) c10.e()).floatValue() - ((Number) c10.i()).floatValue()) > BitmapDescriptorFactory.HUE_RED ? 1 : ((((Number) c10.e()).floatValue() - ((Number) c10.i()).floatValue()) == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) == 0 ? 0.0f : (eVar.b() - ((Number) c10.i()).floatValue()) / (((Number) c10.e()).floatValue() - ((Number) c10.i()).floatValue());
                    if (b10 < BitmapDescriptorFactory.HUE_RED) {
                        b10 = 0.0f;
                    }
                    if (b10 > 1.0f) {
                        b10 = 1.0f;
                    }
                    if (!(b10 == BitmapDescriptorFactory.HUE_RED)) {
                        r5 = (b10 == 1.0f ? 1 : 0) != 0 ? 100 : jn.o.k(Math.round(b10 * 100), 1, 99);
                    }
                    a10 = this.f2725d.getContext().getResources().getString(l1.n.f27416m, Integer.valueOf(r5));
                }
            } else if (a10 == null) {
                a10 = this.f2725d.getContext().getResources().getString(l1.n.f27407d);
            }
        }
        if (mVar.w().i(pVar.g())) {
            a10 = T(mVar);
        }
        return (String) a10;
    }

    private final void g1() {
        o2.i b10;
        int i10 = 0;
        androidx.collection.z zVar = new androidx.collection.z(0, 1, null);
        androidx.collection.z zVar2 = this.C;
        int[] iArr = zVar2.f1350b;
        long[] jArr = zVar2.f1349a;
        int length = jArr.length - 2;
        long j10 = 255;
        char c10 = 7;
        long j11 = -9187201950435737472L;
        if (length >= 0) {
            while (true) {
                long j12 = jArr[i10];
                if ((((~j12) << 7) & j12 & j11) != j11) {
                    int i11 = 8 - ((~(i10 - length)) >>> 31);
                    int i12 = 0;
                    while (i12 < i11) {
                        if ((j12 & j10) < 128) {
                            int i13 = iArr[(i10 << 3) + i12];
                            m2 m2Var = (m2) a0().c(i13);
                            o2.m b11 = m2Var != null ? m2Var.b() : null;
                            if (b11 == null || !b11.w().i(o2.p.f30605a.v())) {
                                zVar.f(i13);
                                l2 l2Var = (l2) this.I.c(i13);
                                K0(i13, 32, (l2Var == null || (b10 = l2Var.b()) == null) ? null : (String) o2.j.a(b10, o2.p.f30605a.v()));
                            }
                        }
                        j12 >>= 8;
                        i12++;
                        j10 = 255;
                    }
                    if (i11 != 8) {
                        break;
                    }
                }
                if (i10 == length) {
                    break;
                }
                i10++;
                j10 = 255;
                j11 = -9187201950435737472L;
            }
        }
        this.C.r(zVar);
        this.I.i();
        androidx.collection.l a02 = a0();
        int[] iArr2 = a02.f1339b;
        Object[] objArr = a02.f1340c;
        long[] jArr2 = a02.f1338a;
        int length2 = jArr2.length - 2;
        if (length2 >= 0) {
            int i14 = 0;
            while (true) {
                long j13 = jArr2[i14];
                if ((((~j13) << c10) & j13 & (-9187201950435737472L)) != -9187201950435737472L) {
                    int i15 = 8 - ((~(i14 - length2)) >>> 31);
                    for (int i16 = 0; i16 < i15; i16++) {
                        if ((j13 & 255) < 128) {
                            int i17 = (i14 << 3) + i16;
                            int i18 = iArr2[i17];
                            m2 m2Var2 = (m2) objArr[i17];
                            o2.i w10 = m2Var2.b().w();
                            o2.p pVar = o2.p.f30605a;
                            if (w10.i(pVar.v()) && this.C.f(i18)) {
                                K0(i18, 16, (String) m2Var2.b().w().x(pVar.v()));
                            }
                            this.I.t(i18, new l2(m2Var2.b(), a0()));
                        }
                        j13 >>= 8;
                    }
                    if (i15 != 8) {
                        break;
                    }
                }
                if (i14 == length2) {
                    break;
                }
                i14++;
                c10 = 7;
            }
        }
        this.J = new l2(this.f2725d.getSemanticsOwner().a(), a0());
    }

    private final q2.d h0(o2.m mVar) {
        q2.d dVar;
        Object e02;
        q2.d k02 = k0(mVar.w());
        List list = (List) o2.j.a(mVar.w(), o2.p.f30605a.D());
        if (list != null) {
            e02 = sm.c0.e0(list);
            dVar = (q2.d) e02;
        } else {
            dVar = null;
        }
        return k02 == null ? dVar : k02;
    }

    private final String i0(o2.m mVar) {
        Object e02;
        if (mVar == null) {
            return null;
        }
        o2.i w10 = mVar.w();
        o2.p pVar = o2.p.f30605a;
        if (w10.i(pVar.d())) {
            return e3.a.d((List) mVar.w().x(pVar.d()), ",", null, null, 0, null, null, 62, null);
        }
        if (mVar.w().i(pVar.g())) {
            q2.d k02 = k0(mVar.w());
            if (k02 != null) {
                return k02.j();
            }
            return null;
        }
        List list = (List) o2.j.a(mVar.w(), pVar.D());
        if (list == null) {
            return null;
        }
        e02 = sm.c0.e0(list);
        q2.d dVar = (q2.d) e02;
        if (dVar != null) {
            return dVar.j();
        }
        return null;
    }

    private final androidx.compose.ui.platform.g j0(o2.m mVar, int i10) {
        q2.j0 e10;
        if (mVar == null) {
            return null;
        }
        String i02 = i0(mVar);
        if (i02 == null || i02.length() == 0) {
            return null;
        }
        if (i10 == 1) {
            androidx.compose.ui.platform.c a10 = androidx.compose.ui.platform.c.f2341d.a(this.f2725d.getContext().getResources().getConfiguration().locale);
            a10.e(i02);
            return a10;
        }
        if (i10 == 2) {
            androidx.compose.ui.platform.h a11 = androidx.compose.ui.platform.h.f2442d.a(this.f2725d.getContext().getResources().getConfiguration().locale);
            a11.e(i02);
            return a11;
        }
        if (i10 != 4) {
            if (i10 == 8) {
                androidx.compose.ui.platform.f a12 = androidx.compose.ui.platform.f.f2427c.a();
                a12.e(i02);
                return a12;
            }
            if (i10 != 16) {
                return null;
            }
        }
        if (!mVar.w().i(o2.h.f30560a.i()) || (e10 = n2.e(mVar.w())) == null) {
            return null;
        }
        if (i10 == 4) {
            androidx.compose.ui.platform.d a13 = androidx.compose.ui.platform.d.f2409d.a();
            a13.j(i02, e10);
            return a13;
        }
        androidx.compose.ui.platform.e a14 = androidx.compose.ui.platform.e.f2418f.a();
        a14.j(i02, e10, mVar);
        return a14;
    }

    private final q2.d k0(o2.i iVar) {
        return (q2.d) o2.j.a(iVar, o2.p.f30605a.g());
    }

    private final boolean n0(int i10) {
        return this.f2736o == i10;
    }

    private final boolean o0(o2.m mVar) {
        o2.i w10 = mVar.w();
        o2.p pVar = o2.p.f30605a;
        return !w10.i(pVar.d()) && mVar.w().i(pVar.g());
    }

    private final boolean q0(o2.m mVar) {
        String str;
        Object e02;
        List list = (List) o2.j.a(mVar.w(), o2.p.f30605a.d());
        if (list != null) {
            e02 = sm.c0.e0(list);
            str = (String) e02;
        } else {
            str = null;
        }
        boolean z10 = (str == null && h0(mVar) == null && g0(mVar) == null && !f0(mVar)) ? false : true;
        if (n2.g(mVar)) {
            return mVar.w().D() || (mVar.A() && z10);
        }
        return false;
    }

    private final boolean r0() {
        return this.f2729h || (this.f2728g.isEnabled() && this.f2728g.isTouchExplorationEnabled());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void s0(j2.g0 g0Var) {
        if (this.f2745x.add(g0Var)) {
            this.f2746y.n(rm.n0.f34904a);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:101:0x018f A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:111:0x01ad A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:112:0x01ae  */
    /* JADX WARN: Type inference failed for: r0v30 */
    /* JADX WARN: Type inference failed for: r0v31 */
    /* JADX WARN: Type inference failed for: r0v87 */
    /* JADX WARN: Type inference failed for: r1v21 */
    /* JADX WARN: Type inference failed for: r1v22 */
    /* JADX WARN: Type inference failed for: r1v40 */
    /* JADX WARN: Type inference failed for: r2v16 */
    /* JADX WARN: Type inference failed for: r2v17 */
    /* JADX WARN: Type inference failed for: r2v18 */
    /* JADX WARN: Type inference failed for: r2v19 */
    /* JADX WARN: Type inference failed for: r2v21, types: [java.lang.Comparable] */
    /* JADX WARN: Type inference failed for: r2v35 */
    /* JADX WARN: Type inference failed for: r2v36 */
    /* JADX WARN: Type inference failed for: r3v10, types: [java.lang.Comparable] */
    /* JADX WARN: Type inference failed for: r3v14, types: [java.lang.Comparable] */
    /* JADX WARN: Type inference failed for: r3v27 */
    /* JADX WARN: Type inference failed for: r3v7 */
    /* JADX WARN: Type inference failed for: r3v8 */
    /* JADX WARN: Type inference failed for: r4v7, types: [java.lang.Comparable] */
    /* JADX WARN: Type inference failed for: r5v15 */
    /* JADX WARN: Type inference failed for: r5v16 */
    /* JADX WARN: Type inference failed for: r5v18 */
    /* JADX WARN: Type inference failed for: r5v26 */
    /* JADX WARN: Type inference failed for: r5v27 */
    /* JADX WARN: Type inference failed for: r5v30 */
    /* JADX WARN: Type inference failed for: r8v4 */
    /* JADX WARN: Type inference failed for: r8v5 */
    /* JADX WARN: Type inference failed for: r8v6 */
    /* JADX WARN: Type inference failed for: r9v1 */
    /* JADX WARN: Type inference failed for: r9v12 */
    /* JADX WARN: Type inference failed for: r9v2 */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:121:0x018c -> B:85:0x018d). Please report as a decompilation issue!!! */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean v0(int i10, int i11, Bundle bundle) {
        o2.m b10;
        dn.a aVar;
        boolean h10;
        dn.a aVar2;
        dn.a aVar3;
        dn.a aVar4;
        float c10;
        float f10;
        float f11;
        int i12;
        dn.a aVar5;
        boolean k10;
        dn.a aVar6;
        dn.a aVar7;
        dn.a aVar8;
        dn.a aVar9;
        dn.a aVar10;
        dn.a aVar11;
        dn.l lVar;
        o2.a aVar12;
        boolean k11;
        dn.p pVar;
        o2.i w10;
        o2.i w11;
        o2.a aVar13;
        dn.l lVar2;
        dn.a aVar14;
        dn.a aVar15;
        dn.a aVar16;
        dn.a aVar17;
        dn.a aVar18;
        List list;
        m2 m2Var = (m2) a0().c(i10);
        if (m2Var == null || (b10 = m2Var.b()) == null) {
            return false;
        }
        if (i11 == 64) {
            return C0(i10);
        }
        if (i11 == 128) {
            return Q(i10);
        }
        if (i11 == 256 || i11 == 512) {
            if (bundle != null) {
                return d1(b10, bundle.getInt("ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT"), i11 == 256, bundle.getBoolean("ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN"));
            }
            return false;
        }
        if (i11 == 16384) {
            o2.a aVar19 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.c());
            if (aVar19 == null || (aVar = (dn.a) aVar19.a()) == null) {
                return false;
            }
            return ((Boolean) aVar.invoke()).booleanValue();
        }
        if (i11 == 131072) {
            boolean P0 = P0(b10, bundle != null ? bundle.getInt("ACTION_ARGUMENT_SELECTION_START_INT", -1) : -1, bundle != null ? bundle.getInt("ACTION_ARGUMENT_SELECTION_END_INT", -1) : -1, false);
            if (P0) {
                J0(this, F0(b10.o()), 0, null, null, 12, null);
            }
            return P0;
        }
        h10 = a0.h(b10);
        if (!h10) {
            return false;
        }
        if (i11 == 1) {
            o2.a aVar20 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.s());
            if (aVar20 == null || (aVar2 = (dn.a) aVar20.a()) == null) {
                return false;
            }
            return ((Boolean) aVar2.invoke()).booleanValue();
        }
        if (i11 == 2) {
            if (!kotlin.jvm.internal.t.b(o2.j.a(b10.w(), o2.p.f30605a.i()), Boolean.TRUE)) {
                return false;
            }
            this.f2725d.getFocusOwner().f(false, true, true, androidx.compose.ui.focus.d.f2163b.c());
            return true;
        }
        Boolean bool = null;
        bool = null;
        switch (i11) {
            case 16:
                o2.a aVar21 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.k());
                if (aVar21 != null && (aVar3 = (dn.a) aVar21.a()) != null) {
                    bool = (Boolean) aVar3.invoke();
                }
                Boolean bool2 = bool;
                J0(this, i10, 1, null, null, 12, null);
                if (bool2 != null) {
                    return bool2.booleanValue();
                }
                return false;
            case 32:
                o2.a aVar22 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.m());
                if (aVar22 == null || (aVar4 = (dn.a) aVar22.a()) == null) {
                    return false;
                }
                return ((Boolean) aVar4.invoke()).booleanValue();
            case 4096:
            case UserMetadata.MAX_INTERNAL_KEY_SIZE /* 8192 */:
                break;
            case 32768:
                o2.a aVar23 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.r());
                if (aVar23 == null || (aVar7 = (dn.a) aVar23.a()) == null) {
                    return false;
                }
                return ((Boolean) aVar7.invoke()).booleanValue();
            case 65536:
                o2.a aVar24 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.e());
                if (aVar24 == null || (aVar8 = (dn.a) aVar24.a()) == null) {
                    return false;
                }
                return ((Boolean) aVar8.invoke()).booleanValue();
            case 262144:
                o2.a aVar25 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.g());
                if (aVar25 == null || (aVar9 = (dn.a) aVar25.a()) == null) {
                    return false;
                }
                return ((Boolean) aVar9.invoke()).booleanValue();
            case 524288:
                o2.a aVar26 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.b());
                if (aVar26 == null || (aVar10 = (dn.a) aVar26.a()) == null) {
                    return false;
                }
                return ((Boolean) aVar10.invoke()).booleanValue();
            case 1048576:
                o2.a aVar27 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.f());
                if (aVar27 == null || (aVar11 = (dn.a) aVar27.a()) == null) {
                    return false;
                }
                return ((Boolean) aVar11.invoke()).booleanValue();
            case 2097152:
                String string = bundle != null ? bundle.getString("ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE") : null;
                o2.a aVar28 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.y());
                if (aVar28 == null || (lVar = (dn.l) aVar28.a()) == null) {
                    return false;
                }
                if (string == null) {
                    string = "";
                }
                return ((Boolean) lVar.invoke(new q2.d(string, null, null, 6, null))).booleanValue();
            case R.id.accessibilityActionShowOnScreen:
                o2.m r10 = b10.r();
                if (r10 != null && (w11 = r10.w()) != null) {
                    aVar12 = (o2.a) o2.j.a(w11, o2.h.f30560a.t());
                    while (r10 != null && aVar12 == null) {
                        r10 = r10.r();
                        if (r10 != null && (w10 = r10.w()) != null) {
                            aVar12 = (o2.a) o2.j.a(w10, o2.h.f30560a.t());
                        }
                    }
                    if (r10 != null) {
                        return false;
                    }
                    r1.i a10 = h2.t.a(r10.p().r());
                    h2.s i02 = r10.p().r().i0();
                    r1.i t10 = a10.t(i02 != null ? h2.t.e(i02) : r1.g.f34318b.c());
                    r1.i b11 = r1.j.b(b10.s(), c3.s.d(b10.u()));
                    o2.i w12 = r10.w();
                    o2.p pVar2 = o2.p.f30605a;
                    o2.g gVar = (o2.g) o2.j.a(w12, pVar2.k());
                    o2.g gVar2 = (o2.g) o2.j.a(r10.w(), pVar2.I());
                    float x02 = x0(b11.i() - t10.i(), b11.j() - t10.j());
                    if ((gVar != null && gVar.b()) != false) {
                        x02 = -x02;
                    }
                    k11 = a0.k(b10);
                    if (k11) {
                        x02 = -x02;
                    }
                    float x03 = x0(b11.l() - t10.l(), b11.e() - t10.e());
                    if (gVar2 != null && gVar2.b()) {
                        x03 = -x03;
                    }
                    if (aVar12 == null || (pVar = (dn.p) aVar12.a()) == null) {
                        return false;
                    }
                    return ((Boolean) pVar.invoke(Float.valueOf(x02), Float.valueOf(x03))).booleanValue();
                }
                aVar12 = null;
                while (r10 != null) {
                    r10 = r10.r();
                    if (r10 != null) {
                        aVar12 = (o2.a) o2.j.a(w10, o2.h.f30560a.t());
                    }
                    aVar12 = null;
                    while (r10 != null) {
                    }
                }
                if (r10 != null) {
                }
                break;
            case R.id.accessibilityActionSetProgress:
                if (bundle == null || !bundle.containsKey("android.view.accessibility.action.ARGUMENT_PROGRESS_VALUE") || (aVar13 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.w())) == null || (lVar2 = (dn.l) aVar13.a()) == null) {
                    return false;
                }
                return ((Boolean) lVar2.invoke(Float.valueOf(bundle.getFloat("android.view.accessibility.action.ARGUMENT_PROGRESS_VALUE")))).booleanValue();
            case R.id.accessibilityActionImeEnter:
                o2.a aVar29 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.l());
                if (aVar29 == null || (aVar14 = (dn.a) aVar29.a()) == null) {
                    return false;
                }
                return ((Boolean) aVar14.invoke()).booleanValue();
            default:
                switch (i11) {
                    case R.id.accessibilityActionScrollUp:
                    case R.id.accessibilityActionScrollLeft:
                    case R.id.accessibilityActionScrollDown:
                    case R.id.accessibilityActionScrollRight:
                        break;
                    default:
                        switch (i11) {
                            case R.id.accessibilityActionPageUp:
                                o2.a aVar30 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.q());
                                if (aVar30 == null || (aVar15 = (dn.a) aVar30.a()) == null) {
                                    return false;
                                }
                                return ((Boolean) aVar15.invoke()).booleanValue();
                            case R.id.accessibilityActionPageDown:
                                o2.a aVar31 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.n());
                                if (aVar31 == null || (aVar16 = (dn.a) aVar31.a()) == null) {
                                    return false;
                                }
                                return ((Boolean) aVar16.invoke()).booleanValue();
                            case R.id.accessibilityActionPageLeft:
                                o2.a aVar32 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.o());
                                if (aVar32 == null || (aVar17 = (dn.a) aVar32.a()) == null) {
                                    return false;
                                }
                                return ((Boolean) aVar17.invoke()).booleanValue();
                            case R.id.accessibilityActionPageRight:
                                o2.a aVar33 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.p());
                                if (aVar33 == null || (aVar18 = (dn.a) aVar33.a()) == null) {
                                    return false;
                                }
                                return ((Boolean) aVar18.invoke()).booleanValue();
                            default:
                                androidx.collection.u0 u0Var = (androidx.collection.u0) this.f2741t.h(i10);
                                if (u0Var == null || ((CharSequence) u0Var.h(i11)) == null || (list = (List) o2.j.a(b10.w(), o2.h.f30560a.d())) == null || list.size() <= 0) {
                                    return false;
                                }
                                android.support.v4.media.session.b.a(list.get(0));
                                throw null;
                        }
                }
        }
        ?? r02 = i11 == 4096;
        ?? r12 = i11 == 8192;
        ?? r32 = i11 == 16908345;
        ?? r52 = i11 == 16908347;
        ?? r82 = i11 == 16908344;
        ?? r22 = i11 == 16908346;
        ?? r92 = r32 == true || r52 == true || r02 == true || r12 == true;
        ?? r23 = r82 == true || r22 == true || r02 == true || r12 == true;
        if (r02 != false || r12 != false) {
            o2.e eVar = (o2.e) o2.j.a(b10.w(), o2.p.f30605a.x());
            o2.a aVar34 = (o2.a) o2.j.a(b10.w(), o2.h.f30560a.w());
            if (eVar != null && aVar34 != null) {
                c10 = jn.o.c(((Number) eVar.c().e()).floatValue(), ((Number) eVar.c().i()).floatValue());
                f10 = jn.o.f(((Number) eVar.c().i()).floatValue(), ((Number) eVar.c().e()).floatValue());
                if (eVar.d() > 0) {
                    f11 = c10 - f10;
                    i12 = eVar.d() + 1;
                } else {
                    f11 = c10 - f10;
                    i12 = 20;
                }
                float f12 = f11 / i12;
                if (r12 != false) {
                    f12 = -f12;
                }
                dn.l lVar3 = (dn.l) aVar34.a();
                if (lVar3 != null) {
                    return ((Boolean) lVar3.invoke(Float.valueOf(eVar.b() + f12))).booleanValue();
                }
                return false;
            }
        }
        long k12 = h2.t.a(b10.p().r()).k();
        Float d10 = n2.d(b10.w());
        o2.i w13 = b10.w();
        o2.h hVar = o2.h.f30560a;
        o2.a aVar35 = (o2.a) o2.j.a(w13, hVar.t());
        if (aVar35 == null) {
            return false;
        }
        o2.i w14 = b10.w();
        o2.p pVar3 = o2.p.f30605a;
        o2.g gVar3 = (o2.g) o2.j.a(w14, pVar3.k());
        if (gVar3 != null && r92 != false) {
            float floatValue = d10 != null ? d10.floatValue() : r1.m.i(k12);
            if (r32 != false || r12 != false) {
                floatValue = -floatValue;
            }
            if (gVar3.b()) {
                floatValue = -floatValue;
            }
            k10 = a0.k(b10);
            if (k10 && (r32 != false || r52 != false)) {
                floatValue = -floatValue;
            }
            if (w0(gVar3, floatValue)) {
                if (!(b10.w().i(hVar.o()) || b10.w().i(hVar.p()))) {
                    dn.p pVar4 = (dn.p) aVar35.a();
                    if (pVar4 != null) {
                        return ((Boolean) pVar4.invoke(Float.valueOf(floatValue), Float.valueOf(BitmapDescriptorFactory.HUE_RED))).booleanValue();
                    }
                    return false;
                }
                o2.a aVar36 = floatValue > BitmapDescriptorFactory.HUE_RED ? (o2.a) o2.j.a(b10.w(), hVar.p()) : (o2.a) o2.j.a(b10.w(), hVar.o());
                if (aVar36 == null || (aVar6 = (dn.a) aVar36.a()) == null) {
                    return false;
                }
                return ((Boolean) aVar6.invoke()).booleanValue();
            }
        }
        o2.g gVar4 = (o2.g) o2.j.a(b10.w(), pVar3.I());
        if (gVar4 == null || !r23 == true) {
            return false;
        }
        float floatValue2 = d10 != null ? d10.floatValue() : r1.m.g(k12);
        if (r82 != false || r12 != false) {
            floatValue2 = -floatValue2;
        }
        if (gVar4.b()) {
            floatValue2 = -floatValue2;
        }
        if (!w0(gVar4, floatValue2)) {
            return false;
        }
        if (!(b10.w().i(hVar.q()) || b10.w().i(hVar.n()))) {
            dn.p pVar5 = (dn.p) aVar35.a();
            if (pVar5 != null) {
                return ((Boolean) pVar5.invoke(Float.valueOf(BitmapDescriptorFactory.HUE_RED), Float.valueOf(floatValue2))).booleanValue();
            }
            return false;
        }
        o2.a aVar37 = floatValue2 > BitmapDescriptorFactory.HUE_RED ? (o2.a) o2.j.a(b10.w(), hVar.n()) : (o2.a) o2.j.a(b10.w(), hVar.q());
        if (aVar37 == null || (aVar5 = (dn.a) aVar37.a()) == null) {
            return false;
        }
        return ((Boolean) aVar5.invoke()).booleanValue();
    }

    private static final boolean w0(o2.g gVar, float f10) {
        return (f10 < BitmapDescriptorFactory.HUE_RED && ((Number) gVar.c().invoke()).floatValue() > BitmapDescriptorFactory.HUE_RED) || (f10 > BitmapDescriptorFactory.HUE_RED && ((Number) gVar.c().invoke()).floatValue() < ((Number) gVar.a().invoke()).floatValue());
    }

    private static final float x0(float f10, float f11) {
        return (Math.signum(f10) > Math.signum(f11) ? 1 : (Math.signum(f10) == Math.signum(f11) ? 0 : -1)) == 0 ? Math.abs(f10) < Math.abs(f11) ? f10 : f11 : BitmapDescriptorFactory.HUE_RED;
    }

    private final void y0(int i10, t3.h hVar, o2.m mVar) {
        String str;
        Object e02;
        boolean h10;
        boolean h11;
        boolean h12;
        View h13;
        boolean h14;
        boolean h15;
        boolean k10;
        boolean k11;
        boolean h16;
        float c10;
        float f10;
        boolean i11;
        boolean h17;
        boolean z10;
        boolean h18;
        boolean z11;
        hVar.g0("android.view.View");
        o2.i w10 = mVar.w();
        o2.p pVar = o2.p.f30605a;
        if (w10.i(pVar.g())) {
            hVar.g0("android.widget.EditText");
        }
        if (mVar.w().i(pVar.D())) {
            hVar.g0("android.widget.TextView");
        }
        o2.f fVar = (o2.f) o2.j.a(mVar.w(), pVar.y());
        if (fVar != null) {
            fVar.n();
            if (mVar.x() || mVar.t().isEmpty()) {
                f.a aVar = o2.f.f30548b;
                if (o2.f.k(fVar.n(), aVar.g())) {
                    hVar.F0(this.f2725d.getContext().getResources().getString(l1.n.f27415l));
                } else if (o2.f.k(fVar.n(), aVar.f())) {
                    hVar.F0(this.f2725d.getContext().getResources().getString(l1.n.f27414k));
                } else {
                    String i12 = n2.i(fVar.n());
                    if (!o2.f.k(fVar.n(), aVar.d()) || mVar.A() || mVar.w().D()) {
                        hVar.g0(i12);
                    }
                }
            }
            rm.n0 n0Var = rm.n0.f34904a;
        }
        hVar.z0(this.f2725d.getContext().getPackageName());
        hVar.u0(n2.f(mVar));
        List t10 = mVar.t();
        int size = t10.size();
        for (int i13 = 0; i13 < size; i13++) {
            o2.m mVar2 = (o2.m) t10.get(i13);
            if (a0().a(mVar2.o())) {
                androidx.compose.ui.viewinterop.c cVar = this.f2725d.getAndroidViewsHandler$ui_release().getLayoutNodeToHolder().get(mVar2.q());
                if (mVar2.o() != -1) {
                    if (cVar != null) {
                        hVar.c(cVar);
                    } else {
                        hVar.d(this.f2725d, mVar2.o());
                    }
                }
            }
        }
        if (i10 == this.f2736o) {
            hVar.a0(true);
            hVar.b(h.a.f36137l);
        } else {
            hVar.a0(false);
            hVar.b(h.a.f36136k);
        }
        U0(mVar, hVar);
        Q0(mVar, hVar);
        T0(mVar, hVar);
        R0(mVar, hVar);
        o2.i w11 = mVar.w();
        o2.p pVar2 = o2.p.f30605a;
        p2.a aVar2 = (p2.a) o2.j.a(w11, pVar2.G());
        if (aVar2 != null) {
            if (aVar2 == p2.a.On) {
                hVar.f0(true);
            } else if (aVar2 == p2.a.Off) {
                hVar.f0(false);
            }
            rm.n0 n0Var2 = rm.n0.f34904a;
        }
        Boolean bool = (Boolean) o2.j.a(mVar.w(), pVar2.A());
        if (bool != null) {
            boolean booleanValue = bool.booleanValue();
            if (fVar == null ? false : o2.f.k(fVar.n(), o2.f.f30548b.g())) {
                hVar.I0(booleanValue);
            } else {
                hVar.f0(booleanValue);
            }
            rm.n0 n0Var3 = rm.n0.f34904a;
        }
        if (!mVar.w().D() || mVar.t().isEmpty()) {
            List list = (List) o2.j.a(mVar.w(), pVar2.d());
            if (list != null) {
                e02 = sm.c0.e0(list);
                str = (String) e02;
            } else {
                str = null;
            }
            hVar.k0(str);
        }
        String str2 = (String) o2.j.a(mVar.w(), pVar2.C());
        if (str2 != null) {
            o2.m mVar3 = mVar;
            while (true) {
                if (mVar3 == null) {
                    z11 = false;
                    break;
                }
                o2.i w12 = mVar3.w();
                o2.q qVar = o2.q.f30642a;
                if (w12.i(qVar.a())) {
                    z11 = ((Boolean) mVar3.w().x(qVar.a())).booleanValue();
                    break;
                }
                mVar3 = mVar3.r();
            }
            if (z11) {
                hVar.S0(str2);
            }
        }
        o2.i w13 = mVar.w();
        o2.p pVar3 = o2.p.f30605a;
        if (((rm.n0) o2.j.a(w13, pVar3.j())) != null) {
            hVar.s0(true);
            rm.n0 n0Var4 = rm.n0.f34904a;
        }
        hVar.D0(mVar.w().i(pVar3.w()));
        hVar.n0(mVar.w().i(pVar3.p()));
        Integer num = (Integer) o2.j.a(mVar.w(), pVar3.u());
        hVar.x0(num != null ? num.intValue() : -1);
        h10 = a0.h(mVar);
        hVar.o0(h10);
        hVar.q0(mVar.w().i(pVar3.i()));
        if (hVar.J()) {
            hVar.r0(((Boolean) mVar.w().x(pVar3.i())).booleanValue());
            if (hVar.K()) {
                hVar.a(2);
            } else {
                hVar.a(1);
            }
        }
        hVar.T0(n2.g(mVar));
        android.support.v4.media.session.b.a(o2.j.a(mVar.w(), pVar3.t()));
        hVar.h0(false);
        o2.i w14 = mVar.w();
        o2.h hVar2 = o2.h.f30560a;
        o2.a aVar3 = (o2.a) o2.j.a(w14, hVar2.k());
        if (aVar3 != null) {
            boolean b10 = kotlin.jvm.internal.t.b(o2.j.a(mVar.w(), pVar3.A()), Boolean.TRUE);
            f.a aVar4 = o2.f.f30548b;
            if (!(fVar == null ? false : o2.f.k(fVar.n(), aVar4.g()))) {
                if (!(fVar == null ? false : o2.f.k(fVar.n(), aVar4.e()))) {
                    z10 = false;
                    hVar.h0(z10 || (z10 && !b10));
                    h18 = a0.h(mVar);
                    if (h18 && hVar.G()) {
                        hVar.b(new h.a(16, aVar3.b()));
                    }
                    rm.n0 n0Var5 = rm.n0.f34904a;
                }
            }
            z10 = true;
            hVar.h0(z10 || (z10 && !b10));
            h18 = a0.h(mVar);
            if (h18) {
                hVar.b(new h.a(16, aVar3.b()));
            }
            rm.n0 n0Var52 = rm.n0.f34904a;
        }
        hVar.w0(false);
        o2.a aVar5 = (o2.a) o2.j.a(mVar.w(), hVar2.m());
        if (aVar5 != null) {
            hVar.w0(true);
            h17 = a0.h(mVar);
            if (h17) {
                hVar.b(new h.a(32, aVar5.b()));
            }
            rm.n0 n0Var6 = rm.n0.f34904a;
        }
        o2.a aVar6 = (o2.a) o2.j.a(mVar.w(), hVar2.c());
        if (aVar6 != null) {
            hVar.b(new h.a(16384, aVar6.b()));
            rm.n0 n0Var7 = rm.n0.f34904a;
        }
        h11 = a0.h(mVar);
        if (h11) {
            o2.a aVar7 = (o2.a) o2.j.a(mVar.w(), hVar2.y());
            if (aVar7 != null) {
                hVar.b(new h.a(2097152, aVar7.b()));
                rm.n0 n0Var8 = rm.n0.f34904a;
            }
            o2.a aVar8 = (o2.a) o2.j.a(mVar.w(), hVar2.l());
            if (aVar8 != null) {
                hVar.b(new h.a(R.id.accessibilityActionImeEnter, aVar8.b()));
                rm.n0 n0Var9 = rm.n0.f34904a;
            }
            o2.a aVar9 = (o2.a) o2.j.a(mVar.w(), hVar2.e());
            if (aVar9 != null) {
                hVar.b(new h.a(65536, aVar9.b()));
                rm.n0 n0Var10 = rm.n0.f34904a;
            }
            o2.a aVar10 = (o2.a) o2.j.a(mVar.w(), hVar2.r());
            if (aVar10 != null) {
                if (hVar.K() && this.f2725d.getClipboardManager().b()) {
                    hVar.b(new h.a(32768, aVar10.b()));
                }
                rm.n0 n0Var11 = rm.n0.f34904a;
            }
        }
        String i02 = i0(mVar);
        if (!(i02 == null || i02.length() == 0)) {
            hVar.N0(Z(mVar), Y(mVar));
            o2.a aVar11 = (o2.a) o2.j.a(mVar.w(), hVar2.x());
            hVar.b(new h.a(131072, aVar11 != null ? aVar11.b() : null));
            hVar.a(256);
            hVar.a(512);
            hVar.y0(11);
            List list2 = (List) o2.j.a(mVar.w(), pVar3.d());
            if ((list2 == null || list2.isEmpty()) && mVar.w().i(hVar2.i())) {
                i11 = a0.i(mVar);
                if (!i11) {
                    hVar.y0(hVar.v() | 4 | 16);
                }
            }
        }
        ArrayList arrayList = new ArrayList();
        arrayList.add("androidx.compose.ui.semantics.id");
        CharSequence y10 = hVar.y();
        if (!(y10 == null || y10.length() == 0) && mVar.w().i(hVar2.i())) {
            arrayList.add("android.view.accessibility.extra.DATA_TEXT_CHARACTER_LOCATION_KEY");
        }
        if (mVar.w().i(pVar3.C())) {
            arrayList.add("androidx.compose.ui.semantics.testTag");
        }
        hVar.b0(arrayList);
        o2.e eVar = (o2.e) o2.j.a(mVar.w(), pVar3.x());
        if (eVar != null) {
            if (mVar.w().i(hVar2.w())) {
                hVar.g0("android.widget.SeekBar");
            } else {
                hVar.g0("android.widget.ProgressBar");
            }
            if (eVar != o2.e.f30543d.a()) {
                hVar.E0(h.g.a(1, ((Number) eVar.c().i()).floatValue(), ((Number) eVar.c().e()).floatValue(), eVar.b()));
            }
            if (mVar.w().i(hVar2.w())) {
                h16 = a0.h(mVar);
                if (h16) {
                    float b11 = eVar.b();
                    c10 = jn.o.c(((Number) eVar.c().e()).floatValue(), ((Number) eVar.c().i()).floatValue());
                    if (b11 < c10) {
                        hVar.b(h.a.f36142q);
                    }
                    float b12 = eVar.b();
                    f10 = jn.o.f(((Number) eVar.c().i()).floatValue(), ((Number) eVar.c().e()).floatValue());
                    if (b12 > f10) {
                        hVar.b(h.a.f36143r);
                    }
                }
            }
        }
        b.a(hVar, mVar);
        k2.a.d(mVar, hVar);
        k2.a.e(mVar, hVar);
        o2.g gVar = (o2.g) o2.j.a(mVar.w(), pVar3.k());
        o2.a aVar12 = (o2.a) o2.j.a(mVar.w(), hVar2.t());
        if (gVar != null && aVar12 != null) {
            if (!k2.a.b(mVar)) {
                hVar.g0("android.widget.HorizontalScrollView");
            }
            if (((Number) gVar.a().invoke()).floatValue() > BitmapDescriptorFactory.HUE_RED) {
                hVar.H0(true);
            }
            h15 = a0.h(mVar);
            if (h15) {
                if (A0(gVar)) {
                    hVar.b(h.a.f36142q);
                    k11 = a0.k(mVar);
                    hVar.b(!k11 ? h.a.F : h.a.D);
                }
                if (z0(gVar)) {
                    hVar.b(h.a.f36143r);
                    k10 = a0.k(mVar);
                    hVar.b(!k10 ? h.a.D : h.a.F);
                }
            }
        }
        o2.g gVar2 = (o2.g) o2.j.a(mVar.w(), pVar3.I());
        if (gVar2 != null && aVar12 != null) {
            if (!k2.a.b(mVar)) {
                hVar.g0("android.widget.ScrollView");
            }
            if (((Number) gVar2.a().invoke()).floatValue() > BitmapDescriptorFactory.HUE_RED) {
                hVar.H0(true);
            }
            h14 = a0.h(mVar);
            if (h14) {
                if (A0(gVar2)) {
                    hVar.b(h.a.f36142q);
                    hVar.b(h.a.E);
                }
                if (z0(gVar2)) {
                    hVar.b(h.a.f36143r);
                    hVar.b(h.a.C);
                }
            }
        }
        c.a(hVar, mVar);
        hVar.A0((CharSequence) o2.j.a(mVar.w(), pVar3.v()));
        h12 = a0.h(mVar);
        if (h12) {
            o2.a aVar13 = (o2.a) o2.j.a(mVar.w(), hVar2.g());
            if (aVar13 != null) {
                hVar.b(new h.a(262144, aVar13.b()));
                rm.n0 n0Var12 = rm.n0.f34904a;
            }
            o2.a aVar14 = (o2.a) o2.j.a(mVar.w(), hVar2.b());
            if (aVar14 != null) {
                hVar.b(new h.a(524288, aVar14.b()));
                rm.n0 n0Var13 = rm.n0.f34904a;
            }
            o2.a aVar15 = (o2.a) o2.j.a(mVar.w(), hVar2.f());
            if (aVar15 != null) {
                hVar.b(new h.a(1048576, aVar15.b()));
                rm.n0 n0Var14 = rm.n0.f34904a;
            }
            if (mVar.w().i(hVar2.d())) {
                List list3 = (List) mVar.w().x(hVar2.d());
                int size2 = list3.size();
                androidx.collection.j jVar = Q;
                if (size2 >= jVar.b()) {
                    throw new IllegalStateException("Can't have more than " + jVar.b() + " custom actions for one widget");
                }
                androidx.collection.u0 u0Var = new androidx.collection.u0(0, 1, null);
                androidx.collection.d0 b13 = androidx.collection.k0.b();
                if (this.f2742u.d(i10)) {
                    androidx.collection.d0 d0Var = (androidx.collection.d0) this.f2742u.h(i10);
                    androidx.collection.x xVar = new androidx.collection.x(0, 1, null);
                    int[] iArr = jVar.f1329a;
                    int i14 = jVar.f1330b;
                    for (int i15 = 0; i15 < i14; i15++) {
                        xVar.f(iArr[i15]);
                    }
                    ArrayList arrayList2 = new ArrayList();
                    if (list3.size() > 0) {
                        android.support.v4.media.session.b.a(list3.get(0));
                        kotlin.jvm.internal.t.d(d0Var);
                        throw null;
                    }
                    if (arrayList2.size() > 0) {
                        android.support.v4.media.session.b.a(arrayList2.get(0));
                        xVar.a(0);
                        throw null;
                    }
                } else if (list3.size() > 0) {
                    android.support.v4.media.session.b.a(list3.get(0));
                    jVar.a(0);
                    throw null;
                }
                this.f2741t.n(i10, u0Var);
                this.f2742u.n(i10, b13);
            }
        }
        hVar.G0(q0(mVar));
        int e10 = this.D.e(i10, -1);
        if (e10 != -1) {
            View h19 = n2.h(this.f2725d.getAndroidViewsHandler$ui_release(), e10);
            if (h19 != null) {
                hVar.Q0(h19);
            } else {
                hVar.R0(this.f2725d, e10);
            }
            K(i10, hVar, this.F, null);
        }
        int e11 = this.E.e(i10, -1);
        if (e11 == -1 || (h13 = n2.h(this.f2725d.getAndroidViewsHandler$ui_release(), e11)) == null) {
            return;
        }
        hVar.O0(h13);
        K(i10, hVar, this.G, null);
    }

    private static final boolean z0(o2.g gVar) {
        return (((Number) gVar.c().invoke()).floatValue() > BitmapDescriptorFactory.HUE_RED && !gVar.b()) || (((Number) gVar.c().invoke()).floatValue() < ((Number) gVar.a().invoke()).floatValue() && gVar.b());
    }

    /* JADX WARN: Code restructure failed: missing block: B:31:0x0069, code lost:
    
        r11 = r2;
        r2 = r6;
     */
    /* JADX WARN: Removed duplicated region for block: B:13:0x0077 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:15:0x0078  */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0084 A[Catch: all -> 0x00e2, TryCatch #0 {all -> 0x00e2, blocks: (B:11:0x0069, B:16:0x007c, B:18:0x0084, B:20:0x008d, B:22:0x0096, B:24:0x00a7, B:26:0x00ae, B:27:0x00b7, B:10:0x005d), top: B:9:0x005d }] */
    /* JADX WARN: Removed duplicated region for block: B:32:0x00da  */
    /* JADX WARN: Removed duplicated region for block: B:39:0x0025 A[EXC_TOP_SPLITTER, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:8:0x005a  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object M(vm.d dVar) {
        k kVar;
        Object f10;
        int i10;
        androidx.collection.z zVar;
        vp.f fVar;
        androidx.collection.z zVar2;
        vp.f fVar2;
        Object b10;
        if (dVar instanceof k) {
            kVar = (k) dVar;
            int i11 = kVar.f2767u;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                kVar.f2767u = i11 - Integer.MIN_VALUE;
                Object obj = kVar.f2765s;
                f10 = wm.d.f();
                i10 = kVar.f2767u;
                if (i10 == 0) {
                    try {
                        if (i10 == 1) {
                            vp.f fVar3 = (vp.f) kVar.f2764r;
                            zVar = (androidx.collection.z) kVar.f2763q;
                            x xVar = (x) kVar.f2762p;
                            rm.y.b(obj);
                            fVar = fVar3;
                            this = xVar;
                            if (((Boolean) obj).booleanValue()) {
                                this.f2745x.clear();
                                return rm.n0.f34904a;
                            }
                            fVar.next();
                            if (this.p0()) {
                                int size = this.f2745x.size();
                                for (int i12 = 0; i12 < size; i12++) {
                                    j2.g0 g0Var = (j2.g0) this.f2745x.D(i12);
                                    this.N0(g0Var, zVar);
                                    this.O0(g0Var);
                                }
                                zVar.h();
                                if (!this.K) {
                                    this.K = true;
                                    this.f2734m.post(this.L);
                                }
                                this.f2745x.clear();
                                this.f2739r.i();
                                this.f2740s.i();
                                long j10 = this.f2730i;
                                kVar.f2762p = this;
                                kVar.f2763q = zVar;
                                kVar.f2764r = fVar;
                                kVar.f2767u = 2;
                                if (tp.w0.a(j10, kVar) == f10) {
                                    return f10;
                                }
                            }
                            zVar2 = zVar;
                            fVar2 = fVar;
                        } else {
                            if (i10 != 2) {
                                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                            }
                            vp.f fVar4 = (vp.f) kVar.f2764r;
                            androidx.collection.z zVar3 = (androidx.collection.z) kVar.f2763q;
                            x xVar2 = (x) kVar.f2762p;
                            rm.y.b(obj);
                            zVar2 = zVar3;
                            fVar2 = fVar4;
                            this = xVar2;
                        }
                    } catch (Throwable th2) {
                        th = th2;
                        r6.f2745x.clear();
                        throw th;
                    }
                } else {
                    rm.y.b(obj);
                    try {
                        zVar2 = new androidx.collection.z(0, 1, null);
                        fVar2 = this.f2746y.iterator();
                    } catch (Throwable th3) {
                        x xVar3 = this;
                        th = th3;
                        xVar3.f2745x.clear();
                        throw th;
                    }
                }
                kVar.f2762p = this;
                kVar.f2763q = zVar2;
                kVar.f2764r = fVar2;
                kVar.f2767u = 1;
                b10 = fVar2.b(kVar);
                if (b10 != f10) {
                    return f10;
                }
                vp.f fVar5 = fVar2;
                zVar = zVar2;
                obj = b10;
                fVar = fVar5;
                if (((Boolean) obj).booleanValue()) {
                }
            }
        }
        kVar = new k(dVar);
        Object obj2 = kVar.f2765s;
        f10 = wm.d.f();
        i10 = kVar.f2767u;
        if (i10 == 0) {
        }
        kVar.f2762p = this;
        kVar.f2763q = zVar2;
        kVar.f2764r = fVar2;
        kVar.f2767u = 1;
        b10 = fVar2.b(kVar);
        if (b10 != f10) {
        }
    }

    public final boolean N(boolean z10, int i10, long j10) {
        if (kotlin.jvm.internal.t.b(Looper.getMainLooper().getThread(), Thread.currentThread())) {
            return O(a0(), z10, i10, j10);
        }
        return false;
    }

    public final void S0(long j10) {
        this.f2730i = j10;
    }

    public final boolean V(MotionEvent motionEvent) {
        if (!r0()) {
            return false;
        }
        int action = motionEvent.getAction();
        if (action == 7 || action == 9) {
            int m02 = m0(motionEvent.getX(), motionEvent.getY());
            boolean dispatchGenericMotionEvent = this.f2725d.getAndroidViewsHandler$ui_release().dispatchGenericMotionEvent(motionEvent);
            f1(m02);
            if (m02 == Integer.MIN_VALUE) {
                return dispatchGenericMotionEvent;
            }
            return true;
        }
        if (action != 10) {
            return false;
        }
        if (this.f2726e == Integer.MIN_VALUE) {
            return this.f2725d.getAndroidViewsHandler$ui_release().dispatchGenericMotionEvent(motionEvent);
        }
        f1(Integer.MIN_VALUE);
        return true;
    }

    @Override // androidx.core.view.a
    public t3.i b(View view) {
        return this.f2735n;
    }

    public final String b0() {
        return this.G;
    }

    public final String c0() {
        return this.F;
    }

    public final androidx.collection.w d0() {
        return this.E;
    }

    public final androidx.collection.w e0() {
        return this.D;
    }

    public final androidx.compose.ui.platform.r l0() {
        return this.f2725d;
    }

    public final int m0(float f10, float f11) {
        int m10;
        int i10;
        j2.j1.A(this.f2725d, false, 1, null);
        j2.u uVar = new j2.u();
        this.f2725d.getRoot().z0(r1.h.a(f10, f11), uVar, (r13 & 4) != 0, (r13 & 8) != 0);
        m10 = sm.u.m(uVar);
        while (true) {
            i10 = Integer.MIN_VALUE;
            if (-1 >= m10) {
                break;
            }
            j2.g0 m11 = j2.k.m(uVar.get(m10));
            if (this.f2725d.getAndroidViewsHandler$ui_release().getLayoutNodeToHolder().get(m11) != null) {
                return Integer.MIN_VALUE;
            }
            if (m11.k0().q(j2.b1.a(8))) {
                i10 = F0(m11.q0());
                if (n2.f(o2.n.a(m11, false))) {
                    break;
                }
            }
            m10--;
        }
        return i10;
    }

    public final boolean p0() {
        if (this.f2729h) {
            return true;
        }
        return this.f2728g.isEnabled() && (this.f2733l.isEmpty() ^ true);
    }

    public final void t0(j2.g0 g0Var) {
        this.f2747z = true;
        if (p0()) {
            s0(g0Var);
        }
    }

    public final void u0() {
        this.f2747z = true;
        if (!p0() || this.K) {
            return;
        }
        this.K = true;
        this.f2734m.post(this.L);
    }
}
