| Leases (Tables)
 | 12 Months Ended | 
| Dec. 31, 2022 | 
|---|
| Leases [Abstract] |  | 
| Schedule of Rent and Related Expenses and Lease Costs | Rent and related expenses were as follows: 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|  | Year Ended December 31, |  
|  | 2022 |  | 2021 |  | 2020 |  
| Rent and related expenses | $ | 9,199 |  |  | $ | 9,740 |  |  | $ | 8,891 |  | The costs related to our leases were as follows: 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|  | Year Ended December 31, |  
|  | 2022 |  | 2021 |  | 2020 |  
| Operating Leases |  |  |  |  |  |  
| Operating lease costs | $ | 8,372 |  |  | $ | 8,780 |  |  | $ | 7,970 |  |  
|  |  |  |  |  |  |  
| Financing Leases |  |  |  |  |  |  
| Amortization expense | 2,104 |  |  | 2,129 |  |  | 2,129 |  |  
| Interest on lease liabilities | 2,147 |  |  | 2,541 |  |  | 3,019 |  |  
| Total financing lease costs | 4,251 |  |  | 4,670 |  |  | 5,148 |  |  
| Total lease costs | $ | 12,623 |  |  | $ | 13,450 |  |  | $ | 13,118 |  | 
 Supplemental cash flow information related to our leases was as follows: 
|  |  |  |  |  |  |  |  |  |  |  |  |  
|  | Year Ended December 31, |  
|  | 2022 |  | 2021 |  
| Cash paid for amounts included in the measurement of operating lease liabilities | $ | 7,978 |  |  | $ | 11,385 |  |  
| Right-of-use assets obtained in exchange for new operating lease liabilities | $ | 4,872 |  |  | $ | 10,007 |  |  
|  |  |  |  |  | 
| Schedule of Assets and Liabilities, Lessee | The table below sets forth supplemental balance sheet information related to leases: 
|  |  |  |  |  |  |  |  |  |  |  |  |  
|  | December 31, |  
|  | 2022 |  | 2021 |  
| Operating Leases |  |  |  |  
| Operating lease assets | $ | 38,224 |  |  | $ | 41,982 |  |  
|  |  |  |  |  
| Current portion of operating lease liabilities | $ | 5,829 |  |  | $ | 6,276 |  |  
| Long-term operating lease liabilities, net of current portion | 31,703 |  |  | 35,135 |  |  
| Total Operating lease liabilities | $ | 37,532 |  |  | $ | 41,411 |  |  
| Weighted-average remaining lease term | 13 years |  | 12 years |  
| Weighted-average discount rate | 6.0 | % |  | 5.7 | % |  
|  |  |  |  |  
| 
Financing Leases (1)
 |  |  |  |  
| Energy assets, net | $ | 29,365 |  |  | $ | 31,876 |  |  
|  |  |  |  |  
| Current portions of financing lease liabilities | $ | 1,992 |  |  | $ | 3,125 |  |  
| Long-term financing lease liabilities, net of current portion, unamortized discount and debt issuance costs | 14,068 |  |  | 16,101 |  |  
| Total financing lease liabilities | $ | 16,060 |  |  | $ | 19,226 |  |  
| Weighted-average remaining lease term | 14 years |  | 15 years |  
| Weighted-average discount rate | 12.1 | % |  | 12.1 | % |  
|  |  |  |  |  | (1) Includes sale-leaseback transactions entered into prior to January 1, 2019. |  | 
| Schedule of Finance Lease Liability Maturity | The table below sets forth our estimated minimum future lease obligations under our leases: 
|  |  |  |  |  |  |  |  |  |  |  |  |  
|  | Operating Leases |  | Financing Leases |  
| Year ended December 31, |  |  |  |  
| 2023 | $ | 7,769 |  |  | $ | 3,627 |  |  
| 2024 | 6,585 |  |  | 2,565 |  |  
| 2025 | 5,319 |  |  | 2,213 |  |  
| 2026 | 3,233 |  |  | 2,054 |  |  
| 2027 | 2,631 |  |  | 1,922 |  |  
| Thereafter | 29,383 |  |  | 17,891 |  |  
| Total minimum lease payments | $ | 54,920 |  |  | $ | 30,272 |  |  
| Less: interest | 17,388 |  |  | 14,212 |  |  
| Present value of lease liabilities | $ | 37,532 |  |  | $ | 16,060 |  |  | 
| Schedule of Operating Lease Liability Maturity | The table below sets forth our estimated minimum future lease obligations under our leases: 
|  |  |  |  |  |  |  |  |  |  |  |  |  
|  | Operating Leases |  | Financing Leases |  
| Year ended December 31, |  |  |  |  
| 2023 | $ | 7,769 |  |  | $ | 3,627 |  |  
| 2024 | 6,585 |  |  | 2,565 |  |  
| 2025 | 5,319 |  |  | 2,213 |  |  
| 2026 | 3,233 |  |  | 2,054 |  |  
| 2027 | 2,631 |  |  | 1,922 |  |  
| Thereafter | 29,383 |  |  | 17,891 |  |  
| Total minimum lease payments | $ | 54,920 |  |  | $ | 30,272 |  |  
| Less: interest | 17,388 |  |  | 14,212 |  |  
| Present value of lease liabilities | $ | 37,532 |  |  | $ | 16,060 |  |  | 
| Schedule of Amount Related to Sale Leasebacks | The following table presents a summary of amounts related to these sale-leasebacks included in our consolidated balance sheets: 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|  | December 31, |  |  |  |  |  |  |  |  |  |  |  
|  | 2022 |  | 2021 |  |  |  |  |  |  |  
| Deferred loss, short-term, net | 115 |  |  | 115 |  |  |  |  |  |  |  |  |  |  |  |  
| Deferred loss, long-term, net | 1,455 |  |  | 1,571 |  |  |  |  |  |  |  |  |  |  |  |  
| Total deferred loss | $ | 1,570 |  |  | $ | 1,686 |  |  |  |  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
| Deferred gain, short-term, net | 345 |  |  | 345 |  |  |  |  |  |  |  |  |  |  |  |  
| Deferred gain, long-term, net | 4,430 |  |  | 4,775 |  |  |  |  |  |  |  |  |  |  |  |  
| Total deferred gain | $ | 4,775 |  |  | $ | 5,120 |  |  |  |  |  |  |  |  |  |  |  |  |