// Copyright 2018-2020, University of Colorado Boulder

/**
 * Convenience type for vertical slider.
 * See https://github.com/phetsims/sun/issues/380
 *
 * @author Chris Malley (PixelZoom, Inc.)
 */

import InstanceRegistry from '../../phet-core/js/documentation/InstanceRegistry.js';
import inherit from '../../phet-core/js/inherit.js';
import merge from '../../phet-core/js/merge.js';
import Orientation from '../../phet-core/js/Orientation.js';
import swapObjectKeys from '../../phet-core/js/swapObjectKeys.js';
import Slider from './Slider.js';
import sun from './sun.js';

/**
 * @param {Property.<number>} valueProperty
 * @param {Range} range
 * @param {Object} [options]
 * @constructor
 */
function VSlider( valueProperty, range, options ) {

  assert && assert( !options || options.orientation === undefined, 'VSlider sets orientation' );

  options = merge( {
    orientation: Orientation.VERTICAL
  }, options );

  // swap dimensions because Slider.js expects these set up as dimensions for a horizontal slider.
  // These aren't specified in options above, because we want to check against undefined and to use Slider.js defaults.
  if ( options.trackSize !== undefined ) {
    options.trackSize = options.trackSize.flipped();
  }
  if ( options.thumbSize !== undefined ) {
    options.thumbSize = options.thumbSize.flipped();
  }

  swapObjectKeys( options, 'thumbTouchAreaXDilation', 'thumbTouchAreaYDilation' );
  swapObjectKeys( options, 'thumbMouseAreaXDilation', 'thumbMouseAreaYDilation' );

  Slider.call( this, valueProperty, range, options );

  // support for binder documentation, stripped out in builds and only runs when ?binder is specified
  assert && phet.chipper.queryParameters.binder && InstanceRegistry.registerDataURL( 'sun', 'VSlider', this );
}

sun.register( 'VSlider', VSlider );

inherit( Slider, VSlider );
export default VSlider;
@@ -283,61 +283,8 @@
 s';%0A
-import inherit from '../../phet-core/js/inherit.js';%0A
 impo
@@ -519,20 +519,56 @@
 n.js';%0A%0A
+class VSlider extends Slider %7B%0A%0A  
 /**%0A
+  
  * @para
@@ -603,16 +603,18 @@
 roperty%0A
+  
  * @para
@@ -629,16 +629,18 @@
 %7D range%0A
+  
  * @para
@@ -661,19 +661,23 @@
 tions%5D%0A 
-* @
+  */%0A  
 construc
@@ -683,29 +683,8 @@
 ctor
-%0A */%0Afunction VSlider
 ( va
@@ -716,16 +716,18 @@
 ns ) %7B%0A%0A
+  
   assert
@@ -816,16 +816,18 @@
 on' );%0A%0A
+  
   option
@@ -839,16 +839,18 @@
 erge( %7B%0A
+  
     orie
@@ -879,16 +879,18 @@
 ERTICAL%0A
+  
   %7D, opt
@@ -896,24 +896,26 @@
 tions );%0A%0A  
+ 
+ 
 // swap dime
@@ -999,16 +999,18 @@
 slider.%0A
+  
   // The
@@ -1121,16 +1121,18 @@
 faults.%0A
+  
   if ( o
@@ -1162,32 +1162,34 @@
 defined ) %7B%0A    
+  
 options.trackSiz
@@ -1225,14 +1225,18 @@
 ();%0A
+  
   %7D%0A  
+ 
+ 
 if (
@@ -1268,24 +1268,26 @@
 defined ) %7B%0A
+  
     options.
@@ -1331,13 +1331,17 @@
 ();%0A
+  
   %7D%0A%0A
+  
   sw
@@ -1419,16 +1419,18 @@
 ion' );%0A
+  
   swapOb
@@ -1511,26 +1511,16 @@
 %0A%0A  
-Slider.call( this,
+  super(
  val
@@ -1550,16 +1550,18 @@
 ons );%0A%0A
+  
   // sup
@@ -1654,16 +1654,18 @@
 ecified%0A
+  
   assert
@@ -1767,16 +1767,20 @@
 this );%0A
+  %7D%0A
 %7D%0A%0Asun.r
@@ -1813,37 +1813,8 @@
 r );
-%0A%0Ainherit( Slider, VSlider );
 %0Aexp

convert VSlider to ES6 class, https://github.com/phetsims/tasks/issues/1044