Scenery Debug Snapshot'+this.getDebugHTML()+"";window.open("data:text/html;charset=utf-8,"+encodeURIComponent(t))},foreignObjectRasterization:function(t){function i(t){if(t.blocks)_.each(t.blocks,function(t){i(t)});else if(t.firstDrawable&&t.lastDrawable){for(var e=t.firstDrawable;e!==t.lastDrawable;e=e.nextDrawable)i(e);i(t.lastDrawable),t.canvas&&t.canvas instanceof window.HTMLCanvasElement&&(n[t.canvasId]=t.canvas.toDataURL())}}var n={};i(this._rootBackbone);var r=document.implementation.createHTMLDocument("");r.documentElement.innerHTML=this.domElement.outerHTML,r.documentElement.setAttribute("xmlns",r.documentElement.namespaceURI);var s=r.documentElement.getElementsByTagName("canvas");s=Array.prototype.slice.call(s);for(var a=0;a
'+a+"
",l=new window.Image;l.onload=function(){s.drawImage(l,0,0),n(r.toDataURL())},l.onerror=function(){n(null)};var h=new window.TextEncoderLite("utf-8").encode(o),c=window.fromByteArray(h);l.src="data:image/svg+xml;base64,"+c},set focus(t){this.focusProperty.value=t},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.customCursors={"scenery-grab-pointer":["grab","-moz-grab","-webkit-grab","pointer"],"scenery-grabbing-pointer":["grabbing","-moz-grabbing","-webkit-grabbing","pointer"]},e.focusProperty=new a(null,{tandem:c.createStaticTandem("display").createTandem("focusProperty"),phetioValueType:y}),e.assertSubtreeDisposed=function(t){},e.userGestureEmitter=new n,e}),i("JOIST/JoistA11yStrings",["require","JOIST/joist"],function(t){"use strict";var e=t("JOIST/joist"),i={hotKeysAndHelpString:"Keyboard Shortcuts",closeString:"Close",simResourcesAndToolsString:"Sim Resources and Tools",phetString:"PhET Menu"};if("xss"===phet.chipper.queryParameters.stringTest)for(var n in i)i[n]+='';return e.register("JoistA11yStrings",i),i}),i("PHET_CORE/detectPrefixEvent",["require","PHET_CORE/phetCore"],function(t){"use strict";function e(t,e,i){return void 0!==t["on"+e]?e:void 0!==t["onmoz"+e]?"moz"+e:void 0!==t["onMoz"+e]?"Moz"+e:void 0!==t["onwebkit"+e]?"webkit"+e:void 0!==t["onms"+e]?"ms"+e:void 0!==t["ono"+e]?"o"+e:void 0}return t("PHET_CORE/phetCore").register("detectPrefixEvent",e),e}),i("JOIST/FullScreen",["require","PHET_CORE/platform","PHET_CORE/detectPrefix","PHET_CORE/detectPrefixEvent","AXON/Property","JOIST/joist"],function(t){"use strict";var e=t("PHET_CORE/platform"),i=t("PHET_CORE/detectPrefix"),n=t("PHET_CORE/detectPrefixEvent"),r=t("AXON/Property"),s=t("JOIST/joist"),a=i(document.body,"requestFullscreen")||i(document.body,"requestFullScreen"),o=i(document,"exitFullscreen")||i(document,"cancelFullScreen"),l=i(document,"fullscreenElement")||i(document,"fullScreenElement"),h=i(document,"fullscreenEnabled")||i(document,"fullScreenEnabled"),c=n(document,"fullscreenchange");"msfullscreenchange"===c&&(c="MSFullscreenChange");var u={isFullScreen:function(){return!!document[l]},isFullScreenEnabled:function(){return document[h]&&!e.safari7},enterFullScreen:function(t){if(e.ie9||e.ie10){if(void 0!==window.ActiveXObject){var i=new window.ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}}else t.display.domElement[a]&&t.display.domElement[a]()},exitFullScreen:function(){document[o]&&document[o]()},toggleFullScreen:function(t){u.isFullScreen()?u.exitFullScreen():u.enterFullScreen(t)},isFullScreenProperty:new r(!1)};return document.addEventListener(c,function(t){u.isFullScreenProperty.set(u.isFullScreen())}),s.register("FullScreen",u),u}),i("JOIST/TDialog",["require","ifphetio!PHET_IO/assertions/assertInstanceOf","JOIST/joist","ifphetio!PHET_IO/phetioInherit","SUN/TPanel"],function(t){"use strict";function e(t,e){s.call(this,t,e),i(t,phet.joist.Dialog)}var i=t("ifphetio!PHET_IO/assertions/assertInstanceOf"),n=t("JOIST/joist"),r=t("ifphetio!PHET_IO/phetioInherit"),s=t("SUN/TPanel");return r(s,"TDialog",e,{},{documentation:"A dialog panel"}),n.register("TDialog",e),e}),i("JOIST/Dialog",["require","PHET_CORE/inherit","KITE/Shape","SCENERY/nodes/Node","SCENERY/display/Display","SCENERY/nodes/Path","SCENERY/input/Input","SUN/Panel","SUN/buttons/RectangularPushButton","JOIST/joist","JOIST/JoistA11yStrings","SCENERY_PHET/accessibility/AriaHerald","SCENERY/accessibility/AccessibilityUtil","JOIST/FullScreen","JOIST/TDialog","TANDEM/Tandem"],function(t){"use strict";function e(t,i){var c=this;i=_.extend({modal:!1,title:null,titleAlign:"center",titleSpacing:20,hasCloseButton:!0,layoutStrategy:e.DEFAULT_LAYOUT_STRATEGY,cornerRadius:10,resize:!0,fill:"white",stroke:"black",backgroundPickable:!0,xMargin:20,yMargin:20,closeButtonBaseColor:"#d00",closeButtonMargin:5,tandem:g.tandemRequired(),phetioType:m,tagName:"div",ariaRole:"dialog",focusOnCloseNode:null},i),this.isModal=i.modal,this.isShowing=!1;var u=new r({children:[t]});if(i.title){var d=i.title;u.addChild(d);var A=function(){switch(i.titleAlign){case"center":d.centerX=t.centerX;break;case"left":d.left=t.left;break;case"right":d.right=t.right;break;default:throw new Error("unknown titleAlign for Dialog: "+i.titleAlign)}d.bottom=t.top-i.titleSpacing};i.resize&&(t.on("bounds",A),d.on("localBounds",A)),A()}if(l.call(this,u,i),i.hasCloseButton){var b=new a((new n).moveTo(0,0).lineTo(10,10).moveTo(0,10).lineTo(10,0),{stroke:"#fff",lineWidth:3}),v=new h({content:b,baseColor:i.closeButtonBaseColor,xMargin:5,yMargin:5,listener:function(){c.hide()},accessibleFire:function(){c.focusActiveElement()},tandem:i.tandem.createTandem("closeButton"),tagName:"button",accessibleLabel:E});this.addChild(v);var T=function(){v.right=u.right+i.xMargin-i.closeButtonMargin,v.top=u.top-i.yMargin+i.closeButtonMargin,v.focusHighlight=n.bounds(b.bounds.dilated(10))};i.resize&&(u.on("bounds",T),i.title&&i.title.on("bounds",T)),T()}var C=window.phet.joist.sim;this.updateLayout=function(){i.layoutStrategy(c,C.boundsProperty.value,C.screenBoundsProperty.value,C.scaleProperty.value)},this.updateLayout(),this.sim=C,this.accessibleOrder=[d,u],t.tagName&&t.setAriaDescribesNode(this),i.title&&i.title.tagName&&i.title.setAriaLabelsNode(this),this.sim.resizedEmitter.addListener(this.updateLayout),this.activeElement=i.focusOnCloseNode||null;var y=this.addAccessibleInputListener({keydown:function(t){if(t.keyCode===o.KEY_ESCAPE)t.preventDefault(),c.hide(),c.focusActiveElement();else if(t.keyCode===o.KEY_TAB&&p.isFullScreen()){var e=s.focusedNode,i=f.getNextFocusable()===e,n=f.getPreviousFocusable()===e;i&&n&&t.preventDefault()}}});this.disposeDialog=function(){i.tandem.removeInstance(this),c.sim.resizedEmitter.removeListener(c.updateLayout),c.removeAccessibleInputListener(y),i.hasCloseButton&&v.dispose(),i.resize&&(u.off("bounds",T),i.title&&(i.title.off("bounds",T),d.off("localBounds",A),t.off("bounds",A))),u.removeAllChildren(),u.detach()}}var i=t("PHET_CORE/inherit"),n=t("KITE/Shape"),r=t("SCENERY/nodes/Node"),s=t("SCENERY/display/Display"),a=t("SCENERY/nodes/Path"),o=t("SCENERY/input/Input"),l=t("SUN/Panel"),h=t("SUN/buttons/RectangularPushButton"),c=t("JOIST/joist"),u=t("JOIST/JoistA11yStrings"),d=t("SCENERY_PHET/accessibility/AriaHerald"),f=t("SCENERY/accessibility/AccessibilityUtil"),p=t("JOIST/FullScreen"),m=t("JOIST/TDialog"),g=t("TANDEM/Tandem"),E=u.closeString;return c.register("Dialog",e),e.DEFAULT_LAYOUT_STRATEGY=function(t,e,i,n){t.center=e.center.times(1/n)},i(l,e,{show:function(){this.isShowing||(window.phet.joist.sim.showPopup(this,this.isModal),this.isShowing=!0,this.activeElement=this.activeElement||s.focusedNode,this.setAccessibleViewsHidden(!0),this.updateLayout())},hide:function(){this.isShowing&&(window.phet.joist.sim.hidePopup(this,this.isModal),this.isShowing=!1,this.setAccessibleViewsHidden(!1))},dispose:function(){this.hide(),this.disposeDialog(),l.prototype.dispose.call(this)},setAccessibleViewsHidden:function(t){for(var e=0;e0&&v.push(new l(10)),v.push(new a(A,{font:i,tagName:"h2",accessibleLabel:A})),v.push(new s(t.translation,b))),t.thanks&&(v.length>0&&v.push(new l(10)),v.push(new a(g,{font:i,tagName:"h2",accessibleLabel:g})),v.push(new s(t.thanks,b))),o.call(this,_.extend({align:"left",spacing:1,children:v},e)),this.disposeCreditsNode=function(){v.forEach(function(t){t.dispose&&t.dispose()})}}var i=t("JOIST/joist"),n=t("PHET_CORE/inherit"),r=t("PHETCOMMON/util/StringUtils"),s=t("SCENERY/nodes/RichText"),a=t("SCENERY/nodes/Text"),o=t("SCENERY/nodes/VBox"),l=t("SCENERY/nodes/VStrut"),h=t("SCENERY_PHET/PhetFont"),c=t("string!JOIST/credits.contributors"),u=t("string!JOIST/credits.graphicArts"),d=t("string!JOIST/credits.leadDesign"),f=t("string!JOIST/credits.qualityAssurance"),p=t("string!JOIST/credits.softwareDevelopment"),m=t("string!JOIST/credits.team"),g=t("string!JOIST/credits.thanks"),E=t("string!JOIST/credits.title"),A=t("string!JOIST/credits.translation");return i.register("CreditsNode",e),n(o,e,{dispose:function(){this.disposeCreditsNode(),o.prototype.dispose.call(this)}})}),i("SUN/buttons/TextPushButton",["require","PHET_CORE/inherit","SUN/buttons/RectangularPushButton","SUN/sun","SCENERY/nodes/Text","TANDEM/Tandem"],function(t){"use strict";function e(t,e){e=_.extend({textFill:"black",maxTextWidth:null,tandem:a.tandemRequired(),accessibleLabel:t},e);var i=new s(t,{font:e.font,fill:e.textFill,maxWidth:e.maxTextWidth,tandem:e.tandem.createTandem("textNode")});n.call(this,_.extend({content:i},e))}var i=t("PHET_CORE/inherit"),n=t("SUN/buttons/RectangularPushButton"),r=t("SUN/sun"),s=t("SCENERY/nodes/Text"),a=t("TANDEM/Tandem");return r.register("TextPushButton",e),i(n,e)}),i("SCENERY_PHET/SpinningIndicatorNode",["require","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY/nodes/Rectangle","SCENERY/nodes/Circle","SCENERY/util/Color","SCENERY_PHET/sceneryPhet","TANDEM/Tandem"],function(t){"use strict";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,n.call(this,t),this.indicatorRotation=2*Math.PI,this.activeColor=new a(t.activeColor),this.inactiveColor=new a(t.inactiveColor),this.angleDelta=2*Math.PI/t.elementQuantity,this.elements=[];for(var i=0,r=0;rt.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("BRAND/../../js/brand",["require","PHET_CORE/Namespace"],function(t){"use strict";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){"use strict";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/UpdateCheck",["require","PHET_CORE/inherit","AXON/Property","JOIST/packageJSON","JOIST/SimVersion","BRAND/Brand","JOIST/joist"],function(t){"use strict";function e(){this.stateProperty=new n("unchecked",{validValues:["up-to-date","out-of-date","checking","offline","unchecked"]}),this.latestVersionProperty=new n(null),this.ourVersion=h,this.timeoutCallback=this.timeout.bind(this)}var i=t("PHET_CORE/inherit"),n=t("AXON/Property"),r=t("JOIST/packageJSON"),s=t("JOIST/SimVersion"),a=t("BRAND/Brand"),o=t("JOIST/joist"),l=r.name,h=s.parse(r.version,phet.chipper.buildTimestamp),c="https:"===document.location.protocol?"https:":"http:";i(Object,e,{areUpdatesChecked:"phet"===a.id&&!a.isPhetApp,updateURL:"http://phet.colorado.edu/html-sim-update?simulation="+encodeURIComponent(l)+"&version="+encodeURIComponent(h.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)return void(t.stateProperty.value="up-to-date");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=s.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",c+"//phet.colorado.edu/services/check-html-updates",!0),e.send(JSON.stringify({api:"1.0",simulation:l,locale:phet.joist.sim.locale,currentVersion:t.ourVersion.toString(),buildTimestamp:phet.chipper.buildTimestamp})))}}});var u=new e;return o.register("UpdateCheck",u),u}),i("JOIST/LinkText",["require","PHET_CORE/inherit","SCENERY/nodes/Text","SCENERY/input/ButtonListener","JOIST/joist"],function(t){"use strict";function e(t,e,i){i=_.extend({handleEvent:!1},i),n.call(this,t,_.extend({fill:"rgb(27,0,241)",cursor:"pointer",tagName:"a",accessibleLabel:t},i)),this.addInputListener(new r({fire:function(t){i.handleEvent&&t.handle(),window.open(e,"_blank").focus()}})),this.setAccessibleAttribute("href",e),this.setAccessibleAttribute("target","_blank")}var i=t("PHET_CORE/inherit"),n=t("SCENERY/nodes/Text"),r=t("SCENERY/input/ButtonListener");return t("JOIST/joist").register("LinkText",e),i(n,e)}),i("string!JOIST/updates.upToDate",function(){return window.phet.chipper.strings.get("JOIST/updates.upToDate")}),i("string!JOIST/updates.outOfDate",function(){return window.phet.chipper.strings.get("JOIST/updates.outOfDate")}),i("string!JOIST/updates.checking",function(){return window.phet.chipper.strings.get("JOIST/updates.checking")}),i("string!JOIST/updates.offline",function(){return window.phet.chipper.strings.get("JOIST/updates.offline")}),i("string!JOIST/updates.newVersionAvailable",function(){return window.phet.chipper.strings.get("JOIST/updates.newVersionAvailable")}),i("string!JOIST/updates.yourCurrentVersion",function(){return window.phet.chipper.strings.get("JOIST/updates.yourCurrentVersion")}),i("string!JOIST/updates.getUpdate",function(){return window.phet.chipper.strings.get("JOIST/updates.getUpdate")}),i("string!JOIST/updates.noThanks",function(){return window.phet.chipper.strings.get("JOIST/updates.noThanks")}),i("JOIST/UpdateNodes",["require","SCENERY/nodes/HBox","SCENERY/nodes/VBox","SCENERY/nodes/Text","SCENERY/nodes/Rectangle","PHETCOMMON/util/StringUtils","SCENERY_PHET/PhetFont","SUN/FontAwesomeNode","SUN/buttons/TextPushButton","SCENERY_PHET/SpinningIndicatorNode","SCENERY/nodes/VStrut","JOIST/UpdateCheck","JOIST/LinkText","JOIST/joist","string!JOIST/updates.upToDate","string!JOIST/updates.outOfDate","string!JOIST/updates.checking","string!JOIST/updates.offline","string!JOIST/updates.newVersionAvailable","string!JOIST/updates.yourCurrentVersion","string!JOIST/updates.getUpdate","string!JOIST/updates.noThanks"],function(t){"use strict";var e=t("SCENERY/nodes/HBox"),i=t("SCENERY/nodes/VBox"),n=t("SCENERY/nodes/Text"),r=t("SCENERY/nodes/Rectangle"),s=t("PHETCOMMON/util/StringUtils"),a=t("SCENERY_PHET/PhetFont"),o=t("SUN/FontAwesomeNode"),l=t("SUN/buttons/TextPushButton"),h=t("SCENERY_PHET/SpinningIndicatorNode"),c=t("SCENERY/nodes/VStrut"),u=t("JOIST/UpdateCheck"),d=t("JOIST/LinkText"),f=t("JOIST/joist"),p=t("string!JOIST/updates.upToDate"),m=t("string!JOIST/updates.outOfDate"),g=t("string!JOIST/updates.checking"),E=t("string!JOIST/updates.offline"),A=t("string!JOIST/updates.newVersionAvailable"),b=t("string!JOIST/updates.yourCurrentVersion"),v=t("string!JOIST/updates.getUpdate"),T=t("string!JOIST/updates.noThanks"),C=new a(14),y={createCheckingNode:function(t){var i=new h({indicatorSize:t.big?24:18}),r=new e(_.extend({spacing:t.big?10:8,maxWidth:550,children:[i,new n(g,{font:new a(t.big?16:14),fontWeight:t.big?"bold":"normal"})],tagName:"p",accessibleLabel:g},t));return r.step=function(t){"checking"===u.stateProperty&&i.step(t)},r.stepListener=r.step.bind(r),r},createUpToDateNode:function(t){return new e(_.extend({spacing:8,maxWidth:550,children:[new r(0,0,20,20,5,5,{fill:"#5c3",scale:t.big?1.2:1,children:[new o("check",{fill:"#fff",scale:.38,centerX:10,centerY:10})]}),new n(p,{font:new a(t.big?16:14),fontWeight:t.big?"bold":"normal"})],tagName:"p",accessibleLabel:p},t))},createOutOfDateAboutNode:function(t){return new e(_.extend({spacing:8,cursor:"pointer",maxWidth:550,children:[new o("warning_sign",{fill:"#E87600",scale:.5}),new d(m,u.updateURL,{font:C})],tagName:"div"},t))},createOutOfDateDialogNode:function(t,r,o,h){return new i(_.extend({spacing:15,maxWidth:550,children:[new i({spacing:5,align:"left",children:[new n(s.format(A,o),{font:new a(16),fontWeight:"bold"}),new n(s.format(b,r),{font:C})]}),new e({spacing:25,children:[new l(v,{baseColor:"#6f6",font:C,listener:function(){var t=window.open(u.updateURL,"_blank");t&&t.focus()}}),new l(T,{baseColor:"#ddd",font:C,listener:function(){t.hide()}})]})]},h))},createOfflineNode:function(t){return new e(_.extend({spacing:0,maxWidth:550,children:[new c(20),new n(E,{font:new a(t.big?16:14),fontWeight:t.big?"bold":"normal"})],tagName:"p",accessibleLabel:E},t))}};return f.register("UpdateNodes",y),y}),i("SCENERY_PHET/TMultiLineText",["require","SCENERY_PHET/sceneryPhet","SCENERY/nodes/TNode","ifphetio!PHET_IO/assertions/assertInstanceOf","ifphetio!PHET_IO/phetioInherit","ifphetio!PHET_IO/phetioEvents","ifphetio!PHET_IO/types/TString","ifphetio!PHET_IO/types/TVoid"],function(t){"use strict";function e(t,i){n.call(this,t,i),r(t,phet.sceneryPhet.MultiLineText),t.on("text",function(t,n){a.trigger("model",i,e,"textChanged",{oldText:t,newText:n})})}var i=t("SCENERY_PHET/sceneryPhet"),n=t("SCENERY/nodes/TNode"),r=t("ifphetio!PHET_IO/assertions/assertInstanceOf"),s=t("ifphetio!PHET_IO/phetioInherit"),a=t("ifphetio!PHET_IO/phetioEvents"),o=t("ifphetio!PHET_IO/types/TString"),l=t("ifphetio!PHET_IO/types/TVoid");return s(n,"TMultiLineText",e,{setText:{returnType:l,parameterTypes:[o],implementation:function(t){this.instance.text=t},documentation:"Set the text content"},getText:{returnType:o,parameterTypes:[],implementation:function(){return this.instance.text},documentation:"Get the text content"}},{documentation:"The tandem wrapper type for the scenery phet's MultiLineText node"}),i.register("TMultiLineText",e),e}),i("SCENERY_PHET/MultiLineText",["require","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY_PHET/PhetFont","SCENERY/nodes/Text","SCENERY/nodes/VBox","SCENERY_PHET/sceneryPhet","PHETCOMMON/util/StringUtils","TANDEM/Tandem","SCENERY_PHET/TMultiLineText"],function(t){"use strict";function e(t,e){e=_.extend({font:new r,align:"center",tandem:h.tandemOptional(),phetioType:c},e),this.options=e,n.call(this),this._text=null,this.textParent=null,this.text=t,this.tagName="p",this.accessibleLabel=t,this.mutate(_.omit(e,"align"))}var i=t("PHET_CORE/inherit"),n=t("SCENERY/nodes/Node"),r=t("SCENERY_PHET/PhetFont"),s=t("SCENERY/nodes/Text"),a=t("SCENERY/nodes/VBox"),o=t("SCENERY_PHET/sceneryPhet"),l=t("PHETCOMMON/util/StringUtils"),h=t("TANDEM/Tandem"),c=t("SCENERY_PHET/TMultiLineText");return o.register("MultiLineText",e),i(n,e,{setText:function(t){this._text=t;var e=this,i=l.embeddedSplit(t,"\n").map(function(t){return 0===t.length&&(t=" "),new s(t,_.omit(e.options,"align","maxWidth","tandem"))}),n=this.textParent?this.indexOfChild(this.textParent):0;this.textParent&&this.removeChild(this.textParent),this.textParent=new a({children:i,align:this.options.align}),this.insertChild(n,this.textParent)},set text(t){this.setText(t)},getText:function(){return this._text},get text(){return this.getText()},setFill:function(t){this.options.fill=t;for(var e=this.textParent.getChildren(),i=0;i0){O.push(new h(15));for(var M=0;M0)&&(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/Node","SCENERY/nodes/Image","KITE/Shape","SCENERY/nodes/Path","PHET_CORE/inherit","JOIST/PhetMenu","AXON/Property","JOIST/JoistButton","JOIST/UpdateCheck","SCENERY/util/TransformTracker","JOIST/JoistA11yStrings","JOIST/joist","mipmap!BRAND/logo.png","mipmap!BRAND/logo-on-white.png"],function(t){"use strict";function e(t,e,a,u){function d(t,e,i){f.right=t.right/i-2/i;var n=t.height-e.height;f.bottom=e.bottom/i+n/2/i}var f=new o(t,u.createTandem("phetMenu"),{showSaveAndLoad:t.options.showSaveAndLoad,closeCallback:function(){ f.hide()}});t.resizedEmitter.addListener(d);for(var A={textDescription:"PhET Menu Button",highlightExtensionWidth:6,highlightExtensionHeight:5,highlightCenterOffsetY:4,listener:function(){f.show()},tagName:"button",accessibleLabel:p},b=new n(m,{scale:E,pickable:!1}),v=new r,T=0;T<3;T++){var C=3.543*T*2.5;v.arc(0,C,2.5,0,2*Math.PI,!1)}var y=new s(v,{left:b.width+8,bottom:b.bottom-.5,pickable:!1}),S=new i({children:[b,y]});h.call(this,S,e,u,A),this.focusHighlight=r.bounds(S.bounds.dilated(4)),l.multilink([e,t.showHomeScreenProperty,c.stateProperty],function(t,e,i){var n="black"!==t&&!e,r="out-of-date"===i;y.fill=n?r?"#0a0":"#222":r?"#3F3":"white",b.image=n?g:m}),this.addAccessibleInputListener({click:function(){f.show(),f.items[0].focus()}}),this.setAccessibleAttribute("aria-haspopup",!0)}var i=t("SCENERY/nodes/Node"),n=t("SCENERY/nodes/Image"),r=t("KITE/Shape"),s=t("SCENERY/nodes/Path"),a=t("PHET_CORE/inherit"),o=t("JOIST/PhetMenu"),l=t("AXON/Property"),h=t("JOIST/JoistButton"),c=t("JOIST/UpdateCheck"),u=t("SCENERY/util/TransformTracker"),d=t("JOIST/JoistA11yStrings"),f=t("JOIST/joist"),p=d.phetString,m=t("mipmap!BRAND/logo.png"),g=t("mipmap!BRAND/logo-on-white.png"),E=.28/m[0].height*108;return f.register("PhetButton",e),a(h,e,{},{HORIZONTAL_INSET:10,VERTICAL_INSET:0,linkPhetButtonTransform:function(t,e,i){function n(){r.matrix=a.matrix.inverted().timesMatrix(s.matrix)}var r=t.view.phetButton,s=new u(e.phetButton.getUniqueTrailTo(i),{isStatic:!0}),a=new u(r.getParent().getUniqueTrailTo(i),{isStatic:!0});s.addListener(n),a.addListener(n),n()}})}),i("JOIST/Frame",["require","PHET_CORE/inherit","SCENERY/nodes/Node","SCENERY/nodes/Rectangle","SCENERY/util/LinearGradient","JOIST/joist"],function(t){"use strict";function e(t,e){e=_.extend({xMargin1:6,yMargin1:6,cornerRadius:0},e),n.call(this);var i=t.width+2*e.xMargin1,a=t.height+2*e.yMargin1;this.gradient=new s(0,0,i,0).addColorStop(0,"#fbff41").addColorStop(.1475,"#fef98b").addColorStop(.465,"#feff40").addColorStop(.77,"#fffccd").addColorStop(1,"#fbff41"),this.rectangle=new r(0,0,i,a,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=i,this.frameHeight=a}var i=t("PHET_CORE/inherit"),n=t("SCENERY/nodes/Node"),r=t("SCENERY/nodes/Rectangle"),s=t("SCENERY/util/LinearGradient");return t("JOIST/joist").register("Frame",e),i(n,e,{setHighlighted:function(t){this.rectangle.lineWidth=t?4.5:3,t?this.rectangle.setRect(-.75,-.75,this.frameWidth+1.5,this.frameHeight+1.5):this.rectangle.setRect(0,0,this.frameWidth,this.frameHeight)}}),e}),i("JOIST/TScreenButton",["require","JOIST/joist","SCENERY/nodes/TNode","ifphetio!PHET_IO/assertions/assertInstanceOf","ifphetio!PHET_IO/phetioInherit","ifphetio!PHET_IO/toEventOnEmit"],function(t){"use strict";function e(t,e){r(t,phet.joist.ScreenButton),n.call(this,t,e),a(t.startedCallbacksForFiredEmitter,t.endedCallbacksForFiredEmitter,"user",e,this.constructor,"fired")}var i=t("JOIST/joist"),n=t("SCENERY/nodes/TNode"),r=t("ifphetio!PHET_IO/assertions/assertInstanceOf"),s=t("ifphetio!PHET_IO/phetioInherit"),a=t("ifphetio!PHET_IO/toEventOnEmit");return s(n,"TScreenButton",e,{},{documentation:"A pressable button in the simulation, in the home screen",events:["fired"]}),i.register("TScreenButton",e),e}),i("JOIST/ScreenButton",["require","PHET_CORE/inherit","JOIST/joist","AXON/Emitter","SCENERY/nodes/Rectangle","SCENERY/nodes/VBox","SCENERY/nodes/Text","SCENERY_PHET/PhetFont","SCENERY/nodes/Node","JOIST/Frame","DOT/Util","SCENERY_PHET/PhetColorScheme","KITE/Shape","JOIST/TScreenButton"],function(t){"use strict";function e(t,e,i,n,g,E){var A=this;E=_.extend({opacity:1,tandem:g,phetioType:p},E);var b=e.screens[i];this.startedCallbacksForFiredEmitter=new r({indicateCallbacks:!1}),this.endedCallbacksForFiredEmitter=new r({indicateCallbacks:!1});var v=u.linear(2,4,.875,.5,e.screens.length),T=t?m:v*m,C=new h({opacity:E.opacity,children:[b.homeScreenIcon],scale:T/b.homeScreenIcon.height}),y=t?new c(C):new s(0,0,C.width,C.height,{stroke:E.showSmallHomeScreenIconFrame?"#dddddd":null,lineWidth:.7}),S=new h({opacity:E.opacity,children:[y,C]}),O=new o(b.name,{font:new l(t?42:18),fill:t?d.PHET_LOGO_YELLOW:"gray",tandem:g.createTandem("text")});O.width>S.width&&O.scale(S.width/O.width),n.link(function(e){var n=e===i;y.setHighlighted&&y.setHighlighted(n),C.opacity=t||n?1:.5,O.fill=t||n?"white":"gray"}),a.call(this,{children:[S,O]});var P=t?function(){e.showHomeScreenProperty.value=!1,n.value=-1}:function(){e.screenIndexProperty.value=i};this.addInputListener({down:function(t){A.startedCallbacksForFiredEmitter.emit(),P(),A.endedCallbacksForFiredEmitter.emit()}}),t||(this.highlightListener={over:function(t){n.value=i},out:function(t){n.value=-1}},this.addInputListener({over:function(t){t.pointer.isTouch&&(e.screenIndexProperty.value=i)}})),this.mouseArea=this.touchArea=f.bounds(this.bounds),this.disposeScreenButton=function(){n.unlink()},this.mutate(E)}var i=t("PHET_CORE/inherit"),n=t("JOIST/joist"),r=t("AXON/Emitter"),s=t("SCENERY/nodes/Rectangle"),a=t("SCENERY/nodes/VBox"),o=t("SCENERY/nodes/Text"),l=t("SCENERY_PHET/PhetFont"),h=t("SCENERY/nodes/Node"),c=t("JOIST/Frame"),u=t("DOT/Util"),d=t("SCENERY_PHET/PhetColorScheme"),f=t("KITE/Shape"),p=t("JOIST/TScreenButton"),m=140;return n.register("ScreenButton",e),i(a,e,{dispose:function(){this.disposeScreenButton(),a.prototype.dispose.call(this)}})}),i("JOIST/HomeScreenView",["require","JOIST/PhetButton","SCENERY/nodes/Node","SCENERY/nodes/HBox","SCENERY/nodes/Text","PHET_CORE/inherit","JOIST/ScreenView","JOIST/ScreenButton","AXON/Property","SCENERY_PHET/PhetFont","DOT/Bounds2","JOIST/joist"],function(t){"use strict";function e(t,e,a){var u=this;a=_.extend({showSmallHomeScreenIconFrame:!1,warningNode:null},a),o.call(this,{layoutBounds:f});var d=new s(t.name,{font:new c({size:52,family:p}),fill:"white",y:110,tandem:e.createTandem("title")});this.addChild(d),d.scale(Math.min(1,.9*this.layoutBounds.width/d.width)),d.centerX=this.layoutBounds.centerX;var m=new h(-1),g=_.map(t.screens,function(i){var n=t.screens.indexOf(i),r=e.createTandem(i.tandem.tail+"LargeButton"),s=!0,o=new l(s,t,n,m,r,{resize:!1,cursor:"pointer"}),h=e.createTandem(i.tandem.tail+"SmallButton");s=!1;var c=new l(s,t,n,m,h,{spacing:3,cursor:"pointer",showSmallHomeScreenIconFrame:a.showSmallHomeScreenIconFrame});return c.addInputListener(c.highlightListener),o.addInputListener(c.highlightListener),{screen:i,small:c,large:o,index:n}}),E=new n;u.addChild(E);var A=t.screens.length<=3?60:33,b=null;t.screenIndexProperty.link(function(t){b&&(b.removeAllChildren(),E.removeChild(b));var e=_.map(g,function(e){return e.index===t?e.large:e.small});b=new r({spacing:A,children:e,align:"top",resize:!1}),E.addChild(b),E.centerX=u.layoutBounds.width/2,E.top=170});var v=new h("black"),T=new h("white");if(this.phetButton=new i(t,v,T,e.createTandem("phetButton")),this.addChild(this.phetButton),a.warningNode){var C=a.warningNode;this.addChild(C),C.centerX=this.layoutBounds.centerX,C.bottom=this.layoutBounds.maxY-20}}var i=t("JOIST/PhetButton"),n=t("SCENERY/nodes/Node"),r=t("SCENERY/nodes/HBox"),s=t("SCENERY/nodes/Text"),a=t("PHET_CORE/inherit"),o=t("JOIST/ScreenView"),l=t("JOIST/ScreenButton"),h=t("AXON/Property"),c=t("SCENERY_PHET/PhetFont"),u=t("DOT/Bounds2"),d=t("JOIST/joist"),f=new u(0,0,768,504),p="Century Gothic, Futura";return d.register("HomeScreenView",e),a(o,e,{},{TITLE_FONT_FAMILY:p,LAYOUT_BOUNDS:f})}),i("string!JOIST/keyboardShortcuts.title",function(){return window.phet.chipper.strings.get("JOIST/keyboardShortcuts.title")}),i("JOIST/KeyboardHelpDialog",["require","PHET_CORE/inherit","JOIST/Dialog","JOIST/joist","SCENERY/input/ButtonListener","SCENERY/nodes/Path","SCENERY/nodes/Text","KITE/Shape","JOIST/JoistA11yStrings","SCENERY_PHET/PhetFont","TANDEM/Tandem","string!JOIST/keyboardShortcuts.title"],function(t){"use strict";function e(t,e,i){var r=new o(g,{font:new c({weight:"bold",size:20}),maxWidth:m,tagName:"h1",accessibleLabel:h.hotKeysAndHelpString});i=_.extend({titleAlign:"center",title:r,modal:!0,hasCloseButton:!1,fill:"rgb( 214, 237, 249 )",xMargin:p,yMargin:p,titleSpacing:p,focusOnCloseNode:t,tandem:u.tandemRequired()},i);var E=new l;E.moveTo(-d,-d).lineTo(d,d),E.moveTo(d,-d).lineTo(-d,d),this.closeButtonPath=new a(E,{stroke:"black",lineCap:"round",lineWidth:2,cursor:"pointer",tagName:"button",accessibleLabel:h.closeString,focusHighlight:l.bounds(E.getBounds().dilated(10))});var A=this,b=new s({down:function(){A.hide()}});this.closeButtonPath.addInputListener(b);var v=this.closeButtonPath.left-2*this.closeButtonPath.width,T=this.closeButtonPath.top-f/2,C=4*this.closeButtonPath.width,y=this.closeButtonPath.height+f;this.closeButtonPath.mouseArea=l.rect(v,T,C,y),this.closeButtonPath.touchArea=this.closeButtonPath.mouseArea,n.call(this,e,i),this.closeButtonPath.right=e.right+2*p-f,this.closeButtonPath.top=e.top+f,this.addChild(this.closeButtonPath);var S=this.closeButtonPath.addAccessibleInputListener({click:function(){A.hide(),A.focusActiveElement()}});this.disposeKeyboardHelpDialog=function(){A.closeButtonPath.removeInputListener(b),A.closeButtonPath.removeAccessibleInputListener(S)}}var i=t("PHET_CORE/inherit"),n=t("JOIST/Dialog"),r=t("JOIST/joist"),s=t("SCENERY/input/ButtonListener"),a=t("SCENERY/nodes/Path"),o=t("SCENERY/nodes/Text"),l=t("KITE/Shape"),h=t("JOIST/JoistA11yStrings"),c=t("SCENERY_PHET/PhetFont"),u=t("TANDEM/Tandem"),d=7,f=10,p=20,m=500,g=t("string!JOIST/keyboardShortcuts.title");return r.register("KeyboardHelpDialog",e),i(n,e,{dispose:function(){this.disposeKeyboardHelpDialog(),n.prototype.dispose.call(this)}})}),i("mipmap!JOIST/keyboard-icon.png",function(){var t=window.phet.chipper.mipmaps["JOIST/keyboard-icon.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("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","PHET_CORE/inherit","AXON/Property","KITE/Shape","SCENERY/nodes/Image","JOIST/JoistButton","JOIST/KeyboardHelpDialog","JOIST/JoistA11yStrings","JOIST/joist","mipmap!JOIST/keyboard-icon.png","mipmap!JOIST/keyboard-icon-on-white.png"],function(t){"use strict";function e(t,e,i){var h=this,f=null,p=function(){f||(f=new o(h,t.keyboardHelpNode,{tandem:i.createTandem("keyboardHelpDialog")})),f.show()},m={highlightExtensionWidth:5,highlightExtensionHeight:10,highlightCenterOffsetY:3,listener:p,tagName:"button",accessibleLabel:l.hotKeysAndHelpString},g=new s(c,{scale:d,pickable:!1});a.call(this,g,e,i,m),this.focusHighlight=r.bounds(g.bounds.dilated(5)),n.multilink([e,t.showHomeScreenProperty],function(t,e){var i="black"!==t&&!e;g.image=i?u:c}),this.clickListener=this.addAccessibleInputListener({click:function(){p(),f.closeButtonPath.focus()}})}var i=t("PHET_CORE/inherit"),n=t("AXON/Property"),r=t("KITE/Shape"),s=t("SCENERY/nodes/Image"),a=t("JOIST/JoistButton"),o=t("JOIST/KeyboardHelpDialog"),l=t("JOIST/JoistA11yStrings"),h=t("JOIST/joist"),c=t("mipmap!JOIST/keyboard-icon.png"),u=t("mipmap!JOIST/keyboard-icon-on-white.png"),d=.32/c[0].height*67;return h.register("KeyboardHelpButton",e),i(a,e,{dispose:function(){this.removeAccessibleInputListener(this.clickListener),a.prototype.dispose&&a.prototype.dispose.call(this)}})}),i("string!JOIST/simTitleWithScreenNamePattern",function(){return window.phet.chipper.strings.get("JOIST/simTitleWithScreenNamePattern")}),i("JOIST/NavigationBar",["require","DOT/Dimension2","JOIST/HomeButton","PHET_CORE/inherit","PHET_CORE/platform","JOIST/NavigationBarScreenButton","JOIST/HomeScreenView","SCENERY/nodes/Node","JOIST/PhetButton","JOIST/KeyboardHelpButton","SCENERY_PHET/PhetFont","SCENERY/nodes/Rectangle","PHETCOMMON/util/StringUtils","SCENERY/nodes/Text","JOIST/JoistA11yStrings","JOIST/joist","string!JOIST/simTitleWithScreenNamePattern"],function(t){"use strict";function e(t,e,i){this.screens=e,l.call(this),this.background=new d(0,0,A.width,A.height,{pickable:!0}),t.lookAndFeel.navigationBarFillProperty.linkAttribute(this.background,"fill"),this.addChild(this.background),this.barContents=new l,this.addChild(this.barContents);var r=t.name;if(phet.chipper.queryParameters.screens&&1===phet.chipper.queryParameters.screens.length&&e[0].name&&(r=f.fillIn(E,{simName:t.name,screenName:e[0].name})),this.titleTextNode=new p(r,{font:new u(16),tandem:i.createTandem("titleTextNode")}),t.lookAndFeel.navigationBarTextFillProperty.linkAttribute(this.titleTextNode,"fill"),this.barContents.addChild(this.titleTextNode),this.phetButton=new h(t,t.lookAndFeel.navigationBarFillProperty,t.lookAndFeel.navigationBarTextFillProperty,i.createTandem("phetButton")),this.barContents.addChild(this.phetButton),this.keyboardHelpButton=new c(t,t.lookAndFeel.navigationBarFillProperty,i.createTandem("keyboardHelpButton")),t.accessible&&t.keyboardHelpNode&&!s.mobileSafari&&this.barContents.addChild(this.keyboardHelpButton),1===e.length)this.titleTextNode.maxWidth=o.LAYOUT_BOUNDS.width-b-v-this.phetButton.width-T-this.keyboardHelpButton.width-y;else{var g=Math.min(this.titleTextNode.width,.2*o.LAYOUT_BOUNDS.width);this.homeButton=new n(A.height,t.lookAndFeel.navigationBarFillProperty,i.createTandem("homeButton"),{listener:function(){t.showHomeScreenProperty.value=!0}}),this.barContents.addChild(this.homeButton);for(var w=o.LAYOUT_BOUNDS.width/2-b-g-v-this.homeButton.width-O,R=o.LAYOUT_BOUNDS.width/2-this.phetButton.width-T-this.keyboardHelpButton.width-y,N=2*Math.min(w,R),x=(N-(e.length-1)*P)/e.length,D=_.map(e,function(e){return new a(t.lookAndFeel.navigationBarFillProperty,t.screenIndexProperty,t.screens,e,A.height,{maxButtonWidth:x,tandem:i.createTandem(e.tandem.tail+"Button")})}),B=Math.max(I,_.maxBy(D,function(t){return t.width}).width),k=B+P,L=0;L0}),this.addInputListener(new a({fire:function(e){i.startedCallbacksForFiredEmitter.emit(),t.get(t.length-1).hide(),i.endedCallbacksForFiredEmitter.emit()}})),this.disposeBarrierRectangle=function(){t.lengthProperty.unlink()},this.mutate(e)}var i=t("PHET_CORE/inherit"),n=t("SCENERY_PHET/sceneryPhet"),r=t("AXON/Emitter"),s=t("SCENERY/nodes/Plane"),a=t("SCENERY/input/ButtonListener"),o=t("TANDEM/Tandem"),l=t("SCENERY_PHET/TBarrierRectangle");return n.register("BarrierRectangle",e),i(s,e,{dispose:function(){this.disposeBarrierRectangle(),s.prototype.dispose.call(this)}})}),i("JOIST/Profiler",["require","PHET_CORE/inherit","JOIST/joist"],function(t){"use strict";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=t("JOIST/joist"),r=30;return n.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}),n=n+" — "+this.longTimes),$("#phetProfiler").html(n),e=0;ee.length-1)throw new Error("invalid screen index: "+t);p.push(e[i])}),e=p}i=_.extend({showHomeScreen:e.length>1&&phet.chipper.queryParameters.showHomeScreen,screenIndex:phet.chipper.queryParameters.screenIndex-1,credits:{},optionsNode:null,homeScreenWarningNode:null,recordInputEventLog:!1,inputEventLogName:void 0,showSaveAndLoad:!1,showSmallHomeScreenIconFrame:!1,accessibility:phet.chipper.queryParameters.accessibility,keyboardHelpNode:null,rootRenderer:g.edge?"canvas":"svg"},i),this.options=i,i.rootRenderer=phet.chipper.queryParameters.rootRenderer||i.rootRenderer,this.showHomeScreenProperty=new f(i.showHomeScreen,{tandem:h.createTandem("sim.showHomeScreenProperty"),phetioValueType:N}),this.screenIndexProperty=new f(i.screenIndex,{tandem:h.createTandem("sim.screenIndexProperty"),phetioValueType:x({values:_.range(0,e.length)})}),this.activeProperty=new f(!phet.joist.playbackModeEnabledProperty.value,{tandem:h.createTandem("sim.activeProperty"),phetioValueType:N}),this.browserTabVisibleProperty=new f(!0,{tandem:h.createTandem("browserTabVisibleProperty"),phetioValueType:N,phetioInstanceDocumentation:"this Property is read-only, do not attempt to set its value"}),document.addEventListener("visibilitychange",function(){l.browserTabVisibleProperty.set("visible"===document.visibilityState)},!1),this.scaleProperty=new f(1),this.boundsProperty=new f(null),this.screenBoundsProperty=new f(null),this.currentScreenProperty=new f(null),c.addInstance(this,w),this.lookAndFeel=new v,this.destroyed=!1,this.accessible=i.accessibility,this.keyboardHelpNode=i.keyboardHelpNode,window.phet.joist.sim=l,window.phet.joist.ScreenshotGenerator=T,this.name=t,this.version=C.version,this.credits=i.credits,this.frameCounter=0,this.resizePending=!0,this.inputEventLog=[],this.inputEventBounds=n.NOTHING,this.locale=phet.chipper.locale||"en",QueryStringMachine.containsKey("locale")&&$("title").html(t),phet.chipper.queryParameters.recordInputEventLog&&(i.recordInputEventLog=!0,i.inputEventLogName=phet.chipper.queryParameters.recordInputEventLog),phet.chipper.queryParameters.playbackInputEventLog&&(i.playbackInputEventLog=!0,i.inputEventLogName=phet.chipper.queryParameters.playbackInputEventLog),phet.chipper.queryParameters.fuzzMouse&&(window.open=function(){return{focus:function(){},blur:function(){}}}),this.startedSimConstructorEmitter.emit1({repoName:C.name,simName:this.name,simVersion:this.version,url:window.location.href,randomSeed:window.phet.chipper.randomSeed}),$("body").css("padding","0").css("margin","0").css("overflow","hidden");var m=document.getElementById("aria-live-elements");m&&(m.style[s.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 d({renderer:i.rootRenderer}),this.activeProperty.lazyLink(function(t){t||l.rootNode.interruptSubtreeInput()}),this.display=new u(l.rootNode,{allowSceneOverflow:!1,allowWebGL:phet.chipper.queryParameters.webgl,accessibility:i.accessibility,isApplication:!1,assumeFullWindow:!0}),this.activeProperty.link(function(t){l.display.interactive=t});var E=l.display.domElement;E.id="sim",document.body.appendChild(E);var A=this.heartbeatDiv=document.createElement("div");A.style.opacity=0,A.style.position="absolute",A.style.left="0",A.style.top="0",A.style.width="0",A.style.height="0",A.style.clip="rect(0,0,0,0)",A.setAttribute("aria-hidden",!0),E.appendChild(A),phet.chipper.queryParameters.sceneryLog&&this.display.scenery.enableLogging(phet.chipper.queryParameters.sceneryLog),phet.chipper.queryParameters.sceneryStringLog&&this.display.scenery.switchLogToString(),this.display.initializeEvents(),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),window.phet.joist.makeEverythingSlow=function(){window.setInterval(function(){r(64)},16)},window.phet.joist.makeRandomSlowness=function(){window.setInterval(function(){r(Math.ceil(100+200*Math.random()))},Math.ceil(100+200*Math.random()))},this.screens=e,e.length>1?(this.homeScreen=new o(this,h.createTandem("homeScreen"),{warningNode:i.homeScreenWarningNode,showSmallHomeScreenIconFrame:i.showSmallHomeScreenIconFrame}),this.homeScreen.initializeModelAndView()):this.homeScreen=null,this.navigationBar=new a(this,e,h.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}),f.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()}),phet.chipper.queryParameters.legendsOfLearning&&new R(this).start()}var i=t("PHET_CORE/inherit"),n=t("DOT/Bounds2"),r=t("DOT/Dimension2"),s=t("SCENERY/util/Features"),a=t("JOIST/NavigationBar"),o=t("JOIST/HomeScreen"),l=t("JOIST/HomeScreenView"),h=t("JOIST/UpdateCheck"),c=t("SCENERY/util/Util"),u=t("SCENERY/display/Display"),d=t("SCENERY/nodes/Node"),f=t("AXON/Property"),p=t("AXON/BooleanProperty"),m=t("AXON/ObservableArray"),g=t("PHET_CORE/platform"),E=t("PHET_CORE/Timer"),A=t("SCENERY_PHET/BarrierRectangle"),b=t("JOIST/Profiler"),v=t("JOIST/LookAndFeel"),T=t("JOIST/ScreenshotGenerator"),C=t("JOIST/packageJSON"),y=t("JOIST/PhetButton"),S=t("JOIST/joist"),O=t("TANDEM/Tandem"),P=t("DOT/Util"),I=t("AXON/Emitter"),w=t("JOIST/TSim"),R=t("JOIST/thirdPartySupport/LegendsOfLearningSupport"),N=t("ifphetio!PHET_IO/types/TBoolean"),x=t("ifphetio!PHET_IO/types/TNumber");return phet.joist.elapsedTime=0,phet.joist.playbackModeEnabledProperty=new p(!1),S.register("Sim",e),i(Object,e,{finishInit:function(t,e){var i=this;this.homeScreen&&this.rootNode.addChild(this.homeScreen.view),_.each(t,function(t){t.view.layerSplit=!0,i.rootNode.addChild(t.view)}),this.rootNode.addChild(this.navigationBar),this.homeScreen&&y.linkPhetButtonTransform(this.homeScreen,this.navigationBar,this.rootNode),f.multilink([this.showHomeScreenProperty,this.screenIndexProperty],function(e,n){i.homeScreen&&(e?(i.homeScreen.activeProperty.set(!0),i.homeScreen.view.setVisible(!0)):(i.homeScreen.view.setVisible(!1), i.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.frameStartedEmitter.emit(),this.frameCounter++,this.frameCounter%1e3==0&&(this.heartbeatDiv.innerHTML=Math.random()),this.resizePending&&this.resizeToWindow(),phet.chipper.queryParameters.fuzzMouse&&this.display.fuzzMouseEvents(phet.chipper.queryParameters.fuzzRate);var e=this.getSelectedScreen();e&&e.maxDT&&(t=Math.min(t,e.maxDT)),phet.joist.elapsedTime=phet.joist.elapsedTime+1e3*t,E.step(t),e&&e.model.step&&t&&e.model.step(t),window.TWEEN&&window.TWEEN.update(phet.joist.elapsedTime),e&&e.view.step&&e.view.step(t),this.display.updateDisplay(),this.frameEndedEmitter.emit1(t)}})}),i("JOIST/checkNamespaces",["require","JOIST/joist"],function(t){"use strict";var e=t("JOIST/joist"),i=function(){var t=window.requirejs._defined||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 e.register("checkNamespaces",i),i}),i("DOT/Random",["require","DOT/Util","DOT/dot","PHET_CORE/inherit"],function(t){"use strict";function e(t){t=_.extend({seed:null,staticSeed:!1},t),null!==t.seed&&t.staticSeed;var e=t.staticSeed?window.phet.chipper.randomSeed:t.seed;this.setSeed(e)}var i=t("DOT/Util"),n=t("DOT/dot");return t("PHET_CORE/inherit")(Object,e,{setSeed:function(t){this.seed=t,this.seedrandom=null!==this.seed?new Math.seedrandom(this.seed+""):null},nextBoolean:function(){return this.nextDouble()>=.5},nextInt:function(t){return 0|this.nextDouble()*t},nextIntBetween:function(t,e){var i=e-t;return this.nextInt(i+1)+t},sample:function(t){return t[this.nextIntBetween(0,t.length-1)]},shuffle:function(t){var e=this,i=-1,n=new Array(t.length);return _.forEach(t,function(t){var r=e.nextIntBetween(0,++i);n[i]=n[r],n[r]=t}),n},nextDouble:function(){return null===this.seed?Math.random():this.seedrandom()},nextGaussian:function(){return i.boxMullerTransform(0,1,this)}}),n.register("Random",e),e}),i("PHET_IO/types/TPhETIO",function(){return function(){return function(){}}}),i("JOIST/SimLauncher",["require","JOIST/checkNamespaces","JOIST/joist","TANDEM/Tandem","DOT/Random","ifphetio!PHET_IO/SimIFrameAPI","ifphetio!PHET_IO/types/TPhETIO","ifphetio!PHET_IO/phetio"],function(t){"use strict";var e=(t("JOIST/checkNamespaces"),t("JOIST/joist")),i=t("TANDEM/Tandem"),n=t("DOT/Random"),r=t("ifphetio!PHET_IO/SimIFrameAPI"),s=t("ifphetio!PHET_IO/types/TPhETIO"),a=t("ifphetio!PHET_IO/phetio"),o={launch:function(t){function e(){window.phetLaunchSimulation=function(){i.launch(),phet.joist.random=new n({staticSeed:!0}),t()},phet.phetio&&(new i("phetio").addInstance(a,s),r.initialize()),phet.phetio&&!phet.phetio.queryParameters.phetioStandalone||window.phetLaunchSimulation()}window.phet.joist.launchCalled=!0;var o=[],l=0;if(window.phetImages)for(var h=0;h