Commits

Manuel Barkhau  committed 8ff0bb3 Draft

updated codemirror lib

  • Participants
  • Parent commits 7cf87d5

Comments (0)

Files changed (1)

File lib/codemirror.min.js

-var CodeMirror=function(){function a(d,e){function Vb(a){return a>=0&&a<sb.size}function Xb(a){return v(sb,a)}function Yb(a,b){Jb=!0;var c=b-a.height;for(var d=a;d;d=d.parent)d.height+=c}function Zb(a){var b={line:0,ch:0};nc(b,{line:sb.size-1,ch:Xb(sb.size-1).text.length},eb(a),b,b),Db=!0}function $b(a){var b=[];return sb.iter(0,sb.size,function(a){b.push(a.text)}),b.join("\n")}function _b(a){function j(a){var b=Gd(a,!0);if(b&&!Y(b,g)){ub||lc(),g=b,Oc(d,b),Db=!1;var c=Hc();if(b.line>=c.to||b.line<c.from)h=setTimeout(Td(function(){j(a)}),150)}}function k(a){clearTimeout(h);var b=Gd(a);b&&Oc(d,b),C(a),Dc(),Db=!0,l(),i()}Nc(H(a,"shiftKey"));for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==T&&b!=U)return;for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==hb)return f.onGutterClick&&f.onGutterClick(Wb,cb(hb.childNodes,b)+Mb,a),C(a);var d=Gd(a);switch(G(a)){case 3:L&&!c&&Hd(a);return;case 2:d&&Rc(d.line,d.ch,!0);return}if(!d){F(a)==S&&C(a);return}ub||lc();var e=+(new Date);if(yb&&yb.time>e-400&&Y(yb.pos,d))return C(a),setTimeout(Dc,20),$c(d.line);if(xb&&xb.time>e-400&&Y(xb.pos,d))return yb={time:e,pos:d},C(a),Zc(d);xb={time:e,pos:d};var g=d,h;if(R&&!f.readOnly&&!Y(vb.from,vb.to)&&!Z(d,vb.from)&&!Z(vb.to,d)){O&&(ib.draggable=!0);var i=I(document,"mouseup",Td(function(b){O&&(ib.draggable=!1),Ab=!1,i(),Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)<10&&(C(b),Rc(d.line,d.ch,!0),Dc())}),!0);Ab=!0,ib.dragDrop&&ib.dragDrop();return}C(a),Rc(d.line,d.ch,!0);var l=I(document,"mousemove",Td(function(a){clearTimeout(h),C(a),!M&&!G(a)?k(a):j(a)}),!0),i=I(document,"mouseup",Td(k),!0)}function ac(a){for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==hb)return C(a);var c=Gd(a);if(!c)return;yb={time:+(new Date),pos:c},C(a),Zc(c)}function bc(a){a.preventDefault();var b=Gd(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=Tc(b),Td(function(){var a=sc(g.join(""),b,b);Oc(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=vb.from,k=vb.to;Oc(b,b),Ab&&sc("",j,k),tc(g),Dc()}}catch(a){}}function cc(a){var b=wc();a.dataTransfer.setData("Text",b);if(L||P){var c=document.createElement("img");c.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",a.dataTransfer.setDragImage(c,0,0)}}function dc(a,b){if(typeof a=="string"){a=h[a];if(!a)return!1}var c=wb;try{f.readOnly&&(Cb=!0),b&&(wb=null),a(Wb)}catch(d){if(d!=K)throw d;return!1}finally{wb=c,Cb=!1}return!0}function ec(a){var b=j(f.keyMap),c=b.auto;clearTimeout(hc),c&&!l(a)&&(hc=setTimeout(function(){j(f.keyMap)==b&&(f.keyMap=c.call?c.call(null,Wb):c)},50));var d=gb[H(a,"keyCode")],e=!1;return d==null||a.altGraphKey?!1:(H(a,"altKey")&&(d="Alt-"+d),H(a,"ctrlKey")&&(d="Ctrl-"+d),H(a,"metaKey")&&(d="Cmd-"+d),H(a,"shiftKey")?e=k("Shift-"+d,f.extraKeys,f.keyMap,function(a){return dc(a,!0)})||k(d,f.extraKeys,f.keyMap,function(a){if(typeof a=="string"&&/^go[A-Z]/.test(a))return dc(a)}):e=k(d,f.extraKeys,f.keyMap,dc),e&&(C(a),M&&(a.oldKeyCode=a.keyCode,a.keyCode=0)),e)}function fc(a,b){var c=k("'"+b+"'",f.extraKeys,f.keyMap,dc);return c&&C(a),c}function ic(a){ub||lc(),M&&a.keyCode==27&&(a.returnValue=!1),xc&&Bc()&&(xc=!1);if(f.onKeyEvent&&f.onKeyEvent(Wb,B(a)))return;var b=H(a,"keyCode");Nc(b==16||H(a,"shiftKey"));var d=ec(a);window.opera&&(gc=d?b:null,!d&&b==88&&H(a,c?"metaKey":"ctrlKey")&&tc(""))}function jc(a){xc&&Bc();if(f.onKeyEvent&&f.onKeyEvent(Wb,B(a)))return;var b=H(a,"keyCode"),c=H(a,"charCode");if(window.opera&&b==gc){gc=null,C(a);return}if((window.opera&&!a.which||Q)&&ec(a))return;var d=String.fromCharCode(c==null?b:c);f.electricChars&&rb.electricChars&&f.smartIndent&&!f.readOnly&&rb.electricChars.indexOf(d)>-1&&setTimeout(Td(function(){ad(vb.to.line,"smart")}),75);if(fc(a,d))return;zc()}function kc(a){if(f.onKeyEvent&&f.onKeyEvent(Wb,B(a)))return;H(a,"keyCode")==16&&(wb=null)}function lc(){if(f.readOnly=="nocursor")return;ub||(f.onFocus&&f.onFocus(Wb),ub=!0,s.className.search(/\bCodeMirror-focused\b/)==-1&&(s.className+=" CodeMirror-focused"),Ib||Cc(!0)),yc(),Id()}function mc(){ub&&(f.onBlur&&f.onBlur(Wb),ub=!1,Pb&&Td(function(){Pb&&(Pb(),Pb=null)})(),s.className=s.className.replace(" CodeMirror-focused","")),clearInterval(qb),setTimeout(function(){ub||(wb=null)},150)}function nc(a,b,c,d,e){if(Cb)return;if(Tb){var g=[];sb.iter(a.line,b.line+1,function(a){g.push(a.text)}),Tb.addChange(a.line,c.length,g);while(Tb.done.length>f.undoDepth)Tb.done.shift()}rc(a,b,c,d,e)}function oc(a,b){if(!a.length)return;var c=a.pop(),d=[];for(var e=c.length-1;e>=0;e-=1){var f=c[e],g=[],h=f.start+f.added;sb.iter(f.start,h,function(a){g.push(a.text)}),d.push({start:f.start,added:f.old.length,old:g});var i=Tc({line:f.start+f.old.length-1,ch:bb(g[g.length-1],f.old[f.old.length-1])});rc({line:f.start,ch:0},{line:h-1,ch:Xb(h-1).text.length},f.old,i,i)}Db=!0,b.push(d)}function pc(){oc(Tb.done,Tb.undone)}function qc(){oc(Tb.undone,Tb.done)}function rc(a,b,c,d,e){function y(a){return a<=Math.min(b.line,b.line+s)?a:a+s}if(Cb)return;var g=!1,h=Qb.length;f.lineWrapping||sb.iter(a.line,b.line,function(a){if(a.text.length==h)return g=!0,!0});if(a.line!=b.line||c.length>1)Jb=!0;var i=b.line-a.line,j=Xb(a.line),k=Xb(b.line);if(a.ch==0&&b.ch==0&&c[c.length-1]==""){var l=[],m=null;a.line?(m=Xb(a.line-1),m.fixMarkEnds(k)):k.fixMarkStarts();for(var n=0,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],m));i&&sb.remove(a.line,i,Kb),l.length&&sb.insert(a.line,l)}else if(j==k)if(c.length==1)j.replace(a.ch,b.ch,c[0]);else{k=j.split(b.ch,c[c.length-1]),j.replace(a.ch,null,c[0]),j.fixMarkEnds(k);var l=[];for(var n=1,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],j));l.push(k),sb.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),sb.remove(a.line+1,i,Kb);else{var l=[];j.replace(a.ch,null,c[0]),k.replace(null,b.ch,c[c.length-1]),j.fixMarkEnds(k);for(var n=1,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],j));i>1&&sb.remove(a.line+1,i-1,Kb),sb.insert(a.line+1,l)}if(f.lineWrapping){var p=S.clientWidth/Dd()-3;sb.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&&Yb(a,b)})}else sb.iter(a.line,n+c.length,function(a){var b=a.text;b.length>h&&(Qb=b,h=b.length,Rb=null,g=!1)}),g&&(h=0,Qb="",Rb=null,sb.iter(0,sb.size,function(a){var b=a.text;b.length>h&&(h=b.length,Qb=b)}));var q=[],s=c.length-i-1;for(var n=0,t=tb.length;n<t;++n){var u=tb[n];u<a.line?q.push(u):u>b.line&&q.push(u+s)}var v=a.line+Math.min(c.length,500);Nd(a.line,v),q.push(v),tb=q,Pd(100),Fb.push({from:a.line,to:b.line+1,diff:s});var w={from:a,to:b,text:c};if(Gb){for(var x=Gb;x.next;x=x.next);x.next=w}else Gb=w;Pc(d,e,y(vb.from.line),y(vb.to.line)),S.clientHeight&&(T.style.height=sb.height*Ad()+2*Ed()+"px")}function sc(a,b,c){function d(d){if(Z(d,b))return d;if(!Z(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=Tc(b),c?c=Tc(c):c=b,a=eb(a);var e;return uc(a,b,c,function(a){return e=a,{from:d(vb.from),to:d(vb.to)}}),e}function tc(a,b){uc(eb(a),vb.from,vb.to,function(a){return b=="end"?{from:a,to:a}:b=="start"?{from:vb.from,to:vb.from}:{from:vb.from,to:a}})}function uc(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});nc(b,c,a,f.from,f.to)}function vc(a,b){var c=a.line,d=b.line;if(c==d)return Xb(c).text.slice(a.ch,b.ch);var e=[Xb(c).text.slice(a.ch)];return sb.iter(c+1,d,function(a){e.push(a.text)}),e.push(Xb(d).text.slice(0,b.ch)),e.join("\n")}function wc(){return vc(vb.from,vb.to)}function yc(){if(xc)return;ob.set(f.pollInterval,function(){Qd(),Bc(),ub&&yc(),Rd()})}function zc(){function b(){Qd();var c=Bc();!c&&!a?(a=!0,ob.set(60,b)):(xc=!1,yc()),Rd()}var a=!1;xc=!0,ob.set(20,b)}function Bc(){if(Ib||!ub||fb(D)||f.readOnly)return!1;var a=D.value;if(a==Ac)return!1;wb=null;var b=0,c=Math.min(Ac.length,a.length);while(b<c&&Ac[b]==a[b])++b;return b<Ac.length?vb.from={line:vb.from.line,ch:vb.from.ch-(Ac.length-b)}:Bb&&Y(vb.from,vb.to)&&(vb.to={line:vb.to.line,ch:Math.min(Xb(vb.to.line).text.length,vb.to.ch+(a.length-b))}),tc(a.slice(b),"end"),Ac=a,!0}function Cc(a){Y(vb.from,vb.to)?a&&(Ac=D.value=""):(Ac="",D.value=wc(),X(D))}function Dc(){f.readOnly!="nocursor"&&D.focus()}function Ec(){if(!kb.getBoundingClientRect)return;var a=kb.getBoundingClientRect();if(M&&a.top==a.bottom)return;var b=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(a.top<0||a.bottom>b)&&kb.scrollIntoView()}function Fc(){var a=ud(vb.inverted?vb.from:vb.to),b=f.lineWrapping?Math.min(a.x,ib.offsetWidth):a.x;return Gc(b,a.y,b,a.yBot)}function Gc(a,b,c,d){var e=Fd(),g=Ed();b+=g,d+=g,a+=e,c+=e;var h=S.clientHeight,i=S.scrollTop,j=!1,k=!0;b<i?(S.scrollTop=Math.max(0,b),j=!0):d>i+h&&(S.scrollTop=d-h,j=!0);var l=S.clientWidth,m=S.scrollLeft,n=f.fixedGutter?_.clientWidth:0;return a<m+n?(a<50&&(a=0),S.scrollLeft=Math.max(0,a-10-n),j=!0):c>l+m-3&&(S.scrollLeft=c+10-l,j=!0,c>T.clientWidth&&(k=!1)),j&&f.onScroll&&f.onScroll(Wb),k}function Hc(){var a=Ad(),b=S.scrollTop-Ed(),c=Math.max(0,Math.floor(b/a)),d=Math.ceil((b+S.clientHeight)/a);return{from:x(sb,c),to:x(sb,d)}}function Ic(a,b){function n(){Rb=S.clientWidth;var a=mb.firstChild,b=!1;return sb.iter(Mb,Nb,function(c){if(!c.hidden){var d=Math.round(a.offsetHeight/k)||1;c.height!=d&&(Yb(c,d),Jb=b=!0)}a=a.nextSibling}),b&&(T.style.height=sb.height*k+2*Ed()+"px"),b}if(!S.clientWidth){Mb=Nb=Lb=0;return}var c=Hc();if(a!==!0&&a.length==0&&c.from>Mb&&c.to<Nb)return;var d=Math.max(c.from-100,0),e=Math.min(sb.size,c.to+100);Mb<d&&d-Mb<20&&(d=Mb),Nb>e&&Nb-e<20&&(e=Math.min(sb.size,Nb));var g=a===!0?[]:Jc([{from:Mb,to:Nb,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=Ad(),l=_.style.display;mb.style.display="none",Kc(d,e,g),mb.style.display=_.style.display="";var m=d!=Mb||e!=Nb||Ob!=S.clientHeight+k;m&&(Ob=S.clientHeight+k),Mb=d,Nb=e,Lb=y(sb,d),U.style.top=Lb*k+"px",S.clientHeight&&(T.style.height=sb.height*k+2*Ed()+"px");if(mb.childNodes.length!=Nb-Mb)throw new Error("BAD PATCH! "+JSON.stringify(g)+" size="+(Nb-Mb)+" nodes="+mb.childNodes.length);return f.lineWrapping?n():(Rb==null&&(Rb=qd(Qb)),Rb>S.clientWidth?(ib.style.width=Rb+"px",T.style.width="",T.style.width=S.scrollWidth+"px"):ib.style.width=T.style.width=""),_.style.display=l,(m||Jb)&&Lc()&&f.lineWrapping&&n()&&Lc(),Mc(),!b&&f.onUpdate&&f.onUpdate(Wb),!0}function Jc(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 Kc(a,b,c){if(!c.length)mb.innerHTML="";else{function d(a){var b=a.nextSibling;return a.parentNode.removeChild(a),b}var e=0,f=mb.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=mb.firstChild,j=a,m=document.createElement("div");sb.iter(a,b,function(a){l&&l.to==j&&(l=c.shift());if(!l||l.from>j){if(a.hidden)var b=m.innerHTML="<pre></pre>";else{var b="<pre"+(a.className?' class="'+a.className+'"':"")+">"+a.getHTML(ed)+"</pre>";a.bgClassName&&(b='<div style="position: relative"><pre class="'+a.bgClassName+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>'+b+"</div>")}m.innerHTML=b,mb.insertBefore(m.firstChild,f)}else f=f.nextSibling;++j})}function Lc(){if(!f.gutter&&!f.lineNumbers)return;var a=U.offsetHeight,b=S.clientHeight;_.style.height=(a-b<2?b:a)+"px";var c=[],d=Mb,e;sb.iter(Mb,Math.max(Nb,Mb+1),function(a){if(a.hidden)c.push("<pre></pre>");else{var b=a.gutterMarker,g=f.lineNumbers?d+f.firstLineNumber:null;b&&b.text?g=b.text.replace("%N%",g!=null?g:""):g==null&&(g="\u00a0"),c.push(b&&b.style?'<pre class="'+b.style+'">':"<pre>",g);for(var h=1;h<a.height;++h)c.push("<br/>&#160;");c.push("</pre>"),b||(e=d)}++d}),_.style.display="none",hb.innerHTML=c.join("");if(e!=null){var g=hb.childNodes[e-Mb],h=String(sb.size).length,i=W(g),j="";while(i.length+j.length<h)j+="\u00a0";j&&g.insertBefore(document.createTextNode(j),g.firstChild)}_.style.display="";var k=Math.abs((parseInt(ib.style.marginLeft)||0)-_.offsetWidth)>2;return ib.style.marginLeft=_.offsetWidth+"px",Jb=!1,k}function Mc(){var a=Y(vb.from,vb.to),b=ud(vb.from,!0),c=a?b:ud(vb.to,!0),d=vb.inverted?b:c,e=Ad(),g=V(s),h=V(mb);A.style.top=Math.max(0,Math.min(S.offsetHeight,d.y+h.top-g.top))+"px",A.style.left=Math.max(0,Math.min(S.offsetWidth,d.x+h.left-g.left))+"px";if(a)kb.style.top=d.y+"px",kb.style.left=(f.lineWrapping?Math.min(d.x,ib.offsetWidth):d.x)+"px",kb.style.display="",lb.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>'}var l=ib.clientWidth||ib.offsetWidth,m=ib.clientHeight||ib.offsetHeight;if(vb.from.ch&&b.y>=0){var n=i?l-c.x:0;k(b.x,b.y,n,e)}var o=Math.max(0,b.y+(vb.from.ch?e:0)),p=Math.min(c.y,m)-o;p>.2*e&&k(0,o,0,p),(!i||!vb.from.ch)&&c.y<m-.5*e&&k(0,c.y,l-c.x,e),lb.innerHTML=j,kb.style.display="none",lb.style.display=""}}function Nc(a){a?wb=wb||(vb.inverted?vb.to:vb.from):wb=null}function Oc(a,b){var c=wb&&Tc(wb);c&&(Z(c,a)?a=c:Z(b,c)&&(b=c)),Pc(a,b),Eb=!0}function Pc(a,b,c,d){Xc=null,c==null&&(c=vb.from.line,d=vb.to.line);if(Y(vb.from,a)&&Y(vb.to,b))return;if(Z(b,a)){var e=b;b=a,a=e}if(a.line!=c){var g=Qc(a,c,vb.from.ch);g?a=g:od(a.line,!1)}b.line!=d&&(b=Qc(b,d,vb.to.ch)),Y(a,b)?vb.inverted=!1:Y(a,vb.to)?vb.inverted=!1:Y(b,vb.from)&&(vb.inverted=!0);if(f.autoClearEmptyLines&&Y(vb.from,vb.to)){var h=vb.inverted?a:b;if(h.line!=vb.from.line&&vb.from.line<sb.size){var i=Xb(vb.from.line);/^\s+$/.test(i.text)&&setTimeout(Td(function(){if(i.parent&&/^\s+$/.test(i.text)){var a=w(i);sc("",{line:a,ch:0},{line:a,ch:i.text.length})}},10))}}vb.from=a,vb.to=b,Hb=!0}function Qc(a,b,c){function d(b){var d=a.line+b,e=b==1?sb.size:-1;while(d!=e){var f=Xb(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=Xb(a.line);return e.hidden?a.line>=b?d(1)||d(-1):d(-1)||d(1):a}function Rc(a,b,c){var d=Tc({line:a,ch:b||0});(c?Oc:Pc)(d,d)}function Sc(a){return Math.max(0,Math.min(a,sb.size-1))}function Tc(a){if(a.line<0)return{line:0,ch:0};if(a.line>=sb.size)return{line:sb.size-1,ch:Xb(sb.size-1).text.length};var b=a.ch,c=Xb(a.line).text.length;return b==null||b>c?{line:a.line,ch:c}:b<0?{line:a.line,ch:0}:a}function Uc(a,b){function g(){for(var b=d+a,c=a<0?-1:sb.size;b!=c;b+=a){var e=Xb(b);if(!e.hidden)return d=b,f=e,!0}}function h(b){if(e==(a<0?0:f.text.length)){if(!!b||!g())return!1;e=a<0?f.text.length:0}else e+=a;return!0}var c=vb.inverted?vb.from:vb.to,d=c.line,e=c.ch,f=Xb(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(db(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 Vc(a,b){var c=a<0?vb.from:vb.to;if(wb||Y(vb.from,vb.to))c=Uc(a,b);Rc(c.line,c.ch,!0)}function Wc(a,b){Y(vb.from,vb.to)?a<0?sc("",Uc(a,b),vb.to):sc("",vb.from,Uc(a,b)):sc("",vb.from,vb.to),Eb=!0}function Yc(a,b){var c=0,d=ud(vb.inverted?vb.from:vb.to,!0);Xc!=null&&(d.x=Xc),b=="page"?c=Math.min(S.clientHeight,window.innerHeight||document.documentElement.clientHeight):b=="line"&&(c=Ad());var e=vd(d.x,d.y+c*a+2);b=="page"&&(S.scrollTop+=ud(e,!0).y-d.y),Rc(e.line,e.ch,!0),Xc=d.x}function Zc(a){var b=Xb(a.line).text,c=a.ch,d=a.ch;while(c>0&&db(b.charAt(c-1)))--c;while(d<b.length&&db(b.charAt(d)))++d;Oc({line:a.line,ch:c},{line:a.line,ch:d})}function $c(a){Oc({line:a,ch:0},Tc({line:a+1,ch:0}))}function _c(a){if(Y(vb.from,vb.to))return ad(vb.from.line,a);var b=vb.to.line-(vb.to.ch?0:1);for(var c=vb.from.line;c<=b;++c)ad(c,a)}function ad(a,b){b||(b="add");if(b=="smart")if(!rb.indent)b="prev";else var c=Md(a);var d=Xb(a),e=d.indentation(f.tabSize),g=d.text.match(/^\s*/)[0],h;b=="prev"?a?h=Xb(a-1).indentation(f.tabSize):h=0:b=="smart"?h=rb.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(vb.from.line!=a&&vb.to.line!=a)return;var j=g}else{var j="",k=0;if(f.indentWithTabs)for(var l=Math.floor(h/f.tabSize);l;--l)k+=f.tabSize,j+="	";while(k<h)++k,j+=" "}sc(j,{line:a,ch:0},{line:a,ch:g.length})}function bd(){rb=a.getMode(f,f.mode),sb.iter(0,sb.size,function(a){a.stateAfter=null}),tb=[0],Pd()}function cd(){var a=f.gutter||f.lineNumbers;_.style.display=a?"":"none",a?Jb=!0:mb.parentNode.style.marginLeft=0}function dd(a,b){if(f.lineWrapping){s.className+=" CodeMirror-wrap";var c=S.clientWidth/Dd()-3;sb.iter(0,sb.size,function(a){if(a.hidden)return;var b=Math.ceil(a.text.length/c)||1;b!=1&&Yb(a,b)}),ib.style.width=T.style.width=""}else s.className=s.className.replace(" CodeMirror-wrap",""),Rb=null,Qb="",sb.iter(0,sb.size,function(a){a.height!=1&&!a.hidden&&Yb(a,1),a.text.length>Qb.length&&(Qb=a.text)});Fb.push({from:0,to:sb.size})}function ed(a){var b=f.tabSize-a%f.tabSize,c=Sb[b];if(c)return c;for(var d='<span class="cm-tab">',e=0;e<b;++e)d+=" ";return Sb[b]={html:d+"</span>",width:b}}function fd(){S.className=S.className.replace(/\s*cm-s-\w+/g,"")+f.theme.replace(/(^|\s)\s*/g," cm-s-")}function gd(){this.set=[]}function hd(a,b,c){function e(a,b,c,e){Xb(a).addMark(new p(b,c,e,d))}a=Tc(a),b=Tc(b);var d=new gd;if(!Z(a,b))return d;if(a.line==b.line)e(a.line,a.ch,b.ch,c);else{e(a.line,a.ch,null,c);for(var f=a.line+1,g=b.line;f<g;++f)e(f,null,null,c);e(b.line,null,b.ch,c)}return Fb.push({from:a.line,to:b.line+1}),d}function id(a){a=Tc(a);var b=new q(a.ch);return Xb(a.line).addMark(b),b}function jd(a){a=Tc(a);var b=[],c=Xb(a.line).marked;if(!c)return b;for(var d=0,e=c.length;d<e;++d){var f=c[d];(f.from==null||f.from<=a.ch)&&(f.to==null||f.to>=a.ch)&&b.push(f.marker||f)}return b}function kd(a,b,c){return typeof a=="number"&&(a=Xb(Sc(a))),a.gutterMarker={text:b,style:c},Jb=!0,a}function ld(a){typeof a=="number"&&(a=Xb(Sc(a))),a.gutterMarker=null,Jb=!0}function md(a,b){var c=a,d=a;return typeof a=="number"?d=Xb(Sc(a)):c=w(a),c==null?null:b(d,c)?(Fb.push({from:c,to:c+1}),d):null}function nd(a,b,c){return md(a,function(a){if(a.className!=b||a.bgClassName!=c)return a.className=b,a.bgClassName=c,!0})}function od(a,b){return md(a,function(a,c){if(a.hidden!=b){a.hidden=b,Yb(a,b?0:1);var d=vb.from.line,e=vb.to.line;if(b&&(d==c||e==c)){var f=d==c?Qc({line:d,ch:0},d,0):vb.from,g=e==c?Qc({line:e,ch:0},e,0):vb.to;if(!g)return;Pc(f,g)}return Jb=!0}})}function pd(a){if(typeof a=="number"){if(!Vb(a))return null;var b=a;a=Xb(a);if(!a)return null}else{var b=w(a);if(b==null)return null}var c=a.gutterMarker;return{line:b,handle:a,text:a.text,markerText:c&&c.text,markerClass:c&&c.style,lineClass:a.className,bgClass:a.bgClassName}}function qd(a){return jb.innerHTML="<pre><span>x</span></pre>",jb.firstChild.firstChild.firstChild.nodeValue=a,jb.firstChild.firstChild.offsetWidth||10}function rd(a,b){function e(a){return jb.innerHTML="<pre><span>"+c.getHTML(ed,a)+"</span></pre>",jb.firstChild.firstChild.offsetWidth}if(b<=0)return 0;var c=Xb(a),d=c.text,f=0,g=0,h=d.length,i,j=Math.min(h,Math.ceil(b/Dd()));for(;;){var k=e(j);if(!(k<=b&&j<h)){i=k,h=j;break}j=Math.min(h,Math.ceil(j*1.2))}if(b>i)return h;j=Math.floor(h*.8),k=e(j),k<b&&(f=j,g=k);for(;;){if(h-f<=1)return i-b>b-g?f:h;var l=Math.ceil((f+h)/2),m=e(l);m>b?(h=l,i=m):(f=l,g=m)}}function td(a,b){if(b==0)return{top:0,left:0};var c="";if(f.lineWrapping){var d=a.text.indexOf(" ",b+6);c=ab(a.text.slice(b+1,d<0?a.text.length:d+(M?5:0)))}jb.innerHTML="<pre>"+a.getHTML(ed,b)+'<span id="CodeMirror-temp-'+sd+'">'+ab(a.text.charAt(b)||" ")+"</span>"+c+"</pre>";var e=document.getElementById("CodeMirror-temp-"+sd),g=e.offsetTop,h=e.offsetLeft;if(M&&g==0&&h==0){var i=document.createElement("span");i.innerHTML="x",e.parentNode.insertBefore(i,e.nextSibling),g=i.offsetTop}return{top:g,left:h}}function ud(a,b){var c,d=Ad(),e=d*(y(sb,a.line)-(b?Lb:0));if(a.ch==0)c=0;else{var g=td(Xb(a.line),a.ch);c=g.left,f.lineWrapping&&(e+=Math.max(0,g.top))}return{x:c,y:e,yBot:e+d}}function vd(a,b){function l(a){var b=td(h,a);if(j){var d=Math.round(b.top/c);return Math.max(0,b.left+(d-k)*S.clientWidth)}return b.left}b<0&&(b=0);var c=Ad(),d=Dd(),e=Lb+Math.floor(b/c),g=x(sb,e);if(g>=sb.size)return{line:sb.size-1,ch:Xb(sb.size-1).text.length};var h=Xb(g),i=h.text,j=f.lineWrapping,k=j?e-y(sb,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*S.clientWidth*.9)/d));for(;;){var r=l(q);if(!(r<=a&&q<o)){p=r,o=q;break}q=Math.min(o,Math.ceil(q*1.2))}if(a>p)return{line:g,ch:o};q=Math.floor(o*.8),r=l(q),r<a&&(m=q,n=r);for(;;){if(o-m<=1)return{line:g,ch:p-a>a-n?m:o};var s=Math.ceil((m+o)/2),t=l(s);t>a?(o=s,p=t):(m=s,n=t)}}function wd(a){var b=ud(a,!0),c=V(ib);return{x:c.left+b.x,y:c.top+b.y,yBot:c.top+b.yBot}}function Ad(){if(zd==null){zd="<pre>";for(var a=0;a<49;++a)zd+="x<br/>";zd+="x</pre>"}var b=mb.clientHeight;return b==yd?xd:(yd=b,jb.innerHTML=zd,xd=jb.firstChild.offsetHeight/50||1,jb.innerHTML="",xd)}function Dd(){return S.clientWidth==Cd?Bd:(Cd=S.clientWidth,Bd=qd("x"))}function Ed(){return ib.offsetTop}function Fd(){return ib.offsetLeft}function Gd(a,b){var c=V(S,!0),d,e;try{d=a.clientX,e=a.clientY}catch(a){return null}if(!b&&(d-c.left>S.clientWidth||e-c.top>S.clientHeight))return null;var f=V(ib,!0);return vd(d-f.left,e-f.top)}function Hd(a){function f(){var a=eb(D.value).join("\n");a!=e&&Td(tc)(a,"end"),A.style.position="relative",D.style.cssText=d,N&&(S.scrollTop=c),Ib=!1,Cc(!0),yc()}var b=Gd(a),c=S.scrollTop;if(!b||window.opera)return;(Y(vb.from,vb.to)||Z(b,vb.from)||!Z(b,vb.to))&&Td(Rc)(b.line,b.ch);var d=D.style.cssText;A.style.position="absolute",D.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Ib=!0;var e=D.value=wc();Dc(),X(D);if(L){E(a);var g=I(window,"mouseup",function(){g(),setTimeout(f,20)},!0)}else setTimeout(f,50)}function Id(){clearInterval(qb);var a=!0;kb.style.visibility="",qb=setInterval(function(){kb.style.visibility=(a=!a)?"":"hidden"},650)}function Kd(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=Jd[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=vb.inverted?vb.from:vb.to,c=Xb(b.line),d=b.ch-1,e=d>=0&&Jd[c.text.charAt(d)]||Jd[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,sb.size):Math.max(-1,k-100);k!=l;k+=h){var c=Xb(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=hd({line:b.line,ch:d},{line:b.line,ch:d+1},m),t=r.pos!=null&&hd({line:k,ch:r.pos},{line:k,ch:r.pos+1},m),u=Td(function(){s.clear(),t&&t.clear()});a?setTimeout(u,800):Pb=u}function Ld(a){var b,c;for(var d=a,e=a-40;d>e;--d){if(d==0)return 0;var g=Xb(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 Md(a){var b=Ld(a),c=b&&Xb(b-1).stateAfter;return c?c=m(rb,c):c=n(rb),sb.iter(b,a,function(a){a.highlight(rb,c,f.tabSize),a.stateAfter=m(rb,c)}),b<a&&Fb.push({from:b,to:a}),a<sb.size&&!Xb(a).stateAfter&&tb.push(a),c}function Nd(a,b){var c=Md(a);sb.iter(a,b,function(a){a.highlight(rb,c,f.tabSize),a.stateAfter=m(rb,c)})}function Od(){var a=+(new Date)+f.workTime,b=tb.length;while(tb.length){if(!Xb(Mb).stateAfter)var c=Mb;else var c=tb.pop();if(c>=sb.size)continue;var d=Ld(c),e=d&&Xb(d-1).stateAfter;e?e=m(rb,e):e=n(rb);var g=0,h=rb.compareStates,i=!1,j=d,k=!1;sb.iter(j,sb.size,function(b){var d=b.stateAfter;if(+(new Date)>a)return tb.push(j),Pd(f.workDelay),i&&Fb.push({from:c,to:j+1}),k=!0;var l=b.highlight(rb,e,f.tabSize);l&&(i=!0),b.stateAfter=m(rb,e);if(h){if(d&&h(d,e))return!0}else if(l!==!1||!d)g=0;else if(++g>3&&(!rb.indent||rb.indent(d,"")==rb.indent(e,"")))return!0;++j});if(k)return;i&&Fb.push({from:c,to:j+1})}b&&f.onHighlightComplete&&f.onHighlightComplete(Wb)}function Pd(a){if(!tb.length)return;pb.set(a,Td(Od))}function Qd(){Db=Eb=Gb=null,Fb=[],Hb=!1,Kb=[]}function Rd(){var a=!1,b;Hb&&(a=!Fc()),Fb.length?b=Ic(Fb,!0):(Hb&&Mc(),Jb&&Lc()),a&&Fc(),Hb&&(Ec(),Id()),ub&&!Ib&&(Db===!0||Db!==!1&&Hb)&&Cc(Eb),Hb&&f.matchBrackets&&setTimeout(Td(function(){Pb&&(Pb(),Pb=null),Y(vb.from,vb.to)&&Kd(!1)}),20);var c=Gb,d=Kb;Hb&&f.onCursorActivity&&f.onCursorActivity(Wb),c&&f.onChange&&Wb&&f.onChange(Wb,c);for(var e=0;e<d.length;++e)d[e](Wb);b&&f.onUpdate&&f.onUpdate(Wb)}function Td(a){return function(){Sd++||Qd();try{var b=a.apply(this,arguments)}finally{--Sd||Rd()}return b}}var f={},i=a.defaults;for(var o in i)i.hasOwnProperty(o)&&(f[o]=(e&&e.hasOwnProperty(o)?e:i)[o]);var s=document.createElement("div");s.className="CodeMirror"+(f.lineWrapping?" CodeMirror-wrap":""),s.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden;"></div><pre class="CodeMirror-cursor">&#160;</pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>',d.appendChild?d.appendChild(s):d(s);var A=s.firstChild,D=A.firstChild,S=s.lastChild,T=S.firstChild,U=T.firstChild,_=U.firstChild,hb=_.firstChild,ib=_.nextSibling.firstChild,jb=ib.firstChild,kb=jb.nextSibling,lb=kb.nextSibling,mb=lb.nextSibling;fd(),b&&(D.style.width="0px"),O||(ib.draggable=!0),ib.style.outline="none",f.tabindex!=null&&(D.tabIndex=f.tabindex),f.autofocus&&Dc(),!f.gutter&&!f.lineNumbers&&(_.style.display="none"),Q&&(A.style.height="1px",A.style.position="absolute");try{qd("x")}catch(nb){throw nb.message.match(/runtime/i)&&(nb=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),nb}var ob=new J,pb=new J,qb,rb,sb=new u([new t([new r("")])]),tb,ub;bd();var vb={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},wb,xb,yb,zb=0,Ab,Bb=!1,Cb=!1,Db,Eb,Fb,Gb,Hb,Ib,Jb,Kb,Lb=0,Mb=0,Nb=0,Ob=0,Pb,Qb="",Rb,Sb={};Td(function(){Zb(f.value||""),Db=!1})();var Tb=new z;I(S,"mousedown",Td(_b)),I(S,"dblclick",Td(ac)),I(ib,"dragstart",cc),I(ib,"selectstart",C),L||I(S,"contextmenu",Hd),I(S,"scroll",function(){zb=S.scrollTop,Ic([]),f.fixedGutter&&(_.style.left=S.scrollLeft+"px"),f.onScroll&&f.onScroll(Wb)}),I(window,"resize",function(){Ic(!0)}),I(D,"keyup",Td(kc)),I(D,"input",zc),I(D,"keydown",Td(ic)),I(D,"keypress",Td(jc)),I(D,"focus",lc),I(D,"blur",mc),I(S,"dragenter",E),I(S,"dragover",E),I(S,"drop",Td(bc)),I(S,"paste",function(){Dc(),zc()}),I(D,"paste",zc),I(D,"cut",Td(function(){f.readOnly||tc("")})),Q&&I(T,"mouseup",function(){document.activeElement==D&&D.blur(),Dc()});var Ub;try{Ub=document.activeElement==D}catch(nb){}Ub||f.autofocus?setTimeout(lc,20):mc();var Wb=s.CodeMirror={getValue:$b,setValue:Td(Zb),getSelection:wc,replaceSelection:Td(tc),focus:function(){window.focus(),Dc(),lc(),zc()},setOption:function(a,b){var c=f[a];f[a]=b,a=="mode"||a=="indentUnit"?bd():a=="readOnly"&&b=="nocursor"?(mc(),D.blur()):a=="readOnly"&&!b?Cc(!0):a=="theme"?fd():a=="lineWrapping"&&c!=b?Td(dd)():a=="tabSize"&&Ic(!0);if(a=="lineNumbers"||a=="gutter"||a=="firstLineNumber"||a=="theme")cd(),Ic(!0)},getOption:function(a){return f[a]},undo:Td(pc),redo:Td(qc),indentLine:Td(function(a,b){typeof b!="string"&&(b==null?b=f.smartIndent?"smart":"prev":b=b?"add":"subtract"),Vb(a)&&ad(a,b)}),indentSelection:Td(_c),historySize:function(){return{undo:Tb.done.length,redo:Tb.undone.length}},clearHistory:function(){Tb=new z},matchBrackets:Td(function(){Kd(!0)}),getTokenAt:Td(function(a){return a=Tc(a),Xb(a.line).getTokenAt(rb,Md(a.line),a.ch)}),getStateAfter:function(a){return a=Sc(a==null?sb.size-1:a),Md(a+1)},cursorCoords:function(a,b){return a==null&&(a=vb.inverted),this.charCoords(a?vb.from:vb.to,b)},charCoords:function(a,b){return a=Tc(a),b=="local"?ud(a,!1):b=="div"?ud(a,!0):wd(a)},coordsChar:function(a){var b=V(ib);return vd(a.x-b.left,a.y-b.top)},markText:Td(hd),setBookmark:id,findMarksAt:jd,setMarker:Td(kd),clearMarker:Td(ld),setLineClass:Td(nd),hideLine:Td(function(a){return od(a,!0)}),showLine:Td(function(a){return od(a,!1)}),onDeleteLine:function(a,b){if(typeof a=="number"){if(!Vb(a))return null;a=Xb(a)}return(a.handlers||(a.handlers=[])).push(b),a},lineInfo:pd,addWidget:function(a,b,c,d,e){a=ud(Tc(a));var f=a.yBot,g=a.x;b.style.position="absolute",T.appendChild(b);if(d=="over")f=a.y;else if(d=="near"){var h=Math.max(S.offsetHeight,sb.height*Ad()),i=Math.max(T.clientWidth,ib.clientWidth)-Fd();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+Ed()+"px",b.style.left=b.style.right="",e=="right"?(g=T.clientWidth-b.offsetWidth,b.style.right="0px"):(e=="left"?g=0:e=="middle"&&(g=(T.clientWidth-b.offsetWidth)/2),b.style.left=g+Fd()+"px"),c&&Gc(g,f,g+b.offsetWidth,f+b.offsetHeight)},lineCount:function(){return sb.size},clipPos:Tc,getCursor:function(a){return a==null&&(a=vb.inverted),$(a?vb.from:vb.to)},somethingSelected:function(){return!Y(vb.from,vb.to)},setCursor:Td(function(a,b,c){b==null&&typeof a.line=="number"?Rc(a.line,a.ch,c):Rc(a,b,c)}),setSelection:Td(function(a,b,c){(c?Oc:Pc)(Tc(a),Tc(b||a))}),getLine:function(a){if(Vb(a))return Xb(a).text},getLineHandle:function(a){if(Vb(a))return Xb(a)},setLine:Td(function(a,b){Vb(a)&&sc(b,{line:a,ch:0},{line:a,ch:Xb(a).text.length})}),removeLine:Td(function(a){Vb(a)&&sc("",{line:a,ch:0},Tc({line:a+1,ch:0}))}),replaceRange:Td(sc),getRange:function(a,b){return vc(Tc(a),Tc(b))},triggerOnKeyDown:Td(ic),execCommand:function(a){return h[a](Wb)},moveH:Td(Vc),deleteH:Td(Wc),moveV:Td(Yc),toggleOverwrite:function(){Bb?(Bb=!1,kb.className=kb.className.replace(" CodeMirror-overwrite","")):(Bb=!0,kb.className+=" CodeMirror-overwrite")},posFromIndex:function(a){var b=0,c;return sb.iter(0,sb.size,function(d){var e=d.text.length+1;if(e>a)return c=a,!0;a-=e,++b}),Tc({line:b,ch:c})},indexFromPos:function(a){if(a.line<0||a.ch<0)return 0;var b=a.ch;return sb.iter(0,a.line,function(a){b+=a.text.length+1}),b},scrollTo:function(a,b){a!=null&&(S.scrollLeft=a),b!=null&&(S.scrollTop=b),Ic([])},operation:function(a){return Td(a)()},refresh:function(){Ic(!0),S.scrollHeight>zb&&(S.scrollTop=zb)},getInputField:function(){return D},getWrapperElement:function(){return s},getScrollerElement:function(){return S},getGutterElement:function(){return _}},gc=null,hc,xc=!1,Ac="",Xc=null;gd.prototype.clear=Td(function(){var a=Infinity,b=-Infinity;for(var c=0,d=this.set.length;c<d;++c){var e=this.set[c],f=e.marked;if(!f||!e.parent)continue;var g=w(e);a=Math.min(a,g),b=Math.max(b,g);for(var h=0;h<f.length;++h)f[h].marker==this&&f.splice(h--,1)}a!=Infinity&&Fb.push({from:a,to:b+1})}),gd.prototype.find=function(){var a,b;for(var c=0,d=this.set.length;c<d;++c){var e=this.set[c],f=e.marked;for(var g=0;g<f.length;++g){var h=f[g];if(h.marker==this)if(h.from!=null||h.to!=null){var i=w(e);i!=null&&(h.from!=null&&(a={line:i,ch:h.from}),h.to!=null&&(b={line:i,ch:h.to}))}}}return{from:a,to:b}};var sd=Math.floor(Math.random()*16777215).toString(16),xd,yd,zd,Bd,Cd=0,Jd={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},Sd=0;for(var Ud in g)g.propertyIsEnumerable(Ud)&&!Wb.propertyIsEnumerable(Ud)&&(Wb[Ud]=g[Ud]);return Wb}function j(a){return typeof a=="string"?i[a]:a}function k(a,b,c,d){function e(b){b=j(b);var c=b[a];if(c!=null&&d(c))return!0;if(b.catchall)return d(b.catchall);var f=b.fallthrough;if(f==null)return!1;if(Object.prototype.toString.call(f)!="[object Array]")return e(f);for(var g=0,h=f.length;g<h;++g)if(e(f[g]))return!0;return!1}return b&&e(b)?!0:e(c)}function l(a){var b=gb[H(a,"keyCode")];return b=="Ctrl"||b=="Alt"||b=="Shift"||b=="Mod"}function m(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function n(a,b,c){return a.startState?a.startState(b,c):!0}function o(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8}function p(a,b,c,d){this.from=a,this.to=b,this.style=c,this.marker=d}function q(a){this.from=a,this.to=a,this.line=null}function r(a,b){this.styles=b||[a,null],this.text=a,this.height=1,this.marked=this.gutterMarker=this.className=this.bgClassName=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function s(a,b,c,d){for(var e=0,f=0,g=0;f<b;e+=2){var h=c[e],i=f+h.length;g==0?(i>a&&d.push(h.slice(a-f,Math.min(h.length,b-f)),c[e+1]),i>=a&&(g=1)):g==1&&(i>b?d.push(h.slice(0,b-f),c[e+1]):d.push(h,c[e+1])),f=i}}function t(a){this.lines=a,this.parent=null;for(var b=0,c=a.length,d=0;b<c;++b)a[b].parent=this,d+=a[b].height;this.height=d}function u(a){this.children=a;var b=0,c=0;for(var d=0,e=a.length;d<e;++d){var f=a[d];b+=f.chunkSize(),c+=f.height,f.parent=this}this.size=b,this.height=c,this.parent=null}function v(a,b){while(!a.lines)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(b<e){a=d;break}b-=e}return a.lines[b]}function w(a){if(a.parent==null)return null;var b=a.parent,c=cb(b.lines,a);for(var d=b.parent;d;b=d,d=d.parent)for(var e=0,f=d.children.length;;++e){if(d.children[e]==b)break;c+=d.children[e].chunkSize()}return c}function x(a,b){var c=0;a:do{for(var d=0,e=a.children.length;d<e;++d){var f=a.children[d],g=f.height;if(b<g){a=f;continue a}b-=g,c+=f.chunkSize()}return c}while(!a.lines);for(var d=0,e=a.lines.length;d<e;++d){var h=a.lines[d],i=h.height;if(b<i)break;b-=i}return c+d}function y(a,b){var c=0;a:do{for(var d=0,e=a.children.length;d<e;++d){var f=a.children[d],g=f.chunkSize();if(b<g){a=f;continue a}b-=g,c+=f.height}return c}while(!a.lines);for(var d=0;d<b;++d)c+=a.lines[d].height;return c}function z(){this.time=0,this.done=[],this.undone=[]}function A(){E(this)}function B(a){return a.stop||(a.stop=A),a}function C(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function D(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function E(a){C(a),D(a)}function F(a){return a.target||a.srcElement}function G(a){if(a.which)return a.which;if(a.button&1)return 1;if(a.button&2)return 3;if(a.button&4)return 2}function H(a,b){var c=a.override&&a.override.hasOwnProperty(b);return c?a.override[b]:a[b]}function I(a,b,c,d){if(typeof a.addEventListener=="function"){a.addEventListener(b,c,!1);if(d)return function(){a.removeEventListener(b,c,!1)}}else{var e=function(a){c(a||window.event)};a.attachEvent("on"+b,e);if(d)return function(){a.detachEvent("on"+b,e)}}}function J(){this.id=null}function T(a,b,c){b==null&&(b=a.search(/[^\s\u00a0]/),b==-1&&(b=a.length));for(var d=0,e=0;d<b;++d)a.charAt(d)=="	"?e+=c-e%c:++e;return e}function U(a){return a.currentStyle?a.currentStyle:window.getComputedStyle(a,null)}function V(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&&U(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 W(a){return a.textContent||a.innerText||a.nodeValue||""}function X(a){b?(a.selectionStart=0,a.selectionEnd=a.value.length):a.select()}function Y(a,b){return a.line==b.line&&a.ch==b.ch}function Z(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function $(a){return{line:a.line,ch:a.ch}}function ab(a){return _.textContent=a,_.innerHTML}function bb(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 cb(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 db(a){return/\w/.test(a)||a.toUpperCase()!=a.toLowerCase()}a.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null};var b=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),c=b||/Mac/.test(navigator.platform),d=/Win/.test(navigator.platform),e=a.modes={},f=a.mimeModes={};a.defineMode=function(b,c){!a.defaults.mode&&b!="null"&&(a.defaults.mode=b),e[b]=c},a.defineMIME=function(a,b){f[a]=b},a.resolveMode=function(b){if(typeof b=="string"&&f.hasOwnProperty(b))b=f[b];else if(typeof b=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(b))return a.resolveMode("application/xml");return typeof b=="string"?{name:b}:b||{name:"null"}},a.getMode=function(b,c){var c=a.resolveMode(c),d=e[c.name];return d?d(b,c):(window.console&&console.warn("No mode "+c.name+" 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=!Y(b,c);!d&&a.getLine(b.line).length==b.ch?a.replaceRange("",b,{line:b.line+1,ch:0}):a.replaceRange("",b,d?c:{line:b.line})},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",{line:b,ch:0},{line:b})},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.setCursor(0,0,!0)},goDocEnd:function(a){a.setSelection({line:a.lineCount()-1},null,!0)},goLineStart:function(a){a.setCursor(a.getCursor().line,0,!0)},goLineStartSmart:function(a){var b=a.getCursor(),c=a.getLine(b.line),d=Math.max(0,c.search(/\S/));a.setCursor(b.line,b.ch<=d&&b.ch?0:d,!0)},goLineEnd:function(a){a.setSelection({line:a.getCursor().line},null,!0)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goWordRight:function(a){a.moveH(1,"word")},delCharLeft:function(a){a.deleteH(-1,"char")},delCharRight:function(a){a.deleteH(1,"char")},delWordLeft:function(a){a.deleteH(-1,"word")},delWordRight:function(a){a.deleteH(1,"word")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("	","end")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);b.ch>0&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),{line:b.line,ch:b.ch-1},{line:b.line,ch:b.ch+1})},newlineAndIndent:function(a){a.replaceSelection("\n","end"),a.indentLine(a.getCursor().line)},toggleOverwrite:function(a){a.toggleOverwrite()}},i=a.keyMap={};i.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"insertTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},i.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},i.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},i["default"]=c?i.macDefault:i.pcDefault,i.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},a.fromTextArea=function(b,c){function d(){b.value=h.getValue()}c||(c={}),c.value=b.value,!c.tabindex&&b.tabindex&&(c.tabindex=b.tabindex),c.autofocus==null&&b.getAttribute("autofocus")!=null&&(c.autofocus=!0);if(b.form){var e=I(b.form,"submit",d,!0);if(typeof b.form.submit=="function"){var f=b.form.submit;function g(){d(),b.form.submit=f,b.form.submit(),b.form.submit=g}b.form.submit=g}}b.style.display="none";var h=a(function(a){b.parentNode.insertBefore(a,b.nextSibling)},c);return h.save=d,h.getTextArea=function(){return b},h.toTextArea=function(){d(),b.parentNode.removeChild(h.getWrapperElement()),b.style.display="",b.form&&(e(),typeof b.form.submit=="function"&&(b.form.submit=f))},h},a.copyState=m,a.startState=n,o.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if(typeof a=="string")var c=b==a;else var c=b&&(a.test?a.test(b):a(b));if(c)return++this.pos,b},eatWhile:function(a){var b=this.pos;while(this.eat(a));return this.pos>b},eatSpace:function(){var a=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);if(b>-1)return this.pos=b,!0},backUp:function(a){this.pos-=a},column:function(){return T(this.string,this.start,this.tabSize)},indentation:function(){return T(this.string,null,this.tabSize)},match:function(a,b,c){if(typeof a!="string"){var e=this.string.slice(this.pos).match(a);return e&&b!==!1&&(this.pos+=e[0].length),e}function d(a){return c?a.toLowerCase():a}if(d(this.string).indexOf(d(a),this.pos)==this.pos)return b!==!1&&(this.pos+=a.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},a.StringStream=o,p.prototype={attach:function(a){this.marker.set.push(a)},detach:function(a){var b=cb(this.marker.set,a);b>-1&&this.marker.set.splice(b,1)},split:function(a,b){if(this.to<=a&&this.to!=null)return null;var c=this.from<a||this.from==null?null:this.from-a+b,d=this.to==null?null:this.to-a+b;return new p(c,d,this.style,this.marker)},dup:function(){return new p(null,null,this.style,this.marker)},clipTo:function(a,b,c,d,e){a&&d>this.from&&(d<this.to||this.to==null)?this.from=null:this.from!=null&&this.from>=b&&(this.from=Math.max(d,this.from)+e),c&&(b<this.to||this.to==null)&&(b>this.from||this.from==null)?this.to=null:this.to!=null&&this.to>b&&(this.to=d<this.to?this.to+e:b)},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(a){return this.marker==a.marker}},q.prototype={attach:function(a){this.line=a},detach:function(a){this.line==a&&(this.line=null)},split:function(a,b){if(a<this.from)return this.from=this.to=this.from-a+b,this},isDead:function(){return this.from>this.to},clipTo:function(a,b,c,d,e){(a||b<this.from)&&(c||d>this.to)?(this.from=0,this.to=-1):this.from>b&&(this.from=this.to=Math.max(d,this.from)+e)},sameSet:function(a){return!1},find:function(){return!this.line||!this.line.parent?null:{line:w(this.line),ch:this.from}},clear:function(){if(this.line){var a=cb(this.line.marked,this);a!=-1&&this.line.marked.splice(a,1),this.line=null}}},r.inheritMarks=function(a,b){var c=new r(a),d=b&&b.marked;if(d)for(var e=0;e<d.length;++e)if(d[e].to==null&&d[e].style){var f=c.marked||(c.marked=[]),g=d[e],h=g.dup();f.push(h),h.attach(c)}return c},r.prototype={replace:function(a,b,c){var d=[],e=this.marked,f=b==null?this.text.length:b;s(0,a,this.styles,d),c&&d.push(c,null),s(f,this.text.length,this.styles,d),this.styles=d,this.text=this.text.slice(0,a)+c+this.text.slice(f),this.stateAfter=null;if(e){var g=c.length-(f-a);for(var h=0;h<e.length;++h){var i=e[h];i.clipTo(a==null,a||0,b==null,f,g),i.isDead()&&(i.detach(this),e.splice(h--,1))}}},split:function(a,b){var c=[b,null],d=this.marked;s(a,this.text.length,this.styles,c);var e=new r(b+this.text.slice(a),c);if(d)for(var f=0;f<d.length;++f){var g=d[f],h=g.split(a,b.length);h&&(e.marked||(e.marked=[]),e.marked.push(h),h.attach(e),h==g&&d.splice(f--,1))}return e},append:function(a){var b=this.text.length,c=a.marked,d=this.marked;this.text+=a.text,s(0,a.text.length,a.styles,this.styles);if(d)for(var e=0;e<d.length;++e)d[e].to==null&&(d[e].to=b);if(c&&c.length){d||(this.marked=d=[]);a:for(var e=0;e<c.length;++e){var f=c[e];if(!f.from)for(var g=0;g<d.length;++g){var h=d[g];if(h.to==b&&h.sameSet(f)){h.to=f.to==null?null:f.to+b,h.isDead()&&(h.detach(this),c.splice(e--,1));continue a}}d.push(f),f.attach(this),f.from+=b,f.to!=null&&(f.to+=b)}}},fixMarkEnds:function(a){var b=this.marked,c=a.marked;if(!b)return;for(var d=0;d<b.length;++d){var e=b[d],f=e.to==null;if(f&&c)for(var g=0;g<c.length;++g)if(c[g].sameSet(e)){f=!1;break}f&&(e.to=this.text.length)}},fixMarkStarts:function(){var a=this.marked;if(!a)return;for(var b=0;b<a.length;++b)a[b].from==null&&(a[b].from=0)},addMark:function(a){a.attach(this),this.marked==null&&(this.marked=[]),this.marked.push(a),this.marked.sort(function(a,b){return(a.from||0)-(b.from||0)})},highlight:function(a,b,c){var d=new o(this.text,c),e=this.styles,f=0,g=!1,h=e[0],i;this.text==""&&a.blankLine&&a.blankLine(b);while(!d.eol()){var j=a.token(d,b),k=this.text.slice(d.start,d.pos);d.start=d.pos,f&&e[f-1]==j?e[f-2]+=k:k&&(!g&&(e[f+1]!=j||f&&e[f-2]!=i)&&(g=!0),e[f++]=k,e[f++]=j,i=h,h=e[f]);if(d.pos>5e3){e[f++]=this.text.slice(d.pos),e[f++]=null;break}}return e.length!=f&&(e.length=f,g=!0),f&&e[f-2]!=i&&(g=!0),g||(e.length<5&&this.text.length<10?null:!1)},getTokenAt:function(a,b,c){var d=this.text,e=new o(d);while(e.pos<c&&!e.eol()){e.start=e.pos;var f=a.token(e,b)}return{start:e.start,end:e.pos,string:e.current(),className:f||null,state:b}},indentation:function(a){return T(this.text,null,a)},getHTML:function(a,b){function f(b,f){if(!b)return;d&&M&&b.charAt(0)==" "&&(b="\u00a0"+b.slice(1)),d=!1;if(b.indexOf("	")==-1){e+=b.length;var g=ab(b)}else{var g="";for(var h=0;;){var i=b.indexOf("	",h);if(i==-1){g+=ab(b.slice(h)),e+=b.length-h;break}e+=i-h;var j=a(e);g+=ab(b.slice(h,i))+j.html,e+=j.width,h=i+1}}f?c.push('<span class="',f,'">',g,"</span>"):c.push(g)}function k(a){return a?"cm-"+a.replace(/ +/g," cm-"):null}var c=[],d=!0,e=0,g=this.styles,h=this.text,i=this.marked,j=h.length;b!=null&&(j=Math.min(b,j));if(!h&&b==null)f(" ");else if(!i||!i.length)for(var l=0,m=0;m<j;l+=2){var n=g[l],o=g[l+1],p=n.length;m+p>j&&(n=n.slice(0,j-m)),m+=p,f(n,k(o))}else{var q=0,l=0,r="",o,s=0,t=i[0].from||0,u=[],v=0;function w(){var a;while(v<i.length&&((a=i[v]).from==q||a.from==null))a.style!=null&&u.push(a),++v;t=v<i.length?i[v].from:Infinity;for(var b=0;b<u.length;++b){var c=u[b].to||Infinity;c==q?u.splice(b--,1):t=Math.min(c,t)}}var x=0;while(q<j){t==q&&w();var y=Math.min(j,t);for(;;){if(r){var z=q+r.length,A=o;for(var B=0;B<u.length;++B)A=(A?A+" ":"")+u[B].style;f(z>y?r.slice(0,y-q):r,A);if(z>=y){r=r.slice(y-q),q=y;break}q=z}r=g[l++],o=k(g[l++])}}}return c.join("")},cleanUp:function(){this.parent=null;if(this.marked)for(var a=0,b=this.marked.length;a<b;++a)this.marked[a].detach(this)}},t.prototype={chunkSize:function(){return this.lines.length},remove:function(a,b,c){for(var d=a,e=a+b;d<e;++d){var f=this.lines[d];this.height-=f.height,f.cleanUp();if(f.handlers)for(var g=0;g<f.handlers.length;++g)c.push(f.handlers[g])}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertHeight:function(a,b,c){this.height+=c,this.lines.splice.apply(this.lines,[a,0].concat(b));for(var d=0,e=b.length;d<e;++d)b[d].parent=this},iterN:function(a,b,c){for(var d=a+b;a<d;++a)if(c(this.lines[a]))return!0}},u.prototype={chunkSize:function(){return this.size},remove:function(a,b,c){this.size-=b;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<f){var g=Math.min(b,f-a),h=e.height;e.remove(a,g,c),this.height-=h-e.height,f==g&&(this.children.splice(d--,1),e.parent=null);if((b-=g)==0)break;a=0}else a-=f}if(this.size-b<25){var i=[];this.collapse(i),this.children=[new t(i)],this.children[0].parent=this}},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insert:function(a,b){var c=0;for(var d=0,e=b.length;d<e;++d)c+=b[d].height;this.insertHeight(a,b,c)},insertHeight:function(a,b,c){this.size+=b.length,this.height+=c;for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<=g){f.insertHeight(a,b,c);if(f.lines&&f.lines.length>50){while(f.lines.length>50){var h=f.lines.splice(f.lines.length-25,25),i=new t(h);f.height-=i.height,this.children.splice(d+1,0,i),i.parent=this}this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(this.children.length<=10)return;var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new u(b);if(!a.parent){var d=new u(a.children);d.parent=a,a.children=[d,c],a=d}else{a.size-=c.size,a.height-=c.height;var e=cb(a.parent.children,a);a.parent.children.splice(e+1,0,c)}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()},iter:function(a,b,c){this.iterN(a,b-a,c)},iterN:function(a,b,c){for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<g){var h=Math.min(b,g-a);if(f.iterN(a,h,c))return!0;if((b-=h)==0)break;a=0}else a-=g}}},z.prototype={addChange:function(a,b,c){this.undone.length=0;var d=+(new Date),e=this.done[this.done.length-1],f=e&&e[e.length-1],g=d-this.time;if(g>400||!f)this.done.push([{start:a,added:b,old:c}]);else if(f.start>a+c.length||f.start+f.added<a-f.added+f.old.length)e.push({start:a,added:b,old:c});else{var h=0;if(a<f.start){for(var i=f.start-a-1;i>=0;--i)f.old.unshift(c[i]);h=Math.min(0,b-c.length),f.added+=f.start-a+h,f.start=a}else f.start<a&&(h=a-f.start,b+=h);for(var i=f.added-h,j=c.length;i<j;++i)f.old.push(c[i]);f.added<b&&(f.added=b)}this.time=d}},a.e_stop=E,a.e_preventDefault=C,a.e_stopPropagation=D,a.connect=I,J.prototype={set:function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)}};var K=a.Pass={toString:function(){return"CodeMirror.Pass"}},L=/gecko\/\d{7}/i.test(navigator.userAgent),M=/MSIE \d/.test(navigator.userAgent),N=/MSIE [1-8]\b/.test(navigator.userAgent),O=/WebKit\//.test(navigator.userAgent),P=/Chrome\//.test(navigator.userAgent),Q=/KHTML\//.test(navigator.userAgent),R=function(){if(N)return!1;var a=document.createElement("div");return"draggable"in a||"dragDrop"in a}(),S="\n";(function(){var a=document.createElement("textarea");a.value="foo\nbar",a.value.indexOf("\r")>-1&&(S="\r\n")})(),document.documentElement.getBoundingClientRect!=null&&(V=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 _=document.createElement("pre");ab("a")=="\na"?ab=function(a){return _.textContent=a,_.innerHTML.slice(1)}:ab("	")!="	"&&(ab=function(a){return _.innerHTML="",_.appendChild(document.createTextNode(a)),_.innerHTML}),a.htmlEscape=ab;var eb="\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=eb;var fb=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 gb={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return a.keyNames=gb,function(){for(var a=0;a<10;a++)gb[a+48]=String(a);for(var a=65;a<=90;a++)gb[a]=String.fromCharCode(a);for(var a=1;a<=12;a++)gb[a+111]=gb[a+63235]="F"+a}(),a}();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")
+var CodeMirror=function(){function e(r,i){function sn(e){return e>=0&&e<Ct.size}function un(e){return E(Ct,e)}function an(e,t){Wt=!0;var n=t-e.height;for(var r=e;r;r=r.parent)r.height+=n}function fn(e){var t={line:0,ch:0};Ln(t,{line:Ct.size-1,ch:un(Ct.size-1).text.length},lt(e),t,t),Ft=!0}function ln(){var e=[];return Ct.iter(0,Ct.size,function(t){e.push(t.text)}),e.join("\n")}function cn(e){if(Dt!=bt.scrollTop||Pt!=K.scrollLeft)Dt=bt.scrollTop,Pt=K.scrollLeft,er([]),s.fixedGutter&&(st.style.left=K.scrollLeft+"px"),s.onScroll&&s.onScroll(on)}function hn(e){function c(e){var t=Zr(e,!0);if(t&&!nt(t,o)){Lt||Tn(),o=t,or(r,t),Ft=!1;var n=Zn();if(t.line>=n.to||t.line<n.from)u=setTimeout(hi(function(){c(e)}),150)}}function h(e){clearTimeout(u);var t=Zr(e);t&&or(r,t),L(e),$n(),Ft=!0,p(),f()}sr(D(e,"shiftKey"));for(var t=M(e);t!=C;t=t.parentNode)if(t.parentNode==G&&t!=Y)return;for(var t=M(e);t!=C;t=t.parentNode)if(t.parentNode==ot)return s.onGutterClick&&s.onGutterClick(on,at(ot.childNodes,t)+$t,e),L(e);var r=Zr(e);switch(_(e)){case 3:j&&!n&&ei(e);return;case 2:r&&fr(r.line,r.ch,!0),setTimeout($n,20),L(e);return}if(!r){M(e)==K&&L(e);return}Lt||Tn();var i=+(new Date);if(_t&&_t.time>i-400&&nt(_t.pos,r))return L(e),setTimeout($n,20),yr(r.line);if(Mt&&Mt.time>i-400&&nt(Mt.pos,r))return _t={time:i,pos:r},L(e),gr(r);Mt={time:i,pos:r};var o=r,u;if(s.dragDrop&&J&&!s.readOnly&&!nt(At.from,At.to)&&!rt(r,At.from)&&!rt(At.to,r)){U&&(K.draggable=!0);function a(t){U&&(K.draggable=!1),Ht=!1,f(),l(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(L(t),fr(r.line,r.ch,!0),$n())}var f=P(document,"mouseup",hi(a),!0),l=P(K,"drop",hi(a),!0);Ht=!0,K.dragDrop&&K.dragDrop();return}L(e),fr(r.line,r.ch,!0);var p=P(document,"mousemove",hi(function(e){clearTimeout(u),L(e),!F&&!_(e)?h(e):c(e)}),!0),f=P(document,"mouseup",hi(h),!0)}function pn(e){for(var t=M(e);t!=C;t=t.parentNode)if(t.parentNode==ot)return L(e);var n=Zr(e);if(!n)return;_t={time:+(new Date),pos:n},L(e),gr(n)}function dn(e){if(s.onDragEvent&&s.onDragEvent(on,k(e)))return;e.preventDefault();var t=Zr(e,!0),n=e.dataTransfer.files;if(!t||s.readOnly)return;if(n&&n.length&&window.FileReader&&window.File){function r(e,n){var r=new FileReader;r.onload=function(){o[n]=r.result,++u==i&&(t=cr(t),hi(function(){var e=Bn(o.join(""),t,t);or(t,e)})())},r.readAsText(e)}var i=n.length,o=Array(i),u=0;for(var a=0;a<i;++a)r(n[a],a)}else{if(Ht&&!rt(t,At.from)&&!rt(At.to,t))return;try{var o=e.dataTransfer.getData("Text");o&&pi(function(){var e=At.from,n=At.to;or(t,t),Ht&&Bn("",e,n),jn(o),$n()})}catch(e){}}}function vn(e){var t=qn();e.dataTransfer.setData("Text",t);if(j||z||W){var n=document.createElement("img");n.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",e.dataTransfer.setDragImage(n,0,0)}}function mn(e,t){if(typeof e=="string"){e=u[e];if(!e)return!1}var n=Ot;try{s.readOnly&&(jt=!0),t&&(Ot=null),e(on)}catch(r){if(r!=B)throw r;return!1}finally{Ot=n,jt=!1}return!0}function gn(e){function u(){o=!0}var t=f(s.keyMap),n=t.auto;clearTimeout(wn),n&&!c(e)&&(wn=setTimeout(function(){f(s.keyMap)==t&&(s.keyMap=n.call?n.call(null,on):n)},50));var r=ht[D(e,"keyCode")],i=!1;if(r==null||e.altGraphKey)return!1;D(e,"altKey")&&(r="Alt-"+r),D(e,"ctrlKey")&&(r="Ctrl-"+r),D(e,"metaKey")&&(r="Cmd-"+r);var o=!1;return D(e,"shiftKey")?i=l("Shift-"+r,s.extraKeys,s.keyMap,function(e){return mn(e,!0)},u)||l(r,s.extraKeys,s.keyMap,function(e){if(typeof e=="string"&&/^go[A-Z]/.test(e))return mn(e)},u):i=l(r,s.extraKeys,s.keyMap,mn,u),o&&(i=!1),i&&(L(e),ti(),F&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),i}function yn(e,t){var n=l("'"+t+"'",s.extraKeys,s.keyMap,function(e){return mn(e,!0)});return n&&(L(e),ti()),n}function En(e){Lt||Tn(),F&&e.keyCode==27&&(e.returnValue=!1),Rn&&Xn()&&(Rn=!1);if(s.onKeyEvent&&s.onKeyEvent(on,k(e)))return;var t=D(e,"keyCode");sr(t==16||D(e,"shiftKey"));var r=gn(e);W&&(bn=r?t:null,!r&&t==88&&D(e,n?"metaKey":"ctrlKey")&&jn(""))}function Sn(e){Rn&&Xn();if(s.onKeyEvent&&s.onKeyEvent(on,k(e)))return;var t=D(e,"keyCode"),n=D(e,"charCode");if(W&&t==bn){bn=null,L(e);return}if((W&&(!e.which||e.which<10)||V)&&gn(e))return;var r=String.fromCharCode(n==null?t:n);s.electricChars&&Nt.electricChars&&s.smartIndent&&!s.readOnly&&Nt.electricChars.indexOf(r)>-1&&setTimeout(hi(function(){wr(At.to.line,"smart")}),75);if(yn(e,r))return;zn()}function xn(e){if(s.onKeyEvent&&s.onKeyEvent(on,k(e)))return;D(e,"keyCode")==16&&(Ot=null)}function Tn(){if(s.readOnly=="nocursor")return;Lt||(s.onFocus&&s.onFocus(on),Lt=!0,K.className.search(/\bCodeMirror-focused\b/)==-1&&(K.className+=" CodeMirror-focused"),zt||Vn(!0)),Un(),ti()}function Nn(){Lt&&(s.onBlur&&s.onBlur(on),Lt=!1,Qt&&hi(function(){Qt&&(Qt(),Qt=null)})(),K.className=K.className.replace(" CodeMirror-focused","")),clearInterval(Tt),setTimeout(function(){Lt||(Ot=null)},150)}function Cn(e){return e>0&&e<1?1:e>-1&&e<0?-1:Math.round(e)}function kn(e){var t=0,n=0;if(e.type=="DOMMouseScroll"){var r=-e.detail*8;e.axis==e.HORIZONTAL_AXIS?t=r:e.axis==e.VERTICAL_AXIS&&(n=r)}else e.wheelDeltaX!==undefined&&e.wheelDeltaY!==undefined?(t=e.wheelDeltaX/3,n=e.wheelDeltaY/3):e.wheelDelta!==undefined&&(n=e.wheelDelta/3);var i=!1;t=Cn(t),n=Cn(n);if(t>0&&K.scrollLeft>0||t<0&&K.scrollLeft+K.clientWidth<K.scrollWidth)K.scrollLeft-=t,i=!0;if(n>0&&bt.scrollTop>0||n<0&&bt.scrollTop+bt.clientHeight<bt.scrollHeight)bt.scrollTop-=n,i=!0;i&&O(e)}function Ln(e,t,n,r,i){if(jt)return;if(tn){var o=[];Ct.iter(e.line,t.line+1,function(e){o.push(e.text)}),tn.addChange(e.line,n.length,o);while(tn.done.length>s.undoDepth)tn.done.shift()}_n(e,t,n,r,i)}function An(e,t){if(!e.length)return;var n=e.pop(),r=[];for(var i=n.length-1;i>=0;i-=1){var s=n[i],o=[],u=s.start+s.added;Ct.iter(s.start,u,function(e){o.push(e.text)}),r.push({start:s.start,added:s.old.length,old:o});var a={line:s.start+s.old.length-1,ch:ut(o[o.length-1],s.old[s.old.length-1])};_n({line:s.start,ch:0},{line:u-1,ch:un(u-1).text.length},s.old,a,a)}Ft=!0,t.push(r)}function On(){An(tn.done,tn.undone)}function Mn(){An(tn.undone,tn.done)}function _n(e,t,n,r,i){function T(e){return e<=Math.min(t.line,t.line+y)?e:e+y}if(jt)return;var o=!1,u=Gt.length;s.lineWrapping||Ct.iter(e.line,t.line+1,function(e){if(!e.hidden&&e.text.length==u)return o=!0,!0});if(e.line!=t.line||n.length>1)Wt=!0;var a=t.line-e.line,f=un(e.line),l=un(t.line);if(e.ch==0&&t.ch==0&&n[n.length-1]==""){var c=[],h=null;e.line?(h=un(e.line-1),h.fixMarkEnds(l)):l.fixMarkStarts();for(var p=0,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],h));a&&Ct.remove(e.line,a,Xt),c.length&&Ct.insert(e.line,c)}else if(f==l)if(n.length==1)f.replace(e.ch,t.ch,n[0]);else{l=f.split(t.ch,n[n.length-1]),f.replace(e.ch,null,n[0]),f.fixMarkEnds(l);var c=[];for(var p=1,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],f));c.push(l),Ct.insert(e.line+1,c)}else if(n.length==1)f.replace(e.ch,null,n[0]),l.replace(null,t.ch,""),f.append(l),Ct.remove(e.line+1,a,Xt);else{var c=[];f.replace(e.ch,null,n[0]),l.replace(null,t.ch,n[n.length-1]),f.fixMarkEnds(l);for(var p=1,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],f));a>1&&Ct.remove(e.line+1,a-1,Xt),Ct.insert(e.line+1,c)}if(s.lineWrapping){var v=Math.max(5,K.clientWidth/Qr()-3);Ct.iter(e.line,e.line+n.length,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/v)||1;t!=e.height&&an(e,t)})}else Ct.iter(e.line,e.line+n.length,function(e){var t=e.text;!e.hidden&&t.length>u&&(Gt=t,u=t.length,Zt=!0,o=!1)}),o&&(Yt=!0);var m=[],y=n.length-a-1;for(var p=0,b=kt.length;p<b;++p){var w=kt[p];w<e.line?m.push(w):w>t.line&&m.push(w+y)}var E=e.line+Math.min(n.length,500);oi(e.line,E),m.push(E),kt=m,ai(100),qt.push({from:e.line,to:t.line+1,diff:y});var S={from:e,to:t,text:n};if(Rt){for(var x=Rt;x.next;x=x.next);x.next=S}else Rt=S;ur(cr(r),cr(i),T(At.from.line),T(At.to.line))}function Dn(e){var t=$r(),n=Math.floor(Ct.height*t+2*Gr()),r=K.clientHeight;bt.style.height=r+"px",K.clientHeight&&(wt.style.height=n+"px"),e!=null&&(bt.scrollTop=e),Y.style.top=Vt*t-bt.scrollTop+"px",bt.style.display=n>r?"block":"none"}function Pn(){var e=document.createElement("div"),t=document.createElement("div");e.className="CodeMirror-scrollbar",e.style.cssText="position: absolute; left: -9999px; height: 100px;",t.className="CodeMirror-scrollbar-inner",t.style.height="200px",e.appendChild(t),document.body.appendChild(e);var n=e.offsetWidth<=1;return document.body.removeChild(e),n}function Hn(){var e=0;Gt="",Zt=!0,Ct.iter(0,Ct.size,function(t){var n=t.text;!t.hidden&&n.length>e&&(e=n.length,Gt=n)}),Yt=!1}function Bn(e,t,n){function r(r){if(rt(r,t))return r;if(!rt(n,r))return i;var s=r.line+e.length-(n.line-t.line)-1,o=r.ch;return r.line==n.line&&(o+=e[e.length-1].length-(n.ch-(n.line==t.line?t.ch:0))),{line:s,ch:o}}t=cr(t),n?n=cr(n):n=t,e=lt(e);var i;return Fn(e,t,n,function(e){return i=e,{from:r(At.from),to:r(At.to)}}),i}function jn(e,t){Fn(lt(e),At.from,At.to,function(e){return t=="end"?{from:e,to:e}:t=="start"?{from:At.from,to:At.from}:{from:At.from,to:e}})}function Fn(e,t,n,r){var i=e.length==1?e[0].length+t.ch:e[e.length-1].length,s=r({line:t.line+e.length-1,ch:i});Ln(t,n,e,s.from,s.to)}function In(e,t){var n=e.line,r=t.line;if(n==r)return un(n).text.slice(e.ch,t.ch);var i=[un(n).text.slice(e.ch)];return Ct.iter(n+1,r,function(e){i.push(e.text)}),i.push(un(r).text.slice(0,t.ch)),i.join("\n")}function qn(){return In(At.from,At.to)}function Un(){if(Rn)return;St.set(s.pollInterval,function(){fi(),Xn(),Lt&&Un(),li()})}function zn(){function t(){fi();var n=Xn();!n&&!e?(e=!0,St.set(60,t)):(Rn=!1,Un()),li()}var e=!1;Rn=!0,St.set(20,t)}function Xn(){if(zt||!Lt||ct(X)||s.readOnly)return!1;var e=X.value;if(e==Wn)return!1;Ot=null;var t=0,n=Math.min(Wn.length,e.length);while(t<n&&Wn[t]==e[t])++t;return t<Wn.length?At.from={line:At.from.line,ch:At.from.ch-(Wn.length-t)}:Bt&&nt(At.from,At.to)&&(At.to={line:At.to.line,ch:Math.min(un(At.to.line).text.length,At.to.ch+(e.length-t))}),jn(e.slice(t),"end"),e.length>1e3?X.value=Wn="":Wn=e,!0}function Vn(e){nt(At.from,At.to)?e&&(Wn=X.value=""):(Wn="",X.value=qn(),tt(X))}function $n(){s.readOnly!="nocursor"&&X.focus()}function Jn(){if(!vt.getBoundingClientRect)return;var e=vt.getBoundingClientRect();if(F&&e.top==e.bottom)return;var t=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(e.top<0||e.bottom>t)&&Kn()}function Kn(){var e=Qn();return Gn(e.x,e.y,e.x,e.yBot)}function Qn(){var e=Rr(At.inverted?At.from:At.to),t=s.lineWrapping?Math.min(e.x,pt.offsetWidth):e.x;return{x:t,y:e.y,yBot:e.yBot}}function Gn(e,t,n,r){var i=Yn(e,t,n,r),o=!1;i.scrollLeft!=null&&(K.scrollLeft=i.scrollLeft,o=!0),i.scrollTop!=null&&(bt.scrollTop=i.scrollTop,o=!0),o&&s.onScroll&&s.onScroll(on)}function Yn(e,t,n,r){var i=Yr(),o=Gr();t+=o,r+=o,e+=i,n+=i;var u=K.clientHeight,a=bt.scrollTop,f={},l=t<Gr()+10;t<a?f.scrollTop=l?0:Math.max(0,t):r>a+u&&(f.scrollTop=r-u);var c=K.clientWidth,h=K.scrollLeft,p=s.fixedGutter?st.clientWidth:0,d=e<p+i+10;return e<h+p||d?(d&&(e=0),f.scrollLeft=Math.max(0,e-10-p)):n>c+h-3&&(f.scrollLeft=n+10-c),f}function Zn(e){var t=$r(),n=(e!=null?e:bt.scrollTop)-Gr(),r=Math.max(0,Math.floor(n/t)),i=Math.ceil((n+K.clientHeight)/t);return{from:x(Ct,r),to:x(Ct,i)}}function er(e,t,n){function d(){var e=yt.firstChild,t=!1;return Ct.iter($t,Jt,function(n){if(!n.hidden){var r=Math.round(e.offsetHeight/c)||1;n.height!=r&&(an(n,r),Wt=t=!0)}e=e.nextSibling}),t}if(!K.clientWidth){$t=Jt=Vt=0;return}var r=Zn(n);if(e!==!0&&e.length==0&&r.from>$t&&r.to<Jt){Dn(n);return}var i=Math.max(r.from-100,0),o=Math.min(Ct.size,r.to+100);$t<i&&i-$t<20&&(i=$t),Jt>o&&Jt-o<20&&(o=Math.min(Ct.size,Jt));var u=e===!0?[]:tr([{from:$t,to:Jt,domStart:0}],e),a=0;for(var f=0;f<u.length;++f){var l=u[f];l.from<i&&(l.domStart+=i-l.from,l.from=i),l.to>o&&(l.to=o),l.from>=l.to?u.splice(f--,1):a+=l.to-l.from}if(a==o-i&&i==$t&&o==Jt){Dn(n);return}u.sort(function(e,t){return e.domStart-t.domStart});var c=$r(),h=st.style.display;yt.style.display="none",nr(i,o,u),yt.style.display=st.style.display="";var p=i!=$t||o!=Jt||Kt!=K.clientHeight+c;p&&(Kt=K.clientHeight+c),$t=i,Jt=o,Vt=T(Ct,i);if(yt.childNodes.length!=Jt-$t)throw new Error("BAD PATCH! "+JSON.stringify(u)+" size="+(Jt-$t)+" nodes="+yt.childNodes.length);if(s.lineWrapping){var v=Math.floor(Ct.height*c+2*Gr()),m=K.clientHeight;v>m&&(bt.style.display="block"),d()}return st.style.display=h,(p||Wt)&&rr()&&s.lineWrapping&&d()&&rr(),ir(),Dn(n),!t&&s.onUpdate&&s.onUpdate(on),!0}function tr(e,t){for(var n=0,r=t.length||0;n<r;++n){var i=t[n],s=[],o=i.diff||0;for(var u=0,a=e.length;u<a;++u){var f=e[u];i.to<=f.from&&i.diff?s.push({from:f.from+o,to:f.to+o,domStart:f.domStart}):i.to<=f.from||i.from>=f.to?s.push(f):(i.from>f.from&&s.push({from:f.from,to:i.from,domStart:f.domStart}),i.to<f.to&&s.push({from:i.to+o,to:f.to+o,domStart:f.domStart+(i.to-f.from)}))}e=s}return e}function nr(e,t,n){if(!n.length)yt.innerHTML="";else{function r(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var i=0,s=yt.firstChild,o;for(var u=0;u<n.length;++u){var a=n[u];while(a.domStart>i)s=r(s),i++;for(var f=0,l=a.to-a.from;f<l;++f)s=s.nextSibling,i++}while(s)s=r(s)}var c=n.shift(),s=yt.firstChild,f=e,h=document.createElement("div");Ct.iter(e,t,function(e){c&&c.to==f&&(c=n.shift());if(!c||c.from>f){if(e.hidden)var t=h.innerHTML="<pre></pre>";else{var t="<pre"+(e.className?' class="'+e.className+'"':"")+">"+e.getHTML(Tr)+"</pre>";e.bgClassName&&(t='<div style="position: relative"><pre class="'+e.bgClassName+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>'+t+"</div>")}h.innerHTML=t,yt.insertBefore(h.firstChild,s)}else s=s.nextSibling;++f})}function rr(){if(!s.gutter&&!s.lineNumbers)return;var e=Y.offsetHeight,t=K.clientHeight;st.style.height=(e-t<2?t:e)+"px";var n=[],r=$t,i;Ct.iter($t,Math.max(Jt,$t+1),function(e){if(e.hidden)n.push("<pre></pre>");else{var t=e.gutterMarker,o=s.lineNumbers?r+s.firstLineNumber:null;t&&t.text?o=t.text.replace("%N%",o!=null?o:""):o==null&&(o="\u00a0"),n.push(t&&t.style?'<pre class="'+t.style+'">':"<pre>",o);for(var u=1;u<e.height;++u)n.push("<br/>&#160;");n.push("</pre>"),t||(i=r)}++r}),st.style.display="none",ot.innerHTML=n.join("");if(i!=null&&s.lineNumbers){var o=ot.childNodes[i-$t],u=String(Ct.size).length,a=et(o.firstChild),f="";while(a.length+f.length<u)f+="\u00a0";f&&o.insertBefore(document.createTextNode(f),o.firstChild)}st.style.display="";var l=Math.abs((parseInt(pt.style.marginLeft)||0)-st.offsetWidth)>2;return pt.style.marginLeft=st.offsetWidth+"px",Wt=!1,l}function ir(){var e=nt(At.from,At.to),t=Rr(At.from,!0),n=e?t:Rr(At.to,!0),r=At.inverted?t:n,i=$r(),o=Z(C),u=Z(yt);A.style.top=Math.max(0,Math.min(K.offsetHeight,r.y+u.top-o.top))+"px",A.style.left=Math.max(0,Math.min(K.offsetWidth,r.x+u.left-o.left))+"px";if(e)vt.style.top=r.y+"px",vt.style.left=(s.lineWrapping?Math.min(r.x,pt.offsetWidth):r.x)+"px",vt.style.display="",gt.style.display="none";else{var a=t.y==n.y,f="",l=pt.clientWidth||pt.offsetWidth,c=pt.clientHeight||pt.offsetHeight;function h(e,t,n,r){var i=R?"width: "+(n?l-n-e:l)+"px":"right: "+n+"px";f+='<div class="CodeMirror-selected" style="position: absolute; left: '+e+"px; top: "+t+"px; "+i+"; height: "+r+'px"></div>'}if(At.from.ch&&t.y>=0){var p=a?l-n.x:0;h(t.x,t.y,p,i)}var d=Math.max(0,t.y+(At.from.ch?i:0)),v=Math.min(n.y,c)-d;v>.2*i&&h(0,d,0,v),(!a||!At.from.ch)&&n.y<c-.5*i&&h(0,n.y,l-n.x,i),gt.innerHTML=f,vt.style.display="none",gt.style.display=""}}function sr(e){e?Ot=Ot||(At.inverted?At.to:At.from):Ot=null}function or(e,t){var n=Ot&&cr(Ot);n&&(rt(n,e)?e=n:rt(t,n)&&(t=n)),ur(e,t),It=!0}function ur(e,t,n,r){vr=null,n==null&&(n=At.from.line,r=At.to.line);if(nt(At.from,e)&&nt(At.to,t))return;if(rt(t,e)){var i=t;t=e,e=i}if(e.line!=n){var o=ar(e,n,At.from.ch);o?e=o:Hr(e.line,!1)}t.line!=r&&(t=ar(t,r,At.to.ch)),nt(e,t)?At.inverted=!1:nt(e,At.to)?At.inverted=!1:nt(t,At.from)&&(At.inverted=!0);if(s.autoClearEmptyLines&&nt(At.from,At.to)){var u=At.inverted?e:t;if(u.line!=At.from.line&&At.from.line<Ct.size){var a=un(At.from.line);/^\s+$/.test(a.text)&&setTimeout(hi(function(){if(a.parent&&/^\s+$/.test(a.text)){var e=S(a);Bn("",{line:e,ch:0},{line:e,ch:a.text.length})}},10))}}At.from=e,At.to=t,Ut=!0}function ar(e,t,n){function r(t){var r=e.line+t,i=t==1?Ct.size:-1;while(r!=i){var o=un(r);if(!o.hidden){var u=e.ch;if(s||u>n||u>o.text.length)u=o.text.length;return{line:r,ch:u}}r+=t}}var i=un(e.line),s=e.ch==i.text.length&&e.ch!=n;return i.hidden?e.line>=t?r(1)||r(-1):r(-1)||r(1):e}function fr(e,t,n){var r=cr({line:e,ch:t||0});(n?or:ur)(r,r)}function lr(e){return Math.max(0,Math.min(e,Ct.size-1))}function cr(e){if(e.line<0)return{line:0,ch:0};if(e.line>=Ct.size)return{line:Ct.size-1,ch:un(Ct.size-1).text.length};var t=e.ch,n=un(e.line).text.length;return t==null||t>n?{line:e.line,ch:n}:t<0?{line:e.line,ch:0}:e}function hr(e,t){function o(){for(var t=r+e,n=e<0?-1:Ct.size;t!=n;t+=e){var i=un(t);if(!i.hidden)return r=t,s=i,!0}}function u(t){if(i==(e<0?0:s.text.length)){if(!!t||!o())return!1;i=e<0?s.text.length:0}else i+=e;return!0}var n=At.inverted?At.from:At.to,r=n.line,i=n.ch,s=un(r);if(t=="char")u();else if(t=="column")u(!0);else if(t=="word"){var a=!1;for(;;){if(e<0&&!u())break;if(ft(s.text.charAt(i)))a=!0;else if(a){e<0&&(e=1,u());break}if(e>0&&!u())break}}return{line:r,ch:i}}function pr(e,t){var n=e<0?At.from:At.to;if(Ot||nt(At.from,At.to))n=hr(e,t);fr(n.line,n.ch,!0)}function dr(e,t){nt(At.from,At.to)?e<0?Bn("",hr(e,t),At.to):Bn("",At.from,hr(e,t)):Bn("",At.from,At.to),It=!0}function mr(e,t){var n=0,r=Rr(At.inverted?At.from:At.to,!0);vr!=null&&(r.x=vr),t=="page"?n=Math.min(K.clientHeight,window.innerHeight||document.documentElement.clientHeight):t=="line"&&(n=$r());var i=Ur(r.x,r.y+n*e+2);t=="page"&&(bt.scrollTop+=Rr(i,!0).y-r.y),fr(i.line,i.ch,!0),vr=r.x}function gr(e){var t=un(e.line).text,n=e.ch,r=e.ch;while(n>0&&ft(t.charAt(n-1)))--n;while(r<t.length&&ft(t.charAt(r)))++r;or({line:e.line,ch:n},{line:e.line,ch:r})}function yr(e){or({line:e,ch:0},cr({line:e+1,ch:0}))}function br(e){if(nt(At.from,At.to))return wr(At.from.line,e);var t=At.to.line-(At.to.ch?0:1);for(var n=At.from.line;n<=t;++n)wr(n,e)}function wr(e,t){t||(t="add");if(t=="smart")if(!Nt.indent)t="prev";else var n=si(e);var r=un(e),i=r.indentation(s.tabSize),o=r.text.match(/^\s*/)[0],u;t=="smart"&&(u=Nt.indent(n,r.text.slice(o.length),r.text),u==B&&(t="prev")),t=="prev"?e?u=un(e-1).indentation(s.tabSize):u=0:t=="add"?u=i+s.indentUnit:t=="subtract"&&(u=i-s.indentUnit),u=Math.max(0,u);var a=u-i;if(!a){if(At.from.line!=e&&At.to.line!=e)return;var f=o}else{var f="",l=0;if(s.indentWithTabs)for(var c=Math.floor(u/s.tabSize);c;--c)l+=s.tabSize,f+="	";while(l<u)++l,f+=" "}Bn(f,{line:e,ch:0},{line:e,ch:o.length})}function Er(){Nt=e.getMode(s,s.mode),Ct.iter(0,Ct.size,function(e){e.stateAfter=null}),kt=[0],ai()}function Sr(){var e=s.gutter||s.lineNumbers;st.style.display=e?"":"none",e?Wt=!0:yt.parentNode.style.marginLeft=0}function xr(e,t){if(s.lineWrapping){C.className+=" CodeMirror-wrap";var n=K.clientWidth/Qr()-3;Ct.iter(0,Ct.size,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/n)||1;t!=1&&an(e,t)}),pt.style.width=G.style.width="",mt.style.left=""}else C.className=C.className.replace(" CodeMirror-wrap",""),Gt="",Zt=!0,Ct.iter(0,Ct.size,function(e){e.height!=1&&!e.hidden&&an(e,1),e.text.length>Gt.length&&(Gt=e.text)});qt.push({from:0,to:Ct.size})}function Tr(e){var t=s.tabSize-e%s.tabSize,n=en[t];if(n)return n;for(var r='<span class="cm-tab">',i=0;i<t;++i)r+=" ";return en[t]={html:r+"</span>",width:t}}function Nr(){K.className=K.className.replace(/\s*cm-s-\S+/g,"")+s.theme.replace(/(^|\s)\s*/g," cm-s-")}function Cr(){var e=a[s.keyMap].style;C.className=C.className.replace(/\s*cm-keymap-\S+/g,"")+(e?" cm-keymap-"+e:"")}function kr(){this.set=[]}function Lr(e,t,n){function i(e,t,n,i){un(e).addMark(new v(t,n,i,r))}e=cr(e),t=cr(t);var r=new kr;if(!rt(e,t))return r;if(e.line==t.line)i(e.line,e.ch,t.ch,n);else{i(e.line,e.ch,null,n);for(var s=e.line+1,o=t.line;s<o;++s)i(s,null,null,n);i(t.line,null,t.ch,n)}return qt.push({from:e.line,to:t.line+1}),r}function Ar(e){e=cr(e);var t=new m(e.ch);return un(e.line).addMark(t),t}function Or(e){e=cr(e);var t=[],n=un(e.line).marked;if(!n)return t;for(var r=0,i=n.length;r<i;++r){var s=n[r];(s.from==null||s.from<=e.ch)&&(s.to==null||s.to>=e.ch)&&t.push(s.marker||s)}return t}function Mr(e,t,n){return typeof e=="number"&&(e=un(lr(e))),e.gutterMarker={text:t,style:n},Wt=!0,e}function _r(e){typeof e=="number"&&(e=un(lr(e))),e.gutterMarker=null,Wt=!0}function Dr(e,t){var n=e,r=e;return typeof e=="number"?r=un(lr(e)):n=S(e),n==null?null:t(r,n)?(qt.push({from:n,to:n+1}),r):null}function Pr(e,t,n){return Dr(e,function(e){if(e.className!=t||e.bgClassName!=n)return e.className=t,e.bgClassName=n,!0})}function Hr(e,t){return Dr(e,function(e,n){if(e.hidden!=t){e.hidden=t;if(!s.lineWrapping){var r=e.text;t&&r.length==Gt.length?Yt=!0:!t&&r.length>Gt.length&&(Gt=r,maxWidth=null,Yt=!1)}an(e,t?0:1);var i=At.from.line,o=At.to.line;if(t&&(i==n||o==n)){var u=i==n?ar({line:i,ch:0},i,0):At.from,a=o==n?ar({line:o,ch:0},o,0):At.to;if(!a)return;ur(u,a)}return Wt=!0}})}function Br(e){if(typeof e=="number"){if(!sn(e))return null;var t=e;e=un(e);if(!e)return null}else{var t=S(e);if(t==null)return null}var n=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:n&&n.text,markerClass:n&&n.style,lineClass:e.className,bgClass:e.bgClassName}}function jr(e){return dt.innerHTML="<pre><span>x</span></pre>",dt.firstChild.firstChild.firstChild.nodeValue=e,dt.firstChild.firstChild.offsetWidth||10}function Fr(e,t){function i(e){return qr(n,e).left}if(t<=0)return 0;var n=un(e),r=n.text,s=0,o=0,u=r.length,a,f=Math.min(u,Math.ceil(t/Qr()));for(;;){var l=i(f);if(!(l<=t&&f<u)){a=l,u=f;break}f=Math.min(u,Math.ceil(f*1.2))}if(t>a)return u;f=Math.floor(u*.8),l=i(f),l<t&&(s=f,o=l);for(;;){if(u-s<=1)return a-t>t-o?s:u;var c=Math.ceil((s+u)/2),h=i(c);h>t?(u=c,a=h):(s=c,o=h)}}function qr(e,t){if(t==0)return{top:0,left:0};var n=s.lineWrapping&&t<e.text.length&&Q.test(e.text.slice(t-1,t+1));dt.innerHTML="<pre>"+e.getHTML(Tr,t,Ir,n)+"</pre>";var r=document.getElementById(Ir),i=r.offsetTop,o=r.offsetLeft;if(F&&i==0&&o==0){var u=document.createElement("span");u.innerHTML="x",r.parentNode.insertBefore(u,r.nextSibling),i=u.offsetTop}return{top:i,left:o}}function Rr(e,t){var n,r=$r(),i=r*(T(Ct,e.line)-(t?Vt:0));if(e.ch==0)n=0;else{var o=qr(un(e.line),e.ch);n=o.left,s.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function Ur(e,t){function c(e){var t=qr(u,e);if(f){var r=Math.round(t.top/n);return Math.max(0,t.left+(r-l)*K.clientWidth)}return t.left}t<0&&(t=0);var n=$r(),r=Qr(),i=Vt+Math.floor(t/n),o=x(Ct,i);if(o>=Ct.size)return{line:Ct.size-1,ch:un(Ct.size-1).text.length};var u=un(o),a=u.text,f=s.lineWrapping,l=f?i-T(Ct,o):0;if(e<=0&&l==0)return{line:o,ch:0};var h=0,p=0,d=a.length,v,m=Math.min(d,Math.ceil((e+l*K.clientWidth*.9)/r));for(;;){var g=c(m);if(!(g<=e&&m<d)){v=g,d=m;break}m=Math.min(d,Math.ceil(m*1.2))}if(e>v)return{line:o,ch:d};m=Math.floor(d*.8),g=c(m),g<e&&(h=m,p=g);for(;;){if(d-h<=1)return{line:o,ch:v-e>e-p?h:d};var y=Math.ceil((h+d)/2),b=c(y);b>e?(d=y,v=b):(h=y,p=b)}}function zr(e){var t=Rr(e,!0),n=Z(pt);return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function $r(){if(Vr==null){Vr="<pre>";for(var e=0;e<49;++e)Vr+="x<br/>";Vr+="x</pre>"}var t=yt.clientHeight;return t==Xr?Wr:(Xr=t,dt.innerHTML=Vr,Wr=dt.firstChild.offsetHeight/50||1,dt.innerHTML="",Wr)}function Qr(){return K.clientWidth==Kr?Jr:(Kr=K.clientWidth,Jr=jr("x"))}function Gr(){return pt.offsetTop}function Yr(){return pt.offsetLeft}function Zr(e,t){var n=Z(K,!0),r,i;try{r=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(r-n.left>K.clientWidth||i-n.top>K.clientHeight))return null;var s=Z(pt,!0);return Ur(r-s.left,i-s.top)}function ei(e){function o(){var e=lt(X.value).join("\n");e!=i&&!s.readOnly&&hi(jn)(e,"end"),A.style.position="relative",X.style.cssText=r,q&&(bt.scrollTop=n),zt=!1,Vn(!0),Un()}var t=Zr(e),n=bt.scrollTop;if(!t||W)return;(nt(At.from,At.to)||rt(t,At.from)||!rt(t,At.to))&&hi(fr)(t.line,t.ch);var r=X.style.cssText;A.style.position="absolute",X.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",zt=!0;var i=X.value=qn();$n(),tt(X);if(j){O(e);var u=P(window,"mouseup",function(){u(),setTimeout(o,20)},!0)}else setTimeout(o,50)}function ti(){clearInterval(Tt);var e=!0;vt.style.visibility="",Tt=setInterval(function(){vt.style.visibility=(e=!e)?"":"hidden"},650)}function ri(e){function v(e,t,n){if(!e.text)return;var r=e.styles,i=o?0:e.text.length-1,s;for(var a=o?0:r.length-2,f=o?r.length:-2;a!=f;a+=2*u){var l=r[a];if(r[a+1]!=h){i+=u*l.length;continue}for(var c=o?0:l.length-1,v=o?l.length:-1;c!=v;c+=u,i+=u)if(i>=t&&i<n&&d.test(s=l.charAt(c))){var m=ni[s];if(m.charAt(1)==">"==o)p.push(s);else{if(p.pop()!=m.charAt(0))return{pos:i,match:!1};if(!p.length)return{pos:i,match:!0}}}}}var t=At.inverted?At.from:At.to,n=un(t.line),r=t.ch-1,i=r>=0&&ni[n.text.charAt(r)]||ni[n.text.charAt(++r)];if(!i)return;var s=i.charAt(0),o=i.charAt(1)==">",u=o?1:-1,a=n.styles;for(var f=r+1,l=0,c=a.length;l<c;l+=2)if((f-=a[l].length)<=0){var h=a[l+1];break}var p=[n.text.charAt(r)],d=/[(){}[\]]/;for(var l=t.line,c=o?Math.min(l+100,Ct.size):Math.max(-1,l-100);l!=c;l+=u){var n=un(l),m=l==t.line,g=v(n,m&&o?r+1:0,m&&!o?r:n.text.length);if(g)break}g||(g={pos:null,match:!1});var h=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",y=Lr({line:t.line,ch:r},{line:t.line,ch:r+1},h),b=g.pos!=null&&Lr({line:l,ch:g.pos},{line:l,ch:g.pos+1},h),w=hi(function(){y.clear(),b&&b.clear()});e?setTimeout(w,800):Qt=w}function ii(e){var t,n;for(var r=e,i=e-40;r>i;--r){if(r==0)return 0;var o=un(r-1);if(o.stateAfter)return r;var u=o.indentation(s.tabSize);if(n==null||t>u)n=r-1,t=u}return n}function si(e){var t=ii(e),n=t&&un(t-1).stateAfter;return n?n=h(Nt,n):n=p(Nt),Ct.iter(t,e,function(e){e.highlight(Nt,n,s.tabSize),e.stateAfter=h(Nt,n)}),t<e&&qt.push({from:t,to:e}),e<Ct.size&&!un(e).stateAfter&&kt.push(e),n}function oi(e,t){var n=si(e);Ct.iter(e,t,function(e){e.highlight(Nt,n,s.tabSize),e.stateAfter=h(Nt,n)})}function ui(){var e=+(new Date)+s.workTime,t=kt.length;while(kt.length){if(!un($t).stateAfter)var n=$t;else var n=kt.pop();if(n>=Ct.size)continue;var r=ii(n),i=r&&un(r-1).stateAfter;i?i=h(Nt,i):i=p(Nt);var o=0,u=Nt.compareStates,a=!1,f=r,l=!1;Ct.iter(f,Ct.size,function(t){var r=t.stateAfter;if(+(new Date)>e)return kt.push(f),ai(s.workDelay),a&&qt.push({from:n,to:f+1}),l=!0;var c=t.highlight(Nt,i,s.tabSize);c&&(a=!0),t.stateAfter=h(Nt,i);var p=null;if(u){var d=r&&u(r,i);d!=B&&(p=!!d)}p==null&&(c!==!1||!r?o=0:++o>3&&(!Nt.indent||Nt.indent(r,"")==Nt.indent(i,""))&&(p=!0));if(p)return!0;++f});if(l)return;a&&qt.push({from:n,to:f+1})}t&&s.onHighlightComplete&&s.onHighlightComplete(on)}function ai(e){if(!kt.length)return;xt.set(e,hi(ui))}function fi(){Ft=It=Rt=null,qt=[],Ut=!1,Xt=[]}function li(){Yt&&Hn(),Zt&&!s.lineWrapping&&(mt.style.left=jr(Gt)+"px",Zt=!1);var e,t;if(Ut){var n=Qn();e=Yn(n.x,n.y,n.x,n.yBot)}qt.length?t=er(qt,!0,e?e.scrollTop:null):(Ut&&ir(),Wt&&rr()),e&&Kn(),Ut&&(Jn(),ti()),Lt&&!zt&&(Ft===!0||Ft!==!1&&Ut)&&Vn(It),Ut&&s.matchBrackets&&setTimeout(hi(function(){Qt&&(Qt(),Qt=null),nt(At.from,At.to)&&ri(!1)}),20);var r=Ut,i=Xt;Rt&&s.onChange&&on&&s.onChange(on,Rt),r&&s.onCursorActivity&&s.onCursorActivity(on);for(var o=0;o<i.length;++o)i[o](on);t&&s.onUpdate&&s.onUpdate(on)}function hi(e){return function(){ci++||fi();try{var t=e.apply(this,arguments)}finally{--ci||li()}return t}}function pi(e){tn.startCompound();try{return e()}finally{tn.endCompound()}}var s={},d=e.defaults;for(var y in d)d.hasOwnProperty(y)&&(s[y]=(i&&i.hasOwnProperty(y)?i:d)[y]);var C=document.createElement("div");C.className="CodeMirror"+(s.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-scrollbar"><div class="CodeMirror-scrollbar-inner"></div></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><pre class="CodeMirror-cursor" style="visibility: hidden">&#160;</pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>',r.appendChild?r.appendChild(C):r(C);var A=C.firstChild,X=A.firstChild,K=C.lastChild,G=K.firstChild,Y=G.firstChild,st=Y.firstChild,ot=st.firstChild,pt=st.nextSibling.firstChild,dt=pt.firstChild,vt=dt.nextSibling,mt=vt.nextSibling,gt=mt.nextSibling,yt=gt.nextSibling,bt=A.nextSibling,wt=bt.firstChild;Nr(),Cr(),t&&(X.style.width="0px"),U||(K.draggable=!0),pt.style.outline="none",s.tabindex!=null&&(X.tabIndex=s.tabindex),s.autofocus&&$n(),!s.gutter&&!s.lineNumbers&&(st.style.display="none"),V&&(A.style.height="1px",A.style.position="absolute"),$?bt.className+=Pn()?" cm-sb-overlap":" cm-sb-nonoverlap":I&&(bt.className+=" cm-sb-ie7");try{jr("x")}catch(Et){throw Et.message.match(/runtime/i)&&(Et=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),Et}var St=new H,xt=new H,Tt,Nt,Ct=new w([new b([new g("")])]),kt,Lt;Er();var At={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},Ot,Mt,_t,Dt=0,Pt=0,Ht,Bt=!1,jt=!1,Ft,It,qt,Rt,Ut,zt,Wt,Xt,Vt=0,$t=0,Jt=0,Kt=0,Qt,Gt="",Yt=!1,Zt=!0,en={};hi(function(){fn(s.value||""),Ft=!1})();var tn=new N;P(K,"mousedown",hi(hn)),P(K,"dblclick",hi(pn)),P(pt,"selectstart",L),j||P(K,"contextmenu",ei),P(K,"scroll",cn),P(bt,"scroll",cn),P(bt,"mousedown",function(){setTimeout($n,0)}),P(K,"mousewheel",kn),P(K,"DOMMouseScroll",kn),P(window,"resize",function(){er(!0)}),P(X,"keyup",hi(xn)),P(X,"input",zn),P(X,"keydown",hi(En)),P(X,"keypress",hi(Sn)),P(X,"focus",Tn),P(X,"blur",Nn);if(s.dragDrop){P(K,"dragstart",vn);function nn(e){if(s.onDragEvent&&s.onDragEvent(on,k(e)))return;O(e)}P(K,"dragenter",nn),P(K,"dragover",nn),P(K,"drop",hi(dn))}P(K,"paste",function(){$n(),zn()}),P(X,"paste",zn),P(X,"cut",hi(function(){s.readOnly||jn("")})),V&&P(G,"mouseup",function(){document.activeElement==X&&X.blur(),$n()});var rn;try{rn=document.activeElement==X}catch(Et){}rn||s.autofocus?setTimeout(Tn,20):Nn();var on=C.CodeMirror={getValue:ln,setValue:hi(fn),getSelection:qn,replaceSelection:hi(jn),focus:function(){window.focus(),$n(),Tn(),zn()},setOption:function(e,t){var n=s[e];s[e]=t,e=="mode"||e=="indentUnit"?Er():e=="readOnly"&&t=="nocursor"?(Nn(),X.blur()):e=="readOnly"&&!t?Vn(!0):e=="theme"?Nr():e=="lineWrapping"&&n!=t?hi(xr)():e=="tabSize"?er(!0):e=="keyMap"&&Cr();if(e=="lineNumbers"||e=="gutter"||e=="firstLineNumber"||e=="theme")Sr(),er(!0)},getOption:function(e){return s[e]},undo:hi(On),redo:hi(Mn),indentLine:hi(function(e,t){typeof t!="string"&&(t==null?t=s.smartIndent?"smart":"prev":t=t?"add":"subtract"),sn(e)&&wr(e,t)}),indentSelection:hi(br),historySize:function(){return{undo:tn.done.length,redo:tn.undone.length}},clearHistory:function(){tn=new N},matchBrackets:hi(function(){ri(!0)}),getTokenAt:hi(function(e){return e=cr(e),un(e.line).getTokenAt(Nt,si(e.line),e.ch)}),getStateAfter:function(e){return e=lr(e==null?Ct.size-1:e),si(e+1)},cursorCoords:function(e,t){return e==null&&(e=At.inverted),this.charCoords(e?At.from:At.to,t)},charCoords:function(e,t){return e=cr(e),t=="local"?Rr(e,!1):t=="div"?Rr(e,!0):zr(e)},coordsChar:function(e){var t=Z(pt);return Ur(e.x-t.left,e.y-t.top)},markText:hi(Lr),setBookmark:Ar,findMarksAt:Or,setMarker:hi(Mr),clearMarker:hi(_r),setLineClass:hi(Pr),hideLine:hi(function(e){return Hr(e,!0)}),showLine:hi(function(e){return Hr(e,!1)}),onDeleteLine:function(e,t){if(typeof e=="number"){if(!sn(e))return null;e=un(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:Br,addWidget:function(e,t,n,r,i){e=Rr(cr(e));var s=e.yBot,o=e.x;t.style.position="absolute",G.appendChild(t);if(r=="over")s=e.y;else if(r=="near"){var u=Math.max(K.offsetHeight,Ct.height*$r()),a=Math.max(G.clientWidth,pt.clientWidth)-Yr();e.yBot+t.offsetHeight>u&&e.y>t.offsetHeight&&(s=e.y-t.offsetHeight),o+t.offsetWidth>a&&(o=a-t.offsetWidth)}t.style.top=s+Gr()+"px",t.style.left=t.style.right="",i=="right"?(o=G.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?o=0:i=="middle"&&(o=(G.clientWidth-t.offsetWidth)/2),t.style.left=o+Yr()+"px"),n&&Gn(o,s,o+t.offsetWidth,s+t.offsetHeight)},lineCount:function(){return Ct.size},clipPos:cr,getCursor:function(e){return e==null&&(e=At.inverted),it(e?At.from:At.to)},somethingSelected:function(){return!nt(At.from,At.to)},setCursor:hi(function(e,t,n){t==null&&typeof e.line=="number"?fr(e.line,e.ch,n):fr(e,t,n)}),setSelection:hi(function(e,t,n){(n?or:ur)(cr(e),cr(t||e))}),getLine:function(e){if(sn(e))return un(e).text},getLineHandle:function(e){if(sn(e))return un(e)},setLine:hi(function(e,t){sn(e)&&Bn(t,{line:e,ch:0},{line:e,ch:un(e).text.length})}),removeLine:hi(function(e){sn(e)&&Bn("",{line:e,ch:0},cr({line:e+1,ch:0}))}),replaceRange:hi(Bn),getRange:function(e,t){return In(cr(e),cr(t))},triggerOnKeyDown:hi(En),execCommand:function(e){return u[e](on)},moveH:hi(pr),deleteH:hi(dr),moveV:hi(mr),toggleOverwrite:function(){Bt?(Bt=!1,vt.className=vt.className.replace(" CodeMirror-overwrite","")):(Bt=!0,vt.className+=" CodeMirror-overwrite")},posFromIndex:function(e){var t=0,n;return Ct.iter(0,Ct.size,function(r){var i=r.text.length+1;if(i>e)return n=e,!0;e-=i,++t}),cr({line:t,ch:n})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return Ct.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){e!=null&&(K.scrollLeft=e),t!=null&&(bt.scrollTop=t),er([])},getScrollInfo:function(){return{x:K.scrollLeft,y:bt.scrollTop,height:bt.scrollHeight,width:K.scrollWidth}},operation:function(e){return hi(e)()},compoundChange:function(e){return pi(e)},refresh:function(){er(!0),bt.scrollHeight>Dt&&(bt.scrollTop=Dt)},getInputField:function(){return X},getWrapperElement:function(){return C},getScrollerElement:function(){return K},getGutterElement:function(){return st}},bn=null,wn,Rn=!1,Wn="",vr=null;kr.prototype.clear=hi(function(){var e=Infinity,t=-Infinity;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;if(!s||!i.parent)continue;var o=S(i);e=Math.min(e,o),t=Math.max(t,o);for(var u=0;u<s.length;++u)s[u].marker==this&&s.splice(u--,1)}e!=Infinity&&qt.push({from:e,to:t+1})}),kr.prototype.find=function(){var e,t;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;for(var o=0;o<s.length;++o){var u=s[o];if(u.marker==this)if(u.from!=null||u.to!=null){var a=S(i);a!=null&&(u.from!=null&&(e={line:a,ch:u.from}),u.to!=null&&(t={line:a,ch:u.to}))}}}return{from:e,to:t}};var Ir="CodeMirror-temp-"+Math.floor(Math.random()*16777215).toString(16),Wr,Xr,Vr,Jr,Kr=0,ni={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},ci=0;for(var di in o)o.propertyIsEnumerable(di)&&!on.propertyIsEnumerable(di)&&(on[di]=o[di]);return on}function f(e){return typeof e=="string"?a[e]:e}function l(e,t,n,r,i){function s(t){t=f(t);var n=t[e];if(n!=null&&r(n))return!0;if(t.nofallthrough)return i&&i(),!0;var o=t.fallthrough;if(o==null)return!1;if(Object.prototype.toString.call(o)!="[object Array]")return s(o);for(var u=0,a=o.length;u<a;++u)if(s(o[u]))return!0;return!1}return t&&s(t)?!0:s(n)}function c(e){var t=ht[D(e,"keyCode")];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function h(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function p(e,t,n){return e.startState?e.startState(t,n):!0}function d(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function v(e,t,n,r){this.from=e,this.to=t,this.style=n,this.marker=r}function m(e){this.from=e,this.to=e,this.line=null}function g(e,t){this.styles=t||[e,null],this.text=e,this.height=1,this.marked=this.gutterMarker=this.className=this.bgClassName=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function y(e,t,n,r){for(var i=0,s=0,o=0;s<t;i+=2){var u=n[i],a=s+u.length;o==0?(a>e&&r.push(u.slice(e-s,Math.min(u.length,t-s)),n[i+1]),a>=e&&(o=1)):o==1&&(a>t?r.push(u.slice(0,t-s),n[i+1]):r.push(u,n[i+1])),s=a}}function b(e){this.lines=e,this.parent=null;for(var t=0,n=e.length,r=0;t<n;++t)e[t].parent=this,r+=e[t].height;this.height=r}function w(e){this.children=e;var t=0,n=0;for(var r=0,i=e.length;r<i;++r){var s=e[r];t+=s.chunkSize(),n+=s.height,s.parent=this}this.size=t,this.height=n,this.parent=null}function E(e,t){while(!e.lines)for(var n=0;;++n){var r=e.children[n],i=r.chunkSize();if(t<i){e=r;break}t-=i}return e.lines[t]}function S(e){if(e.parent==null)return null;var t=e.parent,n=at(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0,s=r.children.length;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n}function x(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.height;if(t<o){e=s;continue e}t-=o,n+=s.chunkSize()}return n}while(!e.lines);for(var r=0,i=e.lines.length;r<i;++r){var u=e.lines[r],a=u.height;if(t<a)break;t-=a}return n+r}function T(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.chunkSize();if(t<o){e=s;continue e}t-=o,n+=s.height}return n}while(!e.lines);for(var r=0;r<t;++r)n+=e.lines[r].height;return n}function N(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function C(){O(this)}function k(e){return e.stop||(e.stop=C),e}function L(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function A(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function O(e){L(e),A(e)}function M(e){return e.target||e.srcElement}function _(e){if(e.which)return e.which;if(e.button&1)return 1;if(e.button&2)return 3;if(e.button&4)return 2}function D(e,t){var n=e.override&&e.override.hasOwnProperty(t);return n?e.override[t]:e[t]}function P(e,t,n,r){if(typeof e.addEventListener=="function"){e.addEventListener(t,n,!1);if(r)return function(){e.removeEventListener(t,n,!1)}}else{var i=function(e){n(e||window.event)};e.attachEvent("on"+t,i);if(r)return function(){e.detachEvent("on"+t,i)}}}function H(){this.id=null}function G(e,t,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var r=0,i=0;r<t;++r)e.charAt(r)=="	"?i+=n-i%n:++i;return i}function Y(e){return e.currentStyle?e.currentStyle:window.getComputedStyle(e,null)}function Z(e,t){var n=e.ownerDocument.body,r=0,i=0,s=!1;for(var o=e;o;o=o.offsetParent){var u=o.offsetLeft,a=o.offsetTop;o==n?(r+=Math.abs(u),i+=Math.abs(a)):(r+=u,i+=a),t&&Y(o).position=="fixed"&&(s=!0)}var f=t&&!s?null:n;for(var o=e.parentNode;o!=f;o=o.parentNode)o.scrollLeft!=null&&(r-=o.scrollLeft,i-=o.scrollTop);return{left:r,top:i}}function et(e){return e.textContent||e.innerText||e.nodeValue||""}function tt(e){t?(e.selectionStart=0,e.selectionEnd=e.value.length):e.select()}function nt(e,t){return e.line==t.line&&e.ch==t.ch}function rt(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function it(e){return{line:e.line,ch:e.ch}}function ot(e){return st.textContent=e,st.innerHTML}function ut(e,t){if(!t)return 0;if(!e)return t.length;for(var n=e.length,r=t.length;n>=0&&r>=0;--n,--r)if(e.charAt(n)!=t.charAt(r))break;return r+1}function at(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function ft(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()}e.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null};var t=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),n=t||/Mac/.test(navigator.platform),r=/Win/.test(navigator.platform),i=e.modes={},s=e.mimeModes={};e.defineMode=function(t,n){!e.defaults.mode&&t!="null"&&(e.defaults.mode=t);if(arguments.length>2){n.dependencies=[];for(var r=2;r<arguments.length;++r)n.dependencies.push(arguments[r])}i[t]=n},e.defineMIME=function(e,t){s[e]=t},e.resolveMode=function(t){if(typeof t=="string"&&s.hasOwnProperty(t))t=s[t];else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=i[n.name];return r?r(t,n):e.getMode(t,"text/plain")},e.listModes=function(){var e=[];for(var t in i)i.propertyIsEnumerable(t)&&e.push(t);return e},e.listMIMEs=function(){var e=[];for(var t in s)s.propertyIsEnumerable(t)&&e.push({mime:t,mode:s[t]});return e};var o=e.extensions={};e.defineExtension=function(e,t){o[e]=t};var u=e.commands={selectAll:function(e){e.setSelection({line:0,ch:0},{line:e.lineCount()-1})},killLine:function(e){var t=e.getCursor(!0),n=e.getCursor(!1),r=!nt(t,n);!r&&e.getLine(t.line).length==t.ch?e.replaceRange("",t,{line:t.line+1,ch:0}):e.replaceRange("",t,r?n:{line:t.line})},deleteLine:function(e){var t=e.getCursor().line;e.replaceRange("",{line:t,ch:0},{line:t})},undo:function(e){e.undo()},redo:function(e){e.redo()},goDocStart:function(e){e.setCursor(0,0,!0)},goDocEnd:function(e){e.setSelection({line:e.lineCount()-1},null,!0)},goLineStart:function(e){e.setCursor(e.getCursor().line,0,!0)},goLineStartSmart:function(e){var t=e.getCursor(),n=e.getLine(t.line),r=Math.max(0,n.search(/\S/));e.setCursor(t.line,t.ch<=r&&t.ch?0:r,!0)},goLineEnd:function(e){e.setSelection({line:e.getCursor().line},null,!0)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goWordRight:function(e){e.moveH(1,"word")},delCharLeft:function(e){e.deleteH(-1,"char")},delCharRight:function(e){e.deleteH(1,"char")},delWordLeft:function(e){e.deleteH(-1,"word")},delWordRight:function(e){e.deleteH(1,"word")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection("	","end")},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection("	","end")},transposeChars:function(e){var t=e.getCursor(),n=e.getLine(t.line);t.ch>0&&t.ch<n.length-1&&e.replaceRange(n.charAt(t.ch)+n.charAt(t.ch-1),{line:t.line,ch:t.ch-1},{line:t.line,ch:t.ch+1})},newlineAndIndent:function(e){e.replaceSelection("\n","end"),e.indentLine(e.getCursor().line)},toggleOverwrite:function(e){e.toggleOverwrite()}},a=e.keyMap={};a.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},a.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},a.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},a["default"]=n?a.macDefault:a.pcDefault,a.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"},e.fromTextArea=function(t,n){function r(){t.value=u.getValue()}n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex),n.autofocus==null&&t.getAttribute("autofocus")!=null&&(n.autofocus=!0);if(t.form){var i=P(t.form,"submit",r,!0);if(typeof t.form.submit=="function"){var s=t.form.submit;function o(){r(),t.form.submit=s,t.form.submit(),t.form.submit=o}t.form.submit=o}}t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return u.save=r,u.getTextArea=function(){return t},u.toTextArea=function(){r(),t.parentNode.removeChild(u.getWrapperElement()),t.style.display="",t.form&&(i(),typeof t.form.submit=="function"&&(t.form.submit=s))},u},e.copyState=h,e.startState=p,d.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(e){var t=this.string.charAt(this.pos);if(typeof e=="string")var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return G(this.string,this.start,this.tabSize)},indentation:function(){return G(this.string,null,this.tabSize)},match:function(e,t,n){if(typeof e!="string"){var i=this.string.slice(this.pos).match(e);return i&&t!==!1&&(this.pos+=i[0].length),i}function r(e){return n?e.toLowerCase():e}if(r(this.string).indexOf(r(e),this.pos)==this.pos)return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=d,v.prototype={attach:function(e){this.marker.set.push(e)},detach:function(e){var t=at(this.marker.set,e);t>-1&&this.marker.set.splice(t,1)},split:function(e,t){if(this.to<=e&&this.to!=null)return null;var n=this.from<e||this.from==null?null:this.from-e+t,r=this.to==null?null:this.to-e+t;return new v(n,r,this.style,this.marker)},dup:function(){return new v(null,null,this.style,this.marker)},clipTo:function(e,t,n,r,i){e&&r>this.from&&(r<this.to||this.to==null)?this.from=null:this.from!=null&&this.from>=t&&(this.from=Math.max(r,this.from)+i),n&&(t<this.to||this.to==null)&&(t>this.from||this.from==null)?this.to=null:this.to!=null&&this.to>t&&(this.to=r<this.to?this.to+i:t)},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(e){return this.marker==e.marker}},m.prototype={attach:function(e){this.line=e},detach:function(e){this.line==e&&(this.line=null)},split:function(e,t){if(e<this.from)return this.from=this.to=this.from-e+t,this},isDead:function(){return this.from>this.to},clipTo:function(e,t,n,r,i){(e||t<this.from)&&(n||r>this.to)?(this.from=0,this.to=-1):this.from>t&&(this.from=this.to=Math.max(r,this.from)+i)},sameSet:function(e){return!1},find:function(){return!this.line||!this.line.parent?null:{line:S(this.line),ch:this.from}},clear:function(){if(this.line){var e=at(this.line.marked,this);e!=-1&&this.line.marked.splice(e,1),this.line=null}}},g.inheritMarks=function(e,t){var n=new g(e),r=t&&t.marked;if(r)for(var i=0;i<r.length;++i)if(r[i].to==null&&r[i].style){var s=n.marked||(n.marked=[]),o=r[i],u=o.dup();s.push(u),u.attach(n)}return n},g.prototype={replace:function(e,t,n){var r=[],i=this.marked,s=t==null?this.text.length:t;y(0,e,this.styles,r),n&&r.push(n,null),y(s,this.text.length,this.styles,r),this.styles=r,this.text=this.text.slice(0,e)+n+this.text.slice(s),this.stateAfter=null;if(i){var o=n.length-(s-e);for(var u=0;u<i.length;++u){var a=i[u];a.clipTo(e==null,e||0,t==null,s,o),a.isDead()&&(a.detach(this),i.splice(u--,1))}}},split:function(e,t){var n=[t,null],r=this.marked;y(e,this.text.length,this.styles,n);var i=new g(t+this.text.slice(e),n);if(r)for(var s=0;s<r.length;++s){var o=r[s],u=o.split(e,t.length);u&&(i.marked||(i.marked=[]),i.marked.push(u),u.attach(i),u==o&&r.splice(s--,1))}return i},append:function(e){var t=this.text.length,n=e.marked,r=this.marked;this.text+=e.text,y(0,e.text.length,e.styles,this.styles);if(r)for(var i=0;i<r.length;++i)r[i].to==null&&(r[i].to=t);if(n&&n.length){r||(this.marked=r=[]);e:for(var i=0;i<n.length;++i){var s=n[i];if(!s.from)for(var o=0;o<r.length;++o){var u=r[o];if(u.to==t&&u.sameSet(s)){u.to=s.to==null?null:s.to+t,u.isDead()&&(u.detach(this),n.splice(i--,1));continue e}}r.push(s),s.attach(this),s.from+=t,s.to!=null&&(s.to+=t)}}},fixMarkEnds:function(e){var t=this.marked,n=e.marked;if(!t)return;for(var r=0;r<t.length;++r){var i=t[r],s=i.to==null;if(s&&n)for(var o=0;o<n.length;++o)if(n[o].sameSet(i)){s=!1;break}s&&(i.to=this.text.length)}},fixMarkStarts:function(){var e=this.marked;if(!e)return;for(var t=0;t<e.length;++t)e[t].from==null&&(e[t].from=0)},addMark:function(e){e.attach(this),this.marked==null&&(this.marked=[]),this.marked.push(e),this.marked.sort(function(e,t){return(e.from||0)-(t.from||0)})},highlight:function(e,t,n){var r=new d(this.text,n),i=this.styles,s=0,o=!1,u=i[0],a;this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()){var f=e.token(r,t),l=this.text.slice(r.start,r.pos);r.start=r.pos,s&&i[s-1]==f?i[s-2]+=l:l&&(!o&&(i[s+1]!=f||s&&i[s-2]!=a)&&(o=!0),i[s++]=l,i[s++]=f,a=u,u=i[s]);if(r.pos>5e3){i[s++]=this.text.slice(r.pos),i[s++]=null;break}}return i.length!=s&&(i.length=s,o=!0),s&&i[s-2]!=a&&(o=!0),o||(i.length<5&&this.text.length<10?null:!1)},getTokenAt:function(e,t,n){var r=this.text,i=new d(r);while(i.pos<n&&!i.eol()){i.start=i.pos;var s=e.token(i,t)}return{start:i.start,end:i.pos,string:i.current(),className:s||null,state:t}},indentation:function(e){return G(this.text,null,e)},getHTML:function(e,t,n,r){function u(t,n){if(!t)return;s&&F&&t.charAt(0)==" "&&(t="\u00a0"+t.slice(1)),s=!1;if(t.indexOf("	")==-1){o+=t.length;var r=ot(t)}else{var r="";for(var u=0;;){var a=t.indexOf("	",u);if(a==-1){r+=ot(t.slice(u)),o+=t.length-u;break}o+=a-u;var f=e(o);r+=ot(t.slice(u,a))+f.html,o+=f.width,u=a+1}}n?i.push('<span class="',n,'">',r,"</span>"):i.push(r)}function v(e){return e?"cm-"+e.replace(/ +/g," cm-"):null}var i=[],s=!0,o=0,a=u;if(t!=null){var f=0,l='<span id="'+n+'">';a=function(e,n){var s=e.length;if(t>=f&&t<f+s){t>f&&(u(e.slice(0,t-f),n),r&&i.push("<wbr>")),i.push(l);var o=t-f;u(W?e.slice(o,o+1):e.slice(o),n),i.push("</span>"),W&&u(e.slice(o+1),n),t--,f+=s}else f+=s,u(e,n),f==t&&f==d?i.push(l+" </span>"):f>t+10&&/\s/.test(e)&&(a=function(){})}}var c=this.styles,h=this.text,p=this.marked,d=h.length;if(!h&&t==null)a(" ");else if(!p||!p.length)for(var m=0,g=0;g<d;m+=2){var y=c[m],b=c[m+1],w=y.length;g+w>d&&(y=y.slice(0,d-g)),g+=w,a(y,v(b))}else{var E=0,m=0,S="",b,x=0,T=p[0].from||0,N=[],C=0;function k(){var e;while(C<p.length&&((e=p[C]).from==E||e.from==null))e.style!=null&&N.push(e),++C;T=C<p.length?p[C].from:Infinity;for(var t=0;t<N.length;++t){var n=N[t].to||Infinity;n==E?N.splice(t--,1):T=Math.min(n,T)}}var L=0;while(E<d){T==E&&k();var A=Math.min(d,T);for(;;){if(S){var O=E+S.length,M=b;for(var _=0;_<N.length;++_)M=(M?M+" ":"")+N[_].style;a(O>A?S.slice(0,A-E):S,M);if(O>=A){S=S.slice(A-E),E=A;break}E=O}S=c[m++],b=v(c[m++])}}}return i.join("")},cleanUp:function(){this.parent=null;if(this.marked)for(var e=0,t=this.marked.length;e<t;++e)this.marked[e].detach(this)}},b.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,n){for(var r=e,i=e+t;r<i;++r){var s=this.lines[r];this.height-=s.height,s.cleanUp();if(s.handlers)for(var o=0;o<s.handlers.length;++o)n.push(s.handlers[o])}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertHeight:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0,i=t.length;r<i;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},w.prototype={chunkSize:function(){return this.size},remove:function(e,t,n){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e),u=i.height;i.remove(e,o,n),this.height-=u-i.height,s==o&&(this.children.splice(r--,1),i.parent=null);if((t-=o)==0)break;e=0}else e-=s}if(this.size-t<25){var a=[];this.collapse(a),this.children=[new b(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0,n=this.children.length;t<n;++t)this.children[t].collapse(e)},insert:function(e,t){var n=0;for(var r=0,i=t.length;r<i;++r)n+=t[r].height;this.insertHeight(e,t,n)},insertHeight:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<=o){s.insertHeight(e,t,n);if(s.lines&&s.lines.length>50){while(s.lines.length>50){var u=s.lines.splice(s.lines.length-25,25),a=new b(u);s.height-=a.height,this.children.splice(r+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new w(t);if(!e.parent){var r=new w(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=at(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iter:function(e,t,n){this.iterN(e,t-e,n)},iterN:function(e,t,n){for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<o){var u=Math.min(t,o-e);if(s.iterN(e,u,n))return!0;if((t-=u)==0)break;e=0}else e-=o}}},N.prototype={addChange:function(e,t,n){this.undone.length=0;var r=+(new Date),i=this.done[this.done.length-1],s=i&&i[i.length-1],o=r-this.time;if(this.compound&&i&&!this.closed)i.push({start:e,added:t,old:n});else if(o>400||!s||this.closed||s.start>e+n.length||s.start+s.added<e)this.done.push([{start:e,added:t,old:n}]),this.closed=!1;else{var u=Math.max(0,s.start-e),a=Math.max(0,e+n.length-(s.start+s.added));for(var f=u;f>0;--f)s.old.unshift(n[f-1]);for(var f=a;f>0;--f)s.old.push(n[n.length-f]);u&&(s.start=e),s.added+=t-(n.length-u-a)}this.time=r},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},e.e_stop=O,e.e_preventDefault=L,e.e_stopPropagation=A,e.connect=P,H.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var B=e.Pass={toString:function(){return"CodeMirror.Pass"}},j=/gecko\/\d{7}/i.test(navigator.userAgent),F=/MSIE \d/.test(navigator.userAgent),I=/MSIE [1-7]\b/.test(navigator.userAgent),q=/MSIE [1-8]\b/.test(navigator.userAgent),R=F&&document.documentMode==5,U=/WebKit\//.test(navigator.userAgent),z=/Chrome\//.test(navigator.userAgent),W=/Opera\//.test(navigator.userAgent),X=/Apple Computer/.test(navigator.vendor),V=/KHTML\//.test(navigator.userAgent),$=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent),J=function(){if(q)return!1;var e=document.createElement("div");return"draggable"in e||"dragDrop"in e}(),K=function(){var e=document.createElement("textarea");return e.value="foo\nbar",e.value.indexOf("\r")>-1?"\r\n":"\n"}(),Q=/^$/;j?Q=/$'/:X?Q=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:z&&(Q=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/),document.documentElement.getBoundingClientRect!=null&&(Z=function(e,t){try{var n=e.getBoundingClientRect();n={top:n.top,left:n.left}}catch(r){n={top:0,left:0}}if(!t)if(window.pageYOffset==null){var i=document.documentElement||document.body.parentNode;i.scrollTop==null&&(i=document.body),n.top+=i.scrollTop,n.left+=i.scrollLeft}else n.top+=window.pageYOffset,n.left+=window.pageXOffset;return n});var st=document.createElement("pre");ot("a")=="\na"?ot=function(e){return st.textContent=e,st.innerHTML.slice(1)}:ot("	")!="	"&&(ot=function(e){return st.innerHTML="",st.appendChild(document.createTextNode(e)),st.innerHTML}),e.htmlEscape=ot;var lt="\n\nb".split(/\n/).length!=3?function(e){var t=0,n,r=[];while((n=e.indexOf("\n",t))>-1)r.push(e.slice(t,e.charAt(n-1)=="\r"?n-1:n)),t=n+1;return r.push(e.slice(t)),r}:function(e){return e.split(/\r?\n/)};e.splitLines=lt;var ct=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var ht={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",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return e.keyNames=ht,function(){for(var e=0;e<10;e++)ht[e+48]=String(e);for(var e=65;e<=90;e++)ht[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)ht[e+111]=ht[e+63235]="F"+e}(),e}();CodeMirror.defineMode("coffeescript",function(e){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function g(e,n){if(e.sol()){var l=n.scopes[0].offset;if(e.eatSpace()){var c=e.indentation();return c>l?"indent":c<l?"dedent":null}l>0&&E(e,n)}if(e.eatSpace())return null;var v=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return n.tokenize=b,n.tokenize(e,n);if(v==="#")return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var g=!1;e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(g=!0),e.match(/^-?\d+\.\d*/)&&(g=!0),e.match(/^-?\.\d+/)&&(g=!0);if(g)return e.peek()=="."&&e.backUp(1),"number";var w=!1;e.match(/^-?0x[0-9a-f]+/i)&&(w=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(w=!0),e.match(/^-?0(?![\dx])/i)&&(w=!0);if(w)return"number"}if(e.match(p))return n.tokenize=y(e.current(),"string"),n.tokenize(e,n);if(e.match(d)){if(e.current()!="/"||e.match(/^.*\//,!1))return n.tokenize=y(e.current(),"string-2"),n.tokenize(e,n);e.backUp(1)}return e.match(u)||e.match(o)?"punctuation":e.match(s)||e.match(r)||e.match(f)?"operator":e.match(i)?"punctuation":e.match(m)?"atom":e.match(h)?"keyword":e.match(a)?"variable":(e.next(),t)}function y(n,r){var i=n.length==1;return function(o,u){while(!o.eol()){o.eatWhile(/[^'"\/\\]/);if(o.eat("\\")){o.next();if(i&&o.eol())return r}else{if(o.match(n))return u.tokenize=g,r;o.eat(/['"\/]/)}}return i&&(e.mode.singleLineStringErrors?r=t:u.tokenize=g),r}}function b(e,t){while(!e.eol()){e.eatWhile(/[^#]/);if(e.match("###")){t.tokenize=g;break}e.eatWhile("#")}return"comment"}function w(t,n,r){r=r||"coffee";var i=0;if(r==="coffee"){for(var s=0;s<n.scopes.length;s++)if(n.scopes[s].type==="coffee"){i=n.scopes[s].offset+e.indentUnit;break}}else i=t.column()+t.current().length;n.scopes.unshift({offset:i,type:r})}function E(e,t){if(t.scopes.length==1)return;if(t.scopes[0].type==="coffee"){var n=e.indentation(),r=-1;for(var i=0;i<t.scopes.length;++i)if(n===t.scopes[i].offset){r=i;break}if(r===-1)return!0;while(t.scopes[0].offset!==n)t.scopes.shift();return!1}return t.scopes.shift(),!1}function S(e,n){var r=n.tokenize(e,n),i=e.current();if(i===".")return r=n.tokenize(e,n),i=e.current(),r==="variable"?"variable":t;if(i==="@")return e.eat("@"),"keyword";i==="return"&&(n.dedent+=1),((i==="->"||i==="=>")&&!n.lambda&&n.scopes[0].type=="coffee"&&e.peek()===""||r==="indent")&&w(e,n);var s="[({".indexOf(i);return s!==-1&&w(e,n,"])}".slice(s,s+1)),l.exec(i)&&w(e,n),i=="then"&&E(e,n),r==="dedent"&&E(e,n)?t:(s="])}".indexOf(i),s!==-1&&E(e,n)?t:(n.dedent>0&&e.eol()&&n.scopes[0].type=="coffee"&&(n.scopes.length>1&&n.scopes.shift(),n.dedent-=1),r))}var t="error",r=new RegExp("^[\\+\\-\\*/%&|\\^~<>!?]"),i=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),s=new RegExp("^((->)|(=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"),o=new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),u=new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"),a=new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*"),f=n(["and","or","not","is","isnt","in","instanceof","typeof"]),l=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],c=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","throw","when","until"],h=n(l.concat(c));l=n(l);var p=new RegExp("^('{3}|\"{3}|['\"])"),d=new RegExp("^(/{3}|/)"),v=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],m=n(v),x={startState:function(e){return{tokenize:g,scopes:[{offset:e||0,type:"coffee"}],lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=S(e,t);return t.lastToken={style:n,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),n},indent:function(e,t){return e.tokenize!=g?0:e.scopes[0].offset}};return x}),CodeMirror.defineMIME("text/x-coffeescript","coffeescript")