Stock-Based Compensation - Summary of Stock-based Compensation Expense Included in Statements of Operations (Detail) - USD ($) $ in Thousands |
3 Months Ended | 6 Months Ended | ||
---|---|---|---|---|
Jun. 30, 2017 |
Jun. 30, 2016 |
Jun. 30, 2017 |
Jun. 30, 2016 |
|
Share-based Compensation Arrangement by Share-based Payment Award, Compensation Cost [Line Items] | ||||
Stock-based compensation expense | $ 18,244 | $ 13,883 | $ 33,815 | $ 25,838 |
Cost of product sales | ||||
Share-based Compensation Arrangement by Share-based Payment Award, Compensation Cost [Line Items] | ||||
Stock-based compensation expense | 881 | 189 | 1,761 | 189 |
Research and development | ||||
Share-based Compensation Arrangement by Share-based Payment Award, Compensation Cost [Line Items] | ||||
Stock-based compensation expense | 6,420 | 4,780 | 11,721 | 9,176 |
Selling, general and administrative | ||||
Share-based Compensation Arrangement by Share-based Payment Award, Compensation Cost [Line Items] | ||||
Stock-based compensation expense | $ 10,943 | $ 8,914 | $ 20,333 | $ 16,473 |