// CodeMirror version 2.2
//
// All functions that need access to the editor's state live inside
// the CodeMirror function. Below that, at the bottom of the file,
// some utilities are defined.

// CodeMirror is the only global var we claim
var CodeMirror=function(){function e(r,d){function v(e){return e>=0&&e<Gt.size}function C(e){return m(Gt,e)}function S(e,t){ln=!0
    for(var n=t-e.height,i=e;i;i=i.parent)i.height+=n}function T(e){var t={line:0,ch:0}
    ae(t,{line:Gt.size-1,ch:C(Gt.size-1).text.length},K(e),t,t),tn=!0}function P(e){var t=[]
    return Gt.iter(0,Gt.size,function(e){t.push(e.text)}),t.join("\n")}function H(e){function t(e){var n=pt(e,!0)
    if(n&&!A(n,a)){Xt||oe(),a=n,Le(i,n),tn=!1
    var o=Ue();(n.line>=o.to||n.line<o.from)&&(r=setTimeout(St(function(){t(e)}),150))}}Ae(e.shiftKey)
    for(var n=N(e);n!=Lt;n=n.parentNode)if(n.parentNode==Mt&&n!=Dt)return
    for(var n=N(e);n!=Lt;n=n.parentNode)if(n.parentNode==Pt)return Tt.onGutterClick&&Tt.onGutterClick(Nn,M(Pt.childNodes,n)+pn,e),y(e)
    var i=pt(e)
    switch(w(e)){case 3:return void(q&&!O&&gt(e))
    case 2:return void(i&&_e(i.line,i.ch,!0))}if(!i)return void(N(e)==_t&&y(e))
    Xt||oe()
    var o=+new Date
    if(Qt&&Qt.time>o-400&&A(Qt.pos,i))return y(e),setTimeout(Ce,20),$e(i.line)
    if(Jt&&Jt.time>o-400&&A(Jt.pos,i))return Qt={time:o,pos:i},y(e),ze(i)
    Jt={time:o,pos:i}
    var r,a=i
    if(W&&!A(mn.from,mn.to)&&!L(i,mn.from)&&!L(mn.to,i)){j&&(Ht.draggable=!0)
    var s=U(At,"mouseup",St(function(t){j&&(Ht.draggable=!1),en=!1,s(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(y(t),_e(i.line,i.ch,!0),Ce())}),!0)
    return void(en=!0)}y(e),_e(i.line,i.ch,!0)
    var l=U(At,"mousemove",St(function(e){clearTimeout(r),y(e),t(e)}),!0),s=U(At,"mouseup",St(function(e){clearTimeout(r)
    var t=pt(e)
    t&&Le(i,t),y(e),Ce(),tn=!0,l(),s()}),!0)}function X(e){for(var t=N(e);t!=Lt;t=t.parentNode)if(t.parentNode==Pt)return y(e)
    var n=pt(e)
    n&&(Qt={time:+new Date,pos:n},y(e),ze(n))}function J(e){function t(e,t){var i=new FileReader
    i.onload=function(){r[t]=i.result,++a==o&&(n=De(n),St(function(){var e=ue(r.join(""),n,n)
    Le(n,e)})())},i.readAsText(e)}e.preventDefault()
    var n=pt(e,!0),i=e.dataTransfer.files
    if(n&&!Tt.readOnly)if(i&&i.length&&window.FileReader&&window.File)for(var o=i.length,r=Array(o),a=0,s=0;o>s;++s)t(i[s],s)
    else try{var r=e.dataTransfer.getData("Text")
    if(r){var l=ue(r,n,n),d=mn.from,c=mn.to
    Le(n,l),en&&ue("",d,c),Ce()}}catch(e){}}function Q(e){var t=pe()
    R(t),e.dataTransfer.setDragImage(Y,0,0),e.dataTransfer.setData("Text",t)}function ee(e){var i,o,r=Z[e.keyCode],a=$[Tt.keyMap].auto
    if(null==r||e.altGraphKey)return a&&(Tt.keyMap=a),null
    if(e.altKey&&(r="Alt-"+r),e.ctrlKey&&(r="Ctrl-"+r),e.metaKey&&(r="Cmd-"+r),e.shiftKey&&(i=t("Shift-"+r,Tt.extraKeys,Tt.keyMap))?o=!0:i=t(r,Tt.extraKeys,Tt.keyMap),"string"==typeof i&&(i=z.propertyIsEnumerable(i)?z[i]:null),!a||!i&&n(e)||(Tt.keyMap=a),!i)return!1
    if(o){var s=Zt
    Zt=null,i(Nn),Zt=s}else i(Nn)
    return y(e),!0}function te(e){Xt||oe()
    var t=e.keyCode
    if(V&&27==t&&(e.returnValue=!1),Ae(16==t||e.shiftKey),!Tt.onKeyEvent||!Tt.onKeyEvent(Nn,b(e))){var n=ee(e)
    window.opera&&(wn=n?e.keyCode:null,!n&&(O?e.metaKey:e.ctrlKey)&&88==e.keyCode&&me(""))}}function ne(e){if(window.opera&&e.keyCode==wn)return wn=null,void y(e)
    if((!Tt.onKeyEvent||!Tt.onKeyEvent(Nn,b(e)))&&(!window.opera||e.which||!ee(e))){if(Tt.electricChars&&Vt.electricChars){var t=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode)
    Vt.electricChars.indexOf(t)>-1&&setTimeout(St(function(){qe(mn.to.line,"smart")}),75)}ve()}}function ie(e){Tt.onKeyEvent&&Tt.onKeyEvent(Nn,b(e))||16==e.keyCode&&(Zt=null)}function oe(){Tt.readOnly||(Xt||(Tt.onFocus&&Tt.onFocus(Nn),Xt=!0,-1==Lt.className.search(/\bCodeMirror-focused\b/)&&(Lt.className+=" CodeMirror-focused"),sn||ye(!0)),ge(),vt())}function re(){Xt&&(Tt.onBlur&&Tt.onBlur(Nn),Xt=!1,Lt.className=Lt.className.replace(" CodeMirror-focused","")),clearInterval(qt),setTimeout(function(){Xt||(Zt=null)},150)}function ae(e,t,n,i,o){if(Cn){var r=[]
    for(Gt.iter(e.line,t.line+1,function(e){r.push(e.text)}),Cn.addChange(e.line,n.length,r);Cn.done.length>Tt.undoDepth;)Cn.done.shift()}ce(e,t,n,i,o)}function se(e,t){var n=e.pop()
    if(n){var i=[],o=n.start+n.added
    Gt.iter(n.start,o,function(e){i.push(e.text)}),t.push({start:n.start,added:n.old.length,old:i})
    var r=De({line:n.start+n.old.length-1,ch:_(i[i.length-1],n.old[n.old.length-1])})
    ce({line:n.start,ch:0},{line:o-1,ch:C(o-1).text.length},n.old,r,r),tn=!0}}function le(){se(Cn.done,Cn.undone)}function de(){se(Cn.undone,Cn.done)}function ce(e,t,n,i,o){function r(e){return e<=Math.min(t.line,t.line+b)?e:e+b}var a=!1,s=bn.length
    Tt.lineWrapping||Gt.iter(e.line,t.line,function(e){return e.text.length==s?(a=!0,!0):void 0}),(e.line!=t.line||n.length>1)&&(ln=!0)
    var d=t.line-e.line,c=C(e.line),u=C(t.line)
    if(0==e.ch&&0==t.ch&&""==n[n.length-1]){var m=[],f=null
    e.line?(f=C(e.line-1),f.fixMarkEnds(u)):u.fixMarkStarts()
    for(var h=0,p=n.length-1;p>h;++h)m.push(l.inheritMarks(n[h],f))
    d&&Gt.remove(e.line,d,dn),m.length&&Gt.insert(e.line,m)}else if(c==u)if(1==n.length)c.replace(e.ch,t.ch,n[0])
    else{u=c.split(t.ch,n[n.length-1]),c.replace(e.ch,null,n[0]),c.fixMarkEnds(u)
    for(var m=[],h=1,p=n.length-1;p>h;++h)m.push(l.inheritMarks(n[h],c))
    m.push(u),Gt.insert(e.line+1,m)}else if(1==n.length)c.replace(e.ch,null,n[0]),u.replace(null,t.ch,""),c.append(u),Gt.remove(e.line+1,d,dn)
    else{var m=[]
    c.replace(e.ch,null,n[0]),u.replace(null,t.ch,n[n.length-1]),c.fixMarkEnds(u)
    for(var h=1,p=n.length-1;p>h;++h)m.push(l.inheritMarks(n[h],c))
    d>1&&Gt.remove(e.line+1,d-1,dn),Gt.insert(e.line+1,m)}if(Tt.lineWrapping){var g=_t.clientWidth/mt()-3
    Gt.iter(e.line,e.line+n.length,function(e){if(!e.hidden){var t=Math.ceil(e.text.length/g)||1
    t!=e.height&&S(e,t)}})}else Gt.iter(e.line,h+n.length,function(e){var t=e.text
    t.length>s&&(bn=t,s=t.length,un=null,a=!1)}),a&&(s=0,bn="",un=null,Gt.iter(0,Gt.size,function(e){var t=e.text
    t.length>s&&(s=t.length,bn=t)}))
    for(var v=[],b=n.length-d-1,h=0,y=jt.length;y>h;++h){var x=jt[h]
    x<e.line?v.push(x):x>t.line&&v.push(x+b)}var N=e.line+Math.min(n.length,500)
    xt(e.line,N),v.push(N),jt=v,wt(100),on.push({from:e.line,to:t.line+1,diff:b})
    var w={from:e,to:t,text:n}
    if(rn){for(var U=rn;U.next;U=U.next);U.next=w}else rn=w
    Ie(i,o,r(mn.from.line),r(mn.to.line)),Mt.style.height=Gt.height*ut()+2*ft()+"px"}function ue(e,t,n){function i(i){if(L(i,t))return i
    if(!L(n,i))return o
    var r=i.line+e.length-(n.line-t.line)-1,a=i.ch
    return i.line==n.line&&(a+=e[e.length-1].length-(n.ch-(n.line==t.line?t.ch:0))),{line:r,ch:a}}t=De(t),n=n?De(n):t,e=K(e)
    var o
    return fe(e,t,n,function(e){return o=e,{from:i(mn.from),to:i(mn.to)}}),o}function me(e,t){fe(K(e),mn.from,mn.to,function(e){return"end"==t?{from:e,to:e}:"start"==t?{from:mn.from,to:mn.from}:{from:mn.from,to:e}})}function fe(e,t,n,i){var o=1==e.length?e[0].length+t.ch:e[e.length-1].length,r=i({line:t.line+e.length-1,ch:o})
    ae(t,n,e,r.from,r.to)}function he(e,t){var n=e.line,i=t.line
    if(n==i)return C(n).text.slice(e.ch,t.ch)
    var o=[C(n).text.slice(e.ch)]
    return Gt.iter(n+1,i,function(e){o.push(e.text)}),o.push(C(i).text.slice(0,t.ch)),o.join("\n")}function pe(){return he(mn.from,mn.to)}function ge(){Un||Yt.set(Tt.pollInterval,function(){Ut(),be(),Xt&&ge(),Et()})}function ve(){function e(){Ut()
    var n=be()
    n||t?(Un=!1,ge()):(t=!0,Yt.set(60,e)),Et()}var t=!1
    Un=!0,Yt.set(20,e)}function be(){if(sn||!Xt||G(Rt))return!1
    var e=Rt.value
    if(e==En)return!1
    Zt=null
    for(var t=0,n=Math.min(En.length,e.length);n>t&&En[t]==e[t];)++t
    return t<En.length?mn.from={line:mn.from.line,ch:mn.from.ch-(En.length-t)}:fn&&A(mn.from,mn.to)&&(mn.to={line:mn.to.line,ch:Math.min(C(mn.to.line).text.length,mn.to.ch+(e.length-t))}),me(e.slice(t),"end"),En=e,!0}function ye(e){A(mn.from,mn.to)?e&&(En=Rt.value=""):(En="",Rt.value=pe(),Rt.select())}function Ce(){Tt.readOnly||Rt.focus()}function xe(){if(zt.getBoundingClientRect){var e=zt.getBoundingClientRect()
    if(!V||e.top!=e.bottom){var t=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(e.top<0||e.bottom>t)&&zt.scrollIntoView()}}}function Ne(){var e=lt(mn.inverted?mn.from:mn.to),t=Tt.lineWrapping?Math.min(e.x,Ht.offsetWidth):e.x
    return we(t,e.y,t,e.yBot)}function we(e,t,n,i){var o=ht(),r=ft(),a=ut()
    t+=r,i+=r,e+=o,n+=o
    var s=_t.clientHeight,l=_t.scrollTop,d=!1,c=!0
    l>t?(_t.scrollTop=Math.max(0,t-2*a),d=!0):i>l+s&&(_t.scrollTop=i+a-s,d=!0)
    var u=_t.clientWidth,m=_t.scrollLeft,f=Tt.fixedGutter?Ot.clientWidth:0
    return m+f>e?(50>e&&(e=0),_t.scrollLeft=Math.max(0,e-10-f),d=!0):n>u+m-3&&(_t.scrollLeft=n+10-u,d=!0,n>Mt.clientWidth&&(c=!1)),d&&Tt.onScroll&&Tt.onScroll(Nn),c}function Ue(){var e=ut(),t=_t.scrollTop-ft(),n=Math.max(0,Math.floor(t/e)),i=Math.ceil((t+_t.clientHeight)/e)
    return{from:h(Gt,n),to:h(Gt,i)}}function Ee(e,t){if(!_t.clientWidth)return void(pn=gn=hn=0)
    var n=Ue()
    if(!(e!==!0&&0==e.length&&n.from>=pn&&n.to<=gn)){var i=Math.max(n.from-100,0),o=Math.min(Gt.size,n.to+100)
    i>pn&&20>i-pn&&(i=pn),gn>o&&20>gn-o&&(o=Math.min(Gt.size,gn))
    for(var r=e===!0?[]:Se([{from:pn,to:gn,domStart:0}],e),a=0,s=0;s<r.length;++s){var l=r[s]
    l.from<i&&(l.domStart+=i-l.from,l.from=i),l.to>o&&(l.to=o),l.from>=l.to?r.splice(s--,1):a+=l.to-l.from}if(a!=o-i){r.sort(function(e,t){return e.domStart-t.domStart})
    var d=ut(),c=Ot.style.display
    $t.style.display=Ot.style.display="none",Te(i,o,r),$t.style.display=""
    var u=i!=pn||o!=gn||vn!=_t.clientHeight+d
    if(u&&(vn=_t.clientHeight+d),pn=i,gn=o,hn=p(Gt,i),Dt.style.top=hn*d+"px",Mt.style.height=Gt.height*d+2*ft()+"px",$t.childNodes.length!=gn-pn)throw Error("BAD PATCH! "+JSON.stringify(r)+" size="+(gn-pn)+" nodes="+$t.childNodes.length)
    if(Tt.lineWrapping){un=_t.clientWidth
    var m=$t.firstChild
    Gt.iter(pn,gn,function(e){if(!e.hidden){var t=Math.round(m.offsetHeight/d)||1
    e.height!=t&&(S(e,t),ln=!0)}m=m.nextSibling})}else null==un&&(un=at(bn)),un>_t.clientWidth?(Ht.style.width=un+"px",Mt.style.width="",Mt.style.width=_t.scrollWidth+"px"):Ht.style.width=Mt.style.width=""
    return Ot.style.display=c,(u||ln)&&ke(),Be(),!t&&Tt.onUpdate&&Tt.onUpdate(Nn),!0}}}function Se(e,t){for(var n=0,i=t.length||0;i>n;++n){for(var o=t[n],r=[],a=o.diff||0,s=0,l=e.length;l>s;++s){var d=e[s]
    o.to<=d.from&&o.diff?r.push({from:d.from+a,to:d.to+a,domStart:d.domStart}):o.to<=d.from||o.from>=d.to?r.push(d):(o.from>d.from&&r.push({from:d.from,to:o.from,domStart:d.domStart}),o.to<d.to&&r.push({from:o.to+a,to:d.to+a,domStart:d.domStart+(o.to-d.from)}))}e=r}return e}function Te(e,t,n){function i(e){var t=e.nextSibling
    return e.parentNode.removeChild(e),t}if(n.length){for(var o=0,r=$t.firstChild,a=0;a<n.length;++a){for(var s=n[a];s.domStart>o;)r=i(r),o++
    for(var l=0,d=s.to-s.from;d>l;++l)r=r.nextSibling,o++}for(;r;)r=i(r)}else $t.innerHTML=""
    var c=n.shift(),r=$t.firstChild,l=e,u=mn.from.line,m=mn.to.line,f=e>u&&m>=e,h=At.createElement("div")
    Gt.iter(e,t,function(e){var t=null,i=null
    f?(t=0,m==l&&(f=!1,i=mn.to.ch)):u==l&&(m==l?(t=mn.from.ch,i=mn.to.ch):(f=!0,t=mn.from.ch)),c&&c.to==l&&(c=n.shift()),!c||c.from>l?(e.hidden?h.innerHTML="<pre></pre>":h.innerHTML=e.getHTML(t,i,!0,yn),$t.insertBefore(h.firstChild,r)):r=r.nextSibling,++l})}function ke(){if(Tt.gutter||Tt.lineNumbers){var e=Dt.offsetHeight,t=_t.clientHeight
    Ot.style.height=(2>e-t?t:e)+"px"
    var n=[],i=pn
    Gt.iter(pn,Math.max(gn,pn+1),function(e){if(e.hidden)n.push("<pre></pre>")
    else{var t=e.gutterMarker,o=Tt.lineNumbers?i+Tt.firstLineNumber:null
    t&&t.text?o=t.text.replace("%N%",null!=o?o:""):null==o&&(o=" "),n.push(t&&t.style?'<pre class="'+t.style+'">':"<pre>",o)
    for(var r=1;r<e.height;++r)n.push("<br/>&#160;")
    n.push("</pre>")}++i}),Ot.style.display="none",Pt.innerHTML=n.join("")
    for(var o=(Gt.size+"").length,r=Pt.firstChild,a=B(r),s="";a.length+s.length<o;)s+=" "
    s&&r.insertBefore(At.createTextNode(s),r.firstChild),Ot.style.display="",Ht.style.marginLeft=Ot.offsetWidth+"px",ln=!1}}function Be(){var e=mn.inverted?mn.from:mn.to,t=(ut(),lt(e,!0)),n=k(Lt),i=k($t)
    It.style.top=t.y+i.top-n.top+"px",It.style.left=t.x+i.left-n.left+"px",A(mn.from,mn.to)?(zt.style.top=t.y+"px",zt.style.left=(Tt.lineWrapping?Math.min(t.x,Ht.offsetWidth):t.x)+"px",zt.style.display=""):zt.style.display="none"}function Ae(e){Zt=e?Zt||(mn.inverted?mn.to:mn.from):null}function Le(e,t){var n=Zt&&De(Zt)
    n&&(L(n,e)?e=n:L(t,n)&&(t=n)),Ie(e,t),nn=!0}function Ie(e,t,n,i){if(Sn=null,null==n&&(n=mn.from.line,i=mn.to.line),!A(mn.from,e)||!A(mn.to,t)){if(L(t,e)){var o=t
    t=e,e=o}e.line!=n&&(e=Re(e,n,mn.from.ch)),t.line!=i&&(t=Re(t,i,mn.to.ch)),A(e,t)?mn.inverted=!1:A(e,mn.to)?mn.inverted=!1:A(t,mn.from)&&(mn.inverted=!0),A(e,t)?A(mn.from,mn.to)||on.push({from:n,to:i+1}):A(mn.from,mn.to)?on.push({from:e.line,to:t.line+1}):(A(e,mn.from)||(e.line<n?on.push({from:e.line,to:Math.min(t.line,n)+1}):on.push({from:n,to:Math.min(i,e.line)+1})),A(t,mn.to)||(t.line<i?on.push({from:Math.max(n,e.line),to:i+1}):on.push({from:Math.max(e.line,i),to:t.line+1}))),mn.from=e,mn.to=t,an=!0}}function Re(e,t,n){function i(t){for(var i=e.line+t,o=1==t?Gt.size:-1;i!=o;){var r=C(i)
    if(!r.hidden){var a=e.ch
    return(a>n||a>r.text.length)&&(a=r.text.length),{line:i,ch:a}}i+=t}}var o=C(e.line)
    return o.hidden?e.line>=t?i(1)||i(-1):i(-1)||i(1):e}function _e(e,t,n){var i=De({line:e,ch:t||0});(n?Le:Ie)(i,i)}function Me(e){return Math.max(0,Math.min(e,Gt.size-1))}function De(e){if(e.line<0)return{line:0,ch:0}
    if(e.line>=Gt.size)return{line:Gt.size-1,ch:C(Gt.size-1).text.length}
    var t=e.ch,n=C(e.line).text.length
    return null==t||t>n?{line:e.line,ch:n}:0>t?{line:e.line,ch:0}:e}function Oe(e,t){function n(){for(var t=r+e,n=0>e?-1:Gt.size;t!=n;t+=e){var i=C(t)
    if(!i.hidden)return r=t,s=i,!0}}function i(t){if(a==(0>e?0:s.text.length)){if(t||!n())return!1
    a=0>e?s.text.length:0}else a+=e
    return!0}var o=mn.inverted?mn.from:mn.to,r=o.line,a=o.ch,s=C(r)
    if("char"==t)i()
    else if("column"==t)i(!0)
    else if("word"==t)for(var l=!1;!(0>e)||i();){if(D(s.text.charAt(a)))l=!0
    else if(l){0>e&&(e=1,i())
    break}if(e>0&&!i())break}return{line:r,ch:a}}function Pe(e,t){var n=0>e?mn.from:mn.to;(Zt||A(mn.from,mn.to))&&(n=Oe(e,t)),_e(n.line,n.ch,!0)}function He(e,t){A(mn.from,mn.to)?0>e?ue("",Oe(e,t),mn.to):ue("",mn.from,Oe(e,t)):ue("",mn.from,mn.to),nn=!0}function Fe(e,t){var n=0,i=lt(mn.inverted?mn.from:mn.to,!0)
    null!=Sn&&(i.x=Sn),"page"==t?n=_t.clientHeight:"line"==t&&(n=ut())
    var o=dt(i.x,i.y+n*e+2)
    _e(o.line,o.ch,!0),Sn=i.x}function ze(e){for(var t=C(e.line).text,n=e.ch,i=e.ch;n>0&&D(t.charAt(n-1));)--n
    for(;i<t.length&&D(t.charAt(i));)++i
    Le({line:e.line,ch:n},{line:e.line,ch:i})}function $e(e){Le({line:e,ch:0},{line:e,ch:C(e).text.length})}function We(e){if(A(mn.from,mn.to))return qe(mn.from.line,e)
    for(var t=mn.to.line-(mn.to.ch?0:1),n=mn.from.line;t>=n;++n)qe(n,e)}function qe(e,t){if(t||(t="add"),"smart"==t)if(Vt.indent)var n=Ct(e)
    else t="prev"
    var i,o=C(e),r=o.indentation(Tt.tabSize),a=o.text.match(/^\s*/)[0]
    "prev"==t?i=e?C(e-1).indentation(Tt.tabSize):0:"smart"==t?i=Vt.indent(n,o.text.slice(a.length),o.text):"add"==t?i=r+Tt.indentUnit:"subtract"==t&&(i=r-Tt.indentUnit),i=Math.max(0,i)
    var s=i-r
    if(s){var l="",d=0
    if(Tt.indentWithTabs)for(var c=Math.floor(i/Tt.tabSize);c;--c)d+=Tt.tabSize,l+="	"
    for(;i>d;)++d,l+=" "}else{if(mn.from.line!=e&&mn.to.line!=e)return
    var l=a}ue(l,{line:e,ch:0},{line:e,ch:a.length})}function Ve(){Vt=e.getMode(Tt,Tt.mode),Gt.iter(0,Gt.size,function(e){e.stateAfter=null}),jt=[0],wt()}function je(){var e=Tt.gutter||Tt.lineNumbers
    Ot.style.display=e?"":"none",e?ln=!0:$t.parentNode.style.marginLeft=0}function Xe(e,t){if(Tt.lineWrapping){Lt.className+=" CodeMirror-wrap"
    var n=_t.clientWidth/mt()-3
    Gt.iter(0,Gt.size,function(e){if(!e.hidden){var t=Math.ceil(e.text.length/n)||1
    1!=t&&S(e,t)}}),Ht.style.width=Mt.style.width=""}else Lt.className=Lt.className.replace(" CodeMirror-wrap",""),un=null,bn="",Gt.iter(0,Gt.size,function(e){1==e.height||e.hidden||S(e,1),e.text.length>bn.length&&(bn=e.text)})
    on.push({from:0,to:Gt.size})}function Ye(){for(var e='<span class="cm-tab">',t=0;t<Tt.tabSize;++t)e+=" "
    return e+"</span>"}function Ke(){yn=Ye(),Ee(!0)}function Ge(){_t.className=_t.className.replace(/\s*cm-s-\w+/g,"")+Tt.theme.replace(/(^|\s)\s*/g," cm-s-")}function Ze(){this.set=[]}function Je(e,t,n){function i(e,t,n,i){C(e).addMark(new a(t,n,i,o.set))}e=De(e),t=De(t)
    var o=new Ze
    if(e.line==t.line)i(e.line,e.ch,t.ch,n)
    else{i(e.line,e.ch,null,n)
    for(var r=e.line+1,s=t.line;s>r;++r)i(r,null,null,n)
    i(t.line,null,t.ch,n)}return on.push({from:e.line,to:t.line+1}),o}function Qe(e){e=De(e)
    var t=new s(e.ch)
    return C(e.line).addMark(t),t}function et(e,t,n){return"number"==typeof e&&(e=C(Me(e))),e.gutterMarker={text:t,style:n},ln=!0,e}function tt(e){"number"==typeof e&&(e=C(Me(e))),e.gutterMarker=null,ln=!0}function nt(e,t){var n=e,i=e
    return"number"==typeof e?i=C(Me(e)):n=f(e),null==n?null:t(i,n)?(on.push({from:n,to:n+1}),i):null}function it(e,t){return nt(e,function(e){return e.className!=t?(e.className=t,!0):void 0})}function ot(e,t){return nt(e,function(e,n){return e.hidden!=t?(e.hidden=t,S(e,t?0:1),!t||mn.from.line!=n&&mn.to.line!=n||Ie(Re(mn.from,mn.from.line,mn.from.ch),Re(mn.to,mn.to.line,mn.to.ch)),ln=!0):void 0})}function rt(e){if("number"==typeof e){if(!v(e))return null
    var t=e
    if(e=C(e),!e)return null}else{var t=f(e)
    if(null==t)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}}function at(e){return Ft.innerHTML="<pre><span>x</span></pre>",Ft.firstChild.firstChild.firstChild.nodeValue=e,Ft.firstChild.firstChild.offsetWidth||10}function st(e,t){var n=""
    if(Tt.lineWrapping){var i=e.text.indexOf(" ",t+2)
    n=R(e.text.slice(t+1,0>i?e.text.length:i+(V?5:0)))}Ft.innerHTML="<pre>"+e.getHTML(null,null,!1,yn,t)+'<span id="CodeMirror-temp-'+Ln+'">'+R(e.text.charAt(t)||" ")+"</span>"+n+"</pre>"
    var o=document.getElementById("CodeMirror-temp-"+Ln),r=o.offsetTop,a=o.offsetLeft
    if(V&&t&&0==r&&0==a){var s=document.createElement("span")
    s.innerHTML="x",o.parentNode.insertBefore(s,o.nextSibling),r=s.offsetTop}return{top:r,left:a}}function lt(e,t){var n,i=ut(),o=i*(p(Gt,e.line)-(t?hn:0))
    if(0==e.ch)n=0
    else{var r=st(C(e.line),e.ch)
    n=r.left,Tt.lineWrapping&&(o+=Math.max(0,r.top))}return{x:n,y:o,yBot:o+i}}function dt(e,t){function n(e){var t=st(s,e)
    if(d){var n=Math.round(t.top/i)
    return Math.max(0,t.left+(n-c)*_t.clientWidth)}return t.left}0>t&&(t=0)
    var i=ut(),o=mt(),r=hn+Math.floor(t/i),a=h(Gt,r)
    if(a>=Gt.size)return{line:Gt.size-1,ch:C(Gt.size-1).text.length}
    var s=C(a),l=s.text,d=Tt.lineWrapping,c=d?r-p(Gt,a):0
    if(0>=e&&0==c)return{line:a,ch:0}
    for(var u,m=0,f=0,g=l.length,v=Math.min(g,Math.ceil((e+c*_t.clientWidth*.9)/o));;){var b=n(v)
    if(!(e>=b&&g>v)){u=b,g=v
    break}v=Math.min(g,Math.ceil(1.2*v))}if(e>u)return{line:a,ch:g}
    for(v=Math.floor(.8*g),b=n(v),e>b&&(m=v,f=b);;){if(1>=g-m)return{line:a,ch:u-e>e-f?m:g}
    var y=Math.ceil((m+g)/2),x=n(y)
    x>e?(g=y,u=x):(m=y,f=x)}}function ct(e){var t=lt(e,!0),n=k(Ht)
    return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function ut(){if(null==Bn){Bn="<pre>"
    for(var e=0;49>e;++e)Bn+="x<br/>"
    Bn+="x</pre>"}var t=$t.clientHeight
    return t==kn?Tn:(kn=t,Ft.innerHTML=Bn,Tn=Ft.firstChild.offsetHeight/50||1,Ft.innerHTML="",Tn)}function mt(){return _t.clientWidth==In?An:(In=_t.clientWidth,An=at("x"))}function ft(){return Ht.offsetTop}function ht(){return Ht.offsetLeft}function pt(e,t){var n,i,o=k(_t,!0)
    try{n=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(n-o.left>_t.clientWidth||i-o.top>_t.clientHeight))return null
    var r=k(Ht,!0)
    return dt(n-r.left,i-r.top)}function gt(e){function t(){var e=K(Rt.value).join("\n")
    e!=o&&St(me)(e,"end"),It.style.position="relative",Rt.style.cssText=i,sn=!1,ye(!0),ge()}var n=pt(e)
    if(n&&!window.opera){(A(mn.from,mn.to)||L(n,mn.from)||!L(n,mn.to))&&St(_e)(n.line,n.ch)
    var i=Rt.style.cssText
    It.style.position="absolute",Rt.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);",sn=!0
    var o=Rt.value=pe()
    if(Ce(),Rt.select(),q){x(e)
    var r=U(window,"mouseup",function(){r(),setTimeout(t,20)},!0)}else setTimeout(t,50)}}function vt(){clearInterval(qt)
    var e=!0
    zt.style.visibility="",qt=setInterval(function(){zt.style.visibility=(e=!e)?"":"hidden"},650)}function bt(e){function t(e,t,n){if(e.text)for(var i,o=e.styles,r=a?0:e.text.length-1,l=a?0:o.length-2,d=a?o.length:-2;l!=d;l+=2*s){var c=o[l]
    if(null==o[l+1]||o[l+1]==m){for(var u=a?0:c.length-1,p=a?c.length:-1;u!=p;u+=s,r+=s)if(r>=t&&n>r&&h.test(i=c.charAt(u))){var g=Rn[i]
    if(">"==g.charAt(1)==a)f.push(i)
    else{if(f.pop()!=g.charAt(0))return{pos:r,match:!1}
    if(!f.length)return{pos:r,match:!0}}}}else r+=s*c.length}}var n=mn.inverted?mn.from:mn.to,i=C(n.line),o=n.ch-1,r=o>=0&&Rn[i.text.charAt(o)]||Rn[i.text.charAt(++o)]
    if(r){for(var a=(r.charAt(0),">"==r.charAt(1)),s=a?1:-1,l=i.styles,d=o+1,c=0,u=l.length;u>c;c+=2)if((d-=l[c].length)<=0){var m=l[c+1]
    break}for(var f=[i.text.charAt(o)],h=/[(){}[\]]/,c=n.line,u=a?Math.min(c+100,Gt.size):Math.max(-1,c-100);c!=u;c+=s){var i=C(c),p=c==n.line,g=t(i,p&&a?o+1:0,p&&!a?o:i.text.length)
    if(g)break}g||(g={pos:null,match:!1})
    var m=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",v=Je({line:n.line,ch:o},{line:n.line,ch:o+1},m),b=null!=g.pos&&Je({line:c,ch:g.pos},{line:c,ch:g.pos+1},m),y=St(function(){v.clear(),b&&b.clear()})
    e?setTimeout(y,800):cn=y}}function yt(e){for(var t,n,i=e,o=e-40;i>o;--i){if(0==i)return 0
    var r=C(i-1)
    if(r.stateAfter)return i
    var a=r.indentation(Tt.tabSize);(null==n||t>a)&&(n=i-1,t=a)}return n}function Ct(e){var t=yt(e),n=t&&C(t-1).stateAfter
    return n=n?i(Vt,n):o(Vt),Gt.iter(t,e,function(e){e.highlight(Vt,n,Tt.tabSize),e.stateAfter=i(Vt,n)}),e>t&&on.push({from:t,to:e}),e<Gt.size&&!C(e).stateAfter&&jt.push(e),n}function xt(e,t){var n=Ct(e)
    Gt.iter(e,t,function(e){e.highlight(Vt,n,Tt.tabSize),e.stateAfter=i(Vt,n)})}function Nt(){for(var e=+new Date+Tt.workTime,t=jt.length;jt.length;){if(C(pn).stateAfter)var n=jt.pop()
    else var n=pn
    if(!(n>=Gt.size)){var r=yt(n),a=r&&C(r-1).stateAfter
    a=a?i(Vt,a):o(Vt)
    var s=0,l=Vt.compareStates,d=!1,c=r,u=!1
    if(Gt.iter(c,Gt.size,function(t){var o=t.stateAfter
    if(+new Date>e)return jt.push(c),wt(Tt.workDelay),d&&on.push({from:n,to:c+1}),u=!0
    var r=t.highlight(Vt,a,Tt.tabSize)
    if(r&&(d=!0),t.stateAfter=i(Vt,a),l){if(o&&l(o,a))return!0}else if(r===!1&&o){if(++s>3&&(!Vt.indent||Vt.indent(o,"")==Vt.indent(a,"")))return!0}else s=0;++c}),u)return
    d&&on.push({from:n,to:c+1})}}t&&Tt.onHighlightComplete&&Tt.onHighlightComplete(Nn)}function wt(e){jt.length&&Kt.set(e,St(Nt))}function Ut(){tn=nn=rn=null,on=[],an=!1,dn=[]}function Et(){var e,t=!1
    an&&(t=!Ne()),on.length?e=Ee(on,!0):(an&&Be(),ln&&ke()),t&&Ne(),an&&(xe(),vt()),Xt&&!sn&&(tn===!0||tn!==!1&&an)&&ye(nn),an&&Tt.matchBrackets&&setTimeout(St(function(){cn&&(cn(),cn=null),A(mn.from,mn.to)&&bt(!1)}),20)
    var n=rn,i=dn
    an&&Tt.onCursorActivity&&Tt.onCursorActivity(Nn),n&&Tt.onChange&&Nn&&Tt.onChange(Nn,n)
    for(var o=0;o<i.length;++o)i[o](Nn)
    e&&Tt.onUpdate&&Tt.onUpdate(Nn)}function St(e){return function(){_n++||Ut()
    try{var t=e.apply(this,arguments)}finally{--_n||Et()}return t}}var Tt={},kt=e.defaults
    for(var Bt in kt)kt.hasOwnProperty(Bt)&&(Tt[Bt]=(d&&d.hasOwnProperty(Bt)?d:kt)[Bt])
    var At=Tt.document,Lt=At.createElement("div")
    Lt.className="CodeMirror"+(Tt.lineWrapping?" CodeMirror-wrap":""),Lt.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px;" 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"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden"></div><pre class="CodeMirror-cursor">&#160;</pre><div></div></div></div></div></div></div>',r.appendChild?r.appendChild(Lt):r(Lt)
    var It=Lt.firstChild,Rt=It.firstChild,_t=Lt.lastChild,Mt=_t.firstChild,Dt=Mt.firstChild,Ot=Dt.firstChild,Pt=Ot.firstChild,Ht=Ot.nextSibling.firstChild,Ft=Ht.firstChild,zt=Ft.nextSibling,$t=zt.nextSibling
    Ge(),/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)&&(Rt.style.width="0px"),j||(Ht.draggable=!0),null!=Tt.tabindex&&(Rt.tabIndex=Tt.tabindex),Tt.gutter||Tt.lineNumbers||(Ot.style.display="none")
    try{at("x")}catch(Wt){throw Wt.message.match(/runtime/i)&&(Wt=Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),Wt}var qt,Vt,jt,Xt,Yt=new E,Kt=new E,Gt=new u([new c([new l("")])])
    Ve()
    var Zt,Jt,Qt,en,tn,nn,on,rn,an,sn,ln,dn,cn,un,mn={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},fn=!1,hn=0,pn=0,gn=0,vn=0,bn="",yn=Ye()
    St(function(){T(Tt.value||""),tn=!1})()
    var Cn=new g
    U(_t,"mousedown",St(H)),U(_t,"dblclick",St(X)),U(Ht,"dragstart",Q),U(Ht,"selectstart",y),q||U(_t,"contextmenu",gt),U(_t,"scroll",function(){Ee([]),Tt.fixedGutter&&(Ot.style.left=_t.scrollLeft+"px"),Tt.onScroll&&Tt.onScroll(Nn)}),U(window,"resize",function(){Ee(!0)}),U(Rt,"keyup",St(ie)),U(Rt,"input",ve),U(Rt,"keydown",St(te)),U(Rt,"keypress",St(ne)),U(Rt,"focus",oe),U(Rt,"blur",re),U(_t,"dragenter",x),U(_t,"dragover",x),U(_t,"drop",St(J)),U(_t,"paste",function(){Ce(),ve()}),U(Rt,"paste",ve),U(Rt,"cut",St(function(){me("")}))
    var xn
    try{xn=At.activeElement==Rt}catch(Wt){}xn?setTimeout(oe,20):re()
    var Nn=Lt.CodeMirror={getValue:P,setValue:St(T),getSelection:pe,replaceSelection:St(me),focus:function(){Ce(),oe(),ve()},setOption:function(e,t){var n=Tt[e]
    Tt[e]=t,"mode"==e||"indentUnit"==e?Ve():"readOnly"==e&&t?(re(),Rt.blur()):"theme"==e?Ge():"lineWrapping"==e&&n!=t?St(Xe)():"tabSize"==e&&St(Ke)(),("lineNumbers"==e||"gutter"==e||"firstLineNumber"==e||"theme"==e)&&St(je)()},getOption:function(e){return Tt[e]},undo:St(le),redo:St(de),indentLine:St(function(e,t){v(e)&&qe(e,null==t?"smart":t?"add":"subtract")}),indentSelection:St(We),historySize:function(){return{undo:Cn.done.length,redo:Cn.undone.length}},clearHistory:function(){Cn=new g},matchBrackets:St(function(){bt(!0)}),getTokenAt:St(function(e){return e=De(e),C(e.line).getTokenAt(Vt,Ct(e.line),e.ch)}),getStateAfter:function(e){return e=Me(null==e?Gt.size-1:e),Ct(e+1)},cursorCoords:function(e){return null==e&&(e=mn.inverted),ct(e?mn.from:mn.to)},charCoords:function(e){return ct(De(e))},coordsChar:function(e){var t=k(Ht)
    return dt(e.x-t.left,e.y-t.top)},markText:St(Je),setBookmark:Qe,setMarker:St(et),clearMarker:St(tt),setLineClass:St(it),hideLine:St(function(e){return ot(e,!0)}),showLine:St(function(e){return ot(e,!1)}),onDeleteLine:function(e,t){if("number"==typeof e){if(!v(e))return null
    e=C(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:rt,addWidget:function(e,t,n,i,o){e=lt(De(e))
    var r=e.yBot,a=e.x
    if(t.style.position="absolute",Mt.appendChild(t),"over"==i)r=e.y
    else if("near"==i){var s=Math.max(_t.offsetHeight,Gt.height*ut()),l=Math.max(Mt.clientWidth,Ht.clientWidth)-ht()
    e.yBot+t.offsetHeight>s&&e.y>t.offsetHeight&&(r=e.y-t.offsetHeight),a+t.offsetWidth>l&&(a=l-t.offsetWidth)}t.style.top=r+ft()+"px",t.style.left=t.style.right="","right"==o?(a=Mt.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?a=0:"middle"==o&&(a=(Mt.clientWidth-t.offsetWidth)/2),t.style.left=a+ht()+"px"),n&&we(a,r,a+t.offsetWidth,r+t.offsetHeight)},lineCount:function(){return Gt.size},clipPos:De,getCursor:function(e){return null==e&&(e=mn.inverted),I(e?mn.from:mn.to)},somethingSelected:function(){return!A(mn.from,mn.to)},setCursor:St(function(e,t,n){null==t&&"number"==typeof e.line?_e(e.line,e.ch,n):_e(e,t,n)}),setSelection:St(function(e,t,n){(n?Le:Ie)(De(e),De(t||e))}),getLine:function(e){return v(e)?C(e).text:void 0},getLineHandle:function(e){return v(e)?C(e):void 0},setLine:St(function(e,t){v(e)&&ue(t,{line:e,ch:0},{line:e,ch:C(e).text.length})}),removeLine:St(function(e){v(e)&&ue("",{line:e,ch:0},De({line:e+1,ch:0}))}),replaceRange:St(ue),getRange:function(e,t){return he(De(e),De(t))},execCommand:function(e){return z[e](Nn)},moveH:St(Pe),deleteH:St(He),moveV:St(Fe),toggleOverwrite:function(){fn=!fn},posFromIndex:function(e){var t,n=0
    return Gt.iter(0,Gt.size,function(i){var o=i.text.length+1
    return o>e?(t=e,!0):(e-=o,void++n)}),De({line:n,ch:t})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0
    var t=e.ch
    return Gt.iter(0,e.line,function(e){t+=e.text.length+1}),t},operation:function(e){return St(e)()},refresh:function(){Ee(!0)},getInputField:function(){return Rt},getWrapperElement:function(){return Lt},getScrollerElement:function(){return _t},getGutterElement:function(){return Ot}},wn=null,Un=!1,En="",Sn=null
    Ze.prototype.clear=St(function(){for(var e=1/0,t=-(1/0),n=0,i=this.set.length;i>n;++n){var o=this.set[n],r=o.marked
    if(r&&o.parent){var a=f(o)
    e=Math.min(e,a),t=Math.max(t,a)
    for(var s=0;s<r.length;++s)r[s].set==this.set&&r.splice(s--,1)}}e!=1/0&&on.push({from:e,to:t+1})}),Ze.prototype.find=function(){for(var e,t,n=0,i=this.set.length;i>n;++n)for(var o=this.set[n],r=o.marked,a=0;a<r.length;++a){var s=r[a]
    if(s.set==this.set&&(null!=s.from||null!=s.to)){var l=f(o)
    null!=l&&(null!=s.from&&(e={line:l,ch:s.from}),null!=s.to&&(t={line:l,ch:s.to}))}}return{from:e,to:t}}
    var Tn,kn,Bn,An,Ln=Math.floor(16777215*Math.random()).toString(16),In=0,Rn={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},_n=0
    for(var Mn in F)F.propertyIsEnumerable(Mn)&&!Nn.propertyIsEnumerable(Mn)&&(Nn[Mn]=F[Mn])
    return Nn}function t(e,t,n){function i(e,t,n){var o=t[e]
    if(null!=o)return o
    if(null==n&&(n=t.fallthrough),null==n)return t.catchall
    if("string"==typeof n)return i(e,$[n])
    for(var r=0,a=n.length;a>r;++r)if(o=i(e,$[n[r]]),null!=o)return o
    return null}return t?i(e,t,n):i(e,$[n])}function n(e){var t=Z[e.keyCode]
    return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function i(e,t){if(t===!0)return t
    if(e.copyState)return e.copyState(t)
    var n={}
    for(var i in t){var o=t[i]
    o instanceof Array&&(o=o.concat([])),n[i]=o}return n}function o(e,t,n){return e.startState?e.startState(t,n):!0}function r(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function a(e,t,n,i){this.from=e,this.to=t,this.style=n,this.set=i}function s(e){this.from=e,this.to=e,this.line=null}function l(e,t){this.styles=t||[e,null],this.text=e,this.height=1,this.marked=this.gutterMarker=this.className=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function d(e,t,n,i){for(var o=0,r=0,a=0;t>r;o+=2){var s=n[o],l=r+s.length
    0==a?(l>e&&i.push(s.slice(e-r,Math.min(s.length,t-r)),n[o+1]),l>=e&&(a=1)):1==a&&(l>t?i.push(s.slice(0,t-r),n[o+1]):i.push(s,n[o+1])),r=l}}function c(e){this.lines=e,this.parent=null
    for(var t=0,n=e.length,i=0;n>t;++t)e[t].parent=this,i+=e[t].height
    this.height=i}function u(e){this.children=e
    for(var t=0,n=0,i=0,o=e.length;o>i;++i){var r=e[i]
    t+=r.chunkSize(),n+=r.height,r.parent=this}this.size=t,this.height=n,this.parent=null}function m(e,t){for(;!e.lines;)for(var n=0;;++n){var i=e.children[n],o=i.chunkSize()
    if(o>t){e=i
    break}t-=o}return e.lines[t]}function f(e){if(null==e.parent)return null
    for(var t=e.parent,n=M(t.lines,e),i=t.parent;i;t=i,i=i.parent){var o=0
    for(i.children.length;i.children[o]!=t;++o)n+=i.children[o].chunkSize()}return n}function h(e,t){var n=0
    e:do{for(var i=0,o=e.children.length;o>i;++i){var r=e.children[i],a=r.height
    if(a>t){e=r
    continue e}t-=a,n+=r.chunkSize()}return n}while(!e.lines)
    for(var i=0,o=e.lines.length;o>i;++i){var s=e.lines[i],l=s.height
    if(l>t)break
    t-=l}return n+i}function p(e,t){var n=0
    e:do{for(var i=0,o=e.children.length;o>i;++i){var r=e.children[i],a=r.chunkSize()
    if(a>t){e=r
    continue e}t-=a,n+=r.height}return n}while(!e.lines)
    for(var i=0;t>i;++i)n+=e.lines[i].height
    return n}function g(){this.time=0,this.done=[],this.undone=[]}function v(){x(this)}function b(e){return e.stop||(e.stop=v),e}function y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function C(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function x(e){y(e),C(e)}function N(e){return e.target||e.srcElement}function w(e){return e.which?e.which:1&e.button?1:2&e.button?3:4&e.button?2:void 0}function U(e,t,n,i){if("function"==typeof e.addEventListener){if(e.addEventListener(t,n,!1),i)return function(){e.removeEventListener(t,n,!1)}}else{var o=function(e){n(e||window.event)}
    if(e.attachEvent("on"+t,o),i)return function(){e.detachEvent("on"+t,o)}}}function E(){this.id=null}function S(e,t,n){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length))
    for(var i=0,o=0;t>i;++i)"	"==e.charAt(i)?o+=n-o%n:++o
    return o}function T(e){return e.currentStyle?e.currentStyle:window.getComputedStyle(e,null)}function k(e,t){for(var n=e.ownerDocument.body,i=0,o=0,r=!1,a=e;a;a=a.offsetParent){var s=a.offsetLeft,l=a.offsetTop
    a==n?(i+=Math.abs(s),o+=Math.abs(l)):(i+=s,o+=l),t&&"fixed"==T(a).position&&(r=!0)}for(var d=t&&!r?null:n,a=e.parentNode;a!=d;a=a.parentNode)null!=a.scrollLeft&&(i-=a.scrollLeft,o-=a.scrollTop)
    return{left:i,top:o}}function B(e){return e.textContent||e.innerText||e.nodeValue||""}function A(e,t){return e.line==t.line&&e.ch==t.ch}function L(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function I(e){return{line:e.line,ch:e.ch}}function R(e){return Y.textContent=e,Y.innerHTML}function _(e,t){if(!t)return e?e.length:0
    if(!e)return t.length
    for(var n=e.length,i=t.length;n>=0&&i>=0&&e.charAt(n)==t.charAt(i);--n,--i);return i+1}function M(e,t){if(e.indexOf)return e.indexOf(t)
    for(var n=0,i=e.length;i>n;++n)if(e[n]==t)return n
    return-1}function D(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()}e.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,onKeyEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,document:window.document}
    var O=/Mac/.test(navigator.platform),P=(/Win/.test(navigator.platform),{}),H={}
    e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),P[t]=n},e.defineMIME=function(e,t){H[e]=t},e.getMode=function(t,n){if("string"==typeof n&&H.hasOwnProperty(n)&&(n=H[n]),"string"==typeof n)var i=n,o={}
    else if(null!=n)var i=n.name,o=n
    var r=P[i]
    return r?r(t,o||{}):(window.console&&console.warn("No mode "+i+" found, falling back to plain text."),e.getMode(t,"text/plain"))},e.listModes=function(){var e=[]
    for(var t in P)P.propertyIsEnumerable(t)&&e.push(t)
    return e},e.listMIMEs=function(){var e=[]
    for(var t in H)H.propertyIsEnumerable(t)&&e.push({mime:t,mode:H[t]})
    return e}
    var F=e.extensions={}
    e.defineExtension=function(e,t){F[e]=t}
    var z=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),i=!A(t,n)
    i||e.getLine(t.line).length!=t.ch?e.replaceRange("",t,i?n:{line:t.line}):e.replaceRange("",t,{line:t.line+1,ch:0})},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),i=Math.max(0,n.search(/\S/))
    e.setCursor(t.line,t.ch<=i&&t.ch?0:i,!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")},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()}},$=e.keyMap={}
    $.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"indentMore","Shift-Tab":"indentLess",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},$.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll",fallthrough:"basic"},$.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll",fallthrough:["basic","emacsy"]},$["default"]=O?$.macDefault:$.pcDefault,$.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 i(){t.value=s.getValue()}function o(){i(),t.form.submit=a,t.form.submit(),t.form.submit=o}if(n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex),t.form){var r=U(t.form,"submit",i,!0)
    if("function"==typeof t.form.submit){var a=t.form.submit
    t.form.submit=o}}t.style.display="none"
    var s=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n)
    return s.save=i,s.getTextArea=function(){return t},s.toTextArea=function(){i(),t.parentNode.removeChild(s.getWrapperElement()),t.style.display="",t.form&&(r(),"function"==typeof t.form.submit&&(t.form.submit=a))},s},e.copyState=i,e.startState=o,r.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos)
    if("string"==typeof e)var n=t==e
    else var n=t&&(e.test?e.test(t):e(t))
    return n?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\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)
    return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return S(this.string,this.start,this.tabSize)},indentation:function(){return S(this.string,null,this.tabSize)},match:function(e,t,n){function i(e){return n?e.toLowerCase():e}if("string"!=typeof e){var o=this.string.slice(this.pos).match(e)
    return o&&t!==!1&&(this.pos+=o[0].length),o}return i(this.string).indexOf(i(e),this.pos)==this.pos?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=r,a.prototype={attach:function(e){this.set.push(e)},detach:function(e){var t=M(this.set,e)
    t>-1&&this.set.splice(t,1)},split:function(e,t){if(this.to<=e&&null!=this.to)return null
    var n=this.from<e||null==this.from?null:this.from-e+t,i=null==this.to?null:this.to-e+t
    return new a(n,i,this.style,this.set)},dup:function(){return new a(null,null,this.style,this.set)},clipTo:function(e,t,n,i,o){null!=this.from&&this.from>=t&&(this.from=Math.max(i,this.from)+o),null!=this.to&&this.to>t&&(this.to=i<this.to?this.to+o:t),e&&i>this.from&&(i<this.to||null==this.to)&&(this.from=null),n&&(t<this.to||null==this.to)&&(t>this.from||null==this.from)&&(this.to=null)},isDead:function(){return null!=this.from&&null!=this.to&&this.from>=this.to},sameSet:function(e){return this.set==e.set}},s.prototype={attach:function(e){this.line=e},detach:function(e){this.line==e&&(this.line=null)},split:function(e,t){return e<this.from?(this.from=this.to=this.from-e+t,this):void 0},isDead:function(){return this.from>this.to},clipTo:function(e,t,n,i,o){(e||t<this.from)&&(n||i>this.to)?(this.from=0,this.to=-1):this.from>t&&(this.from=this.to=Math.max(i,this.from)+o)},sameSet:function(e){return!1},find:function(){return this.line&&this.line.parent?{line:f(this.line),ch:this.from}:null},clear:function(){if(this.line){var e=M(this.line.marked,this);-1!=e&&this.line.marked.splice(e,1),this.line=null}}},l.inheritMarks=function(e,t){var n=new l(e),i=t&&t.marked
    if(i)for(var o=0;o<i.length;++o)if(null==i[o].to&&i[o].style){var r=n.marked||(n.marked=[]),a=i[o],s=a.dup()
    r.push(s),s.attach(n)}return n},l.prototype={replace:function(e,t,n){var i=[],o=this.marked,r=null==t?this.text.length:t
    if(d(0,e,this.styles,i),n&&i.push(n,null),d(r,this.text.length,this.styles,i),this.styles=i,this.text=this.text.slice(0,e)+n+this.text.slice(r),this.stateAfter=null,o)for(var a=n.length-(r-e),s=0,l=o[s];s<o.length;++s)l.clipTo(null==e,e||0,null==t,r,a),l.isDead()&&(l.detach(this),o.splice(s--,1))},split:function(e,t){var n=[t,null],i=this.marked
    d(e,this.text.length,this.styles,n)
    var o=new l(t+this.text.slice(e),n)
    if(i)for(var r=0;r<i.length;++r){var a=i[r],s=a.split(e,t.length)
    s&&(o.marked||(o.marked=[]),o.marked.push(s),s.attach(o))}return o},append:function(e){var t=this.text.length,n=e.marked,i=this.marked
    if(this.text+=e.text,d(0,e.text.length,e.styles,this.styles),i)for(var o=0;o<i.length;++o)null==i[o].to&&(i[o].to=t)
    if(n&&n.length){i||(this.marked=i=[])
    e:for(var o=0;o<n.length;++o){var r=n[o]
    if(!r.from)for(var a=0;a<i.length;++a){var s=i[a]
    if(s.to==t&&s.sameSet(r)){s.to=null==r.to?null:r.to+t,s.isDead()&&(s.detach(this),n.splice(o--,1))
    continue e}}i.push(r),r.attach(this),r.from+=t,null!=r.to&&(r.to+=t)}}},fixMarkEnds:function(e){var t=this.marked,n=e.marked
    if(t)for(var i=0;i<t.length;++i){var o=t[i],r=null==o.to
    if(r&&n)for(var a=0;a<n.length;++a)if(n[a].sameSet(o)){r=!1
    break}r&&(o.to=this.text.length)}},fixMarkStarts:function(){var e=this.marked
    if(e)for(var t=0;t<e.length;++t)null==e[t].from&&(e[t].from=0)},addMark:function(e){e.attach(this),null==this.marked&&(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 i,o=new r(this.text,n),a=this.styles,s=0,l=!1,d=a[0]
    for(""==this.text&&e.blankLine&&e.blankLine(t);!o.eol();){var c=e.token(o,t),u=this.text.slice(o.start,o.pos)
    if(o.start=o.pos,s&&a[s-1]==c?a[s-2]+=u:u&&(!l&&(a[s+1]!=c||s&&a[s-2]!=i)&&(l=!0),a[s++]=u,a[s++]=c,i=d,d=a[s]),o.pos>5e3){a[s++]=this.text.slice(o.pos),a[s++]=null
    break}}return a.length!=s&&(a.length=s,l=!0),s&&a[s-2]!=i&&(l=!0),l||(a.length<5&&this.text.length<10?null:!1)},getTokenAt:function(e,t,n){for(var i=this.text,o=new r(i);o.pos<n&&!o.eol();){o.start=o.pos
    var a=e.token(o,t)}return{start:o.start,end:o.pos,string:o.current(),className:a||null,state:t}},indentation:function(e){return S(this.text,null,e)},getHTML:function(e,t,n,i,o){function r(e,t){e&&(l&&V&&" "==e.charAt(0)&&(e=" "+e.slice(1)),l=!1,t?s.push('<span class="',t,'">',R(e).replace(/\t/g,i),"</span>"):s.push(R(e).replace(/\t/g,i)))}function a(){u&&(v+=1,b=v<u.length?u[v]:null)}var s=[],l=!0
    n&&s.push(this.className?'<pre class="'+this.className+'">':"<pre>")
    var d=this.styles,c=this.text,u=this.marked
    e==t&&(e=null)
    var m=c.length
    if(null!=o&&(m=Math.min(o,m)),c||null!=o)if(u||null!=e){var f,h=0,p=0,g="",v=-1,b=null
    for(a();m>h;){var y=m,C=""
    for(null!=e&&(e>h?y=e:(null==t||t>h)&&(C=" CodeMirror-selected",null!=t&&(y=Math.min(y,t))));b&&null!=b.to&&b.to<=h;)a()
    for(b&&(b.from>h?y=Math.min(y,b.from):(C+=" "+b.style,null!=b.to&&(y=Math.min(y,b.to))));;){var x=h+g.length,N=f
    if(C&&(N=f?f+C:C),r(x>y?g.slice(0,y-h):g,N),x>=y){g=g.slice(y-h),h=y
    break}h=x,g=d[p++],f="cm-"+d[p++]}}null!=e&&null==t&&r(" ","CodeMirror-selected")}else for(var p=0,w=0;m>w;p+=2){var U=d[p],f=d[p+1],E=U.length
    w+E>m&&(U=U.slice(0,m-w)),w+=E,r(U,f&&"cm-"+f)}else r(" ",null!=e&&null==t?"CodeMirror-selected":null)
    return n&&s.push("</pre>"),s.join("")},cleanUp:function(){if(this.parent=null,this.marked)for(var e=0,t=this.marked.length;t>e;++e)this.marked[e].detach(this)}},c.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,n){for(var i=e,o=e+t;o>i;++i){var r=this.lines[i]
    if(this.height-=r.height,r.cleanUp(),r.handlers)for(var a=0;a<r.handlers.length;++a)n.push(r.handlers[a])}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.splice.apply(this.lines,[e,0].concat(t))
    for(var i=0,o=t.length;o>i;++i)t[i].parent=this},iterN:function(e,t,n){for(var i=e+t;i>e;++e)if(n(this.lines[e]))return!0}},u.prototype={chunkSize:function(){return this.size},remove:function(e,t,n){this.size-=t
    for(var i=0;i<this.children.length;++i){var o=this.children[i],r=o.chunkSize()
    if(r>e){var a=Math.min(t,r-e),s=o.height
    if(o.remove(e,a,n),this.height-=s-o.height,r==a&&(this.children.splice(i--,1),o.parent=null),0==(t-=a))break
    e=0}else e-=r}if(this.size-t<25){var l=[]
    this.collapse(l),this.children=[new c(l)]}},collapse:function(e){for(var t=0,n=this.children.length;n>t;++t)this.children[t].collapse(e)},insert:function(e,t){for(var n=0,i=0,o=t.length;o>i;++i)n+=t[i].height
    this.insertHeight(e,t,n)},insertHeight:function(e,t,n){this.size+=t.length,this.height+=n
    for(var i=0,o=this.children.length;o>i;++i){var r=this.children[i],a=r.chunkSize()
    if(a>=e){if(r.insertHeight(e,t,n),r.lines&&r.lines.length>50){for(;r.lines.length>50;){var s=r.lines.splice(r.lines.length-25,25),l=new c(s)
    r.height-=l.height,this.children.splice(i+1,0,l),l.parent=this}this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this
    do{var t=e.children.splice(e.children.length-5,5),n=new u(t)
    if(e.parent){e.size-=n.size,e.height-=n.height
    var i=M(e.parent.children,e)
    e.parent.children.splice(i+1,0,n)}else{var o=new u(e.children)
    o.parent=e,e.children=[o,n],e=o}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 i=0,o=this.children.length;o>i;++i){var r=this.children[i],a=r.chunkSize()
    if(a>e){var s=Math.min(t,a-e)
    if(r.iterN(e,s,n))return!0
    if(0==(t-=s))break
    e=0}else e-=a}}},g.prototype={addChange:function(e,t,n){this.undone.length=0
    var i=+new Date,o=this.done[this.done.length-1]
    if(i-this.time>400||!o||o.start>e+t||o.start+o.added<e-o.added+o.old.length)this.done.push({start:e,added:t,old:n})
    else{var r=0
    if(e<o.start){for(var a=o.start-e-1;a>=0;--a)o.old.unshift(n[a])
    o.added+=o.start-e,o.start=e}else o.start<e&&(r=e-o.start,t+=r)
    for(var a=o.added-r,s=n.length;s>a;++a)o.old.push(n[a])
    o.added<t&&(o.added=t)}this.time=i}},e.e_stop=x,e.e_preventDefault=y,e.e_stopPropagation=C,e.connect=U,E.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}}
    var W=function(){if(/MSIE [1-8]\b/.test(navigator.userAgent))return!1
    var e=document.createElement("div")
    return"draggable"in e}(),q=/gecko\/\d{7}/i.test(navigator.userAgent),V=/MSIE \d/.test(navigator.userAgent),j=/WebKit\//.test(navigator.userAgent),X="\n"
    !function(){var e=document.createElement("textarea")
    e.value="foo\nbar",e.value.indexOf("\r")>-1&&(X="\r\n")}(),null!=document.documentElement.getBoundingClientRect&&(k=function(e,t){try{var n=e.getBoundingClientRect()
    n={top:n.top,left:n.left}}catch(i){n={top:0,left:0}}if(!t)if(null==window.pageYOffset){var o=document.documentElement||document.body.parentNode
    null==o.scrollTop&&(o=document.body),n.top+=o.scrollTop,n.left+=o.scrollLeft}else n.top+=window.pageYOffset,n.left+=window.pageXOffset
    return n})
    var Y=document.createElement("pre")
    "\na"==R("a")?R=function(e){return Y.textContent=e,Y.innerHTML.slice(1)}:"	"!=R("	")&&(R=function(e){return Y.innerHTML="",Y.appendChild(document.createTextNode(e)),Y.innerHTML}),e.htmlEscape=R
    var K=3!="\n\nb".split(/\n/).length?function(e){for(var t,n=0,i=[];(t=e.indexOf("\n",n))>-1;)i.push(e.slice(n,"\r"==e.charAt(t-1)?t-1:t)),n=t+1
    return i.push(e.slice(n)),i}:function(e){return e.split(/\r?\n/)}
    e.splitLines=K
    var G=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?0!=t.compareEndPoints("StartToEnd",t):!1}
    e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null")
    var Z={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"}
    return e.keyNames=Z,function(){for(var e=0;10>e;e++)Z[e+48]=e+""
    for(var e=65;90>=e;e++)Z[e]=String.fromCharCode(e)
    for(var e=1;12>=e;e++)Z[e+111]=Z[e+63235]="F"+e}(),e}()
    CodeMirror.defineMode("xml",function(e,t){function n(e,t){function n(n){return t.tokenize=n,n(e,t)}var o=e.next()
    if("<"==o){if(e.eat("!"))return e.eat("[")?e.match("CDATA[")?n(r("atom","]]>")):null:e.match("--")?n(r("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(a(1))):null
    if(e.eat("?"))return e.eatWhile(/[\w\._\-]/),t.tokenize=r("meta","?>"),"meta"
    b=e.eat("/")?"closeTag":"openTag",e.eatSpace(),v=""
    for(var s;s=e.eat(/[^\s\u00a0=<>\"\'\/?]/);)v+=s
    return t.tokenize=i,"tag"}return"&"==o?(e.eatWhile(/[^;]/),e.eat(";"),"atom"):(e.eatWhile(/[^&<]/),null)}function i(e,t){var i=e.next()
    return">"==i||"/"==i&&e.eat(">")?(t.tokenize=n,b=">"==i?"endTag":"selfcloseTag","tag"):"="==i?(b="equals",null):/[\'\"]/.test(i)?(t.tokenize=o(i),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function o(e){return function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i
    break}return"string"}}function r(e,t){return function(i,o){for(;!i.eol();){if(i.match(t)){o.tokenize=n
    break}i.next()}return e}}function a(e){return function(t,i){for(var o;null!=(o=t.next());){if("<"==o)return i.tokenize=a(e+1),i.tokenize(t,i)
    if(">"==o){if(1==e){i.tokenize=n
    break}return i.tokenize=a(e-1),i.tokenize(t,i)}}return"meta"}}function s(){for(var e=arguments.length-1;e>=0;e--)y.cc.push(arguments[e])}function l(){return s.apply(null,arguments),!0}function d(e,t){var n=N.doNotIndent.hasOwnProperty(e)||y.context&&y.context.noIndent
    y.context={prev:y.context,tagName:e,indent:y.indented,startOfLine:t,noIndent:n}}function c(){y.context&&(y.context=y.context.prev)}function u(e){if("openTag"==e)return y.tagName=v,l(h,m(y.startOfLine))
    if("closeTag"==e){var t=!1
    return t=y.context?y.context.tagName!=v:!0,t&&(C="error"),l(f(t))}return l()}function m(e){return function(t){return"selfcloseTag"==t||"endTag"==t&&N.autoSelfClosers.hasOwnProperty(y.tagName.toLowerCase())?l():"endTag"==t?(d(y.tagName,e),l()):l()}}function f(e){return function(t){return e&&(C="error"),"endTag"==t?(c(),l()):(C="error",l(arguments.callee))}}function h(e){return"word"==e?(C="attribute",l(h)):"equals"==e?l(p,h):"string"==e?(C="error",l(h)):s()}function p(e){return"word"==e&&N.allowUnquoted?(C="string",l()):"string"==e?l(g):s()}function g(e){return"string"==e?l(g):s()}var v,b,y,C,x=e.indentUnit,N=t.htmlMode?{autoSelfClosers:{br:!0,img:!0,hr:!0,link:!0,input:!0,meta:!0,col:!0,frame:!0,base:!0,area:!0},doNotIndent:{pre:!0},allowUnquoted:!0}:{autoSelfClosers:{},doNotIndent:{},allowUnquoted:!1},w=t.alignCDATA
    return{startState:function(){return{tokenize:n,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(e,t){if(e.sol()&&(t.startOfLine=!0,t.indented=e.indentation()),e.eatSpace())return null
    C=b=v=null
    var n=t.tokenize(e,t)
    if(t.type=b,(n||b)&&"comment"!=n)for(y=t;;){var i=t.cc.pop()||u
    if(i(b||n))break}return t.startOfLine=!1,C||n},indent:function(e,t,o){var r=e.context
    if(e.tokenize!=i&&e.tokenize!=n||r&&r.noIndent)return o?o.match(/^(\s*)/)[0].length:0
    if(w&&/<!\[CDATA\[/.test(t))return 0
    for(r&&/^<\//.test(t)&&(r=r.prev);r&&!r.startOfLine;)r=r.prev
    return r?r.indent+x:0},compareStates:function(e,t){if(e.indented!=t.indented||e.tokenize!=t.tokenize)return!1
    for(var n=e.context,i=t.context;;n=n.prev,i=i.prev){if(!n||!i)return n==i
    if(n.tagName!=i.tagName)return!1}},electricChars:"/"}}),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),CodeMirror.defineMode("javascript",function(e,t){function n(e,t,n){return t.tokenize=n,n(e,t)}function i(e,t){for(var n,i=!1;null!=(n=e.next());){if(n==t&&!i)return!1
    i=!i&&"\\"==n}return i}function o(e,t,n){return D=e,O=n,t}function r(e,t){var r=e.next()
    if('"'==r||"'"==r)return n(e,t,a(r))
    if(/[\[\]{}\(\),;\:\.]/.test(r))return o(r)
    if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number")
    if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number")
    if("/"==r)return e.eat("*")?n(e,t,s):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t.reAllowed?(i(e,"/"),e.eatWhile(/[gimy]/),o("regexp","string")):(e.eatWhile(z),o("operator",null,e.current()))
    if("#"==r)return e.skipToEnd(),o("error","error")
    if(z.test(r))return e.eatWhile(z),o("operator",null,e.current())
    e.eatWhile(/[\w\$_]/)
    var l=e.current(),d=F.propertyIsEnumerable(l)&&F[l]
    return d&&t.kwAllowed?o(d.type,d.style,l):o("variable","variable",l)}function a(e){return function(t,n){return i(t,e)||(n.tokenize=r),o("string","string")}}function s(e,t){for(var n,i=!1;n=e.next();){if("/"==n&&i){t.tokenize=r
    break}i="*"==n}return o("comment","comment")}function l(e,t,n,i,o,r){this.indented=e,this.column=t,this.type=n,this.prev=o,this.info=r,null!=i&&(this.align=i)}function d(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0}function c(e,t,n,i,o){var r=e.cc
    for(W.state=e,W.stream=o,W.marked=null,W.cc=r,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=r.length?r.pop():H?C:y
    if(a(n,i)){for(;r.length&&r[r.length-1].lex;)r.pop()()
    return W.marked?W.marked:"variable"==n&&d(e,i)?"variable-2":t}}}function u(){for(var e=arguments.length-1;e>=0;e--)W.cc.push(arguments[e])}function m(){return u.apply(null,arguments),!0}function f(e){var t=W.state
    if(t.context){W.marked="def"
    for(var n=t.localVars;n;n=n.next)if(n.name==e)return
    t.localVars={name:e,next:t.localVars}}}function h(){W.state.context||(W.state.localVars=q),W.state.context={prev:W.state.context,vars:W.state.localVars}}function p(){W.state.localVars=W.state.context.vars,W.state.context=W.state.context.prev}function g(e,t){var n=function(){var n=W.state
    n.lexical=new l(n.indented,W.stream.column(),e,null,n.lexical,t)}
    return n.lex=!0,n}function v(){var e=W.state
    e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function b(e){return function(t){return t==e?m():";"==e?u():m(arguments.callee)}}function y(e){return"var"==e?m(g("vardef"),k,b(";"),v):"keyword a"==e?m(g("form"),C,y,v):"keyword b"==e?m(g("form"),y,v):"{"==e?m(g("}"),T,v):";"==e?m():"function"==e?m(_):"for"==e?m(g("form"),b("("),g(")"),A,b(")"),v,y,v):"variable"==e?m(g("stat"),w):"switch"==e?m(g("form"),C,g("}","switch"),b("{"),T,v,v):"case"==e?m(C,b(":")):"default"==e?m(b(":")):"catch"==e?m(g("form"),h,b("("),M,b(")"),y,v,p):u(g("stat"),C,b(";"),v)}function C(e){return $.hasOwnProperty(e)?m(N):"function"==e?m(_):"keyword c"==e?m(x):"("==e?m(g(")"),C,b(")"),v,N):"operator"==e?m(C):"["==e?m(g("]"),S(C,"]"),v,N):"{"==e?m(g("}"),S(E,"}"),v,N):m()}function x(e){return e.match(/[;\}\)\],]/)?u():u(C)}function N(e,t){if("operator"==e&&/\+\+|--/.test(t))return m(N)
    if("operator"==e)return m(C)
    if(";"!=e)return"("==e?m(g(")"),S(C,")"),v,N):"."==e?m(U,N):"["==e?m(g("]"),C,b("]"),v,N):void 0}function w(e){return":"==e?m(v,y):u(N,b(";"),v)}function U(e){return"variable"==e?(W.marked="property",m()):void 0}function E(e){return"variable"==e&&(W.marked="property"),$.hasOwnProperty(e)?m(b(":"),C):void 0}function S(e,t){function n(i){return","==i?m(e,n):i==t?m():m(b(t))}return function(i){return i==t?m():u(e,n)}}function T(e){return"}"==e?m():u(y,T)}function k(e,t){return"variable"==e?(f(t),m(B)):m()}function B(e,t){return"="==t?m(C,B):","==e?m(k):void 0}function A(e){return"var"==e?m(k,I):";"==e?u(I):"variable"==e?m(L):u(I)}function L(e,t){return"in"==t?m(C):m(N,I)}function I(e,t){return";"==e?m(R):"in"==t?m(C):m(C,b(";"),R)}function R(e){")"!=e&&m(C)}function _(e,t){return"variable"==e?(f(t),m(_)):"("==e?m(g(")"),h,S(M,")"),v,y,p):void 0}function M(e,t){return"variable"==e?(f(t),m()):void 0}var D,O,P=e.indentUnit,H=t.json,F=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),i=e("keyword c"),o=e("operator"),r={type:"atom",style:"atom"}
    return{"if":t,"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":i,"break":i,"continue":i,"new":i,"delete":i,"throw":i,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":o,"typeof":o,"instanceof":o,"true":r,"false":r,"null":r,undefined:r,NaN:r,Infinity:r}}(),z=/[+\-*&%=<>!?|]/,$={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},W={state:null,column:null,marked:null,cc:null},q={name:"this",next:{name:"arguments"}}
    return v.lex=!0,{startState:function(e){return{tokenize:r,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new l((e||0)-P,0,"block",!1),localVars:null,context:null,indented:0}},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation()),e.eatSpace())return null
    var n=t.tokenize(e,t)
    return"comment"==D?n:(t.reAllowed="operator"==D||"keyword c"==D||D.match(/^[\[{}\(,;:]$/),t.kwAllowed="."!=D,c(t,n,D,O,e))},indent:function(e,t){if(e.tokenize!=r)return 0
    var n=t&&t.charAt(0),i=e.lexical,o=i.type,a=n==o
    return"vardef"==o?i.indented+4:"form"==o&&"{"==n?i.indented:"stat"==o||"form"==o?i.indented+P:"switch"!=i.info||a?i.align?i.column+(a?0:1):i.indented+(a?0:P):i.indented+(/^(?:case|default)\b/.test(t)?P:2*P)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("css",function(e){function t(e,t){return a=t,e}function n(e,n){var a=e.next()
    return"@"==a?(e.eatWhile(/[\w\\\-]/),t("meta",e.current())):"/"==a&&e.eat("*")?(n.tokenize=i,i(e,n)):"<"==a&&e.eat("!")?(n.tokenize=o,o(e,n)):"="!=a?"~"!=a&&"|"!=a||!e.eat("=")?'"'==a||"'"==a?(n.tokenize=r(a),n.tokenize(e,n)):"#"==a?(e.eatWhile(/[\w\\\-]/),t("atom","hash")):"!"==a?(e.match(/^\s*\w*/),t("keyword","important")):/\d/.test(a)?(e.eatWhile(/[\w.%]/),t("number","unit")):/[,.+>*\/]/.test(a)?t(null,"select-op"):/[;{}:\[\]]/.test(a)?t(null,a):(e.eatWhile(/[\w\\\-]/),t("variable","variable")):t(null,"compare"):void t(null,"compare")}function i(e,i){for(var o,r=!1;null!=(o=e.next());){if(r&&"/"==o){i.tokenize=n
    break}r="*"==o}return t("comment","comment")}function o(e,i){for(var o,r=0;null!=(o=e.next());){if(r>=2&&">"==o){i.tokenize=n
    break}r="-"==o?r+1:0}return t("comment","comment")}function r(e){return function(i,o){for(var r,a=!1;null!=(r=i.next())&&(r!=e||a);)a=!a&&"\\"==r
    return a||(o.tokenize=n),t("string","string")}}var a,s=e.indentUnit
    return{startState:function(e){return{tokenize:n,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null
    var n=t.tokenize(e,t),i=t.stack[t.stack.length-1]
    return"hash"==a&&"rule"==i?n="atom":"variable"==n&&("rule"==i?n="number":i&&"@media{"!=i||(n="tag")),"rule"==i&&/^[\{\};]$/.test(a)&&t.stack.pop(),"{"==a?"@media"==i?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==a?t.stack.pop():"@media"==a?t.stack.push("@media"):"{"==i&&"comment"!=a&&t.stack.push("rule"),n},indent:function(e,t){var n=e.stack.length
    return/^\}/.test(t)&&(n-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+n*s},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("htmlmixed",function(e,t){function n(e,t){var n=a.token(e,t.htmlState)
    return"tag"==n&&">"==e.current()&&t.htmlState.context&&(/^script$/i.test(t.htmlState.context.tagName)?(t.token=o,t.localState=s.startState(a.indent(t.htmlState,"")),t.mode="javascript"):/^style$/i.test(t.htmlState.context.tagName)&&(t.token=r,t.localState=l.startState(a.indent(t.htmlState,"")),t.mode="css")),n}function i(e,t,n){var i=e.current(),o=i.search(t)
    return o>-1&&e.backUp(i.length-o),n}function o(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=n,t.curState=null,t.mode="html",n(e,t)):i(e,/<\/\s*script\s*>/,s.token(e,t.localState))}function r(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=n,t.localState=null,t.mode="html",n(e,t)):i(e,/<\/\s*style\s*>/,l.token(e,t.localState))}var a=CodeMirror.getMode(e,{name:"xml",htmlMode:!0}),s=CodeMirror.getMode(e,"javascript"),l=CodeMirror.getMode(e,"css")
    return{startState:function(){var e=a.startState()
    return{token:n,localState:null,mode:"html",htmlState:e}},copyState:function(e){if(e.localState)var t=CodeMirror.copyState(e.token==r?l:s,e.localState)
    return{token:e.token,localState:t,mode:e.mode,htmlState:CodeMirror.copyState(a,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return e.token==n||/^\s*<\//.test(t)?a.indent(e.htmlState,t):e.token==o?s.indent(e.localState,t):l.indent(e.localState,t)},compareStates:function(e,t){return a.compareStates(e.htmlState,t.htmlState)},electricChars:"/{}:"}}),CodeMirror.defineMIME("text/html","htmlmixed")
    