package ඓ.㴹.K;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import ඓ.㴹.K.AbstractC1354;

/* renamed from: ඓ.㴹.K.ʬ  reason: contains not printable characters */
/* compiled from: AnimatorSet */
public final class C1320 extends AbstractC1354 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public ArrayList<AbstractC1354> f5118 = new ArrayList<>();

    /* renamed from: ඓ  reason: contains not printable characters */
    public ArrayList<C1325> f5119 = new ArrayList<>();

    /* renamed from: ᕣ  reason: contains not printable characters */
    public long f5120 = 0;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public boolean f5121 = false;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public boolean f5122 = true;

    /* renamed from: 㑃  reason: contains not printable characters */
    public C1327 f5123 = null;

    /* renamed from: 㳳  reason: contains not printable characters */
    public boolean f5124 = false;

    /* renamed from: 㴹  reason: contains not printable characters */
    public ArrayList<C1325> f5125 = new ArrayList<>();

    /* renamed from: 㸾  reason: contains not printable characters */
    public HashMap<AbstractC1354, C1325> f5126 = new HashMap<>();

    /* renamed from: 㿎  reason: contains not printable characters */
    public C1323 f5127 = null;

    /* renamed from: ඓ.㴹.K.ʬ$ʬ  reason: contains not printable characters */
    /* compiled from: AnimatorSet */
    public class C1321 {

        /* renamed from: K  reason: contains not printable characters */
        public C1325 f5129;

        public C1321(AbstractC1354 k) {
            this.f5129 = C1320.this.f5126.get(k);
            if (this.f5129 == null) {
                this.f5129 = new C1325(k);
                C1320.this.f5126.put(k, this.f5129);
                C1320.this.f5119.add(this.f5129);
            }
        }
    }

    /* renamed from: ඓ.㴹.K.ʬ$ඓ  reason: contains not printable characters */
    /* compiled from: AnimatorSet */
    public static class C1322 implements AbstractC1354.AbstractC1355 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public int f5130;

        /* renamed from: ῲ  reason: contains not printable characters */
        public C1325 f5131;

        /* renamed from: K  reason: contains not printable characters */
        public C1320 f5132;

        public C1322(C1320 r1, C1325 r2, int i) {
            this.f5132 = r1;
            this.f5131 = r2;
            this.f5130 = i;
        }

        @Override // ඓ.㴹.K.AbstractC1354.AbstractC1355
        /* renamed from: ʬ  reason: contains not printable characters */
        public void m3459(AbstractC1354 k) {
            if (this.f5130 == 0) {
                m3460(k);
            }
        }

        /* renamed from: ඓ  reason: contains not printable characters */
        public final void m3460(AbstractC1354 k) {
            if (!this.f5132.f5121) {
                C1326 r0 = null;
                int size = this.f5131.f5143.size();
                int i = 0;
                while (true) {
                    if (i >= size) {
                        break;
                    }
                    C1326 r3 = this.f5131.f5143.get(i);
                    if (r3.f5144 == this.f5130 && r3.f5145.f5140 == k) {
                        k.m3514(this);
                        r0 = r3;
                        break;
                    }
                    i++;
                }
                this.f5131.f5143.remove(r0);
                if (this.f5131.f5143.size() == 0) {
                    this.f5131.f5140.m3513();
                    this.f5132.f5118.add(this.f5131.f5140);
                }
            }
        }

        @Override // ඓ.㴹.K.AbstractC1354.AbstractC1355
        /* renamed from: ῲ  reason: contains not printable characters */
        public void m3461(AbstractC1354 k) {
        }

        @Override // ඓ.㴹.K.AbstractC1354.AbstractC1355
        /* renamed from: K  reason: contains not printable characters */
        public void m3462(AbstractC1354 k) {
            if (this.f5130 == 1) {
                m3460(k);
            }
        }

        @Override // ඓ.㴹.K.AbstractC1354.AbstractC1355
        /* renamed from: 㸾  reason: contains not printable characters */
        public void m3463(AbstractC1354 k) {
        }
    }

    /* renamed from: ඓ.㴹.K.ʬ$ῲ  reason: contains not printable characters */
    /* compiled from: AnimatorSet */
    public class C1323 implements AbstractC1354.AbstractC1355 {

        /* renamed from: K  reason: contains not printable characters */
        public C1320 f5134;

        public C1323(C1320 r2) {
            this.f5134 = r2;
        }

        @Override // ඓ.㴹.K.AbstractC1354.AbstractC1355
        /* renamed from: ʬ  reason: contains not printable characters */
        public void m3464(AbstractC1354 k) {
        }

        @Override // ඓ.㴹.K.AbstractC1354.AbstractC1355
        /* renamed from: ῲ  reason: contains not printable characters */
        public void m3465(AbstractC1354 k) {
        }

        @Override // ඓ.㴹.K.AbstractC1354.AbstractC1355
        /* renamed from: K  reason: contains not printable characters */
        public void m3466(AbstractC1354 k) {
            k.m3514(this);
            C1320.this.f5118.remove(k);
            boolean z = true;
            this.f5134.f5126.get(k).f5141 = true;
            if (!C1320.this.f5121) {
                ArrayList<C1325> arrayList = this.f5134.f5125;
                int size = arrayList.size();
                int i = 0;
                while (true) {
                    if (i >= size) {
                        break;
                    } else if (!arrayList.get(i).f5141) {
                        z = false;
                        break;
                    } else {
                        i++;
                    }
                }
                if (z) {
                    ArrayList<AbstractC1354.AbstractC1355> arrayList2 = C1320.this.f5190;
                    if (arrayList2 != null) {
                        ArrayList arrayList3 = (ArrayList) arrayList2.clone();
                        int size2 = arrayList3.size();
                        for (int i2 = 0; i2 < size2; i2++) {
                            ((AbstractC1354.AbstractC1355) arrayList3.get(i2)).m3520(this.f5134);
                        }
                    }
                    this.f5134.f5124 = false;
                }
            }
        }

        @Override // ඓ.㴹.K.AbstractC1354.AbstractC1355
        /* renamed from: 㸾  reason: contains not printable characters */
        public void m3467(AbstractC1354 k) {
            ArrayList<AbstractC1354.AbstractC1355> arrayList;
            C1320 r4 = C1320.this;
            if (!(r4.f5121 || r4.f5118.size() != 0 || (arrayList = C1320.this.f5190) == null)) {
                int size = arrayList.size();
                for (int i = 0; i < size; i++) {
                    C1320.this.f5190.get(i).m3521(this.f5134);
                }
            }
        }
    }

    /* renamed from: ඓ.㴹.K.ʬ$K  reason: contains not printable characters */
    /* compiled from: AnimatorSet */
    public class C1324 extends AbstractC1352 {

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ ArrayList f5136;

        /* renamed from: K  reason: contains not printable characters */
        public boolean f5137 = false;

        public C1324(ArrayList arrayList) {
            this.f5136 = arrayList;
        }

        @Override // ඓ.㴹.K.AbstractC1354.AbstractC1355
        /* renamed from: K  reason: contains not printable characters */
        public void m3468(AbstractC1354 k) {
            if (!this.f5137) {
                int size = this.f5136.size();
                for (int i = 0; i < size; i++) {
                    C1325 r1 = (C1325) this.f5136.get(i);
                    r1.f5140.m3513();
                    C1320.this.f5118.add(r1.f5140);
                }
            }
        }

        @Override // ඓ.㴹.K.AbstractC1354.AbstractC1355
        /* renamed from: 㸾  reason: contains not printable characters */
        public void m3469(AbstractC1354 k) {
            this.f5137 = true;
        }
    }

    /* renamed from: ඓ.㴹.K.ʬ$㴹  reason: contains not printable characters */
    /* compiled from: AnimatorSet */
    public static class C1325 implements Cloneable {

        /* renamed from: ʬ  reason: contains not printable characters */
        public ArrayList<C1326> f5138 = null;

        /* renamed from: ඓ  reason: contains not printable characters */
        public ArrayList<C1325> f5139 = null;

        /* renamed from: ῲ  reason: contains not printable characters */
        public AbstractC1354 f5140;

        /* renamed from: ⁱ  reason: contains not printable characters */
        public boolean f5141 = false;

        /* renamed from: 㴹  reason: contains not printable characters */
        public ArrayList<C1325> f5142 = null;

        /* renamed from: 㸾  reason: contains not printable characters */
        public ArrayList<C1326> f5143 = null;

        public C1325(AbstractC1354 k) {
            this.f5140 = k;
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m3470(C1326 r3) {
            if (this.f5138 == null) {
                this.f5138 = new ArrayList<>();
                this.f5139 = new ArrayList<>();
            }
            this.f5138.add(r3);
            if (!this.f5139.contains(r3.f5145)) {
                this.f5139.add(r3.f5145);
            }
            C1325 r32 = r3.f5145;
            if (r32.f5142 == null) {
                r32.f5142 = new ArrayList<>();
            }
            r32.f5142.add(this);
        }

        @Override // java.lang.Object
        public C1325 clone() {
            try {
                C1325 r0 = (C1325) super.clone();
                r0.f5140 = this.f5140.clone();
                return r0;
            } catch (CloneNotSupportedException unused) {
                throw new AssertionError();
            }
        }
    }

    /* renamed from: ඓ.㴹.K.ʬ$㸾  reason: contains not printable characters */
    /* compiled from: AnimatorSet */
    public static class C1326 {

        /* renamed from: ῲ  reason: contains not printable characters */
        public int f5144;

        /* renamed from: K  reason: contains not printable characters */
        public C1325 f5145;

        public C1326(C1325 r1, int i) {
            this.f5145 = r1;
            this.f5144 = i;
        }
    }

    @Override // ඓ.㴹.K.AbstractC1354
    public void cancel() {
        this.f5121 = true;
        if (this.f5124) {
            ArrayList arrayList = null;
            ArrayList<AbstractC1354.AbstractC1355> arrayList2 = this.f5190;
            if (arrayList2 != null) {
                arrayList = (ArrayList) arrayList2.clone();
                Iterator it2 = arrayList.iterator();
                while (it2.hasNext()) {
                    ((AbstractC1354.AbstractC1355) it2.next()).m3521(this);
                }
            }
            C1327 r1 = this.f5123;
            if (r1 != null && r1.m3481()) {
                this.f5123.cancel();
            } else if (this.f5125.size() > 0) {
                Iterator<C1325> it3 = this.f5125.iterator();
                while (it3.hasNext()) {
                    it3.next().f5140.cancel();
                }
            }
            if (arrayList != null) {
                Iterator it4 = arrayList.iterator();
                while (it4.hasNext()) {
                    ((AbstractC1354.AbstractC1355) it4.next()).m3520(this);
                }
            }
            this.f5124 = false;
        }
    }

    @Override // ඓ.㴹.K.AbstractC1354
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m3454() {
        this.f5121 = false;
        this.f5124 = true;
        if (this.f5122) {
            this.f5125.clear();
            ArrayList arrayList = new ArrayList();
            int size = this.f5119.size();
            for (int i = 0; i < size; i++) {
                C1325 r4 = this.f5119.get(i);
                ArrayList<C1326> arrayList2 = r4.f5138;
                if (arrayList2 == null || arrayList2.size() == 0) {
                    arrayList.add(r4);
                }
            }
            ArrayList arrayList3 = new ArrayList();
            while (arrayList.size() > 0) {
                int size2 = arrayList.size();
                for (int i2 = 0; i2 < size2; i2++) {
                    C1325 r5 = (C1325) arrayList.get(i2);
                    this.f5125.add(r5);
                    ArrayList<C1325> arrayList4 = r5.f5142;
                    if (arrayList4 != null) {
                        int size3 = arrayList4.size();
                        for (int i3 = 0; i3 < size3; i3++) {
                            C1325 r8 = r5.f5142.get(i3);
                            r8.f5139.remove(r5);
                            if (r8.f5139.size() == 0) {
                                arrayList3.add(r8);
                            }
                        }
                    }
                }
                arrayList.clear();
                arrayList.addAll(arrayList3);
                arrayList3.clear();
            }
            this.f5122 = false;
            if (this.f5125.size() != this.f5119.size()) {
                throw new IllegalStateException("Circular dependencies cannot exist in AnimatorSet");
            }
        } else {
            int size4 = this.f5119.size();
            for (int i4 = 0; i4 < size4; i4++) {
                C1325 r3 = this.f5119.get(i4);
                ArrayList<C1326> arrayList5 = r3.f5138;
                if (arrayList5 != null && arrayList5.size() > 0) {
                    int size5 = r3.f5138.size();
                    for (int i5 = 0; i5 < size5; i5++) {
                        C1326 r6 = r3.f5138.get(i5);
                        if (r3.f5139 == null) {
                            r3.f5139 = new ArrayList<>();
                        }
                        if (!r3.f5139.contains(r6.f5145)) {
                            r3.f5139.add(r6.f5145);
                        }
                    }
                }
                r3.f5141 = false;
            }
        }
        int size6 = this.f5125.size();
        for (int i6 = 0; i6 < size6; i6++) {
            C1325 r32 = this.f5125.get(i6);
            ArrayList<AbstractC1354.AbstractC1355> arrayList6 = r32.f5140.f5190;
            if (arrayList6 != null && arrayList6.size() > 0) {
                Iterator it2 = new ArrayList(arrayList6).iterator();
                while (it2.hasNext()) {
                    AbstractC1354.AbstractC1355 k = (AbstractC1354.AbstractC1355) it2.next();
                    if ((k instanceof C1322) || (k instanceof C1323)) {
                        r32.f5140.m3514(k);
                    }
                }
            }
        }
        ArrayList arrayList7 = new ArrayList();
        for (int i7 = 0; i7 < size6; i7++) {
            C1325 r42 = this.f5125.get(i7);
            if (this.f5127 == null) {
                this.f5127 = new C1323(this);
            }
            ArrayList<C1326> arrayList8 = r42.f5138;
            if (arrayList8 == null || arrayList8.size() == 0) {
                arrayList7.add(r42);
            } else {
                int size7 = r42.f5138.size();
                for (int i8 = 0; i8 < size7; i8++) {
                    C1326 r7 = r42.f5138.get(i8);
                    r7.f5145.f5140.m3516(new C1322(this, r42, r7.f5144));
                }
                r42.f5143 = (ArrayList) r42.f5138.clone();
            }
            r42.f5140.m3516(this.f5127);
        }
        if (this.f5120 <= 0) {
            Iterator it3 = arrayList7.iterator();
            while (it3.hasNext()) {
                C1325 r2 = (C1325) it3.next();
                r2.f5140.m3513();
                this.f5118.add(r2.f5140);
            }
        } else {
            C1327 r33 = new C1327();
            r33.m3479(0.0f, 1.0f);
            this.f5123 = r33;
            this.f5123.m3476(this.f5120);
            this.f5123.m3516(new C1324(arrayList7));
            this.f5123.m3473();
        }
        ArrayList<AbstractC1354.AbstractC1355> arrayList9 = this.f5190;
        if (arrayList9 != null) {
            ArrayList arrayList10 = (ArrayList) arrayList9.clone();
            int size8 = arrayList10.size();
            for (int i9 = 0; i9 < size8; i9++) {
                ((AbstractC1354.AbstractC1355) arrayList10.get(i9)).m3518(this);
            }
        }
        if (this.f5119.size() == 0 && this.f5120 == 0) {
            this.f5124 = false;
            ArrayList<AbstractC1354.AbstractC1355> arrayList11 = this.f5190;
            if (arrayList11 != null) {
                ArrayList arrayList12 = (ArrayList) arrayList11.clone();
                int size9 = arrayList12.size();
                for (int i10 = 0; i10 < size9; i10++) {
                    ((AbstractC1354.AbstractC1355) arrayList12.get(i10)).m3520(this);
                }
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m3457(AbstractC1354... kArr) {
        C1321 r3;
        if (kArr != null) {
            this.f5122 = true;
            AbstractC1354 k = kArr[0];
            if (k != null) {
                this.f5122 = true;
                r3 = new C1321(k);
            } else {
                r3 = null;
            }
            for (int i = 1; i < kArr.length; i++) {
                AbstractC1354 k2 = kArr[i];
                C1325 r4 = C1320.this.f5126.get(k2);
                if (r4 == null) {
                    r4 = new C1325(k2);
                    C1320.this.f5126.put(k2, r4);
                    C1320.this.f5119.add(r4);
                }
                r4.m3470(new C1326(r3.f5129, 0));
            }
        }
    }

    @Override // ඓ.㴹.K.AbstractC1354, ඓ.㴹.K.AbstractC1354, java.lang.Object
    public C1320 clone() {
        C1320 r0 = (C1320) super.clone();
        r0.f5122 = true;
        r0.f5121 = false;
        r0.f5124 = false;
        r0.f5118 = new ArrayList<>();
        r0.f5126 = new HashMap<>();
        r0.f5119 = new ArrayList<>();
        r0.f5125 = new ArrayList<>();
        HashMap hashMap = new HashMap();
        Iterator<C1325> it2 = this.f5119.iterator();
        while (it2.hasNext()) {
            C1325 next = it2.next();
            C1325 clone = next.clone();
            hashMap.put(next, clone);
            r0.f5119.add(clone);
            r0.f5126.put(clone.f5140, clone);
            ArrayList arrayList = null;
            clone.f5138 = null;
            clone.f5143 = null;
            clone.f5142 = null;
            clone.f5139 = null;
            ArrayList<AbstractC1354.AbstractC1355> arrayList2 = clone.f5140.f5190;
            if (arrayList2 != null) {
                Iterator<AbstractC1354.AbstractC1355> it3 = arrayList2.iterator();
                while (it3.hasNext()) {
                    AbstractC1354.AbstractC1355 next2 = it3.next();
                    if (next2 instanceof C1323) {
                        if (arrayList == null) {
                            arrayList = new ArrayList();
                        }
                        arrayList.add(next2);
                    }
                }
                if (arrayList != null) {
                    Iterator it4 = arrayList.iterator();
                    while (it4.hasNext()) {
                        arrayList2.remove((AbstractC1354.AbstractC1355) it4.next());
                    }
                }
            }
        }
        Iterator<C1325> it5 = this.f5119.iterator();
        while (it5.hasNext()) {
            C1325 next3 = it5.next();
            C1325 r4 = (C1325) hashMap.get(next3);
            ArrayList<C1326> arrayList3 = next3.f5138;
            if (arrayList3 != null) {
                Iterator<C1326> it6 = arrayList3.iterator();
                while (it6.hasNext()) {
                    C1326 next4 = it6.next();
                    r4.m3470(new C1326((C1325) hashMap.get(next4.f5145), next4.f5144));
                }
            }
        }
        return r0;
    }

    @Override // ඓ.㴹.K.AbstractC1354
    /* renamed from: K  reason: contains not printable characters */
    public boolean m3458() {
        Iterator<C1325> it2 = this.f5119.iterator();
        while (it2.hasNext()) {
            if (it2.next().f5140.m3517()) {
                return true;
            }
        }
        return false;
    }

    @Override // ඓ.㴹.K.AbstractC1354
    /* renamed from: K  reason: contains not printable characters */
    public C1320 m3456(long j) {
        if (j >= 0) {
            Iterator<C1325> it2 = this.f5119.iterator();
            while (it2.hasNext()) {
                it2.next().f5140.m3515(j);
            }
            return this;
        }
        throw new IllegalArgumentException("duration must be a value of zero or greater");
    }
}
