@hpcc-js/codemirror 2.61.2 → 2.61.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/codemirror"]={},e["@hpcc-js/common"])}(this,(function(e,t){"use strict";var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var o={exports:{}};!function(e,t){e.exports=function(){var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=n||i||o,l=a&&(n?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\/(\d+)/.exec(e),d=c&&+c[1],f=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),g=h&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),x=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),k=/win/i.test(t),w=f&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,s=!0);var C=x&&(u||f&&(null==w||w<12.11)),S=r||a&&l>=9;function M(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,T=function(e,t){var r=e.className,n=M(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 A(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function D(e,t){return A(e).appendChild(t)}function F(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 E(e,t,r,n){var i=F(e,t,r,n);return i.setAttribute("role","presentation"),i}function O(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 N(e){var t,r=e.ownerDocument||e;try{t=e.activeElement}catch(e){t=r.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function z(e,t){var r=e.className;M(t).test(r)||(e.className+=(r?" ":"")+t)}function P(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!M(r[n]).test(t)&&(t+=" "+r[n]);return t}L=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var B=function(e){e.select()};function I(e){return e.display.wrapper.ownerDocument}function W(e){return H(e.display.wrapper)}function H(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function j(e){return I(e).defaultView}function _(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function R(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function q(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}g?B=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(B=function(e){try{e.select()}catch(e){}});var G=function(){this.id=null,this.f=null,this.time=0,this.handler=_(this.onTimeout,this)};function V(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}G.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},G.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 U=50,K={toString:function(){return"CodeMirror.Pass"}},$={scroll:!1},X={origin:"*mouse"},Y={origin:"+move"};function Q(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var J=[""];function Z(e){for(;J.length<=e;)J.push(ee(J)+" ");return J[e]}function ee(e){return e[e.length-1]}function te(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function re(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function ne(){}function ie(e,t){var r;return Object.create?r=Object.create(e):(ne.prototype=e,r=new ne),t&&R(t,r),r}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ae(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||oe.test(e))}function le(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ae(e))||t.test(e):ae(e)}function se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ue=/[\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 ce(e){return e.charCodeAt(0)>=768&&ue.test(e)}function de(e,t,r){for(;(r<0?t>0:t<e.length)&&ce(e.charAt(t));)t+=r;return t}function fe(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}}function he(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}var pe=null;function me(e,t,r){var n;pe=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:pe=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:pe=i)}return null!=n?n:pe}var ge=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(r){return r<=247?e.charAt(r):1424<=r&&r<=1524?"R":1536<=r&&r<=1785?t.charAt(r-1536):1774<=r&&r<=2220?"r":8192<=r&&r<=8203?"w":8204==r?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(e,t,r){this.level=e,this.from=t,this.to=r}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!n.test(e))return!1;for(var c=e.length,d=[],f=0;f<c;++f)d.push(r(e.charCodeAt(f)));for(var h=0,p=u;h<c;++h){var m=d[h];"m"==m?d[h]=p:p=m}for(var g=0,v=u;g<c;++g){var y=d[g];"1"==y&&"r"==v?d[g]="n":o.test(y)&&(v=y,"r"==y&&(d[g]="R"))}for(var x=1,b=d[0];x<c-1;++x){var k=d[x];"+"==k&&"1"==b&&"1"==d[x+1]?d[x]="1":","!=k||b!=d[x+1]||"1"!=b&&"n"!=b||(d[x]=b),b=k}for(var w=0;w<c;++w){var C=d[w];if(","==C)d[w]="N";else if("%"==C){var S=void 0;for(S=w+1;S<c&&"%"==d[S];++S);for(var M=w&&"!"==d[w-1]||S<c&&"1"==d[S]?"1":"N",L=w;L<S;++L)d[L]=M;w=S-1}}for(var T=0,A=u;T<c;++T){var D=d[T];"L"==A&&"1"==D?d[T]="L":o.test(D)&&(A=D)}for(var F=0;F<c;++F)if(i.test(d[F])){var E=void 0;for(E=F+1;E<c&&i.test(d[E]);++E);for(var O="L"==(F?d[F-1]:u),N=O==("L"==(E<c?d[E]:u))?O?"L":"R":u,z=F;z<E;++z)d[z]=N;F=E-1}for(var P,B=[],I=0;I<c;)if(a.test(d[I])){var W=I;for(++I;I<c&&a.test(d[I]);++I);B.push(new s(0,W,I))}else{var H=I,j=B.length,_="rtl"==t?1:0;for(++I;I<c&&"L"!=d[I];++I);for(var R=H;R<I;)if(l.test(d[R])){H<R&&(B.splice(j,0,new s(1,H,R)),j+=_);var q=R;for(++R;R<I&&l.test(d[R]);++R);B.splice(j,0,new s(2,q,R)),j+=_,H=R}else++R;H<I&&B.splice(j,0,new s(1,H,I))}return"ltr"==t&&(1==B[0].level&&(P=e.match(/^\s+/))&&(B[0].from=P[0].length,B.unshift(new s(0,0,P[0].length))),1==ee(B).level&&(P=e.match(/\s+$/))&&(ee(B).to-=P[0].length,B.push(new s(0,c-P[0].length,c)))),"rtl"==t?B.reverse():B}}();function ve(e,t){var r=e.order;return null==r&&(r=e.order=ge(e.text,t)),r}var ye=[],xe=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]||ye).concat(r)}};function be(e,t){return e._handlers&&e._handlers[t]||ye}function ke(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=V(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function we(e,t){var r=be(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 Ce(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),we(e,r||t.type,e,t),De(t)||t.codemirrorIgnore}function Se(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==V(r,t[n])&&r.push(t[n])}function Me(e,t){return be(e,t).length>0}function Le(e){e.prototype.on=function(e,t){xe(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}function Te(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Fe(e){Te(e),Ae(e)}function Ee(e){return e.target||e.srcElement}function Oe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),x&&e.ctrlKey&&1==t&&(t=3),t}var Ne,ze,Pe=function(){if(a&&l<9)return!1;var e=F("div");return"draggable"in e||"dragDrop"in e}();function Be(e){if(null==Ne){var t=F("span","​");D(e,F("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ne=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&l<8))}var r=Ne?F("span","​"):F("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Ie(e){if(null!=ze)return ze;var t=D(e,document.createTextNode("AخA")),r=L(t,0,1).getBoundingClientRect(),n=L(t,1,2).getBoundingClientRect();return A(e),!(!r||r.left==r.right)&&(ze=n.right-r.right<3)}var We,He=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),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},je=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)},_e="oncopy"in(We=F("div"))||(We.setAttribute("oncopy","return;"),"function"==typeof We.oncopy),Re=null;function qe(e){if(null!=Re)return Re;var t=D(e,F("span","x")),r=t.getBoundingClientRect(),n=L(t,0,1).getBoundingClientRect();return Re=Math.abs(r.left-n.left)>1}var Ge={},Ve={};function Ue(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ge[e]=t}function Ke(e,t){Ve[e]=t}function $e(e){if("string"==typeof e&&Ve.hasOwnProperty(e))e=Ve[e];else if(e&&"string"==typeof e.name&&Ve.hasOwnProperty(e.name)){var t=Ve[e.name];"string"==typeof t&&(t={name:t}),(e=ie(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return $e("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return $e("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Xe(e,t){t=$e(t);var r=Ge[t.name];if(!r)return Xe(e,"text/plain");var n=r(e,t);if(Ye.hasOwnProperty(t.name)){var i=Ye[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 a in t.modeProps)n[a]=t.modeProps[a];return n}var Ye={};function Qe(e,t){R(t,Ye.hasOwnProperty(e)?Ye[e]:Ye[e]={})}function Je(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 Ze(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 et(e,t,r){return!e.startState||e.startState(t,r)}var tt=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 rt(e,t){if((t-=e.first)<0||t>=e.size)throw new 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 nt(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,(function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i})),n}function it(e,t,r){var n=[];return e.iter(t,r,(function(e){n.push(e.text)})),n}function ot(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function at(e){if(null==e.parent)return null;for(var t=e.parent,r=V(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 lt(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 a=0;a<e.lines.length;++a){var l=e.lines[a].height;if(t<l)break;t-=l}return r+a}function st(e,t){return t>=e.first&&t<e.first+e.size}function ut(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ct(e,t,r){if(void 0===r&&(r=null),!(this instanceof ct))return new ct(e,t,r);this.line=e,this.ch=t,this.sticky=r}function dt(e,t){return e.line-t.line||e.ch-t.ch}function ft(e,t){return e.sticky==t.sticky&&0==dt(e,t)}function ht(e){return ct(e.line,e.ch)}function pt(e,t){return dt(e,t)<0?t:e}function mt(e,t){return dt(e,t)<0?e:t}function gt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function vt(e,t){if(t.line<e.first)return ct(e.first,0);var r=e.first+e.size-1;return t.line>r?ct(r,rt(e,r).text.length):yt(t,rt(e,t.line).text.length)}function yt(e,t){var r=e.ch;return null==r||r>t?ct(e.line,t):r<0?ct(e.line,0):e}function xt(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=vt(e,t[n]);return r}tt.prototype.eol=function(){return this.pos>=this.string.length},tt.prototype.sol=function(){return this.pos==this.lineStart},tt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},tt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},tt.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},tt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},tt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},tt.prototype.skipToEnd=function(){this.pos=this.string.length},tt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},tt.prototype.backUp=function(e){this.pos-=e},tt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=q(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},tt.prototype.indentation=function(){return q(this.string,null,this.tabSize)-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},tt.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},tt.prototype.current=function(){return this.string.slice(this.start,this.pos)},tt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},tt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},tt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var bt=function(e,t){this.state=e,this.lookAhead=t},kt=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 wt(e,t,r,n){var i=[e.state.modeGen],o={};Et(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),o,n);for(var a=r.state,l=function(n){r.baseTokens=i;var l=e.state.overlays[n],s=1,u=0;r.state=!0,Et(e,t.text,l.mode,r,(function(e,t){for(var r=s;u<e;){var n=i[s];n>e&&i.splice(s,1,e,i[s+1],n),s+=2,u=Math.min(e,n)}if(t)if(l.opaque)i.splice(r,s-r,e,"overlay "+t),s=r+2;else for(;r<s;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}}),o),r.state=a,r.baseTokens=null,r.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ct(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=St(e,at(t)),i=t.text.length>e.options.maxHighlightLength&&Je(e.doc.mode,n.state),o=wt(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 St(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new kt(n,!0,t);var o=Ot(e,t,r),a=o>n.first&&rt(n,o-1).stateAfter,l=a?kt.fromSaved(n,a,o):new kt(n,et(n.mode),o);return n.iter(o,t,(function(r){Mt(e,r.text,l);var n=l.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?l.save():null,l.nextLine()})),r&&(n.modeFrontier=l.line),l}function Mt(e,t,r,n){var i=e.doc.mode,o=new tt(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&Lt(i,r.state);!o.eol();)Tt(i,o,r.state),o.start=o.pos}function Lt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ze(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Tt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ze(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}kt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},kt.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}},kt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},kt.fromSaved=function(e,t,r){return t instanceof bt?new kt(e,Je(e.mode,t.state),r,t.lookAhead):new kt(e,Je(e.mode,t),r)},kt.prototype.save=function(e){var t=!1!==e?Je(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new bt(t,this.maxLookAhead):t};var At=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Dt(e,t,r,n){var i,o,a=e.doc,l=a.mode,s=rt(a,(t=vt(a,t)).line),u=St(e,t.line,r),c=new tt(s.text,e.options.tabSize,u);for(n&&(o=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=Tt(l,c,u.state),n&&o.push(new At(c,i,Je(a.mode,u.state)));return n?o:new At(c,i,u.state)}function Ft(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]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Et(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,u=0,c=null,d=new tt(t,e.options.tabSize,n),f=e.options.addModeClass&&[null];for(""==t&&Ft(Lt(r,n.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&Mt(e,t,n,d.pos),d.pos=t.length,s=null):s=Ft(Tt(r,d,n.state,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||c!=s){for(;u<d.start;)i(u=Math.min(d.start,u+5e3),c);c=s}d.start=d.pos}for(;u<d.pos;){var p=Math.min(d.pos,u+5e3);i(p,c),u=p}}function Ot(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=rt(o,l-1),u=s.stateAfter;if(u&&(!r||l+(u instanceof bt?u.lookAhead:0)<=o.modeFrontier))return l;var c=q(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}function Nt(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=rt(e,n).stateAfter;if(i&&(!(i instanceof bt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}var zt=!1,Pt=!1;function Bt(){zt=!0}function It(){Pt=!0}function Wt(e,t,r){this.marker=e,this.from=t,this.to=r}function Ht(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function jt(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function _t(e,t,r){var n=r&&window.WeakSet&&(r.markedSpans||(r.markedSpans=new WeakSet));n&&e.markedSpans&&n.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],n&&n.add(e.markedSpans)),t.marker.attachLine(e)}function Rt(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Wt(a,o.from,l?null:o.to))}}return n}function qt(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Wt(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return n}function Gt(e,t){if(t.full)return null;var r=st(e,t.from.line)&&rt(e,t.from.line).markedSpans,n=st(e,t.to.line)&&rt(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==dt(t.from,t.to),l=Rt(r,i,a),s=qt(n,o,a),u=1==t.text.length,c=ee(t.text).length+(u?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var h=Ht(s,f.marker);h?u&&(f.to=null==h.to?null:h.to+c):f.to=i}}if(s)for(var p=0;p<s.length;++p){var m=s[p];null!=m.to&&(m.to+=c),null==m.from?Ht(l,m.marker)||(m.from=c,u&&(l||(l=[])).push(m)):(m.from+=c,u&&(l||(l=[])).push(m))}l&&(l=Vt(l)),s&&s!=l&&(s=Vt(s));var g=[l];if(!u){var v,y=t.text.length-2;if(y>0&&l)for(var x=0;x<l.length;++x)null==l[x].to&&(v||(v=[])).push(new Wt(l[x].marker,null,null));for(var b=0;b<y;++b)g.push(v);g.push(s)}return g}function Vt(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 Ut(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!=V(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var u=i[s];if(!(dt(u.to,l.from)<0||dt(u.from,l.to)>0)){var c=[s,1],d=dt(u.from,l.from),f=dt(u.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:l.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:l.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}function Kt(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function $t(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Xt(e){return e.inclusiveLeft?-1:0}function Yt(e){return e.inclusiveRight?1:0}function Qt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=dt(n.from,i.from)||Xt(e)-Xt(t);if(o)return-o;var a=dt(n.to,i.to)||Yt(e)-Yt(t);return a||t.id-e.id}function Jt(e,t){var r,n=Pt&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Qt(r,i.marker)<0)&&(r=i.marker);return r}function Zt(e){return Jt(e,!0)}function er(e){return Jt(e,!1)}function tr(e,t){var r,n=Pt&&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||Qt(r,o.marker)<0)&&(r=o.marker)}return r}function rr(e,t,r,n,i){var o=rt(e,t),a=Pt&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var u=s.marker.find(0),c=dt(u.from,r)||Xt(s.marker)-Xt(i),d=dt(u.to,n)||Yt(s.marker)-Yt(i);if(!(c>=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?dt(u.to,r)>=0:dt(u.to,r)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?dt(u.from,n)<=0:dt(u.from,n)<0)))return!0}}}function nr(e){for(var t;t=Zt(e);)e=t.find(-1,!0).line;return e}function ir(e){for(var t;t=er(e);)e=t.find(1,!0).line;return e}function or(e){for(var t,r;t=er(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function ar(e,t){var r=rt(e,t),n=nr(r);return r==n?t:at(n)}function lr(e,t){if(t>e.lastLine())return t;var r,n=rt(e,t);if(!sr(e,n))return t;for(;r=er(n);)n=r.find(1,!0).line;return at(n)+1}function sr(e,t){var r=Pt&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&ur(e,t,n))return!0}}function ur(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return ur(e,n.line,Ht(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&ur(e,t,i))return!0}function cr(e){for(var t=0,r=(e=nr(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 a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function dr(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Zt(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=er(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function fr(e){var t=e.display,r=e.doc;t.maxLine=rt(r,r.first),t.maxLineLength=dr(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=dr(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var hr=function(e,t,r){this.text=e,$t(this,t),this.height=r?r(this):1};function pr(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Kt(e),$t(e,r);var i=n?n(e):1;i!=e.height&&ot(e,i)}function mr(e){e.parent=null,Kt(e)}hr.prototype.lineNo=function(){return at(this)},Le(hr);var gr={},vr={};function yr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?vr:gr;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function xr(e,t){var r=E("span",null,null,s?"padding-right: .1px":null),n={pre:E("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=kr,Ie(e.display.measure)&&(a=ve(o,e.doc.direction))&&(n.addToken=Cr(n.addToken,a)),n.map=[],Mr(o,n,Ct(e,o,t!=e.display.externalMeasured&&at(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=P(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=P(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Be(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var l=n.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return we(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=P(n.pre.className,n.textClass||"")),n}function br(e){var t=F("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function kr(e,t,r,n,i,o,s){if(t){var u,c=e.splitSpaces?wr(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){u=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var p=d.exec(t),m=p?p.index-h:t.length-h;if(m){var g=document.createTextNode(c.slice(h,h+m));a&&l<9?u.appendChild(F("span",[g])):u.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;h+=m+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,x=y-e.col%y;(v=u.appendChild(F("span",Z(x),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=x}else"\r"==p[0]||"\n"==p[0]?((v=u.appendChild(F("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&l<9?u.appendChild(F("span",[v])):u.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),a&&l<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||n||i||f||o||s){var b=r||"";n&&(b+=n),i&&(b+=i);var k=F("span",[u],b,o);if(s)for(var w in s)s.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&k.setAttribute(w,s[w]);return e.content.appendChild(k)}e.content.appendChild(u)}}function wr(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=" "),n+=o,r=" "==o}return n}function Cr(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var d=void 0,f=0;f<t.length&&!((d=t[f]).to>u&&d.from<=u);f++);if(d.to>=c)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-u),i,o,null,l,s),o=null,n=n.slice(d.to-u),u=d.to}}}function Sr(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 Mr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,u,c,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=u=c=l="",f=null,d=null,v=1/0;for(var y=[],x=void 0,b=0;b<n.length;++b){var k=n[b],w=k.marker;if("bookmark"==w.type&&k.from==p&&w.widgetNode)y.push(w);else if(k.from<=p&&(null==k.to||k.to>p||w.collapsed&&k.to==p&&k.from==p)){if(null!=k.to&&k.to!=p&&v>k.to&&(v=k.to,u=""),w.className&&(s+=" "+w.className),w.css&&(l=(l?l+";":"")+w.css),w.startStyle&&k.from==p&&(c+=" "+w.startStyle),w.endStyle&&k.to==v&&(x||(x=[])).push(w.endStyle,k.to),w.title&&((f||(f={})).title=w.title),w.attributes)for(var C in w.attributes)(f||(f={}))[C]=w.attributes[C];w.collapsed&&(!d||Qt(d.marker,w)<0)&&(d=k)}else k.from>p&&v>k.from&&(v=k.from)}if(x)for(var S=0;S<x.length;S+=2)x[S+1]==v&&(u+=" "+x[S]);if(!d||d.from==p)for(var M=0;M<y.length;++M)Sr(t,0,y[M]);if(d&&(d.from||0)==p){if(Sr(t,(null==d.to?h+1:d.to)-p,d.marker,null==d.from),null==d.to)return;d.to==p&&(d=!1)}}if(p>=h)break;for(var L=Math.min(h,v);;){if(g){var T=p+g.length;if(!d){var A=T>L?g.slice(0,L-p):g;t.addToken(t,A,a?a+s:s,c,p+A.length==v?u:"",l,f)}if(T>=L){g=g.slice(L-p),p=L;break}p=T,c=""}g=i.slice(o,o=r[m++]),a=yr(r[m++],t.cm.options)}}else for(var D=1;D<r.length;D+=2)t.addToken(t,i.slice(o,o=r[D]),yr(r[D+1],t.cm.options))}function Lr(e,t,r){this.line=t,this.rest=or(t),this.size=this.rest?at(ee(this.rest))-r+1:1,this.node=this.text=null,this.hidden=sr(e,t)}function Tr(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new Lr(e.doc,rt(e.doc,o),o);n=o+a.size,i.push(a)}return i}var Ar=null;function Dr(e){Ar?Ar.ops.push(e):e.ownsGroup=Ar={ops:[e],delayedCallbacks:[]}}function Fr(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)}function Er(e,t){var r=e.ownsGroup;if(r)try{Fr(r)}finally{Ar=null,t(r)}}var Or=null;function Nr(e,t){var r=be(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);Ar?n=Ar.delayedCallbacks:Or?n=Or:(n=Or=[],setTimeout(zr,0));for(var o=function(e){n.push((function(){return r[e].apply(null,i)}))},a=0;a<r.length;++a)o(a)}}function zr(){var e=Or;Or=null;for(var t=0;t<e.length;++t)e[t]()}function Pr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Hr(e,t):"gutter"==o?_r(e,t,r,n):"class"==o?jr(e,t):"widget"==o&&Rr(e,t,n)}t.changes=null}function Br(e){return e.node==e.text&&(e.node=F("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&l<8&&(e.node.style.zIndex=2)),e.node}function Ir(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=Br(t);t.background=n.insertBefore(F("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function Wr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):xr(e,t)}function Hr(e,t){var r=t.text.className,n=Wr(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,jr(e,t)):r&&(t.text.className=r)}function jr(e,t){Ir(e,t),t.line.wrapClass?Br(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 _r(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=Br(t);t.gutterBackground=F("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 a=Br(t),l=t.gutter=F("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(l.setAttribute("aria-hidden","true"),e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(F("div",ut(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,c=o.hasOwnProperty(u)&&o[u];c&&l.appendChild(F("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function Rr(e,t,r){t.alignable&&(t.alignable=null);for(var n=M("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);Gr(e,t,r)}function qr(e,t,r,n){var i=Wr(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),jr(e,t),_r(e,t,r,n),Gr(e,t,n),t.node}function Gr(e,t,r){if(Vr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Vr(e,t.rest[n],t,r,!1)}function Vr(e,t,r,n,i){if(t.widgets)for(var o=Br(r),a=0,l=t.widgets;a<l.length;++a){var s=l[a],u=F("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Ur(s,u,r,n),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),Nr(s,"redraw")}}function Ur(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Kr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!O(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;"),D(t.display.measure,F("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function $r(e,t){for(var r=Ee(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 Xr(e){return e.lineSpace.offsetTop}function Yr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Qr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=D(e.measure,F("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 Jr(e){return U-e.display.nativeBarWidth}function Zr(e){return e.display.scroller.clientWidth-Jr(e)-e.display.barWidth}function en(e){return e.display.scroller.clientHeight-Jr(e)-e.display.barHeight}function tn(e,t,r){var n=e.options.lineWrapping,i=n&&Zr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],u=a[l+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function rn(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(at(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function nn(e,t){var r=at(t=nr(t)),n=e.display.externalMeasured=new Lr(e.doc,t,r);n.lineN=r;var i=n.built=xr(e,n);return n.text=i.pre,D(e.display.lineMeasure,i.pre),n}function on(e,t,r,n){return sn(e,ln(e,t),r,n)}function an(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[_n(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function ln(e,t){var r=at(t),n=an(e,r);n&&!n.text?n=null:n&&n.changes&&(Pr(e,n,r,Bn(e)),e.curOp.forceUpdate=!0),n||(n=nn(e,t));var i=rn(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function sn(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(tn(e,t.view,t.rect),t.hasHeights=!0),(o=hn(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var un,cn={left:0,right:0,top:0,bottom:0};function dn(e,t,r){for(var n,i,o,a,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,o=1,a="left"):t<s?o=1+(i=t-l):(u==e.length-3||t==s&&e[u+3]>t)&&(i=(o=s-l)-1,t>=s&&(a="right")),null!=i){if(n=e[u+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],a="left";if("right"==r&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function fn(e,t){var r=cn;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function hn(e,t,r,n){var i,o=dn(t.map,r,n),s=o.node,u=o.start,c=o.end,d=o.collapse;if(3==s.nodeType){for(var f=0;f<4;f++){for(;u&&ce(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&ce(t.line.text.charAt(o.coverStart+c));)++c;if((i=a&&l<9&&0==u&&c==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():fn(L(s,u,c).getClientRects(),n)).left||i.right||0==u)break;c=u,u-=1,d="right"}a&&l<11&&(i=pn(e.display.measure,i))}else{var h;u>0&&(d=n="right"),i=e.options.lineWrapping&&(h=s.getClientRects()).length>1?h["right"==n?h.length-1:0]:s.getBoundingClientRect()}if(a&&l<9&&!u&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Pn(e.display),top:p.top,bottom:p.bottom}:cn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,x=0;x<y.length-1&&!(v<y[x]);x++);var b=x?y[x-1]:0,k=y[x],w={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:b,bottom:k};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=m,w.rbottom=g),w}function pn(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!qe(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function mn(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 gn(e){e.display.externalMeasure=null,A(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)mn(e.display.view[t])}function vn(e){gn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function yn(e){return c&&v?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function xn(e){return c&&v?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function bn(e){var t=nr(e).widgets,r=0;if(t)for(var n=0;n<t.length;++n)t[n].above&&(r+=Kr(t[n]));return r}function kn(e,t,r,n,i){if(!i){var o=bn(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=cr(t);if("local"==n?a+=Xr(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==n?0:xn(I(e)));var s=l.left+("window"==n?0:yn(I(e)));r.left+=s,r.right+=s}return r.top+=a,r.bottom+=a,r}function wn(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=yn(I(e)),i-=xn(I(e));else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function Cn(e,t,r,n,i){return n||(n=rt(e.doc,t.line)),kn(e,n,on(e,n,t.ch,i),r)}function Sn(e,t,r,n,i,o){function a(t,a){var l=sn(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,kn(e,n,l,r)}n=n||rt(e.doc,t.line),i||(i=ln(e,n));var l=ve(n,e.doc.direction),s=t.ch,u=t.sticky;if(s>=n.text.length?(s=n.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a("before"==u?s-1:s,"before"==u);function c(e,t,r){return a(r?e-1:e,1==l[t].level!=r)}var d=me(l,s,u),f=pe,h=c(s,d,"before"==u);return null!=f&&(h.other=c(s,f,"before"!=u)),h}function Mn(e,t){var r=0;t=vt(e.doc,t),e.options.lineWrapping||(r=Pn(e.display)*t.ch);var n=rt(e.doc,t.line),i=cr(n)+Xr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Ln(e,t,r,n,i){var o=ct(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function Tn(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Ln(n.first,0,null,-1,-1);var i=lt(n,r),o=n.first+n.size-1;if(i>o)return Ln(n.first+n.size-1,rt(n,o).text.length,null,1,1);t<0&&(t=0);for(var a=rt(n,i);;){var l=En(e,a,i,t,r),s=tr(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=rt(n,i=u.line)}}function An(e,t,r,n){n-=bn(t);var i=t.text.length,o=fe((function(t){return sn(e,r,t-1).bottom<=n}),i,0);return{begin:o,end:i=fe((function(t){return sn(e,r,t).top>n}),o,i)}}function Dn(e,t,r,n){return r||(r=ln(e,t)),An(e,t,r,kn(e,t,sn(e,r,n),"line").top)}function Fn(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function En(e,t,r,n,i){i-=cr(t);var o=ln(e,t),a=bn(t),l=0,s=t.text.length,u=!0,c=ve(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?Nn:On)(e,t,r,o,c,n,i);l=(u=1!=d.level)?d.from:d.to-1,s=u?d.to:d.from-1}var f,h,p=null,m=null,g=fe((function(t){var r=sn(e,o,t);return r.top+=a,r.bottom+=a,!!Fn(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,m=r),!0)}),l,s),v=!1;if(m){var y=n-m.left<m.right-n,x=y==u;g=p+(x?0:1),h=x?"after":"before",f=y?m.left:m.right}else{u||g!=s&&g!=l||g++,h=0==g?"after":g==t.text.length?"before":sn(e,o,g-(u?1:0)).bottom+a<=i==u?"after":"before";var b=Sn(e,ct(r,g,h),"line",t,o);f=b.left,v=i<b.top?-1:i>=b.bottom?1:0}return Ln(r,g=de(t.text,g,1),h,v,n-f)}function On(e,t,r,n,i,o,a){var l=fe((function(l){var s=i[l],u=1!=s.level;return Fn(Sn(e,ct(r,u?s.to:s.from,u?"before":"after"),"line",t,n),o,a,!0)}),0,i.length-1),s=i[l];if(l>0){var u=1!=s.level,c=Sn(e,ct(r,u?s.from:s.to,u?"after":"before"),"line",t,n);Fn(c,o,a,!0)&&c.top>a&&(s=i[l-1])}return s}function Nn(e,t,r,n,i,o,a){var l=An(e,t,n,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,f=0;f<i.length;f++){var h=i[f];if(!(h.from>=u||h.to<=s)){var p=sn(e,n,1!=h.level?Math.min(u,h.to)-1:Math.max(s,h.from)).right,m=p<o?o-p+1e9:p-o;(!c||d>m)&&(c=h,d=m)}}return c||(c=i[i.length-1]),c.from<s&&(c={from:s,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function zn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==un){un=F("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)un.appendChild(document.createTextNode("x")),un.appendChild(F("br"));un.appendChild(document.createTextNode("x"))}D(e.measure,un);var r=un.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),A(e.measure),r||1}function Pn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=F("span","xxxxxxxxxx"),r=F("pre",[t],"CodeMirror-line-like");D(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Bn(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;r[l]=o.offsetLeft+o.clientLeft+i,n[l]=o.clientWidth}return{fixedPos:In(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function In(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Wn(e){var t=zn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Pn(e.display)-3);return function(i){if(sr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function Hn(e){var t=e.doc,r=Wn(e);t.iter((function(e){var t=r(e);t!=e.height&&ot(e,t)}))}function jn(e,t,r,n){var i=e.display;if(!r&&"true"==Ee(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(e){return null}var s,u=Tn(e,o,a);if(n&&u.xRel>0&&(s=rt(e.doc,u.line).text).length==u.ch){var c=q(s,s.length,e.options.tabSize)-s.length;u=ct(u.line,Math.max(0,Math.round((o-Qr(e.display).left)/Pn(e.display))-c))}return u}function _n(e,t){if(t>=e.display.viewTo)return null;if((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)Pt&&ar(e.doc,t)<i.viewTo&&Gn(e);else if(r<=i.viewFrom)Pt&&lr(e.doc,r+n)>i.viewFrom?Gn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Gn(e);else if(t<=i.viewFrom){var o=Vn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Gn(e)}else if(r>=i.viewTo){var a=Vn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Gn(e)}else{var l=Vn(e,t,t,-1),s=Vn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Tr(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):Gn(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function qn(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[_n(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==V(a,r)&&a.push(r)}}}function Gn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Vn(e,t,r,n){var i,o=_n(e,t),a=e.display.view;if(!Pt||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(n>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;ar(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function Un(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=Tr(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Tr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(_n(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Tr(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,_n(e,r)))),n.viewTo=r}function Kn(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 $n(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Xn(e,t){void 0===t&&(t=!0);var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var l=0;l<r.sel.ranges.length;l++)if(t||l!=r.sel.primIndex){var s=r.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(a){var c=a(e,s);c&&Yn(e,c,i)}else(u||e.options.showCursorWhenSelecting)&&Yn(e,s.head,i);u||Jn(e,s,o)}}return n}function Yn(e,t,r){var n=Sn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(F("div"," ","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=Cn(e,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(n.other){var l=r.appendChild(F("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=n.other.left+"px",l.style.top=n.other.top+"px",l.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Qn(e,t){return e.top-t.top||e.left-t.left}function Jn(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),a=Qr(e.display),l=a.left,s=Math.max(n.sizerWidth,Zr(e)-n.sizer.offsetLeft)-a.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(F("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?s-e:r)+"px;\n height: "+(n-t)+"px"))}function d(t,r,n){var o,a,d=rt(i,t),f=d.text.length;function h(r,n){return Cn(e,ct(t,r),"div",d,n)}function p(t,r,n){var i=Dn(e,d,null,t),o="ltr"==r==("after"==n)?"left":"right";return h("after"==n?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),o)[o]}var m=ve(d,i.direction);return he(m,r||0,null==n?f:n,(function(e,t,i,d){var g="ltr"==i,v=h(e,g?"left":"right"),y=h(t-1,g?"right":"left"),x=null==r&&0==e,b=null==n&&t==f,k=0==d,w=!m||d==m.length-1;if(y.top-v.top<=3){var C=(u?b:x)&&w,S=(u?x:b)&&k?l:(g?v:y).left,M=C?s:(g?y:v).right;c(S,v.top,M-S,v.bottom)}else{var L,T,A,D;g?(L=u&&x&&k?l:v.left,T=u?s:p(e,i,"before"),A=u?l:p(t,i,"after"),D=u&&b&&w?s:y.right):(L=u?p(e,i,"before"):l,T=!u&&x&&k?s:v.right,A=!u&&b&&w?l:y.left,D=u?p(t,i,"after"):s),c(L,v.top,T-L,v.bottom),v.bottom<y.top&&c(l,v.bottom,null,y.top),c(A,y.top,D-A,y.bottom)}(!o||Qn(v,o)<0)&&(o=v),Qn(y,o)<0&&(o=y),(!a||Qn(v,a)<0)&&(a=v),Qn(y,a)<0&&(a=y)})),{start:o,end:a}}var f=t.from(),h=t.to();if(f.line==h.line)d(f.line,f.ch,h.ch);else{var p=rt(i,f.line),m=rt(i,h.line),g=nr(p)==nr(m),v=d(f.line,f.ch,g?p.text.length+1:null).end,y=d(h.line,g?0:null,h.ch).start;g&&(v.top<y.top-2?(c(v.right,v.top,null,v.bottom),c(l,y.top,y.left,y.bottom)):c(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&c(l,v.bottom,null,y.top)}r.appendChild(o)}function Zn(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()||ni(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ei(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ri(e))}function ti(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&ni(e))}),100)}function ri(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(we(e,"focus",e,t),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Zn(e))}function ni(e,t){e.state.delayingBlurEvent||(e.state.focused&&(we(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function ii(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,s=0;s<t.view.length;s++){var u=t.view[s],c=e.options.lineWrapping,d=void 0,f=0;if(!u.hidden){if(i+=u.line.height,a&&l<8){var h=u.node.offsetTop+u.node.offsetHeight;d=h-r,r=h}else{var p=u.node.getBoundingClientRect();d=p.bottom-p.top,!c&&u.text.firstChild&&(f=u.text.firstChild.getBoundingClientRect().right-p.left-1)}var m=u.line.height-d;if((m>.005||m<-.005)&&(i<n&&(o-=m),ot(u.line,d),oi(u.line),u.rest))for(var g=0;g<u.rest.length;g++)oi(u.rest[g]);if(f>e.display.sizerWidth){var v=Math.ceil(f/Pn(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function oi(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 ai(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Xr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=lt(t,n),a=lt(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?(o=l,a=lt(t,cr(rt(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=lt(t,cr(rt(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function li(e,t){if(!Ce(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null,o=r.wrapper.ownerDocument;if(t.top+n.top<0?i=!0:t.bottom+n.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var a=F("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Xr(e.display))+"px;\n height: "+(t.bottom-t.top+Jr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function si(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==t.sticky?ct(t.line,t.ch+1,"before"):t,t=t.ch?ct(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=Sn(e,t),s=r&&r!=t?Sn(e,r):l,u=ci(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(vi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(xi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ui(e,t){var r=ci(e,t);null!=r.scrollTop&&vi(e,r.scrollTop),null!=r.scrollLeft&&xi(e,r.scrollLeft)}function ci(e,t){var r=e.display,n=zn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=en(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Yr(r),s=t.top<n,u=t.bottom>l-n;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?l:t.bottom)-o);c!=i&&(a.scrollTop=c)}var d=e.options.fixedGutter?0:r.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft-d,h=Zr(e)-r.gutters.offsetWidth,p=t.right-t.left>h;return p&&(t.right=t.left+h),t.left<10?a.scrollLeft=0:t.left<f?a.scrollLeft=Math.max(0,t.left+d-(p?0:10)):t.right>h+f-3&&(a.scrollLeft=t.right+(p?0:10)-h),a}function di(e,t){null!=t&&(mi(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function fi(e){mi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function hi(e,t,r){null==t&&null==r||mi(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function pi(e,t){mi(e),e.curOp.scrollToPos=t}function mi(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,gi(e,Mn(e,t.from),Mn(e,t.to),t.margin))}function gi(e,t,r,n){var i=ci(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});hi(e,i.scrollLeft,i.scrollTop)}function vi(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||$i(e,{top:t}),yi(e,t,!0),r&&$i(e),ji(e,100))}function yi(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 xi(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,Ji(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function bi(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Yr(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+Jr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var ki=function(e,t,r){this.cm=r;var n=this.vert=F("div",[F("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=F("div",[F("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),xe(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),xe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ki.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);this.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}},ki.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ki.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ki.prototype.zeroWidthHack=function(){var e=x&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new G,this.disableVert=new G},ki.prototype.enableZeroWidthBar=function(e,t,r){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.visibility="hidden":t.set(1e3,n)}e.style.visibility="",t.set(1e3,n)},ki.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wi=function(){};function Ci(e,t){t||(t=bi(e));var r=e.display.barWidth,n=e.display.barHeight;Si(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&ii(e),Si(e,bi(e)),r=e.display.barWidth,n=e.display.barHeight}function Si(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=""}wi.prototype.update=function(){return{bottom:0,right:0}},wi.prototype.setScrollLeft=function(){},wi.prototype.setScrollTop=function(){},wi.prototype.clear=function(){};var Mi={native:ki,null:wi};function Li(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Mi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),xe(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?xi(e,t):vi(e,t)}),e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var Ti=0;function Ai(e){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:++Ti,markArrays:null},Dr(e.curOp)}function Di(e){var t=e.curOp;t&&Er(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Fi(e)}))}function Fi(e){for(var t=e.ops,r=0;r<t.length;r++)Ei(t[r]);for(var n=0;n<t.length;n++)Oi(t[n]);for(var i=0;i<t.length;i++)Ni(t[i]);for(var o=0;o<t.length;o++)zi(t[o]);for(var a=0;a<t.length;a++)Pi(t[a])}function Ei(e){var t=e.cm,r=t.display;qi(t),e.updateMaxLine&&fr(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 Ri(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Oi(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function Ni(e){var t=e.cm,r=t.display;e.updatedDisplay&&ii(t),e.barMeasure=bi(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=on(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Jr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Zr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function zi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&xi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==N(W(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ci(t,e.barMeasure),e.updatedDisplay&&Qi(t,e.barMeasure),e.selectionChanged&&Zn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&ei(e.cm)}function Pi(e){var t=e.cm,r=t.display,n=t.doc;e.updatedDisplay&&Ki(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&yi(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&xi(t,e.scrollLeft,!0,!0),e.scrollToPos&&li(t,si(t,vt(n,e.scrollToPos.from),vt(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||we(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&we(o[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&we(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Bi(e,t){if(e.curOp)return t();Ai(e);try{return t()}finally{Di(e)}}function Ii(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ai(e);try{return t.apply(e,arguments)}finally{Di(e)}}}function Wi(e){return function(){if(this.curOp)return e.apply(this,arguments);Ai(this);try{return e.apply(this,arguments)}finally{Di(this)}}}function Hi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ai(t);try{return e.apply(this,arguments)}finally{Di(t)}}}function ji(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,_(_i,e))}function _i(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=St(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(n.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Je(t.mode,n.state):null,s=wt(e,o,n,!0);l&&(n.state=l),o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&Mt(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return ji(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Bi(e,(function(){for(var t=0;t<i.length;t++)qn(e,i[t],"text")}))}}var Ri=function(e,t,r){var n=e.display;this.viewport=t,this.visible=ai(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Zr(e),this.force=r,this.dims=Bn(e),this.events=[]};function qi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Jr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Jr(e)+"px",t.scrollbarsClipped=!0)}function Gi(e){if(e.hasFocus())return null;var t=N(W(e));if(!t||!O(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=j(e).getSelection();n.anchorNode&&n.extend&&O(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function Vi(e){if(e&&e.activeElt&&e.activeElt!=N(H(e.activeElt))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,r=t.defaultView.getSelection(),n=t.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),r.removeAllRanges(),r.addRange(n),r.extend(e.focusNode,e.focusOffset)}}function Ui(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Gn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Kn(e))return!1;Zi(e)&&(Gn(e),t.dims=Bn(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),Pt&&(o=ar(e.doc,o),a=lr(e.doc,a));var l=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Un(e,o,a),r.viewOffset=cr(rt(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var s=Kn(e);if(!l&&0==s&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Gi(e);return s>4&&(r.lineDiv.style.display="none"),Xi(e,r.updateLineNumbers,t.dims),s>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,Vi(u),A(r.cursorDiv),A(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ji(e,400)),r.updateLineNumbers=null,!0}function Ki(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Zr(e))n&&(t.visible=ai(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Yr(e.display)-en(e),r.top)}),t.visible=ai(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Ui(e,t))break;ii(e);var i=bi(e);$n(e),Ci(e,i),Qi(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 $i(e,t){var r=new Ri(e,t);if(Ui(e,r)){ii(e),Ki(e,r);var n=bi(e);$n(e),Ci(e,n),Qi(e,n),r.finish()}}function Xi(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function l(t){var r=t.nextSibling;return s&&x&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,d=0;d<u.length;d++){var f=u[d];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;a!=f.node;)a=l(a);var h=i&&null!=t&&t<=c&&f.lineNumber;f.changes&&(V(f.changes,"gutter")>-1&&(h=!1),Pr(e,f,c,r)),h&&(A(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(ut(e.options,c)))),a=f.node.nextSibling}else{var p=qr(e,f,c,r);o.insertBefore(p,a)}c+=f.size}for(;a;)a=l(a)}function Yi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Nr(e,"gutterChanged",e)}function Qi(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+Jr(e)+"px"}function Ji(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=In(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Zi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=ut(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(F("div",[F("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Yi(e.display),!0}return!1}function eo(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;n=!0}r.push({className:o,style:a})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function to(e){var t=e.gutters,r=e.gutterSpecs;A(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,a=i.style,l=t.appendChild(F("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Yi(e)}function ro(e){to(e.display),Rn(e),Ji(e)}function no(e,t,n,i){var o=this;this.input=n,o.scrollbarFiller=F("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=F("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=E("div",null,"CodeMirror-code"),o.selectionDiv=F("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=F("div",null,"CodeMirror-cursors"),o.measure=F("div",null,"CodeMirror-measure"),o.lineMeasure=F("div",null,"CodeMirror-measure"),o.lineSpace=E("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=E("div",[o.lineSpace],"CodeMirror-lines");o.mover=F("div",[u],null,"position: relative"),o.sizer=F("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=F("div",null,null,"position: absolute; height: "+U+"px; width: 1px;"),o.gutters=F("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=F("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=F("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),c&&d>=105&&(o.wrapper.style.clipPath="inset(0px)"),o.wrapper.setAttribute("translate","no"),a&&l<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),s||r&&y||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=eo(i.gutters,i.lineNumbers),to(o),n.init(o)}Ri.prototype.signal=function(e,t){Me(e,t)&&this.events.push(arguments)},Ri.prototype.finish=function(){for(var e=0;e<this.events.length;e++)we.apply(null,this.events[e])};var io=0,oo=null;function ao(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 lo(e){var t=ao(e);return t.x*=oo,t.y*=oo,t}function so(e,t){c&&102==d&&(null==e.display.chromeScrollHack?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout((function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""}),100));var n=ao(t),i=n.x,o=n.y,a=oo;0===t.deltaMode&&(i=t.deltaX,o=t.deltaY,a=1);var l=e.display,u=l.scroller,h=u.scrollWidth>u.clientWidth,p=u.scrollHeight>u.clientHeight;if(i&&h||o&&p){if(o&&x&&s)e:for(var m=t.target,g=l.view;m!=u;m=m.parentNode)for(var v=0;v<g.length;v++)if(g[v].node==m){e.display.currentWheelTarget=m;break e}if(i&&!r&&!f&&null!=a)return o&&p&&vi(e,Math.max(0,u.scrollTop+o*a)),xi(e,Math.max(0,u.scrollLeft+i*a)),(!o||o&&p)&&Te(t),void(l.wheelStartX=null);if(o&&null!=a){var y=o*a,b=e.doc.scrollTop,k=b+l.wrapper.clientHeight;y<0?b=Math.max(0,b+y-50):k=Math.min(e.doc.height,k+y+50),$i(e,{top:b,bottom:k})}io<20&&0!==t.deltaMode&&(null==l.wheelStartX?(l.wheelStartX=u.scrollLeft,l.wheelStartY=u.scrollTop,l.wheelDX=i,l.wheelDY=o,setTimeout((function(){if(null!=l.wheelStartX){var e=u.scrollLeft-l.wheelStartX,t=u.scrollTop-l.wheelStartY,r=t&&l.wheelDY&&t/l.wheelDY||e&&l.wheelDX&&e/l.wheelDX;l.wheelStartX=l.wheelStartY=null,r&&(oo=(oo*io+r)/(io+1),++io)}}),200)):(l.wheelDX+=i,l.wheelDY+=o))}}a?oo=-.53:r?oo=15:c?oo=-.7:h&&(oo=-1/3);var uo=function(e,t){this.ranges=e,this.primIndex=t};uo.prototype.primary=function(){return this.ranges[this.primIndex]},uo.prototype.equals=function(e){if(e==this)return!0;if(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(!ft(r.anchor,n.anchor)||!ft(r.head,n.head))return!1}return!0},uo.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new co(ht(this.ranges[t].anchor),ht(this.ranges[t].head));return new uo(e,this.primIndex)},uo.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},uo.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(dt(t,n.from())>=0&&dt(e,n.to())<=0)return r}return-1};var co=function(e,t){this.anchor=e,this.head=t};function fo(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort((function(e,t){return dt(e.from(),t.from())})),r=V(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=dt(l.to(),a.from());if(n&&!a.empty()?s>0:s>=0){var u=mt(l.from(),a.from()),c=pt(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head;o<=r&&--r,t.splice(--o,2,new co(d?c:u,d?u:c))}}return new uo(t,r)}function ho(e,t){return new uo([new co(e,t||e)],0)}function po(e){return e.text?ct(e.from.line+e.text.length-1,ee(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function mo(e,t){if(dt(e,t.from)<0)return e;if(dt(e,t.to)<=0)return po(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+=po(t).ch-t.to.ch),ct(r,n)}function go(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new co(mo(i.anchor,t),mo(i.head,t)))}return fo(e.cm,r,e.sel.primIndex)}function vo(e,t,r){return e.line==t.line?ct(r.line,e.ch-t.ch+r.ch):ct(r.line+(e.line-t.line),e.ch)}function yo(e,t,r){for(var n=[],i=ct(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=vo(l.from,i,o),u=vo(po(l),i,o);if(i=l.to,o=u,"around"==r){var c=e.sel.ranges[a],d=dt(c.head,c.anchor)<0;n[a]=new co(d?u:s,d?s:u)}else n[a]=new co(s,s)}return new uo(n,e.sel.primIndex)}function xo(e){e.doc.mode=Xe(e.options,e.doc.modeOption),bo(e)}function bo(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,ji(e,100),e.state.modeGen++,e.curOp&&Rn(e)}function ko(e,t){return 0==t.from.ch&&0==t.to.ch&&""==ee(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function wo(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){pr(e,r,i,n),Nr(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new hr(u[o],i(o),n));return r}var l=t.from,s=t.to,u=t.text,c=rt(e,l.line),d=rt(e,s.line),f=ee(u),h=i(u.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(ko(e,t)){var m=a(0,u.length-1);o(d,d.text,h),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(c==d)if(1==u.length)o(c,c.text.slice(0,l.ch)+f+c.text.slice(s.ch),h);else{var g=a(1,u.length-1);g.push(new hr(f+c.text.slice(s.ch),h,n)),o(c,c.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,l.ch)+u[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(c,c.text.slice(0,l.ch)+u[0],i(0)),o(d,f+d.text.slice(s.ch),h);var v=a(1,u.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,v)}Nr(e,"change",e,t)}function Co(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;r&&!s||(t(l.doc,s),n(l.doc,e,s))}}}n(e,null,!0)}function So(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Hn(e),xo(e),Mo(e),e.options.direction=t.direction,e.options.lineWrapping||fr(e),e.options.mode=t.modeOption,Rn(e)}function Mo(e){("rtl"==e.doc.direction?z:T)(e.display.lineDiv,"CodeMirror-rtl")}function Lo(e){Bi(e,(function(){Mo(e),Rn(e)}))}function To(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 Ao(e,t){var r={from:ht(t.from),to:po(t),text:nt(e,t.from,t.to)};return Po(e,r,t.from.line,t.to.line+1),Co(e,(function(e){return Po(e,r,t.from.line,t.to.line+1)}),!0),r}function Do(e){for(;e.length&&ee(e).ranges;)e.pop()}function Fo(e,t){return t?(Do(e.done),ee(e.done)):e.done.length&&!ee(e.done).ranges?ee(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),ee(e.done)):void 0}function Eo(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Fo(i,i.lastOp==n)))a=ee(o.changes),0==dt(t.from,t.to)&&0==dt(t.from,a.to)?a.to=po(t):o.changes.push(Ao(e,t));else{var s=ee(i.done);for(s&&s.ranges||zo(e.sel,i.done),o={changes:[Ao(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||we(e,"historyAdded")}function Oo(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function No(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Oo(e,o,ee(i.done),t))?i.done[i.done.length-1]=t:zo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Do(i.undone)}function zo(e,t){var r=ee(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Po(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 Bo(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}function Io(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Bo(r[i]));return n}function Wo(e,t){var r=Io(e,t),n=Gt(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function Ho(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?uo.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var u=a[s],c=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&V(t,Number(c[1]))>-1&&(ee(l)[d]=u[d],delete u[d])}}}return n}function jo(e,t,r,n){if(n){var i=e.anchor;if(r){var o=dt(t,i)<0;o!=dt(r,i)<0?(i=t,t=r):o!=dt(t,r)<0&&(t=r)}return new co(i,t)}return new co(r||t,t)}function _o(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ko(e,new uo([jo(e.sel.primary(),t,r,i)],0),n)}function Ro(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]=jo(e.sel.ranges[o],t[o],null,i);Ko(e,fo(e.cm,n,e.sel.primIndex),r)}function qo(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Ko(e,fo(e.cm,i,e.sel.primIndex),n)}function Go(e,t,r,n){Ko(e,ho(t,r),n)}function Vo(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new co(vt(e,t[r].anchor),vt(e,t[r].head))},origin:r&&r.origin};return we(e,"beforeSelectionChange",e,n),e.cm&&we(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?fo(e.cm,n.ranges,n.ranges.length-1):t}function Uo(e,t,r){var n=e.history.done,i=ee(n);i&&i.ranges?(n[n.length-1]=t,$o(e,t,r)):Ko(e,t,r)}function Ko(e,t,r){$o(e,t,r),No(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function $o(e,t,r){(Me(e,"beforeSelectionChange")||e.cm&&Me(e.cm,"beforeSelectionChange"))&&(t=Vo(e,t,r));var n=r&&r.bias||(dt(t.primary().head,e.sel.primary().head)<0?-1:1);Xo(e,Qo(e,t,n,!0)),r&&!1===r.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||fi(e.cm)}function Xo(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Se(e.cm)),Nr(e,"cursorActivity",e))}function Yo(e){Xo(e,Qo(e,e.sel,null,!1))}function Qo(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Zo(e,a.anchor,l&&l.anchor,r,n),u=a.head==a.anchor?s:Zo(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new co(s,u))}return i?fo(e.cm,i,t.primIndex):t}function Jo(e,t,r,n,i){var o=rt(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,c="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==l.from||(u?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(c?l.to>=t.ch:l.to>t.ch))){if(i&&(we(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var d=s.find(n<0?1:-1),f=void 0;if((n<0?c:u)&&(d=ea(e,d,-n,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=dt(d,r))&&(n<0?f<0:f>0))return Jo(e,d,t,n,i)}var h=s.find(n<0?-1:1);return(n<0?u:c)&&(h=ea(e,h,n,h.line==t.line?o:null)),h?Jo(e,h,t,n,i):null}}return t}function Zo(e,t,r,n,i){var o=n||1,a=Jo(e,t,r,o,i)||!i&&Jo(e,t,r,o,!0)||Jo(e,t,r,-o,i)||!i&&Jo(e,t,r,-o,!0);return a||(e.cantEdit=!0,ct(e.first,0))}function ea(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?vt(e,ct(t.line-1)):null:r>0&&t.ch==(n||rt(e,t.line)).text.length?t.line<e.first+e.size-1?ct(t.line+1,0):null:new ct(t.line,t.ch+r)}function ta(e){e.setSelection(ct(e.firstLine(),0),ct(e.lastLine()),$)}function ra(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=vt(e,t)),r&&(n.to=vt(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),we(e,"beforeChange",e,n),e.cm&&we(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 na(e,t,r){if(e.cm){if(!e.cm.curOp)return Ii(e.cm,na)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Me(e,"beforeChange")||e.cm&&Me(e.cm,"beforeChange"))||(t=ra(e,t,!0))){var n=zt&&!r&&Ut(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)ia(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else ia(e,t)}}function ia(e,t){if(1!=t.text.length||""!=t.text[0]||0!=dt(t.from,t.to)){var r=go(e,t);Eo(e,t,r,e.cm?e.cm.curOp.id:NaN),la(e,t,r,Gt(e,t));var n=[];Co(e,(function(e,r){r||-1!=V(n,e.history)||(fa(e.history,t),n.push(e.history)),la(e,t,null,Gt(e,t))}))}}function oa(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,a=e.sel,l="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,u=0;u<l.length&&(i=l[u],r?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=l.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=l.pop()).ranges){if(n)return void l.push(i);break}if(zo(i,s),r&&!i.equals(e.sel))return void Ko(e,i,{clearRedo:!1});a=i}var c=[];zo(a,s),s.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=Me(e,"beforeChange")||e.cm&&Me(e.cm,"beforeChange"),f=function(r){var n=i.changes[r];if(n.origin=t,d&&!ra(e,n,!1))return l.length=0,{};c.push(Ao(e,n));var o=r?go(e,n):ee(l);la(e,n,o,Wo(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:po(n)});var a=[];Co(e,(function(e,t){t||-1!=V(a,e.history)||(fa(e.history,n),a.push(e.history)),la(e,n,null,Wo(e,n))}))},h=i.changes.length-1;h>=0;--h){var p=f(h);if(p)return p.v}}}}function aa(e,t){if(0!=t&&(e.first+=t,e.sel=new uo(te(e.sel.ranges,(function(e){return new co(ct(e.anchor.line+t,e.anchor.ch),ct(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++)qn(e.cm,n,"gutter")}}function la(e,t,r,n){if(e.cm&&!e.cm.curOp)return Ii(e.cm,la)(e,t,r,n);if(t.to.line<e.first)aa(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);aa(e,i),t={from:ct(e.first,0),to:ct(t.to.line+i,t.to.ch),text:[ee(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ct(o,rt(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=nt(e,t.from,t.to),r||(r=go(e,t)),e.cm?sa(e.cm,t,n):wo(e,t,n),$o(e,r,$),e.cantEdit&&Zo(e,ct(e.firstLine(),0))&&(e.cantEdit=!1)}}function sa(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=at(nr(rt(n,o.line))),n.iter(s,a.line+1,(function(e){if(e==i.maxLine)return l=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&Se(e),wo(n,t,r,Wn(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,(function(e){var t=dr(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)})),l&&(e.curOp.updateMaxLine=!0)),Nt(n,o.line),ji(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?Rn(e):o.line!=a.line||1!=t.text.length||ko(e.doc,t)?Rn(e,o.line,a.line+1,u):qn(e,o.line,"text");var c=Me(e,"changes"),d=Me(e,"change");if(d||c){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&Nr(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function ua(e,t,r,n,i){var o;n||(n=r),dt(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),na(e,{from:r,to:n,text:t,origin:i})}function ca(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function da(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)ca(o.ranges[l].anchor,t,r,n),ca(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(r<u.from.line)u.from=ct(u.from.line+n,u.from.ch),u.to=ct(u.to.line+n,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function fa(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;da(e.done,r,n,i),da(e.undone,r,n,i)}function ha(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=rt(e,gt(e,t)):i=at(t),null==i?null:(n(o,i)&&e.cm&&qn(e.cm,i,r),o)}function pa(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 ma(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}co.prototype.from=function(){return mt(this.anchor,this.head)},co.prototype.to=function(){return pt(this.anchor,this.head)},co.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},pa.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,mr(i),Nr(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}},ma.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),a=n.height;if(n.removeInner(e,o),this.height-=a-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 pa))){var l=[];this.collapse(l),this.children=[new pa(l)],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 a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new pa(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++n,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ma(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=V(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new ma(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 a=Math.min(t,o-e);if(i.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var ga=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 va(e,t,r){cr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&di(e,r)}function ya(e,t,r,n){var i=new ga(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),ha(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!sr(e,t)){var n=cr(t)<e.scrollTop;ot(t,t.height+Kr(i)),n&&di(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&Nr(o,"lineWidgetAdded",o,i,"number"==typeof t?t:at(t)),i}ga.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=at(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=Kr(this);ot(r,Math.max(0,r.height-o)),e&&(Bi(e,(function(){va(e,r,-o),qn(e,n,"widget")})),Nr(e,"lineWidgetCleared",e,this,n))}},ga.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Kr(this)-t;i&&(sr(this.doc,n)||ot(n,n.height+i),r&&Bi(r,(function(){r.curOp.forceUpdate=!0,va(r,n,i),Nr(r,"lineWidgetChanged",r,e,at(n))})))},Le(ga);var xa=0,ba=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++xa};function ka(e,t,r,n,i){if(n&&n.shared)return Ca(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Ii(e.cm,ka)(e,t,r,n,i);var o=new ba(e,i),a=dt(t,r);if(n&&R(n,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=E("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(rr(e,t.line,t,r,o)||t.line!=r.line&&rr(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");It()}o.addToHistory&&Eo(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var l,s=t.line,u=e.cm;if(e.iter(s,r.line+1,(function(n){u&&o.collapsed&&!u.options.lineWrapping&&nr(n)==u.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&ot(n,0),_t(n,new Wt(o,s==t.line?t.ch:null,s==r.line?r.ch:null),e.cm&&e.cm.curOp),++s})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){sr(e,t)&&ot(t,0)})),o.clearOnEnter&&xe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Bt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++xa,o.atomic=!0),u){if(l&&(u.curOp.updateMaxLine=!0),o.collapsed)Rn(u,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=r.line;c++)qn(u,c,"text");o.atomic&&Yo(u.doc),Nr(u,"markerAdded",u,o)}return o}ba.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ai(e),Me(this,"clear")){var r=this.find();r&&Nr(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=Ht(a.markedSpans,this);e&&!this.collapsed?qn(e,at(a),"text"):e&&(null!=l.to&&(i=at(a)),null!=l.from&&(n=at(a))),a.markedSpans=jt(a.markedSpans,l),null==l.from&&this.collapsed&&!sr(this.doc,a)&&e&&ot(a,zn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=nr(this.lines[s]),c=dr(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&&Yo(e.doc)),e&&Nr(e,"markerCleared",e,this,n,i),t&&Di(e),this.parent&&this.parent.clear()}},ba.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Ht(o.markedSpans,this);if(null!=a.from&&(r=ct(t?o:at(o),a.from),-1==e))return r;if(null!=a.to&&(n=ct(t?o:at(o),a.to),1==e))return n}return r&&{from:r,to:n}},ba.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&Bi(n,(function(){var i=t.line,o=at(t.line),a=an(n,o);if(a&&(mn(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!sr(r.doc,i)&&null!=r.height){var l=r.height;r.height=null;var s=Kr(r)-l;s&&ot(i,i.height+s)}Nr(n,"markerChanged",n,e)}))},ba.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=V(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ba.prototype.detachLine=function(e){if(this.lines.splice(V(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Le(ba);var wa=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function Ca(e,t,r,n,i){(n=R(n)).shared=!1;var o=[ka(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Co(e,(function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(ka(e,vt(e,t),vt(e,r),n,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=ee(o)})),new wa(o,a)}function Sa(e){return e.findMarks(ct(e.first,0),e.clipPos(ct(e.lastLine())),(function(e){return e.parent}))}function Ma(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(dt(o,a)){var l=ka(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}function La(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];Co(r.primary.doc,(function(e){return n.push(e)}));for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==V(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}wa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Nr(this,"clear")}},wa.prototype.find=function(e,t){return this.primary.find(e,t)},Le(wa);var Ta=0,Aa=function(e,t,r,n,i){if(!(this instanceof Aa))return new Aa(e,t,r,n,i);null==r&&(r=0),ma.call(this,[new pa([new hr("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=ct(r,0);this.sel=ho(o),this.history=new To(null),this.id=++Ta,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),wo(this,{from:o,to:o,text:e}),Ko(this,ho(o),$)};Aa.prototype=ie(ma.prototype,{constructor:Aa,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=it(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Hi((function(e){var t=ct(this.first,0),r=this.first+this.size-1;na(this,{from:t,to:ct(r,rt(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&hi(this.cm,0,0),Ko(this,ho(t),$)})),replaceRange:function(e,t,r,n){ua(this,e,t=vt(this,t),r=r?vt(this,r):t,n)},getRange:function(e,t,r){var n=nt(this,vt(this,e),vt(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(st(this,e))return rt(this,e)},getLineNumber:function(e){return at(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=rt(this,e)),nr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return vt(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:Hi((function(e,t,r){Go(this,vt(this,"number"==typeof e?ct(e,t||0):e),null,r)})),setSelection:Hi((function(e,t,r){Go(this,vt(this,e),vt(this,t||e),r)})),extendSelection:Hi((function(e,t,r){_o(this,vt(this,e),t&&vt(this,t),r)})),extendSelections:Hi((function(e,t){Ro(this,xt(this,e),t)})),extendSelectionsBy:Hi((function(e,t){Ro(this,xt(this,te(this.sel.ranges,e)),t)})),setSelections:Hi((function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new co(vt(this,e[i].anchor),vt(this,e[i].head||e[i].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ko(this,fo(this.cm,n,t),r)}})),addSelection:Hi((function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new co(vt(this,e),vt(this,t||e))),Ko(this,fo(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=nt(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=nt(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:Hi((function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var l=t&&"end"!=t&&yo(this,n,t),s=n.length-1;s>=0;s--)na(this,n[s]);l?Uo(this,l):this.cm&&fi(this.cm)})),undo:Hi((function(){oa(this,"undo")})),redo:Hi((function(){oa(this,"redo")})),undoSelection:Hi((function(){oa(this,"undo",!0)})),redoSelection:Hi((function(){oa(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 To(this.history),Co(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:Ho(this.history.done),undone:Ho(this.history.undone)}},setHistory:function(e){var t=this.history=new To(this.history);t.done=Ho(e.done.slice(0),null,!0),t.undone=Ho(e.undone.slice(0),null,!0)},setGutterMarker:Hi((function(e,t,r){return ha(this,e,"gutter",(function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&se(n)&&(e.gutterMarkers=null),!0}))})),clearGutter:Hi((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&ha(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,se(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!st(this,e))return null;if(t=e,!(e=rt(this,e)))return null}else if(null==(t=at(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:Hi((function(e,t,r){return ha(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(M(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0}))})),removeLineClass:Hi((function(e,t,r){return ha(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(M(r));if(!o)return!1;var a=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:Hi((function(e,t,r){return ya(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return ka(this,vt(this,e),vt(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 ka(this,e=vt(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=rt(this,(e=vt(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=vt(this,e),t=vt(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.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})),vt(this,ct(r,t))},indexFromPos:function(e){var t=(e=vt(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 Aa(it(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 Aa(it(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}],Ma(n,Sa(this)),n},unlinkDoc:function(e){if(e instanceof Rl&&(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),La(Sa(this));break}if(e.history==this.history){var r=[e.id];Co(e,(function(e){return r.push(e.id)}),!0),e.history=new To(null),e.history.done=Ho(this.history.done,r),e.history.undone=Ho(this.history.undone,r)}},iterLinkedDocs:function(e){Co(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):He(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Hi((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Lo(this.cm))}))}),Aa.prototype.eachLine=Aa.prototype.iter;var Da=0;function Fa(e){var t=this;if(Na(t),!Ce(t,e)&&!$r(t.display,e)){Te(e),a&&(Da=+new Date);var r=jn(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&&Ii(t,(function(){var e={from:r=vt(t.doc,r),to:r,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};na(t.doc,e),Uo(t.doc,ho(vt(t.doc,r),vt(t.doc,po(e))))}))()},u=function(e,r){if(t.options.allowDropFileTypes&&-1==V(t.options.allowDropFileTypes,e.type))s();else{var n=new FileReader;n.onerror=function(){return s()},n.onload=function(){var e=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[r]=e),s()},n.readAsText(e)}},c=0;c<n.length;c++)u(n[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),$o(t.doc,ho(r,r)),f)for(var h=0;h<f.length;++h)ua(t.doc,"",f[h].anchor,f[h].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ea(e,t){if(a&&(!e.state.draggingText||+new Date-Da<100))Fe(t);else if(!Ce(e,t)&&!$r(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var r=F("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),f&&r.parentNode.removeChild(r)}}function Oa(e,t){var r=jn(e,t);if(r){var n=document.createDocumentFragment();Yn(e,r,n),e.display.dragCursor||(e.display.dragCursor=F("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),D(e.display.dragCursor,n)}}function Na(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function za(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 Pa=!1;function Ba(){Pa||(Ia(),Pa=!0)}function Ia(){var e;xe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,za(Wa)}),100))})),xe(window,"blur",(function(){return za(ni)}))}function Wa(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ha={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"},ja=0;ja<10;ja++)Ha[ja+48]=Ha[ja+96]=String(ja);for(var _a=65;_a<=90;_a++)Ha[_a]=String.fromCharCode(_a);for(var Ra=1;Ra<=12;Ra++)Ha[Ra+111]=Ha[Ra+63235]="F"+Ra;var qa={};function Ga(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Va(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=te(r.split(" "),Ga),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=n):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var u in t)e[u]=t[u];return e}function Ua(e,t,r,n){var i=(t=Ya(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 Ua(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Ua(e,t.fallthrough[o],r,n);if(a)return a}}}function Ka(e){var t="string"==typeof e?e:Ha[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function $a(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Mod"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function Xa(e,t){if(f&&34==e.keyCode&&e.char)return!1;var r=Ha[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),$a(r,e,t))}function Ya(e){return"string"==typeof e?qa[e]:e}function Qa(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&dt(o.from,ee(n).to)<=0;){var a=n.pop();if(dt(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}Bi(e,(function(){for(var t=n.length-1;t>=0;t--)ua(e.doc,"",n[t].from,n[t].to,"+delete");fi(e)}))}function Ja(e,t,r){var n=de(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Za(e,t,r){var n=Ja(e,t.ch,r);return null==n?null:new ct(t.line,n,r<0?"after":"before")}function el(e,t,r,n,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ve(r,t.doc.direction);if(o){var a,l=i<0?ee(o):o[0],s=i<0==(1==l.level)?"after":"before";if(l.level>0||"rtl"==t.doc.direction){var u=ln(t,r);a=i<0?r.text.length-1:0;var c=sn(t,u,a).top;a=fe((function(e){return sn(t,u,e).top==c}),i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=Ja(r,a,1))}else a=i<0?l.to:l.from;return new ct(n,a,s)}}return new ct(n,i<0?r.text.length:0,i<0?"before":"after")}function tl(e,t,r,n){var i=ve(t,e.doc.direction);if(!i)return Za(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 o=me(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return Za(t,r,n);var l,s=function(e,r){return Ja(t,e instanceof ct?e.ch:e,r)},u=function(r){return e.options.lineWrapping?(l=l||ln(e,t),Dn(e,t,l,r)):{begin:0,end:t.text.length}},c=u("before"==r.sticky?s(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==n<0,f=s(r,d?1:-1);if(null!=f&&(d?f<=a.to&&f<=c.end:f>=a.from&&f>=c.begin)){var h=d?"before":"after";return new ct(r.line,f,h)}}var p=function(e,t,n){for(var o=function(e,t){return t?new ct(r.line,s(e,1),"before"):new ct(r.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),u=l?n.begin:s(n.end,-1);if(a.from<=u&&u<a.to)return o(u,l);if(u=l?a.from:s(a.to,-1),n.begin<=u&&u<n.end)return o(u,l)}},m=p(o+n,n,c);if(m)return m;var g=n>0?c.end:s(c.begin,-1);return null==g||n>0&&g==t.text.length||!(m=p(n>0?0:i.length-1,n,u(g)))?null:m}qa.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"},qa.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"},qa.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"},qa.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"]},qa.default=x?qa.macDefault:qa.pcDefault;var rl={selectAll:ta,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return Qa(e,(function(t){if(t.empty()){var r=rt(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:ct(t.head.line+1,0)}:{from:t.head,to:ct(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Qa(e,(function(t){return{from:ct(t.from().line,0),to:vt(e.doc,ct(t.to().line+1,0))}}))},delLineLeft:function(e){return Qa(e,(function(e){return{from:ct(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Qa(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 Qa(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(ct(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ct(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return nl(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ol(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return il(e,t.head.line)}),{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")}),Y)},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")}),Y)},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/)?ol(e,t.head):n}),Y)},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("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=q(e.getLine(o.line),o.ch,n);t.push(Z(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Bi(e,(function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=rt(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ct(i.line,i.ch-1)),i.ch>0)i=new ct(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ct(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=rt(e.doc,i.line-1).text;a&&(i=new ct(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ct(i.line-1,a.length-1),i,"+transpose"))}r.push(new co(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){return Bi(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)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);fi(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function nl(e,t){var r=rt(e.doc,t),n=nr(r);return n!=r&&(t=at(n)),el(!0,e,n,t,1)}function il(e,t){var r=rt(e.doc,t),n=ir(r);return n!=r&&(t=at(n)),el(!0,e,r,t,-1)}function ol(e,t){var r=nl(e,t.line),n=rt(e.doc,r.line),i=ve(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(r.ch,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return ct(r.line,a?0:o,r.sticky)}return r}function al(e,t,r){if("string"==typeof t&&!(t=rl[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)!=K}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function ll(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Ua(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Ua(t,e.options.extraKeys,r,e)||Ua(t,e.options.keyMap,r,e)}var sl=new G;function ul(e,t,r,n){var i=e.state.keySeq;if(i){if(Ka(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:sl.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),cl(e,i+" "+t,r,n))return!0}return cl(e,t,r,n)}function cl(e,t,r,n){var i=ll(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&Nr(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(Te(r),Zn(e)),!!i}function dl(e,t){var r=Xa(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ul(e,"Shift-"+r,t,(function(t){return al(e,t,!0)}))||ul(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return al(e,t)})):ul(e,r,t,(function(t){return al(e,t)})))}function fl(e,t,r){return ul(e,"'"+r+"'",t,(function(t){return al(e,t,!0)}))}var hl=null;function pl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=N(W(t)),Ce(t,e)))){a&&l<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var i=dl(t,e);f&&(hl=i?n:null,i||88!=n||_e||!(x?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),r&&!x&&!i&&46==n&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||ml(t)}}function ml(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(T(t,"CodeMirror-crosshair"),ke(document,"keyup",r),ke(document,"mouseover",r))}z(t,"CodeMirror-crosshair"),xe(document,"keyup",r),xe(document,"mouseover",r)}function gl(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ce(this,e)}function vl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||$r(t.display,e)||Ce(t,e)||e.ctrlKey&&!e.altKey||x&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(f&&r==hl)return hl=null,void Te(e);if(!f||e.which&&!(e.which<10)||!dl(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(fl(t,e,i)||t.display.input.onKeyPress(e))}}}var yl,xl,bl=400,kl=function(e,t,r){this.time=e,this.pos=t,this.button=r};function wl(e,t){var r=+new Date;return xl&&xl.compare(r,e,t)?(yl=xl=null,"triple"):yl&&yl.compare(r,e,t)?(xl=new kl(r,e,t),yl=null,"double"):(yl=new kl(r,e,t),xl=null,"single")}function Cl(e){var t=this,r=t.display;if(!(Ce(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,$r(r,e))s||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100));else if(!Ol(t,e)){var n=jn(t,e),i=Oe(e),o=n?wl(n,i):"single";j(t).focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&Sl(t,i,n,o,e)||(1==i?n?Ll(t,n,o,e):Ee(e)==r.scroller&&Te(e):2==i?(n&&_o(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):ti(t)))}}function Sl(e,t,r,n,i){var o="Click";return"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o),ul(e,$a(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=rl[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=K}finally{e.state.suppressEdits=!1}return n}))}function Ml(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=b?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=x?r.metaKey:r.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(x?r.altKey:r.ctrlKey)),i}function Ll(e,t,r,n){a?setTimeout(_(ei,e),0):e.curOp.focus=N(W(e));var i,o=Ml(e,r,n),l=e.doc.sel;e.options.dragDrop&&Pe&&!e.isReadOnly()&&"single"==r&&(i=l.contains(t))>-1&&(dt((i=l.ranges[i]).from(),t)<0||t.xRel>0)&&(dt(i.to(),t)>0||t.xRel<0)?Tl(e,n,t,o):Dl(e,n,t,o)}function Tl(e,t,r,n){var i=e.display,o=!1,u=Ii(e,(function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ti(e)),ke(i.wrapper.ownerDocument,"mouseup",u),ke(i.wrapper.ownerDocument,"mousemove",c),ke(i.scroller,"dragstart",d),ke(i.scroller,"drop",u),o||(Te(t),n.addNew||_o(e.doc,r,null,null,n.extend),s&&!h||a&&9==l?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};s&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!n.moveOnDrag,xe(i.wrapper.ownerDocument,"mouseup",u),xe(i.wrapper.ownerDocument,"mousemove",c),xe(i.scroller,"dragstart",d),xe(i.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Al(e,t,r){if("char"==r)return new co(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new co(ct(t.line,0),vt(e.doc,ct(t.line+1,0)));var n=r(e,t);return new co(n.from,n.to)}function Dl(e,t,r,n){a&&ti(e);var i=e.display,o=e.doc;Te(t);var l,s,u=o.sel,c=u.ranges;if(n.addNew&&!n.extend?(s=o.sel.contains(r),l=s>-1?c[s]:new co(r,r)):(l=o.sel.primary(),s=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(l=new co(r,r)),r=jn(e,t,!0,!0),s=-1;else{var d=Al(e,r,n.unit);l=n.extend?jo(l,d.anchor,d.head,n.extend):d}n.addNew?-1==s?(s=c.length,Ko(o,fo(e,c.concat([l]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==n.unit&&!n.extend?(Ko(o,fo(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):qo(o,s,l,X):(s=0,Ko(o,new uo([l],0),X),u=o.sel);var f=r;function h(t){if(0!=dt(f,t))if(f=t,"rectangle"==n.unit){for(var i=[],a=e.options.tabSize,c=q(rt(o,r.line).text,r.ch,a),d=q(rt(o,t.line).text,t.ch,a),h=Math.min(c,d),p=Math.max(c,d),m=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=g;m++){var v=rt(o,m).text,y=Q(v,h,a);h==p?i.push(new co(ct(m,y),ct(m,y))):v.length>y&&i.push(new co(ct(m,y),ct(m,Q(v,p,a))))}i.length||i.push(new co(r,r)),Ko(o,fo(e,u.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x,b=l,k=Al(e,t,n.unit),w=b.anchor;dt(k.anchor,w)>0?(x=k.head,w=mt(b.from(),k.anchor)):(x=k.anchor,w=pt(b.to(),k.head));var C=u.ranges.slice(0);C[s]=Fl(e,new co(vt(o,w),x)),Ko(o,fo(e,C,s),X)}}var p=i.wrapper.getBoundingClientRect(),m=0;function g(t){var r=++m,a=jn(e,t,!0,"rectangle"==n.unit);if(a)if(0!=dt(a,f)){e.curOp.focus=N(W(e)),h(a);var l=ai(i,o);(a.line>=l.to||a.line<l.from)&&setTimeout(Ii(e,(function(){m==r&&g(t)})),150)}else{var s=t.clientY<p.top?-20:t.clientY>p.bottom?20:0;s&&setTimeout(Ii(e,(function(){m==r&&(i.scroller.scrollTop+=s,g(t))})),50)}}function v(t){e.state.selectingText=!1,m=1/0,t&&(Te(t),i.input.focus()),ke(i.wrapper.ownerDocument,"mousemove",y),ke(i.wrapper.ownerDocument,"mouseup",x),o.history.lastSelOrigin=null}var y=Ii(e,(function(e){0!==e.buttons&&Oe(e)?g(e):v(e)})),x=Ii(e,v);e.state.selectingText=x,xe(i.wrapper.ownerDocument,"mousemove",y),xe(i.wrapper.ownerDocument,"mouseup",x)}function Fl(e,t){var r=t.anchor,n=t.head,i=rt(e.doc,r.line);if(0==dt(r,n)&&r.sticky==n.sticky)return t;var o=ve(i);if(!o)return t;var a=me(o,r.ch,r.sticky),l=o[a];if(l.from!=r.ch&&l.to!=r.ch)return t;var s,u=a+(l.from==r.ch==(1!=l.level)?0:1);if(0==u||u==o.length)return t;if(n.line!=r.line)s=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=me(o,n.ch,n.sticky),d=c-a||(n.ch-r.ch)*(1==l.level?-1:1);s=c==u-1||c==u?d<0:d>0}var f=o[u+(s?-1:0)],h=s==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return r.ch==p&&r.sticky==m?t:new co(new ct(r.line,p,m),n)}function El(e,t,r,n){var i,o;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&&Te(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Me(e,r))return De(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=a.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i)return we(e,r,e,lt(e.doc,o),e.display.gutterSpecs[s].className,t),De(t)}}function Ol(e,t){return El(e,t,"gutterClick",!0)}function Nl(e,t){$r(e.display,t)||zl(e,t)||Ce(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function zl(e,t){return!!Me(e,"gutterContextMenu")&&El(e,t,"gutterContextMenu",!1)}function Pl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vn(e)}kl.prototype.compare=function(e,t,r){return this.time+bl>e&&0==dt(t,this.pos)&&r==this.button};var Bl={toString:function(){return"CodeMirror.Init"}},Il={},Wl={};function Hl(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=Bl&&i(e,t,r)}:i)}e.defineOption=r,e.Init=Bl,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,xo(e)}),!0),r("indentUnit",2,xo,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){bo(e),vn(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(ct(n,o))}n++}));for(var i=r.length-1;i>=0;i--)ua(e.doc,t,r[i],ct(r[i].line,r[i].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Bl&&e.refresh()})),r("specialCharPlaceholder",br,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!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",!k),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){Pl(e),ro(e)}),!0),r("keyMap","default",(function(e,t,r){var n=Ya(t),i=r!=Bl&&Ya(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,_l,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=eo(t,e.options.lineNumbers),ro(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?In(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return Ci(e)}),!0),r("scrollbarStyle","native",(function(e){Li(e),Ci(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=eo(e.options.gutters,t),ro(e)}),!0),r("firstLineNumber",1,ro,!0),r("lineNumberFormatter",(function(e){return e}),ro,!0),r("showCursorWhenSelecting",!1,$n,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(ni(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,jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,$n,!0),r("singleCursorHeightPerLine",!0,$n,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,bo,!0),r("addModeClass",!1,bo,!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,bo,!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)}function jl(e,t,r){if(!t!=!(r&&r!=Bl)){var n=e.display.dragFunctions,i=t?xe:ke;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 _l(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),fr(e)),Hn(e),Rn(e),vn(e),setTimeout((function(){return Ci(e)}),100)}function Rl(e,t){var r=this;if(!(this instanceof Rl))return new Rl(e,t);this.options=t=t?R(t):{},R(Il,t,!1);var n=t.value;"string"==typeof n?n=new Aa(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Rl.inputStyles[t.inputStyle](this),o=this.display=new no(e,n,i,t);for(var u in o.wrapper.CodeMirror=this,Pl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Li(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 G,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),a&&l<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),ql(this),Ba(),Ai(this),this.curOp.forceUpdate=!0,So(this,n),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){r.hasFocus()&&!r.state.focused&&ri(r)}),20):ni(this),Wl)Wl.hasOwnProperty(u)&&Wl[u](this,t[u],Bl);Zi(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Gl.length;++c)Gl[c](this);Di(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function ql(e){var t=e.display;xe(t.scroller,"mousedown",Ii(e,Cl)),xe(t.scroller,"dblclick",a&&l<11?Ii(e,(function(t){if(!Ce(e,t)){var r=jn(e,t);if(r&&!Ol(e,t)&&!$r(e.display,t)){Te(t);var n=e.findWordAt(r);_o(e.doc,n.anchor,n.head)}}})):function(t){return Ce(e,t)||Te(t)}),xe(t.scroller,"contextmenu",(function(t){return Nl(e,t)})),xe(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||Nl(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){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function s(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}xe(t.scroller,"touchstart",(function(i){if(!Ce(e,i)&&!o(i)&&!Ol(e,i)){t.input.ensurePolled(),clearTimeout(r);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),xe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),xe(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!$r(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!n.prev||s(n,n.prev)?new co(a,a):!n.prev.prev||s(n,n.prev.prev)?e.findWordAt(a):new co(ct(a.line,0),vt(e.doc,ct(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Te(r)}i()})),xe(t.scroller,"touchcancel",i),xe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(vi(e,t.scroller.scrollTop),xi(e,t.scroller.scrollLeft,!0),we(e,"scroll",e))})),xe(t.scroller,"mousewheel",(function(t){return so(e,t)})),xe(t.scroller,"DOMMouseScroll",(function(t){return so(e,t)})),xe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){Ce(e,t)||Fe(t)},over:function(t){Ce(e,t)||(Oa(e,t),Fe(t))},start:function(t){return Ea(e,t)},drop:Ii(e,Fa),leave:function(t){Ce(e,t)||Na(e)}};var u=t.input.getField();xe(u,"keyup",(function(t){return gl.call(e,t)})),xe(u,"keydown",Ii(e,pl)),xe(u,"keypress",Ii(e,vl)),xe(u,"focus",(function(t){return ri(e,t)})),xe(u,"blur",(function(t){return ni(e,t)}))}Rl.defaults=Il,Rl.optionHandlers=Wl;var Gl=[];function Vl(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=St(e,t).state:r="prev");var a=e.options.tabSize,l=rt(o,t),s=q(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u,c=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&((u=o.mode.indent(i,l.text.slice(c.length),l.text))==K||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?q(rt(o,t-1).text,null,a):0:"add"==r?u=s+e.options.indentUnit:"subtract"==r?u=s-e.options.indentUnit:"number"==typeof r&&(u=s+r),u=Math.max(0,u);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(u/a);h;--h)f+=a,d+="\t";if(f<u&&(d+=Z(u-f)),d!=c)return ua(o,d,ct(t,0),ct(t,c.length),"+input"),l.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<c.length){var g=ct(t,c.length);qo(o,p,new co(g,g));break}}}Rl.defineInitHook=function(e){return Gl.push(e)};var Ul=null;function Kl(e){Ul=e}function $l(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=+new Date-200,l="paste"==i||e.state.pasteIncoming>a,s=He(t),u=null;if(l&&n.ranges.length>1)if(Ul&&Ul.text.join("\n")==t){if(n.ranges.length%Ul.text.length==0){u=[];for(var c=0;c<Ul.text.length;c++)u.push(o.splitLines(Ul.text[c]))}}else s.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(u=te(s,(function(e){return[e]})));for(var d=e.curOp.updateInput,f=n.ranges.length-1;f>=0;f--){var h=n.ranges[f],p=h.from(),m=h.to();h.empty()&&(r&&r>0?p=ct(p.line,p.ch-r):e.state.overwrite&&!l?m=ct(m.line,Math.min(rt(o,m.line).text.length,m.ch+ee(s).length)):l&&Ul&&Ul.lineWise&&Ul.text.join("\n")==s.join("\n")&&(p=m=ct(p.line,0)));var g={from:p,to:m,text:u?u[f%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};na(e.doc,g),Nr(e,"inputRead",e,g)}t&&!l&&Yl(e,t),fi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Xl(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||Bi(t,(function(){return $l(t,r,0,null,"paste")})),!0}function Yl(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),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Vl(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(rt(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Vl(e,i.head.line,"smart"));a&&Nr(e,"electricInput",e,i.head.line)}}}function Ql(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:ct(i,0),head:ct(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Jl(e,t,r,n){e.setAttribute("autocorrect",r?"on":"off"),e.setAttribute("autocapitalize",n?"on":"off"),e.setAttribute("spellcheck",!!t)}function Zl(){var e=F("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=F("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),t}function es(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){j(this).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)&&Ii(this,t[e])(this,r,i),we(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"](Ya(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:Wi((function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");re(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(e){return e.priority})),this.state.modeGen++,Rn(this)})),removeOverlay:Wi((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)return t.splice(r,1),this.state.modeGen++,void Rn(this)}})),indentLine:Wi((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),st(this.doc,e)&&Vl(this,e,t,r)})),indentSelection:Wi((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&&(Vl(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&fi(this));else{var o=i.from(),a=i.to(),l=Math.max(r,o.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s<r;++s)Vl(this,s,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&qo(this.doc,n,new co(o,u[n].to()),$)}}})),getTokenAt:function(e,t){return Dt(this,e,t)},getLineTokens:function(e,t){return Dt(this,ct(e),t,!0)},getTokenTypeAt:function(e){e=vt(this.doc,e);var t,r=Ct(this,rt(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},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 a=0;a<o[t].length;a++){var l=i[o[t][a]];l&&n.push(l)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var s=0;s<i._global.length;s++){var u=i._global[s];u.pred(o,this)&&-1==V(n,u.val)&&n.push(u.val)}return n},getStateAfter:function(e,t){var r=this.doc;return St(this,(e=gt(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Sn(this,null==e?r.head:"object"==typeof e?vt(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Cn(this,vt(this.doc,e),t||"page")},coordsChar:function(e,t){return Tn(this,(e=wn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=wn(this,{top:e,left:0},t||"page").top,lt(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=rt(this.doc,e)}else n=e;return kn(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-cr(n):0)},defaultTextHeight:function(){return zn(this.display)},defaultCharWidth:function(){return Pn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display,a=(e=Sn(this,vt(this.doc,e))).bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>u&&(l=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&ui(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Wi(pl),triggerOnKeyPress:Wi(vl),triggerOnKeyUp:gl,triggerOnMouseDown:Wi(Cl),execCommand:function(e){if(rl.hasOwnProperty(e))return rl[e].call(null,this)},triggerElectric:Wi((function(e){Yl(this,e)})),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=vt(this.doc,e),a=0;a<t&&!(o=ts(this.doc,o,i,r,n)).hitSide;++a);return o},moveH:Wi((function(e,t){var r=this;this.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?ts(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()}),Y)})),deleteH:Wi((function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Qa(this,(function(r){var i=ts(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 a=vt(this.doc,e),l=0;l<t;++l){var s=Sn(this,a,"div");if(null==o?o=s.left:s.left=o,(a=rs(this,s,i,r)).hitSide)break}return a},moveV:Wi((function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var l=Sn(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=rs(r,l,e,t);return"page"==t&&a==n.sel.primary()&&di(r,Cn(r,s,"div").top-l.top),s}),Y),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=rt(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?++n:--r;for(var o=t.charAt(r),a=le(o,i)?function(e){return le(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!le(e)};r>0&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new co(ct(e.line,r),ct(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),we(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==N(W(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Wi((function(e,t){hi(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Jr(this)-this.display.barHeight,width:e.scrollWidth-Jr(this)-this.display.barWidth,clientHeight:en(this),clientWidth:Zr(this)}},scrollIntoView:Wi((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ct(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?pi(this,e):gi(this,e.from,e.to,e.margin)})),setSize:Wi((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&&gn(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){qn(r,i,"widget");break}++i})),this.curOp.forceUpdate=!0,we(this,"refresh",this)})),operation:function(e){return Bi(this,e)},startOperation:function(){return Ai(this)},endOperation:function(){return Di(this)},refresh:Wi((function(){var e=this.display.cachedTextHeight;Rn(this),this.curOp.forceUpdate=!0,vn(this),hi(this,this.doc.scrollLeft,this.doc.scrollTop),Yi(this.display),(null==e||Math.abs(e-zn(this.display))>.5||this.options.lineWrapping)&&Hn(this),we(this,"refresh",this)})),swapDoc:Wi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),So(this,e),vn(this),this.display.input.reset(),hi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Nr(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}},Le(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}function ts(e,t,r,n,i){var o=t,a=r,l=rt(e,t.line),s=i&&"rtl"==e.direction?-r:r;function u(){var r=t.line+s;return!(r<e.first||r>=e.first+e.size)&&(t=new ct(r,t.ch,t.sticky),l=rt(e,r))}function c(o){var a;if("codepoint"==n){var c=l.text.charCodeAt(t.ch+(r>0?0:-1));if(isNaN(c))a=null;else{var d=r>0?c>=55296&&c<56320:c>=56320&&c<57343;a=new ct(t.line,Math.max(0,Math.min(l.text.length,t.ch+r*(d?2:1))),-r)}}else a=i?tl(e.cm,l,t,r):Za(l,t,r);if(null==a){if(o||!u())return!1;t=el(i,e.cm,l,t.line,s)}else t=a;return!0}if("char"==n||"codepoint"==n)c();else if("column"==n)c(!0);else if("word"==n||"group"==n)for(var d=null,f="group"==n,h=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(r<0)||c(!p);p=!1){var m=l.text.charAt(t.ch)||"\n",g=le(m,h)?"w":f&&"\n"==m?"n":!f||/\s/.test(m)?null:"p";if(!f||p||g||(g="s"),d&&d!=g){r<0&&(r=1,c(),t.sticky="after");break}if(g&&(d=g),r>0&&!c(!p))break}var v=Zo(e,t,o,a,!0);return ft(o,v)&&(v.hitSide=!0),v}function rs(e,t,r,n){var i,o,a=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,j(e).innerHeight||a(e).documentElement.clientHeight),u=Math.max(s-.5*zn(e.display),3);i=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;(o=Tn(e,l,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*r}return o}var ns=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new G,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function is(e,t){var r=an(e,t.line);if(!r||r.hidden)return null;var n=rt(e.doc,t.line),i=rn(r,n,t.line),o=ve(n,e.doc.direction),a="left";o&&(a=me(o,t.ch)%2?"right":"left");var l=dn(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function os(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function as(e,t){return t&&(e.bad=!0),e}function ls(e,t,r,n,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function u(e){return function(t){return t.id==e}}function c(){a&&(o+=l,s&&(o+=l),a=s=!1)}function d(e){e&&(c(),o+=e)}function f(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void d(r);var o,h=t.getAttribute("cm-marker");if(h){var p=e.findMarks(ct(n,0),ct(i+1,0),u(+h));return void(p.length&&(o=p[0].find(0))&&d(nt(e.doc,o.from,o.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&c();for(var g=0;g<t.childNodes.length;g++)f(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),m&&(a=!0)}else 3==t.nodeType&&d(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;f(t),t!=r;)t=t.nextSibling,s=!1;return o}function ss(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return as(e.clipPos(ct(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 us(o,t,r)}}function us(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!O(n,t))return as(ct(at(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?ee(e.rest):e.line;return as(ct(at(o),o.text.length),i)}var a=3==t.nodeType?t:null,l=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,r&&(r=a.nodeValue.length));l.parentNode!=n;)l=l.parentNode;var s=e.measure,u=s.maps;function c(t,r,n){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?s.map:u[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==r){var c=at(i<0?e.line:e.rest[i]),d=o[a]+n;return(n<0||l!=t)&&(d=o[a+(n?1:0)]),ct(c,d)}}}var d=c(a,l,r);if(d)return as(d,i);for(var f=l.nextSibling,h=a?a.nodeValue.length-r:0;f;f=f.nextSibling){if(d=c(f,f.firstChild,0))return as(ct(d.line,d.ch-h),i);h+=f.textContent.length}for(var p=l.previousSibling,m=r;p;p=p.previousSibling){if(d=c(p,p.firstChild,-1))return as(ct(d.line,d.ch+m),i);m+=p.textContent.length}}ns.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;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!Ce(n,e)){if(n.somethingSelected())Kl({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=Ql(n);Kl({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation((function(){n.setSelections(t.ranges,0,$),n.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Ul.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var l=Zl(),s=l.firstChild;Jl(s),n.display.lineSpace.insertBefore(l,n.display.lineSpace.firstChild),s.value=Ul.text.join("\n");var u=N(H(i));B(s),setTimeout((function(){n.display.lineSpace.removeChild(l),u.focus(),u==i&&r.showPrimarySelection()}),50)}}i.contentEditable=!0,Jl(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),xe(i,"paste",(function(e){!o(e)||Ce(n,e)||Xl(e,n)||l<=11&&setTimeout(Ii(n,(function(){return t.updateFromDOM()})),20)})),xe(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),xe(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),xe(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),xe(i,"touchstart",(function(){return r.forceCompositionEnd()})),xe(i,"input",(function(){t.composing||t.readFromDOMSoon()})),xe(i,"copy",a),xe(i,"cut",a)},ns.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ns.prototype.prepareSelection=function(){var e=Xn(this.cm,!1);return e.focus=N(H(this.div))==this.div,e},ns.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ns.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ns.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=ss(t,e.anchorNode,e.anchorOffset),l=ss(t,e.focusNode,e.focusOffset);if(!a||a.bad||!l||l.bad||0!=dt(mt(a,l),i)||0!=dt(pt(a,l),o)){var s=t.display.view,u=i.line>=t.display.viewFrom&&is(t,i)||{node:s[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&is(t,o);if(!c){var d=s[s.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(u&&c){var h,p=e.rangeCount&&e.getRangeAt(0);try{h=L(u.node,u.offset,c.offset,c.node)}catch(e){}h&&(!r&&t.state.focused?(e.collapse(u.node,u.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),p&&null==e.anchorNode?e.addRange(p):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},ns.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)},ns.prototype.showMultipleSelections=function(e){D(this.cm.display.cursorDiv,e.cursors),D(this.cm.display.selectionDiv,e.selection)},ns.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ns.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},ns.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&N(H(this.div))==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},ns.prototype.blur=function(){this.div.blur()},ns.prototype.getField=function(){return this.div},ns.prototype.supportsTouch=function(){return!0},ns.prototype.receivedFocus=function(){var e=this,t=this;function r(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,r))}this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):Bi(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,r)},ns.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ns.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&c&&this.cm.display.gutterSpecs.length&&os(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=ss(t,e.anchorNode,e.anchorOffset),n=ss(t,e.focusNode,e.focusOffset);r&&n&&Bi(t,(function(){Ko(t.doc,ho(r,n),$),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},ns.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=ct(a.line-1,rt(n.doc,a.line-1).length)),l.ch==rt(n.doc,l.line).text.length&&l.line<n.lastLine()&&(l=ct(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=_n(n,a.line))?(t=at(i.view[0].line),r=i.view[0].node):(t=at(i.view[e].line),r=i.view[e-1].node.nextSibling);var s,u,c=_n(n,l.line);if(c==i.view.length-1?(s=i.viewTo-1,u=i.lineDiv.lastChild):(s=at(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1;for(var d=n.doc.splitLines(ls(n,r,u,t,s)),f=nt(n.doc,ct(t,0),ct(s,rt(n.doc,s).text.length));d.length>1&&f.length>1;)if(ee(d)==ee(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var y=ee(d),x=ee(f),b=Math.min(y.length-(1==d.length?h:0),x.length-(1==f.length?h:0));p<b&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)++p;if(1==d.length&&1==f.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)h--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var k=ct(t,h),w=ct(s,f.length?ee(f).length-p:0);return d.length>1||d[0]||dt(k,w)?(ua(n.doc,d,k,w,"+input"),!0):void 0},ns.prototype.ensurePolled=function(){this.forceCompositionEnd()},ns.prototype.reset=function(){this.forceCompositionEnd()},ns.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ns.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))},ns.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Bi(this.cm,(function(){return Rn(e.cm)}))},ns.prototype.setUneditable=function(e){e.contentEditable="false"},ns.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ii(this.cm,$l)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},ns.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},ns.prototype.onContextMenu=function(){},ns.prototype.resetPosition=function(){},ns.prototype.needsContentAttribute=!0;var cs=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new G,this.hasSelection=!1,this.composing=null,this.resetting=!1};function ds(e,t){if((t=t?R(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(H(e));t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=l.getValue()}var i;if(e.form&&(xe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(ke(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var l=Rl((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l}function fs(e){e.off=ke,e.on=xe,e.wheelEventPixels=lo,e.Doc=Aa,e.splitLines=He,e.countColumn=q,e.findColumn=Q,e.isWordChar=ae,e.Pass=K,e.signal=we,e.Line=hr,e.changeEnd=po,e.scrollbarModel=Mi,e.Pos=ct,e.cmpPos=dt,e.modes=Ge,e.mimeModes=Ve,e.resolveMode=$e,e.getMode=Xe,e.modeExtensions=Ye,e.extendMode=Qe,e.copyState=Je,e.startState=et,e.innerMode=Ze,e.commands=rl,e.keyMap=qa,e.keyName=Xa,e.isModifierKey=Ka,e.lookupKey=Ua,e.normalizeKeyMap=Va,e.StringStream=tt,e.SharedTextMarker=wa,e.TextMarker=ba,e.LineWidget=ga,e.e_preventDefault=Te,e.e_stopPropagation=Ae,e.e_stop=Fe,e.addClass=z,e.contains=O,e.rmClass=T,e.keyNames=Ha}cs.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!Ce(n,e)){if(n.somethingSelected())Kl({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Ql(n);Kl({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,$):(r.prevInput="",i.value=t.text.join("\n"),B(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),xe(i,"input",(function(){a&&l>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),xe(i,"paste",(function(e){Ce(n,e)||Xl(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),xe(i,"cut",o),xe(i,"copy",o),xe(e.scroller,"paste",(function(t){if(!$r(e,t)&&!Ce(n,t)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),xe(e.lineSpace,"selectstart",(function(t){$r(e,t)||Te(t)})),xe(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"})}})),xe(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},cs.prototype.createField=function(e){this.wrapper=Zl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Jl(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},cs.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},cs.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Xn(e);if(e.options.moveInputWithCursor){var i=Sn(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},cs.prototype.showSelection=function(e){var t=this.cm.display;D(t.cursorDiv,e.cursors),D(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},cs.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&B(this.textarea),a&&l>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",a&&l>=9&&(this.hasSelection=null));this.resetting=!1}},cs.prototype.getField=function(){return this.textarea},cs.prototype.supportsTouch=function(){return!1},cs.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||N(H(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},cs.prototype.blur=function(){this.textarea.blur()},cs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},cs.prototype.receivedFocus=function(){this.slowPoll()},cs.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},cs.prototype.fastPoll=function(){var e=!1,t=this;function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}t.pollingFast=!0,t.polling.set(20,r)},cs.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||je(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(a&&l>=9&&this.hasSelection===i||x&&/[\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 s=0,u=Math.min(n.length,i.length);s<u&&n.charCodeAt(s)==i.charCodeAt(s);)++s;return Bi(t,(function(){$l(t,i.slice(s),n.length-s,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},cs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},cs.prototype.onKeyPress=function(){a&&l>=9&&(this.hasSelection=null),this.fastPoll()},cs.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=jn(r,e),u=n.scroller.scrollTop;if(o&&!f){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&Ii(r,Ko)(r.doc,ho(o),$);var c,d=i.style.cssText,h=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(c=i.ownerDocument.defaultView.scrollY),n.input.focus(),s&&i.ownerDocument.defaultView.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),a&&l>=9&&g(),S){Fe(e);var m=function(){ke(window,"mouseup",m),setTimeout(v,20)};xe(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=r.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=d,a&&l<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&l<9)&&g();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Ii(r,ta)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},cs.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},cs.prototype.setUneditable=function(){},cs.prototype.needsContentAttribute=!1,Hl(Rl),es(Rl);var hs="iter insert remove copy getEditor constructor".split(" ");for(var ps in Aa.prototype)Aa.prototype.hasOwnProperty(ps)&&V(hs,ps)<0&&(Rl.prototype[ps]=function(e){return function(){return e.apply(this.doc,arguments)}}(Aa.prototype[ps]));return Le(Aa),Rl.inputStyles={textarea:cs,contenteditable:ns},Rl.defineMode=function(e){Rl.defaults.mode||"null"==e||(Rl.defaults.mode=e),Ue.apply(this,arguments)},Rl.defineMIME=Ke,Rl.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Rl.defineMIME("text/plain","null"),Rl.defineExtension=function(e,t){Rl.prototype[e]=t},Rl.defineDocExtension=function(e,t){Aa.prototype[e]=t},Rl.fromTextArea=ds,fs(Rl),Rl.version="5.65.16",Rl}()}(o);var a=o.exports;!function(e){function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}e.defineMode("css",(function(t,r){var n=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var i,o,a=t.indentUnit,l=r.tokenHooks,s=r.documentTypes||{},u=r.mediaTypes||{},c=r.mediaFeatures||{},d=r.mediaValueKeywords||{},f=r.propertyKeywords||{},h=r.nonStandardPropertyKeywords||{},p=r.fontProperties||{},m=r.counterDescriptors||{},g=r.colorKeywords||{},v=r.valueKeywords||{},y=r.allowNested,x=r.lineComment,b=!0===r.supportsAtComponent,k=!1!==t.highlightNonStandardPropertyKeywords;function w(e,t){return i=t,e}function C(e,t){var r=e.next();if(l[r]){var n=l[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),w("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?w(null,"compare"):'"'==r||"'"==r?(t.tokenize=S(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),w("atom","hash")):"!"==r?(e.match(/^\s*\w*/),w("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),w("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?w(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?w(null,r):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=M),w("variable callee","variable")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),w("property","word")):w(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),w("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?w("variable-2","variable-definition"):w("variable-2","variable")):e.match(/^\w+-/)?w("meta","meta"):void 0}function S(e){return function(t,r){for(var n,i=!1;null!=(n=t.next());){if(n==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==n}return(n==e||!i&&")"!=e)&&(r.tokenize=null),w("string","string")}}function M(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=S(")"),w(null,"(")}function L(e,t,r){this.type=e,this.indent=t,this.prev=r}function T(e,t,r,n){return e.context=new L(r,t.indentation()+(!1===n?0:a),e.context),r}function A(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function D(e,t,r){return O[r.context.type](e,t,r)}function F(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return D(e,t,r)}function E(e){var t=e.current().toLowerCase();o=v.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var O={top:function(e,t,r){if("{"==e)return T(r,t,"block");if("}"==e&&r.context.prev)return A(r);if(b&&/@component/i.test(e))return T(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return T(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return T(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return T(r,t,"at");if("hash"==e)o="builtin";else if("word"==e)o="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return T(r,t,"interpolation");if(":"==e)return"pseudo";if(y&&"("==e)return T(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return f.hasOwnProperty(n)?(o="property","maybeprop"):h.hasOwnProperty(n)?(o=k?"string-2":"property","maybeprop"):y?(o=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==e?"block":y||"hash"!=e&&"qualifier"!=e?O.top(e,t,r):(o="error","block")},maybeprop:function(e,t,r){return":"==e?T(r,t,"prop"):D(e,t,r)},prop:function(e,t,r){if(";"==e)return A(r);if("{"==e&&y)return T(r,t,"propBlock");if("}"==e||"{"==e)return F(e,t,r);if("("==e)return T(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current())){if("word"==e)E(t);else if("interpolation"==e)return T(r,t,"interpolation")}else o+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?A(r):"word"==e?(o="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?F(e,t,r):")"==e?A(r):"("==e?T(r,t,"parens"):"interpolation"==e?T(r,t,"interpolation"):("word"==e&&E(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(o="variable-3",r.context.type):D(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&s.hasOwnProperty(t.current())?(o="tag",r.context.type):O.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return T(r,t,"atBlock_parens");if("}"==e||";"==e)return F(e,t,r);if("{"==e)return A(r)&&T(r,t,y?"block":"top");if("interpolation"==e)return T(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();o="only"==n||"not"==n||"and"==n||"or"==n?"keyword":u.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":d.hasOwnProperty(n)?"keyword":f.hasOwnProperty(n)?"property":h.hasOwnProperty(n)?k?"string-2":"property":v.hasOwnProperty(n)?"atom":g.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?F(e,t,r):"{"==e?A(r)&&T(r,t,y?"block":"top",!1):("word"==e&&(o="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?A(r):"{"==e||"}"==e?F(e,t,r,2):O.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?T(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(o="variable","restricted_atBlock_before"):D(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,A(r)):"word"==e?(o="@font-face"==r.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(o="variable","keyframes"):"{"==e?T(r,t,"top"):D(e,t,r)},at:function(e,t,r){return";"==e?A(r):"{"==e||"}"==e?F(e,t,r):("word"==e?o="tag":"hash"==e&&(o="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?A(r):"{"==e||";"==e?F(e,t,r):("word"==e?o="variable":"variable"!=e&&"("!=e&&")"!=e&&(o="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:n?"block":"top",stateArg:null,context:new L(n?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||C)(e,t);return r&&"object"==typeof r&&(i=r[1],r=r[0]),o=r,"comment"!=i&&(t.state=O[t.state](i,e,t)),o},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-a)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:x,fold:"brace"}}));var r=["domain","regexp","url","url-prefix"],n=t(r),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],l=t(a),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],u=t(s),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(c),f=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],h=t(f),p=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(g),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],x=t(y),b=r.concat(i).concat(a).concat(s).concat(c).concat(f).concat(g).concat(y);function k(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}e.registerHelper("hintWords","css",b),e.defineMIME("text/css",{documentTypes:n,mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:p,counterDescriptors:m,colorKeywords:v,valueKeywords:x,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:x,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:x,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:n,mediaTypes:o,mediaFeatures:l,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:p,counterDescriptors:m,colorKeywords:v,valueKeywords:x,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css",helperType:"gss"})}(o.exports),function(e){e.defineMode("ecl",(function(e){function t(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function r(e,t){return!!t.startOfLine&&(e.skipToEnd(),"meta")}var n,i=e.indentUnit,o=t("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"),a=t("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"),l=t("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"),s=t("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"),u=t("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"),c=t("catch class do else finally for if switch try while"),d=t("true false null"),f={"#":r},h=/[+\-*&%=<>!?|\/]/;function p(e,t){var r=e.next();if(f[r]){var i=f[r](e,t);if(!1!==i)return i}if('"'==r||"'"==r)return t.tokenize=m(r),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(r))return n=r,null;if(/\d/.test(r))return e.eatWhile(/[\w\.]/),"number";if("/"==r){if(e.eat("*"))return t.tokenize=g,g(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(h.test(r))return e.eatWhile(h),"operator";e.eatWhile(/[\w\$_]/);var p=e.current().toLowerCase();if(o.propertyIsEnumerable(p))return c.propertyIsEnumerable(p)&&(n="newstatement"),"keyword";if(a.propertyIsEnumerable(p))return c.propertyIsEnumerable(p)&&(n="newstatement"),"variable";if(l.propertyIsEnumerable(p))return c.propertyIsEnumerable(p)&&(n="newstatement"),"variable-2";if(s.propertyIsEnumerable(p))return c.propertyIsEnumerable(p)&&(n="newstatement"),"variable-3";if(u.propertyIsEnumerable(p))return c.propertyIsEnumerable(p)&&(n="newstatement"),"builtin";for(var v=p.length-1;v>=0&&(!isNaN(p[v])||"_"==p[v]);)--v;if(v>0){var y=p.substr(0,v+1);if(s.propertyIsEnumerable(y))return c.propertyIsEnumerable(y)&&(n="newstatement"),"variable-3"}return d.propertyIsEnumerable(p)?"atom":null}function m(e){return function(t,r){for(var n,i=!1,o=!1;null!=(n=t.next());){if(n==e&&!i){o=!0;break}i=!i&&"\\"==n}return!o&&i||(r.tokenize=p),"string"}}function g(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=p;break}n="*"==r}return"comment"}function v(e,t,r,n,i){this.indented=e,this.column=t,this.type=r,this.align=n,this.prev=i}function y(e,t,r){return e.context=new v(e.indented,t,r,null,e.context)}function x(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}return{startState:function(e){return{tokenize:null,context:new v((e||0)-i,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;n=null;var i=(t.tokenize||p)(e,t);if("comment"==i||"meta"==i)return i;if(null==r.align&&(r.align=!0),";"!=n&&":"!=n||"statement"!=r.type)if("{"==n)y(t,e.column(),"}");else if("["==n)y(t,e.column(),"]");else if("("==n)y(t,e.column(),")");else if("}"==n){for(;"statement"==r.type;)r=x(t);for("}"==r.type&&(r=x(t));"statement"==r.type;)r=x(t)}else n==r.type?x(t):("}"==r.type||"top"==r.type||"statement"==r.type&&"newstatement"==n)&&y(t,e.column(),"statement");else x(t);return t.startOfLine=!1,i},indent:function(e,t){if(e.tokenize!=p&&null!=e.tokenize)return 0;var r=e.context,n=t&&t.charAt(0);"statement"==r.type&&"}"==n&&(r=r.prev);var o=n==r.type;return"statement"==r.type?r.indented+("{"==n?0:i):r.align?r.column+(o?0:1):r.indented+(o?0:i)},electricChars:"{}"}})),e.defineMIME("text/x-ecl","ecl")}(o.exports);!function(e){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(n,i){var o,a,l=n.indentUnit,s={},u=i.htmlMode?t:r;for(var c in u)s[c]=u[c];for(var c in i)s[c]=i[c];function d(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();return"<"==n?e.eat("!")?e.eat("[")?e.match("CDATA[")?r(p("atom","]]>")):null:e.match("--")?r(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(m(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==n?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=d,o=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return o="equals",null;if("<"==r){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=h(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=f;break}return"string"};return t.isInAttribute=!0,t}function p(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=d;break}r.next()}return e}}function m(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=m(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=d;break}return r.tokenize=m(e-1),r.tokenize(t,r)}}return"meta"}}function g(e){return e&&e.toLowerCase()}function v(e,t,r){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=r,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function y(e){e.context&&(e.context=e.context.prev)}function x(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!s.contextGrabbers.hasOwnProperty(g(r))||!s.contextGrabbers[g(r)].hasOwnProperty(g(t)))return;y(e)}}function b(e,t,r){return"openTag"==e?(r.tagStart=t.column(),k):"closeTag"==e?w:b}function k(e,t,r){return"word"==e?(r.tagName=t.current(),a="tag",M):s.allowMissingTagName&&"endTag"==e?(a="tag bracket",M(e,t,r)):(a="error",k)}function w(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&s.implicitlyClosed.hasOwnProperty(g(r.context.tagName))&&y(r),r.context&&r.context.tagName==n||!1===s.matchClosing?(a="tag",C):(a="tag error",S)}return s.allowMissingTagName&&"endTag"==e?(a="tag bracket",C(e,t,r)):(a="error",S)}function C(e,t,r){return"endTag"!=e?(a="error",C):(y(r),b)}function S(e,t,r){return a="error",C(e,t,r)}function M(e,t,r){if("word"==e)return a="attribute",L;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(g(n))?x(r,n):(x(r,n),r.context=new v(r,n,i==r.indented)),b}return a="error",M}function L(e,t,r){return"equals"==e?T:(s.allowMissing||(a="error"),M(e,t,r))}function T(e,t,r){return"string"==e?A:"word"==e&&s.allowUnquoted?(a="string",M):(a="error",M(e,t,r))}function A(e,t,r){return"string"==e?A:M(e,t,r)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var r=t.tokenize(e,t);return(r||o)&&"comment"!=r&&(a=null,t.state=t.state(o||r,e,t),a&&(r="error"==a?r+" error":a)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+l;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==s.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+l*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var o=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!s.implicitlyClosed.hasOwnProperty(g(i.tagName)))break;i=i.prev}else if(o)for(;i;){var a=s.contextGrabbers[g(i.tagName)];if(!a||!a.hasOwnProperty(g(o[2])))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+l:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==T&&(e.state=M)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],r=e.context;r;r=r.prev)t.push(r.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(o.exports);!function(e){e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var t=0;t<e.modeInfo.length;t++){var r=e.modeInfo[t];r.mimes&&(r.mime=r.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.mime==t)return n;if(n.mimes)for(var i=0;i<n.mimes.length;i++)if(n.mimes[i]==t)return n}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.ext)for(var i=0;i<n.ext.length;i++)if(n.ext[i]==t)return n}},e.findModeByFileName=function(t){for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.file&&n.file.test(t))return n}var i=t.lastIndexOf("."),o=i>-1&&t.substring(i+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.name.toLowerCase()==t)return n;if(n.alias)for(var i=0;i<n.alias.length;i++)if(n.alias[i].toLowerCase()==t)return n}}}(o.exports),function(e){e.defineMode("markdown",(function(t,r){var n=e.getMode(t,"text/html"),i="null"==n.name;function o(r){if(e.findModeByName){var n=e.findModeByName(r);n&&(r=n.mime||n.mimes[0])}var i=e.getMode(t,r);return"null"==i.name?null:i}void 0===r.highlightFormatting&&(r.highlightFormatting=!1),void 0===r.maxBlockquoteDepth&&(r.maxBlockquoteDepth=0),void 0===r.taskLists&&(r.taskLists=!1),void 0===r.strikethrough&&(r.strikethrough=!1),void 0===r.emoji&&(r.emoji=!1),void 0===r.fencedCodeBlockHighlighting&&(r.fencedCodeBlockHighlighting=!0),void 0===r.fencedCodeBlockDefaultMode&&(r.fencedCodeBlockDefaultMode="text/plain"),void 0===r.xml&&(r.xml=!0),void 0===r.tokenTypeOverrides&&(r.tokenTypeOverrides={});var a={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var l in a)a.hasOwnProperty(l)&&r.tokenTypeOverrides[l]&&(a[l]=r.tokenTypeOverrides[l]);var s=/^([*\-_])(?:\s*\1){2,}\s*$/,u=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,d=r.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,f=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,m=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,v=" ";function y(e,t,r){return t.f=t.inline=r,r(e,t)}function x(e,t,r){return t.f=t.block=r,r(e,t)}function b(e){return!e||!/\S/.test(e.string)}function k(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==C){var r=i;if(!r){var o=e.innerMode(n,t.htmlState);r="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}r&&(t.f=T,t.block=w,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function w(t,n){var i=t.column()===n.indentation,l=b(n.prevLine.stream),h=n.indentedCode,g=n.prevLine.hr,v=!1!==n.list,x=(n.listStack[n.listStack.length-1]||0)+3;n.indentedCode=!1;var k=n.indentation;if(null===n.indentationDiff&&(n.indentationDiff=n.indentation,v)){for(n.list=null;k<n.listStack[n.listStack.length-1];)n.listStack.pop(),n.listStack.length?n.indentation=n.listStack[n.listStack.length-1]:n.list=!1;!1!==n.list&&(n.indentationDiff=k-n.listStack[n.listStack.length-1])}var w=!(l||g||n.prevLine.header||v&&h||n.prevLine.fencedCodeEnd),C=(!1===n.list||g||l)&&n.indentation<=x&&t.match(s),L=null;if(n.indentationDiff>=4&&(h||n.prevLine.fencedCodeEnd||n.prevLine.header||l))return t.skipToEnd(),n.indentedCode=!0,a.code;if(t.eatSpace())return null;if(i&&n.indentation<=x&&(L=t.match(d))&&L[1].length<=6)return n.quote=0,n.header=L[1].length,n.thisLine.header=!0,r.highlightFormatting&&(n.formatting="header"),n.f=n.inline,M(n);if(n.indentation<=x&&t.eat(">"))return n.quote=i?1:n.quote+1,r.highlightFormatting&&(n.formatting="quote"),t.eatSpace(),M(n);if(!C&&!n.setext&&i&&n.indentation<=x&&(L=t.match(u))){var T=L[1]?"ol":"ul";return n.indentation=k+t.current().length,n.list=!0,n.quote=0,n.listStack.push(n.indentation),n.em=!1,n.strong=!1,n.code=!1,n.strikethrough=!1,r.taskLists&&t.match(c,!1)&&(n.taskList=!0),n.f=n.inline,r.highlightFormatting&&(n.formatting=["list","list-"+T]),M(n)}return i&&n.indentation<=x&&(L=t.match(p,!0))?(n.quote=0,n.fencedEndRE=new RegExp(L[1]+"+ *$"),n.localMode=r.fencedCodeBlockHighlighting&&o(L[2]||r.fencedCodeBlockDefaultMode),n.localMode&&(n.localState=e.startState(n.localMode)),n.f=n.block=S,r.highlightFormatting&&(n.formatting="code-block"),n.code=-1,M(n)):n.setext||!(w&&v||n.quote||!1!==n.list||n.code||C||m.test(t.string))&&(L=t.lookAhead(1))&&(L=L.match(f))?(n.setext?(n.header=n.setext,n.setext=0,t.skipToEnd(),r.highlightFormatting&&(n.formatting="header")):(n.header="="==L[0].charAt(0)?1:2,n.setext=n.header),n.thisLine.header=!0,n.f=n.inline,M(n)):C?(t.skipToEnd(),n.hr=!0,n.thisLine.hr=!0,a.hr):"["===t.peek()?y(t,n,O):y(t,n,n.inline)}function C(t,r){var o=n.token(t,r.htmlState);if(!i){var a=e.innerMode(n,r.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||r.md_inside&&t.current().indexOf(">")>-1)&&(r.f=T,r.block=w,r.htmlState=null)}return o}function S(e,t){var n,i=t.listStack[t.listStack.length-1]||0,o=t.indentation<i,l=i+3;return t.fencedEndRE&&t.indentation<=l&&(o||e.match(t.fencedEndRE))?(r.highlightFormatting&&(t.formatting="code-block"),o||(n=M(t)),t.localMode=t.localState=null,t.block=w,t.f=T,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,o?x(e,t,t.block):n):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),a.code)}function M(e){var t=[];if(e.formatting){t.push(a.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var n=0;n<e.formatting.length;n++)t.push(a.formatting+"-"+e.formatting[n]),"header"===e.formatting[n]&&t.push(a.formatting+"-"+e.formatting[n]+"-"+e.header),"quote"===e.formatting[n]&&(!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=e.quote?t.push(a.formatting+"-"+e.formatting[n]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(a.linkHref,"url"):(e.strong&&t.push(a.strong),e.em&&t.push(a.em),e.strikethrough&&t.push(a.strikethrough),e.emoji&&t.push(a.emoji),e.linkText&&t.push(a.linkText),e.code&&t.push(a.code),e.image&&t.push(a.image),e.imageAltText&&t.push(a.imageAltText,"link"),e.imageMarker&&t.push(a.imageMarker)),e.header&&t.push(a.header,a.header+"-"+e.header),e.quote&&(t.push(a.quote),!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=e.quote?t.push(a.quote+"-"+e.quote):t.push(a.quote+"-"+r.maxBlockquoteDepth)),!1!==e.list){var i=(e.listStack.length-1)%3;i?1===i?t.push(a.list2):t.push(a.list3):t.push(a.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function L(e,t){if(e.match(h,!0))return M(t)}function T(t,i){var o=i.text(t,i);if(void 0!==o)return o;if(i.list)return i.list=null,M(i);if(i.taskList)return" "===t.match(c,!0)[1]?i.taskOpen=!0:i.taskClosed=!0,r.highlightFormatting&&(i.formatting="task"),i.taskList=!1,M(i);if(i.taskOpen=!1,i.taskClosed=!1,i.header&&t.match(/^#+$/,!0))return r.highlightFormatting&&(i.formatting="header"),M(i);var l=t.next();if(i.linkTitle){i.linkTitle=!1;var s=l;"("===l&&(s=")");var u="^\\s*(?:[^"+(s=(s+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+s;if(t.match(new RegExp(u),!0))return a.linkHref}if("`"===l){var d=i.formatting;r.highlightFormatting&&(i.formatting="code"),t.eatWhile("`");var f=t.current().length;if(0!=i.code||i.quote&&1!=f){if(f==i.code){var h=M(i);return i.code=0,h}return i.formatting=d,M(i)}return i.code=f,M(i)}if(i.code)return M(i);if("\\"===l&&(t.next(),r.highlightFormatting)){var p=M(i),m=a.formatting+"-escape";return p?p+" "+m:m}if("!"===l&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,r.highlightFormatting&&(i.formatting="image"),M(i);if("["===l&&i.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,r.highlightFormatting&&(i.formatting="image"),M(i);if("]"===l&&i.imageAltText){r.highlightFormatting&&(i.formatting="image");var p=M(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=D,p}if("["===l&&!i.image)return i.linkText&&t.match(/^.*?\]/)||(i.linkText=!0,r.highlightFormatting&&(i.formatting="link")),M(i);if("]"===l&&i.linkText){r.highlightFormatting&&(i.formatting="link");var p=M(i);return i.linkText=!1,i.inline=i.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?D:T,p}if("<"===l&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=A,r.highlightFormatting&&(i.formatting="link"),(p=M(i))?p+=" ":p="",p+a.linkInline;if("<"===l&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=A,r.highlightFormatting&&(i.formatting="link"),(p=M(i))?p+=" ":p="",p+a.linkEmail;if(r.xml&&"<"===l&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var v=t.string.indexOf(">",t.pos);if(-1!=v){var y=t.string.substring(t.start,v);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(y)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(n),x(t,i,C)}if(r.xml&&"<"===l&&t.match(/^\/\w*?>/))return i.md_inside=!1,"tag";if("*"===l||"_"===l){for(var b=1,k=1==t.pos?" ":t.string.charAt(t.pos-2);b<3&&t.eat(l);)b++;var w=t.peek()||" ",S=!/\s/.test(w)&&(!g.test(w)||/\s/.test(k)||g.test(k)),L=!/\s/.test(k)&&(!g.test(k)||/\s/.test(w)||g.test(w)),F=null,E=null;if(b%2&&(i.em||!S||"*"!==l&&L&&!g.test(k)?i.em!=l||!L||"*"!==l&&S&&!g.test(w)||(F=!1):F=!0),b>1&&(i.strong||!S||"*"!==l&&L&&!g.test(k)?i.strong!=l||!L||"*"!==l&&S&&!g.test(w)||(E=!1):E=!0),null!=E||null!=F)return r.highlightFormatting&&(i.formatting=null==F?"strong":null==E?"em":"strong em"),!0===F&&(i.em=l),!0===E&&(i.strong=l),h=M(i),!1===F&&(i.em=!1),!1===E&&(i.strong=!1),h}else if(" "===l&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return M(i);t.backUp(1)}if(r.strikethrough)if("~"===l&&t.eatWhile(l)){if(i.strikethrough)return r.highlightFormatting&&(i.formatting="strikethrough"),h=M(i),i.strikethrough=!1,h;if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,r.highlightFormatting&&(i.formatting="strikethrough"),M(i)}else if(" "===l&&t.match("~~",!0)){if(" "===t.peek())return M(i);t.backUp(2)}if(r.emoji&&":"===l&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){i.emoji=!0,r.highlightFormatting&&(i.formatting="emoji");var O=M(i);return i.emoji=!1,O}return" "===l&&(t.match(/^ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),M(i)}function A(e,t){if(">"===e.next()){t.f=t.inline=T,r.highlightFormatting&&(t.formatting="link");var n=M(t);return n?n+=" ":n="",n+a.linkInline}return e.match(/^[^>]+/,!0),a.linkInline}function D(e,t){if(e.eatSpace())return null;var n=e.next();return"("===n||"["===n?(t.f=t.inline=E("("===n?")":"]"),r.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,M(t)):"error"}var F={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(e){return function(t,n){if(t.next()===e){n.f=n.inline=T,r.highlightFormatting&&(n.formatting="link-string");var i=M(n);return n.linkHref=!1,i}return t.match(F[e]),n.linkHref=!0,M(n)}}function O(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=N,e.next(),r.highlightFormatting&&(t.formatting="link"),t.linkText=!0,M(t)):y(e,t,T)}function N(e,t){if(e.match("]:",!0)){t.f=t.inline=z,r.highlightFormatting&&(t.formatting="link");var n=M(t);return t.linkText=!1,n}return e.match(/^([^\]\\]|\\.)+/,!0),a.linkText}function z(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),t.f=t.inline=T,a.linkHref+" url")}var P={startState:function(){return{f:w,prevLine:{stream:null},thisLine:{stream:null},block:w,htmlState:null,indentation:0,inline:T,text:L,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(n,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return k(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=C)){var r=e.match(/^\s*/,!0)[0].replace(/\t/g,v).length;if(t.indentation=r,t.indentationDiff=null,r>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==C?{state:e.htmlState,mode:n}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:P}},indent:function(t,r,i){return t.block==C&&n.indent?n.indent(t.htmlState,r,i):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,r,i):e.Pass},blankLine:k,getType:M,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return P}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(o.exports);!function(e){e.overlayMode=function(t,r,n){return{startState:function(){return{base:e.startState(t),overlay:e.startState(r),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(n){return{base:e.copyState(t,n.base),overlay:e.copyState(r,n.overlay),basePos:n.basePos,baseCur:null,overlayPos:n.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=r.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||n&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,r,n){return t.indent(e.base,r,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){var i,o;return t.blankLine&&(i=t.blankLine(e.base)),r.blankLine&&(o=r.blankLine(e.overlay)),null==o?i:n&&null!=i?i+" "+o:o}}}}(o.exports),function(e){var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",(function(r,n){var i=0;function o(e){return e.code=!1,null}var a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,r){if(r.combineTokens=null,r.codeBlock)return e.match(/^```+/)?(r.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(r.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),r.codeBlock=!0,null;if("`"===e.peek()){e.next();var o=e.pos;e.eatWhile("`");var a=1+e.pos-o;return r.code?a===i&&(r.code=!1):(i=a,r.code=!0),null}if(r.code)return e.next(),null;if(e.eatSpace())return r.ateSpace=!0,null;if((e.sol()||r.ateSpace)&&(r.ateSpace=!1,!1!==n.gitHubSpice)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return r.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return r.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(r.combineTokens=!0,"link"):(e.next(),null)},blankLine:o},l={taskLists:!0,strikethrough:!0,emoji:!0};for(var s in n)l[s]=n[s];return l.name="markdown",e.overlayMode(e.getMode(r,l),a)}),"markdown"),e.defineMIME("text/x-gfm","gfm")}(o.exports);function l(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}!function(e){e.defineMode("javascript",(function(t,r){var n,i,o=t.indentUnit,a=r.statementIndent,l=r.jsonld,s=r.json||l,u=!1!==r.trackScope,c=r.typescript,d=r.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),h=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function g(e,t,r){return n=e,i=r,t}function v(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=y(r),t.tokenize(e,t);if("."==r&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==r&&e.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return g(r);if("="==r&&e.eat(">"))return g("=>","operator");if("0"==r&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(r))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");if("/"==r)return e.eat("*")?(t.tokenize=x,x(e,t)):e.eat("/")?(e.skipToEnd(),g("comment","comment")):it(e,t,1)?(m(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(e.eat("="),g("operator","operator",e.current()));if("`"==r)return t.tokenize=b,b(e,t);if("#"==r&&"!"==e.peek())return e.skipToEnd(),g("meta","meta");if("#"==r&&e.eatWhile(d))return g("variable","property");if("<"==r&&e.match("!--")||"-"==r&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),g("comment","comment");if(h.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-|&?]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),"?"==r&&e.eat(".")?g("."):g("operator","operator",e.current());if(d.test(r)){e.eatWhile(d);var n=e.current();if("."!=t.lastType){if(f.propertyIsEnumerable(n)){var i=f[n];return g(i.type,i.style,n)}if("async"==n&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",n)}return g("variable","variable",n)}}function y(e){return function(t,r){var n,i=!1;if(l&&"@"==t.peek()&&t.match(p))return r.tokenize=v,g("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=v),g("string","string")}}function x(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=v;break}n="*"==r}return g("comment","comment")}function b(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=v;break}n=!n&&"\\"==r}return g("quasi","string-2",e.current())}var k="([{}])";function w(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(c){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=k.indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(d.test(l))o=!0;else if(/["'\/`]/.test(l))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==l&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function S(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function M(e,t){if(!u)return!1;for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}function L(e,t,r,n,i){var o=e.cc;for(T.state=e,T.stream=i,T.marked=null,T.cc=o,T.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?V:q)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return T.marked?T.marked:"variable"==r&&M(e,n)?"variable-2":t}}var T={state:null,column:null,marked:null,cc:null};function A(){for(var e=arguments.length-1;e>=0;e--)T.cc.push(arguments[e])}function D(){return A.apply(null,arguments),!0}function F(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function E(e){var t=T.state;if(T.marked="def",u){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=O(e,t.context);if(null!=n)return void(t.context=n)}else if(!F(e,t.localVars))return void(t.localVars=new P(e,t.localVars));r.globalVars&&!F(e,t.globalVars)&&(t.globalVars=new P(e,t.globalVars))}}function O(e,t){if(t){if(t.block){var r=O(e,t.prev);return r?r==t.prev?t:new z(r,t.vars,!0):null}return F(e,t.vars)?t:new z(t.prev,new P(e,t.vars),!1)}return null}function N(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function z(e,t,r){this.prev=e,this.vars=t,this.block=r}function P(e,t){this.name=e,this.next=t}var B=new P("this",new P("arguments",null));function I(){T.state.context=new z(T.state.context,T.state.localVars,!1),T.state.localVars=B}function W(){T.state.context=new z(T.state.context,T.state.localVars,!0),T.state.localVars=null}function H(){T.state.localVars=T.state.context.vars,T.state.context=T.state.context.prev}function j(e,t){var r=function(){var r=T.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new S(n,T.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function _(){var e=T.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function R(e){function t(r){return r==e?D():";"==e||"}"==r||")"==r||"]"==r?A():D(t)}return t}function q(e,t){return"var"==e?D(j("vardef",t),Ae,R(";"),_):"keyword a"==e?D(j("form"),K,q,_):"keyword b"==e?D(j("form"),q,_):"keyword d"==e?T.stream.match(/^\s*$/,!1)?D():D(j("stat"),X,R(";"),_):"debugger"==e?D(R(";")):"{"==e?D(j("}"),W,fe,_,H):";"==e?D():"if"==e?("else"==T.state.lexical.info&&T.state.cc[T.state.cc.length-1]==_&&T.state.cc.pop()(),D(j("form"),K,q,_,ze)):"function"==e?D(We):"for"==e?D(j("form"),W,Pe,q,H,_):"class"==e||c&&"interface"==t?(T.marked="keyword",D(j("form","class"==e?e:t),qe,_)):"variable"==e?c&&"declare"==t?(T.marked="keyword",D(q)):c&&("module"==t||"enum"==t||"type"==t)&&T.stream.match(/^\s*\w/,!1)?(T.marked="keyword","enum"==t?D(tt):"type"==t?D(je,R("operator"),ve,R(";")):D(j("form"),De,R("{"),j("}"),fe,_,_)):c&&"namespace"==t?(T.marked="keyword",D(j("form"),V,q,_)):c&&"abstract"==t?(T.marked="keyword",D(q)):D(j("stat"),oe):"switch"==e?D(j("form"),K,R("{"),j("}","switch"),W,fe,_,_,H):"case"==e?D(V,R(":")):"default"==e?D(R(":")):"catch"==e?D(j("form"),I,G,q,_,H):"export"==e?D(j("stat"),Ke,_):"import"==e?D(j("stat"),Xe,_):"async"==e?D(q):"@"==t?D(V,q):A(j("stat"),V,R(";"),_)}function G(e){if("("==e)return D(_e,R(")"))}function V(e,t){return $(e,t,!1)}function U(e,t){return $(e,t,!0)}function K(e){return"("!=e?A():D(j(")"),X,R(")"),_)}function $(e,t,r){if(T.state.fatArrowAt==T.stream.start){var n=r?te:ee;if("("==e)return D(I,j(")"),ce(_e,")"),_,R("=>"),n,H);if("variable"==e)return A(I,De,R("=>"),n,H)}var i=r?Q:Y;return C.hasOwnProperty(e)?D(i):"function"==e?D(We,i):"class"==e||c&&"interface"==t?(T.marked="keyword",D(j("form"),Re,_)):"keyword c"==e||"async"==e?D(r?U:V):"("==e?D(j(")"),X,R(")"),_,i):"operator"==e||"spread"==e?D(r?U:V):"["==e?D(j("]"),et,_,i):"{"==e?de(le,"}",null,i):"quasi"==e?A(J,i):"new"==e?D(re(r)):D()}function X(e){return e.match(/[;\}\)\],]/)?A():A(V)}function Y(e,t){return","==e?D(X):Q(e,t,!1)}function Q(e,t,r){var n=0==r?Y:Q,i=0==r?V:U;return"=>"==e?D(I,r?te:ee,H):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?D(n):c&&"<"==t&&T.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?D(j(">"),ce(ve,">"),_,n):"?"==t?D(V,R(":"),i):D(i):"quasi"==e?A(J,n):";"!=e?"("==e?de(U,")","call",n):"."==e?D(ae,n):"["==e?D(j("]"),X,R("]"),_,n):c&&"as"==t?(T.marked="keyword",D(ve,n)):"regexp"==e?(T.state.lastType=T.marked="operator",T.stream.backUp(T.stream.pos-T.stream.start-1),D(i)):void 0:void 0}function J(e,t){return"quasi"!=e?A():"${"!=t.slice(t.length-2)?D(J):D(X,Z)}function Z(e){if("}"==e)return T.marked="string-2",T.state.tokenize=b,D(J)}function ee(e){return w(T.stream,T.state),A("{"==e?q:V)}function te(e){return w(T.stream,T.state),A("{"==e?q:U)}function re(e){return function(t){return"."==t?D(e?ie:ne):"variable"==t&&c?D(Me,e?Q:Y):A(e?U:V)}}function ne(e,t){if("target"==t)return T.marked="keyword",D(Y)}function ie(e,t){if("target"==t)return T.marked="keyword",D(Q)}function oe(e){return":"==e?D(_,q):A(Y,R(";"),_)}function ae(e){if("variable"==e)return T.marked="property",D()}function le(e,t){return"async"==e?(T.marked="property",D(le)):"variable"==e||"keyword"==T.style?(T.marked="property","get"==t||"set"==t?D(se):(c&&T.state.fatArrowAt==T.stream.start&&(r=T.stream.match(/^\s*:\s*/,!1))&&(T.state.fatArrowAt=T.stream.pos+r[0].length),D(ue))):"number"==e||"string"==e?(T.marked=l?"property":T.style+" property",D(ue)):"jsonld-keyword"==e?D(ue):c&&N(t)?(T.marked="keyword",D(le)):"["==e?D(V,he,R("]"),ue):"spread"==e?D(U,ue):"*"==t?(T.marked="keyword",D(le)):":"==e?A(ue):void 0;var r}function se(e){return"variable"!=e?A(ue):(T.marked="property",D(We))}function ue(e){return":"==e?D(U):"("==e?A(We):void 0}function ce(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=T.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),D((function(r,n){return r==t||n==t?A():A(e)}),n)}return i==t||o==t?D():r&&r.indexOf(";")>-1?A(e):D(R(t))}return function(r,i){return r==t||i==t?D():A(e,n)}}function de(e,t,r){for(var n=3;n<arguments.length;n++)T.cc.push(arguments[n]);return D(j(t,r),ce(e,t),_)}function fe(e){return"}"==e?D():A(q,fe)}function he(e,t){if(c){if(":"==e)return D(ve);if("?"==t)return D(he)}}function pe(e,t){if(c&&(":"==e||"in"==t))return D(ve)}function me(e){if(c&&":"==e)return T.stream.match(/^\s*\w+\s+is\b/,!1)?D(V,ge,ve):D(ve)}function ge(e,t){if("is"==t)return T.marked="keyword",D()}function ve(e,t){return"keyof"==t||"typeof"==t||"infer"==t||"readonly"==t?(T.marked="keyword",D("typeof"==t?U:ve)):"variable"==e||"void"==t?(T.marked="type",D(Se)):"|"==t||"&"==t?D(ve):"string"==e||"number"==e||"atom"==e?D(Se):"["==e?D(j("]"),ce(ve,"]",","),_,Se):"{"==e?D(j("}"),xe,_,Se):"("==e?D(ce(Ce,")"),ye,Se):"<"==e?D(ce(ve,">"),ve):"quasi"==e?A(ke,Se):void 0}function ye(e){if("=>"==e)return D(ve)}function xe(e){return e.match(/[\}\)\]]/)?D():","==e||";"==e?D(xe):A(be,xe)}function be(e,t){return"variable"==e||"keyword"==T.style?(T.marked="property",D(be)):"?"==t||"number"==e||"string"==e?D(be):":"==e?D(ve):"["==e?D(R("variable"),pe,R("]"),be):"("==e?A(He,be):e.match(/[;\}\)\],]/)?void 0:D()}function ke(e,t){return"quasi"!=e?A():"${"!=t.slice(t.length-2)?D(ke):D(ve,we)}function we(e){if("}"==e)return T.marked="string-2",T.state.tokenize=b,D(ke)}function Ce(e,t){return"variable"==e&&T.stream.match(/^\s*[?:]/,!1)||"?"==t?D(Ce):":"==e?D(ve):"spread"==e?D(Ce):A(ve)}function Se(e,t){return"<"==t?D(j(">"),ce(ve,">"),_,Se):"|"==t||"."==e||"&"==t?D(ve):"["==e?D(ve,R("]"),Se):"extends"==t||"implements"==t?(T.marked="keyword",D(ve)):"?"==t?D(ve,R(":"),ve):void 0}function Me(e,t){if("<"==t)return D(j(">"),ce(ve,">"),_,Se)}function Le(){return A(ve,Te)}function Te(e,t){if("="==t)return D(ve)}function Ae(e,t){return"enum"==t?(T.marked="keyword",D(tt)):A(De,he,Oe,Ne)}function De(e,t){return c&&N(t)?(T.marked="keyword",D(De)):"variable"==e?(E(t),D()):"spread"==e?D(De):"["==e?de(Ee,"]"):"{"==e?de(Fe,"}"):void 0}function Fe(e,t){return"variable"!=e||T.stream.match(/^\s*:/,!1)?("variable"==e&&(T.marked="property"),"spread"==e?D(De):"}"==e?A():"["==e?D(V,R("]"),R(":"),Fe):D(R(":"),De,Oe)):(E(t),D(Oe))}function Ee(){return A(De,Oe)}function Oe(e,t){if("="==t)return D(U)}function Ne(e){if(","==e)return D(Ae)}function ze(e,t){if("keyword b"==e&&"else"==t)return D(j("form","else"),q,_)}function Pe(e,t){return"await"==t?D(Pe):"("==e?D(j(")"),Be,_):void 0}function Be(e){return"var"==e?D(Ae,Ie):"variable"==e?D(Ie):A(Ie)}function Ie(e,t){return")"==e?D():";"==e?D(Ie):"in"==t||"of"==t?(T.marked="keyword",D(V,Ie)):A(V,Ie)}function We(e,t){return"*"==t?(T.marked="keyword",D(We)):"variable"==e?(E(t),D(We)):"("==e?D(I,j(")"),ce(_e,")"),_,me,q,H):c&&"<"==t?D(j(">"),ce(Le,">"),_,We):void 0}function He(e,t){return"*"==t?(T.marked="keyword",D(He)):"variable"==e?(E(t),D(He)):"("==e?D(I,j(")"),ce(_e,")"),_,me,H):c&&"<"==t?D(j(">"),ce(Le,">"),_,He):void 0}function je(e,t){return"keyword"==e||"variable"==e?(T.marked="type",D(je)):"<"==t?D(j(">"),ce(Le,">"),_):void 0}function _e(e,t){return"@"==t&&D(V,_e),"spread"==e?D(_e):c&&N(t)?(T.marked="keyword",D(_e)):c&&"this"==e?D(he,Oe):A(De,he,Oe)}function Re(e,t){return"variable"==e?qe(e,t):Ge(e,t)}function qe(e,t){if("variable"==e)return E(t),D(Ge)}function Ge(e,t){return"<"==t?D(j(">"),ce(Le,">"),_,Ge):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(T.marked="keyword"),D(c?ve:V,Ge)):"{"==e?D(j("}"),Ve,_):void 0}function Ve(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&N(t))&&T.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(T.marked="keyword",D(Ve)):"variable"==e||"keyword"==T.style?(T.marked="property",D(Ue,Ve)):"number"==e||"string"==e?D(Ue,Ve):"["==e?D(V,he,R("]"),Ue,Ve):"*"==t?(T.marked="keyword",D(Ve)):c&&"("==e?A(He,Ve):";"==e||","==e?D(Ve):"}"==e?D():"@"==t?D(V,Ve):void 0}function Ue(e,t){if("!"==t)return D(Ue);if("?"==t)return D(Ue);if(":"==e)return D(ve,Oe);if("="==t)return D(U);var r=T.state.lexical.prev;return A(r&&"interface"==r.info?He:We)}function Ke(e,t){return"*"==t?(T.marked="keyword",D(Ze,R(";"))):"default"==t?(T.marked="keyword",D(V,R(";"))):"{"==e?D(ce($e,"}"),Ze,R(";")):A(q)}function $e(e,t){return"as"==t?(T.marked="keyword",D(R("variable"))):"variable"==e?A(U,$e):void 0}function Xe(e){return"string"==e?D():"("==e?A(V):"."==e?A(Y):A(Ye,Qe,Ze)}function Ye(e,t){return"{"==e?de(Ye,"}"):("variable"==e&&E(t),"*"==t&&(T.marked="keyword"),D(Je))}function Qe(e){if(","==e)return D(Ye,Qe)}function Je(e,t){if("as"==t)return T.marked="keyword",D(Ye)}function Ze(e,t){if("from"==t)return T.marked="keyword",D(V)}function et(e){return"]"==e?D():A(ce(U,"]"))}function tt(){return A(j("form"),De,R("{"),j("}"),ce(rt,"}"),_,_)}function rt(){return A(De,Oe)}function nt(e,t){return"operator"==e.lastType||","==e.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function it(e,t,r){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return I.lex=W.lex=!0,H.lex=!0,_.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new S((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&new z(null,null,!1),indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),w(e,t)),t.tokenize!=x&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",L(t,r,n,i,e))},indent:function(t,n){if(t.tokenize==x||t.tokenize==b)return e.Pass;if(t.tokenize!=v)return 0;var i,l=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var c=t.cc[u];if(c==_)s=s.prev;else if(c!=ze&&c!=H)break}for(;("stat"==s.type||"form"==s.type)&&("}"==l||(i=t.cc[t.cc.length-1])&&(i==Y||i==Q)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;a&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var d=s.type,f=l==d;return"vardef"==d?s.indented+("operator"==t.lastType||","==t.lastType?s.info.length+1:0):"form"==d&&"{"==l?s.indented:"form"==d?s.indented+o:"stat"==d?s.indented+(nt(t,n)?a||o:0):"switch"!=s.info||f||0==r.doubleIndentSwitch?s.align?s.column+(f?0:1):s.indented+(f?0:o):s.indented+(/^(?:case|default)\b/.test(n)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:l,jsonMode:s,expressionAllowed:it,skipExpression:function(t){L(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(o.exports),function(e){var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function r(e,t,r){var n=e.current(),i=n.search(t);return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}var n={};function i(e){var t=n[e];return t||(n[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function o(e,t){var r=e.match(i(t));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function a(e,t){return new RegExp((t?"^":"")+"</\\s*"+e+"\\s*>","i")}function l(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}function s(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n[0]||n[1].test(o(t,n[0])))return n[2]}}e.defineMode("htmlmixed",(function(n,i){var o=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:i.multilineTagIndentFactor,multilineTagIndentPastTag:i.multilineTagIndentPastTag,allowMissingTagName:i.allowMissingTagName}),u={},c=i&&i.tags,d=i&&i.scriptTypes;if(l(t,u),c&&l(c,u),d)for(var f=d.length-1;f>=0;f--)u.script.unshift(["type",d[f].matches,d[f].mode]);function h(t,i){var l,c=o.token(t,i.htmlState),d=/\btag\b/.test(c);if(d&&!/[<>\s\/]/.test(t.current())&&(l=i.htmlState.tagName&&i.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(l))i.inTag=l+" ";else if(i.inTag&&d&&/>$/.test(t.current())){var f=/^([\S]+) (.*)/.exec(i.inTag);i.inTag=null;var p=">"==t.current()&&s(u[f[1]],f[2]),m=e.getMode(n,p),g=a(f[1],!0),v=a(f[1],!1);i.token=function(e,t){return e.match(g,!1)?(t.token=h,t.localState=t.localMode=null,null):r(e,v,t.localMode.token(e,t.localState))},i.localMode=m,i.localState=e.startState(m,o.indent(i.htmlState,"",""))}else i.inTag&&(i.inTag+=t.current(),t.eol()&&(i.inTag+=" "));return c}return{startState:function(){return{token:h,inTag:null,localMode:null,localState:null,htmlState:e.startState(o)}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(o,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r,n){return!t.localMode||/^\s*<\//.test(r)?o.indent(t.htmlState,r,n):t.localMode.indent?t.localMode.indent(t.localState,r,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||o}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}(o.exports),a.defineMode("dot",(function(e){var t=/--|->|=|;/,r=/[\[\]{}]/;return{startState:function(){return{indent_level:0}},token:function(e,n){switch(e.eatSpace(),n.looking_for){case"multiline-comment":return e.match(/.*\*\//)?n.looking_for=null:e.skipToEnd(),"comment";case"property":return e.match("=")?"variable-3":(e.match(/\w+/),n.looking_for=null,"string-2");case"graphname":if(n.looking_for=null,e.match(/{\W*$/))return n.indent_level+=1,"bracket";if(e.match("{"))return"bracket";if(e.match(/[^\W]+/))return"variable-2";default:return e.match(/{\W*$/)?(n.indent_level+=1,"bracket"):e.match(/}\W*$/)?(n.indent_level-=1,"bracket"):e.match(r)?"bracket":e.match(/".*"/)?"string":e.match(/\w+=[\"\w]+/,!1)?(n.looking_for="property",e.match(/[^=]+/),"attribute"):e.match(t)?"variable-3":e.match(/(di)?graph[^{\w]+/)?(n.looking_for="graphname","keyword"):e.match(/\/\/|#/)?(e.skipToEnd(),"comment"):e.match(/\/\*.*\*\//)?"comment":e.match("/*")?(n.looking_for="multiline-comment","comment"):(e.match(/\w+/)||e.skipToEnd(),"variable")}},indent:function(t,r){return t.indent_level*(e.indentUnit||2)},closeBrackets:{pairs:'[]{}""'},lineComment:/(\/\/|#)/,blockCommentStart:"/*",blockCommentEnd:"*/"}})),a.defineMIME("text/x-dot","dot"),a.defineMode("markdown",(function(e,t){var r=a.getMode(e,"text/html"),n="null"==r.name;void 0===t.defaultMode&&(t.defaultMode=""),void 0===t.highlightFormatting&&(t.highlightFormatting=!1),void 0===t.maxBlockquoteDepth&&(t.maxBlockquoteDepth=0),void 0===t.taskLists&&(t.taskLists=!1),void 0===t.strikethrough&&(t.strikethrough=!1),void 0===t.emoji&&(t.emoji=!1),void 0===t.fencedCodeBlockHighlighting&&(t.fencedCodeBlockHighlighting=!0),void 0===t.xml&&(t.xml=!0),void 0===t.tokenTypeOverrides&&(t.tokenTypeOverrides={});var i={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var o in i)i.hasOwnProperty(o)&&t.tokenTypeOverrides[o]&&(i[o]=t.tokenTypeOverrides[o]);var l=/^([*\-_])(?:\s*\1){2,}\s*$/,s=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,c=t.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ *(?:\={1,}|-{1,})\s*$/,f=/^[^#!\[\]*_\\<>` "'(~:]+/,h=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function g(e,t,r){return t.f=t.inline=r,r(e,t)}function v(e,t,r){return t.f=t.block=r,r(e,t)}function y(e){if(e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==b){var t=n;if(!t){var i=a.innerMode(r,e.htmlState);t="xml"==i.mode.name&&null===i.state.tagStart&&!i.state.context&&i.state.tokenize.isInText}t&&(e.f=S,e.block=x,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function x(r,n){var o,f=r.column()===n.indentation,m=!(o=n.prevLine.stream)||!/\S/.test(o.string),v=n.indentedCode,y=n.prevLine.hr,x=!1!==n.list,b=(n.listStack[n.listStack.length-1]||0)+3;n.indentedCode=!1;var C=n.indentation;if(null===n.indentationDiff&&(n.indentationDiff=n.indentation,x)){for(n.list=null;C<n.listStack[n.listStack.length-1];)n.listStack.pop(),n.listStack.length?n.indentation=n.listStack[n.listStack.length-1]:n.list=!1;!1!==n.list&&(n.indentationDiff=C-n.listStack[n.listStack.length-1])}var S=!(m||y||n.prevLine.header||x&&v||n.prevLine.fencedCodeEnd),M=(!1===n.list||y||m)&&n.indentation<=b&&r.match(l),L=null;if(n.indentationDiff>=4&&(v||n.prevLine.fencedCodeEnd||n.prevLine.header||m))return r.skipToEnd(),n.indentedCode=!0,i.code;if(r.eatSpace())return null;if(f&&n.indentation<=b&&(L=r.match(c))&&L[1].length<=6)return n.quote=0,n.header=L[1].length,n.thisLine.header=!0,t.highlightFormatting&&(n.formatting="header"),n.f=n.inline,w(n);if(n.indentation<=b&&r.eat(">"))return n.quote=f?1:n.quote+1,t.highlightFormatting&&(n.formatting="quote"),r.eatSpace(),w(n);if(!M&&!n.setext&&f&&n.indentation<=b&&(L=r.match(s))){var T=L[1]?"ol":"ul";return n.indentation=C+r.current().length,n.list=!0,n.quote=0,n.listStack.push(n.indentation),n.em=!1,n.strong=!1,n.code=!1,n.strikethrough=!1,t.taskLists&&r.match(u,!1)&&(n.taskList=!0),n.f=n.inline,t.highlightFormatting&&(n.formatting=["list","list-"+T]),w(n)}return f&&n.indentation<=b&&(L=r.match(h,!0))?(n.quote=0,n.fencedEndRE=new RegExp(L[1]+"+ *$"),n.localMode=t.fencedCodeBlockHighlighting&&function(r){if(r=""===r?t.defaultMode:r,a.findModeByName){var n=a.findModeByName(r);n&&(r=n.mime||n.mimes[0])}var i=a.getMode(e,r);return"null"==i.name?null:i}(L[2]),n.localMode&&(n.localState=a.startState(n.localMode)),n.f=n.block=k,t.highlightFormatting&&(n.formatting="code-block"),n.code=-1,w(n)):n.setext||!(S&&x||n.quote||!1!==n.list||n.code||M||p.test(r.string))&&(L=r.lookAhead(1))&&(L=L.match(d))?(n.setext?(n.header=n.setext,n.setext=0,r.skipToEnd(),t.highlightFormatting&&(n.formatting="header")):(n.header="="==L[0].charAt(0)?1:2,n.setext=n.header),n.thisLine.header=!0,n.f=n.inline,w(n)):M?(r.skipToEnd(),n.hr=!0,n.thisLine.hr=!0,i.hr):"["===r.peek()?g(r,n,A):g(r,n,n.inline)}function b(e,t){var i=r.token(e,t.htmlState);if(!n){var o=a.innerMode(r,t.htmlState);("xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=S,t.block=x,t.htmlState=null)}return i}function k(e,r){var n,o=r.listStack[r.listStack.length-1]||0,a=r.indentation<o,l=o+3;return r.fencedEndRE&&r.indentation<=l&&(a||e.match(r.fencedEndRE))?(t.highlightFormatting&&(r.formatting="code-block"),a||(n=w(r)),r.localMode=r.localState=null,r.block=x,r.f=S,r.fencedEndRE=null,r.code=0,r.thisLine.fencedCodeEnd=!0,a?v(e,r,r.block):n):r.localMode?r.localMode.token(e,r.localState):(e.skipToEnd(),i.code)}function w(e){var r=[];if(e.formatting){r.push(i.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var n=0;n<e.formatting.length;n++)r.push(i.formatting+"-"+e.formatting[n]),"header"===e.formatting[n]&&r.push(i.formatting+"-"+e.formatting[n]+"-"+e.header),"quote"===e.formatting[n]&&(!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?r.push(i.formatting+"-"+e.formatting[n]+"-"+e.quote):r.push("error"))}if(e.taskOpen)return r.push("meta"),r.length?r.join(" "):null;if(e.taskClosed)return r.push("property"),r.length?r.join(" "):null;if(e.linkHref?r.push(i.linkHref,"url"):(e.strong&&r.push(i.strong),e.em&&r.push(i.em),e.strikethrough&&r.push(i.strikethrough),e.emoji&&r.push(i.emoji),e.linkText&&r.push(i.linkText),e.code&&r.push(i.code),e.image&&r.push(i.image),e.imageAltText&&r.push(i.imageAltText,"link"),e.imageMarker&&r.push(i.imageMarker)),e.header&&r.push(i.header,i.header+"-"+e.header),e.quote&&(r.push(i.quote),!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?r.push(i.quote+"-"+e.quote):r.push(i.quote+"-"+t.maxBlockquoteDepth)),!1!==e.list){var o=(e.listStack.length-1)%3;o?1===o?r.push(i.list2):r.push(i.list3):r.push(i.list1)}return e.trailingSpaceNewLine?r.push("trailing-space-new-line"):e.trailingSpace&&r.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),r.length?r.join(" "):null}function C(e,t){if(e.match(f,!0))return w(t)}function S(e,n){var o=n.text(e,n);if(void 0!==o)return o;if(n.list)return n.list=null,w(n);if(n.taskList)return" "===e.match(u,!0)[1]?n.taskOpen=!0:n.taskClosed=!0,t.highlightFormatting&&(n.formatting="task"),n.taskList=!1,w(n);if(n.taskOpen=!1,n.taskClosed=!1,n.header&&e.match(/^#+$/,!0))return t.highlightFormatting&&(n.formatting="header"),w(n);var l=e.next();if(n.linkTitle){n.linkTitle=!1;var s=l;"("===l&&(s=")");var c="^\\s*(?:[^"+(s=(s+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+s;if(e.match(new RegExp(c),!0))return i.linkHref}if("`"===l){var d=n.formatting;t.highlightFormatting&&(n.formatting="code"),e.eatWhile("`");var f=e.current().length;if(0!=n.code||n.quote&&1!=f){if(f==n.code){var h=w(n);return n.code=0,h}return n.formatting=d,w(n)}return n.code=f,w(n)}if(n.code)return w(n);if("\\"===l&&(e.next(),t.highlightFormatting)){var p=w(n),g=i.formatting+"-escape";return p?p+" "+g:g}if("!"===l&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return n.imageMarker=!0,n.image=!0,t.highlightFormatting&&(n.formatting="image"),w(n);if("["===l&&n.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return n.imageMarker=!1,n.imageAltText=!0,t.highlightFormatting&&(n.formatting="image"),w(n);if("]"===l&&n.imageAltText){t.highlightFormatting&&(n.formatting="image");var p=w(n);return n.imageAltText=!1,n.image=!1,n.inline=n.f=L,p}if("["===l&&!n.image)return n.linkText&&e.match(/^.*?\]/)||(n.linkText=!0,t.highlightFormatting&&(n.formatting="link")),w(n);if("]"===l&&n.linkText){t.highlightFormatting&&(n.formatting="link");var p=w(n);return n.linkText=!1,n.inline=n.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?L:S,p}if("<"===l&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return n.f=n.inline=M,t.highlightFormatting&&(n.formatting="link"),(p=w(n))?p+=" ":p="",p+i.linkInline;if("<"===l&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return n.f=n.inline=M,t.highlightFormatting&&(n.formatting="link"),(p=w(n))?p+=" ":p="",p+i.linkEmail;if(t.xml&&"<"===l&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var y=e.string.indexOf(">",e.pos);if(-1!=y){var x=e.string.substring(e.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(x)&&(n.md_inside=!0)}return e.backUp(1),n.htmlState=a.startState(r),v(e,n,b)}if(t.xml&&"<"===l&&e.match(/^\/\w*?>/))return n.md_inside=!1,"tag";if("*"===l||"_"===l){for(var k=1,C=1==e.pos?" ":e.string.charAt(e.pos-2);k<3&&e.eat(l);)k++;var T=e.peek()||" ",A=!/\s/.test(T)&&(!m.test(T)||/\s/.test(C)||m.test(C)),D=!/\s/.test(C)&&(!m.test(C)||/\s/.test(T)||m.test(T)),F=null,E=null;if(k%2&&(n.em||!A||"*"!==l&&D&&!m.test(C)?n.em!=l||!D||"*"!==l&&A&&!m.test(T)||(F=!1):F=!0),k>1&&(n.strong||!A||"*"!==l&&D&&!m.test(C)?n.strong!=l||!D||"*"!==l&&A&&!m.test(T)||(E=!1):E=!0),null!=E||null!=F){t.highlightFormatting&&(n.formatting=null==F?"strong":null==E?"em":"strong em"),!0===F&&(n.em=l),!0===E&&(n.strong=l);h=w(n);return!1===F&&(n.em=!1),!1===E&&(n.strong=!1),h}}else if(" "===l&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return w(n);e.backUp(1)}if(t.strikethrough)if("~"===l&&e.eatWhile(l)){if(n.strikethrough){t.highlightFormatting&&(n.formatting="strikethrough");h=w(n);return n.strikethrough=!1,h}if(e.match(/^[^\s]/,!1))return n.strikethrough=!0,t.highlightFormatting&&(n.formatting="strikethrough"),w(n)}else if(" "===l&&e.match(/^~~/,!0)){if(" "===e.peek())return w(n);e.backUp(2)}if(t.emoji&&":"===l&&e.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){n.emoji=!0,t.highlightFormatting&&(n.formatting="emoji");var O=w(n);return n.emoji=!1,O}return" "===l&&(e.match(/^ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),w(n)}function M(e,r){if(">"===e.next()){r.f=r.inline=S,t.highlightFormatting&&(r.formatting="link");var n=w(r);return n?n+=" ":n="",n+i.linkInline}return e.match(/^[^>]+/,!0),i.linkInline}function L(e,r){if(e.eatSpace())return null;var n,i=e.next();return"("===i||"["===i?(r.f=r.inline=(n="("===i?")":"]",function(e,r){if(e.next()===n){r.f=r.inline=S,t.highlightFormatting&&(r.formatting="link-string");var i=w(r);return r.linkHref=!1,i}return e.match(T[n]),r.linkHref=!0,w(r)}),t.highlightFormatting&&(r.formatting="link-string"),r.linkHref=!0,w(r)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function A(e,r){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(r.f=D,e.next(),t.highlightFormatting&&(r.formatting="link"),r.linkText=!0,w(r)):g(e,r,S)}function D(e,r){if(e.match(/^\]:/,!0)){r.f=r.inline=F,t.highlightFormatting&&(r.formatting="link");var n=w(r);return r.linkText=!1,n}return e.match(/^([^\]\\]|\\.)+/,!0),i.linkText}function F(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=S,i.linkHref+" url")}var E={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:S,text:C,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&a.copyState(r,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?a.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,linkHref:e.linkHref,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return y(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=b)){var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=r,t.indentationDiff=null,r>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==b?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:E}},indent:function(e,t,n){return e.block==b&&r.indent?r.indent(e.htmlState,t,n):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,t,n):a.Pass},blankLine:y,getType:w,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return E}),"xml"),a.defineMIME("text/markdown","markdown"),a.defineMIME("text/x-markdown","markdown");l('.CodeMirror{color:#000;direction:ltr;font-family:monospace;height:300px}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{background-color:#f7f7f7;border-right:1px solid #ddd;white-space:nowrap}.CodeMirror-linenumber{color:#999;min-width:20px;padding:0 3px 0 5px;text-align:right;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{background:#7e7;border:0!important;width:auto}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:-50px}.CodeMirror-ruler{border-left:1px solid #ccc;bottom:0;position:absolute;top:0}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{background:#fff;overflow:hidden;position:relative}.CodeMirror-scroll{height:100%;margin-bottom:-50px;margin-right:-50px;outline:none;overflow:scroll!important;padding-bottom:50px;position:relative;z-index:0}.CodeMirror-sizer{border-right:50px solid transparent;position:relative}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{display:none;outline:none;position:absolute;z-index:6}.CodeMirror-vscrollbar{overflow-x:hidden;overflow-y:scroll;right:0;top:0}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-x:scroll;overflow-y:hidden}.CodeMirror-scrollbar-filler{bottom:0;right:0}.CodeMirror-gutter-filler{bottom:0;left:0}.CodeMirror-gutters{left:0;min-height:100%;position:absolute;top:0;z-index:3}.CodeMirror-gutter{display:inline-block;height:100%;margin-bottom:-50px;vertical-align:top;white-space:normal}.CodeMirror-gutter-wrapper{background:none!important;border:none!important;position:absolute;z-index:4}.CodeMirror-gutter-background{bottom:0;position:absolute;top:0;z-index:4}.CodeMirror-gutter-elt{cursor:default;position:absolute;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{word-wrap:normal;-webkit-tap-highlight-color:transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual;line-height:inherit;margin:0;overflow:visible;position:relative;white-space:pre;z-index:2}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}.CodeMirror-linewidget{padding:.1px;position:relative;z-index:2}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{height:0;overflow:hidden;position:absolute;visibility:hidden;width:100%}.CodeMirror-cursor{pointer-events:none;position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{position:relative;visibility:hidden;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}'),function(e){function t(t){return function(r,n){var i=n.line,o=r.getLine(i);function a(t){for(var a,l=n.ch,s=0;;){var u=l<=0?-1:o.lastIndexOf(t[0],l-1);if(-1!=u){if(1==s&&u<n.ch)break;if(a=r.getTokenTypeAt(e.Pos(i,u+1)),!/^(comment|string)/.test(a))return{ch:u+1,tokenType:a,pair:t};l=u-1}else{if(1==s)break;s=1,l=o.length}}}function l(t){var n,o,a=1,l=r.lastLine(),s=t.ch;e:for(var u=i;u<=l;++u)for(var c=r.getLine(u),d=u==i?s:0;;){var f=c.indexOf(t.pair[0],d),h=c.indexOf(t.pair[1],d);if(f<0&&(f=c.length),h<0&&(h=c.length),(d=Math.min(f,h))==c.length)break;if(r.getTokenTypeAt(e.Pos(u,d+1))==t.tokenType)if(d==f)++a;else if(! --a){n=u,o=d;break e}++d}return null==n||i==n?null:{from:e.Pos(i,s),to:e.Pos(n,o)}}for(var s=[],u=0;u<t.length;u++){var c=a(t[u]);c&&s.push(c)}for(s.sort((function(e,t){return e.ch-t.ch})),u=0;u<s.length;u++){var d=l(s[u]);if(d)return d}return null}}e.registerHelper("fold","brace",t([["{","}"],["[","]"]])),e.registerHelper("fold","brace-paren",t([["{","}"],["[","]"],["(",")"]])),e.registerHelper("fold","import",(function(t,r){function n(r){if(r<t.firstLine()||r>t.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));if(/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"keyword"!=n.type||"import"!=n.string)return null;for(var i=r,o=Math.min(t.lastLine(),r+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:n.end,end:e.Pos(i,a)}}}var i,o=r.line,a=n(o);if(!a||n(o-1)||(i=n(o-2))&&i.end.line==o-1)return null;for(var l=a.end;;){var s=n(l.line+1);if(null==s)break;l=s.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:l}})),e.registerHelper("fold","include",(function(t,r){function n(r){if(r<t.firstLine()||r>t.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));return/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"meta"==n.type&&"#include"==n.string.slice(0,8)?n.start+8:void 0}var i=r.line,o=n(i);if(null==o||null!=n(i-1))return null;for(var a=i;null!=n(a+1);)++a;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}}))}(o.exports),function(e){e.registerGlobalHelper("fold","comment",(function(e){return e.blockCommentStart&&e.blockCommentEnd}),(function(t,r){var n=t.getModeAt(r),i=n.blockCommentStart,o=n.blockCommentEnd;if(i&&o){for(var a,l=r.line,s=t.getLine(l),u=r.ch,c=0;;){var d=u<=0?-1:s.lastIndexOf(i,u-1);if(-1!=d){if(1==c&&d<r.ch)return;if(/comment/.test(t.getTokenTypeAt(e.Pos(l,d+1)))&&(0==d||s.slice(d-o.length,d)==o||!/comment/.test(t.getTokenTypeAt(e.Pos(l,d))))){a=d+i.length;break}u=d-1}else{if(1==c)return;c=1,u=s.length}}var f,h,p=1,m=t.lastLine();e:for(var g=l;g<=m;++g)for(var v=t.getLine(g),y=g==l?a:0;;){var x=v.indexOf(i,y),b=v.indexOf(o,y);if(x<0&&(x=v.length),b<0&&(b=v.length),(y=Math.min(x,b))==v.length)break;if(y==x)++p;else if(! --p){f=g,h=y;break e}++y}if(null!=f&&(l!=f||h!=a))return{from:e.Pos(l,a),to:e.Pos(f,h)}}}))}(o.exports);!function(e){function t(t,n,o,a){if(o&&o.call){var l=o;o=null}else l=i(t,o,"rangeFinder");"number"==typeof n&&(n=e.Pos(n,0));var s=i(t,o,"minFoldSize");function u(e){var r=l(t,n);if(!r||r.to.line-r.from.line<s)return null;if("fold"===a)return r;for(var i=t.findMarksAt(r.from),o=0;o<i.length;++o)if(i[o].__isFold){if(!e)return null;r.cleared=!0,i[o].clear()}return r}var c=u(!0);if(i(t,o,"scanUp"))for(;!c&&n.line>t.firstLine();)n=e.Pos(n.line-1,0),c=u(!1);if(c&&!c.cleared&&"unfold"!==a){var d=r(t,o,c);e.on(d,"mousedown",(function(t){f.clear(),e.e_preventDefault(t)}));var f=t.markText(c.from,c.to,{replacedWith:d,clearOnEnter:i(t,o,"clearOnEnter"),__isFold:!0});f.on("clear",(function(r,n){e.signal(t,"unfold",t,r,n)})),e.signal(t,"fold",t,c.from,c.to)}}function r(e,t,r){var n=i(e,t,"widget");if("function"==typeof n&&(n=n(r.from,r.to)),"string"==typeof n){var o=document.createTextNode(n);(n=document.createElement("span")).appendChild(o),n.className="CodeMirror-foldmarker"}else n&&(n=n.cloneNode(!0));return n}e.newFoldFunction=function(e,r){return function(n,i){t(n,i,{rangeFinder:e,widget:r})}},e.defineExtension("foldCode",(function(e,r,n){t(this,e,r,n)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),r=0;r<t.length;++r)if(t[r].__isFold)return!0})),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),{scanUp:!1},"unfold")},e.commands.foldAll=function(t){t.operation((function(){for(var r=t.firstLine(),n=t.lastLine();r<=n;r++)t.foldCode(e.Pos(r,0),{scanUp:!1},"fold")}))},e.commands.unfoldAll=function(t){t.operation((function(){for(var r=t.firstLine(),n=t.lastLine();r<=n;r++)t.foldCode(e.Pos(r,0),{scanUp:!1},"unfold")}))},e.registerHelper("fold","combine",(function(){var e=Array.prototype.slice.call(arguments,0);return function(t,r){for(var n=0;n<e.length;++n){var i=e[n](t,r);if(i)return i}}})),e.registerHelper("fold","auto",(function(e,t){for(var r=e.getHelpers(t,"fold"),n=0;n<r.length;n++){var i=r[n](e,t);if(i)return i}}));var n={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function i(e,t,r){if(t&&void 0!==t[r])return t[r];var i=e.options.foldOptions;return i&&void 0!==i[r]?i[r]:n[r]}e.defineOption("foldOptions",null),e.defineExtension("foldOption",(function(e,t){return i(this,e,t)}))}(o.exports),function(e){e.defineOption("foldGutter",!1,(function(t,i,o){o&&o!=e.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",u),t.off("changes",d),t.off("viewportChange",f),t.off("fold",h),t.off("unfold",h),t.off("swapDoc",d),t.off("optionChange",c)),i&&(t.state.foldGutter=new r(n(i)),s(t),t.on("gutterClick",u),t.on("changes",d),t.on("viewportChange",f),t.on("fold",h),t.on("unfold",h),t.on("swapDoc",d),t.on("optionChange",c))}));var t=e.Pos;function r(e){this.options=e,this.from=this.to=0}function n(e){return!0===e&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function i(e,r){for(var n=e.findMarks(t(r,0),t(r+1,0)),i=0;i<n.length;++i)if(n[i].__isFold){var o=n[i].find(-1);if(o&&o.line===r)return n[i]}}function o(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function a(e,r,n){var a=e.state.foldGutter.options,s=r-1,u=e.foldOption(a,"minFoldSize"),c=e.foldOption(a,"rangeFinder"),d="string"==typeof a.indicatorFolded&&l(a.indicatorFolded),f="string"==typeof a.indicatorOpen&&l(a.indicatorOpen);e.eachLine(r,n,(function(r){++s;var n=null,l=r.gutterMarkers;if(l&&(l=l[a.gutter]),i(e,s)){if(d&&l&&d.test(l.className))return;n=o(a.indicatorFolded)}else{var h=t(s,0),p=c&&c(e,h);if(p&&p.to.line-p.from.line>=u){if(f&&l&&f.test(l.className))return;n=o(a.indicatorOpen)}}(n||l)&&e.setGutterMarker(r,a.gutter,n)}))}function l(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function s(e){var t=e.getViewport(),r=e.state.foldGutter;r&&(e.operation((function(){a(e,t.from,t.to)})),r.from=t.from,r.to=t.to)}function u(e,r,n){var o=e.state.foldGutter;if(o){var a=o.options;if(n==a.gutter){var l=i(e,r);l?l.clear():e.foldCode(t(r,0),a)}}}function c(e,t){"mode"==t&&d(e)}function d(e){var t=e.state.foldGutter;if(t){var r=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){s(e)}),r.foldOnChangeTimeSpan||600)}}function f(e){var t=e.state.foldGutter;if(t){var r=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var r=e.getViewport();t.from==t.to||r.from-t.to>20||t.from-r.to>20?s(e):e.operation((function(){r.from<t.from&&(a(e,r.from,t.from),t.from=r.from),r.to>t.to&&(a(e,t.to,r.to),t.to=r.to)}))}),r.updateViewportTimeSpan||400)}}function h(e,t){var r=e.state.foldGutter;if(r){var n=t.line;n>=r.from&&n<r.to&&a(e,n,n+1)}}}(o.exports),function(e){function t(t,r){var n=t.getLine(r),i=n.search(/\S/);return-1==i||/\bcomment\b/.test(t.getTokenTypeAt(e.Pos(r,i+1)))?-1:e.countColumn(n,null,t.getOption("tabSize"))}e.registerHelper("fold","indent",(function(r,n){var i=t(r,n.line);if(!(i<0)){for(var o=null,a=n.line+1,l=r.lastLine();a<=l;++a){var s=t(r,a);if(-1==s);else{if(!(s>i))break;o=a}}return o?{from:e.Pos(n.line,r.getLine(n.line).length),to:e.Pos(o,r.getLine(o).length)}:void 0}}))}(o.exports),function(e){var t=e.Pos;function r(e,t){return e.line-t.line||e.ch-t.ch}var n="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=new RegExp("<(/?)(["+n+"]["+n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function a(e,r){var n=e.cm.getTokenTypeAt(t(e.line,r));return n&&/\btag\b/.test(n)}function l(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function s(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function u(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(l(e))continue;return}if(a(e,t+1)){var r=e.text.lastIndexOf("/",t),n=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t+1}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(s(e))continue;return}if(a(e,t+1)){i.lastIndex=t,e.ch=t;var r=i.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function d(e){for(;;){i.lastIndex=e.ch;var t=i.exec(e.text);if(!t){if(l(e))continue;return}if(a(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function f(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(s(e))continue;return}if(a(e,t+1)){var r=e.text.lastIndexOf("/",t),n=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t}}function h(e,r){for(var n=[];;){var i,o=d(e),a=e.line,l=e.ch-(o?o[0].length:0);if(!o||!(i=u(e)))return;if("selfClose"!=i)if(o[1]){for(var s=n.length-1;s>=0;--s)if(n[s]==o[2]){n.length=s;break}if(s<0&&(!r||r==o[2]))return{tag:o[2],from:t(a,l),to:t(e.line,e.ch)}}else n.push(o[2])}}function p(e,r){for(var n=[];;){var i=f(e);if(!i)return;if("selfClose"!=i){var o=e.line,a=e.ch,l=c(e);if(!l)return;if(l[1])n.push(l[2]);else{for(var s=n.length-1;s>=0;--s)if(n[s]==l[2]){n.length=s;break}if(s<0&&(!r||r==l[2]))return{tag:l[2],from:t(e.line,e.ch),to:t(o,a)}}}else c(e)}}e.registerHelper("fold","xml",(function(e,n){for(var i=new o(e,n.line,0);;){var a=d(i);if(!a||i.line!=n.line)return;var l=u(i);if(!l)return;if(!a[1]&&"selfClose"!=l){var s=t(i.line,i.ch),c=h(i,a[2]);return c&&r(c.from,s)>0?{from:s,to:c.from}:null}}})),e.findMatchingTag=function(e,n,i){var a=new o(e,n.line,n.ch,i);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var l=u(a),s=l&&t(a.line,a.ch),d=l&&c(a);if(l&&d&&!(r(a,n)>0)){var f={from:t(a.line,a.ch),to:s,tag:d[2]};return"selfClose"==l?{open:f,close:null,at:"open"}:d[1]?{open:p(a,d[2]),close:f,at:"close"}:{open:f,close:h(a=new o(e,s.line,s.ch,i),d[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r,n){for(var i=new o(e,t.line,t.ch,r);;){var a=p(i,n);if(!a)break;var l=h(new o(e,t.line,t.ch,r),a.tag);if(l)return{open:a,close:l}}},e.scanForClosingTag=function(e,t,r,n){return h(new o(e,t.line,t.ch,n?{from:0,to:n}:null),r)}}(o.exports);l('.CodeMirror-foldmarker{color:blue;cursor:pointer;font-family:arial;line-height:.3;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\\25BE"}.CodeMirror-foldgutter-folded:after{content:"\\25B8"}');!function(e){function t(t,r,n){var i,o=t.getWrapperElement();return(i=o.appendChild(document.createElement("div"))).className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof r?i.innerHTML=r:i.appendChild(r),e.addClass(o,"dialog-opened"),i}function r(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",(function(n,i,o){o||(o={}),r(this,null);var a=t(this,n,o.bottom),l=!1,s=this;function u(t){if("string"==typeof t)d.value=t;else{if(l)return;l=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),s.focus(),o.onClose&&o.onClose(a)}}var c,d=a.getElementsByTagName("input")[0];return d?(d.focus(),o.value&&(d.value=o.value,!1!==o.selectValueOnOpen&&d.select()),o.onInput&&e.on(d,"input",(function(e){o.onInput(e,d.value,u)})),o.onKeyUp&&e.on(d,"keyup",(function(e){o.onKeyUp(e,d.value,u)})),e.on(d,"keydown",(function(t){o&&o.onKeyDown&&o.onKeyDown(t,d.value,u)||((27==t.keyCode||!1!==o.closeOnEnter&&13==t.keyCode)&&(d.blur(),e.e_stop(t),u()),13==t.keyCode&&i(d.value,t))})),!1!==o.closeOnBlur&&e.on(a,"focusout",(function(e){null!==e.relatedTarget&&u()}))):(c=a.getElementsByTagName("button")[0])&&(e.on(c,"click",(function(){u(),s.focus()})),!1!==o.closeOnBlur&&e.on(c,"blur",u),c.focus()),u})),e.defineExtension("openConfirm",(function(n,i,o){r(this,null);var a=t(this,n,o&&o.bottom),l=a.getElementsByTagName("button"),s=!1,u=this,c=1;function d(){s||(s=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),u.focus())}l[0].focus();for(var f=0;f<l.length;++f){var h=l[f];!function(t){e.on(h,"click",(function(r){e.e_preventDefault(r),d(),t&&t(u)}))}(i[f]),e.on(h,"blur",(function(){--c,setTimeout((function(){c<=0&&d()}),200)})),e.on(h,"focus",(function(){++c}))}})),e.defineExtension("openNotification",(function(n,i){r(this,u);var o,a=t(this,n,i&&i.bottom),l=!1,s=i&&void 0!==i.duration?i.duration:5e3;function u(){l||(l=!0,clearTimeout(o),e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a))}return e.on(a,"click",(function(t){e.e_preventDefault(t),u()})),s&&(o=setTimeout(u,s)),u}))}(o.exports),function(e){function t(e,t,r,n,i){e.openDialog?e.openDialog(t,i,{value:n,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(r,n))}function r(e){return e.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use line:column or scroll% syntax)")+"</span>"}function n(e,t){var r=Number(t);return/^[-+]/.test(t)?e.getCursor().line+r:r-1}e.defineOption("search",{bottom:!1}),e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,r(e),e.phrase("Jump to line:"),i.line+1+":"+i.ch,(function(t){var r;if(t)if(r=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(n(e,r[1]),Number(r[2]));else if(r=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var o=Math.round(e.lineCount()*Number(r[1])/100);/^[-+]/.test(r[1])&&(o=i.line+o+1),e.setCursor(o-1,i.ch)}else(r=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(n(e,r[1]),i.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}(o.exports);!function(e){var t,r,n=e.Pos;function i(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}function o(e,t){for(var r=i(e),n=r,o=0;o<t.length;o++)-1==n.indexOf(t.charAt(o))&&(n+=t.charAt(o));return r==n?e:new RegExp(e.source,n)}function a(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function l(e,t,r){t=o(t,"g");for(var i=r.line,a=r.ch,l=e.lastLine();i<=l;i++,a=0){t.lastIndex=a;var s=e.getLine(i),u=t.exec(s);if(u)return{from:n(i,u.index),to:n(i,u.index+u[0].length),match:u}}}function s(e,t,r){if(!a(t))return l(e,t,r);t=o(t,"gm");for(var i,s=1,u=r.line,c=e.lastLine();u<=c;){for(var d=0;d<s&&!(u>c);d++){var f=e.getLine(u++);i=null==i?f:i+"\n"+f}s*=2,t.lastIndex=r.ch;var h=t.exec(i);if(h){var p=i.slice(0,h.index).split("\n"),m=h[0].split("\n"),g=r.line+p.length-1,v=p[p.length-1].length;return{from:n(g,v),to:n(g+m.length-1,1==m.length?v+m[0].length:m[m.length-1].length),match:h}}}}function u(e,t,r){for(var n,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-r)break;(!n||a>n.index+n[0].length)&&(n=o),i=o.index+1}return n}function c(e,t,r){t=o(t,"g");for(var i=r.line,a=r.ch,l=e.firstLine();i>=l;i--,a=-1){var s=e.getLine(i),c=u(s,t,a<0?0:s.length-a);if(c)return{from:n(i,c.index),to:n(i,c.index+c[0].length),match:c}}}function d(e,t,r){if(!a(t))return c(e,t,r);t=o(t,"gm");for(var i,l=1,s=e.getLine(r.line).length-r.ch,d=r.line,f=e.firstLine();d>=f;){for(var h=0;h<l&&d>=f;h++){var p=e.getLine(d--);i=null==i?p:p+"\n"+i}l*=2;var m=u(i,t,s);if(m){var g=i.slice(0,m.index).split("\n"),v=m[0].split("\n"),y=d+g.length,x=g[g.length-1].length;return{from:n(y,x),to:n(y+v.length-1,1==v.length?x+v[0].length:v[v.length-1].length),match:m}}}}function f(e,t,r,n){if(e.length==t.length)return r;for(var i=0,o=r+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,l=n(e.slice(0,a)).length;if(l==r)return a;l>r?o=a:i=a+1}}function h(e,i,o,a){if(!i.length)return null;var l=a?t:r,s=l(i).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.lastLine()+1-s.length;u<=d;u++,c=0){var h=e.getLine(u).slice(c),p=l(h);if(1==s.length){var m=p.indexOf(s[0]);if(-1==m)continue e;return o=f(h,p,m,l)+c,{from:n(u,f(h,p,m,l)+c),to:n(u,f(h,p,m+s[0].length,l)+c)}}var g=p.length-s[0].length;if(p.slice(g)==s[0]){for(var v=1;v<s.length-1;v++)if(l(e.getLine(u+v))!=s[v])continue e;var y=e.getLine(u+s.length-1),x=l(y),b=s[s.length-1];if(x.slice(0,b.length)==b)return{from:n(u,f(h,p,g,l)+c),to:n(u+s.length-1,f(y,x,b.length,l))}}}}function p(e,i,o,a){if(!i.length)return null;var l=a?t:r,s=l(i).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.firstLine()-1+s.length;u>=d;u--,c=-1){var h=e.getLine(u);c>-1&&(h=h.slice(0,c));var p=l(h);if(1==s.length){var m=p.lastIndexOf(s[0]);if(-1==m)continue e;return{from:n(u,f(h,p,m,l)),to:n(u,f(h,p,m+s[0].length,l))}}var g=s[s.length-1];if(p.slice(0,g.length)==g){var v=1;for(o=u-s.length+1;v<s.length-1;v++)if(l(e.getLine(o+v))!=s[v])continue e;var y=e.getLine(u+1-s.length),x=l(y);if(x.slice(x.length-s[0].length)==s[0])return{from:n(u+1-s.length,f(y,x,y.length-s[0].length,l)),to:n(u,f(h,p,g.length,l))}}}}function m(e,t,r,i){var a;this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=e,r=r?e.clipPos(r):n(0,0),this.pos={from:r,to:r},"object"==typeof i?a=i.caseFold:(a=i,i=null),"string"==typeof t?(null==a&&(a=!1),this.matches=function(r,n){return(r?p:h)(e,t,n,a)}):(t=o(t,"gm"),i&&!1===i.multiline?this.matches=function(r,n){return(r?c:l)(e,t,n)}:this.matches=function(r,n){return(r?d:s)(e,t,n)})}String.prototype.normalize?(t=function(e){return e.normalize("NFD").toLowerCase()},r=function(e){return e.normalize("NFD")}):(t=function(e){return e.toLowerCase()},r=function(e){return e}),m.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){var r=this.doc.clipPos(t?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(r=n(r.line,r.ch),t?(r.ch--,r.ch<0&&(r.line--,r.ch=(this.doc.getLine(r.line)||"").length)):(r.ch++,r.ch>(this.doc.getLine(r.line)||"").length&&(r.ch=0,r.line++)),0!=e.cmpPos(r,this.doc.clipPos(r))))return this.atOccurrence=!1;var i=this.matches(t,r);if(this.afterEmptyMatch=i&&0==e.cmpPos(i.from,i.to),i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var o=n(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,r){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,r),this.pos.to=n(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,r){return new m(this.doc,e,t,r)})),e.defineDocExtension("getSearchCursor",(function(e,t,r){return new m(this,e,t,r)})),e.defineExtension("selectMatches",(function(t,r){for(var n=[],i=this.getSearchCursor(t,this.getCursor("from"),r);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)n.push({anchor:i.from(),head:i.to()});n.length&&this.setSelections(n,0)}))}(o.exports),function(e){function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var r=e.exec(t.string);if(r&&r.index==t.pos)return t.pos+=r[0].length||1,"searching";r?t.pos=r.index:t.skipToEnd()}}}function r(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(e){return e.state.search||(e.state.search=new r)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,r){return e.getSearchCursor(t,r,{caseFold:i(t),multiline:!0})}function a(e,t,r,n,i){e.openDialog(t,n,{value:r,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){p(e)},onKeyDown:i,bottom:e.options.search.bottom})}function l(e,t,r,n,i){e.openDialog?e.openDialog(t,i,{value:n,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(r,n))}function s(e,t,r,n){e.openConfirm?e.openConfirm(t,n):confirm(r)&&n[0]()}function u(e){return e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"==t?"\\":e}))}function c(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(e){}else e=u(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function d(e,r,n){r.queryText=n,r.query=c(n),e.removeOverlay(r.overlay,i(r.query)),r.overlay=t(r.query,i(r.query)),e.addOverlay(r.overlay),e.showMatchesOnScrollbar&&(r.annotate&&(r.annotate.clear(),r.annotate=null),r.annotate=e.showMatchesOnScrollbar(r.query,i(r.query)))}function f(t,r,i,o){var s=n(t);if(s.query)return h(t,r);var u=t.getSelection()||s.lastQuery;if(u instanceof RegExp&&"x^"==u.source&&(u=null),i&&t.openDialog){var c=null,f=function(r,n){e.e_stop(n),r&&(r!=s.queryText&&(d(t,s,r),s.posFrom=s.posTo=t.getCursor()),c&&(c.style.opacity=1),h(t,n.shiftKey,(function(e,r){var n;r.line<3&&document.querySelector&&(n=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&n.getBoundingClientRect().bottom-4>t.cursorCoords(r,"window").top&&((c=n).style.opacity=.4)})))};a(t,g(t),u,f,(function(r,i){var o=e.keyName(r),a=t.getOption("extraKeys"),l=a&&a[o]||e.keyMap[t.getOption("keyMap")][o];"findNext"==l||"findPrev"==l||"findPersistentNext"==l||"findPersistentPrev"==l?(e.e_stop(r),d(t,n(t),i),t.execCommand(l)):"find"!=l&&"findPersistent"!=l||(e.e_stop(r),f(i,r))})),o&&u&&(d(t,s,u),h(t,r))}else l(t,g(t),"Search for:",u,(function(e){e&&!s.query&&t.operation((function(){d(t,s,e),s.posFrom=s.posTo=t.getCursor(),h(t,r)}))}))}function h(t,r,i){t.operation((function(){var a=n(t),l=o(t,a.query,r?a.posFrom:a.posTo);(l.find(r)||(l=o(t,a.query,r?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(r))&&(t.setSelection(l.from(),l.to()),t.scrollIntoView({from:l.from(),to:l.to()},20),a.posFrom=l.from(),a.posTo=l.to(),i&&i(l.from(),l.to()))}))}function p(e){e.operation((function(){var t=n(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))}))}function m(e,t){var r=e?document.createElement(e):document.createDocumentFragment();for(var n in t)r[n]=t[n];for(var i=2;i<arguments.length;i++){var o=arguments[i];r.appendChild("string"==typeof o?document.createTextNode(o):o)}return r}function g(e){var t=m("label",{className:"CodeMirror-search-label"},e.phrase("Search:"),m("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));return t.setAttribute("for","CodeMirror-search-field"),m("",null,t," ",m("span",{style:"color: #666",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}function v(e){return m("",null," ",m("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",m("span",{style:"color: #666",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}function y(e){return m("",null,m("span",{className:"CodeMirror-search-label"},e.phrase("With:"))," ",m("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}function x(e){return m("",null,m("span",{className:"CodeMirror-search-label"},e.phrase("Replace?"))," ",m("button",{},e.phrase("Yes"))," ",m("button",{},e.phrase("No"))," ",m("button",{},e.phrase("All"))," ",m("button",{},e.phrase("Stop")))}function b(e,t,r){e.operation((function(){for(var n=o(e,t);n.findNext();)if("string"!=typeof t){var i=e.getRange(n.from(),n.to()).match(t);n.replace(r.replace(/\$(\d)/g,(function(e,t){return i[t]})))}else n.replace(r)}))}function k(e,t){if(!e.getOption("readOnly")){var r=e.getSelection()||n(e).lastQuery,i=t?e.phrase("Replace all:"):e.phrase("Replace:"),a=m("",null,m("span",{className:"CodeMirror-search-label"},i),v(e));l(e,a,i,r,(function(r){r&&(r=c(r),l(e,y(e),e.phrase("Replace with:"),"",(function(n){if(n=u(n),t)b(e,r,n);else{p(e);var i=o(e,r,e.getCursor("from")),a=function(){var t,u=i.from();!(t=i.findNext())&&(i=o(e,r),!(t=i.findNext())||u&&i.from().line==u.line&&i.from().ch==u.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),s(e,x(e),e.phrase("Replace?"),[function(){l(t)},a,function(){b(e,r,n)}]))},l=function(e){i.replace("string"==typeof r?n:n.replace(/\$(\d)/g,(function(t,r){return e[r]}))),a()};a()}})))}))}}e.defineOption("search",{bottom:!1}),e.commands.find=function(e){p(e),f(e)},e.commands.findPersistent=function(e){p(e),f(e,!1,!0)},e.commands.findPersistentNext=function(e){f(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){f(e,!0,!0,!0)},e.commands.findNext=f,e.commands.findPrev=function(e){f(e,!0)},e.commands.clearSearch=p,e.commands.replace=k,e.commands.replaceAll=function(e){k(e,!0)}}(o.exports);function s(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}l(".CodeMirror-dialog{background:inherit;color:inherit;left:0;overflow:hidden;padding:.1em .8em;position:absolute;right:0;z-index:15}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{background:transparent;border:none;color:inherit;font-family:monospace;outline:none;width:20em}.CodeMirror-dialog button{font-size:70%}");s('.codemirror_Editor{border:1px solid #d3d3d3}.codemirror_Editor .cm-marked-text{background-color:#ff0}.codemirror_Editor .cm-marked-error,.codemirror_Editor .cm-marked-info,.codemirror_Editor .cm-marked-warning{background-position:0 100%;background-repeat:repeat-x;display:inline-block;position:relative}.codemirror_Editor .cm-marked-info{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHElEQVQYV2NkgIP//xkYGBkZIXwIB0SDCQgHAgDEXAgCKU2DPwAAAABJRU5ErkJggg==")}.codemirror_Editor .cm-marked-error{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHUlEQVQYV2NkgIL/DAz/GRkYGBlBfBgHTMM4MJUAzFoIAuwf4BEAAAAASUVORK5CYII=")}.codemirror_Editor .cm-marked-warning{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHUlEQVQYV2NkgIL/Sxn+M0YzMDKC+DAOmIZxYCoBKQkLp8ga+UwAAAAASUVORK5CYII=")}');var u=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t._markedText=[],t._initialText="",t._options=new Map,t}return n(r,e),r.prototype.options=function(){return{gutters:this.guttersOption(),readOnly:this.readOnly(),lineNumbers:!0,tabSize:2}},r.prototype.option=function(e,t){return this._codemirror?arguments.length<2?this._codemirror.getOption(e):(this._codemirror.setOption(e,t),this):arguments.length<2?this._options.get(e):void this._options.set(e,t)},r.prototype.guttersOption=function(){var e=["CodeMirror-linenumbers"];return this.gutterMarkerWidth()>0&&e.unshift({className:"CodeMirror-guttermarker",style:"width:".concat(this.gutterMarkerWidth(),"px;")}),e},r.prototype.addGutterMarker=function(e,r,n,i,o,a,l,s){void 0===n&&(n=null),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=function(){}),void 0===l&&(l=function(){}),void 0===s&&(s=function(e){});var u=this._codemirror.getLineHandle(e),c=document.createElement("div");c.textContent=r,c.style.paddingLeft="3px",c.style.paddingRight="3px",c.style.color=t.Palette.textColor(n),null!==i&&(c.style.fontFamily=i),null!==o&&(c.style.fontSize=o),c.style.backgroundColor=n,c.style.textAlign=this.markerTextAlign(),this._codemirror.setGutterMarker(u,"CodeMirror-guttermarker",c),c.onmouseenter=a,c.onmouseleave=l,c.onclick=s},r.prototype.removeGutterMarker=function(e){var t=this._codemirror.getLineHandle(e);this._codemirror.setGutterMarker(t,"CodeMirror-guttermarker",null)},r.prototype.hasFocus=function(){return this._codemirror.hasFocus()},r.prototype.text=function(e){if(this._codemirror){var t=this._codemirror.getDoc();return arguments.length?(t.setValue(e),this):t.getValue()}return arguments.length?(this._initialText=e,this):this._initialText},r.prototype.highlight=function(e,t,r){return void 0===r&&(r="cm-marked-text"),"number"==typeof e&&(e=this.positionAt(e)),"number"==typeof t&&(t=this.positionAt(t)),this._codemirror&&this._markedText.push(this._codemirror.markText(e,t,{className:r})),this},r.prototype.highlightInfo=function(e,t){return this.highlight(e,t,"cm-marked-info"),this},r.prototype.highlightWarning=function(e,t){return this.highlight(e,t,"cm-marked-warning"),this},r.prototype.highlightError=function(e,t){return this.highlight(e,t,"cm-marked-error"),this},r.prototype.removeAllHighlight=function(){for(var e=0,t=this._markedText;e<t.length;e++){t[e].clear()}return this._markedText=[],this},r.prototype.positionAt=function(e){return this._codemirror.posFromIndex(e)},r.prototype.getLineLength=function(e){var t;return(null===(t=this._codemirror.doc.getLine(e))||void 0===t?void 0:t.length)||0},r.prototype.highlightSubstring=function(e){var t=this,r=this.text().split(e).slice(0,-1),n=0;r.forEach((function(r){n+=r.length,t.highlight(t.positionAt(n),t.positionAt(n+e.length)),n+=e.length}))},r.prototype.setCursor=function(e,t,r){var n=this;void 0===r&&(r=!0),this._codemirror.setCursor(e,t),r&&setTimeout((function(){n._codemirror.focus()}),0)},r.prototype.enter=function(t,r){var n=this;e.prototype.enter.call(this,t,r),this._codemirror=a.fromTextArea(r.append("textarea").node(),this.options()),this._codemirror.on("changes",(function(e,t){n.changes(t)})),this._options.forEach((function(e,t){n._codemirror.setOption(t,e)})),this.text(this._initialText)},r.prototype.update=function(t,r){e.prototype.update.call(this,t,r),this._codemirror.setOption("readOnly",this.readOnly()),this._codemirror.setOption("gutters",this.guttersOption()),this._codemirror.setSize(this.width()-2,this.height()-2),this._codemirror.refresh()},r.prototype.changes=function(e){},r.prototype.setOption=function(e,t){this._codemirror.setOption(e,t)},r}(t.HTMLWidget);u.prototype._class+=" codemirror_Editor",u.prototype.publish("markerTextAlign","right","string","Gutter marker text alignment",["left","center","right"]),u.prototype.publish("readOnly",!1,"boolean","If true, the contents will be uneditable"),u.prototype.publish("gutterMarkerWidth",0,"number","Width of gutter marker column displayed to the left of line numbers (pixels)");var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"text/css",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.css=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);c.prototype._class+=" codemirror_CSSEditor";var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"text/x-dot"})},t.prototype.dot=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);d.prototype._class+=" codemirror_JSEditor";s(".codemirror_ECLEditor .cm-s-default span.cm-comment{color:green}.codemirror_ECLEditor .cm-s-default span.cm-keyword{color:#00f}.codemirror_ECLEditor .cm-s-default span.cm-variable{color:navy;font-weight:700}.codemirror_ECLEditor .cm-s-default span.cm-variable-2,.codemirror_ECLEditor .cm-s-default span.cm-variable-3{color:maroon}.codemirror_ECLEditor .cm-s-default span.cm-builtin{color:purple}.codemirror_ECLEditor .cm-s-default span.cm-string{color:grey}.cm-s-default span.cm-atom,.codemirror_ECLEditor .cm-s-default span.cm-number{color:#000}.codemirror_ECLEditor .cm-s-default span.cm-meta{color:#004080}.codemirror_ECLEditor .ErrorLine{background:#c00!important;color:#fff!important}.codemirror_ECLEditor .WarningLine{background:#ff9!important}.codemirror_ECLEditor .highlightline{background:#e8f2ff!important}");var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"text/x-ecl",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.ecl=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);f.prototype._class+=" codemirror_ECLEditor";var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"htmlmixed",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.html=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);h.prototype._class+=" codemirror_HTMLEditor";var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"text/javascript",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.javascript=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);p.prototype._class+=" codemirror_JSEditor";var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"application/json",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.json=function(e){return arguments.length?(this.text(JSON.stringify(e,null,"\t")),this):JSON.parse(this.text())},t}(u);m.prototype._class+=" codemirror_JSONEditor";var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"text/x-gfm",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.markdown=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);g.prototype._class+=" codemirror_MarkdownEditor";var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:{name:"text/x-gfm",defaultMode:"javascript"}})},t}(g);v.prototype._class+=" codemirror_ObservableMarkdownEditor";var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"application/xml",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.xml=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);y.prototype._class+=" codemirror_XMLEditor",e.BUILD_VERSION="2.104.37",e.CSSEditor=c,e.DOTEditor=d,e.ECLEditor=f,e.Editor=u,e.HTMLEditor=h,e.JSEditor=p,e.JSONEditor=m,e.MarkdownEditor=g,e.ObservableMarkdownEditor=v,e.PKG_NAME="@hpcc-js/codemirror",e.PKG_VERSION="2.61.2",e.XMLEditor=y,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@hpcc-js/codemirror"]={},e["@hpcc-js/common"])}(this,(function(e,t){"use strict";var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var o={exports:{}};!function(e,t){e.exports=function(){var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=n||i||o,l=a&&(n?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\/(\d+)/.exec(e),d=c&&+c[1],f=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),g=h&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),x=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),k=/win/i.test(t),w=f&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,s=!0);var C=x&&(u||f&&(null==w||w<12.11)),S=r||a&&l>=9;function M(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,T=function(e,t){var r=e.className,n=M(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 A(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function D(e,t){return A(e).appendChild(t)}function F(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 E(e,t,r,n){var i=F(e,t,r,n);return i.setAttribute("role","presentation"),i}function O(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 N(e){var t,r=e.ownerDocument||e;try{t=e.activeElement}catch(e){t=r.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function z(e,t){var r=e.className;M(t).test(r)||(e.className+=(r?" ":"")+t)}function P(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!M(r[n]).test(t)&&(t+=" "+r[n]);return t}L=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var B=function(e){e.select()};function I(e){return e.display.wrapper.ownerDocument}function W(e){return H(e.display.wrapper)}function H(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function j(e){return I(e).defaultView}function _(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function R(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function q(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}g?B=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(B=function(e){try{e.select()}catch(e){}});var G=function(){this.id=null,this.f=null,this.time=0,this.handler=_(this.onTimeout,this)};function V(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}G.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},G.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 U=50,K={toString:function(){return"CodeMirror.Pass"}},$={scroll:!1},X={origin:"*mouse"},Y={origin:"+move"};function Q(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var J=[""];function Z(e){for(;J.length<=e;)J.push(ee(J)+" ");return J[e]}function ee(e){return e[e.length-1]}function te(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function re(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function ne(){}function ie(e,t){var r;return Object.create?r=Object.create(e):(ne.prototype=e,r=new ne),t&&R(t,r),r}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ae(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||oe.test(e))}function le(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ae(e))||t.test(e):ae(e)}function se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ue=/[\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 ce(e){return e.charCodeAt(0)>=768&&ue.test(e)}function de(e,t,r){for(;(r<0?t>0:t<e.length)&&ce(e.charAt(t));)t+=r;return t}function fe(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}}function he(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}var pe=null;function me(e,t,r){var n;pe=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:pe=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:pe=i)}return null!=n?n:pe}var ge=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(r){return r<=247?e.charAt(r):1424<=r&&r<=1524?"R":1536<=r&&r<=1785?t.charAt(r-1536):1774<=r&&r<=2220?"r":8192<=r&&r<=8203?"w":8204==r?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(e,t,r){this.level=e,this.from=t,this.to=r}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!n.test(e))return!1;for(var c=e.length,d=[],f=0;f<c;++f)d.push(r(e.charCodeAt(f)));for(var h=0,p=u;h<c;++h){var m=d[h];"m"==m?d[h]=p:p=m}for(var g=0,v=u;g<c;++g){var y=d[g];"1"==y&&"r"==v?d[g]="n":o.test(y)&&(v=y,"r"==y&&(d[g]="R"))}for(var x=1,b=d[0];x<c-1;++x){var k=d[x];"+"==k&&"1"==b&&"1"==d[x+1]?d[x]="1":","!=k||b!=d[x+1]||"1"!=b&&"n"!=b||(d[x]=b),b=k}for(var w=0;w<c;++w){var C=d[w];if(","==C)d[w]="N";else if("%"==C){var S=void 0;for(S=w+1;S<c&&"%"==d[S];++S);for(var M=w&&"!"==d[w-1]||S<c&&"1"==d[S]?"1":"N",L=w;L<S;++L)d[L]=M;w=S-1}}for(var T=0,A=u;T<c;++T){var D=d[T];"L"==A&&"1"==D?d[T]="L":o.test(D)&&(A=D)}for(var F=0;F<c;++F)if(i.test(d[F])){var E=void 0;for(E=F+1;E<c&&i.test(d[E]);++E);for(var O="L"==(F?d[F-1]:u),N=O==("L"==(E<c?d[E]:u))?O?"L":"R":u,z=F;z<E;++z)d[z]=N;F=E-1}for(var P,B=[],I=0;I<c;)if(a.test(d[I])){var W=I;for(++I;I<c&&a.test(d[I]);++I);B.push(new s(0,W,I))}else{var H=I,j=B.length,_="rtl"==t?1:0;for(++I;I<c&&"L"!=d[I];++I);for(var R=H;R<I;)if(l.test(d[R])){H<R&&(B.splice(j,0,new s(1,H,R)),j+=_);var q=R;for(++R;R<I&&l.test(d[R]);++R);B.splice(j,0,new s(2,q,R)),j+=_,H=R}else++R;H<I&&B.splice(j,0,new s(1,H,I))}return"ltr"==t&&(1==B[0].level&&(P=e.match(/^\s+/))&&(B[0].from=P[0].length,B.unshift(new s(0,0,P[0].length))),1==ee(B).level&&(P=e.match(/\s+$/))&&(ee(B).to-=P[0].length,B.push(new s(0,c-P[0].length,c)))),"rtl"==t?B.reverse():B}}();function ve(e,t){var r=e.order;return null==r&&(r=e.order=ge(e.text,t)),r}var ye=[],xe=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]||ye).concat(r)}};function be(e,t){return e._handlers&&e._handlers[t]||ye}function ke(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=V(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function we(e,t){var r=be(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 Ce(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),we(e,r||t.type,e,t),De(t)||t.codemirrorIgnore}function Se(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==V(r,t[n])&&r.push(t[n])}function Me(e,t){return be(e,t).length>0}function Le(e){e.prototype.on=function(e,t){xe(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}function Te(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Fe(e){Te(e),Ae(e)}function Ee(e){return e.target||e.srcElement}function Oe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),x&&e.ctrlKey&&1==t&&(t=3),t}var Ne,ze,Pe=function(){if(a&&l<9)return!1;var e=F("div");return"draggable"in e||"dragDrop"in e}();function Be(e){if(null==Ne){var t=F("span","​");D(e,F("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ne=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&l<8))}var r=Ne?F("span","​"):F("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Ie(e){if(null!=ze)return ze;var t=D(e,document.createTextNode("AخA")),r=L(t,0,1).getBoundingClientRect(),n=L(t,1,2).getBoundingClientRect();return A(e),!(!r||r.left==r.right)&&(ze=n.right-r.right<3)}var We,He=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),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},je=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)},_e="oncopy"in(We=F("div"))||(We.setAttribute("oncopy","return;"),"function"==typeof We.oncopy),Re=null;function qe(e){if(null!=Re)return Re;var t=D(e,F("span","x")),r=t.getBoundingClientRect(),n=L(t,0,1).getBoundingClientRect();return Re=Math.abs(r.left-n.left)>1}var Ge={},Ve={};function Ue(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ge[e]=t}function Ke(e,t){Ve[e]=t}function $e(e){if("string"==typeof e&&Ve.hasOwnProperty(e))e=Ve[e];else if(e&&"string"==typeof e.name&&Ve.hasOwnProperty(e.name)){var t=Ve[e.name];"string"==typeof t&&(t={name:t}),(e=ie(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return $e("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return $e("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Xe(e,t){t=$e(t);var r=Ge[t.name];if(!r)return Xe(e,"text/plain");var n=r(e,t);if(Ye.hasOwnProperty(t.name)){var i=Ye[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 a in t.modeProps)n[a]=t.modeProps[a];return n}var Ye={};function Qe(e,t){R(t,Ye.hasOwnProperty(e)?Ye[e]:Ye[e]={})}function Je(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 Ze(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 et(e,t,r){return!e.startState||e.startState(t,r)}var tt=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 rt(e,t){if((t-=e.first)<0||t>=e.size)throw new 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 nt(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,(function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i})),n}function it(e,t,r){var n=[];return e.iter(t,r,(function(e){n.push(e.text)})),n}function ot(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function at(e){if(null==e.parent)return null;for(var t=e.parent,r=V(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 lt(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 a=0;a<e.lines.length;++a){var l=e.lines[a].height;if(t<l)break;t-=l}return r+a}function st(e,t){return t>=e.first&&t<e.first+e.size}function ut(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ct(e,t,r){if(void 0===r&&(r=null),!(this instanceof ct))return new ct(e,t,r);this.line=e,this.ch=t,this.sticky=r}function dt(e,t){return e.line-t.line||e.ch-t.ch}function ft(e,t){return e.sticky==t.sticky&&0==dt(e,t)}function ht(e){return ct(e.line,e.ch)}function pt(e,t){return dt(e,t)<0?t:e}function mt(e,t){return dt(e,t)<0?e:t}function gt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function vt(e,t){if(t.line<e.first)return ct(e.first,0);var r=e.first+e.size-1;return t.line>r?ct(r,rt(e,r).text.length):yt(t,rt(e,t.line).text.length)}function yt(e,t){var r=e.ch;return null==r||r>t?ct(e.line,t):r<0?ct(e.line,0):e}function xt(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=vt(e,t[n]);return r}tt.prototype.eol=function(){return this.pos>=this.string.length},tt.prototype.sol=function(){return this.pos==this.lineStart},tt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},tt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},tt.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},tt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},tt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},tt.prototype.skipToEnd=function(){this.pos=this.string.length},tt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},tt.prototype.backUp=function(e){this.pos-=e},tt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=q(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},tt.prototype.indentation=function(){return q(this.string,null,this.tabSize)-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},tt.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},tt.prototype.current=function(){return this.string.slice(this.start,this.pos)},tt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},tt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},tt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var bt=function(e,t){this.state=e,this.lookAhead=t},kt=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 wt(e,t,r,n){var i=[e.state.modeGen],o={};Et(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),o,n);for(var a=r.state,l=function(n){r.baseTokens=i;var l=e.state.overlays[n],s=1,u=0;r.state=!0,Et(e,t.text,l.mode,r,(function(e,t){for(var r=s;u<e;){var n=i[s];n>e&&i.splice(s,1,e,i[s+1],n),s+=2,u=Math.min(e,n)}if(t)if(l.opaque)i.splice(r,s-r,e,"overlay "+t),s=r+2;else for(;r<s;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}}),o),r.state=a,r.baseTokens=null,r.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ct(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=St(e,at(t)),i=t.text.length>e.options.maxHighlightLength&&Je(e.doc.mode,n.state),o=wt(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 St(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new kt(n,!0,t);var o=Ot(e,t,r),a=o>n.first&&rt(n,o-1).stateAfter,l=a?kt.fromSaved(n,a,o):new kt(n,et(n.mode),o);return n.iter(o,t,(function(r){Mt(e,r.text,l);var n=l.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?l.save():null,l.nextLine()})),r&&(n.modeFrontier=l.line),l}function Mt(e,t,r,n){var i=e.doc.mode,o=new tt(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&Lt(i,r.state);!o.eol();)Tt(i,o,r.state),o.start=o.pos}function Lt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ze(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Tt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ze(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}kt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},kt.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}},kt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},kt.fromSaved=function(e,t,r){return t instanceof bt?new kt(e,Je(e.mode,t.state),r,t.lookAhead):new kt(e,Je(e.mode,t),r)},kt.prototype.save=function(e){var t=!1!==e?Je(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new bt(t,this.maxLookAhead):t};var At=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Dt(e,t,r,n){var i,o,a=e.doc,l=a.mode,s=rt(a,(t=vt(a,t)).line),u=St(e,t.line,r),c=new tt(s.text,e.options.tabSize,u);for(n&&(o=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=Tt(l,c,u.state),n&&o.push(new At(c,i,Je(a.mode,u.state)));return n?o:new At(c,i,u.state)}function Ft(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]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Et(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,u=0,c=null,d=new tt(t,e.options.tabSize,n),f=e.options.addModeClass&&[null];for(""==t&&Ft(Lt(r,n.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&Mt(e,t,n,d.pos),d.pos=t.length,s=null):s=Ft(Tt(r,d,n.state,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||c!=s){for(;u<d.start;)i(u=Math.min(d.start,u+5e3),c);c=s}d.start=d.pos}for(;u<d.pos;){var p=Math.min(d.pos,u+5e3);i(p,c),u=p}}function Ot(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=rt(o,l-1),u=s.stateAfter;if(u&&(!r||l+(u instanceof bt?u.lookAhead:0)<=o.modeFrontier))return l;var c=q(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}function Nt(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=rt(e,n).stateAfter;if(i&&(!(i instanceof bt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}var zt=!1,Pt=!1;function Bt(){zt=!0}function It(){Pt=!0}function Wt(e,t,r){this.marker=e,this.from=t,this.to=r}function Ht(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function jt(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function _t(e,t,r){var n=r&&window.WeakSet&&(r.markedSpans||(r.markedSpans=new WeakSet));n&&e.markedSpans&&n.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],n&&n.add(e.markedSpans)),t.marker.attachLine(e)}function Rt(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Wt(a,o.from,l?null:o.to))}}return n}function qt(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Wt(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return n}function Gt(e,t){if(t.full)return null;var r=st(e,t.from.line)&&rt(e,t.from.line).markedSpans,n=st(e,t.to.line)&&rt(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==dt(t.from,t.to),l=Rt(r,i,a),s=qt(n,o,a),u=1==t.text.length,c=ee(t.text).length+(u?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var h=Ht(s,f.marker);h?u&&(f.to=null==h.to?null:h.to+c):f.to=i}}if(s)for(var p=0;p<s.length;++p){var m=s[p];null!=m.to&&(m.to+=c),null==m.from?Ht(l,m.marker)||(m.from=c,u&&(l||(l=[])).push(m)):(m.from+=c,u&&(l||(l=[])).push(m))}l&&(l=Vt(l)),s&&s!=l&&(s=Vt(s));var g=[l];if(!u){var v,y=t.text.length-2;if(y>0&&l)for(var x=0;x<l.length;++x)null==l[x].to&&(v||(v=[])).push(new Wt(l[x].marker,null,null));for(var b=0;b<y;++b)g.push(v);g.push(s)}return g}function Vt(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 Ut(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!=V(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var u=i[s];if(!(dt(u.to,l.from)<0||dt(u.from,l.to)>0)){var c=[s,1],d=dt(u.from,l.from),f=dt(u.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:l.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:l.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}function Kt(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function $t(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Xt(e){return e.inclusiveLeft?-1:0}function Yt(e){return e.inclusiveRight?1:0}function Qt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=dt(n.from,i.from)||Xt(e)-Xt(t);if(o)return-o;var a=dt(n.to,i.to)||Yt(e)-Yt(t);return a||t.id-e.id}function Jt(e,t){var r,n=Pt&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Qt(r,i.marker)<0)&&(r=i.marker);return r}function Zt(e){return Jt(e,!0)}function er(e){return Jt(e,!1)}function tr(e,t){var r,n=Pt&&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||Qt(r,o.marker)<0)&&(r=o.marker)}return r}function rr(e,t,r,n,i){var o=rt(e,t),a=Pt&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var u=s.marker.find(0),c=dt(u.from,r)||Xt(s.marker)-Xt(i),d=dt(u.to,n)||Yt(s.marker)-Yt(i);if(!(c>=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?dt(u.to,r)>=0:dt(u.to,r)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?dt(u.from,n)<=0:dt(u.from,n)<0)))return!0}}}function nr(e){for(var t;t=Zt(e);)e=t.find(-1,!0).line;return e}function ir(e){for(var t;t=er(e);)e=t.find(1,!0).line;return e}function or(e){for(var t,r;t=er(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function ar(e,t){var r=rt(e,t),n=nr(r);return r==n?t:at(n)}function lr(e,t){if(t>e.lastLine())return t;var r,n=rt(e,t);if(!sr(e,n))return t;for(;r=er(n);)n=r.find(1,!0).line;return at(n)+1}function sr(e,t){var r=Pt&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&ur(e,t,n))return!0}}function ur(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return ur(e,n.line,Ht(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&ur(e,t,i))return!0}function cr(e){for(var t=0,r=(e=nr(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 a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function dr(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Zt(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=er(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function fr(e){var t=e.display,r=e.doc;t.maxLine=rt(r,r.first),t.maxLineLength=dr(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=dr(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var hr=function(e,t,r){this.text=e,$t(this,t),this.height=r?r(this):1};function pr(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Kt(e),$t(e,r);var i=n?n(e):1;i!=e.height&&ot(e,i)}function mr(e){e.parent=null,Kt(e)}hr.prototype.lineNo=function(){return at(this)},Le(hr);var gr={},vr={};function yr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?vr:gr;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function xr(e,t){var r=E("span",null,null,s?"padding-right: .1px":null),n={pre:E("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=kr,Ie(e.display.measure)&&(a=ve(o,e.doc.direction))&&(n.addToken=Cr(n.addToken,a)),n.map=[],Mr(o,n,Ct(e,o,t!=e.display.externalMeasured&&at(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=P(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=P(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Be(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var l=n.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return we(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=P(n.pre.className,n.textClass||"")),n}function br(e){var t=F("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function kr(e,t,r,n,i,o,s){if(t){var u,c=e.splitSpaces?wr(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){u=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var p=d.exec(t),m=p?p.index-h:t.length-h;if(m){var g=document.createTextNode(c.slice(h,h+m));a&&l<9?u.appendChild(F("span",[g])):u.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;h+=m+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,x=y-e.col%y;(v=u.appendChild(F("span",Z(x),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=x}else"\r"==p[0]||"\n"==p[0]?((v=u.appendChild(F("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&l<9?u.appendChild(F("span",[v])):u.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),a&&l<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||n||i||f||o||s){var b=r||"";n&&(b+=n),i&&(b+=i);var k=F("span",[u],b,o);if(s)for(var w in s)s.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&k.setAttribute(w,s[w]);return e.content.appendChild(k)}e.content.appendChild(u)}}function wr(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=" "),n+=o,r=" "==o}return n}function Cr(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var d=void 0,f=0;f<t.length&&!((d=t[f]).to>u&&d.from<=u);f++);if(d.to>=c)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-u),i,o,null,l,s),o=null,n=n.slice(d.to-u),u=d.to}}}function Sr(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 Mr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,u,c,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=u=c=l="",f=null,d=null,v=1/0;for(var y=[],x=void 0,b=0;b<n.length;++b){var k=n[b],w=k.marker;if("bookmark"==w.type&&k.from==p&&w.widgetNode)y.push(w);else if(k.from<=p&&(null==k.to||k.to>p||w.collapsed&&k.to==p&&k.from==p)){if(null!=k.to&&k.to!=p&&v>k.to&&(v=k.to,u=""),w.className&&(s+=" "+w.className),w.css&&(l=(l?l+";":"")+w.css),w.startStyle&&k.from==p&&(c+=" "+w.startStyle),w.endStyle&&k.to==v&&(x||(x=[])).push(w.endStyle,k.to),w.title&&((f||(f={})).title=w.title),w.attributes)for(var C in w.attributes)(f||(f={}))[C]=w.attributes[C];w.collapsed&&(!d||Qt(d.marker,w)<0)&&(d=k)}else k.from>p&&v>k.from&&(v=k.from)}if(x)for(var S=0;S<x.length;S+=2)x[S+1]==v&&(u+=" "+x[S]);if(!d||d.from==p)for(var M=0;M<y.length;++M)Sr(t,0,y[M]);if(d&&(d.from||0)==p){if(Sr(t,(null==d.to?h+1:d.to)-p,d.marker,null==d.from),null==d.to)return;d.to==p&&(d=!1)}}if(p>=h)break;for(var L=Math.min(h,v);;){if(g){var T=p+g.length;if(!d){var A=T>L?g.slice(0,L-p):g;t.addToken(t,A,a?a+s:s,c,p+A.length==v?u:"",l,f)}if(T>=L){g=g.slice(L-p),p=L;break}p=T,c=""}g=i.slice(o,o=r[m++]),a=yr(r[m++],t.cm.options)}}else for(var D=1;D<r.length;D+=2)t.addToken(t,i.slice(o,o=r[D]),yr(r[D+1],t.cm.options))}function Lr(e,t,r){this.line=t,this.rest=or(t),this.size=this.rest?at(ee(this.rest))-r+1:1,this.node=this.text=null,this.hidden=sr(e,t)}function Tr(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new Lr(e.doc,rt(e.doc,o),o);n=o+a.size,i.push(a)}return i}var Ar=null;function Dr(e){Ar?Ar.ops.push(e):e.ownsGroup=Ar={ops:[e],delayedCallbacks:[]}}function Fr(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)}function Er(e,t){var r=e.ownsGroup;if(r)try{Fr(r)}finally{Ar=null,t(r)}}var Or=null;function Nr(e,t){var r=be(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);Ar?n=Ar.delayedCallbacks:Or?n=Or:(n=Or=[],setTimeout(zr,0));for(var o=function(e){n.push((function(){return r[e].apply(null,i)}))},a=0;a<r.length;++a)o(a)}}function zr(){var e=Or;Or=null;for(var t=0;t<e.length;++t)e[t]()}function Pr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Hr(e,t):"gutter"==o?_r(e,t,r,n):"class"==o?jr(e,t):"widget"==o&&Rr(e,t,n)}t.changes=null}function Br(e){return e.node==e.text&&(e.node=F("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&l<8&&(e.node.style.zIndex=2)),e.node}function Ir(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=Br(t);t.background=n.insertBefore(F("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function Wr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):xr(e,t)}function Hr(e,t){var r=t.text.className,n=Wr(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,jr(e,t)):r&&(t.text.className=r)}function jr(e,t){Ir(e,t),t.line.wrapClass?Br(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 _r(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=Br(t);t.gutterBackground=F("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 a=Br(t),l=t.gutter=F("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(l.setAttribute("aria-hidden","true"),e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(F("div",ut(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,c=o.hasOwnProperty(u)&&o[u];c&&l.appendChild(F("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function Rr(e,t,r){t.alignable&&(t.alignable=null);for(var n=M("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);Gr(e,t,r)}function qr(e,t,r,n){var i=Wr(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),jr(e,t),_r(e,t,r,n),Gr(e,t,n),t.node}function Gr(e,t,r){if(Vr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Vr(e,t.rest[n],t,r,!1)}function Vr(e,t,r,n,i){if(t.widgets)for(var o=Br(r),a=0,l=t.widgets;a<l.length;++a){var s=l[a],u=F("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Ur(s,u,r,n),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),Nr(s,"redraw")}}function Ur(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Kr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!O(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;"),D(t.display.measure,F("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function $r(e,t){for(var r=Ee(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 Xr(e){return e.lineSpace.offsetTop}function Yr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Qr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=D(e.measure,F("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 Jr(e){return U-e.display.nativeBarWidth}function Zr(e){return e.display.scroller.clientWidth-Jr(e)-e.display.barWidth}function en(e){return e.display.scroller.clientHeight-Jr(e)-e.display.barHeight}function tn(e,t,r){var n=e.options.lineWrapping,i=n&&Zr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],u=a[l+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function rn(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(at(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function nn(e,t){var r=at(t=nr(t)),n=e.display.externalMeasured=new Lr(e.doc,t,r);n.lineN=r;var i=n.built=xr(e,n);return n.text=i.pre,D(e.display.lineMeasure,i.pre),n}function on(e,t,r,n){return sn(e,ln(e,t),r,n)}function an(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[_n(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function ln(e,t){var r=at(t),n=an(e,r);n&&!n.text?n=null:n&&n.changes&&(Pr(e,n,r,Bn(e)),e.curOp.forceUpdate=!0),n||(n=nn(e,t));var i=rn(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function sn(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(tn(e,t.view,t.rect),t.hasHeights=!0),(o=hn(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var un,cn={left:0,right:0,top:0,bottom:0};function dn(e,t,r){for(var n,i,o,a,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,o=1,a="left"):t<s?o=1+(i=t-l):(u==e.length-3||t==s&&e[u+3]>t)&&(i=(o=s-l)-1,t>=s&&(a="right")),null!=i){if(n=e[u+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],a="left";if("right"==r&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function fn(e,t){var r=cn;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function hn(e,t,r,n){var i,o=dn(t.map,r,n),s=o.node,u=o.start,c=o.end,d=o.collapse;if(3==s.nodeType){for(var f=0;f<4;f++){for(;u&&ce(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&ce(t.line.text.charAt(o.coverStart+c));)++c;if((i=a&&l<9&&0==u&&c==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():fn(L(s,u,c).getClientRects(),n)).left||i.right||0==u)break;c=u,u-=1,d="right"}a&&l<11&&(i=pn(e.display.measure,i))}else{var h;u>0&&(d=n="right"),i=e.options.lineWrapping&&(h=s.getClientRects()).length>1?h["right"==n?h.length-1:0]:s.getBoundingClientRect()}if(a&&l<9&&!u&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Pn(e.display),top:p.top,bottom:p.bottom}:cn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,x=0;x<y.length-1&&!(v<y[x]);x++);var b=x?y[x-1]:0,k=y[x],w={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:b,bottom:k};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=m,w.rbottom=g),w}function pn(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!qe(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function mn(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 gn(e){e.display.externalMeasure=null,A(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)mn(e.display.view[t])}function vn(e){gn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function yn(e){return c&&v?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function xn(e){return c&&v?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function bn(e){var t=nr(e).widgets,r=0;if(t)for(var n=0;n<t.length;++n)t[n].above&&(r+=Kr(t[n]));return r}function kn(e,t,r,n,i){if(!i){var o=bn(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=cr(t);if("local"==n?a+=Xr(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==n?0:xn(I(e)));var s=l.left+("window"==n?0:yn(I(e)));r.left+=s,r.right+=s}return r.top+=a,r.bottom+=a,r}function wn(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=yn(I(e)),i-=xn(I(e));else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function Cn(e,t,r,n,i){return n||(n=rt(e.doc,t.line)),kn(e,n,on(e,n,t.ch,i),r)}function Sn(e,t,r,n,i,o){function a(t,a){var l=sn(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,kn(e,n,l,r)}n=n||rt(e.doc,t.line),i||(i=ln(e,n));var l=ve(n,e.doc.direction),s=t.ch,u=t.sticky;if(s>=n.text.length?(s=n.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a("before"==u?s-1:s,"before"==u);function c(e,t,r){return a(r?e-1:e,1==l[t].level!=r)}var d=me(l,s,u),f=pe,h=c(s,d,"before"==u);return null!=f&&(h.other=c(s,f,"before"!=u)),h}function Mn(e,t){var r=0;t=vt(e.doc,t),e.options.lineWrapping||(r=Pn(e.display)*t.ch);var n=rt(e.doc,t.line),i=cr(n)+Xr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Ln(e,t,r,n,i){var o=ct(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function Tn(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Ln(n.first,0,null,-1,-1);var i=lt(n,r),o=n.first+n.size-1;if(i>o)return Ln(n.first+n.size-1,rt(n,o).text.length,null,1,1);t<0&&(t=0);for(var a=rt(n,i);;){var l=En(e,a,i,t,r),s=tr(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=rt(n,i=u.line)}}function An(e,t,r,n){n-=bn(t);var i=t.text.length,o=fe((function(t){return sn(e,r,t-1).bottom<=n}),i,0);return{begin:o,end:i=fe((function(t){return sn(e,r,t).top>n}),o,i)}}function Dn(e,t,r,n){return r||(r=ln(e,t)),An(e,t,r,kn(e,t,sn(e,r,n),"line").top)}function Fn(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function En(e,t,r,n,i){i-=cr(t);var o=ln(e,t),a=bn(t),l=0,s=t.text.length,u=!0,c=ve(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?Nn:On)(e,t,r,o,c,n,i);l=(u=1!=d.level)?d.from:d.to-1,s=u?d.to:d.from-1}var f,h,p=null,m=null,g=fe((function(t){var r=sn(e,o,t);return r.top+=a,r.bottom+=a,!!Fn(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,m=r),!0)}),l,s),v=!1;if(m){var y=n-m.left<m.right-n,x=y==u;g=p+(x?0:1),h=x?"after":"before",f=y?m.left:m.right}else{u||g!=s&&g!=l||g++,h=0==g?"after":g==t.text.length?"before":sn(e,o,g-(u?1:0)).bottom+a<=i==u?"after":"before";var b=Sn(e,ct(r,g,h),"line",t,o);f=b.left,v=i<b.top?-1:i>=b.bottom?1:0}return Ln(r,g=de(t.text,g,1),h,v,n-f)}function On(e,t,r,n,i,o,a){var l=fe((function(l){var s=i[l],u=1!=s.level;return Fn(Sn(e,ct(r,u?s.to:s.from,u?"before":"after"),"line",t,n),o,a,!0)}),0,i.length-1),s=i[l];if(l>0){var u=1!=s.level,c=Sn(e,ct(r,u?s.from:s.to,u?"after":"before"),"line",t,n);Fn(c,o,a,!0)&&c.top>a&&(s=i[l-1])}return s}function Nn(e,t,r,n,i,o,a){var l=An(e,t,n,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,f=0;f<i.length;f++){var h=i[f];if(!(h.from>=u||h.to<=s)){var p=sn(e,n,1!=h.level?Math.min(u,h.to)-1:Math.max(s,h.from)).right,m=p<o?o-p+1e9:p-o;(!c||d>m)&&(c=h,d=m)}}return c||(c=i[i.length-1]),c.from<s&&(c={from:s,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function zn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==un){un=F("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)un.appendChild(document.createTextNode("x")),un.appendChild(F("br"));un.appendChild(document.createTextNode("x"))}D(e.measure,un);var r=un.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),A(e.measure),r||1}function Pn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=F("span","xxxxxxxxxx"),r=F("pre",[t],"CodeMirror-line-like");D(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Bn(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;r[l]=o.offsetLeft+o.clientLeft+i,n[l]=o.clientWidth}return{fixedPos:In(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function In(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Wn(e){var t=zn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Pn(e.display)-3);return function(i){if(sr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function Hn(e){var t=e.doc,r=Wn(e);t.iter((function(e){var t=r(e);t!=e.height&&ot(e,t)}))}function jn(e,t,r,n){var i=e.display;if(!r&&"true"==Ee(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(e){return null}var s,u=Tn(e,o,a);if(n&&u.xRel>0&&(s=rt(e.doc,u.line).text).length==u.ch){var c=q(s,s.length,e.options.tabSize)-s.length;u=ct(u.line,Math.max(0,Math.round((o-Qr(e.display).left)/Pn(e.display))-c))}return u}function _n(e,t){if(t>=e.display.viewTo)return null;if((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)Pt&&ar(e.doc,t)<i.viewTo&&Gn(e);else if(r<=i.viewFrom)Pt&&lr(e.doc,r+n)>i.viewFrom?Gn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Gn(e);else if(t<=i.viewFrom){var o=Vn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Gn(e)}else if(r>=i.viewTo){var a=Vn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Gn(e)}else{var l=Vn(e,t,t,-1),s=Vn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Tr(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):Gn(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function qn(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[_n(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==V(a,r)&&a.push(r)}}}function Gn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Vn(e,t,r,n){var i,o=_n(e,t),a=e.display.view;if(!Pt||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(n>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;ar(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function Un(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=Tr(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Tr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(_n(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Tr(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,_n(e,r)))),n.viewTo=r}function Kn(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 $n(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Xn(e,t){void 0===t&&(t=!0);var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var l=0;l<r.sel.ranges.length;l++)if(t||l!=r.sel.primIndex){var s=r.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(a){var c=a(e,s);c&&Yn(e,c,i)}else(u||e.options.showCursorWhenSelecting)&&Yn(e,s.head,i);u||Jn(e,s,o)}}return n}function Yn(e,t,r){var n=Sn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(F("div"," ","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=Cn(e,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(n.other){var l=r.appendChild(F("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=n.other.left+"px",l.style.top=n.other.top+"px",l.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Qn(e,t){return e.top-t.top||e.left-t.left}function Jn(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),a=Qr(e.display),l=a.left,s=Math.max(n.sizerWidth,Zr(e)-n.sizer.offsetLeft)-a.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(F("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?s-e:r)+"px;\n height: "+(n-t)+"px"))}function d(t,r,n){var o,a,d=rt(i,t),f=d.text.length;function h(r,n){return Cn(e,ct(t,r),"div",d,n)}function p(t,r,n){var i=Dn(e,d,null,t),o="ltr"==r==("after"==n)?"left":"right";return h("after"==n?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),o)[o]}var m=ve(d,i.direction);return he(m,r||0,null==n?f:n,(function(e,t,i,d){var g="ltr"==i,v=h(e,g?"left":"right"),y=h(t-1,g?"right":"left"),x=null==r&&0==e,b=null==n&&t==f,k=0==d,w=!m||d==m.length-1;if(y.top-v.top<=3){var C=(u?b:x)&&w,S=(u?x:b)&&k?l:(g?v:y).left,M=C?s:(g?y:v).right;c(S,v.top,M-S,v.bottom)}else{var L,T,A,D;g?(L=u&&x&&k?l:v.left,T=u?s:p(e,i,"before"),A=u?l:p(t,i,"after"),D=u&&b&&w?s:y.right):(L=u?p(e,i,"before"):l,T=!u&&x&&k?s:v.right,A=!u&&b&&w?l:y.left,D=u?p(t,i,"after"):s),c(L,v.top,T-L,v.bottom),v.bottom<y.top&&c(l,v.bottom,null,y.top),c(A,y.top,D-A,y.bottom)}(!o||Qn(v,o)<0)&&(o=v),Qn(y,o)<0&&(o=y),(!a||Qn(v,a)<0)&&(a=v),Qn(y,a)<0&&(a=y)})),{start:o,end:a}}var f=t.from(),h=t.to();if(f.line==h.line)d(f.line,f.ch,h.ch);else{var p=rt(i,f.line),m=rt(i,h.line),g=nr(p)==nr(m),v=d(f.line,f.ch,g?p.text.length+1:null).end,y=d(h.line,g?0:null,h.ch).start;g&&(v.top<y.top-2?(c(v.right,v.top,null,v.bottom),c(l,y.top,y.left,y.bottom)):c(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&c(l,v.bottom,null,y.top)}r.appendChild(o)}function Zn(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()||ni(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ei(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ri(e))}function ti(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&ni(e))}),100)}function ri(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(we(e,"focus",e,t),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Zn(e))}function ni(e,t){e.state.delayingBlurEvent||(e.state.focused&&(we(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function ii(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,s=0;s<t.view.length;s++){var u=t.view[s],c=e.options.lineWrapping,d=void 0,f=0;if(!u.hidden){if(i+=u.line.height,a&&l<8){var h=u.node.offsetTop+u.node.offsetHeight;d=h-r,r=h}else{var p=u.node.getBoundingClientRect();d=p.bottom-p.top,!c&&u.text.firstChild&&(f=u.text.firstChild.getBoundingClientRect().right-p.left-1)}var m=u.line.height-d;if((m>.005||m<-.005)&&(i<n&&(o-=m),ot(u.line,d),oi(u.line),u.rest))for(var g=0;g<u.rest.length;g++)oi(u.rest[g]);if(f>e.display.sizerWidth){var v=Math.ceil(f/Pn(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function oi(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 ai(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Xr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=lt(t,n),a=lt(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?(o=l,a=lt(t,cr(rt(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=lt(t,cr(rt(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function li(e,t){if(!Ce(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null,o=r.wrapper.ownerDocument;if(t.top+n.top<0?i=!0:t.bottom+n.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var a=F("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Xr(e.display))+"px;\n height: "+(t.bottom-t.top+Jr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function si(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==t.sticky?ct(t.line,t.ch+1,"before"):t,t=t.ch?ct(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=Sn(e,t),s=r&&r!=t?Sn(e,r):l,u=ci(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(vi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(xi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ui(e,t){var r=ci(e,t);null!=r.scrollTop&&vi(e,r.scrollTop),null!=r.scrollLeft&&xi(e,r.scrollLeft)}function ci(e,t){var r=e.display,n=zn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=en(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Yr(r),s=t.top<n,u=t.bottom>l-n;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?l:t.bottom)-o);c!=i&&(a.scrollTop=c)}var d=e.options.fixedGutter?0:r.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft-d,h=Zr(e)-r.gutters.offsetWidth,p=t.right-t.left>h;return p&&(t.right=t.left+h),t.left<10?a.scrollLeft=0:t.left<f?a.scrollLeft=Math.max(0,t.left+d-(p?0:10)):t.right>h+f-3&&(a.scrollLeft=t.right+(p?0:10)-h),a}function di(e,t){null!=t&&(mi(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function fi(e){mi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function hi(e,t,r){null==t&&null==r||mi(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function pi(e,t){mi(e),e.curOp.scrollToPos=t}function mi(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,gi(e,Mn(e,t.from),Mn(e,t.to),t.margin))}function gi(e,t,r,n){var i=ci(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});hi(e,i.scrollLeft,i.scrollTop)}function vi(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||$i(e,{top:t}),yi(e,t,!0),r&&$i(e),ji(e,100))}function yi(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 xi(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,Ji(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function bi(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Yr(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+Jr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var ki=function(e,t,r){this.cm=r;var n=this.vert=F("div",[F("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=F("div",[F("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),xe(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),xe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ki.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);this.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}},ki.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ki.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ki.prototype.zeroWidthHack=function(){var e=x&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new G,this.disableVert=new G},ki.prototype.enableZeroWidthBar=function(e,t,r){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.visibility="hidden":t.set(1e3,n)}e.style.visibility="",t.set(1e3,n)},ki.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wi=function(){};function Ci(e,t){t||(t=bi(e));var r=e.display.barWidth,n=e.display.barHeight;Si(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&ii(e),Si(e,bi(e)),r=e.display.barWidth,n=e.display.barHeight}function Si(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=""}wi.prototype.update=function(){return{bottom:0,right:0}},wi.prototype.setScrollLeft=function(){},wi.prototype.setScrollTop=function(){},wi.prototype.clear=function(){};var Mi={native:ki,null:wi};function Li(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Mi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),xe(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?xi(e,t):vi(e,t)}),e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var Ti=0;function Ai(e){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:++Ti,markArrays:null},Dr(e.curOp)}function Di(e){var t=e.curOp;t&&Er(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Fi(e)}))}function Fi(e){for(var t=e.ops,r=0;r<t.length;r++)Ei(t[r]);for(var n=0;n<t.length;n++)Oi(t[n]);for(var i=0;i<t.length;i++)Ni(t[i]);for(var o=0;o<t.length;o++)zi(t[o]);for(var a=0;a<t.length;a++)Pi(t[a])}function Ei(e){var t=e.cm,r=t.display;qi(t),e.updateMaxLine&&fr(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 Ri(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Oi(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function Ni(e){var t=e.cm,r=t.display;e.updatedDisplay&&ii(t),e.barMeasure=bi(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=on(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Jr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Zr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function zi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&xi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==N(W(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ci(t,e.barMeasure),e.updatedDisplay&&Qi(t,e.barMeasure),e.selectionChanged&&Zn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&ei(e.cm)}function Pi(e){var t=e.cm,r=t.display,n=t.doc;e.updatedDisplay&&Ki(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&yi(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&xi(t,e.scrollLeft,!0,!0),e.scrollToPos&&li(t,si(t,vt(n,e.scrollToPos.from),vt(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||we(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&we(o[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&we(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Bi(e,t){if(e.curOp)return t();Ai(e);try{return t()}finally{Di(e)}}function Ii(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ai(e);try{return t.apply(e,arguments)}finally{Di(e)}}}function Wi(e){return function(){if(this.curOp)return e.apply(this,arguments);Ai(this);try{return e.apply(this,arguments)}finally{Di(this)}}}function Hi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ai(t);try{return e.apply(this,arguments)}finally{Di(t)}}}function ji(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,_(_i,e))}function _i(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=St(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(n.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Je(t.mode,n.state):null,s=wt(e,o,n,!0);l&&(n.state=l),o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&Mt(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return ji(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Bi(e,(function(){for(var t=0;t<i.length;t++)qn(e,i[t],"text")}))}}var Ri=function(e,t,r){var n=e.display;this.viewport=t,this.visible=ai(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Zr(e),this.force=r,this.dims=Bn(e),this.events=[]};function qi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Jr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Jr(e)+"px",t.scrollbarsClipped=!0)}function Gi(e){if(e.hasFocus())return null;var t=N(W(e));if(!t||!O(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=j(e).getSelection();n.anchorNode&&n.extend&&O(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function Vi(e){if(e&&e.activeElt&&e.activeElt!=N(H(e.activeElt))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,r=t.defaultView.getSelection(),n=t.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),r.removeAllRanges(),r.addRange(n),r.extend(e.focusNode,e.focusOffset)}}function Ui(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Gn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Kn(e))return!1;Zi(e)&&(Gn(e),t.dims=Bn(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),Pt&&(o=ar(e.doc,o),a=lr(e.doc,a));var l=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Un(e,o,a),r.viewOffset=cr(rt(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var s=Kn(e);if(!l&&0==s&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Gi(e);return s>4&&(r.lineDiv.style.display="none"),Xi(e,r.updateLineNumbers,t.dims),s>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,Vi(u),A(r.cursorDiv),A(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ji(e,400)),r.updateLineNumbers=null,!0}function Ki(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Zr(e))n&&(t.visible=ai(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Yr(e.display)-en(e),r.top)}),t.visible=ai(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Ui(e,t))break;ii(e);var i=bi(e);$n(e),Ci(e,i),Qi(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 $i(e,t){var r=new Ri(e,t);if(Ui(e,r)){ii(e),Ki(e,r);var n=bi(e);$n(e),Ci(e,n),Qi(e,n),r.finish()}}function Xi(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function l(t){var r=t.nextSibling;return s&&x&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,d=0;d<u.length;d++){var f=u[d];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;a!=f.node;)a=l(a);var h=i&&null!=t&&t<=c&&f.lineNumber;f.changes&&(V(f.changes,"gutter")>-1&&(h=!1),Pr(e,f,c,r)),h&&(A(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(ut(e.options,c)))),a=f.node.nextSibling}else{var p=qr(e,f,c,r);o.insertBefore(p,a)}c+=f.size}for(;a;)a=l(a)}function Yi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Nr(e,"gutterChanged",e)}function Qi(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+Jr(e)+"px"}function Ji(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=In(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Zi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=ut(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(F("div",[F("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Yi(e.display),!0}return!1}function eo(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;n=!0}r.push({className:o,style:a})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function to(e){var t=e.gutters,r=e.gutterSpecs;A(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,a=i.style,l=t.appendChild(F("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",Yi(e)}function ro(e){to(e.display),Rn(e),Ji(e)}function no(e,t,n,i){var o=this;this.input=n,o.scrollbarFiller=F("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=F("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=E("div",null,"CodeMirror-code"),o.selectionDiv=F("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=F("div",null,"CodeMirror-cursors"),o.measure=F("div",null,"CodeMirror-measure"),o.lineMeasure=F("div",null,"CodeMirror-measure"),o.lineSpace=E("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=E("div",[o.lineSpace],"CodeMirror-lines");o.mover=F("div",[u],null,"position: relative"),o.sizer=F("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=F("div",null,null,"position: absolute; height: "+U+"px; width: 1px;"),o.gutters=F("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=F("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=F("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),c&&d>=105&&(o.wrapper.style.clipPath="inset(0px)"),o.wrapper.setAttribute("translate","no"),a&&l<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),s||r&&y||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=eo(i.gutters,i.lineNumbers),to(o),n.init(o)}Ri.prototype.signal=function(e,t){Me(e,t)&&this.events.push(arguments)},Ri.prototype.finish=function(){for(var e=0;e<this.events.length;e++)we.apply(null,this.events[e])};var io=0,oo=null;function ao(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 lo(e){var t=ao(e);return t.x*=oo,t.y*=oo,t}function so(e,t){c&&102==d&&(null==e.display.chromeScrollHack?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout((function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""}),100));var n=ao(t),i=n.x,o=n.y,a=oo;0===t.deltaMode&&(i=t.deltaX,o=t.deltaY,a=1);var l=e.display,u=l.scroller,h=u.scrollWidth>u.clientWidth,p=u.scrollHeight>u.clientHeight;if(i&&h||o&&p){if(o&&x&&s)e:for(var m=t.target,g=l.view;m!=u;m=m.parentNode)for(var v=0;v<g.length;v++)if(g[v].node==m){e.display.currentWheelTarget=m;break e}if(i&&!r&&!f&&null!=a)return o&&p&&vi(e,Math.max(0,u.scrollTop+o*a)),xi(e,Math.max(0,u.scrollLeft+i*a)),(!o||o&&p)&&Te(t),void(l.wheelStartX=null);if(o&&null!=a){var y=o*a,b=e.doc.scrollTop,k=b+l.wrapper.clientHeight;y<0?b=Math.max(0,b+y-50):k=Math.min(e.doc.height,k+y+50),$i(e,{top:b,bottom:k})}io<20&&0!==t.deltaMode&&(null==l.wheelStartX?(l.wheelStartX=u.scrollLeft,l.wheelStartY=u.scrollTop,l.wheelDX=i,l.wheelDY=o,setTimeout((function(){if(null!=l.wheelStartX){var e=u.scrollLeft-l.wheelStartX,t=u.scrollTop-l.wheelStartY,r=t&&l.wheelDY&&t/l.wheelDY||e&&l.wheelDX&&e/l.wheelDX;l.wheelStartX=l.wheelStartY=null,r&&(oo=(oo*io+r)/(io+1),++io)}}),200)):(l.wheelDX+=i,l.wheelDY+=o))}}a?oo=-.53:r?oo=15:c?oo=-.7:h&&(oo=-1/3);var uo=function(e,t){this.ranges=e,this.primIndex=t};uo.prototype.primary=function(){return this.ranges[this.primIndex]},uo.prototype.equals=function(e){if(e==this)return!0;if(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(!ft(r.anchor,n.anchor)||!ft(r.head,n.head))return!1}return!0},uo.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new co(ht(this.ranges[t].anchor),ht(this.ranges[t].head));return new uo(e,this.primIndex)},uo.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},uo.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(dt(t,n.from())>=0&&dt(e,n.to())<=0)return r}return-1};var co=function(e,t){this.anchor=e,this.head=t};function fo(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort((function(e,t){return dt(e.from(),t.from())})),r=V(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=dt(l.to(),a.from());if(n&&!a.empty()?s>0:s>=0){var u=mt(l.from(),a.from()),c=pt(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head;o<=r&&--r,t.splice(--o,2,new co(d?c:u,d?u:c))}}return new uo(t,r)}function ho(e,t){return new uo([new co(e,t||e)],0)}function po(e){return e.text?ct(e.from.line+e.text.length-1,ee(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function mo(e,t){if(dt(e,t.from)<0)return e;if(dt(e,t.to)<=0)return po(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+=po(t).ch-t.to.ch),ct(r,n)}function go(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new co(mo(i.anchor,t),mo(i.head,t)))}return fo(e.cm,r,e.sel.primIndex)}function vo(e,t,r){return e.line==t.line?ct(r.line,e.ch-t.ch+r.ch):ct(r.line+(e.line-t.line),e.ch)}function yo(e,t,r){for(var n=[],i=ct(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=vo(l.from,i,o),u=vo(po(l),i,o);if(i=l.to,o=u,"around"==r){var c=e.sel.ranges[a],d=dt(c.head,c.anchor)<0;n[a]=new co(d?u:s,d?s:u)}else n[a]=new co(s,s)}return new uo(n,e.sel.primIndex)}function xo(e){e.doc.mode=Xe(e.options,e.doc.modeOption),bo(e)}function bo(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,ji(e,100),e.state.modeGen++,e.curOp&&Rn(e)}function ko(e,t){return 0==t.from.ch&&0==t.to.ch&&""==ee(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function wo(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){pr(e,r,i,n),Nr(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new hr(u[o],i(o),n));return r}var l=t.from,s=t.to,u=t.text,c=rt(e,l.line),d=rt(e,s.line),f=ee(u),h=i(u.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(ko(e,t)){var m=a(0,u.length-1);o(d,d.text,h),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(c==d)if(1==u.length)o(c,c.text.slice(0,l.ch)+f+c.text.slice(s.ch),h);else{var g=a(1,u.length-1);g.push(new hr(f+c.text.slice(s.ch),h,n)),o(c,c.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,l.ch)+u[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(c,c.text.slice(0,l.ch)+u[0],i(0)),o(d,f+d.text.slice(s.ch),h);var v=a(1,u.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,v)}Nr(e,"change",e,t)}function Co(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;r&&!s||(t(l.doc,s),n(l.doc,e,s))}}}n(e,null,!0)}function So(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Hn(e),xo(e),Mo(e),e.options.direction=t.direction,e.options.lineWrapping||fr(e),e.options.mode=t.modeOption,Rn(e)}function Mo(e){("rtl"==e.doc.direction?z:T)(e.display.lineDiv,"CodeMirror-rtl")}function Lo(e){Bi(e,(function(){Mo(e),Rn(e)}))}function To(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 Ao(e,t){var r={from:ht(t.from),to:po(t),text:nt(e,t.from,t.to)};return Po(e,r,t.from.line,t.to.line+1),Co(e,(function(e){return Po(e,r,t.from.line,t.to.line+1)}),!0),r}function Do(e){for(;e.length&&ee(e).ranges;)e.pop()}function Fo(e,t){return t?(Do(e.done),ee(e.done)):e.done.length&&!ee(e.done).ranges?ee(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),ee(e.done)):void 0}function Eo(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Fo(i,i.lastOp==n)))a=ee(o.changes),0==dt(t.from,t.to)&&0==dt(t.from,a.to)?a.to=po(t):o.changes.push(Ao(e,t));else{var s=ee(i.done);for(s&&s.ranges||zo(e.sel,i.done),o={changes:[Ao(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||we(e,"historyAdded")}function Oo(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function No(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Oo(e,o,ee(i.done),t))?i.done[i.done.length-1]=t:zo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Do(i.undone)}function zo(e,t){var r=ee(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Po(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 Bo(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}function Io(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Bo(r[i]));return n}function Wo(e,t){var r=Io(e,t),n=Gt(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function Ho(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?uo.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var u=a[s],c=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&V(t,Number(c[1]))>-1&&(ee(l)[d]=u[d],delete u[d])}}}return n}function jo(e,t,r,n){if(n){var i=e.anchor;if(r){var o=dt(t,i)<0;o!=dt(r,i)<0?(i=t,t=r):o!=dt(t,r)<0&&(t=r)}return new co(i,t)}return new co(r||t,t)}function _o(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ko(e,new uo([jo(e.sel.primary(),t,r,i)],0),n)}function Ro(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]=jo(e.sel.ranges[o],t[o],null,i);Ko(e,fo(e.cm,n,e.sel.primIndex),r)}function qo(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Ko(e,fo(e.cm,i,e.sel.primIndex),n)}function Go(e,t,r,n){Ko(e,ho(t,r),n)}function Vo(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new co(vt(e,t[r].anchor),vt(e,t[r].head))},origin:r&&r.origin};return we(e,"beforeSelectionChange",e,n),e.cm&&we(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?fo(e.cm,n.ranges,n.ranges.length-1):t}function Uo(e,t,r){var n=e.history.done,i=ee(n);i&&i.ranges?(n[n.length-1]=t,$o(e,t,r)):Ko(e,t,r)}function Ko(e,t,r){$o(e,t,r),No(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function $o(e,t,r){(Me(e,"beforeSelectionChange")||e.cm&&Me(e.cm,"beforeSelectionChange"))&&(t=Vo(e,t,r));var n=r&&r.bias||(dt(t.primary().head,e.sel.primary().head)<0?-1:1);Xo(e,Qo(e,t,n,!0)),r&&!1===r.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||fi(e.cm)}function Xo(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Se(e.cm)),Nr(e,"cursorActivity",e))}function Yo(e){Xo(e,Qo(e,e.sel,null,!1))}function Qo(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Zo(e,a.anchor,l&&l.anchor,r,n),u=a.head==a.anchor?s:Zo(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new co(s,u))}return i?fo(e.cm,i,t.primIndex):t}function Jo(e,t,r,n,i){var o=rt(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,c="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==l.from||(u?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(c?l.to>=t.ch:l.to>t.ch))){if(i&&(we(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var d=s.find(n<0?1:-1),f=void 0;if((n<0?c:u)&&(d=ea(e,d,-n,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=dt(d,r))&&(n<0?f<0:f>0))return Jo(e,d,t,n,i)}var h=s.find(n<0?-1:1);return(n<0?u:c)&&(h=ea(e,h,n,h.line==t.line?o:null)),h?Jo(e,h,t,n,i):null}}return t}function Zo(e,t,r,n,i){var o=n||1,a=Jo(e,t,r,o,i)||!i&&Jo(e,t,r,o,!0)||Jo(e,t,r,-o,i)||!i&&Jo(e,t,r,-o,!0);return a||(e.cantEdit=!0,ct(e.first,0))}function ea(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?vt(e,ct(t.line-1)):null:r>0&&t.ch==(n||rt(e,t.line)).text.length?t.line<e.first+e.size-1?ct(t.line+1,0):null:new ct(t.line,t.ch+r)}function ta(e){e.setSelection(ct(e.firstLine(),0),ct(e.lastLine()),$)}function ra(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=vt(e,t)),r&&(n.to=vt(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),we(e,"beforeChange",e,n),e.cm&&we(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 na(e,t,r){if(e.cm){if(!e.cm.curOp)return Ii(e.cm,na)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Me(e,"beforeChange")||e.cm&&Me(e.cm,"beforeChange"))||(t=ra(e,t,!0))){var n=zt&&!r&&Ut(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)ia(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else ia(e,t)}}function ia(e,t){if(1!=t.text.length||""!=t.text[0]||0!=dt(t.from,t.to)){var r=go(e,t);Eo(e,t,r,e.cm?e.cm.curOp.id:NaN),la(e,t,r,Gt(e,t));var n=[];Co(e,(function(e,r){r||-1!=V(n,e.history)||(fa(e.history,t),n.push(e.history)),la(e,t,null,Gt(e,t))}))}}function oa(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,a=e.sel,l="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,u=0;u<l.length&&(i=l[u],r?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=l.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=l.pop()).ranges){if(n)return void l.push(i);break}if(zo(i,s),r&&!i.equals(e.sel))return void Ko(e,i,{clearRedo:!1});a=i}var c=[];zo(a,s),s.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=Me(e,"beforeChange")||e.cm&&Me(e.cm,"beforeChange"),f=function(r){var n=i.changes[r];if(n.origin=t,d&&!ra(e,n,!1))return l.length=0,{};c.push(Ao(e,n));var o=r?go(e,n):ee(l);la(e,n,o,Wo(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:po(n)});var a=[];Co(e,(function(e,t){t||-1!=V(a,e.history)||(fa(e.history,n),a.push(e.history)),la(e,n,null,Wo(e,n))}))},h=i.changes.length-1;h>=0;--h){var p=f(h);if(p)return p.v}}}}function aa(e,t){if(0!=t&&(e.first+=t,e.sel=new uo(te(e.sel.ranges,(function(e){return new co(ct(e.anchor.line+t,e.anchor.ch),ct(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++)qn(e.cm,n,"gutter")}}function la(e,t,r,n){if(e.cm&&!e.cm.curOp)return Ii(e.cm,la)(e,t,r,n);if(t.to.line<e.first)aa(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);aa(e,i),t={from:ct(e.first,0),to:ct(t.to.line+i,t.to.ch),text:[ee(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ct(o,rt(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=nt(e,t.from,t.to),r||(r=go(e,t)),e.cm?sa(e.cm,t,n):wo(e,t,n),$o(e,r,$),e.cantEdit&&Zo(e,ct(e.firstLine(),0))&&(e.cantEdit=!1)}}function sa(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=at(nr(rt(n,o.line))),n.iter(s,a.line+1,(function(e){if(e==i.maxLine)return l=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&Se(e),wo(n,t,r,Wn(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,(function(e){var t=dr(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)})),l&&(e.curOp.updateMaxLine=!0)),Nt(n,o.line),ji(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?Rn(e):o.line!=a.line||1!=t.text.length||ko(e.doc,t)?Rn(e,o.line,a.line+1,u):qn(e,o.line,"text");var c=Me(e,"changes"),d=Me(e,"change");if(d||c){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&Nr(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function ua(e,t,r,n,i){var o;n||(n=r),dt(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),na(e,{from:r,to:n,text:t,origin:i})}function ca(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function da(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)ca(o.ranges[l].anchor,t,r,n),ca(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(r<u.from.line)u.from=ct(u.from.line+n,u.from.ch),u.to=ct(u.to.line+n,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function fa(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;da(e.done,r,n,i),da(e.undone,r,n,i)}function ha(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=rt(e,gt(e,t)):i=at(t),null==i?null:(n(o,i)&&e.cm&&qn(e.cm,i,r),o)}function pa(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 ma(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}co.prototype.from=function(){return mt(this.anchor,this.head)},co.prototype.to=function(){return pt(this.anchor,this.head)},co.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},pa.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,mr(i),Nr(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}},ma.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),a=n.height;if(n.removeInner(e,o),this.height-=a-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 pa))){var l=[];this.collapse(l),this.children=[new pa(l)],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 a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new pa(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++n,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ma(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=V(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new ma(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 a=Math.min(t,o-e);if(i.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var ga=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 va(e,t,r){cr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&di(e,r)}function ya(e,t,r,n){var i=new ga(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),ha(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!sr(e,t)){var n=cr(t)<e.scrollTop;ot(t,t.height+Kr(i)),n&&di(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&Nr(o,"lineWidgetAdded",o,i,"number"==typeof t?t:at(t)),i}ga.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=at(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=Kr(this);ot(r,Math.max(0,r.height-o)),e&&(Bi(e,(function(){va(e,r,-o),qn(e,n,"widget")})),Nr(e,"lineWidgetCleared",e,this,n))}},ga.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Kr(this)-t;i&&(sr(this.doc,n)||ot(n,n.height+i),r&&Bi(r,(function(){r.curOp.forceUpdate=!0,va(r,n,i),Nr(r,"lineWidgetChanged",r,e,at(n))})))},Le(ga);var xa=0,ba=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++xa};function ka(e,t,r,n,i){if(n&&n.shared)return Ca(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Ii(e.cm,ka)(e,t,r,n,i);var o=new ba(e,i),a=dt(t,r);if(n&&R(n,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=E("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(rr(e,t.line,t,r,o)||t.line!=r.line&&rr(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");It()}o.addToHistory&&Eo(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var l,s=t.line,u=e.cm;if(e.iter(s,r.line+1,(function(n){u&&o.collapsed&&!u.options.lineWrapping&&nr(n)==u.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&ot(n,0),_t(n,new Wt(o,s==t.line?t.ch:null,s==r.line?r.ch:null),e.cm&&e.cm.curOp),++s})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){sr(e,t)&&ot(t,0)})),o.clearOnEnter&&xe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Bt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++xa,o.atomic=!0),u){if(l&&(u.curOp.updateMaxLine=!0),o.collapsed)Rn(u,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=r.line;c++)qn(u,c,"text");o.atomic&&Yo(u.doc),Nr(u,"markerAdded",u,o)}return o}ba.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ai(e),Me(this,"clear")){var r=this.find();r&&Nr(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=Ht(a.markedSpans,this);e&&!this.collapsed?qn(e,at(a),"text"):e&&(null!=l.to&&(i=at(a)),null!=l.from&&(n=at(a))),a.markedSpans=jt(a.markedSpans,l),null==l.from&&this.collapsed&&!sr(this.doc,a)&&e&&ot(a,zn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=nr(this.lines[s]),c=dr(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&&Yo(e.doc)),e&&Nr(e,"markerCleared",e,this,n,i),t&&Di(e),this.parent&&this.parent.clear()}},ba.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Ht(o.markedSpans,this);if(null!=a.from&&(r=ct(t?o:at(o),a.from),-1==e))return r;if(null!=a.to&&(n=ct(t?o:at(o),a.to),1==e))return n}return r&&{from:r,to:n}},ba.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&Bi(n,(function(){var i=t.line,o=at(t.line),a=an(n,o);if(a&&(mn(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!sr(r.doc,i)&&null!=r.height){var l=r.height;r.height=null;var s=Kr(r)-l;s&&ot(i,i.height+s)}Nr(n,"markerChanged",n,e)}))},ba.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=V(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ba.prototype.detachLine=function(e){if(this.lines.splice(V(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Le(ba);var wa=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function Ca(e,t,r,n,i){(n=R(n)).shared=!1;var o=[ka(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Co(e,(function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(ka(e,vt(e,t),vt(e,r),n,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=ee(o)})),new wa(o,a)}function Sa(e){return e.findMarks(ct(e.first,0),e.clipPos(ct(e.lastLine())),(function(e){return e.parent}))}function Ma(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(dt(o,a)){var l=ka(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}function La(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];Co(r.primary.doc,(function(e){return n.push(e)}));for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==V(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}wa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Nr(this,"clear")}},wa.prototype.find=function(e,t){return this.primary.find(e,t)},Le(wa);var Ta=0,Aa=function(e,t,r,n,i){if(!(this instanceof Aa))return new Aa(e,t,r,n,i);null==r&&(r=0),ma.call(this,[new pa([new hr("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=ct(r,0);this.sel=ho(o),this.history=new To(null),this.id=++Ta,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),wo(this,{from:o,to:o,text:e}),Ko(this,ho(o),$)};Aa.prototype=ie(ma.prototype,{constructor:Aa,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=it(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Hi((function(e){var t=ct(this.first,0),r=this.first+this.size-1;na(this,{from:t,to:ct(r,rt(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&hi(this.cm,0,0),Ko(this,ho(t),$)})),replaceRange:function(e,t,r,n){ua(this,e,t=vt(this,t),r=r?vt(this,r):t,n)},getRange:function(e,t,r){var n=nt(this,vt(this,e),vt(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(st(this,e))return rt(this,e)},getLineNumber:function(e){return at(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=rt(this,e)),nr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return vt(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:Hi((function(e,t,r){Go(this,vt(this,"number"==typeof e?ct(e,t||0):e),null,r)})),setSelection:Hi((function(e,t,r){Go(this,vt(this,e),vt(this,t||e),r)})),extendSelection:Hi((function(e,t,r){_o(this,vt(this,e),t&&vt(this,t),r)})),extendSelections:Hi((function(e,t){Ro(this,xt(this,e),t)})),extendSelectionsBy:Hi((function(e,t){Ro(this,xt(this,te(this.sel.ranges,e)),t)})),setSelections:Hi((function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new co(vt(this,e[i].anchor),vt(this,e[i].head||e[i].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ko(this,fo(this.cm,n,t),r)}})),addSelection:Hi((function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new co(vt(this,e),vt(this,t||e))),Ko(this,fo(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=nt(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=nt(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:Hi((function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var l=t&&"end"!=t&&yo(this,n,t),s=n.length-1;s>=0;s--)na(this,n[s]);l?Uo(this,l):this.cm&&fi(this.cm)})),undo:Hi((function(){oa(this,"undo")})),redo:Hi((function(){oa(this,"redo")})),undoSelection:Hi((function(){oa(this,"undo",!0)})),redoSelection:Hi((function(){oa(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 To(this.history),Co(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:Ho(this.history.done),undone:Ho(this.history.undone)}},setHistory:function(e){var t=this.history=new To(this.history);t.done=Ho(e.done.slice(0),null,!0),t.undone=Ho(e.undone.slice(0),null,!0)},setGutterMarker:Hi((function(e,t,r){return ha(this,e,"gutter",(function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&se(n)&&(e.gutterMarkers=null),!0}))})),clearGutter:Hi((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&ha(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,se(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!st(this,e))return null;if(t=e,!(e=rt(this,e)))return null}else if(null==(t=at(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:Hi((function(e,t,r){return ha(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(M(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0}))})),removeLineClass:Hi((function(e,t,r){return ha(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(M(r));if(!o)return!1;var a=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:Hi((function(e,t,r){return ya(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return ka(this,vt(this,e),vt(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 ka(this,e=vt(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=rt(this,(e=vt(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=vt(this,e),t=vt(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.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})),vt(this,ct(r,t))},indexFromPos:function(e){var t=(e=vt(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 Aa(it(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 Aa(it(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}],Ma(n,Sa(this)),n},unlinkDoc:function(e){if(e instanceof Rl&&(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),La(Sa(this));break}if(e.history==this.history){var r=[e.id];Co(e,(function(e){return r.push(e.id)}),!0),e.history=new To(null),e.history.done=Ho(this.history.done,r),e.history.undone=Ho(this.history.undone,r)}},iterLinkedDocs:function(e){Co(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):He(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Hi((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Lo(this.cm))}))}),Aa.prototype.eachLine=Aa.prototype.iter;var Da=0;function Fa(e){var t=this;if(Na(t),!Ce(t,e)&&!$r(t.display,e)){Te(e),a&&(Da=+new Date);var r=jn(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&&Ii(t,(function(){var e={from:r=vt(t.doc,r),to:r,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};na(t.doc,e),Uo(t.doc,ho(vt(t.doc,r),vt(t.doc,po(e))))}))()},u=function(e,r){if(t.options.allowDropFileTypes&&-1==V(t.options.allowDropFileTypes,e.type))s();else{var n=new FileReader;n.onerror=function(){return s()},n.onload=function(){var e=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[r]=e),s()},n.readAsText(e)}},c=0;c<n.length;c++)u(n[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),$o(t.doc,ho(r,r)),f)for(var h=0;h<f.length;++h)ua(t.doc,"",f[h].anchor,f[h].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ea(e,t){if(a&&(!e.state.draggingText||+new Date-Da<100))Fe(t);else if(!Ce(e,t)&&!$r(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var r=F("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),f&&r.parentNode.removeChild(r)}}function Oa(e,t){var r=jn(e,t);if(r){var n=document.createDocumentFragment();Yn(e,r,n),e.display.dragCursor||(e.display.dragCursor=F("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),D(e.display.dragCursor,n)}}function Na(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function za(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 Pa=!1;function Ba(){Pa||(Ia(),Pa=!0)}function Ia(){var e;xe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,za(Wa)}),100))})),xe(window,"blur",(function(){return za(ni)}))}function Wa(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ha={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"},ja=0;ja<10;ja++)Ha[ja+48]=Ha[ja+96]=String(ja);for(var _a=65;_a<=90;_a++)Ha[_a]=String.fromCharCode(_a);for(var Ra=1;Ra<=12;Ra++)Ha[Ra+111]=Ha[Ra+63235]="F"+Ra;var qa={};function Ga(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Va(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=te(r.split(" "),Ga),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=n):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var u in t)e[u]=t[u];return e}function Ua(e,t,r,n){var i=(t=Ya(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 Ua(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Ua(e,t.fallthrough[o],r,n);if(a)return a}}}function Ka(e){var t="string"==typeof e?e:Ha[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function $a(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Mod"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function Xa(e,t){if(f&&34==e.keyCode&&e.char)return!1;var r=Ha[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),$a(r,e,t))}function Ya(e){return"string"==typeof e?qa[e]:e}function Qa(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&dt(o.from,ee(n).to)<=0;){var a=n.pop();if(dt(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}Bi(e,(function(){for(var t=n.length-1;t>=0;t--)ua(e.doc,"",n[t].from,n[t].to,"+delete");fi(e)}))}function Ja(e,t,r){var n=de(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Za(e,t,r){var n=Ja(e,t.ch,r);return null==n?null:new ct(t.line,n,r<0?"after":"before")}function el(e,t,r,n,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ve(r,t.doc.direction);if(o){var a,l=i<0?ee(o):o[0],s=i<0==(1==l.level)?"after":"before";if(l.level>0||"rtl"==t.doc.direction){var u=ln(t,r);a=i<0?r.text.length-1:0;var c=sn(t,u,a).top;a=fe((function(e){return sn(t,u,e).top==c}),i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=Ja(r,a,1))}else a=i<0?l.to:l.from;return new ct(n,a,s)}}return new ct(n,i<0?r.text.length:0,i<0?"before":"after")}function tl(e,t,r,n){var i=ve(t,e.doc.direction);if(!i)return Za(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 o=me(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return Za(t,r,n);var l,s=function(e,r){return Ja(t,e instanceof ct?e.ch:e,r)},u=function(r){return e.options.lineWrapping?(l=l||ln(e,t),Dn(e,t,l,r)):{begin:0,end:t.text.length}},c=u("before"==r.sticky?s(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==n<0,f=s(r,d?1:-1);if(null!=f&&(d?f<=a.to&&f<=c.end:f>=a.from&&f>=c.begin)){var h=d?"before":"after";return new ct(r.line,f,h)}}var p=function(e,t,n){for(var o=function(e,t){return t?new ct(r.line,s(e,1),"before"):new ct(r.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),u=l?n.begin:s(n.end,-1);if(a.from<=u&&u<a.to)return o(u,l);if(u=l?a.from:s(a.to,-1),n.begin<=u&&u<n.end)return o(u,l)}},m=p(o+n,n,c);if(m)return m;var g=n>0?c.end:s(c.begin,-1);return null==g||n>0&&g==t.text.length||!(m=p(n>0?0:i.length-1,n,u(g)))?null:m}qa.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"},qa.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"},qa.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"},qa.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"]},qa.default=x?qa.macDefault:qa.pcDefault;var rl={selectAll:ta,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return Qa(e,(function(t){if(t.empty()){var r=rt(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:ct(t.head.line+1,0)}:{from:t.head,to:ct(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Qa(e,(function(t){return{from:ct(t.from().line,0),to:vt(e.doc,ct(t.to().line+1,0))}}))},delLineLeft:function(e){return Qa(e,(function(e){return{from:ct(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Qa(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 Qa(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(ct(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ct(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return nl(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ol(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return il(e,t.head.line)}),{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")}),Y)},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")}),Y)},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/)?ol(e,t.head):n}),Y)},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("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=q(e.getLine(o.line),o.ch,n);t.push(Z(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Bi(e,(function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=rt(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ct(i.line,i.ch-1)),i.ch>0)i=new ct(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ct(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=rt(e.doc,i.line-1).text;a&&(i=new ct(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ct(i.line-1,a.length-1),i,"+transpose"))}r.push(new co(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){return Bi(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)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);fi(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function nl(e,t){var r=rt(e.doc,t),n=nr(r);return n!=r&&(t=at(n)),el(!0,e,n,t,1)}function il(e,t){var r=rt(e.doc,t),n=ir(r);return n!=r&&(t=at(n)),el(!0,e,r,t,-1)}function ol(e,t){var r=nl(e,t.line),n=rt(e.doc,r.line),i=ve(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(r.ch,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return ct(r.line,a?0:o,r.sticky)}return r}function al(e,t,r){if("string"==typeof t&&!(t=rl[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)!=K}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function ll(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Ua(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Ua(t,e.options.extraKeys,r,e)||Ua(t,e.options.keyMap,r,e)}var sl=new G;function ul(e,t,r,n){var i=e.state.keySeq;if(i){if(Ka(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:sl.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),cl(e,i+" "+t,r,n))return!0}return cl(e,t,r,n)}function cl(e,t,r,n){var i=ll(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&Nr(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(Te(r),Zn(e)),!!i}function dl(e,t){var r=Xa(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ul(e,"Shift-"+r,t,(function(t){return al(e,t,!0)}))||ul(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return al(e,t)})):ul(e,r,t,(function(t){return al(e,t)})))}function fl(e,t,r){return ul(e,"'"+r+"'",t,(function(t){return al(e,t,!0)}))}var hl=null;function pl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=N(W(t)),Ce(t,e)))){a&&l<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var i=dl(t,e);f&&(hl=i?n:null,i||88!=n||_e||!(x?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),r&&!x&&!i&&46==n&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||ml(t)}}function ml(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(T(t,"CodeMirror-crosshair"),ke(document,"keyup",r),ke(document,"mouseover",r))}z(t,"CodeMirror-crosshair"),xe(document,"keyup",r),xe(document,"mouseover",r)}function gl(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ce(this,e)}function vl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||$r(t.display,e)||Ce(t,e)||e.ctrlKey&&!e.altKey||x&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(f&&r==hl)return hl=null,void Te(e);if(!f||e.which&&!(e.which<10)||!dl(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(fl(t,e,i)||t.display.input.onKeyPress(e))}}}var yl,xl,bl=400,kl=function(e,t,r){this.time=e,this.pos=t,this.button=r};function wl(e,t){var r=+new Date;return xl&&xl.compare(r,e,t)?(yl=xl=null,"triple"):yl&&yl.compare(r,e,t)?(xl=new kl(r,e,t),yl=null,"double"):(yl=new kl(r,e,t),xl=null,"single")}function Cl(e){var t=this,r=t.display;if(!(Ce(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,$r(r,e))s||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100));else if(!Ol(t,e)){var n=jn(t,e),i=Oe(e),o=n?wl(n,i):"single";j(t).focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&Sl(t,i,n,o,e)||(1==i?n?Ll(t,n,o,e):Ee(e)==r.scroller&&Te(e):2==i?(n&&_o(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):ti(t)))}}function Sl(e,t,r,n,i){var o="Click";return"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o),ul(e,$a(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=rl[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=K}finally{e.state.suppressEdits=!1}return n}))}function Ml(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=b?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=x?r.metaKey:r.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(x?r.altKey:r.ctrlKey)),i}function Ll(e,t,r,n){a?setTimeout(_(ei,e),0):e.curOp.focus=N(W(e));var i,o=Ml(e,r,n),l=e.doc.sel;e.options.dragDrop&&Pe&&!e.isReadOnly()&&"single"==r&&(i=l.contains(t))>-1&&(dt((i=l.ranges[i]).from(),t)<0||t.xRel>0)&&(dt(i.to(),t)>0||t.xRel<0)?Tl(e,n,t,o):Dl(e,n,t,o)}function Tl(e,t,r,n){var i=e.display,o=!1,u=Ii(e,(function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ti(e)),ke(i.wrapper.ownerDocument,"mouseup",u),ke(i.wrapper.ownerDocument,"mousemove",c),ke(i.scroller,"dragstart",d),ke(i.scroller,"drop",u),o||(Te(t),n.addNew||_o(e.doc,r,null,null,n.extend),s&&!h||a&&9==l?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};s&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!n.moveOnDrag,xe(i.wrapper.ownerDocument,"mouseup",u),xe(i.wrapper.ownerDocument,"mousemove",c),xe(i.scroller,"dragstart",d),xe(i.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Al(e,t,r){if("char"==r)return new co(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new co(ct(t.line,0),vt(e.doc,ct(t.line+1,0)));var n=r(e,t);return new co(n.from,n.to)}function Dl(e,t,r,n){a&&ti(e);var i=e.display,o=e.doc;Te(t);var l,s,u=o.sel,c=u.ranges;if(n.addNew&&!n.extend?(s=o.sel.contains(r),l=s>-1?c[s]:new co(r,r)):(l=o.sel.primary(),s=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(l=new co(r,r)),r=jn(e,t,!0,!0),s=-1;else{var d=Al(e,r,n.unit);l=n.extend?jo(l,d.anchor,d.head,n.extend):d}n.addNew?-1==s?(s=c.length,Ko(o,fo(e,c.concat([l]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==n.unit&&!n.extend?(Ko(o,fo(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):qo(o,s,l,X):(s=0,Ko(o,new uo([l],0),X),u=o.sel);var f=r;function h(t){if(0!=dt(f,t))if(f=t,"rectangle"==n.unit){for(var i=[],a=e.options.tabSize,c=q(rt(o,r.line).text,r.ch,a),d=q(rt(o,t.line).text,t.ch,a),h=Math.min(c,d),p=Math.max(c,d),m=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=g;m++){var v=rt(o,m).text,y=Q(v,h,a);h==p?i.push(new co(ct(m,y),ct(m,y))):v.length>y&&i.push(new co(ct(m,y),ct(m,Q(v,p,a))))}i.length||i.push(new co(r,r)),Ko(o,fo(e,u.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x,b=l,k=Al(e,t,n.unit),w=b.anchor;dt(k.anchor,w)>0?(x=k.head,w=mt(b.from(),k.anchor)):(x=k.anchor,w=pt(b.to(),k.head));var C=u.ranges.slice(0);C[s]=Fl(e,new co(vt(o,w),x)),Ko(o,fo(e,C,s),X)}}var p=i.wrapper.getBoundingClientRect(),m=0;function g(t){var r=++m,a=jn(e,t,!0,"rectangle"==n.unit);if(a)if(0!=dt(a,f)){e.curOp.focus=N(W(e)),h(a);var l=ai(i,o);(a.line>=l.to||a.line<l.from)&&setTimeout(Ii(e,(function(){m==r&&g(t)})),150)}else{var s=t.clientY<p.top?-20:t.clientY>p.bottom?20:0;s&&setTimeout(Ii(e,(function(){m==r&&(i.scroller.scrollTop+=s,g(t))})),50)}}function v(t){e.state.selectingText=!1,m=1/0,t&&(Te(t),i.input.focus()),ke(i.wrapper.ownerDocument,"mousemove",y),ke(i.wrapper.ownerDocument,"mouseup",x),o.history.lastSelOrigin=null}var y=Ii(e,(function(e){0!==e.buttons&&Oe(e)?g(e):v(e)})),x=Ii(e,v);e.state.selectingText=x,xe(i.wrapper.ownerDocument,"mousemove",y),xe(i.wrapper.ownerDocument,"mouseup",x)}function Fl(e,t){var r=t.anchor,n=t.head,i=rt(e.doc,r.line);if(0==dt(r,n)&&r.sticky==n.sticky)return t;var o=ve(i);if(!o)return t;var a=me(o,r.ch,r.sticky),l=o[a];if(l.from!=r.ch&&l.to!=r.ch)return t;var s,u=a+(l.from==r.ch==(1!=l.level)?0:1);if(0==u||u==o.length)return t;if(n.line!=r.line)s=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=me(o,n.ch,n.sticky),d=c-a||(n.ch-r.ch)*(1==l.level?-1:1);s=c==u-1||c==u?d<0:d>0}var f=o[u+(s?-1:0)],h=s==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return r.ch==p&&r.sticky==m?t:new co(new ct(r.line,p,m),n)}function El(e,t,r,n){var i,o;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&&Te(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Me(e,r))return De(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=a.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i)return we(e,r,e,lt(e.doc,o),e.display.gutterSpecs[s].className,t),De(t)}}function Ol(e,t){return El(e,t,"gutterClick",!0)}function Nl(e,t){$r(e.display,t)||zl(e,t)||Ce(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function zl(e,t){return!!Me(e,"gutterContextMenu")&&El(e,t,"gutterContextMenu",!1)}function Pl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vn(e)}kl.prototype.compare=function(e,t,r){return this.time+bl>e&&0==dt(t,this.pos)&&r==this.button};var Bl={toString:function(){return"CodeMirror.Init"}},Il={},Wl={};function Hl(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=Bl&&i(e,t,r)}:i)}e.defineOption=r,e.Init=Bl,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,xo(e)}),!0),r("indentUnit",2,xo,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){bo(e),vn(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(ct(n,o))}n++}));for(var i=r.length-1;i>=0;i--)ua(e.doc,t,r[i],ct(r[i].line,r[i].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Bl&&e.refresh()})),r("specialCharPlaceholder",br,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!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",!k),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){Pl(e),ro(e)}),!0),r("keyMap","default",(function(e,t,r){var n=Ya(t),i=r!=Bl&&Ya(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,_l,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=eo(t,e.options.lineNumbers),ro(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?In(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return Ci(e)}),!0),r("scrollbarStyle","native",(function(e){Li(e),Ci(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=eo(e.options.gutters,t),ro(e)}),!0),r("firstLineNumber",1,ro,!0),r("lineNumberFormatter",(function(e){return e}),ro,!0),r("showCursorWhenSelecting",!1,$n,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(ni(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,jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,$n,!0),r("singleCursorHeightPerLine",!0,$n,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,bo,!0),r("addModeClass",!1,bo,!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,bo,!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)}function jl(e,t,r){if(!t!=!(r&&r!=Bl)){var n=e.display.dragFunctions,i=t?xe:ke;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 _l(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),fr(e)),Hn(e),Rn(e),vn(e),setTimeout((function(){return Ci(e)}),100)}function Rl(e,t){var r=this;if(!(this instanceof Rl))return new Rl(e,t);this.options=t=t?R(t):{},R(Il,t,!1);var n=t.value;"string"==typeof n?n=new Aa(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Rl.inputStyles[t.inputStyle](this),o=this.display=new no(e,n,i,t);for(var u in o.wrapper.CodeMirror=this,Pl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Li(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 G,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),a&&l<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),ql(this),Ba(),Ai(this),this.curOp.forceUpdate=!0,So(this,n),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){r.hasFocus()&&!r.state.focused&&ri(r)}),20):ni(this),Wl)Wl.hasOwnProperty(u)&&Wl[u](this,t[u],Bl);Zi(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Gl.length;++c)Gl[c](this);Di(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function ql(e){var t=e.display;xe(t.scroller,"mousedown",Ii(e,Cl)),xe(t.scroller,"dblclick",a&&l<11?Ii(e,(function(t){if(!Ce(e,t)){var r=jn(e,t);if(r&&!Ol(e,t)&&!$r(e.display,t)){Te(t);var n=e.findWordAt(r);_o(e.doc,n.anchor,n.head)}}})):function(t){return Ce(e,t)||Te(t)}),xe(t.scroller,"contextmenu",(function(t){return Nl(e,t)})),xe(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||Nl(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){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function s(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}xe(t.scroller,"touchstart",(function(i){if(!Ce(e,i)&&!o(i)&&!Ol(e,i)){t.input.ensurePolled(),clearTimeout(r);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),xe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),xe(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!$r(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!n.prev||s(n,n.prev)?new co(a,a):!n.prev.prev||s(n,n.prev.prev)?e.findWordAt(a):new co(ct(a.line,0),vt(e.doc,ct(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Te(r)}i()})),xe(t.scroller,"touchcancel",i),xe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(vi(e,t.scroller.scrollTop),xi(e,t.scroller.scrollLeft,!0),we(e,"scroll",e))})),xe(t.scroller,"mousewheel",(function(t){return so(e,t)})),xe(t.scroller,"DOMMouseScroll",(function(t){return so(e,t)})),xe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){Ce(e,t)||Fe(t)},over:function(t){Ce(e,t)||(Oa(e,t),Fe(t))},start:function(t){return Ea(e,t)},drop:Ii(e,Fa),leave:function(t){Ce(e,t)||Na(e)}};var u=t.input.getField();xe(u,"keyup",(function(t){return gl.call(e,t)})),xe(u,"keydown",Ii(e,pl)),xe(u,"keypress",Ii(e,vl)),xe(u,"focus",(function(t){return ri(e,t)})),xe(u,"blur",(function(t){return ni(e,t)}))}Rl.defaults=Il,Rl.optionHandlers=Wl;var Gl=[];function Vl(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=St(e,t).state:r="prev");var a=e.options.tabSize,l=rt(o,t),s=q(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u,c=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&((u=o.mode.indent(i,l.text.slice(c.length),l.text))==K||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?q(rt(o,t-1).text,null,a):0:"add"==r?u=s+e.options.indentUnit:"subtract"==r?u=s-e.options.indentUnit:"number"==typeof r&&(u=s+r),u=Math.max(0,u);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(u/a);h;--h)f+=a,d+="\t";if(f<u&&(d+=Z(u-f)),d!=c)return ua(o,d,ct(t,0),ct(t,c.length),"+input"),l.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<c.length){var g=ct(t,c.length);qo(o,p,new co(g,g));break}}}Rl.defineInitHook=function(e){return Gl.push(e)};var Ul=null;function Kl(e){Ul=e}function $l(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=+new Date-200,l="paste"==i||e.state.pasteIncoming>a,s=He(t),u=null;if(l&&n.ranges.length>1)if(Ul&&Ul.text.join("\n")==t){if(n.ranges.length%Ul.text.length==0){u=[];for(var c=0;c<Ul.text.length;c++)u.push(o.splitLines(Ul.text[c]))}}else s.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(u=te(s,(function(e){return[e]})));for(var d=e.curOp.updateInput,f=n.ranges.length-1;f>=0;f--){var h=n.ranges[f],p=h.from(),m=h.to();h.empty()&&(r&&r>0?p=ct(p.line,p.ch-r):e.state.overwrite&&!l?m=ct(m.line,Math.min(rt(o,m.line).text.length,m.ch+ee(s).length)):l&&Ul&&Ul.lineWise&&Ul.text.join("\n")==s.join("\n")&&(p=m=ct(p.line,0)));var g={from:p,to:m,text:u?u[f%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};na(e.doc,g),Nr(e,"inputRead",e,g)}t&&!l&&Yl(e,t),fi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Xl(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||Bi(t,(function(){return $l(t,r,0,null,"paste")})),!0}function Yl(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),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Vl(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(rt(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Vl(e,i.head.line,"smart"));a&&Nr(e,"electricInput",e,i.head.line)}}}function Ql(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:ct(i,0),head:ct(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Jl(e,t,r,n){e.setAttribute("autocorrect",r?"on":"off"),e.setAttribute("autocapitalize",n?"on":"off"),e.setAttribute("spellcheck",!!t)}function Zl(){var e=F("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=F("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),t}function es(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){j(this).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)&&Ii(this,t[e])(this,r,i),we(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"](Ya(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:Wi((function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");re(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(e){return e.priority})),this.state.modeGen++,Rn(this)})),removeOverlay:Wi((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)return t.splice(r,1),this.state.modeGen++,void Rn(this)}})),indentLine:Wi((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),st(this.doc,e)&&Vl(this,e,t,r)})),indentSelection:Wi((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&&(Vl(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&fi(this));else{var o=i.from(),a=i.to(),l=Math.max(r,o.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s<r;++s)Vl(this,s,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&qo(this.doc,n,new co(o,u[n].to()),$)}}})),getTokenAt:function(e,t){return Dt(this,e,t)},getLineTokens:function(e,t){return Dt(this,ct(e),t,!0)},getTokenTypeAt:function(e){e=vt(this.doc,e);var t,r=Ct(this,rt(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},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 a=0;a<o[t].length;a++){var l=i[o[t][a]];l&&n.push(l)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var s=0;s<i._global.length;s++){var u=i._global[s];u.pred(o,this)&&-1==V(n,u.val)&&n.push(u.val)}return n},getStateAfter:function(e,t){var r=this.doc;return St(this,(e=gt(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Sn(this,null==e?r.head:"object"==typeof e?vt(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Cn(this,vt(this.doc,e),t||"page")},coordsChar:function(e,t){return Tn(this,(e=wn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=wn(this,{top:e,left:0},t||"page").top,lt(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=rt(this.doc,e)}else n=e;return kn(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-cr(n):0)},defaultTextHeight:function(){return zn(this.display)},defaultCharWidth:function(){return Pn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display,a=(e=Sn(this,vt(this.doc,e))).bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>u&&(l=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&ui(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Wi(pl),triggerOnKeyPress:Wi(vl),triggerOnKeyUp:gl,triggerOnMouseDown:Wi(Cl),execCommand:function(e){if(rl.hasOwnProperty(e))return rl[e].call(null,this)},triggerElectric:Wi((function(e){Yl(this,e)})),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=vt(this.doc,e),a=0;a<t&&!(o=ts(this.doc,o,i,r,n)).hitSide;++a);return o},moveH:Wi((function(e,t){var r=this;this.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?ts(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()}),Y)})),deleteH:Wi((function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Qa(this,(function(r){var i=ts(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 a=vt(this.doc,e),l=0;l<t;++l){var s=Sn(this,a,"div");if(null==o?o=s.left:s.left=o,(a=rs(this,s,i,r)).hitSide)break}return a},moveV:Wi((function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var l=Sn(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=rs(r,l,e,t);return"page"==t&&a==n.sel.primary()&&di(r,Cn(r,s,"div").top-l.top),s}),Y),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=rt(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?++n:--r;for(var o=t.charAt(r),a=le(o,i)?function(e){return le(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!le(e)};r>0&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new co(ct(e.line,r),ct(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),we(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==N(W(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Wi((function(e,t){hi(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Jr(this)-this.display.barHeight,width:e.scrollWidth-Jr(this)-this.display.barWidth,clientHeight:en(this),clientWidth:Zr(this)}},scrollIntoView:Wi((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ct(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?pi(this,e):gi(this,e.from,e.to,e.margin)})),setSize:Wi((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&&gn(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){qn(r,i,"widget");break}++i})),this.curOp.forceUpdate=!0,we(this,"refresh",this)})),operation:function(e){return Bi(this,e)},startOperation:function(){return Ai(this)},endOperation:function(){return Di(this)},refresh:Wi((function(){var e=this.display.cachedTextHeight;Rn(this),this.curOp.forceUpdate=!0,vn(this),hi(this,this.doc.scrollLeft,this.doc.scrollTop),Yi(this.display),(null==e||Math.abs(e-zn(this.display))>.5||this.options.lineWrapping)&&Hn(this),we(this,"refresh",this)})),swapDoc:Wi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),So(this,e),vn(this),this.display.input.reset(),hi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Nr(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}},Le(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}function ts(e,t,r,n,i){var o=t,a=r,l=rt(e,t.line),s=i&&"rtl"==e.direction?-r:r;function u(){var r=t.line+s;return!(r<e.first||r>=e.first+e.size)&&(t=new ct(r,t.ch,t.sticky),l=rt(e,r))}function c(o){var a;if("codepoint"==n){var c=l.text.charCodeAt(t.ch+(r>0?0:-1));if(isNaN(c))a=null;else{var d=r>0?c>=55296&&c<56320:c>=56320&&c<57343;a=new ct(t.line,Math.max(0,Math.min(l.text.length,t.ch+r*(d?2:1))),-r)}}else a=i?tl(e.cm,l,t,r):Za(l,t,r);if(null==a){if(o||!u())return!1;t=el(i,e.cm,l,t.line,s)}else t=a;return!0}if("char"==n||"codepoint"==n)c();else if("column"==n)c(!0);else if("word"==n||"group"==n)for(var d=null,f="group"==n,h=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(r<0)||c(!p);p=!1){var m=l.text.charAt(t.ch)||"\n",g=le(m,h)?"w":f&&"\n"==m?"n":!f||/\s/.test(m)?null:"p";if(!f||p||g||(g="s"),d&&d!=g){r<0&&(r=1,c(),t.sticky="after");break}if(g&&(d=g),r>0&&!c(!p))break}var v=Zo(e,t,o,a,!0);return ft(o,v)&&(v.hitSide=!0),v}function rs(e,t,r,n){var i,o,a=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,j(e).innerHeight||a(e).documentElement.clientHeight),u=Math.max(s-.5*zn(e.display),3);i=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;(o=Tn(e,l,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*r}return o}var ns=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new G,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function is(e,t){var r=an(e,t.line);if(!r||r.hidden)return null;var n=rt(e.doc,t.line),i=rn(r,n,t.line),o=ve(n,e.doc.direction),a="left";o&&(a=me(o,t.ch)%2?"right":"left");var l=dn(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function os(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function as(e,t){return t&&(e.bad=!0),e}function ls(e,t,r,n,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function u(e){return function(t){return t.id==e}}function c(){a&&(o+=l,s&&(o+=l),a=s=!1)}function d(e){e&&(c(),o+=e)}function f(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void d(r);var o,h=t.getAttribute("cm-marker");if(h){var p=e.findMarks(ct(n,0),ct(i+1,0),u(+h));return void(p.length&&(o=p[0].find(0))&&d(nt(e.doc,o.from,o.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&c();for(var g=0;g<t.childNodes.length;g++)f(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),m&&(a=!0)}else 3==t.nodeType&&d(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;f(t),t!=r;)t=t.nextSibling,s=!1;return o}function ss(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return as(e.clipPos(ct(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 us(o,t,r)}}function us(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!O(n,t))return as(ct(at(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?ee(e.rest):e.line;return as(ct(at(o),o.text.length),i)}var a=3==t.nodeType?t:null,l=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,r&&(r=a.nodeValue.length));l.parentNode!=n;)l=l.parentNode;var s=e.measure,u=s.maps;function c(t,r,n){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?s.map:u[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==r){var c=at(i<0?e.line:e.rest[i]),d=o[a]+n;return(n<0||l!=t)&&(d=o[a+(n?1:0)]),ct(c,d)}}}var d=c(a,l,r);if(d)return as(d,i);for(var f=l.nextSibling,h=a?a.nodeValue.length-r:0;f;f=f.nextSibling){if(d=c(f,f.firstChild,0))return as(ct(d.line,d.ch-h),i);h+=f.textContent.length}for(var p=l.previousSibling,m=r;p;p=p.previousSibling){if(d=c(p,p.firstChild,-1))return as(ct(d.line,d.ch+m),i);m+=p.textContent.length}}ns.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;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!Ce(n,e)){if(n.somethingSelected())Kl({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=Ql(n);Kl({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation((function(){n.setSelections(t.ranges,0,$),n.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Ul.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var l=Zl(),s=l.firstChild;Jl(s),n.display.lineSpace.insertBefore(l,n.display.lineSpace.firstChild),s.value=Ul.text.join("\n");var u=N(H(i));B(s),setTimeout((function(){n.display.lineSpace.removeChild(l),u.focus(),u==i&&r.showPrimarySelection()}),50)}}i.contentEditable=!0,Jl(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),xe(i,"paste",(function(e){!o(e)||Ce(n,e)||Xl(e,n)||l<=11&&setTimeout(Ii(n,(function(){return t.updateFromDOM()})),20)})),xe(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),xe(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),xe(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),xe(i,"touchstart",(function(){return r.forceCompositionEnd()})),xe(i,"input",(function(){t.composing||t.readFromDOMSoon()})),xe(i,"copy",a),xe(i,"cut",a)},ns.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ns.prototype.prepareSelection=function(){var e=Xn(this.cm,!1);return e.focus=N(H(this.div))==this.div,e},ns.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ns.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ns.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=ss(t,e.anchorNode,e.anchorOffset),l=ss(t,e.focusNode,e.focusOffset);if(!a||a.bad||!l||l.bad||0!=dt(mt(a,l),i)||0!=dt(pt(a,l),o)){var s=t.display.view,u=i.line>=t.display.viewFrom&&is(t,i)||{node:s[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&is(t,o);if(!c){var d=s[s.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(u&&c){var h,p=e.rangeCount&&e.getRangeAt(0);try{h=L(u.node,u.offset,c.offset,c.node)}catch(e){}h&&(!r&&t.state.focused?(e.collapse(u.node,u.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),p&&null==e.anchorNode?e.addRange(p):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},ns.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)},ns.prototype.showMultipleSelections=function(e){D(this.cm.display.cursorDiv,e.cursors),D(this.cm.display.selectionDiv,e.selection)},ns.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ns.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},ns.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&N(H(this.div))==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},ns.prototype.blur=function(){this.div.blur()},ns.prototype.getField=function(){return this.div},ns.prototype.supportsTouch=function(){return!0},ns.prototype.receivedFocus=function(){var e=this,t=this;function r(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,r))}this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):Bi(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,r)},ns.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ns.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&c&&this.cm.display.gutterSpecs.length&&os(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=ss(t,e.anchorNode,e.anchorOffset),n=ss(t,e.focusNode,e.focusOffset);r&&n&&Bi(t,(function(){Ko(t.doc,ho(r,n),$),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},ns.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=ct(a.line-1,rt(n.doc,a.line-1).length)),l.ch==rt(n.doc,l.line).text.length&&l.line<n.lastLine()&&(l=ct(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=_n(n,a.line))?(t=at(i.view[0].line),r=i.view[0].node):(t=at(i.view[e].line),r=i.view[e-1].node.nextSibling);var s,u,c=_n(n,l.line);if(c==i.view.length-1?(s=i.viewTo-1,u=i.lineDiv.lastChild):(s=at(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1;for(var d=n.doc.splitLines(ls(n,r,u,t,s)),f=nt(n.doc,ct(t,0),ct(s,rt(n.doc,s).text.length));d.length>1&&f.length>1;)if(ee(d)==ee(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var y=ee(d),x=ee(f),b=Math.min(y.length-(1==d.length?h:0),x.length-(1==f.length?h:0));p<b&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)++p;if(1==d.length&&1==f.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)h--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var k=ct(t,h),w=ct(s,f.length?ee(f).length-p:0);return d.length>1||d[0]||dt(k,w)?(ua(n.doc,d,k,w,"+input"),!0):void 0},ns.prototype.ensurePolled=function(){this.forceCompositionEnd()},ns.prototype.reset=function(){this.forceCompositionEnd()},ns.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ns.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))},ns.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Bi(this.cm,(function(){return Rn(e.cm)}))},ns.prototype.setUneditable=function(e){e.contentEditable="false"},ns.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ii(this.cm,$l)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},ns.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},ns.prototype.onContextMenu=function(){},ns.prototype.resetPosition=function(){},ns.prototype.needsContentAttribute=!0;var cs=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new G,this.hasSelection=!1,this.composing=null,this.resetting=!1};function ds(e,t){if((t=t?R(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(H(e));t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=l.getValue()}var i;if(e.form&&(xe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(ke(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var l=Rl((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l}function fs(e){e.off=ke,e.on=xe,e.wheelEventPixels=lo,e.Doc=Aa,e.splitLines=He,e.countColumn=q,e.findColumn=Q,e.isWordChar=ae,e.Pass=K,e.signal=we,e.Line=hr,e.changeEnd=po,e.scrollbarModel=Mi,e.Pos=ct,e.cmpPos=dt,e.modes=Ge,e.mimeModes=Ve,e.resolveMode=$e,e.getMode=Xe,e.modeExtensions=Ye,e.extendMode=Qe,e.copyState=Je,e.startState=et,e.innerMode=Ze,e.commands=rl,e.keyMap=qa,e.keyName=Xa,e.isModifierKey=Ka,e.lookupKey=Ua,e.normalizeKeyMap=Va,e.StringStream=tt,e.SharedTextMarker=wa,e.TextMarker=ba,e.LineWidget=ga,e.e_preventDefault=Te,e.e_stopPropagation=Ae,e.e_stop=Fe,e.addClass=z,e.contains=O,e.rmClass=T,e.keyNames=Ha}cs.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!Ce(n,e)){if(n.somethingSelected())Kl({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Ql(n);Kl({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,$):(r.prevInput="",i.value=t.text.join("\n"),B(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),xe(i,"input",(function(){a&&l>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),xe(i,"paste",(function(e){Ce(n,e)||Xl(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),xe(i,"cut",o),xe(i,"copy",o),xe(e.scroller,"paste",(function(t){if(!$r(e,t)&&!Ce(n,t)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),xe(e.lineSpace,"selectstart",(function(t){$r(e,t)||Te(t)})),xe(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"})}})),xe(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},cs.prototype.createField=function(e){this.wrapper=Zl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Jl(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},cs.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},cs.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Xn(e);if(e.options.moveInputWithCursor){var i=Sn(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},cs.prototype.showSelection=function(e){var t=this.cm.display;D(t.cursorDiv,e.cursors),D(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},cs.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&B(this.textarea),a&&l>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",a&&l>=9&&(this.hasSelection=null));this.resetting=!1}},cs.prototype.getField=function(){return this.textarea},cs.prototype.supportsTouch=function(){return!1},cs.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||N(H(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},cs.prototype.blur=function(){this.textarea.blur()},cs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},cs.prototype.receivedFocus=function(){this.slowPoll()},cs.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},cs.prototype.fastPoll=function(){var e=!1,t=this;function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}t.pollingFast=!0,t.polling.set(20,r)},cs.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||je(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(a&&l>=9&&this.hasSelection===i||x&&/[\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 s=0,u=Math.min(n.length,i.length);s<u&&n.charCodeAt(s)==i.charCodeAt(s);)++s;return Bi(t,(function(){$l(t,i.slice(s),n.length-s,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},cs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},cs.prototype.onKeyPress=function(){a&&l>=9&&(this.hasSelection=null),this.fastPoll()},cs.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=jn(r,e),u=n.scroller.scrollTop;if(o&&!f){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&Ii(r,Ko)(r.doc,ho(o),$);var c,d=i.style.cssText,h=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(c=i.ownerDocument.defaultView.scrollY),n.input.focus(),s&&i.ownerDocument.defaultView.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),a&&l>=9&&g(),S){Fe(e);var m=function(){ke(window,"mouseup",m),setTimeout(v,20)};xe(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=r.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=d,a&&l<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&l<9)&&g();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Ii(r,ta)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},cs.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},cs.prototype.setUneditable=function(){},cs.prototype.needsContentAttribute=!1,Hl(Rl),es(Rl);var hs="iter insert remove copy getEditor constructor".split(" ");for(var ps in Aa.prototype)Aa.prototype.hasOwnProperty(ps)&&V(hs,ps)<0&&(Rl.prototype[ps]=function(e){return function(){return e.apply(this.doc,arguments)}}(Aa.prototype[ps]));return Le(Aa),Rl.inputStyles={textarea:cs,contenteditable:ns},Rl.defineMode=function(e){Rl.defaults.mode||"null"==e||(Rl.defaults.mode=e),Ue.apply(this,arguments)},Rl.defineMIME=Ke,Rl.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Rl.defineMIME("text/plain","null"),Rl.defineExtension=function(e,t){Rl.prototype[e]=t},Rl.defineDocExtension=function(e,t){Aa.prototype[e]=t},Rl.fromTextArea=ds,fs(Rl),Rl.version="5.65.16",Rl}()}(o);var a=o.exports;!function(e){function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}e.defineMode("css",(function(t,r){var n=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var i,o,a=t.indentUnit,l=r.tokenHooks,s=r.documentTypes||{},u=r.mediaTypes||{},c=r.mediaFeatures||{},d=r.mediaValueKeywords||{},f=r.propertyKeywords||{},h=r.nonStandardPropertyKeywords||{},p=r.fontProperties||{},m=r.counterDescriptors||{},g=r.colorKeywords||{},v=r.valueKeywords||{},y=r.allowNested,x=r.lineComment,b=!0===r.supportsAtComponent,k=!1!==t.highlightNonStandardPropertyKeywords;function w(e,t){return i=t,e}function C(e,t){var r=e.next();if(l[r]){var n=l[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),w("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?w(null,"compare"):'"'==r||"'"==r?(t.tokenize=S(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),w("atom","hash")):"!"==r?(e.match(/^\s*\w*/),w("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),w("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?w(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?w(null,r):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=M),w("variable callee","variable")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),w("property","word")):w(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),w("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?w("variable-2","variable-definition"):w("variable-2","variable")):e.match(/^\w+-/)?w("meta","meta"):void 0}function S(e){return function(t,r){for(var n,i=!1;null!=(n=t.next());){if(n==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==n}return(n==e||!i&&")"!=e)&&(r.tokenize=null),w("string","string")}}function M(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=S(")"),w(null,"(")}function L(e,t,r){this.type=e,this.indent=t,this.prev=r}function T(e,t,r,n){return e.context=new L(r,t.indentation()+(!1===n?0:a),e.context),r}function A(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function D(e,t,r){return O[r.context.type](e,t,r)}function F(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return D(e,t,r)}function E(e){var t=e.current().toLowerCase();o=v.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var O={top:function(e,t,r){if("{"==e)return T(r,t,"block");if("}"==e&&r.context.prev)return A(r);if(b&&/@component/i.test(e))return T(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return T(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return T(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return T(r,t,"at");if("hash"==e)o="builtin";else if("word"==e)o="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return T(r,t,"interpolation");if(":"==e)return"pseudo";if(y&&"("==e)return T(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return f.hasOwnProperty(n)?(o="property","maybeprop"):h.hasOwnProperty(n)?(o=k?"string-2":"property","maybeprop"):y?(o=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==e?"block":y||"hash"!=e&&"qualifier"!=e?O.top(e,t,r):(o="error","block")},maybeprop:function(e,t,r){return":"==e?T(r,t,"prop"):D(e,t,r)},prop:function(e,t,r){if(";"==e)return A(r);if("{"==e&&y)return T(r,t,"propBlock");if("}"==e||"{"==e)return F(e,t,r);if("("==e)return T(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current())){if("word"==e)E(t);else if("interpolation"==e)return T(r,t,"interpolation")}else o+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?A(r):"word"==e?(o="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?F(e,t,r):")"==e?A(r):"("==e?T(r,t,"parens"):"interpolation"==e?T(r,t,"interpolation"):("word"==e&&E(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(o="variable-3",r.context.type):D(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&s.hasOwnProperty(t.current())?(o="tag",r.context.type):O.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return T(r,t,"atBlock_parens");if("}"==e||";"==e)return F(e,t,r);if("{"==e)return A(r)&&T(r,t,y?"block":"top");if("interpolation"==e)return T(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();o="only"==n||"not"==n||"and"==n||"or"==n?"keyword":u.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":d.hasOwnProperty(n)?"keyword":f.hasOwnProperty(n)?"property":h.hasOwnProperty(n)?k?"string-2":"property":v.hasOwnProperty(n)?"atom":g.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?F(e,t,r):"{"==e?A(r)&&T(r,t,y?"block":"top",!1):("word"==e&&(o="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?A(r):"{"==e||"}"==e?F(e,t,r,2):O.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?T(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(o="variable","restricted_atBlock_before"):D(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,A(r)):"word"==e?(o="@font-face"==r.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(o="variable","keyframes"):"{"==e?T(r,t,"top"):D(e,t,r)},at:function(e,t,r){return";"==e?A(r):"{"==e||"}"==e?F(e,t,r):("word"==e?o="tag":"hash"==e&&(o="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?A(r):"{"==e||";"==e?F(e,t,r):("word"==e?o="variable":"variable"!=e&&"("!=e&&")"!=e&&(o="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:n?"block":"top",stateArg:null,context:new L(n?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||C)(e,t);return r&&"object"==typeof r&&(i=r[1],r=r[0]),o=r,"comment"!=i&&(t.state=O[t.state](i,e,t)),o},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-a)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:x,fold:"brace"}}));var r=["domain","regexp","url","url-prefix"],n=t(r),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],l=t(a),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],u=t(s),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(c),f=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],h=t(f),p=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(g),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],x=t(y),b=r.concat(i).concat(a).concat(s).concat(c).concat(f).concat(g).concat(y);function k(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}e.registerHelper("hintWords","css",b),e.defineMIME("text/css",{documentTypes:n,mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:p,counterDescriptors:m,colorKeywords:v,valueKeywords:x,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:x,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:x,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:n,mediaTypes:o,mediaFeatures:l,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:p,counterDescriptors:m,colorKeywords:v,valueKeywords:x,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css",helperType:"gss"})}(o.exports),function(e){e.defineMode("ecl",(function(e){function t(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function r(e,t){return!!t.startOfLine&&(e.skipToEnd(),"meta")}var n,i=e.indentUnit,o=t("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"),a=t("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"),l=t("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"),s=t("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"),u=t("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"),c=t("catch class do else finally for if switch try while"),d=t("true false null"),f={"#":r},h=/[+\-*&%=<>!?|\/]/;function p(e,t){var r=e.next();if(f[r]){var i=f[r](e,t);if(!1!==i)return i}if('"'==r||"'"==r)return t.tokenize=m(r),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(r))return n=r,null;if(/\d/.test(r))return e.eatWhile(/[\w\.]/),"number";if("/"==r){if(e.eat("*"))return t.tokenize=g,g(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(h.test(r))return e.eatWhile(h),"operator";e.eatWhile(/[\w\$_]/);var p=e.current().toLowerCase();if(o.propertyIsEnumerable(p))return c.propertyIsEnumerable(p)&&(n="newstatement"),"keyword";if(a.propertyIsEnumerable(p))return c.propertyIsEnumerable(p)&&(n="newstatement"),"variable";if(l.propertyIsEnumerable(p))return c.propertyIsEnumerable(p)&&(n="newstatement"),"variable-2";if(s.propertyIsEnumerable(p))return c.propertyIsEnumerable(p)&&(n="newstatement"),"variable-3";if(u.propertyIsEnumerable(p))return c.propertyIsEnumerable(p)&&(n="newstatement"),"builtin";for(var v=p.length-1;v>=0&&(!isNaN(p[v])||"_"==p[v]);)--v;if(v>0){var y=p.substr(0,v+1);if(s.propertyIsEnumerable(y))return c.propertyIsEnumerable(y)&&(n="newstatement"),"variable-3"}return d.propertyIsEnumerable(p)?"atom":null}function m(e){return function(t,r){for(var n,i=!1,o=!1;null!=(n=t.next());){if(n==e&&!i){o=!0;break}i=!i&&"\\"==n}return!o&&i||(r.tokenize=p),"string"}}function g(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=p;break}n="*"==r}return"comment"}function v(e,t,r,n,i){this.indented=e,this.column=t,this.type=r,this.align=n,this.prev=i}function y(e,t,r){return e.context=new v(e.indented,t,r,null,e.context)}function x(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}return{startState:function(e){return{tokenize:null,context:new v((e||0)-i,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;n=null;var i=(t.tokenize||p)(e,t);if("comment"==i||"meta"==i)return i;if(null==r.align&&(r.align=!0),";"!=n&&":"!=n||"statement"!=r.type)if("{"==n)y(t,e.column(),"}");else if("["==n)y(t,e.column(),"]");else if("("==n)y(t,e.column(),")");else if("}"==n){for(;"statement"==r.type;)r=x(t);for("}"==r.type&&(r=x(t));"statement"==r.type;)r=x(t)}else n==r.type?x(t):("}"==r.type||"top"==r.type||"statement"==r.type&&"newstatement"==n)&&y(t,e.column(),"statement");else x(t);return t.startOfLine=!1,i},indent:function(e,t){if(e.tokenize!=p&&null!=e.tokenize)return 0;var r=e.context,n=t&&t.charAt(0);"statement"==r.type&&"}"==n&&(r=r.prev);var o=n==r.type;return"statement"==r.type?r.indented+("{"==n?0:i):r.align?r.column+(o?0:1):r.indented+(o?0:i)},electricChars:"{}"}})),e.defineMIME("text/x-ecl","ecl")}(o.exports);!function(e){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(n,i){var o,a,l=n.indentUnit,s={},u=i.htmlMode?t:r;for(var c in u)s[c]=u[c];for(var c in i)s[c]=i[c];function d(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();return"<"==n?e.eat("!")?e.eat("[")?e.match("CDATA[")?r(p("atom","]]>")):null:e.match("--")?r(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(m(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==n?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=d,o=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return o="equals",null;if("<"==r){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=h(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=f;break}return"string"};return t.isInAttribute=!0,t}function p(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=d;break}r.next()}return e}}function m(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=m(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=d;break}return r.tokenize=m(e-1),r.tokenize(t,r)}}return"meta"}}function g(e){return e&&e.toLowerCase()}function v(e,t,r){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=r,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function y(e){e.context&&(e.context=e.context.prev)}function x(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!s.contextGrabbers.hasOwnProperty(g(r))||!s.contextGrabbers[g(r)].hasOwnProperty(g(t)))return;y(e)}}function b(e,t,r){return"openTag"==e?(r.tagStart=t.column(),k):"closeTag"==e?w:b}function k(e,t,r){return"word"==e?(r.tagName=t.current(),a="tag",M):s.allowMissingTagName&&"endTag"==e?(a="tag bracket",M(e,t,r)):(a="error",k)}function w(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&s.implicitlyClosed.hasOwnProperty(g(r.context.tagName))&&y(r),r.context&&r.context.tagName==n||!1===s.matchClosing?(a="tag",C):(a="tag error",S)}return s.allowMissingTagName&&"endTag"==e?(a="tag bracket",C(e,t,r)):(a="error",S)}function C(e,t,r){return"endTag"!=e?(a="error",C):(y(r),b)}function S(e,t,r){return a="error",C(e,t,r)}function M(e,t,r){if("word"==e)return a="attribute",L;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(g(n))?x(r,n):(x(r,n),r.context=new v(r,n,i==r.indented)),b}return a="error",M}function L(e,t,r){return"equals"==e?T:(s.allowMissing||(a="error"),M(e,t,r))}function T(e,t,r){return"string"==e?A:"word"==e&&s.allowUnquoted?(a="string",M):(a="error",M(e,t,r))}function A(e,t,r){return"string"==e?A:M(e,t,r)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var r=t.tokenize(e,t);return(r||o)&&"comment"!=r&&(a=null,t.state=t.state(o||r,e,t),a&&(r="error"==a?r+" error":a)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+l;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==s.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+l*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var o=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!s.implicitlyClosed.hasOwnProperty(g(i.tagName)))break;i=i.prev}else if(o)for(;i;){var a=s.contextGrabbers[g(i.tagName)];if(!a||!a.hasOwnProperty(g(o[2])))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+l:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==T&&(e.state=M)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],r=e.context;r;r=r.prev)t.push(r.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(o.exports);!function(e){e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var t=0;t<e.modeInfo.length;t++){var r=e.modeInfo[t];r.mimes&&(r.mime=r.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.mime==t)return n;if(n.mimes)for(var i=0;i<n.mimes.length;i++)if(n.mimes[i]==t)return n}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.ext)for(var i=0;i<n.ext.length;i++)if(n.ext[i]==t)return n}},e.findModeByFileName=function(t){for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.file&&n.file.test(t))return n}var i=t.lastIndexOf("."),o=i>-1&&t.substring(i+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var r=0;r<e.modeInfo.length;r++){var n=e.modeInfo[r];if(n.name.toLowerCase()==t)return n;if(n.alias)for(var i=0;i<n.alias.length;i++)if(n.alias[i].toLowerCase()==t)return n}}}(o.exports),function(e){e.defineMode("markdown",(function(t,r){var n=e.getMode(t,"text/html"),i="null"==n.name;function o(r){if(e.findModeByName){var n=e.findModeByName(r);n&&(r=n.mime||n.mimes[0])}var i=e.getMode(t,r);return"null"==i.name?null:i}void 0===r.highlightFormatting&&(r.highlightFormatting=!1),void 0===r.maxBlockquoteDepth&&(r.maxBlockquoteDepth=0),void 0===r.taskLists&&(r.taskLists=!1),void 0===r.strikethrough&&(r.strikethrough=!1),void 0===r.emoji&&(r.emoji=!1),void 0===r.fencedCodeBlockHighlighting&&(r.fencedCodeBlockHighlighting=!0),void 0===r.fencedCodeBlockDefaultMode&&(r.fencedCodeBlockDefaultMode="text/plain"),void 0===r.xml&&(r.xml=!0),void 0===r.tokenTypeOverrides&&(r.tokenTypeOverrides={});var a={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var l in a)a.hasOwnProperty(l)&&r.tokenTypeOverrides[l]&&(a[l]=r.tokenTypeOverrides[l]);var s=/^([*\-_])(?:\s*\1){2,}\s*$/,u=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,d=r.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,f=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,m=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,v=" ";function y(e,t,r){return t.f=t.inline=r,r(e,t)}function x(e,t,r){return t.f=t.block=r,r(e,t)}function b(e){return!e||!/\S/.test(e.string)}function k(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==C){var r=i;if(!r){var o=e.innerMode(n,t.htmlState);r="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}r&&(t.f=T,t.block=w,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function w(t,n){var i=t.column()===n.indentation,l=b(n.prevLine.stream),h=n.indentedCode,g=n.prevLine.hr,v=!1!==n.list,x=(n.listStack[n.listStack.length-1]||0)+3;n.indentedCode=!1;var k=n.indentation;if(null===n.indentationDiff&&(n.indentationDiff=n.indentation,v)){for(n.list=null;k<n.listStack[n.listStack.length-1];)n.listStack.pop(),n.listStack.length?n.indentation=n.listStack[n.listStack.length-1]:n.list=!1;!1!==n.list&&(n.indentationDiff=k-n.listStack[n.listStack.length-1])}var w=!(l||g||n.prevLine.header||v&&h||n.prevLine.fencedCodeEnd),C=(!1===n.list||g||l)&&n.indentation<=x&&t.match(s),L=null;if(n.indentationDiff>=4&&(h||n.prevLine.fencedCodeEnd||n.prevLine.header||l))return t.skipToEnd(),n.indentedCode=!0,a.code;if(t.eatSpace())return null;if(i&&n.indentation<=x&&(L=t.match(d))&&L[1].length<=6)return n.quote=0,n.header=L[1].length,n.thisLine.header=!0,r.highlightFormatting&&(n.formatting="header"),n.f=n.inline,M(n);if(n.indentation<=x&&t.eat(">"))return n.quote=i?1:n.quote+1,r.highlightFormatting&&(n.formatting="quote"),t.eatSpace(),M(n);if(!C&&!n.setext&&i&&n.indentation<=x&&(L=t.match(u))){var T=L[1]?"ol":"ul";return n.indentation=k+t.current().length,n.list=!0,n.quote=0,n.listStack.push(n.indentation),n.em=!1,n.strong=!1,n.code=!1,n.strikethrough=!1,r.taskLists&&t.match(c,!1)&&(n.taskList=!0),n.f=n.inline,r.highlightFormatting&&(n.formatting=["list","list-"+T]),M(n)}return i&&n.indentation<=x&&(L=t.match(p,!0))?(n.quote=0,n.fencedEndRE=new RegExp(L[1]+"+ *$"),n.localMode=r.fencedCodeBlockHighlighting&&o(L[2]||r.fencedCodeBlockDefaultMode),n.localMode&&(n.localState=e.startState(n.localMode)),n.f=n.block=S,r.highlightFormatting&&(n.formatting="code-block"),n.code=-1,M(n)):n.setext||!(w&&v||n.quote||!1!==n.list||n.code||C||m.test(t.string))&&(L=t.lookAhead(1))&&(L=L.match(f))?(n.setext?(n.header=n.setext,n.setext=0,t.skipToEnd(),r.highlightFormatting&&(n.formatting="header")):(n.header="="==L[0].charAt(0)?1:2,n.setext=n.header),n.thisLine.header=!0,n.f=n.inline,M(n)):C?(t.skipToEnd(),n.hr=!0,n.thisLine.hr=!0,a.hr):"["===t.peek()?y(t,n,O):y(t,n,n.inline)}function C(t,r){var o=n.token(t,r.htmlState);if(!i){var a=e.innerMode(n,r.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||r.md_inside&&t.current().indexOf(">")>-1)&&(r.f=T,r.block=w,r.htmlState=null)}return o}function S(e,t){var n,i=t.listStack[t.listStack.length-1]||0,o=t.indentation<i,l=i+3;return t.fencedEndRE&&t.indentation<=l&&(o||e.match(t.fencedEndRE))?(r.highlightFormatting&&(t.formatting="code-block"),o||(n=M(t)),t.localMode=t.localState=null,t.block=w,t.f=T,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,o?x(e,t,t.block):n):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),a.code)}function M(e){var t=[];if(e.formatting){t.push(a.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var n=0;n<e.formatting.length;n++)t.push(a.formatting+"-"+e.formatting[n]),"header"===e.formatting[n]&&t.push(a.formatting+"-"+e.formatting[n]+"-"+e.header),"quote"===e.formatting[n]&&(!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=e.quote?t.push(a.formatting+"-"+e.formatting[n]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(a.linkHref,"url"):(e.strong&&t.push(a.strong),e.em&&t.push(a.em),e.strikethrough&&t.push(a.strikethrough),e.emoji&&t.push(a.emoji),e.linkText&&t.push(a.linkText),e.code&&t.push(a.code),e.image&&t.push(a.image),e.imageAltText&&t.push(a.imageAltText,"link"),e.imageMarker&&t.push(a.imageMarker)),e.header&&t.push(a.header,a.header+"-"+e.header),e.quote&&(t.push(a.quote),!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=e.quote?t.push(a.quote+"-"+e.quote):t.push(a.quote+"-"+r.maxBlockquoteDepth)),!1!==e.list){var i=(e.listStack.length-1)%3;i?1===i?t.push(a.list2):t.push(a.list3):t.push(a.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function L(e,t){if(e.match(h,!0))return M(t)}function T(t,i){var o=i.text(t,i);if(void 0!==o)return o;if(i.list)return i.list=null,M(i);if(i.taskList)return" "===t.match(c,!0)[1]?i.taskOpen=!0:i.taskClosed=!0,r.highlightFormatting&&(i.formatting="task"),i.taskList=!1,M(i);if(i.taskOpen=!1,i.taskClosed=!1,i.header&&t.match(/^#+$/,!0))return r.highlightFormatting&&(i.formatting="header"),M(i);var l=t.next();if(i.linkTitle){i.linkTitle=!1;var s=l;"("===l&&(s=")");var u="^\\s*(?:[^"+(s=(s+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+s;if(t.match(new RegExp(u),!0))return a.linkHref}if("`"===l){var d=i.formatting;r.highlightFormatting&&(i.formatting="code"),t.eatWhile("`");var f=t.current().length;if(0!=i.code||i.quote&&1!=f){if(f==i.code){var h=M(i);return i.code=0,h}return i.formatting=d,M(i)}return i.code=f,M(i)}if(i.code)return M(i);if("\\"===l&&(t.next(),r.highlightFormatting)){var p=M(i),m=a.formatting+"-escape";return p?p+" "+m:m}if("!"===l&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,r.highlightFormatting&&(i.formatting="image"),M(i);if("["===l&&i.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,r.highlightFormatting&&(i.formatting="image"),M(i);if("]"===l&&i.imageAltText){r.highlightFormatting&&(i.formatting="image");var p=M(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=D,p}if("["===l&&!i.image)return i.linkText&&t.match(/^.*?\]/)||(i.linkText=!0,r.highlightFormatting&&(i.formatting="link")),M(i);if("]"===l&&i.linkText){r.highlightFormatting&&(i.formatting="link");var p=M(i);return i.linkText=!1,i.inline=i.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?D:T,p}if("<"===l&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=A,r.highlightFormatting&&(i.formatting="link"),(p=M(i))?p+=" ":p="",p+a.linkInline;if("<"===l&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=A,r.highlightFormatting&&(i.formatting="link"),(p=M(i))?p+=" ":p="",p+a.linkEmail;if(r.xml&&"<"===l&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var v=t.string.indexOf(">",t.pos);if(-1!=v){var y=t.string.substring(t.start,v);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(y)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(n),x(t,i,C)}if(r.xml&&"<"===l&&t.match(/^\/\w*?>/))return i.md_inside=!1,"tag";if("*"===l||"_"===l){for(var b=1,k=1==t.pos?" ":t.string.charAt(t.pos-2);b<3&&t.eat(l);)b++;var w=t.peek()||" ",S=!/\s/.test(w)&&(!g.test(w)||/\s/.test(k)||g.test(k)),L=!/\s/.test(k)&&(!g.test(k)||/\s/.test(w)||g.test(w)),F=null,E=null;if(b%2&&(i.em||!S||"*"!==l&&L&&!g.test(k)?i.em!=l||!L||"*"!==l&&S&&!g.test(w)||(F=!1):F=!0),b>1&&(i.strong||!S||"*"!==l&&L&&!g.test(k)?i.strong!=l||!L||"*"!==l&&S&&!g.test(w)||(E=!1):E=!0),null!=E||null!=F)return r.highlightFormatting&&(i.formatting=null==F?"strong":null==E?"em":"strong em"),!0===F&&(i.em=l),!0===E&&(i.strong=l),h=M(i),!1===F&&(i.em=!1),!1===E&&(i.strong=!1),h}else if(" "===l&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return M(i);t.backUp(1)}if(r.strikethrough)if("~"===l&&t.eatWhile(l)){if(i.strikethrough)return r.highlightFormatting&&(i.formatting="strikethrough"),h=M(i),i.strikethrough=!1,h;if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,r.highlightFormatting&&(i.formatting="strikethrough"),M(i)}else if(" "===l&&t.match("~~",!0)){if(" "===t.peek())return M(i);t.backUp(2)}if(r.emoji&&":"===l&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){i.emoji=!0,r.highlightFormatting&&(i.formatting="emoji");var O=M(i);return i.emoji=!1,O}return" "===l&&(t.match(/^ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),M(i)}function A(e,t){if(">"===e.next()){t.f=t.inline=T,r.highlightFormatting&&(t.formatting="link");var n=M(t);return n?n+=" ":n="",n+a.linkInline}return e.match(/^[^>]+/,!0),a.linkInline}function D(e,t){if(e.eatSpace())return null;var n=e.next();return"("===n||"["===n?(t.f=t.inline=E("("===n?")":"]"),r.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,M(t)):"error"}var F={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(e){return function(t,n){if(t.next()===e){n.f=n.inline=T,r.highlightFormatting&&(n.formatting="link-string");var i=M(n);return n.linkHref=!1,i}return t.match(F[e]),n.linkHref=!0,M(n)}}function O(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=N,e.next(),r.highlightFormatting&&(t.formatting="link"),t.linkText=!0,M(t)):y(e,t,T)}function N(e,t){if(e.match("]:",!0)){t.f=t.inline=z,r.highlightFormatting&&(t.formatting="link");var n=M(t);return t.linkText=!1,n}return e.match(/^([^\]\\]|\\.)+/,!0),a.linkText}function z(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),t.f=t.inline=T,a.linkHref+" url")}var P={startState:function(){return{f:w,prevLine:{stream:null},thisLine:{stream:null},block:w,htmlState:null,indentation:0,inline:T,text:L,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(n,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return k(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=C)){var r=e.match(/^\s*/,!0)[0].replace(/\t/g,v).length;if(t.indentation=r,t.indentationDiff=null,r>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==C?{state:e.htmlState,mode:n}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:P}},indent:function(t,r,i){return t.block==C&&n.indent?n.indent(t.htmlState,r,i):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,r,i):e.Pass},blankLine:k,getType:M,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return P}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(o.exports);!function(e){e.overlayMode=function(t,r,n){return{startState:function(){return{base:e.startState(t),overlay:e.startState(r),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(n){return{base:e.copyState(t,n.base),overlay:e.copyState(r,n.overlay),basePos:n.basePos,baseCur:null,overlayPos:n.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=r.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||n&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,r,n){return t.indent(e.base,r,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){var i,o;return t.blankLine&&(i=t.blankLine(e.base)),r.blankLine&&(o=r.blankLine(e.overlay)),null==o?i:n&&null!=i?i+" "+o:o}}}}(o.exports),function(e){var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",(function(r,n){var i=0;function o(e){return e.code=!1,null}var a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,r){if(r.combineTokens=null,r.codeBlock)return e.match(/^```+/)?(r.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(r.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),r.codeBlock=!0,null;if("`"===e.peek()){e.next();var o=e.pos;e.eatWhile("`");var a=1+e.pos-o;return r.code?a===i&&(r.code=!1):(i=a,r.code=!0),null}if(r.code)return e.next(),null;if(e.eatSpace())return r.ateSpace=!0,null;if((e.sol()||r.ateSpace)&&(r.ateSpace=!1,!1!==n.gitHubSpice)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return r.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return r.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(r.combineTokens=!0,"link"):(e.next(),null)},blankLine:o},l={taskLists:!0,strikethrough:!0,emoji:!0};for(var s in n)l[s]=n[s];return l.name="markdown",e.overlayMode(e.getMode(r,l),a)}),"markdown"),e.defineMIME("text/x-gfm","gfm")}(o.exports);function l(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}!function(e){e.defineMode("javascript",(function(t,r){var n,i,o=t.indentUnit,a=r.statementIndent,l=r.jsonld,s=r.json||l,u=!1!==r.trackScope,c=r.typescript,d=r.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),h=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function g(e,t,r){return n=e,i=r,t}function v(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=y(r),t.tokenize(e,t);if("."==r&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==r&&e.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return g(r);if("="==r&&e.eat(">"))return g("=>","operator");if("0"==r&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(r))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");if("/"==r)return e.eat("*")?(t.tokenize=x,x(e,t)):e.eat("/")?(e.skipToEnd(),g("comment","comment")):it(e,t,1)?(m(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(e.eat("="),g("operator","operator",e.current()));if("`"==r)return t.tokenize=b,b(e,t);if("#"==r&&"!"==e.peek())return e.skipToEnd(),g("meta","meta");if("#"==r&&e.eatWhile(d))return g("variable","property");if("<"==r&&e.match("!--")||"-"==r&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),g("comment","comment");if(h.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-|&?]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),"?"==r&&e.eat(".")?g("."):g("operator","operator",e.current());if(d.test(r)){e.eatWhile(d);var n=e.current();if("."!=t.lastType){if(f.propertyIsEnumerable(n)){var i=f[n];return g(i.type,i.style,n)}if("async"==n&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",n)}return g("variable","variable",n)}}function y(e){return function(t,r){var n,i=!1;if(l&&"@"==t.peek()&&t.match(p))return r.tokenize=v,g("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=v),g("string","string")}}function x(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=v;break}n="*"==r}return g("comment","comment")}function b(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=v;break}n=!n&&"\\"==r}return g("quasi","string-2",e.current())}var k="([{}])";function w(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(c){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),s=k.indexOf(l);if(s>=0&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(d.test(l))o=!0;else if(/["'\/`]/.test(l))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==l&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function S(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function M(e,t){if(!u)return!1;for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}function L(e,t,r,n,i){var o=e.cc;for(T.state=e,T.stream=i,T.marked=null,T.cc=o,T.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?V:q)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return T.marked?T.marked:"variable"==r&&M(e,n)?"variable-2":t}}var T={state:null,column:null,marked:null,cc:null};function A(){for(var e=arguments.length-1;e>=0;e--)T.cc.push(arguments[e])}function D(){return A.apply(null,arguments),!0}function F(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function E(e){var t=T.state;if(T.marked="def",u){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=O(e,t.context);if(null!=n)return void(t.context=n)}else if(!F(e,t.localVars))return void(t.localVars=new P(e,t.localVars));r.globalVars&&!F(e,t.globalVars)&&(t.globalVars=new P(e,t.globalVars))}}function O(e,t){if(t){if(t.block){var r=O(e,t.prev);return r?r==t.prev?t:new z(r,t.vars,!0):null}return F(e,t.vars)?t:new z(t.prev,new P(e,t.vars),!1)}return null}function N(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function z(e,t,r){this.prev=e,this.vars=t,this.block=r}function P(e,t){this.name=e,this.next=t}var B=new P("this",new P("arguments",null));function I(){T.state.context=new z(T.state.context,T.state.localVars,!1),T.state.localVars=B}function W(){T.state.context=new z(T.state.context,T.state.localVars,!0),T.state.localVars=null}function H(){T.state.localVars=T.state.context.vars,T.state.context=T.state.context.prev}function j(e,t){var r=function(){var r=T.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new S(n,T.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function _(){var e=T.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function R(e){function t(r){return r==e?D():";"==e||"}"==r||")"==r||"]"==r?A():D(t)}return t}function q(e,t){return"var"==e?D(j("vardef",t),Ae,R(";"),_):"keyword a"==e?D(j("form"),K,q,_):"keyword b"==e?D(j("form"),q,_):"keyword d"==e?T.stream.match(/^\s*$/,!1)?D():D(j("stat"),X,R(";"),_):"debugger"==e?D(R(";")):"{"==e?D(j("}"),W,fe,_,H):";"==e?D():"if"==e?("else"==T.state.lexical.info&&T.state.cc[T.state.cc.length-1]==_&&T.state.cc.pop()(),D(j("form"),K,q,_,ze)):"function"==e?D(We):"for"==e?D(j("form"),W,Pe,q,H,_):"class"==e||c&&"interface"==t?(T.marked="keyword",D(j("form","class"==e?e:t),qe,_)):"variable"==e?c&&"declare"==t?(T.marked="keyword",D(q)):c&&("module"==t||"enum"==t||"type"==t)&&T.stream.match(/^\s*\w/,!1)?(T.marked="keyword","enum"==t?D(tt):"type"==t?D(je,R("operator"),ve,R(";")):D(j("form"),De,R("{"),j("}"),fe,_,_)):c&&"namespace"==t?(T.marked="keyword",D(j("form"),V,q,_)):c&&"abstract"==t?(T.marked="keyword",D(q)):D(j("stat"),oe):"switch"==e?D(j("form"),K,R("{"),j("}","switch"),W,fe,_,_,H):"case"==e?D(V,R(":")):"default"==e?D(R(":")):"catch"==e?D(j("form"),I,G,q,_,H):"export"==e?D(j("stat"),Ke,_):"import"==e?D(j("stat"),Xe,_):"async"==e?D(q):"@"==t?D(V,q):A(j("stat"),V,R(";"),_)}function G(e){if("("==e)return D(_e,R(")"))}function V(e,t){return $(e,t,!1)}function U(e,t){return $(e,t,!0)}function K(e){return"("!=e?A():D(j(")"),X,R(")"),_)}function $(e,t,r){if(T.state.fatArrowAt==T.stream.start){var n=r?te:ee;if("("==e)return D(I,j(")"),ce(_e,")"),_,R("=>"),n,H);if("variable"==e)return A(I,De,R("=>"),n,H)}var i=r?Q:Y;return C.hasOwnProperty(e)?D(i):"function"==e?D(We,i):"class"==e||c&&"interface"==t?(T.marked="keyword",D(j("form"),Re,_)):"keyword c"==e||"async"==e?D(r?U:V):"("==e?D(j(")"),X,R(")"),_,i):"operator"==e||"spread"==e?D(r?U:V):"["==e?D(j("]"),et,_,i):"{"==e?de(le,"}",null,i):"quasi"==e?A(J,i):"new"==e?D(re(r)):D()}function X(e){return e.match(/[;\}\)\],]/)?A():A(V)}function Y(e,t){return","==e?D(X):Q(e,t,!1)}function Q(e,t,r){var n=0==r?Y:Q,i=0==r?V:U;return"=>"==e?D(I,r?te:ee,H):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?D(n):c&&"<"==t&&T.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?D(j(">"),ce(ve,">"),_,n):"?"==t?D(V,R(":"),i):D(i):"quasi"==e?A(J,n):";"!=e?"("==e?de(U,")","call",n):"."==e?D(ae,n):"["==e?D(j("]"),X,R("]"),_,n):c&&"as"==t?(T.marked="keyword",D(ve,n)):"regexp"==e?(T.state.lastType=T.marked="operator",T.stream.backUp(T.stream.pos-T.stream.start-1),D(i)):void 0:void 0}function J(e,t){return"quasi"!=e?A():"${"!=t.slice(t.length-2)?D(J):D(X,Z)}function Z(e){if("}"==e)return T.marked="string-2",T.state.tokenize=b,D(J)}function ee(e){return w(T.stream,T.state),A("{"==e?q:V)}function te(e){return w(T.stream,T.state),A("{"==e?q:U)}function re(e){return function(t){return"."==t?D(e?ie:ne):"variable"==t&&c?D(Me,e?Q:Y):A(e?U:V)}}function ne(e,t){if("target"==t)return T.marked="keyword",D(Y)}function ie(e,t){if("target"==t)return T.marked="keyword",D(Q)}function oe(e){return":"==e?D(_,q):A(Y,R(";"),_)}function ae(e){if("variable"==e)return T.marked="property",D()}function le(e,t){return"async"==e?(T.marked="property",D(le)):"variable"==e||"keyword"==T.style?(T.marked="property","get"==t||"set"==t?D(se):(c&&T.state.fatArrowAt==T.stream.start&&(r=T.stream.match(/^\s*:\s*/,!1))&&(T.state.fatArrowAt=T.stream.pos+r[0].length),D(ue))):"number"==e||"string"==e?(T.marked=l?"property":T.style+" property",D(ue)):"jsonld-keyword"==e?D(ue):c&&N(t)?(T.marked="keyword",D(le)):"["==e?D(V,he,R("]"),ue):"spread"==e?D(U,ue):"*"==t?(T.marked="keyword",D(le)):":"==e?A(ue):void 0;var r}function se(e){return"variable"!=e?A(ue):(T.marked="property",D(We))}function ue(e){return":"==e?D(U):"("==e?A(We):void 0}function ce(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=T.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),D((function(r,n){return r==t||n==t?A():A(e)}),n)}return i==t||o==t?D():r&&r.indexOf(";")>-1?A(e):D(R(t))}return function(r,i){return r==t||i==t?D():A(e,n)}}function de(e,t,r){for(var n=3;n<arguments.length;n++)T.cc.push(arguments[n]);return D(j(t,r),ce(e,t),_)}function fe(e){return"}"==e?D():A(q,fe)}function he(e,t){if(c){if(":"==e)return D(ve);if("?"==t)return D(he)}}function pe(e,t){if(c&&(":"==e||"in"==t))return D(ve)}function me(e){if(c&&":"==e)return T.stream.match(/^\s*\w+\s+is\b/,!1)?D(V,ge,ve):D(ve)}function ge(e,t){if("is"==t)return T.marked="keyword",D()}function ve(e,t){return"keyof"==t||"typeof"==t||"infer"==t||"readonly"==t?(T.marked="keyword",D("typeof"==t?U:ve)):"variable"==e||"void"==t?(T.marked="type",D(Se)):"|"==t||"&"==t?D(ve):"string"==e||"number"==e||"atom"==e?D(Se):"["==e?D(j("]"),ce(ve,"]",","),_,Se):"{"==e?D(j("}"),xe,_,Se):"("==e?D(ce(Ce,")"),ye,Se):"<"==e?D(ce(ve,">"),ve):"quasi"==e?A(ke,Se):void 0}function ye(e){if("=>"==e)return D(ve)}function xe(e){return e.match(/[\}\)\]]/)?D():","==e||";"==e?D(xe):A(be,xe)}function be(e,t){return"variable"==e||"keyword"==T.style?(T.marked="property",D(be)):"?"==t||"number"==e||"string"==e?D(be):":"==e?D(ve):"["==e?D(R("variable"),pe,R("]"),be):"("==e?A(He,be):e.match(/[;\}\)\],]/)?void 0:D()}function ke(e,t){return"quasi"!=e?A():"${"!=t.slice(t.length-2)?D(ke):D(ve,we)}function we(e){if("}"==e)return T.marked="string-2",T.state.tokenize=b,D(ke)}function Ce(e,t){return"variable"==e&&T.stream.match(/^\s*[?:]/,!1)||"?"==t?D(Ce):":"==e?D(ve):"spread"==e?D(Ce):A(ve)}function Se(e,t){return"<"==t?D(j(">"),ce(ve,">"),_,Se):"|"==t||"."==e||"&"==t?D(ve):"["==e?D(ve,R("]"),Se):"extends"==t||"implements"==t?(T.marked="keyword",D(ve)):"?"==t?D(ve,R(":"),ve):void 0}function Me(e,t){if("<"==t)return D(j(">"),ce(ve,">"),_,Se)}function Le(){return A(ve,Te)}function Te(e,t){if("="==t)return D(ve)}function Ae(e,t){return"enum"==t?(T.marked="keyword",D(tt)):A(De,he,Oe,Ne)}function De(e,t){return c&&N(t)?(T.marked="keyword",D(De)):"variable"==e?(E(t),D()):"spread"==e?D(De):"["==e?de(Ee,"]"):"{"==e?de(Fe,"}"):void 0}function Fe(e,t){return"variable"!=e||T.stream.match(/^\s*:/,!1)?("variable"==e&&(T.marked="property"),"spread"==e?D(De):"}"==e?A():"["==e?D(V,R("]"),R(":"),Fe):D(R(":"),De,Oe)):(E(t),D(Oe))}function Ee(){return A(De,Oe)}function Oe(e,t){if("="==t)return D(U)}function Ne(e){if(","==e)return D(Ae)}function ze(e,t){if("keyword b"==e&&"else"==t)return D(j("form","else"),q,_)}function Pe(e,t){return"await"==t?D(Pe):"("==e?D(j(")"),Be,_):void 0}function Be(e){return"var"==e?D(Ae,Ie):"variable"==e?D(Ie):A(Ie)}function Ie(e,t){return")"==e?D():";"==e?D(Ie):"in"==t||"of"==t?(T.marked="keyword",D(V,Ie)):A(V,Ie)}function We(e,t){return"*"==t?(T.marked="keyword",D(We)):"variable"==e?(E(t),D(We)):"("==e?D(I,j(")"),ce(_e,")"),_,me,q,H):c&&"<"==t?D(j(">"),ce(Le,">"),_,We):void 0}function He(e,t){return"*"==t?(T.marked="keyword",D(He)):"variable"==e?(E(t),D(He)):"("==e?D(I,j(")"),ce(_e,")"),_,me,H):c&&"<"==t?D(j(">"),ce(Le,">"),_,He):void 0}function je(e,t){return"keyword"==e||"variable"==e?(T.marked="type",D(je)):"<"==t?D(j(">"),ce(Le,">"),_):void 0}function _e(e,t){return"@"==t&&D(V,_e),"spread"==e?D(_e):c&&N(t)?(T.marked="keyword",D(_e)):c&&"this"==e?D(he,Oe):A(De,he,Oe)}function Re(e,t){return"variable"==e?qe(e,t):Ge(e,t)}function qe(e,t){if("variable"==e)return E(t),D(Ge)}function Ge(e,t){return"<"==t?D(j(">"),ce(Le,">"),_,Ge):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(T.marked="keyword"),D(c?ve:V,Ge)):"{"==e?D(j("}"),Ve,_):void 0}function Ve(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&N(t))&&T.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(T.marked="keyword",D(Ve)):"variable"==e||"keyword"==T.style?(T.marked="property",D(Ue,Ve)):"number"==e||"string"==e?D(Ue,Ve):"["==e?D(V,he,R("]"),Ue,Ve):"*"==t?(T.marked="keyword",D(Ve)):c&&"("==e?A(He,Ve):";"==e||","==e?D(Ve):"}"==e?D():"@"==t?D(V,Ve):void 0}function Ue(e,t){if("!"==t)return D(Ue);if("?"==t)return D(Ue);if(":"==e)return D(ve,Oe);if("="==t)return D(U);var r=T.state.lexical.prev;return A(r&&"interface"==r.info?He:We)}function Ke(e,t){return"*"==t?(T.marked="keyword",D(Ze,R(";"))):"default"==t?(T.marked="keyword",D(V,R(";"))):"{"==e?D(ce($e,"}"),Ze,R(";")):A(q)}function $e(e,t){return"as"==t?(T.marked="keyword",D(R("variable"))):"variable"==e?A(U,$e):void 0}function Xe(e){return"string"==e?D():"("==e?A(V):"."==e?A(Y):A(Ye,Qe,Ze)}function Ye(e,t){return"{"==e?de(Ye,"}"):("variable"==e&&E(t),"*"==t&&(T.marked="keyword"),D(Je))}function Qe(e){if(","==e)return D(Ye,Qe)}function Je(e,t){if("as"==t)return T.marked="keyword",D(Ye)}function Ze(e,t){if("from"==t)return T.marked="keyword",D(V)}function et(e){return"]"==e?D():A(ce(U,"]"))}function tt(){return A(j("form"),De,R("{"),j("}"),ce(rt,"}"),_,_)}function rt(){return A(De,Oe)}function nt(e,t){return"operator"==e.lastType||","==e.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function it(e,t,r){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return I.lex=W.lex=!0,H.lex=!0,_.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new S((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&new z(null,null,!1),indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),w(e,t)),t.tokenize!=x&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",L(t,r,n,i,e))},indent:function(t,n){if(t.tokenize==x||t.tokenize==b)return e.Pass;if(t.tokenize!=v)return 0;var i,l=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var c=t.cc[u];if(c==_)s=s.prev;else if(c!=ze&&c!=H)break}for(;("stat"==s.type||"form"==s.type)&&("}"==l||(i=t.cc[t.cc.length-1])&&(i==Y||i==Q)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;a&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var d=s.type,f=l==d;return"vardef"==d?s.indented+("operator"==t.lastType||","==t.lastType?s.info.length+1:0):"form"==d&&"{"==l?s.indented:"form"==d?s.indented+o:"stat"==d?s.indented+(nt(t,n)?a||o:0):"switch"!=s.info||f||0==r.doubleIndentSwitch?s.align?s.column+(f?0:1):s.indented+(f?0:o):s.indented+(/^(?:case|default)\b/.test(n)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:l,jsonMode:s,expressionAllowed:it,skipExpression:function(t){L(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(o.exports),function(e){var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function r(e,t,r){var n=e.current(),i=n.search(t);return i>-1?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}var n={};function i(e){var t=n[e];return t||(n[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function o(e,t){var r=e.match(i(t));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function a(e,t){return new RegExp((t?"^":"")+"</\\s*"+e+"\\s*>","i")}function l(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;o>=0;o--)n.unshift(i[o])}function s(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n[0]||n[1].test(o(t,n[0])))return n[2]}}e.defineMode("htmlmixed",(function(n,i){var o=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:i.multilineTagIndentFactor,multilineTagIndentPastTag:i.multilineTagIndentPastTag,allowMissingTagName:i.allowMissingTagName}),u={},c=i&&i.tags,d=i&&i.scriptTypes;if(l(t,u),c&&l(c,u),d)for(var f=d.length-1;f>=0;f--)u.script.unshift(["type",d[f].matches,d[f].mode]);function h(t,i){var l,c=o.token(t,i.htmlState),d=/\btag\b/.test(c);if(d&&!/[<>\s\/]/.test(t.current())&&(l=i.htmlState.tagName&&i.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(l))i.inTag=l+" ";else if(i.inTag&&d&&/>$/.test(t.current())){var f=/^([\S]+) (.*)/.exec(i.inTag);i.inTag=null;var p=">"==t.current()&&s(u[f[1]],f[2]),m=e.getMode(n,p),g=a(f[1],!0),v=a(f[1],!1);i.token=function(e,t){return e.match(g,!1)?(t.token=h,t.localState=t.localMode=null,null):r(e,v,t.localMode.token(e,t.localState))},i.localMode=m,i.localState=e.startState(m,o.indent(i.htmlState,"",""))}else i.inTag&&(i.inTag+=t.current(),t.eol()&&(i.inTag+=" "));return c}return{startState:function(){return{token:h,inTag:null,localMode:null,localState:null,htmlState:e.startState(o)}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(o,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r,n){return!t.localMode||/^\s*<\//.test(r)?o.indent(t.htmlState,r,n):t.localMode.indent?t.localMode.indent(t.localState,r,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||o}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}(o.exports),a.defineMode("dot",(function(e){var t=/--|->|=|;/,r=/[\[\]{}]/;return{startState:function(){return{indent_level:0}},token:function(e,n){switch(e.eatSpace(),n.looking_for){case"multiline-comment":return e.match(/.*\*\//)?n.looking_for=null:e.skipToEnd(),"comment";case"property":return e.match("=")?"variable-3":(e.match(/\w+/),n.looking_for=null,"string-2");case"graphname":if(n.looking_for=null,e.match(/{\W*$/))return n.indent_level+=1,"bracket";if(e.match("{"))return"bracket";if(e.match(/[^\W]+/))return"variable-2";default:return e.match(/{\W*$/)?(n.indent_level+=1,"bracket"):e.match(/}\W*$/)?(n.indent_level-=1,"bracket"):e.match(r)?"bracket":e.match(/".*"/)?"string":e.match(/\w+=[\"\w]+/,!1)?(n.looking_for="property",e.match(/[^=]+/),"attribute"):e.match(t)?"variable-3":e.match(/(di)?graph[^{\w]+/)?(n.looking_for="graphname","keyword"):e.match(/\/\/|#/)?(e.skipToEnd(),"comment"):e.match(/\/\*.*\*\//)?"comment":e.match("/*")?(n.looking_for="multiline-comment","comment"):(e.match(/\w+/)||e.skipToEnd(),"variable")}},indent:function(t,r){return t.indent_level*(e.indentUnit||2)},closeBrackets:{pairs:'[]{}""'},lineComment:/(\/\/|#)/,blockCommentStart:"/*",blockCommentEnd:"*/"}})),a.defineMIME("text/x-dot","dot"),a.defineMode("markdown",(function(e,t){var r=a.getMode(e,"text/html"),n="null"==r.name;void 0===t.defaultMode&&(t.defaultMode=""),void 0===t.highlightFormatting&&(t.highlightFormatting=!1),void 0===t.maxBlockquoteDepth&&(t.maxBlockquoteDepth=0),void 0===t.taskLists&&(t.taskLists=!1),void 0===t.strikethrough&&(t.strikethrough=!1),void 0===t.emoji&&(t.emoji=!1),void 0===t.fencedCodeBlockHighlighting&&(t.fencedCodeBlockHighlighting=!0),void 0===t.xml&&(t.xml=!0),void 0===t.tokenTypeOverrides&&(t.tokenTypeOverrides={});var i={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var o in i)i.hasOwnProperty(o)&&t.tokenTypeOverrides[o]&&(i[o]=t.tokenTypeOverrides[o]);var l=/^([*\-_])(?:\s*\1){2,}\s*$/,s=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,c=t.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ *(?:\={1,}|-{1,})\s*$/,f=/^[^#!\[\]*_\\<>` "'(~:]+/,h=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function g(e,t,r){return t.f=t.inline=r,r(e,t)}function v(e,t,r){return t.f=t.block=r,r(e,t)}function y(e){if(e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==b){var t=n;if(!t){var i=a.innerMode(r,e.htmlState);t="xml"==i.mode.name&&null===i.state.tagStart&&!i.state.context&&i.state.tokenize.isInText}t&&(e.f=S,e.block=x,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function x(r,n){var o,f=r.column()===n.indentation,m=!(o=n.prevLine.stream)||!/\S/.test(o.string),v=n.indentedCode,y=n.prevLine.hr,x=!1!==n.list,b=(n.listStack[n.listStack.length-1]||0)+3;n.indentedCode=!1;var C=n.indentation;if(null===n.indentationDiff&&(n.indentationDiff=n.indentation,x)){for(n.list=null;C<n.listStack[n.listStack.length-1];)n.listStack.pop(),n.listStack.length?n.indentation=n.listStack[n.listStack.length-1]:n.list=!1;!1!==n.list&&(n.indentationDiff=C-n.listStack[n.listStack.length-1])}var S=!(m||y||n.prevLine.header||x&&v||n.prevLine.fencedCodeEnd),M=(!1===n.list||y||m)&&n.indentation<=b&&r.match(l),L=null;if(n.indentationDiff>=4&&(v||n.prevLine.fencedCodeEnd||n.prevLine.header||m))return r.skipToEnd(),n.indentedCode=!0,i.code;if(r.eatSpace())return null;if(f&&n.indentation<=b&&(L=r.match(c))&&L[1].length<=6)return n.quote=0,n.header=L[1].length,n.thisLine.header=!0,t.highlightFormatting&&(n.formatting="header"),n.f=n.inline,w(n);if(n.indentation<=b&&r.eat(">"))return n.quote=f?1:n.quote+1,t.highlightFormatting&&(n.formatting="quote"),r.eatSpace(),w(n);if(!M&&!n.setext&&f&&n.indentation<=b&&(L=r.match(s))){var T=L[1]?"ol":"ul";return n.indentation=C+r.current().length,n.list=!0,n.quote=0,n.listStack.push(n.indentation),n.em=!1,n.strong=!1,n.code=!1,n.strikethrough=!1,t.taskLists&&r.match(u,!1)&&(n.taskList=!0),n.f=n.inline,t.highlightFormatting&&(n.formatting=["list","list-"+T]),w(n)}return f&&n.indentation<=b&&(L=r.match(h,!0))?(n.quote=0,n.fencedEndRE=new RegExp(L[1]+"+ *$"),n.localMode=t.fencedCodeBlockHighlighting&&function(r){if(r=""===r?t.defaultMode:r,a.findModeByName){var n=a.findModeByName(r);n&&(r=n.mime||n.mimes[0])}var i=a.getMode(e,r);return"null"==i.name?null:i}(L[2]),n.localMode&&(n.localState=a.startState(n.localMode)),n.f=n.block=k,t.highlightFormatting&&(n.formatting="code-block"),n.code=-1,w(n)):n.setext||!(S&&x||n.quote||!1!==n.list||n.code||M||p.test(r.string))&&(L=r.lookAhead(1))&&(L=L.match(d))?(n.setext?(n.header=n.setext,n.setext=0,r.skipToEnd(),t.highlightFormatting&&(n.formatting="header")):(n.header="="==L[0].charAt(0)?1:2,n.setext=n.header),n.thisLine.header=!0,n.f=n.inline,w(n)):M?(r.skipToEnd(),n.hr=!0,n.thisLine.hr=!0,i.hr):"["===r.peek()?g(r,n,A):g(r,n,n.inline)}function b(e,t){var i=r.token(e,t.htmlState);if(!n){var o=a.innerMode(r,t.htmlState);("xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=S,t.block=x,t.htmlState=null)}return i}function k(e,r){var n,o=r.listStack[r.listStack.length-1]||0,a=r.indentation<o,l=o+3;return r.fencedEndRE&&r.indentation<=l&&(a||e.match(r.fencedEndRE))?(t.highlightFormatting&&(r.formatting="code-block"),a||(n=w(r)),r.localMode=r.localState=null,r.block=x,r.f=S,r.fencedEndRE=null,r.code=0,r.thisLine.fencedCodeEnd=!0,a?v(e,r,r.block):n):r.localMode?r.localMode.token(e,r.localState):(e.skipToEnd(),i.code)}function w(e){var r=[];if(e.formatting){r.push(i.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var n=0;n<e.formatting.length;n++)r.push(i.formatting+"-"+e.formatting[n]),"header"===e.formatting[n]&&r.push(i.formatting+"-"+e.formatting[n]+"-"+e.header),"quote"===e.formatting[n]&&(!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?r.push(i.formatting+"-"+e.formatting[n]+"-"+e.quote):r.push("error"))}if(e.taskOpen)return r.push("meta"),r.length?r.join(" "):null;if(e.taskClosed)return r.push("property"),r.length?r.join(" "):null;if(e.linkHref?r.push(i.linkHref,"url"):(e.strong&&r.push(i.strong),e.em&&r.push(i.em),e.strikethrough&&r.push(i.strikethrough),e.emoji&&r.push(i.emoji),e.linkText&&r.push(i.linkText),e.code&&r.push(i.code),e.image&&r.push(i.image),e.imageAltText&&r.push(i.imageAltText,"link"),e.imageMarker&&r.push(i.imageMarker)),e.header&&r.push(i.header,i.header+"-"+e.header),e.quote&&(r.push(i.quote),!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?r.push(i.quote+"-"+e.quote):r.push(i.quote+"-"+t.maxBlockquoteDepth)),!1!==e.list){var o=(e.listStack.length-1)%3;o?1===o?r.push(i.list2):r.push(i.list3):r.push(i.list1)}return e.trailingSpaceNewLine?r.push("trailing-space-new-line"):e.trailingSpace&&r.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),r.length?r.join(" "):null}function C(e,t){if(e.match(f,!0))return w(t)}function S(e,n){var o=n.text(e,n);if(void 0!==o)return o;if(n.list)return n.list=null,w(n);if(n.taskList)return" "===e.match(u,!0)[1]?n.taskOpen=!0:n.taskClosed=!0,t.highlightFormatting&&(n.formatting="task"),n.taskList=!1,w(n);if(n.taskOpen=!1,n.taskClosed=!1,n.header&&e.match(/^#+$/,!0))return t.highlightFormatting&&(n.formatting="header"),w(n);var l=e.next();if(n.linkTitle){n.linkTitle=!1;var s=l;"("===l&&(s=")");var c="^\\s*(?:[^"+(s=(s+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+s;if(e.match(new RegExp(c),!0))return i.linkHref}if("`"===l){var d=n.formatting;t.highlightFormatting&&(n.formatting="code"),e.eatWhile("`");var f=e.current().length;if(0!=n.code||n.quote&&1!=f){if(f==n.code){var h=w(n);return n.code=0,h}return n.formatting=d,w(n)}return n.code=f,w(n)}if(n.code)return w(n);if("\\"===l&&(e.next(),t.highlightFormatting)){var p=w(n),g=i.formatting+"-escape";return p?p+" "+g:g}if("!"===l&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return n.imageMarker=!0,n.image=!0,t.highlightFormatting&&(n.formatting="image"),w(n);if("["===l&&n.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return n.imageMarker=!1,n.imageAltText=!0,t.highlightFormatting&&(n.formatting="image"),w(n);if("]"===l&&n.imageAltText){t.highlightFormatting&&(n.formatting="image");var p=w(n);return n.imageAltText=!1,n.image=!1,n.inline=n.f=L,p}if("["===l&&!n.image)return n.linkText&&e.match(/^.*?\]/)||(n.linkText=!0,t.highlightFormatting&&(n.formatting="link")),w(n);if("]"===l&&n.linkText){t.highlightFormatting&&(n.formatting="link");var p=w(n);return n.linkText=!1,n.inline=n.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?L:S,p}if("<"===l&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return n.f=n.inline=M,t.highlightFormatting&&(n.formatting="link"),(p=w(n))?p+=" ":p="",p+i.linkInline;if("<"===l&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return n.f=n.inline=M,t.highlightFormatting&&(n.formatting="link"),(p=w(n))?p+=" ":p="",p+i.linkEmail;if(t.xml&&"<"===l&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var y=e.string.indexOf(">",e.pos);if(-1!=y){var x=e.string.substring(e.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(x)&&(n.md_inside=!0)}return e.backUp(1),n.htmlState=a.startState(r),v(e,n,b)}if(t.xml&&"<"===l&&e.match(/^\/\w*?>/))return n.md_inside=!1,"tag";if("*"===l||"_"===l){for(var k=1,C=1==e.pos?" ":e.string.charAt(e.pos-2);k<3&&e.eat(l);)k++;var T=e.peek()||" ",A=!/\s/.test(T)&&(!m.test(T)||/\s/.test(C)||m.test(C)),D=!/\s/.test(C)&&(!m.test(C)||/\s/.test(T)||m.test(T)),F=null,E=null;if(k%2&&(n.em||!A||"*"!==l&&D&&!m.test(C)?n.em!=l||!D||"*"!==l&&A&&!m.test(T)||(F=!1):F=!0),k>1&&(n.strong||!A||"*"!==l&&D&&!m.test(C)?n.strong!=l||!D||"*"!==l&&A&&!m.test(T)||(E=!1):E=!0),null!=E||null!=F){t.highlightFormatting&&(n.formatting=null==F?"strong":null==E?"em":"strong em"),!0===F&&(n.em=l),!0===E&&(n.strong=l);h=w(n);return!1===F&&(n.em=!1),!1===E&&(n.strong=!1),h}}else if(" "===l&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return w(n);e.backUp(1)}if(t.strikethrough)if("~"===l&&e.eatWhile(l)){if(n.strikethrough){t.highlightFormatting&&(n.formatting="strikethrough");h=w(n);return n.strikethrough=!1,h}if(e.match(/^[^\s]/,!1))return n.strikethrough=!0,t.highlightFormatting&&(n.formatting="strikethrough"),w(n)}else if(" "===l&&e.match(/^~~/,!0)){if(" "===e.peek())return w(n);e.backUp(2)}if(t.emoji&&":"===l&&e.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){n.emoji=!0,t.highlightFormatting&&(n.formatting="emoji");var O=w(n);return n.emoji=!1,O}return" "===l&&(e.match(/^ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),w(n)}function M(e,r){if(">"===e.next()){r.f=r.inline=S,t.highlightFormatting&&(r.formatting="link");var n=w(r);return n?n+=" ":n="",n+i.linkInline}return e.match(/^[^>]+/,!0),i.linkInline}function L(e,r){if(e.eatSpace())return null;var n,i=e.next();return"("===i||"["===i?(r.f=r.inline=(n="("===i?")":"]",function(e,r){if(e.next()===n){r.f=r.inline=S,t.highlightFormatting&&(r.formatting="link-string");var i=w(r);return r.linkHref=!1,i}return e.match(T[n]),r.linkHref=!0,w(r)}),t.highlightFormatting&&(r.formatting="link-string"),r.linkHref=!0,w(r)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function A(e,r){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(r.f=D,e.next(),t.highlightFormatting&&(r.formatting="link"),r.linkText=!0,w(r)):g(e,r,S)}function D(e,r){if(e.match(/^\]:/,!0)){r.f=r.inline=F,t.highlightFormatting&&(r.formatting="link");var n=w(r);return r.linkText=!1,n}return e.match(/^([^\]\\]|\\.)+/,!0),i.linkText}function F(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=S,i.linkHref+" url")}var E={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:S,text:C,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&a.copyState(r,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?a.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,linkHref:e.linkHref,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return y(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=b)){var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=r,t.indentationDiff=null,r>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==b?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:E}},indent:function(e,t,n){return e.block==b&&r.indent?r.indent(e.htmlState,t,n):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,t,n):a.Pass},blankLine:y,getType:w,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return E}),"xml"),a.defineMIME("text/markdown","markdown"),a.defineMIME("text/x-markdown","markdown");l('.CodeMirror{color:#000;direction:ltr;font-family:monospace;height:300px}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{background-color:#f7f7f7;border-right:1px solid #ddd;white-space:nowrap}.CodeMirror-linenumber{color:#999;min-width:20px;padding:0 3px 0 5px;text-align:right;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{background:#7e7;border:0!important;width:auto}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:-50px}.CodeMirror-ruler{border-left:1px solid #ccc;bottom:0;position:absolute;top:0}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{background:#fff;overflow:hidden;position:relative}.CodeMirror-scroll{height:100%;margin-bottom:-50px;margin-right:-50px;outline:none;overflow:scroll!important;padding-bottom:50px;position:relative;z-index:0}.CodeMirror-sizer{border-right:50px solid transparent;position:relative}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{display:none;outline:none;position:absolute;z-index:6}.CodeMirror-vscrollbar{overflow-x:hidden;overflow-y:scroll;right:0;top:0}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-x:scroll;overflow-y:hidden}.CodeMirror-scrollbar-filler{bottom:0;right:0}.CodeMirror-gutter-filler{bottom:0;left:0}.CodeMirror-gutters{left:0;min-height:100%;position:absolute;top:0;z-index:3}.CodeMirror-gutter{display:inline-block;height:100%;margin-bottom:-50px;vertical-align:top;white-space:normal}.CodeMirror-gutter-wrapper{background:none!important;border:none!important;position:absolute;z-index:4}.CodeMirror-gutter-background{bottom:0;position:absolute;top:0;z-index:4}.CodeMirror-gutter-elt{cursor:default;position:absolute;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{word-wrap:normal;-webkit-tap-highlight-color:transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual;line-height:inherit;margin:0;overflow:visible;position:relative;white-space:pre;z-index:2}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}.CodeMirror-linewidget{padding:.1px;position:relative;z-index:2}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{height:0;overflow:hidden;position:absolute;visibility:hidden;width:100%}.CodeMirror-cursor{pointer-events:none;position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{position:relative;visibility:hidden;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}'),function(e){function t(t){return function(r,n){var i=n.line,o=r.getLine(i);function a(t){for(var a,l=n.ch,s=0;;){var u=l<=0?-1:o.lastIndexOf(t[0],l-1);if(-1!=u){if(1==s&&u<n.ch)break;if(a=r.getTokenTypeAt(e.Pos(i,u+1)),!/^(comment|string)/.test(a))return{ch:u+1,tokenType:a,pair:t};l=u-1}else{if(1==s)break;s=1,l=o.length}}}function l(t){var n,o,a=1,l=r.lastLine(),s=t.ch;e:for(var u=i;u<=l;++u)for(var c=r.getLine(u),d=u==i?s:0;;){var f=c.indexOf(t.pair[0],d),h=c.indexOf(t.pair[1],d);if(f<0&&(f=c.length),h<0&&(h=c.length),(d=Math.min(f,h))==c.length)break;if(r.getTokenTypeAt(e.Pos(u,d+1))==t.tokenType)if(d==f)++a;else if(! --a){n=u,o=d;break e}++d}return null==n||i==n?null:{from:e.Pos(i,s),to:e.Pos(n,o)}}for(var s=[],u=0;u<t.length;u++){var c=a(t[u]);c&&s.push(c)}for(s.sort((function(e,t){return e.ch-t.ch})),u=0;u<s.length;u++){var d=l(s[u]);if(d)return d}return null}}e.registerHelper("fold","brace",t([["{","}"],["[","]"]])),e.registerHelper("fold","brace-paren",t([["{","}"],["[","]"],["(",")"]])),e.registerHelper("fold","import",(function(t,r){function n(r){if(r<t.firstLine()||r>t.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));if(/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"keyword"!=n.type||"import"!=n.string)return null;for(var i=r,o=Math.min(t.lastLine(),r+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:n.end,end:e.Pos(i,a)}}}var i,o=r.line,a=n(o);if(!a||n(o-1)||(i=n(o-2))&&i.end.line==o-1)return null;for(var l=a.end;;){var s=n(l.line+1);if(null==s)break;l=s.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:l}})),e.registerHelper("fold","include",(function(t,r){function n(r){if(r<t.firstLine()||r>t.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));return/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"meta"==n.type&&"#include"==n.string.slice(0,8)?n.start+8:void 0}var i=r.line,o=n(i);if(null==o||null!=n(i-1))return null;for(var a=i;null!=n(a+1);)++a;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}}))}(o.exports),function(e){e.registerGlobalHelper("fold","comment",(function(e){return e.blockCommentStart&&e.blockCommentEnd}),(function(t,r){var n=t.getModeAt(r),i=n.blockCommentStart,o=n.blockCommentEnd;if(i&&o){for(var a,l=r.line,s=t.getLine(l),u=r.ch,c=0;;){var d=u<=0?-1:s.lastIndexOf(i,u-1);if(-1!=d){if(1==c&&d<r.ch)return;if(/comment/.test(t.getTokenTypeAt(e.Pos(l,d+1)))&&(0==d||s.slice(d-o.length,d)==o||!/comment/.test(t.getTokenTypeAt(e.Pos(l,d))))){a=d+i.length;break}u=d-1}else{if(1==c)return;c=1,u=s.length}}var f,h,p=1,m=t.lastLine();e:for(var g=l;g<=m;++g)for(var v=t.getLine(g),y=g==l?a:0;;){var x=v.indexOf(i,y),b=v.indexOf(o,y);if(x<0&&(x=v.length),b<0&&(b=v.length),(y=Math.min(x,b))==v.length)break;if(y==x)++p;else if(! --p){f=g,h=y;break e}++y}if(null!=f&&(l!=f||h!=a))return{from:e.Pos(l,a),to:e.Pos(f,h)}}}))}(o.exports);!function(e){function t(t,n,o,a){if(o&&o.call){var l=o;o=null}else l=i(t,o,"rangeFinder");"number"==typeof n&&(n=e.Pos(n,0));var s=i(t,o,"minFoldSize");function u(e){var r=l(t,n);if(!r||r.to.line-r.from.line<s)return null;if("fold"===a)return r;for(var i=t.findMarksAt(r.from),o=0;o<i.length;++o)if(i[o].__isFold){if(!e)return null;r.cleared=!0,i[o].clear()}return r}var c=u(!0);if(i(t,o,"scanUp"))for(;!c&&n.line>t.firstLine();)n=e.Pos(n.line-1,0),c=u(!1);if(c&&!c.cleared&&"unfold"!==a){var d=r(t,o,c);e.on(d,"mousedown",(function(t){f.clear(),e.e_preventDefault(t)}));var f=t.markText(c.from,c.to,{replacedWith:d,clearOnEnter:i(t,o,"clearOnEnter"),__isFold:!0});f.on("clear",(function(r,n){e.signal(t,"unfold",t,r,n)})),e.signal(t,"fold",t,c.from,c.to)}}function r(e,t,r){var n=i(e,t,"widget");if("function"==typeof n&&(n=n(r.from,r.to)),"string"==typeof n){var o=document.createTextNode(n);(n=document.createElement("span")).appendChild(o),n.className="CodeMirror-foldmarker"}else n&&(n=n.cloneNode(!0));return n}e.newFoldFunction=function(e,r){return function(n,i){t(n,i,{rangeFinder:e,widget:r})}},e.defineExtension("foldCode",(function(e,r,n){t(this,e,r,n)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),r=0;r<t.length;++r)if(t[r].__isFold)return!0})),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),{scanUp:!1},"unfold")},e.commands.foldAll=function(t){t.operation((function(){for(var r=t.firstLine(),n=t.lastLine();r<=n;r++)t.foldCode(e.Pos(r,0),{scanUp:!1},"fold")}))},e.commands.unfoldAll=function(t){t.operation((function(){for(var r=t.firstLine(),n=t.lastLine();r<=n;r++)t.foldCode(e.Pos(r,0),{scanUp:!1},"unfold")}))},e.registerHelper("fold","combine",(function(){var e=Array.prototype.slice.call(arguments,0);return function(t,r){for(var n=0;n<e.length;++n){var i=e[n](t,r);if(i)return i}}})),e.registerHelper("fold","auto",(function(e,t){for(var r=e.getHelpers(t,"fold"),n=0;n<r.length;n++){var i=r[n](e,t);if(i)return i}}));var n={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function i(e,t,r){if(t&&void 0!==t[r])return t[r];var i=e.options.foldOptions;return i&&void 0!==i[r]?i[r]:n[r]}e.defineOption("foldOptions",null),e.defineExtension("foldOption",(function(e,t){return i(this,e,t)}))}(o.exports),function(e){e.defineOption("foldGutter",!1,(function(t,i,o){o&&o!=e.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",u),t.off("changes",d),t.off("viewportChange",f),t.off("fold",h),t.off("unfold",h),t.off("swapDoc",d),t.off("optionChange",c)),i&&(t.state.foldGutter=new r(n(i)),s(t),t.on("gutterClick",u),t.on("changes",d),t.on("viewportChange",f),t.on("fold",h),t.on("unfold",h),t.on("swapDoc",d),t.on("optionChange",c))}));var t=e.Pos;function r(e){this.options=e,this.from=this.to=0}function n(e){return!0===e&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function i(e,r){for(var n=e.findMarks(t(r,0),t(r+1,0)),i=0;i<n.length;++i)if(n[i].__isFold){var o=n[i].find(-1);if(o&&o.line===r)return n[i]}}function o(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function a(e,r,n){var a=e.state.foldGutter.options,s=r-1,u=e.foldOption(a,"minFoldSize"),c=e.foldOption(a,"rangeFinder"),d="string"==typeof a.indicatorFolded&&l(a.indicatorFolded),f="string"==typeof a.indicatorOpen&&l(a.indicatorOpen);e.eachLine(r,n,(function(r){++s;var n=null,l=r.gutterMarkers;if(l&&(l=l[a.gutter]),i(e,s)){if(d&&l&&d.test(l.className))return;n=o(a.indicatorFolded)}else{var h=t(s,0),p=c&&c(e,h);if(p&&p.to.line-p.from.line>=u){if(f&&l&&f.test(l.className))return;n=o(a.indicatorOpen)}}(n||l)&&e.setGutterMarker(r,a.gutter,n)}))}function l(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function s(e){var t=e.getViewport(),r=e.state.foldGutter;r&&(e.operation((function(){a(e,t.from,t.to)})),r.from=t.from,r.to=t.to)}function u(e,r,n){var o=e.state.foldGutter;if(o){var a=o.options;if(n==a.gutter){var l=i(e,r);l?l.clear():e.foldCode(t(r,0),a)}}}function c(e,t){"mode"==t&&d(e)}function d(e){var t=e.state.foldGutter;if(t){var r=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){s(e)}),r.foldOnChangeTimeSpan||600)}}function f(e){var t=e.state.foldGutter;if(t){var r=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var r=e.getViewport();t.from==t.to||r.from-t.to>20||t.from-r.to>20?s(e):e.operation((function(){r.from<t.from&&(a(e,r.from,t.from),t.from=r.from),r.to>t.to&&(a(e,t.to,r.to),t.to=r.to)}))}),r.updateViewportTimeSpan||400)}}function h(e,t){var r=e.state.foldGutter;if(r){var n=t.line;n>=r.from&&n<r.to&&a(e,n,n+1)}}}(o.exports),function(e){function t(t,r){var n=t.getLine(r),i=n.search(/\S/);return-1==i||/\bcomment\b/.test(t.getTokenTypeAt(e.Pos(r,i+1)))?-1:e.countColumn(n,null,t.getOption("tabSize"))}e.registerHelper("fold","indent",(function(r,n){var i=t(r,n.line);if(!(i<0)){for(var o=null,a=n.line+1,l=r.lastLine();a<=l;++a){var s=t(r,a);if(-1==s);else{if(!(s>i))break;o=a}}return o?{from:e.Pos(n.line,r.getLine(n.line).length),to:e.Pos(o,r.getLine(o).length)}:void 0}}))}(o.exports),function(e){var t=e.Pos;function r(e,t){return e.line-t.line||e.ch-t.ch}var n="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=new RegExp("<(/?)(["+n+"]["+n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function a(e,r){var n=e.cm.getTokenTypeAt(t(e.line,r));return n&&/\btag\b/.test(n)}function l(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function s(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function u(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(l(e))continue;return}if(a(e,t+1)){var r=e.text.lastIndexOf("/",t),n=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t+1}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(s(e))continue;return}if(a(e,t+1)){i.lastIndex=t,e.ch=t;var r=i.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function d(e){for(;;){i.lastIndex=e.ch;var t=i.exec(e.text);if(!t){if(l(e))continue;return}if(a(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function f(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(s(e))continue;return}if(a(e,t+1)){var r=e.text.lastIndexOf("/",t),n=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t}}function h(e,r){for(var n=[];;){var i,o=d(e),a=e.line,l=e.ch-(o?o[0].length:0);if(!o||!(i=u(e)))return;if("selfClose"!=i)if(o[1]){for(var s=n.length-1;s>=0;--s)if(n[s]==o[2]){n.length=s;break}if(s<0&&(!r||r==o[2]))return{tag:o[2],from:t(a,l),to:t(e.line,e.ch)}}else n.push(o[2])}}function p(e,r){for(var n=[];;){var i=f(e);if(!i)return;if("selfClose"!=i){var o=e.line,a=e.ch,l=c(e);if(!l)return;if(l[1])n.push(l[2]);else{for(var s=n.length-1;s>=0;--s)if(n[s]==l[2]){n.length=s;break}if(s<0&&(!r||r==l[2]))return{tag:l[2],from:t(e.line,e.ch),to:t(o,a)}}}else c(e)}}e.registerHelper("fold","xml",(function(e,n){for(var i=new o(e,n.line,0);;){var a=d(i);if(!a||i.line!=n.line)return;var l=u(i);if(!l)return;if(!a[1]&&"selfClose"!=l){var s=t(i.line,i.ch),c=h(i,a[2]);return c&&r(c.from,s)>0?{from:s,to:c.from}:null}}})),e.findMatchingTag=function(e,n,i){var a=new o(e,n.line,n.ch,i);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var l=u(a),s=l&&t(a.line,a.ch),d=l&&c(a);if(l&&d&&!(r(a,n)>0)){var f={from:t(a.line,a.ch),to:s,tag:d[2]};return"selfClose"==l?{open:f,close:null,at:"open"}:d[1]?{open:p(a,d[2]),close:f,at:"close"}:{open:f,close:h(a=new o(e,s.line,s.ch,i),d[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r,n){for(var i=new o(e,t.line,t.ch,r);;){var a=p(i,n);if(!a)break;var l=h(new o(e,t.line,t.ch,r),a.tag);if(l)return{open:a,close:l}}},e.scanForClosingTag=function(e,t,r,n){return h(new o(e,t.line,t.ch,n?{from:0,to:n}:null),r)}}(o.exports);l('.CodeMirror-foldmarker{color:blue;cursor:pointer;font-family:arial;line-height:.3;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\\25BE"}.CodeMirror-foldgutter-folded:after{content:"\\25B8"}');!function(e){function t(t,r,n){var i,o=t.getWrapperElement();return(i=o.appendChild(document.createElement("div"))).className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof r?i.innerHTML=r:i.appendChild(r),e.addClass(o,"dialog-opened"),i}function r(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",(function(n,i,o){o||(o={}),r(this,null);var a=t(this,n,o.bottom),l=!1,s=this;function u(t){if("string"==typeof t)d.value=t;else{if(l)return;l=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),s.focus(),o.onClose&&o.onClose(a)}}var c,d=a.getElementsByTagName("input")[0];return d?(d.focus(),o.value&&(d.value=o.value,!1!==o.selectValueOnOpen&&d.select()),o.onInput&&e.on(d,"input",(function(e){o.onInput(e,d.value,u)})),o.onKeyUp&&e.on(d,"keyup",(function(e){o.onKeyUp(e,d.value,u)})),e.on(d,"keydown",(function(t){o&&o.onKeyDown&&o.onKeyDown(t,d.value,u)||((27==t.keyCode||!1!==o.closeOnEnter&&13==t.keyCode)&&(d.blur(),e.e_stop(t),u()),13==t.keyCode&&i(d.value,t))})),!1!==o.closeOnBlur&&e.on(a,"focusout",(function(e){null!==e.relatedTarget&&u()}))):(c=a.getElementsByTagName("button")[0])&&(e.on(c,"click",(function(){u(),s.focus()})),!1!==o.closeOnBlur&&e.on(c,"blur",u),c.focus()),u})),e.defineExtension("openConfirm",(function(n,i,o){r(this,null);var a=t(this,n,o&&o.bottom),l=a.getElementsByTagName("button"),s=!1,u=this,c=1;function d(){s||(s=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),u.focus())}l[0].focus();for(var f=0;f<l.length;++f){var h=l[f];!function(t){e.on(h,"click",(function(r){e.e_preventDefault(r),d(),t&&t(u)}))}(i[f]),e.on(h,"blur",(function(){--c,setTimeout((function(){c<=0&&d()}),200)})),e.on(h,"focus",(function(){++c}))}})),e.defineExtension("openNotification",(function(n,i){r(this,u);var o,a=t(this,n,i&&i.bottom),l=!1,s=i&&void 0!==i.duration?i.duration:5e3;function u(){l||(l=!0,clearTimeout(o),e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a))}return e.on(a,"click",(function(t){e.e_preventDefault(t),u()})),s&&(o=setTimeout(u,s)),u}))}(o.exports),function(e){function t(e,t,r,n,i){e.openDialog?e.openDialog(t,i,{value:n,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(r,n))}function r(e){return e.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+e.phrase("(Use line:column or scroll% syntax)")+"</span>"}function n(e,t){var r=Number(t);return/^[-+]/.test(t)?e.getCursor().line+r:r-1}e.defineOption("search",{bottom:!1}),e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,r(e),e.phrase("Jump to line:"),i.line+1+":"+i.ch,(function(t){var r;if(t)if(r=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(n(e,r[1]),Number(r[2]));else if(r=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var o=Math.round(e.lineCount()*Number(r[1])/100);/^[-+]/.test(r[1])&&(o=i.line+o+1),e.setCursor(o-1,i.ch)}else(r=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(n(e,r[1]),i.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}(o.exports);!function(e){var t,r,n=e.Pos;function i(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}function o(e,t){for(var r=i(e),n=r,o=0;o<t.length;o++)-1==n.indexOf(t.charAt(o))&&(n+=t.charAt(o));return r==n?e:new RegExp(e.source,n)}function a(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function l(e,t,r){t=o(t,"g");for(var i=r.line,a=r.ch,l=e.lastLine();i<=l;i++,a=0){t.lastIndex=a;var s=e.getLine(i),u=t.exec(s);if(u)return{from:n(i,u.index),to:n(i,u.index+u[0].length),match:u}}}function s(e,t,r){if(!a(t))return l(e,t,r);t=o(t,"gm");for(var i,s=1,u=r.line,c=e.lastLine();u<=c;){for(var d=0;d<s&&!(u>c);d++){var f=e.getLine(u++);i=null==i?f:i+"\n"+f}s*=2,t.lastIndex=r.ch;var h=t.exec(i);if(h){var p=i.slice(0,h.index).split("\n"),m=h[0].split("\n"),g=r.line+p.length-1,v=p[p.length-1].length;return{from:n(g,v),to:n(g+m.length-1,1==m.length?v+m[0].length:m[m.length-1].length),match:h}}}}function u(e,t,r){for(var n,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-r)break;(!n||a>n.index+n[0].length)&&(n=o),i=o.index+1}return n}function c(e,t,r){t=o(t,"g");for(var i=r.line,a=r.ch,l=e.firstLine();i>=l;i--,a=-1){var s=e.getLine(i),c=u(s,t,a<0?0:s.length-a);if(c)return{from:n(i,c.index),to:n(i,c.index+c[0].length),match:c}}}function d(e,t,r){if(!a(t))return c(e,t,r);t=o(t,"gm");for(var i,l=1,s=e.getLine(r.line).length-r.ch,d=r.line,f=e.firstLine();d>=f;){for(var h=0;h<l&&d>=f;h++){var p=e.getLine(d--);i=null==i?p:p+"\n"+i}l*=2;var m=u(i,t,s);if(m){var g=i.slice(0,m.index).split("\n"),v=m[0].split("\n"),y=d+g.length,x=g[g.length-1].length;return{from:n(y,x),to:n(y+v.length-1,1==v.length?x+v[0].length:v[v.length-1].length),match:m}}}}function f(e,t,r,n){if(e.length==t.length)return r;for(var i=0,o=r+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,l=n(e.slice(0,a)).length;if(l==r)return a;l>r?o=a:i=a+1}}function h(e,i,o,a){if(!i.length)return null;var l=a?t:r,s=l(i).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.lastLine()+1-s.length;u<=d;u++,c=0){var h=e.getLine(u).slice(c),p=l(h);if(1==s.length){var m=p.indexOf(s[0]);if(-1==m)continue e;return o=f(h,p,m,l)+c,{from:n(u,f(h,p,m,l)+c),to:n(u,f(h,p,m+s[0].length,l)+c)}}var g=p.length-s[0].length;if(p.slice(g)==s[0]){for(var v=1;v<s.length-1;v++)if(l(e.getLine(u+v))!=s[v])continue e;var y=e.getLine(u+s.length-1),x=l(y),b=s[s.length-1];if(x.slice(0,b.length)==b)return{from:n(u,f(h,p,g,l)+c),to:n(u+s.length-1,f(y,x,b.length,l))}}}}function p(e,i,o,a){if(!i.length)return null;var l=a?t:r,s=l(i).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.firstLine()-1+s.length;u>=d;u--,c=-1){var h=e.getLine(u);c>-1&&(h=h.slice(0,c));var p=l(h);if(1==s.length){var m=p.lastIndexOf(s[0]);if(-1==m)continue e;return{from:n(u,f(h,p,m,l)),to:n(u,f(h,p,m+s[0].length,l))}}var g=s[s.length-1];if(p.slice(0,g.length)==g){var v=1;for(o=u-s.length+1;v<s.length-1;v++)if(l(e.getLine(o+v))!=s[v])continue e;var y=e.getLine(u+1-s.length),x=l(y);if(x.slice(x.length-s[0].length)==s[0])return{from:n(u+1-s.length,f(y,x,y.length-s[0].length,l)),to:n(u,f(h,p,g.length,l))}}}}function m(e,t,r,i){var a;this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=e,r=r?e.clipPos(r):n(0,0),this.pos={from:r,to:r},"object"==typeof i?a=i.caseFold:(a=i,i=null),"string"==typeof t?(null==a&&(a=!1),this.matches=function(r,n){return(r?p:h)(e,t,n,a)}):(t=o(t,"gm"),i&&!1===i.multiline?this.matches=function(r,n){return(r?c:l)(e,t,n)}:this.matches=function(r,n){return(r?d:s)(e,t,n)})}String.prototype.normalize?(t=function(e){return e.normalize("NFD").toLowerCase()},r=function(e){return e.normalize("NFD")}):(t=function(e){return e.toLowerCase()},r=function(e){return e}),m.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){var r=this.doc.clipPos(t?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(r=n(r.line,r.ch),t?(r.ch--,r.ch<0&&(r.line--,r.ch=(this.doc.getLine(r.line)||"").length)):(r.ch++,r.ch>(this.doc.getLine(r.line)||"").length&&(r.ch=0,r.line++)),0!=e.cmpPos(r,this.doc.clipPos(r))))return this.atOccurrence=!1;var i=this.matches(t,r);if(this.afterEmptyMatch=i&&0==e.cmpPos(i.from,i.to),i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var o=n(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,r){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,r),this.pos.to=n(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,r){return new m(this.doc,e,t,r)})),e.defineDocExtension("getSearchCursor",(function(e,t,r){return new m(this,e,t,r)})),e.defineExtension("selectMatches",(function(t,r){for(var n=[],i=this.getSearchCursor(t,this.getCursor("from"),r);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)n.push({anchor:i.from(),head:i.to()});n.length&&this.setSelections(n,0)}))}(o.exports),function(e){function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var r=e.exec(t.string);if(r&&r.index==t.pos)return t.pos+=r[0].length||1,"searching";r?t.pos=r.index:t.skipToEnd()}}}function r(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(e){return e.state.search||(e.state.search=new r)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,r){return e.getSearchCursor(t,r,{caseFold:i(t),multiline:!0})}function a(e,t,r,n,i){e.openDialog(t,n,{value:r,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){p(e)},onKeyDown:i,bottom:e.options.search.bottom})}function l(e,t,r,n,i){e.openDialog?e.openDialog(t,i,{value:n,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(r,n))}function s(e,t,r,n){e.openConfirm?e.openConfirm(t,n):confirm(r)&&n[0]()}function u(e){return e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"==t?"\\":e}))}function c(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(e){}else e=u(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function d(e,r,n){r.queryText=n,r.query=c(n),e.removeOverlay(r.overlay,i(r.query)),r.overlay=t(r.query,i(r.query)),e.addOverlay(r.overlay),e.showMatchesOnScrollbar&&(r.annotate&&(r.annotate.clear(),r.annotate=null),r.annotate=e.showMatchesOnScrollbar(r.query,i(r.query)))}function f(t,r,i,o){var s=n(t);if(s.query)return h(t,r);var u=t.getSelection()||s.lastQuery;if(u instanceof RegExp&&"x^"==u.source&&(u=null),i&&t.openDialog){var c=null,f=function(r,n){e.e_stop(n),r&&(r!=s.queryText&&(d(t,s,r),s.posFrom=s.posTo=t.getCursor()),c&&(c.style.opacity=1),h(t,n.shiftKey,(function(e,r){var n;r.line<3&&document.querySelector&&(n=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&n.getBoundingClientRect().bottom-4>t.cursorCoords(r,"window").top&&((c=n).style.opacity=.4)})))};a(t,g(t),u,f,(function(r,i){var o=e.keyName(r),a=t.getOption("extraKeys"),l=a&&a[o]||e.keyMap[t.getOption("keyMap")][o];"findNext"==l||"findPrev"==l||"findPersistentNext"==l||"findPersistentPrev"==l?(e.e_stop(r),d(t,n(t),i),t.execCommand(l)):"find"!=l&&"findPersistent"!=l||(e.e_stop(r),f(i,r))})),o&&u&&(d(t,s,u),h(t,r))}else l(t,g(t),"Search for:",u,(function(e){e&&!s.query&&t.operation((function(){d(t,s,e),s.posFrom=s.posTo=t.getCursor(),h(t,r)}))}))}function h(t,r,i){t.operation((function(){var a=n(t),l=o(t,a.query,r?a.posFrom:a.posTo);(l.find(r)||(l=o(t,a.query,r?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(r))&&(t.setSelection(l.from(),l.to()),t.scrollIntoView({from:l.from(),to:l.to()},20),a.posFrom=l.from(),a.posTo=l.to(),i&&i(l.from(),l.to()))}))}function p(e){e.operation((function(){var t=n(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))}))}function m(e,t){var r=e?document.createElement(e):document.createDocumentFragment();for(var n in t)r[n]=t[n];for(var i=2;i<arguments.length;i++){var o=arguments[i];r.appendChild("string"==typeof o?document.createTextNode(o):o)}return r}function g(e){var t=m("label",{className:"CodeMirror-search-label"},e.phrase("Search:"),m("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));return t.setAttribute("for","CodeMirror-search-field"),m("",null,t," ",m("span",{style:"color: #666",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}function v(e){return m("",null," ",m("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",m("span",{style:"color: #666",className:"CodeMirror-search-hint"},e.phrase("(Use /re/ syntax for regexp search)")))}function y(e){return m("",null,m("span",{className:"CodeMirror-search-label"},e.phrase("With:"))," ",m("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}function x(e){return m("",null,m("span",{className:"CodeMirror-search-label"},e.phrase("Replace?"))," ",m("button",{},e.phrase("Yes"))," ",m("button",{},e.phrase("No"))," ",m("button",{},e.phrase("All"))," ",m("button",{},e.phrase("Stop")))}function b(e,t,r){e.operation((function(){for(var n=o(e,t);n.findNext();)if("string"!=typeof t){var i=e.getRange(n.from(),n.to()).match(t);n.replace(r.replace(/\$(\d)/g,(function(e,t){return i[t]})))}else n.replace(r)}))}function k(e,t){if(!e.getOption("readOnly")){var r=e.getSelection()||n(e).lastQuery,i=t?e.phrase("Replace all:"):e.phrase("Replace:"),a=m("",null,m("span",{className:"CodeMirror-search-label"},i),v(e));l(e,a,i,r,(function(r){r&&(r=c(r),l(e,y(e),e.phrase("Replace with:"),"",(function(n){if(n=u(n),t)b(e,r,n);else{p(e);var i=o(e,r,e.getCursor("from")),a=function(){var t,u=i.from();!(t=i.findNext())&&(i=o(e,r),!(t=i.findNext())||u&&i.from().line==u.line&&i.from().ch==u.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),s(e,x(e),e.phrase("Replace?"),[function(){l(t)},a,function(){b(e,r,n)}]))},l=function(e){i.replace("string"==typeof r?n:n.replace(/\$(\d)/g,(function(t,r){return e[r]}))),a()};a()}})))}))}}e.defineOption("search",{bottom:!1}),e.commands.find=function(e){p(e),f(e)},e.commands.findPersistent=function(e){p(e),f(e,!1,!0)},e.commands.findPersistentNext=function(e){f(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){f(e,!0,!0,!0)},e.commands.findNext=f,e.commands.findPrev=function(e){f(e,!0)},e.commands.clearSearch=p,e.commands.replace=k,e.commands.replaceAll=function(e){k(e,!0)}}(o.exports);function s(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}l(".CodeMirror-dialog{background:inherit;color:inherit;left:0;overflow:hidden;padding:.1em .8em;position:absolute;right:0;z-index:15}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{background:transparent;border:none;color:inherit;font-family:monospace;outline:none;width:20em}.CodeMirror-dialog button{font-size:70%}");s('.codemirror_Editor{border:1px solid #d3d3d3}.codemirror_Editor .cm-marked-text{background-color:#ff0}.codemirror_Editor .cm-marked-error,.codemirror_Editor .cm-marked-info,.codemirror_Editor .cm-marked-warning{background-position:0 100%;background-repeat:repeat-x;display:inline-block;position:relative}.codemirror_Editor .cm-marked-info{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHElEQVQYV2NkgIP//xkYGBkZIXwIB0SDCQgHAgDEXAgCKU2DPwAAAABJRU5ErkJggg==")}.codemirror_Editor .cm-marked-error{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHUlEQVQYV2NkgIL/DAz/GRkYGBlBfBgHTMM4MJUAzFoIAuwf4BEAAAAASUVORK5CYII=")}.codemirror_Editor .cm-marked-warning{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHUlEQVQYV2NkgIL/Sxn+M0YzMDKC+DAOmIZxYCoBKQkLp8ga+UwAAAAASUVORK5CYII=")}');var u=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t._markedText=[],t._initialText="",t._options=new Map,t}return n(r,e),r.prototype.options=function(){return{gutters:this.guttersOption(),readOnly:this.readOnly(),lineNumbers:!0,tabSize:2}},r.prototype.option=function(e,t){return this._codemirror?arguments.length<2?this._codemirror.getOption(e):(this._codemirror.setOption(e,t),this):arguments.length<2?this._options.get(e):void this._options.set(e,t)},r.prototype.guttersOption=function(){var e=["CodeMirror-linenumbers"];return this.gutterMarkerWidth()>0&&e.unshift({className:"CodeMirror-guttermarker",style:"width:".concat(this.gutterMarkerWidth(),"px;")}),e},r.prototype.addGutterMarker=function(e,r,n,i,o,a,l,s){void 0===n&&(n=null),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=function(){}),void 0===l&&(l=function(){}),void 0===s&&(s=function(e){});var u=this._codemirror.getLineHandle(e),c=document.createElement("div");c.textContent=r,c.style.paddingLeft="3px",c.style.paddingRight="3px",c.style.color=t.Palette.textColor(n),null!==i&&(c.style.fontFamily=i),null!==o&&(c.style.fontSize=o),c.style.backgroundColor=n,c.style.textAlign=this.markerTextAlign(),this._codemirror.setGutterMarker(u,"CodeMirror-guttermarker",c),c.onmouseenter=a,c.onmouseleave=l,c.onclick=s},r.prototype.removeGutterMarker=function(e){var t=this._codemirror.getLineHandle(e);this._codemirror.setGutterMarker(t,"CodeMirror-guttermarker",null)},r.prototype.hasFocus=function(){return this._codemirror.hasFocus()},r.prototype.text=function(e){if(this._codemirror){var t=this._codemirror.getDoc();return arguments.length?(t.setValue(e),this):t.getValue()}return arguments.length?(this._initialText=e,this):this._initialText},r.prototype.highlight=function(e,t,r){return void 0===r&&(r="cm-marked-text"),"number"==typeof e&&(e=this.positionAt(e)),"number"==typeof t&&(t=this.positionAt(t)),this._codemirror&&this._markedText.push(this._codemirror.markText(e,t,{className:r})),this},r.prototype.highlightInfo=function(e,t){return this.highlight(e,t,"cm-marked-info"),this},r.prototype.highlightWarning=function(e,t){return this.highlight(e,t,"cm-marked-warning"),this},r.prototype.highlightError=function(e,t){return this.highlight(e,t,"cm-marked-error"),this},r.prototype.removeAllHighlight=function(){for(var e=0,t=this._markedText;e<t.length;e++){t[e].clear()}return this._markedText=[],this},r.prototype.positionAt=function(e){return this._codemirror.posFromIndex(e)},r.prototype.getLineLength=function(e){var t;return(null===(t=this._codemirror.doc.getLine(e))||void 0===t?void 0:t.length)||0},r.prototype.highlightSubstring=function(e){var t=this,r=this.text().split(e).slice(0,-1),n=0;r.forEach((function(r){n+=r.length,t.highlight(t.positionAt(n),t.positionAt(n+e.length)),n+=e.length}))},r.prototype.setCursor=function(e,t,r){var n=this;void 0===r&&(r=!0),this._codemirror.setCursor(e,t),r&&setTimeout((function(){n._codemirror.focus()}),0)},r.prototype.enter=function(t,r){var n=this;e.prototype.enter.call(this,t,r),this._codemirror=a.fromTextArea(r.append("textarea").node(),this.options()),this._codemirror.on("changes",(function(e,t){n.changes(t)})),this._options.forEach((function(e,t){n._codemirror.setOption(t,e)})),this.text(this._initialText)},r.prototype.update=function(t,r){e.prototype.update.call(this,t,r),this._codemirror.setOption("readOnly",this.readOnly()),this._codemirror.setOption("gutters",this.guttersOption()),this._codemirror.setSize(this.width()-2,this.height()-2),this._codemirror.refresh()},r.prototype.changes=function(e){},r.prototype.setOption=function(e,t){this._codemirror.setOption(e,t)},r}(t.HTMLWidget);u.prototype._class+=" codemirror_Editor",u.prototype.publish("markerTextAlign","right","string","Gutter marker text alignment",["left","center","right"]),u.prototype.publish("readOnly",!1,"boolean","If true, the contents will be uneditable"),u.prototype.publish("gutterMarkerWidth",0,"number","Width of gutter marker column displayed to the left of line numbers (pixels)");var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"text/css",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.css=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);c.prototype._class+=" codemirror_CSSEditor";var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"text/x-dot"})},t.prototype.dot=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);d.prototype._class+=" codemirror_JSEditor";s(".codemirror_ECLEditor .cm-s-default span.cm-comment{color:green}.codemirror_ECLEditor .cm-s-default span.cm-keyword{color:#00f}.codemirror_ECLEditor .cm-s-default span.cm-variable{color:navy;font-weight:700}.codemirror_ECLEditor .cm-s-default span.cm-variable-2,.codemirror_ECLEditor .cm-s-default span.cm-variable-3{color:maroon}.codemirror_ECLEditor .cm-s-default span.cm-builtin{color:purple}.codemirror_ECLEditor .cm-s-default span.cm-string{color:grey}.cm-s-default span.cm-atom,.codemirror_ECLEditor .cm-s-default span.cm-number{color:#000}.codemirror_ECLEditor .cm-s-default span.cm-meta{color:#004080}.codemirror_ECLEditor .ErrorLine{background:#c00!important;color:#fff!important}.codemirror_ECLEditor .WarningLine{background:#ff9!important}.codemirror_ECLEditor .highlightline{background:#e8f2ff!important}");var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"text/x-ecl",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.ecl=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);f.prototype._class+=" codemirror_ECLEditor";var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"htmlmixed",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.html=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);h.prototype._class+=" codemirror_HTMLEditor";var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"text/javascript",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.javascript=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);p.prototype._class+=" codemirror_JSEditor";var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"application/json",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.json=function(e){return arguments.length?(this.text(JSON.stringify(e,null,"\t")),this):JSON.parse(this.text())},t}(u);m.prototype._class+=" codemirror_JSONEditor";var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"text/x-gfm",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.markdown=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);g.prototype._class+=" codemirror_MarkdownEditor";var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:{name:"text/x-gfm",defaultMode:"javascript"}})},t}(g);v.prototype._class+=" codemirror_ObservableMarkdownEditor";var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.options=function(){return i(i({},e.prototype.options.call(this)),{mode:"application/xml",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]})},t.prototype.xml=function(e){return arguments.length?(this.text(e),this):this.text()},t}(u);y.prototype._class+=" codemirror_XMLEditor",e.BUILD_VERSION="2.105.9",e.CSSEditor=c,e.DOTEditor=d,e.ECLEditor=f,e.Editor=u,e.HTMLEditor=h,e.JSEditor=p,e.JSONEditor=m,e.MarkdownEditor=g,e.ObservableMarkdownEditor=v,e.PKG_NAME="@hpcc-js/codemirror",e.PKG_VERSION="2.61.4",e.XMLEditor=y,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=index.min.js.map