";window.open("data:text/html;charset=utf-8,"+encodeURIComponent(t))},getAccessibleDebugHTML:function(){function t(i,r){e+=r+s((i.isRootInstance?"":i.node.tagName)+" "+i.toString())+"
",i.children.forEach(function(e){t(e,r+n)})}var e="",i="font-weight: bold; font-size: 120%; margin-top: 5px;",n="    ";e+='
Accessible Instances

',t(this._rootAccessibleInstance,""),e+='
Parallel DOM

';for(var r=this._rootAccessibleInstance.peer.primarySibling.outerHTML,a=(r=r.replace(/\>\\n<")).split("\n"),o="",h=0;h",u||(o+=n)}return e},foreignObjectRasterization:function(t){function i(t){t.id||(t.id="unknown-canvas-"+s++),r[t.id]=t.toDataURL()}function n(t){if(t.blocks)_.each(t.blocks,function(t){n(t)});else if(t.firstDrawable&&t.lastDrawable){for(var e=t.firstDrawable;e!==t.lastDrawable;e=e.nextDrawable)n(e);n(t.lastDrawable),t.canvas&&t.canvas instanceof window.HTMLCanvasElement&&i(t.canvas)}g.DOMDrawable&&t instanceof g.DOMDrawable&&(t.domElement instanceof window.HTMLCanvasElement&&i(t.domElement),Array.prototype.forEach.call(t.domElement.getElementsByTagName("canvas"),function(t){i(t)}))}var r={},s=0;n(this._rootBackbone);var a=document.implementation.createHTMLDocument("");a.documentElement.innerHTML=this.domElement.outerHTML,a.documentElement.setAttribute("xmlns",a.documentElement.namespaceURI);var o=a.documentElement.getElementsByTagName("canvas");o=Array.prototype.slice.call(o);for(var h=0;h
'+(new window.XMLSerializer).serializeToString(t)+"
",o=new window.Image;o.onload=function(){s.drawImage(o,0,0),n(r.toDataURL())},o.onerror=function(){n(null)};var h=new window.TextEncoderLite("utf-8").encode(a),l=window.fromByteArray(h);o.src="data:image/svg+xml;base64,"+l},set focus(t){if(window.phet&&phet.phetio&&phet.chipper.accessibility&&t)t.trail.lastNode();var e;this.focusProperty.value&&(e=this.focusedNode).focusChangedEmitter.emit1(!1),this.focusProperty.value=t,t?t.trail.lastNode().focusChangedEmitter.emit1(!0):e&&e.blur()},get focus(){return this.focusProperty.value},getFocusedNode:function(){var t=null,e=this.focusProperty.get();return e&&(t=e.trail.lastNode()),t},get focusedNode(){return this.getFocusedNode()}}),e.prototype.dispose=function(){this._input&&this.detachEvents(),this._rootNode.removeRootedDisplay(this),this._accessible&&this._rootAccessibleInstance.dispose()},e.customCursors={"scenery-grab-pointer":["grab","-moz-grab","-webkit-grab","pointer"],"scenery-grabbing-pointer":["grabbing","-moz-grabbing","-webkit-grabbing","pointer"]},e.focusProperty=new u(null,window.phet&&phet.chipper&&phet.chipper.accessibility?{tandem:p.rootTandem.createTandem("display").createTandem("focusProperty"),phetioType:d(A(T))}:{}),e.userGestureEmitter=new r,e.assertSubtreeDisposed=function(t){},e.windowHasFocusProperty=new c(!1),e.attachToWindow=function(){e.globallyAttached||(e.attachedWindowFocusListener=function(){e.windowHasFocusProperty.value=!0},e.attachedWindowBlurListener=function(){e.windowHasFocusProperty.value=!1},window.addEventListener("focus",e.attachedWindowFocusListener),window.addEventListener("blur",e.attachedWindowBlurListener),e.windowHasFocusProperty.value=document.hasFocus(),e.globallyAttached=!0)},e.detachFromWindow=function(){window.removeEventListener("focus",e.attachedWindowFocusListener),window.removeEventListener("blur",e.attachedWindowBlurListener),e.windowHasFocusProperty.value=document.hasFocus(),e.globallyAttached=!1},e.globallyAttached=!1,e}),i("SCENERY/util/DisplayedProperty",["require","AXON/BooleanProperty","PHET_CORE/inherit","SCENERY/scenery"],function(t){function e(t,e,n){i.call(this,!1,n),this.node=t,this.display=e,this.updateListener=this.updateValue.bind(this),this.addedInstancelistener=this.addedInstance.bind(this),this.removedInstancelistener=this.removedInstance.bind(this),t.onStatic("addedInstance",this.addedInstancelistener),t.onStatic("removedInstance",this.removedInstancelistener);for(var r=t.instances,s=0;s=e&&(t(),i.removeListener(r))};return this.addListener(r),r}},{key:"clearTimeout",value:function(t){this.hasListener(t)&&this.removeListener(t)}},{key:"setInterval",value:function(t,e){var i=this,n=0,r=function r(s){for(n+=s;1e3*n>=e&&-1!==i.hasListener(r);)t(),n-=e/1e3};return this.addListener(r),r}},{key:"clearInterval",value:function(t){this.hasListener(t)&&this.removeListener(t)}}]),i}();return i.register("timer",new n)}),i("SCENERY_PHET/accessibility/ariaHerald",["require","AXON/Emitter","SCENERY_PHET/sceneryPhet","PHET_CORE/timer"],function(t){var e=t("AXON/Emitter"),i=t("SCENERY_PHET/sceneryPhet"),n=t("PHET_CORE/timer"),r=document.getElementById("polite-1"),s=document.getElementById("polite-2"),a=document.getElementById("polite-3"),o=document.getElementById("polite-4"),h=[r,s,a,o],l=function(){function t(){_classCallCheck(this,t),this.initialized=!1,this.elementIndex=0,this.announcingEmitter=null}return _createClass(t,[{key:"initialize",value:function(){var t=this;this.initialized=!0,this.announcingEmitter=new e({valueTypes:["string","boolean"]}),this.announcingEmitter.addListener(function(e,i){var n=h[t.elementIndex];t.updateLiveElement(n,e,i),t.elementIndex=(t.elementIndex+1)%h.length})}},{key:"announcePolite",value:function(t,e){this.announcingEmitter.emit(t,e||!0)}},{key:"updateLiveElement",value:function(t,e,i){this.initialized&&((i=void 0===i||i)&&(t.textContent=""),t.textContent=e,n.setTimeout(function(){t.textContent=""},200))}}]),t}();return i.register("ariaHerald",new l)}),i("SCENERY_PHET/accessibility/UtteranceQueueIO",["require","TANDEM/types/BooleanIO","TANDEM/types/ObjectIO","TANDEM/phetioInherit","SCENERY_PHET/sceneryPhet","TANDEM/types/StringIO","TANDEM/types/VoidIO","ifphetio!PHET_IO/assertInstanceOf"],function(t){function e(t,e){n.call(this,t,e)}var i=t("TANDEM/types/BooleanIO"),n=t("TANDEM/types/ObjectIO"),r=t("TANDEM/phetioInherit"),s=t("SCENERY_PHET/sceneryPhet"),a=t("TANDEM/types/StringIO"),o=t("TANDEM/types/VoidIO");t("ifphetio!PHET_IO/assertInstanceOf");return r(n,"UtteranceQueueIO",e,{addToBack:{returnType:o,parameterTypes:[a],implementation:function(t){return this.instance.addToBack(t)},documentation:"Add the utterance (string) to the end of the queue.",invocableForReadOnlyInstances:!1},addToFront:{returnType:o,parameterTypes:[a],implementation:function(t){return this.instance.addToFront(t)},documentation:"Add the utterance (string) to the beginning of the queue.",invocableForReadOnlyInstances:!1},setMuted:{returnType:o,parameterTypes:[i],implementation:function(t){this.instance.muted(t)},documentation:"Set whether the utteranceQueue will be muted or not. If muted, utterances still move through the queue but will not be read by screen readers.",invocableForReadOnlyInstances:!1},getMuted:{returnType:i,parameterTypes:[o],implementation:function(){return this.instance.muted()},documentation:"Get whether the utteranceQueue is muted. If muted, utterances still move through the queue but will not be read by screen readers."},setEnabled:{returnType:o,parameterTypes:[i],implementation:function(t){this.instance.enabled(t)},documentation:"Set whether the utteranceQueue will be enabled or not. When enabled, Utterances cannot be added to the queue, and the Queue cannot be cleared. Also nothing will be sent to assistive technology.",invocableForReadOnlyInstances:!1},getEnabled:{returnType:i,parameterTypes:[o],implementation:function(){return this.instance.enabled()},documentation:"Get whether the utteranceQueue is enabled. When enabled, Utterances cannot be added to the queue, and the Queue cannot be cleared. Also nothing will be sent to assistive technology."}},{documentation:"Manages a queue of Utterances that are read in order by a screen reader.",events:["announced"]}),s.register("UtteranceQueueIO",e),e}),i("SCENERY_PHET/accessibility/utteranceQueue",["require","SCENERY_PHET/accessibility/AlertableDef","SCENERY_PHET/accessibility/ariaHerald","TANDEM/PhetioObject","SCENERY_PHET/sceneryPhet","TANDEM/Tandem","PHET_CORE/timer","SCENERY_PHET/accessibility/Utterance","SCENERY_PHET/accessibility/UtteranceQueueIO"],function(t){t("SCENERY_PHET/accessibility/AlertableDef");var e=t("SCENERY_PHET/accessibility/ariaHerald"),i=t("TANDEM/PhetioObject"),n=t("SCENERY_PHET/sceneryPhet"),r=t("TANDEM/Tandem"),s=t("PHET_CORE/timer"),a=t("SCENERY_PHET/accessibility/Utterance"),o=t("SCENERY_PHET/accessibility/UtteranceQueueIO"),h=500,l=function(t){function n(){_classCallCheck(this,n);var t=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return t._initialized=!1,t.queue=[],t._stepInterval=h,t._intervalCallback=null,t._muted=!1,t._enabled=!0,t}return _inherits(n,i),_createClass(n,[{key:"addToBack",value:function(t){this._enabled&&this._initialized&&("string"==typeof t&&(t=new a({alert:t})),this.clearUtteranceGroup(t.uniqueGroupId),this.queue.push(t))}},{key:"addToBackIfDefined",value:function(t){null!==t&&void 0!==t&&this.addToBack(t)}},{key:"addToFront",value:function(t){this._enabled&&this._initialized&&("string"==typeof t&&(t=new a({alert:t})),this.clearUtteranceGroup(t.uniqueGroupId),this.queue.unshift(t))}},{key:"next",value:function(){for(var t=void 0,i=0;in.delayTime){t=n,this.queue.splice(i,1);break}}if(t&&!this._muted&&t.predicate()){var r=t.getTextToAlert();this.phetioStartEvent("announced",{utterance:r}),e.announcePolite(r),this.phetioEndEvent()}}},{key:"clearUtteranceGroup",value:function(t){if(t)for(var e=this.queue.length-1;e>=0;e--){this.queue[e].uniqueGroupId===t&&this.queue.splice(e,1)}}},{key:"clear",value:function(){this.queue=[]}},{key:"setMuted",value:function(t){this._muted=t}},{key:"getMuted",value:function(){return this._muted}},{key:"setEnabled",value:function(t){this._enabled=t}},{key:"getEnabled",value:function(){return this._enabled}},{key:"getStepInterval",value:function(){return this._stepInterval}},{key:"setStepInterval",value:function(t){this._stepInterval=t,this._intervalCallback&&s.clearInterval(this._intervalCallback),this._intervalCallback=s.setInterval(this.stepQueue.bind(this),this._stepInterval)}},{key:"stepQueue",value:function(){if(this._enabled){for(var t=0;t2",B,e.createTandem("areaSlider"),{keyboardStep:1,shiftKeyboardStep:.01,accessibleValuePattern:L,startDrag:function(){N=t.areaProperty.get(),h=t.resistanceProperty.get()},endDrag:function(){var e=t.resistanceProperty.get(),i=t.areaProperty.get()-N,r=e-h;i&&r&&v.addToBack(new y({alert:n(e,r,i,U),uniqueGroupId:"rhoChangeAlert",delayTime:J}))}}),V=new a({children:[c,w,P]});f.addSoundGenerator(new d({resistanceProperty:t.resistanceProperty,resistivityProperty:t.resistivityProperty,resistivitySlider:c,lengthProperty:t.lengthProperty,lengthSlider:w,areaProperty:t.areaProperty,areaSlider:P,resetInProgressProperty:t.resetInProgressProperty})),w.left=c.right+K,P.left=w.right+K,V.centerX=0,s.bottom=V.top-12;var G=new a({children:[s,V],tandem:e.createTandem("content")});o.call(this,G,i)}function i(t,e){var i,n=e&&Math.abs(t)>Q;return t>0?i=n?X:G:t<0&&(i=n?j:z),i}function n(t,e,n,r){var s=i(e,!0),a=i(n,!1);return m.fillIn(V,{letter:r,letterChange:a,rChange:s,resistance:u.getFormattedResistanceValue(t)})}function r(t){var e=t>=100?0:t>=10?1:t<.001?4:t<1?3:2;return m.format(N,P,E.toFixed(t,e),w)}var s=t("PHET_CORE/inherit"),a=t("SCENERY/nodes/Node"),o=t("SUN/Panel"),h=t("RESISTANCE_IN_A_WIRE/resistanceInAWire"),l=t("RESISTANCE_IN_A_WIRE/resistance-in-a-wire/ResistanceInAWireA11yStrings"),u=t("RESISTANCE_IN_A_WIRE/resistance-in-a-wire/ResistanceInAWireConstants"),c=t("RESISTANCE_IN_A_WIRE/resistance-in-a-wire/model/ResistanceInAWireModel"),d=t("RESISTANCE_IN_A_WIRE/resistance-in-a-wire/view/ResistanceSoundGenerator"),p=t("RESISTANCE_IN_A_WIRE/resistance-in-a-wire/view/SliderUnit"),f=t("TAMBO/soundManager"),m=t("PHETCOMMON/util/StringUtils"),g=t("SCENERY/nodes/Text"),E=t("DOT/Util"),y=t("SCENERY_PHET/accessibility/Utterance"),v=t("SCENERY_PHET/accessibility/utteranceQueue"),b=t("string!RESISTANCE_IN_A_WIRE/area"),S=t("string!RESISTANCE_IN_A_WIRE/areaSymbol"),T=t("string!RESISTANCE_IN_A_WIRE/cm"),C=t("string!RESISTANCE_IN_A_WIRE/length"),A=t("string!RESISTANCE_IN_A_WIRE/lengthSymbol"),R=t("string!SCENERY_PHET/symbol.ohms"),w=t("string!RESISTANCE_IN_A_WIRE/ohm"),N=t("string!RESISTANCE_IN_A_WIRE/pattern.0label.1value.2units"),I=t("string!RESISTANCE_IN_A_WIRE/pattern.0resistanceUnits.1lengthUnits"),P=t("string!RESISTANCE_IN_A_WIRE/resistance"),O=t("string!RESISTANCE_IN_A_WIRE/resistivity"),D=t("string!SCENERY_PHET/symbol.resistivity"),x=l.resistivityUnitsPatternString.value,k=l.lengthUnitsPatternString.value,L=l.areaUnitsPatternString.value,M=l.resistivitySliderLabelString.value,Y=l.lengthSliderLabelString.value,B=l.areaSliderLabelString.value,H=l.sliderControlsString.value,q=l.slidersDescriptionString.value,V=l.sizeChangeAlertPatternString.value,F=l.letterRhoString.value,W=l.letterLString.value,U=l.letterAString.value,G=l.growsString.value,z=l.shrinksString.value,X=l.growsALotString.value,j=l.shrinksALotString.value,K=50,J=1e3,Q=(c.getResistanceRange().max-c.getResistanceRange().min)/u.RELATIVE_SIZE_STRINGS.length*2;return h.register("ControlPanel",e),s(o,e)}),i("string!RESISTANCE_IN_A_WIRE/resistanceSymbol",function(){return window.phet.chipper.strings.get("RESISTANCE_IN_A_WIRE/resistanceSymbol")}),i("RESISTANCE_IN_A_WIRE/resistance-in-a-wire/view/FormulaNode",["require","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY/nodes/Path","SCENERY_PHET/PhetFont","PHET_CORE/platform","SCENERY/nodes/Rectangle","RESISTANCE_IN_A_WIRE/resistanceInAWire","RESISTANCE_IN_A_WIRE/resistance-in-a-wire/ResistanceInAWireA11yStrings","RESISTANCE_IN_A_WIRE/resistance-in-a-wire/ResistanceInAWireConstants","KITE/Shape","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text","DOT/Vector2","string!RESISTANCE_IN_A_WIRE/areaSymbol","string!RESISTANCE_IN_A_WIRE/lengthSymbol","string!RESISTANCE_IN_A_WIRE/resistanceSymbol","string!SCENERY_PHET/symbol.resistivity"],function(t){function e(t,e,i){n.call(this,{tandem:e,tagName:"div",labelTagName:"h3",labelContent:v,descriptionContent:b});var h=new p("=",{font:new s({family:u.FONT_FAMILY,size:90}),fill:u.BLACK_COLOR,center:new f(100,0),tandem:e.createTandem("equalsSign")});this.a11yScaleMap={},this.a11yScaleMap[C]=0,this.a11yScaleMap[A]=0,this.a11yScaleMap[R]=0,this.a11yScaleMap[w]=0;var l=[{label:E,center:new f(h.centerX-100,0),property:t.resistanceProperty,color:u.RED_COLOR,cappedSize:!0,tandem:e.createTandem("resistanceSymbol"),scaleKey:C},{label:y,center:new f(h.centerX+120,-90),property:t.resistivityProperty,color:u.BLUE_COLOR,tandem:e.createTandem("resistivitySymbol"),scaleKey:A},{label:g,center:new f(h.centerX+220,-90),property:t.lengthProperty,color:u.BLUE_COLOR,tandem:e.createTandem("lengthSymbol"),scaleKey:w},{label:m,center:new f(h.centerX+170,90),property:t.areaProperty,color:u.BLUE_COLOR,tandem:e.createTandem("areaSymbol"),scaleKey:R}],d=new n({tagName:"p"});a.safari&&(d.renderer="canvas");var S=this;l.forEach(function(t){var e=new p(t.label,{font:new s({family:u.FONT_FAMILY,size:15}),fill:t.color,center:t.center,tandem:t.tandem}),i=o.bounds(e.bounds.dilated(1)),r=new n({children:[i,e]});d.addChild(r);var a=7/t.property.value;t.property.link(function(e){var i=a*e+1;r.setScaleMagnitude(i),r.center=t.center,S.a11yScaleMap[t.scaleKey]=i}),t.property.lazyLink(function(){d.setDescriptionContent(S.getRelativeSizeDescription())})}),this.addChild(d),this.addChild(h),this.addChild(new r(c.lineSegment(150,8,400,8),{stroke:"black",lineWidth:6,tandem:e.createTandem("dividingLine")})),this.mutate(i),d.setDescriptionContent(S.getRelativeSizeDescription())}var i=t("PHET_CORE/inherit"),n=t("SCENERY/nodes/Node"),r=t("SCENERY/nodes/Path"),s=t("SCENERY_PHET/PhetFont"),a=t("PHET_CORE/platform"),o=t("SCENERY/nodes/Rectangle"),h=t("RESISTANCE_IN_A_WIRE/resistanceInAWire"),l=t("RESISTANCE_IN_A_WIRE/resistance-in-a-wire/ResistanceInAWireA11yStrings"),u=t("RESISTANCE_IN_A_WIRE/resistance-in-a-wire/ResistanceInAWireConstants"),c=t("KITE/Shape"),d=t("PHETCOMMON/util/StringUtils"),p=t("SCENERY/nodes/Text"),f=t("DOT/Vector2"),m=t("string!RESISTANCE_IN_A_WIRE/areaSymbol"),g=t("string!RESISTANCE_IN_A_WIRE/lengthSymbol"),E=t("string!RESISTANCE_IN_A_WIRE/resistanceSymbol"),y=t("string!SCENERY_PHET/symbol.resistivity"),v=l.resistanceEquationString.value,b=l.resistanceEquationDescriptionString.value,S=l.rhoLAndAComparablePatternString.value,T=l.lAndAComparablePatternString.value,_=l.noneComparablePatternString.value,C="resistance",A="resistivity",R="area",w="length";h.register("FormulaNode",e),i(n,e,{getRelativeSizeDescription:function(){for(var t=this.a11yScaleMap[C],e=this.a11yScaleMap[A],i=this.a11yScaleMap[R],n=this.a11yScaleMap[w],r=t/e,s=t/i,a=t/n,o=n/i,h=n/e,l=N(r),c=N(a),p=N(s),f=u.RELATIVE_SIZE_MAP.comparable.range,m=Object.keys(u.RELATIVE_SIZE_MAP),g=!1,E=0;E';return e.register("JoistA11yStrings",i),i}),i("SCENERY_PHET/PhetColorScheme",["require","SCENERY/util/Color","SCENERY_PHET/sceneryPhet"],function(t){var e=t("SCENERY/util/Color"),i=t("SCENERY_PHET/sceneryPhet"),n=new e(0,200,0),r=new e(255,85,0),s=new e(0,135,0),a=new e(236,153,55),o=new e(106,206,245),h=new e(254,225,5),l={ACCELERATION:e.GREEN,APPLIED_FORCE:a,BUTTON_YELLOW:h,ELASTIC_ENERGY:new e(153,51,102),FRICTION_FORCE:r,GRAVITATIONAL_FORCE:new e(50,130,215),HEAT_THERMAL_ENERGY:r,IMAGINARY_PART:new e(153,51,102),KINETIC_ENERGY:e.GREEN,NET_WORK:n,NORMAL_FORCE:new e(255,235,0),PHET_LOGO_BLUE:o,PHET_LOGO_YELLOW:h,POSITION:e.BLUE,POTENTIAL_ENERGY:e.BLUE,REAL_PART:new e(255,153,0),RED_COLORBLIND:r,RESET_ALL_BUTTON_BASE_COLOR:new e(247,151,34),GREEN_COLORBLIND:s,TOTAL_ENERGY:a,TOTAL_FORCE:n,VELOCITY:r,WALL_FORCE:new e(153,51,0)};return i.register("PhetColorScheme",l),l}),i("SCENERY_PHET/ResetShape",["require","PHET_CORE/inherit","SCENERY_PHET/sceneryPhet","KITE/Shape"],function(t){function e(t){r.call(this);var e=.4*t,i=.625*t,n=2.25*(i-e),s=.35*-Math.PI,a=-2*Math.PI*.85,o=.18*-Math.PI;this.moveTo(e*Math.cos(s),e*Math.sin(s)),this.lineTo(i*Math.cos(s),i*Math.sin(s));var h=s+a;this.arc(0,0,i,s,h,!0);var l=(n-(i-e))/2;this.lineTo((i+l)*Math.cos(h),(i+l)*Math.sin(h));var u=.55*(i+e);this.lineTo(u*Math.cos(h+o),u*Math.sin(h+o)),this.lineTo((e-l)*Math.cos(h),(e-l)*Math.sin(h)),this.lineTo(e*Math.cos(h),e*Math.sin(h)),this.arc(0,0,e,h,s),this.close()}var i=t("PHET_CORE/inherit"),n=t("SCENERY_PHET/sceneryPhet"),r=t("KITE/Shape");return n.register("ResetShape",e),i(r,e)}),i("SUN/buttons/ButtonInteractionState",["require","SUN/sun"],function(t){var e={IDLE:"IDLE",OVER:"OVER",PRESSED:"PRESSED",DISABLED:"DISABLED",DISABLED_PRESSED:"DISABLED_PRESSED"};return t("SUN/sun").register("ButtonInteractionState",e),e}),i("SUN/buttons/PushButtonInteractionStateProperty",["require","SUN/buttons/ButtonInteractionState","AXON/DerivedProperty","PHET_CORE/inherit","SUN/sun"],function(t){function e(t,e){n.call(this,[t.overProperty,t.looksPressedProperty,t.enabledProperty],function(t,e,n){return n?t&&!e?i.OVER:t&&e?i.PRESSED:i.IDLE:i.DISABLED},e)}var i=t("SUN/buttons/ButtonInteractionState"),n=t("AXON/DerivedProperty"),r=t("PHET_CORE/inherit");return t("SUN/sun").register("PushButtonInteractionStateProperty",e),r(n,e)}),i("SCENERY/input/EventIO",["require","TANDEM/types/ObjectIO","TANDEM/phetioInherit","SCENERY/scenery","DOT/Vector2IO","ifphetio!PHET_IO/assertInstanceOf"],function(t){function e(t,e){i.call(this,t,e)}var i=t("TANDEM/types/ObjectIO"),n=t("TANDEM/phetioInherit"),r=t("SCENERY/scenery"),s=t("DOT/Vector2IO");t("ifphetio!PHET_IO/assertInstanceOf");return n(i,"EventIO",e,{},{get documentation(){return"An event, with a point"},isInstance:function(t){return t instanceof r.Event},toStateObject:function(t){var e={type:t.type,domEventType:t.domEvent.type};return t.pointer&&t.pointer.point&&(e.point=s.toStateObject(t.pointer.point)),e}}),r.register("EventIO",e)}),i("SCENERY/listeners/PressListener",["require","AXON/BooleanProperty","AXON/DerivedProperty","AXON/Emitter","AXON/EmitterIO","SCENERY/input/Event","SCENERY/input/EventIO","PHET_CORE/inherit","SCENERY/input/Mouse","SCENERY/nodes/Node","AXON/ObservableArray","TANDEM/PhetioObject","SCENERY/scenery","TANDEM/Tandem","PHET_CORE/timer","TANDEM/types/VoidIO"],function(t){function e(t){var e=this;t=_.extend({mouseButton:0,pressCursor:"pointer",press:_.noop,release:_.noop,drag:_.noop,targetNode:null,attach:!0,canStartPress:b,a11yLooksPressedInterval:100,tandem:f.required,phetioReadOnly:d.DEFAULT_OPTIONS.phetioReadOnly},t),this._id=E++,this._mouseButton=t.mouseButton,this._a11yLooksPressedInterval=t.a11yLooksPressedInterval,this._pressCursor=t.pressCursor,this._pressListener=t.press,this._releaseListener=t.release,this._dragListener=t.drag,this._canStartPress=t.canStartPress,this._targetNode=t.targetNode,this._attach=t.attach,this.overPointers=new c,this.isPressedProperty=new i(!1,{reentrant:!0}),this.isOverProperty=new i(!1),this.isHoveringProperty=new i(!1),this.isHighlightedProperty=new i(!1),this.isFocusedProperty=new i(!1),this.pointer=null,this.pressedTrail=null,this.interrupted=!1,this._listeningToPointer=!1,this._isHoveringListener=this.invalidateHovering.bind(this),this._isHighlightedListener=this.invalidateHighlighted.bind(this),this.a11yClickingProperty=new i(!1),this.looksPressedProperty=n.or([this.a11yClickingProperty,this.isPressedProperty]),this._a11yClickingTimeoutListener=null,this._pointerListener={up:this.pointerUp.bind(this),cancel:this.pointerCancel.bind(this),move:this.pointerMove.bind(this),interrupt:this.pointerInterrupt.bind(this)},this.a11yListener={click:this.click.bind(this),focus:this.focus.bind(this),blur:this.blur.bind(this)},this._pressedEmitter=new r({valueTypes:[a,function(t){return null===t||t instanceof u},function(t){return null===t||"function"==typeof t}],tandem:t.tandem.createTandem("pressedEmitter"),phetioDocumentation:"Emits whenever a press occurs. The first argument when emitting can be used to convey info about the Event.",phetioReadOnly:t.phetioReadOnly,phetioEventType:"user",phetioType:y,listener:this.onPress.bind(this)}),this._releasedEmitter=new r({valueTypes:[function(t){return null===t||"function"==typeof t}],tandem:t.tandem.createTandem("releasedEmitter"),phetioDocumentation:"Emits whenever a release occurs.",phetioReadOnly:t.phetioReadOnly,phetioEventType:"user",phetioType:v,listener:this.onRelease.bind(this)}),this.overPointers.lengthProperty.link(this.invalidateOver.bind(this)),this.isFocusedProperty.link(this.invalidateOver.bind(this)),this.overPointers.lengthProperty.link(this._isHoveringListener),this.isPressedProperty.link(this._isHoveringListener),this.overPointers.addItemAddedListener(function(t){t.isDownProperty.link(e._isHoveringListener)}),this.overPointers.addItemRemovedListener(function(t){t.isDownProperty.unlink(e._isHoveringListener)}),this.isHoveringProperty.link(this._isHighlightedListener),this.isPressedProperty.link(this._isHighlightedListener)}var i=t("AXON/BooleanProperty"),n=t("AXON/DerivedProperty"),r=t("AXON/Emitter"),s=t("AXON/EmitterIO"),a=t("SCENERY/input/Event"),o=t("SCENERY/input/EventIO"),h=t("PHET_CORE/inherit"),l=t("SCENERY/input/Mouse"),u=t("SCENERY/nodes/Node"),c=t("AXON/ObservableArray"),d=t("TANDEM/PhetioObject"),p=t("SCENERY/scenery"),f=t("TANDEM/Tandem"),m=t("PHET_CORE/timer"),g=t("TANDEM/types/VoidIO"),E=0,y=s([{name:"event",type:o},{name:"targetNode",type:g},{name:"callback",type:g}]),v=s([{name:"callback",type:g}]),b=_.constant(!0);return p.register("PressListener",e),h(Object,e,{get isPressed(){return this.isPressedProperty.value},getCurrentTarget:function(){return this.pressedTrail.lastNode()},canPress:function(t){return this.canClick()&&(!(t.pointer instanceof l)||t.domEvent.button===this._mouseButton)&&(!this._attach||!t.pointer.isAttached())},canClick:function(){return!this.isPressed&&this._canStartPress()},press:function(t,e,i){return!!this.canPress(t)&&(this._pressedEmitter.emit(t,e||null,i||null),!0)},release:function(t){this._releasedEmitter.emit(t||null)},drag:function(t){this._dragListener(t,this)},interrupt:function(){this.isPressed&&(this.interrupted=!0,this.release())},invalidateOver:function(){this.isOverProperty.value=this.isFocusedProperty.value||this.overPointers.length>0},invalidateHovering:function(){for(var t=this.overPointers.getArray(),e=0;en+this._radius||i>r+this._radius)&&(e<=n||i<=r||(e-=n,i-=r,e*e+i*i<=this._radius*this._radius))},canvasPaintSelf:function(t,e){n.prototype.paintCanvas(t,this,e)},createDOMDrawable:function(t,e){return r.createFromPool(t,e)},createSVGDrawable:function(t,e){return s.createFromPool(t,e)},createCanvasDrawable:function(t,e){return n.createFromPool(t,e)},setRadius:function(t){if(this._radius!==t){this._radius=t,this.invalidateCircle();for(var e=this._drawables.length,i=0;i=s*s}return!1},setShape:function(t){if(null!==t)throw new Error("Cannot set the shape of a scenery.Circle to something non-null");this.invalidatePath()},getShape:function(){return this._shape||(this._shape=this.createCircleShape()),this._shape},hasShape:function(){return!0}}),e}),i("SUN/ColorConstants",["require","SCENERY/util/Color","PHET_CORE/inherit","SUN/sun"],function(t){function e(){}var i=t("SCENERY/util/Color"),n=t("PHET_CORE/inherit");return t("SUN/sun").register("ColorConstants",e),n(Object,e,{},{LIGHT_BLUE:new i(153,206,255),LIGHT_GRAY:new i(220,220,220)})}),i("SCENERY/util/PaintColorProperty",["require","PHET_CORE/inherit","SCENERY/util/PaintDef","SCENERY/display/PaintObserver","AXON/Property","SCENERY/scenery"],function(t){function e(t,e){var i=n.toColor(t);e=_.extend({luminanceFactor:0,useDeepEquality:!0},e),s.call(this,i,e),this._paint=null,this._luminanceFactor=e.luminanceFactor,this._changeListener=this.invalidatePaint.bind(this),this._paintObserver=new r(this._changeListener),this.setPaint(t)}var i=t("PHET_CORE/inherit"),n=t("SCENERY/util/PaintDef"),r=t("SCENERY/display/PaintObserver"),s=t("AXON/Property");return t("SCENERY/scenery").register("PaintColorProperty",e),i(s,e,{setPaint:function(t){this._paint=t,this._paintObserver.setPrimary(t)},set paint(t){this.setPaint(t)},getPaint:function(){return this._paint},get paint(){return this.getPaint()},setLuminanceFactor:function(t){this.luminanceFactor!==t&&(this._luminanceFactor=t,this.invalidatePaint())},set luminanceFactor(t){this.setLuminanceFactor(t)},getLuminanceFactor:function(){return this._luminanceFactor},get luminanceFactor(){return this.getLuminanceFactor()},invalidatePaint:function(){this.value=n.toColor(this._paint).colorUtilsBrightness(this._luminanceFactor)},dispose:function(){this.paint=null,s.prototype.dispose.call(this)}}),e}),i("SCENERY/display/SVGGradientStop",["require","SCENERY/util/Color","PHET_CORE/inherit","PHET_CORE/Poolable","AXON/Property","SCENERY/scenery"],function(t){function e(t,e,i){this.initialize(t,e,i)}var i=t("SCENERY/util/Color"),n=t("PHET_CORE/inherit"),r=t("PHET_CORE/Poolable"),s=t("AXON/Property"),a=t("SCENERY/scenery"),o=new i("transparent");return a.register("SVGGradientStop",e),n(Object,e,{initialize:function(t,e,n){return this.svgGradient=t,this.color=n,this.ratio=e,this.svgElement=this.svgElement||document.createElementNS(a.svgns,"stop"),this.svgElement.setAttribute("offset",e),this.dirty=!0,this.update(),this.propertyListener=this.propertyListener||this.onPropertyChange.bind(this),this.colorListener=this.colorListener||this.markDirty.bind(this),n instanceof s?(n.lazyLink(this.propertyListener),n.value instanceof i&&n.value.changeEmitter.addListener(this.colorListener)):n instanceof i&&n.changeEmitter.addListener(this.colorListener),this},onPropertyChange:function(t,e){e instanceof i&&e.changeEmitter.removeListener(this.colorListener),t instanceof i&&t.changeEmitter.addListener(this.colorListener),this.markDirty()},markDirty:function(){this.dirty=!0,this.svgGradient.markDirty()},update:function(){if(this.dirty){this.dirty=!1;var t=this.color;t instanceof s&&(t=t.value),null===t&&(t="transparent"),"string"==typeof t?o.setCSS(t):o.set(t);var e="stop-opacity: "+o.a.toFixed(20)+";";o.alpha=1;var i="stop-color: "+o.toCSS()+";";this.svgElement.setAttribute("style",i+" "+e)}},dispose:function(){var t=this.color;t instanceof s?(t.hasListener(this.propertyListener)&&t.unlink(this.propertyListener),t.value instanceof i&&t.value.changeEmitter.removeListener(this.colorListener)):t instanceof i&&t.changeEmitter.removeListener(this.colorListener),this.color=null,this.svgGradient=null,this.freeToPool()}}),r.mixInto(e,{initialize:e.prototype.initialize}),e}),i("SCENERY/display/SVGGradient",["require","PHET_CORE/cleanArray","PHET_CORE/inherit","SCENERY/scenery","SCENERY/display/SVGGradientStop"],function(t){function e(t,e){this.initialize(t,e)}var i=t("PHET_CORE/cleanArray"),n=t("PHET_CORE/inherit"),r=t("SCENERY/scenery"),s=t("SCENERY/display/SVGGradientStop");return r.register("SVGGradient",e),n(Object,e,{initialize:function(t,e){this.svgBlock=t,this.gradient=e;var n=void 0!==this.definition;this.definition=this.definition||this.createDefinition(),n||this.definition.setAttribute("gradientUnits","userSpaceOnUse"),e.transformMatrix?this.definition.setAttribute("gradientTransform",e.transformMatrix.getSVGTransform()):this.definition.removeAttribute("gradientTransform");var r=e.getSVGStops();this.stops=i(this.stops);for(var a=0;athis.endRadius,this.largePoint=this.startIsLarger?this.start:this.end,this.maxRadius=Math.max(this.startRadius,this.endRadius),this.minRadius=Math.min(this.startRadius,this.endRadius),this.startRadius,this.endRadius,i.call(this)}var i=t("SCENERY/util/Gradient"),n=t("PHET_CORE/inherit"),r=t("PHET_CORE/platform"),s=t("SCENERY/scenery"),a=t("SCENERY/display/SVGRadialGradient"),o=t("DOT/Vector2");return s.register("RadialGradient",e),n(i,e,{isRadialGradient:!0,createCanvasGradient:function(){return s.scratchContext.createRadialGradient(this.start.x,this.start.y,this.startRadius,this.end.x,this.end.y,this.endRadius)},createSVGPaint:function(t){return a.createFromPool(t,this)},getSVGStops:function(){var t=this.startIsLarger,e=this.maxRadius,i=this.minRadius,n=this.stops.map(function(n){var r=t?1-n.ratio:n.ratio;return i>0&&(r=function(t,e,i,n,s){return i+(r-t)*(1-i)/(1-t)}(0,0,i/e)),{ratio:r,color:n.color}});return t&&n.reverse(),n},toString:function(){var t="new scenery.RadialGradient( "+this.start.x+", "+this.start.y+", "+this.startRadius+", "+this.end.x+", "+this.end.y+", "+this.endRadius+" )";return _.each(this.stops,function(e){t+=".addColorStop( "+e.ratio+", '"+e.color.toString()+"' )"}),t}}),e}),i("SUN/buttons/RoundButtonView",["require","SUN/buttons/ButtonInteractionState","SCENERY/nodes/Circle","SUN/ColorConstants","AXON/DerivedProperty","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY/util/PaintColorProperty","SCENERY/util/RadialGradient","KITE/Shape","SUN/sun","TANDEM/Tandem","DOT/Vector2"],function(t){function e(t,s,a){function l(t){S.cursor=t===i.DISABLED||t===i.DISABLED_PRESSED?null:"pointer"}this.buttonModel=t,a=_.extend({radius:a&&a.content?void 0:30,content:null,cursor:"pointer",baseColor:f,disabledBaseColor:r.LIGHT_GRAY,minXMargin:5,minYMargin:5,fireOnDown:!1,touchAreaDilation:0,mouseAreaDilation:0,stroke:void 0,lineWidth:.5,tandem:d.optional,xContentOffset:0,yContentOffset:0,buttonAppearanceStrategy:e.ThreeDAppearanceStrategy,contentAppearanceStrategy:e.FadeContentWhenDisabled},a),o.call(this);var c=a.content,m=new p(a.xContentOffset,a.yContentOffset);c&&(c.pickable=!1),this.baseColorProperty=new h(a.baseColor);var g=t.createListener({tandem:a.tandem.createTandem("pressListener")});this.addInputListener(g),this.addAccessibleInputListener(g.a11yListener);var E=a.radius||Math.max(c.width+2*a.minXMargin,c.height+2*a.minYMargin)/2,y=new n(E,{fill:a.baseColor,lineWidth:a.lineWidth});this.addChild(y);var v=new a.buttonAppearanceStrategy(y,s,this.baseColorProperty,a);c&&(c.center=m,this.addChild(c));var b=new a.contentAppearanceStrategy(c,s),S=this;s.link(l),this.touchArea=u.circle(0,0,E+a.touchAreaDilation),this.mouseArea=u.circle(0,0,E+a.mouseAreaDilation),this.pickable=null,this.focusHighlight=new u.circle(0,0,E+5),this.mutate(a),this.disposeRoundButtonView=function(){v.dispose(),b.dispose(),g.dispose(),s.hasListener(l)&&s.unlink(l),this.baseColorProperty.dispose()}}var i=t("SUN/buttons/ButtonInteractionState"),n=t("SCENERY/nodes/Circle"),r=t("SUN/ColorConstants"),s=t("AXON/DerivedProperty"),a=t("PHET_CORE/inherit"),o=t("SCENERY/nodes/Node"),h=t("SCENERY/util/PaintColorProperty"),l=t("SCENERY/util/RadialGradient"),u=t("KITE/Shape"),c=t("SUN/sun"),d=t("TANDEM/Tandem"),p=t("DOT/Vector2"),f=r.LIGHT_BLUE;return c.register("RoundButtonView",e),e.ThreeDAppearanceStrategy=function(t,e,r,a){function o(e){switch(e){case i.IDLE:t.fill=I,H.stroke=Y,H.fill=P;break;case i.OVER:t.fill=O,H.stroke=Y,H.fill=D;break;case i.PRESSED:t.fill=x,H.stroke=Y,H.fill=D;break;case i.DISABLED:t.fill=k,H.stroke=B,H.fill=L;break;case i.DISABLED_PRESSED:t.fill=M,H.stroke=B,H.fill=L;break;default:throw new Error("upsupported interactionState: "+e)}}var u=new h(r,{luminanceFactor:.8}),c=new h(r,{luminanceFactor:.7}),d=new h(r,{luminanceFactor:.3}),p=new h(r,{luminanceFactor:-.1}),f=new h(r,{luminanceFactor:-.2}),m=new h(r,{luminanceFactor:-.4}),g=new h(r,{luminanceFactor:-.5}),E=new h(a.disabledBaseColor),y=new h(a.disabledBaseColor,{luminanceFactor:.8}),v=new h(a.disabledBaseColor,{luminanceFactor:.5}),b=new h(a.disabledBaseColor,{luminanceFactor:-.1}),S=new h(a.disabledBaseColor,{luminanceFactor:-.2}),T=new h(a.disabledBaseColor,{luminanceFactor:-.4}),_=new h(a.disabledBaseColor,{luminanceFactor:-.5}),C=new s([r],function(t){return t.withAlpha(0)}),A=new s([E],function(t){return t.withAlpha(0)}),R=t.width/2,w=R-2.5,N=R+2.5,I=new l(2.5,2.5,w,2.5,2.5,N).addColorStop(0,r).addColorStop(1,c),P=new l(-2.5,-2.5,w,-2.5,-2.5,N).addColorStop(0,C).addColorStop(1,g),O=new l(2.5,2.5,w,2.5,2.5,N).addColorStop(0,d).addColorStop(1,u),D=new l(-2.5,-2.5,w,-2.5,-2.5,N).addColorStop(0,C).addColorStop(1,g),x=new l(-2.5,-2.5,0,0,0,N).addColorStop(0,p).addColorStop(.6,f).addColorStop(.8,r).addColorStop(1,u),k=new l(2.5,2.5,w,2.5,2.5,N).addColorStop(0,a.disabledBaseColor).addColorStop(1,v),L=new l(-2.5,-2.5,w,-2.5,-2.5,N).addColorStop(0,A).addColorStop(1,_),M=new l(-2.5,-2.5,0,0,0,N).addColorStop(0,b).addColorStop(.6,S).addColorStop(.8,a.disabledBaseColor).addColorStop(1,y),Y=null,B=null;null===a.stroke?(Y=null,B=null):void 0===a.stroke?(Y=m,B=T):(Y=a.stroke,B=T);var H=new n(R,{lineWidth:a.lineWidth,pickable:!1});t.addChild(H),t.cachedPaints=[I,O,x,k,M],H.cachedPaints=[P,D,L,Y,B],e.link(o),this.dispose=function(){e.hasListener(o)&&e.unlink(o),C.dispose(),A.dispose(),E.dispose(),u.dispose(),c.dispose(),d.dispose(),p.dispose(),f.dispose(),m.dispose(),g.dispose(),y.dispose(),v.dispose(),b.dispose(),S.dispose(),T.dispose(),_.dispose()}},e.FlatAppearanceStrategy=function(t,e,n,r){function s(e){switch(e){case i.IDLE:t.fill=u,t.stroke=m;break;case i.OVER:t.fill=c,t.stroke=m;break;case i.PRESSED:t.fill=d,t.stroke=m;break;case i.DISABLED:t.fill=p,t.stroke=g;break;case i.DISABLED_PRESSED:t.fill=f,t.stroke=g;break;default:throw new Error("upsupported interactionState: "+e)}}var a=new h(n,{luminanceFactor:.4}),o=new h(n,{luminanceFactor:-.4}),l=new h(r.disabledBaseColor,{luminanceFactor:-.4}),u=n,c=a,d=o,p=r.disabledBaseColor,f=p,m=null,g=null;null===r.stroke?(m=null,g=null):void 0===r.stroke?(m=o,g=l):(m=r.stroke,g=l),t.cachedPaints=[u,c,d,p,f,m,g],e.link(s),this.dispose=function(){e.hasListener(s)&&e.unlink(s),a.dispose(),o.dispose(),l.dispose()}},e.FadeContentWhenDisabled=function(t,e){function n(e){t&&(t.opacity=e===i.DISABLED||e===i.DISABLED_PRESSED?.3:1)}e.link(n),this.dispose=function(){e.hasListener(n)&&e.unlink(n)}},a(o,e,{setEnabled:function(t){this.buttonModel.enabledProperty.set(t)},set enabled(t){this.setEnabled(t)},getEnabled:function(){return this.buttonModel.enabledProperty.get()},get enabled(){return this.getEnabled()},setBaseColor:function(t){this.baseColorProperty.paint=t},set baseColor(t){this.setBaseColor(t)},getBaseColor:function(){return this.baseColorProperty.paint},get baseColor(){return this.getBaseColor()},dispose:function(){this.disposeRoundButtonView(),o.prototype.dispose.call(this)}})}),i("SUN/buttons/RoundPushButton",["require","PHET_CORE/inherit","PHET_CORE/documentation/InstanceRegistry","SUN/buttons/PushButtonInteractionStateProperty","SUN/buttons/PushButtonModel","SUN/buttons/RoundButtonView","SUN/sun","TANDEM/Tandem"],function(t){function e(t){var e=this,i=(t=_.extend({tandem:o.required,tagName:"button"},t)).listener;t=_.omit(t,["listener"]),this.buttonModel=new r(t),s.call(this,this.buttonModel,new n(this.buttonModel),t),i&&this.addListener(i),this.disposeRoundPushButton=function(){e.buttonModel.dispose()}}var i=t("PHET_CORE/inherit"),n=(t("PHET_CORE/documentation/InstanceRegistry"),t("SUN/buttons/PushButtonInteractionStateProperty")),r=t("SUN/buttons/PushButtonModel"),s=t("SUN/buttons/RoundButtonView"),a=t("SUN/sun"),o=t("TANDEM/Tandem");return a.register("RoundPushButton",e),i(s,e,{dispose:function(){this.disposeRoundPushButton(),s.prototype.dispose.call(this)},addListener:function(t){this.buttonModel.addListener(t)},removeListener:function(t){this.buttonModel.removeListener(t)}})}),i("SCENERY_PHET/buttons/ResetButton",["require","PHET_CORE/inherit","DOT/Matrix3","SCENERY/nodes/Path","SCENERY_PHET/ResetShape","SUN/buttons/RoundPushButton","SCENERY_PHET/sceneryPhet","TANDEM/Tandem"],function(t){function e(t){var e=t&&t.radius?t.radius:24;t=_.extend({radius:e,minXMargin:.2*e,baseColor:"white",arrowColor:"black",xContentOffset:-.03*e,yContentOffset:-.0125*e,tandem:h.required},t);var i=new r(new s(t.radius),{fill:t.arrowColor}),o=new r(i.shape.transformed(n.scaling(-1,-1)));i.localBounds=i.localBounds.union(o.localBounds),t.content=i,a.call(this,t)}var i=t("PHET_CORE/inherit"),n=t("DOT/Matrix3"),r=t("SCENERY/nodes/Path"),s=t("SCENERY_PHET/ResetShape"),a=t("SUN/buttons/RoundPushButton"),o=t("SCENERY_PHET/sceneryPhet"),h=t("TANDEM/Tandem");return o.register("ResetButton",e),i(a,e)}),i("string!SCENERY_PHET/ResetAllButton.name",function(){return window.phet.chipper.strings.get("SCENERY_PHET/ResetAllButton.name")}),i("SCENERY_PHET/buttons/ResetAllButton",["require","TANDEM/types/BooleanIO","AXON/DerivedProperty","AXON/DerivedPropertyIO","PHET_CORE/inherit","SCENERY_PHET/PhetColorScheme","SCENERY_PHET/buttons/ResetButton","SCENERY_PHET/sceneryPhet","SCENERY_PHET/SceneryPhetA11yStrings","KITE/Shape","TANDEM/Tandem","SCENERY_PHET/accessibility/Utterance","SCENERY_PHET/accessibility/utteranceQueue","string!SCENERY_PHET/ResetAllButton.name"],function(t){function e(t){t=_.extend({radius:f,baseColor:a.RESET_ALL_BUTTON_BASE_COLOR,arrowColor:"white",tandem:c.required,phetioDocumentation:"The orange, round button that can be used to restore the initial state",innerContent:m},t),o.call(this,t),this.focusHighlight=(new u).circle(0,0,t.radius+5),this.isFiringProperty=new n([this.buttonModel.isFiringProperty],function(t){return t},{tandem:t.tandem.createTandem("isFiringProperty"),phetioDocumentation:"Temporarily becomes true while the Reset All button is firing. Commonly used to disable audio effects during reset.",phetioType:r(i),phetioState:!1}),this.isFiringProperty.lazyLink(function(t){p.enabled=!t,t?p.clear():p.addToBack(new d({alert:g,uniqueGroupId:"resetAllButtonAlert",delayTime:500}))})}var i=t("TANDEM/types/BooleanIO"),n=t("AXON/DerivedProperty"),r=t("AXON/DerivedPropertyIO"),s=t("PHET_CORE/inherit"),a=t("SCENERY_PHET/PhetColorScheme"),o=t("SCENERY_PHET/buttons/ResetButton"),h=t("SCENERY_PHET/sceneryPhet"),l=t("SCENERY_PHET/SceneryPhetA11yStrings"),u=t("KITE/Shape"),c=t("TANDEM/Tandem"),d=t("SCENERY_PHET/accessibility/Utterance"),p=t("SCENERY_PHET/accessibility/utteranceQueue"),f=24,m=t("string!SCENERY_PHET/ResetAllButton.name"),g=l.resetAllAlertString.value;return h.register("ResetAllButton",e),s(o,e,{dispose:function(){this.isFiringProperty.dispose(),o.prototype.dispose.call(this)}})}),i("sound!TAMBO/reset-all.mp3",function(){return{base64:"data:audio/mpeg;base64,//swxAADBmUg7gCM3gjdH+EKkCADXz1BJf+Sv+D////B/+wLRCz8Ob7nQMDFvER3BwvY1oeojPpiEQYQL0nv/PTaE9Mj+CGSDyAlZCn+8ALh+7wp/1AwM6X1dlkJsf90b/9q79N/rXbyJO1mvPWrJd51MyMpH2ewI2SON/D/ewqahUQACtOQSosYwemRvEQowgEMcAgGEnpMUTvv//syxA4ACWhZFlm3gBFDi2o3N4ACrPHCPBpQhfbtmAGADTeZ8V0FwZZz7p/u/7+JQnto6loivZdV4Z1XlUuVdY1Lv+XQAAaMTt1uEgAAAAAAAQ8AArHCEEcJahjISY0EG2FI4VnM4hqpkY8GtFIRBaKjcwWceAuhbBTW6J8QDSFrH/mEBxb5d8U53t7PlPAT2yll2jZVACnAARxCcv/7MsQDgkgkcTrd5IA5BAvmCd0NJwsw0uCYBQDJggBQmDskmY6QmZhRg+GCmBMoavWoyp1qZ9gRJUQaaFMf69Sa+yTfVe4x/3OVdnVKMdKDDvJ8gUKw4NzA4GAUJBhODx2QtRhi5B4/L5/Up6DBhyokLWexBtC7iXyfKsZbB1IHwsB9K4vS+CEluYQqOR1866oAMyABVggADJrmg5n/+zLEBgJIfGE2zHjFsQIJ5MmvbIl6YGQHxijkGGCiVoaIA7gQAgYCIETlr1EgBV3RdMlXzWbjsuq6UvqokR/EJJkyOmHTj41omg1p0jAzELohQsQEB1CaikKiLmCCpiHEnncwfadxBGfHpoo+CBIBDCLIqAshdpPKZeluUP5zbxQ5Fvu3t44/T/SvuKjVZsAAAibS0LyzYwBg4UmQ//swxAeCSRxvOG5oy2kGiScdjuSUyKaeHhoOrm7C+YolB04mHJEmPFg4ujKsBTWWAOCpfJlb1d2tzlTmTiLTV3bp7za0Z/919hjJC4APjwAlCbqVZYa9YIgfTGCoeGQZ8GAyeg5QzFUojk+KBe8LhA45CbHJ6Wx5yp6IS93Z2hpf1lDT/OnWyBVfjBwNDw7BVQA2AAC20yWHGcEh//syxAWCSLRTNsz3ZLkJC2fZnrDmJOtswTCEwVN8w4N80jCgRg+bgQ2ZlAGvCpvr+ZeNGYDibCEiEtbiF7+U8GyfPP4FqrmjcgsZvxZu2TncBoq1zVeNoY3tzesBa4DAHRBDkHKgFGZqaGFJMGK8lmeI9GGYaDIEgYMS87YKktC0Pz1IYF1ycmq1d0oztLpbo5gygAAB90/gLdWCH//7MsQFgkeAWThscMVhCQzoqY2xHxCNEsAkwwkGjTICZWaqqJgEyHApoFgGLG1qpMAIEeuJRoLRRABh1Kd0TrzK2zTrRhwIQoA4D5tDKCOUoYhib/itAWJjBk7QIQA3VAMuAxkaMcQTn4E7xdMJHCYATHJ8d7xtudt5pTp/HOv92wABEZXvyYJqAACc4AAh5LJFIWLDCEUAnCYgIj7/+zLECgJHZGNFLG0I8N6L51mNmK4yEwQ9TLMqnwSCuIOiZh5cUHAqAFrkflFRxoKSzB1zNV+bVtzTFHMF8HTNtWTD7ASgQgc8wMwEIoVoSwAJZC4xnnwayFLcWOArlnjWXqlphKpea1oUJjGplVrUSVbIaiwACIKXqAIbCkJolC4htvvMPaJlGBGYs2GDTZ7rCAg0SGnnVO/c3LyA//swxBSARyBfQkzsyrjmjOoo/bCnJEpkPd0gZ9iC7vtGGGKl2kAAGUwCYNUOItz9IT7nuDEarEhGGGU6xn4Q6OKkFzuWPvOXdUnrrRKeZPeqVXa/AuutA8vEkmy0FMVcAAVUU0IjaWiOiMxgzCUhZ452o+UIOYiwkOM20SlAsByQFGEgK1KgqRcBUIw4K60iIsW3kfsKtgyMuAJc//syxB6CRyRfPE1warjhDShc/aSnMUBRTh/IBPpIoaDjIcYxIsSxGgc6qlMXBVILmTyCxPmJV0cW5rMG2YbGyBvyyM8l55zY60oAAIU4AAAIaSrYqIQEfElFgTjnMJHw2qQzO5RX6DQMYziCHJljXIGj1Lg/uRPwjmJqURp8anVTfz/nwJWgAAylAgV/25sFV0/TWgoQTu6sMMgQ5f/7MsQpgEeEa0NM8Mcw4ozpacyZHxExUrTH9IkGJYwZHotnZK1ACitNzotE/KtCjBtkWyT9CpJAAE04AAAIGSFa0o8/kXFQCJSNOjlJMXBfPZVljvn0SHByx0nZmaLtLZhUWI5MxZ8Vqyq/kRNb2FhWAQhF4JzlAWIwJGUCBBgo+ZpSGWanAYmIEgCUkgQuDGq0yGTougTEXYxG8sf/+zLEMwBHPFtBTuUouOEI5pm/bMZ7l8v/mPO/hZqS//RVAAAOQAAABeSt7bAgBtszxhYB4GhfmCazGYHQSxoQqCi4uCYPNhyKv5nqAI+IEn81YVP23nVTg1UKuJgFBcym6jqc1tgSKh7+GcQgsYlghYvyKyCSZhDpfp7VtsLhMhne1ss5ulprWdgGhF1////+lQAAmgBXCzVTjx0u//swxD2CR1RJMU9tKKDTh+Xhn2jGmIARjRpwsB9K/Rp2OQcULFsrMTgiJbVVFARDTgVIrO2LM68uO+Xe6zoLygqYDAHXZYv9C93GliIAACIpsJhZlACo2KnowEyySIHOkHgQ+aPVbNfq0Idrtr///3feAEAAQNgC8i/YOQQHX0FADwKHQYrzKQgCvBcYRHzAgjoF1LnpKoJPe2+e//syxEkCBsBJLw13JjDHhual3LEWrn0OVaiFf///////+sxI8BpgATI1M9DEswQBM5HQWsHIy9CZMJBRtJKIlYABR29sLIgCFgqVFEs/rzNwr16lxYzk0Z+XTSEQCCAaYLrFgYBAgVEmUMG/hn5EUmnhYmUaAkKOhzS6R4YwrNB5+N09H+Wozq88qPEZf/7//+x3rXWiaAA8DIxYRv/7MsRZAsboNyjMe0Rg4YcjQb9swKRhyQCk0QC4oGAk5NY/jOVggMbME4ayRZYUkctGgKLVUbKAgFH2NxZ/52lux9zP73//c1l0f////9m/zSoAYUYAACIg6AStCbiiMpEADA0QTO3szEocjNHR5sswK0CJHEaIaHHaDxon+uQx2/vt1HT+z////6cb9qVYwBnDKpuBeYELM+DoUNT/+zLEZQMHeDkmTXdGMQmJI8m/bMDzfQbiMjoeMxKQWjBMAHMKIOwUOcyQHoIyJdArUH6cSRQxIZHHqep/7/dm+gAPGACIGIX5smYGDLCmKBGdTnm6GiiZYY1YTx1RIeKgO2Q9j4eT/DoIYkNeluT+WUtBez//+mz+pX7jFgKFVaY0D5jYKGAAYYPFpiQqGY9KaK18Zj8BnHvCuFxe//swxGmCR2RHKu7pKLDtiOMBv2jIIxmZF8Y0QmBDgMMlANpjL4zGpXS16K1hPX0GxomhBGQuZhxKHHQwKmNkAiHzBdYytG2gIEWD2sLFBWQnbWwKXmHg0MBwWp554rO1RUAB2G/VFKedTFtPHfo/+z/r8+Y+NgyRCPYKpxnY+AAYEmJoRObfqEZknjeGtw6MiMOSJyXKGrAElmIA//syxHGDx1A3IG17JgDsh2LBz3DAAULJfLtM4iEspM564AP//////R7/SgAKAADCBEEJICixwVRlMVATFDgzGtNGA7sxnAzxgeBgbKonCvXFQykQQgswmAL+UWfmxSfdMGV////UJHIBCjtSJHYxkuBwSIAc0iWMzl+4w9wNwj+AZkmFQsde7wdWgcASELlYukkOySVRrlq3XDW6Nv/7MsR6g4iMLxxt+2YQ+Qbiwb9wwKKMJiAaczkM0yBfYsOOo5MLlbkwJQtDGxZDD8EBg6GmDOQUHgGpAeFEvrRuMVKX9ascvQ1Y0DQDhBYpAJUAiQIIqHhhQzaw9Z2DOxjMuhBipf8yY7ywAX0T2XLRxQNY4Ifo06c5/f93T0//o/+6T1MOpjIiBEQCxg0RQxrE7RA+1oQ1BEwwgA7/+zDEfQPHXDUabfuGANeG4oG/cMBIYwLBQxCV4HGcjSiEJBO0KRUtDKrdm4ef//////1P0SAWJAAUgK8B7ha0wDSy5dQ2dzYbwzNQEw1aX4VYcWMDpDQ1tjRerYl7y6marf//orbXQzEH0HP0U0AISQC0hKmN0MDByAK8YAOOZjDCSAMDgE0adk+VJhTBMEBZgZAS8FWW39NCYrv/+zLEiAMGjDsWDXuGAOmGo82uDNqf///p/6v9uvpCgCIxk4AHdsBA5CBAYnMSCT5mqzTUsDgjzYoE5TwUAV2ZRKRI7GobqUUvzvVwO7/////9vxXVYK9yiYaJgUkDVQUggWtZJMswWJzvUFMzDEcES1TkN+hVkFtgYfVyshBp9CVHASd9/+lfVoffs/aT/+3oSkBBgT5AlYk6rQms//syxJSDBzw1FA3roIDkBWNNnujApKRAhozVgIwtAQowEhGngjd6dRpDYQBq26snZ3+jl3//5H/9LPxm6ggbKSQTGkBwJDr9AEAZRWZh0SYgjAAdh4nEPHBJ1I+L20Vnud4NBUNXf//9lH9PR6myyEnLxTHIxkgIFsgoOhuNFBgNIiwaOJzpdEzxASS7XUMuZitqGWgTH0gqoIlpBP/7MsSfA4boLRZte2YA5YaiAb7owLmO6v9fR6/KM+v+tPb6ahpQsqVkpWKwJLBg4DAOB0YyeFg4COajuYRQYQP8HpT1wceQNLJHn2f///47Y9VxKxrhCkWPuCFhWo81A1FdTJHImAMYU1ZBCzE1tMDAQ7B43PHRwJxW4JQqQFtJU2s7///1dLdz7TLkFTS2Co0qLGjYngEk7e9diUP/+zDEqoMHICsabPMmEM4Eow2e5MIIZrVcxtoYKA8xbIDmUnGddoh0rLaVhaELboGA3I///+32tj0qUhAXA4lABA0VFRzYs5Bxwo8cRAZqIgBjC0wyrCVrVBy0Sl3U0lLcrNkmJX3vXQ9xHrF1kft9KnLd0/5XIPY0tSK0DTykPgmqBACpusgAjZhT0YwByozh1IJWKp2KmeLt9Ov/+zLEt4MG7C8QLXcGENuFYg2eZMLR2pQ6RirmqAoCYKg0PHnDwUA5I6x8afWSCCjoaGWkABNLoLs3MMFnGvzaGfMY2VvKaYxjfVvVP6f/9DGVtSlb//VsrzTGDCnJFXIg08GgaduIVUxBTUUzLjk5LjNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//syxMQDx4gzCgzwxsDphiFBzJkQVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7MsTMggc4KQgN5YhA0YShqJwkmlVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+zDE2QBG9BsHQYXiANIdX3A0iMBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU="}}),i("TAMBO/sound-generators/ResetAllSoundGenerator",["require","PHET_CORE/inherit","TAMBO/sound-generators/SoundClip","TAMBO/tambo","sound!TAMBO/reset-all.mp3"],function(t){function e(t,e){var i=this;n.call(this,s,e);var r=function(t){t&&i.play()};t.link(r),this.disposeResetAllSound=function(){t.unlink(r)}}var i=t("PHET_CORE/inherit"),n=t("TAMBO/sound-generators/SoundClip"),r=t("TAMBO/tambo"),s=t("sound!TAMBO/reset-all.mp3");return r.register("ResetAllSoundGenerator",e),i(n,e,{dispose:function(){this.disposeResetAllSound(),n.prototype.dispose.call(this)}})}),i("SCENERY_PHET/accessibility/nodes/ScreenSummaryNode",["require","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY_PHET/sceneryPhet","SCENERY_PHET/SceneryPhetA11yStrings","PHETCOMMON/util/StringUtils"],function(t){function e(){n.call(this),this.openingSummaryNode=new n({tagName:"p"});var t=new n({tagName:"p",innerContent:h});this.addChild(this.openingSummaryNode),this.addChild(t),this.accessibleOrder=[this.openingSummaryNode,null,t]}var i=t("PHET_CORE/inherit"),n=t("SCENERY/nodes/Node"),r=t("SCENERY_PHET/sceneryPhet"),s=t("SCENERY_PHET/SceneryPhetA11yStrings"),a=t("PHETCOMMON/util/StringUtils"),o=s.screenSummaryMultiScreenIntro.value,h=s.screenSummaryKeyboardShortcutsHint.value,l=s.screenSummarySingleScreenIntroPattern.value;return r.register("ScreenSummaryNode",e),i(n,e,{setIntroString:function(t,e){this.openingSummaryNode.innerContent=e>1?o:a.fillIn(l,{sim:t})}})}),i("JOIST/ScreenView",["require","DOT/Bounds2","PHET_CORE/inherit","JOIST/joist","SCENERY/nodes/Node","AXON/Property","SCENERY_PHET/accessibility/nodes/ScreenSummaryNode","TANDEM/Tandem"],function(t){function e(t){t=_.extend({layoutBounds:l.copy(),addScreenSummaryNode:!1},t),this.layoutBounds=t.layoutBounds,s.call(this,_.extend({layerSplit:!0,excludeInvisible:!0,tandem:h.optional,containerTagName:"article",tagName:"div",labelTagName:"h1"},t)),this.visibleBoundsProperty=new a(t.layoutBounds),this.screenSummaryNode=null,t.addScreenSummaryNode&&(this.screenSummaryNode=new o,this.addChild(this.screenSummaryNode))}var i=t("DOT/Bounds2"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("SCENERY/nodes/Node"),a=t("AXON/Property"),o=t("SCENERY_PHET/accessibility/nodes/ScreenSummaryNode"),h=t("TANDEM/Tandem"),l=new i(0,0,1024,618);return r.register("ScreenView",e),n(s,e,{getLayoutScale:function(t,e){return Math.min(t/this.layoutBounds.width,e/this.layoutBounds.height)},layout:function(t,e){this.resetTransform();var n=this.getLayoutScale(t,e);this.setScaleMagnitude(n);var r=0,s=0;n===t/this.layoutBounds.width?s=(e/n-this.layoutBounds.height)/2:n===e/this.layoutBounds.height&&(r=(t/n-this.layoutBounds.width)/2),this.translate(r,s),this.visibleBoundsProperty.set(new i(-r,-s,t/n-r,e/n-s))},dispose:function(){s.prototype.dispose.call(this),this.disposeScreenView()}},{DEFAULT_LAYOUT_BOUNDS:l})}),i("SCENERY/display/drawables/CanvasNodeDrawable",["require","SCENERY/display/CanvasSelfDrawable","PHET_CORE/inherit","PHET_CORE/Poolable","SCENERY/scenery"],function(t){function e(t,e){this.initializeCanvasSelfDrawable(t,e)}var i=t("SCENERY/display/CanvasSelfDrawable"),n=t("PHET_CORE/inherit"),r=t("PHET_CORE/Poolable"),s=[];return t("SCENERY/scenery").register("CanvasNodeDrawable",e),n(i,e,{paintCanvas:function(t,e,i){if(!e.selfBounds.isEmpty()){var n=t.context;n.save(),n.fillStyle="black",n.strokeStyle="black",n.lineWidth=1,n.lineCap="butt",n.lineJoin="miter",n.lineDash=s,n.lineDashOffset=0,n.miterLimit=10,e.paintCanvas(n),n.restore()}}}),r.mixInto(e),e}),i("SCENERY/nodes/CanvasNode",["require","PHET_CORE/inherit","SCENERY/scenery","SCENERY/display/drawables/CanvasNodeDrawable","SCENERY/nodes/Node","SCENERY/display/Renderer"],function(t){function e(t){s.call(this,t),this.setRendererBitmask(a.bitmaskCanvas)}var i=t("PHET_CORE/inherit"),n=t("SCENERY/scenery"),r=t("SCENERY/display/drawables/CanvasNodeDrawable"),s=t("SCENERY/nodes/Node"),a=t("SCENERY/display/Renderer");return n.register("CanvasNode",e),i(s,e,{_mutatorKeys:["canvasBounds"].concat(s.prototype._mutatorKeys),setCanvasBounds:function(t){this.invalidateSelf(t)},set canvasBounds(t){this.setCanvasBounds(t)},getCanvasBounds:function(){return this.getSelfBounds()},get canvasBounds(){return this.getCanvasBounds()},isPainted:function(){return!0},paintCanvas:function(t){throw new Error("CanvasNode needs paintCanvas implemented")},invalidatePaint:function(){for(var t=this._drawables.length,e=0;e0}),this.addInputListener(new i({tandem:e.tandem.createTandem("inputListener"),fire:function(e){t.get(t.length-1).hide()}})),this.disposeBarrierRectangle=function(){t.lengthProperty.unlink()},this.mutate(e)}var i=t("SCENERY/listeners/FireListener"),n=t("PHET_CORE/inherit"),r=t("SCENERY/nodes/Plane"),s=t("SCENERY_PHET/sceneryPhet"),a=t("TANDEM/Tandem");return s.register("BarrierRectangle",e),n(r,e,{dispose:function(){this.disposeBarrierRectangle(),r.prototype.dispose.call(this)}})}),i("BRAND/../../js/brand",["require","PHET_CORE/Namespace"],function(t){return new(t("PHET_CORE/Namespace"))("brand")}),i("string!JOIST/termsPrivacyAndLicensing",function(){return window.phet.chipper.strings.get("JOIST/termsPrivacyAndLicensing")}),i("string!JOIST/translation.credits.link",function(){return window.phet.chipper.strings.get("JOIST/translation.credits.link")}),i("string!JOIST/thirdParty.credits.link",function(){return window.phet.chipper.strings.get("JOIST/thirdParty.credits.link")}),i("BRAND/Brand",["require","BRAND/../../js/brand","string!JOIST/termsPrivacyAndLicensing","string!JOIST/translation.credits.link","string!JOIST/thirdParty.credits.link"],function(t){var e=t("BRAND/../../js/brand"),i=t("string!JOIST/termsPrivacyAndLicensing"),n=t("string!JOIST/translation.credits.link"),r=t("string!JOIST/thirdParty.credits.link"),s={id:"phet",name:"PhET™ Interactive Simulations",copyright:"Copyright © 2002-{{year}} University of Colorado Boulder",isPhetApp:phet.chipper.queryParameters["phet-app"]||phet.chipper.queryParameters["phet-android-app"],getLinks:function(t,e){return[{text:i,url:"http://phet.colorado.edu/en/licensing/html"},{text:n,url:"http://phet.colorado.edu/translation-credits?simName="+encodeURIComponent(t)+"&locale="+encodeURIComponent(e)},{text:r,url:"http://phet.colorado.edu/third-party-credits?simName="+encodeURIComponent(t)+"&locale="+encodeURIComponent(e)+"#"+t}]}};return e.register("Brand",s),s}),i("JOIST/Heartbeat",["require","JOIST/joist"],function(t){var e=!1,i={start:function(t){e=!0;var i=document.createElement("div");i.style.opacity=0,i.style.position="absolute",i.style.left="0",i.style.top="0",i.style.width="0",i.style.height="0",i.style.clip="rect(0,0,0,0)",i.setAttribute("aria-hidden",!0),t.display.domElement.appendChild(i),t.frameStartedEmitter.addListener(function(){t.frameCounter%1e3==0&&(i.innerHTML=Math.random())})}};return t("JOIST/joist").register("Heartbeat",i),i}),i("JOIST/Frame",["require","DOT/Bounds2","PHET_CORE/inherit","JOIST/joist","SCENERY/util/LinearGradient","SCENERY/nodes/Node","SCENERY/nodes/Rectangle"],function(t){function e(t,e){e=_.extend({xMargin1:6,yMargin1:6,cornerRadius:0},e),a.call(this);var n=t.width+2*e.xMargin1,r=t.height+2*e.yMargin1;this.gradient=new s(0,0,n,0).addColorStop(0,"#fbff41").addColorStop(.1475,"#fef98b").addColorStop(.465,"#feff40").addColorStop(.77,"#fffccd").addColorStop(1,"#fbff41"),this.rectangle=new o(0,0,n,r,e.cornerRadius,e.cornerRadius,{stroke:this.gradient,lineWidth:3,x:t.x-e.xMargin1,y:t.y-e.yMargin1}),this.addChild(this.rectangle),this.mutate(e),this.frameWidth=n,this.frameHeight=r;var h=i.rect(this.rectangle.x,this.rectangle.y,this.frameWidth,this.frameHeight);this.highlightRectangle=o.bounds(h.dilated(.75),{stroke:"transparent",lineWidth:4.5}),this.addChild(this.highlightRectangle)}var i=t("DOT/Bounds2"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("SCENERY/util/LinearGradient"),a=t("SCENERY/nodes/Node"),o=t("SCENERY/nodes/Rectangle");return r.register("Frame",e),n(a,e,{setHighlighted:function(t){this.highlightRectangle.stroke=t?this.gradient:"transparent"}}),e}),i("JOIST/ScreenButton",["require","SCENERY/listeners/FireListener","JOIST/Frame","PHET_CORE/inherit","JOIST/joist","SCENERY/nodes/Node","SCENERY_PHET/PhetColorScheme","SCENERY_PHET/PhetFont","SCENERY/nodes/Rectangle","KITE/Shape","SCENERY/nodes/Text","SCENERY/input/Touch","DOT/Util","SCENERY/nodes/VBox"],function(t){function e(t,e,r,s,g,E){E=_.extend({opacity:1,tandem:g,phetioEventType:"user",phetioDocumentation:"A pressable button in the simulation, in the home screen"},E);var y=e.screens[r],v=p.linear(2,4,.875,.5,e.screens.length);e.screens.length>=5&&(v=.4);var b=t?m:v*m,S=new a({opacity:E.opacity,children:[y.homeScreenIcon],scale:b/y.homeScreenIcon.height}),T=t?new n(S):new l(0,0,S.width,S.height,{stroke:E.showSmallHomeScreenIconFrame?"#dddddd":null,lineWidth:.7}),C=new a({opacity:E.opacity,children:[T,S]}),A=new c(y.name,{font:new h(t?42:18),fill:t?o.BUTTON_YELLOW:"gray",tandem:g.createTandem("text")});A.maxWidth=C.width,s.link(function(e){var i=e===r;T.setHighlighted&&T.setHighlighted(i),S.opacity=t||i?1:.5,A.fill=t||i?"white":"gray"}),f.call(this,{children:[C,A]});var R=new i({fireOnDown:!0,fire:t?function(){e.showHomeScreenProperty.value=!1,s.value=-1}:function(){e.screenIndexProperty.value=r},tandem:E.tandem.createTandem("inputListener")});this.addInputListener(R),this.addAccessibleInputListener({click:function(){t&&R.fire()}}),this.addAccessibleInputListener({focus:function(){!t&&R.fire()}}),this.addAccessibleInputListener({focus:function(){s.value=r},blur:function(){s.value=-1}}),t||(this.highlightListener={over:function(t){s.value=r},out:function(t){s.value=-1}},this.addInputListener({over:function(t){t.pointer instanceof d&&(e.screenIndexProperty.value=r)}})),this.mouseArea=this.touchArea=u.bounds(this.bounds),this.disposeScreenButton=function(){s.unlink()},this.mutate(E)}var i=t("SCENERY/listeners/FireListener"),n=t("JOIST/Frame"),r=t("PHET_CORE/inherit"),s=t("JOIST/joist"),a=t("SCENERY/nodes/Node"),o=t("SCENERY_PHET/PhetColorScheme"),h=t("SCENERY_PHET/PhetFont"),l=t("SCENERY/nodes/Rectangle"),u=t("KITE/Shape"),c=t("SCENERY/nodes/Text"),d=t("SCENERY/input/Touch"),p=t("DOT/Util"),f=t("SCENERY/nodes/VBox"),m=140;return s.register("ScreenButton",e),r(f,e,{dispose:function(){this.disposeScreenButton(),f.prototype.dispose.call(this)}})}),i("JOIST/HomeScreenView",["require","DOT/Bounds2","SCENERY/nodes/HBox","PHET_CORE/inherit","JOIST/joist","JOIST/JoistA11yStrings","SCENERY/nodes/Node","SCENERY_PHET/PhetFont","AXON/Property","JOIST/ScreenButton","JOIST/ScreenView","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text"],function(t){function e(t,e,i){var r=this;i=_.extend({showSmallHomeScreenIconFrame:!1,warningNode:null},i),c.call(this,{layoutBounds:E,tandem:e,labelContent:t.name,descriptionContent:d.fillIn(g,{name:t.name,screens:t.screens.length})});var s=new p(t.name,{font:new h({size:52,family:y}),fill:"white",y:110,tandem:e.createTandem("title")});this.addChild(s),s.scale(Math.min(1,.9*this.layoutBounds.width/s.width)),s.centerX=this.layoutBounds.centerX;var a=new l(-1),v=_.map(t.screens,function(n,r){var s=e.createTandem(n.screenTandem.tail+"LargeButton"),o={tagName:"button",innerContent:n.name,descriptionContent:n.descriptionContent,appendDescription:!0,containerTagName:"li"},h=new u(!0,t,r,a,s,_.extend(o,{resize:!1,cursor:"pointer"})),l=e.createTandem(n.screenTandem.tail+"SmallButton"),c=new u(!1,t,r,a,l,_.extend(o,{spacing:3,cursor:"pointer",showSmallHomeScreenIconFrame:i.showSmallHomeScreenIconFrame}));c.addInputListener(c.highlightListener),h.addInputListener(c.highlightListener);var d=function(){c.visible&&c.focus(),h.visible&&h.focus()};return c.addAccessibleInputListener({focus:d}),h.addAccessibleInputListener({click:d}),c.setAccessibleAttribute("aria-roledescription",m),h.setAccessibleAttribute("aria-roledescription",m),{screen:n,small:c,large:h,index:r}}),b=new o({tagName:"nav",ariaLabel:f}),S=new o({tagName:"ol"});b.addChild(S),this.addChild(b);var T=60;4===t.screens.length&&(T=33),t.screens.length>=5&&(T=20);var C=null;if(this.highlightedScreenButton=null,t.screenIndexProperty.link(function(t){C&&(C.removeAllChildren(),S.removeChild(C));var e=_.map(v,function(e){return e.index===t&&(r.highlightedScreenButton=e.large),e.index===t?e.large:e.small});C=new n({spacing:T,children:e,align:"top",resize:!1,maxWidth:r.layoutBounds.width-118}),S.addChild(C),S.centerX=r.layoutBounds.width/2,S.top=r.layoutBounds.height/3}),i.warningNode){var A=i.warningNode;this.addChild(A),A.centerX=this.layoutBounds.centerX,A.bottom=this.layoutBounds.maxY-20}}var i=t("DOT/Bounds2"),n=t("SCENERY/nodes/HBox"),r=t("PHET_CORE/inherit"),s=t("JOIST/joist"),a=t("JOIST/JoistA11yStrings"),o=t("SCENERY/nodes/Node"),h=t("SCENERY_PHET/PhetFont"),l=t("AXON/Property"),u=t("JOIST/ScreenButton"),c=t("JOIST/ScreenView"),d=t("PHETCOMMON/util/StringUtils"),p=t("SCENERY/nodes/Text"),f=a.simScreens.value,m=a.simScreen.value,g=a.homeScreenDescriptionPattern.value,E=new i(0,0,768,504),y="Century Gothic, Futura";return s.register("HomeScreenView",e),r(c,e,{focusHighlightedScreenButton:function(){this.highlightedScreenButton.focus()}},{TITLE_FONT_FAMILY:y,LAYOUT_BOUNDS:E})}),i("JOIST/HomeScreen",["require","JOIST/HomeScreenView","PHET_CORE/inherit","JOIST/joist","AXON/Property","JOIST/Screen"],function(t){function e(t,e,n){(n=_.extend({backgroundColorProperty:new s(o)},n)).tandem=e,a.call(this,function(){return{}},function(){return new i(t,e.createTandem("view"),_.pick(n,["showSmallHomeScreenIconFrame","warningNode"]))},n)}var i=t("JOIST/HomeScreenView"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("AXON/Property"),a=t("JOIST/Screen"),o="black";return r.register("HomeScreen",e),n(a,e,{},{BACKGROUND_COLOR:o})}),i("SCENERY/input/InputFuzzer",["require","PHET_CORE/inherit","DOT/Random","SCENERY/scenery","DOT/Vector2"],function(t){function e(t,e){var i=this;this.display=t,this.touches=[],this.nextTouchID=1,this.isMouseDown=!1,this.mousePosition=new s,this.random=new n({seed:e}),this.mouseToggleAction=function(){i.mouseToggle()},this.mouseMoveAction=function(){i.mouseMove()},this.touchStartAction=function(){var t=i.createTouch(i.getRandomPosition());i.touchStart(t)},this.touchMoveAction=function(){var t=i.random.sample(i.touches);i.touchMove(t)},this.touchEndAction=function(){var t=i.random.sample(i.touches);i.touchEnd(t),i.removeTouch(t)},this.touchCancelAction=function(){var t=i.random.sample(i.touches);i.touchCancel(t),i.removeTouch(t)}}var i=t("PHET_CORE/inherit"),n=t("DOT/Random"),r=t("SCENERY/scenery"),s=t("DOT/Vector2");return r.register("InputFuzzer",e),i(Object,e,{fuzzEvents:function(t,e,i,n){for(;this.random.nextDouble()<1-1/(t+1);){var r=this.touches.length+(this.isMouseDown?1:0)0}},{key:"timeDownForKey",value:function(t){return this.keyState[t].timeDown}},{key:"clearState",value:function(){this.keyState={}}},{key:"step",value:function(t){if(this.keysAreDown()){var e=1e3*t;for(var i in this.keyState)this.keyState.hasOwnProperty(i)&&this.keyState[i].keyDown&&(this.keyState[i].timeDown+=e)}}},{key:"dispose",value:function(){this._disposeKeystateTracker()}},{key:"movementKeysDown",get:function(){return this.rightMovementKeysDown()||this.leftMovementKeysDown()||this.upMovementKeysDown()||this.downMovementKeysDown()}},{key:"enterKeyDown",get:function(){return this.isKeyDown(e.KEY_ENTER)}},{key:"shiftKeyDown",get:function(){return this.isKeyDown(e.KEY_SHIFT)}}]),t}();return i.register("KeyStateTracker",r)}),i("SCENERY/accessibility/KeyboardFuzzer",["require","SCENERY/accessibility/AccessibilityUtil","SCENERY/accessibility/KeyboardUtil","SCENERY/accessibility/KeyStateTracker","DOT/Random","SCENERY/scenery","PHET_CORE/timer"],function(t){var e=t("SCENERY/accessibility/AccessibilityUtil"),i=t("SCENERY/accessibility/KeyboardUtil"),n=t("SCENERY/accessibility/KeyStateTracker"),r=t("DOT/Random"),s=t("SCENERY/scenery"),a=t("PHET_CORE/timer"),o={INPUT:[].concat(_toConsumableArray(i.ARROW_KEYS),[i.KEY_PAGE_UP,i.KEY_PAGE_DOWN,i.KEY_HOME,i.KEY_END,i.KEY_ENTER,i.KEY_SPACE]),DIV:[].concat(_toConsumableArray(i.ARROW_KEYS)),P:[i.KEY_ESCAPE],BUTTON:[i.KEY_ENTER,i.KEY_SPACE]},h=function(){function t(e,i){_classCallCheck(this,t),this.display=e,this.random=new r({seed:i}),this.keyStateTracker=new n,this.keysPressedEachFrame=100,this.keyupListeners=[],this.currentElement=null}return _createClass(t,[{key:"chooseNextElement",value:function(){if(null===this.currentElement)this.currentElement=document.activeElement;else if(this.random.nextDouble()<.1){this.clearListeners();var t=e.getRandomFocusable();t.focus(),this.currentElement=t}}},{key:"clearListeners",value:function(){this.keyupListeners.forEach(function(t){a.clearTimeout(t),t()})}},{key:"triggerClickEvent",value:function(t){t.click()}},{key:"triggerKeyDownUpEvents",value:function(t,e){var i=this;this.keyStateTracker.isKeyDown(e)||(this.triggerDOMEvent("keydown",t,e),this.keyupListeners.push(a.setTimeout(function(){i.triggerDOMEvent("keyup",t,e)},this.random.nextInt(200))))}},{key:"triggerRandomKeyDownUpEvents",value:function(t){var e=Math.floor(214*this.random.nextDouble()+9);this.triggerKeyDownUpEvents(t,e)}},{key:"fuzzBoardEvents",value:function(){this.chooseNextElement();for(var t=0;t=this.windowSize},updateRunningAverage:function(t){return this.numSamples=Math.min(this.windowSize,this.numSamples+1),this.total-=this.samples[this.sampleIndex],this.total+=t,this.samples[this.sampleIndex]=t,this.sampleIndex=(this.sampleIndex+1)%this.windowSize,this.getRunningAverage()}})}),i("JOIST/MemoryMonitor",["require","JOIST/joist","DOT/RunningAverage"],function(t){var e=t("JOIST/joist"),i=t("DOT/RunningAverage"),n=1048576,r=!1,s=function(){function t(e){_classCallCheck(this,t),e=_.extend({windowSize:2e3,memoryLimit:phet.chipper.queryParameters.memoryLimit},e),this.memoryLimit=e.memoryLimit*n,this.runningAverage=new i(e.windowSize),this.lastMemory=0}return _createClass(t,[{key:"measure",value:function(){if(window.performance&&window.performance.memory&&window.performance.memory.usedJSHeapSize){var e=window.performance.memory.usedJSHeapSize;this.lastMemory=e;var i=this.runningAverage.updateRunningAverage(e);if(this.memoryLimit&&this.runningAverage.isSaturated()&&!r&&i>this.memoryLimit&&e>.5*this.memoryLimit)throw r=!0,new Error("Average memory used ("+t.memoryString(i)+") is above our memoryLimit ("+t.memoryString(this.memoryLimit)+"). Current memory: "+t.memoryString(e)+".")}}}],[{key:"memoryString",value:function(t){return Math.ceil(t/n)+"MB"}}]),t}();return e.register("MemoryMonitor",s)}),i("SCENERY/display/drawables/ImageCanvasDrawable",["require","SCENERY/display/CanvasSelfDrawable","PHET_CORE/inherit","PHET_CORE/Poolable","SCENERY/scenery"],function(t){function e(t,e){this.initializeCanvasSelfDrawable(t,e)}var i=t("SCENERY/display/CanvasSelfDrawable"),n=t("PHET_CORE/inherit"),r=t("PHET_CORE/Poolable");return t("SCENERY/scenery").register("ImageCanvasDrawable",e),n(i,e,{paintCanvas:function(t,e,i){var n=1!==e._imageOpacity;if(e._image&&0!==e._image.width&&0!==e._image.height){if(n&&(t.context.save(),t.context.globalAlpha*=e._imageOpacity),e._mipmap&&e.hasMipmaps()){var r=e.getMipmapLevel(i),s=e.getMipmapCanvas(r),a=Math.pow(2,r);t.context.drawImage(s,0,0,s.width*a,s.height*a)}else t.context.drawImage(e._image,0,0);n&&t.context.restore()}},markDirtyImage:function(){this.markPaintDirty()},markDirtyMipmap:function(){this.markPaintDirty()},markDirtyImageOpacity:function(){this.markPaintDirty()}}),r.mixInto(e),e}),i("SCENERY/display/drawables/ImageStatefulDrawable",["require","PHET_CORE/inheritance","SCENERY/scenery","SCENERY/display/SelfDrawable"],function(t){t("PHET_CORE/inheritance");var e=t("SCENERY/scenery"),i=(t("SCENERY/display/SelfDrawable"),{mixInto:function(t){var e=t.prototype;e.initializeState=function(t,e){return this.paintDirty=!0,this.dirtyImage=!0,this.dirtyImageOpacity=!0,this.dirtyMipmap=!0,this},e.disposeState=function(){},e.markPaintDirty=function(){this.paintDirty=!0,this.markDirty()},e.markDirtyImage=function(){this.dirtyImage=!0,this.markPaintDirty()},e.markDirtyImageOpacity=function(){this.dirtyImageOpacity=!0,this.markPaintDirty()},e.markDirtyMipmap=function(){this.dirtyMipmap=!0,this.markPaintDirty()},e.setToCleanState=function(){this.paintDirty=!1,this.dirtyImage=!1,this.dirtyImageOpacity=!1,this.dirtyMipmap=!1}}});return e.register("ImageStatefulDrawable",i),i}),i("SCENERY/display/drawables/ImageDOMDrawable",["require","SCENERY/display/DOMSelfDrawable","SCENERY/display/drawables/ImageStatefulDrawable","PHET_CORE/inherit","PHET_CORE/Poolable","SCENERY/scenery","SCENERY/util/Util"],function(t){function e(t,e){this.initializeDOMSelfDrawable(t,e),this.initializeState(t,e),this.domElement||(this.domElement=document.createElement("img"),this.domElement.style.display="block",this.domElement.style.position="absolute",this.domElement.style.pointerEvents="none",this.domElement.style.left="0",this.domElement.style.top="0"),this.hasOpacity=!1,a.Util.prepareForTransform(this.domElement,this.forceAcceleration)}var i=t("SCENERY/display/DOMSelfDrawable"),n=t("SCENERY/display/drawables/ImageStatefulDrawable"),r=t("PHET_CORE/inherit"),s=t("PHET_CORE/Poolable"),a=t("SCENERY/scenery");t("SCENERY/util/Util");return a.register("ImageDOMDrawable",e),r(i,e,{updateDOM:function(){var t=this.node,e=this.domElement;this.paintDirty&&this.dirtyImage&&(e.src=t._image?t._image.src:"//:0"),this.dirtyImageOpacity&&(1===t._imageOpacity?this.hasOpacity&&(this.hasOpacity=!1,e.style.opacity=""):(this.hasOpacity=!0,e.style.opacity=t._imageOpacity)),this.transformDirty&&a.Util.applyPreparedTransform(this.getTransformMatrix(),this.domElement,this.forceAcceleration),this.setToCleanState(),this.transformDirty=!1},dispose:function(){this.disposeState(),i.prototype.dispose.call(this)}}),n.mixInto(e),s.mixInto(e),e}),i("SCENERY/display/drawables/ImageSVGDrawable",["require","SCENERY/display/drawables/ImageStatefulDrawable","PHET_CORE/inherit","PHET_CORE/platform","PHET_CORE/Poolable","SCENERY/scenery","SCENERY/display/SVGSelfDrawable"],function(t){function e(t,e){this.initializeSVGSelfDrawable(t,e,!1,h);var i=this;this.svgElement=this.svgElement||document.createElementNS(a.svgns,"image"),this.svgElement.setAttribute("x",0),this.svgElement.setAttribute("y",0),this.hasOpacity=!1,this._usingMipmap=!1,this._mipmapLevel=-1,this._mipmapTransformListener=this._mipmapTransformListener||function(){i.markDirtyMipmap()},this._mipmapListener=this._mipmapListener||function(){i.markDirtyMipmap(),i.updateMipmapStatus(i.node._mipmap)},this.node.onStatic("mipmap",this._mipmapListener),this.updateMipmapStatus(e.node._mipmap)}var i=t("SCENERY/display/drawables/ImageStatefulDrawable"),n=t("PHET_CORE/inherit"),r=t("PHET_CORE/platform"),s=t("PHET_CORE/Poolable"),a=t("SCENERY/scenery"),o=t("SCENERY/display/SVGSelfDrawable"),h=!0;return a.register("ImageSVGDrawable",e),n(o,e,{updateSVGSelf:function(){var t=this.svgElement;this.dirtyImage?this.node._image?this.updateURL(t,!0):(t.setAttribute("width","0"),t.setAttribute("height","0"),t.setAttributeNS(a.xlinkns,"xlink:href","//:0")):this.dirtyMipmap&&this.node._image&&this.updateURL(t,!1),this.dirtyImageOpacity&&(1===this.node._imageOpacity?this.hasOpacity&&(this.hasOpacity=!1,t.removeAttribute("opacity")):(this.hasOpacity=!0,t.setAttribute("opacity",this.node._imageOpacity)))},updateURL:function(t,e){var i=-1;if(this.node._mipmap&&(i=this.node.getMipmapLevel(this.instance.relativeTransform.matrix)),e||i!==this._mipmapLevel)if(this._mipmapLevel>=0&&-1===i&&(r.ie9||r.ie10?t.setAttribute("transform",""):t.removeAttribute("transform")),this._mipmapLevel=i,this.node._mipmap&&this.node.hasMipmaps()){var n=this.node.getMipmapURL(i),s=this.node.getMipmapCanvas(i);t.setAttribute("width",s.width+"px"),t.setAttribute("height",s.height+"px"),t.setAttribute("transform","scale("+Math.pow(2,i).toFixed(20)+")"),t.setAttributeNS(a.xlinkns,"xlink:href",n)}else t.setAttribute("width",this.node.getImageWidth()+"px"),t.setAttribute("height",this.node.getImageHeight()+"px"),t.setAttributeNS(a.xlinkns,"xlink:href",this.node.getImageURL())},updateMipmapStatus:function(t){this._usingMipmap!==t&&(this._usingMipmap=t,t?(this.instance.relativeTransform.addListener(this._mipmapTransformListener),this.instance.relativeTransform.addPrecompute()):(this.instance.relativeTransform.removeListener(this._mipmapTransformListener),this.instance.relativeTransform.removePrecompute()),this.markDirtyMipmap())},dispose:function(){this.updateMipmapStatus(!1),this.node.offStatic("mipmap",this._mipmapListener),o.prototype.dispose.call(this)}}),i.mixInto(e),s.mixInto(e),e}),i("SCENERY/display/drawables/ImageWebGLDrawable",["require","SCENERY/display/drawables/ImageStatefulDrawable","PHET_CORE/inherit","PHET_CORE/Poolable","SCENERY/display/Renderer","SCENERY/scenery","DOT/Vector2","SCENERY/display/WebGLSelfDrawable"],function(t){function e(t,e){this.initializeWebGLSelfDrawable(t,e),this.vertexArray||(this.vertexArray=new Float32Array(6*l)),this.upperLeft=new o,this.lowerLeft=new o,this.upperRight=new o,this.lowerRight=new o,this.xyDirty=!0,this.uvDirty=!0,this.updatedOnce=!1,this.sprite=null}var i=t("SCENERY/display/drawables/ImageStatefulDrawable"),n=t("PHET_CORE/inherit"),r=t("PHET_CORE/Poolable"),s=t("SCENERY/display/Renderer"),a=t("SCENERY/scenery"),o=t("DOT/Vector2"),h=t("SCENERY/display/WebGLSelfDrawable"),l=5,u=0*l,c=1*l,d=2*l,p=3*l,f=4*l,m=5*l;return a.register("ImageWebGLDrawable",e),n(h,e,{webglRenderer:s.webglTexturedTriangles,onAddToBlock:function(t){this.webglBlock=t,this.markDirty(),this.reserveSprite()},onRemoveFromBlock:function(t){this.unreserveSprite()},reserveSprite:function(){if(this.sprite){if(this.sprite.image===this.node._image)return;this.unreserveSprite()}var t=this.node.getImageWidth(),e=this.node.getImageHeight();this.sprite=t>0&&e>0?this.webglBlock.addSpriteSheetImage(this.node._image,t,e):null,this.xyDirty=!0,this.uvDirty=!0},unreserveSprite:function(){this.sprite&&this.webglBlock.removeSpriteSheetImage(this.sprite),this.sprite=null},markTransformDirty:function(){this.xyDirty=!0,h.prototype.markTransformDirty.call(this)},markPaintDirty:function(){this.xyDirty=!0,this.uvDirty=!0,this.markDirty()},update:function(){if(!h.prototype.update.call(this))return!1;if(this.reserveSprite(),!this.dirtyImageOpacity&&this.updatedOnce||(this.vertexArray[u+4]=this.node._imageOpacity,this.vertexArray[c+4]=this.node._imageOpacity,this.vertexArray[d+4]=this.node._imageOpacity,this.vertexArray[p+4]=this.node._imageOpacity,this.vertexArray[f+4]=this.node._imageOpacity,this.vertexArray[m+4]=this.node._imageOpacity),this.updatedOnce=!0,!this.sprite)return!1;if(this.uvDirty){this.uvDirty=!1;var t=this.sprite.uvBounds;this.vertexArray[u+2]=t.minX,this.vertexArray[u+3]=t.minY,this.vertexArray[c+2]=t.minX,this.vertexArray[c+3]=t.maxY,this.vertexArray[d+2]=t.maxX,this.vertexArray[d+3]=t.minY,this.vertexArray[p+2]=t.maxX,this.vertexArray[p+3]=t.minY,this.vertexArray[f+2]=t.minX,this.vertexArray[f+3]=t.maxY,this.vertexArray[m+2]=t.maxX,this.vertexArray[m+3]=t.maxY}if(this.xyDirty){this.xyDirty=!1;var e=this.node.getImageWidth(),i=this.node.getImageHeight(),n=this.instance.relativeTransform.matrix;n.multiplyVector2(this.upperLeft.setXY(0,0)),n.multiplyVector2(this.lowerLeft.setXY(0,i)),n.multiplyVector2(this.upperRight.setXY(e,0)),n.multiplyVector2(this.lowerRight.setXY(e,i)),this.vertexArray[u+0]=this.upperLeft.x,this.vertexArray[u+1]=this.upperLeft.y,this.vertexArray[c+0]=this.lowerLeft.x,this.vertexArray[c+1]=this.lowerLeft.y,this.vertexArray[d+0]=this.upperRight.x,this.vertexArray[d+1]=this.upperRight.y,this.vertexArray[p+0]=this.upperRight.x,this.vertexArray[p+1]=this.upperRight.y,this.vertexArray[f+0]=this.lowerLeft.x,this.vertexArray[f+1]=this.lowerLeft.y,this.vertexArray[m+0]=this.lowerRight.x,this.vertexArray[m+1]=this.lowerRight.y}return!0},dispose:function(){h.prototype.dispose.call(this)}}),i.mixInto(e),r.mixInto(e),e}),i("SCENERY/nodes/Image",["require","DOT/Bounds2","PHET_CORE/cleanArray","PHET_CORE/extendDefined","SCENERY/display/drawables/ImageCanvasDrawable","SCENERY/display/drawables/ImageDOMDrawable","SCENERY/display/drawables/ImageSVGDrawable","SCENERY/display/drawables/ImageWebGLDrawable","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY/display/Renderer","SCENERY/scenery","SCENERY/util/SpriteSheet"],function(t){function e(t,e){this._initialWidth=m.initialWidth,this._initialHeight=m.initialHeight,this._imageOpacity=m.imageOpacity,this._mipmap=m.mipmap,this._mipmapBias=m.mipmapBias,this._mipmapInitialLevel=m.mipmapInitialLevel,this._mipmapMaxLevel=m.mipmapMaxLevel,this._mipmapCanvases=[],this._mipmapURLs=[],this._mipmapData=null,this._imageLoadListener=this.onImageLoad.bind(this),this._imageLoadListenerAttached=!1,e=r({image:t},e),u.call(this,e),this.invalidateSupportedRenderers()}var i=t("DOT/Bounds2"),n=t("PHET_CORE/cleanArray"),r=t("PHET_CORE/extendDefined"),s=t("SCENERY/display/drawables/ImageCanvasDrawable"),a=t("SCENERY/display/drawables/ImageDOMDrawable"),o=t("SCENERY/display/drawables/ImageSVGDrawable"),h=t("SCENERY/display/drawables/ImageWebGLDrawable"),l=t("PHET_CORE/inherit"),u=t("SCENERY/nodes/Node"),c=t("SCENERY/display/Renderer"),d=t("SCENERY/scenery"),p=t("SCENERY/util/SpriteSheet"),f=Math.log2||function(t){return Math.log(t)/Math.LN2},m={imageOpacity:1,initialWidth:0,initialHeight:0,mipmap:!1,mipmapBias:0,mipmapInitialLevel:4,mipmapMaxLevel:5};return d.register("Image",e),l(u,e,{_mutatorKeys:["image","imageOpacity","initialWidth","initialHeight","mipmap","mipmapBias","mipmapInitialLevel","mipmapMaxLevel"].concat(u.prototype._mutatorKeys),drawableMarkFlags:u.prototype.drawableMarkFlags.concat(["image","imageOpacity","mipmap"]),setImage:function(t){var e=this._image!==t;if(e&&"string"==typeof t&&(this._image&&t===this._image.src&&(e=!1),t===this._mipmapData&&(e=!1)),e){if(this._initialWidth=0,this._initialHeight=0,this._image&&this._imageLoadListenerAttached&&this.detachImageLoadListener(),this._mipmapData=null,"string"==typeof t){var i=t;(t=document.createElement("img")).src=i}else Array.isArray(t)&&(this._mipmapData=t,t=t[0].img,this._mipmapInitialLevel=this._mipmapMaxLevel=this._mipmapData.length,this._mipmap=!0);this._image=t,!(this._image instanceof HTMLImageElement)||this._image.width&&this._image.height||this.attachImageLoadListener(),this.invalidateImage()}return this},set image(t){this.setImage(t)},getImage:function(){return this._image},get image(){return this.getImage()},invalidateImage:function(){this._image?this.invalidateSelf(new i(0,0,this.getImageWidth(),this.getImageHeight())):this.invalidateSelf(i.NOTHING);for(var t=this._drawables.length,e=0;e2){var i=document.createElement("canvas");if(i.width=Math.ceil(e.width/2),i.height=Math.ceil(e.height/2),i.width>0&&i.height>0){var n=i.getContext("2d");n.scale(.5,.5),n.drawImage(e,0,0),this._mipmapCanvases.push(i),this._mipmapURLs.push(i.toDataURL())}}},invalidateMipmaps:function(){if(n(this._mipmapCanvases),n(this._mipmapURLs),this._image&&this._mipmap)if(this._mipmapData)for(var t=0;t=1)return 0;var i=f(1/e);if((i=Math.round(i+this._mipmapBias-.7))<0&&(i=0),i>this._mipmapMaxLevel&&(i=this._mipmapMaxLevel),this.mipmap&&!this._mipmapCanvases[i]){for(var n=this._mipmapCanvases.length-1;++n<=i;)this.constructNextMipmap();return Math.min(i,this._mipmapCanvases.length-1)}return i},getMipmapCanvas:function(t){return this._mipmapData&&this._mipmapData[t]&&this._mipmapData[t].updateCanvas&&this._mipmapData[t].updateCanvas(),this._mipmapCanvases[t]},getMipmapURL:function(t){return this._mipmapURLs[t]},hasMipmaps:function(){return this._mipmapCanvases.length>0},getImageWidth:function(){var t=this._mipmapData?this._mipmapData[0].width:this._image.naturalWidth||this._image.width;return 0===t?this._initialWidth:t},get imageWidth(){return this.getImageWidth()},getImageHeight:function(){var t=this._mipmapData?this._mipmapData[0].height:this._image.naturalHeight||this._image.height;return 0===t?this._initialHeight:t},get imageHeight(){return this.getImageHeight()},getImageURL:function(){return this._image.src},isPainted:function(){return!0},canvasPaintSelf:function(t,e){s.prototype.paintCanvas(t,this,e)},createDOMDrawable:function(t,e){return a.createFromPool(t,e)},createSVGDrawable:function(t,e){return o.createFromPool(t,e)},createCanvasDrawable:function(t,e){return s.createFromPool(t,e)},createWebGLDrawable:function(t,e){return h.createFromPool(t,e)},attachImageLoadListener:function(){this._isDisposed||(this._image.addEventListener("load",this._imageLoadListener),this._imageLoadListenerAttached=!0)},detachImageLoadListener:function(){this._image.removeEventListener("load",this._imageLoadListener),this._imageLoadListenerAttached=!1},onImageLoad:function(){this.invalidateImage(),this.detachImageLoadListener()},dispose:function(){this._image&&this._imageLoadListenerAttached&&this.detachImageLoadListener(),u.prototype.dispose.call(this)}}),e.createSVGImage=function(t,e,i){var n=document.createElementNS(d.svgns,"image");return n.setAttribute("x",0),n.setAttribute("y",0),n.setAttribute("width",e+"px"),n.setAttribute("height",i+"px"),n.setAttributeNS(d.xlinkns,"xlink:href",t),n},e.createFastMipmapFromCanvas=function(t){var e=[],i=t.toDataURL(),n=new window.Image;n.src=i,e.push({img:n,url:i,width:t.width,height:t.height});for(var r=t;r.width>=2&&r.height>=2;){var s={},a=document.createElement("canvas");a.width=s.width=Math.ceil(r.width/2),a.height=s.height=Math.ceil(r.height/2);var o=a.getContext("2d");o.setTransform(.5,0,0,.5,0,0),o.drawImage(r,0,0),s.canvas=a,s.url=a.toDataURL(),s.img=new window.Image,s.img.src=s.url,r=a,e.push(s)}return e},e.DEFAULT_OPTIONS=_.extend({},u.DEFAULT_OPTIONS,m),e}),i("JOIST/HighlightNode",["require","SCENERY/util/Color","SCENERY/nodes/HBox","PHET_CORE/inherit","JOIST/joist","SCENERY/util/LinearGradient","SCENERY/nodes/Rectangle"],function(t){function e(t,e,r){var s=(r=_.extend({fill:"white",highlightWidth:1,pickable:!1},r)).fill,h=i.toColor(s).withAlpha(0),l={fill:new a(0,0,0,e).addColorStop(0,h).addColorStop(.5,s).addColorStop(1,h)},u=new o(0,0,r.highlightWidth,e,l),c=new o(0,0,r.highlightWidth,e,l);r.children=[u,c],r.spacing=t,n.call(this,r)}var i=t("SCENERY/util/Color"),n=t("SCENERY/nodes/HBox"),r=t("PHET_CORE/inherit"),s=t("JOIST/joist"),a=t("SCENERY/util/LinearGradient"),o=t("SCENERY/nodes/Rectangle");return s.register("HighlightNode",e),r(n,e)}),i("JOIST/JoistButton",["require","SUN/buttons/ButtonInteractionState","SCENERY/accessibility/FocusHighlightPath","JOIST/HighlightNode","PHET_CORE/inherit","JOIST/joist","SCENERY/nodes/Node","AXON/Property","SUN/buttons/PushButtonInteractionStateProperty","SUN/buttons/PushButtonModel","KITE/Shape"],function(t){function e(t,e,s,a){(a=_.extend({cursor:"pointer",listener:null,highlightExtensionWidth:0,highlightExtensionHeight:0,highlightCenterOffsetX:0,highlightCenterOffsetY:0},a)).tandem=s,this.buttonModel=new u(a);var d=function(e){return new r(t.width+a.highlightExtensionWidth,t.height+a.highlightExtensionHeight,{centerX:t.centerX+a.highlightCenterOffsetX,centerY:t.centerY+a.highlightCenterOffsetY,fill:e,pickable:!1})},p=d("white"),f=d("black");o.call(this,_.extend({children:[t,p,f]}));var m=new l(this.buttonModel);this.interactionStateProperty=m,h.multilink([m,e],function(t,e){var n="black"!==e;p.visible=!n&&(t===i.OVER||t===i.PRESSED),f.visible=n&&(t===i.OVER||t===i.PRESSED)});var g=this.buttonModel.createListener({tandem:s.createTandem("pressListener")});this.addInputListener(g),this.addAccessibleInputListener(g.a11yListener),this.mouseArea=this.touchArea=c.bounds(this.bounds),this.mutate(a);var E=n.getOuterLineWidthFromNode(this);this.focusHighlight=c.bounds(this.bounds.shiftedY(-E))}var i=t("SUN/buttons/ButtonInteractionState"),n=t("SCENERY/accessibility/FocusHighlightPath"),r=t("JOIST/HighlightNode"),s=t("PHET_CORE/inherit"),a=t("JOIST/joist"),o=t("SCENERY/nodes/Node"),h=t("AXON/Property"),l=t("SUN/buttons/PushButtonInteractionStateProperty"),u=t("SUN/buttons/PushButtonModel"),c=t("KITE/Shape");return a.register("JoistButton",e),s(o,e)}),i("SUN/DialogIO",["require","SCENERY/nodes/NodeIO","TANDEM/phetioInherit","SUN/sun","ifphetio!PHET_IO/assertInstanceOf"],function(t){function e(t,e){i.call(this,t,e)}var i=t("SCENERY/nodes/NodeIO"),n=t("TANDEM/phetioInherit"),r=t("SUN/sun");t("ifphetio!PHET_IO/assertInstanceOf");return n(i,"DialogIO",e,{},{documentation:"A dialog panel"}),r.register("DialogIO",e),e}),i("SUN/buttons/RectangularButtonView",["require","SCENERY/nodes/AlignBox","DOT/Bounds2","SUN/buttons/ButtonInteractionState","SCENERY/util/Color","SUN/ColorConstants","AXON/DerivedProperty","PHET_CORE/inherit","SCENERY/util/LinearGradient","SCENERY/nodes/Node","SCENERY/util/PaintColorProperty","SCENERY/nodes/Path","KITE/Shape","SUN/sun","TANDEM/Tandem"],function(t){function e(t,e,i){return f.roundedRectangleWithRadii(0,0,t,e,{topLeft:"number"==typeof i.leftTopCornerRadius?i.leftTopCornerRadius:i.cornerRadius,topRight:"number"==typeof i.rightTopCornerRadius?i.rightTopCornerRadius:i.cornerRadius,bottomLeft:"number"==typeof i.leftBottomCornerRadius?i.leftBottomCornerRadius:i.cornerRadius,bottomRight:"number"==typeof i.rightBottomCornerRadius?i.rightBottomCornerRadius:i.cornerRadius})}function i(t,a,h){function l(t){w.cursor=t===s.DISABLED||t===s.DISABLED_PRESSED?null:"pointer"}this.buttonModel=t,h=_.extend({content:null,minWidth:y+v,minHeight:E+v,cursor:"pointer",cornerRadius:4,baseColor:b,disabledBaseColor:o.LIGHT_GRAY,xMargin:8,yMargin:5,fireOnDown:!1,touchAreaXDilation:0,touchAreaYDilation:0,stroke:void 0,lineWidth:.5,xAlign:"center",yAlign:"center",tandem:g.optional,buttonAppearanceStrategy:i.ThreeDAppearanceStrategy,contentAppearanceStrategy:i.FadeContentWhenDisabled,tagName:"button"},h),c.call(this);var u=h.content;this._pressListener=t.createListener({tandem:h.tandem.createTandem("pressListener"),accessibleClick:h.accessibleClick}),this.addInputListener(this._pressListener),this.addAccessibleInputListener(this._pressListener.a11yListener),this.baseColorProperty=new d(h.baseColor);var m=Math.max(u?u.width+2*h.xMargin:0,h.minWidth),S=Math.max(u?u.height+2*h.yMargin:0,h.minHeight),T=new p(e(m,S,h),{fill:h.baseColor,lineWidth:h.lineWidth});if(this.addChild(T),u){u&&(u.pickable=!1);var C=new n(u,{alignBounds:new r(h.xMargin,h.yMargin,T.width-h.xMargin,S-h.yMargin),xAlign:h.xAlign,yAlign:h.yAlign});this.addChild(C)}var A=new h.buttonAppearanceStrategy(T,a,this.baseColorProperty,h),R=new h.contentAppearanceStrategy(u,a,h),w=this;a.link(l),this.mouseArea=f.rectangle(0,0,m,S),this.touchArea=f.rectangle(-h.touchAreaXDilation,-h.touchAreaYDilation,m+2*h.touchAreaXDilation,S+2*h.touchAreaYDilation),this.mutate(h),this.disposeRectangularButtonView=function(){A.dispose(),R.dispose(),this.baseColorProperty.dispose(),this._pressListener.dispose(),a.hasListener(l)&&a.unlink(l),u&&C.dispose()}}var n=t("SCENERY/nodes/AlignBox"),r=t("DOT/Bounds2"),s=t("SUN/buttons/ButtonInteractionState"),a=t("SCENERY/util/Color"),o=t("SUN/ColorConstants"),h=t("AXON/DerivedProperty"),l=t("PHET_CORE/inherit"),u=t("SCENERY/util/LinearGradient"),c=t("SCENERY/nodes/Node"),d=t("SCENERY/util/PaintColorProperty"),p=t("SCENERY/nodes/Path"),f=t("KITE/Shape"),m=t("SUN/sun"),g=t("TANDEM/Tandem"),E=7,y=7,v=3,b=o.LIGHT_BLUE;return m.register("RectangularButtonView",i),i.ThreeDAppearanceStrategy=function(t,i,n,r){function o(e){switch(e){case s.IDLE:t.fill=H,X.stroke=l,X.fill=q;break;case s.OVER:t.fill=V,X.stroke=l,X.fill=F;break;case s.PRESSED:t.fill=W,X.stroke=l,X.fill=F;break;case s.DISABLED:t.fill=U,t.stroke=c,X.stroke=c,X.fill=G;break;case s.DISABLED_PRESSED:t.fill=z,t.stroke=c,X.stroke=c,X.fill=G;break;default:throw new Error("unsupported interactionState: "+e)}}var l,c,f=t.width,m=t.height,g=Math.min(E/m,1),b=Math.max(1-v/m,0),S=Math.min(y/f,1),T=Math.max(1-v/f,0),_=new a(255,255,255,.7),C=new d(n,{luminanceFactor:.7}),A=new d(n,{luminanceFactor:.5}),R=new d(n,{luminanceFactor:.2}),w=new d(n,{luminanceFactor:-.3}),N=new d(n,{luminanceFactor:-.4}),I=new d(n,{luminanceFactor:-.5}),P=new d(r.disabledBaseColor),O=new d(r.disabledBaseColor,{luminanceFactor:.7}),D=new d(r.disabledBaseColor,{luminanceFactor:.5}),x=new d(r.disabledBaseColor,{luminanceFactor:.2}),k=new d(r.disabledBaseColor,{luminanceFactor:-.3}),L=new d(r.disabledBaseColor,{luminanceFactor:-.4}),M=new d(r.disabledBaseColor,{luminanceFactor:-.5}),Y=new h([n],function(t){return t.withAlpha(0)}),B=new h([P],function(t){return t.withAlpha(0)}),H=new u(0,0,0,m).addColorStop(0,C).addColorStop(g,n).addColorStop(b,n).addColorStop(1,I),q=new u(0,0,f,0).addColorStop(0,_).addColorStop(S,Y).addColorStop(T,Y).addColorStop(1,I),V=new u(0,0,0,m).addColorStop(0,C).addColorStop(g,A).addColorStop(b,A).addColorStop(1,I),F=new u(0,0,f,0).addColorStop(0,_).addColorStop(S/2,new a(255,255,255,0)).addColorStop(T,Y).addColorStop(1,w),W=new u(0,0,0,m).addColorStop(0,C).addColorStop(.67*g,w).addColorStop(b,R).addColorStop(1,I),U=new u(0,0,0,m).addColorStop(0,O).addColorStop(g,D).addColorStop(b,D).addColorStop(1,M),G=new u(0,0,f,0).addColorStop(0,O).addColorStop(S,B).addColorStop(T,B).addColorStop(1,M),z=new u(0,0,0,m).addColorStop(0,O).addColorStop(.67*g,k).addColorStop(b,x).addColorStop(1,M);null===r.stroke?(l=null,c=null):void 0===r.stroke?(l=N,c=L):(l=r.stroke,c=L);var X=new p(e(f,m,r),{lineWidth:r.lineWidth,pickable:!1});t.addChild(X),t.cachedPaints=[H,V,W,U,z,c],X.cachedPaints=[q,F,G,l,c],i.link(o),this.dispose=function(){i.hasListener(o)&&i.unlink(o),Y.dispose(),B.dispose(),P.dispose(),C.dispose(),A.dispose(),R.dispose(),w.dispose(),N.dispose(),I.dispose(),O.dispose(),D.dispose(),x.dispose(),k.dispose(),L.dispose(),M.dispose()}},i.FlatAppearanceStrategy=function(t,e,i,n){function r(e){switch(e){case s.IDLE:t.fill=c,t.stroke=a;break;case s.OVER:t.fill=p,t.stroke=a;break;case s.PRESSED:t.fill=f,t.stroke=a;break;case s.DISABLED:t.fill=m,t.stroke=o;break;case s.DISABLED_PRESSED:t.fill=g,t.stroke=o;break;default:throw new Error("unsupported interactionState: "+e)}}var a,o,h=new d(i,{luminanceFactor:.4}),l=new d(i,{luminanceFactor:-.4}),u=new d(n.disabledBaseColor,{luminanceFactor:-.4}),c=i,p=h,f=l,m=n.disabledBaseColor,g=m;null===n.stroke?(a=null,o=null):void 0===n.stroke?(a=l,o=u):(a=n.stroke,o=u),t.cachedPaints=[c,p,f,m,g,a,o],e.link(r),this.dispose=function(){e.hasListener(r)&&e.unlink(r),h.dispose(),l.dispose(),u.dispose()}},i.FadeContentWhenDisabled=function(t,e){function i(e){t&&(t.opacity=e===s.DISABLED||e===s.DISABLED_PRESSED?.3:1)}e.link(i),this.dispose=function(){e.hasListener(i)&&e.unlink(i)}},l(c,i,{setEnabled:function(t){this.buttonModel.enabledProperty.set(t)},set enabled(t){this.setEnabled(t)},getEnabled:function(){return this.buttonModel.enabledProperty.get()},get enabled(){return this.getEnabled()},setBaseColor:function(t){this.baseColorProperty.paint=t},set baseColor(t){this.setBaseColor(t)},getBaseColor:function(){return this.baseColorProperty.value},get baseColor(){return this.getBaseColor()},a11yClick:function(){this._pressListener.click()},dispose:function(){this.disposeRectangularButtonView(),c.prototype.dispose.call(this)}})}),i("SUN/buttons/RectangularPushButton",["require","PHET_CORE/inherit","PHET_CORE/documentation/InstanceRegistry","SUN/buttons/PushButtonInteractionStateProperty","SUN/buttons/PushButtonModel","SUN/buttons/RectangularButtonView","SUN/sun","TANDEM/Tandem"],function(t){function e(t){var e=(t=_.extend({tandem:o.required},t)).listener;t=_.omit(t,["listener"]),this.buttonModel=new r(t),e&&this.addListener(e),s.call(this,this.buttonModel,new n(this.buttonModel),t),this.disposeRectangularPushButton=function(){this.buttonModel.dispose()}}var i=t("PHET_CORE/inherit"),n=(t("PHET_CORE/documentation/InstanceRegistry"),t("SUN/buttons/PushButtonInteractionStateProperty")),r=t("SUN/buttons/PushButtonModel"),s=t("SUN/buttons/RectangularButtonView"),a=t("SUN/sun"),o=t("TANDEM/Tandem");return a.register("RectangularPushButton",e),i(s,e,{dispose:function(){this.disposeRectangularPushButton(),s.prototype.dispose.call(this)},addListener:function(t){this.buttonModel.addListener(t)},removeListener:function(t){this.buttonModel.removeListener(t)}})}),i("SUN/SunA11yStrings",["require","SUN/sun"],function(t){var e=t("SUN/sun"),i={accordionBoxCollapse:{value:"Collapse"},accordionBoxExpand:{value:"Expand"},close:{value:"Close"}};if("xss"===phet.chipper.queryParameters.stringTest)for(var n in i)i[n].value+='';return e.register("SunA11yStrings",i),i}),i("SUN/Dialog",["require","SCENERY/accessibility/AccessibilityUtil","SCENERY/accessibility/AccessiblePeer","SCENERY/nodes/AlignBox","SUN/DialogIO","SCENERY/display/Display","SCENERY/util/FullScreen","SCENERY/nodes/HBox","PHET_CORE/inherit","SCENERY/accessibility/KeyboardUtil","SUN/Panel","SCENERY/nodes/Path","SUN/buttons/RectangularButtonView","SUN/buttons/RectangularPushButton","KITE/Shape","SUN/sun","SUN/SunA11yStrings","TANDEM/Tandem","SCENERY/nodes/VBox"],function(t){function e(t,u){var p=this;(u=_.extend({xSpacing:10,ySpacing:10,topMargin:15,bottomMargin:15,leftMargin:null,closeButtonTopMargin:10,closeButtonRightMargin:10,modal:!0,title:null,titleAlign:"center",layoutStrategy:e.DEFAULT_LAYOUT_STRATEGY,closeButtonListener:function(){p.hide()},closeButtonTouchAreaXDilation:0,closeButtonTouchAreaYDilation:0,closeButtonMouseAreaXDilation:0,closeButtonMouseAreaYDilation:0,showCallback:null,hideCallback:null,cornerRadius:10,resize:!0,fill:"white",stroke:"black",backgroundPickable:!0,tandem:v.optional,phetioType:a,phetioReadOnly:!1,phetioState:!1,tagName:"div",ariaRole:"dialog",focusOnCloseNode:null},u)).xMargin=0,u.yMargin=0,null===u.leftMargin&&(u.leftMargin=u.xSpacing+T+u.closeButtonRightMargin),this.isModal=u.modal,this.showCallback=u.showCallback,this.hideCallback=u.hideCallback,this.isShowing=!1;var f=new i({iconLength:T,listener:function(){u.closeButtonListener(),f.buttonModel.isA11yClicking()&&p.focusActiveElement()},tandem:u.tandem.createTandem("closeButton"),phetioReadOnly:u.phetioReadOnly,phetioState:u.phetioState,tagName:"button",innerContent:S});f.touchArea=f.bounds.dilatedXY(u.closeButtonTouchAreaXDilation,u.closeButtonTouchAreaYDilation),f.mouseArea=f.bounds.dilatedXY(u.closeButtonMouseAreaXDilation,u.closeButtonMouseAreaYDilation),this.closeButton=f;var m=new b({children:u.title?[u.title,t]:[t],spacing:u.ySpacing,align:u.titleAlign}),g=new s(m,{topMargin:u.topMargin,bottomMargin:u.bottomMargin,leftMargin:u.leftMargin}),E=new s(f,{topMargin:u.closeButtonTopMargin,rightMargin:u.closeButtonRightMargin}),y=new l({children:[g,E],spacing:u.xSpacing,align:"top"});d.call(this,y,u);var C=window.phet.joist.sim;this.updateLayout=function(){u.layoutStrategy(p,C.boundsProperty.value,C.screenBoundsProperty.value,C.scaleProperty.value)},this.updateLayout(),this.sim=C,this.accessibleOrder=[f,u.title,t].filter(function(t){return void 0!==t}),u.title&&u.title.tagName&&this.addAriaLabelledbyAssociation({thisElementName:r.PRIMARY_SIBLING,otherNode:u.title,otherElementName:r.PRIMARY_SIBLING}),this.sim.resizedEmitter.addListener(this.updateLayout),this.activeElement=u.focusOnCloseNode||null;var A={keydown:function(t){if(t.keyCode===c.KEY_ESCAPE)t.preventDefault(),p.hide(),p.focusActiveElement();else if(t.keyCode===c.KEY_TAB&&h.isFullScreen()){var e=o.focus.trail.getUniqueId(),i=n.getNextFocusable().id===e,r=n.getPreviousFocusable().id===e;i&&r&&t.preventDefault()}}};this.addAccessibleInputListener(A),this.disposeDialog=function(){p.sim.resizedEmitter.removeListener(p.updateLayout),p.removeAccessibleInputListener(A),f.dispose(),y.removeAllChildren(),y.detach()}}function i(t){t=_.extend({iconLength:7,baseColor:"transparent",buttonAppearanceStrategy:f.FlatAppearanceStrategy,xMargin:0,yMargin:0,listener:null},t);var e=(new g).moveTo(-t.iconLength/2,-t.iconLength/2).lineTo(t.iconLength/2,t.iconLength/2).moveTo(t.iconLength/2,-t.iconLength/2).lineTo(-t.iconLength/2,t.iconLength/2);t.content=new p(e,{stroke:"black",lineCap:"round",lineWidth:2}),m.call(this,t)}var n=t("SCENERY/accessibility/AccessibilityUtil"),r=t("SCENERY/accessibility/AccessiblePeer"),s=t("SCENERY/nodes/AlignBox"),a=t("SUN/DialogIO"),o=t("SCENERY/display/Display"),h=t("SCENERY/util/FullScreen"),l=t("SCENERY/nodes/HBox"),u=t("PHET_CORE/inherit"),c=t("SCENERY/accessibility/KeyboardUtil"),d=t("SUN/Panel"),p=t("SCENERY/nodes/Path"),f=t("SUN/buttons/RectangularButtonView"),m=t("SUN/buttons/RectangularPushButton"),g=t("KITE/Shape"),E=t("SUN/sun"),y=t("SUN/SunA11yStrings"),v=t("TANDEM/Tandem"),b=t("SCENERY/nodes/VBox"),S=y.close.value,T=14;return E.register("Dialog",e),e.DEFAULT_LAYOUT_STRATEGY=function(t,e,i,n){t.center=e.center.times(1/n)},u(d,e,{show:function(){this.isShowing||(window.phet.joist.sim.showPopup(this,this.isModal),this.isShowing=!0,this.activeElement=this.activeElement||o.focusedNode,this.setAccessibleViewsVisible(!1),this.updateLayout(),this.showCallback&&this.showCallback())},hide:function(){this.isShowing&&(window.phet.joist.sim.hidePopup(this,this.isModal),this.isShowing=!1,this.setAccessibleViewsVisible(!0),this.hideCallback&&this.hideCallback())},dispose:function(){this.hide(),this.disposeDialog(),d.prototype.dispose.call(this)},setAccessibleViewsVisible:function(t){for(var e=0;e0)&&(e.drawImage(t.img,0,0),delete t.updateCanvas)}}),t}),i("mipmap!JOIST/keyboard-icon-on-white.png",function(){var t=window.phet.chipper.mipmaps["JOIST/keyboard-icon-on-white.png"];return window.phetImages=window.phetImages||[],t.forEach(function(t){t.img=new Image,window.phetImages.push(t.img),t.img.src=t.url,t.canvas=document.createElement("canvas"),t.canvas.width=t.width,t.canvas.height=t.height;var e=t.canvas.getContext("2d");t.updateCanvas=function(){t.img.complete&&(void 0===t.img.naturalWidth||t.img.naturalWidth>0)&&(e.drawImage(t.img,0,0),delete t.updateCanvas)}}),t}),i("JOIST/KeyboardHelpButton",["require","SCENERY/nodes/Image","PHET_CORE/inherit","JOIST/joist","JOIST/JoistA11yStrings","JOIST/JoistButton","JOIST/KeyboardHelpDialog","mipmap!JOIST/keyboard-icon.png","mipmap!JOIST/keyboard-icon-on-white.png"],function(t){function e(t,e,n,r){var s=this,d=null;(r=_.extend({highlightExtensionWidth:5,highlightExtensionHeight:10,highlightCenterOffsetY:2,tagName:"button",innerContent:u},r)).listener=function(){d||(d=new o(t,{focusOnCloseNode:s,tandem:n.createTandem("keyboardHelpDialog")})),d.show(),s.buttonModel.isA11yClicking()&&d.focusCloseButton()};var p=new i(h,{scale:c,pickable:!1});a.call(this,p,e,n,r),e.link(function(t){p.image="black"===t?h:l})}var i=t("SCENERY/nodes/Image"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("JOIST/JoistA11yStrings"),a=t("JOIST/JoistButton"),o=t("JOIST/KeyboardHelpDialog"),h=t("mipmap!JOIST/keyboard-icon.png"),l=t("mipmap!JOIST/keyboard-icon-on-white.png"),u=s.hotKeysAndHelp.value,c=.3/h[0].height*67;return r.register("KeyboardHelpButton",e),n(a,e)}),i("SUN/ToggleNode",["require","PHET_CORE/inherit","SCENERY/nodes/Node","SUN/sun"],function(t){function e(t,i,r){r=_.extend({alignChildren:e.CENTER},r);var s=function(e){for(var i=0;iT.maxButtonWidth?(N.maxWidth=A.maxWidth=T.maxButtonWidth-(this.width-I.width),P.setRect(0,0,I.width,P.height),P.center=I.center,D.spacing=x.spacing=P.width+2*v,D.center=x.center=I.center):N.maxWidth=this.width,this.setAccessibleAttribute("aria-roledescription",b);var k=n.getOuterLineWidthFromNode(this);this.focusHighlight=f.bounds(this.bounds.setMinY(this.bounds.minY-k/2)),this.mutate(T)}var i=t("AXON/DerivedProperty"),n=t("SCENERY/accessibility/FocusHighlightPath"),r=t("JOIST/HighlightNode"),s=t("PHET_CORE/inherit"),a=t("JOIST/joist"),o=t("JOIST/JoistA11yStrings"),h=t("SCENERY/nodes/Node"),l=t("SCENERY_PHET/PhetColorScheme"),u=t("SCENERY_PHET/PhetFont"),c=t("AXON/Property"),d=t("SUN/buttons/PushButtonModel"),p=t("SCENERY/nodes/Rectangle"),f=t("KITE/Shape"),m=t("PHETCOMMON/util/StringUtils"),g=t("TANDEM/Tandem"),E=t("SCENERY/nodes/Text"),y=(t("DOT/Util"),t("SCENERY/nodes/VBox")),v=4,b=o.simScreen.value,S=o.screenNumberPattern.value;return a.register("NavigationBarScreenButton",e),s(h,e)}),i("JOIST/PhetButtonIO",["require","TANDEM/types/BooleanIO","JOIST/joist","SCENERY/util/NodeProperty","TANDEM/types/NullableIO","TANDEM/types/ObjectIO","TANDEM/phetioInherit","AXON/PropertyIO","ifphetio!PHET_IO/assertInstanceOf"],function(t){function e(t,e){a.call(this,t,e);var n=new r(t,"pickability","pickable",{phetioReadOnly:t.phetioReadOnly,phetioState:t.phetioState,tandem:t.tandem.createTandem("pickableProperty"),phetioType:h(s(i)),phetioDocumentation:"Set whether the phetButton will be pickable (and hence interactive), see the NodeIO documentation for more details"});this.disposePhetButtonIO=function(){n.dispose()}}var i=t("TANDEM/types/BooleanIO"),n=t("JOIST/joist"),r=t("SCENERY/util/NodeProperty"),s=t("TANDEM/types/NullableIO"),a=t("TANDEM/types/ObjectIO"),o=t("TANDEM/phetioInherit"),h=t("AXON/PropertyIO");t("ifphetio!PHET_IO/assertInstanceOf");return o(a,"PhetButtonIO",e,{dispose:function(){this.disposePhetButtonIO()}},{documentation:"The PhET Button in the bottom right of the screen",toStateObject:function(){},fromStateObject:function(t){return t}}),n.register("PhetButtonIO",e),e}),i("string!JOIST/credits.contributors",function(){return window.phet.chipper.strings.get("JOIST/credits.contributors")}),i("string!JOIST/credits.graphicArts",function(){return window.phet.chipper.strings.get("JOIST/credits.graphicArts")}),i("string!JOIST/credits.leadDesign",function(){return window.phet.chipper.strings.get("JOIST/credits.leadDesign")}),i("string!JOIST/credits.qualityAssurance",function(){return window.phet.chipper.strings.get("JOIST/credits.qualityAssurance")}),i("string!JOIST/credits.softwareDevelopment",function(){return window.phet.chipper.strings.get("JOIST/credits.softwareDevelopment")}),i("string!JOIST/credits.soundDesign",function(){return window.phet.chipper.strings.get("JOIST/credits.soundDesign")}),i("string!JOIST/credits.team",function(){return window.phet.chipper.strings.get("JOIST/credits.team")}),i("string!JOIST/credits.thanks",function(){return window.phet.chipper.strings.get("JOIST/credits.thanks")}),i("string!JOIST/credits.title",function(){return window.phet.chipper.strings.get("JOIST/credits.title")}),i("string!JOIST/credits.translation",function(){return window.phet.chipper.strings.get("JOIST/credits.translation")}),i("JOIST/CreditsNode",["require","PHET_CORE/inherit","JOIST/joist","SCENERY_PHET/PhetFont","SCENERY/nodes/RichText","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text","SCENERY/nodes/VBox","SCENERY/nodes/VStrut","string!JOIST/credits.contributors","string!JOIST/credits.graphicArts","string!JOIST/credits.leadDesign","string!JOIST/credits.qualityAssurance","string!JOIST/credits.softwareDevelopment","string!JOIST/credits.soundDesign","string!JOIST/credits.team","string!JOIST/credits.thanks","string!JOIST/credits.title","string!JOIST/credits.translation"],function(t){function e(t,e){e=_.extend({align:"left",spacing:1,maxWidth:550},e);var i=new r({size:14,weight:"bold"}),n={font:new r(12),align:"left",lineWrap:e.maxWidth,tagName:"p"},b=[];if(b.push(new o(y,{font:i,tagName:"h2",innerContent:y})),t.leadDesign){var S=a.format(d,"‪"+t.leadDesign+"‬");b.push(new s(S,_.extend({innerContent:S},n)))}if(t.softwareDevelopment){var T=a.format(f,"‪"+t.softwareDevelopment+"‬");b.push(new s(T,_.extend({innerContent:T},n)))}if(t.team){var C=a.format(g,"‪"+t.team+"‬");b.push(new s(C,_.extend({innerContent:C},n)))}if(t.contributors){var A=a.format(u,"‪"+t.contributors+"‬");b.push(new s(A,_.extend({innerContent:A},n)))}if(t.qualityAssurance){var R=a.format(p,"‪"+t.qualityAssurance+"‬");b.push(new s(R,_.extend({innerContent:R},n)))}if(t.graphicArts){var w=a.format(c,"‪"+t.graphicArts+"‬");b.push(new s(w,_.extend({innerContent:w},n)))}if(t.soundDesign){var N=a.format(m,"‪"+t.soundDesign+"‬");b.push(new s(N,_.extend({innerContent:N},n)))}if(t.translation&&(b.length>0&&b.push(new l(10)),b.push(new o(v,{font:i,tagName:"h2",innerContent:v})),b.push(new s(t.translation,n))),t.thanks){b.length>0&&b.push(new l(10)),b.push(new o(E,{font:i,tagName:"h2",innerContent:E}));var I=new s(t.thanks,n);I.innerContent=t.thanks,b.push(I)}e.children=b,h.call(this,e),this.disposeCreditsNode=function(){b.forEach(function(t){t.dispose&&t.dispose()})}}var i=t("PHET_CORE/inherit"),n=t("JOIST/joist"),r=t("SCENERY_PHET/PhetFont"),s=t("SCENERY/nodes/RichText"),a=t("PHETCOMMON/util/StringUtils"),o=t("SCENERY/nodes/Text"),h=t("SCENERY/nodes/VBox"),l=t("SCENERY/nodes/VStrut"),u=t("string!JOIST/credits.contributors"),c=t("string!JOIST/credits.graphicArts"),d=t("string!JOIST/credits.leadDesign"),p=t("string!JOIST/credits.qualityAssurance"),f=t("string!JOIST/credits.softwareDevelopment"),m=t("string!JOIST/credits.soundDesign"),g=t("string!JOIST/credits.team"),E=t("string!JOIST/credits.thanks"),y=t("string!JOIST/credits.title"),v=t("string!JOIST/credits.translation");return n.register("CreditsNode",e),i(h,e,{dispose:function(){this.disposeCreditsNode(),h.prototype.dispose.call(this)}})}),i("JOIST/packageJSON",["require","JOIST/joist","text!REPOSITORY/package.json"],function(t){var e=t("JOIST/joist"),i=t("text!REPOSITORY/package.json"),n=JSON.parse(i);return e.register("packageJSON",n),n}),i("JOIST/SimVersion",["require","PHET_CORE/inherit","JOIST/joist"],function(t){function e(t){this.major=t.major,this.minor=t.minor,this.maintenance=t.maintenance,this.suffix=t.suffix,this.buildTimestamp=t.buildTimestamp}var i=t("PHET_CORE/inherit");return t("JOIST/joist").register("SimVersion",e),i(Object,e,{compare:function(t){return this.majort.major?1:this.minort.minor?1:this.maintenancet.maintenance?1:0},get isSimNotPublished(){return this.major<1||1===this.major&&0===this.minor&&0===this.maintenance&&this.suffix},toString:function(){return this.major+"."+this.minor+"."+this.maintenance+(this.suffix?"-"+this.suffix:"")}},{parse:function(t,i){var n=t.match(/(\d+)\.(\d+)\.(\d+)(-(.+))?/);if(!n)throw new Error("could not parse version: "+t);return new e({major:parseInt(n[1],10),minor:parseInt(n[2],10),maintenance:parseInt(n[3],10),suffix:n[5],buildTimestamp:i})}})}),i("JOIST/UpdateCheck",["require","BRAND/Brand","PHET_CORE/inherit","JOIST/joist","JOIST/packageJSON","AXON/Property","JOIST/SimVersion"],function(t){function e(){this.stateProperty=new a("unchecked",{validValues:["up-to-date","out-of-date","checking","offline","unchecked"]}),this.latestVersionProperty=new a(null),this.ourVersion=l,this.timeoutCallback=this.timeout.bind(this)}var i=t("BRAND/Brand"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("JOIST/packageJSON"),a=t("AXON/Property"),o=t("JOIST/SimVersion"),h=s.name,l=o.parse(s.version,phet.chipper.buildTimestamp),u="https:"===document.location.protocol?"https:":"http:";n(Object,e,{areUpdatesChecked:"phet"===i.id&&!i.isPhetApp&&phet.chipper.queryParameters.yotta,updateURL:"http://phet.colorado.edu/html-sim-update?simulation="+encodeURIComponent(h)+"&version="+encodeURIComponent(l.toString())+"&buildTimestamp="+encodeURIComponent(""+phet.chipper.buildTimestamp),timeoutId:-1,timeoutMilliseconds:15e3,clearTimeout:function(){window.clearTimeout(this.timeoutId)},setTimeout:function(){this.timeoutId=window.setTimeout(this.timeoutCallback,this.timeoutMilliseconds)},resetTimeout:function(){"checking"===this.stateProperty.value&&(this.clearTimeout(),this.setTimeout())},timeout:function(){this.stateProperty.value="offline"},check:function(){var t=this;if(this.areUpdatesChecked&&("unchecked"===t.stateProperty.value||"offline"===t.stateProperty.value))if(this.ourVersion.isSimNotPublished)t.stateProperty.value="up-to-date";else{var e=new XMLHttpRequest;"withCredentials"in e&&(t.stateProperty.value="checking",t.setTimeout(),e.onload=function(){t.clearTimeout();try{var i=JSON.parse(e.responseText);i.error?(console.log("Update check failure: "+i.error),t.stateProperty.value="offline"):(t.updateURL&&(t.updateURL=i.updateURL),t.latestVersion=o.parse(i.latestVersion,i.buildTimestamp),"out-of-date"===i.state||"up-to-date"===i.state?t.stateProperty.value=i.state:(console.log("Failed to get proper state: "+i.state),t.stateProperty.value="offline"))}catch(e){t.stateProperty.value="offline"}},e.onerror=function(){t.clearTimeout(),t.stateProperty.value="offline"},e.open("post",u+"//phet.colorado.edu/services/check-html-updates",!0),e.send(JSON.stringify({api:"1.0",simulation:h,locale:phet.joist.sim.locale,currentVersion:t.ourVersion.toString(),buildTimestamp:phet.chipper.buildTimestamp})))}}});var c=new e;return r.register("UpdateCheck",c),c}),i("SCENERY_PHET/SpinningIndicatorNode",["require","SCENERY/nodes/Circle","SCENERY/util/Color","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY/util/PaintColorProperty","SCENERY/nodes/Rectangle","SCENERY_PHET/sceneryPhet","TANDEM/Tandem"],function(t){function e(t){l.indicateUninstrumentedCode(),t=_.extend({indicatorSize:15,indicatorSpeed:1,elementFactory:e.rectangleFactory,elementQuantity:16,activeColor:"rgba(0,0,0,1)",inactiveColor:"rgba(0,0,0,0.15)"},t),this.options=t,s.call(this,t),this.indicatorRotation=2*Math.PI,this.activeColorProperty=new a(t.activeColor),this.inactiveColorProperty=new a(t.inactiveColor),this.angleDelta=2*Math.PI/t.elementQuantity,this.elements=[];for(var i=0,n=0;n'+v+"",{links:{url:c.updateURL},font:T})],tagName:"div"},t))},createOutOfDateDialogNode:function(t,e,n,s){return new d(_.extend({spacing:15,maxWidth:550,children:[new d({spacing:5,align:"left",children:[new l(h.format(g,n),{font:new r(16),fontWeight:"bold"}),new l(h.format(S,e),{font:T})]}),new i({spacing:25,children:[new u(m,{baseColor:"#6f6",font:T,listener:function(){if(!window.phet||!phet.chipper||!phet.chipper.queryParameters||phet.chipper.queryParameters.allowLinks){var t=window.open(c.updateURL,"_blank");t&&t.focus()}}}),new u(E,{baseColor:"#ddd",font:T,listener:function(){t.hide()}})]})]},s))},createOfflineNode:function(t){return new i(_.extend({spacing:0,maxWidth:550,children:[new p(20),new l(y,{font:new r(t.big?16:14),fontWeight:t.big?"bold":"normal"})],tagName:"p",innerContent:y},t))}};return n.register("UpdateNodes",C),C}),i("string!JOIST/versionPattern",function(){return window.phet.chipper.strings.get("JOIST/versionPattern")}),i("JOIST/AboutDialog",["require","SCENERY/accessibility/AccessiblePeer","SCENERY/input/ButtonListener","JOIST/CreditsNode","SUN/Dialog","PHET_CORE/inherit","JOIST/joist","SCENERY/nodes/Node","JOIST/packageJSON","SCENERY_PHET/PhetFont","SCENERY/nodes/RichText","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text","PHET_CORE/timer","JOIST/UpdateCheck","JOIST/UpdateNodes","SCENERY/nodes/VBox","SCENERY/nodes/VStrut","string!JOIST/versionPattern"],function(t){function e(t,e,a,o,f,S,T){var _=[],C=new p(t,{font:new u(28),maxWidth:b,tagName:"h1",innerContent:t});_.push(C);var A=d.format(v,e);if(_.push(new p(A,{font:new u(20),maxWidth:b,tagName:"p",innerContent:A})),phet.chipper.buildTimestamp&&_.push(new p(phet.chipper.buildTimestamp,{font:new u(13),maxWidth:b,tagName:"p",innerContent:phet.chipper.buildTimestamp})),m.areUpdatesChecked){var R={left:0,top:0},w=g.createCheckingNode(R),N=g.createUpToDateNode(R),I=g.createOutOfDateAboutNode(R),P=g.createOfflineNode(R);this.updateStepListener=w.stepListener,this.updateVisibilityListener=function(t){w.visible="checking"===t,N.visible="up-to-date"===t,I.visible="out-of-date"===t,P.visible="offline"===t,w.accessibleContentDisplayed=w.visible,N.accessibleContentDisplayed=N.visible,I.accessibleContentDisplayed=I.visible,P.accessibleContentDisplayed=P.visible},_.push(new h({children:[w,N,I,P],maxWidth:b}))}var O=[];if(o.name&&O.push(new c(o.name,{font:new u(16),supScale:.5,supYOffset:2,maxWidth:b,tagName:"h2",innerContent:o.name})),o.copyright){var D=phet.chipper.buildTimestamp?phet.chipper.buildTimestamp.split("-")[0]:(new Date).getFullYear(),x=d.fillIn(o.copyright,{year:D});O.push(new p(x,{font:new u(12),maxWidth:b,tagName:"p",innerContent:x}))}o.additionalLicenseStatement&&(this.additionalLicenseStatement=new c(o.additionalLicenseStatement,{font:new u(10),fill:"gray",align:"left",maxWidth:b,tagName:"p",innerContent:o.additionalLicenseStatement}),O.push(this.additionalLicenseStatement)),O.length>0&&(_.push(new y(15)),_=_.concat(O)),!a||"phet"!==o.id&&"phet-io"!==o.id||(_.push(new y(15)),this.creditsNode=new r(a,{maxWidth:b}),_.push(this.creditsNode));var k=o.getLinks(l.name,f);if(k&&k.length>0){_.push(new y(15));for(var L=T.createGroupTandem("link"),M=0;M'+Y.text+"",{links:{url:Y.url},font:new u(14),maxWidth:b,tandem:L.createNextTandem(),phetioReadOnly:!0,phetioState:!1}))}}var B=new E({align:"left",spacing:5,children:_,tagName:"div"});s.call(this,B,{focusOnCloseNode:S,tandem:T,phetioReadOnly:!0,phetioState:!1,xSpacing:20,topMargin:20,bottomMargin:20,leftMargin:20,rightMargin:20}),this.addAriaLabelledbyAssociation({thisElementName:i.PRIMARY_SIBLING,otherNode:C,otherElementName:i.PRIMARY_SIBLING});var H=new n({fire:this.hide.bind(this)});this.addInputListener(H),this.disposeAboutDialog=function(){this.removeInputListener(H),this.creditsNode&&this.creditsNode.dispose(),this.additionalLicenseStatement&&this.additionalLicenseStatement.dispose()}}var i=t("SCENERY/accessibility/AccessiblePeer"),n=t("SCENERY/input/ButtonListener"),r=t("JOIST/CreditsNode"),s=t("SUN/Dialog"),a=t("PHET_CORE/inherit"),o=t("JOIST/joist"),h=t("SCENERY/nodes/Node"),l=t("JOIST/packageJSON"),u=t("SCENERY_PHET/PhetFont"),c=t("SCENERY/nodes/RichText"),d=t("PHETCOMMON/util/StringUtils"),p=t("SCENERY/nodes/Text"),f=t("PHET_CORE/timer"),m=t("JOIST/UpdateCheck"),g=t("JOIST/UpdateNodes"),E=t("SCENERY/nodes/VBox"),y=t("SCENERY/nodes/VStrut"),v=t("string!JOIST/versionPattern"),b=550;return o.register("AboutDialog",e),a(s,e,{show:function(){m.areUpdatesChecked&&!this.isShowing&&(m.resetTimeout(),"offline"!==m.stateProperty.value&&"unchecked"!==m.stateProperty.value||m.check(),f.addListener(this.updateStepListener),m.stateProperty.link(this.updateVisibilityListener)),s.prototype.show.call(this)},hide:function(){this.isShowing&&(s.prototype.hide.call(this),m.areUpdatesChecked&&(m.stateProperty.unlink(this.updateVisibilityListener),f.removeListener(this.updateStepListener)))},dispose:function(){this.disposeAboutDialog(),s.prototype.dispose.call(this)}})}),i("SUN/MenuItem",["require","SCENERY/accessibility/AccessibilityUtil","SCENERY/listeners/FireListener","SUN/FontAwesomeNode","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY_PHET/PhetFont","SCENERY/nodes/Rectangle","SUN/sun","TANDEM/Tandem","SCENERY/nodes/Text"],function(t){function e(t,e,r,s,l,T){var C=this;T=_.extend({cursor:"pointer",tandem:u.optional,textFill:"black",phetioDocumentation:"Item buttons shown in a popup menu",phetioEventType:"user",tagName:"button",focusAfterCallback:!1,containerTagName:"li",containerAriaRole:"none",innerContent:s,ariaRole:"menuitem"},T),a.call(this);var A=new c(s,{font:new o(p),fill:T.textFill,maxWidth:m}),R=new h(0,0,t+y+v+E,e+b+b,S,S);this.addChild(R),this.addChild(A),A.left=R.left+y+E,A.centerY=R.centerY,this.addInputListener({enter:function(){R.fill=f},exit:function(){R.fill=null}});var w=function(t){r(t),l(t)};this.addInputListener(new n({tandem:T.tandem.createTandem("inputListener"),fire:w})),this.separatorBefore=T.separatorBefore;var N;if(T.checkedProperty){var I=new a({children:[d],right:A.left-g,centerY:A.centerY});N=function(t){I.visible=t},T.checkedProperty.link(N),this.addChild(I)}var P={click:function(t){w();var e=phet.joist.display.accessibleDOMElement;T.focusAfterCallback&&i.getNextFocusable(e).focus()}};this.addAccessibleInputListener(P),this.mutate(T),this.disposeMenuItem=function(){T.checkedProperty&&T.checkedProperty.unlink(N),C.removeAccessibleInputListener(P)}}var i=t("SCENERY/accessibility/AccessibilityUtil"),n=t("SCENERY/listeners/FireListener"),r=t("SUN/FontAwesomeNode"),s=t("PHET_CORE/inherit"),a=t("SCENERY/nodes/Node"),o=t("SCENERY_PHET/PhetFont"),h=t("SCENERY/nodes/Rectangle"),l=t("SUN/sun"),u=t("TANDEM/Tandem"),c=t("SCENERY/nodes/Text"),d=new r("check",{fill:"rgba(0,0,0,0.7)",scale:.4}),p=18,f="#a6d2f4",m=400,g=2,E=d.width+g,y=2,v=5,b=3,S=5;return l.register("MenuItem",e),s(a,e,{dispose:function(){this.disposeMenuItem(),a.prototype.dispose.call(this)}})}),i("JOIST/OptionsDialogIO",["require","SUN/DialogIO","JOIST/joist","TANDEM/phetioInherit","ifphetio!PHET_IO/assertInstanceOf"],function(t){function e(t,e){i.call(this,t,e)}var i=t("SUN/DialogIO"),n=t("JOIST/joist"),r=t("TANDEM/phetioInherit");t("ifphetio!PHET_IO/assertInstanceOf");return r(i,"OptionsDialogIO",e,{},{documentation:"A dialog panel"}),n.register("OptionsDialogIO",e),e}),i("string!JOIST/options.title",function(){return window.phet.chipper.strings.get("JOIST/options.title")}),i("JOIST/OptionsDialog",["require","SUN/Dialog","PHET_CORE/inherit","JOIST/joist","JOIST/OptionsDialogIO","SCENERY_PHET/PhetFont","TANDEM/Tandem","SCENERY/nodes/Text","string!JOIST/options.title"],function(t){function e(t,e){(e=_.extend({titleAlign:"center",bottomMargin:20,ySpacing:20,tandem:o.required,phetioType:s},e)).title||(e.title=new h(l,{font:new a(30),maxWidth:400,tandem:e.tandem.createTandem("title")})),i.call(this,t,e),this.disposeOptionsDialog=function(){e.title&&e.title.dispose()}}var i=t("SUN/Dialog"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("JOIST/OptionsDialogIO"),a=t("SCENERY_PHET/PhetFont"),o=t("TANDEM/Tandem"),h=t("SCENERY/nodes/Text"),l=t("string!JOIST/options.title");return r.register("OptionsDialog",e),n(i,e,{dispose:function(){this.disposeOptionsDialog(),i.prototype.dispose.call(this)}},{DEFAULT_FONT:new a(15),DEFAULT_SPACING:10})}),i("JOIST/PhetMenuIO",["require","JOIST/joist","TANDEM/types/ObjectIO","TANDEM/phetioInherit","ifphetio!PHET_IO/assertInstanceOf"],function(t){function e(t,e){n.call(this,t,e)}var i=t("JOIST/joist"),n=t("TANDEM/types/ObjectIO"),r=t("TANDEM/phetioInherit");t("ifphetio!PHET_IO/assertInstanceOf");return r(n,"PhetMenuIO",e,{},{documentation:"The PhET Menu in the bottom right of the screen"}),i.register("PhetMenuIO",e),e}),i("JOIST/ScreenshotGenerator",["require","SCENERY/util/CanvasContextWrapper","PHET_CORE/inherit","JOIST/joist"],function(t){function e(){}var i=t("SCENERY/util/CanvasContextWrapper"),n=t("PHET_CORE/inherit");return t("JOIST/joist").register("ScreenshotGenerator",e),n(Object,e,{},{generateScreenshot:function(t,e){e=e||"image/png";var n=document.createElement("canvas");n.width=t.display.width,n.height=t.display.height;var r=n.getContext("2d");r.fillStyle=t.display.domElement.style.backgroundColor,r.fillRect(0,0,n.width,n.height);var s=new i(n,r);t.rootNode.renderToCanvasSubtree(s);return n.toDataURL(e)}})}),i("JOIST/UpdateDialog",["require","SCENERY/input/ButtonListener","SUN/Dialog","PHET_CORE/inherit","JOIST/joist","SCENERY/nodes/Node","PHET_CORE/timer","JOIST/UpdateCheck","JOIST/UpdateNodes"],function(t){function e(t){function e(){var t=h.latestVersion?h.latestVersion.toString():"x.x.xx",e=h.ourVersion.toString();c.children=[l.createOutOfDateDialogNode(r,e,t,s)]}var r=this,s={centerX:0,centerY:0,big:!0},o=l.createCheckingNode(s),u=l.createUpToDateNode(s),c=new a({tagName:"div"}),d=l.createOfflineNode(s);e(),this.updateStepListener=o.stepListener,this.updateVisibilityListener=function(t){"out-of-date"===t&&e(),o.visible="checking"===t,u.visible="up-to-date"===t,c.visible="out-of-date"===t,d.visible="offline"===t,o.accessibleContentDisplayed=o.visible,u.accessibleContentDisplayed=u.visible,c.accessibleContentDisplayed=c.visible,d.accessibleContentDisplayed=d.visible};var p=new a({children:[o,u,c,d],tagName:"div"});n.call(this,p,{focusOnCloseNode:t});var f=new i({fire:r.hide.bind(r)});this.addInputListener(f),this.disposeUpdateDialog=function(){r.removeInputListener(f)}}var i=t("SCENERY/input/ButtonListener"),n=t("SUN/Dialog"),r=t("PHET_CORE/inherit"),s=t("JOIST/joist"),a=t("SCENERY/nodes/Node"),o=t("PHET_CORE/timer"),h=t("JOIST/UpdateCheck"),l=t("JOIST/UpdateNodes");return s.register("UpdateDialog",e),r(n,e,{show:function(){h.areUpdatesChecked&&!this.isShowing&&(h.resetTimeout(),"offline"!==h.stateProperty.value&&"unchecked"!==h.stateProperty||h.check(),o.addListener(this.updateStepListener),h.stateProperty.link(this.updateVisibilityListener)),n.prototype.show.call(this)},hide:function(){this.isShowing&&(n.prototype.hide.call(this),h.areUpdatesChecked&&(h.stateProperty.unlink(this.updateVisibilityListener),o.removeListener(this.updateStepListener)))},dispose:function(){this.disposeUpdateDialog(),n.prototype.dispose.call(this)}})}),i("string!JOIST/menuItem.about",function(){return window.phet.chipper.strings.get("JOIST/menuItem.about")}),i("string!JOIST/menuItem.enhancedSound",function(){return window.phet.chipper.strings.get("JOIST/menuItem.enhancedSound")}),i("string!JOIST/menuItem.fullscreen",function(){return window.phet.chipper.strings.get("JOIST/menuItem.fullscreen")}),i("string!JOIST/menuItem.getUpdate",function(){return window.phet.chipper.strings.get("JOIST/menuItem.getUpdate")}),i("string!JOIST/menuItem.mailInputEventsLog",function(){return window.phet.chipper.strings.get("JOIST/menuItem.mailInputEventsLog")}),i("string!JOIST/menuItem.options",function(){return window.phet.chipper.strings.get("JOIST/menuItem.options")}),i("string!JOIST/menuItem.outputInputEventsLog",function(){return window.phet.chipper.strings.get("JOIST/menuItem.outputInputEventsLog")}),i("string!JOIST/menuItem.phetWebsite",function(){return window.phet.chipper.strings.get("JOIST/menuItem.phetWebsite")}),i("string!JOIST/menuItem.reportAProblem",function(){return window.phet.chipper.strings.get("JOIST/menuItem.reportAProblem")}),i("string!JOIST/menuItem.screenshot",function(){return window.phet.chipper.strings.get("JOIST/menuItem.screenshot")}),i("string!JOIST/menuItem.submitInputEventsLog",function(){return window.phet.chipper.strings.get("JOIST/menuItem.submitInputEventsLog")}),i("JOIST/PhetMenu",["require","JOIST/AboutDialog","SCENERY/accessibility/AccessibilityUtil","BRAND/Brand","AXON/DerivedProperty","SCENERY/display/Display","SCENERY/util/FullScreen","PHET_CORE/inherit","JOIST/joist","SCENERY/accessibility/KeyboardUtil","SUN/MenuItem","SCENERY/nodes/Node","JOIST/OptionsDialog","SCENERY/nodes/Path","SCENERY_PHET/PhetFont","JOIST/PhetMenuIO","PHET_CORE/platform","SCENERY/nodes/Rectangle","JOIST/ScreenshotGenerator","KITE/Shape","TAMBO/soundManager","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text","JOIST/UpdateCheck","JOIST/UpdateDialog","string!JOIST/menuItem.about","string!JOIST/menuItem.enhancedSound","string!JOIST/menuItem.fullscreen","string!JOIST/menuItem.getUpdate","string!JOIST/menuItem.mailInputEventsLog","string!JOIST/menuItem.options","string!JOIST/menuItem.outputInputEventsLog","string!JOIST/menuItem.phetWebsite","string!JOIST/menuItem.reportAProblem","string!JOIST/menuItem.screenshot","string!JOIST/menuItem.submitInputEventsLog"],function(t){function e(t,e,h){var l="phet"===r.id,y=r.isPhetApp;(h=_.extend({showSaveAndLoad:!1,phetioType:g,phetioState:!1,phetioDocumentation:"This menu is displayed when the PhET button is pressed.",tagName:"ul",ariaRole:"menu"},h)).tandem=e;var F=this;d.call(this);var W,U=null,G=null,z=null,X=[{text:D,present:!!t.options.optionsNode,callback:function(){G||(G=new p(t.options.optionsNode,{tandem:e.createTandem("optionsDialog")})),G.show()},tandem:e.createTandem("optionsMenuItem"),phetioDocumentation:"This menu item shows an options dialog.",phetioState:!1,tagName:"button",focusAfterCallback:!0},{text:k,present:l,callback:function(){if(!q&&(!window.phet||!phet.chipper||!phet.chipper.queryParameters||phet.chipper.queryParameters.allowLinks)){var e=window.open("http://phet.colorado.edu/"+t.locale,"_blank");e&&e.focus()}},tagName:"button"},{text:x,present:!!t.options.recordInputEventLog,callback:function(){console.log(t.getRecordedInputEventLogString())},tagName:"button"},{text:Y,present:!!t.options.recordInputEventLog,callback:function(){t.submitEventLog()},tagName:"button"},{text:O,present:!!t.options.recordInputEventLog,callback:function(){t.mailEventLog()},tagName:"button"},{text:L,present:l&&!y,callback:function(){var e=phet.chipper.dependencies?JSON.parse(JSON.stringify(phet.chipper.dependencies)):{};delete e.comment;for(var i in e)e[i].sha&&(e[i].sha=e[i].sha.substring(0,8));var n="http://phet.colorado.edu/files/troubleshooting/?sim="+encodeURIComponent(t.name)+"&version="+encodeURIComponent(t.version+" "+(phet.chipper.buildTimestamp?phet.chipper.buildTimestamp:"(require.js)"))+"&url="+encodeURIComponent(window.location.href)+"&dependencies="+encodeURIComponent(JSON.stringify(e));if(!q&&(!window.phet||!phet.chipper||!phet.chipper.queryParameters||phet.chipper.queryParameters.allowLinks)){var r=window.open(n,"_blank");r&&r.focus()}},tagName:"button"},{text:"QR code",present:phet.chipper.queryParameters.qrCode,callback:function(){if(!q){var t=window.open("http://api.qrserver.com/v1/create-qr-code/?data="+encodeURIComponent(window.location.href)+"&size=220x220&margin=0","_blank");t&&t.focus()}},tagName:"button"},{text:P,present:A.areUpdatesChecked,textFill:new s([A.stateProperty],function(t){return"out-of-date"===t?"#0a0":"#000"}),callback:function(){if(!z){var e=t.navigationBar.phetButton;z=new R(e)}z.show()},tagName:"button",focusAfterCallback:!0},{text:M,present:!E.ie9&&!y,callback:function(){var e=v.generateScreenshot(t);if(window.Blob&&new window.Blob){for(var i=e.slice("data:image/png;base64,".length),n=window.atob(i),r=new window.Uint8Array(n.length),s=0;s0)&&(e.drawImage(t.img,0,0),delete t.updateCanvas)}}),t}),i("mipmap!BRAND/logo-on-white.png",function(){var t=window.phet.chipper.mipmaps["BRAND/logo-on-white.png"];return window.phetImages=window.phetImages||[],t.forEach(function(t){t.img=new Image,window.phetImages.push(t.img),t.img.src=t.url,t.canvas=document.createElement("canvas"),t.canvas.width=t.width,t.canvas.height=t.height;var e=t.canvas.getContext("2d");t.updateCanvas=function(){t.img.complete&&(void 0===t.img.naturalWidth||t.img.naturalWidth>0)&&(e.drawImage(t.img,0,0),delete t.updateCanvas)}}),t}),i("JOIST/PhetButton",["require","SCENERY/nodes/Image","PHET_CORE/inherit","JOIST/joist","JOIST/JoistA11yStrings","JOIST/JoistButton","SCENERY/nodes/Node","SCENERY/nodes/Path","JOIST/PhetButtonIO","JOIST/PhetMenu","AXON/Property","KITE/Shape","JOIST/UpdateCheck","mipmap!BRAND/logo.png","mipmap!BRAND/logo-on-white.png"],function(t){function e(t,e,n){var r=this,s=new u(t,n.createTandem("phetMenu"),{showSaveAndLoad:t.options.showSaveAndLoad,closeCallback:function(){s.hide()}});t.resizedEmitter.addListener(function(e,i){var n=t.boundsProperty.value,r=t.screenBoundsProperty.value,a=t.scaleProperty.value;s.right=n.right/a-2/a;var o=n.height-r.height;s.bottom=r.bottom/a+o/2/a});for(var y={highlightExtensionWidth:6,highlightExtensionHeight:5,highlightCenterOffsetY:4,listener:function(){s.show()},phetioType:l,phetioDocumentation:"The button that appears at the right side of the navigation bar, which shows a menu when pressed",tagName:"button",innerContent:f},v=new i(m,{scale:E,pickable:!1}),b=new d,S=0;S<3;S++){var T=3.543*S*2.5;b.arc(0,T,2.5,0,2*Math.PI,!1)}var _=new h(b,{left:v.width+8,bottom:v.bottom-.5,pickable:!1}),C=new o({children:[v,_]});a.call(this,C,e,n,y),c.multilink([e,t.showHomeScreenProperty,p.stateProperty],function(t,e,i){var n="black"!==t&&!e,r="out-of-date"===i;_.fill=n?r?"#0a0":"#222":r?"#3F3":"white",v.image=n?g:m}),this.on("pickability",function(){_.visible=!1!==r.pickable}),this.addAccessibleInputListener({click:function(){s.show(),s.items[0].focus()}}),this.setAccessibleAttribute("aria-haspopup",!0)}var i=t("SCENERY/nodes/Image"),n=t("PHET_CORE/inherit"),r=t("JOIST/joist"),s=t("JOIST/JoistA11yStrings"),a=t("JOIST/JoistButton"),o=t("SCENERY/nodes/Node"),h=t("SCENERY/nodes/Path"),l=t("JOIST/PhetButtonIO"),u=t("JOIST/PhetMenu"),c=t("AXON/Property"),d=t("KITE/Shape"),p=t("JOIST/UpdateCheck"),f=s.phet.value,m=t("mipmap!BRAND/logo.png"),g=t("mipmap!BRAND/logo-on-white.png"),E=.28/m[0].height*108;return r.register("PhetButton",e),n(a,e)}),i("string!JOIST/simTitleWithScreenNamePattern",function(){return window.phet.chipper.strings.get("JOIST/simTitleWithScreenNamePattern")}),i("JOIST/NavigationBar",["require","JOIST/A11yButtonsHBox","SCENERY/accessibility/AccessiblePeer","AXON/DerivedProperty","DOT/Dimension2","JOIST/HomeButton","JOIST/HomeScreen","JOIST/HomeScreenView","PHET_CORE/inherit","JOIST/joist","JOIST/JoistA11yStrings","JOIST/NavigationBarScreenButton","SCENERY/nodes/Node","JOIST/PhetButton","SCENERY_PHET/PhetFont","SCENERY/nodes/Rectangle","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text","string!JOIST/simTitleWithScreenNamePattern"],function(t){function e(t,e,s,l){var u=this;this.screens=e,p.call(this,{tagName:"div",ariaRole:"region",labelTagName:"h2",labelContent:1===e.length?S:b}),this.navigationBarFillProperty=new r([s,t.lookAndFeel.navigationBarFillProperty],function(t,e){return t?o.BACKGROUND_COLOR:e}),this.background=new g(0,0,C.width,C.height,{pickable:!0,fill:this.navigationBarFillProperty}),this.addChild(this.background),this.barContents=new p,this.addChild(this.barContents);var c=t.name;if(phet.chipper.queryParameters.screens&&1===phet.chipper.queryParameters.screens.length&&e[0].name&&(c=E.fillIn(v,{simName:t.name,screenName:e[0].name})),this.titleTextNode=new y(c,{font:new m(16),fill:t.lookAndFeel.navigationBarTextFillProperty,tandem:l.createTandem("titleTextNode"),phetioDocumentation:"Displays the title of the simulation in the navigation bar (bottom left)"}),this.titleTextNode.setVisible(!1),this.barContents.addChild(this.titleTextNode),this.phetButton=new f(t,this.navigationBarFillProperty,l.createTandem("phetButton")),this.barContents.addChild(this.phetButton),this.a11yButtonsHBox=new i(t,this.navigationBarFillProperty,l.createTandem("a11yButtonsHBox")),this.barContents.addChild(this.a11yButtonsHBox),this.addAriaLabelledbyAssociation({thisElementName:n.PRIMARY_SIBLING,otherNode:this,otherElementName:n.LABEL_SIBLING}),1===e.length)this.titleTextNode.maxWidth=h.LAYOUT_BOUNDS.width-A-R-w-this.a11yButtonsHBox.width-w-this.phetButton.width-N;else{var k=Math.min(this.titleTextNode.width,.2*h.LAYOUT_BOUNDS.width),L=new p({tagName:"nav",ariaLabel:T}),M=new p({tagName:"ol"});L.addChild(M),L.setVisible(!1),this.barContents.addChild(L),this.homeButton=new a(C.height,t.lookAndFeel.navigationBarFillProperty,l.createTandem("homeButton"),{listener:function(){t.showHomeScreenProperty.value=!0,u.homeButton.buttonModel.isA11yClicking()&&t.homeScreen.view.focusHighlightedScreenButton()}}),phet.chipper.queryParameters.homeScreen&&M.addChild(this.homeButton);for(var Y=h.LAYOUT_BOUNDS.width/2-A-k-R-P-this.homeButton.width-O,B=h.LAYOUT_BOUNDS.width/2-w-this.a11yButtonsHBox.width-w-this.phetButton.width-N,H=2*Math.min(Y,B),q=(H-(e.length-1)*D)/e.length,V=_.map(e,function(e){return new d(t.lookAndFeel.navigationBarFillProperty,t.screenIndexProperty,t.screens,e,C.height,{maxButtonWidth:q,tandem:l.createTandem(e.screenTandem.tail+"Button")})}),F=Math.max(x,_.maxBy(V,function(t){return t.width}).width)+D,W=0;W0&&(this.a11yButtonsHBox.centerY=this.phetButton.centerY),1!==this.screens.length&&(this.screenButtonsContainer.centerY=C.height/2,this.homeButton.centerY=C.height/2),this.layout(1,C.width,C.height),this.accessibleOrder=[L,this.a11yButtonsHBox,this.phetButton].filter(function(t){return void 0!==t}),s.link(function(t){u.titleTextNode.setVisible(!t),L&&L.setVisible(!t)})}var i=t("JOIST/A11yButtonsHBox"),n=t("SCENERY/accessibility/AccessiblePeer"),r=t("AXON/DerivedProperty"),s=t("DOT/Dimension2"),a=t("JOIST/HomeButton"),o=t("JOIST/HomeScreen"),h=t("JOIST/HomeScreenView"),l=t("PHET_CORE/inherit"),u=t("JOIST/joist"),c=t("JOIST/JoistA11yStrings"),d=t("JOIST/NavigationBarScreenButton"),p=t("SCENERY/nodes/Node"),f=t("JOIST/PhetButton"),m=t("SCENERY_PHET/PhetFont"),g=t("SCENERY/nodes/Rectangle"),E=t("PHETCOMMON/util/StringUtils"),y=t("SCENERY/nodes/Text"),v=t("string!JOIST/simTitleWithScreenNamePattern"),b=c.simScreensResourcesAndTools.value,S=c.simResourcesAndTools.value,T=c.simScreens.value,C=new s(h.LAYOUT_BOUNDS.width,40),A=10,R=25,w=6,N=10,I=0,P=5,O=P,D=0,x=60;return u.register("NavigationBar",e),l(p,e,{layout:function(t,e,i){this.background.rectWidth=e,this.background.rectHeight=i,this.barContents.setScaleMagnitude(t);var n;n=C.width*t0&&(this.a11yButtonsHBox.right=this.phetButton.left-w),1!==this.screens.length&&(this.screenButtonsContainer.x=n/2,this.homeButton.right=this.screenButtonsContainer.left-O,this.titleTextNode.maxWidth=this.homeButton.left-A-R)}},{NAVIGATION_BAR_SIZE:C})}),i("JOIST/Profiler",["require","PHET_CORE/inherit","JOIST/joist"],function(t){function e(){this.allTimes=[],this.histogram=[],this.longTimes=[],this.frameStartTime=0,this.previousFrameStartTime=0;for(var t=0;t')}var i=t("PHET_CORE/inherit"),n=30;return t("JOIST/joist").register("Profiler",e),i(Object,e,{frameStarted:function(){this.frameStartTime=Date.now()},frameEnded:function(){if(this.allTimes.length>0&&this.allTimes.length%60==0){for(var t=0,e=0;e0&&(this.longTimes.sort(function(t,e){return e-t}),i=i+" — "+this.longTimes),$("#phetProfiler").html(i),e=0;ee.length-1)throw new Error("invalid screen index: "+t);N.push(e[i])}),0!==g){var O=_.indexOf(N,e[g-1]);g=O+1}e=N}n=_.extend({showHomeScreen:e.length>1&&y&&0===g,screenIndex:0===g?0:g-1,credits:{},optionsNode:null,homeScreenWarningNode:null,recordInputEventLog:!1,inputEventLogName:void 0,showSaveAndLoad:!1,showSmallHomeScreenIconFrame:!1,accessibility:!1,keyboardHelpNode:null,supportsSound:!1,supportsEnhancedSound:!1,rootRenderer:P.edge?"canvas":"svg",allowBackingScaleAntialiasing:!0},n),this.options=n,n.rootRenderer=phet.chipper.queryParameters.rootRenderer||n.rootRenderer,this.showHomeScreenProperty=new r(n.showHomeScreen,e.length>1?{tandem:V.createTandem("showHomeScreenProperty")}:{}),this.screenIndexProperty=new w(n.screenIndex,{tandem:V.createTandem("screenIndexProperty"),phetioDocumentation:"Indicates which screen is selected (0-indexed)",validValues:_.range(0,e.length),numberType:"Integer"}),this.activeProperty=new r(!phet.joist.playbackModeEnabledProperty.value,{tandem:V.createTandem("activeProperty"),phetioDocumentation:"Determines whether the entire simulation is running and processing user input. Setting this property to false pauses the simulation, and prevents user interaction."}),this.browserTabVisibleProperty=new r(!0,{tandem:V.createTandem("browserTabVisibleProperty"),phetioDocumentation:"Indicates whether the browser tab containing the simulation is currently visible",phetioReadOnly:!0}),document.addEventListener("visibilitychange",function(){l.browserTabVisibleProperty.set("visible"===document.visibilityState)},!1),this.scaleProperty=new D(1),this.boundsProperty=new D(null),this.screenBoundsProperty=new D(null),this.currentScreenProperty=new D(null),this.lookAndFeel=new S,this.destroyed=!1,this.memoryMonitor=new T,phet.chipper.accessibility=phet.chipper.accessibility||n.accessibility,phet.chipper.accessibility&&(i.initialize(),H.initialize()),this.keyboardHelpNode=n.keyboardHelpNode,this.supportsSound=(phet.chipper.queryParameters.supportsSound||n.supportsSound)&&("enabled"===phet.chipper.queryParameters.sound||"muted"===phet.chipper.queryParameters.sound)&&!P.ie,this.supportsEnhancedSound=this.supportsSound&&(phet.chipper.queryParameters.supportsEnhancedSound||n.supportsEnhancedSound),this.supportsSound&&k.initialize(this.browserTabVisibleProperty,this.activeProperty),window.phet.joist.sim=this,window.phet.joist.ScreenshotGenerator=x,this.name=t,this.version=I.version,this.credits=n.credits,this.frameCounter=0,this.resizePending=!0,this.locale=phet.chipper.locale||"en",QueryStringMachine.containsKey("locale")&&$("title").html(t),phet.chipper.queryParameters.recordInputEventLog&&(n.recordInputEventLog=!0,n.inputEventLogName=phet.chipper.queryParameters.recordInputEventLog),phet.chipper.queryParameters.playbackInputEventLog&&(n.playbackInputEventLog=!0,n.inputEventLogName=phet.chipper.queryParameters.playbackInputEventLog),(phet.chipper.queryParameters.fuzz||phet.chipper.queryParameters.fuzzMouse||phet.chipper.queryParameters.fuzzTouch||phet.chipper.queryParameters.fuzzBoard)&&(window.open=function(){return{focus:function(){},blur:function(){}}}),phet.phetio&&q.initializeSim();$("body").css("padding","0").css("margin","0").css("overflow","hidden");var L=document.getElementById("aria-live-elements");L&&(L.style[d.userSelect]="none"),document.getElementById("sim")&&document.getElementById("sim").parentNode===document.body&&document.body.removeChild(document.getElementById("sim")),document.onselectstart=function(){return!1},this.rootNode=new A({renderer:n.rootRenderer}),this.display=new h(l.rootNode,{allowSceneOverflow:!1,allowWebGL:phet.chipper.queryParameters.webgl,accessibility:phet.chipper.accessibility,isApplication:!1,assumeFullWindow:!0,allowBackingScaleAntialiasing:n.allowBackingScaleAntialiasing}),this.inputFuzzer=new E(this.display,Math.random()),this.keyboardFuzzer=new v(this.display,Math.random()),this.activeProperty.link(function(t){l.display.interactive=t}),l.display.domElement.id="sim",document.body.appendChild(l.display.domElement),p.start(this),phet.chipper.queryParameters.sceneryLog&&this.display.scenery.enableLogging(phet.chipper.queryParameters.sceneryLog),phet.chipper.queryParameters.sceneryStringLog&&this.display.scenery.switchLogToString(),this.display.initializeEvents({tandem:V.createTandem("controller").createTandem("input")}),window.phet.joist.rootNode=this.rootNode,window.phet.joist.display=this.display,l.display.setPointerDisplayVisible(phet.chipper.queryParameters.showPointers),l.display.setPointerAreaDisplayVisible(phet.chipper.queryParameters.showPointerAreas),l.display.setCanvasNodeBoundsVisible(phet.chipper.queryParameters.showCanvasNodeBounds),l.display.setFittedBlockBoundsVisible(phet.chipper.queryParameters.showFittedBlockBounds),this.screens=e,e.length>1?(this.homeScreen=new f(this,V.createTandem("homeScreen"),{warningNode:n.homeScreenWarningNode,showSmallHomeScreenIconFrame:n.showSmallHomeScreenIconFrame}),this.homeScreen.initializeModelAndView()):this.homeScreen=null,this.navigationBar=new C(this,e,this.showHomeScreenProperty,V.createTandem("navigationBar")),this.updateBackground=function(){l.lookAndFeel.backgroundColorProperty.value=l.currentScreenProperty.value?l.currentScreenProperty.value.backgroundColorProperty.value:l.homeScreen.backgroundColorProperty.value},this.lookAndFeel.backgroundColorProperty.link(function(t){l.display.backgroundColor=t}),D.multilink([this.showHomeScreenProperty,this.screenIndexProperty],function(t,i){l.currentScreenProperty.value=t&&l.homeScreen?null:e[i],l.updateBackground()}),this.currentScreenProperty.lazyLink(function(t,e){null===e?l.homeScreen.view.interruptSubtreeInput():e.view.interruptSubtreeInput()}),window.addEventListener("pageshow",function(t){t.persisted&&window.location.reload()}),phet.chipper.queryParameters.legendsOfLearning&&new b(this).start()}var i=t("SCENERY_PHET/accessibility/ariaHerald"),n=t("SCENERY_PHET/BarrierRectangle"),r=t("AXON/BooleanProperty"),s=t("DOT/Bounds2"),a=t("BRAND/Brand"),o=t("DOT/Dimension2"),h=t("SCENERY/display/Display"),l=t("DOT/Util"),u=t("AXON/Emitter"),c=t("AXON/EmitterIO"),d=t("SCENERY/util/Features"),p=t("JOIST/Heartbeat"),f=t("JOIST/HomeScreen"),m=t("JOIST/HomeScreenView"),g=t("PHET_CORE/inherit"),E=t("SCENERY/input/InputFuzzer"),y=t("JOIST/joist"),v=t("SCENERY/accessibility/KeyboardFuzzer"),b=t("JOIST/thirdPartySupport/LegendsOfLearningSupport"),S=t("JOIST/LookAndFeel"),T=t("JOIST/MemoryMonitor"),C=t("JOIST/NavigationBar"),A=t("SCENERY/nodes/Node"),R=t("TANDEM/types/NumberIO"),w=t("AXON/NumberProperty"),N=t("AXON/ObservableArray"),I=t("JOIST/packageJSON"),P=t("PHET_CORE/platform"),O=t("JOIST/Profiler"),D=t("AXON/Property"),x=t("JOIST/ScreenshotGenerator"),k=t("TAMBO/soundManager"),L=t("TANDEM/Tandem"),M=t("PHET_CORE/timer"),Y=t("JOIST/UpdateCheck"),B=t("SCENERY/util/Util"),H=t("SCENERY_PHET/accessibility/utteranceQueue"),q=t("ifphetio!PHET_IO/phetio"),V=L.rootTandem;return phet.joist.elapsedTime=0,phet.joist.playbackModeEnabledProperty=new r(phet.chipper.queryParameters.playbackMode),y.register("Sim",e),g(Object,e,{finishInit:function(t){var e=this;this.homeScreen&&this.rootNode.addChild(this.homeScreen.view),_.each(t,function(t){t.view.layerSplit=!0,e.rootNode.addChild(t.view)}),this.rootNode.addChild(this.navigationBar),D.multilink([this.showHomeScreenProperty,this.screenIndexProperty],function(i,n){e.homeScreen&&(i?(e.homeScreen.activeProperty.set(!0),e.homeScreen.view.setVisible(!0)):(e.homeScreen.view.setVisible(!1),e.homeScreen.activeProperty.set(!1)));for(var r=0;r=0&&this.stepSimulation(i)},getSelectedScreen:function(){return this.showHomeScreenProperty.value?null:this.screens[this.screenIndexProperty.value]},stepSimulation:function(t){this.stepSimulationEmitter.emit(t)}})}),i("JOIST/checkNamespaces",["require","JOIST/joist"],function(t){var e=function(){var t=window.requirejs&&window.requirejs._defined||window.require&&window.require.s.contexts._.defined,e=function(e){for(var i in t)if(!(i.indexOf("!")>=0||i.indexOf("/")<0||i.indexOf("..")>=0)){var n=i.slice(0,i.indexOf("/")),r=i.slice(i.lastIndexOf("/")+1),s=n.toLowerCase().split("_"),a=[s[0]].concat(s.slice(1).map(function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join("");if(r!==a&&r!==a+"Namespace"){var o=phet[a]&&phet[a][r];o||e("not namespaced: "+a+"."+r),o&&o!==t[i]&&e(a+"."+r+" is different than the expected namespaced object")}}};e(function(t){console.log(t)}),e(function(t){})};return t("JOIST/joist").register("checkNamespaces",e),e}),i("PHET_IO/phetioCommandProcessor",function(){return function(){return function(){}}}),i("JOIST/SimLauncher",["require","TANDEM/Tandem","JOIST/checkNamespaces","JOIST/joist","DOT/Random","ifphetio!PHET_IO/dataStream","ifphetio!PHET_IO/phetioCommandProcessor"],function(t){var e=t("TANDEM/Tandem"),i=(t("JOIST/checkNamespaces"),t("JOIST/joist")),n=t("DOT/Random"),r=t("ifphetio!PHET_IO/dataStream"),s=t("ifphetio!PHET_IO/phetioCommandProcessor"),a={launch:function(t){function i(){window.phetLaunchSimulation=function(){e.launch(),r.launch&&r.launch(),phet.joist.random=new n({staticSeed:!0}),t()},phet.phetio&&s.initialize(),phet.chipper.queryParameters.postMessageOnReady&&window.parent&&window.parent.postMessage(JSON.stringify({type:"ready",url:window.location.href}),"*"),phet.phetio&&!phet.phetio.queryParameters.phetioStandalone||phet.chipper.queryParameters.playbackMode||window.phetLaunchSimulation()}function a(t){return!!t.complete&&(void 0===t.naturalWidth||0!==t.naturalWidth)}window.phet.joist.launchCalled=!0;var o=[],h=0;if(window.phetImages)for(var l=0;l