UNB/ CS/ David Bremner/ teaching/ cs2613/ books/ eloquent-javascript/ js/ acorn codemirror.js
(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t():typeof define==="function"&&define.amd?define(t):(e=e||self,e.CodeMirror=t())})(this,function(){"use strict";var e=navigator.userAgent;var t=navigator.platform;var r=/gecko\/\d/i.test(e);var i=/MSIE \d/.test(e);var n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e);var a=/Edge\/(\d+)/.exec(e);var s=i||n||a;var o=s&&(i?document.documentMode||6:+(a||n)[1]);var l=!a&&/WebKit\//.test(e);var u=l&&/Qt\/\d+\.\d+/.test(e);var c=!a&&/Chrome\/(\d+)/.exec(e);var f=c&&+c[1];var h=/Opera\//.test(e);var p=/Apple Computer/.test(navigator.vendor);var d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e);var m=/PhantomJS/.test(e);var v=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2);var g=/Android/.test(e);var y=v||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e);var x=v||/Mac/.test(t);var b=/\bCrOS\b/.test(e);var w=/win/i.test(t);var k=h&&e.match(/Version\/(\d*\.\d*)/);if(k){k=Number(k[1])}if(k&&k>=15){h=false;l=true}var C=x&&(u||h&&(k==null||k<12.11));var S=r||s&&o>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var T=function(e,t){var r=e.className;var i=L(t).exec(r);if(i){var n=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(n?i[1]+n:"")}};function A(e){for(var t=e.childNodes.length;t>0;--t){e.removeChild(e.firstChild)}return e}function E(e,t){return A(e).appendChild(t)}function M(e,t,r,i){var n=document.createElement(e);if(r){n.className=r}if(i){n.style.cssText=i}if(typeof t=="string"){n.appendChild(document.createTextNode(t))}else if(t){for(var a=0;a<t.length;++a){n.appendChild(t[a])}}return n}function N(e,t,r,i){var n=M(e,t,r,i);n.setAttribute("role","presentation");return n}var _;if(document.createRange){_=function(e,t,r,i){var n=document.createRange();n.setEnd(i||e,r);n.setStart(e,t);return n}}else{_=function(e,t,r){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}i.collapse(true);i.moveEnd("character",r);i.moveStart("character",t);return i}}function P(e,t){if(t.nodeType==3){t=t.parentNode}if(e.contains){return e.contains(t)}do{if(t.nodeType==11){t=t.host}if(t==e){return true}}while(t=t.parentNode)}function I(e){var t;try{t=e.activeElement}catch(r){t=e.body||null}while(t&&t.shadowRoot&&t.shadowRoot.activeElement){t=t.shadowRoot.activeElement}return t}function O(e,t){var r=e.className;if(!L(t).test(r)){e.className+=(r?" ":"")+t}}function D(e,t){var r=e.split(" ");for(var i=0;i<r.length;i++){if(r[i]&&!L(r[i]).test(t)){t+=" "+r[i]}}return t}var R=function(e){e.select()};if(v){R=function(e){e.selectionStart=0;e.selectionEnd=e.value.length}}else if(s){R=function(e){try{e.select()}catch(e){}}}function V(e){return e.display.wrapper.ownerDocument}function F(e){return V(e).defaultView}function z(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function W(e,t,r){if(!t){t={}}for(var i in e){if(e.hasOwnProperty(i)&&(r!==false||!t.hasOwnProperty(i))){t[i]=e[i]}}return t}function B(e,t,r,i,n){if(t==null){t=e.search(/[^\s\u00a0]/);if(t==-1){t=e.length}}for(var a=i||0,s=n||0;;){var o=e.indexOf("\t",a);if(o<0||o>=t){return s+(t-a)}s+=o-a;s+=r-s%r;a=o+1}}var H=function(){this.id=null;this.f=null;this.time=0;this.handler=z(this.onTimeout,this)};H.prototype.onTimeout=function(e){e.id=0;if(e.time<=+new Date){e.f()}else{setTimeout(e.handler,e.time-+new Date)}};H.prototype.set=function(e,t){this.f=t;var r=+new Date+e;if(!this.id||r<this.time){clearTimeout(this.id);this.id=setTimeout(this.handler,e);this.time=r}};function j(e,t){for(var r=0;r<e.length;++r){if(e[r]==t){return r}}return-1}var U=50;var G={toString:function(){return"CodeMirror.Pass"}};var q={scroll:false},K={origin:"*mouse"},$={origin:"+move"};function X(e,t,r){for(var i=0,n=0;;){var a=e.indexOf("\t",i);if(a==-1){a=e.length}var s=a-i;if(a==e.length||n+s>=t){return i+Math.min(s,t-n)}n+=a-i;n+=r-n%r;i=a+1;if(n>=t){return i}}}var Y=[""];function Q(e){while(Y.length<=e){Y.push(Z(Y)+" ")}return Y[e]}function Z(e){return e[e.length-1]}function J(e,t){var r=[];for(var i=0;i<e.length;i++){r[i]=t(e[i],i)}return r}function ee(e,t,r){var i=0,n=r(t);while(i<e.length&&r(e[i])<=n){i++}e.splice(i,0,t)}function te(){}function re(e,t){var r;if(Object.create){r=Object.create(e)}else{te.prototype=e;r=new te}if(t){W(t,r)}return r}var ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ne(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||ie.test(e))}function ae(e,t){if(!t){return ne(e)}if(t.source.indexOf("\\w")>-1&&ne(e)){return true}return t.test(e)}function se(e){for(var t in e){if(e.hasOwnProperty(t)&&e[t]){return false}}return true}var oe=/[\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 le(e){return e.charCodeAt(0)>=768&&oe.test(e)}function ue(e,t,r){while((r<0?t>0:t<e.length)&&le(e.charAt(t))){t+=r}return t}function ce(e,t,r){var i=t>r?-1:1;for(;;){if(t==r){return t}var n=(t+r)/2,a=i<0?Math.ceil(n):Math.floor(n);if(a==t){return e(a)?t:r}if(e(a)){r=a}else{t=a+i}}}function fe(e,t,r,i){if(!e){return i(t,r,"ltr",0)}var n=false;for(var a=0;a<e.length;++a){var s=e[a];if(s.from<r&&s.to>t||t==r&&s.to==t){i(Math.max(s.from,t),Math.min(s.to,r),s.level==1?"rtl":"ltr",a);n=true}}if(!n){i(t,r,"ltr")}}var he=null;function pe(e,t,r){var i;he=null;for(var n=0;n<e.length;++n){var a=e[n];if(a.from<t&&a.to>t){return n}if(a.to==t){if(a.from!=a.to&&r=="before"){i=n}else{he=n}}if(a.from==t){if(a.from!=a.to&&r!="before"){i=n}else{he=n}}}return i!=null?i:he}var de=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(r){if(r<=247){return e.charAt(r)}else if(1424<=r&&r<=1524){return"R"}else if(1536<=r&&r<=1785){return t.charAt(r-1536)}else if(1774<=r&&r<=2220){return"r"}else if(8192<=r&&r<=8203){return"w"}else if(r==8204){return"b"}else{return"L"}}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var n=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,o=/[1n]/;function l(e,t,r){this.level=e;this.from=t;this.to=r}return function(e,t){var u=t=="ltr"?"L":"R";if(e.length==0||t=="ltr"&&!i.test(e)){return false}var c=e.length,f=[];for(var h=0;h<c;++h){f.push(r(e.charCodeAt(h)))}for(var p=0,d=u;p<c;++p){var m=f[p];if(m=="m"){f[p]=d}else{d=m}}for(var v=0,g=u;v<c;++v){var y=f[v];if(y=="1"&&g=="r"){f[v]="n"}else if(a.test(y)){g=y;if(y=="r"){f[v]="R"}}}for(var x=1,b=f[0];x<c-1;++x){var w=f[x];if(w=="+"&&b=="1"&&f[x+1]=="1"){f[x]="1"}else if(w==","&&b==f[x+1]&&(b=="1"||b=="n")){f[x]=b}b=w}for(var k=0;k<c;++k){var C=f[k];if(C==","){f[k]="N"}else if(C=="%"){var S=void 0;for(S=k+1;S<c&&f[S]=="%";++S){}var L=k&&f[k-1]=="!"||S<c&&f[S]=="1"?"1":"N";for(var T=k;T<S;++T){f[T]=L}k=S-1}}for(var A=0,E=u;A<c;++A){var M=f[A];if(E=="L"&&M=="1"){f[A]="L"}else if(a.test(M)){E=M}}for(var N=0;N<c;++N){if(n.test(f[N])){var _=void 0;for(_=N+1;_<c&&n.test(f[_]);++_){}var P=(N?f[N-1]:u)=="L";var I=(_<c?f[_]:u)=="L";var O=P==I?P?"L":"R":u;for(var D=N;D<_;++D){f[D]=O}N=_-1}}var R=[],V;for(var F=0;F<c;){if(s.test(f[F])){var z=F;for(++F;F<c&&s.test(f[F]);++F){}R.push(new l(0,z,F))}else{var W=F,B=R.length,H=t=="rtl"?1:0;for(++F;F<c&&f[F]!="L";++F){}for(var j=W;j<F;){if(o.test(f[j])){if(W<j){R.splice(B,0,new l(1,W,j));B+=H}var U=j;for(++j;j<F&&o.test(f[j]);++j){}R.splice(B,0,new l(2,U,j));B+=H;W=j}else{++j}}if(W<F){R.splice(B,0,new l(1,W,F))}}}if(t=="ltr"){if(R[0].level==1&&(V=e.match(/^\s+/))){R[0].from=V[0].length;R.unshift(new l(0,0,V[0].length))}if(Z(R).level==1&&(V=e.match(/\s+$/))){Z(R).to-=V[0].length;R.push(new l(0,c-V[0].length,c))}}return t=="rtl"?R.reverse():R}}();function me(e,t){var r=e.order;if(r==null){r=e.order=de(e.text,t)}return r}var ve=[];var ge=function(e,t,r){if(e.addEventListener){e.addEventListener(t,r,false)}else if(e.attachEvent){e.attachEvent("on"+t,r)}else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||ve).concat(r)}};function ye(e,t){return e._handlers&&e._handlers[t]||ve}function xe(e,t,r){if(e.removeEventListener){e.removeEventListener(t,r,false)}else if(e.detachEvent){e.detachEvent("on"+t,r)}else{var i=e._handlers,n=i&&i[t];if(n){var a=j(n,r);if(a>-1){i[t]=n.slice(0,a).concat(n.slice(a+1))}}}}function be(e,t){var r=ye(e,t);if(!r.length){return}var i=Array.prototype.slice.call(arguments,2);for(var n=0;n<r.length;++n){r[n].apply(null,i)}}function we(e,t,r){if(typeof t=="string"){t={type:t,preventDefault:function(){this.defaultPrevented=true}}}be(e,r||t.type,e,t);return Ae(t)||t.codemirrorIgnore}function ke(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t){return}var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]);for(var i=0;i<t.length;++i){if(j(r,t[i])==-1){r.push(t[i])}}}function Ce(e,t){return ye(e,t).length>0}function Se(e){e.prototype.on=function(e,t){ge(this,e,t)};e.prototype.off=function(e,t){xe(this,e,t)}}function Le(e){if(e.preventDefault){e.preventDefault()}else{e.returnValue=false}}function Te(e){if(e.stopPropagation){e.stopPropagation()}else{e.cancelBubble=true}}function Ae(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==false}function Ee(e){Le(e);Te(e)}function Me(e){return e.target||e.srcElement}function Ne(e){var t=e.which;if(t==null){if(e.button&1){t=1}else if(e.button&2){t=3}else if(e.button&4){t=2}}if(x&&e.ctrlKey&&t==1){t=3}return t}var _e=function(){if(s&&o<9){return false}var e=M("div");return"draggable"in e||"dragDrop"in e}();var Pe;function Ie(e){if(Pe==null){var t=M("span","​");E(e,M("span",[t,document.createTextNode("x")]));if(e.firstChild.offsetHeight!=0){Pe=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&o<8)}}var r=Pe?M("span","​"):M("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");r.setAttribute("cm-text","");return r}var Oe;function De(e){if(Oe!=null){return Oe}var t=E(e,document.createTextNode("AخA"));var r=_(t,0,1).getBoundingClientRect();var i=_(t,1,2).getBoundingClientRect();A(e);if(!r||r.left==r.right){return false}return Oe=i.right-r.right<3}var Re="\n\nb".split(/\n/).length!=3?function(e){var t=0,r=[],i=e.length;while(t<=i){var n=e.indexOf("\n",t);if(n==-1){n=e.length}var a=e.slice(t,e.charAt(n-1)=="\r"?n-1:n);var s=a.indexOf("\r");if(s!=-1){r.push(a.slice(0,s));t+=s+1}else{r.push(a);t=n+1}}return r}:function(e){return e.split(/\r\n?|\n/)};var Ve=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return false}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}if(!t||t.parentElement()!=e){return false}return t.compareEndPoints("StartToEnd",t)!=0};var Fe=function(){var e=M("div");if("oncopy"in e){return true}e.setAttribute("oncopy","return;");return typeof e.oncopy=="function"}();var ze=null;function We(e){if(ze!=null){return ze}var t=E(e,M("span","x"));var r=t.getBoundingClientRect();var i=_(t,0,1).getBoundingClientRect();return ze=Math.abs(r.left-i.left)>1}var Be={},He={};function je(e,t){if(arguments.length>2){t.dependencies=Array.prototype.slice.call(arguments,2)}Be[e]=t}function Ue(e,t){He[e]=t}function Ge(e){if(typeof e=="string"&&He.hasOwnProperty(e)){e=He[e]}else if(e&&typeof e.name=="string"&&He.hasOwnProperty(e.name)){var t=He[e.name];if(typeof t=="string"){t={name:t}}e=re(t,e);e.name=t.name}else if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e)){return Ge("application/xml")}else if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e)){return Ge("application/json")}if(typeof e=="string"){return{name:e}}else{return e||{name:"null"}}}function qe(e,t){t=Ge(t);var r=Be[t.name];if(!r){return qe(e,"text/plain")}var i=r(e,t);if(Ke.hasOwnProperty(t.name)){var n=Ke[t.name];for(var a in n){if(!n.hasOwnProperty(a)){continue}if(i.hasOwnProperty(a)){i["_"+a]=i[a]}i[a]=n[a]}}i.name=t.name;if(t.helperType){i.helperType=t.helperType}if(t.modeProps){for(var s in t.modeProps){i[s]=t.modeProps[s]}}return i}var Ke={};function $e(e,t){var r=Ke.hasOwnProperty(e)?Ke[e]:Ke[e]={};W(t,r)}function Xe(e,t){if(t===true){return t}if(e.copyState){return e.copyState(t)}var r={};for(var i in t){var n=t[i];if(n instanceof Array){n=n.concat([])}r[i]=n}return r}function Ye(e,t){var r;while(e.innerMode){r=e.innerMode(t);if(!r||r.mode==e){break}t=r.state;e=r.mode}return r||{mode:e,state:t}}function Qe(e,t,r){return e.startState?e.startState(t,r):true}var Ze=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};Ze.prototype.eol=function(){return this.pos>=this.string.length};Ze.prototype.sol=function(){return this.pos==this.lineStart};Ze.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};Ze.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};Ze.prototype.eat=function(e){var t=this.string.charAt(this.pos);var r;if(typeof e=="string"){r=t==e}else{r=t&&(e.test?e.test(t):e(t))}if(r){++this.pos;return t}};Ze.prototype.eatWhile=function(e){var t=this.pos;while(this.eat(e)){}return this.pos>t};Ze.prototype.eatSpace=function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>e};Ze.prototype.skipToEnd=function(){this.pos=this.string.length};Ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1){this.pos=t;return true}};Ze.prototype.backUp=function(e){this.pos-=e};Ze.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=B(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)};Ze.prototype.indentation=function(){return B(this.string,null,this.tabSize)-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)};Ze.prototype.match=function(e,t,r){if(typeof e=="string"){var i=function(e){return r?e.toLowerCase():e};var n=this.string.substr(this.pos,e.length);if(i(n)==i(e)){if(t!==false){this.pos+=e.length}return true}}else{var a=this.string.slice(this.pos).match(e);if(a&&a.index>0){return null}if(a&&t!==false){this.pos+=a[0].length}return a}};Ze.prototype.current=function(){return this.string.slice(this.start,this.pos)};Ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};Ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)};Ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Je(e,t){t-=e.first;if(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 i=0;;++i){var n=r.children[i],a=n.chunkSize();if(t<a){r=n;break}t-=a}}return r.lines[t]}function et(e,t,r){var i=[],n=t.line;e.iter(t.line,r.line+1,function(e){var a=e.text;if(n==r.line){a=a.slice(0,r.ch)}if(n==t.line){a=a.slice(t.ch)}i.push(a);++n});return i}function tt(e,t,r){var i=[];e.iter(t,r,function(e){i.push(e.text)});return i}function rt(e,t){var r=t-e.height;if(r){for(var i=e;i;i=i.parent){i.height+=r}}}function it(e){if(e.parent==null){return null}var t=e.parent,r=j(t.lines,e);for(var i=t.parent;i;t=i,i=i.parent){for(var n=0;;++n){if(i.children[n]==t){break}r+=i.children[n].chunkSize()}}return r+t.first}function nt(e,t){var r=e.first;e:do{for(var i=0;i<e.children.length;++i){var n=e.children[i],a=n.height;if(t<a){e=n;continue e}t-=a;r+=n.chunkSize()}return r}while(!e.lines);var s=0;for(;s<e.lines.length;++s){var o=e.lines[s],l=o.height;if(t<l){break}t-=l}return r+s}function at(e,t){return t>=e.first&&t<e.first+e.size}function st(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ot(e,t,r){if(r===void 0)r=null;if(!(this instanceof ot)){return new ot(e,t,r)}this.line=e;this.ch=t;this.sticky=r}function lt(e,t){return e.line-t.line||e.ch-t.ch}function ut(e,t){return e.sticky==t.sticky&&lt(e,t)==0}function ct(e){return ot(e.line,e.ch)}function ft(e,t){return lt(e,t)<0?t:e}function ht(e,t){return lt(e,t)<0?e:t}function pt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function dt(e,t){if(t.line<e.first){return ot(e.first,0)}var r=e.first+e.size-1;if(t.line>r){return ot(r,Je(e,r).text.length)}return mt(t,Je(e,t.line).text.length)}function mt(e,t){var r=e.ch;if(r==null||r>t){return ot(e.line,t)}else if(r<0){return ot(e.line,0)}else{return e}}function vt(e,t){var r=[];for(var i=0;i<t.length;i++){r[i]=dt(e,t[i])}return r}var gt=function(e,t){this.state=e;this.lookAhead=t};var yt=function(e,t,r,i){this.state=t;this.doc=e;this.line=r;this.maxLookAhead=i||0;this.baseTokens=null;this.baseTokenPos=1};yt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);if(t!=null&&e>this.maxLookAhead){this.maxLookAhead=e}return t};yt.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}};yt.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};yt.fromSaved=function(e,t,r){if(t instanceof gt){return new yt(e,Xe(e.mode,t.state),r,t.lookAhead)}else{return new yt(e,Xe(e.mode,t),r)}};yt.prototype.save=function(e){var t=e!==false?Xe(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t};function xt(e,t,r,i){var n=[e.state.modeGen],a={};Et(e,t.text,e.doc.mode,r,function(e,t){return n.push(e,t)},a,i);var s=r.state;var o=function(i){r.baseTokens=n;var o=e.state.overlays[i],l=1,u=0;r.state=true;Et(e,t.text,o.mode,r,function(e,t){var r=l;while(u<e){var i=n[l];if(i>e){n.splice(l,1,e,n[l+1],i)}l+=2;u=Math.min(e,i)}if(!t){return}if(o.opaque){n.splice(r,l-r,e,"overlay "+t);l=r+2}else{for(;r<l;r+=2){var a=n[r+1];n[r+1]=(a?a+" ":"")+"overlay "+t}}},a);r.state=s;r.baseTokens=null;r.baseTokenPos=1};for(var l=0;l<e.state.overlays.length;++l)o(l);return{styles:n,classes:a.bgClass||a.textClass?a:null}}function bt(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=wt(e,it(t));var n=t.text.length>e.options.maxHighlightLength&&Xe(e.doc.mode,i.state);var a=xt(e,t,i);if(n){i.state=n}t.stateAfter=i.save(!n);t.styles=a.styles;if(a.classes){t.styleClasses=a.classes}else if(t.styleClasses){t.styleClasses=null}if(r===e.doc.highlightFrontier){e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier)}}return t.styles}function wt(e,t,r){var i=e.doc,n=e.display;if(!i.mode.startState){return new yt(i,true,t)}var a=Mt(e,t,r);var s=a>i.first&&Je(i,a-1).stateAfter;var o=s?yt.fromSaved(i,s,a):new yt(i,Qe(i.mode),a);i.iter(a,t,function(r){kt(e,r.text,o);var i=o.line;r.stateAfter=i==t-1||i%5==0||i>=n.viewFrom&&i<n.viewTo?o.save():null;o.nextLine()});if(r){i.modeFrontier=o.line}return o}function kt(e,t,r,i){var n=e.doc.mode;var a=new Ze(t,e.options.tabSize,r);a.start=a.pos=i||0;if(t==""){Ct(n,r.state)}while(!a.eol()){St(n,a,r.state);a.start=a.pos}}function Ct(e,t){if(e.blankLine){return e.blankLine(t)}if(!e.innerMode){return}var r=Ye(e,t);if(r.mode.blankLine){return r.mode.blankLine(r.state)}}function St(e,t,r,i){for(var n=0;n<10;n++){if(i){i[0]=Ye(e,r).mode}var a=e.token(t,r);if(t.pos>t.start){return a}}throw new Error("Mode "+e.name+" failed to advance stream.")}var Lt=function(e,t,r){this.start=e.start;this.end=e.pos;this.string=e.current();this.type=t||null;this.state=r};function Tt(e,t,r,i){var n=e.doc,a=n.mode,s;t=dt(n,t);var o=Je(n,t.line),l=wt(e,t.line,r);var u=new Ze(o.text,e.options.tabSize,l),c;if(i){c=[]}while((i||u.pos<t.ch)&&!u.eol()){u.start=u.pos;s=St(a,u,l.state);if(i){c.push(new Lt(u,s,Xe(n.mode,l.state)))}}return i?c:new Lt(u,s,l.state)}function At(e,t){if(e){for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r){break}e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var i=r[1]?"bgClass":"textClass";if(t[i]==null){t[i]=r[2]}else if(!new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[i])){t[i]+=" "+r[2]}}}return e}function Et(e,t,r,i,n,a,s){var o=r.flattenSpans;if(o==null){o=e.options.flattenSpans}var l=0,u=null;var c=new Ze(t,e.options.tabSize,i),f;var h=e.options.addModeClass&&[null];if(t==""){At(Ct(r,i.state),a)}while(!c.eol()){if(c.pos>e.options.maxHighlightLength){o=false;if(s){kt(e,t,i,c.pos)}c.pos=t.length;f=null}else{f=At(St(r,c,i.state,h),a)}if(h){var p=h[0].name;if(p){f="m-"+(f?p+" "+f:p)}}if(!o||u!=f){while(l<c.start){l=Math.min(c.start,l+5e3);n(l,u)}u=f}c.start=c.pos}while(l<c.pos){var d=Math.min(c.pos,l+5e3);n(d,u);l=d}}function Mt(e,t,r){var i,n,a=e.doc;var s=r?-1:t-(e.doc.mode.innerMode?1e3:100);for(var o=t;o>s;--o){if(o<=a.first){return a.first}var l=Je(a,o-1),u=l.stateAfter;if(u&&(!r||o+(u instanceof gt?u.lookAhead:0)<=a.modeFrontier)){return o}var c=B(l.text,null,e.options.tabSize);if(n==null||i>c){n=o-1;i=c}}return n}function Nt(e,t){e.modeFrontier=Math.min(e.modeFrontier,t);if(e.highlightFrontier<t-10){return}var r=e.first;for(var i=t-1;i>r;i--){var n=Je(e,i).stateAfter;if(n&&(!(n instanceof gt)||i+n.lookAhead<t)){r=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var _t=false,Pt=false;function It(){_t=true}function Ot(){Pt=true}function Dt(e,t,r){this.marker=e;this.from=t;this.to=r}function Rt(e,t){if(e){for(var r=0;r<e.length;++r){var i=e[r];if(i.marker==t){return i}}}}function Vt(e,t){var r;for(var i=0;i<e.length;++i){if(e[i]!=t){(r||(r=[])).push(e[i])}}return r}function Ft(e,t,r){var i=r&&window.WeakSet&&(r.markedSpans||(r.markedSpans=new WeakSet));if(i&&e.markedSpans&&i.has(e.markedSpans)){e.markedSpans.push(t)}else{e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t];if(i){i.add(e.markedSpans)}}t.marker.attachLine(e)}function zt(e,t,r){var i;if(e){for(var n=0;n<e.length;++n){var a=e[n],s=a.marker;var o=a.from==null||(s.inclusiveLeft?a.from<=t:a.from<t);if(o||a.from==t&&s.type=="bookmark"&&(!r||!a.marker.insertLeft)){var l=a.to==null||(s.inclusiveRight?a.to>=t:a.to>t);(i||(i=[])).push(new Dt(s,a.from,l?null:a.to))}}}return i}function Wt(e,t,r){var i;if(e){for(var n=0;n<e.length;++n){var a=e[n],s=a.marker;var o=a.to==null||(s.inclusiveRight?a.to>=t:a.to>t);if(o||a.from==t&&s.type=="bookmark"&&(!r||a.marker.insertLeft)){var l=a.from==null||(s.inclusiveLeft?a.from<=t:a.from<t);(i||(i=[])).push(new Dt(s,l?null:a.from-t,a.to==null?null:a.to-t))}}}return i}function Bt(e,t){if(t.full){return null}var r=at(e,t.from.line)&&Je(e,t.from.line).markedSpans;var i=at(e,t.to.line)&&Je(e,t.to.line).markedSpans;if(!r&&!i){return null}var n=t.from.ch,a=t.to.ch,s=lt(t.from,t.to)==0;var o=zt(r,n,s);var l=Wt(i,a,s);var u=t.text.length==1,c=Z(t.text).length+(u?n:0);if(o){for(var f=0;f<o.length;++f){var h=o[f];if(h.to==null){var p=Rt(l,h.marker);if(!p){h.to=n}else if(u){h.to=p.to==null?null:p.to+c}}}}if(l){for(var d=0;d<l.length;++d){var m=l[d];if(m.to!=null){m.to+=c}if(m.from==null){var v=Rt(o,m.marker);if(!v){m.from=c;if(u){(o||(o=[])).push(m)}}}else{m.from+=c;if(u){(o||(o=[])).push(m)}}}}if(o){o=Ht(o)}if(l&&l!=o){l=Ht(l)}var g=[o];if(!u){var y=t.text.length-2,x;if(y>0&&o){for(var b=0;b<o.length;++b){if(o[b].to==null){(x||(x=[])).push(new Dt(o[b].marker,null,null))}}}for(var w=0;w<y;++w){g.push(x)}g.push(l)}return g}function Ht(e){for(var t=0;t<e.length;++t){var r=e[t];if(r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==false){e.splice(t--,1)}}if(!e.length){return null}return e}function jt(e,t,r){var i=null;e.iter(t.line,r.line+1,function(e){if(e.markedSpans){for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;if(r.readOnly&&(!i||j(i,r)==-1)){(i||(i=[])).push(r)}}}});if(!i){return null}var n=[{from:t,to:r}];for(var a=0;a<i.length;++a){var s=i[a],o=s.find(0);for(var l=0;l<n.length;++l){var u=n[l];if(lt(u.to,o.from)<0||lt(u.from,o.to)>0){continue}var c=[l,1],f=lt(u.from,o.from),h=lt(u.to,o.to);if(f<0||!s.inclusiveLeft&&!f){c.push({from:u.from,to:o.from})}if(h>0||!s.inclusiveRight&&!h){c.push({from:o.to,to:u.to})}n.splice.apply(n,c);l+=c.length-3}}return n}function Ut(e){var t=e.markedSpans;if(!t){return}for(var r=0;r<t.length;++r){t[r].marker.detachLine(e)}e.markedSpans=null}function Gt(e,t){if(!t){return}for(var r=0;r<t.length;++r){t[r].marker.attachLine(e)}e.markedSpans=t}function qt(e){return e.inclusiveLeft?-1:0}function Kt(e){return e.inclusiveRight?1:0}function $t(e,t){var r=e.lines.length-t.lines.length;if(r!=0){return r}var i=e.find(),n=t.find();var a=lt(i.from,n.from)||qt(e)-qt(t);if(a){return-a}var s=lt(i.to,n.to)||Kt(e)-Kt(t);if(s){return s}return t.id-e.id}function Xt(e,t){var r=Pt&&e.markedSpans,i;if(r){for(var n=void 0,a=0;a<r.length;++a){n=r[a];if(n.marker.collapsed&&(t?n.from:n.to)==null&&(!i||$t(i,n.marker)<0)){i=n.marker}}}return i}function Yt(e){return Xt(e,true)}function Qt(e){return Xt(e,false)}function Zt(e,t){var r=Pt&&e.markedSpans,i;if(r){for(var n=0;n<r.length;++n){var a=r[n];if(a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!i||$t(i,a.marker)<0)){i=a.marker}}}return i}function Jt(e,t,r,i,n){var a=Je(e,t);var s=Pt&&a.markedSpans;if(s){for(var o=0;o<s.length;++o){var l=s[o];if(!l.marker.collapsed){continue}var u=l.marker.find(0);var c=lt(u.from,r)||qt(l.marker)-qt(n);var f=lt(u.to,i)||Kt(l.marker)-Kt(n);if(c>=0&&f<=0||c<=0&&f>=0){continue}if(c<=0&&(l.marker.inclusiveRight&&n.inclusiveLeft?lt(u.to,r)>=0:lt(u.to,r)>0)||c>=0&&(l.marker.inclusiveRight&&n.inclusiveLeft?lt(u.from,i)<=0:lt(u.from,i)<0)){return true}}}}function er(e){var t;while(t=Yt(e)){e=t.find(-1,true).line}return e}function tr(e){var t;while(t=Qt(e)){e=t.find(1,true).line}return e}function rr(e){var t,r;while(t=Qt(e)){e=t.find(1,true).line;(r||(r=[])).push(e)}return r}function ir(e,t){var r=Je(e,t),i=er(r);if(r==i){return t}return it(i)}function nr(e,t){if(t>e.lastLine()){return t}var r=Je(e,t),i;if(!ar(e,r)){return t}while(i=Qt(r)){r=i.find(1,true).line}return it(r)+1}function ar(e,t){var r=Pt&&t.markedSpans;if(r){for(var i=void 0,n=0;n<r.length;++n){i=r[n];if(!i.marker.collapsed){continue}if(i.from==null){return true}if(i.marker.widgetNode){continue}if(i.from==0&&i.marker.inclusiveLeft&&sr(e,t,i)){return true}}}}function sr(e,t,r){if(r.to==null){var i=r.marker.find(1,true);return sr(e,i.line,Rt(i.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length){return true}for(var n=void 0,a=0;a<t.markedSpans.length;++a){n=t.markedSpans[a];if(n.marker.collapsed&&!n.marker.widgetNode&&n.from==r.to&&(n.to==null||n.to!=r.from)&&(n.marker.inclusiveLeft||r.marker.inclusiveRight)&&sr(e,t,n)){return true}}}function or(e){e=er(e);var t=0,r=e.parent;for(var i=0;i<r.lines.length;++i){var n=r.lines[i];if(n==e){break}else{t+=n.height}}for(var a=r.parent;a;r=a,a=r.parent){for(var s=0;s<a.children.length;++s){var o=a.children[s];if(o==r){break}else{t+=o.height}}}return t}function lr(e){if(e.height==0){return 0}var t=e.text.length,r,i=e;while(r=Yt(i)){var n=r.find(0,true);i=n.from.line;t+=n.from.ch-n.to.ch}i=e;while(r=Qt(i)){var a=r.find(0,true);t-=i.text.length-a.from.ch;i=a.to.line;t+=i.text.length-a.to.ch}return t}function ur(e){var t=e.display,r=e.doc;t.maxLine=Je(r,r.first);t.maxLineLength=lr(t.maxLine);t.maxLineChanged=true;r.iter(function(e){var r=lr(e);if(r>t.maxLineLength){t.maxLineLength=r;t.maxLine=e}})}var cr=function(e,t,r){this.text=e;Gt(this,t);this.height=r?r(this):1};cr.prototype.lineNo=function(){return it(this)};Se(cr);function fr(e,t,r,i){e.text=t;if(e.stateAfter){e.stateAfter=null}if(e.styles){e.styles=null}if(e.order!=null){e.order=null}Ut(e);Gt(e,r);var n=i?i(e):1;if(n!=e.height){rt(e,n)}}function hr(e){e.parent=null;Ut(e)}var pr={},dr={};function mr(e,t){if(!e||/^\s*$/.test(e)){return null}var r=t.addModeClass?dr:pr;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function vr(e,t){var r=N("span",null,null,l?"padding-right: .1px":null);var i={pre:N("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:false,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var a=n?t.rest[n-1]:t.line,s=void 0;i.pos=0;i.addToken=yr;if(De(e.display.measure)&&(s=me(a,e.doc.direction))){i.addToken=br(i.addToken,s)}i.map=[];var o=t!=e.display.externalMeasured&&it(a);kr(a,i,bt(e,a,o));if(a.styleClasses){if(a.styleClasses.bgClass){i.bgClass=D(a.styleClasses.bgClass,i.bgClass||"")}if(a.styleClasses.textClass){i.textClass=D(a.styleClasses.textClass,i.textClass||"")}}if(i.map.length==0){i.map.push(0,0,i.content.appendChild(Ie(e.display.measure)))}if(n==0){t.measure.map=i.map;t.measure.cache={}}else{(t.measure.maps||(t.measure.maps=[])).push(i.map);(t.measure.caches||(t.measure.caches=[])).push({})}}if(l){var u=i.content.lastChild;if(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab")){i.content.className="cm-tab-wrap-hack"}}be(e,"renderLine",e,t.line,i.pre);if(i.pre.className){i.textClass=D(i.pre.className,i.textClass||"")}return i}function gr(e){var t=M("span","•","cm-invalidchar");t.title="\\u"+e.charCodeAt(0).toString(16);t.setAttribute("aria-label",t.title);return t}function yr(e,t,r,i,n,a,l){if(!t){return}var u=e.splitSpaces?xr(t,e.trailingSpace):t;var c=e.cm.state.specialChars,f=false;var h;if(!c.test(t)){e.col+=t.length;h=document.createTextNode(u);e.map.push(e.pos,e.pos+t.length,h);if(s&&o<9){f=true}e.pos+=t.length}else{h=document.createDocumentFragment();var p=0;while(true){c.lastIndex=p;var d=c.exec(t);var m=d?d.index-p:t.length-p;if(m){var v=document.createTextNode(u.slice(p,p+m));if(s&&o<9){h.appendChild(M("span",[v]))}else{h.appendChild(v)}e.map.push(e.pos,e.pos+m,v);e.col+=m;e.pos+=m}if(!d){break}p+=m+1;var g=void 0;if(d[0]=="\t"){var y=e.cm.options.tabSize,x=y-e.col%y;g=h.appendChild(M("span",Q(x),"cm-tab"));g.setAttribute("role","presentation");g.setAttribute("cm-text","\t");e.col+=x}else if(d[0]=="\r"||d[0]=="\n"){g=h.appendChild(M("span",d[0]=="\r"?"␍":"␤","cm-invalidchar"))
;g.setAttribute("cm-text",d[0]);e.col+=1}else{g=e.cm.options.specialCharPlaceholder(d[0]);g.setAttribute("cm-text",d[0]);if(s&&o<9){h.appendChild(M("span",[g]))}else{h.appendChild(g)}e.col+=1}e.map.push(e.pos,e.pos+1,g);e.pos++}}e.trailingSpace=u.charCodeAt(t.length-1)==32;if(r||i||n||f||a||l){var b=r||"";if(i){b+=i}if(n){b+=n}var w=M("span",[h],b,a);if(l){for(var k in l){if(l.hasOwnProperty(k)&&k!="style"&&k!="class"){w.setAttribute(k,l[k])}}}return e.content.appendChild(w)}e.content.appendChild(h)}function xr(e,t){if(e.length>1&&!/  /.test(e)){return e}var r=t,i="";for(var n=0;n<e.length;n++){var a=e.charAt(n);if(a==" "&&r&&(n==e.length-1||e.charCodeAt(n+1)==32)){a=" "}i+=a;r=a==" "}return i}function br(e,t){return function(r,i,n,a,s,o,l){n=n?n+" cm-force-border":"cm-force-border";var u=r.pos,c=u+i.length;for(;;){var f=void 0;for(var h=0;h<t.length;h++){f=t[h];if(f.to>u&&f.from<=u){break}}if(f.to>=c){return e(r,i,n,a,s,o,l)}e(r,i.slice(0,f.to-u),n,a,null,o,l);a=null;i=i.slice(f.to-u);u=f.to}}}function wr(e,t,r,i){var n=!i&&r.widgetNode;if(n){e.map.push(e.pos,e.pos+t,n)}if(!i&&e.cm.display.input.needsContentAttribute){if(!n){n=e.content.appendChild(document.createElement("span"))}n.setAttribute("cm-marker",r.id)}if(n){e.cm.display.input.setUneditable(n);e.content.appendChild(n)}e.pos+=t;e.trailingSpace=false}function kr(e,t,r){var i=e.markedSpans,n=e.text,a=0;if(!i){for(var s=1;s<r.length;s+=2){t.addToken(t,n.slice(a,a=r[s]),mr(r[s+1],t.cm.options))}return}var o=n.length,l=0,u=1,c="",f,h;var p=0,d,m,v,g,y;for(;;){if(p==l){d=m=v=h="";y=null;g=null;p=Infinity;var x=[],b=void 0;for(var w=0;w<i.length;++w){var k=i[w],C=k.marker;if(C.type=="bookmark"&&k.from==l&&C.widgetNode){x.push(C)}else if(k.from<=l&&(k.to==null||k.to>l||C.collapsed&&k.to==l&&k.from==l)){if(k.to!=null&&k.to!=l&&p>k.to){p=k.to;m=""}if(C.className){d+=" "+C.className}if(C.css){h=(h?h+";":"")+C.css}if(C.startStyle&&k.from==l){v+=" "+C.startStyle}if(C.endStyle&&k.to==p){(b||(b=[])).push(C.endStyle,k.to)}if(C.title){(y||(y={})).title=C.title}if(C.attributes){for(var S in C.attributes){(y||(y={}))[S]=C.attributes[S]}}if(C.collapsed&&(!g||$t(g.marker,C)<0)){g=k}}else if(k.from>l&&p>k.from){p=k.from}}if(b){for(var L=0;L<b.length;L+=2){if(b[L+1]==p){m+=" "+b[L]}}}if(!g||g.from==l){for(var T=0;T<x.length;++T){wr(t,0,x[T])}}if(g&&(g.from||0)==l){wr(t,(g.to==null?o+1:g.to)-l,g.marker,g.from==null);if(g.to==null){return}if(g.to==l){g=false}}}if(l>=o){break}var A=Math.min(o,p);while(true){if(c){var E=l+c.length;if(!g){var M=E>A?c.slice(0,A-l):c;t.addToken(t,M,f?f+d:d,v,l+M.length==p?m:"",h,y)}if(E>=A){c=c.slice(A-l);l=A;break}l=E;v=""}c=n.slice(a,a=r[u++]);f=mr(r[u++],t.cm.options)}}}function Cr(e,t,r){this.line=t;this.rest=rr(t);this.size=this.rest?it(Z(this.rest))-r+1:1;this.node=this.text=null;this.hidden=ar(e,t)}function Sr(e,t,r){var i=[],n;for(var a=t;a<r;a=n){var s=new Cr(e.doc,Je(e.doc,a),a);n=a+s.size;i.push(s)}return i}var Lr=null;function Tr(e){if(Lr){Lr.ops.push(e)}else{e.ownsGroup=Lr={ops:[e],delayedCallbacks:[]}}}function Ar(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++){t[r].call(null)}for(var i=0;i<e.ops.length;i++){var n=e.ops[i];if(n.cursorActivityHandlers){while(n.cursorActivityCalled<n.cursorActivityHandlers.length){n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}}}while(r<t.length)}function Er(e,t){var r=e.ownsGroup;if(!r){return}try{Ar(r)}finally{Lr=null;t(r)}}var Mr=null;function Nr(e,t){var r=ye(e,t);if(!r.length){return}var i=Array.prototype.slice.call(arguments,2),n;if(Lr){n=Lr.delayedCallbacks}else if(Mr){n=Mr}else{n=Mr=[];setTimeout(_r,0)}var a=function(e){n.push(function(){return r[e].apply(null,i)})};for(var s=0;s<r.length;++s)a(s)}function _r(){var e=Mr;Mr=null;for(var t=0;t<e.length;++t){e[t]()}}function Pr(e,t,r,i){for(var n=0;n<t.changes.length;n++){var a=t.changes[n];if(a=="text"){Rr(e,t)}else if(a=="gutter"){Fr(e,t,r,i)}else if(a=="class"){Vr(e,t)}else if(a=="widget"){zr(e,t,i)}}t.changes=null}function Ir(e){if(e.node==e.text){e.node=M("div",null,null,"position: relative");if(e.text.parentNode){e.text.parentNode.replaceChild(e.node,e.text)}e.node.appendChild(e.text);if(s&&o<8){e.node.style.zIndex=2}}return e.node}function Or(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r){r+=" CodeMirror-linebackground"}if(t.background){if(r){t.background.className=r}else{t.background.parentNode.removeChild(t.background);t.background=null}}else if(r){var i=Ir(t);t.background=i.insertBefore(M("div",null,r),i.firstChild);e.display.input.setUneditable(t.background)}}function Dr(e,t){var r=e.display.externalMeasured;if(r&&r.line==t.line){e.display.externalMeasured=null;t.measure=r.measure;return r.built}return vr(e,t)}function Rr(e,t){var r=t.text.className;var i=Dr(e,t);if(t.text==t.node){t.node=i.pre}t.text.parentNode.replaceChild(i.pre,t.text);t.text=i.pre;if(i.bgClass!=t.bgClass||i.textClass!=t.textClass){t.bgClass=i.bgClass;t.textClass=i.textClass;Vr(e,t)}else if(r){t.text.className=r}}function Vr(e,t){Or(e,t);if(t.line.wrapClass){Ir(t).className=t.line.wrapClass}else if(t.node!=t.text){t.node.className=""}var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Fr(e,t,r,i){if(t.gutter){t.node.removeChild(t.gutter);t.gutter=null}if(t.gutterBackground){t.node.removeChild(t.gutterBackground);t.gutterBackground=null}if(t.line.gutterClass){var n=Ir(t);t.gutterBackground=M("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px");e.display.input.setUneditable(t.gutterBackground);n.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var s=Ir(t);var o=t.gutter=M("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");o.setAttribute("aria-hidden","true");e.display.input.setUneditable(o);s.insertBefore(o,t.text);if(t.line.gutterClass){o.className+=" "+t.line.gutterClass}if(e.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])){t.lineNumber=o.appendChild(M("div",st(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))}if(a){for(var l=0;l<e.display.gutterSpecs.length;++l){var u=e.display.gutterSpecs[l].className,c=a.hasOwnProperty(u)&&a[u];if(c){o.appendChild(M("div",[c],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}}}function zr(e,t,r){if(t.alignable){t.alignable=null}var i=L("CodeMirror-linewidget");for(var n=t.node.firstChild,a=void 0;n;n=a){a=n.nextSibling;if(i.test(n.className)){t.node.removeChild(n)}}Br(e,t,r)}function Wr(e,t,r,i){var n=Dr(e,t);t.text=t.node=n.pre;if(n.bgClass){t.bgClass=n.bgClass}if(n.textClass){t.textClass=n.textClass}Vr(e,t);Fr(e,t,r,i);Br(e,t,i);return t.node}function Br(e,t,r){Hr(e,t.line,t,r,true);if(t.rest){for(var i=0;i<t.rest.length;i++){Hr(e,t.rest[i],t,r,false)}}}function Hr(e,t,r,i,n){if(!t.widgets){return}var a=Ir(r);for(var s=0,o=t.widgets;s<o.length;++s){var l=o[s],u=M("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));if(!l.handleMouseEvents){u.setAttribute("cm-ignore-events","true")}jr(l,u,r,i);e.display.input.setUneditable(u);if(n&&l.above){a.insertBefore(u,r.gutter||r.text)}else{a.appendChild(u)}Nr(l,"redraw")}}function jr(e,t,r,i){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var n=i.wrapperWidth;t.style.left=i.fixedPos+"px";if(!e.coverGutter){n-=i.gutterTotalWidth;t.style.paddingLeft=i.gutterTotalWidth+"px"}t.style.width=n+"px"}if(e.coverGutter){t.style.zIndex=5;t.style.position="relative";if(!e.noHScroll){t.style.marginLeft=-i.gutterTotalWidth+"px"}}}function Ur(e){if(e.height!=null){return e.height}var t=e.doc.cm;if(!t){return 0}if(!P(document.body,e.node)){var r="position: relative;";if(e.coverGutter){r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"}if(e.noHScroll){r+="width: "+t.display.wrapper.clientWidth+"px;"}E(t.display.measure,M("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Gr(e,t){for(var r=Me(t);r!=e.wrapper;r=r.parentNode){if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover){return true}}}function qr(e){return e.lineSpace.offsetTop}function Kr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $r(e){if(e.cachedPaddingH){return e.cachedPaddingH}var t=E(e.measure,M("pre","x","CodeMirror-line-like"));var r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle;var i={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};if(!isNaN(i.left)&&!isNaN(i.right)){e.cachedPaddingH=i}return i}function Xr(e){return U-e.display.nativeBarWidth}function Yr(e){return e.display.scroller.clientWidth-Xr(e)-e.display.barWidth}function Qr(e){return e.display.scroller.clientHeight-Xr(e)-e.display.barHeight}function Zr(e,t,r){var i=e.options.lineWrapping;var n=i&&Yr(e);if(!t.measure.heights||i&&t.measure.width!=n){var a=t.measure.heights=[];if(i){t.measure.width=n;var s=t.text.firstChild.getClientRects();for(var o=0;o<s.length-1;o++){var l=s[o],u=s[o+1];if(Math.abs(l.bottom-u.bottom)>2){a.push((l.bottom+u.top)/2-r.top)}}}a.push(r.bottom-r.top)}}function Jr(e,t,r){if(e.line==t){return{map:e.measure.map,cache:e.measure.cache}}if(e.rest){for(var i=0;i<e.rest.length;i++){if(e.rest[i]==t){return{map:e.measure.maps[i],cache:e.measure.caches[i]}}}for(var n=0;n<e.rest.length;n++){if(it(e.rest[n])>r){return{map:e.measure.maps[n],cache:e.measure.caches[n],before:true}}}}}function ei(e,t){t=er(t);var r=it(t);var i=e.display.externalMeasured=new Cr(e.doc,t,r);i.lineN=r;var n=i.built=vr(e,i);i.text=n.pre;E(e.display.lineMeasure,n.pre);return i}function ti(e,t,r,i){return ni(e,ii(e,t),r,i)}function ri(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo){return e.display.view[Vi(e,t)]}var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size){return r}}function ii(e,t){var r=it(t);var i=ri(e,r);if(i&&!i.text){i=null}else if(i&&i.changes){Pr(e,i,r,Pi(e));e.curOp.forceUpdate=true}if(!i){i=ei(e,t)}var n=Jr(i,t,r);return{line:t,view:i,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:false}}function ni(e,t,r,i,n){if(t.before){r=-1}var a=r+(i||""),s;if(t.cache.hasOwnProperty(a)){s=t.cache[a]}else{if(!t.rect){t.rect=t.view.text.getBoundingClientRect()}if(!t.hasHeights){Zr(e,t.view,t.rect);t.hasHeights=true}s=li(e,t,r,i);if(!s.bogus){t.cache[a]=s}}return{left:s.left,right:s.right,top:n?s.rtop:s.top,bottom:n?s.rbottom:s.bottom}}var ai={left:0,right:0,top:0,bottom:0};function si(e,t,r){var i,n,a,s,o,l;for(var u=0;u<e.length;u+=3){o=e[u];l=e[u+1];if(t<o){n=0;a=1;s="left"}else if(t<l){n=t-o;a=n+1}else if(u==e.length-3||t==l&&e[u+3]>t){a=l-o;n=a-1;if(t>=l){s="right"}}if(n!=null){i=e[u+2];if(o==l&&r==(i.insertLeft?"left":"right")){s=r}if(r=="left"&&n==0){while(u&&e[u-2]==e[u-3]&&e[u-1].insertLeft){i=e[(u-=3)+2];s="left"}}if(r=="right"&&n==l-o){while(u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft){i=e[(u+=3)+2];s="right"}}break}}return{node:i,start:n,end:a,collapse:s,coverStart:o,coverEnd:l}}function oi(e,t){var r=ai;if(t=="left"){for(var i=0;i<e.length;i++){if((r=e[i]).left!=r.right){break}}}else{for(var n=e.length-1;n>=0;n--){if((r=e[n]).left!=r.right){break}}}return r}function li(e,t,r,i){var n=si(t.map,r,i);var a=n.node,l=n.start,u=n.end,c=n.collapse;var f;if(a.nodeType==3){for(var h=0;h<4;h++){while(l&&le(t.line.text.charAt(n.coverStart+l))){--l}while(n.coverStart+u<n.coverEnd&&le(t.line.text.charAt(n.coverStart+u))){++u}if(s&&o<9&&l==0&&u==n.coverEnd-n.coverStart){f=a.parentNode.getBoundingClientRect()}else{f=oi(_(a,l,u).getClientRects(),i)}if(f.left||f.right||l==0){break}u=l;l=l-1;c="right"}if(s&&o<11){f=ui(e.display.measure,f)}}else{if(l>0){c=i="right"}var p;if(e.options.lineWrapping&&(p=a.getClientRects()).length>1){f=p[i=="right"?p.length-1:0]}else{f=a.getBoundingClientRect()}}if(s&&o<9&&!l&&(!f||!f.left&&!f.right)){var d=a.parentNode.getClientRects()[0];if(d){f={left:d.left,right:d.left+_i(e.display),top:d.top,bottom:d.bottom}}else{f=ai}}var m=f.top-t.rect.top,v=f.bottom-t.rect.top;var g=(m+v)/2;var y=t.view.measure.heights;var x=0;for(;x<y.length-1;x++){if(g<y[x]){break}}var b=x?y[x-1]:0,w=y[x];var k={left:(c=="right"?f.right:f.left)-t.rect.left,right:(c=="left"?f.left:f.right)-t.rect.left,top:b,bottom:w};if(!f.left&&!f.right){k.bogus=true}if(!e.options.singleCursorHeightPerLine){k.rtop=m;k.rbottom=v}return k}function ui(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!We(e)){return t}var r=screen.logicalXDPI/screen.deviceXDPI;var i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*i,bottom:t.bottom*i}}function ci(e){if(e.measure){e.measure.cache={};e.measure.heights=null;if(e.rest){for(var t=0;t<e.rest.length;t++){e.measure.caches[t]={}}}}}function fi(e){e.display.externalMeasure=null;A(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++){ci(e.display.view[t])}}function hi(e){fi(e);e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null;if(!e.options.lineWrapping){e.display.maxLineChanged=true}e.display.lineNumChars=null}function pi(e){if(c&&g){return-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft))}return e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function di(e){if(c&&g){return-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop))}return e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function mi(e){var t=er(e);var r=t.widgets;var i=0;if(r){for(var n=0;n<r.length;++n){if(r[n].above){i+=Ur(r[n])}}}return i}function vi(e,t,r,i,n){if(!n){var a=mi(t);r.top+=a;r.bottom+=a}if(i=="line"){return r}if(!i){i="local"}var s=or(t);if(i=="local"){s+=qr(e.display)}else{s-=e.display.viewOffset}if(i=="page"||i=="window"){var o=e.display.lineSpace.getBoundingClientRect();s+=o.top+(i=="window"?0:di(V(e)));var l=o.left+(i=="window"?0:pi(V(e)));r.left+=l;r.right+=l}r.top+=s;r.bottom+=s;return r}function gi(e,t,r){if(r=="div"){return t}var i=t.left,n=t.top;if(r=="page"){i-=pi(V(e));n-=di(V(e))}else if(r=="local"||!r){var a=e.display.sizer.getBoundingClientRect();i+=a.left;n+=a.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:i-s.left,top:n-s.top}}function yi(e,t,r,i,n){if(!i){i=Je(e.doc,t.line)}return vi(e,i,ti(e,i,t.ch,n),r)}function xi(e,t,r,i,n,a){i=i||Je(e.doc,t.line);if(!n){n=ii(e,i)}function s(t,s){var o=ni(e,n,t,s?"right":"left",a);if(s){o.left=o.right}else{o.right=o.left}return vi(e,i,o,r)}var o=me(i,e.doc.direction),l=t.ch,u=t.sticky;if(l>=i.text.length){l=i.text.length;u="before"}else if(l<=0){l=0;u="after"}if(!o){return s(u=="before"?l-1:l,u=="before")}function c(e,t,r){var i=o[t],n=i.level==1;return s(r?e-1:e,n!=r)}var f=pe(o,l,u);var h=he;var p=c(l,f,u=="before");if(h!=null){p.other=c(l,h,u!="before")}return p}function bi(e,t){var r=0;t=dt(e.doc,t);if(!e.options.lineWrapping){r=_i(e.display)*t.ch}var i=Je(e.doc,t.line);var n=or(i)+qr(e.display);return{left:r,right:r,top:n,bottom:n+i.height}}function wi(e,t,r,i,n){var a=ot(e,t,r);a.xRel=n;if(i){a.outside=i}return a}function ki(e,t,r){var i=e.doc;r+=e.display.viewOffset;if(r<0){return wi(i.first,0,null,-1,-1)}var n=nt(i,r),a=i.first+i.size-1;if(n>a){return wi(i.first+i.size-1,Je(i,a).text.length,null,1,1)}if(t<0){t=0}var s=Je(i,n);for(;;){var o=Ti(e,s,n,t,r);var l=Zt(s,o.ch+(o.xRel>0||o.outside>0?1:0));if(!l){return o}var u=l.find(1);if(u.line==n){return u}s=Je(i,n=u.line)}}function Ci(e,t,r,i){i-=mi(t);var n=t.text.length;var a=ce(function(t){return ni(e,r,t-1).bottom<=i},n,0);n=ce(function(t){return ni(e,r,t).top>i},a,n);return{begin:a,end:n}}function Si(e,t,r,i){if(!r){r=ii(e,t)}var n=vi(e,t,ni(e,r,i),"line").top;return Ci(e,t,r,n)}function Li(e,t,r,i){return e.bottom<=r?false:e.top>r?true:(i?e.left:e.right)>t}function Ti(e,t,r,i,n){n-=or(t);var a=ii(e,t);var s=mi(t);var o=0,l=t.text.length,u=true;var c=me(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?Ei:Ai)(e,t,r,a,c,i,n);u=f.level!=1;o=u?f.from:f.to-1;l=u?f.to:f.from-1}var h=null,p=null;var d=ce(function(t){var r=ni(e,a,t);r.top+=s;r.bottom+=s;if(!Li(r,i,n,false)){return false}if(r.top<=n&&r.left<=i){h=t;p=r}return true},o,l);var m,v,g=false;if(p){var y=i-p.left<p.right-i,x=y==u;d=h+(x?0:1);v=x?"after":"before";m=y?p.left:p.right}else{if(!u&&(d==l||d==o)){d++}v=d==0?"after":d==t.text.length?"before":ni(e,a,d-(u?1:0)).bottom+s<=n==u?"after":"before";var b=xi(e,ot(r,d,v),"line",t,a);m=b.left;g=n<b.top?-1:n>=b.bottom?1:0}d=ue(t.text,d,1);return wi(r,d,v,g,i-m)}function Ai(e,t,r,i,n,a,s){var o=ce(function(o){var l=n[o],u=l.level!=1;return Li(xi(e,ot(r,u?l.to:l.from,u?"before":"after"),"line",t,i),a,s,true)},0,n.length-1);var l=n[o];if(o>0){var u=l.level!=1;var c=xi(e,ot(r,u?l.from:l.to,u?"after":"before"),"line",t,i);if(Li(c,a,s,true)&&c.top>s){l=n[o-1]}}return l}function Ei(e,t,r,i,n,a,s){var o=Ci(e,t,i,s);var l=o.begin;var u=o.end;if(/\s/.test(t.text.charAt(u-1))){u--}var c=null,f=null;for(var h=0;h<n.length;h++){var p=n[h];if(p.from>=u||p.to<=l){continue}var d=p.level!=1;var m=ni(e,i,d?Math.min(u,p.to)-1:Math.max(l,p.from)).right;var v=m<a?a-m+1e9:m-a;if(!c||f>v){c=p;f=v}}if(!c){c=n[n.length-1]}if(c.from<l){c={from:l,to:c.to,level:c.level}}if(c.to>u){c={from:c.from,to:u,level:c.level}}return c}var Mi;function Ni(e){if(e.cachedTextHeight!=null){return e.cachedTextHeight}if(Mi==null){Mi=M("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t){Mi.appendChild(document.createTextNode("x"));Mi.appendChild(M("br"))}Mi.appendChild(document.createTextNode("x"))}E(e.measure,Mi);var r=Mi.offsetHeight/50;if(r>3){e.cachedTextHeight=r}A(e.measure);return r||1}function _i(e){if(e.cachedCharWidth!=null){return e.cachedCharWidth}var t=M("span","xxxxxxxxxx");var r=M("pre",[t],"CodeMirror-line-like");E(e.measure,r);var i=t.getBoundingClientRect(),n=(i.right-i.left)/10;if(n>2){e.cachedCharWidth=n}return n||10}function Pi(e){var t=e.display,r={},i={};var n=t.gutters.clientLeft;for(var a=t.gutters.firstChild,s=0;a;a=a.nextSibling,++s){var o=e.display.gutterSpecs[s].className;r[o]=a.offsetLeft+a.clientLeft+n;i[o]=a.clientWidth}return{fixedPos:Ii(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Ii(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Oi(e){var t=Ni(e.display),r=e.options.lineWrapping;var i=r&&Math.max(5,e.display.scroller.clientWidth/_i(e.display)-3);return function(n){if(ar(e.doc,n)){return 0}var a=0;if(n.widgets){for(var s=0;s<n.widgets.length;s++){if(n.widgets[s].height){a+=n.widgets[s].height}}}if(r){return a+(Math.ceil(n.text.length/i)||1)*t}else{return a+t}}}function Di(e){var t=e.doc,r=Oi(e);t.iter(function(e){var t=r(e);if(t!=e.height){rt(e,t)}})}function Ri(e,t,r,i){var n=e.display;if(!r&&Me(t).getAttribute("cm-not-content")=="true"){return null}var a,s,o=n.lineSpace.getBoundingClientRect();try{a=t.clientX-o.left;s=t.clientY-o.top}catch(e){return null}var l=ki(e,a,s),u;if(i&&l.xRel>0&&(u=Je(e.doc,l.line).text).length==l.ch){var c=B(u,u.length,e.options.tabSize)-u.length;l=ot(l.line,Math.max(0,Math.round((a-$r(e.display).left)/_i(e.display))-c))}return l}function Vi(e,t){if(t>=e.display.viewTo){return null}t-=e.display.viewFrom;if(t<0){return null}var r=e.display.view;for(var i=0;i<r.length;i++){t-=r[i].size;if(t<0){return i}}}function Fi(e,t,r,i){if(t==null){t=e.doc.first}if(r==null){r=e.doc.first+e.doc.size}if(!i){i=0}var n=e.display;if(i&&r<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)){n.updateLineNumbers=t}e.curOp.viewChanged=true;if(t>=n.viewTo){if(Pt&&ir(e.doc,t)<n.viewTo){Wi(e)}}else if(r<=n.viewFrom){if(Pt&&nr(e.doc,r+i)>n.viewFrom){Wi(e)}else{n.viewFrom+=i;n.viewTo+=i}}else if(t<=n.viewFrom&&r>=n.viewTo){Wi(e)}else if(t<=n.viewFrom){var a=Bi(e,r,r+i,1);if(a){n.view=n.view.slice(a.index);n.viewFrom=a.lineN;n.viewTo+=i}else{Wi(e)}}else if(r>=n.viewTo){var s=Bi(e,t,t,-1);if(s){n.view=n.view.slice(0,s.index);n.viewTo=s.lineN}else{Wi(e)}}else{var o=Bi(e,t,t,-1);var l=Bi(e,r,r+i,1);if(o&&l){n.view=n.view.slice(0,o.index).concat(Sr(e,o.lineN,l.lineN)).concat(n.view.slice(l.index));n.viewTo+=i}else{Wi(e)}}var u=n.externalMeasured;if(u){if(r<u.lineN){u.lineN+=i}else if(t<u.lineN+u.size){n.externalMeasured=null}}}function zi(e,t,r){e.curOp.viewChanged=true;var i=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size){i.externalMeasured=null}if(t<i.viewFrom||t>=i.viewTo){return}var a=i.view[Vi(e,t)];if(a.node==null){return}var s=a.changes||(a.changes=[]);if(j(s,r)==-1){s.push(r)}}function Wi(e){e.display.viewFrom=e.display.viewTo=e.doc.first;e.display.view=[];e.display.viewOffset=0}function Bi(e,t,r,i){var n=Vi(e,t),a,s=e.display.view;if(!Pt||r==e.doc.first+e.doc.size){return{index:n,lineN:r}}var o=e.display.viewFrom;for(var l=0;l<n;l++){o+=s[l].size}if(o!=t){if(i>0){if(n==s.length-1){return null}a=o+s[n].size-t;n++}else{a=o-t}t+=a;r+=a}while(ir(e.doc,r)!=r){if(n==(i<0?0:s.length-1)){return null}r+=i*s[n-(i<0?1:0)].size;n+=i}return{index:n,lineN:r}}function Hi(e,t,r){var i=e.display,n=i.view;if(n.length==0||t>=i.viewTo||r<=i.viewFrom){i.view=Sr(e,t,r);i.viewFrom=t}else{if(i.viewFrom>t){i.view=Sr(e,t,i.viewFrom).concat(i.view)}else if(i.viewFrom<t){i.view=i.view.slice(Vi(e,t))}i.viewFrom=t;if(i.viewTo<r){i.view=i.view.concat(Sr(e,i.viewTo,r))}else if(i.viewTo>r){i.view=i.view.slice(0,Vi(e,r))}}i.viewTo=r}function ji(e){var t=e.display.view,r=0;for(var i=0;i<t.length;i++){var n=t[i];if(!n.hidden&&(!n.node||n.changes)){++r}}return r}function Ui(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Gi(e,t){if(t===void 0)t=true;var r=e.doc,i={};var n=i.cursors=document.createDocumentFragment();var a=i.selection=document.createDocumentFragment();var s=e.options.$customCursor;if(s){t=true}for(var o=0;o<r.sel.ranges.length;o++){if(!t&&o==r.sel.primIndex){continue}var l=r.sel.ranges[o];if(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom){continue}var u=l.empty();if(s){var c=s(e,l);if(c){qi(e,c,n)}}else if(u||e.options.showCursorWhenSelecting){qi(e,l.head,n)}if(!u){$i(e,l,a)}}return i}function qi(e,t,r){var i=xi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine);var n=r.appendChild(M("div"," ","CodeMirror-cursor"));n.style.left=i.left+"px";n.style.top=i.top+"px";n.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px";if(/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var a=yi(e,t,"div",null,null);var s=a.right-a.left;n.style.width=(s>0?s:e.defaultCharWidth())+"px"}if(i.other){var o=r.appendChild(M("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="";o.style.left=i.other.left+"px";o.style.top=i.other.top+"px";o.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Ki(e,t){return e.top-t.top||e.left-t.left}function $i(e,t,r){var i=e.display,n=e.doc;var a=document.createDocumentFragment();var s=$r(e.display),o=s.left;var l=Math.max(i.sizerWidth,Yr(e)-i.sizer.offsetLeft)-s.right;var u=n.direction=="ltr";function c(e,t,r,i){if(t<0){t=0}t=Math.round(t);i=Math.round(i);a.appendChild(M("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(r==null?l-e:r)+"px;\n                             height: "+(i-t)+"px"))}function f(t,r,i){var a=Je(n,t);var s=a.text.length;var f,h;function p(r,i){return yi(e,ot(t,r),"div",a,i)}function d(t,r,i){var n=Si(e,a,null,t);var s=r=="ltr"==(i=="after")?"left":"right";var o=i=="after"?n.begin:n.end-(/\s/.test(a.text.charAt(n.end-1))?2:1);return p(o,s)[s]}var m=me(a,n.direction);fe(m,r||0,i==null?s:i,function(e,t,n,a){var v=n=="ltr";var g=p(e,v?"left":"right");var y=p(t-1,v?"right":"left");var x=r==null&&e==0,b=i==null&&t==s;var w=a==0,k=!m||a==m.length-1;if(y.top-g.top<=3){var C=(u?x:b)&&w;var S=(u?b:x)&&k;var L=C?o:(v?g:y).left;var T=S?l:(v?y:g).right;c(L,g.top,T-L,g.bottom)}else{var A,E,M,N;if(v){A=u&&x&&w?o:g.left;E=u?l:d(e,n,"before");M=u?o:d(t,n,"after");N=u&&b&&k?l:y.right}else{A=!u?o:d(e,n,"before");E=!u&&x&&w?l:g.right;M=!u&&b&&k?o:y.left;N=!u?l:d(t,n,"after")}c(A,g.top,E-A,g.bottom);if(g.bottom<y.top){c(o,g.bottom,null,y.top)}c(M,y.top,N-M,y.bottom)}if(!f||Ki(g,f)<0){f=g}if(Ki(y,f)<0){f=y}if(!h||Ki(g,h)<0){h=g}if(Ki(y,h)<0){h=y}});return{start:f,end:h}}var h=t.from(),p=t.to();if(h.line==p.line){f(h.line,h.ch,p.ch)}else{var d=Je(n,h.line),m=Je(n,p.line);var v=er(d)==er(m);var g=f(h.line,h.ch,v?d.text.length+1:null).end;var y=f(p.line,v?0:null,p.ch).start;if(v){if(g.top<y.top-2){c(g.right,g.top,null,g.bottom);c(o,y.top,y.left,y.bottom)}else{c(g.right,g.top,y.left-g.right,g.bottom)}}if(g.bottom<y.top){c(o,g.bottom,null,y.top)}}r.appendChild(a)}function Xi(e){if(!e.state.focused){return}var t=e.display;clearInterval(t.blinker);var r=true;t.cursorDiv.style.visibility="";if(e.options.cursorBlinkRate>0){t.blinker=setInterval(function(){if(!e.hasFocus()){Ji(e)}t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate)}else if(e.options.cursorBlinkRate<0){t.cursorDiv.style.visibility="hidden"}}function Yi(e){if(!e.hasFocus()){e.display.input.focus();if(!e.state.focused){Zi(e)}}}function Qi(e){e.state.delayingBlurEvent=true;setTimeout(function(){if(e.state.delayingBlurEvent){e.state.delayingBlurEvent=false;if(e.state.focused){Ji(e)}}},100)}function Zi(e,t){if(e.state.delayingBlurEvent&&!e.state.draggingText){e.state.delayingBlurEvent=false}if(e.options.readOnly=="nocursor"){return}if(!e.state.focused){be(e,"focus",e,t);e.state.focused=true;O(e.display.wrapper,"CodeMirror-focused");if(!e.curOp&&e.display.selForContextMenu!=e.doc.sel){e.display.input.reset();if(l){setTimeout(function(){return e.display.input.reset(true)},20)}}e.display.input.receivedFocus()}Xi(e)}function Ji(e,t){if(e.state.delayingBlurEvent){return}if(e.state.focused){be(e,"blur",e,t);e.state.focused=false;T(e.display.wrapper,"CodeMirror-focused")}clearInterval(e.display.blinker);setTimeout(function(){if(!e.state.focused){e.display.shift=false}},150)}function en(e){var t=e.display;var r=t.lineDiv.offsetTop;var i=Math.max(0,t.scroller.getBoundingClientRect().top);var n=t.lineDiv.getBoundingClientRect().top;var a=0;for(var l=0;l<t.view.length;l++){var u=t.view[l],c=e.options.lineWrapping;var f=void 0,h=0;if(u.hidden){continue}n+=u.line.height;if(s&&o<8){var p=u.node.offsetTop+u.node.offsetHeight;f=p-r;r=p}else{var d=u.node.getBoundingClientRect();f=d.bottom-d.top;if(!c&&u.text.firstChild){h=u.text.firstChild.getBoundingClientRect().right-d.left-1}}var m=u.line.height-f;if(m>.005||m<-.005){if(n<i){a-=m}rt(u.line,f);tn(u.line);if(u.rest){for(var v=0;v<u.rest.length;v++){tn(u.rest[v])}}}if(h>e.display.sizerWidth){var g=Math.ceil(h/_i(e.display));if(g>e.display.maxLineLength){e.display.maxLineLength=g;e.display.maxLine=u.line;e.display.maxLineChanged=true}}}if(Math.abs(a)>2){t.scroller.scrollTop+=a}}function tn(e){if(e.widgets){for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],i=r.node.parentNode;if(i){r.height=i.offsetHeight}}}}function rn(e,t,r){var i=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;i=Math.floor(i-qr(e));var n=r&&r.bottom!=null?r.bottom:i+e.wrapper.clientHeight;var a=nt(t,i),s=nt(t,n);if(r&&r.ensure){var o=r.ensure.from.line,l=r.ensure.to.line;if(o<a){a=o;s=nt(t,or(Je(t,o))+e.wrapper.clientHeight)}else if(Math.min(l,t.lastLine())>=s){a=nt(t,or(Je(t,l))-e.wrapper.clientHeight);s=l}}return{from:a,to:Math.max(s,a+1)}}function nn(e,t){if(we(e,"scrollCursorIntoView")){return}var r=e.display,i=r.sizer.getBoundingClientRect(),n=null;var a=r.wrapper.ownerDocument;if(t.top+i.top<0){n=true}else if(t.bottom+i.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)){n=false}if(n!=null&&!m){var s=M("div","​",null,"position: absolute;\n                         top: "+(t.top-r.viewOffset-qr(e.display))+"px;\n                         height: "+(t.bottom-t.top+Xr(e)+r.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s);s.scrollIntoView(n);e.display.lineSpace.removeChild(s)}}function an(e,t,r,i){if(i==null){i=0}var n;if(!e.options.lineWrapping&&t==r){r=t.sticky=="before"?ot(t.line,t.ch+1,"before"):t;t=t.ch?ot(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t}for(var a=0;a<5;a++){var s=false;var o=xi(e,t);var l=!r||r==t?o:xi(e,r);n={left:Math.min(o.left,l.left),top:Math.min(o.top,l.top)-i,right:Math.max(o.left,l.left),bottom:Math.max(o.bottom,l.bottom)+i};var u=on(e,n);var c=e.doc.scrollTop,f=e.doc.scrollLeft;if(u.scrollTop!=null){dn(e,u.scrollTop);if(Math.abs(e.doc.scrollTop-c)>1){s=true}}if(u.scrollLeft!=null){vn(e,u.scrollLeft);if(Math.abs(e.doc.scrollLeft-f)>1){s=true}}if(!s){break}}return n}function sn(e,t){var r=on(e,t);if(r.scrollTop!=null){dn(e,r.scrollTop)}if(r.scrollLeft!=null){vn(e,r.scrollLeft)}}function on(e,t){var r=e.display,i=Ni(e.display);if(t.top<0){t.top=0}var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop;var a=Qr(e),s={};if(t.bottom-t.top>a){t.bottom=t.top+a}var o=e.doc.height+Kr(r);var l=t.top<i,u=t.bottom>o-i;if(t.top<n){s.scrollTop=l?0:t.top}else if(t.bottom>n+a){var c=Math.min(t.top,(u?o:t.bottom)-a);if(c!=n){s.scrollTop=c}}var f=e.options.fixedGutter?0:r.gutters.offsetWidth;var h=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-f;var p=Yr(e)-r.gutters.offsetWidth;var d=t.right-t.left>p;if(d){t.right=t.left+p}if(t.left<10){s.scrollLeft=0}else if(t.left<h){s.scrollLeft=Math.max(0,t.left+f-(d?0:10))}else if(t.right>p+h-3){s.scrollLeft=t.right+(d?0:10)-p}return s}function ln(e,t){if(t==null){return}hn(e);e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function un(e){hn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function cn(e,t,r){if(t!=null||r!=null){hn(e)}if(t!=null){e.curOp.scrollLeft=t}if(r!=null){e.curOp.scrollTop=r}}function fn(e,t){hn(e);e.curOp.scrollToPos=t}function hn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=bi(e,t.from),i=bi(e,t.to);pn(e,r,i,t.margin)}}function pn(e,t,r,i){var n=on(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-i,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+i});cn(e,n.scrollLeft,n.scrollTop)}function dn(e,t){if(Math.abs(e.doc.scrollTop-t)<2){return}if(!r){Gn(e,{top:t})}mn(e,t,true);if(r){Gn(e)}Vn(e,100)}function mn(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t));if(e.display.scroller.scrollTop==t&&!r){return}e.doc.scrollTop=t;e.display.scrollbars.setScrollTop(t);if(e.display.scroller.scrollTop!=t){e.display.scroller.scrollTop=t}}function vn(e,t,r,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth));if((r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i){return}e.doc.scrollLeft=t;Xn(e);if(e.display.scroller.scrollLeft!=t){e.display.scroller.scrollLeft=t}e.display.scrollbars.setScrollLeft(t)}function gn(e){var t=e.display,r=t.gutters.offsetWidth;var i=Math.round(e.doc.height+Kr(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:i,scrollHeight:i+Xr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var yn=function(e,t,r){this.cm=r;var i=this.vert=M("div",[M("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var n=this.horiz=M("div",[M("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=n.tabIndex=-1;e(i);e(n);ge(i,"scroll",function(){if(i.clientHeight){t(i.scrollTop,"vertical")}});ge(n,"scroll",function(){if(n.clientWidth){t(n.scrollLeft,"horizontal")}});this.checkedZeroWidth=false
;if(s&&o<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};yn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1;var r=e.scrollHeight>e.clientHeight+1;var i=e.nativeBarWidth;if(r){this.vert.style.display="block";this.vert.style.bottom=t?i+"px":"0";var n=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else{this.vert.scrollTop=0;this.vert.style.display="";this.vert.firstChild.style.height="0"}if(t){this.horiz.style.display="block";this.horiz.style.right=r?i+"px":"0";this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(r?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedZeroWidth&&e.clientHeight>0){if(i==0){this.zeroWidthHack()}this.checkedZeroWidth=true}return{right:r?i:0,bottom:t?i:0}};yn.prototype.setScrollLeft=function(e){if(this.horiz.scrollLeft!=e){this.horiz.scrollLeft=e}if(this.disableHoriz){this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")}};yn.prototype.setScrollTop=function(e){if(this.vert.scrollTop!=e){this.vert.scrollTop=e}if(this.disableVert){this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}};yn.prototype.zeroWidthHack=function(){var e=x&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e;this.horiz.style.visibility=this.vert.style.visibility="hidden";this.disableHoriz=new H;this.disableVert=new H};yn.prototype.enableZeroWidthBar=function(e,t,r){e.style.visibility="";function i(){var n=e.getBoundingClientRect();var a=r=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);if(a!=e){e.style.visibility="hidden"}else{t.set(1e3,i)}}t.set(1e3,i)};yn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz);e.removeChild(this.vert)};var xn=function(){};xn.prototype.update=function(){return{bottom:0,right:0}};xn.prototype.setScrollLeft=function(){};xn.prototype.setScrollTop=function(){};xn.prototype.clear=function(){};function bn(e,t){if(!t){t=gn(e)}var r=e.display.barWidth,i=e.display.barHeight;wn(e,t);for(var n=0;n<4&&r!=e.display.barWidth||i!=e.display.barHeight;n++){if(r!=e.display.barWidth&&e.options.lineWrapping){en(e)}wn(e,gn(e));r=e.display.barWidth;i=e.display.barHeight}}function wn(e,t){var r=e.display;var i=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=i.right)+"px";r.sizer.style.paddingBottom=(r.barHeight=i.bottom)+"px";r.heightForcer.style.borderBottom=i.bottom+"px solid transparent";if(i.right&&i.bottom){r.scrollbarFiller.style.display="block";r.scrollbarFiller.style.height=i.bottom+"px";r.scrollbarFiller.style.width=i.right+"px"}else{r.scrollbarFiller.style.display=""}if(i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter){r.gutterFiller.style.display="block";r.gutterFiller.style.height=i.bottom+"px";r.gutterFiller.style.width=t.gutterWidth+"px"}else{r.gutterFiller.style.display=""}}var kn={native:yn,null:xn};function Cn(e){if(e.display.scrollbars){e.display.scrollbars.clear();if(e.display.scrollbars.addClass){T(e.display.wrapper,e.display.scrollbars.addClass)}}e.display.scrollbars=new kn[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller);ge(t,"mousedown",function(){if(e.state.focused){setTimeout(function(){return e.display.input.focus()},0)}});t.setAttribute("cm-not-content","true")},function(t,r){if(r=="horizontal"){vn(e,t)}else{dn(e,t)}},e);if(e.display.scrollbars.addClass){O(e.display.wrapper,e.display.scrollbars.addClass)}}var Sn=0;function Ln(e){e.curOp={cm:e,viewChanged:false,startHeight:e.doc.height,forceUpdate:false,updateInput:0,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:false,id:++Sn,markArrays:null};Tr(e.curOp)}function Tn(e){var t=e.curOp;if(t){Er(t,function(e){for(var t=0;t<e.ops.length;t++){e.ops[t].cm.curOp=null}An(e)})}}function An(e){var t=e.ops;for(var r=0;r<t.length;r++){En(t[r])}for(var i=0;i<t.length;i++){Mn(t[i])}for(var n=0;n<t.length;n++){Nn(t[n])}for(var a=0;a<t.length;a++){_n(t[a])}for(var s=0;s<t.length;s++){Pn(t[s])}}function En(e){var t=e.cm,r=t.display;Wn(t);if(e.updateMaxLine){ur(t)}e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping;e.update=e.mustUpdate&&new zn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Mn(e){e.updatedDisplay=e.mustUpdate&&jn(e.cm,e.update)}function Nn(e){var t=e.cm,r=t.display;if(e.updatedDisplay){en(t)}e.barMeasure=gn(t);if(r.maxLineChanged&&!t.options.lineWrapping){e.adjustWidthTo=ti(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+Xr(t)+t.display.barWidth);e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Yr(t))}if(e.updatedDisplay||e.selectionChanged){e.preparedSelection=r.input.prepareSelection()}}function _n(e){var t=e.cm;if(e.adjustWidthTo!=null){t.display.sizer.style.minWidth=e.adjustWidthTo+"px";if(e.maxScrollLeft<t.doc.scrollLeft){vn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),true)}t.display.maxLineChanged=false}var r=e.focus&&e.focus==I(V(t));if(e.preparedSelection){t.display.input.showSelection(e.preparedSelection,r)}if(e.updatedDisplay||e.startHeight!=t.doc.height){bn(t,e.barMeasure)}if(e.updatedDisplay){$n(t,e.barMeasure)}if(e.selectionChanged){Xi(t)}if(t.state.focused&&e.updateInput){t.display.input.reset(e.typing)}if(r){Yi(e.cm)}}function Pn(e){var t=e.cm,r=t.display,i=t.doc;if(e.updatedDisplay){Un(t,e.update)}if(r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)){r.wheelStartX=r.wheelStartY=null}if(e.scrollTop!=null){mn(t,e.scrollTop,e.forceScroll)}if(e.scrollLeft!=null){vn(t,e.scrollLeft,true,true)}if(e.scrollToPos){var n=an(t,dt(i,e.scrollToPos.from),dt(i,e.scrollToPos.to),e.scrollToPos.margin);nn(t,n)}var a=e.maybeHiddenMarkers,s=e.maybeUnhiddenMarkers;if(a){for(var o=0;o<a.length;++o){if(!a[o].lines.length){be(a[o],"hide")}}}if(s){for(var l=0;l<s.length;++l){if(s[l].lines.length){be(s[l],"unhide")}}}if(r.wrapper.offsetHeight){i.scrollTop=t.display.scroller.scrollTop}if(e.changeObjs){be(t,"changes",t,e.changeObjs)}if(e.update){e.update.finish()}}function In(e,t){if(e.curOp){return t()}Ln(e);try{return t()}finally{Tn(e)}}function On(e,t){return function(){if(e.curOp){return t.apply(e,arguments)}Ln(e);try{return t.apply(e,arguments)}finally{Tn(e)}}}function Dn(e){return function(){if(this.curOp){return e.apply(this,arguments)}Ln(this);try{return e.apply(this,arguments)}finally{Tn(this)}}}function Rn(e){return function(){var t=this.cm;if(!t||t.curOp){return e.apply(this,arguments)}Ln(t);try{return e.apply(this,arguments)}finally{Tn(t)}}}function Vn(e,t){if(e.doc.highlightFrontier<e.display.viewTo){e.state.highlight.set(t,z(Fn,e))}}function Fn(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo){return}var r=+new Date+e.options.workTime;var i=wt(e,t.highlightFrontier);var n=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(i.line>=e.display.viewFrom){var s=a.styles;var o=a.text.length>e.options.maxHighlightLength?Xe(t.mode,i.state):null;var l=xt(e,a,i,true);if(o){i.state=o}a.styles=l.styles;var u=a.styleClasses,c=l.classes;if(c){a.styleClasses=c}else if(u){a.styleClasses=null}var f=!s||s.length!=a.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass);for(var h=0;!f&&h<s.length;++h){f=s[h]!=a.styles[h]}if(f){n.push(i.line)}a.stateAfter=i.save();i.nextLine()}else{if(a.text.length<=e.options.maxHighlightLength){kt(e,a.text,i)}a.stateAfter=i.line%5==0?i.save():null;i.nextLine()}if(+new Date>r){Vn(e,e.options.workDelay);return true}});t.highlightFrontier=i.line;t.modeFrontier=Math.max(t.modeFrontier,i.line);if(n.length){In(e,function(){for(var t=0;t<n.length;t++){zi(e,n[t],"text")}})}}var zn=function(e,t,r){var i=e.display;this.viewport=t;this.visible=rn(i,e.doc,t);this.editorIsHidden=!i.wrapper.offsetWidth;this.wrapperHeight=i.wrapper.clientHeight;this.wrapperWidth=i.wrapper.clientWidth;this.oldDisplayWidth=Yr(e);this.force=r;this.dims=Pi(e);this.events=[]};zn.prototype.signal=function(e,t){if(Ce(e,t)){this.events.push(arguments)}};zn.prototype.finish=function(){for(var e=0;e<this.events.length;e++){be.apply(null,this.events[e])}};function Wn(e){var t=e.display;if(!t.scrollbarsClipped&&t.scroller.offsetWidth){t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth;t.heightForcer.style.height=Xr(e)+"px";t.sizer.style.marginBottom=-t.nativeBarWidth+"px";t.sizer.style.borderRightWidth=Xr(e)+"px";t.scrollbarsClipped=true}}function Bn(e){if(e.hasFocus()){return null}var t=I(V(e));if(!t||!P(e.display.lineDiv,t)){return null}var r={activeElt:t};if(window.getSelection){var i=F(e).getSelection();if(i.anchorNode&&i.extend&&P(e.display.lineDiv,i.anchorNode)){r.anchorNode=i.anchorNode;r.anchorOffset=i.anchorOffset;r.focusNode=i.focusNode;r.focusOffset=i.focusOffset}}return r}function Hn(e){if(!e||!e.activeElt||e.activeElt==I(e.activeElt.ownerDocument)){return}e.activeElt.focus();if(!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode)){var t=e.activeElt.ownerDocument;var r=t.defaultView.getSelection(),i=t.createRange();i.setEnd(e.anchorNode,e.anchorOffset);i.collapse(false);r.removeAllRanges();r.addRange(i);r.extend(e.focusNode,e.focusOffset)}}function jn(e,t){var r=e.display,i=e.doc;if(t.editorIsHidden){Wi(e);return false}if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&ji(e)==0){return false}if(Yn(e)){Wi(e);t.dims=Pi(e)}var n=i.first+i.size;var a=Math.max(t.visible.from-e.options.viewportMargin,i.first);var s=Math.min(n,t.visible.to+e.options.viewportMargin);if(r.viewFrom<a&&a-r.viewFrom<20){a=Math.max(i.first,r.viewFrom)}if(r.viewTo>s&&r.viewTo-s<20){s=Math.min(n,r.viewTo)}if(Pt){a=ir(e.doc,a);s=nr(e.doc,s)}var o=a!=r.viewFrom||s!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Hi(e,a,s);r.viewOffset=or(Je(e.doc,r.viewFrom));e.display.mover.style.top=r.viewOffset+"px";var l=ji(e);if(!o&&l==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)){return false}var u=Bn(e);if(l>4){r.lineDiv.style.display="none"}qn(e,r.updateLineNumbers,t.dims);if(l>4){r.lineDiv.style.display=""}r.renderedView=r.view;Hn(u);A(r.cursorDiv);A(r.selectionDiv);r.gutters.style.height=r.sizer.style.minHeight=0;if(o){r.lastWrapHeight=t.wrapperHeight;r.lastWrapWidth=t.wrapperWidth;Vn(e,400)}r.updateLineNumbers=null;return true}function Un(e,t){var r=t.viewport;for(var i=true;;i=false){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Yr(e)){if(r&&r.top!=null){r={top:Math.min(e.doc.height+Kr(e.display)-Qr(e),r.top)}}t.visible=rn(e.display,e.doc,r);if(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo){break}}else if(i){t.visible=rn(e.display,e.doc,r)}if(!jn(e,t)){break}en(e);var n=gn(e);Ui(e);bn(e,n);$n(e,n);t.force=false}t.signal(e,"update",e);if(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 Gn(e,t){var r=new zn(e,t);if(jn(e,r)){en(e);Un(e,r);var i=gn(e);Ui(e);bn(e,i);$n(e,i);r.finish()}}function qn(e,t,r){var i=e.display,n=e.options.lineNumbers;var a=i.lineDiv,s=a.firstChild;function o(t){var r=t.nextSibling;if(l&&x&&e.display.currentWheelTarget==t){t.style.display="none"}else{t.parentNode.removeChild(t)}return r}var u=i.view,c=i.viewFrom;for(var f=0;f<u.length;f++){var h=u[f];if(h.hidden);else if(!h.node||h.node.parentNode!=a){var p=Wr(e,h,c,r);a.insertBefore(p,s)}else{while(s!=h.node){s=o(s)}var d=n&&t!=null&&t<=c&&h.lineNumber;if(h.changes){if(j(h.changes,"gutter")>-1){d=false}Pr(e,h,c,r)}if(d){A(h.lineNumber);h.lineNumber.appendChild(document.createTextNode(st(e.options,c)))}s=h.node.nextSibling}c+=h.size}while(s){s=o(s)}}function Kn(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px";Nr(e,"gutterChanged",e)}function $n(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+Xr(e)+"px"}function Xn(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter)){return}var i=Ii(t)-t.scroller.scrollLeft+e.doc.scrollLeft;var n=t.gutters.offsetWidth,a=i+"px";for(var s=0;s<r.length;s++){if(!r[s].hidden){if(e.options.fixedGutter){if(r[s].gutter){r[s].gutter.style.left=a}if(r[s].gutterBackground){r[s].gutterBackground.style.left=a}}var o=r[s].alignable;if(o){for(var l=0;l<o.length;l++){o[l].style.left=a}}}}if(e.options.fixedGutter){t.gutters.style.left=i+n+"px"}}function Yn(e){if(!e.options.lineNumbers){return false}var t=e.doc,r=st(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var n=i.measure.appendChild(M("div",[M("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var a=n.firstChild.offsetWidth,s=n.offsetWidth-a;i.lineGutter.style.width="";i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-s)+1;i.lineNumWidth=i.lineNumInnerWidth+s;i.lineNumChars=i.lineNumInnerWidth?r.length:-1;i.lineGutter.style.width=i.lineNumWidth+"px";Kn(e.display);return true}return false}function Qn(e,t){var r=[],i=false;for(var n=0;n<e.length;n++){var a=e[n],s=null;if(typeof a!="string"){s=a.style;a=a.className}if(a=="CodeMirror-linenumbers"){if(!t){continue}else{i=true}}r.push({className:a,style:s})}if(t&&!i){r.push({className:"CodeMirror-linenumbers",style:null})}return r}function Zn(e){var t=e.gutters,r=e.gutterSpecs;A(t);e.lineGutter=null;for(var i=0;i<r.length;++i){var n=r[i];var a=n.className;var s=n.style;var o=t.appendChild(M("div",null,"CodeMirror-gutter "+a));if(s){o.style.cssText=s}if(a=="CodeMirror-linenumbers"){e.lineGutter=o;o.style.width=(e.lineNumWidth||1)+"px"}}t.style.display=r.length?"":"none";Kn(e)}function Jn(e){Zn(e.display);Fi(e);Xn(e)}function ea(e,t,i,n){var a=this;this.input=i;a.scrollbarFiller=M("div",null,"CodeMirror-scrollbar-filler");a.scrollbarFiller.setAttribute("cm-not-content","true");a.gutterFiller=M("div",null,"CodeMirror-gutter-filler");a.gutterFiller.setAttribute("cm-not-content","true");a.lineDiv=N("div",null,"CodeMirror-code");a.selectionDiv=M("div",null,null,"position: relative; z-index: 1");a.cursorDiv=M("div",null,"CodeMirror-cursors");a.measure=M("div",null,"CodeMirror-measure");a.lineMeasure=M("div",null,"CodeMirror-measure");a.lineSpace=N("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var u=N("div",[a.lineSpace],"CodeMirror-lines");a.mover=M("div",[u],null,"position: relative");a.sizer=M("div",[a.mover],"CodeMirror-sizer");a.sizerWidth=null;a.heightForcer=M("div",null,null,"position: absolute; height: "+U+"px; width: 1px;");a.gutters=M("div",null,"CodeMirror-gutters");a.lineGutter=null;a.scroller=M("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll");a.scroller.setAttribute("tabIndex","-1");a.wrapper=M("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror");if(c&&f>=105){a.wrapper.style.clipPath="inset(0px)"}a.wrapper.setAttribute("translate","no");if(s&&o<8){a.gutters.style.zIndex=-1;a.scroller.style.paddingRight=0}if(!l&&!(r&&y)){a.scroller.draggable=true}if(e){if(e.appendChild){e.appendChild(a.wrapper)}else{e(a.wrapper)}}a.viewFrom=a.viewTo=t.first;a.reportedViewFrom=a.reportedViewTo=t.first;a.view=[];a.renderedView=null;a.externalMeasured=null;a.viewOffset=0;a.lastWrapHeight=a.lastWrapWidth=0;a.updateLineNumbers=null;a.nativeBarWidth=a.barHeight=a.barWidth=0;a.scrollbarsClipped=false;a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null;a.alignWidgets=false;a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null;a.maxLine=null;a.maxLineLength=0;a.maxLineChanged=false;a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null;a.shift=false;a.selForContextMenu=null;a.activeTouch=null;a.gutterSpecs=Qn(n.gutters,n.lineNumbers);Zn(a);i.init(a)}var ta=0,ra=null;if(s){ra=-.53}else if(r){ra=15}else if(c){ra=-.7}else if(p){ra=-1/3}function ia(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;if(t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS){t=e.detail}if(r==null&&e.detail&&e.axis==e.VERTICAL_AXIS){r=e.detail}else if(r==null){r=e.wheelDelta}return{x:t,y:r}}function na(e){var t=ia(e);t.x*=ra;t.y*=ra;return t}function aa(e,t){if(c&&f==102){if(e.display.chromeScrollHack==null){e.display.sizer.style.pointerEvents="none"}else{clearTimeout(e.display.chromeScrollHack)}e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null;e.display.sizer.style.pointerEvents=""},100)}var i=ia(t),n=i.x,a=i.y;var s=ra;if(t.deltaMode===0){n=t.deltaX;a=t.deltaY;s=1}var o=e.display,u=o.scroller;var p=u.scrollWidth>u.clientWidth;var d=u.scrollHeight>u.clientHeight;if(!(n&&p||a&&d)){return}if(a&&x&&l){e:for(var m=t.target,v=o.view;m!=u;m=m.parentNode){for(var g=0;g<v.length;g++){if(v[g].node==m){e.display.currentWheelTarget=m;break e}}}}if(n&&!r&&!h&&s!=null){if(a&&d){dn(e,Math.max(0,u.scrollTop+a*s))}vn(e,Math.max(0,u.scrollLeft+n*s));if(!a||a&&d){Le(t)}o.wheelStartX=null;return}if(a&&s!=null){var y=a*s;var b=e.doc.scrollTop,w=b+o.wrapper.clientHeight;if(y<0){b=Math.max(0,b+y-50)}else{w=Math.min(e.doc.height,w+y+50)}Gn(e,{top:b,bottom:w})}if(ta<20&&t.deltaMode!==0){if(o.wheelStartX==null){o.wheelStartX=u.scrollLeft;o.wheelStartY=u.scrollTop;o.wheelDX=n;o.wheelDY=a;setTimeout(function(){if(o.wheelStartX==null){return}var e=u.scrollLeft-o.wheelStartX;var t=u.scrollTop-o.wheelStartY;var r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null;if(!r){return}ra=(ra*ta+r)/(ta+1);++ta},200)}else{o.wheelDX+=n;o.wheelDY+=a}}}var sa=function(e,t){this.ranges=e;this.primIndex=t};sa.prototype.primary=function(){return this.ranges[this.primIndex]};sa.prototype.equals=function(e){if(e==this){return true}if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length){return false}for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],i=e.ranges[t];if(!ut(r.anchor,i.anchor)||!ut(r.head,i.head)){return false}}return true};sa.prototype.deepCopy=function(){var e=[];for(var t=0;t<this.ranges.length;t++){e[t]=new oa(ct(this.ranges[t].anchor),ct(this.ranges[t].head))}return new sa(e,this.primIndex)};sa.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++){if(!this.ranges[e].empty()){return true}}return false};sa.prototype.contains=function(e,t){if(!t){t=e}for(var r=0;r<this.ranges.length;r++){var i=this.ranges[r];if(lt(t,i.from())>=0&&lt(e,i.to())<=0){return r}}return-1};var oa=function(e,t){this.anchor=e;this.head=t};oa.prototype.from=function(){return ht(this.anchor,this.head)};oa.prototype.to=function(){return ft(this.anchor,this.head)};oa.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function la(e,t,r){var i=e&&e.options.selectionsMayTouch;var n=t[r];t.sort(function(e,t){return lt(e.from(),t.from())});r=j(t,n);for(var a=1;a<t.length;a++){var s=t[a],o=t[a-1];var l=lt(o.to(),s.from());if(i&&!s.empty()?l>0:l>=0){var u=ht(o.from(),s.from()),c=ft(o.to(),s.to());var f=o.empty()?s.from()==s.head:o.from()==o.head;if(a<=r){--r}t.splice(--a,2,new oa(f?c:u,f?u:c))}}return new sa(t,r)}function ua(e,t){return new sa([new oa(e,t||e)],0)}function ca(e){if(!e.text){return e.to}return ot(e.from.line+e.text.length-1,Z(e.text).length+(e.text.length==1?e.from.ch:0))}function fa(e,t){if(lt(e,t.from)<0){return e}if(lt(e,t.to)<=0){return ca(t)}var r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;if(e.line==t.to.line){i+=ca(t).ch-t.to.ch}return ot(r,i)}function ha(e,t){var r=[];for(var i=0;i<e.sel.ranges.length;i++){var n=e.sel.ranges[i];r.push(new oa(fa(n.anchor,t),fa(n.head,t)))}return la(e.cm,r,e.sel.primIndex)}function pa(e,t,r){if(e.line==t.line){return ot(r.line,e.ch-t.ch+r.ch)}else{return ot(r.line+(e.line-t.line),e.ch)}}function da(e,t,r){var i=[];var n=ot(e.first,0),a=n;for(var s=0;s<t.length;s++){var o=t[s];var l=pa(o.from,n,a);var u=pa(ca(o),n,a);n=o.to;a=u;if(r=="around"){var c=e.sel.ranges[s],f=lt(c.head,c.anchor)<0;i[s]=new oa(f?u:l,f?l:u)}else{i[s]=new oa(l,l)}}return new sa(i,e.sel.primIndex)}function ma(e){e.doc.mode=qe(e.options,e.doc.modeOption);va(e)}function va(e){e.doc.iter(function(e){if(e.stateAfter){e.stateAfter=null}if(e.styles){e.styles=null}});e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first;Vn(e,100);e.state.modeGen++;if(e.curOp){Fi(e)}}function ga(e,t){return t.from.ch==0&&t.to.ch==0&&Z(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ya(e,t,r,i){function n(e){return r?r[e]:null}function a(e,r,n){fr(e,r,n,i);Nr(e,"change",e,t)}function s(e,t){var r=[];for(var a=e;a<t;++a){r.push(new cr(u[a],n(a),i))}return r}var o=t.from,l=t.to,u=t.text;var c=Je(e,o.line),f=Je(e,l.line);var h=Z(u),p=n(u.length-1),d=l.line-o.line;if(t.full){e.insert(0,s(0,u.length));e.remove(u.length,e.size-u.length)}else if(ga(e,t)){var m=s(0,u.length-1);a(f,f.text,p);if(d){e.remove(o.line,d)}if(m.length){e.insert(o.line,m)}}else if(c==f){if(u.length==1){a(c,c.text.slice(0,o.ch)+h+c.text.slice(l.ch),p)}else{var v=s(1,u.length-1);v.push(new cr(h+c.text.slice(l.ch),p,i));a(c,c.text.slice(0,o.ch)+u[0],n(0));e.insert(o.line+1,v)}}else if(u.length==1){a(c,c.text.slice(0,o.ch)+u[0]+f.text.slice(l.ch),n(0));e.remove(o.line+1,d)}else{a(c,c.text.slice(0,o.ch)+u[0],n(0));a(f,h+f.text.slice(l.ch),p);var g=s(1,u.length-1);if(d>1){e.remove(o.line+1,d-1)}e.insert(o.line+1,g)}Nr(e,"change",e,t)}function xa(e,t,r){function i(e,n,a){if(e.linked){for(var s=0;s<e.linked.length;++s){var o=e.linked[s];if(o.doc==n){continue}var l=a&&o.sharedHist;if(r&&!l){continue}t(o.doc,l);i(o.doc,e,l)}}}i(e,null,true)}function ba(e,t){if(t.cm){throw new Error("This document is already in use.")}e.doc=t;t.cm=e;Di(e);ma(e);wa(e);e.options.direction=t.direction;if(!e.options.lineWrapping){ur(e)}e.options.mode=t.modeOption;Fi(e)}function wa(e){(e.doc.direction=="rtl"?O:T)(e.display.lineDiv,"CodeMirror-rtl")}function ka(e){In(e,function(){wa(e);Fi(e)})}function Ca(e){this.done=[];this.undone=[];this.undoDepth=e?e.undoDepth:Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=e?e.maxGeneration:1}function Sa(e,t){var r={from:ct(t.from),to:ca(t),text:et(e,t.from,t.to)};_a(e,r,t.from.line,t.to.line+1);xa(e,function(e){return _a(e,r,t.from.line,t.to.line+1)},true);return r}function La(e){while(e.length){var t=Z(e);if(t.ranges){e.pop()}else{break}}}function Ta(e,t){if(t){La(e.done);return Z(e.done)}else if(e.done.length&&!Z(e.done).ranges){return Z(e.done)}else if(e.done.length>1&&!e.done[e.done.length-2].ranges){e.done.pop();return Z(e.done)}}function Aa(e,t,r,i){var n=e.history;n.undone.length=0;var a=+new Date,s;var o;if((n.lastOp==i||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(s=Ta(n,n.lastOp==i))){o=Z(s.changes);if(lt(t.from,t.to)==0&&lt(t.from,o.to)==0){o.to=ca(t)}else{s.changes.push(Sa(e,t))}}else{var l=Z(n.done);if(!l||!l.ranges){Na(e.sel,n.done)}s={changes:[Sa(e,t)],generation:n.generation};n.done.push(s);while(n.done.length>n.undoDepth){n.done.shift();if(!n.done[0].ranges){n.done.shift()}}}n.done.push(r);n.generation=++n.maxGeneration;n.lastModTime=n.lastSelTime=a;n.lastOp=n.lastSelOp=i;n.lastOrigin=n.lastSelOrigin=t.origin;if(!o){be(e,"historyAdded")}}function Ea(e,t,r,i){var n=t.charAt(0);return n=="*"||n=="+"&&r.ranges.length==i.ranges.length&&r.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ma(e,t,r,i){var n=e.history,a=i&&i.origin;if(r==n.lastSelOp||a&&n.lastSelOrigin==a&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==a||Ea(e,a,Z(n.done),t))){n.done[n.done.length-1]=t}else{Na(t,n.done)}n.lastSelTime=+new Date;n.lastSelOrigin=a;n.lastSelOp=r;if(i&&i.clearRedo!==false){La(n.undone)}}function Na(e,t){var r=Z(t);if(!(r&&r.ranges&&r.equals(e))){t.push(e)}}function _a(e,t,r,i){var n=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,i),function(r){if(r.markedSpans){(n||(n=t["spans_"+e.id]={}))[a]=r.markedSpans}++a})}function Pa(e){if(!e){return null}var t;for(var r=0;r<e.length;++r){if(e[r].marker.explicitlyCleared){if(!t){t=e.slice(0,r)}}else if(t){t.push(e[r])}}return!t?e:t.length?t:null}function Ia(e,t){var r=t["spans_"+e.id];if(!r){return null}var i=[];for(var n=0;n<t.text.length;++n){i.push(Pa(r[n]))}return i}function Oa(e,t){var r=Ia(e,t);var i=Bt(e,t);if(!r){return i}if(!i){return r}for(var n=0;n<r.length;++n){var a=r[n],s=i[n];if(a&&s){e:for(var o=0;o<s.length;++o){var l=s[o];for(var u=0;u<a.length;++u){if(a[u].marker==l.marker){continue e}}a.push(l)}}else if(s){r[n]=s}}return r}function Da(e,t,r){var i=[];for(var n=0;n<e.length;++n){var a=e[n];if(a.ranges){i.push(r?sa.prototype.deepCopy.call(a):a);continue}var s=a.changes,o=[];i.push({changes:o});for(var l=0;l<s.length;++l){var u=s[l],c=void 0;o.push({from:u.from,to:u.to,text:u.text});if(t){for(var f in u){if(c=f.match(/^spans_(\d+)$/)){if(j(t,Number(c[1]))>-1){Z(o)[f]=u[f];delete u[f]}}}}}}return i}function Ra(e,t,r,i){if(i){var n=e.anchor;if(r){var a=lt(t,n)<0;if(a!=lt(r,n)<0){n=t;t=r}else if(a!=lt(t,r)<0){t=r}}return new oa(n,t)}else{return new oa(r||t,t)}}function Va(e,t,r,i,n){if(n==null){n=e.cm&&(e.cm.display.shift||e.extend)}ja(e,new sa([Ra(e.sel.primary(),t,r,n)],0),i)}function Fa(e,t,r){var i=[];var n=e.cm&&(e.cm.display.shift||e.extend);for(var a=0;a<e.sel.ranges.length;a++){i[a]=Ra(e.sel.ranges[a],t[a],null,n)}var s=la(e.cm,i,e.sel.primIndex);ja(e,s,r)}function za(e,t,r,i){var n=e.sel.ranges.slice(0);n[t]=r;ja(e,la(e.cm,n,e.sel.primIndex),i)}function Wa(e,t,r,i){ja(e,ua(t,r),i)}function Ba(e,t,r){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++){this.ranges[r]=new oa(dt(e,t[r].anchor),dt(e,t[r].head))}},origin:r&&r.origin};be(e,"beforeSelectionChange",e,i);if(e.cm){be(e.cm,"beforeSelectionChange",e.cm,i)}if(i.ranges!=t.ranges){return la(e.cm,i.ranges,i.ranges.length-1)}else{return t}}function Ha(e,t,r){var i=e.history.done,n=Z(i);if(n&&n.ranges){i[i.length-1]=t;Ua(e,t,r)}else{ja(e,t,r)}}function ja(e,t,r){Ua(e,t,r);Ma(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Ua(e,t,r){if(Ce(e,"beforeSelectionChange")||e.cm&&Ce(e.cm,"beforeSelectionChange")){t=Ba(e,t,r)}var i=r&&r.bias||(lt(t.primary().head,e.sel.primary().head)<0?-1:1);Ga(e,Ka(e,t,i,true));if(!(r&&r.scroll===false)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"){un(e.cm)}}function Ga(e,t){if(t.equals(e.sel)){return}e.sel=t;if(e.cm){e.cm.curOp.updateInput=1;e.cm.curOp.selectionChanged=true;ke(e.cm)}Nr(e,"cursorActivity",e)}function qa(e){Ga(e,Ka(e,e.sel,null,false))}function Ka(e,t,r,i){var n;for(var a=0;a<t.ranges.length;a++){var s=t.ranges[a];var o=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a];var l=Xa(e,s.anchor,o&&o.anchor,r,i);var u=s.head==s.anchor?l:Xa(e,s.head,o&&o.head,r,i);if(n||l!=s.anchor||u!=s.head){if(!n){n=t.ranges.slice(0,a)}n[a]=new oa(l,u)}}return n?la(e.cm,n,t.primIndex):t}function $a(e,t,r,i,n){var a=Je(e,t.line);if(a.markedSpans){for(var s=0;s<a.markedSpans.length;++s){var o=a.markedSpans[s],l=o.marker;var u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft;var c="selectRight"in l?!l.selectRight:l.inclusiveRight;if((o.from==null||(u?o.from<=t.ch:o.from<t.ch))&&(o.to==null||(c?o.to>=t.ch:o.to>t.ch))){if(n){be(l,"beforeCursorEnter");if(l.explicitlyCleared){if(!a.markedSpans){break}else{--s;continue}}}if(!l.atomic){continue}if(r){var f=l.find(i<0?1:-1),h=void 0;if(i<0?c:u){f=Ya(e,f,-i,f&&f.line==t.line?a:null)}if(f&&f.line==t.line&&(h=lt(f,r))&&(i<0?h<0:h>0)){return $a(e,f,t,i,n)}}var p=l.find(i<0?-1:1);if(i<0?u:c){p=Ya(e,p,i,p.line==t.line?a:null)}return p?$a(e,p,t,i,n):null}}}return t}function Xa(e,t,r,i,n){var a=i||1;var s=$a(e,t,r,a,n)||!n&&$a(e,t,r,a,true)||$a(e,t,r,-a,n)||!n&&$a(e,t,r,-a,true);if(!s){e.cantEdit=true;return ot(e.first,0)}return s}function Ya(e,t,r,i){if(r<0&&t.ch==0){if(t.line>e.first){return dt(e,ot(t.line-1))}else{return null}}else if(r>0&&t.ch==(i||Je(e,t.line)).text.length){if(t.line<e.first+e.size-1){return ot(t.line+1,0)}else{return null}}else{return new ot(t.line,t.ch+r)}}function Qa(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),q)}function Za(e,t,r){var i={canceled:false,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=true}};if(r){i.update=function(t,r,n,a){if(t){i.from=dt(e,t)}if(r){i.to=dt(e,r)}if(n){i.text=n}if(a!==undefined){i.origin=a}}}be(e,"beforeChange",e,i);if(e.cm){be(e.cm,"beforeChange",e.cm,i)}if(i.canceled){if(e.cm){e.cm.curOp.updateInput=2}return null}return{from:i.from,to:i.to,text:i.text,origin:i.origin}}function Ja(e,t,r){if(e.cm){if(!e.cm.curOp){return On(e.cm,Ja)(e,t,r)}if(e.cm.state.suppressEdits){return}}if(Ce(e,"beforeChange")||e.cm&&Ce(e.cm,"beforeChange")){t=Za(e,t,true);if(!t){return}}var i=_t&&!r&&jt(e,t.from,t.to);if(i){for(var n=i.length-1;n>=0;--n){es(e,{from:i[n].from,to:i[n].to,text:n?[""]:t.text,origin:t.origin})}}else{es(e,t)}}function es(e,t){if(t.text.length==1&&t.text[0]==""&&lt(t.from,t.to)==0){return}var r=ha(e,t);Aa(e,t,r,e.cm?e.cm.curOp.id:NaN);is(e,t,r,Bt(e,t));var i=[];xa(e,function(e,r){if(!r&&j(i,e.history)==-1){ls(e.history,t);i.push(e.history)}is(e,t,null,Bt(e,t))})}function ts(e,t,r){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!r){return}var n=e.history,a,s=e.sel;var o=t=="undo"?n.done:n.undone,l=t=="undo"?n.undone:n.done;var u=0;for(;u<o.length;u++){a=o[u];if(r?a.ranges&&!a.equals(e.sel):!a.ranges){break}}if(u==o.length){return}n.lastOrigin=n.lastSelOrigin=null;for(;;){a=o.pop();if(a.ranges){Na(a,l);if(r&&!a.equals(e.sel)){ja(e,a,{clearRedo:false});return}s=a}else if(i){o.push(a);return}else{break}}var c=[];Na(s,l);l.push({changes:c,generation:n.generation});n.generation=a.generation||++n.maxGeneration;var f=Ce(e,"beforeChange")||e.cm&&Ce(e.cm,"beforeChange");var h=function(r){var i=a.changes[r];i.origin=t;if(f&&!Za(e,i,false)){o.length=0;return{}}c.push(Sa(e,i));var n=r?ha(e,i):Z(o);is(e,i,n,Oa(e,i));if(!r&&e.cm){e.cm.scrollIntoView({from:i.from,to:ca(i)})}var s=[];xa(e,function(e,t){if(!t&&j(s,e.history)==-1){ls(e.history,i);s.push(e.history)}is(e,i,null,Oa(e,i))})};for(var p=a.changes.length-1;p>=0;--p){var d=h(p);if(d)return d.v}}function rs(e,t){if(t==0){return}e.first+=t;e.sel=new sa(J(e.sel.ranges,function(e){return new oa(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))}),e.sel.primIndex);if(e.cm){Fi(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,i=r.viewFrom;i<r.viewTo;i++){zi(e.cm,i,"gutter")}}}function is(e,t,r,i){if(e.cm&&!e.cm.curOp){return On(e.cm,is)(e,t,r,i)}if(t.to.line<e.first){rs(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine()){return}if(t.from.line<e.first){var n=t.text.length-1-(e.first-t.from.line);rs(e,n);t={from:ot(e.first,0),to:ot(t.to.line+n,t.to.ch),text:[Z(t.text)],origin:t.origin}}var a=e.lastLine();if(t.to.line>a){t={from:t.from,to:ot(a,Je(e,a).text.length),text:[t.text[0]],origin:t.origin}}t.removed=et(e,t.from,t.to);if(!r){r=ha(e,t)}if(e.cm){ns(e.cm,t,i)}else{ya(e,t,i)}Ua(e,r,q);if(e.cantEdit&&Xa(e,ot(e.firstLine(),0))){e.cantEdit=false}}function ns(e,t,r){var i=e.doc,n=e.display,a=t.from,s=t.to;var o=false,l=a.line;if(!e.options.lineWrapping){l=it(er(Je(i,a.line)));i.iter(l,s.line+1,function(e){if(e==n.maxLine){o=true;return true}})}
if(i.sel.contains(t.from,t.to)>-1){ke(e)}ya(i,t,r,Oi(e));if(!e.options.lineWrapping){i.iter(l,a.line+t.text.length,function(e){var t=lr(e);if(t>n.maxLineLength){n.maxLine=e;n.maxLineLength=t;n.maxLineChanged=true;o=false}});if(o){e.curOp.updateMaxLine=true}}Nt(i,a.line);Vn(e,400);var u=t.text.length-(s.line-a.line)-1;if(t.full){Fi(e)}else if(a.line==s.line&&t.text.length==1&&!ga(e.doc,t)){zi(e,a.line,"text")}else{Fi(e,a.line,s.line+1,u)}var c=Ce(e,"changes"),f=Ce(e,"change");if(f||c){var h={from:a,to:s,text:t.text,removed:t.removed,origin:t.origin};if(f){Nr(e,"change",e,h)}if(c){(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}}e.display.selForContextMenu=null}function as(e,t,r,i,n){var a;if(!i){i=r}if(lt(i,r)<0){a=[i,r],r=a[0],i=a[1]}if(typeof t=="string"){t=e.splitLines(t)}Ja(e,{from:r,to:i,text:t,origin:n})}function ss(e,t,r,i){if(r<e.line){e.line+=i}else if(t<e.line){e.line=t;e.ch=0}}function os(e,t,r,i){for(var n=0;n<e.length;++n){var a=e[n],s=true;if(a.ranges){if(!a.copied){a=e[n]=a.deepCopy();a.copied=true}for(var o=0;o<a.ranges.length;o++){ss(a.ranges[o].anchor,t,r,i);ss(a.ranges[o].head,t,r,i)}continue}for(var l=0;l<a.changes.length;++l){var u=a.changes[l];if(r<u.from.line){u.from=ot(u.from.line+i,u.from.ch);u.to=ot(u.to.line+i,u.to.ch)}else if(t<=u.to.line){s=false;break}}if(!s){e.splice(0,n+1);n=0}}}function ls(e,t){var r=t.from.line,i=t.to.line,n=t.text.length-(i-r)-1;os(e.done,r,i,n);os(e.undone,r,i,n)}function us(e,t,r,i){var n=t,a=t;if(typeof t=="number"){a=Je(e,pt(e,t))}else{n=it(t)}if(n==null){return null}if(i(a,n)&&e.cm){zi(e.cm,n,r)}return a}function cs(e){this.lines=e;this.parent=null;var t=0;for(var r=0;r<e.length;++r){e[r].parent=this;t+=e[r].height}this.height=t}cs.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,i=e+t;r<i;++r){var n=this.lines[r];this.height-=n.height;hr(n);Nr(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r;this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i){t[i].parent=this}},iterN:function(e,t,r){for(var i=e+t;e<i;++e){if(r(this.lines[e])){return true}}}};function fs(e){this.children=e;var t=0,r=0;for(var i=0;i<e.length;++i){var n=e[i];t+=n.chunkSize();r+=n.height;n.parent=this}this.size=t;this.height=r;this.parent=null}fs.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],n=i.chunkSize();if(e<n){var a=Math.min(t,n-e),s=i.height;i.removeInner(e,a);this.height-=s-i.height;if(n==a){this.children.splice(r--,1);i.parent=null}if((t-=a)==0){break}e=0}else{e-=n}}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof cs))){var o=[];this.collapse(o);this.children=[new cs(o)];this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t){this.children[t].collapse(e)}},insertInner:function(e,t,r){this.size+=t.length;this.height+=r;for(var i=0;i<this.children.length;++i){var n=this.children[i],a=n.chunkSize();if(e<=a){n.insertInner(e,t,r);if(n.lines&&n.lines.length>50){var s=n.lines.length%25+25;for(var o=s;o<n.lines.length;){var l=new cs(n.lines.slice(o,o+=25));n.height-=l.height;this.children.splice(++i,0,l);l.parent=this}n.lines=n.lines.slice(0,s);this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(this.children.length<=10){return}var e=this;do{var t=e.children.splice(e.children.length-5,5);var r=new fs(t);if(!e.parent){var i=new fs(e.children);i.parent=e;e.children=[i,r];e=i}else{e.size-=r.size;e.height-=r.height;var n=j(e.parent.children,e);e.parent.children.splice(n+1,0,r)}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var i=0;i<this.children.length;++i){var n=this.children[i],a=n.chunkSize();if(e<a){var s=Math.min(t,a-e);if(n.iterN(e,s,r)){return true}if((t-=s)==0){break}e=0}else{e-=a}}}};var hs=function(e,t,r){if(r){for(var i in r){if(r.hasOwnProperty(i)){this[i]=r[i]}}}this.doc=e;this.node=t};hs.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,i=it(r);if(i==null||!t){return}for(var n=0;n<t.length;++n){if(t[n]==this){t.splice(n--,1)}}if(!t.length){r.widgets=null}var a=Ur(this);rt(r,Math.max(0,r.height-a));if(e){In(e,function(){ps(e,r,-a);zi(e,i,"widget")});Nr(e,"lineWidgetCleared",e,this,i)}};hs.prototype.changed=function(){var e=this;var t=this.height,r=this.doc.cm,i=this.line;this.height=null;var n=Ur(this)-t;if(!n){return}if(!ar(this.doc,i)){rt(i,i.height+n)}if(r){In(r,function(){r.curOp.forceUpdate=true;ps(r,i,n);Nr(r,"lineWidgetChanged",r,e,it(i))})}};Se(hs);function ps(e,t,r){if(or(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)){ln(e,r)}}function ds(e,t,r,i){var n=new hs(e,r,i);var a=e.cm;if(a&&n.noHScroll){a.display.alignWidgets=true}us(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(n.insertAt==null){r.push(n)}else{r.splice(Math.min(r.length,Math.max(0,n.insertAt)),0,n)}n.line=t;if(a&&!ar(e,t)){var i=or(t)<e.scrollTop;rt(t,t.height+Ur(n));if(i){ln(a,n.height)}a.curOp.forceUpdate=true}return true});if(a){Nr(a,"lineWidgetAdded",a,n,typeof t=="number"?t:it(t))}return n}var ms=0;var vs=function(e,t){this.lines=[];this.type=t;this.doc=e;this.id=++ms};vs.prototype.clear=function(){if(this.explicitlyCleared){return}var e=this.doc.cm,t=e&&!e.curOp;if(t){Ln(e)}if(Ce(this,"clear")){var r=this.find();if(r){Nr(this,"clear",r.from,r.to)}}var i=null,n=null;for(var a=0;a<this.lines.length;++a){var s=this.lines[a];var o=Rt(s.markedSpans,this);if(e&&!this.collapsed){zi(e,it(s),"text")}else if(e){if(o.to!=null){n=it(s)}if(o.from!=null){i=it(s)}}s.markedSpans=Vt(s.markedSpans,o);if(o.from==null&&this.collapsed&&!ar(this.doc,s)&&e){rt(s,Ni(e.display))}}if(e&&this.collapsed&&!e.options.lineWrapping){for(var l=0;l<this.lines.length;++l){var u=er(this.lines[l]),c=lr(u);if(c>e.display.maxLineLength){e.display.maxLine=u;e.display.maxLineLength=c;e.display.maxLineChanged=true}}}if(i!=null&&e&&this.collapsed){Fi(e,i,n+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(e){qa(e.doc)}}if(e){Nr(e,"markerCleared",e,this,i,n)}if(t){Tn(e)}if(this.parent){this.parent.clear()}};vs.prototype.find=function(e,t){if(e==null&&this.type=="bookmark"){e=1}var r,i;for(var n=0;n<this.lines.length;++n){var a=this.lines[n];var s=Rt(a.markedSpans,this);if(s.from!=null){r=ot(t?a:it(a),s.from);if(e==-1){return r}}if(s.to!=null){i=ot(t?a:it(a),s.to);if(e==1){return i}}}return r&&{from:r,to:i}};vs.prototype.changed=function(){var e=this;var t=this.find(-1,true),r=this,i=this.doc.cm;if(!t||!i){return}In(i,function(){var n=t.line,a=it(t.line);var s=ri(i,a);if(s){ci(s);i.curOp.selectionChanged=i.curOp.forceUpdate=true}i.curOp.updateMaxLine=true;if(!ar(r.doc,n)&&r.height!=null){var o=r.height;r.height=null;var l=Ur(r)-o;if(l){rt(n,n.height+l)}}Nr(i,"markerChanged",i,e)})};vs.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;if(!t.maybeHiddenMarkers||j(t.maybeHiddenMarkers,this)==-1){(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(e)};vs.prototype.detachLine=function(e){this.lines.splice(j(this.lines,e),1);if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};Se(vs);function gs(e,t,r,i,n){if(i&&i.shared){return xs(e,t,r,i,n)}if(e.cm&&!e.cm.curOp){return On(e.cm,gs)(e,t,r,i,n)}var a=new vs(e,n),s=lt(t,r);if(i){W(i,a,false)}if(s>0||s==0&&a.clearWhenEmpty!==false){return a}if(a.replacedWith){a.collapsed=true;a.widgetNode=N("span",[a.replacedWith],"CodeMirror-widget");if(!i.handleMouseEvents){a.widgetNode.setAttribute("cm-ignore-events","true")}if(i.insertLeft){a.widgetNode.insertLeft=true}}if(a.collapsed){if(Jt(e,t.line,t,r,a)||t.line!=r.line&&Jt(e,r.line,t,r,a)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}Ot()}if(a.addToHistory){Aa(e,{from:t,to:r,origin:"markText"},e.sel,NaN)}var o=t.line,l=e.cm,u;e.iter(o,r.line+1,function(i){if(l&&a.collapsed&&!l.options.lineWrapping&&er(i)==l.display.maxLine){u=true}if(a.collapsed&&o!=t.line){rt(i,0)}Ft(i,new Dt(a,o==t.line?t.ch:null,o==r.line?r.ch:null),e.cm&&e.cm.curOp);++o});if(a.collapsed){e.iter(t.line,r.line+1,function(t){if(ar(e,t)){rt(t,0)}})}if(a.clearOnEnter){ge(a,"beforeCursorEnter",function(){return a.clear()})}if(a.readOnly){It();if(e.history.done.length||e.history.undone.length){e.clearHistory()}}if(a.collapsed){a.id=++ms;a.atomic=true}if(l){if(u){l.curOp.updateMaxLine=true}if(a.collapsed){Fi(l,t.line,r.line+1)}else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title){for(var c=t.line;c<=r.line;c++){zi(l,c,"text")}}if(a.atomic){qa(l.doc)}Nr(l,"markerAdded",l,a)}return a}var ys=function(e,t){this.markers=e;this.primary=t;for(var r=0;r<e.length;++r){e[r].parent=this}};ys.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var e=0;e<this.markers.length;++e){this.markers[e].clear()}Nr(this,"clear")};ys.prototype.find=function(e,t){return this.primary.find(e,t)};Se(ys);function xs(e,t,r,i,n){i=W(i);i.shared=false;var a=[gs(e,t,r,i,n)],s=a[0];var o=i.widgetNode;xa(e,function(e){if(o){i.widgetNode=o.cloneNode(true)}a.push(gs(e,dt(e,t),dt(e,r),i,n));for(var l=0;l<e.linked.length;++l){if(e.linked[l].isParent){return}}s=Z(a)});return new ys(a,s)}function bs(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),function(e){return e.parent})}function ws(e,t){for(var r=0;r<t.length;r++){var i=t[r],n=i.find();var a=e.clipPos(n.from),s=e.clipPos(n.to);if(lt(a,s)){var o=gs(e,a,s,i.primary,i.primary.type);i.markers.push(o);o.parent=i}}}function ks(e){var t=function(t){var r=e[t],i=[r.primary.doc];xa(r.primary.doc,function(e){return i.push(e)});for(var n=0;n<r.markers.length;n++){var a=r.markers[n];if(j(i,a.doc)==-1){a.parent=null;r.markers.splice(n--,1)}}};for(var r=0;r<e.length;r++)t(r)}var Cs=0;var Ss=function(e,t,r,i,n){if(!(this instanceof Ss)){return new Ss(e,t,r,i,n)}if(r==null){r=0}fs.call(this,[new cs([new cr("",null)])]);this.first=r;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=r;var a=ot(r,0);this.sel=ua(a);this.history=new Ca(null);this.id=++Cs;this.modeOption=t;this.lineSep=i;this.direction=n=="rtl"?"rtl":"ltr";this.extend=false;if(typeof e=="string"){e=this.splitLines(e)}ya(this,{from:a,to:a,text:e});ja(this,ua(a),q)};Ss.prototype=re(fs.prototype,{constructor:Ss,iter:function(e,t,r){if(r){this.iterN(e-this.first,t-e,r)}else{this.iterN(this.first,this.first+this.size,e)}},insert:function(e,t){var r=0;for(var i=0;i<t.length;++i){r+=t[i].height}this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=tt(this,this.first,this.first+this.size);if(e===false){return t}return t.join(e||this.lineSeparator())},setValue:Rn(function(e){var t=ot(this.first,0),r=this.first+this.size-1;Ja(this,{from:t,to:ot(r,Je(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:true},true);if(this.cm){cn(this.cm,0,0)}ja(this,ua(t),q)}),replaceRange:function(e,t,r,i){t=dt(this,t);r=r?dt(this,r):t;as(this,e,t,r,i)},getRange:function(e,t,r){var i=et(this,dt(this,e),dt(this,t));if(r===false){return i}if(r===""){return i.join("")}return i.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(at(this,e)){return Je(this,e)}},getLineNumber:function(e){return it(e)},getLineHandleVisualStart:function(e){if(typeof e=="number"){e=Je(this,e)}return er(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return dt(this,e)},getCursor:function(e){var t=this.sel.primary(),r;if(e==null||e=="head"){r=t.head}else if(e=="anchor"){r=t.anchor}else if(e=="end"||e=="to"||e===false){r=t.to()}else{r=t.from()}return r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Rn(function(e,t,r){Wa(this,dt(this,typeof e=="number"?ot(e,t||0):e),null,r)}),setSelection:Rn(function(e,t,r){Wa(this,dt(this,e),dt(this,t||e),r)}),extendSelection:Rn(function(e,t,r){Va(this,dt(this,e),t&&dt(this,t),r)}),extendSelections:Rn(function(e,t){Fa(this,vt(this,e),t)}),extendSelectionsBy:Rn(function(e,t){var r=J(this.sel.ranges,e);Fa(this,vt(this,r),t)}),setSelections:Rn(function(e,t,r){if(!e.length){return}var i=[];for(var n=0;n<e.length;n++){i[n]=new oa(dt(this,e[n].anchor),dt(this,e[n].head||e[n].anchor))}if(t==null){t=Math.min(e.length-1,this.sel.primIndex)}ja(this,la(this.cm,i,t),r)}),addSelection:Rn(function(e,t,r){var i=this.sel.ranges.slice(0);i.push(new oa(dt(this,e),dt(this,t||e)));ja(this,la(this.cm,i,i.length-1),r)}),getSelection:function(e){var t=this.sel.ranges,r;for(var i=0;i<t.length;i++){var n=et(this,t[i].from(),t[i].to());r=r?r.concat(n):n}if(e===false){return r}else{return r.join(e||this.lineSeparator())}},getSelections:function(e){var t=[],r=this.sel.ranges;for(var i=0;i<r.length;i++){var n=et(this,r[i].from(),r[i].to());if(e!==false){n=n.join(e||this.lineSeparator())}t[i]=n}return t},replaceSelection:function(e,t,r){var i=[];for(var n=0;n<this.sel.ranges.length;n++){i[n]=e}this.replaceSelections(i,t,r||"+input")},replaceSelections:Rn(function(e,t,r){var i=[],n=this.sel;for(var a=0;a<n.ranges.length;a++){var s=n.ranges[a];i[a]={from:s.from(),to:s.to(),text:this.splitLines(e[a]),origin:r}}var o=t&&t!="end"&&da(this,i,t);for(var l=i.length-1;l>=0;l--){Ja(this,i[l])}if(o){Ha(this,o)}else if(this.cm){un(this.cm)}}),undo:Rn(function(){ts(this,"undo")}),redo:Rn(function(){ts(this,"redo")}),undoSelection:Rn(function(){ts(this,"undo",true)}),redoSelection:Rn(function(){ts(this,"redo",true)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){var e=this.history,t=0,r=0;for(var i=0;i<e.done.length;i++){if(!e.done[i].ranges){++t}}for(var n=0;n<e.undone.length;n++){if(!e.undone[n].ranges){++r}}return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Ca(this.history);xa(this,function(t){return t.history=e.history},true)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(e){if(e){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Da(this.history.done),undone:Da(this.history.undone)}},setHistory:function(e){var t=this.history=new Ca(this.history);t.done=Da(e.done.slice(0),null,true);t.undone=Da(e.undone.slice(0),null,true)},setGutterMarker:Rn(function(e,t,r){return us(this,e,"gutter",function(e){var i=e.gutterMarkers||(e.gutterMarkers={});i[t]=r;if(!r&&se(i)){e.gutterMarkers=null}return true})}),clearGutter:Rn(function(e){var t=this;this.iter(function(r){if(r.gutterMarkers&&r.gutterMarkers[e]){us(t,r,"gutter",function(){r.gutterMarkers[e]=null;if(se(r.gutterMarkers)){r.gutterMarkers=null}return true})}})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!at(this,e)){return null}t=e;e=Je(this,e);if(!e){return null}}else{t=it(e);if(t==null){return null}}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Rn(function(e,t,r){return us(this,e,t=="gutter"?"gutter":"class",function(e){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!e[i]){e[i]=r}else if(L(r).test(e[i])){return false}else{e[i]+=" "+r}return true})}),removeLineClass:Rn(function(e,t,r){return us(this,e,t=="gutter"?"gutter":"class",function(e){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";var n=e[i];if(!n){return false}else if(r==null){e[i]=null}else{var a=n.match(L(r));if(!a){return false}var s=a.index+a[0].length;e[i]=n.slice(0,a.index)+(!a.index||s==n.length?"":" ")+n.slice(s)||null}return true})}),addLineWidget:Rn(function(e,t,r){return ds(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return gs(this,dt(this,e),dt(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:false,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};e=dt(this,e);return gs(this,e,e,r,"bookmark")},findMarksAt:function(e){e=dt(this,e);var t=[],r=Je(this,e.line).markedSpans;if(r){for(var i=0;i<r.length;++i){var n=r[i];if((n.from==null||n.from<=e.ch)&&(n.to==null||n.to>=e.ch)){t.push(n.marker.parent||n.marker)}}}return t},findMarks:function(e,t,r){e=dt(this,e);t=dt(this,t);var i=[],n=e.line;this.iter(e.line,t.line+1,function(a){var s=a.markedSpans;if(s){for(var o=0;o<s.length;o++){var l=s[o];if(!(l.to!=null&&n==e.line&&e.ch>=l.to||l.from==null&&n!=e.line||l.from!=null&&n==t.line&&l.from>=t.ch)&&(!r||r(l.marker))){i.push(l.marker.parent||l.marker)}}}++n});return i},getAllMarks:function(){var e=[];this.iter(function(t){var r=t.markedSpans;if(r){for(var i=0;i<r.length;++i){if(r[i].from!=null){e.push(r[i].marker)}}}});return e},posFromIndex:function(e){var t,r=this.first,i=this.lineSeparator().length;this.iter(function(n){var a=n.text.length+i;if(a>e){t=e;return true}e-=a;++r});return dt(this,ot(r,t))},indexFromPos:function(e){e=dt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0){return 0}var r=this.lineSeparator().length;this.iter(this.first,e.line,function(e){t+=e.text.length+r});return t},copy:function(e){var t=new Ss(tt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);t.scrollTop=this.scrollTop;t.scrollLeft=this.scrollLeft;t.sel=this.sel;t.extend=false;if(e){t.history.undoDepth=this.history.undoDepth;t.setHistory(this.getHistory())}return t},linkedDoc:function(e){if(!e){e={}}var t=this.first,r=this.first+this.size;if(e.from!=null&&e.from>t){t=e.from}if(e.to!=null&&e.to<r){r=e.to}var i=new Ss(tt(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);if(e.sharedHist){i.history=this.history}(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist});i.linked=[{doc:this,isParent:true,sharedHist:e.sharedHist}];ws(i,bs(this));return i},unlinkDoc:function(e){if(e instanceof zo){e=e.doc}if(this.linked){for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e){continue}this.linked.splice(t,1);e.unlinkDoc(this);ks(bs(this));break}}if(e.history==this.history){var i=[e.id];xa(e,function(e){return i.push(e.id)},true);e.history=new Ca(null);e.history.done=Da(this.history.done,i);e.history.undone=Da(this.history.undone,i)}},iterLinkedDocs:function(e){xa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){if(this.lineSep){return e.split(this.lineSep)}return Re(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Rn(function(e){if(e!="rtl"){e="ltr"}if(e==this.direction){return}this.direction=e;this.iter(function(e){return e.order=null});if(this.cm){ka(this.cm)}})});Ss.prototype.eachLine=Ss.prototype.iter;var Ls=0;function Ts(e){var t=this;Ms(t);if(we(t,e)||Gr(t.display,e)){return}Le(e);if(s){Ls=+new Date}var r=Ri(t,e,true),i=e.dataTransfer.files;if(!r||t.isReadOnly()){return}if(i&&i.length&&window.FileReader&&window.File){var n=i.length,a=Array(n),o=0;var l=function(){if(++o==n){On(t,function(){r=dt(t.doc,r);var e={from:r,to:r,text:t.doc.splitLines(a.filter(function(e){return e!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ja(t.doc,e);Ha(t.doc,ua(dt(t.doc,r),dt(t.doc,ca(e))))})()}};var u=function(e,r){if(t.options.allowDropFileTypes&&j(t.options.allowDropFileTypes,e.type)==-1){l();return}var i=new FileReader;i.onerror=function(){return l()};i.onload=function(){var e=i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)){l();return}a[r]=e;l()};i.readAsText(e)};for(var c=0;c<i.length;c++){u(i[c],c)}}else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e);setTimeout(function(){return t.display.input.focus()},20);return}try{var f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy){h=t.listSelections()}Ua(t.doc,ua(r,r));if(h){for(var p=0;p<h.length;++p){as(t.doc,"",h[p].anchor,h[p].head,"drag")}}t.replaceSelection(f,"around","paste");t.display.input.focus()}}catch(e){}}}function As(e,t){if(s&&(!e.state.draggingText||+new Date-Ls<100)){Ee(t);return}if(we(e,t)||Gr(e.display,t)){return}t.dataTransfer.setData("Text",e.getSelection());t.dataTransfer.effectAllowed="copyMove";if(t.dataTransfer.setDragImage&&!p){var r=M("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(h){r.width=r.height=1;e.display.wrapper.appendChild(r);r._top=r.offsetTop}t.dataTransfer.setDragImage(r,0,0);if(h){r.parentNode.removeChild(r)}}}function Es(e,t){var r=Ri(e,t);if(!r){return}var i=document.createDocumentFragment();qi(e,r,i);if(!e.display.dragCursor){e.display.dragCursor=M("div",null,"CodeMirror-cursors CodeMirror-dragcursors");e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)}E(e.display.dragCursor,i)}function Ms(e){if(e.display.dragCursor){e.display.lineSpace.removeChild(e.display.dragCursor);e.display.dragCursor=null}}function Ns(e){if(!document.getElementsByClassName){return}var t=document.getElementsByClassName("CodeMirror"),r=[];for(var i=0;i<t.length;i++){var n=t[i].CodeMirror;if(n){r.push(n)}}if(r.length){r[0].operation(function(){for(var t=0;t<r.length;t++){e(r[t])}})}}var _s=false;function Ps(){if(_s){return}Is();_s=true}function Is(){var e;ge(window,"resize",function(){if(e==null){e=setTimeout(function(){e=null;Ns(Os)},100)}});ge(window,"blur",function(){return Ns(Ji)})}function Os(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null;t.scrollbarsClipped=false;e.setSize()}var Ds={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var Rs=0;Rs<10;Rs++){Ds[Rs+48]=Ds[Rs+96]=String(Rs)}for(var Vs=65;Vs<=90;Vs++){Ds[Vs]=String.fromCharCode(Vs)}for(var Fs=1;Fs<=12;Fs++){Ds[Fs+111]=Ds[Fs+63235]="F"+Fs}var zs={};zs.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"};zs.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"};zs.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};zs.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"]};zs["default"]=x?zs.macDefault:zs.pcDefault;function Ws(e){var t=e.split(/-(?!$)/);e=t[t.length-1];var r,i,n,a;for(var s=0;s<t.length-1;s++){var o=t[s];if(/^(cmd|meta|m)$/i.test(o)){a=true}else if(/^a(lt)?$/i.test(o)){r=true}else if(/^(c|ctrl|control)$/i.test(o)){i=true}else if(/^s(hift)?$/i.test(o)){n=true}else{throw new Error("Unrecognized modifier name: "+o)}}if(r){e="Alt-"+e}if(i){e="Ctrl-"+e}if(a){e="Cmd-"+e}if(n){e="Shift-"+e}return e}function Bs(e){var t={};for(var r in e){if(e.hasOwnProperty(r)){var i=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r)){continue}if(i=="..."){delete e[r];continue}var n=J(r.split(" "),Ws);for(var a=0;a<n.length;a++){var s=void 0,o=void 0;if(a==n.length-1){o=n.join(" ");s=i}else{o=n.slice(0,a+1).join(" ");s="..."}var l=t[o];if(!l){t[o]=s}else if(l!=s){throw new Error("Inconsistent bindings for "+o)}}delete e[r]}}for(var u in t){e[u]=t[u]}return e}function Hs(e,t,r,i){t=qs(t);var n=t.call?t.call(e,i):t[e];if(n===false){return"nothing"}if(n==="..."){return"multi"}if(n!=null&&r(n)){return"handled"}if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]"){return Hs(e,t.fallthrough,r,i)}for(var a=0;a<t.fallthrough.length;a++){var s=Hs(e,t.fallthrough[a],r,i);if(s){return s}}}}function js(e){var t=typeof e=="string"?e:Ds[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Us(e,t,r){var i=e;if(t.altKey&&i!="Alt"){e="Alt-"+e}if((C?t.metaKey:t.ctrlKey)&&i!="Ctrl"){e="Ctrl-"+e}if((C?t.ctrlKey:t.metaKey)&&i!="Mod"){e="Cmd-"+e}if(!r&&t.shiftKey&&i!="Shift"){e="Shift-"+e}return e}function Gs(e,t){if(h&&e.keyCode==34&&e["char"]){return false}var r=Ds[e.keyCode];if(r==null||e.altGraphKey){return false}if(e.keyCode==3&&e.code){r=e.code}return Us(r,e,t)}function qs(e){return typeof e=="string"?zs[e]:e}function Ks(e,t){var r=e.doc.sel.ranges,i=[];for(var n=0;n<r.length;n++){var a=t(r[n]);while(i.length&&lt(a.from,Z(i).to)<=0){var s=i.pop();if(lt(s.from,a.from)<0){a.from=s.from;break}}i.push(a)}In(e,function(){for(var t=i.length-1;t>=0;t--){as(e.doc,"",i[t].from,i[t].to,"+delete")}un(e)})}function $s(e,t,r){var i=ue(e.text,t+r,r);return i<0||i>e.text.length?null:i}function Xs(e,t,r){var i=$s(e,t.ch,r);return i==null?null:new ot(t.line,i,r<0?"after":"before")}function Ys(e,t,r,i,n){if(e){if(t.doc.direction=="rtl"){n=-n}var a=me(r,t.doc.direction);if(a){var s=n<0?Z(a):a[0];var o=n<0==(s.level==1);var l=o?"after":"before";var u;if(s.level>0||t.doc.direction=="rtl"){var c=ii(t,r);u=n<0?r.text.length-1:0;var f=ni(t,c,u).top;u=ce(function(e){return ni(t,c,e).top==f},n<0==(s.level==1)?s.from:s.to-1,u);if(l=="before"){u=$s(r,u,1)}}else{u=n<0?s.to:s.from}return new ot(i,u,l)}}return new ot(i,n<0?r.text.length:0,n<0?"before":"after")}function Qs(e,t,r,i){var n=me(t,e.doc.direction);if(!n){return Xs(t,r,i)}if(r.ch>=t.text.length){r.ch=t.text.length;r.sticky="before"}else if(r.ch<=0){r.ch=0;r.sticky="after"}var a=pe(n,r.ch,r.sticky),s=n[a];if(e.doc.direction=="ltr"&&s.level%2==0&&(i>0?s.to>r.ch:s.from<r.ch)){return Xs(t,r,i)}var o=function(e,r){return $s(t,e instanceof ot?e.ch:e,r)};var l;var u=function(r){if(!e.options.lineWrapping){return{begin:0,end:t.text.length}}l=l||ii(e,t);return Si(e,t,l,r)};var c=u(r.sticky=="before"?o(r,-1):r.ch);if(e.doc.direction=="rtl"||s.level==1){var f=s.level==1==i<0;var h=o(r,f?1:-1);if(h!=null&&(!f?h>=s.from&&h>=c.begin:h<=s.to&&h<=c.end)){var p=f?"before":"after";return new ot(r.line,h,p)}}var d=function(e,t,i){var a=function(e,t){return t?new ot(r.line,o(e,1),"before"):new ot(r.line,e,"after")};for(;e>=0&&e<n.length;e+=t){var s=n[e];var l=t>0==(s.level!=1);var u=l?i.begin:o(i.end,-1);if(s.from<=u&&u<s.to){return a(u,l)}u=l?s.from:o(s.to,-1);if(i.begin<=u&&u<i.end){return a(u,l)}}};var m=d(a+i,i,c);if(m){return m}var v=i>0?c.end:o(c.begin,-1);if(v!=null&&!(i>0&&v==t.text.length)){m=d(i>0?0:n.length-1,i,u(v));if(m){return m}}return null}var Zs={selectAll:Qa,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(e){return Ks(e,function(t){if(t.empty()){var r=Je(e.doc,t.head.line).text.length;if(t.head.ch==r&&t.head.line<e.lastLine()){return{from:t.head,to:ot(t.head.line+1,0)}}else{return{from:t.head,to:ot(t.head.line,r)}}}else{return{from:t.from(),to:t.to()}}})},deleteLine:function(e){return Ks(e,function(t){return{from:ot(t.from().line,0),to:dt(e.doc,ot(t.to().line+1,0))}})},delLineLeft:function(e){return Ks(e,function(e){return{from:ot(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Ks(e,function(t){var r=e.charCoords(t.head,"div").top+5;var i=e.coordsChar({left:0,top:r},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return Ks(e,function(t){var r=e.charCoords(t.head,"div").top+5;var i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:i}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Js(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return to(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return eo(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},$)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},$)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;var i=e.coordsChar({left:0,top:r},"div");if(i.ch<e.getLine(i.line).search(/\S/)){return to(e,t.head)}return i},$)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){
return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){var t=[],r=e.listSelections(),i=e.options.tabSize;for(var n=0;n<r.length;n++){var a=r[n].from();var s=B(e.getLine(a.line),a.ch,i);t.push(Q(i-s%i))}e.replaceSelections(t)},defaultTab:function(e){if(e.somethingSelected()){e.indentSelection("add")}else{e.execCommand("insertTab")}},transposeChars:function(e){return In(e,function(){var t=e.listSelections(),r=[];for(var i=0;i<t.length;i++){if(!t[i].empty()){continue}var n=t[i].head,a=Je(e.doc,n.line).text;if(a){if(n.ch==a.length){n=new ot(n.line,n.ch-1)}if(n.ch>0){n=new ot(n.line,n.ch+1);e.replaceRange(a.charAt(n.ch-1)+a.charAt(n.ch-2),ot(n.line,n.ch-2),n,"+transpose")}else if(n.line>e.doc.first){var s=Je(e.doc,n.line-1).text;if(s){n=new ot(n.line,1);e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),ot(n.line-1,s.length-1),n,"+transpose")}}}r.push(new oa(n,n))}e.setSelections(r)})},newlineAndIndent:function(e){return In(e,function(){var t=e.listSelections();for(var r=t.length-1;r>=0;r--){e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input")}t=e.listSelections();for(var i=0;i<t.length;i++){e.indentLine(t[i].from().line,null,true)}un(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Js(e,t){var r=Je(e.doc,t);var i=er(r);if(i!=r){t=it(i)}return Ys(true,e,i,t,1)}function eo(e,t){var r=Je(e.doc,t);var i=tr(r);if(i!=r){t=it(i)}return Ys(true,e,r,t,-1)}function to(e,t){var r=Js(e,t.line);var i=Je(e.doc,r.line);var n=me(i,e.doc.direction);if(!n||n[0].level==0){var a=Math.max(r.ch,i.text.search(/\S/));var s=t.line==r.line&&t.ch<=a&&t.ch;return ot(r.line,s?0:a,r.sticky)}return r}function ro(e,t,r){if(typeof t=="string"){t=Zs[t];if(!t){return false}}e.display.input.ensurePolled();var i=e.display.shift,n=false;try{if(e.isReadOnly()){e.state.suppressEdits=true}if(r){e.display.shift=false}n=t(e)!=G}finally{e.display.shift=i;e.state.suppressEdits=false}return n}function io(e,t,r){for(var i=0;i<e.state.keyMaps.length;i++){var n=Hs(t,e.state.keyMaps[i],r,e);if(n){return n}}return e.options.extraKeys&&Hs(t,e.options.extraKeys,r,e)||Hs(t,e.options.keyMap,r,e)}var no=new H;function ao(e,t,r,i){var n=e.state.keySeq;if(n){if(js(t)){return"handled"}if(/\'$/.test(t)){e.state.keySeq=null}else{no.set(50,function(){if(e.state.keySeq==n){e.state.keySeq=null;e.display.input.reset()}})}if(so(e,n+" "+t,r,i)){return true}}return so(e,t,r,i)}function so(e,t,r,i){var n=io(e,t,i);if(n=="multi"){e.state.keySeq=t}if(n=="handled"){Nr(e,"keyHandled",e,t,r)}if(n=="handled"||n=="multi"){Le(r);Xi(e)}return!!n}function oo(e,t){var r=Gs(t,true);if(!r){return false}if(t.shiftKey&&!e.state.keySeq){return ao(e,"Shift-"+r,t,function(t){return ro(e,t,true)})||ao(e,r,t,function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion){return ro(e,t)}})}else{return ao(e,r,t,function(t){return ro(e,t)})}}function lo(e,t,r){return ao(e,"'"+r+"'",t,function(t){return ro(e,t,true)})}var uo=null;function co(e){var t=this;if(e.target&&e.target!=t.display.input.getField()){return}t.curOp.focus=I(V(t));if(we(t,e)){return}if(s&&o<11&&e.keyCode==27){e.returnValue=false}var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=oo(t,e);if(h){uo=n?i:null;if(!n&&i==88&&!Fe&&(x?e.metaKey:e.ctrlKey)){t.replaceSelection("",null,"cut")}}if(r&&!x&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand){document.execCommand("cut")}if(i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)){fo(t)}}function fo(e){var t=e.display.lineDiv;O(t,"CodeMirror-crosshair");function r(e){if(e.keyCode==18||!e.altKey){T(t,"CodeMirror-crosshair");xe(document,"keyup",r);xe(document,"mouseover",r)}}ge(document,"keyup",r);ge(document,"mouseover",r)}function ho(e){if(e.keyCode==16){this.doc.sel.shift=false}we(this,e)}function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField()){return}if(Gr(t.display,e)||we(t,e)||e.ctrlKey&&!e.altKey||x&&e.metaKey){return}var r=e.keyCode,i=e.charCode;if(h&&r==uo){uo=null;Le(e);return}if(h&&(!e.which||e.which<10)&&oo(t,e)){return}var n=String.fromCharCode(i==null?r:i);if(n=="\b"){return}if(lo(t,e,n)){return}t.display.input.onKeyPress(e)}var mo=400;var vo=function(e,t,r){this.time=e;this.pos=t;this.button=r};vo.prototype.compare=function(e,t,r){return this.time+mo>e&&lt(t,this.pos)==0&&r==this.button};var go,yo;function xo(e,t){var r=+new Date;if(yo&&yo.compare(r,e,t)){go=yo=null;return"triple"}else if(go&&go.compare(r,e,t)){yo=new vo(r,e,t);go=null;return"double"}else{go=new vo(r,e,t);yo=null;return"single"}}function bo(e){var t=this,r=t.display;if(we(t,e)||r.activeTouch&&r.input.supportsTouch()){return}r.input.ensurePolled();r.shift=e.shiftKey;if(Gr(r,e)){if(!l){r.scroller.draggable=false;setTimeout(function(){return r.scroller.draggable=true},100)}return}if(Mo(t,e)){return}var i=Ri(t,e),n=Ne(e),a=i?xo(i,n):"single";F(t).focus();if(n==1&&t.state.selectingText){t.state.selectingText(e)}if(i&&wo(t,n,i,a,e)){return}if(n==1){if(i){Co(t,i,a,e)}else if(Me(e)==r.scroller){Le(e)}}else if(n==2){if(i){Va(t.doc,i)}setTimeout(function(){return r.input.focus()},20)}else if(n==3){if(S){t.display.input.onContextMenu(e)}else{Qi(t)}}}function wo(e,t,r,i,n){var a="Click";if(i=="double"){a="Double"+a}else if(i=="triple"){a="Triple"+a}a=(t==1?"Left":t==2?"Middle":"Right")+a;return ao(e,Us(a,n),n,function(t){if(typeof t=="string"){t=Zs[t]}if(!t){return false}var i=false;try{if(e.isReadOnly()){e.state.suppressEdits=true}i=t(e,r)!=G}finally{e.state.suppressEdits=false}return i})}function ko(e,t,r){var i=e.getOption("configureMouse");var n=i?i(e,t,r):{};if(n.unit==null){var a=b?r.shiftKey&&r.metaKey:r.altKey;n.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}if(n.extend==null||e.doc.extend){n.extend=e.doc.extend||r.shiftKey}if(n.addNew==null){n.addNew=x?r.metaKey:r.ctrlKey}if(n.moveOnDrag==null){n.moveOnDrag=!(x?r.altKey:r.ctrlKey)}return n}function Co(e,t,r,i){if(s){setTimeout(z(Yi,e),0)}else{e.curOp.focus=I(V(e))}var n=ko(e,r,i);var a=e.doc.sel,o;if(e.options.dragDrop&&_e&&!e.isReadOnly()&&r=="single"&&(o=a.contains(t))>-1&&(lt((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(lt(o.to(),t)>0||t.xRel<0)){So(e,i,t,n)}else{To(e,i,t,n)}}function So(e,t,r,i){var n=e.display,a=false;var u=On(e,function(t){if(l){n.scroller.draggable=false}e.state.draggingText=false;if(e.state.delayingBlurEvent){if(e.hasFocus()){e.state.delayingBlurEvent=false}else{Qi(e)}}xe(n.wrapper.ownerDocument,"mouseup",u);xe(n.wrapper.ownerDocument,"mousemove",c);xe(n.scroller,"dragstart",f);xe(n.scroller,"drop",u);if(!a){Le(t);if(!i.addNew){Va(e.doc,r,null,null,i.extend)}if(l&&!p||s&&o==9){setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:true});n.input.focus()},20)}else{n.input.focus()}}});var c=function(e){a=a||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10};var f=function(){return a=true};if(l){n.scroller.draggable=true}e.state.draggingText=u;u.copy=!i.moveOnDrag;ge(n.wrapper.ownerDocument,"mouseup",u);ge(n.wrapper.ownerDocument,"mousemove",c);ge(n.scroller,"dragstart",f);ge(n.scroller,"drop",u);e.state.delayingBlurEvent=true;setTimeout(function(){return n.input.focus()},20);if(n.scroller.dragDrop){n.scroller.dragDrop()}}function Lo(e,t,r){if(r=="char"){return new oa(t,t)}if(r=="word"){return e.findWordAt(t)}if(r=="line"){return new oa(ot(t.line,0),dt(e.doc,ot(t.line+1,0)))}var i=r(e,t);return new oa(i.from,i.to)}function To(e,t,r,i){if(s){Qi(e)}var n=e.display,a=e.doc;Le(t);var o,l,u=a.sel,c=u.ranges;if(i.addNew&&!i.extend){l=a.sel.contains(r);if(l>-1){o=c[l]}else{o=new oa(r,r)}}else{o=a.sel.primary();l=a.sel.primIndex}if(i.unit=="rectangle"){if(!i.addNew){o=new oa(r,r)}r=Ri(e,t,true,true);l=-1}else{var f=Lo(e,r,i.unit);if(i.extend){o=Ra(o,f.anchor,f.head,i.extend)}else{o=f}}if(!i.addNew){l=0;ja(a,new sa([o],0),K);u=a.sel}else if(l==-1){l=c.length;ja(a,la(e,c.concat([o]),l),{scroll:false,origin:"*mouse"})}else if(c.length>1&&c[l].empty()&&i.unit=="char"&&!i.extend){ja(a,la(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:false,origin:"*mouse"});u=a.sel}else{za(a,l,o,K)}var h=r;function p(t){if(lt(h,t)==0){return}h=t;if(i.unit=="rectangle"){var n=[],s=e.options.tabSize;var c=B(Je(a,r.line).text,r.ch,s);var f=B(Je(a,t.line).text,t.ch,s);var p=Math.min(c,f),d=Math.max(c,f);for(var m=Math.min(r.line,t.line),v=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=v;m++){var g=Je(a,m).text,y=X(g,p,s);if(p==d){n.push(new oa(ot(m,y),ot(m,y)))}else if(g.length>y){n.push(new oa(ot(m,y),ot(m,X(g,d,s))))}}if(!n.length){n.push(new oa(r,r))}ja(a,la(e,u.ranges.slice(0,l).concat(n),l),{origin:"*mouse",scroll:false});e.scrollIntoView(t)}else{var x=o;var b=Lo(e,t,i.unit);var w=x.anchor,k;if(lt(b.anchor,w)>0){k=b.head;w=ht(x.from(),b.anchor)}else{k=b.anchor;w=ft(x.to(),b.head)}var C=u.ranges.slice(0);C[l]=Ao(e,new oa(dt(a,w),k));ja(a,la(e,C,l),K)}}var d=n.wrapper.getBoundingClientRect();var m=0;function v(t){var r=++m;var s=Ri(e,t,true,i.unit=="rectangle");if(!s){return}if(lt(s,h)!=0){e.curOp.focus=I(V(e));p(s);var o=rn(n,a);if(s.line>=o.to||s.line<o.from){setTimeout(On(e,function(){if(m==r){v(t)}}),150)}}else{var l=t.clientY<d.top?-20:t.clientY>d.bottom?20:0;if(l){setTimeout(On(e,function(){if(m!=r){return}n.scroller.scrollTop+=l;v(t)}),50)}}}function g(t){e.state.selectingText=false;m=Infinity;if(t){Le(t);n.input.focus()}xe(n.wrapper.ownerDocument,"mousemove",y);xe(n.wrapper.ownerDocument,"mouseup",x);a.history.lastSelOrigin=null}var y=On(e,function(e){if(e.buttons===0||!Ne(e)){g(e)}else{v(e)}});var x=On(e,g);e.state.selectingText=x;ge(n.wrapper.ownerDocument,"mousemove",y);ge(n.wrapper.ownerDocument,"mouseup",x)}function Ao(e,t){var r=t.anchor;var i=t.head;var n=Je(e.doc,r.line);if(lt(r,i)==0&&r.sticky==i.sticky){return t}var a=me(n);if(!a){return t}var s=pe(a,r.ch,r.sticky),o=a[s];if(o.from!=r.ch&&o.to!=r.ch){return t}var l=s+(o.from==r.ch==(o.level!=1)?0:1);if(l==0||l==a.length){return t}var u;if(i.line!=r.line){u=(i.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0}else{var c=pe(a,i.ch,i.sticky);var f=c-s||(i.ch-r.ch)*(o.level==1?-1:1);if(c==l-1||c==l){u=f<0}else{u=f>0}}var h=a[l+(u?-1:0)];var p=u==(h.level==1);var d=p?h.from:h.to,m=p?"after":"before";return r.ch==d&&r.sticky==m?t:new oa(new ot(r.line,d,m),i)}function Eo(e,t,r,i){var n,a;if(t.touches){n=t.touches[0].clientX;a=t.touches[0].clientY}else{try{n=t.clientX;a=t.clientY}catch(e){return false}}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right)){return false}if(i){Le(t)}var s=e.display;var o=s.lineDiv.getBoundingClientRect();if(a>o.bottom||!Ce(e,r)){return Ae(t)}a-=o.top-s.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var u=s.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=n){var c=nt(e.doc,a);var f=e.display.gutterSpecs[l];be(e,r,e,c,f.className,t);return Ae(t)}}}function Mo(e,t){return Eo(e,t,"gutterClick",true)}function No(e,t){if(Gr(e.display,t)||_o(e,t)){return}if(we(e,t,"contextmenu")){return}if(!S){e.display.input.onContextMenu(t)}}function _o(e,t){if(!Ce(e,"gutterContextMenu")){return false}return Eo(e,t,"gutterContextMenu",false)}function Po(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-");hi(e)}var Io={toString:function(){return"CodeMirror.Init"}};var Oo={};var Do={};function Ro(e){var t=e.optionHandlers;function r(r,i,n,a){e.defaults[r]=i;if(n){t[r]=a?function(e,t,r){if(r!=Io){n(e,t,r)}}:n}}e.defineOption=r;e.Init=Io;r("value","",function(e,t){return e.setValue(t)},true);r("mode",null,function(e,t){e.doc.modeOption=t;ma(e)},true);r("indentUnit",2,ma,true);r("indentWithTabs",false);r("smartIndent",true);r("tabSize",4,function(e){va(e);hi(e);Fi(e)},true);r("lineSeparator",null,function(e,t){e.doc.lineSep=t;if(!t){return}var r=[],i=e.doc.first;e.doc.iter(function(e){for(var n=0;;){var a=e.text.indexOf(t,n);if(a==-1){break}n=a+t.length;r.push(ot(i,a))}i++});for(var n=r.length-1;n>=0;n--){as(e.doc,t,r[n],ot(r[n].line,r[n].ch+t.length))}});r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g");if(r!=Io){e.refresh()}});r("specialCharPlaceholder",gr,function(e){return e.refresh()},true);r("electricChars",true);r("inputStyle",y?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},true);r("spellcheck",false,function(e,t){return e.getInputField().spellcheck=t},true);r("autocorrect",false,function(e,t){return e.getInputField().autocorrect=t},true);r("autocapitalize",false,function(e,t){return e.getInputField().autocapitalize=t},true);r("rtlMoveVisually",!w);r("wholeLineUpdateBefore",true);r("theme","default",function(e){Po(e);Jn(e)},true);r("keyMap","default",function(e,t,r){var i=qs(t);var n=r!=Io&&qs(r);if(n&&n.detach){n.detach(e,i)}if(i.attach){i.attach(e,n||null)}});r("extraKeys",null);r("configureMouse",null);r("lineWrapping",false,Fo,true);r("gutters",[],function(e,t){e.display.gutterSpecs=Qn(t,e.options.lineNumbers);Jn(e)},true);r("fixedGutter",true,function(e,t){e.display.gutters.style.left=t?Ii(e.display)+"px":"0";e.refresh()},true);r("coverGutterNextToScrollbar",false,function(e){return bn(e)},true);r("scrollbarStyle","native",function(e){Cn(e);bn(e);e.display.scrollbars.setScrollTop(e.doc.scrollTop);e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},true);r("lineNumbers",false,function(e,t){e.display.gutterSpecs=Qn(e.options.gutters,t);Jn(e)},true);r("firstLineNumber",1,Jn,true);r("lineNumberFormatter",function(e){return e},Jn,true);r("showCursorWhenSelecting",false,Ui,true);r("resetSelectionOnContextMenu",true);r("lineWiseCopyCut",true);r("pasteLinesPerSelection",true);r("selectionsMayTouch",false);r("readOnly",false,function(e,t){if(t=="nocursor"){Ji(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",false,function(e,t){if(!t){e.display.input.reset()}},true);r("dragDrop",true,Vo);r("allowDropFileTypes",null);r("cursorBlinkRate",530);r("cursorScrollMargin",0);r("cursorHeight",1,Ui,true);r("singleCursorHeightPerLine",true,Ui,true);r("workTime",100);r("workDelay",100);r("flattenSpans",true,va,true);r("addModeClass",false,va,true);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()},true);r("maxHighlightLength",1e4,va,true);r("moveInputWithCursor",true,function(e,t){if(!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)},true);r("phrases",null)}function Vo(e,t,r){var i=r&&r!=Io;if(!t!=!i){var n=e.display.dragFunctions;var a=t?ge:xe;a(e.display.scroller,"dragstart",n.start);a(e.display.scroller,"dragenter",n.enter);a(e.display.scroller,"dragover",n.over);a(e.display.scroller,"dragleave",n.leave);a(e.display.scroller,"drop",n.drop)}}function Fo(e){if(e.options.lineWrapping){O(e.display.wrapper,"CodeMirror-wrap");e.display.sizer.style.minWidth="";e.display.sizerWidth=null}else{T(e.display.wrapper,"CodeMirror-wrap");ur(e)}Di(e);Fi(e);hi(e);setTimeout(function(){return bn(e)},100)}function zo(e,t){var r=this;if(!(this instanceof zo)){return new zo(e,t)}this.options=t=t?W(t):{};W(Oo,t,false);var i=t.value;if(typeof i=="string"){i=new Ss(i,t.mode,null,t.lineSeparator,t.direction)}else if(t.mode){i.modeOption=t.mode}this.doc=i;var n=new zo.inputStyles[t.inputStyle](this);var a=this.display=new ea(e,i,n,t);a.wrapper.CodeMirror=this;Po(this);if(t.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}Cn(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,delayingBlurEvent:false,focused:false,suppressEdits:false,pasteIncoming:-1,cutIncoming:-1,selectingText:false,draggingText:false,highlight:new H,keySeq:null,specialChars:null};if(t.autofocus&&!y){a.input.focus()}if(s&&o<11){setTimeout(function(){return r.display.input.reset(true)},20)}Wo(this);Ps();Ln(this);this.curOp.forceUpdate=true;ba(this,i);if(t.autofocus&&!y||this.hasFocus()){setTimeout(function(){if(r.hasFocus()&&!r.state.focused){Zi(r)}},20)}else{Ji(this)}for(var u in Do){if(Do.hasOwnProperty(u)){Do[u](this,t[u],Io)}}Yn(this);if(t.finishInit){t.finishInit(this)}for(var c=0;c<Bo.length;++c){Bo[c](this)}Tn(this);if(l&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"){a.lineDiv.style.textRendering="auto"}}zo.defaults=Oo;zo.optionHandlers=Do;function Wo(e){var t=e.display;ge(t.scroller,"mousedown",On(e,bo));if(s&&o<11){ge(t.scroller,"dblclick",On(e,function(t){if(we(e,t)){return}var r=Ri(e,t);if(!r||Mo(e,t)||Gr(e.display,t)){return}Le(t);var i=e.findWordAt(r);Va(e.doc,i.anchor,i.head)}))}else{ge(t.scroller,"dblclick",function(t){return we(e,t)||Le(t)})}ge(t.scroller,"contextmenu",function(t){return No(e,t)});ge(t.input.getField(),"contextmenu",function(r){if(!t.scroller.contains(r.target)){No(e,r)}});var r,i={end:0};function n(){if(t.activeTouch){r=setTimeout(function(){return t.activeTouch=null},1e3);i=t.activeTouch;i.end=+new Date}}function a(e){if(e.touches.length!=1){return false}var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(t.left==null){return true}var r=t.left-e.left,i=t.top-e.top;return r*r+i*i>20*20}ge(t.scroller,"touchstart",function(n){if(!we(e,n)&&!a(n)&&!Mo(e,n)){t.input.ensurePolled();clearTimeout(r);var s=+new Date;t.activeTouch={start:s,moved:false,prev:s-i.end<=300?i:null};if(n.touches.length==1){t.activeTouch.left=n.touches[0].pageX;t.activeTouch.top=n.touches[0].pageY}}});ge(t.scroller,"touchmove",function(){if(t.activeTouch){t.activeTouch.moved=true}});ge(t.scroller,"touchend",function(r){var i=t.activeTouch;if(i&&!Gr(t,r)&&i.left!=null&&!i.moved&&new Date-i.start<300){var a=e.coordsChar(t.activeTouch,"page"),s;if(!i.prev||l(i,i.prev)){s=new oa(a,a)}else if(!i.prev.prev||l(i,i.prev.prev)){s=e.findWordAt(a)}else{s=new oa(ot(a.line,0),dt(e.doc,ot(a.line+1,0)))}e.setSelection(s.anchor,s.head);e.focus();Le(r)}n()});ge(t.scroller,"touchcancel",n);ge(t.scroller,"scroll",function(){if(t.scroller.clientHeight){dn(e,t.scroller.scrollTop);vn(e,t.scroller.scrollLeft,true);be(e,"scroll",e)}});ge(t.scroller,"mousewheel",function(t){return aa(e,t)});ge(t.scroller,"DOMMouseScroll",function(t){return aa(e,t)});ge(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0});t.dragFunctions={enter:function(t){if(!we(e,t)){Ee(t)}},over:function(t){if(!we(e,t)){Es(e,t);Ee(t)}},start:function(t){return As(e,t)},drop:On(e,Ts),leave:function(t){if(!we(e,t)){Ms(e)}}};var u=t.input.getField();ge(u,"keyup",function(t){return ho.call(e,t)});ge(u,"keydown",On(e,co));ge(u,"keypress",On(e,po));ge(u,"focus",function(t){return Zi(e,t)});ge(u,"blur",function(t){return Ji(e,t)})}var Bo=[];zo.defineInitHook=function(e){return Bo.push(e)};function Ho(e,t,r,i){var n=e.doc,a;if(r==null){r="add"}if(r=="smart"){if(!n.mode.indent){r="prev"}else{a=wt(e,t).state}}var s=e.options.tabSize;var o=Je(n,t),l=B(o.text,null,s);if(o.stateAfter){o.stateAfter=null}var u=o.text.match(/^\s*/)[0],c;if(!i&&!/\S/.test(o.text)){c=0;r="not"}else if(r=="smart"){c=n.mode.indent(a,o.text.slice(u.length),o.text);if(c==G||c>150){if(!i){return}r="prev"}}if(r=="prev"){if(t>n.first){c=B(Je(n,t-1).text,null,s)}else{c=0}}else if(r=="add"){c=l+e.options.indentUnit}else if(r=="subtract"){c=l-e.options.indentUnit}else if(typeof r=="number"){c=l+r}c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs){for(var p=Math.floor(c/s);p;--p){h+=s;f+="\t"}}if(h<c){f+=Q(c-h)}if(f!=u){as(n,f,ot(t,0),ot(t,u.length),"+input");o.stateAfter=null;return true}else{for(var d=0;d<n.sel.ranges.length;d++){var m=n.sel.ranges[d];if(m.head.line==t&&m.head.ch<u.length){var v=ot(t,u.length);za(n,d,new oa(v,v));break}}}}var jo=null;function Uo(e){jo=e}function Go(e,t,r,i,n){var a=e.doc;e.display.shift=false;if(!i){i=a.sel}var s=+new Date-200;var o=n=="paste"||e.state.pasteIncoming>s;var l=Re(t),u=null;if(o&&i.ranges.length>1){if(jo&&jo.text.join("\n")==t){if(i.ranges.length%jo.text.length==0){u=[];for(var c=0;c<jo.text.length;c++){u.push(a.splitLines(jo.text[c]))}}}else if(l.length==i.ranges.length&&e.options.pasteLinesPerSelection){u=J(l,function(e){return[e]})}}var f=e.curOp.updateInput;for(var h=i.ranges.length-1;h>=0;h--){var p=i.ranges[h];var d=p.from(),m=p.to();if(p.empty()){if(r&&r>0){d=ot(d.line,d.ch-r)}else if(e.state.overwrite&&!o){m=ot(m.line,Math.min(Je(a,m.line).text.length,m.ch+Z(l).length))}else if(o&&jo&&jo.lineWise&&jo.text.join("\n")==l.join("\n")){d=m=ot(d.line,0)}}var v={from:d,to:m,text:u?u[h%u.length]:l,origin:n||(o?"paste":e.state.cutIncoming>s?"cut":"+input")};Ja(e.doc,v);Nr(e,"inputRead",e,v)}if(t&&!o){Ko(e,t)}un(e);if(e.curOp.updateInput<2){e.curOp.updateInput=f}e.curOp.typing=true;e.state.pasteIncoming=e.state.cutIncoming=-1}function qo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r){e.preventDefault();if(!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()){In(t,function(){return Go(t,r,0,null,"paste")})}return true}}function Ko(e,t){if(!e.options.electricChars||!e.options.smartIndent){return}var r=e.doc.sel;for(var i=r.ranges.length-1;i>=0;i--){var n=r.ranges[i];if(n.head.ch>100||i&&r.ranges[i-1].head.line==n.head.line){continue}var a=e.getModeAt(n.head);var s=false;if(a.electricChars){for(var o=0;o<a.electricChars.length;o++){if(t.indexOf(a.electricChars.charAt(o))>-1){s=Ho(e,n.head.line,"smart");break}}}else if(a.electricInput){if(a.electricInput.test(Je(e.doc,n.head.line).text.slice(0,n.head.ch))){s=Ho(e,n.head.line,"smart")}}if(s){Nr(e,"electricInput",e,n.head.line)}}}function $o(e){var t=[],r=[];for(var i=0;i<e.doc.sel.ranges.length;i++){var n=e.doc.sel.ranges[i].head.line;var a={anchor:ot(n,0),head:ot(n+1,0)};r.push(a);t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:r}}function Xo(e,t,r,i){e.setAttribute("autocorrect",r?"":"off");e.setAttribute("autocapitalize",i?"":"off");e.setAttribute("spellcheck",!!t)}function Yo(){var e=M("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");var t=M("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(l){e.style.width="1000px"}else{e.setAttribute("wrap","off")}if(v){e.style.border="1px solid black"}Xo(e);return t}function Qo(e){var t=e.optionHandlers;var r=e.helpers={};e.prototype={constructor:e,focus:function(){F(this).focus();this.display.input.focus()},setOption:function(e,r){var i=this.options,n=i[e];if(i[e]==r&&e!="mode"){return}i[e]=r;if(t.hasOwnProperty(e)){On(this,t[e])(this,r,n)}be(this,"optionChange",this,e)},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](qs(e))},removeKeyMap:function(e){var t=this.state.keyMaps;for(var r=0;r<t.length;++r){if(t[r]==e||t[r].name==e){t.splice(r,1);return true}}},addOverlay:Dn(function(t,r){var i=t.token?t:e.getMode(this.options,t);if(i.startState){throw new Error("Overlays may not be stateful.")}ee(this.state.overlays,{mode:i,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},function(e){return e.priority});this.state.modeGen++;Fi(this)}),removeOverlay:Dn(function(e){var t=this.state.overlays;for(var r=0;r<t.length;++r){var i=t[r].modeSpec;if(i==e||typeof e=="string"&&i.name==e){t.splice(r,1);this.state.modeGen++;Fi(this);return}}}),indentLine:Dn(function(e,t,r){if(typeof t!="string"&&typeof t!="number"){if(t==null){t=this.options.smartIndent?"smart":"prev"}else{t=t?"add":"subtract"}}if(at(this.doc,e)){Ho(this,e,t,r)}}),indentSelection:Dn(function(e){var t=this.doc.sel.ranges,r=-1;for(var i=0;i<t.length;i++){var n=t[i];if(!n.empty()){var a=n.from(),s=n.to();var o=Math.max(r,a.line);r=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=o;l<r;++l){Ho(this,l,e)}var u=this.doc.sel.ranges;if(a.ch==0&&t.length==u.length&&u[i].from().ch>0){za(this.doc,i,new oa(a,u[i].to()),q)}}else if(n.head.line>r){Ho(this,n.head.line,e,true);r=n.head.line;if(i==this.doc.sel.primIndex){un(this)}}}}),getTokenAt:function(e,t){return Tt(this,e,t)},getLineTokens:function(e,t){return Tt(this,ot(e),t,true)},getTokenTypeAt:function(e){e=dt(this.doc,e);var t=bt(this,Je(this.doc,e.line));var r=0,i=(t.length-1)/2,n=e.ch;var a;if(n==0){a=t[2]}else{for(;;){var s=r+i>>1;if((s?t[s*2-1]:0)>=n){i=s}else if(t[s*2+1]<n){r=s+1}else{a=t[s*2+2];break}}}var o=a?a.indexOf("overlay "):-1;return o<0?a:o==0?null:a.slice(0,o-1)},getModeAt:function(t){var r=this.doc.mode;if(!r.innerMode){return r}return e.innerMode(r,this.getTokenAt(t).state).mode},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var i=[];if(!r.hasOwnProperty(t)){return i}var n=r[t],a=this.getModeAt(e);if(typeof a[t]=="string"){if(n[a[t]]){i.push(n[a[t]])}}else if(a[t]){for(var s=0;s<a[t].length;s++){var o=n[a[t][s]];if(o){i.push(o)}}}else if(a.helperType&&n[a.helperType]){i.push(n[a.helperType])}else if(n[a.name]){i.push(n[a.name])}for(var l=0;l<n._global.length;l++){var u=n._global[l];if(u.pred(a,this)&&j(i,u.val)==-1){i.push(u.val)}}return i},getStateAfter:function(e,t){var r=this.doc;e=pt(r,e==null?r.first+r.size-1:e);return wt(this,e+1,t).state},cursorCoords:function(e,t){var r,i=this.doc.sel.primary();if(e==null){r=i.head}else if(typeof e=="object"){r=dt(this.doc,e)}else{r=e?i.from():i.to()}return xi(this,r,t||"page")},charCoords:function(e,t){return yi(this,dt(this.doc,e),t||"page")},coordsChar:function(e,t){e=gi(this,e,t||"page");return ki(this,e.left,e.top)},lineAtHeight:function(e,t){e=gi(this,{top:e,left:0},t||"page").top;return nt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var i=false,n;if(typeof e=="number"){var a=this.doc.first+this.doc.size-1;if(e<this.doc.first){e=this.doc.first}else if(e>a){e=a;i=true}n=Je(this.doc,e)}else{n=e}return vi(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-or(n):0)},defaultTextHeight:function(){return Ni(this.display)},defaultCharWidth:function(){return _i(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,i,n){var a=this.display;e=xi(this,dt(this.doc,e));var s=e.bottom,o=e.left;t.style.position="absolute";t.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(t);a.sizer.appendChild(t);if(i=="over"){s=e.top}else if(i=="above"||i=="near"){var l=Math.max(a.wrapper.clientHeight,this.doc.height),u=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);if((i=="above"||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight){s=e.top-t.offsetHeight}else if(e.bottom+t.offsetHeight<=l){s=e.bottom}if(o+t.offsetWidth>u){o=u-t.offsetWidth}}t.style.top=s+"px";t.style.left=t.style.right="";if(n=="right"){o=a.sizer.clientWidth-t.offsetWidth;t.style.right="0px"}else{if(n=="left"){o=0}else if(n=="middle"){o=(a.sizer.clientWidth-t.offsetWidth)/2}t.style.left=o+"px"}if(r){sn(this,{left:o,top:s,right:o+t.offsetWidth,bottom:s+t.offsetHeight})}},triggerOnKeyDown:Dn(co),triggerOnKeyPress:Dn(po),triggerOnKeyUp:ho,triggerOnMouseDown:Dn(bo),execCommand:function(e){if(Zs.hasOwnProperty(e)){return Zs[e].call(null,this)}},triggerElectric:Dn(function(e){Ko(this,e)}),findPosH:function(e,t,r,i){var n=1;if(t<0){n=-1;t=-t}var a=dt(this.doc,e);for(var s=0;s<t;++s){a=Zo(this.doc,a,n,r,i);if(a.hitSide){break}}return a},moveH:Dn(function(e,t){var r=this;this.extendSelectionsBy(function(i){if(r.display.shift||r.doc.extend||i.empty()){return Zo(r.doc,i.head,e,t,r.options.rtlMoveVisually)}else{return e<0?i.from():i.to()}},$)}),deleteH:Dn(function(e,t){var r=this.doc.sel,i=this.doc;if(r.somethingSelected()){i.replaceSelection("",null,"+delete")}else{Ks(this,function(r){var n=Zo(i,r.head,e,t,false);return e<0?{from:n,to:r.head}:{from:r.head,to:n}})}}),findPosV:function(e,t,r,i){var n=1,a=i;if(t<0){n=-1;t=-t}var s=dt(this.doc,e);for(var o=0;o<t;++o){var l=xi(this,s,"div");if(a==null){a=l.left}else{l.left=a}s=Jo(this,l,n,r);if(s.hitSide){break}}return s},moveV:Dn(function(e,t){var r=this;var i=this.doc,n=[];var a=!this.display.shift&&!i.extend&&i.sel.somethingSelected();i.extendSelectionsBy(function(s){if(a){return e<0?s.from():s.to()}var o=xi(r,s.head,"div");if(s.goalColumn!=null){o.left=s.goalColumn}n.push(o.left);var l=Jo(r,o,e,t);if(t=="page"&&s==i.sel.primary()){ln(r,yi(r,l,"div").top-o.top)}return l},$);if(n.length){for(var s=0;s<i.sel.ranges.length;s++){i.sel.ranges[s].goalColumn=n[s]}}}),findWordAt:function(e){var t=this.doc,r=Je(t,e.line).text;var i=e.ch,n=e.ch;if(r){var a=this.getHelper(e,"wordChars");if((e.sticky=="before"||n==r.length)&&i){--i}else{++n}var s=r.charAt(i);var o=ae(s,a)?function(e){return ae(e,a)}:/\s/.test(s)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ae(e)};while(i>0&&o(r.charAt(i-1))){--i}while(n<r.length&&o(r.charAt(n))){++n}}return new oa(ot(e.line,i),ot(e.line,n))},toggleOverwrite:function(e){if(e!=null&&e==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){O(this.display.cursorDiv,"CodeMirror-overwrite")}else{T(this.display.cursorDiv,"CodeMirror-overwrite")}be(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==I(V(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Dn(function(e,t){cn(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Xr(this)-this.display.barHeight,width:e.scrollWidth-Xr(this)-this.display.barWidth,clientHeight:Qr(this),clientWidth:Yr(this)}},scrollIntoView:Dn(function(e,t){if(e==null){e={from:this.doc.sel.primary().head,to:null};if(t==null){t=this.options.cursorScrollMargin}}else if(typeof e=="number"){e={from:ot(e,0),to:null}}else if(e.from==null){e={from:e,to:null}}if(!e.to){e.to=e.from}e.margin=t||0;if(e.from.line!=null){fn(this,e)}else{pn(this,e.from,e.to,e.margin)}}),setSize:Dn(function(e,t){var r=this;var i=function(e){return typeof e=="number"||/^\d+$/.test(String(e))?e+"px":e};if(e!=null){this.display.wrapper.style.width=i(e)}if(t!=null){this.display.wrapper.style.height=i(t)}if(this.options.lineWrapping){fi(this)}var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,function(e){if(e.widgets){for(var t=0;t<e.widgets.length;t++){if(e.widgets[t].noHScroll){zi(r,n,"widget");break}}}++n});this.curOp.forceUpdate=true;be(this,"refresh",this)}),operation:function(e){return In(this,e)},startOperation:function(){return Ln(this)},endOperation:function(){return Tn(this)},refresh:Dn(function(){var e=this.display.cachedTextHeight;Fi(this);this.curOp.forceUpdate=true;hi(this);cn(this,this.doc.scrollLeft,this.doc.scrollTop);Kn(this.display);if(e==null||Math.abs(e-Ni(this.display))>.5||this.options.lineWrapping){Di(this)}be(this,"refresh",this)}),swapDoc:Dn(function(e){var t=this.doc;t.cm=null;if(this.state.selectingText){this.state.selectingText()}ba(this,e);hi(this);this.display.input.reset();cn(this,e.scrollLeft,e.scrollTop);this.curOp.forceScroll=true;Nr(this,"swapDoc",this,t);return 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}};Se(e);e.registerHelper=function(t,i,n){if(!r.hasOwnProperty(t)){r[t]=e[t]={_global:[]}}r[t][i]=n}
;e.registerGlobalHelper=function(t,i,n,a){e.registerHelper(t,i,a);r[t]._global.push({pred:n,val:a})}}function Zo(e,t,r,i,n){var a=t;var s=r;var o=Je(e,t.line);var l=n&&e.direction=="rtl"?-r:r;function u(){var r=t.line+l;if(r<e.first||r>=e.first+e.size){return false}t=new ot(r,t.ch,t.sticky);return o=Je(e,r)}function c(a){var s;if(i=="codepoint"){var c=o.text.charCodeAt(t.ch+(r>0?0:-1));if(isNaN(c)){s=null}else{var f=r>0?c>=55296&&c<56320:c>=56320&&c<57343;s=new ot(t.line,Math.max(0,Math.min(o.text.length,t.ch+r*(f?2:1))),-r)}}else if(n){s=Qs(e.cm,o,t,r)}else{s=Xs(o,t,r)}if(s==null){if(!a&&u()){t=Ys(n,e.cm,o,t.line,l)}else{return false}}else{t=s}return true}if(i=="char"||i=="codepoint"){c()}else if(i=="column"){c(true)}else if(i=="word"||i=="group"){var f=null,h=i=="group";var p=e.cm&&e.cm.getHelper(t,"wordChars");for(var d=true;;d=false){if(r<0&&!c(!d)){break}var m=o.text.charAt(t.ch)||"\n";var v=ae(m,p)?"w":h&&m=="\n"?"n":!h||/\s/.test(m)?null:"p";if(h&&!d&&!v){v="s"}if(f&&f!=v){if(r<0){r=1;c();t.sticky="after"}break}if(v){f=v}if(r>0&&!c(!d)){break}}}var g=Xa(e,t,a,s,true);if(ut(a,g)){g.hitSide=true}return g}function Jo(e,t,r,i){var n=e.doc,a=t.left,s;if(i=="page"){var o=Math.min(e.display.wrapper.clientHeight,F(e).innerHeight||n(e).documentElement.clientHeight);var l=Math.max(o-.5*Ni(e.display),3);s=(r>0?t.bottom:t.top)+r*l}else if(i=="line"){s=r>0?t.bottom+3:t.top-3}var u;for(;;){u=ki(e,a,s);if(!u.outside){break}if(r<0?s<=0:s>=n.height){u.hitSide=true;break}s+=r*5}return u}var el=function(e){this.cm=e;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new H;this.composing=null;this.gracePeriod=false;this.readDOMTimeout=null};el.prototype.init=function(e){var t=this;var r=this,i=r.cm;var n=r.div=e.lineDiv;n.contentEditable=true;Xo(n,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function a(e){for(var t=e.target;t;t=t.parentNode){if(t==n){return true}if(/\bCodeMirror-(?:line)?widget\b/.test(t.className)){break}}return false}ge(n,"paste",function(e){if(!a(e)||we(i,e)||qo(e,i)){return}if(o<=11){setTimeout(On(i,function(){return t.updateFromDOM()}),20)}});ge(n,"compositionstart",function(e){t.composing={data:e.data,done:false}});ge(n,"compositionupdate",function(e){if(!t.composing){t.composing={data:e.data,done:false}}});ge(n,"compositionend",function(e){if(t.composing){if(e.data!=t.composing.data){t.readFromDOMSoon()}t.composing.done=true}});ge(n,"touchstart",function(){return r.forceCompositionEnd()});ge(n,"input",function(){if(!t.composing){t.readFromDOMSoon()}});function s(e){if(!a(e)||we(i,e)){return}if(i.somethingSelected()){Uo({lineWise:false,text:i.getSelections()});if(e.type=="cut"){i.replaceSelection("",null,"cut")}}else if(!i.options.lineWiseCopyCut){return}else{var t=$o(i);Uo({lineWise:true,text:t.text});if(e.type=="cut"){i.operation(function(){i.setSelections(t.ranges,0,q);i.replaceSelection("",null,"cut")})}}if(e.clipboardData){e.clipboardData.clearData();var s=jo.text.join("\n");e.clipboardData.setData("Text",s);if(e.clipboardData.getData("Text")==s){e.preventDefault();return}}var o=Yo(),l=o.firstChild;i.display.lineSpace.insertBefore(o,i.display.lineSpace.firstChild);l.value=jo.text.join("\n");var u=I(n.ownerDocument);R(l);setTimeout(function(){i.display.lineSpace.removeChild(o);u.focus();if(u==n){r.showPrimarySelection()}},50)}ge(n,"copy",s);ge(n,"cut",s)};el.prototype.screenReaderLabelChanged=function(e){if(e){this.div.setAttribute("aria-label",e)}else{this.div.removeAttribute("aria-label")}};el.prototype.prepareSelection=function(){var e=Gi(this.cm,false);e.focus=I(this.div.ownerDocument)==this.div;return e};el.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length){return}if(e.focus||t){this.showPrimarySelection()}this.showMultipleSelections(e)};el.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};el.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary();var n=i.from(),a=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||a.line<t.display.viewFrom){e.removeAllRanges();return}var s=al(t,e.anchorNode,e.anchorOffset);var o=al(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&o&&!o.bad&&lt(ht(s,o),n)==0&&lt(ft(s,o),a)==0){return}var l=t.display.view;var u=n.line>=t.display.viewFrom&&tl(t,n)||{node:l[0].measure.map[2],offset:0};var c=a.line<t.display.viewTo&&tl(t,a);if(!c){var f=l[l.length-1].measure;var h=f.maps?f.maps[f.maps.length-1]:f.map;c={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(!u||!c){e.removeAllRanges();return}var p=e.rangeCount&&e.getRangeAt(0),d;try{d=_(u.node,u.offset,c.offset,c.node)}catch(e){}if(d){if(!r&&t.state.focused){e.collapse(u.node,u.offset);if(!d.collapsed){e.removeAllRanges();e.addRange(d)}}else{e.removeAllRanges();e.addRange(d)}if(p&&e.anchorNode==null){e.addRange(p)}else if(r){this.startGracePeriod()}}this.rememberSelection()};el.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){e.gracePeriod=false;if(e.selectionChanged()){e.cm.operation(function(){return e.cm.curOp.selectionChanged=true})}},20)};el.prototype.showMultipleSelections=function(e){E(this.cm.display.cursorDiv,e.cursors);E(this.cm.display.selectionDiv,e.selection)};el.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode;this.lastAnchorOffset=e.anchorOffset;this.lastFocusNode=e.focusNode;this.lastFocusOffset=e.focusOffset};el.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount){return false}var t=e.getRangeAt(0).commonAncestorContainer;return P(this.div,t)};el.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()||I(this.div.ownerDocument)!=this.div){this.showSelection(this.prepareSelection(),true)}this.div.focus()}};el.prototype.blur=function(){this.div.blur()};el.prototype.getField=function(){return this.div};el.prototype.supportsTouch=function(){return true};el.prototype.receivedFocus=function(){var e=this;var t=this;if(this.selectionInEditor()){setTimeout(function(){return e.pollSelection()},20)}else{In(this.cm,function(){return t.cm.curOp.selectionChanged=true})}function r(){if(t.cm.state.focused){t.pollSelection();t.polling.set(t.cm.options.pollInterval,r)}}this.polling.set(this.cm.options.pollInterval,r)};el.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset};el.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return}var e=this.getSelection(),t=this.cm;if(g&&c&&this.cm.display.gutterSpecs.length&&rl(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return}if(this.composing){return}this.rememberSelection();var r=al(t,e.anchorNode,e.anchorOffset);var i=al(t,e.focusNode,e.focusOffset);if(r&&i){In(t,function(){ja(t.doc,ua(r,i),q);if(r.bad||i.bad){t.curOp.selectionChanged=true}})}};el.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null}var e=this.cm,t=e.display,r=e.doc.sel.primary();var i=r.from(),n=r.to();if(i.ch==0&&i.line>e.firstLine()){i=ot(i.line-1,Je(e.doc,i.line-1).length)}if(n.ch==Je(e.doc,n.line).text.length&&n.line<e.lastLine()){n=ot(n.line+1,0)}if(i.line<t.viewFrom||n.line>t.viewTo-1){return false}var a,s,o;if(i.line==t.viewFrom||(a=Vi(e,i.line))==0){s=it(t.view[0].line);o=t.view[0].node}else{s=it(t.view[a].line);o=t.view[a-1].node.nextSibling}var l=Vi(e,n.line);var u,c;if(l==t.view.length-1){u=t.viewTo-1;c=t.lineDiv.lastChild}else{u=it(t.view[l+1].line)-1;c=t.view[l+1].node.previousSibling}if(!o){return false}var f=e.doc.splitLines(nl(e,o,c,s,u));var h=et(e.doc,ot(s,0),ot(u,Je(e.doc,u).text.length));while(f.length>1&&h.length>1){if(Z(f)==Z(h)){f.pop();h.pop();u--}else if(f[0]==h[0]){f.shift();h.shift();s++}else{break}}var p=0,d=0;var m=f[0],v=h[0],g=Math.min(m.length,v.length);while(p<g&&m.charCodeAt(p)==v.charCodeAt(p)){++p}var y=Z(f),x=Z(h);var b=Math.min(y.length-(f.length==1?p:0),x.length-(h.length==1?p:0));while(d<b&&y.charCodeAt(y.length-d-1)==x.charCodeAt(x.length-d-1)){++d}if(f.length==1&&h.length==1&&s==i.line){while(p&&p>i.ch&&y.charCodeAt(y.length-d-1)==x.charCodeAt(x.length-d-1)){p--;d++}}f[f.length-1]=y.slice(0,y.length-d).replace(/^\u200b+/,"");f[0]=f[0].slice(p).replace(/\u200b+$/,"");var w=ot(s,p);var k=ot(u,h.length?Z(h).length-d:0);if(f.length>1||f[0]||lt(w,k)){as(e.doc,f,w,k,"+input");return true}};el.prototype.ensurePolled=function(){this.forceCompositionEnd()};el.prototype.reset=function(){this.forceCompositionEnd()};el.prototype.forceCompositionEnd=function(){if(!this.composing){return}clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};el.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null){return}this.readDOMTimeout=setTimeout(function(){e.readDOMTimeout=null;if(e.composing){if(e.composing.done){e.composing=null}else{return}}e.updateFromDOM()},80)};el.prototype.updateFromDOM=function(){var e=this;if(this.cm.isReadOnly()||!this.pollContent()){In(this.cm,function(){return Fi(e.cm)})}};el.prototype.setUneditable=function(e){e.contentEditable="false"};el.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing){return}e.preventDefault();if(!this.cm.isReadOnly()){On(this.cm,Go)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)}};el.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")};el.prototype.onContextMenu=function(){};el.prototype.resetPosition=function(){};el.prototype.needsContentAttribute=true;function tl(e,t){var r=ri(e,t.line);if(!r||r.hidden){return null}var i=Je(e.doc,t.line);var n=Jr(r,i,t.line);var a=me(i,e.doc.direction),s="left";if(a){var o=pe(a,t.ch);s=o%2?"right":"left"}var l=si(n.map,t.ch,s);l.offset=l.collapse=="right"?l.end:l.start;return l}function rl(e){for(var t=e;t;t=t.parentNode){if(/CodeMirror-gutter-wrapper/.test(t.className)){return true}}return false}function il(e,t){if(t){e.bad=true}return e}function nl(e,t,r,i,n){var a="",s=false,o=e.doc.lineSeparator(),l=false;function u(e){return function(t){return t.id==e}}function c(){if(s){a+=o;if(l){a+=o}s=l=false}}function f(e){if(e){c();a+=e}}function h(t){if(t.nodeType==1){var r=t.getAttribute("cm-text");if(r){f(r);return}var a=t.getAttribute("cm-marker"),p;if(a){var d=e.findMarks(ot(i,0),ot(n+1,0),u(+a));if(d.length&&(p=d[0].find(0))){f(et(e.doc,p.from,p.to).join(o))}return}if(t.getAttribute("contenteditable")=="false"){return}var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&t.textContent.length==0){return}if(m){c()}for(var v=0;v<t.childNodes.length;v++){h(t.childNodes[v])}if(/^(pre|p)$/i.test(t.nodeName)){l=true}if(m){s=true}}else if(t.nodeType==3){f(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}}for(;;){h(t);if(t==r){break}t=t.nextSibling;l=false}return a}function al(e,t,r){var i;if(t==e.display.lineDiv){i=e.display.lineDiv.childNodes[r];if(!i){return il(e.clipPos(ot(e.display.viewTo-1)),true)}t=null;r=0}else{for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv){return null}if(i.parentNode&&i.parentNode==e.display.lineDiv){break}}}for(var n=0;n<e.display.view.length;n++){var a=e.display.view[n];if(a.node==i){return sl(a,t,r)}}}function sl(e,t,r){var i=e.text.firstChild,n=false;if(!t||!P(i,t)){return il(ot(it(e.line),0),true)}if(t==i){n=true;t=i.childNodes[r];r=0;if(!t){var a=e.rest?Z(e.rest):e.line;return il(ot(it(a),a.text.length),n)}}var s=t.nodeType==3?t:null,o=t;if(!s&&t.childNodes.length==1&&t.firstChild.nodeType==3){s=t.firstChild;if(r){r=s.nodeValue.length}}while(o.parentNode!=i){o=o.parentNode}var l=e.measure,u=l.maps;function c(t,r,i){for(var n=-1;n<(u?u.length:0);n++){var a=n<0?l.map:u[n];for(var s=0;s<a.length;s+=3){var o=a[s+2];if(o==t||o==r){var c=it(n<0?e.line:e.rest[n]);var f=a[s]+i;if(i<0||o!=t){f=a[s+(i?1:0)]}return ot(c,f)}}}}var f=c(s,o,r);if(f){return il(f,n)}for(var h=o.nextSibling,p=s?s.nodeValue.length-r:0;h;h=h.nextSibling){f=c(h,h.firstChild,0);if(f){return il(ot(f.line,f.ch-p),n)}else{p+=h.textContent.length}}for(var d=o.previousSibling,m=r;d;d=d.previousSibling){f=c(d,d.firstChild,-1);if(f){return il(ot(f.line,f.ch+m),n)}else{m+=d.textContent.length}}}var ol=function(e){this.cm=e;this.prevInput="";this.pollingFast=false;this.polling=new H;this.hasSelection=false;this.composing=null;this.resetting=false};ol.prototype.init=function(e){var t=this;var r=this,i=this.cm;this.createField(e);var n=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild);if(v){n.style.width="0px"}ge(n,"input",function(){if(s&&o>=9&&t.hasSelection){t.hasSelection=null}r.poll()});ge(n,"paste",function(e){if(we(i,e)||qo(e,i)){return}i.state.pasteIncoming=+new Date;r.fastPoll()});function a(e){if(we(i,e)){return}if(i.somethingSelected()){Uo({lineWise:false,text:i.getSelections()})}else if(!i.options.lineWiseCopyCut){return}else{var t=$o(i);Uo({lineWise:true,text:t.text});if(e.type=="cut"){i.setSelections(t.ranges,null,q)}else{r.prevInput="";n.value=t.text.join("\n");R(n)}}if(e.type=="cut"){i.state.cutIncoming=+new Date}}ge(n,"cut",a);ge(n,"copy",a);ge(e.scroller,"paste",function(t){if(Gr(e,t)||we(i,t)){return}if(!n.dispatchEvent){i.state.pasteIncoming=+new Date;r.focus();return}var a=new Event("paste");a.clipboardData=t.clipboardData;n.dispatchEvent(a)});ge(e.lineSpace,"selectstart",function(t){if(!Gr(e,t)){Le(t)}});ge(n,"compositionstart",function(){var e=i.getCursor("from");if(r.composing){r.composing.range.clear()}r.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}});ge(n,"compositionend",function(){if(r.composing){r.poll();r.composing.range.clear();r.composing=null}})};ol.prototype.createField=function(e){this.wrapper=Yo();this.textarea=this.wrapper.firstChild};ol.prototype.screenReaderLabelChanged=function(e){if(e){this.textarea.setAttribute("aria-label",e)}else{this.textarea.removeAttribute("aria-label")}};ol.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc;var i=Gi(e);if(e.options.moveInputWithCursor){var n=xi(e,r.sel.primary().head,"div");var a=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+s.top-a.top));i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+s.left-a.left))}return i};ol.prototype.showSelection=function(e){var t=this.cm,r=t.display;E(r.cursorDiv,e.cursors);E(r.selectionDiv,e.selection);if(e.teTop!=null){this.wrapper.style.top=e.teTop+"px";this.wrapper.style.left=e.teLeft+"px"}};ol.prototype.reset=function(e){if(this.contextMenuPending||this.composing&&e){return}var t=this.cm;this.resetting=true;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r;if(t.state.focused){R(this.textarea)}if(s&&o>=9){this.hasSelection=r}}else if(!e){this.prevInput=this.textarea.value="";if(s&&o>=9){this.hasSelection=null}}this.resetting=false};ol.prototype.getField=function(){return this.textarea};ol.prototype.supportsTouch=function(){return false};ol.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!y||I(this.textarea.ownerDocument)!=this.textarea)){try{this.textarea.focus()}catch(e){}}};ol.prototype.blur=function(){this.textarea.blur()};ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};ol.prototype.receivedFocus=function(){this.slowPoll()};ol.prototype.slowPoll=function(){var e=this;if(this.pollingFast){return}this.polling.set(this.cm.options.pollInterval,function(){e.poll();if(e.cm.state.focused){e.slowPoll()}})};ol.prototype.fastPoll=function(){var e=false,t=this;t.pollingFast=true;function r(){var i=t.poll();if(!i&&!e){e=true;t.polling.set(60,r)}else{t.pollingFast=false;t.slowPoll()}}t.polling.set(20,r)};ol.prototype.poll=function(){var e=this;var t=this.cm,r=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Ve(r)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq){return false}var n=r.value;if(n==i&&!t.somethingSelected()){return false}if(s&&o>=9&&this.hasSelection===n||x&&/[\uf700-\uf7ff]/.test(n)){t.display.input.reset();return false}if(t.doc.sel==t.display.selForContextMenu){var a=n.charCodeAt(0);if(a==8203&&!i){i="​"}if(a==8666){this.reset();return this.cm.execCommand("undo")}}var l=0,u=Math.min(i.length,n.length);while(l<u&&i.charCodeAt(l)==n.charCodeAt(l)){++l}In(t,function(){Go(t,n.slice(l),i.length-l,null,e.composing?"*compose":null);if(n.length>1e3||n.indexOf("\n")>-1){r.value=e.prevInput=""}else{e.prevInput=n}if(e.composing){e.composing.range.clear();e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"})}});return true};ol.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}};ol.prototype.onKeyPress=function(){if(s&&o>=9){this.hasSelection=null}this.fastPoll()};ol.prototype.onContextMenu=function(e){var t=this,r=t.cm,i=r.display,n=t.textarea;if(t.contextMenuPending){t.contextMenuPending()}var a=Ri(r,e),u=i.scroller.scrollTop;if(!a||h){return}var c=r.options.resetSelectionOnContextMenu;if(c&&r.doc.sel.contains(a)==-1){On(r,ja)(r.doc,ua(a),q)}var f=n.style.cssText,p=t.wrapper.style.cssText;var d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static";n.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px;\n      z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var m;if(l){m=n.ownerDocument.defaultView.scrollY}i.input.focus();if(l){n.ownerDocument.defaultView.scrollTo(null,m)}i.input.reset();if(!r.somethingSelected()){n.value=t.prevInput=" "}t.contextMenuPending=g;i.selForContextMenu=r.doc.sel;clearTimeout(i.detectingSelectAll);function v(){if(n.selectionStart!=null){var e=r.somethingSelected();var a="​"+(e?n.value:"");n.value="⇚";n.value=a;t.prevInput=e?"":"​";n.selectionStart=1;n.selectionEnd=a.length;i.selForContextMenu=r.doc.sel}}function g(){if(t.contextMenuPending!=g){return}t.contextMenuPending=false;t.wrapper.style.cssText=p;n.style.cssText=f;if(s&&o<9){i.scrollbars.setScrollTop(i.scroller.scrollTop=u)}if(n.selectionStart!=null){if(!s||s&&o<9){v()}var e=0,a=function(){if(i.selForContextMenu==r.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="​"){On(r,Qa)(r)}else if(e++<10){i.detectingSelectAll=setTimeout(a,500)}else{i.selForContextMenu=null;i.input.reset()}};i.detectingSelectAll=setTimeout(a,200)}}if(s&&o>=9){v()}if(S){Ee(e);var y=function(){xe(window,"mouseup",y);setTimeout(g,20)};ge(window,"mouseup",y)}else{setTimeout(g,50)}};ol.prototype.readOnlyChanged=function(e){if(!e){this.reset()}this.textarea.disabled=e=="nocursor";this.textarea.readOnly=!!e};ol.prototype.setUneditable=function(){};ol.prototype.needsContentAttribute=false;function ll(e,t){t=t?W(t):{};t.value=e.value;if(!t.tabindex&&e.tabIndex){t.tabindex=e.tabIndex}if(!t.placeholder&&e.placeholder){t.placeholder=e.placeholder}if(t.autofocus==null){var r=I(e.ownerDocument);t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function i(){e.value=o.getValue()}var n;if(e.form){ge(e.form,"submit",i);if(!t.leaveSubmitMethodAlone){var a=e.form;n=a.submit;try{var s=a.submit=function(){i();a.submit=n;a.submit();a.submit=s}}catch(e){}}}t.finishInit=function(r){r.save=i;r.getTextArea=function(){return e};r.toTextArea=function(){r.toTextArea=isNaN;i();e.parentNode.removeChild(r.getWrapperElement());e.style.display="";if(e.form){xe(e.form,"submit",i);if(!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"){e.form.submit=n}}}};e.style.display="none";var o=zo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return o}function ul(e){e.off=xe;e.on=ge;e.wheelEventPixels=na;e.Doc=Ss;e.splitLines=Re;e.countColumn=B;e.findColumn=X;e.isWordChar=ne;e.Pass=G;e.signal=be;e.Line=cr;e.changeEnd=ca;e.scrollbarModel=kn;e.Pos=ot;e.cmpPos=lt;e.modes=Be;e.mimeModes=He;e.resolveMode=Ge;e.getMode=qe;e.modeExtensions=Ke;e.extendMode=$e;e.copyState=Xe;e.startState=Qe;e.innerMode=Ye;e.commands=Zs;e.keyMap=zs;e.keyName=Gs;e.isModifierKey=js;e.lookupKey=Hs;e.normalizeKeyMap=Bs;e.StringStream=Ze;e.SharedTextMarker=ys;e.TextMarker=vs;e.LineWidget=hs;e.e_preventDefault=Le;e.e_stopPropagation=Te;e.e_stop=Ee;e.addClass=O;e.contains=P;e.rmClass=T;e.keyNames=Ds}Ro(zo);Qo(zo);var cl="iter insert remove copy getEditor constructor".split(" ");for(var fl in Ss.prototype){if(Ss.prototype.hasOwnProperty(fl)&&j(cl,fl)<0){zo.prototype[fl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ss.prototype[fl])}}Se(Ss);zo.inputStyles={textarea:ol,contenteditable:el};zo.defineMode=function(e){if(!zo.defaults.mode&&e!="null"){zo.defaults.mode=e}je.apply(this,arguments)};zo.defineMIME=Ue;zo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}});zo.defineMIME("text/plain","null");zo.defineExtension=function(e,t){zo.prototype[e]=t};zo.defineDocExtension=function(e,t){Ss.prototype[e]=t};zo.fromTextArea=ll;ul(zo);zo.version="5.65.9";return zo});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("javascript",function(t,r){var i=t.indentUnit;var n=r.statementIndent;var a=r.jsonld;var s=r.json||a;var o=r.trackScope!==false;var l=r.typescript;var u=r.wordCharacters||/[\w$\xa1-\uffff]/;var c=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),i=e("keyword c"),n=e("keyword d");var a=e("operator"),s={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:i,void:i,throw:i,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:a,typeof:a,instanceof:a,true:s,false:s,null:s,undefined:s,NaN:s,Infinity:s,this:e("this"),class:e("class"),super:e("atom"),yield:i,export:e("export"),import:e("import"),extends:i,await:i}}();var f=/[+\-*&%=<>!?|~^@]/;var h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function p(e){var t=false,r,i=false;while((r=e.next())!=null){if(!t){if(r=="/"&&!i)return;if(r=="[")i=true;else if(i&&r=="]")i=false}t=!t&&r=="\\"}}var d,m;function v(e,t,r){d=e;m=r;return t}function g(e,t){var r=e.next();if(r=='"'||r=="'"){t.tokenize=y(r);return t.tokenize(e,t)}else if(r=="."&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)){return v("number","number")}else if(r=="."&&e.match("..")){return v("spread","meta")}else if(/[\[\]{}\(\),;\:\.]/.test(r)){return v(r)}else if(r=="="&&e.eat(">")){return v("=>","operator")}else if(r=="0"&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)){return v("number","number")}else if(/\d/.test(r)){e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);return v("number","number")}else if(r=="/"){if(e.eat("*")){t.tokenize=x;return x(e,t)}else if(e.eat("/")){e.skipToEnd();return v("comment","comment")}else if(nt(e,t,1)){p(e);e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);return v("regexp","string-2")}else{e.eat("=");return v("operator","operator",e.current())}}else if(r=="`"){t.tokenize=b;return b(e,t)}else if(r=="#"&&e.peek()=="!"){e.skipToEnd();return v("meta","meta")}else if(r=="#"&&e.eatWhile(u)){return v("variable","property")}else if(r=="<"&&e.match("!--")||r=="-"&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start))){e.skipToEnd();return v("comment","comment")}else if(f.test(r)){if(r!=">"||!t.lexical||t.lexical.type!=">"){if(e.eat("=")){if(r=="!"||r=="=")e.eat("=")}else if(/[<>*+\-|&?]/.test(r)){e.eat(r);if(r==">")e.eat(r)}}if(r=="?"&&e.eat("."))return v(".");return v("operator","operator",e.current())}else if(u.test(r)){e.eatWhile(u);var i=e.current();if(t.lastType!="."){if(c.propertyIsEnumerable(i)){var n=c[i];return v(n.type,n.style,i)}if(i=="async"&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,false))return v("async","keyword",i)}return v("variable","variable",i)}}function y(e){return function(t,r){var i=false,n;if(a&&t.peek()=="@"&&t.match(h)){r.tokenize=g;return v("jsonld-keyword","meta")}while((n=t.next())!=null){if(n==e&&!i)break;i=!i&&n=="\\"}if(!i)r.tokenize=g;return v("string","string")}}function x(e,t){var r=false,i;while(i=e.next()){if(i=="/"&&r){t.tokenize=g;break}r=i=="*"}return v("comment","comment")}function b(e,t){var r=false,i;while((i=e.next())!=null){if(!r&&(i=="`"||i=="$"&&e.eat("{"))){t.tokenize=g;break}r=!r&&i=="\\"}return v("quasi","string-2",e.current())}var w="([{}])";function k(e,t){if(t.fatArrowAt)t.fatArrowAt=null;var r=e.string.indexOf("=>",e.start);if(r<0)return;if(l){var i=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));if(i)r=i.index}var n=0,a=false;for(var s=r-1;s>=0;--s){var o=e.string.charAt(s);var c=w.indexOf(o);if(c>=0&&c<3){if(!n){++s;break}if(--n==0){if(o=="(")a=true;break}}else if(c>=3&&c<6){++n}else if(u.test(o)){a=true}else if(/["'\/`]/.test(o)){for(;;--s){if(s==0)return;var f=e.string.charAt(s-1);if(f==o&&e.string.charAt(s-2)!="\\"){s--;break}}}else if(a&&!n){++s;break}}if(a&&!n)t.fatArrowAt=s}var C={atom:true,number:true,variable:true,string:true,regexp:true,this:true,import:true,"jsonld-keyword":true};function S(e,t,r,i,n,a){this.indented=e;this.column=t;this.type=r;this.prev=n;this.info=a;if(i!=null)this.align=i}function L(e,t){if(!o)return false;for(var r=e.localVars;r;r=r.next)if(r.name==t)return true;for(var i=e.context;i;i=i.prev){for(var r=i.vars;r;r=r.next)if(r.name==t)return true}}function T(e,t,r,i,n){var a=e.cc;A.state=e;A.stream=n;A.marked=null,A.cc=a;A.style=t;if(!e.lexical.hasOwnProperty("align"))e.lexical.align=true;while(true){var o=a.length?a.pop():s?G:j;if(o(r,i)){while(a.length&&a[a.length-1].lex)a.pop()();if(A.marked)return A.marked;if(r=="variable"&&L(e,i))return"variable-2";return t}}}var A={state:null,column:null,marked:null,cc:null};function E(){for(var e=arguments.length-1;e>=0;e--)A.cc.push(arguments[e])}function M(){E.apply(null,arguments);return true}function N(e,t){for(var r=t;r;r=r.next)if(r.name==e)return true;return false}function _(e){var t=A.state;A.marked="def";if(!o)return;if(t.context){if(t.lexical.info=="var"&&t.context&&t.context.block){var i=P(e,t.context);if(i!=null){t.context=i;return}}else if(!N(e,t.localVars)){t.localVars=new D(e,t.localVars);return}}if(r.globalVars&&!N(e,t.globalVars))t.globalVars=new D(e,t.globalVars)}function P(e,t){if(!t){return null}else if(t.block){var r=P(e,t.prev);if(!r)return null;if(r==t.prev)return t;return new O(r,t.vars,true)}else if(N(e,t.vars)){return t}else{return new O(t.prev,new D(e,t.vars),false)}}function I(e){return e=="public"||e=="private"||e=="protected"||e=="abstract"||e=="readonly"}function O(e,t,r){this.prev=e;this.vars=t;this.block=r}function D(e,t){this.name=e;this.next=t}var R=new D("this",new D("arguments",null));function V(){A.state.context=new O(A.state.context,A.state.localVars,false);A.state.localVars=R}function F(){A.state.context=new O(A.state.context,A.state.localVars,true);A.state.localVars=null}V.lex=F.lex=true;function z(){A.state.localVars=A.state.context.vars;A.state.context=A.state.context.prev}z.lex=true;function W(e,t){var r=function(){var r=A.state,i=r.indented;if(r.lexical.type=="stat")i=r.lexical.indented;else for(var n=r.lexical;n&&n.type==")"&&n.align;n=n.prev)i=n.indented;r.lexical=new S(i,A.stream.column(),e,null,r.lexical,t)};r.lex=true;return r}function B(){var e=A.state;if(e.lexical.prev){if(e.lexical.type==")")e.indented=e.lexical.indented;e.lexical=e.lexical.prev}}B.lex=true;function H(e){function t(r){if(r==e)return M();else if(e==";"||r=="}"||r==")"||r=="]")return E();else return M(t)}return t}function j(e,t){if(e=="var")return M(W("vardef",t),Ee,H(";"),B);if(e=="keyword a")return M(W("form"),K,j,B);if(e=="keyword b")return M(W("form"),j,B);if(e=="keyword d")return A.stream.match(/^\s*$/,false)?M():M(W("stat"),X,H(";"),B);if(e=="debugger")return M(H(";"));if(e=="{")return M(W("}"),F,he,B,z);if(e==";")return M();if(e=="if"){if(A.state.lexical.info=="else"&&A.state.cc[A.state.cc.length-1]==B)A.state.cc.pop()();return M(W("form"),K,j,B,Oe)}if(e=="function")return M(Fe);if(e=="for")return M(W("form"),F,De,j,z,B);if(e=="class"||l&&t=="interface"){A.marked="keyword";return M(W("form",e=="class"?e:t),je,B)}if(e=="variable"){if(l&&t=="declare"){A.marked="keyword";return M(j)}else if(l&&(t=="module"||t=="enum"||t=="type")&&A.stream.match(/^\s*\w/,false)){A.marked="keyword";if(t=="enum")return M(tt);else if(t=="type")return M(We,H("operator"),ge,H(";"));else return M(W("form"),Me,H("{"),W("}"),he,B,B)}else if(l&&t=="namespace"){A.marked="keyword";return M(W("form"),G,j,B)}else if(l&&t=="abstract"){A.marked="keyword";return M(j)}else{return M(W("stat"),ae)}}if(e=="switch")return M(W("form"),K,H("{"),W("}","switch"),F,he,B,B,z);if(e=="case")return M(G,H(":"));if(e=="default")return M(H(":"));if(e=="catch")return M(W("form"),V,U,j,B,z);if(e=="export")return M(W("stat"),Ke,B);if(e=="import")return M(W("stat"),Xe,B);if(e=="async")return M(j);if(t=="@")return M(G,j);return E(W("stat"),G,H(";"),B)}function U(e){if(e=="(")return M(Be,H(")"))}function G(e,t){return $(e,t,false)}function q(e,t){return $(e,t,true)}function K(e){if(e!="(")return E();return M(W(")"),X,H(")"),B)}function $(e,t,r){if(A.state.fatArrowAt==A.stream.start){var i=r?te:ee;if(e=="(")return M(V,W(")"),ce(Be,")"),B,H("=>"),i,z);else if(e=="variable")return E(V,Me,H("=>"),i,z)}var n=r?Q:Y;if(C.hasOwnProperty(e))return M(n);if(e=="function")return M(Fe,n);if(e=="class"||l&&t=="interface"){A.marked="keyword";return M(W("form"),He,B)}if(e=="keyword c"||e=="async")return M(r?q:G);if(e=="(")return M(W(")"),X,H(")"),B,n);if(e=="operator"||e=="spread")return M(r?q:G);if(e=="[")return M(W("]"),et,B,n);if(e=="{")return fe(oe,"}",null,n);if(e=="quasi")return E(Z,n);if(e=="new")return M(re(r));return M()}function X(e){if(e.match(/[;\}\)\],]/))return E();return E(G)}function Y(e,t){if(e==",")return M(X);return Q(e,t,false)}function Q(e,t,r){var i=r==false?Y:Q;var n=r==false?G:q;if(e=="=>")return M(V,r?te:ee,z);if(e=="operator"){if(/\+\+|--/.test(t)||l&&t=="!")return M(i);if(l&&t=="<"&&A.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,false))return M(W(">"),ce(ge,">"),B,i);if(t=="?")return M(G,H(":"),n);return M(n)}if(e=="quasi"){return E(Z,i)}if(e==";")return;if(e=="(")return fe(q,")","call",i);if(e==".")return M(se,i);if(e=="[")return M(W("]"),X,H("]"),B,i);if(l&&t=="as"){A.marked="keyword";return M(ge,i)}if(e=="regexp"){A.state.lastType=A.marked="operator";A.stream.backUp(A.stream.pos-A.stream.start-1);return M(n)}}function Z(e,t){if(e!="quasi")return E();if(t.slice(t.length-2)!="${")return M(Z);return M(X,J)}function J(e){if(e=="}"){A.marked="string-2";A.state.tokenize=b;return M(Z)}}function ee(e){k(A.stream,A.state);return E(e=="{"?j:G)}function te(e){k(A.stream,A.state);return E(e=="{"?j:q)}function re(e){return function(t){if(t==".")return M(e?ne:ie);else if(t=="variable"&&l)return M(Le,e?Q:Y);else return E(e?q:G)}}function ie(e,t){if(t=="target"){A.marked="keyword";return M(Y)}}function ne(e,t){if(t=="target"){A.marked="keyword";return M(Q)}}function ae(e){if(e==":")return M(B,j);return E(Y,H(";"),B)}function se(e){if(e=="variable"){A.marked="property";return M()}}function oe(e,t){if(e=="async"){A.marked="property";return M(oe)
}else if(e=="variable"||A.style=="keyword"){A.marked="property";if(t=="get"||t=="set")return M(le);var r;if(l&&A.state.fatArrowAt==A.stream.start&&(r=A.stream.match(/^\s*:\s*/,false)))A.state.fatArrowAt=A.stream.pos+r[0].length;return M(ue)}else if(e=="number"||e=="string"){A.marked=a?"property":A.style+" property";return M(ue)}else if(e=="jsonld-keyword"){return M(ue)}else if(l&&I(t)){A.marked="keyword";return M(oe)}else if(e=="["){return M(G,pe,H("]"),ue)}else if(e=="spread"){return M(q,ue)}else if(t=="*"){A.marked="keyword";return M(oe)}else if(e==":"){return E(ue)}}function le(e){if(e!="variable")return E(ue);A.marked="property";return M(Fe)}function ue(e){if(e==":")return M(q);if(e=="(")return E(Fe)}function ce(e,t,r){function i(n,a){if(r?r.indexOf(n)>-1:n==","){var s=A.state.lexical;if(s.info=="call")s.pos=(s.pos||0)+1;return M(function(r,i){if(r==t||i==t)return E();return E(e)},i)}if(n==t||a==t)return M();if(r&&r.indexOf(";")>-1)return E(e);return M(H(t))}return function(r,n){if(r==t||n==t)return M();return E(e,i)}}function fe(e,t,r){for(var i=3;i<arguments.length;i++)A.cc.push(arguments[i]);return M(W(t,r),ce(e,t),B)}function he(e){if(e=="}")return M();return E(j,he)}function pe(e,t){if(l){if(e==":")return M(ge);if(t=="?")return M(pe)}}function de(e,t){if(l&&(e==":"||t=="in"))return M(ge)}function me(e){if(l&&e==":"){if(A.stream.match(/^\s*\w+\s+is\b/,false))return M(G,ve,ge);else return M(ge)}}function ve(e,t){if(t=="is"){A.marked="keyword";return M()}}function ge(e,t){if(t=="keyof"||t=="typeof"||t=="infer"||t=="readonly"){A.marked="keyword";return M(t=="typeof"?q:ge)}if(e=="variable"||t=="void"){A.marked="type";return M(Se)}if(t=="|"||t=="&")return M(ge);if(e=="string"||e=="number"||e=="atom")return M(Se);if(e=="[")return M(W("]"),ce(ge,"]",","),B,Se);if(e=="{")return M(W("}"),xe,B,Se);if(e=="(")return M(ce(Ce,")"),ye,Se);if(e=="<")return M(ce(ge,">"),ge);if(e=="quasi"){return E(we,Se)}}function ye(e){if(e=="=>")return M(ge)}function xe(e){if(e.match(/[\}\)\]]/))return M();if(e==","||e==";")return M(xe);return E(be,xe)}function be(e,t){if(e=="variable"||A.style=="keyword"){A.marked="property";return M(be)}else if(t=="?"||e=="number"||e=="string"){return M(be)}else if(e==":"){return M(ge)}else if(e=="["){return M(H("variable"),de,H("]"),be)}else if(e=="("){return E(ze,be)}else if(!e.match(/[;\}\)\],]/)){return M()}}function we(e,t){if(e!="quasi")return E();if(t.slice(t.length-2)!="${")return M(we);return M(ge,ke)}function ke(e){if(e=="}"){A.marked="string-2";A.state.tokenize=b;return M(we)}}function Ce(e,t){if(e=="variable"&&A.stream.match(/^\s*[?:]/,false)||t=="?")return M(Ce);if(e==":")return M(ge);if(e=="spread")return M(Ce);return E(ge)}function Se(e,t){if(t=="<")return M(W(">"),ce(ge,">"),B,Se);if(t=="|"||e=="."||t=="&")return M(ge);if(e=="[")return M(ge,H("]"),Se);if(t=="extends"||t=="implements"){A.marked="keyword";return M(ge)}if(t=="?")return M(ge,H(":"),ge)}function Le(e,t){if(t=="<")return M(W(">"),ce(ge,">"),B,Se)}function Te(){return E(ge,Ae)}function Ae(e,t){if(t=="=")return M(ge)}function Ee(e,t){if(t=="enum"){A.marked="keyword";return M(tt)}return E(Me,pe,Pe,Ie)}function Me(e,t){if(l&&I(t)){A.marked="keyword";return M(Me)}if(e=="variable"){_(t);return M()}if(e=="spread")return M(Me);if(e=="[")return fe(_e,"]");if(e=="{")return fe(Ne,"}")}function Ne(e,t){if(e=="variable"&&!A.stream.match(/^\s*:/,false)){_(t);return M(Pe)}if(e=="variable")A.marked="property";if(e=="spread")return M(Me);if(e=="}")return E();if(e=="[")return M(G,H("]"),H(":"),Ne);return M(H(":"),Me,Pe)}function _e(){return E(Me,Pe)}function Pe(e,t){if(t=="=")return M(q)}function Ie(e){if(e==",")return M(Ee)}function Oe(e,t){if(e=="keyword b"&&t=="else")return M(W("form","else"),j,B)}function De(e,t){if(t=="await")return M(De);if(e=="(")return M(W(")"),Re,B)}function Re(e){if(e=="var")return M(Ee,Ve);if(e=="variable")return M(Ve);return E(Ve)}function Ve(e,t){if(e==")")return M();if(e==";")return M(Ve);if(t=="in"||t=="of"){A.marked="keyword";return M(G,Ve)}return E(G,Ve)}function Fe(e,t){if(t=="*"){A.marked="keyword";return M(Fe)}if(e=="variable"){_(t);return M(Fe)}if(e=="(")return M(V,W(")"),ce(Be,")"),B,me,j,z);if(l&&t=="<")return M(W(">"),ce(Te,">"),B,Fe)}function ze(e,t){if(t=="*"){A.marked="keyword";return M(ze)}if(e=="variable"){_(t);return M(ze)}if(e=="(")return M(V,W(")"),ce(Be,")"),B,me,z);if(l&&t=="<")return M(W(">"),ce(Te,">"),B,ze)}function We(e,t){if(e=="keyword"||e=="variable"){A.marked="type";return M(We)}else if(t=="<"){return M(W(">"),ce(Te,">"),B)}}function Be(e,t){if(t=="@")M(G,Be);if(e=="spread")return M(Be);if(l&&I(t)){A.marked="keyword";return M(Be)}if(l&&e=="this")return M(pe,Pe);return E(Me,pe,Pe)}function He(e,t){if(e=="variable")return je(e,t);return Ue(e,t)}function je(e,t){if(e=="variable"){_(t);return M(Ue)}}function Ue(e,t){if(t=="<")return M(W(">"),ce(Te,">"),B,Ue);if(t=="extends"||t=="implements"||l&&e==","){if(t=="implements")A.marked="keyword";return M(l?ge:G,Ue)}if(e=="{")return M(W("}"),Ge,B)}function Ge(e,t){if(e=="async"||e=="variable"&&(t=="static"||t=="get"||t=="set"||l&&I(t))&&A.stream.match(/^\s+[\w$\xa1-\uffff]/,false)){A.marked="keyword";return M(Ge)}if(e=="variable"||A.style=="keyword"){A.marked="property";return M(qe,Ge)}if(e=="number"||e=="string")return M(qe,Ge);if(e=="[")return M(G,pe,H("]"),qe,Ge);if(t=="*"){A.marked="keyword";return M(Ge)}if(l&&e=="(")return E(ze,Ge);if(e==";"||e==",")return M(Ge);if(e=="}")return M();if(t=="@")return M(G,Ge)}function qe(e,t){if(t=="!")return M(qe);if(t=="?")return M(qe);if(e==":")return M(ge,Pe);if(t=="=")return M(q);var r=A.state.lexical.prev,i=r&&r.info=="interface";return E(i?ze:Fe)}function Ke(e,t){if(t=="*"){A.marked="keyword";return M(Je,H(";"))}if(t=="default"){A.marked="keyword";return M(G,H(";"))}if(e=="{")return M(ce($e,"}"),Je,H(";"));return E(j)}function $e(e,t){if(t=="as"){A.marked="keyword";return M(H("variable"))}if(e=="variable")return E(q,$e)}function Xe(e){if(e=="string")return M();if(e=="(")return E(G);if(e==".")return E(Y);return E(Ye,Qe,Je)}function Ye(e,t){if(e=="{")return fe(Ye,"}");if(e=="variable")_(t);if(t=="*")A.marked="keyword";return M(Ze)}function Qe(e){if(e==",")return M(Ye,Qe)}function Ze(e,t){if(t=="as"){A.marked="keyword";return M(Ye)}}function Je(e,t){if(t=="from"){A.marked="keyword";return M(G)}}function et(e){if(e=="]")return M();return E(ce(q,"]"))}function tt(){return E(W("form"),Me,H("{"),W("}"),ce(rt,"}"),B,B)}function rt(){return E(Me,Pe)}function it(e,t){return e.lastType=="operator"||e.lastType==","||f.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function nt(e,t,r){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||t.lastType=="quasi"&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return{startState:function(e){var t={tokenize:g,lastType:"sof",cc:[],lexical:new S((e||0)-i,0,"block",false),localVars:r.localVars,context:r.localVars&&new O(null,null,false),indented:e||0};if(r.globalVars&&typeof r.globalVars=="object")t.globalVars=r.globalVars;return t},token:function(e,t){if(e.sol()){if(!t.lexical.hasOwnProperty("align"))t.lexical.align=false;t.indented=e.indentation();k(e,t)}if(t.tokenize!=x&&e.eatSpace())return null;var r=t.tokenize(e,t);if(d=="comment")return r;t.lastType=d=="operator"&&(m=="++"||m=="--")?"incdec":d;return T(t,r,d,m,e)},indent:function(t,a){if(t.tokenize==x||t.tokenize==b)return e.Pass;if(t.tokenize!=g)return 0;var s=a&&a.charAt(0),o=t.lexical,l;if(!/^\s*else\b/.test(a))for(var u=t.cc.length-1;u>=0;--u){var c=t.cc[u];if(c==B)o=o.prev;else if(c!=Oe&&c!=z)break}while((o.type=="stat"||o.type=="form")&&(s=="}"||(l=t.cc[t.cc.length-1])&&(l==Y||l==Q)&&!/^[,\.=+\-*:?[\(]/.test(a)))o=o.prev;if(n&&o.type==")"&&o.prev.type=="stat")o=o.prev;var f=o.type,h=s==f;if(f=="vardef")return o.indented+(t.lastType=="operator"||t.lastType==","?o.info.length+1:0);else if(f=="form"&&s=="{")return o.indented;else if(f=="form")return o.indented+i;else if(f=="stat")return o.indented+(it(t,a)?n||i:0);else if(o.info=="switch"&&!h&&r.doubleIndentSwitch!=false)return o.indented+(/^(?:case|default)\b/.test(a)?i:2*i);else if(o.align)return o.column+(h?0:1);else return o.indented+(h?0:i)},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:nt,skipExpression:function(t){T(t,"atom","atom","true",new e.StringStream("",2,null))}}});e.registerHelper("wordChars","javascript",/[\w$]/);e.defineMIME("text/javascript","javascript");e.defineMIME("text/ecmascript","javascript");e.defineMIME("application/javascript","javascript");e.defineMIME("application/x-javascript","javascript");e.defineMIME("application/ecmascript","javascript");e.defineMIME("application/json",{name:"javascript",json:true});e.defineMIME("application/x-json",{name:"javascript",json:true});e.defineMIME("application/manifest+json",{name:"javascript",json:true});e.defineMIME("application/ld+json",{name:"javascript",jsonld:true});e.defineMIME("text/typescript",{name:"javascript",typescript:true});e.defineMIME("application/typescript",{name:"javascript",typescript:true})});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("css",function(t,r){var i=r.inline;if(!r.propertyKeywords)r=e.resolveMode("text/css");var n=t.indentUnit,a=r.tokenHooks,s=r.documentTypes||{},o=r.mediaTypes||{},l=r.mediaFeatures||{},u=r.mediaValueKeywords||{},c=r.propertyKeywords||{},f=r.nonStandardPropertyKeywords||{},h=r.fontProperties||{},p=r.counterDescriptors||{},d=r.colorKeywords||{},m=r.valueKeywords||{},v=r.allowNested,g=r.lineComment,y=r.supportsAtComponent===true,x=t.highlightNonStandardPropertyKeywords!==false;var b,w;function k(e,t){b=t;return e}function C(e,t){var r=e.next();if(a[r]){var i=a[r](e,t);if(i!==false)return i}if(r=="@"){e.eatWhile(/[\w\\\-]/);return k("def",e.current())}else if(r=="="||(r=="~"||r=="|")&&e.eat("=")){return k(null,"compare")}else if(r=='"'||r=="'"){t.tokenize=S(r);return t.tokenize(e,t)}else if(r=="#"){e.eatWhile(/[\w\\\-]/);return k("atom","hash")}else if(r=="!"){e.match(/^\s*\w*/);return k("keyword","important")}else if(/\d/.test(r)||r=="."&&e.eat(/\d/)){e.eatWhile(/[\w.%]/);return k("number","unit")}else if(r==="-"){if(/[\d.]/.test(e.peek())){e.eatWhile(/[\w.%]/);return k("number","unit")}else if(e.match(/^-[\w\\\-]*/)){e.eatWhile(/[\w\\\-]/);if(e.match(/^\s*:/,false))return k("variable-2","variable-definition");return k("variable-2","variable")}else if(e.match(/^\w+-/)){return k("meta","meta")}}else if(/[,+>*\/]/.test(r)){return k(null,"select-op")}else if(r=="."&&e.match(/^-?[_a-z][_a-z0-9-]*/i)){return k("qualifier","qualifier")}else if(/[:;{}\[\]\(\)]/.test(r)){return k(null,r)}else if(e.match(/^[\w-.]+(?=\()/)){if(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())){t.tokenize=L}return k("variable callee","variable")}else if(/[\w\\\-]/.test(r)){e.eatWhile(/[\w\\\-]/);return k("property","word")}else{return k(null,null)}}function S(e){return function(t,r){var i=false,n;while((n=t.next())!=null){if(n==e&&!i){if(e==")")t.backUp(1);break}i=!i&&n=="\\"}if(n==e||!i&&e!=")")r.tokenize=null;return k("string","string")}}function L(e,t){e.next();if(!e.match(/^\s*[\"\')]/,false))t.tokenize=S(")");else t.tokenize=null;return k(null,"(")}function T(e,t,r){this.type=e;this.indent=t;this.prev=r}function A(e,t,r,i){e.context=new T(r,t.indentation()+(i===false?0:n),e.context);return r}function E(e){if(e.context.prev)e.context=e.context.prev;return e.context.type}function M(e,t,r){return P[r.context.type](e,t,r)}function N(e,t,r,i){for(var n=i||1;n>0;n--)r.context=r.context.prev;return M(e,t,r)}function _(e){var t=e.current().toLowerCase();if(m.hasOwnProperty(t))w="atom";else if(d.hasOwnProperty(t))w="keyword";else w="variable"}var P={};P.top=function(e,t,r){if(e=="{"){return A(r,t,"block")}else if(e=="}"&&r.context.prev){return E(r)}else if(y&&/@component/i.test(e)){return A(r,t,"atComponentBlock")}else if(/^@(-moz-)?document$/i.test(e)){return A(r,t,"documentTypes")}else if(/^@(media|supports|(-moz-)?document|import)$/i.test(e)){return A(r,t,"atBlock")}else if(/^@(font-face|counter-style)/i.test(e)){r.stateArg=e;return"restricted_atBlock_before"}else if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e)){return"keyframes"}else if(e&&e.charAt(0)=="@"){return A(r,t,"at")}else if(e=="hash"){w="builtin"}else if(e=="word"){w="tag"}else if(e=="variable-definition"){return"maybeprop"}else if(e=="interpolation"){return A(r,t,"interpolation")}else if(e==":"){return"pseudo"}else if(v&&e=="("){return A(r,t,"parens")}return r.context.type};P.block=function(e,t,r){if(e=="word"){var i=t.current().toLowerCase();if(c.hasOwnProperty(i)){w="property";return"maybeprop"}else if(f.hasOwnProperty(i)){w=x?"string-2":"property";return"maybeprop"}else if(v){w=t.match(/^\s*:(?:\s|$)/,false)?"property":"tag";return"block"}else{w+=" error";return"maybeprop"}}else if(e=="meta"){return"block"}else if(!v&&(e=="hash"||e=="qualifier")){w="error";return"block"}else{return P.top(e,t,r)}};P.maybeprop=function(e,t,r){if(e==":")return A(r,t,"prop");return M(e,t,r)};P.prop=function(e,t,r){if(e==";")return E(r);if(e=="{"&&v)return A(r,t,"propBlock");if(e=="}"||e=="{")return N(e,t,r);if(e=="(")return A(r,t,"parens");if(e=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current())){w+=" error"}else if(e=="word"){_(t)}else if(e=="interpolation"){return A(r,t,"interpolation")}return"prop"};P.propBlock=function(e,t,r){if(e=="}")return E(r);if(e=="word"){w="property";return"maybeprop"}return r.context.type};P.parens=function(e,t,r){if(e=="{"||e=="}")return N(e,t,r);if(e==")")return E(r);if(e=="(")return A(r,t,"parens");if(e=="interpolation")return A(r,t,"interpolation");if(e=="word")_(t);return"parens"};P.pseudo=function(e,t,r){if(e=="meta")return"pseudo";if(e=="word"){w="variable-3";return r.context.type}return M(e,t,r)};P.documentTypes=function(e,t,r){if(e=="word"&&s.hasOwnProperty(t.current())){w="tag";return r.context.type}else{return P.atBlock(e,t,r)}};P.atBlock=function(e,t,r){if(e=="(")return A(r,t,"atBlock_parens");if(e=="}"||e==";")return N(e,t,r);if(e=="{")return E(r)&&A(r,t,v?"block":"top");if(e=="interpolation")return A(r,t,"interpolation");if(e=="word"){var i=t.current().toLowerCase();if(i=="only"||i=="not"||i=="and"||i=="or")w="keyword";else if(o.hasOwnProperty(i))w="attribute";else if(l.hasOwnProperty(i))w="property";else if(u.hasOwnProperty(i))w="keyword";else if(c.hasOwnProperty(i))w="property";else if(f.hasOwnProperty(i))w=x?"string-2":"property";else if(m.hasOwnProperty(i))w="atom";else if(d.hasOwnProperty(i))w="keyword";else w="error"}return r.context.type};P.atComponentBlock=function(e,t,r){if(e=="}")return N(e,t,r);if(e=="{")return E(r)&&A(r,t,v?"block":"top",false);if(e=="word")w="error";return r.context.type};P.atBlock_parens=function(e,t,r){if(e==")")return E(r);if(e=="{"||e=="}")return N(e,t,r,2);return P.atBlock(e,t,r)};P.restricted_atBlock_before=function(e,t,r){if(e=="{")return A(r,t,"restricted_atBlock");if(e=="word"&&r.stateArg=="@counter-style"){w="variable";return"restricted_atBlock_before"}return M(e,t,r)};P.restricted_atBlock=function(e,t,r){if(e=="}"){r.stateArg=null;return E(r)}if(e=="word"){if(r.stateArg=="@font-face"&&!h.hasOwnProperty(t.current().toLowerCase())||r.stateArg=="@counter-style"&&!p.hasOwnProperty(t.current().toLowerCase()))w="error";else w="property";return"maybeprop"}return"restricted_atBlock"};P.keyframes=function(e,t,r){if(e=="word"){w="variable";return"keyframes"}if(e=="{")return A(r,t,"top");return M(e,t,r)};P.at=function(e,t,r){if(e==";")return E(r);if(e=="{"||e=="}")return N(e,t,r);if(e=="word")w="tag";else if(e=="hash")w="builtin";return"at"};P.interpolation=function(e,t,r){if(e=="}")return E(r);if(e=="{"||e==";")return N(e,t,r);if(e=="word")w="variable";else if(e!="variable"&&e!="("&&e!=")")w="error";return"interpolation"};return{startState:function(e){return{tokenize:null,state:i?"block":"top",stateArg:null,context:new T(i?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||C)(e,t);if(r&&typeof r=="object"){b=r[1];r=r[0]}w=r;if(b!="comment")t.state=P[t.state](b,e,t);return w},indent:function(e,t){var r=e.context,i=t&&t.charAt(0);var a=r.indent;if(r.type=="prop"&&(i=="}"||i==")"))r=r.prev;if(r.prev){if(i=="}"&&(r.type=="block"||r.type=="top"||r.type=="interpolation"||r.type=="restricted_atBlock")){r=r.prev;a=r.indent}else if(i==")"&&(r.type=="parens"||r.type=="atBlock_parens")||i=="{"&&(r.type=="at"||r.type=="atBlock")){a=Math.max(0,r.indent-n)}}return a},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:g,fold:"brace"}});function t(e){var t={};for(var r=0;r<e.length;++r){t[e[r].toLowerCase()]=true}return t}var r=["domain","regexp","url","url-prefix"],i=t(r);var n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(n);var s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],o=t(s);var l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],u=t(l);var c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(c);var h=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],p=t(h);var d=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],m=t(d);var v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],g=t(v);var y=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],x=t(y)
;var b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],w=t(b);var k=r.concat(n).concat(s).concat(l).concat(c).concat(h).concat(y).concat(b);e.registerHelper("hintWords","css",k);function C(e,t){var r=false,i;while((i=e.next())!=null){if(r&&i=="/"){t.tokenize=null;break}r=i=="*"}return["comment","comment"]}e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:o,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:g,colorKeywords:x,valueKeywords:w,tokenHooks:{"/":function(e,t){if(!e.eat("*"))return false;t.tokenize=C;return C(e,t)}},name:"css"});e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:o,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:x,valueKeywords:w,fontProperties:m,allowNested:true,lineComment:"//",tokenHooks:{"/":function(e,t){if(e.eat("/")){e.skipToEnd();return["comment","comment"]}else if(e.eat("*")){t.tokenize=C;return C(e,t)}else{return["operator","operator"]}},":":function(e){if(e.match(/^\s*\{/,false))return[null,null];return false},$:function(e){e.match(/^[\w-]+/);if(e.match(/^\s*:/,false))return["variable-2","variable-definition"];return["variable-2","variable"]},"#":function(e){if(!e.eat("{"))return false;return[null,"interpolation"]}},name:"css",helperType:"scss"});e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:o,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:x,valueKeywords:w,fontProperties:m,allowNested:true,lineComment:"//",tokenHooks:{"/":function(e,t){if(e.eat("/")){e.skipToEnd();return["comment","comment"]}else if(e.eat("*")){t.tokenize=C;return C(e,t)}else{return["operator","operator"]}},"@":function(e){if(e.eat("{"))return[null,"interpolation"];if(e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,false))return false;e.eatWhile(/[\w\\\-]/);if(e.match(/^\s*:/,false))return["variable-2","variable-definition"];return["variable-2","variable"]},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"});e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:o,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:g,colorKeywords:x,valueKeywords:w,supportsAtComponent:true,tokenHooks:{"/":function(e,t){if(!e.eat("*"))return false;t.tokenize=C;return C(e,t)}},name:"css",helperType:"gss"})});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";var t={autoSelfClosers:{area:true,base:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true,menuitem:true},implicitlyClosed:{dd:true,li:true,optgroup:true,option:true,p:true,rp:true,rt:true,tbody:true,td:true,tfoot:true,th:true,tr:true},contextGrabbers:{dd:{dd:true,dt:true},dt:{dd:true,dt:true},li:{li:true},option:{option:true,optgroup:true},optgroup:{optgroup:true},p:{address:true,article:true,aside:true,blockquote:true,dir:true,div:true,dl:true,fieldset:true,footer:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,header:true,hgroup:true,hr:true,menu:true,nav:true,ol:true,p:true,pre:true,section:true,table:true,ul:true},rp:{rp:true,rt:true},rt:{rp:true,rt:true},tbody:{tbody:true,tfoot:true},td:{td:true,th:true},tfoot:{tbody:true},th:{td:true,th:true},thead:{tbody:true,tfoot:true},tr:{tr:true}},doNotIndent:{pre:true},allowUnquoted:true,allowMissing:true,caseFold:true};var r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:false,allowMissing:false,allowMissingTagName:false,caseFold:false};e.defineMode("xml",function(i,n){var a=i.indentUnit;var s={};var o=n.htmlMode?t:r;for(var l in o)s[l]=o[l];for(var l in n)s[l]=n[l];var u,c;function f(e,t){function r(r){t.tokenize=r;return r(e,t)}var i=e.next();if(i=="<"){if(e.eat("!")){if(e.eat("[")){if(e.match("CDATA["))return r(d("atom","]]>"));else return null}else if(e.match("--")){return r(d("comment","--\x3e"))}else if(e.match("DOCTYPE",true,true)){e.eatWhile(/[\w\._\-]/);return r(m(1))}else{return null}}else if(e.eat("?")){e.eatWhile(/[\w\._\-]/);t.tokenize=d("meta","?>");return"meta"}else{u=e.eat("/")?"closeTag":"openTag";t.tokenize=h;return"tag bracket"}}else if(i=="&"){var n;if(e.eat("#")){if(e.eat("x")){n=e.eatWhile(/[a-fA-F\d]/)&&e.eat(";")}else{n=e.eatWhile(/[\d]/)&&e.eat(";")}}else{n=e.eatWhile(/[\w\.\-:]/)&&e.eat(";")}return n?"atom":"error"}else{e.eatWhile(/[^&<]/);return null}}f.isInText=true;function h(e,t){var r=e.next();if(r==">"||r=="/"&&e.eat(">")){t.tokenize=f;u=r==">"?"endTag":"selfcloseTag";return"tag bracket"}else if(r=="="){u="equals";return null}else if(r=="<"){t.tokenize=f;t.state=b;t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}else if(/[\'\"]/.test(r)){t.tokenize=p(r);t.stringStartCol=e.column();return t.tokenize(e,t)}else{e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}}function p(e){var t=function(t,r){while(!t.eol()){if(t.next()==e){r.tokenize=h;break}}return"string"};t.isInAttribute=true;return t}function d(e,t){return function(r,i){while(!r.eol()){if(r.match(t)){i.tokenize=f;break}r.next()}return e}}function m(e){return function(t,r){var i;while((i=t.next())!=null){if(i=="<"){r.tokenize=m(e+1);return r.tokenize(t,r)}else if(i==">"){if(e==1){r.tokenize=f;break}else{r.tokenize=m(e-1);return r.tokenize(t,r)}}}return"meta"}}function v(e){return e&&e.toLowerCase()}function g(e,t,r){this.prev=e.context;this.tagName=t||"";this.indent=e.indented;this.startOfLine=r;if(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)this.noIndent=true}function y(e){if(e.context)e.context=e.context.prev}function x(e,t){var r;while(true){if(!e.context){return}r=e.context.tagName;if(!s.contextGrabbers.hasOwnProperty(v(r))||!s.contextGrabbers[v(r)].hasOwnProperty(v(t))){return}y(e)}}function b(e,t,r){if(e=="openTag"){r.tagStart=t.column();return w}else if(e=="closeTag"){return k}else{return b}}function w(e,t,r){if(e=="word"){r.tagName=t.current();c="tag";return L}else if(s.allowMissingTagName&&e=="endTag"){c="tag bracket";return L(e,t,r)}else{c="error";return w}}function k(e,t,r){if(e=="word"){var i=t.current();if(r.context&&r.context.tagName!=i&&s.implicitlyClosed.hasOwnProperty(v(r.context.tagName)))y(r);if(r.context&&r.context.tagName==i||s.matchClosing===false){c="tag";return C}else{c="tag error";return S}}else if(s.allowMissingTagName&&e=="endTag"){c="tag bracket";return C(e,t,r)}else{c="error";return S}}function C(e,t,r){if(e!="endTag"){c="error";return C}y(r);return b}function S(e,t,r){c="error";return C(e,t,r)}function L(e,t,r){if(e=="word"){c="attribute";return T}else if(e=="endTag"||e=="selfcloseTag"){var i=r.tagName,n=r.tagStart;r.tagName=r.tagStart=null;if(e=="selfcloseTag"||s.autoSelfClosers.hasOwnProperty(v(i))){x(r,i)}else{x(r,i);r.context=new g(r,i,n==r.indented)}return b}c="error";return L}function T(e,t,r){if(e=="equals")return A;if(!s.allowMissing)c="error";return L(e,t,r)}function A(e,t,r){if(e=="string")return E;if(e=="word"&&s.allowUnquoted){c="string";return L}c="error";return L(e,t,r)}function E(e,t,r){if(e=="string")return E;return L(e,t,r)}return{startState:function(e){var t={tokenize:f,state:b,indented:e||0,tagName:null,tagStart:null,context:null};if(e!=null)t.baseIndent=e;return t},token:function(e,t){if(!t.tagName&&e.sol())t.indented=e.indentation();if(e.eatSpace())return null;u=null;var r=t.tokenize(e,t);if((r||u)&&r!="comment"){c=null;t.state=t.state(u||r,e,t);if(c)r=c=="error"?r+" error":c}return r},indent:function(t,r,i){var n=t.context;if(t.tokenize.isInAttribute){if(t.tagStart==t.indented)return t.stringStartCol+1;else return t.indented+a}if(n&&n.noIndent)return e.Pass;if(t.tokenize!=h&&t.tokenize!=f)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName){if(s.multilineTagIndentPastTag!==false)return t.tagStart+t.tagName.length+2;else return t.tagStart+a*(s.multilineTagIndentFactor||1)}if(s.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var o=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(o&&o[1]){while(n){if(n.tagName==o[2]){n=n.prev;break}else if(s.implicitlyClosed.hasOwnProperty(v(n.tagName))){n=n.prev}else{break}}}else if(o){while(n){var l=s.contextGrabbers[v(n.tagName)];if(l&&l.hasOwnProperty(v(o[2])))n=n.prev;else break}}while(n&&n.prev&&!n.startOfLine)n=n.prev;if(n)return n.indent+a;else return t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){if(e.state==A)e.state=L},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:e.type=="closeTag"}:null},xmlCurrentContext:function(e){var t=[];for(var r=e.context;r;r=r.prev)t.push(r.tagName);return t.reverse()}}});e.defineMIME("text/xml","xml");e.defineMIME("application/xml","xml");if(!e.mimeModes.hasOwnProperty("text/html"))e.defineMIME("text/html",{name:"xml",htmlMode:true})});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e);else e(CodeMirror)})(function(e){"use strict";var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function r(e,t,r){var i=e.current(),n=i.search(t);if(n>-1){e.backUp(i.length-n)}else if(i.match(/<\/?$/)){e.backUp(i.length);if(!e.match(t,false))e.match(i)}return r}var i={};function n(e){var t=i[e];if(t)return t;return i[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function a(e,t){var r=e.match(n(t));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function s(e,t){return new RegExp((t?"^":"")+"</\\s*"+e+"\\s*>","i")}function o(e,t){for(var r in e){var i=t[r]||(t[r]=[]);var n=e[r];for(var a=n.length-1;a>=0;a--)i.unshift(n[a])}}function l(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(!i[0]||i[1].test(a(t,i[0])))return i[2]}}e.defineMode("htmlmixed",function(i,n){var a=e.getMode(i,{name:"xml",htmlMode:true,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag,allowMissingTagName:n.allowMissingTagName});var u={};var c=n&&n.tags,f=n&&n.scriptTypes;o(t,u);if(c)o(c,u);if(f)for(var h=f.length-1;h>=0;h--)u.script.unshift(["type",f[h].matches,f[h].mode]);function p(t,n){var o=a.token(t,n.htmlState),c=/\btag\b/.test(o),f;if(c&&!/[<>\s\/]/.test(t.current())&&(f=n.htmlState.tagName&&n.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(f)){n.inTag=f+" "}else if(n.inTag&&c&&/>$/.test(t.current())){var h=/^([\S]+) (.*)/.exec(n.inTag);n.inTag=null;var d=t.current()==">"&&l(u[h[1]],h[2]);var m=e.getMode(i,d);var v=s(h[1],true),g=s(h[1],false);n.token=function(e,t){if(e.match(v,false)){t.token=p;t.localState=t.localMode=null;return null}return r(e,g,t.localMode.token(e,t.localState))};n.localMode=m;n.localState=e.startState(m,a.indent(n.htmlState,"",""))}else if(n.inTag){n.inTag+=t.current();if(t.eol())n.inTag+=" "}return o}return{startState:function(){var t=e.startState(a);return{token:p,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var r;if(t.localState){r=e.copyState(t.localMode,t.localState)}return{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(a,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r,i){if(!t.localMode||/^\s*<\//.test(r))return a.indent(t.htmlState,r,i);else if(t.localMode.indent)return t.localMode.indent(t.localState,r,i);else return e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||a}}}},"xml","javascript","css");e.defineMIME("text/html","htmlmixed")});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8);var r=e.Pos;var i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function n(e){return e&&e.bracketRegex||/[(){}[\]]/}function a(e,t,a){var o=e.getLineHandle(t.line),l=t.ch-1;var u=a&&a.afterCursor;if(u==null)u=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className);var c=n(a);var f=!u&&l>=0&&c.test(o.text.charAt(l))&&i[o.text.charAt(l)]||c.test(o.text.charAt(l+1))&&i[o.text.charAt(++l)];if(!f)return null;var h=f.charAt(1)==">"?1:-1;if(a&&a.strict&&h>0!=(l==t.ch))return null;var p=e.getTokenTypeAt(r(t.line,l+1));var d=s(e,r(t.line,l+(h>0?1:0)),h,p,a);if(d==null)return null;return{from:r(t.line,l),to:d&&d.pos,match:d&&d.ch==f.charAt(0),forward:h>0}}function s(e,t,a,s,o){var l=o&&o.maxScanLineLength||1e4;var u=o&&o.maxScanLines||1e3;var c=[];var f=n(o);var h=a>0?Math.min(t.line+u,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-u);for(var p=t.line;p!=h;p+=a){var d=e.getLine(p);if(!d)continue;var m=a>0?0:d.length-1,v=a>0?d.length:-1;if(d.length>l)continue;if(p==t.line)m=t.ch-(a<0?1:0);for(;m!=v;m+=a){var g=d.charAt(m);if(f.test(g)&&(s===undefined||(e.getTokenTypeAt(r(p,m+1))||"")==(s||""))){var y=i[g];if(y&&y.charAt(1)==">"==a>0)c.push(g);else if(!c.length)return{pos:r(p,m),ch:g};else c.pop()}}}return p-a==(a>0?e.lastLine():e.firstLine())?false:null}function o(e,i,n){var s=e.state.matchBrackets.maxHighlightLineLength||1e3,o=n&&n.highlightNonMatching;var l=[],u=e.listSelections();for(var c=0;c<u.length;c++){var f=u[c].empty()&&a(e,u[c].head,n);if(f&&(f.match||o!==false)&&e.getLine(f.from.line).length<=s){var h=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(f.from,r(f.from.line,f.from.ch+1),{className:h}));if(f.to&&e.getLine(f.to.line).length<=s)l.push(e.markText(f.to,r(f.to.line,f.to.ch+1),{className:h}))}}if(l.length){if(t&&e.state.focused)e.focus();var p=function(){e.operation(function(){for(var e=0;e<l.length;e++)l[e].clear()})};if(i)setTimeout(p,800);else return p}}function l(e){e.operation(function(){if(e.state.matchBrackets.currentlyHighlighted){e.state.matchBrackets.currentlyHighlighted();e.state.matchBrackets.currentlyHighlighted=null}e.state.matchBrackets.currentlyHighlighted=o(e,false,e.state.matchBrackets)})}function u(e){if(e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted){e.state.matchBrackets.currentlyHighlighted();e.state.matchBrackets.currentlyHighlighted=null}}e.defineOption("matchBrackets",false,function(t,r,i){if(i&&i!=e.Init){t.off("cursorActivity",l);t.off("focus",l);t.off("blur",u);u(t)}if(r){t.state.matchBrackets=typeof r=="object"?r:{};t.on("cursorActivity",l);t.on("focus",l);t.on("blur",u)}});e.defineExtension("matchBrackets",function(){o(this,true)});e.defineExtension("findMatchingBracket",function(e,t,r){if(r||typeof t=="boolean"){if(!r){t=t?{strict:true}:null}else{r.strict=t;t=r}}return a(this,e,t)});e.defineExtension("scanForBracket",function(e,t,r,i){return s(this,e,t,r,i)})});(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?t(exports):typeof define==="function"&&define.amd?define(["exports"],t):t(e.acorn={})})(this,function(e){"use strict";var t={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"};var r="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";var i={5:r,6:r+" const class extends export import super"};var n=/^in(stanceof)?$/;var a="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞹꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";var s="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";var o=new RegExp("["+a+"]");var l=new RegExp("["+a+s+"]");a=s=null;var u=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,190,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,26,230,43,117,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,68,12,0,67,12,65,1,31,6129,15,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541];var c=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239];function f(e,t){var r=65536;for(var i=0;i<t.length;i+=2){r+=t[i];if(r>e){return false}r+=t[i+1];if(r>=e){return true}}}function h(e,t){if(e<65){return e===36}if(e<91){return true}if(e<97){return e===95}if(e<123){return true}if(e<=65535){return e>=170&&o.test(String.fromCharCode(e))}if(t===false){return false}return f(e,u)}function p(e,t){if(e<48){return e===36}if(e<58){return true}if(e<65){return false}if(e<91){return true}if(e<97){return e===95}if(e<123){return true}if(e<=65535){return e>=170&&l.test(String.fromCharCode(e))}if(t===false){return false}return f(e,u)||f(e,c)}var d=function e(t,r){if(r===void 0)r={};this.label=t;this.keyword=r.keyword;this.beforeExpr=!!r.beforeExpr;this.startsExpr=!!r.startsExpr;this.isLoop=!!r.isLoop;this.isAssign=!!r.isAssign;this.prefix=!!r.prefix;this.postfix=!!r.postfix;this.binop=r.binop||null;this.updateContext=null};function m(e,t){return new d(e,{beforeExpr:true,binop:t})}var v={beforeExpr:true};var g={startsExpr:true};var y={};function x(e,t){if(t===void 0)t={};t.keyword=e;return y[e]=new d(e,t)}var b={num:new d("num",g),regexp:new d("regexp",g),string:new d("string",g),name:new d("name",g),eof:new d("eof"),bracketL:new d("[",{beforeExpr:true,startsExpr:true}),bracketR:new d("]"),braceL:new d("{",{beforeExpr:true,startsExpr:true}),braceR:new d("}"),parenL:new d("(",{beforeExpr:true,startsExpr:true}),parenR:new d(")"),comma:new d(",",v),semi:new d(";",v),colon:new d(":",v),dot:new d("."),question:new d("?",v),arrow:new d("=>",v),template:new d("template"),invalidTemplate:new d("invalidTemplate"),ellipsis:new d("...",v),backQuote:new d("`",g),dollarBraceL:new d("${",{beforeExpr:true,startsExpr:true}),eq:new d("=",{beforeExpr:true,isAssign:true}),assign:new d("_=",{beforeExpr:true,isAssign:true}),incDec:new d("++/--",{prefix:true,postfix:true,startsExpr:true}),prefix:new d("!/~",{beforeExpr:true,prefix:true,startsExpr:true}),logicalOR:m("||",1),logicalAND:m("&&",2),bitwiseOR:m("|",3),bitwiseXOR:m("^",4),bitwiseAND:m("&",5),equality:m("==/!=/===/!==",6),relational:m("</>/<=/>=",7),bitShift:m("<</>>/>>>",8),plusMin:new d("+/-",{beforeExpr:true,binop:9,prefix:true,startsExpr:true}),modulo:m("%",10),star:m("*",10),slash:m("/",10),starstar:new d("**",{beforeExpr:true}),_break:x("break"),_case:x("case",v),_catch:x("catch"),_continue:x("continue"),_debugger:x("debugger"),_default:x("default",v),_do:x("do",{isLoop:true,beforeExpr:true}),_else:x("else",v),_finally:x("finally"),_for:x("for",{isLoop:true}),_function:x("function",g),_if:x("if"),_return:x("return",v),_switch:x("switch"),_throw:x("throw",v),_try:x("try"),_var:x("var"),_const:x("const"),_while:x("while",{isLoop:true}),_with:x("with"),_new:x("new",{beforeExpr:true,startsExpr:true}),_this:x("this",g),_super:x("super",g),_class:x("class",g),_extends:x("extends",v),_export:x("export"),_import:x("import"),_null:x("null",g),_true:x("true",g),_false:x("false",g),_in:x("in",{beforeExpr:true,binop:7}),_instanceof:x("instanceof",{beforeExpr:true,binop:7}),_typeof:x("typeof",{beforeExpr:true,prefix:true,startsExpr:true}),_void:x("void",{beforeExpr:true,prefix:true,startsExpr:true}),_delete:x("delete",{beforeExpr:true,prefix:true,startsExpr:true})};var w=/\r\n?|\n|\u2028|\u2029/;var k=new RegExp(w.source,"g");function C(e,t){return e===10||e===13||!t&&(e===8232||e===8233)}var S=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;var L=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;var T=Object.prototype;var A=T.hasOwnProperty;var E=T.toString;function M(e,t){return A.call(e,t)}var N=Array.isArray||function(e){return E.call(e)==="[object Array]"};var _=function e(t,r){this.line=t;this.column=r};_.prototype.offset=function e(t){return new _(this.line,this.column+t)};var P=function e(t,r,i){this.start=r;this.end=i;if(t.sourceFile!==null){this.source=t.sourceFile}};function I(e,t){for(var r=1,i=0;;){k.lastIndex=i;var n=k.exec(e);if(n&&n.index<t){++r;i=n.index+n[0].length}else{return new _(r,t-i)}}}var O={ecmaVersion:7,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowAwaitOutsideFunction:false,allowHashBang:false,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false,plugins:{}};function D(e){var t={};for(var r in O){t[r]=e&&M(e,r)?e[r]:O[r]}if(t.ecmaVersion>=2015){t.ecmaVersion-=2009}if(t.allowReserved==null){t.allowReserved=t.ecmaVersion<5}if(N(t.onToken)){var i=t.onToken;t.onToken=function(e){return i.push(e)}}if(N(t.onComment)){t.onComment=R(t,t.onComment)}return t}function R(e,t){return function(r,i,n,a,s,o){var l={type:r?"Block":"Line",value:i,start:n,end:a};if(e.locations){l.loc=new P(this,s,o)}if(e.ranges){l.range=[n,a]}t.push(l)}}var V={};function F(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var z=function e(r,n,a){this.options=r=D(r);this.sourceFile=r.sourceFile;this.keywords=F(i[r.ecmaVersion>=6?6:5]);var s="";if(!r.allowReserved){for(var o=r.ecmaVersion;;o--){if(s=t[o]){break}}if(r.sourceType==="module"){s+=" await"}}this.reservedWords=F(s);var l=(s?s+" ":"")+t.strict;this.reservedWordsStrict=F(l);this.reservedWordsStrictBind=F(l+" "+t.strictBind);this.input=String(n);this.containsEsc=false;this.loadPlugins(r.plugins);if(a){this.pos=a;this.lineStart=this.input.lastIndexOf("\n",a-1)+1;this.curLine=this.input.slice(0,this.lineStart).split(w).length}else{this.pos=this.lineStart=0;this.curLine=1}this.type=b.eof;this.value=null;this.start=this.end=this.pos;this.startLoc=this.endLoc=this.curPosition();this.lastTokEndLoc=this.lastTokStartLoc=null;this.lastTokStart=this.lastTokEnd=this.pos;this.context=this.initialContext();this.exprAllowed=true;this.inModule=r.sourceType==="module";this.strict=this.inModule||this.strictDirective(this.pos);this.potentialArrowAt=-1;this.inFunction=this.inGenerator=this.inAsync=false
;this.yieldPos=this.awaitPos=0;this.labels=[];if(this.pos===0&&r.allowHashBang&&this.input.slice(0,2)==="#!"){this.skipLineComment(2)}this.scopeStack=[];this.enterFunctionScope();this.regexpState=null};z.prototype.isKeyword=function e(t){return this.keywords.test(t)};z.prototype.isReservedWord=function e(t){return this.reservedWords.test(t)};z.prototype.extend=function e(t,r){this[t]=r(this[t])};z.prototype.loadPlugins=function e(t){var r=this;for(var i in t){var n=V[i];if(!n){throw new Error("Plugin '"+i+"' not found")}n(r,t[i])}};z.prototype.parse=function e(){var t=this.options.program||this.startNode();this.nextToken();return this.parseTopLevel(t)};var W=z.prototype;var B=/^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)"|;)/;W.strictDirective=function(e){var t=this;for(;;){L.lastIndex=e;e+=L.exec(t.input)[0].length;var r=B.exec(t.input.slice(e));if(!r){return false}if((r[1]||r[2])==="use strict"){return true}e+=r[0].length}};W.eat=function(e){if(this.type===e){this.next();return true}else{return false}};W.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc};W.eatContextual=function(e){if(!this.isContextual(e)){return false}this.next();return true};W.expectContextual=function(e){if(!this.eatContextual(e)){this.unexpected()}};W.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||w.test(this.input.slice(this.lastTokEnd,this.start))};W.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon){this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc)}return true}};W.semicolon=function(){if(!this.eat(b.semi)&&!this.insertSemicolon()){this.unexpected()}};W.afterTrailingComma=function(e,t){if(this.type===e){if(this.options.onTrailingComma){this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc)}if(!t){this.next()}return true}};W.expect=function(e){this.eat(e)||this.unexpected()};W.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};function H(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}W.checkPatternErrors=function(e,t){if(!e){return}if(e.trailingComma>-1){this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element")}var r=t?e.parenthesizedAssign:e.parenthesizedBind;if(r>-1){this.raiseRecoverable(r,"Parenthesized pattern")}};W.checkExpressionErrors=function(e,t){if(!e){return false}var r=e.shorthandAssign;var i=e.doubleProto;if(!t){return r>=0||i>=0}if(r>=0){this.raise(r,"Shorthand property assignments are valid only in destructuring patterns")}if(i>=0){this.raiseRecoverable(i,"Redefinition of __proto__ property")}};W.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)){this.raise(this.yieldPos,"Yield expression cannot be a default value")}if(this.awaitPos){this.raise(this.awaitPos,"Await expression cannot be a default value")}};W.isSimpleAssignTarget=function(e){if(e.type==="ParenthesizedExpression"){return this.isSimpleAssignTarget(e.expression)}return e.type==="Identifier"||e.type==="MemberExpression"};var j=z.prototype;j.parseTopLevel=function(e){var t=this;var r={};if(!e.body){e.body=[]}while(this.type!==b.eof){var i=t.parseStatement(true,true,r);e.body.push(i)}this.adaptDirectivePrologue(e.body);this.next();if(this.options.ecmaVersion>=6){e.sourceType=this.options.sourceType}return this.finishNode(e,"Program")};var U={kind:"loop"};var G={kind:"switch"};j.isLet=function(){if(this.options.ecmaVersion<6||!this.isContextual("let")){return false}L.lastIndex=this.pos;var e=L.exec(this.input);var t=this.pos+e[0].length,r=this.input.charCodeAt(t);if(r===91||r===123){return true}if(h(r,true)){var i=t+1;while(p(this.input.charCodeAt(i),true)){++i}var a=this.input.slice(t,i);if(!n.test(a)){return true}}return false};j.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async")){return false}L.lastIndex=this.pos;var e=L.exec(this.input);var t=this.pos+e[0].length;return!w.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!p(this.input.charAt(t+8)))};j.parseStatement=function(e,t,r){var i=this.type,n=this.startNode(),a;if(this.isLet()){i=b._var;a="let"}switch(i){case b._break:case b._continue:return this.parseBreakContinueStatement(n,i.keyword);case b._debugger:return this.parseDebuggerStatement(n);case b._do:return this.parseDoStatement(n);case b._for:return this.parseForStatement(n);case b._function:if(!e&&this.options.ecmaVersion>=6){this.unexpected()}return this.parseFunctionStatement(n,false);case b._class:if(!e){this.unexpected()}return this.parseClass(n,true);case b._if:return this.parseIfStatement(n);case b._return:return this.parseReturnStatement(n);case b._switch:return this.parseSwitchStatement(n);case b._throw:return this.parseThrowStatement(n);case b._try:return this.parseTryStatement(n);case b._const:case b._var:a=a||this.value;if(!e&&a!=="var"){this.unexpected()}return this.parseVarStatement(n,a);case b._while:return this.parseWhileStatement(n);case b._with:return this.parseWithStatement(n);case b.braceL:return this.parseBlock();case b.semi:return this.parseEmptyStatement(n);case b._export:case b._import:if(!this.options.allowImportExportEverywhere){if(!t){this.raise(this.start,"'import' and 'export' may only appear at the top level")}if(!this.inModule){this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}}return i===b._import?this.parseImport(n):this.parseExport(n,r);default:if(this.isAsyncFunction()){if(!e){this.unexpected()}this.next();return this.parseFunctionStatement(n,true)}var s=this.value,o=this.parseExpression();if(i===b.name&&o.type==="Identifier"&&this.eat(b.colon)){return this.parseLabeledStatement(n,s,o)}else{return this.parseExpressionStatement(n,o)}}};j.parseBreakContinueStatement=function(e,t){var r=this;var i=t==="break";this.next();if(this.eat(b.semi)||this.insertSemicolon()){e.label=null}else if(this.type!==b.name){this.unexpected()}else{e.label=this.parseIdent();this.semicolon()}var n=0;for(;n<this.labels.length;++n){var a=r.labels[n];if(e.label==null||a.name===e.label.name){if(a.kind!=null&&(i||a.kind==="loop")){break}if(e.label&&i){break}}}if(n===this.labels.length){this.raise(e.start,"Unsyntactic "+t)}return this.finishNode(e,i?"BreakStatement":"ContinueStatement")};j.parseDebuggerStatement=function(e){this.next();this.semicolon();return this.finishNode(e,"DebuggerStatement")};j.parseDoStatement=function(e){this.next();this.labels.push(U);e.body=this.parseStatement(false);this.labels.pop();this.expect(b._while);e.test=this.parseParenExpression();if(this.options.ecmaVersion>=6){this.eat(b.semi)}else{this.semicolon()}return this.finishNode(e,"DoWhileStatement")};j.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;this.labels.push(U);this.enterLexicalScope();this.expect(b.parenL);if(this.type===b.semi){if(t>-1){this.unexpected(t)}return this.parseFor(e,null)}var r=this.isLet();if(this.type===b._var||this.type===b._const||r){var i=this.startNode(),n=r?"let":this.value;this.next();this.parseVar(i,true,n);this.finishNode(i,"VariableDeclaration");if((this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&i.declarations.length===1&&!(n!=="var"&&i.declarations[0].init)){if(this.options.ecmaVersion>=9){if(this.type===b._in){if(t>-1){this.unexpected(t)}}else{e.await=t>-1}}return this.parseForIn(e,i)}if(t>-1){this.unexpected(t)}return this.parseFor(e,i)}var a=new H;var s=this.parseExpression(true,a);if(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")){if(this.options.ecmaVersion>=9){if(this.type===b._in){if(t>-1){this.unexpected(t)}}else{e.await=t>-1}}this.toAssignable(s,false,a);this.checkLVal(s);return this.parseForIn(e,s)}else{this.checkExpressionErrors(a,true)}if(t>-1){this.unexpected(t)}return this.parseFor(e,s)};j.parseFunctionStatement=function(e,t){this.next();return this.parseFunction(e,true,false,t)};j.parseIfStatement=function(e){this.next();e.test=this.parseParenExpression();e.consequent=this.parseStatement(!this.strict&&this.type===b._function);e.alternate=this.eat(b._else)?this.parseStatement(!this.strict&&this.type===b._function):null;return this.finishNode(e,"IfStatement")};j.parseReturnStatement=function(e){if(!this.inFunction&&!this.options.allowReturnOutsideFunction){this.raise(this.start,"'return' outside of function")}this.next();if(this.eat(b.semi)||this.insertSemicolon()){e.argument=null}else{e.argument=this.parseExpression();this.semicolon()}return this.finishNode(e,"ReturnStatement")};j.parseSwitchStatement=function(e){var t=this;this.next();e.discriminant=this.parseParenExpression();e.cases=[];this.expect(b.braceL);this.labels.push(G);this.enterLexicalScope();var r;for(var i=false;this.type!==b.braceR;){if(t.type===b._case||t.type===b._default){var n=t.type===b._case;if(r){t.finishNode(r,"SwitchCase")}e.cases.push(r=t.startNode());r.consequent=[];t.next();if(n){r.test=t.parseExpression()}else{if(i){t.raiseRecoverable(t.lastTokStart,"Multiple default clauses")}i=true;r.test=null}t.expect(b.colon)}else{if(!r){t.unexpected()}r.consequent.push(t.parseStatement(true))}}this.exitLexicalScope();if(r){this.finishNode(r,"SwitchCase")}this.next();this.labels.pop();return this.finishNode(e,"SwitchStatement")};j.parseThrowStatement=function(e){this.next();if(w.test(this.input.slice(this.lastTokEnd,this.start))){this.raise(this.lastTokEnd,"Illegal newline after throw")}e.argument=this.parseExpression();this.semicolon();return this.finishNode(e,"ThrowStatement")};var q=[];j.parseTryStatement=function(e){this.next();e.block=this.parseBlock();e.handler=null;if(this.type===b._catch){var t=this.startNode();this.next();if(this.eat(b.parenL)){t.param=this.parseBindingAtom();this.enterLexicalScope();this.checkLVal(t.param,"let");this.expect(b.parenR)}else{if(this.options.ecmaVersion<10){this.unexpected()}t.param=null;this.enterLexicalScope()}t.body=this.parseBlock(false);this.exitLexicalScope();e.handler=this.finishNode(t,"CatchClause")}e.finalizer=this.eat(b._finally)?this.parseBlock():null;if(!e.handler&&!e.finalizer){this.raise(e.start,"Missing catch or finally clause")}return this.finishNode(e,"TryStatement")};j.parseVarStatement=function(e,t){this.next();this.parseVar(e,false,t);this.semicolon();return this.finishNode(e,"VariableDeclaration")};j.parseWhileStatement=function(e){this.next();e.test=this.parseParenExpression();this.labels.push(U);e.body=this.parseStatement(false);this.labels.pop();return this.finishNode(e,"WhileStatement")};j.parseWithStatement=function(e){if(this.strict){this.raise(this.start,"'with' in strict mode")}this.next();e.object=this.parseParenExpression();e.body=this.parseStatement(false);return this.finishNode(e,"WithStatement")};j.parseEmptyStatement=function(e){this.next();return this.finishNode(e,"EmptyStatement")};j.parseLabeledStatement=function(e,t,r){var i=this;for(var n=0,a=i.labels;n<a.length;n+=1){var s=a[n];if(s.name===t){i.raise(r.start,"Label '"+t+"' is already declared")}}var o=this.type.isLoop?"loop":this.type===b._switch?"switch":null;for(var l=this.labels.length-1;l>=0;l--){var u=i.labels[l];if(u.statementStart===e.start){u.statementStart=i.start;u.kind=o}else{break}}this.labels.push({name:t,kind:o,statementStart:this.start});e.body=this.parseStatement(true);if(e.body.type==="ClassDeclaration"||e.body.type==="VariableDeclaration"&&e.body.kind!=="var"||e.body.type==="FunctionDeclaration"&&(this.strict||e.body.generator||e.body.async)){this.raiseRecoverable(e.body.start,"Invalid labeled declaration")}this.labels.pop();e.label=r;return this.finishNode(e,"LabeledStatement")};j.parseExpressionStatement=function(e,t){e.expression=t;this.semicolon();return this.finishNode(e,"ExpressionStatement")};j.parseBlock=function(e){var t=this;if(e===void 0)e=true;var r=this.startNode();r.body=[];this.expect(b.braceL);if(e){this.enterLexicalScope()}while(!this.eat(b.braceR)){var i=t.parseStatement(true);r.body.push(i)}if(e){this.exitLexicalScope()}return this.finishNode(r,"BlockStatement")};j.parseFor=function(e,t){e.init=t;this.expect(b.semi);e.test=this.type===b.semi?null:this.parseExpression();this.expect(b.semi);e.update=this.type===b.parenR?null:this.parseExpression();this.expect(b.parenR);this.exitLexicalScope();e.body=this.parseStatement(false);this.labels.pop();return this.finishNode(e,"ForStatement")};j.parseForIn=function(e,t){var r=this.type===b._in?"ForInStatement":"ForOfStatement";this.next();if(r==="ForInStatement"){if(t.type==="AssignmentPattern"||t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(this.strict||t.declarations[0].id.type!=="Identifier")){this.raise(t.start,"Invalid assignment in for-in loop head")}}e.left=t;e.right=r==="ForInStatement"?this.parseExpression():this.parseMaybeAssign();this.expect(b.parenR);this.exitLexicalScope();e.body=this.parseStatement(false);this.labels.pop();return this.finishNode(e,r)};j.parseVar=function(e,t,r){var i=this;e.declarations=[];e.kind=r;for(;;){var n=i.startNode();i.parseVarId(n,r);if(i.eat(b.eq)){n.init=i.parseMaybeAssign(t)}else if(r==="const"&&!(i.type===b._in||i.options.ecmaVersion>=6&&i.isContextual("of"))){i.unexpected()}else if(n.id.type!=="Identifier"&&!(t&&(i.type===b._in||i.isContextual("of")))){i.raise(i.lastTokEnd,"Complex binding patterns require an initialization value")}else{n.init=null}e.declarations.push(i.finishNode(n,"VariableDeclarator"));if(!i.eat(b.comma)){break}}return e};j.parseVarId=function(e,t){e.id=this.parseBindingAtom(t);this.checkLVal(e.id,t,false)};j.parseFunction=function(e,t,r,i){this.initFunction(e);if(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i){e.generator=this.eat(b.star)}if(this.options.ecmaVersion>=8){e.async=!!i}if(t){e.id=t==="nullableID"&&this.type!==b.name?null:this.parseIdent();if(e.id){this.checkLVal(e.id,this.inModule&&!this.inFunction?"let":"var")}}var n=this.inGenerator,a=this.inAsync,s=this.yieldPos,o=this.awaitPos,l=this.inFunction;this.inGenerator=e.generator;this.inAsync=e.async;this.yieldPos=0;this.awaitPos=0;this.inFunction=true;this.enterFunctionScope();if(!t){e.id=this.type===b.name?this.parseIdent():null}this.parseFunctionParams(e);this.parseFunctionBody(e,r);this.inGenerator=n;this.inAsync=a;this.yieldPos=s;this.awaitPos=o;this.inFunction=l;return this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")};j.parseFunctionParams=function(e){this.expect(b.parenL);e.params=this.parseBindingList(b.parenR,false,this.options.ecmaVersion>=8);this.checkYieldAwaitInDefaultParams()};j.parseClass=function(e,t){var r=this;this.next();this.parseClassId(e,t);this.parseClassSuper(e);var i=this.startNode();var n=false;i.body=[];this.expect(b.braceL);while(!this.eat(b.braceR)){var a=r.parseClassMember(i);if(a&&a.type==="MethodDefinition"&&a.kind==="constructor"){if(n){r.raise(a.start,"Duplicate constructor in the same class")}n=true}}e.body=this.finishNode(i,"ClassBody");return this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};j.parseClassMember=function(e){var t=this;if(this.eat(b.semi)){return null}var r=this.startNode();var i=function(e,i){if(i===void 0)i=false;var n=t.start,a=t.startLoc;if(!t.eatContextual(e)){return false}if(t.type!==b.parenL&&(!i||!t.canInsertSemicolon())){return true}if(r.key){t.unexpected()}r.computed=false;r.key=t.startNodeAt(n,a);r.key.name=e;t.finishNode(r.key,"Identifier");return false};r.kind="method";r.static=i("static");var n=this.eat(b.star);var a=false;if(!n){if(this.options.ecmaVersion>=8&&i("async",true)){a=true;n=this.options.ecmaVersion>=9&&this.eat(b.star)}else if(i("get")){r.kind="get"}else if(i("set")){r.kind="set"}}if(!r.key){this.parsePropertyName(r)}var s=r.key;if(!r.computed&&!r.static&&(s.type==="Identifier"&&s.name==="constructor"||s.type==="Literal"&&s.value==="constructor")){if(r.kind!=="method"){this.raise(s.start,"Constructor can't have get/set modifier")}if(n){this.raise(s.start,"Constructor can't be a generator")}if(a){this.raise(s.start,"Constructor can't be an async method")}r.kind="constructor"}else if(r.static&&s.type==="Identifier"&&s.name==="prototype"){this.raise(s.start,"Classes may not have a static property named prototype")}this.parseClassMethod(e,r,n,a);if(r.kind==="get"&&r.value.params.length!==0){this.raiseRecoverable(r.value.start,"getter should have no params")}if(r.kind==="set"&&r.value.params.length!==1){this.raiseRecoverable(r.value.start,"setter should have exactly one param")}if(r.kind==="set"&&r.value.params[0].type==="RestElement"){this.raiseRecoverable(r.value.params[0].start,"Setter cannot use rest params")}return r};j.parseClassMethod=function(e,t,r,i){t.value=this.parseMethod(r,i);e.body.push(this.finishNode(t,"MethodDefinition"))};j.parseClassId=function(e,t){e.id=this.type===b.name?this.parseIdent():t===true?this.unexpected():null};j.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts():null};j.parseExport=function(e,t){var r=this;this.next();if(this.eat(b.star)){this.expectContextual("from");if(this.type!==b.string){this.unexpected()}e.source=this.parseExprAtom();this.semicolon();return this.finishNode(e,"ExportAllDeclaration")}if(this.eat(b._default)){this.checkExport(t,"default",this.lastTokStart);var i;if(this.type===b._function||(i=this.isAsyncFunction())){var n=this.startNode();this.next();if(i){this.next()}e.declaration=this.parseFunction(n,"nullableID",false,i)}else if(this.type===b._class){var a=this.startNode();e.declaration=this.parseClass(a,"nullableID")}else{e.declaration=this.parseMaybeAssign();this.semicolon()}return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement()){e.declaration=this.parseStatement(true);if(e.declaration.type==="VariableDeclaration"){this.checkVariableExport(t,e.declaration.declarations)}else{this.checkExport(t,e.declaration.id.name,e.declaration.id.start)}e.specifiers=[];e.source=null}else{e.declaration=null;e.specifiers=this.parseExportSpecifiers(t);if(this.eatContextual("from")){if(this.type!==b.string){this.unexpected()}e.source=this.parseExprAtom()}else{for(var s=0,o=e.specifiers;s<o.length;s+=1){var l=o[s];r.checkUnreserved(l.local)}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};j.checkExport=function(e,t,r){if(!e){return}if(M(e,t)){this.raiseRecoverable(r,"Duplicate export '"+t+"'")}e[t]=true};j.checkPatternExport=function(e,t){var r=this;var i=t.type;if(i==="Identifier"){this.checkExport(e,t.name,t.start)}else if(i==="ObjectPattern"){for(var n=0,a=t.properties;n<a.length;n+=1){var s=a[n];r.checkPatternExport(e,s)}}else if(i==="ArrayPattern"){for(var o=0,l=t.elements;o<l.length;o+=1){var u=l[o];if(u){r.checkPatternExport(e,u)}}}else if(i==="Property"){this.checkPatternExport(e,t.value)}else if(i==="AssignmentPattern"){this.checkPatternExport(e,t.left)}else if(i==="RestElement"){this.checkPatternExport(e,t.argument)}else if(i==="ParenthesizedExpression"){this.checkPatternExport(e,t.expression)}};j.checkVariableExport=function(e,t){var r=this;if(!e){return}for(var i=0,n=t;i<n.length;i+=1){var a=n[i];r.checkPatternExport(e,a.id)}};j.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};j.parseExportSpecifiers=function(e){var t=this;var r=[],i=true;this.expect(b.braceL);while(!this.eat(b.braceR)){if(!i){t.expect(b.comma);if(t.afterTrailingComma(b.braceR)){break}}else{i=false}var n=t.startNode();n.local=t.parseIdent(true);n.exported=t.eatContextual("as")?t.parseIdent(true):n.local;t.checkExport(e,n.exported.name,n.exported.start);r.push(t.finishNode(n,"ExportSpecifier"))}return r};j.parseImport=function(e){this.next();if(this.type===b.string){e.specifiers=q;e.source=this.parseExprAtom()}else{e.specifiers=this.parseImportSpecifiers();this.expectContextual("from");e.source=this.type===b.string?this.parseExprAtom():this.unexpected()}this.semicolon();return this.finishNode(e,"ImportDeclaration")};j.parseImportSpecifiers=function(){var e=this;var t=[],r=true;if(this.type===b.name){var i=this.startNode();i.local=this.parseIdent();this.checkLVal(i.local,"let");t.push(this.finishNode(i,"ImportDefaultSpecifier"));if(!this.eat(b.comma)){return t}}if(this.type===b.star){var n=this.startNode();this.next();this.expectContextual("as");n.local=this.parseIdent();this.checkLVal(n.local,"let");t.push(this.finishNode(n,"ImportNamespaceSpecifier"));return t}this.expect(b.braceL);while(!this.eat(b.braceR)){if(!r){e.expect(b.comma);if(e.afterTrailingComma(b.braceR)){break}}else{r=false}var a=e.startNode();a.imported=e.parseIdent(true);if(e.eatContextual("as")){a.local=e.parseIdent()}else{e.checkUnreserved(a.imported);a.local=a.imported}e.checkLVal(a.local,"let");t.push(e.finishNode(a,"ImportSpecifier"))}return t};j.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t){e[t].directive=e[t].expression.raw.slice(1,-1)}};j.isDirectiveCandidate=function(e){return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value==="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var K=z.prototype;K.toAssignable=function(e,t,r){var i=this;if(this.options.ecmaVersion>=6&&e){switch(e.type){case"Identifier":if(this.inAsync&&e.name==="await"){this.raise(e.start,"Can not use 'await' as identifier inside an async function")}break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern";if(r){this.checkPatternErrors(r,true)}for(var n=0,a=e.properties;n<a.length;n+=1){var s=a[n];i.toAssignable(s,t);if(s.type==="RestElement"&&(s.argument.type==="ArrayPattern"||s.argument.type==="ObjectPattern")){i.raise(s.argument.start,"Unexpected token")}}break;case"Property":if(e.kind!=="init"){this.raise(e.key.start,"Object pattern can't contain getter or setter")}this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern";if(r){this.checkPatternErrors(r,true)}this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement";this.toAssignable(e.argument,t);if(e.argument.type==="AssignmentPattern"){this.raise(e.argument.start,"Rest elements cannot have a default value")}break;case"AssignmentExpression":if(e.operator!=="="){this.raise(e.left.end,"Only '=' operator can be used for specifying default value.")}e.type="AssignmentPattern";delete e.operator;this.toAssignable(e.left,t);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(e.expression,t);break;case"MemberExpression":if(!t){break}default:this.raise(e.start,"Assigning to rvalue")}}else if(r){this.checkPatternErrors(r,true)}return e};K.toAssignableList=function(e,t){var r=this;var i=e.length;for(var n=0;n<i;n++){var a=e[n];if(a){r.toAssignable(a,t)}}if(i){var s=e[i-1];if(this.options.ecmaVersion===6&&t&&s&&s.type==="RestElement"&&s.argument.type!=="Identifier"){this.unexpected(s.argument.start)}}return e};K.parseSpread=function(e){var t=this.startNode();this.next();t.argument=this.parseMaybeAssign(false,e);return this.finishNode(t,"SpreadElement")};K.parseRestBinding=function(){var e=this.startNode();this.next();if(this.options.ecmaVersion===6&&this.type!==b.name){this.unexpected()}e.argument=this.parseBindingAtom();return this.finishNode(e,"RestElement")};K.parseBindingAtom=function(){if(this.options.ecmaVersion>=6){switch(this.type){case b.bracketL:var e=this.startNode();this.next();e.elements=this.parseBindingList(b.bracketR,true,true);return this.finishNode(e,"ArrayPattern");case b.braceL:return this.parseObj(true)}}return this.parseIdent()};K.parseBindingList=function(e,t,r){var i=this;var n=[],a=true;while(!this.eat(e)){if(a){a=false}else{i.expect(b.comma)}if(t&&i.type===b.comma){n.push(null)}else if(r&&i.afterTrailingComma(e)){break}else if(i.type===b.ellipsis){var s=i.parseRestBinding();i.parseBindingListItem(s);n.push(s);if(i.type===b.comma){i.raise(i.start,"Comma is not permitted after the rest element")}i.expect(e);break}else{var o=i.parseMaybeDefault(i.start,i.startLoc);i.parseBindingListItem(o);n.push(o)}}return n};K.parseBindingListItem=function(e){return e};K.parseMaybeDefault=function(e,t,r){r=r||this.parseBindingAtom();if(this.options.ecmaVersion<6||!this.eat(b.eq)){return r}var i=this.startNodeAt(e,t);i.left=r;i.right=this.parseMaybeAssign();return this.finishNode(i,"AssignmentPattern")};K.checkLVal=function(e,t,r){var i=this;switch(e.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(e.name)){this.raiseRecoverable(e.start,(t?"Binding ":"Assigning to ")+e.name+" in strict mode")}if(r){if(M(r,e.name)){this.raiseRecoverable(e.start,"Argument name clash")}r[e.name]=true}if(t&&t!=="none"){if(t==="var"&&!this.canDeclareVarName(e.name)||t!=="var"&&!this.canDeclareLexicalName(e.name)){this.raiseRecoverable(e.start,"Identifier '"+e.name+"' has already been declared")}if(t==="var"){this.declareVarName(e.name)}else{this.declareLexicalName(e.name)}}break;case"MemberExpression":if(t){this.raiseRecoverable(e.start,"Binding member expression")}break;case"ObjectPattern":for(var n=0,a=e.properties;n<a.length;n+=1){var s=a[n];i.checkLVal(s,t,r)}break;case"Property":this.checkLVal(e.value,t,r);break;case"ArrayPattern":for(var o=0,l=e.elements;o<l.length;o+=1){var u=l[o];if(u){i.checkLVal(u,t,r)}}break;case"AssignmentPattern":this.checkLVal(e.left,t,r);break;case"RestElement":this.checkLVal(e.argument,t,r);break;case"ParenthesizedExpression":this.checkLVal(e.expression,t,r);break;default:this.raise(e.start,(t?"Binding":"Assigning to")+" rvalue")}};var $=z.prototype;$.checkPropClash=function(e,t,r){if(this.options.ecmaVersion>=9&&e.type==="SpreadElement"){return}if(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand)){return}var i=e.key;var n;switch(i.type){case"Identifier":n=i.name;break;case"Literal":n=String(i.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){if(n==="__proto__"&&a==="init"){if(t.proto){if(r&&r.doubleProto<0){r.doubleProto=i.start}else{this.raiseRecoverable(i.start,"Redefinition of __proto__ property")}}t.proto=true}return}n="$"+n;var s=t[n];if(s){var o;if(a==="init"){o=this.strict&&s.init||s.get||s.set}else{o=s.init||s[a]}if(o){this.raiseRecoverable(i.start,"Redefinition of property")}}else{s=t[n]={init:false,get:false,set:false}}s[a]=true};$.parseExpression=function(e,t){var r=this;var i=this.start,n=this.startLoc;var a=this.parseMaybeAssign(e,t);if(this.type===b.comma){var s=this.startNodeAt(i,n);s.expressions=[a];while(this.eat(b.comma)){s.expressions.push(r.parseMaybeAssign(e,t))}return this.finishNode(s,"SequenceExpression")}return a};$.parseMaybeAssign=function(e,t,r){if(this.inGenerator&&this.isContextual("yield")){return this.parseYield()}var i=false,n=-1,a=-1;if(t){n=t.parenthesizedAssign;a=t.trailingComma;t.parenthesizedAssign=t.trailingComma=-1}else{t=new H;i=true}var s=this.start,o=this.startLoc;if(this.type===b.parenL||this.type===b.name){this.potentialArrowAt=this.start}var l=this.parseMaybeConditional(e,t);if(r){l=r.call(this,l,s,o)}if(this.type.isAssign){var u=this.startNodeAt(s,o);u.operator=this.value;u.left=this.type===b.eq?this.toAssignable(l,false,t):l;if(!i){H.call(t)}t.shorthandAssign=-1;this.checkLVal(l);this.next();u.right=this.parseMaybeAssign(e);return this.finishNode(u,"AssignmentExpression")}else{if(i){this.checkExpressionErrors(t,true)}}if(n>-1){t.parenthesizedAssign=n}if(a>-1){t.trailingComma=a}return l};$.parseMaybeConditional=function(e,t){var r=this.start,i=this.startLoc;var n=this.parseExprOps(e,t);if(this.checkExpressionErrors(t)){return n}if(this.eat(b.question)){var a=this.startNodeAt(r,i);a.test=n;a.consequent=this.parseMaybeAssign();this.expect(b.colon);a.alternate=this.parseMaybeAssign(e);return this.finishNode(a,"ConditionalExpression")}return n};$.parseExprOps=function(e,t){var r=this.start,i=this.startLoc;var n=this.parseMaybeUnary(t,false);if(this.checkExpressionErrors(t)){return n}return n.start===r&&n.type==="ArrowFunctionExpression"?n:this.parseExprOp(n,r,i,-1,e)};$.parseExprOp=function(e,t,r,i,n){var a=this.type.binop;if(a!=null&&(!n||this.type!==b._in)){if(a>i){var s=this.type===b.logicalOR||this.type===b.logicalAND;var o=this.value;this.next();var l=this.start,u=this.startLoc;var c=this.parseExprOp(this.parseMaybeUnary(null,false),l,u,a,n);var f=this.buildBinary(t,r,e,c,o,s);return this.parseExprOp(f,t,r,i,n)}}return e};$.buildBinary=function(e,t,r,i,n,a){var s=this.startNodeAt(e,t);s.left=r;s.operator=n;s.right=i;return this.finishNode(s,a?"LogicalExpression":"BinaryExpression")};$.parseMaybeUnary=function(e,t){var r=this;var i=this.start,n=this.startLoc,a;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)){a=this.parseAwait();t=true}else if(this.type.prefix){var s=this.startNode(),o=this.type===b.incDec;s.operator=this.value;s.prefix=true;this.next();s.argument=this.parseMaybeUnary(null,true);this.checkExpressionErrors(e,true);if(o){this.checkLVal(s.argument)}else if(this.strict&&s.operator==="delete"&&s.argument.type==="Identifier"){this.raiseRecoverable(s.start,"Deleting local variable in strict mode")}else{t=true}a=this.finishNode(s,o?"UpdateExpression":"UnaryExpression")}else{a=this.parseExprSubscripts(e);if(this.checkExpressionErrors(e)){return a}while(this.type.postfix&&!this.canInsertSemicolon()){var l=r.startNodeAt(i,n);l.operator=r.value;l.prefix=false;l.argument=a;r.checkLVal(a);r.next();a=r.finishNode(l,"UpdateExpression")}}if(!t&&this.eat(b.starstar)){return this.buildBinary(i,n,a,this.parseMaybeUnary(null,false),"**",false)}else{return a}};$.parseExprSubscripts=function(e){var t=this.start,r=this.startLoc;var i=this.parseExprAtom(e);var n=i.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")";if(this.checkExpressionErrors(e)||n){return i}var a=this.parseSubscripts(i,t,r);if(e&&a.type==="MemberExpression"){if(e.parenthesizedAssign>=a.start){e.parenthesizedAssign=-1}if(e.parenthesizedBind>=a.start){e.parenthesizedBind=-1}}return a};$.parseSubscripts=function(e,t,r,i){var n=this;var a=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&this.input.slice(e.start,e.end)==="async";for(var s=void 0;;){if((s=n.eat(b.bracketL))||n.eat(b.dot)){var o=n.startNodeAt(t,r);o.object=e;o.property=s?n.parseExpression():n.parseIdent(true);o.computed=!!s;if(s){n.expect(b.bracketR)}e=n.finishNode(o,"MemberExpression")}else if(!i&&n.eat(b.parenL)){var l=new H,u=n.yieldPos,c=n.awaitPos;n.yieldPos=0;n.awaitPos=0;var f=n.parseExprList(b.parenR,n.options.ecmaVersion>=8,false,l);if(a&&!n.canInsertSemicolon()&&n.eat(b.arrow)){n.checkPatternErrors(l,false);n.checkYieldAwaitInDefaultParams();n.yieldPos=u;n.awaitPos=c;return n.parseArrowExpression(n.startNodeAt(t,r),f,true)}n.checkExpressionErrors(l,true);n.yieldPos=u||n.yieldPos;n.awaitPos=c||n.awaitPos;var h=n.startNodeAt(t,r);h.callee=e;h.arguments=f;e=n.finishNode(h,"CallExpression")}else if(n.type===b.backQuote){var p=n.startNodeAt(t,r);p.tag=e;p.quasi=n.parseTemplate({isTagged:true});e=n.finishNode(p,"TaggedTemplateExpression")}else{return e}}};$.parseExprAtom=function(e){var t,r=this.potentialArrowAt===this.start;switch(this.type){case b._super:if(!this.inFunction){this.raise(this.start,"'super' outside of function or class")}t=this.startNode();this.next();if(this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL){this.unexpected()}return this.finishNode(t,"Super");case b._this:t=this.startNode();this.next();return this.finishNode(t,"ThisExpression");case b.name:var i=this.start,n=this.startLoc,a=this.containsEsc;var s=this.parseIdent(this.type!==b.name)
;if(this.options.ecmaVersion>=8&&!a&&s.name==="async"&&!this.canInsertSemicolon()&&this.eat(b._function)){return this.parseFunction(this.startNodeAt(i,n),false,false,true)}if(r&&!this.canInsertSemicolon()){if(this.eat(b.arrow)){return this.parseArrowExpression(this.startNodeAt(i,n),[s],false)}if(this.options.ecmaVersion>=8&&s.name==="async"&&this.type===b.name&&!a){s=this.parseIdent();if(this.canInsertSemicolon()||!this.eat(b.arrow)){this.unexpected()}return this.parseArrowExpression(this.startNodeAt(i,n),[s],true)}}return s;case b.regexp:var o=this.value;t=this.parseLiteral(o.value);t.regex={pattern:o.pattern,flags:o.flags};return t;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:t=this.startNode();t.value=this.type===b._null?null:this.type===b._true;t.raw=this.type.keyword;this.next();return this.finishNode(t,"Literal");case b.parenL:var l=this.start,u=this.parseParenAndDistinguishExpression(r);if(e){if(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)){e.parenthesizedAssign=l}if(e.parenthesizedBind<0){e.parenthesizedBind=l}}return u;case b.bracketL:t=this.startNode();this.next();t.elements=this.parseExprList(b.bracketR,true,true,e);return this.finishNode(t,"ArrayExpression");case b.braceL:return this.parseObj(false,e);case b._function:t=this.startNode();this.next();return this.parseFunction(t,false);case b._class:return this.parseClass(this.startNode(),false);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();default:this.unexpected()}};$.parseLiteral=function(e){var t=this.startNode();t.value=e;t.raw=this.input.slice(this.start,this.end);this.next();return this.finishNode(t,"Literal")};$.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();this.expect(b.parenR);return e};$.parseParenAndDistinguishExpression=function(e){var t=this;var r=this.start,i=this.startLoc,n,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s=this.start,o=this.startLoc;var l=[],u=true,c=false;var f=new H,h=this.yieldPos,p=this.awaitPos,d;this.yieldPos=0;this.awaitPos=0;while(this.type!==b.parenR){u?u=false:t.expect(b.comma);if(a&&t.afterTrailingComma(b.parenR,true)){c=true;break}else if(t.type===b.ellipsis){d=t.start;l.push(t.parseParenItem(t.parseRestBinding()));if(t.type===b.comma){t.raise(t.start,"Comma is not permitted after the rest element")}break}else{l.push(t.parseMaybeAssign(false,f,t.parseParenItem))}}var m=this.start,v=this.startLoc;this.expect(b.parenR);if(e&&!this.canInsertSemicolon()&&this.eat(b.arrow)){this.checkPatternErrors(f,false);this.checkYieldAwaitInDefaultParams();this.yieldPos=h;this.awaitPos=p;return this.parseParenArrowList(r,i,l)}if(!l.length||c){this.unexpected(this.lastTokStart)}if(d){this.unexpected(d)}this.checkExpressionErrors(f,true);this.yieldPos=h||this.yieldPos;this.awaitPos=p||this.awaitPos;if(l.length>1){n=this.startNodeAt(s,o);n.expressions=l;this.finishNodeAt(n,"SequenceExpression",m,v)}else{n=l[0]}}else{n=this.parseParenExpression()}if(this.options.preserveParens){var g=this.startNodeAt(r,i);g.expression=n;return this.finishNode(g,"ParenthesizedExpression")}else{return n}};$.parseParenItem=function(e){return e};$.parseParenArrowList=function(e,t,r){return this.parseArrowExpression(this.startNodeAt(e,t),r)};var X=[];$.parseNew=function(){var e=this.startNode();var t=this.parseIdent(true);if(this.options.ecmaVersion>=6&&this.eat(b.dot)){e.meta=t;var r=this.containsEsc;e.property=this.parseIdent(true);if(e.property.name!=="target"||r){this.raiseRecoverable(e.property.start,"The only valid meta property for new is new.target")}if(!this.inFunction){this.raiseRecoverable(e.start,"new.target can only be used in functions")}return this.finishNode(e,"MetaProperty")}var i=this.start,n=this.startLoc;e.callee=this.parseSubscripts(this.parseExprAtom(),i,n,true);if(this.eat(b.parenL)){e.arguments=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,false)}else{e.arguments=X}return this.finishNode(e,"NewExpression")};$.parseTemplateElement=function(e){var t=e.isTagged;var r=this.startNode();if(this.type===b.invalidTemplate){if(!t){this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal")}r.value={raw:this.value,cooked:null}}else{r.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value}}this.next();r.tail=this.type===b.backQuote;return this.finishNode(r,"TemplateElement")};$.parseTemplate=function(e){var t=this;if(e===void 0)e={};var r=e.isTagged;if(r===void 0)r=false;var i=this.startNode();this.next();i.expressions=[];var n=this.parseTemplateElement({isTagged:r});i.quasis=[n];while(!n.tail){if(t.type===b.eof){t.raise(t.pos,"Unterminated template literal")}t.expect(b.dollarBraceL);i.expressions.push(t.parseExpression());t.expect(b.braceR);i.quasis.push(n=t.parseTemplateElement({isTagged:r}))}this.next();return this.finishNode(i,"TemplateLiteral")};$.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===b.name||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===b.star)&&!w.test(this.input.slice(this.lastTokEnd,this.start))};$.parseObj=function(e,t){var r=this;var i=this.startNode(),n=true,a={};i.properties=[];this.next();while(!this.eat(b.braceR)){if(!n){r.expect(b.comma);if(r.afterTrailingComma(b.braceR)){break}}else{n=false}var s=r.parseProperty(e,t);if(!e){r.checkPropClash(s,a,t)}i.properties.push(s)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};$.parseProperty=function(e,t){var r=this.startNode(),i,n,a,s;if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis)){if(e){r.argument=this.parseIdent(false);if(this.type===b.comma){this.raise(this.start,"Comma is not permitted after the rest element")}return this.finishNode(r,"RestElement")}if(this.type===b.parenL&&t){if(t.parenthesizedAssign<0){t.parenthesizedAssign=this.start}if(t.parenthesizedBind<0){t.parenthesizedBind=this.start}}r.argument=this.parseMaybeAssign(false,t);if(this.type===b.comma&&t&&t.trailingComma<0){t.trailingComma=this.start}return this.finishNode(r,"SpreadElement")}if(this.options.ecmaVersion>=6){r.method=false;r.shorthand=false;if(e||t){a=this.start;s=this.startLoc}if(!e){i=this.eat(b.star)}}var o=this.containsEsc;this.parsePropertyName(r);if(!e&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(r)){n=true;i=this.options.ecmaVersion>=9&&this.eat(b.star);this.parsePropertyName(r,t)}else{n=false}this.parsePropertyValue(r,e,i,n,a,s,t,o);return this.finishNode(r,"Property")};$.parsePropertyValue=function(e,t,r,i,n,a,s,o){if((r||i)&&this.type===b.colon){this.unexpected()}if(this.eat(b.colon)){e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(false,s);e.kind="init"}else if(this.options.ecmaVersion>=6&&this.type===b.parenL){if(t){this.unexpected()}e.kind="init";e.method=true;e.value=this.parseMethod(r,i)}else if(!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&(this.type!==b.comma&&this.type!==b.braceR)){if(r||i){this.unexpected()}e.kind=e.key.name;this.parsePropertyName(e);e.value=this.parseMethod(false);var l=e.kind==="get"?0:1;if(e.value.params.length!==l){var u=e.value.start;if(e.kind==="get"){this.raiseRecoverable(u,"getter should have no params")}else{this.raiseRecoverable(u,"setter should have exactly one param")}}else{if(e.kind==="set"&&e.value.params[0].type==="RestElement"){this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}}}else if(this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"){this.checkUnreserved(e.key);e.kind="init";if(t){e.value=this.parseMaybeDefault(n,a,e.key)}else if(this.type===b.eq&&s){if(s.shorthandAssign<0){s.shorthandAssign=this.start}e.value=this.parseMaybeDefault(n,a,e.key)}else{e.value=e.key}e.shorthand=true}else{this.unexpected()}};$.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL)){e.computed=true;e.key=this.parseMaybeAssign();this.expect(b.bracketR);return e.key}else{e.computed=false}}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent(true)};$.initFunction=function(e){e.id=null;if(this.options.ecmaVersion>=6){e.generator=false;e.expression=false}if(this.options.ecmaVersion>=8){e.async=false}};$.parseMethod=function(e,t){var r=this.startNode(),i=this.inGenerator,n=this.inAsync,a=this.yieldPos,s=this.awaitPos,o=this.inFunction;this.initFunction(r);if(this.options.ecmaVersion>=6){r.generator=e}if(this.options.ecmaVersion>=8){r.async=!!t}this.inGenerator=r.generator;this.inAsync=r.async;this.yieldPos=0;this.awaitPos=0;this.inFunction=true;this.enterFunctionScope();this.expect(b.parenL);r.params=this.parseBindingList(b.parenR,false,this.options.ecmaVersion>=8);this.checkYieldAwaitInDefaultParams();this.parseFunctionBody(r,false);this.inGenerator=i;this.inAsync=n;this.yieldPos=a;this.awaitPos=s;this.inFunction=o;return this.finishNode(r,"FunctionExpression")};$.parseArrowExpression=function(e,t,r){var i=this.inGenerator,n=this.inAsync,a=this.yieldPos,s=this.awaitPos,o=this.inFunction;this.enterFunctionScope();this.initFunction(e);if(this.options.ecmaVersion>=8){e.async=!!r}this.inGenerator=false;this.inAsync=e.async;this.yieldPos=0;this.awaitPos=0;this.inFunction=true;e.params=this.toAssignableList(t,true);this.parseFunctionBody(e,true);this.inGenerator=i;this.inAsync=n;this.yieldPos=a;this.awaitPos=s;this.inFunction=o;return this.finishNode(e,"ArrowFunctionExpression")};$.parseFunctionBody=function(e,t){var r=t&&this.type!==b.braceL;var i=this.strict,n=false;if(r){e.body=this.parseMaybeAssign();e.expression=true;this.checkParams(e,false)}else{var a=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);if(!i||a){n=this.strictDirective(this.end);if(n&&a){this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list")}}var s=this.labels;this.labels=[];if(n){this.strict=true}this.checkParams(e,!i&&!n&&!t&&this.isSimpleParamList(e.params));e.body=this.parseBlock(false);e.expression=false;this.adaptDirectivePrologue(e.body.body);this.labels=s}this.exitFunctionScope();if(this.strict&&e.id){this.checkLVal(e.id,"none")}this.strict=i};$.isSimpleParamList=function(e){for(var t=0,r=e;t<r.length;t+=1){var i=r[t];if(i.type!=="Identifier"){return false}}return true};$.checkParams=function(e,t){var r=this;var i={};for(var n=0,a=e.params;n<a.length;n+=1){var s=a[n];r.checkLVal(s,"var",t?null:i)}};$.parseExprList=function(e,t,r,i){var n=this;var a=[],s=true;while(!this.eat(e)){if(!s){n.expect(b.comma);if(t&&n.afterTrailingComma(e)){break}}else{s=false}var o=void 0;if(r&&n.type===b.comma){o=null}else if(n.type===b.ellipsis){o=n.parseSpread(i);if(i&&n.type===b.comma&&i.trailingComma<0){i.trailingComma=n.start}}else{o=n.parseMaybeAssign(false,i)}a.push(o)}return a};$.checkUnreserved=function(e){var t=e.start;var r=e.end;var i=e.name;if(this.inGenerator&&i==="yield"){this.raiseRecoverable(t,"Can not use 'yield' as identifier inside a generator")}if(this.inAsync&&i==="await"){this.raiseRecoverable(t,"Can not use 'await' as identifier inside an async function")}if(this.isKeyword(i)){this.raise(t,"Unexpected keyword '"+i+"'")}if(this.options.ecmaVersion<6&&this.input.slice(t,r).indexOf("\\")!==-1){return}var n=this.strict?this.reservedWordsStrict:this.reservedWords;if(n.test(i)){if(!this.inAsync&&i==="await"){this.raiseRecoverable(t,"Can not use keyword 'await' outside an async function")}this.raiseRecoverable(t,"The keyword '"+i+"' is reserved")}};$.parseIdent=function(e,t){var r=this.startNode();if(e&&this.options.allowReserved==="never"){e=false}if(this.type===b.name){r.name=this.value}else if(this.type.keyword){r.name=this.type.keyword;if((r.name==="class"||r.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)){this.context.pop()}}else{this.unexpected()}this.next();this.finishNode(r,"Identifier");if(!e){this.checkUnreserved(r)}return r};$.parseYield=function(){if(!this.yieldPos){this.yieldPos=this.start}var e=this.startNode();this.next();if(this.type===b.semi||this.canInsertSemicolon()||this.type!==b.star&&!this.type.startsExpr){e.delegate=false;e.argument=null}else{e.delegate=this.eat(b.star);e.argument=this.parseMaybeAssign()}return this.finishNode(e,"YieldExpression")};$.parseAwait=function(){if(!this.awaitPos){this.awaitPos=this.start}var e=this.startNode();this.next();e.argument=this.parseMaybeUnary(null,true);return this.finishNode(e,"AwaitExpression")};var Y=z.prototype;Y.raise=function(e,t){var r=I(this.input,e);t+=" ("+r.line+":"+r.column+")";var i=new SyntaxError(t);i.pos=e;i.loc=r;i.raisedAt=this.pos;throw i};Y.raiseRecoverable=Y.raise;Y.curPosition=function(){if(this.options.locations){return new _(this.curLine,this.pos-this.lineStart)}};var Q=z.prototype;var Z=Object.assign||function(e){var t=[],r=arguments.length-1;while(r-- >0)t[r]=arguments[r+1];for(var i=0,n=t;i<n.length;i+=1){var a=n[i];for(var s in a){if(M(a,s)){e[s]=a[s]}}}return e};Q.enterFunctionScope=function(){this.scopeStack.push({var:{},lexical:{},childVar:{},parentLexical:{}})};Q.exitFunctionScope=function(){this.scopeStack.pop()};Q.enterLexicalScope=function(){var e=this.scopeStack[this.scopeStack.length-1];var t={var:{},lexical:{},childVar:{},parentLexical:{}};this.scopeStack.push(t);Z(t.parentLexical,e.lexical,e.parentLexical)};Q.exitLexicalScope=function(){var e=this.scopeStack.pop();var t=this.scopeStack[this.scopeStack.length-1];Z(t.childVar,e.var,e.childVar)};Q.canDeclareVarName=function(e){var t=this.scopeStack[this.scopeStack.length-1];return!M(t.lexical,e)&&!M(t.parentLexical,e)};Q.canDeclareLexicalName=function(e){var t=this.scopeStack[this.scopeStack.length-1];return!M(t.lexical,e)&&!M(t.var,e)&&!M(t.childVar,e)};Q.declareVarName=function(e){this.scopeStack[this.scopeStack.length-1].var[e]=true};Q.declareLexicalName=function(e){this.scopeStack[this.scopeStack.length-1].lexical[e]=true};var J=function e(t,r,i){this.type="";this.start=r;this.end=0;if(t.options.locations){this.loc=new P(t,i)}if(t.options.directSourceFile){this.sourceFile=t.options.directSourceFile}if(t.options.ranges){this.range=[r,0]}};var ee=z.prototype;ee.startNode=function(){return new J(this,this.start,this.startLoc)};ee.startNodeAt=function(e,t){return new J(this,e,t)};function te(e,t,r,i){e.type=t;e.end=r;if(this.options.locations){e.loc.end=i}if(this.options.ranges){e.range[1]=r}return e}ee.finishNode=function(e,t){return te.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};ee.finishNodeAt=function(e,t,r,i){return te.call(this,e,t,r,i)};var re=function e(t,r,i,n,a){this.token=t;this.isExpr=!!r;this.preserveSpace=!!i;this.override=n;this.generator=!!a};var ie={b_stat:new re("{",false),b_expr:new re("{",true),b_tmpl:new re("${",false),p_stat:new re("(",false),p_expr:new re("(",true),q_tmpl:new re("`",true,true,function(e){return e.tryReadTemplateToken()}),f_stat:new re("function",false),f_expr:new re("function",true),f_expr_gen:new re("function",true,false,null,true),f_gen:new re("function",false,false,null,true)};var ne=z.prototype;ne.initialContext=function(){return[ie.b_stat]};ne.braceIsBlock=function(e){var t=this.curContext();if(t===ie.f_expr||t===ie.f_stat){return true}if(e===b.colon&&(t===ie.b_stat||t===ie.b_expr)){return!t.isExpr}if(e===b._return||e===b.name&&this.exprAllowed){return w.test(this.input.slice(this.lastTokEnd,this.start))}if(e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow){return true}if(e===b.braceL){return t===ie.b_stat}if(e===b._var||e===b.name){return false}return!this.exprAllowed};ne.inGeneratorContext=function(){var e=this;for(var t=this.context.length-1;t>=1;t--){var r=e.context[t];if(r.token==="function"){return r.generator}}return false};ne.updateContext=function(e){var t,r=this.type;if(r.keyword&&e===b.dot){this.exprAllowed=false}else if(t=r.updateContext){t.call(this,e)}else{this.exprAllowed=r.beforeExpr}};b.parenR.updateContext=b.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=true;return}var e=this.context.pop();if(e===ie.b_stat&&this.curContext().token==="function"){e=this.context.pop()}this.exprAllowed=!e.isExpr};b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ie.b_stat:ie.b_expr);this.exprAllowed=true};b.dollarBraceL.updateContext=function(){this.context.push(ie.b_tmpl);this.exprAllowed=true};b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?ie.p_stat:ie.p_expr);this.exprAllowed=true};b.incDec.updateContext=function(){};b._function.updateContext=b._class.updateContext=function(e){if(e.beforeExpr&&e!==b.semi&&e!==b._else&&!((e===b.colon||e===b.braceL)&&this.curContext()===ie.b_stat)){this.context.push(ie.f_expr)}else{this.context.push(ie.f_stat)}this.exprAllowed=false};b.backQuote.updateContext=function(){if(this.curContext()===ie.q_tmpl){this.context.pop()}else{this.context.push(ie.q_tmpl)}this.exprAllowed=false};b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;if(this.context[t]===ie.f_expr){this.context[t]=ie.f_expr_gen}else{this.context[t]=ie.f_gen}}this.exprAllowed=true};b.name.updateContext=function(e){var t=false;if(this.options.ecmaVersion>=6&&e!==b.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext()){t=true}}this.exprAllowed=t};var ae={$LONE:["ASCII","ASCII_Hex_Digit","AHex","Alphabetic","Alpha","Any","Assigned","Bidi_Control","Bidi_C","Bidi_Mirrored","Bidi_M","Case_Ignorable","CI","Cased","Changes_When_Casefolded","CWCF","Changes_When_Casemapped","CWCM","Changes_When_Lowercased","CWL","Changes_When_NFKC_Casefolded","CWKCF","Changes_When_Titlecased","CWT","Changes_When_Uppercased","CWU","Dash","Default_Ignorable_Code_Point","DI","Deprecated","Dep","Diacritic","Dia","Emoji","Emoji_Component","Emoji_Modifier","Emoji_Modifier_Base","Emoji_Presentation","Extender","Ext","Grapheme_Base","Gr_Base","Grapheme_Extend","Gr_Ext","Hex_Digit","Hex","IDS_Binary_Operator","IDSB","IDS_Trinary_Operator","IDST","ID_Continue","IDC","ID_Start","IDS","Ideographic","Ideo","Join_Control","Join_C","Logical_Order_Exception","LOE","Lowercase","Lower","Math","Noncharacter_Code_Point","NChar","Pattern_Syntax","Pat_Syn","Pattern_White_Space","Pat_WS","Quotation_Mark","QMark","Radical","Regional_Indicator","RI","Sentence_Terminal","STerm","Soft_Dotted","SD","Terminal_Punctuation","Term","Unified_Ideograph","UIdeo","Uppercase","Upper","Variation_Selector","VS","White_Space","space","XID_Continue","XIDC","XID_Start","XIDS"],General_Category:["Cased_Letter","LC","Close_Punctuation","Pe","Connector_Punctuation","Pc","Control","Cc","cntrl","Currency_Symbol","Sc","Dash_Punctuation","Pd","Decimal_Number","Nd","digit","Enclosing_Mark","Me","Final_Punctuation","Pf","Format","Cf","Initial_Punctuation","Pi","Letter","L","Letter_Number","Nl","Line_Separator","Zl","Lowercase_Letter","Ll","Mark","M","Combining_Mark","Math_Symbol","Sm","Modifier_Letter","Lm","Modifier_Symbol","Sk","Nonspacing_Mark","Mn","Number","N","Open_Punctuation","Ps","Other","C","Other_Letter","Lo","Other_Number","No","Other_Punctuation","Po","Other_Symbol","So","Paragraph_Separator","Zp","Private_Use","Co","Punctuation","P","punct","Separator","Z","Space_Separator","Zs","Spacing_Mark","Mc","Surrogate","Cs","Symbol","S","Titlecase_Letter","Lt","Unassigned","Cn","Uppercase_Letter","Lu"],Script:["Adlam","Adlm","Ahom","Anatolian_Hieroglyphs","Hluw","Arabic","Arab","Armenian","Armn","Avestan","Avst","Balinese","Bali","Bamum","Bamu","Bassa_Vah","Bass","Batak","Batk","Bengali","Beng","Bhaiksuki","Bhks","Bopomofo","Bopo","Brahmi","Brah","Braille","Brai","Buginese","Bugi","Buhid","Buhd","Canadian_Aboriginal","Cans","Carian","Cari","Caucasian_Albanian","Aghb","Chakma","Cakm","Cham","Cherokee","Cher","Common","Zyyy","Coptic","Copt","Qaac","Cuneiform","Xsux","Cypriot","Cprt","Cyrillic","Cyrl","Deseret","Dsrt","Devanagari","Deva","Duployan","Dupl","Egyptian_Hieroglyphs","Egyp","Elbasan","Elba","Ethiopic","Ethi","Georgian","Geor","Glagolitic","Glag","Gothic","Goth","Grantha","Gran","Greek","Grek","Gujarati","Gujr","Gurmukhi","Guru","Han","Hani","Hangul","Hang","Hanunoo","Hano","Hatran","Hatr","Hebrew","Hebr","Hiragana","Hira","Imperial_Aramaic","Armi","Inherited","Zinh","Qaai","Inscriptional_Pahlavi","Phli","Inscriptional_Parthian","Prti","Javanese","Java","Kaithi","Kthi","Kannada","Knda","Katakana","Kana","Kayah_Li","Kali","Kharoshthi","Khar","Khmer","Khmr","Khojki","Khoj","Khudawadi","Sind","Lao","Laoo","Latin","Latn","Lepcha","Lepc","Limbu","Limb","Linear_A","Lina","Linear_B","Linb","Lisu","Lycian","Lyci","Lydian","Lydi","Mahajani","Mahj","Malayalam","Mlym","Mandaic","Mand","Manichaean","Mani","Marchen","Marc","Masaram_Gondi","Gonm","Meetei_Mayek","Mtei","Mende_Kikakui","Mend","Meroitic_Cursive","Merc","Meroitic_Hieroglyphs","Mero","Miao","Plrd","Modi","Mongolian","Mong","Mro","Mroo","Multani","Mult","Myanmar","Mymr","Nabataean","Nbat","New_Tai_Lue","Talu","Newa","Nko","Nkoo","Nushu","Nshu","Ogham","Ogam","Ol_Chiki","Olck","Old_Hungarian","Hung","Old_Italic","Ital","Old_North_Arabian","Narb","Old_Permic","Perm","Old_Persian","Xpeo","Old_South_Arabian","Sarb","Old_Turkic","Orkh","Oriya","Orya","Osage","Osge","Osmanya","Osma","Pahawh_Hmong","Hmng","Palmyrene","Palm","Pau_Cin_Hau","Pauc","Phags_Pa","Phag","Phoenician","Phnx","Psalter_Pahlavi","Phlp","Rejang","Rjng","Runic","Runr","Samaritan","Samr","Saurashtra","Saur","Sharada","Shrd","Shavian","Shaw","Siddham","Sidd","SignWriting","Sgnw","Sinhala","Sinh","Sora_Sompeng","Sora","Soyombo","Soyo","Sundanese","Sund","Syloti_Nagri","Sylo","Syriac","Syrc","Tagalog","Tglg","Tagbanwa","Tagb","Tai_Le","Tale","Tai_Tham","Lana","Tai_Viet","Tavt","Takri","Takr","Tamil","Taml","Tangut","Tang","Telugu","Telu","Thaana","Thaa","Thai","Tibetan","Tibt","Tifinagh","Tfng","Tirhuta","Tirh","Ugaritic","Ugar","Vai","Vaii","Warang_Citi","Wara","Yi","Yiii","Zanabazar_Square","Zanb"]};Array.prototype.push.apply(ae.$LONE,ae.General_Category);ae.gc=ae.General_Category;ae.sc=ae.Script_Extensions=ae.scx=ae.Script;var se=z.prototype;var oe=function e(t){this.parser=t;this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"");this.source="";this.flags="";this.start=0;this.switchU=false;this.switchN=false;this.pos=0;this.lastIntValue=0;this.lastStringValue="";this.lastAssertionIsQuantifiable=false;this.numCapturingParens=0;this.maxBackReference=0;this.groupNames=[];this.backReferenceNames=[]};oe.prototype.reset=function e(t,r,i){var n=i.indexOf("u")!==-1;this.start=t|0;this.source=r+"";this.flags=i;this.switchU=n&&this.parser.options.ecmaVersion>=6;this.switchN=n&&this.parser.options.ecmaVersion>=9};oe.prototype.raise=function e(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};oe.prototype.at=function e(t){var r=this.source;var i=r.length;if(t>=i){return-1}var n=r.charCodeAt(t);if(!this.switchU||n<=55295||n>=57344||t+1>=i){return n}var a=r.charCodeAt(t+1);return a>=56320&&a<=57343?(n<<10)+a-56613888:n};oe.prototype.nextIndex=function e(t){var r=this.source;var i=r.length;if(t>=i){return i}var n=r.charCodeAt(t),a;if(!this.switchU||n<=55295||n>=57344||t+1>=i||(a=r.charCodeAt(t+1))<56320||a>57343){return t+1}return t+2};oe.prototype.current=function e(){return this.at(this.pos)};oe.prototype.lookahead=function e(){return this.at(this.nextIndex(this.pos))};oe.prototype.advance=function e(){this.pos=this.nextIndex(this.pos)};oe.prototype.eat=function e(t){if(this.current()===t){this.advance();return true}return false};function le(e){if(e<=65535){return String.fromCharCode(e)}e-=65536;return String.fromCharCode((e>>10)+55296,(e&1023)+56320)}se.validateRegExpFlags=function(e){var t=this;var r=e.validFlags;var i=e.flags;for(var n=0;n<i.length;n++){var a=i.charAt(n);if(r.indexOf(a)===-1){t.raise(e.start,"Invalid regular expression flag")}if(i.indexOf(a,n+1)>-1){t.raise(e.start,"Duplicate regular expression flag")}}};se.validateRegExpPattern=function(e){this.regexp_pattern(e);if(!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0){e.switchN=true;this.regexp_pattern(e)}};se.regexp_pattern=function(e){e.pos=0;e.lastIntValue=0;e.lastStringValue="";e.lastAssertionIsQuantifiable=false;e.numCapturingParens=0;e.maxBackReference=0;e.groupNames.length=0;e.backReferenceNames.length=0;this.regexp_disjunction(e);if(e.pos!==e.source.length){if(e.eat(41)){e.raise("Unmatched ')'")}if(e.eat(93)||e.eat(125)){e.raise("Lone quantifier brackets")}}if(e.maxBackReference>e.numCapturingParens){e.raise("Invalid escape")}for(var t=0,r=e.backReferenceNames;t<r.length;t+=1){var i=r[t];if(e.groupNames.indexOf(i)===-1){e.raise("Invalid named capture referenced")}}};se.regexp_disjunction=function(e){var t=this;this.regexp_alternative(e);while(e.eat(124)){t.regexp_alternative(e)}if(this.regexp_eatQuantifier(e,true)){e.raise("Nothing to repeat")}if(e.eat(123)){e.raise("Lone quantifier brackets")}};se.regexp_alternative=function(e){while(e.pos<e.source.length&&this.regexp_eatTerm(e)){}};se.regexp_eatTerm=function(e){if(this.regexp_eatAssertion(e)){if(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)){if(e.switchU){e.raise("Invalid quantifier")}}return true}if(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e)){this.regexp_eatQuantifier(e);return true}return false};se.regexp_eatAssertion=function(e){var t=e.pos;e.lastAssertionIsQuantifiable=false;if(e.eat(94)||e.eat(36)){return true}if(e.eat(92)){if(e.eat(66)||e.eat(98)){return true}e.pos=t}if(e.eat(40)&&e.eat(63)){var r=false;if(this.options.ecmaVersion>=9){r=e.eat(60)}if(e.eat(61)||e.eat(33)){this.regexp_disjunction(e);if(!e.eat(41)){e.raise("Unterminated group")}e.lastAssertionIsQuantifiable=!r;return true}}e.pos=t;return false};se.regexp_eatQuantifier=function(e,t){if(t===void 0)t=false;if(this.regexp_eatQuantifierPrefix(e,t)){e.eat(63);return true}return false};se.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};se.regexp_eatBracedQuantifier=function(e,t){var r=e.pos;if(e.eat(123)){var i=0,n=-1;if(this.regexp_eatDecimalDigits(e)){i=e.lastIntValue;if(e.eat(44)&&this.regexp_eatDecimalDigits(e)){n=e.lastIntValue}if(e.eat(125)){if(n!==-1&&n<i&&!t){e.raise("numbers out of order in {} quantifier")}return true}}if(e.switchU&&!t){e.raise("Incomplete quantifier")}e.pos=r}return false};se.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};se.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e)){return true}e.pos=t}return false};se.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){this.regexp_disjunction(e);if(e.eat(41)){return true}e.raise("Unterminated group")}e.pos=t}return false};se.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9){this.regexp_groupSpecifier(e)}else if(e.current()===63){e.raise("Invalid group")}this.regexp_disjunction(e);if(e.eat(41)){e.numCapturingParens+=1;return true}e.raise("Unterminated group")}return false};se.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};se.regexp_eatInvalidBracedQuantifier=function(e){if(this.regexp_eatBracedQuantifier(e,true)){e.raise("Nothing to repeat")}return false};se.regexp_eatSyntaxCharacter=function(e){var t=e.current();if(ue(t)){e.lastIntValue=t;e.advance();return true}return false};function ue(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}se.regexp_eatPatternCharacters=function(e){var t=e.pos;var r=0;while((r=e.current())!==-1&&!ue(r)){e.advance()}return e.pos!==t};se.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();if(t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124){e.advance();return true}return false};se.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){if(e.groupNames.indexOf(e.lastStringValue)!==-1){e.raise("Duplicate capture group name")}e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};se.regexp_eatGroupName=function(e){e.lastStringValue="";if(e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62)){return true}e.raise("Invalid capture group name")}return false};se.regexp_eatRegExpIdentifierName=function(e){e.lastStringValue="";if(this.regexp_eatRegExpIdentifierStart(e)){e.lastStringValue+=le(e.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(e)){e.lastStringValue+=le(e.lastIntValue)}return true}return false};se.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos;var r=e.current();e.advance();if(r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e)){r=e.lastIntValue}if(ce(r)){e.lastIntValue=r;return true}e.pos=t;return false};function ce(e){return h(e,true)||e===36||e===95}se.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos;var r=e.current();e.advance();if(r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e)){r=e.lastIntValue}if(fe(r)){e.lastIntValue=r;return true}e.pos=t;return false};function fe(e){return p(e,true)||e===36||e===95||e===8204||e===8205}se.regexp_eatAtomEscape=function(e){if(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)){return true}if(e.switchU){if(e.current()===99){e.raise("Invalid unicode escape")}e.raise("Invalid escape")}return false};se.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var r=e.lastIntValue;if(e.switchU){if(r>e.maxBackReference){e.maxBackReference=r}return true}if(r<=e.numCapturingParens){return true}e.pos=t}return false};se.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e)){e.backReferenceNames.push(e.lastStringValue);return true}e.raise("Invalid named reference")}return false};se.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};se.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e)){return true}e.pos=t}return false};se.regexp_eatZero=function(e){if(e.current()===48&&!ge(e.lookahead())){e.lastIntValue=0;e.advance();return true}return false};se.regexp_eatControlEscape=function(e){var t=e.current();if(t===116){e.lastIntValue=9;e.advance();return true}if(t===110){e.lastIntValue=10;e.advance();return true}if(t===118){e.lastIntValue=11;e.advance();return true}if(t===102){e.lastIntValue=12;e.advance();return true}if(t===114){e.lastIntValue=13;e.advance();return true}return false};se.regexp_eatControlLetter=function(e){var t=e.current();if(he(t)){e.lastIntValue=t%32;e.advance();return true}return false};function he(e){return e>=65&&e<=90||e>=97&&e<=122}se.regexp_eatRegExpUnicodeEscapeSequence=function(e){var t=e.pos;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(e.switchU&&r>=55296&&r<=56319){var i=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(n>=56320&&n<=57343){e.lastIntValue=(r-55296)*1024+(n-56320)+65536;return true}}e.pos=i;e.lastIntValue=r}return true}if(e.switchU&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&pe(e.lastIntValue)){return true}if(e.switchU){e.raise("Invalid unicode escape")}
e.pos=t}return false};function pe(e){return e>=0&&e<=1114111}se.regexp_eatIdentityEscape=function(e){if(e.switchU){if(this.regexp_eatSyntaxCharacter(e)){return true}if(e.eat(47)){e.lastIntValue=47;return true}return false}var t=e.current();if(t!==99&&(!e.switchN||t!==107)){e.lastIntValue=t;e.advance();return true}return false};se.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48);e.advance()}while((t=e.current())>=48&&t<=57);return true}return false};se.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(de(t)){e.lastIntValue=-1;e.advance();return true}if(e.switchU&&this.options.ecmaVersion>=9&&(t===80||t===112)){e.lastIntValue=-1;e.advance();if(e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125)){return true}e.raise("Invalid property name")}return false};function de(e){return e===100||e===68||e===115||e===83||e===119||e===87}se.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;this.regexp_validateUnicodePropertyNameAndValue(e,r,i);return true}}e.pos=t;if(this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;this.regexp_validateUnicodePropertyNameOrValue(e,n);return true}return false};se.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){if(!ae.hasOwnProperty(t)||ae[t].indexOf(r)===-1){e.raise("Invalid property name")}};se.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(ae.$LONE.indexOf(t)===-1){e.raise("Invalid property name")}};se.regexp_eatUnicodePropertyName=function(e){var t=0;e.lastStringValue="";while(me(t=e.current())){e.lastStringValue+=le(t);e.advance()}return e.lastStringValue!==""};function me(e){return he(e)||e===95}se.regexp_eatUnicodePropertyValue=function(e){var t=0;e.lastStringValue="";while(ve(t=e.current())){e.lastStringValue+=le(t);e.advance()}return e.lastStringValue!==""};function ve(e){return me(e)||ge(e)}se.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};se.regexp_eatCharacterClass=function(e){if(e.eat(91)){e.eat(94);this.regexp_classRanges(e);if(e.eat(93)){return true}e.raise("Unterminated character class")}return false};se.regexp_classRanges=function(e){var t=this;while(this.regexp_eatClassAtom(e)){var r=e.lastIntValue;if(e.eat(45)&&t.regexp_eatClassAtom(e)){var i=e.lastIntValue;if(e.switchU&&(r===-1||i===-1)){e.raise("Invalid character class")}if(r!==-1&&i!==-1&&r>i){e.raise("Range out of order in character class")}}}};se.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e)){return true}if(e.switchU){var r=e.current();if(r===99||be(r)){e.raise("Invalid class escape")}e.raise("Invalid escape")}e.pos=t}var i=e.current();if(i!==93){e.lastIntValue=i;e.advance();return true}return false};se.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98)){e.lastIntValue=8;return true}if(e.switchU&&e.eat(45)){e.lastIntValue=45;return true}if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e)){return true}e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};se.regexp_eatClassControlLetter=function(e){var t=e.current();if(ge(t)||t===95){e.lastIntValue=t%32;e.advance();return true}return false};se.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2)){return true}if(e.switchU){e.raise("Invalid escape")}e.pos=t}return false};se.regexp_eatDecimalDigits=function(e){var t=e.pos;var r=0;e.lastIntValue=0;while(ge(r=e.current())){e.lastIntValue=10*e.lastIntValue+(r-48);e.advance()}return e.pos!==t};function ge(e){return e>=48&&e<=57}se.regexp_eatHexDigits=function(e){var t=e.pos;var r=0;e.lastIntValue=0;while(ye(r=e.current())){e.lastIntValue=16*e.lastIntValue+xe(r);e.advance()}return e.pos!==t};function ye(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function xe(e){if(e>=65&&e<=70){return 10+(e-65)}if(e>=97&&e<=102){return 10+(e-97)}return e-48}se.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;if(t<=3&&this.regexp_eatOctalDigit(e)){e.lastIntValue=t*64+r*8+e.lastIntValue}else{e.lastIntValue=t*8+r}}else{e.lastIntValue=t}return true}return false};se.regexp_eatOctalDigit=function(e){var t=e.current();if(be(t)){e.lastIntValue=t-48;e.advance();return true}e.lastIntValue=0;return false};function be(e){return e>=48&&e<=55}se.regexp_eatFixedHexDigits=function(e,t){var r=e.pos;e.lastIntValue=0;for(var i=0;i<t;++i){var n=e.current();if(!ye(n)){e.pos=r;return false}e.lastIntValue=16*e.lastIntValue+xe(n);e.advance()}return true};var we=function e(t){this.type=t.type;this.value=t.value;this.start=t.start;this.end=t.end;if(t.options.locations){this.loc=new P(t,t.startLoc,t.endLoc)}if(t.options.ranges){this.range=[t.start,t.end]}};var ke=z.prototype;ke.next=function(){if(this.options.onToken){this.options.onToken(new we(this))}this.lastTokEnd=this.end;this.lastTokStart=this.start;this.lastTokEndLoc=this.endLoc;this.lastTokStartLoc=this.startLoc;this.nextToken()};ke.getToken=function(){this.next();return new we(this)};if(typeof Symbol!=="undefined"){ke[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}}ke.curContext=function(){return this.context[this.context.length-1]};ke.nextToken=function(){var e=this.curContext();if(!e||!e.preserveSpace){this.skipSpace()}this.start=this.pos;if(this.options.locations){this.startLoc=this.curPosition()}if(this.pos>=this.input.length){return this.finishToken(b.eof)}if(e.override){return e.override(this)}else{this.readToken(this.fullCharCodeAtPos())}};ke.readToken=function(e){if(h(e,this.options.ecmaVersion>=6)||e===92){return this.readWord()}return this.getTokenFromCode(e)};ke.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=57344){return e}var t=this.input.charCodeAt(this.pos+1);return(e<<10)+t-56613888};ke.skipBlockComment=function(){var e=this;var t=this.options.onComment&&this.curPosition();var r=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1){this.raise(this.pos-2,"Unterminated comment")}this.pos=i+2;if(this.options.locations){k.lastIndex=r;var n;while((n=k.exec(this.input))&&n.index<this.pos){++e.curLine;e.lineStart=n.index+n[0].length}}if(this.options.onComment){this.options.onComment(true,this.input.slice(r+2,i),r,this.pos,t,this.curPosition())}};ke.skipLineComment=function(e){var t=this;var r=this.pos;var i=this.options.onComment&&this.curPosition();var n=this.input.charCodeAt(this.pos+=e);while(this.pos<this.input.length&&!C(n)){n=t.input.charCodeAt(++t.pos)}if(this.options.onComment){this.options.onComment(false,this.input.slice(r+e,this.pos),r,this.pos,i,this.curPosition())}};ke.skipSpace=function(){var e=this;e:while(this.pos<this.input.length){var t=e.input.charCodeAt(e.pos);switch(t){case 32:case 160:++e.pos;break;case 13:if(e.input.charCodeAt(e.pos+1)===10){++e.pos}case 10:case 8232:case 8233:++e.pos;if(e.options.locations){++e.curLine;e.lineStart=e.pos}break;case 47:switch(e.input.charCodeAt(e.pos+1)){case 42:e.skipBlockComment();break;case 47:e.skipLineComment(2);break;default:break e}break;default:if(t>8&&t<14||t>=5760&&S.test(String.fromCharCode(t))){++e.pos}else{break e}}}};ke.finishToken=function(e,t){this.end=this.pos;if(this.options.locations){this.endLoc=this.curPosition()}var r=this.type;this.type=e;this.value=t;this.updateContext(r)};ke.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57){return this.readNumber(true)}var t=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&e===46&&t===46){this.pos+=3;return this.finishToken(b.ellipsis)}else{++this.pos;return this.finishToken(b.dot)}};ke.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);if(this.exprAllowed){++this.pos;return this.readRegexp()}if(e===61){return this.finishOp(b.assign,2)}return this.finishOp(b.slash,1)};ke.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1);var r=1;var i=e===42?b.star:b.modulo;if(this.options.ecmaVersion>=7&&e===42&&t===42){++r;i=b.starstar;t=this.input.charCodeAt(this.pos+2)}if(t===61){return this.finishOp(b.assign,r+1)}return this.finishOp(i,r)};ke.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){return this.finishOp(e===124?b.logicalOR:b.logicalAND,2)}if(t===61){return this.finishOp(b.assign,2)}return this.finishOp(e===124?b.bitwiseOR:b.bitwiseAND,1)};ke.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);if(e===61){return this.finishOp(b.assign,2)}return this.finishOp(b.bitwiseXOR,1)};ke.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||w.test(this.input.slice(this.lastTokEnd,this.pos)))){this.skipLineComment(3);this.skipSpace();return this.nextToken()}return this.finishOp(b.incDec,2)}if(t===61){return this.finishOp(b.assign,2)}return this.finishOp(b.plusMin,1)};ke.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1);var r=1;if(t===e){r=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2;if(this.input.charCodeAt(this.pos+r)===61){return this.finishOp(b.assign,r+1)}return this.finishOp(b.bitShift,r)}if(t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45){this.skipLineComment(4);this.skipSpace();return this.nextToken()}if(t===61){r=2}return this.finishOp(b.relational,r)};ke.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===61){return this.finishOp(b.equality,this.input.charCodeAt(this.pos+2)===61?3:2)}if(e===61&&t===62&&this.options.ecmaVersion>=6){this.pos+=2;return this.finishToken(b.arrow)}return this.finishOp(e===61?b.eq:b.prefix,1)};ke.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:++this.pos;return this.finishToken(b.parenL);case 41:++this.pos;return this.finishToken(b.parenR);case 59:++this.pos;return this.finishToken(b.semi);case 44:++this.pos;return this.finishToken(b.comma);case 91:++this.pos;return this.finishToken(b.bracketL);case 93:++this.pos;return this.finishToken(b.bracketR);case 123:++this.pos;return this.finishToken(b.braceL);case 125:++this.pos;return this.finishToken(b.braceR);case 58:++this.pos;return this.finishToken(b.colon);case 63:++this.pos;return this.finishToken(b.question);case 96:if(this.options.ecmaVersion<6){break}++this.pos;return this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88){return this.readRadixNumber(16)}if(this.options.ecmaVersion>=6){if(t===111||t===79){return this.readRadixNumber(8)}if(t===98||t===66){return this.readRadixNumber(2)}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(false);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(b.prefix,1)}this.raise(this.pos,"Unexpected character '"+Ce(e)+"'")};ke.finishOp=function(e,t){var r=this.input.slice(this.pos,this.pos+t);this.pos+=t;return this.finishToken(e,r)};ke.readRegexp=function(){var e=this;var t,r,i=this.pos;for(;;){if(e.pos>=e.input.length){e.raise(i,"Unterminated regular expression")}var n=e.input.charAt(e.pos);if(w.test(n)){e.raise(i,"Unterminated regular expression")}if(!t){if(n==="["){r=true}else if(n==="]"&&r){r=false}else if(n==="/"&&!r){break}t=n==="\\"}else{t=false}++e.pos}var a=this.input.slice(i,this.pos);++this.pos;var s=this.pos;var o=this.readWord1();if(this.containsEsc){this.unexpected(s)}var l=this.regexpState||(this.regexpState=new oe(this));l.reset(i,a,o);this.validateRegExpFlags(l);this.validateRegExpPattern(l);var u=null;try{u=new RegExp(a,o)}catch(e){}return this.finishToken(b.regexp,{pattern:a,flags:o,value:u})};ke.readInt=function(e,t){var r=this;var i=this.pos,n=0;for(var a=0,s=t==null?Infinity:t;a<s;++a){var o=r.input.charCodeAt(r.pos),l=void 0;if(o>=97){l=o-97+10}else if(o>=65){l=o-65+10}else if(o>=48&&o<=57){l=o-48}else{l=Infinity}if(l>=e){break}++r.pos;n=n*e+l}if(this.pos===i||t!=null&&this.pos-i!==t){return null}return n};ke.readRadixNumber=function(e){this.pos+=2;var t=this.readInt(e);if(t==null){this.raise(this.start+2,"Expected number in radix "+e)}if(h(this.fullCharCodeAtPos())){this.raise(this.pos,"Identifier directly after number")}return this.finishToken(b.num,t)};ke.readNumber=function(e){var t=this.pos;if(!e&&this.readInt(10)===null){this.raise(t,"Invalid number")}var r=this.pos-t>=2&&this.input.charCodeAt(t)===48;if(r&&this.strict){this.raise(t,"Invalid number")}if(r&&/[89]/.test(this.input.slice(t,this.pos))){r=false}var i=this.input.charCodeAt(this.pos);if(i===46&&!r){++this.pos;this.readInt(10);i=this.input.charCodeAt(this.pos)}if((i===69||i===101)&&!r){i=this.input.charCodeAt(++this.pos);if(i===43||i===45){++this.pos}if(this.readInt(10)===null){this.raise(t,"Invalid number")}}if(h(this.fullCharCodeAtPos())){this.raise(this.pos,"Identifier directly after number")}var n=this.input.slice(t,this.pos);var a=r?parseInt(n,8):parseFloat(n);return this.finishToken(b.num,a)};ke.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){if(this.options.ecmaVersion<6){this.unexpected()}var r=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos);++this.pos;if(t>1114111){this.invalidStringToken(r,"Code point out of bounds")}}else{t=this.readHexChar(4)}return t};function Ce(e){if(e<=65535){return String.fromCharCode(e)}e-=65536;return String.fromCharCode((e>>10)+55296,(e&1023)+56320)}ke.readString=function(e){var t=this;var r="",i=++this.pos;for(;;){if(t.pos>=t.input.length){t.raise(t.start,"Unterminated string constant")}var n=t.input.charCodeAt(t.pos);if(n===e){break}if(n===92){r+=t.input.slice(i,t.pos);r+=t.readEscapedChar(false);i=t.pos}else{if(C(n,t.options.ecmaVersion>=10)){t.raise(t.start,"Unterminated string constant")}++t.pos}}r+=this.input.slice(i,this.pos++);return this.finishToken(b.string,r)};var Se={};ke.tryReadTemplateToken=function(){this.inTemplateElement=true;try{this.readTmplToken()}catch(e){if(e===Se){this.readInvalidTemplateToken()}else{throw e}}this.inTemplateElement=false};ke.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9){throw Se}else{this.raise(e,t)}};ke.readTmplToken=function(){var e=this;var t="",r=this.pos;for(;;){if(e.pos>=e.input.length){e.raise(e.start,"Unterminated template")}var i=e.input.charCodeAt(e.pos);if(i===96||i===36&&e.input.charCodeAt(e.pos+1)===123){if(e.pos===e.start&&(e.type===b.template||e.type===b.invalidTemplate)){if(i===36){e.pos+=2;return e.finishToken(b.dollarBraceL)}else{++e.pos;return e.finishToken(b.backQuote)}}t+=e.input.slice(r,e.pos);return e.finishToken(b.template,t)}if(i===92){t+=e.input.slice(r,e.pos);t+=e.readEscapedChar(true);r=e.pos}else if(C(i)){t+=e.input.slice(r,e.pos);++e.pos;switch(i){case 13:if(e.input.charCodeAt(e.pos)===10){++e.pos}case 10:t+="\n";break;default:t+=String.fromCharCode(i);break}if(e.options.locations){++e.curLine;e.lineStart=e.pos}r=e.pos}else{++e.pos}}};ke.readInvalidTemplateToken=function(){var e=this;for(;this.pos<this.input.length;this.pos++){switch(e.input[e.pos]){case"\\":++e.pos;break;case"$":if(e.input[e.pos+1]!=="{"){break}case"`":return e.finishToken(b.invalidTemplate,e.input.slice(e.start,e.pos))}}this.raise(this.start,"Unterminated template")};ke.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);++this.pos;switch(t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Ce(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10){++this.pos}case 10:if(this.options.locations){this.lineStart=this.pos;++this.curLine}return"";default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0];var i=parseInt(r,8);if(i>255){r=r.slice(0,-1);i=parseInt(r,8)}this.pos+=r.length-1;t=this.input.charCodeAt(this.pos);if((r!=="0"||t===56||t===57)&&(this.strict||e)){this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode")}return String.fromCharCode(i)}return String.fromCharCode(t)}};ke.readHexChar=function(e){var t=this.pos;var r=this.readInt(16,e);if(r===null){this.invalidStringToken(t,"Bad character escape sequence")}return r};ke.readWord1=function(){var e=this;this.containsEsc=false;var t="",r=true,i=this.pos;var n=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var a=e.fullCharCodeAtPos();if(p(a,n)){e.pos+=a<=65535?1:2}else if(a===92){e.containsEsc=true;t+=e.input.slice(i,e.pos);var s=e.pos;if(e.input.charCodeAt(++e.pos)!==117){e.invalidStringToken(e.pos,"Expecting Unicode escape sequence \\uXXXX")}++e.pos;var o=e.readCodePoint();if(!(r?h:p)(o,n)){e.invalidStringToken(s,"Invalid Unicode escape")}t+=Ce(o);i=e.pos}else{break}r=false}return t+this.input.slice(i,this.pos)};ke.readWord=function(){var e=this.readWord1();var t=b.name;if(this.keywords.test(e)){if(this.containsEsc){this.raiseRecoverable(this.start,"Escape sequence in keyword "+e)}t=y[e]}return this.finishToken(t,e)};var Le="5.7.3";function Te(e,t){return new z(t,e).parse()}function Ae(e,t,r){var i=new z(r,e,t);i.nextToken();return i.parseExpression()}function Ee(e,t){return new z(t,e)}function Me(t,r,i){e.parse_dammit=t;e.LooseParser=r;e.pluginsLoose=i}e.version=Le;e.parse=Te;e.parseExpressionAt=Ae;e.tokenizer=Ee;e.addLooseExports=Me;e.Parser=z;e.plugins=V;e.defaultOptions=O;e.Position=_;e.SourceLocation=P;e.getLineInfo=I;e.Node=J;e.TokenType=d;e.tokTypes=b;e.keywordTypes=y;e.TokContext=re;e.tokContexts=ie;e.isIdentifierChar=p;e.isIdentifierStart=h;e.Token=we;e.isNewLine=C;e.lineBreak=w;e.lineBreakG=k;e.nonASCIIwhitespace=S;Object.defineProperty(e,"__esModule",{value:true})});(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?t(exports):typeof define==="function"&&define.amd?define(["exports"],t):t((e.acorn=e.acorn||{},e.acorn.walk={}))})(this,function(e){"use strict";function t(e,t,r,i,n){if(!r){r=v}(function e(i,n,a){var s=a||i.type,o=t[s];r[s](i,n,e);if(o){o(i,n)}})(e,i,n)}function r(e,t,r,i){var n=[];if(!r){r=v}(function e(i,a,s){var o=s||i.type,l=t[o];var u=i!==n[n.length-1];if(u){n.push(i)}r[o](i,a,e);if(l){l(i,a||n,n)}if(u){n.pop()}})(e,i)}function i(e,t,r,i,n){var a=r?p(r,i||undefined):i;(function e(t,r,i){a[i||t.type](t,r,e)})(e,t,n)}function n(e){if(typeof e==="string"){return function(t){return t===e}}else if(!e){return function(){return true}}else{return e}}var a=function e(t,r){this.node=t;this.state=r};function s(e,t,r,i,n){if(!r){r=v}(function e(i,n,a){var s=a||i.type;r[s](i,n,e);if(!a){t(i,n,s)}})(e,i,n)}function o(e,t,r,i){if(!r){r=v}var n=[];(function e(i,a,s){var o=s||i.type;var l=i!==n[n.length-1];if(l){n.push(i)}r[o](i,a,e);if(!s){t(i,a||n,n,o)}if(l){n.pop()}})(e,i)}function l(e,t,r,i,s,o){if(!s){s=v}i=n(i);try{(function e(n,o,l){var u=l||n.type;if((t==null||n.start<=t)&&(r==null||n.end>=r)){s[u](n,o,e)}if((t==null||n.start===t)&&(r==null||n.end===r)&&i(u,n)){throw new a(n,o)}})(e,o)}catch(e){if(e instanceof a){return e}throw e}}function u(e,t,r,i,s){r=n(r);if(!i){i=v}try{(function e(n,s,o){var l=o||n.type;if(n.start>t||n.end<t){return}i[l](n,s,e);if(r(l,n)){throw new a(n,s)}})(e,s)}catch(e){if(e instanceof a){return e}throw e}}function c(e,t,r,i,s){r=n(r);if(!i){i=v}try{(function e(n,s,o){if(n.end<t){return}var l=o||n.type;if(n.start>=t&&r(l,n)){throw new a(n,s)}i[l](n,s,e)})(e,s)}catch(e){if(e instanceof a){return e}throw e}}function f(e,t,r,i,s){r=n(r);if(!i){i=v}var o;(function e(n,s,l){if(n.start>t){return}var u=l||n.type;if(n.end<=t&&(!o||o.node.end<n.end)&&r(u,n)){o=new a(n,s)}i[u](n,s,e)})(e,s);return o}var h=Object.create||function(e){function t(){}t.prototype=e;return new t};function p(e,t){var r=h(t||v);for(var i in e){r[i]=e[i]}return r}function d(e,t,r){r(e,t)}function m(e,t,r){}var v={};v.Program=v.BlockStatement=function(e,t,r){for(var i=0,n=e.body;i<n.length;i+=1){var a=n[i];r(a,t,"Statement")}};v.Statement=d;v.EmptyStatement=m;v.ExpressionStatement=v.ParenthesizedExpression=function(e,t,r){return r(e.expression,t,"Expression")};v.IfStatement=function(e,t,r){r(e.test,t,"Expression");r(e.consequent,t,"Statement");if(e.alternate){r(e.alternate,t,"Statement")}};v.LabeledStatement=function(e,t,r){return r(e.body,t,"Statement")};v.BreakStatement=v.ContinueStatement=m;v.WithStatement=function(e,t,r){r(e.object,t,"Expression");r(e.body,t,"Statement")};v.SwitchStatement=function(e,t,r){r(e.discriminant,t,"Expression");for(var i=0,n=e.cases;i<n.length;i+=1){var a=n[i];if(a.test){r(a.test,t,"Expression")}for(var s=0,o=a.consequent;s<o.length;s+=1){var l=o[s];r(l,t,"Statement")}}};v.SwitchCase=function(e,t,r){if(e.test){r(e.test,t,"Expression")}for(var i=0,n=e.consequent;i<n.length;i+=1){var a=n[i];r(a,t,"Statement")}};v.ReturnStatement=v.YieldExpression=v.AwaitExpression=function(e,t,r){if(e.argument){r(e.argument,t,"Expression")}};v.ThrowStatement=v.SpreadElement=function(e,t,r){return r(e.argument,t,"Expression")};v.TryStatement=function(e,t,r){r(e.block,t,"Statement");if(e.handler){r(e.handler,t)}if(e.finalizer){r(e.finalizer,t,"Statement")}};v.CatchClause=function(e,t,r){if(e.param){r(e.param,t,"Pattern")}r(e.body,t,"ScopeBody")};v.WhileStatement=v.DoWhileStatement=function(e,t,r){r(e.test,t,"Expression");r(e.body,t,"Statement")};v.ForStatement=function(e,t,r){if(e.init){r(e.init,t,"ForInit")}if(e.test){r(e.test,t,"Expression")}if(e.update){r(e.update,t,"Expression")}r(e.body,t,"Statement")};v.ForInStatement=v.ForOfStatement=function(e,t,r){r(e.left,t,"ForInit");r(e.right,t,"Expression");r(e.body,t,"Statement")};v.ForInit=function(e,t,r){if(e.type==="VariableDeclaration"){r(e,t)}else{r(e,t,"Expression")}};v.DebuggerStatement=m;v.FunctionDeclaration=function(e,t,r){return r(e,t,"Function")};v.VariableDeclaration=function(e,t,r){for(var i=0,n=e.declarations;i<n.length;i+=1){var a=n[i];r(a,t)}};v.VariableDeclarator=function(e,t,r){r(e.id,t,"Pattern");if(e.init){r(e.init,t,"Expression")}};v.Function=function(e,t,r){if(e.id){r(e.id,t,"Pattern")}for(var i=0,n=e.params;i<n.length;i+=1){var a=n[i];r(a,t,"Pattern")}r(e.body,t,e.expression?"ScopeExpression":"ScopeBody")};v.ScopeBody=function(e,t,r){return r(e,t,"Statement")};v.ScopeExpression=function(e,t,r){return r(e,t,"Expression")};v.Pattern=function(e,t,r){if(e.type==="Identifier"){r(e,t,"VariablePattern")}else if(e.type==="MemberExpression"){r(e,t,"MemberPattern")}else{r(e,t)}};v.VariablePattern=m;v.MemberPattern=d;v.RestElement=function(e,t,r){return r(e.argument,t,"Pattern")};v.ArrayPattern=function(e,t,r){for(var i=0,n=e.elements;i<n.length;i+=1){var a=n[i];if(a){r(a,t,"Pattern")}}};v.ObjectPattern=function(e,t,r){for(var i=0,n=e.properties;i<n.length;i+=1){var a=n[i];if(a.type==="Property"){if(a.computed){r(a.key,t,"Expression")}r(a.value,t,"Pattern")}else if(a.type==="RestElement"){r(a.argument,t,"Pattern")}}};v.Expression=d;v.ThisExpression=v.Super=v.MetaProperty=m;v.ArrayExpression=function(e,t,r){for(var i=0,n=e.elements;i<n.length;i+=1){var a=n[i];if(a){r(a,t,"Expression")}}};v.ObjectExpression=function(e,t,r){for(var i=0,n=e.properties;i<n.length;i+=1){var a=n[i];r(a,t)}};v.FunctionExpression=v.ArrowFunctionExpression=v.FunctionDeclaration;v.SequenceExpression=v.TemplateLiteral=function(e,t,r){for(var i=0,n=e.expressions;i<n.length;i+=1){var a=n[i];r(a,t,"Expression")}};v.UnaryExpression=v.UpdateExpression=function(e,t,r){r(e.argument,t,"Expression")};v.BinaryExpression=v.LogicalExpression=function(e,t,r){r(e.left,t,"Expression");r(e.right,t,"Expression")};v.AssignmentExpression=v.AssignmentPattern=function(e,t,r){r(e.left,t,"Pattern");r(e.right,t,"Expression")};v.ConditionalExpression=function(e,t,r){r(e.test,t,"Expression");r(e.consequent,t,"Expression");r(e.alternate,t,"Expression")};v.NewExpression=v.CallExpression=function(e,t,r){r(e.callee,t,"Expression");if(e.arguments){for(var i=0,n=e.arguments;i<n.length;i+=1){var a=n[i];r(a,t,"Expression")}}};v.MemberExpression=function(e,t,r){r(e.object,t,"Expression");if(e.computed){r(e.property,t,"Expression")}};v.ExportNamedDeclaration=v.ExportDefaultDeclaration=function(e,t,r){if(e.declaration){r(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression")}if(e.source){r(e.source,t,"Expression")}};v.ExportAllDeclaration=function(e,t,r){r(e.source,t,"Expression")};v.ImportDeclaration=function(e,t,r){for(var i=0,n=e.specifiers;i<n.length;i+=1){var a=n[i];r(a,t)}r(e.source,t,"Expression")};v.ImportSpecifier=v.ImportDefaultSpecifier=v.ImportNamespaceSpecifier=v.Identifier=v.Literal=m;v.TaggedTemplateExpression=function(e,t,r){r(e.tag,t,"Expression");r(e.quasi,t,"Expression")};v.ClassDeclaration=v.ClassExpression=function(e,t,r){return r(e,t,"Class")};v.Class=function(e,t,r){if(e.id){r(e.id,t,"Pattern")}if(e.superClass){r(e.superClass,t,"Expression")}r(e.body,t)};v.ClassBody=function(e,t,r){for(var i=0,n=e.body;i<n.length;i+=1){var a=n[i];r(a,t)}};v.MethodDefinition=v.Property=function(e,t,r){if(e.computed){r(e.key,t,"Expression")}r(e.value,t,"Expression")};e.simple=t;e.ancestor=r;e.recursive=i;e.full=s;e.fullAncestor=o;e.findNodeAt=l;e.findNodeAround=u;e.findNodeAfter=c;e.findNodeBefore=f;e.make=p;e.base=v;Object.defineProperty(e,"__esModule",{value:true})});