CodeMirror.defineMode("xml",function(t,e){function n(t,e){function n(n){return e.tokenize=n,n(t,e)}var i=t.next();if("<"==i){if(t.eat("!"))return t.eat("[")?t.match("CDATA[")?n(o("atom","]]>")):null:t.match("--")?n(o("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(a(1))):null;if(t.eat("?"))return t.eatWhile(/[\w\._\-]/),e.tokenize=o("meta","?>"),"meta";var l=t.eat("/");g="";for(var u;u=t.eat(/[^\s\u00a0=<>\"\'\/?]/);)g+=u;return g?(h=l?"closeTag":"openTag",e.tokenize=r,"tag"):"error"}if("&"==i){return(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error"}return t.eatWhile(/[^&<]/),null}function r(t,e){var o=t.next();return">"==o||"/"==o&&t.eat(">")?(e.tokenize=n,h=">"==o?"endTag":"selfcloseTag","tag"):"="==o?(h="equals",null):/[\'\"]/.test(o)?(e.tokenize=function(t){return function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=r;break}return"string"}}(o),e.tokenize(t,e)):(t.eatWhile(/[^\s\u00a0=<>\"\']/),"word")}function o(t,e){return function(r,o){for(;!r.eol();){if(r.match(e)){o.tokenize=n;break}r.next()}return t}}function a(t){return function(e,r){for(var o;null!=(o=e.next());){if("<"==o)return r.tokenize=a(t+1),r.tokenize(e,r);if(">"==o){if(1==t){r.tokenize=n;break}return r.tokenize=a(t-1),r.tokenize(e,r)}}return"meta"}}function i(){for(var t=arguments.length-1;t>=0;t--)x.cc.push(arguments[t])}function l(){return i.apply(null,arguments),!0}function u(){x.context&&(x.context=x.context.prev)}function d(t){if("openTag"==t)return x.tagName=g,l(f,function(t){return function(e){var n=x.tagName;return x.tagName=null,"selfcloseTag"==e||"endTag"==e&&w.autoSelfClosers.hasOwnProperty(n.toLowerCase())?(c(n.toLowerCase()),l()):"endTag"==e?(c(n.toLowerCase()),function(t,e){var n=w.doNotIndent.hasOwnProperty(t)||x.context&&x.context.noIndent;x.context={prev:x.context,tagName:t,indent:x.indented,startOfLine:e,noIndent:n}}(n,t),l()):l()}}(x.startOfLine));if("closeTag"==t){var e=!1;return x.context?x.context.tagName!=g&&(w.implicitlyClosed.hasOwnProperty(x.context.tagName.toLowerCase())&&u(),e=!x.context||x.context.tagName!=g):e=!0,e&&(k="error"),l(function(t){return function(e){return t&&(k="error"),"endTag"==e?(u(),l()):(k="error",l(arguments.callee))}}(e))}return l()}function c(t){for(var e;;){if(!x.context)return;if(e=x.context.tagName.toLowerCase(),!w.contextGrabbers.hasOwnProperty(e)||!w.contextGrabbers[e].hasOwnProperty(t))return;u()}}function f(t){return"word"==t?(k="attribute",l(s,f)):"endTag"==t||"selfcloseTag"==t?i():(k="error",l(f))}function s(t){return"equals"==t?l(m,f):(w.allowMissing?"word"==t&&(k="attribute"):k="error","endTag"==t||"selfcloseTag"==t?i():l())}function m(t){return"string"==t?l(p):"word"==t&&w.allowUnquoted?(k="string",l()):(k="error","endTag"==t||"selfCloseTag"==t?i():l())}function p(t){return"string"==t?l(p):i()}var g,h,x,k,b=t.indentUnit,w=e.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},C=e.alignCDATA;return{startState:function(){return{tokenize:n,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;k=h=g=null;var n=e.tokenize(t,e);if(e.type=h,(n||h)&&"comment"!=n)for(x=e;;){if((e.cc.pop()||d)(h||n))break}return e.startOfLine=!1,k||n},indent:function(t,e,o){var a=t.context;if(t.tokenize!=r&&t.tokenize!=n||a&&a.noIndent)return o?o.match(/^(\s*)/)[0].length:0;if(C&&/<!\[CDATA\[/.test(e))return 0;for(a&&/^<\//.test(e)&&(a=a.prev);a&&!a.startOfLine;)a=a.prev;return a?a.indent+b:0},electricChars:"/",configuration:e.htmlMode?"html":"xml"}}),CodeMirror.defineMIME("text/xml","xml"),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0});