!function(t){functione(n){if(r[n])returnr[n].exports;vari=r[n]={exports:{},id:n,loaded:!1};returnt[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}varr={};returne.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){functionn(){vart=this;i.call(t);vare=news;e.createClone();varr=[e.clones[0]];t.exampleSprite=e,t.runtime=newa(r),t.blockListener=e.blocks.generateBlockListener(!1,t.runtime),t.flyoutBlockListener=e.blocks.generateBlockListener(!0,t.runtime),t.runtime.on(a.STACK_GLOW_ON,function(e){t.emit(a.STACK_GLOW_ON,{id:e})}),t.runtime.on(a.STACK_GLOW_OFF,function(e){t.emit(a.STACK_GLOW_OFF,{id:e})}),t.runtime.on(a.BLOCK_GLOW_ON,function(e){t.emit(a.BLOCK_GLOW_ON,{id:e})}),t.runtime.on(a.BLOCK_GLOW_OFF,function(e){t.emit(a.BLOCK_GLOW_OFF,{id:e})}),t.runtime.on(a.VISUAL_REPORT,function(e,r){t.emit(a.VISUAL_REPORT,{id:e,value:r})})}vari=r(1),o=r(2),s=r(6),a=r(61),c="function"==typeofimportScripts;o.inherits(n,i),n.prototype.start=function(){this.runtime.start()},n.prototype.greenFlag=function(){this.runtime.greenFlag()},n.prototype.stopAll=function(){this.runtime.stopAll()},n.prototype.getPlaygroundData=function(){this.emit("playgroundData",{blocks:this.exampleSprite.blocks,threads:this.runtime.threads})},n.prototype.animationFrame=function(){this.runtime.animationFrame()},n.prototype.postIOData=function(t,e){this.runtime.ioDevices[t]&&this.runtime.ioDevices[t].postData(e)},c&&(self.importScripts("./node_modules/scratch-render/render-worker.js"),self.renderer=newself.RenderWebGLWorker,self.vmInstance=newn,self.onmessage=function(t){vare=t.data;switch(e.method){case"start":self.vmInstance.runtime.start();break;case"greenFlag":self.vmInstance.runtime.greenFlag();break;case"stopAll":self.vmInstance.runtime.stopAll();break;case"blockListener":self.vmInstance.blockListener(e.args);break;case"flyoutBlockListener":self.vmInstance.flyoutBlockListener(e.args);break;case"getPlaygroundData":self.postMessage({method:"playgroundData",blocks:self.vmInstance.exampleSprite.blocks,threads:self.vmInstance.runtime.threads});break;case"animationFrame":self.vmInstance.animationFrame();break;case"postIOData":self.vmInstance.postIOData(e.device,e.data);break;default:"RendererConnected"==t.data.id,self.renderer.onmessage(t)}},self.vmInstance.runtime.on(a.STACK_GLOW_ON,function(t){self.postMessage({method:a.STACK_GLOW_ON,id:t})}),self.vmInstance.runtime.on(a.STACK_GLOW_OFF,function(t){self.postMessage({method:a.STACK_GLOW_OFF,id:t})}),self.vmInstance.runtime.on(a.BLOCK_GLOW_ON,function(t){self.postMessage({method:a.BLOCK_GLOW_ON,id:t})}),self.vmInstance.runtime.on(a.BLOCK_GLOW_OFF,function(t){self.postMessage({method:a.BLOCK_GLOW_OFF,id:t})}),self.vmInstance.runtime.on(a.VISUAL_REPORT,function(t,e){self.postMessage({method:a.VISUAL_REPORT,id:t,value:e})})),t.exports=n,"undefined"!=typeofwindow&&(window.VirtualMachine=t.exports)},function(t,e){functionr(){this._events=this._events||{},this._maxListeners=this._maxListeners||void0}functionn(t){return"function"==typeoft}functioni(t){return"number"==typeoft}functiono(t){return"object"==typeoft&&null!==t}functions(t){returnvoid0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void0,r.prototype._maxListeners=void0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throwTypeError("n must be a positive number");returnthis._maxListeners=t,this},r.prototype.emit=function(t){vare,r,i,a,c,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],einstanceofError)throwe;throwTypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],s(r))return!1;if(n(r))switch(arguments.length){case1:r.call(this);break;case2:r.call(this,arguments[1]);break;case3:r.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),r.apply(this,a)}elseif(o(r))for(a=Array.prototype.slice.call(arguments,1),u=r.slice(),i=u.length,c=0;i>c;c++)u[c].apply(this,a);return!0},r.prototype.addListener=function(t,e){vari;if(!n(e))throwTypeEr
this._index--)},a.prototype._stateBeforeSpecialEnd=function(t){this._special!==_t||"c"!==t&&"C"!==t?this._special!==mt||"t"!==t&&"T"!==t?this._state=f:this._state=ot:this._state=J},a.prototype._stateBeforeScript1=s("R",H),a.prototype._stateBeforeScript2=s("I",W),a.prototype._stateBeforeScript3=s("P",X),a.prototype._stateBeforeScript4=s("T",K),a.prototype._stateBeforeScript5=function(t){("/"===t||">"===t||n(t))&&(this._special=_t),this._state=g,this._index--},a.prototype._stateAfterScript1=o("R",Q,f),a.prototype._stateAfterScript2=o("I",Z,f),a.prototype._stateAfterScript3=o("P",$,f),a.prototype._stateAfterScript4=o("T",tt,f),a.prototype._stateAfterScript5=function(t){">"===t||n(t)?(this._special=gt,this._state=b,this._sectionStart=this._index-6,this._index--):this._state=f},a.prototype._stateBeforeStyle1=s("Y",rt),a.prototype._stateBeforeStyle2=s("L",nt),a.prototype._stateBeforeStyle3=s("E",it),a.prototype._stateBeforeStyle4=function(t){("/"===t||">"===t||n(t))&&(this._special=mt),this._state=g,this._index--},a.prototype._stateAfterStyle1=o("Y",st,f),a.prototype._stateAfterStyle2=o("L",at,f),a.prototype._stateAfterStyle3=o("E",ct,f),a.prototype._stateAfterStyle4=function(t){">"===t||n(t)?(this._special=gt,this._state=b,this._sectionStart=this._index-5,this._index--):this._state=f},a.prototype._stateBeforeEntity=o("#",ht,lt),a.prototype._stateBeforeNumericEntity=o("X",ft,pt),a.prototype._parseNamedEntityStrict=function(){if(this._sectionStart+1<this._index){vart=this._buffer.substring(this._sectionStart+1,this._index),e=this._xmlMode?l:u;e.hasOwnProperty(t)&&(this._emitPartial(e[t]),this._sectionStart=this._index+1)}},a.prototype._parseLegacyEntity=function(){vart=this._sectionStart+1,e=this._index-t;for(e>6&&(e=6);e>=2;){varr=this._buffer.substr(t,e);if(h.hasOwnProperty(r))returnthis._emitPartial(h[r]),void(this._sectionStart+=e+1);e--}},a.prototype._stateInNamedEntity=function(t){";"===t?(this._parseNamedEntityStrict(),this._sectionStart+1<this._index&&!this._xmlMode&&this._parseLegacyEntity(),this._state=this._baseState):("a">t||t>"z")&&("A">t||t>"Z")&&("0">t||t>"9")&&(this._xmlMode||this._sectionStart+1===this._index||(this._baseState!==f?"="!==t&&this._parseNamedEntityStrict():this._parseLegacyEntity()),this._state=this._baseState,this._index--)},a.prototype._decodeNumericEntity=function(t,e){varr=this._sectionStart+t;if(r!==this._index){varn=this._buffer.substring(r,this._index),i=parseInt(n,e);this._emitPartial(c(i)),this._sectionStart=this._index}elsethis._sectionStart--;this._state=this._baseState},a.prototype._stateInNumericEntity=function(t){";"===t?(this._decodeNumericEntity(2,10),this._sectionStart++):("0">t||t>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(2,10),this._index--)},a.prototype._stateInHexEntity=function(t){";"===t?(this._decodeNumericEntity(3,16),this._sectionStart++):("a">t||t>"f")&&("A">t||t>"F")&&("0">t||t>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(3,16),this._index--)},a.prototype._cleanup=function(){this._sectionStart<0?(this._buffer="",this._index=0,this._bufferOffset+=this._index):this._running&&(this._state===f?(this._sectionStart!==this._index&&this._cbs.ontext(this._buffer.substr(this._sectionStart)),this._buffer="",this._index=0,this._bufferOffset+=this._index):this._sectionStart===this._index?(this._buffer="",this._index=0,this._bufferOffset+=this._index):(this._buffer=this._buffer.substr(this._sectionStart),this._index-=this._sectionStart,this._bufferOffset+=this._sectionStart),this._sectionStart=0)},a.prototype.write=function(t){this._ended&&this._cbs.onerror(Error(".write() after done!")),this._buffer+=t,this._parse()},a.prototype._parse=function(){for(;this._index<this._buffer.length&&this._running;){vart=this._buffer.charAt(this._index);this._state===f?this._stateText(t):this._state===d?this._stateBeforeTagName(t):this._state===g?this._stateInTagName(t):this._state===m?this._stateBeforeCloseingTagName(t):this._state===b?this._stateInCloseingTagName(t):this._state===y?this._stateAfterCloseingTagName(t):this._stat
"use strict";functioni(){functiont(){}try{vare=newUint8Array(1);returne.foo=function(){return42},e.constructor=t,42===e.foo()&&e.constructor===t&&"function"==typeofe.subarray&&0===e.subarray(1,1).byteLength}catch(r){return!1}}functiono(){returnt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}functiont(e){returnthisinstanceoft?(t.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void0),"number"==typeofe?s(this,e):"string"==typeofe?a(this,e,arguments.length>1?arguments[1]:"utf8"):c(this,e)):arguments.length>1?newt(e,arguments[1]):newt(e)}functions(e,r){if(e=g(e,0>r?0:0|_(r)),!t.TYPED_ARRAY_SUPPORT)for(varn=0;r>n;n++)e[n]=0;returne}functiona(t,e,r){"string"==typeofr&&""!==r||(r="utf8");varn=0|b(e,r);returnt=g(t,n),t.write(e,r),t}functionc(e,r){if(t.isBuffer(r))returnu(e,r);if(J(r))returnh(e,r);if(null==r)thrownewTypeError("must start with number, buffer, array or string");if("undefined"!=typeofArrayBuffer){if(r.bufferinstanceofArrayBuffer)returnl(e,r);if(rinstanceofArrayBuffer)returnp(e,r)}returnr.length?f(e,r):d(e,r)}functionu(t,e){varr=0|_(e.length);returnt=g(t,r),e.copy(t,0,0,r),t}functionh(t,e){varr=0|_(e.length);t=g(t,r);for(varn=0;r>n;n+=1)t[n]=255&e[n];returnt}functionl(t,e){varr=0|_(e.length);t=g(t,r);for(varn=0;r>n;n+=1)t[n]=255&e[n];returnt}functionp(e,r){returnt.TYPED_ARRAY_SUPPORT?(r.byteLength,e=t._augment(newUint8Array(r))):e=l(e,newUint8Array(r)),e}functionf(t,e){varr=0|_(e.length);t=g(t,r);for(varn=0;r>n;n+=1)t[n]=255&e[n];returnt}functiond(t,e){varr,n=0;"Buffer"===e.type&&J(e.data)&&(r=e.data,n=0|_(r.length)),t=g(t,n);for(vari=0;n>i;i+=1)t[i]=255&r[i];returnt}functiong(e,r){t.TYPED_ARRAY_SUPPORT?(e=t._augment(newUint8Array(r)),e.__proto__=t.prototype):(e.length=r,e._isBuffer=!0);varn=0!==r&&r<=t.poolSize>>>1;returnn&&(e.parent=Q),e}function_(t){if(t>=o())thrownewRangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return0|t}functionm(e,r){if(!(thisinstanceofm))returnnewm(e,r);varn=newt(e,r);returndeleten.parent,n}functionb(t,e){"string"!=typeoft&&(t=""+t);varr=t.length;if(0===r)return0;for(varn=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":returnr;case"utf8":case"utf-8":returnY(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return2*r;case"hex":returnr>>>1;case"base64":returnH(t).length;default:if(n)returnY(t).length;e=(""+e).toLowerCase(),n=!0}}functiony(t,e,r){varn=!1;if(e=0|e,r=void0===r||r===1/0?this.length:0|r,t||(t="utf8"),0>e&&(e=0),r>this.length&&(r=this.length),e>=r)return"";for(;;)switch(t){case"hex":returnR(this,e,r);case"utf8":case"utf-8":returnA(this,e,r);case"ascii":returnI(this,e,r);case"binary":returnD(this,e,r);case"base64":returnT(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":returnN(this,e,r);default:if(n)thrownewTypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}functionv(t,e,r,n){r=Number(r)||0;vari=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;varo=e.length;if(o%2!==0)thrownewError("Invalid hex string");n>o/2&&(n=o/2);for(vars=0;n>s;s++){vara=parseInt(e.substr(2*s,2),16);if(isNaN(a))thrownewError("Invalid hex string");t[r+s]=a}returns}functionw(t,e,r,n){returnW(Y(e,t.length-r),t,r,n)}functionS(t,e,r,n){returnW(V(e),t,r,n)}functionE(t,e,r,n){returnS(t,e,r,n)}functionk(t,e,r,n){returnW(H(e),t,r,n)}functionx(t,e,r,n){returnW(z(e,t.length-r),t,r,n)}functionT(t,e,r){return0===e&&r===t.length?X.fromByteArray(t):X.fromByteArray(t.slice(e,r))}functionA(t,e,r){r=Math.min(t.length,r);for(varn=[],i=e;r>i;){varo=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(r>=i+a){varc,u,h,l;switch(a){case1:128>o&&(s=o);break;case2:c=t[i+1],128===(192&c)&&(l=(31&o)<<6|63&c,l>127&&(s=l));break;case3:c=t[i+1],u=t[i+2],128===(192&c)&&128===(192&u)&&(l=(15&o)<<12|(63&c)<<6|63&u,l>2047&&(55296>l||l>57343)&&(s=l));break;case4:c=t[i+1],u=t[i+2],h=t[i+3],128===(192&c)&&128===(192&u)&&128===(192&h)&&(l=(15&o)<<18|(63&c)<<12|(63&u)<<6|63&h,l>65535&&1114112>l&&(s=l))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n