{"size": 60717, "ext": "js", "max_stars_repo_path": "lib/oculus/server/public/js/codemirror.min.js", "max_stars_repo_name": "paulrosania/oculus", "max_stars_repo_stars_event_min_datetime": "2015-07-16T22:18:27.000Z", "max_stars_repo_stars_event_max_datetime": "2020-09-02T21:55:13.000Z", "max_issues_repo_path": "lib/oculus/server/public/js/codemirror.min.js", "max_issues_repo_name": "shykes/oculus", "max_issues_repo_issues_event_min_datetime": "2021-03-19T18:29:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-03-19T18:29:41.000Z", "max_forks_repo_path": "lib/oculus/server/public/js/codemirror.min.js", "max_forks_repo_name": "shykes/oculus", "max_forks_repo_forks_event_min_datetime": "2015-07-15T18:17:11.000Z", "max_forks_repo_forks_event_max_datetime": "2016-12-16T06:35:41.000Z"}
{"max_stars_count": 12, "max_issues_count": 2, "max_forks_count": 3, "avg_line_length": 60717.0, "max_line_length": 60717, "alphanum_fraction": 0.6689395062}
var CodeMirror=function(){function a(d,e){function Wb(a){return a>=0&&a<tb.size}function Yb(a){return v(tb,a)}function Zb(a,b){Kb=!0;var c=b-a.height;for(var d=a;d;d=d.parent)d.height+=c}function $b(a){var b={line:0,ch:0};oc(b,{line:tb.size-1,ch:Yb(tb.size-1).text.length},fb(a),b,b),Eb=!0}function _b(a){var b=[];return tb.iter(0,tb.size,function(a){b.push(a.text)}),b.join("\n")}function ac(a){function j(a){var b=Hd(a,!0);if(b&&!Z(b,g)){vb||mc(),g=b,Pc(d,b),Eb=!1;var c=Ic();if(b.line>=c.to||b.line<c.from)h=setTimeout(Ud(function(){j(a)}),150)}}function k(a){clearTimeout(h);var b=Hd(a);b&&Pc(d,b),C(a),Ec(),Eb=!0,l(),i()}Oc(H(a,"shiftKey"));for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==U&&b!=V)return;for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==ib)return f.onGutterClick&&f.onGutterClick(Xb,db(ib.childNodes,b)+Nb,a),C(a);var d=Hd(a);switch(G(a)){case 3:L&&!c&&Id(a);return;case 2:d&&Sc(d.line,d.ch,!0);return}if(!d){F(a)==T&&C(a);return}vb||mc();var e=+(new Date);if(zb&&zb.time>e-400&&Z(zb.pos,d))return C(a),setTimeout(Ec,20),_c(d.line);if(yb&&yb.time>e-400&&Z(yb.pos,d))return zb={time:e,pos:d},C(a),$c(d);yb={time:e,pos:d};var g=d,h;if(f.dragDrop&&S&&!f.readOnly&&!Z(wb.from,wb.to)&&!$(d,wb.from)&&!$(wb.to,d)){P&&(jb.draggable=!0);var i=I(document,"mouseup",Ud(function(b){P&&(jb.draggable=!1),Bb=!1,i(),Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)<10&&(C(b),Sc(d.line,d.ch,!0),Ec())}),!0);Bb=!0,jb.dragDrop&&jb.dragDrop();return}C(a),Sc(d.line,d.ch,!0);var l=I(document,"mousemove",Ud(function(a){clearTimeout(h),C(a),!M&&!G(a)?k(a):j(a)}),!0),i=I(document,"mouseup",Ud(k),!0)}function bc(a){for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==ib)return C(a);var c=Hd(a);if(!c)return;zb={time:+(new Date),pos:c},C(a),$c(c)}function cc(a){a.preventDefault();var b=Hd(a,!0),c=a.dataTransfer.files;if(!b||f.readOnly)return;if(c&&c.length&&window.FileReader&&window.File){function d(a,c){var d=new FileReader;d.onload=function(){g[c]=d.result,++h==e&&(b=Uc(b),Ud(function(){var a=tc(g.join(""),b,b);Pc(b,a)})())},d.readAsText(a)}var e=c.length,g=Array(e),h=0;for(var i=0;i<e;++i)d(c[i],i)}else try{var g=a.dataTransfer.getData("Text");if(g){var j=wb.from,k=wb.to;Pc(b,b),Bb&&tc("",j,k),uc(g),Ec()}}catch(a){}}function dc(a){var b=xc();a.dataTransfer.setData("Text",b);if(L||Q){var c=document.createElement("img");c.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",a.dataTransfer.setDragImage(c,0,0)}}function ec(a,b){if(typeof a=="string"){a=h[a];if(!a)return!1}var c=xb;try{f.readOnly&&(Db=!0),b&&(xb=null),a(Xb)}catch(d){if(d!=K)throw d;return!1}finally{xb=c,Db=!1}return!0}function fc(a){var b=j(f.keyMap),c=b.auto;clearTimeout(ic),c&&!l(a)&&(ic=setTimeout(function(){j(f.keyMap)==b&&(f.keyMap=c.call?c.call(null,Xb):c)},50));var d=hb[H(a,"keyCode")],e=!1;return d==null||a.altGraphKey?!1:(H(a,"altKey")&&(d="Alt-"+d),H(a,"ctrlKey")&&(d="Ctrl-"+d),H(a,"metaKey")&&(d="Cmd-"+d),H(a,"shiftKey")?e=k("Shift-"+d,f.extraKeys,f.keyMap,function(a){return ec(a,!0)})||k(d,f.extraKeys,f.keyMap,function(a){if(typeof a=="string"&&/^go[A-Z]/.test(a))return ec(a)}):e=k(d,f.extraKeys,f.keyMap,ec),e&&(C(a),M&&(a.oldKeyCode=a.keyCode,a.keyCode=0)),e)}function gc(a,b){var c=k("'"+b+"'",f.extraKeys,f.keyMap,ec);return c&&C(a),c}function jc(a){vb||mc(),M&&a.keyCode==27&&(a.returnValue=!1),yc&&Cc()&&(yc=!1);if(f.onKeyEvent&&f.onKeyEvent(Xb,B(a)))return;var b=H(a,"keyCode");Oc(b==16||H(a,"shiftKey"));var d=fc(a);window.opera&&(hc=d?b:null,!d&&b==88&&H(a,c?"metaKey":"ctrlKey")&&uc(""))}function kc(a){yc&&Cc();if(f.onKeyEvent&&f.onKeyEvent(Xb,B(a)))return;var b=H(a,"keyCode"),c=H(a,"charCode");if(window.opera&&b==hc){hc=null,C(a);return}if((window.opera&&!a.which||R)&&fc(a))return;var d=String.fromCharCode(c==null?b:c);f.electricChars&&sb.electricChars&&f.smartIndent&&!f.readOnly&&sb.electricChars.indexOf(d)>-1&&setTimeout(Ud(function(){bd(wb.to.line,"smart")}),75);if(gc(a,d))return;Ac()}function lc(a){if(f.onKeyEvent&&f.onKeyEvent(Xb,B(a)))return;H(a,"keyCode")==16&&(xb=null)}function mc(){if(f.readOnly=="nocursor")return;vb||(f.onFocus&&f.onFocus(Xb),vb=!0,s.className.search(/\bCodeMirror-focused\b/)==-1&&(s.className+=" CodeMirror-focused"),Jb||Dc(!0)),zc(),Jd()}function nc(){vb&&(f.onBlur&&f.onBlur(Xb),vb=!1,Qb&&Ud(function(){Qb&&(Qb(),Qb=null)})(),s.className=s.className.replace(" CodeMirror-focused","")),clearInterval(rb),setTimeout(function(){vb||(xb=null)},150)}function oc(a,b,c,d,e){if(Db)return;if(Ub){var g=[];tb.iter(a.line,b.line+1,function(a){g.push(a.text)}),Ub.addChange(a.line,c.length,g);while(Ub.done.length>f.undoDepth)Ub.done.shift()}sc(a,b,c,d,e)}function pc(a,b){if(!a.length)return;var c=a.pop(),d=[];for(var e=c.length-1;e>=0;e-=1){var f=c[e],g=[],h=f.start+f.added;tb.iter(f.start,h,function(a){g.push(a.text)}),d.push({start:f.start,added:f.old.length,old:g});var i=Uc({line:f.start+f.old.length-1,ch:cb(g[g.length-1],f.old[f.old.length-1])});sc({line:f.start,ch:0},{line:h-1,ch:Yb(h-1).text.length},f.old,i,i)}Eb=!0,b.push(d)}function qc(){pc(Ub.done,Ub.undone)}function rc(){pc(Ub.undone,Ub.done)}function sc(a,b,c,d,e){function y(a){return a<=Math.min(b.line,b.line+s)?a:a+s}if(Db)return;var g=!1,h=Rb.length;f.lineWrapping||tb.iter(a.line,b.line,function(a){if(a.text.length==h)return g=!0,!0});if(a.line!=b.line||c.length>1)Kb=!0;var i=b.line-a.line,j=Yb(a.line),k=Yb(b.line);if(a.ch==0&&b.ch==0&&c[c.length-1]==""){var l=[],m=null;a.line?(m=Yb(a.line-1),m.fixMarkEnds(k)):k.fixMarkStarts();for(var n=0,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],m));i&&tb.remove(a.line,i,Lb),l.length&&tb.insert(a.line,l)}else if(j==k)if(c.length==1)j.replace(a.ch,b.ch,c[0]);else{k=j.split(b.ch,c[c.length-1]),j.replace(a.ch,null,c[0]),j.fixMarkEnds(k);var l=[];for(var n=1,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],j));l.push(k),tb.insert(a.line+1,l)}else if(c.length==1)j.replace(a.ch,null,c[0]),k.replace(null,b.ch,""),j.append(k),tb.remove(a.line+1,i,Lb);else{var l=[];j.replace(a.ch,null,c[0]),k.replace(null,b.ch,c[c.length-1]),j.fixMarkEnds(k);for(var n=1,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],j));i>1&&tb.remove(a.line+1,i-1,Lb),tb.insert(a.line+1,l)}if(f.lineWrapping){var p=Math.max(5,T.clientWidth/Ed()-3);tb.iter(a.line,a.line+c.length,function(a){if(a.hidden)return;var b=Math.ceil(a.text.length/p)||1;b!=a.height&&Zb(a,b)})}else tb.iter(a.line,n+c.length,function(a){var b=a.text;b.length>h&&(Rb=b,h=b.length,Sb=null,g=!1)}),g&&(h=0,Rb="",Sb=null,tb.iter(0,tb.size,function(a){var b=a.text;b.length>h&&(h=b.length,Rb=b)}));var q=[],s=c.length-i-1;for(var n=0,t=ub.length;n<t;++n){var u=ub[n];u<a.line?q.push(u):u>b.line&&q.push(u+s)}var v=a.line+Math.min(c.length,500);Od(a.line,v),q.push(v),ub=q,Qd(100),Gb.push({from:a.line,to:b.line+1,diff:s});var w={from:a,to:b,text:c};if(Hb){for(var x=Hb;x.next;x=x.next);x.next=w}else Hb=w;Qc(d,e,y(wb.from.line),y(wb.to.line)),T.clientHeight&&(U.style.height=tb.height*Bd()+2*Fd()+"px")}function tc(a,b,c){function d(d){if($(d,b))return d;if(!$(c,d))return e;var f=d.line+a.length-(c.line-b.line)-1,g=d.ch;return d.line==c.line&&(g+=a[a.length-1].length-(c.ch-(c.line==b.line?b.ch:0))),{line:f,ch:g}}b=Uc(b),c?c=Uc(c):c=b,a=fb(a);var e;return vc(a,b,c,function(a){return e=a,{from:d(wb.from),to:d(wb.to)}}),e}function uc(a,b){vc(fb(a),wb.from,wb.to,function(a){return b=="end"?{from:a,to:a}:b=="start"?{from:wb.from,to:wb.from}:{from:wb.from,to:a}})}function vc(a,b,c,d){var e=a.length==1?a[0].length+b.ch:a[a.length-1].length,f=d({line:b.line+a.length-1,ch:e});oc(b,c,a,f.from,f.to)}function wc(a,b){var c=a.line,d=b.line;if(c==d)return Yb(c).text.slice(a.ch,b.ch);var e=[Yb(c).text.slice(a.ch)];return tb.iter(c+1,d,function(a){e.push(a.text)}),e.push(Yb(d).text.slice(0,b.ch)),e.join("\n")}function xc(){return wc(wb.from,wb.to)}function zc(){if(yc)return;pb.set(f.pollInterval,function(){Rd(),Cc(),vb&&zc(),Sd()})}function Ac(){function b(){Rd();var c=Cc();!c&&!a?(a=!0,pb.set(60,b)):(yc=!1,zc()),Sd()}var a=!1;yc=!0,pb.set(20,b)}function Cc(){if(Jb||!vb||gb(D)||f.readOnly)return!1;var a=D.value;if(a==Bc)return!1;xb=null;var b=0,c=Math.min(Bc.length,a.length);while(b<c&&Bc[b]==a[b])++b;return b<Bc.length?wb.from={line:wb.from.line,ch:wb.from.ch-(Bc.length-b)}:Cb&&Z(wb.from,wb.to)&&(wb.to={line:wb.to.line,ch:Math.min(Yb(wb.to.line).text.length,wb.to.ch+(a.length-b))}),uc(a.slice(b),"end"),Bc=a,!0}function Dc(a){Z(wb.from,wb.to)?a&&(Bc=D.value=""):(Bc="",D.value=xc(),Y(D))}function Ec(){f.readOnly!="nocursor"&&D.focus()}function Fc(){if(!lb.getBoundingClientRect)return;var a=lb.getBoundingClientRect();if(M&&a.top==a.bottom)return;var b=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(a.top<0||a.bottom>b)&&lb.scrollIntoView()}function Gc(){var a=vd(wb.inverted?wb.from:wb.to),b=f.lineWrapping?Math.min(a.x,jb.offsetWidth):a.x;return Hc(b,a.y,b,a.yBot)}function Hc(a,b,c,d){var e=Gd(),g=Fd();b+=g,d+=g,a+=e,c+=e;var h=T.clientHeight,i=T.scrollTop,j=!1,k=!0;b<i?(T.scrollTop=Math.max(0,b),j=!0):d>i+h&&(T.scrollTop=d-h,j=!0);var l=T.clientWidth,m=T.scrollLeft,n=f.fixedGutter?ab.clientWidth:0;return a<m+n?(a<50&&(a=0),T.scrollLeft=Math.max(0,a-10-n),j=!0):c>l+m-3&&(T.scrollLeft=c+10-l,j=!0,c>U.clientWidth&&(k=!1)),j&&f.onScroll&&f.onScroll(Xb),k}function Ic(){var a=Bd(),b=T.scrollTop-Fd(),c=Math.max(0,Math.floor(b/a)),d=Math.ceil((b+T.clientHeight)/a);return{from:x(tb,c),to:x(tb,d)}}function Jc(a,b){function n(){Sb=T.clientWidth;var a=nb.firstChild,b=!1;return tb.iter(Nb,Ob,function(c){if(!c.hidden){var d=Math.round(a.offsetHeight/k)||1;c.height!=d&&(Zb(c,d),Kb=b=!0)}a=a.nextSibling}),b&&(U.style.height=tb.height*k+2*Fd()+"px"),b}if(!T.clientWidth){Nb=Ob=Mb=0;return}var c=Ic();if(a!==!0&&a.length==0&&c.from>Nb&&c.to<Ob)return;var d=Math.max(c.from-100,0),e=Math.min(tb.size,c.to+100);Nb<d&&d-Nb<20&&(d=Nb),Ob>e&&Ob-e<20&&(e=Math.min(tb.size,Ob));var g=a===!0?[]:Kc([{from:Nb,to:Ob,domStart:0}],a),h=0;for(var i=0;i<g.length;++i){var j=g[i];j.from<d&&(j.domStart+=d-j.from,j.from=d),j.to>e&&(j.to=e),j.from>=j.to?g.splice(i--,1):h+=j.to-j.from}if(h==e-d)return;g.sort(function(a,b){return a.domStart-b.domStart});var k=Bd(),l=ab.style.display;nb.style.display="none",Lc(d,e,g),nb.style.display=ab.style.display="";var m=d!=Nb||e!=Ob||Pb!=T.clientHeight+k;m&&(Pb=T.clientHeight+k),Nb=d,Ob=e,Mb=y(tb,d),V.style.top=Mb*k+"px",T.clientHeight&&(U.style.height=tb.height*k+2*Fd()+"px");if(nb.childNodes.length!=Ob-Nb)throw new Error("BAD PATCH! "+JSON.stringify(g)+" size="+(Ob-Nb)+" nodes="+nb.childNodes.length);return f.lineWrapping?n():(Sb==null&&(Sb=rd(Rb)),Sb>T.clientWidth?(jb.style.width=Sb+"px",U.style.width="",U.style.width=T.scrollWidth+"px"):jb.style.width=U.style.width=""),ab.style.display=l,(m||Kb)&&Mc()&&f.lineWrapping&&n()&&Mc(),Nc(),!b&&f.onUpdate&&f.onUpdate(Xb),!0}function Kc(a,b){for(var c=0,d=b.length||0;c<d;++c){var e=b[c],f=[],g=e.diff||0;for(var h=0,i=a.length;h<i;++h){var j=a[h];e.to<=j.from&&e.diff?f.push({from:j.from+g,to:j.to+g,domStart:j.domStart}):e.to<=j.from||e.from>=j.to?f.push(j):(e.from>j.from&&f.push({from:j.from,to:e.from,domStart:j.domStart}),e.to<j.to&&f.push({from:e.to+g,to:j.to+g,domStart:j.domStart+(e.to-j.from)}))}a=f}return a}function Lc(a,b,c){if(!c.length)nb.innerHTML="";else{function d(a){var b=a.nextSibling;return a.parentNode.removeChild(a),b}var e=0,f=nb.firstChild,g;for(var h=0;h<c.length;++h){var i=c[h];while(i.domStart>e)f=d(f),e++;for(var j=0,k=i.to-i.from;j<k;++j)f=f.nextSibling,e++}while(f)f=d(f)}var l=c.shift(),f=nb.firstChild,j=a,m=document.createElement("div");tb.iter(a,b,function(a){l&&l.to==j&&(l=c.shift());if(!l||l.from>j){if(a.hidden)var b=m.innerHTML="<pre></pre>";else{var b="<pre"+(a.className?' class="'+a.className+'"':"")+">"+a.getHTML(fd)+"</pre>";a.bgClassName&&(b='<div style="position: relative"><pre class="'+a.bgClassName+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>'+b+"</div>")}m.innerHTML=b,nb.insertBefore(m.firstChild,f)}else f=f.nextSibling;++j})}function Mc(){if(!f.gutter&&!f.lineNumbers)return;var a=V.offsetHeight,b=T.clientHeight;ab.style.height=(a-b<2?b:a)+"px";var c=[],d=Nb,e;tb.iter(Nb,Math.max(Ob,Nb+1),function(a){if(a.hidden)c.push("<pre></pre>");else{var b=a.gutterMarker,g=f.lineNumbers?d+f.firstLineNumber:null;b&&b.text?g=b.text.replace("%N%",g!=null?g:""):g==null&&(g="\u00a0"),c.push(b&&b.style?'<pre class="'+b.style+'">':"<pre>",g);for(var h=1;h<a.height;++h)c.push("<br/>&#160;");c.push("</pre>"),b||(e=d)}++d}),ab.style.display="none",ib.innerHTML=c.join("");if(e!=null){var g=ib.childNodes[e-Nb],h=String(tb.size).length,i=X(g),j="";while(i.length+j.length<h)j+="\u00a0";j&&g.insertBefore(document.createTextNode(j),g.firstChild)}ab.style.display="";var k=Math.abs((parseInt(jb.style.marginLeft)||0)-ab.offsetWidth)>2;return jb.style.marginLeft=ab.offsetWidth+"px",Kb=!1,k}function Nc(){var a=Z(wb.from,wb.to),b=vd(wb.from,!0),c=a?b:vd(wb.to,!0),d=wb.inverted?b:c,e=Bd(),g=W(s),h=W(nb);A.style.top=Math.max(0,Math.min(T.offsetHeight,d.y+h.top-g.top))+"px",A.style.left=Math.max(0,Math.min(T.offsetWidth,d.x+h.left-g.left))+"px";if(a)lb.style.top=d.y+"px",lb.style.left=(f.lineWrapping?Math.min(d.x,jb.offsetWidth):d.x)+"px",lb.style.display="",mb.style.display="none";else{var i=b.y==c.y,j="",k=jb.clientWidth||jb.offsetWidth,l=jb.clientHeight||jb.offsetHeight;function m(a,b,c,d){var e=O?"width: "+(c?k-c-a:k)+"px":"right: "+c+"px";j+='<div class="CodeMirror-selected" style="position: absolute; left: '+a+"px; top: "+b+"px; "+e+"; height: "+d+'px"></div>'}if(wb.from.ch&&b.y>=0){var n=i?k-c.x:0;m(b.x,b.y,n,e)}var o=Math.max(0,b.y+(wb.from.ch?e:0)),p=Math.min(c.y,l)-o;p>.2*e&&m(0,o,0,p),(!i||!wb.from.ch)&&c.y<l-.5*e&&m(0,c.y,k-c.x,e),mb.innerHTML=j,lb.style.display="none",mb.style.display=""}}function Oc(a){a?xb=xb||(wb.inverted?wb.to:wb.from):xb=null}function Pc(a,b){var c=xb&&Uc(xb);c&&($(c,a)?a=c:$(b,c)&&(b=c)),Qc(a,b),Fb=!0}function Qc(a,b,c,d){Yc=null,c==null&&(c=wb.from.line,d=wb.to.line);if(Z(wb.from,a)&&Z(wb.to,b))return;if($(b,a)){var e=b;b=a,a=e}if(a.line!=c){var g=Rc(a,c,wb.from.ch);g?a=g:pd(a.line,!1)}b.line!=d&&(b=Rc(b,d,wb.to.ch)),Z(a,b)?wb.inverted=!1:Z(a,wb.to)?wb.inverted=!1:Z(b,wb.from)&&(wb.inverted=!0);if(f.autoClearEmptyLines&&Z(wb.from,wb.to)){var h=wb.inverted?a:b;if(h.line!=wb.from.line&&wb.from.line<tb.size){var i=Yb(wb.from.line);/^\s+$/.test(i.text)&&setTimeout(Ud(function(){if(i.parent&&/^\s+$/.test(i.text)){var a=w(i);tc("",{line:a,ch:0},{line:a,ch:i.text.length})}},10))}}wb.from=a,wb.to=b,Ib=!0}function Rc(a,b,c){function d(b){var d=a.line+b,e=b==1?tb.size:-1;while(d!=e){var f=Yb(d);if(!f.hidden){var g=a.ch;if(g>c||g>f.text.length)g=f.text.length;return{line:d,ch:g}}d+=b}}var e=Yb(a.line);return e.hidden?a.line>=b?d(1)||d(-1):d(-1)||d(1):a}function Sc(a,b,c){var d=Uc({line:a,ch:b||0});(c?Pc:Qc)(d,d)}function Tc(a){return Math.max(0,Math.min(a,tb.size-1))}function Uc(a){if(a.line<0)return{line:0,ch:0};if(a.line>=tb.size)return{line:tb.size-1,ch:Yb(tb.size-1).text.length};var b=a.ch,c=Yb(a.line).text.length;return b==null||b>c?{line:a.line,ch:c}:b<0?{line:a.line,ch:0}:a}function Vc(a,b){function g(){for(var b=d+a,c=a<0?-1:tb.size;b!=c;b+=a){var e=Yb(b);if(!e.hidden)return d=b,f=e,!0}}function h(b){if(e==(a<0?0:f.text.length)){if(!!b||!g())return!1;e=a<0?f.text.length:0}else e+=a;return!0}var c=wb.inverted?wb.from:wb.to,d=c.line,e=c.ch,f=Yb(d);if(b=="char")h();else if(b=="column")h(!0);else if(b=="word"){var i=!1;for(;;){if(a<0&&!h())break;if(eb(f.text.charAt(e)))i=!0;else if(i){a<0&&(a=1,h());break}if(a>0&&!h())break}}return{line:d,ch:e}}function Wc(a,b){var c=a<0?wb.from:wb.to;if(xb||Z(wb.from,wb.to))c=Vc(a,b);Sc(c.line,c.ch,!0)}function Xc(a,b){Z(wb.from,wb.to)?a<0?tc("",Vc(a,b),wb.to):tc("",wb.from,Vc(a,b)):tc("",wb.from,wb.to),Fb=!0}function Zc(a,b){var c=0,d=vd(wb.inverted?wb.from:wb.to,!0);Yc!=null&&(d.x=Yc),b=="page"?c=Math.min(T.clientHeight,window.innerHeight||document.documentElement.clientHeight):b=="line"&&(c=Bd());var e=wd(d.x,d.y+c*a+2);b=="page"&&(T.scrollTop+=vd(e,!0).y-d.y),Sc(e.line,e.ch,!0),Yc=d.x}function $c(a){var b=Yb(a.line).text,c=a.ch,d=a.ch;while(c>0&&eb(b.charAt(c-1)))--c;while(d<b.length&&eb(b.charAt(d)))++d;Pc({line:a.line,ch:c},{line:a.line,ch:d})}function _c(a){Pc({line:a,ch:0},Uc({line:a+1,ch:0}))}function ad(a){if(Z(wb.from,wb.to))return bd(wb.from.line,a);var b=wb.to.line-(wb.to.ch?0:1);for(var c=wb.from.line;c<=b;++c)bd(c,a)}function bd(a,b){b||(b="add");if(b=="smart")if(!sb.indent)b="prev";else var c=Nd(a);var d=Yb(a),e=d.indentation(f.tabSize),g=d.text.match(/^\s*/)[0],h;b=="prev"?a?h=Yb(a-1).indentation(f.tabSize):h=0:b=="smart"?h=sb.indent(c,d.text.slice(g.length),d.text):b=="add"?h=e+f.indentUnit:b=="subtract"&&(h=e-f.indentUnit),h=Math.max(0,h);var i=h-e;if(!i){if(wb.from.line!=a&&wb.to.line!=a)return;var j=g}else{var j="",k=0;if(f.indentWithTabs)for(var l=Math.floor(h/f.tabSize);l;--l)k+=f.tabSize,j+="	";while(k<h)++k,j+=" "}tc(j,{line:a,ch:0},{line:a,ch:g.length})}function cd(){sb=a.getMode(f,f.mode),tb.iter(0,tb.size,function(a){a.stateAfter=null}),ub=[0],Qd()}function dd(){var a=f.gutter||f.lineNumbers;ab.style.display=a?"":"none",a?Kb=!0:nb.parentNode.style.marginLeft=0}function ed(a,b){if(f.lineWrapping){s.className+=" CodeMirror-wrap";var c=T.clientWidth/Ed()-3;tb.iter(0,tb.size,function(a){if(a.hidden)return;var b=Math.ceil(a.text.length/c)||1;b!=1&&Zb(a,b)}),jb.style.width=U.style.width=""}else s.className=s.className.replace(" CodeMirror-wrap",""),Sb=null,Rb="",tb.iter(0,tb.size,function(a){a.height!=1&&!a.hidden&&Zb(a,1),a.text.length>Rb.length&&(Rb=a.text)});Gb.push({from:0,to:tb.size})}function fd(a){var b=f.tabSize-a%f.tabSize,c=Tb[b];if(c)return c;for(var d='<span class="cm-tab">',e=0;e<b;++e)d+=" ";return Tb[b]={html:d+"</span>",width:b}}function gd(){T.className=T.className.replace(/\s*cm-s-\w+/g,"")+f.theme.replace(/(^|\s)\s*/g," cm-s-")}function hd(){this.set=[]}function id(a,b,c){function e(a,b,c,e){Yb(a).addMark(new p(b,c,e,d))}a=Uc(a),b=Uc(b);var d=new hd;if(!$(a,b))return d;if(a.line==b.line)e(a.line,a.ch,b.ch,c);else{e(a.line,a.ch,null,c);for(var f=a.line+1,g=b.line;f<g;++f)e(f,null,null,c);e(b.line,null,b.ch,c)}return Gb.push({from:a.line,to:b.line+1}),d}function jd(a){a=Uc(a);var b=new q(a.ch);return Yb(a.line).addMark(b),b}function kd(a){a=Uc(a);var b=[],c=Yb(a.line).marked;if(!c)return b;for(var d=0,e=c.length;d<e;++d){var f=c[d];(f.from==null||f.from<=a.ch)&&(f.to==null||f.to>=a.ch)&&b.push(f.marker||f)}return b}function ld(a,b,c){return typeof a=="number"&&(a=Yb(Tc(a))),a.gutterMarker={text:b,style:c},Kb=!0,a}function md(a){typeof a=="number"&&(a=Yb(Tc(a))),a.gutterMarker=null,Kb=!0}function nd(a,b){var c=a,d=a;return typeof a=="number"?d=Yb(Tc(a)):c=w(a),c==null?null:b(d,c)?(Gb.push({from:c,to:c+1}),d):null}function od(a,b,c){return nd(a,function(a){if(a.className!=b||a.bgClassName!=c)return a.className=b,a.bgClassName=c,!0})}function pd(a,b){return nd(a,function(a,c){if(a.hidden!=b){a.hidden=b,Zb(a,b?0:1);var d=wb.from.line,e=wb.to.line;if(b&&(d==c||e==c)){var f=d==c?Rc({line:d,ch:0},d,0):wb.from,g=e==c?Rc({line:e,ch:0},e,0):wb.to;if(!g)return;Qc(f,g)}return Kb=!0}})}function qd(a){if(typeof a=="number"){if(!Wb(a))return null;var b=a;a=Yb(a);if(!a)return null}else{var b=w(a);if(b==null)return null}var c=a.gutterMarker;return{line:b,handle:a,text:a.text,markerText:c&&c.text,markerClass:c&&c.style,lineClass:a.className,bgClass:a.bgClassName}}function rd(a){return kb.innerHTML="<pre><span>x</span></pre>",kb.firstChild.firstChild.firstChild.nodeValue=a,kb.firstChild.firstChild.offsetWidth||10}function sd(a,b){function e(a){return kb.innerHTML="<pre><span>"+c.getHTML(fd,a)+"</span></pre>",kb.firstChild.firstChild.offsetWidth}if(b<=0)return 0;var c=Yb(a),d=c.text,f=0,g=0,h=d.length,i,j=Math.min(h,Math.ceil(b/Ed()));for(;;){var k=e(j);if(!(k<=b&&j<h)){i=k,h=j;break}j=Math.min(h,Math.ceil(j*1.2))}if(b>i)return h;j=Math.floor(h*.8),k=e(j),k<b&&(f=j,g=k);for(;;){if(h-f<=1)return i-b>b-g?f:h;var l=Math.ceil((f+h)/2),m=e(l);m>b?(h=l,i=m):(f=l,g=m)}}function ud(a,b){if(b==0)return{top:0,left:0};var c="";if(f.lineWrapping){var d=a.text.indexOf(" ",b+6);c=bb(a.text.slice(b+1,d<0?a.text.length:d+(M?5:0)))}kb.innerHTML="<pre>"+a.getHTML(fd,b)+'<span id="CodeMirror-temp-'+td+'">'+bb(a.text.charAt(b)||" ")+"</span>"+c+"</pre>";var e=document.getElementById("CodeMirror-temp-"+td),g=e.offsetTop,h=e.offsetLeft;if(M&&g==0&&h==0){var i=document.createElement("span");i.innerHTML="x",e.parentNode.insertBefore(i,e.nextSibling),g=i.offsetTop}return{top:g,left:h}}function vd(a,b){var c,d=Bd(),e=d*(y(tb,a.line)-(b?Mb:0));if(a.ch==0)c=0;else{var g=ud(Yb(a.line),a.ch);c=g.left,f.lineWrapping&&(e+=Math.max(0,g.top))}return{x:c,y:e,yBot:e+d}}function wd(a,b){function l(a){var b=ud(h,a);if(j){var d=Math.round(b.top/c);return Math.max(0,b.left+(d-k)*T.clientWidth)}return b.left}b<0&&(b=0);var c=Bd(),d=Ed(),e=Mb+Math.floor(b/c),g=x(tb,e);if(g>=tb.size)return{line:tb.size-1,ch:Yb(tb.size-1).text.length};var h=Yb(g),i=h.text,j=f.lineWrapping,k=j?e-y(tb,g):0;if(a<=0&&k==0)return{line:g,ch:0};var m=0,n=0,o=i.length,p,q=Math.min(o,Math.ceil((a+k*T.clientWidth*.9)/d));for(;;){var r=l(q);if(!(r<=a&&q<o)){p=r,o=q;break}q=Math.min(o,Math.ceil(q*1.2))}if(a>p)return{line:g,ch:o};q=Math.floor(o*.8),r=l(q),r<a&&(m=q,n=r);for(;;){if(o-m<=1)return{line:g,ch:p-a>a-n?m:o};var s=Math.ceil((m+o)/2),t=l(s);t>a?(o=s,p=t):(m=s,n=t)}}function xd(a){var b=vd(a,!0),c=W(jb);return{x:c.left+b.x,y:c.top+b.y,yBot:c.top+b.yBot}}function Bd(){if(Ad==null){Ad="<pre>";for(var a=0;a<49;++a)Ad+="x<br/>";Ad+="x</pre>"}var b=nb.clientHeight;return b==zd?yd:(zd=b,kb.innerHTML=Ad,yd=kb.firstChild.offsetHeight/50||1,kb.innerHTML="",yd)}function Ed(){return T.clientWidth==Dd?Cd:(Dd=T.clientWidth,Cd=rd("x"))}function Fd(){return jb.offsetTop}function Gd(){return jb.offsetLeft}function Hd(a,b){var c=W(T,!0),d,e;try{d=a.clientX,e=a.clientY}catch(a){return null}if(!b&&(d-c.left>T.clientWidth||e-c.top>T.clientHeight))return null;var f=W(jb,!0);return wd(d-f.left,e-f.top)}function Id(a){function f(){var a=fb(D.value).join("\n");a!=e&&Ud(uc)(a,"end"),A.style.position="relative",D.style.cssText=d,N&&(T.scrollTop=c),Jb=!1,Dc(!0),zc()}var b=Hd(a),c=T.scrollTop;if(!b||window.opera)return;(Z(wb.from,wb.to)||$(b,wb.from)||!$(b,wb.to))&&Ud(Sc)(b.line,b.ch);var d=D.style.cssText;A.style.position="absolute",D.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Jb=!0;var e=D.value=xc();Ec(),Y(D);if(L){E(a);var g=I(window,"mouseup",function(){g(),setTimeout(f,20)},!0)}else setTimeout(f,50)}function Jd(){clearInterval(rb);var a=!0;lb.style.visibility="",rb=setInterval(function(){lb.style.visibility=(a=!a)?"":"hidden"},650)}function Ld(a){function p(a,b,c){if(!a.text)return;var d=a.styles,e=g?0:a.text.length-1,f;for(var i=g?0:d.length-2,j=g?d.length:-2;i!=j;i+=2*h){var k=d[i];if(d[i+1]!=null&&d[i+1]!=m){e+=h*k.length;continue}for(var l=g?0:k.length-1,p=g?k.length:-1;l!=p;l+=h,e+=h)if(e>=b&&e<c&&o.test(f=k.charAt(l))){var q=Kd[f];if(q.charAt(1)==">"==g)n.push(f);else{if(n.pop()!=q.charAt(0))return{pos:e,match:!1};if(!n.length)return{pos:e,match:!0}}}}}var b=wb.inverted?wb.from:wb.to,c=Yb(b.line),d=b.ch-1,e=d>=0&&Kd[c.text.charAt(d)]||Kd[c.text.charAt(++d)];if(!e)return;var f=e.charAt(0),g=e.charAt(1)==">",h=g?1:-1,i=c.styles;for(var j=d+1,k=0,l=i.length;k<l;k+=2)if((j-=i[k].length)<=0){var m=i[k+1];break}var n=[c.text.charAt(d)],o=/[(){}[\]]/;for(var k=b.line,l=g?Math.min(k+100,tb.size):Math.max(-1,k-100);k!=l;k+=h){var c=Yb(k),q=k==b.line,r=p(c,q&&g?d+1:0,q&&!g?d:c.text.length);if(r)break}r||(r={pos:null,match:!1});var m=r.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",s=id({line:b.line,ch:d},{line:b.line,ch:d+1},m),t=r.pos!=null&&id({line:k,ch:r.pos},{line:k,ch:r.pos+1},m),u=Ud(function(){s.clear(),t&&t.clear()});a?setTimeout(u,800):Qb=u}function Md(a){var b,c;for(var d=a,e=a-40;d>e;--d){if(d==0)return 0;var g=Yb(d-1);if(g.stateAfter)return d;var h=g.indentation(f.tabSize);if(c==null||b>h)c=d-1,b=h}return c}function Nd(a){var b=Md(a),c=b&&Yb(b-1).stateAfter;return c?c=m(sb,c):c=n(sb),tb.iter(b,a,function(a){a.highlight(sb,c,f.tabSize),a.stateAfter=m(sb,c)}),b<a&&Gb.push({from:b,to:a}),a<tb.size&&!Yb(a).stateAfter&&ub.push(a),c}function Od(a,b){var c=Nd(a);tb.iter(a,b,function(a){a.highlight(sb,c,f.tabSize),a.stateAfter=m(sb,c)})}function Pd(){var a=+(new Date)+f.workTime,b=ub.length;while(ub.length){if(!Yb(Nb).stateAfter)var c=Nb;else var c=ub.pop();if(c>=tb.size)continue;var d=Md(c),e=d&&Yb(d-1).stateAfter;e?e=m(sb,e):e=n(sb);var g=0,h=sb.compareStates,i=!1,j=d,k=!1;tb.iter(j,tb.size,function(b){var d=b.stateAfter;if(+(new Date)>a)return ub.push(j),Qd(f.workDelay),i&&Gb.push({from:c,to:j+1}),k=!0;var l=b.highlight(sb,e,f.tabSize);l&&(i=!0),b.stateAfter=m(sb,e);var n=null;if(h){var o=d&&h(d,e);o!=K&&(n=!!o)}n==null&&(l!==!1||!d?g=0:++g>3&&(!sb.indent||sb.indent(d,"")==sb.indent(e,""))&&(n=!0));if(n)return!0;++j});if(k)return;i&&Gb.push({from:c,to:j+1})}b&&f.onHighlightComplete&&f.onHighlightComplete(Xb)}function Qd(a){if(!ub.length)return;qb.set(a,Ud(Pd))}function Rd(){Eb=Fb=Hb=null,Gb=[],Ib=!1,Lb=[]}function Sd(){var a=!1,b;Ib&&(a=!Gc()),Gb.length?b=Jc(Gb,!0):(Ib&&Nc(),Kb&&Mc()),a&&Gc(),Ib&&(Fc(),Jd()),vb&&!Jb&&(Eb===!0||Eb!==!1&&Ib)&&Dc(Fb),Ib&&f.matchBrackets&&setTimeout(Ud(function(){Qb&&(Qb(),Qb=null),Z(wb.from,wb.to)&&Ld(!1)}),20);var c=Hb,d=Lb;Ib&&f.onCursorActivity&&f.onCursorActivity(Xb),c&&f.onChange&&Xb&&f.onChange(Xb,c);for(var e=0;e<d.length;++e)d[e](Xb);b&&f.onUpdate&&f.onUpdate(Xb)}function Ud(a){return function(){Td++||Rd();try{var b=a.apply(this,arguments)}finally{--Td||Sd()}return b}}var f={},i=a.defaults;for(var o in i)i.hasOwnProperty(o)&&(f[o]=(e&&e.hasOwnProperty(o)?e:i)[o]);var s=document.createElement("div");s.className="CodeMirror"+(f.lineWrapping?" CodeMirror-wrap":""),s.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden;"></div><pre class="CodeMirror-cursor">&#160;</pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>',d.appendChild?d.appendChild(s):d(s);var A=s.firstChild,D=A.firstChild,T=s.lastChild,U=T.firstChild,V=U.firstChild,ab=V.firstChild,ib=ab.firstChild,jb=ab.nextSibling.firstChild,kb=jb.firstChild,lb=kb.nextSibling,mb=lb.nextSibling,nb=mb.nextSibling;gd(),b&&(D.style.width="0px"),P||(jb.draggable=!0),jb.style.outline="none",f.tabindex!=null&&(D.tabIndex=f.tabindex),f.autofocus&&Ec(),!f.gutter&&!f.lineNumbers&&(ab.style.display="none"),R&&(A.style.height="1px",A.style.position="absolute");try{rd("x")}catch(ob){throw ob.message.match(/runtime/i)&&(ob=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),ob}var pb=new J,qb=new J,rb,sb,tb=new u([new t([new r("")])]),ub,vb;cd();var wb={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},xb,yb,zb,Ab=0,Bb,Cb=!1,Db=!1,Eb,Fb,Gb,Hb,Ib,Jb,Kb,Lb,Mb=0,Nb=0,Ob=0,Pb=0,Qb,Rb="",Sb,Tb={};Ud(function(){$b(f.value||""),Eb=!1})();var Ub=new z;I(T,"mousedown",Ud(ac)),I(T,"dblclick",Ud(bc)),I(jb,"selectstart",C),L||I(T,"contextmenu",Id),I(T,"scroll",function(){Ab=T.scrollTop,Jc([]),f.fixedGutter&&(ab.style.left=T.scrollLeft+"px"),f.onScroll&&f.onScroll(Xb)}),I(window,"resize",function(){Jc(!0)}),I(D,"keyup",Ud(lc)),I(D,"input",Ac),I(D,"keydown",Ud(jc)),I(D,"keypress",Ud(kc)),I(D,"focus",mc),I(D,"blur",nc),f.dragDrop&&(I(jb,"dragstart",dc),I(T,"dragenter",E),I(T,"dragover",E),I(T,"drop",Ud(cc))),I(T,"paste",function(){Ec(),Ac()}),I(D,"paste",Ac),I(D,"cut",Ud(function(){f.readOnly||uc("")})),R&&I(U,"mouseup",function(){document.activeElement==D&&D.blur(),Ec()});var Vb;try{Vb=document.activeElement==D}catch(ob){}Vb||f.autofocus?setTimeout(mc,20):nc();var Xb=s.CodeMirror={getValue:_b,setValue:Ud($b),getSelection:xc,replaceSelection:Ud(uc),focus:function(){window.focus(),Ec(),mc(),Ac()},setOption:function(a,b){var c=f[a];f[a]=b,a=="mode"||a=="indentUnit"?cd():a=="readOnly"&&b=="nocursor"?(nc(),D.blur()):a=="readOnly"&&!b?Dc(!0):a=="theme"?gd():a=="lineWrapping"&&c!=b?Ud(ed)():a=="tabSize"&&Jc(!0);if(a=="lineNumbers"||a=="gutter"||a=="firstLineNumber"||a=="theme")dd(),Jc(!0)},getOption:function(a){return f[a]},undo:Ud(qc),redo:Ud(rc),indentLine:Ud(function(a,b){typeof b!="string"&&(b==null?b=f.smartIndent?"smart":"prev":b=b?"add":"subtract"),Wb(a)&&bd(a,b)}),indentSelection:Ud(ad),historySize:function(){return{undo:Ub.done.length,redo:Ub.undone.length}},clearHistory:function(){Ub=new z},matchBrackets:Ud(function(){Ld(!0)}),getTokenAt:Ud(function(a){return a=Uc(a),Yb(a.line).getTokenAt(sb,Nd(a.line),a.ch)}),getStateAfter:function(a){return a=Tc(a==null?tb.size-1:a),Nd(a+1)},cursorCoords:function(a,b){return a==null&&(a=wb.inverted),this.charCoords(a?wb.from:wb.to,b)},charCoords:function(a,b){return a=Uc(a),b=="local"?vd(a,!1):b=="div"?vd(a,!0):xd(a)},coordsChar:function(a){var b=W(jb);return wd(a.x-b.left,a.y-b.top)},markText:Ud(id),setBookmark:jd,findMarksAt:kd,setMarker:Ud(ld),clearMarker:Ud(md),setLineClass:Ud(od),hideLine:Ud(function(a){return pd(a,!0)}),showLine:Ud(function(a){return pd(a,!1)}),onDeleteLine:function(a,b){if(typeof a=="number"){if(!Wb(a))return null;a=Yb(a)}return(a.handlers||(a.handlers=[])).push(b),a},lineInfo:qd,addWidget:function(a,b,c,d,e){a=vd(Uc(a));var f=a.yBot,g=a.x;b.style.position="absolute",U.appendChild(b);if(d=="over")f=a.y;else if(d=="near"){var h=Math.max(T.offsetHeight,tb.height*Bd()),i=Math.max(U.clientWidth,jb.clientWidth)-Gd();a.yBot+b.offsetHeight>h&&a.y>b.offsetHeight&&(f=a.y-b.offsetHeight),g+b.offsetWidth>i&&(g=i-b.offsetWidth)}b.style.top=f+Fd()+"px",b.style.left=b.style.right="",e=="right"?(g=U.clientWidth-b.offsetWidth,b.style.right="0px"):(e=="left"?g=0:e=="middle"&&(g=(U.clientWidth-b.offsetWidth)/2),b.style.left=g+Gd()+"px"),c&&Hc(g,f,g+b.offsetWidth,f+b.offsetHeight)},lineCount:function(){return tb.size},clipPos:Uc,getCursor:function(a){return a==null&&(a=wb.inverted),_(a?wb.from:wb.to)},somethingSelected:function(){return!Z(wb.from,wb.to)},setCursor:Ud(function(a,b,c){b==null&&typeof a.line=="number"?Sc(a.line,a.ch,c):Sc(a,b,c)}),setSelection:Ud(function(a,b,c){(c?Pc:Qc)(Uc(a),Uc(b||a))}),getLine:function(a){if(Wb(a))return Yb(a).text},getLineHandle:function(a){if(Wb(a))return Yb(a)},setLine:Ud(function(a,b){Wb(a)&&tc(b,{line:a,ch:0},{line:a,ch:Yb(a).text.length})}),removeLine:Ud(function(a){Wb(a)&&tc("",{line:a,ch:0},Uc({line:a+1,ch:0}))}),replaceRange:Ud(tc),getRange:function(a,b){return wc(Uc(a),Uc(b))},triggerOnKeyDown:Ud(jc),execCommand:function(a){return h[a](Xb)},moveH:Ud(Wc),deleteH:Ud(Xc),moveV:Ud(Zc),toggleOverwrite:function(){Cb?(Cb=!1,lb.className=lb.className.replace(" CodeMirror-overwrite","")):(Cb=!0,lb.className+=" CodeMirror-overwrite")},posFromIndex:function(a){var b=0,c;return tb.iter(0,tb.size,function(d){var e=d.text.length+1;if(e>a)return c=a,!0;a-=e,++b}),Uc({line:b,ch:c})},indexFromPos:function(a){if(a.line<0||a.ch<0)return 0;var b=a.ch;return tb.iter(0,a.line,function(a){b+=a.text.length+1}),b},scrollTo:function(a,b){a!=null&&(T.scrollLeft=a),b!=null&&(T.scrollTop=b),Jc([])},operation:function(a){return Ud(a)()},refresh:function(){Jc(!0),T.scrollHeight>Ab&&(T.scrollTop=Ab)},getInputField:function(){return D},getWrapperElement:function(){return s},getScrollerElement:function(){return T},getGutterElement:function(){return ab}},hc=null,ic,yc=!1,Bc="",Yc=null;hd.prototype.clear=Ud(function(){var a=Infinity,b=-Infinity;for(var c=0,d=this.set.length;c<d;++c){var e=this.set[c],f=e.marked;if(!f||!e.parent)continue;var g=w(e);a=Math.min(a,g),b=Math.max(b,g);for(var h=0;h<f.length;++h)f[h].marker==this&&f.splice(h--,1)}a!=Infinity&&Gb.push({from:a,to:b+1})}),hd.prototype.find=function(){var a,b;for(var c=0,d=this.set.length;c<d;++c){var e=this.set[c],f=e.marked;for(var g=0;g<f.length;++g){var h=f[g];if(h.marker==this)if(h.from!=null||h.to!=null){var i=w(e);i!=null&&(h.from!=null&&(a={line:i,ch:h.from}),h.to!=null&&(b={line:i,ch:h.to}))}}}return{from:a,to:b}};var td=Math.floor(Math.random()*16777215).toString(16),yd,zd,Ad,Cd,Dd=0,Kd={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},Td=0;for(var Vd in g)g.propertyIsEnumerable(Vd)&&!Xb.propertyIsEnumerable(Vd)&&(Xb[Vd]=g[Vd]);return Xb}function j(a){return typeof a=="string"?i[a]:a}function k(a,b,c,d){function e(b){b=j(b);var c=b[a];if(c!=null&&d(c))return!0;if(b.catchall)return d(b.catchall);var f=b.fallthrough;if(f==null)return!1;if(Object.prototype.toString.call(f)!="[object Array]")return e(f);for(var g=0,h=f.length;g<h;++g)if(e(f[g]))return!0;return!1}return b&&e(b)?!0:e(c)}function l(a){var b=hb[H(a,"keyCode")];return b=="Ctrl"||b=="Alt"||b=="Shift"||b=="Mod"}function m(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function n(a,b,c){return a.startState?a.startState(b,c):!0}function o(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8}function p(a,b,c,d){this.from=a,this.to=b,this.style=c,this.marker=d}function q(a){this.from=a,this.to=a,this.line=null}function r(a,b){this.styles=b||[a,null],this.text=a,this.height=1,this.marked=this.gutterMarker=this.className=this.bgClassName=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function s(a,b,c,d){for(var e=0,f=0,g=0;f<b;e+=2){var h=c[e],i=f+h.length;g==0?(i>a&&d.push(h.slice(a-f,Math.min(h.length,b-f)),c[e+1]),i>=a&&(g=1)):g==1&&(i>b?d.push(h.slice(0,b-f),c[e+1]):d.push(h,c[e+1])),f=i}}function t(a){this.lines=a,this.parent=null;for(var b=0,c=a.length,d=0;b<c;++b)a[b].parent=this,d+=a[b].height;this.height=d}function u(a){this.children=a;var b=0,c=0;for(var d=0,e=a.length;d<e;++d){var f=a[d];b+=f.chunkSize(),c+=f.height,f.parent=this}this.size=b,this.height=c,this.parent=null}function v(a,b){while(!a.lines)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(b<e){a=d;break}b-=e}return a.lines[b]}function w(a){if(a.parent==null)return null;var b=a.parent,c=db(b.lines,a);for(var d=b.parent;d;b=d,d=d.parent)for(var e=0,f=d.children.length;;++e){if(d.children[e]==b)break;c+=d.children[e].chunkSize()}return c}function x(a,b){var c=0;a:do{for(var d=0,e=a.children.length;d<e;++d){var f=a.children[d],g=f.height;if(b<g){a=f;continue a}b-=g,c+=f.chunkSize()}return c}while(!a.lines);for(var d=0,e=a.lines.length;d<e;++d){var h=a.lines[d],i=h.height;if(b<i)break;b-=i}return c+d}function y(a,b){var c=0;a:do{for(var d=0,e=a.children.length;d<e;++d){var f=a.children[d],g=f.chunkSize();if(b<g){a=f;continue a}b-=g,c+=f.height}return c}while(!a.lines);for(var d=0;d<b;++d)c+=a.lines[d].height;return c}function z(){this.time=0,this.done=[],this.undone=[]}function A(){E(this)}function B(a){return a.stop||(a.stop=A),a}function C(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function D(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function E(a){C(a),D(a)}function F(a){return a.target||a.srcElement}function G(a){if(a.which)return a.which;if(a.button&1)return 1;if(a.button&2)return 3;if(a.button&4)return 2}function H(a,b){var c=a.override&&a.override.hasOwnProperty(b);return c?a.override[b]:a[b]}function I(a,b,c,d){if(typeof a.addEventListener=="function"){a.addEventListener(b,c,!1);if(d)return function(){a.removeEventListener(b,c,!1)}}else{var e=function(a){c(a||window.event)};a.attachEvent("on"+b,e);if(d)return function(){a.detachEvent("on"+b,e)}}}function J(){this.id=null}function U(a,b,c){b==null&&(b=a.search(/[^\s\u00a0]/),b==-1&&(b=a.length));for(var d=0,e=0;d<b;++d)a.charAt(d)=="	"?e+=c-e%c:++e;return e}function V(a){return a.currentStyle?a.currentStyle:window.getComputedStyle(a,null)}function W(a,b){var c=a.ownerDocument.body,d=0,e=0,f=!1;for(var g=a;g;g=g.offsetParent){var h=g.offsetLeft,i=g.offsetTop;g==c?(d+=Math.abs(h),e+=Math.abs(i)):(d+=h,e+=i),b&&V(g).position=="fixed"&&(f=!0)}var j=b&&!f?null:c;for(var g=a.parentNode;g!=j;g=g.parentNode)g.scrollLeft!=null&&(d-=g.scrollLeft,e-=g.scrollTop);return{left:d,top:e}}function X(a){return a.textContent||a.innerText||a.nodeValue||""}function Y(a){b?(a.selectionStart=0,a.selectionEnd=a.value.length):a.select()}function Z(a,b){return a.line==b.line&&a.ch==b.ch}function $(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function _(a){return{line:a.line,ch:a.ch}}function bb(a){return ab.textContent=a,ab.innerHTML}function cb(a,b){if(!b)return 0;if(!a)return b.length;for(var c=a.length,d=b.length;c>=0&&d>=0;--c,--d)if(a.charAt(c)!=b.charAt(d))break;return d+1}function db(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function eb(a){return/\w/.test(a)||a.toUpperCase()!=a.toLowerCase()}a.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null};var b=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),c=b||/Mac/.test(navigator.platform),d=/Win/.test(navigator.platform),e=a.modes={},f=a.mimeModes={};a.defineMode=function(b,c){!a.defaults.mode&&b!="null"&&(a.defaults.mode=b);if(arguments.length>2){c.dependencies=[];for(var d=2;d<arguments.length;++d)c.dependencies.push(arguments[d])}e[b]=c},a.defineMIME=function(a,b){f[a]=b},a.resolveMode=function(b){if(typeof b=="string"&&f.hasOwnProperty(b))b=f[b];else if(typeof b=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(b))return a.resolveMode("application/xml");return typeof b=="string"?{name:b}:b||{name:"null"}},a.getMode=function(b,c){var c=a.resolveMode(c),d=e[c.name];return d?d(b,c):a.getMode(b,"text/plain")},a.listModes=function(){var a=[];for(var b in e)e.propertyIsEnumerable(b)&&a.push(b);return a},a.listMIMEs=function(){var a=[];for(var b in f)f.propertyIsEnumerable(b)&&a.push({mime:b,mode:f[b]});return a};var g=a.extensions={};a.defineExtension=function(a,b){g[a]=b};var h=a.commands={selectAll:function(a){a.setSelection({line:0,ch:0},{line:a.lineCount()-1})},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!Z(b,c);!d&&a.getLine(b.line).length==b.ch?a.replaceRange("",b,{line:b.line+1,ch:0}):a.replaceRange("",b,d?c:{line:b.line})},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",{line:b,ch:0},{line:b})},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.setCursor(0,0,!0)},goDocEnd:function(a){a.setSelection({line:a.lineCount()-1},null,!0)},goLineStart:function(a){a.setCursor(a.getCursor().line,0,!0)},goLineStartSmart:function(a){var b=a.getCursor(),c=a.getLine(b.line),d=Math.max(0,c.search(/\S/));a.setCursor(b.line,b.ch<=d&&b.ch?0:d,!0)},goLineEnd:function(a){a.setSelection({line:a.getCursor().line},null,!0)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goWordRight:function(a){a.moveH(1,"word")},delCharLeft:function(a){a.deleteH(-1,"char")},delCharRight:function(a){a.deleteH(1,"char")},delWordLeft:function(a){a.deleteH(-1,"word")},delWordRight:function(a){a.deleteH(1,"word")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("	","end")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);b.ch>0&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),{line:b.line,ch:b.ch-1},{line:b.line,ch:b.ch+1})},newlineAndIndent:function(a){a.replaceSelection("\n","end"),a.indentLine(a.getCursor().line)},toggleOverwrite:function(a){a.toggleOverwrite()}},i=a.keyMap={};i.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"insertTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},i.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},i.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},i["default"]=c?i.macDefault:i.pcDefault,i.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},a.fromTextArea=function(b,c){function d(){b.value=h.getValue()}c||(c={}),c.value=b.value,!c.tabindex&&b.tabindex&&(c.tabindex=b.tabindex),c.autofocus==null&&b.getAttribute("autofocus")!=null&&(c.autofocus=!0);if(b.form){var e=I(b.form,"submit",d,!0);if(typeof b.form.submit=="function"){var f=b.form.submit;function g(){d(),b.form.submit=f,b.form.submit(),b.form.submit=g}b.form.submit=g}}b.style.display="none";var h=a(function(a){b.parentNode.insertBefore(a,b.nextSibling)},c);return h.save=d,h.getTextArea=function(){return b},h.toTextArea=function(){d(),b.parentNode.removeChild(h.getWrapperElement()),b.style.display="",b.form&&(e(),typeof b.form.submit=="function"&&(b.form.submit=f))},h},a.copyState=m,a.startState=n,o.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if(typeof a=="string")var c=b==a;else var c=b&&(a.test?a.test(b):a(b));if(c)return++this.pos,b},eatWhile:function(a){var b=this.pos;while(this.eat(a));return this.pos>b},eatSpace:function(){var a=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);if(b>-1)return this.pos=b,!0},backUp:function(a){this.pos-=a},column:function(){return U(this.string,this.start,this.tabSize)},indentation:function(){return U(this.string,null,this.tabSize)},match:function(a,b,c){if(typeof a!="string"){var e=this.string.slice(this.pos).match(a);return e&&b!==!1&&(this.pos+=e[0].length),e}function d(a){return c?a.toLowerCase():a}if(d(this.string).indexOf(d(a),this.pos)==this.pos)return b!==!1&&(this.pos+=a.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},a.StringStream=o,p.prototype={attach:function(a){this.marker.set.push(a)},detach:function(a){var b=db(this.marker.set,a);b>-1&&this.marker.set.splice(b,1)},split:function(a,b){if(this.to<=a&&this.to!=null)return null;var c=this.from<a||this.from==null?null:this.from-a+b,d=this.to==null?null:this.to-a+b;return new p(c,d,this.style,this.marker)},dup:function(){return new p(null,null,this.style,this.marker)},clipTo:function(a,b,c,d,e){a&&d>this.from&&(d<this.to||this.to==null)?this.from=null:this.from!=null&&this.from>=b&&(this.from=Math.max(d,this.from)+e),c&&(b<this.to||this.to==null)&&(b>this.from||this.from==null)?this.to=null:this.to!=null&&this.to>b&&(this.to=d<this.to?this.to+e:b)},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(a){return this.marker==a.marker}},q.prototype={attach:function(a){this.line=a},detach:function(a){this.line==a&&(this.line=null)},split:function(a,b){if(a<this.from)return this.from=this.to=this.from-a+b,this},isDead:function(){return this.from>this.to},clipTo:function(a,b,c,d,e){(a||b<this.from)&&(c||d>this.to)?(this.from=0,this.to=-1):this.from>b&&(this.from=this.to=Math.max(d,this.from)+e)},sameSet:function(a){return!1},find:function(){return!this.line||!this.line.parent?null:{line:w(this.line),ch:this.from}},clear:function(){if(this.line){var a=db(this.line.marked,this);a!=-1&&this.line.marked.splice(a,1),this.line=null}}},r.inheritMarks=function(a,b){var c=new r(a),d=b&&b.marked;if(d)for(var e=0;e<d.length;++e)if(d[e].to==null&&d[e].style){var f=c.marked||(c.marked=[]),g=d[e],h=g.dup();f.push(h),h.attach(c)}return c},r.prototype={replace:function(a,b,c){var d=[],e=this.marked,f=b==null?this.text.length:b;s(0,a,this.styles,d),c&&d.push(c,null),s(f,this.text.length,this.styles,d),this.styles=d,this.text=this.text.slice(0,a)+c+this.text.slice(f),this.stateAfter=null;if(e){var g=c.length-(f-a);for(var h=0;h<e.length;++h){var i=e[h];i.clipTo(a==null,a||0,b==null,f,g),i.isDead()&&(i.detach(this),e.splice(h--,1))}}},split:function(a,b){var c=[b,null],d=this.marked;s(a,this.text.length,this.styles,c);var e=new r(b+this.text.slice(a),c);if(d)for(var f=0;f<d.length;++f){var g=d[f],h=g.split(a,b.length);h&&(e.marked||(e.marked=[]),e.marked.push(h),h.attach(e),h==g&&d.splice(f--,1))}return e},append:function(a){var b=this.text.length,c=a.marked,d=this.marked;this.text+=a.text,s(0,a.text.length,a.styles,this.styles);if(d)for(var e=0;e<d.length;++e)d[e].to==null&&(d[e].to=b);if(c&&c.length){d||(this.marked=d=[]);a:for(var e=0;e<c.length;++e){var f=c[e];if(!f.from)for(var g=0;g<d.length;++g){var h=d[g];if(h.to==b&&h.sameSet(f)){h.to=f.to==null?null:f.to+b,h.isDead()&&(h.detach(this),c.splice(e--,1));continue a}}d.push(f),f.attach(this),f.from+=b,f.to!=null&&(f.to+=b)}}},fixMarkEnds:function(a){var b=this.marked,c=a.marked;if(!b)return;for(var d=0;d<b.length;++d){var e=b[d],f=e.to==null;if(f&&c)for(var g=0;g<c.length;++g)if(c[g].sameSet(e)){f=!1;break}f&&(e.to=this.text.length)}},fixMarkStarts:function(){var a=this.marked;if(!a)return;for(var b=0;b<a.length;++b)a[b].from==null&&(a[b].from=0)},addMark:function(a){a.attach(this),this.marked==null&&(this.marked=[]),this.marked.push(a),this.marked.sort(function(a,b){return(a.from||0)-(b.from||0)})},highlight:function(a,b,c){var d=new o(this.text,c),e=this.styles,f=0,g=!1,h=e[0],i;this.text==""&&a.blankLine&&a.blankLine(b);while(!d.eol()){var j=a.token(d,b),k=this.text.slice(d.start,d.pos);d.start=d.pos,f&&e[f-1]==j?e[f-2]+=k:k&&(!g&&(e[f+1]!=j||f&&e[f-2]!=i)&&(g=!0),e[f++]=k,e[f++]=j,i=h,h=e[f]);if(d.pos>5e3){e[f++]=this.text.slice(d.pos),e[f++]=null;break}}return e.length!=f&&(e.length=f,g=!0),f&&e[f-2]!=i&&(g=!0),g||(e.length<5&&this.text.length<10?null:!1)},getTokenAt:function(a,b,c){var d=this.text,e=new o(d);while(e.pos<c&&!e.eol()){e.start=e.pos;var f=a.token(e,b)}return{start:e.start,end:e.pos,string:e.current(),className:f||null,state:b}},indentation:function(a){return U(this.text,null,a)},getHTML:function(a,b){function f(b,f){if(!b)return;d&&M&&b.charAt(0)==" "&&(b="\u00a0"+b.slice(1)),d=!1;if(b.indexOf("	")==-1){e+=b.length;var g=bb(b)}else{var g="";for(var h=0;;){var i=b.indexOf("	",h);if(i==-1){g+=bb(b.slice(h)),e+=b.length-h;break}e+=i-h;var j=a(e);g+=bb(b.slice(h,i))+j.html,e+=j.width,h=i+1}}f?c.push('<span class="',f,'">',g,"</span>"):c.push(g)}function k(a){return a?"cm-"+a.replace(/ +/g," cm-"):null}var c=[],d=!0,e=0,g=this.styles,h=this.text,i=this.marked,j=h.length;b!=null&&(j=Math.min(b,j));if(!h&&b==null)f(" ");else if(!i||!i.length)for(var l=0,m=0;m<j;l+=2){var n=g[l],o=g[l+1],p=n.length;m+p>j&&(n=n.slice(0,j-m)),m+=p,f(n,k(o))}else{var q=0,l=0,r="",o,s=0,t=i[0].from||0,u=[],v=0;function w(){var a;while(v<i.length&&((a=i[v]).from==q||a.from==null))a.style!=null&&u.push(a),++v;t=v<i.length?i[v].from:Infinity;for(var b=0;b<u.length;++b){var c=u[b].to||Infinity;c==q?u.splice(b--,1):t=Math.min(c,t)}}var x=0;while(q<j){t==q&&w();var y=Math.min(j,t);for(;;){if(r){var z=q+r.length,A=o;for(var B=0;B<u.length;++B)A=(A?A+" ":"")+u[B].style;f(z>y?r.slice(0,y-q):r,A);if(z>=y){r=r.slice(y-q),q=y;break}q=z}r=g[l++],o=k(g[l++])}}}return c.join("")},cleanUp:function(){this.parent=null;if(this.marked)for(var a=0,b=this.marked.length;a<b;++a)this.marked[a].detach(this)}},t.prototype={chunkSize:function(){return this.lines.length},remove:function(a,b,c){for(var d=a,e=a+b;d<e;++d){var f=this.lines[d];this.height-=f.height,f.cleanUp();if(f.handlers)for(var g=0;g<f.handlers.length;++g)c.push(f.handlers[g])}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertHeight:function(a,b,c){this.height+=c,M?this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a)):this.lines.splice.apply(this.lines,[a,0].concat(b));for(var d=0,e=b.length;d<e;++d)b[d].parent=this},iterN:function(a,b,c){for(var d=a+b;a<d;++a)if(c(this.lines[a]))return!0}},u.prototype={chunkSize:function(){return this.size},remove:function(a,b,c){this.size-=b;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<f){var g=Math.min(b,f-a),h=e.height;e.remove(a,g,c),this.height-=h-e.height,f==g&&(this.children.splice(d--,1),e.parent=null);if((b-=g)==0)break;a=0}else a-=f}if(this.size-b<25){var i=[];this.collapse(i),this.children=[new t(i)],this.children[0].parent=this}},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insert:function(a,b){var c=0;for(var d=0,e=b.length;d<e;++d)c+=b[d].height;this.insertHeight(a,b,c)},insertHeight:function(a,b,c){this.size+=b.length,this.height+=c;for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<=g){f.insertHeight(a,b,c);if(f.lines&&f.lines.length>50){while(f.lines.length>50){var h=f.lines.splice(f.lines.length-25,25),i=new t(h);f.height-=i.height,this.children.splice(d+1,0,i),i.parent=this}this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(this.children.length<=10)return;var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new u(b);if(!a.parent){var d=new u(a.children);d.parent=a,a.children=[d,c],a=d}else{a.size-=c.size,a.height-=c.height;var e=db(a.parent.children,a);a.parent.children.splice(e+1,0,c)}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()},iter:function(a,b,c){this.iterN(a,b-a,c)},iterN:function(a,b,c){for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<g){var h=Math.min(b,g-a);if(f.iterN(a,h,c))return!0;if((b-=h)==0)break;a=0}else a-=g}}},z.prototype={addChange:function(a,b,c){this.undone.length=0;var d=+(new Date),e=this.done[this.done.length-1],f=e&&e[e.length-1],g=d-this.time;if(g>400||!f)this.done.push([{start:a,added:b,old:c}]);else if(f.start>a+c.length||f.start+f.added<a-f.added+f.old.length)e.push({start:a,added:b,old:c});else{var h=0;if(a<f.start){for(var i=f.start-a-1;i>=0;--i)f.old.unshift(c[i]);h=Math.min(0,b-c.length),f.added+=f.start-a+h,f.start=a}else f.start<a&&(h=a-f.start,b+=h);for(var i=f.added-h,j=c.length;i<j;++i)f.old.push(c[i]);f.added<b&&(f.added=b)}this.time=d}},a.e_stop=E,a.e_preventDefault=C,a.e_stopPropagation=D,a.connect=I,J.prototype={set:function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)}};var K=a.Pass={toString:function(){return"CodeMirror.Pass"}},L=/gecko\/\d{7}/i.test(navigator.userAgent),M=/MSIE \d/.test(navigator.userAgent),N=/MSIE [1-8]\b/.test(navigator.userAgent),O=M&&document.documentMode==5,P=/WebKit\//.test(navigator.userAgent),Q=/Chrome\//.test(navigator.userAgent),R=/KHTML\//.test(navigator.userAgent),S=function(){if(N)return!1;var a=document.createElement("div");return"draggable"in a||"dragDrop"in a}(),T="\n";(function(){var a=document.createElement("textarea");a.value="foo\nbar",a.value.indexOf("\r")>-1&&(T="\r\n")})(),document.documentElement.getBoundingClientRect!=null&&(W=function(a,b){try{var c=a.getBoundingClientRect();c={top:c.top,left:c.left}}catch(d){c={top:0,left:0}}if(!b)if(window.pageYOffset==null){var e=document.documentElement||document.body.parentNode;e.scrollTop==null&&(e=document.body),c.top+=e.scrollTop,c.left+=e.scrollLeft}else c.top+=window.pageYOffset,c.left+=window.pageXOffset;return c});var ab=document.createElement("pre");bb("a")=="\na"?bb=function(a){return ab.textContent=a,ab.innerHTML.slice(1)}:bb("	")!="	"&&(bb=function(a){return ab.innerHTML="",ab.appendChild(document.createTextNode(a)),ab.innerHTML}),a.htmlEscape=bb;var fb="\n\nb".split(/\n/).length!=3?function(a){var b=0,c,d=[];while((c=a.indexOf("\n",b))>-1)d.push(a.slice(b,a.charAt(c-1)=="\r"?c-1:c)),b=c+1;return d.push(a.slice(b)),d}:function(a){return a.split(/\r?\n/)};a.splitLines=fb;var gb=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return!b||b.parentElement()!=a?!1:b.compareEndPoints("StartToEnd",b)!=0};a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");var hb={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return a.keyNames=hb,function(){for(var a=0;a<10;a++)hb[a+48]=String(a);for(var a=65;a<=90;a++)hb[a]=String.fromCharCode(a);for(var a=1;a<=12;a++)hb[a+111]=hb[a+63235]="F"+a}(),a}();CodeMirror.defineMode("mysql",function(a){function d(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function h(a,b){var d=a.next();c=null;if(d=="$"||d=="?")return a.match(/^[\w\d]*/),"variable-2";if(d=="<"&&!a.match(/^[\s\u00a0=]/,!1))return a.match(/^[^\s\u00a0>]*>?/),"atom";if(d=='"'||d=="'")return b.tokenize=i(d),b.tokenize(a,b);if(d=="`")return b.tokenize=j(d),b.tokenize(a,b);if(/[{}\(\),\.;\[\]]/.test(d))return c=d,null;if(d!="-"){if(g.test(d))return a.eatWhile(g),null;if(d==":")return a.eatWhile(/[\w\d\._\-]/),"atom";a.eatWhile(/[_\w\d]/);if(a.eat(":"))return a.eatWhile(/[\w\d_\-]/),"atom";var h=a.current(),k;return e.test(h)?null:f.test(h)?"keyword":"variable"}ch2=a.next();if(ch2=="-")return a.skipToEnd(),"comment"}function i(a){return function(b,c){var d=!1,e;while((e=b.next())!=null){if(e==a&&!d){c.tokenize=h;break}d=!d&&e=="\\"}return"string"}}function j(a){return function(b,c){var d=!1,e;while((e=b.next())!=null){if(e==a&&!d){c.tokenize=h;break}d=!d&&e=="\\"}return"variable-2"}}function k(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function l(a){a.indent=a.context.indent,a.context=a.context.prev}var b=a.indentUnit,c,e=d(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","isblank","isliteral","union","a"]),f=d(["ACCESSIBLE","ALTER","AS","BEFORE","BINARY","BY","CASE","CHARACTER","COLUMN","CONTINUE","CROSS","CURRENT_TIMESTAMP","DATABASE","DAY_MICROSECOND","DEC","DEFAULT","DESC","DISTINCT","DOUBLE","EACH","ENCLOSED","EXIT","FETCH","FLOAT8","FOREIGN","GRANT","HIGH_PRIORITY","HOUR_SECOND","IN","INNER","INSERT","INT2","INT8","INTO","JOIN","KILL","LEFT","LINEAR","LOCALTIME","LONG","LOOP","MATCH","MEDIUMTEXT","MINUTE_SECOND","NATURAL","NULL","OPTIMIZE","OR","OUTER","PRIMARY","RANGE","READ_WRITE","REGEXP","REPEAT","RESTRICT","RIGHT","SCHEMAS","SENSITIVE","SHOW","SPECIFIC","SQLSTATE","SQL_CALC_FOUND_ROWS","STARTING","TERMINATED","TINYINT","TRAILING","UNDO","UNLOCK","USAGE","UTC_DATE","VALUES","VARCHARACTER","WHERE","WRITE","ZEROFILL","ALL","AND","ASENSITIVE","BIGINT","BOTH","CASCADE","CHAR","COLLATE","CONSTRAINT","CREATE","CURRENT_TIME","CURSOR","DAY_HOUR","DAY_SECOND","DECLARE","DELETE","DETERMINISTIC","DIV","DUAL","ELSEIF","EXISTS","FALSE","FLOAT4","FORCE","FULLTEXT","HAVING","HOUR_MINUTE","IGNORE","INFILE","INSENSITIVE","INT1","INT4","INTERVAL","ITERATE","KEYS","LEAVE","LIMIT","LOAD","LOCK","LONGTEXT","MASTER_SSL_VERIFY_SERVER_CERT","MEDIUMINT","MINUTE_MICROSECOND","MODIFIES","NO_WRITE_TO_BINLOG","ON","OPTIONALLY","OUT","PRECISION","PURGE","READS","REFERENCES","RENAME","REQUIRE","REVOKE","SCHEMA","SELECT","SET","SPATIAL","SQLEXCEPTION","SQL_BIG_RESULT","SSL","TABLE","TINYBLOB","TO","TRUE","UNIQUE","UPDATE","USING","UTC_TIMESTAMP","VARCHAR","WHEN","WITH","YEAR_MONTH","ADD","ANALYZE","ASC","BETWEEN","BLOB","CALL","CHANGE","CHECK","CONDITION","CONVERT","CURRENT_DATE","CURRENT_USER","DATABASES","DAY_MINUTE","DECIMAL","DELAYED","DESCRIBE","DISTINCTROW","DROP","ELSE","ESCAPED","EXPLAIN","FLOAT","FOR","FROM","GROUP","HOUR_MICROSECOND","IF","INDEX","INOUT","INT","INT3","INTEGER","IS","KEY","LEADING","LIKE","LINES","LOCALTIMESTAMP","LONGBLOB","LOW_PRIORITY","MEDIUMBLOB","MIDDLEINT","MOD","NOT","NUMERIC","OPTION","ORDER","OUTFILE","PROCEDURE","READ","REAL","RELEASE","REPLACE","RETURN","RLIKE","SECOND_MICROSECOND","SEPARATOR","SMALLINT","SQL","SQLWARNING","SQL_SMALL_RESULT","STRAIGHT_JOIN","THEN","TINYTEXT","TRIGGER","UNION","UNSIGNED","USE","UTC_TIME","VARBINARY","VARYING","WHILE","XOR","FULL","COLUMNS","MIN","MAX","STDEV","COUNT"]),g=/[*+\-<>=&|]/;return{startState:function(a){return{tokenize:h,context:null,indent:0,col:0}},token:function(a,b){a.sol()&&(b.context&&b.context.align==null&&(b.context.align=!1),b.indent=a.indentation());if(a.eatSpace())return null;var d=b.tokenize(a,b);d!="comment"&&b.context&&b.context.align==null&&b.context.type!="pattern"&&(b.context.align=!0);if(c=="(")k(b,")",a.column());else if(c=="[")k(b,"]",a.column());else if(c=="{")k(b,"}",a.column());else if(/[\]\}\)]/.test(c)){while(b.context&&b.context.type=="pattern")l(b);b.context&&c==b.context.type&&l(b)}else c=="."&&b.context&&b.context.type=="pattern"?l(b):/atom|string|variable/.test(d)&&b.context&&(/[\}\]]/.test(b.context.type)?k(b,"pattern",a.column()):b.context.type=="pattern"&&!b.context.align&&(b.context.align=!0,b.context.col=a.column()));return d},indent:function(a,c){var d=c&&c.charAt(0),e=a.context;if(/[\]\}]/.test(d))while(e&&e.type=="pattern")e=e.prev;var f=e&&d==e.type;return e?e.type=="pattern"?e.col:e.align?e.col+(f?0:1):e.indent+(f?0:b):0}}}),CodeMirror.defineMIME("text/x-mysql","mysql"),CodeMirror.runMode=function(a,b,c,d){var e=CodeMirror.getMode(CodeMirror.defaults,b),f=c.nodeType==1,g=d&&d.tabSize||CodeMirror.defaults.tabSize;if(f){var h=c,i=[],j=0;c=function(a,b){if(a=="\n"){i.push("<br>"),j=0;return}var c="";for(var d=0;;){var e=a.indexOf("	",d);if(e==-1){c+=CodeMirror.htmlEscape(a.slice(d)),j+=a.length-d;break}j+=e-d,c+=CodeMirror.htmlEscape(a.slice(d,e));var f=g-j%g;j+=f;for(var h=0;h<f;++h)c+=" ";d=e+1}b?i.push('<span class="cm-'+CodeMirror.htmlEscape(b)+'">'+c+"</span>"):i.push(c)}}var k=CodeMirror.splitLines(a),l=CodeMirror.startState(e);for(var m=0,n=k.length;m<n;++m){m&&c("\n");var o=new CodeMirror.StringStream(k[m]);while(!o.eol()){var p=e.token(o,l);c(o.current(),p,m,o.start),o.start=o.pos}}f&&(h.innerHTML=i.join(""))}