Choose the correct reported speech for this question:

Direct: "Are you coming to the party?" they asked.

They asked me am I coming to the party.They asked me if I was coming to the party.They asked me if I am coming to the party.They asked me was I coming to the party.