// 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 Andrew Adare (PhET Interactive Simulations)
 */

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

const DialogIO = new IOType( 'DialogIO', {
  isValidValue: v => v instanceof phet.sun.Dialog,
  supertype: 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}
   */
  toStateObject( dialog ) {
    return dialog.tandem.phetioID;
  }
} );

sun.register( 'DialogIO', DialogIO );
export default DialogIO;
@@ -481,15 +481,9 @@
 %0A  /
-**%0A   *
+/
  Sin
@@ -591,18 +591,18 @@
 esn't%0A  
- *
+//
  matter,
@@ -709,18 +709,18 @@
  when%0A  
- *
+//
  setting
@@ -731,93 +731,8 @@
 te.%0A
-   * @override%0A   * @public%0A   * @param %7BDialog%7D dialog%0A   * @returns %7Bstring%7D%0A   */%0A
   to
@@ -746,17 +746,17 @@
 ject
-(
+:
  dialog 
 ) %7B%0A
@@ -755,22 +755,10 @@
 log 
-) %7B%0A    return
+=%3E
  dia
@@ -780,13 +780,8 @@
 ioID
-;%0A  %7D
 %0A%7D )

Use arrow functions in IOType state functions, see https://github.com/phetsims/tandem/issues/211