import '../../globals.js';
import optionize from '../../phet-core/js/optionize.js';
import { HBox, Image, RichText } from '../../scenery/js/imports.js';
import Dialog from '../../sun/js/Dialog.js';
import IOType from '../../tandem/js/types/IOType.js';
import phetGirlWaggingFinger_png from '../images/phetGirlWaggingFinger_png.js';
import PhetFont from './PhetFont.js';
import sceneryPhet from './sceneryPhet.js';
class OopsDialog extends Dialog {
    /**
     * @param messageString - supports RichText formatting
     * @param [providedOptions]
     */
    constructor(messageString, providedOptions) {
        const options = optionize()({
            // DialogOptions
            topMargin: 20,
            bottomMargin: 20,
            // phet-io
            phetioType: OopsDialog.OopsDialogIO
        }, providedOptions);
        const text = new RichText(messageString, optionize()({
            font: new PhetFont(20),
            maxWidth: 600,
            maxHeight: 400
        }, options.richTextOptions));
        const iconNode = options.iconNode || new Image(phetGirlWaggingFinger_png, {
            maxHeight: 132 // determined empirically
        });
        const content = new HBox({
            spacing: 20,
            children: [text, iconNode]
        });
        super(content, options);
        this.disposeOopsDialog = () => {
            text.dispose();
        };
        if (typeof messageString !== 'string') {
            this.addLinkedElement(messageString);
        }
    }
    dispose() {
        this.disposeOopsDialog();
        super.dispose();
    }
}
OopsDialog.OopsDialogIO = new IOType('OopsDialogIO', {
    valueType: OopsDialog,
    supertype: Dialog.DialogIO
});
export default OopsDialog;
sceneryPhet.register('OopsDialog', OopsDialog);
//# sourceMappingURL=OopsDialog.js.map