PageSourceSearch

https://de.serlo.org/_next/static/chunks/02e4a100.05913e73d6458526.js

js serlo.org collected 2026-09-24 17:44:26 UTC 172,228 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7745],{16424:function(e,t,r){function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}r.d(t,{g:function(){return n},r:function(){return l}}),"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var i,o={exports:{}};function l(){var e;return i||(i=1,e=function(){var e,t,r,n,i,o,l,s,a,u=navigator.userAgent,c=navigator.platform,h=/gecko\/\d/i.test(u),f=/MSIE \d/.test(u),d=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(u),p=/Edge\/(\d+)/.exec(u),g=f||d||p,v=g&&(f?document.documentMode||6:+(p||d)[1]),m=!p&&/WebKit\//.test(u),y=m&&/Qt\/\d+\.\d+/.test(u),b=!p&&/Chrome\//.test(u),w=/Opera\//.test(u),x=/Apple Computer/.test(navigator.vendor),C=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(u),S=/PhantomJS/.test(u),L=x&&(/Mobile\/\w+/.test(u)||navigator.maxTouchPoints>2),k=/Android/.test(u),T=L||k||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(u),M=L||/Mac/.test(c),N=/\bCrOS\b/.test(u),O=/win/i.test(c),A=w&&u.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(w=!1,m=!0);var D=M&&(y||w&&(null==A||A<12.11)),W=h||g&&v>=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 I(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=I(e,t,r,n);return i.setAttribute("role","presentation"),i}function z(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(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}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}document.createRange?n=function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:n=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var V=function(e){e.select()};function K(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function j(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 X(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}:g&&(V=function(e){try{e.select()}catch(e){}});var Y=function(){this.id=null,this.f=null,this.time=0,this.handler=K(this.onTimeout,this)};function _(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return -1}Y.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Y.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 $={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},Z={origin:"*mouse"},Q={origin:"+move"};function J(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 ee=[""];function et(e){for(;ee.length<=e;)ee.push(er(ee)+" ");return ee[e]}function er(e){return e[e.length-1]}function en(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function ei(){}function eo(e,t){var r;
vendor: 5,635 bytes, line 1
1return Object.create?r=Object.create(e):(ei.prototype=e,r=new ei),t&&j(t,r),r}var el=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function es(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||el.test(e))}function ea(e,t){return t?!!(t.source.indexOf("\\w")>-1&&es(e))||t.test(e):es(e)}function eu(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ec=/[\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 eh(e){return e.charCodeAt(0)>=768&&ec.test(e)}function ef(e,t,r){for(;(r<0?t>0:t<e.length)&&eh(e.charAt(t));)t+=r;return t}function ed(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 ep=null;function eg(e,t,r){var n;ep=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:ep=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:ep=i)}return null!=n?n:ep}var ev=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function o(e,t,r){this.level=e,this.from=t,this.to=r}return function(l,s){var a="ltr"==s?"L":"R";if(0==l.length||"ltr"==s&&!e.test(l))return!1;for(var u=l.length,c=[],h=0;h<u;++h){c.push((F=l.charCodeAt(h))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(F):1424<=F&&F<=1524?"R":1536<=F&&F<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(F-1536):1774<=F&&F<=2220?"r":8192<=F&&F<=8203?"w":8204==F?"b":"L")}for(var f=0,d=a;f<u;++f){var p=c[f];"m"==p?c[f]=d:d=p}for(var g=0,v=a;g<u;++g){var m=c[g];"1"==m&&"r"==v?c[g]="n":r.test(m)&&(v=m,"r"==m&&(c[g]="R"))}for(var y=1,b=c[0];y<u-1;++y){var w=c[y];"+"==w&&"1"==b&&"1"==c[y+1]?c[y]="1":","==w&&b==c[y+1]&&("1"==b||"n"==b)&&(c[y]=b),b=w}for(var x=0;x<u;++x){var C=c[x];if(","==C)c[x]="N";else if("%"==C){var S=void 0;for(S=x+1;S<u&&"%"==c[S];++S);for(var L=x&&"!"==c[x-1]||S<u&&"1"==c[S]?"1":"N",k=x;k<S;++k)c[k]=L;x=S-1}}for(var T=0,M=a;T<u;++T){var N=c[T];"L"==M&&"1"==N?c[T]="L":r.test(N)&&(M=N)}for(var O=0;O<u;++O)if(t.test(c[O])){var A=void 0;for(A=O+1;A<u&&t.test(c[A]);++A);for(var D=(O?c[O-1]:a)=="L",W=D==((A<u?c[A]:a)=="L")?D?"L":"R":a,H=O;H<A;++H)c[H]=W;O=A-1}for(var F,P,E=[],I=0;I<u;)if(n.test(c[I])){var R=I;for(++I;I<u&&n.test(c[I]);++I);E.push(new o(0,R,I))}else{var z=I,B=E.length,G="rtl"==s?1:0;for(++I;I<u&&"L"!=c[I];++I);for(var U=z;U<I;)if(i.test(c[U])){z<U&&(E.splice(B,0,new o(1,z,U)),B+=G);var V=U;for(++U;U<I&&i.test(c[U]);++U);E.splice(B,0,new o(2,V,U)),B+=G,z=U}else++U;z<I&&E.splice(B,0,new o(1,z,I))}return"ltr"==s&&(1==E[0].level&&(P=l.match(/^\s+/))&&(E[0].from=P[0].length,E.unshift(new o(0,0,P[0].length))),1==er(E).level&&(P=l.match(/\s+$/))&&(er(E).to-=P[0].length,E.push(new o(0,u-P[0].length,u)))),"rtl"==s?E.reverse():E}}();function em(e,t){var r=e.order;return null==r&&(r=e.order=ev(e.text,t)),r}var ey=[],eb=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||ey).concat(r)}};function ew(e,t){return e._handlers&&e._handlers[t]||ey}function ex(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=_(i,r);o>
1-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function eC(e,t){var r=ew(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 eS(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),eC(e,r||t.type,e,t),eO(t)||t.codemirrorIgnore}function eL(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==_(r,t[n])&&r.push(t[n])}function ek(e,t){return ew(e,t).length>0}function eT(e){e.prototype.on=function(e,t){eb(this,e,t)},e.prototype.off=function(e,t){ex(this,e,t)}}function eM(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function eN(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function eO(e){return null!=e.defaultPrevented?e.defaultPrevented:!1==e.returnValue}function eA(e){eM(e),eN(e)}function eD(e){return e.target||e.srcElement}function eW(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),M&&e.ctrlKey&&1==t&&(t=3),t}var eH=function(){if(g&&v<9)return!1;var e=I("div");return"draggable"in e||"dragDrop"in e}(),eF=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/)},eP=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!!t&&t.parentElement()==e&&0!=t.compareEndPoints("StartToEnd",t)},eE="oncopy"in(e=I("div"))||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy),eI=null,eR={},ez={};function eB(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),eR[e]=t}function eG(e){if("string"==typeof e&&ez.hasOwnProperty(e))e=ez[e];else if(e&&"string"==typeof e.name&&ez.hasOwnProperty(e.name)){var t=ez[e.name];"string"==typeof t&&(t={name:t}),(e=eo(t,e)).name=t.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return eG("application/xml");else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return eG("application/json");return"string"==typeof e?{name:e}:e||{name:"null"}}function eU(e,t){var r=eR[(t=eG(t)).name];if(!r)return eU(e,"text/plain");var n=r(e,t);if(eV.hasOwnProperty(t.name)){var i=eV[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 eV={};function eK(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 ej(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 eX(e,t,r){return!e.startState||e.startState(t,r)}var eY=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 e_(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 e$(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;
1i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function eq(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function eZ(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=_(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 eJ(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}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 e0(e,t){return t>=e.first&&t<e.first+e.size}function e1(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function e2(e,t,r){if(void 0===r&&(r=null),!(this instanceof e2))return new e2(e,t,r);this.line=e,this.ch=t,this.sticky=r}function e3(e,t){return e.line-t.line||e.ch-t.ch}function e5(e,t){return e.sticky==t.sticky&&0==e3(e,t)}function e9(e){return e2(e.line,e.ch)}function e6(e,t){return 0>e3(e,t)?t:e}function e4(e,t){return 0>e3(e,t)?e:t}function e8(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function e7(e,t){if(t.line<e.first)return e2(e.first,0);var r,n,i=e.first+e.size-1;return t.line>i?e2(i,e_(e,i).text.length):(r=e_(e,t.line).text.length,null==(n=t.ch)||n>r?e2(t.line,r):n<0?e2(t.line,0):t)}function te(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=e7(e,t[n]);return r}eY.prototype.eol=function(){return this.pos>=this.string.length},eY.prototype.sol=function(){return this.pos==this.lineStart},eY.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},eY.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eY.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},eY.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eY.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},eY.prototype.skipToEnd=function(){this.pos=this.string.length},eY.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},eY.prototype.backUp=function(e){this.pos-=e},eY.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=X(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},eY.prototype.indentation=function(){return X(this.string,null,this.tabSize)-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},eY.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)}},eY.prototype.current=function(){return this.string.slice(this.start,this.pos)},eY.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},eY.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},eY.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var tt=function(e,t){this.state=e,this.lookAhead=t},tr=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 tn(e,t,r,n){var i=[e.state.modeGen],o={};tf(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,tf(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 ti(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=to(e,eQ(t)),i=t.text.length>
vendor: 4,551 bytes, line 1
1e.options.maxHighlightLength&&eK(e.doc.mode,n.state),o=tn(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 to(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new tr(n,!0,t);var o=function(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=e_(o,s-1),u=a.stateAfter;if(u&&(!r||s+(u instanceof tt?u.lookAhead:0)<=o.modeFrontier))return s;var c=X(a.text,null,e.options.tabSize);(null==i||n>c)&&(i=s-1,n=c)}return i}(e,t,r),l=o>n.first&&e_(n,o-1).stateAfter,s=l?tr.fromSaved(n,l,o):new tr(n,eX(n.mode),o);return n.iter(o,t,function(r){tl(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 tl(e,t,r,n){var i=e.doc.mode,o=new eY(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&ts(i,r.state);!o.eol();)ta(i,o,r.state),o.start=o.pos}function ts(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=ej(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}}function ta(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=ej(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.")}tr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},tr.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}},tr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},tr.fromSaved=function(e,t,r){return t instanceof tt?new tr(e,eK(e.mode,t.state),r,t.lookAhead):new tr(e,eK(e.mode,t),r)},tr.prototype.save=function(e){var t=!1!==e?eK(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new tt(t,this.maxLookAhead):t};var tu=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function tc(e,t,r,n){var i,o=e.doc,l=o.mode;t=e7(o,t);var s,a=e_(o,t.line),u=to(e,t.line,r),c=new eY(a.text,e.options.tabSize,u);for(n&&(s=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=ta(l,c,u.state),n&&s.push(new tu(c,i,eK(o.mode,u.state)));return n?s:new tu(c,i,u.state)}function th(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 tf(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,h=new eY(t,e.options.tabSize,n),f=e.options.addModeClass&&[null];for(""==t&&th(ts(r,n.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,l&&tl(e,t,n,h.pos),h.pos=t.length,a=null):a=th(ta(r,h,n.state,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<h.start;)i(u=Math.min(h.start,u+5e3),c);c=a}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);i(p,c),u=p}}var td=!1,tp=!1;function tg(e,t,r){this.marker=e,this.from=t,this.to=r}function tv(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function tm(e,t){if(t.full)return null;var r=e0(e,t.from.line)&&e_(e,t.from.line).markedSpans,n=e0(e,t.to.line)&&e_(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==e3(t.from,t.to),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==l.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new tg(l,o.from,s?null:o.to))}}return n}(r,i,l),a=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.to||(l.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new tg(l,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,l),u=1==t.text.length,c=er(t.text).length+(u?i:0);if(s)for(var h=0;h<s.length;++h){var f=s[h];if(null==f.to){var d=tv(a,f.marker);d?u&&(f.to=null==d.to?null:d.to+c):f.to=i}}if(a)for(var p=0;p<a.length;++p){var g=a[p];
1null!=g.to&&(g.to+=c),null==g.from?!tv(s,g.marker)&&(g.from=c,u&&(s||(s=[])).push(g)):(g.from+=c,u&&(s||(s=[])).push(g))}s&&(s=ty(s)),a&&a!=s&&(a=ty(a));var v=[s];if(!u){var m,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(m||(m=[])).push(new tg(s[b].marker,null,null));for(var w=0;w<y;++w)v.push(m);v.push(a)}return v}function ty(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 tb(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function tw(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function tx(e){return e.inclusiveLeft?-1:0}function tC(e){return e.inclusiveRight?1:0}function tS(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=e3(n.from,i.from)||tx(e)-tx(t);return o?-o:e3(n.to,i.to)||tC(e)-tC(t)||t.id-e.id}function tL(e,t){var r,n=tp&&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>tS(r,i.marker))&&(r=i.marker);return r}function tk(e,t,r,n,i){var o=e_(e,t),l=tp&&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=e3(u.from,r)||tx(a.marker)-tx(i),h=e3(u.to,n)||tC(a.marker)-tC(i);if((!(c>=0)||!(h<=0))&&(!(c<=0)||!(h>=0))&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?e3(u.to,r)>=0:e3(u.to,r)>0)||c>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?0>=e3(u.from,n):0>e3(u.from,n))))return!0}}}function tT(e){for(var t;t=tL(e,!0);)e=t.find(-1,!0).line;return e}function tM(e,t){var r=e_(e,t),n=tT(r);return r==n?t:eQ(n)}function tN(e,t){if(t>e.lastLine())return t;var r,n=e_(e,t);if(!tO(e,n))return t;for(;r=tL(n,!1);)n=r.find(1,!0).line;return eQ(n)+1}function tO(e,t){var r=tp&&t.markedSpans;if(r){for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed&&(null==n.from||!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&function e(t,r,n){if(null==n.to){var i=n.marker.find(1,!0);return e(t,i.line,tv(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==r.text.length)return!0;for(var o=void 0,l=0;l<r.markedSpans.length;++l)if((o=r.markedSpans[l]).marker.collapsed&&!o.marker.widgetNode&&o.from==n.to&&(null==o.to||o.to!=n.from)&&(o.marker.inclusiveLeft||n.marker.inclusiveRight)&&e(t,r,o))return!0}(e,t,n)))return!0}}function tA(e){e=tT(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 tD(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=tL(n,!0);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=tL(n,!1);){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 tW(e){var t=e.display,r=e.doc;t.maxLine=e_(r,r.first),t.maxLineLength=tD(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=tD(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}var tH=function(e,t,r){this.text=e,tw(this,t),this.height=r?r(this):1}
1;tH.prototype.lineNo=function(){return eQ(this)},eT(tH);var tF={},tP={};function tE(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?tP:tF;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function tI(e,t){var r=R("span",null,null,m?"padding-right: .1px":null),l={pre:R("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var s=0;s<=(t.rest?t.rest.length:0);s++){var a=s?t.rest[s-1]:t.line,u=void 0;l.pos=0,l.addToken=tz,function(e){if(null!=o)return o;var t=E(e,document.createTextNode("AخA")),r=n(t,0,1).getBoundingClientRect(),i=n(t,1,2).getBoundingClientRect();return P(e),!!r&&r.left!=r.right&&(o=i.right-r.right<3)}(e.display.measure)&&(u=em(a,e.doc.direction))&&(l.addToken=function(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 h=void 0,f=0;f<t.length&&(!((h=t[f]).to>u)||!(h.from<=u));f++);if(h.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,h.to-u),i,o,null,s,a),o=null,n=n.slice(h.to-u),u=h.to}}}(l.addToken,u)),l.map=[];var c=t!=e.display.externalMeasured&&eQ(a);(function(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]),tE(r[l+1],t.cm.options));return}for(var s,a,u,c,h,f,d,p=i.length,g=0,v=1,m="",y=0;;){if(y==g){u=c=h=a="",d=null,f=null,y=1/0;for(var b=[],w=void 0,x=0;x<n.length;++x){var C=n[x],S=C.marker;if("bookmark"==S.type&&C.from==g&&S.widgetNode)b.push(S);else if(C.from<=g&&(null==C.to||C.to>g||S.collapsed&&C.to==g&&C.from==g)){if(null!=C.to&&C.to!=g&&y>C.to&&(y=C.to,c=""),S.className&&(u+=" "+S.className),S.css&&(a=(a?a+";":"")+S.css),S.startStyle&&C.from==g&&(h+=" "+S.startStyle),S.endStyle&&C.to==y&&(w||(w=[])).push(S.endStyle,C.to),S.title&&((d||(d={})).title=S.title),S.attributes)for(var L in S.attributes)(d||(d={}))[L]=S.attributes[L];S.collapsed&&(!f||0>tS(f.marker,S))&&(f=C)}else C.from>g&&y>C.from&&(y=C.from)}if(w)for(var k=0;k<w.length;k+=2)w[k+1]==y&&(c+=" "+w[k]);if(!f||f.from==g)for(var T=0;T<b.length;++T)tB(t,0,b[T]);if(f&&(f.from||0)==g){if(tB(t,(null==f.to?p+1:f.to)-g,f.marker,null==f.from),null==f.to)return;f.to==g&&(f=!1)}}if(g>=p)break;for(var M=Math.min(p,y);;){if(m){var N=g+m.length;if(!f){var O=N>M?m.slice(0,M-g):m;t.addToken(t,O,s?s+u:u,h,g+O.length==y?c:"",a,d)}if(N>=M){m=m.slice(M-g),g=M;break}g=N,h=""}m=i.slice(o,o=r[v++]),s=tE(r[v++],t.cm.options)}}})(a,l,ti(e,a,c)),a.styleClasses&&(a.styleClasses.bgClass&&(l.bgClass=U(a.styleClasses.bgClass,l.bgClass||"")),a.styleClasses.textClass&&(l.textClass=U(a.styleClasses.textClass,l.textClass||""))),0==l.map.length&&l.map.push(0,0,l.content.appendChild(function(e){if(null==i){var t=I("span","​");E(e,I("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(i=t.offsetWidth<=1&&t.offsetHeight>2&&!(g&&v<8))}var r=i?I("span","​"):I("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}(e.display.measure))),0==s?(t.measure.map=l.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(l.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(m){var h=l.content.lastChild;(/\bcm-tab\b/.test(h.className)||h.querySelector&&h.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return eC(e,"renderLine",e,t.line,l.pre),l.pre.className&&(l.textClass=U(l.pre.className,l.textClass||"")),l}function tR(e){var t=I("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function tz(e,t,r,n,i,o,l){if(t){var s,a=e.splitSpaces?function(e,t){if(e.length>1&&!/  /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "==o&&r&&(i==e.length-1||32==e.charCodeAt(i+1))&&(o="\xa0"),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,u=e.cm.state.specialChars,c=!1;if(u.test(t)){s=document.createDocumentFragment();for(var h=0;;){u.lastIndex=h;var f=u.exec(t),d=f?f.index-h:t.length-h;if(d){var p=document.createTextNode(a.slice(h,h+d));g&&v<9?s.appendChild(I("span",[p])):s.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!f)break;h+=d+1;var m=void 0;if("	"==f[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(m=s.appendChild(I("span",et(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","	"),e.col+=b}else"\r"==f[0]||"\n"==f[0]?(m=s.appendChild(I("span","\r"==f[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",f[0]):((m=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),g&&v<9?s.appendChild(I("span",[m])):s.appendChild(m)),e.col+=1;e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,s=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,s),g&&v<9&&(c=!0),e.pos+=t.length;
vendor: 4,512 bytes, line 1
1if(e.trailingSpace=32==a.charCodeAt(t.length-1),r||n||i||c||o||l){var w=r||"";n&&(w+=n),i&&(w+=i);var x=I("span",[s],w,o);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,l[C]);return e.content.appendChild(x)}e.content.appendChild(s)}}function tB(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 tG(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=tL(e,!1);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?eQ(er(this.rest))-r+1:1,this.node=this.text=null,this.hidden=tO(e,t)}function tU(e,t,r){for(var n,i=[],o=t;o<r;o=n){var l=new tG(e.doc,e_(e.doc,o),o);n=o+l.size,i.push(l)}return i}var tV=null,tK=null;function tj(e,t){var r=ew(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);tV?n=tV.delayedCallbacks:tK?n=tK:(n=tK=[],setTimeout(tX,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},l=0;l<r.length;++l)o(l)}}function tX(){var e=tK;tK=null;for(var t=0;t<e.length;++t)e[t]()}function tY(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?function(e,t){var r=t.text.className,n=t$(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,tq(e,t)):r&&(t.text.className=r)}(e,t):"gutter"==o?tZ(e,t,r,n):"class"==o?tq(e,t):"widget"==o&&function(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);tQ(e,t,r)}(e,t,n)}t.changes=null}function t_(e){return e.node==e.text&&(e.node=I("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),g&&v<8&&(e.node.style.zIndex=2)),e.node}function t$(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):tI(e,t)}function tq(e,t){(function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=t_(t);t.background=n.insertBefore(I("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}})(e,t),t.line.wrapClass?t_(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 tZ(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=t_(t);t.gutterBackground=I("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=t_(t),s=t.gutter=I("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(I("div",e1(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(I("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function tQ(e,t,r){if(tJ(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)tJ(e,t.rest[n],t,r,!1)}function tJ(e,t,r,n,i){if(t.widgets)for(var o=t_(r),l=0,s=t.widgets;l<s.length;++l){var a=s[l],u=I("div",[a.node],"CodeMirror-linewidget"+(a.className?" "+a.className:""));a.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),function(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);
1var 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"))}(a,u,r,n),e.display.input.setUneditable(u),i&&a.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),tj(a,"redraw")}}function t0(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!z(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,I("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function t1(e,t){for(var r=eD(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 t2(e){return e.lineSpace.offsetTop}function t3(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function t5(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=E(e.measure,I("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 t9(e){return 50-e.display.nativeBarWidth}function t6(e){return e.display.scroller.clientWidth-t9(e)-e.display.barWidth}function t4(e){return e.display.scroller.clientHeight-t9(e)-e.display.barHeight}function t8(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 t7(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[rM(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function re(e,t){var r,n,i,o,l=eQ(t),s=t7(e,l);s&&!s.text?s=null:s&&s.changes&&(tY(e,s,l,rC(e)),e.curOp.forceUpdate=!0),s||(n=eQ(r=tT(r=t)),(i=e.display.externalMeasured=new tG(e.doc,r,n)).lineN=n,o=i.built=tI(e,i),i.text=o.pre,E(e.display.lineMeasure,o.pre),s=i);var a=t8(s,t,l);return{line:t,view:s,rect:null,map:a.map,cache:a.cache,before:a.before,hasHeights:!1}}function rt(e,t,r,i,o){t.before&&(r=-1);var l,s=r+(i||"");return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var n=e.options.lineWrapping,i=n&&t6(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],u=l[s+1];Math.abs(a.bottom-u.bottom)>2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(l=function(e,t,r,i){var o,l,s=rn(t.map,r,i),a=s.node,u=s.start,c=s.end,h=s.collapse;if(3==a.nodeType){for(var f=0;f<4;f++){for(;u&&eh(t.line.text.charAt(s.coverStart+u));)--u;for(;s.coverStart+c<s.coverEnd&&eh(t.line.text.charAt(s.coverStart+c));)++c;if((o=g&&v<9&&0==u&&c==s.coverEnd-s.coverStart?a.parentNode.getBoundingClientRect():function(e,t){var r=rr;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}(n(a,u,c).getClientRects(),i)).left||o.right||0==u)break;c=u,u-=1,h="right"}g&&v<11&&(o=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=eI)return eI;var t=E(e,I("span","x")),r=t.getBoundingClientRect(),i=n(t,0,1).getBoundingClientRect();return eI=Math.abs(r.left-i.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*i,bottom:t.bottom*i}}(e.display.measure,o))}else u>0&&(h=i="right"),o=e.options.lineWrapping&&(l=a.getClientRects()).length>1?l["right"==i?l.length-1:0]:a.getBoundingClientRect();if(g&&v<9&&!u&&(!o||!o.left&&!o.right)){var d=a.parentNode.getClientRects()[0];
vendor: 4,371 bytes, line 1
1o=d?{left:d.left,right:d.left+rx(e.display),top:d.top,bottom:d.bottom}:rr}for(var p=o.top-t.rect.top,m=o.bottom-t.rect.top,y=(p+m)/2,b=t.view.measure.heights,w=0;w<b.length-1&&!(y<b[w]);w++);var x=w?b[w-1]:0,C=b[w],S={left:("right"==h?o.right:o.left)-t.rect.left,right:("left"==h?o.left:o.right)-t.rect.left,top:x,bottom:C};return o.left||o.right||(S.bogus=!0),e.options.singleCursorHeightPerLine||(S.rtop=p,S.rbottom=m),S}(e,t,r,i)).bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:o?l.rtop:l.top,bottom:o?l.rbottom:l.bottom}}var rr={left:0,right:0,top:0,bottom:0};function rn(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 ri(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 ro(e){e.display.externalMeasure=null,P(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ri(e.display.view[t])}function rl(e){ro(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function rs(){return b&&k?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ra(){return b&&k?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ru(e){var t=tT(e).widgets,r=0;if(t)for(var n=0;n<t.length;++n)t[n].above&&(r+=t0(t[n]));return r}function rc(e,t,r,n,i){if(!i){var o=ru(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=tA(t);if("local"==n?l+=t2(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:ra());var a=s.left+("window"==n?0:rs());r.left+=a,r.right+=a}return r.top+=l,r.bottom+=l,r}function rh(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=rs(),i-=ra();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 rf(e,t,r,n,i){var o,l;return n||(n=e_(e.doc,t.line)),rc(e,n,(o=n,l=t.ch,rt(e,re(e,o),l,i)),r)}function rd(e,t,r,n,i,o){function l(t,l){var s=rt(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,rc(e,n,s,r)}n=n||e_(e.doc,t.line),i||(i=re(e,n));var s=em(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 h=eg(s,a,u),f=ep,d=c(a,h,"before"==u);return null!=f&&(d.other=c(a,f,"before"!=u)),d}function rp(e,t){var r=0;t=e7(e.doc,t),e.options.lineWrapping||(r=rx(e.display)*t.ch);var n=e_(e.doc,t.line),i=tA(n)+t2(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function rg(e,t,r,n,i){var o=e2(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function rv(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return rg(n.first,0,null,-1,-1);var i=eJ(n,r),o=n.first+n.size-1;if(i>o)return rg(n.first+n.size-1,e_(n,o).text.length,null,1,1);t<0&&(t=0);for(var l=e_(n,i);;){var s=function(e,t,r,n,i){i-=tA(t);var o=re(e,t),l=ru(t),s=0,a=t.text.length,u=!0,c=em(t,e.doc.direction);if(c){var h=(e.options.lineWrapping?function(e,t,r,n,i,o,l){var s=rm(e,t,n,l),a=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,h=null,f=0;f<i.length;f++){var d=i[f];if(!(d.from>=u)&&!(d.to<=a)){var p=rt(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||h>g)&&(c=d,h=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(e,t,r,n,i,o,l){var s=ed(function(s){var a=i[s],u=1!=a.level;return rb(rd(e,e2(r,u?a.to:a.from,u?"before":"after"),"line",t,n
1),o,l,!0)},0,i.length-1),a=i[s];if(s>0){var u=1!=a.level,c=rd(e,e2(r,u?a.from:a.to,u?"after":"before"),"line",t,n);rb(c,o,l,!0)&&c.top>l&&(a=i[s-1])}return a})(e,t,r,o,c,n,i);s=(u=1!=h.level)?h.from:h.to-1,a=u?h.to:h.from-1}var f,d,p=null,g=null,v=ed(function(t){var r=rt(e,o,t);return r.top+=l,r.bottom+=l,!!rb(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)},s,a),m=!1;if(g){var y=n-g.left<g.right-n,b=y==u;v=p+(b?0:1),d=b?"after":"before",f=y?g.left:g.right}else{!u&&(v==a||v==s)&&v++,d=0==v?"after":v==t.text.length?"before":rt(e,o,v-(u?1:0)).bottom+l<=i==u?"after":"before";var w=rd(e,e2(r,v,d),"line",t,o);f=w.left,m=i<w.top?-1:i>=w.bottom?1:0}return rg(r,v=ef(t.text,v,1),d,m,n-f)}(e,l,i,t,r),a=function(e,t){var r,n=tp&&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>tS(r,o.marker))&&(r=o.marker)}return r}(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=e_(n,i=u.line)}}function rm(e,t,r,n){n-=ru(t);var i=t.text.length,o=ed(function(t){return rt(e,r,t-1).bottom<=n},i,0);return i=ed(function(t){return rt(e,r,t).top>n},o,i),{begin:o,end:i}}function ry(e,t,r,n){r||(r=re(e,t));var i=rc(e,t,rt(e,r,n),"line").top;return rm(e,t,r,i)}function rb(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function rw(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==l){l=I("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)l.appendChild(document.createTextNode("x")),l.appendChild(I("br"));l.appendChild(document.createTextNode("x"))}E(e.measure,l);var r=l.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),P(e.measure),r||1}function rx(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=I("span","xxxxxxxxxx"),r=I("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 rC(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:rS(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function rS(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function rL(e){var t=rw(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/rx(e.display)-3);return function(i){if(tO(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 rk(e){var t=e.doc,r=rL(e);t.iter(function(e){var t=r(e);t!=e.height&&eZ(e,t)})}function rT(e,t,r,n){var i=e.display;if(!r&&"true"==eD(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(e){return null}var a,u=rv(e,o,l);if(n&&u.xRel>0&&(a=e_(e.doc,u.line).text).length==u.ch){var c=X(a,a.length,e.options.tabSize)-a.length;u=e2(u.line,Math.max(0,Math.round((o-t5(e.display).left)/rx(e.display))-c))}return u}function rM(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 rN(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)tp&&tM(e.doc,t)<i.viewTo&&rA(e);else if(r<=i.viewFrom)tp&&tN(e.doc,r+n)>i.viewFrom?rA(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)rA(e);else if(t<=i.viewFrom){var o=rD(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):rA(e)}else if(r>=i.viewTo){var l=rD(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):rA(e)}else{var s=rD(e,t,t,-1),a=rD(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(tU(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):rA(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function rO(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[rM(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==_(l,r)&&l.push(r)}}}function rA(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function rD(e,t,r,n){var i,o=rM(e,t),l=e.display.view;if(!tp||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(;tM(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}}
1function rW(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 rH(e){e.display.input.showSelection(e.display.input.prepareSelection())}function rF(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&&rP(e,c,i)}else(u||e.options.showCursorWhenSelecting)&&rP(e,a.head,i);u||function(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),l=t5(e.display),s=l.left,a=Math.max(n.sizerWidth,t6(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(I("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 h(t,r,n){var o,l,h=e_(i,t),f=h.text.length;function d(r,n){return rf(e,e2(t,r),"div",h,n)}function p(t,r,n){var i=ry(e,h,null,t),o="ltr"==r==("after"==n)?"left":"right";return d("after"==n?i.begin:i.end-(/\s/.test(h.text.charAt(i.end-1))?2:1),o)[o]}var g=em(h,i.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(g,r||0,null==n?f:n,function(e,t,i,h){var v,m,y,b,w="ltr"==i,x=d(e,w?"left":"right"),C=d(t-1,w?"right":"left"),S=null==r&&0==e,L=null==n&&t==f,k=0==h,T=!g||h==g.length-1;if(C.top-x.top<=3){var M=(u?S:L)&&k,N=(u?L:S)&&T,O=M?s:(w?x:C).left,A=N?a:(w?C:x).right;c(O,x.top,A-O,x.bottom)}else w?(v=u&&S&&k?s:x.left,m=u?a:p(e,i,"before"),y=u?s:p(t,i,"after"),b=u&&L&&T?a:C.right):(v=u?p(e,i,"before"):s,m=!u&&S&&k?a:x.right,y=!u&&L&&T?s:C.left,b=u?p(t,i,"after"):a),c(v,x.top,m-v,x.bottom),x.bottom<C.top&&c(s,x.bottom,null,C.top),c(y,C.top,b-y,C.bottom);(!o||0>rE(x,o))&&(o=x),0>rE(C,o)&&(o=C),(!l||0>rE(x,l))&&(l=x),0>rE(C,l)&&(l=C)}),{start:o,end:l}}var f=t.from(),d=t.to();if(f.line==d.line)h(f.line,f.ch,d.ch);else{var p=e_(i,f.line),g=e_(i,d.line),v=tT(p)==tT(g),m=h(f.line,f.ch,v?p.text.length+1:null).end,y=h(d.line,v?0:null,d.ch).start;v&&(m.top<y.top-2?(c(m.right,m.top,null,m.bottom),c(s,y.top,y.left,y.bottom)):c(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&c(s,m.bottom,null,y.top)}r.appendChild(o)}(e,a,o)}}return n}function rP(e,t,r){var n=rd(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(I("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=rf(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(I("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 rE(e,t){return e.top-t.top||e.left-t.left}function rI(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()||rG(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function rR(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||rB(e))}function rz(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&rG(e))},100)}function rB(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(eC(e,"focus",e,t),e.state.focused=!0,G(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.dis
vendor: 4,853 bytes, line 1
1play.input.reset(),m&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),rI(e))}function rG(e,t){e.state.delayingBlurEvent||(e.state.focused&&(eC(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 rU(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,g&&v<8){var h=s.node.offsetTop+s.node.offsetHeight;u=h-r,r=h}else{var f=s.node.getBoundingClientRect();u=f.bottom-f.top,!a&&s.text.firstChild&&(c=s.text.firstChild.getBoundingClientRect().right-f.left-1)}var d=s.line.height-u;if((d>.005||d<-.005)&&(i<n&&(o-=d),eZ(s.line,u),rV(s.line),s.rest))for(var p=0;p<s.rest.length;p++)rV(s.rest[p]);if(c>e.display.sizerWidth){var m=Math.ceil(c/rx(e.display));m>e.display.maxLineLength&&(e.display.maxLineLength=m,e.display.maxLine=s.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function rV(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 rK(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-t2(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=eJ(t,n),l=eJ(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;s<o?(o=s,l=eJ(t,tA(e_(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=eJ(t,tA(e_(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function rj(e,t){var r=e.display,n=rw(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=t4(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+t3(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 h=e.options.fixedGutter?0:r.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft-h,d=t6(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<f?l.scrollLeft=Math.max(0,t.left+h-(p?0:10)):t.right>d+f-3&&(l.scrollLeft=t.right+(p?0:10)-d),l}function rX(e,t){null!=t&&(r$(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function rY(e){r$(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function r_(e,t,r){(null!=t||null!=r)&&r$(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function r$(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=rp(e,t.from),n=rp(e,t.to);rq(e,r,n,t.margin)}}function rq(e,t,r,n){var i=rj(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});r_(e,i.scrollLeft,i.scrollTop)}function rZ(e,t){2>Math.abs(e.doc.scrollTop-t)||(h||nu(e,{top:t}),rQ(e,t,!0),h&&nu(e),ni(e,100))}function rQ(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 rJ(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,nf(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function r0(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+t3(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+t9(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var r1=function(e,t,r){this.cm=r;var n=this.vert=I("div",[I("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=I("div",[I("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),eb(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),eb(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,g&&v<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};r1.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=t?n+"px":"0";var i=e.viewHeight-(t?n:0);
1this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},r1.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},r1.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},r1.prototype.zeroWidthHack=function(){this.horiz.style.height=this.vert.style.width=M&&!C?"12px":"18px",this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Y,this.disableVert=new Y},r1.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)})},r1.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var r2=function(){};function r3(e,t){t||(t=r0(e));var r=e.display.barWidth,n=e.display.barHeight;r5(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&rU(e),r5(e,r0(e)),r=e.display.barWidth,n=e.display.barHeight}function r5(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}r2.prototype.update=function(){return{bottom:0,right:0}},r2.prototype.setScrollLeft=function(){},r2.prototype.setScrollTop=function(){},r2.prototype.clear=function(){};var r9={native:r1,null:r2};function r6(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new r9[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),eb(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?rJ(e,t):rZ(e,t)},e),e.display.scrollbars.addClass&&G(e.display.wrapper,e.display.scrollbars.addClass)}var r4=0;function r8(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++r4,markArrays:null},t=e.curOp,tV?tV.ops.push(t):t.ownsGroup=tV={ops:[t],delayedCallbacks:[]}}function r7(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{tV=null,t(r)}}(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;(function(e){for(var t,r=e.ops,n=0;n<r.length;n++)(function(e){var t=e.cm,r=t.display;
1(function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=t9(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=t9(e)+"px",t.scrollbarsClipped=!0)})(t),e.updateMaxLine&&tW(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new nl(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)})(r[n]);for(var i=0;i<r.length;i++)(t=r[i]).updatedDisplay=t.mustUpdate&&ns(t.cm,t.update);for(var o=0;o<r.length;o++)(function(e){var t,r,n=e.cm,i=n.display;e.updatedDisplay&&rU(n),e.barMeasure=r0(n),i.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=(t=i.maxLine,r=i.maxLine.text.length,rt(n,re(n,t),r,void 0)).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+t9(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-t6(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())})(r[o]);for(var l=0;l<r.length;l++)(function(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&rJ(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==B();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&r3(t,e.barMeasure),e.updatedDisplay&&nh(t,e.barMeasure),e.selectionChanged&&rI(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&rR(e.cm)})(r[l]);for(var s=0;s<r.length;s++)(function(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&na(t,e.update),null!=r.wheelStartX&&(null!=e.scrollTop||null!=e.scrollLeft||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&rQ(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&rJ(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=function(e,t,r,n){null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==t.sticky?e2(t.line,t.ch+1,"before"):t,t=t.ch?e2(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var i,o=0;o<5;o++){var l=!1,s=rd(e,t),a=r&&r!=t?rd(e,r):s,u=rj(e,i={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-n,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+n}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(rZ(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(rJ(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(l=!0)),!l)break}return i}(t,e7(n,e.scrollToPos.from),e7(n,e.scrollToPos.to),e.scrollToPos.margin);!function(e,t){if(!eS(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!S){var o=I("div","​",null,"position: absolute;\n                         top: "+(t.top-r.viewOffset-t2(e.display))+"px;\n                         height: "+(t.bottom-t.top+t9(e)+r.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,i)}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||eC(o[s],"hide");if(l)for(var a=0;a<l.length;++a)l[a].lines.length&&eC(l[a],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&eC(t,"changes",t,e.changeObjs),e.update&&e.update.finish()})(r[s])})(e)})}function ne(e,t){if(e.curOp)return t();r8(e);try{return t()}finally{r7(e)}}function nt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);r8(e);try{return t.apply(e,arguments)}finally{r7(e)}}}function nr(e){return function(){if(this.curOp)return e.apply(this,arguments);r8(this);try{return e.apply(this,arguments)}finally{r7(this)}}}function nn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);r8(t);try{return e.apply(this,arguments)}finally{r7(t)}}}function ni(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,K(no,e))}function no(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=to(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if
vendor: 4,204 bytes, line 1
1(n.line>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength?eK(t.mode,n.state):null,a=tn(e,o,n,!0);s&&(n.state=s),o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&f<l.length;++f)h=l[f]!=o.styles[f];h&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&tl(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return ni(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&ne(e,function(){for(var t=0;t<i.length;t++)rO(e,i[t],"text")})}}var nl=function(e,t,r){var n=e.display;this.viewport=t,this.visible=rK(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=t6(e),this.force=r,this.dims=rC(e),this.events=[]};function ns(e,t){var r,n,i,o=e.display,l=e.doc;if(t.editorIsHidden)return rA(e),!1;if(!t.force&&t.visible.from>=o.viewFrom&&t.visible.to<=o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>=o.viewTo)&&o.renderedView==o.view&&0==rW(e))return!1;nd(e)&&(rA(e),t.dims=rC(e));var s=l.first+l.size,a=Math.max(t.visible.from-e.options.viewportMargin,l.first),u=Math.min(s,t.visible.to+e.options.viewportMargin);o.viewFrom<a&&a-o.viewFrom<20&&(a=Math.max(l.first,o.viewFrom)),o.viewTo>u&&o.viewTo-u<20&&(u=Math.min(s,o.viewTo)),tp&&(a=tM(e.doc,a),u=tN(e.doc,u));var c=a!=o.viewFrom||u!=o.viewTo||o.lastWrapHeight!=t.wrapperHeight||o.lastWrapWidth!=t.wrapperWidth;r=a,n=u,0==(i=e.display).view.length||r>=i.viewTo||n<=i.viewFrom?(i.view=tU(e,r,n),i.viewFrom=r):(i.viewFrom>r?i.view=tU(e,r,i.viewFrom).concat(i.view):i.viewFrom<r&&(i.view=i.view.slice(rM(e,r))),i.viewFrom=r,i.viewTo<n?i.view=i.view.concat(tU(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,rM(e,n)))),i.viewTo=n,o.viewOffset=tA(e_(e.doc,o.viewFrom)),e.display.mover.style.top=o.viewOffset+"px";var h=rW(e);if(!c&&0==h&&!t.force&&o.renderedView==o.view&&(null==o.updateLineNumbers||o.updateLineNumbers>=o.viewTo))return!1;var f=function(e){if(e.hasFocus())return null;var t=B();if(!t||!z(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&z(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return h>4&&(o.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,l=o.firstChild;function s(t){var r=t.nextSibling;return m&&M&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var a=n.view,u=n.viewFrom,c=0;c<a.length;c++){var h=a[c];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;l!=h.node;)l=s(l);var f=i&&null!=t&&t<=u&&h.lineNumber;h.changes&&(_(h.changes,"gutter")>-1&&(f=!1),tY(e,h,u,r)),f&&(P(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(e1(e.options,u)))),l=h.node.nextSibling}else{var d=function(e,t,r,n){var i=t$(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),tq(e,t),tZ(e,t,r,n),tQ(e,t,n),t.node}(e,h,u,r);o.insertBefore(d,l)}u+=h.size}for(;l;)l=s(l)}(e,o.updateLineNumbers,t.dims),h>4&&(o.lineDiv.style.display=""),o.renderedView=o.view,function(e){if(e&&e.activeElt&&e.activeElt!=B()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&z(document.body,e.anchorNode)&&z(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(f),P(o.cursorDiv),P(o.selectionDiv),o.gutters.style.height=o.sizer.style.minHeight=0,c&&(o.lastWrapHeight=t.wrapperHeight,o.lastWrapWidth=t.wrapperWidth,ni(e,400)),o.updateLineNumbers=null,!0}function na(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=t6(e))n&&(t.visible=rK(e.display,e.doc,r));
1else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+t3(e.display)-t4(e),r.top)}),t.visible=rK(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ns(e,t))break;rU(e);var i=r0(e);rH(e),r3(e,i),nh(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function nu(e,t){var r=new nl(e,t);if(ns(e,r)){rU(e),na(e,r);var n=r0(e);rH(e),r3(e,n),nh(e,n),r.finish()}}function nc(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",tj(e,"gutterChanged",e)}function nh(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+t9(e)+"px"}function nf(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=rS(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&(r[l].gutter&&(r[l].gutter.style.left=o),r[l].gutterBackground&&(r[l].gutterBackground.style.left=o));var s=r[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function nd(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=e1(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(I("div",[I("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",nc(e.display),!0}return!1}function np(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],l=null;if("string"!=typeof o&&(l=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;n=!0}r.push({className:o,style:l})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function ng(e){var t=e.gutters,r=e.gutterSpecs;P(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,l=i.style,s=t.appendChild(I("div",null,"CodeMirror-gutter "+o));l&&(s.style.cssText=l),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",nc(e)}function nv(e){ng(e.display),rN(e),nf(e)}function nm(e,t,r,n){this.input=r,this.scrollbarFiller=I("div",null,"CodeMirror-scrollbar-filler"),this.scrollbarFiller.setAttribute("cm-not-content","true"),this.gutterFiller=I("div",null,"CodeMirror-gutter-filler"),this.gutterFiller.setAttribute("cm-not-content","true"),this.lineDiv=R("div",null,"CodeMirror-code"),this.selectionDiv=I("div",null,null,"position: relative; z-index: 1"),this.cursorDiv=I("div",null,"CodeMirror-cursors"),this.measure=I("div",null,"CodeMirror-measure"),this.lineMeasure=I("div",null,"CodeMirror-measure"),this.lineSpace=R("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");var i=R("div",[this.lineSpace],"CodeMirror-lines");this.mover=I("div",[i],null,"position: relative"),this.sizer=I("div",[this.mover],"CodeMirror-sizer"),this.sizerWidth=null,this.heightForcer=I("div",null,null,"position: absolute; height: 50px; width: 1px;"),this.gutters=I("div",null,"CodeMirror-gutters"),this.lineGutter=null,this.scroller=I("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll"),this.scroller.setAttribute("tabIndex","-1"),this.wrapper=I("div",[this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror"),this.wrapper.setAttribute("translate","no"),g&&v<8&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0),m||h&&T||(this.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(this.wrapper):e(this.wrapper)),this.viewFrom=this.viewTo=t.first,this.reportedViewFrom=this.reportedViewTo=t.first,this.view=[],this.renderedView=null,this.externalMeasured=null,this.viewOffset=0,this.lastWrapHeight=this.lastWrapWidth=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.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null,this.maxLine=null,this.maxLineLength=0,this.maxLineChanged=!1,this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null,this.shift=!1,this.selForContextMenu=null,this.activeTouch=null,this.gutterSpecs=np(n.gutters,n.lineNumbers),ng(this),r.init(this)}nl.prototype.signal=function(e,t){ek(e,t)&&this.events.push(arguments)},nl.prototype.finish=function(){for(var e=0;e<this.events.length;e++)eC.apply(null,this.events[e])};var ny=0,nb=null;function nw(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function nx(e,t){var r=nw(t),n=r.x,i=r.y,o=nb;0===t.deltaMode&&(n=t.deltaX,i=t.deltaY,o=1);var l=e.display,s=l.scroller,a=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(n&&a||i&&u){if(i&&M&&m){e:for(var c=t.target,f=l.view;c!=s;c=c.parentNode)for(var d=0;d<f.length;d++)if(f[d].node==c){e.display.currentWheelTarget=c;break e}}if(n&&!h&&!w&&null!=o){i&&u&&rZ(e,Math.max(0,s.scrollTop+i*o)),rJ(e,Math.max(0,s.scrollLeft+n*o)),(!i||i&&u)&&eM(t),l.wheelStartX=null;return}if(i&&null!=o){var p=i*o,g=e.doc.scrollTop,v=g+l.wrapper.clientHeight;p<0?g=Math.max(0,g+p-50):v=Math.min(e.doc.height,v+p+50),nu(e,{top:g,bottom:v})}ny<20&&0!==t.deltaMode&&(null==l.wheelStartX?(l.wheelStartX=s.scrollLeft,l.wheelStartY=s.scrollTop,l.wheelDX=n,l.wheelDY=i,setTimeout(function(){if(null!=l.wheelStartX){var e=s.scrollLeft-l.wheelStartX,t=s.scrollTop-l.wheelStartY,r=t&&l.wheelDY&&t/l.wheelDY||e&&l.wheelDX&&e/l.wheelDX;l.wheelStartX=l.wheelStartY=null,r&&(nb=(nb*ny+r)/(ny+1),++ny)}},200)):(l.wheelDX+=n,l.wheelDY+=i))}}g?nb=-.53:h?nb=15:b?nb=-.7:x&&(nb=-1/3);var nC=function(e,t){this.ranges=e,this.primIndex=t};nC.prototype.primary=function(){return this.ranges[this.primIndex]},nC.prototype.equals=function(e){if(e==this)return!0;
1if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!e5(r.anchor,n.anchor)||!e5(r.head,n.head))return!1}return!0},nC.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new nS(e9(this.ranges[t].anchor),e9(this.ranges[t].head));return new nC(e,this.primIndex)},nC.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},nC.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(e3(t,n.from())>=0&&0>=e3(e,n.to()))return r}return -1};var nS=function(e,t){this.anchor=e,this.head=t};function nL(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(e,t){return e3(e.from(),t.from())}),r=_(t,i);for(var o=1;o<t.length;o++){var l=t[o],s=t[o-1],a=e3(s.to(),l.from());if(n&&!l.empty()?a>0:a>=0){var u=e4(s.from(),l.from()),c=e6(s.to(),l.to()),h=s.empty()?l.from()==l.head:s.from()==s.head;o<=r&&--r,t.splice(--o,2,new nS(h?c:u,h?u:c))}}return new nC(t,r)}function nk(e,t){return new nC([new nS(e,t||e)],0)}function nT(e){return e.text?e2(e.from.line+e.text.length-1,er(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function nM(e,t){if(0>e3(e,t.from))return e;if(0>=e3(e,t.to))return nT(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=nT(t).ch-t.to.ch),e2(r,n)}function nN(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new nS(nM(i.anchor,t),nM(i.head,t)))}return nL(e.cm,r,e.sel.primIndex)}function nO(e,t,r){return e.line==t.line?e2(r.line,e.ch-t.ch+r.ch):e2(r.line+(e.line-t.line),e.ch)}function nA(e){e.doc.mode=eU(e.options,e.doc.modeOption),nD(e)}function nD(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ni(e,100),e.state.modeGen++,e.curOp&&rN(e)}function nW(e,t){return 0==t.from.ch&&0==t.to.ch&&""==er(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function nH(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){var o;e.text=r,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),tb(e),tw(e,i),(o=n?n(e):1)!=e.height&&eZ(e,o),tj(e,"change",e,t)}function l(e,t){for(var r=[],o=e;o<t;++o)r.push(new tH(u[o],i(o),n));return r}var s=t.from,a=t.to,u=t.text,c=e_(e,s.line),h=e_(e,a.line),f=er(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(nW(e,t)){var g=l(0,u.length-1);o(h,h.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==h){if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(a.ch),d);else{var v=l(1,u.length-1);v.push(new tH(f+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,v)}}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(h,f+h.text.slice(a.ch),d);var m=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,m)}tj(e,"change",e,t)}function nF(e,t,r){!function e(n,i,o){if(n.linked)for(var l=0;l<n.linked.length;++l){var s=n.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;(!r||a)&&(t(s.doc,a),e(s.doc,n,a))}}}(e,null,!0)}function nP(e,t){if(t.cm)throw Error("This document is already in use.");e.doc=t,t.cm=e,rk(e),nA(e),nE(e),e.options.direction=t.direction,e.options.lineWrapping||tW(e),e.options.mode=t.modeOption,rN(e)}function nE(e){("rtl"==e.doc.direction?G:F)(e.display.lineDiv,"CodeMirror-rtl")}function nI(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function nR(e,t){var r={from:e9(t.from),to:nT(t),text:e$(e,t.from,t.to)};return nU(e,r,t.from.line,t.to.line+1),nF(e,function(e){return nU(e,r,t.from.line,t.to.line+1)},!0),r}function nz(e){for(;e.length;)if(er(e).ranges)e.pop();else break}function nB(e,t,r,n){var i,o=e.history;o.undone.length=0;var l,s=+new Date;if((o.lastOp==n||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(l=o.lastOp==n?(nz(o.done),er(o.done)):o.done.length&&!er(o.done).ranges?er(o.done):o.done.length>1&&!o.done[o.done.length-2].ranges?(o.done.pop(),er(o.done)):void 0))i=er(l.changes),0==e3(t.from,t.to)&&0==e3(t.from,i.to)?i.to=nT(t):l.changes.push(nR(e,t));else{var a=er(o.done);for(a&&a.ranges||nG(e.sel,o.done),l={changes:[nR(e,t)],generation:o.generation},o.done.push(l);o.done.length>
1o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(r),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,i||eC(e,"historyAdded")}function nG(e,t){var r=er(t);r&&r.ranges&&r.equals(e)||t.push(e)}function nU(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function nV(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(function(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}(r[i]));return n}(e,t),n=tm(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)t:for(var s=0;s<l.length;++s){for(var a=l[s],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue t;o.push(a)}else l&&(r[i]=l)}return r}function nK(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){n.push(r?nC.prototype.deepCopy.call(o):o);continue}var l=o.changes,s=[];n.push({changes:s});for(var a=0;a<l.length;++a){var u=l[a],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&_(t,Number(c[1]))>-1&&(er(s)[h]=u[h],delete u[h])}}return n}function nj(e,t,r,n){if(!n)return new nS(r||t,t);var i=e.anchor;if(r){var o=0>e3(t,i);o!=0>e3(r,i)?(i=t,t=r):o!=0>e3(t,r)&&(t=r)}return new nS(i,t)}function nX(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),nq(e,new nC([nj(e.sel.primary(),t,r,i)],0),n)}function nY(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=nj(e.sel.ranges[o],t[o],null,i);var l=nL(e.cm,n,e.sel.primIndex);nq(e,l,r)}function n_(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,nq(e,nL(e.cm,i,e.sel.primIndex),n)}function n$(e,t,r){var n=e.history.done,i=er(n);i&&i.ranges?(n[n.length-1]=t,nZ(e,t,r)):nq(e,t,r)}function nq(e,t,r){var n,i,o,l,s,a,u,c;nZ(e,t,r),n=e,i=e.sel,o=e.cm?e.cm.curOp.id:NaN,l=r,u=n.history,c=l&&l.origin,o==u.lastSelOp||c&&u.lastSelOrigin==c&&(u.lastModTime==u.lastSelTime&&u.lastOrigin==c||(s=er(u.done),"*"==(a=c.charAt(0))||"+"==a&&s.ranges.length==i.ranges.length&&s.somethingSelected()==i.somethingSelected()&&new Date-n.history.lastSelTime<=(n.cm?n.cm.options.historyEventDelay:500)))?u.done[u.done.length-1]=i:nG(i,u.done),u.lastSelTime=+new Date,u.lastSelOrigin=c,u.lastSelOp=o,l&&!1!==l.clearRedo&&nz(u.undone)}function nZ(e,t,r){if(ek(e,"beforeSelectionChange")||e.cm&&ek(e.cm,"beforeSelectionChange")){var n,i;i={ranges:(n=t).ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new nS(e7(e,t[r].anchor),e7(e,t[r].head))},origin:r&&r.origin},eC(e,"beforeSelectionChange",e,i),e.cm&&eC(e.cm,"beforeSelectionChange",e.cm,i),t=i.ranges!=n.ranges?nL(e.cm,i.ranges,i.ranges.length-1):n}var o=r&&r.bias||(0>e3(t.primary().head,e.sel.primary().head)?-1:1);nQ(e,n0(e,t,o,!0)),!(r&&!1===r.scroll)&&e.cm&&"nocursor"!=e.cm.getOption("readOnly")&&rY(e.cm)}function nQ(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,eL(e.cm)),tj(e,"cursorActivity",e))}function nJ(e){nQ(e,n0(e,e.sel,null,!1))}function n0(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=n2(e,l.anchor,s&&s.anchor,r,n),u=n2(e,l.head,s&&s.head,r,n);(i||a!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new nS(a,u))}return i?nL(e.cm,i,t.primIndex):t}function n1(e,t,r,n,i){var o=e_(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker,u="selectLeft"in a?!a.selectLeft:a.inclusiveLeft,c="selectRight"in a?!a.selectRight:a.inclusiveRight;if((null==s.from||(u?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(c?s.to>=t.ch:s.to>t.ch))){if(i&&(eC(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var h=a.find(n<0?1:-1),f=void 0;if((n<0?c:u)&&(h=n3(e,h,-n,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(f=e3(h,r))&&(n<0?f<0:f>0))return n1(e,h,t,n,i)}var d=a.find(n<0?-1:1);return(n<0?u:c)&&(d=n3(e,d,n,d.line==t.line?o:null)),d?n1(e,d,t,n,i):null}}return t}function n2(e,t,r,n,i){var o=n||1;return n1(e,t,r,o,i)||!i&&n1(e,t,r,o,!0)||n1(e,t,r,-o,i)||!i&&n1(e,t,r,-o,!0)||(e.cantEdit=!0,e2(e.first,0))}
1function n3(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?e7(e,e2(t.line-1)):null:r>0&&t.ch==(n||e_(e,t.line)).text.length?t.line<e.first+e.size-1?e2(t.line+1,0):null:new e2(t.line,t.ch+r)}function n5(e){e.setSelection(e2(e.firstLine(),0),e2(e.lastLine()),q)}function n9(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return(r&&(n.update=function(t,r,i,o){t&&(n.from=e7(e,t)),r&&(n.to=e7(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),eC(e,"beforeChange",e,n),e.cm&&eC(e.cm,"beforeChange",e.cm,n),n.canceled)?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function n6(e,t,r){if(e.cm){if(!e.cm.curOp)return nt(e.cm,n6)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(ek(e,"beforeChange")||e.cm&&ek(e.cm,"beforeChange"))||(t=n9(e,t,!0))){var n=td&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;r.readOnly&&(!n||-1==_(n,r))&&(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],s=l.find(0),a=0;a<i.length;++a){var u=i[a];if(!(0>e3(u.to,s.from)||e3(u.from,s.to)>0)){var c=[a,1],h=e3(u.from,s.from),f=e3(u.to,s.to);!(h<0)&&(l.inclusiveLeft||h)||c.push({from:u.from,to:s.from}),!(f>0)&&(l.inclusiveRight||f)||c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)n4(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else n4(e,t)}}function n4(e,t){if(1!=t.text.length||""!=t.text[0]||0!=e3(t.from,t.to)){var r=nN(e,t);nB(e,t,r,e.cm?e.cm.curOp.id:NaN),ie(e,t,r,tm(e,t));var n=[];nF(e,function(e,r){r||-1!=_(n,e.history)||(io(e.history,t),n.push(e.history)),ie(e,t,null,tm(e,t))})}}function n8(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,l=e.sel,s="undo"==t?o.done:o.undone,a="undo"==t?o.undone:o.done,u=0;u<s.length&&(i=s[u],r?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;)if((i=s.pop()).ranges){if(nG(i,a),r&&!i.equals(e.sel)){nq(e,i,{clearRedo:!1});return}l=i}else if(n){s.push(i);return}else break;var c=[];nG(l,a),a.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var h=ek(e,"beforeChange")||e.cm&&ek(e.cm,"beforeChange"),f=i.changes.length-1;f>=0;--f){var d=function(r){var n=i.changes[r];if(n.origin=t,h&&!n9(e,n,!1))return s.length=0,{};c.push(nR(e,n));var o=r?nN(e,n):er(s);ie(e,n,o,nV(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:nT(n)});var l=[];nF(e,function(e,t){t||-1!=_(l,e.history)||(io(e.history,n),l.push(e.history)),ie(e,n,null,nV(e,n))})}(f);if(d)return d.v}}}}function n7(e,t){if(0!=t&&(e.first+=t,e.sel=new nC(en(e.sel.ranges,function(e){return new nS(e2(e.anchor.line+t,e.anchor.ch),e2(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){rN(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)rO(e.cm,n,"gutter")}}function ie(e,t,r,n){if(e.cm&&!e.cm.curOp)return nt(e.cm,ie)(e,t,r,n);if(t.to.line<e.first){n7(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);n7(e,i),t={from:e2(e.first,0),to:e2(t.to.line+i,t.to.ch),text:[er(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:e2(o,e_(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=e$(e,t.from,t.to),r||(r=nN(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=eQ(tT(e_(n,o.line))),n.iter(a,l.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&eL(e),nH(n,t,r,rL(e)),!e.options.lineWrapping&&(n.iter(a,o.line+t.text.length,function(e){var t=tD(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=e_(e,n).stateAfter;if(i&&(!(i instanceof tt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}(n,o.line),ni(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?rN(e):o.line!=l.line||1!=t.text.length||nW(e.doc,t)?rN(e,o.line,l.line+1,u):rO(e,o.line,"text");var c=ek(e,"changes"),h=ek(e,"change");if(h||c){var f={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};
vendor: 4,840 bytes, line 1
1h&&tj(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,n):nH(e,t,n),nZ(e,r,q),e.cantEdit&&n2(e,e2(e.firstLine(),0))&&(e.cantEdit=!1)}}function it(e,t,r,n,i){var o;n||(n=r),0>e3(n,r)&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),n6(e,{from:r,to:n,text:t,origin:i})}function ir(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ii(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)ir(o.ranges[s].anchor,t,r,n),ir(o.ranges[s].head,t,r,n);continue}for(var a=0;a<o.changes.length;++a){var u=o.changes[a];if(r<u.from.line)u.from=e2(u.from.line+n,u.from.ch),u.to=e2(u.to.line+n,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}function io(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;ii(e.done,r,n,i),ii(e.undone,r,n,i)}function il(e,t,r,n){var i=t,o=t;return("number"==typeof t?o=e_(e,e8(e,t)):i=eQ(t),null==i)?null:(n(o,i)&&e.cm&&rO(e.cm,i,r),o)}function is(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function ia(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}nS.prototype.from=function(){return e4(this.anchor,this.head)},nS.prototype.to=function(){return e6(this.anchor,this.head)},nS.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},is.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,i.parent=null,tb(i),tj(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},ia.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof is))){var s=[];this.collapse(s),this.children=[new is(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,s=l;s<i.lines.length;){var a=new is(i.lines.slice(s,s+=25));i.height-=a.height,this.children.splice(++n,0,a),a.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ia(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=_(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new ia(e.children);n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var iu=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function ic(e,t,r){tA(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&rX(e,r)}iu.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=eQ(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=t0(this);eZ(r,Math.max(0,r.height-o)),e&&(ne(e,function(){ic(e,r,-o),rO(e,n,"widget")}),tj(e,"lineWidgetCleared",e,this,n))}},iu.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=t0(this)-t;i&&(tO(this.doc,n)||eZ(n,n.height+i),r&&ne(r,function(){r.curOp.forceUpdate=!0,ic(r,n,i),tj(r,"lineWidgetChanged",r,e,eQ(n))}))},eT(iu);var ih=0,id=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ih};function ip(e,t,r,n,i){if(n&&n.shared){var o,l,s,a;return(o=j(o=n)).shared=!1,s=(l=[ip(e,t,r,o,i)])[0],a=o.widgetNode,nF(e,function(e){a&&(o.widgetNode=a.cloneNode(!0)),l.push(ip(e,e7(e,t),e7(e,r),o,i));for(var n=0;n<e.linked.length;++n)if(e.linked[n].isParent)return;s=er(l)}),new ig(l,s)}if(e.cm&&!e.cm.curOp)return nt(e.cm,ip)(e,t,r,n,i);var u=new id(e,i),c=e3(t,r);
1if(n&&j(n,u,!1),c>0||0==c&&!1!==u.clearWhenEmpty)return u;if(u.replacedWith&&(u.collapsed=!0,u.widgetNode=R("span",[u.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||u.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(u.widgetNode.insertLeft=!0)),u.collapsed){if(tk(e,t.line,t,r,u)||t.line!=r.line&&tk(e,r.line,t,r,u))throw Error("Inserting collapsed marker partially overlapping an existing one");tp=!0}u.addToHistory&&nB(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var h,f=t.line,d=e.cm;if(e.iter(f,r.line+1,function(n){var i,o,l;d&&u.collapsed&&!d.options.lineWrapping&&tT(n)==d.display.maxLine&&(h=!0),u.collapsed&&f!=t.line&&eZ(n,0),i=new tg(u,f==t.line?t.ch:null,f==r.line?r.ch:null),(l=(o=e.cm&&e.cm.curOp)&&window.WeakSet&&(o.markedSpans||(o.markedSpans=new WeakSet)))&&n.markedSpans&&l.has(n.markedSpans)?n.markedSpans.push(i):(n.markedSpans=n.markedSpans?n.markedSpans.concat([i]):[i],l&&l.add(n.markedSpans)),i.marker.attachLine(n),++f}),u.collapsed&&e.iter(t.line,r.line+1,function(t){tO(e,t)&&eZ(t,0)}),u.clearOnEnter&&eb(u,"beforeCursorEnter",function(){return u.clear()}),u.readOnly&&(td=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),u.collapsed&&(u.id=++ih,u.atomic=!0),d){if(h&&(d.curOp.updateMaxLine=!0),u.collapsed)rN(d,t.line,r.line+1);else if(u.className||u.startStyle||u.endStyle||u.css||u.attributes||u.title)for(var p=t.line;p<=r.line;p++)rO(d,p,"text");u.atomic&&nJ(d.doc),tj(d,"markerAdded",d,u)}return u}id.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&r8(e),ek(this,"clear")){var r=this.find();r&&tj(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],s=tv(l.markedSpans,this);e&&!this.collapsed?rO(e,eQ(l),"text"):e&&(null!=s.to&&(i=eQ(l)),null!=s.from&&(n=eQ(l))),l.markedSpans=function(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}(l.markedSpans,s),null==s.from&&this.collapsed&&!tO(this.doc,l)&&e&&eZ(l,rw(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var a=0;a<this.lines.length;++a){var u=tT(this.lines[a]),c=tD(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&rN(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&nJ(e.doc)),e&&tj(e,"markerCleared",e,this,n,i),t&&r7(e),this.parent&&this.parent.clear()}},id.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var o=this.lines[i],l=tv(o.markedSpans,this);if(null!=l.from&&(r=e2(t?o:eQ(o),l.from),-1==e))return r;if(null!=l.to&&(n=e2(t?o:eQ(o),l.to),1==e))return n}return r&&{from:r,to:n}},id.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&ne(n,function(){var i=t.line,o=t7(n,eQ(t.line));if(o&&(ri(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!tO(r.doc,i)&&null!=r.height){var l=r.height;r.height=null;var s=t0(r)-l;s&&eZ(i,i.height+s)}tj(n,"markerChanged",n,e)})},id.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=_(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},id.prototype.detachLine=function(e){if(this.lines.splice(_(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},eT(id);var ig=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function iv(e){return e.findMarks(e2(e.first,0),e.clipPos(e2(e.lastLine())),function(e){return e.parent})}ig.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();tj(this,"clear")}},ig.prototype.find=function(e,t){return this.primary.find(e,t)},eT(ig);var im=0,iy=function(e,t,r,n,i){if(!(this instanceof iy))return new iy(e,t,r,n,i);null==r&&(r=0),ia.call(this,[new is([new tH("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=e2(r,0);this.sel=nk(o),this.history=new nI(null),this.id=++im,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),nH(this,{from:o,to:o,text:e}),nq(this,nk(o),q)};iy.prototype=eo(ia.prototype,{constructor:iy,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=eq(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:nn(function(e){var t=e2(this.first,0),r=this.first+this.size-1;n6(this,{from:t,to:e2(r,e_(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&r_(this.cm,0,0),nq(this,nk(t),q)}),replaceRange:function(e,t,r,n){t=e7(this,t),r=r?e7(this,r):t,it(this,e,t,r,n)},getRange:function(e,t,r){var n=e$(this,e7(this,e),e7(this,t));return!1===r?n:""===r?n.join(""):n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(e0(this,e))return e_(this,e)},getLineNumber:function(e){return eQ(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=e_(this,e)),tT(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return e7(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:nn(function(e,t,r){nq(this,nk(e7(this,"number"==typeof e?e2(e,t||0):e),null),r)}),setSelection:nn(function(e,t,r){nq(this,nk(e7(this,e),e7(this,t||e)),r)}),extendSelection:nn(function(e,t,r){nX(this,e7(this,e),t&&e7(this,t),r)}),extendSelections:nn(function(e,t){nY(this,te(this,e),t)}),extendSelectionsBy:nn(function(e,t){nY(this,te(this,en(this.sel.ranges,e)),t)}),setSelections:nn(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new nS(e7(this,e[i].anchor),e7(this,e[i].head||e[i].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),nq(this,nL(this.cm,n,t),r)}}),addSelection:nn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new nS(e7(this,e),e7(this,t||e))),nq(this,nL(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=e$(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=e$(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:nn(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];n[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&function(e,t,r){for(var n=[],i=e2(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=nO(s.from,i,o),u=nO(nT(s),i,o);if(i=s.to,o=u,"around"==r){var c=e.sel.ranges[l],h=0>e3(c.head,c.anchor);n[l]=new nS(h?u:a,h?a:u)}else n[l]=new nS(a,a)}return new nC(n,e.sel.primIndex)}(this,n,t),a=n.length-1;a>=0;a--)n6(this,n[a]);s?n$(this,s):this.cm&&rY(this.cm)}
1),undo:nn(function(){n8(this,"undo")}),redo:nn(function(){n8(this,"redo")}),undoSelection:nn(function(){n8(this,"undo",!0)}),redoSelection:nn(function(){n8(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)!e.done[n].ranges&&++t;for(var i=0;i<e.undone.length;i++)!e.undone[i].ranges&&++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new nI(this.history),nF(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:nK(this.history.done),undone:nK(this.history.undone)}},setHistory:function(e){var t=this.history=new nI(this.history);t.done=nK(e.done.slice(0),null,!0),t.undone=nK(e.undone.slice(0),null,!0)},setGutterMarker:nn(function(e,t,r){return il(this,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&eu(n)&&(e.gutterMarkers=null),!0})}),clearGutter:nn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&il(t,r,"gutter",function(){return r.gutterMarkers[e]=null,eu(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!e0(this,e)||(t=e,!(e=e_(this,e))))return null}else if(null==(t=eQ(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:nn(function(e,t,r){return il(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(H(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0})}),removeLineClass:nn(function(e,t,r){return il(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(H(r));if(!o)return!1;var l=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0})}),addLineWidget:nn(function(e,t,r){var n,i,o;return n=this,i=new iu(n,t,r),(o=n.cm)&&i.noHScroll&&(o.display.alignWidgets=!0),il(n,e,"widget",function(e){var t=e.widgets||(e.widgets=[]);if(null==i.insertAt?t.push(i):t.splice(Math.min(t.length,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!tO(n,e)){var r=tA(e)<n.scrollTop;eZ(e,e.height+t0(i)),r&&rX(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&tj(o,"lineWidgetAdded",o,i,"number"==typeof e?e:eQ(e)),i}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return ip(this,e7(this,e),e7(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return ip(this,e=e7(this,e),e,r,"bookmark")},findMarksAt:function(e){e=e7(this,e);var t=[],r=e_(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=e7(this,e),t=e7(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;s<l.length;s++){var a=l[s];!(null!=a.to&&i==e.line&&e.ch>=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch)&&(!r||r(a.marker))&&n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r}),e7(this,e2(r,t))},indexFromPos:function(e){var t=(e=e7(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new iy(eq(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new iy(eq(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(e3(o,l)){var s=ip(e,o,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}(n,iv(this)),n},unlinkDoc:function(e){if(e instanceof oe&&(e=e.doc),this.linked){for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),function(e){for(var t=0;t<e.length;t++)!function(t){var r=e[t],n=[r.primary.doc];nF(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==_(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}}(t)}(iv(this));break}}if(e.history==this.history){var r=[e.id];nF(e,function(e){return r.push(e.id)},!0),e.history=new nI(null),e.history.done=nK(this.history.done,r),e.history.undone=nK(this.history.undone,r)}},iterLinkedDocs:function(e){nF(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):eF(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:nn(function(e){if("rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm)){var t;ne(t=this.cm,function(){nE(t),rN(t)})}})}),iy.prototype.eachLine=iy.prototype.iter;var ib=0;function iw(e){var t=this;if(ix(t),!(eS(t,e)||t1(t.display,e))){eM(e),g&&(ib=+new Date);var r=rT(t,e,!0),n=e.dataTransfer.files;if(!(!r||t.isReadOnly())){if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(){++l==i&&nt(t,function(){var e={from:r=e7(t.doc,r),to:r,text:t.doc.splitLines(o.filter(function(e){return null!=e}).join(t.doc.lineSeparator())),origin:"paste"};n6(t.doc,e),n$(t.doc,nk(e7(t.doc,r),e7(t.doc,nT(e))))})()},a=function(e,r){if(t.options.allowDropFileTypes&&-1==_(t.options.allowDropFileTypes,e.type)){s();return}var n=new FileReader;n.onerror=function(){return s()},n.onload=function(){var e=n.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)){s();return}o[r]=e,s()},n.readAsText(e)},u=0;u<n.length;u++)a(n[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var c,h=e.dataTransfer.getData("Text");if(h){if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),nZ(t.doc,nk(r,r)),c)for(var f=0;f<c.length;
1++f)it(t.doc,"",c[f].anchor,c[f].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}}function ix(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function iC(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var t=0;t<r.length;t++)e(r[t])})}}var iS=!1;function iL(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var ik={3:"Pause",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:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},iT=0;iT<10;iT++)ik[iT+48]=ik[iT+96]=String(iT);for(var iM=65;iM<=90;iM++)ik[iM]=String.fromCharCode(iM);for(var iN=1;iN<=12;iN++)ik[iN+111]=ik[iN+63235]="F"+iN;var iO={};function iA(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var l=0;l<o.length-1;l++){var s=o[l];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))n=!0;else throw Error("Unrecognized modifier name: "+s)}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function iD(e,t,r,n){var i=(t=iP(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return iD(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=iD(e,t.fallthrough[o],r,n);if(l)return l}}}function iW(e){var t="string"==typeof e?e:ik[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function iH(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(D?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(D?t.ctrlKey:t.metaKey)&&"Mod"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function iF(e,t){if(w&&34==e.keyCode&&e.char)return!1;var r=ik[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),iH(r,e,t))}function iP(e){return"string"==typeof e?iO[e]:e}function iE(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&0>=e3(o.from,er(n).to);){var l=n.pop();if(0>e3(l.from,o.from)){o.from=l.from;break}}n.push(o)}ne(e,function(){for(var t=n.length-1;t>=0;t--)it(e.doc,"",n[t].from,n[t].to,"+delete");rY(e)})}function iI(e,t,r){var n=ef(e.text,t+r,r);return n<0||n>e.text.length?null:n}function iR(e,t,r){var n=iI(e,t.ch,r);return null==n?null:new e2(t.line,n,r<0?"after":"before")}function iz(e,t,r,n,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=em(r,t.doc.direction);if(o){var l,s=i<0?er(o):o[0],a=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=re(t,r),c=rt(t,u,l=i<0?r.text.length-1:0).top;l=ed(function(e){return rt(t,u,e).top==c},i<0==(1==s.level)?s.from:s.to-1,l),"before"==a&&(l=iI(r,l,1))}else l=i<0?s.to:s.from;return new e2(n,l,a)}}return new e2(n,i<0?r.text.length:0,i<0?"before":"after")}iO.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"},iO.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"},iO.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},iO.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"]},iO.default=M?iO.macDefault:iO.pcDefault;var iB={selectAll:n5,singleSelection:function(e){return e.setSelection(e.getCursor("anch
1or"),e.getCursor("head"),q)},killLine:function(e){return iE(e,function(t){if(!t.empty())return{from:t.from(),to:t.to()};var r=e_(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:e2(t.head.line+1,0)}:{from:t.head,to:e2(t.head.line,r)}})},deleteLine:function(e){return iE(e,function(t){return{from:e2(t.from().line,0),to:e7(e.doc,e2(t.to().line+1,0))}})},delLineLeft:function(e){return iE(e,function(e){return{from:e2(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return iE(e,function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}})},delWrappedLineRight:function(e){return iE(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(e2(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(e2(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return iG(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return iU(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){var r,n,i;return r=t.head.line,(i=function(e){for(var t;t=tL(e,!1);)e=t.find(1,!0).line;return e}(n=e_(e.doc,r)))!=n&&(r=eQ(i)),iz(!0,e,n,r,-1)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Q)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Q)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?iU(e,t.head):n},Q)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("	")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=X(e.getLine(o.line),o.ch,n);t.push(et(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ne(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=e_(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new e2(i.line,i.ch-1)),i.ch>0)i=new e2(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),e2(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=e_(e.doc,i.line-1).text;l&&(i=new e2(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),e2(i.line-1,l.length-1),i,"+transpose"))}}r.push(new nS(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return ne(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;
1r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);rY(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function iG(e,t){var r=e_(e.doc,t),n=tT(r);return n!=r&&(t=eQ(n)),iz(!0,e,n,t,1)}function iU(e,t){var r=iG(e,t.line),n=e_(e.doc,r.line),i=em(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(r.ch,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return e2(r.line,l?0:o,r.sticky)}return r}function iV(e,t,r){if("string"==typeof t&&!(t=iB[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=$}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var iK=new Y;function ij(e,t,r,n){var i=e.state.keySeq;if(i){if(iW(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:iK.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),iX(e,i+" "+t,r,n))return!0}return iX(e,t,r,n)}function iX(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=iD(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&iD(t,e.options.extraKeys,r,e)||iD(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&tj(e,"keyHandled",e,t,r),("handled"==i||"multi"==i)&&(eM(r),rI(e)),!!i}function iY(e,t){var r=iF(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ij(e,"Shift-"+r,t,function(t){return iV(e,t,!0)})||ij(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return iV(e,t)}):ij(e,r,t,function(t){return iV(e,t)}))}var i_=null;function i$(e){if((!e.target||e.target==this.display.input.getField())&&(this.curOp.focus=B(),!eS(this,e))){g&&v<11&&27==e.keyCode&&(e.returnValue=!1);var t=e.keyCode;this.display.shift=16==t||e.shiftKey;var r=iY(this,e);w&&(i_=r?t:null,!r&&88==t&&!eE&&(M?e.metaKey:e.ctrlKey)&&this.replaceSelection("",null,"cut")),h&&!M&&!r&&46==t&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=t||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(F(t,"CodeMirror-crosshair"),ex(document,"keyup",r),ex(document,"mouseover",r))}G(t,"CodeMirror-crosshair"),eb(document,"keyup",r),eb(document,"mouseover",r)}(this)}}
1function iq(e){16==e.keyCode&&(this.doc.sel.shift=!1),eS(this,e)}function iZ(e){if(!(e.target&&e.target!=this.display.input.getField()||t1(this.display,e)||eS(this,e))&&(!e.ctrlKey||e.altKey)&&(!M||!e.metaKey)){var t,r=e.keyCode,n=e.charCode;if(w&&r==i_){i_=null,eM(e);return}if(!(w&&(!e.which||e.which<10)&&iY(this,e))){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(t=this,ij(t,"'"+i+"'",e,function(e){return iV(t,e,!0)})||this.display.input.onKeyPress(e))}}}var iQ=function(e,t,r){this.time=e,this.pos=t,this.button=r};function iJ(e){var t,r,n,i,o,l,u,c,h,f,d,p,y=this.display;if(!(eS(this,e)||y.activeTouch&&y.input.supportsTouch())){if(y.input.ensurePolled(),y.shift=e.shiftKey,t1(y,e)){m||(y.scroller.draggable=!1,setTimeout(function(){return y.scroller.draggable=!0},100));return}if(!i2(this,e)){var b=rT(this,e),w=eW(e),C=b?(p=+new Date,a&&a.compare(p,b,w)?(s=a=null,"triple"):s&&s.compare(p,b,w)?(a=new iQ(p,b,w),s=null,"double"):(s=new iQ(p,b,w),a=null,"single")):"single";window.focus(),1==w&&this.state.selectingText&&this.state.selectingText(e),!(b&&(t=this,r="Click","double"==C?r="Double"+r:"triple"==C&&(r="Triple"+r),ij(t,iH(r=(1==w?"Left":2==w?"Middle":"Right")+r,e),e,function(e){if("string"==typeof e&&(e=iB[e]),!e)return!1;var r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),r=e(t,b)!=$}finally{t.state.suppressEdits=!1}return r})))&&(1==w?b?(g?setTimeout(K(rR,this),0):this.curOp.focus=B(),n=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=N?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),null==i.addNew&&(i.addNew=M?r.metaKey:r.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(M?r.altKey:r.ctrlKey)),i}(this,C,e),o=this.doc.sel,this.options.dragDrop&&eH&&!this.isReadOnly()&&"single"==C&&(i=o.contains(b))>-1&&(0>e3((i=o.ranges[i]).from(),b)||b.xRel>0)&&(e3(i.to(),b)>0||b.xRel<0)?(l=this,u=l.display,c=!1,h=nt(l,function(e){m&&(u.scroller.draggable=!1),l.state.draggingText=!1,l.state.delayingBlurEvent&&(l.hasFocus()?l.state.delayingBlurEvent=!1:rz(l)),ex(u.wrapper.ownerDocument,"mouseup",h),ex(u.wrapper.ownerDocument,"mousemove",f),ex(u.scroller,"dragstart",d),ex(u.scroller,"drop",h),c||(eM(e),n.addNew||nX(l.doc,b,null,null,n.extend),m&&!x||g&&9==v?setTimeout(function(){u.wrapper.ownerDocument.body.focus({preventScroll:!0}),u.input.focus()},20):u.input.focus())}),f=function(t){c=c||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},d=function(){return c=!0},m&&(u.scroller.draggable=!0),l.state.draggingText=h,h.copy=!n.moveOnDrag,eb(u.wrapper.ownerDocument,"mouseup",h),eb(u.wrapper.ownerDocument,"mousemove",f),eb(u.scroller,"dragstart",d),eb(u.scroller,"drop",h),l.state.delayingBlurEvent=!0,setTimeout(function(){return u.input.focus()},20),u.scroller.dragDrop&&u.scroller.dragDrop()):function(e,t,r,n){g&&rz(e);var i=e.display,o=e.doc;eM(t);var l,s,a=o.sel,u=a.ranges;if(n.addNew&&!n.extend?l=(s=o.sel.contains(r))>-1?u[s]:new nS(r,r):(l=o.sel.primary(),s=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(l=new nS(r,r)),r=rT(e,t,!0,!0),s=-1;else{var c=i0(e,r,n.unit);l=n.extend?nj(l,c.anchor,c.head,n.extend):c}n.addNew?-1==s?(s=u.length,nq(o,nL(e,u.concat([l]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==n.unit&&!n.extend?(nq(o,nL(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),a=o.sel):n_(o,s,l,Z):(s=0,nq(o,new nC([l],0),Z),a=o.sel);var h=r,f=i.wrapper.getBoundingClientRect(),d=0;function p(t){e.state.selectingText=!1,d=1/0,t&&(eM(t),i.input.focus()),ex(i.wrapper.ownerDocument,"mousemove",v),ex(i.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var v=nt(e,function(t){0!==t.buttons&&eW(t)?function t(u){var c=++d,p=rT(e,u,!0,"rectangle"==n.unit);if(p){if(0!=e3(p,h)){e.curOp.focus=B(),function(t){if(0!=e3(h,t)){if(h=t,"rectangle"==n.unit){for(var i=[],u=e.options.tabSize,c=X(e_(o,r.line).text,r.ch,u),f=X(e_(o,t.line).text,t.ch,u),d=Math.min(c,f),p=Math.max(c,f),g=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=v;g++){var m=e_(o,g).text,y=J(m,d,u);d==p?i.push(new nS(e2(g,y),e2(g,y))):m.length>y&&i.push(new nS(e2(g,y),e2(g,J(m,p,u))))}i.length||i.push(new nS(r,r)),nq(o,nL(e,a.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=l,x=i0(e,t,n.unit),C=w.anchor;e3(x.anchor,C)>0?(b=x.head,C=e4(w.from(),x.anchor)):(b=x.anchor,C=e6(w.to(),x.head));var S=a.ranges.slice(0);S[s]=function(e,t){var r,n=t.anchor,i=t.head,o=e_(e.doc,n.line);if(0==e3(n,i)&&n.sticky==i.sticky)return t;var l=em(o);if(!l)return t;var s=eg(l,n.ch,n.sticky),a=l[s];if(a.from!=n.ch&&a.to!=n.ch)return t;var u=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==l.length)return t;if(i.line!=n.line)r=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=eg(l,i.ch,i.sticky),h=c-s||(i.ch-n.ch)*(1==a.level?-1:1);r=c==u-1||c==u?h<0:h>0}var f=l[u+(r?-1:0)],d=r==(1==f.level),p=d?f.from:f.to,g=d?"after":"before";return n.ch==p&&n.sticky==g?t:new nS(new e2(n.line,p,g),i)}(e,new nS(e7(o,C),b)),nq(o,nL(e,S,s),Z)}}}(p);var g=rK(i,o);(p.line>=g.to||p.line<g.from)&&setTimeout(nt(e,function(){d==c&&t(u)}),150)}
1else{var v=u.clientY<f.top?-20:u.clientY>f.bottom?20:0;v&&setTimeout(nt(e,function(){d==c&&(i.scroller.scrollTop+=v,t(u))}),50)}}}(t):p(t)}),m=nt(e,p);e.state.selectingText=m,eb(i.wrapper.ownerDocument,"mousemove",v),eb(i.wrapper.ownerDocument,"mouseup",m)}(this,e,b,n)):eD(e)==y.scroller&&eM(e):2==w?(b&&nX(this.doc,b),setTimeout(function(){return y.input.focus()},20)):3==w&&(W?this.display.input.onContextMenu(e):rz(this)))}}}function i0(e,t,r){if("char"==r)return new nS(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new nS(e2(t.line,0),e7(e.doc,e2(t.line+1,0)));var n=r(e,t);return new nS(n.from,n.to)}function i1(e,t,r,n){if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&eM(t);var i,o,l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!ek(e,r))return eO(t);o-=s.top-l.viewOffset;for(var a=0;a<e.display.gutterSpecs.length;++a){var u=l.gutters.childNodes[a];if(u&&u.getBoundingClientRect().right>=i){var c=eJ(e.doc,o),h=e.display.gutterSpecs[a];return eC(e,r,e,c,h.className,t),eO(t)}}}function i2(e,t){return i1(e,t,"gutterClick",!0)}function i3(e,t){!(t1(e.display,t)||ek(e,"gutterContextMenu")&&i1(e,t,"gutterContextMenu",!1)||eS(e,t,"contextmenu"))&&(W||e.display.input.onContextMenu(t))}function i5(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),rl(e)}iQ.prototype.compare=function(e,t,r){return this.time+400>e&&0==e3(t,this.pos)&&r==this.button};var i9={toString:function(){return"CodeMirror.Init"}},i6={},i4={};function i8(e,t,r){if(!t!=!(r&&r!=i9)){var n=e.display.dragFunctions,i=t?eb:ex;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function i7(e){e.options.lineWrapping?(G(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(F(e.display.wrapper,"CodeMirror-wrap"),tW(e)),rk(e),rN(e),rl(e),setTimeout(function(){return r3(e)},100)}function oe(e,t){var r=this;if(!(this instanceof oe))return new oe(e,t);this.options=t=t?j(t):{},j(i6,t,!1);var n=t.value;"string"==typeof n?n=new iy(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new oe.inputStyles[t.inputStyle](this),o=this.display=new nm(e,n,i,t);for(var l in o.wrapper.CodeMirror=this,i5(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r6(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 Y,keySeq:null,specialChars:null},t.autofocus&&!T&&o.input.focus(),g&&v<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(e){var t=e.display;eb(t.scroller,"mousedown",nt(e,iJ)),g&&v<11?eb(t.scroller,"dblclick",nt(e,function(t){if(!eS(e,t)){var r=rT(e,t);if(!(!r||i2(e,t)||t1(e.display,t))){eM(t);var n=e.findWordAt(r);nX(e.doc,n.anchor,n.head)}}})):eb(t.scroller,"dblclick",function(t){return eS(e,t)||eM(t)}),eb(t.scroller,"contextmenu",function(t){return i3(e,t)}),eb(t.input.getField(),"contextmenu",function(r){t.scroller.contains(r.target)||i3(e,r)});var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),(n=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}eb(t.scroller,"touchstart",function(i){if(!eS(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!i2(e,i)){t.input.ensurePolled(),clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),eb(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),eb(t.scroller,"touchend",function(r){var n=t.activeTouch;if(n&&!t1(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var l,s=e.coordsChar(t.activeTouch,"page");l=!n.prev||o(n,n.prev)?new nS(s,s):!n.prev.prev||o(n,n.prev.prev)?e.findWordAt(s):new nS(e2(s.line,0),e7(e.doc,e2(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),eM(r)}
1i()}),eb(t.scroller,"touchcancel",i),eb(t.scroller,"scroll",function(){t.scroller.clientHeight&&(rZ(e,t.scroller.scrollTop),rJ(e,t.scroller.scrollLeft,!0),eC(e,"scroll",e))}),eb(t.scroller,"mousewheel",function(t){return nx(e,t)}),eb(t.scroller,"DOMMouseScroll",function(t){return nx(e,t)}),eb(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){eS(e,t)||eA(t)},over:function(t){eS(e,t)||(function(e,t){var r=rT(e,t);if(r){var n=document.createDocumentFragment();rP(e,r,n),e.display.dragCursor||(e.display.dragCursor=I("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),E(e.display.dragCursor,n)}}(e,t),eA(t))},start:function(t){return function(e,t){if(g&&(!e.state.draggingText||+new Date-ib<100)){eA(t);return}if(!(eS(e,t)||t1(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!x)){var r=I("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",w&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),w&&r.parentNode.removeChild(r)}}(e,t)},drop:nt(e,iw),leave:function(t){eS(e,t)||ix(e)}};var l=t.input.getField();eb(l,"keyup",function(t){return iq.call(e,t)}),eb(l,"keydown",nt(e,i$)),eb(l,"keypress",nt(e,iZ)),eb(l,"focus",function(t){return rB(e,t)}),eb(l,"blur",function(t){return rG(e,t)})}(this),function(){if(!iS){var e;eb(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,iC(iL)},100))}),eb(window,"blur",function(){return iC(rG)}),iS=!0}}(),r8(this),this.curOp.forceUpdate=!0,nP(this,n),t.autofocus&&!T||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&rB(r)},20):rG(this),i4)i4.hasOwnProperty(l)&&i4[l](this,t[l],i9);nd(this),t.finishInit&&t.finishInit(this);for(var s=0;s<ot.length;++s)ot[s](this);r7(this),m&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}oe.defaults=i6,oe.optionHandlers=i4;var ot=[];function or(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=to(e,t).state:r="prev");var l=e.options.tabSize,s=e_(o,t),a=X(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==$||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?X(e_(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+="	";if(f<u&&(h+=et(u-f)),h!=c)return it(o,h,e2(t,0),e2(t,c.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==t&&g.head.ch<c.length){var v=e2(t,c.length);n_(o,p,new nS(v,v));break}}}oe.defineInitHook=function(e){return ot.push(e)};var on=null;function oi(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l=+new Date-200,s="paste"==i||e.state.pasteIncoming>l,a=eF(t),u=null;if(s&&n.ranges.length>1){if(on&&on.text.join("\n")==t){if(n.ranges.length%on.text.length==0){u=[];for(var c=0;c<on.text.length;c++)u.push(o.splitLines(on.text[c]))}}else a.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(u=en(a,function(e){return[e]}))}for(var h=e.curOp.updateInput,f=n.ranges.length-1;f>=0;f--){var d=n.ranges[f],p=d.from(),g=d.to();d.empty()&&(r&&r>0?p=e2(p.line,p.ch-r):e.state.overwrite&&!s?g=e2(g.line,Math.min(e_(o,g.line).text.length,g.ch+er(a).length)):s&&on&&on.lineWise&&on.text.join("\n")==a.join("\n")&&(p=g=e2(p.line,0)));var v={from:p,to:g,text:u?u[f%u.length]:a,origin:i||(s?"paste":e.state.cutIncoming>l?"cut":"+input")};n6(e.doc,v),tj(e,"inputRead",e,v)}t&&!s&&ol(e,t),rY(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function oo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||ne(t,function(){return oi(t,r,0,null,"paste")}),!0}function ol(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100)&&(!n||r.ranges[n-1].head.line!=i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){l=or(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(e_(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=or(e,i.head.line,"smart"));l&&tj(e,"electricInput",e,i.head.line)}}}function os(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:e2(i,0),head:e2(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function oa(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}
1function ou(){var e=I("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=I("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return m?e.style.width="1000px":e.setAttribute("wrap","off"),L&&(e.style.border="1px solid black"),oa(e),t}function oc(e,t,r,n,i){var o=t,l=r,s=e_(e,t.line),a=i&&"rtl"==e.direction?-r:r;function u(o){if("codepoint"==n){var l,u,c=s.text.charCodeAt(t.ch+(r>0?0:-1));if(isNaN(c))l=null;else{var h=r>0?c>=55296&&c<56320:c>=56320&&c<57343;l=new e2(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*(h?2:1))),-r)}}else l=i?function(e,t,r,n){var i,o=em(t,e.doc.direction);if(!o)return iR(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var l=eg(o,r.ch,r.sticky),s=o[l];if("ltr"==e.doc.direction&&s.level%2==0&&(n>0?s.to>r.ch:s.from<r.ch))return iR(t,r,n);var a=function(e,r){return iI(t,e instanceof e2?e.ch:e,r)},u=function(r){return e.options.lineWrapping?(i=i||re(e,t),ry(e,t,i,r)):{begin:0,end:t.text.length}},c=u("before"==r.sticky?a(r,-1):r.ch);if("rtl"==e.doc.direction||1==s.level){var h=1==s.level==n<0,f=a(r,h?1:-1);if(null!=f&&(h?f<=s.to&&f<=c.end:f>=s.from&&f>=c.begin))return new e2(r.line,f,h?"before":"after")}var d=function(e,t,n){for(;e>=0&&e<o.length;e+=t){var i,l=o[e],s=t>0==(1!=l.level),u=s?n.begin:a(n.end,-1);if(l.from<=u&&u<l.to||(u=s?l.from:a(l.to,-1),n.begin<=u&&u<n.end)){return i=u,s?new e2(r.line,a(i,1),"before"):new e2(r.line,i,"after")}}},p=d(l+n,n,c);if(p)return p;var g=n>0?c.end:a(c.begin,-1);return null!=g&&!(n>0&&g==t.text.length)&&(p=d(n>0?0:o.length-1,n,u(g)))?p:null}(e.cm,s,t,r):iR(s,t,r);if(null==l){if(!(!o&&!((u=t.line+a)<e.first)&&!(u>=e.first+e.size)&&(t=new e2(u,t.ch,t.sticky),s=e_(e,u))))return!1;t=iz(i,e.cm,s,t.line,a)}else t=l;return!0}if("char"==n||"codepoint"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var c=null,h="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||u(!d);d=!1){var p=s.text.charAt(t.ch)||"\n",g=ea(p,f)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||d||g||(g="s"),c&&c!=g){r<0&&(r=1,u(),t.sticky="after");break}if(g&&(c=g),r>0&&!u(!d))break}var v=n2(e,t,o,l,!0);return e5(o,v)&&(v.hitSide=!0),v}function oh(e,t,r,n){var i,o,l=e.doc,s=t.left;if("page"==n){var a=Math.max(Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight)-.5*rw(e.display),3);o=(r>0?t.bottom:t.top)+r*a}else"line"==n&&(o=r>0?t.bottom+3:t.top-3);for(;(i=rv(e,s,o)).outside;){if(r<0?o<=0:o>=l.height){i.hitSide=!0;break}o+=5*r}return i}var of=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Y,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function od(e,t){var r=t7(e,t.line);if(!r||r.hidden)return null;var n=e_(e.doc,t.line),i=t8(r,n,t.line),o=em(n,e.doc.direction),l="left";o&&(l=eg(o,t.ch)%2?"right":"left");var s=rn(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function op(e,t){return t&&(e.bad=!0),e}function og(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return op(e.clipPos(e2(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return function(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!z(n,t))return op(e2(eQ(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?er(e.rest):e.line;return op(e2(eQ(o),o.text.length),i)}var l=3==t.nodeType?t:null,s=t;for(!l&&1==t.childNodes.length&&3==t.firstChild.nodeType&&(l=t.firstChild,r&&(r=l.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var a=e.measure,u=a.maps;function c(t,r,n){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?a.map:u[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==r){var c=eQ(i<0?e.line:e.rest[i]),h=o[l]+n;return(n<0||s!=t)&&(h=o[l+(n?1:0)]),e2(c,h)}}}var h=c(l,s,r);if(h)return op(h,i);for(var f=s.nextSibling,d=l?l.nodeValue.length-r:0;f;f=f.nextSibling){if(h=c(f,f.firstChild,0))return op(e2(h.line,h.ch-d),i);d+=f.textContent.length}for(var p=s.previousSibling,g=r;p;p=p.previousSibling){if(h=c(p,p.firstChild,-1))return op(e2(h.line,h.ch+g),i);g+=p.textContent.length}}(o,t,r)}}of.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;
1if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function l(e){if(!(!o(e)||eS(n,e))){if(n.somethingSelected())on={lineWise:!1,text:n.getSelections()},"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=os(n);on={lineWise:!0,text:t.text},"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,q),n.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var l=on.text.join("\n");if(e.clipboardData.setData("Text",l),e.clipboardData.getData("Text")==l){e.preventDefault();return}}var s=ou(),a=s.firstChild;n.display.lineSpace.insertBefore(s,n.display.lineSpace.firstChild),a.value=on.text.join("\n");var u=B();V(a),setTimeout(function(){n.display.lineSpace.removeChild(s),u.focus(),u==i&&r.showPrimarySelection()},50)}}i.contentEditable=!0,oa(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),eb(i,"paste",function(e){!(!o(e)||eS(n,e)||oo(e,n))&&v<=11&&setTimeout(nt(n,function(){return t.updateFromDOM()}),20)}),eb(i,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),eb(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),eb(i,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),eb(i,"touchstart",function(){return r.forceCompositionEnd()}),eb(i,"input",function(){t.composing||t.readFromDOMSoon()}),eb(i,"copy",l),eb(i,"cut",l)},of.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},of.prototype.prepareSelection=function(){var e=rF(this.cm,!1);return e.focus=B()==this.div,e},of.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},of.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},of.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom){e.removeAllRanges();return}var l=og(t,e.anchorNode,e.anchorOffset),s=og(t,e.focusNode,e.focusOffset);if(!l||l.bad||!s||s.bad||0!=e3(e4(l,s),i)||0!=e3(e6(l,s),o)){var a=t.display.view,u=i.line>=t.display.viewFrom&&od(t,i)||{node:a[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&od(t,o);if(!c){var f=a[a.length-1].measure,d=f.maps?f.maps[f.maps.length-1]:f.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(!u||!c){e.removeAllRanges();return}var p,g=e.rangeCount&&e.getRangeAt(0);try{p=n(u.node,u.offset,c.offset,c.node)}catch(e){}p&&(!h&&t.state.focused?(e.collapse(u.node,u.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),g&&null==e.anchorNode?e.addRange(g):h&&this.startGracePeriod()),this.rememberSelection()}},of.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},of.prototype.showMultipleSelections=function(e){E(this.cm.display.cursorDiv,e.cursors),E(this.cm.display.selectionDiv,e.selection)},of.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},of.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return z(this.div,t)},of.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&B()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},of.prototype.blur=function(){this.div.blur()},of.prototype.getField=function(){return this.div},of.prototype.supportsTouch=function(){return!0},of.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):ne(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},of.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},of.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(k&&b&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var r=og(t,e.anchorNode,e.anchorOffset),n=og(t,e.focusNode,e.focusOffset);r&&n&&ne(t,function(){nq(t.doc,nk(r,n),q),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},of.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n,i,o=this.cm,l=o.display,s=o.doc.sel.primary(),a=s.from(),u=s.to();if(0==a.ch&&a.line>o.firstLine()&&(a=e2(a.line-1,e_(o.doc,a.line-1).length)),u.ch==e_(o.doc,u.line).text.length&&u.line<o.lastLine()&&(u=e2(u.line+1,0)),a.line<l.viewFrom||u.line>l.viewTo-1)return!1;a.line==l.viewFrom||0==(e=rM(o,a.line))?(t=eQ(l.view[0].line),r=l.view[0].node):(t=eQ(l.view[e].line),r=l.view[e-1].node.nextSibling);var c=rM(o,u.line);
1if(c==l.view.length-1?(n=l.viewTo-1,i=l.lineDiv.lastChild):(n=eQ(l.view[c+1].line)-1,i=l.view[c+1].node.previousSibling),!r)return!1;for(var h=o.doc.splitLines(function(e,t,r,n,i){var o="",l=!1,s=e.doc.lineSeparator(),a=!1;function u(){l&&(o+=s,a&&(o+=s),l=a=!1)}function c(e){e&&(u(),o+=e)}for(;function t(r){if(1==r.nodeType){var o=r.getAttribute("cm-text");if(o){c(o);return}var h,f=r.getAttribute("cm-marker");if(f){var d,p=e.findMarks(e2(n,0),e2(i+1,0),(d=+f,function(e){return e.id==d}));p.length&&(h=p[0].find(0))&&c(e$(e.doc,h.from,h.to).join(s));return}if("false"!=r.getAttribute("contenteditable")){var g=/^(pre|div|p|li|table|br)$/i.test(r.nodeName);if(/^br$/i.test(r.nodeName)||0!=r.textContent.length){g&&u();for(var v=0;v<r.childNodes.length;v++)t(r.childNodes[v]);/^(pre|p)$/i.test(r.nodeName)&&(a=!0),g&&(l=!0)}}}else 3==r.nodeType&&c(r.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}(t),t!=r;)t=t.nextSibling,a=!1;return o}(o,r,i,t,n)),f=e$(o.doc,e2(t,0),e2(n,e_(o.doc,n).text.length));h.length>1&&f.length>1;)if(er(h)==er(f))h.pop(),f.pop(),n--;else if(h[0]==f[0])h.shift(),f.shift(),t++;else break;for(var d=0,p=0,g=h[0],v=f[0],m=Math.min(g.length,v.length);d<m&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=er(h),b=er(f),w=Math.min(y.length-(1==h.length?d:0),b.length-(1==f.length?d:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==f.length&&t==a.line)for(;d&&d>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var x=e2(t,d),C=e2(n,f.length?er(f).length-p:0);if(h.length>1||h[0]||e3(x,C))return it(o.doc,h,x,C,"+input"),!0},of.prototype.ensurePolled=function(){this.forceCompositionEnd()},of.prototype.reset=function(){this.forceCompositionEnd()},of.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},of.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},of.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ne(this.cm,function(){return rN(e.cm)})},of.prototype.setUneditable=function(e){e.contentEditable="false"},of.prototype.onKeyPress=function(e){0!=e.charCode&&!this.composing&&(e.preventDefault(),this.cm.isReadOnly()||nt(this.cm,oi)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},of.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},of.prototype.onContextMenu=function(){},of.prototype.resetPosition=function(){},of.prototype.needsContentAttribute=!0;var ov=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Y,this.hasSelection=!1,this.composing=null};ov.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!eS(n,e)){if(n.somethingSelected())on={lineWise:!1,text:n.getSelections()};else{if(!n.options.lineWiseCopyCut)return;var t=os(n);on={lineWise:!0,text:t.text},"cut"==e.type?n.setSelections(t.ranges,null,q):(r.prevInput="",i.value=t.text.join("\n"),V(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),L&&(i.style.width="0px"),eb(i,"input",function(){g&&v>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),eb(i,"paste",function(e){eS(n,e)||oo(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())}),eb(i,"cut",o),eb(i,"copy",o),eb(e.scroller,"paste",function(t){if(!(t1(e,t)||eS(n,t))){if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}}),eb(e.lineSpace,"selectstart",function(t){t1(e,t)||eM(t)}),eb(i,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),eb(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},ov.prototype.createField=function(e){this.wrapper=ou(),this.textarea=this.wrapper.firstChild},ov.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ov.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=rF(e);if(e.options.moveInputWithCursor){var i=rd(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},ov.prototype.showSelection=function(e){var t=this.cm.display;E(t.cursorDiv,e.cursors),E(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ov.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&V(this.textarea),g&&v>=9&&(this.hasSelection=r)}else!e&&(this.prevInput=this.textarea.value="",g&&v>=9&&(this.hasSelection=null))}},ov.prototype.getField=function(){return this.textarea},ov.prototype.supportsTouch=function(){return!1}
1,ov.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!T||B()!=this.textarea))try{this.textarea.focus()}catch(e){}},ov.prototype.blur=function(){this.textarea.blur()},ov.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ov.prototype.receivedFocus=function(){this.slowPoll()},ov.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},ov.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))})},ov.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||eP(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(g&&v>=9&&this.hasSelection===i||M&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,s=Math.min(n.length,i.length);l<s&&n.charCodeAt(l)==i.charCodeAt(l);)++l;return ne(t,function(){oi(t,i.slice(l),n.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ov.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ov.prototype.onKeyPress=function(){g&&v>=9&&(this.hasSelection=null),this.fastPoll()},ov.prototype.onContextMenu=function(e){var t,r=this,n=r.cm,i=n.display,o=r.textarea;r.contextMenuPending&&r.contextMenuPending();var l=rT(n,e),s=i.scroller.scrollTop;if(l&&!w){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(l)&&nt(n,nq)(n.doc,nk(l),q);var a=o.style.cssText,u=r.wrapper.style.cssText,c=r.wrapper.offsetParent.getBoundingClientRect();if(r.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-c.top-5)+"px; left: "+(e.clientX-c.left-5)+"px;\n      z-index: 1000; background: "+(g?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",m&&(t=window.scrollY),i.input.focus(),m&&window.scrollTo(null,t),i.input.reset(),n.somethingSelected()||(o.value=r.prevInput=" "),r.contextMenuPending=d,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),g&&v>=9&&f(),W){eA(e);var h=function(){ex(window,"mouseup",h),setTimeout(d,20)};eb(window,"mouseup",h)}else setTimeout(d,50)}function f(){if(null!=o.selectionStart){var e=n.somethingSelected(),t="​"+(e?o.value:"");o.value="⇚",o.value=t,r.prevInput=e?"":"​",o.selectionStart=1,o.selectionEnd=t.length,i.selForContextMenu=n.doc.sel}}function d(){if(r.contextMenuPending==d&&(r.contextMenuPending=!1,r.wrapper.style.cssText=u,o.style.cssText=a,g&&v<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=s),null!=o.selectionStart)){(!g||g&&v<9)&&f();var e=0,t=function(){i.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==r.prevInput?nt(n,n5)(n):e++<10?i.detectingSelectAll=setTimeout(t,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(t,200)}}},ov.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},ov.prototype.setUneditable=function(){},ov.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=i9&&i(e,t,r)}:i)}e.defineOption=r,e.Init=i9,r("value","",function(e,t){return e.setValue(t)},!0),r("mode",null,function(e,t){e.doc.modeOption=t,nA(e)},!0),r("indentUnit",2,nA,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(e){nD(e),rl(e),rN(e)},!0),r("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(e2(n,o))}n++});for(var i=r.length-1;i>=0;i--)it(e.doc,t,r[i],e2(r[i].line,r[i].ch+t.length))}}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(e,t,r){e.state.specialChars=RegExp(t.source+(t.test("	")?"":"|	"),"g"),r!=i9&&e.refresh()}),r("specialCharPlaceholder",tR,function(e){return e.refresh()},!0),r("electricChars",!0),r("inputStyle",T?"contenteditable":"textarea",function(){throw Error("inputStyle can not (yet) be changed in a running editor")}
1,!0),r("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),r("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),r("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),r("rtlMoveVisually",!O),r("wholeLineUpdateBefore",!0),r("theme","default",function(e){i5(e),nv(e)},!0),r("keyMap","default",function(e,t,r){var n=iP(t),i=r!=i9&&iP(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,i7,!0),r("gutters",[],function(e,t){e.display.gutterSpecs=np(t,e.options.lineNumbers),nv(e)},!0),r("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?rS(e.display)+"px":"0",e.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(e){return r3(e)},!0),r("scrollbarStyle","native",function(e){r6(e),r3(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),r("lineNumbers",!1,function(e,t){e.display.gutterSpecs=np(e.options.gutters,t),nv(e)},!0),r("firstLineNumber",1,nv,!0),r("lineNumberFormatter",function(e){return e},nv,!0),r("showCursorWhenSelecting",!1,rH,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(e,t){"nocursor"==t&&(rG(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),r("screenReaderLabel",null,function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)}),r("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),r("dragDrop",!0,i8),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,rH,!0),r("singleCursorHeightPerLine",!0,rH,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,nD,!0),r("addModeClass",!1,nD,!0),r("pollInterval",100),r("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),r("historyEventDelay",1250),r("viewportMargin",10,function(e){return e.refresh()},!0),r("maxHighlightLength",1e4,nD,!0),r("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),r("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),r("autofocus",null),r("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),r("phrases",null)}(oe),t=oe.optionHandlers,r=oe.helpers={},oe.prototype={constructor:oe,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];(n[e]!=r||"mode"==e)&&(n[e]=r,t.hasOwnProperty(e)&&nt(this,t[e])(this,r,i),eC(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](iP(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:nr(function(e,t){var r=e.token?e:oe.getMode(this.options,e);if(r.startState)throw Error("Overlays may not be stateful.");(function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)})(this.state.overlays,{mode:r,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,rN(this)}),removeOverlay:nr(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e){t.splice(r,1),this.state.modeGen++,rN(this);return}}}),indentLine:nr(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),e0(this.doc,e)&&or(this,e,t,r)}),indentSelection:nr(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(or(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&rY(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;a<r;++a)or(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&n_(this.doc,n,new nS(o,u[n].to()),q)}}}),getTokenAt:function(e,t){return tc(this,e,t)},getLineTokens:function(e,t){return tc(this,e2(e),t,!0)},getTokenTypeAt:function(e){e=e7(this.doc,e);var t,r=ti(this,e_(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;
1if((l?r[2*l-1]:0)>=o)i=l;else if(r[2*l+1]<o)n=l+1;else{t=r[2*l+2];break}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?oe.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!r.hasOwnProperty(t))return n;var i=r[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]]);else if(o[t])for(var l=0;l<o[t].length;l++){var s=i[o[t][l]];s&&n.push(s)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var a=0;a<i._global.length;a++){var u=i._global[a];u.pred(o,this)&&-1==_(n,u.val)&&n.push(u.val)}return n},getStateAfter:function(e,t){var r=this.doc;return to(this,(e=e8(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return rd(this,null==e?r.head:"object"==typeof e?e7(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return rf(this,e7(this.doc,e),t||"page")},coordsChar:function(e,t){return rv(this,(e=rh(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=rh(this,{top:e,left:0},t||"page").top,eJ(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=e_(this.doc,e)}else n=e;return rc(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-tA(n):0)},defaultTextHeight:function(){return rw(this.display)},defaultCharWidth:function(){return rx(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,l=this.display,s=(e=rd(this,e7(this.doc,e))).bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)s=e.top;else if("above"==n||"near"==n){var u=Math.max(l.wrapper.clientHeight,this.doc.height),c=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=u&&(s=e.bottom),a+t.offsetWidth>c&&(a=c-t.offsetWidth)}t.style.top=s+"px",t.style.left=t.style.right="","right"==i?(a=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),r&&(null!=(o=rj(this,{left:a,top:s,right:a+t.offsetWidth,bottom:s+t.offsetHeight})).scrollTop&&rZ(this,o.scrollTop),null!=o.scrollLeft&&rJ(this,o.scrollLeft))},triggerOnKeyDown:nr(i$),triggerOnKeyPress:nr(iZ),triggerOnKeyUp:iq,triggerOnMouseDown:nr(iJ),execCommand:function(e){if(iB.hasOwnProperty(e))return iB[e].call(null,this)},triggerElectric:nr(function(e){ol(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=e7(this.doc,e),l=0;l<t&&!(o=oc(this.doc,o,i,r,n)).hitSide;++l);return o},moveH:nr(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?oc(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},Q)}),deleteH:nr(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):iE(this,function(r){var i=oc(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var l=e7(this.doc,e),s=0;s<t;++s){var a=rd(this,l,"div");if(null==o?o=a.left:a.left=o,(l=oh(this,a,i,r)).hitSide)break}return l},moveV:nr(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return e<0?l.from():l.to();var s=rd(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=oh(r,s,e,t);return"page"==t&&l==n.sel.primary()&&rX(r,rf(r,a,"div").top-s.top),a},Q),i.length)for(var l=0;l<n.sel.ranges.length;l++)n.sel.ranges[l].goalColumn=i[l]}),findWordAt:function(e){var t=e_(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");("before"==e.sticky||n==t.length)&&r?--r:++n;for(var o=t.charAt(r),l=ea(o,i)?function(e){return ea(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ea(e)};r>0&&l(t.charAt(r-1));)--r;for(;n<t.length&&l(t.charAt(n));)++n}return new nS(e2(e.line,r),e2(e.line,n))},toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?G(this.display.cursorDiv,"CodeMirror-overwrite"):F(this.display.cursorDiv,"CodeMirror-overwrite"),eC(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==B()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:nr(function(e,t){r_(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-t9(this)-this.display.barHeight,width:e.scrollWidth-t9(this)-this.display.barWidth,clientHeight:t4(this),clientWidth:t6(this)}},scrollIntoView:nr(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:e2(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line){var r;r=e,r$(this),this.curOp.scrollToPos=r}else rq(this,e.from,e.to,e.margin)}),setSize:nr(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&ro(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets){for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){rO(r,i,"widget");break}}++i}),this.curOp.forceUpdate=!0,eC(this,"refresh",this)}),operation:function(e){return ne(this,e)},startOperation:function(){return r8(this)},endOperation:function(){return r7(this)},refresh:nr(function(){var e=this.display.cachedTextHeight;rN(this),this.curOp.forceUpdate=!0,rl(this),r_(this,this.doc.scrollLeft,this.doc.scrollTop),nc(this.display),(null==e||Math.abs(e-rw(this.display))>.5||this.options.lineWrapping)&&rk(this),eC(this,"refresh",this)}),swapDoc:nr(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),nP(this,e),rl(this),this.display.input.reset(),r_
1(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,tj(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},eT(oe),oe.registerHelper=function(e,t,n){r.hasOwnProperty(e)||(r[e]=oe[e]={_global:[]}),r[e][t]=n},oe.registerGlobalHelper=function(e,t,n,i){oe.registerHelper(e,t,i),r[e]._global.push({pred:n,val:i})};var om="iter insert remove copy getEditor constructor".split(" ");for(var oy in iy.prototype)iy.prototype.hasOwnProperty(oy)&&0>_(om,oy)&&(oe.prototype[oy]=function(e){return function(){return e.apply(this.doc,arguments)}}(iy.prototype[oy]));return eT(iy),oe.inputStyles={textarea:ov,contenteditable:of},oe.defineMode=function(e){oe.defaults.mode||"null"==e||(oe.defaults.mode=e),eB.apply(this,arguments)},oe.defineMIME=function(e,t){ez[e]=t},oe.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),oe.defineMIME("text/plain","null"),oe.defineExtension=function(e,t){oe.prototype[e]=t},oe.defineDocExtension=function(e,t){iy.prototype[e]=t},oe.fromTextArea=function(e,t){if((t=t?j(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r,n=B();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=s.getValue()}if(e.form&&(eb(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var l=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ex(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var s=oe(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},oe.off=ex,oe.on=eb,oe.wheelEventPixels=function(e){var t=nw(e);return t.x*=nb,t.y*=nb,t},oe.Doc=iy,oe.splitLines=eF,oe.countColumn=X,oe.findColumn=J,oe.isWordChar=es,oe.Pass=$,oe.signal=eC,oe.Line=tH,oe.changeEnd=nT,oe.scrollbarModel=r9,oe.Pos=e2,oe.cmpPos=e3,oe.modes=eR,oe.mimeModes=ez,oe.resolveMode=eG,oe.getMode=eU,oe.modeExtensions=eV,oe.extendMode=function(e,t){j(t,eV.hasOwnProperty(e)?eV[e]:eV[e]={})},oe.copyState=eK,oe.startState=eX,oe.innerMode=ej,oe.commands=iB,oe.keyMap=iO,oe.keyName=iF,oe.isModifierKey=iW,oe.lookupKey=iD,oe.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=en(r.split(" "),iA),o=0;o<i.length;o++){var l=void 0,s=void 0;o==i.length-1?(s=i.join(" "),l=n):(s=i.slice(0,o+1).join(" "),l="...");var a=t[s];if(a){if(a!=l)throw Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[r]}for(var u in t)e[u]=t[u];return e},oe.StringStream=eY,oe.SharedTextMarker=ig,oe.TextMarker=id,oe.LineWidget=iu,oe.e_preventDefault=eM,oe.e_stopPropagation=eN,oe.e_stop=eA,oe.addClass=G,oe.contains=z,oe.rmClass=F,oe.keyNames=ik,oe.version="5.65.3",oe},o.exports=e()),o.exports}}}]);
2//# sourceMappingURL=02e4a100.05913e73d6458526.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.