CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS - USD ($)
$ in Thousands
9 Months Ended
Sep. 30, 2021
Sep. 30, 2020
Cash flows from operating activities:    
Net loss $ (141,526) $ (127,192)
Adjustments to reconcile net loss to net cash used in operating activities:    
Stock-based compensation expense 26,428 24,725
Depreciation and amortization expense 4,331 5,176
Amortization of premium on investments 118 186
Non-cash interest expense 1,036 232
Changes in operating assets and liabilities:    
Prepaid expenses and other current assets (1,226) (1,323)
Operating lease, right-of-use-asset 4,156 4,184
Accounts payable 2,773 2,095
Accrued expenses and other current liabilities (416) (2,425)
Other long-term liabilities (102) 580
Operating lease liabilities (3,477) (3,338)
Net cash used in operating activities (107,905) (97,100)
Cash flows from investing activities:    
Purchases of property, plant and equipment (2,280) (4,467)
Purchases of investments   (122,671)
Sales and maturities of investments 85,000 181,102
Net cash provided by investing activities 82,720 53,964
Cash flows from financing activities:    
Proceeds from underwritten public offering of common stock, net of commissions and underwriting discounts 188,000  
Payments of offering costs (360)  
Payments of debt issuance costs (150)  
Proceeds from borrowings under loan and security agreement   25,000
Proceeds from issuance of common stock upon exercise of stock options 10,547 1,412
Net cash provided by financing activities 198,037 26,412
Net increase in cash, cash equivalents and restricted cash 172,852 (16,724)
Cash, cash equivalents and restricted cash at beginning of period 92,901 93,633
Cash, cash equivalents and restricted cash at end of period 265,753 76,909
Supplemental cash flow information:    
Cash paid for interest 3,635 2,740
Cash paid for leases 5,675 5,822
Supplemental disclosure of non-cash investing and financing information:    
Purchases of property, plant and equipment included in accounts payable or accrued expenses 1,145 564
Lease assets obtained in exchange for new operating lease liabilities   90
Offering costs included in accounts payable and accrued expenses $ 35  
Lease asset derecognized upon lease cancellation   $ 982