| FINANCIAL STATEMENT COMPONENTS - Consolidated Statements of Operations (Details) - USD ($) $ in Thousands | 12 Months Ended | ||
|---|---|---|---|
| Jun. 30, 2023 | Jun. 30, 2022 | Jun. 30, 2021 | |
| Other expense (income), net: | |||
| Interest income | $ (74,095) | $ (8,695) | $ (8,929) | 
| Foreign exchange losses, net | 233 | 3,925 | 5,005 | 
| Net realized losses (gains) on sale of investments | 986 | 306 | (253) | 
| Other | (31,844) | 9,069 | (25,125) | 
| Other expense (income), net | $ (104,720) | $ 4,605 | $ (29,302) | 
| X | ||||||||||
| 
- Definition Other Nonoperating Income (Expense), Miscellaneous No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount, before tax, of realized and unrealized gain (loss) from foreign currency transaction. Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- Definition Amount before accretion (amortization) of purchase discount (premium) of interest income on nonoperating securities. Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of income (expense) related to nonoperating activities, classified as other. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Amount of realized gain (loss) on investment. Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 |