scratch-vm/vm.min.js

13 lines
212 KiB
JavaScript
Raw Normal View History

2017-01-30 11:40:20 -05:00
!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){(function(e){t.exports=e.VirtualMachine=r(1)}).call(e,function(){return this}())},function(t,e,r){var n=r(103);t.exports=n},function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!i(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,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],e instanceof Error)throw e;var p=new Error('Uncaught, unspecified "error" event. ('+e+")");throw p.context=e,p}if(r=this._events[t],s(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),r.apply(this,a)}else if(o(r))for(a=Array.prototype.slice.call(arguments,1),c=r.slice(),i=c.length,u=0;u<i;u++)c[u].apply(this,a);return!0},r.prototype.addListener=function(t,e){var i;if(!n(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,i,s,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],s=r.length,i=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(a=s;a-- >0;)if(r[a]===e||r[a].listener&&r[a].listener===e){i=a;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],n(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,r){(function(t,n){function i(t,r){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidde
i.push([t,e,r])},o.get=function(){return i},o.empty=function(){i=[]},t.exports=o},function(t,e,r){var n=r(15),i=!1,o=new n;o.write=function(t,e,r){if("undefined"!=typeof window&&"undefined"!=typeof JSON&&JSON.stringify&&JSON.parse)try{i||(i=window.localStorage.minilog?JSON.parse(window.localStorage.minilog):[]),i.push([(new Date).toString(),t,e,r]),window.localStorage.minilog=JSON.stringify(i)}catch(n){}},t.exports=o},function(t,e,r){function n(t){this.url=t.url||"",this.cache=[],this.timer=null,this.interval=t.interval||3e4,this.enabled=!0,this.jQuery=window.jQuery,this.extras={}}var i=r(15),o=(new Date).valueOf().toString(36);i.mixin(n),n.prototype.write=function(t,e,r){this.timer||this.init(),this.cache.push([t,e].concat(r))},n.prototype.init=function(){if(this.enabled&&this.jQuery){var t=this;this.timer=setTimeout(function(){var e,r,n=[],i=t.url;if(0==t.cache.length)return t.init();for(e=0;e<t.cache.length;e++)try{JSON.stringify(t.cache[e]),n.push(t.cache[e])}catch(s){}t.jQuery.isEmptyObject(t.extras)?(r=JSON.stringify({logs:n}),i=t.url+"?client_id="+o):r=JSON.stringify(t.jQuery.extend({logs:n},t.extras)),t.jQuery.ajax(i,{type:"POST",cache:!1,processData:!1,data:r,contentType:"application/json",timeout:1e4}).success(function(e,r,n){e.interval&&(t.interval=Math.max(1e3,e.interval))}).error(function(){t.interval=3e4}).always(function(){t.init()}),t.cache=[]},this.interval)}},n.prototype.end=function(){},n.jQueryWait=function(t){return"undefined"!=typeof window&&(window.jQuery||window.$)?t(window.jQuery||window.$):void("undefined"!=typeof window&&setTimeout(function(){n.jQueryWait(t)},200))},t.exports=n},function(t,e,r){var n=r(26),i=r(27),o=r(79),s=function(){this._blocks={},this._scripts=[]};s.BRANCH_INPUT_PREFIX="SUBSTACK",s.prototype.getBlock=function(t){return this._blocks[t]},s.prototype.getScripts=function(){return this._scripts},s.prototype.getNextBlock=function(t){return"undefined"==typeof this._blocks[t]?null:this._blocks[t].next},s.prototype.getBranch=function(t,e){var r=this._blocks[t];if("undefined"==typeof r)return null;e||(e=1);var n=s.BRANCH_INPUT_PREFIX;return e>1&&(n+=e),n in r.inputs?r.inputs[n].block:null},s.prototype.getOpcode=function(t){return"undefined"==typeof this._blocks[t]?null:this._blocks[t].opcode},s.prototype.getFields=function(t){return"undefined"==typeof this._blocks[t]?null:this._blocks[t].fields},s.prototype.getInputs=function(t){if("undefined"==typeof this._blocks[t])return null;var e={};for(var r in this._blocks[t].inputs)r.substring(0,s.BRANCH_INPUT_PREFIX.length)!==s.BRANCH_INPUT_PREFIX&&(e[r]=this._blocks[t].inputs[r]);return e},s.prototype.getMutation=function(t){return"undefined"==typeof this._blocks[t]?null:this._blocks[t].mutation},s.prototype.getTopLevelScript=function(t){if("undefined"==typeof this._blocks[t])return null;for(var e=this._blocks[t];null!==e.parent;)e=this._blocks[e.parent];return e.id},s.prototype.getProcedureDefinition=function(t){for(var e in this._blocks){var r=this._blocks[e];if(("procedures_defnoreturn"===r.opcode||"procedures_defreturn"===r.opcode)&&r.mutation.proccode===t)return e}return null},s.prototype.getProcedureParamNames=function(t){for(var e in this._blocks){var r=this._blocks[e];if(("procedures_defnoreturn"===r.opcode||"procedures_defreturn"===r.opcode)&&r.mutation.proccode===t)return JSON.parse(r.mutation.argumentnames)}return null},s.prototype.blocklyListen=function(t,e){if("object"==typeof t&&"string"==typeof t.blockId){if("stackclick"===t.element)return void(e&&e.toggleScript(t.blockId));switch(t.type){case"create":for(var r=n(t),i=0;i<r.length;i++)this.createBlock(r[i]);break;case"change":this.changeBlock({id:t.blockId,element:t.element,name:t.name,value:t.newValue});break;case"move":this.moveBlock({id:t.blockId,oldParent:t.oldParentId,oldInput:t.oldInputName,newParent:t.newParentId,newInput:t.newInputName,newCoordinate:t.newCoordinate});break;case"delete":if(!this._blocks.hasOwnProperty(t.blockId)||this._blocks[t.blockId].shadow)return;e&&this._blocks[t.blockId].topLevel&&e.quietGlow(t.blockId),this.deleteBlock({id:t.blockId})}}},s.prot
CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"",dd:"",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:"",emsp14:"",emsp:"",ENG:"Ŋ",eng:"ŋ",ensp:"",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"",Escr:"",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth
}function a(t){if(t>=I)t=I;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}function u(t,e){return 0===e.length&&e.ended?0:e.objectMode?0===t?0:1:isNaN(t)||N.isNull(t)?e.flowing&&e.buffer.length?e.buffer[0].length:e.length:t<=0?0:(t>e.highWaterMark&&(e.highWaterMark=a(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function c(t,e){var r=null;return N.isBuffer(e)||N.isString(e)||N.isNullOrUndefined(e)||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function p(t,e){if(e.decoder&&!e.ended){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,h(t)}function h(t){var r=t._readableState;r.needReadable=!1,r.emittedReadable||(A("emitReadable",r.flowing),r.emittedReadable=!0,r.sync?e.nextTick(function(){l(t)}):l(t))}function l(t){A("emit readable"),t.emit("readable"),y(t)}function f(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(function(){d(t,r)}))}function d(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(A("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function g(t){return function(){var e=t._readableState;A("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&O.listenerCount(t,"data")&&(e.flowing=!0,y(t))}}function m(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick(function(){_(t,r)}))}function _(t,e){e.resumeScheduled=!1,t.emit("resume"),y(t),e.flowing&&!e.reading&&t.read(0)}function y(t){var e=t._readableState;if(A("flow",e.flowing),e.flowing)do var r=t.read();while(null!==r&&e.flowing)}function b(t,e){var r,n=e.buffer,i=e.length,o=!!e.decoder,s=!!e.objectMode;if(0===n.length)return null;if(0===i)r=null;else if(s)r=n.shift();else if(!t||t>=i)r=o?n.join(""):E.concat(n,i),n.length=0;else if(t<n[0].length){var a=n[0];r=a.slice(0,t),n[0]=a.slice(t)}else if(t===n[0].length)r=n.shift();else{r=o?"":new E(t);for(var u=0,c=0,p=n.length;c<p&&u<t;c++){var a=n[0],h=Math.min(t-u,a.length);o?r+=a.slice(0,h):a.copy(r,u,0,h),h<a.length?n[0]=a.slice(h):n.shift(),u+=h}}return r}function v(t){var r=t._readableState;if(r.length>0)throw new Error("endReadable called on non-empty stream");r.endEmitted||(r.ended=!0,e.nextTick(function(){r.endEmitted||0!==r.length||(r.endEmitted=!0,t.readable=!1,t.emit("end"))}))}function w(t,e){for(var r=0,n=t.length;r<n;r++)e(t[r],r)}function S(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}t.exports=i;var T=r(47),E=r(48).Buffer;i.ReadableState=n;var O=r(2).EventEmitter;O.listenerCount||(O.listenerCount=function(t,e){return t.listeners(e).length});var k=r(43),N=r(52);N.inherits=r(53);var x,A=r(54);A=A&&A.debuglog?A.debuglog("stream"):function(){},N.inherits(i,k),i.prototype.push=function(t,e){var r=this._readableState;return N.isString(t)&&!r.objectMode&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=new E(t,e),e="")),o(this,r,t,e,!1)},i.prototype.unshift=function(t){var e=this._readableState;return o(this,e,t,"",!0)},i.prototype.setEncoding=function(t){return x||(x=r(57).StringDecoder),this._readableState.decoder=new x(t),this._readableState.encoding=t,this};var I=8388608;i.prototype.read=function(t){A("read",t);var e=this._readableState,r=t;if((!N.isNumber(t)||t>0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return A("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?v(this):h(this),null;if(t=u(t,e),0===t&&e.ended)return 0===e.length&&v(this),null;var n=e.needReadable;A("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&(n=!0,A("length less than watermark",n)),(e.ended||e.reading)&&(n=!1,A("reading or ended",n)),n&&(A("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1),n&&!e.reading&&(t=u(r,e));var i;return i=t>0?b(t,e):null,N.isNull(i)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),r!==t&&e.ended&&0===e.length&&v(this),N.isNull(i)||this.emit("data",i),i},i.prototype._read=function(t){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(t,r){function
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
"use strict";function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function o(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,r){if(o()<r)throw new RangeError("Invalid typed array length");return t.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=t.prototype):(null===e&&(e=new t(r)),e.length=r),e}function t(e,r,n){if(!(t.TYPED_ARRAY_SUPPORT||this instanceof t))return new t(e,r,n);if("number"==typeof e){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return a(this,e,r,n)}function a(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?f(t,e,r,n):"string"==typeof e?h(t,e,r):d(t,e)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,e,r,n){return u(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}function p(e,r){if(u(r),e=s(e,r<0?0:0|g(r)),!t.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)e[n]=0;return e}function h(e,r,n){if("string"==typeof n&&""!==n||(n="utf8"),!t.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|_(r,n);e=s(e,i);var o=e.write(r,n);return o!==i&&(e=e.slice(0,o)),e}function l(t,e){var r=e.length<0?0:0|g(e.length);t=s(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function f(e,r,n,i){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return r=void 0===n&&void 0===i?new Uint8Array(r):void 0===i?new Uint8Array(r,n):new Uint8Array(r,n,i),t.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=t.prototype):e=l(e,r),e}function d(e,r){if(t.isBuffer(r)){var n=0|g(r.length);return e=s(e,n),0===e.length?e:(r.copy(e,0,0,n),e)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||K(r.length)?s(e,0):l(e,r);if("Buffer"===r.type&&$(r.data))return l(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function g(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function m(e){return+e!=e&&(e=0),t.alloc(+e)}function _(e,r){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(i)return Y(e).length;r=(""+r).toLowerCase(),i=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===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":return C(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(e,r,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(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}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=t.from(r,i)),t.isBuffer(r))return 0===r.length?-1:w(e,r,n,i,o);if("number"==ty
var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(t){var e=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){function n(t){return this instanceof n?void i.call(this,t):new n(t)}t.exports=n;var i=r(58),o=r(52);o.inherits=r(53),o.inherits(n,i),n.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){t.exports=r(56)},function(t,e,r){t.exports=r(55)},function(t,e,r){t.exports=r(58)},function(t,e,r){t.exports=r(59)},function(t,e){},function(t,e,r){function n(t){this._cbs=t||{}}t.exports=n;var i=r(28).EVENTS;Object.keys(i).forEach(function(t){if(0===i[t])t="on"+t,n.prototype[t]=function(){this._cbs[t]&&this._cbs[t]()};else if(1===i[t])t="on"+t,n.prototype[t]=function(e){this._cbs[t]&&this._cbs[t](e)};else{if(2!==i[t])throw Error("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){var n=t.exports;[r(67),r(73),r(74),r(75),r(76),r(77)].forEach(function(t){Object.keys(t).forEach(function(e){n[e]=t[e].bind(n)})})},function(t,e,r){function n(t,e){return t.children?t.children.map(function(t){return s(t,e)}).join(""):""}function i(t){return Array.isArray(t)?t.map(i).join(""):a(t)||t.type===o.CDATA?i(t.children):t.type===o.Text?t.data:""}var o=r(37),s=r(68),a=o.isTag;t.exports={getInnerHTML:n,getOuterHTML:s,getText:i}},function(t,e,r){function n(t,e){if(t){var r,n="";for(var i in t)r=t[i],n&&(n+=" "),n+=!r&&h[i]?i:i+'="'+(e.decodeEntities?p.encodeXML(r):r)+'"';return n}}function i(t,e){"svg"===t.name&&(e={decodeEntities:e.decodeEntities,xmlMode:!0});var r="<"+t.name,i=n(t.attribs,e);return i&&(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}function o(t){return"<"+t.data+">"}function s(t,e){var r=t.data||"";return!e.decodeEntities||t.parent&&t.parent.name in l||(r=p.encodeXML(r)),r}function a(t){return"<![CDATA["+t.children[0].data+"]]>"}function u(t){return"<!--"+t.data+"-->"}var c=r(69),p=r(70),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(var r="",n=0;n<t.length;n++){var p=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)}return r}},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){var n=r(71),i=r(72);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){function n(t){return Object.keys(t).sort().reduce(function(e,r){return e[t[r]]="&"+r+";",e},{})}function i(t){var e=[],r=[];return Object.keys(t).forEach(function(t){1===t.length?e.push("\\"+t):r.push(t)}),r.unshift("["+e.join("")+"]"),new RegExp(r.join("|"),"g")}functi
var r=i.toString(t.EFFECT).toLowerCase(),n=i.toNumber(t.VALUE);if(e.target.audioEffects.hasOwnProperty(r)){var o=n+e.target.audioEffects[r];e.target.setAudioEffect(r,o)}},o.prototype.clearEffects=function(t,e){e.target.audioPlayer.clearEffects()},o.prototype.setVolume=function(t,e){var r=i.toNumber(t.VOLUME);e.target.audioPlayer.setVolume(r)},o.prototype.changeVolume=function(t,e){var r=i.toNumber(t.VOLUME);e.target.audioPlayer.changeVolume(r)},o.prototype.getVolume=function(t,e){return e.target.audioPlayer.currentVolume},o.prototype.setTempo=function(t){var e=i.toNumber(t.TEMPO);this.runtime.audioEngine.setTempo(e)},o.prototype.changeTempo=function(t){var e=i.toNumber(t.TEMPO);this.runtime.audioEngine.changeTempo(e)},o.prototype.getTempo=function(){return this.runtime.audioEngine.currentTempo},o.prototype.soundsMenu=function(t){return t.SOUND_MENU},o.prototype.beatsMenu=function(t){return t.BEATS},o.prototype.effectsMenu=function(t){return t.EFFECT},t.exports=o},function(t,e,r){var n=r(82),i=function(t){this.runtime=t};i.prototype.getPrimitives=function(){return{sensing_touchingobject:this.touchingObject,sensing_touchingcolor:this.touchingColor,sensing_coloristouchingcolor:this.colorTouchingColor,sensing_distanceto:this.distanceTo,sensing_timer:this.getTimer,sensing_resettimer:this.resetTimer,sensing_of:this.getAttributeOf,sensing_mousex:this.getMouseX,sensing_mousey:this.getMouseY,sensing_mousedown:this.getMouseDown,sensing_keypressed:this.getKeyPressed,sensing_current:this.current,sensing_dayssince2000:this.daysSince2000}},i.prototype.touchingObject=function(t,e){var r=t.TOUCHINGOBJECTMENU;if("_mouse_"===r){var n=e.ioQuery("mouse","getX"),i=e.ioQuery("mouse","getY");return e.target.isTouchingPoint(n,i)}return"_edge_"===r?e.target.isTouchingEdge():e.target.isTouchingSprite(r)},i.prototype.touchingColor=function(t,e){var r=n.toRgbColorList(t.COLOR);return e.target.isTouchingColor(r)},i.prototype.colorTouchingColor=function(t,e){var r=n.toRgbColorList(t.COLOR),i=n.toRgbColorList(t.COLOR2);return e.target.colorIsTouchingColor(i,r)},i.prototype.distanceTo=function(t,e){if(e.target.isStage)return 1e4;var r=0,n=0;if("_mouse_"===t.DISTANCETOMENU)r=e.ioQuery("mouse","getX"),n=e.ioQuery("mouse","getY");else{var i=this.runtime.getSpriteTargetByName(t.DISTANCETOMENU);if(!i)return 1e4;r=i.x,n=i.y}var o=e.target.x-r,s=e.target.y-n;return Math.sqrt(o*o+s*s)},i.prototype.getTimer=function(t,e){return e.ioQuery("clock","projectTimer")},i.prototype.resetTimer=function(t,e){e.ioQuery("clock","resetProjectTimer")},i.prototype.getMouseX=function(t,e){return e.ioQuery("mouse","getX")},i.prototype.getMouseY=function(t,e){return e.ioQuery("mouse","getY")},i.prototype.getMouseDown=function(t,e){return e.ioQuery("mouse","getIsDown")},i.prototype.current=function(t){var e=n.toString(t.CURRENTMENU).toLowerCase(),r=new Date;switch(e){case"year":return r.getFullYear();case"month":return r.getMonth()+1;case"date":return r.getDate();case"dayofweek":return r.getDay()+1;case"hour":return r.getHours();case"minute":return r.getMinutes();case"second":return r.getSeconds()}return 0},i.prototype.getKeyPressed=function(t,e){return e.ioQuery("keyboard","getKeyIsDown",t.KEY_OPTION)},i.prototype.daysSince2000=function(){var t=864e5,e=new Date(2e3,0,1),r=new Date,n=r.getTimezoneOffset()-e.getTimezoneOffset(),i=r.valueOf()-e.valueOf();return i+=60*(r.getTimezoneOffset()-n)*1e3,i/t},i.prototype.getAttributeOf=function(t){var e;if(e="_stage_"===t.OBJECT?this.runtime.getTargetForStage():this.runtime.getSpriteTargetByName(t.OBJECT),e.isStage)switch(t.PROPERTY){case"background #":return e.currentCostume+1;case"backdrop #":return e.currentCostume+1;case"backdrop name":return e.sprite.costumes[e.currentCostume].name;case"volume":return}else switch(t.PROPERTY){case"x position":return e.x;case"y position":return e.y;case"direction":return e.direction;case"costume #":return e.currentCostume+1;case"costume name":return e.sprite.costumes[e.currentCostume].name;case"size":return e.size;case"volume":return}var r=t.PROPERTY;return e.variables.hasOwnProperty(r)?e.variables[r].
},mouseY:{opcode:"sensing_mousey",argMap:[]},soundLevel:{opcode:"sensing_loudness",argMap:[]},senseVideoMotion:{opcode:"sensing_videoon",argMap:[{type:"input",inputOp:"sensing_videoonmenuone",inputName:"VIDEOONMENU1"},{type:"input",inputOp:"sensing_videoonmenutwo",inputName:"VIDEOONMENU2"}]},setVideoState:{opcode:"sensing_videotoggle",argMap:[{type:"input",inputOp:"sensing_videotogglemenu",inputName:"VIDEOTOGGLEMENU"}]},setVideoTransparency:{opcode:"sensing_setvideotransparency",argMap:[{type:"input",inputOp:"math_number",inputName:"TRANSPARENCY"}]},timer:{opcode:"sensing_timer",argMap:[]},timerReset:{opcode:"sensing_resettimer",argMap:[]},"getAttribute:of:":{opcode:"sensing_of",argMap:[{type:"input",inputOp:"sensing_of_property_menu",inputName:"PROPERTY"},{type:"input",inputOp:"sensing_of_object_menu",inputName:"OBJECT"}]},timeAndDate:{opcode:"sensing_current",argMap:[{type:"input",inputOp:"sensing_currentmenu",inputName:"CURRENTMENU"}]},timestamp:{opcode:"sensing_dayssince2000",argMap:[]},getUserName:{opcode:"sensing_username",argMap:[]},"+":{opcode:"operator_add",argMap:[{type:"input",inputOp:"math_number",inputName:"NUM1"},{type:"input",inputOp:"math_number",inputName:"NUM2"}]},"-":{opcode:"operator_subtract",argMap:[{type:"input",inputOp:"math_number",inputName:"NUM1"},{type:"input",inputOp:"math_number",inputName:"NUM2"}]},"*":{opcode:"operator_multiply",argMap:[{type:"input",inputOp:"math_number",inputName:"NUM1"},{type:"input",inputOp:"math_number",inputName:"NUM2"}]},"/":{opcode:"operator_divide",argMap:[{type:"input",inputOp:"math_number",inputName:"NUM1"},{type:"input",inputOp:"math_number",inputName:"NUM2"}]},"randomFrom:to:":{opcode:"operator_random",argMap:[{type:"input",inputOp:"math_number",inputName:"FROM"},{type:"input",inputOp:"math_number",inputName:"TO"}]},"<":{opcode:"operator_lt",argMap:[{type:"input",inputOp:"text",inputName:"OPERAND1"},{type:"input",inputOp:"text",inputName:"OPERAND2"}]},"=":{opcode:"operator_equals",argMap:[{type:"input",inputOp:"text",inputName:"OPERAND1"},{type:"input",inputOp:"text",inputName:"OPERAND2"}]},">":{opcode:"operator_gt",argMap:[{type:"input",inputOp:"text",inputName:"OPERAND1"},{type:"input",inputOp:"text",inputName:"OPERAND2"}]},"&":{opcode:"operator_and",argMap:[{type:"input",inputName:"OPERAND1"},{type:"input",inputName:"OPERAND2"}]},"|":{opcode:"operator_or",argMap:[{type:"input",inputName:"OPERAND1"},{type:"input",inputName:"OPERAND2"}]},not:{opcode:"operator_not",argMap:[{type:"input",inputName:"OPERAND"}]},"concatenate:with:":{opcode:"operator_join",argMap:[{type:"input",inputOp:"text",inputName:"STRING1"},{type:"input",inputOp:"text",inputName:"STRING2"}]},"letter:of:":{opcode:"operator_letter_of",argMap:[{type:"input",inputOp:"math_whole_number",inputName:"LETTER"},{type:"input",inputOp:"text",inputName:"STRING"}]},"stringLength:":{opcode:"operator_length",argMap:[{type:"input",inputOp:"text",inputName:"STRING"}]},"%":{opcode:"operator_mod",argMap:[{type:"input",inputOp:"math_number",inputName:"NUM1"},{type:"input",inputOp:"math_number",inputName:"NUM2"}]},rounded:{opcode:"operator_round",argMap:[{type:"input",inputOp:"math_number",inputName:"NUM"}]},"computeFunction:of:":{opcode:"operator_mathop",argMap:[{type:"input",inputOp:"operator_mathop_menu",inputName:"OPERATOR"},{type:"input",inputOp:"math_number",inputName:"NUM"}]},readVariable:{opcode:"data_variable",argMap:[{type:"input",inputOp:"data_variablemenu",inputName:"VARIABLE"}]},"setVar:to:":{opcode:"data_setvariableto",argMap:[{type:"input",inputOp:"data_variablemenu",inputName:"VARIABLE"},{type:"input",inputOp:"text",inputName:"VALUE"}]},"changeVar:by:":{opcode:"data_changevariableby",argMap:[{type:"input",inputOp:"data_variablemenu",inputName:"VARIABLE"},{type:"input",inputOp:"math_number",inputName:"VALUE"}]},"showVariable:":{opcode:"data_showvariable",argMap:[{type:"input",inputOp:"data_variablemenu",inputName:"VARIABLE"}]},"hideVariable:":{opcode:"data_hidevariable",argMap:[{type:"input",inputOp:"data_variablemenu",inputName:"VARIABLE"}]},"contentsOfList:":{opcode:"data_list",argMap:[{type:"fi