// Copyright 2014-2025, University of Colorado Boulder
/**
 * Play pause button for starting/stopping the sim.  Often appears at the bottom center of the screen.
 * Generated programmatically using RoundPushButton (as opposed to using raster images).
 *
 * @author Sam Reid (PhET Interactive Simulations)
 * @author Jesse Greenberg (PhET Interactive Simulations)
 */
import { string_scenery_phet_a11y_playControlButton_pause_StringProperty } from '../strings/a11y/playControlButton/pause.js';
import '../../../globals.js';
import '../../../chipper/js/browser/initialize-globals.js';
import { assert } from '../../../scenerystack/assert.js';
import InstanceRegistry from '../../../phet-core/js/documentation/InstanceRegistry.js';
import optionize from '../../../phet-core/js/optionize.js';
import Path from '../../../scenery/js/nodes/Path.js';
import PauseIconShape from '../PauseIconShape.js';
import sceneryPhet from '../sceneryPhet.js';
import SceneryPhetConstants from '../SceneryPhetConstants.js';
import PlayControlButton from './PlayControlButton.js';
export default class PlayPauseButton extends PlayControlButton {
    constructor(isPlayingProperty, providedOptions) {
        const options = optionize()({
            // PlayPauseButtonOptions
            radius: SceneryPhetConstants.PLAY_CONTROL_BUTTON_RADIUS,
            // PlayControlButtonOptions
            includeGlobalHotkey: true,
            endPlayingLabel: string_scenery_phet_a11y_playControlButton_pause_StringProperty
        }, providedOptions);
        // icon sized relative to the radius
        const pauseHeight = options.radius;
        const pauseWidth = options.radius * 0.6;
        const pausePath = new Path(new PauseIconShape(pauseWidth, pauseHeight), { fill: 'black' });
        super(isPlayingProperty, pausePath, options);
        // support for binder documentation, stripped out in builds and only runs when ?binder is specified
        assert && self.phet?.chipper?.queryParameters?.binder && InstanceRegistry.registerDataURL('scenery-phet', 'PlayPauseButton', this);
    }
}
sceneryPhet.register('PlayPauseButton', PlayPauseButton);
