import '../../../globals.js';
// Copyright 2014-2022, University of Colorado Boulder
/**
 * A DerivedProperty that maps PushButtonModel states to the states needed by the button view.
 *
 * @author John Blanco (PhET Interactive Simulations)
 */
import { DerivedProperty4 } from '../../../axon/js/DerivedProperty.js';
import sun from '../sun.js';
import ButtonInteractionState from './ButtonInteractionState.js';
export default class PushButtonInteractionStateProperty extends DerivedProperty4 {
    constructor(buttonModel) {
        super([buttonModel.focusedProperty, buttonModel.overProperty, buttonModel.looksOverProperty, buttonModel.looksPressedProperty], (focused, over, looksOver, looksPressed) => {
            return looksOver && !looksPressed ? ButtonInteractionState.OVER :
                (over || focused) && looksPressed ? ButtonInteractionState.PRESSED :
                    ButtonInteractionState.IDLE;
        }, { valueType: ButtonInteractionState });
    }
}
sun.register('PushButtonInteractionStateProperty', PushButtonInteractionStateProperty);
//# sourceMappingURL=PushButtonInteractionStateProperty.js.map