32 lines
222 KiB
JavaScript
32 lines
222 KiB
JavaScript
import{Q as Mu,_ as Ll,g as Tl,a2 as Du,i as Hu,O as pl,x as Eu,P as Wu,o as Ol,c as Nl,r as Fu,a as Nn,b as vl,w as Pu,p as Iu,f as Ru}from"./index.15fc886a.js";var co={exports:{}},gl;function tt(){return gl||(gl=1,function(Oe,Be){(function(m,U){Oe.exports=U()})(Mu,function(){var m=navigator.userAgent,U=navigator.platform,I=/gecko\/\d/i.test(m),G=/MSIE \d/.test(m),M=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(m),w=/Edge\/(\d+)/.exec(m),S=G||M||w,x=S&&(G?document.documentMode||6:+(w||M)[1]),C=!w&&/WebKit\//.test(m),W=C&&/Qt\/\d+\.\d+/.test(m),P=!w&&/Chrome\/(\d+)/.exec(m),j=P&&+P[1],O=/Opera\//.test(m),R=/Apple Computer/.test(navigator.vendor),D=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(m),H=/PhantomJS/.test(m),k=R&&(/Mobile\/\w+/.test(m)||navigator.maxTouchPoints>2),L=/Android/.test(m),B=k||L||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(m),z=k||/Mac/.test(U),q=/\bCrOS\b/.test(m),Q=/win/i.test(U),g=O&&m.match(/Version\/(\d*\.\d*)/);g&&(g=Number(g[1])),g&&g>=15&&(O=!1,C=!0);var F=z&&(W||O&&(g==null||g<12.11)),ne=I||S&&x>=9;function V(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ee=function(e,t){var n=e.className,r=V(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 T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function K(e,t){return T(e).appendChild(t)}function d(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 ce(e,t,n,r){var i=d(e,t,n,r);return i.setAttribute("role","presentation"),i}var be;document.createRange?be=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:be=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{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 we(e){var t;try{t=e.activeElement}catch{t=e.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function Ce(e,t){var n=e.className;V(t).test(n)||(e.className+=(n?" ":"")+t)}function Ft(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!V(n[r]).test(t)&&(t+=" "+n[r]);return t}var lr=function(e){e.select()};k?lr=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:S&&(lr=function(e){try{e.select()}catch{}});function ze(e){return e.display.wrapper.ownerDocument}function Pt(e){return ze(e).defaultView}function rt(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ae(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function ie(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 ue=function(){this.id=null,this.f=null,this.time=0,this.handler=rt(this.onTimeout,this)};ue.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ue.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 de(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var An=50,xe={toString:function(){return"CodeMirror.Pass"}},Ne={scroll:!1},sr={origin:"*mouse"},qt={origin:"+move"};function kt(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 pt=[""];function Lt(e){for(;pt.length<=e;)pt.push(pe(pt)+" ");return pt[e]}function pe(e){return e[e.length-1]}function wr(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Mn(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function Yr(){}function Dn(e,t){var n;return Object.create?n=Object.create(e):(Yr.prototype=e,n=new Yr),t&&ae(t,n),n}var vi=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function qr(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||vi.test(e))}function Sr(e,t){return t?t.source.indexOf("\\w")>-1&&qr(e)?!0:t.test(e):qr(e)}function Hn(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Cr=/[\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 Zr(e){return e.charCodeAt(0)>=768&&Cr.test(e)}function Tt(e,t,n){for(;(n<0?t>0:t<e.length)&&Zr(e.charAt(t));)t+=n;return t}function Me(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 ur(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 Ot=null;function vt(e,t,n){var r;Ot=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:Ot=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:Ot=i)}return r!=null?r:Ot}var gi=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,h,c){this.level=u,this.from=h,this.to=c}return function(u,h){var c=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var b=u.length,y=[],A=0;A<b;++A)y.push(n(u.charCodeAt(A)));for(var E=0,_=c;E<b;++E){var X=y[E];X=="m"?y[E]=_:_=X}for(var J=0,Y=c;J<b;++J){var $=y[J];$=="1"&&Y=="r"?y[J]="n":o.test($)&&(Y=$,$=="r"&&(y[J]="R"))}for(var oe=1,re=y[0];oe<b-1;++oe){var fe=y[oe];fe=="+"&&re=="1"&&y[oe+1]=="1"?y[oe]="1":fe==","&&re==y[oe+1]&&(re=="1"||re=="n")&&(y[oe]=re),re=fe}for(var Se=0;Se<b;++Se){var Ke=y[Se];if(Ke==",")y[Se]="N";else if(Ke=="%"){var Ae=void 0;for(Ae=Se+1;Ae<b&&y[Ae]=="%";++Ae);for(var ht=Se&&y[Se-1]=="!"||Ae<b&&y[Ae]=="1"?"1":"N",at=Se;at<Ae;++at)y[at]=ht;Se=Ae-1}}for(var Fe=0,lt=c;Fe<b;++Fe){var Ye=y[Fe];lt=="L"&&Ye=="1"?y[Fe]="L":o.test(Ye)&&(lt=Ye)}for(var Re=0;Re<b;++Re)if(i.test(y[Re])){var Pe=void 0;for(Pe=Re+1;Pe<b&&i.test(y[Pe]);++Pe);for(var Ee=(Re?y[Re-1]:c)=="L",st=(Pe<b?y[Pe]:c)=="L",Kr=Ee==st?Ee?"L":"R":c,ar=Re;ar<Pe;++ar)y[ar]=Kr;Re=Pe-1}for(var Je=[],Wt,Xe=0;Xe<b;)if(a.test(y[Xe])){var fo=Xe;for(++Xe;Xe<b&&a.test(y[Xe]);++Xe);Je.push(new s(0,fo,Xe))}else{var Yt=Xe,br=Je.length,xr=h=="rtl"?1:0;for(++Xe;Xe<b&&y[Xe]!="L";++Xe);for(var et=Yt;et<Xe;)if(l.test(y[et])){Yt<et&&(Je.splice(br,0,new s(1,Yt,et)),br+=xr);var Xr=et;for(++et;et<Xe&&l.test(y[et]);++et);Je.splice(br,0,new s(2,Xr,et)),br+=xr,Yt=et}else++et;Yt<Xe&&Je.splice(br,0,new s(1,Yt,Xe))}return h=="ltr"&&(Je[0].level==1&&(Wt=u.match(/^\s+/))&&(Je[0].from=Wt[0].length,Je.unshift(new s(0,0,Wt[0].length))),pe(Je).level==1&&(Wt=u.match(/\s+$/))&&(pe(Je).to-=Wt[0].length,Je.push(new s(0,b-Wt[0].length,b)))),h=="rtl"?Je.reverse():Je}}();function gt(e,t){var n=e.order;return n==null&&(n=e.order=gi(e.text,t)),n}var En=[],Z=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 Qr(e,t){return e._handlers&&e._handlers[t]||En}function qe(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=de(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ke(e,t){var n=Qr(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 De(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ke(e,n||t.type,e,t),Jr(t)||t.codemirrorIgnore}function Wn(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)de(n,t[r])==-1&&n.push(t[r])}function je(e,t){return Qr(e,t).length>0}function Ve(e){e.prototype.on=function(t,n){Z(this,t,n)},e.prototype.off=function(t,n){qe(this,t,n)}}function Ze(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function fr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Jr(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function It(e){Ze(e),fr(e)}function nt(e){return e.target||e.srcElement}function jr(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),z&&e.ctrlKey&&t==1&&(t=3),t}var yi=function(){if(S&&x<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),yt;function mi(e){if(yt==null){var t=d("span","\u200B");K(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(S&&x<8))}var n=yt?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var kr;function Fn(e){if(kr!=null)return kr;var t=K(e,document.createTextNode("A\u062EA")),n=be(t,0,1).getBoundingClientRect(),r=be(t,1,2).getBoundingClientRect();return T(e),!n||n.left==n.right?!1:kr=r.right-n.right<3}var Vr=`
|
|
|
|
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/)},Zt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Nt=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),At=null;function Pn(e){if(At!=null)return At;var t=K(e,d("span","x")),n=t.getBoundingClientRect(),r=be(t,0,1).getBoundingClientRect();return At=Math.abs(n.left-r.left)>1}var bt={},Qt={};function In(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),bt[e]=t}function Lr(e,t){Qt[e]=t}function ut(e){if(typeof e=="string"&&Qt.hasOwnProperty(e))e=Qt[e];else if(e&&typeof e.name=="string"&&Qt.hasOwnProperty(e.name)){var t=Qt[e.name];typeof t=="string"&&(t={name:t}),e=Dn(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ut("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ut("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Rt(e,t){t=ut(t);var n=bt[t.name];if(!n)return Rt(e,"text/plain");var r=n(e,t);if(Jt.hasOwnProperty(t.name)){var i=Jt[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 Jt={};function Rn(e,t){var n=Jt.hasOwnProperty(e)?Jt[e]:Jt[e]={};ae(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 jt(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 $r(e,t,n){return e.startState?e.startState(t,n):!0}var He=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};He.prototype.eol=function(){return this.pos>=this.string.length},He.prototype.sol=function(){return this.pos==this.lineStart},He.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},He.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},He.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},He.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},He.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},He.prototype.skipToEnd=function(){this.pos=this.string.length},He.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},He.prototype.backUp=function(e){this.pos-=e},He.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ie(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ie(this.string,this.lineStart,this.tabSize):0)},He.prototype.indentation=function(){return ie(this.string,null,this.tabSize)-(this.lineStart?ie(this.string,this.lineStart,this.tabSize):0)},He.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)}},He.prototype.current=function(){return this.string.slice(this.start,this.pos)},He.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},He.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},He.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function te(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 zt(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 Tr(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function mt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ge(e){if(e.parent==null)return null;for(var t=e.parent,n=de(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 Mt(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 f(e,t){return t>=e.first&&t<e.first+e.size}function p(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function v(e,t,n){if(n===void 0&&(n=null),!(this instanceof v))return new v(e,t,n);this.line=e,this.ch=t,this.sticky=n}function N(e,t){return e.line-t.line||e.ch-t.ch}function le(e,t){return e.sticky==t.sticky&&N(e,t)==0}function he(e){return v(e.line,e.ch)}function ve(e,t){return N(e,t)<0?t:e}function Ie(e,t){return N(e,t)<0?e:t}function ct(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function se(e,t){if(t.line<e.first)return v(e.first,0);var n=e.first+e.size-1;return t.line>n?v(n,te(e,n).text.length):Dl(t,te(e,t.line).text.length)}function Dl(e,t){var n=e.ch;return n==null||n>t?v(e.line,t):n<0?v(e.line,0):e}function go(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=se(e,t[r]);return n}var Bn=function(e,t){this.state=e,this.lookAhead=t},Dt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Dt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Dt.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}},Dt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Dt.fromSaved=function(e,t,n){return t instanceof Bn?new Dt(e,Bt(e.mode,t.state),n,t.lookAhead):new Dt(e,Bt(e.mode,t),n)},Dt.prototype.save=function(e){var t=e!==!1?Bt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Bn(t,this.maxLookAhead):t};function yo(e,t,n,r){var i=[e.state.modeGen],o={};Co(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var a=n.state,l=function(u){n.baseTokens=i;var h=e.state.overlays[u],c=1,b=0;n.state=!0,Co(e,t.text,h.mode,n,function(y,A){for(var E=c;b<y;){var _=i[c];_>y&&i.splice(c,1,y,i[c+1],_),c+=2,b=Math.min(y,_)}if(!!A)if(h.opaque)i.splice(E,c-E,y,"overlay "+A),c=E+2;else for(;E<c;E+=2){var X=i[E+1];i[E+1]=(X?X+" ":"")+"overlay "+A}},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 mo(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=en(e,ge(t)),i=t.text.length>e.options.maxHighlightLength&&Bt(e.doc.mode,r.state),o=yo(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 en(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Dt(r,!0,t);var o=Hl(e,t,n),a=o>r.first&&te(r,o-1).stateAfter,l=a?Dt.fromSaved(r,a,o):new Dt(r,$r(r.mode),o);return r.iter(o,t,function(s){bi(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 bi(e,t,n,r){var i=e.doc.mode,o=new He(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&bo(i,n.state);!o.eol();)xi(i,o,n.state),o.start=o.pos}function bo(e,t){if(e.blankLine)return e.blankLine(t);if(!!e.innerMode){var n=jt(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function xi(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=jt(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 xo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function wo(e,t,n,r){var i=e.doc,o=i.mode,a;t=se(i,t);var l=te(i,t.line),s=en(e,t.line,n),u=new He(l.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,a=xi(o,u,s.state),r&&h.push(new xo(u,a,Bt(i.mode,s.state)));return r?h:new xo(u,a,s.state)}function So(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 Co(e,t,n,r,i,o,a){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,u=null,h=new He(t,e.options.tabSize,r),c,b=e.options.addModeClass&&[null];for(t==""&&So(bo(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(l=!1,a&&bi(e,t,r,h.pos),h.pos=t.length,c=null):c=So(xi(n,h,r.state,b),o),b){var y=b[0].name;y&&(c="m-"+(c?y+" "+c:y))}if(!l||u!=c){for(;s<h.start;)s=Math.min(h.start,s+5e3),i(s,u);u=c}h.start=h.pos}for(;s<h.pos;){var A=Math.min(h.pos,s+5e3);i(A,u),s=A}}function Hl(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=te(o,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof Bn?u.lookAhead:0)<=o.modeFrontier))return l;var h=ie(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=l-1,r=h)}return i}function El(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=te(e,r).stateAfter;if(i&&(!(i instanceof Bn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var ko=!1,_t=!1;function Wl(){ko=!0}function Fl(){_t=!0}function zn(e,t,n){this.marker=e,this.from=t,this.to=n}function tn(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 Il(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 Rl(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 zn(a,o.from,s?null:o.to))}}return r}function Bl(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 zn(a,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function wi(e,t){if(t.full)return null;var n=f(e,t.from.line)&&te(e,t.from.line).markedSpans,r=f(e,t.to.line)&&te(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=N(t.from,t.to)==0,l=Rl(n,i,a),s=Bl(r,o,a),u=t.text.length==1,h=pe(t.text).length+(u?i:0);if(l)for(var c=0;c<l.length;++c){var b=l[c];if(b.to==null){var y=tn(s,b.marker);y?u&&(b.to=y.to==null?null:y.to+h):b.to=i}}if(s)for(var A=0;A<s.length;++A){var E=s[A];if(E.to!=null&&(E.to+=h),E.from==null){var _=tn(l,E.marker);_||(E.from=h,u&&(l||(l=[])).push(E))}else E.from+=h,u&&(l||(l=[])).push(E)}l&&(l=Lo(l)),s&&s!=l&&(s=Lo(s));var X=[l];if(!u){var J=t.text.length-2,Y;if(J>0&&l)for(var $=0;$<l.length;++$)l[$].to==null&&(Y||(Y=[])).push(new zn(l[$].marker,null,null));for(var oe=0;oe<J;++oe)X.push(Y);X.push(s)}return X}function Lo(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 zl(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(y){if(y.markedSpans)for(var A=0;A<y.markedSpans.length;++A){var E=y.markedSpans[A].marker;E.readOnly&&(!r||de(r,E)==-1)&&(r||(r=[])).push(E)}}),!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(!(N(u.to,l.from)<0||N(u.from,l.to)>0)){var h=[s,1],c=N(u.from,l.from),b=N(u.to,l.to);(c<0||!a.inclusiveLeft&&!c)&&h.push({from:u.from,to:l.from}),(b>0||!a.inclusiveRight&&!b)&&h.push({from:l.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function To(e){var t=e.markedSpans;if(!!t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Oo(e,t){if(!!t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function _n(e){return e.inclusiveLeft?-1:0}function Gn(e){return e.inclusiveRight?1:0}function Si(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=N(r.from,i.from)||_n(e)-_n(t);if(o)return-o;var a=N(r.to,i.to)||Gn(e)-Gn(t);return a||t.id-e.id}function No(e,t){var n=_t&&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||Si(r,i.marker)<0)&&(r=i.marker);return r}function Ao(e){return No(e,!0)}function Un(e){return No(e,!1)}function _l(e,t){var n=_t&&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||Si(r,o.marker)<0)&&(r=o.marker)}return r}function Mo(e,t,n,r,i){var o=te(e,t),a=_t&&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),h=N(u.from,n)||_n(s.marker)-_n(i),c=N(u.to,r)||Gn(s.marker)-Gn(i);if(!(h>=0&&c<=0||h<=0&&c>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?N(u.to,n)>=0:N(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?N(u.from,r)<=0:N(u.from,r)<0)))return!0}}}function xt(e){for(var t;t=Ao(e);)e=t.find(-1,!0).line;return e}function Gl(e){for(var t;t=Un(e);)e=t.find(1,!0).line;return e}function Ul(e){for(var t,n;t=Un(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ci(e,t){var n=te(e,t),r=xt(n);return n==r?t:ge(r)}function Do(e,t){if(t>e.lastLine())return t;var n=te(e,t),r;if(!Vt(e,n))return t;for(;r=Un(n);)n=r.find(1,!0).line;return ge(n)+1}function Vt(e,t){var n=_t&&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&&ki(e,t,r))return!0}}}function ki(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return ki(e,r.line,tn(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)&&ki(e,t,i))return!0}function Gt(e){e=xt(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 Kn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Ao(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Un(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 Li(e){var t=e.display,n=e.doc;t.maxLine=te(n,n.first),t.maxLineLength=Kn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Kn(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Or=function(e,t,n){this.text=e,Oo(this,t),this.height=n?n(this):1};Or.prototype.lineNo=function(){return ge(this)},Ve(Or);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),To(e),Oo(e,n);var i=r?r(e):1;i!=e.height&&mt(e,i)}function Xl(e){e.parent=null,To(e)}var Yl={},ql={};function Ho(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ql:Yl;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Eo(e,t){var n=ce("span",null,null,C?"padding-right: .1px":null),r={pre:ce("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=Ql,Fn(e.display.measure)&&(a=gt(o,e.doc.direction))&&(r.addToken=jl(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&ge(o);Vl(o,r,mo(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Ft(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Ft(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(mi(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(C){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 ke(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Ft(r.pre.className,r.textClass||"")),r}function Zl(e){var t=d("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ql(e,t,n,r,i,o,a){if(!!t){var l=e.splitSpaces?Jl(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,h),S&&x<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var c=0;;){s.lastIndex=c;var b=s.exec(t),y=b?b.index-c:t.length-c;if(y){var A=document.createTextNode(l.slice(c,c+y));S&&x<9?h.appendChild(d("span",[A])):h.appendChild(A),e.map.push(e.pos,e.pos+y,A),e.col+=y,e.pos+=y}if(!b)break;c+=y+1;var E=void 0;if(b[0]==" "){var _=e.cm.options.tabSize,X=_-e.col%_;E=h.appendChild(d("span",Lt(X),"cm-tab")),E.setAttribute("role","presentation"),E.setAttribute("cm-text"," "),e.col+=X}else b[0]=="\r"||b[0]==`
|
|
`?(E=h.appendChild(d("span",b[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),E.setAttribute("cm-text",b[0]),e.col+=1):(E=e.cm.options.specialCharPlaceholder(b[0]),E.setAttribute("cm-text",b[0]),S&&x<9?h.appendChild(d("span",[E])):h.appendChild(E),e.col+=1);e.map.push(e.pos,e.pos+1,E),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var J=n||"";r&&(J+=r),i&&(J+=i);var Y=d("span",[h],J,o);if(a)for(var $ in a)a.hasOwnProperty($)&&$!="style"&&$!="class"&&Y.setAttribute($,a[$]);return e.content.appendChild(Y)}e.content.appendChild(h)}}function Jl(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 jl(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,h=u+r.length;;){for(var c=void 0,b=0;b<t.length&&(c=t[b],!(c.to>u&&c.from<=u));b++);if(c.to>=h)return e(n,r,i,o,a,l,s);e(n,r.slice(0,c.to-u),i,o,null,l,s),o=null,r=r.slice(c.to-u),u=c.to}}}function Wo(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 Vl(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]),Ho(n[a+1],t.cm.options));return}for(var l=i.length,s=0,u=1,h="",c,b,y=0,A,E,_,X,J;;){if(y==s){A=E=_=b="",J=null,X=null,y=1/0;for(var Y=[],$=void 0,oe=0;oe<r.length;++oe){var re=r[oe],fe=re.marker;if(fe.type=="bookmark"&&re.from==s&&fe.widgetNode)Y.push(fe);else if(re.from<=s&&(re.to==null||re.to>s||fe.collapsed&&re.to==s&&re.from==s)){if(re.to!=null&&re.to!=s&&y>re.to&&(y=re.to,E=""),fe.className&&(A+=" "+fe.className),fe.css&&(b=(b?b+";":"")+fe.css),fe.startStyle&&re.from==s&&(_+=" "+fe.startStyle),fe.endStyle&&re.to==y&&($||($=[])).push(fe.endStyle,re.to),fe.title&&((J||(J={})).title=fe.title),fe.attributes)for(var Se in fe.attributes)(J||(J={}))[Se]=fe.attributes[Se];fe.collapsed&&(!X||Si(X.marker,fe)<0)&&(X=re)}else re.from>s&&y>re.from&&(y=re.from)}if($)for(var Ke=0;Ke<$.length;Ke+=2)$[Ke+1]==y&&(E+=" "+$[Ke]);if(!X||X.from==s)for(var Ae=0;Ae<Y.length;++Ae)Wo(t,0,Y[Ae]);if(X&&(X.from||0)==s){if(Wo(t,(X.to==null?l+1:X.to)-s,X.marker,X.from==null),X.to==null)return;X.to==s&&(X=!1)}}if(s>=l)break;for(var ht=Math.min(l,y);;){if(h){var at=s+h.length;if(!X){var Fe=at>ht?h.slice(0,ht-s):h;t.addToken(t,Fe,c?c+A:A,_,s+Fe.length==y?E:"",b,J)}if(at>=ht){h=h.slice(ht-s),s=ht;break}s=at,_=""}h=i.slice(o,o=n[u++]),c=Ho(n[u++],t.cm.options)}}}function Fo(e,t,n){this.line=t,this.rest=Ul(t),this.size=this.rest?ge(pe(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Vt(e,t)}function Xn(e,t,n){for(var r=[],i,o=t;o<n;o=i){var a=new Fo(e.doc,te(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Nr=null;function $l(e){Nr?Nr.ops.push(e):e.ownsGroup=Nr={ops:[e],delayedCallbacks:[]}}function es(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 ts(e,t){var n=e.ownsGroup;if(!!n)try{es(n)}finally{Nr=null,t(n)}}var rn=null;function _e(e,t){var n=Qr(e,t);if(!!n.length){var r=Array.prototype.slice.call(arguments,2),i;Nr?i=Nr.delayedCallbacks:rn?i=rn:(i=rn=[],setTimeout(rs,0));for(var o=function(l){i.push(function(){return n[l].apply(null,r)})},a=0;a<n.length;++a)o(a)}}function rs(){var e=rn;rn=null;for(var t=0;t<e.length;++t)e[t]()}function Po(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?is(e,t):o=="gutter"?Ro(e,t,n,r):o=="class"?Ti(e,t):o=="widget"&&os(e,t,r)}t.changes=null}function nn(e){return e.node==e.text&&(e.node=d("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),S&&x<8&&(e.node.style.zIndex=2)),e.node}function ns(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=nn(t);t.background=r.insertBefore(d("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Io(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Eo(e,t)}function is(e,t){var n=t.text.className,r=Io(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,Ti(e,t)):n&&(t.text.className=n)}function Ti(e,t){ns(e,t),t.line.wrapClass?nn(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 Ro(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=nn(t);t.gutterBackground=d("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=nn(t),l=t.gutter=d("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(d("div",p(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,h=o.hasOwnProperty(u)&&o[u];h&&l.appendChild(d("div",[h],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function os(e,t,n){t.alignable&&(t.alignable=null);for(var r=V("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Bo(e,t,n)}function as(e,t,n,r){var i=Io(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Ti(e,t),Ro(e,t,n,r),Bo(e,t,r),t.node}function Bo(e,t,n){if(zo(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)zo(e,t.rest[r],t,n,!1)}function zo(e,t,n,r,i){if(!!t.widgets)for(var o=nn(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],u=d("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),ls(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),_e(s,"redraw")}}function ls(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 on(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;"),K(t.display.measure,d("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Ut(e,t){for(var n=nt(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 Yn(e){return e.lineSpace.offsetTop}function Oi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function _o(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=K(e.measure,d("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 Ht(e){return An-e.display.nativeBarWidth}function hr(e){return e.display.scroller.clientWidth-Ht(e)-e.display.barWidth}function Ni(e){return e.display.scroller.clientHeight-Ht(e)-e.display.barHeight}function ss(e,t,n){var r=e.options.lineWrapping,i=r&&hr(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 Go(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(ge(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function us(e,t){t=xt(t);var n=ge(t),r=e.display.externalMeasured=new Fo(e.doc,t,n);r.lineN=n;var i=r.built=Eo(e,r);return r.text=i.pre,K(e.display.lineMeasure,i.pre),r}function Uo(e,t,n,r){return Et(e,Ar(e,t),n,r)}function Ai(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[pr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Ar(e,t){var n=ge(t),r=Ai(e,n);r&&!r.text?r=null:r&&r.changes&&(Po(e,r,n,Wi(e)),e.curOp.forceUpdate=!0),r||(r=us(e,t));var i=Go(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Et(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||(ss(e,t.view,t.rect),t.hasHeights=!0),a=hs(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 Ko={left:0,right:0,top:0,bottom:0};function Xo(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 fs(e,t){var n=Ko;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 hs(e,t,n,r){var i=Xo(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;a&&Zr(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l<i.coverEnd&&Zr(t.line.text.charAt(i.coverStart+l));)++l;if(S&&x<9&&a==0&&l==i.coverEnd-i.coverStart?u=o.parentNode.getBoundingClientRect():u=fs(be(o,a,l).getClientRects(),r),u.left||u.right||a==0)break;l=a,a=a-1,s="right"}S&&x<11&&(u=cs(e.display.measure,u))}else{a>0&&(s=r="right");var c;e.options.lineWrapping&&(c=o.getClientRects()).length>1?u=c[r=="right"?c.length-1:0]:u=o.getBoundingClientRect()}if(S&&x<9&&!a&&(!u||!u.left&&!u.right)){var b=o.parentNode.getClientRects()[0];b?u={left:b.left,right:b.left+Dr(e.display),top:b.top,bottom:b.bottom}:u=Ko}for(var y=u.top-t.rect.top,A=u.bottom-t.rect.top,E=(y+A)/2,_=t.view.measure.heights,X=0;X<_.length-1&&!(E<_[X]);X++);var J=X?_[X-1]:0,Y=_[X],$={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:J,bottom:Y};return!u.left&&!u.right&&($.bogus=!0),e.options.singleCursorHeightPerLine||($.rtop=y,$.rbottom=A),$}function cs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Pn(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 Yo(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 qo(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Yo(e.display.view[t])}function an(e){qo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Zo(e){return P&&L?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Qo(e){return P&&L?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Mi(e){var t=xt(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=on(n[i]));return r}function qn(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=Gt(t);if(r=="local"?a+=Yn(e.display):a-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+(r=="window"?0:Qo(ze(e)));var s=l.left+(r=="window"?0:Zo(ze(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-=Zo(ze(e)),i-=Qo(ze(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 Zn(e,t,n,r,i){return r||(r=te(e.doc,t.line)),qn(e,r,Uo(e,r,t.ch,i),n)}function wt(e,t,n,r,i,o){r=r||te(e.doc,t.line),i||(i=Ar(e,r));function a(A,E){var _=Et(e,i,A,E?"right":"left",o);return E?_.left=_.right:_.right=_.left,qn(e,r,_,n)}var l=gt(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 h(A,E,_){var X=l[E],J=X.level==1;return a(_?A-1:A,J!=_)}var c=vt(l,s,u),b=Ot,y=h(s,c,u=="before");return b!=null&&(y.other=h(s,b,u!="before")),y}function jo(e,t){var n=0;t=se(e.doc,t),e.options.lineWrapping||(n=Dr(e.display)*t.ch);var r=te(e.doc,t.line),i=Gt(r)+Yn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Di(e,t,n,r,i){var o=v(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Hi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Di(r.first,0,null,-1,-1);var i=Mt(r,n),o=r.first+r.size-1;if(i>o)return Di(r.first+r.size-1,te(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=te(r,i);;){var l=ds(e,a,i,t,n),s=_l(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=te(r,i=u.line)}}function Vo(e,t,n,r){r-=Mi(t);var i=t.text.length,o=Me(function(a){return Et(e,n,a-1).bottom<=r},i,0);return i=Me(function(a){return Et(e,n,a).top>r},o,i),{begin:o,end:i}}function $o(e,t,n,r){n||(n=Ar(e,t));var i=qn(e,t,Et(e,n,r),"line").top;return Vo(e,t,n,i)}function Ei(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function ds(e,t,n,r,i){i-=Gt(t);var o=Ar(e,t),a=Mi(t),l=0,s=t.text.length,u=!0,h=gt(t,e.doc.direction);if(h){var c=(e.options.lineWrapping?vs:ps)(e,t,n,o,h,r,i);u=c.level!=1,l=u?c.from:c.to-1,s=u?c.to:c.from-1}var b=null,y=null,A=Me(function(oe){var re=Et(e,o,oe);return re.top+=a,re.bottom+=a,Ei(re,r,i,!1)?(re.top<=i&&re.left<=r&&(b=oe,y=re),!0):!1},l,s),E,_,X=!1;if(y){var J=r-y.left<y.right-r,Y=J==u;A=b+(Y?0:1),_=Y?"after":"before",E=J?y.left:y.right}else{!u&&(A==s||A==l)&&A++,_=A==0?"after":A==t.text.length?"before":Et(e,o,A-(u?1:0)).bottom+a<=i==u?"after":"before";var $=wt(e,v(n,A,_),"line",t,o);E=$.left,X=i<$.top?-1:i>=$.bottom?1:0}return A=Tt(t.text,A,1),Di(n,A,_,X,r-E)}function ps(e,t,n,r,i,o,a){var l=Me(function(c){var b=i[c],y=b.level!=1;return Ei(wt(e,v(n,y?b.to:b.from,y?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,h=wt(e,v(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Ei(h,o,a,!0)&&h.top>a&&(s=i[l-1])}return s}function vs(e,t,n,r,i,o,a){var l=Vo(e,t,r,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,c=null,b=0;b<i.length;b++){var y=i[b];if(!(y.from>=u||y.to<=s)){var A=y.level!=1,E=Et(e,r,A?Math.min(u,y.to)-1:Math.max(s,y.from)).right,_=E<o?o-E+1e9:E-o;(!h||c>_)&&(h=y,c=_)}}return h||(h=i[i.length-1]),h.from<s&&(h={from:s,to:h.to,level:h.level}),h.to>u&&(h={from:h.from,to:u,level:h.level}),h}var cr;function Mr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(cr==null){cr=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)cr.appendChild(document.createTextNode("x")),cr.appendChild(d("br"));cr.appendChild(document.createTextNode("x"))}K(e.measure,cr);var n=cr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function Dr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),n=d("pre",[t],"CodeMirror-line-like");K(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Wi(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:Fi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Fi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ea(e){var t=Mr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Dr(e.display)-3);return function(i){if(Vt(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 Pi(e){var t=e.doc,n=ea(e);t.iter(function(r){var i=n(r);i!=r.height&&mt(r,i)})}function dr(e,t,n,r){var i=e.display;if(!n&&nt(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{return null}var s=Hi(e,o,a),u;if(r&&s.xRel>0&&(u=te(e.doc,s.line).text).length==s.ch){var h=ie(u,u.length,e.options.tabSize)-u.length;s=v(s.line,Math.max(0,Math.round((o-_o(e.display).left)/Dr(e.display))-h))}return s}function pr(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 it(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)_t&&Ci(e.doc,t)<i.viewTo&&er(e);else if(n<=i.viewFrom)_t&&Do(e.doc,n+r)>i.viewFrom?er(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)er(e);else if(t<=i.viewFrom){var o=Qn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):er(e)}else if(n>=i.viewTo){var a=Qn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):er(e)}else{var l=Qn(e,t,t,-1),s=Qn(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Xn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):er(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function $t(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[pr(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);de(a,n)==-1&&a.push(n)}}}function er(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,n,r){var i=pr(e,t),o,a=e.display.view;if(!_t||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(;Ci(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 gs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Xn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Xn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(pr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Xn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,pr(e,n)))),r.viewTo=n}function ta(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 ln(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ra(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 h=a(e,s);h&&Ii(e,h,i)}else(u||e.options.showCursorWhenSelecting)&&Ii(e,s.head,i);u||ys(e,s,o)}}return r}function Ii(e,t,n){var r=wt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(d("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=Zn(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(d("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 Jn(e,t){return e.top-t.top||e.left-t.left}function ys(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=_o(e.display),l=a.left,s=Math.max(r.sizerWidth,hr(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function h(Y,$,oe,re){$<0&&($=0),$=Math.round($),re=Math.round(re),o.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+Y+`px;
|
|
top: `+$+"px; width: "+(oe==null?s-Y:oe)+`px;
|
|
height: `+(re-$)+"px"))}function c(Y,$,oe){var re=te(i,Y),fe=re.text.length,Se,Ke;function Ae(Fe,lt){return Zn(e,v(Y,Fe),"div",re,lt)}function ht(Fe,lt,Ye){var Re=$o(e,re,null,Fe),Pe=lt=="ltr"==(Ye=="after")?"left":"right",Ee=Ye=="after"?Re.begin:Re.end-(/\s/.test(re.text.charAt(Re.end-1))?2:1);return Ae(Ee,Pe)[Pe]}var at=gt(re,i.direction);return ur(at,$||0,oe==null?fe:oe,function(Fe,lt,Ye,Re){var Pe=Ye=="ltr",Ee=Ae(Fe,Pe?"left":"right"),st=Ae(lt-1,Pe?"right":"left"),Kr=$==null&&Fe==0,ar=oe==null&<==fe,Je=Re==0,Wt=!at||Re==at.length-1;if(st.top-Ee.top<=3){var Xe=(u?Kr:ar)&&Je,fo=(u?ar:Kr)&&Wt,Yt=Xe?l:(Pe?Ee:st).left,br=fo?s:(Pe?st:Ee).right;h(Yt,Ee.top,br-Yt,Ee.bottom)}else{var xr,et,Xr,ho;Pe?(xr=u&&Kr&&Je?l:Ee.left,et=u?s:ht(Fe,Ye,"before"),Xr=u?l:ht(lt,Ye,"after"),ho=u&&ar&&Wt?s:st.right):(xr=u?ht(Fe,Ye,"before"):l,et=!u&&Kr&&Je?s:Ee.right,Xr=!u&&ar&&Wt?l:st.left,ho=u?ht(lt,Ye,"after"):s),h(xr,Ee.top,et-xr,Ee.bottom),Ee.bottom<st.top&&h(l,Ee.bottom,null,st.top),h(Xr,st.top,ho-Xr,st.bottom)}(!Se||Jn(Ee,Se)<0)&&(Se=Ee),Jn(st,Se)<0&&(Se=st),(!Ke||Jn(Ee,Ke)<0)&&(Ke=Ee),Jn(st,Ke)<0&&(Ke=st)}),{start:Se,end:Ke}}var b=t.from(),y=t.to();if(b.line==y.line)c(b.line,b.ch,y.ch);else{var A=te(i,b.line),E=te(i,y.line),_=xt(A)==xt(E),X=c(b.line,b.ch,_?A.text.length+1:null).end,J=c(y.line,_?0:null,y.ch).start;_&&(X.top<J.top-2?(h(X.right,X.top,null,X.bottom),h(l,J.top,J.left,J.bottom)):h(X.right,X.top,J.left-X.right,X.bottom)),X.bottom<J.top&&h(l,X.bottom,null,J.top)}n.appendChild(o)}function Ri(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()||Hr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function na(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||zi(e))}function Bi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Hr(e))},100)}function zi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,Ce(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),C&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ri(e))}function Hr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,ee(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function jn(e){for(var t=e.display,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,h=0;if(!l.hidden){if(i+=l.line.height,S&&x<8){var c=l.node.offsetTop+l.node.offsetHeight;u=c-n,n=c}else{var b=l.node.getBoundingClientRect();u=b.bottom-b.top,!s&&l.text.firstChild&&(h=l.text.firstChild.getBoundingClientRect().right-b.left-1)}var y=l.line.height-u;if((y>.005||y<-.005)&&(i<r&&(o-=y),mt(l.line,u),ia(l.line),l.rest))for(var A=0;A<l.rest.length;A++)ia(l.rest[A]);if(h>e.display.sizerWidth){var E=Math.ceil(h/Dr(e.display));E>e.display.maxLineLength&&(e.display.maxLineLength=E,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ia(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 Vn(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Yn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=Mt(t,r),a=Mt(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=Mt(t,Gt(te(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=Mt(t,Gt(te(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function ms(e,t){if(!De(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&&!H){var a=d("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-Yn(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Ht(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 bs(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?v(t.line,t.ch+1,"before"):t,t=t.ch?v(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=_i(e,i),h=e.doc.scrollTop,c=e.doc.scrollLeft;if(u.scrollTop!=null&&(un(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(a=!0)),u.scrollLeft!=null&&(vr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(a=!0)),!a)break}return i}function xs(e,t){var n=_i(e,t);n.scrollTop!=null&&un(e,n.scrollTop),n.scrollLeft!=null&&vr(e,n.scrollLeft)}function _i(e,t){var n=e.display,r=Mr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Ni(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Oi(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 h=Math.min(t.top,(u?l:t.bottom)-o);h!=i&&(a.scrollTop=h)}var c=e.options.fixedGutter?0:n.gutters.offsetWidth,b=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-c,y=hr(e)-n.gutters.offsetWidth,A=t.right-t.left>y;return A&&(t.right=t.left+y),t.left<10?a.scrollLeft=0:t.left<b?a.scrollLeft=Math.max(0,t.left+c-(A?0:10)):t.right>y+b-3&&(a.scrollLeft=t.right+(A?0:10)-y),a}function Gi(e,t){t!=null&&($n(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Er(e){$n(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function sn(e,t,n){(t!=null||n!=null)&&$n(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function ws(e,t){$n(e),e.curOp.scrollToPos=t}function $n(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=jo(e,t.from),r=jo(e,t.to);oa(e,n,r,t.margin)}}function oa(e,t,n,r){var i=_i(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});sn(e,i.scrollLeft,i.scrollTop)}function un(e,t){Math.abs(e.doc.scrollTop-t)<2||(I||Ki(e,{top:t}),aa(e,t,!0),I&&Ki(e),cn(e,100))}function aa(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 vr(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,ha(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function fn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Oi(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+Ht(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var gr=function(e,t,n){this.cm=n;var r=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Z(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Z(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,S&&x<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};gr.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}},gr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gr.prototype.zeroWidthHack=function(){var e=z&&!D?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new ue,this.disableVert=new ue},gr.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)},gr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var hn=function(){};hn.prototype.update=function(){return{bottom:0,right:0}},hn.prototype.setScrollLeft=function(){},hn.prototype.setScrollTop=function(){},hn.prototype.clear=function(){};function Wr(e,t){t||(t=fn(e));var n=e.display.barWidth,r=e.display.barHeight;la(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&jn(e),la(e,fn(e)),n=e.display.barWidth,r=e.display.barHeight}function la(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 sa={native:gr,null:hn};function ua(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ee(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new sa[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Z(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"?vr(e,t):un(e,t)},e),e.display.scrollbars.addClass&&Ce(e.display.wrapper,e.display.scrollbars.addClass)}var Ss=0;function yr(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:++Ss,markArrays:null},$l(e.curOp)}function mr(e){var t=e.curOp;t&&ts(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;Cs(n)})}function Cs(e){for(var t=e.ops,n=0;n<t.length;n++)ks(t[n]);for(var r=0;r<t.length;r++)Ls(t[r]);for(var i=0;i<t.length;i++)Ts(t[i]);for(var o=0;o<t.length;o++)Os(t[o]);for(var a=0;a<t.length;a++)Ns(t[a])}function ks(e){var t=e.cm,n=t.display;Ms(t),e.updateMaxLine&&Li(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 ei(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ls(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function Ts(e){var t=e.cm,n=t.display;e.updatedDisplay&&jn(t),e.barMeasure=fn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Uo(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+Ht(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-hr(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&&vr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==we(ze(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Wr(t,e.barMeasure),e.updatedDisplay&&Yi(t,e.barMeasure),e.selectionChanged&&Ri(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&na(e.cm)}function Ns(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&fa(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&aa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&vr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=bs(t,se(r,e.scrollToPos.from),se(r,e.scrollToPos.to),e.scrollToPos.margin);ms(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||ke(o[l],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&ke(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ke(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ft(e,t){if(e.curOp)return t();yr(e);try{return t()}finally{mr(e)}}function Ge(e,t){return function(){if(e.curOp)return t.apply(e,arguments);yr(e);try{return t.apply(e,arguments)}finally{mr(e)}}}function $e(e){return function(){if(this.curOp)return e.apply(this,arguments);yr(this);try{return e.apply(this,arguments)}finally{mr(this)}}}function Ue(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);yr(t);try{return e.apply(this,arguments)}finally{mr(t)}}}function cn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,rt(As,e))}function As(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=en(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=yo(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var u=o.styleClasses,h=s.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var c=!a||a.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),b=0;!c&&b<a.length;++b)c=a[b]!=o.styles[b];c&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&bi(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return cn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&ft(e,function(){for(var o=0;o<i.length;o++)$t(e,i[o],"text")})}}var ei=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Vn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=hr(e),this.force=n,this.dims=Wi(e),this.events=[]};ei.prototype.signal=function(e,t){je(e,t)&&this.events.push(arguments)},ei.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ke.apply(null,this.events[e])};function Ms(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ht(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ht(e)+"px",t.scrollbarsClipped=!0)}function Ds(e){if(e.hasFocus())return null;var t=we(ze(e));if(!t||!Le(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=Pt(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 Hs(e){if(!(!e||!e.activeElt||e.activeElt==we(e.activeElt.ownerDocument))&&(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 Ui(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return er(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&&ta(e)==0)return!1;ca(e)&&(er(e),t.dims=Wi(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)),_t&&(o=Ci(e.doc,o),a=Do(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;gs(e,o,a),n.viewOffset=Gt(te(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=ta(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=Ds(e);return s>4&&(n.lineDiv.style.display="none"),Es(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Hs(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,cn(e,400)),n.updateLineNumbers=null,!0}function fa(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==hr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Oi(e.display)-Ni(e),n.top)}),t.visible=Vn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vn(e.display,e.doc,n));if(!Ui(e,t))break;jn(e);var i=fn(e);ln(e),Wr(e,i),Yi(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 ei(e,t);if(Ui(e,n)){jn(e),fa(e,n);var r=fn(e);ln(e),Wr(e,r),Yi(e,r),n.finish()}}function Es(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(A){var E=A.nextSibling;return C&&z&&e.display.currentWheelTarget==A?A.style.display="none":A.parentNode.removeChild(A),E}for(var s=r.view,u=r.viewFrom,h=0;h<s.length;h++){var c=s[h];if(!c.hidden)if(!c.node||c.node.parentNode!=o){var b=as(e,c,u,n);o.insertBefore(b,a)}else{for(;a!=c.node;)a=l(a);var y=i&&t!=null&&t<=u&&c.lineNumber;c.changes&&(de(c.changes,"gutter")>-1&&(y=!1),Po(e,c,u,n)),y&&(T(c.lineNumber),c.lineNumber.appendChild(document.createTextNode(p(e.options,u)))),a=c.node.nextSibling}u+=c.size}for(;a;)a=l(a)}function Xi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",_e(e,"gutterChanged",e)}function Yi(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+Ht(e)+"px"}function ha(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Fi(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 ca(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=p(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(d("div",[d("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",Xi(e.display),!0}return!1}function qi(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 da(e){var t=e.gutters,n=e.gutterSpecs;T(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(d("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",Xi(e)}function dn(e){da(e.display),it(e),ha(e)}function Ws(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=d("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=d("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=ce("div",null,"CodeMirror-code"),i.selectionDiv=d("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=d("div",null,"CodeMirror-cursors"),i.measure=d("div",null,"CodeMirror-measure"),i.lineMeasure=d("div",null,"CodeMirror-measure"),i.lineSpace=ce("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=ce("div",[i.lineSpace],"CodeMirror-lines");i.mover=d("div",[o],null,"position: relative"),i.sizer=d("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=d("div",null,null,"position: absolute; height: "+An+"px; width: 1px;"),i.gutters=d("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=d("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=d("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),P&&j>=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),S&&x<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!C&&!(I&&B)&&(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=qi(r.gutters,r.lineNumbers),da(i),n.init(i)}var ti=0,Kt=null;S?Kt=-.53:I?Kt=15:P?Kt=-.7:R&&(Kt=-1/3);function pa(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 Fs(e){var t=pa(e);return t.x*=Kt,t.y*=Kt,t}function va(e,t){P&&j==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=pa(t),r=n.x,i=n.y,o=Kt;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&&z&&C){e:for(var h=t.target,c=a.view;h!=l;h=h.parentNode)for(var b=0;b<c.length;b++)if(c[b].node==h){e.display.currentWheelTarget=h;break e}}if(r&&!I&&!O&&o!=null){i&&u&&un(e,Math.max(0,l.scrollTop+i*o)),vr(e,Math.max(0,l.scrollLeft+r*o)),(!i||i&&u)&&Ze(t),a.wheelStartX=null;return}if(i&&o!=null){var y=i*o,A=e.doc.scrollTop,E=A+a.wrapper.clientHeight;y<0?A=Math.max(0,A+y-50):E=Math.min(e.doc.height,E+y+50),Ki(e,{top:A,bottom:E})}ti<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 _=l.scrollLeft-a.wheelStartX,X=l.scrollTop-a.wheelStartY,J=X&&a.wheelDY&&X/a.wheelDY||_&&a.wheelDX&&_/a.wheelDX;a.wheelStartX=a.wheelStartY=null,J&&(Kt=(Kt*ti+J)/(ti+1),++ti)}},200)):(a.wheelDX+=r,a.wheelDY+=i))}}var dt=function(e,t){this.ranges=e,this.primIndex=t};dt.prototype.primary=function(){return this.ranges[this.primIndex]},dt.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(!le(n.anchor,r.anchor)||!le(n.head,r.head))return!1}return!0},dt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new ye(he(this.ranges[t].anchor),he(this.ranges[t].head));return new dt(e,this.primIndex)},dt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},dt.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(N(t,r.from())>=0&&N(e,r.to())<=0)return n}return-1};var ye=function(e,t){this.anchor=e,this.head=t};ye.prototype.from=function(){return Ie(this.anchor,this.head)},ye.prototype.to=function(){return ve(this.anchor,this.head)},ye.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function St(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(b,y){return N(b.from(),y.from())}),n=de(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=N(l.to(),a.from());if(r&&!a.empty()?s>0:s>=0){var u=Ie(l.from(),a.from()),h=ve(l.to(),a.to()),c=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new ye(c?h:u,c?u:h))}}return new dt(t,n)}function tr(e,t){return new dt([new ye(e,t||e)],0)}function rr(e){return e.text?v(e.from.line+e.text.length-1,pe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ga(e,t){if(N(e,t.from)<0)return e;if(N(e,t.to)<=0)return rr(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+=rr(t).ch-t.to.ch),v(n,r)}function Zi(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new ye(ga(i.anchor,t),ga(i.head,t)))}return St(e.cm,n,e.sel.primIndex)}function ya(e,t,n){return e.line==t.line?v(n.line,e.ch-t.ch+n.ch):v(n.line+(e.line-t.line),e.ch)}function Ps(e,t,n){for(var r=[],i=v(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=ya(l.from,i,o),u=ya(rr(l),i,o);if(i=l.to,o=u,n=="around"){var h=e.sel.ranges[a],c=N(h.head,h.anchor)<0;r[a]=new ye(c?u:s,c?s:u)}else r[a]=new ye(s,s)}return new dt(r,e.sel.primIndex)}function Qi(e){e.doc.mode=Rt(e.options,e.doc.modeOption),pn(e)}function pn(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,cn(e,100),e.state.modeGen++,e.curOp&&it(e)}function ma(e,t){return t.from.ch==0&&t.to.ch==0&&pe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ji(e,t,n,r){function i(J){return n?n[J]:null}function o(J,Y,$){Kl(J,Y,$,r),_e(J,"change",J,t)}function a(J,Y){for(var $=[],oe=J;oe<Y;++oe)$.push(new Or(u[oe],i(oe),r));return $}var l=t.from,s=t.to,u=t.text,h=te(e,l.line),c=te(e,s.line),b=pe(u),y=i(u.length-1),A=s.line-l.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(ma(e,t)){var E=a(0,u.length-1);o(c,c.text,y),A&&e.remove(l.line,A),E.length&&e.insert(l.line,E)}else if(h==c)if(u.length==1)o(h,h.text.slice(0,l.ch)+b+h.text.slice(s.ch),y);else{var _=a(1,u.length-1);_.push(new Or(b+h.text.slice(s.ch),y,r)),o(h,h.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,_)}else if(u.length==1)o(h,h.text.slice(0,l.ch)+u[0]+c.text.slice(s.ch),i(0)),e.remove(l.line+1,A);else{o(h,h.text.slice(0,l.ch)+u[0],i(0)),o(c,b+c.text.slice(s.ch),y);var X=a(1,u.length-1);A>1&&e.remove(l.line+1,A-1),e.insert(l.line+1,X)}_e(e,"change",e,t)}function nr(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 ba(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Pi(e),Qi(e),xa(e),e.options.direction=t.direction,e.options.lineWrapping||Li(e),e.options.mode=t.modeOption,it(e)}function xa(e){(e.doc.direction=="rtl"?Ce:ee)(e.display.lineDiv,"CodeMirror-rtl")}function Is(e){ft(e,function(){xa(e),it(e)})}function ri(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 ji(e,t){var n={from:he(t.from),to:rr(t),text:zt(e,t.from,t.to)};return Ca(e,n,t.from.line,t.to.line+1),nr(e,function(r){return Ca(r,n,t.from.line,t.to.line+1)},!0),n}function wa(e){for(;e.length;){var t=pe(e);if(t.ranges)e.pop();else break}}function Rs(e,t){if(t)return wa(e.done),pe(e.done);if(e.done.length&&!pe(e.done).ranges)return pe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),pe(e.done)}function Sa(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=Rs(i,i.lastOp==r)))l=pe(a.changes),N(t.from,t.to)==0&&N(t.from,l.to)==0?l.to=rr(t):a.changes.push(ji(e,t));else{var s=pe(i.done);for((!s||!s.ranges)&&ni(e.sel,i.done),a={changes:[ji(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||ke(e,"historyAdded")}function Bs(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 zs(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||Bs(e,o,pe(i.done),t))?i.done[i.done.length-1]=t:ni(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&wa(i.undone)}function ni(e,t){var n=pe(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ca(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 _s(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 Gs(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(_s(n[i]));return r}function ka(e,t){var n=Gs(e,t),r=wi(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 Fr(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?dt.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],h=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var c in u)(h=c.match(/^spans_(\d+)$/))&&de(t,Number(h[1]))>-1&&(pe(l)[c]=u[c],delete u[c])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=N(t,i)<0;o!=N(n,i)<0?(i=t,t=n):o!=N(t,n)<0&&(t=n)}return new ye(i,t)}else return new ye(n||t,t)}function ii(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qe(e,new dt([Vi(e.sel.primary(),t,n,i)],0),r)}function La(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]=Vi(e.sel.ranges[o],t[o],null,i);var a=St(e.cm,r,e.sel.primIndex);Qe(e,a,n)}function $i(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Qe(e,St(e.cm,i,e.sel.primIndex),r)}function Ta(e,t,n,r){Qe(e,tr(t,n),r)}function Us(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 ye(se(e,i[o].anchor),se(e,i[o].head))},origin:n&&n.origin};return ke(e,"beforeSelectionChange",e,r),e.cm&&ke(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?St(e.cm,r.ranges,r.ranges.length-1):t}function Oa(e,t,n){var r=e.history.done,i=pe(r);i&&i.ranges?(r[r.length-1]=t,oi(e,t,n)):Qe(e,t,n)}function Qe(e,t,n){oi(e,t,n),zs(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function oi(e,t,n){(je(e,"beforeSelectionChange")||e.cm&&je(e.cm,"beforeSelectionChange"))&&(t=Us(e,t,n));var r=n&&n.bias||(N(t.primary().head,e.sel.primary().head)<0?-1:1);Na(e,Ma(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Er(e.cm)}function Na(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Wn(e.cm)),_e(e,"cursorActivity",e))}function Aa(e){Na(e,Ma(e,e.sel,null,!1))}function Ma(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=ai(e,a.anchor,l&&l.anchor,n,r),u=a.head==a.anchor?s:ai(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 ye(s,u))}return i?St(e.cm,i,t.primIndex):t}function Pr(e,t,n,r,i){var o=te(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,h="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(u?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(h?l.to>=t.ch:l.to>t.ch))){if(i&&(ke(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var c=s.find(r<0?1:-1),b=void 0;if((r<0?h:u)&&(c=Da(e,c,-r,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(b=N(c,n))&&(r<0?b<0:b>0))return Pr(e,c,t,r,i)}var y=s.find(r<0?-1:1);return(r<0?u:h)&&(y=Da(e,y,r,y.line==t.line?o:null)),y?Pr(e,y,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,a=Pr(e,t,n,o,i)||!i&&Pr(e,t,n,o,!0)||Pr(e,t,n,-o,i)||!i&&Pr(e,t,n,-o,!0);return a||(e.cantEdit=!0,v(e.first,0))}function Da(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?se(e,v(t.line-1)):null:n>0&&t.ch==(r||te(e,t.line)).text.length?t.line<e.first+e.size-1?v(t.line+1,0):null:new v(t.line,t.ch+n)}function Ha(e){e.setSelection(v(e.firstLine(),0),v(e.lastLine()),Ne)}function Ea(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=se(e,i)),o&&(r.to=se(e,o)),a&&(r.text=a),l!==void 0&&(r.origin=l)}),ke(e,"beforeChange",e,r),e.cm&&ke(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 Ir(e,t,n){if(e.cm){if(!e.cm.curOp)return Ge(e.cm,Ir)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((je(e,"beforeChange")||e.cm&&je(e.cm,"beforeChange"))&&(t=Ea(e,t,!0),!t))){var r=ko&&!n&&zl(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Wa(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Wa(e,t)}}function Wa(e,t){if(!(t.text.length==1&&t.text[0]==""&&N(t.from,t.to)==0)){var n=Zi(e,t);Sa(e,t,n,e.cm?e.cm.curOp.id:NaN),vn(e,t,n,wi(e,t));var r=[];nr(e,function(i,o){!o&&de(r,i.history)==-1&&(Ra(i.history,t),r.push(i.history)),vn(i,t,null,wi(i,t))})}}function li(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(ni(o,s),n&&!o.equals(e.sel)){Qe(e,o,{clearRedo:!1});return}a=o}else if(r){l.push(o);return}else break;var h=[];ni(a,s),s.push({changes:h,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var c=je(e,"beforeChange")||e.cm&&je(e.cm,"beforeChange"),b=function(E){var _=o.changes[E];if(_.origin=t,c&&!Ea(e,_,!1))return l.length=0,{};h.push(ji(e,_));var X=E?Zi(e,_):pe(l);vn(e,_,X,ka(e,_)),!E&&e.cm&&e.cm.scrollIntoView({from:_.from,to:rr(_)});var J=[];nr(e,function(Y,$){!$&&de(J,Y.history)==-1&&(Ra(Y.history,_),J.push(Y.history)),vn(Y,_,null,ka(Y,_))})},y=o.changes.length-1;y>=0;--y){var A=b(y);if(A)return A.v}}}}function Fa(e,t){if(t!=0&&(e.first+=t,e.sel=new dt(wr(e.sel.ranges,function(i){return new ye(v(i.anchor.line+t,i.anchor.ch),v(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){it(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)$t(e.cm,r,"gutter")}}function vn(e,t,n,r){if(e.cm&&!e.cm.curOp)return Ge(e.cm,vn)(e,t,n,r);if(t.to.line<e.first){Fa(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);Fa(e,i),t={from:v(e.first,0),to:v(t.to.line+i,t.to.ch),text:[pe(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:v(o,te(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=zt(e,t.from,t.to),n||(n=Zi(e,t)),e.cm?Ks(e.cm,t,r):Ji(e,t,r),oi(e,n,Ne),e.cantEdit&&ai(e,v(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=ge(xt(te(r,o.line))),r.iter(s,a.line+1,function(y){if(y==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Wn(e),Ji(r,t,n,ea(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(y){var A=Kn(y);A>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=A,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),El(r,o.line),cn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?it(e):o.line==a.line&&t.text.length==1&&!ma(e.doc,t)?$t(e,o.line,"text"):it(e,o.line,a.line+1,u);var h=je(e,"changes"),c=je(e,"change");if(c||h){var b={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};c&&_e(e,"change",e,b),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(b)}e.display.selForContextMenu=null}function Rr(e,t,n,r,i){var o;r||(r=n),N(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Ir(e,{from:n,to:r,text:t,origin:i})}function Pa(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ia(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++)Pa(o.ranges[l].anchor,t,n,r),Pa(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=v(u.from.line+r,u.from.ch),u.to=v(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 Ra(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Ia(e.done,n,r,i),Ia(e.undone,n,r,i)}function gn(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=te(e,ct(e,t)):i=ge(t),i==null?null:(r(o,i)&&e.cm&&$t(e.cm,i,n),o)}function yn(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}yn.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,Xl(i),_e(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 mn(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}mn.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 yn))){var l=[];this.collapse(l),this.children=[new yn(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 yn(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 mn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=de(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new mn(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 bn=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};bn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ge(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=on(this);mt(n,Math.max(0,n.height-o)),e&&(ft(e,function(){Ba(e,n,-o),$t(e,r,"widget")}),_e(e,"lineWidgetCleared",e,this,r))}},bn.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=on(this)-t;!i||(Vt(this.doc,r)||mt(r,r.height+i),n&&ft(n,function(){n.curOp.forceUpdate=!0,Ba(n,r,i),_e(n,"lineWidgetChanged",n,e,ge(r))}))},Ve(bn);function Ba(e,t,n){Gt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Gi(e,n)}function Xs(e,t,n,r){var i=new bn(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),gn(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&&!Vt(e,a)){var s=Gt(a)<e.scrollTop;mt(a,a.height+on(i)),s&&Gi(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&_e(o,"lineWidgetAdded",o,i,typeof t=="number"?t:ge(t)),i}var za=0,ir=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++za};ir.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&yr(e),je(this,"clear")){var n=this.find();n&&_e(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=tn(a.markedSpans,this);e&&!this.collapsed?$t(e,ge(a),"text"):e&&(l.to!=null&&(i=ge(a)),l.from!=null&&(r=ge(a))),a.markedSpans=Pl(a.markedSpans,l),l.from==null&&this.collapsed&&!Vt(this.doc,a)&&e&&mt(a,Mr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=xt(this.lines[s]),h=Kn(u);h>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&it(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Aa(e.doc)),e&&_e(e,"markerCleared",e,this,r,i),t&&mr(e),this.parent&&this.parent.clear()}},ir.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=tn(o.markedSpans,this);if(a.from!=null&&(n=v(t?o:ge(o),a.from),e==-1))return n;if(a.to!=null&&(r=v(t?o:ge(o),a.to),e==1))return r}return n&&{from:n,to:r}},ir.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||ft(r,function(){var i=t.line,o=ge(t.line),a=Ai(r,o);if(a&&(Yo(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Vt(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=on(n)-l;s&&mt(i,i.height+s)}_e(r,"markerChanged",r,e)})},ir.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||de(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ir.prototype.detachLine=function(e){if(this.lines.splice(de(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ve(ir);function Br(e,t,n,r,i){if(r&&r.shared)return Ys(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Ge(e.cm,Br)(e,t,n,r,i);var o=new ir(e,i),a=N(t,n);if(r&&ae(r,o,!1),a>0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=ce("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Mo(e,t.line,t,n,o)||t.line!=n.line&&Mo(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Fl()}o.addToHistory&&Sa(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(c){s&&o.collapsed&&!s.options.lineWrapping&&xt(c)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&mt(c,0),Il(c,new zn(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(c){Vt(e,c)&&mt(c,0)}),o.clearOnEnter&&Z(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Wl(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++za,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)it(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)$t(s,h,"text");o.atomic&&Aa(s.doc),_e(s,"markerAdded",s,o)}return o}var xn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};xn.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();_e(this,"clear")}},xn.prototype.find=function(e,t){return this.primary.find(e,t)},Ve(xn);function Ys(e,t,n,r,i){r=ae(r),r.shared=!1;var o=[Br(e,t,n,r,i)],a=o[0],l=r.widgetNode;return nr(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Br(s,se(s,t),se(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;a=pe(o)}),new xn(o,a)}function _a(e){return e.findMarks(v(e.first,0),e.clipPos(v(e.lastLine())),function(t){return t.parent})}function qs(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(N(o,a)){var l=Br(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Zs(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];nr(i.primary.doc,function(s){return o.push(s)});for(var a=0;a<i.markers.length;a++){var l=i.markers[a];de(o,l.doc)==-1&&(l.parent=null,i.markers.splice(a--,1))}},n=0;n<e.length;n++)t(n)}var Qs=0,ot=function(e,t,n,r,i){if(!(this instanceof ot))return new ot(e,t,n,r,i);n==null&&(n=0),mn.call(this,[new yn([new Or("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=v(n,0);this.sel=tr(o),this.history=new ri(null),this.id=++Qs,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ji(this,{from:o,to:o,text:e}),Qe(this,tr(o),Ne)};ot.prototype=Dn(mn.prototype,{constructor:ot,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=Tr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Ue(function(e){var t=v(this.first,0),n=this.first+this.size-1;Ir(this,{from:t,to:v(n,te(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&sn(this.cm,0,0),Qe(this,tr(t),Ne)}),replaceRange:function(e,t,n,r){t=se(this,t),n=n?se(this,n):t,Rr(this,e,t,n,r)},getRange:function(e,t,n){var r=zt(this,se(this,e),se(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(f(this,e))return te(this,e)},getLineNumber:function(e){return ge(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=te(this,e)),xt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return se(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:Ue(function(e,t,n){Ta(this,se(this,typeof e=="number"?v(e,t||0):e),null,n)}),setSelection:Ue(function(e,t,n){Ta(this,se(this,e),se(this,t||e),n)}),extendSelection:Ue(function(e,t,n){ii(this,se(this,e),t&&se(this,t),n)}),extendSelections:Ue(function(e,t){La(this,go(this,e),t)}),extendSelectionsBy:Ue(function(e,t){var n=wr(this.sel.ranges,e);La(this,go(this,n),t)}),setSelections:Ue(function(e,t,n){if(!!e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new ye(se(this,e[i].anchor),se(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Qe(this,St(this.cm,r,t),n)}}),addSelection:Ue(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new ye(se(this,e),se(this,t||e))),Qe(this,St(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=zt(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=zt(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:Ue(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--)Ir(this,r[s]);l?Oa(this,l):this.cm&&Er(this.cm)}),undo:Ue(function(){li(this,"undo")}),redo:Ue(function(){li(this,"redo")}),undoSelection:Ue(function(){li(this,"undo",!0)}),redoSelection:Ue(function(){li(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 ri(this.history),nr(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:Fr(this.history.done),undone:Fr(this.history.undone)}},setHistory:function(e){var t=this.history=new ri(this.history);t.done=Fr(e.done.slice(0),null,!0),t.undone=Fr(e.undone.slice(0),null,!0)},setGutterMarker:Ue(function(e,t,n){return gn(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&Hn(i)&&(r.gutterMarkers=null),!0})}),clearGutter:Ue(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&gn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,Hn(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!f(this,e)||(t=e,e=te(this,e),!e))return null}else if(t=ge(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:Ue(function(e,t,n){return gn(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(V(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:Ue(function(e,t,n){return gn(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(V(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:Ue(function(e,t,n){return Xs(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Br(this,se(this,e),se(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=se(this,e),Br(this,e,e,n,"bookmark")},findMarksAt:function(e){e=se(this,e);var t=[],n=te(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=se(this,e),t=se(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}),se(this,v(n,t))},indexFromPos:function(e){e=se(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 ot(Tr(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 ot(Tr(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}],qs(r,_a(this)),r},unlinkDoc:function(e){if(e instanceof Te&&(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),Zs(_a(this));break}}if(e.history==this.history){var r=[e.id];nr(e,function(i){return r.push(i.id)},!0),e.history=new ri(null),e.history.done=Fr(this.history.done,r),e.history.undone=Fr(this.history.undone,r)}},iterLinkedDocs:function(e){nr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Vr(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Ue(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Is(this.cm))})}),ot.prototype.eachLine=ot.prototype.iter;var Ga=0;function Js(e){var t=this;if(Ua(t),!(De(t,e)||Ut(t.display,e))){Ze(e),S&&(Ga=+new Date);var n=dr(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&&Ge(t,function(){n=se(t.doc,n);var y={from:n,to:n,text:t.doc.splitLines(o.filter(function(A){return A!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ir(t.doc,y),Oa(t.doc,tr(se(t.doc,n),se(t.doc,rr(y))))})()},s=function(y,A){if(t.options.allowDropFileTypes&&de(t.options.allowDropFileTypes,y.type)==-1){l();return}var E=new FileReader;E.onerror=function(){return l()},E.onload=function(){var _=E.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(_)){l();return}o[A]=_,l()},E.readAsText(y)},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 h=e.dataTransfer.getData("Text");if(h){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),oi(t.doc,tr(n,n)),c)for(var b=0;b<c.length;++b)Rr(t.doc,"",c[b].anchor,c[b].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch{}}}}function js(e,t){if(S&&(!e.state.draggingText||+new Date-Ga<100)){It(t);return}if(!(De(e,t)||Ut(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!R)){var n=d("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",O&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),O&&n.parentNode.removeChild(n)}}function Vs(e,t){var n=dr(e,t);if(!!n){var r=document.createDocumentFragment();Ii(e,n,r),e.display.dragCursor||(e.display.dragCursor=d("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),K(e.display.dragCursor,r)}}function Ua(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ka(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 Xa=!1;function $s(){Xa||(eu(),Xa=!0)}function eu(){var e;Z(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ka(tu)},100))}),Z(window,"blur",function(){return Ka(Hr)})}function tu(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var or={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"},wn=0;wn<10;wn++)or[wn+48]=or[wn+96]=String(wn);for(var si=65;si<=90;si++)or[si]=String.fromCharCode(si);for(var Sn=1;Sn<=12;Sn++)or[Sn+111]=or[Sn+63235]="F"+Sn;var Xt={};Xt.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"},Xt.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"},Xt.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"},Xt.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"]},Xt.default=z?Xt.macDefault:Xt.pcDefault;function ru(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 nu(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=wr(n.split(" "),ru),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=ui(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 Ya(e){var t=typeof e=="string"?e:or[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function qa(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(F?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(F?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Za(e,t){if(O&&e.keyCode==34&&e.char)return!1;var n=or[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),qa(n,e,t))}function ui(e){return typeof e=="string"?Xt[e]:e}function _r(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&N(o.from,pe(r).to)<=0;){var a=r.pop();if(N(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}ft(e,function(){for(var l=r.length-1;l>=0;l--)Rr(e.doc,"",r[l].from,r[l].to,"+delete");Er(e)})}function eo(e,t,n){var r=Tt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function to(e,t,n){var r=eo(e,t.ch,n);return r==null?null:new v(t.line,r,n<0?"after":"before")}function ro(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=gt(n,t.doc.direction);if(o){var a=i<0?pe(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var h=Ar(t,n);u=i<0?n.text.length-1:0;var c=Et(t,h,u).top;u=Me(function(b){return Et(t,h,b).top==c},i<0==(a.level==1)?a.from:a.to-1,u),s=="before"&&(u=eo(n,u,1))}else u=i<0?a.to:a.from;return new v(r,u,s)}}return new v(r,i<0?n.text.length:0,i<0?"before":"after")}function iu(e,t,n,r){var i=gt(t,e.doc.direction);if(!i)return to(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=vt(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 to(t,n,r);var l=function(X,J){return eo(t,X instanceof v?X.ch:X,J)},s,u=function(X){return e.options.lineWrapping?(s=s||Ar(e,t),$o(e,t,s,X)):{begin:0,end:t.text.length}},h=u(n.sticky=="before"?l(n,-1):n.ch);if(e.doc.direction=="rtl"||a.level==1){var c=a.level==1==r<0,b=l(n,c?1:-1);if(b!=null&&(c?b<=a.to&&b<=h.end:b>=a.from&&b>=h.begin)){var y=c?"before":"after";return new v(n.line,b,y)}}var A=function(X,J,Y){for(var $=function(Se,Ke){return Ke?new v(n.line,l(Se,1),"before"):new v(n.line,Se,"after")};X>=0&&X<i.length;X+=J){var oe=i[X],re=J>0==(oe.level!=1),fe=re?Y.begin:l(Y.end,-1);if(oe.from<=fe&&fe<oe.to||(fe=re?oe.from:l(oe.to,-1),Y.begin<=fe&&fe<Y.end))return $(fe,re)}},E=A(o+r,r,h);if(E)return E;var _=r>0?h.end:l(h.begin,-1);return _!=null&&!(r>0&&_==t.text.length)&&(E=A(r>0?0:i.length-1,r,u(_)),E)?E:null}var Cn={selectAll:Ha,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ne)},killLine:function(e){return _r(e,function(t){if(t.empty()){var n=te(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:v(t.head.line+1,0)}:{from:t.head,to:v(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return _r(e,function(t){return{from:v(t.from().line,0),to:se(e.doc,v(t.to().line+1,0))}})},delLineLeft:function(e){return _r(e,function(t){return{from:v(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return _r(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 _r(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(v(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(v(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Qa(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 ou(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")},qt)},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")},qt)},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},qt)},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=ie(e.getLine(o.line),o.ch,r);t.push(Lt(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ft(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(!!t[r].empty()){var i=t[r].head,o=te(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new v(i.line,i.ch-1)),i.ch>0)i=new v(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),v(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=te(e.doc,i.line-1).text;a&&(i=new v(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),v(i.line-1,a.length-1),i,"+transpose"))}}n.push(new ye(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return ft(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);Er(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Qa(e,t){var n=te(e.doc,t),r=xt(n);return r!=n&&(t=ge(r)),ro(!0,e,r,t,1)}function ou(e,t){var n=te(e.doc,t),r=Gl(n);return r!=n&&(t=ge(r)),ro(!0,e,n,t,-1)}function Ja(e,t){var n=Qa(e,t.line),r=te(e.doc,n.line),i=gt(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 v(n.line,a?0:o,n.sticky)}return n}function fi(e,t,n){if(typeof t=="string"&&(t=Cn[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)!=xe}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function au(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 lu=new ue;function kn(e,t,n,r){var i=e.state.keySeq;if(i){if(Ya(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:lu.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ja(e,i+" "+t,n,r))return!0}return ja(e,t,n,r)}function ja(e,t,n,r){var i=au(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&_e(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(Ze(n),Ri(e)),!!i}function Va(e,t){var n=Za(t,!0);return n?t.shiftKey&&!e.state.keySeq?kn(e,"Shift-"+n,t,function(r){return fi(e,r,!0)})||kn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return fi(e,r)}):kn(e,n,t,function(r){return fi(e,r)}):!1}function su(e,t,n){return kn(e,"'"+n+"'",t,function(r){return fi(e,r,!0)})}var no=null;function $a(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=we(ze(t)),!De(t,e))){S&&x<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Va(t,e);O&&(no=r?n:null,!r&&n==88&&!Nt&&(z?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),I&&!z&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&uu(t)}}function uu(e){var t=e.display.lineDiv;Ce(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(ee(t,"CodeMirror-crosshair"),qe(document,"keyup",n),qe(document,"mouseover",n))}Z(document,"keyup",n),Z(document,"mouseover",n)}function el(e){e.keyCode==16&&(this.doc.sel.shift=!1),De(this,e)}function tl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Ut(t.display,e)||De(t,e)||e.ctrlKey&&!e.altKey||z&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(O&&n==no){no=null,Ze(e);return}if(!(O&&(!e.which||e.which<10)&&Va(t,e))){var i=String.fromCharCode(r==null?n:r);i!="\b"&&(su(t,e,i)||t.display.input.onKeyPress(e))}}}var fu=400,io=function(e,t,n){this.time=e,this.pos=t,this.button=n};io.prototype.compare=function(e,t,n){return this.time+fu>e&&N(t,this.pos)==0&&n==this.button};var Ln,Tn;function hu(e,t){var n=+new Date;return Tn&&Tn.compare(n,e,t)?(Ln=Tn=null,"triple"):Ln&&Ln.compare(n,e,t)?(Tn=new io(n,e,t),Ln=null,"double"):(Ln=new io(n,e,t),Tn=null,"single")}function rl(e){var t=this,n=t.display;if(!(De(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Ut(n,e)){C||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!oo(t,e)){var r=dr(t,e),i=jr(e),o=r?hu(r,i):"single";Pt(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&cu(t,i,r,o,e))&&(i==1?r?pu(t,r,o,e):nt(e)==n.scroller&&Ze(e):i==2?(r&&ii(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(ne?t.display.input.onContextMenu(e):Bi(t)))}}}function cu(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,kn(e,qa(o,i),i,function(a){if(typeof a=="string"&&(a=Cn[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=xe}finally{e.state.suppressEdits=!1}return l})}function du(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=q?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=z?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(z?n.altKey:n.ctrlKey)),i}function pu(e,t,n,r){S?setTimeout(rt(na,e),0):e.curOp.focus=we(ze(e));var i=du(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&yi&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(N((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(N(a.to(),t)>0||t.xRel<0)?vu(e,r,t,i):gu(e,r,t,i)}function vu(e,t,n,r){var i=e.display,o=!1,a=Ge(e,function(u){C&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Bi(e)),qe(i.wrapper.ownerDocument,"mouseup",a),qe(i.wrapper.ownerDocument,"mousemove",l),qe(i.scroller,"dragstart",s),qe(i.scroller,"drop",a),o||(Ze(u),r.addNew||ii(e.doc,n,null,null,r.extend),C&&!R||S&&x==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};C&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,Z(i.wrapper.ownerDocument,"mouseup",a),Z(i.wrapper.ownerDocument,"mousemove",l),Z(i.scroller,"dragstart",s),Z(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function nl(e,t,n){if(n=="char")return new ye(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new ye(v(t.line,0),se(e.doc,v(t.line+1,0)));var r=n(e,t);return new ye(r.from,r.to)}function gu(e,t,n,r){S&&Bi(e);var i=e.display,o=e.doc;Ze(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 ye(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new ye(n,n)),n=dr(e,t,!0,!0),l=-1;else{var h=nl(e,n,r.unit);r.extend?a=Vi(a,h.anchor,h.head,r.extend):a=h}r.addNew?l==-1?(l=u.length,Qe(o,St(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(Qe(o,St(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):$i(o,l,a,sr):(l=0,Qe(o,new dt([a],0),sr),s=o.sel);var c=n;function b(Y){if(N(c,Y)!=0)if(c=Y,r.unit=="rectangle"){for(var $=[],oe=e.options.tabSize,re=ie(te(o,n.line).text,n.ch,oe),fe=ie(te(o,Y.line).text,Y.ch,oe),Se=Math.min(re,fe),Ke=Math.max(re,fe),Ae=Math.min(n.line,Y.line),ht=Math.min(e.lastLine(),Math.max(n.line,Y.line));Ae<=ht;Ae++){var at=te(o,Ae).text,Fe=kt(at,Se,oe);Se==Ke?$.push(new ye(v(Ae,Fe),v(Ae,Fe))):at.length>Fe&&$.push(new ye(v(Ae,Fe),v(Ae,kt(at,Ke,oe))))}$.length||$.push(new ye(n,n)),Qe(o,St(e,s.ranges.slice(0,l).concat($),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Y)}else{var lt=a,Ye=nl(e,Y,r.unit),Re=lt.anchor,Pe;N(Ye.anchor,Re)>0?(Pe=Ye.head,Re=Ie(lt.from(),Ye.anchor)):(Pe=Ye.anchor,Re=ve(lt.to(),Ye.head));var Ee=s.ranges.slice(0);Ee[l]=yu(e,new ye(se(o,Re),Pe)),Qe(o,St(e,Ee,l),sr)}}var y=i.wrapper.getBoundingClientRect(),A=0;function E(Y){var $=++A,oe=dr(e,Y,!0,r.unit=="rectangle");if(!!oe)if(N(oe,c)!=0){e.curOp.focus=we(ze(e)),b(oe);var re=Vn(i,o);(oe.line>=re.to||oe.line<re.from)&&setTimeout(Ge(e,function(){A==$&&E(Y)}),150)}else{var fe=Y.clientY<y.top?-20:Y.clientY>y.bottom?20:0;fe&&setTimeout(Ge(e,function(){A==$&&(i.scroller.scrollTop+=fe,E(Y))}),50)}}function _(Y){e.state.selectingText=!1,A=1/0,Y&&(Ze(Y),i.input.focus()),qe(i.wrapper.ownerDocument,"mousemove",X),qe(i.wrapper.ownerDocument,"mouseup",J),o.history.lastSelOrigin=null}var X=Ge(e,function(Y){Y.buttons===0||!jr(Y)?_(Y):E(Y)}),J=Ge(e,_);e.state.selectingText=J,Z(i.wrapper.ownerDocument,"mousemove",X),Z(i.wrapper.ownerDocument,"mouseup",J)}function yu(e,t){var n=t.anchor,r=t.head,i=te(e.doc,n.line);if(N(n,r)==0&&n.sticky==r.sticky)return t;var o=gt(i);if(!o)return t;var a=vt(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 h=vt(o,r.ch,r.sticky),c=h-a||(r.ch-n.ch)*(l.level==1?-1:1);h==s-1||h==s?u=c<0:u=c>0}var b=o[s+(u?-1:0)],y=u==(b.level==1),A=y?b.from:b.to,E=y?"after":"before";return n.ch==A&&n.sticky==E?t:new ye(new v(n.line,A,E),r)}function il(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{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ze(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!je(e,n))return Jr(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 h=Mt(e.doc,o),c=e.display.gutterSpecs[s];return ke(e,n,e,h,c.className,t),Jr(t)}}}function oo(e,t){return il(e,t,"gutterClick",!0)}function ol(e,t){Ut(e.display,t)||mu(e,t)||De(e,t,"contextmenu")||ne||e.display.input.onContextMenu(t)}function mu(e,t){return je(e,"gutterContextMenu")?il(e,t,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),an(e)}var Gr={toString:function(){return"CodeMirror.Init"}},ll={},hi={};function bu(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,u){u!=Gr&&o(l,s,u)}:o)}e.defineOption=n,e.Init=Gr,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){pn(r),an(r),it(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 h=s.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(v(a,h))}a++});for(var l=o.length-1;l>=0;l--)Rr(r.doc,i,o[l],v(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!=Gr&&r.refresh()}),n("specialCharPlaceholder",Zl,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",B?"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){al(r),dn(r)},!0),n("keyMap","default",function(r,i,o){var a=ui(i),l=o!=Gr&&ui(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,wu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=qi(i,r.options.lineNumbers),dn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Fi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Wr(r)},!0),n("scrollbarStyle","native",function(r){ua(r),Wr(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=qi(r.options.gutters,i),dn(r)},!0),n("firstLineNumber",1,dn,!0),n("lineNumberFormatter",function(r){return r},dn,!0),n("showCursorWhenSelecting",!1,ln,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Hr(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,xu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ln,!0),n("singleCursorHeightPerLine",!0,ln,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,pn,!0),n("addModeClass",!1,pn,!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,pn,!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 xu(e,t,n){var r=n&&n!=Gr;if(!t!=!r){var i=e.display.dragFunctions,o=t?Z:qe;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 wu(e){e.options.lineWrapping?(Ce(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ee(e.display.wrapper,"CodeMirror-wrap"),Li(e)),Pi(e),it(e),an(e),setTimeout(function(){return Wr(e)},100)}function Te(e,t){var n=this;if(!(this instanceof Te))return new Te(e,t);this.options=t=t?ae(t):{},ae(ll,t,!1);var r=t.value;typeof r=="string"?r=new ot(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Te.inputStyles[t.inputStyle](this),o=this.display=new Ws(e,r,i,t);o.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ua(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 ue,keySeq:null,specialChars:null},t.autofocus&&!B&&o.input.focus(),S&&x<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Su(this),$s(),yr(this),this.curOp.forceUpdate=!0,ba(this,r),t.autofocus&&!B||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&zi(n)},20):Hr(this);for(var a in hi)hi.hasOwnProperty(a)&&hi[a](this,t[a],Gr);ca(this),t.finishInit&&t.finishInit(this);for(var l=0;l<ao.length;++l)ao[l](this);mr(this),C&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}Te.defaults=ll,Te.optionHandlers=hi;function Su(e){var t=e.display;Z(t.scroller,"mousedown",Ge(e,rl)),S&&x<11?Z(t.scroller,"dblclick",Ge(e,function(s){if(!De(e,s)){var u=dr(e,s);if(!(!u||oo(e,s)||Ut(e.display,s))){Ze(s);var h=e.findWordAt(u);ii(e.doc,h.anchor,h.head)}}})):Z(t.scroller,"dblclick",function(s){return De(e,s)||Ze(s)}),Z(t.scroller,"contextmenu",function(s){return ol(e,s)}),Z(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||ol(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 h=u.left-s.left,c=u.top-s.top;return h*h+c*c>20*20}Z(t.scroller,"touchstart",function(s){if(!De(e,s)&&!o(s)&&!oo(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)}}),Z(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Z(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Ut(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),c;!u.prev||a(u,u.prev)?c=new ye(h,h):!u.prev.prev||a(u,u.prev.prev)?c=e.findWordAt(h):c=new ye(v(h.line,0),se(e.doc,v(h.line+1,0))),e.setSelection(c.anchor,c.head),e.focus(),Ze(s)}i()}),Z(t.scroller,"touchcancel",i),Z(t.scroller,"scroll",function(){t.scroller.clientHeight&&(un(e,t.scroller.scrollTop),vr(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),Z(t.scroller,"mousewheel",function(s){return va(e,s)}),Z(t.scroller,"DOMMouseScroll",function(s){return va(e,s)}),Z(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){De(e,s)||It(s)},over:function(s){De(e,s)||(Vs(e,s),It(s))},start:function(s){return js(e,s)},drop:Ge(e,Js),leave:function(s){De(e,s)||Ua(e)}};var l=t.input.getField();Z(l,"keyup",function(s){return el.call(e,s)}),Z(l,"keydown",Ge(e,$a)),Z(l,"keypress",Ge(e,tl)),Z(l,"focus",function(s){return zi(e,s)}),Z(l,"blur",function(s){return Hr(e,s)})}var ao=[];Te.defineInitHook=function(e){return ao.push(e)};function On(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=en(e,t).state:n="prev");var a=e.options.tabSize,l=te(i,t),s=ie(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(l.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,l.text.slice(u.length),l.text),h==xe||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=ie(te(i,t-1).text,null,a):h=0:n=="add"?h=s+e.options.indentUnit:n=="subtract"?h=s-e.options.indentUnit:typeof n=="number"&&(h=s+n),h=Math.max(0,h);var c="",b=0;if(e.options.indentWithTabs)for(var y=Math.floor(h/a);y;--y)b+=a,c+=" ";if(b<h&&(c+=Lt(h-b)),c!=u)return Rr(i,c,v(t,0),v(t,u.length),"+input"),l.stateAfter=null,!0;for(var A=0;A<i.sel.ranges.length;A++){var E=i.sel.ranges[A];if(E.head.line==t&&E.head.ch<u.length){var _=v(t,u.length);$i(i,A,new ye(_,_));break}}}var Ct=null;function ci(e){Ct=e}function lo(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=Vr(t),u=null;if(l&&r.ranges.length>1)if(Ct&&Ct.text.join(`
|
|
`)==t){if(r.ranges.length%Ct.text.length==0){u=[];for(var h=0;h<Ct.text.length;h++)u.push(o.splitLines(Ct.text[h]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=wr(s,function(X){return[X]}));for(var c=e.curOp.updateInput,b=r.ranges.length-1;b>=0;b--){var y=r.ranges[b],A=y.from(),E=y.to();y.empty()&&(n&&n>0?A=v(A.line,A.ch-n):e.state.overwrite&&!l?E=v(E.line,Math.min(te(o,E.line).text.length,E.ch+pe(s).length)):l&&Ct&&Ct.lineWise&&Ct.text.join(`
|
|
`)==s.join(`
|
|
`)&&(A=E=v(A.line,0)));var _={from:A,to:E,text:u?u[b%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};Ir(e.doc,_),_e(e,"inputRead",e,_)}t&&!l&&ul(e,t),Er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=c),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ft(t,function(){return lo(t,n,0,null,"paste")}),!0}function ul(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=On(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(te(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=On(e,i.head.line,"smart"));a&&_e(e,"electricInput",e,i.head.line)}}}function fl(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:v(i,0),head:v(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function so(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function hl(){var e=d("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=d("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return C?e.style.width="1000px":e.setAttribute("wrap","off"),k&&(e.style.border="1px solid black"),t}function Cu(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){Pt(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)&&Ge(this,t[r])(this,i,a),ke(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"](ui(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:$e(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");Mn(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(a){return a.priority}),this.state.modeGen++,it(this)}),removeOverlay:$e(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++,it(this);return}}}),indentLine:$e(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),f(this.doc,r)&&On(this,r,i,o)}),indentSelection:$e(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&&(On(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&Er(this));else{var s=l.from(),u=l.to(),h=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var c=h;c<o;++c)On(this,c,r);var b=this.doc.sel.ranges;s.ch==0&&i.length==b.length&&b[a].from().ch>0&&$i(this.doc,a,new ye(s,b[a].to()),Ne)}}}),getTokenAt:function(r,i){return wo(this,r,i)},getLineTokens:function(r,i){return wo(this,v(r),i,!0)},getTokenTypeAt:function(r){r=se(this.doc,r);var i=mo(this,te(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 h=s?s.indexOf("overlay "):-1;return h<0?s:h==0?null:s.slice(0,h-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 h=0;h<a._global.length;h++){var c=a._global[h];c.pred(l,this)&&de(o,c.val)==-1&&o.push(c.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=ct(o,r==null?o.first+o.size-1:r),en(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=se(this.doc,r):o=r?a.from():a.to(),wt(this,o,i||"page")},charCoords:function(r,i){return Zn(this,se(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Jo(this,r,i||"page"),Hi(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Jo(this,{top:r,left:0},i||"page").top,Mt(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=te(this.doc,r)}else l=r;return qn(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-Gt(l):0)},defaultTextHeight:function(){return Mr(this.display)},defaultCharWidth:function(){return Dr(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,se(this.doc,r));var u=r.bottom,h=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 c=Math.max(s.wrapper.clientHeight,this.doc.height),b=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>c)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=c&&(u=r.bottom),h+i.offsetWidth>b&&(h=b-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(h=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?h=0:l=="middle"&&(h=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&xs(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:$e($a),triggerOnKeyPress:$e(tl),triggerOnKeyUp:el,triggerOnMouseDown:$e(rl),execCommand:function(r){if(Cn.hasOwnProperty(r))return Cn[r].call(null,this)},triggerElectric:$e(function(r){ul(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=se(this.doc,r),u=0;u<i&&(s=uo(this.doc,s,l,o,a),!s.hitSide);++u);return s},moveH:$e(function(r,i){var o=this;this.extendSelectionsBy(function(a){return o.display.shift||o.doc.extend||a.empty()?uo(o.doc,a.head,r,i,o.options.rtlMoveVisually):r<0?a.from():a.to()},qt)}),deleteH:$e(function(r,i){var o=this.doc.sel,a=this.doc;o.somethingSelected()?a.replaceSelection("",null,"+delete"):_r(this,function(l){var s=uo(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=se(this.doc,r),h=0;h<i;++h){var c=wt(this,u,"div");if(s==null?s=c.left:c.left=s,u=cl(this,c,l,o),u.hitSide)break}return u},moveV:$e(function(r,i){var o=this,a=this.doc,l=[],s=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(h){if(s)return r<0?h.from():h.to();var c=wt(o,h.head,"div");h.goalColumn!=null&&(c.left=h.goalColumn),l.push(c.left);var b=cl(o,c,r,i);return i=="page"&&h==a.sel.primary()&&Gi(o,Zn(o,b,"div").top-c.top),b},qt),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=te(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),h=Sr(u,s)?function(c){return Sr(c,s)}:/\s/.test(u)?function(c){return/\s/.test(c)}:function(c){return!/\s/.test(c)&&!Sr(c)};a>0&&h(o.charAt(a-1));)--a;for(;l<o.length&&h(o.charAt(l));)++l}return new ye(v(r.line,a),v(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ce(this.display.cursorDiv,"CodeMirror-overwrite"):ee(this.display.cursorDiv,"CodeMirror-overwrite"),ke(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==we(ze(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:$e(function(r,i){sn(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Ht(this)-this.display.barHeight,width:r.scrollWidth-Ht(this)-this.display.barWidth,clientHeight:Ni(this),clientWidth:hr(this)}},scrollIntoView:$e(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:v(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?ws(this,r):oa(this,r.from,r.to,r.margin)}),setSize:$e(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&&qo(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){$t(o,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,ke(this,"refresh",this)}),operation:function(r){return ft(this,r)},startOperation:function(){return yr(this)},endOperation:function(){return mr(this)},refresh:$e(function(){var r=this.display.cachedTextHeight;it(this),this.curOp.forceUpdate=!0,an(this),sn(this,this.doc.scrollLeft,this.doc.scrollTop),Xi(this.display),(r==null||Math.abs(r-Mr(this.display))>.5||this.options.lineWrapping)&&Pi(this),ke(this,"refresh",this)}),swapDoc:$e(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ba(this,r),an(this),this.display.input.reset(),sn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,_e(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}},Ve(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 uo(e,t,n,r,i){var o=t,a=n,l=te(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var J=t.line+s;return J<e.first||J>=e.first+e.size?!1:(t=new v(J,t.ch,t.sticky),l=te(e,J))}function h(J){var Y;if(r=="codepoint"){var $=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN($))Y=null;else{var oe=n>0?$>=55296&&$<56320:$>=56320&&$<57343;Y=new v(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(oe?2:1))),-n)}}else i?Y=iu(e.cm,l,t,n):Y=to(l,t,n);if(Y==null)if(!J&&u())t=ro(i,e.cm,l,t.line,s);else return!1;else t=Y;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var c=null,b=r=="group",y=e.cm&&e.cm.getHelper(t,"wordChars"),A=!0;!(n<0&&!h(!A));A=!1){var E=l.text.charAt(t.ch)||`
|
|
`,_=Sr(E,y)?"w":b&&E==`
|
|
`?"n":!b||/\s/.test(E)?null:"p";if(b&&!A&&!_&&(_="s"),c&&c!=_){n<0&&(n=1,h(),t.sticky="after");break}if(_&&(c=_),n>0&&!h(!A))break}var X=ai(e,t,o,a,!0);return le(o,X)&&(X.hitSide=!0),X}function cl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,Pt(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*Mr(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=Hi(e,o,a),!!u.outside;){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var me=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ue,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};me.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,so(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}Z(i,"paste",function(l){!o(l)||De(r,l)||sl(l,r)||x<=11&&setTimeout(Ge(r,function(){return t.updateFromDOM()}),20)}),Z(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),Z(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),Z(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Z(i,"touchstart",function(){return n.forceCompositionEnd()}),Z(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||De(r,l))){if(r.somethingSelected())ci({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=fl(r);ci({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Ne),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=Ct.text.join(`
|
|
`);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var h=hl(),c=h.firstChild;so(c),r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),c.value=Ct.text.join(`
|
|
`);var b=we(i.ownerDocument);lr(c),setTimeout(function(){r.display.lineSpace.removeChild(h),b.focus(),b==i&&n.showPrimarySelection()},50)}}Z(i,"copy",a),Z(i,"cut",a)},me.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},me.prototype.prepareSelection=function(){var e=ra(this.cm,!1);return e.focus=we(this.div.ownerDocument)==this.div,e},me.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},me.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},me.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=di(t,e.anchorNode,e.anchorOffset),a=di(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&a&&!a.bad&&N(Ie(o,a),r)==0&&N(ve(o,a),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&dl(t,r)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&dl(t,i);if(!u){var h=l[l.length-1].measure,c=h.maps?h.maps[h.maps.length-1]:h.map;u={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}if(!s||!u){e.removeAllRanges();return}var b=e.rangeCount&&e.getRangeAt(0),y;try{y=be(s.node,s.offset,u.offset,u.node)}catch{}y&&(!I&&t.state.focused?(e.collapse(s.node,s.offset),y.collapsed||(e.removeAllRanges(),e.addRange(y))):(e.removeAllRanges(),e.addRange(y)),b&&e.anchorNode==null?e.addRange(b):I&&this.startGracePeriod()),this.rememberSelection()}},me.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)},me.prototype.showMultipleSelections=function(e){K(this.cm.display.cursorDiv,e.cursors),K(this.cm.display.selectionDiv,e.selection)},me.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},me.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Le(this.div,t)},me.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||we(this.div.ownerDocument)!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},me.prototype.blur=function(){this.div.blur()},me.prototype.getField=function(){return this.div},me.prototype.supportsTouch=function(){return!0},me.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):ft(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)},me.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},me.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(L&&P&&this.cm.display.gutterSpecs.length&&ku(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=di(t,e.anchorNode,e.anchorOffset),r=di(t,e.focusNode,e.focusOffset);n&&r&&ft(t,function(){Qe(t.doc,tr(n,r),Ne),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},me.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=v(r.line-1,te(e.doc,r.line-1).length)),i.ch==te(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=v(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;r.line==t.viewFrom||(o=pr(e,r.line))==0?(a=ge(t.view[0].line),l=t.view[0].node):(a=ge(t.view[o].line),l=t.view[o-1].node.nextSibling);var s=pr(e,i.line),u,h;if(s==t.view.length-1?(u=t.viewTo-1,h=t.lineDiv.lastChild):(u=ge(t.view[s+1].line)-1,h=t.view[s+1].node.previousSibling),!l)return!1;for(var c=e.doc.splitLines(Lu(e,l,h,a,u)),b=zt(e.doc,v(a,0),v(u,te(e.doc,u).text.length));c.length>1&&b.length>1;)if(pe(c)==pe(b))c.pop(),b.pop(),u--;else if(c[0]==b[0])c.shift(),b.shift(),a++;else break;for(var y=0,A=0,E=c[0],_=b[0],X=Math.min(E.length,_.length);y<X&&E.charCodeAt(y)==_.charCodeAt(y);)++y;for(var J=pe(c),Y=pe(b),$=Math.min(J.length-(c.length==1?y:0),Y.length-(b.length==1?y:0));A<$&&J.charCodeAt(J.length-A-1)==Y.charCodeAt(Y.length-A-1);)++A;if(c.length==1&&b.length==1&&a==r.line)for(;y&&y>r.ch&&J.charCodeAt(J.length-A-1)==Y.charCodeAt(Y.length-A-1);)y--,A++;c[c.length-1]=J.slice(0,J.length-A).replace(/^\u200b+/,""),c[0]=c[0].slice(y).replace(/\u200b+$/,"");var oe=v(a,y),re=v(u,b.length?pe(b).length-A:0);if(c.length>1||c[0]||N(oe,re))return Rr(e.doc,c,oe,re,"+input"),!0},me.prototype.ensurePolled=function(){this.forceCompositionEnd()},me.prototype.reset=function(){this.forceCompositionEnd()},me.prototype.forceCompositionEnd=function(){!this.composing||(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},me.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))},me.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ft(this.cm,function(){return it(e.cm)})},me.prototype.setUneditable=function(e){e.contentEditable="false"},me.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ge(this.cm,lo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},me.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},me.prototype.onContextMenu=function(){},me.prototype.resetPosition=function(){},me.prototype.needsContentAttribute=!0;function dl(e,t){var n=Ai(e,t.line);if(!n||n.hidden)return null;var r=te(e.doc,t.line),i=Go(n,r,t.line),o=gt(r,e.doc.direction),a="left";if(o){var l=vt(o,t.ch);a=l%2?"right":"left"}var s=Xo(i.map,t.ch,a);return s.offset=s.collapse=="right"?s.end:s.start,s}function ku(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Ur(e,t){return t&&(e.bad=!0),e}function Lu(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function u(y){return function(A){return A.id==y}}function h(){a&&(o+=l,s&&(o+=l),a=s=!1)}function c(y){y&&(h(),o+=y)}function b(y){if(y.nodeType==1){var A=y.getAttribute("cm-text");if(A){c(A);return}var E=y.getAttribute("cm-marker"),_;if(E){var X=e.findMarks(v(r,0),v(i+1,0),u(+E));X.length&&(_=X[0].find(0))&&c(zt(e.doc,_.from,_.to).join(l));return}if(y.getAttribute("contenteditable")=="false")return;var J=/^(pre|div|p|li|table|br)$/i.test(y.nodeName);if(!/^br$/i.test(y.nodeName)&&y.textContent.length==0)return;J&&h();for(var Y=0;Y<y.childNodes.length;Y++)b(y.childNodes[Y]);/^(pre|p)$/i.test(y.nodeName)&&(s=!0),J&&(a=!0)}else y.nodeType==3&&c(y.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;b(t),t!=n;)t=t.nextSibling,s=!1;return o}function di(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Ur(e.clipPos(v(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 Tu(o,t,n)}}function Tu(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!Le(r,t))return Ur(v(ge(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?pe(e.rest):e.line;return Ur(v(ge(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 h(_,X,J){for(var Y=-1;Y<(u?u.length:0);Y++)for(var $=Y<0?s.map:u[Y],oe=0;oe<$.length;oe+=3){var re=$[oe+2];if(re==_||re==X){var fe=ge(Y<0?e.line:e.rest[Y]),Se=$[oe]+J;return(J<0||re!=_)&&(Se=$[oe+(J?1:0)]),v(fe,Se)}}}var c=h(a,l,n);if(c)return Ur(c,i);for(var b=l.nextSibling,y=a?a.nodeValue.length-n:0;b;b=b.nextSibling){if(c=h(b,b.firstChild,0),c)return Ur(v(c.line,c.ch-y),i);y+=b.textContent.length}for(var A=l.previousSibling,E=n;A;A=A.previousSibling){if(c=h(A,A.firstChild,-1),c)return Ur(v(c.line,c.ch+E),i);E+=A.textContent.length}}var We=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ue,this.hasSelection=!1,this.composing=null,this.resetting=!1};We.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),k&&(i.style.width="0px"),Z(i,"input",function(){S&&x>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Z(i,"paste",function(a){De(r,a)||sl(a,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(a){if(!De(r,a)){if(r.somethingSelected())ci({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=fl(r);ci({lineWise:!0,text:l.text}),a.type=="cut"?r.setSelections(l.ranges,null,Ne):(n.prevInput="",i.value=l.text.join(`
|
|
`),lr(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}Z(i,"cut",o),Z(i,"copy",o),Z(e.scroller,"paste",function(a){if(!(Ut(e,a)||De(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)}}),Z(e.lineSpace,"selectstart",function(a){Ut(e,a)||Ze(a)}),Z(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"})}}),Z(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},We.prototype.createField=function(e){this.wrapper=hl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;so(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},We.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},We.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ra(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},We.prototype.showSelection=function(e){var t=this.cm,n=t.display;K(n.cursorDiv,e.cursors),K(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},We.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&&lr(this.textarea),S&&x>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",S&&x>=9&&(this.hasSelection=null));this.resetting=!1}},We.prototype.getField=function(){return this.textarea},We.prototype.supportsTouch=function(){return!1},We.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!B||we(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch{}},We.prototype.blur=function(){this.textarea.blur()},We.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},We.prototype.receivedFocus=function(){this.slowPoll()},We.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},We.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)},We.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Zt(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(S&&x>=9&&this.hasSelection===i||z&&/[\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 ft(t,function(){lo(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},We.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},We.prototype.onKeyPress=function(){S&&x>=9&&(this.hasSelection=null),this.fastPoll()},We.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=dr(n,e),a=r.scroller.scrollTop;if(!o||O)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&Ge(n,Qe)(n.doc,tr(o),Ne);var s=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px;
|
|
z-index: 1000; background: `+(S?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var c;C&&(c=i.ownerDocument.defaultView.scrollY),r.input.focus(),C&&i.ownerDocument.defaultView.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function b(){if(i.selectionStart!=null){var E=n.somethingSelected(),_="\u200B"+(E?i.value:"");i.value="\u21DA",i.value=_,t.prevInput=E?"":"\u200B",i.selectionStart=1,i.selectionEnd=_.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,S&&x<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!S||S&&x<9)&&b();var E=0,_=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?Ge(n,Ha)(n):E++<10?r.detectingSelectAll=setTimeout(_,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(_,200)}}if(S&&x>=9&&b(),ne){It(e);var A=function(){qe(window,"mouseup",A),setTimeout(y,20)};Z(window,"mouseup",A)}else setTimeout(y,50)},We.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},We.prototype.setUneditable=function(){},We.prototype.needsContentAttribute=!1;function Ou(e,t){if(t=t?ae(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=we(e.ownerDocument);t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(Z(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{}}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&&(qe(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=Te(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function Nu(e){e.off=qe,e.on=Z,e.wheelEventPixels=Fs,e.Doc=ot,e.splitLines=Vr,e.countColumn=ie,e.findColumn=kt,e.isWordChar=qr,e.Pass=xe,e.signal=ke,e.Line=Or,e.changeEnd=rr,e.scrollbarModel=sa,e.Pos=v,e.cmpPos=N,e.modes=bt,e.mimeModes=Qt,e.resolveMode=ut,e.getMode=Rt,e.modeExtensions=Jt,e.extendMode=Rn,e.copyState=Bt,e.startState=$r,e.innerMode=jt,e.commands=Cn,e.keyMap=Xt,e.keyName=Za,e.isModifierKey=Ya,e.lookupKey=zr,e.normalizeKeyMap=nu,e.StringStream=He,e.SharedTextMarker=xn,e.TextMarker=ir,e.LineWidget=bn,e.e_preventDefault=Ze,e.e_stopPropagation=fr,e.e_stop=It,e.addClass=Ce,e.contains=Le,e.rmClass=ee,e.keyNames=or}bu(Te),Cu(Te);var Au="iter insert remove copy getEditor constructor".split(" ");for(var pi in ot.prototype)ot.prototype.hasOwnProperty(pi)&&de(Au,pi)<0&&(Te.prototype[pi]=function(e){return function(){return e.apply(this.doc,arguments)}}(ot.prototype[pi]));return Ve(ot),Te.inputStyles={textarea:We,contenteditable:me},Te.defineMode=function(e){!Te.defaults.mode&&e!="null"&&(Te.defaults.mode=e),In.apply(this,arguments)},Te.defineMIME=Lr,Te.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Te.defineMIME("text/plain","null"),Te.defineExtension=function(e,t){Te.prototype[e]=t},Te.defineDocExtension=function(e,t){ot.prototype[e]=t},Te.fromTextArea=Ou,Nu(Te),Te.version="5.65.11",Te})}(co)),co.exports}var Bu=tt();(function(Oe,Be){(function(m){m(tt())})(function(m){m.defineMode("javascript",function(U,I){var G=U.indentUnit,M=I.statementIndent,w=I.jsonld,S=I.json||w,x=I.trackScope!==!1,C=I.typescript,W=I.wordCharacters||/[\w$\xa1-\uffff]/,P=function(){function f(Ie){return{type:Ie,style:"keyword"}}var p=f("keyword a"),v=f("keyword b"),N=f("keyword c"),le=f("keyword d"),he=f("operator"),ve={type:"atom",style:"atom"};return{if:f("if"),while:p,with:p,else:v,do:v,try:v,finally:v,return:le,break:le,continue:le,new:f("new"),delete:N,void:N,throw:N,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:he,typeof:he,instanceof:he,true:ve,false:ve,null:ve,undefined:ve,NaN:ve,Infinity:ve,this:f("this"),class:f("class"),super:f("atom"),yield:N,export:f("export"),import:f("import"),extends:N,await:N}}(),j=/[+\-*&%=<>!?|~^@]/,O=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function R(f){for(var p=!1,v,N=!1;(v=f.next())!=null;){if(!p){if(v=="/"&&!N)return;v=="["?N=!0:N&&v=="]"&&(N=!1)}p=!p&&v=="\\"}}var D,H;function k(f,p,v){return D=f,H=v,p}function L(f,p){var v=f.next();if(v=='"'||v=="'")return p.tokenize=B(v),p.tokenize(f,p);if(v=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return k("number","number");if(v=="."&&f.match(".."))return k("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(v))return k(v);if(v=="="&&f.eat(">"))return k("=>","operator");if(v=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return k("number","number");if(/\d/.test(v))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),k("number","number");if(v=="/")return f.eat("*")?(p.tokenize=z,z(f,p)):f.eat("/")?(f.skipToEnd(),k("comment","comment")):Mt(f,p,1)?(R(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),k("regexp","string-2")):(f.eat("="),k("operator","operator",f.current()));if(v=="`")return p.tokenize=q,q(f,p);if(v=="#"&&f.peek()=="!")return f.skipToEnd(),k("meta","meta");if(v=="#"&&f.eatWhile(W))return k("variable","property");if(v=="<"&&f.match("!--")||v=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),k("comment","comment");if(j.test(v))return(v!=">"||!p.lexical||p.lexical.type!=">")&&(f.eat("=")?(v=="!"||v=="=")&&f.eat("="):/[<>*+\-|&?]/.test(v)&&(f.eat(v),v==">"&&f.eat(v))),v=="?"&&f.eat(".")?k("."):k("operator","operator",f.current());if(W.test(v)){f.eatWhile(W);var N=f.current();if(p.lastType!="."){if(P.propertyIsEnumerable(N)){var le=P[N];return k(le.type,le.style,N)}if(N=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return k("async","keyword",N)}return k("variable","variable",N)}}function B(f){return function(p,v){var N=!1,le;if(w&&p.peek()=="@"&&p.match(O))return v.tokenize=L,k("jsonld-keyword","meta");for(;(le=p.next())!=null&&!(le==f&&!N);)N=!N&&le=="\\";return N||(v.tokenize=L),k("string","string")}}function z(f,p){for(var v=!1,N;N=f.next();){if(N=="/"&&v){p.tokenize=L;break}v=N=="*"}return k("comment","comment")}function q(f,p){for(var v=!1,N;(N=f.next())!=null;){if(!v&&(N=="`"||N=="$"&&f.eat("{"))){p.tokenize=L;break}v=!v&&N=="\\"}return k("quasi","string-2",f.current())}var Q="([{}])";function g(f,p){p.fatArrowAt&&(p.fatArrowAt=null);var v=f.string.indexOf("=>",f.start);if(!(v<0)){if(C){var N=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,v));N&&(v=N.index)}for(var le=0,he=!1,ve=v-1;ve>=0;--ve){var Ie=f.string.charAt(ve),ct=Q.indexOf(Ie);if(ct>=0&&ct<3){if(!le){++ve;break}if(--le==0){Ie=="("&&(he=!0);break}}else if(ct>=3&&ct<6)++le;else if(W.test(Ie))he=!0;else if(/["'\/`]/.test(Ie))for(;;--ve){if(ve==0)return;var se=f.string.charAt(ve-1);if(se==Ie&&f.string.charAt(ve-2)!="\\"){ve--;break}}else if(he&&!le){++ve;break}}he&&!le&&(p.fatArrowAt=ve)}}var F={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ne(f,p,v,N,le,he){this.indented=f,this.column=p,this.type=v,this.prev=le,this.info=he,N!=null&&(this.align=N)}function V(f,p){if(!x)return!1;for(var v=f.localVars;v;v=v.next)if(v.name==p)return!0;for(var N=f.context;N;N=N.prev)for(var v=N.vars;v;v=v.next)if(v.name==p)return!0}function ee(f,p,v,N,le){var he=f.cc;for(T.state=f,T.stream=le,T.marked=null,T.cc=he,T.style=p,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var ve=he.length?he.pop():S?xe:de;if(ve(v,N)){for(;he.length&&he[he.length-1].lex;)he.pop()();return T.marked?T.marked:v=="variable"&&V(f,N)?"variable-2":p}}}var T={state:null,column:null,marked:null,cc:null};function K(){for(var f=arguments.length-1;f>=0;f--)T.cc.push(arguments[f])}function d(){return K.apply(null,arguments),!0}function ce(f,p){for(var v=p;v;v=v.next)if(v.name==f)return!0;return!1}function be(f){var p=T.state;if(T.marked="def",!!x){if(p.context){if(p.lexical.info=="var"&&p.context&&p.context.block){var v=Le(f,p.context);if(v!=null){p.context=v;return}}else if(!ce(f,p.localVars)){p.localVars=new Ft(f,p.localVars);return}}I.globalVars&&!ce(f,p.globalVars)&&(p.globalVars=new Ft(f,p.globalVars))}}function Le(f,p){if(p)if(p.block){var v=Le(f,p.prev);return v?v==p.prev?p:new Ce(v,p.vars,!0):null}else return ce(f,p.vars)?p:new Ce(p.prev,new Ft(f,p.vars),!1);else return null}function we(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function Ce(f,p,v){this.prev=f,this.vars=p,this.block=v}function Ft(f,p){this.name=f,this.next=p}var lr=new Ft("this",new Ft("arguments",null));function ze(){T.state.context=new Ce(T.state.context,T.state.localVars,!1),T.state.localVars=lr}function Pt(){T.state.context=new Ce(T.state.context,T.state.localVars,!0),T.state.localVars=null}ze.lex=Pt.lex=!0;function rt(){T.state.localVars=T.state.context.vars,T.state.context=T.state.context.prev}rt.lex=!0;function ae(f,p){var v=function(){var N=T.state,le=N.indented;if(N.lexical.type=="stat")le=N.lexical.indented;else for(var he=N.lexical;he&&he.type==")"&&he.align;he=he.prev)le=he.indented;N.lexical=new ne(le,T.stream.column(),f,null,N.lexical,p)};return v.lex=!0,v}function ie(){var f=T.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}ie.lex=!0;function ue(f){function p(v){return v==f?d():f==";"||v=="}"||v==")"||v=="]"?K():d(p)}return p}function de(f,p){return f=="var"?d(ae("vardef",p),It,ue(";"),ie):f=="keyword a"?d(ae("form"),sr,de,ie):f=="keyword b"?d(ae("form"),de,ie):f=="keyword d"?T.stream.match(/^\s*$/,!1)?d():d(ae("stat"),kt,ue(";"),ie):f=="debugger"?d(ue(";")):f=="{"?d(ae("}"),Pt,Ot,ie,rt):f==";"?d():f=="if"?(T.state.lexical.info=="else"&&T.state.cc[T.state.cc.length-1]==ie&&T.state.cc.pop()(),d(ae("form"),sr,de,ie,kr)):f=="function"?d(Nt):f=="for"?d(ae("form"),Pt,Fn,de,rt,ie):f=="class"||C&&p=="interface"?(T.marked="keyword",d(ae("form",f=="class"?f:p),In,ie)):f=="variable"?C&&p=="declare"?(T.marked="keyword",d(de)):C&&(p=="module"||p=="enum"||p=="type")&&T.stream.match(/^\s*\w/,!1)?(T.marked="keyword",p=="enum"?d(Tr):p=="type"?d(Pn,ue("operator"),Z,ue(";")):d(ae("form"),nt,ue("{"),ae("}"),Ot,ie,ie)):C&&p=="namespace"?(T.marked="keyword",d(ae("form"),xe,de,ie)):C&&p=="abstract"?(T.marked="keyword",d(de)):d(ae("stat"),Sr):f=="switch"?d(ae("form"),sr,ue("{"),ae("}","switch"),Pt,Ot,ie,ie,rt):f=="case"?d(xe,ue(":")):f=="default"?d(ue(":")):f=="catch"?d(ae("form"),ze,An,de,ie,rt):f=="export"?d(ae("stat"),Jt,ie):f=="import"?d(ae("stat"),Bt,ie):f=="async"?d(de):p=="@"?d(xe,de):K(ae("stat"),xe,ue(";"),ie)}function An(f){if(f=="(")return d(bt,ue(")"))}function xe(f,p){return qt(f,p,!1)}function Ne(f,p){return qt(f,p,!0)}function sr(f){return f!="("?K():d(ae(")"),kt,ue(")"),ie)}function qt(f,p,v){if(T.state.fatArrowAt==T.stream.start){var N=v?Yr:Mn;if(f=="(")return d(ze,ae(")"),Me(bt,")"),ie,ue("=>"),N,rt);if(f=="variable")return K(ze,nt,ue("=>"),N,rt)}var le=v?Lt:pt;return F.hasOwnProperty(f)?d(le):f=="function"?d(Nt,le):f=="class"||C&&p=="interface"?(T.marked="keyword",d(ae("form"),Qt,ie)):f=="keyword c"||f=="async"?d(v?Ne:xe):f=="("?d(ae(")"),kt,ue(")"),ie,le):f=="operator"||f=="spread"?d(v?Ne:xe):f=="["?d(ae("]"),zt,ie,le):f=="{"?ur(Cr,"}",null,le):f=="quasi"?K(pe,le):f=="new"?d(Dn(v)):d()}function kt(f){return f.match(/[;\}\)\],]/)?K():K(xe)}function pt(f,p){return f==","?d(kt):Lt(f,p,!1)}function Lt(f,p,v){var N=v==!1?pt:Lt,le=v==!1?xe:Ne;if(f=="=>")return d(ze,v?Yr:Mn,rt);if(f=="operator")return/\+\+|--/.test(p)||C&&p=="!"?d(N):C&&p=="<"&&T.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?d(ae(">"),Me(Z,">"),ie,N):p=="?"?d(xe,ue(":"),le):d(le);if(f=="quasi")return K(pe,N);if(f!=";"){if(f=="(")return ur(Ne,")","call",N);if(f==".")return d(Hn,N);if(f=="[")return d(ae("]"),kt,ue("]"),ie,N);if(C&&p=="as")return T.marked="keyword",d(Z,N);if(f=="regexp")return T.state.lastType=T.marked="operator",T.stream.backUp(T.stream.pos-T.stream.start-1),d(le)}}function pe(f,p){return f!="quasi"?K():p.slice(p.length-2)!="${"?d(pe):d(kt,wr)}function wr(f){if(f=="}")return T.marked="string-2",T.state.tokenize=q,d(pe)}function Mn(f){return g(T.stream,T.state),K(f=="{"?de:xe)}function Yr(f){return g(T.stream,T.state),K(f=="{"?de:Ne)}function Dn(f){return function(p){return p=="."?d(f?qr:vi):p=="variable"&&C?d(Ze,f?Lt:pt):K(f?Ne:xe)}}function vi(f,p){if(p=="target")return T.marked="keyword",d(pt)}function qr(f,p){if(p=="target")return T.marked="keyword",d(Lt)}function Sr(f){return f==":"?d(ie,de):K(pt,ue(";"),ie)}function Hn(f){if(f=="variable")return T.marked="property",d()}function Cr(f,p){if(f=="async")return T.marked="property",d(Cr);if(f=="variable"||T.style=="keyword"){if(T.marked="property",p=="get"||p=="set")return d(Zr);var v;return C&&T.state.fatArrowAt==T.stream.start&&(v=T.stream.match(/^\s*:\s*/,!1))&&(T.state.fatArrowAt=T.stream.pos+v[0].length),d(Tt)}else{if(f=="number"||f=="string")return T.marked=w?"property":T.style+" property",d(Tt);if(f=="jsonld-keyword")return d(Tt);if(C&&we(p))return T.marked="keyword",d(Cr);if(f=="[")return d(xe,vt,ue("]"),Tt);if(f=="spread")return d(Ne,Tt);if(p=="*")return T.marked="keyword",d(Cr);if(f==":")return K(Tt)}}function Zr(f){return f!="variable"?K(Tt):(T.marked="property",d(Nt))}function Tt(f){if(f==":")return d(Ne);if(f=="(")return K(Nt)}function Me(f,p,v){function N(le,he){if(v?v.indexOf(le)>-1:le==","){var ve=T.state.lexical;return ve.info=="call"&&(ve.pos=(ve.pos||0)+1),d(function(Ie,ct){return Ie==p||ct==p?K():K(f)},N)}return le==p||he==p?d():v&&v.indexOf(";")>-1?K(f):d(ue(p))}return function(le,he){return le==p||he==p?d():K(f,N)}}function ur(f,p,v){for(var N=3;N<arguments.length;N++)T.cc.push(arguments[N]);return d(ae(p,v),Me(f,p),ie)}function Ot(f){return f=="}"?d():K(de,Ot)}function vt(f,p){if(C){if(f==":")return d(Z);if(p=="?")return d(vt)}}function gi(f,p){if(C&&(f==":"||p=="in"))return d(Z)}function gt(f){if(C&&f==":")return T.stream.match(/^\s*\w+\s+is\b/,!1)?d(xe,En,Z):d(Z)}function En(f,p){if(p=="is")return T.marked="keyword",d()}function Z(f,p){if(p=="keyof"||p=="typeof"||p=="infer"||p=="readonly")return T.marked="keyword",d(p=="typeof"?Ne:Z);if(f=="variable"||p=="void")return T.marked="type",d(Ve);if(p=="|"||p=="&")return d(Z);if(f=="string"||f=="number"||f=="atom")return d(Ve);if(f=="[")return d(ae("]"),Me(Z,"]",","),ie,Ve);if(f=="{")return d(ae("}"),qe,ie,Ve);if(f=="(")return d(Me(je,")"),Qr,Ve);if(f=="<")return d(Me(Z,">"),Z);if(f=="quasi")return K(De,Ve)}function Qr(f){if(f=="=>")return d(Z)}function qe(f){return f.match(/[\}\)\]]/)?d():f==","||f==";"?d(qe):K(ke,qe)}function ke(f,p){if(f=="variable"||T.style=="keyword")return T.marked="property",d(ke);if(p=="?"||f=="number"||f=="string")return d(ke);if(f==":")return d(Z);if(f=="[")return d(ue("variable"),gi,ue("]"),ke);if(f=="(")return K(At,ke);if(!f.match(/[;\}\)\],]/))return d()}function De(f,p){return f!="quasi"?K():p.slice(p.length-2)!="${"?d(De):d(Z,Wn)}function Wn(f){if(f=="}")return T.marked="string-2",T.state.tokenize=q,d(De)}function je(f,p){return f=="variable"&&T.stream.match(/^\s*[?:]/,!1)||p=="?"?d(je):f==":"?d(Z):f=="spread"?d(je):K(Z)}function Ve(f,p){if(p=="<")return d(ae(">"),Me(Z,">"),ie,Ve);if(p=="|"||f=="."||p=="&")return d(Z);if(f=="[")return d(Z,ue("]"),Ve);if(p=="extends"||p=="implements")return T.marked="keyword",d(Z);if(p=="?")return d(Z,ue(":"),Z)}function Ze(f,p){if(p=="<")return d(ae(">"),Me(Z,">"),ie,Ve)}function fr(){return K(Z,Jr)}function Jr(f,p){if(p=="=")return d(Z)}function It(f,p){return p=="enum"?(T.marked="keyword",d(Tr)):K(nt,vt,yt,mi)}function nt(f,p){if(C&&we(p))return T.marked="keyword",d(nt);if(f=="variable")return be(p),d();if(f=="spread")return d(nt);if(f=="[")return ur(yi,"]");if(f=="{")return ur(jr,"}")}function jr(f,p){return f=="variable"&&!T.stream.match(/^\s*:/,!1)?(be(p),d(yt)):(f=="variable"&&(T.marked="property"),f=="spread"?d(nt):f=="}"?K():f=="["?d(xe,ue("]"),ue(":"),jr):d(ue(":"),nt,yt))}function yi(){return K(nt,yt)}function yt(f,p){if(p=="=")return d(Ne)}function mi(f){if(f==",")return d(It)}function kr(f,p){if(f=="keyword b"&&p=="else")return d(ae("form","else"),de,ie)}function Fn(f,p){if(p=="await")return d(Fn);if(f=="(")return d(ae(")"),Vr,ie)}function Vr(f){return f=="var"?d(It,Zt):f=="variable"?d(Zt):K(Zt)}function Zt(f,p){return f==")"?d():f==";"?d(Zt):p=="in"||p=="of"?(T.marked="keyword",d(xe,Zt)):K(xe,Zt)}function Nt(f,p){if(p=="*")return T.marked="keyword",d(Nt);if(f=="variable")return be(p),d(Nt);if(f=="(")return d(ze,ae(")"),Me(bt,")"),ie,gt,de,rt);if(C&&p=="<")return d(ae(">"),Me(fr,">"),ie,Nt)}function At(f,p){if(p=="*")return T.marked="keyword",d(At);if(f=="variable")return be(p),d(At);if(f=="(")return d(ze,ae(")"),Me(bt,")"),ie,gt,rt);if(C&&p=="<")return d(ae(">"),Me(fr,">"),ie,At)}function Pn(f,p){if(f=="keyword"||f=="variable")return T.marked="type",d(Pn);if(p=="<")return d(ae(">"),Me(fr,">"),ie)}function bt(f,p){return p=="@"&&d(xe,bt),f=="spread"?d(bt):C&&we(p)?(T.marked="keyword",d(bt)):C&&f=="this"?d(vt,yt):K(nt,vt,yt)}function Qt(f,p){return f=="variable"?In(f,p):Lr(f,p)}function In(f,p){if(f=="variable")return be(p),d(Lr)}function Lr(f,p){if(p=="<")return d(ae(">"),Me(fr,">"),ie,Lr);if(p=="extends"||p=="implements"||C&&f==",")return p=="implements"&&(T.marked="keyword"),d(C?Z:xe,Lr);if(f=="{")return d(ae("}"),ut,ie)}function ut(f,p){if(f=="async"||f=="variable"&&(p=="static"||p=="get"||p=="set"||C&&we(p))&&T.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return T.marked="keyword",d(ut);if(f=="variable"||T.style=="keyword")return T.marked="property",d(Rt,ut);if(f=="number"||f=="string")return d(Rt,ut);if(f=="[")return d(xe,vt,ue("]"),Rt,ut);if(p=="*")return T.marked="keyword",d(ut);if(C&&f=="(")return K(At,ut);if(f==";"||f==",")return d(ut);if(f=="}")return d();if(p=="@")return d(xe,ut)}function Rt(f,p){if(p=="!"||p=="?")return d(Rt);if(f==":")return d(Z,yt);if(p=="=")return d(Ne);var v=T.state.lexical.prev,N=v&&v.info=="interface";return K(N?At:Nt)}function Jt(f,p){return p=="*"?(T.marked="keyword",d(te,ue(";"))):p=="default"?(T.marked="keyword",d(xe,ue(";"))):f=="{"?d(Me(Rn,"}"),te,ue(";")):K(de)}function Rn(f,p){if(p=="as")return T.marked="keyword",d(ue("variable"));if(f=="variable")return K(Ne,Rn)}function Bt(f){return f=="string"?d():f=="("?K(xe):f=="."?K(pt):K(jt,$r,te)}function jt(f,p){return f=="{"?ur(jt,"}"):(f=="variable"&&be(p),p=="*"&&(T.marked="keyword"),d(He))}function $r(f){if(f==",")return d(jt,$r)}function He(f,p){if(p=="as")return T.marked="keyword",d(jt)}function te(f,p){if(p=="from")return T.marked="keyword",d(xe)}function zt(f){return f=="]"?d():K(Me(Ne,"]"))}function Tr(){return K(ae("form"),nt,ue("{"),ae("}"),Me(mt,"}"),ie,ie)}function mt(){return K(nt,yt)}function ge(f,p){return f.lastType=="operator"||f.lastType==","||j.test(p.charAt(0))||/[,.]/.test(p.charAt(0))}function Mt(f,p,v){return p.tokenize==L&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(p.lastType)||p.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(v||0)))}return{startState:function(f){var p={tokenize:L,lastType:"sof",cc:[],lexical:new ne((f||0)-G,0,"block",!1),localVars:I.localVars,context:I.localVars&&new Ce(null,null,!1),indented:f||0};return I.globalVars&&typeof I.globalVars=="object"&&(p.globalVars=I.globalVars),p},token:function(f,p){if(f.sol()&&(p.lexical.hasOwnProperty("align")||(p.lexical.align=!1),p.indented=f.indentation(),g(f,p)),p.tokenize!=z&&f.eatSpace())return null;var v=p.tokenize(f,p);return D=="comment"?v:(p.lastType=D=="operator"&&(H=="++"||H=="--")?"incdec":D,ee(p,v,D,H,f))},indent:function(f,p){if(f.tokenize==z||f.tokenize==q)return m.Pass;if(f.tokenize!=L)return 0;var v=p&&p.charAt(0),N=f.lexical,le;if(!/^\s*else\b/.test(p))for(var he=f.cc.length-1;he>=0;--he){var ve=f.cc[he];if(ve==ie)N=N.prev;else if(ve!=kr&&ve!=rt)break}for(;(N.type=="stat"||N.type=="form")&&(v=="}"||(le=f.cc[f.cc.length-1])&&(le==pt||le==Lt)&&!/^[,\.=+\-*:?[\(]/.test(p));)N=N.prev;M&&N.type==")"&&N.prev.type=="stat"&&(N=N.prev);var Ie=N.type,ct=v==Ie;return Ie=="vardef"?N.indented+(f.lastType=="operator"||f.lastType==","?N.info.length+1:0):Ie=="form"&&v=="{"?N.indented:Ie=="form"?N.indented+G:Ie=="stat"?N.indented+(ge(f,p)?M||G:0):N.info=="switch"&&!ct&&I.doubleIndentSwitch!=!1?N.indented+(/^(?:case|default)\b/.test(p)?G:2*G):N.align?N.column+(ct?0:1):N.indented+(ct?0:G)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:S?null:"/*",blockCommentEnd:S?null:"*/",blockCommentContinue:S?null:" * ",lineComment:S?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:S?"json":"javascript",jsonldMode:w,jsonMode:S,expressionAllowed:Mt,skipExpression:function(f){ee(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})})})();var zu={exports:{}};(function(Oe,Be){(function(m){m(tt())})(function(m){function U(w,S,x,C){if(x&&x.call){var W=x;x=null}else var W=M(w,x,"rangeFinder");typeof S=="number"&&(S=m.Pos(S,0));var P=M(w,x,"minFoldSize");function j(H){var k=W(w,S);if(!k||k.to.line-k.from.line<P)return null;if(C==="fold")return k;for(var L=w.findMarksAt(k.from),B=0;B<L.length;++B)if(L[B].__isFold){if(!H)return null;k.cleared=!0,L[B].clear()}return k}var O=j(!0);if(M(w,x,"scanUp"))for(;!O&&S.line>w.firstLine();)S=m.Pos(S.line-1,0),O=j(!1);if(!(!O||O.cleared||C==="unfold")){var R=I(w,x,O);m.on(R,"mousedown",function(H){D.clear(),m.e_preventDefault(H)});var D=w.markText(O.from,O.to,{replacedWith:R,clearOnEnter:M(w,x,"clearOnEnter"),__isFold:!0});D.on("clear",function(H,k){m.signal(w,"unfold",w,H,k)}),m.signal(w,"fold",w,O.from,O.to)}}function I(w,S,x){var C=M(w,S,"widget");if(typeof C=="function"&&(C=C(x.from,x.to)),typeof C=="string"){var W=document.createTextNode(C);C=document.createElement("span"),C.appendChild(W),C.className="CodeMirror-foldmarker"}else C&&(C=C.cloneNode(!0));return C}m.newFoldFunction=function(w,S){return function(x,C){U(x,C,{rangeFinder:w,widget:S})}},m.defineExtension("foldCode",function(w,S,x){U(this,w,S,x)}),m.defineExtension("isFolded",function(w){for(var S=this.findMarksAt(w),x=0;x<S.length;++x)if(S[x].__isFold)return!0}),m.commands.toggleFold=function(w){w.foldCode(w.getCursor())},m.commands.fold=function(w){w.foldCode(w.getCursor(),null,"fold")},m.commands.unfold=function(w){w.foldCode(w.getCursor(),{scanUp:!1},"unfold")},m.commands.foldAll=function(w){w.operation(function(){for(var S=w.firstLine(),x=w.lastLine();S<=x;S++)w.foldCode(m.Pos(S,0),{scanUp:!1},"fold")})},m.commands.unfoldAll=function(w){w.operation(function(){for(var S=w.firstLine(),x=w.lastLine();S<=x;S++)w.foldCode(m.Pos(S,0),{scanUp:!1},"unfold")})},m.registerHelper("fold","combine",function(){var w=Array.prototype.slice.call(arguments,0);return function(S,x){for(var C=0;C<w.length;++C){var W=w[C](S,x);if(W)return W}}}),m.registerHelper("fold","auto",function(w,S){for(var x=w.getHelpers(S,"fold"),C=0;C<x.length;C++){var W=x[C](w,S);if(W)return W}});var G={rangeFinder:m.fold.auto,widget:"\u2194",minFoldSize:0,scanUp:!1,clearOnEnter:!0};m.defineOption("foldOptions",null);function M(w,S,x){if(S&&S[x]!==void 0)return S[x];var C=w.options.foldOptions;return C&&C[x]!==void 0?C[x]:G[x]}m.defineExtension("foldOption",function(w,S){return M(this,w,S)})})})();(function(Oe,Be){(function(m){m(tt())})(function(m){function U(I){return function(G,M){var w=M.line,S=G.getLine(w);function x(R){for(var D,H=M.ch,k=0;;){var L=H<=0?-1:S.lastIndexOf(R[0],H-1);if(L==-1){if(k==1)break;k=1,H=S.length;continue}if(k==1&&L<M.ch)break;if(D=G.getTokenTypeAt(m.Pos(w,L+1)),!/^(comment|string)/.test(D))return{ch:L+1,tokenType:D,pair:R};H=L-1}}function C(R){var D=1,H=G.lastLine(),k,L=R.ch,B;e:for(var z=w;z<=H;++z)for(var q=G.getLine(z),Q=z==w?L:0;;){var g=q.indexOf(R.pair[0],Q),F=q.indexOf(R.pair[1],Q);if(g<0&&(g=q.length),F<0&&(F=q.length),Q=Math.min(g,F),Q==q.length)break;if(G.getTokenTypeAt(m.Pos(z,Q+1))==R.tokenType){if(Q==g)++D;else if(!--D){k=z,B=Q;break e}}++Q}return k==null||w==k?null:{from:m.Pos(w,L),to:m.Pos(k,B)}}for(var W=[],P=0;P<I.length;P++){var j=x(I[P]);j&&W.push(j)}W.sort(function(R,D){return R.ch-D.ch});for(var P=0;P<W.length;P++){var O=C(W[P]);if(O)return O}return null}}m.registerHelper("fold","brace",U([["{","}"],["[","]"]])),m.registerHelper("fold","brace-paren",U([["{","}"],["[","]"],["(",")"]])),m.registerHelper("fold","import",function(I,G){function M(P){if(P<I.firstLine()||P>I.lastLine())return null;var j=I.getTokenAt(m.Pos(P,1));if(/\S/.test(j.string)||(j=I.getTokenAt(m.Pos(P,j.end+1))),j.type!="keyword"||j.string!="import")return null;for(var O=P,R=Math.min(I.lastLine(),P+10);O<=R;++O){var D=I.getLine(O),H=D.indexOf(";");if(H!=-1)return{startCh:j.end,end:m.Pos(O,H)}}}var w=G.line,S=M(w),x;if(!S||M(w-1)||(x=M(w-2))&&x.end.line==w-1)return null;for(var C=S.end;;){var W=M(C.line+1);if(W==null)break;C=W.end}return{from:I.clipPos(m.Pos(w,S.startCh+1)),to:C}}),m.registerHelper("fold","include",function(I,G){function M(W){if(W<I.firstLine()||W>I.lastLine())return null;var P=I.getTokenAt(m.Pos(W,1));if(/\S/.test(P.string)||(P=I.getTokenAt(m.Pos(W,P.end+1))),P.type=="meta"&&P.string.slice(0,8)=="#include")return P.start+8}var w=G.line,S=M(w);if(S==null||M(w-1)!=null)return null;for(var x=w;;){var C=M(x+1);if(C==null)break;++x}return{from:m.Pos(w,S+1),to:I.clipPos(m.Pos(x))}})})})();(function(Oe,Be){(function(m){m(tt())})(function(m){m.registerGlobalHelper("fold","comment",function(U){return U.blockCommentStart&&U.blockCommentEnd},function(U,I){var G=U.getModeAt(I),M=G.blockCommentStart,w=G.blockCommentEnd;if(!M||!w)return;for(var S=I.line,x=U.getLine(S),C,W=I.ch,P=0;;){var j=W<=0?-1:x.lastIndexOf(M,W-1);if(j==-1){if(P==1)return;P=1,W=x.length;continue}if(P==1&&j<I.ch)return;if(/comment/.test(U.getTokenTypeAt(m.Pos(S,j+1)))&&(j==0||x.slice(j-w.length,j)==w||!/comment/.test(U.getTokenTypeAt(m.Pos(S,j))))){C=j+M.length;break}W=j-1}var O=1,R=U.lastLine(),D,H;e:for(var k=S;k<=R;++k)for(var L=U.getLine(k),B=k==S?C:0;;){var z=L.indexOf(M,B),q=L.indexOf(w,B);if(z<0&&(z=L.length),q<0&&(q=L.length),B=Math.min(z,q),B==L.length)break;if(B==z)++O;else if(!--O){D=k,H=B;break e}++B}if(!(D==null||S==D&&H==C))return{from:m.Pos(S,C),to:m.Pos(D,H)}})})})();(function(Oe,Be){(function(m){m(tt())})(function(m){function U(I,G){var M=I.getLine(G),w=M.search(/\S/);return w==-1||/\bcomment\b/.test(I.getTokenTypeAt(m.Pos(G,w+1)))?-1:m.countColumn(M,null,I.getOption("tabSize"))}m.registerHelper("fold","indent",function(I,G){var M=U(I,G.line);if(!(M<0)){for(var w=null,S=G.line+1,x=I.lastLine();S<=x;++S){var C=U(I,S);if(C!=-1)if(C>M)w=S;else break}if(w)return{from:m.Pos(G.line,I.getLine(G.line).length),to:m.Pos(w,I.getLine(w).length)}}})})})();(function(Oe,Be){(function(m){m(tt(),zu.exports)})(function(m){m.defineOption("foldGutter",!1,function(D,H,k){k&&k!=m.Init&&(D.clearGutter(D.state.foldGutter.options.gutter),D.state.foldGutter=null,D.off("gutterClick",W),D.off("changes",j),D.off("viewportChange",O),D.off("fold",R),D.off("unfold",R),D.off("swapDoc",j),D.off("optionChange",P)),H&&(D.state.foldGutter=new I(G(H)),C(D),D.on("gutterClick",W),D.on("changes",j),D.on("viewportChange",O),D.on("fold",R),D.on("unfold",R),D.on("swapDoc",j),D.on("optionChange",P))});var U=m.Pos;function I(D){this.options=D,this.from=this.to=0}function G(D){return D===!0&&(D={}),D.gutter==null&&(D.gutter="CodeMirror-foldgutter"),D.indicatorOpen==null&&(D.indicatorOpen="CodeMirror-foldgutter-open"),D.indicatorFolded==null&&(D.indicatorFolded="CodeMirror-foldgutter-folded"),D}function M(D,H){for(var k=D.findMarks(U(H,0),U(H+1,0)),L=0;L<k.length;++L)if(k[L].__isFold){var B=k[L].find(-1);if(B&&B.line===H)return k[L]}}function w(D){if(typeof D=="string"){var H=document.createElement("div");return H.className=D+" CodeMirror-guttermarker-subtle",H}else return D.cloneNode(!0)}function S(D,H,k){var L=D.state.foldGutter.options,B=H-1,z=D.foldOption(L,"minFoldSize"),q=D.foldOption(L,"rangeFinder"),Q=typeof L.indicatorFolded=="string"&&x(L.indicatorFolded),g=typeof L.indicatorOpen=="string"&&x(L.indicatorOpen);D.eachLine(H,k,function(F){++B;var ne=null,V=F.gutterMarkers;if(V&&(V=V[L.gutter]),M(D,B)){if(Q&&V&&Q.test(V.className))return;ne=w(L.indicatorFolded)}else{var ee=U(B,0),T=q&&q(D,ee);if(T&&T.to.line-T.from.line>=z){if(g&&V&&g.test(V.className))return;ne=w(L.indicatorOpen)}}!ne&&!V||D.setGutterMarker(F,L.gutter,ne)})}function x(D){return new RegExp("(^|\\s)"+D+"(?:$|\\s)\\s*")}function C(D){var H=D.getViewport(),k=D.state.foldGutter;!k||(D.operation(function(){S(D,H.from,H.to)}),k.from=H.from,k.to=H.to)}function W(D,H,k){var L=D.state.foldGutter;if(!!L){var B=L.options;if(k==B.gutter){var z=M(D,H);z?z.clear():D.foldCode(U(H,0),B)}}}function P(D,H){H=="mode"&&j(D)}function j(D){var H=D.state.foldGutter;if(!!H){var k=H.options;H.from=H.to=0,clearTimeout(H.changeUpdate),H.changeUpdate=setTimeout(function(){C(D)},k.foldOnChangeTimeSpan||600)}}function O(D){var H=D.state.foldGutter;if(!!H){var k=H.options;clearTimeout(H.changeUpdate),H.changeUpdate=setTimeout(function(){var L=D.getViewport();H.from==H.to||L.from-H.to>20||H.from-L.to>20?C(D):D.operation(function(){L.from<H.from&&(S(D,L.from,H.from),H.from=L.from),L.to>H.to&&(S(D,H.to,L.to),H.to=L.to)})},k.updateViewportTimeSpan||400)}}function R(D,H){var k=D.state.foldGutter;if(!!k){var L=H.line;L>=k.from&&L<k.to&&S(D,L,L+1)}}})})();var yl={exports:{}},ml;function Al(){return ml||(ml=1,function(Oe,Be){(function(m){m(tt())})(function(m){m.defineExtension("annotateScrollbar",function(I){return typeof I=="string"&&(I={className:I}),new U(this,I)}),m.defineOption("scrollButtonHeight",0);function U(I,G){this.cm=I,this.options=G,this.buttonHeight=G.scrollButtonHeight||I.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=I.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();function M(S){clearTimeout(w.doRedraw),w.doRedraw=setTimeout(function(){w.redraw()},S)}var w=this;I.on("refresh",this.resizeHandler=function(){clearTimeout(w.doUpdate),w.doUpdate=setTimeout(function(){w.computeScale()&&M(20)},100)}),I.on("markerAdded",this.resizeHandler),I.on("markerCleared",this.resizeHandler),G.listenForChanges!==!1&&I.on("changes",this.changeHandler=function(){M(250)})}U.prototype.computeScale=function(){var I=this.cm,G=(I.getWrapperElement().clientHeight-I.display.barHeight-this.buttonHeight*2)/I.getScrollerElement().scrollHeight;if(G!=this.hScale)return this.hScale=G,!0},U.prototype.update=function(I){this.annotations=I,this.redraw()},U.prototype.redraw=function(I){I!==!1&&this.computeScale();var G=this.cm,M=this.hScale,w=document.createDocumentFragment(),S=this.annotations,x=G.getOption("lineWrapping"),C=x&&G.defaultTextHeight()*1.5,W=null,P=null;function j(q,Q){if(W!=q.line){W=q.line,P=G.getLineHandle(q.line);var g=G.getLineHandleVisualStart(P);g!=P&&(W=G.getLineNumber(g),P=g)}if(P.widgets&&P.widgets.length||x&&P.height>C)return G.charCoords(q,"local")[Q?"top":"bottom"];var F=G.heightAtLine(P,"local");return F+(Q?0:P.height)}var O=G.lastLine();if(G.display.barWidth)for(var R=0,D;R<S.length;R++){var H=S[R];if(!(H.to.line>O)){for(var k=D||j(H.from,!0)*M,L=j(H.to,!1)*M;R<S.length-1&&!(S[R+1].to.line>O||(D=j(S[R+1].from,!0)*M,D>L+.9));)H=S[++R],L=j(H.to,!1)*M;if(L!=k){var B=Math.max(L-k,3),z=w.appendChild(document.createElement("div"));z.style.cssText="position: absolute; right: 0px; width: "+Math.max(G.display.barWidth-1,2)+"px; top: "+(k+this.buttonHeight)+"px; height: "+B+"px",z.className=this.options.className,H.id&&z.setAttribute("annotation-id",H.id)}}}this.div.textContent="",this.div.appendChild(w)},U.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}})}()),yl.exports}Al();var bl={exports:{}},xl={exports:{}},wl;function po(){return wl||(wl=1,function(Oe,Be){(function(m){m(tt())})(function(m){var U=m.Pos;function I(k){var L=k.flags;return L!=null?L:(k.ignoreCase?"i":"")+(k.global?"g":"")+(k.multiline?"m":"")}function G(k,L){for(var B=I(k),z=B,q=0;q<L.length;q++)z.indexOf(L.charAt(q))==-1&&(z+=L.charAt(q));return B==z?k:new RegExp(k.source,z)}function M(k){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(k.source)}function w(k,L,B){L=G(L,"g");for(var z=B.line,q=B.ch,Q=k.lastLine();z<=Q;z++,q=0){L.lastIndex=q;var g=k.getLine(z),F=L.exec(g);if(F)return{from:U(z,F.index),to:U(z,F.index+F[0].length),match:F}}}function S(k,L,B){if(!M(L))return w(k,L,B);L=G(L,"gm");for(var z,q=1,Q=B.line,g=k.lastLine();Q<=g;){for(var F=0;F<q&&!(Q>g);F++){var ne=k.getLine(Q++);z=z==null?ne:z+`
|
|
`+ne}q=q*2,L.lastIndex=B.ch;var V=L.exec(z);if(V){var ee=z.slice(0,V.index).split(`
|
|
`),T=V[0].split(`
|
|
`),K=B.line+ee.length-1,d=ee[ee.length-1].length;return{from:U(K,d),to:U(K+T.length-1,T.length==1?d+T[0].length:T[T.length-1].length),match:V}}}}function x(k,L,B){for(var z,q=0;q<=k.length;){L.lastIndex=q;var Q=L.exec(k);if(!Q)break;var g=Q.index+Q[0].length;if(g>k.length-B)break;(!z||g>z.index+z[0].length)&&(z=Q),q=Q.index+1}return z}function C(k,L,B){L=G(L,"g");for(var z=B.line,q=B.ch,Q=k.firstLine();z>=Q;z--,q=-1){var g=k.getLine(z),F=x(g,L,q<0?0:g.length-q);if(F)return{from:U(z,F.index),to:U(z,F.index+F[0].length),match:F}}}function W(k,L,B){if(!M(L))return C(k,L,B);L=G(L,"gm");for(var z,q=1,Q=k.getLine(B.line).length-B.ch,g=B.line,F=k.firstLine();g>=F;){for(var ne=0;ne<q&&g>=F;ne++){var V=k.getLine(g--);z=z==null?V:V+`
|
|
`+z}q*=2;var ee=x(z,L,Q);if(ee){var T=z.slice(0,ee.index).split(`
|
|
`),K=ee[0].split(`
|
|
`),d=g+T.length,ce=T[T.length-1].length;return{from:U(d,ce),to:U(d+K.length-1,K.length==1?ce+K[0].length:K[K.length-1].length),match:ee}}}}var P,j;String.prototype.normalize?(P=function(k){return k.normalize("NFD").toLowerCase()},j=function(k){return k.normalize("NFD")}):(P=function(k){return k.toLowerCase()},j=function(k){return k});function O(k,L,B,z){if(k.length==L.length)return B;for(var q=0,Q=B+Math.max(0,k.length-L.length);;){if(q==Q)return q;var g=q+Q>>1,F=z(k.slice(0,g)).length;if(F==B)return g;F>B?Q=g:q=g+1}}function R(k,L,B,z){if(!L.length)return null;var q=z?P:j,Q=q(L).split(/\r|\n\r?/);e:for(var g=B.line,F=B.ch,ne=k.lastLine()+1-Q.length;g<=ne;g++,F=0){var V=k.getLine(g).slice(F),ee=q(V);if(Q.length==1){var T=ee.indexOf(Q[0]);if(T==-1)continue e;var B=O(V,ee,T,q)+F;return{from:U(g,O(V,ee,T,q)+F),to:U(g,O(V,ee,T+Q[0].length,q)+F)}}else{var K=ee.length-Q[0].length;if(ee.slice(K)!=Q[0])continue e;for(var d=1;d<Q.length-1;d++)if(q(k.getLine(g+d))!=Q[d])continue e;var ce=k.getLine(g+Q.length-1),be=q(ce),Le=Q[Q.length-1];if(be.slice(0,Le.length)!=Le)continue e;return{from:U(g,O(V,ee,K,q)+F),to:U(g+Q.length-1,O(ce,be,Le.length,q))}}}}function D(k,L,B,z){if(!L.length)return null;var q=z?P:j,Q=q(L).split(/\r|\n\r?/);e:for(var g=B.line,F=B.ch,ne=k.firstLine()-1+Q.length;g>=ne;g--,F=-1){var V=k.getLine(g);F>-1&&(V=V.slice(0,F));var ee=q(V);if(Q.length==1){var T=ee.lastIndexOf(Q[0]);if(T==-1)continue e;return{from:U(g,O(V,ee,T,q)),to:U(g,O(V,ee,T+Q[0].length,q))}}else{var K=Q[Q.length-1];if(ee.slice(0,K.length)!=K)continue e;for(var d=1,B=g-Q.length+1;d<Q.length-1;d++)if(q(k.getLine(B+d))!=Q[d])continue e;var ce=k.getLine(g+1-Q.length),be=q(ce);if(be.slice(be.length-Q[0].length)!=Q[0])continue e;return{from:U(g+1-Q.length,O(ce,be,ce.length-Q[0].length,q)),to:U(g,O(V,ee,K.length,q))}}}}function H(k,L,B,z){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=k,B=B?k.clipPos(B):U(0,0),this.pos={from:B,to:B};var q;typeof z=="object"?q=z.caseFold:(q=z,z=null),typeof L=="string"?(q==null&&(q=!1),this.matches=function(Q,g){return(Q?D:R)(k,L,g,q)}):(L=G(L,"gm"),!z||z.multiline!==!1?this.matches=function(Q,g){return(Q?W:S)(k,L,g)}:this.matches=function(Q,g){return(Q?C:w)(k,L,g)})}H.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(k){var L=this.doc.clipPos(k?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(L=U(L.line,L.ch),k?(L.ch--,L.ch<0&&(L.line--,L.ch=(this.doc.getLine(L.line)||"").length)):(L.ch++,L.ch>(this.doc.getLine(L.line)||"").length&&(L.ch=0,L.line++)),m.cmpPos(L,this.doc.clipPos(L))!=0))return this.atOccurrence=!1;var B=this.matches(k,L);if(this.afterEmptyMatch=B&&m.cmpPos(B.from,B.to)==0,B)return this.pos=B,this.atOccurrence=!0,this.pos.match||!0;var z=U(k?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:z,to:z},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(k,L){if(!!this.atOccurrence){var B=m.splitLines(k);this.doc.replaceRange(B,this.pos.from,this.pos.to,L),this.pos.to=U(this.pos.from.line+B.length-1,B[B.length-1].length+(B.length==1?this.pos.from.ch:0))}}},m.defineExtension("getSearchCursor",function(k,L,B){return new H(this.doc,k,L,B)}),m.defineDocExtension("getSearchCursor",function(k,L,B){return new H(this,k,L,B)}),m.defineExtension("selectMatches",function(k,L){for(var B=[],z=this.getSearchCursor(k,this.getCursor("from"),L);z.findNext()&&!(m.cmpPos(z.to(),this.getCursor("to"))>0);)B.push({anchor:z.from(),head:z.to()});B.length&&this.setSelections(B,0)})})}()),xl.exports}var Sl;function Ml(){return Sl||(Sl=1,function(Oe,Be){(function(m){m(tt(),po(),Al())})(function(m){m.defineExtension("showMatchesOnScrollbar",function(M,w,S){return typeof S=="string"&&(S={className:S}),S||(S={}),new U(this,M,w,S)});function U(M,w,S,x){this.cm=M,this.options=x;var C={listenForChanges:!1};for(var W in x)C[W]=x[W];C.className||(C.className="CodeMirror-search-match"),this.annotation=M.annotateScrollbar(C),this.query=w,this.caseFold=S,this.gap={from:M.firstLine(),to:M.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var P=this;M.on("change",this.changeHandler=function(j,O){P.onChange(O)})}var I=1e3;U.prototype.findMatches=function(){if(!!this.gap){for(var M=0;M<this.matches.length;M++){var w=this.matches[M];if(w.from.line>=this.gap.to)break;w.to.line>=this.gap.from&&this.matches.splice(M--,1)}for(var S=this.cm.getSearchCursor(this.query,m.Pos(this.gap.from,0),{caseFold:this.caseFold,multiline:this.options.multiline}),x=this.options&&this.options.maxMatches||I;S.findNext();){var w={from:S.from(),to:S.to()};if(w.from.line>=this.gap.to||(this.matches.splice(M++,0,w),this.matches.length>x))break}this.gap=null}};function G(M,w,S){return M<=w?M:Math.max(w,M+S)}U.prototype.onChange=function(M){var w=M.from.line,S=m.changeEnd(M).line,x=S-M.to.line;if(this.gap?(this.gap.from=Math.min(G(this.gap.from,w,x),M.from.line),this.gap.to=Math.max(G(this.gap.to,w,x),M.from.line)):this.gap={from:M.from.line,to:S+1},x)for(var C=0;C<this.matches.length;C++){var W=this.matches[C],P=G(W.from.line,w,x);P!=W.from.line&&(W.from=m.Pos(P,W.from.ch));var j=G(W.to.line,w,x);j!=W.to.line&&(W.to=m.Pos(j,W.to.ch))}clearTimeout(this.update);var O=this;this.update=setTimeout(function(){O.updateAfterChange()},250)},U.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},U.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}})}()),bl.exports}Ml();(function(Oe,Be){(function(m){m(tt(),Ml())})(function(m){var U={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function I(O){this.options={};for(var R in U)this.options[R]=(O&&O.hasOwnProperty(R)?O:U)[R];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}m.defineOption("highlightSelectionMatches",!1,function(O,R,D){if(D&&D!=m.Init&&(x(O),clearTimeout(O.state.matchHighlighter.timeout),O.state.matchHighlighter=null,O.off("cursorActivity",G),O.off("focus",M)),R){var H=O.state.matchHighlighter=new I(R);O.hasFocus()?(H.active=!0,C(O)):O.on("focus",M),O.on("cursorActivity",G)}});function G(O){var R=O.state.matchHighlighter;(R.active||O.hasFocus())&&w(O,R)}function M(O){var R=O.state.matchHighlighter;R.active||(R.active=!0,w(O,R))}function w(O,R){clearTimeout(R.timeout),R.timeout=setTimeout(function(){C(O)},R.options.delay)}function S(O,R,D,H){var k=O.state.matchHighlighter;if(O.addOverlay(k.overlay=j(R,D,H)),k.options.annotateScrollbar&&O.showMatchesOnScrollbar){var L=D?new RegExp((/\w/.test(R.charAt(0))?"\\b":"")+R.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(R.charAt(R.length-1))?"\\b":"")):R;k.matchesonscroll=O.showMatchesOnScrollbar(L,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function x(O){var R=O.state.matchHighlighter;R.overlay&&(O.removeOverlay(R.overlay),R.overlay=null,R.matchesonscroll&&(R.matchesonscroll.clear(),R.matchesonscroll=null))}function C(O){O.operation(function(){var R=O.state.matchHighlighter;if(x(O),!O.somethingSelected()&&R.options.showToken){for(var D=R.options.showToken===!0?/[\w$]/:R.options.showToken,H=O.getCursor(),k=O.getLine(H.line),L=H.ch,B=L;L&&D.test(k.charAt(L-1));)--L;for(;B<k.length&&D.test(k.charAt(B));)++B;L<B&&S(O,k.slice(L,B),D,R.options.style);return}var z=O.getCursor("from"),q=O.getCursor("to");if(z.line==q.line&&!(R.options.wordsOnly&&!W(O,z,q))){var Q=O.getRange(z,q);R.options.trim&&(Q=Q.replace(/^\s+|\s+$/g,"")),Q.length>=R.options.minChars&&S(O,Q,!1,R.options.style)}})}function W(O,R,D){var H=O.getRange(R,D);if(H.match(/^\w+$/)!==null){if(R.ch>0){var k={line:R.line,ch:R.ch-1},L=O.getRange(k,R);if(L.match(/\W/)===null)return!1}if(D.ch<O.getLine(R.line).length){var k={line:D.line,ch:D.ch+1},L=O.getRange(D,k);if(L.match(/\W/)===null)return!1}return!0}else return!1}function P(O,R){return(!O.start||!R.test(O.string.charAt(O.start-1)))&&(O.pos==O.string.length||!R.test(O.string.charAt(O.pos)))}function j(O,R,D){return{token:function(H){if(H.match(O)&&(!R||P(H,R)))return D;H.next(),H.skipTo(O.charAt(0))||H.skipToEnd()}}}})})();var Cl={exports:{}},kl;function vo(){return kl||(kl=1,function(Oe,Be){(function(m){m(tt())})(function(m){function U(G,M,w){var S=G.getWrapperElement(),x;return x=S.appendChild(document.createElement("div")),w?x.className="CodeMirror-dialog CodeMirror-dialog-bottom":x.className="CodeMirror-dialog CodeMirror-dialog-top",typeof M=="string"?x.innerHTML=M:x.appendChild(M),m.addClass(S,"dialog-opened"),x}function I(G,M){G.state.currentNotificationClose&&G.state.currentNotificationClose(),G.state.currentNotificationClose=M}m.defineExtension("openDialog",function(G,M,w){w||(w={}),I(this,null);var S=U(this,G,w.bottom),x=!1,C=this;function W(O){if(typeof O=="string")P.value=O;else{if(x)return;x=!0,m.rmClass(S.parentNode,"dialog-opened"),S.parentNode.removeChild(S),C.focus(),w.onClose&&w.onClose(S)}}var P=S.getElementsByTagName("input")[0],j;return P?(P.focus(),w.value&&(P.value=w.value,w.selectValueOnOpen!==!1&&P.select()),w.onInput&&m.on(P,"input",function(O){w.onInput(O,P.value,W)}),w.onKeyUp&&m.on(P,"keyup",function(O){w.onKeyUp(O,P.value,W)}),m.on(P,"keydown",function(O){w&&w.onKeyDown&&w.onKeyDown(O,P.value,W)||((O.keyCode==27||w.closeOnEnter!==!1&&O.keyCode==13)&&(P.blur(),m.e_stop(O),W()),O.keyCode==13&&M(P.value,O))}),w.closeOnBlur!==!1&&m.on(S,"focusout",function(O){O.relatedTarget!==null&&W()})):(j=S.getElementsByTagName("button")[0])&&(m.on(j,"click",function(){W(),C.focus()}),w.closeOnBlur!==!1&&m.on(j,"blur",W),j.focus()),W}),m.defineExtension("openConfirm",function(G,M,w){I(this,null);var S=U(this,G,w&&w.bottom),x=S.getElementsByTagName("button"),C=!1,W=this,P=1;function j(){C||(C=!0,m.rmClass(S.parentNode,"dialog-opened"),S.parentNode.removeChild(S),W.focus())}x[0].focus();for(var O=0;O<x.length;++O){var R=x[O];(function(D){m.on(R,"click",function(H){m.e_preventDefault(H),j(),D&&D(W)})})(M[O]),m.on(R,"blur",function(){--P,setTimeout(function(){P<=0&&j()},200)}),m.on(R,"focus",function(){++P})}}),m.defineExtension("openNotification",function(G,M){I(this,W);var w=U(this,G,M&&M.bottom),S=!1,x,C=M&&typeof M.duration<"u"?M.duration:5e3;function W(){S||(S=!0,clearTimeout(x),m.rmClass(w.parentNode,"dialog-opened"),w.parentNode.removeChild(w))}return m.on(w,"click",function(P){m.e_preventDefault(P),W()}),C&&(x=setTimeout(W,C)),W})})}()),Cl.exports}(function(Oe,Be){(function(m){m(tt(),vo())})(function(m){m.defineOption("search",{bottom:!1});function U(M,w,S,x,C){M.openDialog?M.openDialog(w,C,{value:x,selectValueOnOpen:!0,bottom:M.options.search.bottom}):C(prompt(S,x))}function I(M){return M.phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+M.phrase("(Use line:column or scroll% syntax)")+"</span>"}function G(M,w){var S=Number(w);return/^[-+]/.test(w)?M.getCursor().line+S:S-1}m.commands.jumpToLine=function(M){var w=M.getCursor();U(M,I(M),M.phrase("Jump to line:"),w.line+1+":"+w.ch,function(S){if(!!S){var x;if(x=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(S))M.setCursor(G(M,x[1]),Number(x[2]));else if(x=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(S)){var C=Math.round(M.lineCount()*Number(x[1])/100);/^[-+]/.test(x[1])&&(C=w.line+C+1),M.setCursor(C-1,w.ch)}else(x=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(S))&&M.setCursor(G(M,x[1]),w.ch)}})},m.keyMap.default["Alt-G"]="jumpToLine"})})();vo();po();(function(Oe,Be){(function(m){m(tt(),po(),vo())})(function(m){m.defineOption("search",{bottom:!1});function U(g,F){return typeof g=="string"?g=new RegExp(g.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),F?"gi":"g"):g.global||(g=new RegExp(g.source,g.ignoreCase?"gi":"g")),{token:function(ne){g.lastIndex=ne.pos;var V=g.exec(ne.string);if(V&&V.index==ne.pos)return ne.pos+=V[0].length||1,"searching";V?ne.pos=V.index:ne.skipToEnd()}}}function I(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function G(g){return g.state.search||(g.state.search=new I)}function M(g){return typeof g=="string"&&g==g.toLowerCase()}function w(g,F,ne){return g.getSearchCursor(F,ne,{caseFold:M(F),multiline:!0})}function S(g,F,ne,V,ee){g.openDialog(F,V,{value:ne,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){D(g)},onKeyDown:ee,bottom:g.options.search.bottom})}function x(g,F,ne,V,ee){g.openDialog?g.openDialog(F,ee,{value:V,selectValueOnOpen:!0,bottom:g.options.search.bottom}):ee(prompt(ne,V))}function C(g,F,ne,V){g.openConfirm?g.openConfirm(F,V):confirm(ne)&&V[0]()}function W(g){return g.replace(/\\([nrt\\])/g,function(F,ne){return ne=="n"?`
|
|
`:ne=="r"?"\r":ne=="t"?" ":ne=="\\"?"\\":F})}function P(g){var F=g.match(/^\/(.*)\/([a-z]*)$/);if(F)try{g=new RegExp(F[1],F[2].indexOf("i")==-1?"":"i")}catch{}else g=W(g);return(typeof g=="string"?g=="":g.test(""))&&(g=/x^/),g}function j(g,F,ne){F.queryText=ne,F.query=P(ne),g.removeOverlay(F.overlay,M(F.query)),F.overlay=U(F.query,M(F.query)),g.addOverlay(F.overlay),g.showMatchesOnScrollbar&&(F.annotate&&(F.annotate.clear(),F.annotate=null),F.annotate=g.showMatchesOnScrollbar(F.query,M(F.query)))}function O(g,F,ne,V){var ee=G(g);if(ee.query)return R(g,F);var T=g.getSelection()||ee.lastQuery;if(T instanceof RegExp&&T.source=="x^"&&(T=null),ne&&g.openDialog){var K=null,d=function(ce,be){m.e_stop(be),ce&&(ce!=ee.queryText&&(j(g,ee,ce),ee.posFrom=ee.posTo=g.getCursor()),K&&(K.style.opacity=1),R(g,be.shiftKey,function(Le,we){var Ce;we.line<3&&document.querySelector&&(Ce=g.display.wrapper.querySelector(".CodeMirror-dialog"))&&Ce.getBoundingClientRect().bottom-4>g.cursorCoords(we,"window").top&&((K=Ce).style.opacity=.4)}))};S(g,k(g),T,d,function(ce,be){var Le=m.keyName(ce),we=g.getOption("extraKeys"),Ce=we&&we[Le]||m.keyMap[g.getOption("keyMap")][Le];Ce=="findNext"||Ce=="findPrev"||Ce=="findPersistentNext"||Ce=="findPersistentPrev"?(m.e_stop(ce),j(g,G(g),be),g.execCommand(Ce)):(Ce=="find"||Ce=="findPersistent")&&(m.e_stop(ce),d(be,ce))}),V&&T&&(j(g,ee,T),R(g,F))}else x(g,k(g),"Search for:",T,function(ce){ce&&!ee.query&&g.operation(function(){j(g,ee,ce),ee.posFrom=ee.posTo=g.getCursor(),R(g,F)})})}function R(g,F,ne){g.operation(function(){var V=G(g),ee=w(g,V.query,F?V.posFrom:V.posTo);!ee.find(F)&&(ee=w(g,V.query,F?m.Pos(g.lastLine()):m.Pos(g.firstLine(),0)),!ee.find(F))||(g.setSelection(ee.from(),ee.to()),g.scrollIntoView({from:ee.from(),to:ee.to()},20),V.posFrom=ee.from(),V.posTo=ee.to(),ne&&ne(ee.from(),ee.to()))})}function D(g){g.operation(function(){var F=G(g);F.lastQuery=F.query,F.query&&(F.query=F.queryText=null,g.removeOverlay(F.overlay),F.annotate&&(F.annotate.clear(),F.annotate=null))})}function H(g,F){var ne=g?document.createElement(g):document.createDocumentFragment();for(var V in F)ne[V]=F[V];for(var ee=2;ee<arguments.length;ee++){var T=arguments[ee];ne.appendChild(typeof T=="string"?document.createTextNode(T):T)}return ne}function k(g){var F=H("label",{className:"CodeMirror-search-label"},g.phrase("Search:"),H("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));return F.setAttribute("for","CodeMirror-search-field"),H("",null,F," ",H("span",{style:"color: #666",className:"CodeMirror-search-hint"},g.phrase("(Use /re/ syntax for regexp search)")))}function L(g){return H("",null," ",H("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",H("span",{style:"color: #666",className:"CodeMirror-search-hint"},g.phrase("(Use /re/ syntax for regexp search)")))}function B(g){return H("",null,H("span",{className:"CodeMirror-search-label"},g.phrase("With:"))," ",H("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}function z(g){return H("",null,H("span",{className:"CodeMirror-search-label"},g.phrase("Replace?"))," ",H("button",{},g.phrase("Yes"))," ",H("button",{},g.phrase("No"))," ",H("button",{},g.phrase("All"))," ",H("button",{},g.phrase("Stop")))}function q(g,F,ne){g.operation(function(){for(var V=w(g,F);V.findNext();)if(typeof F!="string"){var ee=g.getRange(V.from(),V.to()).match(F);V.replace(ne.replace(/\$(\d)/g,function(T,K){return ee[K]}))}else V.replace(ne)})}function Q(g,F){if(!g.getOption("readOnly")){var ne=g.getSelection()||G(g).lastQuery,V=F?g.phrase("Replace all:"):g.phrase("Replace:"),ee=H("",null,H("span",{className:"CodeMirror-search-label"},V),L(g));x(g,ee,V,ne,function(T){!T||(T=P(T),x(g,B(g),g.phrase("Replace with:"),"",function(K){if(K=W(K),F)q(g,T,K);else{D(g);var d=w(g,T,g.getCursor("from")),ce=function(){var Le=d.from(),we;!(we=d.findNext())&&(d=w(g,T),!(we=d.findNext())||Le&&d.from().line==Le.line&&d.from().ch==Le.ch)||(g.setSelection(d.from(),d.to()),g.scrollIntoView({from:d.from(),to:d.to()}),C(g,z(g),g.phrase("Replace?"),[function(){be(we)},ce,function(){q(g,T,K)}]))},be=function(Le){d.replace(typeof T=="string"?K:K.replace(/\$(\d)/g,function(we,Ce){return Le[Ce]})),ce()};ce()}}))})}}m.commands.find=function(g){D(g),O(g)},m.commands.findPersistent=function(g){D(g),O(g,!1,!0)},m.commands.findPersistentNext=function(g){O(g,!1,!0,!0)},m.commands.findPersistentPrev=function(g){O(g,!0,!0,!0)},m.commands.findNext=O,m.commands.findPrev=function(g){O(g,!0)},m.commands.clearSearch=D,m.commands.replace=Q,m.commands.replaceAll=function(g){Q(g,!0)}})})();(function(Oe,Be){(function(m){m(tt())})(function(m){m.defineOption("placeholder","",function(x,C,W){var P=W&&W!=m.Init;if(C&&!P)x.on("blur",M),x.on("change",w),x.on("swapDoc",w),m.on(x.getInputField(),"compositionupdate",x.state.placeholderCompose=function(){G(x)}),w(x);else if(!C&&P){x.off("blur",M),x.off("change",w),x.off("swapDoc",w),m.off(x.getInputField(),"compositionupdate",x.state.placeholderCompose),U(x);var j=x.getWrapperElement();j.className=j.className.replace(" CodeMirror-empty","")}C&&!x.hasFocus()&&M(x)});function U(x){x.state.placeholder&&(x.state.placeholder.parentNode.removeChild(x.state.placeholder),x.state.placeholder=null)}function I(x){U(x);var C=x.state.placeholder=document.createElement("pre");C.style.cssText="height: 0; overflow: visible",C.style.direction=x.getOption("direction"),C.className="CodeMirror-placeholder CodeMirror-line-like";var W=x.getOption("placeholder");typeof W=="string"&&(W=document.createTextNode(W)),C.appendChild(W),x.display.lineSpace.insertBefore(C,x.display.lineSpace.firstChild)}function G(x){setTimeout(function(){var C=!1;if(x.lineCount()==1){var W=x.getInputField();C=W.nodeName=="TEXTAREA"?!x.getLine(0).length:!/[^\u200b]/.test(W.querySelector(".CodeMirror-line").textContent)}C?I(x):U(x)},20)}function M(x){S(x)&&I(x)}function w(x){var C=x.getWrapperElement(),W=S(x);C.className=C.className.replace(" CodeMirror-empty","")+(W?" CodeMirror-empty":""),W?I(x):U(x)}function S(x){return x.lineCount()===1&&x.getLine(0)===""}})})();(function(Oe,Be){(function(m){m(tt())})(function(m){var U="CodeMirror-activeline",I="CodeMirror-activeline-background",G="CodeMirror-activeline-gutter";m.defineOption("styleActiveLine",!1,function(C,W,P){var j=P==m.Init?!1:P;W!=j&&(j&&(C.off("beforeSelectionChange",x),M(C),delete C.state.activeLines),W&&(C.state.activeLines=[],S(C,C.listSelections()),C.on("beforeSelectionChange",x)))});function M(C){for(var W=0;W<C.state.activeLines.length;W++)C.removeLineClass(C.state.activeLines[W],"wrap",U),C.removeLineClass(C.state.activeLines[W],"background",I),C.removeLineClass(C.state.activeLines[W],"gutter",G)}function w(C,W){if(C.length!=W.length)return!1;for(var P=0;P<C.length;P++)if(C[P]!=W[P])return!1;return!0}function S(C,W){for(var P=[],j=0;j<W.length;j++){var O=W[j],R=C.getOption("styleActiveLine");if(!(typeof R=="object"&&R.nonEmpty?O.anchor.line!=O.head.line:!O.empty())){var D=C.getLineHandleVisualStart(O.head.line);P[P.length-1]!=D&&P.push(D)}}w(C.state.activeLines,P)||C.operation(function(){M(C);for(var H=0;H<P.length;H++)C.addLineClass(P[H],"wrap",U),C.addLineClass(P[H],"background",I),C.addLineClass(P[H],"gutter",G);C.state.activeLines=P})}function x(C,W){S(C,W.ranges)}})})();const _u=window.CodeMirror||Bu,Gu=Tl({props:{modelValue:String,defaultValue:String,readOnly:{type:Boolean,default:!1}},setup(Oe,Be){const{modelValue:m,defaultValue:U,readOnly:I}=Du(Oe),G=Hu();let M;return pl(m,()=>{M!=null&&m.value&&m.value!==M.getValue()&&M.setValue(m.value)}),pl(I,()=>{M!=null&&M.setOption("readOnly",I.value)}),Eu(()=>{M=_u.fromTextArea(G.value,{value:m.value,mode:"application/json",indentWithTabs:!1,smartIndent:!0,lineNumbers:!0,matchBrackets:!0,readOnly:I.value,foldGutter:!0,lineWrapping:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter","CodeMirror-lint-markers"],styleActiveLine:!1}),M.on("change",()=>{Be.emit("update:modelValue",M.getValue())}),U.value&&M.setValue(U.value)}),Wu(()=>{M!==null&&(M.toTextArea(),M=null)}),{codeEditor:G}}}),Uu={ref:"codeEditor",placeholder:"\u8BF7\u8F93\u5165..."};function Ku(Oe,Be,m,U,I,G){return Ol(),Nl("textarea",Uu,null,512)}const Xu=Ll(Gu,[["render",Ku]]),Yu=Oe=>(Iu("data-v-666accbb"),Oe=Oe(),Ru(),Oe),qu={class:"m-code-mirror"},Zu={class:"header"},Qu=Yu(()=>Nn("div",null,[Nn("span",null,"\u4EE3\u7801\u7F16\u8F91\u5668\u7EC4\u4EF6\u793A\u4F8B")],-1)),Ju={class:"footer"},ju={class:"footer-inner"},Vu=Tl({__name:"index",setup(Oe){return(Be,m)=>{const U=Fu("el-card");return Ol(),Nl("div",qu,[Nn("div",Zu,[vl(U,null,{default:Pu(()=>[Qu]),_:1})]),Nn("div",Ju,[Nn("div",ju,[vl(Xu)])])])}}});const ef=Ll(Vu,[["__scopeId","data-v-666accbb"]]);export{ef as default};
|