var CodeMirror=function(){function Ce(t,e){var L={},n=Ce.defaults;for(var r in n)n.hasOwnProperty(r)&&(L[r]=(e&&e.hasOwnProperty(r)?e:n)[r]);var m=L.document,s=m.createElement("div");s.className="CodeMirror"+(L.lineWrapping?" CodeMirror-wrap":""),s.innerHTML='
 
',t.appendChild?t.appendChild(s):t(s);var l=s.firstChild,a=l.firstChild,A=s.lastChild,z=A.firstChild,d=z.firstChild,p=d.firstChild,u=p.firstChild,g=p.nextSibling.firstChild,f=g.firstChild,o=f.nextSibling,v=o.nextSibling;Vt(),/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)&&(a.style.width="0px"),_e||(g.draggable=!0),null!=L.tabindex&&(a.tabIndex=L.tabindex),L.gutter||L.lineNumbers||(p.style.display="none");try{Yt("x")}catch(t){throw t.message.match(/runtime/i)&&(t=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),t}var i,T,E,c,h=new Fe,x=new Fe,W=new De([new Ne([new We("")])]);Ot();var y,k,C,w,M,b,N,D,S,H,I,O,R,P,U={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},B=!1,V=0,K=0,F=0,j=0,G="",Y=Ut();ye(function(){Q(L.value||""),M=!1})();var _,q=new Re;Ke(A,"mousedown",ye(function(e){St(e.shiftKey);for(var t=Ve(e);t!=s;t=t.parentNode)if(t.parentNode==z&&t!=d)return;for(t=Ve(e);t!=s;t=t.parentNode)if(t.parentNode==u)return L.onGutterClick&&L.onGutterClick($,Qe(u.childNodes,t)+K,e),Ue(e);var i=ae(e);switch(function(t){{if(t.which)return t.which;if(1&t.button)return 1;if(2&t.button)return 3;if(4&t.button)return 2}}(e)){case 3:return void(Ge&&!we&&se(e));case 2:return void(i&&Tt(i.line,i.ch,!0))}if(!i)return void(Ve(e)==A&&Ue(e));c||nt();var n=+new Date;{if(C&&C.time>n-400&&Xe(C.pos,i))return Ue(e),setTimeout(xt,20),function(t){Lt({line:t,ch:0},{line:t,ch:Z(t).text.length})}(i.line);if(k&&k.time>n-400&&Xe(k.pos,i))return C={time:n,pos:i},Ue(e),Ht(i);k={time:n,pos:i}}var o,l=i;if(je&&!Xe(U.from,U.to)&&!$e(i,U.from)&&!$e(U.to,i)){_e&&(g.draggable=!0);var r=Ke(m,"mouseup",ye(function(t){_e&&(g.draggable=!1),w=!1,r(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(Ue(t),Tt(i.line,i.ch,!0),xt())}),!0);return void(w=!0)}Ue(e),Tt(i.line,i.ch,!0);var a=Ke(m,"mousemove",ye(function(t){clearTimeout(o),Ue(t),function t(e){var n=ae(e,!0);if(n&&!Xe(n,l)){c||nt(),Lt(i,l=n),M=!1;var r=Ct();(n.line>=r.to||n.linea&&t.y>e.offsetHeight&&(o=t.y-e.offsetHeight),l+e.offsetWidth>s&&(l=s-e.offsetWidth)}e.style.top=o+oe()+"px",e.style.left=e.style.right="","right"==i?(l=z.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(z.clientWidth-e.offsetWidth)/2),e.style.left=l+le()+"px"),n&&kt(l,o,l+e.offsetWidth,o+e.offsetHeight)},lineCount:function(){return W.size},clipPos:Wt,getCursor:function(t){return null==t&&(t=U.inverted),{line:(e=t?U.from:U.to).line,ch:e.ch};var e},somethingSelected:function(){return!Xe(U.from,U.to)},setCursor:ye(function(t,e,n){null==e&&"number"==typeof t.line?Tt(t.line,t.ch,n):Tt(t,e,n)}),setSelection:ye(function(t,e,n){(n?Lt:At)(Wt(t),Wt(e||t))}),getLine:function(t){if(X(t))return Z(t).text},getLineHandle:function(t){if(X(t))return Z(t)},setLine:ye(function(t,e){X(t)&&at(e,{line:t,ch:0},{line:t,ch:Z(t).text.length})}),removeLine:ye(function(t){X(t)&&at("",{line:t,ch:0},Wt({line:t+1,ch:0}))}),replaceRange:ye(at),getRange:function(t,e){return ft(Wt(t),Wt(e))},execCommand:function(t){return be[t]($)},moveH:ye(function(t,e){var n=t<0?U.from:U.to;(y||Xe(U.from,U.to))&&(n=Nt(t,e));Tt(n.line,n.ch,!0)}),deleteH:ye(function(t,e){Xe(U.from,U.to)?t<0?at("",Nt(t,e),U.to):at("",U.from,Nt(t,e)):at("",U.from,U.to);b=!0}),moveV:ye(function(t,e){var n=0,r=Jt(U.inverted?U.from:U.to,!0);null!=Dt&&(r.x=Dt);"page"==e?n=A.clientHeight:"line"==e&&(n=ee());var i=Qt(r.x,r.y+n*t+2);Tt(i.line,i.ch,!0),Dt=r.x}),toggleOverwrite:function(){B=!B},posFromIndex:function(n){var r,i=0;return W.iter(0,W.size,function(t){var e=t.text.length+1;if(nL.undoDepth;)q.done.shift()}lt(t,e,n,r,i)}function ot(t,e){var n=t.pop();if(n){var r=[],i=n.start+n.added;W.iter(n.start,i,function(t){r.push(t.text)}),e.push({start:n.start,added:n.old.length,old:r});var o=Wt({line:n.start+n.old.length-1,ch:function(t,e){if(!e)return t?t.length:0;if(!t)return e.length;for(var n=t.length,r=e.length;0<=n&&0<=r&&t.charAt(n)==e.charAt(r);--n,--r);return r+1}(r[r.length-1],n.old[n.old.length-1])});lt({line:n.start,ch:0},{line:i-1,ch:Z(i-1).text.length},n.old,o,o),M=!0}}function lt(t,e,n,r,i){var o=!1,l=G.length;L.lineWrapping||W.iter(t.line,e.line,function(t){if(t.text.length==l)return o=!0}),(t.line!=e.line||1l&&(l=(G=e).length,P=null,o=!1)}),o&&(l=0,G="",P=null,W.iter(0,W.size,function(t){var e=t.text;e.length>l&&(l=e.length,G=e)}));for(var m=[],g=n.length-a-1,v=(h=0,E.length);he.line&&m.push(x+g)}var y,k,C,w=t.line+Math.min(n.length,500);y=t.line,k=w,C=de(y),W.iter(y,k,function(t){t.highlight(T,C,L.tabSize),t.stateAfter=Ae(T,C)}),m.push(w),E=m,me(100),N.push({from:t.line,to:e.line+1,diff:g});var M={from:t,to:e,text:n};if(D){for(var b=D;b.next;b=b.next);b.next=M}else D=M;function S(t){return t<=Math.min(e.line,e.line+g)?t:t+g}At(r,i,S(U.from.line),S(U.to.line)),z.style.height=W.height*ee()+2*oe()+"px"}function at(r,i,o){function e(t){if($e(t,i))return t;if(!$e(o,t))return l;var e=t.line+r.length-(o.line-i.line)-1,n=t.ch;return t.line==o.line&&(n+=r[r.length-1].length-(o.ch-(o.line==i.line?i.ch:0))),{line:e,ch:n}}var l;return i=Wt(i),o=o?Wt(o):i,ut(r=en(r),i,o,function(t){return l=t,{from:e(U.from),to:e(U.to)}}),l}function st(t,e){ut(en(t),U.from,U.to,function(t){return"end"==e?{from:t,to:t}:"start"==e?{from:U.from,to:U.from}:{from:U.from,to:t}})}function ut(t,e,n,r){var i=1==t.length?t[0].length+e.ch:t[t.length-1].length,o=r({line:e.line+t.length-1,ch:i});it(e,n,t,o.from,o.to)}function ft(t,e){var n=t.line,r=e.line;if(n==r)return Z(n).text.slice(t.ch,e.ch);var i=[Z(n).text.slice(t.ch)];return W.iter(n+1,r,function(t){i.push(t.text)}),i.push(Z(r).text.slice(0,e.ch)),i.join("\n")}function ct(){return ft(U.from,U.to)}var ht=!1;function dt(){ht||h.set(L.pollInterval,function(){ge(),gt(),c&&dt(),ve()})}function pt(){var e=!1;ht=!0,h.set(20,function t(){ge(),gt()||e?(ht=!1,dt()):(e=!0,h.set(60,t)),ve()})}var mt="";function gt(){if(H||!c||nn(a))return!1;var t=a.value;if(t==mt)return!1;y=null;for(var e=0,n=Math.min(mt.length,t.length);ez.clientWidth&&(f=!1)),u&&L.onScroll&&L.onScroll($),f}function Ct(){var t=ee(),e=A.scrollTop-oe(),n=Math.max(0,Math.floor(e/t)),r=Math.ceil((e+A.clientHeight)/t);return{from:Ie(W,n),to:Ie(W,r)}}function wt(t,e){if(A.clientWidth){var n=Ct();if(!(!0!==t&&0==t.length&&n.from>=K&&n.to<=F)){var r=Math.max(n.from-100,0),i=Math.min(W.size,n.to+100);K=u.to?o.push(u):(i.from>u.from&&o.push({from:u.from,to:i.from,domStart:u.domStart}),i.toi&&(s.to=i),s.from>=s.to?o.splice(a--,1):l+=s.to-s.from}if(l!=i-r){o.sort(function(t,e){return t.domStart-e.domStart});var u=ee(),f=p.style.display;v.style.display=p.style.display="none",function(t,e,r){if(r.length){function n(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}for(var i=0,o=v.firstChild,l=0;li;)o=n(o),i++;for(var s=0,u=a.to-a.from;ss?(t.hidden?p.innerHTML="
":p.innerHTML=t.getHTML(e,n,!0,Y),v.insertBefore(p.firstChild,o)):o=o.nextSibling,++s})}(r,i,o),v.style.display="";var c=r!=K||i!=F||j!=A.clientHeight+u;if(c&&(j=A.clientHeight+u),F=i,V=Oe(W,K=r),d.style.top=V*u+"px",z.style.height=W.height*u+2*oe()+"px",v.childNodes.length!=F-K)throw new Error("BAD PATCH! "+JSON.stringify(o)+" size="+(F-K)+" nodes="+v.childNodes.length);if(L.lineWrapping){P=A.clientWidth;var h=v.firstChild;W.iter(K,F,function(t){if(!t.hidden){var e=Math.round(h.offsetHeight/u)||1;t.height!=e&&(J(t,e),I=!0)}h=h.nextSibling})}else null==P&&(P=Yt(G)),P>A.clientWidth?(g.style.width=P+"px",z.style.width="",z.style.width=A.scrollWidth+"px"):g.style.width=z.style.width="";return p.style.display=f,(c||I)&&Mt(),bt(),!e&&L.onUpdate&&L.onUpdate($),!0}}}else K=F=V=0}function Mt(){if(L.gutter||L.lineNumbers){var t=d.offsetHeight,e=A.clientHeight;p.style.height=(t-e<2?e:t)+"px";var i=[],o=K;W.iter(K,Math.max(F,K+1),function(t){if(t.hidden)i.push("
");else{var e=t.gutterMarker,n=L.lineNumbers?o+L.firstLineNumber:null;e&&e.text?n=e.text.replace("%N%",null!=n?n:""):null==n&&(n=" "),i.push(e&&e.style?'
':"
",n);for(var r=1;r ");i.push("
")}++o}),p.style.display="none",u.innerHTML=i.join("");for(var n,r=String(W.size).length,l=u.firstChild,a=(n=l).textContent||n.innerText||n.nodeValue||"",s="";a.length+s.lengthr.text.length)&&(i=r.text.length),{line:e,ch:i}}e+=t}}return Z(o.line).hidden?o.line>=t?e(1)||e(-1):e(-1)||e(1):o}function Tt(t,e,n){var r=Wt({line:t,ch:e||0});(n?Lt:At)(r,r)}function Et(t){return Math.max(0,Math.min(t,W.size-1))}function Wt(t){if(t.line<0)return{line:0,ch:0};if(t.line>=W.size)return{line:W.size-1,ch:Z(W.size-1).text.length};var e=t.ch,n=Z(t.line).text.length;return null==e||nG.length&&(G=t.text)});N.push({from:0,to:W.size})}function Ut(){for(var t='',e=0;e"}function Bt(){Y=Ut(),wt(!0)}function Vt(){A.className=A.className.replace(/\s*cm-s-\w+/g,"")+L.theme.replace(/(^|\s)\s*/g," cm-s-")}function Kt(){this.set=[]}function Ft(t,e,n){t=Wt(t),e=Wt(e);var i=new Kt;function r(t,e,n,r){Z(t).addMark(new Te(e,n,r,i.set))}if(t.line==e.line)r(t.line,t.ch,e.ch,n);else{r(t.line,t.ch,null,n);for(var o=t.line+1,l=e.line;o"+t.getHTML(null,null,!1,Y,e)+''+Je(t.text.charAt(e)||" ")+""+n+"
";var i=document.getElementById("CodeMirror-temp-"+$t),o=i.offsetTop,l=i.offsetLeft;if(Ye&&e&&0==o&&0==l){var a=document.createElement("span");a.innerHTML="x",i.parentNode.insertBefore(a,i.nextSibling),o=a.offsetTop}return{top:o,left:l}}function Jt(t,e){var n,r=ee(),i=r*(Oe(W,t.line)-(e?V:0));if(0==t.ch)n=0;else{var o=Zt(Z(t.line),t.ch);n=o.left,L.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function Qt(t,e){e<0&&(e=0);var r=ee(),n=ie(),i=V+Math.floor(e/r),o=Ie(W,i);if(o>=W.size)return{line:W.size-1,ch:Z(W.size-1).text.length};var l=Z(o),a=l.text,s=L.lineWrapping,u=s?i-Oe(W,o):0;if(t<=0&&0==u)return{line:o,ch:0};function f(t){var e=Zt(l,t);if(s){var n=Math.round(e.top/r);return Math.max(0,e.left+(n-u)*A.clientWidth)}return e.left}for(var c,h=0,d=0,p=a.length,m=Math.min(p,Math.ceil((t+u*A.clientWidth*.9)/n));;){var g=f(m);if(!(g<=t&&m";for(var t=0;t<49;++t)Xt+="x
";Xt+="x"}var e=v.clientHeight;return e==qt||(qt=e,f.innerHTML=Xt,_t=f.firstChild.offsetHeight/50||1,f.innerHTML=""),_t}var ne,re=0;function ie(){return A.clientWidth==re?ne:(re=A.clientWidth,ne=Yt("x"))}function oe(){return g.offsetTop}function le(){return g.offsetLeft}function ae(t,e){var n,r,i=qe(A,!0);try{n=t.clientX,r=t.clientY}catch(t){return null}if(!e&&(n-i.left>A.clientWidth||r-i.top>A.clientHeight))return null;var o=qe(g,!0);return Qt(n-o.left,r-o.top)}function se(t){var e=ae(t);if(e&&!window.opera){!Xe(U.from,U.to)&&!$e(e,U.from)&&$e(e,U.to)||ye(Tt)(e.line,e.ch);var n=a.style.cssText;l.style.position="absolute",a.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: white; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",H=!0;var r=a.value=ct();if(xt(),a.select(),Ge){Be(t);var i=Ke(window,"mouseup",function(){i(),setTimeout(o,20)},!0)}else setTimeout(o,50)}function o(){var t=en(a.value).join("\n");t!=r&&ye(st)(t,"end"),l.style.position="relative",a.style.cssText=n,vt(!(H=!1)),dt()}}function ue(){clearInterval(i);var t=!0;o.style.visibility="",i=setInterval(function(){o.style.visibility=(t=!t)?"":"hidden"},650)}var fe={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function ce(t){var e=U.inverted?U.from:U.to,n=Z(e.line),r=e.ch-1,i=0<=r&&fe[n.text.charAt(r)]||fe[n.text.charAt(++r)];if(i){i.charAt(0);for(var h=">"==i.charAt(1),d=h?1:-1,o=n.styles,l=r+1,a=0,s=o.length;a"==c.charAt(1)==h)m.push(r);else{if(m.pop()!=c.charAt(0))return{pos:o,match:!1};if(!m.length)return{pos:o,match:!0}}}}else o+=d*s.length}}}function he(t){for(var e,n,r=t,i=t-40;i=W.size)){var e=he(i),o=e&&Z(e-1).stateAfter;o=o?Ae(T,o):ze(T);var l=0,a=T.compareStates,s=!1,u=e,f=!1;if(W.iter(u,W.size,function(t){var e=t.stateAfter;if(+new Date>r)return E.push(u),me(L.workDelay),s&&N.push({from:i,to:u+1}),f=!0;var n=t.highlight(T,o,L.tabSize);if(n&&(s=!0),t.stateAfter=Ae(T,o),a){if(e&&a(e,o))return!0}else if(!1===n&&e){if(3<++l&&(!T.indent||T.indent(e,"")==T.indent(o,"")))return!0}else l=0;++u}),f)return;s&&N.push({from:i,to:u+1})}}t&&L.onHighlightComplete&&L.onHighlightComplete($)}function me(t){E.length&&x.set(t,ye(pe))}function ge(){M=b=D=null,S=!(N=[]),O=[]}function ve(){var t,e=!1;S&&(e=!yt()),N.length?t=wt(N,!0):(S&&bt(),I&&Mt()),e&&yt(),S&&(function(){if(o.getBoundingClientRect){var t=o.getBoundingClientRect();if(!Ye||t.top!=t.bottom){var e=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(t.top<0||t.bottom>e)&&o.scrollIntoView()}}}(),ue()),c&&!H&&(!0===M||!1!==M&&S)&&vt(b),S&&L.matchBrackets&&setTimeout(ye(function(){R&&(R(),R=null),Xe(U.from,U.to)&&ce(!1)}),20);var n=D,r=O;S&&L.onCursorActivity&&L.onCursorActivity($),n&&L.onChange&&$&&L.onChange($,n);for(var i=0;i=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pose},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var e=this.string.indexOf(t,this.pos);if(-1=e&&(this.from=Math.max(r,this.from)+i),null!=this.to&&this.to>e&&(this.to=rthis.from&&(rthis.from||null==this.from)&&(this.to=null)},isDead:function(){return null!=this.from&&null!=this.to&&this.from>=this.to},sameSet:function(t){return this.set==t.set}},Ee.prototype={attach:function(t){this.line=t},detach:function(t){this.line==t&&(this.line=null)},split:function(t,e){if(tthis.to},clipTo:function(t,e,n,r,i){(t||ethis.to)?(this.from=0,this.to=-1):this.from>e&&(this.from=this.to=Math.max(r,this.from)+i)},sameSet:function(t){return!1},find:function(){return this.line&&this.line.parent?{line:He(this.line),ch:this.from}:null},clear:function(){if(this.line){var t=Qe(this.line.marked,this);-1!=t&&this.line.marked.splice(t,1),this.line=null}}},We.inheritMarks=function(t,e){var n=new We(t),r=e&&e.marked;if(r)for(var i=0;i',Je(t).replace(/\t/g,r),""):o.push(Je(t).replace(/\t/g,r)))}n&&o.push(this.className?'
':"
");var s=this.styles,u=this.text,f=this.marked;t==e&&(t=null);var c=u.length;if(null!=i&&(c=Math.min(i,c)),u||null!=i)if(f||null!=t){var h=0,d=(C=0,""),p=-1,m=null;function g(){f&&(m=(p+=1)h?v=Math.min(v,m.from):(x+=" "+m.style,null!=m.to&&(v=Math.min(v,m.to))));;){var y=h+d.length,k=b;if(x&&(k=b?b+x:x),a(v"),o.join("")},cleanUp:function(){if(this.parent=null,this.marked)for(var t=0,e=this.marked.length;tt+e||i.start+i.added")):null:e.match("--")?t(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),t(function r(i){return function(t,e){for(var n;null!=(n=t.next());){if("<"==n)return e.tokenize=r(i+1),e.tokenize(t,e);if(">"==n){if(1!=i)return e.tokenize=r(i-1),e.tokenize(t,e);e.tokenize=f;break}}return"meta"}}(1))):null;if(e.eat("?"))return e.eatWhile(/[\w\._\-]/),n.tokenize=h("meta","?>"),"meta";for(l=e.eat("/")?"closeTag":"openTag",e.eatSpace(),o="";r=e.eat(/[^\s\u00a0=<>\"\'\/?]/);)o+=r;return n.tokenize=c,"tag"}function c(t,e){var n,r=t.next();return">"==r||"/"==r&&t.eat(">")?(e.tokenize=f,l=">"==r?"endTag":"selfcloseTag","tag"):"="==r?(l="equals",null):/[\'\"]/.test(r)?(e.tokenize=(n=r,function(t,e){for(;!t.eol();)if(t.next()==n){e.tokenize=c;break}return"string"}),e.tokenize(t,e)):(t.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function h(n,r){return function(t,e){for(;!t.eol();){if(t.match(r)){e.tokenize=f;break}t.next()}return n}}function n(){for(var t=arguments.length-1;0<=t;t--)a.cc.push(arguments[t])}function d(){return n.apply(null,arguments),!0}function p(t){if("openTag"==t)return a.tagName=o,d(m,(i=a.startOfLine,function(t){return"selfcloseTag"==t||"endTag"==t&&s.autoSelfClosers.hasOwnProperty(a.tagName.toLowerCase())||"endTag"==t&&(e=a.tagName,n=i,r=s.doNotIndent.hasOwnProperty(e)||a.context&&a.context.noIndent,a.context={prev:a.context,tagName:e,indent:a.indented,startOfLine:n,noIndent:r}),d();var e,n,r}));if("closeTag"!=t)return d();var e,i,n=!1;return(n=!a.context||a.context.tagName!=o)&&(r="error"),d((e=n,function(t){return e&&(r="error"),"endTag"==t?(a.context&&(a.context=a.context.prev),d()):(r="error",d(arguments.callee))}))}function m(t){return"word"==t?(r="attribute",d(m)):"equals"==t?d(g,m):"string"==t?(r="error",d(m)):n()}function g(t){return"word"==t&&s.allowUnquoted?(r="string",d()):"string"==t?d(v):n()}function v(t){return"string"==t?d(v):n()}return{startState:function(){return{tokenize:f,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(t,e){if(t.sol()&&(e.startOfLine=!0,e.indented=t.indentation()),t.eatSpace())return null;r=l=o=null;var n=e.tokenize(t,e);if(e.type=l,(n||l)&&"comment"!=n)for(a=e;;){if((e.cc.pop()||p)(l||n))break}return e.startOfLine=!1,r||n},indent:function(t,e,n){var r=t.context;if(t.tokenize!=c&&t.tokenize!=f||r&&r.noIndent)return n?n.match(/^(\s*)/)[0].length:0;if(u&&/!?|]/;function p(t,e,n){return(e.tokenize=n)(t,e)}function m(t,e){for(var n,r=!1;null!=(n=t.next());){if(n==e&&!r)return;r=!r&&"\\"==n}return r}function g(t,e,n){return c=t,h=n,e}function v(t,e){var n=t.next();if('"'==n||"'"==n)return p(t,e,(r=n,function(t,e){return m(t,r)||(e.tokenize=v),g("string","string")}));if(/[\[\]{}\(\),;\:\.]/.test(n))return g(n);if("0"==n&&t.eat(/x/i))return t.eatWhile(/[\da-f]/i),g("number","number");if(/\d/.test(n))return t.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),g("number","number");if("/"==n)return t.eat("*")?p(t,e,x):t.eat("/")?(t.skipToEnd(),g("comment","comment")):e.reAllowed?(m(t,"/"),t.eatWhile(/[gimy]/),g("regexp","string")):(t.eatWhile(d),g("operator",null,t.current()));if("#"==n)return t.skipToEnd(),g("error","error");if(d.test(n))return t.eatWhile(d),g("operator",null,t.current());t.eatWhile(/[\w\$_]/);var r,i=t.current(),o=u.propertyIsEnumerable(i)&&u[i];return o&&e.kwAllowed?g(o.type,o.style,i):g("variable","variable",i)}function x(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=v;break}r="*"==n}return g("comment","comment")}var y={atom:!0,number:!0,variable:!0,string:!0,regexp:!0};function k(t,e,n,r,i,o){this.indented=t,this.column=e,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function C(t,e){for(var n=t.localVars;n;n=n.next)if(n.name==e)return 1}var w={state:null,column:null,marked:null,cc:null};function M(){for(var t=arguments.length-1;0<=t;t--)w.cc.push(arguments[t])}function b(){return M.apply(null,arguments),!0}function S(t){var e=w.state;if(e.context){w.marked="def";for(var n=e.localVars;n;n=n.next)if(n.name==t)return;e.localVars={name:t,next:e.localVars}}}var L={name:"this",next:{name:"arguments"}};function A(){w.state.context||(w.state.localVars=L),w.state.context={prev:w.state.context,vars:w.state.localVars}}function z(){w.state.localVars=w.state.context.vars,w.state.context=w.state.context.prev}function T(e,n){function t(){var t=w.state;t.lexical=new k(t.indented,w.stream.column(),e,null,t.lexical,n)}return t.lex=!0,t}function E(){var t=w.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function W(e){return function(t){return t==e?b():";"==e?M():b(arguments.callee)}}function N(t){return"var"==t?b(T("vardef"),V,W(";"),E):"keyword a"==t?b(T("form"),D,N,E):"keyword b"==t?b(T("form"),N,E):"{"==t?b(T("}"),B,E):";"==t?b():"function"==t?b(_):"for"==t?b(T("form"),W("("),T(")"),F,W(")"),E,N,E):"variable"==t?b(T("stat"),O):"switch"==t?b(T("form"),D,T("}","switch"),W("{"),B,E,E):"case"==t?b(D,W(":")):"default"==t?b(W(":")):"catch"==t?b(T("form"),A,W("("),q,W(")"),N,E,z):M(T("stat"),D,W(";"),E)}function D(t){return y.hasOwnProperty(t)?b(I):"function"==t?b(_):"keyword c"==t?b(H):"("==t?b(T(")"),D,W(")"),E,I):"operator"==t?b(D):"["==t?b(T("]"),U(D,"]"),E,I):"{"==t?b(T("}"),U(P,"}"),E,I):b()}function H(t){return t.match(/[;\}\)\],]/)?M():M(D)}function I(t,e){return"operator"==t&&/\+\+|--/.test(e)?b(I):"operator"==t?b(D):";"!=t?"("==t?b(T(")"),U(D,")"),E,I):"."==t?b(R,I):"["==t?b(T("]"),D,W("]"),E,I):void 0:void 0}function O(t){return":"==t?b(E,N):M(I,W(";"),E)}function R(t){if("variable"==t)return w.marked="property",b()}function P(t){if("variable"==t&&(w.marked="property"),y.hasOwnProperty(t))return b(W(":"),D)}function U(e,n){function r(t){return","==t?b(e,r):t==n?b():b(W(n))}return function(t){return t==n?b():M(e,r)}}function B(t){return"}"==t?b():M(N,B)}function V(t,e){return"variable"==t?(S(e),b(K)):b()}function K(t,e){return"="==e?b(D,K):","==t?b(V):void 0}function F(t){return"var"==t?b(V,G):";"!=t&&"variable"==t?b(j):M(G)}function j(t,e){return"in"==e?b(D):b(I,G)}function G(t,e){return";"==t?b(Y):"in"==e?b(D):b(D,W(";"),Y)}function Y(t){")"!=t&&b(D)}function _(t,e){return"variable"==t?(S(e),b(_)):"("==t?b(T(")"),A,U(q,")"),E,N,z):void 0}function q(t,e){if("variable"==t)return S(e),b()}return E.lex=!0,{startState:function(t){return{tokenize:v,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new k((t||0)-a,0,"block",!1),localVars:null,context:null,indented:0}},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation()),t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==c?n:(e.reAllowed="operator"==c||"keyword c"==c||c.match(/^[\[{}\(,;:]$/),e.kwAllowed="."!=c,function(t,e,n,r,i){var o=t.cc;for(w.state=t,w.stream=i,w.marked=null,w.cc=o,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);;){if((o.length?o.pop():s?D:N)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return w.marked?w.marked:"variable"==n&&C(t,r)?"variable-2":e}}}(e,n,c,h,t))},indent:function(t,e){if(t.tokenize!=v)return 0;var n=e&&e.charAt(0),r=t.lexical,i=r.type,o=n==i;return"vardef"==i?r.indented+4:"form"==i&&"{"==n?r.indented:"stat"==i||"form"==i?r.indented+a:"switch"!=r.info||o?r.align?r.column+(o?0:1):r.indented+(o?0:a):r.indented+(/^(?:case|default)\b/.test(e)?a:2*a)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("css",function(t){var i,r=t.indentUnit;function o(t,e){return i=e,t}function l(t,e){var i,n=t.next();return"@"==n?(t.eatWhile(/[\w\\\-]/),o("meta",t.current())):"/"==n&&t.eat("*")?(e.tokenize=a)(t,e):"<"==n&&t.eat("!")?(e.tokenize=s)(t,e):"="!=n?"~"!=n&&"|"!=n||!t.eat("=")?'"'==n||"'"==n?(e.tokenize=(i=n,function(t,e){for(var n,r=!1;null!=(n=t.next())&&(n!=i||r);)r=!r&&"\\"==n;return r||(e.tokenize=l),o("string","string")}),e.tokenize(t,e)):"#"==n?(t.eatWhile(/[\w\\\-]/),o("atom","hash")):"!"==n?(t.match(/^\s*\w*/),o("keyword","important")):/\d/.test(n)?(t.eatWhile(/[\w.%]/),o("number","unit")):/[,.+>*\/]/.test(n)?o(null,"select-op"):/[;{}:\[\]]/.test(n)?o(null,n):(t.eatWhile(/[\w\\\-]/),o("variable","variable")):o(null,"compare"):void o(null,"compare")}function a(t,e){for(var n,r=!1;null!=(n=t.next());){if(r&&"/"==n){e.tokenize=l;break}r="*"==n}return o("comment","comment")}function s(t,e){for(var n,r=0;null!=(n=t.next());){if(2<=r&&">"==n){e.tokenize=l;break}r="-"==n?r+1:0}return o("comment","comment")}return{startState:function(t){return{tokenize:l,baseIndent:t||0,stack:[]}},token:function(t,e){if(t.eatSpace())return null;var n=e.tokenize(t,e),r=e.stack[e.stack.length-1];return"hash"==i&&"rule"==r?n="atom":"variable"==n&&("rule"==r?n="number":r&&"@media{"!=r||(n="tag")),"rule"==r&&/^[\{\};]$/.test(i)&&e.stack.pop(),"{"==i?"@media"==r?e.stack[e.stack.length-1]="@media{":e.stack.push("{"):"}"==i?e.stack.pop():"@media"==i?e.stack.push("@media"):"{"==r&&"comment"!=i&&e.stack.push("rule"),n},indent:function(t,e){var n=t.stack.length;return/^\}/.test(e)&&(n-="rule"==t.stack[t.stack.length-1]?2:1),t.baseIndent+n*r},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("htmlmixed",function(t,e){var r=CodeMirror.getMode(t,{name:"xml",htmlMode:!0}),i=CodeMirror.getMode(t,"javascript"),o=CodeMirror.getMode(t,"css");function n(t,e){var n=r.token(t,e.htmlState);return"tag"==n&&">"==t.current()&&e.htmlState.context&&(/^script$/i.test(e.htmlState.context.tagName)?(e.token=a,e.localState=i.startState(r.indent(e.htmlState,"")),e.mode="javascript"):/^style$/i.test(e.htmlState.context.tagName)&&(e.token=s,e.localState=o.startState(r.indent(e.htmlState,"")),e.mode="css")),n}function l(t,e,n){var r=t.current(),i=r.search(e);return-1/i,!1)?(e.token=n,e.curState=null,e.mode="html",n(t,e)):l(t,/<\/\s*script\s*>/,i.token(t,e.localState))}function s(t,e){return t.match(/^<\/\s*style\s*>/i,!1)?(e.token=n,e.localState=null,e.mode="html",n(t,e)):l(t,/<\/\s*style\s*>/,o.token(t,e.localState))}return{startState:function(){return{token:n,localState:null,mode:"html",htmlState:r.startState()}},copyState:function(t){if(t.localState)var e=CodeMirror.copyState(t.token==s?o:i,t.localState);return{token:t.token,localState:e,mode:t.mode,htmlState:CodeMirror.copyState(r,t.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(t,e){return t.token==n||/^\s*<\//.test(e)?r.indent(t.htmlState,e):t.token==a?i.indent(t.localState,e):o.indent(t.localState,e)},compareStates:function(t,e){return r.compareStates(t.htmlState,e.htmlState)},electricChars:"/{}:"}}),CodeMirror.defineMIME("text/html","htmlmixed");