ace.define("ace/mode/lua",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/lua_highlight_rules","ace/mode/folding/lua","ace/range"],function(e,t,n){var r=e("../lib/oop");var i=e("./text").Mode;var s=e("../tokenizer").Tokenizer;var o=e("./lua_highlight_rules").LuaHighlightRules;var u=e("./folding/lua").FoldMode;var a=e("../range").Range;var f=function(){this.$tokenizer=new s((new o).getRules()),this.foldingRules=new u};r.inherits(f,i),function(){function n$$0(t){var n=
0;for(var r in t){var i=t[r];i.type=="keyword"?i.value in e$$0&&(n+=e$$0[i.value]):i.type=="paren.lparen"?n++:i.type=="paren.rparen"&&n--}return n<0?-1:n>0?1:0}var e$$0={"function":1,then:1,"do":1,"else":1,elseif:1,repeat:1,end:-1,until:-1};var t$$0=["else","elseif","end","until"];this.getNextLineIndent=function(e,t,r){var i=this.$getIndent(t);var s=0;var o=this.$tokenizer.getLineTokens(t,e);var u=o.tokens;return e=="start"&&(s=n$$0(u)),s>0?i+r:s<0&&i.substr(i.length-r.length)==r&&!this.checkOutdent(e,
t,"\n")?i.substr(0,i.length-r.length):i},this.checkOutdent=function(e,n,r){if(r!="\n"&&r!="\r"&&r!="\r\n")return!1;if(n.match(/^\s*[\)\}\]]$/))return!0;var i=this.$tokenizer.getLineTokens(n.trim(),e).tokens;return!i||!i.length?!1:i[0].type=="keyword"&&t$$0.indexOf(i[0].value)!=-1},this.autoOutdent=function(e,t,r){var i=t.getLine(r-1);var s=this.$getIndent(i).length;var o=this.$tokenizer.getLineTokens(i,"start").tokens;var u=t.getTabString().length;var f=s+u*n$$0(o);var l=this.$getIndent(t.getLine(r)).length;
if(l<f)return;t.outdentRows(new a(r,0,r+2,0))}}.call(f.prototype),t.Mode=f}),ace.define("ace/mode/lua_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e$$1,t$$1,n$$1){var r$$1=e$$1("../lib/oop");var i$$1=e$$1("./text_highlight_rules").TextHighlightRules;var s$$1=function(){var e$$0="break|do|else|elseif|end|for|function|if|in|local|repeat|return|then|until|while|or|and|not";var t$$0="true|false|nil|_G|_VERSION";var n$$0="string|xpcall|package|tostring|print|os|unpack|require|getfenv|setmetatable|next|assert|tonumber|io|rawequal|collectgarbage|getmetatable|module|rawset|math|debug|pcall|table|newproxy|type|coroutine|_G|select|gcinfo|pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|load|error|loadfile|sub|upper|len|gfind|rep|find|match|char|dump|gmatch|reverse|byte|format|gsub|lower|preload|loadlib|loaded|loaders|cpath|config|path|seeall|exit|setlocale|date|getenv|difftime|remove|time|clock|tmpname|rename|execute|lines|write|close|flush|open|output|type|read|stderr|stdin|input|stdout|popen|tmpfile|log|max|acos|huge|ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|gethook|setmetatable|setlocal|traceback|setfenv|getinfo|setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|foreachi|maxn|foreach|concat|sort|remove|resume|yield|status|wrap|create|running|__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber";
var r$$0="string|package|os|io|math|debug|table|coroutine";var i$$0="";var s$$0="setn|foreach|foreachi|gcinfo|log10|maxn";var o=this.createKeywordMapper({keyword:e$$0,"support.function":n$$0,"invalid.deprecated":s$$0,"constant.library":r$$0,"constant.language":t$$0,"invalid.illegal":i$$0,"variable.language":"this"},"identifier");var u="";var a="(?:(?:[1-9]\\d*)|(?:0))";var f="(?:0[xX][\\dA-Fa-f]+)";var l="(?:"+a+"|"+f+")";var c="(?:\\.\\d+)";var h="(?:\\d+)";var p="(?:(?:"+h+"?"+c+")|(?:"+h+"\\.))";
var d="(?:"+p+")";var v=[];this.$rules={start:[{token:"comment",regex:u+"\\-\\-\\[\\[.*\\]\\]"},{token:"comment",regex:u+"\\-\\-\\[\\=\\[.*\\]\\=\\]"},{token:"comment",regex:u+"\\-\\-\\[\\={2}\\[.*\\]\\={2}\\]"},{token:"comment",regex:u+"\\-\\-\\[\\={3}\\[.*\\]\\={3}\\]"},{token:"comment",regex:u+"\\-\\-\\[\\={4}\\[.*\\]\\={4}\\]"},{token:"comment",regex:u+"\\-\\-\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]"},{token:"comment",regex:u+"\\-\\-\\[\\[.*$",merge:!0,next:"qcomment"},{token:"comment",regex:u+"\\-\\-\\[\\=\\[.*$",
merge:!0,next:"qcomment1"},{token:"comment",regex:u+"\\-\\-\\[\\={2}\\[.*$",merge:!0,next:"qcomment2"},{token:"comment",regex:u+"\\-\\-\\[\\={3}\\[.*$",merge:!0,next:"qcomment3"},{token:"comment",regex:u+"\\-\\-\\[\\={4}\\[.*$",merge:!0,next:"qcomment4"},{token:function(e){var t=/\-\-\[(\=+)\[/;var n;return(n=t.exec(e))!=null&&(n=n[1])!=undefined&&v.push(n.length),"comment"},regex:u+"\\-\\-\\[\\={5}\\=*\\[.*$",merge:!0,next:"qcomment5"},{token:"comment",regex:"\\-\\-.*$"},{token:"string",regex:u+
"\\[\\[.*\\]\\]"},{token:"string",regex:u+"\\[\\=\\[.*\\]\\=\\]"},{token:"string",regex:u+"\\[\\={2}\\[.*\\]\\={2}\\]"},{token:"string",regex:u+"\\[\\={3}\\[.*\\]\\={3}\\]"},{token:"string",regex:u+"\\[\\={4}\\[.*\\]\\={4}\\]"},{token:"string",regex:u+"\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]"},{token:"string",regex:u+"\\[\\[.*$",merge:!0,next:"qstring"},{token:"string",regex:u+"\\[\\=\\[.*$",merge:!0,next:"qstring1"},{token:"string",regex:u+"\\[\\={2}\\[.*$",merge:!0,next:"qstring2"},{token:"string",regex:u+
"\\[\\={3}\\[.*$",merge:!0,next:"qstring3"},{token:"string",regex:u+"\\[\\={4}\\[.*$",merge:!0,next:"qstring4"},{token:function(e){var t=/\[(\=+)\[/;var n;return(n=t.exec(e))!=null&&(n=n[1])!=undefined&&v.push(n.length),"string"},regex:u+"\\[\\={5}\\=*\\[.*$",merge:!0,next:"qstring5"},{token:"string",regex:u+'"(?:[^\\\\]|\\\\.)*?"'},{token:"string",regex:u+"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:d},{token:"constant.numeric",regex:l+"\\b"},{token:o,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},
{token:"keyword.operator",regex:"\\+|\\-|\\*|\\/|%|\\#|\\^|~|<|>|<=|=>|==|~=|=|\\:|\\.\\.\\.|\\.\\."},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qcomment:[{token:"comment",regex:"(?:[^\\\\]|\\\\.)*?\\]\\]",next:"start"},{token:"comment",merge:!0,regex:".+"}],qcomment1:[{token:"comment",regex:"(?:[^\\\\]|\\\\.)*?\\]\\=\\]",next:"start"},{token:"comment",merge:!0,regex:".+"}],qcomment2:[{token:"comment",regex:"(?:[^\\\\]|\\\\.)*?\\]\\={2}\\]",
next:"start"},{token:"comment",merge:!0,regex:".+"}],qcomment3:[{token:"comment",regex:"(?:[^\\\\]|\\\\.)*?\\]\\={3}\\]",next:"start"},{token:"comment",merge:!0,regex:".+"}],qcomment4:[{token:"comment",regex:"(?:[^\\\\]|\\\\.)*?\\]\\={4}\\]",next:"start"},{token:"comment",merge:!0,regex:".+"}],qcomment5:[{token:function(e){var t=/\](\=+)\]/;var n=this.rules.qcomment5[0];var r;n.next="start";if((r=t.exec(e))!=null&&(r=r[1])!=undefined){var i=r.length;var s;(s=v.pop())!=i&&(v.push(s),n.next="qcomment5")}return"comment"},
regex:"(?:[^\\\\]|\\\\.)*?\\]\\={5}\\=*\\]",next:"start"},{token:"comment",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?\\]\\]",next:"start"},{token:"string",merge:!0,regex:".+"}],qstring1:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?\\]\\=\\]",next:"start"},{token:"string",merge:!0,regex:".+"}],qstring2:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?\\]\\={2}\\]",next:"start"},{token:"string",merge:!0,regex:".+"}],qstring3:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?\\]\\={3}\\]",
next:"start"},{token:"string",merge:!0,regex:".+"}],qstring4:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?\\]\\={4}\\]",next:"start"},{token:"string",merge:!0,regex:".+"}],qstring5:[{token:function(e){var t=/\](\=+)\]/;var n=this.rules.qstring5[0];var r;n.next="start";if((r=t.exec(e))!=null&&(r=r[1])!=undefined){var i=r.length;var s;(s=v.pop())!=i&&(v.push(s),n.next="qstring5")}return"string"},regex:"(?:[^\\\\]|\\\\.)*?\\]\\={5}\\=*\\]",next:"start"},{token:"string",merge:!0,regex:".+"}]}};r$$1.inherits(s$$1,
i$$1),t$$1.LuaHighlightRules=s$$1}),ace.define("ace/mode/folding/lua",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"],function(e$$0,t$$0,n$$0){var r$$0=e$$0("../../lib/oop");var i$$0=e$$0("./fold_mode").FoldMode;var s$$0=e$$0("../../range").Range;var o$$0=e$$0("ace/token_iterator").TokenIterator;var u$$0=t$$0.FoldMode=function(){};r$$0.inherits(u$$0,i$$0),function(){this.foldingStartMarker=/\b(function|then|do|repeat)\b|{\s*$|(\[=*\[)/,this.foldingStopMarker=
/\bend\b|^\s*}|\]=*\]/,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);var i=this.foldingStartMarker.test(r);var s=this.foldingStopMarker.test(r);if(i&&!s){var o=r.match(this.foldingStartMarker);if(o[1]=="then"&&/\belseif\b/.test(r))return;if(o[1]){if(e.getTokenAt(n,o.index+1).type==="keyword")return"start"}else{if(!o[2])return"start";var u=e.bgTokenizer.getState(n)||"";if(u.indexOf("comment")!=-1||u.indexOf("string")!=-1)return"start"}}if(t!="markbeginend"||!s||i&&s)return"";o=r.match(this.foldingStopMarker);
if(o[0]==="end"){if(e.getTokenAt(n,o.index+1).type==="keyword")return"end"}else{if(o[0][0]!=="]")return"end";u=e.bgTokenizer.getState(n-1)||"";if(u.indexOf("comment")!=-1||u.indexOf("string")!=-1)return"end"}},this.getFoldWidgetRange=function(e,t,n){var r=e.doc.getLine(n);var i=this.foldingStartMarker.exec(r);if(i)return i[1]?this.luaBlock(e,n,i.index+1):i[2]?e.getCommentFoldRange(n,i.index+1):this.openingBracketBlock(e,"{",n,i.index);i=this.foldingStopMarker.exec(r);if(i)return i[0]==="end"&&e.getTokenAt(n,
i.index+1).type==="keyword"?this.luaBlock(e,n,i.index+1):i[0][0]==="]"?e.getCommentFoldRange(n,i.index+1):this.closingBracketBlock(e,"}",n,i.index+i[0].length)},this.luaBlock=function(e,t,n){var r=new o$$0(e,t,n);var i={"function":1,"do":1,then:1,elseif:-1,end:-1,repeat:1,until:-1};var u=r.getCurrentToken();if(!u||u.type!="keyword")return;var a=u.value;var f=[a];var l=i[a];if(!l)return;var c=l===-1?r.getCurrentTokenColumn():e.getLine(t).length;var h=t;for(r.step=l===-1?r.stepBackward:r.stepForward;u=
r.step();){if(u.type!=="keyword")continue;var p=l*i[u.value];if(p>0)f.unshift(u.value);else if(p<=0){f.shift();if(!f.length&&u.value!="elseif")break;p===0&&f.unshift(u.value)}}t=r.getCurrentTokenRow();return l===-1?new s$$0(t,e.getLine(t).length,h,c):new s$$0(h,c,t,r.getCurrentTokenColumn())}}.call(u$$0.prototype)});