(function(m,oe){typeof exports=="object"&&typeof module!="undefined"?module.exports=oe():typeof define=="function"&&define.amd?define(oe):(m=m||self,m.CodeMirror=oe())})(this,(function(){"use strict";var m=navigator.userAgent,oe=navigator.platform,re=/gecko\/\d/i.test(m),$=/MSIE \d/.test(m),ne=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(m),_=/Edge\/(\d+)/.exec(m),R=$||ne||_,W=R&&($?document.documentMode||6:+(_||ne)[1]),y=!_&&/WebKit\//.test(m),L=y&&/Qt\/\d+\.\d+/.test(m),v=!_&&/Chrome\/(\d+)/.exec(m),C=v&&+v[1],T=/Opera\//.test(m),V=/Apple Computer/.test(navigator.vendor),Y=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(m),K=/PhantomJS/.test(m),O=V&&(/Mobile\/\w+/.test(m)||navigator.maxTouchPoints>2),k=/Android/.test(m),M=O||k||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(m),E=O||/Mac/.test(oe),B=/\bCrOS\b/.test(m),q=/win/i.test(oe),g=T&&m.match(/Version\/(\d*\.\d*)/);g&&(g=Number(g[1])),g&&g>=15&&(T=!1,y=!0);var P=E&&(L||T&&(g==null||g<12.11)),U=re||R&&W>=9;function H(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Q=function(e,t){var n=e.className,r=H(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function w(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function j(e,t){return w(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function G(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var I;document.createRange?I=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:I=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function le(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function ve(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch(r){n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function me(e,t){var n=e.className;H(t).test(n)||(e.className+=(n?" ":"")+t)}function je(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!H(n[r]).test(t)&&(t+=" "+n[r]);return t}var rt=function(e){e.select()};O?rt=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:R&&(rt=function(e){try{e.select()}catch(t){}});function Pe(e){return e.display.wrapper.ownerDocument}function Xe(e){return ze(e.display.wrapper)}function ze(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function ge(e){return Pe(e).defaultView}function pe(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function xe(e,t,n){t||(t={});for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n!==!1||!Object.prototype.hasOwnProperty.call(t,r))&&(t[r]=e[r]);return t}function Se(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}var be=function(){this.id=null,this.f=null,this.time=0,this.handler=pe(this.onTimeout,this)};be.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},be.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function fe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var et=50,Ot={toString:function(){return"CodeMirror.Pass"}},ft={scroll:!1},kt={origin:"*mouse"},Te={origin:"+move"};function Ke(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var ct=[""];function Ct(e){for(;ct.length<=e;)ct.push(Ce(ct)+" ");return ct[e]}function Ce(e){return e[e.length-1]}function Ne(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function S(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function J(){}function D(e,t){var n;return Object.create?n=Object.create(e):(J.prototype=e,n=new J),t&&xe(t,n),n}var Le=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function nt(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Le.test(e))}function Gt(e,t){return t?t.source.indexOf("\\w")>-1&&nt(e)?!0:t.test(e):nt(e)}function zn(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var jt=/[\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 _e(e){return e.charCodeAt(0)>=768&&jt.test(e)}function er(e,t,n){for(;(n<0?t>0:t<e.length)&&_e(e.charAt(t));)t+=n;return t}function It(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function tr(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),a.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var vr=null;function rr(e,t,n){var r;vr=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:vr=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:vr=i)}return r!=null?r:vr}var hi=(function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(u,d,p){this.level=u,this.from=d,this.to=p}return function(u,d){var p=d=="ltr"?"L":"R";if(u.length==0||d=="ltr"&&!r.test(u))return!1;for(var x=u.length,b=[],N=0;N<x;++N)b.push(n(u.charCodeAt(N)));for(var F=0,Z=p;F<x;++F){var ee=b[F];ee=="m"?b[F]=Z:Z=ee}for(var ae=0,te=p;ae<x;++ae){var se=b[ae];se=="1"&&te=="r"?b[ae]="n":o.test(se)&&(te=se,se=="r"&&(b[ae]="R"))}for(var he=1,ce=b[0];he<x-1;++he){var we=b[he];we=="+"&&ce=="1"&&b[he+1]=="1"?b[he]="1":we==","&&ce==b[he+1]&&(ce=="1"||ce=="n")&&(b[he]=ce),ce=we}for(var De=0;De<x;++De){var Ve=b[De];if(Ve==",")b[De]="N";else if(Ve=="%"){var We=void 0;for(We=De+1;We<x&&b[We]=="%";++We);for(var wt=De&&b[De-1]=="!"||We<x&&b[We]=="1"?"1":"N",vt=De;vt<We;++vt)b[vt]=wt;De=We-1}}for(var Ue=0,mt=p;Ue<x;++Ue){var tt=b[Ue];mt=="L"&&tt=="1"?b[Ue]="L":o.test(tt)&&(mt=tt)}for(var qe=0;qe<x;++qe)if(i.test(b[qe])){var Ge=void 0;for(Ge=qe+1;Ge<x&&i.test(b[Ge]);++Ge);for(var Be=(qe?b[qe-1]:p)=="L",yt=(Ge<x?b[Ge]:p)=="L",$r=Be==yt?Be?"L":"R":p,gr=qe;gr<Ge;++gr)b[gr]=$r;qe=Ge-1}for(var lt=[],Ut,$e=0;$e<x;)if(a.test(b[$e])){var lo=$e;for(++$e;$e<x&&a.test(b[$e]);++$e);lt.push(new s(0,lo,$e))}else{var $t=$e,Tr=lt.length,Mr=d=="rtl"?1:0;for(++$e;$e<x&&b[$e]!="L";++$e);for(var ut=$t;ut<$e;)if(l.test(b[ut])){$t<ut&&(lt.splice(Tr,0,new s(1,$t,ut)),Tr+=Mr);var en=ut;for(++ut;ut<$e&&l.test(b[ut]);++ut);lt.splice(Tr,0,new s(2,en,ut)),Tr+=Mr,$t=ut}else++ut;$t<$e&<.splice(Tr,0,new s(1,$t,$e))}return d=="ltr"&&(lt[0].level==1&&(Ut=u.match(/^\s+/))&&(lt[0].from=Ut[0].length,lt.unshift(new s(0,0,Ut[0].length))),Ce(lt).level==1&&(Ut=u.match(/\s+$/))&&(Ce(lt).to-=Ut[0].length,lt.push(new s(0,x-Ut[0].length,x)))),d=="rtl"?lt.reverse():lt}})();function ke(e,t){var n=e.order;return n==null&&(n=e.order=hi(e.text,t)),n}var En=[],de=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||En).concat(n)}};function qt(e,t){return e._handlers&&e._handlers[t]||En}function it(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=fe(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function He(e,t){var n=qt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Fe(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),He(e,n||t.type,e,t),dt(t)||t.codemirrorIgnore}function Tt(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)fe(n,t[r])==-1&&n.push(t[r])}function bt(e,t){return qt(e,t).length>0}function At(e){e.prototype.on=function(t,n){de(this,t,n)},e.prototype.off=function(t,n){it(this,t,n)}}function ot(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Or(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function dt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function nr(e){ot(e),Or(e)}function tn(e){return e.target||e.srcElement}function Nt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),E&&e.ctrlKey&&t==1&&(t=3),t}var pi=(function(){if(R&&W<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e})(),Ar;function Wn(e){if(Ar==null){var t=c("span","\u200B");j(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ar=t.offsetWidth<=1&&t.offsetHeight>2&&!(R&&W<8))}var n=Ar?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var rn;function ir(e){if(rn!=null)return rn;var t=j(e,document.createTextNode("A\u062EA")),n=I(t,0,1).getBoundingClientRect(),r=I(t,1,2).getBoundingClientRect();return w(e),!n||n.left==n.right?!1:rn=r.right-n.right<3}var Mt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},or=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Hn=(function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),Dt=null;function gi(e){if(Dt!=null)return Dt;var t=j(e,c("span","x")),n=t.getBoundingClientRect(),r=I(t,0,1).getBoundingClientRect();return Dt=Math.abs(n.left-r.left)>1}var Nr={},Pt={};function zt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Nr[e]=t}function mr(e,t){Pt[e]=t}function Dr(e){if(typeof e=="string"&&Pt.hasOwnProperty(e))e=Pt[e];else if(e&&typeof e.name=="string"&&Pt.hasOwnProperty(e.name)){var t=Pt[e.name];typeof t=="string"&&(t={name:t}),e=D(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Dr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Dr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Pr(e,t){t=Dr(t);var n=Nr[t.name];if(!n)return Pr(e,"text/plain");var r=n(e,t);if(ar.hasOwnProperty(t.name)){var i=ar[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var ar={};function zr(e,t){var n=ar.hasOwnProperty(e)?ar[e]:ar[e]={};xe(t,n)}function Bt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function nn(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Er(e,t,n){return e.startState?e.startState(t,n):!0}var Ie=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Ie.prototype.eol=function(){return this.pos>=this.string.length},Ie.prototype.sol=function(){return this.pos==this.lineStart},Ie.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ie.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ie.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Ie.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ie.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ie.prototype.skipToEnd=function(){this.pos=this.string.length},Ie.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ie.prototype.backUp=function(e){this.pos-=e},Ie.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Se(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Se(this.string,this.lineStart,this.tabSize):0)},Ie.prototype.indentation=function(){return Se(this.string,null,this.tabSize)-(this.lineStart?Se(this.string,this.lineStart,this.tabSize):0)},Ie.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(a){return n?a.toLowerCase():a},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Ie.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ie.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ie.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ie.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ue(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Xt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var a=o.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function on(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function St(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function f(e){if(e.parent==null)return null;for(var t=e.parent,n=fe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function h(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return n+a}function z(e,t){return t>=e.first&&t<e.first+e.size}function X(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function A(e,t,n){if(n===void 0&&(n=null),!(this instanceof A))return new A(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ie(e,t){return e.line-t.line||e.ch-t.ch}function Me(e,t){return e.sticky==t.sticky&&ie(e,t)==0}function Ye(e){return A(e.line,e.ch)}function ht(e,t){return ie(e,t)<0?t:e}function Wr(e,t){return ie(e,t)<0?e:t}function uo(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ye(e,t){if(t.line<e.first)return A(e.first,0);var n=e.first+e.size-1;return t.line>n?A(n,ue(e,n).text.length):ul(t,ue(e,t.line).text.length)}function ul(e,t){var n=e.ch;return n==null||n>t?A(e.line,t):n<0?A(e.line,0):e}function fo(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ye(e,t[r]);return n}var Fn=function(e,t){this.state=e,this.lookAhead=t},Rt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Rt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Rt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Rt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Rt.fromSaved=function(e,t,n){return t instanceof Fn?new Rt(e,Bt(e.mode,t.state),n,t.lookAhead):new Rt(e,Bt(e.mode,t),n)},Rt.prototype.save=function(e){var t=e!==!1?Bt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Fn(t,this.maxLookAhead):t};function co(e,t,n,r){var i=[e.state.modeGen],o={};yo(e,t.text,e.doc.mode,n,function(u,d){return i.push(u,d)},o,r);for(var a=n.state,l=function(u){n.baseTokens=i;var d=e.state.overlays[u],p=1,x=0;n.state=!0,yo(e,t.text,d.mode,n,function(b,N){for(var F=p;x<b;){var Z=i[p];Z>b&&i.splice(p,1,b,i[p+1],Z),p+=2,x=Math.min(b,Z)}if(N)if(d.opaque)i.splice(F,p-F,b,"overlay "+N),p=F+2;else for(;F<p;F+=2){var ee=i[F+1];i[F+1]=(ee?ee+" ":"")+"overlay "+N}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function ho(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=an(e,f(t)),i=t.text.length>e.options.maxHighlightLength&&Bt(e.doc.mode,r.state),o=co(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function an(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Rt(r,!0,t);var o=fl(e,t,n),a=o>r.first&&ue(r,o-1).stateAfter,l=a?Rt.fromSaved(r,a,o):new Rt(r,Er(r.mode),o);return r.iter(o,t,function(s){vi(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?l.save():null,l.nextLine()}),n&&(r.modeFrontier=l.line),l}function vi(e,t,n,r){var i=e.doc.mode,o=new Ie(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&po(i,n.state);!o.eol();)mi(i,o,n.state),o.start=o.pos}function po(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=nn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function mi(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=nn(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var go=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function vo(e,t,n,r){var i=e.doc,o=i.mode,a;t=ye(i,t);var l=ue(i,t.line),s=an(e,t.line,n),u=new Ie(l.text,e.options.tabSize,s),d;for(r&&(d=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,a=mi(o,u,s.state),r&&d.push(new go(u,a,Bt(i.mode,s.state)));return r?d:new go(u,a,s.state)}function mo(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function yo(e,t,n,r,i,o,a){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,u=null,d=new Ie(t,e.options.tabSize,r),p,x=e.options.addModeClass&&[null];for(t==""&&mo(po(n,r.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&vi(e,t,r,d.pos),d.pos=t.length,p=null):p=mo(mi(n,d,r.state,x),o),x){var b=x[0].name;b&&(p="m-"+(p?b+" "+p:b))}if(!l||u!=p){for(;s<d.start;)s=Math.min(d.start,s+5e3),i(s,u);u=p}d.start=d.pos}for(;s<d.pos;){var N=Math.min(d.pos,s+5e3);i(N,u),s=N}}function fl(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=ue(o,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof Fn?u.lookAhead:0)<=o.modeFrontier))return l;var d=Se(s.text,null,e.options.tabSize);(i==null||r>d)&&(i=l-1,r=d)}return i}function cl(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=ue(e,r).stateAfter;if(i&&(!(i instanceof Fn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var bo=!1,Yt=!1;function dl(){bo=!0}function hl(){Yt=!0}function In(e,t,n){this.marker=e,this.from=t,this.to=n}function ln(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function pl(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function gl(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function vl(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&a.type=="bookmark"&&(!n||!o.marker.insertLeft)){var s=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new In(a,o.from,s?null:o.to))}}return r}function ml(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&a.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new In(a,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function yi(e,t){if(t.full)return null;var n=z(e,t.from.line)&&ue(e,t.from.line).markedSpans,r=z(e,t.to.line)&&ue(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=ie(t.from,t.to)==0,l=vl(n,i,a),s=ml(r,o,a),u=t.text.length==1,d=Ce(t.text).length+(u?i:0);if(l)for(var p=0;p<l.length;++p){var x=l[p];if(x.to==null){var b=ln(s,x.marker);b?u&&(x.to=b.to==null?null:b.to+d):x.to=i}}if(s)for(var N=0;N<s.length;++N){var F=s[N];if(F.to!=null&&(F.to+=d),F.from==null){var Z=ln(l,F.marker);Z||(F.from=d,u&&(l||(l=[])).push(F))}else F.from+=d,u&&(l||(l=[])).push(F)}l&&(l=xo(l)),s&&s!=l&&(s=xo(s));var ee=[l];if(!u){var ae=t.text.length-2,te;if(ae>0&&l)for(var se=0;se<l.length;++se)l[se].to==null&&(te||(te=[])).push(new In(l[se].marker,null,null));for(var he=0;he<ae;++he)ee.push(te);ee.push(s)}return ee}function xo(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function yl(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(b){if(b.markedSpans)for(var N=0;N<b.markedSpans.length;++N){var F=b.markedSpans[N].marker;F.readOnly&&(!r||fe(r,F)==-1)&&(r||(r=[])).push(F)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var u=i[s];if(!(ie(u.to,l.from)<0||ie(u.from,l.to)>0)){var d=[s,1],p=ie(u.from,l.from),x=ie(u.to,l.to);(p<0||!a.inclusiveLeft&&!p)&&d.push({from:u.from,to:l.from}),(x>0||!a.inclusiveRight&&!x)&&d.push({from:l.to,to:u.to}),i.splice.apply(i,d),s+=d.length-3}}return i}function wo(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function ko(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Bn(e){return e.inclusiveLeft?-1:0}function Rn(e){return e.inclusiveRight?1:0}function bi(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=ie(r.from,i.from)||Bn(e)-Bn(t);if(o)return-o;var a=ie(r.to,i.to)||Rn(e)-Rn(t);return a||t.id-e.id}function Co(e,t){var n=Yt&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||bi(r,i.marker)<0)&&(r=i.marker);return r}function So(e){return Co(e,!0)}function Kn(e){return Co(e,!1)}function bl(e,t){var n=Yt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||bi(r,o.marker)<0)&&(r=o.marker)}return r}function Lo(e,t,n,r,i){var o=ue(e,t),a=Yt&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var u=s.marker.find(0),d=ie(u.from,n)||Bn(s.marker)-Bn(i),p=ie(u.to,r)||Rn(s.marker)-Rn(i);if(!(d>=0&&p<=0||d<=0&&p>=0)&&(d<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ie(u.to,n)>=0:ie(u.to,n)>0)||d>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ie(u.from,r)<=0:ie(u.from,r)<0)))return!0}}}function Et(e){for(var t;t=So(e);)e=t.find(-1,!0).line;return e}function xl(e){for(var t;t=Kn(e);)e=t.find(1,!0).line;return e}function wl(e){for(var t,n;t=Kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function xi(e,t){var n=ue(e,t),r=Et(n);return n==r?t:f(r)}function To(e,t){if(t>e.lastLine())return t;var n=ue(e,t),r;if(!lr(e,n))return t;for(;r=Kn(n);)n=r.find(1,!0).line;return f(n)+1}function lr(e,t){var n=Yt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&wi(e,t,r))return!0}}}function wi(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return wi(e,r.line,ln(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&wi(e,t,i))return!0}function Zt(e){e=Et(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function _n(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=So(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Kn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function ki(e){var t=e.display,n=e.doc;t.maxLine=ue(n,n.first),t.maxLineLength=_n(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=_n(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Hr=function(e,t,n){this.text=e,ko(this,t),this.height=n?n(this):1};Hr.prototype.lineNo=function(){return f(this)},At(Hr);function kl(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),wo(e),ko(e,n);var i=r?r(e):1;i!=e.height&&St(e,i)}function Cl(e){e.parent=null,wo(e)}var Sl={},Ll={};function Mo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ll:Sl;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Oo(e,t){var n=G("span",null,null,y?"padding-right: .1px":null),r={pre:G("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Ml,ir(e.display.measure)&&(a=ke(o,e.doc.direction))&&(r.addToken=Al(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&f(o);Nl(o,r,ho(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=je(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=je(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Wn(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(y){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return He(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=je(r.pre.className,r.textClass||"")),r}function Tl(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ml(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?Ol(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,d;if(!s.test(t))e.col+=t.length,d=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,d),R&&W<9&&(u=!0),e.pos+=t.length;else{d=document.createDocumentFragment();for(var p=0;;){s.lastIndex=p;var x=s.exec(t),b=x?x.index-p:t.length-p;if(b){var N=document.createTextNode(l.slice(p,p+b));R&&W<9?d.appendChild(c("span",[N])):d.appendChild(N),e.map.push(e.pos,e.pos+b,N),e.col+=b,e.pos+=b}if(!x)break;p+=b+1;var F=void 0;if(x[0]==" "){var Z=e.cm.options.tabSize,ee=Z-e.col%Z;F=d.appendChild(c("span",Ct(ee),"cm-tab")),F.setAttribute("role","presentation"),F.setAttribute("cm-text"," "),e.col+=ee}else x[0]=="\r"||x[0]==`
`?(F=d.appendChild(c("span",x[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),F.setAttribute("cm-text",x[0]),e.col+=1):(F=e.cm.options.specialCharPlaceholder(x[0]),F.setAttribute("cm-text",x[0]),R&&W<9?d.appendChild(c("span",[F])):d.appendChild(F),e.col+=1);e.map.push(e.pos,e.pos+1,F),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var ae=n||"";r&&(ae+=r),i&&(ae+=i);var te=c("span",[d],ae,o);if(a)for(var se in a)a.hasOwnProperty(se)&&se!="style"&&se!="class"&&te.setAttribute(se,a[se]);return e.content.appendChild(te)}e.content.appendChild(d)}}function Ol(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o="\xA0"),r+=o,n=o==" "}return r}function Al(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,d=u+r.length;;){for(var p=void 0,x=0;x<t.length&&(p=t[x],!(p.to>u&&p.from<=u));x++);if(p.to>=d)return e(n,r,i,o,a,l,s);e(n,r.slice(0,p.to-u),i,o,null,l,s),o=null,r=r.slice(p.to-u),u=p.to}}}function Ao(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Nl(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;a<n.length;a+=2)t.addToken(t,i.slice(o,o=n[a]),Mo(n[a+1],t.cm.options));return}for(var l=i.length,s=0,u=1,d="",p,x,b=0,N,F,Z,ee,ae;;){if(b==s){N=F=Z=x="",ae=null,ee=null,b=1/0;for(var te=[],se=void 0,he=0;he<r.length;++he){var ce=r[he],we=ce.marker;if(we.type=="bookmark"&&ce.from==s&&we.widgetNode)te.push(we);else if(ce.from<=s&&(ce.to==null||ce.to>s||we.collapsed&&ce.to==s&&ce.from==s)){if(ce.to!=null&&ce.to!=s&&b>ce.to&&(b=ce.to,F=""),we.className&&(N+=" "+we.className),we.css&&(x=(x?x+";":"")+we.css),we.startStyle&&ce.from==s&&(Z+=" "+we.startStyle),we.endStyle&&ce.to==b&&(se||(se=[])).push(we.endStyle,ce.to),we.title&&((ae||(ae={})).title=we.title),we.attributes)for(var De in we.attributes)(ae||(ae={}))[De]=we.attributes[De];we.collapsed&&(!ee||bi(ee.marker,we)<0)&&(ee=ce)}else ce.from>s&&b>ce.from&&(b=ce.from)}if(se)for(var Ve=0;Ve<se.length;Ve+=2)se[Ve+1]==b&&(F+=" "+se[Ve]);if(!ee||ee.from==s)for(var We=0;We<te.length;++We)Ao(t,0,te[We]);if(ee&&(ee.from||0)==s){if(Ao(t,(ee.to==null?l+1:ee.to)-s,ee.marker,ee.from==null),ee.to==null)return;ee.to==s&&(ee=!1)}}if(s>=l)break;for(var wt=Math.min(l,b);;){if(d){var vt=s+d.length;if(!ee){var Ue=vt>wt?d.slice(0,wt-s):d;t.addToken(t,Ue,p?p+N:N,Z,s+Ue.length==b?F:"",x,ae)}if(vt>=wt){d=d.slice(wt-s),s=wt;break}s=vt,Z=""}d=i.slice(o,o=n[u++]),p=Mo(n[u++],t.cm.options)}}}function No(e,t,n){this.line=t,this.rest=wl(t),this.size=this.rest?f(Ce(this.rest))-n+1:1,this.node=this.text=null,this.hidden=lr(e,t)}function Un(e,t,n){for(var r=[],i,o=t;o<n;o=i){var a=new No(e.doc,ue(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Fr=null;function Dl(e){Fr?Fr.ops.push(e):e.ownsGroup=Fr={ops:[e],delayedCallbacks:[]}}function Pl(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function zl(e,t){var n=e.ownsGroup;if(n)try{Pl(n)}finally{Fr=null,t(n)}}var sn=null;function Ze(e,t){var n=qt(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Fr?i=Fr.delayedCallbacks:sn?i=sn:(i=sn=[],setTimeout(El,0));for(var o=function(l){i.push(function(){return n[l].apply(null,r)})},a=0;a<n.length;++a)o(a)}}function El(){var e=sn;sn=null;for(var t=0;t<e.length;++t)e[t]()}function Do(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?Hl(e,t):o=="gutter"?zo(e,t,n,r):o=="class"?Ci(e,t):o=="widget"&&Fl(e,t,r)}t.changes=null}function un(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),R&&W<8&&(e.node.style.zIndex=2)),e.node}function Wl(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=un(t);t.background=r.insertBefore(c("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Po(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Oo(e,t)}function Hl(e,t){var n=t.text.className,r=Po(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Ci(e,t)):n&&(t.text.className=n)}function Ci(e,t){Wl(e,t),t.line.wrapClass?un(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function zo(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=un(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=un(t),l=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(l.setAttribute("aria-hidden","true"),e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=l.appendChild(c("div",X(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,d=o.hasOwnProperty(u)&&o[u];d&&l.appendChild(c("div",[d],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Fl(e,t,n){t.alignable&&(t.alignable=null);for(var r=H("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Eo(e,t,n)}function Il(e,t,n,r){var i=Po(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Ci(e,t),zo(e,t,n,r),Eo(e,t,r),t.node}function Eo(e,t,n){if(Wo(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Wo(e,t.rest[r],t,n,!1)}function Wo(e,t,n,r,i){if(t.widgets)for(var o=un(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],u=c("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Bl(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),Ze(s,"redraw")}}function Bl(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function fn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!le(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),j(t.display.measure,c("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Qt(e,t){for(var n=tn(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Gn(e){return e.lineSpace.offsetTop}function Si(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ho(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=j(e.measure,c("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Kt(e){return et-e.display.nativeBarWidth}function yr(e){return e.display.scroller.clientWidth-Kt(e)-e.display.barWidth}function Li(e){return e.display.scroller.clientHeight-Kt(e)-e.display.barHeight}function Rl(e,t,n){var r=e.options.lineWrapping,i=r&&yr(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],u=a[l+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Fo(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(f(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Kl(e,t){t=Et(t);var n=f(t),r=e.display.externalMeasured=new No(e.doc,t,n);r.lineN=n;var i=r.built=Oo(e,r);return r.text=i.pre,j(e.display.lineMeasure,i.pre),r}function Io(e,t,n,r){return _t(e,Ir(e,t),n,r)}function Ti(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[wr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Ir(e,t){var n=f(t),r=Ti(e,n);r&&!r.text?r=null:r&&r.changes&&(Do(e,r,n,Di(e)),e.curOp.forceUpdate=!0),r||(r=Kl(e,t));var i=Fo(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function _t(e,t,n,r,i){t.before&&(n=-1);var o=n+(r||""),a;return t.cache.hasOwnProperty(o)?a=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Rl(e,t.view,t.rect),t.hasHeights=!0),a=Ul(e,t,n,r),a.bogus||(t.cache[o]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}var Bo={left:0,right:0,top:0,bottom:0};function Ro(e,t,n){for(var r,i,o,a,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],a="left";if(n=="right"&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function _l(e,t){var n=Bo;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Ul(e,t,n,r){var i=Ro(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,u;if(o.nodeType==3){for(var d=0;d<4;d++){for(;a&&_e(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l<i.coverEnd&&_e(t.line.text.charAt(i.coverStart+l));)++l;if(R&&W<9&&a==0&&l==i.coverEnd-i.coverStart?u=o.parentNode.getBoundingClientRect():u=_l(I(o,a,l).getClientRects(),r),u.left||u.right||a==0)break;l=a,a=a-1,s="right"}R&&W<11&&(u=Gl(e.display.measure,u))}else{a>0&&(s=r="right");var p;e.options.lineWrapping&&(p=o.getClientRects()).length>1?u=p[r=="right"?p.length-1:0]:u=o.getBoundingClientRect()}if(R&&W<9&&!a&&(!u||!u.left&&!u.right)){var x=o.parentNode.getClientRects()[0];x?u={left:x.left,right:x.left+Rr(e.display),top:x.top,bottom:x.bottom}:u=Bo}for(var b=u.top-t.rect.top,N=u.bottom-t.rect.top,F=(b+N)/2,Z=t.view.measure.heights,ee=0;ee<Z.length-1&&!(F<Z[ee]);ee++);var ae=ee?Z[ee-1]:0,te=Z[ee],se={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:ae,bottom:te};return!u.left&&!u.right&&(se.bogus=!0),e.options.singleCursorHeightPerLine||(se.rtop=b,se.rbottom=N),se}function Gl(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!gi(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Ko(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function _o(e){e.display.externalMeasure=null,w(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ko(e.display.view[t])}function cn(e){_o(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Uo(e){return v&&k?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Go(e){return v&&k?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Mi(e){var t=Et(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=fn(n[i]));return r}function jn(e,t,n,r,i){if(!i){var o=Mi(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var a=Zt(t);if(r=="local"?a+=Gn(e.display):a-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+(r=="window"?0:Go(Pe(e)));var s=l.left+(r=="window"?0:Uo(Pe(e)));n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function jo(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=Uo(Pe(e)),i-=Go(Pe(e));else if(n=="local"||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function qn(e,t,n,r,i){return r||(r=ue(e.doc,t.line)),jn(e,r,Io(e,r,t.ch,i),n)}function Wt(e,t,n,r,i,o){r=r||ue(e.doc,t.line),i||(i=Ir(e,r));function a(N,F){var Z=_t(e,i,N,F?"right":"left",o);return F?Z.left=Z.right:Z.right=Z.left,jn(e,r,Z,n)}var l=ke(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a(u=="before"?s-1:s,u=="before");function d(N,F,Z){var ee=l[F],ae=ee.level==1;return a(Z?N-1:N,ae!=Z)}var p=rr(l,s,u),x=vr,b=d(s,p,u=="before");return x!=null&&(b.other=d(s,x,u!="before")),b}function qo(e,t){var n=0;t=ye(e.doc,t),e.options.lineWrapping||(n=Rr(e.display)*t.ch);var r=ue(e.doc,t.line),i=Zt(r)+Gn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Oi(e,t,n,r,i){var o=A(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Ai(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Oi(r.first,0,null,-1,-1);var i=h(r,n),o=r.first+r.size-1;if(i>o)return Oi(r.first+r.size-1,ue(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=ue(r,i);;){var l=jl(e,a,i,t,n),s=bl(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=ue(r,i=u.line)}}function Xo(e,t,n,r){r-=Mi(t);var i=t.text.length,o=It(function(a){return _t(e,n,a-1).bottom<=r},i,0);return i=It(function(a){return _t(e,n,a).top>r},o,i),{begin:o,end:i}}function Yo(e,t,n,r){n||(n=Ir(e,t));var i=jn(e,t,_t(e,n,r),"line").top;return Xo(e,t,n,i)}function Ni(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function jl(e,t,n,r,i){i-=Zt(t);var o=Ir(e,t),a=Mi(t),l=0,s=t.text.length,u=!0,d=ke(t,e.doc.direction);if(d){var p=(e.options.lineWrapping?Xl:ql)(e,t,n,o,d,r,i);u=p.level!=1,l=u?p.from:p.to-1,s=u?p.to:p.from-1}var x=null,b=null,N=It(function(he){var ce=_t(e,o,he);return ce.top+=a,ce.bottom+=a,Ni(ce,r,i,!1)?(ce.top<=i&&ce.left<=r&&(x=he,b=ce),!0):!1},l,s),F,Z,ee=!1;if(b){var ae=r-b.left<b.right-r,te=ae==u;N=x+(te?0:1),Z=te?"after":"before",F=ae?b.left:b.right}else{!u&&(N==s||N==l)&&N++,Z=N==0?"after":N==t.text.length?"before":_t(e,o,N-(u?1:0)).bottom+a<=i==u?"after":"before";var se=Wt(e,A(n,N,Z),"line",t,o);F=se.left,ee=i<se.top?-1:i>=se.bottom?1:0}return N=er(t.text,N,1),Oi(n,N,Z,ee,r-F)}function ql(e,t,n,r,i,o,a){var l=It(function(p){var x=i[p],b=x.level!=1;return Ni(Wt(e,A(n,b?x.to:x.from,b?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,d=Wt(e,A(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Ni(d,o,a,!0)&&d.top>a&&(s=i[l-1])}return s}function Xl(e,t,n,r,i,o,a){var l=Xo(e,t,r,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var d=null,p=null,x=0;x<i.length;x++){var b=i[x];if(!(b.from>=u||b.to<=s)){var N=b.level!=1,F=_t(e,r,N?Math.min(u,b.to)-1:Math.max(s,b.from)).right,Z=F<o?o-F+1e9:F-o;(!d||p>Z)&&(d=b,p=Z)}}return d||(d=i[i.length-1]),d.from<s&&(d={from:s,to:d.to,level:d.level}),d.to>u&&(d={from:d.from,to:u,level:d.level}),d}var br;function Br(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(br==null){br=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)br.appendChild(document.createTextNode("x")),br.appendChild(c("br"));br.appendChild(document.createTextNode("x"))}j(e.measure,br);var n=br.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),w(e.measure),n||1}function Rr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");j(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Di(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+i,r[l]=o.clientWidth}return{fixedPos:Pi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Pi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Zo(e){var t=Br(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Rr(e.display)-3);return function(i){if(lr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function zi(e){var t=e.doc,n=Zo(e);t.iter(function(r){var i=n(r);i!=r.height&&St(r,i)})}function xr(e,t,n,r){var i=e.display;if(!n&&tn(t).getAttribute("cm-not-content")=="true")return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(p){return null}var s=Ai(e,o,a),u;if(r&&s.xRel>0&&(u=ue(e.doc,s.line).text).length==s.ch){var d=Se(u,u.length,e.options.tabSize)-u.length;s=A(s.line,Math.max(0,Math.round((o-Ho(e.display).left)/Rr(e.display))-d))}return s}function wr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function pt(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Yt&&xi(e.doc,t)<i.viewTo&&ur(e);else if(n<=i.viewFrom)Yt&&To(e.doc,n+r)>i.viewFrom?ur(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)ur(e);else if(t<=i.viewFrom){var o=Xn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):ur(e)}else if(n>=i.viewTo){var a=Xn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):ur(e)}else{var l=Xn(e,t,t,-1),s=Xn(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Un(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):ur(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function sr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[wr(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);fe(a,n)==-1&&a.push(n)}}}function ur(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Xn(e,t,n,r){var i=wr(e,t),o,a=e.display.view;if(!Yt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s<i;s++)l+=a[s].size;if(l!=t){if(r>0){if(i==a.length-1)return null;o=l+a[i].size-t,i++}else o=l-t;t+=o,n+=o}for(;xi(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Yl(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Un(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Un(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(wr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Un(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,wr(e,n)))),r.viewTo=n}function Qo(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function dn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Jo(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var l=0;l<n.sel.ranges.length;l++)if(!(!t&&l==n.sel.primIndex)){var s=n.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(a){var d=a(e,s);d&&Ei(e,d,i)}else(u||e.options.showCursorWhenSelecting)&&Ei(e,s.head,i);u||Zl(e,s,o)}}return r}function Ei(e,t,n){var r=Wt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(c("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=qn(e,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Yn(e,t){return e.top-t.top||e.left-t.left}function Zl(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Ho(e.display),l=a.left,s=Math.max(r.sizerWidth,yr(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function d(te,se,he,ce){se<0&&(se=0),se=Math.round(se),ce=Math.round(ce),o.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+te+`px;
top: `+se+"px; width: "+(he==null?s-te:he)+`px;
height: `+(ce-se)+"px"))}function p(te,se,he){var ce=ue(i,te),we=ce.text.length,De,Ve;function We(Ue,mt){return qn(e,A(te,Ue),"div",ce,mt)}function wt(Ue,mt,tt){var qe=Yo(e,ce,null,Ue),Ge=mt=="ltr"==(tt=="after")?"left":"right",Be=tt=="after"?qe.begin:qe.end-(/\s/.test(ce.text.charAt(qe.end-1))?2:1);return We(Be,Ge)[Ge]}var vt=ke(ce,i.direction);return tr(vt,se||0,he==null?we:he,function(Ue,mt,tt,qe){var Ge=tt=="ltr",Be=We(Ue,Ge?"left":"right"),yt=We(mt-1,Ge?"right":"left"),$r=se==null&&Ue==0,gr=he==null&&mt==we,lt=qe==0,Ut=!vt||qe==vt.length-1;if(yt.top-Be.top<=3){var $e=(u?$r:gr)&<,lo=(u?gr:$r)&&Ut,$t=$e?l:(Ge?Be:yt).left,Tr=lo?s:(Ge?yt:Be).right;d($t,Be.top,Tr-$t,Be.bottom)}else{var Mr,ut,en,so;Ge?(Mr=u&&$r&<?l:Be.left,ut=u?s:wt(Ue,tt,"before"),en=u?l:wt(mt,tt,"after"),so=u&&gr&&Ut?s:yt.right):(Mr=u?wt(Ue,tt,"before"):l,ut=!u&&$r&<?s:Be.right,en=!u&&gr&&Ut?l:yt.left,so=u?wt(mt,tt,"after"):s),d(Mr,Be.top,ut-Mr,Be.bottom),Be.bottom<yt.top&&d(l,Be.bottom,null,yt.top),d(en,yt.top,so-en,yt.bottom)}(!De||Yn(Be,De)<0)&&(De=Be),Yn(yt,De)<0&&(De=yt),(!Ve||Yn(Be,Ve)<0)&&(Ve=Be),Yn(yt,Ve)<0&&(Ve=yt)}),{start:De,end:Ve}}var x=t.from(),b=t.to();if(x.line==b.line)p(x.line,x.ch,b.ch);else{var N=ue(i,x.line),F=ue(i,b.line),Z=Et(N)==Et(F),ee=p(x.line,x.ch,Z?N.text.length+1:null).end,ae=p(b.line,Z?0:null,b.ch).start;Z&&(ee.top<ae.top-2?(d(ee.right,ee.top,null,ee.bottom),d(l,ae.top,ae.left,ae.bottom)):d(ee.right,ee.top,ae.left-ee.right,ee.bottom)),ee.bottom<ae.top&&d(l,ee.bottom,null,ae.top)}n.appendChild(o)}function Wi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Kr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Vo(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Fi(e))}function Hi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Kr(e))},100)}function Fi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(He(e,"focus",e,t),e.state.focused=!0,me(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),y&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Wi(e))}function Kr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(He(e,"blur",e,t),e.state.focused=!1,Q(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Zn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a<t.view.length;a++){var l=t.view[a],s=e.options.lineWrapping,u=void 0,d=0;if(!l.hidden){if(i+=l.line.height,R&&W<8){var p=l.node.offsetTop+l.node.offsetHeight;u=p-n,n=p}else{var x=l.node.getBoundingClientRect();u=x.bottom-x.top,!s&&l.text.firstChild&&(d=l.text.firstChild.getBoundingClientRect().right-x.left-1)}var b=l.line.height-u;if((b>.005||b<-.005)&&(i<r&&(o-=b),St(l.line,u),$o(l.line),l.rest))for(var N=0;N<l.rest.length;N++)$o(l.rest[N]);if(d>e.display.sizerWidth){var F=Math.ceil(d/Rr(e.display));F>e.display.maxLineLength&&(e.display.maxLineLength=F,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function $o(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Qn(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Gn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=h(t,r),a=h(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=h(t,Zt(ue(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=h(t,Zt(ue(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Ql(e,t){if(!Fe(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!K){var a=c("div","\u200B",null,`position: absolute;
top: `+(t.top-n.viewOffset-Gn(e.display))+`px;
height: `+(t.bottom-t.top+Kt(e)+n.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function Jl(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?A(t.line,t.ch+1,"before"):t,t=t.ch?A(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=Wt(e,t),s=!n||n==t?l:Wt(e,n);i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r};var u=Ii(e,i),d=e.doc.scrollTop,p=e.doc.scrollLeft;if(u.scrollTop!=null&&(pn(e,u.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(a=!0)),u.scrollLeft!=null&&(kr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return i}function Vl(e,t){var n=Ii(e,t);n.scrollTop!=null&&pn(e,n.scrollTop),n.scrollLeft!=null&&kr(e,n.scrollLeft)}function Ii(e,t){var n=e.display,r=Br(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Li(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Si(n),s=t.top<r,u=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var d=Math.min(t.top,(u?l:t.bottom)-o);d!=i&&(a.scrollTop=d)}var p=e.options.fixedGutter?0:n.gutters.offsetWidth,x=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-p,b=yr(e)-n.gutters.offsetWidth,N=t.right-t.left>b;return N&&(t.right=t.left+b),t.left<10?a.scrollLeft=0:t.left<x?a.scrollLeft=Math.max(0,t.left+p-(N?0:10)):t.right>b+x-3&&(a.scrollLeft=t.right+(N?0:10)-b),a}function Bi(e,t){t!=null&&(Jn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function _r(e){Jn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function hn(e,t,n){(t!=null||n!=null)&&Jn(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function $l(e,t){Jn(e),e.curOp.scrollToPos=t}function Jn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=qo(e,t.from),r=qo(e,t.to);ea(e,n,r,t.margin)}}function ea(e,t,n,r){var i=Ii(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});hn(e,i.scrollLeft,i.scrollTop)}function pn(e,t){Math.abs(e.doc.scrollTop-t)<2||(re||Ki(e,{top:t}),ta(e,t,!0),re&&Ki(e),mn(e,100))}function ta(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function kr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,aa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function gn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Si(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?n:0,docHeight:r,scrollHeight:r+Kt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Cr=function(e,t,n){this.cm=n;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),de(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),de(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,R&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Cr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Cr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Cr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Cr.prototype.zeroWidthHack=function(){var e=E&&!Y?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new be,this.disableVert=new be},Cr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Cr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var vn=function(){};vn.prototype.update=function(){return{bottom:0,right:0}},vn.prototype.setScrollLeft=function(){},vn.prototype.setScrollTop=function(){},vn.prototype.clear=function(){};function Ur(e,t){t||(t=gn(e));var n=e.display.barWidth,r=e.display.barHeight;ra(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Zn(e),ra(e,gn(e)),n=e.display.barWidth,r=e.display.barHeight}function ra(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var na={native:Cr,null:vn};function ia(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Q(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new na[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),de(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?kr(e,t):pn(e,t)},e),e.display.scrollbars.addClass&&me(e.display.wrapper,e.display.scrollbars.addClass)}var es=0;function Sr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++es,markArrays:null},Dl(e.curOp)}function Lr(e){var t=e.curOp;t&&zl(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;ts(n)})}function ts(e){for(var t=e.ops,n=0;n<t.length;n++)rs(t[n]);for(var r=0;r<t.length;r++)ns(t[r]);for(var i=0;i<t.length;i++)is(t[i]);for(var o=0;o<t.length;o++)os(t[o]);for(var a=0;a<t.length;a++)as(t[a])}function rs(e){var t=e.cm,n=t.display;ss(t),e.updateMaxLine&&ki(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Vn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ns(e){e.updatedDisplay=e.mustUpdate&&Ri(e.cm,e.update)}function is(e){var t=e.cm,n=t.display;e.updatedDisplay&&Zn(t),e.barMeasure=gn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Io(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Kt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-yr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function os(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&kr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==ve(Xe(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ur(t,e.barMeasure),e.updatedDisplay&&Ui(t,e.barMeasure),e.selectionChanged&&Wi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Vo(e.cm)}function as(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&oa(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&ta(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&kr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Jl(t,ye(r,e.scrollToPos.from),ye(r,e.scrollToPos.to),e.scrollToPos.margin);Ql(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||He(o[l],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&He(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&He(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function xt(e,t){if(e.curOp)return t();Sr(e);try{return t()}finally{Lr(e)}}function Qe(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Sr(e);try{return t.apply(e,arguments)}finally{Lr(e)}}}function st(e){return function(){if(this.curOp)return e.apply(this,arguments);Sr(this);try{return e.apply(this,arguments)}finally{Lr(this)}}}function Je(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Sr(t);try{return e.apply(this,arguments)}finally{Lr(t)}}}function mn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,pe(ls,e))}function ls(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=an(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Bt(t.mode,r.state):null,s=co(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var u=o.styleClasses,d=s.classes;d?o.styleClasses=d:u&&(o.styleClasses=null);for(var p=!a||a.length!=o.styles.length||u!=d&&(!u||!d||u.bgClass!=d.bgClass||u.textClass!=d.textClass),x=0;!p&&x<a.length;++x)p=a[x]!=o.styles[x];p&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&vi(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return mn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&xt(e,function(){for(var o=0;o<i.length;o++)sr(e,i[o],"text")})}}var Vn=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Qn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=yr(e),this.force=n,this.dims=Di(e),this.events=[]};Vn.prototype.signal=function(e,t){bt(e,t)&&this.events.push(arguments)},Vn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)He.apply(null,this.events[e])};function ss(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Kt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Kt(e)+"px",t.scrollbarsClipped=!0)}function us(e){if(e.hasFocus())return null;var t=ve(Xe(e));if(!t||!le(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=ge(e).getSelection();r.anchorNode&&r.extend&&le(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function fs(e){if(!(!e||!e.activeElt||e.activeElt==ve(ze(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&le(document.body,e.anchorNode)&&le(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Ri(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return ur(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Qo(e)==0)return!1;la(e)&&(ur(e),t.dims=Di(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Yt&&(o=xi(e.doc,o),a=To(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Yl(e,o,a),n.viewOffset=Zt(ue(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=Qo(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=us(e);return s>4&&(n.lineDiv.style.display="none"),cs(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,fs(u),w(n.cursorDiv),w(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,mn(e,400)),n.updateLineNumbers=null,!0}function oa(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==yr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Si(e.display)-Li(e),n.top)}),t.visible=Qn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Qn(e.display,e.doc,n));if(!Ri(e,t))break;Zn(e);var i=gn(e);dn(e),Ur(e,i),Ui(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ki(e,t){var n=new Vn(e,t);if(Ri(e,n)){Zn(e),oa(e,n);var r=gn(e);dn(e),Ur(e,r),Ui(e,r),n.finish()}}function cs(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(N){var F=N.nextSibling;return y&&E&&e.display.currentWheelTarget==N?N.style.display="none":N.parentNode.removeChild(N),F}for(var s=r.view,u=r.viewFrom,d=0;d<s.length;d++){var p=s[d];if(!p.hidden)if(!p.node||p.node.parentNode!=o){var x=Il(e,p,u,n);o.insertBefore(x,a)}else{for(;a!=p.node;)a=l(a);var b=i&&t!=null&&t<=u&&p.lineNumber;p.changes&&(fe(p.changes,"gutter")>-1&&(b=!1),Do(e,p,u,n)),b&&(w(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(X(e.options,u)))),a=p.node.nextSibling}u+=p.size}for(;a;)a=l(a)}function _i(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Ze(e,"gutterChanged",e)}function Ui(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Kt(e)+"px"}function aa(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Pi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function la(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=X(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(c("div",[c("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",_i(e.display),!0}return!1}function Gi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if(typeof o!="string"&&(a=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function sa(e){var t=e.gutters,n=e.gutterSpecs;w(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,l=t.appendChild(c("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),o=="CodeMirror-linenumbers"&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",_i(e)}function yn(e){sa(e.display),pt(e),aa(e)}function ds(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=G("div",null,"CodeMirror-code"),i.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=c("div",null,"CodeMirror-cursors"),i.measure=c("div",null,"CodeMirror-measure"),i.lineMeasure=c("div",null,"CodeMirror-measure"),i.lineSpace=G("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=G("div",[i.lineSpace],"CodeMirror-lines");i.mover=c("div",[o],null,"position: relative"),i.sizer=c("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=c("div",null,null,"position: absolute; height: "+et+"px; width: 1px;"),i.gutters=c("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=c("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=c("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),v&&C===105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),R&&W<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!y&&!(re&&M)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Gi(r.gutters,r.lineNumbers),sa(i),n.init(i)}var $n=0,Jt=null;R?Jt=-.53:re?Jt=15:v?Jt=-.7:V&&(Jt=-1/3);function ua(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function hs(e){var t=ua(e);return t.x*=Jt,t.y*=Jt,t}function fa(e,t){v&&C==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=ua(t),r=n.x,i=n.y,o=Jt;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(r&&s||i&&u){if(i&&E&&y){e:for(var d=t.target,p=a.view;d!=l;d=d.parentNode)for(var x=0;x<p.length;x++)if(p[x].node==d){e.display.currentWheelTarget=d;break e}}if(r&&!re&&!T&&o!=null){i&&u&&pn(e,Math.max(0,l.scrollTop+i*o)),kr(e,Math.max(0,l.scrollLeft+r*o)),(!i||i&&u)&&ot(t),a.wheelStartX=null;return}if(i&&o!=null){var b=i*o,N=e.doc.scrollTop,F=N+a.wrapper.clientHeight;b<0?N=Math.max(0,N+b-50):F=Math.min(e.doc.height,F+b+50),Ki(e,{top:N,bottom:F})}$n<20&&t.deltaMode!==0&&(a.wheelStartX==null?(a.wheelStartX=l.scrollLeft,a.wheelStartY=l.scrollTop,a.wheelDX=r,a.wheelDY=i,setTimeout(function(){if(a.wheelStartX!=null){var Z=l.scrollLeft-a.wheelStartX,ee=l.scrollTop-a.wheelStartY,ae=ee&&a.wheelDY&&ee/a.wheelDY||Z&&a.wheelDX&&Z/a.wheelDX;a.wheelStartX=a.wheelStartY=null,ae&&(Jt=(Jt*$n+ae)/($n+1),++$n)}},200)):(a.wheelDX+=r,a.wheelDY+=i))}}var Lt=function(e,t){this.ranges=e,this.primIndex=t};Lt.prototype.primary=function(){return this.ranges[this.primIndex]},Lt.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!Me(n.anchor,r.anchor)||!Me(n.head,r.head))return!1}return!0},Lt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Oe(Ye(this.ranges[t].anchor),Ye(this.ranges[t].head));return new Lt(e,this.primIndex)},Lt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Lt.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ie(t,r.from())>=0&&ie(e,r.to())<=0)return n}return-1};var Oe=function(e,t){this.anchor=e,this.head=t};Oe.prototype.from=function(){return Wr(this.anchor,this.head)},Oe.prototype.to=function(){return ht(this.anchor,this.head)},Oe.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ht(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(x,b){return ie(x.from(),b.from())}),n=fe(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=ie(l.to(),a.from());if(r&&!a.empty()?s>0:s>=0){var u=Wr(l.from(),a.from()),d=ht(l.to(),a.to()),p=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new Oe(p?d:u,p?u:d))}}return new Lt(t,n)}function fr(e,t){return new Lt([new Oe(e,t||e)],0)}function cr(e){return e.text?A(e.from.line+e.text.length-1,Ce(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ca(e,t){if(ie(e,t.from)<0)return e;if(ie(e,t.to)<=0)return cr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=cr(t).ch-t.to.ch),A(n,r)}function ji(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Oe(ca(i.anchor,t),ca(i.head,t)))}return Ht(e.cm,n,e.sel.primIndex)}function da(e,t,n){return e.line==t.line?A(n.line,e.ch-t.ch+n.ch):A(n.line+(e.line-t.line),e.ch)}function ps(e,t,n){for(var r=[],i=A(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=da(l.from,i,o),u=da(cr(l),i,o);if(i=l.to,o=u,n=="around"){var d=e.sel.ranges[a],p=ie(d.head,d.anchor)<0;r[a]=new Oe(p?u:s,p?s:u)}else r[a]=new Oe(s,s)}return new Lt(r,e.sel.primIndex)}function qi(e){e.doc.mode=Pr(e.options,e.doc.modeOption),bn(e)}function bn(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,mn(e,100),e.state.modeGen++,e.curOp&&pt(e)}function ha(e,t){return t.from.ch==0&&t.to.ch==0&&Ce(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Xi(e,t,n,r){function i(ae){return n?n[ae]:null}function o(ae,te,se){kl(ae,te,se,r),Ze(ae,"change",ae,t)}function a(ae,te){for(var se=[],he=ae;he<te;++he)se.push(new Hr(u[he],i(he),r));return se}var l=t.from,s=t.to,u=t.text,d=ue(e,l.line),p=ue(e,s.line),x=Ce(u),b=i(u.length-1),N=s.line-l.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(ha(e,t)){var F=a(0,u.length-1);o(p,p.text,b),N&&e.remove(l.line,N),F.length&&e.insert(l.line,F)}else if(d==p)if(u.length==1)o(d,d.text.slice(0,l.ch)+x+d.text.slice(s.ch),b);else{var Z=a(1,u.length-1);Z.push(new Hr(x+d.text.slice(s.ch),b,r)),o(d,d.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,Z)}else if(u.length==1)o(d,d.text.slice(0,l.ch)+u[0]+p.text.slice(s.ch),i(0)),e.remove(l.line+1,N);else{o(d,d.text.slice(0,l.ch)+u[0],i(0)),o(p,x+p.text.slice(s.ch),b);var ee=a(1,u.length-1);N>1&&e.remove(l.line+1,N-1),e.insert(l.line+1,ee)}Ze(e,"change",e,t)}function dr(e,t,n){function r(i,o,a){if(i.linked)for(var l=0;l<i.linked.length;++l){var s=i.linked[l];if(s.doc!=o){var u=a&&s.sharedHist;n&&!u||(t(s.doc,u),r(s.doc,i,u))}}}r(e,null,!0)}function pa(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,zi(e),qi(e),ga(e),e.options.direction=t.direction,e.options.lineWrapping||ki(e),e.options.mode=t.modeOption,pt(e)}function ga(e){(e.doc.direction=="rtl"?me:Q)(e.display.lineDiv,"CodeMirror-rtl")}function gs(e){xt(e,function(){ga(e),pt(e)})}function ei(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Yi(e,t){var n={from:Ye(t.from),to:cr(t),text:Xt(e,t.from,t.to)};return ya(e,n,t.from.line,t.to.line+1),dr(e,function(r){return ya(r,n,t.from.line,t.to.line+1)},!0),n}function va(e){for(;e.length;){var t=Ce(e);if(t.ranges)e.pop();else break}}function vs(e,t){if(t)return va(e.done),Ce(e.done);if(e.done.length&&!Ce(e.done).ranges)return Ce(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ce(e.done)}function ma(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a,l;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(a=vs(i,i.lastOp==r)))l=Ce(a.changes),ie(t.from,t.to)==0&&ie(t.from,l.to)==0?l.to=cr(t):a.changes.push(Yi(e,t));else{var s=Ce(i.done);for((!s||!s.ranges)&&ti(e.sel,i.done),a={changes:[Yi(e,t)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||He(e,"historyAdded")}function ms(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ys(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ms(e,o,Ce(i.done),t))?i.done[i.done.length-1]=t:ti(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&va(i.undone)}function ti(e,t){var n=Ce(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ya(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(a){a.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=a.markedSpans),++o})}function bs(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function xs(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(bs(n[i]));return r}function ba(e,t){var n=xs(e,t),r=yi(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function Gr(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?Lt.prototype.deepCopy.call(o):o);continue}var a=o.changes,l=[];r.push({changes:l});for(var s=0;s<a.length;++s){var u=a[s],d=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var p in u)(d=p.match(/^spans_(\d+)$/))&&fe(t,Number(d[1]))>-1&&(Ce(l)[p]=u[p],delete u[p])}}return r}function Zi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ie(t,i)<0;o!=ie(n,i)<0?(i=t,t=n):o!=ie(t,n)<0&&(t=n)}return new Oe(i,t)}else return new Oe(n||t,t)}function ri(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),at(e,new Lt([Zi(e.sel.primary(),t,n,i)],0),r)}function xa(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Zi(e.sel.ranges[o],t[o],null,i);var a=Ht(e.cm,r,e.sel.primIndex);at(e,a,n)}function Qi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,at(e,Ht(e.cm,i,e.sel.primIndex),r)}function wa(e,t,n,r){at(e,fr(t,n),r)}function ws(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var o=0;o<i.length;o++)this.ranges[o]=new Oe(ye(e,i[o].anchor),ye(e,i[o].head))},origin:n&&n.origin};return He(e,"beforeSelectionChange",e,r),e.cm&&He(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ht(e.cm,r.ranges,r.ranges.length-1):t}function ka(e,t,n){var r=e.history.done,i=Ce(r);i&&i.ranges?(r[r.length-1]=t,ni(e,t,n)):at(e,t,n)}function at(e,t,n){ni(e,t,n),ys(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ni(e,t,n){(bt(e,"beforeSelectionChange")||e.cm&&bt(e.cm,"beforeSelectionChange"))&&(t=ws(e,t,n));var r=n&&n.bias||(ie(t.primary().head,e.sel.primary().head)<0?-1:1);Ca(e,La(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&_r(e.cm)}function Ca(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Tt(e.cm)),Ze(e,"cursorActivity",e))}function Sa(e){Ca(e,La(e,e.sel,null,!1))}function La(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=ii(e,a.anchor,l&&l.anchor,n,r),u=a.head==a.anchor?s:ii(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Oe(s,u))}return i?Ht(e.cm,i,t.primIndex):t}function jr(e,t,n,r,i){var o=ue(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,d="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(u?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(d?l.to>=t.ch:l.to>t.ch))){if(i&&(He(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var p=s.find(r<0?1:-1),x=void 0;if((r<0?d:u)&&(p=Ta(e,p,-r,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(x=ie(p,n))&&(r<0?x<0:x>0))return jr(e,p,t,r,i)}var b=s.find(r<0?-1:1);return(r<0?u:d)&&(b=Ta(e,b,r,b.line==t.line?o:null)),b?jr(e,b,t,r,i):null}}return t}function ii(e,t,n,r,i){var o=r||1,a=jr(e,t,n,o,i)||!i&&jr(e,t,n,o,!0)||jr(e,t,n,-o,i)||!i&&jr(e,t,n,-o,!0);return a||(e.cantEdit=!0,A(e.first,0))}function Ta(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ye(e,A(t.line-1)):null:n>0&&t.ch==(r||ue(e,t.line)).text.length?t.line<e.first+e.size-1?A(t.line+1,0):null:new A(t.line,t.ch+n)}function Ma(e){e.setSelection(A(e.firstLine(),0),A(e.lastLine()),ft)}function Oa(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,o,a,l){i&&(r.from=ye(e,i)),o&&(r.to=ye(e,o)),a&&(r.text=a),l!==void 0&&(r.origin=l)}),He(e,"beforeChange",e,r),e.cm&&He(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function qr(e,t,n){if(e.cm){if(!e.cm.curOp)return Qe(e.cm,qr)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((bt(e,"beforeChange")||e.cm&&bt(e.cm,"beforeChange"))&&(t=Oa(e,t,!0),!t))){var r=bo&&!n&&yl(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Aa(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Aa(e,t)}}function Aa(e,t){if(!(t.text.length==1&&t.text[0]==""&&ie(t.from,t.to)==0)){var n=ji(e,t);ma(e,t,n,e.cm?e.cm.curOp.id:NaN),xn(e,t,n,yi(e,t));var r=[];dr(e,function(i,o){!o&&fe(r,i.history)==-1&&(za(i.history,t),r.push(i.history)),xn(i,t,null,yi(i,t))})}}function oi(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,a=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u<l.length&&(o=l[u],!(n?o.ranges&&!o.equals(e.sel):!o.ranges));u++);if(u!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=l.pop(),o.ranges){if(ti(o,s),n&&!o.equals(e.sel)){at(e,o,{clearRedo:!1});return}a=o}else if(r){l.push(o);return}else break;var d=[];ti(a,s),s.push({changes:d,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var p=bt(e,"beforeChange")||e.cm&&bt(e.cm,"beforeChange"),x=function(F){var Z=o.changes[F];if(Z.origin=t,p&&!Oa(e,Z,!1))return l.length=0,{};d.push(Yi(e,Z));var ee=F?ji(e,Z):Ce(l);xn(e,Z,ee,ba(e,Z)),!F&&e.cm&&e.cm.scrollIntoView({from:Z.from,to:cr(Z)});var ae=[];dr(e,function(te,se){!se&&fe(ae,te.history)==-1&&(za(te.history,Z),ae.push(te.history)),xn(te,Z,null,ba(te,Z))})},b=o.changes.length-1;b>=0;--b){var N=x(b);if(N)return N.v}}}}function Na(e,t){if(t!=0&&(e.first+=t,e.sel=new Lt(Ne(e.sel.ranges,function(i){return new Oe(A(i.anchor.line+t,i.anchor.ch),A(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){pt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)sr(e.cm,r,"gutter")}}function xn(e,t,n,r){if(e.cm&&!e.cm.curOp)return Qe(e.cm,xn)(e,t,n,r);if(t.to.line<e.first){Na(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Na(e,i),t={from:A(e.first,0),to:A(t.to.line+i,t.to.ch),text:[Ce(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:A(o,ue(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Xt(e,t.from,t.to),n||(n=ji(e,t)),e.cm?ks(e.cm,t,r):Xi(e,t,r),ni(e,n,ft),e.cantEdit&&ii(e,A(e.firstLine(),0))&&(e.cantEdit=!1)}}function ks(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=f(Et(ue(r,o.line))),r.iter(s,a.line+1,function(b){if(b==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Tt(e),Xi(r,t,n,Zo(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(b){var N=_n(b);N>i.maxLineLength&&(i.maxLine=b,i.maxLineLength=N,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),cl(r,o.line),mn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?pt(e):o.line==a.line&&t.text.length==1&&!ha(e.doc,t)?sr(e,o.line,"text"):pt(e,o.line,a.line+1,u);var d=bt(e,"changes"),p=bt(e,"change");if(p||d){var x={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};p&&Ze(e,"change",e,x),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(x)}e.display.selForContextMenu=null}function Xr(e,t,n,r,i){var o;r||(r=n),ie(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),qr(e,{from:n,to:r,text:t,origin:i})}function Da(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Pa(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)Da(o.ranges[l].anchor,t,n,r),Da(o.ranges[l].head,t,n,r);continue}for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(n<u.from.line)u.from=A(u.from.line+r,u.from.ch),u.to=A(u.to.line+r,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}function za(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Pa(e.done,n,r,i),Pa(e.undone,n,r,i)}function wn(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=ue(e,uo(e,t)):i=f(t),i==null?null:(r(o,i)&&e.cm&&sr(e.cm,i,n),o)}function kn(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}kn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Cl(i),Ze(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function Cn(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Cn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof kn))){var l=[];this.collapse(l),this.children=[new kn(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new kn(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Cn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=fe(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new Cn(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if((t-=a)==0)break;e=0}else e-=o}}};var Sn=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Sn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=f(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=fn(this);St(n,Math.max(0,n.height-o)),e&&(xt(e,function(){Ea(e,n,-o),sr(e,r,"widget")}),Ze(e,"lineWidgetCleared",e,this,r))}},Sn.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=fn(this)-t;i&&(lr(this.doc,r)||St(r,r.height+i),n&&xt(n,function(){n.curOp.forceUpdate=!0,Ea(n,r,i),Ze(n,"lineWidgetChanged",n,e,f(r))}))},At(Sn);function Ea(e,t,n){Zt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Bi(e,n)}function Cs(e,t,n,r){var i=new Sn(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),wn(e,t,"widget",function(a){var l=a.widgets||(a.widgets=[]);if(i.insertAt==null?l.push(i):l.splice(Math.min(l.length,Math.max(0,i.insertAt)),0,i),i.line=a,o&&!lr(e,a)){var s=Zt(a)<e.scrollTop;St(a,a.height+fn(i)),s&&Bi(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&Ze(o,"lineWidgetAdded",o,i,typeof t=="number"?t:f(t)),i}var Wa=0,hr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Wa};hr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Sr(e),bt(this,"clear")){var n=this.find();n&&Ze(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=ln(a.markedSpans,this);e&&!this.collapsed?sr(e,f(a),"text"):e&&(l.to!=null&&(i=f(a)),l.from!=null&&(r=f(a))),a.markedSpans=pl(a.markedSpans,l),l.from==null&&this.collapsed&&!lr(this.doc,a)&&e&&St(a,Br(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=Et(this.lines[s]),d=_n(u);d>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=d,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&pt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Sa(e.doc)),e&&Ze(e,"markerCleared",e,this,r,i),t&&Lr(e),this.parent&&this.parent.clear()}},hr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=ln(o.markedSpans,this);if(a.from!=null&&(n=A(t?o:f(o),a.from),e==-1))return n;if(a.to!=null&&(r=A(t?o:f(o),a.to),e==1))return r}return n&&{from:n,to:r}},hr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||xt(r,function(){var i=t.line,o=f(t.line),a=Ti(r,o);if(a&&(Ko(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!lr(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=fn(n)-l;s&&St(i,i.height+s)}Ze(r,"markerChanged",r,e)})},hr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||fe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},hr.prototype.detachLine=function(e){if(this.lines.splice(fe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},At(hr);function Yr(e,t,n,r,i){if(r&&r.shared)return Ss(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Qe(e.cm,Yr)(e,t,n,r,i);var o=new hr(e,i),a=ie(t,n);if(r&&xe(r,o,!1),a>0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=G("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Lo(e,t.line,t,n,o)||t.line!=n.line&&Lo(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");hl()}o.addToHistory&&ma(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,n.line+1,function(p){s&&o.collapsed&&!s.options.lineWrapping&&Et(p)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&St(p,0),gl(p,new In(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(p){lr(e,p)&&St(p,0)}),o.clearOnEnter&&de(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(dl(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Wa,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)pt(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var d=t.line;d<=n.line;d++)sr(s,d,"text");o.atomic&&Sa(s.doc),Ze(s,"markerAdded",s,o)}return o}var Ln=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Ln.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ze(this,"clear")}},Ln.prototype.find=function(e,t){return this.primary.find(e,t)},At(Ln);function Ss(e,t,n,r,i){r=xe(r),r.shared=!1;var o=[Yr(e,t,n,r,i)],a=o[0],l=r.widgetNode;return dr(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Yr(s,ye(s,t),ye(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;a=Ce(o)}),new Ln(o,a)}function Ha(e){return e.findMarks(A(e.first,0),e.clipPos(A(e.lastLine())),function(t){return t.parent})}function Ls(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ie(o,a)){var l=Yr(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Ts(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];dr(i.primary.doc,function(s){return o.push(s)});for(var a=0;a<i.markers.length;a++){var l=i.markers[a];fe(o,l.doc)==-1&&(l.parent=null,i.markers.splice(a--,1))}},n=0;n<e.length;n++)t(n)}var Ms=0,gt=function(e,t,n,r,i){if(!(this instanceof gt))return new gt(e,t,n,r,i);n==null&&(n=0),Cn.call(this,[new kn([new Hr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=A(n,0);this.sel=fr(o),this.history=new ei(null),this.id=++Ms,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Xi(this,{from:o,to:o,text:e}),at(this,fr(o),ft)};gt.prototype=D(Cn.prototype,{constructor:gt,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=on(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Je(function(e){var t=A(this.first,0),n=this.first+this.size-1;qr(this,{from:t,to:A(n,ue(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&hn(this.cm,0,0),at(this,fr(t),ft)}),replaceRange:function(e,t,n,r){t=ye(this,t),n=n?ye(this,n):t,Xr(this,e,t,n,r)},getRange:function(e,t,n){var r=Xt(this,ye(this,e),ye(this,t));return n===!1?r:n===""?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(z(this,e))return ue(this,e)},getLineNumber:function(e){return f(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ue(this,e)),Et(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ye(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Je(function(e,t,n){wa(this,ye(this,typeof e=="number"?A(e,t||0):e),null,n)}),setSelection:Je(function(e,t,n){wa(this,ye(this,e),ye(this,t||e),n)}),extendSelection:Je(function(e,t,n){ri(this,ye(this,e),t&&ye(this,t),n)}),extendSelections:Je(function(e,t){xa(this,fo(this,e),t)}),extendSelectionsBy:Je(function(e,t){var n=Ne(this.sel.ranges,e);xa(this,fo(this,n),t)}),setSelections:Je(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Oe(ye(this,e[i].anchor),ye(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),at(this,Ht(this.cm,r,t),n)}}),addSelection:Je(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Oe(ye(this,e),ye(this,t||e))),at(this,Ht(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=Xt(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Xt(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Je(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&t!="end"&&ps(this,r,t),s=r.length-1;s>=0;s--)qr(this,r[s]);l?ka(this,l):this.cm&&_r(this.cm)}),undo:Je(function(){oi(this,"undo")}),redo:Je(function(){oi(this,"redo")}),undoSelection:Je(function(){oi(this,"undo",!0)}),redoSelection:Je(function(){oi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new ei(this.history),dr(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Gr(this.history.done),undone:Gr(this.history.undone)}},setHistory:function(e){var t=this.history=new ei(this.history);t.done=Gr(e.done.slice(0),null,!0),t.undone=Gr(e.undone.slice(0),null,!0)},setGutterMarker:Je(function(e,t,n){return wn(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&zn(i)&&(r.gutterMarkers=null),!0})}),clearGutter:Je(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&wn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,zn(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!z(this,e)||(t=e,e=ue(this,e),!e))return null}else if(t=f(e),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:Je(function(e,t,n){return wn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(H(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:Je(function(e,t,n){return wn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[i];if(o)if(n==null)r[i]=null;else{var a=o.match(H(n));if(!a)return!1;var l=a.index+a[0].length;r[i]=o.slice(0,a.index)+(!a.index||l==o.length?"":" ")+o.slice(l)||null}else return!1;return!0})}),addLineWidget:Je(function(e,t,n){return Cs(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Yr(this,ye(this,e),ye(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ye(this,e),Yr(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ye(this,e);var t=[],n=ue(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ye(this,e),t=ye(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];!(s.to!=null&&i==e.line&&e.ch>=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),ye(this,A(n,t))},indexFromPos:function(e){e=ye(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new gt(on(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new gt(on(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Ls(r,Ha(this)),r},unlinkDoc:function(e){if(e instanceof Ee&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ts(Ha(this));break}}if(e.history==this.history){var r=[e.id];dr(e,function(i){return r.push(i.id)},!0),e.history=new ei(null),e.history.done=Gr(this.history.done,r),e.history.undone=Gr(this.history.undone,r)}},iterLinkedDocs:function(e){dr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Mt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Je(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&gs(this.cm))})}),gt.prototype.eachLine=gt.prototype.iter;var Fa=0;function Os(e){var t=this;if(Ia(t),!(Fe(t,e)||Qt(t.display,e))){ot(e),R&&(Fa=+new Date);var n=xr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(){++a==i&&Qe(t,function(){n=ye(t.doc,n);var b={from:n,to:n,text:t.doc.splitLines(o.filter(function(N){return N!=null}).join(t.doc.lineSeparator())),origin:"paste"};qr(t.doc,b),ka(t.doc,fr(ye(t.doc,n),ye(t.doc,cr(b))))})()},s=function(b,N){if(t.options.allowDropFileTypes&&fe(t.options.allowDropFileTypes,b.type)==-1){l();return}var F=new FileReader;F.onerror=function(){return l()},F.onload=function(){var Z=F.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Z)){l();return}o[N]=Z,l()},F.readAsText(b)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var d=e.dataTransfer.getData("Text");if(d){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),ni(t.doc,fr(n,n)),p)for(var x=0;x<p.length;++x)Xr(t.doc,"",p[x].anchor,p[x].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(b){}}}}function As(e,t){if(R&&(!e.state.draggingText||+new Date-Fa<100)){nr(t);return}if(!(Fe(e,t)||Qt(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!V)){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",T&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),T&&n.parentNode.removeChild(n)}}function Ns(e,t){var n=xr(e,t);if(n){var r=document.createDocumentFragment();Ei(e,n,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),j(e.display.dragCursor,r)}}function Ia(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ba(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}}var Ra=!1;function Ds(){Ra||(Ps(),Ra=!0)}function Ps(){var e;de(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ba(zs)},100))}),de(window,"blur",function(){return Ba(Kr)})}function zs(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var pr={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"},Tn=0;Tn<10;Tn++)pr[Tn+48]=pr[Tn+96]=String(Tn);for(var ai=65;ai<=90;ai++)pr[ai]=String.fromCharCode(ai);for(var Mn=1;Mn<=12;Mn++)pr[Mn+111]=pr[Mn+63235]="F"+Mn;var Vt={};Vt.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"},Vt.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"},Vt.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"},Vt.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"]},Vt.default=E?Vt.macDefault:Vt.pcDefault;function Es(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ws(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=Ne(n.split(" "),Es),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(!s)t[l]=a;else if(s!=a)throw new Error("Inconsistent bindings for "+l)}delete e[n]}for(var u in t)e[u]=t[u];return e}function Zr(e,t,n,r){t=li(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Zr(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Zr(e,t.fallthrough[o],n,r);if(a)return a}}}function Ka(e){var t=typeof e=="string"?e:pr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function _a(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(P?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(P?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Ua(e,t){if(T&&e.keyCode==34&&e.char)return!1;var n=pr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),_a(n,e,t))}function li(e){return typeof e=="string"?Vt[e]:e}function Qr(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&ie(o.from,Ce(r).to)<=0;){var a=r.pop();if(ie(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}xt(e,function(){for(var l=r.length-1;l>=0;l--)Xr(e.doc,"",r[l].from,r[l].to,"+delete");_r(e)})}function Ji(e,t,n){var r=er(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Vi(e,t,n){var r=Ji(e,t.ch,n);return r==null?null:new A(t.line,r,n<0?"after":"before")}function $i(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=ke(n,t.doc.direction);if(o){var a=i<0?Ce(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var d=Ir(t,n);u=i<0?n.text.length-1:0;var p=_t(t,d,u).top;u=It(function(x){return _t(t,d,x).top==p},i<0==(a.level==1)?a.from:a.to-1,u),s=="before"&&(u=Ji(n,u,1))}else u=i<0?a.to:a.from;return new A(r,u,s)}}return new A(r,i<0?n.text.length:0,i<0?"before":"after")}function Hs(e,t,n,r){var i=ke(t,e.doc.direction);if(!i)return Vi(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=rr(i,n.ch,n.sticky),a=i[o];if(e.doc.direction=="ltr"&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Vi(t,n,r);var l=function(ee,ae){return Ji(t,ee instanceof A?ee.ch:ee,ae)},s,u=function(ee){return e.options.lineWrapping?(s=s||Ir(e,t),Yo(e,t,s,ee)):{begin:0,end:t.text.length}},d=u(n.sticky=="before"?l(n,-1):n.ch);if(e.doc.direction=="rtl"||a.level==1){var p=a.level==1==r<0,x=l(n,p?1:-1);if(x!=null&&(p?x<=a.to&&x<=d.end:x>=a.from&&x>=d.begin)){var b=p?"before":"after";return new A(n.line,x,b)}}var N=function(ee,ae,te){for(var se=function(De,Ve){return Ve?new A(n.line,l(De,1),"before"):new A(n.line,De,"after")};ee>=0&&ee<i.length;ee+=ae){var he=i[ee],ce=ae>0==(he.level!=1),we=ce?te.begin:l(te.end,-1);if(he.from<=we&&we<he.to||(we=ce?he.from:l(he.to,-1),te.begin<=we&&we<te.end))return se(we,ce)}},F=N(o+r,r,d);if(F)return F;var Z=r>0?d.end:l(d.begin,-1);return Z!=null&&!(r>0&&Z==t.text.length)&&(F=N(r>0?0:i.length-1,r,u(Z)),F)?F:null}var On={selectAll:Ma,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ft)},killLine:function(e){return Qr(e,function(t){if(t.empty()){var n=ue(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:A(t.head.line+1,0)}:{from:t.head,to:A(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Qr(e,function(t){return{from:A(t.from().line,0),to:ye(e.doc,A(t.to().line+1,0))}})},delLineLeft:function(e){return Qr(e,function(t){return{from:A(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Qr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Qr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},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(A(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(A(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ga(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ja(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Fs(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Te)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Te)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ja(e,t.head):r},Te)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Se(e.getLine(o.line),o.ch,r);t.push(Ct(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return xt(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=ue(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new A(i.line,i.ch-1)),i.ch>0)i=new A(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),A(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=ue(e.doc,i.line-1).text;a&&(i=new A(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),A(i.line-1,a.length-1),i,"+transpose"))}}n.push(new Oe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return xt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);_r(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ga(e,t){var n=ue(e.doc,t),r=Et(n);return r!=n&&(t=f(r)),$i(!0,e,r,t,1)}function Fs(e,t){var n=ue(e.doc,t),r=xl(n);return r!=n&&(t=f(r)),$i(!0,e,n,t,-1)}function ja(e,t){var n=Ga(e,t.line),r=ue(e.doc,n.line),i=ke(r,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return A(n.line,a?0:o,n.sticky)}return n}function si(e,t,n){if(typeof t=="string"&&(t=On[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ot}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Is(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Zr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Zr(t,e.options.extraKeys,n,e)||Zr(t,e.options.keyMap,n,e)}var Bs=new be;function An(e,t,n,r){var i=e.state.keySeq;if(i){if(Ka(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Bs.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),qa(e,i+" "+t,n,r))return!0}return qa(e,t,n,r)}function qa(e,t,n,r){var i=Is(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Ze(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(ot(n),Wi(e)),!!i}function Xa(e,t){var n=Ua(t,!0);return n?t.shiftKey&&!e.state.keySeq?An(e,"Shift-"+n,t,function(r){return si(e,r,!0)})||An(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return si(e,r)}):An(e,n,t,function(r){return si(e,r)}):!1}function Rs(e,t,n){return An(e,"'"+n+"'",t,function(r){return si(e,r,!0)})}var eo=null;function Ya(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=ve(Xe(t)),!Fe(t,e))){R&&W<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Xa(t,e);T&&(eo=r?n:null,!r&&n==88&&!Hn&&(E?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),re&&!E&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ks(t)}}function Ks(e){var t=e.display.lineDiv;me(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(Q(t,"CodeMirror-crosshair"),it(document,"keyup",n),it(document,"mouseover",n))}de(document,"keyup",n),de(document,"mouseover",n)}function Za(e){e.keyCode==16&&(this.doc.sel.shift=!1),Fe(this,e)}function Qa(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Qt(t.display,e)||Fe(t,e)||e.ctrlKey&&!e.altKey||E&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(T&&n==eo){eo=null,ot(e);return}if(!(T&&(!e.which||e.which<10)&&Xa(t,e))){var i=String.fromCharCode(r==null?n:r);i!="\b"&&(Rs(t,e,i)||t.display.input.onKeyPress(e))}}}var _s=400,to=function(e,t,n){this.time=e,this.pos=t,this.button=n};to.prototype.compare=function(e,t,n){return this.time+_s>e&&ie(t,this.pos)==0&&n==this.button};var Nn,Dn;function Us(e,t){var n=+new Date;return Dn&&Dn.compare(n,e,t)?(Nn=Dn=null,"triple"):Nn&&Nn.compare(n,e,t)?(Dn=new to(n,e,t),Nn=null,"double"):(Nn=new to(n,e,t),Dn=null,"single")}function Ja(e){var t=this,n=t.display;if(!(Fe(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Qt(n,e)){y||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!ro(t,e)){var r=xr(t,e),i=Nt(e),o=r?Us(r,i):"single";ge(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Gs(t,i,r,o,e))&&(i==1?r?qs(t,r,o,e):tn(e)==n.scroller&&ot(e):i==2?(r&&ri(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(U?t.display.input.onContextMenu(e):Hi(t)))}}}function Gs(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,An(e,_a(o,i),i,function(a){if(typeof a=="string"&&(a=On[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=Ot}finally{e.state.suppressEdits=!1}return l})}function js(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=B?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=E?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(E?n.altKey:n.ctrlKey)),i}function qs(e,t,n,r){R?setTimeout(pe(Vo,e),0):e.curOp.focus=ve(Xe(e));var i=js(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&pi&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(ie((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(ie(a.to(),t)>0||t.xRel<0)?Xs(e,r,t,i):Ys(e,r,t,i)}function Xs(e,t,n,r){var i=e.display,o=!1,a=Qe(e,function(u){y&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Hi(e)),it(i.wrapper.ownerDocument,"mouseup",a),it(i.wrapper.ownerDocument,"mousemove",l),it(i.scroller,"dragstart",s),it(i.scroller,"drop",a),o||(ot(u),r.addNew||ri(e.doc,n,null,null,r.extend),y&&!V||R&&W==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};y&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,de(i.wrapper.ownerDocument,"mouseup",a),de(i.wrapper.ownerDocument,"mousemove",l),de(i.scroller,"dragstart",s),de(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Va(e,t,n){if(n=="char")return new Oe(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Oe(A(t.line,0),ye(e.doc,A(t.line+1,0)));var r=n(e,t);return new Oe(r.from,r.to)}function Ys(e,t,n,r){R&&Hi(e);var i=e.display,o=e.doc;ot(t);var a,l,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=u[l]:a=new Oe(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new Oe(n,n)),n=xr(e,t,!0,!0),l=-1;else{var d=Va(e,n,r.unit);r.extend?a=Zi(a,d.anchor,d.head,r.extend):a=d}r.addNew?l==-1?(l=u.length,at(o,Ht(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(at(o,Ht(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):Qi(o,l,a,kt):(l=0,at(o,new Lt([a],0),kt),s=o.sel);var p=n;function x(te){if(ie(p,te)!=0)if(p=te,r.unit=="rectangle"){for(var se=[],he=e.options.tabSize,ce=Se(ue(o,n.line).text,n.ch,he),we=Se(ue(o,te.line).text,te.ch,he),De=Math.min(ce,we),Ve=Math.max(ce,we),We=Math.min(n.line,te.line),wt=Math.min(e.lastLine(),Math.max(n.line,te.line));We<=wt;We++){var vt=ue(o,We).text,Ue=Ke(vt,De,he);De==Ve?se.push(new Oe(A(We,Ue),A(We,Ue))):vt.length>Ue&&se.push(new Oe(A(We,Ue),A(We,Ke(vt,Ve,he))))}se.length||se.push(new Oe(n,n)),at(o,Ht(e,s.ranges.slice(0,l).concat(se),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(te)}else{var mt=a,tt=Va(e,te,r.unit),qe=mt.anchor,Ge;ie(tt.anchor,qe)>0?(Ge=tt.head,qe=Wr(mt.from(),tt.anchor)):(Ge=tt.anchor,qe=ht(mt.to(),tt.head));var Be=s.ranges.slice(0);Be[l]=Zs(e,new Oe(ye(o,qe),Ge)),at(o,Ht(e,Be,l),kt)}}var b=i.wrapper.getBoundingClientRect(),N=0;function F(te){var se=++N,he=xr(e,te,!0,r.unit=="rectangle");if(he)if(ie(he,p)!=0){e.curOp.focus=ve(Xe(e)),x(he);var ce=Qn(i,o);(he.line>=ce.to||he.line<ce.from)&&setTimeout(Qe(e,function(){N==se&&F(te)}),150)}else{var we=te.clientY<b.top?-20:te.clientY>b.bottom?20:0;we&&setTimeout(Qe(e,function(){N==se&&(i.scroller.scrollTop+=we,F(te))}),50)}}function Z(te){e.state.selectingText=!1,N=1/0,te&&(ot(te),i.input.focus()),it(i.wrapper.ownerDocument,"mousemove",ee),it(i.wrapper.ownerDocument,"mouseup",ae),o.history.lastSelOrigin=null}var ee=Qe(e,function(te){te.buttons===0||!Nt(te)?Z(te):F(te)}),ae=Qe(e,Z);e.state.selectingText=ae,de(i.wrapper.ownerDocument,"mousemove",ee),de(i.wrapper.ownerDocument,"mouseup",ae)}function Zs(e,t){var n=t.anchor,r=t.head,i=ue(e.doc,n.line);if(ie(n,r)==0&&n.sticky==r.sticky)return t;var o=ke(i);if(!o)return t;var a=rr(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=a+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var d=rr(o,r.ch,r.sticky),p=d-a||(r.ch-n.ch)*(l.level==1?-1:1);d==s-1||d==s?u=p<0:u=p>0}var x=o[s+(u?-1:0)],b=u==(x.level==1),N=b?x.from:x.to,F=b?"after":"before";return n.ch==N&&n.sticky==F?t:new Oe(new A(n.line,N,F),r)}function $a(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(x){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ot(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!bt(e,n))return dt(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=a.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var d=h(e.doc,o),p=e.display.gutterSpecs[s];return He(e,n,e,d,p.className,t),dt(t)}}}function ro(e,t){return $a(e,t,"gutterClick",!0)}function el(e,t){Qt(e.display,t)||Qs(e,t)||Fe(e,t,"contextmenu")||U||e.display.input.onContextMenu(t)}function Qs(e,t){return bt(e,"gutterContextMenu")?$a(e,t,"gutterContextMenu",!1):!1}function tl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),cn(e)}var Jr={toString:function(){return"CodeMirror.Init"}},rl={},ui={};function Js(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,u){u!=Jr&&o(l,s,u)}:o)}e.defineOption=n,e.Init=Jr,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,qi(r)},!0),n("indentUnit",2,qi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){bn(r),cn(r),pt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],a=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var d=s.text.indexOf(i,u);if(d==-1)break;u=d+i.length,o.push(A(a,d))}a++});for(var l=o.length-1;l>=0;l--)Xr(r.doc,i,o[l],A(o[l].line,o[l].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=Jr&&r.refresh()}),n("specialCharPlaceholder",Tl,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",M?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!q),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){tl(r),yn(r)},!0),n("keyMap","default",function(r,i,o){var a=li(i),l=o!=Jr&&li(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,$s,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Gi(i,r.options.lineNumbers),yn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Pi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Ur(r)},!0),n("scrollbarStyle","native",function(r){ia(r),Ur(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Gi(r.options.gutters,i),yn(r)},!0),n("firstLineNumber",1,yn,!0),n("lineNumberFormatter",function(r){return r},yn,!0),n("showCursorWhenSelecting",!1,dn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Kr(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Vs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,dn,!0),n("singleCursorHeightPerLine",!0,dn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,bn,!0),n("addModeClass",!1,bn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,bn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Vs(e,t,n){var r=n&&n!=Jr;if(!t!=!r){var i=e.display.dragFunctions,o=t?de:it;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function $s(e){e.options.lineWrapping?(me(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Q(e.display.wrapper,"CodeMirror-wrap"),ki(e)),zi(e),pt(e),cn(e),setTimeout(function(){return Ur(e)},100)}function Ee(e,t){var n=this;if(!(this instanceof Ee))return new Ee(e,t);this.options=t=t?xe(t):{},xe(rl,t,!1);var r=t.value;typeof r=="string"?r=new gt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ee.inputStyles[t.inputStyle](this),o=this.display=new ds(e,r,i,t);o.wrapper.CodeMirror=this,tl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ia(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new be,keySeq:null,specialChars:null},t.autofocus&&!M&&o.input.focus(),R&&W<11&&setTimeout(function(){return n.display.input.reset(!0)},20),eu(this),Ds(),Sr(this),this.curOp.forceUpdate=!0,pa(this,r),t.autofocus&&!M||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Fi(n)},20):Kr(this);for(var a in ui)ui.hasOwnProperty(a)&&ui[a](this,t[a],Jr);la(this),t.finishInit&&t.finishInit(this);for(var l=0;l<no.length;++l)no[l](this);Lr(this),y&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}Ee.defaults=rl,Ee.optionHandlers=ui;function eu(e){var t=e.display;de(t.scroller,"mousedown",Qe(e,Ja)),R&&W<11?de(t.scroller,"dblclick",Qe(e,function(s){if(!Fe(e,s)){var u=xr(e,s);if(!(!u||ro(e,s)||Qt(e.display,s))){ot(s);var d=e.findWordAt(u);ri(e.doc,d.anchor,d.head)}}})):de(t.scroller,"dblclick",function(s){return Fe(e,s)||ot(s)}),de(t.scroller,"contextmenu",function(s){return el(e,s)}),de(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||el(e,s)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function a(s,u){if(u.left==null)return!0;var d=u.left-s.left,p=u.top-s.top;return d*d+p*p>400}de(t.scroller,"touchstart",function(s){if(!Fe(e,s)&&!o(s)&&!ro(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),de(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),de(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Qt(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var d=e.coordsChar(t.activeTouch,"page"),p;!u.prev||a(u,u.prev)?p=new Oe(d,d):!u.prev.prev||a(u,u.prev.prev)?p=e.findWordAt(d):p=new Oe(A(d.line,0),ye(e.doc,A(d.line+1,0))),e.setSelection(p.anchor,p.head),e.focus(),ot(s)}i()}),de(t.scroller,"touchcancel",i),de(t.scroller,"scroll",function(){t.scroller.clientHeight&&(pn(e,t.scroller.scrollTop),kr(e,t.scroller.scrollLeft,!0),He(e,"scroll",e))}),de(t.scroller,"mousewheel",function(s){return fa(e,s)}),de(t.scroller,"DOMMouseScroll",function(s){return fa(e,s)}),de(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Fe(e,s)||nr(s)},over:function(s){Fe(e,s)||(Ns(e,s),nr(s))},start:function(s){return As(e,s)},drop:Qe(e,Os),leave:function(s){Fe(e,s)||Ia(e)}};var l=t.input.getField();de(l,"keyup",function(s){return Za.call(e,s)}),de(l,"keydown",Qe(e,Ya)),de(l,"keypress",Qe(e,Qa)),de(l,"focus",function(s){return Fi(e,s)}),de(l,"blur",function(s){return Kr(e,s)})}var no=[];Ee.defineInitHook=function(e){return no.push(e)};function Pn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=an(e,t).state:n="prev");var a=e.options.tabSize,l=ue(i,t),s=Se(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],d;if(!r&&!/\S/.test(l.text))d=0,n="not";else if(n=="smart"&&(d=i.mode.indent(o,l.text.slice(u.length),l.text),d==Ot||d>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?d=Se(ue(i,t-1).text,null,a):d=0:n=="add"?d=s+e.options.indentUnit:n=="subtract"?d=s-e.options.indentUnit:typeof n=="number"&&(d=s+n),d=Math.max(0,d);var p="",x=0;if(e.options.indentWithTabs)for(var b=Math.floor(d/a);b;--b)x+=a,p+=" ";if(x<d&&(p+=Ct(d-x)),p!=u)return Xr(i,p,A(t,0),A(t,u.length),"+input"),l.stateAfter=null,!0;for(var N=0;N<i.sel.ranges.length;N++){var F=i.sel.ranges[N];if(F.head.line==t&&F.head.ch<u.length){var Z=A(t,u.length);Qi(i,N,new Oe(Z,Z));break}}}var Ft=null;function fi(e){Ft=e}function io(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,l=i=="paste"||e.state.pasteIncoming>a,s=Mt(t),u=null;if(l&&r.ranges.length>1)if(Ft&&Ft.text.join(`
`)==t){if(r.ranges.length%Ft.text.length==0){u=[];for(var d=0;d<Ft.text.length;d++)u.push(o.splitLines(Ft.text[d]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=Ne(s,function(ee){return[ee]}));for(var p=e.curOp.updateInput,x=r.ranges.length-1;x>=0;x--){var b=r.ranges[x],N=b.from(),F=b.to();b.empty()&&(n&&n>0?N=A(N.line,N.ch-n):e.state.overwrite&&!l?F=A(F.line,Math.min(ue(o,F.line).text.length,F.ch+Ce(s).length)):l&&Ft&&Ft.lineWise&&Ft.text.join(`
`)==s.join(`
`)&&(N=F=A(N.line,0)));var Z={from:N,to:F,text:u?u[x%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};qr(e.doc,Z),Ze(e,"inputRead",e,Z)}t&&!l&&il(e,t),_r(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function nl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&xt(t,function(){return io(t,n,0,null,"paste")}),!0}function il(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Pn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ue(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Pn(e,i.head.line,"smart"));a&&Ze(e,"electricInput",e,i.head.line)}}}function ol(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:A(i,0),head:A(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function oo(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function al(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return y?e.style.width="1000px":e.setAttribute("wrap","off"),O&&(e.style.border="1px solid black"),t}function tu(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){ge(this).focus(),this.display.input.focus()},setOption:function(r,i){var o=this.options,a=o[r];o[r]==i&&r!="mode"||(o[r]=i,t.hasOwnProperty(r)&&Qe(this,t[r])(this,i,a),He(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](li(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==r||i[o].name==r)return i.splice(o,1),!0},addOverlay:st(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");S(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(a){return a.priority}),this.state.modeGen++,pt(this)}),removeOverlay:st(function(r){for(var i=this.state.overlays,o=0;o<i.length;++o){var a=i[o].modeSpec;if(a==r||typeof r=="string"&&a.name==r){i.splice(o,1),this.state.modeGen++,pt(this);return}}}),indentLine:st(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),z(this.doc,r)&&Pn(this,r,i,o)}),indentSelection:st(function(r){for(var i=this.doc.sel.ranges,o=-1,a=0;a<i.length;a++){var l=i[a];if(l.empty())l.head.line>o&&(Pn(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&_r(this));else{var s=l.from(),u=l.to(),d=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var p=d;p<o;++p)Pn(this,p,r);var x=this.doc.sel.ranges;s.ch==0&&i.length==x.length&&x[a].from().ch>0&&Qi(this.doc,a,new Oe(s,x[a].to()),ft)}}}),getTokenAt:function(r,i){return vo(this,r,i)},getLineTokens:function(r,i){return vo(this,A(r),i,!0)},getTokenTypeAt:function(r){r=ye(this.doc,r);var i=ho(this,ue(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=o+a>>1;if((u?i[u*2-1]:0)>=l)a=u;else if(i[u*2+1]<l)o=u+1;else{s=i[u*2+2];break}}var d=s?s.indexOf("overlay "):-1;return d<0?s:d==0?null:s.slice(0,d-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var a=n[i],l=this.getModeAt(r);if(typeof l[i]=="string")a[l[i]]&&o.push(a[l[i]]);else if(l[i])for(var s=0;s<l[i].length;s++){var u=a[l[i][s]];u&&o.push(u)}else l.helperType&&a[l.helperType]?o.push(a[l.helperType]):a[l.name]&&o.push(a[l.name]);for(var d=0;d<a._global.length;d++){var p=a._global[d];p.pred(l,this)&&fe(o,p.val)==-1&&o.push(p.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=uo(o,r==null?o.first+o.size-1:r),an(this,r+1,i).state},cursorCoords:function(r,i){var o,a=this.doc.sel.primary();return r==null?o=a.head:typeof r=="object"?o=ye(this.doc,r):o=r?a.from():a.to(),Wt(this,o,i||"page")},charCoords:function(r,i){return qn(this,ye(this.doc,r),i||"page")},coordsChar:function(r,i){return r=jo(this,r,i||"page"),Ai(this,r.left,r.top)},lineAtHeight:function(r,i){return r=jo(this,{top:r,left:0},i||"page").top,h(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,o){var a=!1,l;if(typeof r=="number"){var s=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>s&&(r=s,a=!0),l=ue(this.doc,r)}else l=r;return jn(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-Zt(l):0)},defaultTextHeight:function(){return Br(this.display)},defaultCharWidth:function(){return Rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,a,l){var s=this.display;r=Wt(this,ye(this.doc,r));var u=r.bottom,d=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),a=="over")u=r.top;else if(a=="above"||a=="near"){var p=Math.max(s.wrapper.clientHeight,this.doc.height),x=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>p)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=p&&(u=r.bottom),d+i.offsetWidth>x&&(d=x-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(d=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?d=0:l=="middle"&&(d=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=d+"px"),o&&Vl(this,{left:d,top:u,right:d+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:st(Ya),triggerOnKeyPress:st(Qa),triggerOnKeyUp:Za,triggerOnMouseDown:st(Ja),execCommand:function(r){if(On.hasOwnProperty(r))return On[r].call(null,this)},triggerElectric:st(function(r){il(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=ye(this.doc,r),u=0;u<i&&(s=ao(this.doc,s,l,o,a),!s.hitSide);++u);return s},moveH:st(function(r,i){var o=this;this.extendSelectionsBy(function(a){return o.display.shift||o.doc.extend||a.empty()?ao(o.doc,a.head,r,i,o.options.rtlMoveVisually):r<0?a.from():a.to()},Te)}),deleteH:st(function(r,i){var o=this.doc.sel,a=this.doc;o.somethingSelected()?a.replaceSelection("",null,"+delete"):Qr(this,function(l){var s=ao(a,l.head,r,i,!1);return r<0?{from:s,to:l.head}:{from:l.head,to:s}})}),findPosV:function(r,i,o,a){var l=1,s=a;i<0&&(l=-1,i=-i);for(var u=ye(this.doc,r),d=0;d<i;++d){var p=Wt(this,u,"div");if(s==null?s=p.left:p.left=s,u=ll(this,p,l,o),u.hitSide)break}return u},moveV:st(function(r,i){var o=this,a=this.doc,l=[],s=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(d){if(s)return r<0?d.from():d.to();var p=Wt(o,d.head,"div");d.goalColumn!=null&&(p.left=d.goalColumn),l.push(p.left);var x=ll(o,p,r,i);return i=="page"&&d==a.sel.primary()&&Bi(o,qn(o,x,"div").top-p.top),x},Te),l.length)for(var u=0;u<a.sel.ranges.length;u++)a.sel.ranges[u].goalColumn=l[u]}),findWordAt:function(r){var i=this.doc,o=ue(i,r.line).text,a=r.ch,l=r.ch;if(o){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||l==o.length)&&a?--a:++l;for(var u=o.charAt(a),d=Gt(u,s)?function(p){return Gt(p,s)}:/\s/.test(u)?function(p){return/\s/.test(p)}:function(p){return!/\s/.test(p)&&!Gt(p)};a>0&&d(o.charAt(a-1));)--a;for(;l<o.length&&d(o.charAt(l));)++l}return new Oe(A(r.line,a),A(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?me(this.display.cursorDiv,"CodeMirror-overwrite"):Q(this.display.cursorDiv,"CodeMirror-overwrite"),He(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ve(Xe(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:st(function(r,i){hn(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Kt(this)-this.display.barHeight,width:r.scrollWidth-Kt(this)-this.display.barWidth,clientHeight:Li(this),clientWidth:yr(this)}},scrollIntoView:st(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:A(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?$l(this,r):ea(this,r.from,r.to,r.margin)}),setSize:st(function(r,i){var o=this,a=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=a(r)),i!=null&&(this.display.wrapper.style.height=a(i)),this.options.lineWrapping&&_o(this);var l=this.display.viewFrom;this.doc.iter(l,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){sr(o,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,He(this,"refresh",this)}),operation:function(r){return xt(this,r)},startOperation:function(){return Sr(this)},endOperation:function(){return Lr(this)},refresh:st(function(){var r=this.display.cachedTextHeight;pt(this),this.curOp.forceUpdate=!0,cn(this),hn(this,this.doc.scrollLeft,this.doc.scrollTop),_i(this.display),(r==null||Math.abs(r-Br(this.display))>.5||this.options.lineWrapping)&&zi(this),He(this,"refresh",this)}),swapDoc:st(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),pa(this,r),cn(this),this.display.input.reset(),hn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Ze(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},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}},At(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,a){e.registerHelper(r,i,a),n[r]._global.push({pred:o,val:a})}}function ao(e,t,n,r,i){var o=t,a=n,l=ue(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var ae=t.line+s;return ae<e.first||ae>=e.first+e.size?!1:(t=new A(ae,t.ch,t.sticky),l=ue(e,ae))}function d(ae){var te;if(r=="codepoint"){var se=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(se))te=null;else{var he=n>0?se>=55296&&se<56320:se>=56320&&se<57343;te=new A(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(he?2:1))),-n)}}else i?te=Hs(e.cm,l,t,n):te=Vi(l,t,n);if(te==null)if(!ae&&u())t=$i(i,e.cm,l,t.line,s);else return!1;else t=te;return!0}if(r=="char"||r=="codepoint")d();else if(r=="column")d(!0);else if(r=="word"||r=="group")for(var p=null,x=r=="group",b=e.cm&&e.cm.getHelper(t,"wordChars"),N=!0;!(n<0&&!d(!N));N=!1){var F=l.text.charAt(t.ch)||`
`,Z=Gt(F,b)?"w":x&&F==`
`?"n":!x||/\s/.test(F)?null:"p";if(x&&!N&&!Z&&(Z="s"),p&&p!=Z){n<0&&(n=1,d(),t.sticky="after");break}if(Z&&(p=Z),n>0&&!d(!N))break}var ee=ii(e,t,o,a,!0);return Me(o,ee)&&(ee.hitSide=!0),ee}function ll(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,ge(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*Br(e.display),3);a=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var u;u=Ai(e,o,a),!!u.outside;){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var Ae=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new be,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ae.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,oo(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(l){for(var s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}de(i,"paste",function(l){!o(l)||Fe(r,l)||nl(l,r)||W<=11&&setTimeout(Qe(r,function(){return t.updateFromDOM()}),20)}),de(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),de(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),de(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),de(i,"touchstart",function(){return n.forceCompositionEnd()}),de(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||Fe(r,l))){if(r.somethingSelected())fi({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=ol(r);fi({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,ft),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=Ft.text.join(`
`);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var d=al(),p=d.firstChild;oo(p),r.display.lineSpace.insertBefore(d,r.display.lineSpace.firstChild),p.value=Ft.text.join(`
`);var x=ve(ze(i));rt(p),setTimeout(function(){r.display.lineSpace.removeChild(d),x.focus(),x==i&&n.showPrimarySelection()},50)}}de(i,"copy",a),de(i,"cut",a)},Ae.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ae.prototype.prepareSelection=function(){var e=Jo(this.cm,!1);return e.focus=ve(ze(this.div))==this.div,e},Ae.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ae.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ae.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=ci(t,e.anchorNode,e.anchorOffset),a=ci(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&a&&!a.bad&&ie(Wr(o,a),r)==0&&ie(ht(o,a),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&sl(t,r)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&sl(t,i);if(!u){var d=l[l.length-1].measure,p=d.maps?d.maps[d.maps.length-1]:d.map;u={node:p[p.length-1],offset:p[p.length-2]-p[p.length-3]}}if(!s||!u){e.removeAllRanges();return}var x=e.rangeCount&&e.getRangeAt(0),b;try{b=I(s.node,s.offset,u.offset,u.node)}catch(N){}b&&(!re&&t.state.focused?(e.collapse(s.node,s.offset),b.collapsed||(e.removeAllRanges(),e.addRange(b))):(e.removeAllRanges(),e.addRange(b)),x&&e.anchorNode==null?e.addRange(x):re&&this.startGracePeriod()),this.rememberSelection()}},Ae.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Ae.prototype.showMultipleSelections=function(e){j(this.cm.display.cursorDiv,e.cursors),j(this.cm.display.selectionDiv,e.selection)},Ae.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ae.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return le(this.div,t)},Ae.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||ve(ze(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ae.prototype.blur=function(){this.div.blur()},Ae.prototype.getField=function(){return this.div},Ae.prototype.supportsTouch=function(){return!0},Ae.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):xt(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Ae.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ae.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(k&&v&&this.cm.display.gutterSpecs.length&&ru(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=ci(t,e.anchorNode,e.anchorOffset),r=ci(t,e.focusNode,e.focusOffset);n&&r&&xt(t,function(){at(t.doc,fr(n,r),ft),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Ae.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=A(r.line-1,ue(e.doc,r.line-1).length)),i.ch==ue(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=A(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;r.line==t.viewFrom||(o=wr(e,r.line))==0?(a=f(t.view[0].line),l=t.view[0].node):(a=f(t.view[o].line),l=t.view[o-1].node.nextSibling);var s=wr(e,i.line),u,d;if(s==t.view.length-1?(u=t.viewTo-1,d=t.lineDiv.lastChild):(u=f(t.view[s+1].line)-1,d=t.view[s+1].node.previousSibling),!l)return!1;for(var p=e.doc.splitLines(nu(e,l,d,a,u)),x=Xt(e.doc,A(a,0),A(u,ue(e.doc,u).text.length));p.length>1&&x.length>1;)if(Ce(p)==Ce(x))p.pop(),x.pop(),u--;else if(p[0]==x[0])p.shift(),x.shift(),a++;else break;for(var b=0,N=0,F=p[0],Z=x[0],ee=Math.min(F.length,Z.length);b<ee&&F.charCodeAt(b)==Z.charCodeAt(b);)++b;for(var ae=Ce(p),te=Ce(x),se=Math.min(ae.length-(p.length==1?b:0),te.length-(x.length==1?b:0));N<se&&ae.charCodeAt(ae.length-N-1)==te.charCodeAt(te.length-N-1);)++N;if(p.length==1&&x.length==1&&a==r.line)for(;b&&b>r.ch&&ae.charCodeAt(ae.length-N-1)==te.charCodeAt(te.length-N-1);)b--,N++;p[p.length-1]=ae.slice(0,ae.length-N).replace(/^\u200b+/,""),p[0]=p[0].slice(b).replace(/\u200b+$/,"");var he=A(a,b),ce=A(u,x.length?Ce(x).length-N:0);if(p.length>1||p[0]||ie(he,ce))return Xr(e.doc,p,he,ce,"+input"),!0},Ae.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ae.prototype.reset=function(){this.forceCompositionEnd()},Ae.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ae.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},Ae.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&xt(this.cm,function(){return pt(e.cm)})},Ae.prototype.setUneditable=function(e){e.contentEditable="false"},Ae.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Qe(this.cm,io)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Ae.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ae.prototype.onContextMenu=function(){},Ae.prototype.resetPosition=function(){},Ae.prototype.needsContentAttribute=!0;function sl(e,t){var n=Ti(e,t.line);if(!n||n.hidden)return null;var r=ue(e.doc,t.line),i=Fo(n,r,t.line),o=ke(r,e.doc.direction),a="left";if(o){var l=rr(o,t.ch);a=l%2?"right":"left"}var s=Ro(i.map,t.ch,a);return s.offset=s.collapse=="right"?s.end:s.start,s}function ru(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Vr(e,t){return t&&(e.bad=!0),e}function nu(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function u(b){return function(N){return N.id==b}}function d(){a&&(o+=l,s&&(o+=l),a=s=!1)}function p(b){b&&(d(),o+=b)}function x(b){if(b.nodeType==1){var N=b.getAttribute("cm-text");if(N){p(N);return}var F=b.getAttribute("cm-marker"),Z;if(F){var ee=e.findMarks(A(r,0),A(i+1,0),u(+F));ee.length&&(Z=ee[0].find(0))&&p(Xt(e.doc,Z.from,Z.to).join(l));return}if(b.getAttribute("contenteditable")=="false")return;var ae=/^(pre|div|p|li|table|br)$/i.test(b.nodeName);if(!/^br$/i.test(b.nodeName)&&b.textContent.length==0)return;ae&&d();for(var te=0;te<b.childNodes.length;te++)x(b.childNodes[te]);/^(pre|p)$/i.test(b.nodeName)&&(s=!0),ae&&(a=!0)}else b.nodeType==3&&p(b.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;x(t),t!=n;)t=t.nextSibling,s=!1;return o}function ci(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Vr(e.clipPos(A(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return iu(o,t,n)}}function iu(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!le(r,t))return Vr(A(f(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?Ce(e.rest):e.line;return Vr(A(f(o),o.text.length),i)}var a=t.nodeType==3?t:null,l=t;for(!a&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(a=t.firstChild,n&&(n=a.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,u=s.maps;function d(Z,ee,ae){for(var te=-1;te<(u?u.length:0);te++)for(var se=te<0?s.map:u[te],he=0;he<se.length;he+=3){var ce=se[he+2];if(ce==Z||ce==ee){var we=f(te<0?e.line:e.rest[te]),De=se[he]+ae;return(ae<0||ce!=Z)&&(De=se[he+(ae?1:0)]),A(we,De)}}}var p=d(a,l,n);if(p)return Vr(p,i);for(var x=l.nextSibling,b=a?a.nodeValue.length-n:0;x;x=x.nextSibling){if(p=d(x,x.firstChild,0),p)return Vr(A(p.line,p.ch-b),i);b+=x.textContent.length}for(var N=l.previousSibling,F=n;N;N=N.previousSibling){if(p=d(N,N.firstChild,-1),p)return Vr(A(p.line,p.ch+F),i);F+=N.textContent.length}}var Re=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new be,this.hasSelection=!1,this.composing=null,this.resetting=!1};Re.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),O&&(i.style.width="0px"),de(i,"input",function(){R&&W>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),de(i,"paste",function(a){Fe(r,a)||nl(a,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(a){if(!Fe(r,a)){if(r.somethingSelected())fi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=ol(r);fi({lineWise:!0,text:l.text}),a.type=="cut"?r.setSelections(l.ranges,null,ft):(n.prevInput="",i.value=l.text.join(`
`),rt(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}de(i,"cut",o),de(i,"copy",o),de(e.scroller,"paste",function(a){if(!(Qt(e,a)||Fe(r,a))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var l=new Event("paste");l.clipboardData=a.clipboardData,i.dispatchEvent(l)}}),de(e.lineSpace,"selectstart",function(a){Qt(e,a)||ot(a)}),de(i,"compositionstart",function(){var a=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:a,range:r.markText(a,r.getCursor("to"),{className:"CodeMirror-composing"})}}),de(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Re.prototype.createField=function(e){this.wrapper=al(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;oo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Re.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Re.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Jo(e);if(e.options.moveInputWithCursor){var i=Wt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Re.prototype.showSelection=function(e){var t=this.cm,n=t.display;j(n.cursorDiv,e.cursors),j(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Re.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&rt(this.textarea),R&&W>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",R&&W>=9&&(this.hasSelection=null));this.resetting=!1}},Re.prototype.getField=function(){return this.textarea},Re.prototype.supportsTouch=function(){return!1},Re.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!M||ve(ze(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},Re.prototype.blur=function(){this.textarea.blur()},Re.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Re.prototype.receivedFocus=function(){this.slowPoll()},Re.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Re.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Re.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||or(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(R&&W>=9&&this.hasSelection===i||E&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(r.length,i.length);a<l&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return xt(t,function(){io(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Re.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Re.prototype.onKeyPress=function(){R&&W>=9&&(this.hasSelection=null),this.fastPoll()},Re.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=xr(n,e),a=r.scroller.scrollTop;if(!o||T)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&Qe(n,at)(n.doc,fr(o),ft);var s=i.style.cssText,u=t.wrapper.style.cssText,d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+`px;
z-index: 1000; background: `+(R?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var p;y&&(p=i.ownerDocument.defaultView.scrollY),r.input.focus(),y&&i.ownerDocument.defaultView.scrollTo(null,p),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=b,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function x(){if(i.selectionStart!=null){var F=n.somethingSelected(),Z="\u200B"+(F?i.value:"");i.value="\u21DA",i.value=Z,t.prevInput=F?"":"\u200B",i.selectionStart=1,i.selectionEnd=Z.length,r.selForContextMenu=n.doc.sel}}function b(){if(t.contextMenuPending==b&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,R&&W<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!R||R&&W<9)&&x();var F=0,Z=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?Qe(n,Ma)(n):F++<10?r.detectingSelectAll=setTimeout(Z,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Z,200)}}if(R&&W>=9&&x(),U){nr(e);var N=function(){it(window,"mouseup",N),setTimeout(b,20)};de(window,"mouseup",N)}else setTimeout(b,50)},Re.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Re.prototype.setUneditable=function(){},Re.prototype.needsContentAttribute=!1;function ou(e,t){if(t=t?xe(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=ve(ze(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(de(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(s){}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(it(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=Ee(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function au(e){e.off=it,e.on=de,e.wheelEventPixels=hs,e.Doc=gt,e.splitLines=Mt,e.countColumn=Se,e.findColumn=Ke,e.isWordChar=nt,e.Pass=Ot,e.signal=He,e.Line=Hr,e.changeEnd=cr,e.scrollbarModel=na,e.Pos=A,e.cmpPos=ie,e.modes=Nr,e.mimeModes=Pt,e.resolveMode=Dr,e.getMode=Pr,e.modeExtensions=ar,e.extendMode=zr,e.copyState=Bt,e.startState=Er,e.innerMode=nn,e.commands=On,e.keyMap=Vt,e.keyName=Ua,e.isModifierKey=Ka,e.lookupKey=Zr,e.normalizeKeyMap=Ws,e.StringStream=Ie,e.SharedTextMarker=Ln,e.TextMarker=hr,e.LineWidget=Sn,e.e_preventDefault=ot,e.e_stopPropagation=Or,e.e_stop=nr,e.addClass=me,e.contains=le,e.rmClass=Q,e.keyNames=pr}Js(Ee),tu(Ee);var lu="iter insert remove copy getEditor constructor".split(" ");for(var di in gt.prototype)gt.prototype.hasOwnProperty(di)&&fe(lu,di)<0&&(Ee.prototype[di]=(function(e){return function(){return e.apply(this.doc,arguments)}})(gt.prototype[di]));return At(gt),Ee.inputStyles={textarea:Re,contenteditable:Ae},Ee.defineMode=function(e){!Ee.defaults.mode&&e!="null"&&(Ee.defaults.mode=e),zt.apply(this,arguments)},Ee.defineMIME=mr,Ee.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ee.defineMIME("text/plain","null"),Ee.defineExtension=function(e,t){Ee.prototype[e]=t},Ee.defineDocExtension=function(e,t){gt.prototype[e]=t},Ee.fromTextArea=ou,au(Ee),Ee.version="5.65.21",Ee})),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],m):m(CodeMirror)})(function(m){"use strict";m.overlayMode=function(oe,re,$){return{startState:function(){return{base:m.startState(oe),overlay:m.startState(re),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(ne){return{base:m.copyState(oe,ne.base),overlay:m.copyState(re,ne.overlay),basePos:ne.basePos,baseCur:null,overlayPos:ne.overlayPos,overlayCur:null}},token:function(ne,_){return(ne!=_.streamSeen||Math.min(_.basePos,_.overlayPos)<ne.start)&&(_.streamSeen=ne,_.basePos=_.overlayPos=ne.start),ne.start==_.basePos&&(_.baseCur=oe.token(ne,_.base),_.basePos=ne.pos),ne.start==_.overlayPos&&(ne.pos=ne.start,_.overlayCur=re.token(ne,_.overlay),_.overlayPos=ne.pos),ne.pos=Math.min(_.basePos,_.overlayPos),_.overlayCur==null?_.baseCur:_.baseCur!=null&&_.overlay.combineTokens||$&&_.overlay.combineTokens==null?_.baseCur+" "+_.overlayCur:_.overlayCur},indent:oe.indent&&function(ne,_,R){return oe.indent(ne.base,_,R)},electricChars:oe.electricChars,innerMode:function(ne){return{state:ne.base,mode:oe}},blankLine:function(ne){var _,R;return oe.blankLine&&(_=oe.blankLine(ne.base)),re.blankLine&&(R=re.blankLine(ne.overlay)),R==null?_:$&&_!=null?_+" "+R:R}}}}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],m):m(CodeMirror)})(function(m){"use strict";var oe={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},re={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};m.defineMode("xml",function($,ne){var _=$.indentUnit,R={},W=ne.htmlMode?oe:re;for(var y in W)R[y]=W[y];for(var y in ne)R[y]=ne[y];var L,v;function C(c,G){function I(me){return G.tokenize=me,me(c,G)}var le=c.next();if(le=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?I(Y("atom","]]>")):null:c.match("--")?I(Y("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),I(K(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),G.tokenize=Y("meta","?>"),"meta"):(L=c.eat("/")?"closeTag":"openTag",G.tokenize=T,"tag bracket");if(le=="&"){var ve;return c.eat("#")?c.eat("x")?ve=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):ve=c.eatWhile(/[\d]/)&&c.eat(";"):ve=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),ve?"atom":"error"}else return c.eatWhile(/[^&<]/),null}C.isInText=!0;function T(c,G){var I=c.next();if(I==">"||I=="/"&&c.eat(">"))return G.tokenize=C,L=I==">"?"endTag":"selfcloseTag","tag bracket";if(I=="=")return L="equals",null;if(I=="<"){G.tokenize=C,G.state=B,G.tagName=G.tagStart=null;var le=G.tokenize(c,G);return le?le+" tag error":"tag error"}else return/[\'\"]/.test(I)?(G.tokenize=V(I),G.stringStartCol=c.column(),G.tokenize(c,G)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function V(c){var G=function(I,le){for(;!I.eol();)if(I.next()==c){le.tokenize=T;break}return"string"};return G.isInAttribute=!0,G}function Y(c,G){return function(I,le){for(;!I.eol();){if(I.match(G)){le.tokenize=C;break}I.next()}return c}}function K(c){return function(G,I){for(var le;(le=G.next())!=null;){if(le=="<")return I.tokenize=K(c+1),I.tokenize(G,I);if(le==">")if(c==1){I.tokenize=C;break}else return I.tokenize=K(c-1),I.tokenize(G,I)}return"meta"}}function O(c){return c&&c.toLowerCase()}function k(c,G,I){this.prev=c.context,this.tagName=G||"",this.indent=c.indented,this.startOfLine=I,(R.doNotIndent.hasOwnProperty(G)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function M(c){c.context&&(c.context=c.context.prev)}function E(c,G){for(var I;;){if(!c.context||(I=c.context.tagName,!R.contextGrabbers.hasOwnProperty(O(I))||!R.contextGrabbers[O(I)].hasOwnProperty(O(G))))return;M(c)}}function B(c,G,I){return c=="openTag"?(I.tagStart=G.column(),q):c=="closeTag"?g:B}function q(c,G,I){return c=="word"?(I.tagName=G.current(),v="tag",H):R.allowMissingTagName&&c=="endTag"?(v="tag bracket",H(c,G,I)):(v="error",q)}function g(c,G,I){if(c=="word"){var le=G.current();return I.context&&I.context.tagName!=le&&R.implicitlyClosed.hasOwnProperty(O(I.context.tagName))&&M(I),I.context&&I.context.tagName==le||R.matchClosing===!1?(v="tag",P):(v="tag error",U)}else return R.allowMissingTagName&&c=="endTag"?(v="tag bracket",P(c,G,I)):(v="error",U)}function P(c,G,I){return c!="endTag"?(v="error",P):(M(I),B)}function U(c,G,I){return v="error",P(c,G,I)}function H(c,G,I){if(c=="word")return v="attribute",Q;if(c=="endTag"||c=="selfcloseTag"){var le=I.tagName,ve=I.tagStart;return I.tagName=I.tagStart=null,c=="selfcloseTag"||R.autoSelfClosers.hasOwnProperty(O(le))?E(I,le):(E(I,le),I.context=new k(I,le,ve==I.indented)),B}return v="error",H}function Q(c,G,I){return c=="equals"?w:(R.allowMissing||(v="error"),H(c,G,I))}function w(c,G,I){return c=="string"?j:c=="word"&&R.allowUnquoted?(v="string",H):(v="error",H(c,G,I))}function j(c,G,I){return c=="string"?j:H(c,G,I)}return{startState:function(c){var G={tokenize:C,state:B,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(G.baseIndent=c),G},token:function(c,G){if(!G.tagName&&c.sol()&&(G.indented=c.indentation()),c.eatSpace())return null;L=null;var I=G.tokenize(c,G);return(I||L)&&I!="comment"&&(v=null,G.state=G.state(L||I,c,G),v&&(I=v=="error"?I+" error":v)),I},indent:function(c,G,I){var le=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+_;if(le&&le.noIndent)return m.Pass;if(c.tokenize!=T&&c.tokenize!=C)return I?I.match(/^(\s*)/)[0].length:0;if(c.tagName)return R.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+_*(R.multilineTagIndentFactor||1);if(R.alignCDATA&&/<!\[CDATA\[/.test(G))return 0;var ve=G&&/^<(\/)?([\w_:\.-]*)/.exec(G);if(ve&&ve[1])for(;le;)if(le.tagName==ve[2]){le=le.prev;break}else if(R.implicitlyClosed.hasOwnProperty(O(le.tagName)))le=le.prev;else break;else if(ve)for(;le;){var me=R.contextGrabbers[O(le.tagName)];if(me&&me.hasOwnProperty(O(ve[2])))le=le.prev;else break}for(;le&&le.prev&&!le.startOfLine;)le=le.prev;return le?le.indent+_:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:R.htmlMode?"html":"xml",helperType:R.htmlMode?"html":"xml",skipAttribute:function(c){c.state==w&&(c.state=H)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var G=[],I=c.context;I;I=I.prev)G.push(I.tagName);return G.reverse()}}}),m.defineMIME("text/xml","xml"),m.defineMIME("application/xml","xml"),m.mimeModes.hasOwnProperty("text/html")||m.defineMIME("text/html",{name:"xml",htmlMode:!0})}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],m):m(CodeMirror)})(function(m){"use strict";m.defineMode("javascript",function(oe,re){var $=oe.indentUnit,ne=re.statementIndent,_=re.jsonld,R=re.json||_,W=re.trackScope!==!1,y=re.typescript,L=re.wordCharacters||/[\w$\xa1-\uffff]/,v=(function(){function f(Ye){return{type:Ye,style:"keyword"}}var h=f("keyword a"),z=f("keyword b"),X=f("keyword c"),A=f("keyword d"),ie=f("operator"),Me={type:"atom",style:"atom"};return{if:f("if"),while:h,with:h,else:z,do:z,try:z,finally:z,return:A,break:A,continue:A,new:f("new"),delete:X,void:X,throw:X,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:ie,typeof:ie,instanceof:ie,true:Me,false:Me,null:Me,undefined:Me,NaN:Me,Infinity:Me,this:f("this"),class:f("class"),super:f("atom"),yield:X,export:f("export"),import:f("import"),extends:X,await:X}})(),C=/[+\-*&%=<>!?|~^@]/,T=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function V(f){for(var h=!1,z,X=!1;(z=f.next())!=null;){if(!h){if(z=="/"&&!X)return;z=="["?X=!0:X&&z=="]"&&(X=!1)}h=!h&&z=="\\"}}var Y,K;function O(f,h,z){return Y=f,K=z,h}function k(f,h){var z=f.next();if(z=='"'||z=="'")return h.tokenize=M(z),h.tokenize(f,h);if(z=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return O("number","number");if(z=="."&&f.match(".."))return O("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(z))return O(z);if(z=="="&&f.eat(">"))return O("=>","operator");if(z=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return O("number","number");if(/\d/.test(z))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),O("number","number");if(z=="/")return f.eat("*")?(h.tokenize=E,E(f,h)):f.eat("/")?(f.skipToEnd(),O("comment","comment")):St(f,h,1)?(V(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),O("regexp","string-2")):(f.eat("="),O("operator","operator",f.current()));if(z=="`")return h.tokenize=B,B(f,h);if(z=="#"&&f.peek()=="!")return f.skipToEnd(),O("meta","meta");if(z=="#"&&f.eatWhile(L))return O("variable","property");if(z=="<"&&f.match("!--")||z=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),O("comment","comment");if(C.test(z))return(z!=">"||!h.lexical||h.lexical.type!=">")&&(f.eat("=")?(z=="!"||z=="=")&&f.eat("="):/[<>*+\-|&?]/.test(z)&&(f.eat(z),z==">"&&f.eat(z))),z=="?"&&f.eat(".")?O("."):O("operator","operator",f.current());if(L.test(z)){f.eatWhile(L);var X=f.current();if(h.lastType!="."){if(v.propertyIsEnumerable(X)){var A=v[X];return O(A.type,A.style,X)}if(X=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return O("async","keyword",X)}return O("variable","variable",X)}}function M(f){return function(h,z){var X=!1,A;if(_&&h.peek()=="@"&&h.match(T))return z.tokenize=k,O("jsonld-keyword","meta");for(;(A=h.next())!=null&&!(A==f&&!X);)X=!X&&A=="\\";return X||(z.tokenize=k),O("string","string")}}function E(f,h){for(var z=!1,X;X=f.next();){if(X=="/"&&z){h.tokenize=k;break}z=X=="*"}return O("comment","comment")}function B(f,h){for(var z=!1,X;(X=f.next())!=null;){if(!z&&(X=="`"||X=="$"&&f.eat("{"))){h.tokenize=k;break}z=!z&&X=="\\"}return O("quasi","string-2",f.current())}var q="([{}])";function g(f,h){h.fatArrowAt&&(h.fatArrowAt=null);var z=f.string.indexOf("=>",f.start);if(!(z<0)){if(y){var X=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,z));X&&(z=X.index)}for(var A=0,ie=!1,Me=z-1;Me>=0;--Me){var Ye=f.string.charAt(Me),ht=q.indexOf(Ye);if(ht>=0&&ht<3){if(!A){++Me;break}if(--A==0){Ye=="("&&(ie=!0);break}}else if(ht>=3&&ht<6)++A;else if(L.test(Ye))ie=!0;else if(/["'\/`]/.test(Ye))for(;;--Me){if(Me==0)return;var Wr=f.string.charAt(Me-1);if(Wr==Ye&&f.string.charAt(Me-2)!="\\"){Me--;break}}else if(ie&&!A){++Me;break}}ie&&!A&&(h.fatArrowAt=Me)}}var P={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function U(f,h,z,X,A,ie){this.indented=f,this.column=h,this.type=z,this.prev=A,this.info=ie,X!=null&&(this.align=X)}function H(f,h){if(!W)return!1;for(var z=f.localVars;z;z=z.next)if(z.name==h)return!0;for(var X=f.context;X;X=X.prev)for(var z=X.vars;z;z=z.next)if(z.name==h)return!0}function Q(f,h,z,X,A){var ie=f.cc;for(w.state=f,w.stream=A,w.marked=null,w.cc=ie,w.style=h,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var Me=ie.length?ie.pop():R?fe:Se;if(Me(z,X)){for(;ie.length&&ie[ie.length-1].lex;)ie.pop()();return w.marked?w.marked:z=="variable"&&H(f,X)?"variable-2":h}}}var w={state:null,column:null,marked:null,cc:null};function j(){for(var f=arguments.length-1;f>=0;f--)w.cc.push(arguments[f])}function c(){return j.apply(null,arguments),!0}function G(f,h){for(var z=h;z;z=z.next)if(z.name==f)return!0;return!1}function I(f){var h=w.state;if(w.marked="def",!!W){if(h.context){if(h.lexical.info=="var"&&h.context&&h.context.block){var z=le(f,h.context);if(z!=null){h.context=z;return}}else if(!G(f,h.localVars)){h.localVars=new je(f,h.localVars);return}}re.globalVars&&!G(f,h.globalVars)&&(h.globalVars=new je(f,h.globalVars))}}function le(f,h){if(h)if(h.block){var z=le(f,h.prev);return z?z==h.prev?h:new me(z,h.vars,!0):null}else return G(f,h.vars)?h:new me(h.prev,new je(f,h.vars),!1);else return null}function ve(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function me(f,h,z){this.prev=f,this.vars=h,this.block=z}function je(f,h){this.name=f,this.next=h}var rt=new je("this",new je("arguments",null));function Pe(){w.state.context=new me(w.state.context,w.state.localVars,!1),w.state.localVars=rt}function Xe(){w.state.context=new me(w.state.context,w.state.localVars,!0),w.state.localVars=null}Pe.lex=Xe.lex=!0;function ze(){w.state.localVars=w.state.context.vars,w.state.context=w.state.context.prev}ze.lex=!0;function ge(f,h){var z=function(){var X=w.state,A=X.indented;if(X.lexical.type=="stat")A=X.lexical.indented;else for(var ie=X.lexical;ie&&ie.type==")"&&ie.align;ie=ie.prev)A=ie.indented;X.lexical=new U(A,w.stream.column(),f,null,X.lexical,h)};return z.lex=!0,z}function pe(){var f=w.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}pe.lex=!0;function xe(f){function h(z){return z==f?c():f==";"||z=="}"||z==")"||z=="]"?j():c(h)}return h}function Se(f,h){return f=="var"?c(ge("vardef",h),Or,xe(";"),pe):f=="keyword a"?c(ge("form"),Ot,Se,pe):f=="keyword b"?c(ge("form"),Se,pe):f=="keyword d"?w.stream.match(/^\s*$/,!1)?c():c(ge("stat"),kt,xe(";"),pe):f=="debugger"?c(xe(";")):f=="{"?c(ge("}"),Xe,It,pe,ze):f==";"?c():f=="if"?(w.state.lexical.info=="else"&&w.state.cc[w.state.cc.length-1]==pe&&w.state.cc.pop()(),c(ge("form"),Ot,Se,pe,Ar)):f=="function"?c(Mt):f=="for"?c(ge("form"),Xe,Wn,Se,ze,pe):f=="class"||y&&h=="interface"?(w.marked="keyword",c(ge("form",f=="class"?f:h),Nr,pe)):f=="variable"?y&&h=="declare"?(w.marked="keyword",c(Se)):y&&(h=="module"||h=="enum"||h=="type")&&w.stream.match(/^\s*\w/,!1)?(w.marked="keyword",h=="enum"?c(ue):h=="type"?c(Hn,xe("operator"),ke,xe(";")):c(ge("form"),dt,xe("{"),ge("}"),It,pe,pe)):y&&h=="namespace"?(w.marked="keyword",c(ge("form"),fe,Se,pe)):y&&h=="abstract"?(w.marked="keyword",c(Se)):c(ge("stat"),Le):f=="switch"?c(ge("form"),Ot,xe("{"),ge("}","switch"),Xe,It,pe,pe,ze):f=="case"?c(fe,xe(":")):f=="default"?c(xe(":")):f=="catch"?c(ge("form"),Pe,be,Se,pe,ze):f=="export"?c(ge("stat"),Dr,pe):f=="import"?c(ge("stat"),ar,pe):f=="async"?c(Se):h=="@"?c(fe,Se):j(ge("stat"),fe,xe(";"),pe)}function be(f){if(f=="(")return c(Dt,xe(")"))}function fe(f,h){return ft(f,h,!1)}function et(f,h){return ft(f,h,!0)}function Ot(f){return f!="("?j():c(ge(")"),kt,xe(")"),pe)}function ft(f,h,z){if(w.state.fatArrowAt==w.stream.start){var X=z?Ne:Ce;if(f=="(")return c(Pe,ge(")"),_e(Dt,")"),pe,xe("=>"),X,ze);if(f=="variable")return j(Pe,dt,xe("=>"),X,ze)}var A=z?Ke:Te;return P.hasOwnProperty(f)?c(A):f=="function"?c(Mt,A):f=="class"||y&&h=="interface"?(w.marked="keyword",c(ge("form"),gi,pe)):f=="keyword c"||f=="async"?c(z?et:fe):f=="("?c(ge(")"),kt,xe(")"),pe,A):f=="operator"||f=="spread"?c(z?et:fe):f=="["?c(ge("]"),Ie,pe,A):f=="{"?er(Gt,"}",null,A):f=="quasi"?j(ct,A):f=="new"?c(S(z)):c()}function kt(f){return f.match(/[;\}\)\],]/)?j():j(fe)}function Te(f,h){return f==","?c(kt):Ke(f,h,!1)}function Ke(f,h,z){var X=z==!1?Te:Ke,A=z==!1?fe:et;if(f=="=>")return c(Pe,z?Ne:Ce,ze);if(f=="operator")return/\+\+|--/.test(h)||y&&h=="!"?c(X):y&&h=="<"&&w.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(ge(">"),_e(ke,">"),pe,X):h=="?"?c(fe,xe(":"),A):c(A);if(f=="quasi")return j(ct,X);if(f!=";"){if(f=="(")return er(et,")","call",X);if(f==".")return c(nt,X);if(f=="[")return c(ge("]"),kt,xe("]"),pe,X);if(y&&h=="as")return w.marked="keyword",c(ke,X);if(f=="regexp")return w.state.lastType=w.marked="operator",w.stream.backUp(w.stream.pos-w.stream.start-1),c(A)}}function ct(f,h){return f!="quasi"?j():h.slice(h.length-2)!="${"?c(ct):c(kt,Ct)}function Ct(f){if(f=="}")return w.marked="string-2",w.state.tokenize=B,c(ct)}function Ce(f){return g(w.stream,w.state),j(f=="{"?Se:fe)}function Ne(f){return g(w.stream,w.state),j(f=="{"?Se:et)}function S(f){return function(h){return h=="."?c(f?D:J):h=="variable"&&y?c(bt,f?Ke:Te):j(f?et:fe)}}function J(f,h){if(h=="target")return w.marked="keyword",c(Te)}function D(f,h){if(h=="target")return w.marked="keyword",c(Ke)}function Le(f){return f==":"?c(pe,Se):j(Te,xe(";"),pe)}function nt(f){if(f=="variable")return w.marked="property",c()}function Gt(f,h){if(f=="async")return w.marked="property",c(Gt);if(f=="variable"||w.style=="keyword"){if(w.marked="property",h=="get"||h=="set")return c(zn);var z;return y&&w.state.fatArrowAt==w.stream.start&&(z=w.stream.match(/^\s*:\s*/,!1))&&(w.state.fatArrowAt=w.stream.pos+z[0].length),c(jt)}else{if(f=="number"||f=="string")return w.marked=_?"property":w.style+" property",c(jt);if(f=="jsonld-keyword")return c(jt);if(y&&ve(h))return w.marked="keyword",c(Gt);if(f=="[")return c(fe,tr,xe("]"),jt);if(f=="spread")return c(et,jt);if(h=="*")return w.marked="keyword",c(Gt);if(f==":")return j(jt)}}function zn(f){return f!="variable"?j(jt):(w.marked="property",c(Mt))}function jt(f){if(f==":")return c(et);if(f=="(")return j(Mt)}function _e(f,h,z){function X(A,ie){if(z?z.indexOf(A)>-1:A==","){var Me=w.state.lexical;return Me.info=="call"&&(Me.pos=(Me.pos||0)+1),c(function(Ye,ht){return Ye==h||ht==h?j():j(f)},X)}return A==h||ie==h?c():z&&z.indexOf(";")>-1?j(f):c(xe(h))}return function(A,ie){return A==h||ie==h?c():j(f,X)}}function er(f,h,z){for(var X=3;X<arguments.length;X++)w.cc.push(arguments[X]);return c(ge(h,z),_e(f,h),pe)}function It(f){return f=="}"?c():j(Se,It)}function tr(f,h){if(y){if(f==":")return c(ke);if(h=="?")return c(tr)}}function vr(f,h){if(y&&(f==":"||h=="in"))return c(ke)}function rr(f){if(y&&f==":")return w.stream.match(/^\s*\w+\s+is\b/,!1)?c(fe,hi,ke):c(ke)}function hi(f,h){if(h=="is")return w.marked="keyword",c()}function ke(f,h){if(h=="keyof"||h=="typeof"||h=="infer"||h=="readonly")return w.marked="keyword",c(h=="typeof"?et:ke);if(f=="variable"||h=="void")return w.marked="type",c(Tt);if(h=="|"||h=="&")return c(ke);if(f=="string"||f=="number"||f=="atom")return c(Tt);if(f=="[")return c(ge("]"),_e(ke,"]",","),pe,Tt);if(f=="{")return c(ge("}"),de,pe,Tt);if(f=="(")return c(_e(Fe,")"),En,Tt);if(f=="<")return c(_e(ke,">"),ke);if(f=="quasi")return j(it,Tt)}function En(f){if(f=="=>")return c(ke)}function de(f){return f.match(/[\}\)\]]/)?c():f==","||f==";"?c(de):j(qt,de)}function qt(f,h){if(f=="variable"||w.style=="keyword")return w.marked="property",c(qt);if(h=="?"||f=="number"||f=="string")return c(qt);if(f==":")return c(ke);if(f=="[")return c(xe("variable"),vr,xe("]"),qt);if(f=="(")return j(or,qt);if(!f.match(/[;\}\)\],]/))return c()}function it(f,h){return f!="quasi"?j():h.slice(h.length-2)!="${"?c(it):c(ke,He)}function He(f){if(f=="}")return w.marked="string-2",w.state.tokenize=B,c(it)}function Fe(f,h){return f=="variable"&&w.stream.match(/^\s*[?:]/,!1)||h=="?"?c(Fe):f==":"?c(ke):f=="spread"?c(Fe):j(ke)}function Tt(f,h){if(h=="<")return c(ge(">"),_e(ke,">"),pe,Tt);if(h=="|"||f=="."||h=="&")return c(ke);if(f=="[")return c(ke,xe("]"),Tt);if(h=="extends"||h=="implements")return w.marked="keyword",c(ke);if(h=="?")return c(ke,xe(":"),ke)}function bt(f,h){if(h=="<")return c(ge(">"),_e(ke,">"),pe,Tt)}function At(){return j(ke,ot)}function ot(f,h){if(h=="=")return c(ke)}function Or(f,h){return h=="enum"?(w.marked="keyword",c(ue)):j(dt,tr,Nt,pi)}function dt(f,h){if(y&&ve(h))return w.marked="keyword",c(dt);if(f=="variable")return I(h),c();if(f=="spread")return c(dt);if(f=="[")return er(tn,"]");if(f=="{")return er(nr,"}")}function nr(f,h){return f=="variable"&&!w.stream.match(/^\s*:/,!1)?(I(h),c(Nt)):(f=="variable"&&(w.marked="property"),f=="spread"?c(dt):f=="}"?j():f=="["?c(fe,xe("]"),xe(":"),nr):c(xe(":"),dt,Nt))}function tn(){return j(dt,Nt)}function Nt(f,h){if(h=="=")return c(et)}function pi(f){if(f==",")return c(Or)}function Ar(f,h){if(f=="keyword b"&&h=="else")return c(ge("form","else"),Se,pe)}function Wn(f,h){if(h=="await")return c(Wn);if(f=="(")return c(ge(")"),rn,pe)}function rn(f){return f=="var"?c(Or,ir):f=="variable"?c(ir):j(ir)}function ir(f,h){return f==")"?c():f==";"?c(ir):h=="in"||h=="of"?(w.marked="keyword",c(fe,ir)):j(fe,ir)}function Mt(f,h){if(h=="*")return w.marked="keyword",c(Mt);if(f=="variable")return I(h),c(Mt);if(f=="(")return c(Pe,ge(")"),_e(Dt,")"),pe,rr,Se,ze);if(y&&h=="<")return c(ge(">"),_e(At,">"),pe,Mt)}function or(f,h){if(h=="*")return w.marked="keyword",c(or);if(f=="variable")return I(h),c(or);if(f=="(")return c(Pe,ge(")"),_e(Dt,")"),pe,rr,ze);if(y&&h=="<")return c(ge(">"),_e(At,">"),pe,or)}function Hn(f,h){if(f=="keyword"||f=="variable")return w.marked="type",c(Hn);if(h=="<")return c(ge(">"),_e(At,">"),pe)}function Dt(f,h){return h=="@"&&c(fe,Dt),f=="spread"?c(Dt):y&&ve(h)?(w.marked="keyword",c(Dt)):y&&f=="this"?c(tr,Nt):j(dt,tr,Nt)}function gi(f,h){return f=="variable"?Nr(f,h):Pt(f,h)}function Nr(f,h){if(f=="variable")return I(h),c(Pt)}function Pt(f,h){if(h=="<")return c(ge(">"),_e(At,">"),pe,Pt);if(h=="extends"||h=="implements"||y&&f==",")return h=="implements"&&(w.marked="keyword"),c(y?ke:fe,Pt);if(f=="{")return c(ge("}"),zt,pe)}function zt(f,h){if(f=="async"||f=="variable"&&(h=="static"||h=="get"||h=="set"||y&&ve(h))&&w.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return w.marked="keyword",c(zt);if(f=="variable"||w.style=="keyword")return w.marked="property",c(mr,zt);if(f=="number"||f=="string")return c(mr,zt);if(f=="[")return c(fe,tr,xe("]"),mr,zt);if(h=="*")return w.marked="keyword",c(zt);if(y&&f=="(")return j(or,zt);if(f==";"||f==",")return c(zt);if(f=="}")return c();if(h=="@")return c(fe,zt)}function mr(f,h){if(h=="!"||h=="?")return c(mr);if(f==":")return c(ke,Nt);if(h=="=")return c(et);var z=w.state.lexical.prev,X=z&&z.info=="interface";return j(X?or:Mt)}function Dr(f,h){return h=="*"?(w.marked="keyword",c(Er,xe(";"))):h=="default"?(w.marked="keyword",c(fe,xe(";"))):f=="{"?c(_e(Pr,"}"),Er,xe(";")):j(Se)}function Pr(f,h){if(h=="as")return w.marked="keyword",c(xe("variable"));if(f=="variable")return j(et,Pr)}function ar(f){return f=="string"?c():f=="("?j(fe):f=="."?j(Te):j(zr,Bt,Er)}function zr(f,h){return f=="{"?er(zr,"}"):(f=="variable"&&I(h),h=="*"&&(w.marked="keyword"),c(nn))}function Bt(f){if(f==",")return c(zr,Bt)}function nn(f,h){if(h=="as")return w.marked="keyword",c(zr)}function Er(f,h){if(h=="from")return w.marked="keyword",c(fe)}function Ie(f){return f=="]"?c():j(_e(et,"]"))}function ue(){return j(ge("form"),dt,xe("{"),ge("}"),_e(Xt,"}"),pe,pe)}function Xt(){return j(dt,Nt)}function on(f,h){return f.lastType=="operator"||f.lastType==","||C.test(h.charAt(0))||/[,.]/.test(h.charAt(0))}function St(f,h,z){return h.tokenize==k&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(h.lastType)||h.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(z||0)))}return{startState:function(f){var h={tokenize:k,lastType:"sof",cc:[],lexical:new U((f||0)-$,0,"block",!1),localVars:re.localVars,context:re.localVars&&new me(null,null,!1),indented:f||0};return re.globalVars&&typeof re.globalVars=="object"&&(h.globalVars=re.globalVars),h},token:function(f,h){if(f.sol()&&(h.lexical.hasOwnProperty("align")||(h.lexical.align=!1),h.indented=f.indentation(),g(f,h)),h.tokenize!=E&&f.eatSpace())return null;var z=h.tokenize(f,h);return Y=="comment"?z:(h.lastType=Y=="operator"&&(K=="++"||K=="--")?"incdec":Y,Q(h,z,Y,K,f))},indent:function(f,h){if(f.tokenize==E||f.tokenize==B)return m.Pass;if(f.tokenize!=k)return 0;var z=h&&h.charAt(0),X=f.lexical,A;if(!/^\s*else\b/.test(h))for(var ie=f.cc.length-1;ie>=0;--ie){var Me=f.cc[ie];if(Me==pe)X=X.prev;else if(Me!=Ar&&Me!=ze)break}for(;(X.type=="stat"||X.type=="form")&&(z=="}"||(A=f.cc[f.cc.length-1])&&(A==Te||A==Ke)&&!/^[,\.=+\-*:?[\(]/.test(h));)X=X.prev;ne&&X.type==")"&&X.prev.type=="stat"&&(X=X.prev);var Ye=X.type,ht=z==Ye;return Ye=="vardef"?X.indented+(f.lastType=="operator"||f.lastType==","?X.info.length+1:0):Ye=="form"&&z=="{"?X.indented:Ye=="form"?X.indented+$:Ye=="stat"?X.indented+(on(f,h)?ne||$:0):X.info=="switch"&&!ht&&re.doubleIndentSwitch!=!1?X.indented+(/^(?:case|default)\b/.test(h)?$:2*$):X.align?X.column+(ht?0:1):X.indented+(ht?0:$)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:R?null:"/*",blockCommentEnd:R?null:"*/",blockCommentContinue:R?null:" * ",lineComment:R?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:R?"json":"javascript",jsonldMode:_,jsonMode:R,expressionAllowed:St,skipExpression:function(f){Q(f,"atom","atom","true",new m.StringStream("",2,null))}}}),m.registerHelper("wordChars","javascript",/[\w$]/),m.defineMIME("text/javascript","javascript"),m.defineMIME("text/ecmascript","javascript"),m.defineMIME("application/javascript","javascript"),m.defineMIME("application/x-javascript","javascript"),m.defineMIME("application/ecmascript","javascript"),m.defineMIME("application/json",{name:"javascript",json:!0}),m.defineMIME("application/x-json",{name:"javascript",json:!0}),m.defineMIME("application/manifest+json",{name:"javascript",json:!0}),m.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),m.defineMIME("text/typescript",{name:"javascript",typescript:!0}),m.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],m):m(CodeMirror)})(function(m){"use strict";m.defineMode("css",function(U,H){var Q=H.inline;H.propertyKeywords||(H=m.resolveMode("text/css"));var w=U.indentUnit,j=H.tokenHooks,c=H.documentTypes||{},G=H.mediaTypes||{},I=H.mediaFeatures||{},le=H.mediaValueKeywords||{},ve=H.propertyKeywords||{},me=H.nonStandardPropertyKeywords||{},je=H.fontProperties||{},rt=H.counterDescriptors||{},Pe=H.colorKeywords||{},Xe=H.valueKeywords||{},ze=H.allowNested,ge=H.lineComment,pe=H.supportsAtComponent===!0,xe=U.highlightNonStandardPropertyKeywords!==!1,Se,be;function fe(S,J){return Se=J,S}function et(S,J){var D=S.next();if(j[D]){var Le=j[D](S,J);if(Le!==!1)return Le}if(D=="@")return S.eatWhile(/[\w\\\-]/),fe("def",S.current());if(D=="="||(D=="~"||D=="|")&&S.eat("="))return fe(null,"compare");if(D=='"'||D=="'")return J.tokenize=Ot(D),J.tokenize(S,J);if(D=="#")return S.eatWhile(/[\w\\\-]/),fe("atom","hash");if(D=="!")return S.match(/^\s*\w*/),fe("keyword","important");if(/\d/.test(D)||D=="."&&S.eat(/\d/))return S.eatWhile(/[\w.%]/),fe("number","unit");if(D==="-"){if(/[\d.]/.test(S.peek()))return S.eatWhile(/[\w.%]/),fe("number","unit");if(S.match(/^-[\w\\\-]*/))return S.eatWhile(/[\w\\\-]/),S.match(/^\s*:/,!1)?fe("variable-2","variable-definition"):fe("variable-2","variable");if(S.match(/^\w+-/))return fe("meta","meta")}else return/[,+>*\/]/.test(D)?fe(null,"select-op"):D=="."&&S.match(/^-?[_a-z][_a-z0-9-]*/i)?fe("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(D)?fe(null,D):S.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(S.current())&&(J.tokenize=ft),fe("variable callee","variable")):/[\w\\\-]/.test(D)?(S.eatWhile(/[\w\\\-]/),fe("property","word")):fe(null,null)}function Ot(S){return function(J,D){for(var Le=!1,nt;(nt=J.next())!=null;){if(nt==S&&!Le){S==")"&&J.backUp(1);break}Le=!Le&&nt=="\\"}return(nt==S||!Le&&S!=")")&&(D.tokenize=null),fe("string","string")}}function ft(S,J){return S.next(),S.match(/^\s*[\"\')]/,!1)?J.tokenize=null:J.tokenize=Ot(")"),fe(null,"(")}function kt(S,J,D){this.type=S,this.indent=J,this.prev=D}function Te(S,J,D,Le){return S.context=new kt(D,J.indentation()+(Le===!1?0:w),S.context),D}function Ke(S){return S.context.prev&&(S.context=S.context.prev),S.context.type}function ct(S,J,D){return Ne[D.context.type](S,J,D)}function Ct(S,J,D,Le){for(var nt=Le||1;nt>0;nt--)D.context=D.context.prev;return ct(S,J,D)}function Ce(S){var J=S.current().toLowerCase();Xe.hasOwnProperty(J)?be="atom":Pe.hasOwnProperty(J)?be="keyword":be="variable"}var Ne={};return Ne.top=function(S,J,D){if(S=="{")return Te(D,J,"block");if(S=="}"&&D.context.prev)return Ke(D);if(pe&&/@component/i.test(S))return Te(D,J,"atComponentBlock");if(/^@(-moz-)?document$/i.test(S))return Te(D,J,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(S))return Te(D,J,"atBlock");if(/^@(font-face|counter-style)/i.test(S))return D.stateArg=S,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(S))return"keyframes";if(S&&S.charAt(0)=="@")return Te(D,J,"at");if(S=="hash")be="builtin";else if(S=="word")be="tag";else{if(S=="variable-definition")return"maybeprop";if(S=="interpolation")return Te(D,J,"interpolation");if(S==":")return"pseudo";if(ze&&S=="(")return Te(D,J,"parens")}return D.context.type},Ne.block=function(S,J,D){if(S=="word"){var Le=J.current().toLowerCase();return ve.hasOwnProperty(Le)?(be="property","maybeprop"):me.hasOwnProperty(Le)?(be=xe?"string-2":"property","maybeprop"):ze?(be=J.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(be+=" error","maybeprop")}else return S=="meta"?"block":!ze&&(S=="hash"||S=="qualifier")?(be="error","block"):Ne.top(S,J,D)},Ne.maybeprop=function(S,J,D){return S==":"?Te(D,J,"prop"):ct(S,J,D)},Ne.prop=function(S,J,D){if(S==";")return Ke(D);if(S=="{"&&ze)return Te(D,J,"propBlock");if(S=="}"||S=="{")return Ct(S,J,D);if(S=="(")return Te(D,J,"parens");if(S=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(J.current()))be+=" error";else if(S=="word")Ce(J);else if(S=="interpolation")return Te(D,J,"interpolation");return"prop"},Ne.propBlock=function(S,J,D){return S=="}"?Ke(D):S=="word"?(be="property","maybeprop"):D.context.type},Ne.parens=function(S,J,D){return S=="{"||S=="}"?Ct(S,J,D):S==")"?Ke(D):S=="("?Te(D,J,"parens"):S=="interpolation"?Te(D,J,"interpolation"):(S=="word"&&Ce(J),"parens")},Ne.pseudo=function(S,J,D){return S=="meta"?"pseudo":S=="word"?(be="variable-3",D.context.type):ct(S,J,D)},Ne.documentTypes=function(S,J,D){return S=="word"&&c.hasOwnProperty(J.current())?(be="tag",D.context.type):Ne.atBlock(S,J,D)},Ne.atBlock=function(S,J,D){if(S=="(")return Te(D,J,"atBlock_parens");if(S=="}"||S==";")return Ct(S,J,D);if(S=="{")return Ke(D)&&Te(D,J,ze?"block":"top");if(S=="interpolation")return Te(D,J,"interpolation");if(S=="word"){var Le=J.current().toLowerCase();Le=="only"||Le=="not"||Le=="and"||Le=="or"?be="keyword":G.hasOwnProperty(Le)?be="attribute":I.hasOwnProperty(Le)?be="property":le.hasOwnProperty(Le)?be="keyword":ve.hasOwnProperty(Le)?be="property":me.hasOwnProperty(Le)?be=xe?"string-2":"property":Xe.hasOwnProperty(Le)?be="atom":Pe.hasOwnProperty(Le)?be="keyword":be="error"}return D.context.type},Ne.atComponentBlock=function(S,J,D){return S=="}"?Ct(S,J,D):S=="{"?Ke(D)&&Te(D,J,ze?"block":"top",!1):(S=="word"&&(be="error"),D.context.type)},Ne.atBlock_parens=function(S,J,D){return S==")"?Ke(D):S=="{"||S=="}"?Ct(S,J,D,2):Ne.atBlock(S,J,D)},Ne.restricted_atBlock_before=function(S,J,D){return S=="{"?Te(D,J,"restricted_atBlock"):S=="word"&&D.stateArg=="@counter-style"?(be="variable","restricted_atBlock_before"):ct(S,J,D)},Ne.restricted_atBlock=function(S,J,D){return S=="}"?(D.stateArg=null,Ke(D)):S=="word"?(D.stateArg=="@font-face"&&!je.hasOwnProperty(J.current().toLowerCase())||D.stateArg=="@counter-style"&&!rt.hasOwnProperty(J.current().toLowerCase())?be="error":be="property","maybeprop"):"restricted_atBlock"},Ne.keyframes=function(S,J,D){return S=="word"?(be="variable","keyframes"):S=="{"?Te(D,J,"top"):ct(S,J,D)},Ne.at=function(S,J,D){return S==";"?Ke(D):S=="{"||S=="}"?Ct(S,J,D):(S=="word"?be="tag":S=="hash"&&(be="builtin"),"at")},Ne.interpolation=function(S,J,D){return S=="}"?Ke(D):S=="{"||S==";"?Ct(S,J,D):(S=="word"?be="variable":S!="variable"&&S!="("&&S!=")"&&(be="error"),"interpolation")},{startState:function(S){return{tokenize:null,state:Q?"block":"top",stateArg:null,context:new kt(Q?"block":"top",S||0,null)}},token:function(S,J){if(!J.tokenize&&S.eatSpace())return null;var D=(J.tokenize||et)(S,J);return D&&typeof D=="object"&&(Se=D[1],D=D[0]),be=D,Se!="comment"&&(J.state=Ne[J.state](Se,S,J)),be},indent:function(S,J){var D=S.context,Le=J&&J.charAt(0),nt=D.indent;return D.type=="prop"&&(Le=="}"||Le==")")&&(D=D.prev),D.prev&&(Le=="}"&&(D.type=="block"||D.type=="top"||D.type=="interpolation"||D.type=="restricted_atBlock")?(D=D.prev,nt=D.indent):(Le==")"&&(D.type=="parens"||D.type=="atBlock_parens")||Le=="{"&&(D.type=="at"||D.type=="atBlock"))&&(nt=Math.max(0,D.indent-w))),nt},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:ge,fold:"brace"}});function oe(U){for(var H={},Q=0;Q<U.length;++Q)H[U[Q].toLowerCase()]=!0;return H}var re=["domain","regexp","url","url-prefix"],$=oe(re),ne=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],_=oe(ne),R=["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"],W=oe(R),y=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],L=oe(y),v=["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"],C=oe(v),T=["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"],V=oe(T),Y=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],K=oe(Y),O=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],k=oe(O),M=["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"],E=oe(M),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"],q=oe(B),g=re.concat(ne).concat(R).concat(y).concat(v).concat(T).concat(M).concat(B);m.registerHelper("hintWords","css",g);function P(U,H){for(var Q=!1,w;(w=U.next())!=null;){if(Q&&w=="/"){H.tokenize=null;break}Q=w=="*"}return["comment","comment"]}m.defineMIME("text/css",{documentTypes:$,mediaTypes:_,mediaFeatures:W,mediaValueKeywords:L,propertyKeywords:C,nonStandardPropertyKeywords:V,fontProperties:K,counterDescriptors:k,colorKeywords:E,valueKeywords:q,tokenHooks:{"/":function(U,H){return U.eat("*")?(H.tokenize=P,P(U,H)):!1}},name:"css"}),m.defineMIME("text/x-scss",{mediaTypes:_,mediaFeatures:W,mediaValueKeywords:L,propertyKeywords:C,nonStandardPropertyKeywords:V,colorKeywords:E,valueKeywords:q,fontProperties:K,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(U,H){return U.eat("/")?(U.skipToEnd(),["comment","comment"]):U.eat("*")?(H.tokenize=P,P(U,H)):["operator","operator"]},":":function(U){return U.match(/^\s*\{/,!1)?[null,null]:!1},$:function(U){return U.match(/^[\w-]+/),U.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(U){return U.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),m.defineMIME("text/x-less",{mediaTypes:_,mediaFeatures:W,mediaValueKeywords:L,propertyKeywords:C,nonStandardPropertyKeywords:V,colorKeywords:E,valueKeywords:q,fontProperties:K,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(U,H){return U.eat("/")?(U.skipToEnd(),["comment","comment"]):U.eat("*")?(H.tokenize=P,P(U,H)):["operator","operator"]},"@":function(U){return U.eat("{")?[null,"interpolation"]:U.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)?!1:(U.eatWhile(/[\w\\\-]/),U.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),m.defineMIME("text/x-gss",{documentTypes:$,mediaTypes:_,mediaFeatures:W,propertyKeywords:C,nonStandardPropertyKeywords:V,fontProperties:K,counterDescriptors:k,colorKeywords:E,valueKeywords:q,supportsAtComponent:!0,tokenHooks:{"/":function(U,H){return U.eat("*")?(H.tokenize=P,P(U,H)):!1}},name:"css",helperType:"gss"})}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],m):m(CodeMirror)})(function(m){"use strict";var oe={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 re(L,v,C){var T=L.current(),V=T.search(v);return V>-1?L.backUp(T.length-V):T.match(/<\/?$/)&&(L.backUp(T.length),L.match(v,!1)||L.match(T)),C}var $={};function ne(L){var v=$[L];return v||($[L]=new RegExp("\\s+"+L+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function _(L,v){var C=L.match(ne(v));return C?/^\s*(.*?)\s*$/.exec(C[2])[1]:""}function R(L,v){return new RegExp((v?"^":"")+"</\\s*"+L+"\\s*>","i")}function W(L,v){for(var C in L)for(var T=v[C]||(v[C]=[]),V=L[C],Y=V.length-1;Y>=0;Y--)T.unshift(V[Y])}function y(L,v){for(var C=0;C<L.length;C++){var T=L[C];if(!T[0]||T[1].test(_(v,T[0])))return T[2]}}m.defineMode("htmlmixed",function(L,v){var C=m.getMode(L,{name:"xml",htmlMode:!0,multilineTagIndentFactor:v.multilineTagIndentFactor,multilineTagIndentPastTag:v.multilineTagIndentPastTag,allowMissingTagName:v.allowMissingTagName}),T={},V=v&&v.tags,Y=v&&v.scriptTypes;if(W(oe,T),V&&W(V,T),Y)for(var K=Y.length-1;K>=0;K--)T.script.unshift(["type",Y[K].matches,Y[K].mode]);function O(k,M){var E=C.token(k,M.htmlState),B=/\btag\b/.test(E),q;if(B&&!/[<>\s\/]/.test(k.current())&&(q=M.htmlState.tagName&&M.htmlState.tagName.toLowerCase())&&T.hasOwnProperty(q))M.inTag=q+" ";else if(M.inTag&&B&&/>$/.test(k.current())){var g=/^([\S]+) (.*)/.exec(M.inTag);M.inTag=null;var P=k.current()==">"&&y(T[g[1]],g[2]),U=m.getMode(L,P),H=R(g[1],!0),Q=R(g[1],!1);M.token=function(w,j){return w.match(H,!1)?(j.token=O,j.localState=j.localMode=null,null):re(w,Q,j.localMode.token(w,j.localState))},M.localMode=U,M.localState=m.startState(U,C.indent(M.htmlState,"",""))}else M.inTag&&(M.inTag+=k.current(),k.eol()&&(M.inTag+=" "));return E}return{startState:function(){var k=m.startState(C);return{token:O,inTag:null,localMode:null,localState:null,htmlState:k}},copyState:function(k){var M;return k.localState&&(M=m.copyState(k.localMode,k.localState)),{token:k.token,inTag:k.inTag,localMode:k.localMode,localState:M,htmlState:m.copyState(C,k.htmlState)}},token:function(k,M){return M.token(k,M)},indent:function(k,M,E){return!k.localMode||/^\s*<\//.test(M)?C.indent(k.htmlState,M,E):k.localMode.indent?k.localMode.indent(k.localState,M,E):m.Pass},innerMode:function(k){return{state:k.localState||k.htmlState,mode:k.localMode||C}}}},"xml","javascript","css"),m.defineMIME("text/html","htmlmixed")}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],m):m(CodeMirror)})(function(m){var oe=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),re=m.Pos,$={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function ne(v){return v&&v.bracketRegex||/[(){}[\]]/}function _(v,C,T){var V=v.getLineHandle(C.line),Y=C.ch-1,K=T&&T.afterCursor;K==null&&(K=/(^| )cm-fat-cursor($| )/.test(v.getWrapperElement().className));var O=ne(T),k=!K&&Y>=0&&O.test(V.text.charAt(Y))&&$[V.text.charAt(Y)]||O.test(V.text.charAt(Y+1))&&$[V.text.charAt(++Y)];if(!k)return null;var M=k.charAt(1)==">"?1:-1;if(T&&T.strict&&M>0!=(Y==C.ch))return null;var E=v.getTokenTypeAt(re(C.line,Y+1)),B=R(v,re(C.line,Y+(M>0?1:0)),M,E,T);return B==null?null:{from:re(C.line,Y),to:B&&B.pos,match:B&&B.ch==k.charAt(0),forward:M>0}}function R(v,C,T,V,Y){for(var K=Y&&Y.maxScanLineLength||1e4,O=Y&&Y.maxScanLines||1e3,k=[],M=ne(Y),E=T>0?Math.min(C.line+O,v.lastLine()+1):Math.max(v.firstLine()-1,C.line-O),B=C.line;B!=E;B+=T){var q=v.getLine(B);if(q){var g=T>0?0:q.length-1,P=T>0?q.length:-1;if(!(q.length>K))for(B==C.line&&(g=C.ch-(T<0?1:0));g!=P;g+=T){var U=q.charAt(g);if(M.test(U)&&(V===void 0||(v.getTokenTypeAt(re(B,g+1))||"")==(V||""))){var H=$[U];if(H&&H.charAt(1)==">"==T>0)k.push(U);else if(k.length)k.pop();else return{pos:re(B,g),ch:U}}}}}return B-T==(T>0?v.lastLine():v.firstLine())?!1:null}function W(v,C,T){for(var V=v.state.matchBrackets.maxHighlightLineLength||1e3,Y=T&&T.highlightNonMatching,K=[],O=v.listSelections(),k=0;k<O.length;k++){var M=O[k].empty()&&_(v,O[k].head,T);if(M&&(M.match||Y!==!1)&&v.getLine(M.from.line).length<=V){var E=M.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";K.push(v.markText(M.from,re(M.from.line,M.from.ch+1),{className:E})),M.to&&v.getLine(M.to.line).length<=V&&K.push(v.markText(M.to,re(M.to.line,M.to.ch+1),{className:E}))}}if(K.length){oe&&v.state.focused&&v.focus();var B=function(){v.operation(function(){for(var q=0;q<K.length;q++)K[q].clear()})};if(C)setTimeout(B,800);else return B}}function y(v){v.operation(function(){v.state.matchBrackets.currentlyHighlighted&&(v.state.matchBrackets.currentlyHighlighted(),v.state.matchBrackets.currentlyHighlighted=null),v.state.matchBrackets.currentlyHighlighted=W(v,!1,v.state.matchBrackets)})}function L(v){v.state.matchBrackets&&v.state.matchBrackets.currentlyHighlighted&&(v.state.matchBrackets.currentlyHighlighted(),v.state.matchBrackets.currentlyHighlighted=null)}m.defineOption("matchBrackets",!1,function(v,C,T){T&&T!=m.Init&&(v.off("cursorActivity",y),v.off("focus",y),v.off("blur",L),L(v)),C&&(v.state.matchBrackets=typeof C=="object"?C:{},v.on("cursorActivity",y),v.on("focus",y),v.on("blur",L))}),m.defineExtension("matchBrackets",function(){W(this,!0)}),m.defineExtension("findMatchingBracket",function(v,C,T){return(T||typeof C=="boolean")&&(T?(T.strict=C,C=T):C=C?{strict:!0}:null),_(this,v,C)}),m.defineExtension("scanForBracket",function(v,C,T,V){return R(this,v,C,T,V)})}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror"),require("../fold/xml-fold")):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],m):m(CodeMirror)})(function(m){m.defineOption("autoCloseTags",!1,function(y,L,v){if(v!=m.Init&&v&&y.removeKeyMap("autoCloseTags"),!!L){var C={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(C["'/'"]=function(T){return _(T)}),(typeof L!="object"||L.whenOpening!==!1)&&(C["'>'"]=function(T){return $(T)}),y.addKeyMap(C)}});var oe=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],re=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function $(y){if(y.getOption("disableInput"))return m.Pass;for(var L=y.listSelections(),v=[],C=y.getOption("autoCloseTags"),T=0;T<L.length;T++){if(!L[T].empty())return m.Pass;var V=L[T].head,Y=y.getTokenAt(V),K=m.innerMode(y.getMode(),Y.state),O=K.state,k=K.mode.xmlCurrentTag&&K.mode.xmlCurrentTag(O),M=k&&k.name;if(!M)return m.Pass;var E=K.mode.configuration=="html",B=typeof C=="object"&&C.dontCloseTags||E&&oe,q=typeof C=="object"&&C.indentTags||E&&re;Y.end>V.ch&&(M=M.slice(0,M.length-Y.end+V.ch));var g=M.toLowerCase();if(!M||Y.type=="string"&&(Y.end!=V.ch||!/[\"\']/.test(Y.string.charAt(Y.string.length-1))||Y.string.length==1)||Y.type=="tag"&&k.close||Y.string.indexOf("/")==V.ch-Y.start-1||B&&R(B,g)>-1||W(y,K.mode.xmlCurrentContext&&K.mode.xmlCurrentContext(O)||[],M,V,!0))return m.Pass;var P=typeof C=="object"&&C.emptyTags;if(P&&R(P,M)>-1){v[T]={text:"/>",newPos:m.Pos(V.line,V.ch+2)};continue}var U=q&&R(q,g)>-1;v[T]={indent:U,text:">"+(U?`
`:"")+"</"+M+">",newPos:U?m.Pos(V.line+1,0):m.Pos(V.line,V.ch+1)}}for(var H=typeof C=="object"&&C.dontIndentOnAutoClose,T=L.length-1;T>=0;T--){var Q=v[T];y.replaceRange(Q.text,L[T].head,L[T].anchor,"+insert");var w=y.listSelections().slice(0);w[T]={head:Q.newPos,anchor:Q.newPos},y.setSelections(w),!H&&Q.indent&&(y.indentLine(Q.newPos.line,null,!0),y.indentLine(Q.newPos.line+1,null,!0))}}function ne(y,L){for(var v=y.listSelections(),C=[],T=L?"/":"</",V=y.getOption("autoCloseTags"),Y=typeof V=="object"&&V.dontIndentOnSlash,K=0;K<v.length;K++){if(!v[K].empty())return m.Pass;var O=v[K].head,k=y.getTokenAt(O),M=m.innerMode(y.getMode(),k.state),E=M.state;if(L&&(k.type=="string"||k.string.charAt(0)!="<"||k.start!=O.ch-1))return m.Pass;var B,q=M.mode.name!="xml"&&y.getMode().name=="htmlmixed";if(q&&M.mode.name=="javascript")B=T+"script";else if(q&&M.mode.name=="css")B=T+"style";else{var g=M.mode.xmlCurrentContext&&M.mode.xmlCurrentContext(E),P=g.length?g[g.length-1]:"";if(!g||g.length&&W(y,g,P,O))return m.Pass;B=T+P}y.getLine(O.line).charAt(k.end)!=">"&&(B+=">"),C[K]=B}if(y.replaceSelections(C),v=y.listSelections(),!Y)for(var K=0;K<v.length;K++)(K==v.length-1||v[K].head.line<v[K+1].head.line)&&y.indentLine(v[K].head.line)}function _(y){return y.getOption("disableInput")?m.Pass:ne(y,!0)}m.commands.closeTag=function(y){return ne(y)};function R(y,L){if(y.indexOf)return y.indexOf(L);for(var v=0,C=y.length;v<C;++v)if(y[v]==L)return v;return-1}function W(y,L,v,C,T){if(!m.scanForClosingTag)return!1;var V=Math.min(y.lastLine()+1,C.line+500),Y=m.scanForClosingTag(y,C,null,V);if(!Y||Y.tag!=v)return!1;for(var K=T?1:0,O=L.length-1;O>=0&&L[O]==v;O--)++K;C=Y.to;for(var O=1;O<K;O++){var k=m.scanForClosingTag(y,C,null,V);if(!k||k.tag!=v)return!1;C=k.to}return!0}}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],m):m(CodeMirror)})(function(m){"use strict";var oe="CodeMirror-activeline",re="CodeMirror-activeline-background",$="CodeMirror-activeline-gutter";m.defineOption("styleActiveLine",!1,function(y,L,v){var C=v==m.Init?!1:v;L!=C&&(C&&(y.off("beforeSelectionChange",W),ne(y),delete y.state.activeLines),L&&(y.state.activeLines=[],R(y,y.listSelections()),y.on("beforeSelectionChange",W)))});function ne(y){for(var L=0;L<y.state.activeLines.length;L++)y.removeLineClass(y.state.activeLines[L],"wrap",oe),y.removeLineClass(y.state.activeLines[L],"background",re),y.removeLineClass(y.state.activeLines[L],"gutter",$)}function _(y,L){if(y.length!=L.length)return!1;for(var v=0;v<y.length;v++)if(y[v]!=L[v])return!1;return!0}function R(y,L){for(var v=[],C=0;C<L.length;C++){var T=L[C],V=y.getOption("styleActiveLine");if(!(typeof V=="object"&&V.nonEmpty?T.anchor.line!=T.head.line:!T.empty())){var Y=y.getLineHandleVisualStart(T.head.line);v[v.length-1]!=Y&&v.push(Y)}}_(y.state.activeLines,v)||y.operation(function(){ne(y);for(var K=0;K<v.length;K++)y.addLineClass(v[K],"wrap",oe),y.addLineClass(v[K],"background",re),y.addLineClass(v[K],"gutter",$);y.state.activeLines=v})}function W(y,L){R(y,L.ranges)}}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],m):m(CodeMirror)})(function(m){m.defineOption("placeholder","",function(W,y,L){var v=L&&L!=m.Init;if(y&&!v)W.on("blur",ne),W.on("change",_),W.on("swapDoc",_),m.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){$(W)}),_(W);else if(!y&&v){W.off("blur",ne),W.off("change",_),W.off("swapDoc",_),m.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),oe(W);var C=W.getWrapperElement();C.className=C.className.replace(" CodeMirror-empty","")}y&&!W.hasFocus()&&ne(W)});function oe(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function re(W){oe(W);var y=W.state.placeholder=document.createElement("pre");y.style.cssText="height: 0; overflow: visible",y.style.direction=W.getOption("direction"),y.className="CodeMirror-placeholder CodeMirror-line-like";var L=W.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),y.appendChild(L),W.display.lineSpace.insertBefore(y,W.display.lineSpace.firstChild)}function $(W){setTimeout(function(){var y=!1;if(W.lineCount()==1){var L=W.getInputField();y=L.nodeName=="TEXTAREA"?!W.getLine(0).length:!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)}y?re(W):oe(W)},20)}function ne(W){R(W)&&re(W)}function _(W){var y=W.getWrapperElement(),L=R(W);y.className=y.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?re(W):oe(W)}function R(W){return W.lineCount()===1&&W.getLine(0)===""}}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],m):m(CodeMirror)})(function(m){function oe($,ne,_){var R=$.getWrapperElement(),W;return W=R.appendChild(document.createElement("div")),_?W.className="CodeMirror-dialog CodeMirror-dialog-bottom":W.className="CodeMirror-dialog CodeMirror-dialog-top",typeof ne=="string"?W.innerHTML=ne:W.appendChild(ne),m.addClass(R,"dialog-opened"),W}function re($,ne){$.state.currentNotificationClose&&$.state.currentNotificationClose(),$.state.currentNotificationClose=ne}m.defineExtension("openDialog",function($,ne,_){_||(_={}),re(this,null);var R=oe(this,$,_.bottom),W=!1,y=this;function L(T){if(typeof T=="string")v.value=T;else{if(W)return;W=!0,m.rmClass(R.parentNode,"dialog-opened"),R.parentNode.removeChild(R),y.focus(),_.onClose&&_.onClose(R)}}var v=R.getElementsByTagName("input")[0],C;return v?(v.focus(),_.value&&(v.value=_.value,_.selectValueOnOpen!==!1&&v.select()),_.onInput&&m.on(v,"input",function(T){_.onInput(T,v.value,L)}),_.onKeyUp&&m.on(v,"keyup",function(T){_.onKeyUp(T,v.value,L)}),m.on(v,"keydown",function(T){_&&_.onKeyDown&&_.onKeyDown(T,v.value,L)||((T.keyCode==27||_.closeOnEnter!==!1&&T.keyCode==13)&&(v.blur(),m.e_stop(T),L()),T.keyCode==13&&ne(v.value,T))}),_.closeOnBlur!==!1&&m.on(R,"focusout",function(T){T.relatedTarget!==null&&L()})):(C=R.getElementsByTagName("button")[0])&&(m.on(C,"click",function(){L(),y.focus()}),_.closeOnBlur!==!1&&m.on(C,"blur",L),C.focus()),L}),m.defineExtension("openConfirm",function($,ne,_){re(this,null);var R=oe(this,$,_&&_.bottom),W=R.getElementsByTagName("button"),y=!1,L=this,v=1;function C(){y||(y=!0,m.rmClass(R.parentNode,"dialog-opened"),R.parentNode.removeChild(R),L.focus())}W[0].focus();for(var T=0;T<W.length;++T){var V=W[T];(function(Y){m.on(V,"click",function(K){m.e_preventDefault(K),C(),Y&&Y(L)})})(ne[T]),m.on(V,"blur",function(){--v,setTimeout(function(){v<=0&&C()},200)}),m.on(V,"focus",function(){++v})}}),m.defineExtension("openNotification",function($,ne){re(this,L);var _=oe(this,$,ne&&ne.bottom),R=!1,W,y=ne&&typeof ne.duration!="undefined"?ne.duration:5e3;function L(){R||(R=!0,clearTimeout(W),m.rmClass(_.parentNode,"dialog-opened"),_.parentNode.removeChild(_))}return m.on(_,"click",function(v){m.e_preventDefault(v),L()}),y&&(W=setTimeout(L,y)),L})}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],m):m(CodeMirror)})(function(m){"use strict";var oe=m.Pos;function re(O){var k=O.flags;return k!=null?k:(O.ignoreCase?"i":"")+(O.global?"g":"")+(O.multiline?"m":"")}function $(O,k){for(var M=re(O),E=M,B=0;B<k.length;B++)E.indexOf(k.charAt(B))==-1&&(E+=k.charAt(B));return M==E?O:new RegExp(O.source,E)}function ne(O){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(O.source)}function _(O,k,M){k=$(k,"g");for(var E=M.line,B=M.ch,q=O.lastLine();E<=q;E++,B=0){k.lastIndex=B;var g=O.getLine(E),P=k.exec(g);if(P)return{from:oe(E,P.index),to:oe(E,P.index+P[0].length),match:P}}}function R(O,k,M){if(!ne(k))return _(O,k,M);k=$(k,"gm");for(var E,B=1,q=M.line,g=O.lastLine();q<=g;){for(var P=0;P<B&&!(q>g);P++){var U=O.getLine(q++);E=E==null?U:E+`
`+U}B=B*2,k.lastIndex=M.ch;var H=k.exec(E);if(H){var Q=E.slice(0,H.index).split(`
`),w=H[0].split(`
`),j=M.line+Q.length-1,c=Q[Q.length-1].length;return{from:oe(j,c),to:oe(j+w.length-1,w.length==1?c+w[0].length:w[w.length-1].length),match:H}}}}function W(O,k,M){for(var E,B=0;B<=O.length;){k.lastIndex=B;var q=k.exec(O);if(!q)break;var g=q.index+q[0].length;if(g>O.length-M)break;(!E||g>E.index+E[0].length)&&(E=q),B=q.index+1}return E}function y(O,k,M){k=$(k,"g");for(var E=M.line,B=M.ch,q=O.firstLine();E>=q;E--,B=-1){var g=O.getLine(E),P=W(g,k,B<0?0:g.length-B);if(P)return{from:oe(E,P.index),to:oe(E,P.index+P[0].length),match:P}}}function L(O,k,M){if(!ne(k))return y(O,k,M);k=$(k,"gm");for(var E,B=1,q=O.getLine(M.line).length-M.ch,g=M.line,P=O.firstLine();g>=P;){for(var U=0;U<B&&g>=P;U++){var H=O.getLine(g--);E=E==null?H:H+`
`+E}B*=2;var Q=W(E,k,q);if(Q){var w=E.slice(0,Q.index).split(`
`),j=Q[0].split(`
`),c=g+w.length,G=w[w.length-1].length;return{from:oe(c,G),to:oe(c+j.length-1,j.length==1?G+j[0].length:j[j.length-1].length),match:Q}}}}var v,C;String.prototype.normalize?(v=function(O){return O.normalize("NFD").toLowerCase()},C=function(O){return O.normalize("NFD")}):(v=function(O){return O.toLowerCase()},C=function(O){return O});function T(O,k,M,E){if(O.length==k.length)return M;for(var B=0,q=M+Math.max(0,O.length-k.length);;){if(B==q)return B;var g=B+q>>1,P=E(O.slice(0,g)).length;if(P==M)return g;P>M?q=g:B=g+1}}function V(O,k,M,E){if(!k.length)return null;var B=E?v:C,q=B(k).split(/\r|\n\r?/);e:for(var g=M.line,P=M.ch,U=O.lastLine()+1-q.length;g<=U;g++,P=0){var H=O.getLine(g).slice(P),Q=B(H);if(q.length==1){var w=Q.indexOf(q[0]);if(w==-1)continue e;var M=T(H,Q,w,B)+P;return{from:oe(g,T(H,Q,w,B)+P),to:oe(g,T(H,Q,w+q[0].length,B)+P)}}else{var j=Q.length-q[0].length;if(Q.slice(j)!=q[0])continue e;for(var c=1;c<q.length-1;c++)if(B(O.getLine(g+c))!=q[c])continue e;var G=O.getLine(g+q.length-1),I=B(G),le=q[q.length-1];if(I.slice(0,le.length)!=le)continue e;return{from:oe(g,T(H,Q,j,B)+P),to:oe(g+q.length-1,T(G,I,le.length,B))}}}}function Y(O,k,M,E){if(!k.length)return null;var B=E?v:C,q=B(k).split(/\r|\n\r?/);e:for(var g=M.line,P=M.ch,U=O.firstLine()-1+q.length;g>=U;g--,P=-1){var H=O.getLine(g);P>-1&&(H=H.slice(0,P));var Q=B(H);if(q.length==1){var w=Q.lastIndexOf(q[0]);if(w==-1)continue e;return{from:oe(g,T(H,Q,w,B)),to:oe(g,T(H,Q,w+q[0].length,B))}}else{var j=q[q.length-1];if(Q.slice(0,j.length)!=j)continue e;for(var c=1,M=g-q.length+1;c<q.length-1;c++)if(B(O.getLine(M+c))!=q[c])continue e;var G=O.getLine(g+1-q.length),I=B(G);if(I.slice(I.length-q[0].length)!=q[0])continue e;return{from:oe(g+1-q.length,T(G,I,G.length-q[0].length,B)),to:oe(g,T(H,Q,j.length,B))}}}}function K(O,k,M,E){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=O,M=M?O.clipPos(M):oe(0,0),this.pos={from:M,to:M};var B;typeof E=="object"?B=E.caseFold:(B=E,E=null),typeof k=="string"?(B==null&&(B=!1),this.matches=function(q,g){return(q?Y:V)(O,k,g,B)}):(k=$(k,"gm"),!E||E.multiline!==!1?this.matches=function(q,g){return(q?L:R)(O,k,g)}:this.matches=function(q,g){return(q?y:_)(O,k,g)})}K.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(O){var k=this.doc.clipPos(O?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(k=oe(k.line,k.ch),O?(k.ch--,k.ch<0&&(k.line--,k.ch=(this.doc.getLine(k.line)||"").length)):(k.ch++,k.ch>(this.doc.getLine(k.line)||"").length&&(k.ch=0,k.line++)),m.cmpPos(k,this.doc.clipPos(k))!=0))return this.atOccurrence=!1;var M=this.matches(O,k);if(this.afterEmptyMatch=M&&m.cmpPos(M.from,M.to)==0,M)return this.pos=M,this.atOccurrence=!0,this.pos.match||!0;var E=oe(O?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:E,to:E},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(O,k){if(this.atOccurrence){var M=m.splitLines(O);this.doc.replaceRange(M,this.pos.from,this.pos.to,k),this.pos.to=oe(this.pos.from.line+M.length-1,M[M.length-1].length+(M.length==1?this.pos.from.ch:0))}}},m.defineExtension("getSearchCursor",function(O,k,M){return new K(this.doc,O,k,M)}),m.defineDocExtension("getSearchCursor",function(O,k,M){return new K(this,O,k,M)}),m.defineExtension("selectMatches",function(O,k){for(var M=[],E=this.getSearchCursor(O,this.getCursor("from"),k);E.findNext()&&!(m.cmpPos(E.to(),this.getCursor("to"))>0);)M.push({anchor:E.from(),head:E.to()});M.length&&this.setSelections(M,0)})}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):typeof define=="function"&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],m):m(CodeMirror)})(function(m){"use strict";m.defineOption("search",{bottom:!1});function oe(g,P){return typeof g=="string"?g=new RegExp(g.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),P?"gi":"g"):g.global||(g=new RegExp(g.source,g.ignoreCase?"gi":"g")),{token:function(U){g.lastIndex=U.pos;var H=g.exec(U.string);if(H&&H.index==U.pos)return U.pos+=H[0].length||1,"searching";H?U.pos=H.index:U.skipToEnd()}}}function re(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function $(g){return g.state.search||(g.state.search=new re)}function ne(g){return typeof g=="string"&&g==g.toLowerCase()}function _(g,P,U){return g.getSearchCursor(P,U,{caseFold:ne(P),multiline:!0})}function R(g,P,U,H,Q){g.openDialog(P,H,{value:U,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){Y(g)},onKeyDown:Q,bottom:g.options.search.bottom})}function W(g,P,U,H,Q){g.openDialog?g.openDialog(P,Q,{value:H,selectValueOnOpen:!0,bottom:g.options.search.bottom}):Q(prompt(U,H))}function y(g,P,U,H){g.openConfirm?g.openConfirm(P,H):confirm(U)&&H[0]()}function L(g){return g.replace(/\\([nrt\\])/g,function(P,U){return U=="n"?`
`:U=="r"?"\r":U=="t"?" ":U=="\\"?"\\":P})}function v(g){var P=g.match(/^\/(.*)\/([a-z]*)$/);if(P)try{g=new RegExp(P[1],P[2].indexOf("i")==-1?"":"i")}catch(U){}else g=L(g);return(typeof g=="string"?g=="":g.test(""))&&(g=/x^/),g}function C(g,P,U){P.queryText=U,P.query=v(U),g.removeOverlay(P.overlay,ne(P.query)),P.overlay=oe(P.query,ne(P.query)),g.addOverlay(P.overlay),g.showMatchesOnScrollbar&&(P.annotate&&(P.annotate.clear(),P.annotate=null),P.annotate=g.showMatchesOnScrollbar(P.query,ne(P.query)))}function T(g,P,U,H){var Q=$(g);if(Q.query)return V(g,P);var w=g.getSelection()||Q.lastQuery;if(w instanceof RegExp&&w.source=="x^"&&(w=null),U&&g.openDialog){var j=null,c=function(G,I){m.e_stop(I),G&&(G!=Q.queryText&&(C(g,Q,G),Q.posFrom=Q.posTo=g.getCursor()),j&&(j.style.opacity=1),V(g,I.shiftKey,function(le,ve){var me;ve.line<3&&document.querySelector&&(me=g.display.wrapper.querySelector(".CodeMirror-dialog"))&&me.getBoundingClientRect().bottom-4>g.cursorCoords(ve,"window").top&&((j=me).style.opacity=.4)}))};R(g,O(g),w,c,function(G,I){var le=m.keyName(G),ve=g.getOption("extraKeys"),me=ve&&ve[le]||m.keyMap[g.getOption("keyMap")][le];me=="findNext"||me=="findPrev"||me=="findPersistentNext"||me=="findPersistentPrev"?(m.e_stop(G),C(g,$(g),I),g.execCommand(me)):(me=="find"||me=="findPersistent")&&(m.e_stop(G),c(I,G))}),H&&w&&(C(g,Q,w),V(g,P))}else W(g,O(g),"Search for:",w,function(G){G&&!Q.query&&g.operation(function(){C(g,Q,G),Q.posFrom=Q.posTo=g.getCursor(),V(g,P)})})}function V(g,P,U){g.operation(function(){var H=$(g),Q=_(g,H.query,P?H.posFrom:H.posTo);!Q.find(P)&&(Q=_(g,H.query,P?m.Pos(g.lastLine()):m.Pos(g.firstLine(),0)),!Q.find(P))||(g.setSelection(Q.from(),Q.to()),g.scrollIntoView({from:Q.from(),to:Q.to()},20),H.posFrom=Q.from(),H.posTo=Q.to(),U&&U(Q.from(),Q.to()))})}function Y(g){g.operation(function(){var P=$(g);P.lastQuery=P.query,P.query&&(P.query=P.queryText=null,g.removeOverlay(P.overlay),P.annotate&&(P.annotate.clear(),P.annotate=null))})}function K(g,P){var U=g?document.createElement(g):document.createDocumentFragment();for(var H in P)U[H]=P[H];for(var Q=2;Q<arguments.length;Q++){var w=arguments[Q];U.appendChild(typeof w=="string"?document.createTextNode(w):w)}return U}function O(g){var P=K("label",{className:"CodeMirror-search-label"},g.phrase("Search:"),K("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));return P.setAttribute("for","CodeMirror-search-field"),K("",null,P," ",K("span",{style:"color: #666",className:"CodeMirror-search-hint"},g.phrase("(Use /re/ syntax for regexp search)")))}function k(g){return K("",null," ",K("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",K("span",{style:"color: #666",className:"CodeMirror-search-hint"},g.phrase("(Use /re/ syntax for regexp search)")))}function M(g){return K("",null,K("span",{className:"CodeMirror-search-label"},g.phrase("With:"))," ",K("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}function E(g){return K("",null,K("span",{className:"CodeMirror-search-label"},g.phrase("Replace?"))," ",K("button",{},g.phrase("Yes"))," ",K("button",{},g.phrase("No"))," ",K("button",{},g.phrase("All"))," ",K("button",{},g.phrase("Stop")))}function B(g,P,U){g.operation(function(){for(var H=_(g,P);H.findNext();)if(typeof P!="string"){var Q=g.getRange(H.from(),H.to()).match(P);H.replace(U.replace(/\$(\d)/g,function(w,j){return Q[j]}))}else H.replace(U)})}function q(g,P){if(!g.getOption("readOnly")){var U=g.getSelection()||$(g).lastQuery,H=P?g.phrase("Replace all:"):g.phrase("Replace:"),Q=K("",null,K("span",{className:"CodeMirror-search-label"},H),k(g));W(g,Q,H,U,function(w){w&&(w=v(w),W(g,M(g),g.phrase("Replace with:"),"",function(j){if(j=L(j),P)B(g,w,j);else{Y(g);var c=_(g,w,g.getCursor("from")),G=function(){var le=c.from(),ve;!(ve=c.findNext())&&(c=_(g,w),!(ve=c.findNext())||le&&c.from().line==le.line&&c.from().ch==le.ch)||(g.setSelection(c.from(),c.to()),g.scrollIntoView({from:c.from(),to:c.to()}),y(g,E(g),g.phrase("Replace?"),[function(){I(ve)},G,function(){B(g,w,j)}]))},I=function(le){c.replace(typeof w=="string"?j:j.replace(/\$(\d)/g,function(ve,me){return le[me]})),G()};G()}}))})}}m.commands.find=function(g){Y(g),T(g)},m.commands.findPersistent=function(g){Y(g),T(g,!1,!0)},m.commands.findPersistentNext=function(g){T(g,!1,!0,!0)},m.commands.findPersistentPrev=function(g){T(g,!0,!0,!0)},m.commands.findNext=T,m.commands.findPrev=function(g){T(g,!0)},m.commands.clearSearch=Y,m.commands.replace=q,m.commands.replaceAll=function(g){q(g,!0)}}),(function(m){typeof exports=="object"&&typeof module=="object"?m(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],m):m(CodeMirror)})(function(m){"use strict";var oe={},re=/[^\s\u00a0]/,$=m.Pos,ne=m.cmpPos;function _(y){var L=y.search(re);return L==-1?0:L}m.commands.toggleComment=function(y){y.toggleComment()},m.defineExtension("toggleComment",function(y){y||(y=oe);for(var L=this,v=1/0,C=this.listSelections(),T=null,V=C.length-1;V>=0;V--){var Y=C[V].from(),K=C[V].to();Y.line>=v||(K.line>=v&&(K=$(v,0)),v=Y.line,T==null?L.uncomment(Y,K,y)?T="un":(L.lineComment(Y,K,y),T="line"):T=="un"?L.uncomment(Y,K,y):L.lineComment(Y,K,y))}});function R(y,L,v){return/\bstring\b/.test(y.getTokenTypeAt($(L.line,0)))&&!/^[\'\"\`]/.test(v)}function W(y,L){var v=y.getMode();return v.useInnerComments===!1||!v.innerMode?v:y.getModeAt(L)}m.defineExtension("lineComment",function(y,L,v){v||(v=oe);var C=this,T=W(C,y),V=C.getLine(y.line);if(!(V==null||R(C,y,V))){var Y=v.lineComment||T.lineComment;if(!Y){(v.blockCommentStart||T.blockCommentStart)&&(v.fullLines=!0,C.blockComment(y,L,v));return}var K=Math.min(L.ch!=0||L.line==y.line?L.line+1:L.line,C.lastLine()+1),O=v.padding==null?" ":v.padding,k=v.commentBlankLines||y.line==L.line;C.operation(function(){if(v.indent){for(var M=null,E=y.line;E<K;++E){var B=C.getLine(E),q=B.search(re)===-1?B:B.slice(0,_(B));(M==null||M.length>q.length)&&(M=q)}for(var E=y.line;E<K;++E){var B=C.getLine(E),g=M.length;!k&&!re.test(B)||(B.slice(0,g)!=M&&(g=_(B)),C.replaceRange(M+Y+O,$(E,0),$(E,g)))}}else for(var E=y.line;E<K;++E)(k||re.test(C.getLine(E)))&&C.replaceRange(Y+O,$(E,0))})}}),m.defineExtension("blockComment",function(y,L,v){v||(v=oe);var C=this,T=W(C,y),V=v.blockCommentStart||T.blockCommentStart,Y=v.blockCommentEnd||T.blockCommentEnd;if(!V||!Y){(v.lineComment||T.lineComment)&&v.fullLines!=!1&&C.lineComment(y,L,v);return}if(!/\bcomment\b/.test(C.getTokenTypeAt($(y.line,0)))){var K=Math.min(L.line,C.lastLine());K!=y.line&&L.ch==0&&re.test(C.getLine(K))&&--K;var O=v.padding==null?" ":v.padding;y.line>K||C.operation(function(){if(v.fullLines!=!1){var k=re.test(C.getLine(K));C.replaceRange(O+Y,$(K)),C.replaceRange(V+O,$(y.line,0));var M=v.blockCommentLead||T.blockCommentLead;if(M!=null)for(var E=y.line+1;E<=K;++E)(E!=K||k)&&C.replaceRange(M+O,$(E,0))}else{var B=ne(C.getCursor("to"),L)==0,q=!C.somethingSelected();C.replaceRange(Y,L),B&&C.setSelection(q?L:C.getCursor("from"),L),C.replaceRange(V,y)}})}}),m.defineExtension("uncomment",function(y,L,v){v||(v=oe);var C=this,T=W(C,y),V=Math.min(L.ch!=0||L.line==y.line?L.line:L.line-1,C.lastLine()),Y=Math.min(y.line,V),K=v.lineComment||T.lineComment,O=[],k=v.padding==null?" ":v.padding,M;e:{if(!K)break e;for(var E=Y;E<=V;++E){var B=C.getLine(E),q=B.indexOf(K);if(q>-1&&!/comment/.test(C.getTokenTypeAt($(E,q+1)))&&(q=-1),q==-1&&re.test(B)||q>-1&&re.test(B.slice(0,q)))break e;O.push(B)}if(C.operation(function(){for(var me=Y;me<=V;++me){var je=O[me-Y],rt=je.indexOf(K),Pe=rt+K.length;rt<0||(je.slice(Pe,Pe+k.length)==k&&(Pe+=k.length),M=!0,C.replaceRange("",$(me,rt),$(me,Pe)))}}),M)return!0}var g=v.blockCommentStart||T.blockCommentStart,P=v.blockCommentEnd||T.blockCommentEnd;if(!g||!P)return!1;var U=v.blockCommentLead||T.blockCommentLead,H=C.getLine(Y),Q=H.indexOf(g);if(Q==-1)return!1;var w=V==Y?H:C.getLine(V),j=w.indexOf(P,V==Y?Q+g.length:0),c=$(Y,Q+1),G=$(V,j+1);if(j==-1||!/comment/.test(C.getTokenTypeAt(c))||!/comment/.test(C.getTokenTypeAt(G))||C.getRange(c,G,`
`).indexOf(P)>-1)return!1;var I=H.lastIndexOf(g,y.ch),le=I==-1?-1:H.slice(0,y.ch).indexOf(P,I+g.length);if(I!=-1&&le!=-1&&le+P.length!=y.ch)return!1;le=w.indexOf(P,L.ch);var ve=w.slice(L.ch).lastIndexOf(g,le-L.ch);return I=le==-1||ve==-1?-1:L.ch+ve,le!=-1&&I!=-1&&I!=L.ch?!1:(C.operation(function(){C.replaceRange("",$(V,j-(k&&w.slice(j-k.length,j)==k?k.length:0)),$(V,j+P.length));var me=Q+g.length;if(k&&H.slice(me,me+k.length)==k&&(me+=k.length),C.replaceRange("",$(Y,Q),$(Y,me)),U)for(var je=Y+1;je<=V;++je){var rt=C.getLine(je),Pe=rt.indexOf(U);if(!(Pe==-1||re.test(rt.slice(0,Pe)))){var Xe=Pe+U.length;k&&rt.slice(Xe,Xe+k.length)==k&&(Xe+=k.length),C.replaceRange("",$(je,Pe),$(je,Xe))}}}),!0)})}),CodeMirror.defineMode("tera",function(m){var oe={startState:function(){return{inTag:null}},token:function(re,$){if($.inTag){for(var ne=$.inTag==="{#"?"#}":$.inTag==="{{"?"}}":"%}";!re.eol();){if(re.match(ne)){var _=$.inTag;return $.inTag=null,_==="{#"?"comment":_==="{{"?"variable-2":"keyword"}re.next()}return $.inTag==="{#"?"comment":$.inTag==="{{"?"variable-2":"keyword"}if(re.match("{#"))return $.inTag="{#","comment";if(re.match("{{"))return $.inTag="{{","variable-2";if(re.match("{%"))return $.inTag="{%","keyword";for(;re.next()!=null&&!re.match("{{",!1)&&!re.match("{%",!1)&&!re.match("{#",!1););return null}};return CodeMirror.overlayMode(CodeMirror.getMode(m,"htmlmixed"),oe)}),CodeMirror.defineMIME("text/x-tera","tera"),(function(){if(!document.getElementById("rcms-cm-css")){var m=document.createElement("style");m.id="rcms-cm-css",m.textContent=`/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
color: black;
direction: ltr;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like {
padding: 0 4px; /* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
background-color: white; /* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
border-right: 1px solid #ddd;
background-color: #f7f7f7;
white-space: nowrap;
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
white-space: nowrap;
}
.CodeMirror-guttermarker { color: black; }
.CodeMirror-guttermarker-subtle { color: #999; }
/* CURSOR */
.CodeMirror-cursor {
border-left: 1px solid black;
border-right: none;
width: 0;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.cm-fat-cursor .CodeMirror-cursor {
width: auto;
border: 0 !important;
background: #7e7;
}
.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}
.cm-fat-cursor .CodeMirror-line::selection,
.cm-fat-cursor .CodeMirror-line > span::selection,
.cm-fat-cursor .CodeMirror-line > span > span::selection { background: transparent; }
.cm-fat-cursor .CodeMirror-line::-moz-selection,
.cm-fat-cursor .CodeMirror-line > span::-moz-selection,
.cm-fat-cursor .CodeMirror-line > span > span::-moz-selection { background: transparent; }
.cm-fat-cursor { caret-color: transparent; }
@-moz-keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}
@-webkit-keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}
@keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}
/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror-overwrite .CodeMirror-cursor {}
.cm-tab { display: inline-block; text-decoration: inherit; }
.CodeMirror-rulers {
position: absolute;
left: 0; right: 0; top: -50px; bottom: 0;
overflow: hidden;
}
.CodeMirror-ruler {
border-left: 1px solid #ccc;
top: 0; bottom: 0;
position: absolute;
}
/* DEFAULT THEME */
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-strikethrough {text-decoration: line-through;}
.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable,
.cm-s-default .cm-punctuation,
.cm-s-default .cm-property,
.cm-s-default .cm-operator {}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
.cm-s-default .cm-comment {color: #a50;}
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;}
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #30a;}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}
.cm-s-default .cm-error {color: #f00;}
.cm-invalidchar {color: #f00;}
.CodeMirror-composing { border-bottom: 2px solid; }
/* Default styles for common addons */
div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
.CodeMirror-activeline-background {background: #e8f2ff;}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
position: relative;
overflow: hidden;
background: white;
}
.CodeMirror-scroll {
overflow: scroll !important; /* Things will break if this is overridden */
/* 50px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -50px; margin-right: -50px;
padding-bottom: 50px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
z-index: 0;
}
.CodeMirror-sizer {
position: relative;
border-right: 50px solid transparent;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actual scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
outline: none;
}
.CodeMirror-vscrollbar {
right: 0; top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0; left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0; bottom: 0;
}
.CodeMirror-gutter-filler {
left: 0; bottom: 0;
}
.CodeMirror-gutters {
position: absolute; left: 0; top: 0;
min-height: 100%;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
display: inline-block;
vertical-align: top;
margin-bottom: -50px;
}
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
background: none !important;
border: none !important;
}
.CodeMirror-gutter-background {
position: absolute;
top: 0; bottom: 0;
z-index: 4;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper ::selection { background-color: transparent }
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
.CodeMirror-lines {
cursor: text;
min-height: 1px; /* prevents collapsing before first draw */
}
.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
line-height: inherit;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
-webkit-font-variant-ligatures: contextual;
font-variant-ligatures: contextual;
}
.CodeMirror-wrap pre.CodeMirror-line,
.CodeMirror-wrap pre.CodeMirror-line-like {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-linebackground {
position: absolute;
left: 0; right: 0; top: 0; bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
padding: 0.1px; /* Force widget margins to stay inside of the container */
}
.CodeMirror-widget {}
.CodeMirror-rtl pre { direction: rtl; }
.CodeMirror-code {
outline: none;
}
/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.CodeMirror-measure {
position: absolute;
width: 100%;
height: 0;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-cursor {
position: absolute;
pointer-events: none;
}
.CodeMirror-measure pre { position: static; }
div.CodeMirror-cursors {
visibility: hidden;
position: relative;
z-index: 3;
}
div.CodeMirror-dragcursors {
visibility: visible;
}
.CodeMirror-focused div.CodeMirror-cursors {
visibility: visible;
}
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-crosshair { cursor: crosshair; }
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
.cm-searching {
background-color: #ffa;
background-color: rgba(255, 255, 0, .4);
}
/* Used to force a border model for a node */
.cm-force-border { padding-right: .1px; }
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursors {
visibility: hidden;
}
}
/* See issue #2901 */
.cm-tab-wrap-hack:after { content: ''; }
/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext { background: none; }
.CodeMirror-dialog {
position: absolute;
left: 0; right: 0;
background: inherit;
z-index: 15;
padding: .1em .8em;
overflow: hidden;
color: inherit;
}
.CodeMirror-dialog-top {
border-bottom: 1px solid #eee;
top: 0;
}
.CodeMirror-dialog-bottom {
border-top: 1px solid #eee;
bottom: 0;
}
.CodeMirror-dialog input {
border: none;
outline: none;
background: transparent;
width: 20em;
color: inherit;
font-family: monospace;
}
.CodeMirror-dialog button {
font-size: 70%;
}
`,document.head.appendChild(m)}})();