/* CodeMirror - Minified & Bundled
   Generated with http://codemirror.net/doc/compress.html
   Version: 5.25.0

   CodeMirror Library:
   - codemirror.js
   Modes:
   - css.js
   - htmlembedded.js
   - htmlmixed.js
   - javascript.js
   - xml.js
   Add-ons:
   - dialog.js
   - search.js
   - searchcursor.js
 */

(function(Fa,ba){"object"===typeof exports&&"undefined"!==typeof module?module.exports=ba():"function"===typeof define&&define.amd?define(ba):Fa.CodeMirror=ba()})(this,function(){function Fa(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function ba(a){for(var b=a.childNodes.length;0<b;--b)a.removeChild(a.firstChild);return a}function Y(a,b){return ba(a).appendChild(b)}function v(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)a.appendChild(document.createTextNode(b));
else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function Xa(a,b,c,d){a=v(a,b,c,d);a.setAttribute("role","presentation");return a}function Zb(a,b){3==b.nodeType&&(b=b.parentNode);if(a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)}function qa(){var a;try{a=document.activeElement}catch(b){a=document.body||null}for(;a&&a.shadowRoot&&a.shadowRoot.activeElement;)a=a.shadowRoot.activeElement;return a}function Ga(a,b){var c=a.className;Fa(b).test(c)||
(a.className+=(c?" ":"")+b)}function Gc(a,b){for(var c=a.split(" "),d=0;d<c.length;d++)c[d]&&!Fa(c[d]).test(b)&&(b+=" "+c[d]);return b}function Hc(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function Ha(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||!1===c&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function ca(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));d=d||0;for(e=e||0;;){var f=a.indexOf("\t",d);if(0>f||f>=b)return e+
(b-d);e+=f-d;e+=c-e%c;d=f+1}}function M(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function Ic(a,b,c){for(var d=0,e=0;;){var f=a.indexOf("\t",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);e+=f-d;e+=c-e%c;d=f+1;if(e>=b)return d}}function Jc(a){for(;$b.length<=a;)$b.push(z($b)+" ");return $b[a]}function z(a){return a[a.length-1]}function ac(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function Qf(a,b,c){for(var d=0,e=c(b);d<a.length&&
c(a[d])<=e;)d++;a.splice(d,0,b)}function Md(){}function Nd(a,b){var c;Object.create?c=Object.create(a):(Md.prototype=a,c=new Md);b&&Ha(b,c);return c}function Kc(a){return/\w/.test(a)||"\u0080"<a&&(a.toUpperCase()!=a.toLowerCase()||Rf.test(a))}function bc(a,b){return b?-1<b.source.indexOf("\\w")&&Kc(a)?!0:b.test(a):Kc(a)}function Od(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Lc(a){return 768<=a.charCodeAt(0)&&Sf.test(a)}function Pd(a,b,c){for(;(0>c?0<b:b<a.length)&&Lc(a.charAt(b));)b+=
c;return b}function cc(a,b,c){for(;;){if(1>=Math.abs(b-c))return a(b)?b:c;var d=Math.floor((b+c)/2);a(d)?c=d:b=d}}function Tf(a,b,c){this.input=c;this.scrollbarFiller=v("div",null,"CodeMirror-scrollbar-filler");this.scrollbarFiller.setAttribute("cm-not-content","true");this.gutterFiller=v("div",null,"CodeMirror-gutter-filler");this.gutterFiller.setAttribute("cm-not-content","true");this.lineDiv=Xa("div",null,"CodeMirror-code");this.selectionDiv=v("div",null,null,"position: relative; z-index: 1");
this.cursorDiv=v("div",null,"CodeMirror-cursors");this.measure=v("div",null,"CodeMirror-measure");this.lineMeasure=v("div",null,"CodeMirror-measure");this.lineSpace=Xa("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");var d=Xa("div",[this.lineSpace],"CodeMirror-lines");this.mover=v("div",[d],null,"position: relative");this.sizer=v("div",[this.mover],"CodeMirror-sizer");this.sizerWidth=null;this.heightForcer=v("div",null,null,
"position: absolute; height: 30px; width: 1px;");this.gutters=v("div",null,"CodeMirror-gutters");this.lineGutter=null;this.scroller=v("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll");this.scroller.setAttribute("tabIndex","-1");this.wrapper=v("div",[this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror");B&&8>E&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0);N||xa&&tb||(this.scroller.draggable=!0);a&&(a.appendChild?a.appendChild(this.wrapper):a(this.wrapper));
this.reportedViewFrom=this.reportedViewTo=this.viewFrom=this.viewTo=b.first;this.view=[];this.externalMeasured=this.renderedView=null;this.lastWrapHeight=this.lastWrapWidth=this.viewOffset=0;this.updateLineNumbers=null;this.nativeBarWidth=this.barHeight=this.barWidth=0;this.scrollbarsClipped=!1;this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=null;this.alignWidgets=!1;this.maxLine=this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null;this.maxLineLength=0;this.maxLineChanged=
!1;this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null;this.shift=!1;this.activeTouch=this.selForContextMenu=null;c.init(this)}function u(a,b){b-=a.first;if(0>b||b>=a.size)throw Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(b<f){c=e;break}b-=f}return c.lines[b]}function Ia(a,b,c){var d=[],e=b.line;a.iter(b.line,c.line+1,function(a){a=a.text;e==c.line&&(a=a.slice(0,c.ch));e==b.line&&(a=a.slice(b.ch));
d.push(a);++e});return d}function Mc(a,b,c){var d=[];a.iter(b,c,function(a){d.push(a.text)});return d}function ja(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function C(a){if(null==a.parent)return null;var b=a.parent;a=M(b.lines,a);for(var c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a+b.first}function Ja(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(b<f){a=e;continue a}b-=f;c+=
e.chunkSize()}return c}while(!a.lines);for(d=0;d<a.lines.length;++d){e=a.lines[d].height;if(b<e)break;b-=e}return c+d}function ub(a,b){return b>=a.first&&b<a.first+a.size}function Nc(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function q(a,b,c){void 0===c&&(c=null);if(!(this instanceof q))return new q(a,b,c);this.line=a;this.ch=b;this.sticky=c}function x(a,b){return a.line-b.line||a.ch-b.ch}function Oc(a,b){return a.sticky==b.sticky&&0==x(a,b)}function Pc(a){return q(a.line,a.ch)}
function dc(a,b){return 0>x(a,b)?b:a}function ec(a,b){return 0>x(a,b)?a:b}function w(a,b){if(b.line<a.first)return q(a.first,0);var c=a.first+a.size-1;if(b.line>c)return q(c,u(a,c).text.length);var c=u(a,b.line).text.length,d=b.ch,c=null==d||d>c?q(b.line,c):0>d?q(b.line,0):b;return c}function Qd(a,b){for(var c=[],d=0;d<b.length;d++)c[d]=w(a,b[d]);return c}function fc(a,b,c){this.marker=a;this.from=b;this.to=c}function vb(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function Qc(a,
b){if(b.full)return null;var c=ub(a,b.from.line)&&u(a,b.from.line).markedSpans,d=ub(a,b.to.line)&&u(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==x(b.from,b.to),h;if(c)for(var k=0;k<c.length;++k){var l=c[k],m=l.marker;if(null==l.from||(m.inclusiveLeft?l.from<=e:l.from<e)||!(l.from!=e||"bookmark"!=m.type||g&&l.marker.insertLeft)){var p=null==l.to||(m.inclusiveRight?l.to>=e:l.to>e);(h||(h=[])).push(new fc(m,l.from,p?null:l.to))}}var c=h,n;if(d)for(h=0;h<d.length;++h)if(k=
d[h],l=k.marker,null==k.to||(l.inclusiveRight?k.to>=f:k.to>f)||k.from==f&&"bookmark"==l.type&&(!g||k.marker.insertLeft))m=null==k.from||(l.inclusiveLeft?k.from<=f:k.from<f),(n||(n=[])).push(new fc(l,m?null:k.from-f,null==k.to?null:k.to-f));d=n;f=1==b.text.length;g=z(b.text).length+(f?e:0);if(c)for(n=0;n<c.length;++n)if(h=c[n],null==h.to)(k=vb(d,h.marker),k)?f&&(h.to=null==k.to?null:k.to+g):h.to=e;if(d)for(e=0;e<d.length;++e)n=d[e],null!=n.to&&(n.to+=g),null==n.from?vb(c,n.marker)||(n.from=g,f&&(c||
(c=[])).push(n)):(n.from+=g,f&&(c||(c=[])).push(n));c&&(c=Rd(c));d&&d!=c&&(d=Rd(d));e=[c];if(!f){var f=b.text.length-2,r;if(0<f&&c)for(g=0;g<c.length;++g)null==c[g].to&&(r||(r=[])).push(new fc(c[g].marker,null,null));for(c=0;c<f;++c)e.push(r);e.push(d)}return e}function Rd(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&!1!==c.marker.clearWhenEmpty&&a.splice(b--,1)}return a.length?a:null}function Uf(a,b,c){var d=null;a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=
0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=M(d,c)||(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b){c=d[b];for(var e=c.find(0),f=0;f<a.length;++f){var g=a[f];if(!(0>x(g.to,e.from)||0<x(g.from,e.to))){var h=[f,1],k=x(g.from,e.from),l=x(g.to,e.to);(0>k||!c.inclusiveLeft&&!k)&&h.push({from:g.from,to:e.from});(0<l||!c.inclusiveRight&&!l)&&h.push({from:e.to,to:g.to});a.splice.apply(a,h);f+=h.length-3}}}return a}function Sd(a){var b=
a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Td(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Ud(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var c=a.find(),d=b.find(),e=x(c.from,d.from)||(a.inclusiveLeft?-1:0)-(b.inclusiveLeft?-1:0);return e?-e:(c=x(c.to,d.to)||(a.inclusiveRight?1:0)-(b.inclusiveRight?1:0))?c:b.id-a.id}function Ka(a,b){var c=ya&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)e=
c[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!d||0>Ud(d,e.marker))&&(d=e.marker);return d}function Vd(a,b,c,d,e){a=u(a,b);if(a=ya&&a.markedSpans)for(b=0;b<a.length;++b){var f=a[b];if(f.marker.collapsed){var g=f.marker.find(0),h=x(g.from,c)||(f.marker.inclusiveLeft?-1:0)-(e.inclusiveLeft?-1:0),k=x(g.to,d)||(f.marker.inclusiveRight?1:0)-(e.inclusiveRight?1:0);if(!(0<=h&&0>=k||0>=h&&0<=k)&&(0>=h&&(f.marker.inclusiveRight&&e.inclusiveLeft?0<=x(g.to,c):0<x(g.to,c))||0<=h&&(f.marker.inclusiveRight&&
e.inclusiveLeft?0>=x(g.from,d):0>x(g.from,d))))return!0}}}function ka(a){for(var b;b=Ka(a,!0);)a=b.find(-1,!0).line;return a}function Rc(a,b){var c=u(a,b),d=ka(c);return c==d?b:C(d)}function Wd(a,b){if(b>a.lastLine())return b;var c=u(a,b),d;if(!La(a,c))return b;for(;d=Ka(c,!1);)c=d.find(1,!0).line;return C(c)+1}function La(a,b){var c=ya&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed&&(null==d.from||!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&Sc(a,b,d)))return!0}
function Sc(a,b,c){if(null==c.to)return b=c.marker.find(1,!0),Sc(a,b.line,vb(b.line.markedSpans,c.marker));if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var d,e=0;e<b.markedSpans.length;++e)if(d=b.markedSpans[e],d.marker.collapsed&&!d.marker.widgetNode&&d.from==c.to&&(null==d.to||d.to!=c.from)&&(d.marker.inclusiveLeft||c.marker.inclusiveRight)&&Sc(a,b,d))return!0}function la(a){a=ka(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;else b+=e.height}for(a=
c.parent;a;c=a,a=c.parent)for(d=0;d<a.children.length&&(e=a.children[d],e!=c);++d)b+=e.height;return b}function gc(a){if(0==a.height)return 0;for(var b=a.text.length,c,d=a;c=Ka(d,!0);)c=c.find(0,!0),d=c.from.line,b+=c.from.ch-c.to.ch;for(d=a;c=Ka(d,!1);)a=c.find(0,!0),b-=d.text.length-a.from.ch,d=a.to.line,b+=d.text.length-a.to.ch;return b}function Tc(a){var b=a.display;a=a.doc;b.maxLine=u(a,a.first);b.maxLineLength=gc(b.maxLine);b.maxLineChanged=!0;a.iter(function(a){var d=gc(a);d>b.maxLineLength&&
(b.maxLineLength=d,b.maxLine=a)})}function Vf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];if(g.from<c&&g.to>b||b==c&&g.to==b)d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0}e||d(b,c,"ltr")}function Uc(a,b,c){var d;wb=null;for(var e=0;e<a.length;++e){var f=a[e];if(f.from<b&&f.to>b)return e;f.to==b&&(f.from!=f.to&&"before"==c?d=e:wb=e);f.from==b&&(f.from!=f.to&&"before"!=c?d=e:wb=e)}return null!=d?d:wb}function za(a,b){var c=a.order;null==c&&(c=
a.order=Wf(a.text,b));return c}function Vc(a,b,c){b=Pd(a.text,b+c,c);return 0>b||b>a.text.length?null:b}function Wc(a,b,c){a=Vc(a,b.ch,c);return null==a?null:new q(b.line,a,0>c?"after":"before")}function Xc(a,b,c,d,e){if(a&&(a=za(c,b.doc.direction))){a=0>e?z(a):a[0];var f=0>e==(1==a.level)?"after":"before",g;if(0<a.level){var h=Ya(b,c);g=0>e?c.text.length-1:0;var k=ra(b,h,g).top;g=cc(function(a){return ra(b,h,a).top==k},0>e==(1==a.level)?a.from:a.to-1,g);"before"==f&&(g=Vc(c,g,1,!0))}else g=0>e?a.to:
a.from;return new q(d,g,f)}return new q(d,0>e?c.text.length:0,0>e?"before":"after")}function Xd(a,b,c,d){var e=za(b,a.doc.direction);if(!e)return Wc(b,c,d);c.ch>=b.text.length?(c.ch=b.text.length,c.sticky="before"):0>=c.ch&&(c.ch=0,c.sticky="after");var f=Uc(e,c.ch,c.sticky),g=e[f];if("ltr"==a.doc.direction&&0==g.level%2&&(0<d?g.to>c.ch:g.from<c.ch))return Wc(b,c,d);var h=function(a,d){return Vc(b,a instanceof q?a.ch:a,d)},k,l=function(d){if(!a.options.lineWrapping)return{begin:0,end:b.text.length};
var c=k=k||Ya(a,b);d=Ma(a,b,ra(a,c,d),"line").top;return Yd(a,b,c,d)},m=l("before"==c.sticky?h(c,-1):c.ch);if("rtl"==a.doc.direction||1==g.level){var p=1==g.level==0>d,n=h(c,p?1:-1);if(null!=n&&(p?n<=g.to&&n<=m.end:n>=g.from&&n>=m.begin))return new q(c.line,n,p?"before":"after")}g=function(a,b,d){for(var f=function(a,b){return b?new q(c.line,h(a,1),"before"):new q(c.line,a,"after")};0<=a&&a<e.length;a+=b){var g=e[a],k=0<b==(1!=g.level),l=k?d.begin:h(d.end,-1);if(g.from<=l&&l<g.to)return f(l,k);l=
k?g.from:h(g.to,-1);if(d.begin<=l&&l<d.end)return f(l,k)}};if(f=g(f+d,d,m))return f;m=0<d?m.end:h(m.begin,-1);return null==m||0<d&&m==b.text.length||!(f=g(0<d?0:e.length-1,d,l(m)))?null:f}function ea(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=(a=a._handlers)&&a[b];d&&(c=M(d,c),-1<c&&(a[b]=d.slice(0,c).concat(d.slice(c+1))))}}function G(a,b){var c=a._handlers&&a._handlers[b]||hc;if(c.length)for(var d=Array.prototype.slice.call(arguments,
2),e=0;e<c.length;++e)c[e].apply(null,d)}function I(a,b,c){"string"==typeof b&&(b={type:b,preventDefault:function(){this.defaultPrevented=!0}});G(a,c||b.type,a,b);return Yc(b)||b.codemirrorIgnore}function Zd(a){var b=a._handlers&&a._handlers.cursorActivity;if(b){a=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]);for(var c=0;c<b.length;++c)-1==M(a,b[c])&&a.push(b[c])}}function da(a,b){return 0<(a._handlers&&a._handlers[b]||hc).length}function Za(a){a.prototype.on=function(a,c){t(this,
a,c)};a.prototype.off=function(a,c){ea(this,a,c)}}function Q(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function $d(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Yc(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function xb(a){Q(a);$d(a)}function ae(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));fa&&a.ctrlKey&&1==b&&(b=3);return b}function Xf(a){if(null==Zc){var b=v("span","\u200b");Y(a,v("span",[b,document.createTextNode("x")]));
0!=a.firstChild.offsetHeight&&(Zc=1>=b.offsetWidth&&2<b.offsetHeight&&!(B&&8>E))}a=Zc?v("span","\u200b"):v("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px");a.setAttribute("cm-text","");return a}function Yf(a,b){2<arguments.length&&(b.dependencies=Array.prototype.slice.call(arguments,2));$c[a]=b}function ic(a){if("string"==typeof a&&$a.hasOwnProperty(a))a=$a[a];else if(a&&"string"==typeof a.name&&$a.hasOwnProperty(a.name)){var b=$a[a.name];"string"==typeof b&&(b={name:b});
a=Nd(b,a);a.name=b.name}else{if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return ic("application/xml");if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+json$/.test(a))return ic("application/json")}return"string"==typeof a?{name:a}:a||{name:"null"}}function ad(a,b){b=ic(b);var c=$c[b.name];if(!c)return ad(a,"text/plain");c=c(a,b);if(ab.hasOwnProperty(b.name)){var d=ab[b.name],e;for(e in d)d.hasOwnProperty(e)&&(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}c.name=b.name;b.helperType&&(c.helperType=
b.helperType);if(b.modeProps)for(var f in b.modeProps)c[f]=b.modeProps[f];return c}function Zf(a,b){var c=ab.hasOwnProperty(a)?ab[a]:ab[a]={};Ha(b,c)}function sa(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];e instanceof Array&&(e=e.concat([]));c[d]=e}return c}function bd(a,b){for(var c;a.innerMode;){c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state;a=c.mode}return c||{mode:a,state:b}}function be(a,b,c){return a.startState?a.startState(b,c):!0}function ce(a,
b,c,d){var e=[a.state.modeGen],f={};de(a,b.text,a.doc.mode,c,function(a,b){return e.push(a,b)},f,d);c=function(d){var c=a.state.overlays[d],g=1,l=0;de(a,b.text,c.mode,!0,function(a,b){for(var d=g;l<a;){var f=e[g];f>a&&e.splice(g,1,a,e[g+1],f);g+=2;l=Math.min(a,f)}if(b)if(c.opaque)e.splice(d,g-d,a,"overlay "+b),g=d+2;else for(;d<g;d+=2)f=e[d+1],e[d+1]=(f?f+" ":"")+"overlay "+b},f)};for(d=0;d<a.state.overlays.length;++d)c(d);return{styles:e,classes:f.bgClass||f.textClass?f:null}}function ee(a,b,c){if(!b.styles||
b.styles[0]!=a.state.modeGen){var d=yb(a,C(b)),e=ce(a,b,b.text.length>a.options.maxHighlightLength?sa(a.doc.mode,d):d);b.stateAfter=d;b.styles=e.styles;e.classes?b.styleClasses=e.classes:b.styleClasses&&(b.styleClasses=null);c===a.doc.frontier&&a.doc.frontier++}return b.styles}function yb(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=$f(a,b,c),g=f>d.first&&u(d,f-1).stateAfter,g=g?sa(d.mode,g):be(d.mode);d.iter(f,b,function(c){cd(a,c.text,g);c.stateAfter=f==b-1||0==f%5||f>=e.viewFrom&&
f<e.viewTo?sa(d.mode,g):null;++f});c&&(d.frontier=f);return g}function cd(a,b,c,d){var e=a.doc.mode;a=new J(b,a.options.tabSize);a.start=a.pos=d||0;for(""==b&&fe(e,c);!a.eol();)dd(e,a,c),a.start=a.pos}function fe(a,b){if(a.blankLine)return a.blankLine(b);if(a.innerMode){var c=bd(a,b);if(c.mode.blankLine)return c.mode.blankLine(c.state)}}function dd(a,b,c,d){for(var e=0;10>e;e++){d&&(d[0]=bd(a,c).mode);var f=a.token(b,c);if(b.pos>b.start)return f}throw Error("Mode "+a.name+" failed to advance stream.");
}function ge(a,b,c,d){var e=function(a){return{start:m.start,end:m.pos,string:m.current(),type:h||null,state:a?sa(f.mode,l):l}},f=a.doc,g=f.mode,h;b=w(f,b);var k=u(f,b.line),l=yb(a,b.line,c),m=new J(k.text,a.options.tabSize),p;for(d&&(p=[]);(d||m.pos<b.ch)&&!m.eol();)m.start=m.pos,h=dd(g,m,l),d&&p.push(e(!0));return d?p:e()}function he(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";
null==b[d]?b[d]=c[2]:(new RegExp("(?:^|s)"+c[2]+"(?:$|s)")).test(b[d])||(b[d]+=" "+c[2])}return a}function de(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var k=0,l=null,m=new J(b,a.options.tabSize),p,n=a.options.addModeClass&&[null];for(""==b&&he(fe(c,d),f);!m.eol();){m.pos>a.options.maxHighlightLength?(h=!1,g&&cd(a,b,d,m.pos),m.pos=b.length,p=null):p=he(dd(c,m,d,n),f);if(n){var r=n[0].name;r&&(p="m-"+(p?r+" "+p:r))}if(!h||l!=p){for(;k<m.start;)k=Math.min(m.start,k+5E3),
e(k,l);l=p}m.start=m.pos}for(;k<m.pos;)a=Math.min(m.pos,k+5E3),e(a,l),k=a}function $f(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1E3:100);b>g;--b){if(b<=f.first)return f.first;var h=u(f,b-1);if(h.stateAfter&&(!c||b<=f.frontier))return b;h=ca(h.text,null,a.options.tabSize);if(null==e||d>h)e=b-1,d=h}return e}function ie(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?ag:bg;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function je(a,b){var c=Xa("span",null,null,N?"padding-right: .1px":
null),c={pre:Xa("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:a,trailingSpace:!1,splitSpaces:(B||N)&&a.getOption("lineWrapping")};b.measure={};for(var d=0;d<=(b.rest?b.rest.length:0);d++){var e=d?b.rest[d-1]:b.line,f=void 0;c.pos=0;c.addToken=cg;var g;g=a.display.measure;if(null!=ed)g=ed;else{var h=Y(g,document.createTextNode("A\u062eA")),k=bb(h,0,1).getBoundingClientRect(),h=bb(h,1,2).getBoundingClientRect();ba(g);g=k&&k.left!=k.right?ed=3>h.right-k.right:!1}g&&(f=za(e,a.doc.direction))&&
(c.addToken=dg(c.addToken,f));c.map=[];var l=b!=a.display.externalMeasured&&C(e);a:{var m=h=k=g=void 0,p=void 0,n=void 0,r=void 0,f=c,l=ee(a,e,l),D=e.markedSpans,q=e.text,u=0;if(D)for(var v=q.length,t=0,x=1,w="",ma=0;;){if(ma==t){p=m=h=k=n="";g=null;for(var ma=Infinity,ta=[],W=void 0,z=0;z<D.length;++z){var y=D[z],A=y.marker;"bookmark"==A.type&&y.from==t&&A.widgetNode?ta.push(A):y.from<=t&&(null==y.to||y.to>t||A.collapsed&&y.to==t&&y.from==t)?(null!=y.to&&y.to!=t&&ma>y.to&&(ma=y.to,m=""),A.className&&
(p+=" "+A.className),A.css&&(n=(n?n+";":"")+A.css),A.startStyle&&y.from==t&&(h+=" "+A.startStyle),A.endStyle&&y.to==ma&&(W||(W=[])).push(A.endStyle,y.to),A.title&&!k&&(k=A.title),A.collapsed&&(!g||0>Ud(g.marker,A))&&(g=y)):y.from>t&&ma>y.from&&(ma=y.from)}if(W)for(z=0;z<W.length;z+=2)W[z+1]==ma&&(m+=" "+W[z]);if(!g||g.from==t)for(W=0;W<ta.length;++W)ke(f,0,ta[W]);if(g&&(g.from||0)==t){ke(f,(null==g.to?v+1:g.to)-t,g.marker,null==g.from);if(null==g.to)break a;g.to==t&&(g=!1)}}if(t>=v)break;for(ta=Math.min(v,
ma);;){if(w){W=t+w.length;g||(z=W>ta?w.slice(0,ta-t):w,f.addToken(f,z,r?r+p:p,h,t+z.length==ma?m:"",k,n));if(W>=ta){w=w.slice(ta-t);t=ta;break}t=W;h=""}w=q.slice(u,u=l[x++]);r=ie(l[x++],f.cm.options)}}else for(g=1;g<l.length;g+=2)f.addToken(f,q.slice(u,u=l[g]),ie(l[g+1],f.cm.options))}e.styleClasses&&(e.styleClasses.bgClass&&(c.bgClass=Gc(e.styleClasses.bgClass,c.bgClass||"")),e.styleClasses.textClass&&(c.textClass=Gc(e.styleClasses.textClass,c.textClass||"")));0==c.map.length&&c.map.push(0,0,c.content.appendChild(Xf(a.display.measure)));
0==d?(b.measure.map=c.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(c.map),(b.measure.caches||(b.measure.caches=[])).push({}))}N&&(d=c.content.lastChild,/\bcm-tab\b/.test(d.className)||d.querySelector&&d.querySelector(".cm-tab"))&&(c.content.className="cm-tab-wrap-hack");G(a,"renderLine",a,b.line,c.pre);c.pre.className&&(c.textClass=Gc(c.pre.className,c.textClass||""));return c}function eg(a){var b=v("span","\u2022","cm-invalidchar");b.title="\\u"+a.charCodeAt(0).toString(16);
b.setAttribute("aria-label",b.title);return b}function cg(a,b,c,d,e,f,g){if(b){var h;if(a.splitSpaces)if(h=a.trailingSpace,1<b.length&&!/  /.test(b))h=b;else{for(var k="",l=0;l<b.length;l++){var m=b.charAt(l);" "!=m||!h||l!=b.length-1&&32!=b.charCodeAt(l+1)||(m="\u00a0");k+=m;h=" "==m}h=k}else h=b;k=h;l=a.cm.state.specialChars;m=!1;if(l.test(b)){h=document.createDocumentFragment();for(var p=0;;){l.lastIndex=p;var n=l.exec(b),r=n?n.index-p:b.length-p;if(r){var q=document.createTextNode(k.slice(p,p+
r));B&&9>E?h.appendChild(v("span",[q])):h.appendChild(q);a.map.push(a.pos,a.pos+r,q);a.col+=r;a.pos+=r}if(!n)break;p+=r+1;"\t"==n[0]?(n=a.cm.options.tabSize,n-=a.col%n,r=h.appendChild(v("span",Jc(n),"cm-tab")),r.setAttribute("role","presentation"),r.setAttribute("cm-text","\t"),a.col+=n):("\r"==n[0]||"\n"==n[0]?(r=h.appendChild(v("span","\r"==n[0]?"\u240d":"\u2424","cm-invalidchar")),r.setAttribute("cm-text",n[0])):(r=a.cm.options.specialCharPlaceholder(n[0]),r.setAttribute("cm-text",n[0]),B&&9>E?
h.appendChild(v("span",[r])):h.appendChild(r)),a.col+=1);a.map.push(a.pos,a.pos+1,r);a.pos++}}else a.col+=b.length,h=document.createTextNode(k),a.map.push(a.pos,a.pos+b.length,h),B&&9>E&&(m=!0),a.pos+=b.length;a.trailingSpace=32==k.charCodeAt(b.length-1);if(c||d||e||m||g)return b=c||"",d&&(b+=d),e&&(b+=e),d=v("span",[h],b,g),f&&(d.title=f),a.content.appendChild(d);a.content.appendChild(h)}}function dg(a,b){return function(c,d,e,f,g,h,k){e=e?e+" cm-force-border":"cm-force-border";for(var l=c.pos,m=
l+d.length;;){for(var p=void 0,n=0;n<b.length&&!(p=b[n],p.to>l&&p.from<=l);n++);if(p.to>=m)return a(c,d,e,f,g,h,k);a(c,d.slice(0,p.to-l),e,f,null,h,k);f=null;d=d.slice(p.to-l);l=p.to}}}function ke(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e);!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id));e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e));a.pos+=b;a.trailingSpace=!1}function le(a,
b,c){for(var d=this.line=b,e;d=Ka(d,!1);)d=d.find(1,!0).line,(e||(e=[])).push(d);this.size=(this.rest=e)?C(z(this.rest))-c+1:1;this.node=this.text=null;this.hidden=La(a,b)}function jc(a,b,c){var d=[],e;for(e=b;e<c;)b=new le(a.doc,u(a.doc,e),e),e+=b.size,d.push(b);return d}function fg(a,b){var c=a.ownsGroup;if(c)try{var d=c.delayedCallbacks,e=0;do{for(;e<d.length;e++)d[e].call(null);for(var f=0;f<c.ops.length;f++){var g=c.ops[f];if(g.cursorActivityHandlers)for(;g.cursorActivityCalled<g.cursorActivityHandlers.length;)g.cursorActivityHandlers[g.cursorActivityCalled++].call(null,
g.cm)}}while(e<d.length)}finally{cb=null,b(c)}}function O(a,b){var c=a._handlers&&a._handlers[b]||hc;if(c.length){var d=Array.prototype.slice.call(arguments,2),e;cb?e=cb.delayedCallbacks:zb?e=zb:(e=zb=[],setTimeout(gg,0));for(var f=function(a){e.push(function(){return c[a].apply(null,d)})},g=0;g<c.length;++g)f(g)}}function gg(){var a=zb;zb=null;for(var b=0;b<a.length;++b)a[b]()}function me(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];if("text"==f){var f=a,g=b,h=g.text.className,
k=ne(f,g);g.text==g.node&&(g.node=k.pre);g.text.parentNode.replaceChild(k.pre,g.text);g.text=k.pre;k.bgClass!=g.bgClass||k.textClass!=g.textClass?(g.bgClass=k.bgClass,g.textClass=k.textClass,fd(f,g)):h&&(g.text.className=h)}else if("gutter"==f)oe(a,b,c,d);else if("class"==f)fd(a,b);else if("widget"==f){f=a;g=b;h=d;g.alignable&&(g.alignable=null);for(var k=g.node.firstChild,l;k;k=l)l=k.nextSibling,"CodeMirror-linewidget"==k.className&&g.node.removeChild(k);pe(f,g,h)}}b.changes=null}function Ab(a){a.node==
a.text&&(a.node=v("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),B&&8>E&&(a.node.style.zIndex=2));return a.node}function ne(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):je(a,b)}function fd(a,b){var c=b.bgClass?b.bgClass+" "+(b.line.bgClass||""):b.line.bgClass;c&&(c+=" CodeMirror-linebackground");if(b.background)c?b.background.className=
c:(b.background.parentNode.removeChild(b.background),b.background=null);else if(c){var d=Ab(b);b.background=d.insertBefore(v("div",null,c),d.firstChild);a.display.input.setUneditable(b.background)}b.line.wrapClass?Ab(b).className=b.line.wrapClass:b.node!=b.text&&(b.node.className="");b.text.className=(b.textClass?b.textClass+" "+(b.line.textClass||""):b.line.textClass)||""}function oe(a,b,c,d){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);b.gutterBackground&&(b.node.removeChild(b.gutterBackground),
b.gutterBackground=null);if(b.line.gutterClass){var e=Ab(b);b.gutterBackground=v("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px");a.display.input.setUneditable(b.gutterBackground);e.insertBefore(b.gutterBackground,b.text)}e=b.line.gutterMarkers;if(a.options.lineNumbers||e){var f=Ab(b),g=b.gutter=v("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+
"px");a.display.input.setUneditable(g);f.insertBefore(g,b.text);b.line.gutterClass&&(g.className+=" "+b.line.gutterClass);!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(v("div",Nc(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px")));if(e)for(b=0;b<a.options.gutters.length;++b)c=a.options.gutters[b],(f=e.hasOwnProperty(c)&&e[c])&&g.appendChild(v("div",[f],"CodeMirror-gutter-elt",
"left: "+d.gutterLeft[c]+"px; width: "+d.gutterWidth[c]+"px"))}}function hg(a,b,c,d){var e=ne(a,b);b.text=b.node=e.pre;e.bgClass&&(b.bgClass=e.bgClass);e.textClass&&(b.textClass=e.textClass);fd(a,b);oe(a,b,c,d);pe(a,b,d);return b.node}function pe(a,b,c){qe(a,b.line,b,c,!0);if(b.rest)for(var d=0;d<b.rest.length;d++)qe(a,b.rest[d],b,c,!1)}function qe(a,b,c,d,e){if(b.widgets){var f=Ab(c),g=0;for(b=b.widgets;g<b.length;++g){var h=b[g],k=v("div",[h.node],"CodeMirror-linewidget");h.handleMouseEvents||k.setAttribute("cm-ignore-events",
"true");var l=h,m=k,p=d;if(l.noHScroll){(c.alignable||(c.alignable=[])).push(m);var n=p.wrapperWidth;m.style.left=p.fixedPos+"px";l.coverGutter||(n-=p.gutterTotalWidth,m.style.paddingLeft=p.gutterTotalWidth+"px");m.style.width=n+"px"}l.coverGutter&&(m.style.zIndex=5,m.style.position="relative",l.noHScroll||(m.style.marginLeft=-p.gutterTotalWidth+"px"));a.display.input.setUneditable(k);e&&h.above?f.insertBefore(k,c.gutter||c.text):f.appendChild(k);O(h,"redraw")}}}function Bb(a){if(null!=a.height)return a.height;
var b=a.doc.cm;if(!b)return 0;if(!Zb(document.body,a.node)){var c="position: relative;";a.coverGutter&&(c+="margin-left: -"+b.display.gutters.offsetWidth+"px;");a.noHScroll&&(c+="width: "+b.display.wrapper.clientWidth+"px;");Y(b.display.measure,v("div",[a.node],null,c))}return a.height=a.node.parentNode.offsetHeight}function ua(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}
function gd(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function re(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=Y(a.measure,v("pre","x")),b=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,b={left:parseInt(b.paddingLeft),right:parseInt(b.paddingRight)};isNaN(b.left)||isNaN(b.right)||(a.cachedPaddingH=b);return b}function na(a){return 30-a.display.nativeBarWidth}function Na(a){return a.display.scroller.clientWidth-na(a)-a.display.barWidth}function hd(a){return a.display.scroller.clientHeight-
na(a)-a.display.barHeight}function se(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;d<a.rest.length;d++)if(a.rest[d]==b)return{map:a.measure.maps[d],cache:a.measure.caches[d]};for(b=0;b<a.rest.length;b++)if(C(a.rest[b])>c)return{map:a.measure.maps[b],cache:a.measure.caches[b],before:!0}}function id(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[Oa(a,b)];var c=a.display.externalMeasured;if(c&&b>=c.lineN&&b<c.lineN+c.size)return c}function Ya(a,
b){var c=C(b),d=id(a,c);d&&!d.text?d=null:d&&d.changes&&(me(a,d,c,jd(a)),a.curOp.forceUpdate=!0);if(!d){var e;e=ka(b);d=C(e);e=a.display.externalMeasured=new le(a.doc,e,d);e.lineN=d;d=e.built=je(a,e);e.text=d.pre;Y(a.display.lineMeasure,d.pre);d=e}c=se(d,b,c);return{line:b,view:d,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function ra(a,b,c,d,e){b.before&&(c=-1);var f=c+(d||"");if(b.cache.hasOwnProperty(f))a=b.cache[f];else{b.rect||(b.rect=b.view.text.getBoundingClientRect());
if(!b.hasHeights){var g=b.view,h=b.rect,k=a.options.lineWrapping,l=k&&Na(a);if(!g.measure.heights||k&&g.measure.width!=l){var m=g.measure.heights=[];if(k)for(g.measure.width=l,g=g.text.firstChild.getClientRects(),k=0;k<g.length-1;k++){var l=g[k],p=g[k+1];2<Math.abs(l.bottom-p.bottom)&&m.push((l.bottom+p.top)/2-h.top)}m.push(h.bottom-h.top)}b.hasHeights=!0}m=d;g=te(b.map,c,m);d=g.node;h=g.start;k=g.end;c=g.collapse;var n;if(3==d.nodeType){for(var r=0;4>r;r++){for(;h&&Lc(b.line.text.charAt(g.coverStart+
h));)--h;for(;g.coverStart+k<g.coverEnd&&Lc(b.line.text.charAt(g.coverStart+k));)++k;if(B&&9>E&&0==h&&k==g.coverEnd-g.coverStart)n=d.parentNode.getBoundingClientRect();else{n=bb(d,h,k).getClientRects();k=ue;if("left"==m)for(l=0;l<n.length&&(k=n[l]).left==k.right;l++);else for(l=n.length-1;0<=l&&(k=n[l]).left==k.right;l--);n=k}if(n.left||n.right||0==h)break;k=h;--h;c="right"}B&&11>E&&((r=!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI)||(null!=kd?r=kd:(m=Y(a.display.measure,
v("span","x")),r=m.getBoundingClientRect(),m=bb(m,0,1).getBoundingClientRect(),r=kd=1<Math.abs(r.left-m.left)),r=!r),r||(r=screen.logicalXDPI/screen.deviceXDPI,m=screen.logicalYDPI/screen.deviceYDPI,n={left:n.left*r,right:n.right*r,top:n.top*m,bottom:n.bottom*m}))}else 0<h&&(c=m="right"),n=a.options.lineWrapping&&1<(r=d.getClientRects()).length?r["right"==m?r.length-1:0]:d.getBoundingClientRect();!(B&&9>E)||h||n&&(n.left||n.right)||(n=(n=d.parentNode.getClientRects()[0])?{left:n.left,right:n.left+
Cb(a.display),top:n.top,bottom:n.bottom}:ue);d=n.top-b.rect.top;h=n.bottom-b.rect.top;r=(d+h)/2;m=b.view.measure.heights;for(g=0;g<m.length-1&&!(r<m[g]);g++);c={left:("right"==c?n.right:n.left)-b.rect.left,right:("left"==c?n.left:n.right)-b.rect.left,top:g?m[g-1]:0,bottom:m[g]};n.left||n.right||(c.bogus=!0);a.options.singleCursorHeightPerLine||(c.rtop=d,c.rbottom=h);a=c;a.bogus||(b.cache[f]=a)}return{left:a.left,right:a.right,top:e?a.rtop:a.top,bottom:e?a.rbottom:a.bottom}}function te(a,b,c){for(var d,
e,f,g,h,k,l=0;l<a.length;l+=3){h=a[l];k=a[l+1];if(b<h)e=0,f=1,g="left";else if(b<k)e=b-h,f=e+1;else if(l==a.length-3||b==k&&a[l+3]>b)f=k-h,e=f-1,b>=k&&(g="right");if(null!=e){d=a[l+2];h==k&&c==(d.insertLeft?"left":"right")&&(g=c);if("left"==c&&0==e)for(;l&&a[l-2]==a[l-3]&&a[l-1].insertLeft;)d=a[(l-=3)+2],g="left";if("right"==c&&e==k-h)for(;l<a.length-3&&a[l+3]==a[l+4]&&!a[l+5].insertLeft;)d=a[(l+=3)+2],g="right";break}}return{node:d,start:e,end:f,collapse:g,coverStart:h,coverEnd:k}}function ve(a){if(a.measure&&
(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function we(a){a.display.externalMeasure=null;ba(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)ve(a.display.view[b])}function Db(a){we(a);a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null;a.options.lineWrapping||(a.display.maxLineChanged=!0);a.display.lineNumChars=null}function Ma(a,b,c,d,e){if(!e&&b.widgets)for(e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=
Bb(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=la(b);b="local"==d?b+a.display.lineSpace.offsetTop:b-a.display.viewOffset;if("page"==d||"window"==d)a=a.display.lineSpace.getBoundingClientRect(),b+=a.top+("window"==d?0:window.pageYOffset||(document.documentElement||document.body).scrollTop),d=a.left+("window"==d?0:window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=d,c.right+=d;c.top+=b;c.bottom+=b;return c}function xe(a,b,c){if("div"==c)return b;
var d=b.left;b=b.top;"page"==c?(d-=window.pageXOffset||(document.documentElement||document.body).scrollLeft,b-=window.pageYOffset||(document.documentElement||document.body).scrollTop):"local"!=c&&c||(c=a.display.sizer.getBoundingClientRect(),d+=c.left,b+=c.top);a=a.display.lineSpace.getBoundingClientRect();return{left:d-a.left,top:b-a.top}}function kc(a,b,c,d,e){d||(d=u(a.doc,b.line));var f=d;b=b.ch;d=ra(a,Ya(a,d),b,e);return Ma(a,f,d,c)}function ga(a,b,c,d,e,f){function g(b,g){var h=ra(a,e,b,g?"right":
"left",f);g?h.left=h.right:h.right=h.left;return Ma(a,d,h,c)}function h(a,b,d){return g(d?a-1:a,0!=k[b].level%2!=d)}d=d||u(a.doc,b.line);e||(e=Ya(a,d));var k=za(d,a.doc.direction),l=b.ch;b=b.sticky;l>=d.text.length?(l=d.text.length,b="before"):0>=l&&(l=0,b="after");if(!k)return g("before"==b?l-1:l,"before"==b);var m=Uc(k,l,b),p=wb,m=h(l,m,"before"==b);null!=p&&(m.other=h(l,p,"before"!=b));return m}function ye(a,b){var c=0;b=w(a.doc,b);a.options.lineWrapping||(c=Cb(a.display)*b.ch);var d=u(a.doc,b.line),
e=la(d)+a.display.lineSpace.offsetTop;return{left:c,right:c,top:e,bottom:e+d.height}}function ld(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(0>c)return a=q(d.first,0,null),a.xRel=-1,a.outside=!0,a;var e=Ja(d,c),f=d.first+d.size-1;if(e>f)return a=u(d,f).text.length,a=q(d.first+d.size-1,a,null),a.xRel=1,a.outside=!0,a;0>b&&(b=0);for(f=u(d,e);;)if(d=ig(a,f,e,b,c),f=(e=Ka(f,!1))&&e.find(0,!0),e&&(d.ch>f.from.ch||d.ch==f.from.ch&&0<d.xRel))e=C(f=f.to.line);else return d}function Yd(a,b,c,d){var e=b.text.length,
f=cc(function(e){return Ma(a,b,ra(a,c,e-1),"line").bottom<=d},e,0),e=cc(function(e){return Ma(a,b,ra(a,c,e),"line").top>d},f,e);return{begin:f,end:e}}function ig(a,b,c,d,e){e-=la(b);var f=0,g=b.text.length,h=Ya(a,b);if(za(b,a.doc.direction)){if(a.options.lineWrapping){var k;k=Yd(a,b,h,e);f=k.begin;g=k.end;k}c=new q(c,f);var l=ga(a,c,"line",b,h).left;k=l<d?1:-1;var m=l-d,p;do{l=m;p=c;c=Xd(a,b,c,k);if(null==c||c.ch<f||g<=("before"==c.sticky?c.ch-1:c.ch)){c=p;break}m=ga(a,c,"line",b,h).left-d}while(0>
k!=0>m&&Math.abs(m)<=Math.abs(l));if(Math.abs(m)>Math.abs(l)){if(0>m==0>l)throw Error("Broke out of infinite loop in coordsCharInner");c=p}}else f=cc(function(c){var f=Ma(a,b,ra(a,h,c),"line");return f.top>e?(g=Math.min(c,g),!0):f.bottom<=e?!1:f.left>d?!0:f.right<d?!1:d-f.left<f.right-d},f,g),f=Pd(b.text,f,1),c=new q(c,f,f==g?"before":"after");f=ga(a,c,"line",b,h);if(e<f.top||f.bottom<e)c.outside=!0;c.xRel=d<f.left?-1:d>f.right?1:0;return c}function Pa(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;
if(null==Qa){Qa=v("pre");for(var b=0;49>b;++b)Qa.appendChild(document.createTextNode("x")),Qa.appendChild(v("br"));Qa.appendChild(document.createTextNode("x"))}Y(a.measure,Qa);b=Qa.offsetHeight/50;3<b&&(a.cachedTextHeight=b);ba(a.measure);return b||1}function Cb(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=v("span","xxxxxxxxxx"),c=v("pre",[b]);Y(a.measure,c);b=b.getBoundingClientRect();b=(b.right-b.left)/10;2<b&&(a.cachedCharWidth=b);return b||10}function jd(a){for(var b=a.display,
c={},d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g)c[a.options.gutters[g]]=f.offsetLeft+f.clientLeft+e,d[a.options.gutters[g]]=f.clientWidth;return{fixedPos:md(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function md(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function ze(a){var b=Pa(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/
Cb(a.display)-3);return function(e){if(La(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function nd(a){var b=a.doc,c=ze(a);b.iter(function(a){var b=c(a);b!=a.height&&ja(a,b)})}function Ra(a,b,c,d){var e=a.display;if(!c&&"true"==(b.target||b.srcElement).getAttribute("cm-not-content"))return null;var f,g;c=e.lineSpace.getBoundingClientRect();try{f=b.clientX-c.left,g=b.clientY-
c.top}catch(k){return null}b=ld(a,f,g);var h;d&&1==b.xRel&&(h=u(a.doc,b.line).text).length==b.ch&&(d=ca(h,h.length,a.options.tabSize)-h.length,b=q(b.line,Math.max(0,Math.round((f-re(a.display).left)/Cb(a.display))-d)));return b}function Oa(a,b){if(b>=a.display.viewTo)return null;b-=a.display.viewFrom;if(0>b)return null;for(var c=a.display.view,d=0;d<c.length;d++)if(b-=c[d].size,0>b)return d}function Eb(a){a.display.input.showSelection(a.display.input.prepareSelection())}function Ae(a,b){for(var c=
a.doc,d={},e=d.cursors=document.createDocumentFragment(),f=d.selection=document.createDocumentFragment(),g=0;g<c.sel.ranges.length;g++)if(!1!==b||g!=c.sel.primIndex){var h=c.sel.ranges[g];if(!(h.from().line>=a.display.viewTo||h.to().line<a.display.viewFrom)){var k=h.empty();(k||a.options.showCursorWhenSelecting)&&Be(a,h.head,e);k||jg(a,h,f)}}return d}function Be(a,b,c){b=ga(a,b,"div",null,null,!a.options.singleCursorHeightPerLine);var d=c.appendChild(v("div","\u00a0","CodeMirror-cursor"));d.style.left=
b.left+"px";d.style.top=b.top+"px";d.style.height=Math.max(0,b.bottom-b.top)*a.options.cursorHeight+"px";b.other&&(a=c.appendChild(v("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor")),a.style.display="",a.style.left=b.other.left+"px",a.style.top=b.other.top+"px",a.style.height=.85*(b.other.bottom-b.other.top)+"px")}function jg(a,b,c){function d(a,b,d,c){0>b&&(b=0);b=Math.round(b);c=Math.round(c);h.appendChild(v("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px;\n                             top: "+
b+"px; width: "+(null==d?m-a:d)+"px;\n                             height: "+(c-b)+"px"))}function e(b,c,e){var f=u(g,b),h=f.text.length,k,n;Vf(za(f,g.direction),c||0,null==e?h:e,function(g,p,r){var D=kc(a,q(b,g),"div",f,"left"),t,u;g==p?(t=D,r=u=D.left):(t=kc(a,q(b,p-1),"div",f,"right"),"rtl"==r&&(r=D,D=t,t=r),r=D.left,u=t.right);null==c&&0==g&&(r=l);3<t.top-D.top&&(d(r,D.top,null,D.bottom),r=l,D.bottom<t.top&&d(r,D.bottom,null,t.top));null==e&&p==h&&(u=m);if(!k||D.top<k.top||D.top==k.top&&D.left<
k.left)k=D;if(!n||t.bottom>n.bottom||t.bottom==n.bottom&&t.right>n.right)n=t;r<l+1&&(r=l);d(r,t.top,u-r,t.bottom)});return{start:k,end:n}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),k=re(a.display),l=k.left,m=Math.max(f.sizerWidth,Na(a)-f.sizer.offsetLeft)-k.right,f=b.from();b=b.to();if(f.line==b.line)e(f.line,f.ch,b.ch);else{var p=u(g,f.line),k=u(g,b.line),k=ka(p)==ka(k),f=e(f.line,f.ch,k?p.text.length+1:null).end;b=e(b.line,k?0:null,b.ch).start;k&&(f.top<b.top-2?(d(f.right,f.top,
null,f.bottom),d(l,b.top,b.left,b.bottom)):d(f.right,f.top,b.left-f.right,f.bottom));f.bottom<b.top&&d(l,f.bottom,null,b.top)}c.appendChild(h)}function od(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility="";0<a.options.cursorBlinkRate?b.blinker=setInterval(function(){return b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):0>a.options.cursorBlinkRate&&(b.cursorDiv.style.visibility="hidden")}}function Ce(a){a.state.focused||
(a.display.input.focus(),pd(a))}function kg(a){a.state.delayingBlurEvent=!0;setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,Fb(a))},100)}function pd(a,b){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1);"nocursor"!=a.options.readOnly&&(a.state.focused||(G(a,"focus",a,b),a.state.focused=!0,Ga(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),N&&setTimeout(function(){return a.display.input.reset(!0)},
20)),a.display.input.receivedFocus()),od(a))}function Fb(a,b){a.state.delayingBlurEvent||(a.state.focused&&(G(a,"blur",a,b),a.state.focused=!1,Sa(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function qd(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=md(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&
(c[g].gutter&&(c[g].gutter.style.left=f),c[g].gutterBackground&&(c[g].gutterBackground.style.left=f));var h=c[g].alignable;if(h)for(var k=0;k<h.length;k++)h[k].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function De(a){if(!a.options.lineNumbers)return!1;var b=a.doc,b=Nc(a.options,b.first+b.size-1),c=a.display;if(b.length!=c.lineNumChars){var d=c.measure.appendChild(v("div",[v("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=d.firstChild.offsetWidth,d=d.offsetWidth-
e;c.lineGutter.style.width="";c.lineNumInnerWidth=Math.max(e,c.lineGutter.offsetWidth-d)+1;c.lineNumWidth=c.lineNumInnerWidth+d;c.lineNumChars=c.lineNumInnerWidth?b.length:-1;c.lineGutter.style.width=c.lineNumWidth+"px";rd(a);return!0}return!1}function lc(a){a=a.display;for(var b=a.lineDiv.offsetTop,c=0;c<a.view.length;c++){var d=a.view[c],e;if(!d.hidden){if(B&&8>E){var f=d.node.offsetTop+d.node.offsetHeight;e=f-b;b=f}else e=d.node.getBoundingClientRect(),e=e.bottom-e.top;f=d.line.height-e;2>e&&(e=
Pa(a));if(.001<f||-.001>f)if(ja(d.line,e),Ee(d.line),d.rest)for(e=0;e<d.rest.length;e++)Ee(d.rest[e])}}}function Ee(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.parentNode.offsetHeight}function sd(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop,d=Math.floor(d-a.lineSpace.offsetTop),e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,d=Ja(b,d),e=Ja(b,e);if(c&&c.ensure){var f=c.ensure.from.line;c=c.ensure.to.line;f<d?(d=f,e=Ja(b,la(u(b,
f))+a.wrapper.clientHeight)):Math.min(c,b.lastLine())>=e&&(d=Ja(b,la(u(b,c))-a.wrapper.clientHeight),e=c)}return{from:d,to:Math.max(e,d+1)}}function Gb(a,b){2>Math.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,xa||td(a,{top:b}),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbars.setScrollTop(b),xa&&td(a),Hb(a,100))}function db(a,b,c){(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),
a.doc.scrollLeft=b,qd(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function Fe(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail);null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:null==c&&(c=a.wheelDelta);return{x:b,y:c}}function lg(a){a=Fe(a);a.x*=Z;a.y*=Z;return a}function Ge(a,b){var c=Fe(b),d=c.x,c=c.y,e=a.display,f=e.scroller,g=f.scrollWidth>f.clientWidth,h=f.scrollHeight>f.clientHeight;
if(d&&g||c&&h){if(c&&fa&&N){var g=b.target,k=e.view;a:for(;g!=f;g=g.parentNode)for(var l=0;l<k.length;l++)if(k[l].node==g){a.display.currentWheelTarget=g;break a}}!d||xa||ha||null==Z?(c&&null!=Z&&(h=c*Z,g=a.doc.scrollTop,k=g+e.wrapper.clientHeight,0>h?g=Math.max(0,g+h-50):k=Math.min(a.doc.height,k+h+50),td(a,{top:g,bottom:k})),20>mc&&(null==e.wheelStartX?(e.wheelStartX=f.scrollLeft,e.wheelStartY=f.scrollTop,e.wheelDX=d,e.wheelDY=c,setTimeout(function(){if(null!=e.wheelStartX){var a=f.scrollLeft-e.wheelStartX,
b=f.scrollTop-e.wheelStartY,a=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null;a&&(Z=(Z*mc+a)/(mc+1),++mc)}},200)):(e.wheelDX+=d,e.wheelDY+=c))):(c&&h&&Gb(a,Math.max(0,Math.min(f.scrollTop+c*Z,f.scrollHeight-f.clientHeight))),db(a,Math.max(0,Math.min(f.scrollLeft+d*Z,f.scrollWidth-f.clientWidth))),(!c||c&&h)&&Q(b),e.wheelStartX=null)}}function Ib(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+gd(a.display));return{clientHeight:b.scroller.clientHeight,
viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+na(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function eb(a,b){b||(b=Ib(a));var c=a.display.barWidth,d=a.display.barHeight;He(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&lc(a),He(a,Ib(a)),c=a.display.barWidth,d=
a.display.barHeight}function He(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px";c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px";c.heightForcer.style.borderBottom=d.bottom+"px solid transparent";d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="";d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?
(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function Ie(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&Sa(a.display.wrapper,a.display.scrollbars.addClass));a.display.scrollbars=new Je[a.options.scrollbarStyle](function(b){a.display.wrapper.insertBefore(b,a.display.scrollbarFiller);t(b,"mousedown",function(){a.state.focused&&setTimeout(function(){return a.display.input.focus()},
0)});b.setAttribute("cm-not-content","true")},function(b,c){"horizontal"==c?db(a,b):Gb(a,b)},a);a.display.scrollbars.addClass&&Ga(a.display.wrapper,a.display.scrollbars.addClass)}function nc(a,b){var c=a.display,d=Pa(a.display);0>b.top&&(b.top=0);var e=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:c.scroller.scrollTop,f=hd(a),g={};b.bottom-b.top>f&&(b.bottom=b.top+f);var h=a.doc.height+gd(c),k=b.top<d,d=b.bottom>h-d;b.top<e?g.scrollTop=k?0:b.top:b.bottom>e+f&&(f=Math.min(b.top,(d?h:b.bottom)-
f),f!=e&&(g.scrollTop=f));e=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:c.scroller.scrollLeft;c=Na(a)-(a.options.fixedGutter?c.gutters.offsetWidth:0);if(f=b.right-b.left>c)b.right=b.left+c;10>b.left?g.scrollLeft=0:b.left<e?g.scrollLeft=Math.max(0,b.left-(f?0:10)):b.right>c+e-3&&(g.scrollLeft=b.right+(f?0:10)-c);return g}function oc(a,b,c){null==b&&null==c||pc(a);null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b);null!=c&&(a.curOp.scrollTop=(null==
a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function fb(a){pc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?q(b.line,b.ch-1):b,d=q(b.line,b.ch+1));a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin}}function pc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=ye(a,b.from),d=ye(a,b.to),b=nc(a,{left:Math.min(c.left,d.left),top:Math.min(c.top,d.top)-b.margin,right:Math.max(c.right,d.right),bottom:Math.max(c.bottom,d.bottom)+b.margin});a.scrollTo(b.scrollLeft,
b.scrollTop)}}function gb(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++mg};a=a.curOp;cb?cb.ops.push(a):a.ownsGroup=cb={ops:[a],delayedCallbacks:[]}}function hb(a){fg(a.curOp,function(a){for(var b=0;b<a.ops.length;b++)a.ops[b].cm.curOp=null;a=a.ops;for(b=0;b<a.length;b++){var d=a[b],
e=d.cm,f=e.display,g=e.display;!g.scrollbarsClipped&&g.scroller.offsetWidth&&(g.nativeBarWidth=g.scroller.offsetWidth-g.scroller.clientWidth,g.heightForcer.style.height=na(e)+"px",g.sizer.style.marginBottom=-g.nativeBarWidth+"px",g.sizer.style.borderRightWidth=na(e)+"px",g.scrollbarsClipped=!0);d.updateMaxLine&&Tc(e);d.mustUpdate=d.viewChanged||d.forceUpdate||null!=d.scrollTop||d.scrollToPos&&(d.scrollToPos.from.line<f.viewFrom||d.scrollToPos.to.line>=f.viewTo)||f.maxLineChanged&&e.options.lineWrapping;
d.update=d.mustUpdate&&new qc(e,d.mustUpdate&&{top:d.scrollTop,ensure:d.scrollToPos},d.forceUpdate)}for(b=0;b<a.length;b++)d=a[b],d.updatedDisplay=d.mustUpdate&&ud(d.cm,d.update);for(b=0;b<a.length;b++)if(d=a[b],e=d.cm,f=e.display,d.updatedDisplay&&lc(e),d.barMeasure=Ib(e),f.maxLineChanged&&!e.options.lineWrapping&&(g=f.maxLine.text.length,g=ra(e,Ya(e,f.maxLine),g,void 0),d.adjustWidthTo=g.left+3,e.display.sizerWidth=d.adjustWidthTo,d.barMeasure.scrollWidth=Math.max(f.scroller.clientWidth,f.sizer.offsetLeft+
d.adjustWidthTo+na(e)+e.display.barWidth),d.maxScrollLeft=Math.max(0,f.sizer.offsetLeft+d.adjustWidthTo-Na(e))),d.updatedDisplay||d.selectionChanged)d.preparedSelection=f.input.prepareSelection(d.focus);for(b=0;b<a.length;b++)d=a[b],e=d.cm,null!=d.adjustWidthTo&&(e.display.sizer.style.minWidth=d.adjustWidthTo+"px",d.maxScrollLeft<e.doc.scrollLeft&&db(e,Math.min(e.display.scroller.scrollLeft,d.maxScrollLeft),!0),e.display.maxLineChanged=!1),f=d.focus&&d.focus==qa()&&(!document.hasFocus||document.hasFocus()),
d.preparedSelection&&e.display.input.showSelection(d.preparedSelection,f),(d.updatedDisplay||d.startHeight!=e.doc.height)&&eb(e,d.barMeasure),d.updatedDisplay&&vd(e,d.barMeasure),d.selectionChanged&&od(e),e.state.focused&&d.updateInput&&e.display.input.reset(d.typing),f&&Ce(d.cm);for(b=0;b<a.length;b++){var h=void 0,d=a[b],e=d.cm,f=e.display,g=e.doc;d.updatedDisplay&&Ke(e,d.update);null==f.wheelStartX||null==d.scrollTop&&null==d.scrollLeft&&!d.scrollToPos||(f.wheelStartX=f.wheelStartY=null);null==
d.scrollTop||f.scroller.scrollTop==d.scrollTop&&!d.forceScroll||(g.scrollTop=Math.max(0,Math.min(f.scroller.scrollHeight-f.scroller.clientHeight,d.scrollTop)),f.scrollbars.setScrollTop(g.scrollTop),f.scroller.scrollTop=g.scrollTop);null==d.scrollLeft||f.scroller.scrollLeft==d.scrollLeft&&!d.forceScroll||(g.scrollLeft=Math.max(0,Math.min(f.scroller.scrollWidth-f.scroller.clientWidth,d.scrollLeft)),f.scrollbars.setScrollLeft(g.scrollLeft),f.scroller.scrollLeft=g.scrollLeft,qd(e));if(d.scrollToPos){var k=
w(g,d.scrollToPos.from),l=w(g,d.scrollToPos.to),m=d.scrollToPos.margin;null==m&&(m=0);for(var p=0;5>p;p++){var n=!1,h=ga(e,k),r=l&&l!=k?ga(e,l):h,h={left:Math.min(h.left,r.left),top:Math.min(h.top,r.top)-m,right:Math.max(h.left,r.left),bottom:Math.max(h.bottom,r.bottom)+m},r=nc(e,h),q=e.doc.scrollTop,t=e.doc.scrollLeft;null!=r.scrollTop&&(Gb(e,r.scrollTop),1<Math.abs(e.doc.scrollTop-q)&&(n=!0));null!=r.scrollLeft&&(db(e,r.scrollLeft),1<Math.abs(e.doc.scrollLeft-t)&&(n=!0));if(!n)break}l=h;I(e,"scrollCursorIntoView")||
(m=e.display,p=m.sizer.getBoundingClientRect(),k=null,0>l.top+p.top?k=!0:l.bottom+p.top>(window.innerHeight||document.documentElement.clientHeight)&&(k=!1),null==k||ng||(l=v("div","\u200b",null,"position: absolute;\n                         top: "+(l.top-m.viewOffset-e.display.lineSpace.offsetTop)+"px;\n                         height: "+(l.bottom-l.top+na(e)+m.barHeight)+"px;\n                         left: "+l.left+"px; width: "+Math.max(2,l.right-l.left)+"px;"),e.display.lineSpace.appendChild(l),
l.scrollIntoView(k),e.display.lineSpace.removeChild(l)))}l=d.maybeHiddenMarkers;k=d.maybeUnhiddenMarkers;if(l)for(m=0;m<l.length;++m)l[m].lines.length||G(l[m],"hide");if(k)for(l=0;l<k.length;++l)k[l].lines.length&&G(k[l],"unhide");f.wrapper.offsetHeight&&(g.scrollTop=e.display.scroller.scrollTop);d.changeObjs&&G(e,"changes",e,d.changeObjs);d.update&&d.update.finish()}})}function X(a,b){if(a.curOp)return b();gb(a);try{return b()}finally{hb(a)}}function K(a,b){return function(){if(a.curOp)return b.apply(a,
arguments);gb(a);try{return b.apply(a,arguments)}finally{hb(a)}}}function S(a){return function(){if(this.curOp)return a.apply(this,arguments);gb(this);try{return a.apply(this,arguments)}finally{hb(this)}}}function L(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);gb(b);try{return a.apply(this,arguments)}finally{hb(b)}}}function T(a,b,c,d){null==b&&(b=a.doc.first);null==c&&(c=a.doc.first+a.doc.size);d||(d=0);var e=a.display;d&&c<e.viewTo&&(null==e.updateLineNumbers||
e.updateLineNumbers>b)&&(e.updateLineNumbers=b);a.curOp.viewChanged=!0;if(b>=e.viewTo)ya&&Rc(a.doc,b)<e.viewTo&&Aa(a);else if(c<=e.viewFrom)ya&&Wd(a.doc,c+d)>e.viewFrom?Aa(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Aa(a);else if(b<=e.viewFrom){var f=rc(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Aa(a)}else if(c>=e.viewTo)(f=rc(a,b,b,-1))?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Aa(a);else{var f=rc(a,b,b,-1),g=rc(a,c,c+d,1);f&&g?(e.view=
e.view.slice(0,f.index).concat(jc(a,f.lineN,g.lineN)).concat(e.view.slice(g.index)),e.viewTo+=d):Aa(a)}if(a=e.externalMeasured)c<a.lineN?a.lineN+=d:b<a.lineN+a.size&&(e.externalMeasured=null)}function Ba(a,b,c){a.curOp.viewChanged=!0;var d=a.display,e=a.display.externalMeasured;e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null);b<d.viewFrom||b>=d.viewTo||(a=d.view[Oa(a,b)],null!=a.node&&(a=a.changes||(a.changes=[]),-1==M(a,c)&&a.push(c)))}function Aa(a){a.display.viewFrom=a.display.viewTo=
a.doc.first;a.display.view=[];a.display.viewOffset=0}function rc(a,b,c,d){var e=Oa(a,b),f=a.display.view;if(!ya||c==a.doc.first+a.doc.size)return{index:e,lineN:c};for(var g=a.display.viewFrom,h=0;h<e;h++)g+=f[h].size;if(g!=b){if(0<d){if(e==f.length-1)return null;b=g+f[e].size-b;e++}else b=g-b;c+=b}for(;Rc(a.doc,c)!=c;){if(e==(0>d?0:f.length-1))return null;c+=d*f[e-(0>d?1:0)].size;e+=d}return{index:e,lineN:c}}function Le(a){a=a.display.view;for(var b=0,c=0;c<a.length;c++){var d=a[c];d.hidden||d.node&&
!d.changes||++b}return b}function Hb(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.viewTo&&a.state.highlight.set(b,Hc(og,a))}function og(a){var b=a.doc;b.frontier<b.first&&(b.frontier=b.first);if(!(b.frontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,d=sa(b.mode,yb(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength,k=ce(a,f,h?sa(b.mode,d):
d,!0);f.styles=k.styles;var l=f.styleClasses;(k=k.classes)?f.styleClasses=k:l&&(f.styleClasses=null);l=!g||g.length!=f.styles.length||l!=k&&(!l||!k||l.bgClass!=k.bgClass||l.textClass!=k.textClass);for(k=0;!l&&k<g.length;++k)l=g[k]!=f.styles[k];l&&e.push(b.frontier);f.stateAfter=h?d:sa(b.mode,d)}else f.text.length<=a.options.maxHighlightLength&&cd(a,f.text,d),f.stateAfter=0==b.frontier%5?sa(b.mode,d):null;++b.frontier;if(+new Date>c)return Hb(a,a.options.workDelay),!0});e.length&&X(a,function(){for(var b=
0;b<e.length;b++)Ba(a,e[b],"text")})}}function ud(a,b){var c=a.display,d=a.doc;if(b.editorIsHidden)return Aa(a),!1;if(!b.force&&b.visible.from>=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Le(a))return!1;De(a)&&(Aa(a),b.dims=jd(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFrom<f&&20>f-c.viewFrom&&(f=Math.max(d.first,c.viewFrom));
c.viewTo>g&&20>c.viewTo-g&&(g=Math.min(e,c.viewTo));ya&&(f=Rc(a.doc,f),g=Wd(a.doc,g));d=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;e=a.display;0==e.view.length||f>=e.viewTo||g<=e.viewFrom?(e.view=jc(a,f,g),e.viewFrom=f):(e.viewFrom>f?e.view=jc(a,f,e.viewFrom).concat(e.view):e.viewFrom<f&&(e.view=e.view.slice(Oa(a,f))),e.viewFrom=f,e.viewTo<g?e.view=e.view.concat(jc(a,e.viewTo,g)):e.viewTo>g&&(e.view=e.view.slice(0,Oa(a,g))));e.viewTo=g;c.viewOffset=
la(u(a.doc,c.viewFrom));a.display.mover.style.top=c.viewOffset+"px";g=Le(a);if(!d&&0==g&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;f=qa();4<g&&(c.lineDiv.style.display="none");pg(a,c.updateLineNumbers,b.dims);4<g&&(c.lineDiv.style.display="");c.renderedView=c.view;f&&qa()!=f&&f.offsetHeight&&f.focus();ba(c.cursorDiv);ba(c.selectionDiv);c.gutters.style.height=c.sizer.style.minHeight=0;d&&(c.lastWrapHeight=b.wrapperHeight,c.lastWrapWidth=b.wrapperWidth,
Hb(a,400));c.updateLineNumbers=null;return!0}function Ke(a,b){for(var c=b.viewport,d=!0;;d=!1){if(!d||!a.options.lineWrapping||b.oldDisplayWidth==Na(a))if(c&&null!=c.top&&(c={top:Math.min(a.doc.height+gd(a.display)-hd(a),c.top)}),b.visible=sd(a.display,a.doc,c),b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)break;if(!ud(a,b))break;lc(a);d=Ib(a);Eb(a);eb(a,d);vd(a,d)}b.signal(a,"update",a);if(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)b.signal(a,
"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo}function td(a,b){var c=new qc(a,b);if(ud(a,c)){lc(a);Ke(a,c);var d=Ib(a);Eb(a);eb(a,d);vd(a,d);c.finish()}}function pg(a,b,c){function d(b){var d=b.nextSibling;N&&fa&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b);return d}for(var e=a.display,f=a.options.lineNumbers,g=e.lineDiv,h=g.firstChild,k=e.view,e=e.viewFrom,l=0;l<
k.length;l++){var m=k[l];if(!m.hidden)if(m.node&&m.node.parentNode==g){for(;h!=m.node;)h=d(h);h=f&&null!=b&&b<=e&&m.lineNumber;m.changes&&(-1<M(m.changes,"gutter")&&(h=!1),me(a,m,e,c));h&&(ba(m.lineNumber),m.lineNumber.appendChild(document.createTextNode(Nc(a.options,e))));h=m.node.nextSibling}else{var p=hg(a,m,e,c);g.insertBefore(p,h)}e+=m.size}for(;h;)h=d(h)}function rd(a){a.display.sizer.style.marginLeft=a.display.gutters.offsetWidth+"px"}function vd(a,b){a.display.sizer.style.minHeight=b.docHeight+
"px";a.display.heightForcer.style.top=b.docHeight+"px";a.display.gutters.style.height=b.docHeight+a.display.barHeight+na(a)+"px"}function Me(a){var b=a.display.gutters,c=a.options.gutters;ba(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(v("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none";rd(a)}function wd(a){var b=M(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?
a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):-1<b&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function ia(a,b){var c=a[b];a.sort(function(a,b){return x(a.from(),b.from())});b=M(a,c);for(c=1;c<a.length;c++){var d=a[c],e=a[c-1];if(0<=x(e.to(),d.from())){var f=ec(e.from(),d.from()),g=dc(e.to(),d.to()),d=e.empty()?d.from()==d.head:e.from()==e.head;c<=b&&--b;a.splice(--c,2,new y(d?g:f,d?f:g))}}return new aa(a,b)}function va(a,b){return new aa([new y(a,b||a)],0)}function Ca(a){return a.text?
q(a.from.line+a.text.length-1,z(a.text).length+(1==a.text.length?a.from.ch:0)):a.to}function Ne(a,b){if(0>x(a,b.from))return a;if(0>=x(a,b.to))return Ca(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;a.line==b.to.line&&(d+=Ca(b).ch-b.to.ch);return q(c,d)}function xd(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new y(Ne(e.anchor,b),Ne(e.head,b)))}return ia(c,a.sel.primIndex)}function Oe(a,b,c){return a.line==b.line?q(c.line,a.ch-b.ch+c.ch):q(c.line+
(a.line-b.line),a.ch)}function yd(a){a.doc.mode=ad(a.options,a.doc.modeOption);Jb(a)}function Jb(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.doc.frontier=a.doc.first;Hb(a,100);a.state.modeGen++;a.curOp&&T(a)}function Pe(a,b){return 0==b.from.ch&&0==b.to.ch&&""==z(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function zd(a,b,c,d){function e(a,c,e){a.text=c;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);null!=a.order&&(a.order=null);
Sd(a);Td(a,e);c=d?d(a):1;c!=a.height&&ja(a,c);O(a,"change",a,b)}function f(a,b){for(var e=[],f=a;f<b;++f)e.push(new ib(k[f],c?c[f]:null,d));return e}var g=b.from,h=b.to,k=b.text,l=u(a,g.line),m=u(a,h.line),p=z(k),n=c?c[k.length-1]:null,r=h.line-g.line;b.full?(a.insert(0,f(0,k.length)),a.remove(k.length,a.size-k.length)):Pe(a,b)?(h=f(0,k.length-1),e(m,m.text,n),r&&a.remove(g.line,r),h.length&&a.insert(g.line,h)):l==m?1==k.length?e(l,l.text.slice(0,g.ch)+p+l.text.slice(h.ch),n):(r=f(1,k.length-1),r.push(new ib(p+
l.text.slice(h.ch),n,d)),e(l,l.text.slice(0,g.ch)+k[0],c?c[0]:null),a.insert(g.line+1,r)):1==k.length?(e(l,l.text.slice(0,g.ch)+k[0]+m.text.slice(h.ch),c?c[0]:null),a.remove(g.line+1,r)):(e(l,l.text.slice(0,g.ch)+k[0],c?c[0]:null),e(m,p+m.text.slice(h.ch),n),n=f(1,k.length-1),1<r&&a.remove(g.line+1,r-1),a.insert(g.line+1,n));O(a,"change",a,b)}function Ta(a,b,c){function d(a,f,g){if(a.linked)for(var e=0;e<a.linked.length;++e){var k=a.linked[e];if(k.doc!=f){var l=g&&k.sharedHist;if(!c||l)b(k.doc,l),
d(k.doc,a,l)}}}d(a,null,!0)}function Qe(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;nd(a);yd(a);Re(a);a.options.lineWrapping||Tc(a);a.options.mode=b.modeOption;T(a)}function Re(a){("rtl"==a.doc.direction?Ga:Sa)(a.display.lineDiv,"CodeMirror-rtl")}function qg(a){X(a,function(){Re(a);T(a)})}function sc(a){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOrigin=this.lastSelOrigin=this.lastOp=this.lastSelOp=null;this.generation=
this.maxGeneration=a||1}function Ad(a,b){var c={from:Pc(b.from),to:Ca(b),text:Ia(a,b.from,b.to)};Se(a,c,b.from.line,b.to.line+1);Ta(a,function(a){return Se(a,c,b.from.line,b.to.line+1)},!0);return c}function Te(a){for(;a.length;)if(z(a).ranges)a.pop();else break}function Ue(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,g,h,k;if(k=e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))e.lastOp==
d?(Te(e.done),g=z(e.done)):e.done.length&&!z(e.done).ranges?g=z(e.done):1<e.done.length&&!e.done[e.done.length-2].ranges?(e.done.pop(),g=z(e.done)):g=void 0,k=g;if(k)h=z(g.changes),0==x(b.from,b.to)&&0==x(b.from,h.to)?h.to=Ca(b):g.changes.push(Ad(a,b));else for((g=z(e.done))&&g.ranges||tc(a.sel,e.done),g={changes:[Ad(a,b)],generation:e.generation},e.done.push(g);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift();e.done.push(c);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=
f;e.lastOp=e.lastSelOp=d;e.lastOrigin=e.lastSelOrigin=b.origin;h||G(a,"historyAdded")}function tc(a,b){var c=z(b);c&&c.ranges&&c.equals(a)||b.push(a)}function Se(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(d){d.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=d.markedSpans);++f})}function rg(a){if(!a)return null;for(var b,c=0;c<a.length;++c)a[c].marker.explicitlyCleared?b||(b=a.slice(0,c)):b&&b.push(a[c]);return b?b.length?b:null:a}function Ve(a,
b){var c;if(c=b["spans_"+a.id]){for(var d=[],e=0;e<b.text.length;++e)d.push(rg(c[e]));c=d}else c=null;d=Qc(a,b);if(!c)return d;if(!d)return c;for(e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g){var h=0;a:for(;h<g.length;++h){for(var k=g[h],l=0;l<f.length;++l)if(f[l].marker==k.marker)continue a;f.push(k)}}else g&&(c[e]=g)}return c}function jb(a,b,c){for(var d=[],e=0;e<a.length;++e){var f=a[e];if(f.ranges)d.push(c?aa.prototype.deepCopy.call(f):f);else{var f=f.changes,g=[];d.push({changes:g});for(var h=
0;h<f.length;++h){var k=f[h],l;g.push({from:k.from,to:k.to,text:k.text});if(b)for(var m in k)(l=m.match(/^spans_(\d+)$/))&&-1<M(b,Number(l[1]))&&(z(g)[m]=k[m],delete k[m])}}}return d}function Kb(a,b,c,d){return a.cm&&a.cm.display.shift||a.extend?(a=b.anchor,d&&(b=0>x(c,a),b!=0>x(d,a)?(a=c,c=d):b!=0>x(c,d)&&(c=d)),new y(a,c)):new y(d||c,c)}function uc(a,b,c,d){P(a,new aa([Kb(a,a.sel.primary(),b,c)],0),d)}function We(a,b,c){for(var d=[],e=0;e<a.sel.ranges.length;e++)d[e]=Kb(a,a.sel.ranges[e],b[e],null);
b=ia(d,a.sel.primIndex);P(a,b,c)}function Bd(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c;P(a,ia(e,a.sel.primIndex),d)}function sg(a,b,c){c={ranges:b.ranges,update:function(b){this.ranges=[];for(var d=0;d<b.length;d++)this.ranges[d]=new y(w(a,b[d].anchor),w(a,b[d].head))},origin:c&&c.origin};G(a,"beforeSelectionChange",a,c);a.cm&&G(a.cm,"beforeSelectionChange",a.cm,c);return c.ranges!=b.ranges?ia(c.ranges,c.ranges.length-1):b}function Xe(a,b,c){var d=a.history.done,e=z(d);e&&e.ranges?(d[d.length-1]=
b,vc(a,b,c)):P(a,b,c)}function P(a,b,c){vc(a,b,c);b=a.sel;var d=a.cm?a.cm.curOp.id:NaN,e=a.history,f=c&&c.origin,g;if(!(g=d==e.lastSelOp)&&(g=f&&e.lastSelOrigin==f)&&!(g=e.lastModTime==e.lastSelTime&&e.lastOrigin==f)){g=z(e.done);var h=f.charAt(0);g="*"==h||"+"==h&&g.ranges.length==b.ranges.length&&g.somethingSelected()==b.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}g?e.done[e.done.length-1]=b:tc(b,e.done);e.lastSelTime=+new Date;e.lastSelOrigin=
f;e.lastSelOp=d;c&&!1!==c.clearRedo&&Te(e.undone)}function vc(a,b,c){if(da(a,"beforeSelectionChange")||a.cm&&da(a.cm,"beforeSelectionChange"))b=sg(a,b,c);var d=c&&c.bias||(0>x(b.primary().head,a.sel.primary().head)?-1:1);Ye(a,Ze(a,b,d,!0));c&&!1===c.scroll||!a.cm||fb(a.cm)}function Ye(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,Zd(a.cm)),O(a,"cursorActivity",a))}function $e(a){Ye(a,Ze(a,a.sel,null,!1),oa)}function Ze(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var g=
b.ranges[f],h=b.ranges.length==a.sel.ranges.length&&a.sel.ranges[f],k=Cd(a,g.anchor,h&&h.anchor,c,d),h=Cd(a,g.head,h&&h.head,c,d);if(e||k!=g.anchor||h!=g.head)e||(e=b.ranges.slice(0,f)),e[f]=new y(k,h)}return e?ia(e,b.primIndex):b}function kb(a,b,c,d,e){var f=u(a,b.line);if(f.markedSpans)for(var g=0;g<f.markedSpans.length;++g){var h=f.markedSpans[g],k=h.marker;if((null==h.from||(k.inclusiveLeft?h.from<=b.ch:h.from<b.ch))&&(null==h.to||(k.inclusiveRight?h.to>=b.ch:h.to>b.ch))){if(e&&(G(k,"beforeCursorEnter"),
k.explicitlyCleared))if(f.markedSpans){--g;continue}else break;if(k.atomic){if(c){g=k.find(0>d?1:-1);h=void 0;if(0>d?k.inclusiveRight:k.inclusiveLeft)g=af(a,g,-d,g&&g.line==b.line?f:null);if(g&&g.line==b.line&&(h=x(g,c))&&(0>d?0>h:0<h))return kb(a,g,b,d,e)}c=k.find(0>d?-1:1);if(0>d?k.inclusiveLeft:k.inclusiveRight)c=af(a,c,d,c.line==b.line?f:null);return c?kb(a,c,b,d,e):null}}}return b}function Cd(a,b,c,d,e){d=d||1;b=kb(a,b,c,d,e)||!e&&kb(a,b,c,d,!0)||kb(a,b,c,-d,e)||!e&&kb(a,b,c,-d,!0);return b?
b:(a.cantEdit=!0,q(a.first,0))}function af(a,b,c,d){return 0>c&&0==b.ch?b.line>a.first?w(a,q(b.line-1)):null:0<c&&b.ch==(d||u(a,b.line)).text.length?b.line<a.first+a.size-1?q(b.line+1,0):null:new q(b.line,b.ch+c)}function bf(a){a.setSelection(q(a.firstLine(),0),q(a.lastLine()),oa)}function cf(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){return d.canceled=!0}};c&&(d.update=function(b,c,g,h){b&&(d.from=w(a,b));c&&(d.to=w(a,c));g&&(d.text=g);void 0!==h&&
(d.origin=h)});G(a,"beforeChange",a,d);a.cm&&G(a.cm,"beforeChange",a.cm,d);return d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function lb(a,b,c){if(a.cm){if(!a.cm.curOp)return K(a.cm,lb)(a,b,c);if(a.cm.state.suppressEdits)return}if(da(a,"beforeChange")||a.cm&&da(a.cm,"beforeChange"))if(b=cf(a,b,!0),!b)return;if(c=df&&!c&&Uf(a,b.from,b.to))for(var d=c.length-1;0<=d;--d)ef(a,{from:c[d].from,to:c[d].to,text:d?[""]:b.text});else ef(a,b)}function ef(a,b){if(1!=b.text.length||""!=
b.text[0]||0!=x(b.from,b.to)){var c=xd(a,b);Ue(a,b,c,a.cm?a.cm.curOp.id:NaN);Lb(a,b,c,Qc(a,b));var d=[];Ta(a,function(a,c){c||-1!=M(d,a.history)||(ff(a.history,b),d.push(a.history));Lb(a,b,null,Qc(a,b))})}}function wc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits||c){for(var d=a.history,e,f=a.sel,g="undo"==b?d.done:d.undone,h="undo"==b?d.undone:d.done,k=0;k<g.length&&(e=g[k],c?!e.ranges||e.equals(a.sel):e.ranges);k++);if(k!=g.length){for(d.lastOrigin=d.lastSelOrigin=null;;)if(e=g.pop(),e.ranges){tc(e,
h);if(c&&!e.equals(a.sel)){P(a,e,{clearRedo:!1});return}f=e}else break;var l=[];tc(f,h);h.push({changes:l,generation:d.generation});d.generation=e.generation||++d.maxGeneration;var m=da(a,"beforeChange")||a.cm&&da(a.cm,"beforeChange");c=function(d){var c=e.changes[d];c.origin=b;if(m&&!cf(a,c,!1))return g.length=0,{};l.push(Ad(a,c));var f=d?xd(a,c):z(g);Lb(a,c,f,Ve(a,c));!d&&a.cm&&a.cm.scrollIntoView({from:c.from,to:Ca(c)});var h=[];Ta(a,function(a,b){b||-1!=M(h,a.history)||(ff(a.history,c),h.push(a.history));
Lb(a,c,null,Ve(a,c))})};for(d=e.changes.length-1;0<=d;--d)if(f=c(d))return f.v}}}function gf(a,b){if(0!=b&&(a.first+=b,a.sel=new aa(ac(a.sel.ranges,function(a){return new y(q(a.anchor.line+b,a.anchor.ch),q(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){T(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)Ba(a.cm,d,"gutter")}}function Lb(a,b,c,d){if(a.cm&&!a.cm.curOp)return K(a.cm,Lb)(a,b,c,d);if(b.to.line<a.first)gf(a,b.text.length-1-(b.to.line-b.from.line));else if(!(b.from.line>
a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);gf(a,e);b={from:q(a.first,0),to:q(b.to.line+e,b.to.ch),text:[z(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:q(e,u(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=Ia(a,b.from,b.to);c||(c=xd(a,b));a.cm?tg(a.cm,b,d):zd(a,b,d);vc(a,c,oa)}}function tg(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,k=f.line;a.options.lineWrapping||(k=C(ka(u(d,f.line))),d.iter(k,g.line+1,function(a){if(a==
e.maxLine)return h=!0}));-1<d.sel.contains(b.from,b.to)&&Zd(a);zd(d,b,c,ze(a));a.options.lineWrapping||(d.iter(k,f.line+b.text.length,function(a){var b=gc(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0));d.frontier=Math.min(d.frontier,f.line);Hb(a,400);c=b.text.length-(g.line-f.line)-1;b.full?T(a):f.line!=g.line||1!=b.text.length||Pe(a.doc,b)?T(a,f.line,g.line+1,c):Ba(a,f.line,"text");c=da(a,"changes");if((d=da(a,"change"))||c)b={from:f,
to:g,text:b.text,removed:b.removed,origin:b.origin},d&&O(a,"change",a,b),c&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(b);a.display.selForContextMenu=null}function mb(a,b,c,d,e){d||(d=c);if(0>x(d,c)){var f=d;d=c;c=f}"string"==typeof b&&(b=a.splitLines(b));lb(a,{from:c,to:d,text:b,origin:e})}function hf(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function jf(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges)for(f.copied||(f=a[e]=f.deepCopy(),f.copied=!0),g=0;g<f.ranges.length;g++)hf(f.ranges[g].anchor,
b,c,d),hf(f.ranges[g].head,b,c,d);else{for(var h=0;h<f.changes.length;++h){var k=f.changes[h];if(c<k.from.line)k.from=q(k.from.line+d,k.from.ch),k.to=q(k.to.line+d,k.to.ch);else if(b<=k.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function ff(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;jf(a.done,c,d,e);jf(a.undone,c,d,e)}function Mb(a,b,c,d){var e=b,f=b;"number"==typeof b?f=u(a,Math.max(a.first,Math.min(b,a.first+a.size-1))):e=C(b);if(null==e)return null;d(f,e)&&a.cm&&Ba(a.cm,e,
c);return f}function ug(a,b,c,d){var e=new Nb(a,c,d),f=a.cm;f&&e.noHScroll&&(f.display.alignWidgets=!0);Mb(a,b,"widget",function(b){var d=b.widgets||(b.widgets=[]);null==e.insertAt?d.push(e):d.splice(Math.min(d.length-1,Math.max(0,e.insertAt)),0,e);e.line=b;f&&!La(a,b)&&(d=la(b)<a.scrollTop,ja(b,b.height+Bb(e)),d&&oc(f,null,e.height),f.curOp.forceUpdate=!0);return!0});O(f,"lineWidgetAdded",f,e,"number"==typeof b?b:C(b));return e}function nb(a,b,c,d,e){if(d&&d.shared)return vg(a,b,c,d,e);if(a.cm&&
!a.cm.curOp)return K(a.cm,nb)(a,b,c,d,e);var f=new Da(a,e);e=x(b,c);d&&Ha(d,f,!1);if(0<e||0==e&&!1!==f.clearWhenEmpty)return f;f.replacedWith&&(f.collapsed=!0,f.widgetNode=Xa("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(f.widgetNode.insertLeft=!0));if(f.collapsed){if(Vd(a,b.line,b,c,f)||b.line!=c.line&&Vd(a,c.line,b,c,f))throw Error("Inserting collapsed marker partially overlapping an existing one");ya=!0}f.addToHistory&&
Ue(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var g=b.line,h=a.cm,k;a.iter(g,c.line+1,function(a){h&&f.collapsed&&!h.options.lineWrapping&&ka(a)==h.display.maxLine&&(k=!0);f.collapsed&&g!=b.line&&ja(a,0);var d=new fc(f,g==b.line?b.ch:null,g==c.line?c.ch:null);a.markedSpans=a.markedSpans?a.markedSpans.concat([d]):[d];d.marker.attachLine(a);++g});f.collapsed&&a.iter(b.line,c.line+1,function(b){La(a,b)&&ja(b,0)});f.clearOnEnter&&t(f,"beforeCursorEnter",function(){return f.clear()});f.readOnly&&(df=
!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory());f.collapsed&&(f.id=++kf,f.atomic=!0);if(h){k&&(h.curOp.updateMaxLine=!0);if(f.collapsed)T(h,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(d=b.line;d<=c.line;d++)Ba(h,d,"text");f.atomic&&$e(h.doc);O(h,"markerAdded",h,f)}return f}function vg(a,b,c,d,e){d=Ha(d);d.shared=!1;var f=[nb(a,b,c,d,e)],g=f[0],h=d.widgetNode;Ta(a,function(a){h&&(d.widgetNode=h.cloneNode(!0));f.push(nb(a,w(a,b),w(a,c),d,
e));for(var k=0;k<a.linked.length;++k)if(a.linked[k].isParent)return;g=z(f)});return new Ob(f,g)}function lf(a){return a.findMarks(q(a.first,0),a.clipPos(q(a.lastLine())),function(a){return a.parent})}function wg(a){for(var b=function(b){b=a[b];var d=[b.primary.doc];Ta(b.primary.doc,function(a){return d.push(a)});for(var c=0;c<b.markers.length;c++){var g=b.markers[c];-1==M(d,g.doc)&&(g.parent=null,b.markers.splice(c--,1))}},c=0;c<a.length;c++)b(c)}function xg(a){var b=this;mf(b);if(!I(b,a)&&!ua(b.display,
a)){Q(a);B&&(nf=+new Date);var c=Ra(b,a,!0),d=a.dataTransfer.files;if(c&&!b.isReadOnly())if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){if(!b.options.allowDropFileTypes||-1!=M(b.options.allowDropFileTypes,a.type)){var h=new FileReader;h.onload=K(b,function(){var a=h.result;/[\x00-\x08\x0e-\x1f]{2}/.test(a)&&(a="");f[d]=a;++g==e&&(c=w(b.doc,c),a={from:c,to:c,text:b.doc.splitLines(f.join(b.doc.lineSeparator())),origin:"paste"},lb(b.doc,a),Xe(b.doc,va(c,
Ca(a))))});h.readAsText(a)}},k=0;k<e;++k)h(d[k],k);else if(b.state.draggingText&&-1<b.doc.sel.contains(c))b.state.draggingText(a),setTimeout(function(){return b.display.input.focus()},20);else try{if(h=a.dataTransfer.getData("Text")){b.state.draggingText&&!b.state.draggingText.copy&&(k=b.listSelections());vc(b.doc,va(c,c));if(k)for(d=0;d<k.length;++d)mb(b.doc,"",k[d].anchor,k[d].head,"drag");b.replaceSelection(h,"around","paste");b.display.input.focus()}}catch(l){}}}function mf(a){a.display.dragCursor&&
(a.display.lineSpace.removeChild(a.display.dragCursor),a.display.dragCursor=null)}function of(a){if(document.body.getElementsByClassName)for(var b=document.body.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;d&&a(d)}}function yg(){var a;t(window,"resize",function(){null==a&&(a=setTimeout(function(){a=null;of(zg)},100))});t(window,"blur",function(){return of(Fb)})}function zg(a){var b=a.display;if(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)b.cachedCharWidth=
b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize()}function Ag(a){var b=a.split(/-(?!$)/);a=b[b.length-1];for(var c,d,e,f,g=0;g<b.length-1;g++){var h=b[g];if(/^(cmd|meta|m)$/i.test(h))f=!0;else if(/^a(lt)?$/i.test(h))c=!0;else if(/^(c|ctrl|control)$/i.test(h))d=!0;else if(/^s(hift)?$/i.test(h))e=!0;else throw Error("Unrecognized modifier name: "+h);}c&&(a="Alt-"+a);d&&(a="Ctrl-"+a);f&&(a="Cmd-"+a);e&&(a="Shift-"+a);return a}function Bg(a){var b={},c;for(c in a)if(a.hasOwnProperty(c)){var d=
a[c];if(!/^(name|fallthrough|(de|at)tach)$/.test(c)){if("..."!=d)for(var e=ac(c.split(" "),Ag),f=0;f<e.length;f++){var g,h;f==e.length-1?(h=e.join(" "),g=d):(h=e.slice(0,f+1).join(" "),g="...");var k=b[h];if(!k)b[h]=g;else if(k!=g)throw Error("Inconsistent bindings for "+h);}delete a[c]}}for(var l in b)a[l]=b[l];return a}function ob(a,b,c,d){b=xc(b);var e=b.call?b.call(a,d):b[a];if(!1===e)return"nothing";if("..."===e)return"multi";if(null!=e&&c(e))return"handled";if(b.fallthrough){if("[object Array]"!=
Object.prototype.toString.call(b.fallthrough))return ob(a,b.fallthrough,c,d);for(e=0;e<b.fallthrough.length;e++){var f=ob(a,b.fallthrough[e],c,d);if(f)return f}}}function pf(a){a="string"==typeof a?a:Ea[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a}function qf(a,b){if(ha&&34==a.keyCode&&a["char"])return!1;var c=Ea[a.keyCode],d=c;if(null==d||a.altGraphKey)return!1;a.altKey&&"Alt"!=c&&(d="Alt-"+d);(rf?a.metaKey:a.ctrlKey)&&"Ctrl"!=c&&(d="Ctrl-"+d);(rf?a.ctrlKey:a.metaKey)&&"Cmd"!=c&&(d=
"Cmd-"+d);!b&&a.shiftKey&&"Shift"!=c&&(d="Shift-"+d);return d}function xc(a){return"string"==typeof a?Pb[a]:a}function pb(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&0>=x(f.from,z(d).to);){var g=d.pop();if(0>x(g.from,f.from)){f.from=g.from;break}}d.push(f)}X(a,function(){for(var b=d.length-1;0<=b;b--)mb(a.doc,"",d[b].from,d[b].to,"+delete");fb(a)})}function sf(a,b){var c=u(a.doc,b),d=ka(c);d!=c&&(b=C(d));return Xc(!0,a,d,b,1)}function tf(a,b){var c=sf(a,b.line),
d=u(a.doc,c.line),e=za(d,a.doc.direction);return e&&0!=e[0].level?c:(d=Math.max(0,d.text.search(/\S/)),q(c.line,b.line==c.line&&b.ch<=d&&b.ch?0:d,c.sticky))}function yc(a,b,c){if("string"==typeof b&&(b=zc[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Dd}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function Cg(a,b,c){for(var d=0;d<a.state.keyMaps.length;d++){var e=ob(b,a.state.keyMaps[d],
c,a);if(e)return e}return a.options.extraKeys&&ob(b,a.options.extraKeys,c,a)||ob(b,a.options.keyMap,c,a)}function Ac(a,b,c,d){var e=a.state.keySeq;if(e){if(pf(b))return"handled";Dg.set(50,function(){a.state.keySeq==e&&(a.state.keySeq=null,a.display.input.reset())});b=e+" "+b}d=Cg(a,b,d);"multi"==d&&(a.state.keySeq=b);"handled"==d&&O(a,"keyHandled",a,b,c);if("handled"==d||"multi"==d)Q(c),od(a);return e&&!d&&/\'$/.test(b)?(Q(c),!0):!!d}function uf(a,b){var c=qf(b,!0);return c?b.shiftKey&&!a.state.keySeq?
Ac(a,"Shift-"+c,b,function(b){return yc(a,b,!0)})||Ac(a,c,b,function(b){if("string"==typeof b?/^go[A-Z]/.test(b):b.motion)return yc(a,b)}):Ac(a,c,b,function(b){return yc(a,b)}):!1}function Eg(a,b,c){return Ac(a,"'"+c+"'",b,function(b){return yc(a,b,!0)})}function vf(a){this.curOp.focus=qa();if(!I(this,a)){B&&11>E&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.display.shift=16==b||a.shiftKey;var c=uf(this,a);ha&&(Ed=c?b:null,!c&&88==b&&!wf&&(fa?a.metaKey:a.ctrlKey)&&this.replaceSelection("",
null,"cut"));18!=b||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||Fg(this)}}function Fg(a){function b(a){18!=a.keyCode&&a.altKey||(Sa(c,"CodeMirror-crosshair"),ea(document,"keyup",b),ea(document,"mouseover",b))}var c=a.display.lineDiv;Ga(c,"CodeMirror-crosshair");t(document,"keyup",b);t(document,"mouseover",b)}function xf(a){16==a.keyCode&&(this.doc.sel.shift=!1);I(this,a)}function yf(a){if(!(ua(this.display,a)||I(this,a)||a.ctrlKey&&!a.altKey||fa&&a.metaKey)){var b=a.keyCode,c=
a.charCode;if(ha&&b==Ed)Ed=null,Q(a);else if(!ha||a.which&&!(10>a.which)||!uf(this,a))if(b=String.fromCharCode(null==c?b:c),"\b"!=b&&!Eg(this,a,b))this.display.input.onKeyPress(a)}}function Gg(a){var b=this.display;if(!(I(this,a)||b.activeTouch&&b.input.supportsTouch()))if(b.input.ensurePolled(),b.shift=a.shiftKey,ua(b,a))N||(b.scroller.draggable=!1,setTimeout(function(){return b.scroller.draggable=!0},100));else if(!Fd(this,a,"gutterClick",!0)){var c=Ra(this,a);window.focus();switch(ae(a)){case 1:this.state.selectingText?
this.state.selectingText(a):c?Hg(this,a,c):(a.target||a.srcElement)==b.scroller&&Q(a);break;case 2:N&&(this.state.lastMiddleDown=+new Date);c&&uc(this.doc,c);setTimeout(function(){return b.input.focus()},20);Q(a);break;case 3:Gd?zf(this,a):kg(this)}}}function Hg(a,b,c){B?setTimeout(Hc(Ce,a),0):a.curOp.focus=qa();var d=+new Date,e;Bc&&Bc.time>d-400&&0==x(Bc.pos,c)?e="triple":Cc&&Cc.time>d-400&&0==x(Cc.pos,c)?(e="double",Bc={time:d,pos:c}):(e="single",Cc={time:d,pos:c});var d=a.doc.sel,f=fa?b.metaKey:
b.ctrlKey,g;a.options.dragDrop&&Ig&&!a.isReadOnly()&&"single"==e&&-1<(g=d.contains(c))&&(0>x((g=d.ranges[g]).from(),c)||0<c.xRel)&&(0<x(g.to(),c)||0>c.xRel)?Jg(a,b,c,f):Kg(a,b,c,e,f)}function Jg(a,b,c,d){var e=a.display,f=+new Date,g=K(a,function(h){N&&(e.scroller.draggable=!1);a.state.draggingText=!1;ea(document,"mouseup",g);ea(e.scroller,"drop",g);10>Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)&&(Q(h),!d&&+new Date-200<f&&uc(a.doc,c),N||B&&9==E?setTimeout(function(){document.body.focus();
e.input.focus()},20):e.input.focus())});N&&(e.scroller.draggable=!0);a.state.draggingText=g;g.copy=fa?b.altKey:b.ctrlKey;e.scroller.dragDrop&&e.scroller.dragDrop();t(document,"mouseup",g);t(e.scroller,"drop",g)}function Kg(a,b,c,d,e){function f(b){if(0!=x(v,b))if(v=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=ca(u(l,c.line).text,c.ch,f),h=ca(u(l,b.line).text,b.ch,f),k=Math.min(g,h),g=Math.max(g,h),h=Math.min(c.line,b.line),r=Math.min(a.lastLine(),Math.max(c.line,b.line));h<=r;h++){var t=u(l,h).text,
D=Ic(t,k,f);k==g?e.push(new y(q(h,D),q(h,D))):t.length>D&&e.push(new y(q(h,D),q(h,Ic(t,g,f))))}e.length||e.push(new y(c,c));P(l,ia(n.ranges.slice(0,p).concat(e),p),{origin:"*mouse",scroll:!1});a.scrollIntoView(b)}else k=m,e=k.anchor,f=b,"single"!=d&&(b="double"==d?a.findWordAt(b):new y(q(b.line,0),w(l,q(b.line+1,0))),0<x(b.anchor,e)?(f=b.head,e=ec(k.from(),b.anchor)):(f=b.anchor,e=dc(k.to(),b.head))),b=n.ranges.slice(0),b[p]=new y(w(l,e),f),P(l,ia(b,p),Hd)}function g(b){var c=++z,e=Ra(a,b,!0,"rect"==
d);if(e)if(0!=x(e,v)){a.curOp.focus=qa();f(e);var h=sd(k,l);(e.line>=h.to||e.line<h.from)&&setTimeout(K(a,function(){z==c&&g(b)}),150)}else{var m=b.clientY<A.top?-20:b.clientY>A.bottom?20:0;m&&setTimeout(K(a,function(){z==c&&(k.scroller.scrollTop+=m,g(b))}),50)}}function h(b){a.state.selectingText=!1;z=Infinity;Q(b);k.input.focus();ea(document,"mousemove",B);ea(document,"mouseup",C);l.history.lastSelOrigin=null}var k=a.display,l=a.doc;Q(b);var m,p,n=l.sel,r=n.ranges;e&&!b.shiftKey?(p=l.sel.contains(c),
m=-1<p?r[p]:new y(c,c)):(m=l.sel.primary(),p=l.sel.primIndex);if(Lg?b.shiftKey&&b.metaKey:b.altKey)d="rect",e||(m=new y(c,c)),c=Ra(a,b,!0,!0),p=-1;else if("double"==d){var D=a.findWordAt(c);m=a.display.shift||l.extend?Kb(l,m,D.anchor,D.head):D}else"triple"==d?(D=new y(q(c.line,0),w(l,q(c.line+1,0))),m=a.display.shift||l.extend?Kb(l,m,D.anchor,D.head):D):m=Kb(l,m,c);e?-1==p?(p=r.length,P(l,ia(r.concat([m]),p),{scroll:!1,origin:"*mouse"})):1<r.length&&r[p].empty()&&"single"==d&&!b.shiftKey?(P(l,ia(r.slice(0,
p).concat(r.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),n=l.sel):Bd(l,p,m,Hd):(p=0,P(l,new aa([m],0),Hd),n=l.sel);var v=c,A=k.wrapper.getBoundingClientRect(),z=0,B=K(a,function(a){ae(a)?g(a):h(a)}),C=K(a,h);a.state.selectingText=C;t(document,"mousemove",B);t(document,"mouseup",C)}function Fd(a,b,c,d){var e,f;try{e=b.clientX,f=b.clientY}catch(k){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&Q(b);d=a.display;var g=d.lineDiv.getBoundingClientRect();if(f>g.bottom||
!da(a,c))return Yc(b);f-=g.top-d.viewOffset;for(g=0;g<a.options.gutters.length;++g){var h=d.gutters.childNodes[g];if(h&&h.getBoundingClientRect().right>=e)return e=Ja(a.doc,f),G(a,c,a,e,a.options.gutters[g],b),Yc(b)}}function zf(a,b){var c;(c=ua(a.display,b))||(c=da(a,"gutterContextMenu")?Fd(a,b,"gutterContextMenu",!1):!1);if(!c&&!I(a,b,"contextmenu"))a.display.input.onContextMenu(b)}function Af(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g,
" cm-s-");Db(a)}function Qb(a){Me(a);T(a);qd(a)}function Mg(a,b,c){!b!=!(c&&c!=qb)&&(c=a.display.dragFunctions,b=b?t:ea,b(a.display.scroller,"dragstart",c.start),b(a.display.scroller,"dragenter",c.enter),b(a.display.scroller,"dragover",c.over),b(a.display.scroller,"dragleave",c.leave),b(a.display.scroller,"drop",c.drop))}function Ng(a){a.options.lineWrapping?(Ga(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Sa(a.display.wrapper,"CodeMirror-wrap"),
Tc(a));nd(a);T(a);Db(a);setTimeout(function(){return eb(a)},100)}function F(a,b){var c=this;if(!(this instanceof F))return new F(a,b);this.options=b=b?Ha(b):{};Ha(Bf,b,!1);wd(b);var d=b.value;"string"==typeof d&&(d=new U(d,b.mode,null,b.lineSeparator,b.direction));this.doc=d;var e=new F.inputStyles[b.inputStyle](this),e=this.display=new Tf(a,d,e);e.wrapper.CodeMirror=this;Me(this);Af(this);b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");Ie(this);this.state={keyMaps:[],overlays:[],
modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ua,keySeq:null,specialChars:null};b.autofocus&&!tb&&e.input.focus();B&&11>E&&setTimeout(function(){return c.display.input.reset(!0)},20);Og(this);Cf||(yg(),Cf=!0);gb(this);this.curOp.forceUpdate=!0;Qe(this,d);b.autofocus&&!tb||this.hasFocus()?setTimeout(Hc(pd,this),20):Fb(this);for(var f in Dc)if(Dc.hasOwnProperty(f))Dc[f](c,b[f],qb);De(this);b.finishInit&&
b.finishInit(this);for(d=0;d<Id.length;++d)Id[d](c);hb(this);N&&b.lineWrapping&&"optimizelegibility"==getComputedStyle(e.lineDiv).textRendering&&(e.lineDiv.style.textRendering="auto")}function Og(a){function b(){d.activeTouch&&(e=setTimeout(function(){return d.activeTouch=null},1E3),f=d.activeTouch,f.end=+new Date)}function c(a,b){if(null==b.left)return!0;var d=b.left-a.left,c=b.top-a.top;return 400<d*d+c*c}var d=a.display;t(d.scroller,"mousedown",K(a,Gg));B&&11>E?t(d.scroller,"dblclick",K(a,function(b){if(!I(a,
b)){var d=Ra(a,b);!d||Fd(a,b,"gutterClick",!0)||ua(a.display,b)||(Q(b),b=a.findWordAt(d),uc(a.doc,b.anchor,b.head))}})):t(d.scroller,"dblclick",function(b){return I(a,b)||Q(b)});Gd||t(d.scroller,"contextmenu",function(b){return zf(a,b)});var e,f={end:0};t(d.scroller,"touchstart",function(b){var c;if(c=!I(a,b))1!=b.touches.length?c=!1:(c=b.touches[0],c=1>=c.radiusX&&1>=c.radiusY),c=!c;c&&(d.input.ensurePolled(),clearTimeout(e),c=+new Date,d.activeTouch={start:c,moved:!1,prev:300>=c-f.end?f:null},1==
b.touches.length&&(d.activeTouch.left=b.touches[0].pageX,d.activeTouch.top=b.touches[0].pageY))});t(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)});t(d.scroller,"touchend",function(e){var f=d.activeTouch;if(f&&!ua(d,e)&&null!=f.left&&!f.moved&&300>new Date-f.start){var g=a.coordsChar(d.activeTouch,"page"),f=!f.prev||c(f,f.prev)?new y(g,g):!f.prev.prev||c(f,f.prev.prev)?a.findWordAt(g):new y(q(g.line,0),w(a.doc,q(g.line+1,0)));a.setSelection(f.anchor,f.head);a.focus();Q(e)}b()});
t(d.scroller,"touchcancel",b);t(d.scroller,"scroll",function(){d.scroller.clientHeight&&(Gb(a,d.scroller.scrollTop),db(a,d.scroller.scrollLeft,!0),G(a,"scroll",a))});t(d.scroller,"mousewheel",function(b){return Ge(a,b)});t(d.scroller,"DOMMouseScroll",function(b){return Ge(a,b)});t(d.wrapper,"scroll",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0});d.dragFunctions={enter:function(b){I(a,b)||xb(b)},over:function(b){if(!I(a,b)){var d=Ra(a,b);if(d){var c=document.createDocumentFragment();
Be(a,d,c);a.display.dragCursor||(a.display.dragCursor=v("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv));Y(a.display.dragCursor,c)}xb(b)}},start:function(b){if(B&&(!a.state.draggingText||100>+new Date-nf))xb(b);else if(!I(a,b)&&!ua(a.display,b)&&(b.dataTransfer.setData("Text",a.getSelection()),b.dataTransfer.effectAllowed="copyMove",b.dataTransfer.setDragImage&&!Df)){var d=v("img",null,null,"position: fixed; left: 0; top: 0;");
d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";ha&&(d.width=d.height=1,a.display.wrapper.appendChild(d),d._top=d.offsetTop);b.dataTransfer.setDragImage(d,0,0);ha&&d.parentNode.removeChild(d)}},drop:K(a,xg),leave:function(b){I(a,b)||mf(a)}};var g=d.input.getField();t(g,"keyup",function(b){return xf.call(a,b)});t(g,"keydown",K(a,vf));t(g,"keypress",K(a,yf));t(g,"focus",function(b){return pd(a,b)});t(g,"blur",function(b){return Fb(a,b)})}function Rb(a,b,c,d){var e=
a.doc,f;null==c&&(c="add");"smart"==c&&(e.mode.indent?f=yb(a,b):c="prev");var g=a.options.tabSize,h=u(e,b),k=ca(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var l=h.text.match(/^\s*/)[0],m;if(!d&&!/\S/.test(h.text))m=0,c="not";else if("smart"==c&&(m=e.mode.indent(f,h.text.slice(l.length),h.text),m==Dd||150<m)){if(!d)return;c="prev"}"prev"==c?m=b>e.first?ca(u(e,b-1).text,null,g):0:"add"==c?m=k+a.options.indentUnit:"subtract"==c?m=k-a.options.indentUnit:"number"==typeof c&&(m=k+c);m=Math.max(0,
m);c="";d=0;if(a.options.indentWithTabs)for(a=Math.floor(m/g);a;--a)d+=g,c+="\t";d<m&&(c+=Jc(m-d));if(c!=l)return mb(e,c,q(b,0),q(b,l.length),"+input"),h.stateAfter=null,!0;for(g=0;g<e.sel.ranges.length;g++)if(h=e.sel.ranges[g],h.head.line==b&&h.head.ch<l.length){b=q(b,l.length);Bd(e,g,new y(b,b));break}}function Jd(a,b,c,d,e){var f=a.doc;a.display.shift=!1;d||(d=f.sel);var g=a.state.pasteIncoming||"paste"==e,h=Kd(b),k=null;if(g&&1<d.ranges.length)if(V&&V.text.join("\n")==b){if(0==d.ranges.length%
V.text.length)for(var k=[],l=0;l<V.text.length;l++)k.push(f.splitLines(V.text[l]))}else h.length==d.ranges.length&&(k=ac(h,function(a){return[a]}));for(var m,l=d.ranges.length-1;0<=l;l--){m=d.ranges[l];var p=m.from(),n=m.to();m.empty()&&(c&&0<c?p=q(p.line,p.ch-c):a.state.overwrite&&!g?n=q(n.line,Math.min(u(f,n.line).text.length,n.ch+z(h).length)):V&&V.lineWise&&V.text.join("\n")==b&&(p=n=q(p.line,0)));m=a.curOp.updateInput;p={from:p,to:n,text:k?k[l%k.length]:h,origin:e||(g?"paste":a.state.cutIncoming?
"cut":"+input")};lb(a.doc,p);O(a,"inputRead",a,p)}b&&!g&&Ef(a,b);fb(a);a.curOp.updateInput=m;a.curOp.typing=!0;a.state.pasteIncoming=a.state.cutIncoming=!1}function Ff(a,b){var c=a.clipboardData&&a.clipboardData.getData("Text");if(c)return a.preventDefault(),b.isReadOnly()||b.options.disableInput||X(b,function(){return Jd(b,c,0,null,"paste")}),!0}function Ef(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;0<=d;d--){var e=c.ranges[d];if(!(100<e.head.ch||
d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars)for(var h=0;h<f.electricChars.length;h++){if(-1<b.indexOf(f.electricChars.charAt(h))){g=Rb(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(u(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Rb(a,e.head.line,"smart"));g&&O(a,"electricInput",a,e.head.line)}}}function Gf(a){for(var b=[],c=[],d=0;d<a.doc.sel.ranges.length;d++){var e=a.doc.sel.ranges[d].head.line,e={anchor:q(e,0),head:q(e+
1,0)};c.push(e);b.push(a.getRange(e.anchor,e.head))}return{text:b,ranges:c}}function Hf(a,b){a.setAttribute("autocorrect","off");a.setAttribute("autocapitalize","off");a.setAttribute("spellcheck",!!b)}function If(){var a=v("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),b=v("div",[a],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");N?a.style.width="1000px":a.setAttribute("wrap","off");Sb&&(a.style.border="1px solid black");
Hf(a);return b}function Ld(a,b,c,d,e){function f(d){var f;f=e?Xd(a.cm,k,b,c):Wc(k,b,c);if(null==f){if(d=!d)d=b.line+c,d<a.first||d>=a.first+a.size?d=!1:(b=new q(d,b.ch,b.sticky),d=k=u(a,d));if(d)b=Xc(e,a.cm,k,b.line,c);else return!1}else b=f;return!0}var g=b,h=c,k=u(a,b.line);if("char"==d)f();else if("column"==d)f(!0);else if("word"==d||"group"==d){var l=null;d="group"==d;for(var m=a.cm&&a.cm.getHelper(b,"wordChars"),p=!0;!(0>c)||f(!p);p=!1){var n=k.text.charAt(b.ch)||"\n",n=bc(n,m)?"w":d&&"\n"==
n?"n":!d||/\s/.test(n)?null:"p";!d||p||n||(n="s");if(l&&l!=n){0>c&&(c=1,f(),b.sticky="after");break}n&&(l=n);if(0<c&&!f(!p))break}}h=Cd(a,b,g,h,!0);Oc(g,h)&&(h.hitSide=!0);return h}function Jf(a,b,c,d){var e=a.doc,f=b.left,g;"page"==d?(g=Math.max(Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight)-.5*Pa(a.display),3),g=(0<c?b.bottom:b.top)+c*g):"line"==d&&(g=0<c?b.bottom+3:b.top-3);for(;;){b=ld(a,f,g);if(!b.outside)break;if(0>c?0>=g:g>=e.height){b.hitSide=
!0;break}g+=5*c}return b}function Kf(a,b){var c=id(a,b.line);if(!c||c.hidden)return null;var d=u(a.doc,b.line),c=se(c,d,b.line),d=za(d,a.doc.direction),e="left";d&&(e=Uc(d,b.ch)%2?"right":"left");c=te(c.map,b.ch,e);c.offset="right"==c.collapse?c.end:c.start;return c}function Pg(a){for(;a;a=a.parentNode)if(/CodeMirror-gutter-wrapper/.test(a.className))return!0;return!1}function rb(a,b){b&&(a.bad=!0);return a}function Qg(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(a){a&&(l&&
(k+=m,l=!1),k+=a)}function h(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)g(c||b.textContent.replace(/\u200b/g,""));else{var c=b.getAttribute("cm-marker"),p;if(c)b=a.findMarks(q(d,0),q(e+1,0),f(+c)),b.length&&(p=b[0].find())&&g(Ia(a.doc,p.from,p.to).join(m));else if("false"!=b.getAttribute("contenteditable")){(p=/^(pre|div|p)$/i.test(b.nodeName))&&l&&(k+=m,l=!1);for(c=0;c<b.childNodes.length;c++)h(b.childNodes[c]);p&&(l=!0)}}}else 3==b.nodeType&&g(b.nodeValue)}for(var k="",l=!1,
m=a.doc.lineSeparator();;){h(b);if(b==c)break;b=b.nextSibling}return k}function Ec(a,b,c){var d;if(b==a.display.lineDiv){d=a.display.lineDiv.childNodes[c];if(!d)return rb(a.clipPos(q(a.display.viewTo-1)),!0);b=null;c=0}else for(d=b;;d=d.parentNode){if(!d||d==a.display.lineDiv)return null;if(d.parentNode&&d.parentNode==a.display.lineDiv)break}for(var e=0;e<a.display.view.length;e++){var f=a.display.view[e];if(f.node==d)return Rg(f,b,c)}}function Rg(a,b,c){function d(b,d,c){for(var e=-1;e<(l?l.length:
0);e++)for(var f=0>e?k.map:l[e],g=0;g<f.length;g+=3){var h=f[g+2];if(h==b||h==d){d=C(0>e?a.line:a.rest[e]);e=f[g]+c;if(0>c||h!=b)e=f[g+(c?1:0)];return q(d,e)}}}var e=a.text.firstChild,f=!1;if(!b||!Zb(e,b))return rb(q(C(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b))return c=a.rest?z(a.rest):a.line,rb(q(C(c),c.text.length),f);var g=3==b.nodeType?b:null,h=b;g||1!=b.childNodes.length||3!=b.firstChild.nodeType||(g=b.firstChild,c&&(c=g.nodeValue.length));for(;h.parentNode!=e;)h=h.parentNode;var k=
a.measure,l=k.maps;if(b=d(g,h,c))return rb(b,f);e=h.nextSibling;for(g=g?g.nodeValue.length-c:0;e;e=e.nextSibling){if(b=d(e,e.firstChild,0))return rb(q(b.line,b.ch-g),f);g+=e.textContent.length}for(h=h.previousSibling;h;h=h.previousSibling){if(b=d(h,h.firstChild,-1))return rb(q(b.line,b.ch+c),f);c+=h.textContent.length}}var R=navigator.userAgent,Lf=navigator.platform,xa=/gecko\/\d/i.test(R),Mf=/MSIE \d/.test(R),Nf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(R),Tb=/Edge\/(\d+)/.exec(R),B=Mf||Nf||Tb,
E=B&&(Mf?document.documentMode||6:+(Tb||Nf)[1]),N=!Tb&&/WebKit\//.test(R),Sg=N&&/Qt\/\d+\.\d+/.test(R),Of=!Tb&&/Chrome\//.test(R),ha=/Opera\//.test(R),Df=/Apple Computer/.test(navigator.vendor),Tg=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(R),ng=/PhantomJS/.test(R),Sb=!Tb&&/AppleWebKit/.test(R)&&/Mobile\/\w+/.test(R),Pf=/Android/.test(R),tb=Sb||Pf||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(R),fa=Sb||/Mac/.test(Lf),Lg=/\bCrOS\b/.test(R),Ug=/win/i.test(Lf),Va=ha&&R.match(/Version\/(\d*\.\d*)/);
Va&&(Va=Number(Va[1]));Va&&15<=Va&&(ha=!1,N=!0);var rf=fa&&(Sg||ha&&(null==Va||12.11>Va)),Gd=xa||B&&9<=E,Sa=function(a,b){var c=a.className,d=Fa(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=c.slice(0,d.index)+(e?d[1]+e:"")}},bb;bb=document.createRange?function(a,b,c,d){var e=document.createRange();e.setEnd(d||a,c);e.setStart(a,b);return e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}d.collapse(!0);d.moveEnd("character",
c);d.moveStart("character",b);return d};var sb=function(a){a.select()};Sb?sb=function(a){a.selectionStart=0;a.selectionEnd=a.value.length}:B&&(sb=function(a){try{a.select()}catch(b){}});var Ua=function(){this.id=null};Ua.prototype.set=function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)};var Dd={toString:function(){return"CodeMirror.Pass"}},oa={scroll:!1},Hd={origin:"*mouse"},Ub={origin:"+move"},$b=[""],Rf=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,
Sf=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,
df=!1,ya=!1,wb=null,Wf=function(){function a(a){return 247>=a?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(a):1424<=a&&1524>=a?"R":1536<=a&&1785>=a?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(a-
1536):1774<=a&&2220>=a?"r":8192<=a&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,d){this.level=a;this.from=b;this.to=d}var c=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,e=/[LRr]/,f=/[Lb1n]/,g=/[1n]/;return function(h,k){var l="ltr"==k?"L":"R";if(0==h.length||"ltr"==k&&!c.test(h))return!1;for(var m=h.length,p=[],n=0;n<m;++n)p.push(a(h.charCodeAt(n)));for(var n=0,r=l;n<m;++n){var q=p[n];"m"==q?p[n]=r:r=q}n=0;for(r=l;n<m;++n)q=p[n],"1"==q&&"r"==r?p[n]="n":e.test(q)&&(r=q,"r"==q&&(p[n]="R"));
n=1;for(r=p[0];n<m-1;++n)q=p[n],"+"==q&&"1"==r&&"1"==p[n+1]?p[n]="1":","!=q||r!=p[n+1]||"1"!=r&&"n"!=r||(p[n]=r),r=q;for(n=0;n<m;++n)if(r=p[n],","==r)p[n]="N";else if("%"==r){for(r=n+1;r<m&&"%"==p[r];++r);for(q=n&&"!"==p[n-1]||r<m&&"1"==p[r]?"1":"N";n<r;++n)p[n]=q;n=r-1}n=0;for(r=l;n<m;++n)q=p[n],"L"==r&&"1"==q?p[n]="L":e.test(q)&&(r=q);for(r=0;r<m;++r)if(d.test(p[r])){for(n=r+1;n<m&&d.test(p[n]);++n);q="L"==(r?p[r-1]:l);for(q=q==("L"==(n<m?p[n]:l))?q?"L":"R":l;r<n;++r)p[r]=q;r=n-1}for(var l=[],t,
n=0;n<m;)if(f.test(p[n])){r=n;for(++n;n<m&&f.test(p[n]);++n);l.push(new b(0,r,n))}else{var u=n,r=l.length;for(++n;n<m&&"L"!=p[n];++n);for(q=u;q<n;)if(g.test(p[q])){u<q&&l.splice(r,0,new b(1,u,q));u=q;for(++q;q<n&&g.test(p[q]);++q);l.splice(r,0,new b(2,u,q));u=q}else++q;u<n&&l.splice(r,0,new b(1,u,n))}1==l[0].level&&(t=h.match(/^\s+/))&&(l[0].from=t[0].length,l.unshift(new b(0,0,t[0].length)));1==z(l).level&&(t=h.match(/\s+$/))&&(z(l).to-=t[0].length,l.push(new b(0,m-t[0].length,m)));return"rtl"==
k?l.reverse():l}}(),hc=[],t=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),a[b]=(a[b]||hc).concat(c))},Ig=function(){if(B&&9>E)return!1;var a=v("div");return"draggable"in a||"dragDrop"in a}(),Zc,ed,Kd=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+
1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},Vg=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){var b;try{b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},wf=function(){var a=v("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),kd=null,$c={},$a={},ab={},J=function(a,b){this.pos=this.start=
0;this.string=a;this.tabSize=b||8;this.lineStart=this.lastColumnPos=this.lastColumnValue=0};J.prototype.eol=function(){return this.pos>=this.string.length};J.prototype.sol=function(){return this.pos==this.lineStart};J.prototype.peek=function(){return this.string.charAt(this.pos)||void 0};J.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)};J.prototype.eat=function(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,
b};J.prototype.eatWhile=function(a){for(var b=this.pos;this.eat(a););return this.pos>b};J.prototype.eatSpace=function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a};J.prototype.skipToEnd=function(){this.pos=this.string.length};J.prototype.skipTo=function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0};J.prototype.backUp=function(a){this.pos-=a};J.prototype.column=function(){this.lastColumnPos<this.start&&(this.lastColumnValue=
ca(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start);return this.lastColumnValue-(this.lineStart?ca(this.string,this.lineStart,this.tabSize):0)};J.prototype.indentation=function(){return ca(this.string,null,this.tabSize)-(this.lineStart?ca(this.string,this.lineStart,this.tabSize):0)};J.prototype.match=function(a,b,c){if("string"==typeof a){var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);if(d(e)==d(a))return!1!==
b&&(this.pos+=a.length),!0}else{if((a=this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}};J.prototype.current=function(){return this.string.slice(this.start,this.pos)};J.prototype.hideFirstChars=function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}};var ib=function(a,b,c){this.text=a;Td(this,b);this.height=c?c(this):1};ib.prototype.lineNo=function(){return C(this)};Za(ib);var bg={},ag={},cb=null,zb=null,ue={left:0,right:0,
top:0,bottom:0},Qa,mc=0,Z=null;B?Z=-.53:xa?Z=15:Of?Z=-.7:Df&&(Z=-1/3);var Wa=function(a,b,c){this.cm=c;var d=this.vert=v("div",[v("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=v("div",[v("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d);a(e);t(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")});t(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")});this.checkedZeroWidth=!1;B&&8>E&&(this.horiz.style.minHeight=this.vert.style.minWidth=
"18px")};Wa.prototype.update=function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;c?(this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0",this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+(a.viewHeight-(b?d:0)))+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0");b?(this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px",this.horiz.firstChild.style.width=
Math.max(0,a.scrollWidth-a.clientWidth+(a.viewWidth-a.barLeft-(c?d:0)))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0");!this.checkedZeroWidth&&0<a.clientHeight&&(0==d&&this.zeroWidthHack(),this.checkedZeroWidth=!0);return{right:c?d:0,bottom:b?d:0}};Wa.prototype.setScrollLeft=function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a);this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)};Wa.prototype.setScrollTop=function(a){this.vert.scrollTop!=a&&
(this.vert.scrollTop=a);this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)};Wa.prototype.zeroWidthHack=function(){this.horiz.style.height=this.vert.style.width=fa&&!Tg?"12px":"18px";this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none";this.disableHoriz=new Ua;this.disableVert=new Ua};Wa.prototype.enableZeroWidthBar=function(a,b){function c(){var d=a.getBoundingClientRect();document.elementFromPoint(d.left+1,d.bottom-1)!=a?a.style.pointerEvents="none":b.set(1E3,c)}
a.style.pointerEvents="auto";b.set(1E3,c)};Wa.prototype.clear=function(){var a=this.horiz.parentNode;a.removeChild(this.horiz);a.removeChild(this.vert)};var Vb=function(){};Vb.prototype.update=function(){return{bottom:0,right:0}};Vb.prototype.setScrollLeft=function(){};Vb.prototype.setScrollTop=function(){};Vb.prototype.clear=function(){};var Je={"native":Wa,"null":Vb},mg=0,qc=function(a,b,c){var d=a.display;this.viewport=b;this.visible=sd(d,a.doc,b);this.editorIsHidden=!d.wrapper.offsetWidth;this.wrapperHeight=
d.wrapper.clientHeight;this.wrapperWidth=d.wrapper.clientWidth;this.oldDisplayWidth=Na(a);this.force=c;this.dims=jd(a);this.events=[]};qc.prototype.signal=function(a,b){da(a,b)&&this.events.push(arguments)};qc.prototype.finish=function(){for(var a=0;a<this.events.length;a++)G.apply(null,this.events[a])};var aa=function(a,b){this.ranges=a;this.primIndex=b};aa.prototype.primary=function(){return this.ranges[this.primIndex]};aa.prototype.equals=function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||
a.ranges.length!=this.ranges.length)return!1;for(var b=0;b<this.ranges.length;b++){var c=this.ranges[b],d=a.ranges[b];if(!Oc(c.anchor,d.anchor)||!Oc(c.head,d.head))return!1}return!0};aa.prototype.deepCopy=function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new y(Pc(this.ranges[b].anchor),Pc(this.ranges[b].head));return new aa(a,this.primIndex)};aa.prototype.somethingSelected=function(){for(var a=0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return!0;return!1};aa.prototype.contains=function(a,
b){b||(b=a);for(var c=0;c<this.ranges.length;c++){var d=this.ranges[c];if(0<=x(b,d.from())&&0>=x(a,d.to()))return c}return-1};var y=function(a,b){this.anchor=a;this.head=b};y.prototype.from=function(){return ec(this.anchor,this.head)};y.prototype.to=function(){return dc(this.anchor,this.head)};y.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var wa=function(a){this.lines=a;this.parent=null;for(var b=0,c=0;c<a.length;++c)a[c].parent=this,b+=a[c].height;
this.height=b};wa.prototype.chunkSize=function(){return this.lines.length};wa.prototype.removeInner=function(a,b){for(var c=a,d=a+b;c<d;++c){var e=this.lines[c];this.height-=e.height;var f=e;f.parent=null;Sd(f);O(e,"delete")}this.lines.splice(a,b)};wa.prototype.collapse=function(a){a.push.apply(a,this.lines)};wa.prototype.insertInner=function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(a=0;a<b.length;++a)b[a].parent=this};wa.prototype.iterN=function(a,
b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0};var pa=function(a){this.children=a;for(var b=0,c=0,d=0;d<a.length;++d){var e=a[d],b=b+e.chunkSize(),c=c+e.height;e.parent=this}this.size=b;this.height=c;this.parent=null};pa.prototype.chunkSize=function(){return this.size};pa.prototype.removeInner=function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(a<e){var f=Math.min(b,e-a),g=d.height;d.removeInner(a,f);this.height-=g-d.height;e==f&&(this.children.splice(c--,
1),d.parent=null);if(0==(b-=f))break;a=0}else a-=e}25>this.size-b&&(1<this.children.length||!(this.children[0]instanceof wa))&&(c=[],this.collapse(c),this.children=[new wa(c)],this.children[0].parent=this)};pa.prototype.collapse=function(a){for(var b=0;b<this.children.length;++b)this.children[b].collapse(a)};pa.prototype.insertInner=function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<=f){e.insertInner(a,b,c);if(e.lines&&
50<e.lines.length){for(b=a=e.lines.length%25+25;b<e.lines.length;)c=new wa(e.lines.slice(b,b+=25)),e.height-=c.height,this.children.splice(++d,0,c),c.parent=this;e.lines=e.lines.slice(0,a);this.maybeSpill()}break}a-=f}};pa.prototype.maybeSpill=function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new pa(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=M(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new pa(a.children),c.parent=
a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}};pa.prototype.iterN=function(a,b,c){for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<f){f=Math.min(b,f-a);if(e.iterN(a,f,c))return!0;if(0==(b-=f))break;a=0}else a-=f}};var Nb=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.doc=a;this.node=b};Nb.prototype.clear=function(){var a=this.doc.cm,b=this.line.widgets,c=this.line,d=C(c);if(null!=d&&b){for(var e=
0;e<b.length;++e)b[e]==this&&b.splice(e--,1);b.length||(c.widgets=null);var f=Bb(this);ja(c,Math.max(0,c.height-f));a&&(X(a,function(){var b=-f;la(c)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&oc(a,null,b);Ba(a,d,"widget")}),O(a,"lineWidgetCleared",a,this,d))}};Nb.prototype.changed=function(){var a=this,b=this.height,c=this.doc.cm,d=this.line;this.height=null;var e=Bb(this)-b;e&&(ja(d,d.height+e),c&&X(c,function(){c.curOp.forceUpdate=!0;la(d)<(c.curOp&&c.curOp.scrollTop||c.doc.scrollTop)&&oc(c,
null,e);O(c,"lineWidgetChanged",c,a,C(d))}))};Za(Nb);var kf=0,Da=function(a,b){this.lines=[];this.type=b;this.doc=a;this.id=++kf};Da.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;b&&gb(a);if(da(this,"clear")){var c=this.find();c&&O(this,"clear",c.from,c.to)}for(var d=c=null,e=0;e<this.lines.length;++e){var f=this.lines[e],g=vb(f.markedSpans,this);a&&!this.collapsed?Ba(a,C(f),"text"):a&&(null!=g.to&&(d=C(f)),null!=g.from&&(c=C(f)));for(var h=f,k=void 0,l=f.markedSpans,
m=g,p=0;p<l.length;++p)l[p]!=m&&(k||(k=[])).push(l[p]);h.markedSpans=k;null==g.from&&this.collapsed&&!La(this.doc,f)&&a&&ja(f,Pa(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)f=ka(this.lines[e]),g=gc(f),g>a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&this.collapsed&&T(a,c,d+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&$e(a.doc));
a&&O(a,"markerCleared",a,this,c,d);b&&hb(a);this.parent&&this.parent.clear()}};Da.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e<this.lines.length;++e){var f=this.lines[e],g=vb(f.markedSpans,this);if(null!=g.from&&(c=q(b?f:C(f),g.from),-1==a))return c;if(null!=g.to&&(d=q(b?f:C(f),g.to),1==a))return d}return c&&{from:c,to:d}};Da.prototype.changed=function(){var a=this,b=this.find(-1,!0),c=this,d=this.doc.cm;b&&d&&X(d,function(){var e=b.line,f=C(b.line);if(f=id(d,
f))ve(f),d.curOp.selectionChanged=d.curOp.forceUpdate=!0;d.curOp.updateMaxLine=!0;La(c.doc,e)||null==c.height||(f=c.height,c.height=null,(f=Bb(c)-f)&&ja(e,e.height+f));O(d,"markerChanged",d,a)})};Da.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=M(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};Da.prototype.detachLine=function(a){this.lines.splice(M(this.lines,a),
1);!this.lines.length&&this.doc.cm&&(a=this.doc.cm.curOp,(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this))};Za(Da);var Ob=function(a,b){this.markers=a;this.primary=b;for(var c=0;c<a.length;++c)a[c].parent=this};Ob.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();O(this,"clear")}};Ob.prototype.find=function(a,b){return this.primary.find(a,b)};Za(Ob);var Wg=0,U=function(a,b,c,d,e){if(!(this instanceof
U))return new U(a,b,c,d,e);null==c&&(c=0);pa.call(this,[new wa([new ib("",null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=c;c=q(c,0);this.sel=va(c);this.history=new sc(null);this.id=++Wg;this.modeOption=b;this.lineSep=d;this.direction="rtl"==e?"rtl":"ltr";this.extend=!1;"string"==typeof a&&(a=this.splitLines(a));zd(this,{from:c,to:c,text:a});P(this,va(c),oa)};U.prototype=Nd(pa.prototype,{constructor:U,iter:function(a,b,c){c?this.iterN(a-
this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=Mc(this,this.first,this.first+this.size);return!1===a?b:b.join(a||this.lineSeparator())},setValue:L(function(a){var b=q(this.first,0),c=this.first+this.size-1;lb(this,{from:b,to:q(c,u(this,c).text.length),text:this.splitLines(a),origin:"setValue",full:!0},
!0);P(this,va(b))}),replaceRange:function(a,b,c,d){b=w(this,b);c=c?w(this,c):b;mb(this,a,b,c,d)},getRange:function(a,b,c){a=Ia(this,w(this,a),w(this,b));return!1===c?a:a.join(c||this.lineSeparator())},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},getLineHandle:function(a){if(ub(this,a))return u(this,a)},getLineNumber:function(a){return C(a)},getLineHandleVisualStart:function(a){"number"==typeof a&&(a=u(this,a));return ka(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},
lastLine:function(){return this.first+this.size-1},clipPos:function(a){return w(this,a)},getCursor:function(a){var b=this.sel.primary();return null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||"to"==a||!1===a?b.to():b.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:L(function(a,b,c){a=w(this,"number"==typeof a?q(a,b||0):a);P(this,va(a,null),c)}),setSelection:L(function(a,b,c){var d=w(this,a);a=w(this,b||a);
P(this,va(d,a),c)}),extendSelection:L(function(a,b,c){uc(this,w(this,a),b&&w(this,b),c)}),extendSelections:L(function(a,b){We(this,Qd(this,a),b)}),extendSelectionsBy:L(function(a,b){var c=ac(this.sel.ranges,a);We(this,Qd(this,c),b)}),setSelections:L(function(a,b,c){if(a.length){for(var d=[],e=0;e<a.length;e++)d[e]=new y(w(this,a[e].anchor),w(this,a[e].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex));P(this,ia(d,b),c)}}),addSelection:L(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new y(w(this,
a),w(this,b||a)));P(this,ia(d,d.length-1),c)}),getSelection:function(a){for(var b=this.sel.ranges,c,d=0;d<b.length;d++){var e=Ia(this,b[d].from(),b[d].to());c=c?c.concat(e):e}return!1===a?c:c.join(a||this.lineSeparator())},getSelections:function(a){for(var b=[],c=this.sel.ranges,d=0;d<c.length;d++){var e=Ia(this,c[d].from(),c[d].to());!1!==a&&(e=e.join(a||this.lineSeparator()));b[d]=e}return b},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,
b,c||"+input")},replaceSelections:L(function(a,b,c){for(var d=[],e=this.sel,f=0;f<e.ranges.length;f++){var g=e.ranges[f];d[f]={from:g.from(),to:g.to(),text:this.splitLines(a[f]),origin:c}}if(a=b&&"end"!=b){a=[];e=c=q(this.first,0);for(f=0;f<d.length;f++){var h=d[f],g=Oe(h.from,c,e),k=Oe(Ca(h),c,e);c=h.to;e=k;"around"==b?(h=this.sel.ranges[f],h=0>x(h.head,h.anchor),a[f]=new y(h?k:g,h?g:k)):a[f]=new y(g,g)}a=new aa(a,this.sel.primIndex)}b=a;for(a=d.length-1;0<=a;a--)lb(this,d[a]);b?Xe(this,b):this.cm&&
fb(this.cm)}),undo:L(function(){wc(this,"undo")}),redo:L(function(){wc(this,"redo")}),undoSelection:L(function(){wc(this,"undo",!0)}),redoSelection:L(function(){wc(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(d=0;d<a.undone.length;d++)a.undone[d].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new sc(this.history.maxGeneration)},
markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null);return this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:jb(this.history.done),undone:jb(this.history.undone)}},setHistory:function(a){var b=this.history=new sc(this.history.maxGeneration);b.done=jb(a.done.slice(0),null,!0);b.undone=jb(a.undone.slice(0),
null,!0)},setGutterMarker:L(function(a,b,c){return Mb(this,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});d[b]=c;!c&&Od(d)&&(a.gutterMarkers=null);return!0})}),clearGutter:L(function(a){var b=this;this.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&Mb(b,c,"gutter",function(){c.gutterMarkers[a]=null;Od(c.gutterMarkers)&&(c.gutterMarkers=null);return!0})})}),lineInfo:function(a){var b;if("number"==typeof a){if(!ub(this,a))return null;b=a;a=u(this,a);if(!a)return null}else if(b=
C(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},addLineClass:L(function(a,b,c){return Mb(this,a,"gutter"==b?"gutter":"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass";if(a[d]){if(Fa(c).test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:L(function(a,b,c){return Mb(this,a,"gutter"==b?"gutter":"class",
function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass",f=a[d];if(f)if(null==c)a[d]=null;else{var g=f.match(Fa(c));if(!g)return!1;var h=g.index+g[0].length;a[d]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}else return!1;return!0})}),addLineWidget:L(function(a,b,c){return ug(this,a,b,c)}),removeLineWidget:function(a){a.clear()},markText:function(a,b,c){return nb(this,w(this,a),w(this,b),c,c&&c.type||"range")},setBookmark:function(a,
b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared,handleMouseEvents:b&&b.handleMouseEvents};a=w(this,a);return nb(this,a,a,c,"bookmark")},findMarksAt:function(a){a=w(this,a);var b=[],c=u(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=w(this,a);b=w(this,b);var d=[],e=a.line;this.iter(a.line,
b.line+1,function(f){if(f=f.markedSpans)for(var g=0;g<f.length;g++){var h=f[g];null!=h.to&&e==a.line&&a.ch>=h.to||null==h.from&&e!=a.line||null!=h.from&&e==b.line&&h.from>=b.ch||c&&!c(h.marker)||d.push(h.marker.parent||h.marker)}++e});return d},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;c<b.length;++c)null!=b[c].from&&a.push(b[c].marker)});return a},posFromIndex:function(a){var b,c=this.first,d=this.lineSeparator().length;this.iter(function(e){e=e.text.length+
d;if(e>a)return b=a,!0;a-=e;++c});return w(this,q(c,b))},indexFromPos:function(a){a=w(this,a);var b=a.ch;if(a.line<this.first||0>a.ch)return 0;var c=this.lineSeparator().length;this.iter(this.first,a.line,function(a){b+=a.text.length+c});return b},copy:function(a){var b=new U(Mc(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel=this.sel;b.extend=!1;a&&(b.history.undoDepth=this.history.undoDepth,
b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.to<c&&(c=a.to);b=new U(Mc(this,b,c),a.mode||this.modeOption,b,this.lineSep,this.direction);a.sharedHist&&(b.history=this.history);(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}];a=lf(this);for(c=0;c<a.length;c++){var d=a[c],e=d.find(),f=b.clipPos(e.from),e=
b.clipPos(e.to);x(f,e)&&(f=nb(b,f,e,d.primary,d.primary.type),d.markers.push(f),f.parent=d)}return b},unlinkDoc:function(a){a instanceof F&&(a=a.doc);if(this.linked)for(var b=0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);wg(lf(this));break}if(a.history==this.history){var c=[a.id];Ta(a,function(a){return c.push(a.id)},!0);a.history=new sc(null);a.history.done=jb(this.history.done,c);a.history.undone=jb(this.history.undone,c)}},iterLinkedDocs:function(a){Ta(this,
a)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(a){return this.lineSep?a.split(this.lineSep):Kd(a)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:L(function(a){"rtl"!=a&&(a="ltr");a!=this.direction&&(this.direction=a,this.iter(function(a){return a.order=null}),this.cm&&qg(this.cm))})});U.prototype.eachLine=U.prototype.iter;for(var nf=0,Cf=!1,Ea={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:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Wb=0;10>Wb;Wb++)Ea[Wb+
48]=Ea[Wb+96]=String(Wb);for(var Fc=65;90>=Fc;Fc++)Ea[Fc]=String.fromCharCode(Fc);for(var Xb=1;12>=Xb;Xb++)Ea[Xb+111]=Ea[Xb+63235]="F"+Xb;var Pb={basic:{Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},pcDefault:{"Ctrl-A":"selectAll",
"Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",
"Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},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":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},
macDefault:{"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll",
"Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]}};Pb["default"]=fa?Pb.macDefault:Pb.pcDefault;var zc={selectAll:bf,singleSelection:function(a){return a.setSelection(a.getCursor("anchor"),a.getCursor("head"),oa)},killLine:function(a){return pb(a,function(b){if(b.empty()){var c=u(a.doc,b.head.line).text.length;
return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:q(b.head.line+1,0)}:{from:b.head,to:q(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){return pb(a,function(b){return{from:q(b.from().line,0),to:w(a.doc,q(b.to().line+1,0))}})},delLineLeft:function(a){return pb(a,function(a){return{from:q(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(a){return pb(a,function(b){var c=a.charCoords(b.head,"div").top+5;return{from:a.coordsChar({left:0,top:c},"div"),to:b.from()}})},
delWrappedLineRight:function(a){return pb(a,function(b){var c=a.charCoords(b.head,"div").top+5,c=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:c}})},undo:function(a){return a.undo()},redo:function(a){return a.redo()},undoSelection:function(a){return a.undoSelection()},redoSelection:function(a){return a.redoSelection()},goDocStart:function(a){return a.extendSelection(q(a.firstLine(),0))},goDocEnd:function(a){return a.extendSelection(q(a.lastLine()))},goLineStart:function(a){return a.extendSelectionsBy(function(b){return sf(a,
b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){return a.extendSelectionsBy(function(b){return tf(a,b.head)},{origin:"+move",bias:1})},goLineEnd:function(a){return a.extendSelectionsBy(function(b){b=b.head.line;var c=u(a.doc,b),d;d=c;for(var e;e=Ka(d,!1);)d=e.find(1,!0).line;d!=c&&(b=C(d));return Xc(!0,a,c,b,-1)},{origin:"+move",bias:-1})},goLineRight:function(a){return a.extendSelectionsBy(function(b){b=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+
100,top:b},"div")},Ub)},goLineLeft:function(a){return a.extendSelectionsBy(function(b){b=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:b},"div")},Ub)},goLineLeftSmart:function(a){return a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5,c=a.coordsChar({left:0,top:c},"div");return c.ch<a.getLine(c.line).search(/\S/)?tf(a,b.head):c},Ub)},goLineUp:function(a){return a.moveV(-1,"line")},goLineDown:function(a){return a.moveV(1,"line")},goPageUp:function(a){return a.moveV(-1,
"page")},goPageDown:function(a){return a.moveV(1,"page")},goCharLeft:function(a){return a.moveH(-1,"char")},goCharRight:function(a){return a.moveH(1,"char")},goColumnLeft:function(a){return a.moveH(-1,"column")},goColumnRight:function(a){return a.moveH(1,"column")},goWordLeft:function(a){return a.moveH(-1,"word")},goGroupRight:function(a){return a.moveH(1,"group")},goGroupLeft:function(a){return a.moveH(-1,"group")},goWordRight:function(a){return a.moveH(1,"word")},delCharBefore:function(a){return a.deleteH(-1,
"char")},delCharAfter:function(a){return a.deleteH(1,"char")},delWordBefore:function(a){return a.deleteH(-1,"word")},delWordAfter:function(a){return a.deleteH(1,"word")},delGroupBefore:function(a){return a.deleteH(-1,"group")},delGroupAfter:function(a){return a.deleteH(1,"group")},indentAuto:function(a){return a.indentSelection("smart")},indentMore:function(a){return a.indentSelection("add")},indentLess:function(a){return a.indentSelection("subtract")},insertTab:function(a){return a.replaceSelection("\t")},
insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),f=ca(a.getLine(f.line),f.ch,d);b.push(Jc(d-f%d))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){return X(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++)if(b[d].empty()){var e=b[d].head,f=u(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new q(e.line,e.ch-1)),0<e.ch)e=
new q(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),q(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=u(a.doc,e.line-1).text;g&&(e=new q(e.line,1),a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),q(e.line-1,g.length-1),e,"+transpose"))}c.push(new y(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){return X(a,function(){for(var b=a.listSelections(),c=b.length-1;0<=c;c--)a.replaceRange(a.doc.lineSeparator(),b[c].anchor,b[c].head,"+input");
b=a.listSelections();for(c=0;c<b.length;c++)a.indentLine(b[c].from().line,null,!0);fb(a)})},openLine:function(a){return a.replaceSelection("\n","start")},toggleOverwrite:function(a){return a.toggleOverwrite()}},Dg=new Ua,Ed=null,Cc,Bc,qb={toString:function(){return"CodeMirror.Init"}},Bf={},Dc={};F.defaults=Bf;F.optionHandlers=Dc;var Id=[];F.defineInitHook=function(a){return Id.push(a)};var V=null,A=function(a){this.cm=a;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=
null;this.polling=new Ua;this.composing=null;this.gracePeriod=!1;this.readDOMTimeout=null};A.prototype.init=function(a){function b(a){if(!I(e,a)){if(e.somethingSelected())V={lineWise:!1,text:e.getSelections()},"cut"==a.type&&e.replaceSelection("",null,"cut");else if(e.options.lineWiseCopyCut){var b=Gf(e);V={lineWise:!0,text:b.text};"cut"==a.type&&e.operation(function(){e.setSelections(b.ranges,0,oa);e.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var c=
V.text.join("\n");a.clipboardData.setData("Text",c);if(a.clipboardData.getData("Text")==c){a.preventDefault();return}}var g=If();a=g.firstChild;e.display.lineSpace.insertBefore(g,e.display.lineSpace.firstChild);a.value=V.text.join("\n");var m=document.activeElement;sb(a);setTimeout(function(){e.display.lineSpace.removeChild(g);m.focus();m==f&&d.showPrimarySelection()},50)}}var c=this,d=this,e=d.cm,f=d.div=a.lineDiv;Hf(f,e.options.spellcheck);t(f,"paste",function(a){I(e,a)||Ff(a,e)||11>=E&&setTimeout(K(e,
function(){return c.updateFromDOM()}),20)});t(f,"compositionstart",function(a){c.composing={data:a.data,done:!1}});t(f,"compositionupdate",function(a){c.composing||(c.composing={data:a.data,done:!1})});t(f,"compositionend",function(a){c.composing&&(a.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)});t(f,"touchstart",function(){return d.forceCompositionEnd()});t(f,"input",function(){c.composing||c.readFromDOMSoon()});t(f,"copy",b);t(f,"cut",b)};A.prototype.prepareSelection=function(){var a=
Ae(this.cm,!1);a.focus=this.cm.state.focused;return a};A.prototype.showSelection=function(a,b){a&&this.cm.display.view.length&&((a.focus||b)&&this.showPrimarySelection(),this.showMultipleSelections(a))};A.prototype.showPrimarySelection=function(){var a=window.getSelection(),b=this.cm.doc.sel.primary(),c=Ec(this.cm,a.anchorNode,a.anchorOffset),d=Ec(this.cm,a.focusNode,a.focusOffset);if(!c||c.bad||!d||d.bad||0!=x(ec(c,d),b.from())||0!=x(dc(c,d),b.to()))if(c=Kf(this.cm,b.from()),d=Kf(this.cm,b.to()),
c||d){var e=this.cm.display.view,b=a.rangeCount&&a.getRangeAt(0);c?d||(d=e[e.length-1].measure,d=d.maps?d.maps[d.maps.length-1]:d.map,d={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}):c={node:e[0].measure.map[2],offset:0};var f;try{f=bb(c.node,c.offset,d.offset,d.node)}catch(g){}f&&(!xa&&this.cm.state.focused?(a.collapse(c.node,c.offset),f.collapsed||(a.removeAllRanges(),a.addRange(f))):(a.removeAllRanges(),a.addRange(f)),b&&null==a.anchorNode?a.addRange(b):xa&&this.startGracePeriod());this.rememberSelection()}else a.removeAllRanges()};
A.prototype.startGracePeriod=function(){var a=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){a.gracePeriod=!1;a.selectionChanged()&&a.cm.operation(function(){return a.cm.curOp.selectionChanged=!0})},20)};A.prototype.showMultipleSelections=function(a){Y(this.cm.display.cursorDiv,a.cursors);Y(this.cm.display.selectionDiv,a.selection)};A.prototype.rememberSelection=function(){var a=window.getSelection();this.lastAnchorNode=a.anchorNode;this.lastAnchorOffset=a.anchorOffset;
this.lastFocusNode=a.focusNode;this.lastFocusOffset=a.focusOffset};A.prototype.selectionInEditor=function(){var a=window.getSelection();if(!a.rangeCount)return!1;a=a.getRangeAt(0).commonAncestorContainer;return Zb(this.div,a)};A.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())};A.prototype.blur=function(){this.div.blur()};A.prototype.getField=function(){return this.div};A.prototype.supportsTouch=
function(){return!0};A.prototype.receivedFocus=function(){function a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():X(this.cm,function(){return b.cm.curOp.selectionChanged=!0});this.polling.set(this.cm.options.pollInterval,a)};A.prototype.selectionChanged=function(){var a=window.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||
a.focusOffset!=this.lastFocusOffset};A.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var a=window.getSelection(),b=this.cm;if(Pf&&Of&&this.cm.options.gutters.length&&Pg(a.anchorNode))this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();else if(!this.composing){this.rememberSelection();var c=Ec(b,a.anchorNode,a.anchorOffset),d=Ec(b,a.focusNode,a.focusOffset);c&&d&&X(b,function(){P(b.doc,
va(c,d),oa);if(c.bad||d.bad)b.curOp.selectionChanged=!0})}}};A.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),e=c.to();0==d.ch&&d.line>a.firstLine()&&(d=q(d.line-1,u(a.doc,d.line-1).length));e.ch==u(a.doc,e.line).text.length&&e.line<a.lastLine()&&(e=q(e.line+1,0));if(d.line<b.viewFrom||e.line>b.viewTo-1)return!1;var f;d.line==b.viewFrom||0==(f=Oa(a,d.line))?(c=C(b.view[0].line),
f=b.view[0].node):(c=C(b.view[f].line),f=b.view[f-1].node.nextSibling);var g=Oa(a,e.line);g==b.view.length-1?(e=b.viewTo-1,b=b.lineDiv.lastChild):(e=C(b.view[g+1].line)-1,b=b.view[g+1].node.previousSibling);if(!f)return!1;b=a.doc.splitLines(Qg(a,f,b,c,e));for(f=Ia(a.doc,q(c,0),q(e,u(a.doc,e).text.length));1<b.length&&1<f.length;)if(z(b)==z(f))b.pop(),f.pop(),e--;else if(b[0]==f[0])b.shift(),f.shift(),c++;else break;for(var h=0,g=0,k=b[0],l=f[0],m=Math.min(k.length,l.length);h<m&&k.charCodeAt(h)==
l.charCodeAt(h);)++h;k=z(b);l=z(f);for(m=Math.min(k.length-(1==b.length?h:0),l.length-(1==f.length?h:0));g<m&&k.charCodeAt(k.length-g-1)==l.charCodeAt(l.length-g-1);)++g;if(1==b.length&&1==f.length&&c==d.line)for(;h&&h>d.ch&&k.charCodeAt(k.length-g-1)==l.charCodeAt(l.length-g-1);)h--,g++;b[b.length-1]=k.slice(0,k.length-g).replace(/^\u200b+/,"");b[0]=b[0].slice(h).replace(/\u200b+$/,"");d=q(c,h);c=q(e,f.length?z(f).length-g:0);if(1<b.length||b[0]||x(d,c))return mb(a.doc,b,d,c,"+input"),!0};A.prototype.ensurePolled=
function(){this.forceCompositionEnd()};A.prototype.reset=function(){this.forceCompositionEnd()};A.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())};A.prototype.readFromDOMSoon=function(){var a=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){a.readDOMTimeout=null;if(a.composing)if(a.composing.done)a.composing=null;else return;a.updateFromDOM()},80))};A.prototype.updateFromDOM=
function(){var a=this;!this.cm.isReadOnly()&&this.pollContent()||X(this.cm,function(){return T(a.cm)})};A.prototype.setUneditable=function(a){a.contentEditable="false"};A.prototype.onKeyPress=function(a){0!=a.charCode&&(a.preventDefault(),this.cm.isReadOnly()||K(this.cm,Jd)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0))};A.prototype.readOnlyChanged=function(a){this.div.contentEditable=String("nocursor"!=a)};A.prototype.onContextMenu=function(){};A.prototype.resetPosition=function(){};
A.prototype.needsContentAttribute=!0;var H=function(a){this.cm=a;this.prevInput="";this.pollingFast=!1;this.polling=new Ua;this.hasSelection=this.inaccurateSelection=!1;this.composing=null};H.prototype.init=function(a){function b(a){if(!I(e,a)){if(e.somethingSelected())V={lineWise:!1,text:e.getSelections()},d.inaccurateSelection&&(d.prevInput="",d.inaccurateSelection=!1,g.value=V.text.join("\n"),sb(g));else if(e.options.lineWiseCopyCut){var b=Gf(e);V={lineWise:!0,text:b.text};"cut"==a.type?e.setSelections(b.ranges,
null,oa):(d.prevInput="",g.value=b.text.join("\n"),sb(g))}else return;"cut"==a.type&&(e.state.cutIncoming=!0)}}var c=this,d=this,e=this.cm,f=this.wrapper=If(),g=this.textarea=f.firstChild;a.wrapper.insertBefore(f,a.wrapper.firstChild);Sb&&(g.style.width="0px");t(g,"input",function(){B&&9<=E&&c.hasSelection&&(c.hasSelection=null);d.poll()});t(g,"paste",function(a){I(e,a)||Ff(a,e)||(e.state.pasteIncoming=!0,d.fastPoll())});t(g,"cut",b);t(g,"copy",b);t(a.scroller,"paste",function(b){ua(a,b)||I(e,b)||
(e.state.pasteIncoming=!0,d.focus())});t(a.lineSpace,"selectstart",function(b){ua(a,b)||Q(b)});t(g,"compositionstart",function(){var a=e.getCursor("from");d.composing&&d.composing.range.clear();d.composing={start:a,range:e.markText(a,e.getCursor("to"),{className:"CodeMirror-composing"})}});t(g,"compositionend",function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)})};H.prototype.prepareSelection=function(){var a=this.cm,b=a.display,c=a.doc,d=Ae(a);if(a.options.moveInputWithCursor){var a=
ga(a,c.sel.primary().head,"div"),c=b.wrapper.getBoundingClientRect(),e=b.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+e.top-c.top));d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+e.left-c.left))}return d};H.prototype.showSelection=function(a){var b=this.cm.display;Y(b.cursorDiv,a.cursors);Y(b.selectionDiv,a.selection);null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")};H.prototype.reset=function(a){if(!this.contextMenuPending){var b,
c,d=this.cm,e=d.doc;d.somethingSelected()?(this.prevInput="",b=e.sel.primary(),c=(b=wf&&(100<b.to().line-b.from().line||1E3<(c=d.getSelection()).length))?"-":c||d.getSelection(),this.textarea.value=c,d.state.focused&&sb(this.textarea),B&&9<=E&&(this.hasSelection=c)):a||(this.prevInput=this.textarea.value="",B&&9<=E&&(this.hasSelection=null));this.inaccurateSelection=b}};H.prototype.getField=function(){return this.textarea};H.prototype.supportsTouch=function(){return!1};H.prototype.focus=function(){if("nocursor"!=
this.cm.options.readOnly&&(!tb||qa()!=this.textarea))try{this.textarea.focus()}catch(a){}};H.prototype.blur=function(){this.textarea.blur()};H.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};H.prototype.receivedFocus=function(){this.slowPoll()};H.prototype.slowPoll=function(){var a=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){a.poll();a.cm.state.focused&&a.slowPoll()})};H.prototype.fastPoll=function(){function a(){c.poll()||b?
(c.pollingFast=!1,c.slowPoll()):(b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0;c.polling.set(20,a)};H.prototype.poll=function(){var a=this,b=this.cm,c=this.textarea,d=this.prevInput;if(this.contextMenuPending||!b.state.focused||Vg(c)&&!d&&!this.composing||b.isReadOnly()||b.options.disableInput||b.state.keySeq)return!1;var e=c.value;if(e==d&&!b.somethingSelected())return!1;if(B&&9<=E&&this.hasSelection===e||fa&&/[\uf700-\uf7ff]/.test(e))return b.display.input.reset(),!1;if(b.doc.sel==
b.display.selForContextMenu){var f=e.charCodeAt(0);8203!=f||d||(d="\u200b");if(8666==f)return this.reset(),this.cm.execCommand("undo")}for(var g=0,f=Math.min(d.length,e.length);g<f&&d.charCodeAt(g)==e.charCodeAt(g);)++g;X(b,function(){Jd(b,e.slice(g),d.length-g,null,a.composing?"*compose":null);1E3<e.length||-1<e.indexOf("\n")?c.value=a.prevInput="":a.prevInput=e;a.composing&&(a.composing.range.clear(),a.composing.range=b.markText(a.composing.start,b.getCursor("to"),{className:"CodeMirror-composing"}))});
return!0};H.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)};H.prototype.onKeyPress=function(){B&&9<=E&&(this.hasSelection=null);this.fastPoll()};H.prototype.onContextMenu=function(a){function b(){if(null!=g.selectionStart){var a=e.somethingSelected(),b="\u200b"+(a?g.value:"");g.value="\u21da";g.value=b;d.prevInput=a?"":"\u200b";g.selectionStart=1;g.selectionEnd=b.length;f.selForContextMenu=e.doc.sel}}function c(){d.contextMenuPending=!1;d.wrapper.style.cssText=
m;g.style.cssText=l;B&&9>E&&f.scrollbars.setScrollTop(f.scroller.scrollTop=k);if(null!=g.selectionStart){(!B||B&&9>E)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&0<g.selectionEnd&&"\u200b"==d.prevInput?K(e,bf)(e):10>a++?f.detectingSelectAll=setTimeout(c,500):(f.selForContextMenu=null,f.input.reset())};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=Ra(e,a),k=f.scroller.scrollTop;if(h&&!ha){e.options.resetSelectionOnContextMenu&&
-1==e.doc.sel.contains(h)&&K(e,P)(e.doc,va(h),oa);var l=g.style.cssText,m=d.wrapper.style.cssText;d.wrapper.style.cssText="position: absolute";h=d.wrapper.getBoundingClientRect();g.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(a.clientY-h.top-5)+"px; left: "+(a.clientX-h.left-5)+"px;\n      z-index: 1000; background: "+(B?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
var p;N&&(p=window.scrollY);f.input.focus();N&&window.scrollTo(null,p);f.input.reset();e.somethingSelected()||(g.value=d.prevInput=" ");d.contextMenuPending=!0;f.selForContextMenu=e.doc.sel;clearTimeout(f.detectingSelectAll);B&&9<=E&&b();if(Gd){xb(a);var n=function(){ea(window,"mouseup",n);setTimeout(c,20)};t(window,"mouseup",n)}else setTimeout(c,50)}};H.prototype.readOnlyChanged=function(a){a||this.reset()};H.prototype.setUneditable=function(){};H.prototype.needsContentAttribute=!1;(function(a){function b(b,
e,f,g){a.defaults[b]=e;f&&(c[b]=g?function(a,b,d){d!=qb&&f(a,b,d)}:f)}var c=a.optionHandlers;a.defineOption=b;a.Init=qb;b("value","",function(a,b){return a.setValue(b)},!0);b("mode",null,function(a,b){a.doc.modeOption=b;yd(a)},!0);b("indentUnit",2,yd,!0);b("indentWithTabs",!1);b("smartIndent",!0);b("tabSize",4,function(a){Jb(a);Db(a);T(a)},!0);b("lineSeparator",null,function(a,b){if(a.doc.lineSep=b){var d=[],c=a.doc.first;a.doc.iter(function(a){for(var e=0;;){var f=a.text.indexOf(b,e);if(-1==f)break;
e=f+b.length;d.push(q(c,f))}c++});for(var e=d.length-1;0<=e;e--)mb(a.doc,b,d[e],q(d[e].line,d[e].ch+b.length))}});b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(a,b,c){a.state.specialChars=new RegExp(b.source+(b.test("\t")?"":"|\t"),"g");c!=qb&&a.refresh()});b("specialCharPlaceholder",eg,function(a){return a.refresh()},!0);b("electricChars",!0);b("inputStyle",tb?"contenteditable":"textarea",function(){throw Error("inputStyle can not (yet) be changed in a running editor");
},!0);b("spellcheck",!1,function(a,b){return a.getInputField().spellcheck=b},!0);b("rtlMoveVisually",!Ug);b("wholeLineUpdateBefore",!0);b("theme","default",function(a){Af(a);Qb(a)},!0);b("keyMap","default",function(a,b,c){b=xc(b);(c=c!=qb&&xc(c))&&c.detach&&c.detach(a,b);b.attach&&b.attach(a,c||null)});b("extraKeys",null);b("lineWrapping",!1,Ng,!0);b("gutters",[],function(a){wd(a.options);Qb(a)},!0);b("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?md(a.display)+"px":"0";a.refresh()},
!0);b("coverGutterNextToScrollbar",!1,function(a){return eb(a)},!0);b("scrollbarStyle","native",function(a){Ie(a);eb(a);a.display.scrollbars.setScrollTop(a.doc.scrollTop);a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0);b("lineNumbers",!1,function(a){wd(a.options);Qb(a)},!0);b("firstLineNumber",1,Qb,!0);b("lineNumberFormatter",function(a){return a},Qb,!0);b("showCursorWhenSelecting",!1,Eb,!0);b("resetSelectionOnContextMenu",!0);b("lineWiseCopyCut",!0);b("readOnly",!1,function(a,b){"nocursor"==
b?(Fb(a),a.display.input.blur(),a.display.disabled=!0):a.display.disabled=!1;a.display.input.readOnlyChanged(b)});b("disableInput",!1,function(a,b){b||a.display.input.reset()},!0);b("dragDrop",!0,Mg);b("allowDropFileTypes",null);b("cursorBlinkRate",530);b("cursorScrollMargin",0);b("cursorHeight",1,Eb,!0);b("singleCursorHeightPerLine",!0,Eb,!0);b("workTime",100);b("workDelay",100);b("flattenSpans",!0,Jb,!0);b("addModeClass",!1,Jb,!0);b("pollInterval",100);b("undoDepth",200,function(a,b){return a.doc.history.undoDepth=
b});b("historyEventDelay",1250);b("viewportMargin",10,function(a){return a.refresh()},!0);b("maxHighlightLength",1E4,Jb,!0);b("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()});b("tabindex",null,function(a,b){return a.display.input.getField().tabIndex=b||""});b("autofocus",null);b("direction","ltr",function(a,b){return a.doc.setDirection(b)},!0)})(F);(function(a){var b=a.optionHandlers,c=a.helpers={};a.prototype={constructor:a,focus:function(){window.focus();this.display.input.focus()},
setOption:function(a,c){var d=this.options,e=d[a];if(d[a]!=c||"mode"==a)d[a]=c,b.hasOwnProperty(a)&&K(this,b[a])(this,c,e),G(this,"optionChange",this,a)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](xc(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||b[c].name==a)return b.splice(c,1),!0},addOverlay:S(function(b,c){var d=b.token?b:a.getMode(this.options,b);if(d.startState)throw Error("Overlays may not be stateful.");
Qf(this.state.overlays,{mode:d,modeSpec:b,opaque:c&&c.opaque,priority:c&&c.priority||0},function(a){return a.priority});this.state.modeGen++;T(this)}),removeOverlay:S(function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a){b.splice(c,1);this.state.modeGen++;T(this);break}}}),indentLine:S(function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");ub(this.doc,a)&&Rb(this,
a,b,c)}),indentSelection:S(function(a){for(var b=this.doc.sel.ranges,c=-1,d=0;d<b.length;d++){var h=b[d];if(h.empty())h.head.line>c&&(Rb(this,h.head.line,a,!0),c=h.head.line,d==this.doc.sel.primIndex&&fb(this));else{for(var k=h.from(),h=h.to(),l=Math.max(c,k.line),c=Math.min(this.lastLine(),h.line-(h.ch?0:1))+1,h=l;h<c;++h)Rb(this,h,a);h=this.doc.sel.ranges;0==k.ch&&b.length==h.length&&0<h[d].from().ch&&Bd(this.doc,d,new y(k,h[d].to()),oa)}}}),getTokenAt:function(a,b){return ge(this,a,b)},getLineTokens:function(a,
b){return ge(this,q(a),b,!0)},getTokenTypeAt:function(a){a=w(this.doc,a);var b=ee(this,u(this.doc,a.line)),c=0,d=(b.length-1)/2;a=a.ch;if(0==a)b=b[2];else for(;;){var h=c+d>>1;if((h?b[2*h-1]:0)>=a)d=h;else if(b[2*h+1]<a)c=h+1;else{b=b[2*h+2];break}}c=b?b.indexOf("overlay "):-1;return 0>c?b:0==c?null:b.slice(0,c-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,
b){var d=[];if(!c.hasOwnProperty(b))return d;var e=c[b],h=this.getModeAt(a);if("string"==typeof h[b])e[h[b]]&&d.push(e[h[b]]);else if(h[b])for(var k=0;k<h[b].length;k++){var l=e[h[b][k]];l&&d.push(l)}else h.helperType&&e[h.helperType]?d.push(e[h.helperType]):e[h.name]&&d.push(e[h.name]);for(k=0;k<e._global.length;k++)l=e._global[k],l.pred(h,this)&&-1==M(d,l.val)&&d.push(l.val);return d},getStateAfter:function(a,b){var c=this.doc;a=Math.max(c.first,Math.min(null==a?c.first+c.size-1:a,c.first+c.size-
1));return yb(this,a+1,b)},cursorCoords:function(a,b){var c;c=this.doc.sel.primary();c=null==a?c.head:"object"==typeof a?w(this.doc,a):a?c.from():c.to();return ga(this,c,b||"page")},charCoords:function(a,b){return kc(this,w(this.doc,a),b||"page")},coordsChar:function(a,b){a=xe(this,a,b||"page");return ld(this,a.left,a.top)},lineAtHeight:function(a,b){a=xe(this,{top:a,left:0},b||"page").top;return Ja(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b,c){var d=!1;if("number"==typeof a){var e=
this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>e&&(a=e,d=!0);a=u(this.doc,a)}return Ma(this,a,{top:0,left:0},b||"page",c||d).top+(d?this.doc.height-la(a):0)},defaultTextHeight:function(){return Pa(this.display)},defaultCharWidth:function(){return Cb(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,g,h){var d=this.display;a=ga(this,w(this.doc,a));var e=a.bottom,f=a.left;b.style.position="absolute";b.setAttribute("cm-ignore-events",
"true");this.display.input.setUneditable(b);d.sizer.appendChild(b);if("over"==g)e=a.top;else if("above"==g||"near"==g){var p=Math.max(d.wrapper.clientHeight,this.doc.height),n=Math.max(d.sizer.clientWidth,d.lineSpace.clientWidth);("above"==g||a.bottom+b.offsetHeight>p)&&a.top>b.offsetHeight?e=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=p&&(e=a.bottom);f+b.offsetWidth>n&&(f=n-b.offsetWidth)}b.style.top=e+"px";b.style.left=b.style.right="";"right"==h?(f=d.sizer.clientWidth-b.offsetWidth,b.style.right=
"0px"):("left"==h?f=0:"middle"==h&&(f=(d.sizer.clientWidth-b.offsetWidth)/2),b.style.left=f+"px");c&&(a=nc(this,{left:f,top:e,right:f+b.offsetWidth,bottom:e+b.offsetHeight}),null!=a.scrollTop&&Gb(this,a.scrollTop),null!=a.scrollLeft&&db(this,a.scrollLeft))},triggerOnKeyDown:S(vf),triggerOnKeyPress:S(yf),triggerOnKeyUp:xf,execCommand:function(a){if(zc.hasOwnProperty(a))return zc[a].call(null,this)},triggerElectric:S(function(a){Ef(this,a)}),findPosH:function(a,b,c,g){var d=1;0>b&&(d=-1,b=-b);a=w(this.doc,
a);for(var e=0;e<b&&(a=Ld(this.doc,a,d,c,g),!a.hitSide);++e);return a},moveH:S(function(a,b){var c=this;this.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Ld(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Ub)}),deleteH:S(function(a,b){var c=this.doc;this.doc.sel.somethingSelected()?c.replaceSelection("",null,"+delete"):pb(this,function(d){var e=Ld(c,d.head,a,b,!1);return 0>a?{from:e,to:d.head}:{from:d.head,to:e}})}),findPosV:function(a,b,c,g){var d=
1;0>b&&(d=-1,b=-b);var e=w(this.doc,a);for(a=0;a<b&&(e=ga(this,e,"div"),null==g?g=e.left:e.left=g,e=Jf(this,e,d,c),!e.hitSide);++a);return e},moveV:S(function(a,b){var c=this,d=this.doc,e=[],k=!this.display.shift&&!d.extend&&d.sel.somethingSelected();d.extendSelectionsBy(function(f){if(k)return 0>a?f.from():f.to();var g=ga(c,f.head,"div");null!=f.goalColumn&&(g.left=f.goalColumn);e.push(g.left);var h=Jf(c,g,a,b);"page"==b&&f==d.sel.primary()&&oc(c,null,kc(c,h,"div").top-g.top);return h},Ub);if(e.length)for(var l=
0;l<d.sel.ranges.length;l++)d.sel.ranges[l].goalColumn=e[l]}),findWordAt:function(a){var b=u(this.doc,a.line).text,c=a.ch,d=a.ch;if(b){var h=this.getHelper(a,"wordChars");"before"!=a.sticky&&d!=b.length||!c?++d:--c;for(var k=b.charAt(c),k=bc(k,h)?function(a){return bc(a,h)}:/\s/.test(k)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!bc(a)};0<c&&k(b.charAt(c-1));)--c;for(;d<b.length&&k(b.charAt(d));)++d}return new y(q(a.line,c),q(a.line,d))},toggleOverwrite:function(a){if(null==
a||a!=this.state.overwrite)(this.state.overwrite=!this.state.overwrite)?Ga(this.display.cursorDiv,"CodeMirror-overwrite"):Sa(this.display.cursorDiv,"CodeMirror-overwrite"),G(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==qa()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:S(function(a,b){null==a&&null==b||pc(this);null!=a&&(this.curOp.scrollLeft=a);null!=b&&(this.curOp.scrollTop=b)}),getScrollInfo:function(){var a=
this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-na(this)-this.display.barHeight,width:a.scrollWidth-na(this)-this.display.barWidth,clientHeight:hd(this),clientWidth:Na(this)}},scrollIntoView:S(function(a,b){null==a?(a={from:this.doc.sel.primary().head,to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:q(a,0),to:null}:null==a.from&&(a={from:a,to:null});a.to||(a.to=a.from);a.margin=b||0;if(null!=a.from.line)pc(this),this.curOp.scrollToPos=
a;else{var c=nc(this,{left:Math.min(a.from.left,a.to.left),top:Math.min(a.from.top,a.to.top)-a.margin,right:Math.max(a.from.right,a.to.right),bottom:Math.max(a.from.bottom,a.to.bottom)+a.margin});this.scrollTo(c.scrollLeft,c.scrollTop)}}),setSize:S(function(a,b){var c=this,d=function(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a};null!=a&&(this.display.wrapper.style.width=d(a));null!=b&&(this.display.wrapper.style.height=d(b));this.options.lineWrapping&&we(this);var e=this.display.viewFrom;
this.doc.iter(e,this.display.viewTo,function(a){if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].noHScroll){Ba(c,e,"widget");break}++e});this.curOp.forceUpdate=!0;G(this,"refresh",this)}),operation:function(a){return X(this,a)},refresh:S(function(){var a=this.display.cachedTextHeight;T(this);this.curOp.forceUpdate=!0;Db(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);rd(this);(null==a||.5<Math.abs(a-Pa(this.display)))&&nd(this);G(this,"refresh",this)}),swapDoc:S(function(a){var b=
this.doc;b.cm=null;Qe(this,a);Db(this);this.display.input.reset();this.scrollTo(a.scrollLeft,a.scrollTop);this.curOp.forceScroll=!0;O(this,"swapDoc",this,b);return b}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};Za(a);a.registerHelper=function(b,e,f){c.hasOwnProperty(b)||(c[b]=a[b]={_global:[]});c[b][e]=f};
a.registerGlobalHelper=function(b,e,f,g){a.registerHelper(b,e,g);c[b]._global.push({pred:f,val:g})}})(F);var Xg="iter insert remove copy getEditor constructor".split(" "),Yb;for(Yb in U.prototype)U.prototype.hasOwnProperty(Yb)&&0>M(Xg,Yb)&&(F.prototype[Yb]=function(a){return function(){return a.apply(this.doc,arguments)}}(U.prototype[Yb]));Za(U);F.inputStyles={textarea:H,contenteditable:A};F.defineMode=function(a){F.defaults.mode||"null"==a||(F.defaults.mode=a);Yf.apply(this,arguments)};F.defineMIME=
function(a,b){$a[a]=b};F.defineMode("null",function(){return{token:function(a){return a.skipToEnd()}}});F.defineMIME("text/plain","null");F.defineExtension=function(a,b){F.prototype[a]=b};F.defineDocExtension=function(a,b){U.prototype[a]=b};F.fromTextArea=function(a,b){function c(){a.value=h.getValue()}b=b?Ha(b):{};b.value=a.value;!b.tabindex&&a.tabIndex&&(b.tabindex=a.tabIndex);!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder);if(null==b.autofocus){var d=qa();b.autofocus=d==a||null!=a.getAttribute("autofocus")&&
d==document.body}var e;if(a.form&&(t(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var f=a.form;e=f.submit;try{var g=f.submit=function(){c();f.submit=e;f.submit();f.submit=g}}catch(k){}}b.finishInit=function(b){b.save=c;b.getTextArea=function(){return a};b.toTextArea=function(){b.toTextArea=isNaN;c();a.parentNode.removeChild(b.getWrapperElement());a.style.display="";a.form&&(ea(a.form,"submit",c),"function"==typeof a.form.submit&&(a.form.submit=e))}};a.style.display="none";var h=F(function(b){return a.parentNode.insertBefore(b,
a.nextSibling)},b);return h};(function(a){a.off=ea;a.on=t;a.wheelEventPixels=lg;a.Doc=U;a.splitLines=Kd;a.countColumn=ca;a.findColumn=Ic;a.isWordChar=Kc;a.Pass=Dd;a.signal=G;a.Line=ib;a.changeEnd=Ca;a.scrollbarModel=Je;a.Pos=q;a.cmpPos=x;a.modes=$c;a.mimeModes=$a;a.resolveMode=ic;a.getMode=ad;a.modeExtensions=ab;a.extendMode=Zf;a.copyState=sa;a.startState=be;a.innerMode=bd;a.commands=zc;a.keyMap=Pb;a.keyName=qf;a.isModifierKey=pf;a.lookupKey=ob;a.normalizeKeyMap=Bg;a.StringStream=J;a.SharedTextMarker=
Ob;a.TextMarker=Da;a.LineWidget=Nb;a.e_preventDefault=Q;a.e_stopPropagation=$d;a.e_stop=xb;a.addClass=Ga;a.contains=Zb;a.rmClass=Sa;a.keyNames=Ea})(F);F.version="5.25.0";return F});

(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){var A={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,menuitem:!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,
caseFold:!0},I={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};h.defineMode("xml",function(v,t){function F(a,f){function e(e){f.tokenize=e;return e(a,f)}var k=a.next();if("<"==k){if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?e(C("atom","]]\x3e")):null:a.match("--")?e(C("comment","--\x3e")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),e(M(1))):null;if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),f.tokenize=C("meta","?>"),
"meta";K=a.eat("/")?"closeTag":"openTag";f.tokenize=B;return"tag bracket"}if("&"==k)return(a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"))?"atom":"error";a.eatWhile(/[^&<]/);return null}function B(a,f){var e=a.next();if(">"==e||"/"==e&&a.eat(">"))return f.tokenize=F,K=">"==e?"endTag":"selfcloseTag","tag bracket";if("="==e)return K="equals",null;if("<"==e)return f.tokenize=F,f.state=G,f.tagName=f.tagStart=null,(e=f.tokenize(a,
f))?e+" tag error":"tag error";if(/[\'\"]/.test(e))return f.tokenize=N(e),f.stringStartCol=a.column(),f.tokenize(a,f);a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}function N(a){var e=function(e,f){for(;!e.eol();)if(e.next()==a){f.tokenize=B;break}return"string"};e.isInAttribute=!0;return e}function C(a,f){return function(e,k){for(;!e.eol();){if(e.match(f)){k.tokenize=F;break}e.next()}return a}}function M(a){return function(e,q){for(var f;null!=(f=e.next());){if("<"==f)return q.tokenize=
M(a+1),q.tokenize(e,q);if(">"==f)if(1==a){q.tokenize=F;break}else return q.tokenize=M(a-1),q.tokenize(e,q)}return"meta"}}function z(a,f,q){this.prev=a.context;this.tagName=f;this.indent=a.indented;this.startOfLine=q;if(H.doNotIndent.hasOwnProperty(f)||a.context&&a.context.noIndent)this.noIndent=!0}function m(a){a.context&&(a.context=a.context.prev)}function a(a,f){for(var e;a.context;){e=a.context.tagName;if(!H.contextGrabbers.hasOwnProperty(e)||!H.contextGrabbers[e].hasOwnProperty(f))break;m(a)}}
function G(a,f,q){return"openTag"==a?(q.tagStart=f.column(),J):"closeTag"==a?x:G}function J(a,f,q){if("word"==a)return q.tagName=f.current(),D="tag",g;D="error";return J}function x(a,f,q){if("word"==a){a=f.current();q.context&&q.context.tagName!=a&&H.implicitlyClosed.hasOwnProperty(q.context.tagName)&&m(q);if(q.context&&q.context.tagName==a||!1===H.matchClosing)return D="tag",u;D="tag error";return p}D="error";return p}function u(a,f,q){if("endTag"!=a)return D="error",u;m(q);return G}function p(a,
f,q){D="error";return u(a,f,q)}function g(e,f,q){if("word"==e)return D="attribute",E;if("endTag"==e||"selfcloseTag"==e){f=q.tagName;var k=q.tagStart;q.tagName=q.tagStart=null;"selfcloseTag"==e||H.autoSelfClosers.hasOwnProperty(f)?a(q,f):(a(q,f),q.context=new z(q,f,k==q.indented));return G}D="error";return g}function E(a,f,k){if("equals"==a)return w;H.allowMissing||(D="error");return g(a,f,k)}function w(a,f,q){if("string"==a)return k;if("word"==a&&H.allowUnquoted)return D="string",g;D="error";return g(a,
f,q)}function k(a,f,q){return"string"==a?k:g(a,f,q)}var P=v.indentUnit,H={},U=t.htmlMode?A:I,R;for(R in U)H[R]=U[R];for(R in t)H[R]=t[R];var K,D;F.isInText=!0;return{startState:function(a){var e={tokenize:F,state:G,indented:a||0,tagName:null,tagStart:null,context:null};null!=a&&(e.baseIndent=a);return e},token:function(a,f){!f.tagName&&a.sol()&&(f.indented=a.indentation());if(a.eatSpace())return null;K=null;var e=f.tokenize(a,f);(e||K)&&"comment"!=e&&(D=null,f.state=f.state(K||e,a,f),D&&(e="error"==
D?e+" error":D));return e},indent:function(a,f,k){var e=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+P;if(e&&e.noIndent)return h.Pass;if(a.tokenize!=B&&a.tokenize!=F)return k?k.match(/^(\s*)/)[0].length:0;if(a.tagName)return!1!==H.multilineTagIndentPastTag?a.tagStart+a.tagName.length+2:a.tagStart+P*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/<!\[CDATA\[/.test(f))return 0;if((f=f&&/^<(\/)?([\w_:\.-]*)/.exec(f))&&f[1])for(;e;)if(e.tagName==
f[2]){e=e.prev;break}else if(H.implicitlyClosed.hasOwnProperty(e.tagName))e=e.prev;else break;else if(f)for(;e;)if((k=H.contextGrabbers[e.tagName])&&k.hasOwnProperty(f[2]))e=e.prev;else break;for(;e&&e.prev&&!e.startOfLine;)e=e.prev;return e?e.indent+P:a.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(a){a.state==w&&(a.state=g)}}});h.defineMIME("text/xml",
"xml");h.defineMIME("application/xml","xml");h.mimeModes.hasOwnProperty("text/html")||h.defineMIME("text/html",{name:"xml",htmlMode:!0})});
(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function A(h,v,t){return/^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(v.lastType)||"quasi"==v.lastType&&/\{\s*$/.test(h.string.slice(0,h.pos-(t||0)))}h.defineMode("javascript",function(I,v){function t(c,a,b){aa=c;da=b;return a}function F(c,a){var b=c.next();if('"'==b||"'"==
b)return a.tokenize=B(b),a.tokenize(c,a);if("."==b&&c.match(/^\d+(?:[eE][+\-]?\d+)?/))return t("number","number");if("."==b&&c.match(".."))return t("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(b))return t(b);if("="==b&&c.eat(">"))return t("=>","operator");if("0"==b&&c.eat(/x/i))return c.eatWhile(/[\da-f]/i),t("number","number");if("0"==b&&c.eat(/o/i))return c.eatWhile(/[0-7]/i),t("number","number");if("0"==b&&c.eat(/b/i))return c.eatWhile(/[01]/i),t("number","number");if(/\d/.test(b))return c.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),
t("number","number");if("/"==b){if(c.eat("*"))return a.tokenize=N,N(c,a);if(c.eat("/"))return c.skipToEnd(),t("comment","comment");if(A(c,a,1)){a:for(var b=!1,n,d=!1;null!=(n=c.next());){if(!b){if("/"==n&&!d)break a;"["==n?d=!0:d&&"]"==n&&(d=!1)}b=!b&&"\\"==n}c.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return t("regexp","string-2")}c.eatWhile(ea);return t("operator","operator",c.current())}if("`"==b)return a.tokenize=C,C(c,a);if("#"==b)return c.skipToEnd(),t("error","error");if(ea.test(b))return">"==
b&&a.lexical&&">"==a.lexical.type||c.eatWhile(ea),t("operator","operator",c.current());if(ka.test(b))return c.eatWhile(ka),b=c.current(),(n=ra.propertyIsEnumerable(b)&&ra[b])&&"."!=a.lastType?t(n.type,n.style,b):t("variable","variable",b)}function B(c){return function(a,b){var n=!1,d;if(fa&&"@"==a.peek()&&a.match(za))return b.tokenize=F,t("jsonld-keyword","meta");for(;null!=(d=a.next())&&(d!=c||n);)n=!n&&"\\"==d;n||(b.tokenize=F);return t("string","string")}}function N(c,a){for(var b=!1,n;n=c.next();){if("/"==
n&&b){a.tokenize=F;break}b="*"==n}return t("comment","comment")}function C(c,a){for(var b=!1,n;null!=(n=c.next());){if(!b&&("`"==n||"$"==n&&c.eat("{"))){a.tokenize=F;break}b=!b&&"\\"==n}return t("quasi","string-2",c.current())}function M(c,a){a.fatArrowAt&&(a.fatArrowAt=null);var b=c.string.indexOf("=>",c.start);if(!(0>b)){if(S){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(c.string.slice(c.start,b));n&&(b=n.index)}for(var n=0,d=!1,b=b-1;0<=b;--b){var e=c.string.charAt(b),r="([{}])".indexOf(e);
if(0<=r&&3>r){if(!n){++b;break}if(0==--n){"("==e&&(d=!0);break}}else if(3<=r&&6>r)++n;else if(ka.test(e))d=!0;else{if(/["'\/]/.test(e))return;if(d&&!n){++b;break}}}d&&!n&&(a.fatArrowAt=b)}}function z(c,a,b,d,e,r){this.indented=c;this.column=a;this.type=b;this.prev=e;this.info=r;null!=d&&(this.align=d)}function m(){for(var c=arguments.length-1;0<=c;c--)l.cc.push(arguments[c])}function a(){m.apply(null,arguments);return!0}function G(c){function a(a){for(;a;a=a.next)if(a.name==c)return!0;return!1}var b=
l.state;l.marked="def";b.context?a(b.localVars)||(b.localVars={name:c,next:b.localVars}):!a(b.globalVars)&&v.globalVars&&(b.globalVars={name:c,next:b.globalVars})}function J(){l.state.context={prev:l.state.context,vars:l.state.localVars};l.state.localVars=Aa}function x(){l.state.localVars=l.state.context.vars;l.state.context=l.state.context.prev}function u(c,a){var b=function(){var b=l.state,n=b.indented;if("stat"==b.lexical.type)n=b.lexical.indented;else for(var d=b.lexical;d&&")"==d.type&&d.align;d=
d.prev)n=d.indented;b.lexical=new z(n,l.stream.column(),c,null,b.lexical,a)};b.lex=!0;return b}function p(){var c=l.state;c.lexical.prev&&(")"==c.lexical.type&&(c.indented=c.lexical.indented),c.lexical=c.lexical.prev)}function g(c){function b(d){return d==c?a():";"==c?m():a(b)}return b}function E(c,d){return"var"==c?a(u("vardef",d.length),L,g(";"),p):"keyword a"==c?a(u("form"),P,E,p):"keyword b"==c?a(u("form"),E,p):"{"==c?a(u("}"),ga,p):";"==c?a():"if"==c?("else"==l.state.lexical.info&&l.state.cc[l.state.cc.length-
1]==p&&l.state.cc.pop()(),a(u("form"),P,E,p,sa)):"function"==c?a(Q):"for"==c?a(u("form"),Ba,E,p):"variable"==c?a(u("stat"),Ca):"switch"==c?a(u("form"),P,u("}","switch"),g("{"),ga,p,p):"case"==c?a(w,g(":")):"default"==c?a(g(":")):"catch"==c?a(u("form"),J,g("("),la,g(")"),E,p,x):"class"==c?a(u("form"),ta,p):"export"==c?a(u("stat"),Da,p):"import"==c?a(u("stat"),Ea,p):"module"==c?a(u("form"),b,u("}"),g("{"),ga,p,p):"type"==c?a(O,g("operator"),O,g(";")):"async"==c?a(E):m(u("stat"),w,g(";"),p)}function w(c){return H(c,
!1)}function k(c){return H(c,!0)}function P(c){return"("!=c?m():a(u(")"),w,g(")"),p)}function H(c,d){if(l.state.fatArrowAt==l.stream.start){var n=d?qa:q;if("("==c)return a(J,u(")"),T(b,")"),p,g("=>"),n,x);if("variable"==c)return m(J,b,g("=>"),n,x)}n=d?D:K;return Fa.hasOwnProperty(c)?a(n):"function"==c?a(Q,n):"class"==c?a(u("form"),Ga,p):"keyword c"==c||"async"==c?a(d?R:U):"("==c?a(u(")"),U,g(")"),p,n):"operator"==c||"spread"==c?a(d?k:w):"["==c?a(u("]"),Ha,p,n):"{"==c?ba(ma,"}",null,n):"quasi"==c?
m(e,n):"new"==c?a(ya(d)):a()}function U(c){return c.match(/[;\}\)\],]/)?m():m(w)}function R(c){return c.match(/[;\}\)\],]/)?m():m(k)}function K(c,b){return","==c?a(w):D(c,b,!1)}function D(c,b,d){var n=0==d?K:D,r=0==d?w:k;if("=>"==c)return a(J,d?qa:q,x);if("operator"==c)return/\+\+|--/.test(b)?a(n):"?"==b?a(w,g(":"),r):a(r);if("quasi"==c)return m(e,n);if(";"!=c){if("("==c)return ba(k,")","call",n);if("."==c)return a(Ia,n);if("["==c)return a(u("]"),U,g("]"),p,n)}}function e(c,b){return"quasi"!=c?m():
"${"!=b.slice(b.length-2)?a(e):a(w,f)}function f(c){if("}"==c)return l.marked="string-2",l.state.tokenize=C,a(e)}function q(c){M(l.stream,l.state);return m("{"==c?E:w)}function qa(c){M(l.stream,l.state);return m("{"==c?E:k)}function ya(c){return function(b){return"."==b?a(c?Ja:Ka):m(c?k:w)}}function Ka(c,b){if("target"==b)return l.marked="keyword",a(K)}function Ja(c,b){if("target"==b)return l.marked="keyword",a(D)}function Ca(c){return":"==c?a(p,E):m(K,g(";"),p)}function Ia(c){if("variable"==c)return l.marked=
"property",a()}function ma(c,b){if("async"==c)return l.marked="property",a(ma);if("variable"==c||"keyword"==l.style)return l.marked="property","get"==b||"set"==b?a(La):a(V);if("number"==c||"string"==c)return l.marked=fa?"property":l.style+" property",a(V);if("jsonld-keyword"==c)return a(V);if("modifier"==c)return a(ma);if("["==c)return a(w,g("]"),V);if("spread"==c)return a(w);if(":"==c)return m(V)}function La(c){if("variable"!=c)return m(V);l.marked="property";return a(Q)}function V(c){if(":"==c)return a(k);
if("("==c)return m(Q)}function T(c,b,d){function n(e,r){if(d?-1<d.indexOf(e):","==e){var f=l.state.lexical;"call"==f.info&&(f.pos=(f.pos||0)+1);return a(function(a,d){return a==b||d==b?m():m(c)},n)}return e==b||r==b?a():a(g(b))}return function(d,e){return d==b||e==b?a():m(c,n)}}function ba(c,b,d){for(var n=3;n<arguments.length;n++)l.cc.push(arguments[n]);return a(u(b,d),T(c,b),p)}function ga(c){return"}"==c?a():m(E,ga)}function ha(c,b){if(S){if(":"==c)return a(O);if("?"==b)return a(ha)}}function O(c){if("variable"==
c)return l.marked="variable-3",a(y);if("string"==c||"number"==c||"atom"==c)return a(y);if("{"==c)return a(u("}"),T(ca,"}",",;"),p);if("("==c)return a(T(W,")"),Ma)}function Ma(c){if("=>"==c)return a(O)}function ca(c,b){if("variable"==c||"keyword"==l.style)return l.marked="property",a(ca);if("?"==b)return a(ca);if(":"==c)return a(O)}function W(c){if("variable"==c)return a(W);if(":"==c)return a(O)}function y(c,b){if("<"==b)return a(u(">"),T(O,">"),p,y);if("|"==b||"."==c)return a(O);if("["==c)return a(g("]"),
y)}function L(){return m(b,ha,d,Na)}function b(c,d){if("modifier"==c)return a(b);if("variable"==c)return G(d),a();if("spread"==c)return a(b);if("["==c)return ba(b,"]");if("{"==c)return ba(r,"}")}function r(c,n){if("variable"==c&&!l.stream.match(/^\s*:/,!1))return G(n),a(d);"variable"==c&&(l.marked="property");return"spread"==c?a(b):"}"==c?m():a(g(":"),b,d)}function d(c,b){if("="==b)return a(k)}function Na(c){if(","==c)return a(L)}function sa(c,b){if("keyword b"==c&&"else"==b)return a(u("form","else"),
E,p)}function Ba(c){if("("==c)return a(u(")"),Oa,g(")"),p)}function Oa(c){return"var"==c?a(L,g(";"),ia):";"==c?a(ia):"variable"==c?a(Pa):m(w,g(";"),ia)}function Pa(c,b){return"in"==b||"of"==b?(l.marked="keyword",a(w)):a(K,ia)}function ia(c,b){return";"==c?a(ua):"in"==b||"of"==b?(l.marked="keyword",a(w)):m(w,g(";"),ua)}function ua(b){")"!=b&&a(w)}function Q(b,d){if("*"==d)return l.marked="keyword",a(Q);if("variable"==b)return G(d),a(Q);if("("==b)return a(J,u(")"),T(la,")"),p,ha,E,x)}function la(c){return"spread"==
c?a(la):m(b,ha,d)}function Ga(b,a){return"variable"==b?ta(b,a):na(b,a)}function ta(b,d){if("variable"==b)return G(d),a(na)}function na(b,d){if("extends"==d||"implements"==d||S&&","==b)return a(S?O:w,na);if("{"==b)return a(u("}"),X,p)}function X(b,d){if("variable"==b||"keyword"==l.style){if(("async"==d||"static"==d||"get"==d||"set"==d||S&&("public"==d||"private"==d||"protected"==d||"readonly"==d||"abstract"==d))&&l.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return l.marked="keyword",a(X);l.marked="property";
return a(S?oa:Q,X)}if("["==b)return a(w,g("]"),S?oa:Q,X);if("*"==d)return l.marked="keyword",a(X);if(";"==b)return a(X);if("}"==b)return a()}function oa(b,e){return"?"==e?a(oa):":"==b?a(O,d):m(Q)}function Da(b,d){return"*"==d?(l.marked="keyword",a(pa,g(";"))):"default"==d?(l.marked="keyword",a(w,g(";"))):"{"==b?a(T(va,"}"),pa,g(";")):m(E)}function va(b,d){if("as"==d)return l.marked="keyword",a(g("variable"));if("variable"==b)return m(k,va)}function Ea(b){return"string"==b?a():m(ja,wa,pa)}function ja(b,
d){if("{"==b)return ba(ja,"}");"variable"==b&&G(d);"*"==d&&(l.marked="keyword");return a(Qa)}function wa(b){if(","==b)return a(ja,wa)}function Qa(b,d){if("as"==d)return l.marked="keyword",a(ja)}function pa(b,d){if("from"==d)return l.marked="keyword",a(w)}function Ha(b){return"]"==b?a():m(T(k,"]"))}var Y=I.indentUnit,xa=v.statementIndent,fa=v.jsonld,Z=v.json||fa,S=v.typescript,ka=v.wordCharacters||/[\w$\xa1-\uffff]/,ra=function(){function b(b){return{type:b,style:"keyword"}}var a=b("keyword a"),d=
b("keyword b"),e=b("keyword c"),r=b("operator"),f={type:"atom",style:"atom"},a={"if":b("if"),"while":a,"with":a,"else":d,"do":d,"try":d,"finally":d,"return":e,"break":e,"continue":e,"new":b("new"),"delete":e,"throw":e,"debugger":e,"var":b("var"),"const":b("var"),let:b("var"),"function":b("function"),"catch":b("catch"),"for":b("for"),"switch":b("switch"),"case":b("case"),"default":b("default"),"in":r,"typeof":r,"instanceof":r,"true":f,"false":f,"null":f,undefined:f,NaN:f,Infinity:f,"this":b("this"),
"class":b("class"),"super":b("atom"),yield:e,"export":b("export"),"import":b("import"),"extends":e,await:e,async:b("async")};if(S){var d={type:"variable",style:"variable-3"},e={"interface":b("class"),"implements":e,namespace:e,module:b("module"),"enum":b("module"),type:b("type"),"public":b("modifier"),"private":b("modifier"),"protected":b("modifier"),"abstract":b("modifier"),as:r,string:d,number:d,"boolean":d,any:d},k;for(k in e)a[k]=e[k]}return a}(),ea=/[+\-*&%=<>!?|~^]/,za=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,
aa,da,Fa={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},l={state:null,column:null,marked:null,cc:null},Aa={name:"this",next:{name:"arguments"}};p.lex=!0;return{startState:function(b){b={tokenize:F,lastType:"sof",cc:[],lexical:new z((b||0)-Y,0,"block",!1),localVars:v.localVars,context:v.localVars&&{vars:v.localVars},indented:b||0};v.globalVars&&"object"==typeof v.globalVars&&(b.globalVars=v.globalVars);return b},token:function(b,a){b.sol()&&(a.lexical.hasOwnProperty("align")||
(a.lexical.align=!1),a.indented=b.indentation(),M(b,a));if(a.tokenize!=N&&b.eatSpace())return null;var d=a.tokenize(b,a);if("comment"==aa)return d;a.lastType="operator"!=aa||"++"!=da&&"--"!=da?aa:"incdec";a:{var c=aa,e=da,r=a.cc;l.state=a;l.stream=b;l.marked=null;l.cc=r;l.style=d;a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);for(;;)if((r.length?r.pop():Z?w:E)(c,e)){for(;r.length&&r[r.length-1].lex;)r.pop()();if(l.marked){d=l.marked;break a}if(c="variable"==c)b:{for(c=a.localVars;c;c=c.next)if(c.name==
e){c=!0;break b}for(r=a.context;r;r=r.prev)for(c=r.vars;c;c=c.next)if(c.name==e){c=!0;break b}c=void 0}if(c){d="variable-2";break a}break a}}return d},indent:function(b,a){if(b.tokenize==N)return h.Pass;if(b.tokenize!=F)return 0;var d=a&&a.charAt(0),c=b.lexical,e;if(!/^\s*else\b/.test(a))for(var r=b.cc.length-1;0<=r;--r){var f=b.cc[r];if(f==p)c=c.prev;else if(f!=sa)break}for(;!("stat"!=c.type&&"form"!=c.type||"}"!=d&&(!(e=b.cc[b.cc.length-1])||e!=K&&e!=D||/^[,\.=+\-*:?[\(]/.test(a)));)c=c.prev;xa&&
")"==c.type&&"stat"==c.prev.type&&(c=c.prev);e=c.type;r=d==e;return"vardef"==e?c.indented+("operator"==b.lastType||","==b.lastType?c.info+1:0):"form"==e&&"{"==d?c.indented:"form"==e?c.indented+Y:"stat"==e?(d=c.indented,c="operator"==b.lastType||","==b.lastType||ea.test(a.charAt(0))||/[,.]/.test(a.charAt(0)),d+(c?xa||Y:0)):"switch"!=c.info||r||0==v.doubleIndentSwitch?c.align?c.column+(r?0:1):c.indented+(r?0:Y):c.indented+(/^(?:case|default)\b/.test(a)?Y:2*Y)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,
blockCommentStart:Z?null:"/*",blockCommentEnd:Z?null:"*/",lineComment:Z?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Z?"json":"javascript",jsonldMode:fa,jsonMode:Z,expressionAllowed:A,skipExpression:function(b){var a=b.cc[b.cc.length-1];a!=w&&a!=k||b.cc.pop()}}});h.registerHelper("wordChars","javascript",/[\w$]/);h.defineMIME("text/javascript","javascript");h.defineMIME("text/ecmascript","javascript");h.defineMIME("application/javascript","javascript");h.defineMIME("application/x-javascript",
"javascript");h.defineMIME("application/ecmascript","javascript");h.defineMIME("application/json",{name:"javascript",json:!0});h.defineMIME("application/x-json",{name:"javascript",json:!0});h.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});h.defineMIME("text/typescript",{name:"javascript",typescript:!0});h.defineMIME("application/typescript",{name:"javascript",typescript:!0})});
(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function A(a){for(var k={},h=0;h<a.length;++h)k[a[h].toLowerCase()]=!0;return k}function I(a,h){for(var k=!1,g;null!=(g=a.next());){if(k&&"/"==g){h.tokenize=null;break}k="*"==g}return["comment","comment"]}h.defineMode("css",function(a,g){function k(b,a){W=a;return b}function m(b,a){var d=b.next();if(C[d]){var e=
C[d](b,a);if(!1!==e)return e}if("@"==d)return b.eatWhile(/[\w\\\-]/),k("def",b.current());if("="==d||("~"==d||"|"==d)&&b.eat("="))return k(null,"compare");if('"'==d||"'"==d)return a.tokenize=p(d),a.tokenize(b,a);if("#"==d)return b.eatWhile(/[\w\\\-]/),k("atom","hash");if("!"==d)return b.match(/^\s*\w*/),k("keyword","important");if(/\d/.test(d)||"."==d&&b.eat(/\d/))return b.eatWhile(/[\w.%]/),k("number","unit");if("-"===d){if(/[\d.]/.test(b.peek()))return b.eatWhile(/[\w.%]/),k("number","unit");if(b.match(/^-[\w\\\-]+/))return b.eatWhile(/[\w\\\-]/),
b.match(/^\s*:/,!1)?k("variable-2","variable-definition"):k("variable-2","variable");if(b.match(/^\w+-/))return k("meta","meta")}else return/[,+>*\/]/.test(d)?k(null,"select-op"):"."==d&&b.match(/^-?[_a-z][_a-z0-9-]*/i)?k("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(d)?k(null,d):"u"==d&&b.match(/rl(-prefix)?\(/)||"d"==d&&b.match("omain(")||"r"==d&&b.match("egexp(")?(b.backUp(1),a.tokenize=J,k("property","word")):/[\w\\\-]/.test(d)?(b.eatWhile(/[\w\\\-]/),k("property","word")):k(null,null)}function p(b){return function(a,
d){for(var e=!1,r;null!=(r=a.next());){if(r==b&&!e){")"==b&&a.backUp(1);break}e=!e&&"\\"==r}if(r==b||!e&&")"!=b)d.tokenize=null;return k("string","string")}}function J(b,a){b.next();b.match(/\s*[\"\')]/,!1)?a.tokenize=null:a.tokenize=p(")");return k(null,"(")}function x(b,a,d){this.type=b;this.indent=a;this.prev=d}function e(b,a,d,e){b.context=new x(d,a.indentation()+(!1===e?0:t),b.context);return d}function f(b){b.context.prev&&(b.context=b.context.prev);return b.context.type}function q(b,a,d,e){for(e=
e||1;0<e;e--)d.context=d.context.prev;return L[d.context.type](b,a,d)}function u(b){b=b.current().toLowerCase();y=I.hasOwnProperty(b)?"atom":A.hasOwnProperty(b)?"keyword":"variable"}var w=g.inline;g.propertyKeywords||(g=h.resolveMode("text/css"));var t=a.indentUnit,C=g.tokenHooks,v=g.documentTypes||{},P=g.mediaTypes||{},M=g.mediaFeatures||{},N=g.mediaValueKeywords||{},z=g.propertyKeywords||{},E=g.nonStandardPropertyKeywords||{},F=g.fontProperties||{},G=g.counterDescriptors||{},A=g.colorKeywords||
{},I=g.valueKeywords||{},B=g.allowNested,ca=!0===g.supportsAtComponent,W,y,L={top:function(b,a,d){if("{"==b)return e(d,a,"block");if("}"==b&&d.context.prev)return f(d);if(ca&&/@component/.test(b))return e(d,a,"atComponentBlock");if(/^@(-moz-)?document$/.test(b))return e(d,a,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(b))return e(d,a,"atBlock");if(/^@(font-face|counter-style)/.test(b))return d.stateArg=b,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(b))return"keyframes";
if(b&&"@"==b.charAt(0))return e(d,a,"at");if("hash"==b)y="builtin";else if("word"==b)y="tag";else{if("variable-definition"==b)return"maybeprop";if("interpolation"==b)return e(d,a,"interpolation");if(":"==b)return"pseudo";if(B&&"("==b)return e(d,a,"parens")}return d.context.type},block:function(b,a,d){if("word"==b){b=a.current().toLowerCase();if(z.hasOwnProperty(b))return y="property","maybeprop";if(E.hasOwnProperty(b))return y="string-2","maybeprop";if(B)return y=a.match(/^\s*:(?:\s|$)/,!1)?"property":
"tag","block";y+=" error";return"maybeprop"}if("meta"==b)return"block";if(B||"hash"!=b&&"qualifier"!=b)return L.top(b,a,d);y="error";return"block"},maybeprop:function(b,a,d){return":"==b?e(d,a,"prop"):L[d.context.type](b,a,d)},prop:function(b,a,d){if(";"==b)return f(d);if("{"==b&&B)return e(d,a,"propBlock");if("}"==b||"{"==b)return q(b,a,d);if("("==b)return e(d,a,"parens");if("hash"==b&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(a.current()))y+=" error";else if("word"==b)u(a);else if("interpolation"==
b)return e(d,a,"interpolation");return"prop"},propBlock:function(b,a,d){return"}"==b?f(d):"word"==b?(y="property","maybeprop"):d.context.type},parens:function(b,a,d){if("{"==b||"}"==b)return q(b,a,d);if(")"==b)return f(d);if("("==b)return e(d,a,"parens");if("interpolation"==b)return e(d,a,"interpolation");"word"==b&&u(a);return"parens"},pseudo:function(b,a,d){return"meta"==b?"pseudo":"word"==b?(y="variable-3",d.context.type):L[d.context.type](b,a,d)},documentTypes:function(b,a,d){return"word"==b&&
v.hasOwnProperty(a.current())?(y="tag",d.context.type):L.atBlock(b,a,d)},atBlock:function(b,a,d){if("("==b)return e(d,a,"atBlock_parens");if("}"==b||";"==b)return q(b,a,d);if("{"==b)return f(d)&&e(d,a,B?"block":"top");if("interpolation"==b)return e(d,a,"interpolation");"word"==b&&(b=a.current().toLowerCase(),y="only"==b||"not"==b||"and"==b||"or"==b?"keyword":P.hasOwnProperty(b)?"attribute":M.hasOwnProperty(b)?"property":N.hasOwnProperty(b)?"keyword":z.hasOwnProperty(b)?"property":E.hasOwnProperty(b)?
"string-2":I.hasOwnProperty(b)?"atom":A.hasOwnProperty(b)?"keyword":"error");return d.context.type},atComponentBlock:function(b,a,d){if("}"==b)return q(b,a,d);if("{"==b)return f(d)&&e(d,a,B?"block":"top",!1);"word"==b&&(y="error");return d.context.type},atBlock_parens:function(b,a,d){return")"==b?f(d):"{"==b||"}"==b?q(b,a,d,2):L.atBlock(b,a,d)},restricted_atBlock_before:function(b,a,d){return"{"==b?e(d,a,"restricted_atBlock"):"word"==b&&"@counter-style"==d.stateArg?(y="variable","restricted_atBlock_before"):
L[d.context.type](b,a,d)},restricted_atBlock:function(b,a,d){return"}"==b?(d.stateArg=null,f(d)):"word"==b?(y="@font-face"==d.stateArg&&!F.hasOwnProperty(a.current().toLowerCase())||"@counter-style"==d.stateArg&&!G.hasOwnProperty(a.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(b,a,d){return"word"==b?(y="variable","keyframes"):"{"==b?e(d,a,"top"):L[d.context.type](b,a,d)},at:function(b,a,d){if(";"==b)return f(d);if("{"==b||"}"==b)return q(b,a,d);
"word"==b?y="tag":"hash"==b&&(y="builtin");return"at"},interpolation:function(b,a,d){if("}"==b)return f(d);if("{"==b||";"==b)return q(b,a,d);"word"==b?y="variable":"variable"!=b&&"("!=b&&")"!=b&&(y="error");return"interpolation"}};return{startState:function(a){return{tokenize:null,state:w?"block":"top",stateArg:null,context:new x(w?"block":"top",a||0,null)}},token:function(a,e){if(!e.tokenize&&a.eatSpace())return null;var b=(e.tokenize||m)(a,e);b&&"object"==typeof b&&(W=b[1],b=b[0]);y=b;e.state=L[e.state](W,
a,e);return y},indent:function(a,e){var b=a.context,f=e&&e.charAt(0),k=b.indent;"prop"!=b.type||"}"!=f&&")"!=f||(b=b.prev);if(b.prev)if("}"==f&&("block"==b.type||"top"==b.type||"interpolation"==b.type||"restricted_atBlock"==b.type))b=b.prev,k=b.indent;else if(")"==f&&("parens"==b.type||"atBlock_parens"==b.type)||"{"==f&&("at"==b.type||"atBlock"==b.type))k=Math.max(0,b.indent-t);return k},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:g.lineComment,fold:"brace"}});var v=
["domain","regexp","url","url-prefix"],t=A(v),F="all aural braille handheld print projection screen tty tv embossed".split(" "),B=A(F),N="width min-width max-width height min-height max-height device-width min-device-width max-device-width device-height min-device-height max-device-height aspect-ratio min-aspect-ratio max-aspect-ratio device-aspect-ratio min-device-aspect-ratio max-device-aspect-ratio color min-color max-color color-index min-color-index max-color-index monochrome min-monochrome max-monochrome resolution min-resolution max-resolution scan grid orientation device-pixel-ratio min-device-pixel-ratio max-device-pixel-ratio pointer any-pointer hover any-hover".split(" "),
C=A(N),M="landscape portrait none coarse fine on-demand hover interlace progressive".split(" "),z=A(M),m="align-content align-items align-self alignment-adjust alignment-baseline anchor-point animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function appearance azimuth backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip color color-profile column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset crop cue cue-after cue-before cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit fit-position flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float float-offset flow-from flow-into font font-feature-settings font-family font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-rows grid-column grid-column-end grid-column-gap grid-column-start grid-gap grid-row grid-row-end grid-row-gap grid-row-start grid-template grid-template-areas grid-template-columns grid-template-rows hanging-punctuation height hyphens icon image-orientation image-rendering image-resolution inline-box-align justify-content left letter-spacing line-break line-height line-stacking line-stacking-ruby line-stacking-shift line-stacking-strategy list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up object-fit object-position opacity order orphans outline outline-color outline-offset outline-style outline-width overflow overflow-style overflow-wrap overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside page-policy pause pause-after pause-before perspective perspective-origin pitch pitch-range play-during position presentation-level punctuation-trim quotes region-break-after region-break-before region-break-inside region-fragment rendering-intent resize rest rest-after rest-before richness right rotation rotation-point ruby-align ruby-overhang ruby-position ruby-span shape-image-threshold shape-inside shape-margin shape-outside size speak speak-as speak-header speak-numeral speak-punctuation speech-rate stress string-set tab-size table-layout target target-name target-new target-position text-align text-align-last text-decoration text-decoration-color text-decoration-line text-decoration-skip text-decoration-style text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-height text-indent text-justify text-outline text-overflow text-shadow text-size-adjust text-space-collapse text-transform text-underline-position text-wrap top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi user-select vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-range voice-rate voice-stress voice-volume volume white-space widows width will-change word-break word-spacing word-wrap z-index clip-path clip-rule mask enable-background filter flood-color flood-opacity lighting-color stop-color stop-opacity pointer-events color-interpolation color-interpolation-filters color-rendering fill fill-opacity fill-rule image-rendering marker marker-end marker-mid marker-start shape-rendering stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-rendering baseline-shift dominant-baseline glyph-orientation-horizontal glyph-orientation-vertical text-anchor writing-mode".split(" "),
a=A(m),G="scrollbar-arrow-color scrollbar-base-color scrollbar-dark-shadow-color scrollbar-face-color scrollbar-highlight-color scrollbar-shadow-color scrollbar-3d-light-color scrollbar-track-color shape-inside searchfield-cancel-button searchfield-decoration searchfield-results-button searchfield-results-decoration zoom".split(" "),J=A(G),x=A("font-family src unicode-range font-variant font-feature-settings font-stretch font-weight font-style".split(" ")),u=A("additive-symbols fallback negative pad prefix range speak-as suffix symbols system".split(" ")),
p="aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkturquoise darkviolet deeppink deepskyblue dimgray dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray grey green greenyellow honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightpink lightsalmon lightseagreen lightskyblue lightslategray lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen".split(" "),
g=A(p),E="above absolute activeborder additive activecaption afar after-white-space ahead alias all all-scroll alphabetic alternate always amharic amharic-abegede antialiased appworkspace arabic-indic armenian asterisks attr auto auto-flow avoid avoid-column avoid-page avoid-region background backwards baseline below bidi-override binary bengali blink block block-axis bold bolder border border-box both bottom break break-all break-word bullets button button-bevel buttonface buttonhighlight buttonshadow buttontext calc cambodian capitalize caps-lock-indicator caption captiontext caret cell center checkbox circle cjk-decimal cjk-earthly-branch cjk-heavenly-stem cjk-ideographic clear clip close-quote col-resize collapse color color-burn color-dodge column column-reverse compact condensed contain content contents content-box context-menu continuous copy counter counters cover crop cross crosshair currentcolor cursive cyclic darken dashed decimal decimal-leading-zero default default-button dense destination-atop destination-in destination-out destination-over devanagari difference disc discard disclosure-closed disclosure-open document dot-dash dot-dot-dash dotted double down e-resize ease ease-in ease-in-out ease-out element ellipse ellipsis embed end ethiopic ethiopic-abegede ethiopic-abegede-am-et ethiopic-abegede-gez ethiopic-abegede-ti-er ethiopic-abegede-ti-et ethiopic-halehame-aa-er ethiopic-halehame-aa-et ethiopic-halehame-am-et ethiopic-halehame-gez ethiopic-halehame-om-et ethiopic-halehame-sid-et ethiopic-halehame-so-et ethiopic-halehame-ti-er ethiopic-halehame-ti-et ethiopic-halehame-tig ethiopic-numeric ew-resize exclusion expanded extends extra-condensed extra-expanded fantasy fast fill fixed flat flex flex-end flex-start footnotes forwards from geometricPrecision georgian graytext grid groove gujarati gurmukhi hand hangul hangul-consonant hard-light hebrew help hidden hide higher highlight highlighttext hiragana hiragana-iroha horizontal hsl hsla hue icon ignore inactiveborder inactivecaption inactivecaptiontext infinite infobackground infotext inherit initial inline inline-axis inline-block inline-flex inline-grid inline-table inset inside intrinsic invert italic japanese-formal japanese-informal justify kannada katakana katakana-iroha keep-all khmer korean-hangul-formal korean-hanja-formal korean-hanja-informal landscape lao large larger left level lighter lighten line-through linear linear-gradient lines list-item listbox listitem local logical loud lower lower-alpha lower-armenian lower-greek lower-hexadecimal lower-latin lower-norwegian lower-roman lowercase ltr luminosity malayalam match matrix matrix3d media-controls-background media-current-time-display media-fullscreen-button media-mute-button media-play-button media-return-to-realtime-button media-rewind-button media-seek-back-button media-seek-forward-button media-slider media-sliderthumb media-time-remaining-display media-volume-slider media-volume-slider-container media-volume-sliderthumb medium menu menulist menulist-button menulist-text menulist-textfield menutext message-box middle min-intrinsic mix mongolian monospace move multiple multiply myanmar n-resize narrower ne-resize nesw-resize no-close-quote no-drop no-open-quote no-repeat none normal not-allowed nowrap ns-resize numbers numeric nw-resize nwse-resize oblique octal opacity open-quote optimizeLegibility optimizeSpeed oriya oromo outset outside outside-shape overlay overline padding padding-box painted page paused persian perspective plus-darker plus-lighter pointer polygon portrait pre pre-line pre-wrap preserve-3d progress push-button radial-gradient radio read-only read-write read-write-plaintext-only rectangle region relative repeat repeating-linear-gradient repeating-radial-gradient repeat-x repeat-y reset reverse rgb rgba ridge right rotate rotate3d rotateX rotateY rotateZ round row row-resize row-reverse rtl run-in running s-resize sans-serif saturation scale scale3d scaleX scaleY scaleZ screen scroll scrollbar scroll-position se-resize searchfield searchfield-cancel-button searchfield-decoration searchfield-results-button searchfield-results-decoration semi-condensed semi-expanded separate serif show sidama simp-chinese-formal simp-chinese-informal single skew skewX skewY skip-white-space slide slider-horizontal slider-vertical sliderthumb-horizontal sliderthumb-vertical slow small small-caps small-caption smaller soft-light solid somali source-atop source-in source-out source-over space space-around space-between spell-out square square-button start static status-bar stretch stroke sub subpixel-antialiased super sw-resize symbolic symbols table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group tamil telugu text text-bottom text-top textarea textfield thai thick thin threeddarkshadow threedface threedhighlight threedlightshadow threedshadow tibetan tigre tigrinya-er tigrinya-er-abegede tigrinya-et tigrinya-et-abegede to top trad-chinese-formal trad-chinese-informal transform translate translate3d translateX translateY translateZ transparent ultra-condensed ultra-expanded underline unset up upper-alpha upper-armenian upper-greek upper-hexadecimal upper-latin upper-norwegian upper-roman uppercase urdu url var vertical vertical-text visible visibleFill visiblePainted visibleStroke visual w-resize wait wave wider window windowframe windowtext words wrap wrap-reverse x-large x-small xor xx-large xx-small".split(" "),
w=A(E),v=v.concat(F).concat(N).concat(M).concat(m).concat(G).concat(p).concat(E);h.registerHelper("hintWords","css",v);h.defineMIME("text/css",{documentTypes:t,mediaTypes:B,mediaFeatures:C,mediaValueKeywords:z,propertyKeywords:a,nonStandardPropertyKeywords:J,fontProperties:x,counterDescriptors:u,colorKeywords:g,valueKeywords:w,tokenHooks:{"/":function(a,g){if(!a.eat("*"))return!1;g.tokenize=I;return I(a,g)}},name:"css"});h.defineMIME("text/x-scss",{mediaTypes:B,mediaFeatures:C,mediaValueKeywords:z,
propertyKeywords:a,nonStandardPropertyKeywords:J,colorKeywords:g,valueKeywords:w,fontProperties:x,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(a,g){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(g.tokenize=I,I(a,g)):["operator","operator"]},":":function(a){return a.match(/\s*\{/)?[null,"{"]:!1},$:function(a){a.match(/^[\w-]+/);return a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(a){return a.eat("{")?[null,"interpolation"]:
!1}},name:"css",helperType:"scss"});h.defineMIME("text/x-less",{mediaTypes:B,mediaFeatures:C,mediaValueKeywords:z,propertyKeywords:a,nonStandardPropertyKeywords:J,colorKeywords:g,valueKeywords:w,fontProperties:x,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(a,g){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(g.tokenize=I,I(a,g)):["operator","operator"]},"@":function(a){if(a.eat("{"))return[null,"interpolation"];if(a.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,
!1))return!1;a.eatWhile(/[\w\\\-]/);return a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"});h.defineMIME("text/x-gss",{documentTypes:t,mediaTypes:B,mediaFeatures:C,propertyKeywords:a,nonStandardPropertyKeywords:J,fontProperties:x,counterDescriptors:u,colorKeywords:g,valueKeywords:w,supportsAtComponent:!0,tokenHooks:{"/":function(a,g){if(!a.eat("*"))return!1;g.tokenize=I;return I(a,g)}},name:"css",
helperType:"gss"})});
(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],h):h(CodeMirror)})(function(h){function A(h){var t=B[h];return t?t:B[h]=new RegExp("\\s+"+h+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function I(h,t){var v=h.match(A(t));return v?/^\s*(.*?)\s*$/.exec(v[2])[1]:""}
function v(h,t){for(var v in h)for(var z=t[v]||(t[v]=[]),m=h[v],a=m.length-1;0<=a;a--)z.unshift(m[a])}function t(h,t){for(var v=0;v<h.length;v++){var z=h[v];if(!z[0]||z[1].test(I(t,z[0])))return z[2]}}var F={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],
[null,null,"css"]]},B={};h.defineMode("htmlmixed",function(A,C){function B(a,x){var u=z.token(a,x.htmlState),p=/\btag\b/.test(u),g;if(p&&!/[<>\s\/]/.test(a.current())&&(g=x.htmlState.tagName&&x.htmlState.tagName.toLowerCase())&&m.hasOwnProperty(g))x.inTag=g+" ";else if(x.inTag&&p&&/>$/.test(a.current())){p=/^([\S]+) (.*)/.exec(x.inTag);x.inTag=null;g=">"==a.current()&&t(m[p[1]],p[2]);g=h.getMode(A,g);var v=new RegExp("^</s*"+p[1]+"s*>","i"),w=new RegExp("</s*"+p[1]+"s*>","i");x.token=function(a,g){if(a.match(v,
!1))return g.token=B,g.localState=g.localMode=null;var h=g.localMode.token(a,g.localState),k=a.current(),m=k.search(w);-1<m?a.backUp(k.length-m):k.match(/<\/?$/)&&(a.backUp(k.length),a.match(w,!1)||a.match(k));return h};x.localMode=g;x.localState=h.startState(g,z.indent(x.htmlState,""))}else x.inTag&&(x.inTag+=a.current(),a.eol()&&(x.inTag+=" "));return u}var z=h.getMode(A,{name:"xml",htmlMode:!0,multilineTagIndentFactor:C.multilineTagIndentFactor,multilineTagIndentPastTag:C.multilineTagIndentPastTag}),
m={},a=C&&C.tags,G=C&&C.scriptTypes;v(F,m);a&&v(a,m);if(G)for(a=G.length-1;0<=a;a--)m.script.unshift(["type",G[a].matches,G[a].mode]);return{startState:function(){var a=h.startState(z);return{token:B,inTag:null,localMode:null,localState:null,htmlState:a}},copyState:function(a){var m;a.localState&&(m=h.copyState(a.localMode,a.localState));return{token:a.token,inTag:a.inTag,localMode:a.localMode,localState:m,htmlState:h.copyState(z,a.htmlState)}},token:function(a,h){return h.token(a,h)},indent:function(a,
m){return!a.localMode||/^\s*<\//.test(m)?z.indent(a.htmlState,m):a.localMode.indent?a.localMode.indent(a.localState,m):h.Pass},innerMode:function(a){return{state:a.localState||a.htmlState,mode:a.localMode||z}}}},"xml","javascript","css");h.defineMIME("text/html","htmlmixed")});

(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){function q(a,h,c){a=a.getWrapperElement().appendChild(document.createElement("div"));a.className=c?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top";"string"==typeof h?a.innerHTML=h:a.appendChild(h);return a}function r(a,h){a.state.currentNotificationClose&&a.state.currentNotificationClose();
a.state.currentNotificationClose=h}a.defineExtension("openDialog",function(k,h,c){function f(a){if("string"==typeof a)e.value=a;else if(!n&&(n=!0,d.parentNode.removeChild(d),l.focus(),c.onClose))c.onClose(d)}c||(c={});r(this,null);var d=q(this,k,c.bottom),n=!1,l=this,e=d.getElementsByTagName("input")[0];if(e){e.focus();c.value&&(e.value=c.value,!1!==c.selectValueOnOpen&&e.select());if(c.onInput)a.on(e,"input",function(a){c.onInput(a,e.value,f)});if(c.onKeyUp)a.on(e,"keyup",function(a){c.onKeyUp(a,
e.value,f)});a.on(e,"keydown",function(d){if(!(c&&c.onKeyDown&&c.onKeyDown(d,e.value,f))){if(27==d.keyCode||!1!==c.closeOnEnter&&13==d.keyCode)e.blur(),a.e_stop(d),f();13==d.keyCode&&h(e.value,d)}});if(!1!==c.closeOnBlur)a.on(e,"blur",f)}else if(k=d.getElementsByTagName("button")[0]){a.on(k,"click",function(){f();l.focus()});if(!1!==c.closeOnBlur)a.on(k,"blur",f);k.focus()}return f});a.defineExtension("openConfirm",function(k,h,c){function f(){n||(n=!0,d.parentNode.removeChild(d),l.focus())}r(this,
null);var d=q(this,k,c&&c.bottom);k=d.getElementsByTagName("button");var n=!1,l=this,e=1;k[0].focus();for(c=0;c<k.length;++c){var m=k[c];(function(c){a.on(m,"click",function(h){a.e_preventDefault(h);f();c&&c(l)})})(h[c]);a.on(m,"blur",function(){--e;setTimeout(function(){0>=e&&f()},200)});a.on(m,"focus",function(){++e})}});a.defineExtension("openNotification",function(k,h){function c(){d||(d=!0,clearTimeout(n),f.parentNode.removeChild(f))}r(this,c);var f=q(this,k,h&&h.bottom),d=!1,n,l=h&&"undefined"!==
typeof h.duration?h.duration:5E3;a.on(f,"click",function(h){a.e_preventDefault(h);c()});l&&(n=setTimeout(c,l));return c})});
(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){function q(a,c,f,d){this.atOccurrence=!1;this.doc=a;null==d&&"string"==typeof c&&(d=!1);f=f?a.clipPos(f):k(0,0);this.pos={from:f,to:f};if("string"!=typeof c)c.global||(c=new RegExp(c.source,c.ignoreCase?"ig":"g")),this.matches=function(f,d){if(f){c.lastIndex=0;for(var h=a.getLine(d.line).slice(0,d.ch),
e=0,g,b;;){c.lastIndex=e;e=c.exec(h);if(!e)break;g=e;b=g.index;e=g.index+(g[0].length||1);if(e==h.length)break}(e=g&&g[0].length||0)||(0==b&&0==h.length?g=void 0:b!=a.getLine(d.line).length&&e++)}else c.lastIndex=d.ch,h=a.getLine(d.line),e=(g=c.exec(h))&&g[0].length||0,b=g&&g.index,b+e==h.length||e||(e=1);if(g&&e)return{from:k(d.line,b),to:k(d.line,b+e),match:g}};else{var h=c;d&&(c=c.toLowerCase());var l=d?function(a){return a.toLowerCase()}:function(a){return a},e=c.split("\n");if(1==e.length)this.matches=
c.length?function(d,e){if(d){var f=a.getLine(e.line).slice(0,e.ch),m=l(f),g=m.lastIndexOf(c);if(-1<g)return g=r(f,m,g),{from:k(e.line,g),to:k(e.line,g+h.length)}}else if(f=a.getLine(e.line).slice(e.ch),m=l(f),g=m.indexOf(c),-1<g)return g=r(f,m,g)+e.ch,{from:k(e.line,g),to:k(e.line,g+h.length)}}:function(){};else{var m=h.split("\n");this.matches=function(c,d){var f=e.length-1;if(c){if(!(d.line-(e.length-1)<a.firstLine()||l(a.getLine(d.line).slice(0,m[f].length))!=e[e.length-1])){for(var h=k(d.line,
m[f].length),g=d.line-1,b=f-1;1<=b;--b,--g)if(e[b]!=l(a.getLine(g)))return;var b=a.getLine(g),p=b.length-m[0].length;return l(b.slice(p))!=e[0]?void 0:{from:k(g,p),to:h}}}else if(!(d.line+(e.length-1)>a.lastLine())&&(b=a.getLine(d.line),p=b.length-m[0].length,l(b.slice(p))==e[0])){h=k(d.line,p);g=d.line+1;for(b=1;b<f;++b,++g)if(e[b]!=l(a.getLine(g)))return;return l(a.getLine(g).slice(0,m[f].length))!=e[f]?void 0:{from:h,to:k(g,m[f].length)}}}}}}function r(a,c,f){if(a.length==c.length)return f;for(c=
Math.min(f,a.length);;){var d=a.slice(0,c).toLowerCase().length;if(d<f)++c;else if(d>f)--c;else return c}}var k=a.Pos;q.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function c(a){a=k(a,0);f.pos={from:a,to:a};return f.atOccurrence=!1}for(var f=this,d=this.doc.clipPos(a?this.pos.from:this.pos.to);;){if(this.pos=this.matches(a,d))return this.atOccurrence=!0,this.pos.match||!0;if(a){if(!d.line)return c(0);d=k(d.line-1,this.doc.getLine(d.line-
1).length)}else{var h=this.doc.lineCount();if(d.line==h-1)return c(h);d=k(d.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(h,c){if(this.atOccurrence){var f=a.splitLines(h);this.doc.replaceRange(f,this.pos.from,this.pos.to,c);this.pos.to=k(this.pos.from.line+f.length-1,f[f.length-1].length+(1==f.length?this.pos.from.ch:0))}}};a.defineExtension("getSearchCursor",function(a,c,f){return new q(this.doc,a,c,
f)});a.defineDocExtension("getSearchCursor",function(a,c,f){return new q(this,a,c,f)});a.defineExtension("selectMatches",function(h,c){for(var f=[],d=this.getSearchCursor(h,this.getCursor("from"),c);d.findNext()&&!(0<a.cmpPos(d.to(),this.getCursor("to")));)f.push({anchor:d.from(),head:d.to()});f.length&&this.setSelections(f,0)})});
(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],a):a(CodeMirror)})(function(a){function q(b,a){"string"==typeof b?b=new RegExp(b.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),a?"gi":"g"):b.global||(b=new RegExp(b.source,b.ignoreCase?"gi":"g"));return{token:function(a){b.lastIndex=a.pos;
var c=b.exec(a.string);if(c&&c.index==a.pos)return a.pos+=c[0].length||1,"searching";c?a.pos=c.index:a.skipToEnd()}}}function r(){this.overlay=this.posFrom=this.posTo=this.lastQuery=this.query=null}function k(b){return b.state.search||(b.state.search=new r)}function h(b){return"string"==typeof b&&b==b.toLowerCase()}function c(b,a,c){return b.getSearchCursor(a,c,h(a))}function f(b,a,c,d,f){b.openDialog(a,d,{value:c,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){u(b)},onKeyDown:f})}function d(b,
a,c,d,f){b.openDialog?b.openDialog(a,f,{value:d,selectValueOnOpen:!0}):f(prompt(c,d))}function n(b,a,c,d){if(b.openConfirm)b.openConfirm(a,d);else if(confirm(c))d[0]()}function l(b){return b.replace(/\\(.)/g,function(b,a){return"n"==a?"\n":"r"==a?"\r":a})}function e(b){var a=b.match(/^\/(.*)\/([a-z]*)$/);if(a)try{b=new RegExp(a[1],-1==a[2].indexOf("i")?"":"i")}catch(y){}else b=l(b);if("string"==typeof b?""==b:b.test(""))b=/x^/;return b}function m(b,a,c){a.queryText=c;a.query=e(c);b.removeOverlay(a.overlay,
h(a.query));a.overlay=q(a.query,h(a.query));b.addOverlay(a.overlay);b.showMatchesOnScrollbar&&(a.annotate&&(a.annotate.clear(),a.annotate=null),a.annotate=b.showMatchesOnScrollbar(a.query,h(a.query)))}function t(b,c,e,h){var g=k(b);if(g.query)return v(b,c);var p=b.getSelection()||g.lastQuery;if(e&&b.openDialog){var l=null,x=function(c,d){a.e_stop(d);c&&(c!=g.queryText&&(m(b,g,c),g.posFrom=g.posTo=b.getCursor()),l&&(l.style.opacity=1),v(b,d.shiftKey,function(a,c){var d;3>c.line&&document.querySelector&&
(d=b.display.wrapper.querySelector(".CodeMirror-dialog"))&&d.getBoundingClientRect().bottom-4>b.cursorCoords(c,"window").top&&((l=d).style.opacity=.4)}))};f(b,'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',p,x,function(c,d){var f=a.keyName(c),e=a.keyMap[b.getOption("keyMap")][f];e||(e=b.getOption("extraKeys")[f]);if("findNext"==e||"findPrev"==e||"findPersistentNext"==
e||"findPersistentPrev"==e)a.e_stop(c),m(b,k(b),d),b.execCommand(e);else if("find"==e||"findPersistent"==e)a.e_stop(c),x(d,c)});h&&p&&(m(b,g,p),v(b,c))}else d(b,'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',"Search for:",p,function(a){a&&!g.query&&b.operation(function(){m(b,g,a);g.posFrom=g.posTo=b.getCursor();v(b,c)})})}function v(b,d,e){b.operation(function(){var f=
k(b),g=c(b,f.query,d?f.posFrom:f.posTo);if(!g.find(d)&&(g=c(b,f.query,d?a.Pos(b.lastLine()):a.Pos(b.firstLine(),0)),!g.find(d)))return;b.setSelection(g.from(),g.to());b.scrollIntoView({from:g.from(),to:g.to()},20);f.posFrom=g.from();f.posTo=g.to();e&&e(g.from(),g.to())})}function u(a){a.operation(function(){var b=k(a);if(b.lastQuery=b.query)b.query=b.queryText=null,a.removeOverlay(b.overlay),b.annotate&&(b.annotate.clear(),b.annotate=null)})}function w(a,d,f){a.operation(function(){for(var b=c(a,
d);b.findNext();)if("string"!=typeof d){var e=a.getRange(b.from(),b.to()).match(d);b.replace(f.replace(/\$(\d)/g,function(a,b){return e[b]}))}else b.replace(f)})}function g(a,f){if(!a.getOption("readOnly")){var b=a.getSelection()||k(a).lastQuery,g=f?"Replace all:":"Replace:";d(a,g+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',g,b,function(b){b&&(b=e(b),d(a,'With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',
"Replace with:","",function(d){d=l(d);if(f)w(a,b,d);else{u(a);var e=c(a,b,a.getCursor("from")),g=function(){var f=e.from(),k;if(!(k=e.findNext())&&(e=c(a,b),!(k=e.findNext())||f&&e.from().line==f.line&&e.from().ch==f.ch))return;a.setSelection(e.from(),e.to());a.scrollIntoView({from:e.from(),to:e.to()});n(a,"Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>","Replace?",[function(){h(k)},g,function(){w(a,b,d)}])},h=function(a){e.replace("string"==typeof b?
d:d.replace(/\$(\d)/g,function(b,c){return a[c]}));g()};g()}}))})}}a.commands.find=function(a){u(a);t(a)};a.commands.findPersistent=function(a){u(a);t(a,!1,!0)};a.commands.findPersistentNext=function(a){t(a,!1,!0,!0)};a.commands.findPersistentPrev=function(a){t(a,!0,!0,!0)};a.commands.findNext=t;a.commands.findPrev=function(a){t(a,!0)};a.commands.clearSearch=u;a.commands.replace=g;a.commands.replaceAll=function(a){g(a,!0)}});