diff --git a/public/js/fengari-web.js b/public/js/fengari-web.js new file mode 100644 index 000000000..8d83e5059 --- /dev/null +++ b/public/js/fengari-web.js @@ -0,0 +1,8 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.fengari=t():e.fengari=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=34)}([function(e,t,r){"use strict"; +/** +@license MIT + +Copyright © 2017-2018 Benoit Giannangeli +Copyright © 2017-2018 Daurnimator +Copyright © 1994–2017 Lua.org, PUC-Rio. +*/var n=r(5);e.exports.FENGARI_AUTHORS=n.FENGARI_AUTHORS,e.exports.FENGARI_COPYRIGHT=n.FENGARI_COPYRIGHT,e.exports.FENGARI_RELEASE=n.FENGARI_RELEASE,e.exports.FENGARI_VERSION=n.FENGARI_VERSION,e.exports.FENGARI_VERSION_MAJOR=n.FENGARI_VERSION_MAJOR,e.exports.FENGARI_VERSION_MINOR=n.FENGARI_VERSION_MINOR,e.exports.FENGARI_VERSION_NUM=n.FENGARI_VERSION_NUM,e.exports.FENGARI_VERSION_RELEASE=n.FENGARI_VERSION_RELEASE,e.exports.luastring_eq=n.luastring_eq,e.exports.luastring_indexOf=n.luastring_indexOf,e.exports.luastring_of=n.luastring_of,e.exports.to_jsstring=n.to_jsstring,e.exports.to_luastring=n.to_luastring,e.exports.to_uristring=n.to_uristring;var a=r(3),u=r(2),s=r(7),o=r(17);e.exports.luaconf=a,e.exports.lua=u,e.exports.lauxlib=s,e.exports.lualib=o},function(e,t,r){"use strict";function n(e,t){for(var r=0;rt;)n[t]=e[t++];return n},"function"==typeof(new Uint8Array).indexOf)s=function(e,t,r){return e.indexOf(t,r)};else{var l=[].indexOf;if(0!==l.call(new Uint8Array(1),0))throw Error("missing .indexOf");s=function(e,t,r){return l.call(e,t,r)}}o="function"==typeof Uint8Array.of?Uint8Array.of.bind(Uint8Array):function(){return u(arguments)};var i=function(e){return e instanceof Uint8Array},c="cannot convert invalid utf8 to javascript string",f=";,/?:@&=+$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,-_.!~*'()#".split("").reduce((function(e,t){return e[t.charCodeAt(0)]=!0,e}),{}),_={},p=function(e,t){if("string"!=typeof e)throw new TypeError("to_luastring expects a javascript string");if(t){var r=_[e];if(i(r))return r}for(var n=e.length,a=Array(n),s=0,o=0;o>6,a[s++]=128|63&l;else{if(l>=55296&&l<=56319&&o+1=56320&&c<=57343&&(o++,l=1024*(l-55296)+c+9216)}l<=65535?(a[s++]=224|l>>12,a[s++]=128|l>>6&63,a[s++]=128|63&l):(a[s++]=240|l>>18,a[s++]=128|l>>12&63,a[s++]=128|l>>6&63,a[s++]=128|63&l)}}return a=u(a),t&&(_[e]=a),a};e.exports.luastring_from=u,e.exports.luastring_indexOf=s,e.exports.luastring_of=o,e.exports.is_luastring=i,e.exports.luastring_eq=function(e,t){if(e!==t){var r=e.length;if(r!==t.length)return!1;for(var n=0;n244){if(!n)throw RangeError(c);a+="�"}else if(s<=223){if(u>=r){if(!n)throw RangeError(c);a+="�";continue}var o=e[u++];if(128!=(192&o)){if(!n)throw RangeError(c);a+="�";continue}a+=String.fromCharCode(((31&s)<<6)+(63&o))}else if(s<=239){if(u+1>=r){if(!n)throw RangeError(c);a+="�";continue}var l=e[u++];if(128!=(192&l)){if(!n)throw RangeError(c);a+="�";continue}var f=e[u++];if(128!=(192&f)){if(!n)throw RangeError(c);a+="�";continue}var _=((15&s)<<12)+((63&l)<<6)+(63&f);if(_<=65535)a+=String.fromCharCode(_);else{var p=55296+((_-=65536)>>10),v=_%1024+56320;a+=String.fromCharCode(p,v)}}else{if(u+2>=r){if(!n)throw RangeError(c);a+="�";continue}var h=e[u++];if(128!=(192&h)){if(!n)throw RangeError(c);a+="�";continue}var d=e[u++];if(128!=(192&d)){if(!n)throw RangeError(c);a+="�";continue}var L=e[u++];if(128!=(192&L)){if(!n)throw RangeError(c);a+="�";continue}var A=((7&s)<<18)+((63&h)<<12)+((63&d)<<6)+(63&L),g=55296+((A-=65536)>>10),b=A%1024+56320;a+=String.fromCharCode(g,b)}}return a},e.exports.to_uristring=function(e){if(!i(e))throw new TypeError("to_uristring expects a Uint8Array");for(var t="",r=0;r>>20&2047;0===r&&(t.setFloat64(0,e*Math.pow(2,64)),r=(t.getUint32(0)>>>20&2047)-64);var n=r-1022;return[A(e,-n),n]},e.exports.ldexp=A,e.exports.lua_getlocaledecpoint=function(){return 46},e.exports.lua_integer2str=function(e){return String(e)},e.exports.lua_number2str=function(e){return String(Number(e.toPrecision(14)))},e.exports.lua_numbertointeger=function(e){return e>=-2147483648&&e<2147483648&&e},e.exports.luai_apicheck=function(e,t){if(!t)throw Error(t)}},function(e,t,r){"use strict";var n=r(3).luai_apicheck,a=function(e){if(!e)throw Error("assertion failed")};e.exports.lua_assert=a,e.exports.luai_apicheck=n||function(e,t){return a(t)};e.exports.api_check=function(e,t,r){return n(e,t&&r)};e.exports.LUAI_MAXCCALLS=200;e.exports.LUA_MINBUFFER=32;e.exports.luai_nummod=function(e,t,r){var n=t%r;return n*r<0&&(n+=r),n};e.exports.MAX_INT=2147483647;e.exports.MIN_INT=-2147483648},function(e,t,r){var n=r(1),a="Fengari 0.1.4 Copyright (C) 2017-2018 B. Giannangeli, Daurnimator\nBased on: "+n.LUA_COPYRIGHT;e.exports.FENGARI_AUTHORS="B. Giannangeli, Daurnimator",e.exports.FENGARI_COPYRIGHT=a,e.exports.FENGARI_RELEASE="Fengari 0.1.4",e.exports.FENGARI_VERSION="Fengari 0.1",e.exports.FENGARI_VERSION_MAJOR="0",e.exports.FENGARI_VERSION_MINOR="1",e.exports.FENGARI_VERSION_NUM=1,e.exports.FENGARI_VERSION_RELEASE="4",e.exports.is_luastring=n.is_luastring,e.exports.luastring_eq=n.luastring_eq,e.exports.luastring_from=n.luastring_from,e.exports.luastring_indexOf=n.luastring_indexOf,e.exports.luastring_of=n.luastring_of,e.exports.to_jsstring=n.to_jsstring,e.exports.to_luastring=n.to_luastring,e.exports.to_uristring=n.to_uristring,e.exports.from_userstring=n.from_userstring},function(e,t,r){"use strict";var n;function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r>=6,n>>=1}while(t>n);e[8-r]=~n<<1|t}return r},Re=function(e,t){var r="x"===t?function(e){for(var t,r=0,n=0,a=0,u=0,s=0,o=!1;q(e[r]);)r++;if(((t=45===e[r])||43===e[r])&&r++,48!==e[r]||120!==e[r+1]&&88!==e[r+1])return null;for(r+=2;;r++)if(46===e[r]){if(o)break;o=!0}else{if(!W(e[r]))break;0===a&&48===e[r]?u++:++a<=30?n=16*n+ye(e[r]):s++,o&&s--}if(u+a===0)return null;if(s*=4,112===e[r]||80===e[r]){var l,i=0;if(((l=45===e[++r])||43===e[r])&&r++,!J(e[r]))return null;for(;J(e[r]);)i=10*i+e[r++]-48;l&&(i=-i),s+=i}return t&&(n=-n),{n:oe(n,s),i:r}}(e):function(e){try{e=X(e)}catch(e){return null}var t=/^[\t\v\f \n\r]*[+-]?(?:[0-9]+\.?[0-9]*|\.[0-9]*)(?:[eE][+-]?[0-9]+)?/.exec(e);if(!t)return null;var r=parseFloat(t[0]);return isNaN(r)?null:{n:r,i:t[0].length}}(e);if(null===r)return null;for(;q(e[r.i]);)r.i++;return r.i===e.length||0===e[r.i]?r:null},we=[46,120,88,110,78],Se=(u(n={},46,"."),u(n,120,"x"),u(n,88,"x"),u(n,110,"n"),u(n,78,"n"),n),Ie=Math.floor(_e/10),Me=_e%10,Pe=function(e,t){var r;if(t.ttisinteger())r=z(le(t.value));else{var n=ie(t.value);!se&&/^[-0123456789]+$/.test(n)&&(n+=".0"),r=z(n)}t.setsvalue(re(e,r))},Ce=function(e,t){$.luaD_inctop(e),ge(e,e.top-1,ne(e,t))},De=function(e,t,r){for(var n,u=0,s=0,o=0;-1!=(n=j(t,37,s));){switch(Ce(e,t.subarray(s,n)),t[n+1]){case 115:var l=r[o++];if(null===l)l=z("(null)",!0);else{l=F(l);var i=j(l,0);-1!==i&&(l=l.subarray(0,i))}Ce(e,l);break;case 99:var c=r[o++];Z(c)?Ce(e,H(c)):Ve(e,z("<\\%d>",!0),c);break;case 100:case 73:$.luaD_inctop(e),e.stack[e.top-1].setivalue(r[o++]),Pe(e,e.stack[e.top-1]);break;case 102:$.luaD_inctop(e),e.stack[e.top-1].setfltvalue(r[o++]),Pe(e,e.stack[e.top-1]);break;case 112:var f=r[o++];if(f instanceof ee.lua_State||f instanceof ae.Table||f instanceof ke||f instanceof Te||f instanceof xe)Ce(e,z("0x"+f.id.toString(16)));else switch(a(f)){case"undefined":Ce(e,z("undefined"));break;case"number":Ce(e,z("Number("+f+")"));break;case"string":Ce(e,z("String("+JSON.stringify(f)+")"));break;case"boolean":Ce(e,z(f?"Boolean(true)":"Boolean(false)"));break;case"object":if(null===f){Ce(e,z("null"));break}case"function":var _=e.l_G.ids.get(f);_||(_=e.l_G.id_counter++,e.l_G.ids.set(f,_)),Ce(e,z("0x"+_.toString(16)));break;default:Ce(e,z(""))}break;case 85:var p=new Uint8Array(8),v=Ne(p,r[o++]);Ce(e,p.subarray(8-v));break;case 37:Ce(e,z("%",!0));break;default:Q.luaG_runerror(e,z("invalid option '%%%c' to 'lua_pushfstring'"),t[n+1])}u+=2,s=n+2}return $.luaD_checkstack(e,1),Ce(e,t.subarray(s)),u>0&&ce.luaV_concat(e,u+1),e.stack[e.top-1].svalue()},Ve=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;at&&(n=t),r.set(e.subarray(0,n),u),u+=n,r.set(Ee,u),u+=Ee.length),r.set(Ue,u),u+=Ue.length,r=r.subarray(0,u)}return r},e.exports.luaO_hexavalue=ye,e.exports.luaO_int2fb=function(e){var t=0;if(e<8)return e;for(;e>=128;)e=e+15>>4,t+=4;for(;e>=16;)e=e+1>>1,t++;return t+1<<3|e-8},e.exports.luaO_pushfstring=Ve,e.exports.luaO_pushvfstring=De,e.exports.luaO_str2num=function(e,t){var r=function(e){for(var t,r=0,n=0,a=!0;q(e[r]);)r++;if(((t=45===e[r])||43===e[r])&&r++,48!==e[r]||120!==e[r+1]&&88!==e[r+1])for(;r=Ie&&(n>Ie||u>Me+t))return null;n=10*n+u|0,a=!1}else for(r+=2;r"),t.short_src,t.linedefined):ee(e,"?")},He=function(e){var t="PANIC: unprotected error in call to Lua API ("+ge(e,-1)+")";throw new Error(t)},Xe=function(e,t,r){var n=new x;return M(e,0,n)?(S(e,Se("n"),n),we(n.namewhat,Se("method"))&&0===--t?Je(e,Se("calling '%s' on bad self (%s)"),n.name,r):(null===n.name&&(n.name=Fe(e,n)?Oe(e,-1):Se("?")),Je(e,Se("bad argument #%d to '%s' (%s)"),t,n.name,r))):Je(e,Se("bad argument #%d (%s)"),t,r)},ze=function(e,t,r){var n;n=Lt(e,t,Ve)===g?Oe(e,-1):me(e,t)===h?Se("light userdata",!0):$e(e,t);var a=Q(e,Se("%s expected, got %s"),r,n);return Xe(e,t,a)},Ye=function(e,t){var r=new x;M(e,t,r)&&(S(e,Se("Sl",!0),r),r.currentline>0)?Q(e,Se("%s:%d: "),r.short_src,r.currentline):ne(e,Se(""))},Je=function(e,t){Ye(e,1);for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a0&&(t=Re(t),st(e,r).set(t.subarray(0,r)),ft(e,r))},it=function(e,t){t=Re(t),lt(e,t,t.length)},ct=function(e){te(e.L,e.b,e.n),e.n=0,e.b=Ge},ft=function(e,t){e.n+=t},_t=function(e,t,r,n){return me(e,r)<=0?n:t(e,r)},pt=function(e,t){var r=t.string;return t.string=null,r},vt=function(e,t,r,n,a){return j(e,pt,{string:t},n,a)},ht=function(e,t,r,n){return vt(e,t,0,n,null)},dt=function(e,t){return ht(e,t,t.length,t)},Lt=function(e,t,r){if(I(e,t)){ne(e,r);var n=oe(e,-2);return n===d?J(e,2):fe(e,-2),n}return d},At=function(e,t,r){return t=k(e,t),Lt(e,t,r)!==d&&(ae(e,t),E(e,1,1),!0)},gt=Se("%I"),bt=Se("%f"),Tt=function(e,t,r){var n=r>>>0,a=t.length,u=e.length+1-a;e:for(;n0){var n=r.n;return r.n=0,r.f=r.f.subarray(r.pos),r.buff.subarray(0,n)}var a=r.f;return r.f=null,a};s=function(e){return e.pos=200&&s.status<=299))return n.err=s.status,Et(e,"open",a,{message:"".concat(s.status,": ").concat(s.statusText)});"string"==typeof s.response?n.f=Se(s.response):n.f=new Uint8Array(s.response);var o=Ut(n);o.c===p[0]&&t||o.skipped&&(n.buff[n.n++]=10),null!==o.c&&(n.buff[n.n++]=o.c);var l=j(e,Nt,n,Oe(e,-1),r),i=n.err;return i?(he(e,a),Et(e,"read",a,i)):(fe(e,a),l)};var Rt=function(e,t){return o(e,t,null)},wt=function(e,t,r){var n=ye(e);72!=r&&Je(e,Se("core and library have incompatible numeric types")),n!=ye(null)?Je(e,Se("multiple Lua VMs detected")):n!==t&&Je(e,Se("version mismatch: app. needs %f, Lua core provides %f"),t,n)};e.exports.LUA_ERRFILE=Me,e.exports.LUA_FILEHANDLE=De,e.exports.LUA_LOADED_TABLE=Pe,e.exports.LUA_NOREF=-2,e.exports.LUA_PRELOAD_TABLE=Ce,e.exports.LUA_REFNIL=-1,e.exports.luaL_Buffer=Ke,e.exports.luaL_addchar=function(e,t){st(e,1),e.b[e.n++]=t},e.exports.luaL_addlstring=lt,e.exports.luaL_addsize=ft,e.exports.luaL_addstring=it,e.exports.luaL_addvalue=function(e){var t=e.L,r=Oe(t,-1);lt(e,r,r.length),J(t,1)},e.exports.luaL_argcheck=function(e,t,r,n){t||Xe(e,r,n)},e.exports.luaL_argerror=Xe,e.exports.luaL_buffinit=ot,e.exports.luaL_buffinitsize=function(e,t,r){return ot(e,t),st(t,r)},e.exports.luaL_callmeta=At,e.exports.luaL_checkany=function(e,t){me(e,t)===L&&Xe(e,t,Se("value expected",!0))},e.exports.luaL_checkinteger=ut,e.exports.luaL_checklstring=et,e.exports.luaL_checknumber=at,e.exports.luaL_checkoption=function(e,t,r,n){for(var a=null!==r?nt(e,t,r):tt(e,t),u=0;n[u];u++)if(we(n[u],a))return u;return Xe(e,t,Q(e,Se("invalid option '%s'"),a))},e.exports.luaL_checkstack=Ot,e.exports.luaL_checkstring=tt,e.exports.luaL_checktype=function(e,t,r){me(e,t)!==r&&Qe(e,t,r)},e.exports.luaL_checkudata=function(e,t,r){var n=We(e,t,r);return null===n&&ze(e,t,r),n},e.exports.luaL_checkversion=function(e){wt(e,T,72)},e.exports.luaL_checkversion_=wt,e.exports.luaL_dofile=function(e,t){return Rt(e,t)||Y(e,0,f,0)},e.exports.luaL_dostring=function(e,t){return dt(e,t)||Y(e,0,f,0)},e.exports.luaL_error=Je,e.exports.luaL_execresult=function(e,t){var r,n;if(null===t)return Z(e,1),ee(e,"exit"),$(e,0),3;if(t.status)r="exit",n=t.status;else{if(!t.signal)return Ze(e,0,null,t);r="signal",n=t.signal}return re(e),ee(e,r),$(e,n),3},e.exports.luaL_fileresult=Ze,e.exports.luaL_getmetafield=Lt,e.exports.luaL_getmetatable=qe,e.exports.luaL_getsubtable=xt,e.exports.luaL_gsub=function(e,t,r,n){var a,u=new Ke;for(ot(e,u);(a=Tt(t,r))>=0;)lt(u,t,a),it(u,n),t=t.subarray(a+r.length);return it(u,t),ct(u),Oe(e,-1)},e.exports.luaL_len=function(e,t){F(e,t);var r=Ae(e,-1);return!1===r&&Je(e,Se("object length is not an integer",!0)),J(e,1),r},e.exports.luaL_loadbuffer=ht,e.exports.luaL_loadbufferx=vt,e.exports.luaL_loadfile=Rt,e.exports.luaL_loadfilex=o,e.exports.luaL_loadstring=dt,e.exports.luaL_newlib=function(e,t){N(e),kt(e,t,0)},e.exports.luaL_newlibtable=function(e){N(e)},e.exports.luaL_newmetatable=function(e,t){return qe(e,t)!==d?0:(J(e,1),N(e,0,2),ne(e,t),_e(e,-2,Ve),ae(e,-1),_e(e,_,t),1)},e.exports.luaL_newstate=function(){var e=H();return e&&O(e,He),e},e.exports.luaL_opt=_t,e.exports.luaL_optinteger=function(e,t,r){return _t(e,ut,t,r)},e.exports.luaL_optlstring=rt,e.exports.luaL_optnumber=function(e,t,r){return _t(e,at,t,r)},e.exports.luaL_optstring=nt,e.exports.luaL_prepbuffer=function(e){return st(e,l)},e.exports.luaL_prepbuffsize=st,e.exports.luaL_pushresult=ct,e.exports.luaL_pushresultsize=function(e,t){ft(e,t),ct(e)},e.exports.luaL_ref=function(e,t){var r;return V(e,-1)?(J(e,1),-1):(t=k(e,t),le(e,t,0),r=Le(e,-1),J(e,1),0!==r?(le(e,t,r),ce(e,t,0)):r=ie(e,t)+1,ce(e,t,r),r)},e.exports.luaL_requiref=function(e,t,r,n){xt(e,_,Pe),w(e,-1,t),de(e,-1)||(J(e,1),W(e,r),ne(e,t),E(e,1,1),ae(e,-1),_e(e,-3,t)),fe(e,-2),n&&(ae(e,-1),pe(e,t))},e.exports.luaL_setfuncs=kt,e.exports.luaL_setmetatable=function(e,t){qe(e,t),ve(e,-2)},e.exports.luaL_testudata=We,e.exports.luaL_tolstring=function(e,t){if(At(e,t,Be))G(e,-1)||Je(e,Se("'__tostring' must return a string"));else switch(me(e,t)){case A:D(e,t)?Q(e,gt,Le(e,t)):Q(e,bt,Te(e,t));break;case g:ae(e,t);break;case v:ee(e,de(e,t)?"true":"false");break;case d:ee(e,"nil");break;default:var r=Lt(e,t,Ve),n=r===g?Oe(e,-1):$e(e,t);Q(e,Se("%s: %p"),n,ke(e,t)),r!==d&&fe(e,-2)}return be(e,-1)},e.exports.luaL_traceback=function(e,t,r,n){var a=new x,u=P(e),s=function(e){for(var t=new x,r=1,n=1;M(e,n,t);)r=n,n*=2;for(;r21?10:-1;for(r&&Q(e,Se("%s\n"),r),Ot(e,10,null),ee(e,"stack traceback:");M(t,n++,a);)0==o--?(ee(e,"\n\t..."),n=s-11+1):(S(t,Se("Slnt",!0),a),Q(e,Se("\n\t%s:"),a.short_src),a.currentline>0&&ee(e,"".concat(a.currentline,":")),ee(e," in "),je(e,a),a.istailcall&&ee(e,"\n\t(...tail calls..)"),U(e,P(e)-u));U(e,P(e)-u)},e.exports.luaL_typename=$e,e.exports.luaL_unref=function(e,t,r){r>=0&&(t=k(e,t),le(e,t,0),ce(e,t,r),$(e,r),ce(e,t,0))},e.exports.luaL_where=Ye,e.exports.lua_writestringerror=function(){for(var e=0;et;)delete e.stack[--e.top]},J=function(e,t,r){for(var n=e.top;e.topr+1;)delete e.stack[--e.top]},Z=j+200,q=function(e,t){P(t<=j||t==Z),P(e.stack_last==e.stack.length-G.EXTRA_STACK),e.stack.length=t,e.stack_last=t-G.EXTRA_STACK},W=function(e,t){var r=e.stack.length;if(r>j)le(e,x);else{var n=e.top+t+G.EXTRA_STACK,a=2*r;a>j&&(a=j),aj?(q(e,Z),w.luaG_runerror(e,N("stack overflow",!0))):q(e,a)}},Q=function(e,t){e.stack_last-e.top<=t&&W(e,t)},$=function(e){var t=function(e){for(var t=e.top,r=e.ci;null!==r;r=r.previous)tj&&(r=j),e.stack.length>j&&G.luaE_freeCI(e),t<=j-G.EXTRA_STACK&&r=r+n;s--)delete e.stack[s];return e.top=r+n,!1;default:var o;if(a<=n)for(o=0;o=e.top?e.stack[r+o]=new D.TValue(g,null):e.stack[r+o].setnilvalue()}}for(var l=r+a,i=e.top;i>=l;i--)delete e.stack[i];return e.top=l,!0},ne=function(e,t,r){var n=e.hook;if(n&&e.allowhook){var a=e.ci,u=e.top,s=a.top,o=new U;o.event=t,o.currentline=r,o.i_ci=a,Q(e,_),a.top=e.top+_,P(a.top<=e.stack_last),e.allowhook=0,a.callstatus|=G.CIST_HOOKED,n(e,o),P(!e.allowhook),e.allowhook=1,a.top=s,Y(e,u),a.callstatus&=~G.CIST_HOOKED}},ae=function(e,t){var r=s;t.l_savedpc++,t.previous.callstatus&G.CIST_LUA&&t.previous.l_code[t.previous.l_savedpc-1].opcode==V.OpCodesI.OP_TAILCALL&&(t.callstatus|=G.CIST_TAIL,r=l),ne(e,r,-1),t.l_savedpc--},ue=function(e,t,r){var n,a=t.numparams,u=e.top-r,s=e.top;for(n=0;nt;a--)D.setobjs2s(e,a,a-1);D.setobj2s(e,t,n)},oe=function(e,t,r){++e.nCcalls>=C&&function(e){e.nCcalls===C?w.luaG_runerror(e,N("JS stack overflow",!0)):e.nCcalls>=C+(C>>3)&&le(e,x)}(e),ee(e,t,r)||X.luaV_execute(e),e.nCcalls--},le=function e(t,r){if(t.errorJmp)throw t.errorJmp.status=r,t.errorJmp;var n=t.l_G;if(t.status=r,!n.mainthread.errorJmp){var a=n.panic;throw a&&(J(t,r,t.top),t.ci.top0&&(e!==e.l_G.mainthread?w.luaG_runerror(e,N("attempt to yield across a JS-call boundary",!0)):w.luaG_runerror(e,N("attempt to yield from outside a coroutine",!0))),e.status=m,a.extra=a.funcOff,a.callstatus&G.CIST_LUA?M(e,null===n,"hooks cannot continue after yielding"):(a.c_k=n,null!==n&&(a.c_ctx=r),a.funcOff=e.top-t-1,a.func=e.stack[a.funcOff],le(e,m)),P(a.callstatus&G.CIST_HOOKED),0},de=function(e,t,r,n,a){var u=e.ci,s=e.allowhook,o=e.nny,l=e.errfunc;e.errfunc=a;var i=ie(e,t,r);return i!==E&&(S.luaF_close(e,n),J(e,i,n),e.ci=u,e.allowhook=s,e.nny=o,$(e)),e.errfunc=l,i},Le=function(e,t,r){e.nny++,oe(e,t,r),e.nny--},Ae=a((function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.z=t,this.buff=new z,this.dyd=new B.Dyndata,this.mode=n,this.name=r})),ge=function(e,t,r){t&&-1===y(t,r[0])&&(D.luaO_pushfstring(e,N("attempt to load a %s chunk (mode is '%s')"),r,t),le(e,O))},be=function(e,t){var r,n=t.z.zgetc();n===v[0]?(ge(e,t.mode,N("binary",!0)),r=H.luaU_undump(e,t.z,t.name)):(ge(e,t.mode,N("text",!0)),r=B.luaY_parser(e,t.z,t.buff,t.dyd,t.name,n)),P(r.nupvalues===r.p.upvalues.length),S.luaF_initupvals(e,r)};e.exports.adjust_top=Y,e.exports.luaD_call=oe,e.exports.luaD_callnoyield=Le,e.exports.luaD_checkstack=Q,e.exports.luaD_growstack=W,e.exports.luaD_hook=ne,e.exports.luaD_inctop=function(e){Q(e,1),e.stack[e.top++]=new D.TValue(g,null)},e.exports.luaD_pcall=de,e.exports.luaD_poscall=te,e.exports.luaD_precall=ee,e.exports.luaD_protectedparser=function(e,t,r,n){var a=new Ae(t,r,n);e.nny++;var u=de(e,be,a,e.top,e.errfunc);return e.nny--,u},e.exports.luaD_rawrunprotected=ie,e.exports.luaD_reallocstack=q,e.exports.luaD_throw=le,e.exports.lua_isyieldable=function(e){return 0===e.nny},e.exports.lua_resume=function(e,t,r){var n=e.nny;if(e.status===E){if(e.ci!==e.base_ci)return pe(e,"cannot resume non-suspended coroutine",r)}else if(e.status!==m)return pe(e,"cannot resume dead coroutine",r);if(e.nCcalls=t?t.nCcalls+1:1,e.nCcalls>=C)return pe(e,"JS stack overflow",r);e.nny=0,R.api_checknelems(e,e.status===E?r+1:r);var a=ie(e,ve,r);if(-1===a)a=k;else{for(;a>m&&_e(e,a);)a=ie(e,fe,a);a>m?(e.status=a,J(e,a,e.top),e.ci.top=e.top):P(a===e.status)}return e.nny=n,e.nCcalls--,P(e.nCcalls===(t?t.nCcalls:0)),a},e.exports.lua_yield=function(e,t){he(e,t,0,null)},e.exports.lua_yieldk=he},function(e,t,r){"use strict";function n(e,t){for(var r=0;r1;){var n=Math.floor((t+r)/2);C(e,n).ttisnil()?r=n:t=n}return t},e.exports.luaH_getstr=function(e,t){return x(t instanceof U),P(e,m(t))},e.exports.luaH_setfrom=function(e,t,r,n){x(r instanceof O.TValue);var a=w(e,r);if(n.ttisnil())M(t,a);else{var u=t.strong.get(a);if(u)u.value.setfrom(n);else{var s,o=r.value;s=r.ttisfloat()&&(0|o)===o?new O.TValue(d,o):new O.TValue(r.type,o);var l=new O.TValue(n.type,n.value);I(t,a,s,l)}}},e.exports.luaH_setint=function(e,t,r){x("number"==typeof t&&(0|t)===t&&r instanceof O.TValue);var n=t;if(r.ttisnil())M(e,n);else{var a=e.strong.get(n);if(a){a.value.setfrom(r)}else{var u=new O.TValue(d,t),s=new O.TValue(r.type,r.value);I(e,n,u,s)}}},e.exports.luaH_new=function(e){return new S(e)},e.exports.luaH_next=function(e,t,r){var n,a=e.stack[r];if(a.type===v){if(!(n=t.f))return!1}else{var u=w(e,a);if(n=t.strong.get(u)){if(!(n=n.n))return!1}else{if(!(n=t.dead_weak&&t.dead_weak.get(u)||t.dead_strong.get(u)))return k.luaG_runerror(e,T("invalid key to 'next'"));do{if(!(n=n.n))return!1}while(n.key.ttisdeadkey())}}return O.setobj2s(e,r,n.key),O.setobj2s(e,r+1,n.value),!0},e.exports.Table=S},function(e,t,r){"use strict";function n(e,t){for(var r=0;r=e.l_base-e.funcOff-r?null:{pos:e.funcOff+r+t,name:A("(*vararg)",!0)}}(t,-r);n=t.l_base,a=E.luaF_getlocalname(t.func.value.p,r,I(t))}else n=t.funcOff+1;if(null===a){if(!((t===e.ci?e.top:t.next.funcOff)-n>=r&&r>0))return null;a=A("(*temporary)",!0)}return{pos:n+(r-1),name:a}},V=function(e,t){if(null===t||t instanceof U.CClosure)e.source=A("=[JS]",!0),e.linedefined=-1,e.lastlinedefined=-1,e.what=A("J",!0);else{var r=t.p;e.source=r.source?r.source.getstr():A("=?",!0),e.linedefined=r.linedefined,e.lastlinedefined=r.lastlinedefined,e.what=0===e.linedefined?A("main",!0):A("Lua",!0)}e.short_src=U.luaO_chunkid(e.source,x)},B=function(e,t){var r={name:null,funcname:null};return null===t?null:t.callstatus&N.CIST_FIN?(r.name=A("__gc",!0),r.funcname=A("metamethod",!0),r):!(t.callstatus&N.CIST_TAIL)&&t.previous.callstatus&N.CIST_LUA?j(e,t.previous):null},G=function(e,t,r){var n={name:null,funcname:null};if(y.ISK(r)){var a=e.k[y.INDEXK(r)];if(a.ttisstring())return n.name=a.svalue(),n}else{var u=F(e,t,r);if(u&&99===u.funcname[0])return u}return n.name=A("?",!0),n},K=function(e,t){return e=l+2&&(n=K(s,a));break;case u.OP_CALL:case u.OP_TAILCALL:r>=l&&(n=K(s,a));break;case u.OP_JMP:var c=s+1+o.sBx;sa&&(a=c);break;default:y.testAMode(o.opcode)&&r===l&&(n=K(s,a))}}return n}(t,r,n),s=y.OpCodesI;if(-1!==u){var o=t.code[u];switch(o.opcode){case s.OP_MOVE:var l=o.B;if(l2?n-2:0),u=2;u0;t=t.subarray(1))switch(t[0]){case 83:V(r,n);break;case 108:r.currentline=a&&a.callstatus&N.CIST_LUA?M(a):-1;break;case 117:r.nups=null===n?0:n.nupvalues,null===n||n instanceof U.CClosure?(r.isvararg=!0,r.nparams=0):(r.isvararg=n.p.is_vararg,r.nparams=n.p.numparams);break;case 116:r.istailcall=a?a.callstatus&N.CIST_TAIL:0;break;case 110:var s=B(e,a);null===s?(r.namewhat=A("",!0),r.name=null):(r.namewhat=s.funcname,r.name=s.name);break;case 76:case 102:break;default:u=0}return u}(e,t,r,a=s.ttisclosure()?s.value:null,u),L(t,102)>=0&&(U.pushobj2s(e,s),b(e,e.top<=e.ci.top,"stack overflow")),P(e),L(t,76)>=0&&function(e,t){if(null===t||t instanceof U.CClosure)e.stack[e.top]=new U.TValue(c,null),k.api_incr_top(e);else{var r=t.p.lineinfo,n=R.luaH_new(e);e.stack[e.top]=new U.TValue(f,n),k.api_incr_top(e);for(var a=new U.TValue(i,!0),u=0;u0&&n!==e.base_ci;n=n.previous)t--;return 0===t&&n!==e.base_ci?(a=1,r.i_ci=n):a=0,a},e.exports.lua_sethook=function(e,t,r,n){null!==t&&0!==r||(r=0,t=null),e.ci.callstatus&N.CIST_LUA&&(e.oldpc=e.ci.l_savedpc),e.hook=t,e.basehookcount=n,e.hookcount=e.basehookcount,e.hookmask=r},e.exports.lua_setlocal=function(e,t,r){var n;P(e);var a=D(e,t.i_ci,r);return a?(n=a.name,U.setobjs2s(e,a.pos,e.top-1),delete e.stack[--e.top]):n=null,P(e),n}},function(e,t,r){"use strict";function n(e,t){for(var r=0;r=0&&(r=!0))}return{stopnow:r,ilimit:n}},ze=function e(t,r){if(t.ttisfloat()){var n=t.value,a=Math.floor(n);if(n!==a){if(0===r)return!1;r>1&&(a+=1)}return Te(a)}if(t.ttisinteger())return t.value;if(st(t)){var u=new Ee.TValue;if(Ee.luaO_str2num(t.svalue(),u)===t.vslen()+1)return e(u,r)}return!1},Ye=function(e){return e.ttisinteger()?e.value:ze(e,0)},Je=function(e){if(e.ttnov()===p)return e.value;if(st(e)){var t=new Ee.TValue;if(Ee.luaO_str2num(e.svalue(),t)===e.vslen()+1)return t.value}return!1},Ze=function(e,t){return e.value>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)|0},et=function(e,t,r){return 0===r&&Pe.luaG_runerror(e,g("attempt to divide by zero")),0|Math.floor(t/r)},tt=function(e,t,r){return 0===r&&Pe.luaG_runerror(e,g("attempt to perform 'n%%0'")),t-Math.floor(t/r)*r|0},rt=function(e,t){return t<0?t<=-32?0:e>>>-t:t>=32?0:e<0)},ct=function(e,t){ke(t>=2);do{var r=e.top,n=2;if((e.stack[r-2].ttisstring()||ut(e.stack[r-2]))&&ot(e,r-1))if(lt(e.stack[r-1]))ot(e,r-2);else if(lt(e.stack[r-2]))Ee.setobjs2s(e,r-2,r-1);else{var a=e.stack[r-1].vslen();for(n=1;nr-(n-1);)delete e.stack[--e.top]}while(t>1)},ft=function(e,t,r,n){for(var a=0;a<2e3;a++){var u=void 0;if(t.ttistable()){var s=Me.luaH_get(e,t.value,r);if(!s.ttisnil())return void Ee.setobj2s(e,n,s);if(null===(u=Ie.fasttm(e,t.value.metatable,Ie.TMS.TM_INDEX)))return void e.stack[n].setnilvalue()}else(u=Ie.luaT_gettmbyobj(e,t,Ie.TMS.TM_INDEX)).ttisnil()&&Pe.luaG_typeerror(e,t,g("index",!0));if(u.ttisfunction())return void Ie.luaT_callTM(e,u,t,r,e.stack[n],1);t=u}Pe.luaG_runerror(e,g("'__index' chain too long; possible loop",!0))},_t=function(e,t,r,n){for(var a=0;a<2e3;a++){var u=void 0;if(t.ttistable()){var s=t.value;if(!Me.luaH_get(e,s,r).ttisnil()||null===(u=Ie.fasttm(e,s.metatable,Ie.TMS.TM_NEWINDEX)))return Me.luaH_setfrom(e,s,r,n),void Me.invalidateTMcache(s)}else(u=Ie.luaT_gettmbyobj(e,t,Ie.TMS.TM_NEWINDEX)).ttisnil()&&Pe.luaG_typeerror(e,t,g("index",!0));if(u.ttisfunction())return void Ie.luaT_callTM(e,u,t,r,n,0);t=u}Pe.luaG_runerror(e,g("'__newindex' chain too long; possible loop",!0))};e.exports.cvt2str=ut,e.exports.cvt2num=st,e.exports.luaV_gettable=ft,e.exports.luaV_concat=ct,e.exports.luaV_div=et,e.exports.luaV_equalobj=He,e.exports.luaV_execute=function(e){var t=e.ci;t.callstatus|=Ue.CIST_FRESH;e:for(;;){ke(t===e.ci);var r=t.func.value,n=r.p.k,o=t.l_base,l=t.l_code[t.l_savedpc++];e.hookmask&(a|u)&&Pe.luaG_traceexec(e);var i=Ce(0,o,l);switch(l.opcode){case W:Ee.setobjs2s(e,i,De(0,o,l));break;case z:var c=n[l.Bx];Ee.setobj2s(e,i,c);break;case Y:ke(t.l_code[t.l_savedpc].opcode===P);var f=n[t.l_code[t.l_savedpc++].Ax];Ee.setobj2s(e,i,f);break;case X:e.stack[i].setbvalue(0!==l.B),0!==l.C&&t.l_savedpc++;break;case J:for(var _=0;_<=l.B;_++)e.stack[i+_].setnilvalue();break;case G:var p=l.B;Ee.setobj2s(e,i,r.upvals[p]);break;case B:var v=r.upvals[l.B],h=Be(e,o,n,l);ft(e,v,h,i);break;case V:var d=e.stack[De(0,o,l)],L=Be(e,o,n,l);ft(e,d,L,i);break;case se:var A=r.upvals[l.A],b=Ve(e,o,n,l),T=Be(e,o,n,l);_t(e,A,b,T);break;case oe:r.upvals[l.B].setfrom(e.stack[i]);break;case ue:var x=e.stack[i],O=Ve(e,o,n,l),Ae=Be(e,o,n,l);_t(e,x,O,Ae);break;case $:e.stack[i].sethvalue(Me.luaH_new(e));break;case ne:var ge=De(0,o,l),be=Be(e,o,n,l);Ee.setobjs2s(e,i+1,ge),ft(e,e.stack[ge],be,i);break;case E:var Te=Ve(e,o,n,l),xe=Be(e,o,n,l),ye=void 0,Ne=void 0;Te.ttisinteger()&&xe.ttisinteger()?e.stack[i].setivalue(Te.value+xe.value|0):!1!==(ye=Je(Te))&&!1!==(Ne=Je(xe))?e.stack[i].setfltvalue(ye+Ne):Ie.luaT_trybinTM(e,Te,xe,e.stack[i],Ie.TMS.TM_ADD);break;case ce:var Re=Ve(e,o,n,l),we=Be(e,o,n,l),ze=void 0,Ze=void 0;Re.ttisinteger()&&we.ttisinteger()?e.stack[i].setivalue(Re.value-we.value|0):!1!==(ze=Je(Re))&&!1!==(Ze=Je(we))?e.stack[i].setfltvalue(ze-Ze):Ie.luaT_trybinTM(e,Re,we,e.stack[i],Ie.TMS.TM_SUB);break;case Q:var qe=Ve(e,o,n,l),We=Be(e,o,n,l),ut=void 0,st=void 0;qe.ttisinteger()&&We.ttisinteger()?e.stack[i].setivalue($e(qe.value,We.value)):!1!==(ut=Je(qe))&&!1!==(st=Je(We))?e.stack[i].setfltvalue(ut*st):Ie.luaT_trybinTM(e,qe,We,e.stack[i],Ie.TMS.TM_MUL);break;case q:var ot=Ve(e,o,n,l),lt=Be(e,o,n,l),it=void 0,pt=void 0;ot.ttisinteger()&<.ttisinteger()?e.stack[i].setivalue(tt(e,ot.value,lt.value)):!1!==(it=Je(ot))&&!1!==(pt=Je(lt))?e.stack[i].setfltvalue(Oe(e,it,pt)):Ie.luaT_trybinTM(e,ot,lt,e.stack[i],Ie.TMS.TM_MOD);break;case te:var vt,ht=Ve(e,o,n,l),dt=Be(e,o,n,l),Lt=void 0;!1!==(vt=Je(ht))&&!1!==(Lt=Je(dt))?e.stack[i].setfltvalue(Math.pow(vt,Lt)):Ie.luaT_trybinTM(e,ht,dt,e.stack[i],Ie.TMS.TM_POW);break;case I:var At,gt=Ve(e,o,n,l),bt=Be(e,o,n,l),Tt=void 0;!1!==(At=Je(gt))&&!1!==(Tt=Je(bt))?e.stack[i].setfltvalue(At/Tt):Ie.luaT_trybinTM(e,gt,bt,e.stack[i],Ie.TMS.TM_DIV);break;case K:var xt=Ve(e,o,n,l),kt=Be(e,o,n,l),Ot=void 0,Et=void 0;xt.ttisinteger()&&kt.ttisinteger()?e.stack[i].setivalue(et(e,xt.value,kt.value)):!1!==(Ot=Je(xt))&&!1!==(Et=Je(kt))?e.stack[i].setfltvalue(Math.floor(Ot/Et)):Ie.luaT_trybinTM(e,xt,kt,e.stack[i],Ie.TMS.TM_IDIV);break;case m:var mt,Ut=Ve(e,o,n,l),yt=Be(e,o,n,l),Nt=void 0;!1!==(mt=Ye(Ut))&&!1!==(Nt=Ye(yt))?e.stack[i].setivalue(mt&Nt):Ie.luaT_trybinTM(e,Ut,yt,e.stack[i],Ie.TMS.TM_BAND);break;case y:var Rt,wt=Ve(e,o,n,l),St=Be(e,o,n,l),It=void 0;!1!==(Rt=Ye(wt))&&!1!==(It=Ye(St))?e.stack[i].setivalue(Rt|It):Ie.luaT_trybinTM(e,wt,St,e.stack[i],Ie.TMS.TM_BOR);break;case N:var Mt,Pt=Ve(e,o,n,l),Ct=Be(e,o,n,l),Dt=void 0;!1!==(Mt=Ye(Pt))&&!1!==(Dt=Ye(Ct))?e.stack[i].setivalue(Mt^Dt):Ie.luaT_trybinTM(e,Pt,Ct,e.stack[i],Ie.TMS.TM_BXOR);break;case le:var Vt,Bt=Ve(e,o,n,l),Gt=Be(e,o,n,l),Kt=void 0;!1!==(Vt=Ye(Bt))&&!1!==(Kt=Ye(Gt))?e.stack[i].setivalue(rt(Vt,Kt)):Ie.luaT_trybinTM(e,Bt,Gt,e.stack[i],Ie.TMS.TM_SHL);break;case ie:var Ft,jt=Ve(e,o,n,l),Ht=Be(e,o,n,l),Xt=void 0;!1!==(Ft=Ye(jt))&&!1!==(Xt=Ye(Ht))?e.stack[i].setivalue(rt(Ft,-Xt)):Ie.luaT_trybinTM(e,jt,Ht,e.stack[i],Ie.TMS.TM_SHR);break;case de:var zt=e.stack[De(0,o,l)],Yt=void 0;zt.ttisinteger()?e.stack[i].setivalue(0|-zt.value):!1!==(Yt=Je(zt))?e.stack[i].setfltvalue(-Yt):Ie.luaT_trybinTM(e,zt,zt,e.stack[i],Ie.TMS.TM_UNM);break;case U:var Jt=e.stack[De(0,o,l)];Jt.ttisinteger()?e.stack[i].setivalue(~Jt.value):Ie.luaT_trybinTM(e,Jt,Jt,e.stack[i],Ie.TMS.TM_BNOT);break;case ee:var Zt=e.stack[De(0,o,l)];e.stack[i].setbvalue(Zt.l_isfalse());break;case H:Qe(e,e.stack[i],e.stack[De(0,o,l)]);break;case S:var qt=l.B,Wt=l.C;e.top=o+Wt+1,ct(e,Wt-qt+1);var Qt=o+qt;Ee.setobjs2s(e,i,Qt),Se.adjust_top(e,t.top);break;case F:Ge(e,t,l,0);break;case M:He(e,Ve(e,o,n,l),Be(e,o,n,l))!==l.A?t.l_savedpc++:Ke(e,t);break;case Z:Fe(e,Ve(e,o,n,l),Be(e,o,n,l))!==l.A?t.l_savedpc++:Ke(e,t);break;case j:je(e,Ve(e,o,n,l),Be(e,o,n,l))!==l.A?t.l_savedpc++:Ke(e,t);break;case _e:(l.C?e.stack[i].l_isfalse():!e.stack[i].l_isfalse())?t.l_savedpc++:Ke(e,t);break;case pe:var $t=De(0,o,l),er=e.stack[$t];(l.C?er.l_isfalse():!er.l_isfalse())?t.l_savedpc++:(Ee.setobjs2s(e,i,$t),Ke(e,t));break;case R:var tr=l.B,rr=l.C-1;if(0!==tr&&Se.adjust_top(e,i+tr),!Se.luaD_precall(e,i,rr)){t=e.ci;continue e}rr>=0&&Se.adjust_top(e,t.top);break;case fe:var nr=l.B;if(0!==nr&&Se.adjust_top(e,i+nr),!Se.luaD_precall(e,i,s)){var ar=e.ci,ur=ar.previous,sr=ar.func,or=ar.funcOff,lr=ur.funcOff,ir=ar.l_base+sr.value.p.numparams;r.p.p.length>0&&me.luaF_close(e,ur.l_base);for(var cr=0;or+cr0&&me.luaF_close(e,o);var fr=Se.luaD_poscall(e,t,i,0!==l.B?l.B-1:e.top-i);if(t.callstatus&Ue.CIST_FRESH)return;t=e.ci,fr&&Se.adjust_top(e,t.top),ke(t.callstatus&Ue.CIST_LUA),ke(t.l_code[t.l_savedpc-1].opcode===R);continue e;case C:if(e.stack[i].ttisinteger()){var _r=e.stack[i+2].value,pr=e.stack[i].value+_r|0,vr=e.stack[i+1].value;(0<_r?pr<=vr:vr<=pr)&&(t.l_savedpc+=l.sBx,e.stack[i].chgivalue(pr),e.stack[i+3].setivalue(pr))}else{var hr=e.stack[i+2].value,dr=e.stack[i].value+hr,Lr=e.stack[i+1].value;(00;Ur--)Me.luaH_setint(Nr,Rr--,e.stack[i+Ur]);Se.adjust_top(e,t.top);break;case w:var wr=r.p.p[l.Bx],Sr=nt(wr,r.upvals,e.stack,o);null===Sr?at(e,wr,r.upvals,o,i):e.stack[i].setclLvalue(Sr);break;case Le:var Ir=l.B-1,Mr=o-t.funcOff-r.p.numparams-1,Pr=void 0;for(Mr<0&&(Mr=0),Ir<0&&(Ir=Mr,Se.luaD_checkstack(e,Mr),Se.adjust_top(e,i+Mr)),Pr=0;Pr1&&(e.top=s-1,ct(e,o)),Ee.setobjs2s(e,t.l_base+n.A,e.top-1),Se.adjust_top(e,t.top);break;case ve:ke(t.l_code[t.l_savedpc].opcode===he),Se.adjust_top(e,t.top);break;case R:n.C-1>=0&&Se.adjust_top(e,t.top)}},e.exports.luaV_imul=$e,e.exports.luaV_lessequal=je,e.exports.luaV_lessthan=Fe,e.exports.luaV_mod=tt,e.exports.luaV_objlen=Qe,e.exports.luaV_rawequalobj=function(e,t){return He(null,e,t)},e.exports.luaV_shiftl=rt,e.exports.luaV_tointeger=ze,e.exports.settable=_t,e.exports.tointeger=Ye,e.exports.tonumber=Je},function(e,t,r){"use strict";var n=[96,113,65,84,80,80,92,108,60,16,60,84,108,124,124,124,124,124,124,124,124,124,124,124,124,96,96,96,96,104,34,188,188,188,132,228,84,84,16,98,98,4,98,20,81,80,23],a=function(e,t){return~(-1<>0&a(6,0),A:e>>6&a(8,0),B:e>>23&a(9,0),C:e>>14&a(9,0),Bx:e>>14&a(18,0),Ax:e>>6&a(26,0),sBx:(e>>14&a(18,0))-131071};var t=e.code;return e.opcode=t>>0&a(6,0),e.A=t>>6&a(8,0),e.B=t>>23&a(9,0),e.C=t>>14&a(9,0),e.Bx=t>>14&a(18,0),e.Ax=t>>6&a(26,0),e.sBx=(t>>14&a(18,0))-131071,e};e.exports.BITRK=256,e.exports.CREATE_ABC=function(e,t,r,n){return l(e<<0|t<<6|r<<23|n<<14)},e.exports.CREATE_ABx=function(e,t,r){return l(e<<0|t<<6|r<<14)},e.exports.CREATE_Ax=function(e,t){return l(e<<0|t<<6)},e.exports.GET_OPCODE=function(e){return e.opcode},e.exports.GETARG_A=function(e){return e.A},e.exports.GETARG_B=function(e){return e.B},e.exports.GETARG_C=function(e){return e.C},e.exports.GETARG_Bx=function(e){return e.Bx},e.exports.GETARG_Ax=function(e){return e.Ax},e.exports.GETARG_sBx=function(e){return e.sBx},e.exports.INDEXK=function(e){return-257&e},e.exports.ISK=function(e){return 256&e},e.exports.LFIELDS_PER_FLUSH=50,e.exports.MAXARG_A=255,e.exports.MAXARG_Ax=67108863,e.exports.MAXARG_B=511,e.exports.MAXARG_Bx=262143,e.exports.MAXARG_C=511,e.exports.MAXARG_sBx=131071,e.exports.MAXINDEXRK=255,e.exports.NO_REG=255,e.exports.OpArgK=3,e.exports.OpArgN=0,e.exports.OpArgR=2,e.exports.OpArgU=1,e.exports.OpCodes=["MOVE","LOADK","LOADKX","LOADBOOL","LOADNIL","GETUPVAL","GETTABUP","GETTABLE","SETTABUP","SETUPVAL","SETTABLE","NEWTABLE","SELF","ADD","SUB","MUL","MOD","POW","DIV","IDIV","BAND","BOR","BXOR","SHL","SHR","UNM","BNOT","NOT","LEN","CONCAT","JMP","EQ","LT","LE","TEST","TESTSET","CALL","TAILCALL","RETURN","FORLOOP","FORPREP","TFORCALL","TFORLOOP","SETLIST","CLOSURE","VARARG","EXTRAARG"],e.exports.OpCodesI={OP_MOVE:0,OP_LOADK:1,OP_LOADKX:2,OP_LOADBOOL:3,OP_LOADNIL:4,OP_GETUPVAL:5,OP_GETTABUP:6,OP_GETTABLE:7,OP_SETTABUP:8,OP_SETUPVAL:9,OP_SETTABLE:10,OP_NEWTABLE:11,OP_SELF:12,OP_ADD:13,OP_SUB:14,OP_MUL:15,OP_MOD:16,OP_POW:17,OP_DIV:18,OP_IDIV:19,OP_BAND:20,OP_BOR:21,OP_BXOR:22,OP_SHL:23,OP_SHR:24,OP_UNM:25,OP_BNOT:26,OP_NOT:27,OP_LEN:28,OP_CONCAT:29,OP_JMP:30,OP_EQ:31,OP_LT:32,OP_LE:33,OP_TEST:34,OP_TESTSET:35,OP_CALL:36,OP_TAILCALL:37,OP_RETURN:38,OP_FORLOOP:39,OP_FORPREP:40,OP_TFORCALL:41,OP_TFORLOOP:42,OP_SETLIST:43,OP_CLOSURE:44,OP_VARARG:45,OP_EXTRAARG:46},e.exports.POS_A=6,e.exports.POS_Ax=6,e.exports.POS_B=23,e.exports.POS_Bx=14,e.exports.POS_C=14,e.exports.POS_OP=0,e.exports.RKASK=function(e){return 256|e},e.exports.SETARG_A=function(e,t){return s(e,t,6,8)},e.exports.SETARG_Ax=function(e,t){return s(e,t,6,26)},e.exports.SETARG_B=function(e,t){return s(e,t,23,9)},e.exports.SETARG_Bx=o,e.exports.SETARG_C=function(e,t){return s(e,t,14,9)},e.exports.SETARG_sBx=function(e,t){return o(e,t+131071)},e.exports.SET_OPCODE=function(e,t){return e.code=e.code&u(6,0)|t<<0&a(6,0),l(e)},e.exports.SIZE_A=8,e.exports.SIZE_Ax=26,e.exports.SIZE_B=9,e.exports.SIZE_Bx=18,e.exports.SIZE_C=9,e.exports.SIZE_OP=6,e.exports.fullins=l,e.exports.getBMode=function(e){return n[e]>>4&3},e.exports.getCMode=function(e){return n[e]>>2&3},e.exports.getOpMode=function(e){return 3&n[e]},e.exports.iABC=0,e.exports.iABx=1,e.exports.iAsBx=2,e.exports.iAx=3,e.exports.testAMode=function(e){return 64&n[e]},e.exports.testTMode=function(e){return 128&n[e]}},function(e,t,r){"use strict";var n=r(2),a="_"+n.LUA_VERSION_MAJOR+"_"+n.LUA_VERSION_MINOR;e.exports.LUA_VERSUFFIX=a,e.exports.lua_assert=function(e){},e.exports.luaopen_base=r(24).luaopen_base;e.exports.LUA_COLIBNAME="coroutine",e.exports.luaopen_coroutine=r(25).luaopen_coroutine;e.exports.LUA_TABLIBNAME="table",e.exports.luaopen_table=r(26).luaopen_table;e.exports.LUA_OSLIBNAME="os",e.exports.luaopen_os=r(27).luaopen_os;e.exports.LUA_STRLIBNAME="string",e.exports.luaopen_string=r(28).luaopen_string;e.exports.LUA_UTF8LIBNAME="utf8",e.exports.luaopen_utf8=r(29).luaopen_utf8;e.exports.LUA_BITLIBNAME="bit32";e.exports.LUA_MATHLIBNAME="math",e.exports.luaopen_math=r(30).luaopen_math;e.exports.LUA_DBLIBNAME="debug",e.exports.luaopen_debug=r(31).luaopen_debug;e.exports.LUA_LOADLIBNAME="package",e.exports.luaopen_package=r(32).luaopen_package;e.exports.LUA_FENGARILIBNAME="fengari",e.exports.luaopen_fengari=r(33).luaopen_fengari;var u=r(39);e.exports.luaL_openlibs=u.luaL_openlibs},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(0),u=a.lua,s=a.lauxlib,o=a.lualib,l=a.to_luastring,i=u.LUA_MULTRET,c=u.LUA_OK,f=u.LUA_REGISTRYINDEX,_=u.LUA_RIDX_MAINTHREAD,p=u.LUA_TBOOLEAN,v=u.LUA_TFUNCTION,h=u.LUA_TLIGHTUSERDATA,d=u.LUA_TNIL,L=u.LUA_TNONE,A=u.LUA_TNUMBER,g=u.LUA_TSTRING,b=u.LUA_TTABLE,T=u.LUA_TTHREAD,x=u.LUA_TUSERDATA,k=u.lua_atnativeerror,O=u.lua_call,E=u.lua_getfield,m=u.lua_gettable,U=u.lua_gettop,y=u.lua_isnil,N=u.lua_isproxy,R=u.lua_newuserdata,w=u.lua_pcall,S=u.lua_pop,I=u.lua_pushboolean,M=u.lua_pushcfunction,P=u.lua_pushinteger,C=u.lua_pushlightuserdata,D=u.lua_pushliteral,V=u.lua_pushnil,B=u.lua_pushnumber,G=u.lua_pushstring,K=u.lua_pushvalue,F=u.lua_rawgeti,j=u.lua_rawgetp,H=u.lua_rawsetp,X=u.lua_rotate,z=u.lua_setfield,Y=u.lua_settable,J=u.lua_settop,Z=u.lua_toboolean,q=u.lua_tojsstring,W=u.lua_tonumber,Q=u.lua_toproxy,$=u.lua_tothread,ee=u.lua_touserdata,te=u.lua_type,re=s.luaL_argerror,ne=s.luaL_checkany,ae=s.luaL_checkoption,ue=s.luaL_checkstack,se=s.luaL_checkudata,oe=s.luaL_error,le=s.luaL_getmetafield,ie=s.luaL_newlib,ce=s.luaL_newmetatable,fe=s.luaL_requiref,_e=s.luaL_setfuncs,pe=s.luaL_setmetatable,ve=s.luaL_testudata,he=s.luaL_tolstring,de=o.luaopen_base;var Le,Ae,ge,be="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:(0,eval)("this");if("undefined"!=typeof Reflect)Le=Reflect.apply,Ae=Reflect.construct,ge=Reflect.deleteProperty;else{var Te=Function.apply,xe=Function.bind;Le=function(e,t,r){return Te.call(e,t,r)},Ae=function(e,t){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(xe.apply(e,r))},ge=Function("t","k","delete t[k]")}var ke=String.prototype.concat.bind(""),Oe=function(e){return"object"===n(e)?null!==e:"function"==typeof e},Ee=l("js object"),me=function(e,t){var r=ve(e,t,Ee);return r?r.data:void 0},Ue=function(e,t){return se(e,t,Ee).data},ye=function(e,t){R(e).data=t,pe(e,Ee)},Ne=function(e){F(e,f,_);var t=$(e,-1);return S(e,1),t},Re=new WeakMap,we=function(e,t){switch(n(t)){case"undefined":V(e);break;case"number":B(e,t);break;case"string":G(e,l(t));break;case"boolean":I(e,t);break;case"symbol":C(e,t);break;case"function":if(N(t,e)){t(e);break}case"object":if(null===t){if(j(e,f,null)!==x)throw Error("js library not loaded into lua_State");break}default:var r=Re.get(Ne(e));if(!r)throw Error("js library not loaded into lua_State");var a=r.get(t);a?a(e):(ye(e,t),a=Q(e,-1),r.set(t,a))}},Se=function(e){var t=ee(e,1);return we(e,t),1},Ie=function(e,t){switch(te(e,t)){case L:case d:return;case p:return Z(e,t);case h:return ee(e,t);case A:return W(e,t);case g:return q(e,t);case x:var r=me(e,t);if(void 0!==r)return r;case b:case v:case T:default:return je(e,Q(e,t))}},Me=function(e,t){var r=w(e,t,1,0),n=Ie(e,-1);switch(S(e,1),r){case c:return n;default:throw n}},Pe=function(e,t,r,n,a){if(!Oe(n))throw new TypeError("`args` argument must be an object");var u=+n.length;u>=0||(u=0),ue(e,2+u,null);var s=U(e);t(e),we(e,r);for(var o=0;ovoid 0;"))()},qe=function(e,t,r){var n,a,u=Ne(e);switch(r){case"function":delete(a=function(){}.bind()).length,delete a.name,n=a;break;case"arrow_function":n=function(){var e=Ze();return delete e.length,delete e.name,e}();break;case"object":n={};break;default:throw TypeError("invalid type to createproxy")}return n[Ye]=t,n[ze]=u,new Proxy(n,Je)},We=["function","arrow_function","object"],Qe=We.map((function(e){return l(e)}));He.createproxy=function(e){ne(e,1);var t=We[ae(e,2,Qe[0],Qe)],r=qe(e,Q(e,1),t);return we(e,r),1}}var $e={__index:function(e){var t=Ue(e,1),r=Ie(e,2);return we(e,t[r]),1},__newindex:function(e){var t=Ue(e,1),r=Ie(e,2),n=Ie(e,3);return void 0===n?ge(t,r):t[r]=n,0},__tostring:function(e){var t=Ue(e,1),r=ke(t);return G(e,l(r)),1},__call:function(e){var t,r=Ue(e,1),n=U(e)-1,a=new Array(Math.max(0,n-1));if(n>0&&(t=Ie(e,2),n-- >0))for(var u=0;u=this.keys.length)){var t=this.keys[this.index++];return[t,this.object[t]]}},n={object:u,keys:Object.keys(u),index:0};else{var s=Le(t,u,[]);void 0===s&&oe(e,l("bad '__pairs' result (object with keys 'iter', 'state', 'first' expected)")),void 0===(r=s.iter)&&oe(e,l("bad '__pairs' result (object.iter is missing)")),n=s.state,a=s.first}return M(e,(function(){var t=Ie(e,1),n=Ie(e,2),a=Le(r,t,[n]);if(void 0===a)return 0;Array.isArray(a)||oe(e,l("bad iterator result (Array or undefined expected)")),ue(e,a.length,null);for(var u=0;u0){var n=r.funcOff+t;return I(e,t<=r.top-(r.funcOff+1),"unacceptable index"),n>=e.top?V.luaO_nilobject:e.stack[n]}return t>c?(I(e,0!==t&&-t<=e.top,"invalid index"),e.stack[e.top+t]):t===c?e.l_G.l_registry:(I(e,(t=c-t)<=D.MAXUPVAL+1,"upvalue index too large"),r.func.ttislcf()?V.luaO_nilobject:t<=r.func.value.nupvalues?r.func.value.upvalue[t-1]:V.luaO_nilobject)},ne=function(e,t){var r=e.ci;if(t>0){var n=r.funcOff+t;return I(e,t<=r.top-(r.funcOff+1),"unacceptable index"),n>=e.top?null:n}if(t>c)return I(e,0!==t&&-t<=e.top,"invalid index"),e.top+t;throw Error("attempt to use pseudo-index")},ae=function(e,t){var r,n=e.ci.funcOff;t>=0?(I(e,t<=e.stack_last-(n+1),"new top too large"),r=n+1+t):(I(e,-(t+1)<=e.top-(n+1),"invalid new top"),r=e.top+t+1),P.adjust_top(e,r)},ue=function(e,t){ae(e,-t-1)},se=function(e,t,r){for(;tc,"index not in the stack"),I(e,(r>=0?r:-r)<=n-a+1,"invalid 'n'");var s=r>=0?n-r:a-r-1;se(e,a,s),se(e,s+1,e.top-1),se(e,a,e.top-1)},le=function(e,t,r){var n=re(e,t);re(e,r).setfrom(n)},ie=function(e,t,r){if($("function"==typeof t),ee(r),0===r)e.stack[e.top]=new Z(A,t);else{Q(e,r),I(e,r<=D.MAXUPVAL,"upvalue index too large");for(var n=new q(e,t,r),a=0;a0&&--e.top,e.stack[e.top].setclCvalue(n)}W(e)},ce=ie,fe=function(e,t){ie(e,t,0)},_e=fe,pe=function(e,t,r){var n=F(e,w(r));Q(e,1),V.pushsvalue2s(e,n),I(e,e.top<=e.ci.top,"stack overflow"),z.settable(e,t,e.stack[e.top-1],e.stack[e.top-2]),delete e.stack[--e.top],delete e.stack[--e.top]},ve=function(e,t){pe(e,Y.luaH_getint(e.l_G.l_registry.value,f),t)},he=function(e,t,r){var n=F(e,w(r));return V.pushsvalue2s(e,n),I(e,e.top<=e.ci.top,"stack overflow"),z.luaV_gettable(e,t,e.stack[e.top-1],e.top-1),e.stack[e.top-1].ttnov()},de=function(e,t,r){var n=re(e,t);return ee(r),I(e,n.ttistable(),"table expected"),V.pushobj2s(e,Y.luaH_getint(n.value,r)),I(e,e.top<=e.ci.top,"stack overflow"),e.stack[e.top-1].ttnov()},Le=function(e,t,r){var n=new V.TValue(U,Y.luaH_new(e));e.stack[e.top]=n,W(e)},Ae=function(e,t,r){switch(ee(r),t.ttype()){case d:var n=t.value;return 1<=r&&r<=n.nupvalues?{name:S("",!0),val:n.upvalue[r-1]}:null;case g:var a=t.value,u=a.p;if(!(1<=r&&r<=u.upvalues.length))return null;var s=u.upvalues[r-1].name;return{name:s?s.getstr():S("(*no name)",!0),val:a.upvals[r-1]};default:return null}},ge=function(e,t){var r=re(e,t);if(!r.ttisstring()){if(!z.cvt2str(r))return null;V.luaO_tostring(e,r)}return r.svalue()},be=ge,Te=function(e,t){return z.tointeger(re(e,t))},xe=function(e,t){return z.tonumber(re(e,t))},ke=new WeakMap,Oe=function(e,t){P.luaD_callnoyield(e,t.funcOff,t.nresults)},Ee=function(e,t){var r=re(e,t);return te(r)?r.ttnov():k},me=S("?"),Ue=function(e,t,r){I(e,r===a||e.ci.top-e.top>=r-t,"results from function overflow current stack size")},ye=function(e,t,r,n,u){I(e,null===u||!(e.ci.callstatus&B.CIST_LUA),"cannot use continuations inside hooks"),Q(e,t+1),I(e,e.status===R,"cannot do calls on non-normal thread"),Ue(e,t,r);var s=e.top-(t+1);null!==u&&0===e.nny?(e.ci.c_k=u,e.ci.c_ctx=n,P.luaD_call(e,s,r)):P.luaD_callnoyield(e,s,r),r===a&&e.ci.top0){var c={funcOff:i,nresults:r};o=P.luaD_pcall(e,Oe,c,i,l)}else{var f=e.ci;f.c_k=s,f.c_ctx=u,f.extra=i,f.c_old_errfunc=e.errfunc,e.errfunc=l,f.callstatus&=~B.CIST_OAH|e.allowhook,f.callstatus|=B.CIST_YPCALL,P.luaD_call(e,i,r),f.callstatus&=~B.CIST_YPCALL,e.errfunc=f.c_old_errfunc,o=R}return r===a&&e.ci.top0||t<=c?t:e.top-e.ci.funcOff+t},e.exports.lua_arith=function(e,t){t!==i&&t!==u?Q(e,2):(Q(e,1),V.pushobj2s(e,e.stack[e.top-1]),I(e,e.top<=e.ci.top,"stack overflow")),V.luaO_arith(e,t,e.stack[e.top-2],e.stack[e.top-1],e.stack[e.top-2]),delete e.stack[--e.top]},e.exports.lua_atpanic=function(e,t){var r=e.l_G.panic;return e.l_G.panic=t,r},e.exports.lua_atnativeerror=function(e,t){var r=e.l_G.atnativeerror;return e.l_G.atnativeerror=t,r},e.exports.lua_call=function(e,t,r){ye(e,t,r,0,null)},e.exports.lua_callk=ye,e.exports.lua_checkstack=function(e,t){var r,n=e.ci;(I(e,t>=0,"negative 'n'"),e.stack_last-e.top>t)?r=!0:e.top+B.EXTRA_STACK>X-t?r=!1:(P.luaD_growstack(e,t),r=!0);return r&&n.top=2?z.luaV_concat(e,t):0===t&&(V.pushsvalue2s(e,K(e,S("",!0))),I(e,e.top<=e.ci.top,"stack overflow"))},e.exports.lua_copy=le,e.exports.lua_createtable=Le,e.exports.lua_dump=function(e,t,r,n){Q(e,1);var a=e.stack[e.top-1];return a.ttisLclosure()?C(e,a.value.p,t,r,n):1},e.exports.lua_error=function(e){Q(e,1),M.luaG_errormsg(e)},e.exports.lua_gc=function(){},e.exports.lua_getallocf=function(){return console.warn("lua_getallocf is not available"),0},e.exports.lua_getextraspace=function(){return console.warn("lua_getextraspace is not available"),0},e.exports.lua_getfield=function(e,t,r){return he(e,re(e,t),r)},e.exports.lua_getglobal=function(e,t){return he(e,Y.luaH_getint(e.l_G.l_registry.value,f),t)},e.exports.lua_geti=function(e,t,r){var n=re(e,t);return ee(r),e.stack[e.top]=new Z(E,r),W(e),z.luaV_gettable(e,n,e.stack[e.top-1],e.top-1),e.stack[e.top-1].ttnov()},e.exports.lua_getmetatable=function(e,t){var r,n=re(e,t),a=!1;switch(n.ttnov()){case U:case N:r=n.value.metatable;break;default:r=e.l_G.mt[n.ttnov()]}return null!=r&&(e.stack[e.top]=new Z(U,r),W(e),a=!0),a},e.exports.lua_gettable=function(e,t){var r=re(e,t);return z.luaV_gettable(e,r,e.stack[e.top-1],e.top-1),e.stack[e.top-1].ttnov()},e.exports.lua_gettop=function(e){return e.top-(e.ci.funcOff+1)},e.exports.lua_getupvalue=function(e,t,r){var n=Ae(0,re(e,t),r);if(n){var a=n.name,u=n.val;return V.pushobj2s(e,u),I(e,e.top<=e.ci.top,"stack overflow"),a}return null},e.exports.lua_getuservalue=function(e,t){var r=re(e,t);I(e,r.ttisfulluserdata(),"full userdata expected");var n=r.value.uservalue;return e.stack[e.top]=new Z(n.type,n.value),W(e),e.stack[e.top-1].ttnov()},e.exports.lua_insert=function(e,t){oe(e,t,1)},e.exports.lua_isboolean=function(e,t){return Ee(e,t)===h},e.exports.lua_iscfunction=function(e,t){var r=re(e,t);return r.ttislcf(r)||r.ttisCclosure()},e.exports.lua_isfunction=function(e,t){return Ee(e,t)===L},e.exports.lua_isinteger=function(e,t){return re(e,t).ttisinteger()},e.exports.lua_islightuserdata=function(e,t){return Ee(e,t)===b},e.exports.lua_isnil=function(e,t){return Ee(e,t)===x},e.exports.lua_isnone=function(e,t){return Ee(e,t)===k},e.exports.lua_isnoneornil=function(e,t){return Ee(e,t)<=0},e.exports.lua_isnumber=function(e,t){return!1!==z.tonumber(re(e,t))},e.exports.lua_isproxy=function(e,t){var r=ke.get(e);return!!r&&(null===t||t.l_G===r)},e.exports.lua_isstring=function(e,t){var r=re(e,t);return r.ttisstring()||z.cvt2str(r)},e.exports.lua_istable=function(e,t){return re(e,t).ttistable()},e.exports.lua_isthread=function(e,t){return Ee(e,t)===y},e.exports.lua_isuserdata=function(e,t){var r=re(e,t);return r.ttisfulluserdata(r)||r.ttislightuserdata()},e.exports.lua_len=function(e,t){var r=re(e,t),n=new Z;z.luaV_objlen(e,n,r),e.stack[e.top]=n,W(e)},e.exports.lua_load=function(e,t,r,n,a){n=n?w(n):me,null!==a&&(a=w(a));var u=new J(e,t,r),s=P.luaD_protectedparser(e,u,n,a);if(s===R){var o=e.stack[e.top-1].value;if(o.nupvalues>=1){var l=Y.luaH_getint(e.l_G.l_registry.value,f);o.upvals[0].setfrom(l)}}return s},e.exports.lua_newtable=function(e){Le(e)},e.exports.lua_newuserdata=function(e,t){var r=function(e,t){return new V.Udata(e,t)}(e,t);return e.stack[e.top]=new V.TValue(N,r),W(e),r.data},e.exports.lua_next=function(e,t){var r=re(e,t);return I(e,r.ttistable(),"table expected"),e.stack[e.top]=new Z,Y.luaH_next(e,r.value,e.top-1)?(W(e),1):(delete e.stack[e.top],delete e.stack[--e.top],0)},e.exports.lua_pcall=function(e,t,r,n){return Ne(e,t,r,n,0,null)},e.exports.lua_pcallk=Ne,e.exports.lua_pop=ue,e.exports.lua_pushboolean=function(e,t){e.stack[e.top]=new Z(h,!!t),W(e)},e.exports.lua_pushcclosure=ie,e.exports.lua_pushcfunction=fe,e.exports.lua_pushfstring=function(e,t){t=w(t);for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a=r,"invalid length to lua_pushlstring"),n=F(e,t.subarray(0,r))),V.pushsvalue2s(e,n),I(e,e.top<=e.ci.top,"stack overflow"),n.value},e.exports.lua_pushnil=function(e){e.stack[e.top]=new Z(x,null),W(e)},e.exports.lua_pushnumber=function(e,t){$("number"==typeof t),e.stack[e.top]=new Z(O,t),W(e)},e.exports.lua_pushstring=function(e,t){if(null==t)e.stack[e.top]=new Z(x,null),e.top++;else{var r=F(e,w(t));V.pushsvalue2s(e,r),t=r.getstr()}return I(e,e.top<=e.ci.top,"stack overflow"),t},e.exports.lua_pushthread=function(e){return e.stack[e.top]=new Z(y,e),W(e),e.l_G.mainthread===e},e.exports.lua_pushvalue=function(e,t){V.pushobj2s(e,re(e,t)),I(e,e.top<=e.ci.top,"stack overflow")},e.exports.lua_pushvfstring=function(e,t,r){return t=w(t),V.luaO_pushvfstring(e,t,r)},e.exports.lua_rawequal=function(e,t,r){var n=re(e,t),a=re(e,r);return te(n)&&te(a)?z.luaV_equalobj(null,n,a):0},e.exports.lua_rawget=function(e,t){var r=re(e,t);return I(e,r.ttistable(r),"table expected"),V.setobj2s(e,e.top-1,Y.luaH_get(e,r.value,e.stack[e.top-1])),e.stack[e.top-1].ttnov()},e.exports.lua_rawgeti=de,e.exports.lua_rawgetp=function(e,t,r){var n=re(e,t);I(e,n.ttistable(),"table expected");var a=new Z(b,r);return V.pushobj2s(e,Y.luaH_get(e,n.value,a)),I(e,e.top<=e.ci.top,"stack overflow"),e.stack[e.top-1].ttnov()},e.exports.lua_rawlen=function(e,t){var r=re(e,t);switch(r.ttype()){case m:case T:return r.vslen();case N:return r.value.len;case U:return Y.luaH_getn(r.value);default:return 0}},e.exports.lua_rawset=function(e,t){Q(e,2);var r=re(e,t);I(e,r.ttistable(),"table expected");var n=e.stack[e.top-2],a=e.stack[e.top-1];Y.luaH_setfrom(e,r.value,n,a),Y.invalidateTMcache(r.value),delete e.stack[--e.top],delete e.stack[--e.top]},e.exports.lua_rawseti=function(e,t,r){ee(r),Q(e,1);var n=re(e,t);I(e,n.ttistable(),"table expected"),Y.luaH_setint(n.value,r,e.stack[e.top-1]),delete e.stack[--e.top]},e.exports.lua_rawsetp=function(e,t,r){Q(e,1);var n=re(e,t);I(e,n.ttistable(),"table expected");var a=new Z(b,r),u=e.stack[e.top-1];Y.luaH_setfrom(e,n.value,a,u),delete e.stack[--e.top]},e.exports.lua_register=function(e,t,r){fe(e,r),ve(e,t)},e.exports.lua_remove=function(e,t){oe(e,t,-1),ue(e,1)},e.exports.lua_replace=function(e,t){le(e,-1,t),ue(e,1)},e.exports.lua_rotate=oe,e.exports.lua_setallocf=function(){return console.warn("lua_setallocf is not available"),0},e.exports.lua_setfield=function(e,t,r){pe(e,re(e,t),r)},e.exports.lua_setglobal=ve,e.exports.lua_seti=function(e,t,r){ee(r),Q(e,1);var n=re(e,t);e.stack[e.top]=new Z(E,r),W(e),z.settable(e,n,e.stack[e.top-1],e.stack[e.top-2]),delete e.stack[--e.top],delete e.stack[--e.top]},e.exports.lua_setmetatable=function(e,t){var r;Q(e,1);var n=re(e,t);switch(e.stack[e.top-1].ttisnil()?r=null:(I(e,e.stack[e.top-1].ttistable(),"table expected"),r=e.stack[e.top-1].value),n.ttnov()){case N:case U:n.value.metatable=r;break;default:e.l_G.mt[n.ttnov()]=r}return delete e.stack[--e.top],!0},e.exports.lua_settable=function(e,t){Q(e,2);var r=re(e,t);z.settable(e,r,e.stack[e.top-2],e.stack[e.top-1]),delete e.stack[--e.top],delete e.stack[--e.top]},e.exports.lua_settop=ae,e.exports.lua_setupvalue=function(e,t,r){var n=re(e,t);Q(e,1);var a=Ae(0,n,r);if(a){var u=a.name;return a.val.setfrom(e.stack[e.top-1]),delete e.stack[--e.top],u}return null},e.exports.lua_setuservalue=function(e,t){Q(e,1);var r=re(e,t);I(e,r.ttisfulluserdata(),"full userdata expected"),r.value.uservalue.setfrom(e.stack[e.top-1]),delete e.stack[--e.top]},e.exports.lua_status=function(e){return e.status},e.exports.lua_stringtonumber=function(e,t){var r=new Z,n=V.luaO_str2num(t,r);return 0!==n&&(e.stack[e.top]=r,W(e)),n},e.exports.lua_toboolean=function(e,t){return!re(e,t).l_isfalse()},e.exports.lua_tocfunction=function(e,t){var r=re(e,t);return r.ttislcf()||r.ttisCclosure()?r.value:null},e.exports.lua_todataview=function(e,t){var r=ge(e,t);return new DataView(r.buffer,r.byteOffset,r.byteLength)},e.exports.lua_tointeger=function(e,t){var r=Te(e,t);return!1===r?0:r},e.exports.lua_tointegerx=Te,e.exports.lua_tojsstring=function(e,t){var r=re(e,t);if(!r.ttisstring()){if(!z.cvt2str(r))return null;V.luaO_tostring(e,r)}return r.jsstring()},e.exports.lua_tolstring=ge,e.exports.lua_tonumber=function(e,t){var r=xe(e,t);return!1===r?0:r},e.exports.lua_tonumberx=xe,e.exports.lua_topointer=function(e,t){var r=re(e,t);switch(r.ttype()){case U:case g:case d:case A:case y:case N:case b:return r.value;default:return null}},e.exports.lua_toproxy=function(e,t){var r,n,a,u,s=re(e,t);return r=e.l_G,n=s.type,a=s.value,u=function(e){I(e,e instanceof B.lua_State&&r===e.l_G,"must be from same global state"),e.stack[e.top]=new Z(n,a),W(e)},ke.set(u,r),u},e.exports.lua_tostring=be,e.exports.lua_tothread=function(e,t){var r=re(e,t);return r.ttisthread()?r.value:null},e.exports.lua_touserdata=function(e,t){var r=re(e,t);switch(r.ttnov()){case N:return r.value.data;case b:return r.value;default:return null}},e.exports.lua_type=Ee,e.exports.lua_typename=function(e,t){return I(e,k<=t&&t0&&r<=u.nupvalues,"invalid upvalue index"),u.upvalue[r-1];default:return I(e,!1,"closure expected"),null}},e.exports.lua_upvaluejoin=function(e,t,r,n,a){var u=Re(e,t,r),s=Re(e,n,a),o=s.f.upvals[s.i];u.f.upvals[u.i]=o},e.exports.lua_version=function(e){return null===e?_:e.l_G.version},e.exports.lua_xmove=function(e,t,r){if(e!==t){Q(e,r),I(e,e.l_G===t.l_G,"moving among independent states"),I(e,t.ci.top-t.top>=r,"stack overflow"),e.top-=r;for(var n=0;n0?this.buffer[this.off++]:i(this)}}]),e}(),i=function(e){var t=e.reader(e.L,e.data);if(null===t)return-1;s(t instanceof Uint8Array,"Should only load binary of array of bytes");var r=t.length;return 0===r?-1:(e.buffer=t,e.off=0,e.n=r-1,e.buffer[e.off++])};e.exports.EOZ=-1,e.exports.luaZ_buffer=function(e){return e.buffer.subarray(0,e.n)},e.exports.luaZ_buffremove=function(e,t){e.n-=t},e.exports.luaZ_fill=i,e.exports.luaZ_read=function(e,t,r,n){for(;n;){if(0===e.n){if(-1===i(e))return n;e.n++,e.off--}for(var a=n<=e.n?n:e.n,u=0;u=","<=","~=","<<",">>","::","","","","",""].map((function(e,t){return f(e)})),G=a((function e(){u(this,e),this.r=NaN,this.i=NaN,this.ts=null})),K=a((function e(){u(this,e),this.token=NaN,this.seminfo=new G})),F=a((function e(){u(this,e),this.current=NaN,this.linenumber=NaN,this.lastline=NaN,this.t=new K,this.lookahead=new K,this.fs=null,this.L=null,this.z=null,this.buff=null,this.h=null,this.dyd=null,this.source=null,this.envn=null})),j=function(e,t){var r=e.buff;if(r.n+1>r.buffer.length){r.buffer.length>=v/2&&ee(e,f("lexical element too long",!0),0);var n=2*r.buffer.length;C(e.L,r,n)}r.buffer[r.n++]=t<0?255+t+1:t},H=function(e,t){if(t<257)return O.luaO_pushfstring(e.L,f("'%c'",!0),t);var r=B[t-257];return t<289?O.luaO_pushfstring(e.L,f("'%s'",!0),r):r},X=function(e){return 10===e.current||13===e.current},z=function(e){e.current=e.z.zgetc()},Y=function(e){j(e,e.current),z(e)},J=new O.TValue(l,!0),Z=function(e,t){var r=e.L,n=N(r,t),a=e.h.strong.get(y(n));if(a)n=a.key.tsvalue();else{var u=new O.TValue(i,n);R.luaH_setfrom(r,e.h,u,J)}return n},q=function(e){var t=e.current;h(X(e)),z(e),X(e)&&e.current!==t&&z(e),++e.linenumber>=v&&ee(e,f("chunk has too many lines",!0),0)},W=function(e,t){return e.current===t&&(z(e),!0)},Q=function(e,t){return(e.current===t[0].charCodeAt(0)||e.current===t[1].charCodeAt(0))&&(Y(e),!0)},$=function(e,t){var r="Ee",n=e.current;for(h(g(e.current)),Y(e),48===n&&Q(e,"xX")&&(r="Pp");;)if(Q(e,r)&&Q(e,"-+"),k(e.current))Y(e);else{if(46!==e.current)break;Y(e)}var a=new O.TValue;return 0===O.luaO_str2num(I(e.buff),a)&&ee(e,f("malformed number",!0),290),a.ttisinteger()?(t.i=a.value,291):(h(a.ttisfloat()),t.r=a.value,290)},ee=function(e,t,r){t=d.luaG_addinfo(e.L,t,e.source,e.linenumber),r&&O.luaO_pushfstring(e.L,f("%s near %s"),t,function(e,t){switch(t){case 292:case 293:case 290:case 291:return O.luaO_pushfstring(e.L,f("'%s'",!0),I(e.buff));default:return H(e,t)}}(e,r)),L.luaD_throw(e.L,c)},te=function(e){var t=0,r=e.current;for(h(91===r||93===r),Y(e);61===e.current;)Y(e),t++;return e.current===r?t:-t-1},re=function(e,t,r){var n=e.linenumber;Y(e),X(e)&&q(e);for(var a=!1;!a;)switch(e.current){case S:var u="unfinished long ".concat(t?"string":"comment"," (starting at line ").concat(n,")");ee(e,f(u),289);break;case 93:te(e)===r&&(Y(e),a=!0);break;case 10:case 13:j(e,10),q(e),t||P(e.buff);break;default:t?Y(e):z(e)}t&&(t.ts=Z(e,e.buff.buffer.subarray(2+r,e.buff.n-(2+r))))},ne=function(e,t,r){t||(e.current!==S&&Y(e),ee(e,r,293))},ae=function(e){return Y(e),ne(e,k(e.current),f("hexadecimal digit expected",!0)),O.luaO_hexavalue(e.current)},ue=function(e){var t=ae(e);return t=(t<<4)+ae(e),M(e.buff,2),t},se=function(e){for(var t=new Uint8Array(O.UTF8BUFFSZ),r=O.luaO_utf8esc(t,function(e){var t=4;Y(e),ne(e,123===e.current,f("missing '{'",!0));var r=ae(e);for(Y(e);k(e.current);)t++,r=(r<<4)+O.luaO_hexavalue(e.current),ne(e,r<=1114111,f("UTF-8 value too large",!0)),Y(e);return ne(e,125===e.current,f("missing '}'",!0)),z(e),M(e.buff,t),r}(e));r>0;r--)j(e,t[O.UTF8BUFFSZ-r])},oe=function(e){var t,r=0;for(t=0;t<3&&g(e.current);t++)r=10*r+e.current-48,Y(e);return ne(e,r<=255,f("decimal escape too large",!0)),M(e.buff,t),r},le=function(e,t,r){for(Y(e);e.current!==t;)switch(e.current){case S:ee(e,f("unfinished string",!0),289);break;case 10:case 13:ee(e,f("unfinished string",!0),293);break;case 92:Y(e);var n=void 0,a=void 0;switch(e.current){case 97:a=7,n="read_save";break;case 98:a=8,n="read_save";break;case 102:a=12,n="read_save";break;case 110:a=10,n="read_save";break;case 114:a=13,n="read_save";break;case 116:a=9,n="read_save";break;case 118:a=11,n="read_save";break;case 120:a=ue(e),n="read_save";break;case 117:se(e),n="no_save";break;case 10:case 13:q(e),a=10,n="only_save";break;case 92:case 34:case 39:a=e.current,n="read_save";break;case S:n="no_save";break;case 122:for(M(e.buff,1),z(e);x(e.current);)X(e)?q(e):z(e);n="no_save";break;default:ne(e,g(e.current),f("invalid escape sequence",!0)),a=oe(e),n="only_save"}"read_save"===n&&z(e),"read_save"!==n&&"only_save"!==n||(M(e.buff,1),j(e,a));break;default:Y(e)}Y(e),r.ts=Z(e,e.buff.buffer.subarray(1,e.buff.n-1))},ie=Object.create(null);B.forEach((function(e,t){return ie[U(e)]=t}));var ce=function(e,t){for(P(e.buff);;)switch(h("number"==typeof e.current),e.current){case 10:case 13:q(e);break;case 32:case 12:case 9:case 11:z(e);break;case 45:if(z(e),45!==e.current)return 45;if(z(e),91===e.current){var r=te(e);if(P(e.buff),r>=0){re(e,null,r),P(e.buff);break}}for(;!X(e)&&e.current!==S;)z(e);break;case 91:var n=te(e);return n>=0?(re(e,t,n),293):(-1!==n&&ee(e,f("invalid long string delimiter",!0),293),91);case 61:return z(e),W(e,61)?282:61;case 60:return z(e),W(e,61)?284:W(e,60)?286:60;case 62:return z(e),W(e,61)?283:W(e,62)?287:62;case 47:return z(e),W(e,47)?279:47;case 126:return z(e),W(e,61)?285:126;case 58:return z(e),W(e,58)?288:58;case 34:case 39:return le(e,e.current,t),293;case 46:return Y(e),W(e,46)?W(e,46)?281:280:g(e.current)?$(e,t):46;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return $(e,t);case S:return 289;default:if(T(e.current)){do{Y(e)}while(b(e.current));var a=Z(e,I(e.buff));t.ts=a;var u=ie[y(a)];return void 0!==u&&u<=22?u+257:292}var s=e.current;return z(e),s}};e.exports.FIRST_RESERVED=257,e.exports.LUA_ENV=D,e.exports.LexState=F,e.exports.RESERVED=V,e.exports.isreserved=function(e){var t=ie[y(e)];return void 0!==t&&t<=22},e.exports.luaX_lookahead=function(e){return h(289===e.lookahead.token),e.lookahead.token=ce(e,e.lookahead.seminfo),e.lookahead.token},e.exports.luaX_newstring=Z,e.exports.luaX_next=function(e){e.lastline=e.linenumber,289!==e.lookahead.token?(e.t.token=e.lookahead.token,e.t.seminfo.i=e.lookahead.seminfo.i,e.t.seminfo.r=e.lookahead.seminfo.r,e.t.seminfo.ts=e.lookahead.seminfo.ts,e.lookahead.token=289):e.t.token=ce(e,e.t.seminfo)},e.exports.luaX_setinput=function(e,t,r,n,a){t.t={token:0,seminfo:new G},t.L=e,t.current=a,t.lookahead={token:289,seminfo:new G},t.z=r,t.fs=null,t.linenumber=1,t.lastline=1,t.source=n,t.envn=m(e,D),C(e,t.buff,p)},e.exports.luaX_syntaxerror=function(e,t){ee(e,t,e.t.token)},e.exports.luaX_token2str=H,e.exports.luaX_tokens=B},function(e,t,r){"use strict";var n=(0,r(1).luastring_of)(0,0,0,0,0,0,0,0,0,0,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,22,22,22,22,22,22,22,22,22,22,4,4,4,4,4,4,4,21,21,21,21,21,21,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,4,4,4,5,4,21,21,21,21,21,21,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);e.exports.lisdigit=function(e){return 0!=(2&n[e+1])},e.exports.lislalnum=function(e){return 0!=(3&n[e+1])},e.exports.lislalpha=function(e){return 0!=(1&n[e+1])},e.exports.lisprint=function(e){return 0!=(4&n[e+1])},e.exports.lisspace=function(e){return 0!=(8&n[e+1])},e.exports.lisxdigit=function(e){return 0!=(16&n[e+1])}},function(e,t,r){"use strict";function n(e,t){for(var r=0;rr&&function(e,t,r){var n=e.ls.L,a=e.f.linedefined,u=0===a?l("main function",!0):Re.luaO_pushfstring(n,l("function at line %d",!0),a),s=Re.luaO_pushfstring(n,l("too many %s (limit is %d) in %s",!0),r,t,u);Ee.luaX_syntaxerror(e.ls,s)}(e,r,n)},ht=function(e,t){return e.t.token===t&&(Ee.luaX_next(e),!0)},dt=function(e,t){e.t.token!==t&&pt(e,t)},Lt=function(e,t){dt(e,t),Ee.luaX_next(e)},At=function(e,t,r){t||Ee.luaX_syntaxerror(e,r)},gt=function(e,t,r,n){ht(e,t)||(n===e.linenumber?pt(e,t):Ee.luaX_syntaxerror(e,Re.luaO_pushfstring(e.L,l("%s expected (to close %s at line %d)"),Ee.luaX_token2str(e,t),Ee.luaX_token2str(e,r),n)))},bt=function(e){dt(e,tt.TK_NAME);var t=e.t.seminfo.ts;return Ee.luaX_next(e),t},Tt=function(e,t,r){e.f=e.t=B,e.k=t,e.u.info=r},xt=function(e,t,r){Tt(t,ut.VK,xe(e.fs,r))},kt=function(e,t){xt(e,t,bt(e))},Ot=function(e,t){var r=e.fs,n=e.dyd,a=function(e,t){var r=e.fs,n=r.f;return n.locvars[r.nlocvars]=new Re.LocVar,n.locvars[r.nlocvars].varname=t,r.nlocvars++}(e,t);vt(r,n.actvar.n+1-r.firstlocal,200,l("local variables",!0)),n.actvar.arr[n.actvar.n]=new lt,n.actvar.arr[n.actvar.n].idx=a,n.actvar.n++},Et=function(e,t){Ot(e,Ee.luaX_newstring(e,l(t,!0)))},mt=function(e,t){var r=e.ls.dyd.actvar.arr[e.firstlocal+t].idx;return Ne(r=0;r--)if(nt(t,mt(e,r).varname))return r;return-1}(t,r);if(u>=0)Tt(n,ut.VLOCAL,u),a||function(e,t){for(var r=e.bl;r.nactvar>t;)r=r.previous;r.upval=1}(t,u);else{var s=function(e,t){for(var r=e.f.upvalues,n=0;n1&&ve(a,u-1);else if(n.k!==ut.VVOID&&W(a,n),u>0){var s=a.freereg;ve(a,u),le(a,s,u)}r>t&&(e.fs.freereg-=r-t)},St=function(e){var t=e.L;++t.nCcalls,vt(e.fs,t.nCcalls,Ue,l("JS levels",!0))},It=function(e){return e.L.nCcalls--},Mt=function(e,t,r){var n=e.fs,a=e.dyd.gt,u=a.arr[t];if(Ne(nt(u.name,r.name)),u.nactvar at line %d jumps into the scope of local '%s'"),u.name.getstr(),u.line,s.getstr());_t(e,o)}ce(n,u.pc,r.pc);for(var i=t;is.nactvar&&(r.upval||n.label.n>r.firstlabel)&&ie(e.fs,a.pc,s.nactvar),Mt(e,t,s),!0}return!1},Ct=function(e,t,r,n,a){var u=t.n;return t.arr[u]=new it,t.arr[u].name=r,t.arr[u].line=n,t.arr[u].nactvar=e.fs.nactvar,t.arr[u].pc=a,t.n=u+1,u},Dt=function(e,t){for(var r=e.dyd.gt,n=e.fs.bl.firstgoto;nt;)mt(e,--e.nactvar).endpc=e.pc}(e,t.nactvar),Ne(t.nactvar===e.nactvar),e.freereg=e.nactvar,r.dyd.label.n=t.firstlabel,t.previous?function(e,t){for(var r=t.firstgoto,n=e.ls.dyd.gt;rt.nactvar&&(t.upval&&ie(e,a.pc,t.nactvar),a.nactvar=t.nactvar),Pt(e.ls,r)||r++}}(e,t):t.firstgoto at line %d not inside a loop":"no visible label '%s' for at line %d";r=Re.luaO_pushfstring(e.L,l(r),t.name.getstr(),t.line),_t(e,r)}(r,r.dyd.gt.arr[t.firstgoto])},Kt=function(e){var t=e.fs;he(t,0,0),Gt(t),Ne(null===t.bl),e.fs=t.prev},Ft=function(e,t){switch(e.t.token){case tt.TK_ELSE:case tt.TK_ELSEIF:case tt.TK_END:case tt.TK_EOS:return!0;case tt.TK_UNTIL:return t;default:return!1}},jt=function(e){for(;!Ft(e,1);){if(e.t.token===tt.TK_RETURN)return void dr(e);dr(e)}},Ht=function(e,t){var r=e.fs,n=new st;q(r,t),Ee.luaX_next(e),kt(e,n),ne(r,t,n)},Xt=function(e,t){Ee.luaX_next(e),ar(e,t),Q(e.fs,t),Lt(e,93)},zt=a((function e(){u(this,e),this.v=new st,this.t=new st,this.nh=NaN,this.na=NaN,this.tostore=NaN})),Yt=function(e,t){var r=e.fs,n=e.fs.freereg,a=new st,u=new st;e.t.token===tt.TK_NAME?(vt(r,t.nh,ye,l("items in a constructor",!0)),kt(e,a)):Xt(e,a),t.nh++,Lt(e,61);var s=J(r,a);ar(e,u),F(r,Ge,t.t.u.info,s,J(r,u)),r.freereg=n},Jt=function(e,t){t.v.k!==ut.VVOID&&(W(e,t.v),t.v.k=ut.VVOID,t.tostore===Xe&&(Le(e,t.t.u.info,t.na,t.tostore),t.tostore=0))},Zt=function(e,t){ar(e,t.v),vt(e.fs,t.na,ye,l("items in a constructor",!0)),t.na++,t.tostore++},qt=function(e,t){switch(e.t.token){case tt.TK_NAME:61!==Ee.luaX_lookahead(e)?Zt(e,t):Yt(e,t);break;case 91:Yt(e,t);break;default:Zt(e,t)}},Wt=function(e,t){var r=e.fs,n=e.linenumber,a=F(r,Be,0,0,0),u=new zt;u.na=u.nh=u.tostore=0,u.t=t,Tt(t,ut.VRELOCABLE,a),Tt(u.v,ut.VVOID,0),W(e.fs,t),Lt(e,123);do{if(Ne(u.v.k===ut.VVOID||u.tostore>0),125===e.t.token)break;Jt(r,u),qt(e,u)}while(ht(e,44)||ht(e,59));gt(e,125,123,n),function(e,t){0!==t.tostore&&(rt(t.v.k)?(Ae(e,t.v),Le(e,t.t.u.info,t.na,o),t.na--):(t.v.k!==ut.VVOID&&W(e,t.v),Le(e,t.t.u.info,t.na,t.tostore)))}(r,u),ze(r.f.code[a],Re.luaO_int2fb(u.na)),Ye(r.f.code[a],Re.luaO_int2fb(u.nh))},Qt=function(e,t,r,n){var a=new ot,u=new at;a.f=function(e){var t=e.L,r=new et(t),n=e.fs;return n.f.p[n.np++]=r,r}(e),a.f.linedefined=n,Bt(e,a,u),Lt(e,40),r&&(Et(e,"self"),Ut(e,1)),function(e){var t=e.fs,r=t.f,n=0;if(r.is_vararg=!1,41!==e.t.token)do{switch(e.t.token){case tt.TK_NAME:Ot(e,bt(e)),n++;break;case tt.TK_DOTS:Ee.luaX_next(e),r.is_vararg=!0;break;default:Ee.luaX_syntaxerror(e,l(" or '...' expected",!0))}}while(!r.is_vararg&&ht(e,44));Ut(e,n),r.numparams=t.nactvar,ve(t,t.nactvar)}(e),Lt(e,41),jt(e),a.f.lastlinedefined=e.linenumber,gt(e,tt.TK_END,tt.TK_FUNCTION,n),function(e,t){var r=e.fs.prev;Tt(t,ut.VRELOCABLE,j(r,Me,0,r.np-1)),W(r,t)}(e,t),Kt(e)},$t=function(e,t){var r=1;for(ar(e,t);ht(e,44);)W(e.fs,t),ar(e,t),r++;return r},er=function(e,t,r){var n,a=e.fs,u=new st;switch(e.t.token){case 40:Ee.luaX_next(e),41===e.t.token?u.k=ut.VVOID:($t(e,u),Ae(a,u)),gt(e,41,40,r);break;case 123:Wt(e,u);break;case tt.TK_STRING:xt(e,u,e.t.seminfo.ts),Ee.luaX_next(e);break;default:Ee.luaX_syntaxerror(e,l("function arguments expected",!0))}Ne(t.k===ut.VNONRELOC);var s=t.u.info;rt(u.k)?n=o:(u.k!==ut.VVOID&&W(a,u),n=a.freereg-(s+1)),Tt(t,ut.VCALL,F(a,Ie,s,n+1,2)),$(a,r),a.freereg=s+1},tr=function(e,t){var r=e.fs,n=e.linenumber;for(!function(e,t){switch(e.t.token){case 40:var r=e.linenumber;return Ee.luaX_next(e),ar(e,t),gt(e,41,40,r),void Y(e.fs,t);case tt.TK_NAME:return void Rt(e,t);default:Ee.luaX_syntaxerror(e,l("unexpected symbol",!0))}}(e,t);;)switch(e.t.token){case 46:Ht(e,t);break;case 91:var a=new st;q(r,t),Xt(e,a),ne(r,t,a);break;case 58:var u=new st;Ee.luaX_next(e),kt(e,u),de(r,t,u),er(e,t,n);break;case 40:case tt.TK_STRING:case 123:W(r,t),er(e,t,n);break;default:return}},rr=[{left:10,right:10},{left:10,right:10},{left:11,right:11},{left:11,right:11},{left:14,right:13},{left:11,right:11},{left:11,right:11},{left:6,right:6},{left:4,right:4},{left:5,right:5},{left:7,right:7},{left:7,right:7},{left:9,right:8},{left:3,right:3},{left:3,right:3},{left:3,right:3},{left:3,right:3},{left:3,right:3},{left:3,right:3},{left:2,right:2},{left:1,right:1}],nr=function e(t,r,n){St(t);var a=function(e){switch(e){case tt.TK_NOT:return D;case 45:return C;case 126:return M;case 35:return P;default:return V}}(t.t.token);if(a!==V){var u=t.linenumber;Ee.luaX_next(t),e(t,r,12),pe(t.fs,a,r,u)}else!function(e,t){switch(e.t.token){case tt.TK_FLT:Tt(t,ut.VKFLT,0),t.u.nval=e.t.seminfo.r;break;case tt.TK_INT:Tt(t,ut.VKINT,0),t.u.ival=e.t.seminfo.i;break;case tt.TK_STRING:xt(e,t,e.t.seminfo.ts);break;case tt.TK_NIL:Tt(t,ut.VNIL,0);break;case tt.TK_TRUE:Tt(t,ut.VTRUE,0);break;case tt.TK_FALSE:Tt(t,ut.VFALSE,0);break;case tt.TK_DOTS:var r=e.fs;At(e,r.f.is_vararg,l("cannot use '...' outside a vararg function",!0)),Tt(t,ut.VVARARG,F(r,He,0,1,0));break;case 123:return void Wt(e,t);case tt.TK_FUNCTION:return Ee.luaX_next(e),void Qt(e,t,0,e.linenumber);default:return void tr(e,t)}Ee.luaX_next(e)}(t,r);for(var s=function(e){switch(e){case 43:return f;case 45:return S;case 42:return E;case 37:return O;case 94:return N;case 47:return L;case tt.TK_IDIV:return T;case 38:return p;case 124:return v;case 126:return h;case tt.TK_SHL:return R;case tt.TK_SHR:return w;case tt.TK_CONCAT:return d;case tt.TK_NE:return m;case tt.TK_EQ:return A;case 60:return k;case tt.TK_LE:return x;case 62:return b;case tt.TK_GE:return g;case tt.TK_AND:return _;case tt.TK_OR:return y;default:return U}}(t.t.token);s!==U&&rr[s].left>n;){var o=new st,i=t.linenumber;Ee.luaX_next(t),ae(t.fs,s,r);var c=e(t,o,rr[s].right);_e(t.fs,s,r,o,i),s=c}return It(t),s},ar=function(e,t){nr(e,t,0)},ur=function(e){var t=e.fs,r=new at;Vt(t,r,0),jt(e),Gt(t)},sr=a((function e(){u(this,e),this.prev=null,this.v=new st})),or=function e(t,r,n){var a,u=new st;if(At(t,(a=r.v.k,ut.VLOCAL<=a&&a<=ut.VINDEXED),l("syntax error",!0)),ht(t,44)){var s=new sr;s.prev=r,tr(t,s.v),s.v.k!==ut.VINDEXED&&function(e,t,r){for(var n=e.fs,a=n.freereg,u=!1;t;t=t.prev)t.v.k===ut.VINDEXED&&(t.v.u.ind.vt===r.k&&t.v.u.ind.t===r.u.info&&(u=!0,t.v.u.ind.vt=ut.VLOCAL,t.v.u.ind.t=a),r.k===ut.VLOCAL&&t.v.u.ind.idx===r.u.info&&(u=!0,t.v.u.ind.idx=a));if(u){var s=r.k===ut.VLOCAL?Ve:De;F(n,s,a,r.u.info,0),ve(n,1)}}(t,r,s.v),vt(t.fs,n+t.L.nCcalls,Ue,l("JS levels",!0)),e(t,s,n+1)}else{Lt(t,61);var o=$t(t,u);if(o===n)return ge(t.fs,u),void Te(t.fs,r.v,u);wt(t,n,o,u)}Tt(u,ut.VNONRELOC,t.fs.freereg-1),Te(t.fs,r.v,u)},lr=function(e){var t=new st;return ar(e,t),t.k===ut.VNIL&&(t.k=ut.VFALSE),re(e.fs,t),t.f},ir=function(e,t){var r,n=e.linenumber;ht(e,tt.TK_GOTO)?r=bt(e):(Ee.luaX_next(e),r=Qe(e.L,"break"));var a=Ct(e,e.dyd.gt,r,n,t);Pt(e,a)},cr=function(e,t,r){var n,a=e.fs,u=e.dyd.label;!function(e,t,r){for(var n=e.bl.firstlabel;n=e.fs.freereg&&e.fs.freereg>=e.fs.nactvar),e.fs.freereg=e.fs.nactvar,It(e)};e.exports.Dyndata=ft,e.exports.expkind=ut,e.exports.expdesc=st,e.exports.luaY_parser=function(e,t,r,n,a,u){var s,o,l,i,c=new Ee.LexState,f=new ot,_=Oe.luaF_newLclosure(e,1);return ke.luaD_inctop(e),e.stack[e.top-1].setclLvalue(_),c.h=$e.luaH_new(e),ke.luaD_inctop(e),e.stack[e.top-1].sethvalue(c.h),f.f=_.p=new et(e),f.f.source=We(e,a),c.buff=r,c.dyd=n,n.actvar.n=n.gt.n=n.label.n=0,Ee.luaX_setinput(e,c,t,f.f.source,u),s=c,o=f,l=new at,i=new st,Bt(s,o,l),o.f.is_vararg=!0,Tt(i,ut.VLOCAL,0),yt(o,s.envn,i),Ee.luaX_next(s),jt(s),dt(s,tt.TK_EOS),Kt(s),Ne(!f.prev&&1===f.nups&&!c.fs),Ne(0===n.actvar.n&&0===n.gt.n&&0===n.label.n),delete e.stack[--e.top],_},e.exports.vkisinreg=function(e){return e===ut.VNONRELOC||e===ut.VLOCAL}},function(e,t,r){"use strict";var n,a,u=r(2),s=u.LUA_MULTRET,o=u.LUA_OK,l=u.LUA_TFUNCTION,i=u.LUA_TNIL,c=u.LUA_TNONE,f=u.LUA_TNUMBER,_=u.LUA_TSTRING,p=u.LUA_TTABLE,v=u.LUA_VERSION,h=u.LUA_YIELD,d=u.lua_call,L=u.lua_callk,A=u.lua_concat,g=u.lua_error,b=u.lua_getglobal,T=u.lua_geti,x=u.lua_getmetatable,k=u.lua_gettop,O=u.lua_insert,E=u.lua_isnil,m=u.lua_isnone,U=u.lua_isstring,y=u.lua_load,N=u.lua_next,R=u.lua_pcallk,w=u.lua_pop,S=u.lua_pushboolean,I=u.lua_pushcfunction,M=u.lua_pushglobaltable,P=u.lua_pushinteger,C=u.lua_pushliteral,D=u.lua_pushnil,V=u.lua_pushstring,B=u.lua_pushvalue,G=u.lua_rawequal,K=u.lua_rawget,F=u.lua_rawlen,j=u.lua_rawset,H=u.lua_remove,X=u.lua_replace,z=u.lua_rotate,Y=u.lua_setfield,J=u.lua_setmetatable,Z=u.lua_settop,q=u.lua_setupvalue,W=u.lua_stringtonumber,Q=u.lua_toboolean,$=u.lua_tolstring,ee=u.lua_tostring,te=u.lua_type,re=u.lua_typename,ne=r(7),ae=ne.luaL_argcheck,ue=ne.luaL_checkany,se=ne.luaL_checkinteger,oe=ne.luaL_checkoption,le=ne.luaL_checkstack,ie=ne.luaL_checktype,ce=ne.luaL_error,fe=ne.luaL_getmetafield,_e=ne.luaL_loadbufferx,pe=ne.luaL_loadfile,ve=ne.luaL_loadfilex,he=ne.luaL_optinteger,de=ne.luaL_optstring,Le=ne.luaL_setfuncs,Ae=ne.luaL_tolstring,ge=ne.luaL_where,be=r(5),Te=be.to_jsstring,xe=be.to_luastring;if("function"==typeof TextDecoder){var ke="",Oe=new TextDecoder("utf-8");n=function(e){ke+=Oe.decode(e,{stream:!0})};var Ee=new Uint8Array(0);a=function(){ke+=Oe.decode(Ee),console.log(ke),ke=""}}else{var me=[];n=function(e){try{e=Te(e)}catch(r){var t=new Uint8Array(e.length);t.set(e),e=t}me.push(e)},a=function(){console.log.apply(console.log,me),me=[]}}var Ue=["stop","restart","collect","count","step","setpause","setstepmul","isrunning"].map((function(e){return xe(e)})),ye=function(e){return ie(e,1,p),Z(e,2),N(e,1)?2:(D(e),1)},Ne=function(e){var t=se(e,2)+1;return P(e,t),T(e,1,t)===i?1:2},Re=function(e){var t=he(e,2,1);return Z(e,1),te(e,1)===_&&t>0&&(ge(e,t),B(e,1),A(e,2)),g(e)},we=function(e,t,r){return t!==o&&t!==h?(S(e,0),B(e,-2),2):k(e)-r},Se=function(e,t,r){return t===o?(0!==r&&(B(e,r),q(e,-2,1)||w(e,1)),1):(D(e),O(e,-2),2)},Ie=function(e,t){return le(e,2,"too many nested functions"),B(e,1),d(e,0,1),E(e,-1)?(w(e,1),null):(U(e,-1)||ce(e,xe("reader function must return a string")),X(e,5),ee(e,5))},Me=function(e,t,r){return k(e)-1},Pe={assert:function(e){return Q(e,1)?k(e):(ue(e,1),H(e,1),C(e,"assertion failed!"),Z(e,1),Re(e))},collectgarbage:function(e){oe(e,1,"collect",Ue),he(e,2,0),ce(e,xe("lua_gc not implemented"))},dofile:function(e){var t=de(e,1,null);return Z(e,1),pe(e,t)!==o?g(e):(L(e,0,s,0,Me),Me(e))},error:Re,getmetatable:function(e){return ue(e,1),x(e,1)?(fe(e,1,xe("__metatable",!0)),1):(D(e),1)},ipairs:function(e){return ue(e,1),I(e,Ne),B(e,1),P(e,0),3},load:function(e){var t,r=ee(e,1),n=de(e,3,"bt"),a=m(e,4)?0:4;if(null!==r){var u=de(e,2,r);t=_e(e,r,r.length,u,n)}else{var s=de(e,2,"=(load)");ie(e,1,l),Z(e,5),t=y(e,Ie,null,s,n)}return Se(e,t,a)},loadfile:function(e){var t=de(e,1,null),r=de(e,2,null),n=m(e,3)?0:3,a=ve(e,t,r);return Se(e,a,n)},next:ye,pairs:function(e){return function(e,t,r,n){return ue(e,1),fe(e,1,t)===i?(I(e,n),B(e,1),r?P(e,0):D(e)):(B(e,1),d(e,1,3)),3}(e,xe("__pairs",!0),0,ye)},pcall:function(e){ue(e,1),S(e,1),O(e,1);var t=R(e,k(e)-2,s,0,0,we);return we(e,t,0)},print:function(e){var t=k(e);b(e,xe("tostring",!0));for(var r=1;r<=t;r++){B(e,-1),B(e,r),d(e,1,1);var u=$(e,-1);if(null===u)return ce(e,xe("'tostring' must return a string to 'print'"));r>1&&n(xe("\t")),n(u),w(e,1)}return a(),0},rawequal:function(e){return ue(e,1),ue(e,2),S(e,G(e,1,2)),1},rawget:function(e){return ie(e,1,p),ue(e,2),Z(e,2),K(e,1),1},rawlen:function(e){var t=te(e,1);return ae(e,t===p||t===_,1,"table or string expected"),P(e,F(e,1)),1},rawset:function(e){return ie(e,1,p),ue(e,2),ue(e,3),Z(e,3),j(e,1),1},select:function(e){var t=k(e);if(te(e,1)===_&&35===ee(e,1)[0])return P(e,t-1),1;var r=se(e,1);return r<0?r=t+r:r>t&&(r=t),ae(e,1<=r,1,"index out of range"),t-r},setmetatable:function(e){var t=te(e,2);return ie(e,1,p),ae(e,t===i||t===p,2,"nil or table expected"),fe(e,1,xe("__metatable",!0))!==i?ce(e,xe("cannot change a protected metatable")):(Z(e,2),J(e,1),1)},tonumber:function(e){if(te(e,2)<=0){if(ue(e,1),te(e,1)===f)return Z(e,1),1;var t=ee(e,1);if(null!==t&&W(e,t)===t.length+1)return 1}else{var r=se(e,2);ie(e,1,_);var n=ee(e,1);ae(e,2<=r&&r<=36,2,"base out of range");var a=function(e,t){try{e=Te(e)}catch(e){return null}var r=/^[\t\v\f \n\r]*([+-]?)0*([0-9A-Za-z]+)[\t\v\f \n\r]*$/.exec(e);if(!r)return null;var n=parseInt(r[1]+r[2],t);return isNaN(n)?null:0|n}(n,r);if(null!==a)return P(e,a),1}return D(e),1},tostring:function(e){return ue(e,1),Ae(e,1),1},type:function(e){var t=te(e,1);return ae(e,t!==c,1,"value expected"),V(e,re(e,t)),1},xpcall:function(e){var t=k(e);ie(e,2,l),S(e,1),B(e,1),z(e,3,2);var r=R(e,t-2,s,2,2,we);return we(e,r,2)}};e.exports.luaopen_base=function(e){return M(e),Le(e,Pe,0),B(e,-1),Y(e,-2,xe("_G")),C(e,v),Y(e,-2,xe("_VERSION")),1}},function(e,t,r){"use strict";var n=r(2),a=n.LUA_OK,u=n.LUA_TFUNCTION,s=n.LUA_TSTRING,o=n.LUA_YIELD,l=n.lua_Debug,i=n.lua_checkstack,c=n.lua_concat,f=n.lua_error,_=n.lua_getstack,p=n.lua_gettop,v=n.lua_insert,h=n.lua_isyieldable,d=n.lua_newthread,L=n.lua_pop,A=n.lua_pushboolean,g=n.lua_pushcclosure,b=n.lua_pushliteral,T=n.lua_pushthread,x=n.lua_pushvalue,k=n.lua_resume,O=n.lua_status,E=n.lua_tothread,m=n.lua_type,U=n.lua_upvalueindex,y=n.lua_xmove,N=n.lua_yield,R=r(7),w=R.luaL_argcheck,S=R.luaL_checktype,I=R.luaL_newlib,M=R.luaL_where,P=function(e){var t=E(e,1);return w(e,t,1,"thread expected"),t},C=function(e,t,r){if(!i(t,r))return b(e,"too many arguments to resume"),-1;if(O(t)===a&&0===p(t))return b(e,"cannot resume dead coroutine"),-1;y(e,t,r);var n=k(t,e,r);if(n===a||n===o){var u=p(t);return i(e,u+1)?(y(t,e,u),u):(L(t,u),b(e,"too many results to resume"),-1)}return y(t,e,1),-1},D=function(e){var t=E(e,U(1)),r=C(e,t,p(e));return r<0?(m(e,-1)===s&&(M(e,1),v(e,-2),c(e,2)),f(e)):r},V=function(e){S(e,1,u);var t=d(e);return x(e,1),y(e,t,1),1},B={create:V,isyieldable:function(e){return A(e,h(e)),1},resume:function(e){var t=P(e),r=C(e,t,p(e)-1);return r<0?(A(e,0),v(e,-2),2):(A(e,1),v(e,-(r+1)),r+1)},running:function(e){return A(e,T(e)),2},status:function(e){var t=P(e);if(e===t)b(e,"running");else switch(O(t)){case o:b(e,"suspended");break;case a:var r=new l;_(t,0,r)>0?b(e,"normal"):0===p(t)?b(e,"dead"):b(e,"suspended");break;default:b(e,"dead")}return 1},wrap:function(e){return V(e),g(e,D,1),1},yield:function(e){return N(e,p(e))}};e.exports.luaopen_coroutine=function(e){return I(e,B),1}},function(e,t,r){"use strict";var n=r(3).LUA_MAXINTEGER,a=r(2),u=a.LUA_OPEQ,s=a.LUA_OPLT,o=a.LUA_TFUNCTION,l=a.LUA_TNIL,i=a.LUA_TTABLE,c=a.lua_call,f=a.lua_checkstack,_=a.lua_compare,p=a.lua_createtable,v=a.lua_geti,h=a.lua_getmetatable,d=a.lua_gettop,L=a.lua_insert,A=a.lua_isnil,g=a.lua_isnoneornil,b=a.lua_isstring,T=a.lua_pop,x=a.lua_pushinteger,k=a.lua_pushnil,O=a.lua_pushstring,E=a.lua_pushvalue,m=a.lua_rawget,U=a.lua_setfield,y=a.lua_seti,N=a.lua_settop,R=a.lua_toboolean,w=a.lua_type,S=r(7),I=S.luaL_Buffer,M=S.luaL_addlstring,P=S.luaL_addvalue,C=S.luaL_argcheck,D=S.luaL_buffinit,V=S.luaL_checkinteger,B=S.luaL_checktype,G=S.luaL_error,K=S.luaL_len,F=S.luaL_newlib,j=S.luaL_opt,H=S.luaL_optinteger,X=S.luaL_optlstring,z=S.luaL_pushresult,Y=S.luaL_typename,J=r(17),Z=r(5).to_luastring,q=function(e,t,r){return O(e,t),m(e,-r)!==l},W=function(e,t,r){if(w(e,t)!==i){var n=1;!h(e,t)||1&r&&!q(e,Z("__index",!0),++n)||2&r&&!q(e,Z("__newindex",!0),++n)||4&r&&!q(e,Z("__len",!0),++n)?B(e,t,i):T(e,n)}},Q=function(e,t,r){return W(e,t,4|r),K(e,t)},$=function(e,t,r){v(e,1,r),b(e,-1)||G(e,Z("invalid value (%s) at index %d in table for 'concat'"),Y(e,-1),r),P(t)},ee=function(e,t,r){y(e,1,t),y(e,1,r)},te=function(e,t,r){if(A(e,2))return _(e,t,r,s);E(e,2),E(e,t-1),E(e,r-2),c(e,2,1);var n=R(e,-1);return T(e,1),n},re=function(e,t,r){for(var n=t,a=r-1;;){for(;v(e,1,++n),te(e,-1,-2);)n==r-1&&G(e,Z("invalid order function for sorting")),T(e,1);for(;v(e,1,--a),te(e,-3,-1);)at;n--)v(e,1,n-1),y(e,1,n);break;default:return G(e,"wrong number of arguments to 'insert'")}return y(e,1,t),0},move:function(e){var t=V(e,2),r=V(e,3),a=V(e,4),s=g(e,5)?1:5;if(W(e,1,1),W(e,s,2),r>=t){C(e,t>0||rr||a<=t||1!==s&&1!==_(e,1,s,u))for(var l=0;l=0;i--)v(e,1,t+i),y(e,s,a+i)}return E(e,s),1},pack:function(e){var t=d(e);p(e,t,1),L(e,1);for(var r=t;r>=1;r--)y(e,1,r);return x(e,t),U(e,1,Z("n")),1},remove:function(e){var t=Q(e,1,3),r=H(e,2,t);for(r!==t&&C(e,1<=r&&r<=t+1,1,"position out of bounds"),v(e,1,r);r1&&(C(e,ts&&(a=Math.floor(4294967296*Math.random()))}}(e,1,t,0)),0},unpack:function(e){var t=H(e,2,1),r=j(e,V,3,K(e,1));if(t>r)return 0;var n=r-t;if(n>=Number.MAX_SAFE_INTEGER||!f(e,++n))return G(e,Z("too many results to unpack"));for(;t0?A(r,45):(c=-c,A(r,43)),V(r,Math.floor(c/60),48),V(r,c%60,48)}u+=s}}(e,u,t,r),U(u)}return 1},difftime:function(e){var t=G(e,1),r=G(e,2);return _(e,t-r),1},time:function(e){var t;return l(e,1)?t=new Date:(k(e,1,u),v(e,1),t=new Date(P(e,"year",-1,0),P(e,"month",-1,1),P(e,"day",-1,0),P(e,"hour",12,0),P(e,"min",0,0),P(e,"sec",0,0)),I(e,t)),f(e,Math.floor(t/1e3)),1}};K.clock=function(e){return _(e,performance.now()/1e3),1};e.exports.luaopen_os=function(e){return E(e,K),1}},function(e,t,r){"use strict";function n(e,t){for(var r=0;r-1?t:e.length},Ne=function(e,t){return e>=0?e:0-e>t?0:t+e+1},Re=function(e,t,r,n){return $(n,t,r),0},we=_.length+1,Se=function(e,t,r){var n=function(e){if(Object.is(e,1/0))return me("inf");if(Object.is(e,-1/0))return me("-inf");if(Number.isNaN(e))return me("nan");if(0===e){var t=s(f+"x0p+0",e);return Object.is(e,-0)&&(t="-"+t),me(t)}var r="",n=p(e),a=n[0],u=n[1];return a<0&&(r+="-",a=-a),r+="0x",r+=(2*a).toString(16),r+=s("p%+d",u-=1),me(r)}(r);if(65===t[we])for(var a=0;a=97&&(n[a]=223&u)}else 97!==t[we]&&_e(e,me("modifiers for format '%%a'/'%%A' not implemented"));return n},Ie=me("-+ #0"),Me=function(e){return 97<=e&&e<=122||65<=e&&e<=90},Pe=function(e){return 48<=e&&e<=57},Ce=function(e){return 0<=e&&e<=31||127===e},De=function(e){return 33<=e&&e<=126},Ve=function(e){return 97<=e&&e<=122},Be=function(e){return 65<=e&&e<=90},Ge=function(e){return 97<=e&&e<=122||65<=e&&e<=90||48<=e&&e<=57},Ke=function(e){return De(e)&&!Ge(e)},Fe=function(e){return 32===e||e>=9&&e<=13},je=function(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102},He=function(e,t,r){switch(J(e,r)){case b:var n=z(e,r);!function(e,t,r){Q(e,34);for(var n=0;r--;){if(34===t[n]||92===t[n]||10===t[n])Q(e,92),Q(e,t[n]);else if(Ce(t[n])){var a=""+t[n];Pe(t[n+1])&&(a="0".repeat(3-a.length)+a),te(e,me("\\"+a))}else Q(e,t[n]);n++}Q(e,34)}(t,n,n.length);break;case g:var a;if(U(e,r)){var u=H(e,r);a=me(s(u===c?"0x%"+i+"x":l,u))}else{var o=X(e,r);(function(e){if(Oe(e,46)<0){var t=v(),r=Oe(e,t);r&&(e[r]=46)}})(a=Se(e,me("%".concat(i,"a")),o))}te(t,a);break;case A:case d:ge(e,r),re(t);break;default:ae(e,r,me("value has no literal form"))}},Xe=function(e,t,r,n){for(var a=r;0!==t[a]&&Oe(Ie,t[a])>=0;)a++;a-r>=Ie.length&&_e(e,me("invalid format (repeated flags)")),Pe(t[a])&&a++,Pe(t[a])&&a++,46===t[a]&&(a++,Pe(t[a])&&a++,Pe(t[a])&&a++),Pe(t[a])&&_e(e,me("invalid format (width or precision too long)")),n[0]=37;for(var u=0;u=e.s.length||!Je(e.s[e.off]))return t;var r=0;do{r=10*r+(e.s[e.off++]-48)}while(e.off16||n<=0)&&_e(e.L,me("integral size (%d) out of limits [1,%d]"),n,16),n},We=function(e,t){var r={opt:t.s[t.off++],size:0};switch(r.opt){case 98:return r.size=1,r.opt=0,r;case 66:return r.size=1,r.opt=1,r;case 104:return r.size=2,r.opt=0,r;case 72:return r.size=2,r.opt=1,r;case 108:return r.size=4,r.opt=0,r;case 76:return r.size=4,r.opt=1,r;case 106:return r.size=4,r.opt=0,r;case 74:case 84:return r.size=4,r.opt=1,r;case 102:return r.size=4,r.opt=2,r;case 100:case 110:return r.size=8,r.opt=2,r;case 105:return r.size=qe(e,t,4),r.opt=0,r;case 73:return r.size=qe(e,t,4),r.opt=1,r;case 115:return r.size=qe(e,t,4),r.opt=4,r;case 99:return r.size=Ze(t,-1),-1===r.size&&_e(e.L,me("missing size for format option 'c'")),r.opt=3,r;case 122:return r.opt=5,r;case 120:return r.size=1,r.opt=6,r;case 88:return r.opt=7,r;case 32:break;case 60:e.islittle=!0;break;case 62:e.islittle=!1;break;case 61:e.islittle=!0;break;case 33:e.maxalign=qe(e,t,8);break;default:_e(e.L,me("invalid format option '%c'"),r.opt)}return r.opt=8,r},Qe=function(e,t,r){var n={opt:NaN,size:NaN,ntoalign:NaN},a=We(e,r);n.size=a.size,n.opt=a.opt;var u=n.size;if(7===n.opt)if(r.off>=r.s.length||0===r.s[r.off])ae(e.L,1,me("invalid next option for option 'X'"));else{var s=We(e,r);u=s.size,3!==(s=s.opt)&&0!==u||ae(e.L,1,me("invalid next option for option 'X'"))}return u<=1||3===n.opt?n.ntoalign=0:(u>e.maxalign&&(u=e.maxalign),0!=(u&u-1)&&ae(e.L,1,me("format asks for alignment not power of 2")),n.ntoalign=u-(t&u-1)&u-1),n},$e=function(e,t,r,n,a){var u=de(e,n);u[r?0:n-1]=255&t;for(var s=1;s>=8,u[r?s:n-1-s]=255&t;if(a&&n>4)for(var o=4;o=0;o--)u<<=8,u|=t[r?o:n-1-o];if(n<4){if(a){var l=1<<8*n-1;u=(u^l)-l}}else if(n>4)for(var i=!a||u>=0?0:255,c=s;c=n);for(var a=new DataView(new ArrayBuffer(n)),u=0;u=e.src_end)return!1;var a=e.src[t];switch(e.p[r]){case 46:return!0;case Ue:return ut(a,e.p[r+1]);case 91:return st(e,a,r,n-1);default:return e.p[r]===a}},lt=function(e,t,r){if(r>=e.p_end-1&&_e(e.L,me("malformed pattern (missing arguments to '%%b'")),e.src[t]!==e.p[r])return null;for(var n=e.p[r],a=e.p[r+1],u=1;++t=0;){var u=vt(e,t+a,n+1);if(u)return u;a--}return null},ct=function(e,t,r,n){for(;;){var a=vt(e,t,n+1);if(null!==a)return a;if(!ot(e,t,r,n))return null;t++}},ft=function(e,t,r,n){var a,u=e.level;return u>=32&&_e(e.L,me("too many captures")),e.capture[u]=e.capture[u]?e.capture[u]:{},e.capture[u].init=t,e.capture[u].len=n,e.level=u+1,null===(a=vt(e,t,r))&&e.level--,a},_t=function(e,t,r){var n,a=function(e){var t=e.level;for(t--;t>=0;t--)if(-1===e.capture[t].len)return t;return _e(e.L,me("invalid pattern capture"))}(e);return e.capture[a].len=t-e.capture[a].init,null===(n=vt(e,t,r))&&(e.capture[a].len=-1),n},pt=function(e,t,r){r=function(e,t){return(t-=49)<0||t>=e.level||-1===e.capture[t].len?_e(e.L,me("invalid capture index %%%d"),t+1):t}(e,r);var n=e.capture[r].len;return e.src_end-t>=n&&function(e,t,r,n,a){return ke(e.subarray(t,t+a),r.subarray(n,n+a))}(e.src,e.capture[r].init,e.src,t,n)?t+n:null},vt=function e(t,r,n){var a=!1,u=!0;for(0==t.matchdepth--&&_e(t.L,me("pattern too complex"));u||a;)if(u=!1,n!==t.p_end)switch(a?void 0:t.p[n]){case 40:r=41===t.p[n+1]?ft(t,r,n+2,-2):ft(t,r,n+1,-1);break;case 41:r=_t(t,r,n+1);break;case 36:if(n+1!==t.p_end){a=!0;break}r=t.src.length-r==0?r:null;break;case Ue:switch(t.p[n+1]){case 98:null!==(r=lt(t,r,n+2))&&(n+=4,u=!0);break;case 102:n+=2,91!==t.p[n]&&_e(t.L,me("missing '[' after '%%f' in pattern"));var s=at(t,n),o=r===t.src_init?0:t.src[r-1];if(!st(t,o,n,s-1)&&st(t,r===t.src_end?0:t.src[r],n,s-1)){n=s,u=!0;break}r=null;break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:null!==(r=pt(t,r,t.p[n+1]))&&(n+=2,u=!0);break;default:a=!0}break;default:a=!1;var l=at(t,n);if(ot(t,r,n,l))switch(t.p[l]){case 63:var i;null!==(i=e(t,r+1,l+1))?r=i:(n=l+1,u=!0);break;case 43:r++;case 42:r=it(t,r,n,l);break;case 45:r=ct(t,r,n,l);break;default:r++,n=l,u=!0}else{if(42===t.p[l]||63===t.p[l]||45===t.p[l]){n=l+1,u=!0;break}r=null}}return t.matchdepth++,r},ht=function(e,t,r,n){if(t>=e.level)0===t?M(e.L,e.src.subarray(r,n),n-r):_e(e.L,me("invalid capture index %%%d"),t+1);else{var a=e.capture[t].len;-1===a&&_e(e.L,me("unfinished capture")),-2===a?w(e.L,e.capture[t].init-e.src_init+1):M(e.L,e.src.subarray(e.capture[t].init),a)}},dt=function(e,t,r){var n=0===e.level&&e.src.subarray(t)?1:e.level;ie(e.L,n,"too many captures");for(var a=0;aa+1)return P(e),1;if(t&&(j(e,4)||function(e,t){for(var r=0;r>>0,a=t.length;if(0===a)return n;for(;-1!==(n=e.indexOf(t[0],n));n++)if(ke(e.subarray(n,n+a),t))return n;return-1}(r.subarray(s-1),n,0);if(o>-1)return w(e,s+o),w(e,s+o+u-1),2}else{var l=new nt(e),i=s-1,c=94===n[0];c&&(n=n.subarray(1),u--),Lt(l,e,r,a,n,u);do{var f;if(At(l),null!==(f=vt(l,i,0)))return t?(w(e,i+1),w(e,f),dt(l,null,0)+2):dt(l,i,f)}while(i++r&&(a=r),n>a)return 0;if(a-n>=Number.MAX_SAFE_INTEGER)return _e(e,"string slice too long");var u=a-n+1;ie(e,u,"string slice too long");for(var s=0;s=0&&u<=255,"value out of range"),n[a-1]=u}return Ae(r,t),1},dump:function(e){var t=new W,r=j(e,2);return fe(e,1,L),F(e,1),ue(e,t),0!==O(e,Re,t,r)?_e(e,me("unable to dump given function")):(Le(t),1)},find:function(e){return gt(e,1)},format:function(e){var t=m(e),r=1,n=ce(e,r),a=0,u=new W;for(ue(e,u);at&&ae(e,r,me("no value")),a=Xe(e,n,a,o),String.fromCharCode(n[a++])){case"c":Q(u,oe(e,r));break;case"d":case"i":case"o":case"u":case"x":case"X":var l=oe(e,r);ze(o,me(i,!0)),te(u,me(s(String.fromCharCode.apply(String,o),l)));break;case"a":case"A":ze(o,me(i,!0)),te(u,Se(e,o,le(e,r)));break;case"e":case"E":case"f":case"g":case"G":var c=le(e,r);ze(o,me(i,!0)),te(u,me(s(String.fromCharCode.apply(String,o),c)));break;case"q":He(e,u,r);break;case"s":var f=ge(e,r);o.length<=2||0===o[2]?re(u):(ne(e,f.length===ye(f),r,"string contains zeros"),Oe(o,46)<0&&f.length>=100?re(u):(te(u,me(s(String.fromCharCode.apply(String,o),Ee(f)))),N(e,1)));break;default:return _e(e,me("invalid option '%%%c' to 'format'"),n[a-1])}}return Le(u),1},gmatch:function(e){var t=ce(e,1),r=ce(e,2),n=t.length,a=r.length;F(e,2);var u=new bt;return S(e,u),Lt(u.ms,e,t,n,r,a),u.src=0,u.p=0,u.lastmatch=null,R(e,Tt,3),1},gsub:function(e){var t=ce(e,1),r=t.length,n=ce(e,2),a=n.length,u=null,s=J(e,3),o=ve(e,4,r+1),l=94===n[0],i=0,c=new nt(e),f=new W;for(ne(e,s===g||s===b||s===L||s===T,3,"string/function/table expected"),ue(e,f),l&&(n=n.subarray(1),a--),Lt(c,e,t,r,n,a),t=0,n=0;i0;)Q(t,0);switch(a++,o){case 0:var c=oe(e,a);if(l<4){var f=1<<8*l-1;ne(e,-f<=c&&c>>0<1<<8*l,a,"unsigned overflow"),$e(t,_>>>0,r.islittle,l,!1);break;case 2:var p=de(t,l),v=le(e,a),h=new DataView(p.buffer,p.byteOffset,p.byteLength);4===l?h.setFloat32(0,v,r.islittle):h.setFloat64(0,v,r.islittle),ee(t,l);break;case 3:var d=ce(e,a),L=d.length;for(ne(e,L<=l,a,"string longer than given size"),$(t,d,L);L++=4||g<1<<8*l,a,"string length does not fit in given size"),$e(t,g,r.islittle,l,0),$(t,A,g),u+=g;break;case 5:var b=ce(e,a),T=b.length;ne(e,Oe(b,0)<0,a,"strings contains zeros"),$(t,b,T),Q(t,0),u+=T+1;break;case 6:Q(t,0);case 7:case 8:a--}}return Le(t),1},packsize:function(e){for(var t=new Ye(e),r={s:ce(e,1),off:0},n=0;r.off2147483647/n)return _e(e,me("resulting string too large"));for(var s=n*r+(n-1)*u,o=new W,l=se(e,o,s),i=0;n-- >1;)l.set(t,i),i+=r,u>0&&(l.set(a,i),i+=u);l.set(t,i),Ae(o,s)}return 1},reverse:function(e){for(var t=ce(e,1),r=t.length,n=new Uint8Array(r),a=0;ar&&(a=r),n<=a?D(e,t.subarray(n-1,n-1+(a-n+1))):I(e,""),1},unpack:function(e){var t=new Ye(e),r={s:ce(e,1),off:0},n=ce(e,2),a=n.length,u=Ne(ve(e,3,1),a)-1,s=0;for(ne(e,u<=a&&u>=0,3,"initial position out of string");r.offa&&ae(e,2,me("data string too short")),u+=c,ie(e,2,"too many results"),s++,l){case 0:case 1:var f=et(e,n.subarray(u),t.islittle,i,0===l);w(e,f);break;case 2:var _=tt(0,n.subarray(u),t.islittle,i);C(e,_);break;case 3:D(e,n.subarray(u,u+i));break;case 4:var p=et(e,n.subarray(u),t.islittle,i,0);ne(e,u+p+i<=a,2,"data string too short"),D(e,n.subarray(u+i,u+i+p)),u+=p;break;case 5:var v=Oe(n,0,u);-1===v&&(v=n.length-u),D(e,n.subarray(u,v)),u=v+1;break;case 7:case 6:case 8:s--}u+=i}return w(e,u+1),s+1},upper:function(e){for(var t=ce(e,1),r=t.length,n=new Uint8Array(r),a=0;a=0?e:0-e>t?0:t+e+1},R=[255,127,2047,65535],w=function(e,t){var r=e[t],n=0;if(r<128)n=r;else{for(var a=0;64&r;){var u=e[t+ ++a];if(128!=(192&u))return null;n=n<<6|63&u,r<<=1}if(n|=(127&r)<<5*a,a>3||n>1114111||n<=R[a])return null;t+=a}return{code:n,pos:t+1}},S=U("%U"),I=function(e,t){var r=A(e,t);d(e,0<=r&&r<=1114111,t,"value out of range"),s(e,S,r)},M=function(e){var t=b(e,1),r=t.length,n=_(e,2)-1;if(n<0)n=0;else if(n=r)return 0;var a=w(t,n);return null===a||y(t[a.pos])?T(e,U("invalid UTF-8 code")):(o(e,n+1),o(e,a.code),2)},P={char:function(e){var t=a(e);if(1===t)I(e,1);else{var r=new v;L(e,r);for(var n=1;n<=t;n++)I(e,n),h(r);O(r)}return 1},codepoint:function(e){var t=b(e,1),r=N(k(e,2,1),t.length),n=N(k(e,3,r),t.length);if(d(e,r>=1,2,"out of range"),d(e,n<=t.length,3,"out of range"),r>n)return 0;if(n-r>=Number.MAX_SAFE_INTEGER)return T(e,"string slice too long");var a=n-r+1;for(g(e,a,"string slice too long"),a=0,r-=1;r=0?1:t.length+1;if(n=N(k(e,3,n),t.length),d(e,1<=n&&--n<=t.length,3,"position out of range"),0===r)for(;n>0&&y(t[n]);)n--;else if(y(t[n])&&T(e,"initial position is a continuation byte"),r<0)for(;r<0&&n>0;){do{n--}while(n>0&&y(t[n]));r++}else for(r--;r>0&&n=1,1,"value expected");for(var n=2;n<=t;n++)o(e,r,n,u)&&(r=n);return d(e,r),1},min:function(e){var t=l(e),r=1;k(e,t>=1,1,"value expected");for(var n=2;n<=t;n++)o(e,n,r,u)&&(r=n);return d(e,r),1},modf:function(e){if(i(e,1))A(e,1),h(e,0);else{var t=U(e,1),r=t<0?Math.ceil(t):Math.floor(t);D(e,r),h(e,t===r?0:t-r)}return 2},rad:function(e){return h(e,U(e,1)*(Math.PI/180)),1},random:function(e){var t,r,a=void 0===n?Math.random():C()/2147483648;switch(l(e)){case 0:return h(e,a),1;case 1:t=1,r=m(e,1);break;case 2:t=m(e,1),r=m(e,2);break;default:return y(e,"wrong number of arguments")}return k(e,t<=r,1,"interval is empty"),k(e,t>=0||r<=S+t,1,"interval too large"),a*=r-t+1,_(e,Math.floor(a)+t),1},randomseed:function(e){var t;return t=U(e,1),0==(n=0|t)&&(n=1),C(),0},sin:function(e){return h(e,Math.sin(U(e,1))),1},sqrt:function(e){return h(e,Math.sqrt(U(e,1))),1},tan:function(e){return h(e,Math.tan(U(e,1))),1},tointeger:function(e){var t=b(e,1);return!1!==t?_(e,t):(E(e,1),v(e)),1},type:function(e){return T(e,1)===s?i(e,1)?p(e,"integer"):p(e,"float"):(E(e,1),v(e)),1},ult:function(e){var t=m(e,1),r=m(e,2);return f(e,t>=0?r<0||t=0?C(e,t.currentline):B(e),Te.lua_assert(b(e,Oe("lS"),t)),h(e,2,0))},Ce={gethook:function(e){var t=me(e).thread,r=new Uint8Array(5),n=g(t),a=L(t);if(null===a)B(e);else if(a!==Pe)V(e,"external hook");else{F(e,i,Ie),re(e,-1).get(t)(e)}return G(e,function(e,t){var r=0;return e&u&&(t[r++]=99),e&l&&(t[r++]=114),e&o&&(t[r++]=108),t.subarray(0,r)}(n,r)),C(e,A(t)),3},getinfo:function(e){var t=new v,r=me(e),n=r.arg,a=r.thread,u=Ae(e,n+2,"flnStu");if(Ee(e,a,3),y(e,n+1))u=P(e,Oe(">%s"),u),K(e,n+1),se(e,a,1);else if(!k(a,fe(e,n+1),t))return B(e),1;return b(a,u,t)||ie(e,n+2,"invalid option"),w(e),ke(u,83)>-1&&(Ue(e,Oe("source",!0),t.source),Ue(e,Oe("short_src",!0),t.short_src),ye(e,Oe("linedefined",!0),t.linedefined),ye(e,Oe("lastlinedefined",!0),t.lastlinedefined),Ue(e,Oe("what",!0),t.what)),ke(u,108)>-1&&ye(e,Oe("currentline",!0),t.currentline),ke(u,117)>-1&&(ye(e,Oe("nups",!0),t.nups),ye(e,Oe("nparams",!0),t.nparams),Ne(e,Oe("isvararg",!0),t.isvararg)),ke(u,110)>-1&&(Ue(e,Oe("name",!0),t.name),Ue(e,Oe("namewhat",!0),t.namewhat)),ke(u,116)>-1&&Ne(e,Oe("istailcall",!0),t.istailcall),ke(u,76)>-1&&Re(e,a,Oe("activelines",!0)),ke(u,102)>-1&&Re(e,a,Oe("func",!0)),1},getlocal:function(e){var t=me(e),r=t.thread,n=t.arg,a=new v,u=fe(e,n+2);if(y(e,n+1))return K(e,n+1),G(e,T(e,null,u)),1;var s=fe(e,n+1);if(!k(r,s,a))return ie(e,n+1,"level out of range");Ee(e,r,1);var o=T(r,a,u);return o?(se(r,e,1),G(e,o),H(e,-2,1),2):(B(e),1)},getmetatable:function(e){return ce(e,1),x(e,1)||B(e),1},getregistry:function(e){return K(e,i),1},getupvalue:function(e){return we(e,1)},getuservalue:function(e){return ne(e,1)!==p?B(e):E(e,1),1},sethook:function(e){var t,r,n,a,_=me(e),p=_.thread,v=_.arg;if(N(e,v+1))Z(e,v+1),n=null,t=0,r=0;else{var h=_e(e,v+2);pe(e,v+1,c),r=Le(e,v+3,0),n=Pe,t=function(e,t){var r=0;return ke(e,99)>-1&&(r|=u),ke(e,114)>-1&&(r|=l),ke(e,108)>-1&&(r|=o),t>0&&(r|=s),r}(h,r)}F(e,i,Ie)===f?(a=new WeakMap,D(e,a),j(e,i,Ie)):a=re(e,-1);var d=$(e,v+1);return a.set(p,d),z(p,n,t,r),0},setlocal:function(e){var t=me(e),r=t.thread,n=t.arg,a=new v,u=fe(e,n+1),s=fe(e,n+2);if(!k(r,u,a))return ie(e,n+1,"level out of range");ce(e,n+3),Z(e,n+3),Ee(e,r,1),se(e,r,1);var o=Y(r,a,s);return null===o&&I(r,1),G(e,o),1},setmetatable:function(e){var t=ne(e,2);return le(e,t==f||t==_,2,"nil or table expected"),Z(e,2),J(e,1),1},setupvalue:function(e){return ce(e,3),we(e,0)},setuservalue:function(e){return pe(e,1,p),ce(e,2),Z(e,2),W(e,1),1},traceback:function(e){var t=me(e),r=t.thread,n=t.arg,a=ee(e,n+1);if(null!==a||N(e,n+1)){var u=Le(e,n+2,e===r?1:0);ge(e,r,a,u)}else K(e,n+1);return 1},upvalueid:function(e){var t=Se(e,1,2);return D(e,ae(e,1,t)),1},upvaluejoin:function(e){var t=Se(e,1,2),r=Se(e,3,4);return le(e,!U(e,1),1,"Lua function expected"),le(e,!U(e,3),3,"Lua function expected"),ue(e,1,t,3,r),0}};"undefined"!=typeof window&&(n=function(){var e=prompt("lua_debug>","");return null!==e?e:""}),n&&(Ce.debug=function(e){for(;;){var t=n();if("cont"===t)return 0;if(0!==t.length){var r=Oe(t);(he(e,r,r.length,Oe("=(debug command)",!0))||S(e,0,0,0))&&be(Q(e,-1),"\n"),Z(e,0)}}});e.exports.luaopen_debug=function(e){return de(e,Ce),1}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a,u=r(3),s=u.LUA_DIRSEP,o=u.LUA_EXEC_DIR,l=u.LUA_JSPATH_DEFAULT,i=u.LUA_PATH_DEFAULT,c=u.LUA_PATH_MARK,f=u.LUA_PATH_SEP,_=r(2),p=_.LUA_OK,v=_.LUA_REGISTRYINDEX,h=_.LUA_TNIL,d=_.LUA_TTABLE,L=_.lua_callk,A=_.lua_createtable,g=_.lua_getfield,b=_.lua_insert,T=_.lua_isfunction,x=_.lua_isnil,k=_.lua_isstring,O=_.lua_newtable,E=_.lua_pop,m=_.lua_pushboolean,U=_.lua_pushcclosure,y=_.lua_pushcfunction,N=_.lua_pushfstring,R=_.lua_pushglobaltable,w=_.lua_pushlightuserdata,S=_.lua_pushliteral,I=_.lua_pushlstring,M=_.lua_pushnil,P=_.lua_pushstring,C=_.lua_pushvalue,D=_.lua_rawgeti,V=_.lua_rawgetp,B=_.lua_rawseti,G=_.lua_rawsetp,K=_.lua_remove,F=_.lua_setfield,j=_.lua_setmetatable,H=_.lua_settop,X=_.lua_toboolean,z=_.lua_tostring,Y=_.lua_touserdata,J=_.lua_upvalueindex,Z=r(7),q=Z.LUA_LOADED_TABLE,W=Z.LUA_PRELOAD_TABLE,Q=Z.luaL_Buffer,$=Z.luaL_addvalue,ee=Z.luaL_buffinit,te=Z.luaL_checkstring,re=Z.luaL_error,ne=Z.luaL_getsubtable,ae=Z.luaL_gsub,ue=Z.luaL_len,se=Z.luaL_loadfile,oe=Z.luaL_newlib,le=Z.luaL_optstring,ie=Z.luaL_pushresult,ce=Z.luaL_setfuncs,fe=r(17),_e=r(5),pe=_e.luastring_indexOf,ve=_e.to_jsstring,he=_e.to_luastring,de=_e.to_uristring,Le=r(0),Ae="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:(0,eval)("this"),ge=he("__JSLIBS__"),be=s,Te=s,xe=he("luaopen_"),ke=he("_"),Oe=he("");a=function(e,t,r){t=de(t);var a=new XMLHttpRequest;if(a.open("GET",t,!1),a.send(),a.status<200||a.status>=300)return P(e,he("".concat(a.status,": ").concat(a.statusText))),null;var u,s=a.response;/\/\/[#@] sourceURL=/.test(s)||(s+=" //# sourceURL="+t);try{u=Function("fengari",s)}catch(t){return P(e,he("".concat(t.name,": ").concat(t.message))),null}var o=u(Le);return"function"==typeof o||"object"===n(o)&&null!==o?o:void 0===o?Ae:(P(e,he("library returned unexpected type (".concat(n(o),")"))),null)};var Ee;Ee=function(e){e=de(e);var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(),t.status>=200&&t.status<=299};var me=function(e,t,r){var n=Ne(e,t);if(null===n){if(null===(n=a(e,t,r[0]==="*".charCodeAt(0))))return 1;Re(e,t,n)}if(r[0]==="*".charCodeAt(0))return m(e,1),0;var u=function(e,t,r){var n=t[ve(r)];return n&&"function"==typeof n?n:(N(e,he("undefined symbol: %s"),r),null)}(e,n,r);return null===u?2:(y(e,u),0)},Ue=Ae,ye=function(e,t,r,n){var a="".concat(r).concat(fe.LUA_VERSUFFIX);P(e,he(a));var u=Ue[a];void 0===u&&(u=Ue[r]),void 0===u||function(e){g(e,v,he("LUA_NOENV"));var t=X(e,-1);return E(e,1),t}(e)?P(e,n):(u=ae(e,he(u),he(f+f,!0),he(f+ve(Oe)+f,!0)),ae(e,u,Oe,n),K(e,-2)),F(e,-3,t),E(e,1)},Ne=function(e,t){V(e,v,ge),g(e,-1,t);var r=Y(e,-1);return E(e,2),r},Re=function(e,t,r){V(e,v,ge),w(e,r),C(e,-1),F(e,-3,t),B(e,-2,ue(e,-2)+1),E(e,1)},we=function(e,t){for(;t[0]===f.charCodeAt(0);)t=t.subarray(1);if(0===t.length)return null;var r=pe(t,f.charCodeAt(0));return r<0&&(r=t.length),I(e,t,r),t.subarray(r)},Se=function(e,t,r,n,a){var u=new Q;for(ee(e,u),0!==n[0]&&(t=ae(e,t,n,a));null!==(r=we(e,r));){var s=ae(e,z(e,-1),he(c,!0),t);if(K(e,-2),Ee(s))return s;N(e,he("\n\tno file '%s'"),s),K(e,-2),$(u)}return ie(u),null},Ie=function(e,t,r,n){g(e,J(1),r);var a=z(e,-1);return null===a&&re(e,he("'package.%s' must be a string"),r),Se(e,t,a,he("."),n)},Me=function(e,t,r){return t?(P(e,r),2):re(e,he("error loading module '%s' from file '%s':\n\t%s"),z(e,1),r,z(e,-1))},Pe=function(e){var t=te(e,1),r=Ie(e,t,he("path",!0),he(Te,!0));return null===r?1:Me(e,se(e,r)===p,r)},Ce=function(e,t,r){var n;r=ae(e,r,he("."),ke);var a=pe(r,"-".charCodeAt(0));if(a>=0){n=I(e,r,a),n=N(e,he("%s%s"),xe,n);var u=me(e,t,n);if(2!==u)return u;r=a+1}return n=N(e,he("%s%s"),xe,r),me(e,t,n)},De=function(e){var t=te(e,1),r=Ie(e,t,he("jspath",!0),he(be,!0));return null===r?1:Me(e,0===Ce(e,r,t),r)},Ve=function(e){var t,r=te(e,1),n=pe(r,".".charCodeAt(0));if(n<0)return 0;I(e,r,n);var a=Ie(e,z(e,-1),he("jspath",!0),he(be,!0));return null===a?1:0!==(t=Ce(e,a,r))?2!=t?Me(e,0,a):(P(e,he("\n\tno module '%s' in file '%s'"),r,a),1):(P(e,a),2)},Be=function(e){var t=te(e,1);return g(e,v,W),g(e,-1,t)===h&&N(e,he("\n\tno field package.preload['%s']"),t),1},Ge=function e(t,r,n){for(;r===p?(D(t,3,n.i)===h&&(E(t,1),ie(n.msg),re(t,he("module '%s' not found:%s"),n.name,z(t,-1))),P(t,n.name),L(t,1,2,n,e)):r=p,!T(t,-2);n.i++)k(t,-2)?(E(t,1),$(n.msg)):E(t,2);return n.k(t,p,n.ctx)},Ke=function(e,t,r){return P(e,r),b(e,-2),L(e,2,1,r,Fe),Fe(e,p,r)},Fe=function(e,t,r){var n=r;return x(e,-1)||F(e,2,n),g(e,2,n)==h&&(m(e,1),C(e,-1),F(e,2,n)),1},je={loadlib:function(e){var t=te(e,1),r=te(e,2),n=me(e,t,r);return 0===n?1:(M(e),b(e,-2),S(e,1===n?"open":"init"),3)},searchpath:function(e){return null!==Se(e,te(e,1),te(e,2),le(e,3,"."),le(e,4,s))?1:(M(e),b(e,-2),2)}},He={require:function(e){var t=te(e,1);return H(e,1),g(e,v,q),g(e,2,t),X(e,-1)?1:(E(e,1),function(e,t,r,n){var a=new Q;return ee(e,a),g(e,J(1),he("searchers",!0))!==d&&re(e,he("'package.searchers' must be a table")),Ge(e,p,{name:t,i:1,msg:a,ctx:r,k:n})}(e,t,t,Ke))}};e.exports.luaopen_package=function(e){return function(e){O(e),A(e,0,1),j(e,-2),G(e,v,ge)}(e),oe(e,je),function(e){var t=[Be,Pe,De,Ve,null];A(e);for(var r=0;t[r];r++)C(e,-2),U(e,t[r],1),B(e,-2,r+1);F(e,-2,he("searchers",!0))}(e),ye(e,he("path",!0),"LUA_PATH",i),ye(e,he("jspath",!0),"LUA_JSPATH",l),S(e,s+"\n"+f+"\n"+c+"\n"+o+"\n-\n"),F(e,-2,he("config",!0)),ne(e,v,q),F(e,-2,he("loaded",!0)),ne(e,v,W),F(e,-2,he("preload",!0)),R(e),C(e,-2),ce(e,He,1),E(e,1),1}},function(e,t,r){var n=r(2),a=n.lua_pushinteger,u=n.lua_pushliteral,s=n.lua_setfield,o=r(7).luaL_newlib,l=r(5),i=l.FENGARI_AUTHORS,c=l.FENGARI_COPYRIGHT,f=l.FENGARI_RELEASE,_=l.FENGARI_VERSION,p=l.FENGARI_VERSION_MAJOR,v=l.FENGARI_VERSION_MINOR,h=l.FENGARI_VERSION_NUM,d=l.FENGARI_VERSION_RELEASE,L=l.to_luastring;e.exports.luaopen_fengari=function(e){return o(e,{}),u(e,i),s(e,-2,L("AUTHORS")),u(e,c),s(e,-2,L("COPYRIGHT")),u(e,f),s(e,-2,L("RELEASE")),u(e,_),s(e,-2,L("VERSION")),u(e,p),s(e,-2,L("VERSION_MAJOR")),u(e,v),s(e,-2,L("VERSION_MINOR")),a(e,h),s(e,-2,L("VERSION_NUM")),u(e,d),s(e,-2,L("VERSION_RELEASE")),1}},function(e,t,r){"use strict";r.r(t),r.d(t,"L",(function(){return N})),r.d(t,"load",(function(){return R}));var n=r(0);r.d(t,"FENGARI_AUTHORS",(function(){return n.FENGARI_AUTHORS})),r.d(t,"FENGARI_COPYRIGHT",(function(){return n.FENGARI_COPYRIGHT})),r.d(t,"FENGARI_RELEASE",(function(){return n.FENGARI_RELEASE})),r.d(t,"FENGARI_VERSION",(function(){return n.FENGARI_VERSION})),r.d(t,"FENGARI_VERSION_MAJOR",(function(){return n.FENGARI_VERSION_MAJOR})),r.d(t,"FENGARI_VERSION_MINOR",(function(){return n.FENGARI_VERSION_MINOR})),r.d(t,"FENGARI_VERSION_NUM",(function(){return n.FENGARI_VERSION_NUM})),r.d(t,"FENGARI_VERSION_RELEASE",(function(){return n.FENGARI_VERSION_RELEASE})),r.d(t,"luastring_eq",(function(){return n.luastring_eq})),r.d(t,"luastring_indexOf",(function(){return n.luastring_indexOf})),r.d(t,"luastring_of",(function(){return n.luastring_of})),r.d(t,"to_jsstring",(function(){return n.to_jsstring})),r.d(t,"to_luastring",(function(){return n.to_luastring})),r.d(t,"to_uristring",(function(){return n.to_uristring})),r.d(t,"lua",(function(){return n.lua})),r.d(t,"lauxlib",(function(){return n.lauxlib})),r.d(t,"lualib",(function(){return n.lualib}));var a=r(18);r.d(t,"interop",(function(){return a}));var u=n.lua.LUA_ERRRUN,s=n.lua.LUA_ERRSYNTAX,o=n.lua.LUA_OK,l=n.lua.LUA_VERSION_MAJOR,i=n.lua.LUA_VERSION_MINOR,c=n.lua.lua_Debug,f=n.lua.lua_getinfo,_=n.lua.lua_getstack,p=n.lua.lua_gettop,v=n.lua.lua_insert,h=n.lua.lua_pcall,d=n.lua.lua_pop,L=n.lua.lua_pushcfunction,A=n.lua.lua_pushstring,g=n.lua.lua_remove,b=n.lua.lua_setglobal,T=n.lua.lua_tojsstring,x=n.lauxlib.luaL_loadbuffer,k=n.lauxlib.luaL_newstate,O=n.lauxlib.luaL_requiref,E=a.checkjs,m=a.luaopen_js,U=a.push,y=a.tojs,N=k();function R(e,t){if("string"==typeof e)e=Object(n.to_luastring)(e);else if(!(e instanceof Uint8Array))throw new TypeError("expects an array of bytes or javascript string");t=t?Object(n.to_luastring)(t):null;var r,a=x(N,e,null,t);if(r=a===s?new SyntaxError(T(N,-1)):y(N,-1),d(N,1),a!==o)throw r;return r}if(n.lualib.luaL_openlibs(N),O(N,Object(n.to_luastring)("js"),m,1),d(N,1),A(N,Object(n.to_luastring)(n.FENGARI_COPYRIGHT)),b(N,Object(n.to_luastring)("_COPYRIGHT")),"undefined"!=typeof document&&document instanceof HTMLDocument){var w=function(e){switch(e){case"anonymous":return"omit";case"use-credentials":return"include";default:return"same-origin"}},S=function(e){var t=new c;return _(e,2,t)&&f(e,Object(n.to_luastring)("Sl"),t),U(e,new ErrorEvent("error",{bubbles:!0,cancelable:!0,message:T(e,1),error:y(e,1),filename:t.short_src?Object(n.to_jsstring)(t.short_src):void 0,lineno:t.currentline>0?t.currentline:void 0})),1},I=function(e,t,r){var n,a=x(N,t,null,r);if(a===s){var l=T(N,-1),i=e.src?e.src:document.location,c=new SyntaxError(l,i,void 0);n=new ErrorEvent("error",{message:l,error:c,filename:i,lineno:void 0})}else if(a===o){var f=p(N);L(N,S),v(N,f),Object.defineProperty(document,"currentScript",{value:e,configurable:!0}),a=h(N,0,0,f),delete document.currentScript,g(N,f),a===u&&(n=E(N,-1))}a!==o&&(void 0===n&&(n=new ErrorEvent("error",{message:T(N,-1),error:y(N,-1)})),d(N,1),window.dispatchEvent(n)&&console.error("uncaught exception",n.error))},M=function(e,t,r){if(e.status>=200&&e.status<300){var a=e.response;a="string"==typeof a?Object(n.to_luastring)(e.response):new Uint8Array(a),I(t,a,r)}else t.dispatchEvent(new Event("error"))},P=/^(.*?\/.*?)([\t ]*;.*)?$/,C=/^(\d+)\.(\d+)$/,D=function(e){if("SCRIPT"===e.tagName){var t=P.exec(e.type);if(t){var r=t[1];if("application/lua"===r||"text/lua"===r){if(e.hasAttribute("lua-version")){var a=C.exec(e.getAttribute("lua-version"));if(!a||a[1]!==l||a[2]!==i)return}!function(e){if(e.src){var t=Object(n.to_luastring)("@"+e.src);if("complete"===document.readyState||e.async)if("function"==typeof fetch)fetch(e.src,{method:"GET",credentials:w(e.crossorigin),redirect:"follow",integrity:e.integrity}).then((function(e){if(e.ok)return e.arrayBuffer();throw new Error("unable to fetch")})).then((function(r){var n=new Uint8Array(r);I(e,n,t)})).catch((function(t){e.dispatchEvent(new Event("error"))}));else{var r=new XMLHttpRequest;r.open("GET",e.src,!0),r.responseType="arraybuffer",r.onreadystatechange=function(){4===r.readyState&&M(r,e,t)},r.send()}else{var a=new XMLHttpRequest;a.open("GET",e.src,!1),a.send(),M(a,e,t)}}else{var u=Object(n.to_luastring)(e.innerHTML),s=e.id?Object(n.to_luastring)("="+e.id):u;I(e,u,s)}}(e)}}}};"undefined"!=typeof MutationObserver?new MutationObserver((function(e,t){for(var r=0;re.lasttarget&&(n=e.f.code[e.pc-1]).opcode===S.OP_LOADNIL){var u=n.A,s=u+n.B;if(u<=t&&t<=s+1||t<=u&&u<=a+1)return ua&&(a=s),y.SETARG_A(n,t),void y.SETARG_B(n,a-t)}ee(e,S.OP_LOADNIL,t,r-1,0)},B=function(e,t){return e.f.code[t.u.info]},G=function(e,t){var r=e.f.code[t].sBx;return-1===r?-1:t+1+r},K=function(e,t,r){var n=e.f.code[t],a=r-(t+1);E(-1!==r),Math.abs(a)>y.MAXARG_sBx&&m.luaX_syntaxerror(e.ls,O("control structure too long",!0)),y.SETARG_sBx(n,a)},F=function(e,t,r){if(-1===r)return t;if(-1===t)t=r;else{for(var n=t,a=G(e,n);-1!==a;)a=G(e,n=a);K(e,n,r)}return t},j=function(e){var t=e.jpc;e.jpc=-1;var r=re(e,S.OP_JMP,0,-1);return r=F(e,r,t)},H=function(e,t,r,n,a){return ee(e,t,r,n,a),j(e)},X=function(e){return e.lasttarget=e.pc,e.pc},z=function(e,t){return t>=1&&y.testTMode(e.f.code[t-1].opcode)?t-1:t},Y=function(e,t){return e.f.code[z(e,t)]},J=function(e,t,r){var n=z(e,t),a=e.f.code[n];return a.opcode===S.OP_TESTSET&&(r!==y.NO_REG&&r!==a.B?y.SETARG_A(a,r):e.f.code[n]=y.CREATE_ABC(S.OP_TEST,a.B,0,a.C),!0)},Z=function(e,t){for(;-1!==t;t=G(e,t))J(e,t,y.NO_REG)},q=function(e,t,r,n,a){for(;-1!==t;){var u=G(e,t);J(e,t,n)?K(e,t,r):K(e,t,a),t=u}},W=function(e,t){X(e),e.jpc=F(e,e.jpc,t)},Q=function(e,t,r){r===e.pc?W(e,t):(E(re.f.maxstacksize&&(r>=255&&m.luaX_syntaxerror(e.ls,O("function or expression needs too many registers",!0)),e.f.maxstacksize=r)},se=function(e,t){ue(e,t),e.freereg+=t},oe=function(e,t){!y.ISK(t)&&t>=e.nactvar&&(e.freereg--,E(t===e.freereg))},le=function(e,t){t.k===N.expkind.VNONRELOC&&oe(e,t.u.info)},ie=function(e,t,r){var n=t.k===N.expkind.VNONRELOC?t.u.info:-1,a=r.k===N.expkind.VNONRELOC?r.u.info:-1;n>a?(oe(e,n),oe(e,a)):(oe(e,a),oe(e,n))},ce=function(e,t,r){var n=e.f,a=R.luaH_get(e.L,e.ls.h,t);if(a.ttisinteger()){var u=a.value;if(u=e.nactvar)return Te(e,t,t.u.info),t.u.info}return xe(e,t),t.u.info},Oe=function(e,t){C(t)?ke(e,t):de(e,t)},Ee=function(e,t){var r=N.expkind,n=!1;switch(Oe(e,t),t.k){case r.VTRUE:t.u.info=pe(e,!0),n=!0;break;case r.VFALSE:t.u.info=pe(e,!1),n=!0;break;case r.VNIL:t.u.info=function(e){var t=new I(b,null),r=new I(k,e.ls.h);return ce(e,r,t)}(e),n=!0;break;case r.VKINT:t.u.info=fe(e,t.u.ival),n=!0;break;case r.VKFLT:t.u.info=_e(e,t.u.nval),n=!0;break;case r.VK:n=!0}return n&&(t.k=r.VK,t.u.info<=y.MAXINDEXRK)?y.RKASK(t.u.info):ke(e,t)},me=function(e,t){var r=Y(e,t.u.info);E(y.testTMode(r.opcode)&&r.opcode!==S.OP_TESTSET&&r.opcode!==S.OP_TEST),y.SETARG_A(r,!r.A)},Ue=function(e,t,r){if(t.k===N.expkind.VRELOCABLE){var n=B(e,t);if(n.opcode===S.OP_NOT)return e.pc--,H(e,S.OP_TEST,n.B,0,!r)}return ge(e,t),le(e,t),H(e,S.OP_TESTSET,y.NO_REG,t.u.info,r)},ye=function(e,t){var r,n=N.expkind;switch(de(e,t),t.k){case n.VJMP:me(e,t),r=t.u.info;break;case n.VK:case n.VKFLT:case n.VKINT:case n.VTRUE:r=-1;break;default:r=Ue(e,t,0)}t.f=F(e,t.f,r),W(e,t.t),t.t=-1},Ne=function(e,t){var r,n=N.expkind;switch(de(e,t),t.k){case n.VJMP:r=t.u.info;break;case n.VNIL:case n.VFALSE:r=-1;break;default:r=Ue(e,t,1)}t.t=F(e,t.t,r),W(e,t.f),t.f=-1},Re=function(e,t,r){var n,a,u=N.expkind;if(!(n=D(t,!0))||!(a=D(r,!0))||!function(e,t,r){switch(e){case s:case l:case i:case p:case v:case o:return!1!==w.tointeger(t)&&!1!==w.tointeger(r);case c:case f:case _:return 0!==r.value;default:return 1}}(e,n,a))return 0;var h=new I;if(U.luaO_arith(null,e,n,a,h),h.ttisinteger())t.k=u.VKINT,t.u.ival=h.value;else{var d=h.value;if(isNaN(d)||0===d)return!1;t.k=u.VKFLT,t.u.nval=d}return!0},we=function(e,t,r,n,a){var u=Ee(e,n),s=Ee(e,r);ie(e,r,n),r.u.info=ee(e,t,0,s,u),r.k=N.expkind.VRELOCABLE,Se(e,a)},Se=function(e,t){e.f.lineinfo[e.pc-1]=t};e.exports.BinOpr=M,e.exports.NO_JUMP=-1,e.exports.UnOpr=P,e.exports.getinstruction=B,e.exports.luaK_checkstack=ue,e.exports.luaK_code=$,e.exports.luaK_codeABC=ee,e.exports.luaK_codeABx=te,e.exports.luaK_codeAsBx=re,e.exports.luaK_codek=ae,e.exports.luaK_concat=F,e.exports.luaK_dischargevars=de,e.exports.luaK_exp2RK=Ee,e.exports.luaK_exp2anyreg=ke,e.exports.luaK_exp2anyregup=function(e,t){(t.k!==N.expkind.VUPVAL||C(t))&&ke(e,t)},e.exports.luaK_exp2nextreg=xe,e.exports.luaK_exp2val=Oe,e.exports.luaK_fixline=Se,e.exports.luaK_getlabel=X,e.exports.luaK_goiffalse=Ne,e.exports.luaK_goiftrue=ye,e.exports.luaK_indexed=function(e,t,r){var n=N.expkind;E(!C(t)&&(N.vkisinreg(t.k)||t.k===n.VUPVAL)),t.u.ind.t=t.u.info,t.u.ind.idx=Ee(e,r),t.u.ind.vt=t.k===n.VUPVAL?n.VUPVAL:n.VLOCAL,t.k=n.VINDEXED},e.exports.luaK_infix=function(e,t,r){switch(t){case M.OPR_AND:ye(e,r);break;case M.OPR_OR:Ne(e,r);break;case M.OPR_CONCAT:xe(e,r);break;case M.OPR_ADD:case M.OPR_SUB:case M.OPR_MUL:case M.OPR_DIV:case M.OPR_IDIV:case M.OPR_MOD:case M.OPR_POW:case M.OPR_BAND:case M.OPR_BOR:case M.OPR_BXOR:case M.OPR_SHL:case M.OPR_SHR:D(r,!1)||Ee(e,r);break;default:Ee(e,r)}},e.exports.luaK_intK=fe,e.exports.luaK_jump=j,e.exports.luaK_jumpto=function(e,t){return Q(e,j(e),t)},e.exports.luaK_nil=V,e.exports.luaK_numberK=_e,e.exports.luaK_patchclose=function(e,t,r){for(r++;-1!==t;t=G(e,t)){var n=e.f.code[t];E(n.opcode===S.OP_JMP&&(0===n.A||n.A>=r)),y.SETARG_A(n,r)}},e.exports.luaK_patchlist=Q,e.exports.luaK_patchtohere=W,e.exports.luaK_posfix=function(e,t,r,n,a){var s=N.expkind;switch(t){case M.OPR_AND:E(-1===r.t),de(e,n),n.f=F(e,n.f,r.f),r.to(n);break;case M.OPR_OR:E(-1===r.f),de(e,n),n.t=F(e,n.t,r.t),r.to(n);break;case M.OPR_CONCAT:Oe(e,n);var o=B(e,n);n.k===s.VRELOCABLE&&o.opcode===S.OP_CONCAT?(E(r.u.info===o.B-1),le(e,r),y.SETARG_B(o,r.u.info),r.k=s.VRELOCABLE,r.u.info=n.u.info):(xe(e,n),we(e,S.OP_CONCAT,r,n,a));break;case M.OPR_ADD:case M.OPR_SUB:case M.OPR_MUL:case M.OPR_DIV:case M.OPR_IDIV:case M.OPR_MOD:case M.OPR_POW:case M.OPR_BAND:case M.OPR_BOR:case M.OPR_BXOR:case M.OPR_SHL:case M.OPR_SHR:Re(t+u,r,n)||we(e,t+S.OP_ADD,r,n,a);break;case M.OPR_EQ:case M.OPR_LT:case M.OPR_LE:case M.OPR_NE:case M.OPR_GT:case M.OPR_GE:!function(e,t,r,n){var a,u=N.expkind;r.k===u.VK?a=y.RKASK(r.u.info):(E(r.k===u.VNONRELOC),a=r.u.info);var s=Ee(e,n);switch(ie(e,r,n),t){case M.OPR_NE:r.u.info=H(e,S.OP_EQ,0,a,s);break;case M.OPR_GT:case M.OPR_GE:var o=t-M.OPR_NE+S.OP_EQ;r.u.info=H(e,o,1,s,a);break;default:var l=t-M.OPR_EQ+S.OP_EQ;r.u.info=H(e,l,1,a,s)}r.k=u.VJMP}(e,t,r,n)}return r},e.exports.luaK_prefix=function(e,t,r,n){var a=new N.expdesc;switch(a.k=N.expkind.VKINT,a.u.ival=a.u.nval=a.u.info=0,a.t=-1,a.f=-1,t){case P.OPR_MINUS:case P.OPR_BNOT:if(Re(t+h,r,a))break;case P.OPR_LEN:!function(e,t,r,n){var a=ke(e,r);le(e,r),r.u.info=ee(e,t,0,a,0),r.k=N.expkind.VRELOCABLE,Se(e,n)}(e,t+S.OP_UNM,r,n);break;case P.OPR_NOT:!function(e,t){var r=N.expkind;switch(de(e,t),t.k){case r.VNIL:case r.VFALSE:t.k=r.VTRUE;break;case r.VK:case r.VKFLT:case r.VKINT:case r.VTRUE:t.k=r.VFALSE;break;case r.VJMP:me(e,t);break;case r.VRELOCABLE:case r.VNONRELOC:ge(e,t),le(e,t),t.u.info=ee(e,S.OP_NOT,0,t.u.info,0),t.k=r.VRELOCABLE}var n=t.f;t.f=t.t,t.t=n,Z(e,t.f),Z(e,t.t)}(e,r)}},e.exports.luaK_reserveregs=se,e.exports.luaK_ret=function(e,t,r){ee(e,S.OP_RETURN,t,r+1,0)},e.exports.luaK_self=function(e,t,r){ke(e,t);var n=t.u.info;le(e,t),t.u.info=e.freereg,t.k=N.expkind.VNONRELOC,se(e,2),ee(e,S.OP_SELF,t.u.info,n,Ee(e,r)),le(e,r)},e.exports.luaK_setlist=function(e,t,r,n){var u=(r-1)/y.LFIELDS_PER_FLUSH+1,s=n===a?0:n;E(0!==n&&n<=y.LFIELDS_PER_FLUSH),u<=y.MAXARG_C?ee(e,S.OP_SETLIST,t,s,u):u<=y.MAXARG_Ax?(ee(e,S.OP_SETLIST,t,s,0),ne(e,u)):m.luaX_syntaxerror(e.ls,O("constructor too long",!0)),e.freereg=t+1},e.exports.luaK_setmultret=function(e,t){ve(e,t,a)},e.exports.luaK_setoneret=he,e.exports.luaK_setreturns=ve,e.exports.luaK_storevar=function(e,t,r){var n=N.expkind;switch(t.k){case n.VLOCAL:return le(e,r),void Te(e,r,t.u.info);case n.VUPVAL:var a=ke(e,r);ee(e,S.OP_SETUPVAL,a,t.u.info,0);break;case n.VINDEXED:var u=t.u.ind.vt===n.VLOCAL?S.OP_SETTABLE:S.OP_SETTABUP,s=Ee(e,r);ee(e,u,t.u.ind.t,t.u.ind.idx,s)}le(e,r)},e.exports.luaK_stringK=function(e,t){var r=new I(g,t);return ce(e,r,r)}},function(e,t,r){"use strict";function n(e,t){for(var r=0;r>U&n.MASK1(I,0),A:u>>x&n.MASK1(y,0),B:u>>O&n.MASK1(R,0),C:u>>m&n.MASK1(S,0),Bx:u>>E&n.MASK1(w,0),Ax:u>>k&n.MASK1(N,0),sBx:(u>>E&n.MASK1(w,0))-T}}}},{key:"LoadConstants",value:function(e){for(var t=this.LoadInt(),r=0;r0&&(r.status=r.writer(r.L,e,t,r.data))},T=function(e,t){b(d(e),1,t)},x=function(e,t){var r=new ArrayBuffer(4);new DataView(r).setInt32(0,e,!0);var n=new Uint8Array(r);b(n,4,t)},k=function(e,t){var r=new ArrayBuffer(4);new DataView(r).setInt32(0,e,!0);var n=new Uint8Array(r);b(n,4,t)},O=function(e,t){var r=new ArrayBuffer(8);new DataView(r).setFloat64(0,e,!0);var n=new Uint8Array(r);b(n,8,t)},E=function(e,t){if(null===e)T(0,t);else{var r=e.tsslen()+1,n=e.getstr();r<255?T(r,t):(T(255,t),k(r,t)),b(n,r-1,t)}},m=function(e,t){var r=e.p.length;x(r,t);for(var n=0;n=0),l.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,l.width?parseInt(l.width):0);break;case"e":r=l.precision?parseFloat(r).toExponential(l.precision):parseFloat(r).toExponential();break;case"f":r=l.precision?parseFloat(r).toFixed(l.precision):parseFloat(r);break;case"g":r=l.precision?String(Number(r.toPrecision(l.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=l.precision?r.substring(0,l.precision):r;break;case"t":r=String(!!r),r=l.precision?r.substring(0,l.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=l.precision?r.substring(0,l.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=l.precision?r.substring(0,l.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}u.json.test(l.type)?d+=r:(!u.number.test(l.type)||_&&!l.sign?p="":(p=_?"+":"-",r=r.toString().replace(u.sign,"")),c=l.pad_char?"0"===l.pad_char?"0":l.pad_char.charAt(1):" ",f=l.width-(p+r).length,i=l.width&&f>0?c.repeat(f):"",d+=l.align?p+r+i:"0"===c?p+i+r:i+p+r)}return d}var i=Object.create(null);function c(e){if(i[e])return i[e];for(var t,r=e,n=[],a=0;r;){if(null!==(t=u.text.exec(r)))n.push(t[0]);else if(null!==(t=u.modulo.exec(r)))n.push("%");else{if(null===(t=u.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){a|=1;var s=[],o=t[2],l=[];if(null===(l=u.key.exec(o)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(l[1]);""!==(o=o.substring(l[0].length));)if(null!==(l=u.key_access.exec(o)))s.push(l[1]);else{if(null===(l=u.index_access.exec(o)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(l[1])}t[2]=s}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return i[e]=n}t.sprintf=s,t.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=s,window.vsprintf=o,void 0===(n=function(){return{sprintf:s,vsprintf:o}}.call(t,r,t,e))||(e.exports=n))}()},function(e,t,r){"use strict";var n=r(2).lua_pop,a=r(7).luaL_requiref,u=r(5).to_luastring,s={};e.exports.luaL_openlibs=function(e){for(var t in s)a(e,u(t),s[t],1),n(e,1)};var o=r(17),l=r(24).luaopen_base,i=r(25).luaopen_coroutine,c=r(31).luaopen_debug,f=r(30).luaopen_math,_=r(32).luaopen_package,p=r(27).luaopen_os,v=r(28).luaopen_string,h=r(26).luaopen_table,d=r(29).luaopen_utf8;s._G=l,s[o.LUA_LOADLIBNAME]=_,s[o.LUA_COLIBNAME]=i,s[o.LUA_TABLIBNAME]=h,s[o.LUA_OSLIBNAME]=p,s[o.LUA_STRLIBNAME]=v,s[o.LUA_MATHLIBNAME]=f,s[o.LUA_UTF8LIBNAME]=d,s[o.LUA_DBLIBNAME]=c;var L=r(33).luaopen_fengari;s[o.LUA_FENGARILIBNAME]=L}])})); \ No newline at end of file