define("mixins/token_iterator",["require","exports","module"],function(a,k,n){var g=a("ace/token_iterator").TokenIterator,l=a("ace/range").Range;(function(){function a(b,a){return 1===b.length&&("{"===b||"("===b||"["===b||!!a&&"<"===b)}function f(b,a){return 1===b.length&&("}"===b||")"===b||"]"===b||!!a&&">"===b)}function e(b,a,d,e,c){for(var m=1,q,p=b.clone();q=d.call(p);)if(q=a(q),q===c){if(m--,0===m)return b.moveToTokenIterator(p),!0}else q===e&&m++;return!1}var b={"(":")","{":"}","[":"]","<":">",
")":"(","}":"{","]":"[",">":"<"};this.moveToPreviousToken=function(){var b=this.$rowTokens,a=this.$tokenIndex-1;if(0<=a)return this.$tokenIndex--,b[a];a=this.$session;var d=this.$row;if(0>d)return null;for(;;){d--;if(0>d)return null;if((b=a.getTokens(d))&&b.length)return this.$row=d,this.$tokenIndex=b.length-1,this.$rowTokens=b,b[b.length-1]}};this.moveToNextToken=function(){var b=this.$rowTokens,a=this.$tokenIndex+1;if(a<b.length)return this.$tokenIndex++,b[a];a=this.$session;var d=a.getLength(),
e=this.$row;if(e>=d)return null;for(;;){e++;if(e>=d)return null;if((b=a.getTokens(e))&&b.length)return this.$row=e,this.$tokenIndex=0,this.$rowTokens=b,b[0]}};this.moveToNextSignificantToken=function(){if(!this.moveToNextToken())return!1;for(var b=this.getCurrentToken();/^\s+$/.test(b.value)||/\bcomment\b/.test(b.type);){if(!this.moveToNextToken())return!1;b=this.getCurrentToken()}return!0};this.moveToPreviousSignificantToken=function(){if(!this.moveToPreviousToken())return!1;for(var b=this.getCurrentToken();/^\s+$/.test(b.value)||
/\bcomment\b/.test(b.type);){if(!this.moveToPreviousToken())return!1;b=this.getCurrentToken()}return!0};this.moveToStartOfRow=function(){this.$tokenIndex=0;return this.getCurrentToken()};this.moveToEndOfRow=function(){this.$tokenIndex=this.$rowTokens.length-1;return this.getCurrentToken()};this.moveToStartOfNextRowWithTokens=function(){for(var b=this.$row,a=this.$session,d=a.getLength();;){b++;if(b>=d)return null;var e=a.getTokens(b);if(e&&e.length)return this.$row=b,this.$tokenIndex=0,this.$rowTokens=
e,this.getCurrentToken()}};var c,d=0,r=0;this.tokenizeUpToRow=function(b){var a=this.$session.bgTokenizer;d=Math.min(d,a.currentLine);r=Math.max(r,b);for(var e=a.currentLine;e<=b;e++)a.$tokenizeRow(e);clearTimeout(c);c=setTimeout(function(){a.fireUpdateEvent(d,r);d=r;r=0},700)};this.moveToPosition=function(b,a){this.tokenizeUpToRow(b.row);var d=this.$session.getTokenAt(b.row,b.column);d&&a&&d.column<b.column&&(d=this.$session.getTokenAt(b.row,b.column+1));if(null==d){if(a)return this.$row=b.row,this.$rowTokens=
this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1,this.moveToNextToken();this.$row=b.row+1;this.$tokenIndex=0;this.$rowTokens=this.$session.getTokens(this.$row);return this.moveToPreviousToken()}this.$row=b.row;this.$rowTokens=this.$session.getTokens(this.$row);this.$tokenIndex=d.index;return this.getCurrentToken()};this.clone=function(){var b=new g(this.$session,0,0);b.moveToTokenIterator(this);return b};this.moveToTokenIterator=function(b){for(var a in b)b.hasOwnProperty(a)&&
(this[a]=b[a])};this.peekFwd=function(b){for(var a=this.clone(),d=null,e=0;e<b;e++)d=a.moveToNextToken();return d};this.peekBwd=function(b){for(var a=this.clone(),d=null,e=0;e<b;e++)d=a.moveToPreviousToken();return d};this.getCurrentToken=function(){var b=this.$rowTokens[this.$tokenIndex];b&&(b.row=this.$row);return b};this.getCurrentTokenValue=function(){return this.getCurrentToken().value};this.getCurrentTokenPosition=function(){return{row:this.getCurrentTokenRow(),column:this.getCurrentTokenColumn()}};
this.getCurrentTokenRange=function(){var b=this.getCurrentTokenPosition(),a={row:b.row,column:b.column+this.getCurrentToken().value.length};return l.fromPoints(b,a)};this.fwdToMatchingToken=function(){var d=this.getCurrentToken();return a(d.value,!0)?e(this,function(b){return b.value},this.moveToNextToken,d.value,b[d.value]):"support.function.codebegin"===d.type?e(this,function(b){return b.type},this.moveToNextToken,"support.function.codebegin","support.function.codeend"):!1};this.bwdToMatchingToken=
function(){var a=this.getCurrentToken();return f(a.value,!0)?e(this,function(b){return b.value},this.moveToPreviousToken,a.value,b[a.value]):"support.function.codeend"===a.type?e(this,function(b){return b.type},this.moveToPreviousToken,"support.function.codeend","support.function.codebegin"):!1};this.findTokenValueBwd=function(b,a){a=!!a;do if(!(a&&this.bwdToMatchingToken()||this.getCurrentToken().value!==b))return!0;while(this.moveToPreviousToken());return!1};this.findTokenValueFwd=function(b,a){a=
!!a;do if(!(a&&this.fwdToMatchingToken()||this.getCurrentToken().value!==b))return!0;while(this.moveToNextToken());return!1};this.findTokenTypeBwd=function(b,a){a=!!a;do if(!(a&&this.bwdToMatchingToken()||this.getCurrentToken().type!==b))return!0;while(this.moveToPreviousToken());return!1};this.findTokenTypeFwd=function(b,a){a=!!a;do if(!(a&&this.fwdToMatchingToken()||this.getCurrentToken().type!==b))return!0;while(this.moveToNextToken());return!1}}).call(g.prototype)});define("ace/token_tooltip",["require","exports","module"],function(a,k,n){function g(a){a.tokenTooltip||(f.call(this,a.container),a.tokenTooltip=this,this.editor=a,this.update=this.update.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),l.addListener(a.renderer.scroller,"mousemove",this.onMouseMove),l.addListener(a.renderer.content,"mouseout",this.onMouseOut))}a("ace/lib/dom");n=a("ace/lib/oop");var l=a("ace/lib/event"),h=a("ace/range").Range,f=a("ace/tooltip").Tooltip;
n.inherits(g,f);(function(){this.token={};this.range=new h;this.update=function(){this.$timer=null;var a=this.editor.renderer;1E3<this.lastT-(a.timeStamp||0)&&(a.rect=null,a.timeStamp=this.lastT,this.maxHeight=window.innerHeight,this.maxWidth=window.innerWidth);var b=a.rect||(a.rect=a.scroller.getBoundingClientRect()),c=this.editor.session;a=c.screenToDocumentPosition(Math.floor((this.y+a.scrollTop-b.top)/a.lineHeight),Math.round((this.x+a.scrollLeft-b.left-a.$padding)/a.characterWidth));(b=c.getTokenAt(a.row,
a.column))||c.getLine(a.row)||(b={type:"",value:"",state:c.bgTokenizer.getState(0)});if(b){var d=b.type;b.state&&(d+="|"+b.state);b.merge&&(d+="\n  merge");b.stateTransitions&&(d+="\n  "+b.stateTransitions.join("\n  "));this.tokenText!=d&&(this.setText(d),this.width=this.getWidth(),this.height=this.getHeight(),this.tokenText=d);this.show(null,this.x,this.y);this.token=b;c.removeMarker(this.marker);this.range=new h(a.row,b.start,a.row,b.start+b.value.length);this.marker=c.addMarker(this.range,"ace_bracket",
"text")}else c.removeMarker(this.marker),this.hide()};this.onMouseMove=function(a){this.x=a.clientX;this.y=a.clientY;this.isOpen&&(this.lastT=a.timeStamp,this.setPosition(this.x,this.y));this.$timer||(this.$timer=setTimeout(this.update,100))};this.onMouseOut=function(a){a&&a.currentTarget.contains(a.relatedTarget)||(this.hide(),this.editor.session.removeMarker(this.marker),this.$timer=clearTimeout(this.$timer))};this.setPosition=function(a,b){a+10+this.width>this.maxWidth&&(a=window.innerWidth-this.width-
10);if(b>.75*window.innerHeight||b+20+this.height>this.maxHeight)b=b-this.height-30;f.prototype.setPosition.call(this,a+10,b+20)};this.destroy=function(){this.onMouseOut();l.removeListener(this.editor.renderer.scroller,"mousemove",this.onMouseMove);l.removeListener(this.editor.renderer.content,"mouseout",this.onMouseOut);delete this.editor.tokenTooltip}}).call(g.prototype);k.TokenTooltip=g});define("mode/auto_brace_insert",["require","exports","module"],function(a,k,n){var g=a("ace/range").Range,l=a("ace/mode/text").Mode;(function(){this.$complements={"(":")","[":"]",'"':'"',"{":"}"};this.$reOpen=/^[(["{]$/;this.$reClose=/^[)\]"}]$/;this.$reStop=/^[;,\s)\]}]$/;this.wrapInsert=function(a,f,e,b){if(!this.insertMatching)return f.call(a,e,b);var c=a.selection.getCursor();if(c=a.selection.isEmpty()&&e.row==c.row&&e.column==c.column){var d=g.fromPoints(e,{row:e.row,column:e.column+1}),h=a.doc.getTextRange(d);
if(this.$reClose.test(h)&&h==b){a.selection.moveCursorTo(d.end.row,d.end.column,!1);return}}d=null;c&&(d=this.$moveLeft(a.doc,e),d=a.doc.getTextRange(g.fromPoints(d,e)));f=f.call(a,e,b);c&&this.$reOpen.test(b)?(e=g.fromPoints(f,{row:f.row,column:f.column+1}),e=a.doc.getTextRange(e),(this.$reStop.test(e)||0==e.length)&&this.allowAutoInsert(a,f,this.$complements[b])&&(a.doc.insert(f,this.$complements[b]),a.selection.moveCursorTo(f.row,f.column,!1))):c&&"\n"===b&&(b=this.$moveRight(a.doc,f),b=a.doc.getTextRange(g.fromPoints(f,
b)),c=d,b=(d=a.getTokenAt(e.row,e.column-1))&&"function"===d.value?!1:"{"===c&&"}"===b||"("===c&&")"===b||"["===c&&"]"===b,b&&(e=this.getIndentForOpenBrace?this.getIndentForOpenBrace(this.$moveLeft(a.doc,e)):this.$getIndent(a.doc.getLine(f.row-1)),a.doc.insert(f,"\n"+e),a.selection.moveCursorTo(f.row,f.column,!1)));return f};this.allowAutoInsert=function(a,f,e){return!0};this.smartAllowAutoInsert=function(a,f,e){return"'"!==e&&'"'!==e&&"`"!==e?!0:"`"===e?(f=a.doc.getTextRange({start:{row:f.row,column:0},
end:f}),f=f.replace(/\\./g,""),0!=f.match(/`/g).length%2):0==f.column?!0:(a=this.codeModel.getTokenForPos(f,!1,!0))&&"string"===a.type&&a.column===f.column-1};this.wrapRemove=function(a,f,e){var b=a.selection.getCursor(),c=a.session.getDocument();if(!this.insertMatching||"left"!=e||!a.selection.isEmpty()||a.$readOnly||0==b.column||c.getLine(b.row).length<=b.column)return f.call(a,e);var d=g.fromPoints(this.$moveLeft(c,b),b);b=g.fromPoints(b,this.$moveRight(c,b));d=c.getTextRange(d);c=this.$reOpen.test(d)&&
this.$complements[d]==c.getTextRange(b);f.call(a,e);c&&f.call(a,"right")};this.$moveLeft=function(a,f){if(0==f.row&&0==f.column)return f;var e=f.row,b=f.column;b?b--:(e--,b=a.getLine(e).length);return{row:e,column:b}};this.$moveRight=function(a,f){var e=f.row,b=f.column;a.getLine(e).length!=b?b++:(e++,b=0);return e>=a.getLength()?f:{row:e,column:b}}}).call(l.prototype);k.setInsertMatching=function(a){l.prototype.insertMatching=a}});define("mode/c_cpp",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("ace/tokenizer").Tokenizer,h=a("ace/range").Range;a("mode/r_highlight_rules");var f=a("mode/c_cpp_highlight_rules").c_cppHighlightRules,e=a("mode/c_cpp_matching_brace_outdent").CppMatchingBraceOutdent,b=a("mode/behaviour/cstyle").CStyleBehaviour,c=null;window.NodeWebkit||(c=a("mode/c_cpp_fold_mode").FoldMode);var d=a("mode/r_code_model").RCodeModel,r=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,
q=a("mode/cpp_code_model").CppCodeModel;a("mode/token_cursor");var p=a("mode/utils");a=function(a,p){this.$session=p;this.$doc=p.getDocument();this.$tokenizer=new l((new f).getRules());this.r_codeModel=new d(p,this.$tokenizer,/^r-/,/^\s*\/\*{3,}\s*([Rr])\s*$/,/^\s*\*+\//);this.$r_outdent=new r(this.r_codeModel);this.codeModel=new q(p,this.$tokenizer);this.$behaviour=new b(this.codeModel);this.$cpp_outdent=new e(this.codeModel);window.NodeWebkit||(this.foldingRules=new c);this.$tokens=this.codeModel.$tokens;
this.getLineSansComments=this.codeModel.getLineSansComments};n.inherits(a,g);(function(){this.wrapInsert=function(a,b,d,e){return this.cursorInRLanguageMode()?g.prototype.wrapInsert(a,b,d,e):b.call(a,d,e)};this.wrapRemove=function(a,b,d){return this.cursorInRLanguageMode()?g.prototype.wrapRemove(a,b,d):b.call(a,d)};this.insertChunkInfo={value:"/*** R\n\n*/\n",position:{row:1,column:0},content_position:{row:1,column:0}};this.toggleCommentLines=function(a,b,d,e){var c=!0;a=/^(\s*)\/\//;for(var m=d;m<=
e;m++)if(!a.test(b.getLine(m))){c=!1;break}if(c)for(c=new h(0,0,0,0),m=d;m<=e;m++)d=b.getLine(m).match(a),c.start.row=m,c.end.row=m,c.end.column=d[0].length,b.replace(c,d[1]);else b.indentRows(d,e,"//")};this.getLanguageMode=function(a){return p.getPrimaryState(this.$session,a.row).match(/^r-/)?"R":"C_CPP"};this.cursorInRLanguageMode=function(){return"R"===this.getLanguageMode(this.$session.getSelection().getCursor())};this.inRLanguageMode=function(a){if(!a)return null;"object"===typeof a&&a.hasOwnProperty("length")&&
0<a.length&&(a=a[0]);return a.match(/^r-/)};this.getNextLineIndent=function(a,b,d,e,c){a=p.primaryState(a);return this.inRLanguageMode(a)?this.r_codeModel.getNextLineIndent(a,b,d,e):this.codeModel.getNextLineIndent(a,b,d,e,c)};this.checkOutdent=function(a,b,d){return this.inRLanguageMode(a)?this.$r_outdent.checkOutdent(a,b,d):this.$cpp_outdent.checkOutdent(a,b,d)};this.autoOutdent=function(a,b,d){return this.inRLanguageMode(a)?this.$r_outdent.autoOutdent(a,b,d,this.r_codeModel):this.$cpp_outdent.autoOutdent(a,
b,d)};this.$transformAction=this.transformAction;this.transformAction=function(a,b,d,e,c){a=p.primaryState(a);if(!this.inRLanguageMode(a))return this.$transformAction(a,b,d,e,c)};this.$id="mode/c_cpp"}).call(a.prototype);k.Mode=a});define("mode/c_cpp_fold_mode",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/range").Range;a=a("ace/mode/folding/fold_mode").FoldMode;k=k.FoldMode=function(){};n.inherits(k,a);(function(){function a(a,e,d,f){a=a.doc.$lines;for(var b=e+f,c=a[b],m=0<f?"*/":"/*",h;null!=c;){var r=c.indexOf(m);if(-1!==r){h=0<f?new g(e,d,b,r):new g(b,c.length,e,d);break}b+=f;c=a[b]}return h}function h(a,e,d,f,q){for(var b=e+q,c=a.doc.$lines;0<=b&&b<a.getLength();){for(var h=a.getTokens(b),
r=c[b],l=0;l<h.length;l++)if(h[l].type===f)return 0<q?new g(e,d,b,0):new g(b,r.length,e,d);b+=q}}var f=/(\{|\[)[^\}\]]*$/,e=/^[^\[\{]*(\}|\])/;this.getFoldWidget=function(a,c,d){c="markbeginend"===c?"end":"";d=a.getLine(d);if(f.test(d))return"start";if(e.test(d))return c;a=d.indexOf("/*");d=d.indexOf("*/");return-1!==a&&(-1===d||a>d)?"start":-1!==d&&(-1===a||d<a)?c:""};this.getFoldWidgetRange=function(b,c,d){var g=b.getLine(d),q;if(q=g.match(f))return this.openingBracketBlock(b,q[1],d,q.index);if(q=
"markbeginend"===c&&g.match(e))return this.closingBracketBlock(b,q[1],d,q.index+q[0].length);c=b.getTokens(d);for(q=0;q<c.length;q++){var p=c[q];if("support.function.codebegin"===p.type)return h(b,d,g.length,"support.function.codeend",1);if("support.function.codeend"===p.type)return h(b,d,0,"support.function.codebegin",-1)}c=g.indexOf("/*");if(-1!==c)return a(b,d,g.length,1);c=g.indexOf("*/");if(-1!==c)return a(b,d,c,-1)}}).call(k.prototype)});define("mode/c_cpp_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/lib/lang"),l=a("mode/doc_comment_highlight_rules").DocCommentHighlightRules,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/tex_highlight_rules").TexHighlightRules,e=a("mode/r_highlight_rules").RHighlightRules,b=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules;a=function(){function a(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}
var d=g.arrayToMap("alignas alignof and and_eq asm auto bitand bitor bool break case catch char char16_t char32_t class compl const constexpr const_cast continue decltype default delete do double dynamic_cast else enum explicit export extern false float for friend goto if inline int in long mutable namespace new noexcept not not_eq nullptr or or_eq private protected public register reinterpret_cast return short signed sizeof sizeof... static static_assert static_cast struct switch template this thread_local throw true try typedef typeid typeof typename union unsigned using virtual void volatile wchar_t while xor xor_eq".split(" ")),
h=g.arrayToMap(["NULL"]),q="new delete >>= <<= ->* ... << >> && || == != <= >= :: *= += -= /= ++ -- &= ^= %= -> .* ! $ & | + - * / ^ ~ = %".split(" "),p=q.map(function(b){return a(b)}).join("|");q=["->*"].concat(q).concat("< > , () [] ->".split(" ")).map(function(b){return a(b)});q=["new\\s*\\[\\]","delete\\s*\\[\\]"].concat(q);q="operator\\s*(?:"+q.join("|")+")|operator\\s+[\\w_]+(?:&&|&|\\*)?";this.$rules={start:[{token:"comment.doc.tag",regex:"\\/\\/\\s*\\[\\[.*\\]\\].*$"},{token:"comment.doc.tag",
regex:"^\\s*\\[\\[(.*)\\]\\]"},{token:"comment",regex:"\\/\\/'",next:"rdoc-start"},{token:"comment",regex:"\\/\\/.*$"},l.getStartRule("doc-start"),{token:"comment",merge:!0,regex:"\\/\\*",next:"comment"},{token:"string",regex:'(?:R|L|u8|u|U)?["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",merge:!0,regex:'(?:R|L|u8|u|U)?["].*\\\\$',next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"string",merge:!0,regex:"['].*\\\\$",next:"qstring"},{token:"constant.numeric",
regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"0[bB][01']+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:(?:[fF])|(?:(?:[uU]?(?:(?:l?l?)|(?:L?L?))?)|(?:(?:(?:l?l?)|(?:L?L?))[uU]?))|(?:_\\w+))?\\b"},{token:"keyword.preproc",regex:"#\\s*include\\b",next:"include"},{token:"keyword.preproc",regex:"(?:"+"include pragma line define defined undef ifdef ifndef if else elif endif warning error".split(" ").map(function(a){return"#\\s*"+a+"\\b"}).join("|")+
")"},{token:"variable.language",regex:"\\b__\\S+__\\b"},{token:"keyword",regex:q},{token:function(a){return"this"==a?"variable.language":d.hasOwnProperty(a)?"keyword":h.hasOwnProperty(a)?"constant.language":"identifier"},regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",merge:!1,regex:p},{token:"keyword.punctuation.operator",merge:!1,regex:"\\?|\\:|\\,|\\;|\\.|\\\\"},b.getParenRule(),{token:"paren.keyword.operator",merge:!1,regex:"[<>]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",
regex:".*?\\*\\/",next:"start"},{token:"comment",merge:!0,regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",merge:!0,regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",merge:!0,regex:".+"}],include:[{token:"string",regex:/<.+>/,next:"start"},{token:"string",regex:/".+"/,next:"start"}]};p=(new f("comment")).getRules();for(q=0;q<p.start.length;q++)p.start[q].token+=".virtual-comment";this.addRules(p,
"rdoc-");this.$rules["rdoc-start"].unshift({token:"text",regex:"^",next:"start"});this.$rules["rdoc-start"].unshift({token:"keyword",regex:"@(?!@)[^ ]*"});this.$rules["rdoc-start"].unshift({token:"comment",regex:"@@"});this.$rules["rdoc-start"].push({token:"comment",regex:"[^%\\\\[({\\])}]+"});this.embedRules(l,"doc-",[l.getEndRule("start")]);this.$rules.start.unshift({token:"support.function.codebegin",regex:"^\\s*\\/\\*{3,}\\s*[Rr]\\s*$",next:"r-start"});p=(new e).getRules();this.addRules(p,"r-");
this.$rules["r-start"].unshift({token:"support.function.codeend",regex:"\\*\\/",next:"start"})};n.inherits(a,h);k.c_cppHighlightRules=a});define("mode/c_cpp_matching_brace_outdent",["require","exports","module"],function(a,k,n){var g=a("ace/range").Range,l=a("mode/token_cursor").CppTokenCursor;n=function(a){this.codeModel=a};var h=a("mode/utils"),f=!0,e=!0,b=!0,c=!0,d=!0,r=!0,q=!0,p=!0,m=!0,w=!0,A=!0,z=!0;(function(){this.setIndent=function(a,b,d,e,c){a=a.getDocument();e="string"===typeof e?e:"";var m=a.$lines[d];d=this.$getIndent(a.$lines[b]);m=this.$getIndent(m);("function"!==typeof c||c(d,m))&&a.replace(new g(b,0,b,d.length),m+e)};
this.checkOutdent=function(a,b,d){return h.endsWith(a,"start")&&(":"===d||/^\s*[#\{\}>\]\)<.:]/.test(d)||"="===d)||h.endsWith(a,"comment")&&"/"==d?!0:!1};this.escapeRegExp=function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};this.alignStartToken=function(a,b,d,e,c){return null===c||null===e?!1:(new RegExp("^\\s*"+this.escapeRegExp(a))).test(e)&&(a=c.indexOf(a),0<=a)?(b=b.getDocument(),e=this.$getIndent(e),a=Array(a+1).join(" "),b.replace(new g(d,0,d,e.length),a),!0):!1};this.alignEquals=
function(a,b,d,e){if(null===e||null===d)return!1;var c=d.indexOf("=");if(c!==d.lastIndexOf("="))return!1;var m=e.indexOf("=");if(-1!==c&&-1!==m&&/,\s*$/.test(e)){a=a.getDocument();d=this.$getIndent(d);if(d.length>=m)return!1;c=m-c;if(0>=c)return!1;c=Array(d.length+c+1).join(" ");a.replace(new g(b,0,b,d.length),c);return!0}return!1};this.autoOutdent=function(a,p,t){a=p.doc;var v=a.getLine(t),u=null;0<t&&(u=a.getLine(t-1));if(!w||!this.alignStartToken("<<",p,t,v,u))if(!m||!this.alignStartToken(">>",
p,t,v,u))if(!q||!this.alignStartToken(".",p,t,v,u)){if(f&&/^\s*:/.test(a.getLine(t))&&!/^\s*::/.test(a.getLine(t))&&this.codeModel.$tokenUtils.$tokenizeUpToRow(t)){var k=new l(this.codeModel.$tokens,t,0),n=-1,x=k.cloneCursor();if(")"===x.peekBwd().currentValue()||"keyword"===x.peekBwd().currentType()){do{k=x.currentType();var E=x.currentValue();if("identifier"===k||";"===E){n=x.$row;break}"keyword"!==k&&x.bwdToMatchingToken()}while(x.moveToPreviousToken())}else k.moveToPreviousToken(),k.bwdOverClassySpecifiers()&&
(n=k.$row);0<=n&&this.setIndent(p,t,n,p.getTabString(),function(a,b){return a===b})}if(r&&/^\s*>/.test(v)&&!/^\s*>>/.test(v)&&(n=this.codeModel.getRowForMatchingEOLArrows(p,a,t),0<=n)){this.setIndent(p,t,n);return}if(c&&/^\s*\}/.test(v)&&(n=p.findMatchingBracket({row:t,column:v.indexOf("}")+1}),null!==n)){if(/^\s*\{/.test(a.$lines[n.row])){this.setIndent(p,t,n.row);return}n=this.codeModel.getRowForOpenBraceIndent(p,n.row);if(0<=n){this.setIndent(p,t,n);return}}if(e&&/^\s*\)/.exec(v)&&(n=p.findMatchingBracket({row:t,
column:v.indexOf(")")+1}))){this.setIndent(p,t,n.row);return}if(d&&/^\s*\]/.exec(v)&&(n=p.findMatchingBracket({row:t,column:v.indexOf("]")+1}))){this.setIndent(p,t,n.row);return}if(A&&/^\s*public\s*:\s*$|^\s*private\s*:\s*$|^\s*protected\s*:\s*$/.test(v)&&(x=p.$findOpeningBracket("}",{row:t,column:v.length},h.getTokenTypeRegex("paren")))){n=this.codeModel.getRowForOpenBraceIndent(p,x.row);0<=n?this.setIndent(p,t,n):this.setIndent(p,t,x.row);return}if(z&&(/^\s*case.+:/.test(v)||/^\s*default\s*:/.test(v))&&
(x=p.$findOpeningBracket("}",{row:t,column:/(\S)/.exec(v).index+1},h.getTokenTypeRegex("paren")))){n=this.codeModel.getRowForOpenBraceIndent(p,x.row);0<=n?this.setIndent(p,t,n):this.setIndent(p,t,x.row);return}if(b&&/^\s*\{/.test(v)&&!/;\s*$/.test(u)){if(this.codeModel.$tokenUtils.$tokenizeUpToRow(t)&&(k=new l(this.codeModel.$tokens),k.$row=t,k.$offset=0,k.moveToPreviousToken()&&"="===k.currentValue()))return;u=this.codeModel.getRowForOpenBraceIndent(p,t);if(0<=u){this.setIndent(p,t,u);return}}/^\s*#/.test(v)&&
(p=this.$getIndent(v),a.replace(new g(t,0,t,p.length),""))}};this.$getIndent=function(a){return(a=a.match(/^(\s+)/))?a[1]:""}}).call(n.prototype);k.CppMatchingBraceOutdent=n;k.getOutdentColon=function(){return f};k.setOutdentColon=function(a){f=a};k.getOutdentRightParen=function(){return e};k.setOutdentRightParen=function(a){e=a};k.getOutdentLeftBrace=function(){return b};k.setOutdentLeftBrace=function(a){b=a};k.getOutdentRightBrace=function(){return c};k.setOutdentRightBrace=function(a){c=a};k.getOutdentRightBracket=
function(){return d};k.setOutdentRightBracket=function(a){d=a};k.getOutdentRightArrow=function(){return r};k.setOutdentRightArrow=function(a){r=a};k.getAlignDots=function(){return q};k.setAlignDots=function(a){q=a};k.getAlignEquals=function(){return p};k.setAlignEquals=function(a){p=a};k.getAlignStreamIn=function(){return m};k.setAlignStreamIn=function(a){m=a};k.getAlignStreamOut=function(){return w};k.setAlignStreamOut=function(a){w=a};k.getAlignClassAccessModifiers=function(){return A};k.setAlignClassAccessModifiers=
function(a){A=a};k.getAlignCase=function(){return z};k.setAlignCase=function(a){z=a}});define("mode/behaviour/cstyle",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/behaviour").Behaviour;a("mode/cpp_code_model");a("mode/token_cursor");a("ace/mode/text");var l=a("mode/utils"),h=!0;a=function(a){var e=a.$complements,b=function(a,b,c,p){var d=e[a];if(b==a)return b=c.getSelectionRange(),p=p.doc.getTextRange(b),""!==p?{text:a+p+d,selection:!1}:{text:a+d,selection:[1,1]};if(b==d&&(a=c.getCursorPosition(),p.doc.getLine(a.row)[a.column]==d&&(">"===d||null!==
p.findMatchingBracket({row:a.row,column:a.column+1}))))return{text:"",selection:[1,1]}},c=function(a,b,c){var d=e[a],m=c.doc.getTextRange(b);if(!b.isMultiLine()&&m==a&&c.doc.getLine(b.start.row).substring(b.start.column+1,b.start.column+2)==d)return b.end.column++,b};this.add("R","insertion",function(a,b,e,c,m){if("R"===m||"r"===m)if(a=e.getCursorPosition(),c=(new String(c.doc.getLine(a.row))).match(/^(\s*)\/\*{3,}\s*/))return{text:"R\n"+c[1]+"\n"+c[1]+"*/",selection:[1,c[1].length,1,c[1].length]}});
this.add("newline","insertion",function(b,e,c,p,m){if("\n"===m){var d=c.getCursorPosition();m=d.row;var f=d.column;e=p.getTabString();var h=p.doc.$lines;c=h[m];if(!this.codeModel.inMacro(h,m-1)){var q=/^(\s*\/\/'\s*)/.exec(c);if(q&&f>=q[1].length)return{text:"\n"+q[1]};if(/^\s*[/][*]+\s*$/.test(c)&&!/^\s*[*]/.test(h[m+1]||""))return p=this.$getIndent(c),e=p+" * ",{text:"\n"+e+"\n"+p+" */",selection:[1,e.length,1,e.length]};if(l.endsWith(b,"comment")||l.endsWith(b,"doc-start")){d&&d.row==m&&(c=c.substring(0,
d.column));if(b=/^(\s*)(\/\*)/.exec(c))return{text:"\n"+b[1]+" * "};if(b=/^(\s*\*+\s*)/.exec(c))return{text:"\n"+b[1],selection:[1,b[1].length,1,b[1].length]}}for(b=f-1;/\s/.test(c[b]);)--b;b=c[b];f=c[f];if(q=c.match(/\s*namespace\s*\w*\s*{/))return p=this.$getIndent(c),{text:"\n"+p,selection:[1,p.length,1,p.length]};if("("==b&&")"==f||"["==b&&"]"==f)return c=this.$getIndent(c),p=c+e,{text:"\n"+p+"\n"+c,selection:[1,p.length,1,p.length]};if("{"==b&&"}"==f){if(/^\s*{/.test(c))return c=this.$getIndent(c),
p=c+p.getTabString(),{text:"\n"+p+"\n"+c,selection:[1,p.length,1,p.length]};m=a.getRowForOpenBraceIndent(p,m);if(null!==m&&0<=m)return c=this.$getIndent(p.getDocument().getLine(m)),p=c+p.getTabString(),{text:"\n"+p+"\n"+c,selection:[1,p.length,1,p.length]};c=this.$getIndent(c);p=c+e;return{text:"\n"+p+"\n"+c,selection:[1,p.length,1,p.length]}}}}});this.add("braces","insertion",function(a,e,c,f,m){if(this.insertMatching){if("{"==m&&(a=c.getSelectionRange(),""===f.doc.getTextRange(a))){a=this.codeModel.getTokenCursor();
if(!a.moveToPosition(c.getCursorPosition()))return b("{",m,c,f);do if(!a.bwdToMatchingArrow()){e=a.currentValue();if(!e||!e.length)break;if("namespace"===e)return{text:"{",selection:[1,1]};if("class"===e||"struct"===e||"="===e)return{text:"{};",selection:[1,1]};if(h&&"do"===e)return{text:"{} while ();",selection:[1,1]};if(";"===e||"["===e||"]"===e||"("===e||")"===e||"{"===e||"}"===e||"if"===e||"else"===e||"#"===e[0])return{text:"{}",selection:[1,1]}}while(a.moveToPreviousToken())}return b("{",m,c,
f)}});this.add("braces","deletion",function(a,b,e,c,m){if(this.insertMatching&&(a=c.doc.getTextRange(m),!m.isMultiLine()&&"{"==a)){a=c.doc.getLine(m.start.row);if(/^\s*do\s*\{\} while \(\);\s*$/.test(a))return m.end.column=a.length,m;c=a.substring(m.end.column,m.end.column+1);a=a.substring(m.end.column+1,m.end.column+2);if("}"==c)return m.end.column++,";"==a&&m.end.column++,m}});this.add("parens","insertion",function(a,e,c,f,m){if(this.insertMatching)return b("(",m,c,f)});this.add("parens","deletion",
function(a,b,e,f,m){if(this.insertMatching)return c("(",m,f)});this.add("brackets","insertion",function(a,e,c,f,m){if(this.insertMatching)return b("[",m,c,f)});this.add("brackets","deletion",function(a,b,e,f,m){if(this.insertMatching)return c("[",m,f)});this.add("arrows","insertion",function(a,e,c,f,m){if(this.insertMatching&&(a=f.getLine(c.getCursorPosition().row),/^\s*#\s*include/.test(a)))return b("<",m,c,f)});this.add("arrows","deletion",function(a,b,e,f,m){if(this.insertMatching)return c("<",
m,f)});this.add("string_dquotes","insertion",function(a,b,e,c,m){if(this.insertMatching&&('"'==m||"'"==m)){a=e.getSelectionRange();b=c.doc.getTextRange(a);if(""!==b)return{text:m+b+m,selection:!1};e=e.getCursorPosition();b=c.doc.getLine(e.row);if("\\"==b.substring(e.column-1,e.column))return null;c=c.getTokens(a.start.row);for(var d=0,f,h=-1,p=0;p<c.length;p++){f=c[p];"string"==f.type?h=-1:0>h&&(h=f.value.indexOf(m));if(f.value.length+d>a.start.column)break;d+=c[p].value.length}if(!f||0>h&&"comment"!==
f.type&&("string"!==f.type||a.start.column!==f.value.length+d-1&&f.value.lastIndexOf(m)===f.value.length-1))return{text:m+m,selection:[1,1]};if(f&&"string"===f.type&&b.substring(e.column,e.column+1)==m)return{text:"",selection:[1,1]}}});this.add("string_dquotes","deletion",function(a,b,e,c,f){if(this.insertMatching&&(a=c.doc.getTextRange(f),!f.isMultiLine()&&('"'==a||"'"==a)&&(c=c.doc.getLine(f.start.row).substring(f.start.column+1,f.start.column+2),'"'===c||"'"===c)))return f.end.column++,f});this.add("punctuation.operator",
"insertion",function(a,b,e,c,f){if(this.insertMatching&&";"===f&&(a=e.selection.getCursor(),";"==c.getLine(a.row)[a.column]))return{text:"",selection:[1,1]}});this.add("macro","insertion",function(a,b,e,c,f){b=e.getPrintMarginColumn();b=Math.min(62,b);var d=c.getDocument().$lines,m=e.getCursorPosition(),h=m.row,g=d[h];e=g.substring(0,m.column);if(/^\s*#\s*define[^\\]*$/.test(g)&&"\\"==f)return a=b-e.length+1,0<=a?{text:Array(a+1).join(" ")+"\\\n"+this.$getIndent(g)+c.getTabString(),selection:!1}:
{text:"\\\n"+c.getTabString(),selection:!1};if(/^\s*#\s*define/.test(g)||this.codeModel.inMacro(d,h-1)){if("\\"==f&&/^\s*$/.test(g.substring(e.length,g.length)))return a=b-e.length+1,0<=a?{text:Array(a+1).join(" ")+"\\",selection:!1}:{text:"\\",selection:!1};if("\n"==f){if(/^\s*$/.test(g)||/^\s*#\s*define/.test(g)&&!/\\\s*$/.test(g))return{text:"\n",selection:!1};if(/\\\s*$/.test(g)&&!/\\\s*$/.test(e))return{text:"",selection:[1,m.column,1,m.column]};c=c.getMode().getNextLineIndent(a,g+"\\",c.getTabString(),
h,!1);a=b-e.length+1;f=/\\\s*$/.test(e)?"":"\\";return 0<=a?{text:Array(a+1).join(" ")+f+"\n"+c,selection:!1}:{text:f+"\n"+c,selection:!1}}}})};n.inherits(a,g);k.CStyleBehaviour=a;k.setFillinDoWhile=function(a){h=a};k.getFillinDoWhile=function(){return h}});define("mode/cpp_code_model",["require","exports","module"],function(a,k,n){a("ace/lib/oop");var g=a("ace/range").Range,l=a("mode/token_utils").TokenUtils;a("ace/token_iterator");var h=a("mode/token_cursor").CppTokenCursor,f=a("mode/cpp_scope_tree").CppScopeNode,e=a("mode/cpp_scope_tree").CppScopeManager,b=a("mode/r_code_model").getVerticallyAlignFunctionArgs,c=a("mode/utils");a=function(a,b,c,h,m){this.$session=a;this.$doc=a.getDocument();this.$tokenizer=b;this.$tokens=Array(this.$doc.getLength());
this.$statePattern=c;this.$codeBeginPattern=h;this.$codeEndPattern=m;this.$tokenUtils=new l(this.$doc,this.$tokenizer,this.$tokens,this.$statePattern,this.$codeBeginPattern);this.$scopes=new e(f);var d=!0,g=function(a,b){d?d=!1:(this.$doc.off("change",p),this.$session.off("changeMode",g))}.bind(this),p=function(a){this.$onDocChange(a)}.bind(this);this.$session.on("changeMode",g);this.$doc.on("change",p)};(function(){var a=c.contains;this.getTokenCursor=function(){return new h(this.$tokens,0,0,this)};
this.$tokenizeUpToRow=function(a){this.$tokenUtils.$tokenizeUpToRow(a)};var e=function(b,e){for(;;){var c=b.currentValue(),d=e.$doc.getLine(b.$row);if(a(["{","}",";"],c))break;if(":"===c&&(c=b.peekBwd().currentValue(),a(["public","private","protected"],c)))break;if(/^\s*#/.test(d))break;if(!b.moveToPreviousToken())break}},f="if else for do while struct class try catch switch".split(" "),p=function(a){a=a.trim();return a=a.replace(/[\n\s]+/g," ")},m=function(a,b){var e=p(a),c=b;"undefined"===typeof c&&
(c=80);e.length>c&&(e=e.substring(0,c)+"...");return e};this.$complements={"<":">",">":"<","{":"}","}":"{","[":"]","]":"[","(":")",")":"(","'":"'",'"':'"'};this.alignContinuationSlashes=function(a,b){"undefined"===typeof b&&(b={start:0,end:a.getLength()});var e=a.$lines;if(!(e instanceof Array))return!1;for(var c=b.start;c<b.end;c++)if(n.test(e[c])){var d=c;for(c+=1;n.test(e[c])&&c<=b.end;)c++;for(var f=c,m=e.slice(d,f).map(function(a){return a.lastIndexOf("\\")}),y=Math.max.apply(null,m),h=0;h<f-
d;h++){var g={row:d+h,column:m[h]},p=Array(y-m[h]+1).join(" ");a.insert(g,p)}}return!0};this.allIndicesOf=function(a,b){for(var e=[],c=0;c<a.length;c++)a[c]==b&&e.push(c);return e};this.getRowForMatchingEOLArrows=function(a,b,e){a=0;for(var c,d=1;100>d;d++){c=this.getLineSansComments(b,e-d);if(/;\s*$/.test(c))break;if(/<\s*$/.test(c)&&!/<<\s*$/.test(c)){if(0===a)return e-d;a--}else/^\s*>/.test(c)&&!/^\s*>>/.test(c)&&a++}return-1};var l=/^\s*#\s*define/,n=/\\\s*$/,z=/^\s*[+\-/&^%$!<>.?|=~]|^\s*\*[^/]|^\s*\/[^\*]/,
k=/[+\-*&^%$!<>.?|=~]\s*$|\*[^/]\s*$|\/[^\*]\s*$/,C=function(a){return z.test(a)||k.test(a)};this.inMacro=function(a,b){var e=a[b];return 0>b?!1:n.test(e)?l.test(e)?!0:this.inMacro(a,b-1):!1};this.$buildScopeTreeUpToRow=function(a){a=Math.min(a+30,this.$doc.getLength()-1);this.$tokenUtils.$tokenizeUpToRow(a);var b=this.getTokenCursor();if(b.seekToNearestToken(this.$scopes.parsePos,a)){do{this.$scopes.parsePos=b.currentPosition();this.$scopes.parsePos.column+=b.currentValue().length;var c=b.currentToken().type;
if(/\bsectionhead\b/.test(c)){if(c=/^\/\/'?[-=#\s]*(.*?)\s*[-=#]+\s*$/.exec(b.currentValue()))c=""+c[1],0==c.length&&(c="(Untitled)"),50<c.length&&(c=c.substring(0,50)+"..."),this.$scopes.onSectionStart(c,b.currentPosition())}else if(/\bcodebegin\b/.test(c)){c=b.currentPosition();var d={row:c.row+1,column:0};this.$scopes.getTopLevelScopeCount();this.$scopes.onChunkStart("(R Code Chunk)","(R Code Chunk)",c,d)}else if(/\bcodeend\b/.test(c)){for(c=b.currentPosition();this.$scopes.onScopeEnd(c););c.column+=
b.currentValue().length;this.$scopes.onChunkEnd(c)}else if("{"===b.currentValue())if(c=b.cloneCursor(),d=c.currentPosition(),c.isFirstSignificantTokenOnLine()&&(d.column=0),"namespace"===c.peekBwd(2).currentValue())c.moveToPreviousToken(),d=c.currentValue(),this.$scopes.onNamespaceScopeStart("namespace "+d,c.currentPosition(),b.currentPosition(),d);else if("namespace"===c.peekBwd().currentValue())this.$scopes.onNamespaceScopeStart("anonymous namespace",d,b.currentPosition(),"<anonymous>");else if("class"===
c.peekBwd(2).currentValue()||"struct"===c.peekBwd(2).currentValue()||c.bwdOverClassInheritance()){c.moveToPreviousToken();var f=c.cloneCursor();e(f,this);f=f.peekFwd().currentPosition();d=this.$session.getTextRange(new g(f.row,f.column,d.row,d.column));d=p(d);this.$scopes.onClassScopeStart(d,c.currentPosition(),b.currentPosition(),d)}else if(c.bwdOverConstNoexceptDecltype()&&c.bwdOverInitializationList()&&c.moveBackwardOverMatchingParens()||c.moveBackwardOverMatchingParens())if("identifier"===c.peekBwd().currentType()||
"]"===c.peekBwd().currentValue()||/^operator/.test(c.peekBwd().currentValue()))if("]"===c.peekBwd().currentValue())c=c.currentPosition(),c=this.$session.getTextRange(new g(c.row,c.column,d.row,d.column-1)),c=p("lambda "+c),this.$scopes.onLambdaScopeStart(c,d,b.currentPosition());else{if(c.moveToPreviousToken()){var h="";d=c.currentValue();f="";var q=this.$scopes.getActiveScopes(c.currentPosition());null!=q&&(q=q[q.length-1],q.isClass()&&q.label==="class "+d?"~"===c.peekBwd().currentValue()&&(d="~"+
d):(h=c.cloneCursor(),e(h,this),h.moveToNextToken(),h=h.currentPosition(),q=c.currentPosition(),h=this.$session.getTextRange(new g(h.row,h.column,q.row,q.column))));var y=c.peekFwd();q=y.currentPosition();y.fwdToMatchingToken()&&("const"===y.peekFwd().currentValue()&&y.moveToNextToken(),"noexcept"===y.peekFwd().currentValue()&&y.moveToNextToken(),"noexcept"===y.currentValue()&&"("===y.peekFwd().currentValue()&&(y.moveToNextToken(),y.fwdToMatchingToken()),(y=y.peekFwd().currentPosition())&&(f=this.$session.getTextRange(new g(q.row,
q.column,y.row,y.column))));h=0<h.length?m(d.trim()+f.trim()+": "+h.trim()):m(d.trim()+f.trim());this.$scopes.onFunctionScopeStart(h,c.currentPosition(),b.currentPosition(),d.trim(),f.split(","))}}else this.$scopes.onScopeStart(d);else this.$scopes.onScopeStart(d);else"}"===b.currentValue()&&(c=b.currentPosition(),b.isLastSignificantTokenOnLine()?c.column=this.$doc.getLine(c.row).length+1:c.column++,this.$scopes.onScopeEnd(c))}while(b.moveToNextToken(a))}};this.getCurrentScope=function(a,b){b||(b=
function(a){return!0});if(!a)return"";this.$buildScopeTreeUpToRow(a.row);var c=this.$scopes.getActiveScopes(a);if(c)for(var e=c.length-1;0<=e;e--)if(b(c[e]))return c[e];return null};this.getScopeTree=function(){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.getScopeList()};this.getRowForOpenBraceIndent=function(b,c,e){if(1>=b.getDocument().$lines.length)return-1;if(this.$tokenUtils.$tokenizeUpToRow(c))try{for(var d=Array(this.$tokens.length),m=0;m<this.$tokens.length;m++)if(null!=
this.$tokens[m]&&0<this.$tokens[m].length){var h=this.$tokens[m];"\\"===h[h.length-1].value&&(d[m]=this.$tokens[m].splice(h.length-1,1)[0])}var g=this.getTokenCursor();if(e){var y=b.getSelection().getCursor();if(!g.moveToPosition(y))return 0}else for(g.$row=c,m=g.$tokens[c].length-1,m=g.$tokens[c].length-1;0<=m&&(g.$offset=m,"{"!==g.currentValue());m--);if("{"===g.peekBwd().currentValue()||";"===g.currentValue())return-1;g.bwdOverInitializationList();g.bwdOverClassInheritance();if("{"===g.currentValue()&&
!g.moveToPreviousToken()||"{"===g.currentValue())return-1;for(;"keyword"===g.currentType();){var p=g.currentValue();if(a(f,p)||0===g.$row&&0===g.$offset)return g.$row;if(!g.moveToPreviousToken())return-1}if(":"===g.currentValue()){var q=g.peekBwd().currentValue();if(a(["public","private","protected"],q))return g.moveToNextToken(),g.$row}if(":"===g.currentValue())for(;g.moveToPreviousToken();){if(g.bwdToMatchingToken())if("keyword"===g.peekBwd().currentType())continue;else break;if("identifier"===
g.currentType())break}if(")"===g.currentValue()&&!g.bwdToMatchingToken()||"("===g.currentValue()&&!g.moveToPreviousToken())return-1;"="===g.currentValue()&&g.moveToPreviousToken();return g.$row}finally{for(m=0;m<d.length;m++)"undefined"!==typeof d[m]&&this.$tokens[m].push(d[m])}return-1};this.getLineSansComments=function(a,b,c){if(0>b)return"";a=a.getLine(b);var e=/(?!\\)"/g,d=a,f;for(b=[];f=e.exec(d);)b.push(f.index);if(0<b.length&&0===b.length%2)for(e=0;e<b.length/2;e+=2)d=b[e+1],a=a.substring(0,
b[e]+1)+a.substring(d,a.length);b=a.indexOf("//");-1!=b&&(a=a.substring(0,b));n.test(a)&&(a=a.substring(0,a.lastIndexOf("\\")));c&&(a=a.replace(/\bconst\b/,"").replace(/\bnoexcept\b/,""));return a};this.findStartOfCommentBlock=function(a,b,c){for(var e=0,d=/^\s*\/+\*/;0<=b&&e<c;){if(d.test(a[b]))return b;--b;++e}return-1};this.getNextLineIndent=function(e,d,f,m,g){var h=b(),p=this.$session,y=p.getTabSize(),q=p.getDocument();"number"!==typeof m&&(m=p.getSelection().getCursor().row-1);if(-1===m)return d=
q.getLine(0),0<d.length?this.$getIndent(d):"";if(0===d.length||/^\s*#/.test(d))return this.getNextLineIndent(c.getPrimaryState(p,m-1),q.getLine(m-1),f,m-1,g);var z=this.$getIndent(d),w=this.$getUnindent(d,y),r=q.$lines;if(c.endsWith(e,"comment")||c.endsWith(e,"doc-start")){k&&k.row==m&&(d=d.substring(0,k.column));if(/^\s*$/.test(d))return this.$getIndent(r[m]);k=this.findStartOfCommentBlock(r,m,200);if(null!==k)return this.$getIndent(r[k])+" "}if(c.endsWith(e,"start")){if(l.test(d))return/\\\s*$/.test(d)?
z+f:z;if(/^\s*#\s*\S/.test(d))return z;if(this.inMacro(r,m-1)&&!n.test(d))return w;d=this.getLineSansComments(q,m);var k=p.getSelection().getCursor();k&&k.row==m&&!g&&(d=d.substring(0,k.column));e=this.getLineSansComments(q,m-1);if("string"!==typeof d)return"";if(0===d.length||/^\s*$/.test(d))return this.$getIndent(r[m]);if(/\*\/\s*$/.test(d)&&(w=this.findStartOfCommentBlock(r,m,200),0<=w))return this.$getIndent(r[w]);if(/^\s*<</.test(d)){for(d=m-1;/^\s*<</.test(r[d]);)d--;return this.$getIndent(r[d])}if(/^\s*\./.test(d)){for(d=
m-1;/^\s*\./.test(r[d]);)d--;return this.$getIndent(r[d])}if(/\bnamespace\b.*\{\s*$/.test(d)||/\bswitch\b.*\{\s*$/.test(d))return z;if(d.match(/\(\s*$/))return-1!==d.indexOf("=")||/^\s*(return\s+)?[a-zA-Z0-9_.->:]+\(\s*$/.test(d)?z+f:z+f+f;if(/^\s*(class|struct)\s*[\w]+\s*$/.test(d)||/^\s*(class|struct).*\{\s*$/.test(d)||/^\s*(class|struct)\s+.+:\s*$/.test(d))return z+f;if((w=d.match(/(^\s*(?:class|struct)\s+.*\w[^:]):[^:]\s*.+/))&&!/,\s*/.test(d)||(w=d.match(/^(\s*(class|struct).*:\s*).*,\s*$/))||
(w=d.match(/^(\s*:\s*)(\w+).*,\s*$/))||(w=d.match(/^(\s*)[:,]\s*[\w\s]*$/)))return h?Array(w[1].length+1).join(" "):z+f;if(/<\s*$/.test(d))return z+f;if(/^\s*".*"\s*$/.test(d)||/^\s*template\s*<.*>\s*$/.test(d)&&d.split(">").length==d.split("<").length)return z;if(/([\[\{\(<]).+,\s*$/.exec(d)){var t=["(","{","[","<"];for(w=0;w<t.length;w++){var A=t[w],x=this.$complements[A];A=this.allIndicesOf(d,A);if(A.length&&(x=this.allIndicesOf(d,x),x=A.length-x.length-1,!(0>x)))return r=A[x],h?(d=d.substr(r+
1).match(/([^\s])/),Array(r+d.index+2).join(" ")):z+f}}for(w=m-1;0<=w&&/^\s*$|^\s*#/.test(e);)e=this.getLineSansComments(q,w),w--;if(/^\s*__attribute__\(\(.*\)\)\s*$/.test(d)||/^\s*[\w\s]+\s*$/.test(d)&&!/(class|struct|for|while|do|if|else|try)/.test(d)||C(d)&&C(e))return this.$getIndent(d);if(this.$tokenUtils.$tokenizeUpToRow(m+2)){t=Array(this.$tokens.length);try{for(w=0;w<this.$tokens.length;w++)if(null!=this.$tokens[w]&&0<this.$tokens[w].length){var v=this.$tokens[w];"\\"===v[v.length-1].value&&
(t[w]=this.$tokens[w].splice(v.length-1,1)[0])}var u=this.getTokenCursor();g?(u.$row=m,u.$offset=this.$tokens[m].length-1):u.moveToPosition(k);for(;0>u.$offset&&0<u.$row;)u.$row--,u.$offset=u.$tokens[u.$row].length-1;for(;0<u.$row&&/^\s*#/.test(q.getLine(u.$row));)u.$row--,u.$offset=u.$tokens[u.$row].length-1;g="";var Q=u.cloneCursor(),H=Q.currentValue(),I=Q.currentType();if("keyword"===I||a(["{",")",">",":"],H))g=f;for(;";"===u.currentValue()&&u.moveToPreviousToken(););var N=u.cloneCursor();if(h&&
u.isLastSignificantTokenOnLine()&&("keyword.operator"===u.currentType()||"punctuation.operator"===u.currentType())){var R=u.cloneCursor();R.$offset=0;if("keyword"===R.currentType()){var O=d.split("(").length-d.split(")").length;if(0<O){var M=d.match(/.*?\(\s*(\S)/);if(M)return Array(M[0].length).join(" ")}}}if(","===u.currentValue()){if(h){var G=u.peekBwd();if("]"===G.currentValue()&&G.bwdToMatchingToken())return Array(G.currentPosition().column+1).join(" ");O=d.split("(").length-d.split(")").length;
if(0<O&&(M=d.match(/.*?\(\s*(\S)/)))return Array(M[0].length).join(" ")}if(/[,(]\s*$/.test(d)&&/[,(]\s*$/.test(e))return this.$getIndent(d);var D=u.cloneCursor();return D.findOpeningBracket("{",!1)&&D.bwdOverClassySpecifiers()&&"enum"===D.currentValue()?this.$getIndent(r[D.$row])+f:-1!==d.indexOf("=")?this.$getIndent(d)+f:this.$getIndent(d)}if("keyword.operator"===I&&":"!==H)return this.$getIndent(r[m])+f;for(;;){if("undefined"===typeof u.currentValue())return"undefined"!==typeof N.currentValue()?
this.$getIndent(r[N.$row])+g:g;N=u.cloneCursor();if(";"===u.currentValue()&&u.moveToNextToken()){for(m=u.$row;null!=r[m]&&/^\s*#/.test(r[m]);)++m;return this.$getIndent(r[m])+g}if(a(["for","while","do","try"],u.currentValue())&&";"!==H)return this.$getIndent(r[u.$row])+g;G=u.peekBwd();if(":"===u.currentValue()){if(a(["public","private","protected"],G.currentValue()))return this.$getIndent(r[G.$row])+f;var S=r[u.$row];if(/^\s*case/.test(S))return this.$getIndent(S)+f;if(")"===G.currentValue()&&(D=
G.cloneCursor(),D.bwdToMatchingToken())){var T=D.peekBwd(1),B=D.peekBwd(2);if(null!==T&&"identifier"===T.currentType()&&null!==B&&!/\boperator\b/.test(B.currentType()))return this.$getIndent(r[D.peekBwd().$row])+g}}if("]"===u.currentValue()&&"("===u.peekFwd().currentValue()&&(D=u.cloneCursor(),D.bwdToMatchingToken()))return this.$getIndent(r[D.$row])+g;if("("===u.currentValue()&&"for"===G.currentValue()&&";"===H)return u.peekFwd().cloneCursor(),h?Array(u.peekFwd().currentPosition().column+1).join(" "):
this.$getIndent(r[u.peekFwd().$row])+f;if(h&&"("===u.currentValue()&&!u.isLastSignificantTokenOnLine())return u.moveToNextToken(),Array(u.currentPosition().column+1+y).join(" ");if("if"===u.currentValue()||"else"===u.currentValue()||"template"===u.currentValue()&&"<"===u.peekFwd().currentValue())return this.$getIndent(r[u.$row])+g;if("{"===u.currentValue()){var U=this.getRowForOpenBraceIndent(p,u.$row);return 0<=U?(d=this.getLineSansComments(q,U),z=this.$getIndent(d),/\bnamespace\b/.test(d)?z:z+f):
this.$getIndent(r[u.$row])+f}if(0===u.$row&&0===u.$offset)return this.$getIndent(r[0])+g;if(">"===u.currentValue()&&(D=u.cloneCursor(),D.bwdToMatchingArrow()&&"template"===D.peekBwd().currentValue()))return">"===H&&(g=""),this.$getIndent(r[D.$row])+g;u.bwdToMatchingToken();if(!u.moveToPreviousToken())break;for(;0<u.$row&&/^\s*#/.test(r[u.$row]);)u.$row--,u.$offset=this.$tokens[u.$row].length-1}}finally{for(w=0;w<t.length;w++)"undefined"!==typeof t[w]&&this.$tokens[w].push(t[w])}}}return z};this.$onDocChange=
function(a){"insert"===a.action?this.$tokenUtils.$insertNewRows(a.start.row,a.end.row-a.start.row):this.$tokenUtils.$removeRows(a.start.row,a.end.row-a.start.row);this.$tokenUtils.$invalidateRow(a.start.row);this.$scopes.invalidateFrom(a.start)};this.$getIndent=function(a){return(a=/^([ \t]*)/.exec(a))?a[1]:""};this.$padIndent=function(a,b,c){b=Array(b+1).join(" ");b=a.replace("\t",b);return b>=c?a:a+Array(c-b+1).join(" ")};this.$getUnindent=function(a,b){var c=this.$getIndent(a);if(null===c||0===
c.length)return"";var d=c.indexOf("\t");if(-1!=d)return c.substring(0,d)+c.substring(d+1,c.length);for(var e=d=0;e<b&&e<c.length;e++)" "===c[e]&&d++;return c.substring(d,c.length)}}).call(a.prototype);k.CppCodeModel=a});define("mode/cpp_scope_tree",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("mode/r_scope_tree");a=g.ScopeManager;var l=g.ScopeNode,h=function(a,e,b,c,d,g){this.label=a;this.start=e;this.preamble=b||e;this.end=null;this.scopeType=c;this.scopeCategory=d;this.attributes=g||{};this.parentScope=null;this.$children=[]};n.mixin(h.prototype,l.prototype);h.CATEGORY_CLASS=1;h.CATEGORY_NAMESPACE=2;h.CATEGORY_FUNCTION=3;h.CATEGORY_LAMBDA=4;h.CATEGORY_ANON=5;(function(){this.isClass=
function(){return this.scopeType==l.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_CLASS};this.isNamespace=function(){return this.scopeType==l.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_NAMESPACE};this.isFunction=function(){return this.scopeType==l.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_FUNCTION};this.isLambda=function(){return this.scopeType==l.TYPE_BRACE&&this.scopeCategory==h.CATEGORY_LAMBDA}}).call(h.prototype);g=function(a){this.$ScopeNodeFactory=a;this.parsePos={row:0,column:0};this.$root=new a("(Top Level)",
this.parsePos,null,l.TYPE_ROOT)};n.mixin(g.prototype,a.prototype);(function(){this.onClassScopeStart=function(a,e,b,c){a=new this.$ScopeNodeFactory(a,b,e,l.TYPE_BRACE,h.CATEGORY_CLASS,{name:c});this.$root.addNode(a);this.printScopeTree()};this.onNamespaceScopeStart=function(a,e,b,c){a=new this.$ScopeNodeFactory(a,b,e,l.TYPE_BRACE,h.CATEGORY_NAMESPACE,{name:c});this.$root.addNode(a);this.printScopeTree()};this.onFunctionScopeStart=function(a,e,b,c,d){a=new this.$ScopeNodeFactory(a,b,e,l.TYPE_BRACE,
h.CATEGORY_FUNCTION,{name:c,args:d});this.$root.addNode(a);this.printScopeTree()};this.onLambdaScopeStart=function(a,e,b,c){a=new this.$ScopeNodeFactory(a,b,e,l.TYPE_BRACE,h.CATEGORY_LAMBDA,{args:c});this.$root.addNode(a);this.printScopeTree()};this.onScopeStart=function(a){this.$root.addNode(new this.$ScopeNodeFactory(null,a,null,l.TYPE_BRACE));this.printScopeTree()};this.onScopeEnd=function(a){a=this.$root.closeScope(a,l.TYPE_BRACE);this.printScopeTree();return a}}).call(g.prototype);k.CppScopeManager=
g;k.CppScopeNode=h});define("mode/dcf",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("ace/tokenizer").Tokenizer,h=a("mode/dcf_highlight_rules").DcfHighlightRules;a=function(){this.$tokenizer=new l((new h).getRules())};n.inherits(a,g);(function(){this.getNextLineIndent=function(a,e,b){return this.$getIndent(e)}}).call(a.prototype);k.Mode=a});define("mode/dcf_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:["keyword","text"],regex:"^([\\w@-]+)(\\:)"},{token:"text",regex:".+"}]}};n.inherits(g,a);k.DcfHighlightRules=g});define("mode/doc_comment_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"[@\\\\][\\w\\d_]+"},{token:"comment.doc",merge:!0,regex:"\\s+"},{token:"comment.doc",merge:!0,regex:"TODO"},{token:"comment.doc",merge:!0,regex:"[^@\\\\\\*]+"},{token:"comment.doc",merge:!0,regex:"."}]}};n.inherits(g,a);g.getStartRule=function(a){return{token:"comment.doc",
merge:!0,regex:"\\/\\*[\\*\\!]",next:a}};g.getEndRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\*\\/",next:a}};k.DocCommentHighlightRules=g});define("util/expand_selection",["require","exports","module"],function(a,k,n){k=a("ace/editor").Editor;var g=a("ace/range").Range;a("ace/keyboard/vim");var l=a("ace/token_iterator").TokenIterator,h=a("mode/utils");(function(){function a(a,b){for(var c=a.session.getTokens(b),d=0;d<c.length;d++){var e=c[d];if(!/^\s*$/.test(e.value))return/\bcomment\b/.test(e.type)}return!1}function e(a,b){var c=a.start.row<b.start.row||a.start.row===b.start.row&&a.start.column<b.start.column,d=a.start.row===b.start.row&&
a.start.column===b.start.column,e=a.end.row>b.end.row||a.end.row===b.end.row&&a.end.column>b.end.column,f=a.end.row===b.end.row&&a.end.column===b.end.column;return c?e||f:e?c||d:!1}function b(a,b){for(var c=a.getCurrentToken(),d=a.getCurrentTokenRow();a.moveToPreviousSignificantToken();){var e=a.getCurrentToken();if(d!==a.getCurrentTokenRow()&&0!==e.type.indexOf("keyword.operator")){if(!a.moveToNextSignificantToken())return!1;break}if(r.test(c.value)&&(r.test(e.value)||h.isOpeningBracket(e.value)||
h.contains(b,e.value))){if(!a.moveToNextSignificantToken())return!1;break}a.bwdToMatchingToken();c=a.getCurrentToken();d=a.getCurrentTokenRow()}return!0}function c(a,b,c){p.push({name:a,immediate:b,execute:c})}var d=this,r=/['"\w.]/,q=!1;this.$onClearSelectionHistory=function(){return d.$clearSelectionHistory()};this.$clearSelectionHistory=function(){this.$selectionRangeHistory=null;this.off("change",this.$clearSelectionHistory)};this.$acceptSelection=function(a,b,c){null==this.$selectionRangeHistory&&
(this.$selectionRangeHistory=[]);a.setSelectionRange(b);a.getRange().isEqual(c)||this.$selectionRangeHistory.push(c);this.isRowFullyVisible(b.start.row)&&this.isRowFullyVisible(b.end.row)||this.centerSelection(a);return b};var p=[];c("string",!0,function(a,b,c,d){return(a=b.getTokenAt(d.start.row,d.start.column+1))&&/\bstring\b/.test(a.type)?new g(d.start.row,a.column+1,d.start.row,a.column+a.value.length-1):null});c("token",!0,function(a,b,c,d){return(a=b.getTokenAt(d.start.row,d.start.column+1))&&
/[\d\w]/.test(a.value)?new g(d.start.row,a.column,d.start.row,a.column+a.value.length):null});c("comment",!0,function(b,c,d,e){c=e.start.row;e=e.end.row;for(d=c;d<=e;d++)if(!a(b,d))return null;for(;a(b,c);)c--;for(;a(b,e);)e++;b=b.getSession().getLine(e-1).length;return new g(c+1,0,e-1,b)});c("includeBoundaries",!0,function(a,b,c,d){a=new l(b);c=a.moveToPosition(d.start);0===d.start.column&&(c=a.moveToPreviousToken());b=new l(b);d=b.moveToPosition(d.end,!0);if(c&&d){var e="support.function.codebegin"===
c.type&&"support.function.codeend"===d.type;e||(e=h.isOpeningBracket(c.value)&&h.getComplement(c.value)===d.value);if(e)return a=a.getCurrentTokenPosition(),c=b.getCurrentTokenPosition(),c.column+=d.value.length,g.fromPoints(a,c)}return null});c("matching",!1,function(a,b,c,d){a=new l(b);d=a.moveToPosition(d.start);if(null==d)return null;do{if(null==d)break;if(!a.bwdToMatchingToken()&&(h.isOpeningBracket(d.value)||"support.function.codebegin"===d.type)){c=a.getCurrentTokenPosition();"support.function.codebegin"===
d.type?(c.row++,c.column=0):c.column+=d.value.length;var e=a.clone();if(e.fwdToMatchingToken())return a=e.getCurrentTokenPosition(),"support.function.codebegin"===d.type&&(a.row--,a.column=b.getLine(a.row).length),g.fromPoints(c,a)}}while(d=a.stepBackward());return null});c("statement",!1,function(a,c,d,e){a=new l(c);if(!a.moveToPosition(e.start,!0))return null;c=new l(c);if(!(d=!c.moveToPosition(e.end)||!b(a,[";",",","=","<-","<<-"]))){a:{d=[";",","];for(var f=c.getCurrentToken(),m=c.getCurrentTokenRow();c.moveToNextSignificantToken();){var p=
c.getCurrentToken();if(m!==c.getCurrentTokenRow()&&0!==f.type.indexOf("keyword.operator")){if(!c.moveToPreviousSignificantToken()){d=!1;break a}break}if(r.test(f.value)||h.isClosingBracket(f.value))if(r.test(p.value)||h.isClosingBracket(p.value)||h.contains(d,p.value)){if(!c.moveToPreviousSignificantToken()){d=!1;break a}break}c.fwdToMatchingToken();f=c.getCurrentToken();m=c.getCurrentTokenRow()}d=!0}d=!d}if(d)return null;d=a.getCurrentTokenPosition();f=c.getCurrentTokenPosition();if(d.row===e.start.row&&
d.column===e.start.column&&f.row===e.end.row&&f.column<=e.end.column&&!b(a,[";",","]))return null;e=a.getCurrentTokenPosition();a=c.getCurrentTokenPosition();a.column+=c.getCurrentTokenValue().length;return g.fromPoints(e,a)});c("scope",!1,function(a,b,c,d){c=b.getMode();if(null==c.codeModel||null==c.codeModel.getCurrentScope)return null;a=[];for(d=c.codeModel.getCurrentScope(d.start);null!=d;){c=d.preamble;var e=d.end;if(null==e&&d.parentScope)for(var f=d.parentScope.$children,h=f.length-2;0<=h;h--)if(f[h].equals(d)){e=
f[h+1].preamble;break}null==e&&(e={row:b.getLength(),column:0});a.push(g.fromPoints(c,e));d=d.parentScope}return 0===a.length?null:a});c("everything",!1,function(a,b,c,d){a=b.getLength();if(0===a)return new g(0,0,0,0);b=b.getLine(a-1);return new g(0,0,a-1,b.length)});this.$expandSelection=function(){q||(d.on("change",d.$onClearSelectionHistory),q=!0);for(var a=this.getSession(),b=this.getSelection(),c=b.getRange(),f=[],g=0;g<p.length;g++){var l=p[g],r=l.execute(this,a,b,c);h.isArray(r)||(r=[r]);for(var n=
0;n<r.length;n++){var k=r[n];if(k&&l.immediate&&e(k,c))return this.$acceptSelection(b,k,c);k&&e(k,c)&&f.push({name:l.name,range:k})}}f.sort(function(a,b){a=a.range;b=b.range;var c=a.end.row-a.start.row,d=b.end.row-b.start.row;return c!==d?c>d:a.end.column-a.start.column>b.end.column-b.start.column});return this.$acceptSelection(b,f[0].range,c)};this.$shrinkSelection=function(){var a=this.$selectionRangeHistory;if(a&&a.length)return a=a.pop(),this.getSelection().setSelectionRange(a),this.isRowFullyVisible(a.start.row)&&
this.isRowFullyVisible(a.end.row)||this.centerSelection(this.getSelection()),a;q&&(d.off("change",d.$onClearSelectionHistory),q=!1);return this.getSelectionRange()}}).call(k.prototype)});define("mode/markdown",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("ace/mode/javascript").Mode,h=a("ace/mode/xml").Mode,f=a("ace/mode/html").Mode,e=a("mode/markdown_highlight_rules").MarkdownHighlightRules,b=a("mode/markdown_folding").FoldMode;a=function(){this.HighlightRules=e;this.createModeDelegates({"js-":l,"xml-":h,"html-":f});this.foldingRules=new b};n.inherits(a,g);(function(){this.type="text";this.blockComment={start:"\x3c!--",end:"--\x3e"};
this.getNextLineIndent=function(a,b,e){return this.$getIndent(b)};this.$id="mode/markdown"}).call(a.prototype);k.Mode=a});define("mode/markdown_folding",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/folding/fold_mode").FoldMode,l=a("ace/range").Range;k=k.FoldMode=function(){};var h=a("mode/utils");n.inherits(k,g);(function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/;this.getFoldWidget=function(a,e,b){e="markbeginend"===e?"end":"";var c=a.getLine(b);return this.foldingStartMarker.test(c)?"`"==c[0]?"start"===h.getPrimaryState(a,b)?e:"start":"":""};this.getFoldWidgetRange=
function(a,e,b){function c(b){return(n=a.getTokens(b)[0])&&0===n.type.lastIndexOf(k,0)}function d(){var a=n.value[0];return"="==a?6:"-"==a?5:7-n.value.search(/[^#]/)}var f=a.getLine(b);e=f.length;var g=a.getLength(),p=b,m=b;if(f.match(this.foldingStartMarker)){if("`"==f[0]){if("start"!==h.getPrimaryState(a,b)){for(;++b<g&&!(f=a.getLine(b),"`"==f[0]&"```"==f.substring(0,3)););return new l(p,e,b,0)}for(;0<b--&&!(f=a.getLine(b),"`"==f[0]&"```"==f.substring(0,3)););return new l(b,f.length,p,0)}var n,
k="markup.heading";if(c(b)){for(m=d();++b<g&&!(c(b)&&d()>=m););m=b-(n&&-1!=["=","-"].indexOf(n.value[0])?2:1);if(m>p)for(;m>p&&/^\s*$/.test(a.getLine(m));)m--;if(m>p)return b=a.getLine(m).length,new l(p,e,m,b)}}}}).call(k.prototype)});define("mode/markdown_highlight_rules",["require","exports","module"],function(a,k,n){function g(a,b){return{token:"support.function",regex:"^\\s*```(?:\\{"+a+"[^\\}]*\\}|"+a+")\\s*$",push:b+"start"}}n=a("ace/lib/oop");var l=a("ace/lib/lang"),h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,e=a("ace/mode/xml_highlight_rules").XmlHighlightRules,b=a("ace/mode/html_highlight_rules").HtmlHighlightRules,c=a("ace/mode/css_highlight_rules").CssHighlightRules,
d=a("ace/mode/scss_highlight_rules").ScssHighlightRules,r=a("ace/mode/sass_highlight_rules").SassHighlightRules,q=a("ace/mode/less_highlight_rules").LessHighlightRules,p=a("ace/mode/perl_highlight_rules").PerlHighlightRules,m=a("mode/python_highlight_rules").PythonHighlightRules,w=a("ace/mode/ruby_highlight_rules").RubyHighlightRules,A=a("ace/mode/scala_highlight_rules").ScalaHighlightRules,z=a("mode/sh_highlight_rules").ShHighlightRules;a("mode/stan_highlight_rules");var x=a("mode/sql_highlight_rules").SqlHighlightRules,
C=a("mode/mermaid_highlight_rules").MermaidHighlightRules,t=a("ace/mode/dot_highlight_rules").DotHighlightRules,v=function(a){return"(?:[^"+l.escapeRegExp(a)+"\\\\]|\\\\.)*"};a=function(){var a=l.arrayToMap("title author date rtl depends autosize width height transition transition-speed font-family css class navigation incremental left right id audio video type at help-doc help-topic source console console-input execute pause".split(" ")),h={token:["text","constant.numeric.text","constant.numeric.text",
"constant.numeric.text"],regex:"(^|\\s+)(_{2,3})(?![\\s_])(.*?)(?=_)(\\2)\\b"},n={token:["text","constant.language.boolean.text"],regex:"(^|\\s+)(_(?=[^\\s_]).*?_)\\b"},k={token:["constant.numeric.text","constant.numeric.text","constant.numeric.text"],regex:"([*]{2,3})(?![\\s*])(.*?)(?=[*])(\\1)"},E={token:["constant.language.boolean.text"],regex:"([*](?=[^\\s*]).*?[*])"},y={token:"text",regex:"\\^\\["+v("]")+"\\]"},F={token:"text constant text url string text".split(" "),regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},
J={token:["text","keyword","text","constant","text"],regex:"(\\s*\\[)("+v("]")+")(\\]\\[)("+v("]")+")(\\])"},K={token:"text keyword text markup.href string text paren.keyword.operator nospell paren.keyword.operator".split(" "),regex:"(\\s*\\[)("+v("]")+')(\\]\\()((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)(\\s*"'+v('"')+'"\\s*)?(\\))(?:(\\s*{)((?:[^\\}]+))(\\s*}))?'},P={token:["text","keyword","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"};
this.$rules={basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}[\]()#+\-.!]/},{token:"text",regex:/[?]`/},{token:"support.function.inline_r_chunk",regex:"`r (?:.*?[^`])`"},{token:["support.function","support.function","support.function"],regex:"(`+)(.*?[^`])(\\1)"},y,F,J,K,P,k,h,E,n],start:[{token:"empty_line",regex:"^\\s*$",next:"allowBlock"},{token:"text",regex:/[?]`/},{token:"support.function.inline_r_chunk",regex:"`r (?:.*?[^`])`"},{token:["support.function","support.function","support.function"],
regex:"(`+)([^\\r]*?[^`])(\\1)"},{token:"markup.heading.1",regex:"^\\={3,}\\s*$",next:"fieldblock"},{token:"markup.heading.1",regex:"^={3,}(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-{3,}(?=\\s*$)"},{token:function(a){return"markup.heading."+a.length},regex:/^#{1,6}(?=\s*[^ #]|\s+#.)/,next:"header"},g("(?:javascript|js)","jscode-"),g("xml","xmlcode-"),g("html","htmlcode-"),g("css","csscode-"),g("scss","scsscode-"),g("sass","sasscode-"),g("less","lesscode-"),g("mermaid","mermaidcode-"),g("dot",
"dotcode-"),g("perl","perlcode-"),g("python","pythoncode-"),g("ruby","rubycode-"),g("scala","scalacode-"),g("sh","shcode-"),g("bash","bashcode-"),g("stan","stancode-"),g("sql","sqlcode-"),g("d3","jscode-"),{token:"support.function",regex:"^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",next:"githubblock"},{token:"string.blockquote",regex:"^\\s*>\\s*(?=[-])"},{token:"string.blockquote",regex:"^\\s*>\\s*",next:"blockquote"},y,F,J,{token:"constant.hr",regex:"^\\s*[*](?:\\s*[*]){2,}\\s*$",next:"allowBlock"},{token:"constant.hr",
regex:"^\\s*[-](?:\\s*[-]){2,}\\s*$",next:"allowBlock"},{token:"constant.hr",regex:"^\\s*[_](?:\\s*[_]){2,}\\s*$",next:"allowBlock"},{token:"latex.markup.list.string.begin",regex:"\\\\\\[",next:"mathjaxnativedisplay"},{token:"latex.markup.list.string.begin",regex:"\\\\\\(",next:"mathjaxnativeinline"},{token:"text",regex:"\\\\\\$"},{token:"latex.markup.list.string.begin",regex:"\\${2}",next:"mathjaxdisplay"},{token:["latex.markup.list.string.begin","latex.support.function","latex.markup.list.string.end"],
regex:"(\\$)((?:(?:\\\\.)|(?:[^\\$\\\\]))*?)(\\$)"},{token:["text","keyword","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[{}]"},{token:"markup.list",regex:"-?\\@[\\w\\d-]+"},{token:"text",regex:"[^\\*_%$`\\[#<>{}\\\\@\\s!]+"},{token:"text",regex:"\\\\"},{token:"text",regex:"^\\s*(?:[*+-]|\\d+\\.)\\s+",next:"listblock"},k,h,E,n,
{token:"comment",regex:"<\\!--",next:"html-comment"},{include:"basic"}],"html-comment":[{token:"comment",regex:"--\x3e",next:"start"},{defaultToken:"comment.text"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty_line",regex:"^\\s*$",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],listblock:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"text",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
next:"listblock"},{token:["latex.markup.list.string.begin","latex.support.function","latex.markup.list.string.end"],regex:"(\\$)((?:(?:\\\\.)|(?:[^\\$\\\\]))*?)(\\$)"},{include:"basic",noEscape:!0},{token:"support.function",regex:"^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{defaultToken:"text"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"constant.language.escape",regex:/\\[\\`*_{}[\]()#+\-.!]/},{token:"text",regex:/[?]`/},{token:"support.function.inline_r_chunk",
regex:"`r (?:.*?[^`])`"},{token:["support.function","support.function","support.function"],regex:"(`+)(.*?[^`])(\\1)"},y,F,J,K,P,k,h,E,n,{defaultToken:"string.blockquote"}],githubblock:[{token:"support.function",regex:"^\\s*```",next:"start"},{token:"support.function",regex:".+"}],fieldblock:[{token:function(b){b=b.slice(0,-1);return a[b]?"comment.doc.tag":"text"},regex:"^[\\w-]+\\:",next:"fieldblockvalue"},{token:"text",regex:"(?=.+)",next:"start"}],fieldblockvalue:[{token:"text",regex:"$",next:"fieldblock"},
{token:"text",regex:"[^{}]+"}],mathjaxdisplay:[{token:"latex.markup.list.string.end",regex:"\\${2}",next:"start"},{token:"latex.support.function",regex:"[^\\$]+"}],mathjaxnativedisplay:[{token:"latex.markup.list.string.end",regex:"\\\\\\]",next:"start"},{token:"latex.support.function",regex:"[\\s\\S]+?"}],mathjaxnativeinline:[{token:"latex.markup.list.string.end",regex:"\\\\\\)",next:"start"},{token:"latex.support.function",regex:"[\\s\\S]+?"}]};this.embedRules(f,"jscode-",[{token:"support.function",
regex:"^\\s*```",next:"pop"}]);this.embedRules(b,"htmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(c,"csscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(d,"scsscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(r,"sasscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(q,"lesscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(e,"xmlcode-",[{token:"support.function",
regex:"^\\s*```",next:"pop"}]);this.embedRules(p,"perlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(m,"pythoncode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(w,"rubycode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(C,"mermaidcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(t,"dotcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(A,"scalacode-",
[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(z,"shcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(z,"bashcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(x,"sqlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(f,"jscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.normalizeRules()};n.inherits(a,h);k.MarkdownHighlightRules=a});define("mode/mermaid",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("ace/tokenizer").Tokenizer,h=a("mode/mermaid_highlight_rules").MermaidHighlightRules;a=function(){this.$highlightRules=new h;this.$tokenizer=new l(this.$highlightRules.getRules())};n.inherits(a,g);(function(){this.getNextLineIndent=function(a,e,b){return this.$getIndent(e)}}).call(a.prototype);k.Mode=a});define("mode/mermaid_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.createKeywordMapper({keyword:"sequenceDiagram|participant|graph|subgraph|loop|alt|is|opt|else|end|style|linkStyle|classDef|class"},"identifier",!1);this.$rules={start:[{token:"comment",regex:"%%.*$"},{token:"keyword",merge:!1,regex:"^\\s*graph\\s+(?:TB|BT|RL|LR|TD)\\s*$"},{token:"keyword",merge:!1,regex:"^\\s*(?:sequenceDiagram|participant|subgraph|loop|alt(?:\\s+is)?|opt|else(?:\\s+is)?|end|style|linkStyle|classDef|class)"},
{token:"keyword.operator",merge:!1,regex:">|\\->|\\-\\->|\\-\\-\\-|\\-\\-|\\-\\.\\->|\\-\\.|\\.\\->|==>|==|\\->>|\\-\\->>|\\-x|\\-\\-x"},{token:"paren.keyword.operator",merge:!1,regex:"[[({\\|]"},{token:"paren.keyword.operator",merge:!1,regex:"[\\])}]"},{token:"markup.list",merge:!1,regex:"Note\\s+(?:left|right)\\s+of"},{token:"markup.list",merge:!1,regex:"<br/>"},{token:"text",regex:"\\s+",merge:!0}]}};n.inherits(g,a);k.MermaidHighlightRules=g});define("mode/python",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("mode/python_highlight_rules").PythonHighlightRules,h=a("ace/mode/folding/pythonic").FoldMode,f=a("ace/range").Range;a=function(){this.HighlightRules=l;this.foldingRules=new h("\\:")};n.inherits(a,g);(function(){this.lineCommentStart="#";this.getLanguageMode=function(a){return"Python"};this.getNextLineIndent=function(a,b,c,d){a=this.$getIndent(b);if(/^\s*[#]/.test(b))return a;/[{([:]\s*(?:$|[#])/.test(b)&&
(a+=c);/^\s*(?:break|continue|pass|raise|return)\b/.test(b)&&(a=a.substring(0,a.length-c.length));return a};this.$performOutdent=function(a,b,c){var d=a.doc.$lines[c];c=this.$getIndent(a.doc.$lines[b]);d=this.$getIndent(d);d.length<c.length&&(b=new f(b,0,b,c.length),a.replace(b,d));return!0};this.$autoOutdentElse=function(a,b,c){a=b.doc.$lines[c].substring(0,b.selection.cursor.column);if(!/^\s*(?:else|elif)(?:\s|[:])/.test(a))return!1;for(a=c-1;0<=a;a--)if(/^\s*(?:if|elif|for|try)(?:\s|[:])/.test(b.doc.$lines[a]))return this.$performOutdent(b,
c,a)};this.$autoOutdentExceptFinally=function(a,b,c){a=b.doc.$lines[c].substring(0,b.selection.cursor.column);if(!/^\s*(?:except|finally)(?:\s|[:])/.test(a))return!1;for(a=c-1;0<=a;a--)if(/^\s*(?:try)(?:\s|[:])/.test(b.doc.$lines[a]))return this.$performOutdent(b,c,a)};this.checkOutdent=function(a,b,c){this.$lastInput=c;return":"===c||" "===c};this.$canAutoOutdent=function(a,b,c){a=b.selection.cursor;return 0===a.column?!1:":"===this.$lastInput?!0:" "===this.$lastInput?(b=b.getTokenAt(a.row,a.column-
1)||{},/\bkeyword\b/.test(b.type)):!1};this.autoOutdent=function(a,b,c){this.$canAutoOutdent(a,b,c)&&(this.$autoOutdentElse(a,b,c)||this.$autoOutdentExceptFinally(a,b,c))};this.transformAction=function(a,b,c,d,f){return!1};this.$id="mode/python"}).call(a.prototype);k.Mode=a});define("mode/python_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text_highlight_rules").TextHighlightRules,l=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules;a=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"#\\s*[|].*$",next:"start"},{token:"comment",regex:"#.*$"},{token:"constant.language",regex:"@[a-zA-Z_][a-zA-Z0-9._]*\\b"},{token:"string",regex:'(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?"{3}',
next:"qqstring3"},{token:"string",regex:'(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?"(?=.)',next:"qqstring"},{token:"string",regex:"(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?'{3}",next:"qstring3"},{token:"string",regex:"(?:b|B|br|Br|bR|BR|rb|rB|Rb|RB|r|u|R|U|f|F|fr|Fr|fR|FR|rf|rF|Rf|RF)?'(?=.)",next:"qstring"},{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))|\\d+)[jJ]\\b"},
{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"},{token:"constant.numeric",regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))[lL]\\b"},{token:"constant.numeric",regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))\\b"},{token:this.createKeywordMapper({"invalid.deprecated":"debugger","support.function":"abs|all|any|ascii|basestring|bin|bool|breakpoint|bytearray|bytes|callable|chr|classmethod|cmp|compile|complex|delattr|dict|dir|divmod|eumerate|eval|execfile|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip|__import__",
"constant.language":"NotImplemented|Ellipsis|__debug__",keyword:"False|None|True|and|as|assert|async|await|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield"},"identifier"),regex:"[a-zA-Z_][a-zA-Z0-9_]*\\b"},{token:"keyword.operator",regex:"//=|\\*\\*=|>>=|<<=|//|\\*\\*|==|!=|>=|<=|:=|>>|<<|\\+=|-=|\\*=|/=|&=|%=|\\|=|\\^=|\\+|-|\\*|/|%|>|<|\\^|~|\\||&|=|:|\\.|;|,",merge:!1},l.getParenRule(),{token:"text",
regex:"\\s+"}],qqstring3:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],qstring3:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],qqstring:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},
{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:"\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}]}};n.inherits(a,g);k.PythonHighlightRules=a});define("mode/r",["require","exports","module"],function(a,k,n){a("ace/editor");a("ace/edit_session");a("ace/range");n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/r_highlight_rules").RHighlightRules,e=a("mode/r_code_model").RCodeModel,b=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent;a("mode/auto_brace_insert");var c=a("ace/unicode");a=function(a,c){this.$tokenizer=a?new l((new h).getRules()):
new l((new f).getRules());this.foldingRules=this.codeModel=new e(c,this.$tokenizer);this.$outdent=new b(this.codeModel)};n.inherits(a,g);(function(){this.getLanguageMode=function(a){return"R"};this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(a,b,c)};this.autoOutdent=function(a,b,c){return this.$outdent.autoOutdent(a,b,c)};this.tokenRe=new RegExp("^["+c.wordChars+"._]+","g");this.nonTokenRe=new RegExp("^(?:[^"+c.wordChars+"._]|\\s)+","g");this.$complements={"(":")","[":"]",'"':'"',
"'":"'","{":"}","`":"`"};this.$reOpen=/^[{(\["'`]$/;this.$reClose=/^[})\]"'`]$/;this.getNextLineIndent=function(a,b,c,e){return this.codeModel.getNextLineIndent(a,b,c,e)};this.allowAutoInsert=this.smartAllowAutoInsert;this.getIndentForOpenBrace=function(a){return this.codeModel.getIndentForOpenBrace(a)};this.$getIndent=function(a){return(a=a.match(/^(\s+)/))?a[1]:""};this.$id="mode/r"}).call(a.prototype);k.Mode=a});define("mode/r_code_model",["require","exports","module"],function(a,k,n){function g(a,b){for(var c=0;c<b.length;c++)if(a===b[c])return!0;return!1}function l(a){return"if"===a||"for"===a||"while"===a||"repeat"===a||"function"===a}var h=a("ace/range").Range,f=a("ace/token_iterator").TokenIterator,e=a("mode/token_cursor").RTokenCursor,b=a("mode/utils"),c=!1,d=a("mode/r_scope_tree").ScopeManager,r=a("mode/r_scope_tree").ScopeNode;a=function(a,b,c,e,f){this.$session=a;this.$doc=a.getDocument();this.$tokenizer=
b;this.$tokens=Array(this.$doc.getLength());this.$endStates=Array(this.$doc.getLength());this.$statePattern=c;this.$codeBeginPattern=e;this.$codeEndPattern=f;this.$scopes=new d(r);var g=!0,h=function(a,b){g?g=!1:(this.$doc.off("change",m),this.$session.off("changeMode",h))}.bind(this),m=function(a){this.$onDocChange(a)}.bind(this);this.$session.on("changeMode",h);this.$doc.on("change",m)};(function(){function a(a){return"keyword"==a.type&&("function"==a.value||"\\"==a.value)}function d(a){return/\boperator\b/.test(a.type)&&
/^(=|<-|<<-)$/.test(a.value)}function m(a){return/\bidentifier\b/.test(a.type)}function n(b){var c=b.cloneCursor();if("{"!==c.currentValue()||!c.moveBackwardOverMatchingParens()||!c.moveToPreviousToken()||!a(c.currentToken()))return!1;b.$row=c.$row;b.$offset=c.$offset;return!0}function k(a){a=a.cloneCursor();if(!("{"===a.currentValue()&&a.moveToPreviousToken()&&","!=!a.currentToken().value&&a.moveToPreviousToken()&&"string"!=!a.currentToken().type&&a.moveToPreviousToken()&&"("!=!a.currentToken().value&&
a.moveToPreviousToken()))return!1;a=a.currentToken();return m(a)&&"test_that"==a.value}function r(a){for(;a.findOpeningBracket("(")&&a.moveToPreviousToken();)if(g(a.currentValue(),["if","for","while"]))return!0;return!1}function x(b){var c=b.cloneCursor();if(!(a(c.currentToken())&&c.moveToPreviousToken()&&d(c.currentToken())&&c.moveToPreviousToken()))return!1;b.$row=c.$row;b.$offset=c.$offset;return!0}function C(a){return/\binfix\b/.test(a.type)||"|>"===a.value}function t(b){if(a(b.currentToken())&&
!b.moveToNextToken()||"("===b.currentValue()&&!b.moveToNextToken()||")"===b.currentValue())return[];var c=[];for(m(b.currentToken())&&c.push(b.currentValue());b.moveToNextToken();)if(!b.fwdToMatchingToken()){if(")"===b.currentValue())break;if(","===b.currentValue()){for(;","===b.currentValue()&&b.moveToNextToken(););m(b.currentToken())&&c.push(b.currentValue())}}return c}function v(a){for(var c=0,d=Math.min(a.getLength(),100),e="Title";c++<d;){var f=a.getLine(c);if(/^\s*[-]{3}\s*$/.test(f))break;
f=/^\s*title:\s+(.*?)\s*$/.exec(f);if(null!==f){e=f[1];break}}return b.stripEnclosingQuotes(e.trim())}function u(a){return"keyword.operator"===a||"keyword.operator.infix"===a}var H=b.contains;this.getTokenCursor=function(){return new e(this.$tokens,0,0,this)};this.$complements={"(":")",")":"(","[":"]","]":"[","{":"}","}":"{"};var I=function(a){a=a.trim();return a=a.replace(/[\n\s]+/g," ")};this.getFunctionsInScope=function(a){this.$buildScopeTreeUpToRow(a.row);return this.$scopes.getFunctionsInScope(a)};
this.getAllFunctionScopes=function(a){"undefined"===typeof a&&(a=this.$doc.getLength());this.$buildScopeTreeUpToRow(a);return this.$scopes.getAllFunctionScopes()};this.getDplyrJoinContextFromInfixChain=function(a){var b=a.cloneCursor();a="";b.hasType("identifier")&&(a=b.currentValue());var c="left";"="===b.currentValue()&&(c="right");if(b.hasType("identifier")){if(!b.moveToPreviousToken())return null;"="===b.currentValue()&&(c="right")}if(!b.findOpeningBracket("(",!0)||!b.moveToPreviousToken())return null;
for(;b.findOpeningBracket("(",!0)&&b.moveToPreviousToken();)if(/_join$/.test(b.currentValue())){var d=b.currentValue();if(!b.moveToNextToken())break;if(!b.moveToNextToken())break;var e=b.currentValue();if(!1===this.moveToDataObjectFromInfixChain(b))break;b=b.currentValue();return{token:a,leftData:b,rightData:e,verb:d,cursorPos:c}}return null};this.getDataFromInfixChain=function(a){var b=this.moveToDataObjectFromInfixChain(a),c=[],d=[],e="",f=!1;!1!==b&&(b.excludeArgsFromObject&&(f=b.excludeArgsFromObject),
e=a.currentValue(),c=b.additionalArgs,d=b.excludeArgs,1==b.cancel&&(f=!0,c=[],d=[]));return{name:e,additionalArgs:c,excludeArgs:d,excludeArgsFromObject:f}};var L="mutate summarise summarize rename transmute select rename_vars inner_join left_join right_join semi_join anti_join outer_join full_join".split(" "),E=function(a,b,c,d){if(!a.moveToNextToken()||"("!==a.currentValue()||!a.moveToNextToken()||")"===a.currentValue())return!1;a.hasType("identifier")&&b.additionalArgs.push(a.currentValue());if("rename"===
d){if(!a.moveToNextToken())return!1;if("="===a.currentValue()){if(!a.moveToNextToken())return!1;b.excludeArgs.push(a.currentValue())}}"select"===d&&(b.excludeArgsFromObject=!0);do{if(")"===a.currentValue())break;if(a.$row>c.$row||a.$row===c.$row&&a.$offset>=c.$offset)break;if(a.fwdToMatchingToken()){if(!a.moveToNextToken())break}else if(","===a.currentValue()){if(!a.moveToNextToken())return!1;a.hasType("identifier")&&b.additionalArgs.push(a.currentValue());if(!a.moveToNextToken())return!1;if("="===
a.currentValue()&&g(d,["rename","rename_vars"])){if(!a.moveToNextToken())return!1;a.hasType("identifier")&&b.excludeArgs.push(a.currentValue())}}}while(a.moveToNextToken());return!0};this.moveToDataObjectFromInfixChain=function(a){var b=a.cloneCursor(),c;a:{for(c=b.cloneCursor();c.findOpeningBracket("(",!1)&&c.moveToPreviousToken()&&c.moveToPreviousToken();){if(":"===c.currentValue()){for(;":"===c.currentValue();)if(!c.moveToPreviousToken()){c=!1;break a}if(!c.moveToPreviousToken())break}if(C(c.currentToken())){b.$row=
c.$row;b.$offset=c.$offset;c=!0;break a}}c=!1}if(!c)return!1;for(c={additionalArgs:[],excludeArgs:[],cancel:!1};;){if(0===b.$row&&0===b.$offset)return a.$row=0,a.$offset=0,c;b.moveBackwardOverMatchingParens();if(!b.moveToPreviousToken())return!1;var d=b.currentValue();"pull"===d&&(c.cancel=!0);H(L,d)&&E(b.cloneCursor(),c,a,d);if(!b.moveToPreviousToken())return 0===b.$row&&0===b.$offset?(a.$row=0,a.$offset=0,c):!1;if(":"===b.currentValue()){for(;":"===b.currentValue();)if(!b.moveToPreviousToken())return!1;
if(!b.moveToPreviousToken())return!1}if(!C(b.currentToken()))break}if(!b.moveToNextToken())return!1;a.$row=b.$row;a.$offset=b.$offset;return c};this.getVariablesInScope=function(b){var c=this.getTokenCursor();if(!c.moveToPosition(b))return[];b=c.cloneCursor();b.findOpeningBracket("(",!0)?b.moveToPreviousToken()?(c.$row=b.$row,c.$offset=b.$offset,b=!0):b=!1:b=!1;b&&(a(c.currentToken())?b=x(c):(b=c.cloneCursor(),m(b.currentToken())&&b.moveToPreviousToken()&&d(b.currentToken())&&b.moveToPreviousToken()?
(c.$row=b.$row,c.$offset=b.$offset,b=!0):b=!1),b&&c.findStartOfEvaluationContext());b={};do if(!c.bwdToMatchingToken()){var e=b,f=c.cloneCursor();if("for"===f.currentValue()&&f.moveToNextToken()&&"("===f.currentValue()&&f.moveToNextToken()){var g=f.currentValue();f.moveToNextToken()&&"in"===f.currentValue()&&(e[g]="variable")}d(c.currentToken())&&(e="variable",f=c.cloneCursor(),f.moveToNextToken()&&"function"===f.currentValue()&&(e="function"),f=c.cloneCursor(),f.moveToPreviousToken()&&m(f.currentToken())&&
(f=f.currentValue(),b[f]=e))}while(c.moveToPreviousToken());c=[];for(var h in b)c.push({token:h,type:b[h]});c.sort();return c};this.$buildScopeTreeUpToRow=function(a){function c(a,c,d){if("undefined"===typeof a)return"";if(c=a.exec(c))if(a=c[1],a=a.split(","),0<a.length){c=a[0];if(!/=/.test(c)&&(c=c.replace(/(^\s+)|(\s+$)/g,""),c.length))return c;for(var e=0;e<a.length;e++)if(c=/^\s*label\s*=\s*(.*)$/.exec(a[e]))return b.stripEnclosingQuotes(c[1].trim())}d=d.clone();for(a=d.moveToNextToken();null!=
a&&a.type.startsWith("comment");){a=a.value;c=/^#\|\s*label\s*:\s*(.*)$/;if(c.test(a))return a.replace(c,"$1");a=d.moveToNextToken()}return null}var d=this.$session.getMode().$id;a=Math.min(a+30,this.$doc.getLength()-1);var e=this.$scopes.parsePos.row;if(e>=a)return e;e=new f(this.$session);e.tokenizeUpToRow(a);this.$tokenizeUpToRow(a);var g=this.$scopes.parsePos.row;e.moveToPosition({row:g,column:this.$scopes.parsePos.column},!0);var m=e.getCurrentToken();if(null==m)return g;var p=m.value,q=m.type,
l=e.getCurrentTokenPosition();g=this.$scopes.getChunkCount();do{if(e.$row>a)break;p=m.value;q=m.type;l=e.getCurrentTokenPosition();m=b.getPrimaryState(this.$session,l.row);if("rdoc-start"===m)e.moveToEndOfRow();else{var r=!0;this.$codeBeginPattern&&(r=/^r-/.test(m));if(b.startsWith(q,"markup.heading")){q="";r={row:l.row,column:0};var y={row:l.row+1,column:0};m=0;if(/^\s*#+\s*$/.test(p))m=p.split("#").length-1,p=this.$session.getLine(l.row),q=p.replace(/^\s*[#]+\s*/,"");else if(/^[-=]{3,}\s*$/.test(p)&&
(m="="===p[0]?1:2,q=this.$session.getLine(l.row-1).trim(),r.row--,0===q.length))continue;0===q.length&&(q="(Untitled)");q=q.replace(/{.*}\s*$/,"");this.$scopes.onMarkdownHead(q,r,y,m,!0)}else if(r&&/\bsectionhead\b/.test(q)){q="(Untitled)";if(m=/[^#=-\s]/.exec(p))q=p.substr(m.index),q=q.replace(/\s*[#=-]+\s*$/,"");p=/^\s*([#]+)\s*\w/.exec(p);if(null!=p)if(m=p[1].length,6<m)this.$scopes.onSectionStart(q,l);else r={row:l.row,column:0},y={row:l.row,column:Infinity},this.$scopes.onMarkdownHead(q,r,y,
m,!1);else this.$scopes.onSectionStart(q,l)}else if(r||"mode/sweave"!==d||"keyword"!==q||0!==l.column||0!==p.indexOf("\\")||"\\chapter"!==p&&"\\section"!==p&&"\\subsection"!==p&&"\\subsubsection"!==p)if(/\bcodebegin\b/.test(q)&&"---"===p)p=v(this.$session),this.$scopes.onSectionStart(p,l,{isYaml:!0});else if(/\bcodeend\b/.test(q)&&"---"===p)l.column=Infinity,this.$scopes.onSectionEnd(l);else if("mode/rmarkdown"===d&&/\bcodebegin\b/.test(q)&&0===p.trim().indexOf("/***"))this.$scopes.onSectionStart("(R Code Chunk)",
l);else if("mode/rmarkdown"===d&&/\bcodeend\b/.test(q)&&0===p.trim().indexOf("*/"))this.$scopes.onSectionEnd(l);else/\bcodebegin\b/.test(q)?(g++,q={row:l.row+1,column:0},r=g,m=c(this.$codeBeginPattern,p,e),r="Chunk "+r,m&&"YAML Header"!==p&&(r+=": "+m),this.$scopes.onChunkStart(m,r,l,q)):/\bcodeend\b/.test(q)?(l.column+=p.length,this.$scopes.onChunkEnd(l)):r&&"{"===p?(p=this.getTokenCursor(),p.moveToPosition(l,!0),q=p.cloneCursor(),n(q)?(m=q.cloneCursor(),m.moveToNextToken(),l=null,x(q)&&(r=q.cloneCursor(),
y=q.cloneCursor(),y.findStartOfEvaluationContext()&&(l=y.currentPosition(),y=r.currentPosition(),l.row!==y.row?(l.row=y.row,l.column=0,q.$row=l.row,q.$offset=0):q.moveToPosition(l,!0),l=this.$doc.getTextRange(new h(l.row,l.column,y.row,y.column+r.currentValue().length)))),r=q.currentPosition(),q.isFirstSignificantTokenOnLine()&&(r.column=0),q=t(m),m="("+q.join(", ")+")",m=null==l?I("<function>"+m):I(l+m),this.$scopes.onFunctionScopeStart(m,r,p.currentPosition(),l,q)):k(q)?(q=q.cloneCursor(),q.moveToPreviousToken(),
q.moveToPreviousToken(),l=q.currentToken().value,q=q.cloneCursor(),q.moveToPreviousToken(),q.moveToPreviousToken(),this.$scopes.onTestScopeStart(l,q.currentPosition(),p.currentPosition())):(r=p.currentPosition(),p.isFirstSignificantTokenOnLine()&&(r.column=0),this.$scopes.onScopeStart(r))):r&&"}"===p&&(l.column+=1,this.$scopes.onScopeEnd(l));else m=1,"\\chapter"===p?m=2:"\\section"===p?m=3:"\\subsection"===p?m=4:"\\subsubsection"===p&&(m=5),p=this.$doc.getLine(l.row),p=/{([^}]*)}/.exec(p),q="",null!=
p&&(q=p[1]),r={row:l.row,column:0},y={row:l.row,column:Infinity},this.$scopes.onMarkdownHead(q,r,y,m,!0)}}while(m=e.moveToNextToken());a=Math.max(a,e.$row);this.$scopes.parsePos={row:a,column:-1};return a};this.$getFoldToken=function(a,b,c){this.$tokenizeUpToRow(c);if(this.$statePattern&&!this.$statePattern.test(this.$endStates[c]))return"";a=this.$tokens[c];for(c=0;c<a.length;c++)if(/\bsectionhead\b/.test(a[c].type))return a[c];var d=0,e=null,f=null;for(c=0;c<a.length;c++){var g=a[c];if(/\bparen\b/.test(g.type))switch(g.value){case "{":d++;
1==d&&(e=g);break;case "}":d--,0==d&&(e=null),0>d&&(f=g,d=0)}}return e?e:"markbeginend"==b&&f?f:1<=a.length&&(/\bcodebegin\b/.test(a[0].type)||/\bcodeend\b/.test(a[0].type))?a[0]:null};this.getFoldWidget=function(a,b,c){a=this.$getFoldToken(a,b,c);return null==a?"":"{"==a.value?"start":"}"==a.value?"end":/\bcodebegin\b/.test(a.type)?"start":/\bcodeend\b/.test(a.type)?"end":/\bsectionhead\b/.test(a.type)?"start":""};this.getFoldWidgetRange=function(a,c,d){var e=this.$getFoldToken(a,c,d);if(e){c={row:d,
column:e.column+1};if("{"==e.value)return(a=a.$findClosingBracket(e.value,c,b.getTokenTypeRegex("paren")))?h.fromPoints(c,a):void 0;if("}"==e.value)return(a=a.$findOpeningBracket(e.value,c,b.getTokenTypeRegex("paren")))?h.fromPoints({row:a.row,column:a.column+1},{row:c.row,column:c.column-1}):void 0;if(/\bcodebegin\b/.test(e.type)){c=new f(a,d,0);for(var g;g=c.stepForward();)if(/\bcode(begin|end)\b/.test(g.type))return g=/\bcodebegin\b/.test(g.type),c=c.getCurrentTokenRow(),a=g?{row:c-1,column:a.getLine(c-
1).length}:{row:c,column:a.getLine(c).length},h.fromPoints({row:d,column:e.column+e.value.length},a)}else if(/\bcodeend\b/.test(e.type))for(c=new f(a,d,0);e=c.stepBackward();){if(/\bcodebegin\b/.test(e.type))return c=c.getCurrentTokenRow(),h.fromPoints({row:c,column:a.getLine(c).length},{row:d,column:a.getLine(d).length})}else if(/\bsectionhead\b/.test(e.type)){e=a.getLine(d);if(/^\s*[#=-]+\s*$/.test(e))e=e.length;else{e=/[#=-]+\s*$/.exec(e);if(!e)return;e=e.index}c.column=e;d=new f(a,d+1);for(d.$tokenIndex=
-1;(token=d.stepForward())&&"}"!==token.value&&!/\bsectionhead\b/.test(token.type)&&!/\bcode(?:begin|end)/.test(token.type);)"{"===token.value&&d.fwdToMatchingToken();d=d.getCurrentTokenRow();token&&d--;a={row:d,column:a.getLine(d).length};return h.fromPoints(c,a)}}};this.getCurrentScope=function(a,b){b||(b=function(a){return!0});if(!a)return"";this.$buildScopeTreeUpToRow(a.row);var c=this.$scopes.getActiveScopes(a);if(c)for(var d=c.length-1;0<=d;d--)if(b(c[d]))return c[d];return null};this.getScopeTree=
function(){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.getScopeList()};this.findFunctionDefinitionFromUsage=function(a,b){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.findFunctionDefinitionFromUsage(a,b)};this.getIndentForOpenBrace=function(a){if(this.$tokenizeUpToRow(a.row)){var b=this.getTokenCursor();if(b.seekToNearestToken(a,a.row)&&"{"==b.currentValue()&&b.moveBackwardOverMatchingParens())return this.$getIndent(this.$getLine(b.currentPosition().row))}return this.$getIndent(this.$getLine(a.row))};
this.getIndentForRow=function(a){return this.getNextLineIndent("start",this.$getLine(a),this.$session.getTabString(),a)};this.getNextLineIndent=function(a,e,f,h){if(b.endsWith(a,"qstring"))return this.$getIndent(e);"number"!==typeof h&&(h=this.$session.getSelection().getCursor().row-1);var m=this.$session.getTabSize();a=Array(m+1).join(" ");this.$lineOverrides=null;this.$doc.getLine(h)!==e&&(this.$lineOverrides={},this.$lineOverrides[h]=e,this.$invalidateRow(h));try{var p=0>h?"":this.$getIndent(this.$getLine(h));
if(!this.$tokenizeUpToRow(h))return p;var q={row:h,column:this.$getLine(h).length},n=this.$findPreviousSignificantToken(q,h-10);e=this.$session.getLine(h);if(/\bfunction\s*\(\s*$/.test(e))return this.$getIndent(h)+f+f;p="";var k=!1;if(n&&u(n.token.type))p=f,k=!0;else if(n&&/\bparen\b/.test(n.token.type)&&/\)$/.test(n.token.value)){var w=this.$walkParensBalanced(n.row,n.row-10,null,function(a,b,c){return 0===a.length});if(null!=w){var z=this.$findPreviousSignificantToken(w,0);if(z&&"keyword"===z.token.type&&
/^(if|while|for|function)$/.test(z.token.value))return this.$getIndent(this.$getLine(z.row))+f}}else if(n&&"keyword"===n.token.type&&("repeat"===n.token.value||"else"===n.token.value))return this.$getIndent(this.$getLine(n.row))+f;var t=this.getTokenCursor();if(!t.moveToPosition(q))return"";do{var y=t.currentType();if("support.function.codebegin"===y||"support.function.codeend"===y)return this.$getIndent(this.$doc.getLine(t.$row))+p;var x=t.currentValue();if(t.isAtStartOfNewExpression(!1)){if("{"===
x||"["===x||"("===x)p+=f;return this.$getIndent(this.$doc.getLine(t.$row))+p}if("("===x&&t.isAtStartOfNewExpression(!0))return this.$getIndent(this.$doc.getLine(t.$row))+f;if(!t.bwdToMatchingToken()){if("{"===x)break;if(H(["[","("],x)){var A=t.currentPosition();q=null;c&&(q=this.$findNextSignificantToken({row:A.row,column:A.column+1},h));if(q){e=this.$getLine(q.row);var v=e.replace(/[^\s].*$/,""),F=q.column-v.length,C=Math.floor(F/m);A=F-m*C;F="";for(e=0;e<C;e++)F+=f;for(f=0;f<A;f++)F+=" ";f=v+F;
var J=f.replace("\t",a).length;for(e=q.row+1;e<=h;e++)if(/[^\s]/.test(this.$getLine(e))){var K=this.$endStates[e-1];if("qstring"!==K&&"qqstring"!==K){var I=this.$getLine(e).replace(/[^\s].*$/,"");var E=I.replace("\t",a).length;E<J&&(f=I,J=E)}}return r(t)?f:f+p}return this.getIndentForOpenBrace(A)+f+p}}}while(t.moveToPreviousToken());if(!t.moveToPosition(q))return"";do if(!t.bwdToMatchingToken()){if("{"===t.currentValue())return this.getIndentForOpenBrace(t.currentPosition())+f+p;if(d(t.currentToken())){for(;d(t.currentToken())&&
t.moveToPreviousToken()&&t.findStartOfEvaluationContext();){var B=t.cloneCursor();if(B.moveToPreviousToken()){if("else"===B.currentValue()||"repeat"===B.currentValue())return this.$getIndent(this.$doc.getLine(B.$row))+p+p;if(")"===B.currentValue()&&B.bwdToMatchingToken()&&B.moveToPreviousToken()&&l(B.currentValue())){e=this.$doc.getLine(B.$row);if(!k)for(;B.moveToPreviousToken()&&")"===B.currentValue()&&B.bwdToMatchingToken()&&B.moveToPreviousToken()&&l(B.currentValue());)e=this.$doc.getLine(B.$row);
return this.$getIndent(e)+p+p}}d(t.peekBwd().currentToken())&&t.moveToPreviousToken()}return this.$getIndent(this.$getLine(t.$row))+p}}while(t.moveToPreviousToken());if(k){J=0;t=this.getTokenCursor();t.moveToPosition(q);t.moveToPreviousToken();do{if(g(t.currentValue(),["if","else"])){p+=f;break}if(t.hasType("constant","identifier")){if(!t.moveToPreviousToken())break;if(g(t.currentValue(),["if","else"])){p+=f;break}if(")"===t.currentValue()){if(!t.bwdToMatchingToken())break;if(!t.moveToPreviousToken())break;
if(g(t.currentValue(),["if","else"])){p+=f;break}}if(!t.hasType("operator"))break}else if(!t.findStartOfEvaluationContext())break}while(t.moveToPreviousToken()&&20>J++)}var L=this.$findNextSignificantToken({row:0,column:0},h);return L?this.$getIndent(this.$getLine(L.row))+p:""+p}finally{this.$lineOverrides&&(this.$lineOverrides=null,this.$invalidateRow(h))}};this.getBraceIndent=function(a){var b=this.getTokenCursor(),c={row:a,column:this.$getLine(a).length};if(!b.moveToPosition(c))return"";if(")"===
b.currentValue()){if(b.bwdToMatchingToken()&&b.moveToPreviousToken()&&(c=b.currentValue(),g(c,["if","while","for","function"])))return this.$getIndent(this.$getLine(b.$row))}else if(g(b.currentValue(),["else","repeat"]))return this.$getIndent(this.$getLine(b.$row));return this.getIndentForRow(a)};this.getTokenForPos=function(a,b,c){this.$tokenizeUpToRow(a.row);if(this.$tokens.length<=a.row)return null;for(var d=this.$tokens[a.row],e=0;e<d.length;e++){var f=d[e];if(b&&a.column==f.column)return f;if(a.column<=
f.column)break;if(c&&a.column==f.column+f.value.length||a.column<f.column+f.value.length)return f}return null};this.$tokenizeUpToRow=function(a){a=Math.min(a,this.$endStates.length-1);for(var b=0,c=!0;b<=a;b++)if(!c||!this.$endStates[b]){c=!1;var d=0===b?"start":this.$endStates[b-1],e=this.$getLine(b);e=this.$tokenizer.getLineTokens(e,d,b);!this.$statePattern||this.$statePattern.test(e.state)||this.$statePattern.test(d)?this.$tokens[b]=this.$filterWhitespaceAndComments(e.tokens):this.$tokens[b]=[];
e.state===this.$endStates[b]?c=!0:this.$endStates[b]=e.state}c||b<this.$tokens.length&&this.$invalidateRow(b);return!0};this.$onDocChange=function(a){"insert"===a.action?this.$insertNewRows(a.start.row,a.end.row-a.start.row):this.$removeRows(a.start.row,a.end.row-a.start.row);this.$invalidateRow(a.start.row);this.$scopes.invalidateFrom(a.start)};this.$invalidateRow=function(a){this.$tokens[a]=null;this.$endStates[a]=null};this.$insertNewRows=function(a,b){for(var c=[a,0],d=0;d<b;d++)c.push(null);
this.$tokens.splice.apply(this.$tokens,c);this.$endStates.splice.apply(this.$endStates,c)};this.$removeRows=function(a,b){this.$tokens.splice(a,b);this.$endStates.splice(a,b)};this.$getIndent=function(a){return(a=/^([ \t]*)/.exec(a))?a[1]:""};this.$getLine=function(a){return this.$lineOverrides&&"undefined"!=typeof this.$lineOverrides[a]?this.$lineOverrides[a]:this.$doc.getLine(a)};this.$walkParens=function(a,b,c){var d=/\bparen\b/;return a<b?function(){for(;a<=b;a++)for(var e=this.$tokens[a],f=0;f<
e.length;f++)if(d.test(e[f].type)&&!c(e[f].value,{row:a,column:e[f].column}))return!1;return!0}.call(this):function(){a=Math.max(0,a);for(b=Math.max(0,b);a>=b;a--)for(var e=this.$tokens[a],f=e.length-1;0<=f;f--)if(d.test(e[f].type)&&!c(e[f].value,{row:a,column:e[f].column}))return!1;return!0}.call(this)};this.$walkParensBalanced=function(a,b,c,d){var e=[],f=null,g=this;this.$walkParens(a,b,function(a,b){if(c&&c(e,a,b))return f=b,!1;if(/[\[({]/.test(a))if(e[e.length-1]===g.$complements[a])e.pop();
else return!0;else e.push(a);return d&&d(e,a,b)?(f=b,!1):!0});return f};this.$findNextSignificantToken=function(a,b){if(0==this.$tokens.length)return null;b=Math.min(b,this.$tokens.length-1);for(var c=a.row,d=a.column;c<=b;c++){for(var e=this.$tokens[c],f=0;f<e.length;f++)if(e[f].column+e[f].value.length>d)return{token:e[f],row:c,column:Math.max(e[f].column,d),offset:f};d=0}return null};this.findNextSignificantToken=function(a){return this.$findNextSignificantToken(a,this.$tokens.length-1)};this.$findPreviousSignificantToken=
function(a,b){if(0===this.$tokens.length)return null;b=Math.max(0,b);for(var c=Math.min(a.row,this.$tokens.length-1);c>=b;c--){var d=this.$tokens[c];if(0!==d.length){if(c!=a.row)return{row:c,column:d[d.length-1].column,token:d[d.length-1],offset:d.length-1};for(var e=d.length-1;0<=e;e--)if(d[e].column<a.column)return{row:c,column:d[e].column,token:d[e],offset:e}}}};this.$filterWhitespaceAndComments=function(a){a=a.filter(function(a){a=/\bcode(?:begin|end)\b/.test(a.type)?!1:/\bsectionhead\b/.test(a.type)?
!1:/^\s*$/.test(a.value)||a.type.match(/\b(?:ace_virtual-)?comment\b/);return!a});for(var b=a.length-1;0<=b;b--)if(1<a[b].value.length&&/\bparen\b/.test(a[b].type)){var c=a[b];a.splice(b,1);for(var d=c.value.length-1;0<=d;d--){var e={type:c.type,value:c.value.charAt(d),column:c.column+d};a.splice(b,0,e)}}return a}}).call(a.prototype);k.RCodeModel=a;k.setVerticallyAlignFunctionArgs=function(a){c=a};k.getVerticallyAlignFunctionArgs=function(){return c}});var $jscomp$templatelit$0=["(?:\\|_|[p{L}p{Nl}.][p{L}p{Nl}p{Mn}p{Mc}p{Nd}p{Pc}.]*)"];$jscomp$templatelit$0.raw=["(?:\\\\|_|[\\p{L}\\p{Nl}.][\\p{L}\\p{Nl}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}.]*)"];var $colorFunctionCalls=!1;
define("mode/r_highlight_rules",["require","exports","module"],function(a,k,n){function g(a){for(var b=Array(a.length),c=0;c<a.length;c++)b[c]={include:a[c]};return b}n=a("ace/lib/oop");var l=a("ace/lib/lang"),h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules,e=a("mode/utils"),b=function(){this.$rules={start:[{token:"comment",regex:"@@",merge:!1},{token:"keyword",regex:"\\\\[a-zA-Z0-9]+",merge:!1},{token:["keyword","comment"],
regex:"(@(?:export|field|inheritParams|name|param|rdname|slot|template|useDynLib))(\\s+)(?=[a-zA-Z0-9._-])",merge:!1,next:"rdoc-highlight"},{token:"keyword",regex:"@(?!@)[^ ]*",merge:!1},{token:["paren.keyword.operator","comment"],regex:"(\\[)(=)",merge:!1,next:"markdown-link"},{token:"paren.keyword.operator",regex:"\\[",merge:!1,next:"markdown-link"},{token:["support.function","support.function","support.function"],regex:"(`+)(.*?[^`])(\\1)",merge:!1},{token:["comment","constant.language.boolean"],
regex:"(\\s+|^)(__.+?__)\\b",merge:!1},{token:["comment","constant.language.boolean"],regex:"(\\s+|^)(_(?=[^_])(?:(?:\\\\.)|(?:[^_\\\\]))*?_)\\b",merge:!1},{token:["constant.numeric"],regex:"([*][*].+?[*][*])",merge:!1},{token:["constant.numeric"],regex:"([*](?=[^*])(?:(?:\\\\.)|(?:[^*\\\\]))*?[*])",merge:!1},{token:"paren.keyword.operator",regex:"(?:[[({]|[\\])}])",merge:!1},{defaultToken:"comment"}],highlight:[{token:"identifier.support.function",regex:"[^ ,]+"},{token:"comment",regex:","},{token:"comment",
regex:"\\s*",next:"start"}],"markdown-link":[{token:"paren.keyword.operator",regex:"\\]",next:"start"},{token:["identifier.support.class","comment"],regex:"([a-zA-Z0-9_.]+)(:{1,3})"},{token:"support.function",regex:"`.*?`"},{token:"support.function",regex:"[^{}()[\\]]+"},{token:"paren.keyword.operator",regex:"(?:[[({]|[\\])}])"},{defaultToken:"comment"}]};this.normalizeRules()};n.inherits(b,h);var c=function(a,b,c){return[{type:"string",value:a},{type:"string.color",value:b,bg:c},{type:"string",value:a}]};
a=function(){var a=l.arrayToMap("\\ function if else in break next repeat for while".split(" ")),h=l.arrayToMap("return switch try tryCatch stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass setRefClass R6Class UseMethod NextMethod".split(" ")),q=l.arrayToMap("NULL NA TRUE FALSE T F Inf NaN NA_integer_ NA_real_ NA_character_ NA_complex_".split(" ")),p=new Map([["white","ffffff"],["aliceblue","f0f8ff"],["antiquewhite","faebd7"],["antiquewhite1","ffefdb"],
["antiquewhite2","eedfcc"],["antiquewhite3","cdc0b0"],["antiquewhite4","8b8378"],["aquamarine","7fffd4"],["aquamarine1","7fffd4"],["aquamarine2","76eec6"],["aquamarine3","66cdaa"],["aquamarine4","458b74"],["azure","f0ffff"],["azure1","f0ffff"],["azure2","e0eeee"],["azure3","c1cdcd"],["azure4","838b8b"],["beige","f5f5dc"],["bisque","ffe4c4"],["bisque1","ffe4c4"],["bisque2","eed5b7"],["bisque3","cdb79e"],["bisque4","8b7d6b"],["black","000000"],["blanchedalmond","ffebcd"],["blue","0000ff"],["blue1",
"0000ff"],["blue2","0000ee"],["blue3","0000cd"],["blue4","00008b"],["blueviolet","8a2be2"],["brown","a52a2a"],["brown1","ff4040"],["brown2","ee3b3b"],["brown3","cd3333"],["brown4","8b2323"],["burlywood","deb887"],["burlywood1","ffd39b"],["burlywood2","eec591"],["burlywood3","cdaa7d"],["burlywood4","8b7355"],["cadetblue","5f9ea0"],["cadetblue1","98f5ff"],["cadetblue2","8ee5ee"],["cadetblue3","7ac5cd"],["cadetblue4","53868b"],["chartreuse","7fff00"],["chartreuse1","7fff00"],["chartreuse2","76ee00"],
["chartreuse3","66cd00"],["chartreuse4","458b00"],["chocolate","d2691e"],["chocolate1","ff7f24"],["chocolate2","ee7621"],["chocolate3","cd661d"],["chocolate4","8b4513"],["coral","ff7f50"],["coral1","ff7256"],["coral2","ee6a50"],["coral3","cd5b45"],["coral4","8b3e2f"],["cornflowerblue","6495ed"],["cornsilk","fff8dc"],["cornsilk1","fff8dc"],["cornsilk2","eee8cd"],["cornsilk3","cdc8b1"],["cornsilk4","8b8878"],["cyan","00ffff"],["cyan1","00ffff"],["cyan2","00eeee"],["cyan3","00cdcd"],["cyan4","008b8b"],
["darkblue","00008b"],["darkcyan","008b8b"],["darkgoldenrod","b8860b"],["darkgoldenrod1","ffb90f"],["darkgoldenrod2","eead0e"],["darkgoldenrod3","cd950c"],["darkgoldenrod4","8b6508"],["darkgray","a9a9a9"],["darkgreen","006400"],["darkgrey","a9a9a9"],["darkkhaki","bdb76b"],["darkmagenta","8b008b"],["darkolivegreen","556b2f"],["darkolivegreen1","caff70"],["darkolivegreen2","bcee68"],["darkolivegreen3","a2cd5a"],["darkolivegreen4","6e8b3d"],["darkorange","ff8c00"],["darkorange1","ff7f00"],["darkorange2",
"ee7600"],["darkorange3","cd6600"],["darkorange4","8b4500"],["darkorchid","9932cc"],["darkorchid1","bf3eff"],["darkorchid2","b23aee"],["darkorchid3","9a32cd"],["darkorchid4","68228b"],["darkred","8b0000"],["darksalmon","e9967a"],["darkseagreen","8fbc8f"],["darkseagreen1","c1ffc1"],["darkseagreen2","b4eeb4"],["darkseagreen3","9bcd9b"],["darkseagreen4","698b69"],["darkslateblue","483d8b"],["darkslategray","2f4f4f"],["darkslategray1","97ffff"],["darkslategray2","8deeee"],["darkslategray3","79cdcd"],
["darkslategray4","528b8b"],["darkslategrey","2f4f4f"],["darkturquoise","00ced1"],["darkviolet","9400d3"],["deeppink","ff1493"],["deeppink1","ff1493"],["deeppink2","ee1289"],["deeppink3","cd1076"],["deeppink4","8b0a50"],["deepskyblue","00bfff"],["deepskyblue1","00bfff"],["deepskyblue2","00b2ee"],["deepskyblue3","009acd"],["deepskyblue4","00688b"],["dimgray","696969"],["dimgrey","696969"],["dodgerblue","1e90ff"],["dodgerblue1","1e90ff"],["dodgerblue2","1c86ee"],["dodgerblue3","1874cd"],["dodgerblue4",
"104e8b"],["firebrick","b22222"],["firebrick1","ff3030"],["firebrick2","ee2c2c"],["firebrick3","cd2626"],["firebrick4","8b1a1a"],["floralwhite","fffaf0"],["forestgreen","228b22"],["gainsboro","dcdcdc"],["ghostwhite","f8f8ff"],["gold","ffd700"],["gold1","ffd700"],["gold2","eec900"],["gold3","cdad00"],["gold4","8b7500"],["goldenrod","daa520"],["goldenrod1","ffc125"],["goldenrod2","eeb422"],["goldenrod3","cd9b1d"],["goldenrod4","8b6914"],["gray","bebebe"],["gray0","000000"],["gray1","030303"],["gray2",
"050505"],["gray3","080808"],["gray4","0a0a0a"],["gray5","0d0d0d"],["gray6","0f0f0f"],["gray7","121212"],["gray8","141414"],["gray9","171717"],["gray10","1a1a1a"],["gray11","1c1c1c"],["gray12","1f1f1f"],["gray13","212121"],["gray14","242424"],["gray15","262626"],["gray16","292929"],["gray17","2b2b2b"],["gray18","2e2e2e"],["gray19","303030"],["gray20","333333"],["gray21","363636"],["gray22","383838"],["gray23","3b3b3b"],["gray24","3d3d3d"],["gray25","404040"],["gray26","424242"],["gray27","454545"],
["gray28","474747"],["gray29","4a4a4a"],["gray30","4d4d4d"],["gray31","4f4f4f"],["gray32","525252"],["gray33","545454"],["gray34","575757"],["gray35","595959"],["gray36","5c5c5c"],["gray37","5e5e5e"],["gray38","616161"],["gray39","636363"],["gray40","666666"],["gray41","696969"],["gray42","6b6b6b"],["gray43","6e6e6e"],["gray44","707070"],["gray45","737373"],["gray46","757575"],["gray47","787878"],["gray48","7a7a7a"],["gray49","7d7d7d"],["gray50","7f7f7f"],["gray51","828282"],["gray52","858585"],["gray53",
"878787"],["gray54","8a8a8a"],["gray55","8c8c8c"],["gray56","8f8f8f"],["gray57","919191"],["gray58","949494"],["gray59","969696"],["gray60","999999"],["gray61","9c9c9c"],["gray62","9e9e9e"],["gray63","a1a1a1"],["gray64","a3a3a3"],["gray65","a6a6a6"],["gray66","a8a8a8"],["gray67","ababab"],["gray68","adadad"],["gray69","b0b0b0"],["gray70","b3b3b3"],["gray71","b5b5b5"],["gray72","b8b8b8"],["gray73","bababa"],["gray74","bdbdbd"],["gray75","bfbfbf"],["gray76","c2c2c2"],["gray77","c4c4c4"],["gray78","c7c7c7"],
["gray79","c9c9c9"],["gray80","cccccc"],["gray81","cfcfcf"],["gray82","d1d1d1"],["gray83","d4d4d4"],["gray84","d6d6d6"],["gray85","d9d9d9"],["gray86","dbdbdb"],["gray87","dedede"],["gray88","e0e0e0"],["gray89","e3e3e3"],["gray90","e5e5e5"],["gray91","e8e8e8"],["gray92","ebebeb"],["gray93","ededed"],["gray94","f0f0f0"],["gray95","f2f2f2"],["gray96","f5f5f5"],["gray97","f7f7f7"],["gray98","fafafa"],["gray99","fcfcfc"],["gray100","ffffff"],["green","00ff00"],["green1","00ff00"],["green2","00ee00"],["green3",
"00cd00"],["green4","008b00"],["greenyellow","adff2f"],["grey","bebebe"],["grey0","000000"],["grey1","030303"],["grey2","050505"],["grey3","080808"],["grey4","0a0a0a"],["grey5","0d0d0d"],["grey6","0f0f0f"],["grey7","121212"],["grey8","141414"],["grey9","171717"],["grey10","1a1a1a"],["grey11","1c1c1c"],["grey12","1f1f1f"],["grey13","212121"],["grey14","242424"],["grey15","262626"],["grey16","292929"],["grey17","2b2b2b"],["grey18","2e2e2e"],["grey19","303030"],["grey20","333333"],["grey21","363636"],
["grey22","383838"],["grey23","3b3b3b"],["grey24","3d3d3d"],["grey25","404040"],["grey26","424242"],["grey27","454545"],["grey28","474747"],["grey29","4a4a4a"],["grey30","4d4d4d"],["grey31","4f4f4f"],["grey32","525252"],["grey33","545454"],["grey34","575757"],["grey35","595959"],["grey36","5c5c5c"],["grey37","5e5e5e"],["grey38","616161"],["grey39","636363"],["grey40","666666"],["grey41","696969"],["grey42","6b6b6b"],["grey43","6e6e6e"],["grey44","707070"],["grey45","737373"],["grey46","757575"],["grey47",
"787878"],["grey48","7a7a7a"],["grey49","7d7d7d"],["grey50","7f7f7f"],["grey51","828282"],["grey52","858585"],["grey53","878787"],["grey54","8a8a8a"],["grey55","8c8c8c"],["grey56","8f8f8f"],["grey57","919191"],["grey58","949494"],["grey59","969696"],["grey60","999999"],["grey61","9c9c9c"],["grey62","9e9e9e"],["grey63","a1a1a1"],["grey64","a3a3a3"],["grey65","a6a6a6"],["grey66","a8a8a8"],["grey67","ababab"],["grey68","adadad"],["grey69","b0b0b0"],["grey70","b3b3b3"],["grey71","b5b5b5"],["grey72","b8b8b8"],
["grey73","bababa"],["grey74","bdbdbd"],["grey75","bfbfbf"],["grey76","c2c2c2"],["grey77","c4c4c4"],["grey78","c7c7c7"],["grey79","c9c9c9"],["grey80","cccccc"],["grey81","cfcfcf"],["grey82","d1d1d1"],["grey83","d4d4d4"],["grey84","d6d6d6"],["grey85","d9d9d9"],["grey86","dbdbdb"],["grey87","dedede"],["grey88","e0e0e0"],["grey89","e3e3e3"],["grey90","e5e5e5"],["grey91","e8e8e8"],["grey92","ebebeb"],["grey93","ededed"],["grey94","f0f0f0"],["grey95","f2f2f2"],["grey96","f5f5f5"],["grey97","f7f7f7"],["grey98",
"fafafa"],["grey99","fcfcfc"],["grey100","ffffff"],["honeydew","f0fff0"],["honeydew1","f0fff0"],["honeydew2","e0eee0"],["honeydew3","c1cdc1"],["honeydew4","838b83"],["hotpink","ff69b4"],["hotpink1","ff6eb4"],["hotpink2","ee6aa7"],["hotpink3","cd6090"],["hotpink4","8b3a62"],["indianred","cd5c5c"],["indianred1","ff6a6a"],["indianred2","ee6363"],["indianred3","cd5555"],["indianred4","8b3a3a"],["ivory","fffff0"],["ivory1","fffff0"],["ivory2","eeeee0"],["ivory3","cdcdc1"],["ivory4","8b8b83"],["khaki",
"f0e68c"],["khaki1","fff68f"],["khaki2","eee685"],["khaki3","cdc673"],["khaki4","8b864e"],["lavender","e6e6fa"],["lavenderblush","fff0f5"],["lavenderblush1","fff0f5"],["lavenderblush2","eee0e5"],["lavenderblush3","cdc1c5"],["lavenderblush4","8b8386"],["lawngreen","7cfc00"],["lemonchiffon","fffacd"],["lemonchiffon1","fffacd"],["lemonchiffon2","eee9bf"],["lemonchiffon3","cdc9a5"],["lemonchiffon4","8b8970"],["lightblue","add8e6"],["lightblue1","bfefff"],["lightblue2","b2dfee"],["lightblue3","9ac0cd"],
["lightblue4","68838b"],["lightcoral","f08080"],["lightcyan","e0ffff"],["lightcyan1","e0ffff"],["lightcyan2","d1eeee"],["lightcyan3","b4cdcd"],["lightcyan4","7a8b8b"],["lightgoldenrod","eedd82"],["lightgoldenrod1","ffec8b"],["lightgoldenrod2","eedc82"],["lightgoldenrod3","cdbe70"],["lightgoldenrod4","8b814c"],["lightgoldenrodyellow","fafad2"],["lightgray","d3d3d3"],["lightgreen","90ee90"],["lightgrey","d3d3d3"],["lightpink","ffb6c1"],["lightpink1","ffaeb9"],["lightpink2","eea2ad"],["lightpink3","cd8c95"],
["lightpink4","8b5f65"],["lightsalmon","ffa07a"],["lightsalmon1","ffa07a"],["lightsalmon2","ee9572"],["lightsalmon3","cd8162"],["lightsalmon4","8b5742"],["lightseagreen","20b2aa"],["lightskyblue","87cefa"],["lightskyblue1","b0e2ff"],["lightskyblue2","a4d3ee"],["lightskyblue3","8db6cd"],["lightskyblue4","607b8b"],["lightslateblue","8470ff"],["lightslategray","778899"],["lightslategrey","778899"],["lightsteelblue","b0c4de"],["lightsteelblue1","cae1ff"],["lightsteelblue2","bcd2ee"],["lightsteelblue3",
"a2b5cd"],["lightsteelblue4","6e7b8b"],["lightyellow","ffffe0"],["lightyellow1","ffffe0"],["lightyellow2","eeeed1"],["lightyellow3","cdcdb4"],["lightyellow4","8b8b7a"],["limegreen","32cd32"],["linen","faf0e6"],["magenta","ff00ff"],["magenta1","ff00ff"],["magenta2","ee00ee"],["magenta3","cd00cd"],["magenta4","8b008b"],["maroon","b03060"],["maroon1","ff34b3"],["maroon2","ee30a7"],["maroon3","cd2990"],["maroon4","8b1c62"],["mediumaquamarine","66cdaa"],["mediumblue","0000cd"],["mediumorchid","ba55d3"],
["mediumorchid1","e066ff"],["mediumorchid2","d15fee"],["mediumorchid3","b452cd"],["mediumorchid4","7a378b"],["mediumpurple","9370db"],["mediumpurple1","ab82ff"],["mediumpurple2","9f79ee"],["mediumpurple3","8968cd"],["mediumpurple4","5d478b"],["mediumseagreen","3cb371"],["mediumslateblue","7b68ee"],["mediumspringgreen","00fa9a"],["mediumturquoise","48d1cc"],["mediumvioletred","c71585"],["midnightblue","191970"],["mintcream","f5fffa"],["mistyrose","ffe4e1"],["mistyrose1","ffe4e1"],["mistyrose2","eed5d2"],
["mistyrose3","cdb7b5"],["mistyrose4","8b7d7b"],["moccasin","ffe4b5"],["navajowhite","ffdead"],["navajowhite1","ffdead"],["navajowhite2","eecfa1"],["navajowhite3","cdb38b"],["navajowhite4","8b795e"],["navy","000080"],["navyblue","000080"],["oldlace","fdf5e6"],["olivedrab","6b8e23"],["olivedrab1","c0ff3e"],["olivedrab2","b3ee3a"],["olivedrab3","9acd32"],["olivedrab4","698b22"],["orange","ffa500"],["orange1","ffa500"],["orange2","ee9a00"],["orange3","cd8500"],["orange4","8b5a00"],["orangered","ff4500"],
["orangered1","ff4500"],["orangered2","ee4000"],["orangered3","cd3700"],["orangered4","8b2500"],["orchid","da70d6"],["orchid1","ff83fa"],["orchid2","ee7ae9"],["orchid3","cd69c9"],["orchid4","8b4789"],["palegoldenrod","eee8aa"],["palegreen","98fb98"],["palegreen1","9aff9a"],["palegreen2","90ee90"],["palegreen3","7ccd7c"],["palegreen4","548b54"],["paleturquoise","afeeee"],["paleturquoise1","bbffff"],["paleturquoise2","aeeeee"],["paleturquoise3","96cdcd"],["paleturquoise4","668b8b"],["palevioletred",
"db7093"],["palevioletred1","ff82ab"],["palevioletred2","ee799f"],["palevioletred3","cd6889"],["palevioletred4","8b475d"],["papayawhip","ffefd5"],["peachpuff","ffdab9"],["peachpuff1","ffdab9"],["peachpuff2","eecbad"],["peachpuff3","cdaf95"],["peachpuff4","8b7765"],["peru","cd853f"],["pink","ffc0cb"],["pink1","ffb5c5"],["pink2","eea9b8"],["pink3","cd919e"],["pink4","8b636c"],["plum","dda0dd"],["plum1","ffbbff"],["plum2","eeaeee"],["plum3","cd96cd"],["plum4","8b668b"],["powderblue","b0e0e6"],["purple",
"a020f0"],["purple1","9b30ff"],["purple2","912cee"],["purple3","7d26cd"],["purple4","551a8b"],["red","ff0000"],["red1","ff0000"],["red2","ee0000"],["red3","cd0000"],["red4","8b0000"],["rosybrown","bc8f8f"],["rosybrown1","ffc1c1"],["rosybrown2","eeb4b4"],["rosybrown3","cd9b9b"],["rosybrown4","8b6969"],["royalblue","4169e1"],["royalblue1","4876ff"],["royalblue2","436eee"],["royalblue3","3a5fcd"],["royalblue4","27408b"],["saddlebrown","8b4513"],["salmon","fa8072"],["salmon1","ff8c69"],["salmon2","ee8262"],
["salmon3","cd7054"],["salmon4","8b4c39"],["sandybrown","f4a460"],["seagreen","2e8b57"],["seagreen1","54ff9f"],["seagreen2","4eee94"],["seagreen3","43cd80"],["seagreen4","2e8b57"],["seashell","fff5ee"],["seashell1","fff5ee"],["seashell2","eee5de"],["seashell3","cdc5bf"],["seashell4","8b8682"],["sienna","a0522d"],["sienna1","ff8247"],["sienna2","ee7942"],["sienna3","cd6839"],["sienna4","8b4726"],["skyblue","87ceeb"],["skyblue1","87ceff"],["skyblue2","7ec0ee"],["skyblue3","6ca6cd"],["skyblue4","4a708b"],
["slateblue","6a5acd"],["slateblue1","836fff"],["slateblue2","7a67ee"],["slateblue3","6959cd"],["slateblue4","473c8b"],["slategray","708090"],["slategray1","c6e2ff"],["slategray2","b9d3ee"],["slategray3","9fb6cd"],["slategray4","6c7b8b"],["slategrey","708090"],["snow","fffafa"],["snow1","fffafa"],["snow2","eee9e9"],["snow3","cdc9c9"],["snow4","8b8989"],["springgreen","00ff7f"],["springgreen1","00ff7f"],["springgreen2","00ee76"],["springgreen3","00cd66"],["springgreen4","008b45"],["steelblue","4682b4"],
["steelblue1","63b8ff"],["steelblue2","5cacee"],["steelblue3","4f94cd"],["steelblue4","36648b"],["tan","d2b48c"],["tan1","ffa54f"],["tan2","ee9a49"],["tan3","cd853f"],["tan4","8b5a2b"],["thistle","d8bfd8"],["thistle1","ffe1ff"],["thistle2","eed2ee"],["thistle3","cdb5cd"],["thistle4","8b7b8b"],["tomato","ff6347"],["tomato1","ff6347"],["tomato2","ee5c42"],["tomato3","cd4f39"],["tomato4","8b3626"],["turquoise","40e0d0"],["turquoise1","00f5ff"],["turquoise2","00e5ee"],["turquoise3","00c5cd"],["turquoise4",
"00868b"],["violet","ee82ee"],["violetred","d02090"],["violetred1","ff3e96"],["violetred2","ee3a8c"],["violetred3","cd3278"],["violetred4","8b2252"],["wheat","f5deb3"],["wheat1","ffe7ba"],["wheat2","eed8ae"],["wheat3","cdba96"],["wheat4","8b7e66"],["whitesmoke","f5f5f5"],["yellow","ffff00"],["yellow1","ffff00"],["yellow2","eeee00"],["yellow3","cdcd00"],["yellow4","8b8b00"],["yellowgreen","9acd32"]]),m=String.raw($jscomp$templatelit$0),n={"{":"}","[":"]","(":")"},k={"#comment":[{token:"comment.sectionhead",
regex:"#+(?!').*(?:----|====|####)\\s*$",next:"start"},{token:"comment.doc.tag",regex:"#\\s*[|].*$",next:"start"},{token:["comment","comment.keyword.operator"],regex:"(#+['*]\\s*)(TODO|FIXME)\\b",next:"rdoc-start"},{token:"comment",regex:"#+['*]",next:"rdoc-start"},{token:["comment","comment.keyword.operator","comment"],regex:"(#+\\s*)(TODO|FIXME)\\b(.*)$",next:"start"},{token:"comment",regex:"#.*$",next:"start"}],"#string":[{token:"string",regex:"[rR]['\"][-]*[[({]",next:"rawstring",onMatch:function(a,
b,c,d){c=c||[];c[0]=b;c[1]=this.next;c[2]=n[a[a.length-1]]+a.substring(2,a.length-1)+a[1];return this.token}},{token:"string",regex:"([\"'])(#[0-9a-fA-F]{6})([0-9a-fA-F]{2})?(\\1)",next:"start",onMatch:function(a,b,d,e){b=a.substring(0,1);a=a.substring(1,a.length-1);return c(b,a,a)}},{token:"string",regex:"([\"'])(#[0-9a-fA-F]{3})(\\1)",next:"start",onMatch:function(a,b,d,e){b=a.substring(0,1);a=a.substring(1,a.length-1);return c(b,a,a)}},{token:"string",regex:"([\"'])([a-z]+[0-9]*)(\\1)",next:"start",
onMatch:function(a,b,d,e){b=a.substring(0,1);a=a.substring(1,a.length-1);d=p.get(a);return void 0===d?this.token:c(b,a,"#"+d)}},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:"start"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",next:"start"},{token:"string",merge:!0,regex:'["]',next:"qqstring"},{token:"string",merge:!0,regex:"[']",next:"qstring"}],"#number":[{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+[Li]?",merge:!1,next:"start"},{token:"constant.numeric",regex:"(?:(?:\\d+(?:\\.\\d*)?)|(?:\\.\\d+))(?:[eE][+-]?\\d*)?[iL]?",
merge:!1,next:"start"}],"#quoted-identifier":[{token:"identifier",regex:"[`](?:(?:\\\\.)|(?:[^`\\\\]))*?[`]",merge:!1,next:"start"}]};k["#keyword-or-identifier"]=[{token:function(b){return q.hasOwnProperty(b)?"constant.language":a.hasOwnProperty(b)?"keyword":b.match(/^\.\.\d+$/)?"variable.language":"identifier"},regex:m,unicode:!0,merge:!1,next:"start"}];k["#package-access"]=[{token:function(a){return $colorFunctionCalls?"identifier.support.class":"identifier"},regex:m+"(?=\\s*::)",unicode:!0,merge:!1,
next:"start"}];k["#function-call"]=[{token:function(a){return $colorFunctionCalls?"identifier.support.function":"identifier"},regex:m+"(?=\\s*\\()",unicode:!0,merge:!1,next:"start"}];k["#function-call-or-keyword"]=[{token:function(b){return h.hasOwnProperty(b)||a.hasOwnProperty(b)?"keyword":$colorFunctionCalls?"identifier.support.function":"identifier"},regex:m+"(?=\\s*\\()",unicode:!0,merge:!1,next:"start"}];k["#operator"]=[{token:"keyword.operator",regex:"\\$|@",merge:!1,next:"afterDollar"},{token:"keyword.operator",
regex:":::|::|:=|\\|>|=>|%%|>=|<=|==|!=|<<-|->>|->|<-|\\|\\||&&|=|\\+|-|\\*\\*?|/|\\^|>|<|!|&|\\||~|\\$|:|@|\\?",merge:!1,next:"start"},{token:"keyword.operator.infix",regex:"%.*?%",merge:!1,next:"start"},f.getParenRule(),{token:function(a){return $colorFunctionCalls?"punctuation.keyword.operator":"punctuation"},regex:"[;]",merge:!1,next:"start"},{token:function(a){return $colorFunctionCalls?"punctuation.keyword.operator":"punctuation"},regex:"[,]",merge:!1,next:"start"}];k["#knitr-embed"]=[{token:"constant.language",
regex:"^[<][<][^>]+[>][>]$",merge:!1}];k["#text"]=[{token:"text",regex:"\\s+"}];k.start=g("#comment #string #number #package-access #quoted-identifier #function-call-or-keyword #keyword-or-identifier #knitr-embed #operator #text".split(" "));k.afterDollar=g("#comment #string #number #quoted-identifier #function-call #keyword-or-identifier #operator #text".split(" "));k.rawstring=[{token:"string",regex:"[\\]})][-]*['\"]",onMatch:function(a,b,c,d){this.next=a===c[2]?c[0]:c[1];return this.token}},{defaultToken:"string"}];
k.qqstring=[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+",merge:!0}];k.qstring=[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+",merge:!0}];this.$rules=k;m=(new b).getRules();for(var z in m){k=m[z];for(var x=0;x<k.length;x++)if(e.isArray(k[x].token))for(var C=0;C<k[x].token.length;C++)k[x].token[C]+=".virtual-comment";else k[x].token+=".virtual-comment"}this.embedRules(m,"rdoc-",[{token:"text",regex:"^",
next:"start"}]);this.normalizeRules()};n.inherits(a,h);k.RHighlightRules=a;k.setHighlightRFunctionCalls=function(a){$colorFunctionCalls=a}});define("mode/r_matching_brace_outdent",["require","exports","module"],function(a,k,n){var g=a("ace/range").Range;a=function(a){this.codeModel=a};(function(){this.checkOutdent=function(a,g,f){return/^\s+$/.test(g)&&/^\s*[\{\}\)\]]/.test(f)||/^\s*}\s*$/.test(g)&&"\n"==f||/}\s*$/.test(g)&&/\n/.test(f)?!0:!1};this.autoOutdent=function(a,h,f){if(0!==f){a=h.getLine(f);var e=a.match(/^(\s*[\}\)\]])/);if(e){e=e[1].length;var b=h.findMatchingBracket({row:f,column:e});if(!b||b.row==f)return 0;b=this.codeModel.getIndentForOpenBrace(b);
h.replace(new g(f,0,f,e-1),b)}if(e=a.match(/^(\s*\{)/))e=e[1].length,b=this.codeModel.getBraceIndent(f-1),h.replace(new g(f,0,f,e-1),b)}}}).call(a.prototype);k.RMatchingBraceOutdent=a});define("mode/r_scope_tree",["require","exports","module"],function(a,k,n){function g(a,f){return a.row!=f.row?a.row-f.row:a.column-f.column}var l=function(a,f,e,b,c){this.label=a;if((this.start=f)&&e&&(e.row>f.row||e.row===f.row&&e.column>f.column))throw Error("Malformed preamble: should lie before start position");this.preamble=e||f;this.end=null;this.scopeType=b;this.parentScope=null;this.attributes=c||{};this.$children=[]};l.TYPE_ROOT=1;l.TYPE_BRACE=2;l.TYPE_CHUNK=3;l.TYPE_SECTION=4;(function(){this.isRoot=
function(){return this.scopeType==l.TYPE_ROOT};this.isBrace=function(){return this.scopeType==l.TYPE_BRACE};this.isChunk=function(){return this.scopeType==l.TYPE_CHUNK};this.isSection=function(){return this.scopeType==l.TYPE_SECTION};this.isFunction=function(){return this.isBrace()&&!!this.attributes.args};this.isTest=function(){return this.isBrace()&&"test"===this.attributes.type};this.equals=function(a){return this.scopeType!==a.scopeType||this.start.row!==a.start.row||this.start.column!==a.start.column?
!1:!0};this.addNode=function(a){a.end&&window.alert("[ASSERTION FAILED] New node is already closed");0!=a.$children.length&&window.alert("[ASSERTION FAILED] New node already had children");if(!this.equals(a)){this.end=null;var f=this.$binarySearch(a.preamble);0<=f?this.$children[f].addNode(a):(f=-(f+1),f<this.$children.length&&(a.$children=this.$children.splice(f,this.$children.length-f)),a.parentScope=this,this.$children.push(a))}};this.closeScope=function(a,f){if(0==this.$children.length)return null;
var e=this.$children[this.$children.length-1];if(e.end)return null;var b=e.closeScope(a,f);return b?b:f==e.scopeType?(e.end=a,e.$forceDescendantsClosed(a),e):null};this.$forceDescendantsClosed=function(a){if(0!=this.$children.length){var f=this.$children[this.$children.length-1];f.end||(f.$forceDescendantsClosed(a),f.end=a)}};this.findNode=function(a){var f=this.$binarySearch(a);return 0<=f&&(a=this.$children[f].findNode(a))?(this.label&&a.unshift(this),a):this.label?[this]:null};this.$getFunctionStack=
function(a){var f=this.$binarySearch(a);a=0<=f?this.$children[f].$getFunctionStack(a):[];this.isFunction()&&a.push(this);return a};this.findFunctionDefinitionFromUsage=function(a,f){for(var e=this.$getFunctionStack(a),b=0;b<e.length;b++)for(var c=e[b],d=0;d<c.$children.length;d++)if(c.$children[d].label==f)return c.$children[d];return null};this.getFunctionsInScope=function(a){a=this.$getFunctionStack(a);for(var f=[],e=0;e<a.length;e++)f.push({name:a[e].attributes.name,args:a[e].attributes.args.slice()});
return f};this.invalidateFrom=function(a){var f=this.$binarySearch(a);0<=f?0>=g(a,this.$children[f].start)?a=this.$children[f].preamble:(a=this.$children[f].invalidateFrom(a),f++):f=-(f+1);f<this.$children.length&&this.$children.splice(f,this.$children.length-f);this.end=null;return a};this.$binarySearch=function(a,f,e){"undefined"===typeof f&&(f=0);"undefined"===typeof e&&(e=this.$children.length);if(f===e)return-(f+1);var b=Math.floor((f+e)/2),c=this.$children[b].comparePosition(a);return 0===c?
b:0>c?this.$binarySearch(a,f,b):this.$binarySearch(a,b+1,e)};this.comparePosition=function(a){return 0>g(a,this.preamble)?-1:null!=this.end&&0<=g(a,this.end)?1:0};this.printDebug=function(a){"undefined"===typeof a&&(a="");for(var f=0;f<this.$children.length;f++)this.$children[f].printDebug(a+"    ")}}).call(l.prototype);a=function(a){this.$ScopeNodeFactory=a||l;this.parsePos={row:0,column:0};this.$root=new this.$ScopeNodeFactory("(Top Level)",this.parsePos,null,l.TYPE_ROOT)};(function(){function a(e){count=
e.isChunk()?1:0;e=e.$children||[];for(var b=0;b<e.length;b++)count+=a(e[b]);return count}this.getParsePosition=function(){return this.parsePos};this.setParsePosition=function(a){this.parsePos=a};this.onSectionStart=function(a,b,c){"undefined"==typeof c&&(c={});var d=this.getActiveScopes(b);if(1<d.length){d=d[d.length-2].$children;for(var e=d.length-1;0<=e;e--)if(d[e].isSection()){this.$root.closeScope(b,l.TYPE_SECTION);break}}a=new this.$ScopeNodeFactory(a,b,b,l.TYPE_SECTION,c);this.$root.addNode(a)};
this.onSectionEnd=function(a){this.$root.closeScope(a,l.TYPE_SECTION)};this.closeMarkdownHeaderScopes=function(a,b,c){for(var d=a.$children,e=d.length-1;0<=e;e--){var f=d[e];if(f.isFunction()||f.isChunk())return;if(f.isSection()&&f.attributes.depth>=c)return this.$root.closeScope(b,l.TYPE_SECTION),f.attributes.depth===c||a.isRoot()||null==a?void 0:this.closeMarkdownHeaderScopes(a.parentScope,b,c)}a.isRoot()||null==a||this.closeMarkdownHeaderScopes(a.parentScope,b,c)};this.onMarkdownHead=function(a,
b,c,d,f){var e=this.getActiveScopes(b);1<e.length&&this.closeMarkdownHeaderScopes(e[e.length-2],b,d);this.$root.addNode(new this.$ScopeNodeFactory(a,c,b,l.TYPE_SECTION,{depth:d,isMarkdown:f}))};this.onChunkStart=function(a,b,c,d){this.$root.closeScope(c,l.TYPE_CHUNK);b=new this.$ScopeNodeFactory(b,d,c,l.TYPE_CHUNK);b.chunkLabel=a;this.$root.addNode(b);this.printScopeTree()};this.onChunkEnd=function(a){a=this.$root.closeScope(a,l.TYPE_CHUNK);this.printScopeTree();return a};this.onFunctionScopeStart=
function(a,b,c,d,f){this.$root.addNode(new this.$ScopeNodeFactory(a,c,b,l.TYPE_BRACE,{name:d,args:f,type:"function"}));this.printScopeTree()};this.onTestScopeStart=function(a,b,c){var d="test_that("+a+")";a=a.replace(/^['"](.*)['"]/,"$1");this.$root.addNode(new this.$ScopeNodeFactory(d,c,b,l.TYPE_BRACE,{name:a,type:"test"}));this.printScopeTree()};this.onNamedScopeStart=function(a,b){this.$root.addNode(new this.$ScopeNodeFactory(a,b,null,l.TYPE_BRACE))};this.onScopeStart=function(a){this.$root.addNode(new this.$ScopeNodeFactory(null,
a,null,l.TYPE_BRACE));this.printScopeTree()};this.onScopeEnd=function(a){a=this.$root.closeScope(a,l.TYPE_BRACE);this.printScopeTree();return a};this.getActiveScopes=function(a){return this.$root.findNode(a)};this.getScopeList=function(){return this.$root.$children};this.findFunctionDefinitionFromUsage=function(a,b){return this.$root.findFunctionDefinitionFromUsage(a,b)};this.getFunctionsInScope=function(a,b){return this.$root.getFunctionsInScope(a,b)};this.invalidateFrom=function(a){a={row:Math.max(0,
a.row-1),column:0};0<g(this.parsePos,a)&&(this.parsePos=this.$root.invalidateFrom(a));this.printScopeTree()};this.getChunkCount=function(e){return a(this.$root)};this.getTopLevelScopeCount=function(){return this.$root.$children.length};this.printScopeTree=function(){};this.getAllFunctionScopes=function(){var a=[];f(this.$root,a);return a};var f=function(a,b){a.isFunction()&&b.push(a);for(var c=a.$children,d=0;d<c.length;d++)f(c[d],b)}}).call(a.prototype);k.ScopeManager=a;k.ScopeNode=l});var $rainbowParentheses=!1,$numParenColors=7;
define("mode/rainbow_paren_highlight_rules",["require","exports","module"],function(a,k,n){a=function(){};k.RainbowParenHighlightRules=a;k.setRainbowParentheses=function(a){$rainbowParentheses=a};k.getRainbowParentheses=function(){return $rainbowParentheses};k.setNumParenColors=function(a){$numParenColors=a};a.getParenRule=function(){return{token:"paren.keyword.operator.nomatch",regex:"[[({})\\]]",merge:!1,onMatch:function(a,l,h){if(!$rainbowParentheses)return this.token="paren.keyword.operator.nomatch";
h=h||[];h[0]=l;h[15]=h[15]||0;switch(a){case "[":case "{":case "(":this.token="paren.paren_color_"+h[15]%$numParenColors;h[15]+=1;break;case "]":case "}":case ")":h[15]=Math.max(0,h[15]-1),this.token="paren.paren_color_"+h[15]%$numParenColors}return this.token},next:"start"}}});define("mode/rdoc",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/rdoc_highlight_rules").RDocHighlightRules,e=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;a=function(a){a?(this.$highlightRules=new h,this.$tokenizer=new l((new h).getRules())):(this.$highlightRules=new f,this.$tokenizer=new l((new f).getRules()));this.$outdent=new e};n.inherits(a,
g);(function(){this.getNextLineIndent=function(a,c,d){return this.$getIndent(c)}}).call(a.prototype);k.Mode=a});define("mode/rdoc_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){var a="\\"+"name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage".replace(/\|/g,"|\\");this.createKeywordMapper({keyword:a},
"identifer");this.$rules={start:[{token:"comment",regex:"%.*$"},{token:"text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"},{token:"paren.keyword.operator",
regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell.text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b"},{token:"keyword",
regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell.text",regex:"\\s+"},{token:"nospell.text",regex:"\\w+"}]}};n.inherits(g,a);k.RDocHighlightRules=g});define("mode/rhtml",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/html").Mode,l=a("ace/tokenizer").Tokenizer,h=a("mode/rhtml_highlight_rules").RHtmlHighlightRules,f=a("mode/r_code_model").RCodeModel,e=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,b=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,c=a("mode/utils");a=function(a,c){this.$session=c;this.$tokenizer=new l((new h).getRules());this.codeModel=new f(c,this.$tokenizer,/^r-/,/^\x3c!--\s*begin.rcode\s*(.*)/,
/^\s*end.rcode\s*--\x3e/);this.$outdent=new e;this.$r_outdent=new b(this.codeModel);this.foldingRules=this.codeModel};n.inherits(a,g);(function(){this.insertChunkInfo={value:"\x3c!--begin.rcode\n\nend.rcode--\x3e\n",position:{row:0,column:15},content_position:{row:1,column:0}};this.checkOutdent=function(a,b,e){return"r"===c.activeMode(a,"html")?this.$r_outdent.checkOutdent(a,b,e):this.$outdent.checkOutdent(b,e)};this.autoOutdent=function(a,b,e){return"r"===c.activeMode(a,"html")?this.$r_outdent.autoOutdent(a,
b,e):this.$outdent.autoOutdent(b,e)};this.getLanguageMode=function(a){return c.getPrimaryState(this.$session,a.row).match(/^r-/)?"R":"HTML"};this.$getNextLineIndent=this.getNextLineIndent;this.getNextLineIndent=function(a,b,e,f){return"r"===c.activeMode(a,"html")?this.codeModel.getNextLineIndent(a,b,e,f):this.$getNextLineIndent(a,b,e)};this.$id="mode/rhtml"}).call(a.prototype);k.Mode=a});define("mode/rhtml_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("mode/r_highlight_rules").RHighlightRules,l=a("ace/mode/html_highlight_rules").HtmlHighlightRules;a=a("ace/mode/text_highlight_rules").TextHighlightRules;var h=function(){this.$rules=(new l).getRules();this.$rules.start.unshift({token:"support.function.codebegin",regex:"^\x3c!--\\s*begin.rcode\\s*(?:.*)",next:"r-start"});var a=(new g).getRules();this.addRules(a,"r-");this.$rules["r-start"].unshift({token:"support.function.codeend",
regex:"^\\s*end.rcode\\s*--\x3e",next:"start"})};n.inherits(h,a);k.RHtmlHighlightRules=h});define("mode/rmarkdown",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("mode/markdown").Mode,l=a("ace/tokenizer").Tokenizer,h=a("mode/rmarkdown_highlight_rules").RMarkdownHighlightRules,f=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,e=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,b=a("mode/c_cpp_matching_brace_outdent").CppMatchingBraceOutdent,c=a("mode/r_code_model").RCodeModel,d=a("mode/cpp_code_model").CppCodeModel,r=a("mode/python").Mode,q=a("rstudio/folding/rmarkdown").FoldMode,
p=a("ace/mode/folding/cstyle").FoldMode;a("mode/auto_brace_insert");var m=a("mode/utils"),w=a("ace/unicode");a=function(a,g){var k=this;this.$session=g;this.$tokenizer=new l((new h).getRules());this.$outdent=new f;this.codeModel=new c(g,this.$tokenizer,/^r-/,new RegExp(h.prototype.$reChunkStartString),new RegExp(h.prototype.$reChunkEndString));this.$r_outdent=new e(this.codeModel);this.cpp_codeModel=new d(g,this.$tokenizer,/^r-cpp-/,new RegExp(h.prototype.$reCppChunkStartString),new RegExp(h.prototype.$reChunkEndString));
this.$cpp_outdent=new b(this.cpp_codeModel);this.$python=new r;var n=new q,w=new p;this.$tokenizer.getLineTokens=function(a,b,c){0===c&&(b="firstLine");return l.prototype.getLineTokens.call(this,a,b,c)};this.foldingRules={getFoldWidget:function(a,b,c){var d=k.getLanguageMode({row:c,column:0}),e=a.getLine(c);return"Markdown"===d||m.startsWith(e,"```")||0===c?n.getFoldWidget(a,b,c):"C_CPP"===d?w.getFoldWidget(a,b,c):k.codeModel.getFoldWidget(a,b,c)},getFoldWidgetRange:function(a,b,c){var d=k.getLanguageMode({row:c,
column:0}),e=a.getLine(c);return"Markdown"===d||m.startsWith(e,"```")||0===c?n.getFoldWidgetRange(a,b,c):"C_CPP"===d?w.getFoldWidgetRange(a,b,c):k.codeModel.getFoldWidgetRange(a,b,c)}}};n.inherits(a,g);(function(){function a(a){return m.activeMode(a,"markdown")}this.insertChunkInfo={value:"```{r}\n\n```\n",position:{row:0,column:5},content_position:{row:1,column:0}};this.getLanguageMode=function(b){b=m.getPrimaryState(this.$session,b.row);b=a(b);return"r"===b?"R":"r-cpp"===b?"C_CPP":"yaml"===b?"YAML":
"python"===b?"Python":"sql"==b?"SQL":"stan"===b?"Stan":"Markdown"};this.$getNextLineIndent=this.getNextLineIndent;this.getNextLineIndent=function(b,c,d,e,f){var g=a(b);return"r"===g?this.codeModel.getNextLineIndent(b,c,d,e):"r-cpp"===g?this.cpp_codeModel.getNextLineIndent(b,c,d,e,f):"yaml"===g?this.$getIndent(this.$session.getLine(e+1)):"python"===g?this.$python.getNextLineIndent(b,c,d,e):this.$getNextLineIndent(b,c,d)};this.checkOutdent=function(b,c,d){var e=a(b);return"r"===e?this.$r_outdent.checkOutdent(b,
c,d):"r-cpp"===e?this.$cpp_outdent.checkOutdent(b,c,d):"yaml"===e?!1:this.$outdent.checkOutdent(c,d)};this.autoOutdent=function(b,c,d){var e=a(b);if("r"===e)return this.$r_outdent.autoOutdent(b,c,d);if("r-cpp"===e)return this.$cpp_outdent.autoOutdent(b,c,d);if("yaml"!==e)return"python"===e?this.$python.autoOutdent(b,c,d):this.$outdent.autoOutdent(c,d)};this.getIndentForOpenBrace=function(b){var c=m.getPrimaryState(this.$session,b.row);if("r"===a(c))return this.codeModel.getIndentForOpenBrace(b);b=
this.$session.getLine(b.row1);return this.$getIndent(b)};this.transformAction=function(b,c,d,e,f){var g=a(b);return"markdown"===g?this.transformActionMarkdown(b,c,d,e,f):"r-cpp"===g?this.transformActionCpp(b,c,d,e,f):"yaml"===g?this.transformActionYaml(b,c,d,e,f):"python"===g?this.$python.transformAction(b,c,d,e,f):!1};this.transformActionMarkdown=function(a,b,c,d,e){if("insertion"===b)if("r"===e){if(a=c.getCursorPosition(),b=d.getLine(a.row),d=d.getTokenAt(a.row,a.column-1),null!==d&&-1===d.type.indexOf("support.function")&&
"`"===b[a.column-1])return{text:"r`",selection:[0,a.column+1,0,a.column+1]}}else if("`"===e&&(a=c.getCursorPosition(),b=d.getLine(a.row),d=d.getTokenAt(a.row,a.column+1),null!==d&&-1!==d.type.indexOf("support.function")&&"`"===b[a.column]))return{text:"",selection:[0,a.column+1,0,a.column+1]}};this.transformActionCpp=function(a,b,c,d,e){if("insertion"===b)if("\n"===e){if(a=c.getSelectionRange().start,(d=/^((\s*\/\/+')\s*)/.exec(d.doc.getLine(a.row)))&&c.getSelectionRange().start.column>=d[2].length)return{text:"\n"+
d[1]}}else if("R"===e&&(a=c.getSelectionRange().start,(d=/^(\s*\/\*{3,}\s*)/.exec(d.doc.getLine(a.row)))&&c.getSelectionRange().start.column>=d[1].length))return{text:"R\n\n*/\n",selection:[1,0,1,0]};return!1};this.transformActionYaml=function(a,b,c,d,e){return"insertion"===b&&"\n"===e?(a=c.getCursorPosition().row,a=d.getLine(a),d=this.$getIndent(a),/[:({[]$/.test(a)?(a=this.$session.getTabString(),{text:"\n"+d+a}):{text:"\n"+d}):!1};this.tokenRe=new RegExp("^["+w.wordChars+"._]+","g");this.nonTokenRe=
new RegExp("^(?:[^"+w.wordChars+"._]|\\s)+","g");this.allowAutoInsert=this.smartAllowAutoInsert;this.$id="mode/rmarkdown"}).call(a.prototype);k.Mode=a});define("rstudio/folding/rmarkdown",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/folding/fold_mode").FoldMode,l=a("ace/range").Range;k=k.FoldMode=function(){};var h=a("mode/utils");n.inherits(k,g);(function(){this.getFoldWidget=function(a,b,c){b="markbeginend"===b?"end":"";var d=a.getLine(c),e=a.getState(c);a=0<c?a.getState(c-1):"start";if(h.startsWith(d,"===")||h.startsWith(d,"---")||h.startsWith(d,"..."))return h.startsWith(a,"yaml")?b:"start";if("start"===
e&&h.startsWith(d,"#"))return"start";a=d.trim();return h.startsWith(a,"```")?"start"===e?b:"start":""};var a=function(a,b,c,d,f){b=0===c?1:"start"===b?-1:1;var e={row:c,column:0};1===b&&(e.column=a.getLine(c).length);c+=b;for(var g=0<b?a.getLength():0;c!==g;){var m=a.getLine(c).trim();if(h.startsWith(m,d))break;if(f&&h.startsWith(m,f))break;c+=b}d={row:c,column:0};-1===b&&(d.column=a.getLine(c).length);return 1===b?l.fromPoints(e,d):l.fromPoints(d,e)};this.$getFoldWidgetRange=function(e,b,c){var d=
e.getState(c);b=e.getLine(c);var f=b.trim();if(h.startsWith(b,"```"))return a(e,d,c,"```");var g=0<c?e.getState(c-1):"start";f=0===c&&"---"===f;g=h.startsWith(g,"yaml");if(f||g)return a(e,d,c,"---",f?"...":void 0);if("="===b[0])g=1;else if("-"===b[0])g=2;else{g=/^(#+)(?:.*)$/.exec(b);if(!g)return;g=g[1].length}if(null!==g){a:{f=e.getLength();for(var p=c+1;p<f;p++)if(e.getState(p)===d){var m=e.getLine(p);if(1===g&&/^[=]{3,}\s*/.test(m)){d=p-2;break a}if(2===g&&/^[-]{3,}\s*/.test(m)){d=p-2;break a}if((m=
/^(#+)(?:.*)$/.exec(m))&&m[1].length<=g){d=p-1;break a}}d=f}return new l(c,b.length,d,e.getLine(d).length)}};this.getFoldWidgetRange=function(a,b,c){a=this.$getFoldWidgetRange(a,b,c);if(null!=a&&a.start.row!==a.end.row)return a}}).call(k.prototype)});define("mode/rmarkdown_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("mode/r_highlight_rules").RHighlightRules,l=a("mode/c_cpp_highlight_rules").c_cppHighlightRules,h=a("ace/mode/perl_highlight_rules").PerlHighlightRules,f=a("mode/python_highlight_rules").PythonHighlightRules,e=a("ace/mode/ruby_highlight_rules").RubyHighlightRules,b=a("mode/markdown_highlight_rules").MarkdownHighlightRules,c=a("ace/mode/text_highlight_rules").TextHighlightRules,d=a("mode/yaml_highlight_rules").YamlHighlightRules,
r=a("mode/sh_highlight_rules").ShHighlightRules,q=a("mode/stan_highlight_rules").StanHighlightRules,p=a("mode/sql_highlight_rules").SqlHighlightRules,m=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,w=a("ace/mode/css_highlight_rules").CssHighlightRules,A=a("ace/mode/scss_highlight_rules").ScssHighlightRules,z=a("ace/mode/sass_highlight_rules").SassHighlightRules,x=a("ace/mode/less_highlight_rules").LessHighlightRules;c=a("ace/mode/text_highlight_rules").TextHighlightRules;var C=
a("mode/mermaid_highlight_rules").MermaidHighlightRules,t=a("ace/mode/dot_highlight_rules").DotHighlightRules,v=a("mode/utils");a=function(){this.$rules=(new b).getRules();this.$rules.firstLine=this.$rules.allowBlock.slice();v.embedRules(this,g,"r",this.$reChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,l,"r-cpp",this.$reCppChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,h,"perl",this.$rePerlChunkStartString,
this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,f,"python",this.$rePythonChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,e,"ruby",this.$reRubyChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,b,"markdown",this.$reMarkdownChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,r,"sh",this.$reShChunkStartString,this.$reChunkEndString,["start","listblock",
"allowBlock"]);v.embedRules(this,q,"stan",this.$reStanChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,p,"sql",this.$reSqlChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,C,"mermaid",this.$reMermaidChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,t,"dot",this.$reDotChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,m,"js",
this.$reJavaScriptChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,w,"css",this.$reCssChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,A,"scss",this.$reScssChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,z,"sass",this.$reSassChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,x,"less",this.$reLessChunkStartString,this.$reChunkEndString,
["start","listblock","allowBlock"]);v.embedRules(this,c,"text",this.$reTextChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);v.embedRules(this,d,"yaml","^\\s*---\\s*$","^\\s*(?:---|\\.\\.\\.)\\s*$",["firstLine"]);this.$rules["yaml-start"].unshift({token:["string"],regex:/((?:January|February|March|April|May|June|July|August|September|October|November|December)\s+\d+(?:st|nd|rd|s|n|r)?(?:\s*(?:,)?(?:\s*\d+)?)?)/});this.$rules["yaml-start"].push({defaultToken:"text.nospell"});
this.normalizeRules()};n.inherits(a,c);(function(){function a(a){return"^(?:[ ]{4})?`{3,}\\s*\\{[Rr]\\b(?:.*)engine\\s*\\=\\s*['\"]"+a+"['\"](?:.*)\\}\\s*$|^(?:[ ]{4})?`{3,}\\s*\\{"+a+"\\b(?:.*)\\}\\s*$"}this.$reChunkStartString="^(?:[ ]{4})?`{3,}\\s*\\{\\w+\\b(.*)\\}\\s*$";this.$reChunkEndString="^(?:[ ]{4})?`{3,}\\s*$";this.$reCppChunkStartString=a("(?:[rR][cC]pp|[cC](?:pp)?)\\d*");this.$reMarkdownChunkStartString=a("block");this.$rePerlChunkStartString=a("perl");this.$rePythonChunkStartString=
a("python");this.$reMermaidChunkStartString=a("mermaid");this.$reDotChunkStartString=a("dot");this.$reRubyChunkStartString=a("ruby");this.$reShChunkStartString=a("(?:bash|sh)");this.$reStanChunkStartString=a("stan");this.$reSqlChunkStartString=a("sql");this.$reJavaScriptChunkStartString=a("(?:d3|js|ojs|observable)");this.$reCssChunkStartString=a("css");this.$reScssChunkStartString=a("scss");this.$reSassChunkStartString=a("sass");this.$reLessChunkStartString=a("less");this.$reTextChunkStartString=
a("(?:asis|text)")}).call(a.prototype);k.RMarkdownHighlightRules=a});define("mode/sh",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("mode/sh_highlight_rules").ShHighlightRules,h=a("ace/range").Range,f=a("ace/mode/folding/cstyle").FoldMode,e=a("ace/mode/behaviour/cstyle").CstyleBehaviour;a=function(){this.HighlightRules=l;this.foldingRules=new f;this.$behaviour=new e};n.inherits(a,g);(function(){this.lineCommentStart="#";this.getNextLineIndent=function(a,b,e){var c=this.$getIndent(b),d=this.getTokenizer().getLineTokens(b,
a).tokens;if(d.length&&"comment"==d[d.length-1].type)return c;"start"==a&&b.match(/^.*[\{\(\[:]\s*$/)&&(c+=e);return c};var a={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(b,d,e){if("\r\n"!==e&&"\r"!==e&&"\n"!==e)return!1;b=this.getTokenizer().getLineTokens(d.trim(),b).tokens;if(!b)return!1;do d=b.pop();while(d&&("comment"==d.type||"text"==d.type&&d.value.match(/^\s+$/)));return d?"keyword"==d.type&&a[d.value]:!1};this.autoOutdent=function(a,b,e){e+=1;a=this.$getIndent(b.getLine(e));
var c=b.getTabString();a.slice(-c.length)==c&&b.remove(new h(e,a.length-c.length,e,a.length))};this.$id="mode/sh"}).call(a.prototype);k.Mode=a});define("mode/sh_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=k.reservedKeywords="!|{|}|case|do|done|elif|else|esac|fi|for|if|in|then|until|while|&|;|export|local|read|typeset|unset|elif|select|set|function|declare|readonly",l=k.languageConstructs="[|]|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|source|suspend|test|times|trap|type|ulimit|umask|unalias|wait",
h=function(){this.$rules={start:[{token:"constant",regex:/\\./},{token:["text","comment"],regex:/(^|\s)(#.*)$/},{token:"string.start",regex:'"',push:[{token:"constant.language.escape",regex:/\\(?:[$`"\\]|$)/},{include:"variables"},{token:"keyword.operator",regex:/`/},{token:"string.end",regex:'"',next:"pop"},{defaultToken:"string"}]},{token:"string",regex:"\\$'",push:[{token:"constant.language.escape",regex:/\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/},{token:"string",
regex:"'",next:"pop"},{defaultToken:"string"}]},{regex:"<<<",token:"keyword.operator"},{stateName:"heredoc",regex:"(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",onMatch:function(a,e,b){var c=e.substring(0,e.length-5);c="-"===a[2]?c+"indentedHeredoc":c+"heredoc";a=a.split(this.splitRegex);b.push(c,a[4],e);return[{type:"constant",value:a[1]},{type:"text",value:a[2]},{type:"string",value:a[3]},{type:"support.class",value:a[4]},{type:"string",value:a[5]}]},rules:{heredoc:[{onMatch:function(a,e,b){if(a===
b[1])return this.next=b[2],b.splice(-3),"support.class";this.next="";return"string"},regex:".*$"}],indentedHeredoc:[{token:"string",regex:"^\t+"},{onMatch:function(a,e,b){if(a===b[1])return this.next=b[2],b.splice(-3),"support.class";this.next="";return"string"},regex:".*$"}]}},{regex:"$",token:"empty",next:function(a,e){return/heredoc$/i.test(e[0])?e[0]:a}},{token:["keyword","text","text","text","variable"],regex:/(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/},{token:"variable.language",
regex:"(?:\\$(?:SHLVL|\\$|\\!|\\?))"},{token:"variable",regex:"(?:[a-zA-Z_][a-zA-Z0-9_]*(?==))"},{include:"variables"},{token:"support.function",regex:"(?:[a-zA-Z_][a-zA-Z0-9_]*\\s*\\(\\))"},{token:"support.function",regex:"(?:&(?:\\d+))"},{token:"string",start:"'",end:"'"},{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+)))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"},{token:"constant.numeric",regex:"(?:(?:[1-9]\\d*)|(?:0))\\b"},{token:this.createKeywordMapper({keyword:g,
"support.function.builtin":l,"invalid.deprecated":"debugger"},"identifier"),regex:"[a-zA-Z_][a-zA-Z0-9_]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"},{token:"punctuation.operator",regex:";"},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]]"},{token:"paren.rparen",regex:"[\\)\\}]",next:function(a,e){if(2>e.length)return a;e.shift();return e.shift()}}],variables:[{token:"variable",regex:/(\$)(\w+)/},{token:["variable","paren.lparen"],
regex:/(\$)(\()/,push:"start"},{token:["variable","paren.lparen","keyword.operator","variable","keyword.operator"],regex:/(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,push:"start"},{token:"variable",regex:/\$[*@#?\-$!0_]/},{token:["variable","paren.lparen"],regex:/(\$)(\{)/,push:"start"}]};this.normalizeRules()};n.inherits(h,a);k.ShHighlightRules=h});define("mode/sql",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("mode/sql_highlight_rules").SqlHighlightRules;a("ace/range");a=function(){this.HighlightRules=l};n.inherits(a,g);a.prototype.lineCommentStart="--";a.prototype.$id="mode/sql";k.Mode=a});define("mode/sql_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"comment",regex:"^#.*$"},{token:"comment.doc.tag",regex:"\\?[a-zA-Z_][a-zA-Z0-9_$]*"},{token:"paren.keyword.operator",merge:!1,regex:"[[({]",next:"start"},{token:"paren.keyword.operator",merge:!1,regex:"[\\])}]",
next:"start"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:this.createKeywordMapper({"support.function":"avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl",keyword:"select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant|into|values|between|like|in|alter|index|view|exists|full|distinct|top|truncate|all",
"constant.language":"true|false","storage.type":"int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer"},"identifier",!0),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+"}]};this.normalizeRules()};n.inherits(g,a);k.SqlHighlightRules=g});define("mode/stan",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("ace/tokenizer").Tokenizer,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=a("mode/stan_highlight_rules").StanHighlightRules,e=a("ace/mode/folding/cstyle").FoldMode;a=function(){this.$highlightRules=new f;this.$tokenizer=new l(this.$highlightRules.getRules());this.$outdent=new h;this.foldingRules=new e};n.inherits(a,g);(function(){this.lineCommentStart=["//","#"];this.blockComment=
{start:"/*",end:"*/"};this.toggleCommentLines=function(a,c,d,e){var b=!0;a=/^(\s*)\/\//;for(var f=d;f<=e;f++)if(!a.test(c.getLine(f))){b=!1;break}if(b)for(b=new Range(0,0,0,0),f=d;f<=e;f++)d=c.getLine(f).match(a),b.start.row=f,b.end.row=f,b.end.column=d[0].length,c.replace(b,d[1]);else c.indentRows(d,e,"//")};this.getLanguageMode=function(a){return"Stan"};this.getNextLineIndent=function(a,c,d){var b=this.$getIndent(c),e=this.getTokenizer().getLineTokens(c,a).tokens;if(e.length&&"comment"==e[e.length-
1].type)return b;"start"==a&&c.match(/^.*(?:[\{\(\[])\s*$/)&&(b+=d);return b};this.checkOutdent=function(a,c,d){return this.$outdent.checkOutdent(c,d)};this.autoOutdent=function(a,c,d){this.$outdent.autoOutdent(c,d)};this.$id="mode/stan"}).call(a.prototype);k.Mode=a});define("mode/stan_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:"comment.line.number-sign",regex:"\\/\\/.*$"},{token:"comment.line.double-dash",regex:"#.*$"},{token:"comment.block",regex:"\\/\\*",merge:!0,next:"comment"},{token:"keyword.other.block",regex:"\\b(functions|data|transformed\\s+data|parameters|transformed\\s+parameters|model|generated\\s+quantities)\\b"},
{token:"string.quoted.double",regex:'["][ a-zA-Z0-9~@#$%^&*_\'`\\-+={}[\\]()<>|/!?.,;:]*["]'},{token:"constant.numeric",regex:"(?:(?:\\d+(?:\\.\\d*)?)|(?:\\.\\d+))(?:[eE][+\\-]?\\d*)?\\b"},{token:"keyword.operator",regex:"\\bT(?=\\s*\\[)"},{token:["keyword.other","text","punctuation"],regex:"(lower|upper)(\\s*)(=)"},{token:["keyword.other","text","keyword.operator"],regex:"(target)(\\s*)(\\+=)"},{token:"keyword.control",regex:"\\b(for|in|while|if|then|else|return)\\b"},{token:"keyword.other",regex:"\\b(print|reject)\\b"},
{token:"storage.type",regex:"\\b(int|real|vector|simplex|unit_vector|ordered|positive_ordered|row_vector|matrix|cholesky_factor_cov|cholesky_factor_corr|corr_matrix|cov_matrix|void)\\b"},{token:"invalid.deprecated",regex:"\\b(bernoulli_ccdf_log|bernoulli_cdf_log|bernoulli_log|bernoulli_logit_log|beta_binomial_ccdf_log|beta_binomial_cdf_log|beta_binomial_log|beta_ccdf_log|beta_cdf_log|beta_log|binomial_ccdf_log|binomial_cdf_log|binomial_coefficient_log|binomial_log|binomial_logit_log|categorical_log|categorical_logit_log|cauchy_ccdf_log|cauchy_cdf_log|cauchy_log|chi_square_ccdf_log|chi_square_cdf_log|chi_square_log|dirichlet_log|double_exponential_ccdf_log|double_exponential_cdf_log|double_exponential_log|exp_mod_normal_ccdf_log|exp_mod_normal_cdf_log|exp_mod_normal_log|exponential_ccdf_log|exponential_cdf_log|exponential_log|frechet_ccdf_log|frechet_cdf_log|frechet_log|gamma_ccdf_log|gamma_cdf_log|gamma_log|gaussian_dlm_obs_log|get_lp|gumbel_ccdf_log|gumbel_cdf_log|gumbel_log|hypergeometric_log|increment_log_prob|integrate_ode|inv_chi_square_ccdf_log|inv_chi_square_cdf_log|inv_chi_square_log|inv_gamma_ccdf_log|inv_gamma_cdf_log|inv_gamma_log|inv_wishart_log|lkj_corr_cholesky_log|lkj_corr_log|logistic_ccdf_log|logistic_cdf_log|logistic_log|lognormal_ccdf_log|lognormal_cdf_log|lognormal_log|multi_gp_cholesky_log|multi_gp_log|multi_normal_cholesky_log|multi_normal_log|multi_normal_prec_log|multi_student_t_log|multinomial_log|multiply_log|neg_binomial_2_ccdf_log|neg_binomial_2_cdf_log|neg_binomial_2_log|neg_binomial_2_log_log|neg_binomial_ccdf_log|neg_binomial_cdf_log|neg_binomial_log|normal_ccdf_log|normal_cdf_log|normal_log|ordered_logistic_log|pareto_ccdf_log|pareto_cdf_log|pareto_log|pareto_type_2_ccdf_log|pareto_type_2_cdf_log|pareto_type_2_log|poisson_ccdf_log|poisson_cdf_log|poisson_log|poisson_log_log|rayleigh_ccdf_log|rayleigh_cdf_log|rayleigh_log|scaled_inv_chi_square_ccdf_log|scaled_inv_chi_square_cdf_log|scaled_inv_chi_square_log|skew_normal_ccdf_log|skew_normal_cdf_log|skew_normal_log|student_t_ccdf_log|student_t_cdf_log|student_t_log|uniform_ccdf_log|uniform_cdf_log|uniform_log|von_mises_log|weibull_ccdf_log|weibull_cdf_log|weibull_log|wiener_log|wishart_log)\\b"},
{token:["keyword.operator.sampling","text","support.function"],regex:"(~)(\\s*)(bernoulli|bernoulli_logit|beta|beta_binomial|binomial|binomial_logit|categorical|categorical_logit|cauchy|chi_square|dirichlet|double_exponential|exp_mod_normal|exponential|frechet|gamma|gaussian_dlm_obs|gumbel|hypergeometric|inv_chi_square|inv_gamma|inv_wishart|lkj_corr|lkj_corr_cholesky|logistic|lognormal|multi_gp|multi_gp_cholesky|multi_normal|multi_normal_cholesky|multi_normal_prec|multi_student_t|multinomial|neg_binomial|neg_binomial_2|neg_binomial_2_log|normal|ordered_logistic|pareto|pareto_type_2|poisson|poisson_log|rayleigh|scaled_inv_chi_square|skew_normal|student_t|uniform|von_mises|weibull|wiener|wishart)\\b"},
{token:"support.function",regex:"\\b(Phi|Phi_approx|abs|acos|acosh|append_col|append_row|asin|asinh|atan|atan2|atanh|bernoulli_cdf|bernoulli_lccdf|bernoulli_lcdf|bernoulli_logit_lpmf|bernoulli_lpmf|bernoulli_rng|bessel_first_kind|bessel_second_kind|beta_binomial_cdf|beta_binomial_lccdf|beta_binomial_lcdf|beta_binomial_lpmf|beta_binomial_rng|beta_cdf|beta_lccdf|beta_lcdf|beta_lpdf|beta_rng|binary_log_loss|binomial_cdf|binomial_lccdf|binomial_lcdf|binomial_logit_lpmf|binomial_lpmf|binomial_rng|block|categorical_logit_lpmf|categorical_lpmf|categorical_rng|cauchy_cdf|cauchy_lccdf|cauchy_lcdf|cauchy_lpdf|cauchy_rng|cbrt|ceil|chi_square_cdf|chi_square_lccdf|chi_square_lcdf|chi_square_lpdf|chi_square_rng|cholesky_decompose|col|cols|columns_dot_product|columns_dot_self|cos|cosh|cov_exp_quad|crossprod|csr_extract_u|csr_extract_v|csr_extract_w|csr_matrix_times_vector|csr_to_dense_matrix|cumulative_sum|determinant|diag_matrix|diag_post_multiply|diag_pre_multiply|diagonal|digamma|dims|dirichlet_lpdf|dirichlet_rng|distance|dot_product|dot_self|double_exponential_cdf|double_exponential_lccdf|double_exponential_lcdf|double_exponential_lpdf|double_exponential_rng|e|eigenvalues_sym|eigenvectors_sym|erf|erfc|exp|exp2|exp_mod_normal_cdf|exp_mod_normal_lccdf|exp_mod_normal_lcdf|exp_mod_normal_lpdf|exp_mod_normal_rng|expm1|exponential_cdf|exponential_lccdf|exponential_lcdf|exponential_lpdf|exponential_rng|fabs|falling_factorial|fdim|floor|fma|fmax|fmin|fmod|frechet_cdf|frechet_lccdf|frechet_lcdf|frechet_lpdf|frechet_rng|gamma_cdf|gamma_lccdf|gamma_lcdf|gamma_lpdf|gamma_p|gamma_q|gamma_rng|gaussian_dlm_obs_lpdf|gumbel_cdf|gumbel_lccdf|gumbel_lcdf|gumbel_lpdf|gumbel_rng|head|hypergeometric_lpmf|hypergeometric_rng|hypot|inc_beta|int_step|integrate_ode_bdf|integrate_ode_rk45|inv|inv_chi_square_cdf|inv_chi_square_lccdf|inv_chi_square_lcdf|inv_chi_square_lpdf|inv_chi_square_rng|inv_cloglog|inv_gamma_cdf|inv_gamma_lccdf|inv_gamma_lcdf|inv_gamma_lpdf|inv_gamma_rng|inv_logit|inv_phi|inv_sqrt|inv_square|inv_wishart_lpdf|inv_wishart_rng|inverse|inverse_spd|is_inf|is_nan|lbeta|lchoose|lgamma|lkj_corr_cholesky_lpdf|lkj_corr_cholesky_rng|lkj_corr_lpdf|lkj_corr_rng|lmgamma|lmultiply|log|log10|log1m|log1m_exp|log1m_inv_logit|log1p|log1p_exp|log2|log_determinant|log_diff_exp|log_falling_factorial|log_inv_logit|log_mix|log_rising_factorial|log_softmax|log_sum_exp|logistic_cdf|logistic_lccdf|logistic_lcdf|logistic_lpdf|logistic_rng|logit|lognormal_cdf|lognormal_lccdf|lognormal_lcdf|lognormal_lpdf|lognormal_rng|machine_precision|max|mdivide_left_spd|mdivide_left_tri_low|mdivide_right_spd|mdivide_right_tri_low|mean|min|modified_bessel_first_kind|modified_bessel_second_kind|multi_gp_cholesky_lpdf|multi_gp_lpdf|multi_normal_cholesky_lpdf|multi_normal_cholesky_rng|multi_normal_lpdf|multi_normal_prec_lpdf|multi_normal_rng|multi_student_t_lpdf|multi_student_t_rng|multinomial_lpmf|multinomial_rng|multiply_lower_tri_self_transpose|neg_binomial_2_cdf|neg_binomial_2_lccdf|neg_binomial_2_lcdf|neg_binomial_2_log_lpmf|neg_binomial_2_log_rng|neg_binomial_2_lpmf|neg_binomial_2_rng|neg_binomial_cdf|neg_binomial_lccdf|neg_binomial_lcdf|neg_binomial_lpmf|neg_binomial_rng|negative_infinity|normal_cdf|normal_lccdf|normal_lcdf|normal_lpdf|normal_rng|not_a_number|num_elements|ordered_logistic_lpmf|ordered_logistic_rng|owens_t|pareto_cdf|pareto_lccdf|pareto_lcdf|pareto_lpdf|pareto_rng|pareto_type_2_cdf|pareto_type_2_lccdf|pareto_type_2_lcdf|pareto_type_2_lpdf|pareto_type_2_rng|pi|poisson_cdf|poisson_lccdf|poisson_lcdf|poisson_log_lpmf|poisson_log_rng|poisson_lpmf|poisson_rng|positive_infinity|pow|prod|qr_Q|qr_R|quad_form|quad_form_diag|quad_form_sym|rank|rayleigh_cdf|rayleigh_lccdf|rayleigh_lcdf|rayleigh_lpdf|rayleigh_rng|rep_array|rep_matrix|rep_row_vector|rep_vector|rising_factorial|round|row|rows|rows_dot_product|rows_dot_self|scaled_inv_chi_square_cdf|scaled_inv_chi_square_lccdf|scaled_inv_chi_square_lcdf|scaled_inv_chi_square_lpdf|scaled_inv_chi_square_rng|sd|segment|sin|singular_values|sinh|size|skew_normal_cdf|skew_normal_lccdf|skew_normal_lcdf|skew_normal_lpdf|skew_normal_rng|softmax|sort_asc|sort_desc|sort_indices_asc|sort_indices_desc|sqrt|sqrt2|square|squared_distance|step|student_t_cdf|student_t_lccdf|student_t_lcdf|student_t_lpdf|student_t_rng|sub_col|sub_row|sum|tail|tan|tanh|target|tcrossprod|tgamma|to_array_1d|to_array_2d|to_matrix|to_row_vector|to_vector|trace|trace_gen_quad_form|trace_quad_form|trigamma|trunc|uniform_cdf|uniform_lccdf|uniform_lcdf|uniform_lpdf|uniform_rng|variance|von_mises_lpdf|von_mises_rng|weibull_cdf|weibull_lccdf|weibull_lcdf|weibull_lpdf|weibull_rng|wiener_lpdf|wishart_lpdf|wishart_rng)\\b"},
{token:"invalid.illegal",regex:"\\b(STAN_MAJOR|STAN_MATH_MAJOR|STAN_MATH_MINOR|STAN_MATH_PATCH|STAN_MINOR|STAN_PATCH|alignas|alignof|and|and_eq|asm|auto|bitand|bitor|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|const_cast|constexpr|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|false|float|for|friend|fvar|goto|if|in|inline|int|long|lp__|mutable|namespace|new|noexcept|not|not_eq|nullptr|operator|or|or_eq|private|protected|public|register|reinterpret_cast|repeat|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|then|this|thread_local|throw|true|try|typedef|typeid|typename|union|unsigned|until|using|var|virtual|void|volatile|wchar_t|while|xor|xor_eq)\\b"},
{token:"invalid.illegal",regex:"[a-zA-Z][a-zA-Z0-9_]*(?!__)\\b__\\b"},{token:"invalid.illegal",regex:"\\b(?:_|[_0-9][A-Za-z0-9_]+|[A-Za-z][A-Za-z0-9_]*__)\\b"},{token:"function",regex:"[a-zA-Z][a-zA-Z0-9_]*(?!__)\\b(?=\\s*\\()"},{token:"identifier",regex:"[a-zA-Z][a-zA-Z0-9_]*(?!__)\\b"},{token:"invalid.deprecated",regex:"<-"},{token:"keyword.operator",regex:"~|[|]{2}|&&|==?|!=|<=?|>=?|\\+|-|\\.?\\*|\\.?/|\\\\|\\^|!|'|%|\\?|:"},{token:"punctuation.operator",regex:",|;|[|]"},{token:"paren.lparen.keyword.operator",
regex:"[\\[\\(\\{]"},{token:"paren.rparen.keyword.operator",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",merge:!0,regex:".+"}]}};n.inherits(g,a);k.StanHighlightRules=g});define("mode/sweave",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/sweave_highlight_rules").SweaveHighlightRules,e=a("mode/r_code_model").RCodeModel,b=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,c=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,d=a("ace/unicode"),r=a("mode/utils");a("mode/auto_brace_insert");a=function(a,d){this.$tokenizer=
a?new l((new h).getRules()):new l((new f).getRules());this.$session=d;this.$outdent=new b;this.codeModel=new e(d,this.$tokenizer,/^r-/,/<<(.*?)>>/,/^\s*@\s*$/);this.$r_outdent=new c(this.codeModel);this.foldingRules=this.codeModel};n.inherits(a,g);(function(){this.tokenRe=new RegExp("^["+d.wordChars+"._]+","g");this.nonTokenRe=new RegExp("^(?:[^"+d.wordChars+"._]|\\s)+","g");this.$complements={"(":")","[":"]",'"':'"',"'":"'","{":"}"};this.$reOpen=/^[(["'{]$/;this.$reClose=/^[)\]"'}]$/;this.insertChunkInfo=
{value:"<<>>=\n\n@\n",position:{row:0,column:2},content_position:{row:1,column:0}};this.getLanguageMode=function(a){return r.getPrimaryState(this.$session,a.row).match(/^r-/)?"R":"TeX"};this.$getNextLineIndent=this.getNextLineIndent;this.getNextLineIndent=function(a,b,c,d){return"r"===r.activeMode(a,"tex")?this.codeModel.getNextLineIndent(a,b,c,d):this.$getNextLineIndent(a,b,c)};this.checkOutdent=function(a,b,c){return"r"===r.activeMode(a,"tex")?this.$r_outdent.checkOutdent(a,b,c):this.$outdent.checkOutdent(b,
c)};this.autoOutdent=function(a,b,c){return"r"===r.activeMode(a,"tex")?this.$r_outdent.autoOutdent(a,b,c):this.$outdent.autoOutdent(b,c)};this.allowAutoInsert=this.smartAllowAutoInsert;this.$id="mode/sweave"}).call(a.prototype);k.Mode=a});define("mode/sweave_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("mode/tex_highlight_rules").TexHighlightRules,l=a("mode/r_highlight_rules").RHighlightRules;a=a("ace/mode/text_highlight_rules").TextHighlightRules;var h=function(){this.$rules=(new g).getRules();this.$rules.start.unshift({token:"comment.codebegin",regex:"^\\s*<<.*>>=.*$",next:"r-start"});this.$rules.start.unshift({token:"comment",regex:"^\\s*@(?:\\s.*)?$"});this.$rules.start.unshift({regex:"(\\\\Sexpr)([{])",
next:"r-start",onMatch:function(a,b,c,d){c.length=2;c[0]=b;c[1]=1;return[{type:"keyword",value:"\\Sexpr"},{type:"paren.keyword.operator",value:"{"}]}});var a=(new l).getRules();this.addRules(a,"r-");this.$rules["r-start"].unshift({token:"paren.keyword.operator",regex:"[{]",merge:!1,onMatch:function(a,b,c,d){c.length&&(c[1]+=1);return this.token}});this.$rules["r-start"].unshift({token:"paren.keyword.operator",regex:"[}]",merge:!1,onMatch:function(a,b,c,d){this.next="r-start";c.length&&(--c[1],0==
c[1]&&(this.next=c[0],c.splice(0)));return this.token}});this.$rules["r-start"].unshift({token:"comment.codeend",regex:"^\\s*@(?:\\s.*)?$",next:"start"});this.$rules["r-start"].unshift({token:"comment.codebegin",regex:"^<<.*>>=.*$",next:"r-start"})};n.inherits(h,a);k.SweaveHighlightRules=h});define("mode/tex",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("ace/tokenizer").Tokenizer,h=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/tex_highlight_rules").TexHighlightRules,e=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;a=function(a){this.$tokenizer=a?new l((new h).getRules()):new l((new f).getRules());this.$outdent=new e};n.inherits(a,g);(function(){this.getNextLineIndent=function(a,c,d){return this.$getIndent(c)};
this.allowAutoInsert=function(){return!1}}).call(a.prototype);k.Mode=a});define("mode/tex_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");a("ace/lib/lang");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(a){a||(a="text");this.$rules={start:[{token:"comment",regex:"%.*$"},{token:a,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",
next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:a,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell."+a,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},
{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+a,regex:"\\s+"},{token:"nospell."+a,regex:"\\w+"}]}};n.inherits(g,a);k.TexHighlightRules=g});define("mode/token_cursor",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("mode/utils"),l=g.getTokenTypeRegex("paren"),h=function(a,c,d){this.$tokens=a;this.$row=c||0;this.$offset=d||0};(function(){this.cloneCursor=function(){return new h(this.$tokens,this.$row,this.$offset)};var a=g.isArray,c=g.contains,d={"(":")","{":"}","<":">","[":"]",")":"(","}":"{",">":"<","]":"["},e=["(","[","{"],f=[")","]","}"];this.moveToStartOfRow=function(a){this.$row=a;this.$offset=0};this.moveToEndOfRow=
function(a){this.$row=a;this.$offset=(a=this.$tokens[a])&&a.length?a.length-1:0};this.moveToPreviousToken=function(){if(0>=this.$row&&0>=this.$offset)return this.$offset=this.$row=0,!1;if(0<this.$offset)return this.$offset--,!0;for(var a=this.$row-1,b=0;0<=a;){var c=this.$tokens[a];if(c&&0!==c.length){b=c.length;break}a--}if(0>a)return!1;this.$row=a;this.$offset=b-1;return!0};this.moveToNextToken=function(a){"undefined"===typeof a&&(a=(this.$tokens||[]).length);if(this.$row>a)return!1;null==this.$tokens[this.$row]&&
this.$codeModel&&this.$codeModel.$tokenizeUpToRow&&this.$codeModel.$tokenizeUpToRow.call(this.$codeModel,a);var b=this.$tokens[this.$row];if(b&&this.$offset<b.length-1)return this.$offset++,!0;for(var c=this.$row+1;c<=a&&(!(b=this.$tokens[c])||0===b.length);)c++;if(c>a)return!1;this.$row=c;this.$offset=0;return!0};this.peekBwd=function(a){"undefined"===typeof a&&(a=1);for(var b=this.cloneCursor(),c=0;c<a;c++)if(!b.moveToPreviousToken())return b.$invalidate();return b};this.peekFwd=function(a){"undefined"===
typeof a&&(a=1);for(var b=this.cloneCursor(),c=0;c<a;c++)if(!b.moveToNextToken())return b.$invalidate();return b};this.$invalidate=function(){this.$column=this.$row=0;this.$tokens=[];return this};this.seekToNearestToken=function(a,b){if(a.row>b)return!1;this.$row=a.row;var c=this.$tokens[this.$row]||[];for(this.$offset=0;this.$offset<c.length;this.$offset++)if(c[this.$offset].column>=a.column)return!0;return a.row<b?this.moveToNextToken(b):!1};this.bwdToNearestToken=function(a){this.$row=a.row;this.$offset=
a.column;for(var b=this.$tokens[this.$row]||[];0<=this.$offset;this.$offset--){var c=b[this.$offset];if("undefined"!==typeof c&&c.column<=a.column)return!0}return this.moveToPreviousToken()};this.bwdToMatchingToken=function(){var a=this.currentValue();if(!c(f,a))return!1;for(var b=d[a],e=0;this.moveToPreviousToken();){var g=this.currentValue();if(g===b){if(0===e)return!0;e--}else g===a&&e++}return!1};this.fwdToMatchingToken=function(){var a=this.currentValue();if(!c(e,a))return!1;for(var b=d[a],f=
0;this.moveToNextToken();){var g=this.currentValue();if(g===b){if(0===f)return!0;f--}else g===a&&f++}return!1};this.equals=function(a){return this.$row===a.$row&&this.$offset===a.$offset};this.moveBackwardOverMatchingParens=function(){if(!this.moveToPreviousToken())return!1;if(")"!==this.currentValue())return this.moveToNextToken(),!1;for(var a=!1,b=0;this.moveToPreviousToken();){var c=this.currentValue();if("("===c){if(0===b){a=!0;break}b--}else")"===c&&b++}return a};this.findToken=function(a,b){do{var c=
this.currentToken();if(c&&a(c))return c}while(this.moveToNextToken(b));return null};this.findTokenBwd=function(a,b){do{var c=this.currentToken();if(c&&a(c))return c}while(this.moveToPreviousToken(b));return null};this.currentToken=function(){var a=this.$tokens[this.$row];if(null==a)return{};a=a[this.$offset];return null==a?{}:a};this.currentValue=function(){return this.currentToken().value};this.currentType=function(){return this.currentToken().type};this.hasType=function(){var a=this.currentType();
if(null==a)return!1;for(var b=0;b<arguments.length;b++){var c=arguments[b];if(a===c||-1!==a.indexOf(c+".")||-1!==a.indexOf("."+c))return!0}return!1};this.currentPosition=function(){var a=this.currentToken();return null==a?null:{row:this.$row,column:a.column}};this.isFirstSignificantTokenOnLine=function(){return 0===this.$offset};this.isLastSignificantTokenOnLine=function(){return this.$offset==(this.$tokens[this.$row]||[]).length-1};this.bwdUntil=function(a){for(;!a(this);)this.moveToPreviousToken()};
this.bwdWhile=function(a){for(;a(this);)this.moveToPreviousToken()};this.moveToPosition=function(a,b){var c=a.row,d=a.column,e=this.$tokens[c];null==e&&this.$codeModel&&this.$codeModel.$tokenizeUpToRow&&(this.$codeModel.$tokenizeUpToRow.call(this.$codeModel,c),e=this.$tokens[c]);if(e&&0<e.length&&e[0].column<=d){for(var f=0;f<e.length&&!(e[f].column>=d);f++);this.$row=c;this.$offset=f===e.length?f-1:b&&e[f].column===d?f:f-1;return!0}d=this.cloneCursor();d.$row=c;d.$offset=0;return d.moveToPreviousToken()?
(this.$row=d.$row,this.$offset=d.$offset,!0):!1};this.findOpeningBracket=function(b,c){a(b)||(b=[b]);var d=this.cloneCursor();do if(!d.bwdToMatchingToken()){var e=d.currentValue();if(c&&"{"===e)break;for(var f=0;f<b.length;f++)if(e===b[f])return this.$row=d.$row,this.$offset=d.$offset,!0}while(d.moveToPreviousToken());return!1};this.findOpeningBracketCountCommas=function(b,c){a(b)||(b=[b]);var d=this.cloneCursor(),e=0;do if(!d.bwdToMatchingToken()){var f=d.currentValue();","===f&&(e+=1);if(c&&"{"===
f)break;for(var g=0;g<b.length;g++)if(f===b[g])return this.$row=d.$row,this.$offset=d.$offset,e}while(d.moveToPreviousToken());return-1}}).call(h.prototype);var f=function(a,c,d,e){this.$tokens=a;this.$row=c||0;this.$offset=d||0;this.$codeModel=e};n.mixin(f.prototype,h.prototype);(function(){this.cloneCursor=function(){return new f(this.$tokens,this.$row,this.$offset,this.$codeModel)};var a=g.contains;this.bwdOverConstNoexceptDecltype=function(){var a=this.cloneCursor();if("{"!==a.currentValue()||
!a.moveToPreviousToken())return!1;var b=a.cloneCursor();")"===b.currentValue()&&b.bwdToMatchingToken()&&b.moveToPreviousToken()&&"decltype"===b.currentValue()&&b.moveToPreviousToken()&&(a.$row=b.$row,a.$offset=b.$offset);b=a.cloneCursor();")"===b.currentValue()&&b.bwdToMatchingToken()&&b.moveToPreviousToken()&&"noexcept"===b.currentValue()&&(a.$row=b.$row,a.$offset=b.$offset);if("noexcept"===a.currentValue()&&!a.moveToPreviousToken()||"const"===a.currentValue()&&!a.moveToPreviousToken()||")"===a.currentValue()&&
!a.moveToNextToken())return!1;this.$row=a.$row;this.$offset=a.$offset;return!0};this.bwdToMatchingArrow=function(){if(">"!==this.currentValue())return!1;for(var a=0,b=this.cloneCursor();b.moveToPreviousToken();)if("<"===b.currentValue()){if(0===a)return this.$row=b.$row,this.$offset=b.$offset,!0;a--}else">"===b.currentValue()&&a++;return!1};this.bwdOverClassySpecifiers=function(){var a=this.currentValue();":"!==a&&","!==a&&"{"!==a||this.moveToPreviousToken();do{this.bwdToMatchingArrow()&&this.moveToPreviousToken();
a=this.currentType();var b=this.currentValue();if("keyword"!==a&&"::"!==b&&"identifier"!==a&&"constant"!==a)break;if("class"===b||"struct"===b||"enum"===b||":"===b||","===b)return!0}while(this.moveToPreviousToken());return!1};this.bwdOverClassInheritance=function(){var a=this.cloneCursor();return c(a,this)};var c=function(a,b){a.bwdOverClassySpecifiers();var d=a.currentValue();return","===d?c(a,b):":"===d?(b.$row=a.$row,b.$offset=a.$offset,!0):!1};this.bwdOverInitializationList=function(){var a=this.cloneCursor();
return this.doBwdOverInitializationList(a,this)};this.doBwdOverInitializationList=function(b,c){b.moveBackwardOverMatchingParens();if(!b.moveBackwardOverMatchingParens()&&!b.moveToPreviousToken())return!1;for(;"keyword"===b.currentType();)if(!b.moveToPreviousToken())return!1;if(b.moveToPreviousToken()){var d=b.currentValue();if(","===d)return this.doBwdOverInitializationList(b,c);if(":"===d&&(d=b.peekBwd().currentValue(),!a(["public","private","protected"],d)))return c.$row=b.$row,c.$offset=b.$offset,
!0}return!1}}).call(f.prototype);var e=function(a,c,d,e){this.$tokens=a;this.$row=c||0;this.$offset=d||0;this.$codeModel=e};n.mixin(e.prototype,h.prototype);(function(){function a(a){return 0===a.indexOf("'")?a.lastIndexOf("'")===a.length-1:0===a.indexOf('"')?a.lastIndexOf('"')===a.length-1:!1}function c(a){return"("===a||"["===a||"{"===a}function d(a){return")"===a||"]"===a||"}"===a}this.cloneCursor=function(){return new e(this.$tokens,this.$row,this.$offset,this.$codeModel)};var f=g.contains;this.isValidAsIdentifier=
function(){var a=this.currentType();return this.hasType("identifier","constant")||"symbol"===a||"keyword"===a||"string"===a};this.isExtractionOperator=function(){var a=this.currentValue();return"$"===a||"@"===a||"::"===a||":::"===a};this.findStartOfEvaluationContext=function(){var a=this.cloneCursor();do if(!a.bwdToMatchingToken()){if(a.isValidAsIdentifier()){if(!a.moveToPreviousToken())break;if(a.isExtractionOperator())continue;if(!a.moveToNextToken())return!1;break}return!1}while(a.moveToPreviousToken());
this.$row=a.$row;this.$offset=a.$offset;return!0};this.isLookingAtBinaryOp=function(){var a=this.currentType();return"keyword.operator"===a||"keyword.operator.infix"===a};this.moveToStartOfCurrentStatement=function(){for(var a=this.cloneCursor();a.isLookingAtBinaryOp();)if(!a.moveToPreviousToken())return!1;do if(!a.bwdToMatchingToken()){if(a.isValidAsIdentifier()){if(!a.moveToPreviousToken())break;if(a.isLookingAtBinaryOp()){for(;a.isLookingAtBinaryOp();)if(!a.moveToPreviousToken())return!1;if(!a.moveToNextToken())return!1;
continue}if(!a.moveToNextToken())return!1;break}return!1}while(a.moveToPreviousToken());this.$row=a.$row;this.$offset=a.$offset;return!0};this.moveToEndOfCurrentStatement=function(){for(var a=this.cloneCursor();a.isLookingAtBinaryOp();)if(!a.moveToNextToken())return!1;do if(!a.fwdToMatchingToken()){if(a.isValidAsIdentifier()){if(!a.moveToNextToken())break;if(a.isLookingAtBinaryOp()){for(;a.isLookingAtBinaryOp();)if(!a.moveToNextToken())return!1;if(!a.moveToPreviousToken())return!1;continue}if(!a.moveToPreviousToken())return!1;
break}return!1}while(a.moveToNextToken());this.$row=a.$row;this.$offset=a.$offset;return!0};this.isSingleLineString=function(){return a(this.currentValue())};this.isLeftBracket=function(){return c(this.currentValue())};this.isRightBracket=function(){return d(this.currentValue())};this.isValidForEndOfStatement=function(){var b=this.currentType(),c=this.currentValue();return-1!==b.search(l)?d(c):a(c)||this.hasType("identifier","constant","variable")};this.isValidForStartOfStatement=function(){var b=
this.currentType();this.currentValue();if(-1!==b.search(l))return c(this.currentValue());b=this.currentValue();return a(b)||this.hasType("identifier","constant","variable")};this.isConditionalControlFlowKeyword=function(){var a=this.currentValue();return f(["if","for","while","function"],a)};this.isControlFlowKeyword=function(){var a=this.currentValue();return f("if for while else function repeat break next".split(" "),a)};this.isAtStartOfNewExpression=function(a){var b=this.cloneCursor();return b.moveToPreviousToken()?
this.isValidForStartOfStatement()&&b.isValidForEndOfStatement()&&this.$row>b.$row?b.isControlFlowKeyword()||")"===b.currentValue()&&b.bwdToMatchingToken()&&b.moveToPreviousToken()&&b.isConditionalControlFlowKeyword()?!1:!0:!1:a}}).call(e.prototype);k.TokenCursor=h;k.CppTokenCursor=f;k.RTokenCursor=e});define("mode/token_utils",["require","exports","module"],function(a,k,n){a=function(a,l,h,f,e,b){this.$doc=a;this.$tokenizer=l;this.$tokens=h;this.$endStates=Array(a.getLength());this.$statePattern=f;this.$codeBeginPattern=e;this.$codeEndPattern=b};(function(){this.getTokenForPos=function(a,l,h){this.$tokenizeUpToRow(a.row);if(this.$tokens.length<=a.row)return null;for(var f=this.$tokens[a.row],e=0;e<f.length;e++){var b=f[e];if(l&&a.column==b.column)return b;if(a.column<=b.column)break;if(h&&a.column==
b.column+b.value.length||a.column<b.column+b.value.length)return b}return null};this.$tokenizeUpToRow=function(a){a=Math.min(a,this.$doc.getLength()-1);for(var g=0,h=!0;g<=a;g++)if(!h||!this.$endStates[g]){h=!1;var f=0===g?"start":this.$endStates[g-1],e=this.$doc.getLine(g);e=this.$tokenizer.getLineTokens(e,f,g);!this.$statePattern||this.$statePattern.test(e.state)||this.$statePattern.test(f)?this.$tokens[g]=this.$filterWhitespaceAndComments(e.tokens):this.$tokens[g]=[];e.state===this.$endStates[g]?
h=!0:this.$endStates[g]=e.state}h||g<this.$tokens.length&&this.$invalidateRow(g);return!0};this.$filterWhitespaceAndComments=function(a){a=a.filter(function(a){a=/\bcode(?:begin|end)\b/.test(a.type)?!1:/\bsectionhead\b/.test(a.type)?!1:/^\s*$/.test(a.value)||a.type.match(/\b(?:ace_virtual-)?comment\b/);return!a});for(var g=a.length-1;0<=g;g--)if(1<a[g].value.length&&/\bparen\b/.test(a[g].type)){var h=a[g];a.splice(g,1);for(var f=h.value.length-1;0<=f;f--){var e={type:h.type,value:h.value.charAt(f),
column:h.column+f};a.splice(g,0,e)}}return a};this.$invalidateRow=function(a){this.$tokens[a]=null;this.$endStates[a]=null};this.$insertNewRows=function(a,l){for(var g=[a,0],f=0;f<l;f++)g.push(null);this.$tokens.splice.apply(this.$tokens,g);this.$endStates.splice.apply(this.$endStates,g)};this.$removeRows=function(a,l){this.$tokens.splice(a,l);this.$endStates.splice(a,l)};this.$walkParens=function(a,l,h){var f=/\bparen\b/;return a<l?function(){for(;a<=l;a++)for(var e=this.$tokens[a],b=0;b<e.length;b++)if(f.test(e[b].type)&&
!h(e[b].value,{row:a,column:e[b].column}))return!1;return!0}.call(this):function(){a=Math.max(0,a);for(l=Math.max(0,l);a>=l;a--)for(var e=this.$tokens[a],b=e.length-1;0<=b;b--)if(f.test(e[b].type)&&!h(e[b].value,{row:a,column:e[b].column}))return!1;return!0}.call(this)};this.$walkParensBalanced=function(a,l,h,f,e){var b=[],c=null;this.$walkParens(a,l,function(a,g){if(h&&h(b,a,g))return c=g,!1;if(/[\[({]/.test(a))if(b[b.length-1]===e[a])b.pop();else return!0;else b.push(a);return f&&f(b,a,g)?(c=g,
!1):!0});return c};this.$findNextSignificantToken=function(a,l){if(0==this.$tokens.length)return null;l=Math.min(l,this.$tokens.length-1);for(var g=a.row,f=a.column;g<=l;g++){for(var e=this.$tokens[g],b=0;b<e.length;b++)if(e[b].column+e[b].value.length>f)return{token:e[b],row:g,column:Math.max(e[b].column,f),offset:b};f=0}return null};this.findNextSignificantToken=function(a){return this.$findNextSignificantToken(a,this.$tokens.length-1)};this.$findPreviousSignificantToken=function(a,l){if(0==this.$tokens.length)return null;
l=Math.max(0,l);for(var g=Math.min(a.row,this.$tokens.length-1);g>=l;g--){var f=this.$tokens[g];if(0!=f.length){if(g!=a.row)return{row:g,column:f[f.length-1].column,token:f[f.length-1],offset:f.length-1};for(var e=f.length-1;0<=e;e--)if(f[e].column<a.column)return{row:g,column:f[e].column,token:f[e],offset:e}}}return null}}).call(a.prototype);k.TokenUtils=a});define("mode/utils",["require","exports","module"],function(a,k,n){a("ace/range");var g=a("ace/token_iterator").TokenIterator,l=a("ace/unicode");(function(){var a=this,f=new RegExp("^["+l.wordChars+"._]+","");this.construct=function(a,c){function b(){return a.apply(this,c)}b.prototype=a.prototype;return new b};this.contains=function(a,c){for(var b=0;b<a.length;b++)if(a[b]===c)return!0;return!1};this.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)};this.asArray=function(b){return a.isArray(b)?
b:[b]};this.getPrimaryState=function(b,c){return a.primaryState(b.getState(c))};this.primaryState=function(b){if(a.isArray(b))for(var c=0;c<b.length;c++){var d=b[c];if("#tmp"!==d)return d||"start"}return b||"start"};this.activeMode=function(b,c){var d=a.primaryState(b),e=d.lastIndexOf("-");return-1===e?c:d.substring(0,e).toLowerCase()};this.endsWith=function(a,c){return-1!==a.indexOf(c,a.length-c.length)};this.escapeRegExp=function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};
this.embedRules=function(b,c,d,e,f,g,m){"undefined"===typeof g&&(g=["start"]);"undefined"===typeof m&&(m="start");g=a.asArray(g);m=b.$rules;for(var h=function(a,b,c,d){c.splice(0);return this.token},l=0;l<g.length;l++)m[g[l]].unshift({token:"support.function.codebegin",regex:e,onMatch:h,next:d+"-start"});b.embedRules(c,d+"-",[{token:"support.function.codeend",regex:f,onMatch:h,next:"start"}])};this.isSingleLineString=function(a){if(2>a.length)return!1;var b=a[0];return"'"!==b&&'"'!==b||a[a.length-
1]!==b||"\\"===a[a.length-2]&&"\\"!==a[a.length-3]?!1:!0};this.createTokenIterator=function(a){var b=a.getSelectionRange().start;a=a.getSession();return new g(a,b.row,b.column)};this.isWordCharacter=function(a){return f.test(a)};var e={"'":"'",'"':'"',"`":"`","{":"}","(":")","[":"]","<":">","}":"{",")":"(","]":"[",">":"<"};this.isBracket=function(a,c){return!c||"<"!==a&&">"!==a?"{"===a||"}"===a||"("===a||")"===a||"["===a||"]"===a:!0};this.isOpeningBracket=function(a,c){return"{"===a||"("===a||"["===
a||!!c&&"<"===a};this.isClosingBracket=function(a,c){return"}"===a||")"===a||"]"===a||!!c&&">"===a};this.getComplement=function(a,c){"undefined"===typeof c&&(c=e);var b=c[a];return"undefined"===typeof b?a:b};this.stripEnclosingQuotes=function(a){var b=a.length;if(2>b)return a;var d=a[0];return"'"!==d&&'"'!==d&&"`"!==d||a[b-1]!==d?a:a.substr(1,b-2)};this.startsWith=function(a,c){if("string"!==typeof a||"string"!==typeof c||a.length<c.length)return!1;for(var b=0;b<c.length;b++)if(a[b]!==c[b])return!1;
return!0};this.getTokenTypeRegex=function(a){return new RegExp("(?:^|[.])"+a+"(?:$|[.])","")}}).call(k)});define("mode/xml",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("ace/tokenizer").Tokenizer,h=a("mode/xml_highlight_rules").XmlHighlightRules,f=a("mode/xml_behavior").XmlBehaviour,e=a("mode/xml_fold_mode").FoldMode;a=function(){this.$tokenizer=new l((new h).getRules());this.$behaviour=new f;this.foldingRules=new e};n.inherits(a,g);(function(){this.getNextLineIndent=function(a,c,d){return this.$getIndent(c)}}).call(a.prototype);k.Mode=a});define("mode/xml_behavior",["require","exports","module"],function(a,k,n){function g(a,b){var c=!0,d=a.type.split(".");b.split(".").forEach(function(a){if(-1==d.indexOf(a))return c=!1});return c}n=a("ace/lib/oop");var l=a("ace/mode/behaviour").Behaviour,h=a("ace/mode/behaviour/cstyle").CstyleBehaviour,f=a("ace/token_iterator").TokenIterator;a=function(){this.inherit(h,["string_dquotes"]);this.add("autoclosing","insertion",function(a,b,c,d,h){if(">"==h){a=c.getCursorPosition();c=new f(d,a.row,a.column);
d=c.getCurrentToken();b=!1;if(d&&(g(d,"meta.tag")||g(d,"text")&&d.value.match("/")))b=!0;else{do d=c.stepBackward();while(d&&(g(d,"string")||g(d,"keyword.operator")||g(d,"entity.attribute-name")||g(d,"text")))}if(d&&g(d,"meta.tag-name")&&!c.stepBackward().value.match("/"))return c=d.value,b&&(c=c.substring(0,a.column-d.start)),{text:"></"+c+">",selection:[1,1]}}});this.add("autoindent","insertion",function(a,b,c,d,f){if("\n"==f&&(b=c.getCursorPosition(),"</"==d.doc.getLine(b.row).substring(b.column,
b.column+2)))return a=this.$getIndent(d.doc.getLine(b.row))+d.getTabString(),d=this.$getIndent(d.doc.getLine(b.row)),{text:"\n"+a+"\n"+d,selection:[1,a.length,1,a.length]}})};n.inherits(a,l);k.XmlBehaviour=a});define("mode/xml_fold_mode",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/lib/lang"),l=a("ace/range").Range,h=a("ace/mode/folding/fold_mode").FoldMode,f=a("ace/token_iterator").TokenIterator;a=k.FoldMode=function(a){h.call(this);this.voidElements=a||{}};n.inherits(a,h);(function(){this.getFoldWidget=function(a,b,c){a=this._getFirstTagInLine(a,c);return a.closing?"markbeginend"==b?"end":"":!a.tagName||this.voidElements[a.tagName.toLowerCase()]||a.selfClosing||-1!==
a.value.indexOf("/"+a.tagName)?"":"start"};this._getFirstTagInLine=function(a,b){for(var c=a.getTokens(b),d="",e=0;e<c.length;e++){var f=c[e];d=0===f.type.indexOf("meta.tag")?d+f.value:d+g.stringRepeat(" ",f.value.length)}return this._parseTag(d)};this.tagRe=/^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;this._parseTag=function(a){var b=this.tagRe.exec(a),c=this.tagRe.lastIndex||0;this.tagRe.lastIndex=0;return{value:a,match:b?b[2]:"",closing:b?!!b[3]:!1,selfClosing:b?!!b[5]||"/>"==b[2]:!1,tagName:b?
b[4]:"",column:b[1]?c+b[1].length:c}};this._readTagForward=function(a){var b=a.getCurrentToken();if(!b)return null;var c="",d;do if(0===b.type.indexOf("meta.tag")&&(d||(d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()}),c+=b.value,-1!==c.indexOf(">")))return c=this._parseTag(c),c.start=d,c.end={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length},a.stepForward(),c;while(b=a.stepForward());return null};this._readTagBackward=function(a){var b=a.getCurrentToken();
if(!b)return null;var c="",d;do if(0===b.type.indexOf("meta.tag")&&(d||(d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length}),c=b.value+c,-1!==c.indexOf("<")))return b=this._parseTag(c),b.end=d,b.start={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()},a.stepBackward(),b;while(b=a.stepBackward());return null};this._pop=function(a,b){for(;a.length;){var c=a[a.length-1];if(b&&c.tagName!=b.tagName)if(this.voidElements[b.tagName])break;else if(this.voidElements[c.tagName])a.pop();
else return null;else return a.pop()}};this.getFoldWidgetRange=function(a,b,c){var d=this._getFirstTagInLine(a,c);if(!d.match)return null;b=[];if(d.closing||d.selfClosing)for(a=new f(a,c,d.column+d.match.length),d={row:c,column:d.column};c=this._readTagBackward(a);){if(c.selfClosing)if(b.length)continue;else return c.start.column+=c.tagName.length+2,c.end.column-=2,l.fromPoints(c.start,c.end);if(c.closing)b.push(c);else if(this._pop(b,c),0==b.length)return c.start.column+=c.tagName.length+2,l.fromPoints(c.start,
d)}else for(a=new f(a,c,d.column),d={row:c,column:d.column+d.tagName.length+2};c=this._readTagForward(a);){if(c.selfClosing)if(b.length)continue;else return c.start.column+=c.tagName.length+2,c.end.column-=2,l.fromPoints(c.start,c.end);if(c.closing){if(this._pop(b,c),0==b.length)return l.fromPoints(d,c.start)}else b.push(c)}}}).call(a.prototype)});define("mode/xml_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("mode/xml_util");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var l=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml_pe",regex:"<\\?.*?\\?>"},{token:"comment",merge:!0,regex:"<\\!--",next:"comment"},{token:"xml_pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",
regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"text",regex:"[^<]+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?--\x3e",next:"start"},{token:"comment",merge:!0,regex:".+"}]};g.tag(this.$rules,"tag","start")};n.inherits(l,a);k.XmlHighlightRules=l});define("mode/xml_util",["require","exports","module"],function(a,k,n){function g(a,g){return[{token:"string",merge:!0,regex:".*?"+a,next:g},{token:"string",merge:!0,regex:".+"}]}k.tag=function(a,h,f,e){a[h]=[{token:"text",regex:"\\s+"},{token:function(a){return e&&e[a]?"meta.tag.tag-name."+e[a]:"meta.tag.tag-name"},merge:!0,regex:"[-_a-zA-Z0-9:]+",next:h+"_embed_attribute_list"},{token:"empty",regex:"",next:h+"_embed_attribute_list"}];a[h+"_qstring"]=g("'",h+"_embed_attribute_list");a[h+"_qqstring"]=
g('"',h+"_embed_attribute_list");a[h+"_embed_attribute_list"]=[{token:"meta.tag",merge:!0,regex:"/?>",next:f},{token:"keyword.operator",regex:"="},{token:"entity.other.attribute-name",regex:"[-_a-zA-Z0-9:]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"text",regex:"\\s+"}].concat([{token:"string",regex:'".*?"'},{token:"string",merge:!0,regex:'["].*',next:h+"_qqstring"},{token:"string",regex:"'.*?'"},{token:"string",merge:!0,regex:"['].*",next:h+"_qstring"}])}});define("mode/yaml",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");var g=a("ace/mode/text").Mode,l=a("mode/yaml_highlight_rules").YamlHighlightRules,h=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=a("ace/mode/folding/coffee").FoldMode;a=function(){this.HighlightRules=l;this.$outdent=new h;this.foldingRules=new f;this.$behaviour=this.$defaultBehaviour};n.inherits(a,g);(function(){this.lineCommentStart="#";this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b);
"start"==a&&b.match(/^.*[\{\(\[]\s*$/)&&(d+=c);return d};this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)};this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)};this.$id="mode/yaml"}).call(a.prototype);k.Mode=a});define("mode/yaml_highlight_rules",["require","exports","module"],function(a,k,n){n=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:["whitespace","comment"],regex:"(^|\\s+)(#.*)$"},{token:"list.markup",regex:/^(?:-{3}|\.{3})\s*(?=#|$)/},{token:"list.markup",regex:/^\s*[\-?](?:$|\s)/},{token:"constant",regex:"!![\\w//]+"},{token:"constant.language",regex:"[&\\*][a-zA-Z0-9-_]+"},{token:["meta.tag","keyword","meta.tag","keyword"],regex:/^(\s*[\w\-].*?)(:{2,3})(\s*[\w\-].*?)(:(?:\s+|$))/},
{token:["meta.tag","keyword"],regex:/^(\s*[\w\-].*?)(:(?:\s+|$))/},{token:["meta.tag","keyword"],regex:/([\w\-]+?)(\s*:(?:\s+|$))/},{token:"keyword.operator",regex:"<<\\w*:\\w*"},{token:"keyword.operator",regex:"-\\s*(?=[{])"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:/[|>][-+\d\s]*$/,onMatch:function(a,g,f,e){a=/^\s*/.exec(e)[0];f=f||[];f[0]=g;f[1]=a.length;return this.token},next:"mlString"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",
regex:/(\b|[+\-\.])[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)/},{token:"constant.numeric",regex:/[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/},{token:"constant.language.boolean",regex:"\\b(?:true|false|TRUE|FALSE|True|False|yes|no)\\b"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"}],mlString:[{token:"indent",regex:/^\s*$/},{token:"indent",regex:/^\s*/,onMatch:function(a,g,f){this.next=f[1]>=a.length?f[0]:g;return this.token},next:"mlString"},{token:"string",regex:".+"}]};
this.normalizeRules()};n.inherits(g,a);k.YamlHighlightRules=g});define("theme/default",["require","exports","module"],function(a,k,n){a("ace/lib/dom");k.cssClass="ace-rs"});if(!String.prototype.trimRight){var trimEndRegexp=/\s\s*$/;String.prototype.trimRight=function(){return String(this).replace(trimEndRegexp,"")}}
define("rstudio/loader",["require","exports","module"],function(a,k,n){var g=a("ace/edit_session").EditSession,l=a("ace/editor").Editor;a("ace/lib/event_emitter");a("util/expand_selection");var h=a("ace/range").Range,f=a("ace/virtual_renderer").VirtualRenderer,e=a("ace/mode/text").Mode,b=a("ace/undomanager").UndoManager,c=a("mode/utils");a("ace/lib/event");n=a("ace/lib/oop");a("mixins/token_iterator");var d=function(a,b){l.call(this,a,b);this.setBehavioursEnabled(!0)};n.inherits(d,l);(function(){this.$highlightBrackets=
function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);this.session.selection.isEmpty()&&l.prototype.$highlightBrackets.call(this)};this.insert=function(a,b){if(!this.session.selection.isEmpty()){var d=[];"quotes"===this.$surroundSelection?d=["'",'"',"`"]:"quotes_and_brackets"===this.$surroundSelection&&(d="'\"`({[".split(""));if("quotes_and_brackets"===this.$surroundSelection){var e=this.session.$mode;if(/\/markdown$/.test(e.$id))d.push("*",
"_");else{var f=this.getCursorPosition();e.getLanguageMode&&"Markdown"===e.getLanguageMode(f)&&d.push("*","_")}}if(c.contains(d,a))return d=c.getComplement(a),this.session.replace(this.session.selection.getRange(),a+this.session.getTextRange()+d)}return l.prototype.insert.call(this,a,b)};this.remove=function(a){return this.session.getMode().wrapRemove?this.session.getMode().wrapRemove(this,l.prototype.remove,a):l.prototype.remove.call(this,a)};this.undo=function(){l.prototype.undo.call(this);this._dispatchEvent("undo")};
this.redo=function(){l.prototype.redo.call(this);this._dispatchEvent("redo")};this.onPaste=function(a,b){l.prototype.onPaste.call(this,a.replace(/\r\n|\n\r|\r/g,"\n"),b)}}).call(d.prototype);var r=function(a,b){g.call(this,a,b)};n.inherits(r,g);(function(){this.insert=function(a,b){return this.getMode().wrapInsert?this.getMode().wrapInsert(this,g.prototype.insert,a,b):g.prototype.insert.call(this,a,b)};this.reindent=function(a){var b=this.getMode();if(b.getNextLineIndent){var d=a.start.row;a=a.end.row;
0===d&&(this.applyIndent(0,""),d++);for(var e=d;e<=a;e++){var f=c.getPrimaryState(this,e-1);if(!c.endsWith(f,"qstring")){var g=b.getNextLineIndent(f,this.getLine(e-1),this.getTabString(),e-1,!0);this.applyIndent(e,g);b.autoOutdent(f,this,e)}}b=b.codeModel;"undefined"!==typeof b&&(b=b.alignContinuationSlashes,"undefined"!==typeof b&&b(this.getDocument(),{start:d,end:a}))}};this.applyIndent=function(a,b){var c=this.getLine(a).match(/^\s*/g)[0].length;this.replace(new h(a,0,a,c),b)};this.setDisableOverwrite=
function(a){a?(this.setOverwrite(!1),this.setOverwrite=function(){},this.getOverwrite=function(){return!1}):(this.setOverwrite=g.prototype.setOverwrite,this.getOverwrite=g.prototype.getOverwrite)}}).call(r.prototype);var q=function(){b.call(this)};n.inherits(q,b);(function(){this.peek=function(){return this.$undoStack.length?this.$undoStack[this.$undoStack.length-1]:null}}).call(q.prototype);var p=function(a,b){f.call(this,a,b)};n.inherits(p,f);(function(){this.setTheme=function(a){a&&f.prototype.setTheme.call(this,
a)}}).call(p.prototype);k.RStudioEditor=d;k.loadEditor=function(b){function c(a){f.editor.commands.removeCommand(a)}var f={};b.env=f;b=new p(b,"");var g=new r("");b=new d(b,g);f.editor=b;g=b.getSession();g.setMode(new e);g.setUndoManager(new q);b=a("ace/config");b.set("basePath","ace");b.set("workerPath","js/workers");b.setDefaultValue("session","useWorker",!1);c("findnext");c("findprevious");c("find");c("replace");c("togglecomment");c("gotoline");c("foldall");c("unfoldall");return f.editor}});define("rstudio/snippets",["require","exports","module"],function(a,k,n){k.toSnippetText=function(a){for(var g=a.length,h="",f=0;f<g;f++){var e=a[f];h+="snippet "+e.name+"\n\t"+e.content.replace(/\n/g,"\n\t")+"\n\n"}return h};k.normalizeSnippets=function(a){for(var g=a.length,h=0;h<g;h++){var f=a[h];null==f.tabTrigger&&(f.tabTrigger=f.name);f.content=f.content.replace("\n    ","\n\t")}}});define("rstudio/snippets/c_cpp",["require","exports","module"],function(a,k,n){n=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"once",content:"#ifndef ${1:`HeaderGuardFileName`}\n#define ${1:`HeaderGuardFileName`}\n\n${0}\n\n#endif /* ${1:`HeaderGuardFileName`} */"},{name:"ans",content:"namespace {\n${0}\n} // anonymous namespace"},{name:"ns",content:"namespace ${1:ns} {\n${0}\n} // namespace ${1:ns}"},{name:"cls",content:"class ${1:ClassName} {\npublic:\n    ${2}\nprivate:\n    ${3}\n};"},
{name:"str",content:"struct ${1} {\n    ${0}\n};"},{name:"ept",content:"// [[Rcpp::export]]\n"}];n.normalizeSnippets(g);k.snippetText=n.toSnippetText(g);a.register(g,"c_cpp")});define("rstudio/snippets/markdown",["require","exports","module"],function(a,k,n){n=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"[",content:"[${1:label}](${2:location})"},{name:"![",content:"![${1:label}](${2:location})"},{name:"r",content:"```{r ${1:label}, ${2:options}}\n${0}\n```"},{name:"rcpp",content:"```{r, engine='Rcpp'}\n#include <Rcpp.h>\nusing namespace Rcpp;\n\n${0}\n\n```"}];n.normalizeSnippets(g);k.snippetText=n.toSnippetText(g);a.register(g,"markdown")});define("rstudio/snippets/r",["require","exports","module"],function(a,k,n){n=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"lib",content:"library(${1:package})"},{name:"req",content:"require(${1:package})"},{name:"src",content:'source("${1:file.R}")'},{name:"ret",content:"return(${1:code})"},{name:"mat",content:"matrix(${1:data}, nrow = ${2:rows}, ncol = ${3:cols})"},{name:"sg",content:'setGeneric("${1:generic}", function(${2:x, ...}) {\n    standardGeneric("${1:generic}")\n})'},
{name:"sm",content:'setMethod("${1:generic}", ${2:class}, function(${2:x, ...}) {\n    ${0}\n})'},{name:"sc",content:'setClass("${1:Class}", slots = c(${2:name = "type"}))'},{name:"if",content:"if (${1:condition}) {\n    ${0}\n}"},{name:"el",content:"else {\n    ${0}\n}"},{name:"ei",content:"else if (${1:condition}) {\n    ${0}\n}"},{name:"fun",content:"${1:name} <- function(${2:variables}) {\n    ${0}\n}"},{name:"for",content:"for (${1:variable} in ${2:vector}) {\n    ${0}\n}"},{name:"while",content:"while (${1:condition}) {\n    ${0}\n}"},
{name:"switch",content:"switch (${1:object},\n    ${2:case} = ${3:action}\n)"},{name:"apply",content:"apply(${1:array}, ${2:margin}, ${3:...})"},{name:"lapply",content:"lapply(${1:list}, ${2:function})"},{name:"sapply",content:"sapply(${1:list}, ${2:function})"},{name:"mapply",content:"mapply(${1:function}, ${2:...})"},{name:"tapply",content:"tapply(${1:vector}, ${2:index}, ${3:function})"},{name:"vapply",content:"vapply(${1:list}, ${2:function}, FUN.VALUE = ${3:type}, ${4:...})"},{name:"rapply",
content:"rapply(${1:list}, ${2:function})"},{name:"ts",content:'`r paste("#", date(), "------------------------------\\n")`'},{name:"shinyapp",content:"library(shiny)\n\nui <- fluidPage(\n  ${0}\n)\n\nserver <- function(input, output, session) {\n  \n}\n\nshinyApp(ui, server)"},{name:"shinymod",content:"${1:name}UI <- function(id) {\n  ns <- NS(id)\n  tagList(\n    ${0}\n  )\n}\n\n${1:name}Server <- function(id) {\n  moduleServer(\n    id,\n    function(input, output, session) {\n      \n    }\n  )\n}"}];
n.normalizeSnippets(g);k.snippetText=n.toSnippetText(g);a.register(g,"r")});define("rstudio/snippets/stan",["require","exports","module"],function(a,k,n){n=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"for",content:"for (${1:var} in ${2:start}:${3:end}) {\n  ${0}\n}"},{name:"if",content:"if (${1:condition}) {\n  ${0}\n}"},{name:"el",content:"else (${1:condition}) {\n  ${0}\n}"},{name:"ei",content:"else if (${1:condition}) {\n  ${0}\n}"},{name:"<l",content:"<lower = ${1:expression}>${0}"},{name:"<u",content:"<upper = ${1:expression}>${0}"},{name:"<lu",
content:"<lower = ${1:expression}, upper = ${2:expression}>${0}"},{name:"while",content:"while (${1:condition}) {\n  ${0}\n}"},{name:"gen",content:"generated quantities {\n  ${0}\n}"},{name:"mdl",content:"model {\n  ${0}\n}"},{name:"par",content:"parameters {\n  ${0}\n}"},{name:"tpar",content:"transformed parameters {\n  ${0}\n}"},{name:"data",content:"data {\n  ${0}\n}"},{name:"tdata",content:"transformed data {\n  ${0}\n}"},{name:"ode",content:"integrate_ode(${1:function}, ${2:y0}, ${3:t0}, ${4:t}, ${5:theta}, ${6:x_r}, ${7:x_i});"},
{name:"funs",content:"functions {\n  ${0}\n}"},{name:"fun",content:"${1:return} ${2:name} (${3:args}) {\n  ${0}\n}"}];n.normalizeSnippets(g);k.snippetText=n.toSnippetText(g);a.register(g,"stan")});define("rstudio/snippets/yaml",["require","exports","module"],function(a,k,n){n=a("rstudio/snippets");a=a("ace/snippets").snippetManager;var g=[{name:"key",content:"${1:key}: ${2:value}"},{name:"list",content:"${1:key}:\n  - ${2:value1}\n  - ${3:value2}"}];n.normalizeSnippets(g);k.snippetText=n.toSnippetText(g);a.register(g,"yaml")});