Welcome to mirror list, hosted at ThFree Co, Russian Federation.

codemirror.min.js « codemirror « assets « web - github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3581ef2b4c8a42d8d7f77f14ab0e2c6853a9b0f7 (plain)
1
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).CodeMirror=t()}(this,function(){"use strict";var e,t,r,n,i,o,l,s,a,u,c=navigator.userAgent,f=navigator.platform,h=/gecko\/\d/i.test(c),d=/MSIE \d/.test(c),p=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(c),g=/Edge\/(\d+)/.exec(c),v=d||p||g,m=v&&(d?document.documentMode||6:+(g||p)[1]),$=!g&&/WebKit\//.test(c),y=$&&/Qt\/\d+\.\d+/.test(c),_=!g&&/Chrome\/(\d+)/.exec(c),b=_&&+_[1],x=/Opera\//.test(c),w=/Apple Computer/.test(navigator.vendor),C=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(c),S=/PhantomJS/.test(c),L=w&&(/Mobile\/\w+/.test(c)||navigator.maxTouchPoints>2),k=/Android/.test(c),T=L||k||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(c),N=L||/Mac/.test(f),O=/\bCrOS\b/.test(c),M=/win/i.test(f),A=x&&c.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(x=!1,$=!0);var D=N&&(y||x&&(null==A||A<12.11)),W=h||v&&m>=9;function H(e){return RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var F=function(e,t){var r=e.className,n=H(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function P(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function E(e,t){return P(e).appendChild(t)}function z(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function R(e,t,r,n){var i=z(e,t,r,n);return i.setAttribute("role","presentation"),i}function I(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function B(e){var t;try{t=e.activeElement}catch(r){t=e.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function G(e,t){var r=e.className;H(t).test(r)||(e.className+=(r?" ":"")+t)}function U(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!H(r[n]).test(t)&&(t+=" "+r[n]);return t}i=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var V=function(e){e.select()};function K(e){return e.display.wrapper.ownerDocument}function X(e){return K(e).defaultView}function j(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Y(e,t,r){for(var n in t||(t={}),e)e.hasOwnProperty(n)&&(!1!==r||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function q(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,l=i||0;;){var s=e.indexOf("	",o);if(s<0||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}}L?V=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:v&&(V=function(e){try{e.select()}catch(t){}});var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};function Q(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return -1}Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var J={toString:function(){return"CodeMirror.Pass"}},ee={scroll:!1},et={origin:"*mouse"},er={origin:"+move"};function en(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("	",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}var ei=[""];function eo(e){for(;ei.length<=e;)ei.push(el(ei)+" ");return ei[e]}function el(e){return e[e.length-1]}function es(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function ea(){}function eu(e,t){var r;return Object.create?r=Object.create(e):(ea.prototype=e,r=new ea),t&&Y(t,r),r}var ec=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ef(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ec.test(e))}function eh(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ef(e))||t.test(e):ef(e)}function ed(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ep=/[\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]/;function eg(e){return e.charCodeAt(0)>=768&&ep.test(e)}function ev(e,t,r){for(;(r<0?t>0:t<e.length)&&eg(e.charAt(t));)t+=r;return t}function em(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}var e$=null;function ey(e,t,r){var n;e$=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:e$=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:e$=i)}return null!=n?n:e$}var e_=function(){function e(e){if(e<=247)return"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(e);if(1424<=e&&e<=1524)return"R";if(1536<=e&&e<=1785)return"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(e-1536);if(1774<=e&&e<=2220)return"r";if(8192<=e&&e<=8203)return"w";else if(8204==e)return"b";else return"L"}var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,n=/[LRr]/,i=/[Lb1n]/,o=/[1n]/;function l(e,t,r){this.level=e,this.from=t,this.to=r}return function(s,a){var u="ltr"==a?"L":"R";if(0==s.length||"ltr"==a&&!t.test(s))return!1;for(var c=s.length,f=[],h=0;h<c;++h)f.push(e(s.charCodeAt(h)));for(var d=0,p=u;d<c;++d){var g=f[d];"m"==g?f[d]=p:p=g}for(var v=0,m=u;v<c;++v){var $=f[v];"1"==$&&"r"==m?f[v]="n":n.test($)&&(m=$,"r"==$&&(f[v]="R"))}for(var y=1,_=f[0];y<c-1;++y){var b=f[y];"+"==b&&"1"==_&&"1"==f[y+1]?f[y]="1":","==b&&_==f[y+1]&&("1"==_||"n"==_)&&(f[y]=_),_=b}for(var x=0;x<c;++x){var w=f[x];if(","==w)f[x]="N";else if("%"==w){var C=void 0;for(C=x+1;C<c&&"%"==f[C];++C);for(var S=x&&"!"==f[x-1]||C<c&&"1"==f[C]?"1":"N",L=x;L<C;++L)f[L]=S;x=C-1}}for(var k=0,T=u;k<c;++k){var N=f[k];"L"==T&&"1"==N?f[k]="L":n.test(N)&&(T=N)}for(var O=0;O<c;++O)if(r.test(f[O])){var M=void 0;for(M=O+1;M<c&&r.test(f[M]);++M);for(var A=(O?f[O-1]:u)=="L",D=(M<c?f[M]:u)=="L",W=A==D?A?"L":"R":u,H=O;H<M;++H)f[H]=W;O=M-1}for(var F,P=[],E=0;E<c;)if(i.test(f[E])){var z=E;for(++E;E<c&&i.test(f[E]);++E);P.push(new l(0,z,E))}else{var R=E,I=P.length,B="rtl"==a?1:0;for(++E;E<c&&"L"!=f[E];++E);for(var G=R;G<E;)if(o.test(f[G])){R<G&&(P.splice(I,0,new l(1,R,G)),I+=B);var U=G;for(++G;G<E&&o.test(f[G]);++G);P.splice(I,0,new l(2,U,G)),I+=B,R=G}else++G;R<E&&P.splice(I,0,new l(1,R,E))}return"ltr"==a&&(1==P[0].level&&(F=s.match(/^\s+/))&&(P[0].from=F[0].length,P.unshift(new l(0,0,F[0].length))),1==el(P).level&&(F=s.match(/\s+$/))&&(el(P).to-=F[0].length,P.push(new l(0,c-F[0].length,c)))),"rtl"==a?P.reverse():P}}();function eb(e,t){var r=e.order;return null==r&&(r=e.order=e_(e.text,t)),r}var ex=[],ew=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,{passive:!1});else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||ex).concat(r)}};function eC(e,t){return e._handlers&&e._handlers[t]||ex}function eS(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=Q(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function eL(e,t){var r=eC(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function ek(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),eL(e,r||t.type,e,t),e0(t)||t.codemirrorIgnore}function eT(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==Q(r,t[n])&&r.push(t[n])}function eN(e,t){return eC(e,t).length>0}function eO(e){e.prototype.on=function(e,t){ew(this,e,t)},e.prototype.off=function(e,t){eS(this,e,t)}}function eM(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function eA(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function e0(e){return null!=e.defaultPrevented?e.defaultPrevented:!1==e.returnValue}function eD(e){eM(e),eA(e)}function eW(e){return e.target||e.srcElement}function eH(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),N&&e.ctrlKey&&1==t&&(t=3),t}var eF=function(){if(v&&m<9)return!1;var e=z("div");return"draggable"in e||"dragDrop"in e}();function eP(e){if(null==o){var t=z("span","​");E(e,z("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(o=t.offsetWidth<=1&&t.offsetHeight>2&&!(v&&m<8))}var r=o?z("span","​"):z("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function e1(e){if(null!=l)return l;var t=E(e,document.createTextNode("AخA")),r=i(t,0,1).getBoundingClientRect(),n=i(t,1,2).getBoundingClientRect();return P(e),!!r&&r.left!=r.right&&(l=n.right-r.right<3)}var eE,ez=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},eR=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!!t&&t.parentElement()==e&&0!=t.compareEndPoints("StartToEnd",t)},eI="oncopy"in(eE=z("div"))||(eE.setAttribute("oncopy","return;"),"function"==typeof eE.oncopy),e3=null,eB={},e7={};function e4(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),eB[e]=t}function e6(e,t){e7[e]=t}function e5(e){if("string"==typeof e&&e7.hasOwnProperty(e))e=e7[e];else if(e&&"string"==typeof e.name&&e7.hasOwnProperty(e.name)){var t=e7[e.name];"string"==typeof t&&(t={name:t}),(e=eu(t,e)).name=t.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return e5("application/xml");else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return e5("application/json");return"string"==typeof e?{name:e}:e||{name:"null"}}function e2(e,t){var r=eB[(t=e5(t)).name];if(!r)return e2(e,"text/plain");var n=r(e,t);if(eG.hasOwnProperty(t.name)){var i=eG[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var eG={};function eU(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function eV(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function eK(e,t,r){return!e.startState||e.startState(t,r)}var eX=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function ej(e,t){if((t-=e.first)<0||t>=e.size)throw Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function eY(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function e8(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function e9(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function eq(e){if(null==e.parent)return null;for(var t=e.parent,r=Q(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function eZ(e,t){var r=e.first;outer:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue outer}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var s=e.lines[l].height;if(t<s)break;t-=s}return r+l}function eQ(e,t){return t>=e.first&&t<e.first+e.size}function eJ(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function te(e,t,r){if(void 0===r&&(r=null),!(this instanceof te))return new te(e,t,r);this.line=e,this.ch=t,this.sticky=r}function tt(e,t){return e.line-t.line||e.ch-t.ch}function tr(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function tn(e){return te(e.line,e.ch)}function ti(e,t){return 0>tt(e,t)?t:e}function to(e,t){return 0>tt(e,t)?e:t}function tl(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ts(e,t){if(t.line<e.first)return te(e.first,0);var r,n,i,o=e.first+e.size-1;return t.line>o?te(o,ej(e,o).text.length):(r=t,n=ej(e,t.line).text.length,i=r.ch,null==i||i>n?te(r.line,n):i<0?te(r.line,0):r)}function ta(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ts(e,t[n]);return r}eX.prototype.eol=function(){return this.pos>=this.string.length},eX.prototype.sol=function(){return this.pos==this.lineStart},eX.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},eX.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eX.prototype.eat=function(e){var t,r=this.string.charAt(this.pos);if(t="string"==typeof e?r==e:r&&(e.test?e.test(r):e(r)))return++this.pos,r},eX.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eX.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},eX.prototype.skipToEnd=function(){this.pos=this.string.length},eX.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},eX.prototype.backUp=function(e){this.pos-=e},eX.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=q(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},eX.prototype.indentation=function(){return q(this.string,null,this.tabSize)-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},eX.prototype.match=function(e,t,r){if("string"==typeof e){var n=function(e){return r?e.toLowerCase():e};if(n(this.string.substr(this.pos,e.length))==n(e))return!1!==t&&(this.pos+=e.length),!0}else{var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}},eX.prototype.current=function(){return this.string.slice(this.start,this.pos)},eX.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},eX.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},eX.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var tu=function(e,t){this.state=e,this.lookAhead=t},tc=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function tf(e,t,r,n){var i=[e.state.modeGen],o={};t_(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var l=r.state,s=0;s<e.state.overlays.length;++s)!function(n){r.baseTokens=i;var s=e.state.overlays[n],a=1,u=0;r.state=!0,t_(e,t.text,s.mode,r,function(e,t){for(var r=a;u<e;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t){if(s.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}}},o),r.state=l,r.baseTokens=null,r.baseTokenPos=1}(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function th(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=td(e,eq(t)),i=t.text.length>e.options.maxHighlightLength&&eU(e.doc.mode,n.state),o=tf(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function td(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new tc(n,!0,t);var o=function e(t,r,n){for(var i,o,l=t.doc,s=n?-1:r-(t.doc.mode.innerMode?1e3:100),a=r;a>s;--a){if(a<=l.first)return l.first;var u=ej(l,a-1),c=u.stateAfter;if(c&&(!n||a+(c instanceof tu?c.lookAhead:0)<=l.modeFrontier))return a;var f=q(u.text,null,t.options.tabSize);(null==o||i>f)&&(o=a-1,i=f)}return o}(e,t,r),l=o>n.first&&ej(n,o-1).stateAfter,s=l?tc.fromSaved(n,l,o):new tc(n,eK(n.mode),o);return n.iter(o,t,function(r){tp(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?s.save():null,s.nextLine()}),r&&(n.modeFrontier=s.line),s}function tp(e,t,r,n){var i=e.doc.mode,o=new eX(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&tg(i,r.state);!o.eol();)tv(i,o,r.state),o.start=o.pos}function tg(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=eV(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}}function tv(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=eV(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw Error("Mode "+e.name+" failed to advance stream.")}tc.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},tc.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},tc.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},tc.fromSaved=function(e,t,r){return t instanceof tu?new tc(e,eU(e.mode,t.state),r,t.lookAhead):new tc(e,eU(e.mode,t),r)},tc.prototype.save=function(e){var t=!1!==e?eU(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new tu(t,this.maxLookAhead):t};var tm=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function t$(e,t,r,n){var i,o=e.doc,l=o.mode;t=ts(o,t);var s,a=ej(o,t.line),u=td(e,t.line,r),c=new eX(a.text,e.options.tabSize,u);for(n&&(s=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=tv(l,c,u.state),n&&s.push(new tm(c,i,eU(o.mode,u.state)));return n?s:new tm(c,i,u.state)}function ty(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function t_(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,f=new eX(t,e.options.tabSize,n),h=e.options.addModeClass&&[null];for(""==t&&ty(tg(r,n.state),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(s=!1,l&&tp(e,t,n,f.pos),f.pos=t.length,a=null):a=ty(tv(r,f,n.state,h),o),h){var d=h[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<f.start;)i(u=Math.min(f.start,u+5e3),c);c=a}f.start=f.pos}for(;u<f.pos;){var p=Math.min(f.pos,u+5e3);i(p,c),u=p}}var tb=!1,tx=!1;function tw(e,t,r){this.marker=e,this.from=t,this.to=r}function tC(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function tS(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function tL(e,t){if(t.full)return null;var r=eQ(e,t.from.line)&&ej(e,t.from.line).markedSpans,n=eQ(e,t.to.line)&&ej(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==tt(t.from,t.to),s=function e(t,r,n){var i;if(t)for(var o=0;o<t.length;++o){var l=t[o],s=l.marker;if(null==l.from||(s.inclusiveLeft?l.from<=r:l.from<r)||l.from==r&&"bookmark"==s.type&&(!n||!l.marker.insertLeft)){var a=null==l.to||(s.inclusiveRight?l.to>=r:l.to>r);(i||(i=[])).push(new tw(s,l.from,a?null:l.to))}}return i}(r,i,l),a=function e(t,r,n){var i;if(t)for(var o=0;o<t.length;++o){var l=t[o],s=l.marker;if(null==l.to||(s.inclusiveRight?l.to>=r:l.to>r)||l.from==r&&"bookmark"==s.type&&(!n||l.marker.insertLeft)){var a=null==l.from||(s.inclusiveLeft?l.from<=r:l.from<r);(i||(i=[])).push(new tw(s,a?null:l.from-r,null==l.to?null:l.to-r))}}return i}(n,o,l),u=1==t.text.length,c=el(t.text).length+(u?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var d=tC(a,h.marker);d?u&&(h.to=null==d.to?null:d.to+c):h.to=i}}if(a)for(var p=0;p<a.length;++p){var g=a[p];(null!=g.to&&(g.to+=c),null==g.from)?!tC(s,g.marker)&&(g.from=c,u&&(s||(s=[])).push(g)):(g.from+=c,u&&(s||(s=[])).push(g))}s&&(s=tk(s)),a&&a!=s&&(a=tk(a));var v=[s];if(!u){var m,$=t.text.length-2;if($>0&&s)for(var y=0;y<s.length;++y)null==s[y].to&&(m||(m=[])).push(new tw(s[y].marker,null,null));for(var _=0;_<$;++_)v.push(m);v.push(a)}return v}function tk(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function tT(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function tN(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function tO(e){return e.inclusiveLeft?-1:0}function tM(e){return e.inclusiveRight?1:0}function tA(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=tt(n.from,i.from)||tO(e)-tO(t);if(o)return-o;var l=tt(n.to,i.to)||tM(e)-tM(t);return l||t.id-e.id}function t0(e,t){var r,n=tx&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&(t?i.from:i.to)==null&&(!r||0>tA(r,i.marker))&&(r=i.marker);return r}function tD(e){return t0(e,!0)}function tW(e){return t0(e,!1)}function tH(e,t){var r,n=tx&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||0>tA(r,o.marker))&&(r=o.marker)}return r}function tF(e,t,r,n,i){var o=ej(e,t),l=tx&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var u=a.marker.find(0),c=tt(u.from,r)||tO(a.marker)-tO(i),f=tt(u.to,n)||tM(a.marker)-tM(i);if((!(c>=0)||!(f<=0))&&(!(c<=0)||!(f>=0))&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?tt(u.to,r)>=0:tt(u.to,r)>0)||c>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?0>=tt(u.from,n):0>tt(u.from,n))))return!0}}}function tP(e){for(var t;t=tD(e);)e=t.find(-1,!0).line;return e}function t1(e,t){var r=ej(e,t),n=tP(r);return r==n?t:eq(n)}function tE(e,t){if(t>e.lastLine())return t;var r,n=ej(e,t);if(!tz(e,n))return t;for(;r=tW(n);)n=r.find(1,!0).line;return eq(n)+1}function tz(e,t){var r=tx&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i){if((n=r[i]).marker.collapsed){if(null==n.from||!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&tR(e,t,n))return!0}}}function tR(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return tR(e,n.line,tC(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&tR(e,t,i))return!0}function tI(e){e=tP(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var l=0;l<o.children.length;++l){var s=o.children[l];if(s==r)break;t+=s.height}return t}function t3(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=tD(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=tW(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function tB(e){var t=e.display,r=e.doc;t.maxLine=ej(r,r.first),t.maxLineLength=t3(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=t3(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}var t7=function(e,t,r){this.text=e,tN(this,t),this.height=r?r(this):1};function t4(e){e.parent=null,tT(e)}t7.prototype.lineNo=function(){return eq(this)},eO(t7);var t6={},t5={};function t2(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?t5:t6;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function tG(e,t){var r=R("span",null,null,$?"padding-right: .1px":null),n={pre:R("pre",[r],"CodeMirror-line Line-Hover"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;n.pos=0,n.addToken=tV,e1(e.display.measure)&&(l=eb(o,e.doc.direction))&&(n.addToken=tK(n.addToken,l)),n.map=[];var s=t!=e.display.externalMeasured&&eq(o);tj(o,n,th(e,o,s)),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=U(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=U(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(eP(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if($){var a=n.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return eL(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=U(n.pre.className,n.textClass||"")),n}function tU(e){var t=z("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function tV(e,t,r,n,i,o,l){if(t){var s,a=e.splitSpaces?function e(t,r){if(t.length>1&&!/  /.test(t))return t;for(var n=r,i="",o=0;o<t.length;o++){var l=t.charAt(o);" "==l&&n&&(o==t.length-1||32==t.charCodeAt(o+1))&&(l="\xa0"),i+=l,n=" "==l}return i}(t,e.trailingSpace):t,u=e.cm.state.specialChars,c=!1;if(u.test(t)){s=document.createDocumentFragment();for(var f=0;;){u.lastIndex=f;var h=u.exec(t),d=h?h.index-f:t.length-f;if(d){var p=document.createTextNode(a.slice(f,f+d));v&&m<9?s.appendChild(z("span",[p])):s.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!h)break;f+=d+1;var g=void 0;if("	"==h[0]){var $=e.cm.options.tabSize,y=$-e.col%$;(g=s.appendChild(z("span",eo(y),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","	"),e.col+=y}else"\r"==h[0]||"\n"==h[0]?((g=s.appendChild(z("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),v&&m<9?s.appendChild(z("span",[g])):s.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,s=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,s),v&&m<9&&(c=!0),e.pos+=t.length;if(e.trailingSpace=32==a.charCodeAt(t.length-1),r||n||i||c||o||l){var _=r||"";n&&(_+=n),i&&(_+=i);var b=z("span",[s],_,o);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&b.setAttribute(x,l[x]);return e.content.appendChild(b)}e.content.appendChild(s)}}function tK(e,t){return function(r,n,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var f=void 0,h=0;h<t.length&&(!((f=t[h]).to>u)||!(f.from<=u));h++);if(f.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,f.to-u),i,o,null,s,a),o=null,n=n.slice(f.to-u),u=f.to}}}function tX(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function tj(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(!n){for(var l=1;l<r.length;l+=2)t.addToken(t,i.slice(o,o=r[l]),t2(r[l+1],t.cm.options));return}for(var s,a,u,c,f,h,d,p=i.length,g=0,v=1,m="",$=0;;){if($==g){u=c=f=a="",d=null,h=null,$=1/0;for(var y=[],_=void 0,b=0;b<n.length;++b){var x=n[b],w=x.marker;if("bookmark"==w.type&&x.from==g&&w.widgetNode)y.push(w);else if(x.from<=g&&(null==x.to||x.to>g||w.collapsed&&x.to==g&&x.from==g)){if(null!=x.to&&x.to!=g&&$>x.to&&($=x.to,c=""),w.className&&(u+=" "+w.className),w.css&&(a=(a?a+";":"")+w.css),w.startStyle&&x.from==g&&(f+=" "+w.startStyle),w.endStyle&&x.to==$&&(_||(_=[])).push(w.endStyle,x.to),w.title&&((d||(d={})).title=w.title),w.attributes)for(var C in w.attributes)(d||(d={}))[C]=w.attributes[C];w.collapsed&&(!h||0>tA(h.marker,w))&&(h=x)}else x.from>g&&$>x.from&&($=x.from)}if(_)for(var S=0;S<_.length;S+=2)_[S+1]==$&&(c+=" "+_[S]);if(!h||h.from==g)for(var L=0;L<y.length;++L)tX(t,0,y[L]);if(h&&(h.from||0)==g){if(tX(t,(null==h.to?p+1:h.to)-g,h.marker,null==h.from),null==h.to)return;h.to==g&&(h=!1)}}if(g>=p)break;for(var k=Math.min(p,$);;){if(m){var T=g+m.length;if(!h){var N=T>k?m.slice(0,k-g):m;t.addToken(t,N,s?s+u:u,f,g+N.length==$?c:"",a,d)}if(T>=k){m=m.slice(k-g),g=k;break}g=T,f=""}m=i.slice(o,o=r[v++]),s=t2(r[v++],t.cm.options)}}}function tY(e,t,r){this.line=t,this.rest=function e(t){for(var r,n;r=tW(t);)t=r.find(1,!0).line,(n||(n=[])).push(t);return n}(t),this.size=this.rest?eq(el(this.rest))-r+1:1,this.node=this.text=null,this.hidden=tz(e,t)}function t8(e,t,r){for(var n,i=[],o=t;o<r;o=n){var l=new tY(e.doc,ej(e.doc,o),o);n=o+l.size,i.push(l)}return i}var t9=null,tq=null;function tZ(e,t){var r=eC(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);t9?n=t9.delayedCallbacks:tq?n=tq:(n=tq=[],setTimeout(tQ,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},l=0;l<r.length;++l)o(l)}}function tQ(){var e=tq;tq=null;for(var t=0;t<e.length;++t)e[t]()}function tJ(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?rr(e,t):"gutter"==o?ri(e,t,r,n):"class"==o?rn(e,t):"widget"==o&&ro(e,t,n)}t.changes=null}function re(e){return e.node==e.text&&(e.node=z("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),v&&m<8&&(e.node.style.zIndex=2)),e.node}function rt(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):tG(e,t)}function rr(e,t){var r=t.text.className,n=rt(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,rn(e,t)):r&&(t.text.className=r)}function rn(e,t){!function e(t,r){var n=r.bgClass?r.bgClass+" "+(r.line.bgClass||""):r.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),r.background)n?r.background.className=n:(r.background.parentNode.removeChild(r.background),r.background=null);else if(n){var i=re(r);r.background=i.insertBefore(z("div",null,n),i.firstChild),t.display.input.setUneditable(r.background)}}(e,t),t.line.wrapClass?re(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function ri(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=re(t);t.gutterBackground=z("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=re(t),s=t.gutter=z("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(z("div",eJ(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a<e.display.gutterSpecs.length;++a){var u=e.display.gutterSpecs[a].className,c=o.hasOwnProperty(u)&&o[u];c&&s.appendChild(z("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function ro(e,t,r){t.alignable&&(t.alignable=null);for(var n=H("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);rs(e,t,r)}function rl(e,t,r,n){var i=rt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),rn(e,t),ri(e,t,r,n),rs(e,t,n),t.node}function rs(e,t,r){if(ra(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)ra(e,t.rest[n],t,r,!1)}function ra(e,t,r,n,i){if(t.widgets)for(var o=re(r),l=0,s=t.widgets;l<s.length;++l){var a=s[l],u=z("div",[a.node],"CodeMirror-linewidget"+(a.className?" "+a.className:""));a.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),ru(a,u,r,n),e.display.input.setUneditable(u),i&&a.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),tZ(a,"redraw")}}function ru(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function rc(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!I(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),E(t.display.measure,z("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function rf(e,t){for(var r=eW(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function rh(e){return e.lineSpace.offsetTop}function rd(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function rp(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=E(e.measure,z("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function rg(e){return 50-e.display.nativeBarWidth}function rv(e){return e.display.scroller.clientWidth-rg(e)-e.display.barWidth}function rm(e){return e.display.scroller.clientHeight-rg(e)-e.display.barHeight}function r$(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(eq(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function ry(e,t,r,n){return rx(e,rb(e,t),r,n)}function r_(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[rU(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function rb(e,t){var r,n,i,o,l,s=eq(t),a=r_(e,s);a&&!a.text?a=null:a&&a.changes&&(tJ(e,a,s,r4(e)),e.curOp.forceUpdate=!0),!a&&(a=(r=e,n=t,n=tP(n),i=eq(n),(o=r.display.externalMeasured=new tY(r.doc,n,i)).lineN=i,l=o.built=tG(r,o),o.text=l.pre,E(r.display.lineMeasure,l.pre),o));var u=r$(a,t,s);return{line:t,view:a,rect:null,map:u.map,cache:u.cache,before:u.before,hasHeights:!1}}function rx(e,t,r,n,o){t.before&&(r=-1);var l,s=r+(n||"");return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function e(t,r,n){var i=t.options.lineWrapping,o=i&&rv(t);if(!r.measure.heights||i&&r.measure.width!=o){var l=r.measure.heights=[];if(i){r.measure.width=o;for(var s=r.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var u=s[a],c=s[a+1];Math.abs(u.bottom-c.bottom)>2&&l.push((u.bottom+c.top)/2-n.top)}}l.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(l=function e(t,r,n,o){var l,s,a=rC(r.map,n,o),u=a.node,c=a.start,f=a.end,h=a.collapse;if(3==u.nodeType){for(var d=0;d<4;d++){for(;c&&eg(r.line.text.charAt(a.coverStart+c));)--c;for(;a.coverStart+f<a.coverEnd&&eg(r.line.text.charAt(a.coverStart+f));)++f;if((l=v&&m<9&&0==c&&f==a.coverEnd-a.coverStart?u.parentNode.getBoundingClientRect():rS(i(u,c,f).getClientRects(),o)).left||l.right||0==c)break;f=c,c-=1,h="right"}v&&m<11&&(l=function e(t,r){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function e(t){if(null!=e3)return e3;var r=E(t,z("span","x")),n=r.getBoundingClientRect(),o=i(r,0,1).getBoundingClientRect();return e3=Math.abs(n.left-o.left)>1}(t))return r;var n=screen.logicalXDPI/screen.deviceXDPI,o=screen.logicalYDPI/screen.deviceYDPI;return{left:r.left*n,right:r.right*n,top:r.top*o,bottom:r.bottom*o}}(t.display.measure,l))}else c>0&&(h=o="right"),l=t.options.lineWrapping&&(s=u.getClientRects()).length>1?s["right"==o?s.length-1:0]:u.getBoundingClientRect();if(v&&m<9&&!c&&(!l||!l.left&&!l.right)){var p=u.parentNode.getClientRects()[0];l=p?{left:p.left,right:p.left+r7(t.display),top:p.top,bottom:p.bottom}:rw}for(var g=l.top-r.rect.top,$=l.bottom-r.rect.top,y=(g+$)/2,_=r.view.measure.heights,b=0;b<_.length-1&&!(y<_[b]);b++);var x=b?_[b-1]:0,w=_[b],C={left:("right"==h?l.right:l.left)-r.rect.left,right:("left"==h?l.left:l.right)-r.rect.left,top:x,bottom:w};return l.left||l.right||(C.bogus=!0),t.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=$),C}(e,t,r,n)).bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:o?l.rtop:l.top,bottom:o?l.rbottom:l.bottom}}var rw={left:0,right:0,top:0,bottom:0};function rC(e,t,r){for(var n,i,o,l,s,a,u=0;u<e.length;u+=3)if(s=e[u],a=e[u+1],t<s?(i=0,o=1,l="left"):t<a?o=(i=t-s)+1:(u==e.length-3||t==a&&e[u+3]>t)&&(i=(o=a-s)-1,t>=a&&(l="right")),null!=i){if(n=e[u+2],s==a&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[(u-=3)+2],l="left";if("right"==r&&i==a-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:s,coverEnd:a}}function rS(e,t){var r=rw;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function rL(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function rk(e){e.display.externalMeasure=null,P(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)rL(e.display.view[t])}function rT(e){rk(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function rN(e){return _&&k?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function rO(e){return _&&k?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function rM(e){var t=tP(e).widgets,r=0;if(t)for(var n=0;n<t.length;++n)t[n].above&&(r+=rc(t[n]));return r}function rA(e,t,r,n,i){if(!i){var o=rM(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=tI(t);if("local"==n?l+=rh(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:rO(K(e)));var a=s.left+("window"==n?0:rN(K(e)));r.left+=a,r.right+=a}return r.top+=l,r.bottom+=l,r}function r0(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=rN(K(e)),i-=rO(K(e));else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function rD(e,t,r,n,i){return n||(n=ej(e.doc,t.line)),rA(e,n,ry(e,n,t.ch,i),r)}function rW(e,t,r,n,i,o){function l(t,l){var s=rx(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,rA(e,n,s,r)}n=n||ej(e.doc,t.line),i||(i=rb(e,n));var s=eb(n,e.doc.direction),a=t.ch,u=t.sticky;if(a>=n.text.length?(a=n.text.length,u="before"):a<=0&&(a=0,u="after"),!s)return l("before"==u?a-1:a,"before"==u);function c(e,t,r){return l(r?e-1:e,1==s[t].level!=r)}var f=ey(s,a,u),h=e$,d=c(a,f,"before"==u);return null!=h&&(d.other=c(a,h,"before"!=u)),d}function rH(e,t){var r=0;t=ts(e.doc,t),e.options.lineWrapping||(r=r7(e.display)*t.ch);var n=ej(e.doc,t.line),i=tI(n)+rh(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function rF(e,t,r,n,i){var o=te(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function rP(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return rF(n.first,0,null,-1,-1);var i=eZ(n,r),o=n.first+n.size-1;if(i>o)return rF(n.first+n.size-1,ej(n,o).text.length,null,1,1);t<0&&(t=0);for(var l=ej(n,i);;){var s=rR(e,l,i,t,r),a=tH(l,s.ch+(s.xRel>0||s.outside>0?1:0));if(!a)return s;var u=a.find(1);if(u.line==i)return u;l=ej(n,i=u.line)}}function r1(e,t,r,n){n-=rM(t);var i=t.text.length,o=em(function(t){return rx(e,r,t-1).bottom<=n},i,0);return i=em(function(t){return rx(e,r,t).top>n},o,i),{begin:o,end:i}}function rE(e,t,r,n){r||(r=rb(e,t));var i=rA(e,t,rx(e,r,n),"line").top;return r1(e,t,r,i)}function rz(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function rR(e,t,r,n,i){i-=tI(t);var o=rb(e,t),l=rM(t),s=0,a=t.text.length,u=!0,c=eb(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?r3:rI)(e,t,r,o,c,n,i);s=(u=1!=f.level)?f.from:f.to-1,a=u?f.to:f.from-1}var h,d,p=null,g=null,v=em(function(t){var r=rx(e,o,t);return r.top+=l,r.bottom+=l,!!rz(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)},s,a),m=!1;if(g){var $=n-g.left<g.right-n,y=$==u;v=p+(y?0:1),d=y?"after":"before",h=$?g.left:g.right}else{!u&&(v==a||v==s)&&v++,d=0==v?"after":v==t.text.length?"before":rx(e,o,v-(u?1:0)).bottom+l<=i==u?"after":"before";var _=rW(e,te(r,v,d),"line",t,o);h=_.left,m=i<_.top?-1:i>=_.bottom?1:0}return v=ev(t.text,v,1),rF(r,v,d,m,n-h)}function rI(e,t,r,n,i,o,l){var s=em(function(s){var a=i[s],u=1!=a.level;return rz(rW(e,te(r,u?a.to:a.from,u?"before":"after"),"line",t,n),o,l,!0)},0,i.length-1),a=i[s];if(s>0){var u=1!=a.level,c=rW(e,te(r,u?a.from:a.to,u?"after":"before"),"line",t,n);rz(c,o,l,!0)&&c.top>l&&(a=i[s-1])}return a}function r3(e,t,r,n,i,o,l){var s=r1(e,t,n,l),a=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,f=null,h=0;h<i.length;h++){var d=i[h];if(!(d.from>=u)&&!(d.to<=a)){var p=rx(e,n,1!=d.level?Math.min(u,d.to)-1:Math.max(a,d.from)).right,g=p<o?o-p+1e9:p-o;(!c||f>g)&&(c=d,f=g)}}return c||(c=i[i.length-1]),c.from<a&&(c={from:a,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function rB(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==s){s=z("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)s.appendChild(document.createTextNode("x")),s.appendChild(z("br"));s.appendChild(document.createTextNode("x"))}E(e.measure,s);var r=s.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),P(e.measure),r||1}function r7(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=z("span","xxxxxxxxxx"),r=z("pre",[t],"CodeMirror-line-like");E(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function r4(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var s=e.display.gutterSpecs[l].className;r[s]=o.offsetLeft+o.clientLeft+i,n[s]=o.clientWidth}return{fixedPos:r6(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function r6(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function r5(e){var t=rB(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/r7(e.display)-3);return function(i){if(tz(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function r2(e){var t=e.doc,r=r5(e);t.iter(function(e){var t=r(e);t!=e.height&&e9(e,t)})}function rG(e,t,r,n){var i=e.display;if(!r&&"true"==eW(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(a){return null}var u,c=rP(e,o,l);if(n&&c.xRel>0&&(u=ej(e.doc,c.line).text).length==c.ch){var f=q(u,u.length,e.options.tabSize)-u.length;c=te(c.line,Math.max(0,Math.round((o-rp(e.display).left)/r7(e.display))-f))}return c}function rU(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function rV(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)tx&&t1(e.doc,t)<i.viewTo&&rX(e);else if(r<=i.viewFrom)tx&&tE(e.doc,r+n)>i.viewFrom?rX(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)rX(e);else if(t<=i.viewFrom){var o=rj(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):rX(e)}else if(r>=i.viewTo){var l=rj(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):rX(e)}else{var s=rj(e,t,t,-1),a=rj(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(t8(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):rX(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function rK(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom)&&!(t>=n.viewTo)){var o=n.view[rU(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==Q(l,r)&&l.push(r)}}}function rX(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function rj(e,t,r,n){var i,o=rU(e,t),l=e.display.view;if(!tx||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,a=0;a<o;a++)s+=l[a].size;if(s!=t){if(n>0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;t1(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function rY(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];!i.hidden&&(!i.node||i.changes)&&++r}return r}function r8(e){e.display.input.showSelection(e.display.input.prepareSelection())}function r9(e,t){void 0===t&&(t=!0);var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=e.options.$customCursor;l&&(t=!0);for(var s=0;s<r.sel.ranges.length;s++){if(t||s!=r.sel.primIndex){var a=r.sel.ranges[s];if(!(a.from().line>=e.display.viewTo)&&!(a.to().line<e.display.viewFrom)){var u=a.empty();if(l){var c=l(e,a);c&&rq(e,c,i)}else(u||e.options.showCursorWhenSelecting)&&rq(e,a.head,i);u||rQ(e,a,o)}}}return n}function rq(e,t,r){var n=rW(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(z("div","\xa0","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=rD(e,t,"div",null,null),l=o.right-o.left;i.style.width=(l>0?l:e.defaultCharWidth())+"px"}if(n.other){var s=r.appendChild(z("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function rZ(e,t){return e.top-t.top||e.left-t.left}function rQ(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),l=rp(e.display),s=l.left,a=Math.max(n.sizerWidth,rv(e)-n.sizer.offsetLeft)-l.right,u="ltr"==i.direction;function c(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(z("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==r?a-e:r)+"px;\n                             height: "+(n-t)+"px"))}function f(t,r,n){var o,l,f=ej(i,t),h=f.text.length;function d(r,n){return rD(e,te(t,r),"div",f,n)}function p(t,r,n){var i=rE(e,f,null,t),o="ltr"==r==("after"==n)?"left":"right";return d("after"==n?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var g=eb(f,i.direction);return!function e(t,r,n,i){if(!t)return i(r,n,"ltr",0);for(var o=!1,l=0;l<t.length;++l){var s=t[l];(s.from<n&&s.to>r||r==n&&s.to==r)&&(i(Math.max(s.from,r),Math.min(s.to,n),1==s.level?"rtl":"ltr",l),o=!0)}o||i(r,n,"ltr")}(g,r||0,null==n?h:n,function(e,t,i,f){var v,m,$,y,_="ltr"==i,b=d(e,_?"left":"right"),x=d(t-1,_?"right":"left"),w=null==r&&0==e,C=null==n&&t==h,S=0==f,L=!g||f==g.length-1;if(x.top-b.top<=3){var k=(u?w:C)&&S?s:(_?b:x).left,T=(u?C:w)&&L?a:(_?x:b).right;c(k,b.top,T-k,b.bottom)}else _?(v=u&&w&&S?s:b.left,m=u?a:p(e,i,"before"),$=u?s:p(t,i,"after"),y=u&&C&&L?a:x.right):(v=u?p(e,i,"before"):s,m=!u&&w&&S?a:b.right,$=!u&&C&&L?s:x.left,y=u?p(t,i,"after"):a),c(v,b.top,m-v,b.bottom),b.bottom<x.top&&c(s,b.bottom,null,x.top),c($,x.top,y-$,x.bottom);(!o||0>rZ(b,o))&&(o=b),0>rZ(x,o)&&(o=x),(!l||0>rZ(b,l))&&(l=b),0>rZ(x,l)&&(l=x)}),{start:o,end:l}}var h=t.from(),d=t.to();if(h.line==d.line)f(h.line,h.ch,d.ch);else{var p=ej(i,h.line),g=ej(i,d.line),v=tP(p)==tP(g),m=f(h.line,h.ch,v?p.text.length+1:null).end,$=f(d.line,v?0:null,d.ch).start;v&&(m.top<$.top-2?(c(m.right,m.top,null,m.bottom),c(s,$.top,$.left,$.bottom)):c(m.right,m.top,$.left-m.right,m.bottom)),m.bottom<$.top&&c(s,m.bottom,null,$.top)}r.appendChild(o)}function rJ(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||nn(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ne(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||nr(e))}function nt(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&nn(e))},100)}function nr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(eL(e,"focus",e,t),e.state.focused=!0,G(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),$&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),rJ(e))}function nn(e,t){!e.state.delayingBlurEvent&&(e.state.focused&&(eL(e,"blur",e,t),e.state.focused=!1,F(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function ni(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l<t.view.length;l++){var s=t.view[l],a=e.options.lineWrapping,u=void 0,c=0;if(!s.hidden){if(i+=s.line.height,v&&m<8){var f=s.node.offsetTop+s.node.offsetHeight;u=f-r,r=f}else{var h=s.node.getBoundingClientRect();u=h.bottom-h.top,!a&&s.text.firstChild&&(c=s.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=s.line.height-u;if((d>.005||d<-.005)&&(i<n&&(o-=d),e9(s.line,u),no(s.line),s.rest))for(var p=0;p<s.rest.length;p++)no(s.rest[p]);if(c>e.display.sizerWidth){var g=Math.ceil(c/r7(e.display));g>e.display.maxLineLength&&(e.display.maxLineLength=g,e.display.maxLine=s.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function no(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function nl(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-rh(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=eZ(t,n),l=eZ(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;s<o?(o=s,l=eZ(t,tI(ej(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=eZ(t,tI(ej(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function ns(e,t){var r=e.display,n=rB(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=rm(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+rd(r),a=t.top<n,u=t.bottom>s-n;if(t.top<i)l.scrollTop=a?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(l.scrollTop=c)}var f=e.options.fixedGutter?0:r.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft-f,d=rv(e)-r.gutters.offsetWidth,p=t.right-t.left>d;return p&&(t.right=t.left+d),t.left<10?l.scrollLeft=0:t.left<h?l.scrollLeft=Math.max(0,t.left+f-(p?0:10)):t.right>d+h-3&&(l.scrollLeft=t.right+(p?0:10)-d),l}function na(e,t){null!=t&&(nf(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function nu(e){nf(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function nc(e,t,r){(null!=t||null!=r)&&nf(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function nf(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=rH(e,t.from),n=rH(e,t.to);nh(e,r,n,t.margin)}}function nh(e,t,r,n){var i=ns(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});nc(e,i.scrollLeft,i.scrollTop)}function nd(e,t){!(2>Math.abs(e.doc.scrollTop-t))&&(h||nE(e,{top:t}),np(e,t,!0),h&&nE(e),nW(e,100))}function np(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ng(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),((r?t!=e.doc.scrollLeft:!(2>Math.abs(e.doc.scrollLeft-t)))||n)&&(e.doc.scrollLeft=t,nI(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function nv(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+rd(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+rg(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var nm=function(e,t,r){this.cm=r;var n=this.vert=z("div",[z("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=z("div",[z("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),ew(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),ew(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,v&&m<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};nm.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=