(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-48822c69"],{"362a":function(e,t,r){},"56b3":function(e,t,r){(function(t,r){e.exports=r()})(0,(function(){"use strict";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),l=n||i||o,a=l&&(n?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=f&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,s=!0);var C=y&&(u||f&&(null==x||x<12.11)),k=r||l&&a>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,M=function(e,t){var r=e.className,n=S(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 T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return T(e).appendChild(t)}function N(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)return l+(t-o);l+=a-o,l+=r-l%r,o=a+1}}g?F=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(F=function(e){try{e.select()}catch(t){}});var R=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};function B(e,t){for(var r=0;r=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}var K=[""];function X(e){while(K.length<=e)K.push(Y(K)+" ");return K[e]}function Y(e){return e[e.length-1]}function q(e,t){for(var r=[],n=0;n"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function re(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\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 oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function le(e,t,r){while((r<0?t>0:tr?-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 se(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;ot||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}var ue=null;function ce(e,t,r){var n;ue=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:ue=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:ue=i)}return null!=n?n:ue}var fe=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]/,l=/[Lb1n]/,a=/[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,f=[],h=0;h-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function me(e,t){var r=ge(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function xe(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){ve(this,e,t)}}function Ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Le(e){Ce(e),ke(e)}function Me(e){return e.target||e.srcElement}function Te(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Oe,Ne,Ae=function(){if(l&&a<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function De(e){if(null==Oe){var t=N("span","​");O(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Oe=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&a<8))}var r=Oe?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function We(e){if(null!=Ne)return Ne;var t=O(e,document.createTextNode("AخA")),r=L(t,0,1).getBoundingClientRect(),n=L(t,1,2).getBoundingClientRect();return T(e),!(!r||r.left==r.right)&&(Ne=n.right-r.right<3)}var Ee=3!="\n\nb".split(/\n/).length?function(e){var t=0,r=[],n=e.length;while(t<=n){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},He=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Fe=function(){var e=N("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Pe=null;function Ie(e){if(null!=Pe)return Pe;var t=O(e,N("span","x")),r=t.getBoundingClientRect(),n=L(t,0,1).getBoundingClientRect();return Pe=Math.abs(r.left-n.left)>1}var ze={},Re={};function Be(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ze[e]=t}function je(e,t){Re[e]=t}function Ve(e){if("string"==typeof e&&Re.hasOwnProperty(e))e=Re[e];else if(e&&"string"==typeof e.name&&Re.hasOwnProperty(e.name)){var t=Re[e.name];"string"==typeof t&&(t={name:t}),e=Q(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=Ve(t);var r=ze[t.name];if(!r)return Ge(e,"text/plain");var n=r(e,t);if(_e.hasOwnProperty(t.name)){var i=_e[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var _e={};function Ue(e,t){var r=_e.hasOwnProperty(e)?_e[e]:_e[e]={};I(t,r)}function $e(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 Ke(e,t){var r;while(e.innerMode){if(r=e.innerMode(t),!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}}function Xe(e,t,r){return!e.startState||e.startState(t,r)}var Ye=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 qe(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");var r=e;while(!r.lines)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&tr?it(r,qe(e,r).text.length):ht(t,qe(e,t.line).text.length)}function ht(e,t){var r=e.ch;return null==r||r>t?it(e.line,t):r<0?it(e.line,0):e}function dt(e,t){for(var r=[],n=0;n=this.string.length},Ye.prototype.sol=function(){return this.pos==this.lineStart},Ye.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ye.prototype.next=function(){if(this.post},Ye.prototype.eatSpace=function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},Ye.prototype.skipToEnd=function(){this.pos=this.string.length},Ye.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ye.prototype.backUp=function(e){this.pos-=e},Ye.prototype.column=function(){return this.lastColumnPos0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return!1!==t&&(this.pos+=e.length),!0},Ye.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ye.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ye.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ye.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var pt=function(e,t){this.state=e,this.lookAhead=t},gt=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 vt(e,t,r,n){var i=[e.state.modeGen],o={};Lt(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),o,n);for(var l=r.state,a=function(n){r.baseTokens=i;var a=e.state.overlays[n],s=1,u=0;r.state=!0,Lt(e,t.text,a.mode,r,(function(e,t){var r=s;while(ue&&i.splice(s,1,e,i[s+1],n),s+=2,u=Math.min(e,n)}if(t)if(a.opaque)i.splice(r,s-r,e,"overlay "+t),s=r+2;else for(;re.options.maxHighlightLength&&$e(e.doc.mode,n.state),o=vt(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 yt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new gt(n,!0,t);var o=Mt(e,t,r),l=o>n.first&&qe(n,o-1).stateAfter,a=l?gt.fromSaved(n,l,o):new gt(n,Xe(n.mode),o);return n.iter(o,t,(function(r){bt(e,r.text,a);var n=a.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&nt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}gt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},gt.prototype.baseToken=function(e){if(!this.baseTokens)return null;while(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}},gt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},gt.fromSaved=function(e,t,r){return t instanceof pt?new gt(e,$e(e.mode,t.state),r,t.lookAhead):new gt(e,$e(e.mode,t),r)},gt.prototype.save=function(e){var t=!1!==e?$e(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new pt(t,this.maxLookAhead):t};var Ct=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function kt(e,t,r,n){var i,o=e.doc,l=o.mode;t=ft(o,t);var a,s=qe(o,t.line),u=yt(e,t.line,r),c=new Ye(s.text,e.options.tabSize,u);n&&(a=[]);while((n||c.pose.options.maxHighlightLength?(a=!1,l&&bt(e,t,n,f.pos),f.pos=t.length,s=null):s=St(xt(r,f,n.state,h),o),h){var d=h[0].name;d&&(s="m-"+(s?d+" "+s:d))}if(!a||c!=s){while(ul;--a){if(a<=o.first)return o.first;var s=qe(o,a-1),u=s.stateAfter;if(u&&(!r||a+(u instanceof pt?u.lookAhead:0)<=o.modeFrontier))return a;var c=z(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=a-1,n=c)}return i}function Tt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontierr;n--){var i=qe(e,n).stateAfter;if(i&&(!(i instanceof pt)||n+i.lookAhead=t:o.to>t);(n||(n=[])).push(new Wt(l,o.from,s?null:o.to))}}return n}function It(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t);if(a||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from0&&a)for(var w=0;w0)){var c=[s,1],f=ot(u.from,a.from),h=ot(u.to,a.to);(f<0||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:a.from}),(h>0||!l.inclusiveRight&&!h)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}function jt(e){var t=e.markedSpans;if(t){for(var r=0;rt)&&(!r||Ut(r,o.marker)<0)&&(r=o.marker)}return r}function qt(e,t,r,n,i){var o=qe(e,t),l=Nt&&o.markedSpans;if(l)for(var a=0;a=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ot(u.to,r)>=0:ot(u.to,r)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ot(u.from,n)<=0:ot(u.from,n)<0)))return!0}}}function Zt(e){var t;while(t=Kt(e))e=t.find(-1,!0).line;return e}function Jt(e){var t;while(t=Xt(e))e=t.find(1,!0).line;return e}function Qt(e){var t,r;while(t=Xt(e))e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function er(e,t){var r=qe(e,t),n=Zt(r);return r==n?t:et(n)}function tr(e,t){if(t>e.lastLine())return t;var r,n=qe(e,t);if(!rr(e,n))return t;while(r=Xt(n))n=r.find(1,!0).line;return et(n)+1}function rr(e,t){var r=Nt&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var ar=function(e,t,r){this.text=e,Vt(this,t),this.height=r?r(this):1};function sr(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),jt(e),Vt(e,r);var i=n?n(e):1;i!=e.height&&Qe(e,i)}function ur(e){e.parent=null,jt(e)}ar.prototype.lineNo=function(){return et(this)},xe(ar);var cr={},fr={};function hr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?fr:cr;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function dr(e,t){var r=A("span",null,null,s?"padding-right: .1px":null),n={pre:A("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,l=void 0;n.pos=0,n.addToken=gr,We(e.display.measure)&&(l=he(o,e.doc.direction))&&(n.addToken=mr(n.addToken,l)),n.map=[];var a=t!=e.display.externalMeasured&&et(o);br(o,n,mt(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=H(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=H(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(De(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 u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return me(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=H(n.pre.className,n.textClass||"")),n}function pr(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gr(e,t,r,n,i,o,s){if(t){var u,c=e.splitSpaces?vr(t,e.trailingSpace):t,f=e.cm.state.specialChars,h=!1;if(f.test(t)){u=document.createDocumentFragment();var d=0;while(1){f.lastIndex=d;var p=f.exec(t),g=p?p.index-d:t.length-d;if(g){var v=document.createTextNode(c.slice(d,d+g));l&&a<9?u.appendChild(N("span",[v])):u.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!p)break;d+=g+1;var m=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;m=u.appendChild(N("span",X(b),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?(m=u.appendChild(N("span","\r"==p[0]?"␍":"␤","cm-invalidchar")),m.setAttribute("cm-text",p[0]),e.col+=1):(m=e.cm.options.specialCharPlaceholder(p[0]),m.setAttribute("cm-text",p[0]),l&&a<9?u.appendChild(N("span",[m])):u.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),l&&a<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||n||i||h||o){var w=r||"";n&&(w+=n),i&&(w+=i);var x=N("span",[u],w,o);if(s)for(var C in s)s.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,s[C]);return e.content.appendChild(x)}e.content.appendChild(u)}}function vr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;iu&&f.from<=u)break;if(f.to>=c)return e(r,n,i,o,l,a,s);e(r,n.slice(0,f.to-u),i,o,null,a,s),o=null,n=n.slice(f.to-u),u=f.to}}}function yr(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 br(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,a,s,u,c,f,h,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){s=u=c=a="",h=null,f=null,m=1/0;for(var y=[],b=void 0,w=0;wp||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(s+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((h||(h={})).title=C.title),C.attributes)for(var k in C.attributes)(h||(h={}))[k]=C.attributes[k];C.collapsed&&(!f||Ut(f.marker,C)<0)&&(f=x)}else x.from>p&&m>x.from&&(m=x.from)}if(b)for(var S=0;S=d)break;var M=Math.min(d,m);while(1){if(v){var T=p+v.length;if(!f){var O=T>M?v.slice(0,M-p):v;t.addToken(t,O,l?l+s:s,c,p+O.length==m?u:"",a,h)}if(T>=M){v=v.slice(M-p),p=M;break}p=T,c=""}v=i.slice(o,o=r[g++]),l=hr(r[g++],t.cm.options)}}else for(var N=1;N2&&o.push((s.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function qr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Zr(e,t){t=Zt(t);var r=et(t),n=e.display.externalMeasured=new wr(e.doc,t,r);n.lineN=r;var i=n.built=dr(e,n);return n.text=i.pre,O(e.display.lineMeasure,i.pre),n}function Jr(e,t,r,n){return tn(e,en(e,t),r,n)}function Qr(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(o=s-a,i=o-1,t>=s&&(l="right")),null!=i){if(n=e[u+2],a==s&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)while(u&&e[u-2]==e[u-3]&&e[u-1].insertLeft)n=e[2+(u-=3)],l="left";if("right"==r&&i==s-a)while(u=0;i--)if((r=e[i]).left!=r.right)break;return r}function an(e,t,r,n){var i,o=on(t.map,r,n),s=o.node,u=o.start,c=o.end,f=o.collapse;if(3==s.nodeType){for(var h=0;h<4;h++){while(u&&oe(t.line.text.charAt(o.coverStart+u)))--u;while(o.coverStart+c0&&(f=n="right"),i=e.options.lineWrapping&&(d=s.getClientRects()).length>1?d["right"==n?d.length-1:0]:s.getBoundingClientRect()}if(l&&a<9&&!u&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Nn(e.display),top:p.top,bottom:p.bottom}:nn}for(var g=i.top-t.rect.top,v=i.bottom-t.rect.top,m=(g+v)/2,y=t.view.measure.heights,b=0;b=n.text.length?(s=n.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l("before"==u?s-1:s,"before"==u);function c(e,t,r){var n=a[t],i=1==n.level;return l(r?e-1:e,i!=r)}var f=ce(a,s,u),h=ue,d=c(s,f,"before"==u);return null!=h&&(d.other=c(s,h,"before"!=u)),d}function bn(e,t){var r=0;t=ft(e.doc,t),e.options.lineWrapping||(r=Nn(e.display)*t.ch);var n=qe(e.doc,t.line),i=ir(n)+Gr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function wn(e,t,r,n,i){var o=it(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function xn(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return wn(n.first,0,null,-1,-1);var i=tt(n,r),o=n.first+n.size-1;if(i>o)return wn(n.first+n.size-1,qe(n,o).text.length,null,1,1);t<0&&(t=0);for(var l=qe(n,i);;){var a=Ln(e,l,i,t,r),s=Yt(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=qe(n,i=u.line)}}function Cn(e,t,r,n){n-=pn(t);var i=t.text.length,o=ae((function(t){return tn(e,r,t-1).bottom<=n}),i,0);return i=ae((function(t){return tn(e,r,t).top>n}),o,i),{begin:o,end:i}}function kn(e,t,r,n){r||(r=en(e,t));var i=gn(e,t,tn(e,r,n),"line").top;return Cn(e,t,r,i)}function Sn(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Ln(e,t,r,n,i){i-=ir(t);var o=en(e,t),l=pn(t),a=0,s=t.text.length,u=!0,c=he(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?Tn:Mn)(e,t,r,o,c,n,i);u=1!=f.level,a=u?f.from:f.to-1,s=u?f.to:f.from-1}var h,d,p=null,g=null,v=ae((function(t){var r=tn(e,o,t);return r.top+=l,r.bottom+=l,!!Sn(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)}),a,s),m=!1;if(g){var y=n-g.left=w.bottom?1:0}return v=le(t.text,v,1),wn(r,v,d,m,n-h)}function Mn(e,t,r,n,i,o,l){var a=ae((function(a){var s=i[a],u=1!=s.level;return Sn(yn(e,it(r,u?s.to:s.from,u?"before":"after"),"line",t,n),o,l,!0)}),0,i.length-1),s=i[a];if(a>0){var u=1!=s.level,c=yn(e,it(r,u?s.from:s.to,u?"after":"before"),"line",t,n);Sn(c,o,l,!0)&&c.top>l&&(s=i[a-1])}return s}function Tn(e,t,r,n,i,o,l){var a=Cn(e,t,n,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,f=null,h=0;h=u||d.to<=s)){var p=1!=d.level,g=tn(e,n,p?Math.min(u,d.to)-1:Math.max(s,d.from)).right,v=gv)&&(c=d,f=v)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function On(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==rn){rn=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)rn.appendChild(document.createTextNode("x")),rn.appendChild(N("br"));rn.appendChild(document.createTextNode("x"))}O(e.measure,rn);var r=rn.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),T(e.measure),r||1}function Nn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),r=N("pre",[t],"CodeMirror-line-like");O(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function An(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;r[a]=o.offsetLeft+o.clientLeft+i,n[a]=o.clientWidth}return{fixedPos:Dn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Dn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Wn(e){var t=On(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Nn(e.display)-3);return function(i){if(rr(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l0&&(s=qe(e.doc,u.line).text).length==u.ch){var c=z(s,s.length,e.options.tabSize)-s.length;u=it(u.line,Math.max(0,Math.round((o-Ur(e.display).left)/Nn(e.display))-c))}return u}function Fn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;nt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nt&&er(e.doc,t)i.viewFrom?zn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)zn(e);else if(t<=i.viewFrom){var o=Rn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):zn(e)}else if(r>=i.viewTo){var l=Rn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):zn(e)}else{var a=Rn(e,t,t,-1),s=Rn(e,r,r+n,1);a&&s?(i.view=i.view.slice(0,a.index).concat(xr(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):zn(e)}var u=i.externalMeasured;u&&(r=i.lineN&&t=n.viewTo)){var o=n.view[Fn(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==B(l,r)&&l.push(r)}}}function zn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Rn(e,t,r,n){var i,o=Fn(e,t),l=e.display.view;if(!Nt||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var a=e.display.viewFrom,s=0;s0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,r+=i}while(er(e.doc,r)!=r){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function Bn(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=xr(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=xr(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Fn(e,r)))),n.viewTo=r}function jn(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo||a.to().line0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Xn(e){e.state.focused||(e.display.input.focus(),qn(e))}function Yn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zn(e))}),100)}function qn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(me(e,"focus",e,t),e.state.focused=!0,E(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()),Kn(e))}function Zn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(me(e,"blur",e,t),e.state.focused=!1,M(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Jn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n.005||h<-.005)&&(Qe(i.line,s),Qn(i.line),i.rest))for(var d=0;de.display.sizerWidth){var p=Math.ceil(u/Nn(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Qn(e){if(e.widgets)for(var t=0;t=l&&(o=tt(t,ir(qe(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function ti(e,t){if(!ye(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=N("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Gr(e.display))+"px;\n height: "+(t.bottom-t.top+$r(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ri(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(t=t.ch?it(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t,r="before"==t.sticky?it(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,a=yn(e,t),s=r&&r!=t?yn(e,r):a;i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-n,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+n};var u=ii(e,i),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=u.scrollTop&&(fi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(di(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(l=!0)),!l)break}return i}function ni(e,t){var r=ii(e,t);null!=r.scrollTop&&fi(e,r.scrollTop),null!=r.scrollLeft&&di(e,r.scrollLeft)}function ii(e,t){var r=e.display,n=On(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Xr(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+_r(r),s=t.topa-n;if(t.topi+o){var c=Math.min(t.top,(u?a:t.bottom)-o);c!=i&&(l.scrollTop=c)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,h=Kr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>h;return d&&(t.right=t.left+h),t.left<10?l.scrollLeft=0:t.lefth+f-3&&(l.scrollLeft=t.right+(d?0:10)-h),l}function oi(e,t){null!=t&&(ui(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function li(e){ui(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ai(e,t,r){null==t&&null==r||ui(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function si(e,t){ui(e),e.curOp.scrollToPos=t}function ui(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=bn(e,t.from),n=bn(e,t.to);ci(e,r,n,t.margin)}}function ci(e,t,r,n){var i=ii(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});ai(e,i.scrollLeft,i.scrollTop)}function fi(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||Vi(e,{top:t}),hi(e,t,!0),r&&Vi(e),Hi(e,100))}function hi(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 di(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,$i(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function pi(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+_r(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+$r(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var gi=function(e,t,r){this.cm=r;var n=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),pe(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),pe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};gi.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.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}},gi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gi.prototype.zeroWidthHack=function(){var e=y&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},gi.prototype.enableZeroWidthBar=function(e,t,r){function n(){var i=e.getBoundingClientRect(),o="vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},gi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var vi=function(){};function mi(e,t){t||(t=pi(e));var r=e.display.barWidth,n=e.display.barHeight;yi(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Jn(e),yi(e,pi(e)),r=e.display.barWidth,n=e.display.barHeight}function yi(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=""}vi.prototype.update=function(){return{bottom:0,right:0}},vi.prototype.setScrollLeft=function(){},vi.prototype.setScrollTop=function(){},vi.prototype.clear=function(){};var bi={native:gi,null:vi};function wi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new bi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(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?di(e,t):fi(e,t)}),e),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)}var xi=0;function Ci(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:++xi},kr(e.curOp)}function ki(e){var t=e.curOp;t&&Lr(t,(function(e){for(var t=0;t=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Pi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Mi(e){e.updatedDisplay=e.mustUpdate&&Bi(e.cm,e.update)}function Ti(e){var t=e.cm,r=t.display;e.updatedDisplay&&Jn(t),e.barMeasure=pi(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Jr(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+$r(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Kr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Oi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var r=+new Date+e.options.workTime,n=yt(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 l=o.styles,a=o.text.length>e.options.maxHighlightLength?$e(t.mode,n.state):null,s=vt(e,o,n,!0);a&&(n.state=a),o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!f&&hr)return Hi(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Ai(e,(function(){for(var t=0;t=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==jn(e))return!1;Ki(e)&&(zn(e),t.dims=An(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroml&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Nt&&(o=er(e.doc,o),l=tr(e.doc,l));var a=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Bn(e,o,l),r.viewOffset=ir(qe(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var s=jn(e);if(!a&&0==s&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=zi(e);return s>4&&(r.lineDiv.style.display="none"),Gi(e,r.updateLineNumbers,t.dims),s>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,Ri(u),T(r.cursorDiv),T(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,a&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Hi(e,400)),r.updateLineNumbers=null,!0}function ji(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Kr(e))n&&(t.visible=ei(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+_r(e.display)-Xr(e),r.top)}),t.visible=ei(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Bi(e,t))break;Jn(e);var i=pi(e);Vn(e),mi(e,i),Ui(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 Vi(e,t){var r=new Pi(e,t);if(Bi(e,r)){Jn(e),ji(e,r);var n=pi(e);Vn(e),mi(e,n),Ui(e,n),r.finish()}}function Gi(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,l=o.firstChild;function a(t){var r=t.nextSibling;return s&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,f=0;f-1&&(d=!1),Nr(e,h,c,r)),d&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(nt(e.options,c)))),l=h.node.nextSibling}else{var p=Ir(e,h,c,r);o.insertBefore(p,l)}c+=h.size}while(l)l=a(l)}function _i(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ui(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+$r(e)+"px"}function $i(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=Dn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;la.clientWidth,c=a.scrollHeight>a.clientHeight;if(i&&u||o&&c){if(o&&y&&s)e:for(var h=t.target,d=l.view;h!=a;h=h.parentNode)for(var p=0;p=0&&ot(e,n.to())<=0)return r}return-1};var io=function(e,t){this.anchor=e,this.head=t};function oo(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort((function(e,t){return ot(e.from(),t.from())})),r=B(t,i);for(var o=1;o0:s>=0){var u=ut(a.from(),l.from()),c=st(a.to(),l.to()),f=a.empty()?l.from()==l.head:a.from()==a.head;o<=r&&--r,t.splice(--o,2,new io(f?c:u,f?u:c))}}return new no(t,r)}function lo(e,t){return new no([new io(e,t||e)],0)}function ao(e){return e.text?it(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function so(e,t){if(ot(e,t.from)<0)return e;if(ot(e,t.to)<=0)return ao(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+=ao(t).ch-t.to.ch),it(r,n)}function uo(e,t){for(var r=[],n=0;n1&&e.remove(a.line+1,p-1),e.insert(a.line+1,m)}Tr(e,"change",e,t)}function mo(e,t,r){function n(e,i,o){if(e.linked)for(var l=0;l1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}function Lo(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,a=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=So(i,i.lastOp==n)))l=Y(o.changes),0==ot(t.from,t.to)&&0==ot(t.from,l.to)?l.to=ao(t):o.changes.push(Co(e,t));else{var s=Y(i.done);s&&s.ranges||Oo(e.sel,i.done),o={changes:[Co(e,t)],generation:i.generation},i.done.push(o);while(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=a,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||me(e,"historyAdded")}function Mo(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 To(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||Mo(e,o,Y(i.done),t))?i.done[i.done.length-1]=t:Oo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&ko(i.undone)}function Oo(e,t){var r=Y(t);r&&r.ranges&&r.equals(e)||t.push(e)}function No(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 Ao(e){if(!e)return null;for(var t,r=0;r-1&&(Y(a)[f]=u[f],delete u[f])}}}return n}function Ho(e,t,r,n){if(n){var i=e.anchor;if(r){var o=ot(t,i)<0;o!=ot(r,i)<0?(i=t,t=r):o!=ot(t,r)<0&&(t=r)}return new io(i,t)}return new io(r||t,t)}function Fo(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),jo(e,new no([Ho(e.sel.primary(),t,r,i)],0),n)}function Po(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:a.to>t.ch))){if(i&&(me(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!s.atomic)continue;if(r){var f=s.find(n<0?1:-1),h=void 0;if((n<0?c:u)&&(f=Xo(e,f,-n,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(h=ot(f,r))&&(n<0?h<0:h>0))return $o(e,f,t,n,i)}var d=s.find(n<0?-1:1);return(n<0?u:c)&&(d=Xo(e,d,n,d.line==t.line?o:null)),d?$o(e,d,t,n,i):null}}return t}function Ko(e,t,r,n,i){var o=n||1,l=$o(e,t,r,o,i)||!i&&$o(e,t,r,o,!0)||$o(e,t,r,-o,i)||!i&&$o(e,t,r,-o,!0);return l||(e.cantEdit=!0,it(e.first,0))}function Xo(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?ft(e,it(t.line-1)):null:r>0&&t.ch==(n||qe(e,t.line)).text.length?t.line=0;--i)Jo(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Jo(e,t)}}function Jo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ot(t.from,t.to)){var r=uo(e,t);Lo(e,t,r,e.cm?e.cm.curOp.id:NaN),tl(e,t,r,zt(e,t));var n=[];mo(e,(function(e,r){r||-1!=B(n,e.history)||(ll(e.history,t),n.push(e.history)),tl(e,t,null,zt(e,t))}))}}function Qo(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,l=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,u=0;u=0;--d){var p=h(d);if(p)return p.v}}}}function el(e,t){if(0!=t&&(e.first+=t,e.sel=new no(q(e.sel.ranges,(function(e){return new io(it(e.anchor.line+t,e.anchor.ch),it(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Pn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:it(o,qe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ze(e,t.from,t.to),r||(r=uo(e,t)),e.cm?rl(e.cm,t,n):vo(e,t,n),Vo(e,r,G),e.cantEdit&&Ko(e,it(e.firstLine(),0))&&(e.cantEdit=!1)}}function rl(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=et(Zt(qe(n,o.line))),n.iter(s,l.line+1,(function(e){if(e==i.maxLine)return a=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&be(e),vo(n,t,r,Wn(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,(function(e){var t=or(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),Tt(n,o.line),Hi(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?Pn(e):o.line!=l.line||1!=t.text.length||go(e.doc,t)?Pn(e,o.line,l.line+1,u):In(e,o.line,"text");var c=we(e,"changes"),f=we(e,"change");if(f||c){var h={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};f&&Tr(e,"change",e,h),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function nl(e,t,r,n,i){var o;n||(n=r),ot(n,r)<0&&(o=[n,r],r=o[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Zo(e,{from:r,to:n,text:t,origin:i})}function il(e,t,r,n){r1||!(this.children[0]instanceof sl))){var a=[];this.collapse(a),this.children=[new sl(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=i.lines.length%25+25,a=l;a10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(qt(e,t.line,t,r,o)||t.line!=r.line&&qt(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Dt()}o.addToHistory&&Lo(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var a,s=t.line,u=e.cm;if(e.iter(s,r.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Zt(e)==u.display.maxLine&&(a=!0),o.collapsed&&s!=t.line&&Qe(e,0),Ft(e,new Wt(o,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){rr(e,t)&&Qe(t,0)})),o.clearOnEnter&&pe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(At(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++dl,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)Pn(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++)In(u,c,"text");o.atomic&&_o(u.doc),Tr(u,"markerAdded",u,o)}return o}pl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ci(e),we(this,"clear")){var r=this.find();r&&Tr(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Pn(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&_o(e.doc)),e&&Tr(e,"markerCleared",e,this,n,i),t&&ki(e),this.parent&&this.parent.clear()}},pl.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;s--)Zo(this,n[s]);a?Bo(this,a):this.cm&&li(this.cm)})),undo:Ei((function(){Qo(this,"undo")})),redo:Ei((function(){Qo(this,"redo")})),undoSelection:Ei((function(){Qo(this,"undo",!0)})),redoSelection:Ei((function(){Qo(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.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=ft(this,e),t=ft(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var l=o.markedSpans;if(l)for(var a=0;a=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;ne)return t=e,!0;e-=o,++r})),ft(this,it(r,t))},indexFromPos:function(e){e=ft(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),Vo(t.doc,lo(r,r)),h)for(var d=0;d=0;t--)nl(e.doc,"",n[t].from,n[t].to,"+delete");li(e)}))}function $l(e,t,r){var n=le(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Kl(e,t,r){var n=$l(e,t.ch,r);return null==n?null:new it(t.line,n,r<0?"after":"before")}function Xl(e,t,r,n,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=he(r,t.doc.direction);if(o){var l,a=i<0?Y(o):o[0],s=i<0==(1==a.level),u=s?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var c=en(t,r);l=i<0?r.text.length-1:0;var f=tn(t,c,l).top;l=ae((function(e){return tn(t,c,e).top==f}),i<0==(1==a.level)?a.from:a.to-1,l),"before"==u&&(l=$l(r,l,1))}else l=i<0?a.to:a.from;return new it(n,l,u)}}return new it(n,i<0?r.text.length:0,i<0?"before":"after")}function Yl(e,t,r,n){var i=he(t,e.doc.direction);if(!i)return Kl(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=ce(i,r.ch,r.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(n>0?l.to>r.ch:l.from=l.from&&h>=c.begin)){var d=f?"before":"after";return new it(r.line,h,d)}}var p=function(e,t,n){for(var o=function(e,t){return t?new it(r.line,s(e,1),"before"):new it(r.line,e,"after")};e>=0&&e0==(1!=l.level),u=a?n.begin:s(n.end,-1);if(l.from<=u&&u0?c.end:s(c.begin,-1);return null==v||n>0&&v==t.text.length||(g=p(n>0?0:i.length-1,n,u(v)),!g)?null:g}Il.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"},Il.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"},Il.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Il.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"]},Il["default"]=y?Il.macDefault:Il.pcDefault;var ql={selectAll:Yo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),G)},killLine:function(e){return Ul(e,(function(t){if(t.empty()){var r=qe(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new it(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),it(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=qe(e.doc,i.line-1).text;l&&(i=new it(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),it(i.line-1,l.length-1),i,"+transpose"))}r.push(new io(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){return Ai(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-1&&(ot((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(ot(i.to(),t)>0||t.xRel<0)?xa(e,n,t,o):ka(e,n,t,o)}function xa(e,t,r,n){var i=e.display,o=!1,u=Di(e,(function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,ve(i.wrapper.ownerDocument,"mouseup",u),ve(i.wrapper.ownerDocument,"mousemove",c),ve(i.scroller,"dragstart",f),ve(i.scroller,"drop",u),o||(Ce(t),n.addNew||Fo(e.doc,r,null,null,n.extend),s||l&&9==a?setTimeout((function(){i.wrapper.ownerDocument.body.focus(),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},f=function(){return o=!0};s&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),pe(i.wrapper.ownerDocument,"mouseup",u),pe(i.wrapper.ownerDocument,"mousemove",c),pe(i.scroller,"dragstart",f),pe(i.scroller,"drop",u),Yn(e),setTimeout((function(){return i.input.focus()}),20)}function Ca(e,t,r){if("char"==r)return new io(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new io(it(t.line,0),ft(e.doc,it(t.line+1,0)));var n=r(e,t);return new io(n.from,n.to)}function ka(e,t,r,n){var i=e.display,o=e.doc;Ce(t);var l,a,s=o.sel,u=s.ranges;if(n.addNew&&!n.extend?(a=o.sel.contains(r),l=a>-1?u[a]:new io(r,r)):(l=o.sel.primary(),a=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(l=new io(r,r)),r=Hn(e,t,!0,!0),a=-1;else{var c=Ca(e,r,n.unit);l=n.extend?Ho(l,c.anchor,c.head,n.extend):c}n.addNew?-1==a?(a=u.length,jo(o,oo(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&"char"==n.unit&&!n.extend?(jo(o,oo(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):Io(o,a,l,_):(a=0,jo(o,new no([l],0),_),s=o.sel);var f=r;function h(t){if(0!=ot(f,t))if(f=t,"rectangle"==n.unit){for(var i=[],u=e.options.tabSize,c=z(qe(o,r.line).text,r.ch,u),h=z(qe(o,t.line).text,t.ch,u),d=Math.min(c,h),p=Math.max(c,h),g=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=v;g++){var m=qe(o,g).text,y=$(m,d,u);d==p?i.push(new io(it(g,y),it(g,y))):m.length>y&&i.push(new io(it(g,y),it(g,$(m,p,u))))}i.length||i.push(new io(r,r)),jo(o,oo(e,s.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=l,x=Ca(e,t,n.unit),C=w.anchor;ot(x.anchor,C)>0?(b=x.head,C=ut(w.from(),x.anchor)):(b=x.anchor,C=st(w.to(),x.head));var k=s.ranges.slice(0);k[a]=Sa(e,new io(ft(o,C),b)),jo(o,oo(e,k,a),_)}}var d=i.wrapper.getBoundingClientRect(),p=0;function g(t){var r=++p,l=Hn(e,t,!0,"rectangle"==n.unit);if(l)if(0!=ot(l,f)){e.curOp.focus=W(),h(l);var a=ei(i,o);(l.line>=a.to||l.lined.bottom?20:0;s&&setTimeout(Di(e,(function(){p==r&&(i.scroller.scrollTop+=s,g(t))})),50)}}function v(t){e.state.selectingText=!1,p=1/0,t&&(Ce(t),i.input.focus()),ve(i.wrapper.ownerDocument,"mousemove",m),ve(i.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var m=Di(e,(function(e){0!==e.buttons&&Te(e)?g(e):v(e)})),y=Di(e,v);e.state.selectingText=y,pe(i.wrapper.ownerDocument,"mousemove",m),pe(i.wrapper.ownerDocument,"mouseup",y)}function Sa(e,t){var r=t.anchor,n=t.head,i=qe(e.doc,r.line);if(0==ot(r,n)&&r.sticky==n.sticky)return t;var o=he(i);if(!o)return t;var l=ce(o,r.ch,r.sticky),a=o[l];if(a.from!=r.ch&&a.to!=r.ch)return t;var s,u=l+(a.from==r.ch==(1!=a.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=ce(o,n.ch,n.sticky),f=c-l||(n.ch-r.ch)*(1==a.level?-1:1);s=c==u-1||c==u?f<0:f>0}var h=o[u+(s?-1:0)],d=s==(1==h.level),p=d?h.from:h.to,g=d?"after":"before";return r.ch==p&&r.sticky==g?t:new io(new it(r.line,p,g),n)}function La(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(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ce(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!we(e,r))return Se(t);o-=a.top-l.viewOffset;for(var s=0;s=i){var c=tt(e.doc,o),f=e.display.gutterSpecs[s];return me(e,r,e,c,f.className,t),Se(t)}}}function Ma(e,t){return La(e,t,"gutterClick",!0)}function Ta(e,t){Vr(e.display,t)||Oa(e,t)||ye(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Oa(e,t){return!!we(e,"gutterContextMenu")&&La(e,t,"gutterContextMenu",!1)}function Na(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),fn(e)}ga.prototype.compare=function(e,t,r){return this.time+pa>e&&0==ot(t,this.pos)&&r==this.button};var Aa={toString:function(){return"CodeMirror.Init"}},Da={},Wa={};function Ea(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=Aa&&i(e,t,r)}:i)}e.defineOption=r,e.Init=Aa,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,ho(e)}),!0),r("indentUnit",2,ho,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){po(e),fn(e),Pn(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(it(n,o))}n++}));for(var i=r.length-1;i>=0;i--)nl(e.doc,t,r[i],it(r[i].line,r[i].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Aa&&e.refresh()})),r("specialCharPlaceholder",pr,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",m?"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",!w),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){Na(e),qi(e)}),!0),r("keyMap","default",(function(e,t,r){var n=_l(t),i=r!=Aa&&_l(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Fa,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=Xi(t,e.options.lineNumbers),qi(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Dn(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return mi(e)}),!0),r("scrollbarStyle","native",(function(e){wi(e),mi(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=Xi(e.options.gutters,t),qi(e)}),!0),r("firstLineNumber",1,qi,!0),r("lineNumberFormatter",(function(e){return e}),qi,!0),r("showCursorWhenSelecting",!1,Vn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(Zn(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,Ha),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,Vn,!0),r("singleCursorHeightPerLine",!0,Vn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,po,!0),r("addModeClass",!1,po,!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,po,!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 Ha(e,t,r){var n=r&&r!=Aa;if(!t!=!n){var i=e.display.dragFunctions,o=t?pe:ve;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Fa(e){e.options.lineWrapping?(E(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(M(e.display.wrapper,"CodeMirror-wrap"),lr(e)),En(e),Pn(e),fn(e),setTimeout((function(){return mi(e)}),100)}function Pa(e,t){var r=this;if(!(this instanceof Pa))return new Pa(e,t);this.options=t=t?I(t):{},I(Da,t,!1);var n=t.value;"string"==typeof n?n=new Cl(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Pa.inputStyles[t.inputStyle](this),o=this.display=new Zi(e,n,i,t);for(var u in o.wrapper.CodeMirror=this,Na(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wi(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 R,keySeq:null,specialChars:null},t.autofocus&&!m&&o.input.focus(),l&&a<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),Ia(this),Al(),Ci(this),this.curOp.forceUpdate=!0,yo(this,n),t.autofocus&&!m||this.hasFocus()?setTimeout(P(qn,this),20):Zn(this),Wa)Wa.hasOwnProperty(u)&&Wa[u](this,t[u],Aa);Ki(this),t.finishInit&&t.finishInit(this);for(var c=0;c400}pe(t.scroller,"touchstart",(function(i){if(!ye(e,i)&&!o(i)&&!Ma(e,i)){t.input.ensurePolled(),clearTimeout(r);var l=+new Date;t.activeTouch={start:l,moved:!1,prev:l-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!Vr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var o,l=e.coordsChar(t.activeTouch,"page");o=!n.prev||s(n,n.prev)?new io(l,l):!n.prev.prev||s(n,n.prev.prev)?e.findWordAt(l):new io(it(l.line,0),ft(e.doc,it(l.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Ce(r)}i()})),pe(t.scroller,"touchcancel",i),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(fi(e,t.scroller.scrollTop),di(e,t.scroller.scrollLeft,!0),me(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return ro(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return ro(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||Le(t)},over:function(t){ye(e,t)||(Ml(e,t),Le(t))},start:function(t){return Ll(e,t)},drop:Di(e,Sl),leave:function(t){ye(e,t)||Tl(e)}};var u=t.input.getField();pe(u,"keyup",(function(t){return ca.call(e,t)})),pe(u,"keydown",Di(e,sa)),pe(u,"keypress",Di(e,fa)),pe(u,"focus",(function(t){return qn(e,t)})),pe(u,"blur",(function(t){return Zn(e,t)}))}Pa.defaults=Da,Pa.optionHandlers=Wa;var za=[];function Ra(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=yt(e,t).state:r="prev");var l=e.options.tabSize,a=qe(o,t),s=z(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(n||/\S/.test(a.text)){if("smart"==r&&(u=o.mode.indent(i,a.text.slice(c.length),a.text),u==V||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?z(qe(o,t-1).text,null,l):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 f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)h+=l,f+="\t";if(hl,s=Ee(t),u=null;if(a&&n.ranges.length>1)if(Ba&&Ba.text.join("\n")==t){if(n.ranges.length%Ba.text.length==0){u=[];for(var c=0;c=0;h--){var d=n.ranges[h],p=d.from(),g=d.to();d.empty()&&(r&&r>0?p=it(p.line,p.ch-r):e.state.overwrite&&!a?g=it(g.line,Math.min(qe(o,g.line).text.length,g.ch+Y(s).length)):a&&Ba&&Ba.lineWise&&Ba.text.join("\n")==t&&(p=g=it(p.line,0)));var v={from:p,to:g,text:u?u[h%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Zo(e.doc,v),Tr(e,"inputRead",e,v)}t&&!a&&_a(e,t),li(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ga(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Ai(t,(function(){return Va(t,r,0,null,"paste")})),!0}function _a(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a-1){l=Ra(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(qe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Ra(e,i.head.line,"smart"));l&&Tr(e,"electricInput",e,i.head.line)}}}function Ua(e){for(var t=[],r=[],n=0;nr&&(Ra(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&li(this));else{var o=i.from(),l=i.to(),a=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var s=a;s0&&Io(this.doc,n,new io(o,u[n].to()),G)}}})),getTokenAt:function(e,t){return kt(this,e,t)},getLineTokens:function(e,t){return kt(this,it(e),t,!0)},getTokenTypeAt:function(e){e=ft(this.doc,e);var t,r=mt(this,qe(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]o&&(e=o,i=!0),n=qe(this.doc,e)}else n=e;return gn(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-ir(n):0)},defaultTextHeight:function(){return On(this.display)},defaultCharWidth:function(){return Nn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=yn(this,ft(this.doc,e));var l=e.bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=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?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(l=e.bottom),a+t.offsetWidth>u&&(a=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),r&&ni(this,{left:a,top:l,right:a+t.offsetWidth,bottom:l+t.offsetHeight})},triggerOnKeyDown:Wi(sa),triggerOnKeyPress:Wi(fa),triggerOnKeyUp:ca,triggerOnMouseDown:Wi(ma),execCommand:function(e){if(ql.hasOwnProperty(e))return ql[e].call(null,this)},triggerElectric:Wi((function(e){_a(this,e)})),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=ft(this.doc,e),l=0;l0&&a(r.charAt(n-1)))--n;while(i.5||this.options.lineWrapping)&&En(this),me(this,"refresh",this)})),swapDoc:Wi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),yo(this,e),fn(this),this.display.input.reset(),ai(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Tr(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}},xe(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 Ya(e,t,r,n,i){var o=t,l=r,a=qe(e,t.line),s=i&&"rtl"==e.direction?-r:r;function u(){var r=t.line+s;return!(r=e.first+e.size)&&(t=new it(r,t.ch,t.sticky),a=qe(e,r))}function c(n){var o;if(o=i?Yl(e.cm,a,t,r):Kl(a,t,r),null==o){if(n||!u())return!1;t=Xl(i,e.cm,a,t.line,s)}else t=o;return!0}if("char"==n)c();else if("column"==n)c(!0);else if("word"==n||"group"==n)for(var f=null,h="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;;p=!1){if(r<0&&!c(!p))break;var g=a.text.charAt(t.ch)||"\n",v=re(g,d)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||p||v||(v="s"),f&&f!=v){r<0&&(r=1,c(),t.sticky="after");break}if(v&&(f=v),r>0&&!c(!p))break}var m=Ko(e,t,o,l,!0);return lt(o,m)&&(m.hitSide=!0),m}function qa(e,t,r,n){var i,o,l=e.doc,a=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(s-.5*On(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(;;){if(o=xn(e,a,i),!o.outside)break;if(r<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*r}return o}var Za=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ja(e,t){var r=Qr(e,t.line);if(!r||r.hidden)return null;var n=qe(e.doc,t.line),i=qr(r,n,t.line),o=he(n,e.doc.direction),l="left";if(o){var a=ce(o,t.ch);l=a%2?"right":"left"}var s=on(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function Qa(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function es(e,t){return t&&(e.bad=!0),e}function ts(e,t,r,n,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(e){return function(t){return t.id==e}}function c(){l&&(o+=a,s&&(o+=a),l=s=!1)}function f(e){e&&(c(),o+=e)}function h(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void f(r);var o,d=t.getAttribute("cm-marker");if(d){var p=e.findMarks(it(n,0),it(i+1,0),u(+d));return void(p.length&&(o=p[0].find(0))&&f(Ze(e.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;g&&c();for(var v=0;v=t.display.viewTo||o.line=t.display.viewFrom&&Ja(t,i)||{node:s[0].measure.map[2],offset:0},c=o.linen.firstLine()&&(l=it(l.line-1,qe(n.doc,l.line-1).length)),a.ch==qe(n.doc,a.line).text.length&&a.linei.viewTo-1)return!1;l.line==i.viewFrom||0==(e=Fn(n,l.line))?(t=et(i.view[0].line),r=i.view[0].node):(t=et(i.view[e].line),r=i.view[e-1].node.nextSibling);var s,u,c=Fn(n,a.line);if(c==i.view.length-1?(s=i.viewTo-1,u=i.lineDiv.lastChild):(s=et(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1;var f=n.doc.splitLines(ts(n,r,u,t,s)),h=Ze(n.doc,it(t,0),it(s,qe(n.doc,s).text.length));while(f.length>1&&h.length>1)if(Y(f)==Y(h))f.pop(),h.pop(),s--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),t++}var d=0,p=0,g=f[0],v=h[0],m=Math.min(g.length,v.length);while(dl.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1))d--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var x=it(t,d),C=it(s,h.length?Y(h).length-p:0);return f.length>1||f[0]||ot(x,C)?(nl(n.doc,f,x,C,"+input"),!0):void 0},Za.prototype.ensurePolled=function(){this.forceCompositionEnd()},Za.prototype.reset=function(){this.forceCompositionEnd()},Za.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Za.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))},Za.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ai(this.cm,(function(){return Pn(e.cm)}))},Za.prototype.setUneditable=function(e){e.contentEditable="false"},Za.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Di(this.cm,Va)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Za.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Za.prototype.onContextMenu=function(){},Za.prototype.resetPosition=function(){},Za.prototype.needsContentAttribute=!0;var is=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null};function os(e,t){if(t=t?I(t):{},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=W();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=a.getValue()}var i;if(e.form&&(pe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=l}}catch(s){}}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&&(ve(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var a=Pa((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a}function ls(e){e.off=ve,e.on=pe,e.wheelEventPixels=to,e.Doc=Cl,e.splitLines=Ee,e.countColumn=z,e.findColumn=$,e.isWordChar=te,e.Pass=V,e.signal=me,e.Line=ar,e.changeEnd=ao,e.scrollbarModel=bi,e.Pos=it,e.cmpPos=ot,e.modes=ze,e.mimeModes=Re,e.resolveMode=Ve,e.getMode=Ge,e.modeExtensions=_e,e.extendMode=Ue,e.copyState=$e,e.startState=Xe,e.innerMode=Ke,e.commands=ql,e.keyMap=Il,e.keyName=Gl,e.isModifierKey=jl,e.lookupKey=Bl,e.normalizeKeyMap=Rl,e.StringStream=Ye,e.SharedTextMarker=vl,e.TextMarker=pl,e.LineWidget=cl,e.e_preventDefault=Ce,e.e_stopPropagation=ke,e.e_stop=Le,e.addClass=E,e.contains=D,e.rmClass=M,e.keyNames=El}is.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ye(n,e)){if(n.somethingSelected())ja({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Ua(n);ja({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,G):(r.prevInput="",i.value=t.text.join("\n"),F(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),pe(i,"input",(function(){l&&a>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),pe(i,"paste",(function(e){ye(n,e)||Ga(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),pe(i,"cut",o),pe(i,"copy",o),pe(e.scroller,"paste",(function(t){if(!Vr(e,t)&&!ye(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)}})),pe(e.lineSpace,"selectstart",(function(t){Vr(e,t)||Ce(t)})),pe(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"})}})),pe(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},is.prototype.createField=function(e){this.wrapper=Ka(),this.textarea=this.wrapper.firstChild},is.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},is.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Gn(e);if(e.options.moveInputWithCursor){var i=yn(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},is.prototype.showSelection=function(e){var t=this.cm,r=t.display;O(r.cursorDiv,e.cursors),O(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},is.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&F(this.textarea),l&&a>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",l&&a>=9&&(this.hasSelection=null))}},is.prototype.getField=function(){return this.textarea},is.prototype.supportsTouch=function(){return!1},is.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||W()!=this.textarea))try{this.textarea.focus()}catch(e){}},is.prototype.blur=function(){this.textarea.blur()},is.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},is.prototype.receivedFocus=function(){this.slowPoll()},is.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},is.prototype.fastPoll=function(){var e=!1,t=this;function r(){var n=t.poll();n||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}t.pollingFast=!0,t.polling.set(20,r)},is.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||He(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(l&&a>=9&&this.hasSelection===i||y&&/[\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")}var s=0,u=Math.min(n.length,i.length);while(s1e3||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},is.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},is.prototype.onKeyPress=function(){l&&a>=9&&(this.hasSelection=null),this.fastPoll()},is.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Hn(r,e),u=n.scroller.scrollTop;if(o&&!f){var c=r.options.resetSelectionOnContextMenu;c&&-1==r.doc.sel.contains(o)&&Di(r,jo)(r.doc,lo(o),G);var h,d=i.style.cssText,p=t.wrapper.style.cssText,g=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-g.top-5)+"px; left: "+(e.clientX-g.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(h=window.scrollY),n.input.focus(),s&&window.scrollTo(null,h),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),l&&a>=9&&m(),k){Le(e);var v=function(){ve(window,"mouseup",v),setTimeout(y,20)};pe(window,"mouseup",v)}else setTimeout(y,50)}function m(){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 y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=d,l&&a<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart)){(!l||l&&a<9)&&m();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Di(r,Yo)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},is.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},is.prototype.setUneditable=function(){},is.prototype.needsContentAttribute=!1,Ea(Pa),Xa(Pa);var as="iter insert remove copy getEditor constructor".split(" ");for(var ss in Cl.prototype)Cl.prototype.hasOwnProperty(ss)&&B(as,ss)<0&&(Pa.prototype[ss]=function(e){return function(){return e.apply(this.doc,arguments)}}(Cl.prototype[ss]));return xe(Cl),Pa.inputStyles={textarea:is,contenteditable:Za},Pa.defineMode=function(e){Pa.defaults.mode||"null"==e||(Pa.defaults.mode=e),Be.apply(this,arguments)},Pa.defineMIME=je,Pa.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Pa.defineMIME("text/plain","null"),Pa.defineExtension=function(e,t){Pa.prototype[e]=t},Pa.defineDocExtension=function(e,t){Cl.prototype[e]=t},Pa.fromTextArea=os,ls(Pa),Pa.version="5.53.2",Pa}))},"84f5":function(e,t,r){"use strict";var n=r("362a"),i=r.n(n);i.a},"8c2e":function(e,t,r){},"8f94":function(e,t,r){!function(t,n){e.exports=n(r("56b3"))}(0,(function(e){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=3)}([function(t,r){t.exports=e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=function(e){return e&&e.__esModule?e:{default:e}}(n),o=window.CodeMirror||i.default;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(e),n=1;n!?|~^@]/,d=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function p(e){var t,r=!1,n=!1;while(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=m(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=y,y(e,t)):e.eat("/")?(e.skipToEnd(),g("comment","comment")):et(e,t,1)?(p(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)return e.skipToEnd(),g("error","error");if("<"==r&&e.match("!--")||"-"==r&&e.match("->"))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))),g("operator","operator",e.current());if(c.test(r)){e.eatWhile(c);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 m(e){return function(t,r){var n,i=!1;if(a&&"@"==t.peek()&&t.match(d))return r.tokenize=v,g("jsonld-keyword","meta");while(null!=(n=t.next())){if(n==e&&!i)break;i=!i&&"\\"==n}return i||(r.tokenize=v),g("string","string")}}function y(e,t){var r,n=!1;while(r=e.next()){if("/"==r&&n){t.tokenize=v;break}n="*"==r}return g("comment","comment")}function b(e,t){var r,n=!1;while(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 w="([{}])";function x(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(u){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,l=r-1;l>=0;--l){var a=e.string.charAt(l),s=w.indexOf(a);if(s>=0&&s<3){if(!i){++l;break}if(0==--i){"("==a&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(c.test(a))o=!0;else if(/["'\/`]/.test(a))for(;;--l){if(0==l)return;var f=e.string.charAt(l-1);if(f==a&&"\\"!=e.string.charAt(l-2)){l--;break}}else if(o&&!i){++l;break}}o&&!i&&(t.fatArrowAt=l)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function k(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 S(e,t){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;M.state=e,M.stream=i,M.marked=null,M.cc=o,M.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);while(1){var l=o.length?o.pop():s?_:V;if(l(r,n)){while(o.length&&o[o.length-1].lex)o.pop()();return M.marked?M.marked:"variable"==r&&S(e,n)?"variable-2":t}}}var M={state:null,column:null,marked:null,cc:null};function T(){for(var e=arguments.length-1;e>=0;e--)M.cc.push(arguments[e])}function O(){return T.apply(null,arguments),!0}function N(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function A(e){var t=M.state;if(M.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=D(e,t.context);if(null!=n)return void(t.context=n)}else if(!N(e,t.localVars))return void(t.localVars=new H(e,t.localVars));r.globalVars&&!N(e,t.globalVars)&&(t.globalVars=new H(e,t.globalVars))}function D(e,t){if(t){if(t.block){var r=D(e,t.prev);return r?r==t.prev?t:new E(r,t.vars,!0):null}return N(e,t.vars)?t:new E(t.prev,new H(e,t.vars),!1)}return null}function W(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function E(e,t,r){this.prev=e,this.vars=t,this.block=r}function H(e,t){this.name=e,this.next=t}var F=new H("this",new H("arguments",null));function P(){M.state.context=new E(M.state.context,M.state.localVars,!1),M.state.localVars=F}function I(){M.state.context=new E(M.state.context,M.state.localVars,!0),M.state.localVars=null}function z(){M.state.localVars=M.state.context.vars,M.state.context=M.state.context.prev}function R(e,t){var r=function(){var r=M.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 k(n,M.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function B(){var e=M.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function j(e){function t(r){return r==e?O():";"==e||"}"==r||")"==r||"]"==r?T():O(t)}return t}function V(e,t){return"var"==e?O(R("vardef",t),Se,j(";"),B):"keyword a"==e?O(R("form"),$,V,B):"keyword b"==e?O(R("form"),V,B):"keyword d"==e?M.stream.match(/^\s*$/,!1)?O():O(R("stat"),X,j(";"),B):"debugger"==e?O(j(";")):"{"==e?O(R("}"),I,fe,B,z):";"==e?O():"if"==e?("else"==M.state.lexical.info&&M.state.cc[M.state.cc.length-1]==B&&M.state.cc.pop()(),O(R("form"),$,V,B,Ae)):"function"==e?O(He):"for"==e?O(R("form"),De,V,B):"class"==e||u&&"interface"==t?(M.marked="keyword",O(R("form","class"==e?e:t),Re,B)):"variable"==e?u&&"declare"==t?(M.marked="keyword",O(V)):u&&("module"==t||"enum"==t||"type"==t)&&M.stream.match(/^\s*\w/,!1)?(M.marked="keyword","enum"==t?O(Ze):"type"==t?O(Pe,j("operator"),ve,j(";")):O(R("form"),Le,j("{"),R("}"),fe,B,B)):u&&"namespace"==t?(M.marked="keyword",O(R("form"),_,V,B)):u&&"abstract"==t?(M.marked="keyword",O(V)):O(R("stat"),ie):"switch"==e?O(R("form"),$,j("{"),R("}","switch"),I,fe,B,B,z):"case"==e?O(_,j(":")):"default"==e?O(j(":")):"catch"==e?O(R("form"),P,G,V,B,z):"export"==e?O(R("stat"),Ge,B):"import"==e?O(R("stat"),Ue,B):"async"==e?O(V):"@"==t?O(_,V):T(R("stat"),_,j(";"),B)}function G(e){if("("==e)return O(Ie,j(")"))}function _(e,t){return K(e,t,!1)}function U(e,t){return K(e,t,!0)}function $(e){return"("!=e?T():O(R(")"),X,j(")"),B)}function K(e,t,r){if(M.state.fatArrowAt==M.stream.start){var n=r?ee:Q;if("("==e)return O(P,R(")"),ue(Ie,")"),B,j("=>"),n,z);if("variable"==e)return T(P,Le,j("=>"),n,z)}var i=r?q:Y;return C.hasOwnProperty(e)?O(i):"function"==e?O(He,i):"class"==e||u&&"interface"==t?(M.marked="keyword",O(R("form"),ze,B)):"keyword c"==e||"async"==e?O(r?U:_):"("==e?O(R(")"),X,j(")"),B,i):"operator"==e||"spread"==e?O(r?U:_):"["==e?O(R("]"),qe,B,i):"{"==e?ce(le,"}",null,i):"quasi"==e?T(Z,i):"new"==e?O(te(r)):"import"==e?O(_):O()}function X(e){return e.match(/[;\}\)\],]/)?T():T(_)}function Y(e,t){return","==e?O(X):q(e,t,!1)}function q(e,t,r){var n=0==r?Y:q,i=0==r?_:U;return"=>"==e?O(P,r?ee:Q,z):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?O(n):u&&"<"==t&&M.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?O(R(">"),ue(ve,">"),B,n):"?"==t?O(_,j(":"),i):O(i):"quasi"==e?T(Z,n):";"!=e?"("==e?ce(U,")","call",n):"."==e?O(oe,n):"["==e?O(R("]"),X,j("]"),B,n):u&&"as"==t?(M.marked="keyword",O(ve,n)):"regexp"==e?(M.state.lastType=M.marked="operator",M.stream.backUp(M.stream.pos-M.stream.start-1),O(i)):void 0:void 0}function Z(e,t){return"quasi"!=e?T():"${"!=t.slice(t.length-2)?O(Z):O(_,J)}function J(e){if("}"==e)return M.marked="string-2",M.state.tokenize=b,O(Z)}function Q(e){return x(M.stream,M.state),T("{"==e?V:_)}function ee(e){return x(M.stream,M.state),T("{"==e?V:U)}function te(e){return function(t){return"."==t?O(e?ne:re):"variable"==t&&u?O(xe,e?q:Y):T(e?U:_)}}function re(e,t){if("target"==t)return M.marked="keyword",O(Y)}function ne(e,t){if("target"==t)return M.marked="keyword",O(q)}function ie(e){return":"==e?O(B,V):T(Y,j(";"),B)}function oe(e){if("variable"==e)return M.marked="property",O()}function le(e,t){return"async"==e?(M.marked="property",O(le)):"variable"==e||"keyword"==M.style?(M.marked="property","get"==t||"set"==t?O(ae):(u&&M.state.fatArrowAt==M.stream.start&&(r=M.stream.match(/^\s*:\s*/,!1))&&(M.state.fatArrowAt=M.stream.pos+r[0].length),O(se))):"number"==e||"string"==e?(M.marked=a?"property":M.style+" property",O(se)):"jsonld-keyword"==e?O(se):u&&W(t)?(M.marked="keyword",O(le)):"["==e?O(_,he,j("]"),se):"spread"==e?O(U,se):"*"==t?(M.marked="keyword",O(le)):":"==e?T(se):void 0;var r}function ae(e){return"variable"!=e?T(se):(M.marked="property",O(He))}function se(e){return":"==e?O(U):"("==e?T(He):void 0}function ue(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var l=M.state.lexical;return"call"==l.info&&(l.pos=(l.pos||0)+1),O((function(r,n){return r==t||n==t?T():T(e)}),n)}return i==t||o==t?O():r&&r.indexOf(";")>-1?T(e):O(j(t))}return function(r,i){return r==t||i==t?O():T(e,n)}}function ce(e,t,r){for(var n=3;n"),ve):void 0}function me(e){if("=>"==e)return O(ve)}function ye(e,t){return"variable"==e||"keyword"==M.style?(M.marked="property",O(ye)):"?"==t||"number"==e||"string"==e?O(ye):":"==e?O(ve):"["==e?O(j("variable"),de,j("]"),ye):"("==e?T(Fe,ye):void 0}function be(e,t){return"variable"==e&&M.stream.match(/^\s*[?:]/,!1)||"?"==t?O(be):":"==e?O(ve):"spread"==e?O(be):T(ve)}function we(e,t){return"<"==t?O(R(">"),ue(ve,">"),B,we):"|"==t||"."==e||"&"==t?O(ve):"["==e?O(ve,j("]"),we):"extends"==t||"implements"==t?(M.marked="keyword",O(ve)):"?"==t?O(ve,j(":"),ve):void 0}function xe(e,t){if("<"==t)return O(R(">"),ue(ve,">"),B,we)}function Ce(){return T(ve,ke)}function ke(e,t){if("="==t)return O(ve)}function Se(e,t){return"enum"==t?(M.marked="keyword",O(Ze)):T(Le,he,Oe,Ne)}function Le(e,t){return u&&W(t)?(M.marked="keyword",O(Le)):"variable"==e?(A(t),O()):"spread"==e?O(Le):"["==e?ce(Te,"]"):"{"==e?ce(Me,"}"):void 0}function Me(e,t){return"variable"!=e||M.stream.match(/^\s*:/,!1)?("variable"==e&&(M.marked="property"),"spread"==e?O(Le):"}"==e?T():"["==e?O(_,j("]"),j(":"),Me):O(j(":"),Le,Oe)):(A(t),O(Oe))}function Te(){return T(Le,Oe)}function Oe(e,t){if("="==t)return O(U)}function Ne(e){if(","==e)return O(Se)}function Ae(e,t){if("keyword b"==e&&"else"==t)return O(R("form","else"),V,B)}function De(e,t){return"await"==t?O(De):"("==e?O(R(")"),We,B):void 0}function We(e){return"var"==e?O(Se,Ee):"variable"==e?O(Ee):T(Ee)}function Ee(e,t){return")"==e?O():";"==e?O(Ee):"in"==t||"of"==t?(M.marked="keyword",O(_,Ee)):T(_,Ee)}function He(e,t){return"*"==t?(M.marked="keyword",O(He)):"variable"==e?(A(t),O(He)):"("==e?O(P,R(")"),ue(Ie,")"),B,pe,V,z):u&&"<"==t?O(R(">"),ue(Ce,">"),B,He):void 0}function Fe(e,t){return"*"==t?(M.marked="keyword",O(Fe)):"variable"==e?(A(t),O(Fe)):"("==e?O(P,R(")"),ue(Ie,")"),B,pe,z):u&&"<"==t?O(R(">"),ue(Ce,">"),B,Fe):void 0}function Pe(e,t){return"keyword"==e||"variable"==e?(M.marked="type",O(Pe)):"<"==t?O(R(">"),ue(Ce,">"),B):void 0}function Ie(e,t){return"@"==t&&O(_,Ie),"spread"==e?O(Ie):u&&W(t)?(M.marked="keyword",O(Ie)):u&&"this"==e?O(he,Oe):T(Le,he,Oe)}function ze(e,t){return"variable"==e?Re(e,t):Be(e,t)}function Re(e,t){if("variable"==e)return A(t),O(Be)}function Be(e,t){return"<"==t?O(R(">"),ue(Ce,">"),B,Be):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(M.marked="keyword"),O(u?ve:_,Be)):"{"==e?O(R("}"),je,B):void 0}function je(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&W(t))&&M.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(M.marked="keyword",O(je)):"variable"==e||"keyword"==M.style?(M.marked="property",O(u?Ve:He,je)):"number"==e||"string"==e?O(u?Ve:He,je):"["==e?O(_,he,j("]"),u?Ve:He,je):"*"==t?(M.marked="keyword",O(je)):u&&"("==e?T(Fe,je):";"==e||","==e?O(je):"}"==e?O():"@"==t?O(_,je):void 0}function Ve(e,t){if("?"==t)return O(Ve);if(":"==e)return O(ve,Oe);if("="==t)return O(U);var r=M.state.lexical.prev,n=r&&"interface"==r.info;return T(n?Fe:He)}function Ge(e,t){return"*"==t?(M.marked="keyword",O(Ye,j(";"))):"default"==t?(M.marked="keyword",O(_,j(";"))):"{"==e?O(ue(_e,"}"),Ye,j(";")):T(V)}function _e(e,t){return"as"==t?(M.marked="keyword",O(j("variable"))):"variable"==e?T(U,_e):void 0}function Ue(e){return"string"==e?O():"("==e?T(_):T($e,Ke,Ye)}function $e(e,t){return"{"==e?ce($e,"}"):("variable"==e&&A(t),"*"==t&&(M.marked="keyword"),O(Xe))}function Ke(e){if(","==e)return O($e,Ke)}function Xe(e,t){if("as"==t)return M.marked="keyword",O($e)}function Ye(e,t){if("from"==t)return M.marked="keyword",O(_)}function qe(e){return"]"==e?O():T(ue(U,"]"))}function Ze(){return T(R("form"),Le,j("{"),R("}"),ue(Je,"}"),B,B)}function Je(){return T(Le,Oe)}function Qe(e,t){return"operator"==e.lastType||","==e.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function et(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 z.lex=!0,B.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new k((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&new E(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(),x(e,t)),t.tokenize!=y&&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==y)return e.Pass;if(t.tokenize!=v)return 0;var i,a=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==B)s=s.prev;else if(c!=Ae)break}while(("stat"==s.type||"form"==s.type)&&("}"==a||(i=t.cc[t.cc.length-1])&&(i==Y||i==q)&&!/^[,\.=+\-*:?[\(]/.test(n)))s=s.prev;l&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var f=s.type,h=a==f;return"vardef"==f?s.indented+("operator"==t.lastType||","==t.lastType?s.info.length+1:0):"form"==f&&"{"==a?s.indented:"form"==f?s.indented+o:"stat"==f?s.indented+(Qe(t,n)?l||o:0):"switch"!=s.info||h||0==r.doubleIndentSwitch?s.align?s.column+(h?0:1):s.indented+(h?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:a,jsonMode:s,expressionAllowed:et,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=_&&t!=U||e.cc.pop()}}})),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/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}))}}]);