<commit_before>// Copyright 2018-2020, University of Colorado Boulder

/**
 * IO type for Dialog
 * Used to live at '/joist/js/DialogIO'. Moved to '/sun/js/DialogIO' on 4/10/2018
 *
 * @author <NAME> (PhET Interactive Simulations)
 */

import NodeIO from '../../scenery/js/nodes/NodeIO.js';
import ObjectIO from '../../tandem/js/types/ObjectIO.js';
import sun from './sun.js';

class DialogIO extends NodeIO {}

DialogIO.documentation = 'A dialog panel';
DialogIO.validator = { isValidValue: v => v instanceof phet.sun.Dialog };
DialogIO.typeName = 'DialogIO';
ObjectIO.validateSubtype( DialogIO );

sun.register( 'DialogIO', DialogIO );
export default DialogIO;<commit_msg>add AboutDialog to state, https://github.com/phetsims/phet-io/issues/1663<commit_after>// Copyright 2018-2020, University of Colorado Boulder

/**
 * IO type for Dialog
 * Used to live at '/joist/js/DialogIO'. Moved to '/sun/js/DialogIO' on 4/10/2018
 *
 * @author <NAME> (PhET Interactive Simulations)
 */

import NodeIO from '../../scenery/js/nodes/NodeIO.js';
import ObjectIO from '../../tandem/js/types/ObjectIO.js';
import sun from './sun.js';

class DialogIO extends NodeIO {

  /**
   * Since many Dialogs are dynamic elements, these need to be in the state. The value of the state object doesn't
   * matter, but it instead just serves as a marker to tell the state engine to recreate the Dialog (if dynamic) when
   * setting state.
   * @override
   * @public
   * @param {Dialog} dialog
   * @returns {string}
   */
  static toStateObject( dialog ) {
    return dialog.tandem.phetioID;
  }
}

DialogIO.documentation = 'A dialog panel';
DialogIO.validator = { isValidValue: v => v instanceof phet.sun.Dialog };
DialogIO.typeName = 'DialogIO';
ObjectIO.validateSubtype( DialogIO );

sun.register( 'DialogIO', DialogIO );
export default DialogIO;
{'fraction_non_alphanumeric': 0.13347921225382933, 'fraction_numerical': 0.018599562363238512, 'mean_word_length': 3.787958115183246, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '55268', 'n_tokens_mistral': 603, 'n_tokens_neox': 568, 'n_words': 182}