/*
 * Decompiled with CFR 0.152.
 */
import java.io.IOException;
import java.util.Vector;

public final class f
extends ep {
    private jt a;
    private iy b;
    private hx c;
    private int d = -1;
    private Vector e;
    private int f;
    private hi g;
    private bq h;
    private Vector i;
    private ek j;

    public final cq e() {
        return null;
    }

    public final cq d() {
        return jy.g;
    }

    public final void a() {
        byte[] byArray = lh.k().f().g("FRIENDS_INVITE_REJECTED");
        if (byArray == null) {
            this.j = new ek();
        } else {
            try {
                this.j = ek.a(byArray);
            }
            catch (IOException iOException) {
                this.j = new ek();
            }
        }
        this.d = 0;
        this.f = 0;
        this.i = new Vector();
        this.l();
    }

    public final void b() {
        this.d = -1;
        this.b = null;
        this.c = null;
        this.i = null;
        this.f = 0;
        this.e = new Vector();
        try {
            byte[] byArray = this.j.c();
            lh.k().f().a("FRIENDS_INVITE_REJECTED", byArray);
        }
        catch (IOException iOException) {}
        this.j = null;
    }

    private void m() {
        Vector<jt> vector = new Vector<jt>();
        ek ek2 = new ek();
        ek ek3 = new ek();
        ek ek4 = new ek();
        ek ek5 = new ek();
        boolean bl2 = false;
        int n = this.i.size();
        block6: for (int i = 0; i < n; ++i) {
            jt jt2 = (jt)this.i.elementAt(i);
            long l = jt2.a.h();
            switch (jt2.b) {
                case 2: {
                    ek4.a(l);
                    vector.addElement(jt2.a);
                    bl2 = true;
                    if (this.j.b(l)) continue block6;
                    this.j.a(l);
                    continue block6;
                }
                case 3: {
                    ek5.a(l);
                    bl2 = true;
                    vector.addElement(jt2.a);
                    continue block6;
                }
                case 1: {
                    ek3.a(l);
                    vector.addElement(jt2.a);
                    bl2 = true;
                    this.j.c(l);
                    continue block6;
                }
                case 0: {
                    bl2 = true;
                    ek2.a(l);
                    vector.addElement(jt2.a);
                    this.j.c(l);
                }
            }
        }
        if (bl2) {
            ck.e().a(new bq(ek2, null, null, ek3, ek4, ek5, null, null, this.r, null));
            this.a.a(vector);
        }
        this.f = 0;
        this.a = null;
    }

    private void l() {
        this.b = this.s.b(false, false);
        this.c = (hx)this.b.a();
        Object object = jj.a();
        w w2 = jj.a(false);
        if (this.e.size() != 1) {
            dz.a(this.c, ed.a(lh.d(191), new String[]{"" + (this.f + 1), "" + this.e.size()}), (w)object);
        } else {
            dz.a(this.c, lh.d(222), (w)object);
        }
        jt jt2 = (jt)this.e.elementAt(this.f);
        object = jt2.b.v();
        dz.a(this.c, ed.a(lh.d(193), new String[]{object, jt2.m()}), w2);
        this.h = new bq(false);
        ic ic2 = f.a(this.c, lh.d(195), this.h, w2);
        f.a(this.c, lh.d(196), this.h, w2);
        f.a(this.c, lh.d(197), this.h, w2);
        if (this.j.b(jt2.h())) {
            f.a(this.c, lh.d(192), this.h, w2);
        }
        ic2.q_();
        ic2.z();
        this.g = this.f >= this.e.size() - 1 ? dz.a(this.c, lh.d(141)) : dz.a(this.c, lh.d(189));
        this.c.B();
    }

    public final int a(pb pb2) {
        if (pb2.d != 5 && pb2.d != 8) {
            gm gm2 = this.b.r();
            if (pb2.d == 7 && gm2 == this.g) {
                jt jt2 = (jt)this.e.elementAt(this.f);
                this.i.addElement(new jt(jt2, this.h.b()));
                ++this.f;
                if (this.f < this.e.size()) {
                    this.l();
                    return 3;
                }
                this.m();
                return 1;
            }
            this.b.a(pb2);
            return 3;
        }
        this.m();
        return 1;
    }

    public final int a(nj nj2) {
        if (this.b.b(nj2) == -3) {
            return this.a(pb.a(7));
        }
        return 3;
    }

    public final boolean a(boolean bl2) {
        return this.a(this.b);
    }

    public final void a(ht ht2) {
        this.b.a(ht2, 0, 0);
    }

    public final void a(Vector vector, jt jt2) {
        this.e = vector;
        this.a = jt2;
        this.n();
    }

    public f(eb eb2, hj hj2) {
        super(eb2, hj2);
    }

    private static ic a(hx hx2, String string, bq bq2, w w2) {
        ic ic2 = dz.a(hx2, string, bq2, w2);
        ic2.l(hx2.a());
        return ic2;
    }

    public final void g_() {
        if (this.t) {
            int n = -1;
            if (this.c != null) {
                n = this.c.g(this.c.q());
            }
            switch (this.d) {
                case 0: {
                    this.l();
                }
            }
            if (n != -1) {
                this.c.l(this.c.h(n));
            }
        }
    }
}

