// Copyright 2018-2025, University of Colorado Boulder
/**
 * Display a score as 'Score: N', where N is a number.
 * See specification in https://github.com/phetsims/vegas/issues/59.
 *
 * @author Andrea Lin
 */
import { string_vegas_pattern_score_number_StringProperty } from './strings/pattern/score/number.js';
import '../../globals.js';
import DerivedProperty from '../../axon/js/DerivedProperty.js';
import optionize from '../../phet-core/js/optionize.js';
import StringUtils from '../../phetcommon/js/util/StringUtils.js';
import StatusBar from '../../scenery-phet/js/StatusBar.js';
import Node from '../../scenery/js/nodes/Node.js';
import Text from '../../scenery/js/nodes/Text.js';
import { toFixed } from '../../dot/js/util/toFixed.js';
export default class ScoreDisplayLabeledNumber extends Node {
    constructor(scoreProperty, providedOptions) {
        const options = optionize()({
            // SelfOptions
            font: StatusBar.DEFAULT_FONT,
            textFill: 'black',
            scoreDecimalPlaces: 0
        }, providedOptions);
        const scoreDisplayStringProperty = new DerivedProperty([string_vegas_pattern_score_number_StringProperty, scoreProperty], (pattern, score) => StringUtils.fillIn(pattern, {
            score: toFixed(score, options.scoreDecimalPlaces)
        }));
        const scoreDisplayText = new Text(scoreDisplayStringProperty, {
            font: options.font,
            fill: options.textFill
        });
        options.children = [scoreDisplayText];
        super(options);
        this.disposeScoreDisplayLabeledNumber = () => {
            scoreDisplayStringProperty.dispose();
        };
    }
    dispose() {
        this.disposeScoreDisplayLabeledNumber();
        super.dispose();
    }
}
//# sourceMappingURL=ScoreDisplayLabeledNumber.js.map