aboutsummaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
Diffstat (limited to 'dist')
-rw-r--r--dist/fengari.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/dist/fengari.js b/dist/fengari.js
index 45a79af..c478f6b 100644
--- a/dist/fengari.js
+++ b/dist/fengari.js
@@ -3,4 +3,4 @@ var _NumberparseInt=Number.parseInt,_Mathmax=Math.max,_MathPI=Math.PI,_Mathlog=M
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
- */function N(pe,ce){if(pe===ce)return 0;for(var de=pe.length,Le=ce.length,ge=0,Ae=_Mathmin(de,Le);ge<Ae;++ge)if(pe[ge]!==ce[ge]){de=pe[ge],Le=ce[ge];break}return de<Le?-1:Le<de?1:0}function I(pe){return E.Buffer&&'function'==typeof E.Buffer.isBuffer?E.Buffer.isBuffer(pe):!!(null!=pe&&pe._isBuffer)}function M(pe){return Object.prototype.toString.call(pe)}function P(pe){return!I(pe)&&'function'==typeof E.ArrayBuffer&&('function'==typeof ArrayBuffer.isView?ArrayBuffer.isView(pe):!!pe&&(!!(pe instanceof DataView)||pe.buffer&&pe.buffer instanceof ArrayBuffer))}function K(pe){if(te.isFunction(pe)){if(se)return pe.name;var ce=pe.toString(),de=ce.match(oe);return de&&de[1]}}function V(pe,ce){return'string'==typeof pe?pe.length<ce?pe:pe.slice(0,ce):pe}function G(pe){if(se||!te.isFunction(pe))return te.inspect(pe);var ce=K(pe),de=ce?': '+ce:'';return'[Function'+de+']'}function F(pe){return V(G(pe.actual),128)+' '+pe.operator+' '+V(G(pe.expected),128)}function H(pe,ce,de,Le,ge){throw new ne.AssertionError({message:de,actual:pe,expected:ce,operator:Le,stackStartFunction:ge})}function Y(pe,ce){pe||H(pe,!0,ce,'==',ne.ok)}function J(pe,ce,de,Le){if(pe===ce)return!0;if(I(pe)&&I(ce))return 0===N(pe,ce);if(te.isDate(pe)&&te.isDate(ce))return pe.getTime()===ce.getTime();if(te.isRegExp(pe)&&te.isRegExp(ce))return pe.source===ce.source&&pe.global===ce.global&&pe.multiline===ce.multiline&&pe.lastIndex===ce.lastIndex&&pe.ignoreCase===ce.ignoreCase;if((null===pe||'object'!=typeof pe)&&(null===ce||'object'!=typeof ce))return de?pe==ce:pe==ce;if(P(pe)&&P(ce)&&M(pe)===M(ce)&&!(pe instanceof Float32Array||pe instanceof Float64Array))return 0===N(new Uint8Array(pe.buffer),new Uint8Array(ce.buffer));if(I(pe)!==I(ce))return!1;Le=Le||{actual:[],expected:[]};var ge=Le.actual.indexOf(pe);return-1!==ge&&ge===Le.expected.indexOf(ce)||(Le.actual.push(pe),Le.expected.push(ce),W(pe,ce,de,Le))}function q(pe){return'[object Arguments]'==Object.prototype.toString.call(pe)}function W(pe,ce,de,Le){if(null===pe||void 0===pe||null===ce||void 0===ce)return!1;if(te.isPrimitive(pe)||te.isPrimitive(ce))return pe===ce;if(de&&Object.getPrototypeOf(pe)!==Object.getPrototypeOf(ce))return!1;var ge=q(pe),Ae=q(ce);if(ge&&!Ae||!ge&&Ae)return!1;if(ge)return pe=ue.call(pe),ce=ue.call(ce),J(pe,ce,de);var Te=_e(pe),he=_e(ce),Oe,xe;if(Te.length!==he.length)return!1;for(Te.sort(),he.sort(),xe=Te.length-1;0<=xe;xe--)if(Te[xe]!==he[xe])return!1;for(xe=Te.length-1;0<=xe;xe--)if(Oe=Te[xe],!J(pe[Oe],ce[Oe],de,Le))return!1;return!0}function Z(pe,ce,de){J(pe,ce,!0)&&H(pe,ce,de,'notDeepStrictEqual',Z)}function Q(pe,ce){if(!pe||!ce)return!1;if('[object RegExp]'==Object.prototype.toString.call(ce))return ce.test(pe);try{if(pe instanceof ce)return!0}catch(de){}return!Error.isPrototypeOf(ce)&&!0===ce.call({},pe)}function $(pe){var ce;try{pe()}catch(de){ce=de}return ce}function ee(pe,ce,de,Le){var ge;if('function'!=typeof ce)throw new TypeError('"block" argument must be a function');'string'==typeof de&&(Le=de,de=null),ge=$(ce),Le=(de&&de.name?' ('+de.name+').':'.')+(Le?' '+Le:'.'),pe&&!ge&&H(ge,de,'Missing expected exception'+Le);var Ae='string'==typeof Le,Te=!pe&&te.isError(ge),he=!pe&&ge&&!de;if((Te&&Ae&&Q(ge,de)||he)&&H(ge,de,'Got unwanted exception'+Le),pe&&ge&&de&&!Q(ge,de)||!pe&&ge)throw ge}var te=U(45),ae=Object.prototype.hasOwnProperty,ue=Array.prototype.slice,se=function(){return'foo'===function(){}.name}(),ne=T.exports=Y,oe=/\s*function\s+([^\(\s]*)\s*/;ne.AssertionError=function(ce){this.name='AssertionError',this.actual=ce.actual,this.expected=ce.expected,this.operator=ce.operator,ce.message?(this.message=ce.message,this.generatedMessage=!1):(this.message=F(this),this.generatedMessage=!0);var de=ce.stackStartFunction||H;if(Error.captureStackTrace)Error.captureStackTrace(this,de);else{var Le=new Error;if(Le.stack){var ge=Le.stack,Ae=K(de),Te=ge.indexOf('\n'+Ae);if(0<=Te){var he=ge.indexOf('\n',Te+1);ge=ge.substring(he+1)}this.stack=ge}}},te.inherits(ne.AssertionError,Error),ne.fail=H,ne.ok=Y,ne.equal=function(ce,de,Le){ce!=de&&H(ce,de,Le,'==',ne.equal)},ne.notEqual=function(ce,de,Le){ce==de&&H(ce,de,Le,'!=',ne.notEqual)},ne.deepEqual=function(ce,de,Le){J(ce,de,!1)||H(ce,de,Le,'deepEqual',ne.deepEqual)},ne.deepStrictEqual=function(ce,de,Le){J(ce,de,!0)||H(ce,de,Le,'deepStrictEqual',ne.deepStrictEqual)},ne.notDeepEqual=function(ce,de,Le){J(ce,de,!1)&&H(ce,de,Le,'notDeepEqual',ne.notDeepEqual)},ne.notDeepStrictEqual=Z,ne.strictEqual=function(ce,de,Le){ce!==de&&H(ce,de,Le,'===',ne.strictEqual)},ne.notStrictEqual=function(ce,de,Le){ce===de&&H(ce,de,Le,'!==',ne.notStrictEqual)},ne.throws=function(pe,ce,de){ee(!0,pe,ce,de)},ne.doesNotThrow=function(pe,ce,de){ee(!1,pe,ce,de)},ne.ifError=function(pe){if(pe)throw pe};var _e=Object.keys||function(pe){var ce=[];for(var de in pe)ae.call(pe,de)&&ce.push(de);return ce}}).call(O,U(22))},function(T,O,U){'use strict';const E=U(0),N=U(12),I=U(4),M=[];for(let ut=0;127>ut;ut++)M[_StringfromCharCode(ut)]=ut;T.exports.char=M;const K='5',V='3',F='4',H='Lua '+K+'.'+V,Y=H+'.'+F,J=Y+' Copyright (C) 1994-2017 Lua.org, PUC-Rio',W='0',Z='0',$='1',ee='Fengari '+W+'.'+Z,te=ee+'.'+$,se='_'+K+'_'+V,ne='LUA_INIT',pe={LUA_TNONE:-1,LUA_TNIL:0,LUA_TBOOLEAN:1,LUA_TLIGHTUSERDATA:2,LUA_TNUMBER:3,LUA_TSTRING:4,LUA_TTABLE:5,LUA_TFUNCTION:6,LUA_TUSERDATA:7,LUA_TTHREAD:8,LUA_NUMTAGS:9};pe.LUA_TSHRSTR=0|pe.LUA_TSTRING,pe.LUA_TLNGSTR=16|pe.LUA_TSTRING,pe.LUA_TNUMFLT=0|pe.LUA_TNUMBER,pe.LUA_TNUMINT=16|pe.LUA_TNUMBER,pe.LUA_TLCL=0|pe.LUA_TFUNCTION,pe.LUA_TLCF=16|pe.LUA_TFUNCTION,pe.LUA_TCCL=32|pe.LUA_TFUNCTION;const Pe=-N.LUAI_MAXSTACK-1e3,Ke=2,we={},Xe=0,He=1,je=2,ze=3;T.exports.LUA_PATH_SEP=';',T.exports.LUA_PATH_MARK='?',T.exports.LUA_EXEC_DIR='!';const at=K+'.'+V;T.exports.LUA_VDIR=at;{T.exports.LUA_DIRSEP='/';const rt='/usr/local/';T.exports.LUA_ROOT=rt;const st=rt+'share/lua/'+at+'/';T.exports.LUA_LDIR=st;const nt=rt+'lib/lua/'+at+'/';T.exports.LUA_CDIR=nt,T.exports.LUA_PATH_DEFAULT=st+'?.lua;'+st+'?/init.lua;'+nt+'?.lua;'+nt+'?/init.lua;./?.lua;./?/init.lua',T.exports.LUA_CPATH_DEFAULT=nt+'?.so;'+nt+'loadall.so;./?.so'}T.exports.CT=pe,T.exports.FENGARI_AUTHORS='B. Giannangeli',T.exports.FENGARI_COPYRIGHT=te+' Copyright (C) 2017 Beno\xEEt Giannangeli\nBased on: '+J,T.exports.FENGARI_RELEASE=te,T.exports.FENGARI_VERSION=ee,T.exports.FENGARI_VERSION_MAJOR=W,T.exports.FENGARI_VERSION_MINOR=Z,T.exports.FENGARI_VERSION_NUM=1,T.exports.FENGARI_VERSION_RELEASE=$,T.exports.LUA_AUTHORS='R. Ierusalimschy, L. H. de Figueiredo, W. Celes',T.exports.LUA_COPYRIGHT=J,T.exports.LUA_HOOKCALL=Xe,T.exports.LUA_HOOKCOUNT=ze,T.exports.LUA_HOOKLINE=je,T.exports.LUA_HOOKRET=He,T.exports.LUA_HOOKTAILCALL=4,T.exports.LUA_INITVARVERSION=ne+se,T.exports.LUA_INIT_VAR=ne,T.exports.LUA_MASKCALL=1<<Xe,T.exports.LUA_MASKCOUNT=1<<ze,T.exports.LUA_MASKLINE=1<<je,T.exports.LUA_MASKRET=1<<He,T.exports.LUA_MINSTACK=20,T.exports.LUA_MULTRET=-1,T.exports.LUA_NUMTAGS=9,T.exports.LUA_OPADD=0,T.exports.LUA_OPBAND=7,T.exports.LUA_OPBNOT=13,T.exports.LUA_OPBOR=8,T.exports.LUA_OPBXOR=9,T.exports.LUA_OPDIV=5,T.exports.LUA_OPEQ=0,T.exports.LUA_OPIDIV=6,T.exports.LUA_OPLE=2,T.exports.LUA_OPLT=1,T.exports.LUA_OPMOD=3,T.exports.LUA_OPMUL=2,T.exports.LUA_OPPOW=4,T.exports.LUA_OPSHL=10,T.exports.LUA_OPSHR=11,T.exports.LUA_OPSUB=1,T.exports.LUA_OPUNM=12,T.exports.LUA_REGISTRYINDEX=Pe,T.exports.LUA_RELEASE=Y,T.exports.LUA_RIDX_GLOBALS=Ke,T.exports.LUA_RIDX_LAST=Ke,T.exports.LUA_RIDX_MAINTHREAD=1,T.exports.LUA_SIGNATURE='\x1BLua',T.exports.LUA_VERSION=H,T.exports.LUA_VERSION_MAJOR=K,T.exports.LUA_VERSION_MINOR=V,T.exports.LUA_VERSION_NUM=503,T.exports.LUA_VERSION_RELEASE=F,T.exports.LUA_VERSUFFIX=se,T.exports.constant_types=pe,T.exports.lua_Debug=class{constructor(){this.event=NaN,this.name=null,this.namewhat=null,this.what=null,this.source=null,this.currentline=NaN,this.linedefined=NaN,this.lastlinedefined=NaN,this.nups=NaN,this.nparams=NaN,this.isvararg=NaN,this.istailcall=NaN,this.short_src=null,this.i_ci=null}},T.exports.lua_upvalueindex=function(ut){return Pe-ut},T.exports.thread_status={LUA_OK:0,LUA_YIELD:1,LUA_ERRRUN:2,LUA_ERRSYNTAX:3,LUA_ERRMEM:4,LUA_ERRGCMM:5,LUA_ERRERR:6},T.exports.to_jsstring=function(ut,rt,st){E(Array.isArray(ut),'jsstring expect a array of bytes');let dt=0,nt,ot,_t,it,pt,ct;ut=ut.slice(rt?rt:0,st);for(var Lt='';;){if(nt=ut[dt++],0===nt){Lt+='\0';continue}if(!nt)return Lt;if(!(128&nt)){Lt+=_StringfromCharCode(nt);continue}if(ot=63&ut[dt++],192==(224&nt)){Lt+=_StringfromCharCode((31&nt)<<6|ot);continue}if(_t=63&ut[dt++],224==(240&nt)?nt=(15&nt)<<12|ot<<6|_t:(it=63&ut[dt++],240==(248&nt)?nt=(7&nt)<<18|ot<<12|_t<<6|it:(pt=63&ut[dt++],248==(252&nt)?nt=(3&nt)<<24|ot<<18|_t<<12|it<<6|pt:(ct=63&ut[dt++],nt=(1&nt)<<30|ot<<24|_t<<18|it<<12|pt<<6|ct))),65536>nt)Lt+=_StringfromCharCode(nt);else{var ft=nt-65536;Lt+=_StringfromCharCode(55296|ft>>10,56320|1023&ft)}}return Lt},T.exports.to_luastring=function(ut,rt,st){if(E('string'==typeof ut,'to_luastring expect a js string'),rt){let pt=we[ut];if(Array.isArray(pt))return pt}st=void 0===st?I.MAX_INT:st;let nt=[];if(!(0<st))return 0;let ot=0,it=st-1;for(let pt=0,ct;pt<ut.length;++pt)if(ct=ut.charCodeAt(pt),55296<=ct&&57343>=ct&&(ct=65536+((1023&ct)<<10)|1023&ut.charCodeAt(++pt)),127>=ct){if(ot>=it)break;nt[ot++]=ct}else if(2047>=ct){if(ot+1>=it)break;nt[ot++]=192|ct>>6,nt[ot++]=128|63&ct}else if(65535>=ct){if(ot+2>=it)break;nt[ot++]=224|ct>>12,nt[ot++]=128|63&ct>>6,nt[ot++]=128|63&ct}else if(2097151>=ct){if(ot+3>=it)break;nt[ot++]=240|ct>>18,nt[ot++]=128|63&ct>>12,nt[ot++]=128|63&ct>>6,nt[ot++]=128|63&ct}else if(67108863>=ct){if(ot+4>=it)break;nt[ot++]=248|ct>>24,nt[ot++]=128|63&ct>>18,nt[ot++]=128|63&ct>>12,nt[ot++]=128|63&ct>>6,nt[ot++]=128|63&ct}else{if(ot+5>=it)break;nt[ot++]=252|ct>>30,nt[ot++]=128|63&ct>>24,nt[ot++]=128|63&ct>>18,nt[ot++]=128|63&ct>>12,nt[ot++]=128|63&ct>>6,nt[ot++]=128|63&ct}return rt&&(we[ut]=nt),nt}},function(T,O,U){'use strict';const E=U(1),N=U(21),I=U(8),M=U(9),P=U(15);T.exports.FENGARI_AUTHORS=E.FENGARI_AUTHORS,T.exports.FENGARI_COPYRIGHT=E.FENGARI_COPYRIGHT,T.exports.FENGARI_RELEASE=E.FENGARI_RELEASE,T.exports.FENGARI_VERSION=E.FENGARI_VERSION,T.exports.FENGARI_VERSION_MAJOR=E.FENGARI_VERSION_MAJOR,T.exports.FENGARI_VERSION_MINOR=E.FENGARI_VERSION_MINOR,T.exports.FENGARI_VERSION_NUM=E.FENGARI_VERSION_NUM,T.exports.FENGARI_VERSION_RELEASE=E.FENGARI_VERSION_RELEASE,T.exports.LUA_AUTHORS=E.LUA_AUTHORS,T.exports.LUA_COPYRIGHT=E.LUA_COPYRIGHT,T.exports.LUA_ERRERR=E.thread_status.LUA_ERRERR,T.exports.LUA_ERRGCMM=E.thread_status.LUA_ERRGCMM,T.exports.LUA_ERRMEM=E.thread_status.LUA_ERRMEM,T.exports.LUA_ERRRUN=E.thread_status.LUA_ERRRUN,T.exports.LUA_ERRSYNTAX=E.thread_status.LUA_ERRSYNTAX,T.exports.LUA_HOOKCALL=E.LUA_HOOKCALL,T.exports.LUA_HOOKCOUNT=E.LUA_HOOKCOUNT,T.exports.LUA_HOOKLINE=E.LUA_HOOKLINE,T.exports.LUA_HOOKRET=E.LUA_HOOKRET,T.exports.LUA_HOOKTAILCALL=E.LUA_HOOKTAILCALL,T.exports.LUA_INITVARVERSION=E.LUA_INITVARVERSION,T.exports.LUA_INIT_VAR=E.LUA_INIT_VAR,T.exports.LUA_MASKCALL=E.LUA_MASKCALL,T.exports.LUA_MASKCOUNT=E.LUA_MASKCOUNT,T.exports.LUA_MASKLINE=E.LUA_MASKLINE,T.exports.LUA_MASKRET=E.LUA_MASKRET,T.exports.LUA_MINSTACK=E.LUA_MINSTACK,T.exports.LUA_MULTRET=E.LUA_MULTRET,T.exports.LUA_NUMTAGS=E.LUA_NUMTAGS,T.exports.LUA_OK=E.thread_status.LUA_OK,T.exports.LUA_OPADD=E.LUA_OPADD,T.exports.LUA_OPBAND=E.LUA_OPBAND,T.exports.LUA_OPBNOT=E.LUA_OPBNOT,T.exports.LUA_OPBOR=E.LUA_OPBOR,T.exports.LUA_OPBXOR=E.LUA_OPBXOR,T.exports.LUA_OPDIV=E.LUA_OPDIV,T.exports.LUA_OPEQ=E.LUA_OPEQ,T.exports.LUA_OPIDIV=E.LUA_OPIDIV,T.exports.LUA_OPLE=E.LUA_OPLE,T.exports.LUA_OPLT=E.LUA_OPLT,T.exports.LUA_OPMOD=E.LUA_OPMOD,T.exports.LUA_OPMUL=E.LUA_OPMUL,T.exports.LUA_OPPOW=E.LUA_OPPOW,T.exports.LUA_OPSHL=E.LUA_OPSHL,T.exports.LUA_OPSHR=E.LUA_OPSHR,T.exports.LUA_OPSUB=E.LUA_OPSUB,T.exports.LUA_OPUNM=E.LUA_OPUNM,T.exports.LUA_REGISTRYINDEX=E.LUA_REGISTRYINDEX,T.exports.LUA_RELEASE=E.LUA_RELEASE,T.exports.LUA_RIDX_GLOBALS=E.LUA_RIDX_GLOBALS,T.exports.LUA_RIDX_LAST=E.LUA_RIDX_LAST,T.exports.LUA_RIDX_MAINTHREAD=E.LUA_RIDX_MAINTHREAD,T.exports.LUA_SIGNATURE=E.LUA_SIGNATURE,T.exports.LUA_TNONE=E.CT.LUA_TNONE,T.exports.LUA_TNIL=E.CT.LUA_TNIL,T.exports.LUA_TBOOLEAN=E.CT.LUA_TBOOLEAN,T.exports.LUA_TLIGHTUSERDATA=E.CT.LUA_TLIGHTUSERDATA,T.exports.LUA_TNUMBER=E.CT.LUA_TNUMBER,T.exports.LUA_TSTRING=E.CT.LUA_TSTRING,T.exports.LUA_TTABLE=E.CT.LUA_TTABLE,T.exports.LUA_TFUNCTION=E.CT.LUA_TFUNCTION,T.exports.LUA_TUSERDATA=E.CT.LUA_TUSERDATA,T.exports.LUA_TTHREAD=E.CT.LUA_TTHREAD,T.exports.LUA_VERSION=E.LUA_VERSION,T.exports.LUA_VERSION_MAJOR=E.LUA_VERSION_MAJOR,T.exports.LUA_VERSION_MINOR=E.LUA_VERSION_MINOR,T.exports.LUA_VERSION_NUM=E.LUA_VERSION_NUM,T.exports.LUA_VERSION_RELEASE=E.LUA_VERSION_RELEASE,T.exports.LUA_VERSUFFIX=E.LUA_VERSUFFIX,T.exports.LUA_YIELD=E.thread_status.LUA_YIELD,T.exports.lua_Debug=E.lua_Debug,T.exports.lua_upvalueindex=E.lua_upvalueindex,T.exports.to_jsstring=E.to_jsstring,T.exports.to_luastring=E.to_luastring,T.exports.LUA_CDIR=E.LUA_CDIR,T.exports.LUA_CPATH_DEFAULT=E.LUA_CPATH_DEFAULT,T.exports.LUA_EXEC_DIR=E.LUA_EXEC_DIR,T.exports.LUA_LDIR=E.LUA_LDIR,T.exports.LUA_PATH_DEFAULT=E.LUA_PATH_DEFAULT,T.exports.LUA_PATH_MARK=E.LUA_PATH_MARK,T.exports.LUA_PATH_SEP=E.LUA_PATH_SEP,T.exports.LUA_ROOT=E.LUA_ROOT,T.exports.LUA_SHRDIR=E.LUA_SHRDIR,T.exports.LUA_VDIR=E.LUA_VDIR,T.exports.LUA_DIRSEP=E.LUA_DIRSEP,T.exports.lua_absindex=N.lua_absindex,T.exports.lua_atpanic=N.lua_atpanic,T.exports.lua_call=N.lua_call,T.exports.lua_callk=N.lua_callk,T.exports.lua_checkstack=N.lua_checkstack,T.exports.lua_close=P.lua_close,T.exports.lua_compare=N.lua_compare,T.exports.lua_concat=N.lua_concat,T.exports.lua_copy=N.lua_copy,T.exports.lua_createtable=N.lua_createtable,T.exports.lua_dump=N.lua_dump,T.exports.lua_error=N.lua_error,T.exports.lua_gc=N.lua_gc,T.exports.lua_getallocf=N.lua_getallocf,T.exports.lua_getextraspace=N.lua_getextraspace,T.exports.lua_getfield=N.lua_getfield,T.exports.lua_getglobal=N.lua_getglobal,T.exports.lua_gethook=I.lua_gethook,T.exports.lua_gethookcount=I.lua_gethookcount,T.exports.lua_gethookmask=I.lua_gethookmask,T.exports.lua_geti=N.lua_geti,T.exports.lua_getinfo=I.lua_getinfo,T.exports.lua_getlocal=I.lua_getlocal,T.exports.lua_getmetatable=N.lua_getmetatable,T.exports.lua_getstack=I.lua_getstack,T.exports.lua_gettable=N.lua_gettable,T.exports.lua_gettop=N.lua_gettop,T.exports.lua_getupvalue=N.lua_getupvalue,T.exports.lua_getuservalue=N.lua_getuservalue,T.exports.lua_insert=N.lua_insert,T.exports.lua_isboolean=N.lua_isboolean,T.exports.lua_iscfunction=N.lua_iscfunction,T.exports.lua_isfunction=N.lua_isfunction,T.exports.lua_isinteger=N.lua_isinteger,T.exports.lua_isnil=N.lua_isnil,T.exports.lua_isnone=N.lua_isnone,T.exports.lua_isnoneornil=N.lua_isnoneornil,T.exports.lua_isnumber=N.lua_isnumber,T.exports.lua_isstring=N.lua_isstring,T.exports.lua_istable=N.lua_istable,T.exports.lua_isthread=N.lua_isthread,T.exports.lua_isuserdata=N.lua_isuserdata,T.exports.lua_isyieldable=M.lua_isyieldable,T.exports.lua_len=N.lua_len,T.exports.lua_load=N.lua_load,T.exports.lua_newstate=P.lua_newstate,T.exports.lua_newtable=N.lua_newtable,T.exports.lua_newthread=P.lua_newthread,T.exports.lua_newuserdata=N.lua_newuserdata,T.exports.lua_next=N.lua_next,T.exports.lua_pcall=N.lua_pcall,T.exports.lua_pcallk=N.lua_pcallk,T.exports.lua_pop=N.lua_pop,T.exports.lua_pushboolean=N.lua_pushboolean,T.exports.lua_pushcclosure=N.lua_pushcclosure,T.exports.lua_pushcfunction=N.lua_pushcfunction,T.exports.lua_pushglobaltable=N.lua_pushglobaltable,T.exports.lua_pushinteger=N.lua_pushinteger,T.exports.lua_pushjsclosure=N.lua_pushjsclosure,T.exports.lua_pushjsfunction=N.lua_pushjsfunction,T.exports.lua_pushlightuserdata=N.lua_pushlightuserdata,T.exports.lua_pushliteral=N.lua_pushliteral,T.exports.lua_pushlstring=N.lua_pushlstring,T.exports.lua_pushnil=N.lua_pushnil,T.exports.lua_pushnumber=N.lua_pushnumber,T.exports.lua_pushstring=N.lua_pushstring,T.exports.lua_pushfstring=N.lua_pushfstring,T.exports.lua_pushvfstring=N.lua_pushvfstring,T.exports.lua_pushthread=N.lua_pushthread,T.exports.lua_pushvalue=N.lua_pushvalue,T.exports.lua_rawequal=N.lua_rawequal,T.exports.lua_rawget=N.lua_rawget,T.exports.lua_rawgeti=N.lua_rawgeti,T.exports.lua_rawgetp=N.lua_rawgetp,T.exports.lua_rawlen=N.lua_rawlen,T.exports.lua_rawseti=N.lua_rawseti,T.exports.lua_rawset=N.lua_rawset,T.exports.lua_rawsetp=N.lua_rawsetp,T.exports.lua_remove=N.lua_remove,T.exports.lua_replace=N.lua_replace,T.exports.lua_resume=M.lua_resume,T.exports.lua_rotate=N.lua_rotate,T.exports.lua_setfield=N.lua_setfield,T.exports.lua_setglobal=N.lua_setglobal,T.exports.lua_sethook=I.lua_sethook,T.exports.lua_seti=N.lua_seti,T.exports.lua_setlocal=I.lua_setlocal,T.exports.lua_setmetatable=N.lua_setmetatable,T.exports.lua_settable=N.lua_settable,T.exports.lua_settop=N.lua_settop,T.exports.lua_setupvalue=N.lua_setupvalue,T.exports.lua_setuservalue=N.lua_setuservalue,T.exports.lua_status=N.lua_status,T.exports.lua_stringtonumber=N.lua_stringtonumber,T.exports.lua_toboolean=N.lua_toboolean,T.exports.lua_todataview=N.lua_todataview,T.exports.lua_tointeger=N.lua_tointeger,T.exports.lua_tointegerx=N.lua_tointegerx,T.exports.lua_tojsstring=N.lua_tojsstring,T.exports.lua_toljsstring=N.lua_toljsstring,T.exports.lua_tolstring=N.lua_tolstring,T.exports.lua_tonumber=N.lua_tonumber,T.exports.lua_topointer=N.lua_topointer,T.exports.lua_tostring=N.lua_tostring,T.exports.lua_tothread=N.lua_tothread,T.exports.lua_touserdata=N.lua_touserdata,T.exports.lua_type=N.lua_type,T.exports.lua_typename=N.lua_typename,T.exports.lua_upvalueid=N.lua_upvalueid,T.exports.lua_upvaluejoin=N.lua_upvaluejoin,T.exports.lua_version=N.lua_version,T.exports.lua_xmove=N.lua_xmove,T.exports.lua_yield=M.lua_yield,T.exports.lua_yieldk=M.lua_yieldk},function(T){T.exports=function(){throw new Error('define cannot be used indirect')}},function(T){'use strict';T.exports.LUAI_MAXCCALLS=200,T.exports.LUA_MAXINTEGER=2147483647,T.exports.LUA_MININTEGER=-2147483648,T.exports.MAX_INT=2147483647,T.exports.MIN_INT=-2147483648},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(25),M=U(8),P=U(7),K=U(12),V=U(17),G=U(4),F=N.constant_types,H=N.char;class Y{constructor(ke,ve){this.type=ke,this.value=ve}ttype(){return 63&this.type}ttnov(){return 15&this.type}checktag(ke){return this.type===ke}checktype(ke){return this.ttnov()===ke}ttisnumber(){return this.checktype(F.LUA_TNUMBER)}ttisfloat(){return this.checktag(F.LUA_TNUMFLT)}ttisinteger(){return this.checktag(F.LUA_TNUMINT)}ttisnil(){return this.checktag(F.LUA_TNIL)}ttisboolean(){return this.checktag(F.LUA_TBOOLEAN)}ttislightuserdata(){return this.checktag(F.LUA_TLIGHTUSERDATA)}ttisstring(){return this.checktype(F.LUA_TSTRING)}ttisshrstring(){return this.checktag(F.LUA_TSHRSTR)}ttislngstring(){return this.checktag(F.LUA_TLNGSTR)}ttistable(){return this.checktag(F.LUA_TTABLE)}ttisfunction(){return this.checktype(F.LUA_TFUNCTION)}ttisclosure(){return(31&this.type)===F.LUA_TFUNCTION}ttisCclosure(){return this.checktag(F.LUA_TCCL)}ttisLclosure(){return this.checktag(F.LUA_TLCL)}ttislcf(){return this.checktag(F.LUA_TLCF)}ttisfulluserdata(){return this.checktag(F.LUA_TUSERDATA)}ttisthread(){return this.checktag(F.LUA_TTHREAD)}ttisdeadkey(){return this.checktag(F.LUA_TDEADKEY)}l_isfalse(){return this.ttisnil()||this.ttisboolean()&&!1===this.value}setfltvalue(ke){this.type=F.LUA_TNUMFLT,this.value=ke}setivalue(ke){this.type=F.LUA_TNUMINT,this.value=ke}setnilvalue(){this.type=F.LUA_TNIL,this.value=void 0}setfvalue(ke){this.type=F.LUA_TLCF,this.value=ke}setpvalue(ke){this.type=F.LUA_TLIGHTUSERDATA,this.value=ke}setbvalue(ke){this.type=F.LUA_TBOOLEAN,this.value=ke}sethvalue(ke){this.type=F.LUA_TTABLE,this.value=ke}setfrom(ke){this.type=ke.type,this.value=ke.value}tsvalue(){return E(this.ttisstring()),this.value}svalue(){return this.tsvalue().getstr()}vslen(){return this.tsvalue().tsslen()}jsstring(ke,ve){return N.to_jsstring(this.svalue(),ke,ve)}}const J=new Y(F.LUA_TNIL,null);T.exports.luaO_nilobject=J;const Q=N.to_luastring('...',!0),$=N.to_luastring('[string "'),ee=N.to_luastring('"]'),ae=function(ke){return I.lisdigit(ke)?ke-H[0]:_StringfromCharCode(ke).toLowerCase().charCodeAt(0)-H.a+10},ue=8,oe=function(ke){let ve=H[K.lua_getlocaledecpoint()],Re=0,be=0,Se=0,Ne=0,Ce=!1,Ie;for(;I.lisspace(ke[0]);)ke=ke.slice(1);if(Ie=ke[0]===H['-'],ke=Ie||ke[0]===H['+']?ke.slice(1):ke,ke[0]!==H[0]||ke[1]!==H.x&&ke[1]!==H.X)return 0;for(ke=ke.slice(2);;ke=ke.slice(1))if(ke[0]===ve){if(Ce)break;else Ce=!0;}else if(I.lisxdigit(ke[0]))0==be&&ke[0]===H[0]?Se++:30>=++be?Re=16*Re+ae(ke[0]):Ne++,Ce&&Ne--;else break;if(0==Se+be)return 0;if(Ne*=4,ke[0]===H.p||ke[0]===H.P){let Me=0,Pe;if(ke=ke.slice(1),Pe=ke[0]===H['-'],ke=Pe||ke[0]===H['+']?ke.slice(1):ke,!I.lisdigit(ke[0]))return 0;for(;I.lisdigit(ke[0]);)Me=10*Me+ke[0]-H[0],ke=ke.slice(1);Pe&&(Me=-Me),Ne+=Me}return Ie&&(Re=-Re),0>N.to_jsstring(ke).trim().search(/s/)?K.ldexp(Re,Ne):null},_e=function(ke,ve){let Re='x'===ve?oe(ke):parseFloat(N.to_jsstring(ke));return isNaN(Re)?null:Re},pe=function(ke){let ve=/[.xXnN]/g.exec(_StringfromCharCode(...ke));ve=ve?ve.index:null;let Re=ve?ke[ve]:null,be=Re?_StringfromCharCode(Re).toLowerCase():0;if('n'===be)return null;let Se=_e(ke,be);return null===Se,Se},ce=G.MAX_INT/10,de=G.MAX_INT%10,Le=function(ke){let ve=0,Re=!0,be;for(;I.lisspace(ke[0]);)ke=ke.slice(1);if(be=ke[0]===H['-'],(be||ke[0]===H['+'])&&(ke=ke.slice(1)),ke[0]===H[0]&&(ke[1]===H.x||ke[1]===H.X))for(ke=ke.slice(2);I.lisxdigit(ke[0]);ke=ke.slice(1))ve=16*ve+ae(ke[0]),Re=!1;else for(;I.lisdigit(ke[0]);ke=ke.slice(1)){let Se=ke[0]-H[0];if(ve>=ce&&(ve>ce||Se>de+be))return null;ve=10*ve+Se,Re=!1}for(;I.lisspace(ke[0]);)ke=ke.slice(1);return Re||0<ke.length&&0!==ke[0]?null:0|(be?-ve:ve)},Te=function(ke,ve){ke.stack[ke.top++]=new Y(F.LUA_TLNGSTR,P.luaS_new(ke,ve))},he=function(ke,ve,Re){let be=0,Se=0,Ne=0,Ie;for(;Ie=ve.indexOf(H['%'],Se),-1!=Ie;){switch(Te(ke,ve.slice(Se,Ie)),ve[Ie+1]){case H.s:let Ce=Re[Ne++];null===Ce&&(Ce=N.to_luastring('(null)',!0)),Te(ke,Ce);break;case H.c:let Me=Re[Ne++];I.lisprint(Me)?Te(ke,[Me]):Oe(ke,N.to_luastring('<\\%d>',!0),Me);break;case H.d:case H.I:case H.f:Te(ke,N.to_luastring(''+Re[Ne++]));break;case H.U:Te(ke,N.to_luastring(String.fromCodePoint(Re[Ne++])));break;case H['%']:Te(ke,[H['%']]);break;default:M.luaG_runerror(ke,N.to_luastring('invalid option \'%%%c\' to \'lua_pushfstring\''),ve[Ie+1]);}be+=2,Se=Ie+2}return Te(ke,ve.slice(Se)),0<be&&V.luaV_concat(ke,be+1),ke.stack[ke.top-1].svalue()},Oe=function(ke,ve,...Re){return he(ke,ve,Re)};T.exports.CClosure=class{constructor(ke,ve,Re){for(this.id=ke.l_G.id_counter++,this.f=ve,this.nupvalues=Re,this.upvalue=Array(Re);Re--;)this.upvalue[Re]=new Y(F.LUA_TNIL,null)}},T.exports.LClosure=class{constructor(ke,ve){this.id=ke.l_G.id_counter++,this.p=null,this.nupvalues=ve,this.upvals=Array(ve)}},T.exports.LocVar=class{constructor(){this.varname=null,this.startpc=NaN,this.endpc=NaN}},T.exports.TValue=Y,T.exports.UTF8BUFFSZ=ue,T.exports.intarith=function(ke,ve,Re,be){return ve===N.LUA_OPADD?0|Re+be:ve===N.LUA_OPSUB?0|Re-be:ve===N.LUA_OPMUL?0|Re*be:ve===N.LUA_OPMOD?0|Re-_Mathfloor(Re/be)*be:ve===N.LUA_OPIDIV?0|Re/be:ve===N.LUA_OPBAND?Re&be:ve===N.LUA_OPBOR?Re|be:ve===N.LUA_OPBXOR?Re^be:ve===N.LUA_OPSHL?Re<<be:ve===N.LUA_OPSHR?Re>>be:ve===N.LUA_OPUNM?0|0-Re:ve===N.LUA_OPBNOT?-1^Re:void 0},T.exports.luaO_chunkid=function(ke,ve){ke=ke instanceof Y?ke.value:ke,ve=ve instanceof Y?ve.value:ve;let Re=ke.length,be=[];if(ke[0]===H['='])be=Re<ve?ke.slice(1):be.concat(ke.slice(1,ve));else if(ke[0]===H['@'])Re<=ve?be=ke.slice(1):(ve-=Q.length,be=Q.concat(ke.slice(1,Re-ve)));else{let Se=ke.indexOf(H['\n']),Ne=-1<Se?ke.slice(Se):null;be=$,ve-=$.length+Q.length+ee.length+1,Re<ve&&null===Ne?be=be.concat(ke):(null!==Ne&&(Re=Ne.length-ke.length),Re>ve&&(Re=ve),be=be.concat(ke).concat(Q)),be=be.concat(ee)}return be},T.exports.luaO_hexavalue=ae,T.exports.luaO_int2fb=function(ke){let ve=0;if(8>ke)return ke;for(;128<=ke;)ke=ke+15>>4,ve+=4;for(;16<=ke;)ke=ke+1>>1,ve++;return ve+1<<3|ke-8},T.exports.luaO_pushfstring=Oe,T.exports.luaO_pushvfstring=he,T.exports.luaO_str2num=function(ke){let ve=Le(ke);return null===ve?(ve=pe(ke),null!=ve&&new Y(F.LUA_TNUMFLT,ve)):new Y(F.LUA_TNUMINT,ve)},T.exports.luaO_utf8desc=function(ke,ve){let Re=1;if(E(1114111>=ve),128>ve)ke[ue-1]=ve;else{let be=63;do ke[ue-Re++]=128|63&ve,ve>>=6,be>>=1;while(ve>be);ke[ue-Re]=~be<<1|ve}return Re},T.exports.luaO_utf8esc=function(ke){let ve=[],Re=1;if(E(1114111>=ke),128>ke)ve[ue-1]=ke;else{let be=63;do ve[ue-Re++]=128|63&ke,ke>>=6,be>>=1;while(ke>be);ve[ue-Re]=~be<<1|ke}return{buff:ve,n:Re}},T.exports.numarith=function(ke,ve,Re,be){return ve===N.LUA_OPADD?Re+be:ve===N.LUA_OPSUB?Re-be:ve===N.LUA_OPMUL?Re*be:ve===N.LUA_OPDIV?Re/be:ve===N.LUA_OPPOW?_Mathpow(Re,be):ve===N.LUA_OPIDIV?Re/be:ve===N.LUA_OPUNM?-Re:ve===N.LUA_OPMOD?Re%be:void 0}},function(T,O,U){'use strict';(function(E){const N=U(2),I=U(51),M='_LOADED',K=N.to_luastring('FILE*',!0),G=10,F=11,H=function(et,at,lt){if(0===lt||!N.lua_istable(et,-1))return 0;for(N.lua_pushnil(et);N.lua_next(et,-2);){if(N.lua_type(et,-2)===N.LUA_TSTRING){if(N.lua_rawequal(et,at,-1))return N.lua_pop(et,1),1;if(H(et,at,lt-1))return N.lua_remove(et,-2),N.lua_pushliteral(et,'.'),N.lua_insert(et,-2),N.lua_concat(et,3),1}N.lua_pop(et,1)}return 0},Y=function(et,at){let lt=N.lua_gettop(et);if(N.lua_getinfo(et,['f'.charCodeAt(0)],at),N.lua_getfield(et,N.LUA_REGISTRYINDEX,N.to_luastring(M,!0)),H(et,lt+1,2)){let ut=N.lua_tostring(et,-1);return N.to_jsstring(ut).startsWith('_G.')&&(N.lua_pushstring(et,ut.slice(3)),N.lua_remove(et,-2)),N.lua_copy(et,-1,lt+1),N.lua_pop(et,2),1}return N.lua_settop(et,lt),0},J=function(et,at){Y(et,at)?(N.lua_pushfstring(et,N.to_luastring('function \'%s\''),N.lua_tostring(et,-1)),N.lua_remove(et,-2)):at.namewhat?N.lua_pushfstring(et,N.to_luastring('%s \'%s\''),at.namewhat,at.name):at.what&&at.what[0]==='m'.charCodeAt(0)?N.lua_pushliteral(et,'main chunk'):at.what&&at.what[0]!='C'.charCodeAt(0)?N.lua_pushfstring(et,N.to_luastring('function <%s:%d>'),at.short_src,at.linedefined):N.lua_pushliteral(et,'?')},q=function(et){let at=new N.lua_Debug,lt=1,ut=1;for(;N.lua_getstack(et,ut,at);)lt=ut,ut*=2;for(;lt<ut;){let rt=_Mathfloor((lt+ut)/2);N.lua_getstack(et,rt,at)?lt=rt+1:ut=rt}return ut-1},Z=function(et){throw new Error(`PANIC: unprotected error in call to Lua API (${N.lua_tojsstring(et,-1)})`)},Q=function(et,at,lt){let ut=new N.lua_Debug;return N.lua_getstack(et,0,ut)?(N.lua_getinfo(et,'n',ut),ut.namewhat===N.to_luastring('method',!0)&&(at--,0===at))?te(et,N.to_luastring('calling \'%s\' on bad self (%s)'),ut.name,lt):(null===ut.name&&(ut.name=Y(et,ut)?N.lua_tostring(et,-1):['?'.charCodeAt(0)]),te(et,N.to_luastring('bad argument #%d to \'%s\' (%s)'),at,ut.name,lt)):te(et,N.to_luastring('bad argument #%d (%s)'),at,lt)},$=function(et,at,lt){let ut=Fe(et,at,N.to_luastring('__name',!0))===N.LUA_TSTRING?N.lua_tostring(et,-1):N.lua_type(et,at)===N.LUA_TLIGHTUSERDATA?N.to_luastring('light userdata',!0):Le(et,at),rt=N.lua_pushfstring(et,N.to_luastring('%s expected, got %s'),lt,ut);return Q(et,at,rt)},ee=function(et,at){let lt=new N.lua_Debug;return N.lua_getstack(et,at,lt)&&(N.lua_getinfo(et,N.to_luastring('Sl',!0),lt),0<lt.currentline)?void N.lua_pushfstring(et,N.to_luastring('%s:%d: '),lt.short_src,lt.currentline):void N.lua_pushstring(et,[])},te=function(et,at,...lt){return ee(et,1),N.lua_pushvfstring(et,at,lt),N.lua_concat(et,2),N.lua_error(et)},ae=function(et,at,lt,ut){return at?(N.lua_pushboolean(et,1),1):(N.lua_pushnil(et),lt?N.lua_pushstring(et,N.to_luastring(`${N.to_jsstring(lt)}: ${ut.message}`)):N.lua_pushstring(et,N.to_luastring(ut.message)),N.lua_pushinteger(et,-ut.errno),3)},se=function(et,at){return N.lua_getfield(et,N.LUA_REGISTRYINDEX,at)},_e=function(et,at,lt){let ut=N.lua_touserdata(et,at);return null!==ut&&N.lua_getmetatable(et,at)?(se(et,lt),N.lua_rawequal(et,-1,-2)||(ut=null),N.lua_pop(et,2),ut):null},ce=function(et,at,lt){$(et,at,N.lua_typename(et,lt))},Le=function(et,at){return N.lua_typename(et,N.lua_type(et,at))},Oe=function(et,at){let lt=N.lua_tolstring(et,at);return(null===lt||void 0===lt)&&ce(et,at,N.LUA_TSTRING),lt},xe=function(et,at,lt){return 0>=N.lua_type(et,at)?lt:Oe(et,at)},Ee=function(et,at){N.lua_isnumber(et,at)?Q(et,at,N.to_luastring('number has no integer representation',!0)):ce(et,at,N.LUA_TNUMBER)},ve=function(et,at){let lt=N.lua_tointeger(et,at);return!1===lt&&Ee(et,at),lt},Se=function(et,at){at.L=et,at.b=[]},Ie=function(et,at,lt){et.b=et.b.concat(at.slice(0,lt))},Ce=Ie,De=function(et,at,lt,ut){return 0>=N.lua_type(et,lt)?ut:at(et,lt)},Ke=function(et,at){let lt=at.string;return at.string=null,lt},Be=function(et,at,lt,ut,rt){return N.lua_load(et,Ke,{string:at},ut,rt)},Ve=function(et,at,lt,ut){return Be(et,at,lt,ut,null)},Ge=function(et,at){return Ve(et,at,at.length,at)},Fe=function(et,at,lt){if(!N.lua_getmetatable(et,at))return N.LUA_TNIL;N.lua_pushstring(et,lt);let ut=N.lua_rawget(et,-2);return ut===N.LUA_TNIL&&N.lua_pop(et,2),ut},Xe=function(et,at,lt){return(at=N.lua_absindex(et,at),Fe(et,at,lt)!==N.LUA_TNIL)&&(N.lua_pushvalue(et,at),N.lua_call(et,1,1),!0)},Ye=function(et,at,lt){var ut=lt>>>0,rt=at.length,st=et.length+1-rt;loop:for(;ut<st;ut++){for(let nt=0;nt<rt;nt++)if(et[ut+nt]!==at[nt])continue loop;return ut}return-1},qe=function(et,at,lt){return N.lua_getfield(et,at,lt)===N.LUA_TTABLE||(N.lua_pop(et,1),at=N.lua_absindex(et,at),N.lua_newtable(et),N.lua_pushvalue(et,-1),N.lua_setfield(et,at,lt),!1)},We=function(et,at,lt){for(let ut in Ze(et,lt,N.to_luastring('too many upvalues',!0)),at){for(let rt=0;rt<lt;rt++)N.lua_pushvalue(et,-lt);N.lua_pushcclosure(et,at[ut],lt),N.lua_setfield(et,-(lt+2),N.to_luastring(ut))}N.lua_pop(et,lt)},Ze=function(et,at,lt){N.lua_checkstack(et,at)||(lt?te(et,N.to_luastring('stack overflow (%s)'),lt):te(et,N.to_luastring('stack overflow',!0)))};T.exports.LUA_FILEHANDLE=K,T.exports.LUA_LOADED_TABLE=M,T.exports.LUA_PRELOAD_TABLE='_PRELOAD',T.exports.luaL_Buffer=class{constructor(){this.b=null,this.L=null}},T.exports.luaL_addchar=function(et,at){et.b.push(at)},T.exports.luaL_addlstring=Ie,T.exports.luaL_addstring=Ce,T.exports.luaL_addvalue=function(et){let at=et.L,lt=N.lua_tostring(at,-1);Ce(et,lt),N.lua_remove(at,-1)},T.exports.luaL_argcheck=function(et,at,lt,ut){at||Q(et,lt,ut)},T.exports.luaL_argerror=Q,T.exports.luaL_buffinit=Se,T.exports.luaL_buffinitsize=function(et,at){return Se(et,at),at},T.exports.luaL_callmeta=Xe,T.exports.luaL_checkany=function(et,at){N.lua_type(et,at)===N.LUA_TNONE&&Q(et,at,N.to_luastring('value expected',!0))},T.exports.luaL_checkinteger=ve,T.exports.luaL_checklstring=Oe,T.exports.luaL_checknumber=function(et,at){let lt=N.lua_tonumber(et,at);return!1===lt&&ce(et,at,N.LUA_TNUMBER),lt},T.exports.luaL_checkstack=Ze,T.exports.luaL_checkstring=function(et,at){return Oe(et,at,null)},T.exports.luaL_checktype=function(et,at,lt){N.lua_type(et,at)!==lt&&ce(et,at,lt)},T.exports.luaL_checkudata=function(et,at,lt){let ut=_e(et,at,lt);return null===ut&&$(et,at,lt),ut},T.exports.luaL_dostring=function(et,at){return Ge(et,at)||N.lua_pcall(et,0,N.LUA_MULTRET,0)},T.exports.luaL_error=te,T.exports.luaL_execresult=function(et,at){let lt,ut;if(null===at)return N.lua_pushboolean(et,1),N.lua_pushliteral(et,'exit'),N.lua_pushinteger(et,0),3;if(at.status)lt='exit',ut=at.status;else if(at.signal)lt='signal',ut=at.signal;else return ae(et,0,null,at);return N.lua_pushnil(et),N.lua_pushliteral(et,lt),N.lua_pushinteger(et,ut),3},T.exports.luaL_fileresult=ae,T.exports.luaL_getmetafield=Fe,T.exports.luaL_getmetatable=se,T.exports.luaL_getsubtable=qe,T.exports.luaL_gsub=function(et,at,lt,ut){let st=[],rt;for(;0<=(rt=Ye(at,lt));)st.push(...at.slice(0,rt)),st.push(...ut),at=at.slice(rt+lt.length);return st.push(...at),N.lua_pushstring(et,st),N.lua_tostring(et,-1)},T.exports.luaL_len=function(et,at){N.lua_len(et,at);let lt=N.lua_tointegerx(et,-1);return!1===lt&&te(et,N.to_luastring('object length is not an integer',!0)),N.lua_pop(et,1),lt},T.exports.luaL_loadbuffer=Ve,T.exports.luaL_loadbufferx=Be,T.exports.luaL_loadstring=Ge,T.exports.luaL_newlib=function(et,at){N.lua_createtable(et),We(et,at,0)},T.exports.luaL_newmetatable=function(et,at){return se(et,at)===N.LUA_TNIL?(N.lua_pop(et,1),N.lua_createtable(et,0,2),N.lua_pushstring(et,at),N.lua_setfield(et,-2,N.to_luastring('__name')),N.lua_pushvalue(et,-1),N.lua_setfield(et,N.LUA_REGISTRYINDEX,at),1):0},T.exports.luaL_newstate=function(){let et=N.lua_newstate();return et&&N.lua_atpanic(et,Z),et},T.exports.luaL_openlibs=I.luaL_openlibs,T.exports.luaL_opt=De,T.exports.luaL_optinteger=function(et,at,lt){return De(et,ve,at,lt)},T.exports.luaL_optlstring=xe,T.exports.luaL_optstring=xe,T.exports.luaL_prepbuffsize=function(et){return et},T.exports.luaL_pushresult=function(et){let at=et.L;N.lua_pushstring(at,et.b)},T.exports.luaL_requiref=function(et,at,lt,ut){qe(et,N.LUA_REGISTRYINDEX,N.to_luastring(M)),N.lua_getfield(et,-1,at),N.lua_toboolean(et,-1)||(N.lua_pop(et,1),N.lua_pushcfunction(et,lt),N.lua_pushstring(et,at),N.lua_call(et,1,1),N.lua_pushvalue(et,-1),N.lua_setfield(et,-3,at)),N.lua_remove(et,-2),ut&&(N.lua_pushvalue(et,-1),N.lua_setglobal(et,at))},T.exports.luaL_setfuncs=We,T.exports.luaL_setmetatable=function(et,at){se(et,at),N.lua_setmetatable(et,-2)},T.exports.luaL_testudata=_e,T.exports.luaL_tolstring=function(et,at){if(Xe(et,at,N.to_luastring('__tostring',!0)))N.lua_isstring(et,-1)||te(et,N.to_luastring('\'__tostring\' must return a string',!0));else{let lt=N.lua_type(et,at);switch(lt){case N.LUA_TNUMBER:{if(N.lua_isinteger(et,at))N.lua_pushstring(et,N.to_luastring(N.lua_tointeger(et,at).toString()));else{let ot=N.lua_tonumber(et,at),_t=_Mathabs(ot),it;it=Object.is(ot,Infinity)?'inf':Object.is(ot,-Infinity)?'-inf':_NumberisNaN(ot)?'nan':1e14<=_t||0<_t&&1e-4>_t?ot.toExponential():ot.toPrecision(16).replace(/(\.[0-9][1-9]*)0+$/,'$1'),N.lua_pushstring(et,N.to_luastring(it))}break}case N.LUA_TSTRING:N.lua_pushvalue(et,at);break;case N.LUA_TBOOLEAN:N.lua_pushliteral(et,N.lua_toboolean(et,at)?'true':'false');break;case N.LUA_TNIL:N.lua_pushliteral(et,'nil');break;default:let ut=Fe(et,at,N.to_luastring('__name',!0)),rt=ut===N.LUA_TSTRING?N.lua_tostring(et,-1):Le(et,at),st=N.lua_topointer(et,at),nt;switch(lt){case N.LUA_TLIGHTUSERDATA:nt='<id NYI>';break;case N.LUA_TFUNCTION:if('function'==typeof st){nt='<id NYI>';break}case N.LUA_TTABLE:case N.LUA_TTHREAD:case N.LUA_TUSERDATA:nt=`0x${st.id.toString(16)}`;break;default:throw Error('unhandled type: '+lt);}N.lua_pushstring(et,N.to_luastring(`${N.to_jsstring(rt)}: ${nt}`)),ut!==N.LUA_TNIL&&N.lua_remove(et,-2);}}return N.lua_tolstring(et,-1)},T.exports.luaL_traceback=function(et,at,lt,ut){let rt=new N.lua_Debug,st=N.lua_gettop(et),nt=q(at),ot=nt-ut>G+F?G:-1;for(lt&&N.lua_pushstring(et,lt.concat('\n'.charCodeAt(0))),Ze(et,10,null),N.lua_pushliteral(et,'stack traceback:');N.lua_getstack(at,ut++,rt);)0==ot--?(N.lua_pushliteral(et,'\n\t...'),ut=nt-F+1):(N.lua_getinfo(at,N.to_luastring('Slnt',!0),rt),N.lua_pushstring(et,['\n'.charCodeAt(0),'\t'.charCodeAt(0)].concat(rt.short_src).concat([':'.charCodeAt(0)])),0<rt.currentline&&N.lua_pushliteral(et,`${rt.currentline}:`),N.lua_pushliteral(et,' in '),J(et,rt),rt.istailcall&&N.lua_pushliteral(et,'\n\t(...tail calls..)'),N.lua_concat(et,N.lua_gettop(et)-st));N.lua_concat(et,N.lua_gettop(et)-st)},T.exports.luaL_typename=Le,T.exports.luaL_where=ee,T.exports.lua_writestringerror=function(et){E.stderr?E.stderr.write(et):console.error(et)}}).call(O,U(18))},function(T,O,U){'use strict';const E=U(0),N=U(1);class I{constructor(H,Y){this.hash=null,this.realstring=Y}getstr(){return this.realstring}tsslen(){return this.realstring.length}}const P=function(H){return E(Array.isArray(H)),H.map((Y)=>`${Y}|`).join('')},V=function(H,Y){return new I(H,Y)};T.exports.luaS_eqlngstr=function(H,Y){return E(H instanceof I),E(Y instanceof I),H==Y||H.realstring.length==Y.realstring.length&&H.realstring.join()==Y.realstring.join()},T.exports.luaS_hash=P,T.exports.luaS_hashlongstr=function(H){return E(H instanceof I),null===H.hash&&(H.hash=P(H.getstr())),H.hash},T.exports.luaS_bless=V,T.exports.luaS_new=function(H,Y){return V(H,Y.slice(0))},T.exports.luaS_newliteral=function(H,Y){return V(H,N.to_luastring(Y))},T.exports.TString=I},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(9),M=U(11),P=U(5),K=U(20),V=U(15),G=U(10),F=U(16),H=U(12),Y=U(17),J=P.TValue,q=N.constant_types,W=N.thread_status,Z=function(De){return De.func.value.p.lineinfo?De.func.value.p.lineinfo[De.pcOff-1]:-1},Q=function(De){if(De.status===W.LUA_YIELD){let Ke=De.ci,Be=Ke.funcOff;Ke.func=De.stack[Ke.extra],Ke.funcOff=Ke.extra,Ke.extra=Be}},se=function(De,Ke){E(Ke<De.upvalues.length);let Be=De.upvalues[Ke].name;return null===Be?['?'.charCodeAt(0)]:Be.getstr()},ne=function(De,Ke){let Be=De.func.value.p.numparams;return Ke>=De.l_base-De.funcOff-Be?null:{pos:De.funcOff+Be+Ke,name:N.to_luastring('(*vararg)',!0)}},oe=function(De,Ke,Be){let Ge=null,Ve;if(Ke.callstatus&V.CIST_LUA){if(0>Be)return ne(Ke,-Be);Ve=Ke.l_base,Ge=M.luaF_getlocalname(Ke.func.value.p,Be,Ke.pcOff)}else Ve=Ke.funcOff+1;if(null===Ge){let we=Ke===De.ci?De.top:Ke.next.func;if(we-Ve>=Be&&0<Be)Ge=N.to_luastring('(*temporary)',!0);else return null}return{pos:Ve+(Be-1),name:Ge}},ce=function(De,Ke){if(null===Ke||Ke.type===q.LUA_TCCL)De.source=N.to_luastring('=[JS]',!0),De.linedefined=-1,De.lastlinedefined=-1,De.what='J';else{let Be=Ke.p;De.source=Be.source?Be.source.getstr():N.to_luastring('=?',!0),De.linedefined=Be.linedefined,De.lastlinedefined=Be.lastlinedefined,De.what=0===De.linedefined?N.to_luastring('main',!0):N.to_luastring('Lua',!0)}De.short_src=P.luaO_chunkid(De.source,H.LUA_IDSIZE)},de=function(De,Ke){if(null===Ke||Ke.c.type===q.LUA_TCCL)De.stack[De.top++]=new J(q.LUA_TNIL,null),E(De.top<=De.ci.top,'stack overflow');else{let Be=Ke.l.p.lineinfo,Ve=G.luaH_new(De);De.stack[De.top++]=new J(q.LUA_TTABLE,Ve),E(De.top<=De.ci.top,'stack overflow');let Ge=new J(q.LUA_TBOOLEAN,!0);for(let we=0;we<Ke.l.p.length;we++)G.luaH_setint(Ve,Be[we],Ge)}},Le=function(De,Ke){let Be={name:null,funcname:null};return null===Ke?null:Ke.callstatus&V.CIST_FIN?(Be.name=N.to_luastring('__gc',!0),Be.funcname=N.to_luastring('metamethod',!0),Be):!(Ke.callstatus&V.CIST_TAIL)&&Ke.previous.callstatus&V.CIST_LUA?Ue(De,Ke.previous):null},ge=function(De,Ke,Be,Ve,Ge){let we=1;for(;0<Ke.length;Ke=Ke.slice(1))switch(_StringfromCharCode(Ke[0])){case'S':{ce(Be,Ve);break}case'l':{Be.currentline=Ge&&Ge.callstatus&V.CIST_LUA?Z(Ge):-1;break}case'u':{Be.nups=null===Ve?0:Ve.nupvalues,null===Ve||Ve.type===q.LUA_TCCL?(Be.isvararg=!0,Be.nparams=0):(Be.isvararg=Ve.p.is_vararg,Be.nparams=Ve.p.numparams);break}case't':{Be.istailcall=Ge?Ge.callstatus&V.CIST_TAIL:0;break}case'n':{let Fe=Le(De,Ge);null===Fe?(Be.namewhat=null,Be.name=null):(Be.namewhat=Fe.funcname,Be.name=Fe.name);break}case'L':case'f':break;default:we=0;}return we},Te=function(De,Ke,Be){let Ve={name:null,funcname:null};if(K.ISK(Be)){let Ge=De.k[K.INDEXK(Be)];if(Ge.ttisstring())return Ve.name=Ge.svalue(),Ve}else{let Ge=xe(De,Ke,Be);if(Ge&&Ge.funcname[0]==='c'.charCodeAt(0))return Ge}return Ve.name=[N.char['?']],Ve},he=function(De,Ke){return De<Ke?-1:De},Oe=function(De,Ke,Be){let Ve=-1,Ge=0;for(let we=0;we<Ke;we++){let Fe=De.code[we],Xe=K.OpCodes[Fe.opcode],He=Fe.A;switch(Xe){case'OP_LOADNIL':{let je=Fe.B;He<=Be&&Be<=He+je&&(Ve=he(we,Ge));break}case'OP_TFORCALL':{Be>=He+2&&(Ve=he(we,Ge));break}case'OP_CALL':case'OP_TAILCALL':{Be>=He&&(Ve=he(we,Ge));break}case'OP_JMP':{let je=Fe.sBx,ze=we+1+je;we<ze&&ze<=Ke&&ze>Ge&&(Ge=ze);break}default:K.testAMode(Fe.opcode)&&Be===He&&(Ve=he(we,Ge));}}return Ve},xe=function(De,Ke,Be){let Ve={name:M.luaF_getlocalname(De,Be+1,Ke),funcname:null};if(Ve.name)return Ve.funcname=N.to_luastring('local',!0),Ve;let Ge=Oe(De,Ke,Be);if(-1!==Ge){let we=De.code[Ge],Fe=K.OpCodes[we.opcode];switch(Fe){case'OP_MOVE':{let Xe=we.B;if(Xe<we.A)return xe(De,Ge,Xe);break}case'OP_GETTABUP':case'OP_GETTABLE':{let Xe=we.C,He=we.B,je='OP_GETTABLE'===Fe?M.luaF_getlocalname(De,He+1,Ge):se(De,He);return Ve.name=Te(De,Ge,Xe).name,Ve.funcname=je&&'_ENV'===je?N.to_luastring('global',!0):N.to_luastring('field',!0),Ve}case'OP_GETUPVAL':return Ve.name=se(De,we.B),Ve.funcname=N.to_luastring('upvalue',!0),Ve;case'OP_LOADK':case'OP_LOADKX':{let Xe='OP_LOADK'===Fe?we.Bx:De.code[Ge+1].Ax;if(De.k[Xe].ttisstring())return Ve.name=De.k[Xe].tsvalue(),Ve.funcname=N.to_luastring('constant',!0),Ve;break}case'OP_SELF':{let Xe=we.C;return Ve.name=Te(De,Ge,Xe).name,Ve.funcname=N.to_luastring('method',!0),Ve}default:}}return null},Ue=function(De,Ke){let Be={name:null,funcname:null},Ve=0,Ge=Ke.func.value.p,we=Ke.pcOff-1,Fe=Ge.code[we];if(Ke.callstatus&V.CIST_HOOKED)return Be.name=[N.char['?']],Be.funcname=N.to_luastring('hook',!0),Be;switch(K.OpCodes[Fe.opcode]){case'OP_CALL':case'OP_TAILCALL':return xe(Ge,we,Fe.A);case'OP_TFORCALL':return Be.name=N.to_luastring('for iterator',!0),Be.funcname=N.to_luastring('for iterator',!0),Be;case'OP_SELF':case'OP_GETTABUP':case'OP_GETTABLE':Ve=F.TMS.TM_INDEX;break;case'OP_SETTABUP':case'OP_SETTABLE':Ve=F.TMS.TM_NEWINDEX;break;case'OP_ADD':Ve=F.TMS.OP_ADD;break;case'OP_SUB':Ve=F.TMS.OP_SUB;break;case'OP_MUL':Ve=F.TMS.OP_MUL;break;case'OP_MOD':Ve=F.TMS.OP_MOD;break;case'OP_POW':Ve=F.TMS.OP_POW;break;case'OP_DIV':Ve=F.TMS.OP_DIV;break;case'OP_IDIV':Ve=F.TMS.OP_IDI;break;case'OP_BAND':Ve=F.TMS.OP_BAN;break;case'OP_BOR':Ve=F.TMS.OP_BOR;break;case'OP_BXOR':Ve=F.TMS.OP_BXO;break;case'OP_SHL':Ve=F.TMS.OP_SHL;break;case'OP_SHR':Ve=F.TMS.OP_SHR;break;case'OP_UNM':Ve=F.TMS.TM_UNM;break;case'OP_BNOT':Ve=F.TMS.TM_BNOT;break;case'OP_LEN':Ve=F.TMS.TM_LEN;break;case'OP_CONCAT':Ve=F.TMS.TM_CONCAT;break;case'OP_EQ':Ve=F.TMS.TM_EQ;break;case'OP_LT':Ve=F.TMS.TM_LT;break;case'OP_LE':Ve=F.TMS.TM_LE;break;default:return null;}return Be.name=De.l_G.tmname[Ve].getstr(),Be.funcname=N.to_luastring('metamethod',!0),Be},Ee=function(De,Ke,Be){for(let Ve=Ke.l_base;Ve<Ke.top;Ve++)if(De.stack[Ve]===Be)return Ve;return!1},ke=function(De,Ke,Be){let Ve=Ke.func;for(let Ge=0;Ge<Ve.nupvalues;Ge++)if(Ve.upvals[Ge].val()===Be)return{name:se(Ve.p,Ge),funcname:N.to_luastring('upvalue',!0)};return null},ve=function(De,Ke){let Be=De.ci,Ve=null;if(Be.callstatus&V.CIST_LUA){Ve=ke(De,Be,Ke);let Ge=Ee(De,Be,Ke);!Ve&&Ge&&(Ve=xe(Be.func.value.p,Be.pcOff,Ge-Be.l_base))}return Ve?P.luaO_pushfstring(De,N.to_luastring(' (%s \'%s\')',!0),Ve.funcname,Ve.name):N.to_luastring('',!0)},Re=function(De,Ke,Be){let Ve=F.luaT_objtypename(De,Ke);Ce(De,N.to_luastring(`attempt to ${N.to_jsstring(Be)} a ${N.to_jsstring(Ve)} value${N.to_jsstring(ve(De,Ke))}`))},Ie=function(De,Ke,Be,Ve){let Ge;return Ge=Be?P.luaO_chunkid(Be.getstr(),H.LUA_IDSIZE):['?'.charCodeAt(0)],P.luaO_pushfstring(De,N.to_luastring('%s:%d: %s',!0),Ge,Ve,Ke)},Ce=function(De,Ke,...Be){let Ve=De.ci,Ge=P.luaO_pushvfstring(De,Ke,Be);Ve.callstatus&V.CIST_LUA&&Ie(De,Ge,Ve.func.value.p.source,Z(Ve)),Me(De)},Me=function(De){if(0!==De.errfunc){let Ke=De.errfunc;De.stack[De.top]=De.stack[De.top-1],De.stack[De.top-1]=De.stack[Ke],De.top++,I.luaD_callnoyield(De,De.top-2,1)}I.luaD_throw(De,W.LUA_ERRRUN)};T.exports.luaG_addinfo=Ie,T.exports.luaG_concaterror=function(De,Ke,Be){(Ke.ttisstring()||Ke.ttisnumber())&&(Ke=Be),Re(De,Ke,N.to_luastring('concatenate',!0))},T.exports.luaG_errormsg=Me,T.exports.luaG_opinterror=function(De,Ke,Be,Ve){!1===Y.tonumber(Ke)&&(Be=Ke),Re(De,Be,Ve)},T.exports.luaG_ordererror=function(De,Ke,Be){let Ve=F.luaT_objtypename(De,Ke),Ge=F.luaT_objtypename(De,Be);Ve.join()===Ge.join()?Ce(De,N.to_luastring(`attempt to compare two ${N.to_jsstring(Ve)} values`)):Ce(De,N.to_luastring(`attempt to compare ${N.to_jsstring(Ve)} with ${N.to_jsstring(Ge)}`))},T.exports.luaG_runerror=Ce,T.exports.luaG_tointerror=function(De,Ke,Be){let Ve=Y.tointeger(Ke);!1===Ve&&(Be=Ke),Ce(De,N.to_luastring(`number${N.to_jsstring(ve(De,Be))} has no integer representation`))},T.exports.luaG_traceexec=function(De){let Ke=De.ci,Be=De.hookmask,Ve=0==--De.hookcount&&Be&N.LUA_MASKCOUNT;if(Ve)De.hookcount=De.basehookcount;else if(!(Be&N.LUA_MASKLINE))return;if(Ke.callstatus&V.CIST_HOOKYIELD)return void(Ke.callstatus&=~V.CIST_HOOKYIELD);if(Ve&&I.luaD_hook(De,N.LUA_HOOKCOUNT,-1),Be&N.LUA_MASKLINE){let Ge=Ke.func.value.p,we=Ke.pcOff,Fe=Ge.lineinfo?Ge.lineinfo[we]:-1;(0===we||Ke.pcOff<=De.oldpc||Fe!==Ge.lineinfo?Ge.lineinfo[De.oldpc]:-1)&&I.luaD_hook(De,N.LUA_HOOKLINE,Fe)}De.oldpc=Ke.pcOff,De.status===W.LUA_YIELD&&(Ve&&(De.hookcount=1),Ke.l_savedpc--,Ke.callstatus|=V.CIST_HOOKYIELD,Ke.func=De.top-1,I.luaD_throw(De,W.LUA_YIELD))},T.exports.luaG_typeerror=Re,T.exports.lua_gethook=function(De){return De.hook},T.exports.lua_gethookcount=function(De){return De.basehookcount},T.exports.lua_gethookmask=function(De){return De.hookmask},T.exports.lua_getinfo=function(De,Ke,Be){let Ve,Ge,we,Fe,Xe;return Q(De),Ke[0]==='>'.charCodeAt(0)?(we=null,Xe=De.top-1,Fe=De.stack[Xe],E(De,Fe.ttisfunction(),'function expected'),Ke=Ke.slice(1),De.top--):(we=Be.i_ci,Fe=we.func,Xe=we.funcOff,E(we.func.ttisfunction())),Ge=Fe.ttisclosure()?Fe.value:null,Ve=ge(De,Ke,Be,Ge,we),0<=Ke.indexOf('f'.charCodeAt(0))&&(De.stack[De.top++]=Fe,E(De.top<=De.ci.top,'stack overflow')),Q(De),0<=Ke.indexOf('L'.charCodeAt(0))&&de(De,Ge),Ve},T.exports.lua_getlocal=function(De,Ke,Be){let Ve;if(Q(De),null===Ke)Ve=De.stack[De.top-1].ttisLclosure()?M.luaF_getlocalname(De.stack[De.top-1].value.p,Be,0):null;else{let Ge=oe(De,Ke.i_ci,Be);if(Ge){Ve=Ge.name;let we=De.stack[Ge.pos];De.stack[De.top++]=new J(we.type,we.value)}else Ve=null}return Q(De),Ve},T.exports.lua_getstack=function(De,Ke,Be){let Ve,Ge;if(0>Ke)return 0;for(Ve=De.ci;0<Ke&&Ve!==De.base_ci;Ve=Ve.previous)Ke--;return 0===Ke&&Ve!==De.base_ci?(Ge=1,Be.i_ci=Ve):Ge=0,Ge},T.exports.lua_sethook=function(De,Ke,Be,Ve){(null===Ke||0===Be)&&(Be=0,Ke=null),De.ci.callstatus&V.CIST_LUA&&(De.oldpc=De.ci.pcOff),De.hook=Ke,De.basehookcount=Ve,De.hookcount=De.basehookcount,De.hookmask=Be},T.exports.lua_setlocal=function(De,Ke,Be){Q(De);let Ve=oe(De,Ke.i_ci,Be),Ge=Ve.name,we=Ve.pos;return Ge&&(De.stack[we].type=De.stack[De.top-1].type,De.stack[we].value=De.stack[De.top-1].value,De.top--),Q(De),Ge}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(21),M=U(8),P=U(11),K=U(19),V=U(4),G=U(5),F=U(29),H=U(15),Y=U(7),J=U(16),q=U(53),W=U(17),Z=N.constant_types,Q=N.thread_status,$=function(Ie,Ce,Me){switch(Ce){case Q.LUA_ERRMEM:{Ie.stack[Me]=new G.TValue(Z.LUA_TLNGSTR,Y.luaS_newliteral(Ie,'not enough memory'));break}case Q.LUA_ERRERR:{Ie.stack[Me]=new G.TValue(Z.LUA_TLNGSTR,Y.luaS_newliteral(Ie,'error in error handling'));break}default:Ie.stack[Me]=Ie.stack[Ie.top-1];}Ie.top=Me+1},ee=function(Ie,Ce,Me){let Pe=Ie.stack[Ce],ye;switch(Pe.type){case Z.LUA_TCCL:case Z.LUA_TLCF:{let De=Pe.type===Z.LUA_TCCL?Pe.value.f:Pe.value;Ie.ci.next?(Ie.ci=Ie.ci.next,ye=Ie.ci):(ye=new H.CallInfo(Ce),Ie.ci.next=ye,ye.previous=Ie.ci,ye.next=null,Ie.ci=ye,Ie.ciOff++),ye.nresults=Me,ye.func=Pe,ye.funcOff=Ce,ye.top=Ie.top+N.LUA_MINSTACK,ye.callstatus=0,Ie.hookmask&N.LUA_MASKCALL&&ue(Ie,N.LUA_HOOKCALL,-1);let Ke=De(Ie);return E('number'==typeof Ke&&0<=Ke&&(0|Ke)===Ke,'invalid return value from JS function (expected integer)'),E(Ke<Ie.top-Ie.ci.funcOff,'not enough elements in the stack'),te(Ie,ye,Ie.top-Ke,Ke),!0}case Z.LUA_TLCL:{let De=Pe.value.p,Ke=Ie.top-Ce-1,Be=De.maxstacksize,Ve;if(De.is_vararg)Ve=se(Ie,De,Ke);else{for(;Ke<De.numparams;Ke++)Ie.stack[Ie.top++]=new G.TValue(Z.LUA_TNIL,null);Ve=Ce+1}return Ie.ci.next?(Ie.ci=Ie.ci.next,ye=Ie.ci):(ye=new H.CallInfo(Ce),Ie.ci.next=ye,ye.previous=Ie.ci,ye.next=null,Ie.ci=ye,Ie.ciOff++),ye.nresults=Me,ye.func=Pe,ye.funcOff=Ce,ye.l_base=Ve,ye.top=Ve+Be,Ie.top=ye.top,ye.l_savedpc=De.code,ye.pcOff=0,ye.callstatus=H.CIST_LUA,!1}default:return ne(Ie,Ce,Pe),ee(Ie,Ce,Me);}},te=function(Ie,Ce,Me,Pe){let ye=Ce.nresults;Ie.hookmask&(N.LUA_MASKRET|N.LUA_MASKLINE)&&(Ie.hookmask&N.LUA_MASKRET&&ue(Ie,N.LUA_HOOKRET,-1),Ie.oldpc=Ce.previous.pcOff);let De=Ce.funcOff;return Ie.ci=Ce.previous,Ie.ciOff--,ae(Ie,Me,De,Pe,ye)},ae=function(Ie,Ce,Me,Pe,ye){switch(ye){case 0:break;case 1:{0===Pe&&(Ie.stack[Ce]=G.luaO_nilobject),Ie.stack[Me]=Ie.stack[Ce];break}case N.LUA_MULTRET:{for(let De=0;De<Pe;De++)Ie.stack[Me+De]=Ie.stack[Ce+De];return Ie.top=Me+Pe,!1}default:{let De;if(ye<=Pe)for(De=0;De<ye;De++)Ie.stack[Me+De]=Ie.stack[Ce+De];else{for(De=0;De<Pe;De++)Ie.stack[Me+De]=Ie.stack[Ce+De];for(;De<ye;De++)Ie.stack[Me+De]=new G.TValue(Z.LUA_TNIL,null)}break}}return Ie.top=Me+ye,!0},ue=function(Ie,Ce,Me){let Pe=Ie.hook;if(Pe&&Ie.allowhook){let ye=Ie.ci,De=Ie.top,Ke=ye.top,Be=new N.lua_Debug;Be.event=Ce,Be.currentline=Me,Be.i_ci=ye,ye.top=Ie.top+N.LUA_MINSTACK,Ie.allowhook=0,ye.callstatus|=H.CIST_HOOKED,Pe(Ie,Be),E(!Ie.allowhook),Ie.allowhook=1,ye.top=Ke,Ie.top=De,ye.callstatus&=~H.CIST_HOOKED}},se=function(Ie,Ce,Me){let Pe=Ce.numparams,ye=Ie.top-Me,De=Ie.top,Ke;for(Ke=0;Ke<Pe&&Ke<Me;Ke++)Ie.stack[Ie.top++]=Ie.stack[ye+Ke],Ie.stack[ye+Ke]=new G.TValue(Z.LUA_TNIL,null);for(;Ke<Pe;Ke++)Ie.stack[Ie.top++]=new G.TValue(Z.LUA_TNIL,null);return De},ne=function(Ie,Ce,Me){let Pe=J.luaT_gettmbyobj(Ie,Me,J.TMS.TM_CALL);Pe.ttisfunction(Pe)||M.luaG_typeerror(Ie,Me,N.to_luastring('call',!0));for(let ye=Ie.top;ye>Ce;ye--)Ie.stack[ye]=Ie.stack[ye-1];Ie.top++,Ie.stack[Ce]=new G.TValue(Pe.type,Pe.value)},oe=function(Ie){Ie.nCcalls===V.LUAI_MAXCCALLS?M.luaG_runerror(Ie,'JS stack overflow'):Ie.nCcalls>=V.LUAI_MAXCCALLS+(V.LUAI_MAXCCALLS>>3)&&pe(Ie,Q.LUA_ERRERR)},_e=function(Ie,Ce,Me){++Ie.nCcalls>=V.LUAI_MAXCCALLS&&oe(Ie),ee(Ie,Ce,Me)||W.luaV_execute(Ie),Ie.nCcalls--},pe=function(Ie,Ce){if(Ie.errorJmp)throw Ie.errorJmp.status=Ce,Ie.errorJmp;else{let Me=Ie.l_G;if(Ie.status=Ce,Me.mainthread.errorJmp)Me.mainthread.stack[Me.mainthread.top++]=Ie.stack[Ie.top-1],pe(Me.mainthread,Ce);else throw Me.panic&&($(Ie,Ce,Ie.top),Ie.ci.top<Ie.top&&(Ie.ci.top=Ie.top),Me.panic(Ie)),new Error(`Aborted ${Ce}`)}},ce=function(Ie,Ce,Me){let Pe=Ie.nCcalls,ye={status:Q.LUA_OK,previous:Ie.errorJmp};Ie.errorJmp=ye;try{Ce(Ie,Me)}catch(De){if(ye.status===Q.LUA_OK){ye.status=-1;try{I.lua_pushlightuserdata(Ie,De),M.luaG_errormsg(Ie)}catch(Ke){}}}return Ie.errorJmp=ye.previous,Ie.nCcalls=Pe,ye.status},de=function(Ie,Ce){let Me=Ie.ci;E(null!==Me.c_k&&0===Ie.nny),E(Me.callstatus&H.CIST_YPCALL||Ce===Q.LUA_YIELD),Me.callstatus&Q.CIST_YPCALL&&(Me.callstatus&=~Q.CIST_YPCALL,Ie.errfunc=Me.c_old_errfunc),Me.nresults===N.LUA_MULTRET&&Ie.ci.top<Ie.top&&(Ie.ci.top=Ie.top);let Pe=Me.c_k(Ie,Ce,Me.c_ctx);E(Pe<Ie.top-Ie.ci.funcOff,'not enough elements in the stack'),te(Ie,Me,Ie.top-Pe,Pe)},Le=function(Ie,Ce){for(null!==Ce&&de(Ie,Ce);Ie.ci!==Ie.base_ci;)Ie.ci.callstatus&H.CIST_LUA?(W.luaV_finishOp(Ie),W.luaV_execute(Ie)):de(Ie,H.LUA_YIELD)},ge=function(Ie){for(let Ce=Ie.ci;null!==Ce;Ce=Ce.previous)if(Ce.callstatus&H.CIST_YPCALL)return Ce;return null},Ae=function(Ie,Ce){let Me=ge(Ie);if(null===Me)return 0;let Pe=Ie.stack[Me.extra];return P.luaF_close(Ie,Pe),$(Ie,Ce,Pe),Ie.ci=Me,Ie.allowhook=Me.callstatus&H.CIST_OAH,Ie.nny=0,Ie.errfunc=Me.c_old_errfunc,1},Te=function(Ie,Ce,Me){return Ie.top-=Me,Ie.stack[Ie.top++]=new G.TValue(Z.LUA_TLNGSTR,Y.luaS_newliteral(Ie,Ce)),E(Ie.top<=Ie.ci.top,'stack overflow'),Q.LUA_ERRRUN},he=function(Ie,Ce){let Me=Ie.top-Ce,Pe=Ie.ci;Ie.status===Q.LUA_OK?!ee(Ie,Me-1,N.LUA_MULTRET)&&W.luaV_execute(Ie):(E(Ie.status===Q.LUA_YIELD),Ie.status=Q.LUA_OK,Pe.funcOff=Pe.extra,Pe.func=Ie.stack[Pe.funcOff],Pe.callstatus&H.CIST_LUA?W.luaV_execute(Ie):(null!==Pe.c_k&&(Ce=Pe.c_k(Ie,Q.LUA_YIELD,Pe.c_ctx),E(Ce<Ie.top-Ie.ci.funcOff,'not enough elements in the stack'),Me=Ie.top-Ce),te(Ie,Pe,Me,Ce)),Le(Ie,null))},Ue=function(Ie,Ce,Me,Pe){let ye=Ie.ci;return E(Ce<Ie.top-Ie.ci.funcOff,'not enough elements in the stack'),0<Ie.nny&&(Ie===Ie.l_G.mainthread?M.luaG_runerror(Ie,N.to_luastring('attempt to yield from outside a coroutine',!0)):M.luaG_runerror(Ie,N.to_luastring('attempt to yield across a JS-call boundary',!0))),Ie.status=Q.LUA_YIELD,ye.extra=ye.funcOff,ye.callstatus&H.CIST_LUA?E(null===Pe,'hooks cannot continue after yielding'):(ye.c_k=Pe,null!==Pe&&(ye.c_ctx=Me),ye.funcOff=Ie.top-Ce-1,ye.func=Ie.stack[ye.funcOff],pe(Ie,Q.LUA_YIELD)),E(ye.callstatus&H.CIST_HOOKED),0},ke=function(Ie,Ce,Me,Pe,ye){let De=Ie.ci,Ke=Ie.allowhook,Be=Ie.nny,Ve=Ie.errfunc;Ie.errfunc=ye;let Ge=ce(Ie,Ce,Me);return Ge!==Q.LUA_OK&&(P.luaF_close(Ie,Pe),$(Ie,Ge,Pe),Ie.ci=De,Ie.allowhook=Ke,Ie.nny=Be),Ie.errfunc=Ve,Ge};class Re{constructor(){this.z=new K.MBuffer,this.buff=new K.MBuffer,this.dyd=new F.Dyndata,this.mode=null,this.name=null}}const be=function(Ie,Ce,Me){Ce&&-1===Ce.indexOf(Me[0])&&(I.lua_pushstring(Ie,N.to_luastring(`attempt to load a ${N.to_jsstring(Me)} chunk (mode is '${N.to_jsstring(Ce)}')`)),pe(Ie,Q.LUA_ERRSYNTAX))},Se=function(Ie,Ce){let Pe=Ce.z.getc(),Me;Pe===N.LUA_SIGNATURE.charCodeAt(0)?(be(Ie,Ce.mode,N.to_luastring('binary',!0)),Me=q.luaU_undump(Ie,Ce.z,Ce.name)):(be(Ie,Ce.mode,N.to_luastring('text',!0)),Me=F.luaY_parser(Ie,Ce.z,Ce.buff,Ce.dyd,Ce.name,Pe)),E(Me.nupvalues===Me.p.upvalues.length),P.luaF_initupvals(Ie,Me)};T.exports.SParser=Re,T.exports.adjust_varargs=se,T.exports.luaD_call=_e,T.exports.luaD_callnoyield=function(Ie,Ce,Me){Ie.nny++,_e(Ie,Ce,Me),Ie.nny--},T.exports.luaD_hook=ue,T.exports.luaD_pcall=ke,T.exports.luaD_poscall=te,T.exports.luaD_precall=ee,T.exports.luaD_protectedparser=function(Ie,Ce,Me,Pe){let ye=new Re;Ie.nny++,ye.z=Ce,ye.buff.L=Ie,ye.name=Me,ye.mode=Pe,ye.dyd.actvar.arr=[],ye.dyd.actvar.size=0,ye.dyd.gt.arr=[],ye.dyd.gt.size=0,ye.dyd.label.arr=[],ye.dyd.label.size=0;let De=ke(Ie,Se,ye,Ie.top,Ie.errfunc);return Ie.nny--,De},T.exports.luaD_rawrunprotected=ce,T.exports.luaD_throw=pe,T.exports.lua_isyieldable=function(Ie){return 0===Ie.nny},T.exports.lua_resume=function(Ie,Ce,Me){let Pe=Ie.nny;if(Ie.status===Q.LUA_OK){if(Ie.ci!==Ie.base_ci)return Te(Ie,'cannot resume non-suspended coroutine',Me);}else if(Ie.status!==Q.LUA_YIELD)return Te(Ie,'cannot resume dead coroutine',Me);if(Ie.nCcalls=Ce?Ce.nCcalls+1:1,Ie.nCcalls>=V.LUAI_MAXCCALLS)return Te(Ie,'JS stack overflow',Me);Ie.nny=0,E((Ie.status===Q.LUA_OK?Me+1:Me)<Ie.top-Ie.ci.funcOff,'not enough elements in the stack');let ye=ce(Ie,he,Me);if(-1===ye)ye=Q.LUA_ERRRUN;else{for(;ye>Q.LUA_YIELD&&Ae(Ie,ye);)ye=ce(Ie,Le,ye);ye>Q.LUA_YIELD?(Ie.status=ye,$(Ie,ye,Ie.top),Ie.ci.top=Ie.top):E(ye===Ie.status)}return Ie.nny=Pe,Ie.nCcalls--,E(Ie.nCcalls===(Ce?Ce.nCcalls:0)),ye},T.exports.lua_yield=function(Ie,Ce){Ue(Ie,Ce,0,null)},T.exports.lua_yieldk=Ue,T.exports.moveresults=ae,T.exports.stackerror=oe,T.exports.tryfuncTM=ne},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(8),M=U(5),P=U(7),K=N.constant_types,V=function(ae){switch(ae.type){case K.LUA_TBOOLEAN:case K.LUA_TLIGHTUSERDATA:case K.LUA_TNUMFLT:case K.LUA_TNUMINT:case K.LUA_TTABLE:case K.LUA_TLCL:case K.LUA_TLCF:case K.LUA_TCCL:case K.LUA_TUSERDATA:case K.LUA_TTHREAD:return ae.value;case K.LUA_TSHRSTR:case K.LUA_TLNGSTR:return P.luaS_hashlongstr(ae.tsvalue());default:throw new Error('unknown key type: '+ae.type);}};class G{constructor(ae){this.id=ae.l_G.id_counter++,this.strong=new Map,this.metatable=null}}const H=function(ae,ue){let se=ae.strong.get(ue);return se?se.value:M.luaO_nilobject},Y=function(ae,ue){return E('number'==typeof ue&&(0|ue)===ue),H(ae,ue)},W=function(ae,ue,se){let ne=ae.strong.get(ue);if(ne)return ne.value;let oe=new M.TValue(K.LUA_TNIL,null);return ae.strong.set(ue,{key:se,value:oe}),oe};T.exports.luaH_delete=function(ae,ue){E(ue instanceof M.TValue);let se=V(ue);ae.strong.delete(se)},T.exports.luaH_get=function(ae,ue){return E(ue instanceof M.TValue),ue.ttisnil()?M.luaO_nilobject:H(ae,V(ue))},T.exports.luaH_getint=Y,T.exports.luaH_getn=function(ae){let ue=0,se=ae.strong.size+1;for(;1<se-ue;){let ne=_Mathfloor((ue+se)/2);Y(ae,ne).ttisnil()?se=ne:ue=ne}return ue},T.exports.luaH_getstr=function(ae,ue){return E(ue instanceof P.TString),H(ae,P.luaS_hashlongstr(ue))},T.exports.luaH_set=function(ae,ue){E(ue instanceof M.TValue);let se=V(ue);return W(ae,se,new M.TValue(ue.type,ue.value))},T.exports.luaH_setint=function(ae,ue,se){E('number'==typeof ue&&(0|ue)===ue&&se instanceof M.TValue);let ne=ue,oe=ae.strong.get(ne);if(oe){let _e=oe.value;_e.setfrom(se)}else ae.strong.set(ne,{key:new M.TValue(K.LUA_TNUMINT,ue),value:new M.TValue(se.type,se.value)})},T.exports.luaH_new=function(ae){return new G(ae)},T.exports.luaH_next=function(ae,ue,se){let ne=ae.stack[se],oe;if(ne.type===K.LUA_TNIL)oe=ue.strong.keys().next();else{let pe=V(ne);if(!ue.strong.has(pe))return I.luaG_runerror(ae,'invalid key to \'next\'');let ce=ue.strong.keys();for(;;){let de=ce.next();if(de.done)throw'unreachable';else if(de.value==pe)break}oe=ce.next()}if(oe.done)return!1;let _e=ue.strong.get(oe.value);return ae.stack[se]=new M.TValue(_e.key.type,_e.key.value),ae.stack[se+1]=new M.TValue(_e.value.type,_e.value.value),!0}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(5),M=N.constant_types;class K{constructor(){this.L=null,this.v=null,this.open_next=null,this.refcount=0,this.value=null}val(){return null===this.v?this.value:this.L.stack[this.v]}isopen(){return null!==this.v}}T.exports.MAXUPVAL=255,T.exports.Proto=class{constructor(J){this.id=J.l_G.id_counter++,this.k=[],this.p=[],this.code=[],this.cache=null,this.lineinfo=[],this.upvalues=[],this.numparams=0,this.is_vararg=0,this.maxstacksize=0,this.locvars=[],this.linedefined=0,this.lastlinedefined=0,this.source=null}},T.exports.UpVal=K,T.exports.luaF_findupval=function(J,q){let W=J.openupval,Z=W;for(;null!==W&&W.v>=q;){if(Z=W,E(Z.isopen()),Z.v===q)return Z;W=Z.open_next}let Q=new K;return Z&&(Q.open_next=Z),J.openupval=Q,Q.L=J,Q.v=q,Q},T.exports.luaF_close=function(J,q){for(;null!==J.openupval&&J.openupval.v>=q;){let W=J.openupval;if(E(W.isopen()),J.openupval=W.open_next,0<W.refcount){let Z=W.L.stack[W.v];W.L=null,W.v=null,W.value=new I.TValue(Z.type,Z.value)}}},T.exports.luaF_getlocalname=function(J,q,W){for(let Z=0;Z<J.locvars.length&&J.locvars[Z].startpc<=W;Z++)if(W<J.locvars[Z].endpc&&(q--,0===q))return J.locvars[Z].varname.getstr();return null},T.exports.luaF_initupvals=function(J,q){for(let W=0,Z;W<q.nupvalues;W++)Z=new K(J),Z.refcount=1,Z.value=new I.TValue(M.LUA_TNIL,null),q.upvals[W]=Z},T.exports.luaF_newLclosure=function(J,q){let W=new I.LClosure(J,q);return W}},function(T,O,U){'use strict';const E=U(4),P='',V=`%${P}d`,Y=function(J,q){for(var W=_Mathmin(3,_Mathceil(_Mathabs(q)/1023)),Z=J,Q=0;Q<W;Q++)Z*=_Mathpow(2,_Mathfloor((q+Q)/W));return Z};T.exports.frexp=function(J){if(0===J)return[J,0];var q=new DataView(new ArrayBuffer(8));q.setFloat64(0,J);var W=2047&q.getUint32(0)>>>20;0==W&&(q.setFloat64(0,18446744073709552000*J),W=(2047&q.getUint32(0)>>>20)-64);var Z=W-1022,Q=Y(J,-Z);return[Q,Z]},T.exports.ldexp=Y,T.exports.LUAI_MAXSTACK=1e6,T.exports.LUA_IDSIZE=60,T.exports.LUA_INTEGER_FMT=V,T.exports.LUA_INTEGER_FRMLEN=P,T.exports.LUA_NUMBER_FMT='%.14g',T.exports.LUA_NUMBER_FRMLEN='',T.exports.lua_getlocaledecpoint=function(){return 1.1.toLocaleString().substring(1,2)},T.exports.lua_numbertointeger=function(J){return J>=E.MIN_INT&&J<-E.MIN_INT?J:0}},function(T,O){(function(U){T.exports=U}).call(O,{})},function(T){T.exports=function(U){return U.webpackPolyfill||(U.deprecate=function(){},U.paths=[],!U.children&&(U.children=[]),Object.defineProperty(U,'loaded',{enumerable:!0,get:function(){return U.l}}),Object.defineProperty(U,'id',{enumerable:!0,get:function(){return U.i}}),U.webpackPolyfill=1),U}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(5),M=U(9),P=U(21),K=U(10),V=U(11),G=U(16),F=N.constant_types,H=N.thread_status,Y=N.LUA_NUMTAGS,J=2*N.LUA_MINSTACK;class q{constructor(oe,_e,pe,ce,de,Le){this.func=_e,this.funcOff=oe,this.top=pe,this.previous=de,this.next=Le,this.pcOff=0,this.l_base=ce,this.l_savedpc=[],this.c_k=null,this.c_old_errfunc=null,this.c_ctx=null,this.nresults=0,this.callstatus=0}}class W{constructor(){this.id=null,this.base_ci=new q,this.top=0,this.ci=null,this.ciOff=null,this.stack=[],this.openupval=null,this.status=H.LUA_OK,this.next=null,this.errorJmp=null,this.nny=1,this.errfunc=0}}class Z{constructor(oe){this.id_counter=0,this.mainthread=oe,this.l_registry=new I.TValue(F.LUA_TNIL,null),this.panic=null,this.version=null,this.tmname=Array(G.TMS.TM_N),this.mt=Array(Y)}}const Q=function(oe){oe.stack=Array(J),oe.top=0;let pe=oe.base_ci;pe.next=pe.previous=null,pe.callstatus=0,pe.func=oe.stack[oe.top],pe.funcOff=oe.top,oe.stack[oe.top++]=new I.TValue(F.LUA_TNIL,null),pe.top=oe.top+N.LUA_MINSTACK,oe.ci=pe},$=function(oe,_e){let pe=K.luaH_new(oe);_e.l_registry.sethvalue(pe),K.luaH_setint(pe,N.LUA_RIDX_MAINTHREAD,new I.TValue(F.LUA_TTHREAD,oe)),K.luaH_setint(pe,N.LUA_RIDX_GLOBALS,new I.TValue(F.LUA_TTABLE,K.luaH_new(oe)))},ee=function(oe){let _e=oe.l_G;Q(oe,oe),$(oe,_e),G.luaT_init(oe),_e.version=P.lua_version(null)},te=function(oe,_e){oe.id=_e.id_counter++,oe.l_G=_e,oe.stack=[],oe.ci=null,oe.nci=0,oe.errorJmp=null,oe.nCcalls=0,oe.hook=null,oe.hookmask=0,oe.basehookcount=0,oe.allowhook=1,oe.hookcount=oe.basehookcount,oe.openupval=null,oe.nny=1,oe.status=H.LUA_OK,oe.errfunc=0},se=function(oe){V.luaF_close(oe,oe.stack)};T.exports.lua_State=W,T.exports.CallInfo=q,T.exports.CIST_OAH=1,T.exports.CIST_LUA=2,T.exports.CIST_HOOKED=4,T.exports.CIST_FRESH=8,T.exports.CIST_YPCALL=16,T.exports.CIST_TAIL=32,T.exports.CIST_HOOKYIELD=64,T.exports.CIST_LEQ=128,T.exports.CIST_FIN=256,T.exports.lua_close=function(oe){oe=oe.l_G.mainthread,se(oe)},T.exports.lua_newstate=function(){let oe=new W,_e=new Z(oe);return te(oe,_e),M.luaD_rawrunprotected(oe,ee,null)!==H.LUA_OK&&(oe=null),oe},T.exports.lua_newthread=function(oe){let _e=oe.l_G,pe=new W;return oe.stack[oe.top++]=new I.TValue(F.LUA_TTHREAD,pe),E(oe.top<=oe.ci.top,'stack overflow'),te(pe,_e),pe.hookmask=oe.hookmask,pe.basehookcount=oe.basehookcount,pe.hook=oe.hook,pe.hookcount=pe.basehookcount,Q(pe,oe),pe}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(5),M=U(9),P=U(15),K=U(7),V=U(10),G=U(8),F=U(17),H=N.constant_types,Y=['no value','nil','boolean','userdata','number','string','table','function','userdata','thread','proto'].map((ue)=>N.to_luastring(ue)),J=function(ue){return Y[ue+1]},q={TM_INDEX:0,TM_NEWINDEX:1,TM_GC:2,TM_MODE:3,TM_LEN:4,TM_EQ:5,TM_ADD:6,TM_SUB:7,TM_MUL:8,TM_MOD:9,TM_POW:10,TM_DIV:11,TM_IDIV:12,TM_BAND:13,TM_BOR:14,TM_BXOR:15,TM_SHL:16,TM_SHR:17,TM_UNM:18,TM_BNOT:19,TM_LT:20,TM_LE:21,TM_CONCAT:22,TM_CALL:23,TM_N:24},Q=function(ue,se,ne,oe,_e,pe){let ce=_e,de=ue.top;ue.stack[ue.top]=new I.TValue(se.type,se.value),ue.stack[ue.top+1]=new I.TValue(ne.type,ne.value),ue.stack[ue.top+2]=new I.TValue(oe.type,oe.value),ue.top+=3,pe||(ue.stack[ue.top++]=new I.TValue(_e.type,_e.value)),ue.ci.callstatus&P.CIST_LUA?M.luaD_call(ue,de,pe):M.luaD_callnoyield(ue,de,pe),pe&&(E('number'==typeof ce),ue.stack[ce]=ue.stack[--ue.top])},$=function(ue,se,ne,oe,_e){let pe=ae(ue,se,_e);return(pe.ttisnil()&&(pe=ae(ue,ne,_e)),!pe.ttisnil())&&(Q(ue,pe,se,ne,oe,1),!0)},ae=function(ue,se,ne){let oe;switch(se.ttnov()){case H.LUA_TTABLE:case H.LUA_TUSERDATA:oe=se.value.metatable;break;default:oe=ue.l_G.mt[se.ttnov()];}return oe?V.luaH_getstr(oe,ue.l_G.tmname[ne]):I.luaO_nilobject};T.exports.TMS=q,T.exports.luaT_callTM=Q,T.exports.luaT_callbinTM=$,T.exports.luaT_trybinTM=function(ue,se,ne,oe,_e){if(!$(ue,se,ne,oe,_e))switch(_e){case q.TM_CONCAT:G.luaG_concaterror(ue,se,ne);case q.TM_BAND:case q.TM_BOR:case q.TM_BXOR:case q.TM_SHL:case q.TM_SHR:case q.TM_BNOT:{let pe=F.tonumber(se),ce=F.tonumber(ne);!1!==pe&&!1!==ce?G.luaG_tointerror(ue,se,ne):G.luaG_opinterror(ue,se,ne,N.to_luastring('perform bitwise operation on',!0))}default:G.luaG_opinterror(ue,se,ne,N.to_luastring('perform arithmetic on',!0));}},T.exports.luaT_callorderTM=function(ue,se,ne,oe){return $(ue,se,ne,ue.top,oe)?ue.stack[ue.top].l_isfalse()?0:1:-1},T.exports.luaT_gettmbyobj=ae,T.exports.luaT_init=function(ue){ue.l_G.tmname[q.TM_INDEX]=new K.luaS_new(ue,N.to_luastring('__index',!0)),ue.l_G.tmname[q.TM_NEWINDEX]=new K.luaS_new(ue,N.to_luastring('__newindex',!0)),ue.l_G.tmname[q.TM_GC]=new K.luaS_new(ue,N.to_luastring('__gc',!0)),ue.l_G.tmname[q.TM_MODE]=new K.luaS_new(ue,N.to_luastring('__mode',!0)),ue.l_G.tmname[q.TM_LEN]=new K.luaS_new(ue,N.to_luastring('__len',!0)),ue.l_G.tmname[q.TM_EQ]=new K.luaS_new(ue,N.to_luastring('__eq',!0)),ue.l_G.tmname[q.TM_ADD]=new K.luaS_new(ue,N.to_luastring('__add',!0)),ue.l_G.tmname[q.TM_SUB]=new K.luaS_new(ue,N.to_luastring('__sub',!0)),ue.l_G.tmname[q.TM_MUL]=new K.luaS_new(ue,N.to_luastring('__mul',!0)),ue.l_G.tmname[q.TM_MOD]=new K.luaS_new(ue,N.to_luastring('__mod',!0)),ue.l_G.tmname[q.TM_POW]=new K.luaS_new(ue,N.to_luastring('__pow',!0)),ue.l_G.tmname[q.TM_DIV]=new K.luaS_new(ue,N.to_luastring('__div',!0)),ue.l_G.tmname[q.TM_IDIV]=new K.luaS_new(ue,N.to_luastring('__idiv',!0)),ue.l_G.tmname[q.TM_BAND]=new K.luaS_new(ue,N.to_luastring('__band',!0)),ue.l_G.tmname[q.TM_BOR]=new K.luaS_new(ue,N.to_luastring('__bor',!0)),ue.l_G.tmname[q.TM_BXOR]=new K.luaS_new(ue,N.to_luastring('__bxor',!0)),ue.l_G.tmname[q.TM_SHL]=new K.luaS_new(ue,N.to_luastring('__shl',!0)),ue.l_G.tmname[q.TM_SHR]=new K.luaS_new(ue,N.to_luastring('__shr',!0)),ue.l_G.tmname[q.TM_UNM]=new K.luaS_new(ue,N.to_luastring('__unm',!0)),ue.l_G.tmname[q.TM_BNOT]=new K.luaS_new(ue,N.to_luastring('__bnot',!0)),ue.l_G.tmname[q.TM_LT]=new K.luaS_new(ue,N.to_luastring('__lt',!0)),ue.l_G.tmname[q.TM_LE]=new K.luaS_new(ue,N.to_luastring('__le',!0)),ue.l_G.tmname[q.TM_CONCAT]=new K.luaS_new(ue,N.to_luastring('__concat',!0)),ue.l_G.tmname[q.TM_CALL]=new K.luaS_new(ue,N.to_luastring('__call',!0))},T.exports.luaT_objtypename=function(ue,se){let ne;if(se.ttistable()&&null!==(ne=se.value.metatable)||se.ttisfulluserdata()&&null!==(ne=se.value.metatable)){let oe=V.luaH_getstr(ne,N.to_luastring('__name',!0));if(oe.ttisstring())return oe.svalue()}return J(se.ttnov())},T.exports.ttypename=J},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(20),M=U(12),P=U(5),K=U(11),V=U(15),G=U(7),F=U(4),H=U(9),Y=U(16),J=U(10),q=U(8),W=N.constant_types,Z=N.LUA_MULTRET,$=function(Pe,ye,De){return ye+De.A},ee=function(Pe,ye,De){return ye+De.B},ae=function(Pe,ye,De,Ke){return I.ISK(Ke.B)?De[I.INDEXK(Ke.B)]:Pe.stack[ye+Ke.B]},ue=function(Pe,ye,De,Ke){return I.ISK(Ke.C)?De[I.INDEXK(Ke.C)]:Pe.stack[ye+Ke.C]},ne=function(Pe,ye,De,Ke){let Be=De.A;0!==Be&&K.luaF_close(Pe,ye.l_base+Be-1),ye.pcOff+=De.sBx+Ke},oe=function(Pe,ye){ne(Pe,ye,ye.l_savedpc[ye.pcOff],1)},_e=function(Pe,ye,De){if(ye.ttisnumber()&&De.ttisnumber())return he(ye,De)?1:0;if(ye.ttisstring()&&De.ttisstring())return 0>Ee(ye.tsvalue(),De.tsvalue())?1:0;let Ke=Y.luaT_callorderTM(Pe,ye,De,Y.TMS.TM_LT);return 0>Ke&&q.luaG_ordererror(Pe,ye,De),Ke?1:0},pe=function(Pe,ye,De){let Ke;return ye.ttisnumber()&&De.ttisnumber()?Oe(ye,De)?1:0:ye.ttisstring()&&De.ttisstring()?0>=Ee(ye.tsvalue(),De.tsvalue())?1:0:(Ke=Y.luaT_callorderTM(Pe,ye,De,Y.TMS.TM_LE),0<=Ke)?Ke?1:0:(Pe.ci.callstatus|=V.CIST_LEQ,Ke=Y.luaT_callorderTM(Pe,ye,De,Y.TMS.TM_LT),Pe.ci.callstatus^=V.CIST_LEQ,0>Ke&&q.luaG_ordererror(Pe,ye,De),1===Ke?0:1)},ce=function(Pe,ye,De){if(ye.ttype()!==De.ttype())return ye.ttnov()!==De.ttnov()||ye.ttnov()!==W.LUA_TNUMBER?0:_Mathfloor(ye.value)===_Mathfloor(De.value)?1:0;let Ke;switch(ye.ttype()){case W.LUA_TNIL:return 1;case W.LUA_TBOOLEAN:return ye.value==De.value?1:0;case W.LUA_TNUMINT:case W.LUA_TNUMFLT:case W.LUA_TLCF:return ye.value===De.value?1:0;case W.LUA_TSHRSTR:case W.LUA_TLNGSTR:return G.luaS_eqlngstr(ye.tsvalue(),De.tsvalue())?1:0;case W.LUA_TLIGHTUSERDATA:case W.LUA_TUSERDATA:case W.LUA_TTABLE:if(ye.value===De.value)return 1;if(null===Pe)return 0;Ke=Y.luaT_gettmbyobj(Pe,ye,Y.TMS.TM_EQ),Ke.ttisnil()&&(Ke=Y.luaT_gettmbyobj(Pe,De,Y.TMS.TM_EQ));break;default:return ye.value===De.value?1:0;}return!Ke||Ke.ttisnil()?0:(Y.luaT_callTM(Pe,Ke,ye,De,Pe.top,1),Pe.stack[Pe.top].l_isfalse()?0:1)},Le=function(Pe,ye){let De=!1,Ke=ge(Pe,0>ye?2:1);if(!1===Ke){let Be=Te(Pe);if(!1===Be)return!1;0<Be?(Ke=F.LUA_MAXINTEGER,0>ye&&(De=!0)):(Ke=F.LUA_MININTEGER,0<=ye&&(De=!0))}return{casted:!0,stopnow:De,ilimit:Ke}},ge=function(Pe,ye){if(Pe.ttisfloat()){let De=Pe.value,Ke=_Mathfloor(De);if(De!==Ke){if(0===ye)return!1;1<ye&&(Ke+=1)}let Be=M.lua_numbertointeger(Ke);return 0===Be?0===De&&0:Be}return Pe.ttisinteger()?Pe.value:!!Pe.ttisstring()&&ge(P.luaO_str2num(Pe.svalue()),ye)},Ae=function(Pe){return Pe.ttisinteger()?Pe.value:ge(Pe,0)},Te=function(Pe){return Pe.ttnov()===W.LUA_TNUMBER?Pe.value:Pe.ttnov()===W.LUA_TSTRING&&P.luaO_str2num(Pe.svalue())},he=function(Pe,ye){return Pe.ttisinteger()?ye.ttisinteger()?Pe.value<ye.value?1:0:Ue(ye.value,Pe.value):ye.ttisfloat()?Pe.value<ye.value?1:0:isNaN(Pe.value)?0:!xe(ye.value,Pe.value)},Oe=function(Pe,ye){return Pe.ttisinteger()?ye.ttisinteger()?Pe.value<=ye.value?1:0:xe(Pe.value,ye.value):ye.ttisfloat()?Pe.value<=ye.value?1:0:!isNaN(Pe.value)&&!Ue(ye.value,Pe.value)},xe=function(Pe,ye){return Pe<=ye?1:0},Ue=function(Pe,ye){return Pe<ye?1:0},Ee=function(Pe,ye){let De=Pe.getstr(),Ke=Pe.tsslen(),Be=N.to_jsstring(De),Ve=ye.getstr(),Ge=ye.tsslen(),we=N.to_jsstring(Ve);for(;;){let Fe=Be===we;if(!Fe)return Be<we?-1:1;let Xe=Be.length;if(Xe===Ge)return Xe===Ke?0:1;if(Xe===Ke)return-1;Xe++,De=De.slice(Xe),Ke-=Xe,Ve=Ve.slice(Xe),Ge-=Xe,Be=N.to_jsstring(De),we=N.to_jsstring(Ve)}},ke=function(Pe,ye,De){let Ke;switch(De.ttype()){case W.LUA_TTABLE:{if(Ke=Y.luaT_gettmbyobj(Pe,De,Y.TMS.TM_LEN),!Ke.ttisnil())break;return void(Pe.stack[ye]=new P.TValue(W.LUA_TNUMINT,J.luaH_getn(De.value)))}case W.LUA_TSHRSTR:case W.LUA_TLNGSTR:return void(Pe.stack[ye]=new P.TValue(W.LUA_TNUMINT,De.vslen()));default:{Ke=Y.luaT_gettmbyobj(Pe,De,Y.TMS.TM_LEN),Ke.ttisnil()&&q.luaG_typeerror(Pe,De,N.to_luastring('get length of',!0));break}}Y.luaT_callTM(Pe,Ke,De,De,ye,1)},ve=function(Pe,ye){let De=Pe.stack[ye];return!!De.ttisstring()||De.ttisnumber()&&!isNaN(De.value)&&(Pe.stack[ye]=new P.TValue(W.LUA_TLNGSTR,G.luaS_bless(Pe,N.to_luastring(`${De.value}`))),!0)},Re=function(Pe){return Pe.ttisstring()&&0===Pe.vslen()},be=function(Pe,ye){E(2<=ye);do{let De=Pe.top,Ke=2;if(!(Pe.stack[De-2].ttisstring()||Pe.stack[De-2].ttisnumber())||!ve(Pe,De-1))Y.luaT_trybinTM(Pe,Pe.stack[De-2],Pe.stack[De-1],De-2,Y.TMS.TM_CONCAT),delete Pe.stack[De-1];else if(Re(Pe.stack[De-1]))ve(Pe,De-2),delete Pe.stack[De-1];else if(Re(Pe.stack[De-2]))Pe.stack[De-2]=Pe.stack[De-1],delete Pe.stack[De-1];else{let Be=Array(ye);for(Be[ye-1]=Pe.stack[De-1].svalue(),delete Pe.stack[De-1],Ke=1;Ke<ye&&ve(Pe,De-Ke-1);Ke++)Be[ye-Ke-1]=Pe.stack[De-Ke-1].svalue(),delete Pe.stack[De-Ke-1];let Ve=G.luaS_bless(Pe,Array.prototype.concat.apply([],Be));Pe.stack[De-Ke]=new P.TValue(W.LUA_TLNGSTR,Ve)}ye-=Ke-1,Pe.top-=Ke-1}while(1<ye)},Se=2e3,Ne=function(Pe,ye,De,Ke,Be){if(Be=Be?Be:0,Be>=Se&&q.luaG_runerror(Pe,N.to_luastring('\'__index\' chain too long; possible loop',!0)),ye.ttistable()){let Ve=J.luaH_get(ye.value,De);Ve.ttisnil()?Ie(Pe,ye,De,Ke,Ve,Be):Pe.stack[Ke]=new P.TValue(Ve.type,Ve.value)}else Ie(Pe,ye,De,Ke,null,Be)},Ie=function(Pe,ye,De,Ke,Be,Ve){let Ge;if(null===Be)E(!ye.ttistable()),Ge=Y.luaT_gettmbyobj(Pe,ye,Y.TMS.TM_INDEX),Ge.ttisnil()&&q.luaG_typeerror(Pe,ye,N.to_luastring('index',!0));else if(E(Be.ttisnil()),Ge=Y.luaT_gettmbyobj(Pe,ye,Y.TMS.TM_INDEX),Ge.ttisnil())return void(Pe.stack[Ke]=new P.TValue(W.LUA_TNIL,null));return Ge.ttisfunction()?void Y.luaT_callTM(Pe,Ge,ye,De,Ke,1):void Ne(Pe,Ge,De,Ke,Ve+1)},Ce=function(Pe,ye,De,Ke,Be){if(Be=Be?Be:0,Be>=Se&&q.luaG_runerror(Pe,N.to_luastring('\'__newindex\' chain too long; possible loop',!0)),ye.ttistable()){let Ve=J.luaH_set(ye.value,De);Ve.ttisnil()?Me(Pe,ye,De,Ke,Ve,Be):Ve.setfrom(Ke)}else Me(Pe,ye,De,Ke,null,Be)},Me=function(Pe,ye,De,Ke,Be,Ve){let Ge;if(null===Be)Ge=Y.luaT_gettmbyobj(Pe,ye,Y.TMS.TM_NEWINDEX),Ge.ttisnil()&&q.luaG_typeerror(Pe,ye,N.to_luastring('index',!0));else if(E(Be.ttisnil()),Ge=Y.luaT_gettmbyobj(Pe,ye,Y.TMS.TM_NEWINDEX),Ge.ttisnil())return void Be.setfrom(Ke);return Ge.ttisfunction()?void Y.luaT_callTM(Pe,Ge,ye,De,Ke,0):void Ce(Pe,Ge,De,Ke,Ve+1)};T.exports.LEintfloat=xe,T.exports.LEnum=Oe,T.exports.LTintfloat=Ue,T.exports.LTnum=he,T.exports.RA=$,T.exports.RB=ee,T.exports.RC=function(Pe,ye,De){return ye+De.C},T.exports.RKB=ae,T.exports.RKC=ue,T.exports.dojump=ne,T.exports.donextjump=oe,T.exports.forlimit=Le,T.exports.gettable=Ne,T.exports.l_strcmp=Ee,T.exports.luaV_concat=be,T.exports.luaV_equalobj=ce,T.exports.luaV_execute=function(Pe){const ye=I.OpCodesI;let De=Pe.ci;De.callstatus|=V.CIST_FRESH;newframe:for(;;){E(De===Pe.ci);let Ke=De.func.value,Be=Ke.p.k,Ve=De.l_base,Ge=De.l_savedpc[De.pcOff++];Pe.hookmask&(N.LUA_MASKLINE|N.LUA_MASKCOUNT)&&(q.luaG_traceexec(Pe),Ve=De.l_base);let we=$(Pe,Ve,Ge),Fe=Ge.opcode;switch(Fe){case ye.OP_MOVE:{Pe.stack[we]=Pe.stack[ee(Pe,Ve,Ge)];break}case ye.OP_LOADK:{let Xe=Be[Ge.Bx];Pe.stack[we]=new P.TValue(Xe.type,Xe.value);break}case ye.OP_LOADKX:{E(De.l_savedpc[De.pcOff].opcode===ye.OP_EXTRAARG);let Xe=Be[De.l_savedpc[De.pcOff++].Ax];Pe.stack[we]=new P.TValue(Xe.type,Xe.value);break}case ye.OP_LOADBOOL:{Pe.stack[we]=new P.TValue(W.LUA_TBOOLEAN,0!==Ge.B),0!==Ge.C&&De.pcOff++;break}case ye.OP_LOADNIL:{for(let Xe=0;Xe<=Ge.B;Xe++)Pe.stack[we+Xe]=new P.TValue(W.LUA_TNIL,null);break}case ye.OP_GETUPVAL:{let Xe=Ke.upvals[Ge.B].val();Pe.stack[we]=new P.TValue(Xe.type,Xe.value);break}case ye.OP_SETUPVAL:{let Xe=Ke.upvals[Ge.B];null===Xe.v?Xe.value.setfrom(Pe.stack[we]):Xe.L.stack[Xe.v]=Pe.stack[we];break}case ye.OP_GETTABUP:{let Xe=Ke.upvals[Ge.B].val(),He=ue(Pe,Ve,Be,Ge);Ne(Pe,Xe,He,we),Ve=De.l_base;break}case ye.OP_SETTABUP:{let Xe=Ke.upvals[Ge.A].val(),He=ae(Pe,Ve,Be,Ge),je=ue(Pe,Ve,Be,Ge);Ce(Pe,Xe,He,je),Ve=De.l_base;break}case ye.OP_GETTABLE:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge);Ne(Pe,Xe,He,we),Ve=De.l_base;break}case ye.OP_SETTABLE:{let Xe=Pe.stack[we],He=ae(Pe,Ve,Be,Ge),je=ue(Pe,Ve,Be,Ge);Ce(Pe,Xe,He,je),Ve=De.l_base;break}case ye.OP_NEWTABLE:{Pe.stack[we]=new P.TValue(W.LUA_TTABLE,J.luaH_new(Pe));break}case ye.OP_SELF:{let Xe=Pe.stack[ee(Pe,Ve,Ge)],He=ue(Pe,Ve,Be,Ge);Pe.stack[we+1]=Xe,Ne(Pe,Xe,He,we),Ve=De.l_base;break}case ye.OP_ADD:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);Xe.ttisinteger()&&He.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,0|Xe.value+He.value):!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,je+ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_ADD),Ve=De.l_base);break}case ye.OP_SUB:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);Xe.ttisinteger()&&He.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,0|Xe.value-He.value):!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,je-ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_SUB),Ve=De.l_base);break}case ye.OP_MUL:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);Xe.ttisinteger()&&He.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,0|Xe.value*He.value):!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,je*ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_MUL),Ve=De.l_base);break}case ye.OP_MOD:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);Xe.ttisinteger()&&He.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,0|Xe.value-_Mathfloor(Xe.value/He.value)*He.value):!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,je-_Mathfloor(je/ze)*ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_MOD),Ve=De.l_base);break}case ye.OP_POW:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,_Mathpow(je,ze)):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_POW),Ve=De.l_base);break}case ye.OP_DIV:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,je/ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_DIV),Ve=De.l_base);break}case ye.OP_IDIV:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);Xe.ttisinteger()&&He.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,0|_Mathfloor(Xe.value/He.value)):!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,_Mathfloor(je/ze)):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_IDIV),Ve=De.l_base);break}case ye.OP_BAND:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Ae(Xe),ze=Ae(He);!1!==je&&ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,je&ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_BAND),Ve=De.l_base);break}case ye.OP_BOR:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Ae(Xe),ze=Ae(He);!1!==je&&ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,je|ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_BOR),Ve=De.l_base);break}case ye.OP_BXOR:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Ae(Xe),ze=Ae(He);!1!==je&&ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,je^ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_BXOR),Ve=De.l_base);break}case ye.OP_SHL:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Ae(Xe),ze=Ae(He);!1!==je&&ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,je<<ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_SHL),Ve=De.l_base);break}case ye.OP_SHR:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Ae(Xe),ze=Ae(He);!1!==je&&ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,je>>ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_SHR),Ve=De.l_base);break}case ye.OP_UNM:{let Xe=Pe.stack[ee(Pe,Ve,Ge)],He=Te(Xe);Xe.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,-Xe.value):!1===He?(Y.luaT_trybinTM(Pe,Xe,Xe,we,Y.TMS.TM_UNM),Ve=De.l_base):Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,-He);break}case ye.OP_BNOT:{let Xe=Pe.stack[ee(Pe,Ve,Ge)],He=Te(Xe);Xe.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,~Xe.value):(Y.luaT_trybinTM(Pe,Xe,Xe,we,Y.TMS.TM_BNOT),Ve=De.l_base);break}case ye.OP_NOT:{let Xe=Pe.stack[ee(Pe,Ve,Ge)];Pe.stack[we]=new P.TValue(W.LUA_TBOOLEAN,Xe.l_isfalse());break}case ye.OP_LEN:{ke(Pe,we,Pe.stack[ee(Pe,Ve,Ge)]),Ve=De.l_base;break}case ye.OP_CONCAT:{let Xe=Ge.B,He=Ge.C,je;Pe.top=Ve+He+1,be(Pe,He-Xe+1),Ve=De.l_base,we=$(Pe,Ve,Ge),je=Ve+Xe,Pe.stack[we]=Pe.stack[je],Pe.top=De.top;break}case ye.OP_JMP:{ne(Pe,De,Ge,0);break}case ye.OP_EQ:{ce(Pe,ae(Pe,Ve,Be,Ge),ue(Pe,Ve,Be,Ge))===Ge.A?oe(Pe,De):De.pcOff++,Ve=De.l_base;break}case ye.OP_LT:{_e(Pe,ae(Pe,Ve,Be,Ge),ue(Pe,Ve,Be,Ge))===Ge.A?oe(Pe,De):De.pcOff++,Ve=De.l_base;break}case ye.OP_LE:{pe(Pe,ae(Pe,Ve,Be,Ge),ue(Pe,Ve,Be,Ge))===Ge.A?oe(Pe,De):De.pcOff++,Ve=De.l_base;break}case ye.OP_TEST:{(Ge.C?Pe.stack[we].l_isfalse():!Pe.stack[we].l_isfalse())?De.pcOff++:oe(Pe,De);break}case ye.OP_TESTSET:{let Xe=Pe.stack[ee(Pe,Ve,Ge)];(Ge.C?Xe.l_isfalse():!Xe.l_isfalse())?De.pcOff++:(Pe.stack[we]=Xe,oe(Pe,De));break}case ye.OP_CALL:{let Xe=Ge.B,He=Ge.C-1;if(0!==Xe&&(Pe.top=we+Xe),H.luaD_precall(Pe,we,He))0<=He&&(Pe.top=De.top),Ve=De.l_base;else{De=Pe.ci;continue newframe}break}case ye.OP_TAILCALL:{if(0!==Ge.B&&(Pe.top=we+Ge.B),H.luaD_precall(Pe,we,Z))Ve=De.l_base;else{let Xe=Pe.ci,He=Xe.previous,je=Xe.func,ze=Xe.funcOff,Ye=He.funcOff,Je=Xe.l_base+je.value.p.numparams;0<Ke.p.p.length&&K.luaF_close(Pe,He.l_base);for(let qe=0;ze+qe<Je;qe++)Pe.stack[Ye+qe]=Pe.stack[ze+qe];He.func=Xe.func,He.l_base=Ye+(Xe.l_base-ze),Pe.top=Ye+(Pe.top-ze),He.top=Pe.top,He.l_savedpc=Xe.l_savedpc,He.pcOff=Xe.pcOff,He.callstatus|=V.CIST_TAIL,Pe.ci=He,De=Pe.ci,Pe.ciOff--,E(Pe.top===He.l_base+Pe.stack[Ye].value.p.maxstacksize);continue newframe}break}case ye.OP_RETURN:{0<Ke.p.p.length&&K.luaF_close(Pe,Ve);let Xe=H.luaD_poscall(Pe,De,we,0===Ge.B?Pe.top-we:Ge.B-1);if(De.callstatus&V.CIST_FRESH)return;De=Pe.ci,Xe&&(Pe.top=De.top);continue newframe}case ye.OP_FORLOOP:{if(Pe.stack[we].ttisinteger()){let Xe=Pe.stack[we+2].value,He=Pe.stack[we].value+Xe,je=Pe.stack[we+1].value;(0<Xe?He<=je:je<=He)&&(De.pcOff+=Ge.sBx,Pe.stack[we].value=He,Pe.stack[we+3]=new P.TValue(W.LUA_TNUMINT,He))}else{let Xe=Pe.stack[we+2].value,He=Pe.stack[we].value+Xe,je=Pe.stack[we+1].value;(0<Xe?He<=je:je<=He)&&(De.pcOff+=Ge.sBx,Pe.stack[we].value=He,Pe.stack[we+3]=new P.TValue(W.LUA_TNUMFLT,He))}break}case ye.OP_FORPREP:{let Xe=Pe.stack[we],He=Pe.stack[we+1],je=Pe.stack[we+2],ze=Le(He,je.value);if(Xe.ttisinteger()&&je.ttisinteger()&&ze.casted){let Ye=ze.stopnow?0:Xe.value;He.value=ze.ilimit,Xe.value=Ye-je.value}else{let Ye=Te(Xe),Je=Te(He),qe=Te(je);!1===Je&&q.luaG_runerror(Pe,N.to_luastring('\'for\' limit must be a number',!0)),He.type=W.LUA_TNUMFLT,He.value=Je,!1===qe&&q.luaG_runerror(Pe,N.to_luastring('\'for\' step must be a number',!0)),je.type=W.LUA_TNUMFLT,je.value=qe,!1===Ye&&q.luaG_runerror(Pe,N.to_luastring('\'for\' initial value must be a number',!0)),Xe.type=W.LUA_TNUMFLT,Xe.value=Ye-qe}De.pcOff+=Ge.sBx;break}case ye.OP_TFORCALL:{let Xe=we+3;Pe.stack[Xe+2]=Pe.stack[we+2],Pe.stack[Xe+1]=Pe.stack[we+1],Pe.stack[Xe]=Pe.stack[we],Pe.top=Xe+3,H.luaD_call(Pe,Xe,Ge.C),Ve=De.l_base,Pe.top=De.top,Ge=De.l_savedpc[De.pcOff++],we=$(Pe,Ve,Ge),E(Ge.opcode===ye.OP_TFORLOOP)}case ye.OP_TFORLOOP:{Pe.stack[we+1].ttisnil()||(Pe.stack[we]=Pe.stack[we+1],De.pcOff+=Ge.sBx);break}case ye.OP_SETLIST:{let Xe=Ge.B,He=Ge.C;0===Xe&&(Xe=Pe.top-we-1),0===He&&(E(De.l_savedpc[De.pcOff].opcode===ye.OP_EXTRAARG),He=De.l_savedpc[De.pcOff++].Ax);for(let je=Pe.stack[we].value,ze=(He-1)*I.LFIELDS_PER_FLUSH+Xe;0<Xe;Xe--)J.luaH_setint(je,ze--,Pe.stack[we+Xe]);Pe.top=De.top;break}case ye.OP_CLOSURE:{let Xe=Ke.p.p[Ge.Bx],He=Xe.upvalues.length,je=Xe.upvalues,ze=new P.LClosure(Pe,He);ze.p=Xe,Pe.stack[we]=new P.TValue(W.LUA_TLCL,ze);for(let Ye=0;Ye<He;Ye++)ze.upvals[Ye]=je[Ye].instack?K.luaF_findupval(Pe,Ve+je[Ye].idx):Ke.upvals[je[Ye].idx],ze.upvals[Ye].refcount++;break}case ye.OP_VARARG:{let Xe=Ge.B-1,He=Ve-De.funcOff-Ke.p.numparams-1,je;for(0>He&&(He=0),0>Xe&&(Xe=He,Ve=De.l_base,we=$(Pe,Ve,Ge),Pe.top=we+He),je=0;je<Xe&&je<He;je++)Pe.stack[we+je]=Pe.stack[Ve-He+je];for(;je<Xe;je++)Pe.stack[we+je]=new P.TValue(W.LUA_TNIL,null);break}case ye.OP_EXTRAARG:}}},T.exports.luaV_finishOp=function(Pe){let ye=Pe.ci,De=I.OpCodesI,Ke=ye.l_base,Be=ye.l_savedpc[ye.pcOff-1],Ve=Be.opcode;switch(Ve){case De.OP_ADD:case De.OP_SUB:case De.OP_MUL:case De.OP_DIV:case De.OP_IDIV:case De.OP_BAND:case De.OP_BOR:case De.OP_BXOR:case De.OP_SHL:case De.OP_SHR:case De.OP_MOD:case De.OP_POW:case De.OP_UNM:case De.OP_BNOT:case De.OP_LEN:case De.OP_GETTABUP:case De.OP_GETTABLE:case De.OP_SELF:{Pe.stack[Ke+Be.A]=Pe.stack[--Pe.top];break}case De.OP_LE:case De.OP_LT:case De.OP_EQ:{let Ge=!Pe.stack[Pe.top-1].l_isfalse();Pe.top--,ye.callstatus&V.CIST_LEQ&&(E(Ve===De.OP_LE),ye.callstatus^=V.CIST_LEQ,Ge=1===Ge?0:1),E(ye.l_savedpc[ye.pcOff]===De.OP_JMP),Ge!==Be.A&&ye.pcOff++;break}case De.OP_CONCAT:{let Ge=Pe.top-1,we=Be.B,Fe=Ge-1-(Ke+we);Pe.stack[Pe.top-2]=Pe.stack[Ge],1<Fe&&(Pe.top=Ge-1,be(Pe,Fe)),Pe.stack[ye.l_base+Be.A]=Pe.stack[Pe.top-1],Pe.top=ye.top;break}case De.OP_TFORCALL:{E(ye.l_savedpc[ye.pcOff]===De.OP_TFORLOOP),Pe.top=ye.top;break}case De.OP_CALL:{0<=Be.C-1&&(Pe.top=ye.top);break}}},T.exports.luaV_finishset=Me,T.exports.luaV_lessequal=pe,T.exports.luaV_lessthan=_e,T.exports.luaV_objlen=ke,T.exports.luaV_rawequalobj=function(Pe,ye){return ce(null,Pe,ye)},T.exports.luaV_tointeger=ge,T.exports.settable=Ce,T.exports.tointeger=Ae,T.exports.tonumber=Te},function(T){function U(){throw new Error('setTimeout has not been defined')}function E(){throw new Error('clearTimeout has not been defined')}function N(Z){if(F===setTimeout)return setTimeout(Z,0);if((F===U||!F)&&setTimeout)return F=setTimeout,setTimeout(Z,0);try{return F(Z,0)}catch(Q){try{return F.call(null,Z,0)}catch($){return F.call(this,Z,0)}}}function I(Z){if(H===clearTimeout)return clearTimeout(Z);if((H===E||!H)&&clearTimeout)return H=clearTimeout,clearTimeout(Z);try{return H(Z)}catch(Q){try{return H.call(null,Z)}catch($){return H.call(this,Z)}}}function M(){J&&q&&(J=!1,q.length?Y=q.concat(Y):W=-1,Y.length&&P())}function P(){if(!J){var Z=N(M);J=!0;for(var Q=Y.length;Q;){for(q=Y,Y=[];++W<Q;)q&&q[W].run();W=-1,Q=Y.length}q=null,J=!1,I(Z)}}function K(Z,Q){this.fun=Z,this.array=Q}function V(){}var G=T.exports={},F,H;(function(){try{F='function'==typeof setTimeout?setTimeout:U}catch(Z){F=U}try{H='function'==typeof clearTimeout?clearTimeout:E}catch(Z){H=E}})();var Y=[],J=!1,W=-1,q;G.nextTick=function(Z){var Q=Array(arguments.length-1);if(1<arguments.length)for(var $=1;$<arguments.length;$++)Q[$-1]=arguments[$];Y.push(new K(Z,Q)),1!==Y.length||J||N(P)},K.prototype.run=function(){this.fun.apply(null,this.array)},G.title='browser',G.browser=!0,G.env={},G.argv=[],G.version='',G.versions={},G.on=V,G.addListener=V,G.once=V,G.off=V,G.removeListener=V,G.removeAllListeners=V,G.emit=V,G.prependListener=V,G.prependOnceListener=V,G.listeners=function(){return[]},G.binding=function(){throw new Error('process.binding is not supported')},G.cwd=function(){return'/'},G.chdir=function(){throw new Error('process.chdir is not supported')},G.umask=function(){return 0}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(8),M=U(9),P=U(25),K=U(5),V=U(7),G=U(10),F=U(4),H=N.thread_status,Y=N.char,J=257,q={TK_AND:J,TK_BREAK:J+1,TK_DO:J+2,TK_ELSE:J+3,TK_ELSEIF:J+4,TK_END:J+5,TK_FALSE:J+6,TK_FOR:J+7,TK_FUNCTION:J+8,TK_GOTO:J+9,TK_IF:J+10,TK_IN:J+11,TK_LOCAL:J+12,TK_NIL:J+13,TK_NOT:J+14,TK_OR:J+15,TK_REPEAT:J+16,TK_RETURN:J+17,TK_THEN:J+18,TK_TRUE:J+19,TK_UNTIL:J+20,TK_WHILE:J+21,TK_IDIV:J+22,TK_CONCAT:J+23,TK_DOTS:J+24,TK_EQ:J+25,TK_GE:J+26,TK_LE:J+27,TK_NE:J+28,TK_SHL:J+29,TK_SHR:J+30,TK_DBCOLON:J+31,TK_EOS:J+32,TK_FLT:J+33,TK_INT:J+34,TK_NAME:J+35,TK_STRING:J+36},W=q,Z=['and','break','do','else','elseif','end','false','for','function','goto','if','in','local','nil','not','or','repeat','return','then','true','until','while','//','..','...','==','>=','<=','~=','<<','>>','::','<eof>','<number>','<integer>','<name>','<string>'];class Q{constructor(Pe,ye,De){this.L=Pe,this.data=ye,this.n=0,this.buffer=null,this.off=0,this.reader=De?De:null,this.reader||(E('string'!=typeof ye,'Should only load binary of array of bytes'),this.buffer=ye?ye:[],this.n=this.buffer instanceof DataView?this.buffer.byteLength:this.buffer.length,this.off=0)}getc(){if(0>=this.n&&this.fill(),0>=this.n)return-1;let Pe;return Pe=this.buffer instanceof DataView?this.buffer.getUint8(this.off++,!0):this.buffer[this.off++],0==this.n--&&(this.buffer=null),Pe}read(Pe){let ye=[];for(;0<Pe;){let De=this.getc();-1!==De&&ye.push(De),Pe--}return ye}fill(){this.reader&&(this.buffer=this.reader(this.L,this.data),E('string'!=typeof this.buffer,'Should only load binary of array of bytes'),null!==this.buffer&&(this.n=this.buffer instanceof DataView?this.buffer.byteLength:this.buffer.length,this.off=0))}}class ${constructor(){this.r=NaN,this.i=NaN,this.ts=null}}class ee{constructor(){this.token=NaN,this.seminfo=new $}}const ae=function(Pe,ye){let De=Pe.buff;De.n+1>De.buffer.length&&De.buffer.length>=F.MAX_INT/2&&Te(Pe,N.to_luastring('lexical element too long',!0),0),De.buffer[De.n++]=0>ye?255+ye+1:ye},ue=function(Pe,ye){if(ye<J)return K.luaO_pushfstring(Pe.L,N.to_luastring('\'%c\'',!0),ye);let De=Z[ye-J];return ye<W.TK_EOS?N.to_luastring(`'${De}'`):N.to_luastring(De)},se=function(Pe){return Pe.current===Y['\n']||Pe.current===Y['\r']},ne=function(Pe){Pe.current=Pe.z.getc()},oe=function(Pe){ae(Pe,Pe.current),ne(Pe)},_e=function(Pe,ye){let De=Pe.L,Ke=V.luaS_new(De,ye),Be=G.luaH_set(Pe.h,new K.TValue(N.CT.LUA_TLNGSTR,Ke));if(Be.ttisnil())Be.setbvalue(!0);else{let Ve=Pe.h.strong.get(V.luaS_hashlongstr(Ke));E(Ve.value==Be),Ke=Ve.key.tsvalue()}return Ke},pe=function(Pe){let ye=Pe.current;E(se(Pe)),ne(Pe),se(Pe)&&Pe.current!==ye&&ne(Pe),++Pe.linenumber>=F.MAX_INT&&Te(Pe,N.to_luastring('chunk has too many lines',!0),0)},de=function(Pe,ye){return Pe.current===ye.charCodeAt(0)&&(ne(Pe),!0)},Le=function(Pe,ye){return(Pe.current===ye[0].charCodeAt(0)||Pe.current===ye[1].charCodeAt(0))&&(oe(Pe),!0)},ge=function(Pe,ye){let De='Ee',Ke=Pe.current;for(E(P.lisdigit(Pe.current)),oe(Pe),Ke===Y[0]&&Le(Pe,'xX')&&(De='Pp');;)if(Le(Pe,De)&&Le(Pe,'-+'),P.lisxdigit(Pe.current))oe(Pe);else if(Pe.current===Y['.'])oe(Pe);else break;ae(Pe,0);let Be=K.luaO_str2num(Pe.buff.buffer);return!1===Be&&Te(Pe,N.to_luastring('malformed number',!0),W.TK_FLT),Be.ttisinteger()?(ye.i=Be.value,W.TK_INT):(E(Be.ttisfloat()),ye.r=Be.value,W.TK_FLT)},Ae=function(Pe,ye){return ye===W.TK_NAME||ye===W.TK_STRING||ye===W.TK_FLT||ye===W.TK_INT?(ae(Pe,0),N.to_luastring(`'${N.to_jsstring(Pe.buff.buffer)}'`)):ue(Pe,ye)},Te=function(Pe,ye,De){ye=I.luaG_addinfo(Pe.L,ye,Pe.source,Pe.linenumber),De&&K.luaO_pushfstring(Pe.L,N.to_luastring('%s near %s'),ye,Ae(Pe,De)),M.luaD_throw(Pe.L,H.LUA_ERRSYNTAX)},Oe=function(Pe){let ye=0,De=Pe.current;for(E(De===Y['[']||De===Y[']']),oe(Pe);Pe.current===Y['='];)oe(Pe),ye++;return Pe.current===De?ye:-ye-1},xe=function(Pe,ye,De){let Ke=Pe.linenumber;oe(Pe),se(Pe)&&pe(Pe);for(let Be=!1;!Be;)switch(Pe.current){case-1:{let Ve=ye?'string':'comment',Ge=`unfinished long ${Ve} (starting at line ${Ke})`;Te(Pe,N.to_luastring(Ge),W.TK_EOS);break}case Y[']']:{Oe(Pe)===De&&(oe(Pe),Be=!0);break}case Y['\n']:case Y['\r']:{ae(Pe,Y['\n']),pe(Pe),ye||(Pe.buff.n=0,Pe.buff.buffer=[]);break}default:ye?oe(Pe):ne(Pe);}ye&&(ye.ts=_e(Pe,Pe.buff.buffer.slice(2+De,2+De-2*(2+De))))},Ue=function(Pe,ye,De){ye||(-1!==Pe.current&&oe(Pe),Te(Pe,De,W.TK_STRING))},Ee=function(Pe){return oe(Pe),Ue(Pe,P.lisxdigit(Pe.current),N.to_luastring('hexadecimal digit expected',!0)),K.luaO_hexavalue(Pe.current)},ke=function(Pe){let ye=Ee(Pe);return ye=(ye<<4)+Ee(Pe),Pe.buff.n-=2,ye},ve=function(Pe){let ye=4;oe(Pe),Ue(Pe,Pe.current===Y['{'],N.to_luastring('missing \'{\'',!0));let De=Ee(Pe);for(oe(Pe);P.lisxdigit(Pe.current);)ye++,De=(De<<4)+K.luaO_hexavalue(Pe.current),Ue(Pe,1114111>=De,N.to_luastring('UTF-8 value too large',!0)),oe(Pe);return Ue(Pe,Pe.current===Y['}'],N.to_luastring('missing \'}\'',!0)),ne(Pe),Pe.buff.n-=ye,De},Re=function(Pe){let ye=K.luaO_utf8esc(ve(Pe)),De=ye.buff;for(let Ke=ye.n;0<Ke;Ke--)ae(Pe,De[K.UTF8BUFFSZ-Ke])},be=function(Pe){let ye=0,De;for(De=0;3>De&&P.lisdigit(Pe.current);De++)ye=10*ye+Pe.current-Y[0],oe(Pe);return Ue(Pe,255>=ye,N.to_luastring('decimal escape too large',!0)),Pe.buff.n-=De,ye},Se=function(Pe,ye,De){for(oe(Pe);Pe.current!==ye;)switch(Pe.current){case-1:Te(Pe,N.to_luastring('unfinished string',!0),W.TK_EOS);break;case Y['\n']:case Y['\r']:Te(Pe,N.to_luastring('unfinished string',!0),W.TK_STRING);break;case Y['\\']:{oe(Pe);let Ke,Be;switch(Pe.current){case Y.a:Be=Y.a,Ke='read_save';break;case Y.b:Be=Y['\b'],Ke='read_save';break;case Y.f:Be=Y['\f'],Ke='read_save';break;case Y.n:Be=Y['\n'],Ke='read_save';break;case Y.r:Be=Y['\r'],Ke='read_save';break;case Y.t:Be=Y['\t'],Ke='read_save';break;case Y.v:Be=Y['\x0B'],Ke='read_save';break;case Y.x:Be=ke(Pe),Ke='read_save';break;case Y.u:Re(Pe),Ke='no_save';break;case Y['\n']:case Y['\r']:pe(Pe),Be=Y['\n'],Ke='only_save';break;case Y['\\']:case Y['"']:case Y['\'']:Be=Pe.current,Ke='read_save';break;case-1:Ke='no_save';break;case Y.z:{for(Pe.buff.n-=1,ne(Pe);P.lisspace(Pe.current);)se(Pe)?pe(Pe):ne(Pe);Ke='no_save';break}default:{Ue(Pe,P.lisdigit(Pe.current),N.to_luastring('invalid escape sequence',!0)),Be=be(Pe),Ke='only_save';break}}'read_save'===Ke&&ne(Pe),('read_save'===Ke||'only_save'===Ke)&&(Pe.buff.n-=1,ae(Pe,Be));break}default:oe(Pe);}oe(Pe),De.ts=_e(Pe,Pe.buff.buffer.slice(1,Pe.buff.n-1))},Ie=function(Pe,ye){for(Pe.buff.n=0,Pe.buff.buffer=[];;)switch(E('number'==typeof Pe.current),Pe.current){case Y['\n']:case Y['\r']:{pe(Pe);break}case Y[' ']:case Y['\f']:case Y['\t']:case Y['\x0B']:{ne(Pe);break}case Y['-']:{if(ne(Pe),Pe.current!==Y['-'])return Y['-'];if(ne(Pe),Pe.current===Y['[']){let De=Oe(Pe);if(Pe.buff.n=0,Pe.buff.buffer=[],0<=De){xe(Pe,null,De),Pe.buff.n=0,Pe.buff.buffer=[];break}}for(;!se(Pe)&&-1!==Pe.current;)ne(Pe);break}case Y['[']:{let De=Oe(Pe);return 0<=De?(xe(Pe,ye,De),W.TK_STRING):(-1!==De&&Te(Pe,N.to_luastring('invalid long string delimiter',!0),W.TK_STRING),Y['['])}case Y['=']:return ne(Pe),de(Pe,'=')?W.TK_EQ:Y['='];case Y['<']:return ne(Pe),de(Pe,'=')?W.TK_LE:de(Pe,'<')?W.TK_SHL:Y['<'];case Y['>']:return ne(Pe),de(Pe,'=')?W.TK_GE:de(Pe,'>')?W.TK_SHR:Y['>'];case Y['/']:return ne(Pe),de(Pe,'/')?W.TK_IDIV:Y['/'];case Y['~']:return ne(Pe),de(Pe,'=')?W.TK_NE:Y['~'];case Y[':']:return ne(Pe),de(Pe,':')?W.TK_DBCOLON:Y[':'];case Y['"']:case Y['\'']:return Se(Pe,Pe.current,ye),W.TK_STRING;case Y['.']:return oe(Pe),de(Pe,'.')?de(Pe,'.')?W.TK_DOTS:W.TK_CONCAT:P.lisdigit(Pe.current)?ge(Pe,ye):Y['.'];case Y[0]:case Y[1]:case Y[2]:case Y[3]:case Y[4]:case Y[5]:case Y[6]:case Y[7]:case Y[8]:case Y[9]:return ge(Pe,ye);case-1:return W.TK_EOS;default:{if(P.lislalpha(Pe.current)){do oe(Pe);while(P.lislalnum(Pe.current));let De=_e(Pe,Pe.buff.buffer);ye.ts=De;let Ke=Z.slice(0,22).indexOf(N.to_jsstring(De.getstr()));return 0<=Ke?Ke+J:W.TK_NAME}let De=Pe.current;return ne(Pe),De}}};T.exports.FIRST_RESERVED=J,T.exports.LexState=class{constructor(){this.current=NaN,this.linenumber=NaN,this.lastline=NaN,this.t=new ee,this.lookahead=new ee,this.fs=null,this.L=null,this.z=new Q,this.buff=new Q,this.h=null,this.dyd=null,this.source=null,this.envn=null}},T.exports.MBuffer=Q,T.exports.RESERVED=q,T.exports.isreserved=function(Pe){return 0<=Z.slice(0,22).indexOf(Pe)},T.exports.luaX_lookahead=function(Pe){return E(Pe.lookahead.token===W.TK_EOS),Pe.lookahead.token=Ie(Pe,Pe.lookahead.seminfo),Pe.lookahead.token},T.exports.luaX_newstring=_e,T.exports.luaX_next=function(Pe){Pe.lastline=Pe.linenumber,Pe.lookahead.token===W.TK_EOS?Pe.t.token=Ie(Pe,Pe.t.seminfo):(Pe.t.token=Pe.lookahead.token,Pe.t.seminfo.i=Pe.lookahead.seminfo.i,Pe.t.seminfo.r=Pe.lookahead.seminfo.r,Pe.t.seminfo.ts=Pe.lookahead.seminfo.ts,Pe.lookahead.token=W.TK_EOS)},T.exports.luaX_setinput=function(Pe,ye,De,Ke,Be){ye.t={token:0,seminfo:{i:NaN,r:NaN,ts:null}},ye.L=Pe,ye.current=Be,ye.lookahead={token:W.TK_EOS,seminfo:{i:NaN,r:NaN,ts:null}},ye.z=De,ye.fs=null,ye.linenumber=1,ye.lastline=1,ye.source=Ke,ye.envn=V.luaS_newliteral(Pe,'_ENV')},T.exports.luaX_syntaxerror=function(Pe,ye){Te(Pe,ye,Pe.t.token)},T.exports.luaX_token2str=ue,T.exports.luaX_tokens=Z},function(T){'use strict';const I=0,M=1,P=2,K=3,V=0,G=1,F=2,H=3,Y=[64|P<<4|I<<2|V,64|K<<4|I<<2|G,64|I<<4|I<<2|G,64|M<<4|M<<2|V,64|M<<4|I<<2|V,64|M<<4|I<<2|V,64|M<<4|K<<2|V,64|P<<4|K<<2|V,0|K<<4|K<<2|V,0|M<<4|I<<2|V,0|K<<4|K<<2|V,64|M<<4|M<<2|V,64|P<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|P<<4|I<<2|V,64|P<<4|I<<2|V,64|P<<4|I<<2|V,64|P<<4|I<<2|V,64|P<<4|P<<2|V,0|P<<4|I<<2|F,128|K<<4|K<<2|V,128|K<<4|K<<2|V,128|K<<4|K<<2|V,128|I<<4|M<<2|V,192|P<<4|M<<2|V,64|M<<4|M<<2|V,64|M<<4|M<<2|V,0|M<<4|I<<2|V,64|P<<4|I<<2|F,64|P<<4|I<<2|F,0|I<<4|M<<2|V,64|P<<4|I<<2|F,0|M<<4|M<<2|V,64|M<<4|I<<2|G,64|M<<4|I<<2|V,0|M<<4|M<<2|H],$=9,ee=9,te=$+ee,ae=8,ue=$+ee+ae,se=6,ne=0,oe=ne+se,_e=oe+ae,pe=_e+$,ce=_e,de=oe,Le=(1<<te)-1,ge=Le>>1,Te=(1<<ae)-1,xe=1<<ee-1,be=function(We,Ze){return~(-1<<We)<<Ze},Se=function(We,Ze){return~be(We,Ze)},Ce=function(We,Ze,Qe,$e){return We.code=We.code&Se($e,Qe)|Ze<<Qe&be($e,Qe),je(We)},Ge=function(We,Ze){return Ce(We,Ze,ce,te)},je=function(We){if('number'==typeof We)return{code:We,opcode:We>>ne&be(se,0),A:We>>oe&be(ae,0),B:We>>pe&be(ee,0),C:We>>_e&be($,0),Bx:We>>ce&be(te,0),Ax:We>>de&be(ue,0),sBx:(We>>ce&be(te,0))-ge};let Ze=We.code;return We.opcode=Ze>>ne&be(se,0),We.A=Ze>>oe&be(ae,0),We.B=Ze>>pe&be(ee,0),We.C=Ze>>_e&be($,0),We.Bx=Ze>>ce&be(te,0),We.Ax=Ze>>de&be(ue,0),We.sBx=(Ze>>ce&be(te,0))-ge,We};T.exports.BITRK=xe,T.exports.CREATE_ABC=function(We,Ze,Qe,$e){return je(We<<ne|Ze<<oe|Qe<<pe|$e<<_e)},T.exports.CREATE_ABx=function(We,Ze,Qe){return je(We<<ne|Ze<<oe|Qe<<ce)},T.exports.CREATE_Ax=function(We,Ze){return je(We<<ne|Ze<<de)},T.exports.GET_OPCODE=function(We){return We.opcode},T.exports.GETARG_A=function(We){return We.A},T.exports.GETARG_B=function(We){return We.B},T.exports.GETARG_C=function(We){return We.C},T.exports.GETARG_Bx=function(We){return We.Bx},T.exports.GETARG_Ax=function(We){return We.Ax},T.exports.GETARG_sBx=function(We){return We.sBx},T.exports.INDEXK=function(We){return We&~xe},T.exports.ISK=function(We){return We&xe},T.exports.LFIELDS_PER_FLUSH=50,T.exports.MAXARG_A=Te,T.exports.MAXARG_Ax=(1<<ue)-1,T.exports.MAXARG_B=(1<<ee)-1,T.exports.MAXARG_Bx=Le,T.exports.MAXARG_C=(1<<$)-1,T.exports.MAXARG_sBx=ge,T.exports.MAXINDEXRK=xe-1,T.exports.NO_REG=Te,T.exports.OpArgK=K,T.exports.OpArgN=I,T.exports.OpArgR=P,T.exports.OpArgU=M,T.exports.OpCodes=['OP_MOVE','OP_LOADK','OP_LOADKX','OP_LOADBOOL','OP_LOADNIL','OP_GETUPVAL','OP_GETTABUP','OP_GETTABLE','OP_SETTABUP','OP_SETUPVAL','OP_SETTABLE','OP_NEWTABLE','OP_SELF','OP_ADD','OP_SUB','OP_MUL','OP_MOD','OP_POW','OP_DIV','OP_IDIV','OP_BAND','OP_BOR','OP_BXOR','OP_SHL','OP_SHR','OP_UNM','OP_BNOT','OP_NOT','OP_LEN','OP_CONCAT','OP_JMP','OP_EQ','OP_LT','OP_LE','OP_TEST','OP_TESTSET','OP_CALL','OP_TAILCALL','OP_RETURN','OP_FORLOOP','OP_FORPREP','OP_TFORCALL','OP_TFORLOOP','OP_SETLIST','OP_CLOSURE','OP_VARARG','OP_EXTRAARG'],T.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},T.exports.POS_A=oe,T.exports.POS_Ax=de,T.exports.POS_B=pe,T.exports.POS_Bx=ce,T.exports.POS_C=_e,T.exports.POS_OP=ne,T.exports.RKASK=function(We){return We|xe},T.exports.SETARG_A=function(We,Ze){return Ce(We,Ze,oe,ae)},T.exports.SETARG_Ax=function(We,Ze){return Ce(We,Ze,de,ue)},T.exports.SETARG_B=function(We,Ze){return Ce(We,Ze,pe,ee)},T.exports.SETARG_Bx=Ge,T.exports.SETARG_C=function(We,Ze){return Ce(We,Ze,_e,$)},T.exports.SETARG_sBx=function(We,Ze){return Ge(We,Ze+ge)},T.exports.SET_OPCODE=function(We,Ze){return We.code=We.code&Se(se,ne)|Ze<<ne&be(se,ne),je(We)},T.exports.SIZE_A=ae,T.exports.SIZE_Ax=ue,T.exports.SIZE_B=ee,T.exports.SIZE_Bx=te,T.exports.SIZE_C=$,T.exports.SIZE_OP=se,T.exports.fullins=je,T.exports.getBMode=function(We){return 3&Y[We]>>4},T.exports.getCMode=function(We){return 3&Y[We]>>2},T.exports.getOpMode=function(We){return 3&Y[We]},T.exports.iABC=V,T.exports.iABx=G,T.exports.iAsBx=F,T.exports.iAx=H,T.exports.testAMode=function(We){return 64&Y[We]},T.exports.testTMode=function(We){return 128&Y[We]}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(8),M=U(9),P=U(50),K=U(11),V=U(19),G=U(5),F=U(15),H=U(7),Y=U(16),J=U(12),q=U(17),W=U(10),Z=K.MAXUPVAL,Q=N.constant_types,$=N.thread_status,ee=G.TValue,te=G.CClosure,ae=function(ca){return ca!==G.luaO_nilobject},ne=function(ca,da){let La=ca.ci;if(0<da){let fa=La.funcOff+da;return E(da<=La.top-(La.funcOff+1),'unacceptable index'),fa>=ca.top?G.luaO_nilobject:ca.stack[fa]}return da>N.LUA_REGISTRYINDEX?(E(0!=da&&-da<=ca.top,'invalid index'),ca.stack[ca.top+da]):da===N.LUA_REGISTRYINDEX?ca.l_G.l_registry:(da=N.LUA_REGISTRYINDEX-da,E(da<=Z+1,'upvalue index too large'),La.func.ttislcf()?G.luaO_nilobject:da<=La.func.value.nupvalues?La.func.value.upvalue[da-1]:G.luaO_nilobject)},oe=function(ca,da){let La=ca.ci;if(0<da){let fa=La.funcOff+da;return E(da<=La.top-(La.funcOff+1),'unacceptable index'),fa>=ca.top?null:fa}return da>N.LUA_REGISTRYINDEX?(E(0!=da&&-da<=ca.top,'invalid index'),ca.top+da):da===N.LUA_REGISTRYINDEX?null:(da=N.LUA_REGISTRYINDEX-da,E(da<=Z+1,'upvalue index too large'),La.func.ttislcf()?null:da<=La.func.nupvalues?da-1:null)},ge=function(ca,da){let La=ca.ci.funcOff;if(0<=da){for(;ca.top<La+1+da;)ca.stack[ca.top++]=new ee(Q.LUA_TNIL,null);ca.top=La+1+da}else{E(-(da+1)<=ca.top-(La+1),'invalid new top');for(let fa=ca.top+da+1;ca.top>fa;)delete ca.stack[--ca.top]}},Ae=function(ca,da){ge(ca,-da-1)},Te=function(ca,da,La){for(;da<La;da++,La--){let fa=ca.stack[da];ca.stack[da]=ca.stack[La],ca.stack[La]=fa}},he=function(ca,da,La){let fa=ca.stack[ca.top-1],ga=ne(ca,da),Aa=oe(ca,da);E(ga!==G.luaO_nilobject&&da>N.LUA_REGISTRYINDEX,'index not in the stack'),E((0<=La?La:-La)<=ca.top-da,'invalid \'n\'');let Ta=0<=La?ca.top-1-La:Aa-La-1;Te(ca,Aa,Ta),Te(ca,Ta+1,ca.top-1),Te(ca,Aa,ca.top-1)},Oe=function(ca,da,La){let fa=ne(ca,da);ca.stack[oe(ca,La)]=new ee(fa.type,fa.value)},Me=function(ca,da,La){if(E('function'==typeof da),E('number'==typeof La),0===La)ca.stack[ca.top]=new ee(Q.LUA_TLCF,da);else{E(La<ca.top-ca.ci.funcOff,'not enough elements in the stack'),E(La<=Z,'upvalue index too large');let fa=new te(ca,da,La);for(ca.top-=La;La--;)fa.upvalue[La].setfrom(ca.stack[ca.top+La]),delete ca.stack[ca.top+La];ca.stack[ca.top]=new ee(Q.LUA_TCCL,fa)}ca.top++,E(ca.top<=ca.ci.top,'stack overflow')},ye=function(ca,da){Me(ca,da,0)},we=function(ca,da,La){E(Array.isArray(La),'key must be an array of bytes');let fa=new ee(Q.LUA_TLNGSTR,H.luaS_new(ca,La));E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack'),ca.stack[ca.top++]=fa,q.settable(ca,da,ca.stack[ca.top-1],ca.stack[ca.top-2]),delete ca.stack[--ca.top],delete ca.stack[--ca.top]},We=function(ca,da,La){E(Array.isArray(La),'key must be an array of bytes');let fa=new ee(Q.LUA_TLNGSTR,H.luaS_new(ca,La));return ca.stack[ca.top++]=fa,E(ca.top<=ca.ci.top,'stack overflow'),q.gettable(ca,da,ca.stack[ca.top-1],ca.top-1),ca.stack[ca.top-1].ttnov()},Ze=function(ca,da,La){let fa=ne(ca,da);return E(fa.ttistable(),'table expected'),ca.stack[ca.top++]=W.luaH_getint(fa.value,La),E(ca.top<=ca.ci.top,'stack overflow'),ca.stack[ca.top-1].ttnov()},et=function(ca){let fa=new G.TValue(Q.LUA_TTABLE,W.luaH_new(ca));ca.stack[ca.top++]=fa,E(ca.top<=ca.ci.top,'stack overflow')},at=function(ca,da){return{id:ca.l_G.id_counter++,metatable:null,uservalue:null,len:da,data:Object.create(null)}},ut=function(ca,da,La){switch(da.ttype()){case Q.LUA_TCCL:{let fa=da.value;return 1<=La&&La<=fa.nupvalues?{name:[],val:fa.upvalue[La-1]}:null}case Q.LUA_TLCL:{let fa=da.value,ga=fa.p;if(!(1<=La&&La<=ga.upvalues.length))return null;let Aa=ga.upvalues[La-1].name;return{name:Aa?Aa.getstr():N.to_luastring('(*no name)',!0),val:fa.upvals[La-1].val()}}default:return null;}},ft=function(ca,da){let La=ne(ca,da);return La.ttisstring()||La.ttisnumber()?La.ttisstring()?La.svalue():N.to_luastring(`${La.value}`):null},Tt=function(ca,da){let La=ne(ca,da);return La.ttisstring()||La.ttisnumber()?La.ttisstring()?La.jsstring():`${La.value}`:null},It=function(ca,da){M.luaD_callnoyield(ca,da.funcOff,da.nresults)},Ct=function(ca,da){let La=ne(ca,da);return ae(La)?La.ttnov():Q.LUA_TNONE},Zt=function(ca,da,La,fa,ga){E(null===ga||!(ca.ci.callstatus&F.CIST_LUA),'cannot use continuations inside hooks'),E(da+1<ca.top-ca.ci.funcOff,'not enough elements in the stack'),E(ca.status===$.LUA_OK,'cannot do calls on non-normal thread'),E(da===N.LUA_MULTRET||(ca.ci.top-ca.top>=da-La,'results from function overflow current stack size'));let Aa=ca.top-(da+1);null!==ga&&0===ca.nny?(ca.ci.c_k=ga,ca.ci.c_ctx=fa,M.luaD_call(ca,Aa,La)):M.luaD_callnoyield(ca,Aa,La),La===N.LUA_MULTRET&&ca.ci.top<ca.top&&(ca.ci.top=ca.top)},$t=function(ca,da,La,fa,ga,Aa){E(da+1<ca.top-ca.ci.funcOff,'not enough elements in the stack'),E(ca.status===$.LUA_OK,'cannot do calls on non-normal thread'),E(da===N.LUA_MULTRET||(ca.ci.top-ca.top>=da-La,'results from function overflow current stack size'));let Ta={func:null,funcOff:NaN,nresults:NaN},ha,Oa;if(Oa=0===fa?0:oe(ca,fa),Ta.funcOff=ca.top-(da+1),Ta.func=ca.stack[Ta.funcOff],null===Aa||0<ca.nny)Ta.nresults=La,ha=M.luaD_pcall(ca,It,Ta,Ta.funcOff,Oa);else{let xa=ca.ci;xa.c_k=Aa,xa.c_ctx=ga,xa.extra=Ta.funcOff,xa.c_old_errfunc=ca.errfunc,ca.errfunc=Oa,xa.callstatus&=~F.CIST_OAH|ca.allowhook,xa.callstatus|=F.CIST_YPCALL,M.luaD_call(ca,Ta.funcOff,La),xa.callstatus&=~F.CIST_YPCALL,ca.errfunc=xa.c_old_errfunc,ha=$.LUA_OK}return La===N.LUA_MULTRET&&ca.ci.top<ca.top&&(ca.ci.top=ca.top),ha},sa=function(ca,da,La){let ga=ne(ca,da);E(ga.ttisLclosure(),'Lua function expected');let Aa=ga.value;return E(1<=La&&La<=Aa.p.upvalues.length,'invalid upvalue index'),{closure:Aa,upval:Aa.upvals[La-1],upvalOff:La-1}};T.exports.index2addr=ne,T.exports.index2addr_=oe,T.exports.lua_absindex=function(ca,da){return 0<da||da<=N.LUA_REGISTRYINDEX?da:ca.top-ca.ci.funcOff+da},T.exports.lua_atpanic=function(ca,da){let La=ca.l_G.panic;return ca.l_G.panic=da,La},T.exports.lua_call=function(ca,da,La){Zt(ca,da,La,0,null)},T.exports.lua_callk=Zt,T.exports.lua_checkstack=function(ca){return ca.stack.length<J.LUAI_MAXSTACK},T.exports.lua_compare=function(ca,da,La,fa){let ga=ne(ca,da),Aa=ne(ca,La),Ta=0;return ae(ga)&&ae(Aa)&&(fa===N.LUA_OPEQ?Ta=q.luaV_equalobj(ca,ga,Aa):fa===N.LUA_OPLT?Ta=q.luaV_lessthan(ca,ga,Aa):fa===N.LUA_OPLE?Ta=q.luaV_lessequal(ca,ga,Aa):E(!1,'invalid option')),Ta},T.exports.lua_concat=function(ca,da){E(da<ca.top-ca.ci.funcOff,'not enough elements in the stack'),2<=da?q.luaV_concat(ca,da):0==da&&(ca.stack[ca.top++]=new ee(Q.LUA_TLNGSTR,H.luaS_newliteral(ca,[])),E(ca.top<=ca.ci.top,'stack overflow'))},T.exports.lua_copy=Oe,T.exports.lua_createtable=et,T.exports.lua_dump=function(ca,da,La,fa){E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let ga=ca.stack[ca.top-1];return ga.ttisLclosure()?P.luaU_dump(ca,ga.value.p,da,La,fa):1},T.exports.lua_error=function(ca){E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack'),I.luaG_errormsg(ca)},T.exports.lua_gc=function(){},T.exports.lua_getallocf=function(){return console.warn('lua_getallocf is not available and will always return null'),null},T.exports.lua_getextraspace=function(){return console.warn('lua_getextraspace is not available and will always return null'),null},T.exports.lua_getfield=function(ca,da,La){return We(ca,ne(ca,da),La)},T.exports.lua_getglobal=function(ca,da){return We(ca,W.luaH_getint(ca.l_G.l_registry.value,N.LUA_RIDX_GLOBALS),da)},T.exports.lua_geti=function(ca,da,La){E('number'==typeof La&&(0|La)===La);let fa=ne(ca,da);return ca.stack[ca.top++]=new ee(Q.LUA_TNUMINT,La),E(ca.top<=ca.ci.top,'stack overflow'),q.gettable(ca,fa,ca.stack[ca.top-1],ca.top-1),ca.stack[ca.top-1].ttnov()},T.exports.lua_getmetatable=function(ca,da){let La=ne(ca,da),ga=!1,fa;switch(La.ttnov()){case Q.LUA_TTABLE:case Q.LUA_TUSERDATA:fa=La.value.metatable;break;default:fa=ca.l_G.mt[La.ttnov()];}return null!==fa&&void 0!==fa&&(ca.stack[ca.top++]=new ee(Q.LUA_TTABLE,fa),E(ca.top<=ca.ci.top,'stack overflow'),ga=!0),ga},T.exports.lua_gettable=function(ca,da){let La=ne(ca,da);return q.gettable(ca,La,ca.stack[ca.top-1],ca.top-1),ca.stack[ca.top-1].ttnov()},T.exports.lua_gettop=function(ca){return ca.top-(ca.ci.funcOff+1)},T.exports.lua_getupvalue=function(ca,da,La){let fa=ut(ca,ne(ca,da),La);if(fa){let ga=fa.name,Aa=fa.val;return ca.stack[ca.top++]=new ee(Aa.type,Aa.value),ga}return null},T.exports.lua_getuservalue=function(ca,da){let La=ne(ca,da);E(ca,La.ttisfulluserdata(),'full userdata expected');let fa=La.uservalue;return ca.stack[ca.top++]=new ee(fa.type,fa.value),E(ca.top<=ca.ci.top,'stack overflow'),ca.stack[ca.top-1].ttnov()},T.exports.lua_insert=function(ca,da){he(ca,da,1)},T.exports.lua_isboolean=function(ca,da){return Ct(ca,da)===Q.LUA_TBOOLEAN},T.exports.lua_iscfunction=function(ca,da){let La=ne(ca,da);return La.ttislcf(La)||La.ttisCclosure()},T.exports.lua_isfunction=function(ca,da){return Ct(ca,da)===Q.LUA_TFUNCTION},T.exports.lua_isinteger=function(ca,da){return ne(ca,da).ttisinteger()},T.exports.lua_isnil=function(ca,da){return Ct(ca,da)===Q.LUA_TNIL},T.exports.lua_isnone=function(ca,da){return Ct(ca,da)===Q.LUA_TNONE},T.exports.lua_isnoneornil=function(ca,da){return 0>=Ct(ca,da)},T.exports.lua_isnumber=function(ca,da){return!1!==q.tonumber(ne(ca,da))},T.exports.lua_isstring=function(ca,da){let La=ne(ca,da);return La.ttisstring()||La.ttisnumber()},T.exports.lua_istable=function(ca,da){return ne(ca,da).ttistable()},T.exports.lua_isthread=function(ca,da){return Ct(ca,da)===Q.LUA_TTHREAD},T.exports.lua_isuserdata=function(ca,da){let La=ne(ca,da);return La.ttisfulluserdata(La)||La.ttislightuserdata()},T.exports.lua_len=function(ca,da){let La=ne(ca,da);q.luaV_objlen(ca,ca.top++,La),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_load=function(ca,da,La,fa,ga){E(Array.isArray(fa),'lua_load expect an array of byte as chunckname'),E(!ga||Array.isArray(ga),'lua_load expect an array of byte as mode');let Aa=new V.MBuffer(ca,La,da);fa||(fa=[N.char['?']]);let Ta=M.luaD_protectedparser(ca,Aa,fa,ga);if(Ta===$.LUA_OK){let ha=ca.stack[ca.top-1].value;if(1<=ha.nupvalues){let Oa=W.luaH_getint(ca.l_G.l_registry.value,N.LUA_RIDX_GLOBALS);ha.upvals[0].value.setfrom(Oa)}}return Ta},T.exports.lua_newtable=function(ca){et(ca,0,0)},T.exports.lua_newuserdata=function(ca,da){let La=at(ca,da);return ca.stack[ca.top++]=new G.TValue(Q.LUA_TUSERDATA,La),E(ca.top<=ca.ci.top,'stack overflow'),La.data},T.exports.lua_next=function(ca,da){let La=ne(ca,da);E(La.ttistable(),'table expected');let fa=W.luaH_next(ca,La.value,ca.top-1);return fa?(ca.top++,E(ca.top<=ca.ci.top,'stack overflow'),1):(ca.top--,0)},T.exports.lua_pcall=function(ca,da,La,fa){return $t(ca,da,La,fa,0,null)},T.exports.lua_pcallk=$t,T.exports.lua_pop=Ae,T.exports.lua_pushboolean=function(ca,da){ca.stack[ca.top++]=new ee(Q.LUA_TBOOLEAN,!!da),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_pushcclosure=Me,T.exports.lua_pushcfunction=ye,T.exports.lua_pushglobaltable=function(ca){Ze(ca,N.LUA_REGISTRYINDEX,N.LUA_RIDX_GLOBALS)},T.exports.lua_pushinteger=function(ca,da){E('number'==typeof da&&(0|da)===da),ca.stack[ca.top++]=new ee(Q.LUA_TNUMINT,da),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_pushjsclosure=Me,T.exports.lua_pushjsfunction=ye,T.exports.lua_pushlightuserdata=function(ca,da){ca.stack[ca.top++]=new ee(Q.LUA_TLIGHTUSERDATA,da),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_pushliteral=function(ca,da){if(E('string'==typeof da||void 0===da||null===da,'lua_pushliteral expects a JS string'),void 0===da||null===da)ca.stack[ca.top]=new ee(Q.LUA_TNIL,null);else{let La=new ee(Q.LUA_TLNGSTR,H.luaS_newliteral(ca,da));ca.stack[ca.top]=La}return ca.top++,E(ca.top<=ca.ci.top,'stack overflow'),da},T.exports.lua_pushlstring=function(ca,da,La){E(Array.isArray(da),'lua_pushlstring expects array of byte'),E('number'==typeof La);let fa=new ee(Q.LUA_TLNGSTR,H.luaS_bless(ca,da.slice(0,La)));return ca.stack[ca.top++]=fa,E(ca.top<=ca.ci.top,'stack overflow'),fa.value},T.exports.lua_pushnil=function(ca){ca.stack[ca.top++]=new ee(Q.LUA_TNIL,null),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_pushnumber=function(ca,da){E('number'==typeof da),ca.stack[ca.top++]=new ee(Q.LUA_TNUMFLT,da),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_pushstring=function(ca,da){return E(Array.isArray(da)||void 0===da||null===da,'lua_pushstring expects array of byte'),ca.stack[ca.top]=void 0===da||null===da?new ee(Q.LUA_TNIL,null):new ee(Q.LUA_TLNGSTR,H.luaS_new(ca,da)),ca.top++,E(ca.top<=ca.ci.top,'stack overflow'),da},T.exports.lua_pushfstring=function(ca,da,...La){return E(Array.isArray(da)),G.luaO_pushvfstring(ca,da,La)},T.exports.lua_pushvfstring=function(ca,da,La){return E(Array.isArray(da)),G.luaO_pushvfstring(ca,da,La)},T.exports.lua_pushthread=function(ca){return ca.stack[ca.top++]=new ee(Q.LUA_TTHREAD,ca),E(ca.top<=ca.ci.top,'stack overflow'),ca.l_G.mainthread===ca},T.exports.lua_pushvalue=function(ca,da){ca.stack[ca.top]=ne(ca,da),ca.top++,E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_rawequal=function(ca,da,La){let fa=ne(ca,da),ga=ne(ca,La);return ae(fa)&&ae(ga)?q.luaV_equalobj(null,fa,ga):0},T.exports.lua_rawget=function(ca,da){let La=ne(ca,da);return E(La.ttistable(La),'table expected'),ca.stack[ca.top-1]=W.luaH_get(La.value,ca.stack[ca.top-1]),ca.stack[ca.top-1].ttnov()},T.exports.lua_rawgeti=Ze,T.exports.lua_rawgetp=function(ca,da,La){let fa=ne(ca,da);E(fa.ttistable(),'table expected');let ga=new ee(Q.LUA_TLIGHTUSERDATA,La);return ca.stack[ca.top++]=W.luaH_get(fa.value,ga),E(ca.top<=ca.ci.top,'stack overflow'),ca.stack[ca.top-1].ttnov()},T.exports.lua_rawlen=function(ca,da){let La=ne(ca,da);switch(La.ttype()){case Q.LUA_TSHRSTR:case Q.LUA_TLNGSTR:return La.vslen();case Q.LUA_TUSERDATA:return La.len;case Q.LUA_TTABLE:return W.luaH_getn(La.value);default:return 0;}},T.exports.lua_rawset=function(ca,da){E(2<ca.top-ca.ci.funcOff,'not enough elements in the stack');let La=ne(ca,da);E(La.ttistable(),'table expected');let fa=W.luaH_set(La.value,ca.stack[ca.top-2]);fa.setfrom(ca.stack[ca.top-1]),ca.top-=2},T.exports.lua_rawseti=function(ca,da,La){E(2<ca.top-ca.ci.funcOff,'not enough elements in the stack');let fa=ne(ca,da);E(fa.ttistable(),'table expected'),W.luaH_setint(fa.value,La,ca.stack[ca.top-1]),delete ca.stack[--ca.top]},T.exports.lua_rawsetp=function(ca,da,La){E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let fa=ne(ca,da);E(ca,fa.ttistable(),'table expected');let ga=new ee(Q.LUA_TLIGHTUSERDATA,La),Aa=W.luaH_set(fa.value,ga);Aa.setfrom(ca.stack[ca.top-1]),ca.top--},T.exports.lua_remove=function(ca,da){he(ca,da,-1),Ae(ca,1)},T.exports.lua_replace=function(ca,da){Oe(ca,-1,da),Ae(ca,1)},T.exports.lua_rotate=he,T.exports.lua_setfield=function(ca,da,La){we(ca,ne(ca,da),La)},T.exports.lua_setglobal=function(ca,da){we(ca,W.luaH_getint(ca.l_G.l_registry.value,N.LUA_RIDX_GLOBALS),da)},T.exports.lua_seti=function(ca,da,La){E('number'==typeof La&&(0|La)===La),E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let fa=ne(ca,da);ca.stack[ca.top++]=new ee(Q.LUA_TNUMINT,La),E(ca.top<=ca.ci.top,'stack overflow'),q.settable(ca,fa,ca.stack[ca.top-1],ca.stack[ca.top-2]),delete ca.stack[--ca.top],delete ca.stack[--ca.top]},T.exports.lua_setmetatable=function(ca,da){E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let fa=ne(ca,da),La;switch(ca.stack[ca.top-1].ttisnil()?La=null:(E(ca.stack[ca.top-1].ttistable(),'table expected'),La=ca.stack[ca.top-1].value),fa.ttnov()){case Q.LUA_TUSERDATA:case Q.LUA_TTABLE:{fa.value.metatable=La;break}default:{ca.l_G.mt[fa.ttnov()]=La;break}}return delete ca.stack[--ca.top],!0},T.exports.lua_settable=function(ca,da){E(2<ca.top-ca.ci.funcOff,'not enough elements in the stack');let La=ne(ca,da);q.settable(ca,La,ca.stack[ca.top-2],ca.stack[ca.top-1]),ca.top-=2},T.exports.lua_settop=ge,T.exports.lua_setupvalue=function(ca,da,La){let fa=ne(ca,da);E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let ga=ut(ca,fa,La);if(ga){let Aa=ga.name,Ta=ga.val;return ca.top--,Ta.type=ca.stack[ca.top].type,Ta.value=ca.stack[ca.top].value,Aa}return null},T.exports.lua_setuservalue=function(ca,da){E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let La=ne(ca,da);E(ca,La.ttisfulluserdata(),'full userdata expected'),La.uservalue.setfrom(ca.stack[ca.top-1]),delete ca.stack[--ca.top]},T.exports.lua_status=function(ca){return ca.status},T.exports.lua_stringtonumber=function(ca,da){let La=G.luaO_str2num(da);return La?(ca.stack[ca.top++]=La,E(ca.top<=ca.ci.top,'stack overflow'),da.length):0},T.exports.lua_toboolean=function(ca,da){let La=ne(ca,da);return!La.l_isfalse()},T.exports.lua_todataview=function(ca,da){let La=ne(ca,da);if(!La.ttisstring()&&!La.ttisnumber())return null;let fa=new DataView(new ArrayBuffer(La.vslen()));return La.svalue().forEach((ga,Aa)=>fa.setUint8(Aa,ga,!0)),fa},T.exports.lua_tointeger=function(ca,da){return q.tointeger(ne(ca,da))},T.exports.lua_tointegerx=function(ca,da){return q.tointeger(ne(ca,da))},T.exports.lua_tojsstring=Tt,T.exports.lua_toljsstring=Tt,T.exports.lua_tolstring=ft,T.exports.lua_tonumber=function(ca,da){return q.tonumber(ne(ca,da))},T.exports.lua_topointer=function(ca,da){let La=ne(ca,da);switch(La.ttype()){case Q.LUA_TTABLE:case Q.LUA_TLCL:case Q.LUA_TCCL:case Q.LUA_TLCF:case Q.LUA_TTHREAD:case Q.LUA_TUSERDATA:case Q.LUA_TLIGHTUSERDATA:return La.value;default:return null;}},T.exports.lua_tostring=ft,T.exports.lua_tothread=function(ca,da){let La=ne(ca,da);return La.ttisthread()?La.value:null},T.exports.lua_touserdata=function(ca,da){let La=ne(ca,da);switch(La.ttnov()){case Q.LUA_TUSERDATA:return La.value.data;case Q.LUA_TLIGHTUSERDATA:return La.value;default:return null;}},T.exports.lua_type=Ct,T.exports.lua_typename=function(ca,da){return E(Q.LUA_TNONE<=da&&da<Q.LUA_NUMTAGS,'invalid tag'),Y.ttypename(da)},T.exports.lua_upvalueid=function(ca,da,La){let fa=ne(ca,da);switch(fa.ttype()){case Q.LUA_TLCL:return sa(ca,da,La,null).upval;case Q.LUA_TCCL:{let ga=fa.value;return E(1<=La&&La<=ga.nupvalues,'invalid upvalue index'),ga.upvalue[La-1]}default:return E(!1,'closure expected'),null;}},T.exports.lua_upvaluejoin=function(ca,da,La,fa,ga){let Aa=sa(ca,da,La),Ta=sa(ca,fa,ga),ha=Aa.upvalOff,Oa=Ta.upval,xa=Aa.closure;xa.upvals[ha]=Oa},T.exports.lua_version=function(ca){return null===ca?N.LUA_VERSION_NUM:ca.l_G.version},T.exports.lua_xmove=function(ca,da,La){if(ca!==da){E(La<ca.top-ca.ci.funcOff,'not enough elements in the stack'),E(ca.l_G===da.l_G,'moving among independent states'),E(da.ci.top-da.top>=La,'stack overflow'),ca.top-=La;for(let fa=0;fa<La;fa++)da.stack[da.top]=ca.stack[ca.top+fa],da.top++}}},function(T){var U=function(){return this}();try{U=U||Function('return this')()||(1,eval)('this')}catch(E){'object'==typeof window&&(U=window)}T.exports=U},function(T,O,U){'use strict';const E=U(2),N=U(6),I=function(Z){let Q=E.lua_tothread(Z,1);return N.luaL_argcheck(Z,Q,1,E.to_luastring('thread expected',!0)),Q},M=function(Z,Q,$){if(!E.lua_checkstack(Q,$))return E.lua_pushliteral(Z,'too many arguments to resume'),-1;if(E.lua_status(Q)===E.LUA_OK&&0===E.lua_gettop(Q))return E.lua_pushliteral(Z,'cannot resume dead coroutine'),-1;E.lua_xmove(Z,Q,$);let ee=E.lua_resume(Q,Z,$);if(ee===E.LUA_OK||ee===E.LUA_YIELD){let te=E.lua_gettop(Q);return E.lua_checkstack(Z,te+1)?(E.lua_xmove(Q,Z,te),te):(E.lua_pop(Q,te),E.lua_pushliteral(Z,'too many results to resume'),-1)}return E.lua_xmove(Q,Z,1),-1},K=function(Z){let Q=E.lua_tothread(Z,E.lua_upvalueindex(1)),$=M(Z,Q,E.lua_gettop(Z));return 0>$?(E.lua_type(Z,-1)===E.LUA_TSTRING&&(N.luaL_where(Z,1),E.lua_insert(Z,-2),E.lua_concat(Z,2)),E.lua_error(Z)):$},V=function(Z){N.luaL_checktype(Z,1,E.LUA_TFUNCTION);let Q=E.lua_newthread(Z);return E.lua_pushvalue(Z,1),E.lua_xmove(Z,Q,1),1},q={create:V,isyieldable:function(Z){return E.lua_pushboolean(Z,E.lua_isyieldable(Z)),1},resume:function(Z){let Q=I(Z),$=M(Z,Q,E.lua_gettop(Z)-1);return 0>$?(E.lua_pushboolean(Z,0),E.lua_insert(Z,-2),2):(E.lua_pushboolean(Z,1),E.lua_insert(Z,-($+1)),$+1)},running:function(Z){return E.lua_pushboolean(Z,E.lua_pushthread(Z)),2},status:function(Z){let Q=I(Z);if(Z===Q)E.lua_pushliteral(Z,'running');else switch(E.lua_status(Q)){case E.LUA_YIELD:E.lua_pushliteral(Z,'suspended');break;case E.LUA_OK:{let $=new E.lua_Debug;0<E.lua_getstack(Q,0,$)?E.lua_pushliteral(Z,'normal'):0===E.lua_gettop(Q)?E.lua_pushliteral(Z,'dead'):E.lua_pushliteral(Z,'suspended');break}default:E.lua_pushliteral(Z,'dead');}return 1},wrap:function(Z){return V(Z),E.lua_pushcclosure(Z,K,1),1},'yield':function(Z){return E.lua_yield(Z,E.lua_gettop(Z))}};T.exports.luaopen_coroutine=function(Z){return N.luaL_newlib(Z,q),1}},function(T,O,U){'use strict';const E=U(0),N=U(2),I=U(6),M=function(Oe,xe,Ue){Oe===xe||N.lua_checkstack(xe,Ue)||I.luaL_error(Oe,N.to_luastring('stack overflow',!0))},H=function(Oe){return N.lua_isthread(Oe,1)?{arg:1,thread:N.lua_tothread(Oe,1)}:{arg:0,thread:Oe}},Y=function(Oe,xe,Ue){N.lua_pushstring(Oe,Ue),N.lua_setfield(Oe,-2,xe)},J=function(Oe,xe,Ue){N.lua_pushinteger(Oe,Ue),N.lua_setfield(Oe,-2,xe)},q=function(Oe,xe,Ue){N.lua_pushboolean(Oe,Ue),N.lua_setfield(Oe,-2,xe)},W=function(Oe,xe,Ue){Oe==xe?N.lua_rotate(Oe,-2,1):N.lua_xmove(xe,Oe,1),N.lua_setfield(Oe,-2,Ue)},ee=function(Oe,xe){let Ue=I.luaL_checkinteger(Oe,2);I.luaL_checktype(Oe,1,N.LUA_TFUNCTION);let Ee=xe?N.lua_getupvalue(Oe,1,Ue):N.lua_setupvalue(Oe,1,Ue);return null===Ee?0:(N.lua_pushstring(Oe,Ee),N.lua_insert(Oe,-(xe+1)),xe+1)},ue=function(Oe,xe,Ue){let Ee=I.luaL_checkinteger(Oe,Ue);return I.luaL_checktype(Oe,xe,N.LUA_TFUNCTION),I.luaL_argcheck(Oe,null!==N.lua_getupvalue(Oe,xe,Ee),Ue,N.to_luastring('invalid upvalue index',!0)),Ee},oe=N.to_luastring('__hooks__',!0),_e=['call','return','line','count','tail call'].map((Oe)=>N.to_luastring(Oe)),pe=function(Oe,xe){N.lua_rawgetp(Oe,N.LUA_REGISTRYINDEX,oe),N.lua_pushthread(Oe),N.lua_rawget(Oe,-2)===N.LUA_TFUNCTION&&(N.lua_pushstring(Oe,_e[xe.event]),0<=xe.currentline?N.lua_pushinteger(Oe,xe.currentline):N.lua_pushnil(Oe),E(N.lua_getinfo(Oe,['l'.charCodeAt(0),'S'.charCodeAt(0)],xe)),N.lua_call(Oe,2,0))},ce=function(Oe,xe){let Ue=0;return-1<Oe.indexOf('c'.charCodeAt(0))&&(Ue|=N.LUA_MASKCALL),-1<Oe.indexOf('r'.charCodeAt(0))&&(Ue|=N.LUA_MASKRET),-1<Oe.indexOf('l'.charCodeAt(0))&&(Ue|=N.LUA_MASKLINE),0<xe&&(Ue|=N.LUA_MASKCOUNT),Ue},de=function(Oe,xe){let Ue=0;return Oe&N.LUA_MASKCALL&&(xe[Ue++]='c'.charCodeAt(0)),Oe&N.LUA_MASKRET&&(xe[Ue++]='r'.charCodeAt(0)),Oe&N.LUA_MASKLINE&&(xe[Ue++]='l'.charCodeAt(0)),xe},Te={gethook:function(Oe){let xe=H(Oe),Ue=xe.thread,Ee=xe.arg,ve=N.lua_gethookmask(Ue),Re=N.lua_gethook(Ue);return null===Re?N.lua_pushnil(Oe):Re===pe?(N.lua_rawgetp(Oe,N.LUA_REGISTRYINDEX,oe),M(Oe,Ue,1),N.lua_pushthread(Ue),N.lua_xmove(Ue,Oe,1),N.lua_rawget(Oe,-2),N.lua_remove(Oe,-2)):N.lua_pushliteral(Oe,'external hook'),N.lua_pushstring(Oe,de(ve,[])),N.lua_pushinteger(Oe,N.lua_gethookcount(Ue)),3},getinfo:function(Oe){let xe=new N.lua_Debug,Ue=H(Oe),Ee=Ue.arg,ke=Ue.thread,ve=I.luaL_optstring(Oe,Ee+2,N.to_luastring('flnStu',!0));if(M(Oe,ke,3),N.lua_isfunction(Oe,Ee+1))ve=['>'.charCodeAt(0)].concat(ve),N.lua_pushvalue(Oe,Ee+1),N.lua_xmove(Oe,ke,1);else if(!N.lua_getstack(ke,I.luaL_checkinteger(Oe,Ee+1),xe))return N.lua_pushnil(Oe),1;return N.lua_getinfo(ke,ve,xe)||I.luaL_argerror(Oe,Ee+2,N.to_luastring('invalid option',!0)),N.lua_newtable(Oe),-1<ve.indexOf('S'.charCodeAt(0))&&(Y(Oe,N.to_luastring('source',!0),xe.source),Y(Oe,N.to_luastring('short_src',!0),xe.short_src),Y(Oe,N.to_luastring('linedefined',!0),N.to_luastring(`${xe.linedefined}`)),Y(Oe,N.to_luastring('lastlinedefined',!0),N.to_luastring(`${xe.lastlinedefined}`)),Y(Oe,N.to_luastring('what',!0),xe.what)),-1<ve.indexOf('l'.charCodeAt(0))&&J(Oe,N.to_luastring('currentline',!0),xe.currentline),-1<ve.indexOf('u'.charCodeAt(0))&&(J(Oe,N.to_luastring('nups',!0),xe.nups),J(Oe,N.to_luastring('nparams',!0),xe.nparams),q(Oe,N.to_luastring('isvararg',!0),xe.isvararg)),-1<ve.indexOf('n'.charCodeAt(0))&&(Y(Oe,N.to_luastring('name',!0),xe.name?xe.name:null),Y(Oe,N.to_luastring('namewhat',!0),xe.namewhat?xe.namewhat:null)),-1<ve.indexOf('t'.charCodeAt(0))&&q(Oe,N.to_luastring('istailcall',!0),xe.istailcall),-1<ve.indexOf('L'.charCodeAt(0))&&W(Oe,ke,N.to_luastring('activelines',!0)),-1<ve.indexOf('f'.charCodeAt(0))&&W(Oe,ke,N.to_luastring('func',!0)),1},getlocal:function(Oe){let xe=H(Oe),Ue=xe.thread,Ee=xe.arg,ke=new N.lua_Debug,ve=I.luaL_checkinteger(Oe,Ee+2);if(N.lua_isfunction(Oe,Ee+1))return N.lua_pushvalue(Oe,Ee+1),N.lua_pushstring(Oe,N.lua_getlocal(Oe,null,ve)),1;let Re=I.luaL_checkinteger(Oe,Ee+1);if(!N.lua_getstack(Ue,Re,ke))return I.luaL_argerror(Oe,Ee+1,N.to_luastring('level out of range',!0));M(Oe,Ue,1);let be=N.lua_getlocal(Ue,ke,ve);return be?(N.lua_xmove(Ue,Oe,1),N.lua_pushstring(Oe,be),N.lua_rotate(Oe,-2,1),2):(N.lua_pushnil(Oe),1)},getmetatable:function(Oe){return I.luaL_checkany(Oe,1),N.lua_getmetatable(Oe,1)||N.lua_pushnil(Oe),1},getregistry:function(Oe){return N.lua_pushvalue(Oe,N.LUA_REGISTRYINDEX),1},getupvalue:function(Oe){return ee(Oe,1)},getuservalue:function(Oe){return N.lua_type(Oe,1)===N.LUA_TUSERDATA?N.lua_getuservalue(Oe,1):N.lua_pushnil(Oe),1},sethook:function(Oe){let ke=H(Oe),ve=ke.thread,Re=ke.arg,xe,Ue,Ee;if(N.lua_isnoneornil(Oe,Re+1))N.lua_settop(Oe,Re+1),Ee=null,xe=0,Ue=0;else{const be=I.luaL_checkstring(Oe,Re+2);I.luaL_checktype(Oe,Re+1,N.LUA_TFUNCTION),Ue=I.luaL_optinteger(Oe,Re+3,0),Ee=pe,xe=ce(be,Ue)}return N.lua_rawgetp(Oe,N.LUA_REGISTRYINDEX,oe)===N.LUA_TNIL&&(N.lua_createtable(Oe,0,2),N.lua_pushvalue(Oe,-1),N.lua_rawsetp(Oe,N.LUA_REGISTRYINDEX,oe),N.lua_pushstring(Oe,['k'.charCodeAt(0)]),N.lua_setfield(Oe,-2,N.to_luastring('__mode',!0)),N.lua_pushvalue(Oe,-1),N.lua_setmetatable(Oe,-2)),M(Oe,ve,1),N.lua_pushthread(ve),N.lua_xmove(ve,Oe,1),N.lua_pushvalue(Oe,Re+1),N.lua_rawset(Oe,-3),N.lua_sethook(ve,Ee,xe,Ue),0},setlocal:function(Oe){let xe=H(Oe),Ue=xe.thread,Ee=xe.arg,ke=new N.lua_Debug,ve=I.luaL_checkinteger(Oe,Ee+1),Re=I.luaL_checkinteger(Oe,Ee+2);if(!N.lua_getstack(Ue,ve,ke))return I.luaL_argerror(Oe,Ee+1,'level out of range');I.luaL_checkany(Oe,Ee+3),N.lua_settop(Oe,Ee+3),M(Oe,Ue,1),N.lua_xmove(Oe,Ue,1);let be=N.lua_setlocal(Ue,ke,Re);return null===be&&N.lua_pop(Ue,1),N.lua_pushstring(Oe,be),1},setmetatable:function(Oe){const xe=N.lua_type(Oe,2);return I.luaL_argcheck(Oe,xe==N.LUA_TNIL||xe==N.LUA_TTABLE,2,N.to_luastring('nil or table expected',!0)),N.lua_settop(Oe,2),N.lua_setmetatable(Oe,1),1},setupvalue:function(Oe){return I.luaL_checkany(Oe,3),ee(Oe,0)},setuservalue:function(Oe){return I.luaL_checktype(Oe,1,N.LUA_TUSERDATA),I.luaL_checkany(Oe,2),N.lua_settop(Oe,2),N.lua_setuservalue(Oe,1),1},traceback:function(Oe){let xe=H(Oe),Ue=xe.thread,Ee=xe.arg,ke=N.lua_tostring(Oe,Ee+1);if(null===ke&&!N.lua_isnoneornil(Oe,Ee+1))N.lua_pushvalue(Oe,Ee+1);else{let ve=I.luaL_optinteger(Oe,Ee+2,Oe===Ue?1:0);I.luaL_traceback(Oe,Ue,ke,ve)}return 1},upvalueid:function(Oe){let xe=ue(Oe,1,2);return N.lua_pushlightuserdata(Oe,N.lua_upvalueid(Oe,1,xe)),1},upvaluejoin:function(Oe){let xe=ue(Oe,1,2),Ue=ue(Oe,3,4);return I.luaL_argcheck(Oe,!N.lua_iscfunction(Oe,1),1,N.to_luastring('Lua function expected',!0)),I.luaL_argcheck(Oe,!N.lua_iscfunction(Oe,3),3,N.to_luastring('Lua function expected',!0)),N.lua_upvaluejoin(Oe,1,xe,3,Ue),0}};T.exports.luaopen_debug=function(Oe){return I.luaL_newlib(Oe,Te),1}},function(T){'use strict';T.exports.lisdigit=function(V){return /^\d$/.test(_StringfromCharCode(V))},T.exports.lislalnum=function(V){return /^[_a-zA-Z0-9]$/.test(_StringfromCharCode(V))},T.exports.lislalpha=function(V){return /^[_a-zA-Z]$/.test(_StringfromCharCode(V))},T.exports.lisprint=function(V){return /^[\x20-\x7E]$/.test(_StringfromCharCode(V))},T.exports.lisspace=function(V){return /^\s$/.test(_StringfromCharCode(V))},T.exports.lisxdigit=function(V){return /^[0-9a-fA-F]$/.test(_StringfromCharCode(V))}},function(T,O,U){'use strict';const E=U(33),N=U(2),I=U(6),M=U(4),P=U(12);var K=E();const $=function(he,Oe){let xe=P.lua_numbertointeger(Oe);!1===xe?N.lua_pushnumber(he,Oe):N.lua_pushinteger(he,xe)},Ae={abs:function(he){return N.lua_isinteger(he,1)?N.lua_pushinteger(he,_Mathabs(N.lua_tointeger(he,1))):N.lua_pushnumber(he,_Mathabs(I.luaL_checknumber(he,1))),1},acos:function(he){return N.lua_pushnumber(he,Math.acos(I.luaL_checknumber(he,1))),1},asin:function(he){return N.lua_pushnumber(he,Math.asin(I.luaL_checknumber(he,1))),1},atan:function(he){return N.lua_pushnumber(he,Math.atan(I.luaL_checknumber(he,1))),1},ceil:function(he){return N.lua_isinteger(he,1)?N.lua_settop(he,1):$(he,_Mathceil(I.luaL_checknumber(he,1))),1},cos:function(he){return N.lua_pushnumber(he,Math.cos(I.luaL_checknumber(he,1))),1},deg:function(he){return N.lua_pushnumber(he,I.luaL_checknumber(he,1)*(180/_MathPI)),1},exp:function(he){return N.lua_pushnumber(he,Math.exp(I.luaL_checknumber(he,1))),1},floor:function(he){return N.lua_isinteger(he,1)?N.lua_settop(he,1):$(he,_Mathfloor(I.luaL_checknumber(he,1))),1},fmod:function(he){if(N.lua_isinteger(he,1)&&N.lua_isinteger(he,2)){let Oe=N.lua_tointeger(he,2);1>=_Mathabs(Oe)+1?(I.luaL_argcheck(he,0!==Oe,2,N.to_luastring('zero',!0)),N.lua_pushinteger(he,0)):N.lua_pushinteger(he,N.lua_tointeger(he,1)%Oe)}else{let Oe=I.luaL_checknumber(he,1),xe=I.luaL_checknumber(he,2);N.lua_pushnumber(he,+(Oe-_Mathfloor(Oe/xe)*xe).toPrecision(8))}return 1},log:function(he){let Oe=I.luaL_checknumber(he,1),xe;if(N.lua_isnoneornil(he,2))xe=_Mathlog(Oe);else{let Ue=I.luaL_checknumber(he,2);xe=2===Ue?Math.log2(Oe):10===Ue?Math.log10(Oe):_Mathlog(Oe)/_Mathlog(Ue)}return N.lua_pushnumber(he,xe),1},max:function(he){let Oe=N.lua_gettop(he),xe=1;I.luaL_argcheck(he,1<=Oe,1,N.to_luastring('value expected',!0));for(let Ue=2;Ue<=Oe;Ue++)N.lua_compare(he,xe,Ue,N.LUA_OPLT)&&(xe=Ue);return N.lua_pushvalue(he,xe),1},min:function(he){let Oe=N.lua_gettop(he),xe=1;I.luaL_argcheck(he,1<=Oe,1,N.to_luastring('value expected',!0));for(let Ue=2;Ue<=Oe;Ue++)N.lua_compare(he,Ue,xe,N.LUA_OPLT)&&(xe=Ue);return N.lua_pushvalue(he,xe),1},modf:function(he){if(N.lua_isinteger(he,1))N.lua_settop(he,1),N.lua_pushnumber(he,0);else{let Oe=I.luaL_checknumber(he,1),xe=0>Oe?_Mathceil(Oe):_Mathfloor(Oe);$(he,xe),N.lua_pushnumber(he,Oe===xe?0:Oe-xe)}return 2},rad:function(he){return N.lua_pushnumber(he,I.luaL_checknumber(he,1)*(_MathPI/180)),1},random:function(he){let Ue=K(),Oe,xe;switch(N.lua_gettop(he)){case 0:return N.lua_pushnumber(he,Ue),1;case 1:{Oe=1,xe=I.luaL_checkinteger(he,1);break}case 2:{Oe=I.luaL_checkinteger(he,1),xe=I.luaL_checkinteger(he,2);break}default:return I.luaL_error(he,N.to_luastring('wrong number of arguments',!0));}return I.luaL_argcheck(he,Oe<=xe,1,N.to_luastring('interval is empty',!0)),I.luaL_argcheck(he,0<=Oe||xe<=M.MAX_INT+Oe,1,N.to_luastring('interval too large',!0)),Ue*=xe-Oe+1,N.lua_pushinteger(he,_Mathfloor(Ue)+Oe),1},randomseed:function(he){K=E(_Mathabs(I.luaL_checknumber(he,1)))},sin:function(he){return N.lua_pushnumber(he,Math.sin(I.luaL_checknumber(he,1))),1},sqrt:function(he){return N.lua_pushnumber(he,Math.sqrt(I.luaL_checknumber(he,1))),1},tan:function(he){return N.lua_pushnumber(he,Math.tan(I.luaL_checknumber(he,1))),1},tointeger:function(he){let Oe=N.lua_tointegerx(he,1);return!1===Oe?(I.luaL_checkany(he,1),N.lua_pushnil(he)):N.lua_pushinteger(he,Oe),1},type:function(he){return N.lua_type(he,1)===N.LUA_TNUMBER?N.lua_isinteger(he,1)?N.lua_pushliteral(he,'integer'):N.lua_pushliteral(he,'float'):(I.luaL_checkany(he,1),N.lua_pushnil(he)),1},ult:function(he){let Oe=I.luaL_checkinteger(he,1),xe=I.luaL_checkinteger(he,2);return N.lua_pushboolean(he,_Mathabs(Oe)<_Mathabs(xe)),1}};T.exports.luaopen_math=function(he){return I.luaL_newlib(he,Ae),N.lua_pushnumber(he,Math.PI),N.lua_setfield(he,-2,N.to_luastring('pi',!0)),N.lua_pushnumber(he,Infinity),N.lua_setfield(he,-2,N.to_luastring('huge',!0)),N.lua_pushinteger(he,M.MAX_INT),N.lua_setfield(he,-2,N.to_luastring('maxinteger',!0)),N.lua_pushinteger(he,M.MIN_INT),N.lua_setfield(he,-2,N.to_luastring('mininteger',!0)),1}},function(T,O,U){'use strict';(function(E){const N=U(2),I=U(6),M=['-'.charCodeAt(0)],P=N.to_luastring('__CLIBS__',!0),G=N.LUA_DIRSEP,F=N.LUA_DIRSEP,H='luaopen_',J=[1],Z=function(Ne,Ie){try{return Ie=N.to_jsstring(Ie),Ie.startsWith('.')&&(Ie=`${E.env.PWD}/${Ie}`),!function(){var Me=new Error('Cannot find module "."');throw Me.code='MODULE_NOT_FOUND',Me}()}catch(Ce){N.lua_pushjsstring(Ne,Ce.message)}},Q=function(Ne,Ie,Ce){let Me=Ie[N.to_jsstring(Ce)];return Me&&'function'==typeof Me?Me:void N.lua_pushliteral(Ne,`'${N.to_jsstring(Ce)}'`)},$=function(Ne){N.lua_getfield(Ne,N.LUA_REGISTRYINDEX,N.to_luastring('LUA_NOENV'));let Ie=N.lua_toboolean(Ne,-1);return N.lua_pop(Ne,1),Ie};let ee=function(){return!1};const te=1,ae=2,ue=function(Ne,Ie,Ce){let Me=oe(Ne,Ie);if(null===Me){if(Me=Z(Ne,Ie,Ce[0]==='*'.charCodeAt(0)),null===Me)return te;_e(Ne,Ie,Me)}if(Ce[0]==='*'.charCodeAt(0))return N.lua_pushboolean(Ne,1),0;let Pe=Q(Ne,Me,Ce);return null===Pe?ae:(N.lua_pushcfunction(Ne,Pe),0)},ne=function(Ne,Ie,Ce,Me){let Pe=N.lua_pushstring(Ne,N.to_luastring(`${Ce}${N.LUA_VERSUFFIX}`,!0)),ye=E.env[Pe];void 0===ye&&(ye=E.env[Ce]),void 0===ye||$(Ne)?N.lua_pushstring(Ne,N.to_luastring(Me,!0)):(ye=I.luaL_gsub(Ne,N.to_luastring(ye),N.to_luastring(N.LUA_PATH_SEP+N.LUA_PATH_SEP,!0),N.to_luastring(N.LUA_PATH_SEP,!0).concat(J).concat(N.to_luastring(N.LUA_PATH_SEP,!0))),I.luaL_gsub(Ne,ye,J,N.to_luastring(Me)),N.lua_remove(Ne,-2)),N.lua_setfield(Ne,-3,Ie),N.lua_pop(Ne,1)},oe=function(Ne,Ie){N.lua_rawgetp(Ne,N.LUA_REGISTRYINDEX,P),N.lua_getfield(Ne,-1,Ie);let Ce=N.lua_touserdata(Ne,-1);return N.lua_pop(Ne,2),Ce},_e=function(Ne,Ie,Ce){N.lua_rawgetp(Ne,N.LUA_REGISTRYINDEX,P),N.lua_pushlightuserdata(Ne,Ce),N.lua_pushvalue(Ne,-1),N.lua_setfield(Ne,-3,Ie),N.lua_rawseti(Ne,-2,I.luaL_len(Ne,-2)+1),N.lua_pop(Ne,1)},pe=function(Ne,Ie){for(;Ie[0]===N.LUA_PATH_SEP.charCodeAt(0);)Ie=Ie.slice(1);if(0===Ie.length)return null;let Ce=Ie.indexOf(N.LUA_PATH_SEP.charCodeAt(0));return 0>Ce&&(Ce=Ie.length),N.lua_pushlstring(Ne,Ie,Ce),Ie.slice(Ce)},ce=function(Ne,Ie,Ce,Me,Pe){let ye=[];for(0!==Me[0]&&(Ie=I.luaL_gsub(Ne,Ie,Me,Pe));null!==(Ce=pe(Ne,Ce));){let De=I.luaL_gsub(Ne,N.lua_tostring(Ne,-1),N.to_luastring(N.LUA_PATH_MARK,!0),Ie);if(N.lua_remove(Ne,-2),ee(De))return De;N.lua_remove(Ne,-1),ye.push(...N.to_luastring(`\n\tno file '${N.to_jsstring(De)}'`))}return N.lua_pushstring(Ne,ye),null},Le=function(Ne,Ie,Ce,Me){N.lua_getfield(Ne,N.lua_upvalueindex(1),Ce);let Pe=N.lua_tostring(Ne,-1);return null===Pe&&I.luaL_error(Ne,N.to_luastring('\'package.%s\' must be a string'),Ce),ce(Ne,Ie,Pe,['.'.charCodeAt(0)],Me)},ge=function(Ne,Ie,Ce){return Ie?(N.lua_pushstring(Ne,Ce),2):I.luaL_error(Ne,N.to_luastring('error loading module \'%s\' from file \'%s\':\n\t%s'),N.lua_tostring(Ne,1),Ce,N.lua_tostring(Ne,1))},Ae=function(Ne){let Ie=I.luaL_checkstring(Ne,1),Ce=Le(Ne,Ie,N.to_luastring('path',!0),N.to_luastring(F,!0));return null===Ce?1:ge(Ne,I.luaL_loadfile(Ne,Ce)===N.LUA_OK,Ce)},Te=function(Ne,Ie,Ce){let Me;Ce=I.luaL_gsub(Ne,Ce,['.'.charCodeAt(0)],'_');let Pe=Ce.indexOf(M[0]);if(0<=Pe){Me=N.lua_pushlstring(Ne,Ce,Pe),Me=N.lua_pushstring(Ne,N.to_luastring(`${H}${Me}`));let ye=ue(Ne,Ie,Me);if(ye!==ae)return ye;Ce=Pe+1}return Me=N.lua_pushstring(Ne,N.to_luastring(`${H}${Ce}`)),ue(Ne,Ie,Me)},he=function(Ne){let Ie=I.luaL_checkstring(Ne,1),Ce=Le(Ne,Ie,N.to_luastring('cpath',!0),N.to_luastring(G,!0));return null===Ce?1:ge(Ne,0===Te(Ne,Ce,Ie),Ce)},Oe=function(Ne){let Ie=I.luaL_checkstring(Ne,1),Ce=Ie.indexOf('.'.charCodeAt(0)),Me;if(0>Ce)return 0;N.lua_pushlstring(Ne,Ie,Ce);let Pe=Le(Ne,N.lua_tostring(Ne,-1),N.to_luastring('cpath',!0),N.to_luastring(G,!0));return null===Pe?1:0===(Me=Te(Ne,Pe,Ie))?(N.lua_pushstring(Ne,Pe),2):Me==ae?(N.lua_pushstring(Ne,N.to_luastring(`\n\tno module '${N.to_jsstring(Ie)}' in file '${N.to_jsstring(Pe)}'`)),1):ge(Ne,0,Pe)},xe=function(Ne){let Ie=I.luaL_checkstring(Ne,1);return N.lua_getfield(Ne,N.LUA_REGISTRYINDEX,N.to_luastring(I.LUA_PRELOAD_TABLE,!0)),N.lua_getfield(Ne,-1,Ie)===N.LUA_TNIL&&N.lua_pushliteral(Ne,`\n\tno field package.preload['${N.to_jsstring(Ie)}']`),1},Ue=function(Ne,Ie){let Ce=[];N.lua_getfield(Ne,N.lua_upvalueindex(1),N.to_luastring('searchers',!0))!==N.LUA_TTABLE&&I.luaL_error(Ne,N.to_luastring('\'package.searchers\' must be a table'));for(let Me=1;;Me++){if(N.lua_rawgeti(Ne,3,Me)===N.LUA_TNIL&&(N.lua_pop(Ne,1),N.lua_pushstring(Ne,Ce),I.luaL_error(Ne,N.to_luastring('module \'%s\' not found:%s'),Ie,N.lua_tostring(Ne,-1))),N.lua_pushstring(Ne,Ie),N.lua_call(Ne,1,2),N.lua_isfunction(Ne,-2))return;N.lua_isstring(Ne,-2)?(N.lua_pop(Ne,1),Ce.push(...N.lua_tostring(Ne,-1)),N.lua_remove(Ne,-1)):N.lua_pop(Ne,2)}},ke={loadlib:function(Ne){let Ie=I.luaL_checkstring(Ne,1),Ce=I.luaL_checkstring(Ne,2),Me=ue(Ne,Ie,Ce);return 0===Me?1:(N.lua_pushnil(Ne),N.lua_insert(Ne,-2),N.lua_pushjsstring(Ne,Me===te?'absent':'init'),3)},searchpath:function(Ne){let Ie=ce(Ne,I.luaL_checkstring(Ne,1),I.luaL_checkstring(Ne,2),I.luaL_optstring(Ne,3,['.'.charCodeAt(0)]),I.luaL_optstring(Ne,4,[N.LUA_DIRSEP.charCodeAt(0)]));return null===Ie?(N.lua_pushnil(Ne),N.lua_insert(Ne,-2),2):1}},ve={require:function(Ne){let Ie=I.luaL_checkstring(Ne,1);return(N.lua_settop(Ne,1),N.lua_getfield(Ne,N.LUA_REGISTRYINDEX,N.to_luastring(I.LUA_LOADED_TABLE,!0)),N.lua_getfield(Ne,2,Ie),N.lua_toboolean(Ne,-1))?1:(N.lua_pop(Ne,1),Ue(Ne,Ie),N.lua_pushstring(Ne,Ie),N.lua_insert(Ne,-2),N.lua_call(Ne,2,1),N.lua_isnil(Ne,-1)||N.lua_setfield(Ne,2,Ie),N.lua_getfield(Ne,2,Ie)==N.LUA_TNIL&&(N.lua_pushboolean(Ne,1),N.lua_pushvalue(Ne,-1),N.lua_setfield(Ne,2,Ie)),1)}},Re=function(Ne){let Ie=[xe,Ae,he,Oe,null];N.lua_createtable(Ne);for(let Ce=0;Ie[Ce];Ce++)N.lua_pushvalue(Ne,-2),N.lua_pushcclosure(Ne,Ie[Ce],1),N.lua_rawseti(Ne,-2,Ce+1);N.lua_setfield(Ne,-2,N.to_luastring('searchers',!0))},be=function(Ne){N.lua_newtable(Ne),N.lua_createtable(Ne,0,1),N.lua_setmetatable(Ne,-2),N.lua_rawsetp(Ne,N.LUA_REGISTRYINDEX,P)};T.exports.luaopen_package=function(Ne){return be(Ne),I.luaL_newlib(Ne,ke),Re(Ne),ne(Ne,N.to_luastring('path',!0),'LUA_PATH',N.LUA_PATH_DEFAULT),ne(Ne,N.to_luastring('cpath',!0),'LUA_CPATH',N.LUA_CPATH_DEFAULT),N.lua_pushliteral(Ne,N.LUA_DIRSEP+'\n'+N.LUA_PATH_SEP+'\n'+N.LUA_PATH_MARK+'\n'+N.LUA_EXEC_DIR+'\n'+M+'\n'),N.lua_setfield(Ne,-2,N.to_luastring('config',!0)),I.luaL_getsubtable(Ne,N.LUA_REGISTRYINDEX,N.to_luastring(I.LUA_LOADED_TABLE,!0)),N.lua_setfield(Ne,-2,N.to_luastring('loaded',!0)),I.luaL_getsubtable(Ne,N.LUA_REGISTRYINDEX,N.to_luastring(I.LUA_PRELOAD_TABLE,!0)),N.lua_setfield(Ne,-2,N.to_luastring('preload',!0)),N.lua_pushglobaltable(Ne),N.lua_pushvalue(Ne,-2),I.luaL_setfuncs(Ne,ve,1),N.lua_pop(Ne,1),1}}).call(O,U(18))},function(T,O,U){'use strict';(function(E){const N=U(2),I=U(6),M=U(4),P=U(42),K=N.to_luastring('aAbBcdHIjmMpSUwWxXyYZ%',!0),V=N.to_luastring('aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%||EcECExEXEyEYOdOeOHOIOmOMOSOuOUOVOwOWOy',!0),G=N.to_luastring('aAbBcdHIjmMpSUwWxXyYzZ%||#c#x#d#H#I#j#m#M#S#U#w#W#y#Y',!0),H=function(se,ne,oe){N.lua_pushinteger(se,oe),N.lua_setfield(se,-2,N.to_luastring(ne,!0))},Y=function(se,ne,oe){H(se,'sec',oe?ne.getUTCSeconds():ne.getSeconds()),H(se,'min',oe?ne.getUTCMinutes():ne.getMinutes()),H(se,'hour',oe?ne.getUTCHours():ne.getHours()),H(se,'day',oe?ne.getUTCDate():ne.getDate()),H(se,'month',oe?ne.getUTCMonth():ne.getMonth()),H(se,'year',oe?ne.getUTCFullYear():ne.getFullYear()),H(se,'wday',oe?ne.getUTCDay():ne.getDay());let _e=new Date;H(se,'yday',_Mathfloor((_e-new Date(_e.getFullYear(),0,0))/86400000))},J=M.MAX_INT/2,q=function(se,ne,oe,_e){let pe=N.lua_getfield(se,-1,N.to_luastring(ne,!0)),ce=N.lua_tointegerx(se,-1);if(!1===ce){if(pe!==N.LUA_TNIL)return I.luaL_error(se,N.to_luastring(`field '${ne}' is not an integer`),!0);if(0>oe)return I.luaL_error(se,N.to_luastring(`field '${ne}' missing in date table`),!0);ce=oe}else{if(!(-J<=ce&&ce<=J))return I.luaL_error(se,N.to_luastring(`field '${ne}' is out-of-bound`),!0);ce-=_e}return N.lua_pop(se,1),ce},W=function(se,ne,oe){for(let _e=K,pe=1;0<_e.length&&pe<=ne.length;_e=_e.slice(pe))if(_e[0]==='|'.charCodeAt(0))pe++;else if(N.to_jsstring(ne.slice(0,pe))===N.to_jsstring(_e.slice(0,pe)))return oe.push(...ne.slice(0,pe)),ne.slice(pe);I.luaL_argerror(se,1,N.lua_pushliteral(se,`invalid conversion specifier '%${ne}'`,ne))},ee=function(se,ne){let oe=I.luaL_checkinteger(se,ne);return oe},ae={date:function(se){let ne=I.luaL_optlstring(se,1,'%c'),oe=1e3*I.luaL_opt(se,ee,2,new Date().getTime()/1e3),_e=new Date(oe),pe=!1;if(ne[0]==='!'.charCodeAt(0)&&(pe=!0,ne=ne.slice(1)),null===_e&&I.luaL_error(se,N.to_luastring('time result cannot be represented in this installation',!0)),'*t'===N.to_jsstring(ne))N.lua_createtable(se,0,9),Y(se,_e,pe);else{let de=[],ce;for(;0<ne.length;)ce=['%'.charCodeAt(0)],ne[0]==='%'.charCodeAt(0)?(ne=ne.slice(1),ne=W(se,ne,ce),de.push(...N.to_luastring(P(N.to_jsstring(ce),_e)))):(de.push(ne[0]),ne=ne.slice(1));N.lua_pushstring(se,de)}return 1},difftime:function(se){let ne=ee(se,1),oe=ee(se,2);return N.lua_pushnumber(se,new Date(ne)-new Date(oe)),1},time:function(se){let ne=new Date;return N.lua_isnoneornil(se,1)||(I.luaL_checktype(se,1,N.LUA_TTABLE),N.lua_settop(se,1),ne.setSeconds(q(se,'sec',0,0)),ne.setMinutes(q(se,'min',0,0)),ne.setHours(q(se,'hour',12,0)),ne.setDate(q(se,'day',-1,0)),ne.setMonth(q(se,'month',-1,1)),ne.setFullYear(q(se,'year',-1,0)),Y(se,ne)),N.lua_pushinteger(se,_Mathfloor(ne/1e3)),1}};E&&E.exit&&E.env&&E.uptime&&(ae.clock=function(_e){return N.lua_pushnumber(_e,E.uptime()),1},ae.exit=function(_e){let pe;return pe=N.lua_isboolean(_e,1)?N.lua_toboolean(_e,1)?0:1:I.luaL_optinteger(_e,1,0),N.lua_toboolean(_e,2)&&N.lua_close(_e),_e&&E.exit(pe),0},ae.getenv=function(_e){return N.lua_pushliteral(_e,E.env[N.to_jsstring(I.luaL_checkstring(_e,1))]),1}),T.exports.luaopen_os=function(se){return I.luaL_newlib(se,ae),1}}).call(O,U(18))},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(49),M=U(11),P=U(19),K=U(4),V=U(5),G=U(20),F=U(7),H=U(10),Y=I.BinOpr,J=G.OpCodesI,q=M.Proto,W=P.RESERVED,Z=V.TValue,Q=I.UnOpr,$=N.char,te=function(sa){return sa===se.VCALL||sa===se.VVARARG},ae=function(sa,na){return F.luaS_eqlngstr(sa,na)};class ue{constructor(){this.previous=null,this.firstlabel=NaN,this.firstgoto=NaN,this.nactvar=NaN,this.upval=NaN,this.isloop=NaN}}const se={VVOID:0,VNIL:1,VTRUE:2,VFALSE:3,VK:4,VKFLT:5,VKINT:6,VNONRELOC:7,VLOCAL:8,VUPVAL:9,VINDEXED:10,VJMP:11,VRELOCABLE:12,VCALL:13,VVARARG:14},ne=function(sa){return se.VLOCAL<=sa&&sa<=se.VINDEXED};class _e{constructor(){this.k=NaN,this.u={ival:NaN,nval:NaN,info:NaN,ind:{idx:NaN,t:NaN,vt:NaN}},this.t=NaN,this.f=NaN}to(sa){this.k=sa.k,this.u=sa.u,this.t=sa.t,this.f=sa.f}}class pe{constructor(){this.f=null,this.prev=null,this.ls=null,this.bl=null,this.pc=NaN,this.lasttarget=NaN,this.jpc=NaN,this.nk=NaN,this.np=NaN,this.firstlocal=NaN,this.nlocvars=NaN,this.nactvar=NaN,this.nups=NaN,this.freereg=NaN}}class ce{constructor(){this.idx=NaN}}class de{constructor(){this.name=null,this.pc=NaN,this.line=NaN,this.nactvar=NaN}}class Le{constructor(){this.arr=[],this.n=NaN,this.size=NaN}}const Ae=function(sa,na){sa.t.token=0,P.luaX_syntaxerror(sa,na)},Te=function(sa,na){P.luaX_syntaxerror(sa,V.luaO_pushfstring(sa.L,N.to_luastring('%s expected',!0),P.luaX_token2str(sa,na)))},he=function(sa,na,oa){let _a=sa.ls.L,ia=sa.f.linedefined,pa=0===ia?'main function':`function at line ${ia}`,ca=`too many ${oa} (limit is ${na}) in ${pa}`;P.luaX_syntaxerror(sa.ls,N.to_luastring(ca))},Oe=function(sa,na,oa,_a){na>oa&&he(sa,oa,_a)},xe=function(sa,na){return sa.t.token===na&&(P.luaX_next(sa),!0)},Ue=function(sa,na){sa.t.token!==na&&Te(sa,na)},Ee=function(sa,na){Ue(sa,na),P.luaX_next(sa)},ke=function(sa,na,oa){na||P.luaX_syntaxerror(sa,oa)},ve=function(sa,na,oa,_a){xe(sa,na)||(_a===sa.linenumber?Te(sa,na):P.luaX_syntaxerror(sa,V.luaO_pushfstring(sa.L,N.to_luastring('%s expected (to close %s at line %d)'),P.luaX_token2str(sa,na),P.luaX_token2str(sa,oa),_a)))},Re=function(sa){Ue(sa,W.TK_NAME);let na=sa.t.seminfo.ts;return P.luaX_next(sa),na},be=function(sa,na,oa){sa.f=sa.t=I.NO_JUMP,sa.k=na,sa.u.info=oa},Se=function(sa,na,oa){be(na,se.VK,I.luaK_stringK(sa.fs,oa))},Ne=function(sa,na){Se(sa,na,Re(sa))},Ie=function(sa,na){let oa=sa.fs,_a=oa.f;return _a.locvars[oa.nlocvars]=new V.LocVar,_a.locvars[oa.nlocvars].varname=na,oa.nlocvars++},Ce=function(sa,na){let oa=sa.fs,_a=sa.dyd,ia=Ie(sa,na);Oe(oa,_a.actvar.n+1-oa.firstlocal,200,N.to_luastring('local variables',!0)),_a.actvar.arr[_a.actvar.n]=new ce,_a.actvar.arr[_a.actvar.n].idx=ia,_a.actvar.n++},Me=function(sa,na){Ce(sa,P.luaX_newstring(sa,N.to_luastring(na,!0)))},Pe=function(sa,na){let oa=sa.ls.dyd.actvar.arr[sa.firstlocal+na].idx;return E(oa<sa.nlocvars),sa.f.locvars[oa]},ye=function(sa,na){let oa=sa.fs;for(oa.nactvar+=na;na;na--)Pe(oa,oa.nactvar-na).startpc=oa.pc},De=function(sa,na){for(sa.ls.dyd.actvar.n-=sa.nactvar-na;sa.nactvar>na;)Pe(sa,--sa.nactvar).endpc=sa.pc},Ke=function(sa,na){let oa=sa.f.upvalues;for(let _a=0;_a<sa.nups;_a++)if(ae(oa[_a].name,na))return _a;return-1},Be=function(sa,na,oa){let _a=sa.f;return Oe(sa,sa.nups+1,M.MAXUPVAL,N.to_luastring('upvalues',!0)),_a.upvalues[sa.nups]={instack:oa.k===se.VLOCAL,idx:oa.u.info,name:na},sa.nups++},Ve=function(sa,na){for(let oa=sa.nactvar-1;0<=oa;oa--)if(ae(na,Pe(sa,oa).varname))return oa;return-1},Ge=function(sa,na){let oa=sa.bl;for(;oa.nactvar>na;)oa=oa.previous;oa.upval=1},we=function(sa,na,oa,_a){if(null===sa)be(oa,se.VVOID,0);else{let ia=Ve(sa,na);if(0<=ia)be(oa,se.VLOCAL,ia),_a||Ge(sa,ia);else{let pa=Ke(sa,na);if(0>pa){if(we(sa.prev,na,oa,0),oa.k===se.VVOID)return;pa=Be(sa,na,oa)}be(oa,se.VUPVAL,pa)}}},Fe=function(sa,na){let oa=Re(sa),_a=sa.fs;if(we(_a,oa,na,1),na.k===se.VVOID){let ia=new _e;we(_a,sa.envn,na,1),E(na.k!==se.VVOID),Se(sa,ia,oa),I.luaK_indexed(_a,na,ia)}},Xe=function(sa,na,oa,_a){let ia=sa.fs,pa=na-oa;if(te(_a.k))pa++,0>pa&&(pa=0),I.luaK_setreturns(ia,_a,pa),1<pa&&I.luaK_reserveregs(ia,pa-1);else if(_a.k!==se.VVOID&&I.luaK_exp2nextreg(ia,_a),0<pa){let ca=ia.freereg;I.luaK_reserveregs(ia,pa),I.luaK_nil(ia,ca,pa)}oa>na&&(sa.fs.freereg-=oa-na)},He=function(sa){let na=sa.L;++na.nCcalls,Oe(sa.fs,na.nCcalls,K.LUAI_MAXCCALLS,N.to_luastring('JS levels',!0))},je=function(sa){return sa.L.nCcalls--},ze=function(sa,na,oa){let _a=sa.fs,ia=sa.dyd.gt,pa=ia.arr[na];if(E(ae(pa.name,oa.name)),pa.nactvar<oa.nactvar){let ca=Pe(_a,pa.nactvar).varname,da=V.luaO_pushfstring(sa.L,N.to_luastring('<goto %s> at line %d jumps into the scope of local \'%s\''),pa.name,pa.line,ca);Ae(sa,da)}I.luaK_patchlist(_a,pa.pc,oa.pc);for(let ca=na;ca<ia.n-1;ca++)ia.arr[ca]=ia.arr[ca+1];ia.n--},Ye=function(sa,na){let oa=sa.fs.bl,_a=sa.dyd,ia=_a.gt.arr[na];for(let pa=oa.firstlabel,ca;pa<_a.label.n;pa++)if(ca=_a.label.arr[pa],ae(ca.name,ia.name))return ia.nactvar>ca.nactvar&&(oa.upval||_a.label.n>oa.firstlabel)&&I.luaK_patchclose(sa.fs,ia.pc,ca.nactvar),ze(sa,na,ca),!0;return!1},Je=function(sa,na,oa,_a,ia){let pa=na.n;return na.arr[pa]=new de,na.arr[pa].name=oa,na.arr[pa].line=_a,na.arr[pa].nactvar=sa.fs.nactvar,na.arr[pa].pc=ia,na.n=pa+1,pa},qe=function(sa,na){for(let oa=sa.dyd.gt,_a=sa.fs.bl.firstgoto;_a<oa.n;)ae(oa.arr[_a].name,na.name)?ze(sa,_a,na):_a++},We=function(sa,na){for(let oa=na.firstgoto,_a=sa.ls.dyd.gt,ia;oa<_a.n;)ia=_a.arr[oa],ia.nactvar>na.nactvar&&(na.upval&&I.luaK_patchclose(sa,ia.pc,na.nactvar),ia.nactvar=na.nactvar),Ye(sa.ls,oa)||oa++},Ze=function(sa,na,oa){na.isloop=oa,na.nactvar=sa.nactvar,na.firstlabel=sa.ls.dyd.label.n,na.firstgoto=sa.ls.dyd.gt.n,na.upval=0,na.previous=sa.bl,sa.bl=na,E(sa.freereg===sa.nactvar)},Qe=function(sa){let na=F.luaS_newliteral(sa.L,'break'),oa=Je(sa,sa.dyd.label,na,0,sa.fs.pc);qe(sa,sa.dyd.label.arr[oa])},$e=function(sa,na){let oa=P.isreserved(na.name)?'<%s> at line %d not inside a loop':'no visible label \'%s\' for <goto> at line %d';oa=V.luaO_pushfstring(sa.L,N.to_luastring(oa),na.name,na.line),Ae(sa,oa)},et=function(sa){let na=sa.L,oa=new q(na),_a=sa.fs,ia=_a.f;return ia.p[_a.np++]=oa,oa},at=function(sa,na){let oa=sa.fs.prev;be(na,se.VRELOCABLE,I.luaK_codeABx(oa,J.OP_CLOSURE,0,oa.np-1)),I.luaK_exp2nextreg(oa,na)},lt=function(sa,na,oa){na.prev=sa.fs,na.ls=sa,sa.fs=na,na.pc=0,na.lasttarget=0,na.jpc=I.NO_JUMP,na.freereg=0,na.nk=0,na.np=0,na.nups=0,na.nlocvars=0,na.nactvar=0,na.firstlocal=sa.dyd.actvar.n,na.bl=null;let _a=new q(sa.L);_a=na.f,_a.source=sa.source,_a.maxstacksize=2,Ze(na,oa,!1)},ut=function(sa){let na=sa.bl,oa=sa.ls;if(na.previous&&na.upval){let _a=I.luaK_jump(sa);I.luaK_patchclose(sa,_a,na.nactvar),I.luaK_patchtohere(sa,_a)}na.isloop&&Qe(oa),sa.bl=na.previous,De(sa,na.nactvar),E(na.nactvar===sa.nactvar),sa.freereg=sa.nactvar,oa.dyd.label.n=na.firstlabel,na.previous?We(sa,na):na.firstgoto<oa.dyd.gt.n&&$e(oa,oa.dyd.gt.arr[na.firstgoto])},rt=function(sa){let na=sa.L,oa=sa.fs,_a=oa.f;I.luaK_ret(oa,0,0),ut(oa),sa.fs=oa.prev},st=function(sa,na){switch(sa.t.token){case W.TK_ELSE:case W.TK_ELSEIF:case W.TK_END:case W.TK_EOS:return!0;case W.TK_UNTIL:return na;default:return!1;}},nt=function(sa){for(;!st(sa,1);){if(sa.t.token===W.TK_RETURN)return void aa(sa);aa(sa)}},ot=function(sa,na){let oa=sa.fs,_a=new _e;I.luaK_exp2anyregup(oa,na),P.luaX_next(sa),Ne(sa,_a),I.luaK_indexed(oa,na,_a)},_t=function(sa,na){P.luaX_next(sa),It(sa,na),I.luaK_exp2val(sa.fs,na),Ee(sa,$[']'])};class it{constructor(){this.v=new _e,this.t=new _e,this.nh=NaN,this.na=NaN,this.tostore=NaN}}const pt=function(sa,na){let oa=sa.fs,_a=sa.fs.freereg,ia=new _e,pa=new _e;sa.t.token===W.TK_NAME?(Oe(oa,na.nh,K.MAX_INT,N.to_luastring('items in a constructor',!0)),Ne(sa,ia)):_t(sa,ia),na.nh++,Ee(sa,$['=']);let ca=I.luaK_exp2RK(oa,ia);It(sa,pa),I.luaK_codeABC(oa,J.OP_SETTABLE,na.t.u.info,ca,I.luaK_exp2RK(oa,pa)),oa.freereg=_a},ct=function(sa,na){na.v.k===se.VVOID||(I.luaK_exp2nextreg(sa,na.v),na.v.k=se.VVOID,na.tostore===G.LFIELDS_PER_FLUSH&&(I.luaK_setlist(sa,na.t.u.info,na.na,na.tostore),na.tostore=0))},dt=function(sa,na){0===na.tostore||(te(na.v.k)?(I.luaK_setmultret(sa,na.v),I.luaK_setlist(sa,na.t.u.info,na.na,N.LUA_MULTRET),na.na--):(na.v.k!==se.VVOID&&I.luaK_exp2nextreg(sa,na.v),I.luaK_setlist(sa,na.t.u.info,na.na,na.tostore)))},Lt=function(sa,na){It(sa,na.v),Oe(sa.fs,na.na,K.MAX_INT,N.to_luastring('items in a constructor',!0)),na.na++,na.tostore++},ft=function(sa,na){switch(sa.t.token){case W.TK_NAME:{P.luaX_lookahead(sa)===$['=']?pt(sa,na):Lt(sa,na);break}case $['[']:{pt(sa,na);break}default:{Lt(sa,na);break}}},At=function(sa,na){let oa=sa.fs,_a=sa.linenumber,ia=I.luaK_codeABC(oa,J.OP_NEWTABLE,0,0,0),pa=new it;pa.na=pa.nh=pa.tostore=0,pa.t=na,be(na,se.VRELOCABLE,ia),be(pa.v,se.VVOID,0),I.luaK_exp2nextreg(sa.fs,na),Ee(sa,$['{']);do{if(E(pa.v.k===se.VVOID||0<pa.tostore),sa.t.token===$['}'])break;ct(oa,pa),ft(sa,pa)}while(xe(sa,$[','])||xe(sa,$[';']));ve(sa,$['}'],$['{'],_a),dt(oa,pa),G.SETARG_B(oa.f.code[ia],V.luaO_int2fb(pa.na)),G.SETARG_C(oa.f.code[ia],V.luaO_int2fb(pa.nh))},Tt=function(sa){let na=sa.fs,oa=na.f,_a=0;if(oa.is_vararg=0,sa.t.token!==$[')'])do switch(sa.t.token){case W.TK_NAME:{Ce(sa,Re(sa)),_a++;break}case W.TK_DOTS:{P.luaX_next(sa),oa.is_vararg=1;break}default:P.luaX_syntaxerror(sa,N.to_luastring('<name> or \'...\' expected',!0));}while(!oa.is_vararg&&xe(sa,$[',']));ye(sa,_a),oa.numparams=na.nactvar,I.luaK_reserveregs(na,na.nactvar)},ht=function(sa,na,oa,_a){let ia=new pe,pa=new ue;ia.f=et(sa),ia.f.linedefined=_a,lt(sa,ia,pa),Ee(sa,$['(']),oa&&(Me(sa,'self'),ye(sa,1)),Tt(sa),Ee(sa,$[')']),nt(sa),ia.f.lastlinedefined=sa.linenumber,ve(sa,W.TK_END,W.TK_FUNCTION,_a),at(sa,na),rt(sa)},Ot=function(sa,na){let oa=1;for(It(sa,na);xe(sa,$[',']);)I.luaK_exp2nextreg(sa.fs,na),It(sa,na),oa++;return oa},xt=function(sa,na,oa){let _a=sa.fs,ia=new _e;switch(sa.t.token){case $['(']:{P.luaX_next(sa),sa.t.token===$[')']?ia.k=se.VVOID:(Ot(sa,ia),I.luaK_setmultret(_a,ia)),ve(sa,$[')'],$['('],oa);break}case $['{']:{At(sa,ia);break}case W.TK_STRING:{Se(sa,ia,sa.t.seminfo.ts),P.luaX_next(sa);break}default:P.luaX_syntaxerror(sa,N.to_luastring('function arguments expected',!0));}E(na.k===se.VNONRELOC);let ca=na.u.info,pa;te(ia.k)?pa=N.LUA_MULTRET:(ia.k!==se.VVOID&&I.luaK_exp2nextreg(_a,ia),pa=_a.freereg-(ca+1)),be(na,se.VCALL,I.luaK_codeABC(_a,J.OP_CALL,ca,pa+1,2)),I.luaK_fixline(_a,oa),_a.freereg=ca+1},Ut=function(sa,na){switch(sa.t.token){case $['(']:{let oa=sa.linenumber;return P.luaX_next(sa),It(sa,na),ve(sa,$[')'],$['('],oa),void I.luaK_dischargevars(sa.fs,na)}case W.TK_NAME:return void Fe(sa,na);default:P.luaX_syntaxerror(sa,N.to_luastring('unexpected symbol',!0));}},Et=function(sa,na){let oa=sa.fs,_a=sa.linenumber;for(Ut(sa,na);;)switch(sa.t.token){case $['.']:{ot(sa,na);break}case $['[']:{let ia=new _e;I.luaK_exp2anyregup(oa,na),_t(sa,ia),I.luaK_indexed(oa,na,ia);break}case $[':']:{let ia=new _e;P.luaX_next(sa),Ne(sa,ia),I.luaK_self(oa,na,ia),xt(sa,na,_a);break}case $['(']:case W.TK_STRING:case $['{']:{I.luaK_exp2nextreg(oa,na),xt(sa,na,_a);break}default:return;}},kt=function(sa,na){switch(sa.t.token){case W.TK_FLT:{be(na,se.VKFLT,0),na.u.nval=sa.t.seminfo.r;break}case W.TK_INT:{be(na,se.VKINT,0),na.u.ival=sa.t.seminfo.i;break}case W.TK_STRING:{Se(sa,na,sa.t.seminfo.ts);break}case W.TK_NIL:{be(na,se.VNIL,0);break}case W.TK_TRUE:{be(na,se.VTRUE,0);break}case W.TK_FALSE:{be(na,se.VFALSE,0);break}case W.TK_DOTS:{let oa=sa.fs;ke(sa,oa.f.is_vararg,N.to_luastring('cannot use \'...\' outside a vararg function',!0)),be(na,se.VVARARG,I.luaK_codeABC(oa,J.OP_VARARG,0,1,0));break}case $['{']:return void At(sa,na);case W.TK_FUNCTION:return P.luaX_next(sa),void ht(sa,na,0,sa.linenumber);default:return void Et(sa,na);}P.luaX_next(sa)},vt=function(sa){return sa===W.TK_NOT?Q.OPR_NOT:sa===$['-']?Q.OPR_MINUS:sa===$['~']?Q.OPR_BNOT:sa===$['#']?Q.OPR_LEN:Q.OPR_NOUNOPR},Rt=function(sa){return sa===$['+']?Y.OPR_ADD:sa===$['-']?Y.OPR_SUB:sa===$['*']?Y.OPR_MUL:sa===$['%']?Y.OPR_MOD:sa===$['^']?Y.OPR_POW:sa===$['/']?Y.OPR_DIV:sa===W.TK_IDIV?Y.OPR_IDIV:sa===$['&']?Y.OPR_BAND:sa===$['|']?Y.OPR_BOR:sa===$['~']?Y.OPR_BXOR:sa===W.TK_SHL?Y.OPR_SHL:sa===W.TK_SHR?Y.OPR_SHR:sa===W.TK_CONCAT?Y.OPR_CONCAT:sa===W.TK_NE?Y.OPR_NE:sa===W.TK_EQ?Y.OPR_EQ:sa===$['<']?Y.OPR_LT:sa===W.TK_LE?Y.OPR_LE:sa===$['>']?Y.OPR_GT:sa===W.TK_GE?Y.OPR_GE:sa===W.TK_AND?Y.OPR_AND:sa===W.TK_OR?Y.OPR_OR:Y.OPR_NOBINOPR},bt=[{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}],Nt=function(sa,na,oa){He(sa);let _a=vt(sa.t.token);if(_a!==Q.OPR_NOUNOPR){let pa=sa.linenumber;P.luaX_next(sa),Nt(sa,na,12),I.luaK_prefix(sa.fs,_a,na,pa)}else kt(sa,na);let ia=Rt(sa.t.token);for(;ia!==Y.OPR_NOBINOPR&&bt[ia].left>oa;){let pa=new _e,ca=sa.linenumber;P.luaX_next(sa),I.luaK_infix(sa.fs,ia,na);let da=Nt(sa,pa,bt[ia].right);I.luaK_posfix(sa.fs,ia,na,pa,ca),ia=da}return je(sa),ia},It=function(sa,na){Nt(sa,na,0)},Ct=function(sa){let na=sa.fs,oa=new ue;Ze(na,oa,0),nt(sa),ut(na)};class Mt{constructor(){this.prev=null,this.v=new _e}}const Pt=function(sa,na,oa){let _a=sa.fs,ia=_a.freereg,pa=!1;for(;na;na=na.prev)na.v.k===se.VINDEXED&&(na.v.u.ind.vt===oa.k&&na.v.u.ind.t===oa.u.info&&(pa=!0,na.v.u.ind.vt=se.VLOCAL,na.v.u.ind.t=ia),oa.k===se.VLOCAL&&na.v.u.ind.idx===oa.u.info&&(pa=!0,na.v.u.ind.idx=ia));if(pa){let ca=oa.k===se.VLOCAL?J.OP_MOVE:J.OP_GETUPVAL;I.luaK_codeABC(_a,ca,ia,oa.u.info,0),I.luaK_reserveregs(_a,1)}},yt=function(sa,na,oa){let _a=new _e;if(ke(sa,ne(na.v.k),N.to_luastring('syntax error',!0)),xe(sa,$[','])){let ia=new Mt;ia.prev=na,Et(sa,ia.v),ia.v.k!==se.VINDEXED&&Pt(sa,na,ia.v),Oe(sa.fs,oa+sa.L.nCcalls,K.LUAI_MAXCCALLS,N.to_luastring('JS levels',!0)),yt(sa,ia,oa+1)}else{Ee(sa,$['=']);let ia=Ot(sa,_a);if(ia!==oa)Xe(sa,oa,ia,_a);else return I.luaK_setoneret(sa.fs,_a),void I.luaK_storevar(sa.fs,na.v,_a)}be(_a,se.VNONRELOC,sa.fs.freereg-1),I.luaK_storevar(sa.fs,na.v,_a)},Dt=function(sa){let na=new _e;return It(sa,na),na.k===se.VNIL&&(na.k=se.VFALSE),I.luaK_goiftrue(sa.fs,na),na.f},Kt=function(sa,na){let oa=sa.linenumber,_a;xe(sa,W.TK_GOTO)?_a=Re(sa):(P.luaX_next(sa),_a=F.luaS_newliteral(sa.L,'break'));let ia=Je(sa,sa.dyd.gt,_a,oa,na);Ye(sa,ia)},Bt=function(sa,na,oa){for(let _a=sa.bl.firstlabel;_a<na.n;_a++)ae(oa,na.arr[_a].name)&&Ae(sa.ls,N.to_luastring(`label '${oa.jsstring()}' already defined on line ${na.arr[_a].line}`))},Vt=function(sa){for(;sa.t.token===$[';']||sa.t.token===W.TK_DBCOLON;)aa(sa)},Gt=function(sa,na,oa){let _a=sa.fs,ia=sa.dyd.label,pa;Bt(_a,ia,na),Ee(sa,W.TK_DBCOLON),pa=Je(sa,ia,na,oa,I.luaK_getlabel(_a)),Vt(sa),st(sa,0)&&(ia.arr[pa].nactvar=_a.bl.nactvar),qe(sa,ia.arr[pa])},wt=function(sa,na){let oa=sa.fs,_a=new ue;P.luaX_next(sa);let ia=I.luaK_getlabel(oa),pa=Dt(sa);Ze(oa,_a,1),Ee(sa,W.TK_DO),Ct(sa),I.luaK_jumpto(oa,ia),ve(sa,W.TK_END,W.TK_WHILE,na),ut(oa),I.luaK_patchtohere(oa,pa)},Ft=function(sa,na){let oa=sa.fs,_a=I.luaK_getlabel(oa),ia=new ue,pa=new ue;Ze(oa,ia,1),Ze(oa,pa,0),P.luaX_next(sa),nt(sa),ve(sa,W.TK_UNTIL,W.TK_REPEAT,na);let ca=Dt(sa);pa.upval&&I.luaK_patchclose(oa,ca,pa.nactvar),ut(oa),I.luaK_patchlist(oa,ca,_a),ut(oa)},Xt=function(sa){let na=new _e;It(sa,na),I.luaK_exp2nextreg(sa.fs,na),E(na.k===se.VNONRELOC);let oa=na.u.info;return oa},Ht=function(sa,na,oa,_a,ia){let pa=new ue,ca=sa.fs,da;ye(sa,3),Ee(sa,W.TK_DO);let La=ia?I.luaK_codeAsBx(ca,J.OP_FORPREP,na,I.NO_JUMP):I.luaK_jump(ca);Ze(ca,pa,0),ye(sa,_a),I.luaK_reserveregs(ca,_a),Ct(sa),ut(ca),I.luaK_patchtohere(ca,La),ia?da=I.luaK_codeAsBx(ca,J.OP_FORLOOP,na,I.NO_JUMP):(I.luaK_codeABC(ca,J.OP_TFORCALL,na,0,_a),I.luaK_fixline(ca,oa),da=I.luaK_codeAsBx(ca,J.OP_TFORLOOP,na+2,I.NO_JUMP)),I.luaK_patchlist(ca,da,La+1),I.luaK_fixline(ca,oa)},jt=function(sa,na,oa){let _a=sa.fs,ia=_a.freereg;Me(sa,'(for index)'),Me(sa,'(for limit)'),Me(sa,'(for step)'),Ce(sa,na),Ee(sa,$['=']),Xt(sa),Ee(sa,$[',']),Xt(sa),xe(sa,$[','])?Xt(sa):(I.luaK_codek(_a,_a.freereg,I.luaK_intK(_a,1)),I.luaK_reserveregs(_a,1)),Ht(sa,ia,oa,1,1)},zt=function(sa,na){let oa=sa.fs,_a=new _e,ia=4,pa=oa.freereg;for(Me(sa,'(for generator)'),Me(sa,'(for state)'),Me(sa,'(for control)'),Ce(sa,na);xe(sa,$[',']);)Ce(sa,Re(sa)),ia++;Ee(sa,W.TK_IN);let ca=sa.linenumber;Xe(sa,3,Ot(sa,_a),_a),I.luaK_checkstack(oa,3),Ht(sa,pa,ca,ia-3,0)},Yt=function(sa,na){let oa=sa.fs,_a=new ue;Ze(oa,_a,1),P.luaX_next(sa);let ia=Re(sa);switch(sa.t.token){case $['=']:jt(sa,ia,na);break;case $[',']:case W.TK_IN:zt(sa,ia);break;default:P.luaX_syntaxerror(sa,N.to_luastring('\'=\' or \'in\' expected',!0));}ve(sa,W.TK_END,W.TK_FOR,na),ut(oa)},Jt=function(sa,na){let oa=new ue,_a=sa.fs,ia=new _e,pa;if(P.luaX_next(sa),It(sa,ia),Ee(sa,W.TK_THEN),sa.t.token===W.TK_GOTO||sa.t.token===W.TK_BREAK){if(I.luaK_goiffalse(sa.fs,ia),Ze(_a,oa,!1),Kt(sa,ia.t),Vt(sa),st(sa,0))return void ut(_a);pa=I.luaK_jump(_a)}else I.luaK_goiftrue(sa.fs,ia),Ze(_a,oa,!1),pa=ia.f;return nt(sa),ut(_a),(sa.t.token===W.TK_ELSE||sa.t.token===W.TK_ELSEIF)&&(na=I.luaK_concat(_a,na,I.luaK_jump(_a))),I.luaK_patchtohere(_a,pa),na},qt=function(sa,na){let oa=sa.fs,_a=I.NO_JUMP;for(_a=Jt(sa,_a);sa.t.token===W.TK_ELSEIF;)_a=Jt(sa,_a);xe(sa,W.TK_ELSE)&&Ct(sa),ve(sa,W.TK_END,W.TK_IF,na),I.luaK_patchtohere(oa,_a)},Wt=function(sa){let na=new _e,oa=sa.fs;Ce(sa,Re(sa)),ye(sa,1),ht(sa,na,0,sa.linenumber),Pe(oa,na.u.info).startpc=oa.pc},Zt=function(sa){let na=0,_a=new _e,oa;do Ce(sa,Re(sa)),na++;while(xe(sa,$[',']));xe(sa,$['='])?oa=Ot(sa,_a):(_a.k=se.VVOID,oa=0),Xe(sa,na,oa,_a),ye(sa,na)},Qt=function(sa,na){let oa=0;for(Fe(sa,na);sa.t.token===$['.'];)ot(sa,na);return sa.t.token===$[':']&&(oa=1,ot(sa,na)),oa},$t=function(sa,na){let oa=new _e,_a=new _e;P.luaX_next(sa);let ia=Qt(sa,oa);ht(sa,_a,ia,na),I.luaK_storevar(sa.fs,oa,_a),I.luaK_fixline(sa.fs,na)},ea=function(sa){let na=sa.fs,oa=new Mt;Et(sa,oa.v),sa.t.token===$['=']||sa.t.token===$[',']?(oa.prev=null,yt(sa,oa,1)):(ke(sa,oa.v.k===se.VCALL,N.to_luastring('syntax error',!0)),G.SETARG_C(I.getinstruction(na,oa.v),1))},ta=function(sa){let na=sa.fs,oa=new _e,_a,ia;st(sa,1)||sa.t.token===$[';']?_a=ia=0:(ia=Ot(sa,oa),te(oa.k)?(I.luaK_setmultret(na,oa),oa.k===se.VCALL&&1===ia&&(G.SET_OPCODE(I.getinstruction(na,oa),J.OP_TAILCALL),E(I.getinstruction(na,oa).A===na.nactvar)),_a=na.nactvar,ia=N.LUA_MULTRET):1===ia?_a=I.luaK_exp2anyreg(na,oa):(I.luaK_exp2nextreg(na,oa),_a=na.nactvar,E(ia==na.freereg-_a))),I.luaK_ret(na,_a,ia),xe(sa,$[';'])},aa=function(sa){let na=sa.linenumber;switch(He(sa),sa.t.token){case $[';']:{P.luaX_next(sa);break}case W.TK_IF:{qt(sa,na);break}case W.TK_WHILE:{wt(sa,na);break}case W.TK_DO:{P.luaX_next(sa),Ct(sa),ve(sa,W.TK_END,W.TK_DO,na);break}case W.TK_FOR:{Yt(sa,na);break}case W.TK_REPEAT:{Ft(sa,na);break}case W.TK_FUNCTION:{$t(sa,na);break}case W.TK_LOCAL:{P.luaX_next(sa),xe(sa,W.TK_FUNCTION)?Wt(sa):Zt(sa);break}case W.TK_DBCOLON:{P.luaX_next(sa),Gt(sa,Re(sa),na);break}case W.TK_RETURN:{P.luaX_next(sa),ta(sa);break}case W.TK_BREAK:case W.TK_GOTO:{Kt(sa,I.luaK_jump(sa.fs));break}default:{ea(sa);break}}E(sa.fs.f.maxstacksize>=sa.fs.freereg&&sa.fs.freereg>=sa.fs.nactvar),sa.fs.freereg=sa.fs.nactvar,je(sa)},la=function(sa,na){let oa=new ue,_a=new _e;lt(sa,na,oa),na.f.is_vararg=!0,be(_a,se.VLOCAL,0),Be(na,sa.envn,_a),P.luaX_next(sa),nt(sa),Ue(sa,W.TK_EOS),rt(sa)};T.exports.Dyndata=class{constructor(){this.actvar={arr:[],n:NaN,size:NaN},this.gt=new Le,this.label=new Le}},T.exports.expkind=se,T.exports.expdesc=_e,T.exports.luaY_parser=function(sa,na,oa,_a,ia,pa){let ca=new P.LexState,da=new pe,La=M.luaF_newLclosure(sa,1);return sa.stack[sa.top++]=new Z(N.CT.LUA_TLCL,La),ca.h=H.luaH_new(sa),sa.stack[sa.top++]=ca.h,da.f=La.p=new q(sa),da.f.source=F.luaS_new(sa,ia),ca.buff=oa,ca.dyd=_a,_a.actvar.n=_a.gt.n=_a.label.n=0,P.luaX_setinput(sa,ca,na,da.f.source,pa),la(ca,da),E(!da.prev&&1===da.nups&&!ca.fs),E(0===_a.actvar.n&&0===_a.gt.n&&0===_a.label.n),sa.top--,La},T.exports.vkisinreg=function(sa){return sa===se.VNONRELOC||sa===se.VLOCAL}},function(T,O,U){'use strict';const E=U(0),N=U(41).sprintf,I=U(6),M=U(2),P=U(12),K=U(4),V='%',G=V.charCodeAt(0),H=2147483647,Y=function(Gt){let wt=Gt.indexOf(0);return-1<wt?wt:Gt.length},J=function(Gt,wt){return 0<=Gt?Gt:0-Gt>wt?0:wt+Gt+1},Q=function(Gt,wt,Ft,Xt){return E(Array.isArray(wt)),Xt.push(...wt.slice(0,Ft)),0},ee=P.LUA_NUMBER_FRMLEN.length+1,te=1,ae=function(Gt,wt,Ft){let Xt=_Mathfloor(Ft);return Gt[wt]=10>Xt?Xt+'0'.charCodeAt(0):Xt-10+'a'.charCodeAt(0),Ft-Xt},ue=function(Gt){let wt=[];if(Object.is(Gt,Infinity))return M.to_luastring('inf',!0);if(Object.is(Gt,-Infinity))return M.to_luastring('-inf',!0);if(_NumberisNaN(Gt))return M.to_luastring('nan',!0);if(0===Gt){let Ft=N(P.LUA_NUMBER_FMT+'x0p+0',Gt).split('').map((Xt)=>Xt.charCodeAt(0));return Object.is(Gt,-0)?['-'.charCodeAt(0)].concat(Ft):Ft}let Ft=P.frexp(Gt),Xt=Ft[0],Ht=Ft[1],jt=0;if(0>Xt&&(wt[jt++]='-'.charCodeAt(0),Xt=-Xt),wt[jt++]='0'.charCodeAt(0),wt[jt++]='x'.charCodeAt(0),Xt=ae(wt,jt++,Xt*(1<<te)),Ht-=te,0<Xt){wt[jt++]=P.lua_getlocaledecpoint().charCodeAt(0);do Xt=ae(wt,jt++,16*Xt);while(0<Xt)}let zt=N('p%+d',Ht).split('').map((Yt)=>Yt.charCodeAt(0));return wt.slice(0,jt+1).concat(zt).concat(wt.slice(jt))},se=function(Gt,wt,Ft){let Xt=ue(Ft);if(wt[ee]==='A'.charCodeAt(0))for(let Ht=0;Ht<Xt.length;Ht++)Xt[Ht]=_StringfromCharCode(Xt[Ht]).toUpperCase().charCodeAt(0);else wt[ee]!=='a'.charCodeAt(0)&&I.luaL_error(Gt,M.to_luastring('modifiers for format \'%%a\'/\'%%A\' not implemented'));return Xt},oe=['-'.charCodeAt(0),'+'.charCodeAt(0),' '.charCodeAt(0),'#'.charCodeAt(0),'0'.charCodeAt(0)],pe=(Gt)=>'a'.charCodeAt(0)<=Gt&&Gt<='z'.charCodeAt(0)||Gt>='A'.charCodeAt(0)&&Gt<='Z'.charCodeAt(0),ce=(Gt)=>'0'.charCodeAt(0)<=Gt&&Gt<='9'.charCodeAt(0),de=(Gt)=>0<=Gt&&31>=Gt||127===Gt,Le=(Gt)=>32<Gt&&127>Gt,ge=(Gt)=>/^(?![A-Z]).*$/.test(_StringfromCharCode(Gt)),Ae=(Gt)=>/^(?![a-z]).*$/.test(_StringfromCharCode(Gt)),Te=(Gt)=>/^[a-zA-Z0-9]$/.test(_StringfromCharCode(Gt)),he=(Gt)=>Le(Gt)&&!Te(Gt),Oe=(Gt)=>/^\s$/.test(_StringfromCharCode(Gt)),xe=(Gt)=>/^[0-9A-Fa-f]$/.test(_StringfromCharCode(Gt)),Ue=function(Gt,wt){for(let Ft=0;Ft<wt.length;Ft++)Gt.push(wt[Ft])},Ee=function(Gt,wt){Gt.push('"'.charCodeAt(0));for(let Ft=wt.length;Ft--;){if(wt[0]==='"'.charCodeAt(0)||wt[0]==='\\'.charCodeAt(0)||wt[0]==='\n'.charCodeAt(0))Gt.push('\\'.charCodeAt(0)),Gt.push(wt[0]);else if(de(wt[0])){let Xt=[];Xt=ce(wt[1])?M.to_luastring(N('\\%03d',wt[0])):M.to_luastring(N('\\%d',wt[0])),Ue(Gt,Xt)}else Gt.push(wt[0]);wt=wt.slice(1)}Gt.push('"'.charCodeAt(0))},ke=function(Gt){if(0>Gt.indexOf('.'.charCodeAt(0))){let wt=P.lua_getlocaledecpoint().charCodeAt(0),Ft=Gt.indexOf(wt);Ft&&(Gt[Ft]='.')}},ve=function(Gt,wt,Ft){switch(M.lua_type(Gt,Ft)){case M.LUA_TSTRING:{let Xt=M.lua_tostring(Gt,Ft);Ee(wt,Xt,Xt.length);break}case M.LUA_TNUMBER:{if(!M.lua_isinteger(Gt,Ft)){let Xt=M.lua_tonumber(Gt,Ft);Ue(wt,se(Gt,M.to_luastring(`%${P.LUA_INTEGER_FRMLEN}a`),Xt)),ke(wt)}else{let Xt=M.lua_tointeger(Gt,Ft);Ue(wt,M.to_luastring(N('%d',Xt)))}break}case M.LUA_TNIL:case M.LUA_TBOOLEAN:{Ue(wt,I.luaL_tolstring(Gt,Ft));break}default:I.luaL_argerror(Gt,Ft,M.to_luastring('value has no literal form',!0));}},Re=function(Gt,wt,Ft){let Xt=wt;for(;0!==Xt[0]&&0<=oe.indexOf(Xt[0]);)Xt=Xt.slice(1);wt.length-Xt.length>=oe.length&&I.luaL_error(Gt,M.to_luastring('invalid format (repeated flags)',!0)),ce(Xt[0])&&(Xt=Xt.slice(1)),ce(Xt[0])&&(Xt=Xt.slice(1)),Xt[0]==='.'.charCodeAt(0)&&(Xt=Xt.slice(1),ce(Xt[0])&&(Xt=Xt.slice(1)),ce(Xt[0])&&(Xt=Xt.slice(1))),ce(Xt[0])&&I.luaL_error(Gt,M.to_luastring('invalid format (width or precision too long)',!0)),Ft[0]='%'.charCodeAt(0);for(let Ht=0;Ht<wt.length-Xt.length+1;Ht++)Ft[Ht+1]=wt[Ht];return{form:Ft,p:Xt}},be=function(Gt,wt){let Ft=Gt.length,Xt=wt.length,Ht=Gt[Ft-1];for(let jt=0;jt<wt.length;jt++)Gt[jt+Ft-1]=wt[jt];return Gt[Ft+Xt-1]=Ht,Gt},Ne=0,Ie=16,Ce=4,Me=8,Pe=(1<<Me)-1;class De{constructor(Gt){this.L=Gt,this.islittle=!0,this.maxalign=1}}const Ke={Kint:0,Kuint:1,Kfloat:2,Kchar:3,Kstring:4,Kzstr:5,Kpadding:6,Kpaddalign:7,Knop:8},Be=function(Gt){return'0'.charCodeAt(0)<=Gt&&Gt<='9'.charCodeAt(0)},Ve=function(Gt,wt){if(Gt.off>=Gt.s.length||!Be(Gt.s[Gt.off]))return wt;let Ft=0;do Ft=10*Ft+(Gt.s[Gt.off++]-'0'.charCodeAt(0));while(Gt.off<Gt.s.length&&Be(Gt.s[Gt.off])&&Ft<=(H-9)/10);return Ft},Ge=function(Gt,wt,Ft){let Xt=Ve(wt,Ft);return(Xt>Ie||0>=Xt)&&I.luaL_error(Gt.L,M.to_luastring('integral size (%d) out of limits [1,%d]'),Xt,Ie),Xt},we=function(Gt,wt){let Ft={opt:NaN,size:NaN,opt:wt.s[wt.off++],size:0};switch(Ft.opt){case'b'.charCodeAt(0):return Ft.size=1,Ft.opt=Ke.Kint,Ft;case'B'.charCodeAt(0):return Ft.size=1,Ft.opt=Ke.Kuint,Ft;case'h'.charCodeAt(0):return Ft.size=2,Ft.opt=Ke.Kint,Ft;case'H'.charCodeAt(0):return Ft.size=2,Ft.opt=Ke.Kuint,Ft;case'l'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kint,Ft;case'L'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kuint,Ft;case'j'.charCodeAt(0):return Ft.size=4,Ft.opt=Ke.Kint,Ft;case'J'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kuint,Ft;case'T'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kuint,Ft;case'f'.charCodeAt(0):return Ft.size=4,Ft.opt=Ke.Kfloat,Ft;case'd'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kfloat,Ft;case'n'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kfloat,Ft;case'i'.charCodeAt(0):return Ft.size=Ge(Gt,wt,4),Ft.opt=Ke.Kint,Ft;case'I'.charCodeAt(0):return Ft.size=Ge(Gt,wt,4),Ft.opt=Ke.Kuint,Ft;case's'.charCodeAt(0):return Ft.size=Ge(Gt,wt,8),Ft.opt=Ke.Kstring,Ft;case'c'.charCodeAt(0):return Ft.size=Ve(wt,-1),-1===Ft.size&&I.luaL_error(Gt.L,M.to_luastring('missing size for format option \'c\'')),Ft.opt=Ke.Kchar,Ft;case'z'.charCodeAt(0):return Ft.opt=Ke.Kzstr,Ft;case'x'.charCodeAt(0):return Ft.size=1,Ft.opt=Ke.Kpadding,Ft;case'X'.charCodeAt(0):return Ft.opt=Ke.Kpaddalign,Ft;case' '.charCodeAt(0):break;case'<'.charCodeAt(0):Gt.islittle=!0;break;case'>'.charCodeAt(0):Gt.islittle=!1;break;case'='.charCodeAt(0):Gt.islittle=!0;break;case'!'.charCodeAt(0):Gt.maxalign=Ge(Gt,wt,8);break;default:I.luaL_error(Gt.L,M.to_luastring('invalid format option \'%c\''),Ft.opt);}return Ft.opt=Ke.Knop,Ft},Fe=function(Gt,wt,Ft){let Xt={opt:NaN,size:NaN,ntoalign:NaN},Ht=we(Gt,Ft);Xt.size=Ht.size,Xt.opt=Ht.opt;let jt=Xt.size;if(Xt.opt===Ke.Kpaddalign)if(Ft.off>=Ft.s.length||0===Ft.s[Ft.off])I.luaL_argerror(Gt.L,1,M.to_luastring('invalid next option for option \'X\'',!0));else{let zt=we(Gt,Ft);jt=zt.size,zt=zt.opt,(zt===Ke.Kchar||0===jt)&&I.luaL_argerror(Gt.L,1,M.to_luastring('invalid next option for option \'X\'',!0))}return 1>=jt||Xt.opt===Ke.Kchar?Xt.ntoalign=0:(jt>Gt.maxalign&&(jt=Gt.maxalign),0!=(jt&jt-1)&&I.luaL_argerror(Gt.L,1,M.to_luastring('format asks for alignment not power of 2',!0)),Xt.ntoalign=jt-(wt&jt-1)&jt-1),Xt},Xe=function(Gt,wt,Ft,Xt,Ht){let jt=Array(Xt);jt[Ft?0:Xt-1]=wt&Pe;for(let zt=1;zt<Xt;zt++)wt>>=Me,jt[Ft?zt:Xt-1-zt]=wt&Pe;if(Ht&&Xt>Ce)for(let zt=Ce;zt<Xt;zt++)jt[Ft?zt:Xt-1-zt]=Pe;Gt.push(...jt)},He=function(Gt,wt,Ft,Xt){let Ht=new DataView(new ArrayBuffer(Xt));Ht.setFloat64(0,wt,Ft);for(let jt=0;8>jt;jt++)Gt.push(Ht.getUint8(jt,Ft))},Qe=function(Gt,wt,Ft,Xt,Ht){let jt=0,zt=Xt<=Ce?Xt:Ce;for(let Yt=zt-1;0<=Yt;Yt--)jt<<=Me,jt|=wt[Ft?Yt:Xt-1-Yt];if(Xt<Ce){if(Ht){let Yt=1<<Xt*Me-1;jt=(jt^Yt)-Yt}}else if(Xt>Ce){let Yt=Ht||0<=jt?0:Pe;for(let Jt=zt;Jt<Xt;Jt++)wt[Ft?Jt:Xt-1-Jt]!==Yt&&I.luaL_error(Gt,M.to_luastring('%d-byte integer does not fit into Lua Integer'),Xt)}return jt},$e=function(Gt,wt,Ft,Xt){E(wt.length>=Xt);let Ht=new DataView(new ArrayBuffer(Xt));return wt.forEach((jt,zt)=>Ht.setUint8(zt,jt,Ft)),Ht.getFloat64(0,Ft)},at=-1,lt=-2,ut=200,rt=['^'.charCodeAt(0),'$'.charCodeAt(0),'*'.charCodeAt(0),'+'.charCodeAt(0),'?'.charCodeAt(0),'.'.charCodeAt(0),'('.charCodeAt(0),'['.charCodeAt(0),'%'.charCodeAt(0),'-'.charCodeAt(0)];class st{constructor(Gt){this.src=null,this.src_init=null,this.src_end=null,this.p=null,this.p_end=null,this.L=Gt,this.matchdepth=NaN,this.level=NaN,this.capture=[]}}const nt=function(Gt,wt){return wt-='1'.charCodeAt(0),0>wt||wt>=Gt.level||Gt.capture[wt].len===at?I.luaL_error(Gt.L,M.to_luastring('invalid capture index %%%d'),wt+1):wt},ot=function(Gt){let wt=Gt.level;for(wt--;0<=wt;wt--)if(Gt.capture[wt].len===at)return wt;return I.luaL_error(Gt.L,M.to_luastring('invalid pattern capture'))},_t=function(Gt,wt){switch(Gt.p[wt++]){case G:return wt===Gt.p_end&&I.luaL_error(Gt.L,M.to_luastring('malformed pattern (ends with \'%%\')')),wt+1;case'['.charCodeAt(0):{Gt.p[wt]==='^'.charCodeAt(0)&&wt++;do wt===Gt.p_end&&I.luaL_error(Gt.L,M.to_luastring('malformed pattern (missing \']\')')),Gt.p[wt++]===G&&wt<Gt.p_end&&wt++;while(Gt.p[wt]!==']'.charCodeAt(0));return wt+1}default:return wt;}},it=function(Gt,wt){let Ft;switch(_StringfromCharCode(wt).toLowerCase().charCodeAt(0)){case'a'.charCodeAt(0):Ft=pe(Gt);break;case'c'.charCodeAt(0):Ft=de(Gt);break;case'd'.charCodeAt(0):Ft=ce(Gt);break;case'g'.charCodeAt(0):Ft=Le(Gt);break;case'l'.charCodeAt(0):Ft=ge(Gt);break;case'p'.charCodeAt(0):Ft=he(Gt);break;case's'.charCodeAt(0):Ft=Oe(Gt);break;case'u'.charCodeAt(0):Ft=Ae(Gt);break;case'w'.charCodeAt(0):Ft=Te(Gt);break;case'x'.charCodeAt(0):Ft=xe(Gt);break;case'z'.charCodeAt(0):Ft=0===Gt;break;default:return wt===Gt;}return ge(wt)?Ft:!Ft},pt=function(Gt,wt,Ft,Xt){let Ht=!0;for(Gt.p[Ft+1]==='^'.charCodeAt(0)&&(Ht=!1,Ft++);++Ft<Xt;)if(Gt.p[Ft]===G){if(Ft++,it(wt,Gt.p[Ft]))return Ht;}else if(Gt.p[Ft+1]==='-'.charCodeAt(0)&&Ft+2<Xt){if(Ft+=2,Gt.p[Ft-2]<=wt&&wt<=Gt.p[Ft])return Ht;}else if(Gt.p[Ft]===wt)return Ht;return!Ht},ct=function(Gt,wt,Ft,Xt){if(wt>=Gt.src_end)return!1;let Ht=Gt.src[wt];switch(Gt.p[Ft]){case'.'.charCodeAt(0):return!0;case G:return it(Ht,Gt.p[Ft+1]);case'['.charCodeAt(0):return pt(Gt,Ht,Ft,Xt-1);default:return Gt.p[Ft]===Ht;}},dt=function(Gt,wt,Ft){if(Ft>=Gt.p_end-1&&I.luaL_error(Gt.L,M.to_luastring('malformed pattern (missing arguments to \'%%b\'')),Gt.src[wt]!==Gt.p[Ft])return null;for(let Xt=Gt.p[Ft],Ht=Gt.p[Ft+1],jt=1;++wt<Gt.src_end;)if(Gt.src[wt]!==Ht)wt===Xt&&jt++;else if(0==--jt)return wt+1;return null},Lt=function(Gt,wt,Ft,Xt){let Ht=0;for(;ct(Gt,wt+Ht,Ft,Xt);)Ht++;for(;0<=Ht;){let jt=Ot(Gt,wt+Ht,Xt+1);if(jt)return jt;Ht--}return null},ft=function(Gt,wt,Ft,Xt){for(;;){let Ht=Ot(Gt,wt,Xt+1);if(null!==Ht)return Ht;if(ct(Gt,wt,Ft,Xt))wt++;else return null}},At=function(Gt,wt,Ft,Xt){let Ht=Gt.level;32<=Ht&&I.luaL_error(Gt.L,M.to_luastring('too many captures',!0)),Gt.capture[Ht]=Gt.capture[Ht]?Gt.capture[Ht]:{},Gt.capture[Ht].init=wt,Gt.capture[Ht].len=Xt,Gt.level=Ht+1;let jt;return null===(jt=Ot(Gt,wt,Ft))&&Gt.level--,jt},Tt=function(Gt,wt,Ft){let Xt=ot(Gt);Gt.capture[Xt].len=wt-Gt.capture[Xt].init;let Ht;return null===(Ht=Ot(Gt,wt,Ft))&&(Gt.capture[Xt].len=at),Ht},ht=function(Gt,wt,Ft){Ft=nt(Gt,Ft);let Xt=Gt.capture[Ft].len;return Gt.src_end>=Xt&&Gt.src.slice(Gt.capture[Ft].init,Gt.capture[Ft].init+Xt)===Gt.src.slice(wt,wt+Xt)?wt+Xt:null},Ot=function(Gt,wt,Ft){let Xt=!1,Ht=!0;for(0==Gt.matchdepth--&&I.luaL_error(Gt.L,M.to_luastring('pattern too complex',!0));Ht||Xt;)if(Ht=!1,Ft!==Gt.p_end)switch(Xt?'x'.charCodeAt(0):Gt.p[Ft]){case'('.charCodeAt(0):{wt=Gt.p[Ft+1]===')'.charCodeAt(0)?At(Gt,wt,Ft+2,lt):At(Gt,wt,Ft+1,at);break}case')'.charCodeAt(0):{wt=Tt(Gt,wt,Ft+1);break}case'$'.charCodeAt(0):{if(Ft+1!==Gt.p_end){Xt=!0;break}wt=0===Gt.src.slice(wt).length?wt:null;break}case G:{switch(Gt.p[Ft+1]){case'b'.charCodeAt(0):{wt=dt(Gt,wt,Ft+2),null!==wt&&(Ft=Ft.slice(4),Ht=!0);break}case'f'.charCodeAt(0):{Ft+=2,'['!==Gt.p[Ft]&&I.luaL_error(Gt.L,M.to_luastring('missing \'[\' after \'%%f\' in pattern'));let jt=_t(Gt,Ft),zt=wt===Gt.src_init?0:Gt.s[wt-1];if(!pt(Gt,zt,Ft,jt-1)&&pt(Gt,Gt.src[wt],Ft,jt-1)){Ft=jt,Ht=!0;break}wt=null;break}case'0'.charCodeAt(0):case'1'.charCodeAt(0):case'2'.charCodeAt(0):case'3'.charCodeAt(0):case'4'.charCodeAt(0):case'5'.charCodeAt(0):case'6'.charCodeAt(0):case'7'.charCodeAt(0):case'8'.charCodeAt(0):case'9'.charCodeAt(0):{wt=ht(Gt,wt,Gt.p[Ft+1]),null!==wt&&(Ft+=2,Ht=!0);break}default:Xt=!0;}break}default:{Xt=!1;let jt=_t(Gt,Ft);if(!!ct(Gt,wt,Ft,jt))switch(Gt.p[jt]){case'?'.charCodeAt(0):{let zt;null===(zt=Ot(Gt,wt+1,jt+1))?(Ft=jt+1,Ht=!0):wt=zt;break}case'+'.charCodeAt(0):wt++;case'*'.charCodeAt(0):wt=Lt(Gt,wt,Ft,jt);break;case'-'.charCodeAt(0):wt=ft(Gt,wt,Ft,jt);break;default:wt++,Ft=jt,Ht=!0;}else if(Gt.p[jt]==='*'.charCodeAt(0)||Gt.p[jt]==='?'.charCodeAt(0)||Gt.p[jt]==='-'.charCodeAt(0)){Ft=jt+1,Ht=!0;break}else wt=null;break}}return Gt.matchdepth++,wt},xt=function(Gt,wt,Ft,Xt){if(wt>=Gt.level)0===wt?M.lua_pushlstring(Gt.L,Gt.src.slice(Ft),Xt-Ft):I.luaL_error(Gt.L,M.to_luastring(`invalid capture index %${wt+1}`));else{let Ht=Gt.capture[wt].len;Ht===at&&I.luaL_error(Gt.L,M.to_luastring('unfinished capture',!0)),Ht===lt?M.lua_pushinteger(Gt.L,Gt.src_init+1):M.lua_pushlstring(Gt.L,Gt.src.slice(Gt.capture[wt].init),Ht)}},Ut=function(Gt,wt,Ft){let Xt=0===Gt.level&&Gt.src.slice(wt)?1:Gt.level;I.luaL_checkstack(Gt.L,Xt,M.to_luastring('too many catpures',!0));for(let Ht=0;Ht<Xt;Ht++)xt(Gt,Ht,wt,Ft);return Xt},Et=function(Gt,wt){let Ft=0;do{let Xt=!1,Ht=Gt.slice(Ft);for(let jt=0;jt<rt.length;jt++)if(-1<Ht.indexOf(rt[jt])){Xt=!0;break}if(Xt)return!1;++Ft}while(Ft<=wt);return!0},kt=function(Gt,wt,Ft,Xt,Ht,jt){Gt.L=wt,Gt.matchdepth=ut,Gt.src=Ft,Gt.src_init=0,Gt.src_end=Xt,Gt.p=Ht,Gt.p_end=jt},vt=function(Gt){Gt.level=0,E(Gt.matchdepth===ut)},Rt=function(Gt,wt,Ft){var Xt=Ft>>>0,Ht=wt.length,jt=Gt.length+1-Ht;loop:for(;Xt<jt;Xt++){for(let zt=0;zt<Ht;zt++)if(Gt[Xt+zt]!==wt[zt])continue loop;return Xt}return-1},bt=function(Gt,wt){let Ft=I.luaL_checkstring(Gt,1),Xt=I.luaL_checkstring(Gt,2),Ht=Ft.length,jt=Xt.length,zt=J(I.luaL_optinteger(Gt,3,1),Ht);if(1>zt)zt=1;else if(zt>Ht+1)return M.lua_pushnil(Gt),1;if(wt&&(M.lua_toboolean(Gt,4)||Et(Xt,jt))){let Yt=Rt(Ft.slice(zt-1),Xt,0);if(-1<Yt)return M.lua_pushinteger(Gt,zt+Yt),M.lua_pushinteger(Gt,zt+Yt+jt-1),2}else{let Yt=new st(Gt),Jt=zt-1,qt=Xt[0]==='^'.charCodeAt(0);qt&&(Xt=Xt.slice(1),jt--),kt(Yt,Gt,Ft,Ht,Xt,jt);do{let Wt;if(vt(Yt),null!==(Wt=Ot(Yt,Jt,0)))return wt?(M.lua_pushinteger(Gt,Jt+1),M.lua_pushinteger(Gt,Wt),Ut(Yt,null,0)+2):Ut(Yt,Jt,Wt)}while(Jt++<Yt.src_end&&!qt)}return M.lua_pushnil(Gt),1};class It{constructor(){this.src=NaN,this.p=NaN,this.lastmatch=NaN,this.ms=new st}}const Ct=function(Gt){let wt=M.lua_touserdata(Gt,M.lua_upvalueindex(3));wt.ms.L=Gt;for(let Ft=wt.src;Ft<wt.ms.src_end;Ft++){vt(wt.ms);let Xt;if(null!==(Xt=Ot(wt.ms,Ft,wt.p))&&Xt!==wt.lastmatch)return wt.src=wt.lastmatch=Xt,Ut(wt.ms,Ft,Xt)}return 0},Pt=function(Gt,wt,Ft,Xt){let Ht=Gt.L,jt=M.lua_tostring(Ht,3),zt=jt.length;for(let Yt=0;Yt<zt;Yt++)jt[Yt]===G?(Yt++,ce(jt[Yt])?jt[Yt]==='0'.charCodeAt(0)?I.luaL_addlstring(wt,Gt.src.slice(Ft),Xt-Ft):(xt(Gt,jt[Yt]-'1'.charCodeAt(0),Ft,Xt),I.luaL_tolstring(Ht,-1),M.lua_remove(Ht,-2),I.luaL_addvalue(wt)):(jt[Yt]!==G&&I.luaL_error(Ht,M.to_luastring('invalid use of \'%c\' in replacement string'),V),I.luaL_addchar(wt,jt[Yt]))):I.luaL_addchar(wt,jt[Yt])},yt=function(Gt,wt,Ft,Xt,Ht){let jt=Gt.L;switch(Ht){case M.LUA_TFUNCTION:{M.lua_pushvalue(jt,3);let zt=Ut(Gt,Ft,Xt);M.lua_call(jt,zt,1);break}case M.LUA_TTABLE:{xt(Gt,0,Ft,Xt),M.lua_gettable(jt,3);break}default:return void Pt(Gt,wt,Ft,Xt);}M.lua_toboolean(jt,-1)?!M.lua_isstring(jt,-1)&&I.luaL_error(jt,M.to_luastring('invalid replacement value (a %s)'),I.luaL_typename(jt,-1)):(M.lua_pop(jt,1),M.lua_pushlstring(jt,Ft,Xt-Ft)),I.luaL_addvalue(wt)},Kt={byte:function(Gt){let wt=I.luaL_checkstring(Gt,1),Ft=wt.length,Xt=J(I.luaL_optinteger(Gt,2,1),Ft),Ht=J(I.luaL_optinteger(Gt,3,Xt),Ft);if(1>Xt&&(Xt=1),Ht>Ft&&(Ht=Ft),Xt>Ht)return 0;if(Ht-Xt>=K.MAX_INT)return I.luaL_error(Gt,M.to_luastring('string slice too long',!0));let jt=Ht-Xt+1;I.luaL_checkstack(Gt,jt,M.to_luastring('string slice too long',!0));for(let zt=0;zt<jt;zt++)M.lua_pushinteger(Gt,wt[Xt+zt-1]);return jt},char:function(Gt){let wt=M.lua_gettop(Gt),Ft=[];for(let Xt=1,Ht;Xt<=wt;Xt++)Ht=I.luaL_checkinteger(Gt,Xt),I.luaL_argcheck(Gt,0<=Ht&&255>=Ht,'value out of range'),Ft.push(Ht);return M.lua_pushstring(Gt,Ft),1},dump:function(Gt){let wt=[],Ft=M.lua_toboolean(Gt,2);return(I.luaL_checktype(Gt,1,M.LUA_TFUNCTION),M.lua_settop(Gt,1),0!==M.lua_dump(Gt,Q,wt,Ft))?I.luaL_error(Gt,M.to_luastring('unable to dump given function')):(M.lua_pushstring(Gt,wt),1)},find:function(Gt){return bt(Gt,1)},format:function(Gt){let wt=M.lua_gettop(Gt),Ft=1,Xt=I.luaL_checkstring(Gt,Ft),Ht=[];for(;0<Xt.length;)if(Xt[0]!==G)Ht.push(Xt[0]),Xt=Xt.slice(1);else if((Xt=Xt.slice(1))[0]===G)Ht.push(Xt[0]),Xt=Xt.slice(1);else{let jt=[];++Ft>wt&&I.luaL_argerror(Gt,Ft,M.to_luastring('no value',!0));let zt=Re(Gt,Xt,jt);switch(Xt=zt.p,jt=zt.form,_StringfromCharCode(Xt[0])){case'c':{Xt=Xt.slice(1),Ht.push(I.luaL_checkinteger(Gt,Ft));break}case'd':case'i':case'o':case'u':case'x':case'X':{Xt=Xt.slice(1);let Yt=I.luaL_checkinteger(Gt,Ft);jt=be(jt,P.LUA_INTEGER_FRMLEN.split('').map((Jt)=>Jt.charCodeAt(0))),Ue(Ht,M.to_luastring(N(_StringfromCharCode(...jt),Yt)));break}case'a':case'A':{Xt=Xt.slice(1),jt=be(jt,P.LUA_INTEGER_FRMLEN.split('').map((Yt)=>Yt.charCodeAt(0))),Ue(Ht,se(Gt,jt,I.luaL_checknumber(Gt,Ft)));break}case'e':case'E':case'f':case'g':case'G':{Xt=Xt.slice(1);let Yt=I.luaL_checknumber(Gt,Ft);jt=be(jt,P.LUA_INTEGER_FRMLEN.split('').map((Jt)=>Jt.charCodeAt(0))),Ue(Ht,M.to_luastring(N(_StringfromCharCode(...jt),Yt)));break}case'q':{Xt=Xt.slice(1),ve(Gt,Ht,Ft);break}case's':{Xt=Xt.slice(1);let Yt=I.luaL_tolstring(Gt,Ft);2>=jt.length||0===jt[2]?(Ue(Ht,Yt),M.lua_pop(Gt,1)):(I.luaL_argcheck(Gt,Yt.length===Y(Yt),Ft,M.to_luastring('string contains zeros',!0)),0>jt.indexOf('.'.charCodeAt(0))&&100<=Yt.length?(Ue(Ht,Yt),M.lua_pop(Gt,1)):(Ue(Ht,M.to_luastring(N(_StringfromCharCode(...jt),M.to_jsstring(Yt)))),M.lua_pop(Gt,1)));break}default:return I.luaL_error(Gt,M.to_luastring('invalid option \'%%%c\' to \'format\''),Xt[0]);}}return M.lua_pushstring(Gt,Ht),1},gmatch:function(Gt){let wt=I.luaL_checkstring(Gt,1),Ft=I.luaL_checkstring(Gt,2),Xt=wt.length,Ht=Ft.length;M.lua_settop(Gt,2);let jt=new It;return M.lua_pushlightuserdata(Gt,jt),kt(jt.ms,Gt,wt,Xt,Ft,Ht),jt.src=0,jt.p=0,jt.lastmatch=null,M.lua_pushcclosure(Gt,Ct,3),1},gsub:function(Gt){let wt=I.luaL_checkstring(Gt,1),Ft=wt.length,Xt=I.luaL_checkstring(Gt,2),Ht=Xt.length,jt=null,zt=M.lua_type(Gt,3),Yt=I.luaL_optinteger(Gt,4,Ft+1),Jt=Xt[0]==='^'.charCodeAt(0),qt=0,Wt=new st(Gt),Zt=new I.luaL_Buffer;for(I.luaL_argcheck(Gt,zt===M.LUA_TNUMBER||zt===M.LUA_TSTRING||zt===M.LUA_TFUNCTION||zt===M.LUA_TTABLE,3,M.to_luastring('string/function/table expected',!0)),I.luaL_buffinit(Gt,Zt),Jt&&(Xt=Xt.slice(1),Ht--),kt(Wt,Gt,wt,Ft,Xt,Ht),wt=0,Xt=0;qt<Yt;){let Qt;if(vt(Wt),null!==(Qt=Ot(Wt,wt,Xt))&&Qt!==jt)qt++,yt(Wt,Zt,wt,Qt,zt),wt=jt=Qt;else if(wt<Wt.src_end)I.luaL_addchar(Zt,Wt.src[wt++]);else break;if(Jt)break}return I.luaL_addlstring(Zt,Wt.src.slice(wt),Wt.src_end-wt),I.luaL_pushresult(Zt),M.lua_pushinteger(Gt,qt),2},len:function(Gt){return M.lua_pushinteger(Gt,I.luaL_checkstring(Gt,1).length),1},lower:function(Gt){return M.lua_pushstring(Gt,M.to_luastring(M.to_jsstring(I.luaL_checkstring(Gt,1)).toLowerCase())),1},match:function(Gt){return bt(Gt,0)},pack:function(Gt){let wt=[],Ft=new De(Gt),Xt={s:I.luaL_checkstring(Gt,1),off:0},Ht=1,jt=0;for(M.lua_pushnil(Gt);Xt.off<Xt.s.length;){let zt=Fe(Ft,jt,Xt),Yt=zt.opt,Jt=zt.size,qt=zt.ntoalign;for(jt+=qt+Jt;0<qt--;)wt.push(Ne);switch(Ht++,Yt){case Ke.Kint:{let Wt=I.luaL_checkinteger(Gt,Ht);if(Jt<Ce){let Zt=1<<8*Jt-1;I.luaL_argcheck(Gt,-Zt<=Wt&&Wt<Zt,Ht,M.to_luastring('integer overflow',!0))}Xe(wt,Wt,Ft.islittle,Jt,0>Wt);break}case Ke.Kuint:{let Wt=I.luaL_checkinteger(Gt,Ht);Jt<Ce&&I.luaL_argcheck(Gt,Wt<1<<Jt*Me,Ht,M.to_luastring('unsigned overflow',!0)),Xe(wt,Wt,Ft.islittle,Jt,!1);break}case Ke.Kfloat:{let Wt=I.luaL_checknumber(Gt,Ht);He(wt,Wt,Ft.islittle,Jt);break}case Ke.Kchar:{let Wt=I.luaL_checkstring(Gt,Ht),Zt=Wt.length;for(I.luaL_argcheck(Gt,Zt<=Jt,Ht,M.to_luastring('string long than given size',!0)),wt.push(...Wt);Zt++<Jt;)wt.push(Ne);break}case Ke.Kstring:{let Wt=I.luaL_checkstring(Gt,Ht),Zt=Wt.length;I.luaL_argcheck(Gt,Jt>=Me||Zt<1<<Jt*Me,Ht,M.to_luastring('string length does not fit in given size',!0)),Xe(wt,Zt,Ft.islittle,Jt,0),wt.push(...Wt),jt+=Zt;break}case Ke.Kzstr:{let Wt=I.luaL_checkstring(Gt,Ht),Zt=Wt.length;I.luaL_argcheck(Gt,Wt.length===_StringfromCharCode(...Wt).length,Ht,M.to_luastring('strings contains zeros',!0)),wt.push(...Wt),wt.push(0),jt+=Zt+1;break}case Ke.Kpadding:wt.push(Ne);case Ke.Kpaddalign:case Ke.Knop:Ht--;}}return M.lua_pushstring(Gt,wt),1},packsize:function(Gt){let wt=new De(Gt),Ft={s:I.luaL_checkstring(Gt,1),off:0},Xt=0;for(;Ft.off<Ft.s.length;){let Ht=Fe(wt,Xt,Ft),jt=Ht.opt,zt=Ht.size,Yt=Ht.ntoalign;switch(zt+=Yt,I.luaL_argcheck(Gt,Xt<=H-zt-1,M.to_luastring('format result too large',!0)),Xt+=zt,jt){case Ke.Kstring:case Ke.Kzstr:I.luaL_argerror(Gt,1,M.to_luastring('variable-length format',!0));default:}}return M.lua_pushinteger(Gt,Xt),1},rep:function(Gt){let wt=I.luaL_checkstring(Gt,1),Ft=I.luaL_checkinteger(Gt,2),Xt=I.luaL_optstring(Gt,3,[]);if(wt.length+Xt.length<wt.length||wt.length+Xt.length>H/Ft)return I.luaL_error(Gt,M.to_luastring('resulting string too large',!0));let Ht=[];for(let jt=0;jt<Ft-1;jt++)Ht=Ht.concat(wt.concat(Xt));return Ht=Ht.concat(wt),M.lua_pushstring(Gt,0<Ft?Ht:[]),1},reverse:function(Gt){return M.lua_pushstring(Gt,I.luaL_checkstring(Gt,1).slice(0).reverse()),1},sub:function(Gt){let wt=I.luaL_checkstring(Gt,1),Ft=wt.length,Xt=J(I.luaL_checkinteger(Gt,2),Ft),Ht=J(I.luaL_optinteger(Gt,3,-1),Ft);return 1>Xt&&(Xt=1),Ht>Ft&&(Ht=Ft),Xt<=Ht?M.lua_pushstring(Gt,wt.slice(Xt-1,Xt-1+(Ht-Xt+1))):M.lua_pushliteral(Gt,''),1},unpack:function(Gt){let wt=new De(Gt),Ft={s:I.luaL_checkstring(Gt,1),off:0},Xt=I.luaL_checkstring(Gt,2),Ht=Xt.length,jt=J(I.luaL_optinteger(Gt,3,1),Ht)-1,zt=0;for(I.luaL_argcheck(Gt,jt<=Ht,3,M.to_luastring('initial position out of string',!0));Ft.off<Ft.s.length;){let Yt=Fe(wt,jt,Ft),Jt=Yt.opt,qt=Yt.size,Wt=Yt.ntoalign;switch(jt+Wt+qt>Ht&&I.luaL_argerror(Gt,2,M.to_luastring('data string too short',!0)),jt+=Wt,I.luaL_checkstack(Gt,2,M.to_luastring('too many results',!0)),zt++,Jt){case Ke.Kint:case Ke.Kuint:{let Zt=Qe(Gt,Xt.slice(jt),wt.islittle,qt,Jt===Ke.Kint);M.lua_pushinteger(Gt,Zt);break}case Ke.Kfloat:{let Zt=$e(Gt,Xt.slice(jt),wt.islittle,qt);M.lua_pushnumber(Gt,Zt);break}case Ke.Kchar:{M.lua_pushstring(Gt,Xt.slice(jt,jt+qt));break}case Ke.Kstring:{let Zt=Qe(Gt,Xt.slice(jt),wt.islittle,qt,0);I.luaL_argcheck(Gt,jt+Zt+qt<=Ht,2,M.to_luastring('data string too short',!0)),M.lua_pushstring(Gt,Xt.slice(jt+qt,jt+qt+Zt)),jt+=Zt;break}case Ke.Kzstr:{let Zt=Xt.slice(jt).indexOf(0);M.lua_pushstring(Gt,Xt.slice(jt,jt+Zt)),jt+=Zt+1;break}case Ke.Kpaddalign:case Ke.Kpadding:case Ke.Knop:zt--;}jt+=qt}return M.lua_pushinteger(Gt,jt+1),zt+1},upper:function(Gt){return M.lua_pushstring(Gt,M.to_luastring(M.to_jsstring(I.luaL_checkstring(Gt,1)).toUpperCase())),1}},Bt=function(Gt){M.lua_createtable(Gt,0,1),M.lua_pushliteral(Gt,''),M.lua_pushvalue(Gt,-2),M.lua_setmetatable(Gt,-2),M.lua_pop(Gt,1),M.lua_pushvalue(Gt,-2),M.lua_setfield(Gt,-2,M.to_luastring('__index',!0)),M.lua_pop(Gt,1)};T.exports.luaopen_string=function(Gt){return I.luaL_newlib(Gt,Kt),Bt(Gt),1}},function(T,O,U){'use strict';const E=U(0),N=U(2),I=U(6),M=U(4),P=1,K=2,V=4,G=P|K,F=function(Le,ge,Ae){return N.lua_pushstring(Le,ge),N.lua_rawget(Le,-Ae)!==N.LUA_TNIL},H=function(Le,ge,Ae){if(N.lua_type(Le,ge)!==N.LUA_TTABLE){let Te=1;N.lua_getmetatable(Le,ge)&&(!(Ae&P)||F(Le,N.to_luastring('__index',!0),++Te))&&(!(Ae&K)||F(Le,N.to_luastring('__newindex',!0),++Te))&&(!(Ae&V)||F(Le,N.to_luastring('__len',!0),++Te))?N.lua_pop(Le,Te):I.luaL_checktype(Le,ge,N.LUA_TTABLE)}},Y=function(Le,ge,Ae){return H(Le,ge,Ae|V),I.luaL_len(Le,ge)},J=function(Le,ge,Ae){N.lua_geti(Le,1,Ae),N.lua_isstring(Le,-1)||I.luaL_error(Le,N.to_luastring('invalid value (%s) at index %d in table for \'concat\''),I.luaL_typename(Le,-1),Ae),I.luaL_addvalue(ge)},te=function(){return _Mathfloor(1*Math.random()<<32)},ue=function(Le,ge,Ae){N.lua_seti(Le,1,ge),N.lua_seti(Le,1,Ae)},se=function(Le,ge,Ae){if(N.lua_isnil(Le,2))return N.lua_compare(Le,ge,Ae,N.LUA_OPLT);N.lua_pushvalue(Le,2),N.lua_pushvalue(Le,ge-1),N.lua_pushvalue(Le,Ae-2),N.lua_call(Le,2,1);let Te=N.lua_toboolean(Le,-1);return N.lua_pop(Le,1),Te},ne=function(Le,ge,Ae){for(let Te=ge,he=Ae-1;;){for(;N.lua_geti(Le,1,++Te),se(Le,-1,-2);)Te==Ae-1&&I.luaL_error(Le,N.to_luastring('invalid order function for sorting')),N.lua_pop(Le,1);for(;N.lua_geti(Le,1,--he),se(Le,-3,-1);)he<Te&&I.luaL_error(Le,N.to_luastring('invalid order function for sorting')),N.lua_pop(Le,1);if(he<Te)return N.lua_pop(Le,1),ue(Le,Ae-1,Te),Te;ue(Le,Te,he)}},oe=function(Le,ge,Ae){let Te=_Mathfloor((ge-Le)/4),he=Ae%(2*Te)+(Le+Te);return E(Le+Te<=he&&he<=ge-Te),he},_e=function(Le,ge,Ae,Te){for(;ge<Ae;){if(N.lua_geti(Le,1,ge),N.lua_geti(Le,1,Ae),se(Le,-1,-2)?ue(Le,ge,Ae):N.lua_pop(Le,2),1==Ae-ge)return;let he;if(he=100>Ae-ge||0===Te?_Mathfloor((ge+Ae)/2):oe(ge,Ae,Te),N.lua_geti(Le,1,he),N.lua_geti(Le,1,ge),se(Le,-2,-1)?ue(Le,he,ge):(N.lua_pop(Le,1),N.lua_geti(Le,1,Ae),se(Le,-1,-2)?ue(Le,he,Ae):N.lua_pop(Le,2)),2==Ae-ge)return;N.lua_geti(Le,1,he),N.lua_pushvalue(Le,-1),N.lua_geti(Le,1,Ae-1),ue(Le,he,Ae-1),he=ne(Le,ge,Ae);let Oe;he-ge<Ae-he?(_e(Le,ge,he-1,Te),Oe=he-ge,ge=he+1):(_e(Le,he+1,Ae,Te),Oe=Ae-he,Ae=he-1),(Ae-ge)/128>Oe&&(Te=te())}},ce={concat:function(Le){let ge=Y(Le,1,P),Ae=I.luaL_optlstring(Le,2,[]),Te=I.luaL_optinteger(Le,3,1);ge=I.luaL_optinteger(Le,4,ge);let he=new I.luaL_Buffer;for(I.luaL_buffinit(Le,he);Te<ge;Te++)J(Le,he,Te),I.luaL_addlstring(he,Ae);return Te===ge&&J(Le,he,Te),I.luaL_pushresult(he),1},insert:function(Le){let ge=Y(Le,1,G)+1,Ae;switch(N.lua_gettop(Le)){case 2:Ae=ge;break;case 3:{Ae=I.luaL_checkinteger(Le,2),I.luaL_argcheck(Le,1<=Ae&&Ae<=ge,2,N.to_luastring('position out of bounds',!0));for(let Te=ge;Te>Ae;Te--)N.lua_geti(Le,1,Te-1),N.lua_seti(Le,1,Te);break}default:return I.luaL_error(Le,N.to_luastring('wrong number of arguments to \'insert\'',!0));}return N.lua_seti(Le,1,Ae),0},move:function(Le){let ge=I.luaL_checkinteger(Le,2),Ae=I.luaL_checkinteger(Le,3),Te=I.luaL_checkinteger(Le,4),he=N.lua_isnoneornil(Le,5)?1:5;if(H(Le,1,P),H(Le,he,K),Ae>=ge){I.luaL_argcheck(Le,0<ge||Ae<M.LUA_MAXINTEGER+ge,3,N.to_luastring('too many elements to move',!0));let Oe=Ae-ge+1;if(I.luaL_argcheck(Le,Te<=M.LUA_MAXINTEGER-Oe+1,4,N.to_luastring('destination wrap around',!0)),Te>Ae||Te<=ge||1!=he&&1!==N.lua_compare(Le,1,he,N.LUA_OPEQ))for(let xe=0;xe<Oe;xe++)N.lua_geti(Le,1,ge+xe),N.lua_seti(Le,he,Te+xe);else for(let xe=Oe-1;0<=xe;xe--)N.lua_geti(Le,1,ge+xe),N.lua_seti(Le,he,Te+xe)}return N.lua_pushvalue(Le,he),1},pack:function(Le){let ge=N.lua_gettop(Le);N.lua_createtable(Le,ge,1),N.lua_insert(Le,1);for(let Ae=ge;1<=Ae;Ae--)N.lua_seti(Le,1,Ae);return N.lua_pushinteger(Le,ge),N.lua_setfield(Le,1,['n'.charCodeAt(0)]),1},remove:function(Le){let ge=Y(Le,1,G),Ae=I.luaL_optinteger(Le,2,ge);for(Ae!==ge&&I.luaL_argcheck(Le,1<=Ae&&Ae<=ge+1,1,N.to_luastring('position out of bounds',!0)),N.lua_geti(Le,1,Ae);Ae<ge;Ae++)N.lua_geti(Le,1,Ae+1),N.lua_seti(Le,1,Ae);return N.lua_pushnil(Le),N.lua_seti(Le,1,Ae),1},sort:function(Le){let ge=Y(Le,1,G);return 1<ge&&(I.luaL_argcheck(Le,ge<M.MAX_INT,1,N.to_luastring('array too big',!0)),!N.lua_isnoneornil(Le,2)&&I.luaL_checktype(Le,2,N.LUA_TFUNCTION),N.lua_settop(Le,2),_e(Le,1,ge,0)),0},unpack:function(Le){let ge=I.luaL_optinteger(Le,2,1),Ae=I.luaL_opt(Le,I.luaL_checkinteger,3,I.luaL_len(Le,1));if(ge>Ae)return 0;let Te=Ae-ge;if(Te>=M.MAX_INT||!N.lua_checkstack(Le,++Te))return I.luaL_error(Le,N.to_luastring('too many results to unpack',!0));for(;ge<Ae;ge++)N.lua_geti(Le,1,ge);return N.lua_geti(Le,1,Ae),Te}};T.exports.luaopen_table=function(Le){return I.luaL_newlib(Le,ce),1}},function(T,O,U){'use strict';const E=U(2),N=U(6),I=U(4),M=1114111,P=function(ee){return 128==(192&ee)},K=function(ee,te){return 0<=ee?ee:0-ee>te?0:te+ee+1},V=function(ee){let ue=ee[0],se=0,ne=0;if(128>ue)se=ue;else{let oe=0;for(;64&ue;){let _e=ee[++oe];if(128!=(192&_e))return null;se=se<<6|63&_e,ue<<=1}if(se|=(127&ue)<<5*oe,3<oe||se>M||se<=[255,127,2047,65535][oe])return null;ee=ee.slice(oe),ne+=oe}return{string:ee.slice(1),code:se,pos:ne+1}},F=function(ee,te){let ae=N.luaL_checkinteger(ee,te);N.luaL_argcheck(ee,0<=ae&&ae<=M,te,E.to_luastring('value out of range',!0)),E.lua_pushstring(ee,E.to_luastring(_StringfromCharCode(ae)))},q=function(ee){let te=N.luaL_checkstring(ee,1),ae=te.length,ue=E.lua_tointeger(ee,2)-1;if(0>ue)ue=0;else if(ue<ae)for(ue++;P(te[ue]);)ue++;if(ue>=ae)return 0;let se=V(te.slice(ue)),ne=se?se.code:null,oe=se?se.string:null;return null===oe||P(oe[0])?N.luaL_error(ee,E.to_luastring('invalid UTF-8 code',!0)):(E.lua_pushinteger(ee,ue+1),E.lua_pushinteger(ee,ne),2)},Z={char:function(ee){let te=E.lua_gettop(ee);if(1===te)F(ee,1);else{let ae=new N.luaL_Buffer;N.luaL_buffinit(ee,ae);for(let ue=1;ue<=te;ue++)F(ee,ue),N.luaL_addvalue(ae);N.luaL_pushresult(ae)}return 1},codepoint:function(ee){let te=N.luaL_checkstring(ee,1),ae=K(N.luaL_optinteger(ee,2,1),te.length),ue=K(N.luaL_optinteger(ee,3,ae),te.length);if(N.luaL_argcheck(ee,1<=ae,2,E.to_luastring('out of range',!0)),N.luaL_argcheck(ee,ue<=te.length,3,E.to_luastring('out of range',!0)),ae>ue)return 0;if(ue-ae>=I.MAX_INT)return N.luaL_error(ee,E.to_luastring('string slice too long',!0));let se=ue-ae+1;for(N.luaL_checkstack(ee,se,E.to_luastring('string slice too long',!0)),se=0,te=te.slice(ae-1);se<ue-ae;){let ne=V(te);if(null===ne)return N.luaL_error(ee,E.to_luastring('invalid UTF-8 code',!0));te=ne.string;let oe=ne.code;E.lua_pushinteger(ee,oe),se++}return se},codes:function(ee){return N.luaL_checkstring(ee,1),E.lua_pushcfunction(ee,q),E.lua_pushvalue(ee,1),E.lua_pushinteger(ee,0),3},len:function(ee){let te=0,ae=N.luaL_checkstring(ee,1),ue=ae.length,se=K(N.luaL_optinteger(ee,2,1),ue),ne=K(N.luaL_optinteger(ee,3,-1),ue);for(N.luaL_argcheck(ee,1<=se&&--se<=ue,2,'initial position out of string'),N.luaL_argcheck(ee,--ne<ue,3,'final position out of string');se<=ne;){let oe=V(ae.slice(se)),_e=oe?oe.string:null;if(null===_e)return E.lua_pushnil(ee),E.lua_pushinteger(ee,se+1),2;se=ae.length-_e.length,te++}return E.lua_pushinteger(ee,te),1},offset:function(ee){let te=N.luaL_checkstring(ee,1),ae=N.luaL_checkinteger(ee,2),ue=0<=ae?1:te.length+1;if(ue=K(N.luaL_optinteger(ee,3,ue),te.length),N.luaL_argcheck(ee,1<=ue&&--ue<=te.length,3,E.to_luastring('position out of range',!0)),0===ae)for(;0<ue&&P(te[ue]);)ue--;else if(P(te[ue])&&N.luaL_error(ee,E.to_luastring('initial position is a continuation byte',!0)),0>ae)for(;0>ae&&0<ue;){do ue--;while(0<ue&&P(te[ue]));ae++}else for(ae--;0<ae&&ue<te.length;){do ue++;while(P(te[ue]));ae--}return 0===ae?E.lua_pushinteger(ee,ue+1):E.lua_pushnil(ee),1}};T.exports.luaopen_utf8=function(ee){return N.luaL_newlib(ee,Z),E.lua_pushstring(ee,E.to_luastring('[\0-\x7F\xC2-\xF4][\x80-\xBF]*')),E.lua_setfield(ee,-2,E.to_luastring('charpattern',!0)),1}},function(T,O,U){var E=U(34),N=U(36),I=U(39),M=U(38),P=U(37),K=U(35),V=U(40);V.alea=E,V.xor128=N,V.xorwow=I,V.xorshift7=M,V.xor4096=P,V.tychei=K,T.exports=V},function(T,O,U){(function(E){var N;(function(I,M){function K(H){var Y=this,J=F();Y.next=function(){var q=2091639*Y.s0+2.3283064365386963e-10*Y.c;return Y.s0=Y.s1,Y.s1=Y.s2,Y.s2=q-(Y.c=0|q)},Y.c=1,Y.s0=J(' '),Y.s1=J(' '),Y.s2=J(' '),Y.s0-=J(H),0>Y.s0&&(Y.s0+=1),Y.s1-=J(H),0>Y.s1&&(Y.s1+=1),Y.s2-=J(H),0>Y.s2&&(Y.s2+=1),J=null}function V(H,Y){return Y.c=H.c,Y.s0=H.s0,Y.s1=H.s1,Y.s2=H.s2,Y}function G(H,Y){var J=new K(H),q=Y&&Y.state,W=J.next;return W.int32=function(){return 0|4294967296*J.next()},W.double=function(){return W()+1.1102230246251565e-16*(0|2097152*W())},W.quick=W,q&&('object'==typeof q&&V(q,J),W.state=function(){return V(J,{})}),W}function F(){var H=4022871197;return function(J){J=J.toString();for(var q=0;q<J.length;q++){H+=J.charCodeAt(q);var W=0.02519603282416938*H;H=W>>>0,W-=H,W*=H,H=W>>>0,W-=H,H+=4294967296*W}return 2.3283064365386963e-10*(H>>>0)}}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.alea=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){(function(E){var N;(function(I,M){function K(F){var H=this,Y='';H.next=function(){var q=H.b,W=H.c,Z=H.d,Q=H.a;return q=q<<25^q>>>7^W,W=0|W-Z,Z=Z<<24^Z>>>8^Q,Q=0|Q-q,H.b=q=q<<20^q>>>12^W,H.c=W=0|W-Z,H.d=Z<<16^W>>>16^Q,H.a=0|Q-q},H.a=0,H.b=0,H.c=-1640531527,H.d=1367130551,F===_Mathfloor(F)?(H.a=0|F/4294967296,H.b=0|F):Y+=F;for(var J=0;J<Y.length+20;J++)H.b^=0|Y.charCodeAt(J),H.next()}function V(F,H){return H.a=F.a,H.b=F.b,H.c=F.c,H.d=F.d,H}function G(F,H){var Y=new K(F),J=H&&H.state,q=function(){return(Y.next()>>>0)/4294967296};return q.double=function(){do var W=Y.next()>>>11,Z=(Y.next()>>>0)/4294967296,Q=(W+Z)/2097152;while(0===Q);return Q},q.int32=Y.next,q.quick=q,J&&('object'==typeof J&&V(J,Y),q.state=function(){return V(Y,{})}),q}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.tychei=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){(function(E){var N;(function(I,M){function K(F){var H=this,Y='';H.x=0,H.y=0,H.z=0,H.w=0,H.next=function(){var q=H.x^H.x<<11;return H.x=H.y,H.y=H.z,H.z=H.w,H.w^=H.w>>>19^q^q>>>8},F===(0|F)?H.x=F:Y+=F;for(var J=0;J<Y.length+64;J++)H.x^=0|Y.charCodeAt(J),H.next()}function V(F,H){return H.x=F.x,H.y=F.y,H.z=F.z,H.w=F.w,H}function G(F,H){var Y=new K(F),J=H&&H.state,q=function(){return(Y.next()>>>0)/4294967296};return q.double=function(){do var W=Y.next()>>>11,Z=(Y.next()>>>0)/4294967296,Q=(W+Z)/2097152;while(0===Q);return Q},q.int32=Y.next,q.quick=q,J&&('object'==typeof J&&V(J,Y),q.state=function(){return V(Y,{})}),q}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.xor128=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){(function(E){var N;(function(I,M){function K(F){var Y=this;Y.next=function(){var J=Y.w,q=Y.X,W=Y.i,Z,Q;return Y.w=J=0|J+1640531527,Q=q[127&W+34],Z=q[W=127&W+1],Q^=Q<<13,Z^=Z<<17,Q^=Q>>>15,Z^=Z>>>12,Q=q[W]=Q^Z,Y.i=W,0|Q+(J^J>>>16)},function(J,q){var te=[],ae=128,W,Z,Q,$,ee;for(q===(0|q)?(Z=q,q=null):(q+='\0',Z=0,ae=_Mathmax(ae,q.length)),Q=0,$=-32;$<ae;++$)q&&(Z^=q.charCodeAt(($+32)%q.length)),0===$&&(ee=Z),Z^=Z<<10,Z^=Z>>>15,Z^=Z<<4,Z^=Z>>>13,0<=$&&(ee=0|ee+1640531527,W=te[127&$]^=Z+ee,Q=0==W?Q+1:0);for(128<=Q&&(te[127&(q&&q.length||0)]=-1),Q=127,$=512;0<$;--$)Z=te[127&Q+34],W=te[Q=127&Q+1],Z^=Z<<13,W^=W<<17,Z^=Z>>>15,W^=W>>>12,te[Q]=Z^W;J.w=ee,J.X=te,J.i=Q}(Y,F)}function V(F,H){return H.i=F.i,H.w=F.w,H.X=F.X.slice(),H}function G(F,H){null==F&&(F=+new Date);var Y=new K(F),J=H&&H.state,q=function(){return(Y.next()>>>0)/4294967296};return q.double=function(){do var W=Y.next()>>>11,Z=(Y.next()>>>0)/4294967296,Q=(W+Z)/2097152;while(0===Q);return Q},q.int32=Y.next,q.quick=q,J&&(J.X&&V(J,Y),q.state=function(){return V(Y,{})}),q}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.xor4096=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){(function(E){var N;(function(I,M){function K(F){var Y=this;Y.next=function(){var J=Y.x,q=Y.i,W,Z;return W=J[q],W^=W>>>7,Z=W^W<<24,W=J[7&q+1],Z^=W^W>>>10,W=J[7&q+3],Z^=W^W>>>3,W=J[7&q+4],Z^=W^W<<7,W=J[7&q+7],W^=W<<13,Z^=W^W<<9,J[q]=Z,Y.i=7&q+1,Z},function(J,q){var Q=[],W,Z;if(q===(0|q))Z=Q[0]=q;else for(q=''+q,W=0;W<q.length;++W)Q[7&W]=Q[7&W]<<15^q.charCodeAt(W)+Q[7&W+1]<<13;for(;8>Q.length;)Q.push(0);for(W=0;8>W&&0===Q[W];++W);for(Z=8==W?Q[7]=-1:Q[W],J.x=Q,J.i=0,W=256;0<W;--W)J.next()}(Y,F)}function V(F,H){return H.x=F.x.slice(),H.i=F.i,H}function G(F,H){null==F&&(F=+new Date);var Y=new K(F),J=H&&H.state,q=function(){return(Y.next()>>>0)/4294967296};return q.double=function(){do var W=Y.next()>>>11,Z=(Y.next()>>>0)/4294967296,Q=(W+Z)/2097152;while(0===Q);return Q},q.int32=Y.next,q.quick=q,J&&(J.x&&V(J,Y),q.state=function(){return V(Y,{})}),q}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.xorshift7=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){(function(E){var N;(function(I,M){function K(F){var H=this,Y='';H.next=function(){var q=H.x^H.x>>>2;return H.x=H.y,H.y=H.z,H.z=H.w,H.w=H.v,0|(H.d=0|H.d+362437)+(H.v=H.v^H.v<<4^(q^q<<1))},H.x=0,H.y=0,H.z=0,H.w=0,H.v=0,F===(0|F)?H.x=F:Y+=F;for(var J=0;J<Y.length+64;J++)H.x^=0|Y.charCodeAt(J),J==Y.length&&(H.d=H.x<<10^H.x>>>4),H.next()}function V(F,H){return H.x=F.x,H.y=F.y,H.z=F.z,H.w=F.w,H.v=F.v,H.d=F.d,H}function G(F,H){var Y=new K(F),J=H&&H.state,q=function(){return(Y.next()>>>0)/4294967296};return q.double=function(){do var W=Y.next()>>>11,Z=(Y.next()>>>0)/4294967296,Q=(W+Z)/2097152;while(0===Q);return Q},q.int32=Y.next,q.quick=q,J&&('object'==typeof J&&V(J,Y),q.state=function(){return V(Y,{})}),q}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.xorwow=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){var E;(function(N,I){function M(ue,se,ne){var oe=[];se=!0==se?{entropy:!0}:se||{};var _e=G(V(se.entropy?[ue,H(N)]:null==ue?F():ue,3),oe),pe=new P(oe),ce=function(){for(var de=pe.g(q),Le=Q,ge=0;de<$;)de=(de+ge)*J,Le*=J,ge=pe.g(1);for(;de>=ee;)de/=2,Le/=2,ge>>>=1;return(de+ge)/Le};return ce.int32=function(){return 0|pe.g(4)},ce.quick=function(){return pe.g(4)/4294967296},ce.double=ce,G(H(pe.S),N),(se.pass||ne||function(de,Le,ge,Ae){return Ae&&(Ae.S&&K(Ae,pe),de.state=function(){return K(pe,{})}),ge?(I[Z]=de,Le):de})(ce,_e,'global'in se?se.global:this==I,se.state)}function P(ue){var ne=ue.length,oe=this,_e=0,pe=oe.i=oe.j=0,ce=oe.S=[],se;for(ne||(ue=[ne++]);_e<J;)ce[_e]=_e++;for(_e=0;_e<J;_e++)ce[_e]=ce[pe=te&pe+ue[_e%ne]+(se=ce[_e])],ce[pe]=se;(oe.g=function(de){for(var ge=0,Ae=oe.i,Te=oe.j,he=oe.S,Le;de--;)Le=he[Ae=te&Ae+1],ge=ge*J+he[te&(he[Ae]=he[Te=te&Te+Le])+(he[Te]=Le)];return oe.i=Ae,oe.j=Te,ge})(J)}function K(ue,se){return se.i=ue.i,se.j=ue.j,se.S=ue.S.slice(),se}function V(ue,se){var ne=[],oe=typeof ue,_e;if(se&&'object'==oe)for(_e in ue)try{ne.push(V(ue[_e],se-1))}catch(pe){}return ne.length?ne:'string'==oe?ue:ue+'\0'}function G(ue,se){for(var ne=ue+'',_e=0,oe;_e<ne.length;)se[te&_e]=te&(oe^=19*se[te&_e])+ne.charCodeAt(_e++);return H(se)}function F(){try{var ue;return ae&&(ue=ae.randomBytes)?ue=ue(J):(ue=new Uint8Array(J),(Y.crypto||Y.msCrypto).getRandomValues(ue)),H(ue)}catch(oe){var se=Y.navigator,ne=se&&se.plugins;return[+new Date,Y,ne,Y.screen,H(N)]}}function H(ue){return _StringfromCharCode.apply(0,ue)}var Y=this,J=256,q=6,Z='random',Q=I.pow(J,q),$=I.pow(2,52),ee=2*$,te=J-1,ae;if(I['seed'+Z]=M,G(I.random(),N),'object'==typeof T&&T.exports){T.exports=M;try{ae=U(54)}catch(ue){}}else E=function(){return M}.call(O,U,O,T),!(void 0!==E&&(T.exports=E))})([],Math)},function(T,O,U){var E;(function(N){'use strict';function I(){var F=arguments[0],H=I.cache;return H[F]&&H.hasOwnProperty(F)||(H[F]=I.parse(F)),I.format.call(null,H[F],arguments)}function M(F){return'number'==typeof F?'number':'string'==typeof F?'string':Object.prototype.toString.call(F).slice(8,-1).toLowerCase()}function P(F,H){return 0<=H&&7>=H&&G[F]?G[F][H]:Array(H+1).join(F)}var K={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};I.format=function(F,H){var Y=1,J=F.length,q='',Z=[],se=!0,ne='',W,Q,$,ee,te,ae,ue;for(Q=0;Q<J;Q++)if(q=M(F[Q]),'string'===q)Z[Z.length]=F[Q];else if('array'===q){if(ee=F[Q],ee[2])for(W=H[Y],$=0;$<ee[2].length;$++){if(!W.hasOwnProperty(ee[2][$]))throw new Error(I('[sprintf] property "%s" does not exist',ee[2][$]));W=W[ee[2][$]]}else W=ee[1]?H[ee[1]]:H[Y++];if(K.not_type.test(ee[8])&&K.not_primitive.test(ee[8])&&'function'==M(W)&&(W=W()),K.numeric_arg.test(ee[8])&&'number'!=M(W)&&isNaN(W))throw new TypeError(I('[sprintf] expecting number but found %s',M(W)));switch(K.number.test(ee[8])&&(se=0<=W),ee[8]){case'b':W=parseInt(W,10).toString(2);break;case'c':W=_StringfromCharCode(parseInt(W,10));break;case'd':case'i':W=parseInt(W,10);break;case'j':W=JSON.stringify(W,null,ee[6]?parseInt(ee[6]):0);break;case'e':W=ee[7]?parseFloat(W).toExponential(ee[7]):parseFloat(W).toExponential();break;case'f':W=ee[7]?parseFloat(W).toFixed(ee[7]):parseFloat(W);break;case'g':W=ee[7]?+W.toPrecision(ee[7])+'':parseFloat(W);break;case'o':W=W.toString(8);break;case's':W+='',W=ee[7]?W.substring(0,ee[7]):W;break;case't':W=!!W+'',W=ee[7]?W.substring(0,ee[7]):W;break;case'T':W=M(W),W=ee[7]?W.substring(0,ee[7]):W;break;case'u':W=parseInt(W,10)>>>0;break;case'v':W=W.valueOf(),W=ee[7]?W.substring(0,ee[7]):W;break;case'x':W=parseInt(W,10).toString(16);break;case'X':W=parseInt(W,10).toString(16).toUpperCase();}K.json.test(ee[8])?Z[Z.length]=W:(K.number.test(ee[8])&&(!se||ee[3])?(ne=se?'+':'-',W=W.toString().replace(K.sign,'')):ne='',ae=ee[4]?'0'===ee[4]?'0':ee[4].charAt(1):' ',ue=ee[6]-(ne+W).length,te=ee[6]?0<ue?P(ae,ue):'':'',Z[Z.length]=ee[5]?ne+W+te:'0'===ae?ne+te+W:te+ne+W)}return Z.join('')},I.cache={},I.parse=function(F){for(var H=F,Y=[],J=[],q=0;H;){if(null!==(Y=K.text.exec(H)))J[J.length]=Y[0];else if(null!==(Y=K.modulo.exec(H)))J[J.length]='%';else if(null!==(Y=K.placeholder.exec(H))){if(Y[2]){q|=1;var W=[],Z=Y[2],Q=[];if(null!==(Q=K.key.exec(Z))){for(W[W.length]=Q[1];''!==(Z=Z.substring(Q[0].length));)if(null!==(Q=K.key_access.exec(Z)))W[W.length]=Q[1];else if(null!==(Q=K.index_access.exec(Z)))W[W.length]=Q[1];else throw new SyntaxError('[sprintf] failed to parse named argument key');}else throw new SyntaxError('[sprintf] failed to parse named argument key');Y[2]=W}else q|=2;if(3==q)throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported');J[J.length]=Y}else throw new SyntaxError('[sprintf] unexpected placeholder');H=H.substring(Y[0].length)}return J};var V=function(F,H,Y){return Y=(H||[]).slice(0),Y.splice(0,0,F),I.apply(null,Y)},G={0:['','0','00','000','0000','00000','000000','0000000'],' ':['',' ',' ',' ',' ',' ',' ',' '],_:['','_','__','___','____','_____','______','_______']};O.sprintf=I,O.vsprintf=V,'undefined'!=typeof N&&(N.sprintf=I,N.vsprintf=V,E=function(){return{sprintf:I,vsprintf:V}}.call(O,U,O,T),!(void 0!==E&&(T.exports=E)))})('undefined'==typeof window?this:window)},function(T){(function(){function U(q,W,Z){function $(oe,_e,pe,ce){for(var de='',Le=null,ge=!1,Ae=oe.length,Te=!1,he=0,Oe;he<Ae;he++){if(Oe=oe.charCodeAt(he),!0==ge){if(45===Oe){Le='';continue}else if(95===Oe){Le=' ';continue}else if(48===Oe){Le='0';continue}else if(58===Oe){Te&&V('[WARNING] detected use of unsupported %:: or %::: modifiers to strftime'),Te=!0;continue}switch(Oe){case 37:de+='%';break;case 65:de+=pe.days[_e.getDay()];break;case 66:de+=pe.months[_e.getMonth()];break;case 67:de+=E(_Mathfloor(_e.getFullYear()/100),Le);break;case 68:de+=$(pe.formats.D,_e,pe,ce);break;case 70:de+=$(pe.formats.F,_e,pe,ce);break;case 72:de+=E(_e.getHours(),Le);break;case 73:de+=E(I(_e.getHours()),Le);break;case 76:de+=N(_Mathfloor(ce%1e3));break;case 77:de+=E(_e.getMinutes(),Le);break;case 80:de+=12>_e.getHours()?pe.am:pe.pm;break;case 82:de+=$(pe.formats.R,_e,pe,ce);break;case 83:de+=E(_e.getSeconds(),Le);break;case 84:de+=$(pe.formats.T,_e,pe,ce);break;case 85:de+=E(M(_e,'sunday'),Le);break;case 87:de+=E(M(_e,'monday'),Le);break;case 88:de+=$(pe.formats.X,_e,pe,ce);break;case 89:de+=_e.getFullYear();break;case 90:if(ae&&0===te)de+='GMT';else{var xe=_e.toString().match(/\(([\w\s]+)\)/);de+=xe&&xe[1]||''}break;case 97:de+=pe.shortDays[_e.getDay()];break;case 98:de+=pe.shortMonths[_e.getMonth()];break;case 99:de+=$(pe.formats.c,_e,pe,ce);break;case 100:de+=E(_e.getDate(),Le);break;case 101:de+=E(_e.getDate(),null==Le?' ':Le);break;case 104:de+=pe.shortMonths[_e.getMonth()];break;case 106:var Ue=new Date(_e.getFullYear(),0,1),Ee=_Mathceil((_e.getTime()-Ue.getTime())/86400000);de+=N(Ee);break;case 107:de+=E(_e.getHours(),null==Le?' ':Le);break;case 108:de+=E(I(_e.getHours()),null==Le?' ':Le);break;case 109:de+=E(_e.getMonth()+1,Le);break;case 110:de+='\n';break;case 111:var Ee=_e.getDate();de+=pe.ordinalSuffixes?Ee+''+(pe.ordinalSuffixes[Ee-1]||P(Ee)):Ee+''+P(Ee);break;case 112:de+=12>_e.getHours()?pe.AM:pe.PM;break;case 114:de+=$(pe.formats.r,_e,pe,ce);break;case 115:de+=_Mathfloor(ce/1e3);break;case 116:de+='\t';break;case 117:var Ee=_e.getDay();de+=0===Ee?7:Ee;break;case 118:de+=$(pe.formats.v,_e,pe,ce);break;case 119:de+=_e.getDay();break;case 120:de+=$(pe.formats.x,_e,pe,ce);break;case 121:de+=(''+_e.getFullYear()).slice(2);break;case 122:if(ae&&0===te)de+=Te?'+00:00':'+0000';else{var ke=0===te?-_e.getTimezoneOffset():te/60000,ve=0>ke?'-':'+',Re=Te?':':'',be=_Mathfloor(_Mathabs(ke/60)),Se=_Mathabs(ke%60);de+=ve+E(be)+Re+E(Se)}break;default:ge&&(de+='%'),de+=oe[he];}Le=null,ge=!1;continue}if(37===Oe){ge=!0;continue}de+=oe[he]}return de}var ee=q||F,te=W||0,ae=Z||!1,ue=0,ne=function(oe,_e){var pe;if(!_e){var ce=Date.now();ce>ue?(ue=ce,se=new Date(ue),pe=ue,ae&&(se=new Date(ue+K(se)+te))):pe=ue,_e=se}else if(pe=_e.getTime(),ae){var de=K(_e);if(_e=new Date(pe+de+te),K(_e)!==de){var Le=K(_e);_e=new Date(pe+Le+te)}}return $(oe,_e,ee,pe)},se;return ne.localize=function(oe){return new U(oe||ee,te,ae)},ne.localizeByIdentifier=function(oe){var _e=G[oe];return _e?ne.localize(_e):(V('[WARNING] No locale found with identifier "'+oe+'".'),ne)},ne.timezone=function(oe){var _e=te,pe=ae,ce=typeof oe;if('number'==ce||'string'==ce)if(pe=!0,'string'==ce){var de='-'===oe[0]?-1:1,Le=parseInt(oe.slice(1,3),10),ge=parseInt(oe.slice(3,5),10);_e=1e3*(60*(de*(60*Le+ge)))}else'number'==ce&&(_e=1e3*(60*oe));return new U(ee,_e,pe)},ne.utc=function(){return new U(ee,te,!0)},ne}function E(q,W){return''===W||9<q?q:(null==W&&(W='0'),W+q)}function N(q){return 99<q?q:9<q?'0'+q:'00'+q}function I(q){return 0===q?12:12<q?q-12:q}function M(q,W){W=W||'sunday';var Z=q.getDay();'monday'===W&&(0===Z?Z=6:Z--);var Q=Date.UTC(q.getFullYear(),0,1),$=Date.UTC(q.getFullYear(),q.getMonth(),q.getDate()),ee=_Mathfloor(($-Q)/8.64e7),te=(ee+7-Z)/7;return _Mathfloor(te)}function P(q){var W=q%10,Z=q%100;return 11<=Z&&13>=Z||0==W||4<=W?'th':1==W?'st':2==W?'nd':3==W?'rd':void 0}function K(q){return 6e4*(q.getTimezoneOffset()||0)}function V(q){'undefined'!=typeof console&&'function'==typeof console.warn&&console.warn(q)}var G={de_DE:{days:['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],shortDays:['So','Mo','Di','Mi','Do','Fr','Sa'],months:['Januar','Februar','M\xE4rz','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],shortMonths:['Jan','Feb','M\xE4r','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d.%m.%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},en_CA:{days:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],shortDays:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],months:['January','February','March','April','May','June','July','August','September','October','November','December'],shortMonths:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],ordinalSuffixes:['st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d/%m/%y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%r',x:'%D'}},en_US:{days:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],shortDays:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],months:['January','February','March','April','May','June','July','August','September','October','November','December'],shortMonths:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],ordinalSuffixes:['st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%m/%d/%y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%r',x:'%D'}},es_MX:{days:['domingo','lunes','martes','mi\xE9rcoles','jueves','viernes','s\xE1bado'],shortDays:['dom','lun','mar','mi\xE9','jue','vie','s\xE1b'],months:['enero','febrero','marzo','abril','mayo','junio','julio','agosto','septiembre','octubre','noviembre',' diciembre'],shortMonths:['ene','feb','mar','abr','may','jun','jul','ago','sep','oct','nov','dic'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d/%m/%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},fr_FR:{days:['dimanche','lundi','mardi','mercredi','jeudi','vendredi','samedi'],shortDays:['dim.','lun.','mar.','mer.','jeu.','ven.','sam.'],months:['janvier','f\xE9vrier','mars','avril','mai','juin','juillet','ao\xFBt','septembre','octobre','novembre','d\xE9cembre'],shortMonths:['janv.','f\xE9vr.','mars','avril','mai','juin','juil.','ao\xFBt','sept.','oct.','nov.','d\xE9c.'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d/%m/%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},it_IT:{days:['domenica','luned\xEC','marted\xEC','mercoled\xEC','gioved\xEC','venerd\xEC','sabato'],shortDays:['dom','lun','mar','mer','gio','ven','sab'],months:['gennaio','febbraio','marzo','aprile','maggio','giugno','luglio','agosto','settembre','ottobre','novembre','dicembre'],shortMonths:['pr','mag','giu','lug','ago','set','ott','nov','dic'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d/%m/%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},nl_NL:{days:['zondag','maandag','dinsdag','woensdag','donderdag','vrijdag','zaterdag'],shortDays:['zo','ma','di','wo','do','vr','za'],months:['januari','februari','maart','april','mei','juni','juli','augustus','september','oktober','november','december'],shortMonths:['jan','feb','mrt','apr','mei','jun','jul','aug','sep','okt','nov','dec'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d-%m-%y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},pt_BR:{days:['domingo','segunda','ter\xE7a','quarta','quinta','sexta','s\xE1bado'],shortDays:['Dom','Seg','Ter','Qua','Qui','Sex','S\xE1b'],months:['janeiro','fevereiro','mar\xE7o','abril','maio','junho','julho','agosto','setembro','outubro','novembro','dezembro'],shortMonths:['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d-%m-%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},ru_RU:{days:['\u0412\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435','\u041F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A','\u0412\u0442\u043E\u0440\u043D\u0438\u043A','\u0421\u0440\u0435\u0434\u0430','\u0427\u0435\u0442\u0432\u0435\u0440\u0433','\u041F\u044F\u0442\u043D\u0438\u0446\u0430','\u0421\u0443\u0431\u0431\u043E\u0442\u0430'],shortDays:['\u0412\u0441','\u041F\u043D','\u0412\u0442','\u0421\u0440','\u0427\u0442','\u041F\u0442','\u0421\u0431'],months:['\u042F\u043D\u0432\u0430\u0440\u044C','\u0424\u0435\u0432\u0440\u0430\u043B\u044C','\u041C\u0430\u0440\u0442','\u0410\u043F\u0440\u0435\u043B\u044C','\u041C\u0430\u0439','\u0418\u044E\u043D\u044C','\u0418\u044E\u043B\u044C','\u0410\u0432\u0433\u0443\u0441\u0442','\u0421\u0435\u043D\u0442\u044F\u0431\u0440\u044C','\u041E\u043A\u0442\u044F\u0431\u0440\u044C','\u041D\u043E\u044F\u0431\u0440\u044C','\u0414\u0435\u043A\u0430\u0431\u0440\u044C'],shortMonths:['\u044F\u043D\u0432','\u0444\u0435\u0432','\u043C\u0430\u0440','\u0430\u043F\u0440','\u043C\u0430\u0439','\u0438\u044E\u043D','\u0438\u044E\u043B','\u0430\u0432\u0433','\u0441\u0435\u043D','\u043E\u043A\u0442','\u043D\u043E\u044F','\u0434\u0435\u043A'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X',D:'%d.%m.%y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},tr_TR:{days:['Pazar','Pazartesi','Sal\u0131','\xC7ar\u015Famba','Per\u015Fembe','Cuma','Cumartesi'],shortDays:['Paz','Pzt','Sal','\xC7r\u015F','Pr\u015F','Cum','Cts'],months:['Ocak','\u015Eubat','Mart','Nisan','May\u0131s','Haziran','Temmuz','A\u011Fustos','Eyl\xFCl','Ekim','Kas\u0131m','Aral\u0131k'],shortMonths:['Oca','\u015Eub','Mar','Nis','May','Haz','Tem','A\u011Fu','Eyl','Eki','Kas','Ara'],AM:'\xD6\xD6',PM:'\xD6S',am:'\xD6\xD6',pm:'\xD6S',formats:{c:'%a %d %b %Y %X %Z',D:'%d-%m-%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},zh_CN:{days:['\u661F\u671F\u65E5','\u661F\u671F\u4E00','\u661F\u671F\u4E8C','\u661F\u671F\u4E09','\u661F\u671F\u56DB','\u661F\u671F\u4E94','\u661F\u671F\u516D'],shortDays:['\u65E5','\u4E00','\u4E8C','\u4E09','\u56DB','\u4E94','\u516D'],months:['\u4E00\u6708\u4EFD','\u4E8C\u6708\u4EFD','\u4E09\u6708\u4EFD','\u56DB\u6708\u4EFD','\u4E94\u6708\u4EFD','\u516D\u6708\u4EFD','\u4E03\u6708\u4EFD','\u516B\u6708\u4EFD','\u4E5D\u6708\u4EFD','\u5341\u6708\u4EFD','\u5341\u4E00\u6708\u4EFD','\u5341\u4E8C\u6708\u4EFD'],shortMonths:['\u4E00\u6708','\u4E8C\u6708','\u4E09\u6708','\u56DB\u6708','\u4E94\u6708','\u516D\u6708','\u4E03\u6708','\u516B\u6708','\u4E5D\u6708','\u5341\u6708','\u5341\u4E00\u6708','\u5341\u4E8C\u6708'],AM:'\u4E0A\u5348',PM:'\u4E0B\u5348',am:'\u4E0A\u5348',pm:'\u4E0B\u5348',formats:{c:'%a %d %b %Y %X %Z',D:'%d/%m/%y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%r',x:'%D'}}},F=G.en_US,H=new U(F,0,!1),J;'undefined'==typeof T?(J=function(){return this||(1,eval)('this')}(),J.strftime=H):J=T.exports=H,'function'!=typeof Date.now&&(Date.now=function(){return+new Date})})()},function(T){T.exports='function'==typeof Object.create?function(E,N){E.super_=N,E.prototype=Object.create(N.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}})}:function(E,N){E.super_=N;var I=function(){};I.prototype=N.prototype,E.prototype=new I,E.prototype.constructor=E}},function(T){T.exports=function(E){return E&&'object'==typeof E&&'function'==typeof E.copy&&'function'==typeof E.fill&&'function'==typeof E.readUInt8}},function(T,O,U){(function(E,N){function I(xe,Ue){var Ee={seen:[],stylize:P};return 3<=arguments.length&&(Ee.depth=arguments[2]),4<=arguments.length&&(Ee.colors=arguments[3]),W(Ue)?Ee.showHidden=Ue:Ue&&O._extend(Ee,Ue),ae(Ee.showHidden)&&(Ee.showHidden=!1),ae(Ee.depth)&&(Ee.depth=2),ae(Ee.colors)&&(Ee.colors=!1),ae(Ee.customInspect)&&(Ee.customInspect=!0),Ee.colors&&(Ee.stylize=M),V(Ee,xe,Ee.depth)}function M(xe,Ue){var Ee=I.styles[Ue];return Ee?'\x1B['+I.colors[Ee][0]+'m'+xe+'\x1B['+I.colors[Ee][1]+'m':xe}function P(xe){return xe}function K(xe){var Ue={};return xe.forEach(function(Ee){Ue[Ee]=!0}),Ue}function V(xe,Ue,Ee){if(xe.customInspect&&Ue&&_e(Ue.inspect)&&Ue.inspect!==O.inspect&&!(Ue.constructor&&Ue.constructor.prototype===Ue)){var ke=Ue.inspect(Ee,xe);return ee(ke)||(ke=V(xe,ke,Ee)),ke}var ve=G(xe,Ue);if(ve)return ve;var Re=Object.keys(Ue),be=K(Re);if(xe.showHidden&&(Re=Object.getOwnPropertyNames(Ue)),oe(Ue)&&(0<=Re.indexOf('message')||0<=Re.indexOf('description')))return F(Ue);if(0===Re.length){if(_e(Ue)){var Se=Ue.name?': '+Ue.name:'';return xe.stylize('[Function'+Se+']','special')}if(ue(Ue))return xe.stylize(RegExp.prototype.toString.call(Ue),'regexp');if(ne(Ue))return xe.stylize(Date.prototype.toString.call(Ue),'date');if(oe(Ue))return F(Ue)}var Ne='',Ie=!1,Ce=['{','}'];if(q(Ue)&&(Ie=!0,Ce=['[',']']),_e(Ue)){var Me=Ue.name?': '+Ue.name:'';Ne=' [Function'+Me+']'}if(ue(Ue)&&(Ne=' '+RegExp.prototype.toString.call(Ue)),ne(Ue)&&(Ne=' '+Date.prototype.toUTCString.call(Ue)),oe(Ue)&&(Ne=' '+F(Ue)),0===Re.length&&(!Ie||0==Ue.length))return Ce[0]+Ne+Ce[1];if(0>Ee)return ue(Ue)?xe.stylize(RegExp.prototype.toString.call(Ue),'regexp'):xe.stylize('[Object]','special');xe.seen.push(Ue);var Pe;return Pe=Ie?H(xe,Ue,Ee,be,Re):Re.map(function(ye){return Y(xe,Ue,Ee,be,ye,Ie)}),xe.seen.pop(),J(Pe,Ne,Ce)}function G(xe,Ue){if(ae(Ue))return xe.stylize('undefined','undefined');if(ee(Ue)){var Ee='\''+JSON.stringify(Ue).replace(/^"|"$/g,'').replace(/'/g,'\\\'').replace(/\\"/g,'"')+'\'';return xe.stylize(Ee,'string')}return $(Ue)?xe.stylize(''+Ue,'number'):W(Ue)?xe.stylize(''+Ue,'boolean'):Z(Ue)?xe.stylize('null','null'):void 0}function F(xe){return'['+Error.prototype.toString.call(xe)+']'}function H(xe,Ue,Ee,ke,ve){for(var Re=[],be=0,Se=Ue.length;be<Se;++be)ge(Ue,be+'')?Re.push(Y(xe,Ue,Ee,ke,be+'',!0)):Re.push('');return ve.forEach(function(Ne){Ne.match(/^\d+$/)||Re.push(Y(xe,Ue,Ee,ke,Ne,!0))}),Re}function Y(xe,Ue,Ee,ke,ve,Re){var be,Se,Ne;if(Ne=Object.getOwnPropertyDescriptor(Ue,ve)||{value:Ue[ve]},Ne.get?Ne.set?Se=xe.stylize('[Getter/Setter]','special'):Se=xe.stylize('[Getter]','special'):Ne.set&&(Se=xe.stylize('[Setter]','special')),ge(ke,ve)||(be='['+ve+']'),Se||(0>xe.seen.indexOf(Ne.value)?(Se=Z(Ee)?V(xe,Ne.value,null):V(xe,Ne.value,Ee-1),-1<Se.indexOf('\n')&&(Re?Se=Se.split('\n').map(function(Ie){return' '+Ie}).join('\n').substr(2):Se='\n'+Se.split('\n').map(function(Ie){return' '+Ie}).join('\n'))):Se=xe.stylize('[Circular]','special')),ae(be)){if(Re&&ve.match(/^\d+$/))return Se;be=JSON.stringify(''+ve),be.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(be=be.substr(1,be.length-2),be=xe.stylize(be,'name')):(be=be.replace(/'/g,'\\\'').replace(/\\"/g,'"').replace(/(^"|"$)/g,'\''),be=xe.stylize(be,'string'))}return be+': '+Se}function J(xe,Ue,Ee){var ke=0,ve=xe.reduce(function(Re,be){return ke++,0<=be.indexOf('\n')&&ke++,Re+be.replace(/\u001b\[\d\d?m/g,'').length+1},0);return 60<ve?Ee[0]+(''===Ue?'':Ue+'\n ')+' '+xe.join(',\n ')+' '+Ee[1]:Ee[0]+Ue+' '+xe.join(', ')+' '+Ee[1]}function q(xe){return Array.isArray(xe)}function W(xe){return'boolean'==typeof xe}function Z(xe){return null===xe}function $(xe){return'number'==typeof xe}function ee(xe){return'string'==typeof xe}function ae(xe){return void 0===xe}function ue(xe){return se(xe)&&'[object RegExp]'===ce(xe)}function se(xe){return'object'==typeof xe&&null!==xe}function ne(xe){return se(xe)&&'[object Date]'===ce(xe)}function oe(xe){return se(xe)&&('[object Error]'===ce(xe)||xe instanceof Error)}function _e(xe){return'function'==typeof xe}function ce(xe){return Object.prototype.toString.call(xe)}function de(xe){return 10>xe?'0'+xe.toString(10):xe.toString(10)}function Le(){var xe=new Date,Ue=[de(xe.getHours()),de(xe.getMinutes()),de(xe.getSeconds())].join(':');return[xe.getDate(),Oe[xe.getMonth()],Ue].join(' ')}function ge(xe,Ue){return Object.prototype.hasOwnProperty.call(xe,Ue)}var Ae=/%[sdj%]/g;O.format=function(xe){if(!ee(xe)){for(var Ue=[],Ee=0;Ee<arguments.length;Ee++)Ue.push(I(arguments[Ee]));return Ue.join(' ')}for(var Ee=1,ke=arguments,ve=ke.length,Re=(xe+'').replace(Ae,function(Se){if('%%'===Se)return'%';if(Ee>=ve)return Se;switch(Se){case'%s':return ke[Ee++]+'';case'%d':return+ke[Ee++];case'%j':try{return JSON.stringify(ke[Ee++])}catch(Ne){return'[Circular]'}default:return Se;}}),be=ke[Ee];Ee<ve;be=ke[++Ee])Re+=Z(be)||!se(be)?' '+be:' '+I(be);return Re},O.deprecate=function(xe,Ue){if(ae(E.process))return function(){return O.deprecate(xe,Ue).apply(this,arguments)};if(!0===N.noDeprecation)return xe;var ke=!1;return function(){if(!ke){if(N.throwDeprecation)throw new Error(Ue);else N.traceDeprecation?console.trace(Ue):console.error(Ue);ke=!0}return xe.apply(this,arguments)}};var Te={},he;O.debuglog=function(xe){if(ae(he)&&(he=N.env.NODE_DEBUG||''),xe=xe.toUpperCase(),!Te[xe])if(new RegExp('\\b'+xe+'\\b','i').test(he)){var Ue=N.pid;Te[xe]=function(){var Ee=O.format.apply(O,arguments);console.error('%s %d: %s',xe,Ue,Ee)}}else Te[xe]=function(){};return Te[xe]},O.inspect=I,I.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},I.styles={special:'cyan',number:'yellow',boolean:'yellow',undefined:'grey','null':'bold',string:'green',date:'magenta',regexp:'red'},O.isArray=q,O.isBoolean=W,O.isNull=Z,O.isNullOrUndefined=function(xe){return null==xe},O.isNumber=$,O.isString=ee,O.isSymbol=function(xe){return'symbol'==typeof xe},O.isUndefined=ae,O.isRegExp=ue,O.isObject=se,O.isDate=ne,O.isError=oe,O.isFunction=_e,O.isPrimitive=function(xe){return null===xe||'boolean'==typeof xe||'number'==typeof xe||'string'==typeof xe||'symbol'==typeof xe||'undefined'==typeof xe},O.isBuffer=U(44);var Oe=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];O.log=function(){console.log('%s - %s',Le(),O.format.apply(O,arguments))},O.inherits=U(43),O._extend=function(xe,Ue){if(!Ue||!se(Ue))return xe;for(var Ee=Object.keys(Ue),ke=Ee.length;ke--;)xe[Ee[ke]]=Ue[Ee[ke]];return xe}}).call(O,U(22),U(18))},function(T){function U(E){throw new Error('Cannot find module \''+E+'\'.')}U.keys=function(){return[]},U.resolve=U,T.exports=U,U.id=46},function(T,O,U){'use strict';const E=U(2),N=U(6);T.exports.lua=E,T.exports.lauxlib=N},function(T,O,U){'use strict';(function(E){const N=U(2),I=U(6),q=function(Ae,Te,he,Oe){return I.luaL_checkany(Ae,1),I.luaL_getmetafield(Ae,1,Te)===N.LUA_TNIL?(N.lua_pushcfunction(Ae,Oe),N.lua_pushvalue(Ae,1),he?N.lua_pushinteger(Ae,0):N.lua_pushnil(Ae)):(N.lua_pushvalue(Ae,1),N.lua_call(Ae,1,3)),3},W=function(Ae){return I.luaL_checktype(Ae,1,N.LUA_TTABLE),N.lua_settop(Ae,2),N.lua_next(Ae,1)?2:(N.lua_pushnil(Ae),1)},Q=function(Ae){let Te=I.luaL_checkinteger(Ae,2)+1;return N.lua_pushinteger(Ae,Te),N.lua_geti(Ae,1,Te)===N.LUA_TNIL?1:2},te=function(Ae){let Te=I.luaL_optinteger(Ae,2,1);return N.lua_settop(Ae,1),N.lua_type(Ae,1)===N.LUA_TSTRING&&0<Te&&(I.luaL_where(Ae,Te),N.lua_pushvalue(Ae,1),N.lua_concat(Ae,2)),N.lua_error(Ae)},se=function(Ae,Te,he){return Te!==N.LUA_OK&&Te!==N.LUA_YIELD?(N.lua_pushboolean(Ae,0),N.lua_pushvalue(Ae,-2),2):N.lua_gettop(Ae)-he},_e=function(Ae,Te,he){return Te===N.LUA_OK?(0!==he&&(N.lua_pushvalue(Ae,he),!N.lua_setupvalue(Ae,-2,1)&&N.lua_pop(Ae,1)),1):(N.lua_pushnil(Ae),N.lua_insert(Ae,-2),2)},pe=5,ce=function(Ae){return(I.luaL_checkstack(Ae,2,N.to_luastring('too many nested functions',!0)),N.lua_pushvalue(Ae,1),N.lua_call(Ae,0,1),N.lua_isnil(Ae,-1))?(N.lua_pop(Ae,1),null):(N.lua_isstring(Ae,-1)||I.luaL_error(Ae,N.to_luastring('reader function must return a string',!0)),N.lua_replace(Ae,pe),N.lua_tostring(Ae,pe))},Le={collectgarbage:function(){return 0},assert:function(Ae){return N.lua_toboolean(Ae,1)?N.lua_gettop(Ae):(I.luaL_checkany(Ae,1),N.lua_remove(Ae,1),N.lua_pushliteral(Ae,'assertion failed!'),N.lua_settop(Ae,1),te(Ae))},error:te,getmetatable:function(Ae){return(I.luaL_checkany(Ae,1),!N.lua_getmetatable(Ae,1))?(N.lua_pushnil(Ae),1):(I.luaL_getmetafield(Ae,1,N.to_luastring('__metatable',!0)),1)},ipairs:function(Ae){return I.luaL_checkany(Ae,1),N.lua_pushcfunction(Ae,Q),N.lua_pushvalue(Ae,1),N.lua_pushinteger(Ae,0),3},load:function(Ae){let Te=N.lua_tostring(Ae,1),he=I.luaL_optstring(Ae,3,N.to_luastring('bt',!0)),Oe=N.lua_isnone(Ae,4)?0:4,xe;if(null!==Te){let Ue=I.luaL_optstring(Ae,2,Te);xe=I.luaL_loadbufferx(Ae,Te,Te.length,Ue,he)}else{let Ue=I.luaL_optstring(Ae,2,N.to_luastring('=(load)',!0));I.luaL_checktype(Ae,1,N.LUA_TFUNCTION),N.lua_settop(Ae,pe),xe=N.lua_load(Ae,ce,null,Ue,he)}return _e(Ae,xe,Oe)},next:W,pairs:function(Ae){return q(Ae,N.to_luastring('__pairs',!0),0,W)},pcall:function(Ae){I.luaL_checkany(Ae,1),N.lua_pushboolean(Ae,1),N.lua_insert(Ae,1);let Te=N.lua_pcallk(Ae,N.lua_gettop(Ae)-2,N.LUA_MULTRET,0,0,se);return se(Ae,Te,0)},print:function(Ae){let Te=N.lua_gettop(Ae),he=[];N.lua_getglobal(Ae,N.to_luastring('tostring',!0));for(let Oe=1;Oe<=Te;Oe++){N.lua_pushvalue(Ae,-1),N.lua_pushvalue(Ae,Oe),N.lua_call(Ae,1,1);let xe=N.lua_tolstring(Ae,-1);if(null===xe)return I.luaL_error(Ae,N.to_luastring('\'tostring\' must return a string to \'print\'',!0));1<Oe&&(xe=['\t'.charCodeAt(0)].concat(xe)),he=he.concat(xe),N.lua_pop(Ae,1)}return E.stdout?E.stdout.write(N.to_jsstring(he)+'\n'):console.log(N.to_jsstring(he)),0},rawequal:function(Ae){return I.luaL_checkany(Ae,1),I.luaL_checkany(Ae,2),N.lua_pushboolean(Ae,N.lua_rawequal(Ae,1,2)),1},rawget:function(Ae){return I.luaL_checktype(Ae,1,N.LUA_TTABLE),I.luaL_checkany(Ae,2),N.lua_settop(Ae,2),N.lua_rawget(Ae,1),1},rawlen:function(Ae){let Te=N.lua_type(Ae,1);return I.luaL_argcheck(Ae,Te===N.LUA_TTABLE||Te===N.LUA_TSTRING,1,N.to_luastring('table or string expected',!0)),N.lua_pushinteger(Ae,N.lua_rawlen(Ae,1)),1},rawset:function(Ae){return I.luaL_checktype(Ae,1,N.LUA_TTABLE),I.luaL_checkany(Ae,2),I.luaL_checkany(Ae,3),N.lua_settop(Ae,3),N.lua_rawset(Ae,1),1},select:function(Ae){let Te=N.lua_gettop(Ae);if(N.lua_type(Ae,1)===N.LUA_TSTRING&&N.lua_tostring(Ae,1)[0]==='#'.charCodeAt(0))return N.lua_pushinteger(Ae,Te-1),1;let he=I.luaL_checkinteger(Ae,1);return 0>he?he=Te+he:he>Te&&(he=Te),I.luaL_argcheck(Ae,1<=he,1,N.to_luastring('index out of range',!0)),Te-he},setmetatable:function(Ae){let Te=N.lua_type(Ae,2);return(I.luaL_checktype(Ae,1,N.LUA_TTABLE),I.luaL_argcheck(Ae,Te===N.LUA_TNIL||Te===N.LUA_TTABLE,2,N.to_luastring('nil or table expected',!0)),I.luaL_getmetafield(Ae,1,N.to_luastring('__metatable',!0))!==N.LUA_TNIL)?I.luaL_error(Ae,N.to_luastring('cannot change a protected metatable',!0)):(N.lua_settop(Ae,2),N.lua_setmetatable(Ae,1),1)},tonumber:function(Ae){if(0>=N.lua_type(Ae,2)){if(I.luaL_checkany(Ae,1),N.lua_type(Ae,1)===N.LUA_TNUMBER)return N.lua_settop(Ae,1),1;let Te=N.lua_tostring(Ae,1);if(null!==Te&&N.lua_stringtonumber(Ae,Te)===Te.length)return 1}else{let Te=I.luaL_checkinteger(Ae,2);I.luaL_checktype(Ae,1,N.LUA_TSTRING);let he=N.lua_tostring(Ae,1);I.luaL_argcheck(Ae,2<=Te&&36>=Te,2,N.to_luastring('base out of range',!0));let Oe=parseInt(N.to_jsstring(he),Te);if(!isNaN(Oe))return N.lua_pushinteger(Ae,Oe),1}return N.lua_pushnil(Ae),1},tostring:function(Ae){return I.luaL_checkany(Ae,1),I.luaL_tolstring(Ae,1),1},type:function(Ae){let Te=N.lua_type(Ae,1);return I.luaL_argcheck(Ae,Te!==N.LUA_TNONE,1,N.to_luastring('value expected',!0)),N.lua_pushstring(Ae,N.lua_typename(Ae,Te)),1},xpcall:function(Ae){let Te=N.lua_gettop(Ae);I.luaL_checktype(Ae,2,N.LUA_TFUNCTION),N.lua_pushboolean(Ae,1),N.lua_pushvalue(Ae,1),N.lua_rotate(Ae,3,2);let he=N.lua_pcallk(Ae,Te-2,N.LUA_MULTRET,2,2,se);return se(Ae,he,2)}};T.exports.luaopen_base=function(Ae){return N.lua_pushglobaltable(Ae),I.luaL_setfuncs(Ae,Le,0),N.lua_pushvalue(Ae,-1),N.lua_setfield(Ae,-2,N.to_luastring('_G',!0)),N.lua_pushliteral(Ae,N.LUA_VERSION),N.lua_setfield(Ae,-2,N.to_luastring('_VERSION',!0)),1}}).call(O,U(18))},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(19),M=U(5),P=U(20),K=U(29),V=U(7),G=U(10),F=U(16),H=U(17),Y=N.CT,J=P.OpCodesI,q=M.TValue,W=function(Et,kt,vt,Rt,bt){switch(kt){case N.LUA_OPBAND:case N.LUA_OPBOR:case N.LUA_OPBXOR:case N.LUA_OPSHL:case N.LUA_OPSHR:case N.LUA_OPBNOT:{let St=H.tointeger(vt),Nt=H.tointeger(Rt);if(!1!==St&&!1!==Nt)return bt.type=Y.LUA_TNUMINT,void(bt.value=M.intarith(Et,kt,St,Nt));break}case N.LUA_OPDIV:case N.LUA_OPPOW:{let St=H.tonumber(vt),Nt=H.tonumber(Rt);if(!1!==St&&!1!==Nt)return bt.type=Y.LUA_TNUMFLT,void(bt.value=M.numarith(Et,kt,St,Nt));break}default:{let St=H.tonumber(vt),Nt=H.tonumber(Rt);if(vt.ttisinteger()&&Rt.ttisinteger())return bt.type=Y.LUA_TNUMINT,void(bt.value=M.intarith(Et,kt,vt.value,Rt.value));if(!1!==St&&!1!==Nt)return bt.type=Y.LUA_TNUMFLT,void(bt.value=M.numarith(Et,kt,St,Nt));break}}E(null!==Et),F.luaT_trybinTM(Et,vt,Rt,bt,kt-N.LUA_OPADD+F.TMS.TM_ADD)},Q=-1,$={OPR_ADD:0,OPR_SUB:1,OPR_MUL:2,OPR_MOD:3,OPR_POW:4,OPR_DIV:5,OPR_IDIV:6,OPR_BAND:7,OPR_BOR:8,OPR_BXOR:9,OPR_SHL:10,OPR_SHR:11,OPR_CONCAT:12,OPR_EQ:13,OPR_LT:14,OPR_LE:15,OPR_NE:16,OPR_GT:17,OPR_GE:18,OPR_AND:19,OPR_OR:20,OPR_NOBINOPR:21},ee={OPR_MINUS:0,OPR_BNOT:1,OPR_NOT:2,OPR_LEN:3,OPR_NOUNOPR:4},te=function(Et){return Et.t!==Et.f},ae=function(Et,kt){let vt=K.expkind;if(te(Et))return!1;switch(Et.k){case vt.VKINT:return kt&&(kt.type=Y.LUA_TNUMINT,kt.value=Et.u.ival),!0;case vt.VKFLT:return kt&&(kt.type=Y.LUA_TNUMFLT,kt.value=Et.u.nval),!0;default:return!1;}},ue=function(Et,kt,vt){let bt=kt+vt-1,Rt;if(Et.pc>Et.lasttarget&&(Rt=Et.f.code[Et.pc-1],Rt.opcode===J.OP_LOADNIL)){let St=Rt.A,Nt=St+Rt.B;if(St<=kt&&kt<=Nt+1||kt<=St&&St<=bt+1)return St<kt&&(kt=St),Nt>bt&&(bt=Nt),P.SETARG_A(Rt,kt),void P.SETARG_B(Rt,bt-kt)}Re(Et,J.OP_LOADNIL,kt,vt-1,0)},se=function(Et,kt){return Et.f.code[kt.u.info]},ne=function(Et,kt){let vt=Et.f.code[kt].sBx;return vt===Q?Q:kt+1+vt},oe=function(Et,kt,vt){let Rt=Et.f.code[kt],bt=vt-(kt+1);E(vt!==Q),_Mathabs(bt)>P.MAXARG_sBx&&I.luaX_syntaxerror(Et.ls,N.to_luastring('control structure too long',!0)),P.SETARG_sBx(Rt,bt)},_e=function(Et,kt,vt){if(vt===Q)return kt;if(kt===Q)kt=vt;else{let Rt=kt,bt=ne(Et,Rt);for(;bt!==Q;)Rt=bt,bt=ne(Et,Rt);oe(Et,Rt,vt)}return kt},pe=function(Et){let kt=Et.jpc;Et.jpc=Q;let vt=Se(Et,J.OP_JMP,0,Q);return vt=_e(Et,vt,kt),vt},Le=function(Et,kt,vt,Rt,bt){return Re(Et,kt,vt,Rt,bt),pe(Et)},ge=function(Et){return Et.lasttarget=Et.pc,Et.pc},Ae=function(Et,kt){return 1<=kt&&P.testTMode(Et.f.code[kt-1].opcode)?Et.f.code[kt-1]:Et.f.code[kt]},Te=function(Et,kt,vt){let Rt=Ae(Et,kt);return Rt.opcode===J.OP_TESTSET&&(vt!==P.NO_REG&&vt!==Rt.B?P.SETARG_A(Rt,vt):Rt=P.CREATE_ABC(J.OP_TEST,Rt.B,0,Rt.C),!0)},he=function(Et,kt){for(;kt!==Q;kt=ne(Et,kt))Te(Et,kt,P.NO_REG)},Oe=function(Et,kt,vt,Rt,bt){for(;kt!==Q;){let St=ne(Et,kt);Te(Et,kt,Rt)?oe(Et,kt,vt):oe(Et,kt,bt),kt=St}},xe=function(Et){Oe(Et,Et.jpc,Et.pc,P.NO_REG,Et.pc),Et.jpc=Q},Ue=function(Et,kt){ge(Et),Et.jpc=_e(Et,Et.jpc,kt)},Ee=function(Et,kt,vt){vt===Et.pc?Ue(Et,kt):(E(vt<Et.pc),Oe(Et,kt,vt,P.NO_REG,vt))},ve=function(Et,kt){let vt=Et.f;return xe(Et),vt.code[Et.pc]=kt,vt.lineinfo[Et.pc]=Et.ls.lastline,Et.pc++},Re=function(Et,kt,vt,Rt,bt){return E(P.getOpMode(kt)===P.iABC),E(P.getBMode(kt)!==P.OpArgN||0===Rt),E(P.getCMode(kt)!==P.OpArgN||0===bt),E(vt<=P.MAXARG_A&&Rt<=P.MAXARG_B&&bt<=P.MAXARG_C),ve(Et,P.CREATE_ABC(kt,vt,Rt,bt))},be=function(Et,kt,vt,Rt){return E(P.getOpMode(kt)===P.iABx||P.getOpMode(kt)===P.iAsBx),E(P.getCMode(kt)===P.OpArgN),E(vt<=P.MAXARG_A&&Rt<=P.MAXARG_Bx),ve(Et,P.CREATE_ABx(kt,vt,Rt))},Se=function(Et,kt,vt,Rt){return be(Et,kt,vt,Rt+P.MAXARG_sBx)},Ne=function(Et,kt){return E(kt<=P.MAXARG_Ax),ve(Et,P.CREATE_Ax(J.OP_EXTRAARG,kt))},Ie=function(Et,kt,vt){if(vt<=P.MAXARG_Bx)return be(Et,J.OP_LOADK,kt,vt);let Rt=be(Et,J.OP_LOADKX,kt,0);return Ne(Et,vt),Rt},Ce=function(Et,kt){let vt=Et.freereg+kt;vt>Et.f.maxstacksize&&(255<=vt&&I.luaX_syntaxerror(Et.ls,N.to_luastring('function or expression needs to many registers',!0)),Et.f.maxstacksize=vt)},Me=function(Et,kt){Ce(Et,kt),Et.freereg+=kt},Pe=function(Et,kt){!P.ISK(kt)&&kt>=Et.nactvar&&(Et.freereg--,E(kt===Et.freereg))},ye=function(Et,kt){kt.k===K.expkind.VNONRELOC&&Pe(Et,kt.u.info)},De=function(Et,kt,vt){let Rt=kt.k===K.expkind.VNONRELOC?kt.u.info:-1,bt=vt.k===K.expkind.VNONRELOC?vt.u.info:-1;Rt>bt?(Pe(Et,Rt),Pe(Et,bt)):(Pe(Et,bt),Pe(Et,Rt))},Ke=function(Et,kt,vt){let Rt=Et.f,bt=G.luaH_set(Et.ls.h,kt);if(bt.ttisinteger()){let Nt=bt.value;if(Nt<Et.nk&&Rt.k[Nt].ttype()===vt.ttype()&&Rt.k[Nt].value===vt.value)return Nt}let St=Et.nk;return bt.setivalue(St),Rt.k[St]=vt,Et.nk++,St},Ve=function(Et,kt){let vt=new q(Y.LUA_TLNGSTR,V.luaS_bless(Et.L,N.to_luastring(`${kt}`))),Rt=new q(Y.LUA_TNUMINT,kt);return Ke(Et,vt,Rt)},Ge=function(Et,kt){let vt=new q(Y.LUA_TNUMFLT,kt);return Ke(Et,vt,vt)},we=function(Et,kt){let vt=new q(Y.LUA_TBOOLEAN,kt);return Ke(Et,vt,vt)},Fe=function(Et){let kt=new q(Y.LUA_TNIL,null),vt=new q(Y.LUA_TTABLE,Et.ls.h);return Ke(Et,vt,kt)},Xe=function(Et,kt,vt){let Rt=K.expkind;if(kt.k===Rt.VCALL)P.SETARG_C(se(Et,kt),vt+1);else if(kt.k===Rt.VVARARG){let bt=se(Et,kt);P.SETARG_B(bt,vt+1),P.SETARG_A(bt,Et.freereg),Me(Et,1)}else E(vt===N.LUA_MULTRET)},je=function(Et,kt){let vt=K.expkind;kt.k===vt.VCALL?(E(2===se(Et,kt).C),kt.k=vt.VNONRELOC,kt.u.info=se(Et,kt).A):kt.k===vt.VVARARG&&(P.SETARG_B(se(Et,kt),2),kt.k=vt.VRELOCABLE)},ze=function(Et,kt){let vt=K.expkind;switch(kt.k){case vt.VLOCAL:{kt.k=vt.VNONRELOC;break}case vt.VUPVAL:{kt.u.info=Re(Et,J.OP_GETUPVAL,0,kt.u.info,0),kt.k=vt.VRELOCABLE;break}case vt.VINDEXED:{let Rt;Pe(Et,kt.u.ind.idx),kt.u.ind.vt===vt.VLOCAL?(Pe(Et,kt.u.ind.t),Rt=J.OP_GETTABLE):(E(kt.u.ind.vt===vt.VUPVAL),Rt=J.OP_GETTABUP),kt.u.info=Re(Et,Rt,0,kt.u.ind.t,kt.u.ind.idx),kt.k=vt.VRELOCABLE;break}case vt.VVARARG:case vt.VCALL:{je(Et,kt);break}default:}},Ye=function(Et,kt,vt,Rt){return ge(Et),Re(Et,J.OP_LOADBOOL,kt,vt,Rt)},Je=function(Et,kt,vt){let Rt=K.expkind;switch(ze(Et,kt),kt.k){case Rt.VNIL:{ue(Et,vt,1);break}case Rt.VFALSE:case Rt.VTRUE:{Re(Et,J.OP_LOADBOOL,vt,kt.k===Rt.VTRUE,0);break}case Rt.VK:{Ie(Et,vt,kt.u.info);break}case Rt.VKFLT:{Ie(Et,vt,Ge(Et,kt.u.nval));break}case Rt.VKINT:{Ie(Et,vt,Ve(Et,kt.u.ival));break}case Rt.VRELOCABLE:{let bt=se(Et,kt);P.SETARG_A(bt,vt);break}case Rt.VNONRELOC:{vt!==kt.u.info&&Re(Et,J.OP_MOVE,vt,kt.u.info,0);break}default:return void E(kt.k===Rt.VJMP);}kt.u.info=vt,kt.k=Rt.VNONRELOC},qe=function(Et,kt){kt.k!==K.expkind.VNONRELOC&&(Me(Et,1),Je(Et,kt,Et.freereg-1))},We=function(Et,kt){for(;kt!==Q;kt=ne(Et,kt)){let vt=Ae(Et,kt);if(vt.opcode!==J.OP_TESTSET)return!0}return!1},Ze=function(Et,kt,vt){let Rt=K.expkind;if(Je(Et,kt,vt),kt.k===Rt.VJMP&&(kt.t=_e(Et,kt.t,kt.u.info)),te(kt)){let St=Q,Nt=Q,bt;if(We(Et,kt.t)||We(Et,kt.f)){let It=kt.k===Rt.VJMP?Q:pe(Et);St=Ye(Et,vt,0,1),Nt=Ye(Et,vt,1,0),Ue(Et,It)}bt=ge(Et),Oe(Et,kt.f,bt,vt,St),Oe(Et,kt.t,bt,vt,Nt)}kt.f=kt.t=Q,kt.u.info=vt,kt.k=Rt.VNONRELOC},Qe=function(Et,kt){ze(Et,kt),ye(Et,kt),Me(Et,1),Ze(Et,kt,Et.freereg-1)},$e=function(Et,kt){if(ze(Et,kt),kt.k===K.expkind.VNONRELOC){if(!te(kt))return kt.u.info;if(kt.u.info>=Et.nactvar)return Ze(Et,kt,kt.u.info),kt.u.info}return Qe(Et,kt),kt.u.info},at=function(Et,kt){te(kt)?$e(Et,kt):ze(Et,kt)},lt=function(Et,kt){let vt=K.expkind,Rt=!1;switch(at(Et,kt),kt.k){case vt.VTRUE:kt.u.info=we(Et,1),Rt=!0;break;case vt.VFALSE:kt.u.info=we(Et,0),Rt=!0;break;case vt.VNIL:kt.u.info=Fe(Et),Rt=!0;break;case vt.VKINT:kt.u.info=Ve(Et,kt.u.ival),Rt=!0;break;case vt.VKFLT:kt.u.info=Ge(Et,kt.u.nval),Rt=!0;break;case vt.VK:Rt=!0;break;default:}return Rt&&(kt.k=vt.VK,kt.u.info<=P.MAXINDEXRK)?P.RKASK(kt.u.info):$e(Et,kt)},st=function(Et,kt){let vt=Ae(Et,kt.u.info);E(P.testTMode(vt.opcode)&&vt.opcode!==J.OP_TESTSET&&vt.opcode!==J.OP_TEST),P.SETARG_A(vt,!vt.A)},nt=function(Et,kt,vt){if(kt.k===K.expkind.VRELOCABLE){let Rt=se(Et,kt);if(Rt.opcode===J.OP_NOT)return Et.pc--,Le(Et,J.OP_TEST,Rt.B,0,!vt)}return qe(Et,kt),ye(Et,kt),Le(Et,J.OP_TESTSET,P.NO_REG,kt.u.info,vt)},ot=function(Et,kt){let vt=K.expkind,Rt;switch(ze(Et,kt),kt.k){case vt.VJMP:{st(Et,kt),Rt=kt.u.info;break}case vt.VK:case vt.VKFLT:case vt.VKINT:case vt.VTRUE:{Rt=Q;break}default:{Rt=nt(Et,kt,0);break}}kt.f=_e(Et,kt.f,Rt),Ue(Et,kt.t),kt.t=Q},_t=function(Et,kt){let vt=K.expkind,Rt;switch(ze(Et,kt),kt.k){case vt.VJMP:{Rt=kt.u.info;break}case vt.VNIL:case vt.VFALSE:{Rt=Q;break}default:{Rt=nt(Et,kt,1);break}}kt.t=_e(Et,kt.t,Rt),Ue(Et,kt.f),kt.f=Q},it=function(Et,kt){let vt=K.expkind;switch(ze(Et,kt),kt.k){case vt.VNIL:case vt.VFALSE:{kt.k=vt.VTRUE;break}case vt.VK:case vt.VKFLT:case vt.VKINT:case vt.VTRUE:{kt.k=vt.VFALSE;break}case vt.VJMP:{st(Et,kt);break}case vt.VRELOCABLE:case vt.VNONRELOC:{qe(Et,kt),ye(Et,kt),kt.u.info=Re(Et,J.OP_NOT,0,kt.u.info,0),kt.k=vt.VRELOCABLE;break}}{let Rt=kt.f;kt.f=kt.t,kt.t=Rt}he(Et,kt.f),he(Et,kt.t)},ct=function(Et,kt,vt){return Et===N.LUA_OPBAND||Et===N.LUA_OPBOR||Et===N.LUA_OPBXOR||Et===N.LUA_OPSHL||Et===N.LUA_OPSHR||Et===N.LUA_OPBNOT?H.tointeger(kt)&&H.tointeger(vt):Et===N.LUA_OPDIV||Et===N.LUA_OPIDIV||Et===N.LUA_OPMOD?0!==vt.value:1},dt=function(Et,kt,vt,Rt){let bt=K.expkind,St=new q,Nt=new q,It=new q;if(!ae(vt,St)||!ae(Rt,Nt)||!ct(kt,St,Nt))return 0;if(W(Et.ls.L,kt,St,Nt,It),It.ttisinteger())vt.k=bt.VKINT,vt.u.ival=It.value;else{let Ct=It.value;if(isNaN(Ct)||0===Ct)return!1;vt.k=bt.VKFLT,vt.u.nval=Ct}return!0},Lt=function(Et,kt,vt,Rt){let bt=$e(Et,vt);ye(Et,vt),vt.u.info=Re(Et,kt,0,bt,0),vt.k=K.expkind.VRELOCABLE,xt(Et,Rt)},ft=function(Et,kt,vt,Rt,bt){let St=lt(Et,Rt),Nt=lt(Et,vt);De(Et,vt,Rt),vt.u.info=Re(Et,kt,0,Nt,St),vt.k=K.expkind.VRELOCABLE,xt(Et,bt)},At=function(Et,kt,vt,Rt){let bt=K.expkind,St;vt.k===bt.VK?St=P.RKASK(vt.u.info):(E(vt.k===bt.VNONRELOC),St=vt.u.info);let Nt=lt(Et,Rt);switch(De(Et,vt,Rt),kt){case $.OPR_NE:{vt.u.info=Le(Et,J.OP_EQ,0,St,Nt);break}case $.OPR_GT:case $.OPR_GE:{let It=kt-$.OPR_NE+J.OP_EQ;vt.u.info=Le(Et,It,1,Nt,St);break}default:{let It=kt-$.OPR_EQ+J.OP_EQ;vt.u.info=Le(Et,It,1,St,Nt);break}}vt.k=bt.VJMP},xt=function(Et,kt){Et.f.lineinfo[Et.pc-1]=kt};T.exports.BinOpr=$,T.exports.NO_JUMP=Q,T.exports.UnOpr=ee,T.exports.getinstruction=se,T.exports.luaK_checkstack=Ce,T.exports.luaK_code=ve,T.exports.luaK_codeABC=Re,T.exports.luaK_codeABx=be,T.exports.luaK_codeAsBx=Se,T.exports.luaK_codek=Ie,T.exports.luaK_concat=_e,T.exports.luaK_dischargevars=ze,T.exports.luaK_exp2RK=lt,T.exports.luaK_exp2anyreg=$e,T.exports.luaK_exp2anyregup=function(Et,kt){(kt.k!==K.expkind.VUPVAL||te(kt))&&$e(Et,kt)},T.exports.luaK_exp2nextreg=Qe,T.exports.luaK_exp2val=at,T.exports.luaK_fixline=xt,T.exports.luaK_getlabel=ge,T.exports.luaK_goiffalse=_t,T.exports.luaK_goiftrue=ot,T.exports.luaK_indexed=function(Et,kt,vt){let Rt=K.expkind;E(!te(kt)&&(K.vkisinreg(kt.k)||kt.k===Rt.VUPVAL)),kt.u.ind.t=kt.u.info,kt.u.ind.idx=lt(Et,vt),kt.u.ind.vt=kt.k===Rt.VUPVAL?Rt.VUPVAL:Rt.VLOCAL,kt.k=Rt.VINDEXED},T.exports.luaK_infix=function(Et,kt,vt){switch(kt){case $.OPR_AND:{ot(Et,vt);break}case $.OPR_OR:{_t(Et,vt);break}case $.OPR_CONCAT:{Qe(Et,vt);break}case $.OPR_ADD:case $.OPR_SUB:case $.OPR_MUL:case $.OPR_DIV:case $.OPR_IDIV:case $.OPR_MOD:case $.OPR_POW:case $.OPR_BAND:case $.OPR_BOR:case $.OPR_BXOR:case $.OPR_SHL:case $.OPR_SHR:{ae(vt,null)||lt(Et,vt);break}default:{lt(Et,vt);break}}},T.exports.luaK_intK=Ve,T.exports.luaK_jump=pe,T.exports.luaK_jumpto=function(Et,kt){return Ee(Et,pe(Et),kt)},T.exports.luaK_nil=ue,T.exports.luaK_numberK=Ge,T.exports.luaK_patchclose=function(Et,kt,vt){for(vt++;kt!==Q;kt=ne(Et,kt)){let Rt=Et.f.code[kt];E(Rt.opcode===J.OP_JMP&&(0===Rt.A||Rt.A>=vt)),P.SETARG_A(Rt,vt)}},T.exports.luaK_patchlist=Ee,T.exports.luaK_patchtohere=Ue,T.exports.luaK_posfix=function(Et,kt,vt,Rt,bt){let St=K.expkind;switch(kt){case $.OPR_AND:{E(vt.t===Q),ze(Et,Rt),Rt.f=_e(Et,Rt.f,vt.f),vt.to(Rt);break}case $.OPR_OR:{E(vt.f===Q),ze(Et,Rt),Rt.t=_e(Et,Rt.t,vt.t),vt.to(Rt);break}case $.OPR_CONCAT:{let Nt=se(Et,Rt);at(Et,Rt),Rt.k===St.VRELOCABLE&&Nt.opcode===J.OP_CONCAT?(E(vt.u.info===Nt.B-1),ye(Et,vt),P.SETARG_B(Nt,vt.u.info),vt.k=St.VRELOCABLE,vt.u.info=Rt.u.info):(Qe(Et,Rt),ft(Et,J.OP_CONCAT,vt,Rt,bt));break}case $.OPR_ADD:case $.OPR_SUB:case $.OPR_MUL:case $.OPR_DIV:case $.OPR_IDIV:case $.OPR_MOD:case $.OPR_POW:case $.OPR_BAND:case $.OPR_BOR:case $.OPR_BXOR:case $.OPR_SHL:case $.OPR_SHR:{dt(Et,kt+N.LUA_OPADD,vt,Rt)||ft(Et,kt+J.OP_ADD,vt,Rt,bt);break}case $.OPR_EQ:case $.OPR_LT:case $.OPR_LE:case $.OPR_NE:case $.OPR_GT:case $.OPR_GE:{At(Et,kt,vt,Rt);break}}return vt},T.exports.luaK_prefix=function(Et,kt,vt,Rt){let bt=new K.expdesc;switch(bt.k=K.expkind.VKINT,bt.u.ival=bt.u.nval=bt.u.info=0,bt.t=Q,bt.f=Q,kt){case ee.OPR_MINUS:case ee.OPR_BNOT:if(dt(Et,kt+N.LUA_OPUNM,vt,bt))break;case ee.OPR_LEN:Lt(Et,kt+J.OP_UNM,vt,Rt);break;case ee.OPR_NOT:it(Et,vt);}},T.exports.luaK_reserveregs=Me,T.exports.luaK_ret=function(Et,kt,vt){Re(Et,J.OP_RETURN,kt,vt+1,0)},T.exports.luaK_self=function(Et,kt,vt){$e(Et,kt);let Rt=kt.u.info;ye(Et,kt),kt.u.info=Et.freereg,kt.k=K.expkind.VNONRELOC,Me(Et,2),Re(Et,J.OP_SELF,kt.u.info,Rt,lt(Et,vt)),ye(Et,vt)},T.exports.luaK_setlist=function(Et,kt,vt,Rt){let bt=(vt-1)/P.LFIELDS_PER_FLUSH+1,St=Rt===N.LUA_MULTRET?0:Rt;E(0!==Rt&&Rt<=P.LFIELDS_PER_FLUSH),bt<=P.MAXARG_C?Re(Et,J.OP_SETLIST,kt,St,bt):bt<=P.MAXARG_Ax?(Re(Et,J.OP_SETLIST,kt,St,0),Ne(Et,bt)):I.luaX_syntaxerror(Et.ls,N.to_luastring('constructor too long',!0)),Et.freereg=kt+1},T.exports.luaK_setmultret=function(Et,kt){Xe(Et,kt,N.LUA_MULTRET)},T.exports.luaK_setoneret=je,T.exports.luaK_setreturns=Xe,T.exports.luaK_storevar=function(Et,kt,vt){let Rt=K.expkind;switch(kt.k){case Rt.VLOCAL:return ye(Et,vt),void Ze(Et,vt,kt.u.info);case Rt.VUPVAL:{let bt=$e(Et,vt);Re(Et,J.OP_SETUPVAL,bt,kt.u.info,0);break}case Rt.VINDEXED:{let bt=kt.u.ind.vt===Rt.VLOCAL?J.OP_SETTABLE:J.OP_SETTABUP,St=lt(Et,vt);Re(Et,bt,kt.u.ind.t,kt.u.ind.idx,St);break}}ye(Et,vt)},T.exports.luaK_stringK=function(Et,kt){let vt=new q(Y.LUA_TLNGSTR,kt);return Ke(Et,vt,vt)}},function(T,O,U){'use strict';const E=U(1),N=E.constant_types,K=16*_NumberparseInt(E.LUA_VERSION_MAJOR)+_NumberparseInt(E.LUA_VERSION_MINOR);class G{constructor(){this.L=null,this.write=null,this.data=null,this.strip=NaN,this.status=NaN}}const F=function(oe,_e,pe){0===pe.status&&0<_e&&(pe.status=pe.writer(pe.L,oe,_e,pe.data))},H=function(oe,_e){oe=E.to_luastring(oe),F(oe,oe.length,_e)},Y=function(oe,_e){F([oe],1,_e)},J=function(oe,_e){let pe=new DataView(new ArrayBuffer(4));pe.setInt32(0,oe,!0);let ce=[];for(let de=0;4>de;de++)ce.push(pe.getUint8(de,!0));F(ce,4,_e)},q=function(oe,_e){let pe=new DataView(new ArrayBuffer(4));pe.setInt32(0,oe,!0);let ce=[];for(let de=0;4>de;de++)ce.push(pe.getUint8(de,!0));F(ce,8,_e)},W=function(oe,_e){let pe=new DataView(new ArrayBuffer(8));pe.setFloat64(0,oe,!0);let ce=[];for(let de=0;8>de;de++)ce.push(pe.getUint8(de,!0));F(ce,8,_e)},Z=function(oe,_e){if(null===oe)Y(0,_e);else{let pe=oe.tsslen()+1,ce=oe.getstr();255>pe?Y(pe,_e):(Y(255,_e),q(pe,_e)),F(ce,pe-1,_e)}},Q=function(oe,_e){let pe=oe.code.map((ce)=>ce.code);J(pe.length,_e);for(let ce=0;ce<pe.length;ce++)J(pe[ce],_e)},$=function(oe,_e){let pe=oe.k.length;J(pe,_e);for(let ce=0,de;ce<pe;ce++)switch(de=oe.k[ce],Y(de.ttype(),_e),de.ttype()){case N.LUA_TNIL:break;case N.LUA_TBOOLEAN:Y(de.value?1:0,_e);break;case N.LUA_TNUMFLT:W(de.value,_e);break;case N.LUA_TNUMINT:q(de.value,_e);break;case N.LUA_TSHRSTR:case N.LUA_TLNGSTR:Z(de.tsvalue(),_e);}},ee=function(oe,_e){let pe=oe.p.length;J(pe,_e);for(let ce=0;ce<pe;ce++)ue(oe.p[ce],oe.source,_e)},te=function(oe,_e){let pe=oe.upvalues.length;J(pe,_e);for(let ce=0;ce<pe;ce++)Y(oe.upvalues[ce].instack?1:0,_e),Y(oe.upvalues[ce].idx,_e)},ae=function(oe,_e){let pe=_e.strip?0:oe.lineinfo.length;J(pe,_e);for(let ce=0;ce<pe;ce++)J(oe.lineinfo[ce],_e);pe=_e.strip?0:oe.locvars.length,J(pe,_e);for(let ce=0;ce<pe;ce++)Z(oe.locvars[ce].varname,_e),J(oe.locvars[ce].startpc,_e),J(oe.locvars[ce].endpc,_e);pe=_e.strip?0:oe.upvalues.length,J(pe,_e);for(let ce=0;ce<pe;ce++)Z(oe.upvalues[ce].name,_e)},ue=function(oe,_e,pe){pe.strip||oe.source===_e?Z(null,pe):Z(oe.source,pe),J(oe.linedefined,pe),J(oe.lastlinedefined,pe),Y(oe.numparams,pe),Y(oe.is_vararg?1:0,pe),Y(oe.maxstacksize,pe),Q(oe,pe),$(oe,pe),te(oe,pe),ee(oe,pe),ae(oe,pe)},se=function(oe){H(E.LUA_SIGNATURE,oe),Y(K,oe),Y(0,oe);let _e='\x19\x93\r\n\x1A\n'.split('').map((pe)=>pe.charCodeAt(0));F(_e,_e.length,oe),Y(4,oe),Y(8,oe),Y(4,oe),Y(4,oe),Y(8,oe),q(22136,oe),W(370.5,oe)};T.exports.luaU_dump=function(oe,_e,pe,ce,de){let Le=new G;return Le.L=oe,Le.writer=pe,Le.data=ce,Le.strip=de,Le.status=0,se(Le),Y(_e.upvalues.length,Le),ue(_e,null,Le),Le.status}},function(T,O,U){'use strict';const E=U(2),N=U(6),I=U(48),M=U(23),P=U(26),K=U(30),V=U(31),G=U(32),F=U(24),H=U(28),Y=U(27),J=U(52),q={[J.LUA_LOADLIBNAME]:Y.luaopen_package,[J.LUA_COLIBNAME]:M.luaopen_coroutine,[J.LUA_DBLIBNAME]:F.luaopen_debug,[J.LUA_MATHLIBNAME]:P.luaopen_math,[J.LUA_OSLIBNAME]:H.luaopen_os,[J.LUA_STRLIBNAME]:K.luaopen_string,[J.LUA_TABLIBNAME]:V.luaopen_table,[J.LUA_UTF8LIBNAME]:G.luaopen_utf8,_G:I.luaopen_base};T.exports.luaL_openlibs=function(Z){for(let Q in q)N.luaL_requiref(Z,E.to_luastring(Q),q[Q],1),E.lua_pop(Z,1)}},function(T,O,U){'use strict';const E=U(2),N='_'+E.LUA_VERSION_MAJOR+'_'+E.LUA_VERSION_MINOR;T.exports.LUA_VERSUFFIX=N;const I='coroutine';T.exports.LUA_COLIBNAME=I,T.exports[I]=U(23).luaopen_coroutine;const M='table';T.exports.LUA_TABLIBNAME=M,T.exports[M]=U(31).luaopen_table;const P='os';T.exports.LUA_OSLIBNAME=P,T.exports[P]=U(28).luaopen_os;const K='string';T.exports.LUA_STRLIBNAME=K,T.exports[K]=U(30).luaopen_string;const V='utf8';T.exports.LUA_UTF8LIBNAME=V,T.exports[V]=U(32).luaopen_utf8,T.exports.LUA_BITLIBNAME='bit32';const F='math';T.exports.LUA_MATHLIBNAME=F,T.exports[F]=U(26).luaopen_math;const H='debug';T.exports.LUA_DBLIBNAME=H,T.exports[H]=U(24).luaopen_debug;const Y='package';T.exports.LUA_LOADLIBNAME=Y,T.exports[Y]=U(27).luaopen_package},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(9),M=U(11),P=U(5),K=U(20),V=U(7),G=U(19);let F=[25,147,N.char['\r'],N.char['\n'],26,N.char['\n']];class H{constructor(J,q,W){this.intSize=4,this.size_tSize=8,this.instructionSize=4,this.integerSize=4,this.numberSize=8,E(q instanceof G.MBuffer,'BytecodeParser only operates on a MBuffer'),E(Array.isArray(W)),this.name=W[0]==N.char['@']||W[0]==N.char['=']?W.slice(1):W[0]==N.LUA_SIGNATURE.charCodeAt(0)?N.to_luastring('binary string',!0):W,this.L=J,this.buffer=q,this.dv=new DataView(new ArrayBuffer(_Mathmax(this.intSize,this.size_tSize,this.instructionSize,this.integerSize,this.numberSize)))}read(J){let q=this.buffer.read(J);return E(Array.isArray(q)),q.length<J&&this.error('truncated'),q}readByte(){return this.read(1)[0]}readInteger(){let J=this.read(this.integerSize);for(let q=0;q<J.length;q++)this.dv.setUint8(q,J[q]);return this.dv.getInt32(0,!0)}readSize_t(){return this.readInteger()}readInt(){let J=this.read(this.intSize);for(let q=0;q<J.length;q++)this.dv.setUint8(q,J[q]);return this.dv.getInt32(0,!0)}readNumber(){let J=this.read(this.numberSize);for(let q=0;q<J.length;q++)this.dv.setUint8(q,J[q]);return this.dv.getFloat64(0,!0)}readString(){let J=_Mathmax(this.readByte()-1,0);return 255===J+1&&(J=this.readSize_t()-1),0===J?null:V.luaS_new(this.L,this.read(J))}static MASK1(J,q){return~(-1<<J)<<q}static MASK0(J,q){return~H.MASK1(J,q)}readInstruction(){let J=new DataView(new ArrayBuffer(this.instructionSize));for(let q=0;q<this.instructionSize;q++)J.setUint8(q,this.readByte());return J.getUint32(0,!0)}readCode(J){let q=this.readInt(),W=K,Z=H;for(let Q=0,$;Q<q;Q++)$=this.readInstruction(),J.code[Q]={code:$,opcode:$>>W.POS_OP&Z.MASK1(W.SIZE_OP,0),A:$>>W.POS_A&Z.MASK1(W.SIZE_A,0),B:$>>W.POS_B&Z.MASK1(W.SIZE_B,0),C:$>>W.POS_C&Z.MASK1(W.SIZE_C,0),Bx:$>>W.POS_Bx&Z.MASK1(W.SIZE_Bx,0),Ax:$>>W.POS_Ax&Z.MASK1(W.SIZE_Ax,0),sBx:($>>W.POS_Bx&Z.MASK1(W.SIZE_Bx,0))-W.MAXARG_sBx}}readUpvalues(J){let q=this.readInt();for(let W=0;W<q;W++)J.upvalues[W]={name:null,instack:this.readByte(),idx:this.readByte()}}readConstants(J){let q=this.readInt();for(let W=0,Z;W<q;W++)Z=this.readByte(),Z===N.CT.LUA_TNIL?J.k.push(new P.TValue(N.CT.LUA_TNIL,null)):Z===N.CT.LUA_TBOOLEAN?J.k.push(new P.TValue(N.CT.LUA_TBOOLEAN,this.readByte())):Z===N.CT.LUA_TNUMFLT?J.k.push(new P.TValue(N.CT.LUA_TNUMFLT,this.readNumber())):Z===N.CT.LUA_TNUMINT?J.k.push(new P.TValue(N.CT.LUA_TNUMINT,this.readInteger())):Z===N.CT.LUA_TSHRSTR||Z===N.CT.LUA_TLNGSTR?J.k.push(new P.TValue(N.CT.LUA_TLNGSTR,this.readString())):this.error(`unrecognized constant '${Z}'`)}readProtos(J){let q=this.readInt();for(let W=0;W<q;W++)J.p[W]=new M.Proto(this.L),this.readFunction(J.p[W],J.source)}readDebug(J){let q=this.readInt();for(let W=0;W<q;W++)J.lineinfo[W]=this.readInt();q=this.readInt();for(let W=0;W<q;W++)J.locvars[W]={varname:this.readString(),startpc:this.readInt(),endpc:this.readInt()};q=this.readInt();for(let W=0;W<q;W++)J.upvalues[W].name=this.readString()}readFunction(J,q){J.source=this.readString(),null===J.source&&(J.source=q),J.linedefined=this.readInt(),J.lastlinedefined=this.readInt(),J.numparams=this.readByte(),J.is_vararg=this.readByte(),J.maxstacksize=this.readByte(),this.readCode(J),this.readConstants(J),this.readUpvalues(J),this.readProtos(J),this.readDebug(J)}checkliteral(J,q){let W=this.read(J.length);W.join()!==J.join()&&this.error(q)}checkHeader(){this.checkliteral(N.to_luastring(N.LUA_SIGNATURE.substring(1)),'not a'),83!==this.readByte()&&this.error('version mismatch in'),0!==this.readByte()&&this.error('format mismatch in'),this.checkliteral(F,'corrupted'),this.intSize=this.readByte(),this.size_tSize=this.readByte(),this.instructionSize=this.readByte(),this.integerSize=this.readByte(),this.numberSize=this.readByte(),this.checksize(this.intSize,4,'int'),this.checksize(this.size_tSize,8,'size_t'),this.checksize(this.instructionSize,4,'instruction'),this.checksize(this.integerSize,4,'integer'),this.checksize(this.numberSize,8,'number'),22136!==this.readInteger()&&this.error('endianness mismatch in'),370.5!==this.readNumber()&&this.error('float format mismatch in')}error(J){P.luaO_pushfstring(this.L,N.to_luastring('%s: %s precompiled chunk'),this.name,N.to_luastring(J)),I.luaD_throw(this.L,N.thread_status.LUA_ERRSYNTAX)}checksize(J,q,W){J!==q&&this.error(`${W} size mismatch in`)}}T.exports.luaU_undump=function(J,q,W){let Z=new H(J,q,W);Z.checkHeader();let Q=M.luaF_newLclosure(J,Z.readByte());return J.stack[J.top++]=new P.TValue(N.CT.LUA_TLCL,Q),Q.p=new M.Proto(J),Z.readFunction(Q.p,null),E(Q.nupvalues===Q.p.upvalues.length),Q}},function(){}]); \ No newline at end of file
+ */function N(pe,ce){if(pe===ce)return 0;for(var de=pe.length,Le=ce.length,ge=0,Ae=_Mathmin(de,Le);ge<Ae;++ge)if(pe[ge]!==ce[ge]){de=pe[ge],Le=ce[ge];break}return de<Le?-1:Le<de?1:0}function I(pe){return E.Buffer&&'function'==typeof E.Buffer.isBuffer?E.Buffer.isBuffer(pe):!!(null!=pe&&pe._isBuffer)}function M(pe){return Object.prototype.toString.call(pe)}function P(pe){return!I(pe)&&'function'==typeof E.ArrayBuffer&&('function'==typeof ArrayBuffer.isView?ArrayBuffer.isView(pe):!!pe&&(!!(pe instanceof DataView)||pe.buffer&&pe.buffer instanceof ArrayBuffer))}function K(pe){if(te.isFunction(pe)){if(se)return pe.name;var ce=pe.toString(),de=ce.match(oe);return de&&de[1]}}function V(pe,ce){return'string'==typeof pe?pe.length<ce?pe:pe.slice(0,ce):pe}function G(pe){if(se||!te.isFunction(pe))return te.inspect(pe);var ce=K(pe),de=ce?': '+ce:'';return'[Function'+de+']'}function F(pe){return V(G(pe.actual),128)+' '+pe.operator+' '+V(G(pe.expected),128)}function H(pe,ce,de,Le,ge){throw new ne.AssertionError({message:de,actual:pe,expected:ce,operator:Le,stackStartFunction:ge})}function Y(pe,ce){pe||H(pe,!0,ce,'==',ne.ok)}function J(pe,ce,de,Le){if(pe===ce)return!0;if(I(pe)&&I(ce))return 0===N(pe,ce);if(te.isDate(pe)&&te.isDate(ce))return pe.getTime()===ce.getTime();if(te.isRegExp(pe)&&te.isRegExp(ce))return pe.source===ce.source&&pe.global===ce.global&&pe.multiline===ce.multiline&&pe.lastIndex===ce.lastIndex&&pe.ignoreCase===ce.ignoreCase;if((null===pe||'object'!=typeof pe)&&(null===ce||'object'!=typeof ce))return de?pe==ce:pe==ce;if(P(pe)&&P(ce)&&M(pe)===M(ce)&&!(pe instanceof Float32Array||pe instanceof Float64Array))return 0===N(new Uint8Array(pe.buffer),new Uint8Array(ce.buffer));if(I(pe)!==I(ce))return!1;Le=Le||{actual:[],expected:[]};var ge=Le.actual.indexOf(pe);return-1!==ge&&ge===Le.expected.indexOf(ce)||(Le.actual.push(pe),Le.expected.push(ce),W(pe,ce,de,Le))}function q(pe){return'[object Arguments]'==Object.prototype.toString.call(pe)}function W(pe,ce,de,Le){if(null===pe||void 0===pe||null===ce||void 0===ce)return!1;if(te.isPrimitive(pe)||te.isPrimitive(ce))return pe===ce;if(de&&Object.getPrototypeOf(pe)!==Object.getPrototypeOf(ce))return!1;var ge=q(pe),Ae=q(ce);if(ge&&!Ae||!ge&&Ae)return!1;if(ge)return pe=ue.call(pe),ce=ue.call(ce),J(pe,ce,de);var Te=_e(pe),he=_e(ce),Oe,xe;if(Te.length!==he.length)return!1;for(Te.sort(),he.sort(),xe=Te.length-1;0<=xe;xe--)if(Te[xe]!==he[xe])return!1;for(xe=Te.length-1;0<=xe;xe--)if(Oe=Te[xe],!J(pe[Oe],ce[Oe],de,Le))return!1;return!0}function Z(pe,ce,de){J(pe,ce,!0)&&H(pe,ce,de,'notDeepStrictEqual',Z)}function Q(pe,ce){if(!pe||!ce)return!1;if('[object RegExp]'==Object.prototype.toString.call(ce))return ce.test(pe);try{if(pe instanceof ce)return!0}catch(de){}return!Error.isPrototypeOf(ce)&&!0===ce.call({},pe)}function $(pe){var ce;try{pe()}catch(de){ce=de}return ce}function ee(pe,ce,de,Le){var ge;if('function'!=typeof ce)throw new TypeError('"block" argument must be a function');'string'==typeof de&&(Le=de,de=null),ge=$(ce),Le=(de&&de.name?' ('+de.name+').':'.')+(Le?' '+Le:'.'),pe&&!ge&&H(ge,de,'Missing expected exception'+Le);var Ae='string'==typeof Le,Te=!pe&&te.isError(ge),he=!pe&&ge&&!de;if((Te&&Ae&&Q(ge,de)||he)&&H(ge,de,'Got unwanted exception'+Le),pe&&ge&&de&&!Q(ge,de)||!pe&&ge)throw ge}var te=U(45),ae=Object.prototype.hasOwnProperty,ue=Array.prototype.slice,se=function(){return'foo'===function(){}.name}(),ne=T.exports=Y,oe=/\s*function\s+([^\(\s]*)\s*/;ne.AssertionError=function(ce){this.name='AssertionError',this.actual=ce.actual,this.expected=ce.expected,this.operator=ce.operator,ce.message?(this.message=ce.message,this.generatedMessage=!1):(this.message=F(this),this.generatedMessage=!0);var de=ce.stackStartFunction||H;if(Error.captureStackTrace)Error.captureStackTrace(this,de);else{var Le=new Error;if(Le.stack){var ge=Le.stack,Ae=K(de),Te=ge.indexOf('\n'+Ae);if(0<=Te){var he=ge.indexOf('\n',Te+1);ge=ge.substring(he+1)}this.stack=ge}}},te.inherits(ne.AssertionError,Error),ne.fail=H,ne.ok=Y,ne.equal=function(ce,de,Le){ce!=de&&H(ce,de,Le,'==',ne.equal)},ne.notEqual=function(ce,de,Le){ce==de&&H(ce,de,Le,'!=',ne.notEqual)},ne.deepEqual=function(ce,de,Le){J(ce,de,!1)||H(ce,de,Le,'deepEqual',ne.deepEqual)},ne.deepStrictEqual=function(ce,de,Le){J(ce,de,!0)||H(ce,de,Le,'deepStrictEqual',ne.deepStrictEqual)},ne.notDeepEqual=function(ce,de,Le){J(ce,de,!1)&&H(ce,de,Le,'notDeepEqual',ne.notDeepEqual)},ne.notDeepStrictEqual=Z,ne.strictEqual=function(ce,de,Le){ce!==de&&H(ce,de,Le,'===',ne.strictEqual)},ne.notStrictEqual=function(ce,de,Le){ce===de&&H(ce,de,Le,'!==',ne.notStrictEqual)},ne.throws=function(pe,ce,de){ee(!0,pe,ce,de)},ne.doesNotThrow=function(pe,ce,de){ee(!1,pe,ce,de)},ne.ifError=function(pe){if(pe)throw pe};var _e=Object.keys||function(pe){var ce=[];for(var de in pe)ae.call(pe,de)&&ce.push(de);return ce}}).call(O,U(22))},function(T,O,U){'use strict';const E=U(0),N=U(12),I=U(4),M=[];for(let lt=0;127>lt;lt++)M[_StringfromCharCode(lt)]=lt;T.exports.char=M;const K='5',V='3',F='4',H='Lua '+K+'.'+V,Y=H+'.'+F,J=Y+' Copyright (C) 1994-2017 Lua.org, PUC-Rio',W='0',Z='0',$='1',ee='Fengari '+W+'.'+Z,te=ee+'.'+$,se='_'+K+'_'+V,ne='LUA_INIT',pe={LUA_TNONE:-1,LUA_TNIL:0,LUA_TBOOLEAN:1,LUA_TLIGHTUSERDATA:2,LUA_TNUMBER:3,LUA_TSTRING:4,LUA_TTABLE:5,LUA_TFUNCTION:6,LUA_TUSERDATA:7,LUA_TTHREAD:8,LUA_NUMTAGS:9};pe.LUA_TSHRSTR=0|pe.LUA_TSTRING,pe.LUA_TLNGSTR=16|pe.LUA_TSTRING,pe.LUA_TNUMFLT=0|pe.LUA_TNUMBER,pe.LUA_TNUMINT=16|pe.LUA_TNUMBER,pe.LUA_TLCL=0|pe.LUA_TFUNCTION,pe.LUA_TLCF=16|pe.LUA_TFUNCTION,pe.LUA_TCCL=32|pe.LUA_TFUNCTION;const Pe=-N.LUAI_MAXSTACK-1e3,Ke=2,we={},Xe=0,He=1,je=2,ze=3;T.exports.LUA_PATH_SEP=';',T.exports.LUA_PATH_MARK='?',T.exports.LUA_EXEC_DIR='!';const at=K+'.'+V;T.exports.LUA_VDIR=at;{T.exports.LUA_DIRSEP='/';const ut='/usr/local/';T.exports.LUA_ROOT=ut;const rt=ut+'share/lua/'+at+'/';T.exports.LUA_LDIR=rt;const st=ut+'lib/lua/'+at+'/';T.exports.LUA_CDIR=st,T.exports.LUA_PATH_DEFAULT=rt+'?.lua;'+rt+'?/init.lua;'+st+'?.lua;'+st+'?/init.lua;./?.lua;./?/init.lua',T.exports.LUA_CPATH_DEFAULT=st+'?.so;'+st+'loadall.so;./?.so'}T.exports.CT=pe,T.exports.FENGARI_AUTHORS='B. Giannangeli',T.exports.FENGARI_COPYRIGHT=te+' Copyright (C) 2017 Beno\xEEt Giannangeli\nBased on: '+J,T.exports.FENGARI_RELEASE=te,T.exports.FENGARI_VERSION=ee,T.exports.FENGARI_VERSION_MAJOR=W,T.exports.FENGARI_VERSION_MINOR=Z,T.exports.FENGARI_VERSION_NUM=1,T.exports.FENGARI_VERSION_RELEASE=$,T.exports.LUA_AUTHORS='R. Ierusalimschy, L. H. de Figueiredo, W. Celes',T.exports.LUA_COPYRIGHT=J,T.exports.LUA_HOOKCALL=Xe,T.exports.LUA_HOOKCOUNT=ze,T.exports.LUA_HOOKLINE=je,T.exports.LUA_HOOKRET=He,T.exports.LUA_HOOKTAILCALL=4,T.exports.LUA_INITVARVERSION=ne+se,T.exports.LUA_INIT_VAR=ne,T.exports.LUA_MASKCALL=1<<Xe,T.exports.LUA_MASKCOUNT=1<<ze,T.exports.LUA_MASKLINE=1<<je,T.exports.LUA_MASKRET=1<<He,T.exports.LUA_MINSTACK=20,T.exports.LUA_MULTRET=-1,T.exports.LUA_NUMTAGS=9,T.exports.LUA_OPADD=0,T.exports.LUA_OPBAND=7,T.exports.LUA_OPBNOT=13,T.exports.LUA_OPBOR=8,T.exports.LUA_OPBXOR=9,T.exports.LUA_OPDIV=5,T.exports.LUA_OPEQ=0,T.exports.LUA_OPIDIV=6,T.exports.LUA_OPLE=2,T.exports.LUA_OPLT=1,T.exports.LUA_OPMOD=3,T.exports.LUA_OPMUL=2,T.exports.LUA_OPPOW=4,T.exports.LUA_OPSHL=10,T.exports.LUA_OPSHR=11,T.exports.LUA_OPSUB=1,T.exports.LUA_OPUNM=12,T.exports.LUA_REGISTRYINDEX=Pe,T.exports.LUA_RELEASE=Y,T.exports.LUA_RIDX_GLOBALS=Ke,T.exports.LUA_RIDX_LAST=Ke,T.exports.LUA_RIDX_MAINTHREAD=1,T.exports.LUA_SIGNATURE='\x1BLua',T.exports.LUA_VERSION=H,T.exports.LUA_VERSION_MAJOR=K,T.exports.LUA_VERSION_MINOR=V,T.exports.LUA_VERSION_NUM=503,T.exports.LUA_VERSION_RELEASE=F,T.exports.LUA_VERSUFFIX=se,T.exports.constant_types=pe,T.exports.lua_Debug=class{constructor(){this.event=NaN,this.name=null,this.namewhat=null,this.what=null,this.source=null,this.currentline=NaN,this.linedefined=NaN,this.lastlinedefined=NaN,this.nups=NaN,this.nparams=NaN,this.isvararg=NaN,this.istailcall=NaN,this.short_src=null,this.i_ci=null}},T.exports.lua_upvalueindex=function(lt){return Pe-lt},T.exports.thread_status={LUA_OK:0,LUA_YIELD:1,LUA_ERRRUN:2,LUA_ERRSYNTAX:3,LUA_ERRMEM:4,LUA_ERRGCMM:5,LUA_ERRERR:6},T.exports.to_jsstring=function(lt,ut,rt){E(Array.isArray(lt),'jsstring expect a array of bytes');let ct=0,st,nt,ot,_t,it,pt;lt=lt.slice(ut?ut:0,rt);for(var dt='';;){if(st=lt[ct++],0===st){dt+='\0';continue}if(!st)return dt;if(!(128&st)){dt+=_StringfromCharCode(st);continue}if(nt=63&lt[ct++],192==(224&st)){dt+=_StringfromCharCode((31&st)<<6|nt);continue}if(ot=63&lt[ct++],224==(240&st)?st=(15&st)<<12|nt<<6|ot:(_t=63&lt[ct++],240==(248&st)?st=(7&st)<<18|nt<<12|ot<<6|_t:(it=63&lt[ct++],248==(252&st)?st=(3&st)<<24|nt<<18|ot<<12|_t<<6|it:(pt=63&lt[ct++],st=(1&st)<<30|nt<<24|ot<<18|_t<<12|it<<6|pt))),65536>st)dt+=_StringfromCharCode(st);else{var Lt=st-65536;dt+=_StringfromCharCode(55296|Lt>>10,56320|1023&Lt)}}return dt},T.exports.to_luastring=function(lt,ut,rt){if(E('string'==typeof lt,'to_luastring expect a js string'),ut){let it=we[lt];if(Array.isArray(it))return it}rt=void 0===rt?I.MAX_INT:rt;let st=[];if(!(0<rt))return 0;let nt=0,_t=rt-1;for(let it=0,pt;it<lt.length;++it)if(pt=lt.charCodeAt(it),55296<=pt&&57343>=pt&&(pt=65536+((1023&pt)<<10)|1023&lt.charCodeAt(++it)),127>=pt){if(nt>=_t)break;st[nt++]=pt}else if(2047>=pt){if(nt+1>=_t)break;st[nt++]=192|pt>>6,st[nt++]=128|63&pt}else if(65535>=pt){if(nt+2>=_t)break;st[nt++]=224|pt>>12,st[nt++]=128|63&pt>>6,st[nt++]=128|63&pt}else if(2097151>=pt){if(nt+3>=_t)break;st[nt++]=240|pt>>18,st[nt++]=128|63&pt>>12,st[nt++]=128|63&pt>>6,st[nt++]=128|63&pt}else if(67108863>=pt){if(nt+4>=_t)break;st[nt++]=248|pt>>24,st[nt++]=128|63&pt>>18,st[nt++]=128|63&pt>>12,st[nt++]=128|63&pt>>6,st[nt++]=128|63&pt}else{if(nt+5>=_t)break;st[nt++]=252|pt>>30,st[nt++]=128|63&pt>>24,st[nt++]=128|63&pt>>18,st[nt++]=128|63&pt>>12,st[nt++]=128|63&pt>>6,st[nt++]=128|63&pt}return ut&&(we[lt]=st),st}},function(T,O,U){'use strict';const E=U(1),N=U(21),I=U(8),M=U(9),P=U(15);T.exports.FENGARI_AUTHORS=E.FENGARI_AUTHORS,T.exports.FENGARI_COPYRIGHT=E.FENGARI_COPYRIGHT,T.exports.FENGARI_RELEASE=E.FENGARI_RELEASE,T.exports.FENGARI_VERSION=E.FENGARI_VERSION,T.exports.FENGARI_VERSION_MAJOR=E.FENGARI_VERSION_MAJOR,T.exports.FENGARI_VERSION_MINOR=E.FENGARI_VERSION_MINOR,T.exports.FENGARI_VERSION_NUM=E.FENGARI_VERSION_NUM,T.exports.FENGARI_VERSION_RELEASE=E.FENGARI_VERSION_RELEASE,T.exports.LUA_AUTHORS=E.LUA_AUTHORS,T.exports.LUA_COPYRIGHT=E.LUA_COPYRIGHT,T.exports.LUA_ERRERR=E.thread_status.LUA_ERRERR,T.exports.LUA_ERRGCMM=E.thread_status.LUA_ERRGCMM,T.exports.LUA_ERRMEM=E.thread_status.LUA_ERRMEM,T.exports.LUA_ERRRUN=E.thread_status.LUA_ERRRUN,T.exports.LUA_ERRSYNTAX=E.thread_status.LUA_ERRSYNTAX,T.exports.LUA_HOOKCALL=E.LUA_HOOKCALL,T.exports.LUA_HOOKCOUNT=E.LUA_HOOKCOUNT,T.exports.LUA_HOOKLINE=E.LUA_HOOKLINE,T.exports.LUA_HOOKRET=E.LUA_HOOKRET,T.exports.LUA_HOOKTAILCALL=E.LUA_HOOKTAILCALL,T.exports.LUA_INITVARVERSION=E.LUA_INITVARVERSION,T.exports.LUA_INIT_VAR=E.LUA_INIT_VAR,T.exports.LUA_MASKCALL=E.LUA_MASKCALL,T.exports.LUA_MASKCOUNT=E.LUA_MASKCOUNT,T.exports.LUA_MASKLINE=E.LUA_MASKLINE,T.exports.LUA_MASKRET=E.LUA_MASKRET,T.exports.LUA_MINSTACK=E.LUA_MINSTACK,T.exports.LUA_MULTRET=E.LUA_MULTRET,T.exports.LUA_NUMTAGS=E.LUA_NUMTAGS,T.exports.LUA_OK=E.thread_status.LUA_OK,T.exports.LUA_OPADD=E.LUA_OPADD,T.exports.LUA_OPBAND=E.LUA_OPBAND,T.exports.LUA_OPBNOT=E.LUA_OPBNOT,T.exports.LUA_OPBOR=E.LUA_OPBOR,T.exports.LUA_OPBXOR=E.LUA_OPBXOR,T.exports.LUA_OPDIV=E.LUA_OPDIV,T.exports.LUA_OPEQ=E.LUA_OPEQ,T.exports.LUA_OPIDIV=E.LUA_OPIDIV,T.exports.LUA_OPLE=E.LUA_OPLE,T.exports.LUA_OPLT=E.LUA_OPLT,T.exports.LUA_OPMOD=E.LUA_OPMOD,T.exports.LUA_OPMUL=E.LUA_OPMUL,T.exports.LUA_OPPOW=E.LUA_OPPOW,T.exports.LUA_OPSHL=E.LUA_OPSHL,T.exports.LUA_OPSHR=E.LUA_OPSHR,T.exports.LUA_OPSUB=E.LUA_OPSUB,T.exports.LUA_OPUNM=E.LUA_OPUNM,T.exports.LUA_REGISTRYINDEX=E.LUA_REGISTRYINDEX,T.exports.LUA_RELEASE=E.LUA_RELEASE,T.exports.LUA_RIDX_GLOBALS=E.LUA_RIDX_GLOBALS,T.exports.LUA_RIDX_LAST=E.LUA_RIDX_LAST,T.exports.LUA_RIDX_MAINTHREAD=E.LUA_RIDX_MAINTHREAD,T.exports.LUA_SIGNATURE=E.LUA_SIGNATURE,T.exports.LUA_TNONE=E.CT.LUA_TNONE,T.exports.LUA_TNIL=E.CT.LUA_TNIL,T.exports.LUA_TBOOLEAN=E.CT.LUA_TBOOLEAN,T.exports.LUA_TLIGHTUSERDATA=E.CT.LUA_TLIGHTUSERDATA,T.exports.LUA_TNUMBER=E.CT.LUA_TNUMBER,T.exports.LUA_TSTRING=E.CT.LUA_TSTRING,T.exports.LUA_TTABLE=E.CT.LUA_TTABLE,T.exports.LUA_TFUNCTION=E.CT.LUA_TFUNCTION,T.exports.LUA_TUSERDATA=E.CT.LUA_TUSERDATA,T.exports.LUA_TTHREAD=E.CT.LUA_TTHREAD,T.exports.LUA_VERSION=E.LUA_VERSION,T.exports.LUA_VERSION_MAJOR=E.LUA_VERSION_MAJOR,T.exports.LUA_VERSION_MINOR=E.LUA_VERSION_MINOR,T.exports.LUA_VERSION_NUM=E.LUA_VERSION_NUM,T.exports.LUA_VERSION_RELEASE=E.LUA_VERSION_RELEASE,T.exports.LUA_VERSUFFIX=E.LUA_VERSUFFIX,T.exports.LUA_YIELD=E.thread_status.LUA_YIELD,T.exports.lua_Debug=E.lua_Debug,T.exports.lua_upvalueindex=E.lua_upvalueindex,T.exports.to_jsstring=E.to_jsstring,T.exports.to_luastring=E.to_luastring,T.exports.LUA_CDIR=E.LUA_CDIR,T.exports.LUA_CPATH_DEFAULT=E.LUA_CPATH_DEFAULT,T.exports.LUA_EXEC_DIR=E.LUA_EXEC_DIR,T.exports.LUA_LDIR=E.LUA_LDIR,T.exports.LUA_PATH_DEFAULT=E.LUA_PATH_DEFAULT,T.exports.LUA_PATH_MARK=E.LUA_PATH_MARK,T.exports.LUA_PATH_SEP=E.LUA_PATH_SEP,T.exports.LUA_ROOT=E.LUA_ROOT,T.exports.LUA_SHRDIR=E.LUA_SHRDIR,T.exports.LUA_VDIR=E.LUA_VDIR,T.exports.LUA_DIRSEP=E.LUA_DIRSEP,T.exports.lua_absindex=N.lua_absindex,T.exports.lua_atpanic=N.lua_atpanic,T.exports.lua_call=N.lua_call,T.exports.lua_callk=N.lua_callk,T.exports.lua_checkstack=N.lua_checkstack,T.exports.lua_close=P.lua_close,T.exports.lua_compare=N.lua_compare,T.exports.lua_concat=N.lua_concat,T.exports.lua_copy=N.lua_copy,T.exports.lua_createtable=N.lua_createtable,T.exports.lua_dump=N.lua_dump,T.exports.lua_error=N.lua_error,T.exports.lua_gc=N.lua_gc,T.exports.lua_getallocf=N.lua_getallocf,T.exports.lua_getextraspace=N.lua_getextraspace,T.exports.lua_getfield=N.lua_getfield,T.exports.lua_getglobal=N.lua_getglobal,T.exports.lua_gethook=I.lua_gethook,T.exports.lua_gethookcount=I.lua_gethookcount,T.exports.lua_gethookmask=I.lua_gethookmask,T.exports.lua_geti=N.lua_geti,T.exports.lua_getinfo=I.lua_getinfo,T.exports.lua_getlocal=I.lua_getlocal,T.exports.lua_getmetatable=N.lua_getmetatable,T.exports.lua_getstack=I.lua_getstack,T.exports.lua_gettable=N.lua_gettable,T.exports.lua_gettop=N.lua_gettop,T.exports.lua_getupvalue=N.lua_getupvalue,T.exports.lua_getuservalue=N.lua_getuservalue,T.exports.lua_insert=N.lua_insert,T.exports.lua_isboolean=N.lua_isboolean,T.exports.lua_iscfunction=N.lua_iscfunction,T.exports.lua_isfunction=N.lua_isfunction,T.exports.lua_isinteger=N.lua_isinteger,T.exports.lua_isnil=N.lua_isnil,T.exports.lua_isnone=N.lua_isnone,T.exports.lua_isnoneornil=N.lua_isnoneornil,T.exports.lua_isnumber=N.lua_isnumber,T.exports.lua_isstring=N.lua_isstring,T.exports.lua_istable=N.lua_istable,T.exports.lua_isthread=N.lua_isthread,T.exports.lua_isuserdata=N.lua_isuserdata,T.exports.lua_isyieldable=M.lua_isyieldable,T.exports.lua_len=N.lua_len,T.exports.lua_load=N.lua_load,T.exports.lua_newstate=P.lua_newstate,T.exports.lua_newtable=N.lua_newtable,T.exports.lua_newthread=P.lua_newthread,T.exports.lua_newuserdata=N.lua_newuserdata,T.exports.lua_next=N.lua_next,T.exports.lua_pcall=N.lua_pcall,T.exports.lua_pcallk=N.lua_pcallk,T.exports.lua_pop=N.lua_pop,T.exports.lua_pushboolean=N.lua_pushboolean,T.exports.lua_pushcclosure=N.lua_pushcclosure,T.exports.lua_pushcfunction=N.lua_pushcfunction,T.exports.lua_pushglobaltable=N.lua_pushglobaltable,T.exports.lua_pushinteger=N.lua_pushinteger,T.exports.lua_pushjsclosure=N.lua_pushjsclosure,T.exports.lua_pushjsfunction=N.lua_pushjsfunction,T.exports.lua_pushlightuserdata=N.lua_pushlightuserdata,T.exports.lua_pushliteral=N.lua_pushliteral,T.exports.lua_pushlstring=N.lua_pushlstring,T.exports.lua_pushnil=N.lua_pushnil,T.exports.lua_pushnumber=N.lua_pushnumber,T.exports.lua_pushstring=N.lua_pushstring,T.exports.lua_pushfstring=N.lua_pushfstring,T.exports.lua_pushvfstring=N.lua_pushvfstring,T.exports.lua_pushthread=N.lua_pushthread,T.exports.lua_pushvalue=N.lua_pushvalue,T.exports.lua_rawequal=N.lua_rawequal,T.exports.lua_rawget=N.lua_rawget,T.exports.lua_rawgeti=N.lua_rawgeti,T.exports.lua_rawgetp=N.lua_rawgetp,T.exports.lua_rawlen=N.lua_rawlen,T.exports.lua_rawseti=N.lua_rawseti,T.exports.lua_rawset=N.lua_rawset,T.exports.lua_rawsetp=N.lua_rawsetp,T.exports.lua_remove=N.lua_remove,T.exports.lua_replace=N.lua_replace,T.exports.lua_resume=M.lua_resume,T.exports.lua_rotate=N.lua_rotate,T.exports.lua_setfield=N.lua_setfield,T.exports.lua_setglobal=N.lua_setglobal,T.exports.lua_sethook=I.lua_sethook,T.exports.lua_seti=N.lua_seti,T.exports.lua_setlocal=I.lua_setlocal,T.exports.lua_setmetatable=N.lua_setmetatable,T.exports.lua_settable=N.lua_settable,T.exports.lua_settop=N.lua_settop,T.exports.lua_setupvalue=N.lua_setupvalue,T.exports.lua_setuservalue=N.lua_setuservalue,T.exports.lua_status=N.lua_status,T.exports.lua_stringtonumber=N.lua_stringtonumber,T.exports.lua_toboolean=N.lua_toboolean,T.exports.lua_todataview=N.lua_todataview,T.exports.lua_tointeger=N.lua_tointeger,T.exports.lua_tointegerx=N.lua_tointegerx,T.exports.lua_tojsstring=N.lua_tojsstring,T.exports.lua_toljsstring=N.lua_toljsstring,T.exports.lua_tolstring=N.lua_tolstring,T.exports.lua_tonumber=N.lua_tonumber,T.exports.lua_topointer=N.lua_topointer,T.exports.lua_tostring=N.lua_tostring,T.exports.lua_tothread=N.lua_tothread,T.exports.lua_touserdata=N.lua_touserdata,T.exports.lua_type=N.lua_type,T.exports.lua_typename=N.lua_typename,T.exports.lua_upvalueid=N.lua_upvalueid,T.exports.lua_upvaluejoin=N.lua_upvaluejoin,T.exports.lua_version=N.lua_version,T.exports.lua_xmove=N.lua_xmove,T.exports.lua_yield=M.lua_yield,T.exports.lua_yieldk=M.lua_yieldk},function(T){T.exports=function(){throw new Error('define cannot be used indirect')}},function(T){'use strict';T.exports.LUAI_MAXCCALLS=200,T.exports.LUA_MAXINTEGER=2147483647,T.exports.LUA_MININTEGER=-2147483648,T.exports.MAX_INT=2147483647,T.exports.MIN_INT=-2147483648},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(25),M=U(8),P=U(7),K=U(12),V=U(17),G=U(4),F=N.constant_types,H=N.char;class Y{constructor(ke,ve){this.type=ke,this.value=ve}ttype(){return 63&this.type}ttnov(){return 15&this.type}checktag(ke){return this.type===ke}checktype(ke){return this.ttnov()===ke}ttisnumber(){return this.checktype(F.LUA_TNUMBER)}ttisfloat(){return this.checktag(F.LUA_TNUMFLT)}ttisinteger(){return this.checktag(F.LUA_TNUMINT)}ttisnil(){return this.checktag(F.LUA_TNIL)}ttisboolean(){return this.checktag(F.LUA_TBOOLEAN)}ttislightuserdata(){return this.checktag(F.LUA_TLIGHTUSERDATA)}ttisstring(){return this.checktype(F.LUA_TSTRING)}ttisshrstring(){return this.checktag(F.LUA_TSHRSTR)}ttislngstring(){return this.checktag(F.LUA_TLNGSTR)}ttistable(){return this.checktag(F.LUA_TTABLE)}ttisfunction(){return this.checktype(F.LUA_TFUNCTION)}ttisclosure(){return(31&this.type)===F.LUA_TFUNCTION}ttisCclosure(){return this.checktag(F.LUA_TCCL)}ttisLclosure(){return this.checktag(F.LUA_TLCL)}ttislcf(){return this.checktag(F.LUA_TLCF)}ttisfulluserdata(){return this.checktag(F.LUA_TUSERDATA)}ttisthread(){return this.checktag(F.LUA_TTHREAD)}ttisdeadkey(){return this.checktag(F.LUA_TDEADKEY)}l_isfalse(){return this.ttisnil()||this.ttisboolean()&&!1===this.value}setfltvalue(ke){this.type=F.LUA_TNUMFLT,this.value=ke}setivalue(ke){this.type=F.LUA_TNUMINT,this.value=ke}setnilvalue(){this.type=F.LUA_TNIL,this.value=void 0}setfvalue(ke){this.type=F.LUA_TLCF,this.value=ke}setpvalue(ke){this.type=F.LUA_TLIGHTUSERDATA,this.value=ke}setbvalue(ke){this.type=F.LUA_TBOOLEAN,this.value=ke}sethvalue(ke){this.type=F.LUA_TTABLE,this.value=ke}setfrom(ke){this.type=ke.type,this.value=ke.value}tsvalue(){return E(this.ttisstring()),this.value}svalue(){return this.tsvalue().getstr()}vslen(){return this.tsvalue().tsslen()}jsstring(ke,ve){return N.to_jsstring(this.svalue(),ke,ve)}}const J=new Y(F.LUA_TNIL,null);T.exports.luaO_nilobject=J;const Q=N.to_luastring('...',!0),$=N.to_luastring('[string "'),ee=N.to_luastring('"]'),ae=function(ke){return I.lisdigit(ke)?ke-H[0]:_StringfromCharCode(ke).toLowerCase().charCodeAt(0)-H.a+10},ue=8,oe=function(ke){let ve=H[K.lua_getlocaledecpoint()],Re=0,be=0,Se=0,Ne=0,Ce=!1,Ie;for(;I.lisspace(ke[0]);)ke=ke.slice(1);if(Ie=ke[0]===H['-'],ke=Ie||ke[0]===H['+']?ke.slice(1):ke,ke[0]!==H[0]||ke[1]!==H.x&&ke[1]!==H.X)return 0;for(ke=ke.slice(2);;ke=ke.slice(1))if(ke[0]===ve){if(Ce)break;else Ce=!0;}else if(I.lisxdigit(ke[0]))0==be&&ke[0]===H[0]?Se++:30>=++be?Re=16*Re+ae(ke[0]):Ne++,Ce&&Ne--;else break;if(0==Se+be)return 0;if(Ne*=4,ke[0]===H.p||ke[0]===H.P){let Me=0,Pe;if(ke=ke.slice(1),Pe=ke[0]===H['-'],ke=Pe||ke[0]===H['+']?ke.slice(1):ke,!I.lisdigit(ke[0]))return 0;for(;I.lisdigit(ke[0]);)Me=10*Me+ke[0]-H[0],ke=ke.slice(1);Pe&&(Me=-Me),Ne+=Me}return Ie&&(Re=-Re),0>N.to_jsstring(ke).trim().search(/s/)?K.ldexp(Re,Ne):null},_e=function(ke,ve){let Re='x'===ve?oe(ke):parseFloat(N.to_jsstring(ke));return isNaN(Re)?null:Re},pe=function(ke){let ve=/[.xXnN]/g.exec(_StringfromCharCode(...ke));ve=ve?ve.index:null;let Re=ve?ke[ve]:null,be=Re?_StringfromCharCode(Re).toLowerCase():0;if('n'===be)return null;let Se=_e(ke,be);return null===Se,Se},ce=G.MAX_INT/10,de=G.MAX_INT%10,Le=function(ke){let ve=0,Re=!0,be;for(;I.lisspace(ke[0]);)ke=ke.slice(1);if(be=ke[0]===H['-'],(be||ke[0]===H['+'])&&(ke=ke.slice(1)),ke[0]===H[0]&&(ke[1]===H.x||ke[1]===H.X))for(ke=ke.slice(2);I.lisxdigit(ke[0]);ke=ke.slice(1))ve=16*ve+ae(ke[0]),Re=!1;else for(;I.lisdigit(ke[0]);ke=ke.slice(1)){let Se=ke[0]-H[0];if(ve>=ce&&(ve>ce||Se>de+be))return null;ve=10*ve+Se,Re=!1}for(;I.lisspace(ke[0]);)ke=ke.slice(1);return Re||0<ke.length&&0!==ke[0]?null:0|(be?-ve:ve)},Te=function(ke,ve){ke.stack[ke.top++]=new Y(F.LUA_TLNGSTR,P.luaS_new(ke,ve))},he=function(ke,ve,Re){let be=0,Se=0,Ne=0,Ie;for(;Ie=ve.indexOf(H['%'],Se),-1!=Ie;){switch(Te(ke,ve.slice(Se,Ie)),ve[Ie+1]){case H.s:let Ce=Re[Ne++];null===Ce&&(Ce=N.to_luastring('(null)',!0)),Te(ke,Ce);break;case H.c:let Me=Re[Ne++];I.lisprint(Me)?Te(ke,[Me]):Oe(ke,N.to_luastring('<\\%d>',!0),Me);break;case H.d:case H.I:case H.f:Te(ke,N.to_luastring(''+Re[Ne++]));break;case H.U:Te(ke,N.to_luastring(String.fromCodePoint(Re[Ne++])));break;case H['%']:Te(ke,[H['%']]);break;default:M.luaG_runerror(ke,N.to_luastring('invalid option \'%%%c\' to \'lua_pushfstring\''),ve[Ie+1]);}be+=2,Se=Ie+2}return Te(ke,ve.slice(Se)),0<be&&V.luaV_concat(ke,be+1),ke.stack[ke.top-1].svalue()},Oe=function(ke,ve,...Re){return he(ke,ve,Re)};T.exports.CClosure=class{constructor(ke,ve,Re){for(this.id=ke.l_G.id_counter++,this.f=ve,this.nupvalues=Re,this.upvalue=Array(Re);Re--;)this.upvalue[Re]=new Y(F.LUA_TNIL,null)}},T.exports.LClosure=class{constructor(ke,ve){this.id=ke.l_G.id_counter++,this.p=null,this.nupvalues=ve,this.upvals=Array(ve)}},T.exports.LocVar=class{constructor(){this.varname=null,this.startpc=NaN,this.endpc=NaN}},T.exports.TValue=Y,T.exports.UTF8BUFFSZ=ue,T.exports.intarith=function(ke,ve,Re,be){return ve===N.LUA_OPADD?0|Re+be:ve===N.LUA_OPSUB?0|Re-be:ve===N.LUA_OPMUL?0|Re*be:ve===N.LUA_OPMOD?0|Re-_Mathfloor(Re/be)*be:ve===N.LUA_OPIDIV?0|Re/be:ve===N.LUA_OPBAND?Re&be:ve===N.LUA_OPBOR?Re|be:ve===N.LUA_OPBXOR?Re^be:ve===N.LUA_OPSHL?Re<<be:ve===N.LUA_OPSHR?Re>>be:ve===N.LUA_OPUNM?0|0-Re:ve===N.LUA_OPBNOT?-1^Re:void 0},T.exports.luaO_chunkid=function(ke,ve){ke=ke instanceof Y?ke.value:ke,ve=ve instanceof Y?ve.value:ve;let Re=ke.length,be=[];if(ke[0]===H['='])be=Re<ve?ke.slice(1):be.concat(ke.slice(1,ve));else if(ke[0]===H['@'])Re<=ve?be=ke.slice(1):(ve-=Q.length,be=Q.concat(ke.slice(1,Re-ve)));else{let Se=ke.indexOf(H['\n']),Ne=-1<Se?ke.slice(Se):null;be=$,ve-=$.length+Q.length+ee.length+1,Re<ve&&null===Ne?be=be.concat(ke):(null!==Ne&&(Re=Ne.length-ke.length),Re>ve&&(Re=ve),be=be.concat(ke).concat(Q)),be=be.concat(ee)}return be},T.exports.luaO_hexavalue=ae,T.exports.luaO_int2fb=function(ke){let ve=0;if(8>ke)return ke;for(;128<=ke;)ke=ke+15>>4,ve+=4;for(;16<=ke;)ke=ke+1>>1,ve++;return ve+1<<3|ke-8},T.exports.luaO_pushfstring=Oe,T.exports.luaO_pushvfstring=he,T.exports.luaO_str2num=function(ke){let ve=Le(ke);return null===ve?(ve=pe(ke),null!=ve&&new Y(F.LUA_TNUMFLT,ve)):new Y(F.LUA_TNUMINT,ve)},T.exports.luaO_utf8desc=function(ke,ve){let Re=1;if(E(1114111>=ve),128>ve)ke[ue-1]=ve;else{let be=63;do ke[ue-Re++]=128|63&ve,ve>>=6,be>>=1;while(ve>be);ke[ue-Re]=~be<<1|ve}return Re},T.exports.luaO_utf8esc=function(ke){let ve=[],Re=1;if(E(1114111>=ke),128>ke)ve[ue-1]=ke;else{let be=63;do ve[ue-Re++]=128|63&ke,ke>>=6,be>>=1;while(ke>be);ve[ue-Re]=~be<<1|ke}return{buff:ve,n:Re}},T.exports.numarith=function(ke,ve,Re,be){return ve===N.LUA_OPADD?Re+be:ve===N.LUA_OPSUB?Re-be:ve===N.LUA_OPMUL?Re*be:ve===N.LUA_OPDIV?Re/be:ve===N.LUA_OPPOW?_Mathpow(Re,be):ve===N.LUA_OPIDIV?Re/be:ve===N.LUA_OPUNM?-Re:ve===N.LUA_OPMOD?Re%be:void 0}},function(T,O,U){'use strict';(function(E){const N=U(2),I=U(51),M='_LOADED',K=N.to_luastring('FILE*',!0),G=10,F=11,H=function(et,at,lt){if(0===lt||!N.lua_istable(et,-1))return 0;for(N.lua_pushnil(et);N.lua_next(et,-2);){if(N.lua_type(et,-2)===N.LUA_TSTRING){if(N.lua_rawequal(et,at,-1))return N.lua_pop(et,1),1;if(H(et,at,lt-1))return N.lua_remove(et,-2),N.lua_pushliteral(et,'.'),N.lua_insert(et,-2),N.lua_concat(et,3),1}N.lua_pop(et,1)}return 0},Y=function(et,at){let lt=N.lua_gettop(et);if(N.lua_getinfo(et,['f'.charCodeAt(0)],at),N.lua_getfield(et,N.LUA_REGISTRYINDEX,N.to_luastring(M,!0)),H(et,lt+1,2)){let ut=N.lua_tostring(et,-1);return N.to_jsstring(ut).startsWith('_G.')&&(N.lua_pushstring(et,ut.slice(3)),N.lua_remove(et,-2)),N.lua_copy(et,-1,lt+1),N.lua_pop(et,2),1}return N.lua_settop(et,lt),0},J=function(et,at){Y(et,at)?(N.lua_pushfstring(et,N.to_luastring('function \'%s\''),N.lua_tostring(et,-1)),N.lua_remove(et,-2)):at.namewhat?N.lua_pushfstring(et,N.to_luastring('%s \'%s\''),at.namewhat,at.name):at.what&&at.what[0]==='m'.charCodeAt(0)?N.lua_pushliteral(et,'main chunk'):at.what&&at.what[0]!='C'.charCodeAt(0)?N.lua_pushfstring(et,N.to_luastring('function <%s:%d>'),at.short_src,at.linedefined):N.lua_pushliteral(et,'?')},q=function(et){let at=new N.lua_Debug,lt=1,ut=1;for(;N.lua_getstack(et,ut,at);)lt=ut,ut*=2;for(;lt<ut;){let rt=_Mathfloor((lt+ut)/2);N.lua_getstack(et,rt,at)?lt=rt+1:ut=rt}return ut-1},Z=function(et){throw new Error(`PANIC: unprotected error in call to Lua API (${N.lua_tojsstring(et,-1)})`)},Q=function(et,at,lt){let ut=new N.lua_Debug;return N.lua_getstack(et,0,ut)?(N.lua_getinfo(et,'n',ut),ut.namewhat===N.to_luastring('method',!0)&&(at--,0===at))?te(et,N.to_luastring('calling \'%s\' on bad self (%s)'),ut.name,lt):(null===ut.name&&(ut.name=Y(et,ut)?N.lua_tostring(et,-1):['?'.charCodeAt(0)]),te(et,N.to_luastring('bad argument #%d to \'%s\' (%s)'),at,ut.name,lt)):te(et,N.to_luastring('bad argument #%d (%s)'),at,lt)},$=function(et,at,lt){let ut=Fe(et,at,N.to_luastring('__name',!0))===N.LUA_TSTRING?N.lua_tostring(et,-1):N.lua_type(et,at)===N.LUA_TLIGHTUSERDATA?N.to_luastring('light userdata',!0):Le(et,at),rt=N.lua_pushfstring(et,N.to_luastring('%s expected, got %s'),lt,ut);return Q(et,at,rt)},ee=function(et,at){let lt=new N.lua_Debug;return N.lua_getstack(et,at,lt)&&(N.lua_getinfo(et,N.to_luastring('Sl',!0),lt),0<lt.currentline)?void N.lua_pushfstring(et,N.to_luastring('%s:%d: '),lt.short_src,lt.currentline):void N.lua_pushstring(et,[])},te=function(et,at,...lt){return ee(et,1),N.lua_pushvfstring(et,at,lt),N.lua_concat(et,2),N.lua_error(et)},ae=function(et,at,lt,ut){return at?(N.lua_pushboolean(et,1),1):(N.lua_pushnil(et),lt?N.lua_pushstring(et,N.to_luastring(`${N.to_jsstring(lt)}: ${ut.message}`)):N.lua_pushstring(et,N.to_luastring(ut.message)),N.lua_pushinteger(et,-ut.errno),3)},se=function(et,at){return N.lua_getfield(et,N.LUA_REGISTRYINDEX,at)},_e=function(et,at,lt){let ut=N.lua_touserdata(et,at);return null!==ut&&N.lua_getmetatable(et,at)?(se(et,lt),N.lua_rawequal(et,-1,-2)||(ut=null),N.lua_pop(et,2),ut):null},ce=function(et,at,lt){$(et,at,N.lua_typename(et,lt))},Le=function(et,at){return N.lua_typename(et,N.lua_type(et,at))},Oe=function(et,at){let lt=N.lua_tolstring(et,at);return(null===lt||void 0===lt)&&ce(et,at,N.LUA_TSTRING),lt},xe=function(et,at,lt){return 0>=N.lua_type(et,at)?lt:Oe(et,at)},Ee=function(et,at){N.lua_isnumber(et,at)?Q(et,at,N.to_luastring('number has no integer representation',!0)):ce(et,at,N.LUA_TNUMBER)},ve=function(et,at){let lt=N.lua_tointeger(et,at);return!1===lt&&Ee(et,at),lt},Se=function(et,at){at.L=et,at.b=[]},Ie=function(et,at,lt){et.b=et.b.concat(at.slice(0,lt))},Ce=Ie,De=function(et,at,lt,ut){return 0>=N.lua_type(et,lt)?ut:at(et,lt)},Ke=function(et,at){let lt=at.string;return at.string=null,lt},Be=function(et,at,lt,ut,rt){return N.lua_load(et,Ke,{string:at},ut,rt)},Ve=function(et,at,lt,ut){return Be(et,at,lt,ut,null)},Ge=function(et,at){return Ve(et,at,at.length,at)},Fe=function(et,at,lt){if(!N.lua_getmetatable(et,at))return N.LUA_TNIL;N.lua_pushstring(et,lt);let ut=N.lua_rawget(et,-2);return ut===N.LUA_TNIL&&N.lua_pop(et,2),ut},Xe=function(et,at,lt){return(at=N.lua_absindex(et,at),Fe(et,at,lt)!==N.LUA_TNIL)&&(N.lua_pushvalue(et,at),N.lua_call(et,1,1),!0)},Ye=function(et,at,lt){var ut=lt>>>0,rt=at.length,st=et.length+1-rt;loop:for(;ut<st;ut++){for(let nt=0;nt<rt;nt++)if(et[ut+nt]!==at[nt])continue loop;return ut}return-1},qe=function(et,at,lt){return N.lua_getfield(et,at,lt)===N.LUA_TTABLE||(N.lua_pop(et,1),at=N.lua_absindex(et,at),N.lua_newtable(et),N.lua_pushvalue(et,-1),N.lua_setfield(et,at,lt),!1)},We=function(et,at,lt){for(let ut in Ze(et,lt,N.to_luastring('too many upvalues',!0)),at){for(let rt=0;rt<lt;rt++)N.lua_pushvalue(et,-lt);N.lua_pushcclosure(et,at[ut],lt),N.lua_setfield(et,-(lt+2),N.to_luastring(ut))}N.lua_pop(et,lt)},Ze=function(et,at,lt){N.lua_checkstack(et,at)||(lt?te(et,N.to_luastring('stack overflow (%s)'),lt):te(et,N.to_luastring('stack overflow',!0)))};T.exports.LUA_FILEHANDLE=K,T.exports.LUA_LOADED_TABLE=M,T.exports.LUA_PRELOAD_TABLE='_PRELOAD',T.exports.luaL_Buffer=class{constructor(){this.b=null,this.L=null}},T.exports.luaL_addchar=function(et,at){et.b.push(at)},T.exports.luaL_addlstring=Ie,T.exports.luaL_addstring=Ce,T.exports.luaL_addvalue=function(et){let at=et.L,lt=N.lua_tostring(at,-1);Ce(et,lt),N.lua_remove(at,-1)},T.exports.luaL_argcheck=function(et,at,lt,ut){at||Q(et,lt,ut)},T.exports.luaL_argerror=Q,T.exports.luaL_buffinit=Se,T.exports.luaL_buffinitsize=function(et,at){return Se(et,at),at},T.exports.luaL_callmeta=Xe,T.exports.luaL_checkany=function(et,at){N.lua_type(et,at)===N.LUA_TNONE&&Q(et,at,N.to_luastring('value expected',!0))},T.exports.luaL_checkinteger=ve,T.exports.luaL_checklstring=Oe,T.exports.luaL_checknumber=function(et,at){let lt=N.lua_tonumber(et,at);return!1===lt&&ce(et,at,N.LUA_TNUMBER),lt},T.exports.luaL_checkstack=Ze,T.exports.luaL_checkstring=function(et,at){return Oe(et,at,null)},T.exports.luaL_checktype=function(et,at,lt){N.lua_type(et,at)!==lt&&ce(et,at,lt)},T.exports.luaL_checkudata=function(et,at,lt){let ut=_e(et,at,lt);return null===ut&&$(et,at,lt),ut},T.exports.luaL_dostring=function(et,at){return Ge(et,at)||N.lua_pcall(et,0,N.LUA_MULTRET,0)},T.exports.luaL_error=te,T.exports.luaL_execresult=function(et,at){let lt,ut;if(null===at)return N.lua_pushboolean(et,1),N.lua_pushliteral(et,'exit'),N.lua_pushinteger(et,0),3;if(at.status)lt='exit',ut=at.status;else if(at.signal)lt='signal',ut=at.signal;else return ae(et,0,null,at);return N.lua_pushnil(et),N.lua_pushliteral(et,lt),N.lua_pushinteger(et,ut),3},T.exports.luaL_fileresult=ae,T.exports.luaL_getmetafield=Fe,T.exports.luaL_getmetatable=se,T.exports.luaL_getsubtable=qe,T.exports.luaL_gsub=function(et,at,lt,ut){let st=[],rt;for(;0<=(rt=Ye(at,lt));)st.push(...at.slice(0,rt)),st.push(...ut),at=at.slice(rt+lt.length);return st.push(...at),N.lua_pushstring(et,st),N.lua_tostring(et,-1)},T.exports.luaL_len=function(et,at){N.lua_len(et,at);let lt=N.lua_tointegerx(et,-1);return!1===lt&&te(et,N.to_luastring('object length is not an integer',!0)),N.lua_pop(et,1),lt},T.exports.luaL_loadbuffer=Ve,T.exports.luaL_loadbufferx=Be,T.exports.luaL_loadstring=Ge,T.exports.luaL_newlib=function(et,at){N.lua_createtable(et),We(et,at,0)},T.exports.luaL_newmetatable=function(et,at){return se(et,at)===N.LUA_TNIL?(N.lua_pop(et,1),N.lua_createtable(et,0,2),N.lua_pushstring(et,at),N.lua_setfield(et,-2,N.to_luastring('__name')),N.lua_pushvalue(et,-1),N.lua_setfield(et,N.LUA_REGISTRYINDEX,at),1):0},T.exports.luaL_newstate=function(){let et=N.lua_newstate();return et&&N.lua_atpanic(et,Z),et},T.exports.luaL_openlibs=I.luaL_openlibs,T.exports.luaL_opt=De,T.exports.luaL_optinteger=function(et,at,lt){return De(et,ve,at,lt)},T.exports.luaL_optlstring=xe,T.exports.luaL_optstring=xe,T.exports.luaL_prepbuffsize=function(et){return et},T.exports.luaL_pushresult=function(et){let at=et.L;N.lua_pushstring(at,et.b)},T.exports.luaL_requiref=function(et,at,lt,ut){qe(et,N.LUA_REGISTRYINDEX,N.to_luastring(M)),N.lua_getfield(et,-1,at),N.lua_toboolean(et,-1)||(N.lua_pop(et,1),N.lua_pushcfunction(et,lt),N.lua_pushstring(et,at),N.lua_call(et,1,1),N.lua_pushvalue(et,-1),N.lua_setfield(et,-3,at)),N.lua_remove(et,-2),ut&&(N.lua_pushvalue(et,-1),N.lua_setglobal(et,at))},T.exports.luaL_setfuncs=We,T.exports.luaL_setmetatable=function(et,at){se(et,at),N.lua_setmetatable(et,-2)},T.exports.luaL_testudata=_e,T.exports.luaL_tolstring=function(et,at){if(Xe(et,at,N.to_luastring('__tostring',!0)))N.lua_isstring(et,-1)||te(et,N.to_luastring('\'__tostring\' must return a string',!0));else{let lt=N.lua_type(et,at);switch(lt){case N.LUA_TNUMBER:{if(N.lua_isinteger(et,at))N.lua_pushstring(et,N.to_luastring(N.lua_tointeger(et,at).toString()));else{let ot=N.lua_tonumber(et,at),_t=_Mathabs(ot),it;it=Object.is(ot,Infinity)?'inf':Object.is(ot,-Infinity)?'-inf':_NumberisNaN(ot)?'nan':1e14<=_t||0<_t&&1e-4>_t?ot.toExponential():ot.toPrecision(16).replace(/(\.[0-9][1-9]*)0+$/,'$1'),N.lua_pushstring(et,N.to_luastring(it))}break}case N.LUA_TSTRING:N.lua_pushvalue(et,at);break;case N.LUA_TBOOLEAN:N.lua_pushliteral(et,N.lua_toboolean(et,at)?'true':'false');break;case N.LUA_TNIL:N.lua_pushliteral(et,'nil');break;default:let ut=Fe(et,at,N.to_luastring('__name',!0)),rt=ut===N.LUA_TSTRING?N.lua_tostring(et,-1):Le(et,at),st=N.lua_topointer(et,at),nt;switch(lt){case N.LUA_TLIGHTUSERDATA:nt='<id NYI>';break;case N.LUA_TFUNCTION:if('function'==typeof st){nt='<id NYI>';break}case N.LUA_TTABLE:case N.LUA_TTHREAD:case N.LUA_TUSERDATA:nt=`0x${st.id.toString(16)}`;break;default:throw Error('unhandled type: '+lt);}N.lua_pushstring(et,N.to_luastring(`${N.to_jsstring(rt)}: ${nt}`)),ut!==N.LUA_TNIL&&N.lua_remove(et,-2);}}return N.lua_tolstring(et,-1)},T.exports.luaL_traceback=function(et,at,lt,ut){let rt=new N.lua_Debug,st=N.lua_gettop(et),nt=q(at),ot=nt-ut>G+F?G:-1;for(lt&&N.lua_pushstring(et,lt.concat('\n'.charCodeAt(0))),Ze(et,10,null),N.lua_pushliteral(et,'stack traceback:');N.lua_getstack(at,ut++,rt);)0==ot--?(N.lua_pushliteral(et,'\n\t...'),ut=nt-F+1):(N.lua_getinfo(at,N.to_luastring('Slnt',!0),rt),N.lua_pushstring(et,['\n'.charCodeAt(0),'\t'.charCodeAt(0)].concat(rt.short_src).concat([':'.charCodeAt(0)])),0<rt.currentline&&N.lua_pushliteral(et,`${rt.currentline}:`),N.lua_pushliteral(et,' in '),J(et,rt),rt.istailcall&&N.lua_pushliteral(et,'\n\t(...tail calls..)'),N.lua_concat(et,N.lua_gettop(et)-st));N.lua_concat(et,N.lua_gettop(et)-st)},T.exports.luaL_typename=Le,T.exports.luaL_where=ee,T.exports.lua_writestringerror=function(et){E.stderr?E.stderr.write(et):console.error(et)}}).call(O,U(18))},function(T,O,U){'use strict';const E=U(0),N=U(1);class I{constructor(H,Y){this.hash=null,this.realstring=Y}getstr(){return this.realstring}tsslen(){return this.realstring.length}}const P=function(H){return E(Array.isArray(H)),H.map((Y)=>`${Y}|`).join('')},V=function(H,Y){return new I(H,Y)};T.exports.luaS_eqlngstr=function(H,Y){return E(H instanceof I),E(Y instanceof I),H==Y||H.realstring.length==Y.realstring.length&&H.realstring.join()==Y.realstring.join()},T.exports.luaS_hash=P,T.exports.luaS_hashlongstr=function(H){return E(H instanceof I),null===H.hash&&(H.hash=P(H.getstr())),H.hash},T.exports.luaS_bless=V,T.exports.luaS_new=function(H,Y){return V(H,Y.slice(0))},T.exports.luaS_newliteral=function(H,Y){return V(H,N.to_luastring(Y))},T.exports.TString=I},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(9),M=U(11),P=U(5),K=U(20),V=U(15),G=U(10),F=U(16),H=U(12),Y=U(17),J=P.TValue,q=N.constant_types,W=N.thread_status,Z=function(De){return De.func.value.p.lineinfo?De.func.value.p.lineinfo[De.pcOff-1]:-1},Q=function(De){if(De.status===W.LUA_YIELD){let Ke=De.ci,Be=Ke.funcOff;Ke.func=De.stack[Ke.extra],Ke.funcOff=Ke.extra,Ke.extra=Be}},se=function(De,Ke){E(Ke<De.upvalues.length);let Be=De.upvalues[Ke].name;return null===Be?['?'.charCodeAt(0)]:Be.getstr()},ne=function(De,Ke){let Be=De.func.value.p.numparams;return Ke>=De.l_base-De.funcOff-Be?null:{pos:De.funcOff+Be+Ke,name:N.to_luastring('(*vararg)',!0)}},oe=function(De,Ke,Be){let Ge=null,Ve;if(Ke.callstatus&V.CIST_LUA){if(0>Be)return ne(Ke,-Be);Ve=Ke.l_base,Ge=M.luaF_getlocalname(Ke.func.value.p,Be,Ke.pcOff)}else Ve=Ke.funcOff+1;if(null===Ge){let we=Ke===De.ci?De.top:Ke.next.func;if(we-Ve>=Be&&0<Be)Ge=N.to_luastring('(*temporary)',!0);else return null}return{pos:Ve+(Be-1),name:Ge}},ce=function(De,Ke){if(null===Ke||Ke.type===q.LUA_TCCL)De.source=N.to_luastring('=[JS]',!0),De.linedefined=-1,De.lastlinedefined=-1,De.what='J';else{let Be=Ke.p;De.source=Be.source?Be.source.getstr():N.to_luastring('=?',!0),De.linedefined=Be.linedefined,De.lastlinedefined=Be.lastlinedefined,De.what=0===De.linedefined?N.to_luastring('main',!0):N.to_luastring('Lua',!0)}De.short_src=P.luaO_chunkid(De.source,H.LUA_IDSIZE)},de=function(De,Ke){if(null===Ke||Ke.c.type===q.LUA_TCCL)De.stack[De.top++]=new J(q.LUA_TNIL,null),E(De.top<=De.ci.top,'stack overflow');else{let Be=Ke.l.p.lineinfo,Ve=G.luaH_new(De);De.stack[De.top++]=new J(q.LUA_TTABLE,Ve),E(De.top<=De.ci.top,'stack overflow');let Ge=new J(q.LUA_TBOOLEAN,!0);for(let we=0;we<Ke.l.p.length;we++)G.luaH_setint(Ve,Be[we],Ge)}},Le=function(De,Ke){let Be={name:null,funcname:null};return null===Ke?null:Ke.callstatus&V.CIST_FIN?(Be.name=N.to_luastring('__gc',!0),Be.funcname=N.to_luastring('metamethod',!0),Be):!(Ke.callstatus&V.CIST_TAIL)&&Ke.previous.callstatus&V.CIST_LUA?Ue(De,Ke.previous):null},ge=function(De,Ke,Be,Ve,Ge){let we=1;for(;0<Ke.length;Ke=Ke.slice(1))switch(_StringfromCharCode(Ke[0])){case'S':{ce(Be,Ve);break}case'l':{Be.currentline=Ge&&Ge.callstatus&V.CIST_LUA?Z(Ge):-1;break}case'u':{Be.nups=null===Ve?0:Ve.nupvalues,null===Ve||Ve.type===q.LUA_TCCL?(Be.isvararg=!0,Be.nparams=0):(Be.isvararg=Ve.p.is_vararg,Be.nparams=Ve.p.numparams);break}case't':{Be.istailcall=Ge?Ge.callstatus&V.CIST_TAIL:0;break}case'n':{let Fe=Le(De,Ge);null===Fe?(Be.namewhat=null,Be.name=null):(Be.namewhat=Fe.funcname,Be.name=Fe.name);break}case'L':case'f':break;default:we=0;}return we},Te=function(De,Ke,Be){let Ve={name:null,funcname:null};if(K.ISK(Be)){let Ge=De.k[K.INDEXK(Be)];if(Ge.ttisstring())return Ve.name=Ge.svalue(),Ve}else{let Ge=xe(De,Ke,Be);if(Ge&&Ge.funcname[0]==='c'.charCodeAt(0))return Ge}return Ve.name=[N.char['?']],Ve},he=function(De,Ke){return De<Ke?-1:De},Oe=function(De,Ke,Be){let Ve=-1,Ge=0;for(let we=0;we<Ke;we++){let Fe=De.code[we],Xe=K.OpCodes[Fe.opcode],He=Fe.A;switch(Xe){case'OP_LOADNIL':{let je=Fe.B;He<=Be&&Be<=He+je&&(Ve=he(we,Ge));break}case'OP_TFORCALL':{Be>=He+2&&(Ve=he(we,Ge));break}case'OP_CALL':case'OP_TAILCALL':{Be>=He&&(Ve=he(we,Ge));break}case'OP_JMP':{let je=Fe.sBx,ze=we+1+je;we<ze&&ze<=Ke&&ze>Ge&&(Ge=ze);break}default:K.testAMode(Fe.opcode)&&Be===He&&(Ve=he(we,Ge));}}return Ve},xe=function(De,Ke,Be){let Ve={name:M.luaF_getlocalname(De,Be+1,Ke),funcname:null};if(Ve.name)return Ve.funcname=N.to_luastring('local',!0),Ve;let Ge=Oe(De,Ke,Be);if(-1!==Ge){let we=De.code[Ge],Fe=K.OpCodes[we.opcode];switch(Fe){case'OP_MOVE':{let Xe=we.B;if(Xe<we.A)return xe(De,Ge,Xe);break}case'OP_GETTABUP':case'OP_GETTABLE':{let Xe=we.C,He=we.B,je='OP_GETTABLE'===Fe?M.luaF_getlocalname(De,He+1,Ge):se(De,He);return Ve.name=Te(De,Ge,Xe).name,Ve.funcname=je&&'_ENV'===je?N.to_luastring('global',!0):N.to_luastring('field',!0),Ve}case'OP_GETUPVAL':return Ve.name=se(De,we.B),Ve.funcname=N.to_luastring('upvalue',!0),Ve;case'OP_LOADK':case'OP_LOADKX':{let Xe='OP_LOADK'===Fe?we.Bx:De.code[Ge+1].Ax;if(De.k[Xe].ttisstring())return Ve.name=De.k[Xe].tsvalue(),Ve.funcname=N.to_luastring('constant',!0),Ve;break}case'OP_SELF':{let Xe=we.C;return Ve.name=Te(De,Ge,Xe).name,Ve.funcname=N.to_luastring('method',!0),Ve}default:}}return null},Ue=function(De,Ke){let Be={name:null,funcname:null},Ve=0,Ge=Ke.func.value.p,we=Ke.pcOff-1,Fe=Ge.code[we];if(Ke.callstatus&V.CIST_HOOKED)return Be.name=[N.char['?']],Be.funcname=N.to_luastring('hook',!0),Be;switch(K.OpCodes[Fe.opcode]){case'OP_CALL':case'OP_TAILCALL':return xe(Ge,we,Fe.A);case'OP_TFORCALL':return Be.name=N.to_luastring('for iterator',!0),Be.funcname=N.to_luastring('for iterator',!0),Be;case'OP_SELF':case'OP_GETTABUP':case'OP_GETTABLE':Ve=F.TMS.TM_INDEX;break;case'OP_SETTABUP':case'OP_SETTABLE':Ve=F.TMS.TM_NEWINDEX;break;case'OP_ADD':Ve=F.TMS.OP_ADD;break;case'OP_SUB':Ve=F.TMS.OP_SUB;break;case'OP_MUL':Ve=F.TMS.OP_MUL;break;case'OP_MOD':Ve=F.TMS.OP_MOD;break;case'OP_POW':Ve=F.TMS.OP_POW;break;case'OP_DIV':Ve=F.TMS.OP_DIV;break;case'OP_IDIV':Ve=F.TMS.OP_IDI;break;case'OP_BAND':Ve=F.TMS.OP_BAN;break;case'OP_BOR':Ve=F.TMS.OP_BOR;break;case'OP_BXOR':Ve=F.TMS.OP_BXO;break;case'OP_SHL':Ve=F.TMS.OP_SHL;break;case'OP_SHR':Ve=F.TMS.OP_SHR;break;case'OP_UNM':Ve=F.TMS.TM_UNM;break;case'OP_BNOT':Ve=F.TMS.TM_BNOT;break;case'OP_LEN':Ve=F.TMS.TM_LEN;break;case'OP_CONCAT':Ve=F.TMS.TM_CONCAT;break;case'OP_EQ':Ve=F.TMS.TM_EQ;break;case'OP_LT':Ve=F.TMS.TM_LT;break;case'OP_LE':Ve=F.TMS.TM_LE;break;default:return null;}return Be.name=De.l_G.tmname[Ve].getstr(),Be.funcname=N.to_luastring('metamethod',!0),Be},Ee=function(De,Ke,Be){for(let Ve=Ke.l_base;Ve<Ke.top;Ve++)if(De.stack[Ve]===Be)return Ve;return!1},ke=function(De,Ke,Be){let Ve=Ke.func;for(let Ge=0;Ge<Ve.nupvalues;Ge++)if(Ve.upvals[Ge].val()===Be)return{name:se(Ve.p,Ge),funcname:N.to_luastring('upvalue',!0)};return null},ve=function(De,Ke){let Be=De.ci,Ve=null;if(Be.callstatus&V.CIST_LUA){Ve=ke(De,Be,Ke);let Ge=Ee(De,Be,Ke);!Ve&&Ge&&(Ve=xe(Be.func.value.p,Be.pcOff,Ge-Be.l_base))}return Ve?P.luaO_pushfstring(De,N.to_luastring(' (%s \'%s\')',!0),Ve.funcname,Ve.name):N.to_luastring('',!0)},Re=function(De,Ke,Be){let Ve=F.luaT_objtypename(De,Ke);Ce(De,N.to_luastring(`attempt to ${N.to_jsstring(Be)} a ${N.to_jsstring(Ve)} value${N.to_jsstring(ve(De,Ke))}`))},Ie=function(De,Ke,Be,Ve){let Ge;return Ge=Be?P.luaO_chunkid(Be.getstr(),H.LUA_IDSIZE):['?'.charCodeAt(0)],P.luaO_pushfstring(De,N.to_luastring('%s:%d: %s',!0),Ge,Ve,Ke)},Ce=function(De,Ke,...Be){let Ve=De.ci,Ge=P.luaO_pushvfstring(De,Ke,Be);Ve.callstatus&V.CIST_LUA&&Ie(De,Ge,Ve.func.value.p.source,Z(Ve)),Me(De)},Me=function(De){if(0!==De.errfunc){let Ke=De.errfunc;De.stack[De.top]=De.stack[De.top-1],De.stack[De.top-1]=De.stack[Ke],De.top++,I.luaD_callnoyield(De,De.top-2,1)}I.luaD_throw(De,W.LUA_ERRRUN)};T.exports.luaG_addinfo=Ie,T.exports.luaG_concaterror=function(De,Ke,Be){(Ke.ttisstring()||Ke.ttisnumber())&&(Ke=Be),Re(De,Ke,N.to_luastring('concatenate',!0))},T.exports.luaG_errormsg=Me,T.exports.luaG_opinterror=function(De,Ke,Be,Ve){!1===Y.tonumber(Ke)&&(Be=Ke),Re(De,Be,Ve)},T.exports.luaG_ordererror=function(De,Ke,Be){let Ve=F.luaT_objtypename(De,Ke),Ge=F.luaT_objtypename(De,Be);Ve.join()===Ge.join()?Ce(De,N.to_luastring(`attempt to compare two ${N.to_jsstring(Ve)} values`)):Ce(De,N.to_luastring(`attempt to compare ${N.to_jsstring(Ve)} with ${N.to_jsstring(Ge)}`))},T.exports.luaG_runerror=Ce,T.exports.luaG_tointerror=function(De,Ke,Be){let Ve=Y.tointeger(Ke);!1===Ve&&(Be=Ke),Ce(De,N.to_luastring(`number${N.to_jsstring(ve(De,Be))} has no integer representation`))},T.exports.luaG_traceexec=function(De){let Ke=De.ci,Be=De.hookmask,Ve=0==--De.hookcount&&Be&N.LUA_MASKCOUNT;if(Ve)De.hookcount=De.basehookcount;else if(!(Be&N.LUA_MASKLINE))return;if(Ke.callstatus&V.CIST_HOOKYIELD)return void(Ke.callstatus&=~V.CIST_HOOKYIELD);if(Ve&&I.luaD_hook(De,N.LUA_HOOKCOUNT,-1),Be&N.LUA_MASKLINE){let Ge=Ke.func.value.p,we=Ke.pcOff,Fe=Ge.lineinfo?Ge.lineinfo[we]:-1;(0===we||Ke.pcOff<=De.oldpc||Fe!==Ge.lineinfo?Ge.lineinfo[De.oldpc]:-1)&&I.luaD_hook(De,N.LUA_HOOKLINE,Fe)}De.oldpc=Ke.pcOff,De.status===W.LUA_YIELD&&(Ve&&(De.hookcount=1),Ke.l_savedpc--,Ke.callstatus|=V.CIST_HOOKYIELD,Ke.func=De.top-1,I.luaD_throw(De,W.LUA_YIELD))},T.exports.luaG_typeerror=Re,T.exports.lua_gethook=function(De){return De.hook},T.exports.lua_gethookcount=function(De){return De.basehookcount},T.exports.lua_gethookmask=function(De){return De.hookmask},T.exports.lua_getinfo=function(De,Ke,Be){let Ve,Ge,we,Fe,Xe;return Q(De),Ke[0]==='>'.charCodeAt(0)?(we=null,Xe=De.top-1,Fe=De.stack[Xe],E(De,Fe.ttisfunction(),'function expected'),Ke=Ke.slice(1),De.top--):(we=Be.i_ci,Fe=we.func,Xe=we.funcOff,E(we.func.ttisfunction())),Ge=Fe.ttisclosure()?Fe.value:null,Ve=ge(De,Ke,Be,Ge,we),0<=Ke.indexOf('f'.charCodeAt(0))&&(De.stack[De.top++]=Fe,E(De.top<=De.ci.top,'stack overflow')),Q(De),0<=Ke.indexOf('L'.charCodeAt(0))&&de(De,Ge),Ve},T.exports.lua_getlocal=function(De,Ke,Be){let Ve;if(Q(De),null===Ke)Ve=De.stack[De.top-1].ttisLclosure()?M.luaF_getlocalname(De.stack[De.top-1].value.p,Be,0):null;else{let Ge=oe(De,Ke.i_ci,Be);if(Ge){Ve=Ge.name;let we=De.stack[Ge.pos];De.stack[De.top++]=new J(we.type,we.value)}else Ve=null}return Q(De),Ve},T.exports.lua_getstack=function(De,Ke,Be){let Ve,Ge;if(0>Ke)return 0;for(Ve=De.ci;0<Ke&&Ve!==De.base_ci;Ve=Ve.previous)Ke--;return 0===Ke&&Ve!==De.base_ci?(Ge=1,Be.i_ci=Ve):Ge=0,Ge},T.exports.lua_sethook=function(De,Ke,Be,Ve){(null===Ke||0===Be)&&(Be=0,Ke=null),De.ci.callstatus&V.CIST_LUA&&(De.oldpc=De.ci.pcOff),De.hook=Ke,De.basehookcount=Ve,De.hookcount=De.basehookcount,De.hookmask=Be},T.exports.lua_setlocal=function(De,Ke,Be){Q(De);let Ve=oe(De,Ke.i_ci,Be),Ge=Ve.name,we=Ve.pos;return Ge&&(De.stack[we].type=De.stack[De.top-1].type,De.stack[we].value=De.stack[De.top-1].value,De.top--),Q(De),Ge}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(21),M=U(8),P=U(11),K=U(19),V=U(4),G=U(5),F=U(29),H=U(15),Y=U(7),J=U(16),q=U(53),W=U(17),Z=N.constant_types,Q=N.thread_status,$=function(Ie,Ce,Me){switch(Ce){case Q.LUA_ERRMEM:{Ie.stack[Me]=new G.TValue(Z.LUA_TLNGSTR,Y.luaS_newliteral(Ie,'not enough memory'));break}case Q.LUA_ERRERR:{Ie.stack[Me]=new G.TValue(Z.LUA_TLNGSTR,Y.luaS_newliteral(Ie,'error in error handling'));break}default:Ie.stack[Me]=Ie.stack[Ie.top-1];}Ie.top=Me+1},ee=function(Ie,Ce,Me){let Pe=Ie.stack[Ce],ye;switch(Pe.type){case Z.LUA_TCCL:case Z.LUA_TLCF:{let De=Pe.type===Z.LUA_TCCL?Pe.value.f:Pe.value;Ie.ci.next?(Ie.ci=Ie.ci.next,ye=Ie.ci):(ye=new H.CallInfo(Ce),Ie.ci.next=ye,ye.previous=Ie.ci,ye.next=null,Ie.ci=ye,Ie.ciOff++),ye.nresults=Me,ye.func=Pe,ye.funcOff=Ce,ye.top=Ie.top+N.LUA_MINSTACK,ye.callstatus=0,Ie.hookmask&N.LUA_MASKCALL&&ue(Ie,N.LUA_HOOKCALL,-1);let Ke=De(Ie);return E('number'==typeof Ke&&0<=Ke&&(0|Ke)===Ke,'invalid return value from JS function (expected integer)'),E(Ke<Ie.top-Ie.ci.funcOff,'not enough elements in the stack'),te(Ie,ye,Ie.top-Ke,Ke),!0}case Z.LUA_TLCL:{let De=Pe.value.p,Ke=Ie.top-Ce-1,Be=De.maxstacksize,Ve;if(De.is_vararg)Ve=se(Ie,De,Ke);else{for(;Ke<De.numparams;Ke++)Ie.stack[Ie.top++]=new G.TValue(Z.LUA_TNIL,null);Ve=Ce+1}return Ie.ci.next?(Ie.ci=Ie.ci.next,ye=Ie.ci):(ye=new H.CallInfo(Ce),Ie.ci.next=ye,ye.previous=Ie.ci,ye.next=null,Ie.ci=ye,Ie.ciOff++),ye.nresults=Me,ye.func=Pe,ye.funcOff=Ce,ye.l_base=Ve,ye.top=Ve+Be,Ie.top=ye.top,ye.l_savedpc=De.code,ye.pcOff=0,ye.callstatus=H.CIST_LUA,!1}default:return ne(Ie,Ce,Pe),ee(Ie,Ce,Me);}},te=function(Ie,Ce,Me,Pe){let ye=Ce.nresults;Ie.hookmask&(N.LUA_MASKRET|N.LUA_MASKLINE)&&(Ie.hookmask&N.LUA_MASKRET&&ue(Ie,N.LUA_HOOKRET,-1),Ie.oldpc=Ce.previous.pcOff);let De=Ce.funcOff;return Ie.ci=Ce.previous,Ie.ciOff--,ae(Ie,Me,De,Pe,ye)},ae=function(Ie,Ce,Me,Pe,ye){switch(ye){case 0:break;case 1:{0===Pe&&(Ie.stack[Ce]=G.luaO_nilobject),Ie.stack[Me]=Ie.stack[Ce];break}case N.LUA_MULTRET:{for(let De=0;De<Pe;De++)Ie.stack[Me+De]=Ie.stack[Ce+De];return Ie.top=Me+Pe,!1}default:{let De;if(ye<=Pe)for(De=0;De<ye;De++)Ie.stack[Me+De]=Ie.stack[Ce+De];else{for(De=0;De<Pe;De++)Ie.stack[Me+De]=Ie.stack[Ce+De];for(;De<ye;De++)Ie.stack[Me+De]=new G.TValue(Z.LUA_TNIL,null)}break}}return Ie.top=Me+ye,!0},ue=function(Ie,Ce,Me){let Pe=Ie.hook;if(Pe&&Ie.allowhook){let ye=Ie.ci,De=Ie.top,Ke=ye.top,Be=new N.lua_Debug;Be.event=Ce,Be.currentline=Me,Be.i_ci=ye,ye.top=Ie.top+N.LUA_MINSTACK,Ie.allowhook=0,ye.callstatus|=H.CIST_HOOKED,Pe(Ie,Be),E(!Ie.allowhook),Ie.allowhook=1,ye.top=Ke,Ie.top=De,ye.callstatus&=~H.CIST_HOOKED}},se=function(Ie,Ce,Me){let Pe=Ce.numparams,ye=Ie.top-Me,De=Ie.top,Ke;for(Ke=0;Ke<Pe&&Ke<Me;Ke++)Ie.stack[Ie.top++]=Ie.stack[ye+Ke],Ie.stack[ye+Ke]=new G.TValue(Z.LUA_TNIL,null);for(;Ke<Pe;Ke++)Ie.stack[Ie.top++]=new G.TValue(Z.LUA_TNIL,null);return De},ne=function(Ie,Ce,Me){let Pe=J.luaT_gettmbyobj(Ie,Me,J.TMS.TM_CALL);Pe.ttisfunction(Pe)||M.luaG_typeerror(Ie,Me,N.to_luastring('call',!0));for(let ye=Ie.top;ye>Ce;ye--)Ie.stack[ye]=Ie.stack[ye-1];Ie.top++,Ie.stack[Ce]=new G.TValue(Pe.type,Pe.value)},oe=function(Ie){Ie.nCcalls===V.LUAI_MAXCCALLS?M.luaG_runerror(Ie,'JS stack overflow'):Ie.nCcalls>=V.LUAI_MAXCCALLS+(V.LUAI_MAXCCALLS>>3)&&pe(Ie,Q.LUA_ERRERR)},_e=function(Ie,Ce,Me){++Ie.nCcalls>=V.LUAI_MAXCCALLS&&oe(Ie),ee(Ie,Ce,Me)||W.luaV_execute(Ie),Ie.nCcalls--},pe=function(Ie,Ce){if(Ie.errorJmp)throw Ie.errorJmp.status=Ce,Ie.errorJmp;else{let Me=Ie.l_G;if(Ie.status=Ce,Me.mainthread.errorJmp)Me.mainthread.stack[Me.mainthread.top++]=Ie.stack[Ie.top-1],pe(Me.mainthread,Ce);else throw Me.panic&&($(Ie,Ce,Ie.top),Ie.ci.top<Ie.top&&(Ie.ci.top=Ie.top),Me.panic(Ie)),new Error(`Aborted ${Ce}`)}},ce=function(Ie,Ce,Me){let Pe=Ie.nCcalls,ye={status:Q.LUA_OK,previous:Ie.errorJmp};Ie.errorJmp=ye;try{Ce(Ie,Me)}catch(De){if(ye.status===Q.LUA_OK){ye.status=-1;try{I.lua_pushlightuserdata(Ie,De),M.luaG_errormsg(Ie)}catch(Ke){}}}return Ie.errorJmp=ye.previous,Ie.nCcalls=Pe,ye.status},de=function(Ie,Ce){let Me=Ie.ci;E(null!==Me.c_k&&0===Ie.nny),E(Me.callstatus&H.CIST_YPCALL||Ce===Q.LUA_YIELD),Me.callstatus&Q.CIST_YPCALL&&(Me.callstatus&=~Q.CIST_YPCALL,Ie.errfunc=Me.c_old_errfunc),Me.nresults===N.LUA_MULTRET&&Ie.ci.top<Ie.top&&(Ie.ci.top=Ie.top);let Pe=Me.c_k(Ie,Ce,Me.c_ctx);E(Pe<Ie.top-Ie.ci.funcOff,'not enough elements in the stack'),te(Ie,Me,Ie.top-Pe,Pe)},Le=function(Ie,Ce){for(null!==Ce&&de(Ie,Ce);Ie.ci!==Ie.base_ci;)Ie.ci.callstatus&H.CIST_LUA?(W.luaV_finishOp(Ie),W.luaV_execute(Ie)):de(Ie,H.LUA_YIELD)},ge=function(Ie){for(let Ce=Ie.ci;null!==Ce;Ce=Ce.previous)if(Ce.callstatus&H.CIST_YPCALL)return Ce;return null},Ae=function(Ie,Ce){let Me=ge(Ie);if(null===Me)return 0;let Pe=Ie.stack[Me.extra];return P.luaF_close(Ie,Pe),$(Ie,Ce,Pe),Ie.ci=Me,Ie.allowhook=Me.callstatus&H.CIST_OAH,Ie.nny=0,Ie.errfunc=Me.c_old_errfunc,1},Te=function(Ie,Ce,Me){return Ie.top-=Me,Ie.stack[Ie.top++]=new G.TValue(Z.LUA_TLNGSTR,Y.luaS_newliteral(Ie,Ce)),E(Ie.top<=Ie.ci.top,'stack overflow'),Q.LUA_ERRRUN},he=function(Ie,Ce){let Me=Ie.top-Ce,Pe=Ie.ci;Ie.status===Q.LUA_OK?!ee(Ie,Me-1,N.LUA_MULTRET)&&W.luaV_execute(Ie):(E(Ie.status===Q.LUA_YIELD),Ie.status=Q.LUA_OK,Pe.funcOff=Pe.extra,Pe.func=Ie.stack[Pe.funcOff],Pe.callstatus&H.CIST_LUA?W.luaV_execute(Ie):(null!==Pe.c_k&&(Ce=Pe.c_k(Ie,Q.LUA_YIELD,Pe.c_ctx),E(Ce<Ie.top-Ie.ci.funcOff,'not enough elements in the stack'),Me=Ie.top-Ce),te(Ie,Pe,Me,Ce)),Le(Ie,null))},Ue=function(Ie,Ce,Me,Pe){let ye=Ie.ci;return E(Ce<Ie.top-Ie.ci.funcOff,'not enough elements in the stack'),0<Ie.nny&&(Ie===Ie.l_G.mainthread?M.luaG_runerror(Ie,N.to_luastring('attempt to yield from outside a coroutine',!0)):M.luaG_runerror(Ie,N.to_luastring('attempt to yield across a JS-call boundary',!0))),Ie.status=Q.LUA_YIELD,ye.extra=ye.funcOff,ye.callstatus&H.CIST_LUA?E(null===Pe,'hooks cannot continue after yielding'):(ye.c_k=Pe,null!==Pe&&(ye.c_ctx=Me),ye.funcOff=Ie.top-Ce-1,ye.func=Ie.stack[ye.funcOff],pe(Ie,Q.LUA_YIELD)),E(ye.callstatus&H.CIST_HOOKED),0},ke=function(Ie,Ce,Me,Pe,ye){let De=Ie.ci,Ke=Ie.allowhook,Be=Ie.nny,Ve=Ie.errfunc;Ie.errfunc=ye;let Ge=ce(Ie,Ce,Me);return Ge!==Q.LUA_OK&&(P.luaF_close(Ie,Pe),$(Ie,Ge,Pe),Ie.ci=De,Ie.allowhook=Ke,Ie.nny=Be),Ie.errfunc=Ve,Ge};class Re{constructor(){this.z=new K.MBuffer,this.buff=new K.MBuffer,this.dyd=new F.Dyndata,this.mode=null,this.name=null}}const be=function(Ie,Ce,Me){Ce&&-1===Ce.indexOf(Me[0])&&(I.lua_pushstring(Ie,N.to_luastring(`attempt to load a ${N.to_jsstring(Me)} chunk (mode is '${N.to_jsstring(Ce)}')`)),pe(Ie,Q.LUA_ERRSYNTAX))},Se=function(Ie,Ce){let Pe=Ce.z.getc(),Me;Pe===N.LUA_SIGNATURE.charCodeAt(0)?(be(Ie,Ce.mode,N.to_luastring('binary',!0)),Me=q.luaU_undump(Ie,Ce.z,Ce.name)):(be(Ie,Ce.mode,N.to_luastring('text',!0)),Me=F.luaY_parser(Ie,Ce.z,Ce.buff,Ce.dyd,Ce.name,Pe)),E(Me.nupvalues===Me.p.upvalues.length),P.luaF_initupvals(Ie,Me)};T.exports.SParser=Re,T.exports.adjust_varargs=se,T.exports.luaD_call=_e,T.exports.luaD_callnoyield=function(Ie,Ce,Me){Ie.nny++,_e(Ie,Ce,Me),Ie.nny--},T.exports.luaD_hook=ue,T.exports.luaD_pcall=ke,T.exports.luaD_poscall=te,T.exports.luaD_precall=ee,T.exports.luaD_protectedparser=function(Ie,Ce,Me,Pe){let ye=new Re;Ie.nny++,ye.z=Ce,ye.buff.L=Ie,ye.name=Me,ye.mode=Pe,ye.dyd.actvar.arr=[],ye.dyd.actvar.size=0,ye.dyd.gt.arr=[],ye.dyd.gt.size=0,ye.dyd.label.arr=[],ye.dyd.label.size=0;let De=ke(Ie,Se,ye,Ie.top,Ie.errfunc);return Ie.nny--,De},T.exports.luaD_rawrunprotected=ce,T.exports.luaD_throw=pe,T.exports.lua_isyieldable=function(Ie){return 0===Ie.nny},T.exports.lua_resume=function(Ie,Ce,Me){let Pe=Ie.nny;if(Ie.status===Q.LUA_OK){if(Ie.ci!==Ie.base_ci)return Te(Ie,'cannot resume non-suspended coroutine',Me);}else if(Ie.status!==Q.LUA_YIELD)return Te(Ie,'cannot resume dead coroutine',Me);if(Ie.nCcalls=Ce?Ce.nCcalls+1:1,Ie.nCcalls>=V.LUAI_MAXCCALLS)return Te(Ie,'JS stack overflow',Me);Ie.nny=0,E((Ie.status===Q.LUA_OK?Me+1:Me)<Ie.top-Ie.ci.funcOff,'not enough elements in the stack');let ye=ce(Ie,he,Me);if(-1===ye)ye=Q.LUA_ERRRUN;else{for(;ye>Q.LUA_YIELD&&Ae(Ie,ye);)ye=ce(Ie,Le,ye);ye>Q.LUA_YIELD?(Ie.status=ye,$(Ie,ye,Ie.top),Ie.ci.top=Ie.top):E(ye===Ie.status)}return Ie.nny=Pe,Ie.nCcalls--,E(Ie.nCcalls===(Ce?Ce.nCcalls:0)),ye},T.exports.lua_yield=function(Ie,Ce){Ue(Ie,Ce,0,null)},T.exports.lua_yieldk=Ue,T.exports.moveresults=ae,T.exports.stackerror=oe,T.exports.tryfuncTM=ne},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(8),M=U(5),P=U(7),K=N.constant_types,V=function(ae){switch(ae.type){case K.LUA_TBOOLEAN:case K.LUA_TLIGHTUSERDATA:case K.LUA_TNUMFLT:case K.LUA_TNUMINT:case K.LUA_TTABLE:case K.LUA_TLCL:case K.LUA_TLCF:case K.LUA_TCCL:case K.LUA_TUSERDATA:case K.LUA_TTHREAD:return ae.value;case K.LUA_TSHRSTR:case K.LUA_TLNGSTR:return P.luaS_hashlongstr(ae.tsvalue());default:throw new Error('unknown key type: '+ae.type);}};class G{constructor(ae){this.id=ae.l_G.id_counter++,this.strong=new Map,this.metatable=null}}const H=function(ae,ue){let se=ae.strong.get(ue);return se?se.value:M.luaO_nilobject},Y=function(ae,ue){return E('number'==typeof ue&&(0|ue)===ue),H(ae,ue)},W=function(ae,ue,se){let ne=ae.strong.get(ue);if(ne)return ne.value;let oe=new M.TValue(K.LUA_TNIL,null);return ae.strong.set(ue,{key:se,value:oe}),oe};T.exports.luaH_delete=function(ae,ue){E(ue instanceof M.TValue);let se=V(ue);ae.strong.delete(se)},T.exports.luaH_get=function(ae,ue){return E(ue instanceof M.TValue),ue.ttisnil()?M.luaO_nilobject:H(ae,V(ue))},T.exports.luaH_getint=Y,T.exports.luaH_getn=function(ae){let ue=0,se=ae.strong.size+1;for(;1<se-ue;){let ne=_Mathfloor((ue+se)/2);Y(ae,ne).ttisnil()?se=ne:ue=ne}return ue},T.exports.luaH_getstr=function(ae,ue){return E(ue instanceof P.TString),H(ae,P.luaS_hashlongstr(ue))},T.exports.luaH_set=function(ae,ue){E(ue instanceof M.TValue);let se=V(ue);return W(ae,se,new M.TValue(ue.type,ue.value))},T.exports.luaH_setint=function(ae,ue,se){E('number'==typeof ue&&(0|ue)===ue&&se instanceof M.TValue);let ne=ue,oe=ae.strong.get(ne);if(oe){let _e=oe.value;_e.setfrom(se)}else ae.strong.set(ne,{key:new M.TValue(K.LUA_TNUMINT,ue),value:new M.TValue(se.type,se.value)})},T.exports.luaH_new=function(ae){return new G(ae)},T.exports.luaH_next=function(ae,ue,se){let ne=ae.stack[se],oe;if(ne.type===K.LUA_TNIL)oe=ue.strong.keys().next();else{let pe=V(ne);if(!ue.strong.has(pe))return I.luaG_runerror(ae,'invalid key to \'next\'');let ce=ue.strong.keys();for(;;){let de=ce.next();if(de.done)throw'unreachable';else if(de.value==pe)break}oe=ce.next()}if(oe.done)return!1;let _e=ue.strong.get(oe.value);return ae.stack[se]=new M.TValue(_e.key.type,_e.key.value),ae.stack[se+1]=new M.TValue(_e.value.type,_e.value.value),!0}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(5),M=N.constant_types;class K{constructor(){this.L=null,this.v=null,this.open_next=null,this.refcount=0,this.value=null}val(){return null===this.v?this.value:this.L.stack[this.v]}isopen(){return null!==this.v}}T.exports.MAXUPVAL=255,T.exports.Proto=class{constructor(J){this.id=J.l_G.id_counter++,this.k=[],this.p=[],this.code=[],this.cache=null,this.lineinfo=[],this.upvalues=[],this.numparams=0,this.is_vararg=0,this.maxstacksize=0,this.locvars=[],this.linedefined=0,this.lastlinedefined=0,this.source=null}},T.exports.UpVal=K,T.exports.luaF_findupval=function(J,q){let W=J.openupval,Z=W;for(;null!==W&&W.v>=q;){if(Z=W,E(Z.isopen()),Z.v===q)return Z;W=Z.open_next}let Q=new K;return Z&&(Q.open_next=Z),J.openupval=Q,Q.L=J,Q.v=q,Q},T.exports.luaF_close=function(J,q){for(;null!==J.openupval&&J.openupval.v>=q;){let W=J.openupval;if(E(W.isopen()),J.openupval=W.open_next,0<W.refcount){let Z=W.L.stack[W.v];W.L=null,W.v=null,W.value=new I.TValue(Z.type,Z.value)}}},T.exports.luaF_getlocalname=function(J,q,W){for(let Z=0;Z<J.locvars.length&&J.locvars[Z].startpc<=W;Z++)if(W<J.locvars[Z].endpc&&(q--,0===q))return J.locvars[Z].varname.getstr();return null},T.exports.luaF_initupvals=function(J,q){for(let W=0,Z;W<q.nupvalues;W++)Z=new K(J),Z.refcount=1,Z.value=new I.TValue(M.LUA_TNIL,null),q.upvals[W]=Z},T.exports.luaF_newLclosure=function(J,q){let W=new I.LClosure(J,q);return W}},function(T,O,U){'use strict';const E=U(4),P='',V=`%${P}d`,Y=function(J,q){for(var W=_Mathmin(3,_Mathceil(_Mathabs(q)/1023)),Z=J,Q=0;Q<W;Q++)Z*=_Mathpow(2,_Mathfloor((q+Q)/W));return Z};T.exports.frexp=function(J){if(0===J)return[J,0];var q=new DataView(new ArrayBuffer(8));q.setFloat64(0,J);var W=2047&q.getUint32(0)>>>20;0==W&&(q.setFloat64(0,18446744073709552000*J),W=(2047&q.getUint32(0)>>>20)-64);var Z=W-1022,Q=Y(J,-Z);return[Q,Z]},T.exports.ldexp=Y,T.exports.LUAI_MAXSTACK=1e6,T.exports.LUA_IDSIZE=60,T.exports.LUA_INTEGER_FMT=V,T.exports.LUA_INTEGER_FRMLEN=P,T.exports.LUA_NUMBER_FMT='%.14g',T.exports.LUA_NUMBER_FRMLEN='',T.exports.lua_getlocaledecpoint=function(){return 1.1.toLocaleString().substring(1,2)},T.exports.lua_numbertointeger=function(J){return J>=E.MIN_INT&&J<-E.MIN_INT?J:0}},function(T,O){(function(U){T.exports=U}).call(O,{})},function(T){T.exports=function(U){return U.webpackPolyfill||(U.deprecate=function(){},U.paths=[],!U.children&&(U.children=[]),Object.defineProperty(U,'loaded',{enumerable:!0,get:function(){return U.l}}),Object.defineProperty(U,'id',{enumerable:!0,get:function(){return U.i}}),U.webpackPolyfill=1),U}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(5),M=U(9),P=U(21),K=U(10),V=U(11),G=U(16),F=N.constant_types,H=N.thread_status,Y=N.LUA_NUMTAGS,J=2*N.LUA_MINSTACK;class q{constructor(oe,_e,pe,ce,de,Le){this.func=_e,this.funcOff=oe,this.top=pe,this.previous=de,this.next=Le,this.pcOff=0,this.l_base=ce,this.l_savedpc=[],this.c_k=null,this.c_old_errfunc=null,this.c_ctx=null,this.nresults=0,this.callstatus=0}}class W{constructor(){this.id=null,this.base_ci=new q,this.top=0,this.ci=null,this.ciOff=null,this.stack=[],this.openupval=null,this.status=H.LUA_OK,this.next=null,this.errorJmp=null,this.nny=1,this.errfunc=0}}class Z{constructor(oe){this.id_counter=0,this.mainthread=oe,this.l_registry=new I.TValue(F.LUA_TNIL,null),this.panic=null,this.version=null,this.tmname=Array(G.TMS.TM_N),this.mt=Array(Y)}}const Q=function(oe){oe.stack=Array(J),oe.top=0;let pe=oe.base_ci;pe.next=pe.previous=null,pe.callstatus=0,pe.func=oe.stack[oe.top],pe.funcOff=oe.top,oe.stack[oe.top++]=new I.TValue(F.LUA_TNIL,null),pe.top=oe.top+N.LUA_MINSTACK,oe.ci=pe},$=function(oe,_e){let pe=K.luaH_new(oe);_e.l_registry.sethvalue(pe),K.luaH_setint(pe,N.LUA_RIDX_MAINTHREAD,new I.TValue(F.LUA_TTHREAD,oe)),K.luaH_setint(pe,N.LUA_RIDX_GLOBALS,new I.TValue(F.LUA_TTABLE,K.luaH_new(oe)))},ee=function(oe){let _e=oe.l_G;Q(oe,oe),$(oe,_e),G.luaT_init(oe),_e.version=P.lua_version(null)},te=function(oe,_e){oe.id=_e.id_counter++,oe.l_G=_e,oe.stack=[],oe.ci=null,oe.nci=0,oe.errorJmp=null,oe.nCcalls=0,oe.hook=null,oe.hookmask=0,oe.basehookcount=0,oe.allowhook=1,oe.hookcount=oe.basehookcount,oe.openupval=null,oe.nny=1,oe.status=H.LUA_OK,oe.errfunc=0},se=function(oe){V.luaF_close(oe,oe.stack)};T.exports.lua_State=W,T.exports.CallInfo=q,T.exports.CIST_OAH=1,T.exports.CIST_LUA=2,T.exports.CIST_HOOKED=4,T.exports.CIST_FRESH=8,T.exports.CIST_YPCALL=16,T.exports.CIST_TAIL=32,T.exports.CIST_HOOKYIELD=64,T.exports.CIST_LEQ=128,T.exports.CIST_FIN=256,T.exports.lua_close=function(oe){oe=oe.l_G.mainthread,se(oe)},T.exports.lua_newstate=function(){let oe=new W,_e=new Z(oe);return te(oe,_e),M.luaD_rawrunprotected(oe,ee,null)!==H.LUA_OK&&(oe=null),oe},T.exports.lua_newthread=function(oe){let _e=oe.l_G,pe=new W;return oe.stack[oe.top++]=new I.TValue(F.LUA_TTHREAD,pe),E(oe.top<=oe.ci.top,'stack overflow'),te(pe,_e),pe.hookmask=oe.hookmask,pe.basehookcount=oe.basehookcount,pe.hook=oe.hook,pe.hookcount=pe.basehookcount,Q(pe,oe),pe}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(5),M=U(9),P=U(15),K=U(7),V=U(10),G=U(8),F=U(17),H=N.constant_types,Y=['no value','nil','boolean','userdata','number','string','table','function','userdata','thread','proto'].map((ue)=>N.to_luastring(ue)),J=function(ue){return Y[ue+1]},q={TM_INDEX:0,TM_NEWINDEX:1,TM_GC:2,TM_MODE:3,TM_LEN:4,TM_EQ:5,TM_ADD:6,TM_SUB:7,TM_MUL:8,TM_MOD:9,TM_POW:10,TM_DIV:11,TM_IDIV:12,TM_BAND:13,TM_BOR:14,TM_BXOR:15,TM_SHL:16,TM_SHR:17,TM_UNM:18,TM_BNOT:19,TM_LT:20,TM_LE:21,TM_CONCAT:22,TM_CALL:23,TM_N:24},Q=function(ue,se,ne,oe,_e,pe){let ce=_e,de=ue.top;ue.stack[ue.top]=new I.TValue(se.type,se.value),ue.stack[ue.top+1]=new I.TValue(ne.type,ne.value),ue.stack[ue.top+2]=new I.TValue(oe.type,oe.value),ue.top+=3,pe||(ue.stack[ue.top++]=new I.TValue(_e.type,_e.value)),ue.ci.callstatus&P.CIST_LUA?M.luaD_call(ue,de,pe):M.luaD_callnoyield(ue,de,pe),pe&&(E('number'==typeof ce),ue.stack[ce]=ue.stack[--ue.top])},$=function(ue,se,ne,oe,_e){let pe=ae(ue,se,_e);return(pe.ttisnil()&&(pe=ae(ue,ne,_e)),!pe.ttisnil())&&(Q(ue,pe,se,ne,oe,1),!0)},ae=function(ue,se,ne){let oe;switch(se.ttnov()){case H.LUA_TTABLE:case H.LUA_TUSERDATA:oe=se.value.metatable;break;default:oe=ue.l_G.mt[se.ttnov()];}return oe?V.luaH_getstr(oe,ue.l_G.tmname[ne]):I.luaO_nilobject};T.exports.TMS=q,T.exports.luaT_callTM=Q,T.exports.luaT_callbinTM=$,T.exports.luaT_trybinTM=function(ue,se,ne,oe,_e){if(!$(ue,se,ne,oe,_e))switch(_e){case q.TM_CONCAT:G.luaG_concaterror(ue,se,ne);case q.TM_BAND:case q.TM_BOR:case q.TM_BXOR:case q.TM_SHL:case q.TM_SHR:case q.TM_BNOT:{let pe=F.tonumber(se),ce=F.tonumber(ne);!1!==pe&&!1!==ce?G.luaG_tointerror(ue,se,ne):G.luaG_opinterror(ue,se,ne,N.to_luastring('perform bitwise operation on',!0))}default:G.luaG_opinterror(ue,se,ne,N.to_luastring('perform arithmetic on',!0));}},T.exports.luaT_callorderTM=function(ue,se,ne,oe){return $(ue,se,ne,ue.top,oe)?ue.stack[ue.top].l_isfalse()?0:1:-1},T.exports.luaT_gettmbyobj=ae,T.exports.luaT_init=function(ue){ue.l_G.tmname[q.TM_INDEX]=new K.luaS_new(ue,N.to_luastring('__index',!0)),ue.l_G.tmname[q.TM_NEWINDEX]=new K.luaS_new(ue,N.to_luastring('__newindex',!0)),ue.l_G.tmname[q.TM_GC]=new K.luaS_new(ue,N.to_luastring('__gc',!0)),ue.l_G.tmname[q.TM_MODE]=new K.luaS_new(ue,N.to_luastring('__mode',!0)),ue.l_G.tmname[q.TM_LEN]=new K.luaS_new(ue,N.to_luastring('__len',!0)),ue.l_G.tmname[q.TM_EQ]=new K.luaS_new(ue,N.to_luastring('__eq',!0)),ue.l_G.tmname[q.TM_ADD]=new K.luaS_new(ue,N.to_luastring('__add',!0)),ue.l_G.tmname[q.TM_SUB]=new K.luaS_new(ue,N.to_luastring('__sub',!0)),ue.l_G.tmname[q.TM_MUL]=new K.luaS_new(ue,N.to_luastring('__mul',!0)),ue.l_G.tmname[q.TM_MOD]=new K.luaS_new(ue,N.to_luastring('__mod',!0)),ue.l_G.tmname[q.TM_POW]=new K.luaS_new(ue,N.to_luastring('__pow',!0)),ue.l_G.tmname[q.TM_DIV]=new K.luaS_new(ue,N.to_luastring('__div',!0)),ue.l_G.tmname[q.TM_IDIV]=new K.luaS_new(ue,N.to_luastring('__idiv',!0)),ue.l_G.tmname[q.TM_BAND]=new K.luaS_new(ue,N.to_luastring('__band',!0)),ue.l_G.tmname[q.TM_BOR]=new K.luaS_new(ue,N.to_luastring('__bor',!0)),ue.l_G.tmname[q.TM_BXOR]=new K.luaS_new(ue,N.to_luastring('__bxor',!0)),ue.l_G.tmname[q.TM_SHL]=new K.luaS_new(ue,N.to_luastring('__shl',!0)),ue.l_G.tmname[q.TM_SHR]=new K.luaS_new(ue,N.to_luastring('__shr',!0)),ue.l_G.tmname[q.TM_UNM]=new K.luaS_new(ue,N.to_luastring('__unm',!0)),ue.l_G.tmname[q.TM_BNOT]=new K.luaS_new(ue,N.to_luastring('__bnot',!0)),ue.l_G.tmname[q.TM_LT]=new K.luaS_new(ue,N.to_luastring('__lt',!0)),ue.l_G.tmname[q.TM_LE]=new K.luaS_new(ue,N.to_luastring('__le',!0)),ue.l_G.tmname[q.TM_CONCAT]=new K.luaS_new(ue,N.to_luastring('__concat',!0)),ue.l_G.tmname[q.TM_CALL]=new K.luaS_new(ue,N.to_luastring('__call',!0))},T.exports.luaT_objtypename=function(ue,se){let ne;if(se.ttistable()&&null!==(ne=se.value.metatable)||se.ttisfulluserdata()&&null!==(ne=se.value.metatable)){let oe=V.luaH_getstr(ne,N.to_luastring('__name',!0));if(oe.ttisstring())return oe.svalue()}return J(se.ttnov())},T.exports.ttypename=J},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(20),M=U(12),P=U(5),K=U(11),V=U(15),G=U(7),F=U(4),H=U(9),Y=U(16),J=U(10),q=U(8),W=N.constant_types,Z=N.LUA_MULTRET,$=function(Pe,ye,De){return ye+De.A},ee=function(Pe,ye,De){return ye+De.B},ae=function(Pe,ye,De,Ke){return I.ISK(Ke.B)?De[I.INDEXK(Ke.B)]:Pe.stack[ye+Ke.B]},ue=function(Pe,ye,De,Ke){return I.ISK(Ke.C)?De[I.INDEXK(Ke.C)]:Pe.stack[ye+Ke.C]},ne=function(Pe,ye,De,Ke){let Be=De.A;0!==Be&&K.luaF_close(Pe,ye.l_base+Be-1),ye.pcOff+=De.sBx+Ke},oe=function(Pe,ye){ne(Pe,ye,ye.l_savedpc[ye.pcOff],1)},_e=function(Pe,ye,De){if(ye.ttisnumber()&&De.ttisnumber())return he(ye,De)?1:0;if(ye.ttisstring()&&De.ttisstring())return 0>Ee(ye.tsvalue(),De.tsvalue())?1:0;let Ke=Y.luaT_callorderTM(Pe,ye,De,Y.TMS.TM_LT);return 0>Ke&&q.luaG_ordererror(Pe,ye,De),Ke?1:0},pe=function(Pe,ye,De){let Ke;return ye.ttisnumber()&&De.ttisnumber()?Oe(ye,De)?1:0:ye.ttisstring()&&De.ttisstring()?0>=Ee(ye.tsvalue(),De.tsvalue())?1:0:(Ke=Y.luaT_callorderTM(Pe,ye,De,Y.TMS.TM_LE),0<=Ke)?Ke?1:0:(Pe.ci.callstatus|=V.CIST_LEQ,Ke=Y.luaT_callorderTM(Pe,ye,De,Y.TMS.TM_LT),Pe.ci.callstatus^=V.CIST_LEQ,0>Ke&&q.luaG_ordererror(Pe,ye,De),1===Ke?0:1)},ce=function(Pe,ye,De){if(ye.ttype()!==De.ttype())return ye.ttnov()!==De.ttnov()||ye.ttnov()!==W.LUA_TNUMBER?0:_Mathfloor(ye.value)===_Mathfloor(De.value)?1:0;let Ke;switch(ye.ttype()){case W.LUA_TNIL:return 1;case W.LUA_TBOOLEAN:return ye.value==De.value?1:0;case W.LUA_TNUMINT:case W.LUA_TNUMFLT:case W.LUA_TLCF:return ye.value===De.value?1:0;case W.LUA_TSHRSTR:case W.LUA_TLNGSTR:return G.luaS_eqlngstr(ye.tsvalue(),De.tsvalue())?1:0;case W.LUA_TLIGHTUSERDATA:case W.LUA_TUSERDATA:case W.LUA_TTABLE:if(ye.value===De.value)return 1;if(null===Pe)return 0;Ke=Y.luaT_gettmbyobj(Pe,ye,Y.TMS.TM_EQ),Ke.ttisnil()&&(Ke=Y.luaT_gettmbyobj(Pe,De,Y.TMS.TM_EQ));break;default:return ye.value===De.value?1:0;}return!Ke||Ke.ttisnil()?0:(Y.luaT_callTM(Pe,Ke,ye,De,Pe.top,1),Pe.stack[Pe.top].l_isfalse()?0:1)},Le=function(Pe,ye){let De=!1,Ke=ge(Pe,0>ye?2:1);if(!1===Ke){let Be=Te(Pe);if(!1===Be)return!1;0<Be?(Ke=F.LUA_MAXINTEGER,0>ye&&(De=!0)):(Ke=F.LUA_MININTEGER,0<=ye&&(De=!0))}return{casted:!0,stopnow:De,ilimit:Ke}},ge=function(Pe,ye){if(Pe.ttisfloat()){let De=Pe.value,Ke=_Mathfloor(De);if(De!==Ke){if(0===ye)return!1;1<ye&&(Ke+=1)}let Be=M.lua_numbertointeger(Ke);return 0===Be?0===De&&0:Be}return Pe.ttisinteger()?Pe.value:!!Pe.ttisstring()&&ge(P.luaO_str2num(Pe.svalue()),ye)},Ae=function(Pe){return Pe.ttisinteger()?Pe.value:ge(Pe,0)},Te=function(Pe){return Pe.ttnov()===W.LUA_TNUMBER?Pe.value:Pe.ttnov()===W.LUA_TSTRING&&P.luaO_str2num(Pe.svalue())},he=function(Pe,ye){return Pe.ttisinteger()?ye.ttisinteger()?Pe.value<ye.value?1:0:Ue(ye.value,Pe.value):ye.ttisfloat()?Pe.value<ye.value?1:0:isNaN(Pe.value)?0:!xe(ye.value,Pe.value)},Oe=function(Pe,ye){return Pe.ttisinteger()?ye.ttisinteger()?Pe.value<=ye.value?1:0:xe(Pe.value,ye.value):ye.ttisfloat()?Pe.value<=ye.value?1:0:!isNaN(Pe.value)&&!Ue(ye.value,Pe.value)},xe=function(Pe,ye){return Pe<=ye?1:0},Ue=function(Pe,ye){return Pe<ye?1:0},Ee=function(Pe,ye){let De=Pe.getstr(),Ke=Pe.tsslen(),Be=N.to_jsstring(De),Ve=ye.getstr(),Ge=ye.tsslen(),we=N.to_jsstring(Ve);for(;;){let Fe=Be===we;if(!Fe)return Be<we?-1:1;let Xe=Be.length;if(Xe===Ge)return Xe===Ke?0:1;if(Xe===Ke)return-1;Xe++,De=De.slice(Xe),Ke-=Xe,Ve=Ve.slice(Xe),Ge-=Xe,Be=N.to_jsstring(De),we=N.to_jsstring(Ve)}},ke=function(Pe,ye,De){let Ke;switch(De.ttype()){case W.LUA_TTABLE:{if(Ke=Y.luaT_gettmbyobj(Pe,De,Y.TMS.TM_LEN),!Ke.ttisnil())break;return void(Pe.stack[ye]=new P.TValue(W.LUA_TNUMINT,J.luaH_getn(De.value)))}case W.LUA_TSHRSTR:case W.LUA_TLNGSTR:return void(Pe.stack[ye]=new P.TValue(W.LUA_TNUMINT,De.vslen()));default:{Ke=Y.luaT_gettmbyobj(Pe,De,Y.TMS.TM_LEN),Ke.ttisnil()&&q.luaG_typeerror(Pe,De,N.to_luastring('get length of',!0));break}}Y.luaT_callTM(Pe,Ke,De,De,ye,1)},ve=function(Pe,ye){let De=Pe.stack[ye];return!!De.ttisstring()||De.ttisnumber()&&!isNaN(De.value)&&(Pe.stack[ye]=new P.TValue(W.LUA_TLNGSTR,G.luaS_bless(Pe,N.to_luastring(`${De.value}`))),!0)},Re=function(Pe){return Pe.ttisstring()&&0===Pe.vslen()},be=function(Pe,ye){E(2<=ye);do{let De=Pe.top,Ke=2;if(!(Pe.stack[De-2].ttisstring()||Pe.stack[De-2].ttisnumber())||!ve(Pe,De-1))Y.luaT_trybinTM(Pe,Pe.stack[De-2],Pe.stack[De-1],De-2,Y.TMS.TM_CONCAT),delete Pe.stack[De-1];else if(Re(Pe.stack[De-1]))ve(Pe,De-2),delete Pe.stack[De-1];else if(Re(Pe.stack[De-2]))Pe.stack[De-2]=Pe.stack[De-1],delete Pe.stack[De-1];else{let Be=Array(ye);for(Be[ye-1]=Pe.stack[De-1].svalue(),delete Pe.stack[De-1],Ke=1;Ke<ye&&ve(Pe,De-Ke-1);Ke++)Be[ye-Ke-1]=Pe.stack[De-Ke-1].svalue(),delete Pe.stack[De-Ke-1];let Ve=G.luaS_bless(Pe,Array.prototype.concat.apply([],Be));Pe.stack[De-Ke]=new P.TValue(W.LUA_TLNGSTR,Ve)}ye-=Ke-1,Pe.top-=Ke-1}while(1<ye)},Se=2e3,Ne=function(Pe,ye,De,Ke,Be){if(Be=Be?Be:0,Be>=Se&&q.luaG_runerror(Pe,N.to_luastring('\'__index\' chain too long; possible loop',!0)),ye.ttistable()){let Ve=J.luaH_get(ye.value,De);Ve.ttisnil()?Ie(Pe,ye,De,Ke,Ve,Be):Pe.stack[Ke]=new P.TValue(Ve.type,Ve.value)}else Ie(Pe,ye,De,Ke,null,Be)},Ie=function(Pe,ye,De,Ke,Be,Ve){let Ge;if(null===Be)E(!ye.ttistable()),Ge=Y.luaT_gettmbyobj(Pe,ye,Y.TMS.TM_INDEX),Ge.ttisnil()&&q.luaG_typeerror(Pe,ye,N.to_luastring('index',!0));else if(E(Be.ttisnil()),Ge=Y.luaT_gettmbyobj(Pe,ye,Y.TMS.TM_INDEX),Ge.ttisnil())return void(Pe.stack[Ke]=new P.TValue(W.LUA_TNIL,null));return Ge.ttisfunction()?void Y.luaT_callTM(Pe,Ge,ye,De,Ke,1):void Ne(Pe,Ge,De,Ke,Ve+1)},Ce=function(Pe,ye,De,Ke,Be){if(Be=Be?Be:0,Be>=Se&&q.luaG_runerror(Pe,N.to_luastring('\'__newindex\' chain too long; possible loop',!0)),ye.ttistable()){let Ve=J.luaH_set(ye.value,De);Ve.ttisnil()?Me(Pe,ye,De,Ke,Ve,Be):Ve.setfrom(Ke)}else Me(Pe,ye,De,Ke,null,Be)},Me=function(Pe,ye,De,Ke,Be,Ve){let Ge;if(null===Be)Ge=Y.luaT_gettmbyobj(Pe,ye,Y.TMS.TM_NEWINDEX),Ge.ttisnil()&&q.luaG_typeerror(Pe,ye,N.to_luastring('index',!0));else if(E(Be.ttisnil()),Ge=Y.luaT_gettmbyobj(Pe,ye,Y.TMS.TM_NEWINDEX),Ge.ttisnil())return void Be.setfrom(Ke);return Ge.ttisfunction()?void Y.luaT_callTM(Pe,Ge,ye,De,Ke,0):void Ce(Pe,Ge,De,Ke,Ve+1)};T.exports.LEintfloat=xe,T.exports.LEnum=Oe,T.exports.LTintfloat=Ue,T.exports.LTnum=he,T.exports.RA=$,T.exports.RB=ee,T.exports.RC=function(Pe,ye,De){return ye+De.C},T.exports.RKB=ae,T.exports.RKC=ue,T.exports.dojump=ne,T.exports.donextjump=oe,T.exports.forlimit=Le,T.exports.gettable=Ne,T.exports.l_strcmp=Ee,T.exports.luaV_concat=be,T.exports.luaV_equalobj=ce,T.exports.luaV_execute=function(Pe){const ye=I.OpCodesI;let De=Pe.ci;De.callstatus|=V.CIST_FRESH;newframe:for(;;){E(De===Pe.ci);let Ke=De.func.value,Be=Ke.p.k,Ve=De.l_base,Ge=De.l_savedpc[De.pcOff++];Pe.hookmask&(N.LUA_MASKLINE|N.LUA_MASKCOUNT)&&(q.luaG_traceexec(Pe),Ve=De.l_base);let we=$(Pe,Ve,Ge),Fe=Ge.opcode;switch(Fe){case ye.OP_MOVE:{Pe.stack[we]=Pe.stack[ee(Pe,Ve,Ge)];break}case ye.OP_LOADK:{let Xe=Be[Ge.Bx];Pe.stack[we]=new P.TValue(Xe.type,Xe.value);break}case ye.OP_LOADKX:{E(De.l_savedpc[De.pcOff].opcode===ye.OP_EXTRAARG);let Xe=Be[De.l_savedpc[De.pcOff++].Ax];Pe.stack[we]=new P.TValue(Xe.type,Xe.value);break}case ye.OP_LOADBOOL:{Pe.stack[we]=new P.TValue(W.LUA_TBOOLEAN,0!==Ge.B),0!==Ge.C&&De.pcOff++;break}case ye.OP_LOADNIL:{for(let Xe=0;Xe<=Ge.B;Xe++)Pe.stack[we+Xe]=new P.TValue(W.LUA_TNIL,null);break}case ye.OP_GETUPVAL:{let Xe=Ke.upvals[Ge.B].val();Pe.stack[we]=new P.TValue(Xe.type,Xe.value);break}case ye.OP_SETUPVAL:{let Xe=Ke.upvals[Ge.B];null===Xe.v?Xe.value.setfrom(Pe.stack[we]):Xe.L.stack[Xe.v]=Pe.stack[we];break}case ye.OP_GETTABUP:{let Xe=Ke.upvals[Ge.B].val(),He=ue(Pe,Ve,Be,Ge);Ne(Pe,Xe,He,we),Ve=De.l_base;break}case ye.OP_SETTABUP:{let Xe=Ke.upvals[Ge.A].val(),He=ae(Pe,Ve,Be,Ge),je=ue(Pe,Ve,Be,Ge);Ce(Pe,Xe,He,je),Ve=De.l_base;break}case ye.OP_GETTABLE:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge);Ne(Pe,Xe,He,we),Ve=De.l_base;break}case ye.OP_SETTABLE:{let Xe=Pe.stack[we],He=ae(Pe,Ve,Be,Ge),je=ue(Pe,Ve,Be,Ge);Ce(Pe,Xe,He,je),Ve=De.l_base;break}case ye.OP_NEWTABLE:{Pe.stack[we]=new P.TValue(W.LUA_TTABLE,J.luaH_new(Pe));break}case ye.OP_SELF:{let Xe=Pe.stack[ee(Pe,Ve,Ge)],He=ue(Pe,Ve,Be,Ge);Pe.stack[we+1]=Xe,Ne(Pe,Xe,He,we),Ve=De.l_base;break}case ye.OP_ADD:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);Xe.ttisinteger()&&He.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,0|Xe.value+He.value):!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,je+ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_ADD),Ve=De.l_base);break}case ye.OP_SUB:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);Xe.ttisinteger()&&He.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,0|Xe.value-He.value):!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,je-ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_SUB),Ve=De.l_base);break}case ye.OP_MUL:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);Xe.ttisinteger()&&He.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,0|Xe.value*He.value):!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,je*ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_MUL),Ve=De.l_base);break}case ye.OP_MOD:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);Xe.ttisinteger()&&He.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,0|Xe.value-_Mathfloor(Xe.value/He.value)*He.value):!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,je-_Mathfloor(je/ze)*ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_MOD),Ve=De.l_base);break}case ye.OP_POW:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,_Mathpow(je,ze)):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_POW),Ve=De.l_base);break}case ye.OP_DIV:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,je/ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_DIV),Ve=De.l_base);break}case ye.OP_IDIV:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Te(Xe),ze=Te(He);Xe.ttisinteger()&&He.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,0|_Mathfloor(Xe.value/He.value)):!1!==je&&!1!==ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,_Mathfloor(je/ze)):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_IDIV),Ve=De.l_base);break}case ye.OP_BAND:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Ae(Xe),ze=Ae(He);!1!==je&&ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,je&ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_BAND),Ve=De.l_base);break}case ye.OP_BOR:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Ae(Xe),ze=Ae(He);!1!==je&&ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,je|ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_BOR),Ve=De.l_base);break}case ye.OP_BXOR:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Ae(Xe),ze=Ae(He);!1!==je&&ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,je^ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_BXOR),Ve=De.l_base);break}case ye.OP_SHL:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Ae(Xe),ze=Ae(He);!1!==je&&ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,je<<ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_SHL),Ve=De.l_base);break}case ye.OP_SHR:{let Xe=ae(Pe,Ve,Be,Ge),He=ue(Pe,Ve,Be,Ge),je=Ae(Xe),ze=Ae(He);!1!==je&&ze?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,je>>ze):(Y.luaT_trybinTM(Pe,Xe,He,we,Y.TMS.TM_SHR),Ve=De.l_base);break}case ye.OP_UNM:{let Xe=Pe.stack[ee(Pe,Ve,Ge)],He=Te(Xe);Xe.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,-Xe.value):!1===He?(Y.luaT_trybinTM(Pe,Xe,Xe,we,Y.TMS.TM_UNM),Ve=De.l_base):Pe.stack[we]=new P.TValue(W.LUA_TNUMFLT,-He);break}case ye.OP_BNOT:{let Xe=Pe.stack[ee(Pe,Ve,Ge)],He=Te(Xe);Xe.ttisinteger()?Pe.stack[we]=new P.TValue(W.LUA_TNUMINT,~Xe.value):(Y.luaT_trybinTM(Pe,Xe,Xe,we,Y.TMS.TM_BNOT),Ve=De.l_base);break}case ye.OP_NOT:{let Xe=Pe.stack[ee(Pe,Ve,Ge)];Pe.stack[we]=new P.TValue(W.LUA_TBOOLEAN,Xe.l_isfalse());break}case ye.OP_LEN:{ke(Pe,we,Pe.stack[ee(Pe,Ve,Ge)]),Ve=De.l_base;break}case ye.OP_CONCAT:{let Xe=Ge.B,He=Ge.C,je;Pe.top=Ve+He+1,be(Pe,He-Xe+1),Ve=De.l_base,we=$(Pe,Ve,Ge),je=Ve+Xe,Pe.stack[we]=Pe.stack[je],Pe.top=De.top;break}case ye.OP_JMP:{ne(Pe,De,Ge,0);break}case ye.OP_EQ:{ce(Pe,ae(Pe,Ve,Be,Ge),ue(Pe,Ve,Be,Ge))===Ge.A?oe(Pe,De):De.pcOff++,Ve=De.l_base;break}case ye.OP_LT:{_e(Pe,ae(Pe,Ve,Be,Ge),ue(Pe,Ve,Be,Ge))===Ge.A?oe(Pe,De):De.pcOff++,Ve=De.l_base;break}case ye.OP_LE:{pe(Pe,ae(Pe,Ve,Be,Ge),ue(Pe,Ve,Be,Ge))===Ge.A?oe(Pe,De):De.pcOff++,Ve=De.l_base;break}case ye.OP_TEST:{(Ge.C?Pe.stack[we].l_isfalse():!Pe.stack[we].l_isfalse())?De.pcOff++:oe(Pe,De);break}case ye.OP_TESTSET:{let Xe=Pe.stack[ee(Pe,Ve,Ge)];(Ge.C?Xe.l_isfalse():!Xe.l_isfalse())?De.pcOff++:(Pe.stack[we]=Xe,oe(Pe,De));break}case ye.OP_CALL:{let Xe=Ge.B,He=Ge.C-1;if(0!==Xe&&(Pe.top=we+Xe),H.luaD_precall(Pe,we,He))0<=He&&(Pe.top=De.top),Ve=De.l_base;else{De=Pe.ci;continue newframe}break}case ye.OP_TAILCALL:{if(0!==Ge.B&&(Pe.top=we+Ge.B),H.luaD_precall(Pe,we,Z))Ve=De.l_base;else{let Xe=Pe.ci,He=Xe.previous,je=Xe.func,ze=Xe.funcOff,Ye=He.funcOff,Je=Xe.l_base+je.value.p.numparams;0<Ke.p.p.length&&K.luaF_close(Pe,He.l_base);for(let qe=0;ze+qe<Je;qe++)Pe.stack[Ye+qe]=Pe.stack[ze+qe];He.func=Xe.func,He.l_base=Ye+(Xe.l_base-ze),Pe.top=Ye+(Pe.top-ze),He.top=Pe.top,He.l_savedpc=Xe.l_savedpc,He.pcOff=Xe.pcOff,He.callstatus|=V.CIST_TAIL,Pe.ci=He,De=Pe.ci,Pe.ciOff--,E(Pe.top===He.l_base+Pe.stack[Ye].value.p.maxstacksize);continue newframe}break}case ye.OP_RETURN:{0<Ke.p.p.length&&K.luaF_close(Pe,Ve);let Xe=H.luaD_poscall(Pe,De,we,0===Ge.B?Pe.top-we:Ge.B-1);if(De.callstatus&V.CIST_FRESH)return;De=Pe.ci,Xe&&(Pe.top=De.top);continue newframe}case ye.OP_FORLOOP:{if(Pe.stack[we].ttisinteger()){let Xe=Pe.stack[we+2].value,He=Pe.stack[we].value+Xe,je=Pe.stack[we+1].value;(0<Xe?He<=je:je<=He)&&(De.pcOff+=Ge.sBx,Pe.stack[we].value=He,Pe.stack[we+3]=new P.TValue(W.LUA_TNUMINT,He))}else{let Xe=Pe.stack[we+2].value,He=Pe.stack[we].value+Xe,je=Pe.stack[we+1].value;(0<Xe?He<=je:je<=He)&&(De.pcOff+=Ge.sBx,Pe.stack[we].value=He,Pe.stack[we+3]=new P.TValue(W.LUA_TNUMFLT,He))}break}case ye.OP_FORPREP:{let Xe=Pe.stack[we],He=Pe.stack[we+1],je=Pe.stack[we+2],ze=Le(He,je.value);if(Xe.ttisinteger()&&je.ttisinteger()&&ze.casted){let Ye=ze.stopnow?0:Xe.value;He.value=ze.ilimit,Xe.value=Ye-je.value}else{let Ye=Te(Xe),Je=Te(He),qe=Te(je);!1===Je&&q.luaG_runerror(Pe,N.to_luastring('\'for\' limit must be a number',!0)),He.type=W.LUA_TNUMFLT,He.value=Je,!1===qe&&q.luaG_runerror(Pe,N.to_luastring('\'for\' step must be a number',!0)),je.type=W.LUA_TNUMFLT,je.value=qe,!1===Ye&&q.luaG_runerror(Pe,N.to_luastring('\'for\' initial value must be a number',!0)),Xe.type=W.LUA_TNUMFLT,Xe.value=Ye-qe}De.pcOff+=Ge.sBx;break}case ye.OP_TFORCALL:{let Xe=we+3;Pe.stack[Xe+2]=Pe.stack[we+2],Pe.stack[Xe+1]=Pe.stack[we+1],Pe.stack[Xe]=Pe.stack[we],Pe.top=Xe+3,H.luaD_call(Pe,Xe,Ge.C),Ve=De.l_base,Pe.top=De.top,Ge=De.l_savedpc[De.pcOff++],we=$(Pe,Ve,Ge),E(Ge.opcode===ye.OP_TFORLOOP)}case ye.OP_TFORLOOP:{Pe.stack[we+1].ttisnil()||(Pe.stack[we]=Pe.stack[we+1],De.pcOff+=Ge.sBx);break}case ye.OP_SETLIST:{let Xe=Ge.B,He=Ge.C;0===Xe&&(Xe=Pe.top-we-1),0===He&&(E(De.l_savedpc[De.pcOff].opcode===ye.OP_EXTRAARG),He=De.l_savedpc[De.pcOff++].Ax);for(let je=Pe.stack[we].value,ze=(He-1)*I.LFIELDS_PER_FLUSH+Xe;0<Xe;Xe--)J.luaH_setint(je,ze--,Pe.stack[we+Xe]);Pe.top=De.top;break}case ye.OP_CLOSURE:{let Xe=Ke.p.p[Ge.Bx],He=Xe.upvalues.length,je=Xe.upvalues,ze=new P.LClosure(Pe,He);ze.p=Xe,Pe.stack[we]=new P.TValue(W.LUA_TLCL,ze);for(let Ye=0;Ye<He;Ye++)ze.upvals[Ye]=je[Ye].instack?K.luaF_findupval(Pe,Ve+je[Ye].idx):Ke.upvals[je[Ye].idx],ze.upvals[Ye].refcount++;break}case ye.OP_VARARG:{let Xe=Ge.B-1,He=Ve-De.funcOff-Ke.p.numparams-1,je;for(0>He&&(He=0),0>Xe&&(Xe=He,Ve=De.l_base,we=$(Pe,Ve,Ge),Pe.top=we+He),je=0;je<Xe&&je<He;je++)Pe.stack[we+je]=Pe.stack[Ve-He+je];for(;je<Xe;je++)Pe.stack[we+je]=new P.TValue(W.LUA_TNIL,null);break}case ye.OP_EXTRAARG:}}},T.exports.luaV_finishOp=function(Pe){let ye=Pe.ci,De=I.OpCodesI,Ke=ye.l_base,Be=ye.l_savedpc[ye.pcOff-1],Ve=Be.opcode;switch(Ve){case De.OP_ADD:case De.OP_SUB:case De.OP_MUL:case De.OP_DIV:case De.OP_IDIV:case De.OP_BAND:case De.OP_BOR:case De.OP_BXOR:case De.OP_SHL:case De.OP_SHR:case De.OP_MOD:case De.OP_POW:case De.OP_UNM:case De.OP_BNOT:case De.OP_LEN:case De.OP_GETTABUP:case De.OP_GETTABLE:case De.OP_SELF:{Pe.stack[Ke+Be.A]=Pe.stack[--Pe.top];break}case De.OP_LE:case De.OP_LT:case De.OP_EQ:{let Ge=!Pe.stack[Pe.top-1].l_isfalse();Pe.top--,ye.callstatus&V.CIST_LEQ&&(E(Ve===De.OP_LE),ye.callstatus^=V.CIST_LEQ,Ge=1===Ge?0:1),E(ye.l_savedpc[ye.pcOff]===De.OP_JMP),Ge!==Be.A&&ye.pcOff++;break}case De.OP_CONCAT:{let Ge=Pe.top-1,we=Be.B,Fe=Ge-1-(Ke+we);Pe.stack[Pe.top-2]=Pe.stack[Ge],1<Fe&&(Pe.top=Ge-1,be(Pe,Fe)),Pe.stack[ye.l_base+Be.A]=Pe.stack[Pe.top-1],Pe.top=ye.top;break}case De.OP_TFORCALL:{E(ye.l_savedpc[ye.pcOff]===De.OP_TFORLOOP),Pe.top=ye.top;break}case De.OP_CALL:{0<=Be.C-1&&(Pe.top=ye.top);break}}},T.exports.luaV_finishset=Me,T.exports.luaV_lessequal=pe,T.exports.luaV_lessthan=_e,T.exports.luaV_objlen=ke,T.exports.luaV_rawequalobj=function(Pe,ye){return ce(null,Pe,ye)},T.exports.luaV_tointeger=ge,T.exports.settable=Ce,T.exports.tointeger=Ae,T.exports.tonumber=Te},function(T){function U(){throw new Error('setTimeout has not been defined')}function E(){throw new Error('clearTimeout has not been defined')}function N(Z){if(F===setTimeout)return setTimeout(Z,0);if((F===U||!F)&&setTimeout)return F=setTimeout,setTimeout(Z,0);try{return F(Z,0)}catch(Q){try{return F.call(null,Z,0)}catch($){return F.call(this,Z,0)}}}function I(Z){if(H===clearTimeout)return clearTimeout(Z);if((H===E||!H)&&clearTimeout)return H=clearTimeout,clearTimeout(Z);try{return H(Z)}catch(Q){try{return H.call(null,Z)}catch($){return H.call(this,Z)}}}function M(){J&&q&&(J=!1,q.length?Y=q.concat(Y):W=-1,Y.length&&P())}function P(){if(!J){var Z=N(M);J=!0;for(var Q=Y.length;Q;){for(q=Y,Y=[];++W<Q;)q&&q[W].run();W=-1,Q=Y.length}q=null,J=!1,I(Z)}}function K(Z,Q){this.fun=Z,this.array=Q}function V(){}var G=T.exports={},F,H;(function(){try{F='function'==typeof setTimeout?setTimeout:U}catch(Z){F=U}try{H='function'==typeof clearTimeout?clearTimeout:E}catch(Z){H=E}})();var Y=[],J=!1,W=-1,q;G.nextTick=function(Z){var Q=Array(arguments.length-1);if(1<arguments.length)for(var $=1;$<arguments.length;$++)Q[$-1]=arguments[$];Y.push(new K(Z,Q)),1!==Y.length||J||N(P)},K.prototype.run=function(){this.fun.apply(null,this.array)},G.title='browser',G.browser=!0,G.env={},G.argv=[],G.version='',G.versions={},G.on=V,G.addListener=V,G.once=V,G.off=V,G.removeListener=V,G.removeAllListeners=V,G.emit=V,G.prependListener=V,G.prependOnceListener=V,G.listeners=function(){return[]},G.binding=function(){throw new Error('process.binding is not supported')},G.cwd=function(){return'/'},G.chdir=function(){throw new Error('process.chdir is not supported')},G.umask=function(){return 0}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(8),M=U(9),P=U(25),K=U(5),V=U(7),G=U(10),F=U(4),H=N.thread_status,Y=N.char,J=257,q={TK_AND:J,TK_BREAK:J+1,TK_DO:J+2,TK_ELSE:J+3,TK_ELSEIF:J+4,TK_END:J+5,TK_FALSE:J+6,TK_FOR:J+7,TK_FUNCTION:J+8,TK_GOTO:J+9,TK_IF:J+10,TK_IN:J+11,TK_LOCAL:J+12,TK_NIL:J+13,TK_NOT:J+14,TK_OR:J+15,TK_REPEAT:J+16,TK_RETURN:J+17,TK_THEN:J+18,TK_TRUE:J+19,TK_UNTIL:J+20,TK_WHILE:J+21,TK_IDIV:J+22,TK_CONCAT:J+23,TK_DOTS:J+24,TK_EQ:J+25,TK_GE:J+26,TK_LE:J+27,TK_NE:J+28,TK_SHL:J+29,TK_SHR:J+30,TK_DBCOLON:J+31,TK_EOS:J+32,TK_FLT:J+33,TK_INT:J+34,TK_NAME:J+35,TK_STRING:J+36},W=q,Z=['and','break','do','else','elseif','end','false','for','function','goto','if','in','local','nil','not','or','repeat','return','then','true','until','while','//','..','...','==','>=','<=','~=','<<','>>','::','<eof>','<number>','<integer>','<name>','<string>'];class Q{constructor(Pe,ye,De){this.L=Pe,this.data=ye,this.n=0,this.buffer=null,this.off=0,this.reader=De?De:null,this.reader||(E('string'!=typeof ye,'Should only load binary of array of bytes'),this.buffer=ye?ye:[],this.n=this.buffer instanceof DataView?this.buffer.byteLength:this.buffer.length,this.off=0)}getc(){if(0>=this.n&&this.fill(),0>=this.n)return-1;let Pe;return Pe=this.buffer instanceof DataView?this.buffer.getUint8(this.off++,!0):this.buffer[this.off++],0==this.n--&&(this.buffer=null),Pe}read(Pe){let ye=[];for(;0<Pe;){let De=this.getc();-1!==De&&ye.push(De),Pe--}return ye}fill(){this.reader&&(this.buffer=this.reader(this.L,this.data),E('string'!=typeof this.buffer,'Should only load binary of array of bytes'),null!==this.buffer&&(this.n=this.buffer instanceof DataView?this.buffer.byteLength:this.buffer.length,this.off=0))}}class ${constructor(){this.r=NaN,this.i=NaN,this.ts=null}}class ee{constructor(){this.token=NaN,this.seminfo=new $}}const ae=function(Pe,ye){let De=Pe.buff;De.n+1>De.buffer.length&&De.buffer.length>=F.MAX_INT/2&&Te(Pe,N.to_luastring('lexical element too long',!0),0),De.buffer[De.n++]=0>ye?255+ye+1:ye},ue=function(Pe,ye){if(ye<J)return K.luaO_pushfstring(Pe.L,N.to_luastring('\'%c\'',!0),ye);let De=Z[ye-J];return ye<W.TK_EOS?N.to_luastring(`'${De}'`):N.to_luastring(De)},se=function(Pe){return Pe.current===Y['\n']||Pe.current===Y['\r']},ne=function(Pe){Pe.current=Pe.z.getc()},oe=function(Pe){ae(Pe,Pe.current),ne(Pe)},_e=function(Pe,ye){let De=Pe.L,Ke=V.luaS_new(De,ye),Be=G.luaH_set(Pe.h,new K.TValue(N.CT.LUA_TLNGSTR,Ke));if(Be.ttisnil())Be.setbvalue(!0);else{let Ve=Pe.h.strong.get(V.luaS_hashlongstr(Ke));E(Ve.value==Be),Ke=Ve.key.tsvalue()}return Ke},pe=function(Pe){let ye=Pe.current;E(se(Pe)),ne(Pe),se(Pe)&&Pe.current!==ye&&ne(Pe),++Pe.linenumber>=F.MAX_INT&&Te(Pe,N.to_luastring('chunk has too many lines',!0),0)},de=function(Pe,ye){return Pe.current===ye.charCodeAt(0)&&(ne(Pe),!0)},Le=function(Pe,ye){return(Pe.current===ye[0].charCodeAt(0)||Pe.current===ye[1].charCodeAt(0))&&(oe(Pe),!0)},ge=function(Pe,ye){let De='Ee',Ke=Pe.current;for(E(P.lisdigit(Pe.current)),oe(Pe),Ke===Y[0]&&Le(Pe,'xX')&&(De='Pp');;)if(Le(Pe,De)&&Le(Pe,'-+'),P.lisxdigit(Pe.current))oe(Pe);else if(Pe.current===Y['.'])oe(Pe);else break;ae(Pe,0);let Be=K.luaO_str2num(Pe.buff.buffer);return!1===Be&&Te(Pe,N.to_luastring('malformed number',!0),W.TK_FLT),Be.ttisinteger()?(ye.i=Be.value,W.TK_INT):(E(Be.ttisfloat()),ye.r=Be.value,W.TK_FLT)},Ae=function(Pe,ye){return ye===W.TK_NAME||ye===W.TK_STRING||ye===W.TK_FLT||ye===W.TK_INT?(ae(Pe,0),N.to_luastring(`'${N.to_jsstring(Pe.buff.buffer)}'`)):ue(Pe,ye)},Te=function(Pe,ye,De){ye=I.luaG_addinfo(Pe.L,ye,Pe.source,Pe.linenumber),De&&K.luaO_pushfstring(Pe.L,N.to_luastring('%s near %s'),ye,Ae(Pe,De)),M.luaD_throw(Pe.L,H.LUA_ERRSYNTAX)},Oe=function(Pe){let ye=0,De=Pe.current;for(E(De===Y['[']||De===Y[']']),oe(Pe);Pe.current===Y['='];)oe(Pe),ye++;return Pe.current===De?ye:-ye-1},xe=function(Pe,ye,De){let Ke=Pe.linenumber;oe(Pe),se(Pe)&&pe(Pe);for(let Be=!1;!Be;)switch(Pe.current){case-1:{let Ve=ye?'string':'comment',Ge=`unfinished long ${Ve} (starting at line ${Ke})`;Te(Pe,N.to_luastring(Ge),W.TK_EOS);break}case Y[']']:{Oe(Pe)===De&&(oe(Pe),Be=!0);break}case Y['\n']:case Y['\r']:{ae(Pe,Y['\n']),pe(Pe),ye||(Pe.buff.n=0,Pe.buff.buffer=[]);break}default:ye?oe(Pe):ne(Pe);}ye&&(ye.ts=_e(Pe,Pe.buff.buffer.slice(2+De,2+De-2*(2+De))))},Ue=function(Pe,ye,De){ye||(-1!==Pe.current&&oe(Pe),Te(Pe,De,W.TK_STRING))},Ee=function(Pe){return oe(Pe),Ue(Pe,P.lisxdigit(Pe.current),N.to_luastring('hexadecimal digit expected',!0)),K.luaO_hexavalue(Pe.current)},ke=function(Pe){let ye=Ee(Pe);return ye=(ye<<4)+Ee(Pe),Pe.buff.n-=2,ye},ve=function(Pe){let ye=4;oe(Pe),Ue(Pe,Pe.current===Y['{'],N.to_luastring('missing \'{\'',!0));let De=Ee(Pe);for(oe(Pe);P.lisxdigit(Pe.current);)ye++,De=(De<<4)+K.luaO_hexavalue(Pe.current),Ue(Pe,1114111>=De,N.to_luastring('UTF-8 value too large',!0)),oe(Pe);return Ue(Pe,Pe.current===Y['}'],N.to_luastring('missing \'}\'',!0)),ne(Pe),Pe.buff.n-=ye,De},Re=function(Pe){let ye=K.luaO_utf8esc(ve(Pe)),De=ye.buff;for(let Ke=ye.n;0<Ke;Ke--)ae(Pe,De[K.UTF8BUFFSZ-Ke])},be=function(Pe){let ye=0,De;for(De=0;3>De&&P.lisdigit(Pe.current);De++)ye=10*ye+Pe.current-Y[0],oe(Pe);return Ue(Pe,255>=ye,N.to_luastring('decimal escape too large',!0)),Pe.buff.n-=De,ye},Se=function(Pe,ye,De){for(oe(Pe);Pe.current!==ye;)switch(Pe.current){case-1:Te(Pe,N.to_luastring('unfinished string',!0),W.TK_EOS);break;case Y['\n']:case Y['\r']:Te(Pe,N.to_luastring('unfinished string',!0),W.TK_STRING);break;case Y['\\']:{oe(Pe);let Ke,Be;switch(Pe.current){case Y.a:Be=Y.a,Ke='read_save';break;case Y.b:Be=Y['\b'],Ke='read_save';break;case Y.f:Be=Y['\f'],Ke='read_save';break;case Y.n:Be=Y['\n'],Ke='read_save';break;case Y.r:Be=Y['\r'],Ke='read_save';break;case Y.t:Be=Y['\t'],Ke='read_save';break;case Y.v:Be=Y['\x0B'],Ke='read_save';break;case Y.x:Be=ke(Pe),Ke='read_save';break;case Y.u:Re(Pe),Ke='no_save';break;case Y['\n']:case Y['\r']:pe(Pe),Be=Y['\n'],Ke='only_save';break;case Y['\\']:case Y['"']:case Y['\'']:Be=Pe.current,Ke='read_save';break;case-1:Ke='no_save';break;case Y.z:{for(Pe.buff.n-=1,ne(Pe);P.lisspace(Pe.current);)se(Pe)?pe(Pe):ne(Pe);Ke='no_save';break}default:{Ue(Pe,P.lisdigit(Pe.current),N.to_luastring('invalid escape sequence',!0)),Be=be(Pe),Ke='only_save';break}}'read_save'===Ke&&ne(Pe),('read_save'===Ke||'only_save'===Ke)&&(Pe.buff.n-=1,ae(Pe,Be));break}default:oe(Pe);}oe(Pe),De.ts=_e(Pe,Pe.buff.buffer.slice(1,Pe.buff.n-1))},Ie=function(Pe,ye){for(Pe.buff.n=0,Pe.buff.buffer=[];;)switch(E('number'==typeof Pe.current),Pe.current){case Y['\n']:case Y['\r']:{pe(Pe);break}case Y[' ']:case Y['\f']:case Y['\t']:case Y['\x0B']:{ne(Pe);break}case Y['-']:{if(ne(Pe),Pe.current!==Y['-'])return Y['-'];if(ne(Pe),Pe.current===Y['[']){let De=Oe(Pe);if(Pe.buff.n=0,Pe.buff.buffer=[],0<=De){xe(Pe,null,De),Pe.buff.n=0,Pe.buff.buffer=[];break}}for(;!se(Pe)&&-1!==Pe.current;)ne(Pe);break}case Y['[']:{let De=Oe(Pe);return 0<=De?(xe(Pe,ye,De),W.TK_STRING):(-1!==De&&Te(Pe,N.to_luastring('invalid long string delimiter',!0),W.TK_STRING),Y['['])}case Y['=']:return ne(Pe),de(Pe,'=')?W.TK_EQ:Y['='];case Y['<']:return ne(Pe),de(Pe,'=')?W.TK_LE:de(Pe,'<')?W.TK_SHL:Y['<'];case Y['>']:return ne(Pe),de(Pe,'=')?W.TK_GE:de(Pe,'>')?W.TK_SHR:Y['>'];case Y['/']:return ne(Pe),de(Pe,'/')?W.TK_IDIV:Y['/'];case Y['~']:return ne(Pe),de(Pe,'=')?W.TK_NE:Y['~'];case Y[':']:return ne(Pe),de(Pe,':')?W.TK_DBCOLON:Y[':'];case Y['"']:case Y['\'']:return Se(Pe,Pe.current,ye),W.TK_STRING;case Y['.']:return oe(Pe),de(Pe,'.')?de(Pe,'.')?W.TK_DOTS:W.TK_CONCAT:P.lisdigit(Pe.current)?ge(Pe,ye):Y['.'];case Y[0]:case Y[1]:case Y[2]:case Y[3]:case Y[4]:case Y[5]:case Y[6]:case Y[7]:case Y[8]:case Y[9]:return ge(Pe,ye);case-1:return W.TK_EOS;default:{if(P.lislalpha(Pe.current)){do oe(Pe);while(P.lislalnum(Pe.current));let De=_e(Pe,Pe.buff.buffer);ye.ts=De;let Ke=Z.slice(0,22).indexOf(N.to_jsstring(De.getstr()));return 0<=Ke?Ke+J:W.TK_NAME}let De=Pe.current;return ne(Pe),De}}};T.exports.FIRST_RESERVED=J,T.exports.LexState=class{constructor(){this.current=NaN,this.linenumber=NaN,this.lastline=NaN,this.t=new ee,this.lookahead=new ee,this.fs=null,this.L=null,this.z=new Q,this.buff=new Q,this.h=null,this.dyd=null,this.source=null,this.envn=null}},T.exports.MBuffer=Q,T.exports.RESERVED=q,T.exports.isreserved=function(Pe){return 0<=Z.slice(0,22).indexOf(Pe)},T.exports.luaX_lookahead=function(Pe){return E(Pe.lookahead.token===W.TK_EOS),Pe.lookahead.token=Ie(Pe,Pe.lookahead.seminfo),Pe.lookahead.token},T.exports.luaX_newstring=_e,T.exports.luaX_next=function(Pe){Pe.lastline=Pe.linenumber,Pe.lookahead.token===W.TK_EOS?Pe.t.token=Ie(Pe,Pe.t.seminfo):(Pe.t.token=Pe.lookahead.token,Pe.t.seminfo.i=Pe.lookahead.seminfo.i,Pe.t.seminfo.r=Pe.lookahead.seminfo.r,Pe.t.seminfo.ts=Pe.lookahead.seminfo.ts,Pe.lookahead.token=W.TK_EOS)},T.exports.luaX_setinput=function(Pe,ye,De,Ke,Be){ye.t={token:0,seminfo:{i:NaN,r:NaN,ts:null}},ye.L=Pe,ye.current=Be,ye.lookahead={token:W.TK_EOS,seminfo:{i:NaN,r:NaN,ts:null}},ye.z=De,ye.fs=null,ye.linenumber=1,ye.lastline=1,ye.source=Ke,ye.envn=V.luaS_newliteral(Pe,'_ENV')},T.exports.luaX_syntaxerror=function(Pe,ye){Te(Pe,ye,Pe.t.token)},T.exports.luaX_token2str=ue,T.exports.luaX_tokens=Z},function(T){'use strict';const I=0,M=1,P=2,K=3,V=0,G=1,F=2,H=3,Y=[64|P<<4|I<<2|V,64|K<<4|I<<2|G,64|I<<4|I<<2|G,64|M<<4|M<<2|V,64|M<<4|I<<2|V,64|M<<4|I<<2|V,64|M<<4|K<<2|V,64|P<<4|K<<2|V,0|K<<4|K<<2|V,0|M<<4|I<<2|V,0|K<<4|K<<2|V,64|M<<4|M<<2|V,64|P<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|K<<4|K<<2|V,64|P<<4|I<<2|V,64|P<<4|I<<2|V,64|P<<4|I<<2|V,64|P<<4|I<<2|V,64|P<<4|P<<2|V,0|P<<4|I<<2|F,128|K<<4|K<<2|V,128|K<<4|K<<2|V,128|K<<4|K<<2|V,128|I<<4|M<<2|V,192|P<<4|M<<2|V,64|M<<4|M<<2|V,64|M<<4|M<<2|V,0|M<<4|I<<2|V,64|P<<4|I<<2|F,64|P<<4|I<<2|F,0|I<<4|M<<2|V,64|P<<4|I<<2|F,0|M<<4|M<<2|V,64|M<<4|I<<2|G,64|M<<4|I<<2|V,0|M<<4|M<<2|H],$=9,ee=9,te=$+ee,ae=8,ue=$+ee+ae,se=6,ne=0,oe=ne+se,_e=oe+ae,pe=_e+$,ce=_e,de=oe,Le=(1<<te)-1,ge=Le>>1,Te=(1<<ae)-1,xe=1<<ee-1,be=function(We,Ze){return~(-1<<We)<<Ze},Se=function(We,Ze){return~be(We,Ze)},Ce=function(We,Ze,Qe,$e){return We.code=We.code&Se($e,Qe)|Ze<<Qe&be($e,Qe),je(We)},Ge=function(We,Ze){return Ce(We,Ze,ce,te)},je=function(We){if('number'==typeof We)return{code:We,opcode:We>>ne&be(se,0),A:We>>oe&be(ae,0),B:We>>pe&be(ee,0),C:We>>_e&be($,0),Bx:We>>ce&be(te,0),Ax:We>>de&be(ue,0),sBx:(We>>ce&be(te,0))-ge};let Ze=We.code;return We.opcode=Ze>>ne&be(se,0),We.A=Ze>>oe&be(ae,0),We.B=Ze>>pe&be(ee,0),We.C=Ze>>_e&be($,0),We.Bx=Ze>>ce&be(te,0),We.Ax=Ze>>de&be(ue,0),We.sBx=(Ze>>ce&be(te,0))-ge,We};T.exports.BITRK=xe,T.exports.CREATE_ABC=function(We,Ze,Qe,$e){return je(We<<ne|Ze<<oe|Qe<<pe|$e<<_e)},T.exports.CREATE_ABx=function(We,Ze,Qe){return je(We<<ne|Ze<<oe|Qe<<ce)},T.exports.CREATE_Ax=function(We,Ze){return je(We<<ne|Ze<<de)},T.exports.GET_OPCODE=function(We){return We.opcode},T.exports.GETARG_A=function(We){return We.A},T.exports.GETARG_B=function(We){return We.B},T.exports.GETARG_C=function(We){return We.C},T.exports.GETARG_Bx=function(We){return We.Bx},T.exports.GETARG_Ax=function(We){return We.Ax},T.exports.GETARG_sBx=function(We){return We.sBx},T.exports.INDEXK=function(We){return We&~xe},T.exports.ISK=function(We){return We&xe},T.exports.LFIELDS_PER_FLUSH=50,T.exports.MAXARG_A=Te,T.exports.MAXARG_Ax=(1<<ue)-1,T.exports.MAXARG_B=(1<<ee)-1,T.exports.MAXARG_Bx=Le,T.exports.MAXARG_C=(1<<$)-1,T.exports.MAXARG_sBx=ge,T.exports.MAXINDEXRK=xe-1,T.exports.NO_REG=Te,T.exports.OpArgK=K,T.exports.OpArgN=I,T.exports.OpArgR=P,T.exports.OpArgU=M,T.exports.OpCodes=['OP_MOVE','OP_LOADK','OP_LOADKX','OP_LOADBOOL','OP_LOADNIL','OP_GETUPVAL','OP_GETTABUP','OP_GETTABLE','OP_SETTABUP','OP_SETUPVAL','OP_SETTABLE','OP_NEWTABLE','OP_SELF','OP_ADD','OP_SUB','OP_MUL','OP_MOD','OP_POW','OP_DIV','OP_IDIV','OP_BAND','OP_BOR','OP_BXOR','OP_SHL','OP_SHR','OP_UNM','OP_BNOT','OP_NOT','OP_LEN','OP_CONCAT','OP_JMP','OP_EQ','OP_LT','OP_LE','OP_TEST','OP_TESTSET','OP_CALL','OP_TAILCALL','OP_RETURN','OP_FORLOOP','OP_FORPREP','OP_TFORCALL','OP_TFORLOOP','OP_SETLIST','OP_CLOSURE','OP_VARARG','OP_EXTRAARG'],T.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},T.exports.POS_A=oe,T.exports.POS_Ax=de,T.exports.POS_B=pe,T.exports.POS_Bx=ce,T.exports.POS_C=_e,T.exports.POS_OP=ne,T.exports.RKASK=function(We){return We|xe},T.exports.SETARG_A=function(We,Ze){return Ce(We,Ze,oe,ae)},T.exports.SETARG_Ax=function(We,Ze){return Ce(We,Ze,de,ue)},T.exports.SETARG_B=function(We,Ze){return Ce(We,Ze,pe,ee)},T.exports.SETARG_Bx=Ge,T.exports.SETARG_C=function(We,Ze){return Ce(We,Ze,_e,$)},T.exports.SETARG_sBx=function(We,Ze){return Ge(We,Ze+ge)},T.exports.SET_OPCODE=function(We,Ze){return We.code=We.code&Se(se,ne)|Ze<<ne&be(se,ne),je(We)},T.exports.SIZE_A=ae,T.exports.SIZE_Ax=ue,T.exports.SIZE_B=ee,T.exports.SIZE_Bx=te,T.exports.SIZE_C=$,T.exports.SIZE_OP=se,T.exports.fullins=je,T.exports.getBMode=function(We){return 3&Y[We]>>4},T.exports.getCMode=function(We){return 3&Y[We]>>2},T.exports.getOpMode=function(We){return 3&Y[We]},T.exports.iABC=V,T.exports.iABx=G,T.exports.iAsBx=F,T.exports.iAx=H,T.exports.testAMode=function(We){return 64&Y[We]},T.exports.testTMode=function(We){return 128&Y[We]}},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(8),M=U(9),P=U(50),K=U(11),V=U(19),G=U(5),F=U(15),H=U(7),Y=U(16),J=U(12),q=U(17),W=U(10),Z=K.MAXUPVAL,Q=N.constant_types,$=N.thread_status,ee=G.TValue,te=G.CClosure,ae=function(ca){return ca!==G.luaO_nilobject},ne=function(ca,da){let La=ca.ci;if(0<da){let fa=La.funcOff+da;return E(da<=La.top-(La.funcOff+1),'unacceptable index'),fa>=ca.top?G.luaO_nilobject:ca.stack[fa]}return da>N.LUA_REGISTRYINDEX?(E(0!=da&&-da<=ca.top,'invalid index'),ca.stack[ca.top+da]):da===N.LUA_REGISTRYINDEX?ca.l_G.l_registry:(da=N.LUA_REGISTRYINDEX-da,E(da<=Z+1,'upvalue index too large'),La.func.ttislcf()?G.luaO_nilobject:da<=La.func.value.nupvalues?La.func.value.upvalue[da-1]:G.luaO_nilobject)},oe=function(ca,da){let La=ca.ci;if(0<da){let fa=La.funcOff+da;return E(da<=La.top-(La.funcOff+1),'unacceptable index'),fa>=ca.top?null:fa}return da>N.LUA_REGISTRYINDEX?(E(0!=da&&-da<=ca.top,'invalid index'),ca.top+da):da===N.LUA_REGISTRYINDEX?null:(da=N.LUA_REGISTRYINDEX-da,E(da<=Z+1,'upvalue index too large'),La.func.ttislcf()?null:da<=La.func.nupvalues?da-1:null)},ge=function(ca,da){let La=ca.ci.funcOff;if(0<=da){for(;ca.top<La+1+da;)ca.stack[ca.top++]=new ee(Q.LUA_TNIL,null);ca.top=La+1+da}else{E(-(da+1)<=ca.top-(La+1),'invalid new top');for(let fa=ca.top+da+1;ca.top>fa;)delete ca.stack[--ca.top]}},Ae=function(ca,da){ge(ca,-da-1)},Te=function(ca,da,La){for(;da<La;da++,La--){let fa=ca.stack[da];ca.stack[da]=ca.stack[La],ca.stack[La]=fa}},he=function(ca,da,La){let fa=ca.stack[ca.top-1],ga=ne(ca,da),Aa=oe(ca,da);E(ga!==G.luaO_nilobject&&da>N.LUA_REGISTRYINDEX,'index not in the stack'),E((0<=La?La:-La)<=ca.top-da,'invalid \'n\'');let Ta=0<=La?ca.top-1-La:Aa-La-1;Te(ca,Aa,Ta),Te(ca,Ta+1,ca.top-1),Te(ca,Aa,ca.top-1)},Oe=function(ca,da,La){let fa=ne(ca,da);ca.stack[oe(ca,La)]=new ee(fa.type,fa.value)},Me=function(ca,da,La){if(E('function'==typeof da),E('number'==typeof La),0===La)ca.stack[ca.top]=new ee(Q.LUA_TLCF,da);else{E(La<ca.top-ca.ci.funcOff,'not enough elements in the stack'),E(La<=Z,'upvalue index too large');let fa=new te(ca,da,La);for(ca.top-=La;La--;)fa.upvalue[La].setfrom(ca.stack[ca.top+La]),delete ca.stack[ca.top+La];ca.stack[ca.top]=new ee(Q.LUA_TCCL,fa)}ca.top++,E(ca.top<=ca.ci.top,'stack overflow')},ye=function(ca,da){Me(ca,da,0)},we=function(ca,da,La){E(Array.isArray(La),'key must be an array of bytes');let fa=new ee(Q.LUA_TLNGSTR,H.luaS_new(ca,La));E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack'),ca.stack[ca.top++]=fa,q.settable(ca,da,ca.stack[ca.top-1],ca.stack[ca.top-2]),delete ca.stack[--ca.top],delete ca.stack[--ca.top]},We=function(ca,da,La){E(Array.isArray(La),'key must be an array of bytes');let fa=new ee(Q.LUA_TLNGSTR,H.luaS_new(ca,La));return ca.stack[ca.top++]=fa,E(ca.top<=ca.ci.top,'stack overflow'),q.gettable(ca,da,ca.stack[ca.top-1],ca.top-1),ca.stack[ca.top-1].ttnov()},Ze=function(ca,da,La){let fa=ne(ca,da);return E(fa.ttistable(),'table expected'),ca.stack[ca.top++]=W.luaH_getint(fa.value,La),E(ca.top<=ca.ci.top,'stack overflow'),ca.stack[ca.top-1].ttnov()},et=function(ca){let fa=new G.TValue(Q.LUA_TTABLE,W.luaH_new(ca));ca.stack[ca.top++]=fa,E(ca.top<=ca.ci.top,'stack overflow')},at=function(ca,da){return{id:ca.l_G.id_counter++,metatable:null,uservalue:null,len:da,data:Object.create(null)}},ut=function(ca,da,La){switch(da.ttype()){case Q.LUA_TCCL:{let fa=da.value;return 1<=La&&La<=fa.nupvalues?{name:[],val:fa.upvalue[La-1]}:null}case Q.LUA_TLCL:{let fa=da.value,ga=fa.p;if(!(1<=La&&La<=ga.upvalues.length))return null;let Aa=ga.upvalues[La-1].name;return{name:Aa?Aa.getstr():N.to_luastring('(*no name)',!0),val:fa.upvals[La-1].val()}}default:return null;}},ft=function(ca,da){let La=ne(ca,da);return La.ttisstring()||La.ttisnumber()?La.ttisstring()?La.svalue():N.to_luastring(`${La.value}`):null},Tt=function(ca,da){let La=ne(ca,da);return La.ttisstring()||La.ttisnumber()?La.ttisstring()?La.jsstring():`${La.value}`:null},It=function(ca,da){M.luaD_callnoyield(ca,da.funcOff,da.nresults)},Ct=function(ca,da){let La=ne(ca,da);return ae(La)?La.ttnov():Q.LUA_TNONE},Zt=function(ca,da,La,fa,ga){E(null===ga||!(ca.ci.callstatus&F.CIST_LUA),'cannot use continuations inside hooks'),E(da+1<ca.top-ca.ci.funcOff,'not enough elements in the stack'),E(ca.status===$.LUA_OK,'cannot do calls on non-normal thread'),E(da===N.LUA_MULTRET||(ca.ci.top-ca.top>=da-La,'results from function overflow current stack size'));let Aa=ca.top-(da+1);null!==ga&&0===ca.nny?(ca.ci.c_k=ga,ca.ci.c_ctx=fa,M.luaD_call(ca,Aa,La)):M.luaD_callnoyield(ca,Aa,La),La===N.LUA_MULTRET&&ca.ci.top<ca.top&&(ca.ci.top=ca.top)},$t=function(ca,da,La,fa,ga,Aa){E(da+1<ca.top-ca.ci.funcOff,'not enough elements in the stack'),E(ca.status===$.LUA_OK,'cannot do calls on non-normal thread'),E(da===N.LUA_MULTRET||(ca.ci.top-ca.top>=da-La,'results from function overflow current stack size'));let Ta={func:null,funcOff:NaN,nresults:NaN},ha,Oa;if(Oa=0===fa?0:oe(ca,fa),Ta.funcOff=ca.top-(da+1),Ta.func=ca.stack[Ta.funcOff],null===Aa||0<ca.nny)Ta.nresults=La,ha=M.luaD_pcall(ca,It,Ta,Ta.funcOff,Oa);else{let xa=ca.ci;xa.c_k=Aa,xa.c_ctx=ga,xa.extra=Ta.funcOff,xa.c_old_errfunc=ca.errfunc,ca.errfunc=Oa,xa.callstatus&=~F.CIST_OAH|ca.allowhook,xa.callstatus|=F.CIST_YPCALL,M.luaD_call(ca,Ta.funcOff,La),xa.callstatus&=~F.CIST_YPCALL,ca.errfunc=xa.c_old_errfunc,ha=$.LUA_OK}return La===N.LUA_MULTRET&&ca.ci.top<ca.top&&(ca.ci.top=ca.top),ha},sa=function(ca,da,La){let ga=ne(ca,da);E(ga.ttisLclosure(),'Lua function expected');let Aa=ga.value;return E(1<=La&&La<=Aa.p.upvalues.length,'invalid upvalue index'),{closure:Aa,upval:Aa.upvals[La-1],upvalOff:La-1}};T.exports.index2addr=ne,T.exports.index2addr_=oe,T.exports.lua_absindex=function(ca,da){return 0<da||da<=N.LUA_REGISTRYINDEX?da:ca.top-ca.ci.funcOff+da},T.exports.lua_atpanic=function(ca,da){let La=ca.l_G.panic;return ca.l_G.panic=da,La},T.exports.lua_call=function(ca,da,La){Zt(ca,da,La,0,null)},T.exports.lua_callk=Zt,T.exports.lua_checkstack=function(ca){return ca.stack.length<J.LUAI_MAXSTACK},T.exports.lua_compare=function(ca,da,La,fa){let ga=ne(ca,da),Aa=ne(ca,La),Ta=0;return ae(ga)&&ae(Aa)&&(fa===N.LUA_OPEQ?Ta=q.luaV_equalobj(ca,ga,Aa):fa===N.LUA_OPLT?Ta=q.luaV_lessthan(ca,ga,Aa):fa===N.LUA_OPLE?Ta=q.luaV_lessequal(ca,ga,Aa):E(!1,'invalid option')),Ta},T.exports.lua_concat=function(ca,da){E(da<ca.top-ca.ci.funcOff,'not enough elements in the stack'),2<=da?q.luaV_concat(ca,da):0==da&&(ca.stack[ca.top++]=new ee(Q.LUA_TLNGSTR,H.luaS_newliteral(ca,[])),E(ca.top<=ca.ci.top,'stack overflow'))},T.exports.lua_copy=Oe,T.exports.lua_createtable=et,T.exports.lua_dump=function(ca,da,La,fa){E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let ga=ca.stack[ca.top-1];return ga.ttisLclosure()?P.luaU_dump(ca,ga.value.p,da,La,fa):1},T.exports.lua_error=function(ca){E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack'),I.luaG_errormsg(ca)},T.exports.lua_gc=function(){},T.exports.lua_getallocf=function(){return console.warn('lua_getallocf is not available and will always return null'),null},T.exports.lua_getextraspace=function(){return console.warn('lua_getextraspace is not available and will always return null'),null},T.exports.lua_getfield=function(ca,da,La){return We(ca,ne(ca,da),La)},T.exports.lua_getglobal=function(ca,da){return We(ca,W.luaH_getint(ca.l_G.l_registry.value,N.LUA_RIDX_GLOBALS),da)},T.exports.lua_geti=function(ca,da,La){E('number'==typeof La&&(0|La)===La);let fa=ne(ca,da);return ca.stack[ca.top++]=new ee(Q.LUA_TNUMINT,La),E(ca.top<=ca.ci.top,'stack overflow'),q.gettable(ca,fa,ca.stack[ca.top-1],ca.top-1),ca.stack[ca.top-1].ttnov()},T.exports.lua_getmetatable=function(ca,da){let La=ne(ca,da),ga=!1,fa;switch(La.ttnov()){case Q.LUA_TTABLE:case Q.LUA_TUSERDATA:fa=La.value.metatable;break;default:fa=ca.l_G.mt[La.ttnov()];}return null!==fa&&void 0!==fa&&(ca.stack[ca.top++]=new ee(Q.LUA_TTABLE,fa),E(ca.top<=ca.ci.top,'stack overflow'),ga=!0),ga},T.exports.lua_gettable=function(ca,da){let La=ne(ca,da);return q.gettable(ca,La,ca.stack[ca.top-1],ca.top-1),ca.stack[ca.top-1].ttnov()},T.exports.lua_gettop=function(ca){return ca.top-(ca.ci.funcOff+1)},T.exports.lua_getupvalue=function(ca,da,La){let fa=ut(ca,ne(ca,da),La);if(fa){let ga=fa.name,Aa=fa.val;return ca.stack[ca.top++]=new ee(Aa.type,Aa.value),ga}return null},T.exports.lua_getuservalue=function(ca,da){let La=ne(ca,da);E(ca,La.ttisfulluserdata(),'full userdata expected');let fa=La.uservalue;return ca.stack[ca.top++]=new ee(fa.type,fa.value),E(ca.top<=ca.ci.top,'stack overflow'),ca.stack[ca.top-1].ttnov()},T.exports.lua_insert=function(ca,da){he(ca,da,1)},T.exports.lua_isboolean=function(ca,da){return Ct(ca,da)===Q.LUA_TBOOLEAN},T.exports.lua_iscfunction=function(ca,da){let La=ne(ca,da);return La.ttislcf(La)||La.ttisCclosure()},T.exports.lua_isfunction=function(ca,da){return Ct(ca,da)===Q.LUA_TFUNCTION},T.exports.lua_isinteger=function(ca,da){return ne(ca,da).ttisinteger()},T.exports.lua_isnil=function(ca,da){return Ct(ca,da)===Q.LUA_TNIL},T.exports.lua_isnone=function(ca,da){return Ct(ca,da)===Q.LUA_TNONE},T.exports.lua_isnoneornil=function(ca,da){return 0>=Ct(ca,da)},T.exports.lua_isnumber=function(ca,da){return!1!==q.tonumber(ne(ca,da))},T.exports.lua_isstring=function(ca,da){let La=ne(ca,da);return La.ttisstring()||La.ttisnumber()},T.exports.lua_istable=function(ca,da){return ne(ca,da).ttistable()},T.exports.lua_isthread=function(ca,da){return Ct(ca,da)===Q.LUA_TTHREAD},T.exports.lua_isuserdata=function(ca,da){let La=ne(ca,da);return La.ttisfulluserdata(La)||La.ttislightuserdata()},T.exports.lua_len=function(ca,da){let La=ne(ca,da);q.luaV_objlen(ca,ca.top++,La),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_load=function(ca,da,La,fa,ga){E(Array.isArray(fa),'lua_load expect an array of byte as chunckname'),E(!ga||Array.isArray(ga),'lua_load expect an array of byte as mode');let Aa=new V.MBuffer(ca,La,da);fa||(fa=[N.char['?']]);let Ta=M.luaD_protectedparser(ca,Aa,fa,ga);if(Ta===$.LUA_OK){let ha=ca.stack[ca.top-1].value;if(1<=ha.nupvalues){let Oa=W.luaH_getint(ca.l_G.l_registry.value,N.LUA_RIDX_GLOBALS);ha.upvals[0].value.setfrom(Oa)}}return Ta},T.exports.lua_newtable=function(ca){et(ca,0,0)},T.exports.lua_newuserdata=function(ca,da){let La=at(ca,da);return ca.stack[ca.top++]=new G.TValue(Q.LUA_TUSERDATA,La),E(ca.top<=ca.ci.top,'stack overflow'),La.data},T.exports.lua_next=function(ca,da){let La=ne(ca,da);E(La.ttistable(),'table expected');let fa=W.luaH_next(ca,La.value,ca.top-1);return fa?(ca.top++,E(ca.top<=ca.ci.top,'stack overflow'),1):(ca.top--,0)},T.exports.lua_pcall=function(ca,da,La,fa){return $t(ca,da,La,fa,0,null)},T.exports.lua_pcallk=$t,T.exports.lua_pop=Ae,T.exports.lua_pushboolean=function(ca,da){ca.stack[ca.top++]=new ee(Q.LUA_TBOOLEAN,!!da),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_pushcclosure=Me,T.exports.lua_pushcfunction=ye,T.exports.lua_pushglobaltable=function(ca){Ze(ca,N.LUA_REGISTRYINDEX,N.LUA_RIDX_GLOBALS)},T.exports.lua_pushinteger=function(ca,da){E('number'==typeof da&&(0|da)===da),ca.stack[ca.top++]=new ee(Q.LUA_TNUMINT,da),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_pushjsclosure=Me,T.exports.lua_pushjsfunction=ye,T.exports.lua_pushlightuserdata=function(ca,da){ca.stack[ca.top++]=new ee(Q.LUA_TLIGHTUSERDATA,da),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_pushliteral=function(ca,da){if(E('string'==typeof da||void 0===da||null===da,'lua_pushliteral expects a JS string'),void 0===da||null===da)ca.stack[ca.top]=new ee(Q.LUA_TNIL,null);else{let La=new ee(Q.LUA_TLNGSTR,H.luaS_newliteral(ca,da));ca.stack[ca.top]=La}return ca.top++,E(ca.top<=ca.ci.top,'stack overflow'),da},T.exports.lua_pushlstring=function(ca,da,La){E(Array.isArray(da),'lua_pushlstring expects array of byte'),E('number'==typeof La);let fa=new ee(Q.LUA_TLNGSTR,H.luaS_bless(ca,da.slice(0,La)));return ca.stack[ca.top++]=fa,E(ca.top<=ca.ci.top,'stack overflow'),fa.value},T.exports.lua_pushnil=function(ca){ca.stack[ca.top++]=new ee(Q.LUA_TNIL,null),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_pushnumber=function(ca,da){E('number'==typeof da),ca.stack[ca.top++]=new ee(Q.LUA_TNUMFLT,da),E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_pushstring=function(ca,da){return E(Array.isArray(da)||void 0===da||null===da,'lua_pushstring expects array of byte'),ca.stack[ca.top]=void 0===da||null===da?new ee(Q.LUA_TNIL,null):new ee(Q.LUA_TLNGSTR,H.luaS_new(ca,da)),ca.top++,E(ca.top<=ca.ci.top,'stack overflow'),da},T.exports.lua_pushfstring=function(ca,da,...La){return E(Array.isArray(da)),G.luaO_pushvfstring(ca,da,La)},T.exports.lua_pushvfstring=function(ca,da,La){return E(Array.isArray(da)),G.luaO_pushvfstring(ca,da,La)},T.exports.lua_pushthread=function(ca){return ca.stack[ca.top++]=new ee(Q.LUA_TTHREAD,ca),E(ca.top<=ca.ci.top,'stack overflow'),ca.l_G.mainthread===ca},T.exports.lua_pushvalue=function(ca,da){ca.stack[ca.top]=ne(ca,da),ca.top++,E(ca.top<=ca.ci.top,'stack overflow')},T.exports.lua_rawequal=function(ca,da,La){let fa=ne(ca,da),ga=ne(ca,La);return ae(fa)&&ae(ga)?q.luaV_equalobj(null,fa,ga):0},T.exports.lua_rawget=function(ca,da){let La=ne(ca,da);return E(La.ttistable(La),'table expected'),ca.stack[ca.top-1]=W.luaH_get(La.value,ca.stack[ca.top-1]),ca.stack[ca.top-1].ttnov()},T.exports.lua_rawgeti=Ze,T.exports.lua_rawgetp=function(ca,da,La){let fa=ne(ca,da);E(fa.ttistable(),'table expected');let ga=new ee(Q.LUA_TLIGHTUSERDATA,La);return ca.stack[ca.top++]=W.luaH_get(fa.value,ga),E(ca.top<=ca.ci.top,'stack overflow'),ca.stack[ca.top-1].ttnov()},T.exports.lua_rawlen=function(ca,da){let La=ne(ca,da);switch(La.ttype()){case Q.LUA_TSHRSTR:case Q.LUA_TLNGSTR:return La.vslen();case Q.LUA_TUSERDATA:return La.len;case Q.LUA_TTABLE:return W.luaH_getn(La.value);default:return 0;}},T.exports.lua_rawset=function(ca,da){E(2<ca.top-ca.ci.funcOff,'not enough elements in the stack');let La=ne(ca,da);E(La.ttistable(),'table expected');let fa=W.luaH_set(La.value,ca.stack[ca.top-2]);fa.setfrom(ca.stack[ca.top-1]),ca.top-=2},T.exports.lua_rawseti=function(ca,da,La){E(2<ca.top-ca.ci.funcOff,'not enough elements in the stack');let fa=ne(ca,da);E(fa.ttistable(),'table expected'),W.luaH_setint(fa.value,La,ca.stack[ca.top-1]),delete ca.stack[--ca.top]},T.exports.lua_rawsetp=function(ca,da,La){E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let fa=ne(ca,da);E(ca,fa.ttistable(),'table expected');let ga=new ee(Q.LUA_TLIGHTUSERDATA,La),Aa=W.luaH_set(fa.value,ga);Aa.setfrom(ca.stack[ca.top-1]),ca.top--},T.exports.lua_remove=function(ca,da){he(ca,da,-1),Ae(ca,1)},T.exports.lua_replace=function(ca,da){Oe(ca,-1,da),Ae(ca,1)},T.exports.lua_rotate=he,T.exports.lua_setfield=function(ca,da,La){we(ca,ne(ca,da),La)},T.exports.lua_setglobal=function(ca,da){we(ca,W.luaH_getint(ca.l_G.l_registry.value,N.LUA_RIDX_GLOBALS),da)},T.exports.lua_seti=function(ca,da,La){E('number'==typeof La&&(0|La)===La),E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let fa=ne(ca,da);ca.stack[ca.top++]=new ee(Q.LUA_TNUMINT,La),E(ca.top<=ca.ci.top,'stack overflow'),q.settable(ca,fa,ca.stack[ca.top-1],ca.stack[ca.top-2]),delete ca.stack[--ca.top],delete ca.stack[--ca.top]},T.exports.lua_setmetatable=function(ca,da){E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let fa=ne(ca,da),La;switch(ca.stack[ca.top-1].ttisnil()?La=null:(E(ca.stack[ca.top-1].ttistable(),'table expected'),La=ca.stack[ca.top-1].value),fa.ttnov()){case Q.LUA_TUSERDATA:case Q.LUA_TTABLE:{fa.value.metatable=La;break}default:{ca.l_G.mt[fa.ttnov()]=La;break}}return delete ca.stack[--ca.top],!0},T.exports.lua_settable=function(ca,da){E(2<ca.top-ca.ci.funcOff,'not enough elements in the stack');let La=ne(ca,da);q.settable(ca,La,ca.stack[ca.top-2],ca.stack[ca.top-1]),ca.top-=2},T.exports.lua_settop=ge,T.exports.lua_setupvalue=function(ca,da,La){let fa=ne(ca,da);E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let ga=ut(ca,fa,La);if(ga){let Aa=ga.name,Ta=ga.val;return ca.top--,Ta.type=ca.stack[ca.top].type,Ta.value=ca.stack[ca.top].value,Aa}return null},T.exports.lua_setuservalue=function(ca,da){E(1<ca.top-ca.ci.funcOff,'not enough elements in the stack');let La=ne(ca,da);E(ca,La.ttisfulluserdata(),'full userdata expected'),La.uservalue.setfrom(ca.stack[ca.top-1]),delete ca.stack[--ca.top]},T.exports.lua_status=function(ca){return ca.status},T.exports.lua_stringtonumber=function(ca,da){let La=G.luaO_str2num(da);return La?(ca.stack[ca.top++]=La,E(ca.top<=ca.ci.top,'stack overflow'),da.length):0},T.exports.lua_toboolean=function(ca,da){let La=ne(ca,da);return!La.l_isfalse()},T.exports.lua_todataview=function(ca,da){let La=ne(ca,da);if(!La.ttisstring()&&!La.ttisnumber())return null;let fa=new DataView(new ArrayBuffer(La.vslen()));return La.svalue().forEach((ga,Aa)=>fa.setUint8(Aa,ga,!0)),fa},T.exports.lua_tointeger=function(ca,da){return q.tointeger(ne(ca,da))},T.exports.lua_tointegerx=function(ca,da){return q.tointeger(ne(ca,da))},T.exports.lua_tojsstring=Tt,T.exports.lua_toljsstring=Tt,T.exports.lua_tolstring=ft,T.exports.lua_tonumber=function(ca,da){return q.tonumber(ne(ca,da))},T.exports.lua_topointer=function(ca,da){let La=ne(ca,da);switch(La.ttype()){case Q.LUA_TTABLE:case Q.LUA_TLCL:case Q.LUA_TCCL:case Q.LUA_TLCF:case Q.LUA_TTHREAD:case Q.LUA_TUSERDATA:case Q.LUA_TLIGHTUSERDATA:return La.value;default:return null;}},T.exports.lua_tostring=ft,T.exports.lua_tothread=function(ca,da){let La=ne(ca,da);return La.ttisthread()?La.value:null},T.exports.lua_touserdata=function(ca,da){let La=ne(ca,da);switch(La.ttnov()){case Q.LUA_TUSERDATA:return La.value.data;case Q.LUA_TLIGHTUSERDATA:return La.value;default:return null;}},T.exports.lua_type=Ct,T.exports.lua_typename=function(ca,da){return E(Q.LUA_TNONE<=da&&da<Q.LUA_NUMTAGS,'invalid tag'),Y.ttypename(da)},T.exports.lua_upvalueid=function(ca,da,La){let fa=ne(ca,da);switch(fa.ttype()){case Q.LUA_TLCL:return sa(ca,da,La,null).upval;case Q.LUA_TCCL:{let ga=fa.value;return E(1<=La&&La<=ga.nupvalues,'invalid upvalue index'),ga.upvalue[La-1]}default:return E(!1,'closure expected'),null;}},T.exports.lua_upvaluejoin=function(ca,da,La,fa,ga){let Aa=sa(ca,da,La),Ta=sa(ca,fa,ga),ha=Aa.upvalOff,Oa=Ta.upval,xa=Aa.closure;xa.upvals[ha]=Oa},T.exports.lua_version=function(ca){return null===ca?N.LUA_VERSION_NUM:ca.l_G.version},T.exports.lua_xmove=function(ca,da,La){if(ca!==da){E(La<ca.top-ca.ci.funcOff,'not enough elements in the stack'),E(ca.l_G===da.l_G,'moving among independent states'),E(da.ci.top-da.top>=La,'stack overflow'),ca.top-=La;for(let fa=0;fa<La;fa++)da.stack[da.top]=ca.stack[ca.top+fa],da.top++}}},function(T){var U=function(){return this}();try{U=U||Function('return this')()||(1,eval)('this')}catch(E){'object'==typeof window&&(U=window)}T.exports=U},function(T,O,U){'use strict';const E=U(2),N=U(6),I=function(Z){let Q=E.lua_tothread(Z,1);return N.luaL_argcheck(Z,Q,1,E.to_luastring('thread expected',!0)),Q},M=function(Z,Q,$){if(!E.lua_checkstack(Q,$))return E.lua_pushliteral(Z,'too many arguments to resume'),-1;if(E.lua_status(Q)===E.LUA_OK&&0===E.lua_gettop(Q))return E.lua_pushliteral(Z,'cannot resume dead coroutine'),-1;E.lua_xmove(Z,Q,$);let ee=E.lua_resume(Q,Z,$);if(ee===E.LUA_OK||ee===E.LUA_YIELD){let te=E.lua_gettop(Q);return E.lua_checkstack(Z,te+1)?(E.lua_xmove(Q,Z,te),te):(E.lua_pop(Q,te),E.lua_pushliteral(Z,'too many results to resume'),-1)}return E.lua_xmove(Q,Z,1),-1},K=function(Z){let Q=E.lua_tothread(Z,E.lua_upvalueindex(1)),$=M(Z,Q,E.lua_gettop(Z));return 0>$?(E.lua_type(Z,-1)===E.LUA_TSTRING&&(N.luaL_where(Z,1),E.lua_insert(Z,-2),E.lua_concat(Z,2)),E.lua_error(Z)):$},V=function(Z){N.luaL_checktype(Z,1,E.LUA_TFUNCTION);let Q=E.lua_newthread(Z);return E.lua_pushvalue(Z,1),E.lua_xmove(Z,Q,1),1},q={create:V,isyieldable:function(Z){return E.lua_pushboolean(Z,E.lua_isyieldable(Z)),1},resume:function(Z){let Q=I(Z),$=M(Z,Q,E.lua_gettop(Z)-1);return 0>$?(E.lua_pushboolean(Z,0),E.lua_insert(Z,-2),2):(E.lua_pushboolean(Z,1),E.lua_insert(Z,-($+1)),$+1)},running:function(Z){return E.lua_pushboolean(Z,E.lua_pushthread(Z)),2},status:function(Z){let Q=I(Z);if(Z===Q)E.lua_pushliteral(Z,'running');else switch(E.lua_status(Q)){case E.LUA_YIELD:E.lua_pushliteral(Z,'suspended');break;case E.LUA_OK:{let $=new E.lua_Debug;0<E.lua_getstack(Q,0,$)?E.lua_pushliteral(Z,'normal'):0===E.lua_gettop(Q)?E.lua_pushliteral(Z,'dead'):E.lua_pushliteral(Z,'suspended');break}default:E.lua_pushliteral(Z,'dead');}return 1},wrap:function(Z){return V(Z),E.lua_pushcclosure(Z,K,1),1},'yield':function(Z){return E.lua_yield(Z,E.lua_gettop(Z))}};T.exports.luaopen_coroutine=function(Z){return N.luaL_newlib(Z,q),1}},function(T,O,U){'use strict';const E=U(0),N=U(2),I=U(6),M=function(Oe,xe,Ue){Oe===xe||N.lua_checkstack(xe,Ue)||I.luaL_error(Oe,N.to_luastring('stack overflow',!0))},H=function(Oe){return N.lua_isthread(Oe,1)?{arg:1,thread:N.lua_tothread(Oe,1)}:{arg:0,thread:Oe}},Y=function(Oe,xe,Ue){N.lua_pushstring(Oe,Ue),N.lua_setfield(Oe,-2,xe)},J=function(Oe,xe,Ue){N.lua_pushinteger(Oe,Ue),N.lua_setfield(Oe,-2,xe)},q=function(Oe,xe,Ue){N.lua_pushboolean(Oe,Ue),N.lua_setfield(Oe,-2,xe)},W=function(Oe,xe,Ue){Oe==xe?N.lua_rotate(Oe,-2,1):N.lua_xmove(xe,Oe,1),N.lua_setfield(Oe,-2,Ue)},ee=function(Oe,xe){let Ue=I.luaL_checkinteger(Oe,2);I.luaL_checktype(Oe,1,N.LUA_TFUNCTION);let Ee=xe?N.lua_getupvalue(Oe,1,Ue):N.lua_setupvalue(Oe,1,Ue);return null===Ee?0:(N.lua_pushstring(Oe,Ee),N.lua_insert(Oe,-(xe+1)),xe+1)},ue=function(Oe,xe,Ue){let Ee=I.luaL_checkinteger(Oe,Ue);return I.luaL_checktype(Oe,xe,N.LUA_TFUNCTION),I.luaL_argcheck(Oe,null!==N.lua_getupvalue(Oe,xe,Ee),Ue,N.to_luastring('invalid upvalue index',!0)),Ee},oe=N.to_luastring('__hooks__',!0),_e=['call','return','line','count','tail call'].map((Oe)=>N.to_luastring(Oe)),pe=function(Oe,xe){N.lua_rawgetp(Oe,N.LUA_REGISTRYINDEX,oe),N.lua_pushthread(Oe),N.lua_rawget(Oe,-2)===N.LUA_TFUNCTION&&(N.lua_pushstring(Oe,_e[xe.event]),0<=xe.currentline?N.lua_pushinteger(Oe,xe.currentline):N.lua_pushnil(Oe),E(N.lua_getinfo(Oe,['l'.charCodeAt(0),'S'.charCodeAt(0)],xe)),N.lua_call(Oe,2,0))},ce=function(Oe,xe){let Ue=0;return-1<Oe.indexOf('c'.charCodeAt(0))&&(Ue|=N.LUA_MASKCALL),-1<Oe.indexOf('r'.charCodeAt(0))&&(Ue|=N.LUA_MASKRET),-1<Oe.indexOf('l'.charCodeAt(0))&&(Ue|=N.LUA_MASKLINE),0<xe&&(Ue|=N.LUA_MASKCOUNT),Ue},de=function(Oe,xe){let Ue=0;return Oe&N.LUA_MASKCALL&&(xe[Ue++]='c'.charCodeAt(0)),Oe&N.LUA_MASKRET&&(xe[Ue++]='r'.charCodeAt(0)),Oe&N.LUA_MASKLINE&&(xe[Ue++]='l'.charCodeAt(0)),xe},Te={gethook:function(Oe){let xe=H(Oe),Ue=xe.thread,Ee=xe.arg,ve=N.lua_gethookmask(Ue),Re=N.lua_gethook(Ue);return null===Re?N.lua_pushnil(Oe):Re===pe?(N.lua_rawgetp(Oe,N.LUA_REGISTRYINDEX,oe),M(Oe,Ue,1),N.lua_pushthread(Ue),N.lua_xmove(Ue,Oe,1),N.lua_rawget(Oe,-2),N.lua_remove(Oe,-2)):N.lua_pushliteral(Oe,'external hook'),N.lua_pushstring(Oe,de(ve,[])),N.lua_pushinteger(Oe,N.lua_gethookcount(Ue)),3},getinfo:function(Oe){let xe=new N.lua_Debug,Ue=H(Oe),Ee=Ue.arg,ke=Ue.thread,ve=I.luaL_optstring(Oe,Ee+2,N.to_luastring('flnStu',!0));if(M(Oe,ke,3),N.lua_isfunction(Oe,Ee+1))ve=['>'.charCodeAt(0)].concat(ve),N.lua_pushvalue(Oe,Ee+1),N.lua_xmove(Oe,ke,1);else if(!N.lua_getstack(ke,I.luaL_checkinteger(Oe,Ee+1),xe))return N.lua_pushnil(Oe),1;return N.lua_getinfo(ke,ve,xe)||I.luaL_argerror(Oe,Ee+2,N.to_luastring('invalid option',!0)),N.lua_newtable(Oe),-1<ve.indexOf('S'.charCodeAt(0))&&(Y(Oe,N.to_luastring('source',!0),xe.source),Y(Oe,N.to_luastring('short_src',!0),xe.short_src),Y(Oe,N.to_luastring('linedefined',!0),N.to_luastring(`${xe.linedefined}`)),Y(Oe,N.to_luastring('lastlinedefined',!0),N.to_luastring(`${xe.lastlinedefined}`)),Y(Oe,N.to_luastring('what',!0),xe.what)),-1<ve.indexOf('l'.charCodeAt(0))&&J(Oe,N.to_luastring('currentline',!0),xe.currentline),-1<ve.indexOf('u'.charCodeAt(0))&&(J(Oe,N.to_luastring('nups',!0),xe.nups),J(Oe,N.to_luastring('nparams',!0),xe.nparams),q(Oe,N.to_luastring('isvararg',!0),xe.isvararg)),-1<ve.indexOf('n'.charCodeAt(0))&&(Y(Oe,N.to_luastring('name',!0),xe.name?xe.name:null),Y(Oe,N.to_luastring('namewhat',!0),xe.namewhat?xe.namewhat:null)),-1<ve.indexOf('t'.charCodeAt(0))&&q(Oe,N.to_luastring('istailcall',!0),xe.istailcall),-1<ve.indexOf('L'.charCodeAt(0))&&W(Oe,ke,N.to_luastring('activelines',!0)),-1<ve.indexOf('f'.charCodeAt(0))&&W(Oe,ke,N.to_luastring('func',!0)),1},getlocal:function(Oe){let xe=H(Oe),Ue=xe.thread,Ee=xe.arg,ke=new N.lua_Debug,ve=I.luaL_checkinteger(Oe,Ee+2);if(N.lua_isfunction(Oe,Ee+1))return N.lua_pushvalue(Oe,Ee+1),N.lua_pushstring(Oe,N.lua_getlocal(Oe,null,ve)),1;let Re=I.luaL_checkinteger(Oe,Ee+1);if(!N.lua_getstack(Ue,Re,ke))return I.luaL_argerror(Oe,Ee+1,N.to_luastring('level out of range',!0));M(Oe,Ue,1);let be=N.lua_getlocal(Ue,ke,ve);return be?(N.lua_xmove(Ue,Oe,1),N.lua_pushstring(Oe,be),N.lua_rotate(Oe,-2,1),2):(N.lua_pushnil(Oe),1)},getmetatable:function(Oe){return I.luaL_checkany(Oe,1),N.lua_getmetatable(Oe,1)||N.lua_pushnil(Oe),1},getregistry:function(Oe){return N.lua_pushvalue(Oe,N.LUA_REGISTRYINDEX),1},getupvalue:function(Oe){return ee(Oe,1)},getuservalue:function(Oe){return N.lua_type(Oe,1)===N.LUA_TUSERDATA?N.lua_getuservalue(Oe,1):N.lua_pushnil(Oe),1},sethook:function(Oe){let ke=H(Oe),ve=ke.thread,Re=ke.arg,xe,Ue,Ee;if(N.lua_isnoneornil(Oe,Re+1))N.lua_settop(Oe,Re+1),Ee=null,xe=0,Ue=0;else{const be=I.luaL_checkstring(Oe,Re+2);I.luaL_checktype(Oe,Re+1,N.LUA_TFUNCTION),Ue=I.luaL_optinteger(Oe,Re+3,0),Ee=pe,xe=ce(be,Ue)}return N.lua_rawgetp(Oe,N.LUA_REGISTRYINDEX,oe)===N.LUA_TNIL&&(N.lua_createtable(Oe,0,2),N.lua_pushvalue(Oe,-1),N.lua_rawsetp(Oe,N.LUA_REGISTRYINDEX,oe),N.lua_pushstring(Oe,['k'.charCodeAt(0)]),N.lua_setfield(Oe,-2,N.to_luastring('__mode',!0)),N.lua_pushvalue(Oe,-1),N.lua_setmetatable(Oe,-2)),M(Oe,ve,1),N.lua_pushthread(ve),N.lua_xmove(ve,Oe,1),N.lua_pushvalue(Oe,Re+1),N.lua_rawset(Oe,-3),N.lua_sethook(ve,Ee,xe,Ue),0},setlocal:function(Oe){let xe=H(Oe),Ue=xe.thread,Ee=xe.arg,ke=new N.lua_Debug,ve=I.luaL_checkinteger(Oe,Ee+1),Re=I.luaL_checkinteger(Oe,Ee+2);if(!N.lua_getstack(Ue,ve,ke))return I.luaL_argerror(Oe,Ee+1,'level out of range');I.luaL_checkany(Oe,Ee+3),N.lua_settop(Oe,Ee+3),M(Oe,Ue,1),N.lua_xmove(Oe,Ue,1);let be=N.lua_setlocal(Ue,ke,Re);return null===be&&N.lua_pop(Ue,1),N.lua_pushstring(Oe,be),1},setmetatable:function(Oe){const xe=N.lua_type(Oe,2);return I.luaL_argcheck(Oe,xe==N.LUA_TNIL||xe==N.LUA_TTABLE,2,N.to_luastring('nil or table expected',!0)),N.lua_settop(Oe,2),N.lua_setmetatable(Oe,1),1},setupvalue:function(Oe){return I.luaL_checkany(Oe,3),ee(Oe,0)},setuservalue:function(Oe){return I.luaL_checktype(Oe,1,N.LUA_TUSERDATA),I.luaL_checkany(Oe,2),N.lua_settop(Oe,2),N.lua_setuservalue(Oe,1),1},traceback:function(Oe){let xe=H(Oe),Ue=xe.thread,Ee=xe.arg,ke=N.lua_tostring(Oe,Ee+1);if(null===ke&&!N.lua_isnoneornil(Oe,Ee+1))N.lua_pushvalue(Oe,Ee+1);else{let ve=I.luaL_optinteger(Oe,Ee+2,Oe===Ue?1:0);I.luaL_traceback(Oe,Ue,ke,ve)}return 1},upvalueid:function(Oe){let xe=ue(Oe,1,2);return N.lua_pushlightuserdata(Oe,N.lua_upvalueid(Oe,1,xe)),1},upvaluejoin:function(Oe){let xe=ue(Oe,1,2),Ue=ue(Oe,3,4);return I.luaL_argcheck(Oe,!N.lua_iscfunction(Oe,1),1,N.to_luastring('Lua function expected',!0)),I.luaL_argcheck(Oe,!N.lua_iscfunction(Oe,3),3,N.to_luastring('Lua function expected',!0)),N.lua_upvaluejoin(Oe,1,xe,3,Ue),0}};T.exports.luaopen_debug=function(Oe){return I.luaL_newlib(Oe,Te),1}},function(T){'use strict';T.exports.lisdigit=function(V){return /^\d$/.test(_StringfromCharCode(V))},T.exports.lislalnum=function(V){return /^[_a-zA-Z0-9]$/.test(_StringfromCharCode(V))},T.exports.lislalpha=function(V){return /^[_a-zA-Z]$/.test(_StringfromCharCode(V))},T.exports.lisprint=function(V){return /^[\x20-\x7E]$/.test(_StringfromCharCode(V))},T.exports.lisspace=function(V){return /^\s$/.test(_StringfromCharCode(V))},T.exports.lisxdigit=function(V){return /^[0-9a-fA-F]$/.test(_StringfromCharCode(V))}},function(T,O,U){'use strict';const E=U(33),N=U(2),I=U(6),M=U(4),P=U(12);var K=E();const $=function(he,Oe){let xe=P.lua_numbertointeger(Oe);!1===xe?N.lua_pushnumber(he,Oe):N.lua_pushinteger(he,xe)},Ae={abs:function(he){return N.lua_isinteger(he,1)?N.lua_pushinteger(he,_Mathabs(N.lua_tointeger(he,1))):N.lua_pushnumber(he,_Mathabs(I.luaL_checknumber(he,1))),1},acos:function(he){return N.lua_pushnumber(he,Math.acos(I.luaL_checknumber(he,1))),1},asin:function(he){return N.lua_pushnumber(he,Math.asin(I.luaL_checknumber(he,1))),1},atan:function(he){return N.lua_pushnumber(he,Math.atan(I.luaL_checknumber(he,1))),1},ceil:function(he){return N.lua_isinteger(he,1)?N.lua_settop(he,1):$(he,_Mathceil(I.luaL_checknumber(he,1))),1},cos:function(he){return N.lua_pushnumber(he,Math.cos(I.luaL_checknumber(he,1))),1},deg:function(he){return N.lua_pushnumber(he,I.luaL_checknumber(he,1)*(180/_MathPI)),1},exp:function(he){return N.lua_pushnumber(he,Math.exp(I.luaL_checknumber(he,1))),1},floor:function(he){return N.lua_isinteger(he,1)?N.lua_settop(he,1):$(he,_Mathfloor(I.luaL_checknumber(he,1))),1},fmod:function(he){if(N.lua_isinteger(he,1)&&N.lua_isinteger(he,2)){let Oe=N.lua_tointeger(he,2);1>=_Mathabs(Oe)+1?(I.luaL_argcheck(he,0!==Oe,2,N.to_luastring('zero',!0)),N.lua_pushinteger(he,0)):N.lua_pushinteger(he,N.lua_tointeger(he,1)%Oe)}else{let Oe=I.luaL_checknumber(he,1),xe=I.luaL_checknumber(he,2);N.lua_pushnumber(he,+(Oe-_Mathfloor(Oe/xe)*xe).toPrecision(8))}return 1},log:function(he){let Oe=I.luaL_checknumber(he,1),xe;if(N.lua_isnoneornil(he,2))xe=_Mathlog(Oe);else{let Ue=I.luaL_checknumber(he,2);xe=2===Ue?Math.log2(Oe):10===Ue?Math.log10(Oe):_Mathlog(Oe)/_Mathlog(Ue)}return N.lua_pushnumber(he,xe),1},max:function(he){let Oe=N.lua_gettop(he),xe=1;I.luaL_argcheck(he,1<=Oe,1,N.to_luastring('value expected',!0));for(let Ue=2;Ue<=Oe;Ue++)N.lua_compare(he,xe,Ue,N.LUA_OPLT)&&(xe=Ue);return N.lua_pushvalue(he,xe),1},min:function(he){let Oe=N.lua_gettop(he),xe=1;I.luaL_argcheck(he,1<=Oe,1,N.to_luastring('value expected',!0));for(let Ue=2;Ue<=Oe;Ue++)N.lua_compare(he,Ue,xe,N.LUA_OPLT)&&(xe=Ue);return N.lua_pushvalue(he,xe),1},modf:function(he){if(N.lua_isinteger(he,1))N.lua_settop(he,1),N.lua_pushnumber(he,0);else{let Oe=I.luaL_checknumber(he,1),xe=0>Oe?_Mathceil(Oe):_Mathfloor(Oe);$(he,xe),N.lua_pushnumber(he,Oe===xe?0:Oe-xe)}return 2},rad:function(he){return N.lua_pushnumber(he,I.luaL_checknumber(he,1)*(_MathPI/180)),1},random:function(he){let Ue=K(),Oe,xe;switch(N.lua_gettop(he)){case 0:return N.lua_pushnumber(he,Ue),1;case 1:{Oe=1,xe=I.luaL_checkinteger(he,1);break}case 2:{Oe=I.luaL_checkinteger(he,1),xe=I.luaL_checkinteger(he,2);break}default:return I.luaL_error(he,N.to_luastring('wrong number of arguments',!0));}return I.luaL_argcheck(he,Oe<=xe,1,N.to_luastring('interval is empty',!0)),I.luaL_argcheck(he,0<=Oe||xe<=M.MAX_INT+Oe,1,N.to_luastring('interval too large',!0)),Ue*=xe-Oe+1,N.lua_pushinteger(he,_Mathfloor(Ue)+Oe),1},randomseed:function(he){K=E(_Mathabs(I.luaL_checknumber(he,1)))},sin:function(he){return N.lua_pushnumber(he,Math.sin(I.luaL_checknumber(he,1))),1},sqrt:function(he){return N.lua_pushnumber(he,Math.sqrt(I.luaL_checknumber(he,1))),1},tan:function(he){return N.lua_pushnumber(he,Math.tan(I.luaL_checknumber(he,1))),1},tointeger:function(he){let Oe=N.lua_tointegerx(he,1);return!1===Oe?(I.luaL_checkany(he,1),N.lua_pushnil(he)):N.lua_pushinteger(he,Oe),1},type:function(he){return N.lua_type(he,1)===N.LUA_TNUMBER?N.lua_isinteger(he,1)?N.lua_pushliteral(he,'integer'):N.lua_pushliteral(he,'float'):(I.luaL_checkany(he,1),N.lua_pushnil(he)),1},ult:function(he){let Oe=I.luaL_checkinteger(he,1),xe=I.luaL_checkinteger(he,2);return N.lua_pushboolean(he,_Mathabs(Oe)<_Mathabs(xe)),1}};T.exports.luaopen_math=function(he){return I.luaL_newlib(he,Ae),N.lua_pushnumber(he,Math.PI),N.lua_setfield(he,-2,N.to_luastring('pi',!0)),N.lua_pushnumber(he,Infinity),N.lua_setfield(he,-2,N.to_luastring('huge',!0)),N.lua_pushinteger(he,M.MAX_INT),N.lua_setfield(he,-2,N.to_luastring('maxinteger',!0)),N.lua_pushinteger(he,M.MIN_INT),N.lua_setfield(he,-2,N.to_luastring('mininteger',!0)),1}},function(T,O,U){'use strict';(function(E){const N=U(2),I=U(6),M=['-'.charCodeAt(0)],P=N.to_luastring('__CLIBS__',!0),G=N.LUA_DIRSEP,F=N.LUA_DIRSEP,H='luaopen_',J=[1],Z=function(Ne,Ie){try{return Ie=N.to_jsstring(Ie),Ie.startsWith('.')&&(Ie=`${E.env.PWD}/${Ie}`),!function(){var Me=new Error('Cannot find module "."');throw Me.code='MODULE_NOT_FOUND',Me}()}catch(Ce){N.lua_pushjsstring(Ne,Ce.message)}},Q=function(Ne,Ie,Ce){let Me=Ie[N.to_jsstring(Ce)];return Me&&'function'==typeof Me?Me:void N.lua_pushliteral(Ne,`'${N.to_jsstring(Ce)}'`)},$=function(Ne){N.lua_getfield(Ne,N.LUA_REGISTRYINDEX,N.to_luastring('LUA_NOENV'));let Ie=N.lua_toboolean(Ne,-1);return N.lua_pop(Ne,1),Ie};let ee=function(){return!1};const te=1,ae=2,ue=function(Ne,Ie,Ce){let Me=oe(Ne,Ie);if(null===Me){if(Me=Z(Ne,Ie,Ce[0]==='*'.charCodeAt(0)),null===Me)return te;_e(Ne,Ie,Me)}if(Ce[0]==='*'.charCodeAt(0))return N.lua_pushboolean(Ne,1),0;let Pe=Q(Ne,Me,Ce);return null===Pe?ae:(N.lua_pushcfunction(Ne,Pe),0)},ne=function(Ne,Ie,Ce,Me){let Pe=N.lua_pushstring(Ne,N.to_luastring(`${Ce}${N.LUA_VERSUFFIX}`,!0)),ye=E.env[Pe];void 0===ye&&(ye=E.env[Ce]),void 0===ye||$(Ne)?N.lua_pushstring(Ne,N.to_luastring(Me,!0)):(ye=I.luaL_gsub(Ne,N.to_luastring(ye),N.to_luastring(N.LUA_PATH_SEP+N.LUA_PATH_SEP,!0),N.to_luastring(N.LUA_PATH_SEP,!0).concat(J).concat(N.to_luastring(N.LUA_PATH_SEP,!0))),I.luaL_gsub(Ne,ye,J,N.to_luastring(Me)),N.lua_remove(Ne,-2)),N.lua_setfield(Ne,-3,Ie),N.lua_pop(Ne,1)},oe=function(Ne,Ie){N.lua_rawgetp(Ne,N.LUA_REGISTRYINDEX,P),N.lua_getfield(Ne,-1,Ie);let Ce=N.lua_touserdata(Ne,-1);return N.lua_pop(Ne,2),Ce},_e=function(Ne,Ie,Ce){N.lua_rawgetp(Ne,N.LUA_REGISTRYINDEX,P),N.lua_pushlightuserdata(Ne,Ce),N.lua_pushvalue(Ne,-1),N.lua_setfield(Ne,-3,Ie),N.lua_rawseti(Ne,-2,I.luaL_len(Ne,-2)+1),N.lua_pop(Ne,1)},pe=function(Ne,Ie){for(;Ie[0]===N.LUA_PATH_SEP.charCodeAt(0);)Ie=Ie.slice(1);if(0===Ie.length)return null;let Ce=Ie.indexOf(N.LUA_PATH_SEP.charCodeAt(0));return 0>Ce&&(Ce=Ie.length),N.lua_pushlstring(Ne,Ie,Ce),Ie.slice(Ce)},ce=function(Ne,Ie,Ce,Me,Pe){let ye=[];for(0!==Me[0]&&(Ie=I.luaL_gsub(Ne,Ie,Me,Pe));null!==(Ce=pe(Ne,Ce));){let De=I.luaL_gsub(Ne,N.lua_tostring(Ne,-1),N.to_luastring(N.LUA_PATH_MARK,!0),Ie);if(N.lua_remove(Ne,-2),ee(De))return De;N.lua_remove(Ne,-1),ye.push(...N.to_luastring(`\n\tno file '${N.to_jsstring(De)}'`))}return N.lua_pushstring(Ne,ye),null},Le=function(Ne,Ie,Ce,Me){N.lua_getfield(Ne,N.lua_upvalueindex(1),Ce);let Pe=N.lua_tostring(Ne,-1);return null===Pe&&I.luaL_error(Ne,N.to_luastring('\'package.%s\' must be a string'),Ce),ce(Ne,Ie,Pe,['.'.charCodeAt(0)],Me)},ge=function(Ne,Ie,Ce){return Ie?(N.lua_pushstring(Ne,Ce),2):I.luaL_error(Ne,N.to_luastring('error loading module \'%s\' from file \'%s\':\n\t%s'),N.lua_tostring(Ne,1),Ce,N.lua_tostring(Ne,1))},Ae=function(Ne){let Ie=I.luaL_checkstring(Ne,1),Ce=Le(Ne,Ie,N.to_luastring('path',!0),N.to_luastring(F,!0));return null===Ce?1:ge(Ne,I.luaL_loadfile(Ne,Ce)===N.LUA_OK,Ce)},Te=function(Ne,Ie,Ce){let Me;Ce=I.luaL_gsub(Ne,Ce,['.'.charCodeAt(0)],'_');let Pe=Ce.indexOf(M[0]);if(0<=Pe){Me=N.lua_pushlstring(Ne,Ce,Pe),Me=N.lua_pushstring(Ne,N.to_luastring(`${H}${Me}`));let ye=ue(Ne,Ie,Me);if(ye!==ae)return ye;Ce=Pe+1}return Me=N.lua_pushstring(Ne,N.to_luastring(`${H}${Ce}`)),ue(Ne,Ie,Me)},he=function(Ne){let Ie=I.luaL_checkstring(Ne,1),Ce=Le(Ne,Ie,N.to_luastring('cpath',!0),N.to_luastring(G,!0));return null===Ce?1:ge(Ne,0===Te(Ne,Ce,Ie),Ce)},Oe=function(Ne){let Ie=I.luaL_checkstring(Ne,1),Ce=Ie.indexOf('.'.charCodeAt(0)),Me;if(0>Ce)return 0;N.lua_pushlstring(Ne,Ie,Ce);let Pe=Le(Ne,N.lua_tostring(Ne,-1),N.to_luastring('cpath',!0),N.to_luastring(G,!0));return null===Pe?1:0===(Me=Te(Ne,Pe,Ie))?(N.lua_pushstring(Ne,Pe),2):Me==ae?(N.lua_pushstring(Ne,N.to_luastring(`\n\tno module '${N.to_jsstring(Ie)}' in file '${N.to_jsstring(Pe)}'`)),1):ge(Ne,0,Pe)},xe=function(Ne){let Ie=I.luaL_checkstring(Ne,1);return N.lua_getfield(Ne,N.LUA_REGISTRYINDEX,N.to_luastring(I.LUA_PRELOAD_TABLE,!0)),N.lua_getfield(Ne,-1,Ie)===N.LUA_TNIL&&N.lua_pushliteral(Ne,`\n\tno field package.preload['${N.to_jsstring(Ie)}']`),1},Ue=function(Ne,Ie){let Ce=[];N.lua_getfield(Ne,N.lua_upvalueindex(1),N.to_luastring('searchers',!0))!==N.LUA_TTABLE&&I.luaL_error(Ne,N.to_luastring('\'package.searchers\' must be a table'));for(let Me=1;;Me++){if(N.lua_rawgeti(Ne,3,Me)===N.LUA_TNIL&&(N.lua_pop(Ne,1),N.lua_pushstring(Ne,Ce),I.luaL_error(Ne,N.to_luastring('module \'%s\' not found:%s'),Ie,N.lua_tostring(Ne,-1))),N.lua_pushstring(Ne,Ie),N.lua_call(Ne,1,2),N.lua_isfunction(Ne,-2))return;N.lua_isstring(Ne,-2)?(N.lua_pop(Ne,1),Ce.push(...N.lua_tostring(Ne,-1)),N.lua_remove(Ne,-1)):N.lua_pop(Ne,2)}},ke={loadlib:function(Ne){let Ie=I.luaL_checkstring(Ne,1),Ce=I.luaL_checkstring(Ne,2),Me=ue(Ne,Ie,Ce);return 0===Me?1:(N.lua_pushnil(Ne),N.lua_insert(Ne,-2),N.lua_pushjsstring(Ne,Me===te?'absent':'init'),3)},searchpath:function(Ne){let Ie=ce(Ne,I.luaL_checkstring(Ne,1),I.luaL_checkstring(Ne,2),I.luaL_optstring(Ne,3,['.'.charCodeAt(0)]),I.luaL_optstring(Ne,4,[N.LUA_DIRSEP.charCodeAt(0)]));return null===Ie?(N.lua_pushnil(Ne),N.lua_insert(Ne,-2),2):1}},ve={require:function(Ne){let Ie=I.luaL_checkstring(Ne,1);return(N.lua_settop(Ne,1),N.lua_getfield(Ne,N.LUA_REGISTRYINDEX,N.to_luastring(I.LUA_LOADED_TABLE,!0)),N.lua_getfield(Ne,2,Ie),N.lua_toboolean(Ne,-1))?1:(N.lua_pop(Ne,1),Ue(Ne,Ie),N.lua_pushstring(Ne,Ie),N.lua_insert(Ne,-2),N.lua_call(Ne,2,1),N.lua_isnil(Ne,-1)||N.lua_setfield(Ne,2,Ie),N.lua_getfield(Ne,2,Ie)==N.LUA_TNIL&&(N.lua_pushboolean(Ne,1),N.lua_pushvalue(Ne,-1),N.lua_setfield(Ne,2,Ie)),1)}},Re=function(Ne){let Ie=[xe,Ae,he,Oe,null];N.lua_createtable(Ne);for(let Ce=0;Ie[Ce];Ce++)N.lua_pushvalue(Ne,-2),N.lua_pushcclosure(Ne,Ie[Ce],1),N.lua_rawseti(Ne,-2,Ce+1);N.lua_setfield(Ne,-2,N.to_luastring('searchers',!0))},be=function(Ne){N.lua_newtable(Ne),N.lua_createtable(Ne,0,1),N.lua_setmetatable(Ne,-2),N.lua_rawsetp(Ne,N.LUA_REGISTRYINDEX,P)};T.exports.luaopen_package=function(Ne){return be(Ne),I.luaL_newlib(Ne,ke),Re(Ne),ne(Ne,N.to_luastring('path',!0),'LUA_PATH',N.LUA_PATH_DEFAULT),ne(Ne,N.to_luastring('cpath',!0),'LUA_CPATH',N.LUA_CPATH_DEFAULT),N.lua_pushliteral(Ne,N.LUA_DIRSEP+'\n'+N.LUA_PATH_SEP+'\n'+N.LUA_PATH_MARK+'\n'+N.LUA_EXEC_DIR+'\n'+M+'\n'),N.lua_setfield(Ne,-2,N.to_luastring('config',!0)),I.luaL_getsubtable(Ne,N.LUA_REGISTRYINDEX,N.to_luastring(I.LUA_LOADED_TABLE,!0)),N.lua_setfield(Ne,-2,N.to_luastring('loaded',!0)),I.luaL_getsubtable(Ne,N.LUA_REGISTRYINDEX,N.to_luastring(I.LUA_PRELOAD_TABLE,!0)),N.lua_setfield(Ne,-2,N.to_luastring('preload',!0)),N.lua_pushglobaltable(Ne),N.lua_pushvalue(Ne,-2),I.luaL_setfuncs(Ne,ve,1),N.lua_pop(Ne,1),1}}).call(O,U(18))},function(T,O,U){'use strict';(function(E){const N=U(2),I=U(6),M=U(4),P=U(42),K=N.to_luastring('aAbBcdHIjmMpSUwWxXyYZ%',!0),V=N.to_luastring('aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%||EcECExEXEyEYOdOeOHOIOmOMOSOuOUOVOwOWOy',!0),G=N.to_luastring('aAbBcdHIjmMpSUwWxXyYzZ%||#c#x#d#H#I#j#m#M#S#U#w#W#y#Y',!0),H=function(se,ne,oe){N.lua_pushinteger(se,oe),N.lua_setfield(se,-2,N.to_luastring(ne,!0))},Y=function(se,ne,oe){H(se,'sec',oe?ne.getUTCSeconds():ne.getSeconds()),H(se,'min',oe?ne.getUTCMinutes():ne.getMinutes()),H(se,'hour',oe?ne.getUTCHours():ne.getHours()),H(se,'day',oe?ne.getUTCDate():ne.getDate()),H(se,'month',oe?ne.getUTCMonth():ne.getMonth()),H(se,'year',oe?ne.getUTCFullYear():ne.getFullYear()),H(se,'wday',oe?ne.getUTCDay():ne.getDay());let _e=new Date;H(se,'yday',_Mathfloor((_e-new Date(_e.getFullYear(),0,0))/86400000))},J=M.MAX_INT/2,q=function(se,ne,oe,_e){let pe=N.lua_getfield(se,-1,N.to_luastring(ne,!0)),ce=N.lua_tointegerx(se,-1);if(!1===ce){if(pe!==N.LUA_TNIL)return I.luaL_error(se,N.to_luastring(`field '${ne}' is not an integer`),!0);if(0>oe)return I.luaL_error(se,N.to_luastring(`field '${ne}' missing in date table`),!0);ce=oe}else{if(!(-J<=ce&&ce<=J))return I.luaL_error(se,N.to_luastring(`field '${ne}' is out-of-bound`),!0);ce-=_e}return N.lua_pop(se,1),ce},W=function(se,ne,oe){for(let _e=K,pe=1;0<_e.length&&pe<=ne.length;_e=_e.slice(pe))if(_e[0]==='|'.charCodeAt(0))pe++;else if(N.to_jsstring(ne.slice(0,pe))===N.to_jsstring(_e.slice(0,pe)))return oe.push(...ne.slice(0,pe)),ne.slice(pe);I.luaL_argerror(se,1,N.lua_pushliteral(se,`invalid conversion specifier '%${ne}'`,ne))},ee=function(se,ne){let oe=I.luaL_checkinteger(se,ne);return oe},ae={date:function(se){let ne=I.luaL_optlstring(se,1,'%c'),oe=1e3*I.luaL_opt(se,ee,2,new Date().getTime()/1e3),_e=new Date(oe),pe=!1;if(ne[0]==='!'.charCodeAt(0)&&(pe=!0,ne=ne.slice(1)),null===_e&&I.luaL_error(se,N.to_luastring('time result cannot be represented in this installation',!0)),'*t'===N.to_jsstring(ne))N.lua_createtable(se,0,9),Y(se,_e,pe);else{let de=[],ce;for(;0<ne.length;)ce=['%'.charCodeAt(0)],ne[0]==='%'.charCodeAt(0)?(ne=ne.slice(1),ne=W(se,ne,ce),de.push(...N.to_luastring(P(N.to_jsstring(ce),_e)))):(de.push(ne[0]),ne=ne.slice(1));N.lua_pushstring(se,de)}return 1},difftime:function(se){let ne=ee(se,1),oe=ee(se,2);return N.lua_pushnumber(se,new Date(ne)-new Date(oe)),1},time:function(se){let ne=new Date;return N.lua_isnoneornil(se,1)||(I.luaL_checktype(se,1,N.LUA_TTABLE),N.lua_settop(se,1),ne.setSeconds(q(se,'sec',0,0)),ne.setMinutes(q(se,'min',0,0)),ne.setHours(q(se,'hour',12,0)),ne.setDate(q(se,'day',-1,0)),ne.setMonth(q(se,'month',-1,1)),ne.setFullYear(q(se,'year',-1,0)),Y(se,ne)),N.lua_pushinteger(se,_Mathfloor(ne/1e3)),1}};E&&E.exit&&E.env&&E.uptime&&(ae.clock=function(_e){return N.lua_pushnumber(_e,E.uptime()),1},ae.exit=function(_e){let pe;return pe=N.lua_isboolean(_e,1)?N.lua_toboolean(_e,1)?0:1:I.luaL_optinteger(_e,1,0),N.lua_toboolean(_e,2)&&N.lua_close(_e),_e&&E.exit(pe),0},ae.getenv=function(_e){return N.lua_pushliteral(_e,E.env[N.to_jsstring(I.luaL_checkstring(_e,1))]),1}),T.exports.luaopen_os=function(se){return I.luaL_newlib(se,ae),1}}).call(O,U(18))},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(49),M=U(11),P=U(19),K=U(4),V=U(5),G=U(20),F=U(7),H=U(10),Y=I.BinOpr,J=G.OpCodesI,q=M.Proto,W=P.RESERVED,Z=V.TValue,Q=I.UnOpr,$=N.char,te=function(sa){return sa===se.VCALL||sa===se.VVARARG},ae=function(sa,na){return F.luaS_eqlngstr(sa,na)};class ue{constructor(){this.previous=null,this.firstlabel=NaN,this.firstgoto=NaN,this.nactvar=NaN,this.upval=NaN,this.isloop=NaN}}const se={VVOID:0,VNIL:1,VTRUE:2,VFALSE:3,VK:4,VKFLT:5,VKINT:6,VNONRELOC:7,VLOCAL:8,VUPVAL:9,VINDEXED:10,VJMP:11,VRELOCABLE:12,VCALL:13,VVARARG:14},ne=function(sa){return se.VLOCAL<=sa&&sa<=se.VINDEXED};class _e{constructor(){this.k=NaN,this.u={ival:NaN,nval:NaN,info:NaN,ind:{idx:NaN,t:NaN,vt:NaN}},this.t=NaN,this.f=NaN}to(sa){this.k=sa.k,this.u=sa.u,this.t=sa.t,this.f=sa.f}}class pe{constructor(){this.f=null,this.prev=null,this.ls=null,this.bl=null,this.pc=NaN,this.lasttarget=NaN,this.jpc=NaN,this.nk=NaN,this.np=NaN,this.firstlocal=NaN,this.nlocvars=NaN,this.nactvar=NaN,this.nups=NaN,this.freereg=NaN}}class ce{constructor(){this.idx=NaN}}class de{constructor(){this.name=null,this.pc=NaN,this.line=NaN,this.nactvar=NaN}}class Le{constructor(){this.arr=[],this.n=NaN,this.size=NaN}}const Ae=function(sa,na){sa.t.token=0,P.luaX_syntaxerror(sa,na)},Te=function(sa,na){P.luaX_syntaxerror(sa,V.luaO_pushfstring(sa.L,N.to_luastring('%s expected',!0),P.luaX_token2str(sa,na)))},he=function(sa,na,oa){let _a=sa.ls.L,ia=sa.f.linedefined,pa=0===ia?'main function':`function at line ${ia}`,ca=`too many ${oa} (limit is ${na}) in ${pa}`;P.luaX_syntaxerror(sa.ls,N.to_luastring(ca))},Oe=function(sa,na,oa,_a){na>oa&&he(sa,oa,_a)},xe=function(sa,na){return sa.t.token===na&&(P.luaX_next(sa),!0)},Ue=function(sa,na){sa.t.token!==na&&Te(sa,na)},Ee=function(sa,na){Ue(sa,na),P.luaX_next(sa)},ke=function(sa,na,oa){na||P.luaX_syntaxerror(sa,oa)},ve=function(sa,na,oa,_a){xe(sa,na)||(_a===sa.linenumber?Te(sa,na):P.luaX_syntaxerror(sa,V.luaO_pushfstring(sa.L,N.to_luastring('%s expected (to close %s at line %d)'),P.luaX_token2str(sa,na),P.luaX_token2str(sa,oa),_a)))},Re=function(sa){Ue(sa,W.TK_NAME);let na=sa.t.seminfo.ts;return P.luaX_next(sa),na},be=function(sa,na,oa){sa.f=sa.t=I.NO_JUMP,sa.k=na,sa.u.info=oa},Se=function(sa,na,oa){be(na,se.VK,I.luaK_stringK(sa.fs,oa))},Ne=function(sa,na){Se(sa,na,Re(sa))},Ie=function(sa,na){let oa=sa.fs,_a=oa.f;return _a.locvars[oa.nlocvars]=new V.LocVar,_a.locvars[oa.nlocvars].varname=na,oa.nlocvars++},Ce=function(sa,na){let oa=sa.fs,_a=sa.dyd,ia=Ie(sa,na);Oe(oa,_a.actvar.n+1-oa.firstlocal,200,N.to_luastring('local variables',!0)),_a.actvar.arr[_a.actvar.n]=new ce,_a.actvar.arr[_a.actvar.n].idx=ia,_a.actvar.n++},Me=function(sa,na){Ce(sa,P.luaX_newstring(sa,N.to_luastring(na,!0)))},Pe=function(sa,na){let oa=sa.ls.dyd.actvar.arr[sa.firstlocal+na].idx;return E(oa<sa.nlocvars),sa.f.locvars[oa]},ye=function(sa,na){let oa=sa.fs;for(oa.nactvar+=na;na;na--)Pe(oa,oa.nactvar-na).startpc=oa.pc},De=function(sa,na){for(sa.ls.dyd.actvar.n-=sa.nactvar-na;sa.nactvar>na;)Pe(sa,--sa.nactvar).endpc=sa.pc},Ke=function(sa,na){let oa=sa.f.upvalues;for(let _a=0;_a<sa.nups;_a++)if(ae(oa[_a].name,na))return _a;return-1},Be=function(sa,na,oa){let _a=sa.f;return Oe(sa,sa.nups+1,M.MAXUPVAL,N.to_luastring('upvalues',!0)),_a.upvalues[sa.nups]={instack:oa.k===se.VLOCAL,idx:oa.u.info,name:na},sa.nups++},Ve=function(sa,na){for(let oa=sa.nactvar-1;0<=oa;oa--)if(ae(na,Pe(sa,oa).varname))return oa;return-1},Ge=function(sa,na){let oa=sa.bl;for(;oa.nactvar>na;)oa=oa.previous;oa.upval=1},we=function(sa,na,oa,_a){if(null===sa)be(oa,se.VVOID,0);else{let ia=Ve(sa,na);if(0<=ia)be(oa,se.VLOCAL,ia),_a||Ge(sa,ia);else{let pa=Ke(sa,na);if(0>pa){if(we(sa.prev,na,oa,0),oa.k===se.VVOID)return;pa=Be(sa,na,oa)}be(oa,se.VUPVAL,pa)}}},Fe=function(sa,na){let oa=Re(sa),_a=sa.fs;if(we(_a,oa,na,1),na.k===se.VVOID){let ia=new _e;we(_a,sa.envn,na,1),E(na.k!==se.VVOID),Se(sa,ia,oa),I.luaK_indexed(_a,na,ia)}},Xe=function(sa,na,oa,_a){let ia=sa.fs,pa=na-oa;if(te(_a.k))pa++,0>pa&&(pa=0),I.luaK_setreturns(ia,_a,pa),1<pa&&I.luaK_reserveregs(ia,pa-1);else if(_a.k!==se.VVOID&&I.luaK_exp2nextreg(ia,_a),0<pa){let ca=ia.freereg;I.luaK_reserveregs(ia,pa),I.luaK_nil(ia,ca,pa)}oa>na&&(sa.fs.freereg-=oa-na)},He=function(sa){let na=sa.L;++na.nCcalls,Oe(sa.fs,na.nCcalls,K.LUAI_MAXCCALLS,N.to_luastring('JS levels',!0))},je=function(sa){return sa.L.nCcalls--},ze=function(sa,na,oa){let _a=sa.fs,ia=sa.dyd.gt,pa=ia.arr[na];if(E(ae(pa.name,oa.name)),pa.nactvar<oa.nactvar){let ca=Pe(_a,pa.nactvar).varname,da=V.luaO_pushfstring(sa.L,N.to_luastring('<goto %s> at line %d jumps into the scope of local \'%s\''),pa.name,pa.line,ca);Ae(sa,da)}I.luaK_patchlist(_a,pa.pc,oa.pc);for(let ca=na;ca<ia.n-1;ca++)ia.arr[ca]=ia.arr[ca+1];ia.n--},Ye=function(sa,na){let oa=sa.fs.bl,_a=sa.dyd,ia=_a.gt.arr[na];for(let pa=oa.firstlabel,ca;pa<_a.label.n;pa++)if(ca=_a.label.arr[pa],ae(ca.name,ia.name))return ia.nactvar>ca.nactvar&&(oa.upval||_a.label.n>oa.firstlabel)&&I.luaK_patchclose(sa.fs,ia.pc,ca.nactvar),ze(sa,na,ca),!0;return!1},Je=function(sa,na,oa,_a,ia){let pa=na.n;return na.arr[pa]=new de,na.arr[pa].name=oa,na.arr[pa].line=_a,na.arr[pa].nactvar=sa.fs.nactvar,na.arr[pa].pc=ia,na.n=pa+1,pa},qe=function(sa,na){for(let oa=sa.dyd.gt,_a=sa.fs.bl.firstgoto;_a<oa.n;)ae(oa.arr[_a].name,na.name)?ze(sa,_a,na):_a++},We=function(sa,na){for(let oa=na.firstgoto,_a=sa.ls.dyd.gt,ia;oa<_a.n;)ia=_a.arr[oa],ia.nactvar>na.nactvar&&(na.upval&&I.luaK_patchclose(sa,ia.pc,na.nactvar),ia.nactvar=na.nactvar),Ye(sa.ls,oa)||oa++},Ze=function(sa,na,oa){na.isloop=oa,na.nactvar=sa.nactvar,na.firstlabel=sa.ls.dyd.label.n,na.firstgoto=sa.ls.dyd.gt.n,na.upval=0,na.previous=sa.bl,sa.bl=na,E(sa.freereg===sa.nactvar)},Qe=function(sa){let na=F.luaS_newliteral(sa.L,'break'),oa=Je(sa,sa.dyd.label,na,0,sa.fs.pc);qe(sa,sa.dyd.label.arr[oa])},$e=function(sa,na){let oa=P.isreserved(na.name)?'<%s> at line %d not inside a loop':'no visible label \'%s\' for <goto> at line %d';oa=V.luaO_pushfstring(sa.L,N.to_luastring(oa),na.name,na.line),Ae(sa,oa)},et=function(sa){let na=sa.L,oa=new q(na),_a=sa.fs,ia=_a.f;return ia.p[_a.np++]=oa,oa},at=function(sa,na){let oa=sa.fs.prev;be(na,se.VRELOCABLE,I.luaK_codeABx(oa,J.OP_CLOSURE,0,oa.np-1)),I.luaK_exp2nextreg(oa,na)},lt=function(sa,na,oa){na.prev=sa.fs,na.ls=sa,sa.fs=na,na.pc=0,na.lasttarget=0,na.jpc=I.NO_JUMP,na.freereg=0,na.nk=0,na.np=0,na.nups=0,na.nlocvars=0,na.nactvar=0,na.firstlocal=sa.dyd.actvar.n,na.bl=null;let _a=new q(sa.L);_a=na.f,_a.source=sa.source,_a.maxstacksize=2,Ze(na,oa,!1)},ut=function(sa){let na=sa.bl,oa=sa.ls;if(na.previous&&na.upval){let _a=I.luaK_jump(sa);I.luaK_patchclose(sa,_a,na.nactvar),I.luaK_patchtohere(sa,_a)}na.isloop&&Qe(oa),sa.bl=na.previous,De(sa,na.nactvar),E(na.nactvar===sa.nactvar),sa.freereg=sa.nactvar,oa.dyd.label.n=na.firstlabel,na.previous?We(sa,na):na.firstgoto<oa.dyd.gt.n&&$e(oa,oa.dyd.gt.arr[na.firstgoto])},rt=function(sa){let na=sa.L,oa=sa.fs,_a=oa.f;I.luaK_ret(oa,0,0),ut(oa),sa.fs=oa.prev},st=function(sa,na){switch(sa.t.token){case W.TK_ELSE:case W.TK_ELSEIF:case W.TK_END:case W.TK_EOS:return!0;case W.TK_UNTIL:return na;default:return!1;}},nt=function(sa){for(;!st(sa,1);){if(sa.t.token===W.TK_RETURN)return void aa(sa);aa(sa)}},ot=function(sa,na){let oa=sa.fs,_a=new _e;I.luaK_exp2anyregup(oa,na),P.luaX_next(sa),Ne(sa,_a),I.luaK_indexed(oa,na,_a)},_t=function(sa,na){P.luaX_next(sa),It(sa,na),I.luaK_exp2val(sa.fs,na),Ee(sa,$[']'])};class it{constructor(){this.v=new _e,this.t=new _e,this.nh=NaN,this.na=NaN,this.tostore=NaN}}const pt=function(sa,na){let oa=sa.fs,_a=sa.fs.freereg,ia=new _e,pa=new _e;sa.t.token===W.TK_NAME?(Oe(oa,na.nh,K.MAX_INT,N.to_luastring('items in a constructor',!0)),Ne(sa,ia)):_t(sa,ia),na.nh++,Ee(sa,$['=']);let ca=I.luaK_exp2RK(oa,ia);It(sa,pa),I.luaK_codeABC(oa,J.OP_SETTABLE,na.t.u.info,ca,I.luaK_exp2RK(oa,pa)),oa.freereg=_a},ct=function(sa,na){na.v.k===se.VVOID||(I.luaK_exp2nextreg(sa,na.v),na.v.k=se.VVOID,na.tostore===G.LFIELDS_PER_FLUSH&&(I.luaK_setlist(sa,na.t.u.info,na.na,na.tostore),na.tostore=0))},dt=function(sa,na){0===na.tostore||(te(na.v.k)?(I.luaK_setmultret(sa,na.v),I.luaK_setlist(sa,na.t.u.info,na.na,N.LUA_MULTRET),na.na--):(na.v.k!==se.VVOID&&I.luaK_exp2nextreg(sa,na.v),I.luaK_setlist(sa,na.t.u.info,na.na,na.tostore)))},Lt=function(sa,na){It(sa,na.v),Oe(sa.fs,na.na,K.MAX_INT,N.to_luastring('items in a constructor',!0)),na.na++,na.tostore++},ft=function(sa,na){switch(sa.t.token){case W.TK_NAME:{P.luaX_lookahead(sa)===$['=']?pt(sa,na):Lt(sa,na);break}case $['[']:{pt(sa,na);break}default:{Lt(sa,na);break}}},At=function(sa,na){let oa=sa.fs,_a=sa.linenumber,ia=I.luaK_codeABC(oa,J.OP_NEWTABLE,0,0,0),pa=new it;pa.na=pa.nh=pa.tostore=0,pa.t=na,be(na,se.VRELOCABLE,ia),be(pa.v,se.VVOID,0),I.luaK_exp2nextreg(sa.fs,na),Ee(sa,$['{']);do{if(E(pa.v.k===se.VVOID||0<pa.tostore),sa.t.token===$['}'])break;ct(oa,pa),ft(sa,pa)}while(xe(sa,$[','])||xe(sa,$[';']));ve(sa,$['}'],$['{'],_a),dt(oa,pa),G.SETARG_B(oa.f.code[ia],V.luaO_int2fb(pa.na)),G.SETARG_C(oa.f.code[ia],V.luaO_int2fb(pa.nh))},Tt=function(sa){let na=sa.fs,oa=na.f,_a=0;if(oa.is_vararg=0,sa.t.token!==$[')'])do switch(sa.t.token){case W.TK_NAME:{Ce(sa,Re(sa)),_a++;break}case W.TK_DOTS:{P.luaX_next(sa),oa.is_vararg=1;break}default:P.luaX_syntaxerror(sa,N.to_luastring('<name> or \'...\' expected',!0));}while(!oa.is_vararg&&xe(sa,$[',']));ye(sa,_a),oa.numparams=na.nactvar,I.luaK_reserveregs(na,na.nactvar)},ht=function(sa,na,oa,_a){let ia=new pe,pa=new ue;ia.f=et(sa),ia.f.linedefined=_a,lt(sa,ia,pa),Ee(sa,$['(']),oa&&(Me(sa,'self'),ye(sa,1)),Tt(sa),Ee(sa,$[')']),nt(sa),ia.f.lastlinedefined=sa.linenumber,ve(sa,W.TK_END,W.TK_FUNCTION,_a),at(sa,na),rt(sa)},Ot=function(sa,na){let oa=1;for(It(sa,na);xe(sa,$[',']);)I.luaK_exp2nextreg(sa.fs,na),It(sa,na),oa++;return oa},xt=function(sa,na,oa){let _a=sa.fs,ia=new _e;switch(sa.t.token){case $['(']:{P.luaX_next(sa),sa.t.token===$[')']?ia.k=se.VVOID:(Ot(sa,ia),I.luaK_setmultret(_a,ia)),ve(sa,$[')'],$['('],oa);break}case $['{']:{At(sa,ia);break}case W.TK_STRING:{Se(sa,ia,sa.t.seminfo.ts),P.luaX_next(sa);break}default:P.luaX_syntaxerror(sa,N.to_luastring('function arguments expected',!0));}E(na.k===se.VNONRELOC);let ca=na.u.info,pa;te(ia.k)?pa=N.LUA_MULTRET:(ia.k!==se.VVOID&&I.luaK_exp2nextreg(_a,ia),pa=_a.freereg-(ca+1)),be(na,se.VCALL,I.luaK_codeABC(_a,J.OP_CALL,ca,pa+1,2)),I.luaK_fixline(_a,oa),_a.freereg=ca+1},Ut=function(sa,na){switch(sa.t.token){case $['(']:{let oa=sa.linenumber;return P.luaX_next(sa),It(sa,na),ve(sa,$[')'],$['('],oa),void I.luaK_dischargevars(sa.fs,na)}case W.TK_NAME:return void Fe(sa,na);default:P.luaX_syntaxerror(sa,N.to_luastring('unexpected symbol',!0));}},Et=function(sa,na){let oa=sa.fs,_a=sa.linenumber;for(Ut(sa,na);;)switch(sa.t.token){case $['.']:{ot(sa,na);break}case $['[']:{let ia=new _e;I.luaK_exp2anyregup(oa,na),_t(sa,ia),I.luaK_indexed(oa,na,ia);break}case $[':']:{let ia=new _e;P.luaX_next(sa),Ne(sa,ia),I.luaK_self(oa,na,ia),xt(sa,na,_a);break}case $['(']:case W.TK_STRING:case $['{']:{I.luaK_exp2nextreg(oa,na),xt(sa,na,_a);break}default:return;}},kt=function(sa,na){switch(sa.t.token){case W.TK_FLT:{be(na,se.VKFLT,0),na.u.nval=sa.t.seminfo.r;break}case W.TK_INT:{be(na,se.VKINT,0),na.u.ival=sa.t.seminfo.i;break}case W.TK_STRING:{Se(sa,na,sa.t.seminfo.ts);break}case W.TK_NIL:{be(na,se.VNIL,0);break}case W.TK_TRUE:{be(na,se.VTRUE,0);break}case W.TK_FALSE:{be(na,se.VFALSE,0);break}case W.TK_DOTS:{let oa=sa.fs;ke(sa,oa.f.is_vararg,N.to_luastring('cannot use \'...\' outside a vararg function',!0)),be(na,se.VVARARG,I.luaK_codeABC(oa,J.OP_VARARG,0,1,0));break}case $['{']:return void At(sa,na);case W.TK_FUNCTION:return P.luaX_next(sa),void ht(sa,na,0,sa.linenumber);default:return void Et(sa,na);}P.luaX_next(sa)},vt=function(sa){return sa===W.TK_NOT?Q.OPR_NOT:sa===$['-']?Q.OPR_MINUS:sa===$['~']?Q.OPR_BNOT:sa===$['#']?Q.OPR_LEN:Q.OPR_NOUNOPR},Rt=function(sa){return sa===$['+']?Y.OPR_ADD:sa===$['-']?Y.OPR_SUB:sa===$['*']?Y.OPR_MUL:sa===$['%']?Y.OPR_MOD:sa===$['^']?Y.OPR_POW:sa===$['/']?Y.OPR_DIV:sa===W.TK_IDIV?Y.OPR_IDIV:sa===$['&']?Y.OPR_BAND:sa===$['|']?Y.OPR_BOR:sa===$['~']?Y.OPR_BXOR:sa===W.TK_SHL?Y.OPR_SHL:sa===W.TK_SHR?Y.OPR_SHR:sa===W.TK_CONCAT?Y.OPR_CONCAT:sa===W.TK_NE?Y.OPR_NE:sa===W.TK_EQ?Y.OPR_EQ:sa===$['<']?Y.OPR_LT:sa===W.TK_LE?Y.OPR_LE:sa===$['>']?Y.OPR_GT:sa===W.TK_GE?Y.OPR_GE:sa===W.TK_AND?Y.OPR_AND:sa===W.TK_OR?Y.OPR_OR:Y.OPR_NOBINOPR},bt=[{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}],Nt=function(sa,na,oa){He(sa);let _a=vt(sa.t.token);if(_a!==Q.OPR_NOUNOPR){let pa=sa.linenumber;P.luaX_next(sa),Nt(sa,na,12),I.luaK_prefix(sa.fs,_a,na,pa)}else kt(sa,na);let ia=Rt(sa.t.token);for(;ia!==Y.OPR_NOBINOPR&&bt[ia].left>oa;){let pa=new _e,ca=sa.linenumber;P.luaX_next(sa),I.luaK_infix(sa.fs,ia,na);let da=Nt(sa,pa,bt[ia].right);I.luaK_posfix(sa.fs,ia,na,pa,ca),ia=da}return je(sa),ia},It=function(sa,na){Nt(sa,na,0)},Ct=function(sa){let na=sa.fs,oa=new ue;Ze(na,oa,0),nt(sa),ut(na)};class Mt{constructor(){this.prev=null,this.v=new _e}}const Pt=function(sa,na,oa){let _a=sa.fs,ia=_a.freereg,pa=!1;for(;na;na=na.prev)na.v.k===se.VINDEXED&&(na.v.u.ind.vt===oa.k&&na.v.u.ind.t===oa.u.info&&(pa=!0,na.v.u.ind.vt=se.VLOCAL,na.v.u.ind.t=ia),oa.k===se.VLOCAL&&na.v.u.ind.idx===oa.u.info&&(pa=!0,na.v.u.ind.idx=ia));if(pa){let ca=oa.k===se.VLOCAL?J.OP_MOVE:J.OP_GETUPVAL;I.luaK_codeABC(_a,ca,ia,oa.u.info,0),I.luaK_reserveregs(_a,1)}},yt=function(sa,na,oa){let _a=new _e;if(ke(sa,ne(na.v.k),N.to_luastring('syntax error',!0)),xe(sa,$[','])){let ia=new Mt;ia.prev=na,Et(sa,ia.v),ia.v.k!==se.VINDEXED&&Pt(sa,na,ia.v),Oe(sa.fs,oa+sa.L.nCcalls,K.LUAI_MAXCCALLS,N.to_luastring('JS levels',!0)),yt(sa,ia,oa+1)}else{Ee(sa,$['=']);let ia=Ot(sa,_a);if(ia!==oa)Xe(sa,oa,ia,_a);else return I.luaK_setoneret(sa.fs,_a),void I.luaK_storevar(sa.fs,na.v,_a)}be(_a,se.VNONRELOC,sa.fs.freereg-1),I.luaK_storevar(sa.fs,na.v,_a)},Dt=function(sa){let na=new _e;return It(sa,na),na.k===se.VNIL&&(na.k=se.VFALSE),I.luaK_goiftrue(sa.fs,na),na.f},Kt=function(sa,na){let oa=sa.linenumber,_a;xe(sa,W.TK_GOTO)?_a=Re(sa):(P.luaX_next(sa),_a=F.luaS_newliteral(sa.L,'break'));let ia=Je(sa,sa.dyd.gt,_a,oa,na);Ye(sa,ia)},Bt=function(sa,na,oa){for(let _a=sa.bl.firstlabel;_a<na.n;_a++)ae(oa,na.arr[_a].name)&&Ae(sa.ls,N.to_luastring(`label '${oa.jsstring()}' already defined on line ${na.arr[_a].line}`))},Vt=function(sa){for(;sa.t.token===$[';']||sa.t.token===W.TK_DBCOLON;)aa(sa)},Gt=function(sa,na,oa){let _a=sa.fs,ia=sa.dyd.label,pa;Bt(_a,ia,na),Ee(sa,W.TK_DBCOLON),pa=Je(sa,ia,na,oa,I.luaK_getlabel(_a)),Vt(sa),st(sa,0)&&(ia.arr[pa].nactvar=_a.bl.nactvar),qe(sa,ia.arr[pa])},wt=function(sa,na){let oa=sa.fs,_a=new ue;P.luaX_next(sa);let ia=I.luaK_getlabel(oa),pa=Dt(sa);Ze(oa,_a,1),Ee(sa,W.TK_DO),Ct(sa),I.luaK_jumpto(oa,ia),ve(sa,W.TK_END,W.TK_WHILE,na),ut(oa),I.luaK_patchtohere(oa,pa)},Ft=function(sa,na){let oa=sa.fs,_a=I.luaK_getlabel(oa),ia=new ue,pa=new ue;Ze(oa,ia,1),Ze(oa,pa,0),P.luaX_next(sa),nt(sa),ve(sa,W.TK_UNTIL,W.TK_REPEAT,na);let ca=Dt(sa);pa.upval&&I.luaK_patchclose(oa,ca,pa.nactvar),ut(oa),I.luaK_patchlist(oa,ca,_a),ut(oa)},Xt=function(sa){let na=new _e;It(sa,na),I.luaK_exp2nextreg(sa.fs,na),E(na.k===se.VNONRELOC);let oa=na.u.info;return oa},Ht=function(sa,na,oa,_a,ia){let pa=new ue,ca=sa.fs,da;ye(sa,3),Ee(sa,W.TK_DO);let La=ia?I.luaK_codeAsBx(ca,J.OP_FORPREP,na,I.NO_JUMP):I.luaK_jump(ca);Ze(ca,pa,0),ye(sa,_a),I.luaK_reserveregs(ca,_a),Ct(sa),ut(ca),I.luaK_patchtohere(ca,La),ia?da=I.luaK_codeAsBx(ca,J.OP_FORLOOP,na,I.NO_JUMP):(I.luaK_codeABC(ca,J.OP_TFORCALL,na,0,_a),I.luaK_fixline(ca,oa),da=I.luaK_codeAsBx(ca,J.OP_TFORLOOP,na+2,I.NO_JUMP)),I.luaK_patchlist(ca,da,La+1),I.luaK_fixline(ca,oa)},jt=function(sa,na,oa){let _a=sa.fs,ia=_a.freereg;Me(sa,'(for index)'),Me(sa,'(for limit)'),Me(sa,'(for step)'),Ce(sa,na),Ee(sa,$['=']),Xt(sa),Ee(sa,$[',']),Xt(sa),xe(sa,$[','])?Xt(sa):(I.luaK_codek(_a,_a.freereg,I.luaK_intK(_a,1)),I.luaK_reserveregs(_a,1)),Ht(sa,ia,oa,1,1)},zt=function(sa,na){let oa=sa.fs,_a=new _e,ia=4,pa=oa.freereg;for(Me(sa,'(for generator)'),Me(sa,'(for state)'),Me(sa,'(for control)'),Ce(sa,na);xe(sa,$[',']);)Ce(sa,Re(sa)),ia++;Ee(sa,W.TK_IN);let ca=sa.linenumber;Xe(sa,3,Ot(sa,_a),_a),I.luaK_checkstack(oa,3),Ht(sa,pa,ca,ia-3,0)},Yt=function(sa,na){let oa=sa.fs,_a=new ue;Ze(oa,_a,1),P.luaX_next(sa);let ia=Re(sa);switch(sa.t.token){case $['=']:jt(sa,ia,na);break;case $[',']:case W.TK_IN:zt(sa,ia);break;default:P.luaX_syntaxerror(sa,N.to_luastring('\'=\' or \'in\' expected',!0));}ve(sa,W.TK_END,W.TK_FOR,na),ut(oa)},Jt=function(sa,na){let oa=new ue,_a=sa.fs,ia=new _e,pa;if(P.luaX_next(sa),It(sa,ia),Ee(sa,W.TK_THEN),sa.t.token===W.TK_GOTO||sa.t.token===W.TK_BREAK){if(I.luaK_goiffalse(sa.fs,ia),Ze(_a,oa,!1),Kt(sa,ia.t),Vt(sa),st(sa,0))return void ut(_a);pa=I.luaK_jump(_a)}else I.luaK_goiftrue(sa.fs,ia),Ze(_a,oa,!1),pa=ia.f;return nt(sa),ut(_a),(sa.t.token===W.TK_ELSE||sa.t.token===W.TK_ELSEIF)&&(na=I.luaK_concat(_a,na,I.luaK_jump(_a))),I.luaK_patchtohere(_a,pa),na},qt=function(sa,na){let oa=sa.fs,_a=I.NO_JUMP;for(_a=Jt(sa,_a);sa.t.token===W.TK_ELSEIF;)_a=Jt(sa,_a);xe(sa,W.TK_ELSE)&&Ct(sa),ve(sa,W.TK_END,W.TK_IF,na),I.luaK_patchtohere(oa,_a)},Wt=function(sa){let na=new _e,oa=sa.fs;Ce(sa,Re(sa)),ye(sa,1),ht(sa,na,0,sa.linenumber),Pe(oa,na.u.info).startpc=oa.pc},Zt=function(sa){let na=0,_a=new _e,oa;do Ce(sa,Re(sa)),na++;while(xe(sa,$[',']));xe(sa,$['='])?oa=Ot(sa,_a):(_a.k=se.VVOID,oa=0),Xe(sa,na,oa,_a),ye(sa,na)},Qt=function(sa,na){let oa=0;for(Fe(sa,na);sa.t.token===$['.'];)ot(sa,na);return sa.t.token===$[':']&&(oa=1,ot(sa,na)),oa},$t=function(sa,na){let oa=new _e,_a=new _e;P.luaX_next(sa);let ia=Qt(sa,oa);ht(sa,_a,ia,na),I.luaK_storevar(sa.fs,oa,_a),I.luaK_fixline(sa.fs,na)},ea=function(sa){let na=sa.fs,oa=new Mt;Et(sa,oa.v),sa.t.token===$['=']||sa.t.token===$[',']?(oa.prev=null,yt(sa,oa,1)):(ke(sa,oa.v.k===se.VCALL,N.to_luastring('syntax error',!0)),G.SETARG_C(I.getinstruction(na,oa.v),1))},ta=function(sa){let na=sa.fs,oa=new _e,_a,ia;st(sa,1)||sa.t.token===$[';']?_a=ia=0:(ia=Ot(sa,oa),te(oa.k)?(I.luaK_setmultret(na,oa),oa.k===se.VCALL&&1===ia&&(G.SET_OPCODE(I.getinstruction(na,oa),J.OP_TAILCALL),E(I.getinstruction(na,oa).A===na.nactvar)),_a=na.nactvar,ia=N.LUA_MULTRET):1===ia?_a=I.luaK_exp2anyreg(na,oa):(I.luaK_exp2nextreg(na,oa),_a=na.nactvar,E(ia==na.freereg-_a))),I.luaK_ret(na,_a,ia),xe(sa,$[';'])},aa=function(sa){let na=sa.linenumber;switch(He(sa),sa.t.token){case $[';']:{P.luaX_next(sa);break}case W.TK_IF:{qt(sa,na);break}case W.TK_WHILE:{wt(sa,na);break}case W.TK_DO:{P.luaX_next(sa),Ct(sa),ve(sa,W.TK_END,W.TK_DO,na);break}case W.TK_FOR:{Yt(sa,na);break}case W.TK_REPEAT:{Ft(sa,na);break}case W.TK_FUNCTION:{$t(sa,na);break}case W.TK_LOCAL:{P.luaX_next(sa),xe(sa,W.TK_FUNCTION)?Wt(sa):Zt(sa);break}case W.TK_DBCOLON:{P.luaX_next(sa),Gt(sa,Re(sa),na);break}case W.TK_RETURN:{P.luaX_next(sa),ta(sa);break}case W.TK_BREAK:case W.TK_GOTO:{Kt(sa,I.luaK_jump(sa.fs));break}default:{ea(sa);break}}E(sa.fs.f.maxstacksize>=sa.fs.freereg&&sa.fs.freereg>=sa.fs.nactvar),sa.fs.freereg=sa.fs.nactvar,je(sa)},la=function(sa,na){let oa=new ue,_a=new _e;lt(sa,na,oa),na.f.is_vararg=!0,be(_a,se.VLOCAL,0),Be(na,sa.envn,_a),P.luaX_next(sa),nt(sa),Ue(sa,W.TK_EOS),rt(sa)};T.exports.Dyndata=class{constructor(){this.actvar={arr:[],n:NaN,size:NaN},this.gt=new Le,this.label=new Le}},T.exports.expkind=se,T.exports.expdesc=_e,T.exports.luaY_parser=function(sa,na,oa,_a,ia,pa){let ca=new P.LexState,da=new pe,La=M.luaF_newLclosure(sa,1);return sa.stack[sa.top++]=new Z(N.CT.LUA_TLCL,La),ca.h=H.luaH_new(sa),sa.stack[sa.top++]=ca.h,da.f=La.p=new q(sa),da.f.source=F.luaS_new(sa,ia),ca.buff=oa,ca.dyd=_a,_a.actvar.n=_a.gt.n=_a.label.n=0,P.luaX_setinput(sa,ca,na,da.f.source,pa),la(ca,da),E(!da.prev&&1===da.nups&&!ca.fs),E(0===_a.actvar.n&&0===_a.gt.n&&0===_a.label.n),sa.top--,La},T.exports.vkisinreg=function(sa){return sa===se.VNONRELOC||sa===se.VLOCAL}},function(T,O,U){'use strict';const E=U(0),N=U(41).sprintf,I=U(6),M=U(2),P=U(12),K=U(4),V='%',G=V.charCodeAt(0),H=2147483647,Y=function(Gt){let wt=Gt.indexOf(0);return-1<wt?wt:Gt.length},J=function(Gt,wt){return 0<=Gt?Gt:0-Gt>wt?0:wt+Gt+1},Q=function(Gt,wt,Ft,Xt){return E(Array.isArray(wt)),Xt.push(...wt.slice(0,Ft)),0},ee=P.LUA_NUMBER_FRMLEN.length+1,te=1,ae=function(Gt,wt,Ft){let Xt=_Mathfloor(Ft);return Gt[wt]=10>Xt?Xt+'0'.charCodeAt(0):Xt-10+'a'.charCodeAt(0),Ft-Xt},ue=function(Gt){let wt=[];if(Object.is(Gt,Infinity))return M.to_luastring('inf',!0);if(Object.is(Gt,-Infinity))return M.to_luastring('-inf',!0);if(_NumberisNaN(Gt))return M.to_luastring('nan',!0);if(0===Gt){let Ft=N(P.LUA_NUMBER_FMT+'x0p+0',Gt).split('').map((Xt)=>Xt.charCodeAt(0));return Object.is(Gt,-0)?['-'.charCodeAt(0)].concat(Ft):Ft}let Ft=P.frexp(Gt),Xt=Ft[0],Ht=Ft[1],jt=0;if(0>Xt&&(wt[jt++]='-'.charCodeAt(0),Xt=-Xt),wt[jt++]='0'.charCodeAt(0),wt[jt++]='x'.charCodeAt(0),Xt=ae(wt,jt++,Xt*(1<<te)),Ht-=te,0<Xt){wt[jt++]=P.lua_getlocaledecpoint().charCodeAt(0);do Xt=ae(wt,jt++,16*Xt);while(0<Xt)}let zt=N('p%+d',Ht).split('').map((Yt)=>Yt.charCodeAt(0));return wt.slice(0,jt+1).concat(zt).concat(wt.slice(jt))},se=function(Gt,wt,Ft){let Xt=ue(Ft);if(wt[ee]==='A'.charCodeAt(0))for(let Ht=0;Ht<Xt.length;Ht++)Xt[Ht]=_StringfromCharCode(Xt[Ht]).toUpperCase().charCodeAt(0);else wt[ee]!=='a'.charCodeAt(0)&&I.luaL_error(Gt,M.to_luastring('modifiers for format \'%%a\'/\'%%A\' not implemented'));return Xt},oe=['-'.charCodeAt(0),'+'.charCodeAt(0),' '.charCodeAt(0),'#'.charCodeAt(0),'0'.charCodeAt(0)],pe=(Gt)=>'a'.charCodeAt(0)<=Gt&&Gt<='z'.charCodeAt(0)||Gt>='A'.charCodeAt(0)&&Gt<='Z'.charCodeAt(0),ce=(Gt)=>'0'.charCodeAt(0)<=Gt&&Gt<='9'.charCodeAt(0),de=(Gt)=>0<=Gt&&31>=Gt||127===Gt,Le=(Gt)=>32<Gt&&127>Gt,ge=(Gt)=>/^(?![A-Z]).*$/.test(_StringfromCharCode(Gt)),Ae=(Gt)=>/^(?![a-z]).*$/.test(_StringfromCharCode(Gt)),Te=(Gt)=>/^[a-zA-Z0-9]$/.test(_StringfromCharCode(Gt)),he=(Gt)=>Le(Gt)&&!Te(Gt),Oe=(Gt)=>/^\s$/.test(_StringfromCharCode(Gt)),xe=(Gt)=>/^[0-9A-Fa-f]$/.test(_StringfromCharCode(Gt)),Ue=function(Gt,wt){for(let Ft=0;Ft<wt.length;Ft++)Gt.push(wt[Ft])},Ee=function(Gt,wt){Gt.push('"'.charCodeAt(0));for(let Ft=wt.length;Ft--;){if(wt[0]==='"'.charCodeAt(0)||wt[0]==='\\'.charCodeAt(0)||wt[0]==='\n'.charCodeAt(0))Gt.push('\\'.charCodeAt(0)),Gt.push(wt[0]);else if(de(wt[0])){let Xt=[];Xt=ce(wt[1])?M.to_luastring(N('\\%03d',wt[0])):M.to_luastring(N('\\%d',wt[0])),Ue(Gt,Xt)}else Gt.push(wt[0]);wt=wt.slice(1)}Gt.push('"'.charCodeAt(0))},ke=function(Gt){if(0>Gt.indexOf('.'.charCodeAt(0))){let wt=P.lua_getlocaledecpoint().charCodeAt(0),Ft=Gt.indexOf(wt);Ft&&(Gt[Ft]='.')}},ve=function(Gt,wt,Ft){switch(M.lua_type(Gt,Ft)){case M.LUA_TSTRING:{let Xt=M.lua_tostring(Gt,Ft);Ee(wt,Xt,Xt.length);break}case M.LUA_TNUMBER:{if(!M.lua_isinteger(Gt,Ft)){let Xt=M.lua_tonumber(Gt,Ft);Ue(wt,se(Gt,M.to_luastring(`%${P.LUA_INTEGER_FRMLEN}a`),Xt)),ke(wt)}else{let Xt=M.lua_tointeger(Gt,Ft);Ue(wt,M.to_luastring(N('%d',Xt)))}break}case M.LUA_TNIL:case M.LUA_TBOOLEAN:{Ue(wt,I.luaL_tolstring(Gt,Ft));break}default:I.luaL_argerror(Gt,Ft,M.to_luastring('value has no literal form',!0));}},Re=function(Gt,wt,Ft){let Xt=wt;for(;0!==Xt[0]&&0<=oe.indexOf(Xt[0]);)Xt=Xt.slice(1);wt.length-Xt.length>=oe.length&&I.luaL_error(Gt,M.to_luastring('invalid format (repeated flags)',!0)),ce(Xt[0])&&(Xt=Xt.slice(1)),ce(Xt[0])&&(Xt=Xt.slice(1)),Xt[0]==='.'.charCodeAt(0)&&(Xt=Xt.slice(1),ce(Xt[0])&&(Xt=Xt.slice(1)),ce(Xt[0])&&(Xt=Xt.slice(1))),ce(Xt[0])&&I.luaL_error(Gt,M.to_luastring('invalid format (width or precision too long)',!0)),Ft[0]='%'.charCodeAt(0);for(let Ht=0;Ht<wt.length-Xt.length+1;Ht++)Ft[Ht+1]=wt[Ht];return{form:Ft,p:Xt}},be=function(Gt,wt){let Ft=Gt.length,Xt=wt.length,Ht=Gt[Ft-1];for(let jt=0;jt<wt.length;jt++)Gt[jt+Ft-1]=wt[jt];return Gt[Ft+Xt-1]=Ht,Gt},Ne=0,Ie=16,Ce=4,Me=8,Pe=(1<<Me)-1;class De{constructor(Gt){this.L=Gt,this.islittle=!0,this.maxalign=1}}const Ke={Kint:0,Kuint:1,Kfloat:2,Kchar:3,Kstring:4,Kzstr:5,Kpadding:6,Kpaddalign:7,Knop:8},Be=function(Gt){return'0'.charCodeAt(0)<=Gt&&Gt<='9'.charCodeAt(0)},Ve=function(Gt,wt){if(Gt.off>=Gt.s.length||!Be(Gt.s[Gt.off]))return wt;let Ft=0;do Ft=10*Ft+(Gt.s[Gt.off++]-'0'.charCodeAt(0));while(Gt.off<Gt.s.length&&Be(Gt.s[Gt.off])&&Ft<=(H-9)/10);return Ft},Ge=function(Gt,wt,Ft){let Xt=Ve(wt,Ft);return(Xt>Ie||0>=Xt)&&I.luaL_error(Gt.L,M.to_luastring('integral size (%d) out of limits [1,%d]'),Xt,Ie),Xt},we=function(Gt,wt){let Ft={opt:NaN,size:NaN,opt:wt.s[wt.off++],size:0};switch(Ft.opt){case'b'.charCodeAt(0):return Ft.size=1,Ft.opt=Ke.Kint,Ft;case'B'.charCodeAt(0):return Ft.size=1,Ft.opt=Ke.Kuint,Ft;case'h'.charCodeAt(0):return Ft.size=2,Ft.opt=Ke.Kint,Ft;case'H'.charCodeAt(0):return Ft.size=2,Ft.opt=Ke.Kuint,Ft;case'l'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kint,Ft;case'L'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kuint,Ft;case'j'.charCodeAt(0):return Ft.size=4,Ft.opt=Ke.Kint,Ft;case'J'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kuint,Ft;case'T'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kuint,Ft;case'f'.charCodeAt(0):return Ft.size=4,Ft.opt=Ke.Kfloat,Ft;case'd'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kfloat,Ft;case'n'.charCodeAt(0):return Ft.size=8,Ft.opt=Ke.Kfloat,Ft;case'i'.charCodeAt(0):return Ft.size=Ge(Gt,wt,4),Ft.opt=Ke.Kint,Ft;case'I'.charCodeAt(0):return Ft.size=Ge(Gt,wt,4),Ft.opt=Ke.Kuint,Ft;case's'.charCodeAt(0):return Ft.size=Ge(Gt,wt,8),Ft.opt=Ke.Kstring,Ft;case'c'.charCodeAt(0):return Ft.size=Ve(wt,-1),-1===Ft.size&&I.luaL_error(Gt.L,M.to_luastring('missing size for format option \'c\'')),Ft.opt=Ke.Kchar,Ft;case'z'.charCodeAt(0):return Ft.opt=Ke.Kzstr,Ft;case'x'.charCodeAt(0):return Ft.size=1,Ft.opt=Ke.Kpadding,Ft;case'X'.charCodeAt(0):return Ft.opt=Ke.Kpaddalign,Ft;case' '.charCodeAt(0):break;case'<'.charCodeAt(0):Gt.islittle=!0;break;case'>'.charCodeAt(0):Gt.islittle=!1;break;case'='.charCodeAt(0):Gt.islittle=!0;break;case'!'.charCodeAt(0):Gt.maxalign=Ge(Gt,wt,8);break;default:I.luaL_error(Gt.L,M.to_luastring('invalid format option \'%c\''),Ft.opt);}return Ft.opt=Ke.Knop,Ft},Fe=function(Gt,wt,Ft){let Xt={opt:NaN,size:NaN,ntoalign:NaN},Ht=we(Gt,Ft);Xt.size=Ht.size,Xt.opt=Ht.opt;let jt=Xt.size;if(Xt.opt===Ke.Kpaddalign)if(Ft.off>=Ft.s.length||0===Ft.s[Ft.off])I.luaL_argerror(Gt.L,1,M.to_luastring('invalid next option for option \'X\'',!0));else{let zt=we(Gt,Ft);jt=zt.size,zt=zt.opt,(zt===Ke.Kchar||0===jt)&&I.luaL_argerror(Gt.L,1,M.to_luastring('invalid next option for option \'X\'',!0))}return 1>=jt||Xt.opt===Ke.Kchar?Xt.ntoalign=0:(jt>Gt.maxalign&&(jt=Gt.maxalign),0!=(jt&jt-1)&&I.luaL_argerror(Gt.L,1,M.to_luastring('format asks for alignment not power of 2',!0)),Xt.ntoalign=jt-(wt&jt-1)&jt-1),Xt},Xe=function(Gt,wt,Ft,Xt,Ht){let jt=Array(Xt);jt[Ft?0:Xt-1]=wt&Pe;for(let zt=1;zt<Xt;zt++)wt>>=Me,jt[Ft?zt:Xt-1-zt]=wt&Pe;if(Ht&&Xt>Ce)for(let zt=Ce;zt<Xt;zt++)jt[Ft?zt:Xt-1-zt]=Pe;Gt.push(...jt)},He=function(Gt,wt,Ft,Xt){let Ht=new DataView(new ArrayBuffer(Xt));Ht.setFloat64(0,wt,Ft);for(let jt=0;8>jt;jt++)Gt.push(Ht.getUint8(jt,Ft))},Qe=function(Gt,wt,Ft,Xt,Ht){let jt=0,zt=Xt<=Ce?Xt:Ce;for(let Yt=zt-1;0<=Yt;Yt--)jt<<=Me,jt|=wt[Ft?Yt:Xt-1-Yt];if(Xt<Ce){if(Ht){let Yt=1<<Xt*Me-1;jt=(jt^Yt)-Yt}}else if(Xt>Ce){let Yt=Ht||0<=jt?0:Pe;for(let Jt=zt;Jt<Xt;Jt++)wt[Ft?Jt:Xt-1-Jt]!==Yt&&I.luaL_error(Gt,M.to_luastring('%d-byte integer does not fit into Lua Integer'),Xt)}return jt},$e=function(Gt,wt,Ft,Xt){E(wt.length>=Xt);let Ht=new DataView(new ArrayBuffer(Xt));return wt.forEach((jt,zt)=>Ht.setUint8(zt,jt,Ft)),Ht.getFloat64(0,Ft)},at=-1,lt=-2,ut=200,rt=['^'.charCodeAt(0),'$'.charCodeAt(0),'*'.charCodeAt(0),'+'.charCodeAt(0),'?'.charCodeAt(0),'.'.charCodeAt(0),'('.charCodeAt(0),'['.charCodeAt(0),'%'.charCodeAt(0),'-'.charCodeAt(0)];class st{constructor(Gt){this.src=null,this.src_init=null,this.src_end=null,this.p=null,this.p_end=null,this.L=Gt,this.matchdepth=NaN,this.level=NaN,this.capture=[]}}const nt=function(Gt,wt){return wt-='1'.charCodeAt(0),0>wt||wt>=Gt.level||Gt.capture[wt].len===at?I.luaL_error(Gt.L,M.to_luastring('invalid capture index %%%d'),wt+1):wt},ot=function(Gt){let wt=Gt.level;for(wt--;0<=wt;wt--)if(Gt.capture[wt].len===at)return wt;return I.luaL_error(Gt.L,M.to_luastring('invalid pattern capture'))},_t=function(Gt,wt){switch(Gt.p[wt++]){case G:return wt===Gt.p_end&&I.luaL_error(Gt.L,M.to_luastring('malformed pattern (ends with \'%%\')')),wt+1;case'['.charCodeAt(0):{Gt.p[wt]==='^'.charCodeAt(0)&&wt++;do wt===Gt.p_end&&I.luaL_error(Gt.L,M.to_luastring('malformed pattern (missing \']\')')),Gt.p[wt++]===G&&wt<Gt.p_end&&wt++;while(Gt.p[wt]!==']'.charCodeAt(0));return wt+1}default:return wt;}},it=function(Gt,wt){let Ft;switch(_StringfromCharCode(wt).toLowerCase().charCodeAt(0)){case'a'.charCodeAt(0):Ft=pe(Gt);break;case'c'.charCodeAt(0):Ft=de(Gt);break;case'd'.charCodeAt(0):Ft=ce(Gt);break;case'g'.charCodeAt(0):Ft=Le(Gt);break;case'l'.charCodeAt(0):Ft=ge(Gt);break;case'p'.charCodeAt(0):Ft=he(Gt);break;case's'.charCodeAt(0):Ft=Oe(Gt);break;case'u'.charCodeAt(0):Ft=Ae(Gt);break;case'w'.charCodeAt(0):Ft=Te(Gt);break;case'x'.charCodeAt(0):Ft=xe(Gt);break;case'z'.charCodeAt(0):Ft=0===Gt;break;default:return wt===Gt;}return ge(wt)?Ft:!Ft},pt=function(Gt,wt,Ft,Xt){let Ht=!0;for(Gt.p[Ft+1]==='^'.charCodeAt(0)&&(Ht=!1,Ft++);++Ft<Xt;)if(Gt.p[Ft]===G){if(Ft++,it(wt,Gt.p[Ft]))return Ht;}else if(Gt.p[Ft+1]==='-'.charCodeAt(0)&&Ft+2<Xt){if(Ft+=2,Gt.p[Ft-2]<=wt&&wt<=Gt.p[Ft])return Ht;}else if(Gt.p[Ft]===wt)return Ht;return!Ht},ct=function(Gt,wt,Ft,Xt){if(wt>=Gt.src_end)return!1;let Ht=Gt.src[wt];switch(Gt.p[Ft]){case'.'.charCodeAt(0):return!0;case G:return it(Ht,Gt.p[Ft+1]);case'['.charCodeAt(0):return pt(Gt,Ht,Ft,Xt-1);default:return Gt.p[Ft]===Ht;}},dt=function(Gt,wt,Ft){if(Ft>=Gt.p_end-1&&I.luaL_error(Gt.L,M.to_luastring('malformed pattern (missing arguments to \'%%b\'')),Gt.src[wt]!==Gt.p[Ft])return null;for(let Xt=Gt.p[Ft],Ht=Gt.p[Ft+1],jt=1;++wt<Gt.src_end;)if(Gt.src[wt]!==Ht)wt===Xt&&jt++;else if(0==--jt)return wt+1;return null},Lt=function(Gt,wt,Ft,Xt){let Ht=0;for(;ct(Gt,wt+Ht,Ft,Xt);)Ht++;for(;0<=Ht;){let jt=Ot(Gt,wt+Ht,Xt+1);if(jt)return jt;Ht--}return null},ft=function(Gt,wt,Ft,Xt){for(;;){let Ht=Ot(Gt,wt,Xt+1);if(null!==Ht)return Ht;if(ct(Gt,wt,Ft,Xt))wt++;else return null}},At=function(Gt,wt,Ft,Xt){let Ht=Gt.level;32<=Ht&&I.luaL_error(Gt.L,M.to_luastring('too many captures',!0)),Gt.capture[Ht]=Gt.capture[Ht]?Gt.capture[Ht]:{},Gt.capture[Ht].init=wt,Gt.capture[Ht].len=Xt,Gt.level=Ht+1;let jt;return null===(jt=Ot(Gt,wt,Ft))&&Gt.level--,jt},Tt=function(Gt,wt,Ft){let Xt=ot(Gt);Gt.capture[Xt].len=wt-Gt.capture[Xt].init;let Ht;return null===(Ht=Ot(Gt,wt,Ft))&&(Gt.capture[Xt].len=at),Ht},ht=function(Gt,wt,Ft){Ft=nt(Gt,Ft);let Xt=Gt.capture[Ft].len;return Gt.src_end>=Xt&&Gt.src.slice(Gt.capture[Ft].init,Gt.capture[Ft].init+Xt)===Gt.src.slice(wt,wt+Xt)?wt+Xt:null},Ot=function(Gt,wt,Ft){let Xt=!1,Ht=!0;for(0==Gt.matchdepth--&&I.luaL_error(Gt.L,M.to_luastring('pattern too complex',!0));Ht||Xt;)if(Ht=!1,Ft!==Gt.p_end)switch(Xt?'x'.charCodeAt(0):Gt.p[Ft]){case'('.charCodeAt(0):{wt=Gt.p[Ft+1]===')'.charCodeAt(0)?At(Gt,wt,Ft+2,lt):At(Gt,wt,Ft+1,at);break}case')'.charCodeAt(0):{wt=Tt(Gt,wt,Ft+1);break}case'$'.charCodeAt(0):{if(Ft+1!==Gt.p_end){Xt=!0;break}wt=0===Gt.src.slice(wt).length?wt:null;break}case G:{switch(Gt.p[Ft+1]){case'b'.charCodeAt(0):{wt=dt(Gt,wt,Ft+2),null!==wt&&(Ft=Ft.slice(4),Ht=!0);break}case'f'.charCodeAt(0):{Ft+=2,'['!==Gt.p[Ft]&&I.luaL_error(Gt.L,M.to_luastring('missing \'[\' after \'%%f\' in pattern'));let jt=_t(Gt,Ft),zt=wt===Gt.src_init?0:Gt.s[wt-1];if(!pt(Gt,zt,Ft,jt-1)&&pt(Gt,Gt.src[wt],Ft,jt-1)){Ft=jt,Ht=!0;break}wt=null;break}case'0'.charCodeAt(0):case'1'.charCodeAt(0):case'2'.charCodeAt(0):case'3'.charCodeAt(0):case'4'.charCodeAt(0):case'5'.charCodeAt(0):case'6'.charCodeAt(0):case'7'.charCodeAt(0):case'8'.charCodeAt(0):case'9'.charCodeAt(0):{wt=ht(Gt,wt,Gt.p[Ft+1]),null!==wt&&(Ft+=2,Ht=!0);break}default:Xt=!0;}break}default:{Xt=!1;let jt=_t(Gt,Ft);if(!!ct(Gt,wt,Ft,jt))switch(Gt.p[jt]){case'?'.charCodeAt(0):{let zt;null===(zt=Ot(Gt,wt+1,jt+1))?(Ft=jt+1,Ht=!0):wt=zt;break}case'+'.charCodeAt(0):wt++;case'*'.charCodeAt(0):wt=Lt(Gt,wt,Ft,jt);break;case'-'.charCodeAt(0):wt=ft(Gt,wt,Ft,jt);break;default:wt++,Ft=jt,Ht=!0;}else if(Gt.p[jt]==='*'.charCodeAt(0)||Gt.p[jt]==='?'.charCodeAt(0)||Gt.p[jt]==='-'.charCodeAt(0)){Ft=jt+1,Ht=!0;break}else wt=null;break}}return Gt.matchdepth++,wt},xt=function(Gt,wt,Ft,Xt){if(wt>=Gt.level)0===wt?M.lua_pushlstring(Gt.L,Gt.src.slice(Ft),Xt-Ft):I.luaL_error(Gt.L,M.to_luastring(`invalid capture index %${wt+1}`));else{let Ht=Gt.capture[wt].len;Ht===at&&I.luaL_error(Gt.L,M.to_luastring('unfinished capture',!0)),Ht===lt?M.lua_pushinteger(Gt.L,Gt.src_init+1):M.lua_pushlstring(Gt.L,Gt.src.slice(Gt.capture[wt].init),Ht)}},Ut=function(Gt,wt,Ft){let Xt=0===Gt.level&&Gt.src.slice(wt)?1:Gt.level;I.luaL_checkstack(Gt.L,Xt,M.to_luastring('too many catpures',!0));for(let Ht=0;Ht<Xt;Ht++)xt(Gt,Ht,wt,Ft);return Xt},Et=function(Gt,wt){let Ft=0;do{let Xt=!1,Ht=Gt.slice(Ft);for(let jt=0;jt<rt.length;jt++)if(-1<Ht.indexOf(rt[jt])){Xt=!0;break}if(Xt)return!1;++Ft}while(Ft<=wt);return!0},kt=function(Gt,wt,Ft,Xt,Ht,jt){Gt.L=wt,Gt.matchdepth=ut,Gt.src=Ft,Gt.src_init=0,Gt.src_end=Xt,Gt.p=Ht,Gt.p_end=jt},vt=function(Gt){Gt.level=0,E(Gt.matchdepth===ut)},Rt=function(Gt,wt,Ft){var Xt=Ft>>>0,Ht=wt.length,jt=Gt.length+1-Ht;loop:for(;Xt<jt;Xt++){for(let zt=0;zt<Ht;zt++)if(Gt[Xt+zt]!==wt[zt])continue loop;return Xt}return-1},bt=function(Gt,wt){let Ft=I.luaL_checkstring(Gt,1),Xt=I.luaL_checkstring(Gt,2),Ht=Ft.length,jt=Xt.length,zt=J(I.luaL_optinteger(Gt,3,1),Ht);if(1>zt)zt=1;else if(zt>Ht+1)return M.lua_pushnil(Gt),1;if(wt&&(M.lua_toboolean(Gt,4)||Et(Xt,jt))){let Yt=Rt(Ft.slice(zt-1),Xt,0);if(-1<Yt)return M.lua_pushinteger(Gt,zt+Yt),M.lua_pushinteger(Gt,zt+Yt+jt-1),2}else{let Yt=new st(Gt),Jt=zt-1,qt=Xt[0]==='^'.charCodeAt(0);qt&&(Xt=Xt.slice(1),jt--),kt(Yt,Gt,Ft,Ht,Xt,jt);do{let Wt;if(vt(Yt),null!==(Wt=Ot(Yt,Jt,0)))return wt?(M.lua_pushinteger(Gt,Jt+1),M.lua_pushinteger(Gt,Wt),Ut(Yt,null,0)+2):Ut(Yt,Jt,Wt)}while(Jt++<Yt.src_end&&!qt)}return M.lua_pushnil(Gt),1};class It{constructor(){this.src=NaN,this.p=NaN,this.lastmatch=NaN,this.ms=new st}}const Ct=function(Gt){let wt=M.lua_touserdata(Gt,M.lua_upvalueindex(3));wt.ms.L=Gt;for(let Ft=wt.src;Ft<wt.ms.src_end;Ft++){vt(wt.ms);let Xt;if(null!==(Xt=Ot(wt.ms,Ft,wt.p))&&Xt!==wt.lastmatch)return wt.src=wt.lastmatch=Xt,Ut(wt.ms,Ft,Xt)}return 0},Pt=function(Gt,wt,Ft,Xt){let Ht=Gt.L,jt=M.lua_tostring(Ht,3),zt=jt.length;for(let Yt=0;Yt<zt;Yt++)jt[Yt]===G?(Yt++,ce(jt[Yt])?jt[Yt]==='0'.charCodeAt(0)?I.luaL_addlstring(wt,Gt.src.slice(Ft),Xt-Ft):(xt(Gt,jt[Yt]-'1'.charCodeAt(0),Ft,Xt),I.luaL_tolstring(Ht,-1),M.lua_remove(Ht,-2),I.luaL_addvalue(wt)):(jt[Yt]!==G&&I.luaL_error(Ht,M.to_luastring('invalid use of \'%c\' in replacement string'),V),I.luaL_addchar(wt,jt[Yt]))):I.luaL_addchar(wt,jt[Yt])},yt=function(Gt,wt,Ft,Xt,Ht){let jt=Gt.L;switch(Ht){case M.LUA_TFUNCTION:{M.lua_pushvalue(jt,3);let zt=Ut(Gt,Ft,Xt);M.lua_call(jt,zt,1);break}case M.LUA_TTABLE:{xt(Gt,0,Ft,Xt),M.lua_gettable(jt,3);break}default:return void Pt(Gt,wt,Ft,Xt);}M.lua_toboolean(jt,-1)?!M.lua_isstring(jt,-1)&&I.luaL_error(jt,M.to_luastring('invalid replacement value (a %s)'),I.luaL_typename(jt,-1)):(M.lua_pop(jt,1),M.lua_pushlstring(jt,Ft,Xt-Ft)),I.luaL_addvalue(wt)},Kt={byte:function(Gt){let wt=I.luaL_checkstring(Gt,1),Ft=wt.length,Xt=J(I.luaL_optinteger(Gt,2,1),Ft),Ht=J(I.luaL_optinteger(Gt,3,Xt),Ft);if(1>Xt&&(Xt=1),Ht>Ft&&(Ht=Ft),Xt>Ht)return 0;if(Ht-Xt>=K.MAX_INT)return I.luaL_error(Gt,M.to_luastring('string slice too long',!0));let jt=Ht-Xt+1;I.luaL_checkstack(Gt,jt,M.to_luastring('string slice too long',!0));for(let zt=0;zt<jt;zt++)M.lua_pushinteger(Gt,wt[Xt+zt-1]);return jt},char:function(Gt){let wt=M.lua_gettop(Gt),Ft=[];for(let Xt=1,Ht;Xt<=wt;Xt++)Ht=I.luaL_checkinteger(Gt,Xt),I.luaL_argcheck(Gt,0<=Ht&&255>=Ht,'value out of range'),Ft.push(Ht);return M.lua_pushstring(Gt,Ft),1},dump:function(Gt){let wt=[],Ft=M.lua_toboolean(Gt,2);return(I.luaL_checktype(Gt,1,M.LUA_TFUNCTION),M.lua_settop(Gt,1),0!==M.lua_dump(Gt,Q,wt,Ft))?I.luaL_error(Gt,M.to_luastring('unable to dump given function')):(M.lua_pushstring(Gt,wt),1)},find:function(Gt){return bt(Gt,1)},format:function(Gt){let wt=M.lua_gettop(Gt),Ft=1,Xt=I.luaL_checkstring(Gt,Ft),Ht=[];for(;0<Xt.length;)if(Xt[0]!==G)Ht.push(Xt[0]),Xt=Xt.slice(1);else if((Xt=Xt.slice(1))[0]===G)Ht.push(Xt[0]),Xt=Xt.slice(1);else{let jt=[];++Ft>wt&&I.luaL_argerror(Gt,Ft,M.to_luastring('no value',!0));let zt=Re(Gt,Xt,jt);switch(Xt=zt.p,jt=zt.form,_StringfromCharCode(Xt[0])){case'c':{Xt=Xt.slice(1),Ht.push(I.luaL_checkinteger(Gt,Ft));break}case'd':case'i':case'o':case'u':case'x':case'X':{Xt=Xt.slice(1);let Yt=I.luaL_checkinteger(Gt,Ft);jt=be(jt,P.LUA_INTEGER_FRMLEN.split('').map((Jt)=>Jt.charCodeAt(0))),Ue(Ht,M.to_luastring(N(_StringfromCharCode(...jt),Yt)));break}case'a':case'A':{Xt=Xt.slice(1),jt=be(jt,P.LUA_INTEGER_FRMLEN.split('').map((Yt)=>Yt.charCodeAt(0))),Ue(Ht,se(Gt,jt,I.luaL_checknumber(Gt,Ft)));break}case'e':case'E':case'f':case'g':case'G':{Xt=Xt.slice(1);let Yt=I.luaL_checknumber(Gt,Ft);jt=be(jt,P.LUA_INTEGER_FRMLEN.split('').map((Jt)=>Jt.charCodeAt(0))),Ue(Ht,M.to_luastring(N(_StringfromCharCode(...jt),Yt)));break}case'q':{Xt=Xt.slice(1),ve(Gt,Ht,Ft);break}case's':{Xt=Xt.slice(1);let Yt=I.luaL_tolstring(Gt,Ft);2>=jt.length||0===jt[2]?(Ue(Ht,Yt),M.lua_pop(Gt,1)):(I.luaL_argcheck(Gt,Yt.length===Y(Yt),Ft,M.to_luastring('string contains zeros',!0)),0>jt.indexOf('.'.charCodeAt(0))&&100<=Yt.length?(Ue(Ht,Yt),M.lua_pop(Gt,1)):(Ue(Ht,M.to_luastring(N(_StringfromCharCode(...jt),M.to_jsstring(Yt)))),M.lua_pop(Gt,1)));break}default:return I.luaL_error(Gt,M.to_luastring('invalid option \'%%%c\' to \'format\''),Xt[0]);}}return M.lua_pushstring(Gt,Ht),1},gmatch:function(Gt){let wt=I.luaL_checkstring(Gt,1),Ft=I.luaL_checkstring(Gt,2),Xt=wt.length,Ht=Ft.length;M.lua_settop(Gt,2);let jt=new It;return M.lua_pushlightuserdata(Gt,jt),kt(jt.ms,Gt,wt,Xt,Ft,Ht),jt.src=0,jt.p=0,jt.lastmatch=null,M.lua_pushcclosure(Gt,Ct,3),1},gsub:function(Gt){let wt=I.luaL_checkstring(Gt,1),Ft=wt.length,Xt=I.luaL_checkstring(Gt,2),Ht=Xt.length,jt=null,zt=M.lua_type(Gt,3),Yt=I.luaL_optinteger(Gt,4,Ft+1),Jt=Xt[0]==='^'.charCodeAt(0),qt=0,Wt=new st(Gt),Zt=new I.luaL_Buffer;for(I.luaL_argcheck(Gt,zt===M.LUA_TNUMBER||zt===M.LUA_TSTRING||zt===M.LUA_TFUNCTION||zt===M.LUA_TTABLE,3,M.to_luastring('string/function/table expected',!0)),I.luaL_buffinit(Gt,Zt),Jt&&(Xt=Xt.slice(1),Ht--),kt(Wt,Gt,wt,Ft,Xt,Ht),wt=0,Xt=0;qt<Yt;){let Qt;if(vt(Wt),null!==(Qt=Ot(Wt,wt,Xt))&&Qt!==jt)qt++,yt(Wt,Zt,wt,Qt,zt),wt=jt=Qt;else if(wt<Wt.src_end)I.luaL_addchar(Zt,Wt.src[wt++]);else break;if(Jt)break}return I.luaL_addlstring(Zt,Wt.src.slice(wt),Wt.src_end-wt),I.luaL_pushresult(Zt),M.lua_pushinteger(Gt,qt),2},len:function(Gt){return M.lua_pushinteger(Gt,I.luaL_checkstring(Gt,1).length),1},lower:function(Gt){return M.lua_pushstring(Gt,M.to_luastring(M.to_jsstring(I.luaL_checkstring(Gt,1)).toLowerCase())),1},match:function(Gt){return bt(Gt,0)},pack:function(Gt){let wt=[],Ft=new De(Gt),Xt={s:I.luaL_checkstring(Gt,1),off:0},Ht=1,jt=0;for(M.lua_pushnil(Gt);Xt.off<Xt.s.length;){let zt=Fe(Ft,jt,Xt),Yt=zt.opt,Jt=zt.size,qt=zt.ntoalign;for(jt+=qt+Jt;0<qt--;)wt.push(Ne);switch(Ht++,Yt){case Ke.Kint:{let Wt=I.luaL_checkinteger(Gt,Ht);if(Jt<Ce){let Zt=1<<8*Jt-1;I.luaL_argcheck(Gt,-Zt<=Wt&&Wt<Zt,Ht,M.to_luastring('integer overflow',!0))}Xe(wt,Wt,Ft.islittle,Jt,0>Wt);break}case Ke.Kuint:{let Wt=I.luaL_checkinteger(Gt,Ht);Jt<Ce&&I.luaL_argcheck(Gt,Wt<1<<Jt*Me,Ht,M.to_luastring('unsigned overflow',!0)),Xe(wt,Wt,Ft.islittle,Jt,!1);break}case Ke.Kfloat:{let Wt=I.luaL_checknumber(Gt,Ht);He(wt,Wt,Ft.islittle,Jt);break}case Ke.Kchar:{let Wt=I.luaL_checkstring(Gt,Ht),Zt=Wt.length;for(I.luaL_argcheck(Gt,Zt<=Jt,Ht,M.to_luastring('string long than given size',!0)),wt.push(...Wt);Zt++<Jt;)wt.push(Ne);break}case Ke.Kstring:{let Wt=I.luaL_checkstring(Gt,Ht),Zt=Wt.length;I.luaL_argcheck(Gt,Jt>=Me||Zt<1<<Jt*Me,Ht,M.to_luastring('string length does not fit in given size',!0)),Xe(wt,Zt,Ft.islittle,Jt,0),wt.push(...Wt),jt+=Zt;break}case Ke.Kzstr:{let Wt=I.luaL_checkstring(Gt,Ht),Zt=Wt.length;I.luaL_argcheck(Gt,Wt.length===_StringfromCharCode(...Wt).length,Ht,M.to_luastring('strings contains zeros',!0)),wt.push(...Wt),wt.push(0),jt+=Zt+1;break}case Ke.Kpadding:wt.push(Ne);case Ke.Kpaddalign:case Ke.Knop:Ht--;}}return M.lua_pushstring(Gt,wt),1},packsize:function(Gt){let wt=new De(Gt),Ft={s:I.luaL_checkstring(Gt,1),off:0},Xt=0;for(;Ft.off<Ft.s.length;){let Ht=Fe(wt,Xt,Ft),jt=Ht.opt,zt=Ht.size,Yt=Ht.ntoalign;switch(zt+=Yt,I.luaL_argcheck(Gt,Xt<=H-zt-1,M.to_luastring('format result too large',!0)),Xt+=zt,jt){case Ke.Kstring:case Ke.Kzstr:I.luaL_argerror(Gt,1,M.to_luastring('variable-length format',!0));default:}}return M.lua_pushinteger(Gt,Xt),1},rep:function(Gt){let wt=I.luaL_checkstring(Gt,1),Ft=I.luaL_checkinteger(Gt,2),Xt=I.luaL_optstring(Gt,3,[]);if(wt.length+Xt.length<wt.length||wt.length+Xt.length>H/Ft)return I.luaL_error(Gt,M.to_luastring('resulting string too large',!0));let Ht=[];for(let jt=0;jt<Ft-1;jt++)Ht=Ht.concat(wt.concat(Xt));return Ht=Ht.concat(wt),M.lua_pushstring(Gt,0<Ft?Ht:[]),1},reverse:function(Gt){return M.lua_pushstring(Gt,I.luaL_checkstring(Gt,1).slice(0).reverse()),1},sub:function(Gt){let wt=I.luaL_checkstring(Gt,1),Ft=wt.length,Xt=J(I.luaL_checkinteger(Gt,2),Ft),Ht=J(I.luaL_optinteger(Gt,3,-1),Ft);return 1>Xt&&(Xt=1),Ht>Ft&&(Ht=Ft),Xt<=Ht?M.lua_pushstring(Gt,wt.slice(Xt-1,Xt-1+(Ht-Xt+1))):M.lua_pushliteral(Gt,''),1},unpack:function(Gt){let wt=new De(Gt),Ft={s:I.luaL_checkstring(Gt,1),off:0},Xt=I.luaL_checkstring(Gt,2),Ht=Xt.length,jt=J(I.luaL_optinteger(Gt,3,1),Ht)-1,zt=0;for(I.luaL_argcheck(Gt,jt<=Ht,3,M.to_luastring('initial position out of string',!0));Ft.off<Ft.s.length;){let Yt=Fe(wt,jt,Ft),Jt=Yt.opt,qt=Yt.size,Wt=Yt.ntoalign;switch(jt+Wt+qt>Ht&&I.luaL_argerror(Gt,2,M.to_luastring('data string too short',!0)),jt+=Wt,I.luaL_checkstack(Gt,2,M.to_luastring('too many results',!0)),zt++,Jt){case Ke.Kint:case Ke.Kuint:{let Zt=Qe(Gt,Xt.slice(jt),wt.islittle,qt,Jt===Ke.Kint);M.lua_pushinteger(Gt,Zt);break}case Ke.Kfloat:{let Zt=$e(Gt,Xt.slice(jt),wt.islittle,qt);M.lua_pushnumber(Gt,Zt);break}case Ke.Kchar:{M.lua_pushstring(Gt,Xt.slice(jt,jt+qt));break}case Ke.Kstring:{let Zt=Qe(Gt,Xt.slice(jt),wt.islittle,qt,0);I.luaL_argcheck(Gt,jt+Zt+qt<=Ht,2,M.to_luastring('data string too short',!0)),M.lua_pushstring(Gt,Xt.slice(jt+qt,jt+qt+Zt)),jt+=Zt;break}case Ke.Kzstr:{let Zt=Xt.slice(jt).indexOf(0);M.lua_pushstring(Gt,Xt.slice(jt,jt+Zt)),jt+=Zt+1;break}case Ke.Kpaddalign:case Ke.Kpadding:case Ke.Knop:zt--;}jt+=qt}return M.lua_pushinteger(Gt,jt+1),zt+1},upper:function(Gt){return M.lua_pushstring(Gt,M.to_luastring(M.to_jsstring(I.luaL_checkstring(Gt,1)).toUpperCase())),1}},Bt=function(Gt){M.lua_createtable(Gt,0,1),M.lua_pushliteral(Gt,''),M.lua_pushvalue(Gt,-2),M.lua_setmetatable(Gt,-2),M.lua_pop(Gt,1),M.lua_pushvalue(Gt,-2),M.lua_setfield(Gt,-2,M.to_luastring('__index',!0)),M.lua_pop(Gt,1)};T.exports.luaopen_string=function(Gt){return I.luaL_newlib(Gt,Kt),Bt(Gt),1}},function(T,O,U){'use strict';const E=U(0),N=U(2),I=U(6),M=U(4),P=1,K=2,V=4,G=P|K,F=function(Le,ge,Ae){return N.lua_pushstring(Le,ge),N.lua_rawget(Le,-Ae)!==N.LUA_TNIL},H=function(Le,ge,Ae){if(N.lua_type(Le,ge)!==N.LUA_TTABLE){let Te=1;N.lua_getmetatable(Le,ge)&&(!(Ae&P)||F(Le,N.to_luastring('__index',!0),++Te))&&(!(Ae&K)||F(Le,N.to_luastring('__newindex',!0),++Te))&&(!(Ae&V)||F(Le,N.to_luastring('__len',!0),++Te))?N.lua_pop(Le,Te):I.luaL_checktype(Le,ge,N.LUA_TTABLE)}},Y=function(Le,ge,Ae){return H(Le,ge,Ae|V),I.luaL_len(Le,ge)},J=function(Le,ge,Ae){N.lua_geti(Le,1,Ae),N.lua_isstring(Le,-1)||I.luaL_error(Le,N.to_luastring('invalid value (%s) at index %d in table for \'concat\''),I.luaL_typename(Le,-1),Ae),I.luaL_addvalue(ge)},te=function(){return _Mathfloor(1*Math.random()<<32)},ue=function(Le,ge,Ae){N.lua_seti(Le,1,ge),N.lua_seti(Le,1,Ae)},se=function(Le,ge,Ae){if(N.lua_isnil(Le,2))return N.lua_compare(Le,ge,Ae,N.LUA_OPLT);N.lua_pushvalue(Le,2),N.lua_pushvalue(Le,ge-1),N.lua_pushvalue(Le,Ae-2),N.lua_call(Le,2,1);let Te=N.lua_toboolean(Le,-1);return N.lua_pop(Le,1),Te},ne=function(Le,ge,Ae){for(let Te=ge,he=Ae-1;;){for(;N.lua_geti(Le,1,++Te),se(Le,-1,-2);)Te==Ae-1&&I.luaL_error(Le,N.to_luastring('invalid order function for sorting')),N.lua_pop(Le,1);for(;N.lua_geti(Le,1,--he),se(Le,-3,-1);)he<Te&&I.luaL_error(Le,N.to_luastring('invalid order function for sorting')),N.lua_pop(Le,1);if(he<Te)return N.lua_pop(Le,1),ue(Le,Ae-1,Te),Te;ue(Le,Te,he)}},oe=function(Le,ge,Ae){let Te=_Mathfloor((ge-Le)/4),he=Ae%(2*Te)+(Le+Te);return E(Le+Te<=he&&he<=ge-Te),he},_e=function(Le,ge,Ae,Te){for(;ge<Ae;){if(N.lua_geti(Le,1,ge),N.lua_geti(Le,1,Ae),se(Le,-1,-2)?ue(Le,ge,Ae):N.lua_pop(Le,2),1==Ae-ge)return;let he;if(he=100>Ae-ge||0===Te?_Mathfloor((ge+Ae)/2):oe(ge,Ae,Te),N.lua_geti(Le,1,he),N.lua_geti(Le,1,ge),se(Le,-2,-1)?ue(Le,he,ge):(N.lua_pop(Le,1),N.lua_geti(Le,1,Ae),se(Le,-1,-2)?ue(Le,he,Ae):N.lua_pop(Le,2)),2==Ae-ge)return;N.lua_geti(Le,1,he),N.lua_pushvalue(Le,-1),N.lua_geti(Le,1,Ae-1),ue(Le,he,Ae-1),he=ne(Le,ge,Ae);let Oe;he-ge<Ae-he?(_e(Le,ge,he-1,Te),Oe=he-ge,ge=he+1):(_e(Le,he+1,Ae,Te),Oe=Ae-he,Ae=he-1),(Ae-ge)/128>Oe&&(Te=te())}},ce={concat:function(Le){let ge=Y(Le,1,P),Ae=I.luaL_optlstring(Le,2,[]),Te=I.luaL_optinteger(Le,3,1);ge=I.luaL_optinteger(Le,4,ge);let he=new I.luaL_Buffer;for(I.luaL_buffinit(Le,he);Te<ge;Te++)J(Le,he,Te),I.luaL_addlstring(he,Ae);return Te===ge&&J(Le,he,Te),I.luaL_pushresult(he),1},insert:function(Le){let ge=Y(Le,1,G)+1,Ae;switch(N.lua_gettop(Le)){case 2:Ae=ge;break;case 3:{Ae=I.luaL_checkinteger(Le,2),I.luaL_argcheck(Le,1<=Ae&&Ae<=ge,2,N.to_luastring('position out of bounds',!0));for(let Te=ge;Te>Ae;Te--)N.lua_geti(Le,1,Te-1),N.lua_seti(Le,1,Te);break}default:return I.luaL_error(Le,N.to_luastring('wrong number of arguments to \'insert\'',!0));}return N.lua_seti(Le,1,Ae),0},move:function(Le){let ge=I.luaL_checkinteger(Le,2),Ae=I.luaL_checkinteger(Le,3),Te=I.luaL_checkinteger(Le,4),he=N.lua_isnoneornil(Le,5)?1:5;if(H(Le,1,P),H(Le,he,K),Ae>=ge){I.luaL_argcheck(Le,0<ge||Ae<M.LUA_MAXINTEGER+ge,3,N.to_luastring('too many elements to move',!0));let Oe=Ae-ge+1;if(I.luaL_argcheck(Le,Te<=M.LUA_MAXINTEGER-Oe+1,4,N.to_luastring('destination wrap around',!0)),Te>Ae||Te<=ge||1!=he&&1!==N.lua_compare(Le,1,he,N.LUA_OPEQ))for(let xe=0;xe<Oe;xe++)N.lua_geti(Le,1,ge+xe),N.lua_seti(Le,he,Te+xe);else for(let xe=Oe-1;0<=xe;xe--)N.lua_geti(Le,1,ge+xe),N.lua_seti(Le,he,Te+xe)}return N.lua_pushvalue(Le,he),1},pack:function(Le){let ge=N.lua_gettop(Le);N.lua_createtable(Le,ge,1),N.lua_insert(Le,1);for(let Ae=ge;1<=Ae;Ae--)N.lua_seti(Le,1,Ae);return N.lua_pushinteger(Le,ge),N.lua_setfield(Le,1,['n'.charCodeAt(0)]),1},remove:function(Le){let ge=Y(Le,1,G),Ae=I.luaL_optinteger(Le,2,ge);for(Ae!==ge&&I.luaL_argcheck(Le,1<=Ae&&Ae<=ge+1,1,N.to_luastring('position out of bounds',!0)),N.lua_geti(Le,1,Ae);Ae<ge;Ae++)N.lua_geti(Le,1,Ae+1),N.lua_seti(Le,1,Ae);return N.lua_pushnil(Le),N.lua_seti(Le,1,Ae),1},sort:function(Le){let ge=Y(Le,1,G);return 1<ge&&(I.luaL_argcheck(Le,ge<M.MAX_INT,1,N.to_luastring('array too big',!0)),!N.lua_isnoneornil(Le,2)&&I.luaL_checktype(Le,2,N.LUA_TFUNCTION),N.lua_settop(Le,2),_e(Le,1,ge,0)),0},unpack:function(Le){let ge=I.luaL_optinteger(Le,2,1),Ae=I.luaL_opt(Le,I.luaL_checkinteger,3,I.luaL_len(Le,1));if(ge>Ae)return 0;let Te=Ae-ge;if(Te>=M.MAX_INT||!N.lua_checkstack(Le,++Te))return I.luaL_error(Le,N.to_luastring('too many results to unpack',!0));for(;ge<Ae;ge++)N.lua_geti(Le,1,ge);return N.lua_geti(Le,1,Ae),Te}};T.exports.luaopen_table=function(Le){return I.luaL_newlib(Le,ce),1}},function(T,O,U){'use strict';const E=U(2),N=U(6),I=U(4),M=1114111,P=function(ee){return 128==(192&ee)},K=function(ee,te){return 0<=ee?ee:0-ee>te?0:te+ee+1},V=function(ee){let ue=ee[0],se=0,ne=0;if(128>ue)se=ue;else{let oe=0;for(;64&ue;){let _e=ee[++oe];if(128!=(192&_e))return null;se=se<<6|63&_e,ue<<=1}if(se|=(127&ue)<<5*oe,3<oe||se>M||se<=[255,127,2047,65535][oe])return null;ee=ee.slice(oe),ne+=oe}return{string:ee.slice(1),code:se,pos:ne+1}},F=function(ee,te){let ae=N.luaL_checkinteger(ee,te);N.luaL_argcheck(ee,0<=ae&&ae<=M,te,E.to_luastring('value out of range',!0)),E.lua_pushstring(ee,E.to_luastring(_StringfromCharCode(ae)))},q=function(ee){let te=N.luaL_checkstring(ee,1),ae=te.length,ue=E.lua_tointeger(ee,2)-1;if(0>ue)ue=0;else if(ue<ae)for(ue++;P(te[ue]);)ue++;if(ue>=ae)return 0;let se=V(te.slice(ue)),ne=se?se.code:null,oe=se?se.string:null;return null===oe||P(oe[0])?N.luaL_error(ee,E.to_luastring('invalid UTF-8 code',!0)):(E.lua_pushinteger(ee,ue+1),E.lua_pushinteger(ee,ne),2)},Z={char:function(ee){let te=E.lua_gettop(ee);if(1===te)F(ee,1);else{let ae=new N.luaL_Buffer;N.luaL_buffinit(ee,ae);for(let ue=1;ue<=te;ue++)F(ee,ue),N.luaL_addvalue(ae);N.luaL_pushresult(ae)}return 1},codepoint:function(ee){let te=N.luaL_checkstring(ee,1),ae=K(N.luaL_optinteger(ee,2,1),te.length),ue=K(N.luaL_optinteger(ee,3,ae),te.length);if(N.luaL_argcheck(ee,1<=ae,2,E.to_luastring('out of range',!0)),N.luaL_argcheck(ee,ue<=te.length,3,E.to_luastring('out of range',!0)),ae>ue)return 0;if(ue-ae>=I.MAX_INT)return N.luaL_error(ee,E.to_luastring('string slice too long',!0));let se=ue-ae+1;for(N.luaL_checkstack(ee,se,E.to_luastring('string slice too long',!0)),se=0,te=te.slice(ae-1);se<ue-ae;){let ne=V(te);if(null===ne)return N.luaL_error(ee,E.to_luastring('invalid UTF-8 code',!0));te=ne.string;let oe=ne.code;E.lua_pushinteger(ee,oe),se++}return se},codes:function(ee){return N.luaL_checkstring(ee,1),E.lua_pushcfunction(ee,q),E.lua_pushvalue(ee,1),E.lua_pushinteger(ee,0),3},len:function(ee){let te=0,ae=N.luaL_checkstring(ee,1),ue=ae.length,se=K(N.luaL_optinteger(ee,2,1),ue),ne=K(N.luaL_optinteger(ee,3,-1),ue);for(N.luaL_argcheck(ee,1<=se&&--se<=ue,2,'initial position out of string'),N.luaL_argcheck(ee,--ne<ue,3,'final position out of string');se<=ne;){let oe=V(ae.slice(se)),_e=oe?oe.string:null;if(null===_e)return E.lua_pushnil(ee),E.lua_pushinteger(ee,se+1),2;se=ae.length-_e.length,te++}return E.lua_pushinteger(ee,te),1},offset:function(ee){let te=N.luaL_checkstring(ee,1),ae=N.luaL_checkinteger(ee,2),ue=0<=ae?1:te.length+1;if(ue=K(N.luaL_optinteger(ee,3,ue),te.length),N.luaL_argcheck(ee,1<=ue&&--ue<=te.length,3,E.to_luastring('position out of range',!0)),0===ae)for(;0<ue&&P(te[ue]);)ue--;else if(P(te[ue])&&N.luaL_error(ee,E.to_luastring('initial position is a continuation byte',!0)),0>ae)for(;0>ae&&0<ue;){do ue--;while(0<ue&&P(te[ue]));ae++}else for(ae--;0<ae&&ue<te.length;){do ue++;while(P(te[ue]));ae--}return 0===ae?E.lua_pushinteger(ee,ue+1):E.lua_pushnil(ee),1}};T.exports.luaopen_utf8=function(ee){return N.luaL_newlib(ee,Z),E.lua_pushstring(ee,E.to_luastring('[\0-\x7F\xC2-\xF4][\x80-\xBF]*')),E.lua_setfield(ee,-2,E.to_luastring('charpattern',!0)),1}},function(T,O,U){var E=U(34),N=U(36),I=U(39),M=U(38),P=U(37),K=U(35),V=U(40);V.alea=E,V.xor128=N,V.xorwow=I,V.xorshift7=M,V.xor4096=P,V.tychei=K,T.exports=V},function(T,O,U){(function(E){var N;(function(I,M){function K(H){var Y=this,J=F();Y.next=function(){var q=2091639*Y.s0+2.3283064365386963e-10*Y.c;return Y.s0=Y.s1,Y.s1=Y.s2,Y.s2=q-(Y.c=0|q)},Y.c=1,Y.s0=J(' '),Y.s1=J(' '),Y.s2=J(' '),Y.s0-=J(H),0>Y.s0&&(Y.s0+=1),Y.s1-=J(H),0>Y.s1&&(Y.s1+=1),Y.s2-=J(H),0>Y.s2&&(Y.s2+=1),J=null}function V(H,Y){return Y.c=H.c,Y.s0=H.s0,Y.s1=H.s1,Y.s2=H.s2,Y}function G(H,Y){var J=new K(H),q=Y&&Y.state,W=J.next;return W.int32=function(){return 0|4294967296*J.next()},W.double=function(){return W()+1.1102230246251565e-16*(0|2097152*W())},W.quick=W,q&&('object'==typeof q&&V(q,J),W.state=function(){return V(J,{})}),W}function F(){var H=4022871197;return function(J){J=J.toString();for(var q=0;q<J.length;q++){H+=J.charCodeAt(q);var W=0.02519603282416938*H;H=W>>>0,W-=H,W*=H,H=W>>>0,W-=H,H+=4294967296*W}return 2.3283064365386963e-10*(H>>>0)}}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.alea=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){(function(E){var N;(function(I,M){function K(F){var H=this,Y='';H.next=function(){var q=H.b,W=H.c,Z=H.d,Q=H.a;return q=q<<25^q>>>7^W,W=0|W-Z,Z=Z<<24^Z>>>8^Q,Q=0|Q-q,H.b=q=q<<20^q>>>12^W,H.c=W=0|W-Z,H.d=Z<<16^W>>>16^Q,H.a=0|Q-q},H.a=0,H.b=0,H.c=-1640531527,H.d=1367130551,F===_Mathfloor(F)?(H.a=0|F/4294967296,H.b=0|F):Y+=F;for(var J=0;J<Y.length+20;J++)H.b^=0|Y.charCodeAt(J),H.next()}function V(F,H){return H.a=F.a,H.b=F.b,H.c=F.c,H.d=F.d,H}function G(F,H){var Y=new K(F),J=H&&H.state,q=function(){return(Y.next()>>>0)/4294967296};return q.double=function(){do var W=Y.next()>>>11,Z=(Y.next()>>>0)/4294967296,Q=(W+Z)/2097152;while(0===Q);return Q},q.int32=Y.next,q.quick=q,J&&('object'==typeof J&&V(J,Y),q.state=function(){return V(Y,{})}),q}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.tychei=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){(function(E){var N;(function(I,M){function K(F){var H=this,Y='';H.x=0,H.y=0,H.z=0,H.w=0,H.next=function(){var q=H.x^H.x<<11;return H.x=H.y,H.y=H.z,H.z=H.w,H.w^=H.w>>>19^q^q>>>8},F===(0|F)?H.x=F:Y+=F;for(var J=0;J<Y.length+64;J++)H.x^=0|Y.charCodeAt(J),H.next()}function V(F,H){return H.x=F.x,H.y=F.y,H.z=F.z,H.w=F.w,H}function G(F,H){var Y=new K(F),J=H&&H.state,q=function(){return(Y.next()>>>0)/4294967296};return q.double=function(){do var W=Y.next()>>>11,Z=(Y.next()>>>0)/4294967296,Q=(W+Z)/2097152;while(0===Q);return Q},q.int32=Y.next,q.quick=q,J&&('object'==typeof J&&V(J,Y),q.state=function(){return V(Y,{})}),q}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.xor128=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){(function(E){var N;(function(I,M){function K(F){var Y=this;Y.next=function(){var J=Y.w,q=Y.X,W=Y.i,Z,Q;return Y.w=J=0|J+1640531527,Q=q[127&W+34],Z=q[W=127&W+1],Q^=Q<<13,Z^=Z<<17,Q^=Q>>>15,Z^=Z>>>12,Q=q[W]=Q^Z,Y.i=W,0|Q+(J^J>>>16)},function(J,q){var te=[],ae=128,W,Z,Q,$,ee;for(q===(0|q)?(Z=q,q=null):(q+='\0',Z=0,ae=_Mathmax(ae,q.length)),Q=0,$=-32;$<ae;++$)q&&(Z^=q.charCodeAt(($+32)%q.length)),0===$&&(ee=Z),Z^=Z<<10,Z^=Z>>>15,Z^=Z<<4,Z^=Z>>>13,0<=$&&(ee=0|ee+1640531527,W=te[127&$]^=Z+ee,Q=0==W?Q+1:0);for(128<=Q&&(te[127&(q&&q.length||0)]=-1),Q=127,$=512;0<$;--$)Z=te[127&Q+34],W=te[Q=127&Q+1],Z^=Z<<13,W^=W<<17,Z^=Z>>>15,W^=W>>>12,te[Q]=Z^W;J.w=ee,J.X=te,J.i=Q}(Y,F)}function V(F,H){return H.i=F.i,H.w=F.w,H.X=F.X.slice(),H}function G(F,H){null==F&&(F=+new Date);var Y=new K(F),J=H&&H.state,q=function(){return(Y.next()>>>0)/4294967296};return q.double=function(){do var W=Y.next()>>>11,Z=(Y.next()>>>0)/4294967296,Q=(W+Z)/2097152;while(0===Q);return Q},q.int32=Y.next,q.quick=q,J&&(J.X&&V(J,Y),q.state=function(){return V(Y,{})}),q}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.xor4096=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){(function(E){var N;(function(I,M){function K(F){var Y=this;Y.next=function(){var J=Y.x,q=Y.i,W,Z;return W=J[q],W^=W>>>7,Z=W^W<<24,W=J[7&q+1],Z^=W^W>>>10,W=J[7&q+3],Z^=W^W>>>3,W=J[7&q+4],Z^=W^W<<7,W=J[7&q+7],W^=W<<13,Z^=W^W<<9,J[q]=Z,Y.i=7&q+1,Z},function(J,q){var Q=[],W,Z;if(q===(0|q))Z=Q[0]=q;else for(q=''+q,W=0;W<q.length;++W)Q[7&W]=Q[7&W]<<15^q.charCodeAt(W)+Q[7&W+1]<<13;for(;8>Q.length;)Q.push(0);for(W=0;8>W&&0===Q[W];++W);for(Z=8==W?Q[7]=-1:Q[W],J.x=Q,J.i=0,W=256;0<W;--W)J.next()}(Y,F)}function V(F,H){return H.x=F.x.slice(),H.i=F.i,H}function G(F,H){null==F&&(F=+new Date);var Y=new K(F),J=H&&H.state,q=function(){return(Y.next()>>>0)/4294967296};return q.double=function(){do var W=Y.next()>>>11,Z=(Y.next()>>>0)/4294967296,Q=(W+Z)/2097152;while(0===Q);return Q},q.int32=Y.next,q.quick=q,J&&(J.x&&V(J,Y),q.state=function(){return V(Y,{})}),q}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.xorshift7=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){(function(E){var N;(function(I,M){function K(F){var H=this,Y='';H.next=function(){var q=H.x^H.x>>>2;return H.x=H.y,H.y=H.z,H.z=H.w,H.w=H.v,0|(H.d=0|H.d+362437)+(H.v=H.v^H.v<<4^(q^q<<1))},H.x=0,H.y=0,H.z=0,H.w=0,H.v=0,F===(0|F)?H.x=F:Y+=F;for(var J=0;J<Y.length+64;J++)H.x^=0|Y.charCodeAt(J),J==Y.length&&(H.d=H.x<<10^H.x>>>4),H.next()}function V(F,H){return H.x=F.x,H.y=F.y,H.z=F.z,H.w=F.w,H.v=F.v,H.d=F.d,H}function G(F,H){var Y=new K(F),J=H&&H.state,q=function(){return(Y.next()>>>0)/4294967296};return q.double=function(){do var W=Y.next()>>>11,Z=(Y.next()>>>0)/4294967296,Q=(W+Z)/2097152;while(0===Q);return Q},q.int32=Y.next,q.quick=q,J&&('object'==typeof J&&V(J,Y),q.state=function(){return V(Y,{})}),q}M&&M.exports?M.exports=G:U(3)&&U(13)?(N=function(){return G}.call(O,U,O,M),!(void 0!==N&&(M.exports=N))):this.xorwow=G})(this,'object'==typeof E&&E,U(3))}).call(O,U(14)(T))},function(T,O,U){var E;(function(N,I){function M(ue,se,ne){var oe=[];se=!0==se?{entropy:!0}:se||{};var _e=G(V(se.entropy?[ue,H(N)]:null==ue?F():ue,3),oe),pe=new P(oe),ce=function(){for(var de=pe.g(q),Le=Q,ge=0;de<$;)de=(de+ge)*J,Le*=J,ge=pe.g(1);for(;de>=ee;)de/=2,Le/=2,ge>>>=1;return(de+ge)/Le};return ce.int32=function(){return 0|pe.g(4)},ce.quick=function(){return pe.g(4)/4294967296},ce.double=ce,G(H(pe.S),N),(se.pass||ne||function(de,Le,ge,Ae){return Ae&&(Ae.S&&K(Ae,pe),de.state=function(){return K(pe,{})}),ge?(I[Z]=de,Le):de})(ce,_e,'global'in se?se.global:this==I,se.state)}function P(ue){var ne=ue.length,oe=this,_e=0,pe=oe.i=oe.j=0,ce=oe.S=[],se;for(ne||(ue=[ne++]);_e<J;)ce[_e]=_e++;for(_e=0;_e<J;_e++)ce[_e]=ce[pe=te&pe+ue[_e%ne]+(se=ce[_e])],ce[pe]=se;(oe.g=function(de){for(var ge=0,Ae=oe.i,Te=oe.j,he=oe.S,Le;de--;)Le=he[Ae=te&Ae+1],ge=ge*J+he[te&(he[Ae]=he[Te=te&Te+Le])+(he[Te]=Le)];return oe.i=Ae,oe.j=Te,ge})(J)}function K(ue,se){return se.i=ue.i,se.j=ue.j,se.S=ue.S.slice(),se}function V(ue,se){var ne=[],oe=typeof ue,_e;if(se&&'object'==oe)for(_e in ue)try{ne.push(V(ue[_e],se-1))}catch(pe){}return ne.length?ne:'string'==oe?ue:ue+'\0'}function G(ue,se){for(var ne=ue+'',_e=0,oe;_e<ne.length;)se[te&_e]=te&(oe^=19*se[te&_e])+ne.charCodeAt(_e++);return H(se)}function F(){try{var ue;return ae&&(ue=ae.randomBytes)?ue=ue(J):(ue=new Uint8Array(J),(Y.crypto||Y.msCrypto).getRandomValues(ue)),H(ue)}catch(oe){var se=Y.navigator,ne=se&&se.plugins;return[+new Date,Y,ne,Y.screen,H(N)]}}function H(ue){return _StringfromCharCode.apply(0,ue)}var Y=this,J=256,q=6,Z='random',Q=I.pow(J,q),$=I.pow(2,52),ee=2*$,te=J-1,ae;if(I['seed'+Z]=M,G(I.random(),N),'object'==typeof T&&T.exports){T.exports=M;try{ae=U(54)}catch(ue){}}else E=function(){return M}.call(O,U,O,T),!(void 0!==E&&(T.exports=E))})([],Math)},function(T,O,U){var E;(function(N){'use strict';function I(){var F=arguments[0],H=I.cache;return H[F]&&H.hasOwnProperty(F)||(H[F]=I.parse(F)),I.format.call(null,H[F],arguments)}function M(F){return'number'==typeof F?'number':'string'==typeof F?'string':Object.prototype.toString.call(F).slice(8,-1).toLowerCase()}function P(F,H){return 0<=H&&7>=H&&G[F]?G[F][H]:Array(H+1).join(F)}var K={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};I.format=function(F,H){var Y=1,J=F.length,q='',Z=[],se=!0,ne='',W,Q,$,ee,te,ae,ue;for(Q=0;Q<J;Q++)if(q=M(F[Q]),'string'===q)Z[Z.length]=F[Q];else if('array'===q){if(ee=F[Q],ee[2])for(W=H[Y],$=0;$<ee[2].length;$++){if(!W.hasOwnProperty(ee[2][$]))throw new Error(I('[sprintf] property "%s" does not exist',ee[2][$]));W=W[ee[2][$]]}else W=ee[1]?H[ee[1]]:H[Y++];if(K.not_type.test(ee[8])&&K.not_primitive.test(ee[8])&&'function'==M(W)&&(W=W()),K.numeric_arg.test(ee[8])&&'number'!=M(W)&&isNaN(W))throw new TypeError(I('[sprintf] expecting number but found %s',M(W)));switch(K.number.test(ee[8])&&(se=0<=W),ee[8]){case'b':W=parseInt(W,10).toString(2);break;case'c':W=_StringfromCharCode(parseInt(W,10));break;case'd':case'i':W=parseInt(W,10);break;case'j':W=JSON.stringify(W,null,ee[6]?parseInt(ee[6]):0);break;case'e':W=ee[7]?parseFloat(W).toExponential(ee[7]):parseFloat(W).toExponential();break;case'f':W=ee[7]?parseFloat(W).toFixed(ee[7]):parseFloat(W);break;case'g':W=ee[7]?+W.toPrecision(ee[7])+'':parseFloat(W);break;case'o':W=W.toString(8);break;case's':W+='',W=ee[7]?W.substring(0,ee[7]):W;break;case't':W=!!W+'',W=ee[7]?W.substring(0,ee[7]):W;break;case'T':W=M(W),W=ee[7]?W.substring(0,ee[7]):W;break;case'u':W=parseInt(W,10)>>>0;break;case'v':W=W.valueOf(),W=ee[7]?W.substring(0,ee[7]):W;break;case'x':W=parseInt(W,10).toString(16);break;case'X':W=parseInt(W,10).toString(16).toUpperCase();}K.json.test(ee[8])?Z[Z.length]=W:(K.number.test(ee[8])&&(!se||ee[3])?(ne=se?'+':'-',W=W.toString().replace(K.sign,'')):ne='',ae=ee[4]?'0'===ee[4]?'0':ee[4].charAt(1):' ',ue=ee[6]-(ne+W).length,te=ee[6]?0<ue?P(ae,ue):'':'',Z[Z.length]=ee[5]?ne+W+te:'0'===ae?ne+te+W:te+ne+W)}return Z.join('')},I.cache={},I.parse=function(F){for(var H=F,Y=[],J=[],q=0;H;){if(null!==(Y=K.text.exec(H)))J[J.length]=Y[0];else if(null!==(Y=K.modulo.exec(H)))J[J.length]='%';else if(null!==(Y=K.placeholder.exec(H))){if(Y[2]){q|=1;var W=[],Z=Y[2],Q=[];if(null!==(Q=K.key.exec(Z))){for(W[W.length]=Q[1];''!==(Z=Z.substring(Q[0].length));)if(null!==(Q=K.key_access.exec(Z)))W[W.length]=Q[1];else if(null!==(Q=K.index_access.exec(Z)))W[W.length]=Q[1];else throw new SyntaxError('[sprintf] failed to parse named argument key');}else throw new SyntaxError('[sprintf] failed to parse named argument key');Y[2]=W}else q|=2;if(3==q)throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported');J[J.length]=Y}else throw new SyntaxError('[sprintf] unexpected placeholder');H=H.substring(Y[0].length)}return J};var V=function(F,H,Y){return Y=(H||[]).slice(0),Y.splice(0,0,F),I.apply(null,Y)},G={0:['','0','00','000','0000','00000','000000','0000000'],' ':['',' ',' ',' ',' ',' ',' ',' '],_:['','_','__','___','____','_____','______','_______']};O.sprintf=I,O.vsprintf=V,'undefined'!=typeof N&&(N.sprintf=I,N.vsprintf=V,E=function(){return{sprintf:I,vsprintf:V}}.call(O,U,O,T),!(void 0!==E&&(T.exports=E)))})('undefined'==typeof window?this:window)},function(T){(function(){function U(q,W,Z){function $(oe,_e,pe,ce){for(var de='',Le=null,ge=!1,Ae=oe.length,Te=!1,he=0,Oe;he<Ae;he++){if(Oe=oe.charCodeAt(he),!0==ge){if(45===Oe){Le='';continue}else if(95===Oe){Le=' ';continue}else if(48===Oe){Le='0';continue}else if(58===Oe){Te&&V('[WARNING] detected use of unsupported %:: or %::: modifiers to strftime'),Te=!0;continue}switch(Oe){case 37:de+='%';break;case 65:de+=pe.days[_e.getDay()];break;case 66:de+=pe.months[_e.getMonth()];break;case 67:de+=E(_Mathfloor(_e.getFullYear()/100),Le);break;case 68:de+=$(pe.formats.D,_e,pe,ce);break;case 70:de+=$(pe.formats.F,_e,pe,ce);break;case 72:de+=E(_e.getHours(),Le);break;case 73:de+=E(I(_e.getHours()),Le);break;case 76:de+=N(_Mathfloor(ce%1e3));break;case 77:de+=E(_e.getMinutes(),Le);break;case 80:de+=12>_e.getHours()?pe.am:pe.pm;break;case 82:de+=$(pe.formats.R,_e,pe,ce);break;case 83:de+=E(_e.getSeconds(),Le);break;case 84:de+=$(pe.formats.T,_e,pe,ce);break;case 85:de+=E(M(_e,'sunday'),Le);break;case 87:de+=E(M(_e,'monday'),Le);break;case 88:de+=$(pe.formats.X,_e,pe,ce);break;case 89:de+=_e.getFullYear();break;case 90:if(ae&&0===te)de+='GMT';else{var xe=_e.toString().match(/\(([\w\s]+)\)/);de+=xe&&xe[1]||''}break;case 97:de+=pe.shortDays[_e.getDay()];break;case 98:de+=pe.shortMonths[_e.getMonth()];break;case 99:de+=$(pe.formats.c,_e,pe,ce);break;case 100:de+=E(_e.getDate(),Le);break;case 101:de+=E(_e.getDate(),null==Le?' ':Le);break;case 104:de+=pe.shortMonths[_e.getMonth()];break;case 106:var Ue=new Date(_e.getFullYear(),0,1),Ee=_Mathceil((_e.getTime()-Ue.getTime())/86400000);de+=N(Ee);break;case 107:de+=E(_e.getHours(),null==Le?' ':Le);break;case 108:de+=E(I(_e.getHours()),null==Le?' ':Le);break;case 109:de+=E(_e.getMonth()+1,Le);break;case 110:de+='\n';break;case 111:var Ee=_e.getDate();de+=pe.ordinalSuffixes?Ee+''+(pe.ordinalSuffixes[Ee-1]||P(Ee)):Ee+''+P(Ee);break;case 112:de+=12>_e.getHours()?pe.AM:pe.PM;break;case 114:de+=$(pe.formats.r,_e,pe,ce);break;case 115:de+=_Mathfloor(ce/1e3);break;case 116:de+='\t';break;case 117:var Ee=_e.getDay();de+=0===Ee?7:Ee;break;case 118:de+=$(pe.formats.v,_e,pe,ce);break;case 119:de+=_e.getDay();break;case 120:de+=$(pe.formats.x,_e,pe,ce);break;case 121:de+=(''+_e.getFullYear()).slice(2);break;case 122:if(ae&&0===te)de+=Te?'+00:00':'+0000';else{var ke=0===te?-_e.getTimezoneOffset():te/60000,ve=0>ke?'-':'+',Re=Te?':':'',be=_Mathfloor(_Mathabs(ke/60)),Se=_Mathabs(ke%60);de+=ve+E(be)+Re+E(Se)}break;default:ge&&(de+='%'),de+=oe[he];}Le=null,ge=!1;continue}if(37===Oe){ge=!0;continue}de+=oe[he]}return de}var ee=q||F,te=W||0,ae=Z||!1,ue=0,ne=function(oe,_e){var pe;if(!_e){var ce=Date.now();ce>ue?(ue=ce,se=new Date(ue),pe=ue,ae&&(se=new Date(ue+K(se)+te))):pe=ue,_e=se}else if(pe=_e.getTime(),ae){var de=K(_e);if(_e=new Date(pe+de+te),K(_e)!==de){var Le=K(_e);_e=new Date(pe+Le+te)}}return $(oe,_e,ee,pe)},se;return ne.localize=function(oe){return new U(oe||ee,te,ae)},ne.localizeByIdentifier=function(oe){var _e=G[oe];return _e?ne.localize(_e):(V('[WARNING] No locale found with identifier "'+oe+'".'),ne)},ne.timezone=function(oe){var _e=te,pe=ae,ce=typeof oe;if('number'==ce||'string'==ce)if(pe=!0,'string'==ce){var de='-'===oe[0]?-1:1,Le=parseInt(oe.slice(1,3),10),ge=parseInt(oe.slice(3,5),10);_e=1e3*(60*(de*(60*Le+ge)))}else'number'==ce&&(_e=1e3*(60*oe));return new U(ee,_e,pe)},ne.utc=function(){return new U(ee,te,!0)},ne}function E(q,W){return''===W||9<q?q:(null==W&&(W='0'),W+q)}function N(q){return 99<q?q:9<q?'0'+q:'00'+q}function I(q){return 0===q?12:12<q?q-12:q}function M(q,W){W=W||'sunday';var Z=q.getDay();'monday'===W&&(0===Z?Z=6:Z--);var Q=Date.UTC(q.getFullYear(),0,1),$=Date.UTC(q.getFullYear(),q.getMonth(),q.getDate()),ee=_Mathfloor(($-Q)/8.64e7),te=(ee+7-Z)/7;return _Mathfloor(te)}function P(q){var W=q%10,Z=q%100;return 11<=Z&&13>=Z||0==W||4<=W?'th':1==W?'st':2==W?'nd':3==W?'rd':void 0}function K(q){return 6e4*(q.getTimezoneOffset()||0)}function V(q){'undefined'!=typeof console&&'function'==typeof console.warn&&console.warn(q)}var G={de_DE:{days:['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],shortDays:['So','Mo','Di','Mi','Do','Fr','Sa'],months:['Januar','Februar','M\xE4rz','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],shortMonths:['Jan','Feb','M\xE4r','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d.%m.%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},en_CA:{days:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],shortDays:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],months:['January','February','March','April','May','June','July','August','September','October','November','December'],shortMonths:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],ordinalSuffixes:['st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d/%m/%y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%r',x:'%D'}},en_US:{days:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],shortDays:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],months:['January','February','March','April','May','June','July','August','September','October','November','December'],shortMonths:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],ordinalSuffixes:['st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%m/%d/%y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%r',x:'%D'}},es_MX:{days:['domingo','lunes','martes','mi\xE9rcoles','jueves','viernes','s\xE1bado'],shortDays:['dom','lun','mar','mi\xE9','jue','vie','s\xE1b'],months:['enero','febrero','marzo','abril','mayo','junio','julio','agosto','septiembre','octubre','noviembre',' diciembre'],shortMonths:['ene','feb','mar','abr','may','jun','jul','ago','sep','oct','nov','dic'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d/%m/%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},fr_FR:{days:['dimanche','lundi','mardi','mercredi','jeudi','vendredi','samedi'],shortDays:['dim.','lun.','mar.','mer.','jeu.','ven.','sam.'],months:['janvier','f\xE9vrier','mars','avril','mai','juin','juillet','ao\xFBt','septembre','octobre','novembre','d\xE9cembre'],shortMonths:['janv.','f\xE9vr.','mars','avril','mai','juin','juil.','ao\xFBt','sept.','oct.','nov.','d\xE9c.'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d/%m/%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},it_IT:{days:['domenica','luned\xEC','marted\xEC','mercoled\xEC','gioved\xEC','venerd\xEC','sabato'],shortDays:['dom','lun','mar','mer','gio','ven','sab'],months:['gennaio','febbraio','marzo','aprile','maggio','giugno','luglio','agosto','settembre','ottobre','novembre','dicembre'],shortMonths:['pr','mag','giu','lug','ago','set','ott','nov','dic'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d/%m/%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},nl_NL:{days:['zondag','maandag','dinsdag','woensdag','donderdag','vrijdag','zaterdag'],shortDays:['zo','ma','di','wo','do','vr','za'],months:['januari','februari','maart','april','mei','juni','juli','augustus','september','oktober','november','december'],shortMonths:['jan','feb','mrt','apr','mei','jun','jul','aug','sep','okt','nov','dec'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d-%m-%y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},pt_BR:{days:['domingo','segunda','ter\xE7a','quarta','quinta','sexta','s\xE1bado'],shortDays:['Dom','Seg','Ter','Qua','Qui','Sex','S\xE1b'],months:['janeiro','fevereiro','mar\xE7o','abril','maio','junho','julho','agosto','setembro','outubro','novembro','dezembro'],shortMonths:['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X %Z',D:'%d-%m-%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},ru_RU:{days:['\u0412\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435','\u041F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A','\u0412\u0442\u043E\u0440\u043D\u0438\u043A','\u0421\u0440\u0435\u0434\u0430','\u0427\u0435\u0442\u0432\u0435\u0440\u0433','\u041F\u044F\u0442\u043D\u0438\u0446\u0430','\u0421\u0443\u0431\u0431\u043E\u0442\u0430'],shortDays:['\u0412\u0441','\u041F\u043D','\u0412\u0442','\u0421\u0440','\u0427\u0442','\u041F\u0442','\u0421\u0431'],months:['\u042F\u043D\u0432\u0430\u0440\u044C','\u0424\u0435\u0432\u0440\u0430\u043B\u044C','\u041C\u0430\u0440\u0442','\u0410\u043F\u0440\u0435\u043B\u044C','\u041C\u0430\u0439','\u0418\u044E\u043D\u044C','\u0418\u044E\u043B\u044C','\u0410\u0432\u0433\u0443\u0441\u0442','\u0421\u0435\u043D\u0442\u044F\u0431\u0440\u044C','\u041E\u043A\u0442\u044F\u0431\u0440\u044C','\u041D\u043E\u044F\u0431\u0440\u044C','\u0414\u0435\u043A\u0430\u0431\u0440\u044C'],shortMonths:['\u044F\u043D\u0432','\u0444\u0435\u0432','\u043C\u0430\u0440','\u0430\u043F\u0440','\u043C\u0430\u0439','\u0438\u044E\u043D','\u0438\u044E\u043B','\u0430\u0432\u0433','\u0441\u0435\u043D','\u043E\u043A\u0442','\u043D\u043E\u044F','\u0434\u0435\u043A'],AM:'AM',PM:'PM',am:'am',pm:'pm',formats:{c:'%a %d %b %Y %X',D:'%d.%m.%y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},tr_TR:{days:['Pazar','Pazartesi','Sal\u0131','\xC7ar\u015Famba','Per\u015Fembe','Cuma','Cumartesi'],shortDays:['Paz','Pzt','Sal','\xC7r\u015F','Pr\u015F','Cum','Cts'],months:['Ocak','\u015Eubat','Mart','Nisan','May\u0131s','Haziran','Temmuz','A\u011Fustos','Eyl\xFCl','Ekim','Kas\u0131m','Aral\u0131k'],shortMonths:['Oca','\u015Eub','Mar','Nis','May','Haz','Tem','A\u011Fu','Eyl','Eki','Kas','Ara'],AM:'\xD6\xD6',PM:'\xD6S',am:'\xD6\xD6',pm:'\xD6S',formats:{c:'%a %d %b %Y %X %Z',D:'%d-%m-%Y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%T',x:'%D'}},zh_CN:{days:['\u661F\u671F\u65E5','\u661F\u671F\u4E00','\u661F\u671F\u4E8C','\u661F\u671F\u4E09','\u661F\u671F\u56DB','\u661F\u671F\u4E94','\u661F\u671F\u516D'],shortDays:['\u65E5','\u4E00','\u4E8C','\u4E09','\u56DB','\u4E94','\u516D'],months:['\u4E00\u6708\u4EFD','\u4E8C\u6708\u4EFD','\u4E09\u6708\u4EFD','\u56DB\u6708\u4EFD','\u4E94\u6708\u4EFD','\u516D\u6708\u4EFD','\u4E03\u6708\u4EFD','\u516B\u6708\u4EFD','\u4E5D\u6708\u4EFD','\u5341\u6708\u4EFD','\u5341\u4E00\u6708\u4EFD','\u5341\u4E8C\u6708\u4EFD'],shortMonths:['\u4E00\u6708','\u4E8C\u6708','\u4E09\u6708','\u56DB\u6708','\u4E94\u6708','\u516D\u6708','\u4E03\u6708','\u516B\u6708','\u4E5D\u6708','\u5341\u6708','\u5341\u4E00\u6708','\u5341\u4E8C\u6708'],AM:'\u4E0A\u5348',PM:'\u4E0B\u5348',am:'\u4E0A\u5348',pm:'\u4E0B\u5348',formats:{c:'%a %d %b %Y %X %Z',D:'%d/%m/%y',F:'%Y-%m-%d',R:'%H:%M',r:'%I:%M:%S %p',T:'%H:%M:%S',v:'%e-%b-%Y',X:'%r',x:'%D'}}},F=G.en_US,H=new U(F,0,!1),J;'undefined'==typeof T?(J=function(){return this||(1,eval)('this')}(),J.strftime=H):J=T.exports=H,'function'!=typeof Date.now&&(Date.now=function(){return+new Date})})()},function(T){T.exports='function'==typeof Object.create?function(E,N){E.super_=N,E.prototype=Object.create(N.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}})}:function(E,N){E.super_=N;var I=function(){};I.prototype=N.prototype,E.prototype=new I,E.prototype.constructor=E}},function(T){T.exports=function(E){return E&&'object'==typeof E&&'function'==typeof E.copy&&'function'==typeof E.fill&&'function'==typeof E.readUInt8}},function(T,O,U){(function(E,N){function I(xe,Ue){var Ee={seen:[],stylize:P};return 3<=arguments.length&&(Ee.depth=arguments[2]),4<=arguments.length&&(Ee.colors=arguments[3]),W(Ue)?Ee.showHidden=Ue:Ue&&O._extend(Ee,Ue),ae(Ee.showHidden)&&(Ee.showHidden=!1),ae(Ee.depth)&&(Ee.depth=2),ae(Ee.colors)&&(Ee.colors=!1),ae(Ee.customInspect)&&(Ee.customInspect=!0),Ee.colors&&(Ee.stylize=M),V(Ee,xe,Ee.depth)}function M(xe,Ue){var Ee=I.styles[Ue];return Ee?'\x1B['+I.colors[Ee][0]+'m'+xe+'\x1B['+I.colors[Ee][1]+'m':xe}function P(xe){return xe}function K(xe){var Ue={};return xe.forEach(function(Ee){Ue[Ee]=!0}),Ue}function V(xe,Ue,Ee){if(xe.customInspect&&Ue&&_e(Ue.inspect)&&Ue.inspect!==O.inspect&&!(Ue.constructor&&Ue.constructor.prototype===Ue)){var ke=Ue.inspect(Ee,xe);return ee(ke)||(ke=V(xe,ke,Ee)),ke}var ve=G(xe,Ue);if(ve)return ve;var Re=Object.keys(Ue),be=K(Re);if(xe.showHidden&&(Re=Object.getOwnPropertyNames(Ue)),oe(Ue)&&(0<=Re.indexOf('message')||0<=Re.indexOf('description')))return F(Ue);if(0===Re.length){if(_e(Ue)){var Se=Ue.name?': '+Ue.name:'';return xe.stylize('[Function'+Se+']','special')}if(ue(Ue))return xe.stylize(RegExp.prototype.toString.call(Ue),'regexp');if(ne(Ue))return xe.stylize(Date.prototype.toString.call(Ue),'date');if(oe(Ue))return F(Ue)}var Ne='',Ie=!1,Ce=['{','}'];if(q(Ue)&&(Ie=!0,Ce=['[',']']),_e(Ue)){var Me=Ue.name?': '+Ue.name:'';Ne=' [Function'+Me+']'}if(ue(Ue)&&(Ne=' '+RegExp.prototype.toString.call(Ue)),ne(Ue)&&(Ne=' '+Date.prototype.toUTCString.call(Ue)),oe(Ue)&&(Ne=' '+F(Ue)),0===Re.length&&(!Ie||0==Ue.length))return Ce[0]+Ne+Ce[1];if(0>Ee)return ue(Ue)?xe.stylize(RegExp.prototype.toString.call(Ue),'regexp'):xe.stylize('[Object]','special');xe.seen.push(Ue);var Pe;return Pe=Ie?H(xe,Ue,Ee,be,Re):Re.map(function(ye){return Y(xe,Ue,Ee,be,ye,Ie)}),xe.seen.pop(),J(Pe,Ne,Ce)}function G(xe,Ue){if(ae(Ue))return xe.stylize('undefined','undefined');if(ee(Ue)){var Ee='\''+JSON.stringify(Ue).replace(/^"|"$/g,'').replace(/'/g,'\\\'').replace(/\\"/g,'"')+'\'';return xe.stylize(Ee,'string')}return $(Ue)?xe.stylize(''+Ue,'number'):W(Ue)?xe.stylize(''+Ue,'boolean'):Z(Ue)?xe.stylize('null','null'):void 0}function F(xe){return'['+Error.prototype.toString.call(xe)+']'}function H(xe,Ue,Ee,ke,ve){for(var Re=[],be=0,Se=Ue.length;be<Se;++be)ge(Ue,be+'')?Re.push(Y(xe,Ue,Ee,ke,be+'',!0)):Re.push('');return ve.forEach(function(Ne){Ne.match(/^\d+$/)||Re.push(Y(xe,Ue,Ee,ke,Ne,!0))}),Re}function Y(xe,Ue,Ee,ke,ve,Re){var be,Se,Ne;if(Ne=Object.getOwnPropertyDescriptor(Ue,ve)||{value:Ue[ve]},Ne.get?Ne.set?Se=xe.stylize('[Getter/Setter]','special'):Se=xe.stylize('[Getter]','special'):Ne.set&&(Se=xe.stylize('[Setter]','special')),ge(ke,ve)||(be='['+ve+']'),Se||(0>xe.seen.indexOf(Ne.value)?(Se=Z(Ee)?V(xe,Ne.value,null):V(xe,Ne.value,Ee-1),-1<Se.indexOf('\n')&&(Re?Se=Se.split('\n').map(function(Ie){return' '+Ie}).join('\n').substr(2):Se='\n'+Se.split('\n').map(function(Ie){return' '+Ie}).join('\n'))):Se=xe.stylize('[Circular]','special')),ae(be)){if(Re&&ve.match(/^\d+$/))return Se;be=JSON.stringify(''+ve),be.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(be=be.substr(1,be.length-2),be=xe.stylize(be,'name')):(be=be.replace(/'/g,'\\\'').replace(/\\"/g,'"').replace(/(^"|"$)/g,'\''),be=xe.stylize(be,'string'))}return be+': '+Se}function J(xe,Ue,Ee){var ke=0,ve=xe.reduce(function(Re,be){return ke++,0<=be.indexOf('\n')&&ke++,Re+be.replace(/\u001b\[\d\d?m/g,'').length+1},0);return 60<ve?Ee[0]+(''===Ue?'':Ue+'\n ')+' '+xe.join(',\n ')+' '+Ee[1]:Ee[0]+Ue+' '+xe.join(', ')+' '+Ee[1]}function q(xe){return Array.isArray(xe)}function W(xe){return'boolean'==typeof xe}function Z(xe){return null===xe}function $(xe){return'number'==typeof xe}function ee(xe){return'string'==typeof xe}function ae(xe){return void 0===xe}function ue(xe){return se(xe)&&'[object RegExp]'===ce(xe)}function se(xe){return'object'==typeof xe&&null!==xe}function ne(xe){return se(xe)&&'[object Date]'===ce(xe)}function oe(xe){return se(xe)&&('[object Error]'===ce(xe)||xe instanceof Error)}function _e(xe){return'function'==typeof xe}function ce(xe){return Object.prototype.toString.call(xe)}function de(xe){return 10>xe?'0'+xe.toString(10):xe.toString(10)}function Le(){var xe=new Date,Ue=[de(xe.getHours()),de(xe.getMinutes()),de(xe.getSeconds())].join(':');return[xe.getDate(),Oe[xe.getMonth()],Ue].join(' ')}function ge(xe,Ue){return Object.prototype.hasOwnProperty.call(xe,Ue)}var Ae=/%[sdj%]/g;O.format=function(xe){if(!ee(xe)){for(var Ue=[],Ee=0;Ee<arguments.length;Ee++)Ue.push(I(arguments[Ee]));return Ue.join(' ')}for(var Ee=1,ke=arguments,ve=ke.length,Re=(xe+'').replace(Ae,function(Se){if('%%'===Se)return'%';if(Ee>=ve)return Se;switch(Se){case'%s':return ke[Ee++]+'';case'%d':return+ke[Ee++];case'%j':try{return JSON.stringify(ke[Ee++])}catch(Ne){return'[Circular]'}default:return Se;}}),be=ke[Ee];Ee<ve;be=ke[++Ee])Re+=Z(be)||!se(be)?' '+be:' '+I(be);return Re},O.deprecate=function(xe,Ue){if(ae(E.process))return function(){return O.deprecate(xe,Ue).apply(this,arguments)};if(!0===N.noDeprecation)return xe;var ke=!1;return function(){if(!ke){if(N.throwDeprecation)throw new Error(Ue);else N.traceDeprecation?console.trace(Ue):console.error(Ue);ke=!0}return xe.apply(this,arguments)}};var Te={},he;O.debuglog=function(xe){if(ae(he)&&(he=N.env.NODE_DEBUG||''),xe=xe.toUpperCase(),!Te[xe])if(new RegExp('\\b'+xe+'\\b','i').test(he)){var Ue=N.pid;Te[xe]=function(){var Ee=O.format.apply(O,arguments);console.error('%s %d: %s',xe,Ue,Ee)}}else Te[xe]=function(){};return Te[xe]},O.inspect=I,I.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},I.styles={special:'cyan',number:'yellow',boolean:'yellow',undefined:'grey','null':'bold',string:'green',date:'magenta',regexp:'red'},O.isArray=q,O.isBoolean=W,O.isNull=Z,O.isNullOrUndefined=function(xe){return null==xe},O.isNumber=$,O.isString=ee,O.isSymbol=function(xe){return'symbol'==typeof xe},O.isUndefined=ae,O.isRegExp=ue,O.isObject=se,O.isDate=ne,O.isError=oe,O.isFunction=_e,O.isPrimitive=function(xe){return null===xe||'boolean'==typeof xe||'number'==typeof xe||'string'==typeof xe||'symbol'==typeof xe||'undefined'==typeof xe},O.isBuffer=U(44);var Oe=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];O.log=function(){console.log('%s - %s',Le(),O.format.apply(O,arguments))},O.inherits=U(43),O._extend=function(xe,Ue){if(!Ue||!se(Ue))return xe;for(var Ee=Object.keys(Ue),ke=Ee.length;ke--;)xe[Ee[ke]]=Ue[Ee[ke]];return xe}}).call(O,U(22),U(18))},function(T){function U(E){throw new Error('Cannot find module \''+E+'\'.')}U.keys=function(){return[]},U.resolve=U,T.exports=U,U.id=46},function(T,O,U){'use strict';const E=U(2),N=U(6);T.exports.lua=E,T.exports.lauxlib=N},function(T,O,U){'use strict';(function(E){const N=U(2),I=U(6),q=function(Ae,Te,he,Oe){return I.luaL_checkany(Ae,1),I.luaL_getmetafield(Ae,1,Te)===N.LUA_TNIL?(N.lua_pushcfunction(Ae,Oe),N.lua_pushvalue(Ae,1),he?N.lua_pushinteger(Ae,0):N.lua_pushnil(Ae)):(N.lua_pushvalue(Ae,1),N.lua_call(Ae,1,3)),3},W=function(Ae){return I.luaL_checktype(Ae,1,N.LUA_TTABLE),N.lua_settop(Ae,2),N.lua_next(Ae,1)?2:(N.lua_pushnil(Ae),1)},Q=function(Ae){let Te=I.luaL_checkinteger(Ae,2)+1;return N.lua_pushinteger(Ae,Te),N.lua_geti(Ae,1,Te)===N.LUA_TNIL?1:2},te=function(Ae){let Te=I.luaL_optinteger(Ae,2,1);return N.lua_settop(Ae,1),N.lua_type(Ae,1)===N.LUA_TSTRING&&0<Te&&(I.luaL_where(Ae,Te),N.lua_pushvalue(Ae,1),N.lua_concat(Ae,2)),N.lua_error(Ae)},se=function(Ae,Te,he){return Te!==N.LUA_OK&&Te!==N.LUA_YIELD?(N.lua_pushboolean(Ae,0),N.lua_pushvalue(Ae,-2),2):N.lua_gettop(Ae)-he},_e=function(Ae,Te,he){return Te===N.LUA_OK?(0!==he&&(N.lua_pushvalue(Ae,he),!N.lua_setupvalue(Ae,-2,1)&&N.lua_pop(Ae,1)),1):(N.lua_pushnil(Ae),N.lua_insert(Ae,-2),2)},pe=5,ce=function(Ae){return(I.luaL_checkstack(Ae,2,N.to_luastring('too many nested functions',!0)),N.lua_pushvalue(Ae,1),N.lua_call(Ae,0,1),N.lua_isnil(Ae,-1))?(N.lua_pop(Ae,1),null):(N.lua_isstring(Ae,-1)||I.luaL_error(Ae,N.to_luastring('reader function must return a string',!0)),N.lua_replace(Ae,pe),N.lua_tostring(Ae,pe))},Le={collectgarbage:function(){return 0},assert:function(Ae){return N.lua_toboolean(Ae,1)?N.lua_gettop(Ae):(I.luaL_checkany(Ae,1),N.lua_remove(Ae,1),N.lua_pushliteral(Ae,'assertion failed!'),N.lua_settop(Ae,1),te(Ae))},error:te,getmetatable:function(Ae){return(I.luaL_checkany(Ae,1),!N.lua_getmetatable(Ae,1))?(N.lua_pushnil(Ae),1):(I.luaL_getmetafield(Ae,1,N.to_luastring('__metatable',!0)),1)},ipairs:function(Ae){return I.luaL_checkany(Ae,1),N.lua_pushcfunction(Ae,Q),N.lua_pushvalue(Ae,1),N.lua_pushinteger(Ae,0),3},load:function(Ae){let Te=N.lua_tostring(Ae,1),he=I.luaL_optstring(Ae,3,N.to_luastring('bt',!0)),Oe=N.lua_isnone(Ae,4)?0:4,xe;if(null!==Te){let Ue=I.luaL_optstring(Ae,2,Te);xe=I.luaL_loadbufferx(Ae,Te,Te.length,Ue,he)}else{let Ue=I.luaL_optstring(Ae,2,N.to_luastring('=(load)',!0));I.luaL_checktype(Ae,1,N.LUA_TFUNCTION),N.lua_settop(Ae,pe),xe=N.lua_load(Ae,ce,null,Ue,he)}return _e(Ae,xe,Oe)},next:W,pairs:function(Ae){return q(Ae,N.to_luastring('__pairs',!0),0,W)},pcall:function(Ae){I.luaL_checkany(Ae,1),N.lua_pushboolean(Ae,1),N.lua_insert(Ae,1);let Te=N.lua_pcallk(Ae,N.lua_gettop(Ae)-2,N.LUA_MULTRET,0,0,se);return se(Ae,Te,0)},print:function(Ae){let Te=N.lua_gettop(Ae),he=[];N.lua_getglobal(Ae,N.to_luastring('tostring',!0));for(let Oe=1;Oe<=Te;Oe++){N.lua_pushvalue(Ae,-1),N.lua_pushvalue(Ae,Oe),N.lua_call(Ae,1,1);let xe=N.lua_tolstring(Ae,-1);if(null===xe)return I.luaL_error(Ae,N.to_luastring('\'tostring\' must return a string to \'print\'',!0));1<Oe&&(xe=['\t'.charCodeAt(0)].concat(xe)),he=he.concat(xe),N.lua_pop(Ae,1)}return E.stdout?E.stdout.write(N.to_jsstring(he)+'\n'):console.log(N.to_jsstring(he)),0},rawequal:function(Ae){return I.luaL_checkany(Ae,1),I.luaL_checkany(Ae,2),N.lua_pushboolean(Ae,N.lua_rawequal(Ae,1,2)),1},rawget:function(Ae){return I.luaL_checktype(Ae,1,N.LUA_TTABLE),I.luaL_checkany(Ae,2),N.lua_settop(Ae,2),N.lua_rawget(Ae,1),1},rawlen:function(Ae){let Te=N.lua_type(Ae,1);return I.luaL_argcheck(Ae,Te===N.LUA_TTABLE||Te===N.LUA_TSTRING,1,N.to_luastring('table or string expected',!0)),N.lua_pushinteger(Ae,N.lua_rawlen(Ae,1)),1},rawset:function(Ae){return I.luaL_checktype(Ae,1,N.LUA_TTABLE),I.luaL_checkany(Ae,2),I.luaL_checkany(Ae,3),N.lua_settop(Ae,3),N.lua_rawset(Ae,1),1},select:function(Ae){let Te=N.lua_gettop(Ae);if(N.lua_type(Ae,1)===N.LUA_TSTRING&&N.lua_tostring(Ae,1)[0]==='#'.charCodeAt(0))return N.lua_pushinteger(Ae,Te-1),1;let he=I.luaL_checkinteger(Ae,1);return 0>he?he=Te+he:he>Te&&(he=Te),I.luaL_argcheck(Ae,1<=he,1,N.to_luastring('index out of range',!0)),Te-he},setmetatable:function(Ae){let Te=N.lua_type(Ae,2);return(I.luaL_checktype(Ae,1,N.LUA_TTABLE),I.luaL_argcheck(Ae,Te===N.LUA_TNIL||Te===N.LUA_TTABLE,2,N.to_luastring('nil or table expected',!0)),I.luaL_getmetafield(Ae,1,N.to_luastring('__metatable',!0))!==N.LUA_TNIL)?I.luaL_error(Ae,N.to_luastring('cannot change a protected metatable',!0)):(N.lua_settop(Ae,2),N.lua_setmetatable(Ae,1),1)},tonumber:function(Ae){if(0>=N.lua_type(Ae,2)){if(I.luaL_checkany(Ae,1),N.lua_type(Ae,1)===N.LUA_TNUMBER)return N.lua_settop(Ae,1),1;let Te=N.lua_tostring(Ae,1);if(null!==Te&&N.lua_stringtonumber(Ae,Te)===Te.length)return 1}else{let Te=I.luaL_checkinteger(Ae,2);I.luaL_checktype(Ae,1,N.LUA_TSTRING);let he=N.lua_tostring(Ae,1);I.luaL_argcheck(Ae,2<=Te&&36>=Te,2,N.to_luastring('base out of range',!0));let Oe=parseInt(N.to_jsstring(he),Te);if(!isNaN(Oe))return N.lua_pushinteger(Ae,Oe),1}return N.lua_pushnil(Ae),1},tostring:function(Ae){return I.luaL_checkany(Ae,1),I.luaL_tolstring(Ae,1),1},type:function(Ae){let Te=N.lua_type(Ae,1);return I.luaL_argcheck(Ae,Te!==N.LUA_TNONE,1,N.to_luastring('value expected',!0)),N.lua_pushstring(Ae,N.lua_typename(Ae,Te)),1},xpcall:function(Ae){let Te=N.lua_gettop(Ae);I.luaL_checktype(Ae,2,N.LUA_TFUNCTION),N.lua_pushboolean(Ae,1),N.lua_pushvalue(Ae,1),N.lua_rotate(Ae,3,2);let he=N.lua_pcallk(Ae,Te-2,N.LUA_MULTRET,2,2,se);return se(Ae,he,2)}};T.exports.luaopen_base=function(Ae){return N.lua_pushglobaltable(Ae),I.luaL_setfuncs(Ae,Le,0),N.lua_pushvalue(Ae,-1),N.lua_setfield(Ae,-2,N.to_luastring('_G',!0)),N.lua_pushliteral(Ae,N.LUA_VERSION),N.lua_setfield(Ae,-2,N.to_luastring('_VERSION',!0)),1}}).call(O,U(18))},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(19),M=U(5),P=U(20),K=U(29),V=U(7),G=U(10),F=U(16),H=U(17),Y=N.CT,J=P.OpCodesI,q=M.TValue,W=function(Et,kt,vt,Rt,bt){switch(kt){case N.LUA_OPBAND:case N.LUA_OPBOR:case N.LUA_OPBXOR:case N.LUA_OPSHL:case N.LUA_OPSHR:case N.LUA_OPBNOT:{let St=H.tointeger(vt),Nt=H.tointeger(Rt);if(!1!==St&&!1!==Nt)return bt.type=Y.LUA_TNUMINT,void(bt.value=M.intarith(Et,kt,St,Nt));break}case N.LUA_OPDIV:case N.LUA_OPPOW:{let St=H.tonumber(vt),Nt=H.tonumber(Rt);if(!1!==St&&!1!==Nt)return bt.type=Y.LUA_TNUMFLT,void(bt.value=M.numarith(Et,kt,St,Nt));break}default:{let St=H.tonumber(vt),Nt=H.tonumber(Rt);if(vt.ttisinteger()&&Rt.ttisinteger())return bt.type=Y.LUA_TNUMINT,void(bt.value=M.intarith(Et,kt,vt.value,Rt.value));if(!1!==St&&!1!==Nt)return bt.type=Y.LUA_TNUMFLT,void(bt.value=M.numarith(Et,kt,St,Nt));break}}E(null!==Et),F.luaT_trybinTM(Et,vt,Rt,bt,kt-N.LUA_OPADD+F.TMS.TM_ADD)},Q=-1,$={OPR_ADD:0,OPR_SUB:1,OPR_MUL:2,OPR_MOD:3,OPR_POW:4,OPR_DIV:5,OPR_IDIV:6,OPR_BAND:7,OPR_BOR:8,OPR_BXOR:9,OPR_SHL:10,OPR_SHR:11,OPR_CONCAT:12,OPR_EQ:13,OPR_LT:14,OPR_LE:15,OPR_NE:16,OPR_GT:17,OPR_GE:18,OPR_AND:19,OPR_OR:20,OPR_NOBINOPR:21},ee={OPR_MINUS:0,OPR_BNOT:1,OPR_NOT:2,OPR_LEN:3,OPR_NOUNOPR:4},te=function(Et){return Et.t!==Et.f},ae=function(Et,kt){let vt=K.expkind;if(te(Et))return!1;switch(Et.k){case vt.VKINT:return kt&&(kt.type=Y.LUA_TNUMINT,kt.value=Et.u.ival),!0;case vt.VKFLT:return kt&&(kt.type=Y.LUA_TNUMFLT,kt.value=Et.u.nval),!0;default:return!1;}},ue=function(Et,kt,vt){let bt=kt+vt-1,Rt;if(Et.pc>Et.lasttarget&&(Rt=Et.f.code[Et.pc-1],Rt.opcode===J.OP_LOADNIL)){let St=Rt.A,Nt=St+Rt.B;if(St<=kt&&kt<=Nt+1||kt<=St&&St<=bt+1)return St<kt&&(kt=St),Nt>bt&&(bt=Nt),P.SETARG_A(Rt,kt),void P.SETARG_B(Rt,bt-kt)}Re(Et,J.OP_LOADNIL,kt,vt-1,0)},se=function(Et,kt){return Et.f.code[kt.u.info]},ne=function(Et,kt){let vt=Et.f.code[kt].sBx;return vt===Q?Q:kt+1+vt},oe=function(Et,kt,vt){let Rt=Et.f.code[kt],bt=vt-(kt+1);E(vt!==Q),_Mathabs(bt)>P.MAXARG_sBx&&I.luaX_syntaxerror(Et.ls,N.to_luastring('control structure too long',!0)),P.SETARG_sBx(Rt,bt)},_e=function(Et,kt,vt){if(vt===Q)return kt;if(kt===Q)kt=vt;else{let Rt=kt,bt=ne(Et,Rt);for(;bt!==Q;)Rt=bt,bt=ne(Et,Rt);oe(Et,Rt,vt)}return kt},pe=function(Et){let kt=Et.jpc;Et.jpc=Q;let vt=Se(Et,J.OP_JMP,0,Q);return vt=_e(Et,vt,kt),vt},Le=function(Et,kt,vt,Rt,bt){return Re(Et,kt,vt,Rt,bt),pe(Et)},ge=function(Et){return Et.lasttarget=Et.pc,Et.pc},Ae=function(Et,kt){return 1<=kt&&P.testTMode(Et.f.code[kt-1].opcode)?Et.f.code[kt-1]:Et.f.code[kt]},Te=function(Et,kt,vt){let Rt=Ae(Et,kt);return Rt.opcode===J.OP_TESTSET&&(vt!==P.NO_REG&&vt!==Rt.B?P.SETARG_A(Rt,vt):Rt=P.CREATE_ABC(J.OP_TEST,Rt.B,0,Rt.C),!0)},he=function(Et,kt){for(;kt!==Q;kt=ne(Et,kt))Te(Et,kt,P.NO_REG)},Oe=function(Et,kt,vt,Rt,bt){for(;kt!==Q;){let St=ne(Et,kt);Te(Et,kt,Rt)?oe(Et,kt,vt):oe(Et,kt,bt),kt=St}},xe=function(Et){Oe(Et,Et.jpc,Et.pc,P.NO_REG,Et.pc),Et.jpc=Q},Ue=function(Et,kt){ge(Et),Et.jpc=_e(Et,Et.jpc,kt)},Ee=function(Et,kt,vt){vt===Et.pc?Ue(Et,kt):(E(vt<Et.pc),Oe(Et,kt,vt,P.NO_REG,vt))},ve=function(Et,kt){let vt=Et.f;return xe(Et),vt.code[Et.pc]=kt,vt.lineinfo[Et.pc]=Et.ls.lastline,Et.pc++},Re=function(Et,kt,vt,Rt,bt){return E(P.getOpMode(kt)===P.iABC),E(P.getBMode(kt)!==P.OpArgN||0===Rt),E(P.getCMode(kt)!==P.OpArgN||0===bt),E(vt<=P.MAXARG_A&&Rt<=P.MAXARG_B&&bt<=P.MAXARG_C),ve(Et,P.CREATE_ABC(kt,vt,Rt,bt))},be=function(Et,kt,vt,Rt){return E(P.getOpMode(kt)===P.iABx||P.getOpMode(kt)===P.iAsBx),E(P.getCMode(kt)===P.OpArgN),E(vt<=P.MAXARG_A&&Rt<=P.MAXARG_Bx),ve(Et,P.CREATE_ABx(kt,vt,Rt))},Se=function(Et,kt,vt,Rt){return be(Et,kt,vt,Rt+P.MAXARG_sBx)},Ne=function(Et,kt){return E(kt<=P.MAXARG_Ax),ve(Et,P.CREATE_Ax(J.OP_EXTRAARG,kt))},Ie=function(Et,kt,vt){if(vt<=P.MAXARG_Bx)return be(Et,J.OP_LOADK,kt,vt);let Rt=be(Et,J.OP_LOADKX,kt,0);return Ne(Et,vt),Rt},Ce=function(Et,kt){let vt=Et.freereg+kt;vt>Et.f.maxstacksize&&(255<=vt&&I.luaX_syntaxerror(Et.ls,N.to_luastring('function or expression needs to many registers',!0)),Et.f.maxstacksize=vt)},Me=function(Et,kt){Ce(Et,kt),Et.freereg+=kt},Pe=function(Et,kt){!P.ISK(kt)&&kt>=Et.nactvar&&(Et.freereg--,E(kt===Et.freereg))},ye=function(Et,kt){kt.k===K.expkind.VNONRELOC&&Pe(Et,kt.u.info)},De=function(Et,kt,vt){let Rt=kt.k===K.expkind.VNONRELOC?kt.u.info:-1,bt=vt.k===K.expkind.VNONRELOC?vt.u.info:-1;Rt>bt?(Pe(Et,Rt),Pe(Et,bt)):(Pe(Et,bt),Pe(Et,Rt))},Ke=function(Et,kt,vt){let Rt=Et.f,bt=G.luaH_set(Et.ls.h,kt);if(bt.ttisinteger()){let Nt=bt.value;if(Nt<Et.nk&&Rt.k[Nt].ttype()===vt.ttype()&&Rt.k[Nt].value===vt.value)return Nt}let St=Et.nk;return bt.setivalue(St),Rt.k[St]=vt,Et.nk++,St},Ve=function(Et,kt){let vt=new q(Y.LUA_TLNGSTR,V.luaS_bless(Et.L,N.to_luastring(`${kt}`))),Rt=new q(Y.LUA_TNUMINT,kt);return Ke(Et,vt,Rt)},Ge=function(Et,kt){let vt=new q(Y.LUA_TNUMFLT,kt);return Ke(Et,vt,vt)},we=function(Et,kt){let vt=new q(Y.LUA_TBOOLEAN,kt);return Ke(Et,vt,vt)},Fe=function(Et){let kt=new q(Y.LUA_TNIL,null),vt=new q(Y.LUA_TTABLE,Et.ls.h);return Ke(Et,vt,kt)},Xe=function(Et,kt,vt){let Rt=K.expkind;if(kt.k===Rt.VCALL)P.SETARG_C(se(Et,kt),vt+1);else if(kt.k===Rt.VVARARG){let bt=se(Et,kt);P.SETARG_B(bt,vt+1),P.SETARG_A(bt,Et.freereg),Me(Et,1)}else E(vt===N.LUA_MULTRET)},je=function(Et,kt){let vt=K.expkind;kt.k===vt.VCALL?(E(2===se(Et,kt).C),kt.k=vt.VNONRELOC,kt.u.info=se(Et,kt).A):kt.k===vt.VVARARG&&(P.SETARG_B(se(Et,kt),2),kt.k=vt.VRELOCABLE)},ze=function(Et,kt){let vt=K.expkind;switch(kt.k){case vt.VLOCAL:{kt.k=vt.VNONRELOC;break}case vt.VUPVAL:{kt.u.info=Re(Et,J.OP_GETUPVAL,0,kt.u.info,0),kt.k=vt.VRELOCABLE;break}case vt.VINDEXED:{let Rt;Pe(Et,kt.u.ind.idx),kt.u.ind.vt===vt.VLOCAL?(Pe(Et,kt.u.ind.t),Rt=J.OP_GETTABLE):(E(kt.u.ind.vt===vt.VUPVAL),Rt=J.OP_GETTABUP),kt.u.info=Re(Et,Rt,0,kt.u.ind.t,kt.u.ind.idx),kt.k=vt.VRELOCABLE;break}case vt.VVARARG:case vt.VCALL:{je(Et,kt);break}default:}},Ye=function(Et,kt,vt,Rt){return ge(Et),Re(Et,J.OP_LOADBOOL,kt,vt,Rt)},Je=function(Et,kt,vt){let Rt=K.expkind;switch(ze(Et,kt),kt.k){case Rt.VNIL:{ue(Et,vt,1);break}case Rt.VFALSE:case Rt.VTRUE:{Re(Et,J.OP_LOADBOOL,vt,kt.k===Rt.VTRUE,0);break}case Rt.VK:{Ie(Et,vt,kt.u.info);break}case Rt.VKFLT:{Ie(Et,vt,Ge(Et,kt.u.nval));break}case Rt.VKINT:{Ie(Et,vt,Ve(Et,kt.u.ival));break}case Rt.VRELOCABLE:{let bt=se(Et,kt);P.SETARG_A(bt,vt);break}case Rt.VNONRELOC:{vt!==kt.u.info&&Re(Et,J.OP_MOVE,vt,kt.u.info,0);break}default:return void E(kt.k===Rt.VJMP);}kt.u.info=vt,kt.k=Rt.VNONRELOC},qe=function(Et,kt){kt.k!==K.expkind.VNONRELOC&&(Me(Et,1),Je(Et,kt,Et.freereg-1))},We=function(Et,kt){for(;kt!==Q;kt=ne(Et,kt)){let vt=Ae(Et,kt);if(vt.opcode!==J.OP_TESTSET)return!0}return!1},Ze=function(Et,kt,vt){let Rt=K.expkind;if(Je(Et,kt,vt),kt.k===Rt.VJMP&&(kt.t=_e(Et,kt.t,kt.u.info)),te(kt)){let St=Q,Nt=Q,bt;if(We(Et,kt.t)||We(Et,kt.f)){let It=kt.k===Rt.VJMP?Q:pe(Et);St=Ye(Et,vt,0,1),Nt=Ye(Et,vt,1,0),Ue(Et,It)}bt=ge(Et),Oe(Et,kt.f,bt,vt,St),Oe(Et,kt.t,bt,vt,Nt)}kt.f=kt.t=Q,kt.u.info=vt,kt.k=Rt.VNONRELOC},Qe=function(Et,kt){ze(Et,kt),ye(Et,kt),Me(Et,1),Ze(Et,kt,Et.freereg-1)},$e=function(Et,kt){if(ze(Et,kt),kt.k===K.expkind.VNONRELOC){if(!te(kt))return kt.u.info;if(kt.u.info>=Et.nactvar)return Ze(Et,kt,kt.u.info),kt.u.info}return Qe(Et,kt),kt.u.info},at=function(Et,kt){te(kt)?$e(Et,kt):ze(Et,kt)},lt=function(Et,kt){let vt=K.expkind,Rt=!1;switch(at(Et,kt),kt.k){case vt.VTRUE:kt.u.info=we(Et,1),Rt=!0;break;case vt.VFALSE:kt.u.info=we(Et,0),Rt=!0;break;case vt.VNIL:kt.u.info=Fe(Et),Rt=!0;break;case vt.VKINT:kt.u.info=Ve(Et,kt.u.ival),Rt=!0;break;case vt.VKFLT:kt.u.info=Ge(Et,kt.u.nval),Rt=!0;break;case vt.VK:Rt=!0;break;default:}return Rt&&(kt.k=vt.VK,kt.u.info<=P.MAXINDEXRK)?P.RKASK(kt.u.info):$e(Et,kt)},st=function(Et,kt){let vt=Ae(Et,kt.u.info);E(P.testTMode(vt.opcode)&&vt.opcode!==J.OP_TESTSET&&vt.opcode!==J.OP_TEST),P.SETARG_A(vt,!vt.A)},nt=function(Et,kt,vt){if(kt.k===K.expkind.VRELOCABLE){let Rt=se(Et,kt);if(Rt.opcode===J.OP_NOT)return Et.pc--,Le(Et,J.OP_TEST,Rt.B,0,!vt)}return qe(Et,kt),ye(Et,kt),Le(Et,J.OP_TESTSET,P.NO_REG,kt.u.info,vt)},ot=function(Et,kt){let vt=K.expkind,Rt;switch(ze(Et,kt),kt.k){case vt.VJMP:{st(Et,kt),Rt=kt.u.info;break}case vt.VK:case vt.VKFLT:case vt.VKINT:case vt.VTRUE:{Rt=Q;break}default:{Rt=nt(Et,kt,0);break}}kt.f=_e(Et,kt.f,Rt),Ue(Et,kt.t),kt.t=Q},_t=function(Et,kt){let vt=K.expkind,Rt;switch(ze(Et,kt),kt.k){case vt.VJMP:{Rt=kt.u.info;break}case vt.VNIL:case vt.VFALSE:{Rt=Q;break}default:{Rt=nt(Et,kt,1);break}}kt.t=_e(Et,kt.t,Rt),Ue(Et,kt.f),kt.f=Q},it=function(Et,kt){let vt=K.expkind;switch(ze(Et,kt),kt.k){case vt.VNIL:case vt.VFALSE:{kt.k=vt.VTRUE;break}case vt.VK:case vt.VKFLT:case vt.VKINT:case vt.VTRUE:{kt.k=vt.VFALSE;break}case vt.VJMP:{st(Et,kt);break}case vt.VRELOCABLE:case vt.VNONRELOC:{qe(Et,kt),ye(Et,kt),kt.u.info=Re(Et,J.OP_NOT,0,kt.u.info,0),kt.k=vt.VRELOCABLE;break}}{let Rt=kt.f;kt.f=kt.t,kt.t=Rt}he(Et,kt.f),he(Et,kt.t)},ct=function(Et,kt,vt){return Et===N.LUA_OPBAND||Et===N.LUA_OPBOR||Et===N.LUA_OPBXOR||Et===N.LUA_OPSHL||Et===N.LUA_OPSHR||Et===N.LUA_OPBNOT?H.tointeger(kt)&&H.tointeger(vt):Et===N.LUA_OPDIV||Et===N.LUA_OPIDIV||Et===N.LUA_OPMOD?0!==vt.value:1},dt=function(Et,kt,vt,Rt){let bt=K.expkind,St=new q,Nt=new q,It=new q;if(!ae(vt,St)||!ae(Rt,Nt)||!ct(kt,St,Nt))return 0;if(W(Et.ls.L,kt,St,Nt,It),It.ttisinteger())vt.k=bt.VKINT,vt.u.ival=It.value;else{let Ct=It.value;if(isNaN(Ct)||0===Ct)return!1;vt.k=bt.VKFLT,vt.u.nval=Ct}return!0},Lt=function(Et,kt,vt,Rt){let bt=$e(Et,vt);ye(Et,vt),vt.u.info=Re(Et,kt,0,bt,0),vt.k=K.expkind.VRELOCABLE,xt(Et,Rt)},ft=function(Et,kt,vt,Rt,bt){let St=lt(Et,Rt),Nt=lt(Et,vt);De(Et,vt,Rt),vt.u.info=Re(Et,kt,0,Nt,St),vt.k=K.expkind.VRELOCABLE,xt(Et,bt)},At=function(Et,kt,vt,Rt){let bt=K.expkind,St;vt.k===bt.VK?St=P.RKASK(vt.u.info):(E(vt.k===bt.VNONRELOC),St=vt.u.info);let Nt=lt(Et,Rt);switch(De(Et,vt,Rt),kt){case $.OPR_NE:{vt.u.info=Le(Et,J.OP_EQ,0,St,Nt);break}case $.OPR_GT:case $.OPR_GE:{let It=kt-$.OPR_NE+J.OP_EQ;vt.u.info=Le(Et,It,1,Nt,St);break}default:{let It=kt-$.OPR_EQ+J.OP_EQ;vt.u.info=Le(Et,It,1,St,Nt);break}}vt.k=bt.VJMP},xt=function(Et,kt){Et.f.lineinfo[Et.pc-1]=kt};T.exports.BinOpr=$,T.exports.NO_JUMP=Q,T.exports.UnOpr=ee,T.exports.getinstruction=se,T.exports.luaK_checkstack=Ce,T.exports.luaK_code=ve,T.exports.luaK_codeABC=Re,T.exports.luaK_codeABx=be,T.exports.luaK_codeAsBx=Se,T.exports.luaK_codek=Ie,T.exports.luaK_concat=_e,T.exports.luaK_dischargevars=ze,T.exports.luaK_exp2RK=lt,T.exports.luaK_exp2anyreg=$e,T.exports.luaK_exp2anyregup=function(Et,kt){(kt.k!==K.expkind.VUPVAL||te(kt))&&$e(Et,kt)},T.exports.luaK_exp2nextreg=Qe,T.exports.luaK_exp2val=at,T.exports.luaK_fixline=xt,T.exports.luaK_getlabel=ge,T.exports.luaK_goiffalse=_t,T.exports.luaK_goiftrue=ot,T.exports.luaK_indexed=function(Et,kt,vt){let Rt=K.expkind;E(!te(kt)&&(K.vkisinreg(kt.k)||kt.k===Rt.VUPVAL)),kt.u.ind.t=kt.u.info,kt.u.ind.idx=lt(Et,vt),kt.u.ind.vt=kt.k===Rt.VUPVAL?Rt.VUPVAL:Rt.VLOCAL,kt.k=Rt.VINDEXED},T.exports.luaK_infix=function(Et,kt,vt){switch(kt){case $.OPR_AND:{ot(Et,vt);break}case $.OPR_OR:{_t(Et,vt);break}case $.OPR_CONCAT:{Qe(Et,vt);break}case $.OPR_ADD:case $.OPR_SUB:case $.OPR_MUL:case $.OPR_DIV:case $.OPR_IDIV:case $.OPR_MOD:case $.OPR_POW:case $.OPR_BAND:case $.OPR_BOR:case $.OPR_BXOR:case $.OPR_SHL:case $.OPR_SHR:{ae(vt,null)||lt(Et,vt);break}default:{lt(Et,vt);break}}},T.exports.luaK_intK=Ve,T.exports.luaK_jump=pe,T.exports.luaK_jumpto=function(Et,kt){return Ee(Et,pe(Et),kt)},T.exports.luaK_nil=ue,T.exports.luaK_numberK=Ge,T.exports.luaK_patchclose=function(Et,kt,vt){for(vt++;kt!==Q;kt=ne(Et,kt)){let Rt=Et.f.code[kt];E(Rt.opcode===J.OP_JMP&&(0===Rt.A||Rt.A>=vt)),P.SETARG_A(Rt,vt)}},T.exports.luaK_patchlist=Ee,T.exports.luaK_patchtohere=Ue,T.exports.luaK_posfix=function(Et,kt,vt,Rt,bt){let St=K.expkind;switch(kt){case $.OPR_AND:{E(vt.t===Q),ze(Et,Rt),Rt.f=_e(Et,Rt.f,vt.f),vt.to(Rt);break}case $.OPR_OR:{E(vt.f===Q),ze(Et,Rt),Rt.t=_e(Et,Rt.t,vt.t),vt.to(Rt);break}case $.OPR_CONCAT:{let Nt=se(Et,Rt);at(Et,Rt),Rt.k===St.VRELOCABLE&&Nt.opcode===J.OP_CONCAT?(E(vt.u.info===Nt.B-1),ye(Et,vt),P.SETARG_B(Nt,vt.u.info),vt.k=St.VRELOCABLE,vt.u.info=Rt.u.info):(Qe(Et,Rt),ft(Et,J.OP_CONCAT,vt,Rt,bt));break}case $.OPR_ADD:case $.OPR_SUB:case $.OPR_MUL:case $.OPR_DIV:case $.OPR_IDIV:case $.OPR_MOD:case $.OPR_POW:case $.OPR_BAND:case $.OPR_BOR:case $.OPR_BXOR:case $.OPR_SHL:case $.OPR_SHR:{dt(Et,kt+N.LUA_OPADD,vt,Rt)||ft(Et,kt+J.OP_ADD,vt,Rt,bt);break}case $.OPR_EQ:case $.OPR_LT:case $.OPR_LE:case $.OPR_NE:case $.OPR_GT:case $.OPR_GE:{At(Et,kt,vt,Rt);break}}return vt},T.exports.luaK_prefix=function(Et,kt,vt,Rt){let bt=new K.expdesc;switch(bt.k=K.expkind.VKINT,bt.u.ival=bt.u.nval=bt.u.info=0,bt.t=Q,bt.f=Q,kt){case ee.OPR_MINUS:case ee.OPR_BNOT:if(dt(Et,kt+N.LUA_OPUNM,vt,bt))break;case ee.OPR_LEN:Lt(Et,kt+J.OP_UNM,vt,Rt);break;case ee.OPR_NOT:it(Et,vt);}},T.exports.luaK_reserveregs=Me,T.exports.luaK_ret=function(Et,kt,vt){Re(Et,J.OP_RETURN,kt,vt+1,0)},T.exports.luaK_self=function(Et,kt,vt){$e(Et,kt);let Rt=kt.u.info;ye(Et,kt),kt.u.info=Et.freereg,kt.k=K.expkind.VNONRELOC,Me(Et,2),Re(Et,J.OP_SELF,kt.u.info,Rt,lt(Et,vt)),ye(Et,vt)},T.exports.luaK_setlist=function(Et,kt,vt,Rt){let bt=(vt-1)/P.LFIELDS_PER_FLUSH+1,St=Rt===N.LUA_MULTRET?0:Rt;E(0!==Rt&&Rt<=P.LFIELDS_PER_FLUSH),bt<=P.MAXARG_C?Re(Et,J.OP_SETLIST,kt,St,bt):bt<=P.MAXARG_Ax?(Re(Et,J.OP_SETLIST,kt,St,0),Ne(Et,bt)):I.luaX_syntaxerror(Et.ls,N.to_luastring('constructor too long',!0)),Et.freereg=kt+1},T.exports.luaK_setmultret=function(Et,kt){Xe(Et,kt,N.LUA_MULTRET)},T.exports.luaK_setoneret=je,T.exports.luaK_setreturns=Xe,T.exports.luaK_storevar=function(Et,kt,vt){let Rt=K.expkind;switch(kt.k){case Rt.VLOCAL:return ye(Et,vt),void Ze(Et,vt,kt.u.info);case Rt.VUPVAL:{let bt=$e(Et,vt);Re(Et,J.OP_SETUPVAL,bt,kt.u.info,0);break}case Rt.VINDEXED:{let bt=kt.u.ind.vt===Rt.VLOCAL?J.OP_SETTABLE:J.OP_SETTABUP,St=lt(Et,vt);Re(Et,bt,kt.u.ind.t,kt.u.ind.idx,St);break}}ye(Et,vt)},T.exports.luaK_stringK=function(Et,kt){let vt=new q(Y.LUA_TLNGSTR,kt);return Ke(Et,vt,vt)}},function(T,O,U){'use strict';const E=U(1),N=E.constant_types,K=16*_NumberparseInt(E.LUA_VERSION_MAJOR)+_NumberparseInt(E.LUA_VERSION_MINOR);class G{constructor(){this.L=null,this.write=null,this.data=null,this.strip=NaN,this.status=NaN}}const F=function(oe,_e,pe){0===pe.status&&0<_e&&(pe.status=pe.writer(pe.L,oe,_e,pe.data))},H=function(oe,_e){oe=E.to_luastring(oe),F(oe,oe.length,_e)},Y=function(oe,_e){F([oe],1,_e)},J=function(oe,_e){let pe=new DataView(new ArrayBuffer(4));pe.setInt32(0,oe,!0);let ce=[];for(let de=0;4>de;de++)ce.push(pe.getUint8(de,!0));F(ce,4,_e)},q=function(oe,_e){let pe=new DataView(new ArrayBuffer(4));pe.setInt32(0,oe,!0);let ce=[];for(let de=0;4>de;de++)ce.push(pe.getUint8(de,!0));F(ce,8,_e)},W=function(oe,_e){let pe=new DataView(new ArrayBuffer(8));pe.setFloat64(0,oe,!0);let ce=[];for(let de=0;8>de;de++)ce.push(pe.getUint8(de,!0));F(ce,8,_e)},Z=function(oe,_e){if(null===oe)Y(0,_e);else{let pe=oe.tsslen()+1,ce=oe.getstr();255>pe?Y(pe,_e):(Y(255,_e),q(pe,_e)),F(ce,pe-1,_e)}},Q=function(oe,_e){let pe=oe.code.map((ce)=>ce.code);J(pe.length,_e);for(let ce=0;ce<pe.length;ce++)J(pe[ce],_e)},$=function(oe,_e){let pe=oe.k.length;J(pe,_e);for(let ce=0,de;ce<pe;ce++)switch(de=oe.k[ce],Y(de.ttype(),_e),de.ttype()){case N.LUA_TNIL:break;case N.LUA_TBOOLEAN:Y(de.value?1:0,_e);break;case N.LUA_TNUMFLT:W(de.value,_e);break;case N.LUA_TNUMINT:q(de.value,_e);break;case N.LUA_TSHRSTR:case N.LUA_TLNGSTR:Z(de.tsvalue(),_e);}},ee=function(oe,_e){let pe=oe.p.length;J(pe,_e);for(let ce=0;ce<pe;ce++)ue(oe.p[ce],oe.source,_e)},te=function(oe,_e){let pe=oe.upvalues.length;J(pe,_e);for(let ce=0;ce<pe;ce++)Y(oe.upvalues[ce].instack?1:0,_e),Y(oe.upvalues[ce].idx,_e)},ae=function(oe,_e){let pe=_e.strip?0:oe.lineinfo.length;J(pe,_e);for(let ce=0;ce<pe;ce++)J(oe.lineinfo[ce],_e);pe=_e.strip?0:oe.locvars.length,J(pe,_e);for(let ce=0;ce<pe;ce++)Z(oe.locvars[ce].varname,_e),J(oe.locvars[ce].startpc,_e),J(oe.locvars[ce].endpc,_e);pe=_e.strip?0:oe.upvalues.length,J(pe,_e);for(let ce=0;ce<pe;ce++)Z(oe.upvalues[ce].name,_e)},ue=function(oe,_e,pe){pe.strip||oe.source===_e?Z(null,pe):Z(oe.source,pe),J(oe.linedefined,pe),J(oe.lastlinedefined,pe),Y(oe.numparams,pe),Y(oe.is_vararg?1:0,pe),Y(oe.maxstacksize,pe),Q(oe,pe),$(oe,pe),te(oe,pe),ee(oe,pe),ae(oe,pe)},se=function(oe){H(E.LUA_SIGNATURE,oe),Y(K,oe),Y(0,oe);let _e='\x19\x93\r\n\x1A\n'.split('').map((pe)=>pe.charCodeAt(0));F(_e,_e.length,oe),Y(4,oe),Y(8,oe),Y(4,oe),Y(4,oe),Y(8,oe),q(22136,oe),W(370.5,oe)};T.exports.luaU_dump=function(oe,_e,pe,ce,de){let Le=new G;return Le.L=oe,Le.writer=pe,Le.data=ce,Le.strip=de,Le.status=0,se(Le),Y(_e.upvalues.length,Le),ue(_e,null,Le),Le.status}},function(T,O,U){'use strict';const E=U(2),N=U(6),I=U(48),M=U(23),P=U(26),K=U(30),V=U(31),G=U(32),F=U(24),H=U(28),Y=U(27),J=U(52),q={[J.LUA_LOADLIBNAME]:Y.luaopen_package,[J.LUA_COLIBNAME]:M.luaopen_coroutine,[J.LUA_DBLIBNAME]:F.luaopen_debug,[J.LUA_MATHLIBNAME]:P.luaopen_math,[J.LUA_OSLIBNAME]:H.luaopen_os,[J.LUA_STRLIBNAME]:K.luaopen_string,[J.LUA_TABLIBNAME]:V.luaopen_table,[J.LUA_UTF8LIBNAME]:G.luaopen_utf8,_G:I.luaopen_base};T.exports.luaL_openlibs=function(Z){for(let Q in q)N.luaL_requiref(Z,E.to_luastring(Q),q[Q],1),E.lua_pop(Z,1)}},function(T,O,U){'use strict';const E=U(2),N='_'+E.LUA_VERSION_MAJOR+'_'+E.LUA_VERSION_MINOR;T.exports.LUA_VERSUFFIX=N;const I='coroutine';T.exports.LUA_COLIBNAME=I,T.exports[I]=U(23).luaopen_coroutine;const M='table';T.exports.LUA_TABLIBNAME=M,T.exports[M]=U(31).luaopen_table;const P='os';T.exports.LUA_OSLIBNAME=P,T.exports[P]=U(28).luaopen_os;const K='string';T.exports.LUA_STRLIBNAME=K,T.exports[K]=U(30).luaopen_string;const V='utf8';T.exports.LUA_UTF8LIBNAME=V,T.exports[V]=U(32).luaopen_utf8,T.exports.LUA_BITLIBNAME='bit32';const F='math';T.exports.LUA_MATHLIBNAME=F,T.exports[F]=U(26).luaopen_math;const H='debug';T.exports.LUA_DBLIBNAME=H,T.exports[H]=U(24).luaopen_debug;const Y='package';T.exports.LUA_LOADLIBNAME=Y,T.exports[Y]=U(27).luaopen_package},function(T,O,U){'use strict';const E=U(0),N=U(1),I=U(9),M=U(11),P=U(5),K=U(20),V=U(7),G=U(19);let F=[25,147,N.char['\r'],N.char['\n'],26,N.char['\n']];class H{constructor(J,q,W){this.intSize=4,this.size_tSize=8,this.instructionSize=4,this.integerSize=4,this.numberSize=8,E(q instanceof G.MBuffer,'BytecodeParser only operates on a MBuffer'),E(Array.isArray(W)),this.name=W[0]==N.char['@']||W[0]==N.char['=']?W.slice(1):W[0]==N.LUA_SIGNATURE.charCodeAt(0)?N.to_luastring('binary string',!0):W,this.L=J,this.buffer=q,this.dv=new DataView(new ArrayBuffer(_Mathmax(this.intSize,this.size_tSize,this.instructionSize,this.integerSize,this.numberSize)))}read(J){let q=this.buffer.read(J);return E(Array.isArray(q)),q.length<J&&this.error('truncated'),q}readByte(){return this.read(1)[0]}readInteger(){let J=this.read(this.integerSize);for(let q=0;q<J.length;q++)this.dv.setUint8(q,J[q]);return this.dv.getInt32(0,!0)}readSize_t(){return this.readInteger()}readInt(){let J=this.read(this.intSize);for(let q=0;q<J.length;q++)this.dv.setUint8(q,J[q]);return this.dv.getInt32(0,!0)}readNumber(){let J=this.read(this.numberSize);for(let q=0;q<J.length;q++)this.dv.setUint8(q,J[q]);return this.dv.getFloat64(0,!0)}readString(){let J=_Mathmax(this.readByte()-1,0);return 255===J+1&&(J=this.readSize_t()-1),0===J?null:V.luaS_new(this.L,this.read(J))}static MASK1(J,q){return~(-1<<J)<<q}static MASK0(J,q){return~H.MASK1(J,q)}readInstruction(){let J=new DataView(new ArrayBuffer(this.instructionSize));for(let q=0;q<this.instructionSize;q++)J.setUint8(q,this.readByte());return J.getUint32(0,!0)}readCode(J){let q=this.readInt(),W=K,Z=H;for(let Q=0,$;Q<q;Q++)$=this.readInstruction(),J.code[Q]={code:$,opcode:$>>W.POS_OP&Z.MASK1(W.SIZE_OP,0),A:$>>W.POS_A&Z.MASK1(W.SIZE_A,0),B:$>>W.POS_B&Z.MASK1(W.SIZE_B,0),C:$>>W.POS_C&Z.MASK1(W.SIZE_C,0),Bx:$>>W.POS_Bx&Z.MASK1(W.SIZE_Bx,0),Ax:$>>W.POS_Ax&Z.MASK1(W.SIZE_Ax,0),sBx:($>>W.POS_Bx&Z.MASK1(W.SIZE_Bx,0))-W.MAXARG_sBx}}readUpvalues(J){let q=this.readInt();for(let W=0;W<q;W++)J.upvalues[W]={name:null,instack:this.readByte(),idx:this.readByte()}}readConstants(J){let q=this.readInt();for(let W=0,Z;W<q;W++)Z=this.readByte(),Z===N.CT.LUA_TNIL?J.k.push(new P.TValue(N.CT.LUA_TNIL,null)):Z===N.CT.LUA_TBOOLEAN?J.k.push(new P.TValue(N.CT.LUA_TBOOLEAN,this.readByte())):Z===N.CT.LUA_TNUMFLT?J.k.push(new P.TValue(N.CT.LUA_TNUMFLT,this.readNumber())):Z===N.CT.LUA_TNUMINT?J.k.push(new P.TValue(N.CT.LUA_TNUMINT,this.readInteger())):Z===N.CT.LUA_TSHRSTR||Z===N.CT.LUA_TLNGSTR?J.k.push(new P.TValue(N.CT.LUA_TLNGSTR,this.readString())):this.error(`unrecognized constant '${Z}'`)}readProtos(J){let q=this.readInt();for(let W=0;W<q;W++)J.p[W]=new M.Proto(this.L),this.readFunction(J.p[W],J.source)}readDebug(J){let q=this.readInt();for(let W=0;W<q;W++)J.lineinfo[W]=this.readInt();q=this.readInt();for(let W=0;W<q;W++)J.locvars[W]={varname:this.readString(),startpc:this.readInt(),endpc:this.readInt()};q=this.readInt();for(let W=0;W<q;W++)J.upvalues[W].name=this.readString()}readFunction(J,q){J.source=this.readString(),null===J.source&&(J.source=q),J.linedefined=this.readInt(),J.lastlinedefined=this.readInt(),J.numparams=this.readByte(),J.is_vararg=this.readByte(),J.maxstacksize=this.readByte(),this.readCode(J),this.readConstants(J),this.readUpvalues(J),this.readProtos(J),this.readDebug(J)}checkliteral(J,q){let W=this.read(J.length);W.join()!==J.join()&&this.error(q)}checkHeader(){this.checkliteral(N.to_luastring(N.LUA_SIGNATURE.substring(1)),'not a'),83!==this.readByte()&&this.error('version mismatch in'),0!==this.readByte()&&this.error('format mismatch in'),this.checkliteral(F,'corrupted'),this.intSize=this.readByte(),this.size_tSize=this.readByte(),this.instructionSize=this.readByte(),this.integerSize=this.readByte(),this.numberSize=this.readByte(),this.checksize(this.intSize,4,'int'),this.checksize(this.size_tSize,8,'size_t'),this.checksize(this.instructionSize,4,'instruction'),this.checksize(this.integerSize,4,'integer'),this.checksize(this.numberSize,8,'number'),22136!==this.readInteger()&&this.error('endianness mismatch in'),370.5!==this.readNumber()&&this.error('float format mismatch in')}error(J){P.luaO_pushfstring(this.L,N.to_luastring('%s: %s precompiled chunk'),this.name,N.to_luastring(J)),I.luaD_throw(this.L,N.thread_status.LUA_ERRSYNTAX)}checksize(J,q,W){J!==q&&this.error(`${W} size mismatch in`)}}T.exports.luaU_undump=function(J,q,W){let Z=new H(J,q,W);Z.checkHeader();let Q=M.luaF_newLclosure(J,Z.readByte());return J.stack[J.top++]=new P.TValue(N.CT.LUA_TLCL,Q),Q.p=new M.Proto(J),Z.readFunction(Q.p,null),E(Q.nupvalues===Q.p.upvalues.length),Q}},function(){}]); \ No newline at end of file