主权项 |
1. A compound of Formula I:or a pharmaceutically acceptable salt thereof, wherein:
Ring A is C3-10 cycloalkyl, C6-10 aryl, 4 to 10-membered heterocycloalkyl, or 5 to 10-membered heteroaryl; L is O or NR4; W is N or CR5; X is N or CR6; Y is N or CR7; wherein only one of X and Y is N; R1 is H, C1-10 alkyl, C3-10 cycloalkyl, phenyl, —(CR8R9)pOC(O)R10, —(CR8R9)pNR11R12, or —(CR8R9)pC(O)NR11R12, wherein said C1-10 alkyl, C3-10 cycloalkyl, and phenyl are each optionally substituted with 1, 2, 3, 4, or 5 substituents independently selected from F, Cl, Br, CN, C1-4 alkyl, and C1-4 haloalkyl; R2 and R3 are each independently selected from H, C1-4 alkyl, and C1-4 haloalkyl; R4 is H or C1-4 alkyl; R5 and R6 are each independently selected from H, halo, and C1-4 alkyl; R7 is H, C1-4 alkyl, C2-6 alkenyl, C3-10 cycloalkyl, C3-10 cycloalkyl-C1-4 alkyl, C6-10 aryl, C6-10 aryl-C1-4 alkyl, 4-10 membered heterocycloalkyl, (4-10 membered heterocycloalkyl)-C1-4 alkyl, 5-10 membered heteroaryl, (5-10 membered heteroaryl)-C1-4 alkyl, NR13R14, OR15, C(O)R16, S(O)qR17, wherein said C1-4 alkyl, C2-6 alkenyl, C3-10 cycloalkyl, C3-10 cycloalkyl-C1-4 alkyl, C6-10 aryl, C6-10 aryl-C1-4 alkyl, 4-10 membered heterocycloalkyl, (4-10 membered heterocycloalkyl)-C1-4 alkyl, 5-10 membered heteroaryl, and (5-10 membered heteroaryl)-C1-4 alkyl are each optionally substituted by 1, 2, or 3 substituents selected from halo, C1-4 alkyl, C2-6 alkenyl, amino, C1-4 alkylamino, C2-8 dialkylamino, hydroxy, and C1-4 alkoxy; R8 and R9 are each independently selected from H and C1-4 alkyl; R10 is C1-6 alkyl optionally substituted by 1, 2 or 3 substituents independently selected from C1-6 haloalkyl, C3-10 cycloalkyl, ORa, and NRcRd; R11 and R12 are each independently selected from H and C1-6 alkyl; R13 is H or C1-4 alkyl; R14 is H, C1-4 alkyl, C3-7 cycloalkyl, C3-7 cycloalkyl-C1-4 alkyl, C6-10 aryl, C6-10 aryl-C1-4 alkyl, 4-10 membered heterocycloalkyl, (4-10 membered heterocycloalkyl)-C1-4 alkyl, 5-10 membered heteroaryl, or (5-10 membered heteroaryl)-C1-4 alkyl, C(O)Rb1, C(O)ORa1, C(O)NRc1Rd1, S(O)Rb1, S(O)2Rb1, or S(O)2NRc1Rd1, wherein said C1-4 alkyl, C3-7 cycloalkyl, C3-7 cycloalkyl-C1-4 alkyl, C6-10 aryl, C6-10 aryl-C1-4 alkyl, 4-10 membered heterocycloalkyl, (4-10 membered heterocycloalkyl)-C1-4 alkyl, 5-10 membered heteroaryl, and (5-10 membered heteroaryl)-C1-4 alkyl are each optionally substituted by 1, 2, or 3 substituents independently selected from halo, C1-4 alkyl, C1-4 haloalkyl, CN, NO2, ORa1, SRa1, C(O)Rb1, C(O)NRc1Rd1, C(O)ORa1, OC(O)Rb1, OC(O)NRc1Rd1, NRc1Rd1, NRc1C(O)Rb1, NRc1C(O)ORa1, NRc1C(O)NRc1Rd1, NRc1S(O)Rb1, NRc1S(O)2Rb1, NRc1S(O)2NRc1Rd1, S(O)Rb1, S(O)NRc1Rd1, S(O)2Rb1, and S(O)2NRc1Rd1; or R13 and R14 together with the N atom to which they are attached form a 4-, 5-, 6-, or 7-membered heterocycloalkyl group optionally substituted with 1, 2, or 3 substituents independently selected from C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, 5-6 membered heteroaryl, halo, CN, ORa1, SRa1, C(O)Rb1, C(O)NRc1Rd1, C(O)ORa1, OC(O)Rb1, OC(O)NRc1Rd1, NRc1Rd1, NRc1C(O)Rb1, NRc1C(O)NRc1Rd1, NRc1C(O)ORa1, S(O)Rb1, S(O)NRc1Rd1, S(O)2Rb1, NRc1S(O)2Rb1, NRc1S(O)2NRc1Rd1, and S(O)2NRc1Rd1, wherein said C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, and 5-6 membered heteroaryl are each optionally substituted by 1, 2, or 3 substituents independently selected from halo, CN, ORa1, SRa1, C(O)Rb1, C(O)NRc1Rd1, C(O)ORa1, OC(O)Rb1, OC(O)NRc1Rd1, NRc1Rd1, NRc1C(O)Rb1, NRc1C(O)NRc1Rd1, NRc1C(O)ORa1, S(O)Rb1, S(O)NRc1Rd1, S(O)2Rb1, NRc1S(O)2Rb1, NRc1S(O)2NRc1Rd1, and S(O)2NRc1Rd1; R15 is H, C1-4 alkyl, C3-7 cycloalkyl, C3-7 cycloalkyl-C1-4 alkyl, C6-10 aryl, C6-10 aryl-C1-4 alkyl, 4-10 membered heterocycloalkyl, (4-10 membered heterocycloalkyl)-C1-4 alkyl, 5-10 membered heteroaryl, or (5-10 membered heteroaryl)-C1-4 alkyl, wherein said C1-4 alkyl, C3-7 cycloalkyl, C3-7 cycloalkyl-C1-4 alkyl, C6-10 aryl, C6-10 aryl-C1-4 alkyl, 4-10 membered heterocycloalkyl, (4-10 membered heterocycloalkyl)-C1-4 alkyl, 5-10 membered heteroaryl, and (5-10 membered heteroaryl)-C1-4 alkyl are each optionally substituted by 1, 2, or 3 substituents independently selected from halo, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, 5-6 membered heteroaryl, CN, ORa1, SRa1, C(O)Rb1, C(O)NRc1Rd1, C(O)ORa1, OC(O)Rb1, OC(O)NRc1Rd1, NRc1Rd1, NRc1C(O)Rb1, NRc1C(O)NRc1Rd1, NRc1C(O)ORa1, S(O)Rb1, S(O)NRc1Rd1, S(O)2Rb1, NRc1S(O)2Rb1, NRc1S(O)2NRc1Rd1, and S(O)2NRc1Rd1; R16 is C1-4 alkyl or NR18aR18b wherein said C1-4 alkyl is optionally substituted by 1, 2, or 3 substituents independently selected from halo, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, 5-6 membered heteroaryl, CN, ORa1, SRa1, C(O)Rb1, C(O)NRc1Rd1, C(O)ORa1, OC(O)Rb1, OC(O)NRc1Rd1, NRc1Rd1, NRc1C(O)Rb1, NRc1C(O)NRc1Rd1, NRc1C(O)ORa1, S(O)Rb1, S(O)NRc1Rd1, S(O)2Rb1, NRc1S(O)2Rb1, NRc1S(O)2NRc1Rd1, and S(O)2NRc1Rd1; R17 is C1-4 alkyl, NR18aR18b, or OR18c, wherein said C1-4 alkyl is optionally substituted by 1, 2, or 3 substituents independently selected from halo, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, 5-6 membered heteroaryl, CN, ORa1, SRa1, C(O)Rb1, C(O)NRc1Rd1, C(O)ORa1, OC(O)Rb1, OC(O)NRc1Rd1, NRc1Rd1, NRc1C(O)Rb1, NRc1C(O)NRc1Rd1, NRc1C(O)ORa1, S(O)Rb1, S(O)NRc1Rd1, S(O)2Rb1, NRc1S(O)2Rb1, NRc1S(O)2NRc1Rd1, and S(O)2NRc1Rd1; R18a and R18b are each independently selected from H and C1-4 alkyl wherein said C1-4 alkyl is optionally substituted by 1, 2, or 3 substituents independently selected from halo, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, 5-6 membered heteroaryl, CN, ORa1, SRa1, C(O)Rb1, C(O)NRc1Rd1, C(O)ORa1, OC(O)Rb1, OC(O)NRc1Rd1, NRc1Rd1, NRc1C(O)Rb1, NRc1C(O)NRc1Rd1, NRc4C(O)ORa1, S(O)Rb1, S(O)NRc1Rd1, S(O)2Rb1, NRc1S(O)2Rb1, NRc1S(O)2NRc1Rd1, and S(O)2NRc1Rd1; or R18a and R18b together with the N atom to which they are attached form a 4-, 5-, 6-, or 7-membered heterocycloalkyl group optionally substituted with 1, 2, or 3 substituents independently selected from C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, 5-6 membered heteroaryl, halo, CN, ORa1, SRa1, C(O)Rb1, C(O)NRc1Rd1, C(O)ORa1, OC(O)Rb1, OC(O)NRc1Rd1, NRc1Rd1, NRc1C(O)Rb1, NRc1C(O)NRc1Rd1, NRc1C(O)ORa1, S(O)Rb1, S(O)NRc1Rd1, S(O)2Rb1, NRc1S(O)2Rb1, NRc1S(O)2NRc1Rd1, and S(O)2NRc1Rd1, wherein said C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, and 5-6 membered heteroaryl are each optionally substituted by 1, 2, or 3 substituents independently selected from halo, CN, ORa1, SRa1, C(O)Rb1, C(O)NRc1Rd1, C(O)ORa1, OC(O)Rb1, OC(O)NRc1Rd1, NRc1Rd1, NRc1C(O)Rb1, NRc1C(O)NRc1Rd1, NRc1C(O)ORa1, S(O)Rb1, S(O)NRc1Rd1, S(O)2Rb1, NRc1S(O)2Rb1, NRc1S(O)2NRc1Rd1, and S(O)2NRc1Rd1; R18c is H, C1-6 alkyl, C3-10 cycloalkyl, C3-7 cycloalkyl-C1-4 alkyl, C6-10 aryl, C6-10 aryl-C1-4 alkyl, 4-10 membered heterocycloalkyl, (4-10 membered heterocycloalkyl)-C1-4 alkyl, 5-10 membered heteroaryl, or (5-10 membered heteroaryl)-C1-4 alkyl, wherein said C1-6 alkyl, C3-7 cycloalkyl, C3-10 cycloalkyl-C1-4 alkyl, C6-10 aryl, C6-10 aryl-C1-4 alkyl, 4-10 membered heterocycloalkyl, (4-10 membered heterocycloalkyl)-C1-4 alkyl, 5-10 membered heteroaryl, and (5-10 membered heteroaryl)-C1-4 alkyl are each optionally substituted by 1, 2, or 3 substituents independently selected from halo, C1-4 alkyl, C1-4 haloalkyl, CN, NO2, ORa1, SRa1, C(O)Rb1, C(O)NRc1Rd1, C(O)ORa1, OC(O)Rb1, OC(O)NRc1Rd1, NRc1Rd1, NRc1C(O)Rb1, NRc1C(O)ORa1, NRc1C(O)NRc1Rd1, NRc1S(O)Rb1, NRc1S(O)2Rb1, NRc1S(O)2NRc1Rd1, S(O)Rb1, S(O)NRc1Rd1, S(O)2Rb1, and S(O)2NRc1Rd1; RA is H, Cy1, halo, C1-6 alkyl, C2-6 alkenyl, CN, NO2, ORa2, SRa2, C(O)Rb2, C(O)NRc2Rd2, C(O)ORa2, OC(O)Rb2, OC(O)NRc2Rd2, NRc2Rd2, NRc2C(O)Rb2, NRc2C(O)ORa2, NRc2C(O)NRc2Rd2, NRc2S(O)Rb2, NRc2S(O)2Rb2, NRc2S(O)2NRc2Rd2, S(O)Rb2, S(O)NRc2Rd2, S(O)2Rb2, or S(O)2NRc2Rd2, wherein said C1-6 alkyl and C2-6 alkenyl are each optionally substituted with 1, 2, 3, 4, or 5 substituents independently selected from Cy1, halo, C1-6 alkyl, C2-6 alkenyl, C1-6 haloalkyl, CN, NO2, ORa2, SRa2, C(O)Rb2, C(O)NRc2Rd2, C(O)ORa2, OC(O)Rb2, OC(O)NRc2Rd2, NRc2Rd2, NRc2C(O)Rb2, NRc2C(O)ORa2, NRc2C(O)NRc2Rd2, NRc2S(O)Rb2, NRc2S(O)2Rb2, NRc2S(O)2NRc2Rd2, S(O)Rb2, S(O)NRc2Rd2, S(O)2Rb2, and S(O)2NRc2Rd2; RB is H, Cy2, halo, C1-6 alkyl, C2-6 alkenyl, C1-6 haloalkyl, CN, NO2, ORa3, SRa3, C(O)Rb3, C(O)NRc3Rd3, C(O)ORa3, OC(O)Rb3, OC(O)NRx3Rd3, NRc3Rd3, NRc3C(O)Rb3, NRc3C(O)ORa3, NRc3C(O)NRc3Rd3, NRc3S(O)Rb3, NRc3S(O)2Rb3, NRc3S(O)2NRc3Rd3, S(O)Rb3, S(O)NRc3Rd3, S(O)2Rb3, or S(O)2NRc3Rd3, wherein said C1-6 alkyl and C2-6 alkenyl are each optionally substituted with 1, 2, 3, 4, or 5 substituents independently selected from Cy2, halo, C1-6 alkyl, C2-6 alkenyl, C1-6 haloalkyl, CN, NO2, ORa3, SRa3, C(O)Rb3, C(O)NRc3Rd3, C(O)ORa3, OC(O)Rb3, OC(O)NRc3Rd3, NRc3Rd3, NRc3C(O)Rb3, NRc3C(O)ORa3, NRc3C(O)NRc3Rd3, NRc3S(O)Rb3, NRc1S(O)2Rb3, NRc3S(O)2NRc3Rd3, S(O)Rb3, S(O)NRc3Rd3, S(O)2Rb3, and S(O)2NRc3Rd3; RC and RD are independently selected from H, halo, C1-6 alkyl, C2-6 alkenyl, C1-6 haloalkyl, CN, NO2, ORa4, SRa4, C(O)Rb4, C(O)NRc4Rd4, C(O)ORa4, OC(O)Rb4, OC(O)NRc4Rd4, NRc4Rd4, NRc3C(O)Rb4, NRc4C(O)ORa4, NRc4C(O)NRc4Rd4, NRc4S(O)Rb4, NRc4S(O)2Rb4, NRc4S(O)2NRc4Rd4, S(O)Rb4, S(O)NRc4Rd4, S(O)2Rb4, and S(O)2NRc4Rd4; wherein said C1-6 alkyl and C2-6 alkenyl are each optionally substituted with 1, 2, 3, 4, or 5 substituents independently selected from C6-10 aryl, C3-10 cycloalkyl, 5-10 membered heteroaryl, 4-10 membered heterocycloalkyl, halo, C1-6 alkyl, C2-6 alkenyl, C1-6 haloalkyl, CN, NO2, ORa4, SRa4, C(O)Rb4, C(O)NRc4Rd4, C(O)ORa4, OC(O)Rb4, OC(O)NRc4Rd4, NRc4Rd4, NRc4C(O)Rb4, NRc4C(O)ORa4, NRc4C(O)NRc4Rd4, NRc4S(O)Rb4, NRc4S(O)2Rb4, NRc4S(O)2NRc4Rd4, S(O)Rb4, S(O)2NRc4Rd4, S(O)2Rb4, and S(O)2NRc4Rd4; Cy1 and Cy2 are each independently selected from C6-10 aryl, C3-10 cycloalkyl, 5-10 membered heteroaryl, and 4-10 membered heterocycloalkyl, each of which is optionally substituted by 1, 2, 3, 4, or 5 substituents independently selected from RCy; each RCy is independently selected from halo, C1-6 alkyl, C1-6 haloalkyl, C2-6 alkenyl, C6-10 aryl, C3-10 cycloalkyl, 5-10 membered heteroaryl, 4-10 membered heterocycloalkyl, CN, NO2, ORa5, SRa5, C(O)Rb5, C(O)NRc5Rd5, C(O)ORa5, OC(O)Rb5, OC(O)NRc5Rd5, NRc5Rd5, NRc5C(O)Rb5, NRc5C(O)ORa5, NRc5C(O)NRc5Rd5, NRc5S(O)Rb5, NRc5S(O)2Rb5, NRc5S(O)2NRc5Rd5, S(O)Rb5, S(O)NRc5Rd5, S(O)2Rb5, and S(O)2NRc5Rd5, wherein said C1-6 alkyl, C2-6 alkenyl C6-10 aryl, C3-10 cycloalkyl, 5-10 membered heteroaryl, and 4-10 membered heterocycloalkyl are each optionally substituted with 1, 2, 3, 4, or 5 substituents independently selected from halo, C1-6 alkyl, CN, NO2, ORa5, SRa5, C(O)Rb5, C(O)NRc5Rd5, C(O)ORa5, OC(O)Rb5, OC(O)NRc5Rd5, NRc5Rd5, NRc5C(O)Rb5, NRc5C(O)ORa5, NRc5C(O)NRc5Rd5, NRc5S(O)Rb5, NRc5S(O)2Rb5, NRc5S(O)2NRc5Rd5, S(O)Rb5, S(O)NRc5Rd5, S(O)2Rb5, and S(O)2NRc5Rd5; each Ra, Ra1, Ra2, Ra3, Ra4, and Ra5 is independently selected from H, C1-6 alkyl, C1-4 haloalkyl, C2-6 alkenyl, C6-10 aryl, C3-10 cycloalkyl, 5-10 membered heteroaryl, 4-10 membered heterocycloalkyl, C6-10 aryl-C1-4 alkyl, C3-10 cycloalkyl-C1-4 alkyl, (5-10 membered heteroaryl)-C1-4 alkyl, or (4-10 membered heterocycloalkyl)-C1-4 alkyl, wherein said C1-6 alkyl, C2-6 alkenyl, C6-10 aryl, C3-10 cycloalkyl, 5-10 membered heteroaryl, 4-10 membered heterocycloalkyl, C6-10 aryl-C1-4 alkyl, C3-10 cycloalkyl-C1-4 alkyl, (5-10 membered heteroaryl)-C1-4 alkyl, and (4-10 membered heterocycloalkyl)-C1-4 alkyl are each optionally substituted with 1, 2, 3, 4, or 5 substituents independently selected from C1-4 alkyl, halo, CN, ORa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6; each Rb1, Rb2, Rb3, Rb4, and Rb5 is independently selected from H, C1-6 alkyl, C1-4 haloalkyl, C2-6 alkenyl, C6-10 aryl, C3-10 cycloalkyl, 5-10 membered heteroaryl, 4-10 membered heterocycloalkyl, C6-10 aryl-C1-4 alkyl, C3-10 cycloalkyl-C1-4 alkyl, (5-10 membered heteroaryl)-C1-4 alkyl, or (4-10 membered heterocycloalkyl)-C1-4 alkyl, wherein said C1-6 alkyl, C2-6 alkenyl, C6-10 aryl, C3-10 cycloalkyl, 5-10 membered heteroaryl, 4-10 membered heterocycloalkyl, C6-10 aryl-C1-4 alkyl, C3-10 cycloalkyl-C1-4 alkyl, (5-10 membered heteroaryl)-C1-4 alkyl, and (4-10 membered heterocycloalkyl)-C1-4 alkyl are each optionally substituted with 1, 2, 3, 4, or 5 substituents independently selected from C1-4 alkyl, halo, CN, ORa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6; each Rc, Rd, Rc1, Rd1, Rc2, Rd2, Rc3, Rd3, Rc4, Rd4, Rc5, and Rd5 is independently selected from H, C1-6 alkyl, C1-4 haloalkyl, C2-6 alkenyl, C6-10 aryl, C3-10 cycloalkyl, 5-10 membered heteroaryl, 4-10 membered heterocycloalkyl, C6-10 aryl-C1-4 alkyl, C3-10 cycloalkyl-C1-4 alkyl, (5-10 membered heteroaryl)-C1-4 alkyl, or (4-10 membered heterocycloalkyl)-C1-4 alkyl, wherein said C1-6 alkyl, C2-6 alkenyl, C6-10 aryl, C3-10 cycloalkyl, 5-10 membered heteroaryl, 4-10 membered heterocycloalkyl, C6-10 aryl-C1-4 alkyl, C3-10 cycloalkyl-C1-4 alkyl, (5-10 membered heteroaryl)-C1-4 alkyl, and (4-10 membered heterocycloalkyl)-C1-4 alkyl are each optionally substituted with 1, 2, 3, 4, or 5 substituents independently selected from C1-4 alkyl, halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6; or any Rc and Rd together with the N atom to which they are attached form a 4-, 5-, 6-, or 7-membered heterocycloalkyl group optionally substituted with 1, 2, or 3 substituents independently selected from C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, 5-6 membered heteroaryl, halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6, wherein said C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, and 5-6 membered heteroaryl are optionally substituted by 1, 2, or 3 substituents independently selected from halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6; or any Rc1 and Rd1 together with the N atom to which they are attached form a 4-, 5-, 6-, or 7-membered heterocycloalkyl group optionally substituted with 1, 2, or 3 substituents independently selected from C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, 5-6 membered heteroaryl, halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6, wherein said C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, and 5-6 membered heteroaryl are each optionally substituted by 1, 2, or 3 substituents independently selected from halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6; or any Rc2 and Rd2 together with the N atom to which they are attached form a 4-, 5-, 6-, or 7-membered heterocycloalkyl group optionally substituted with 1, 2, or 3 substituents independently selected from C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, and 5-6 membered heteroaryl, C1-6 haloalkyl, halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6, wherein said C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, and 5-6 membered heteroaryl are each optionally substituted by 1, 2, or 3 substituents independently selected from halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6; or any Rc3 and Rd3 together with the N atom to which they are attached form a 4-, 5-, 6-, or 7-membered heterocycloalkyl group optionally substituted with 1, 2, or 3 substituents independently selected from C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, 5-6 membered heteroaryl, C1-6 haloalkyl, halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6, wherein said C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, and 5-6 membered heteroaryl are each optionally substituted by 1, 2, or 3 substituents independently selected from halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6; or any Rc4 and Rd4 together with the N atom to which they are attached form a 4-, 5-, 6-, or 7-membered heterocycloalkyl group optionally substituted with 1, 2, or 3 substituents independently selected from C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, 5-6 membered heteroaryl, C1-6 haloalkyl, halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6, wherein said C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, and 5-6 membered heteroaryl are each optionally substituted by 1, 2, or 3 substituents independently selected from halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6; or any Rc5 and Rd5 together with the N atom to which they are attached form a 4-, 5-, 6-, or 7-membered heterocycloalkyl group optionally substituted with 1, 2, or 3 substituents independently selected from C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, 5-6 membered heteroaryl, C1-6 haloalkyl, halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6, wherein said C1-6 alkyl, C3-7 cycloalkyl, 4-7 membered heterocycloalkyl, C6-10 aryl, and 5-6 membered heteroaryl are each optionally substituted by 1, 2, or 3 substituents independently selected from halo, CN, ORa6, SRa6, C(O)Rb6, C(O)NRc6Rd6, C(O)ORa6, OC(O)Rb6, OC(O)NRc6Rd6, NRc6Rd6, NRc6C(O)Rb6, NRc6C(O)NRc6Rd6, NRc6C(O)ORa6, S(O)Rb6, S(O)NRc6Rd6, S(O)2Rb6, NRc6S(O)2Rb6, NRc6S(O)2NRc6Rd6, and S(O)2NRc6Rd6; each Ra6, Rb6, Rc6, and Rd6 is independently selected from H, C1-4 alkyl, C2-4 alkenyl, C3-7 cycloalkyl, phenyl, 5-6 membered heteroaryl, and 4-7 membered heterocycloalkyl, wherein said C1-4 alkyl, C2-4 alkenyl, C3-7 cycloalkyl, phenyl, 5-6 membered heteroaryl, and 4-7 membered heterocycloalkyl are each optionally substituted by 1, 2, or 3 substituents independently selected from OH, CN, amino, halo, C1-4 alkyl, C1-4 alkoxy, C1-4 alkylthio, C1-4 alkylamino, and di(C1-4 alkyl)amino; n is 1 or 2; p is 1, 2, or 3; and q is 1 or 2;wherein any aforementioned 4-10 or 4-7 membered heterocycloalkyl group optionally comprises 1, 2, or 3 oxo substituents, wherein each oxo substituent that is present is substituted on a ring-forming carbon, nitrogen, or sulfur atom of the 4-10 or 4-7 membered heterocycloalkyl group. |