/* content from:
 * https://github.com/marijnh/CodeMirror/raw/master/js/codemirror.js
 * closure compiled 2011-05-17 */
var CodeMirrorConfig=window.CodeMirrorConfig||{},CodeMirror=function(){function n(a,b){for(var c in b)a.hasOwnProperty(c)||(a[c]=b[c])}function s(a,b){for(var c=0;c<a.length;c++)b(a[c])}function o(a){return document.createElementNS&&document.documentElement.namespaceURI!==null?document.createElementNS("http://www.w3.org/1999/xhtml",a):document.createElement(a)}function t(a,b){var c=o("div"),d=o("div");c.style.position="absolute";c.style.height="100%";if(c.style.setExpression)try{c.style.setExpression("height",
"this.previousSibling.offsetHeight + 'px'")}catch(g){}c.style.top="0px";c.style.left="0px";c.style.overflow="hidden";a.appendChild(c);d.className="CodeMirror-line-numbers";c.appendChild(d);d.innerHTML="<div>"+b+"</div>";return c}function w(a){if(typeof a.parserfile=="string")a.parserfile=[a.parserfile];if(typeof a.basefiles=="string")a.basefiles=[a.basefiles];if(typeof a.stylesheet=="string")a.stylesheet=[a.stylesheet];var b=' spellcheck="'+(a.disableSpellcheck?"false":"true")+'"',c=['<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html'+
b+"><head>"];c.push('<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>');var d=a.noScriptCaching?"?nocache="+(new Date).getTime().toString(16):"";s(a.stylesheet,function(a){c.push('<link rel="stylesheet" type="text/css" href="'+a+d+'"/>')});s(a.basefiles.concat(a.parserfile),function(b){/^https?:/.test(b)||(b=a.path+b);c.push('<script type="text/javascript" src="'+b+d+'"><\/script>')});c.push('</head><body style="border-width: 0;" class="editbox"'+b+"></body></html>");return c.join("")}
function h(a,b){this.options=b=b||{};n(b,CodeMirrorConfig);if(b.dumbTabs)b.tabMode="spaces";else if(b.normalTab)b.tabMode="default";if(b.cursorActivity)b.onCursorActivity=b.cursorActivity;var c=this.frame=o("iframe");if(b.iframeClass)c.className=b.iframeClass;c.frameBorder=0;c.style.border="0";c.style.width="100%";c.style.height="100%";c.style.display="block";var d=this.wrapping=o("div");d.style.position="relative";d.className="CodeMirror-wrapping";d.style.width=b.width;d.style.height=b.height=="dynamic"?
b.minHeight+"px":b.height;var g=this.textareaHack=o("textarea");d.appendChild(g);g.style.position="absolute";g.style.left="-10000px";g.style.width="10px";g.tabIndex=1E5;c.CodeMirror=this;b.domain&&x?(this.html=w(b),c.src="javascript:(function(){document.open();"+(b.domain?'document.domain="'+b.domain+'";':"")+"document.write(window.frameElement.CodeMirror.html);document.close();})()"):c.src="javascript:;";a.appendChild?a.appendChild(d):a(d);d.appendChild(c);if(b.lineNumbers)this.lineNumbers=t(d,b.firstLineNumber);
this.win=c.contentWindow;if(!b.domain||!x)this.win.document.open(),this.win.document.write(w(b)),this.win.document.close()}n(CodeMirrorConfig,{stylesheet:[],path:"",parserfile:[],basefiles:["util.js","stringstream.js","select.js","undo.js","editor.js","tokenize.js"],iframeClass:null,passDelay:200,passTime:50,lineNumberDelay:200,lineNumberTime:50,continuousScanning:!1,saveFunction:null,onLoad:null,onChange:null,undoDepth:50,undoDelay:800,disableSpellcheck:!0,textWrapping:!0,readOnly:!1,width:"",height:"300px",
minHeight:100,onDynamicHeightChange:null,autoMatchParens:!1,markParen:null,unmarkParen:null,parserConfig:null,tabMode:"indent",enterMode:"indent",electricChars:!0,reindentOnLoad:!1,activeTokens:null,onCursorActivity:null,lineNumbers:!1,firstLineNumber:1,onLineNumberClick:null,indentUnit:2,domain:null,noScriptCaching:!1,incrementalLoading:!1});var x=document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent);h.prototype={init:function(){this.options.initCallback&&this.options.initCallback(this);
if(this.options.onLoad)this.options.onLoad(this);this.options.lineNumbers&&this.activateLineNumbers();this.options.reindentOnLoad&&this.reindent();this.options.height=="dynamic"&&this.setDynamicHeight()},getCode:function(){return this.editor.getCode()},setCode:function(a){this.editor.importCode(a)},selection:function(){this.focusIfIE();return this.editor.selectedText()},reindent:function(){this.editor.reindent()},reindentSelection:function(){this.focusIfIE();this.editor.reindentSelection(null)},focusIfIE:function(){this.win.select.ie_selection&&
document.activeElement!=this.frame&&this.focus()},focus:function(){this.win.focus();this.editor.selectionSnapshot&&this.win.select.setBookmark(this.win.document.body,this.editor.selectionSnapshot)},replaceSelection:function(a){this.focus();this.editor.replaceSelection(a);return!0},replaceChars:function(a,b,c){this.editor.replaceChars(a,b,c)},getSearchCursor:function(a,b,c){return this.editor.getSearchCursor(a,b,c)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},
historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(a,b){this.editor.grabKeys(a,b)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(a,b){this.editor.setParser(a,b)},setSpellcheck:function(a){this.win.document.body.spellcheck=a},setStylesheet:function(a){typeof a==="string"&&(a=[a]);for(var b={},c={},d=this.win.document.getElementsByTagName("link"),g=0,e;e=d[g];g++)if(e.rel.indexOf("stylesheet")!==
-1)for(var f=0;f<a.length;f++){var k=a[f];e.href.substring(e.href.length-k.length)===k&&(b[e.href]=!0,c[k]=!0)}for(g=0;e=d[g];g++)if(e.rel.indexOf("stylesheet")!==-1)e.disabled=!(e.href in b);for(f=0;f<a.length;f++)if(k=a[f],!(k in c))e=this.win.document.createElement("link"),e.rel="stylesheet",e.type="text/css",e.href=k,this.win.document.getElementsByTagName("head")[0].appendChild(e)},setTextWrapping:function(a){if(a!=this.options.textWrapping)this.win.document.body.style.whiteSpace=a?"":"nowrap",
this.options.textWrapping=a,this.lineNumbers&&(this.setLineNumbers(!1),this.setLineNumbers(!0))},setIndentUnit:function(a){this.win.indentUnit=a},setUndoDepth:function(a){this.editor.history.maxDepth=a},setTabMode:function(a){this.options.tabMode=a},setEnterMode:function(a){this.options.enterMode=a},setLineNumbers:function(a){if(a&&!this.lineNumbers)this.lineNumbers=t(this.wrapping,this.options.firstLineNumber),this.activateLineNumbers();else if(!a&&this.lineNumbers)this.wrapping.removeChild(this.lineNumbers),
this.wrapping.style.paddingLeft="",this.lineNumbers=null},cursorPosition:function(a){this.focusIfIE();return this.editor.cursorPosition(a)},firstLine:function(){return this.editor.firstLine()},lastLine:function(){return this.editor.lastLine()},nextLine:function(a){return this.editor.nextLine(a)},prevLine:function(a){return this.editor.prevLine(a)},lineContent:function(a){return this.editor.lineContent(a)},setLineContent:function(a,b){this.editor.setLineContent(a,b)},removeLine:function(a){this.editor.removeLine(a)},
insertIntoLine:function(a,b,c){this.editor.insertIntoLine(a,b,c)},selectLines:function(a,b,c,d){this.win.focus();this.editor.selectLines(a,b,c,d)},nthLine:function(a){for(var b=this.firstLine();a>1&&b!==!1;a--)b=this.nextLine(b);return b},lineNumber:function(a){for(var b=0;a!==!1;)b++,a=this.prevLine(a);return b},jumpToLine:function(a){typeof a=="number"&&(a=this.nthLine(a));this.selectLines(a,0);this.win.focus()},currentLine:function(){return this.lineNumber(this.cursorLine())},cursorLine:function(){return this.cursorPosition().line},
cursorCoords:function(a){return this.editor.cursorCoords(a)},activateLineNumbers:function(){function a(){if(e.offsetWidth!=0){for(var a=e;a.parentNode;a=a.parentNode);if(!i.parentNode||a!=document||!f.Editor){try{v()}catch(b){}clearInterval(n)}else if(i.offsetWidth!=h)h=i.offsetWidth,e.parentNode.style.paddingLeft=h+"px"}}function b(){i.scrollTop=u.scrollTop||k.documentElement.scrollTop||0}function c(a){var b=m.firstChild.offsetHeight;if(b!=0)for(var b=Math.ceil((50+Math.max(u.offsetHeight,Math.max(e.offsetHeight,
u.scrollHeight||0)))/b),c=m.childNodes.length;c<=b;c++){var d=o("div");d.appendChild(document.createTextNode(a?String(c+j.options.firstLineNumber):"\u00a0"));m.appendChild(d)}}function d(){function a(){c(!0);b()}j.updateNumbers=a;var d=f.addEventHandler(f,"scroll",b,!0),e=f.addEventHandler(f,"resize",a,!0);v=function(){d();e();if(j.updateNumbers==a)j.updateNumbers=null};a()}function g(){function a(b,c){h||(h=m.appendChild(o("div")));n&&n(h,c,b);p.push(h);p.push(b);r=h.offsetHeight+h.offsetTop;h=h.nextSibling}
function d(){for(var a=0;a<p.length;a+=2)p[a].innerHTML=p[a+1];p=[]}function e(){if(m.parentNode&&m.parentNode==j.lineNumbers){for(var c=(new Date).getTime()+j.options.lineNumberTime;l;){for(a(k++,l.previousSibling);l&&!f.isBR(l);l=l.nextSibling)for(var g=l.offsetTop+l.offsetHeight;m.offsetHeight&&g-3>r;){var i=r;a("&nbsp;");if(r<=i)break}if(l)l=l.nextSibling;if((new Date).getTime()>c){d();q=setTimeout(e,j.options.lineNumberDelay);return}}for(;h;)a(k++);d();b()}}function g(a){b();c(a);l=u.firstChild;
h=m.firstChild;r=0;k=j.options.firstLineNumber;e()}function i(){q&&clearTimeout(q);j.editor.allClean()?g():q=setTimeout(i,200)}var l,h,k,r,p=[],n=j.options.styleNumbers;g(!0);var q=null;j.updateNumbers=i;var s=f.addEventHandler(f,"scroll",b,!0),t=f.addEventHandler(f,"resize",i,!0);v=function(){q&&clearTimeout(q);if(j.updateNumbers==i)j.updateNumbers=null;s();t()}}var e=this.frame,f=e.contentWindow,k=f.document,u=k.body,i=this.lineNumbers,m=i.firstChild,j=this,h=null;i.onclick=function(a){var b=j.options.onLineNumberClick;
if(b){var a=(a||window.event).target||(a||window.event).srcElement,c=a==i?NaN:Number(a.innerHTML);isNaN(c)||b(c,a)}};var v=function(){};a();var n=setInterval(a,500);(this.options.textWrapping||this.options.styleNumbers?g:d)()},setDynamicHeight:function(){function a(){for(var a=0,c=g.lastChild,f;c&&d.isBR(c);)c.hackBR||a++,c=c.previousSibling;c?(e=c.offsetHeight,f=c.offsetTop+(1+a)*e):e&&(f=a*e);if(f&&(b.options.onDynamicHeightChange&&(f=b.options.onDynamicHeightChange(f)),f))b.wrapping.style.height=
Math.max(h+f,b.options.minHeight)+"px"}var b=this,c=b.options.onCursorActivity,d=b.win,g=d.document.body,e=null,f=null,h=2*b.frame.offsetTop;g.style.overflowY="hidden";d.document.documentElement.style.overflowY="hidden";this.frame.scrolling="no";setTimeout(a,300);b.options.onCursorActivity=function(b){c&&c(b);clearTimeout(f);f=setTimeout(a,100)}}};h.InvalidLineHandle={toString:function(){return"CodeMirror.InvalidLineHandle"}};h.replace=function(a){typeof a=="string"&&(a=document.getElementById(a));
return function(b){a.parentNode.replaceChild(b,a)}};h.fromTextArea=function(a,b){function c(){a.value=e.getCode()}typeof a=="string"&&(a=document.getElementById(a));b=b||{};if(a.style.width&&b.width==null)b.width=a.style.width;if(a.style.height&&b.height==null)b.height=a.style.height;if(b.content==null)b.content=a.value;if(a.form&&(typeof a.form.addEventListener=="function"?a.form.addEventListener("submit",c,!1):a.form.attachEvent("onsubmit",c),typeof a.form.submit=="function")){var d=a.form.submit,
g=function(){c();a.form.submit=d;a.form.submit();a.form.submit=g};a.form.submit=g}a.style.display="none";var e=new h(function(b){a.nextSibling?a.parentNode.insertBefore(b,a.nextSibling):a.parentNode.appendChild(b)},b);e.save=c;e.toTextArea=function(){c();a.parentNode.removeChild(e.wrapping);a.style.display="";if(a.form){if(typeof a.form.submit=="function")a.form.submit=d;typeof a.form.removeEventListener=="function"?a.form.removeEventListener("submit",c,!1):a.form.detachEvent("onsubmit",c)}};return e};
h.isProbablySupported=function(){var a;return window.opera?Number(window.opera.version())>=9.52:/Apple Computer, Inc/.test(navigator.vendor)&&(a=navigator.userAgent.match(/Version\/(\d+(?:\.\d+)?)\./))?Number(a[1])>=3:document.selection&&window.ActiveXObject&&(a=navigator.userAgent.match(/MSIE (\d+(?:\.\d*)?)\b/))?Number(a[1])>=6:(a=navigator.userAgent.match(/gecko\/(\d{8})/i))?Number(a[1])>=20050901:(a=navigator.userAgent.match(/AppleWebKit\/(\d+)/))?Number(a[1])>=525:null};return h}();