Synthesis of alloys and lateral heterostructures of atomically thin transition-metal dichalcogenides for optoelectronic applications