First-principles study of electronic and optical properties of ternary compounds AuBX2 (X = S, Se, Te) and AuMTe2 (M = Al, In, Ga)