INCOME TAXES - Unrecognized Tax Benefits Roll Forward (Details) - USD ($) $ in Thousands |
12 Months Ended | ||
|---|---|---|---|
Jun. 30, 2019 |
Jun. 30, 2018 |
Jun. 30, 2017 |
|
| Reconciliation of Unrecognized Tax Benefits, Excluding Amounts Pertaining to Examined Tax Returns [Roll Forward] | |||
| Unrecognized benefit—beginning of year | $ 29,144 | $ 27,438 | $ 22,851 |
| Gross increases—current year tax positions | 3,852 | 4,762 | 5,184 |
| Gross decreases—prior year tax positions due to statute lapse | (2,146) | (3,056) | (597) |
| Unrecognized benefit—end of year | $ 30,850 | $ 29,144 | $ 27,438 |