EmulatorJS/data/emu-min.js

8 lines
644 KiB
JavaScript
Raw Normal View History

2022-03-16 02:10:39 +00:00
var EJS=function(e){t=!0;var t,n={};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=396)}([function(e,t,n){var o=n(2),r=n(20),a=n(13),i=n(14),s=n(21),c=function(e,t,n){var l,u,d,f,p=e&c.F,h=e&c.G,m=e&c.S,v=e&c.P,g=e&c.B,b=h?o:m?o[t]||(o[t]={}):(o[t]||{}).prototype,y=h?r:r[t]||(r[t]={}),w=y.prototype||(y.prototype={});for(l in h&&(n=t),n)d=((u=!p&&b&&void 0!==b[l])?b:n)[l],f=g&&u?s(d,o):v&&"function"==typeof d?s(Function.call,d):d,b&&i(b,l,d,e&c.U),y[l]!=d&&a(y,l,f),v&&w[l]!=d&&(w[l]=d)};o.core=r,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var o=n(4);e.exports=function(e){if(!o(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var o=n(58)("wks"),r=n(36),a=n(2).Symbol,i="function"==typeof a;(e.exports=function(e){return o[e]||(o[e]=i&&a[e]||(i?a:r)("Symbol."+e))}).store=o},function(e,t,n){!function(e){"use strict";var t=function(){},n={getType:function(){return"null"},isSupported:function(){return!1},update:t},o=function(e){var n=this,o=window;this.update=t,this.requestAnimationFrame=e||o.requestAnimationFrame||o.webkitRequestAnimationFrame||o.mozRequestAnimationFrame,this.tickFunction=function(){n.update(),n.startTicker()},this.startTicker=function(){n.requestAnimationFrame.apply(o,[n.tickFunction])}};o.prototype.start=function(e){this.update=e||t,this.startTicker()};var r=function(){};r.prototype.update=t,r.prototype.start=function(e){this.update=e||t};var a=function(e,t){this.listener=e,this.gamepadGetter=t,this.knownGamepads=[]};a.factory=function(e){var t=n,o=window&&window.navigator;return o&&(void 0!==o.getGamepads?t=new a(e,(function(){return o.getGamepads()})):void 0!==o.webkitGamepads?t=new a(e,(function(){return o.webkitGamepads()})):void 0!==o.webkitGetGamepads&&(t=new a(e,(function(){return o.webkitGetGamepads()})))),t},a.getType=function(){return"WebKit"},a.prototype.getType=function(){return a.getType()},a.prototype.isSupported=function(){return!0},a.prototype.update=function(){var e,t,n=Array.prototype.slice.call(this.gamepadGetter(),0);for(t=this.knownGamepads.length-1;t>=0;t--)e=this.knownGamepads[t],n.indexOf(e)<0&&(this.knownGamepads.splice(t,1),this.listener._disconnect(e));for(t=0;t<n.length;t++)(e=n[t])&&this.knownGamepads.indexOf(e)<0&&(this.knownGamepads.push(e),this.listener._connect(e))};var i=function(e){this.listener=e,window.addEventListener("gamepadconnected",(function(t){e._connect(t.gamepad)})),window.addEventListener("gamepaddisconnected",(function(t){e._disconnect(t.gamepad)}))};i.factory=function(e){var t=n;return window&&void 0!==window.addEventListener&&(t=new i(e)),t},i.getType=function(){return"Firefox"},i.prototype.getType=function(){return i.getType()},i.prototype.isSupported=function(){return-1!==(window&&window.navigator).userAgent.indexOf("Firefox")},i.prototype.update=t;var s=function(e){this.updateStrategy=e||new o,this.gamepads=[],this.listener
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var o=n(370),r=n(371),a=n(372);function i(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return l(this,e,t,n)}function l(e,t,n,o){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,o){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(o||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===o?new Uint8Array(t):void 0===o?new Uint8Array(t,n):new Uint8Array(t,n,o),c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=f(e,t),e}(e,t,n,o):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var o=0|h(t,n),r=(e=s(e,o)).write(t,n);return r!==o&&(e=e.slice(0,r)),e}(e,t,n):function(e,t){if(c.isBuffer(t)){var n=0|p(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(o=t.length)!=o?s(e,0):f(e,t);if("Buffer"===t.type&&a(t.data))return f(e,t.data)}var o;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(u(t),e=s(e,t<0?0:0|p(t)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|p(t.length);e=s(e,n);for(var o=0;o<n;o+=1)e[o]=255&t[o];return e}function p(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function h(e,t){if(c.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 o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return L(e).length;default:if(o)return N(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,n){var r,a,i,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return x(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return r=this,i=n,0===(a=t)&&i===r.length?o.fromByteArray(r):o.fromByteArray(r.slice(a,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,n);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function v(e,t,n){var o=e[t];e[t]=e[n],e[n]=o}function g(e,t,n,o,r){if(0===e.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=c.from(t,o)),c.isBuffer(t))return 0===t.length?-1:b(e,t,n,o,r);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,o,r);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,o,r){var a,i=1