var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var k=0;return function(){return k<a.length?{done:!1,value:a[k++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var k="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return k?k.call(a):$jscomp.arrayIterator(a)};
define("mixins/token_iterator",["require","exports","module"],function(a,k,h){var g=a("ace/token_iterator").TokenIterator,n=a("ace/range").Range;(function(){function a(a,c){return 1===a.length&&("{"===a||"("===a||"["===a||!!c&&"<"===a)}function f(a,c){return 1===a.length&&("}"===a||")"===a||"]"===a||!!c&&">"===a)}function b(a,c,d,b,e){for(var m=1,q,p=a.clone();q=d.call(p);)if(q=c(q),q===e){if(m--,0===m)return a.moveToTokenIterator(p),!0}else q===b&&m++;return!1}var d={"(":")","{":"}","[":"]","<":">",
")":"(","}":"{","]":"[",">":"<"};this.moveToPreviousToken=function(){var a=this.$rowTokens,c=this.$tokenIndex-1;if(0<=c)return this.$tokenIndex--,a[c];c=this.$session;var d=this.$row;if(0>d)return null;for(;;){d--;if(0>d)return null;if((a=c.getTokens(d))&&a.length)return this.$row=d,this.$tokenIndex=a.length-1,this.$rowTokens=a,a[a.length-1]}};this.moveToNextToken=function(){var a=this.$rowTokens,c=this.$tokenIndex+1;if(c<a.length)return this.$tokenIndex++,a[c];c=this.$session;var d=c.getLength(),
b=this.$row;if(b>=d)return null;for(;;){b++;if(b>=d)return null;if((a=c.getTokens(b))&&a.length)return this.$row=b,this.$tokenIndex=0,this.$rowTokens=a,a[0]}};this.moveToNextSignificantToken=function(){if(!this.moveToNextToken())return!1;for(var a=this.getCurrentToken();/^\s+$/.test(a.value)||/\bcomment\b/.test(a.type);){if(!this.moveToNextToken())return!1;a=this.getCurrentToken()}return!0};this.moveToPreviousSignificantToken=function(){if(!this.moveToPreviousToken())return!1;for(var a=this.getCurrentToken();/^\s+$/.test(a.value)||
/\bcomment\b/.test(a.type);){if(!this.moveToPreviousToken())return!1;a=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 a=this.$row,c=this.$session,d=c.getLength();;){a++;if(a>=d)return null;var b=c.getTokens(a);if(b&&b.length)return this.$row=a,this.$tokenIndex=0,this.$rowTokens=
b,this.getCurrentToken()}};var e,c=0,r=0;this.tokenizeUpToRow=function(a){var d=this.$session.bgTokenizer;c=Math.min(c,d.currentLine);r=Math.max(r,a);for(var b=d.currentLine;b<=a;b++)d.$tokenizeRow(b);clearTimeout(e);e=setTimeout(function(){d.fireUpdateEvent(c,r);c=r;r=0},700)};this.moveToPosition=function(a,c){this.tokenizeUpToRow(a.row);var d=this.$session.getTokenAt(a.row,a.column);d&&c&&d.column<a.column&&(d=this.$session.getTokenAt(a.row,a.column+1));if(null==d){if(c)return this.$row=a.row,this.$rowTokens=
this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1,this.moveToNextToken();this.$row=a.row+1;this.$tokenIndex=0;this.$rowTokens=this.$session.getTokens(this.$row);return this.moveToPreviousToken()}this.$row=a.row;this.$rowTokens=this.$session.getTokens(this.$row);this.$tokenIndex=d.index;return this.getCurrentToken()};this.clone=function(){var a=new g(this.$session,0,0);a.moveToTokenIterator(this);return a};this.moveToTokenIterator=function(a){for(var c in a)a.hasOwnProperty(c)&&
(this[c]=a[c])};this.peekFwd=function(a){for(var c=this.clone(),d=null,b=0;b<a;b++)d=c.moveToNextToken();return d};this.peekBwd=function(a){for(var c=this.clone(),d=null,b=0;b<a;b++)d=c.moveToPreviousToken();return d};this.getCurrentToken=function(){var a=this.$rowTokens[this.$tokenIndex];a&&(a.row=this.$row);return a};this.getCurrentTokenValue=function(){return this.getCurrentToken().value};this.getCurrentTokenPosition=function(){return{row:this.getCurrentTokenRow(),column:this.getCurrentTokenColumn()}};
this.getCurrentTokenRange=function(){var a=this.getCurrentTokenPosition(),c={row:a.row,column:a.column+this.getCurrentToken().value.length};return n.fromPoints(a,c)};this.fwdToMatchingToken=function(){var c=this.getCurrentToken();return a(c.value,!0)?b(this,function(a){return a.value},this.moveToNextToken,c.value,d[c.value]):"support.function.codebegin"===c.type?b(this,function(a){return a.type},this.moveToNextToken,"support.function.codebegin","support.function.codeend"):!1};this.bwdToMatchingToken=
function(){var a=this.getCurrentToken();return f(a.value,!0)?b(this,function(a){return a.value},this.moveToPreviousToken,a.value,d[a.value]):"support.function.codeend"===a.type?b(this,function(a){return a.type},this.moveToPreviousToken,"support.function.codeend","support.function.codebegin"):!1};this.findTokenValueBwd=function(a,c){c=!!c;do if(!(c&&this.bwdToMatchingToken()||this.getCurrentToken().value!==a))return!0;while(this.moveToPreviousToken());return!1};this.findTokenValueFwd=function(a,c){c=
!!c;do if(!(c&&this.fwdToMatchingToken()||this.getCurrentToken().value!==a))return!0;while(this.moveToNextToken());return!1};this.findTokenTypeBwd=function(a,c){c=!!c;do if(!(c&&this.bwdToMatchingToken()||this.getCurrentToken().type!==a))return!0;while(this.moveToPreviousToken());return!1};this.findTokenTypeFwd=function(a,c){c=!!c;do if(!(c&&this.fwdToMatchingToken()||this.getCurrentToken().type!==a))return!0;while(this.moveToNextToken());return!1}}).call(g.prototype)});define("ace/token_tooltip",["require","exports","module"],function(a,k,h){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),n.addListener(a.renderer.scroller,"mousemove",this.onMouseMove),n.addListener(a.renderer.content,"mouseout",this.onMouseOut))}a("ace/lib/dom");h=a("ace/lib/oop");var n=a("ace/lib/event"),l=a("ace/range").Range,f=a("ace/tooltip").Tooltip;
h.inherits(g,f);(function(){this.token={};this.range=new l;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 d=a.rect||(a.rect=a.scroller.getBoundingClientRect()),e=Math.floor((this.y+a.scrollTop-d.top)/a.lineHeight),c=this.editor.session;a=c.screenToDocumentPosition(e,Math.round((this.x+a.scrollLeft-d.left-a.$padding)/a.characterWidth));(d=c.getTokenAt(a.row,
a.column))||c.getLine(a.row)||(d={type:"",value:"",state:c.bgTokenizer.getState(0)});d?(e=JSON.stringify(c.getState(e))+"| "+d.type,this.tokenText!=e&&(this.setText(e),this.width=this.getWidth(),this.height=this.getHeight(),this.tokenText=e),this.show(null,this.x,this.y),this.token=d,c.removeMarker(this.marker),this.range=new l(a.row,d.start,a.row,d.start+d.value.length),this.marker=c.addMarker(this.range,"ace_bracket","text")):(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,d){a+10+this.width>this.maxWidth&&(a=window.innerWidth-this.width-10);if(d>.75*window.innerHeight||d+20+this.height>this.maxHeight)d=d-this.height-
30;f.prototype.setPosition.call(this,a+10,d+20)};this.destroy=function(){this.onMouseOut();n.removeListener(this.editor.renderer.scroller,"mousemove",this.onMouseMove);n.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,h){var g=a("ace/range").Range,n=a("ace/mode/text").Mode;(function(){this.$complements={"(":")","[":"]",'"':'"',"{":"}"};this.$reOpen=/^[(["{]$/;this.$reClose=/^[)\]"}]$/;this.$reStop=/^[;,\s)\]}]$/;this.wrapInsert=function(a,f,b,d){if(!this.insertMatching)return f.call(a,b,d);var e=a.selection.getCursor();if(e=a.selection.isEmpty()&&b.row==e.row&&b.column==e.column){var c=g.fromPoints(b,{row:b.row,column:b.column+1}),r=a.doc.getTextRange(c);
if(this.$reClose.test(r)&&r==d){a.selection.moveCursorTo(c.end.row,c.end.column,!1);return}}c=null;e&&(c=this.$moveLeft(a.doc,b),c=a.doc.getTextRange(g.fromPoints(c,b)));f=f.call(a,b,d);e&&this.$reOpen.test(d)?(b=g.fromPoints(f,{row:f.row,column:f.column+1}),b=a.doc.getTextRange(b),(this.$reStop.test(b)||0==b.length)&&this.allowAutoInsert(a,f,this.$complements[d])&&(a.doc.insert(f,this.$complements[d]),a.selection.moveCursorTo(f.row,f.column,!1))):e&&"\n"===d&&(d=this.$moveRight(a.doc,f),d=a.doc.getTextRange(g.fromPoints(f,
d)),e=c,d=(c=a.getTokenAt(b.row,b.column-1))&&"function"===c.value?!1:"{"===e&&"}"===d||"("===e&&")"===d||"["===e&&"]"===d,d&&(b=this.getIndentForOpenBrace?this.getIndentForOpenBrace(this.$moveLeft(a.doc,b)):this.$getIndent(a.doc.getLine(f.row-1)),a.doc.insert(f,"\n"+b),a.selection.moveCursorTo(f.row,f.column,!1)));return f};this.allowAutoInsert=function(a,f,b){return null==a.renderer.$ghostText};this.smartAllowAutoInsert=function(a,f,b){return null!=a.renderer.$ghostText?!1:"'"!==b&&'"'!==b&&"`"!==
b?!0:"`"===b?(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,b){var d=a.selection.getCursor(),e=a.session.getDocument();if(!this.insertMatching||"left"!=b||!a.selection.isEmpty()||a.$readOnly||0==d.column||e.getLine(d.row).length<=d.column)return f.call(a,b);var c=g.fromPoints(this.$moveLeft(e,d),d);d=g.fromPoints(d,
this.$moveRight(e,d));c=e.getTextRange(c);e=this.$reOpen.test(c)&&this.$complements[c]==e.getTextRange(d);f.call(a,b);e&&f.call(a,"right")};this.$moveLeft=function(a,f){if(0==f.row&&0==f.column)return f;var b=f.row,d=f.column;d?d--:(b--,d=a.getLine(b).length);return{row:b,column:d}};this.$moveRight=function(a,f){var b=f.row,d=f.column;a.getLine(b).length!=d?d++:(b++,d=0);return b>=a.getLength()?f:{row:b,column:d}}}).call(n.prototype);k.setInsertMatching=function(a){n.prototype.insertMatching=a}});define("mode/c_cpp",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("ace/tokenizer").Tokenizer,l=a("ace/range").Range;a("mode/r_highlight_rules");var f=a("mode/c_cpp_highlight_rules").c_cppHighlightRules,b=a("mode/c_cpp_matching_brace_outdent").CppMatchingBraceOutdent,d=a("mode/behaviour/cstyle").CStyleBehaviour,e=null;window.NodeWebkit||(e=a("mode/c_cpp_fold_mode").FoldMode);var c=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 n((new f).getRules());this.r_codeModel=new c(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 d(this.codeModel);this.$cpp_outdent=new b(this.codeModel);window.NodeWebkit||(this.foldingRules=new e);this.$tokens=this.codeModel.$tokens;
this.getLineSansComments=this.codeModel.getLineSansComments};h.inherits(a,g);(function(){this.wrapInsert=function(a,c,d,e){return this.cursorInRLanguageMode()?g.prototype.wrapInsert(a,c,d,e):c.call(a,d,e)};this.wrapRemove=function(a,c,d){return this.cursorInRLanguageMode()?g.prototype.wrapRemove(a,c,d):c.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,c,d,e){var b=!0;a=/^(\s*)\/\//;for(var m=d;m<=
e;m++)if(!a.test(c.getLine(m))){b=!1;break}if(b)for(b=new l(0,0,0,0),m=d;m<=e;m++)d=c.getLine(m).match(a),b.start.row=m,b.end.row=m,b.end.column=d[0].length,c.replace(b,d[1]);else c.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,c,d,e,b){a=p.primaryState(a);return this.inRLanguageMode(a)?this.r_codeModel.getNextLineIndent(a,c,d,e):this.codeModel.getNextLineIndent(a,c,d,e,b)};this.checkOutdent=function(a,c,d){return this.inRLanguageMode(a)?this.$r_outdent.checkOutdent(a,c,d):this.$cpp_outdent.checkOutdent(a,c,d)};this.autoOutdent=function(a,c,d){return this.inRLanguageMode(a)?this.$r_outdent.autoOutdent(a,c,d,this.r_codeModel):this.$cpp_outdent.autoOutdent(a,
c,d)};this.$transformAction=this.transformAction;this.transformAction=function(a,c,d,e,b){a=p.primaryState(a);if(!this.inRLanguageMode(a))return this.$transformAction(a,c,d,e,b)};this.$id="mode/c_cpp"}).call(a.prototype);k.Mode=a});define("mode/c_cpp_fold_mode",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/range").Range;a=a("ace/mode/folding/fold_mode").FoldMode;k=k.FoldMode=function(){};h.inherits(k,a);(function(){function a(a,e,c,b){a=a.doc.$lines;for(var d=e+b,p=a[d],m=0<b?"*/":"/*",f;null!=p;){var r=p.indexOf(m);if(-1!==r){f=0<b?new g(e,c,d,r):new g(d,p.length,e,c);break}d+=b;p=a[d]}return f}function l(a,e,c,b,q){for(var d=e+q,m=a.doc.$lines;0<=d&&d<a.getLength();){for(var f=a.getTokens(d),
r=m[d],l=0;l<f.length;l++)if(f[l].type===b)return 0<q?new g(e,c,d,0):new g(d,r.length,e,c);d+=q}}var f=/(\{|\[)[^\}\]]*$/,b=/^[^\[\{]*(\}|\])/;this.getFoldWidget=function(a,e,c){e="markbeginend"===e?"end":"";c=a.getLine(c);if(f.test(c))return"start";if(b.test(c))return e;a=c.indexOf("/*");c=c.indexOf("*/");return-1!==a&&(-1===c||a>c)?"start":-1!==c&&(-1===a||c<a)?e:""};this.getFoldWidgetRange=function(d,e,c){var r=d.getLine(c),q;if(q=r.match(f))return this.openingBracketBlock(d,q[1],c,q.index);if(q=
"markbeginend"===e&&r.match(b))return this.closingBracketBlock(d,q[1],c,q.index+q[0].length);e=d.getTokens(c);for(q=0;q<e.length;q++){var p=e[q];if("support.function.codebegin"===p.type)return l(d,c,r.length,"support.function.codeend",1);if("support.function.codeend"===p.type)return l(d,c,0,"support.function.codebegin",-1)}e=r.indexOf("/*");if(-1!==e)return a(d,c,r.length,1);e=r.indexOf("*/");if(-1!==e)return a(d,c,e,-1)}}).call(k.prototype)});define("mode/c_cpp_highlight_rules",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/lib/lang"),n=a("mode/doc_comment_highlight_rules").DocCommentHighlightRules,l=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/tex_highlight_rules").TexHighlightRules,b=a("mode/r_highlight_rules").RHighlightRules,d=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules;a=function(){function a(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}
var c=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(" ")),
r=g.arrayToMap(["NULL"]),q="new delete >>= <<= ->* ... << >> && || == != <= >= :: *= += -= /= ++ -- &= ^= %= -> .* ! $ & | + - * / ^ ~ = %".split(" "),p=q.map(function(c){return a(c)}).join("|");q=["->*"].concat(q).concat("< > , () [] ->".split(" ")).map(function(c){return a(c)});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:"\\/\\/.*$"},n.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":c.hasOwnProperty(a)?"keyword":r.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:"\\?|\\:|\\,|\\;|\\.|\\\\"},d.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(n,"doc-",[n.getEndRule("start")]);this.$rules.start.unshift({token:"support.function.codebegin",regex:"^\\s*\\/\\*{3,}\\s*[Rr]\\s*$",next:"r-start"});p=(new b).getRules();this.addRules(p,"r-");
this.$rules["r-start"].unshift({token:"support.function.codeend",regex:"\\*\\/",next:"start"})};h.inherits(a,l);k.c_cppHighlightRules=a});define("mode/c_cpp_matching_brace_outdent",["require","exports","module"],function(a,k,h){var g=a("ace/range").Range,n=a("mode/token_cursor").CppTokenCursor;h=function(a){this.codeModel=a};var l=a("mode/utils"),f=!0,b=!0,d=!0,e=!0,c=!0,r=!0,q=!0,p=!0,m=!0,v=!0,B=!0,w=!0;(function(){this.setIndent=function(a,c,d,e,b){a=a.getDocument();e="string"===typeof e?e:"";var m=a.$lines[d];d=this.$getIndent(a.$lines[c]);m=this.$getIndent(m);("function"!==typeof b||b(d,m))&&a.replace(new g(c,0,c,d.length),m+e)};
this.checkOutdent=function(a,c,d){return l.endsWith(a,"start")&&(":"===d||/^\s*[#\{\}>\]\)<.:]/.test(d)||"="===d)||l.endsWith(a,"comment")&&"/"==d?!0:!1};this.escapeRegExp=function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};this.alignStartToken=function(a,c,d,e,b){return null===b||null===e?!1:(new RegExp("^\\s*"+this.escapeRegExp(a))).test(e)&&(a=b.indexOf(a),0<=a)?(c=c.getDocument(),e=this.$getIndent(e),a=Array(a+1).join(" "),c.replace(new g(d,0,d,e.length),a),!0):!1};this.alignEquals=
function(a,c,d,e){if(null===e||null===d)return!1;var b=d.indexOf("=");if(b!==d.lastIndexOf("="))return!1;var m=e.indexOf("=");if(-1!==b&&-1!==m&&/,\s*$/.test(e)){a=a.getDocument();d=this.$getIndent(d);if(d.length>=m)return!1;b=m-b;if(0>=b)return!1;b=Array(d.length+b+1).join(" ");a.replace(new g(c,0,c,d.length),b);return!0}return!1};this.autoOutdent=function(a,p,x){a=p.doc;var t=a.getLine(x),y=null;0<x&&(y=a.getLine(x-1));if(!v||!this.alignStartToken("<<",p,x,t,y))if(!m||!this.alignStartToken(">>",
p,x,t,y))if(!q||!this.alignStartToken(".",p,x,t,y)){if(f&&/^\s*:/.test(a.getLine(x))&&!/^\s*::/.test(a.getLine(x))&&this.codeModel.$tokenUtils.$tokenizeUpToRow(x)){var k=new n(this.codeModel.$tokens,x,0),u=-1,C=k.cloneCursor();if(")"===C.peekBwd().currentValue()||"keyword"===C.peekBwd().currentType()){do{k=C.currentType();var H=C.currentValue();if("identifier"===k||";"===H){u=C.$row;break}"keyword"!==k&&C.bwdToMatchingToken()}while(C.moveToPreviousToken())}else k.moveToPreviousToken(),k.bwdOverClassySpecifiers()&&
(u=k.$row);0<=u&&this.setIndent(p,x,u,p.getTabString(),function(a,c){return a===c})}if(r&&/^\s*>/.test(t)&&!/^\s*>>/.test(t)&&(u=this.codeModel.getRowForMatchingEOLArrows(p,a,x),0<=u)){this.setIndent(p,x,u);return}if(e&&/^\s*\}/.test(t)&&(u=p.findMatchingBracket({row:x,column:t.indexOf("}")+1}),null!==u)){if(/^\s*\{/.test(a.$lines[u.row])){this.setIndent(p,x,u.row);return}u=this.codeModel.getRowForOpenBraceIndent(p,u.row);if(0<=u){this.setIndent(p,x,u);return}}if(b&&/^\s*\)/.exec(t)&&(u=p.findMatchingBracket({row:x,
column:t.indexOf(")")+1}))){this.setIndent(p,x,u.row);return}if(c&&/^\s*\]/.exec(t)&&(u=p.findMatchingBracket({row:x,column:t.indexOf("]")+1}))){this.setIndent(p,x,u.row);return}if(B&&/^\s*public\s*:\s*$|^\s*private\s*:\s*$|^\s*protected\s*:\s*$/.test(t)&&(C=p.$findOpeningBracket("}",{row:x,column:t.length},l.getTokenTypeRegex("paren")))){u=this.codeModel.getRowForOpenBraceIndent(p,C.row);0<=u?this.setIndent(p,x,u):this.setIndent(p,x,C.row);return}if(w&&(/^\s*case.+:/.test(t)||/^\s*default\s*:/.test(t))&&
(C=p.$findOpeningBracket("}",{row:x,column:/(\S)/.exec(t).index+1},l.getTokenTypeRegex("paren")))){u=this.codeModel.getRowForOpenBraceIndent(p,C.row);0<=u?this.setIndent(p,x,u):this.setIndent(p,x,C.row);return}if(d&&/^\s*\{/.test(t)&&!/;\s*$/.test(y)){if(this.codeModel.$tokenUtils.$tokenizeUpToRow(x)&&(k=new n(this.codeModel.$tokens),k.$row=x,k.$offset=0,k.moveToPreviousToken()&&"="===k.currentValue()))return;y=this.codeModel.getRowForOpenBraceIndent(p,x);if(0<=y){this.setIndent(p,x,y);return}}/^\s*#/.test(t)&&
(p=this.$getIndent(t),a.replace(new g(x,0,x,p.length),""))}};this.$getIndent=function(a){return(a=a.match(/^(\s+)/))?a[1]:""}}).call(h.prototype);k.CppMatchingBraceOutdent=h;k.getOutdentColon=function(){return f};k.setOutdentColon=function(a){f=a};k.getOutdentRightParen=function(){return b};k.setOutdentRightParen=function(a){b=a};k.getOutdentLeftBrace=function(){return d};k.setOutdentLeftBrace=function(a){d=a};k.getOutdentRightBrace=function(){return e};k.setOutdentRightBrace=function(a){e=a};k.getOutdentRightBracket=
function(){return c};k.setOutdentRightBracket=function(a){c=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 v};k.setAlignStreamOut=function(a){v=a};k.getAlignClassAccessModifiers=function(){return B};k.setAlignClassAccessModifiers=
function(a){B=a};k.getAlignCase=function(){return w};k.setAlignCase=function(a){w=a}});define("mode/behaviour/cstyle",["require","exports","module"],function(a,k,h){h=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 n=a("mode/utils"),l=!0;a=function(a){var b=a.$complements,d=function(a,d,e,p){var c=b[a];if(d==a)return d=e.getSelectionRange(),p=p.doc.getTextRange(d),""!==p?{text:a+p+c,selection:!1}:{text:a+c,selection:[1,1]};if(d==c&&(a=e.getCursorPosition(),p.doc.getLine(a.row)[a.column]==c&&(">"===c||null!==
p.findMatchingBracket({row:a.row,column:a.column+1}))))return{text:"",selection:[1,1]}},e=function(a,d,e){var c=b[a],m=e.doc.getTextRange(d);if(!d.isMultiLine()&&m==a&&e.doc.getLine(d.start.row).substring(d.start.column+1,d.start.column+2)==c)return d.end.column++,d};this.add("R","insertion",function(a,d,e,b,m){if("R"===m||"r"===m)if(a=e.getCursorPosition(),b=(new String(b.doc.getLine(a.row))).match(/^(\s*)\/\*{3,}\s*/))return{text:"R\n"+b[1]+"\n"+b[1]+"*/",selection:[1,b[1].length,1,b[1].length]}});
this.add("newline","insertion",function(c,d,e,b,m){if("\n"===m){var f=e.getCursorPosition();m=f.row;var p=f.column;d=b.getTabString();var q=b.doc.$lines;e=q[m];if(!this.codeModel.inMacro(q,m-1)){var r=/^(\s*\/\/'\s*)/.exec(e);if(r&&p>=r[1].length)return{text:"\n"+r[1]};if(/^\s*[/][*]+\s*$/.test(e)&&!/^\s*[*]/.test(q[m+1]||""))return b=this.$getIndent(e),d=b+" * ",{text:"\n"+d+"\n"+b+" */",selection:[1,d.length,1,d.length]};if(n.endsWith(c,"comment")||n.endsWith(c,"doc-start")){f&&f.row==m&&(e=e.substring(0,
f.column));if(c=/^(\s*)(\/\*)/.exec(e))return{text:"\n"+c[1]+" * "};if(c=/^(\s*\*+\s*)/.exec(e))return{text:"\n"+c[1],selection:[1,c[1].length,1,c[1].length]}}for(c=p-1;/\s/.test(e[c]);)--c;c=e[c];p=e[p];if(r=e.match(/\s*namespace\s*\w*\s*{/))return b=this.$getIndent(e),{text:"\n"+b,selection:[1,b.length,1,b.length]};if("("==c&&")"==p||"["==c&&"]"==p)return e=this.$getIndent(e),b=e+d,{text:"\n"+b+"\n"+e,selection:[1,b.length,1,b.length]};if("{"==c&&"}"==p){if(/^\s*{/.test(e))return e=this.$getIndent(e),
b=e+b.getTabString(),{text:"\n"+b+"\n"+e,selection:[1,b.length,1,b.length]};m=a.getRowForOpenBraceIndent(b,m);if(null!==m&&0<=m)return e=this.$getIndent(b.getDocument().getLine(m)),b=e+b.getTabString(),{text:"\n"+b+"\n"+e,selection:[1,b.length,1,b.length]};e=this.$getIndent(e);b=e+d;return{text:"\n"+b+"\n"+e,selection:[1,b.length,1,b.length]}}}}});this.add("braces","insertion",function(a,e,b,f,m){if(this.insertMatching){if("{"==m&&(a=b.getSelectionRange(),""===f.doc.getTextRange(a))){a=this.codeModel.getTokenCursor();
if(!a.moveToPosition(b.getCursorPosition()))return d("{",m,b,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(l&&"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 d("{",m,b,
f)}});this.add("braces","deletion",function(a,d,e,b,m){if(this.insertMatching&&(a=b.doc.getTextRange(m),!m.isMultiLine()&&"{"==a)){a=b.doc.getLine(m.start.row);if(/^\s*do\s*\{\} while \(\);\s*$/.test(a))return m.end.column=a.length,m;b=a.substring(m.end.column,m.end.column+1);a=a.substring(m.end.column+1,m.end.column+2);if("}"==b)return m.end.column++,";"==a&&m.end.column++,m}});this.add("parens","insertion",function(a,e,b,f,m){if(this.insertMatching)return d("(",m,b,f)});this.add("parens","deletion",
function(a,d,b,f,m){if(this.insertMatching)return e("(",m,f)});this.add("brackets","insertion",function(a,e,b,f,m){if(this.insertMatching)return d("[",m,b,f)});this.add("brackets","deletion",function(a,d,b,f,m){if(this.insertMatching)return e("[",m,f)});this.add("arrows","insertion",function(a,e,b,f,m){if(this.insertMatching&&(a=f.getLine(b.getCursorPosition().row),/^\s*#\s*include/.test(a)))return d("<",m,b,f)});this.add("arrows","deletion",function(a,d,b,f,m){if(this.insertMatching)return e("<",
m,f)});this.add("string_dquotes","insertion",function(a,d,e,b,m){if(this.insertMatching&&('"'==m||"'"==m)){a=e.getSelectionRange();d=b.doc.getTextRange(a);if(""!==d)return{text:m+d+m,selection:!1};e=e.getCursorPosition();d=b.doc.getLine(e.row);if("\\"==d.substring(e.column-1,e.column))return null;b=b.getTokens(a.start.row);for(var c=0,f,p=-1,g=0;g<b.length;g++){f=b[g];"string"==f.type?p=-1:0>p&&(p=f.value.indexOf(m));if(f.value.length+c>a.start.column)break;c+=b[g].value.length}if(!f||0>p&&"comment"!==
f.type&&("string"!==f.type||a.start.column!==f.value.length+c-1&&f.value.lastIndexOf(m)===f.value.length-1))return{text:m+m,selection:[1,1]};if(f&&"string"===f.type&&d.substring(e.column,e.column+1)==m)return{text:"",selection:[1,1]}}});this.add("string_dquotes","deletion",function(a,d,e,b,m){if(this.insertMatching&&(a=b.doc.getTextRange(m),!m.isMultiLine()&&('"'==a||"'"==a)&&(b=b.doc.getLine(m.start.row).substring(m.start.column+1,m.start.column+2),'"'===b||"'"===b)))return m.end.column++,m});this.add("punctuation.operator",
"insertion",function(a,d,e,b,m){if(this.insertMatching&&";"===m&&(a=e.selection.getCursor(),";"==b.getLine(a.row)[a.column]))return{text:"",selection:[1,1]}});this.add("macro","insertion",function(a,d,e,b,m){d=e.getPrintMarginColumn();d=Math.min(62,d);var c=b.getDocument().$lines,f=e.getCursorPosition(),g=f.row,l=c[g];e=l.substring(0,f.column);if(/^\s*#\s*define[^\\]*$/.test(l)&&"\\"==m)return a=d-e.length+1,0<=a?{text:Array(a+1).join(" ")+"\\\n"+this.$getIndent(l)+b.getTabString(),selection:!1}:
{text:"\\\n"+b.getTabString(),selection:!1};if(/^\s*#\s*define/.test(l)||this.codeModel.inMacro(c,g-1)){if("\\"==m&&/^\s*$/.test(l.substring(e.length,l.length)))return a=d-e.length+1,0<=a?{text:Array(a+1).join(" ")+"\\",selection:!1}:{text:"\\",selection:!1};if("\n"==m){if(/^\s*$/.test(l)||/^\s*#\s*define/.test(l)&&!/\\\s*$/.test(l))return{text:"\n",selection:!1};if(/\\\s*$/.test(l)&&!/\\\s*$/.test(e))return{text:"",selection:[1,f.column,1,f.column]};b=b.getMode().getNextLineIndent(a,l+"\\",b.getTabString(),
g,!1);a=d-e.length+1;m=/\\\s*$/.test(e)?"":"\\";return 0<=a?{text:Array(a+1).join(" ")+m+"\n"+b,selection:!1}:{text:m+"\n"+b,selection:!1}}}})};h.inherits(a,g);k.CStyleBehaviour=a;k.setFillinDoWhile=function(a){l=a};k.getFillinDoWhile=function(){return l}});define("mode/cpp_code_model",["require","exports","module"],function(a,k,h){a("ace/lib/oop");var g=a("ace/range").Range,n=a("mode/token_utils").TokenUtils;a("ace/token_iterator");var l=a("mode/token_cursor").CppTokenCursor,f=a("mode/cpp_scope_tree").CppScopeNode,b=a("mode/cpp_scope_tree").CppScopeManager,d=a("mode/r_code_model").getVerticallyAlignFunctionArgs,e=a("mode/utils");a=function(a,d,e,l,m){this.$session=a;this.$doc=a.getDocument();this.$tokenizer=d;this.$tokens=Array(this.$doc.getLength());
this.$statePattern=e;this.$codeBeginPattern=l;this.$codeEndPattern=m;this.$tokenUtils=new n(this.$doc,this.$tokenizer,this.$tokens,this.$statePattern,this.$codeBeginPattern);this.$scopes=new b(f);var c=!0,g=function(a,d){c?c=!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=e.contains;this.getTokenCursor=function(){return new l(this.$tokens,0,0,this)};
this.$tokenizeUpToRow=function(a){this.$tokenUtils.$tokenizeUpToRow(a)};var b=function(d,e){for(;;){var c=d.currentValue(),b=e.$doc.getLine(d.$row);if(a(["{","}",";"],c))break;if(":"===c&&(c=d.peekBwd().currentValue(),a(["public","private","protected"],c)))break;if(/^\s*#/.test(b))break;if(!d.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,d){var c=p(a),e=d;"undefined"===typeof e&&
(e=80);c.length>e&&(c=c.substring(0,e)+"...");return c};this.$complements={"<":">",">":"<","{":"}","}":"{","[":"]","]":"[","(":")",")":"(","'":"'",'"':'"'};this.alignContinuationSlashes=function(a,d){"undefined"===typeof d&&(d={start:0,end:a.getLength()});var c=a.$lines;if(!(c instanceof Array))return!1;for(var e=d.start;e<d.end;e++)if(k.test(c[e])){var b=e;for(e+=1;k.test(c[e])&&e<=d.end;)e++;for(var m=e,f=c.slice(b,m).map(function(a){return a.lastIndexOf("\\")}),l=Math.max.apply(null,f),g=0;g<m-
b;g++){var p={row:b+g,column:f[g]},q=Array(l-f[g]+1).join(" ");a.insert(p,q)}}return!0};this.allIndicesOf=function(a,d){for(var e=[],c=0;c<a.length;c++)a[c]==d&&e.push(c);return e};this.getRowForMatchingEOLArrows=function(a,d,e){a=0;for(var c,b=1;100>b;b++){c=this.getLineSansComments(d,e-b);if(/;\s*$/.test(c))break;if(/<\s*$/.test(c)&&!/<<\s*$/.test(c)){if(0===a)return e-b;a--}else/^\s*>/.test(c)&&!/^\s*>>/.test(c)&&a++}return-1};var n=/^\s*#\s*define/,k=/\\\s*$/,w=/^\s*[+\-/&^%$!<>.?|=~]|^\s*\*[^/]|^\s*\/[^\*]/,
h=/[+\-*&^%$!<>.?|=~]\s*$|\*[^/]\s*$|\/[^\*]\s*$/,D=function(a){return w.test(a)||h.test(a)};this.inMacro=function(a,d){var c=a[d];return 0>d?!1:k.test(c)?n.test(c)?!0:this.inMacro(a,d-1):!1};this.$buildScopeTreeUpToRow=function(a){a=Math.min(a+30,this.$doc.getLength()-1);this.$tokenUtils.$tokenizeUpToRow(a);var d=this.getTokenCursor();if(d.seekToNearestToken(this.$scopes.parsePos,a)){do{this.$scopes.parsePos=d.currentPosition();this.$scopes.parsePos.column+=d.currentValue().length;var c=d.currentToken().type;
if(/\bsectionhead\b/.test(c)){if(c=/^\/\/'?[-=#\s]*(.*?)\s*[-=#]+\s*$/.exec(d.currentValue()))c=""+c[1],0==c.length&&(c="(Untitled)"),50<c.length&&(c=c.substring(0,50)+"..."),this.$scopes.onSectionStart(c,d.currentPosition())}else if(/\bcodebegin\b/.test(c)){c=d.currentPosition();var e={row:c.row+1,column:0};this.$scopes.getTopLevelScopeCount();this.$scopes.onChunkStart("(R Code Chunk)","(R Code Chunk)",c,e)}else if(/\bcodeend\b/.test(c)){for(c=d.currentPosition();this.$scopes.onScopeEnd(c););c.column+=
d.currentValue().length;this.$scopes.onChunkEnd(c)}else if("{"===d.currentValue())if(c=d.cloneCursor(),e=c.currentPosition(),c.isFirstSignificantTokenOnLine()&&(e.column=0),"namespace"===c.peekBwd(2).currentValue())c.moveToPreviousToken(),e=c.currentValue(),this.$scopes.onNamespaceScopeStart("namespace "+e,c.currentPosition(),d.currentPosition(),e);else if("namespace"===c.peekBwd().currentValue())this.$scopes.onNamespaceScopeStart("anonymous namespace",e,d.currentPosition(),"<anonymous>");else if("class"===
c.peekBwd(2).currentValue()||"struct"===c.peekBwd(2).currentValue()||c.bwdOverClassInheritance()){c.moveToPreviousToken();var f=c.cloneCursor();b(f,this);f=f.peekFwd().currentPosition();e=this.$session.getTextRange(new g(f.row,f.column,e.row,e.column));e=p(e);this.$scopes.onClassScopeStart(e,c.currentPosition(),d.currentPosition(),e)}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,e.row,e.column-1)),c=p("lambda "+c),this.$scopes.onLambdaScopeStart(c,e,d.currentPosition());else{if(c.moveToPreviousToken()){var l="";e=c.currentValue();f="";var q=this.$scopes.getActiveScopes(c.currentPosition());null!=q&&(q=q[q.length-1],q.isClass()&&q.label==="class "+e?"~"===c.peekBwd().currentValue()&&(e="~"+
e):(l=c.cloneCursor(),b(l,this),l.moveToNextToken(),l=l.currentPosition(),q=c.currentPosition(),l=this.$session.getTextRange(new g(l.row,l.column,q.row,q.column))));var r=c.peekFwd();q=r.currentPosition();r.fwdToMatchingToken()&&("const"===r.peekFwd().currentValue()&&r.moveToNextToken(),"noexcept"===r.peekFwd().currentValue()&&r.moveToNextToken(),"noexcept"===r.currentValue()&&"("===r.peekFwd().currentValue()&&(r.moveToNextToken(),r.fwdToMatchingToken()),(r=r.peekFwd().currentPosition())&&(f=this.$session.getTextRange(new g(q.row,
q.column,r.row,r.column))));l=0<l.length?m(e.trim()+f.trim()+": "+l.trim()):m(e.trim()+f.trim());this.$scopes.onFunctionScopeStart(l,c.currentPosition(),d.currentPosition(),e.trim(),f.split(","))}}else this.$scopes.onScopeStart(e);else this.$scopes.onScopeStart(e);else"}"===d.currentValue()&&(c=d.currentPosition(),d.isLastSignificantTokenOnLine()?c.column=this.$doc.getLine(c.row).length+1:c.column++,this.$scopes.onScopeEnd(c))}while(d.moveToNextToken(a))}};this.getCurrentScope=function(a,c){c||(c=
function(a){return!0});if(!a)return"";this.$buildScopeTreeUpToRow(a.row);var d=this.$scopes.getActiveScopes(a);if(d)for(var e=d.length-1;0<=e;e--)if(c(d[e]))return d[e];return null};this.getScopeTree=function(){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.getScopeList()};this.getRowForOpenBraceIndent=function(c,d,e){if(1>=c.getDocument().$lines.length)return-1;if(this.$tokenUtils.$tokenizeUpToRow(d))try{for(var b=Array(this.$tokens.length),m=0;m<this.$tokens.length;m++)if(null!=
this.$tokens[m]&&0<this.$tokens[m].length){var l=this.$tokens[m];"\\"===l[l.length-1].value&&(b[m]=this.$tokens[m].splice(l.length-1,1)[0])}var g=this.getTokenCursor();if(e){var p=c.getSelection().getCursor();if(!g.moveToPosition(p))return 0}else for(g.$row=d,m=g.$tokens[d].length-1,m=g.$tokens[d].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 q=g.currentValue();if(a(f,q)||0===g.$row&&0===g.$offset)return g.$row;if(!g.moveToPreviousToken())return-1}if(":"===g.currentValue()){var r=g.peekBwd().currentValue();if(a(["public","private","protected"],r))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<b.length;m++)"undefined"!==typeof b[m]&&this.$tokens[m].push(b[m])}return-1};this.getLineSansComments=function(a,c,d){if(0>c)return"";a=a.getLine(c);var e=/(?!\\)"/g,b=a,m;for(c=[];m=e.exec(b);)c.push(m.index);if(0<c.length&&0===c.length%2)for(e=0;e<c.length/2;e+=2)b=c[e+1],a=a.substring(0,
c[e]+1)+a.substring(b,a.length);c=a.indexOf("//");-1!=c&&(a=a.substring(0,c));k.test(a)&&(a=a.substring(0,a.lastIndexOf("\\")));d&&(a=a.replace(/\bconst\b/,"").replace(/\bnoexcept\b/,""));return a};this.findStartOfCommentBlock=function(a,c,d){for(var e=0,b=/^\s*\/+\*/;0<=c&&e<d;){if(b.test(a[c]))return c;--c;++e}return-1};this.getNextLineIndent=function(c,b,m,f,g){var l=d(),u=this.$session,p=u.getTabSize(),q=u.getDocument();"number"!==typeof f&&(f=u.getSelection().getCursor().row-1);if(-1===f)return b=
q.getLine(0),0<b.length?this.$getIndent(b):"";if(0===b.length||/^\s*#/.test(b))return this.getNextLineIndent(e.getPrimaryState(u,f-1),q.getLine(f-1),m,f-1,g);var r=this.$getIndent(b),v=this.$getUnindent(b,p),w=q.$lines;if(e.endsWith(c,"comment")||e.endsWith(c,"doc-start")){h&&h.row==f&&(b=b.substring(0,h.column));if(/^\s*$/.test(b))return this.$getIndent(w[f]);h=this.findStartOfCommentBlock(w,f,200);if(null!==h)return this.$getIndent(w[h])+" "}if(e.endsWith(c,"start")){if(n.test(b))return/\\\s*$/.test(b)?
r+m:r;if(/^\s*#\s*\S/.test(b))return r;if(this.inMacro(w,f-1)&&!k.test(b))return v;b=this.getLineSansComments(q,f);var h=u.getSelection().getCursor();h&&h.row==f&&!g&&(b=b.substring(0,h.column));c=this.getLineSansComments(q,f-1);if("string"!==typeof b)return"";if(0===b.length||/^\s*$/.test(b))return this.$getIndent(w[f]);if(/\*\/\s*$/.test(b)&&(v=this.findStartOfCommentBlock(w,f,200),0<=v))return this.$getIndent(w[v]);if(/^\s*<</.test(b)){for(b=f-1;/^\s*<</.test(w[b]);)b--;return this.$getIndent(w[b])}if(/^\s*\./.test(b)){for(b=
f-1;/^\s*\./.test(w[b]);)b--;return this.$getIndent(w[b])}if(/\bnamespace\b.*\{\s*$/.test(b)||/\bswitch\b.*\{\s*$/.test(b))return r;if(b.match(/\(\s*$/))return-1!==b.indexOf("=")||/^\s*(return\s+)?[a-zA-Z0-9_.->:]+\(\s*$/.test(b)?r+m:r+m+m;if(/^\s*(class|struct)\s*[\w]+\s*$/.test(b)||/^\s*(class|struct).*\{\s*$/.test(b)||/^\s*(class|struct)\s+.+:\s*$/.test(b))return r+m;if((v=b.match(/(^\s*(?:class|struct)\s+.*\w[^:]):[^:]\s*.+/))&&!/,\s*/.test(b)||(v=b.match(/^(\s*(class|struct).*:\s*).*,\s*$/))||
(v=b.match(/^(\s*:\s*)(\w+).*,\s*$/))||(v=b.match(/^(\s*)[:,]\s*[\w\s]*$/)))return l?Array(v[1].length+1).join(" "):r+m;if(/<\s*$/.test(b))return r+m;if(/^\s*".*"\s*$/.test(b)||/^\s*template\s*<.*>\s*$/.test(b)&&b.split(">").length==b.split("<").length)return r;if(/([\[\{\(<]).+,\s*$/.exec(b)){var x=["(","{","[","<"];for(v=0;v<x.length;v++){var B=x[v],A=this.$complements[B];B=this.allIndicesOf(b,B);if(B.length&&(A=this.allIndicesOf(b,A),A=B.length-A.length-1,!(0>A)))return w=B[A],l?(b=b.substr(w+
1).match(/([^\s])/),Array(w+b.index+2).join(" ")):r+m}}for(v=f-1;0<=v&&/^\s*$|^\s*#/.test(c);)c=this.getLineSansComments(q,v),v--;if(/^\s*__attribute__\(\(.*\)\)\s*$/.test(b)||/^\s*[\w\s]+\s*$/.test(b)&&!/(class|struct|for|while|do|if|else|try)/.test(b)||D(b)&&D(c))return this.$getIndent(b);if(this.$tokenUtils.$tokenizeUpToRow(f+2)){x=Array(this.$tokens.length);try{for(v=0;v<this.$tokens.length;v++)if(null!=this.$tokens[v]&&0<this.$tokens[v].length){var y=this.$tokens[v];"\\"===y[y.length-1].value&&
(x[v]=this.$tokens[v].splice(y.length-1,1)[0])}var t=this.getTokenCursor();g?(t.$row=f,t.$offset=this.$tokens[f].length-1):t.moveToPosition(h);for(;0>t.$offset&&0<t.$row;)t.$row--,t.$offset=t.$tokens[t.$row].length-1;for(;0<t.$row&&/^\s*#/.test(q.getLine(t.$row));)t.$row--,t.$offset=t.$tokens[t.$row].length-1;g="";var F=t.cloneCursor(),I=F.currentValue(),T=F.currentType();if("keyword"===T||a(["{",")",">",":"],I))g=m;for(;";"===t.currentValue()&&t.moveToPreviousToken(););var O=t.cloneCursor();if(l&&
t.isLastSignificantTokenOnLine()&&("keyword.operator"===t.currentType()||"punctuation.operator"===t.currentType())){var U=t.cloneCursor();U.$offset=0;if("keyword"===U.currentType()){var P=b.split("(").length-b.split(")").length;if(0<P){var G=b.match(/.*?\(\s*(\S)/);if(G)return Array(G[0].length).join(" ")}}}if(","===t.currentValue()){if(l){var E=t.peekBwd();if("]"===E.currentValue()&&E.bwdToMatchingToken())return Array(E.currentPosition().column+1).join(" ");P=b.split("(").length-b.split(")").length;
if(0<P&&(G=b.match(/.*?\(\s*(\S)/)))return Array(G[0].length).join(" ")}if(/[,(]\s*$/.test(b)&&/[,(]\s*$/.test(c))return this.$getIndent(b);var z=t.cloneCursor();return z.findOpeningBracket("{",!1)&&z.bwdOverClassySpecifiers()&&"enum"===z.currentValue()?this.$getIndent(w[z.$row])+m:-1!==b.indexOf("=")?this.$getIndent(b)+m:this.$getIndent(b)}if("keyword.operator"===T&&":"!==I)return this.$getIndent(w[f])+m;for(;;){if("undefined"===typeof t.currentValue())return"undefined"!==typeof O.currentValue()?
this.$getIndent(w[O.$row])+g:g;O=t.cloneCursor();if(";"===t.currentValue()&&t.moveToNextToken()){for(f=t.$row;null!=w[f]&&/^\s*#/.test(w[f]);)++f;return this.$getIndent(w[f])+g}if(a(["for","while","do","try"],t.currentValue())&&";"!==I)return this.$getIndent(w[t.$row])+g;E=t.peekBwd();if(":"===t.currentValue()){if(a(["public","private","protected"],E.currentValue()))return this.$getIndent(w[E.$row])+m;var J=w[t.$row];if(/^\s*case/.test(J))return this.$getIndent(J)+m;if(")"===E.currentValue()&&(z=
E.cloneCursor(),z.bwdToMatchingToken())){var V=z.peekBwd(1),W=z.peekBwd(2);if(null!==V&&"identifier"===V.currentType()&&null!==W&&!/\boperator\b/.test(W.currentType()))return this.$getIndent(w[z.peekBwd().$row])+g}}if("]"===t.currentValue()&&"("===t.peekFwd().currentValue()&&(z=t.cloneCursor(),z.bwdToMatchingToken()))return this.$getIndent(w[z.$row])+g;if("("===t.currentValue()&&"for"===E.currentValue()&&";"===I)return t.peekFwd().cloneCursor(),l?Array(t.peekFwd().currentPosition().column+1).join(" "):
this.$getIndent(w[t.peekFwd().$row])+m;if(l&&"("===t.currentValue()&&!t.isLastSignificantTokenOnLine())return t.moveToNextToken(),Array(t.currentPosition().column+1+p).join(" ");if("if"===t.currentValue()||"else"===t.currentValue()||"template"===t.currentValue()&&"<"===t.peekFwd().currentValue())return this.$getIndent(w[t.$row])+g;if("{"===t.currentValue()){var X=this.getRowForOpenBraceIndent(u,t.$row);return 0<=X?(b=this.getLineSansComments(q,X),r=this.$getIndent(b),/\bnamespace\b/.test(b)?r:r+m):
this.$getIndent(w[t.$row])+m}if(0===t.$row&&0===t.$offset)return this.$getIndent(w[0])+g;if(">"===t.currentValue()&&(z=t.cloneCursor(),z.bwdToMatchingArrow()&&"template"===z.peekBwd().currentValue()))return">"===I&&(g=""),this.$getIndent(w[z.$row])+g;t.bwdToMatchingToken();if(!t.moveToPreviousToken())break;for(;0<t.$row&&/^\s*#/.test(w[t.$row]);)t.$row--,t.$offset=this.$tokens[t.$row].length-1}}finally{for(v=0;v<x.length;v++)"undefined"!==typeof x[v]&&this.$tokens[v].push(x[v])}}}return r};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,c,b){c=Array(c+1).join(" ");c=a.replace("\t",c);return c>=b?a:a+Array(b-c+1).join(" ")};this.$getUnindent=function(a,c){var b=this.$getIndent(a);if(null===b||0===
b.length)return"";var d=b.indexOf("\t");if(-1!=d)return b.substring(0,d)+b.substring(d+1,b.length);for(var e=d=0;e<c&&e<b.length;e++)" "===b[e]&&d++;return b.substring(d,b.length)}}).call(a.prototype);k.CppCodeModel=a});define("mode/cpp_scope_tree",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("mode/r_scope_tree");a=g.ScopeManager;var n=g.ScopeNode,l=function(a,b,d,e,c,g){this.label=a;this.start=b;this.preamble=d||b;this.end=null;this.scopeType=e;this.scopeCategory=c;this.attributes=g||{};this.parentScope=null;this.$children=[]};h.mixin(l.prototype,n.prototype);l.CATEGORY_CLASS=1;l.CATEGORY_NAMESPACE=2;l.CATEGORY_FUNCTION=3;l.CATEGORY_LAMBDA=4;l.CATEGORY_ANON=5;(function(){this.isClass=
function(){return this.scopeType==n.TYPE_BRACE&&this.scopeCategory==l.CATEGORY_CLASS};this.isNamespace=function(){return this.scopeType==n.TYPE_BRACE&&this.scopeCategory==l.CATEGORY_NAMESPACE};this.isFunction=function(){return this.scopeType==n.TYPE_BRACE&&this.scopeCategory==l.CATEGORY_FUNCTION};this.isLambda=function(){return this.scopeType==n.TYPE_BRACE&&this.scopeCategory==l.CATEGORY_LAMBDA}}).call(l.prototype);g=function(a){this.$ScopeNodeFactory=a;this.parsePos={row:0,column:0};this.$root=new a("(Top Level)",
this.parsePos,null,n.TYPE_ROOT)};h.mixin(g.prototype,a.prototype);(function(){this.onClassScopeStart=function(a,b,d,e){a=new this.$ScopeNodeFactory(a,d,b,n.TYPE_BRACE,l.CATEGORY_CLASS,{name:e});this.$root.addNode(a);this.printScopeTree()};this.onNamespaceScopeStart=function(a,b,d,e){a=new this.$ScopeNodeFactory(a,d,b,n.TYPE_BRACE,l.CATEGORY_NAMESPACE,{name:e});this.$root.addNode(a);this.printScopeTree()};this.onFunctionScopeStart=function(a,b,d,e,c){a=new this.$ScopeNodeFactory(a,d,b,n.TYPE_BRACE,
l.CATEGORY_FUNCTION,{name:e,args:c});this.$root.addNode(a);this.printScopeTree()};this.onLambdaScopeStart=function(a,b,d,e){a=new this.$ScopeNodeFactory(a,d,b,n.TYPE_BRACE,l.CATEGORY_LAMBDA,{args:e});this.$root.addNode(a);this.printScopeTree()};this.onScopeStart=function(a){this.$root.addNode(new this.$ScopeNodeFactory(null,a,null,n.TYPE_BRACE));this.printScopeTree()};this.onScopeEnd=function(a){a=this.$root.closeScope(a,n.TYPE_BRACE);this.printScopeTree();return a}}).call(g.prototype);k.CppScopeManager=
g;k.CppScopeNode=l});define("mode/dcf",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("ace/tokenizer").Tokenizer,l=a("mode/dcf_highlight_rules").DcfHighlightRules;a=function(){this.$tokenizer=new n((new l).getRules())};h.inherits(a,g);(function(){this.getNextLineIndent=function(a,b,d){return this.$getIndent(b)}}).call(a.prototype);k.Mode=a});define("mode/dcf_highlight_rules",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(){this.$rules={start:[{token:["keyword","text"],regex:"^([^:]+)(:)"},{token:"text",regex:".+"}]}};h.inherits(g,a);k.DcfHighlightRules=g});define("mode/doc_comment_highlight_rules",["require","exports","module"],function(a,k,h){h=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:"."}]}};h.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,h){k=a("ace/editor").Editor;var g=a("ace/range").Range;a("ace/keyboard/vim");var n=a("ace/token_iterator").TokenIterator,l=a("mode/utils");(function(){function a(a,c){for(var b=a.session.getTokens(c),d=0;d<b.length;d++){var e=b[d];if(!/^\s*$/.test(e.value))return/\bcomment\b/.test(e.type)}return!1}function b(a,c){var b=a.start.row<c.start.row||a.start.row===c.start.row&&a.start.column<c.start.column,d=a.start.row===c.start.row&&
a.start.column===c.start.column,e=a.end.row>c.end.row||a.end.row===c.end.row&&a.end.column>c.end.column,m=a.end.row===c.end.row&&a.end.column===c.end.column;return b?e||m:e?b||d:!1}function d(a,c){for(var b=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(b.value)&&(r.test(e.value)||l.isOpeningBracket(e.value)||
l.contains(c,e.value))){if(!a.moveToNextSignificantToken())return!1;break}a.bwdToMatchingToken();b=a.getCurrentToken();d=a.getCurrentTokenRow()}return!0}function e(a,c,b){p.push({name:a,immediate:c,execute:b})}var c=this,r=/['"\w.]/,q=!1;this.$onClearSelectionHistory=function(){return c.$clearSelectionHistory()};this.$clearSelectionHistory=function(){this.$selectionRangeHistory=null;this.off("change",this.$clearSelectionHistory)};this.$acceptSelection=function(a,c,b){null==this.$selectionRangeHistory&&
(this.$selectionRangeHistory=[]);a.setSelectionRange(c);a.getRange().isEqual(b)||this.$selectionRangeHistory.push(b);this.isRowFullyVisible(c.start.row)&&this.isRowFullyVisible(c.end.row)||this.centerSelection(a);return c};var p=[];e("string",!0,function(a,c,b,d){return(a=c.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});e("token",!0,function(a,c,b,d){return(a=c.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});e("comment",!0,function(c,b,d,e){b=e.start.row;e=e.end.row;for(d=b;d<=e;d++)if(!a(c,d))return null;for(;a(c,b);)b--;for(;a(c,e);)e++;c=c.getSession().getLine(e-1).length;return new g(b+1,0,e-1,c)});e("includeBoundaries",!0,function(a,c,b,d){a=new n(c);b=a.moveToPosition(d.start);0===d.start.column&&(b=a.moveToPreviousToken());c=new n(c);d=c.moveToPosition(d.end,!0);if(b&&d){var e="support.function.codebegin"===
b.type&&"support.function.codeend"===d.type;e||(e=l.isOpeningBracket(b.value)&&l.getComplement(b.value)===d.value);if(e)return a=a.getCurrentTokenPosition(),b=c.getCurrentTokenPosition(),b.column+=d.value.length,g.fromPoints(a,b)}return null});e("matching",!1,function(a,c,b,d){a=new n(c);d=a.moveToPosition(d.start);if(null==d)return null;do{if(null==d)break;if(!a.bwdToMatchingToken()&&(l.isOpeningBracket(d.value)||"support.function.codebegin"===d.type)){b=a.getCurrentTokenPosition();"support.function.codebegin"===
d.type?(b.row++,b.column=0):b.column+=d.value.length;var e=a.clone();if(e.fwdToMatchingToken())return a=e.getCurrentTokenPosition(),"support.function.codebegin"===d.type&&(a.row--,a.column=c.getLine(a.row).length),g.fromPoints(b,a)}}while(d=a.stepBackward());return null});e("statement",!1,function(a,c,b,e){a=new n(c);if(!a.moveToPosition(e.start,!0))return null;c=new n(c);if(!(b=!c.moveToPosition(e.end)||!d(a,[";",",","=","<-","<<-"]))){a:{b=[";",","];for(var f=c.getCurrentToken(),m=c.getCurrentTokenRow();c.moveToNextSignificantToken();){var q=
c.getCurrentToken();if(m!==c.getCurrentTokenRow()&&0!==f.type.indexOf("keyword.operator")){if(!c.moveToPreviousSignificantToken()){b=!1;break a}break}if(r.test(f.value)||l.isClosingBracket(f.value))if(r.test(q.value)||l.isClosingBracket(q.value)||l.contains(b,q.value)){if(!c.moveToPreviousSignificantToken()){b=!1;break a}break}c.fwdToMatchingToken();f=c.getCurrentToken();m=c.getCurrentTokenRow()}b=!0}b=!b}if(b)return null;b=a.getCurrentTokenPosition();f=c.getCurrentTokenPosition();if(b.row===e.start.row&&
b.column===e.start.column&&f.row===e.end.row&&f.column<=e.end.column&&!d(a,[";",","]))return null;e=a.getCurrentTokenPosition();a=c.getCurrentTokenPosition();a.column+=c.getCurrentTokenValue().length;return g.fromPoints(e,a)});e("scope",!1,function(a,c,b,d){b=c.getMode();if(null==b.codeModel||null==b.codeModel.getCurrentScope)return null;a=[];for(d=b.codeModel.getCurrentScope(d.start);null!=d;){b=d.preamble;var e=d.end;if(null==e&&d.parentScope)for(var f=d.parentScope.$children,m=f.length-2;0<=m;m--)if(f[m].equals(d)){e=
f[m+1].preamble;break}null==e&&(e={row:c.getLength(),column:0});a.push(g.fromPoints(b,e));d=d.parentScope}return 0===a.length?null:a});e("everything",!1,function(a,c,b,d){a=c.getLength();if(0===a)return new g(0,0,0,0);c=c.getLine(a-1);return new g(0,0,a-1,c.length)});this.$expandSelection=function(){q||(c.on("change",c.$onClearSelectionHistory),q=!0);for(var a=this.getSession(),d=this.getSelection(),e=d.getRange(),f=[],g=0;g<p.length;g++){var r=p[g],n=r.execute(this,a,d,e);l.isArray(n)||(n=[n]);for(var k=
0;k<n.length;k++){var h=n[k];if(h&&r.immediate&&b(h,e))return this.$acceptSelection(d,h,e);h&&b(h,e)&&f.push({name:r.name,range:h})}}f.sort(function(a,c){a=a.range;c=c.range;var b=a.end.row-a.start.row,d=c.end.row-c.start.row;return b!==d?b>d:a.end.column-a.start.column>c.end.column-c.start.column});return this.$acceptSelection(d,f[0].range,e)};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&&(c.off("change",c.$onClearSelectionHistory),q=!1);return this.getSelectionRange()}}).call(k.prototype)});define("mode/markdown",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("ace/mode/javascript").Mode,l=a("ace/mode/xml").Mode,f=a("ace/mode/html").Mode,b=a("mode/markdown_highlight_rules").MarkdownHighlightRules,d=a("mode/markdown_folding").FoldMode;a=function(){this.HighlightRules=b;this.createModeDelegates({"js-":n,"xml-":l,"html-":f});this.foldingRules=new d};h.inherits(a,g);(function(){this.type="text";this.blockComment={start:"\x3c!--",end:"--\x3e"};
this.getNextLineIndent=function(a,c,b){return this.$getIndent(c)};this.$id="mode/markdown"}).call(a.prototype);k.Mode=a});define("mode/markdown_folding",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/folding/fold_mode").FoldMode,n=a("ace/range").Range;k=k.FoldMode=function(){};var l=a("mode/utils");h.inherits(k,g);(function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/;this.getFoldWidget=function(a,b,d){b="markbeginend"===b?"end":"";var e=a.getLine(d);return this.foldingStartMarker.test(e)?"`"==e[0]?"start"===l.getPrimaryState(a,d)?b:"start":"":""};this.getFoldWidgetRange=
function(a,b,d){function e(c){return(k=a.getTokens(c)[0])&&0===k.type.lastIndexOf(h,0)}function c(){var a=k.value[0];return"="==a?6:"-"==a?5:7-k.value.search(/[^#]/)}var f=a.getLine(d);b=f.length;var g=a.getLength(),p=d,m=d;if(f.match(this.foldingStartMarker)){if("`"==f[0]){if("start"!==l.getPrimaryState(a,d)){for(;++d<g&&!(f=a.getLine(d),"`"==f[0]&"```"==f.substring(0,3)););return new n(p,b,d,0)}for(;0<d--&&!(f=a.getLine(d),"`"==f[0]&"```"==f.substring(0,3)););return new n(d,f.length,p,0)}var k,
h="markup.heading";if(e(d)){for(m=c();++d<g&&!(e(d)&&c()>=m););m=d-(k&&-1!=["=","-"].indexOf(k.value[0])?2:1);if(m>p)for(;m>p&&/^\s*$/.test(a.getLine(m));)m--;if(m>p)return d=a.getLine(m).length,new n(p,b,m,d)}}}}).call(k.prototype)});define("mode/markdown_highlight_rules",["require","exports","module"],function(a,k,h){function g(a,c){return{token:"support.function",regex:"^\\s*```(?:\\{"+a+"[^\\}]*\\}|"+a+")\\s*$",push:c+"start"}}h=a("ace/lib/oop");var n=a("ace/lib/lang"),l=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,b=a("ace/mode/xml_highlight_rules").XmlHighlightRules,d=a("ace/mode/html_highlight_rules").HtmlHighlightRules,e=a("ace/mode/css_highlight_rules").CssHighlightRules,
c=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,v=a("ace/mode/ruby_highlight_rules").RubyHighlightRules,B=a("ace/mode/scala_highlight_rules").ScalaHighlightRules,w=a("mode/sh_highlight_rules").ShHighlightRules;a("mode/stan_highlight_rules");var A=a("mode/sql_highlight_rules").SqlHighlightRules,
D=a("mode/mermaid_highlight_rules").MermaidHighlightRules,x=a("ace/mode/dot_highlight_rules").DotHighlightRules,t=function(a){return"(?:[^"+n.escapeRegExp(a)+"\\\\]|\\\\.)*"},y=!0,F=7;k.setRainbowFencedDivs=function(a){y=a};k.getRainbowFencedDivs=function(){return y};k.setNumFencedDivsColors=function(a){F=a};a=function(){var a=n.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(" ")),
l={token:["text","constant.numeric.text","constant.numeric.text","constant.numeric.text"],regex:"(^|\\s+)(_{2,3})(?![\\s_])(.*?)(?=_)(\\2)\\b"},k={token:["text","constant.language.boolean.text"],regex:"(^|\\s+)(_(?=[^\\s_]).*?_)\\b"},h={token:["constant.numeric.text","constant.numeric.text","constant.numeric.text"],regex:"([*]{2,3})(?![\\s*])(.*?)(?=[*])(\\1)"},K={token:["constant.language.boolean.text"],regex:"([*](?=[^\\s*]).*?[*])"},M={token:"text",regex:"\\^\\["+t("]")+"\\]"},N={token:"text constant text url string text".split(" "),
regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},L={token:["text","keyword","text","constant","text"],regex:"(\\s*\\[)("+t("]")+")(\\]\\[)("+t("]")+")(\\])"},R={token:"text keyword text markup.href string text paren.keyword.operator nospell paren.keyword.operator".split(" "),regex:"(\\s*\\[)("+t("]")+')(\\]\\()((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)(\\s*"'+t('"')+'"\\s*)?(\\))(?:(\\s*{)((?:[^\\}]+))(\\s*}))?'},S={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)"},M,N,L,R,S,h,l,K,k],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:"fenced_open",regex:"^[:]{3,}\\s*.*$",onMatch:function(a,c,b,d,e){if(!y)return"keyword.operator";c=(e.fences||0)%F;if(/^[:]{3,}\s*$/.test(a))return e.fences=c+1,"fenced_div_"+c;e=/^([:]{3,})(.*)$/;return[{type:"fenced_div_"+c,value:a.replace(e,"$1")},{type:"fenced_div_text_"+c,value:a.replace(e,
"$2")}]},next:"start"},{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"},M,N,L,{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:"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"},h,l,K,k,{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)"},M,N,L,R,S,h,l,K,k,{defaultToken:"string.blockquote"}],githubblock:[{token:"support.function",regex:"^\\s*```",next:"start"},{token:"support.function",regex:".+"}],fieldblock:[{token:function(c){c=c.slice(0,-1);return a[c]?"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(d,"htmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(e,"csscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(c,"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(b,"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(v,"rubycode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(D,"mermaidcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(x,"dotcode-",
[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(B,"scalacode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(w,"shcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(w,"bashcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(A,"sqlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(f,"jscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.normalizeRules()};
h.inherits(a,l);k.MarkdownHighlightRules=a});define("mode/mermaid",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("ace/tokenizer").Tokenizer,l=a("mode/mermaid_highlight_rules").MermaidHighlightRules;a=function(){this.$highlightRules=new l;this.$tokenizer=new n(this.$highlightRules.getRules())};h.inherits(a,g);(function(){this.getNextLineIndent=function(a,b,d){return this.$getIndent(b)}}).call(a.prototype);k.Mode=a});define("mode/mermaid_highlight_rules",["require","exports","module"],function(a,k,h){h=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}]}};h.inherits(g,a);k.MermaidHighlightRules=g});define("mode/python",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("mode/python_highlight_rules").PythonHighlightRules,l=a("ace/mode/folding/pythonic").FoldMode,f=a("ace/range").Range;a=function(){this.HighlightRules=n;this.foldingRules=new l("\\:")};h.inherits(a,g);(function(){this.lineCommentStart="#";this.getLanguageMode=function(a){return"Python"};this.getNextLineIndent=function(a,d,e,c){a=this.$getIndent(d);if(/^\s*[#]/.test(d))return a;/[{([:]\s*(?:$|[#])/.test(d)&&
(a+=e);/^\s*(?:break|continue|pass|raise|return)\b/.test(d)&&(a=a.substring(0,a.length-e.length));return a};this.$performOutdent=function(a,d,e){var c=a.doc.$lines[e];e=this.$getIndent(a.doc.$lines[d]);c=this.$getIndent(c);c.length<e.length&&(d=new f(d,0,d,e.length),a.replace(d,c));return!0};this.$autoOutdentElse=function(a,d,e){a=d.doc.$lines[e].substring(0,d.selection.cursor.column);if(!/^\s*(?:else|elif)(?:\s|[:])/.test(a))return!1;for(a=e-1;0<=a;a--)if(/^\s*(?:if|elif|for|try)(?:\s|[:])/.test(d.doc.$lines[a]))return this.$performOutdent(d,
e,a)};this.$autoOutdentExceptFinally=function(a,d,e){a=d.doc.$lines[e].substring(0,d.selection.cursor.column);if(!/^\s*(?:except|finally)(?:\s|[:])/.test(a))return!1;for(a=e-1;0<=a;a--)if(/^\s*(?:try)(?:\s|[:])/.test(d.doc.$lines[a]))return this.$performOutdent(d,e,a)};this.checkOutdent=function(a,d,e){this.$lastInput=e;return":"===e||" "===e};this.$canAutoOutdent=function(a,d,e){a=d.selection.cursor;return 0===a.column?!1:":"===this.$lastInput?!0:" "===this.$lastInput?(d=d.getTokenAt(a.row,a.column-
1)||{},/\bkeyword\b/.test(d.type)):!1};this.autoOutdent=function(a,d,e){this.$canAutoOutdent(a,d,e)&&(this.$autoOutdentElse(a,d,e)||this.$autoOutdentExceptFinally(a,d,e))};this.transformAction=function(a,d,e,c,f){return!1};this.$id="mode/python"}).call(a.prototype);k.Mode=a});define("mode/python_highlight_rules",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text_highlight_rules").TextHighlightRules,n=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules,l=a("mode/utils");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},n.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"}]};l.embedQuartoHighlightRules(this);this.normalizeRules()};h.inherits(a,g);k.PythonHighlightRules=a});define("mode/r",["require","exports","module"],function(a,k,h){a("ace/editor");a("ace/edit_session");a("ace/range");h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("ace/tokenizer").Tokenizer,l=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/r_highlight_rules").RHighlightRules,b=a("mode/r_code_model").RCodeModel,d=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent;a("mode/auto_brace_insert");var e=a("ace/unicode");a=function(a,e){this.$tokenizer=a?new n((new l).getRules()):
new n((new f).getRules());this.foldingRules=this.codeModel=new b(e,this.$tokenizer);this.$outdent=new d(this.codeModel)};h.inherits(a,g);(function(){this.getLanguageMode=function(a){return"R"};this.checkOutdent=function(a,d,b){return this.$outdent.checkOutdent(a,d,b)};this.autoOutdent=function(a,d,b){return this.$outdent.autoOutdent(a,d,b)};this.tokenRe=new RegExp("^["+e.wordChars+"._]+","g");this.nonTokenRe=new RegExp("^(?:[^"+e.wordChars+"._]|\\s)+","g");this.$complements={"(":")","[":"]",'"':'"',
"'":"'","{":"}","`":"`"};this.$reOpen=/^[{(\["'`]$/;this.$reClose=/^[})\]"'`]$/;this.getNextLineIndent=function(a,d,b,e){return this.codeModel.getNextLineIndent(a,d,b,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,h){function g(a,c){for(var d=0;d<c.length;d++)if(a===c[d])return!0;return!1}function n(a){return"if"===a||"for"===a||"while"===a||"repeat"===a||"function"===a}var l=a("ace/range").Range,f=a("ace/token_iterator").TokenIterator,b=a("mode/token_cursor").RTokenCursor,d=a("mode/utils"),e=!1,c=a("mode/r_scope_tree").ScopeManager,r=a("mode/r_scope_tree").ScopeNode;a=function(a,d,b,e,f){this.$session=a;this.$doc=a.getDocument();this.$tokenizer=
d;this.$tokens=Array(this.$doc.getLength());this.$endStates=Array(this.$doc.getLength());this.$contexts=Array(this.$doc.getLength());this.$statePattern=b;this.$codeBeginPattern=e;this.$codeEndPattern=f;this.$scopes=new c(r);var g=!0,l=function(a,c){g?g=!1:(this.$doc.off("change",m),this.$session.off("changeMode",l))}.bind(this),m=function(a){this.$onDocChange(a)}.bind(this);this.$session.on("changeMode",l);this.$doc.on("change",m)};(function(){function a(a){return"keyword"==a.type&&("function"==a.value||
"\\"==a.value)}function c(a){return/\boperator\b/.test(a.type)&&/^(=|<-|<<-)$/.test(a.value)}function m(a){return/\bidentifier\b/.test(a.type)}function r(a){for(;a.findOpeningBracket("(")&&a.moveToPreviousToken();)if(g(a.currentValue(),["if","for","while"]))return!0;return!1}function k(d){var b=d.cloneCursor();if(!(a(b.currentToken())&&b.moveToPreviousToken()&&c(b.currentToken())&&b.moveToPreviousToken()))return!1;d.$row=b.$row;d.$offset=b.$offset;return!0}function h(a){return/\binfix\b/.test(a.type)||
"|>"===a.value}function A(a){return"keyword.operator"===a||"keyword.operator.infix"===a}var D=d.contains;this.getTokenCursor=function(){return new b(this.$tokens,0,0,this)};this.$complements={"(":")",")":"(","[":"]","]":"[","{":"}","}":"{"};var x=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.getDataFromInfixChain=function(a){var c=this.moveToDataObjectFromInfixChain(a),d=[],b=[],e="",f=!1;!1!==c&&(c.excludeArgsFromObject&&(f=c.excludeArgsFromObject),d=a.cloneCursor(),d.findStartOfEvaluationContext(),e=this.$doc.getTextRange(new l(d.currentPosition().row,d.currentPosition().column,a.currentPosition().row,a.currentPosition().column+a.currentValue().length)),d=c.additionalArgs,b=c.excludeArgs,1==c.cancel&&(f=
!0,d=[],b=[]));return{name:e,additionalArgs:d,excludeArgs:b,excludeArgsFromObject:f}};var t="mutate summarise summarize rename transmute select rename_vars inner_join left_join right_join semi_join anti_join outer_join full_join".split(" "),y=function(a,c,d,b){if(!a.moveToNextToken()||"("!==a.currentValue()||!a.moveToNextToken()||")"===a.currentValue())return!1;a.hasType("identifier")&&c.additionalArgs.push(a.currentValue());if("rename"===b){if(!a.moveToNextToken())return!1;if("="===a.currentValue()){if(!a.moveToNextToken())return!1;
c.excludeArgs.push(a.currentValue())}}"select"===b&&(c.excludeArgsFromObject=!0);do{if(")"===a.currentValue())break;if(a.$row>d.$row||a.$row===d.$row&&a.$offset>=d.$offset)break;if(!a.fwdToMatchingToken()&&","===a.currentValue()){if(!a.moveToNextToken())return!1;a.hasType("identifier")&&c.additionalArgs.push(a.currentValue());if(!a.moveToNextToken())return!1;if("="===a.currentValue()&&g(b,["rename","rename_vars"])){if(!a.moveToNextToken())return!1;a.hasType("identifier")&&c.excludeArgs.push(a.currentValue())}}}while(a.moveToNextToken());
return!0};this.moveToDataObjectFromInfixChain=function(a){var c=a.cloneCursor(),d;a:{for(d=c.cloneCursor();d.findOpeningBracket("(",!1)&&d.moveToPreviousToken()&&d.moveToPreviousToken();){if("::"===d.currentValue()||":::"===d.currentValue()){if(!d.moveToPreviousToken())break;if(!m(d.currentToken())||!d.moveToPreviousToken())break}if(h(d.currentToken())){c.$row=d.$row;c.$offset=d.$offset;d=!0;break a}}d=!1}if(!d)return!1;for(d={additionalArgs:[],excludeArgs:[],cancel:!1};;){if(0===c.$row&&0===c.$offset)return a.$row=
0,a.$offset=0,d;c.moveBackwardOverMatchingParens();if(!c.moveToPreviousToken())return!1;var b=c.currentValue();"pull"===b&&(d.cancel=!0);D(t,b)&&y(c.cloneCursor(),d,a,b);if(!c.moveToPreviousToken())return 0===c.$row&&0===c.$offset?(a.$row=0,a.$offset=0,d):!1;if("::"===c.currentValue()||":::"===c.currentValue())if(!c.moveToPreviousToken()||!c.moveToPreviousToken())return!1;if(!h(c.currentToken()))break}if(!c.moveToNextToken())return!1;a.$row=c.$row;a.$offset=c.$offset;return d};var F=function(a){var c=
a.cloneCursor();if(!c.findOpeningBracket(["(","["],!0)||!c.moveToPreviousToken())return!1;a.$row=c.$row;a.$offset=c.$offset;return!0};this.getVariablesInScope=function(d){var b=this.getTokenCursor();if(!b.moveToPosition(d))return[];for(;F(b);){if(a(b.currentToken()))d=k(b);else{d=b;var e=d.cloneCursor();m(e.currentToken())&&e.moveToPreviousToken()&&c(e.currentToken())&&e.moveToPreviousToken()?(d.$row=e.$row,d.$offset=e.$offset,d=!0):d=!1}d&&b.findStartOfEvaluationContext()}d={};do if(!b.bwdToMatchingToken()){e=
d;var f=b.cloneCursor();if("for"===f.currentValue()&&f.moveToNextToken()&&"("===f.currentValue()&&f.moveToNextToken()){var g=f.currentValue();f.moveToNextToken()&&"in"===f.currentValue()&&(e[g]="variable")}c(b.currentToken())&&(e="variable",f=b.cloneCursor(),f.moveToNextToken()&&"function"===f.currentValue()&&(e="function"),f=b.cloneCursor(),f.moveToPreviousToken()&&m(f.currentToken())&&(f=f.currentValue(),d[f]=e))}while(b.moveToPreviousToken());b=[];for(var l in d)b.push({token:l,type:d[l]});b.sort();
return b};this.$buildScopeTreeUpToRow=function(c){var b=this.$session.getMode().$id;c=Math.min(c+30,this.$doc.getLength()-1);var e=this.$scopes.parsePos.row;if(e>=c)return e;e=new f(this.$session);e.tokenizeUpToRow(c);this.$tokenizeUpToRow(c);var g=this.$scopes.parsePos.row;e.moveToPosition({row:g,column:this.$scopes.parsePos.column},!0);var p=e.getCurrentToken();if(null==p)return g;e.getCurrentTokenPosition();g=this.$scopes.getChunkCount();do{if(e.$row>c)break;var r=p.value;var q=p.type;p=e.getCurrentTokenPosition();
var n=d.getPrimaryState(this.$session,p.row);if("rdoc-start"===n)e.moveToEndOfRow();else{var h=!0;this.$codeBeginPattern&&(h=/^r-/.test(n));if(d.startsWith(q,"markup.heading")){q="";h={row:p.row,column:0};var u={row:p.row+1,column:0};n=0;if(/^\s*#+\s*$/.test(r))n=r.split("#").length-1,r=this.$session.getLine(p.row),q=r.replace(/^\s*[#]+\s*/,"");else if(/^[-=]{3,}\s*$/.test(r)&&(n="="===r[0]?1:2,q=this.$session.getLine(p.row-1).trim(),h.row--,0===q.length))continue;q=(q=q.replace(/{.*}\s*$/,""))||
"(Untitled)";this.$scopes.onMarkdownHead(q,h,u,n,!0)}else if(h&&/\bsectionhead\b/.test(q)){q="(Untitled)";if(n=/[^#=-\s]/.exec(r))q=r.substr(n.index),q=q.replace(/\s*[#=-]+\s*$/,"");r=/^\s*([#]+)\s*[^#]/.exec(r);if(null!=r)if(n=r[1].length,6<n)this.$scopes.onSectionStart(q,p);else h={row:p.row,column:0},u={row:p.row,column:Infinity},this.$scopes.onMarkdownHead(q,h,u,n,!1);else this.$scopes.onSectionStart(q,p)}else if(h||"mode/sweave"!==b||"keyword"!==q||0!==p.column||0!==r.indexOf("\\")||"\\chapter"!==
r&&"\\section"!==r&&"\\subsection"!==r&&"\\subsubsection"!==r)if(/\bcodebegin\b/.test(q)&&"---"===r){r=this.$session;q=0;n=Math.min(r.getLength(),100);for(h="Title";q++<n;){u=r.getLine(q);if(/^\s*[-]{3}\s*$/.test(u))break;u=/^\s*title:\s+(.*?)\s*$/.exec(u);if(null!==u){h=u[1];break}}r=d.stripEnclosingQuotes(h.trim());this.$scopes.onSectionStart(r,p,{isYaml:!0})}else if(/\bcodeend\b/.test(q)&&"---"===r)p.column=Infinity,this.$scopes.onSectionEnd(p);else if("mode/rmarkdown"===b&&/\bcodebegin\b/.test(q)&&
0===r.trim().indexOf("/***"))this.$scopes.onSectionStart("(R Code Chunk)",p);else if("mode/rmarkdown"===b&&/\bcodeend\b/.test(q)&&0===r.trim().indexOf("*/"))this.$scopes.onSectionEnd(p);else if(/\bcodebegin\b/.test(q)){g++;q={row:p.row+1,column:0};n=g;a:{h=this.$session;var v=this.$codeBeginPattern;u=e;if("undefined"===typeof v)h="";else{var w=v.exec(r);if(w&&(v=w[1],v=v.split(","),0<v.length)){w=v[0];if(!/=/.test(w)&&(w=w.replace(/(^\s+)|(\s+$)/g,""),w.length)){h=w;break a}for(var t=0;t<v.length;t++)if(w=
/^\s*label\s*=\s*(.*)$/.exec(v[t])){h=d.stripEnclosingQuotes(w[1].trim());break a}}u=u.clone();for(v=u.moveToNextToken();null!=v&&v.type.startsWith("comment");){v=h.getLine(u.$row);w=/^#\|\s*label\s*:\s*(.*)$/;if(w.test(v)){h=v.replace(w,"$1");break a}v=u.moveToStartOfNextRowWithTokens()}h=null}}n="Chunk "+n;h&&"YAML Header"!==r&&(n+=": "+h);this.$scopes.onChunkStart(h,n,p,q)}else if(/\bcodeend\b/.test(q))p.column+=r.length,this.$scopes.onChunkEnd(p);else if(h&&"{"===r)if(r=this.getTokenCursor(),
r.moveToPosition(p,!0),p=r.cloneCursor(),q=p,n=q.cloneCursor(),"{"===n.currentValue()&&n.moveBackwardOverMatchingParens()&&n.moveToPreviousToken()&&a(n.currentToken())?(q.$row=n.$row,q.$offset=n.$offset,q=!0):q=!1,q){h=p.cloneCursor();h.moveToNextToken();q=null;k(p)&&(n=p.cloneCursor(),u=p.cloneCursor(),u.findStartOfEvaluationContext()&&(q=u.currentPosition(),u=n.currentPosition(),q.row!==u.row?(q.row=u.row,q.column=0,p.$row=q.row,p.$offset=0):p.moveToPosition(q,!0),q=this.$doc.getTextRange(new l(q.row,
q.column,u.row,u.column+n.currentValue().length))));n=p.currentPosition();p.isFirstSignificantTokenOnLine()&&(n.column=0);p=h;if(a(p.currentToken())&&!p.moveToNextToken()||"("===p.currentValue()&&!p.moveToNextToken()||")"===p.currentValue())p=[];else{h=[];for(m(p.currentToken())&&h.push(p.currentValue());p.moveToNextToken();)if(!p.fwdToMatchingToken()){if(")"===p.currentValue())break;if(","===p.currentValue()){for(;","===p.currentValue()&&p.moveToNextToken(););m(p.currentToken())&&h.push(p.currentValue())}}p=
h}h="("+p.join(", ")+")";h=null==q?x("<function>"+h):x(q+h);this.$scopes.onFunctionScopeStart(h,n,r.currentPosition(),q,p)}else q=p.cloneCursor(),"{"===q.currentValue()&&q.moveToPreviousToken()&&","!=!q.currentToken().value&&q.moveToPreviousToken()&&"string"!=!q.currentToken().type&&q.moveToPreviousToken()&&"("!=!q.currentToken().value&&q.moveToPreviousToken()?(q=q.currentToken(),q=m(q)&&"test_that"==q.value):q=!1,q?(q=p.cloneCursor(),q.moveToPreviousToken(),q.moveToPreviousToken(),p=q.currentToken().value,
q=q.cloneCursor(),q.moveToPreviousToken(),q.moveToPreviousToken(),this.$scopes.onTestScopeStart(p,q.currentPosition(),r.currentPosition())):(n=r.currentPosition(),r.isFirstSignificantTokenOnLine()&&(n.column=0),this.$scopes.onScopeStart(n));else h&&"}"===r&&(p.column+=1,this.$scopes.onScopeEnd(p));else n=1,"\\chapter"===r?n=2:"\\section"===r?n=3:"\\subsection"===r?n=4:"\\subsubsection"===r&&(n=5),r=this.$doc.getLine(p.row),r=/{([^}]*)}/.exec(r),q="",null!=r&&(q=r[1]),h={row:p.row,column:0},u={row:p.row,
column:Infinity},this.$scopes.onMarkdownHead(q,h,u,n,!0)}}while(p=e.moveToNextToken());c=Math.max(c,e.$row);this.$scopes.parsePos={row:c,column:-1};return c};this.$getFoldToken=function(a,c,d){this.$tokenizeUpToRow(d);if(this.$statePattern&&!this.$statePattern.test(this.$endStates[d]))return"";a=this.$tokens[d];for(d=0;d<a.length;d++)if(/\bsectionhead\b/.test(a[d].type))return a[d];var b=0,e=null,f=null;for(d=0;d<a.length;d++){var g=a[d];if(/\bparen\b/.test(g.type))switch(g.value){case "{":b++;1==
b&&(e=g);break;case "}":b--,0==b&&(e=null),0>b&&(f=g,b=0)}}return e?e:"markbeginend"==c&&f?f:1<=a.length&&(/\bcodebegin\b/.test(a[0].type)||/\bcodeend\b/.test(a[0].type))?a[0]:null};this.getFoldWidget=function(a,c,d){a=this.$getFoldToken(a,c,d);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,b){var e=this.$getFoldToken(a,c,b);if(e){c={row:b,
column:e.column+1};if("{"==e.value)return(a=a.$findClosingBracket(e.value,c,d.getTokenTypeRegex("paren")))?l.fromPoints(c,a):void 0;if("}"==e.value)return(a=a.$findOpeningBracket(e.value,c,d.getTokenTypeRegex("paren")))?l.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,b,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},l.fromPoints({row:b,column:e.column+e.value.length},a)}else if(/\bcodeend\b/.test(e.type))for(c=new f(a,b,0);e=c.stepBackward();){if(/\bcodebegin\b/.test(e.type))return c=c.getCurrentTokenRow(),l.fromPoints({row:c,column:a.getLine(c).length},{row:b,column:a.getLine(b).length})}else if(/\bsectionhead\b/.test(e.type)){e=a.getLine(b);if(/^\s*[#=-]+\s*$/.test(e))e=e.length;else{e=/[#=-]+\s*$/.exec(e);if(!e)return;e=e.index}c.column=e;b=new f(a,b+1);for(b.$tokenIndex=
-1;(token=b.stepForward())&&"}"!==token.value&&!/\bsectionhead\b/.test(token.type)&&!/\bcode(?:begin|end)/.test(token.type);)"{"===token.value&&b.fwdToMatchingToken();b=b.getCurrentTokenRow();token&&b--;a={row:b,column:a.getLine(b).length};return l.fromPoints(c,a)}}};this.getCurrentScope=function(a,c){c||(c=function(a){return!0});if(!a)return"";this.$buildScopeTreeUpToRow(a.row);var d=this.$scopes.getActiveScopes(a);if(d)for(var b=d.length-1;0<=b;b--)if(c(d[b]))return d[b];return null};this.getScopeTree=
function(){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.getScopeList()};this.findFunctionDefinitionFromUsage=function(a,c){this.$buildScopeTreeUpToRow(this.$doc.getLength()-1);return this.$scopes.findFunctionDefinitionFromUsage(a,c)};this.getIndentForOpenBrace=function(a){if(this.$tokenizeUpToRow(a.row)){var c=this.getTokenCursor();if(c.seekToNearestToken(a,a.row)&&"{"==c.currentValue()&&c.moveBackwardOverMatchingParens())return this.$getIndent(this.$getLine(c.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,b,f,q){if(d.endsWith(a,"qstring"))return this.$getIndent(b);"number"!==typeof q&&(q=this.$session.getSelection().getCursor().row-1);var l=this.$session.getTabSize();a=Array(l+1).join(" ");this.$lineOverrides=null;this.$doc.getLine(q)!==b&&(this.$lineOverrides={},this.$lineOverrides[q]=b,this.$invalidateRow(q));try{var p=0>q?"":this.$getIndent(this.$getLine(q));
if(!this.$tokenizeUpToRow(q))return p;var m={row:q,column:this.$getLine(q).length},h=this.$findPreviousSignificantToken(m,0);b=this.$session.getLine(q);if(/\bfunction\s*\(\s*$/.test(b))return this.$getIndent(q)+f+f;p="";var k=!1;if(h&&A(h.token.type))p=f,k=!0;else if(h&&/\bparen\b/.test(h.token.type)&&/\)$/.test(h.token.value)){var v=this.$walkParensBalanced(h.row,h.row-10,null,function(a,c,b){return 0===a.length});if(null!=v){var w=this.$findPreviousSignificantToken(v,0);if(w&&"keyword"===w.token.type&&
/^(if|while|for|function)$/.test(w.token.value))return this.$getIndent(this.$getLine(w.row))+f}}else if(h&&"keyword"===h.token.type&&("repeat"===h.token.value||"else"===h.token.value))return this.$getIndent(this.$getLine(h.row))+f;var u=this.getTokenCursor();if(!u.moveToPosition(m))return"";do{var x=u.currentType();if("support.function.codebegin"===x||"support.function.codeend"===x)return this.$getIndent(this.$doc.getLine(u.$row))+p;var t=u.currentValue();if(u.isAtStartOfNewExpression(!1)){if("{"===
t||"["===t||"("===t)p+=f;return this.$getIndent(this.$doc.getLine(u.$row))+p}if("("===t&&u.isAtStartOfNewExpression(!0))return this.$getIndent(this.$doc.getLine(u.$row))+f;if(!u.bwdToMatchingToken()){if("{"===t)break;if(D(["[","("],t)){var B=u.currentPosition();m=null;e&&(m=this.$findNextSignificantToken({row:B.row,column:B.column+1},q));if(m){b=this.$getLine(m.row);var y=b.replace(/[^\s].*$/,""),C=m.column-y.length,F=Math.floor(C/l);B=C-l*F;C="";for(b=0;b<F;b++)C+=f;for(f=0;f<B;f++)C+=" ";f=y+C;
var H=f.replace("\t",a).length;for(b=m.row+1;b<=q;b++)if(/[^\s]/.test(this.$getLine(b))){var Q=this.$endStates[b-1];if("qstring"!==Q&&"qqstring"!==Q){var G=this.$getLine(b).replace(/[^\s].*$/,"");var E=G.replace("\t",a).length;E<H&&(f=G,H=E)}}return r(u)?f:f+p}return this.getIndentForOpenBrace(B)+f+p}}}while(u.moveToPreviousToken());if(!u.moveToPosition(m))return"";do if(!u.bwdToMatchingToken()){if("{"===u.currentValue())return this.getIndentForOpenBrace(u.currentPosition())+f+p;if(c(u.currentToken())){for(;c(u.currentToken())&&
u.moveToPreviousToken()&&u.findStartOfEvaluationContext();){var z=u.cloneCursor();if(z.moveToPreviousToken()){if("else"===z.currentValue()||"repeat"===z.currentValue())return this.$getIndent(this.$doc.getLine(z.$row))+p+p;if(")"===z.currentValue()&&z.bwdToMatchingToken()&&z.moveToPreviousToken()&&n(z.currentValue())){b=this.$doc.getLine(z.$row);if(!k)for(;z.moveToPreviousToken()&&")"===z.currentValue()&&z.bwdToMatchingToken()&&z.moveToPreviousToken()&&n(z.currentValue());)b=this.$doc.getLine(z.$row);
return this.$getIndent(b)+p+p}}c(u.peekBwd().currentToken())&&u.moveToPreviousToken()}return this.$getIndent(this.$getLine(u.$row))+p}}while(u.moveToPreviousToken());if(k){H=0;u=this.getTokenCursor();u.moveToPosition(m);u.moveToPreviousToken();do{if(g(u.currentValue(),["if","else"])){p+=f;break}if(u.hasType("constant","identifier")){if(!u.moveToPreviousToken())break;if(g(u.currentValue(),["if","else"])){p+=f;break}if(")"===u.currentValue()){if(!u.bwdToMatchingToken())break;if(!u.moveToPreviousToken())break;
if(g(u.currentValue(),["if","else"])){p+=f;break}}if(!u.hasType("operator"))break}else if(!u.findStartOfEvaluationContext())break}while(u.moveToPreviousToken()&&20>H++)}var J=this.$findNextSignificantToken({row:0,column:0},q);return J?this.$getIndent(this.$getLine(J.row))+p:""+p}finally{this.$lineOverrides&&(this.$lineOverrides=null,this.$invalidateRow(q))}};this.getBraceIndent=function(a){var c=this.getTokenCursor(),b={row:a,column:this.$getLine(a).length};if(!c.moveToPosition(b))return"";if(")"===
c.currentValue()){if(c.bwdToMatchingToken()&&c.moveToPreviousToken()&&(b=c.currentValue(),g(b,["if","while","for","function"])))return this.$getIndent(this.$getLine(c.$row))}else if(g(c.currentValue(),["else","repeat"]))return this.$getIndent(this.$getLine(c.$row));return this.getIndentForRow(a)};this.getTokenForPos=function(a,c,b){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(c&&a.column==f.column)return f;if(a.column<=
f.column)break;if(b&&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 c=0,b=!0;c<=a;c++)if(!b||!this.$endStates[c]){b=!1;var d=0===c?"start":this.$endStates[c-1],e=Object.assign({},this.$contexts[c-1]),f=this.$getLine(c);f=this.$tokenizer.getLineTokens(f,d,c,e||{});this.$contexts[c]=e;!this.$statePattern||this.$statePattern.test(f.state)||this.$statePattern.test(d)?this.$tokens[c]=
this.$filterWhitespaceAndComments(f.tokens):this.$tokens[c]=[];f.state===this.$endStates[c]?b=!0:this.$endStates[c]=f.state}b||c<this.$tokens.length&&this.$invalidateRow(c);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.$contexts[a]=
null};this.$insertNewRows=function(a,c){for(var b=[a,0],d=0;d<c;d++)b.push(null);this.$tokens.splice.apply(this.$tokens,b);this.$endStates.splice.apply(this.$endStates,b);this.$contexts.splice.apply(this.$contexts,b)};this.$removeRows=function(a,c){this.$tokens.splice(a,c);this.$endStates.splice(a,c);this.$contexts.splice(a,c)};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,c,b){var d=/\bparen\b/;return a<c?function(){for(;a<=c;a++)for(var e=this.$tokens[a],f=0;f<e.length;f++)if(d.test(e[f].type)&&!b(e[f].value,{row:a,column:e[f].column}))return!1;return!0}.call(this):function(){a=Math.max(0,a);for(c=Math.max(0,c);a>=c;a--)for(var e=this.$tokens[a],f=e.length-1;0<=f;f--)if(d.test(e[f].type)&&!b(e[f].value,{row:a,column:e[f].column}))return!1;return!0}.call(this)};this.$walkParensBalanced=function(a,c,b,d){var e=[],f=
null,g=this;this.$walkParens(a,c,function(a,c){if(b&&b(e,a,c))return f=c,!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,c)?(f=c,!1):!0});return f};this.$findNextSignificantToken=function(a,c){if(0==this.$tokens.length)return null;c=Math.min(c,this.$tokens.length-1);for(var b=a.row,d=a.column;b<=c;b++){for(var e=this.$tokens[b],f=0;f<e.length;f++)if(e[f].column+e[f].value.length>d)return{token:e[f],row:b,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,c){if(0===this.$tokens.length)return null;c=Math.max(0,c);for(var b=Math.min(a.row,this.$tokens.length-1);b>=c;b--){var d=this.$tokens[b];if(0!==d.length){if(b!=a.row)return{row:b,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:b,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 c=a.length-1;0<=c;c--)if(1<a[c].value.length&&/\bparen\b/.test(a[c].type)){var b=a[c];a.splice(c,1);for(var d=b.value.length-1;0<=d;d--){var e={type:b.type,value:b.value.charAt(d),column:b.column+d};a.splice(c,0,e)}}return a}}).call(a.prototype);
k.RCodeModel=a;k.setVerticallyAlignFunctionArgs=function(a){e=a};k.getVerticallyAlignFunctionArgs=function(){return e}});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,h){function g(a){for(var c=Array(a.length),b=0;b<a.length;b++)c[b]={include:a[b]};return c}var n=a("mode/utils");h=a("ace/lib/oop");var l=a("ace/lib/lang"),f=a("ace/mode/text_highlight_rules").TextHighlightRules,b=a("mode/rainbow_paren_highlight_rules").RainbowParenHighlightRules;n=a("mode/utils");var d=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()};h.inherits(d,f);var e=function(a,b,d){return[{type:"string",value:a},{type:"string.color",value:b,
bg:d},{type:"string",value:a}]};a=function(){var a=l.arrayToMap("\\ function if else in break next repeat for while".split(" ")),f=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),h={"{":"}","[":"]","(":")"},k={"#comment":[{token:"comment.sectionhead",
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,c,b,d){b=b||[];b[0]=c;b[1]=this.next;b[2]=h[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,c,b,d){c=a.substring(0,1);a=a.substring(1,a.length-1);return e(c,a,a)}},{token:"string",regex:"([\"'])(#[0-9a-fA-F]{3})(\\1)",next:"start",onMatch:function(a,c,b,d){c=a.substring(0,1);a=a.substring(1,a.length-1);return e(c,a,a)}},{token:"string",regex:"([\"'])([a-z]+[0-9]*)(\\1)",next:"start",onMatch:function(a,c,b,d){c=a.substring(0,1);a=a.substring(1,
a.length-1);b=p.get(a);return void 0===b?this.token:e(c,a,"#"+b)}},{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(c){return q.hasOwnProperty(c)?"constant.language":a.hasOwnProperty(c)?"keyword":c.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(c){return f.hasOwnProperty(c)||a.hasOwnProperty(c)?"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"},b.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,c,b,d){this.next=a===b[2]?b[0]:b[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 d).getRules();for(var w in m){k=m[w];for(var A=0;A<k.length;A++)if(n.isArray(k[A].token))for(var D=0;D<k[A].token.length;D++)k[A].token[D]+=".virtual-comment";else k[A].token+=".virtual-comment"}this.embedRules(m,"rdoc-",[{token:"text",regex:"^",
next:"start"}]);n.embedQuartoHighlightRules(this);this.normalizeRules()};h.inherits(a,f);k.RHighlightRules=a;k.setHighlightRFunctionCalls=function(a){$colorFunctionCalls=a}});define("mode/r_matching_brace_outdent",["require","exports","module"],function(a,k,h){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,l,f){if(0!==f){a=l.getLine(f);var b=a.match(/^(\s*[\}\)\]])/);if(b){b=b[1].length;var d=l.findMatchingBracket({row:f,column:b});if(!d||d.row==f)return 0;d=this.codeModel.getIndentForOpenBrace(d);
l.replace(new g(f,0,f,b-1),d)}if(b=a.match(/^(\s*\{)/))b=b[1].length,d=this.codeModel.getBraceIndent(f-1),l.replace(new g(f,0,f,b-1),d)}}}).call(a.prototype);k.RMatchingBraceOutdent=a});define("mode/r_scope_tree",["require","exports","module"],function(a,k,h){function g(a,f){return a.row!=f.row?a.row-f.row:a.column-f.column}var n=function(a,f,b,d,e){this.label=a;if((this.start=f)&&b&&(b.row>f.row||b.row===f.row&&b.column>f.column))throw Error("Malformed preamble: should lie before start position");this.preamble=b||f;this.end=null;this.scopeType=d;this.parentScope=null;this.attributes=e||{};this.$children=[]};n.TYPE_ROOT=1;n.TYPE_BRACE=2;n.TYPE_CHUNK=3;n.TYPE_SECTION=4;(function(){this.isRoot=
function(){return this.scopeType==n.TYPE_ROOT};this.isBrace=function(){return this.scopeType==n.TYPE_BRACE};this.isChunk=function(){return this.scopeType==n.TYPE_CHUNK};this.isSection=function(){return this.scopeType==n.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)){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 b=this.$children[this.$children.length-
1];if(b.end)return null;var d=b.closeScope(a,f);return d?d:f==b.scopeType?(b.end=a,b.$forceDescendantsClosed(a),b):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 b=this.$getFunctionStack(a),d=0;d<b.length;d++)for(var e=b[d],c=0;c<e.$children.length;c++)if(e.$children[c].label==f)return e.$children[c];return null};this.getFunctionsInScope=function(a){a=this.$getFunctionStack(a);for(var f=[],b=0;b<a.length;b++)f.push({name:a[b].attributes.name,args:a[b].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,b){"undefined"===typeof f&&(f=0);"undefined"===typeof b&&(b=this.$children.length);if(f===b)return-(f+1);var d=Math.floor((f+b)/2),e=this.$children[d].comparePosition(a);return 0===e?d:0>e?this.$binarySearch(a,f,d):this.$binarySearch(a,
d+1,b)};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(n.prototype);a=function(a){this.$ScopeNodeFactory=a||n;this.parsePos={row:0,column:0};this.$root=new this.$ScopeNodeFactory("(Top Level)",this.parsePos,null,n.TYPE_ROOT)};(function(){function a(b){count=b.isChunk()?1:0;b=b.$children||[];for(var d=
0;d<b.length;d++)count+=a(b[d]);return count}this.getParsePosition=function(){return this.parsePos};this.setParsePosition=function(a){this.parsePos=a};this.onSectionStart=function(a,d,e){"undefined"==typeof e&&(e={});var c=this.getActiveScopes(d);if(1<c.length){c=c[c.length-2].$children;for(var b=c.length-1;0<=b;b--)if(c[b].isSection()){this.$root.closeScope(d,n.TYPE_SECTION);break}}a=new this.$ScopeNodeFactory(a,d,d,n.TYPE_SECTION,e);this.$root.addNode(a)};this.onSectionEnd=function(a){this.$root.closeScope(a,
n.TYPE_SECTION)};this.closeMarkdownHeaderScopes=function(a,d,e){for(var c=a.$children,b=c.length-1;0<=b;b--){var f=c[b];if(f.isFunction()||f.isChunk())return;if(f.isSection()&&f.attributes.depth>=e)return this.$root.closeScope(d,n.TYPE_SECTION),f.attributes.depth===e||a.isRoot()||null==a?void 0:this.closeMarkdownHeaderScopes(a.parentScope,d,e)}a.isRoot()||null==a||this.closeMarkdownHeaderScopes(a.parentScope,d,e)};this.onMarkdownHead=function(a,d,e,c,f){var b=this.getActiveScopes(d);1<b.length&&this.closeMarkdownHeaderScopes(b[b.length-
2],d,c);this.$root.addNode(new this.$ScopeNodeFactory(a,e,d,n.TYPE_SECTION,{depth:c,isMarkdown:f}))};this.onChunkStart=function(a,d,e,c){this.$root.closeScope(e,n.TYPE_CHUNK);d=new this.$ScopeNodeFactory(d,c,e,n.TYPE_CHUNK);d.chunkLabel=a;this.$root.addNode(d);this.printScopeTree()};this.onChunkEnd=function(a){a=this.$root.closeScope(a,n.TYPE_CHUNK);this.printScopeTree();return a};this.onFunctionScopeStart=function(a,d,e,c,f){this.$root.addNode(new this.$ScopeNodeFactory(a,e,d,n.TYPE_BRACE,{name:c,
args:f,type:"function"}));this.printScopeTree()};this.onTestScopeStart=function(a,d,e){var c="test_that("+a+")";a=a.replace(/^['"](.*)['"]/,"$1");this.$root.addNode(new this.$ScopeNodeFactory(c,e,d,n.TYPE_BRACE,{name:a,type:"test"}));this.printScopeTree()};this.onNamedScopeStart=function(a,d){this.$root.addNode(new this.$ScopeNodeFactory(a,d,null,n.TYPE_BRACE))};this.onScopeStart=function(a){this.$root.addNode(new this.$ScopeNodeFactory(null,a,null,n.TYPE_BRACE));this.printScopeTree()};this.onScopeEnd=
function(a){a=this.$root.closeScope(a,n.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,d){return this.$root.findFunctionDefinitionFromUsage(a,d)};this.getFunctionsInScope=function(a,d){return this.$root.getFunctionsInScope(a,d)};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(b){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,d){a.isFunction()&&d.push(a);for(var b=a.$children,c=0;c<b.length;c++)f(b[c],d)}}).call(a.prototype);k.ScopeManager=a;k.ScopeNode=n});var $rainbowParentheses=!1,$numParenColors=7;
define("mode/rainbow_paren_highlight_rules",["require","exports","module"],function(a,k,h){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,n,l,f,b){if(!$rainbowParentheses)return this.token="paren.keyword.operator.nomatch";
b.rainbow=b.rainbow||0;switch(a){case "[":case "{":case "(":this.token="paren.paren_color_"+b.rainbow%$numParenColors;b.rainbow+=1;break;case "]":case "}":case ")":b.rainbow=Math.max(0,b.rainbow-1),this.token="paren.paren_color_"+b.rainbow%$numParenColors}return this.token}}}});define("mode/rdoc",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("ace/tokenizer").Tokenizer,l=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/rdoc_highlight_rules").RDocHighlightRules,b=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;a=function(a){a?(this.$highlightRules=new l,this.$tokenizer=new n((new l).getRules())):(this.$highlightRules=new f,this.$tokenizer=new n((new f).getRules()));this.$outdent=new b};h.inherits(a,
g);(function(){this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)}}).call(a.prototype);k.Mode=a});define("mode/rdoc_highlight_rules",["require","exports","module"],function(a,k,h){h=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+"}]}};h.inherits(g,a);k.RDocHighlightRules=g});define("mode/rhtml",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/html").Mode,n=a("ace/tokenizer").Tokenizer,l=a("mode/rhtml_highlight_rules").RHtmlHighlightRules,f=a("mode/r_code_model").RCodeModel,b=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,d=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,e=a("mode/utils");a=function(a,e){this.$session=e;this.$tokenizer=new n((new l).getRules());this.codeModel=new f(e,this.$tokenizer,/^r-/,/^\x3c!--\s*begin.rcode\s*(.*)/,
/^\s*end.rcode\s*--\x3e/);this.$outdent=new b;this.$r_outdent=new d(this.codeModel);this.foldingRules=this.codeModel};h.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,d,b){return"r"===e.activeMode(a,"html")?this.$r_outdent.checkOutdent(a,d,b):this.$outdent.checkOutdent(d,b)};this.autoOutdent=function(a,d,b){return"r"===e.activeMode(a,"html")?this.$r_outdent.autoOutdent(a,
d,b):this.$outdent.autoOutdent(d,b)};this.getLanguageMode=function(a){return e.getPrimaryState(this.$session,a.row).match(/^r-/)?"R":"HTML"};this.$getNextLineIndent=this.getNextLineIndent;this.getNextLineIndent=function(a,d,b,f){return"r"===e.activeMode(a,"html")?this.codeModel.getNextLineIndent(a,d,b,f):this.$getNextLineIndent(a,d,b)};this.$id="mode/rhtml"}).call(a.prototype);k.Mode=a});define("mode/rhtml_highlight_rules",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("mode/r_highlight_rules").RHighlightRules,n=a("ace/mode/html_highlight_rules").HtmlHighlightRules;a=a("ace/mode/text_highlight_rules").TextHighlightRules;var l=function(){this.$rules=(new n).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"})};h.inherits(l,a);k.RHtmlHighlightRules=l});define("mode/rmarkdown",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("mode/markdown").Mode,n=a("ace/tokenizer").Tokenizer,l=a("mode/rmarkdown_highlight_rules").RMarkdownHighlightRules,f=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,b=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,d=a("mode/c_cpp_matching_brace_outdent").CppMatchingBraceOutdent,e=a("mode/r_code_model").RCodeModel,c=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"),v=a("ace/unicode");a=function(a,g){var h=this;this.$session=g;this.$tokenizer=new n((new l).getRules());this.$outdent=new f;this.codeModel=new e(g,this.$tokenizer,/^r-/,new RegExp(l.prototype.$reChunkStartString),new RegExp(l.prototype.$reChunkEndString));this.$r_outdent=new b(this.codeModel);this.cpp_codeModel=new c(g,this.$tokenizer,/^r-cpp-/,new RegExp(l.prototype.$reCppChunkStartString),new RegExp(l.prototype.$reChunkEndString));
this.$cpp_outdent=new d(this.cpp_codeModel);this.$python=new r;var k=new q,v=new p;this.$tokenizer.getLineTokens=function(a,c,d,b){return n.prototype.getLineTokens.call(this,a,0===d?"_start":c,d,b)};this.foldingRules={getFoldWidget:function(a,c,d){var b=h.getLanguageMode({row:d,column:0}),e=a.getLine(d);return"Markdown"===b||m.startsWith(e,"```")||0===d?k.getFoldWidget(a,c,d):"C_CPP"===b?v.getFoldWidget(a,c,d):h.codeModel.getFoldWidget(a,c,d)},getFoldWidgetRange:function(a,c,d){var b=h.getLanguageMode({row:d,
column:0}),e=a.getLine(d);return"Markdown"===b||m.startsWith(e,"```")||0===d?k.getFoldWidgetRange(a,c,d):"C_CPP"===b?v.getFoldWidgetRange(a,c,d):h.codeModel.getFoldWidgetRange(a,c,d)}}};h.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(c){c=m.getPrimaryState(this.$session,c.row);c=a(c);return"r"===c?"R":"r-cpp"===c?"C_CPP":"yaml"===c?"YAML":
"python"===c?"Python":"sql"==c?"SQL":"stan"===c?"Stan":"Markdown"};this.$getNextLineIndent=this.getNextLineIndent;this.getNextLineIndent=function(c,d,b,e,f){var g=a(c);return"r"===g?this.codeModel.getNextLineIndent(c,d,b,e):"r-cpp"===g?this.cpp_codeModel.getNextLineIndent(c,d,b,e,f):"yaml"===g?this.$getIndent(this.$session.getLine(e+1)):"python"===g?this.$python.getNextLineIndent(c,d,b,e):this.$getNextLineIndent(c,d,b)};this.checkOutdent=function(c,d,b){var e=a(c);return"r"===e?this.$r_outdent.checkOutdent(c,
d,b):"r-cpp"===e?this.$cpp_outdent.checkOutdent(c,d,b):"yaml"===e?!1:this.$outdent.checkOutdent(d,b)};this.autoOutdent=function(c,d,b){var e=a(c);if("r"===e)return this.$r_outdent.autoOutdent(c,d,b);if("r-cpp"===e)return this.$cpp_outdent.autoOutdent(c,d,b);if("yaml"!==e)return"python"===e?this.$python.autoOutdent(c,d,b):this.$outdent.autoOutdent(d,b)};this.getIndentForOpenBrace=function(c){var d=m.getPrimaryState(this.$session,c.row);if("r"===a(d))return this.codeModel.getIndentForOpenBrace(c);c=
this.$session.getLine(c.row1);return this.$getIndent(c)};this.transformAction=function(c,d,b,e,f){var g=a(c);return"markdown"===g?this.transformActionMarkdown(c,d,b,e,f):"r-cpp"===g?this.transformActionCpp(c,d,b,e,f):"yaml"===g?this.transformActionYaml(c,d,b,e,f):"python"===g?this.$python.transformAction(c,d,b,e,f):!1};this.transformActionMarkdown=function(a,c,d,b,e){if("insertion"===c)if("r"===e){if(a=d.getCursorPosition(),c=b.getLine(a.row),b=b.getTokenAt(a.row,a.column-1),null!==b&&-1===b.type.indexOf("support.function")&&
"`"===c[a.column-1])return{text:"r`",selection:[0,a.column+1,0,a.column+1]}}else if("`"===e&&(a=d.getCursorPosition(),c=b.getLine(a.row),b=b.getTokenAt(a.row,a.column+1),null!==b&&-1!==b.type.indexOf("support.function")&&"`"===c[a.column]))return{text:"",selection:[0,a.column+1,0,a.column+1]}};this.transformActionCpp=function(a,c,d,b,e){if("insertion"===c)if("\n"===e){if(a=d.getSelectionRange().start,(b=/^((\s*\/\/+')\s*)/.exec(b.doc.getLine(a.row)))&&d.getSelectionRange().start.column>=b[2].length)return{text:"\n"+
b[1]}}else if("R"===e&&(a=d.getSelectionRange().start,(b=/^(\s*\/\*{3,}\s*)/.exec(b.doc.getLine(a.row)))&&d.getSelectionRange().start.column>=b[1].length))return{text:"R\n\n*/\n",selection:[1,0,1,0]};return!1};this.transformActionYaml=function(a,c,d,b,e){return"insertion"===c&&"\n"===e?(a=d.getCursorPosition().row,a=b.getLine(a),b=this.$getIndent(a),/[:({[]$/.test(a)?(a=this.$session.getTabString(),{text:"\n"+b+a}):{text:"\n"+b}):!1};this.tokenRe=new RegExp("^["+v.wordChars+"._]+","g");this.nonTokenRe=
new RegExp("^(?:[^"+v.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,h){h=a("ace/lib/oop");var g=a("ace/mode/folding/fold_mode").FoldMode,n=a("ace/range").Range,l=a("mode/utils");a=k.FoldMode=function(){};h.inherits(a,g);var f=/(?:^|[.])(?:codebegin|heading)(?:$|[.])/,b=/(?:^|[.])(?:codeend)(?:$|[.])/;(function(){this.$getBracedWidgetRange=function(a,b,c,f,g){b="start"===this.getFoldWidget(a,b,c)?1:-1;var d={row:c,column:0};1===b&&(d.column=a.getLine(c).length);c+=b;for(var e=0<b?a.getLength():
0;c!==e;){var q=a.getLine(c).trim();if(l.startsWith(q,f))break;if(g&&l.startsWith(q,g))break;c+=b}f={row:c,column:0};-1===b&&(f.column=a.getLine(c).length);return 1===b?n.fromPoints(d,f):n.fromPoints(f,d)};this.getFoldWidget=function(a,e,c){e="markbeginend"===e?"end":"";a=a.getTokens(c);a=$jscomp.makeIterator(a);for(c=a.next();!c.done;c=a.next()){c=c.value.type||"";if(f.test(c))return"start";if(b.test(c))return e}return""};this.$getFoldWidgetRange=function(a,b,c){var d=a.getState(c),e=a.getLine(c),
f=e.trim();if(l.startsWith(e,"```"))return this.$getBracedWidgetRange(a,b,c,"```");var g=0<c?a.getState(c-1):"start";f=0===c&&"---"===f;g=l.startsWith(g,"yaml");if(f||g)return this.$getBracedWidgetRange(a,b,c,"---",f?"...":void 0);if("="===e[0])b=1;else if("-"===e[0])b=2;else{b=/^(#+)(?:.*)$/.exec(e);if(!b)return;b=b[1].length}if(null!==b){a:{g=a.getLength();for(f=c+1;f<g;f++)if(a.getState(f)===d){var h=a.getLine(f);if(1===b&&/^[=]{3,}\s*/.test(h)){d=f-2;break a}if(2===b&&/^[-]{3,}\s*/.test(h)){d=
f-2;break a}if((h=/^(#+)(?:.*)$/.exec(h))&&h[1].length<=b){d=f-1;break a}}d=g}return new n(c,e.length,d,a.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(a.prototype)});define("mode/rmarkdown_highlight_rules",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("mode/r_highlight_rules").RHighlightRules,n=a("mode/c_cpp_highlight_rules").c_cppHighlightRules,l=a("ace/mode/perl_highlight_rules").PerlHighlightRules,f=a("mode/python_highlight_rules").PythonHighlightRules,b=a("ace/mode/ruby_highlight_rules").RubyHighlightRules,d=a("mode/markdown_highlight_rules").MarkdownHighlightRules,e=a("ace/mode/text_highlight_rules").TextHighlightRules,c=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("mode/tex_highlight_rules").LatexHighlightRules,v=a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,B=a("ace/mode/css_highlight_rules").CssHighlightRules,w=a("ace/mode/scss_highlight_rules").ScssHighlightRules,A=a("ace/mode/sass_highlight_rules").SassHighlightRules,D=a("ace/mode/less_highlight_rules").LessHighlightRules;e=a("ace/mode/text_highlight_rules").TextHighlightRules;
var x=a("mode/mermaid_highlight_rules").MermaidHighlightRules,t=a("ace/mode/dot_highlight_rules").DotHighlightRules,y=a("mode/utils");a=function(){this.$rules=(new d).getRules();this.$rules._start=this.$rules.allowBlock.slice();y.embedRules(this,g,"r",this.$reChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,n,"r-cpp",this.$reCppChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,l,"perl",this.$rePerlChunkStartString,
this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,f,"python",this.$rePythonChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,b,"ruby",this.$reRubyChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,d,"markdown",this.$reMarkdownChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,r,"sh",this.$reShChunkStartString,this.$reChunkEndString,["start","listblock",
"allowBlock"]);y.embedRules(this,q,"stan",this.$reStanChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,p,"sql",this.$reSqlChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,x,"mermaid",this.$reMermaidChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,t,"dot",this.$reDotChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,v,"js",
this.$reJavaScriptChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,B,"css",this.$reCssChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,w,"scss",this.$reScssChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,A,"sass",this.$reSassChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,D,"less",this.$reLessChunkStartString,this.$reChunkEndString,
["start","listblock","allowBlock"]);y.embedRules(this,m,"tex",this.$reLatexChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,e,"text",this.$reTextChunkStartString,this.$reChunkEndString,["start","listblock","allowBlock"]);y.embedRules(this,c,"yaml","^\\s*---\\s*$","^\\s*(?:---|\\.\\.\\.)\\s*$",["_start"]);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()};h.inherits(a,e);(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)");this.$reLatexChunkStartString=a("(?:tikz|latex|tex)")}).call(a.prototype);k.RMarkdownHighlightRules=a});define("mode/sh",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("mode/sh_highlight_rules").ShHighlightRules,l=a("ace/range").Range,f=a("ace/mode/folding/cstyle").FoldMode,b=a("ace/mode/behaviour/cstyle").CstyleBehaviour;a=function(){this.HighlightRules=n;this.foldingRules=new f;this.$behaviour=new b};h.inherits(a,g);(function(){this.lineCommentStart="#";this.getNextLineIndent=function(a,c,b){var d=this.$getIndent(c),e=this.getTokenizer().getLineTokens(c,
a).tokens;if(e.length&&"comment"==e[e.length-1].type)return d;"start"==a&&c.match(/^.*[\{\(\[:]\s*$/)&&(d+=b);return d};var a={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(b,c,d){if("\r\n"!==d&&"\r"!==d&&"\n"!==d)return!1;b=this.getTokenizer().getLineTokens(c.trim(),b).tokens;if(!b)return!1;do c=b.pop();while(c&&("comment"==c.type||"text"==c.type&&c.value.match(/^\s+$/)));return c?"keyword"==c.type&&a[c.value]:!1};this.autoOutdent=function(a,c,b){b+=1;a=this.$getIndent(c.getLine(b));
var d=c.getTabString();a.slice(-d.length)==d&&c.remove(new l(b,a.length-d.length,b,a.length))};this.$id="mode/sh"}).call(a.prototype);k.Mode=a});define("mode/sh_highlight_rules",["require","exports","module"],function(a,k,h){h=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",n=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",
l=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,b,d){var e=b.substring(0,b.length-5);e="-"===a[2]?e+"indentedHeredoc":e+"heredoc";a=a.split(this.splitRegex);d.push(e,a[4],b);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,b,d){if(a===
d[1])return this.next=d[2],d.splice(-3),"support.class";this.next="";return"string"},regex:".*$"}],indentedHeredoc:[{token:"string",regex:"^\t+"},{onMatch:function(a,b,d){if(a===d[1])return this.next=d[2],d.splice(-3),"support.class";this.next="";return"string"},regex:".*$"}]}},{regex:"$",token:"empty",next:function(a,b){return/heredoc$/i.test(b[0])?b[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":n,"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,b){if(2>b.length)return a;b.shift();return b.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()};h.inherits(l,a);k.ShHighlightRules=l});define("mode/sql",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("mode/sql_highlight_rules").SqlHighlightRules;a("ace/range");a=function(){this.HighlightRules=n};h.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,h){h=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()};h.inherits(g,a);k.SqlHighlightRules=g});define("mode/stan",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("ace/tokenizer").Tokenizer,l=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=a("mode/stan_highlight_rules").StanHighlightRules,b=a("ace/mode/folding/cstyle").FoldMode;a=function(){this.$highlightRules=new f;this.$tokenizer=new n(this.$highlightRules.getRules());this.$outdent=new l;this.foldingRules=new b};h.inherits(a,g);(function(){this.lineCommentStart=["//","#"];this.blockComment=
{start:"/*",end:"*/"};this.toggleCommentLines=function(a,b,c,f){var d=!0;a=/^(\s*)\/\//;for(var e=c;e<=f;e++)if(!a.test(b.getLine(e))){d=!1;break}if(d)for(d=new Range(0,0,0,0),e=c;e<=f;e++)c=b.getLine(e).match(a),d.start.row=e,d.end.row=e,d.end.column=c[0].length,b.replace(d,c[1]);else b.indentRows(c,f,"//")};this.getLanguageMode=function(a){return"Stan"};this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.getTokenizer().getLineTokens(b,a).tokens;if(e.length&&"comment"==e[e.length-
1].type)return d;"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/stan"}).call(a.prototype);k.Mode=a});define("mode/stan_highlight_rules",["require","exports","module"],function(a,k,h){h=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:".+"}]}};h.inherits(g,a);k.StanHighlightRules=g});define("mode/sweave",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("ace/tokenizer").Tokenizer,l=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/sweave_highlight_rules").SweaveHighlightRules,b=a("mode/r_code_model").RCodeModel,d=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,e=a("mode/r_matching_brace_outdent").RMatchingBraceOutdent,c=a("ace/unicode"),r=a("mode/utils");a("mode/auto_brace_insert");a=function(a,c){this.$tokenizer=
a?new n((new l).getRules()):new n((new f).getRules());this.$session=c;this.$outdent=new d;this.codeModel=new b(c,this.$tokenizer,/^r-/,/<<(.*?)>>/,/^\s*@\s*$/);this.$r_outdent=new e(this.codeModel);this.foldingRules=this.codeModel};h.inherits(a,g);(function(){this.tokenRe=new RegExp("^["+c.wordChars+"._]+","g");this.nonTokenRe=new RegExp("^(?:[^"+c.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,c,b,d){return"r"===r.activeMode(a,"tex")?this.codeModel.getNextLineIndent(a,c,b,d):this.$getNextLineIndent(a,c,b)};this.checkOutdent=function(a,c,b){return"r"===r.activeMode(a,"tex")?this.$r_outdent.checkOutdent(a,c,b):this.$outdent.checkOutdent(c,
b)};this.autoOutdent=function(a,c,b){return"r"===r.activeMode(a,"tex")?this.$r_outdent.autoOutdent(a,c,b):this.$outdent.autoOutdent(c,b)};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,h){h=a("ace/lib/oop");a("mode/utils");var g=a("mode/tex_highlight_rules").TexHighlightRules,n=a("mode/r_highlight_rules").RHighlightRules;a=a("ace/mode/text_highlight_rules").TextHighlightRules;var l=function(){this.$rules=(new g).getRules();this.addRules((new n).getRules(),"r-");this.addRules((new n).getRules(),"r-sexpr-");this.$rules.start.unshift({token:"comment.codebegin",regex:"^\\s*<<.*>>=.*$",next:"r-start"});
this.$rules["r-start"].unshift({token:"comment.codeend",regex:"^\\s*@(?:\\s.*)?$",next:"start"});this.$rules.start.unshift({token:"comment",regex:"^\\s*@(?:\\s.*)?$"});this.$rules.start.unshift({regex:"(\\\\Sexpr)([{])",next:"r-sexpr-start",onMatch:function(a,b,d,e,c){c.sexpr=c.sexpr||{};c.sexpr.state=b;c.sexpr.count=1;return[{type:"keyword",value:"\\Sexpr"},{type:"paren.keyword.operator",value:"{"}]}});this.$rules["r-sexpr-start"].unshift({token:"paren.keyword.operator",regex:"[{]",merge:!1,onMatch:function(a,
b,d,e,c){c.sexpr.count+=1;return this.token}});this.$rules["r-sexpr-start"].unshift({token:"paren.keyword.operator",regex:"[}]",merge:!1,onMatch:function(a,b,d,e,c){--c.sexpr.count;0===c.sexpr.count?(this.next=c.sexpr.state,delete c.sexpr):this.next=b;return this.token}})};h.inherits(l,a);k.SweaveHighlightRules=l});define("mode/tex",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("ace/tokenizer").Tokenizer,l=a("ace/mode/text_highlight_rules").TextHighlightRules,f=a("mode/tex_highlight_rules").TexHighlightRules,b=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent;a=function(a){this.$tokenizer=a?new n((new l).getRules()):new n((new f).getRules());this.$outdent=new b};h.inherits(a,g);(function(){this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)};
this.allowAutoInsert=function(){return!1}}).call(a.prototype);k.Mode=a});define("mode/tex_highlight_rules",["require","exports","module"],function(a,k,h){h=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+"}]}};h.inherits(g,a);k.TexHighlightRules=g});define("mode/token_cursor",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("mode/utils"),n=g.getTokenTypeRegex("paren"),l=function(a,b,c){this.$tokens=a;this.$row=b||0;this.$offset=c||0};(function(){this.cloneCursor=function(){return new l(this.$tokens,this.$row,this.$offset)};var a=g.isArray,b=g.contains,c={"(":")","{":"}","<":">","[":"]",")":"(","}":"{",">":"<","]":"["},f=["(","[","{"],q=[")","]","}"];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,c=0;0<=a;){var b=this.$tokens[a];if(b&&0!==b.length){c=b.length;break}a--}if(0>a)return!1;this.$row=a;this.$offset=c-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 c=this.$tokens[this.$row];if(c&&this.$offset<c.length-1)return this.$offset++,!0;for(var b=this.$row+1;b<=a&&(!(c=this.$tokens[b])||0===c.length);)b++;if(b>a)return!1;this.$row=b;this.$offset=0;return!0};this.peekBwd=function(a){"undefined"===typeof a&&(a=1);for(var c=this.cloneCursor(),b=0;b<a;b++)if(!c.moveToPreviousToken())return c.$invalidate();return c};this.peekFwd=function(a){"undefined"===
typeof a&&(a=1);for(var c=this.cloneCursor(),b=0;b<a;b++)if(!c.moveToNextToken())return c.$invalidate();return c};this.$invalidate=function(){this.$column=this.$row=0;this.$tokens=[];return this};this.seekToNearestToken=function(a,c){if(a.row>c)return!1;this.$row=a.row;var b=this.$tokens[this.$row]||[];for(this.$offset=0;this.$offset<b.length;this.$offset++)if(b[this.$offset].column>=a.column)return!0;return a.row<c?this.moveToNextToken(c):!1};this.bwdToNearestToken=function(a){this.$row=a.row;this.$offset=
a.column;for(var c=this.$tokens[this.$row]||[];0<=this.$offset;this.$offset--){var b=c[this.$offset];if("undefined"!==typeof b&&b.column<=a.column)return!0}return this.moveToPreviousToken()};this.bwdToMatchingToken=function(){var a=this.currentValue();if(!b(q,a))return!1;for(var d=c[a],e=0;this.moveToPreviousToken();){var f=this.currentValue();if(f===d){if(0===e)return!0;e--}else f===a&&e++}return!1};this.fwdToMatchingToken=function(){var a=this.currentValue();if(!b(f,a))return!1;for(var d=c[a],e=
0;this.moveToNextToken();){var g=this.currentValue();if(g===d){if(0===e)return!0;e--}else g===a&&e++}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,c=0;this.moveToPreviousToken();){var b=this.currentValue();if("("===b){if(0===c){a=!0;break}c--}else")"===b&&c++}return a};this.findToken=function(a,c){do{var b=
this.currentToken();if(b&&a(b))return b}while(this.moveToNextToken(c));return null};this.findTokenBwd=function(a,c){do{var b=this.currentToken();if(b&&a(b))return b}while(this.moveToPreviousToken(c));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 c=0;c<arguments.length;c++){var b=arguments[c];if(a===b||-1!==a.indexOf(b+".")||-1!==a.indexOf("."+b))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,c){var b=a.row,d=a.column,e=this.$tokens[b];null==e&&this.$codeModel&&this.$codeModel.$tokenizeUpToRow&&(this.$codeModel.$tokenizeUpToRow.call(this.$codeModel,b),e=this.$tokens[b]);if(e&&0<e.length&&e[0].column<=d){for(var f=0;f<e.length&&!(e[f].column>=d);f++);this.$row=b;this.$offset=f===e.length?f-1:c&&e[f].column===d?f:f-1;return!0}d=this.cloneCursor();d.$row=b;d.$offset=0;return d.moveToPreviousToken()?
(this.$row=d.$row,this.$offset=d.$offset,!0):!1};this.findOpeningBracket=function(c,b){a(c)||(c=[c]);var d=this.cloneCursor();do if(!d.bwdToMatchingToken()){var e=d.currentValue();if(b&&"{"===e)break;for(var f=0;f<c.length;f++)if(e===c[f])return this.$row=d.$row,this.$offset=d.$offset,!0}while(d.moveToPreviousToken());return!1};this.findOpeningBracketCountCommas=function(c,b){a(c)||(c=[c]);var d=this.cloneCursor(),e=0;do if(!d.bwdToMatchingToken()){var f=d.currentValue();","===f&&(e+=1);if(b&&"{"===
f)break;for(var g=0;g<c.length;g++)if(f===c[g])return this.$row=d.$row,this.$offset=d.$offset,e}while(d.moveToPreviousToken());return-1}}).call(l.prototype);var f=function(a,b,c,f){this.$tokens=a;this.$row=b||0;this.$offset=c||0;this.$codeModel=f};h.mixin(f.prototype,l.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 b(a,this)};var b=function(a,d){a.bwdOverClassySpecifiers();var c=a.currentValue();return","===c?b(a,d):":"===c?(d.$row=a.$row,d.$offset=a.$offset,!0):!1};this.bwdOverInitializationList=function(){var a=this.cloneCursor();
return this.doBwdOverInitializationList(a,this)};this.doBwdOverInitializationList=function(b,d){b.moveBackwardOverMatchingParens();if(!b.moveBackwardOverMatchingParens()&&!b.moveToPreviousToken())return!1;for(;"keyword"===b.currentType();)if(!b.moveToPreviousToken())return!1;if(b.moveToPreviousToken()){var c=b.currentValue();if(","===c)return this.doBwdOverInitializationList(b,d);if(":"===c&&(c=b.peekBwd().currentValue(),!a(["public","private","protected"],c)))return d.$row=b.$row,d.$offset=b.$offset,
!0}return!1}}).call(f.prototype);var b=function(a,b,c,f){this.$tokens=a;this.$row=b||0;this.$offset=c||0;this.$codeModel=f};h.mixin(b.prototype,l.prototype);(function(){function a(a){return 0===a.indexOf("'")?a.lastIndexOf("'")===a.length-1:0===a.indexOf('"')?a.lastIndexOf('"')===a.length-1:!1}function e(a){return"("===a||"["===a||"{"===a}function c(a){return")"===a||"]"===a||"}"===a}this.cloneCursor=function(){return new b(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 e(this.currentValue())};this.isRightBracket=function(){return c(this.currentValue())};this.isValidForEndOfStatement=function(){var b=this.currentType(),d=this.currentValue();return-1!==b.search(n)?c(d):a(d)||this.hasType("identifier","constant","variable")};this.isValidForStartOfStatement=function(){var b=
this.currentType();this.currentValue();if(-1!==b.search(n))return e(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(b.prototype);k.TokenCursor=l;k.CppTokenCursor=f;k.RTokenCursor=b});define("mode/token_utils",["require","exports","module"],function(a,k,h){a=function(a,n,l,f,b,d){this.$doc=a;this.$tokenizer=n;this.$tokens=l;this.$endStates=Array(a.getLength());this.$statePattern=f;this.$codeBeginPattern=b;this.$codeEndPattern=d};(function(){this.getTokenForPos=function(a,n,l){this.$tokenizeUpToRow(a.row);if(this.$tokens.length<=a.row)return null;for(var f=this.$tokens[a.row],b=0;b<f.length;b++){var d=f[b];if(n&&a.column==d.column)return d;if(a.column<=d.column)break;if(l&&a.column==
d.column+d.value.length||a.column<d.column+d.value.length)return d}return null};this.$tokenizeUpToRow=function(a){a=Math.min(a,this.$doc.getLength()-1);for(var g=0,l=!0;g<=a;g++)if(!l||!this.$endStates[g]){l=!1;var f=0===g?"start":this.$endStates[g-1],b=this.$doc.getLine(g);b=this.$tokenizer.getLineTokens(b,f,g);!this.$statePattern||this.$statePattern.test(b.state)||this.$statePattern.test(f)?this.$tokens[g]=this.$filterWhitespaceAndComments(b.tokens):this.$tokens[g]=[];b.state===this.$endStates[g]?
l=!0:this.$endStates[g]=b.state}l||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 l=a[g];a.splice(g,1);for(var f=l.value.length-1;0<=f;f--){var b={type:l.type,value:l.value.charAt(f),
column:l.column+f};a.splice(g,0,b)}}return a};this.$invalidateRow=function(a){this.$tokens[a]=null;this.$endStates[a]=null};this.$insertNewRows=function(a,h){for(var g=[a,0],f=0;f<h;f++)g.push(null);this.$tokens.splice.apply(this.$tokens,g);this.$endStates.splice.apply(this.$endStates,g)};this.$removeRows=function(a,h){this.$tokens.splice(a,h);this.$endStates.splice(a,h)};this.$walkParens=function(a,h,l){var f=/\bparen\b/;return a<h?function(){for(;a<=h;a++)for(var b=this.$tokens[a],d=0;d<b.length;d++)if(f.test(b[d].type)&&
!l(b[d].value,{row:a,column:b[d].column}))return!1;return!0}.call(this):function(){a=Math.max(0,a);for(h=Math.max(0,h);a>=h;a--)for(var b=this.$tokens[a],d=b.length-1;0<=d;d--)if(f.test(b[d].type)&&!l(b[d].value,{row:a,column:b[d].column}))return!1;return!0}.call(this)};this.$walkParensBalanced=function(a,h,l,f,b){var d=[],e=null;this.$walkParens(a,h,function(a,g){if(l&&l(d,a,g))return e=g,!1;if(/[\[({]/.test(a))if(d[d.length-1]===b[a])d.pop();else return!0;else d.push(a);return f&&f(d,a,g)?(e=g,
!1):!0});return e};this.$findNextSignificantToken=function(a,h){if(0==this.$tokens.length)return null;h=Math.min(h,this.$tokens.length-1);for(var g=a.row,f=a.column;g<=h;g++){for(var b=this.$tokens[g],d=0;d<b.length;d++)if(b[d].column+b[d].value.length>f)return{token:b[d],row:g,column:Math.max(b[d].column,f),offset:d};f=0}return null};this.findNextSignificantToken=function(a){return this.$findNextSignificantToken(a,this.$tokens.length-1)};this.$findPreviousSignificantToken=function(a,h){if(0==this.$tokens.length)return null;
h=Math.max(0,h);for(var g=Math.min(a.row,this.$tokens.length-1);g>=h;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 b=f.length-1;0<=b;b--)if(f[b].column<a.column)return{row:g,column:f[b].column,token:f[b],offset:b}}}return null}}).call(a.prototype);k.TokenUtils=a});define("mode/utils",["require","exports","module"],function(a,k,h){a("ace/range");var g=a("ace/token_iterator").TokenIterator,n=a("ace/unicode"),l=a("mode/yaml_highlight_rules").YamlHighlightRules;(function(){var a=this,b=new RegExp("^["+n.wordChars+"._]+","");this.construct=function(a,b){function c(){return a.apply(this,b)}c.prototype=a.prototype;return new c};this.contains=function(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)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,b){return-1!==a.indexOf(b,a.length-b.length)};this.escapeRegExp=function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
"\\$&")};this.embedRules=function(b,c,d,f,g,h,l){"undefined"===typeof h&&(h=["start"]);"undefined"===typeof l&&(l="start");h=a.asArray(h);l=b.$rules;b.embedRules(c,d+"-",[{token:"support.function.codeend",regex:g,onMatch:function(a,b,c,d,e){this.next=e.chunk.state||"start";delete e.chunk;return this.token}}]);for(b=0;b<h.length;b++)l[h[b]].unshift({token:"support.function.codebegin",regex:f,onMatch:function(a,b,c,e,f){f.chunk=f.chunk||{};f.chunk.state=b;this.next=d+"-start";return this.token}})};
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 b.test(a)};var d={"'":"'",'"':'"',"`":"`","{":"}","(":")","[":"]","<":">","}":"{",")":"(","]":"[",">":"<"};this.isBracket=function(a,b){return!b||"<"!==a&&">"!==a?"{"===a||"}"===
a||"("===a||")"===a||"["===a||"]"===a:!0};this.isOpeningBracket=function(a,b){return"{"===a||"("===a||"["===a||!!b&&"<"===a};this.isClosingBracket=function(a,b){return"}"===a||")"===a||"]"===a||!!b&&">"===a};this.getComplement=function(a,b){"undefined"===typeof b&&(b=d);var c=b[a];return"undefined"===typeof c?a:c};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,b){if("string"!==
typeof a||"string"!==typeof b||a.length<b.length)return!1;for(var c=0;c<b.length;c++)if(a[c]!==b[c])return!1;return!0};this.getTokenTypeRegex=function(a){return new RegExp("(?:^|[.])"+a+"(?:$|[.])","")};this.embedQuartoHighlightRules=function(a){a.embedRules(l,"quarto-yaml-");for(var b in a.$rules)"start"!==b&&-1===b.indexOf("-start")||a.$rules[b].unshift({token:"comment.doc.tag",regex:"^\\s*#[|]",push:"quarto-yaml-start"}),0===b.indexOf("quarto-yaml-")&&(a.$rules[b].unshift({token:["whitespace",
"comment.doc.tag"],regex:"^(\\s*)(#[|])",next:b}),a.$rules[b].unshift({token:"whitespace",regex:"^\\s*(?!#)",next:"pop"})),a.$rules["quarto-yaml-start"].unshift({token:"text",regex:"^\\s*(?!#)",next:"pop"}),a.$rules["quarto-yaml-multiline-string"].unshift({regex:/^(#[|])(\s*)/,onMatch:function(a,b,c,d,e){a=this.splitRegex.exec(a);this.next=d===a[1]+a[2]?b:e.yaml.indent>=a[2].length?e.yaml.state:b+"-rest";return[{type:"comment.doc.tag",value:a[1]},{type:"indent",value:a[2]}]}})}}).call(k)});define("mode/xml",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("ace/tokenizer").Tokenizer,l=a("mode/xml_highlight_rules").XmlHighlightRules,f=a("mode/xml_behavior").XmlBehaviour,b=a("mode/xml_fold_mode").FoldMode;a=function(){this.$tokenizer=new n((new l).getRules());this.$behaviour=new f;this.foldingRules=new b};h.inherits(a,g);(function(){this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)}}).call(a.prototype);k.Mode=a});define("mode/xml_behavior",["require","exports","module"],function(a,k,h){function g(a,d){var b=!0,c=a.type.split(".");d.split(".").forEach(function(a){if(-1==c.indexOf(a))return b=!1});return b}h=a("ace/lib/oop");var n=a("ace/mode/behaviour").Behaviour,l=a("ace/mode/behaviour/cstyle").CstyleBehaviour,f=a("ace/token_iterator").TokenIterator;a=function(){this.inherit(l,["string_dquotes"]);this.add("autoclosing","insertion",function(a,d,e,c,h){if(">"==h){a=e.getCursorPosition();e=new f(c,a.row,a.column);
c=e.getCurrentToken();d=!1;if(c&&(g(c,"meta.tag")||g(c,"text")&&c.value.match("/")))d=!0;else{do c=e.stepBackward();while(c&&(g(c,"string")||g(c,"keyword.operator")||g(c,"entity.attribute-name")||g(c,"text")))}if(c&&g(c,"meta.tag-name")&&!e.stepBackward().value.match("/"))return e=c.value,d&&(e=e.substring(0,a.column-c.start)),{text:"></"+e+">",selection:[1,1]}}});this.add("autoindent","insertion",function(a,d,e,c,f){if("\n"==f&&(d=e.getCursorPosition(),"</"==c.doc.getLine(d.row).substring(d.column,
d.column+2)))return a=this.$getIndent(c.doc.getLine(d.row))+c.getTabString(),c=this.$getIndent(c.doc.getLine(d.row)),{text:"\n"+a+"\n"+c,selection:[1,a.length,1,a.length]}})};h.inherits(a,n);k.XmlBehaviour=a});define("mode/xml_fold_mode",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("ace/lib/lang"),n=a("ace/range").Range,l=a("ace/mode/folding/fold_mode").FoldMode,f=a("ace/token_iterator").TokenIterator;a=k.FoldMode=function(a){l.call(this);this.voidElements=a||{}};h.inherits(a,l);(function(){this.getFoldWidget=function(a,d,e){a=this._getFirstTagInLine(a,e);return a.closing?"markbeginend"==d?"end":"":!a.tagName||this.voidElements[a.tagName.toLowerCase()]||a.selfClosing||-1!==
a.value.indexOf("/"+a.tagName)?"":"start"};this._getFirstTagInLine=function(a,d){for(var b=a.getTokens(d),c="",f=0;f<b.length;f++){var h=b[f];c=0===h.type.indexOf("meta.tag")?c+h.value:c+g.stringRepeat(" ",h.value.length)}return this._parseTag(c)};this.tagRe=/^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;this._parseTag=function(a){var b=this.tagRe.exec(a),e=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]?e+b[1].length:e}};this._readTagForward=function(a){var b=a.getCurrentToken();if(!b)return null;var e="",c;do if(0===b.type.indexOf("meta.tag")&&(c||(c={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()}),e+=b.value,-1!==e.indexOf(">")))return e=this._parseTag(e),e.start=c,e.end={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length},a.stepForward(),e;while(b=a.stepForward());return null};this._readTagBackward=function(a){var b=a.getCurrentToken();
if(!b)return null;var e="",c;do if(0===b.type.indexOf("meta.tag")&&(c||(c={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length}),e=b.value+e,-1!==e.indexOf("<")))return b=this._parseTag(e),b.end=c,b.start={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()},a.stepBackward(),b;while(b=a.stepBackward());return null};this._pop=function(a,d){for(;a.length;){var b=a[a.length-1];if(d&&b.tagName!=d.tagName)if(this.voidElements[d.tagName])break;else if(this.voidElements[b.tagName])a.pop();
else return null;else return a.pop()}};this.getFoldWidgetRange=function(a,d,e){var b=this._getFirstTagInLine(a,e);if(!b.match)return null;d=[];if(b.closing||b.selfClosing)for(a=new f(a,e,b.column+b.match.length),b={row:e,column:b.column};e=this._readTagBackward(a);){if(e.selfClosing)if(d.length)continue;else return e.start.column+=e.tagName.length+2,e.end.column-=2,n.fromPoints(e.start,e.end);if(e.closing)d.push(e);else if(this._pop(d,e),0==d.length)return e.start.column+=e.tagName.length+2,n.fromPoints(e.start,
b)}else for(a=new f(a,e,b.column),b={row:e,column:b.column+b.tagName.length+2};e=this._readTagForward(a);){if(e.selfClosing)if(d.length)continue;else return e.start.column+=e.tagName.length+2,e.end.column-=2,n.fromPoints(e.start,e.end);if(e.closing){if(this._pop(d,e),0==d.length)return n.fromPoints(b,e.start)}else d.push(e)}}}).call(a.prototype)});define("mode/xml_highlight_rules",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");var g=a("mode/xml_util");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var n=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")};h.inherits(n,a);k.XmlHighlightRules=n});define("mode/xml_util",["require","exports","module"],function(a,k,h){function g(a,g){return[{token:"string",merge:!0,regex:".*?"+a,next:g},{token:"string",merge:!0,regex:".+"}]}k.tag=function(a,h,f,b){a[h]=[{token:"text",regex:"\\s+"},{token:function(a){return b&&b[a]?"meta.tag.tag-name."+b[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,h){h=a("ace/lib/oop");var g=a("ace/mode/text").Mode,n=a("mode/yaml_highlight_rules").YamlHighlightRules,l=a("ace/mode/matching_brace_outdent").MatchingBraceOutdent,f=a("ace/mode/folding/coffee").FoldMode;a=function(){this.HighlightRules=n;this.$outdent=new l;this.foldingRules=new f;this.$behaviour=this.$defaultBehaviour};h.inherits(a,g);(function(){this.lineCommentStart="#";this.getNextLineIndent=function(a,d,e){var b=this.$getIndent(d);
"start"==a&&d.match(/^.*[\{\(\[]\s*$/)&&(b+=e);return b};this.checkOutdent=function(a,d,e){return this.$outdent.checkOutdent(d,e)};this.autoOutdent=function(a,d,e){this.$outdent.autoOutdent(d,e)};this.$id="mode/yaml"}).call(a.prototype);k.Mode=a});define("mode/yaml_highlight_rules",["require","exports","module"],function(a,k,h){h=a("ace/lib/oop");a=a("ace/mode/text_highlight_rules").TextHighlightRules;var g=function(a){return{token:["constant.numeric","text"],regex:"([-+]?(?:(?:\\d+(?:\\.\\d*)?)|(?:\\.\\d+))(?:[eE][+-]?\\d*)?)(\\s*)"+a}},n=function(){var a={},f=function(a){return{token:["constant.language.boolean","text"],regex:"\\b(true|false|TRUE|FALSE|True|False|yes|no|~)(\\s*)"+a}};a["#string"]=[{token:"string",regex:"'",push:"qstring"},
{token:"string",regex:'"',push:"qqstring"}];a.start=[{token:"comment",regex:"#.*"},{token:"whitespace",regex:"\\s+"},{token:"list.markup",regex:/\b(?:-{3}|\.{3})\s*(?=#|$)/},{token:"list.markup.keyword.operator",regex:/[-?](?=$|\s)/},{token:"constant",regex:"!![\\w//]+"},{token:"constant.language",regex:"[&\\*][a-zA-Z0-9-_]+"},{token:["meta.tag","keyword","meta.tag","keyword.operator"],regex:/\b(\s*[\w\-.]*?)(:{2,3})(\s*[\w\-.]*?)(:(?:\s+|$))/},{token:["meta.tag","keyword.operator"],regex:/\b(\s*[\w\-.]*?)(:(?:\s+|$))/},
{token:"keyword.operator",regex:"<<\\w*:\\w*"},{token:"keyword.operator",regex:"-\\s*(?=[{])"},{include:"#string"},{token:"string",regex:/[|>][-+\d\s]*$/,onMatch:function(a,d,e,c,f){a=/^(?:#[|])?(\s*)/.exec(c)[1];f.yaml=f.yaml||{};f.yaml.state=d;f.yaml.indent=a.length;this.next=d.replace(/start$/,"multiline-string");return this.token}},g("(?=(?:$|#))"),f("(?=(?:$|#))"),{token:"paren.lparen.keyword.operator",regex:"\\[",push:"list"},{token:"paren.lparen.keyword.operator",regex:"\\{",push:"dictionary"},
{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:["text","whitespace","comment"],regex:"(.+?)(?:$|(\\s+)(#.*))"}];a.list=[{token:"paren.rparen.keyword.operator",regex:"\\]",next:"pop"},{token:"whitespace",regex:"\\s+"},{token:"punctuation.keyword.operator",regex:","},{token:"paren.lparen.keyword.operator",regex:"\\[",push:"list"},{token:"paren.lparen.keyword.operator",regex:"\\{",push:"dictionary"},{include:"#string"},g("(?=(?:$|[,\\]]))"),f("(?=(?:$|[,\\]]))"),{token:"text",
regex:"[^,\\]]+"}];a.dictionary=[{token:"paren.rparen.keyword.operator",regex:"\\}",next:"pop"},{token:"whitespace",regex:"\\s+"},{token:"punctuation.keyword.operator",regex:"[:,]"},{token:"paren.lparen.keyword.operator",regex:"\\[",push:"list"},{token:"paren.lparen.keyword.operator",regex:"\\{",push:"dictionary"},{include:"#string"},g("(?=(?:$|[:,}]))"),f("(?=(?:$|[:,}]))"),{token:"text",regex:"[^}:,]+"}];a.qstring=[{token:"constant.language.escape",regex:"''"},{token:"string",regex:"'",next:"pop"},
{token:"string",regex:"[^']+"}];a.qqstring=[{token:"constant.language.escape",regex:"\\\\."},{token:"string",regex:'"',next:"pop"},{token:"string",regex:'[^\\\\"]+'}];a["multiline-string"]=[{token:"string",regex:/\s*/,onMatch:function(a,d,e,c,f){if(/^\s*(?:#[|])?\s*$/.test(c))return this.next=d,this.token;this.next=f.yaml.indent>=a.length?f.yaml.state:d+"-rest";return this.token}}];a["multiline-string-rest"]=[{token:"string",regex:".+",next:"multiline-string"}];this.$rules=a;this.normalizeRules()};
h.inherits(n,a);k.YamlHighlightRules=n});define("theme/default",["require","exports","module"],function(a,k,h){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,h){var g=a("ace/edit_session").EditSession,n=a("ace/editor").Editor;a("ace/lib/event_emitter");a("util/expand_selection");var l=a("ace/range").Range,f=a("ace/virtual_renderer").VirtualRenderer,b=a("ace/mode/text").Mode,d=a("ace/undomanager").UndoManager,e=a("mode/utils");a("ace/lib/event");h=a("ace/lib/oop");a("mixins/token_iterator");var c=function(a,b){b.renderer=a;n.call(this,a,b);this.setBehavioursEnabled(!0)};h.inherits(c,n);
(function(){this.$highlightBrackets=function(){if(this.session.selection.isEmpty())n.prototype.$highlightBrackets.call(this);else{var a=this.session;a.$bracketHighlight&&(a.$bracketHighlight.markerIds.forEach(function(b){a.removeMarker(b)}),a.$bracketHighlight=null)}};this.insert=function(a,b){if(!this.session.selection.isEmpty()){var c=[];"quotes"===this.$surroundSelection?c=["'",'"',"`"]:"quotes_and_brackets"===this.$surroundSelection&&(c="'\"`({[".split(""));if("quotes_and_brackets"===this.$surroundSelection){var d=
this.session.$mode;if(/\/markdown$/.test(d.$id))c.push("*","_");else{var f=this.getCursorPosition();d.getLanguageMode&&"Markdown"===d.getLanguageMode(f)&&c.push("*","_")}}if(e.contains(c,a))return c=e.getComplement(a),this.session.replace(this.session.selection.getRange(),a+this.session.getTextRange()+c)}return n.prototype.insert.call(this,a,b)};this.remove=function(a){return this.session.getMode().wrapRemove?this.session.getMode().wrapRemove(this,n.prototype.remove,a):n.prototype.remove.call(this,
a)};this.undo=function(){n.prototype.undo.call(this);this._dispatchEvent("undo")};this.redo=function(){n.prototype.redo.call(this);this._dispatchEvent("redo")};this.onPaste=function(a,b){n.prototype.onPaste.call(this,a.replace(/\r\n|\n\r|\r/g,"\n"),b)}}).call(c.prototype);var r=function(a,b){g.call(this,a,b)};h.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 c=a.start.row;a=a.end.row;0===c&&(this.applyIndent(0,""),c++);for(var d=c;d<=a;d++){var f=e.getPrimaryState(this,d-1);if(!e.endsWith(f,"qstring")&&"rawstring"!==f){var g=b.getNextLineIndent(f,this.getLine(d-1),this.getTabString(),d-1,!0);this.applyIndent(d,g);b.autoOutdent(f,this,d)}}b=b.codeModel;"undefined"!==typeof b&&(b=b.alignContinuationSlashes,"undefined"!==typeof b&&b(this.getDocument(),{start:c,end:a}))}};this.applyIndent=function(a,
b){var c=this.getLine(a).match(/^\s*/g)[0].length;this.replace(new l(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(){d.call(this)};h.inherits(q,d);(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)};h.inherits(p,f);(function(){this.setTheme=function(a){a&&f.prototype.setTheme.call(this,a)}}).call(p.prototype);k.RStudioEditor=c;k.loadEditor=function(d){function e(a){f.editor.commands.removeCommand(a)}var f={};d.env=f;d=new p(d,"");var g=new r("");d=new c(d,g);f.editor=d;g=d.getSession();g.setMode(new b);g.setUndoManager(new q);d=a("ace/config");d.set("basePath","ace");d.set("workerPath","js/workers");d.setDefaultValue("session","useWorker",!1);e("findnext");
e("findprevious");e("find");e("replace");e("togglecomment");e("gotoline");e("foldall");e("unfoldall");return f.editor}});define("rstudio/snippets",["require","exports","module"],function(a,k,h){k.toSnippetText=function(a){for(var g=a.length,h="",f=0;f<g;f++){var b=a[f];h+="snippet "+b.name+"\n\t"+b.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,h){h=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"}];h.normalizeSnippets(g);k.snippetText=h.toSnippetText(g);a.register(g,"c_cpp")});define("rstudio/snippets/markdown",["require","exports","module"],function(a,k,h){h=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```"}];h.normalizeSnippets(g);k.snippetText=h.toSnippetText(g);a.register(g,"markdown")});define("rstudio/snippets/r",["require","exports","module"],function(a,k,h){h=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}"}];
h.normalizeSnippets(g);k.snippetText=h.toSnippetText(g);a.register(g,"r")});define("rstudio/snippets/stan",["require","exports","module"],function(a,k,h){h=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}"}];h.normalizeSnippets(g);k.snippetText=h.toSnippetText(g);a.register(g,"stan")});define("rstudio/snippets/yaml",["require","exports","module"],function(a,k,h){h=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}"}];h.normalizeSnippets(g);k.snippetText=h.toSnippetText(g);a.register(g,"yaml")});