haste-server/static/codemirror.min.js

1 line
122 KiB
JavaScript

var CodeMirror=function(){function a(d,e){function bS(a){return a>=0&&a<bq.size}function bU(a){return u(bq,a)}function bV(a,b){bH=!0;var c=b-a.height;for(var d=a;d;d=d.parent)d.height+=c}function bW(a){var b={line:0,ch:0};ch(b,{line:bq.size-1,ch:bU(bq.size-1).text.length},_(a),b,b),bB=!0}function bX(a){var b=[];return bq.iter(0,bq.size,function(a){b.push(a.text)}),b.join("\n")}function bY(a){function j(a){var b=dA(a,!0);if(b&&!T(b,g)){bs||cf(),g=b,cI(d,b),bB=!1;var c=cB();if(b.line>=c.to||b.line<c.from)h=setTimeout(dN(function(){j(a)}),150)}}cH(G(a,"shiftKey"));for(var b=E(a);b!=C;b=b.parentNode)if(b.parentNode==bc&&b!=bd)return;for(var b=E(a);b!=C;b=b.parentNode)if(b.parentNode==bf)return f.onGutterClick&&f.onGutterClick(bT,Z(bf.childNodes,b)+bK,a),B(a);var d=dA(a);switch(F(a)){case 3:K&&!c&&dB(a);return;case 2:d&&cL(d.line,d.ch,!0);return}if(!d){E(a)==P&&B(a);return}bs||cf();var e=+(new Date);if(bw&&bw.time>e-400&&T(bw.pos,d))return B(a),setTimeout(cx,20),cU(d.line);if(bv&&bv.time>e-400&&T(bv.pos,d))return bw={time:e,pos:d},B(a),cT(d);bv={time:e,pos:d};var g=d,h;if(J&&!f.readOnly&&!T(bt.from,bt.to)&&!U(d,bt.from)&&!U(bt.to,d)){M&&(bg.draggable=!0);var i=H(z,"mouseup",dN(function(b){M&&(bg.draggable=!1),by=!1,i(),Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)<10&&(B(b),cL(d.line,d.ch,!0),cx())}),!0);by=!0;return}B(a),cL(d.line,d.ch,!0);var k=H(z,"mousemove",dN(function(a){clearTimeout(h),B(a),j(a)}),!0),i=H(z,"mouseup",dN(function(a){clearTimeout(h);var b=dA(a);b&&cI(d,b),B(a),cx(),bB=!0,k(),i()}),!0)}function bZ(a){for(var b=E(a);b!=C;b=b.parentNode)if(b.parentNode==bf)return B(a);var c=dA(a);if(!c)return;bw={time:+(new Date),pos:c},B(a),cT(c)}function b$(a){a.preventDefault();var b=dA(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=cN(b),dN(function(){var a=cm(g.join(""),b,b);cI(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=bt.from,k=bt.to;cI(b,b),by&&cm("",j,k),cn(g),cx()}}catch(a){}}function b_(a){var b=cq();X(b),a.dataTransfer.setDragImage(W,0,0),a.dataTransfer.setData("Text",b)}function ca(a){function g(){return c.call?c.call(null,bT):c}var b=bb[G(a,"keyCode")],c=i[f.keyMap].auto,d,e;if(b==null||a.altGraphKey)return c&&(f.keyMap=g()),null;G(a,"altKey")&&(b="Alt-"+b),G(a,"ctrlKey")&&(b="Ctrl-"+b),G(a,"metaKey")&&(b="Cmd-"+b),G(a,"shiftKey")&&(d=j("Shift-"+b,f.extraKeys,f.keyMap))?e=!0:d=j(b,f.extraKeys,f.keyMap),typeof d=="string"&&(h.propertyIsEnumerable(d)?d=h[d]:d=null),c&&(d||!k(a))&&(f.keyMap=g());if(!d)return!1;var l=bu;try{f.readOnly&&(bA=!0),e&&(bu=null),d(bT)}finally{bu=l,bA=!1}return B(a),!0}function cc(a){bs||cf(),L&&a.keyCode==27&&(a.returnValue=!1);if(f.onKeyEvent&&f.onKeyEvent(bT,A(a)))return;var b=G(a,"keyCode");cH(b==16||G(a,"shiftKey"));var d=ca(a);window.opera&&(cb=d?b:null,!d&&b==88&&G(a,c?"metaKey":"ctrlKey")&&cn(""))}function cd(a){if(f.onKeyEvent&&f.onKeyEvent(bT,A(a)))return;var b=G(a,"keyCode"),c=G(a,"charCode");if(window.opera&&b==cb){cb=null,B(a);return}if(window.opera&&!a.which&&ca(a))return;if(f.electricChars&&bp.electricChars&&f.smartIndent&&!f.readOnly){var d=String.fromCharCode(c==null?b:c);bp.electricChars.indexOf(d)>-1&&setTimeout(dN(function(){cW(bt.to.line,"smart")}),75)}ct()}function ce(a){if(f.onKeyEvent&&f.onKeyEvent(bT,A(a)))return;G(a,"keyCode")==16&&(bu=null)}function cf(){if(f.readOnly=="nocursor")return;bs||(f.onFocus&&f.onFocus(bT),bs=!0,C.className.search(/\bCodeMirror-focused\b/)==-1&&(C.className+=" CodeMirror-focused"),bG||cw(!0)),cs(),dC()}function cg(){bs&&(f.onBlur&&f.onBlur(bT),bs=!1,bN&&dN(function(){bN&&(bN(),bN=null)})(),C.className=C.className.replace(" CodeMirror-focused","")),clearInterval(bo),setTimeout(function(){bs||(bu=null)},150)}function ch(a,b,c,d,e){if(bA)return;if(bQ){var g=[];bq.iter(a.line,b.line+1,function(a){g.push(a.text)}),bQ.addChange(a.line,c.length,g);while(bQ.done.length>f.undoDepth)bQ.done.shift()}cl(a,b,c,d,e)}function ci(a,b,c){var d=a.pop(),e=d?d.length:0,f=[];for(var g=c>0?0:e-1,h=c>0?e:-1;g!=h;g+=c){var i=d[g],j=[],k=i.start+i.added;bq.iter(i.start,k,function(a){j.push(a.text)}),f.push({start:i.start,added:i.old.length,old:j});var l=cN({line:i.start+i.old.length-1,ch:Y(j[j.length-1],i.old[i.old.length-1])});cl({line:i.start,ch:0},{line:k-1,ch:bU(k-1).text.length},i.old,l,l)}bB=!0,b.push(f)}function cj(){ci(bQ.done,bQ.undone,-1)}function ck(){ci(bQ.undone,bQ.done,1)}function cl(a,b,c,d,e){function y(a){return a<=Math.min(b.line,b.line+s)?a:a+s}if(bA)return;var g=!1,h=bO.length;f.lineWrapping||bq.iter(a.line,b.line,function(a){if(a.text.length==h)return g=!0,!0});if(a.line!=b.line||c.length>1)bH=!0;var i=b.line-a.line,j=bU(a.line),k=bU(b.line);if(a.ch==0&&b.ch==0&&c[c.length-1]==""){var l=[],m=null;a.line?(m=bU(a.line-1),m.fixMarkEnds(k)):k.fixMarkStarts();for(var n=0,o=c.length-1;n<o;++n)l.push(q.inheritMarks(c[n],m));i&&bq.remove(a.line,i,bI),l.length&&bq.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(q.inheritMarks(c[n],j));l.push(k),bq.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),bq.remove(a.line+1,i,bI);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(q.inheritMarks(c[n],j));i>1&&bq.remove(a.line+1,i-1,bI),bq.insert(a.line+1,l)}if(f.lineWrapping){var p=P.clientWidth/dx()-3;bq.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&&bV(a,b)})}else bq.iter(a.line,n+c.length,function(a){var b=a.text;b.length>h&&(bO=b,h=b.length,bP=null,g=!1)}),g&&(h=0,bO="",bP=null,bq.iter(0,bq.size,function(a){var b=a.text;b.length>h&&(h=b.length,bO=b)}));var r=[],s=c.length-i-1;for(var n=0,t=br.length;n<t;++n){var u=br[n];u<a.line?r.push(u):u>b.line&&r.push(u+s)}var v=a.line+Math.min(c.length,500);dH(a.line,v),r.push(v),br=r,dJ(100),bD.push({from:a.line,to:b.line+1,diff:s});var w={from:a,to:b,text:c};if(bE){for(var x=bE;x.next;x=x.next);x.next=w}else bE=w;cJ(d,e,y(bt.from.line),y(bt.to.line)),P.clientHeight&&(bc.style.height=bq.height*du()+2*dy()+"px")}function cm(a,b,c){function d(d){if(U(d,b))return d;if(!U(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=cN(b),c?c=cN(c):c=b,a=_(a);var e;return co(a,b,c,function(a){return e=a,{from:d(bt.from),to:d(bt.to)}}),e}function cn(a,b){co(_(a),bt.from,bt.to,function(a){return b=="end"?{from:a,to:a}:b=="start"?{from:bt.from,to:bt.from}:{from:bt.from,to:a}})}function co(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});ch(b,c,a,f.from,f.to)}function cp(a,b){var c=a.line,d=b.line;if(c==d)return bU(c).text.slice(a.ch,b.ch);var e=[bU(c).text.slice(a.ch)];return bq.iter(c+1,d,function(a){e.push(a.text)}),e.push(bU(d).text.slice(0,b.ch)),e.join("\n")}function cq(){return cp(bt.from,bt.to)}function cs(){if(cr)return;bm.set(f.pollInterval,function(){dK(),cv(),bs&&cs(),dL()})}function ct(){function b(){dK();var c=cv();!c&&!a?(a=!0,bm.set(60,b)):(cr=!1,cs()),dL()}var a=!1;cr=!0,bm.set(20,b)}function cv(){if(bG||!bs||ba(O)||f.readOnly)return!1;var a=O.value;if(a==cu)return!1;bu=null;var b=0,c=Math.min(cu.length,a.length);while(b<c&&cu[b]==a[b])++b;return b<cu.length?bt.from={line:bt.from.line,ch:bt.from.ch-(cu.length-b)}:bz&&T(bt.from,bt.to)&&(bt.to={line:bt.to.line,ch:Math.min(bU(bt.to.line).text.length,bt.to.ch+(a.length-b))}),cn(a.slice(b),"end"),cu=a,!0}function cw(a){T(bt.from,bt.to)?a&&(cu=O.value=""):(cu="",O.value=cq(),S(O))}function cx(){f.readOnly!="nocursor"&&O.focus()}function cy(){if(!bi.getBoundingClientRect)return;var a=bi.getBoundingClientRect();if(L&&a.top==a.bottom)return;var b=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(a.top<0||a.bottom>b)&&bi.scrollIntoView()}function cz(){var a=dn(bt.inverted?bt.from:bt.to),b=f.lineWrapping?Math.min(a.x,bg.offsetWidth):a.x;return cA(b,a.y,b,a.yBot)}function cA(a,b,c,d){var e=dz(),g=dy(),h=du();b+=g,d+=g,a+=e,c+=e;var i=P.clientHeight,j=P.scrollTop,k=!1,l=!0;b<j?(P.scrollTop=Math.max(0,b-2*h),k=!0):d>j+i&&(P.scrollTop=d+h-i,k=!0);var m=P.clientWidth,n=P.scrollLeft,o=f.fixedGutter?be.clientWidth:0;return a<n+o?(a<50&&(a=0),P.scrollLeft=Math.max(0,a-10-o),k=!0):c>m+n-3&&(P.scrollLeft=c+10-m,k=!0,c>bc.clientWidth&&(l=!1)),k&&f.onScroll&&f.onScroll(bT),l}function cB(){var a=du(),b=P.scrollTop-dy(),c=Math.max(0,Math.floor(b/a)),d=Math.ceil((b+P.clientHeight)/a);return{from:w(bq,c),to:w(bq,d)}}function cC(a,b){if(!P.clientWidth){bK=bL=bJ=0;return}var c=cB();if(a!==!0&&a.length==0&&c.from>bK&&c.to<bL)return;var d=Math.max(c.from-100,0),e=Math.min(bq.size,c.to+100);bK<d&&d-bK<20&&(d=bK),bL>e&&bL-e<20&&(e=Math.min(bq.size,bL));var g=a===!0?[]:cD([{from:bK,to:bL,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=du(),l=be.style.display;bk.style.display="none",cE(d,e,g),bk.style.display=be.style.display="";var m=d!=bK||e!=bL||bM!=P.clientHeight+k;m&&(bM=P.clientHeight+k),bK=d,bL=e,bJ=x(bq,d),bd.style.top=bJ*k+"px",P.clientHeight&&(bc.style.height=bq.height*k+2*dy()+"px");if(bk.childNodes.length!=bL-bK)throw new Error("BAD PATCH! "+JSON.stringify(g)+" size="+(bL-bK)+" nodes="+bk.childNodes.length);if(f.lineWrapping){bP=P.clientWidth;var n=bk.firstChild,o=!1;bq.iter(bK,bL,function(a){if(!a.hidden){var b=Math.round(n.offsetHeight/k)||1;a.height!=b&&(bV(a,b),bH=o=!0)}n=n.nextSibling}),o&&(bc.style.height=bq.height*k+2*dy()+"px")}else bP==null&&(bP=dj(bO)),bP>P.clientWidth?(bg.style.width=bP+"px",bc.style.width="",bc.style.width=P.scrollWidth+"px"):bg.style.width=bc.style.width="";return be.style.display=l,(m||bH)&&cF(),cG(),!b&&f.onUpdate&&f.onUpdate(bT),!0}function cD(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 cE(a,b,c){if(!c.length)bk.innerHTML="";else{function d(a){var b=a.nextSibling;return a.parentNode.removeChild(a),b}var e=0,f=bk.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=bk.firstChild,j=a,m=z.createElement("div"),n;bq.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.getHTML(c$)+"</pre>";a.className&&(b='<div style="position: relative"><pre class="'+a.className+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>'+b+"</div>")}m.innerHTML=b,bk.insertBefore(m.firstChild,f)}else f=f.nextSibling;++j})}function cF(){if(!f.gutter&&!f.lineNumbers)return;var a=bd.offsetHeight,b=P.clientHeight;be.style.height=(a-b<2?b:a)+"px";var c=[],d=bK;bq.iter(bK,Math.max(bL,bK+1),function(a){if(a.hidden)c.push("<pre></pre>");else{var b=a.gutterMarker,e=f.lineNumbers?d+f.firstLineNumber:null;b&&b.text?e=b.text.replace("%N%",e!=null?e:""):e==null&&(e="\u00a0"),c.push(b&&b.style?'<pre class="'+b.style+'">':"<pre>",e);for(var g=1;g<a.height;++g)c.push("<br/>&#160;");c.push("</pre>")}++d}),be.style.display="none",bf.innerHTML=c.join("");var e=String(bq.size).length,g=bf.firstChild,h=R(g),i="";while(h.length+i.length<e)i+="\u00a0";i&&g.insertBefore(z.createTextNode(i),g.firstChild),be.style.display="",bg.style.marginLeft=be.offsetWidth+"px",bH=!1}function cG(){var a=T(bt.from,bt.to),b=dn(bt.from,!0),c=a?b:dn(bt.to,!0),d=bt.inverted?b:c,e=du(),g=Q(C),h=Q(bk);N.style.top=Math.max(0,Math.min(P.offsetHeight,d.y+h.top-g.top))+"px",N.style.left=Math.max(0,Math.min(P.offsetWidth,d.x+h.left-g.left))+"px";if(a)bi.style.top=d.y+"px",bi.style.left=(f.lineWrapping?Math.min(d.x,bg.offsetWidth):d.x)+"px",bi.style.display="",bj.style.display="none";else{var i=b.y==c.y,j="";function k(a,b,c,d){j+='<div class="CodeMirror-selected" style="position: absolute; left: '+a+"px; top: "+b+"px; right: "+c+"px; height: "+d+'px"></div>'}if(bt.from.ch&&b.y>=0){var l=i?bg.clientWidth-c.x:0;k(b.x,b.y,l,e)}var m=Math.max(0,b.y+(bt.from.ch?e:0)),n=Math.min(c.y,bg.clientHeight)-m;n>.2*e&&k(0,m,0,n),(!i||!bt.from.ch)&&c.y<bg.clientHeight-.5*e&&k(0,c.y,bg.clientWidth-c.x,e),bj.innerHTML=j,bi.style.display="none",bj.style.display=""}}function cH(a){a?bu=bu||(bt.inverted?bt.to:bt.from):bu=null}function cI(a,b){var c=bu&&cN(bu);c&&(U(c,a)?a=c:U(b,c)&&(b=c)),cJ(a,b),bC=!0}function cJ(a,b,c,d){cR=null,c==null&&(c=bt.from.line,d=bt.to.line);if(T(bt.from,a)&&T(bt.to,b))return;if(U(b,a)){var e=b;b=a,a=e}a.line!=c&&(a=cK(a,c,bt.from.ch)),b.line!=d&&(b=cK(b,d,bt.to.ch)),T(a,b)?bt.inverted=!1:T(a,bt.to)?bt.inverted=!1:T(b,bt.from)&&(bt.inverted=!0),bt.from=a,bt.to=b,bF=!0}function cK(a,b,c){function d(b){var d=a.line+b,e=b==1?bq.size:-1;while(d!=e){var f=bU(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=bU(a.line);return e.hidden?a.line>=b?d(1)||d(-1):d(-1)||d(1):a}function cL(a,b,c){var d=cN({line:a,ch:b||0});(c?cI:cJ)(d,d)}function cM(a){return Math.max(0,Math.min(a,bq.size-1))}function cN(a){if(a.line<0)return{line:0,ch:0};if(a.line>=bq.size)return{line:bq.size-1,ch:bU(bq.size-1).text.length};var b=a.ch,c=bU(a.line).text.length;return b==null||b>c?{line:a.line,ch:c}:b<0?{line:a.line,ch:0}:a}function cO(a,b){function g(){for(var b=d+a,c=a<0?-1:bq.size;b!=c;b+=a){var e=bU(b);if(!e.hidden)return d=b,f=e,!0}}function h(b){if(e==(a<0?0:f.text.length))if(!b&&g())e=a<0?f.text.length:0;else return!1;else e+=a;return!0}var c=bt.inverted?bt.from:bt.to,d=c.line,e=c.ch,f=bU(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($(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 cP(a,b){var c=a<0?bt.from:bt.to;if(bu||T(bt.from,bt.to))c=cO(a,b);cL(c.line,c.ch,!0)}function cQ(a,b){T(bt.from,bt.to)?a<0?cm("",cO(a,b),bt.to):cm("",bt.from,cO(a,b)):cm("",bt.from,bt.to),bC=!0}function cS(a,b){var c=0,d=dn(bt.inverted?bt.from:bt.to,!0);cR!=null&&(d.x=cR),b=="page"?c=Math.min(P.clientHeight,window.innerHeight||document.documentElement.clientHeight):b=="line"&&(c=du());var e=dp(d.x,d.y+c*a+2);cL(e.line,e.ch,!0),cR=d.x}function cT(a){var b=bU(a.line).text,c=a.ch,d=a.ch;while(c>0&&$(b.charAt(c-1)))--c;while(d<b.length&&$(b.charAt(d)))++d;cI({line:a.line,ch:c},{line:a.line,ch:d})}function cU(a){cI({line:a,ch:0},cN({line:a+1,ch:0}))}function cV(a){if(T(bt.from,bt.to))return cW(bt.from.line,a);var b=bt.to.line-(bt.to.ch?0:1);for(var c=bt.from.line;c<=b;++c)cW(c,a)}function cW(a,b){b||(b="add");if(b=="smart")if(!bp.indent)b="prev";else var c=dG(a);var d=bU(a),e=d.indentation(f.tabSize),g=d.text.match(/^\s*/)[0],h;b=="prev"?a?h=bU(a-1).indentation(f.tabSize):h=0:b=="smart"?h=bp.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(bt.from.line!=a&&bt.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+="\t";while(k<h)++k,j+=" "}cm(j,{line:a,ch:0},{line:a,ch:g.length})}function cX(){bp=a.getMode(f,f.mode),bq.iter(0,bq.size,function(a){a.stateAfter=null}),br=[0],dJ()}function cY(){var a=f.gutter||f.lineNumbers;be.style.display=a?"":"none",a?bH=!0:bk.parentNode.style.marginLeft=0}function cZ(a,b){if(f.lineWrapping){C.className+=" CodeMirror-wrap";var c=P.clientWidth/dx()-3;bq.iter(0,bq.size,function(a){if(a.hidden)return;var b=Math.ceil(a.text.length/c)||1;b!=1&&bV(a,b)}),bg.style.width=bc.style.width=""}else C.className=C.className.replace(" CodeMirror-wrap",""),bP=null,bO="",bq.iter(0,bq.size,function(a){a.height!=1&&!a.hidden&&bV(a,1),a.text.length>bO.length&&(bO=a.text)});bD.push({from:0,to:bq.size})}function c$(a){var b=f.tabSize-a%f.tabSize;for(var c='<span class="cm-tab">',d=0;d<b;++d)c+=" ";return{html:c+"</span>",width:b}}function c_(){P.className=P.className.replace(/\s*cm-s-\w+/g,"")+f.theme.replace(/(^|\s)\s*/g," cm-s-")}function da(){this.set=[]}function db(a,b,c){function e(a,b,c,e){bU(a).addMark(new o(b,c,e,d.set))}a=cN(a),b=cN(b);var d=new da;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 bD.push({from:a.line,to:b.line+1}),d}function dc(a){a=cN(a);var b=new p(a.ch);return bU(a.line).addMark(b),b}function dd(a,b,c){return typeof a=="number"&&(a=bU(cM(a))),a.gutterMarker={text:b,style:c},bH=!0,a}function de(a){typeof a=="number"&&(a=bU(cM(a))),a.gutterMarker=null,bH=!0}function df(a,b){var c=a,d=a;typeof a=="number"?d=bU(cM(a)):c=v(a);if(c==null)return null;if(b(d,c))bD.push({from:c,to:c+1});else return null;return d}function dg(a,b){return df(a,function(a){if(a.className!=b)return a.className=b,!0})}function dh(a,b){return df(a,function(a,c){if(a.hidden!=b){a.hidden=b,bV(a,b?0:1);var d=bt.from.line,e=bt.to.line;if(b&&(d==c||e==c)){var f=d==c?cK({line:d,ch:0},d,0):bt.from,g=e==c?cK({line:e,ch:0},e,0):bt.to;cJ(f,g)}return bH=!0}})}function di(a){if(typeof a=="number"){if(!bS(a))return null;var b=a;a=bU(a);if(!a)return null}else{var b=v(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}}function dj(a){return bh.innerHTML="<pre><span>x</span></pre>",bh.firstChild.firstChild.firstChild.nodeValue=a,bh.firstChild.firstChild.offsetWidth||10}function dk(a,b){function e(a){return bh.innerHTML="<pre><span>"+c.getHTML(c$,a)+"</span></pre>",bh.firstChild.firstChild.offsetWidth}if(b<=0)return 0;var c=bU(a),d=c.text,f=0,g=0,h=d.length,i,j=Math.min(h,Math.ceil(b/dx()));for(;;){var k=e(j);if(k<=b&&j<h)j=Math.min(h,Math.ceil(j*1.2));else{i=k,h=j;break}}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 dm(a,b){if(b==0)return{top:0,left:0};var c="";if(f.lineWrapping){var d=a.text.indexOf(" ",b+2);c=X(a.text.slice(b+1,d<0?a.text.length:d+(L?5:0)))}bh.innerHTML="<pre>"+a.getHTML(c$,b)+'<span id="CodeMirror-temp-'+dl+'">'+X(a.text.charAt(b)||" ")+"</span>"+c+"</pre>";var e=document.getElementById("CodeMirror-temp-"+dl),g=e.offsetTop,h=e.offsetLeft;if(L&&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 dn(a,b){var c,d=du(),e=d*(x(bq,a.line)-(b?bJ:0));if(a.ch==0)c=0;else{var g=dm(bU(a.line),a.ch);c=g.left,f.lineWrapping&&(e+=Math.max(0,g.top))}return{x:c,y:e,yBot:e+d}}function dp(a,b){function l(a){var b=dm(h,a);if(j){var d=Math.round(b.top/c);return Math.max(0,b.left+(d-k)*P.clientWidth)}return b.left}b<0&&(b=0);var c=du(),d=dx(),e=bJ+Math.floor(b/c),g=w(bq,e);if(g>=bq.size)return{line:bq.size-1,ch:bU(bq.size-1).text.length};var h=bU(g),i=h.text,j=f.lineWrapping,k=j?e-x(bq,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*P.clientWidth*.9)/d));for(;;){var r=l(q);if(r<=a&&q<o)q=Math.min(o,Math.ceil(q*1.2));else{p=r,o=q;break}}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 dq(a){var b=dn(a,!0),c=Q(bg);return{x:c.left+b.x,y:c.top+b.y,yBot:c.top+b.yBot}}function du(){if(dt==null){dt="<pre>";for(var a=0;a<49;++a)dt+="x<br/>";dt+="x</pre>"}var b=bk.clientHeight;return b==ds?dr:(ds=b,bh.innerHTML=dt,dr=bh.firstChild.offsetHeight/50||1,bh.innerHTML="",dr)}function dx(){return P.clientWidth==dw?dv:(dw=P.clientWidth,dv=dj("x"))}function dy(){return bg.offsetTop}function dz(){return bg.offsetLeft}function dA(a,b){var c=Q(P,!0),d,e;try{d=a.clientX,e=a.clientY}catch(a){return null}if(!b&&(d-c.left>P.clientWidth||e-c.top>P.clientHeight))return null;var f=Q(bg,!0);return dp(d-f.left,e-f.top)}function dB(a){function e(){var a=_(O.value).join("\n");a!=d&&dN(cn)(a,"end"),N.style.position="relative",O.style.cssText=c,bG=!1,cw(!0),cs()}var b=dA(a);if(!b||window.opera)return;(T(bt.from,bt.to)||U(b,bt.from)||!U(b,bt.to))&&dN(cL)(b.line,b.ch);var c=O.style.cssText;N.style.position="absolute",O.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);",bG=!0;var d=O.value=cq();cx(),S(O);if(K){D(a);var f=H(window,"mouseup",function(){f(),setTimeout(e,20)},!0)}else setTimeout(e,50)}function dC(){clearInterval(bo);var a=!0;bi.style.visibility="",bo=setInterval(function(){bi.style.visibility=(a=!a)?"":"hidden"},650)}function dE(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=dD[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=bt.inverted?bt.from:bt.to,c=bU(b.line),d=b.ch-1,e=d>=0&&dD[c.text.charAt(d)]||dD[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,bq.size):Math.max(-1,k-100);k!=l;k+=h){var c=bU(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=db({line:b.line,ch:d},{line:b.line,ch:d+1},m),t=r.pos!=null&&db({line:k,ch:r.pos},{line:k,ch:r.pos+1},m),u=dN(function(){s.clear(),t&&t.clear()});a?setTimeout(u,800):bN=u}function dF(a){var b,c;for(var d=a,e=a-40;d>e;--d){if(d==0)return 0;var g=bU(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 dG(a){var b=dF(a),c=b&&bU(b-1).stateAfter;return c?c=l(bp,c):c=m(bp),bq.iter(b,a,function(a){a.highlight(bp,c,f.tabSize),a.stateAfter=l(bp,c)}),b<a&&bD.push({from:b,to:a}),a<bq.size&&!bU(a).stateAfter&&br.push(a),c}function dH(a,b){var c=dG(a);bq.iter(a,b,function(a){a.highlight(bp,c,f.tabSize),a.stateAfter=l(bp,c)})}function dI(){var a=+(new Date)+f.workTime,b=br.length;while(br.length){if(!bU(bK).stateAfter)var c=bK;else var c=br.pop();if(c>=bq.size)continue;var d=dF(c),e=d&&bU(d-1).stateAfter;e?e=l(bp,e):e=m(bp);var g=0,h=bp.compareStates,i=!1,j=d,k=!1;bq.iter(j,bq.size,function(b){var d=b.stateAfter;if(+(new Date)>a)return br.push(j),dJ(f.workDelay),i&&bD.push({from:c,to:j+1}),k=!0;var m=b.highlight(bp,e,f.tabSize);m&&(i=!0),b.stateAfter=l(bp,e);if(h){if(d&&h(d,e))return!0}else if(m!==!1||!d)g=0;else if(++g>3&&(!bp.indent||bp.indent(d,"")==bp.indent(e,"")))return!0;++j});if(k)return;i&&bD.push({from:c,to:j+1})}b&&f.onHighlightComplete&&f.onHighlightComplete(bT)}function dJ(a){if(!br.length)return;bn.set(a,dN(dI))}function dK(){bB=bC=bE=null,bD=[],bF=!1,bI=[]}function dL(){var a=!1,b;bF&&(a=!cz()),bD.length?b=cC(bD,!0):(bF&&cG(),bH&&cF()),a&&cz(),bF&&(cy(),dC()),bs&&!bG&&(bB===!0||bB!==!1&&bF)&&cw(bC),bF&&f.matchBrackets&&setTimeout(dN(function(){bN&&(bN(),bN=null),T(bt.from,bt.to)&&dE(!1)}),20);var c=bE,d=bI;bF&&f.onCursorActivity&&f.onCursorActivity(bT),c&&f.onChange&&bT&&f.onChange(bT,c);for(var e=0;e<d.length;++e)d[e](bT);b&&f.onUpdate&&f.onUpdate(bT)}function dN(a){return function(){dM++||dK();try{var b=a.apply(this,arguments)}finally{--dM||dL()}return b}}var f={},n=a.defaults;for(var r in n)n.hasOwnProperty(r)&&(f[r]=(e&&e.hasOwnProperty(r)?e:n)[r]);var z=f.document,C=z.createElement("div");C.className="CodeMirror"+(f.lineWrapping?" CodeMirror-wrap":""),C.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(C):d(C);var N=C.firstChild,O=N.firstChild,P=C.lastChild,bc=P.firstChild,bd=bc.firstChild,be=bd.firstChild,bf=be.firstChild,bg=be.nextSibling.firstChild,bh=bg.firstChild,bi=bh.nextSibling,bj=bi.nextSibling,bk=bj.nextSibling;c_(),b&&(O.style.width="0px"),M||(bg.draggable=!0),bg.style.outline="none",f.tabindex!=null&&(O.tabIndex=f.tabindex),!f.gutter&&!f.lineNumbers&&(be.style.display="none");try{dj("x")}catch(bl){throw bl.message.match(/runtime/i)&&(bl=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),bl}var bm=new I,bn=new I,bo,bp,bq=new t([new s([new q("")])]),br,bs;cX();var bt={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},bu,bv,bw,bx=0,by,bz=!1,bA=!1,bB,bC,bD,bE,bF,bG,bH,bI,bJ=0,bK=0,bL=0,bM=0,bN,bO="",bP;dN(function(){bW(f.value||""),bB=!1})();var bQ=new y;H(P,"mousedown",dN(bY)),H(P,"dblclick",dN(bZ)),H(bg,"dragstart",b_),H(bg,"selectstart",B),K||H(P,"contextmenu",dB),H(P,"scroll",function(){bx=P.scrollTop,cC([]),f.fixedGutter&&(be.style.left=P.scrollLeft+"px"),f.onScroll&&f.onScroll(bT)}),H(window,"resize",function(){cC(!0)}),H(O,"keyup",dN(ce)),H(O,"input",ct),H(O,"keydown",dN(cc)),H(O,"keypress",dN(cd)),H(O,"focus",cf),H(O,"blur",cg),H(P,"dragenter",D),H(P,"dragover",D),H(P,"drop",dN(b$)),H(P,"paste",function(){cx(),ct()}),H(O,"paste",ct),H(O,"cut",dN(function(){f.readOnly||cn("")}));var bR;try{bR=z.activeElement==O}catch(bl){}bR?setTimeout(cf,20):cg();var bT=C.CodeMirror={getValue:bX,setValue:dN(bW),getSelection:cq,replaceSelection:dN(cn),focus:function(){cx(),cf(),ct()},setOption:function(a,b){var c=f[a];f[a]=b,a=="mode"||a=="indentUnit"?cX():a=="readOnly"&&b=="nocursor"?(cg(),O.blur()):a=="readOnly"&&!b?cw(!0):a=="theme"?c_():a=="lineWrapping"&&c!=b?dN(cZ)():a=="tabSize"&&cC(!0);if(a=="lineNumbers"||a=="gutter"||a=="firstLineNumber"||a=="theme")cY(),cC(!0)},getOption:function(a){return f[a]},undo:dN(cj),redo:dN(ck),indentLine:dN(function(a,b){typeof b!="string"&&(b==null?b=f.smartIndent?"smart":"prev":b=b?"add":"subtract"),bS(a)&&cW(a,b)}),indentSelection:dN(cV),historySize:function(){return{undo:bQ.done.length,redo:bQ.undone.length}},clearHistory:function(){bQ=new y},matchBrackets:dN(function(){dE(!0)}),getTokenAt:dN(function(a){return a=cN(a),bU(a.line).getTokenAt(bp,dG(a.line),a.ch)}),getStateAfter:function(a){return a=cM(a==null?bq.size-1:a),dG(a+1)},cursorCoords:function(a){return a==null&&(a=bt.inverted),dq(a?bt.from:bt.to)},charCoords:function(a){return dq(cN(a))},coordsChar:function(a){var b=Q(bg);return dp(a.x-b.left,a.y-b.top)},markText:dN(db),setBookmark:dc,setMarker:dN(dd),clearMarker:dN(de),setLineClass:dN(dg),hideLine:dN(function(a){return dh(a,!0)}),showLine:dN(function(a){return dh(a,!1)}),onDeleteLine:function(a,b){if(typeof a=="number"){if(!bS(a))return null;a=bU(a)}return(a.handlers||(a.handlers=[])).push(b),a},lineInfo:di,addWidget:function(a,b,c,d,e){a=dn(cN(a));var f=a.yBot,g=a.x;b.style.position="absolute",bc.appendChild(b);if(d=="over")f=a.y;else if(d=="near"){var h=Math.max(P.offsetHeight,bq.height*du()),i=Math.max(bc.clientWidth,bg.clientWidth)-dz();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+dy()+"px",b.style.left=b.style.right="",e=="right"?(g=bc.clientWidth-b.offsetWidth,b.style.right="0px"):(e=="left"?g=0:e=="middle"&&(g=(bc.clientWidth-b.offsetWidth)/2),b.style.left=g+dz()+"px"),c&&cA(g,f,g+b.offsetWidth,f+b.offsetHeight)},lineCount:function(){return bq.size},clipPos:cN,getCursor:function(a){return a==null&&(a=bt.inverted),V(a?bt.from:bt.to)},somethingSelected:function(){return!T(bt.from,bt.to)},setCursor:dN(function(a,b,c){b==null&&typeof a.line=="number"?cL(a.line,a.ch,c):cL(a,b,c)}),setSelection:dN(function(a,b,c){(c?cI:cJ)(cN(a),cN(b||a))}),getLine:function(a){if(bS(a))return bU(a).text},getLineHandle:function(a){if(bS(a))return bU(a)},setLine:dN(function(a,b){bS(a)&&cm(b,{line:a,ch:0},{line:a,ch:bU(a).text.length})}),removeLine:dN(function(a){bS(a)&&cm("",{line:a,ch:0},cN({line:a+1,ch:0}))}),replaceRange:dN(cm),getRange:function(a,b){return cp(cN(a),cN(b))},execCommand:function(a){return h[a](bT)},moveH:dN(cP),deleteH:dN(cQ),moveV:dN(cS),toggleOverwrite:function(){bz?(bz=!1,bi.className=bi.className.replace(" CodeMirror-overwrite","")):(bz=!0,bi.className+=" CodeMirror-overwrite")},posFromIndex:function(a){var b=0,c;return bq.iter(0,bq.size,function(d){var e=d.text.length+1;if(e>a)return c=a,!0;a-=e,++b}),cN({line:b,ch:c})},indexFromPos:function(a){if(a.line<0||a.ch<0)return 0;var b=a.ch;return bq.iter(0,a.line,function(a){b+=a.text.length+1}),b},scrollTo:function(a,b){a!=null&&(P.scrollLeft=a),b!=null&&(P.scrollTop=b),cC([])},operation:function(a){return dN(a)()},refresh:function(){cC(!0),P.scrollHeight>bx&&(P.scrollTop=bx)},getInputField:function(){return O},getWrapperElement:function(){return C},getScrollerElement:function(){return P},getGutterElement:function(){return be}},cb=null,cr=!1,cu="",cR=null;da.prototype.clear=dN(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=v(e);a=Math.min(a,g),b=Math.max(b,g);for(var h=0;h<f.length;++h)f[h].set==this.set&&f.splice(h--,1)}a!=Infinity&&bD.push({from:a,to:b+1})}),da.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.set==this.set)if(h.from!=null||h.to!=null){var i=v(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 dl=Math.floor(Math.random()*16777215).toString(16),dr,ds,dt,dv,dw=0,dD={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},dM=0;for(var dO in g)g.propertyIsEnumerable(dO)&&!bT.propertyIsEnumerable(dO)&&(bT[dO]=g[dO]);return bT}function j(a,b,c){function d(a,b,c){var e=b[a];if(e!=null)return e;c==null&&(c=b.fallthrough);if(c==null)return b.catchall;if(typeof c=="string")return d(a,i[c]);for(var f=0,g=c.length;f<g;++f){e=d(a,i[c[f]]);if(e!=null)return e}return null}return b?d(a,b,c):d(a,i[c])}function k(a){var b=bb[G(a,"keyCode")];return b=="Ctrl"||b=="Alt"||b=="Shift"||b=="Mod"}function l(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 m(a,b,c){return a.startState?a.startState(b,c):!0}function n(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8}function o(a,b,c,d){this.from=a,this.to=b,this.style=c,this.set=d}function p(a){this.from=a,this.to=a,this.line=null}function q(a,b){this.styles=b||[a,null],this.text=a,this.height=1,this.marked=this.gutterMarker=this.className=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function r(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 s(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 t(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 u(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 v(a){if(a.parent==null)return null;var b=a.parent,c=Z(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 w(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 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.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 y(){this.time=0,this.done=[],this.undone=[]}function z(){D(this)}function A(a){return a.stop||(a.stop=z),a}function B(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function C(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function D(a){B(a),C(a)}function E(a){return a.target||a.srcElement}function F(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 G(a,b){var c=a.override&&a.override.hasOwnProperty(b);return c?a.override[b]:a[b]}function H(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 I(){this.id=null}function O(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)=="\t"?e+=c-e%c:++e;return e}function P(a){return a.currentStyle?a.currentStyle:window.getComputedStyle(a,null)}function Q(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&&P(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 R(a){return a.textContent||a.innerText||a.nodeValue||""}function S(a){b?(a.selectionStart=0,a.selectionEnd=a.value.length):a.select()}function T(a,b){return a.line==b.line&&a.ch==b.ch}function U(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function V(a){return{line:a.line,ch:a.ch}}function X(a){return W.textContent=a,W.innerHTML}function Y(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 Z(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 $(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,onKeyEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,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,document:window.document};var b=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),c=b||/Mac/.test(navigator.platform),d=/Win/.test(navigator.platform),e={},f={};a.defineMode=function(b,c){!a.defaults.mode&&b!="null"&&(a.defaults.mode=b),e[b]=c},a.defineMIME=function(a,b){f[a]=b},a.getMode=function(b,c){typeof c=="string"&&f.hasOwnProperty(c)&&(c=f[c]);if(typeof c=="string")var d=c,g={};else if(c!=null)var d=c.name,g=c;var h=e[d];return h?h(b,g||{}):(window.console&&console.warn("No mode "+d+" found, falling back to plain text."),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=!T(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("\t","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:"indentMore","Shift-Tab":"indentLess",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",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",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);if(b.form){var e=H(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=l,a.startState=m,n.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 O(this.string,this.start,this.tabSize)},indentation:function(){return O(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=n,o.prototype={attach:function(a){this.set.push(a)},detach:function(a){var b=Z(this.set,a);b>-1&&this.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 o(c,d,this.style,this.set)},dup:function(){return new o(null,null,this.style,this.set)},clipTo:function(a,b,c,d,e){this.from!=null&&this.from>=b&&(this.from=Math.max(d,this.from)+e),this.to!=null&&this.to>b&&(this.to=d<this.to?this.to+e:b),a&&d>this.from&&(d<this.to||this.to==null)&&(this.from=null),c&&(b<this.to||this.to==null)&&(b>this.from||this.from==null)&&(this.to=null)},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(a){return this.set==a.set}},p.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:v(this.line),ch:this.from}},clear:function(){if(this.line){var a=Z(this.line.marked,this);a!=-1&&this.line.marked.splice(a,1),this.line=null}}},q.inheritMarks=function(a,b){var c=new q(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},q.prototype={replace:function(a,b,c){var d=[],e=this.marked,f=b==null?this.text.length:b;r(0,a,this.styles,d),c&&d.push(c,null),r(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;r(a,this.text.length,this.styles,c);var e=new q(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))}return e},append:function(a){var b=this.text.length,c=a.marked,d=this.marked;this.text+=a.text,r(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 n(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 n(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 O(this.text,null,a)},getHTML:function(a,b){function f(b,f){if(!b)return;d&&L&&b.charAt(0)==" "&&(b="\u00a0"+b.slice(1)),d=!1;if(b.indexOf("\t")==-1){e+=b.length;var g=X(b)}else{var g="";for(var h=0;;){var i=b.indexOf("\t",h);if(i==-1){g+=X(b.slice(h)),e+=b.length-h;break}e+=i-h;var j=a(e);g+=X(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)}},s.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,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}},t.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 s(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 s(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 t(b);if(!a.parent){var d=new t(a.children);d.parent=a,a.children=[d,c],a=d}else{a.size-=c.size,a.height-=c.height;var e=Z(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}}},y.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]);f.added+=f.start-a,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=D,a.e_preventDefault=B,a.e_stopPropagation=C,a.connect=H,I.prototype={set:function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)}};var J=function(){if(/MSIE [1-8]\b/.test(navigator.userAgent))return!1;var a=document.createElement("div");return"draggable"in a}(),K=/gecko\/\d{7}/i.test(navigator.userAgent),L=/MSIE \d/.test(navigator.userAgent),M=/WebKit\//.test(navigator.userAgent),N="\n";(function(){var a=document.createElement("textarea");a.value="foo\nbar",a.value.indexOf("\r")>-1&&(N="\r\n")})(),document.documentElement.getBoundingClientRect!=null&&(Q=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 W=document.createElement("pre");X("a")=="\na"?X=function(a){return W.textContent=a,W.innerHTML.slice(1)}:X("\t")!="\t"&&(X=function(a){return W.innerHTML="",W.appendChild(document.createTextNode(a)),W.innerHTML}),a.htmlEscape=X;var _="\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=_;var ba=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 bb={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",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=bb,function(){for(var a=0;a<10;a++)bb[a+48]=String(a);for(var a=65;a<=90;a++)bb[a]=String.fromCharCode(a);for(var a=1;a<=12;a++)bb[a+111]=bb[a+63235]="F"+a}(),a}();CodeMirror.defineMode("clojure",function(a,b){function m(a){var b={},c=a.split(" ");for(var d=0;d<c.length;++d)b[c[d]]=!0;return b}function r(a,b,c){this.indent=a,this.type=b,this.prev=c}function s(a,b,c){a.indentStack=new r(b,c,a.indentStack)}function t(a){a.indentStack=a.indentStack.prev}function u(a,b){if(a==="0"&&"x"==b.peek().toLowerCase())return b.eat("x"),b.eatWhile(q.hex),!0;if(a=="+"||a=="-")b.eat(q.sign),a=b.next();return q.digit.test(a)?(b.eat(a),b.eatWhile(q.digit),"."==b.peek()&&(b.eat("."),b.eatWhile(q.digit)),"e"==b.peek().toLowerCase()&&(b.eat(q.exponent),b.eat(q.sign),b.eatWhile(q.digit)),!0):!1}var c="builtin",d="comment",e="string",f="tag",g="atom",h="number",i="bracket",j="keyword",k=2,l=1,n=m("true false nil"),o=m("defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle* *1 *2 *3 *agent* *allow-unresolved-vars* *assert *clojure-version* *command-line-args* *compile-files* *compile-path* *e *err* *file* *flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *use-context-classloader* *warn-on-reflection* + - / < <= = == > >= accessor aclone agent agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec decimal? declare definline defmacro defmethod defmulti defn defn- defonce defstruct delay delay? deliver deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall doc dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq eval even? every? extend extend-protocol extend-type extends? extenders false? ffirst file-seq filter find find-doc find-ns find-var first float float-array float? floats flush fn fn? fnext for force format future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator hash hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map? mapcat max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod name namespace neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? or parents partial partition pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-doc print-dup print-method print-namespace-doc print-simple print-special-doc print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string reify reduce ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure release-pending-sends rem remove remove-method remove-ns repeat repeatedly replace replicate require reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-validator! set? short short-array shorts shutdown-agents slurp some sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-form-anchor special-symbol? split-at split-with str stream? string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync syntax-symbol-anchor take take-last take-nth take-while test the-ns time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-dec unchecked-divide unchecked-inc unchecked-multiply unchecked-negate unchecked-remainder unchecked-subtract underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision xml-seq"),p=m("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catchlet letfn binding loop for doseq dotimes when-let if-letdefstruct struct-map assoctesting deftesthandler-case handle dotrace deftrace"),q={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-fA-F]/,sign:/[+-]/,exponent:/[eE]/,keyword_char:/[^\s\(\[\;\)\]]/,basic:/[\w\$_\-]/,lang_keyword:/[\w*+!\-_?:\/]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(a,b){b.indentStack==null&&a.sol()&&(b.indentation=a.indentation());if(a.eatSpace())return null;var j=null;switch(b.mode){case"string":var l,m=!1;while((l=a.next())!=null){if(l=='"'&&!m){b.mode=!1;break}m=!m&&l=="\\"}j=e;break;default:var r=a.next();if(r=='"')b.mode="string",j=e;else if(r=="'"&&!q.digit_or_colon.test(a.peek()))j=g;else if(r==";")a.skipToEnd(),j=d;else if(u(r,a))j=h;else if(r=="("||r=="["){var v="",w=a.column();while((letter=a.eat(q.keyword_char))!=null)v+=letter;v.length>0&&p.propertyIsEnumerable(v)?s(b,w+k,r):(a.eatSpace(),a.eol()||a.peek()==";"?s(b,w+1,r):s(b,w+a.current().length,r)),a.backUp(a.current().length-1),j=i}else if(r==")"||r=="]")j=i,b.indentStack!=null&&b.indentStack.type==(r==")"?"(":"[")&&t(b);else{if(r==":")return a.eatWhile(q.lang_keyword),f;a.eatWhile(q.basic),o&&o.propertyIsEnumerable(a.current())?j=c:n&&n.propertyIsEnumerable(a.current())?j=g:j=null}}return j},indent:function(a,b){return a.indentStack==null?a.indentation:a.indentStack.indent}}}),CodeMirror.defineMIME("text/x-clojure","clojure"),CodeMirror.defineMode("coffeescript",function(a){function c(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function r(a,c){if(a.sol()){var k=c.scopes[0].offset;if(a.eatSpace()){var l=a.indentation();return l>k?"indent":l<k?"dedent":null}k>0&&v(a,c)}if(a.eatSpace())return null;var p=a.peek();if(a.match("###"))return c.tokenize=t,c.tokenize(a,c);if(p==="#")return a.skipToEnd(),"comment";if(a.match(/^-?[0-9\.]/,!1)){var r=!1;a.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(r=!0),a.match(/^-?\d+\.\d*/)&&(r=!0),a.match(/^-?\.\d+/)&&(r=!0);if(r)return a.peek()=="."&&a.backUp(1),"number";var u=!1;a.match(/^-?0x[0-9a-f]+/i)&&(u=!0),a.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(u=!0),a.match(/^-?0(?![\dx])/i)&&(u=!0);if(u)return"number"}if(a.match(n))return c.tokenize=s(a.current(),"string"),c.tokenize(a,c);if(a.match(o)){if(a.current()!="/"||a.match(/^.*\//,!1))return c.tokenize=s(a.current(),"string-2"),c.tokenize(a,c);a.backUp(1)}return a.match(h)||a.match(g)?"punctuation":a.match(f)||a.match(d)||a.match(j)?"operator":a.match(e)?"punctuation":a.match(q)?"atom":a.match(m)?"keyword":a.match(i)?"variable":(a.next(),b)}function s(c,d){var e=c.length==1;return function(g,h){while(!g.eol()){g.eatWhile(/[^'"\/\\]/);if(g.eat("\\")){g.next();if(e&&g.eol())return d}else{if(g.match(c))return h.tokenize=r,d;g.eat(/['"\/]/)}}return e&&(a.mode.singleLineStringErrors?d=b:h.tokenize=r),d}}function t(a,b){while(!a.eol()){a.eatWhile(/[^#]/);if(a.match("###")){b.tokenize=r;break}a.eatWhile("#")}return"comment"}function u(b,c,d){d=d||"coffee";var e=0;if(d==="coffee"){for(var f=0;f<c.scopes.length;f++)if(c.scopes[f].type==="coffee"){e=c.scopes[f].offset+a.indentUnit;break}}else e=b.column()+b.current().length;c.scopes.unshift({offset:e,type:d})}function v(a,b){if(b.scopes.length==1)return;if(b.scopes[0].type==="coffee"){var c=a.indentation(),d=-1;for(var e=0;e<b.scopes.length;++e)if(c===b.scopes[e].offset){d=e;break}if(d===-1)return!0;while(b.scopes[0].offset!==c)b.scopes.shift();return!1}return b.scopes.shift(),!1}function w(a,c){var d=c.tokenize(a,c),e=a.current();if(e===".")return d=c.tokenize(a,c),e=a.current(),d==="variable"?"variable":b;if(e==="@")return a.eat("@"),"keyword";e==="return"&&(c.dedent+=1),((e==="->"||e==="=>")&&!c.lambda&&c.scopes[0].type=="coffee"&&a.peek()===""||d==="indent")&&u(a,c);var f="[({".indexOf(e);return f!==-1&&u(a,c,"])}".slice(f,f+1)),k.exec(e)&&u(a,c),e=="then"&&v(a,c),d==="dedent"&&v(a,c)?b:(f="])}".indexOf(e),f!==-1&&v(a,c)?b:(c.dedent>0&&a.eol()&&c.scopes[0].type=="coffee"&&(c.scopes.length>1&&c.scopes.shift(),c.dedent-=1),d))}var b="error",d=new RegExp("^[\\+\\-\\*/%&|\\^~<>!?]"),e=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),f=new RegExp("^((->)|(=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"),g=new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),h=new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"),i=new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*"),j=c(["and","or","not","is","isnt","in","instanceof","typeof"]),k=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],l=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","throw","when","until"],m=c(k.concat(l));k=c(k);var n=new RegExp("^('{3}|\"{3}|['\"])"),o=new RegExp("^(/{3}|/)"),p=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],q=c(p),x={startState:function(a){return{tokenize:r,scopes:[{offset:a||0,type:"coffee"}],lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=w(a,b);return b.lastToken={style:c,content:a.current()},a.eol()&&a.lambda&&(b.lambda=!1),c},indent:function(a,b){return a.tokenize!=r?0:a.scopes[0].offset}};return x}),CodeMirror.defineMIME("text/x-coffeescript","coffeescript"),CodeMirror.defineMode("css",function(a){function d(a,b){return c=b,a}function e(a,b){var c=a.next();if(c=="@")return a.eatWhile(/[\w\\\-]/),d("meta",a.current());if(c=="/"&&a.eat("*"))return b.tokenize=f,f(a,b);if(c=="<"&&a.eat("!"))return b.tokenize=g,g(a,b);if(c=="=")d(null,"compare");else return c!="~"&&c!="|"||!a.eat("=")?c=='"'||c=="'"?(b.tokenize=h(c),b.tokenize(a,b)):c=="#"?(a.eatWhile(/[\w\\\-]/),d("atom","hash")):c=="!"?(a.match(/^\s*\w*/),d("keyword","important")):/\d/.test(c)?(a.eatWhile(/[\w.%]/),d("number","unit")):/[,.+>*\/]/.test(c)?d(null,"select-op"):/[;{}:\[\]]/.test(c)?d(null,c):(a.eatWhile(/[\w\\\-]/),d("variable","variable")):d(null,"compare")}function f(a,b){var c=!1,f;while((f=a.next())!=null){if(c&&f=="/"){b.tokenize=e;break}c=f=="*"}return d("comment","comment")}function g(a,b){var c=0,f;while((f=a.next())!=null){if(c>=2&&f==">"){b.tokenize=e;break}c=f=="-"?c+1:0}return d("comment","comment")}function h(a){return function(b,c){var f=!1,g;while((g=b.next())!=null){if(g==a&&!f)break;f=!f&&g=="\\"}return f||(c.tokenize=e),d("string","string")}}var b=a.indentUnit,c;return{startState:function(a){return{tokenize:e,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;var d=b.tokenize(a,b),e=b.stack[b.stack.length-1];if(c=="hash"&&e=="rule")d="atom";else if(d=="variable")if(e=="rule")d="number";else if(!e||e=="@media{")d="tag";return e=="rule"&&/^[\{\};]$/.test(c)&&b.stack.pop(),c=="{"?e=="@media"?b.stack[b.stack.length-1]="@media{":b.stack.push("{"):c=="}"?b.stack.pop():c=="@media"?b.stack.push("@media"):e=="{"&&c!="comment"&&b.stack.push("rule"),d},indent:function(a,c){var d=a.stack.length;return/^\}/.test(c)&&(d-=a.stack[a.stack.length-1]=="rule"?2:1),a.baseIndent+d*b},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("diff",function(){return{token:function(a){var b=a.next();a.skipToEnd();if(b=="+")return"plus";if(b=="-")return"minus";if(b=="@")return"rangeinfo"}}}),CodeMirror.defineMIME("text/x-diff","diff"),CodeMirror.defineMode("go",function(a,b){function i(a,b){var c=a.next();if(c=='"'||c=="'"||c=="`")return b.tokenize=j(c),b.tokenize(a,b);if(/[\d\.]/.test(c))return c=="."?a.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):c=="0"?a.match(/^[xX][0-9a-fA-F]+/)||a.match(/^0[0-7]+/):a.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(c))return h=c,null;if(c=="/"){if(a.eat("*"))return b.tokenize=k,k(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(g.test(c))return a.eatWhile(g),"operator";a.eatWhile(/[\w\$_]/);var f=a.current();if(d.propertyIsEnumerable(f)){if(f=="case"||f=="default")h="case";return"keyword"}return e.propertyIsEnumerable(f)?"atom":"word"}function j(a){return function(b,c){var d=!1,e,f=!1;while((e=b.next())!=null){if(e==a&&!d){f=!0;break}d=!d&&e=="\\"}if(f||!d&&a!="`")c.tokenize=i;return"string"}}function k(a,b){var c=!1,d;while(d=a.next()){if(d=="/"&&c){b.tokenize=i;break}c=d=="*"}return"comment"}function l(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function m(a,b,c){return a.context=new l(a.indented,b,c,null,a.context)}function n(a){var b=a.context.type;if(b==")"||b=="]"||b=="}")a.indented=a.context.indented;return a.context=a.context.prev}var c=a.indentUnit,d={"break":!0,"case":!0,chan:!0,"const":!0,"continue":!0,"default":!0,defer:!0,"else":!0,fallthrough:!0,"for":!0,func:!0,go:!0,"goto":!0,"if":!0,"import":!0,"interface":!0,map:!0,"package":!0,range:!0,"return":!0,select:!0,struct:!0,"switch":!0,type:!0,"var":!0,bool:!0,"byte":!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,"int":!0,uint:!0,uintptr:!0},e={"true":!0,"false":!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,imag:!0,len:!0,make:!0,"new":!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},f={"else":!0,"for":!0,func:!0,"if":!0,"interface":!0,select:!0,struct:!0,"switch":!0},g=/[+\-*&^%:=<>!|\/]/,h;return{startState:function(a){return{tokenize:null,context:new l((a||0)-c,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;a.sol()&&(c.align==null&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0,c.type=="case"&&(c.type="}"));if(a.eatSpace())return null;h=null;var d=(b.tokenize||i)(a,b);return d=="comment"?d:(c.align==null&&(c.align=!0),h=="{"?m(b,a.column(),"}"):h=="["?m(b,a.column(),"]"):h=="("?m(b,a.column(),")"):h=="case"?c.type="case":h=="}"&&c.type=="}"?c=n(b):h==c.type&&n(b),b.startOfLine=!1,d)},indent:function(a,b){if(a.tokenize!=i&&a.tokenize!=null)return 0;var d=a.context,e=b&&b.charAt(0);if(d.type=="case"&&/^(?:case|default)\b/.test(b))return a.context.type="}",d.indented;var f=e==d.type;return d.align?d.column+(f?0:1):d.indented+(f?0:c)},electricChars:"{}:"}}),CodeMirror.defineMIME("text/x-go","go"),CodeMirror.defineMode("haskell",function(a,b){function c(a,b,c){return b(c),c(a,b)}function m(a,b){if(a.eatWhile(l))return null;var m=a.next();if(k.test(m)){if(m=="{"&&a.eat("-")){var p="comment";return a.eat("#")&&(p="meta"),c(a,b,n(p,1))}return null}if(m=="'")return a.eat("\\")?a.next():a.next(),a.eat("'")?"string":"error";if(m=='"')return c(a,b,o);if(e.test(m))return a.eatWhile(i),a.eat(".")?"qualifier":"variable-2";if(d.test(m))return a.eatWhile(i),"variable";if(f.test(m)){if(m=="0"){if(a.eat(/[xX]/))return a.eatWhile(g),"integer";if(a.eat(/[oO]/))return a.eatWhile(h),"number"}a.eatWhile(f);var p="number";return a.eat(".")&&(p="number",a.eatWhile(f)),a.eat(/[eE]/)&&(p="number",a.eat(/[-+]/),a.eatWhile(f)),p}if(j.test(m)){if(m=="-"&&a.eat(/-/)){a.eatWhile(/-/);if(!a.eat(j))return a.skipToEnd(),"comment"}var p="variable";return m==":"&&(p="variable-2"),a.eatWhile(j),p}return"error"}function n(a,b){return b==0?m:function(c,d){var e=b;while(!c.eol()){var f=c.next();if(f=="{"&&c.eat("-"))++e;else if(f=="-"&&c.eat("}")){--e;if(e==0)return d(m),a}}return d(n(a,e)),a}}function o(a,b){while(!a.eol()){var c=a.next();if(c=='"')return b(m),"string";if(c=="\\"){if(a.eol()||a.eat(l))return b(p),"string";a.eat("&")||a.next()}}return b(m),"error"}function p(a,b){return a.eat("\\")?c(a,b,o):(a.next(),b(m),"error")}var d=/[a-z_]/,e=/[A-Z]/,f=/[0-9]/,g=/[0-9A-Fa-f]/,h=/[0-7]/,i=/[a-z_A-Z0-9']/,j=/[-!#$%&*+.\/<=>?@\\^|~:]/,k=/[(),;[\]`{}]/,l=/[ \t\v\f]/,q=function(){function b(b){return function(){for(var c=0;c<arguments.length;c++)a[arguments[c]]=b}}var a={};return b("keyword")("case","class","data","default","deriving","do","else","foreign","if","import","in","infix","infixl","infixr","instance","let","module","newtype","of","then","type","where","_"),b("keyword")("..",":","::","=","\\",'"',"<-","->","@","~","=>"),b("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<=","=<<","==",">",">=",">>",">>=","^","^^","||","*","**"),b("builtin")("Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),b("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3"),a}();return{startState:function(){return{f:m}},copyState:function(a){return{f:a.f}},token:function(a,b){var c=b.f(a,function(a){b.f=a}),d=a.current();return d in q?q[d]:c}}}),CodeMirror.defineMIME("text/x-haskell","haskell"),CodeMirror.defineMode("htmlmixed",function(a,b){function f(a,b){var f=c.token(a,b.htmlState);return f=="tag"&&a.current()==">"&&b.htmlState.context&&(/^script$/i.test(b.htmlState.context.tagName)?(b.token=h,b.localState=d.startState(c.indent(b.htmlState,"")),b.mode="javascript"):/^style$/i.test(b.htmlState.context.tagName)&&(b.token=i,b.localState=e.startState(c.indent(b.htmlState,"")),b.mode="css")),f}function g(a,b,c){var d=a.current(),e=d.search(b);return e>-1&&a.backUp(d.length-e),c}function h(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=f,b.curState=null,b.mode="html",f(a,b)):g(a,/<\/\s*script\s*>/,d.token(a,b.localState))}function i(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=f,b.localState=null,b.mode="html",f(a,b)):g(a,/<\/\s*style\s*>/,e.token(a,b.localState))}var c=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),d=CodeMirror.getMode(a,"javascript"),e=CodeMirror.getMode(a,"css");return{startState:function(){var a=c.startState();return{token:f,localState:null,mode:"html",htmlState:a}},copyState:function(a){if(a.localState)var b=CodeMirror.copyState(a.token==i?e:d,a.localState);return{token:a.token,localState:b,mode:a.mode,htmlState:CodeMirror.copyState(c,a.htmlState)}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return a.token==f||/^\s*<\//.test(b)?c.indent(a.htmlState,b):a.token==h?d.indent(a.localState,b):e.indent(a.localState,b)},compareStates:function(a,b){return c.compareStates(a.htmlState,b.htmlState)},electricChars:"/{}:"}}),CodeMirror.defineMIME("text/html","htmlmixed"),CodeMirror.defineMode("javascript",function(a,b){function g(a,b,c){return b.tokenize=c,c(a,b)}function h(a,b){var c=!1,d;while((d=a.next())!=null){if(d==b&&!c)return!1;c=!c&&d=="\\"}return c}function k(a,b,c){return i=a,j=c,b}function l(a,b){var c=a.next();if(c=='"'||c=="'")return g(a,b,m(c));if(/[\[\]{}\(\),;\:\.]/.test(c))return k(c);if(c=="0"&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),k("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),k("number","number");if(c=="/")return a.eat("*")?g(a,b,n):a.eat("/")?(a.skipToEnd(),k("comment","comment")):b.reAllowed?(h(a,"/"),a.eatWhile(/[gimy]/),k("regexp","string-2")):(a.eatWhile(f),k("operator",null,a.current()));if(c=="#")return a.skipToEnd(),k("error","error");if(f.test(c))return a.eatWhile(f),k("operator",null,a.current());a.eatWhile(/[\w\$_]/);var d=a.current(),i=e.propertyIsEnumerable(d)&&e[d];return i&&b.kwAllowed?k(i.type,i.style,d):k("variable","variable",d)}function m(a){return function(b,c){return h(b,a)||(c.tokenize=l),k("string","string")}}function n(a,b){var c=!1,d;while(d=a.next()){if(d=="/"&&c){b.tokenize=l;break}c=d=="*"}return k("comment","comment")}function p(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,d!=null&&(this.align=d)}function q(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function r(a,b,c,e,f){var g=a.cc;s.state=a,s.stream=f,s.marked=null,s.cc=g,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);for(;;){var h=g.length?g.pop():d?D:C;if(h(c,e)){while(g.length&&g[g.length-1].lex)g.pop()();return s.marked?s.marked:c=="variable"&&q(a,e)?"variable-2":b}}}function t(){for(var a=arguments.length-1;a>=0;a--)s.cc.push(arguments[a])}function u(){return t.apply(null,arguments),!0}function v(a){var b=s.state;if(b.context){s.marked="def";for(var c=b.localVars;c;c=c.next)if(c.name==a)return;b.localVars={name:a,next:b.localVars}}}function x(){s.state.context||(s.state.localVars=w),s.state.context={prev:s.state.context,vars:s.state.localVars}}function y(){s.state.localVars=s.state.context.vars,s.state.context=s.state.context.prev}function z(a,b){var c=function(){var c=s.state;c.lexical=new p(c.indented,s.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function A(){var a=s.state;a.lexical.prev&&(a.lexical.type==")"&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function B(a){return function(c){return c==a?u():a==";"?t():u(arguments.callee)}}function C(a){return a=="var"?u(z("vardef"),L,B(";"),A):a=="keyword a"?u(z("form"),D,C,A):a=="keyword b"?u(z("form"),C,A):a=="{"?u(z("}"),K,A):a==";"?u():a=="function"?u(R):a=="for"?u(z("form"),B("("),z(")"),N,B(")"),A,C,A):a=="variable"?u(z("stat"),G):a=="switch"?u(z("form"),D,z("}","switch"),B("{"),K,A,A):a=="case"?u(D,B(":")):a=="default"?u(B(":")):a=="catch"?u(z("form"),x,B("("),S,B(")"),C,A,y):t(z("stat"),D,B(";"),A)}function D(a){return o.hasOwnProperty(a)?u(F):a=="function"?u(R):a=="keyword c"?u(E):a=="("?u(z(")"),E,B(")"),A,F):a=="operator"?u(D):a=="["?u(z("]"),J(D,"]"),A,F):a=="{"?u(z("}"),J(I,"}"),A,F):u()}function E(a){return a.match(/[;\}\)\],]/)?t():t(D)}function F(a,b){if(a=="operator"&&/\+\+|--/.test(b))return u(F);if(a=="operator")return u(D);if(a==";")return;if(a=="(")return u(z(")"),J(D,")"),A,F);if(a==".")return u(H,F);if(a=="[")return u(z("]"),D,B("]"),A,F)}function G(a){return a==":"?u(A,C):t(F,B(";"),A)}function H(a){if(a=="variable")return s.marked="property",u()}function I(a){a=="variable"&&(s.marked="property");if(o.hasOwnProperty(a))return u(B(":"),D)}function J(a,b){function c(d){return d==","?u(a,c):d==b?u():u(B(b))}return function(e){return e==b?u():t(a,c)}}function K(a){return a=="}"?u():t(C,K)}function L(a,b){return a=="variable"?(v(b),u(M)):u()}function M(a,b){if(b=="=")return u(D,M);if(a==",")return u(L)}function N(a){return a=="var"?u(L,P):a==";"?t(P):a=="variable"?u(O):t(P)}function O(a,b){return b=="in"?u(D):u(F,P)}function P(a,b){return a==";"?u(Q):b=="in"?u(D):u(D,B(";"),Q)}function Q(a){a!=")"&&u(D)}function R(a,b){if(a=="variable")return v(b),u(R);if(a=="(")return u(z(")"),x,J(S,")"),A,C,y)}function S(a,b){if(a=="variable")return v(b),u()}var c=a.indentUnit,d=b.json,e=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),f={type:"atom",style:"atom"};return{"if":b,"while":b,"with":b,"else":c,"do":c,"try":c,"finally":c,"return":d,"break":d,"continue":d,"new":d,"delete":d,"throw":d,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,"typeof":e,"instanceof":e,"true":f,"false":f,"null":f,"undefined":f,NaN:f,Infinity:f}}(),f=/[+\-*&%=<>!?|]/,i,j,o={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},s={state:null,column:null,marked:null,cc:null},w={name:"this",next:{name:"arguments"}};return A.lex=!0,{startState:function(a){return{tokenize:l,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new p((a||0)-c,0,"block",!1),localVars:null,context:null,indented:0}},token:function(a,b){a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation());if(a.eatSpace())return null;var c=b.tokenize(a,b);return i=="comment"?c:(b.reAllowed=i=="operator"||i=="keyword c"||i.match(/^[\[{}\(,;:]$/),b.kwAllowed=i!=".",r(b,c,i,j,a))},indent:function(a,b){if(a.tokenize!=l)return 0;var d=b&&b.charAt(0),e=a.lexical,f=e.type,g=d==f;return f=="vardef"?e.indented+4:f=="form"&&d=="{"?e.indented:f=="stat"||f=="form"?e.indented+c:e.info=="switch"&&!g?e.indented+(/^(?:case|default)\b/.test(b)?c:2*c):e.align?e.column+(g?0:1):e.indented+(g?0:c)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("lua",function(a,b){function d(a){return new RegExp("^(?:"+a.join("|")+")","i")}function e(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function l(a){var b=0;while(a.eat("="))++b;return a.eat("["),b}function m(a,b){var c=a.next();return c=="-"&&a.eat("-")?a.eat("[")?(b.cur=n(l(a),"comment"))(a,b):(a.skipToEnd(),"comment"):c=='"'||c=="'"?(b.cur=o(c))(a,b):c=="["&&/[\[=]/.test(a.peek())?(b.cur=n(l(a),"string"))(a,b):/\d/.test(c)?(a.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(c)?(a.eatWhile(/[\w\\\-_.]/),"variable"):null}function n(a,b){return function(c,d){var e=null,f;while((f=c.next())!=null)if(e==null)f=="]"&&(e=0);else if(f=="=")++e;else{if(f=="]"&&e==a){d.cur=m;break}e=null}return b}}function o(a){return function(b,c){var d=!1,e;while((e=b.next())!=null){if(e==a&&!d)break;d=!d&&e=="\\"}return d||(c.cur=m),"string"}}var c=a.indentUnit,f=e(b.specials||[]),g=e(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),h=e(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),i=e(["function","if","repeat","do","\\(","{"]),j=e(["end","until","\\)","}"]),k=d(["end","until","\\)","}","else","elseif"]);return{startState:function(a){return{basecol:a||0,indentDepth:0,cur:m}},token:function(a,b){if(a.eatSpace())return null;var c=b.cur(a,b),d=a.current();return c=="variable"&&(h.test(d)?c="keyword":g.test(d)?c="builtin":f.test(d)&&(c="variable-2")),c!="comment"&&c!="string"&&(i.test(d)?++b.indentDepth:j.test(d)&&--b.indentDepth),c},indent:function(a,b){var d=k.test(b);return a.basecol+c*(a.indentDepth-(d?1:0))}}}),CodeMirror.defineMIME("text/x-lua","lua"),CodeMirror.defineMode("markdown",function(a,b){function t(a,b,c){return b.f=b.inline=c,c(a,b)}function u(a,b,c){return b.f=b.block=c,c(a,b)}function v(a,b){var c;if(a.match(r))return a.skipToEnd(),e;if(a.eatSpace())return null;if(a.peek()==="#"||a.match(q))b.header=!0;else if(a.eat(">"))b.indentation++,b.quote=!0;else{if(a.peek()==="[")return t(a,b,C);if(n.test(a.peek())){var d=new RegExp("(?:s*["+a.peek()+"]){3,}$");if(a.match(d,!0))return h}else if(c=a.match(o,!0)||a.match(p,!0))return b.indentation+=c[0].length,g}return t(a,b,b.inline)}function w(a,b){var d=c.token(a,b.htmlState);return d==="tag"&&b.htmlState.type!=="openTag"&&!b.htmlState.context&&(b.f=z,b.block=v),d}function x(a){return returnValue="",a.strong?a.em?returnValue+=(returnValue?" ":"")+m:returnValue+=(returnValue?" ":"")+l:a.em&&(returnValue+=(returnValue?" ":"")+k),a.header&&(returnValue+=(returnValue?" ":"")+d),a.quote&&(returnValue+=(returnValue?" ":"")+f),returnValue||(returnValue=null),returnValue}function y(a,b){return a.match(s,!0)?x(b):undefined}function z(a,b){var c=b.text(a,b);if(typeof c!="undefined")return c;var d=a.next();if(d==="\\")return a.next(),x(b);if(d==="`")return t(a,b,F(e,"`"));if(d==="[")return t(a,b,A);if(d==="<"&&a.match(/^\w/,!1))return a.backUp(1),u(a,b,w);var f=x(b);return d==="*"||d==="_"?a.eat(d)?(b.strong=!b.strong)?x(b):f:(b.em=!b.em)?x(b):f:x(b)}function A(a,b){while(!a.eol()){var c=a.next();c==="\\"&&a.next();if(c==="]")return b.inline=b.f=B,i}return i}function B(a,b){a.eatSpace();var c=a.next();return c==="("||c==="["?t(a,b,F(j,c==="("?")":"]")):"error"}function C(a,b){return a.match(/^[^\]]*\]:/,!0)?(b.f=D,i):t(a,b,z)}function D(a,b){return a.eatSpace(),a.match(/^[^\s]+/,!0),b.f=b.inline=z,j}function E(a){return E[a]||(E[a]=new RegExp("^(?:[^\\\\\\"+a+"]|\\\\.)*(?:\\"+a+"|$)")),E[a]}function F(a,b,c){return c=c||z,function(d,e){return d.match(E(b)),e.inline=e.f=c,a}}var c=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),d="header",e="comment",f="quote",g="string",h="hr",i="link",j="string",k="em",l="strong",m="emstrong",n=/^[*-=_]/,o=/^[*-+]\s+/,p=/^[0-9]+\.\s+/,q=/^(?:\={3,}|-{3,})$/,r=/^(k:\t|\s{4,})/,s=/^[^\[*_\\<>`]+/;return{startState:function(){return{f:v,block:v,htmlState:c.startState(),indentation:0,inline:z,text:y,em:!1,strong:!1,header:!1,quote:!1}},copyState:function(a){return{f:a.f,block:a.block,htmlState:CodeMirror.copyState(c,a.htmlState),indentation:a.indentation,inline:a.inline,text:a.text,em:a.em,strong:a.strong,header:a.header,quote:a.quote}},token:function(a,b){if(a.sol()){b.em=!1,b.strong=!1,b.header=!1,b.quote=!1,b.f=b.block;var c=b.indentation,d=0;while(c>0)if(a.eat(" "))c--,d++;else if(c>=4&&a.eat("\t"))c-=4,d+=4;else break;b.indentation=d;if(d>0)return null}return b.f(a,b)},getType:x}}),CodeMirror.defineMIME("text/x-markdown","markdown"),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.defineMode("perl",function(a,b){function f(a,b,c,d,e){return b.chain=null,b.style=null,b.tail=null,b.tokenize=function(a,b){var f=!1,g,i=0;while(g=a.next()){if(g===c[i]&&!f)return c[++i]!==undefined?(b.chain=c[i],b.style=d,b.tail=e):e&&a.eatWhile(e),b.tokenize=h,d;f=!f&&g=="\\"}return d},b.tokenize(a,b)}function g(a,b,c){return b.tokenize=function(a,b){return a.string==c&&(b.tokenize=h),a.skipToEnd(),"string"},b.tokenize(a,b)}function h(a,b){if(a.eatSpace())return null;if(b.chain)return f(a,b,b.chain,b.style,b.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),g(a,b,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return g(a,b,"=cut");var h=a.next();if(h=='"'||h=="'"){if(a.prefix(3)=="<<"+h){var i=a.pos;a.eatWhile(/\w/);var j=a.current().substr(1);if(j&&a.eat(h))return g(a,b,j);a.pos=i}return f(a,b,[h],"string")}if(h=="q"){var k=a.look(-2);if(!k||!/\w/.test(k)){k=a.look(0);if(k=="x"){k=a.look(1);if(k=="(")return a.eatSuffix(2),f(a,b,[")"],d,e);if(k=="[")return a.eatSuffix(2),f(a,b,["]"],d,e);if(k=="{")return a.eatSuffix(2),f(a,b,["}"],d,e);if(k=="<")return a.eatSuffix(2),f(a,b,[">"],d,e);if(/[\^'"!~\/]/.test(k))return a.eatSuffix(1),f(a,b,[a.eat(k)],d,e)}else if(k=="q"){k=a.look(1);if(k=="(")return a.eatSuffix(2),f(a,b,[")"],"string");if(k=="[")return a.eatSuffix(2),f(a,b,["]"],"string");if(k=="{")return a.eatSuffix(2),f(a,b,["}"],"string");if(k=="<")return a.eatSuffix(2),f(a,b,[">"],"string");if(/[\^'"!~\/]/.test(k))return a.eatSuffix(1),f(a,b,[a.eat(k)],"string")}else if(k=="w"){k=a.look(1);if(k=="(")return a.eatSuffix(2),f(a,b,[")"],"bracket");if(k=="[")return a.eatSuffix(2),f(a,b,["]"],"bracket");if(k=="{")return a.eatSuffix(2),f(a,b,["}"],"bracket");if(k=="<")return a.eatSuffix(2),f(a,b,[">"],"bracket");if(/[\^'"!~\/]/.test(k))return a.eatSuffix(1),f(a,b,[a.eat(k)],"bracket")}else if(k=="r"){k=a.look(1);if(k=="(")return a.eatSuffix(2),f(a,b,[")"],d,e);if(k=="[")return a.eatSuffix(2),f(a,b,["]"],d,e);if(k=="{")return a.eatSuffix(2),f(a,b,["}"],d,e);if(k=="<")return a.eatSuffix(2),f(a,b,[">"],d,e);if(/[\^'"!~\/]/.test(k))return a.eatSuffix(1),f(a,b,[a.eat(k)],d,e)}else if(/[\^'"!~\/(\[{<]/.test(k)){if(k=="(")return a.eatSuffix(1),f(a,b,[")"],"string");if(k=="[")return a.eatSuffix(1),f(a,b,["]"],"string");if(k=="{")return a.eatSuffix(1),f(a,b,["}"],"string");if(k=="<")return a.eatSuffix(1),f(a,b,[">"],"string");if(/[\^'"!~\/]/.test(k))return f(a,b,[a.eat(k)],"string")}}}if(h=="m"){var k=a.look(-2);if(!k||!/\w/.test(k)){k=a.eat(/[(\[{<\^'"!~\/]/);if(k){if(/[\^'"!~\/]/.test(k))return f(a,b,[k],d,e);if(k=="(")return f(a,b,[")"],d,e);if(k=="[")return f(a,b,["]"],d,e);if(k=="{")return f(a,b,["}"],d,e);if(k=="<")return f(a,b,[">"],d,e)}}}if(h=="s"){var k=/[\/>\]})\w]/.test(a.look(-2));if(!k){k=a.eat(/[(\[{<\^'"!~\/]/);if(k)return k=="["?f(a,b,["]","]"],d,e):k=="{"?f(a,b,["}","}"],d,e):k=="<"?f(a,b,[">",">"],d,e):k=="("?f(a,b,[")",")"],d,e):f(a,b,[k,k],d,e)}}if(h=="y"){var k=/[\/>\]})\w]/.test(a.look(-2));if(!k){k=a.eat(/[(\[{<\^'"!~\/]/);if(k)return k=="["?f(a,b,["]","]"],d,e):k=="{"?f(a,b,["}","}"],d,e):k=="<"?f(a,b,[">",">"],d,e):k=="("?f(a,b,[")",")"],d,e):f(a,b,[k,k],d,e)}}if(h=="t"){var k=/[\/>\]})\w]/.test(a.look(-2));if(!k){k=a.eat("r");if(k){k=a.eat(/[(\[{<\^'"!~\/]/);if(k)return k=="["?f(a,b,["]","]"],d,e):k=="{"?f(a,b,["}","}"],d,e):k=="<"?f(a,b,[">",">"],d,e):k=="("?f(a,b,[")",")"],d,e):f(a,b,[k,k],d,e)}}}if(h=="`")return f(a,b,[h],"variable-2");if(h=="/")return/~\s*$/.test(a.prefix())?f(a,b,[h],d,e):"operator";if(h=="$"){var i=a.pos;if(a.eatWhile(/\d/)||a.eat("{")&&a.eatWhile(/\d/)&&a.eat("}"))return"variable-2";a.pos=i}if(/[$@%]/.test(h)){var i=a.pos;if(a.eat("^")&&a.eat(/[A-Z]/)||!/[@$%&]/.test(a.look(-2))&&a.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var k=a.current();if(c[k])return"variable-2"}a.pos=i}if(/[$@%&]/.test(h))if(a.eatWhile(/[\w$\[\]]/)||a.eat("{")&&a.eatWhile(/[\w$\[\]]/)&&a.eat("}")){var k=a.current();return c[k]?"variable-2":"variable"}if(h=="#"&&a.look(-2)!="$")return a.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(h)){var i=a.pos;a.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/);if(c[a.current()])return"operator";a.pos=i}if(h=="_"&&a.pos==1){if(a.suffix(6)=="_END__")return f(a,b,["\0"],"comment");if(a.suffix(7)=="_DATA__")return f(a,b,["\0"],"variable-2");if(a.suffix(7)=="_C__")return f(a,b,["\0"],"string")}if(/\w/.test(h)){var i=a.pos;if(a.look(-2)=="{"&&(a.look(0)=="}"||a.eatWhile(/\w/)&&a.look(0)=="}"))return"string";a.pos=i}if(/[A-Z]/.test(h)){var l=a.look(-2),i=a.pos;a.eatWhile(/[A-Z_]/);if(/[\da-z]/.test(a.look(0)))a.pos=i;else{var k=c[a.current()];return k?(k[1]&&(k=k[0]),l!=":"?k==1?"keyword":k==2?"def":k==3?"atom":k==4?"operator":k==5?"variable-2":"meta":"meta"):"meta"}}if(/[a-zA-Z_]/.test(h)){var l=a.look(-2);a.eatWhile(/\w/);var k=c[a.current()];return k?(k[1]&&(k=k[0]),l!=":"?k==1?"keyword":k==2?"def":k==3?"atom":k==4?"operator":k==5?"variable-2":"meta":"meta"):"meta"}return null}var c={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},d="string-2",e=/[goseximacplud]/;return{startState:function(){return{tokenize:h,chain:null,style:null,tail:null}},token:function(a,b){return(b.tokenize||h)(a,b)},electricChars:"{}"}}),CodeMirror.defineMIME("text/x-perl","perl"),CodeMirror.StringStream.prototype.look=function(a){return this.string.charAt(this.pos+(a||0))},CodeMirror.StringStream.prototype.prefix=function(a){if(a){var b=this.pos-a;return this.string.substr(b>=0?b:0,a)}return this.string.substr(0,this.pos-1)},CodeMirror.StringStream.prototype.suffix=function(a){var b=this.string.length,c=b-this.pos+1;return this.string.substr(this.pos,a&&a<b?a:c)},CodeMirror.StringStream.prototype.nsuffix=function(a){var b=this.pos,c=a||this.string.length-this.pos+1;return this.pos+=c,this.string.substr(b,c)},CodeMirror.StringStream.prototype.eatSuffix=function(a){var b=this.pos+a,c;b<=0?this.pos=0:b>=(c=this.string.length-1)?this.pos=c:this.pos=b},function(){function a(a){var b={},c=a.split(" ");for(var d=0;d<c.length;++d)b[c[d]]=!0;return b}function b(a){return function(b,c){return b.match(a)?c.tokenize=null:b.skipToEnd(),"string"}}var c={name:"clike",keywords:a("abstract and array as break case catch cfunction class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw try use var while xor returndie echo empty exit eval include include_once isset list require require_once print unset"),blockKeywords:a("catch do else elseif for foreach if switch try while"),atoms:a("true false null TRUE FALSE NULL"),multiLineStrings:!0,hooks:{$:function(a,b){return a.eatWhile(/[\w\$_]/),"variable-2"},"<":function(a,c){return a.match(/<</)?(a.eatWhile(/[\w\.]/),c.tokenize=b(a.current().slice(3)),c.tokenize(a,c)):!1},"#":function(a,b){return a.skipToEnd(),"comment"}}};CodeMirror.defineMode("php",function(a,b){function h(a,b){a.sol()&&b.pending!='"'&&(b.pending=null);if(b.curMode==d){if(a.match(/^<\?\w*/))return b.curMode=g,b.curState=b.php,b.curClose=/^\?>/,b.mode="php","meta";if(b.pending=='"'){while(!a.eol()&&a.next()!='"');var c="string"}else if(b.pending&&a.pos<b.pending.end){a.pos=b.pending.end;var c=b.pending.style}else var c=d.token(a,b.curState);b.pending=null;var i=a.current(),j=i.search(/<\?/);return j!=-1?(c=="string"&&/\"$/.test(i)&&!/\?>/.test(i)?b.pending='"':b.pending={end:a.pos,style:c},a.backUp(i.length-j)):c=="tag"&&a.current()==">"&&b.curState.context&&(/^script$/i.test(b.curState.context.tagName)?(b.curMode=e,b.curState=e.startState(d.indent(b.curState,"")),b.curClose=/^<\/\s*script\s*>/i,b.mode="javascript"):/^style$/i.test(b.curState.context.tagName)&&(b.curMode=f,b.curState=f.startState(d.indent(b.curState,"")),b.curClose=/^<\/\s*style\s*>/i,b.mode="css")),c}if(b.mode=="php"){if(a.match(b.curClose))return b.curMode=d,b.curState=b.html,b.curClose=null,b.mode="html","meta";var c=g.token(a,b.curState);if(c=="comment"){var i=a.current(),k=i.search(/\?>/);k!=-1&&a.backUp(i.length-k)}return c}return a.match(b.curClose,!1)?(b.curMode=d,b.curState=b.html,b.curClose=null,b.mode="html",h(a,b)):b.curMode.token(a,b.curState)}var d=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),e=CodeMirror.getMode(a,"javascript"),f=CodeMirror.getMode(a,"css"),g=CodeMirror.getMode(a,c);return{startState:function(){var a=d.startState();return{html:a,php:g.startState(),curMode:b.startOpen?g:d,curState:b.startOpen?g.startState():a,curClose:b.startOpen?/^\?>/:null,mode:b.startOpen?"php":"html",pending:null}},copyState:function(a){var b=a.html,c=CodeMirror.copyState(d,b),e=a.php,f=CodeMirror.copyState(g,e),h;return a.curState==b?h=c:a.curState==e?h=f:h=CodeMirror.copyState(a.curMode,a.curState),{html:c,php:f,curMode:a.curMode,curState:h,curClose:a.curClose,mode:a.mode,pending:a.pending}},token:h,indent:function(a,b){return a.curMode!=g&&/^\s*<\//.test(b)||a.curMode==g&&/^\?>/.test(b)?d.indent(a.html,b):a.curMode.indent(a.curState,b)},electricChars:"/{}:"}}),CodeMirror.defineMIME("application/x-httpd-php","php"),CodeMirror.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),CodeMirror.defineMIME("text/x-php",c)}(),CodeMirror.defineMode("python",function(a,b){function d(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function t(a,b){if(a.sol()){var d=b.scopes[0].offset;if(a.eatSpace()){var l=a.indentation();return l>d?s="indent":l<d&&(s="dedent"),null}d>0&&w(a,b)}if(a.eatSpace())return null;var m=a.peek();if(m==="#")return a.skipToEnd(),"comment";if(a.match(/^[0-9\.]/,!1)){var n=!1;a.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(n=!0),a.match(/^\d+\.\d*/)&&(n=!0),a.match(/^\.\d+/)&&(n=!0);if(n)return a.eat(/J/i),"number";var o=!1;a.match(/^0x[0-9a-f]+/i)&&(o=!0),a.match(/^0b[01]+/i)&&(o=!0),a.match(/^0o[0-7]+/i)&&(o=!0),a.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(a.eat(/J/i),o=!0),a.match(/^0(?![\dx])/i)&&(o=!0);if(o)return a.eat(/L/i),"number"}return a.match(p)?(b.tokenize=u(a.current()),b.tokenize(a,b)):a.match(i)||a.match(h)?null:a.match(g)||a.match(e)||a.match(k)?"operator":a.match(f)?null:a.match(q)?"keyword":a.match(r)?"builtin":a.match(j)?"variable":(a.next(),c)}function u(a){while("rub".indexOf(a.charAt(0).toLowerCase())>=0)a=a.substr(1);var d=a.length==1,e="string";return function(g,h){while(!g.eol()){g.eatWhile(/[^'"\\]/);if(g.eat("\\")){g.next();if(d&&g.eol())return e}else{if(g.match(a))return h.tokenize=t,e;g.eat(/['"]/)}}if(d){if(b.singleLineStringErrors)return c;h.tokenize=t}return e}}function v(b,c,d){d=d||"py";var e=0;if(d==="py"){if(c.scopes[0].type!=="py"){c.scopes[0].offset=b.indentation();return}for(var f=0;f<c.scopes.length;++f)if(c.scopes[f].type==="py"){e=c.scopes[f].offset+a.indentUnit;break}}else e=b.column()+b.current().length;c.scopes.unshift({offset:e,type:d})}function w(a,b,c){c=c||"py";if(b.scopes.length==1)return;if(b.scopes[0].type==="py"){var d=a.indentation(),e=-1;for(var f=0;f<b.scopes.length;++f)if(d===b.scopes[f].offset){e=f;break}if(e===-1)return!0;while(b.scopes[0].offset!==d)b.scopes.shift();return!1}return c==="py"?(b.scopes[0].offset=a.indentation(),!1):b.scopes[0].type!=c?!0:(b.scopes.shift(),!1)}function x(a,b){s=null;var d=b.tokenize(a,b),e=a.current();if(e===".")return d=b.tokenize(a,b),e=a.current(),d==="variable"||d==="builtin"?"variable":c;if(e==="@")return d=b.tokenize(a,b),e=a.current(),d==="variable"||e==="@staticmethod"||e==="@classmethod"?"meta":c;if(e==="pass"||e==="return")b.dedent+=1;(e===":"&&!b.lambda&&b.scopes[0].type=="py"||s==="indent")&&v(a,b);var f="[({".indexOf(e);return f!==-1&&v(a,b,"])}".slice(f,f+1)),s==="dedent"&&w(a,b)?c:(f="])}".indexOf(e),f!==-1&&w(a,b,e)?c:(b.dedent>0&&a.eol()&&b.scopes[0].type=="py"&&(b.scopes.length>1&&b.scopes.shift(),b.dedent-=1),d))}var c="error",e=new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),f=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),g=new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),h=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),i=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),j=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),k=d(["and","or","not","is","in"]),l=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield"],m=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"],n={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},o={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};if(!b.version||parseInt(b.version,10)!==3){l=l.concat(n.keywords),m=m.concat(n.builtins);var p=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}else{l=l.concat(o.keywords),m=m.concat(o.builtins);var p=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}var q=d(l),r=d(m),s=null,y={startState:function(a){return{tokenize:t,scopes:[{offset:a||0,type:"py"}],lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=x(a,b);return b.lastToken={style:c,content:a.current()},a.eol()&&a.lambda&&(b.lambda=!1),c},indent:function(a,b){return a.tokenize!=t?0:a.scopes[0].offset}};return y}),CodeMirror.defineMIME("text/x-python","python"),CodeMirror.defineMode("r",function(a){function b(a){var b=a.split(" "),c={};for(var d=0;d<b.length;++d)c[b[d]]=!0;return c}function i(a,b){h=null;var i=a.next();if(i=="#")return a.skipToEnd(),"comment";if(i=="0"&&a.eat("x"))return a.eatWhile(/[\da-f]/i),"number";if(i=="."&&a.eat(/\d/))return a.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(i))return a.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if(i=="'"||i=='"')return b.tokenize=j(i),"string";if(i=="."&&a.match(/.[.\d]+/))return"keyword";if(/[\w\.]/.test(i)&&i!="_"){a.eatWhile(/[\w\.]/);var k=a.current();return c.propertyIsEnumerable(k)?"atom":e.propertyIsEnumerable(k)?(f.propertyIsEnumerable(k)&&(h="block"),"keyword"):d.propertyIsEnumerable(k)?"builtin":"variable"}return i=="%"?(a.skipTo("%")&&a.next(),"variable-2"):i=="<"&&a.eat("-")?"arrow":i=="="&&b.ctx.argList?"arg-is":g.test(i)?i=="$"?"dollar":(a.eatWhile(g),"operator"):/[\(\){}\[\];]/.test(i)?(h=i,i==";"?"semi":null):null}function j(a){return function(b,c){if(b.eat("\\")){var d=b.next();return d=="x"?b.match(/^[a-f0-9]{2}/i):(d=="u"||d=="U")&&b.eat("{")&&b.skipTo("}")?b.next():d=="u"?b.match(/^[a-f0-9]{4}/i):d=="U"?b.match(/^[a-f0-9]{8}/i):/[0-7]/.test(d)&&b.match(/^[0-7]{1,2}/),"string-2"}var e;while((e=b.next())!=null){if(e==a){c.tokenize=i;break}if(e=="\\"){b.backUp(1);break}}return"string"}}function k(a,b,c){a.ctx={type:b,indent:a.indent,align:null,column:c.column(),prev:a.ctx}}function l(a){a.indent=a.ctx.indent,a.ctx=a.ctx.prev}var c=b("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"),d=b("list quote bquote eval return call parse deparse"),e=b("if else repeat while function for in next break"),f=b("if else repeat while function for"),g=/[+\-*\/^<>=!&|~$:]/,h;return{startState:function(b){return{tokenize:i,ctx:{type:"top",indent:-a.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(a,b){a.sol()&&(b.ctx.align==null&&(b.ctx.align=!1),b.indent=a.indentation());if(a.eatSpace())return null;var c=b.tokenize(a,b);c!="comment"&&b.ctx.align==null&&(b.ctx.align=!0);var d=b.ctx.type;return(h==";"||h=="{"||h=="}")&&d=="block"&&l(b),h=="{"?k(b,"}",a):h=="("?(k(b,")",a),b.afterIdent&&(b.ctx.argList=!0)):h=="["?k(b,"]",a):h=="block"?k(b,"block",a):h==d&&l(b),b.afterIdent=c=="variable"||c=="keyword",c},indent:function(b,c){if(b.tokenize!=i)return 0;var d=c&&c.charAt(0),e=b.ctx,f=d==e.type;return e.type=="block"?e.indent+(d=="{"?0:a.indentUnit):e.align?e.column+(f?0:1):e.indent+(f?0:a.indentUnit)}}}),CodeMirror.defineMIME("text/x-rsrc","r"),CodeMirror.defineMode("ruby",function(a,b){function c(a){var b={};for(var c=0,d=a.length;c<d;++c)b[a[c]]=!0;return b}function i(a,b,c){return c.tokenize.push(a),a(b,c)}function j(a,b){h=null;if(a.sol()&&a.match("=begin")&&a.eol())return b.tokenize.push(n),"comment";if(a.eatSpace())return null;var c=a.next();if(c=="`"||c=="'"||c=='"'||c=="/"&&!a.eol()&&a.peek()!=" ")return i(l(c,"string",c=='"'||c=="`"),a,b);if(c=="%"){var d,e=!1;a.eat("s")?d="atom":a.eat(/[WQ]/)?(d="string",e=!0):a.eat(/[wxqr]/)&&(d="string");var f=a.eat(/[^\w\s]/);return f?(g.propertyIsEnumerable(f)&&(f=g[f]),i(l(f,d,e,!0),a,b)):"operator"}if(c=="#")return a.skipToEnd(),"comment";if(c=="<"&&a.eat("<")){a.eat("-"),a.eat(/[\'\"\`]/);var j=a.match(/^\w+/);return a.eat(/[\'\"\`]/),j?i(m(j[0]),a,b):null}if(c=="0")return a.eat("x")?a.eatWhile(/[\da-fA-F]/):a.eat("b")?a.eatWhile(/[01]/):a.eatWhile(/[0-7]/),"number";if(/\d/.test(c))return a.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if(c=="?"){while(a.match(/^\\[CM]-/));return a.eat("\\")?a.eatWhile(/\w/):a.next(),"string"}return c==":"?a.eat("'")?i(l("'","atom",!1),a,b):a.eat('"')?i(l('"',"atom",!0),a,b):(a.eatWhile(/[\w\?]/),"atom"):c=="@"?(a.eat("@"),a.eatWhile(/[\w\?]/),"variable-2"):c=="$"?(a.next(),a.eatWhile(/[\w\?]/),"variable-3"):/\w/.test(c)?(a.eatWhile(/[\w\?]/),a.eat(":")?"atom":"ident"):c!="|"||!b.varList&&b.lastTok!="{"&&b.lastTok!="do"?/[\(\)\[\]{}\\;]/.test(c)?(h=c,null):c=="-"&&a.eat(">")?"arrow":/[=+\-\/*:\.^%<>~|]/.test(c)?(a.eatWhile(/[=+\-\/*:\.^%<>~|]/),"operator"):null:(h="|",null)}function k(){var a=1;return function(b,c){if(b.peek()=="}"){a--;if(a==0)return c.tokenize.pop(),c.tokenize[c.tokenize.length-1](b,c)}else b.peek()=="{"&&a++;return j(b,c)}}function l(a,b,c,d){return function(e,f){var g=!1,h;while((h=e.next())!=null){if(h==a&&(d||!g)){f.tokenize.pop();break}if(c&&h=="#"&&!g&&e.eat("{")){f.tokenize.push(k(arguments.callee));break}g=!g&&h=="\\"}return b}}function m(a){return function(b,c){return b.match(a)?c.tokenize.pop():b.skipToEnd(),"string"}}function n(a,b){return a.sol()&&a.match("=end")&&a.eol()&&b.tokenize.pop(),a.skipToEnd(),"comment"}var d=c(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload"]),e=c(["def","class","case","for","while","do","module","then","catch","loop","proc","begin"]),f=c(["end","until"]),g={"[":"]","{":"}","(":")"},h;return{startState:function(){return{tokenize:[j],indented:0,context:{type:"top",indented:-a.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(a,b){a.sol()&&(b.indented=a.indentation());var c=b.tokenize[b.tokenize.length-1](a,b),g;if(c=="ident"){var i=a.current();c=d.propertyIsEnumerable(a.current())?"keyword":/^[A-Z]/.test(i)?"tag":b.lastTok=="def"||b.lastTok=="class"||b.varList?"def":"variable",e.propertyIsEnumerable(i)?g="indent":f.propertyIsEnumerable(i)?g="dedent":(i=="if"||i=="unless")&&a.column()==a.indentation()&&(g="indent")}if(h||c&&c!="comment")b.lastTok=i||h||c;return h=="|"&&(b.varList=!b.varList),g=="indent"||/[\(\[\{]/.test(h)?b.context={prev:b.context,type:h||c,indented:b.indented}:(g=="dedent"||/[\)\]\}]/.test(h))&&b.context.prev&&(b.context=b.context.prev),a.eol()&&(b.continuedLine=h=="\\"||c=="operator"),c},indent:function(b,c){if(b.tokenize[b.tokenize.length-1]!=j)return 0;var d=c&&c.charAt(0),e=b.context,f=e.type==g[d]||e.type=="keyword"&&/^(?:end|until|else|elsif|when|rescue)\b/.test(c);return e.indented+(f?0:a.indentUnit)+(b.continuedLine?a.indentUnit:0)},electricChars:"}de"}}),CodeMirror.defineMIME("text/x-ruby","ruby"),CodeMirror.defineMode("scheme",function(a,b){function l(a){var b={},c=a.split(" ");for(var d=0;d<c.length;++d)b[c[d]]=!0;return b}function o(a,b,c){this.indent=a,this.type=b,this.prev=c}function p(a,b,c){a.indentStack=new o(b,c,a.indentStack)}function q(a){a.indentStack=a.indentStack.prev}function r(a,b){if(/[0-9]/.exec(a)!=null){b.eatWhile(/[0-9]/),b.eat(/\//),b.eatWhile(/[0-9]/);if(b.eol()||!/[a-zA-Z\-\_\/]/.exec(b.peek()))return!0;b.backUp(b.current().length-1)}return!1}var c="builtin",d="comment",e="string",f="atom",g="number",h="bracket",i="keyword",j=2,k=1,m=l("\u03bb case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),n=l("define let letrec let* lambda");return{startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1}},token:function(a,b){b.indentStack==null&&a.sol()&&(b.indentation=a.indentation());if(a.eatSpace())return null;var i=null;switch(b.mode){case"string":var k,l=!1;while((k=a.next())!=null){if(k=='"'&&!l){b.mode=!1;break}l=!l&&k=="\\"}i=e;break;case"comment":var k,o=!1;while((k=a.next())!=null){if(k=="#"&&o){b.mode=!1;break}o=k=="|"}i=d;break;case"s-expr-comment":b.mode=!1;if(a.peek()=="("||a.peek()=="[")b.sExprComment=0;else{a.eatWhile(/[^/s]/),i=d;break};default:var s=a.next();if(s=='"')b.mode="string",i=e;else if(s=="'")i=f;else if(s=="#")a.eat("|")?(b.mode="comment",i=d):a.eat(/[tf]/)?i=f:a.eat(";")&&(b.mode="s-expr-comment",i=d);else if(s==";")a.skipToEnd(),i=d;else if(s=="-")isNaN(parseInt(a.peek()))?i=null:(a.eatWhile(/[\/0-9]/),i=g);else if(r(s,a))i=g;else if(s=="("||s=="["){var t="",u=a.column();while((letter=a.eat(/[^\s\(\[\;\)\]]/))!=null)t+=letter;t.length>0&&n.propertyIsEnumerable(t)?p(b,u+j,s):(a.eatSpace(),a.eol()||a.peek()==";"?p(b,u+1,s):p(b,u+a.current().length,s)),a.backUp(a.current().length-1),typeof b.sExprComment=="number"&&b.sExprComment++,i=h}else s==")"||s=="]"?(i=h,b.indentStack!=null&&b.indentStack.type==(s==")"?"(":"[")&&(q(b),typeof b.sExprComment=="number"&&--b.sExprComment==0&&(i=d,b.sExprComment=!1))):(a.eatWhile(/[\w\$_\-]/),m&&m.propertyIsEnumerable(a.current())?i=c:i=null)}return typeof b.sExprComment=="number"?d:i},indent:function(a,b){return a.indentStack==null?a.indentation:a.indentStack.indent}}}),CodeMirror.defineMIME("text/x-scheme","scheme"),CodeMirror.defineMode("xml",function(a,b){function h(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if(d=="<"){if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?c(k("atom","]]>")):null:a.match("--")?c(k("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(l(1))):null;if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),b.tokenize=k("meta","?>"),"meta";g=a.eat("/")?"closeTag":"openTag",a.eatSpace(),f="";var e;while(e=a.eat(/[^\s\u00a0=<>\"\'\/?]/))f+=e;return b.tokenize=i,"tag"}if(d=="&"){var h;return a.eat("#")?a.eat("x")?h=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):h=a.eatWhile(/[\d]/)&&a.eat(";"):h=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),h?"atom":"error"}return a.eatWhile(/[^&<]/),null}function i(a,b){var c=a.next();return c==">"||c=="/"&&a.eat(">")?(b.tokenize=h,g=c==">"?"endTag":"selfcloseTag","tag"):c=="="?(g="equals",null):/[\'\"]/.test(c)?(b.tokenize=j(c),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function j(a){return function(b,c){while(!b.eol())if(b.next()==a){c.tokenize=i;break}return"string"}}function k(a,b){return function(c,d){while(!c.eol()){if(c.match(b)){d.tokenize=h;break}c.next()}return a}}function l(a){return function(b,c){var d;while((d=b.next())!=null){if(d=="<")return c.tokenize=l(a+1),c.tokenize(b,c);if(d==">"){if(a==1){c.tokenize=h;break}return c.tokenize=l(a-1),c.tokenize(b,c)}}return"meta"}}function o(){for(var a=arguments.length-1;a>=0;a--)m.cc.push(arguments[a])}function p(){return o.apply(null,arguments),!0}function q(a,b){var c=d.doNotIndent.hasOwnProperty(a)||m.context&&m.context.noIndent;m.context={prev:m.context,tagName:a,indent:m.indented,startOfLine:b,noIndent:c}}function r(){m.context&&(m.context=m.context.prev)}function s(a){if(a=="openTag")return m.tagName=f,p(v,t(m.startOfLine));if(a=="closeTag"){var b=!1;return m.context?b=m.context.tagName!=f:b=!0,b&&(n="error"),p(u(b))}return p()}function t(a){return function(b){return b=="selfcloseTag"||b=="endTag"&&d.autoSelfClosers.hasOwnProperty(m.tagName.toLowerCase())?p():b=="endTag"?(q(m.tagName,a),p()):p()}}function u(a){return function(b){return a&&(n="error"),b=="endTag"?(r(),p()):(n="error",p(arguments.callee))}}function v(a){return a=="word"?(n="attribute",p(v)):a=="equals"?p(w,v):a=="string"?(n="error",p(v)):o()}function w(a){return a=="word"&&d.allowUnquoted?(n="string",p()):a=="string"?p(x):o()}function x(a){return a=="string"?p(x):o()}var c=a.indentUnit,d=b.htmlMode?{autoSelfClosers:{br:!0,img:!0,hr:!0,link:!0,input:!0,meta:!0,col:!0,frame:!0,base:!0,area:!0},doNotIndent:{pre:!0},allowUnquoted:!0}:{autoSelfClosers:{},doNotIndent:{},allowUnquoted:!1},e=b.alignCDATA,f,g,m,n;return{startState:function(){return{tokenize:h,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(a,b){a.sol()&&(b.startOfLine=!0,b.indented=a.indentation());if(a.eatSpace())return null;n=g=f=null;var c=b.tokenize(a,b);b.type=g;if((c||g)&&c!="comment"){m=b;for(;;){var d=b.cc.pop()||s;if(d(g||c))break}}return b.startOfLine=!1,n||c},indent:function(a,b,d){var f=a.context;if(a.tokenize!=i&&a.tokenize!=h||f&&f.noIndent)return d?d.match(/^(\s*)/)[0].length:0;if(e&&/<!\[CDATA\[/.test(b))return 0;f&&/^<\//.test(b)&&(f=f.prev);while(f&&!f.startOfLine)f=f.prev;return f?f.indent+c:0},compareStates:function(a,b){if(a.indented!=b.indented||a.tokenize!=b.tokenize)return!1;for(var c=a.context,d=b.context;;c=c.prev,d=d.prev){if(!c||!d)return c==d;if(c.tagName!=d.tagName)return!1}},electricChars:"/"}}),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),CodeMirror.defineMode("yaml",function(){var a=["true","false","on","off","yes","no"],b=new RegExp("\\b(("+a.join(")|(")+"))$","i");return{token:function(a,c){var d=a.peek(),e=c.escaped;c.escaped=!1;if(d=="#")return a.skipToEnd(),"comment";if(c.literal&&a.indentation()>c.keyCol)return a.skipToEnd(),"string";c.literal&&(c.literal=!1);if(a.sol()){c.keyCol=0,c.pair=!1,c.pairStart=!1;if(a.match(/---/))return"def";if(a.match(/\.\.\./))return"def";if(a.match(/\s*-\s+/))return"meta"}if(!c.pair&&a.match(/^\s*([a-z0-9\._-])+(?=\s*:)/i))return c.pair=!0,c.keyCol=a.indentation(),"atom";if(c.pair&&a.match(/^:\s*/))return c.pairStart=!0,"meta";if(a.match(/^(\{|\}|\[|\])/))return d=="{"?c.inlinePairs++:d=="}"?c.inlinePairs--:d=="["?c.inlineList++:c.inlineList--,"meta";if(c.inlineList>0&&!e&&d==",")return a.next(),"meta";if(c.inlinePairs>0&&!e&&d==",")return c.keyCol=0,c.pair=!1,c.pairStart=!1,a.next(),"meta";if(c.pairStart){if(a.match(/^\s*(\||\>)\s*/))return c.literal=!0,"meta";if(a.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(c.inlinePairs==0&&a.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(c.inlinePairs>0&&a.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(a.match(b))return"keyword"}return c.pairStart=!1,c.escaped=d=="\\",a.next(),null},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),CodeMirror.defineMIME("text/x-yaml","yaml")