!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){(function(e){t.exports=e.VirtualMachine=r(1)}).call(e,function(){returnthis}())},function(t,e,r){functionn(t){vare=this;i.call(e),e.runtime=news(t),e.editingTarget=null,e.runtime.on(s.SCRIPT_GLOW_ON,function(t){e.emit(s.SCRIPT_GLOW_ON,{id:t})}),e.runtime.on(s.SCRIPT_GLOW_OFF,function(t){e.emit(s.SCRIPT_GLOW_OFF,{id:t})}),e.runtime.on(s.BLOCK_GLOW_ON,function(t){e.emit(s.BLOCK_GLOW_ON,{id:t})}),e.runtime.on(s.BLOCK_GLOW_OFF,function(t){e.emit(s.BLOCK_GLOW_OFF,{id:t})}),e.runtime.on(s.VISUAL_REPORT,function(t,r){e.emit(s.VISUAL_REPORT,{id:t,value:r})}),this.blockListener=this.blockListener.bind(this)}vari=r(2),o=r(3),s=r(7),a=r(34),u=r(89),c=r(35);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.editingTarget.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)},n.prototype.loadProject=function(t){a(t,this.runtime),this.editingTarget=this.runtime.targets[0],this.emitTargetsUpdate(),this.emitWorkspaceUpdate(),this.runtime.setEditingTarget(this.editingTarget)},n.prototype.createEmptyProject=function(){vart=newc,e=newu(t);e.name="Stage",e.costumes.push({skin:"/assets/stage.png",name:"backdrop1",bitmapResolution:1,rotationCenterX:240,rotationCenterY:180});varr=e.createClone();this.runtime.targets.push(r),r.x=0,r.y=0,r.direction=90,r.size=200,r.visible=!0,r.isStage=!0;varn=newc,i=newu(n);i.name="Sprite1",i.costumes.push({skin:"/assets/scratch_cat.svg",name:"costume1",bitmapResolution:1,rotationCenterX:47,rotationCenterY:55});varo=i.createClone();this.runtime.targets.push(o),o.x=0,o.y=0,o.direction=90,o.size=100,o.visible=!0,this.editingTarget=this.runtime.targets[0],this.emitTargetsUpdate(),this.emitWorkspaceUpdate()},n.prototype.blockListener=function(t){this.editingTarget&&this.editingTarget.blocks.blocklyListen(t,!1,this.runtime)},n.prototype.setEditingTarget=function(t){if(t!=this.editingTarget.id){vare=this.runtime.getTargetById(t);e&&(this.editingTarget=e,this.emitTargetsUpdate(),this.emitWorkspaceUpdate(),this.runtime.setEditingTarget(e))}},n.prototype.emitTargetsUpdate=function(){this.emit("targetsUpdate",{targetList:this.runtime.targets.filter(function(t){return!t.hasOwnProperty("isOriginal")||t.isOriginal}).map(function(t){return[t.id,t.getName()]}),editingTarget:this.editingTarget.id})},n.prototype.emitWorkspaceUpdate=function(){this.emit("workspaceUpdate",{xml:this.editingTarget.blocks.toXML()})},t.exports=n},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)||t<0||isNaN(t))throwTypeError("n must be a positive number");returnthis._maxListeners=t,this},r.prototype.emit=function(t){vare,r,i,a,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],einstanceofError)throwe;varp=newError('Uncaught, unspecified "error" event. ('+e+")");throwp.context=e,p}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),c=r.slice(
})}functionh(t,e){if(e===t)returnl(t,newTypeError("A promise cannot be resolved with itself."));if(e&&("object"==typeofe||"function"==typeofe)){varr=i(e);if(r===y)returnl(t,_);if(r===t.then&&einstanceofa)returnt._81=3,t._65=e,voidf(t);if("function"==typeofr)returnvoidg(r.bind(e),t)}t._81=1,t._65=e,f(t)}functionl(t,e){t._81=2,t._65=e,a._97&&a._97(t,e),f(t)}functionf(t){if(1===t._45&&(c(t,t._54),t._54=null),2===t._45){for(vare=0;e<t._54.length;e++)c(t,t._54[e]);t._54=null}}functiond(t,e,r){this.onFulfilled="function"==typeoft?t:null,this.onRejected="function"==typeofe?e:null,this.promise=r}functiong(t,e){varr=!1,n=s(t,function(t){r||(r=!0,h(e,t))},function(t){r||(r=!0,l(e,t))});r||n!==y||(r=!0,l(e,_))}varm=r(22),_=null,y={};t.exports=a,a._10=null,a._97=null,a._61=n,a.prototype.then=function(t,e){if(this.constructor!==a)returnu(this,t,e);varr=newa(n);returnc(this,newd(t,e,r)),r}},function(t,e){(function(e){"use strict";functionr(t){a.length||(s(),u=!0),a[a.length]=t}functionn(){for(;c<a.length;){vart=c;if(c+=1,a[t].call(),c>p){for(vare=0,r=a.length-c;e<r;e++)a[e]=a[e+c];a.length-=c,c=0}}a.length=0,c=0,u=!1}functioni(t){vare=1,r=newh(t),n=document.createTextNode("");returnr.observe(n,{characterData:!0}),function(){e=-e,n.data=e}}functiono(t){returnfunction(){functione(){clearTimeout(r),clearInterval(n),t()}varr=setTimeout(e,0),n=setInterval(e,50)}}t.exports=r;vars,a=[],u=!1,c=0,p=1024,h=e.MutationObserver||e.WebKitMutationObserver;s="function"==typeofh?i(n):o(n),r.requestFlush=s,r.makeRequestCallFromTimer=o}).call(e,function(){returnthis}())},function(t,e,r){"use strict";varn=r(21);t.exports=n,n.prototype.done=function(t,e){varr=arguments.length?this.then.apply(this,arguments):this;r.then(null,function(t){setTimeout(function(){throwt},0)})}},function(t,e,r){"use strict";varn=r(21);t.exports=n,n.prototype["finally"]=function(t){returnthis.then(function(e){returnn.resolve(t()).then(function(){returne})},function(e){returnn.resolve(t()).then(function(){throwe})})}},function(t,e,r){"use strict";functionn(t){vare=newi(i._61);returne._81=1,e._65=t,e}vari=r(21);t.exports=i;varo=n(!0),s=n(!1),a=n(null),u=n(void0),c=n(0),p=n("");i.resolve=function(t){if(tinstanceofi)returnt;if(null===t)returna;if(void0===t)returnu;if(t===!0)returno;if(t===!1)returns;if(0===t)returnc;if(""===t)returnp;if("object"==typeoft||"function"==typeoft)try{vare=t.then;if("function"==typeofe)returnnewi(e.bind(t))}catch(r){returnnewi(function(t,e){e(r)})}returnn(t)},i.all=function(t){vare=Array.prototype.slice.call(t);returnnewi(function(t,r){functionn(s,a){if(a&&("object"==typeofa||"function"==typeofa)){if(ainstanceofi&&a.then===i.prototype.then){for(;3===a._81;)a=a._65;return1===a._81?n(s,a._65):(2===a._81&&r(a._65),voida.then(function(t){n(s,t)},r))}varu=a.then;if("function"==typeofu){varc=newi(u.bind(a));returnvoidc.then(function(t){n(s,t)},r)}}e[s]=a,0===--o&&t(e)}if(0===e.length)returnt([]);for(varo=e.length,s=0;s<e.length;s++)n(s,e[s])})},i.reject=function(t){returnnewi(function(e,r){r(t)})},i.race=function(t){returnnewi(function(e,r){t.forEach(function(t){i.resolve(t).then(e,r)})})},i.prototype["catch"]=function(t){returnthis.then(null,t)}},function(t,e,r){"use strict";functionn(t,e){for(varr=[],n=0;n<e;n++)r.push("a"+n);vari=["return function ("+r.join(",")+") {","var self = this;","return new Promise(function (rs, rj) {","var res = fn.call(",["self"].concat(r).concat([a]).join(","),");","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");returnFunction(["Promise","fn"],i)(o,t)}functioni(t){for(vare=Math.max(t.length-1,3),r=[],n=0;n<e;n++)r.push("a"+n);vari=["return function ("+r.join(",")+") {","var self = this;","var args;","var argLength = arguments.length;","if (arguments.length > "+e+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","va
"use strict";functioni(){try{vart=newUint8Array(1);returnt.__proto__={__proto__:Uint8Array.prototype,foo:function(){return42}},42===t.foo()&&"function"==typeoft.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}functiono(){returnt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}functions(e,r){if(o()<r)thrownewRangeError("Invalid typed array length");returnt.TYPED_ARRAY_SUPPORT?(e=newUint8Array(r),e.__proto__=t.prototype):(null===e&&(e=newt(r)),e.length=r),e}functiont(e,r,n){if(!(t.TYPED_ARRAY_SUPPORT||thisinstanceoft))returnnewt(e,r,n);if("number"==typeofe){if("string"==typeofr)thrownewError("If encoding is specified then the first argument must be a string");returnp(this,e)}returna(this,e,r,n)}functiona(t,e,r,n){if("number"==typeofe)thrownewTypeError('"value" argument must not be a number');return"undefined"!=typeofArrayBuffer&&einstanceofArrayBuffer?f(t,e,r,n):"string"==typeofe?h(t,e,r):d(t,e)}functionu(t){if("number"!=typeoft)thrownewTypeError('"size" argument must be a number');if(t<0)thrownewRangeError('"size" argument must not be negative')}functionc(t,e,r,n){returnu(e),e<=0?s(t,e):void0!==r?"string"==typeofn?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}functionp(e,r){if(u(r),e=s(e,r<0?0:0|g(r)),!t.TYPED_ARRAY_SUPPORT)for(varn=0;n<r;++n)e[n]=0;returne}functionh(e,r,n){if("string"==typeofn&&""!==n||(n="utf8"),!t.isEncoding(n))thrownewTypeError('"encoding" must be a valid string encoding');vari=0|_(r,n);e=s(e,i);varo=e.write(r,n);returno!==i&&(e=e.slice(0,o)),e}functionl(t,e){varr=e.length<0?0:0|g(e.length);t=s(t,r);for(varn=0;n<r;n+=1)t[n]=255&e[n];returnt}functionf(e,r,n,i){if(r.byteLength,n<0||r.byteLength<n)thrownewRangeError("'offset' is out of bounds");if(r.byteLength<n+(i||0))thrownewRangeError("'length' is out of bounds");returnr=void0===n&&void0===i?newUint8Array(r):void0===i?newUint8Array(r,n):newUint8Array(r,n,i),t.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=t.prototype):e=l(e,r),e}functiond(e,r){if(t.isBuffer(r)){varn=0|g(r.length);returne=s(e,n),0===e.length?e:(r.copy(e,0,0,n),e)}if(r){if("undefined"!=typeofArrayBuffer&&r.bufferinstanceofArrayBuffer||"length"inr)return"number"!=typeofr.length||J(r.length)?s(e,0):l(e,r);if("Buffer"===r.type&&$(r.data))returnl(e,r.data)}thrownewTypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}functiong(t){if(t>=o())thrownewRangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return0|t}functionm(e){return+e!=e&&(e=0),t.alloc(+e)}function_(e,r){if(t.isBuffer(e))returne.length;if("undefined"!=typeofArrayBuffer&&"function"==typeofArrayBuffer.isView&&(ArrayBuffer.isView(e)||einstanceofArrayBuffer))returne.byteLength;"string"!=typeofe&&(e=""+e);varn=e.length;if(0===n)return0;for(vari=!1;;)switch(r){case"ascii":case"latin1":case"binary":returnn;case"utf8":case"utf-8":casevoid0:returnV(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return2*n;case"hex":returnn>>>1;case"base64":returnW(e).length;default:if(i)returnV(e).length;r=(""+r).toLowerCase(),i=!0}}functiony(t,e,r){varn=!1;if((void0===e||e<0)&&(e=0),e>this.length)return"";if((void0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":returnR(this,e,r);case"utf8":case"utf-8":returnA(this,e,r);case"ascii":returnM(this,e,r);case"latin1":case"binary":returnL(this,e,r);case"base64":returnO(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":returnD(this,e,r);default:if(n)thrownewTypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}functionb(t,e,r){varn=t[e];t[e]=t[r],t[r]=n}functionv(e,r,n,i,o){if(0===e.length)return-1;if("string"==typeofn?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}elseif(n<0){if(!o)return-1;n=0}if("string"==typeofr&&(r=t.from(r,i)),t.isBuffer(r))return0===r.length?-1:w(e,r,n,i,o);if("number"==ty
n.writeencoding=e,!n.transforming){vari=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(t){vare=this._transformState;u.isNull(e.writechunk)||!e.writecb||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))}},function(t,e,r){functionn(t){returnthisinstanceofn?voidi.call(this,t):newn(t)}t.exports=n;vari=r(67),o=r(61);o.inherits=r(62),o.inherits(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){t.exports=r(65)},function(t,e,r){t.exports=r(64)},function(t,e,r){t.exports=r(67)},function(t,e,r){t.exports=r(68)},function(t,e){},function(t,e,r){functionn(t){this._cbs=t||{}}t.exports=n;vari=r(37).EVENTS;Object.keys(i).forEach(function(t){if(0===i[t])t="on"+t,n.prototype[t]=function(){this._cbs[t]&&this._cbs[t]()};elseif(1===i[t])t="on"+t,n.prototype[t]=function(e){this._cbs[t]&&this._cbs[t](e)};else{if(2!==i[t])throwError("wrong number of arguments");t="on"+t,n.prototype[t]=function(e,r){this._cbs[t]&&this._cbs[t](e,r)}}})},function(t,e,r){varn=t.exports;[r(76),r(82),r(83),r(84),r(85),r(86)].forEach(function(t){Object.keys(t).forEach(function(e){n[e]=t[e].bind(n)})})},function(t,e,r){functionn(t,e){returnt.children?t.children.map(function(t){returns(t,e)}).join(""):""}functioni(t){returnArray.isArray(t)?t.map(i).join(""):a(t)||t.type===o.CDATA?i(t.children):t.type===o.Text?t.data:""}varo=r(46),s=r(77),a=o.isTag;t.exports={getInnerHTML:n,getOuterHTML:s,getText:i}},function(t,e,r){functionn(t,e){if(t){varr,n="";for(variint)r=t[i],n&&(n+=" "),n+=!r&&h[i]?i:i+'="'+(e.decodeEntities?p.encodeXML(r):r)+'"';returnn}}functioni(t,e){"svg"===t.name&&(e={decodeEntities:e.decodeEntities,xmlMode:!0});varr="<"+t.name,i=n(t.attribs,e);returni&&(r+=" "+i),!e.xmlMode||t.children&&0!==t.children.length?(r+=">",t.children&&(r+=d(t.children,e)),f[t.name]&&!e.xmlMode||(r+="</"+t.name+">")):r+="/>",r}functiono(t){return"<"+t.data+">"}functions(t,e){varr=t.data||"";return!e.decodeEntities||t.parent&&t.parent.nameinl||(r=p.encodeXML(r)),r}functiona(t){return"<![CDATA["+t.children[0].data+"]]>"}functionu(t){return"<!--"+t.data+"-->"}varc=r(78),p=r(79),h={__proto__:null,allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,"default":!0,defer:!0,disabled:!0,hidden:!0,ismap:!0,loop:!0,multiple:!0,muted:!0,open:!0,readonly:!0,required:!0,reversed:!0,scoped:!0,seamless:!0,selected:!0,typemustmatch:!0},l={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0},f={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},d=t.exports=function(t,e){Array.isArray(t)||t.cheerio||(t=[t]),e=e||{};for(varr="",n=0;n<t.length;n++){varp=t[n];r+="root"===p.type?d(p.children,e):c.isTag(p)?i(p,e):p.type===c.Directive?o(p):p.type===c.Comment?u(p):p.type===c.CDATA?a(p):s(p,e)}returnr}},function(t,e){t.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",isTag:function(t){return"tag"===t.type||"script"===t.type||"style"===t.type}}},function(t,e,r){varn=r(80),i=r(81);e.decode=function(t,e){return(!e||e<=0?i.XML:i.HTML)(t)},e.decodeStrict=function(t,e){return(!e||e<=0?i.XML:i.HTMLStrict)(t)},e.encode=function(t,e){return(!e||e<=0?n.XML:n.HTML)(t)},e.encodeXML=n.XML,e.encodeHTML4=e.encodeHTML5=e.encodeHTML=n.HTML,e.decodeXML=e.decodeXMLStrict=i.XML,e.decodeHTML4=e.decodeHTML5=e.decodeHTML=i.HTML,e.decodeHTML4Strict=e.decodeHTML5Strict=e.decodeHTMLStrict=i.HTMLStrict,e.escape=n.escape},function(t,e,r){functionn(t){returnObject.keys(t).sort().reduce(function(e,r){returne[t[r]]="&"+r+";",e},{})}functioni(t){vare=[],r=[];returnObject.keys(t).forEach(function(t){1===t.length?e.push("\\"+t):r.push(t)}),r.unshift("["+e.join("")+"]"),newRegExp(r.join("|"),"g")}functiono(t){return"&#x"+t.charCodeAt(0).toString(16).toUpperC