v3.22.4
NET (LOSS) INCOME PER SHARE - Schedule of potentially dilutive shares (Details) - shares
shares in Thousands
12 Months Ended
Dec. 31, 2022
Dec. 31, 2021
Dec. 31, 2020
Antidilutive Securities Excluded from Computation of Earnings Per Share [Line Items]      
Number of shares excluded in the computation of diluted earnings per share 44,551 6,585 16,597
Stock options      
Antidilutive Securities Excluded from Computation of Earnings Per Share [Line Items]      
Number of shares excluded in the computation of diluted earnings per share 31,795 6,134 12,831
RSUs      
Antidilutive Securities Excluded from Computation of Earnings Per Share [Line Items]      
Number of shares excluded in the computation of diluted earnings per share 5,329 151 3,766
Convertible notes      
Antidilutive Securities Excluded from Computation of Earnings Per Share [Line Items]      
Number of shares excluded in the computation of diluted earnings per share 3,880 0 0
Restricted common stock      
Antidilutive Securities Excluded from Computation of Earnings Per Share [Line Items]      
Number of shares excluded in the computation of diluted earnings per share 1,602 5 0
ESPP      
Antidilutive Securities Excluded from Computation of Earnings Per Share [Line Items]      
Number of shares excluded in the computation of diluted earnings per share 1,945 295 0