CONSOLIDATED STATEMENTS OF CASH FLOWS - USD ($)
$ in Thousands
12 Months Ended
Dec. 31, 2018
Dec. 31, 2017
Dec. 31, 2016
Operating activities      
Net income $ 43,840 $ 15,455 $ 12,298
Adjustments to reconcile net income to net cash provided by operating activities:      
Depreciation expense 3,946 3,686 3,318
Amortization of intangible assets 5,464 5,212 4,598
Loss on disposal of fixed assets 5 1 13
Provision for doubtful accounts 839 815 345
Investment discount and premium amortization (534) (109) 339
Release of valuation allowance (23,435)    
Stock-based compensation 13,511 12,105 8,370
Tax benefit from business acquisition   (2,257) (9,402)
Deferred tax asset adjustment   767  
Changes in assets and liabilities:      
Accounts receivable, net (4,503) (5,116) (3,765)
Inventories (6,341) (9,324) (1,589)
Prepaid expenses and other current assets (1,729) (593) 1,184
Other assets (450) (201) (307)
Accounts payable 1,940 6,370 (32)
Accrued liabilities (67) (441) 1,999
Deferred revenue 1,086 1,213 1,362
Other long-term liabilities 1,378 (156) (653)
Net cash provided by operating activities 34,950 27,427 18,078
Investing activities      
Purchases of available-for-sale investments (62,603) (76,796) (19,227)
Proceeds from sales of available-for-sale investments 3,800 3,955 900
Proceeds from maturities of available-for-sale investments 62,650 43,780 42,203
Purchases of property and equipment (6,288) (3,952) (2,682)
Business acquisitions, net of cash acquired (1,411) (9,258) (32,891)
Net cash used in investing activities (3,852) (42,271) (11,697)
Financing activities      
Proceeds from exercise of options for common stock 10,976 16,959 3,437
Payments for withholding taxes related to net share settlement of equity awards (7,367) (5,534)  
Repurchase of common stock (23,872) (1,821) (3,242)
Repayment of notes payable     (913)
Proceeds from revolving credit facility     5,000
Repayment of revolving credit facility     (5,000)
Payment of debt issuance costs (113)   (89)
Net cash (used in) provided by financing activities (20,376) 9,604 (807)
Effect of exchange rate changes on cash and cash equivalents (102) 214 (340)
Net change in cash and cash equivalents 10,620 (5,026) 5,234
Unrestricted and restricted cash and cash equivalents at beginning of period 30,034 35,060 29,826
Unrestricted and restricted cash and cash equivalents at end of period 40,654 30,034 35,060
Supplemental disclosure of cash flow information      
Cash paid for interest 145 57 204
Cash paid for taxes 1,159 1,292 1,115
Supplemental schedule of non-cash investing and financing activities      
Landlord paid tenant improvements     39
Business acquisitions holdback liability   1,414  
Purchases of property and equipment financed by accounts payable 400 351 135
Net unrealized gains (losses) on available-for-sale investments $ 12 $ (47) $ 46