vue-pure-admin/static/js/index-F682GpPc.js

89 lines
266 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var uu=Object.defineProperty,hu=Object.defineProperties;var cu=Object.getOwnPropertyDescriptors;var Fl=Object.getOwnPropertySymbols;var du=Object.prototype.hasOwnProperty,pu=Object.prototype.propertyIsEnumerable;var El=(ae,R,T)=>R in ae?uu(ae,R,{enumerable:!0,configurable:!0,writable:!0,value:T}):ae[R]=T,Cr=(ae,R)=>{for(var T in R||(R={}))du.call(R,T)&&El(ae,T,R[T]);if(Fl)for(var T of Fl(R))pu.call(R,T)&&El(ae,T,R[T]);return ae},Co=(ae,R)=>hu(ae,cu(R));var Hl=(ae,R,T)=>new Promise((Z,z)=>{var c=v=>{try{p(T.next(v))}catch(m){z(m)}},d=v=>{try{p(T.throw(v))}catch(m){z(m)}},p=v=>v.done?Z(v.value):Promise.resolve(v.value).then(c,d);p((T=T.apply(ae,R)).next())});import{S as is,d as Kn,a as _t,M as gu,Z as vu,p as Do,u as Bt,k as Mi,n as Wr,y as mu,e as cn,b as os,a4 as yu,U as bu,s as wu,v as Su,x as as,m as Oo,a1 as No,af as ku,r as xu,w as Ci,f as Lo,g as _l,j as To,h as Il,_ as Cu}from"./index-DI6gHrBb.js";var Wl={exports:{}},Ti={exports:{}},Lu=Ti.exports,Pl;function nr(){return Pl||(Pl=1,function(ae,R){(function(T,Z){ae.exports=Z()})(Lu,function(){var T=navigator.userAgent,Z=navigator.platform,z=/gecko\/\d/i.test(T),c=/MSIE \d/.test(T),d=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(T),p=/Edge\/(\d+)/.exec(T),v=c||d||p,m=v&&(c?document.documentMode||6:+(p||d)[1]),g=!p&&/WebKit\//.test(T),M=g&&/Qt\/\d+\.\d+/.test(T),b=!p&&/Chrome\/(\d+)/.exec(T),D=b&&+b[1],F=/Opera\//.test(T),_=/Apple Computer/.test(navigator.vendor),H=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(T),w=/PhantomJS/.test(T),L=_&&(/Mobile\/\w+/.test(T)||navigator.maxTouchPoints>2),A=/Android/.test(T),B=L||A||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(T),K=L||/Mac/.test(Z),Q=/\bCrOS\b/.test(T),J=/win/i.test(Z),$=F&&T.match(/Version\/(\d*\.\d*)/);$&&($=Number($[1])),$&&$>=15&&(F=!1,g=!0);var ce=K&&(M||F&&($==null||$<12.11)),de=z||v&&m>=9;function re(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var oe=function(e,t){var n=e.className,r=re(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 U(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ie(e,t){return U(e).appendChild(t)}function C(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function pt(e,t,n,r){var i=C(e,t,n,r);return i.setAttribute("role","presentation"),i}var Qe;document.createRange?Qe=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:Qe=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function gt(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 Ue(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch(r){n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function nt(e,t){var n=e.className;re(t).test(n)||(e.className+=(n?" ":"")+t)}function It(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!re(n[r]).test(t)&&(t+=" "+n[r]);return t}var Wt=function(e){e.select()};L?Wt=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:v&&(Wt=function(e){try{e.select()}catch(t){}});function it(e){return e.display.wrapper.ownerDocument}function bt(e){return De(e.display.wrapper)}function De(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function ke(e){return it(e).defaultView}function pe(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Ce(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 Te(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 kt=function(){this.id=null,this.f=null,this.time=0,this.handler=pe(this.onTimeout,this)};kt.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},kt.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 xe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Re=50,vt={toString:function(){return"CodeMirror.Pass"}},$e={scroll:!1},xt={origin:"*mouse"},ht={origin:"+move"};function Be(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 Ge=[""];function Gt(e){for(;Ge.length<=e;)Ge.push(h(Ge)+" ");return Ge[e]}function h(e){return e[e.length-1]}function x(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function O(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function I(){}function W(e,t){var n;return Object.create?n=Object.create(e):(I.prototype=e,n=new I),t&&Ce(t,n),n}var P=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function j(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||P.test(e))}function V(e,t){return t?t.source.indexOf("\\w")>-1&&j(e)?!0:t.test(e):j(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var we=/[\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 ve(e){return e.charCodeAt(0)>=768&&we.test(e)}function Ae(e,t,n){for(;(n<0?t>0:t<e.length)&&ve(e.charAt(t));)t+=n;return t}function Oe(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 Ne(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 He=null;function Ke(e,t,n){var r;He=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:He=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:He=i)}return r!=null?r:He}var Ct=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(f){return f<=247?e.charAt(f):1424<=f&&f<=1524?"R":1536<=f&&f<=1785?t.charAt(f-1536):1774<=f&&f<=2220?"r":8192<=f&&f<=8203?"w":f==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(f,y,k){this.level=f,this.from=y,this.to=k}return function(f,y){var k=y=="ltr"?"L":"R";if(f.length==0||y=="ltr"&&!r.test(f))return!1;for(var E=f.length,N=[],q=0;q<E;++q)N.push(n(f.charCodeAt(q)));for(var Y=0,te=k;Y<E;++Y){var le=N[Y];le=="m"?N[Y]=te:te=le}for(var ue=0,se=k;ue<E;++ue){var he=N[ue];he=="1"&&se=="r"?N[ue]="n":o.test(he)&&(se=he,he=="r"&&(N[ue]="R"))}for(var Se=1,ye=N[0];Se<E-1;++Se){var Me=N[Se];Me=="+"&&ye=="1"&&N[Se+1]=="1"?N[Se]="1":Me==","&&ye==N[Se+1]&&(ye=="1"||ye=="n")&&(N[Se]=ye),ye=Me}for(var Ie=0;Ie<E;++Ie){var ft=N[Ie];if(ft==",")N[Ie]="N";else if(ft=="%"){var qe=void 0;for(qe=Ie+1;qe<E&&N[qe]=="%";++qe);for(var Ht=Ie&&N[Ie-1]=="!"||qe<E&&N[qe]=="1"?"1":"N",Dt=Ie;Dt<qe;++Dt)N[Dt]=Ht;Ie=qe-1}}for(var Je=0,Ot=k;Je<E;++Je){var dt=N[Je];Ot=="L"&&dt=="1"?N[Je]="L":o.test(dt)&&(Ot=dt)}for(var rt=0;rt<E;++rt)if(i.test(N[rt])){var Ve=void 0;for(Ve=rt+1;Ve<E&&i.test(N[Ve]);++Ve);for(var Ze=(rt?N[rt-1]:k)=="L",Nt=(Ve<E?N[Ve]:k)=="L",un=Ze==Nt?Ze?"L":"R":k,xr=rt;xr<Ve;++xr)N[xr]=un;rt=Ve-1}for(var yt=[],rr,ut=0;ut<E;)if(a.test(N[ut])){var ko=ut;for(++ut;ut<E&&a.test(N[ut]);++ut);yt.push(new s(0,ko,ut))}else{var ur=ut,_r=yt.length,Ir=y=="rtl"?1:0;for(++ut;ut<E&&N[ut]!="L";++ut);for(var St=ur;St<ut;)if(l.test(N[St])){ur<St&&(yt.splice(_r,0,new s(1,ur,St)),_r+=Ir);var hn=St;for(++St;St<ut&&l.test(N[St]);++St);yt.splice(_r,0,new s(2,hn,St)),_r+=Ir,ur=St}else++St;ur<ut&&yt.splice(_r,0,new s(1,ur,ut))}return y=="ltr"&&(yt[0].level==1&&(rr=f.match(/^\s+/))&&(yt[0].from=rr[0].length,yt.unshift(new s(0,0,rr[0].length))),h(yt).level==1&&(rr=f.match(/\s+$/))&&(h(yt).to-=rr[0].length,yt.push(new s(0,E-rr[0].length,E)))),y=="rtl"?yt.reverse():yt}}();function be(e,t){var n=e.order;return n==null&&(n=e.order=Ct(e.text,t)),n}var Lr=[],me=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]||Lr).concat(n)}};function zt(e,t){return e._handlers&&e._handlers[t]||Lr}function et(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=xe(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Pe(e,t){var n=zt(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 We(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Pe(e,n||t.type,e,t),Lt(t)||t.codemirrorIgnore}function ct(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)xe(n,t[r])==-1&&n.push(t[r])}function tt(e,t){return zt(e,t).length>0}function Ft(e){e.prototype.on=function(t,n){me(this,t,n)},e.prototype.off=function(t,n){et(this,t,n)}}function Xe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Pr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Lt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function hr(e){Xe(e),Pr(e)}function dn(e){return e.target||e.srcElement}function Kt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),K&&e.ctrlKey&&t==1&&(t=3),t}var Ai=function(){if(v&&m<9)return!1;var e=C("div");return"draggable"in e||"dragDrop"in e}(),Rr;function Xn(e){if(Rr==null){var t=C("span","");ie(e,C("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Rr=t.offsetWidth<=1&&t.offsetHeight>2&&!(v&&m<8))}var n=Rr?C("span",""):C("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var pn;function cr(e){if(pn!=null)return pn;var t=ie(e,document.createTextNode("AخA")),n=Qe(t,0,1).getBoundingClientRect(),r=Qe(t,1,2).getBoundingClientRect();return U(e),!n||n.left==n.right?!1:pn=r.right-n.right<3}var Ut=`
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/)},dr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Yn=function(){var e=C("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),qt=null;function Di(e){if(qt!=null)return qt;var t=ie(e,C("span","x")),n=t.getBoundingClientRect(),r=Qe(t,0,1).getBoundingClientRect();return qt=Math.abs(n.left-r.left)>1}var Br={},Xt={};function Yt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Br[e]=t}function Tr(e,t){Xt[e]=t}function zr(e){if(typeof e=="string"&&Xt.hasOwnProperty(e))e=Xt[e];else if(e&&typeof e.name=="string"&&Xt.hasOwnProperty(e.name)){var t=Xt[e.name];typeof t=="string"&&(t={name:t}),e=W(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return zr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return zr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ur(e,t){t=zr(t);var n=Br[t.name];if(!n)return Ur(e,"text/plain");var r=n(e,t);if(pr.hasOwnProperty(t.name)){var i=pr[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 pr={};function Gr(e,t){var n=pr.hasOwnProperty(e)?pr[e]:pr[e]={};Ce(t,n)}function Vt(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 gn(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 Kr(e,t,n){return e.startState?e.startState(t,n):!0}var Ye=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};Ye.prototype.eol=function(){return this.pos>=this.string.length},Ye.prototype.sol=function(){return this.pos==this.lineStart},Ye.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ye.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ye.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},Ye.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ye.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ye.prototype.skipToEnd=function(){this.pos=this.string.length},Ye.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ye.prototype.backUp=function(e){this.pos-=e},Ye.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Te(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Te(this.string,this.lineStart,this.tabSize):0)},Ye.prototype.indentation=function(){return Te(this.string,null,this.tabSize)-(this.lineStart?Te(this.string,this.lineStart,this.tabSize):0)},Ye.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)}},Ye.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ye.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ye.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ye.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ge(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 ir(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 vn(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Pt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function u(e){if(e.parent==null)return null;for(var t=e.parent,n=xe(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 S(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 X(e,t){return t>=e.first&&t<e.first+e.size}function ee(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function G(e,t,n){if(n===void 0&&(n=null),!(this instanceof G))return new G(e,t,n);this.line=e,this.ch=t,this.sticky=n}function fe(e,t){return e.line-t.line||e.ch-t.ch}function Fe(e,t){return e.sticky==t.sticky&&fe(e,t)==0}function ot(e){return G(e.line,e.ch)}function Tt(e,t){return fe(e,t)<0?t:e}function qr(e,t){return fe(e,t)<0?e:t}function Eo(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Le(e,t){if(t.line<e.first)return G(e.first,0);var n=e.first+e.size-1;return t.line>n?G(n,ge(e,n).text.length):us(t,ge(e,t.line).text.length)}function us(e,t){var n=e.ch;return n==null||n>t?G(e.line,t):n<0?G(e.line,0):e}function Ho(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Le(e,t[r]);return n}var Zn=function(e,t){this.state=e,this.lookAhead=t},$t=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};$t.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},$t.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}},$t.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},$t.fromSaved=function(e,t,n){return t instanceof Zn?new $t(e,Vt(e.mode,t.state),n,t.lookAhead):new $t(e,Vt(e.mode,t),n)},$t.prototype.save=function(e){var t=e!==!1?Vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Zn(t,this.maxLookAhead):t};function _o(e,t,n,r){var i=[e.state.modeGen],o={};zo(e,t.text,e.doc.mode,n,function(f,y){return i.push(f,y)},o,r);for(var a=n.state,l=function(f){n.baseTokens=i;var y=e.state.overlays[f],k=1,E=0;n.state=!0,zo(e,t.text,y.mode,n,function(N,q){for(var Y=k;E<N;){var te=i[k];te>N&&i.splice(k,1,N,i[k+1],te),k+=2,E=Math.min(N,te)}if(q)if(y.opaque)i.splice(Y,k-Y,N,"overlay "+q),k=Y+2;else for(;Y<k;Y+=2){var le=i[Y+1];i[Y+1]=(le?le+" ":"")+"overlay "+q}},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 Io(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=mn(e,u(t)),i=t.text.length>e.options.maxHighlightLength&&Vt(e.doc.mode,r.state),o=_o(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 mn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new $t(r,!0,t);var o=hs(e,t,n),a=o>r.first&&ge(r,o-1).stateAfter,l=a?$t.fromSaved(r,a,o):new $t(r,Kr(r.mode),o);return r.iter(o,t,function(s){Oi(e,s.text,l);var f=l.line;s.stateAfter=f==t-1||f%5==0||f>=i.viewFrom&&f<i.viewTo?l.save():null,l.nextLine()}),n&&(r.modeFrontier=l.line),l}function Oi(e,t,n,r){var i=e.doc.mode,o=new Ye(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&Wo(i,n.state);!o.eol();)Ni(i,o,n.state),o.start=o.pos}function Wo(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=gn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function Ni(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=gn(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 Po=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Ro(e,t,n,r){var i=e.doc,o=i.mode,a;t=Le(i,t);var l=ge(i,t.line),s=mn(e,t.line,n),f=new Ye(l.text,e.options.tabSize,s),y;for(r&&(y=[]);(r||f.pos<t.ch)&&!f.eol();)f.start=f.pos,a=Ni(o,f,s.state),r&&y.push(new Po(f,a,Vt(i.mode,s.state)));return r?y:new Po(f,a,s.state)}function Bo(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 zo(e,t,n,r,i,o,a){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,f=null,y=new Ye(t,e.options.tabSize,r),k,E=e.options.addModeClass&&[null];for(t==""&&Bo(Wo(n,r.state),o);!y.eol();){if(y.pos>e.options.maxHighlightLength?(l=!1,a&&Oi(e,t,r,y.pos),y.pos=t.length,k=null):k=Bo(Ni(n,y,r.state,E),o),E){var N=E[0].name;N&&(k="m-"+(k?N+" "+k:N))}if(!l||f!=k){for(;s<y.start;)s=Math.min(y.start,s+5e3),i(s,f);f=k}y.start=y.pos}for(;s<y.pos;){var q=Math.min(y.pos,s+5e3);i(q,f),s=q}}function hs(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=ge(o,l-1),f=s.stateAfter;if(f&&(!n||l+(f instanceof Zn?f.lookAhead:0)<=o.modeFrontier))return l;var y=Te(s.text,null,e.options.tabSize);(i==null||r>y)&&(i=l-1,r=y)}return i}function cs(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=ge(e,r).stateAfter;if(i&&(!(i instanceof Zn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Uo=!1,or=!1;function ds(){Uo=!0}function ps(){or=!0}function jn(e,t,n){this.marker=e,this.from=t,this.to=n}function yn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function gs(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function vs(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 ms(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 jn(a,o.from,s?null:o.to))}}return r}function ys(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 jn(a,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function Fi(e,t){if(t.full)return null;var n=X(e,t.from.line)&&ge(e,t.from.line).markedSpans,r=X(e,t.to.line)&&ge(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=fe(t.from,t.to)==0,l=ms(n,i,a),s=ys(r,o,a),f=t.text.length==1,y=h(t.text).length+(f?i:0);if(l)for(var k=0;k<l.length;++k){var E=l[k];if(E.to==null){var N=yn(s,E.marker);N?f&&(E.to=N.to==null?null:N.to+y):E.to=i}}if(s)for(var q=0;q<s.length;++q){var Y=s[q];if(Y.to!=null&&(Y.to+=y),Y.from==null){var te=yn(l,Y.marker);te||(Y.from=y,f&&(l||(l=[])).push(Y))}else Y.from+=y,f&&(l||(l=[])).push(Y)}l&&(l=Go(l)),s&&s!=l&&(s=Go(s));var le=[l];if(!f){var ue=t.text.length-2,se;if(ue>0&&l)for(var he=0;he<l.length;++he)l[he].to==null&&(se||(se=[])).push(new jn(l[he].marker,null,null));for(var Se=0;Se<ue;++Se)le.push(se);le.push(s)}return le}function Go(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 bs(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(N){if(N.markedSpans)for(var q=0;q<N.markedSpans.length;++q){var Y=N.markedSpans[q].marker;Y.readOnly&&(!r||xe(r,Y)==-1)&&(r||(r=[])).push(Y)}}),!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 f=i[s];if(!(fe(f.to,l.from)<0||fe(f.from,l.to)>0)){var y=[s,1],k=fe(f.from,l.from),E=fe(f.to,l.to);(k<0||!a.inclusiveLeft&&!k)&&y.push({from:f.from,to:l.from}),(E>0||!a.inclusiveRight&&!E)&&y.push({from:l.to,to:f.to}),i.splice.apply(i,y),s+=y.length-3}}return i}function Ko(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function qo(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Qn(e){return e.inclusiveLeft?-1:0}function Jn(e){return e.inclusiveRight?1:0}function Ei(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=fe(r.from,i.from)||Qn(e)-Qn(t);if(o)return-o;var a=fe(r.to,i.to)||Jn(e)-Jn(t);return a||t.id-e.id}function Xo(e,t){var n=or&&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||Ei(r,i.marker)<0)&&(r=i.marker);return r}function Yo(e){return Xo(e,!0)}function Vn(e){return Xo(e,!1)}function ws(e,t){var n=or&&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||Ei(r,o.marker)<0)&&(r=o.marker)}return r}function Zo(e,t,n,r,i){var o=ge(e,t),a=or&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var f=s.marker.find(0),y=fe(f.from,n)||Qn(s.marker)-Qn(i),k=fe(f.to,r)||Jn(s.marker)-Jn(i);if(!(y>=0&&k<=0||y<=0&&k>=0)&&(y<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?fe(f.to,n)>=0:fe(f.to,n)>0)||y>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?fe(f.from,r)<=0:fe(f.from,r)<0)))return!0}}}function Zt(e){for(var t;t=Yo(e);)e=t.find(-1,!0).line;return e}function Ss(e){for(var t;t=Vn(e);)e=t.find(1,!0).line;return e}function ks(e){for(var t,n;t=Vn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Hi(e,t){var n=ge(e,t),r=Zt(n);return n==r?t:u(r)}function jo(e,t){if(t>e.lastLine())return t;var n=ge(e,t),r;if(!gr(e,n))return t;for(;r=Vn(n);)n=r.find(1,!0).line;return u(n)+1}function gr(e,t){var n=or&&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&&_i(e,t,r))return!0}}}function _i(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return _i(e,r.line,yn(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)&&_i(e,t,i))return!0}function ar(e){e=Zt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function $n(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Yo(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Vn(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 Ii(e){var t=e.display,n=e.doc;t.maxLine=ge(n,n.first),t.maxLineLength=$n(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=$n(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Xr=function(e,t,n){this.text=e,qo(this,t),this.height=n?n(this):1};Xr.prototype.lineNo=function(){return u(this)},Ft(Xr);function xs(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ko(e),qo(e,n);var i=r?r(e):1;i!=e.height&&Pt(e,i)}function Cs(e){e.parent=null,Ko(e)}var Ls={},Ts={};function Qo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ts:Ls;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Jo(e,t){var n=pt("span",null,null,g?"padding-right: .1px":null),r={pre:pt("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=As,cr(e.display.measure)&&(a=be(o,e.doc.direction))&&(r.addToken=Os(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&u(o);Ns(o,r,Io(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=It(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=It(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Xn(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(g){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 Pe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=It(r.pre.className,r.textClass||"")),r}function Ms(e){var t=C("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function As(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?Ds(t,e.trailingSpace):t,s=e.cm.state.specialChars,f=!1,y;if(!s.test(t))e.col+=t.length,y=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,y),v&&m<9&&(f=!0),e.pos+=t.length;else{y=document.createDocumentFragment();for(var k=0;;){s.lastIndex=k;var E=s.exec(t),N=E?E.index-k:t.length-k;if(N){var q=document.createTextNode(l.slice(k,k+N));v&&m<9?y.appendChild(C("span",[q])):y.appendChild(q),e.map.push(e.pos,e.pos+N,q),e.col+=N,e.pos+=N}if(!E)break;k+=N+1;var Y=void 0;if(E[0]==" "){var te=e.cm.options.tabSize,le=te-e.col%te;Y=y.appendChild(C("span",Gt(le),"cm-tab")),Y.setAttribute("role","presentation"),Y.setAttribute("cm-text"," "),e.col+=le}else E[0]=="\r"||E[0]==`
`?(Y=y.appendChild(C("span",E[0]=="\r"?"␍":"␤","cm-invalidchar")),Y.setAttribute("cm-text",E[0]),e.col+=1):(Y=e.cm.options.specialCharPlaceholder(E[0]),Y.setAttribute("cm-text",E[0]),v&&m<9?y.appendChild(C("span",[Y])):y.appendChild(Y),e.col+=1);e.map.push(e.pos,e.pos+1,Y),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||f||o||a){var ue=n||"";r&&(ue+=r),i&&(ue+=i);var se=C("span",[y],ue,o);if(a)for(var he in a)a.hasOwnProperty(he)&&he!="style"&&he!="class"&&se.setAttribute(he,a[he]);return e.content.appendChild(se)}e.content.appendChild(y)}}function Ds(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=" "),r+=o,n=o==" "}return r}function Os(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var f=n.pos,y=f+r.length;;){for(var k=void 0,E=0;E<t.length&&(k=t[E],!(k.to>f&&k.from<=f));E++);if(k.to>=y)return e(n,r,i,o,a,l,s);e(n,r.slice(0,k.to-f),i,o,null,l,s),o=null,r=r.slice(k.to-f),f=k.to}}}function Vo(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 Ns(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]),Qo(n[a+1],t.cm.options));return}for(var l=i.length,s=0,f=1,y="",k,E,N=0,q,Y,te,le,ue;;){if(N==s){q=Y=te=E="",ue=null,le=null,N=1/0;for(var se=[],he=void 0,Se=0;Se<r.length;++Se){var ye=r[Se],Me=ye.marker;if(Me.type=="bookmark"&&ye.from==s&&Me.widgetNode)se.push(Me);else if(ye.from<=s&&(ye.to==null||ye.to>s||Me.collapsed&&ye.to==s&&ye.from==s)){if(ye.to!=null&&ye.to!=s&&N>ye.to&&(N=ye.to,Y=""),Me.className&&(q+=" "+Me.className),Me.css&&(E=(E?E+";":"")+Me.css),Me.startStyle&&ye.from==s&&(te+=" "+Me.startStyle),Me.endStyle&&ye.to==N&&(he||(he=[])).push(Me.endStyle,ye.to),Me.title&&((ue||(ue={})).title=Me.title),Me.attributes)for(var Ie in Me.attributes)(ue||(ue={}))[Ie]=Me.attributes[Ie];Me.collapsed&&(!le||Ei(le.marker,Me)<0)&&(le=ye)}else ye.from>s&&N>ye.from&&(N=ye.from)}if(he)for(var ft=0;ft<he.length;ft+=2)he[ft+1]==N&&(Y+=" "+he[ft]);if(!le||le.from==s)for(var qe=0;qe<se.length;++qe)Vo(t,0,se[qe]);if(le&&(le.from||0)==s){if(Vo(t,(le.to==null?l+1:le.to)-s,le.marker,le.from==null),le.to==null)return;le.to==s&&(le=!1)}}if(s>=l)break;for(var Ht=Math.min(l,N);;){if(y){var Dt=s+y.length;if(!le){var Je=Dt>Ht?y.slice(0,Ht-s):y;t.addToken(t,Je,k?k+q:q,te,s+Je.length==N?Y:"",E,ue)}if(Dt>=Ht){y=y.slice(Ht-s),s=Ht;break}s=Dt,te=""}y=i.slice(o,o=n[f++]),k=Qo(n[f++],t.cm.options)}}}function $o(e,t,n){this.line=t,this.rest=ks(t),this.size=this.rest?u(h(this.rest))-n+1:1,this.node=this.text=null,this.hidden=gr(e,t)}function ei(e,t,n){for(var r=[],i,o=t;o<n;o=i){var a=new $o(e.doc,ge(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Yr=null;function Fs(e){Yr?Yr.ops.push(e):e.ownsGroup=Yr={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 Hs(e,t){var n=e.ownsGroup;if(n)try{Es(n)}finally{Yr=null,t(n)}}var bn=null;function at(e,t){var n=zt(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Yr?i=Yr.delayedCallbacks:bn?i=bn:(i=bn=[],setTimeout(_s,0));for(var o=function(l){i.push(function(){return n[l].apply(null,r)})},a=0;a<n.length;++a)o(a)}}function _s(){var e=bn;bn=null;for(var t=0;t<e.length;++t)e[t]()}function ea(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?Ws(e,t):o=="gutter"?ra(e,t,n,r):o=="class"?Wi(e,t):o=="widget"&&Ps(e,t,r)}t.changes=null}function wn(e){return e.node==e.text&&(e.node=C("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),v&&m<8&&(e.node.style.zIndex=2)),e.node}function Is(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=wn(t);t.background=r.insertBefore(C("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function ta(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Jo(e,t)}function Ws(e,t){var n=t.text.className,r=ta(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,Wi(e,t)):n&&(t.text.className=n)}function Wi(e,t){Is(e,t),t.line.wrapClass?wn(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 ra(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=wn(t);t.gutterBackground=C("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=wn(t),l=t.gutter=C("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(l.setAttribute("aria-hidden","true"),e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=l.appendChild(C("div",ee(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 f=e.display.gutterSpecs[s].className,y=o.hasOwnProperty(f)&&o[f];y&&l.appendChild(C("div",[y],"CodeMirror-gutter-elt","left: "+r.gutterLeft[f]+"px; width: "+r.gutterWidth[f]+"px"))}}}function Ps(e,t,n){t.alignable&&(t.alignable=null);for(var r=re("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);na(e,t,n)}function Rs(e,t,n,r){var i=ta(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Wi(e,t),ra(e,t,n,r),na(e,t,r),t.node}function na(e,t,n){if(ia(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)ia(e,t.rest[r],t,n,!1)}function ia(e,t,n,r,i){if(t.widgets)for(var o=wn(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],f=C("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||f.setAttribute("cm-ignore-events","true"),Bs(s,f,n,r),e.display.input.setUneditable(f),i&&s.above?o.insertBefore(f,n.gutter||n.text):o.appendChild(f),at(s,"redraw")}}function Bs(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 Sn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!gt(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;"),ie(t.display.measure,C("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function lr(e,t){for(var n=dn(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 ti(e){return e.lineSpace.offsetTop}function Pi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function oa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=ie(e.measure,C("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function er(e){return Re-e.display.nativeBarWidth}function Mr(e){return e.display.scroller.clientWidth-er(e)-e.display.barWidth}function Ri(e){return e.display.scroller.clientHeight-er(e)-e.display.barHeight}function zs(e,t,n){var r=e.options.lineWrapping,i=r&&Mr(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],f=a[l+1];Math.abs(s.bottom-f.bottom)>2&&o.push((s.bottom+f.top)/2-n.top)}}o.push(n.bottom-n.top)}}function aa(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(u(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Us(e,t){t=Zt(t);var n=u(t),r=e.display.externalMeasured=new $o(e.doc,t,n);r.lineN=n;var i=r.built=Jo(e,r);return r.text=i.pre,ie(e.display.lineMeasure,i.pre),r}function la(e,t,n,r){return tr(e,Zr(e,t),n,r)}function Bi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Or(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Zr(e,t){var n=u(t),r=Bi(e,n);r&&!r.text?r=null:r&&r.changes&&(ea(e,r,n,qi(e)),e.curOp.forceUpdate=!0),r||(r=Us(e,t));var i=aa(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function tr(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||(zs(e,t.view,t.rect),t.hasHeights=!0),a=Ks(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 sa={left:0,right:0,top:0,bottom:0};function fa(e,t,n){for(var r,i,o,a,l,s,f=0;f<e.length;f+=3)if(l=e[f],s=e[f+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(f==e.length-3||t==s&&e[f+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),i!=null){if(r=e[f+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;f&&e[f-2]==e[f-3]&&e[f-1].insertLeft;)r=e[(f-=3)+2],a="left";if(n=="right"&&i==s-l)for(;f<e.length-3&&e[f+3]==e[f+4]&&!e[f+5].insertLeft;)r=e[(f+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Gs(e,t){var n=sa;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 Ks(e,t,n,r){var i=fa(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,f;if(o.nodeType==3){for(var y=0;y<4;y++){for(;a&&ve(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l<i.coverEnd&&ve(t.line.text.charAt(i.coverStart+l));)++l;if(v&&m<9&&a==0&&l==i.coverEnd-i.coverStart?f=o.parentNode.getBoundingClientRect():f=Gs(Qe(o,a,l).getClientRects(),r),f.left||f.right||a==0)break;l=a,a=a-1,s="right"}v&&m<11&&(f=qs(e.display.measure,f))}else{a>0&&(s=r="right");var k;e.options.lineWrapping&&(k=o.getClientRects()).length>1?f=k[r=="right"?k.length-1:0]:f=o.getBoundingClientRect()}if(v&&m<9&&!a&&(!f||!f.left&&!f.right)){var E=o.parentNode.getClientRects()[0];E?f={left:E.left,right:E.left+Qr(e.display),top:E.top,bottom:E.bottom}:f=sa}for(var N=f.top-t.rect.top,q=f.bottom-t.rect.top,Y=(N+q)/2,te=t.view.measure.heights,le=0;le<te.length-1&&!(Y<te[le]);le++);var ue=le?te[le-1]:0,se=te[le],he={left:(s=="right"?f.right:f.left)-t.rect.left,right:(s=="left"?f.left:f.right)-t.rect.left,top:ue,bottom:se};return!f.left&&!f.right&&(he.bogus=!0),e.options.singleCursorHeightPerLine||(he.rtop=N,he.rbottom=q),he}function qs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Di(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 ua(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 ha(e){e.display.externalMeasure=null,U(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ua(e.display.view[t])}function kn(e){ha(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ca(e){return b&&A?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function da(e){return b&&A?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function zi(e){var t=Zt(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=Sn(n[i]));return r}function ri(e,t,n,r,i){if(!i){var o=zi(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var a=ar(t);if(r=="local"?a+=ti(e.display):a-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+(r=="window"?0:da(it(e)));var s=l.left+(r=="window"?0:ca(it(e)));n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function pa(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=ca(it(e)),i-=da(it(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 ni(e,t,n,r,i){return r||(r=ge(e.doc,t.line)),ri(e,r,la(e,r,t.ch,i),n)}function jt(e,t,n,r,i,o){r=r||ge(e.doc,t.line),i||(i=Zr(e,r));function a(q,Y){var te=tr(e,i,q,Y?"right":"left",o);return Y?te.left=te.right:te.right=te.left,ri(e,r,te,n)}var l=be(r,e.doc.direction),s=t.ch,f=t.sticky;if(s>=r.text.length?(s=r.text.length,f="before"):s<=0&&(s=0,f="after"),!l)return a(f=="before"?s-1:s,f=="before");function y(q,Y,te){var le=l[Y],ue=le.level==1;return a(te?q-1:q,ue!=te)}var k=Ke(l,s,f),E=He,N=y(s,k,f=="before");return E!=null&&(N.other=y(s,E,f!="before")),N}function ga(e,t){var n=0;t=Le(e.doc,t),e.options.lineWrapping||(n=Qr(e.display)*t.ch);var r=ge(e.doc,t.line),i=ar(r)+ti(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Ui(e,t,n,r,i){var o=G(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Gi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Ui(r.first,0,null,-1,-1);var i=S(r,n),o=r.first+r.size-1;if(i>o)return Ui(r.first+r.size-1,ge(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=ge(r,i);;){var l=Xs(e,a,i,t,n),s=ws(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var f=s.find(1);if(f.line==i)return f;a=ge(r,i=f.line)}}function va(e,t,n,r){r-=zi(t);var i=t.text.length,o=Oe(function(a){return tr(e,n,a-1).bottom<=r},i,0);return i=Oe(function(a){return tr(e,n,a).top>r},o,i),{begin:o,end:i}}function ma(e,t,n,r){n||(n=Zr(e,t));var i=ri(e,t,tr(e,n,r),"line").top;return va(e,t,n,i)}function Ki(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Xs(e,t,n,r,i){i-=ar(t);var o=Zr(e,t),a=zi(t),l=0,s=t.text.length,f=!0,y=be(t,e.doc.direction);if(y){var k=(e.options.lineWrapping?Zs:Ys)(e,t,n,o,y,r,i);f=k.level!=1,l=f?k.from:k.to-1,s=f?k.to:k.from-1}var E=null,N=null,q=Oe(function(Se){var ye=tr(e,o,Se);return ye.top+=a,ye.bottom+=a,Ki(ye,r,i,!1)?(ye.top<=i&&ye.left<=r&&(E=Se,N=ye),!0):!1},l,s),Y,te,le=!1;if(N){var ue=r-N.left<N.right-r,se=ue==f;q=E+(se?0:1),te=se?"after":"before",Y=ue?N.left:N.right}else{!f&&(q==s||q==l)&&q++,te=q==0?"after":q==t.text.length?"before":tr(e,o,q-(f?1:0)).bottom+a<=i==f?"after":"before";var he=jt(e,G(n,q,te),"line",t,o);Y=he.left,le=i<he.top?-1:i>=he.bottom?1:0}return q=Ae(t.text,q,1),Ui(n,q,te,le,r-Y)}function Ys(e,t,n,r,i,o,a){var l=Oe(function(k){var E=i[k],N=E.level!=1;return Ki(jt(e,G(n,N?E.to:E.from,N?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var f=s.level!=1,y=jt(e,G(n,f?s.from:s.to,f?"after":"before"),"line",t,r);Ki(y,o,a,!0)&&y.top>a&&(s=i[l-1])}return s}function Zs(e,t,n,r,i,o,a){var l=va(e,t,r,a),s=l.begin,f=l.end;/\s/.test(t.text.charAt(f-1))&&f--;for(var y=null,k=null,E=0;E<i.length;E++){var N=i[E];if(!(N.from>=f||N.to<=s)){var q=N.level!=1,Y=tr(e,r,q?Math.min(f,N.to)-1:Math.max(s,N.from)).right,te=Y<o?o-Y+1e9:Y-o;(!y||k>te)&&(y=N,k=te)}}return y||(y=i[i.length-1]),y.from<s&&(y={from:s,to:y.to,level:y.level}),y.to>f&&(y={from:y.from,to:f,level:y.level}),y}var Ar;function jr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Ar==null){Ar=C("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ar.appendChild(document.createTextNode("x")),Ar.appendChild(C("br"));Ar.appendChild(document.createTextNode("x"))}ie(e.measure,Ar);var n=Ar.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),U(e.measure),n||1}function Qr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=C("span","xxxxxxxxxx"),n=C("pre",[t],"CodeMirror-line-like");ie(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function qi(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:Xi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Xi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ya(e){var t=jr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Qr(e.display)-3);return function(i){if(gr(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 Yi(e){var t=e.doc,n=ya(e);t.iter(function(r){var i=n(r);i!=r.height&&Pt(r,i)})}function Dr(e,t,n,r){var i=e.display;if(!n&&dn(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(k){return null}var s=Gi(e,o,a),f;if(r&&s.xRel>0&&(f=ge(e.doc,s.line).text).length==s.ch){var y=Te(f,f.length,e.options.tabSize)-f.length;s=G(s.line,Math.max(0,Math.round((o-oa(e.display).left)/Qr(e.display))-y))}return s}function Or(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 Mt(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)or&&Hi(e.doc,t)<i.viewTo&&mr(e);else if(n<=i.viewFrom)or&&jo(e.doc,n+r)>i.viewFrom?mr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)mr(e);else if(t<=i.viewFrom){var o=ii(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):mr(e)}else if(n>=i.viewTo){var a=ii(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):mr(e)}else{var l=ii(e,t,t,-1),s=ii(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(ei(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):mr(e)}var f=i.externalMeasured;f&&(n<f.lineN?f.lineN+=r:t<f.lineN+f.size&&(i.externalMeasured=null))}function vr(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[Or(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);xe(a,n)==-1&&a.push(n)}}}function mr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ii(e,t,n,r){var i=Or(e,t),o,a=e.display.view;if(!or||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(;Hi(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 js(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=ei(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=ei(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Or(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(ei(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Or(e,n)))),r.viewTo=n}function ba(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 xn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function wa(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 f=s.empty();if(a){var y=a(e,s);y&&Zi(e,y,i)}else(f||e.options.showCursorWhenSelecting)&&Zi(e,s.head,i);f||Qs(e,s,o)}}return r}function Zi(e,t,n){var r=jt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(C("div"," ","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=ni(e,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(C("div"," ","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 oi(e,t){return e.top-t.top||e.left-t.left}function Qs(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=oa(e.display),l=a.left,s=Math.max(r.sizerWidth,Mr(e)-r.sizer.offsetLeft)-a.right,f=i.direction=="ltr";function y(se,he,Se,ye){he<0&&(he=0),he=Math.round(he),ye=Math.round(ye),o.appendChild(C("div",null,"CodeMirror-selected","position: absolute; left: "+se+`px;
top: `+he+"px; width: "+(Se==null?s-se:Se)+`px;
height: `+(ye-he)+"px"))}function k(se,he,Se){var ye=ge(i,se),Me=ye.text.length,Ie,ft;function qe(Je,Ot){return ni(e,G(se,Je),"div",ye,Ot)}function Ht(Je,Ot,dt){var rt=ma(e,ye,null,Je),Ve=Ot=="ltr"==(dt=="after")?"left":"right",Ze=dt=="after"?rt.begin:rt.end-(/\s/.test(ye.text.charAt(rt.end-1))?2:1);return qe(Ze,Ve)[Ve]}var Dt=be(ye,i.direction);return Ne(Dt,he||0,Se==null?Me:Se,function(Je,Ot,dt,rt){var Ve=dt=="ltr",Ze=qe(Je,Ve?"left":"right"),Nt=qe(Ot-1,Ve?"right":"left"),un=he==null&&Je==0,xr=Se==null&&Ot==Me,yt=rt==0,rr=!Dt||rt==Dt.length-1;if(Nt.top-Ze.top<=3){var ut=(f?un:xr)&&yt,ko=(f?xr:un)&&rr,ur=ut?l:(Ve?Ze:Nt).left,_r=ko?s:(Ve?Nt:Ze).right;y(ur,Ze.top,_r-ur,Ze.bottom)}else{var Ir,St,hn,xo;Ve?(Ir=f&&un&&yt?l:Ze.left,St=f?s:Ht(Je,dt,"before"),hn=f?l:Ht(Ot,dt,"after"),xo=f&&xr&&rr?s:Nt.right):(Ir=f?Ht(Je,dt,"before"):l,St=!f&&un&&yt?s:Ze.right,hn=!f&&xr&&rr?l:Nt.left,xo=f?Ht(Ot,dt,"after"):s),y(Ir,Ze.top,St-Ir,Ze.bottom),Ze.bottom<Nt.top&&y(l,Ze.bottom,null,Nt.top),y(hn,Nt.top,xo-hn,Nt.bottom)}(!Ie||oi(Ze,Ie)<0)&&(Ie=Ze),oi(Nt,Ie)<0&&(Ie=Nt),(!ft||oi(Ze,ft)<0)&&(ft=Ze),oi(Nt,ft)<0&&(ft=Nt)}),{start:Ie,end:ft}}var E=t.from(),N=t.to();if(E.line==N.line)k(E.line,E.ch,N.ch);else{var q=ge(i,E.line),Y=ge(i,N.line),te=Zt(q)==Zt(Y),le=k(E.line,E.ch,te?q.text.length+1:null).end,ue=k(N.line,te?0:null,N.ch).start;te&&(le.top<ue.top-2?(y(le.right,le.top,null,le.bottom),y(l,ue.top,ue.left,ue.bottom)):y(le.right,le.top,ue.left-le.right,le.bottom)),le.bottom<ue.top&&y(l,le.bottom,null,ue.top)}n.appendChild(o)}function ji(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()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Sa(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ji(e))}function Qi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Jr(e))},100)}function Ji(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Pe(e,"focus",e,t),e.state.focused=!0,nt(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ji(e))}function Jr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Pe(e,"blur",e,t),e.state.focused=!1,oe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function ai(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,f=void 0,y=0;if(!l.hidden){if(i+=l.line.height,v&&m<8){var k=l.node.offsetTop+l.node.offsetHeight;f=k-n,n=k}else{var E=l.node.getBoundingClientRect();f=E.bottom-E.top,!s&&l.text.firstChild&&(y=l.text.firstChild.getBoundingClientRect().right-E.left-1)}var N=l.line.height-f;if((N>.005||N<-.005)&&(i<r&&(o-=N),Pt(l.line,f),ka(l.line),l.rest))for(var q=0;q<l.rest.length;q++)ka(l.rest[q]);if(y>e.display.sizerWidth){var Y=Math.ceil(y/Qr(e.display));Y>e.display.maxLineLength&&(e.display.maxLineLength=Y,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ka(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 li(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-ti(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=S(t,r),a=S(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=S(t,ar(ge(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=S(t,ar(ge(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Js(e,t){if(!We(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&&!w){var a=C("div","",null,`position: absolute;
top: `+(t.top-n.viewOffset-ti(e.display))+`px;
height: `+(t.bottom-t.top+er(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 Vs(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?G(t.line,t.ch+1,"before"):t,t=t.ch?G(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=jt(e,t),s=!n||n==t?l:jt(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 f=Vi(e,i),y=e.doc.scrollTop,k=e.doc.scrollLeft;if(f.scrollTop!=null&&(Ln(e,f.scrollTop),Math.abs(e.doc.scrollTop-y)>1&&(a=!0)),f.scrollLeft!=null&&(Nr(e,f.scrollLeft),Math.abs(e.doc.scrollLeft-k)>1&&(a=!0)),!a)break}return i}function $s(e,t){var n=Vi(e,t);n.scrollTop!=null&&Ln(e,n.scrollTop),n.scrollLeft!=null&&Nr(e,n.scrollLeft)}function Vi(e,t){var n=e.display,r=jr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Ri(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Pi(n),s=t.top<r,f=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var y=Math.min(t.top,(f?l:t.bottom)-o);y!=i&&(a.scrollTop=y)}var k=e.options.fixedGutter?0:n.gutters.offsetWidth,E=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-k,N=Mr(e)-n.gutters.offsetWidth,q=t.right-t.left>N;return q&&(t.right=t.left+N),t.left<10?a.scrollLeft=0:t.left<E?a.scrollLeft=Math.max(0,t.left+k-(q?0:10)):t.right>N+E-3&&(a.scrollLeft=t.right+(q?0:10)-N),a}function $i(e,t){t!=null&&(si(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Vr(e){si(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Cn(e,t,n){(t!=null||n!=null)&&si(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function ef(e,t){si(e),e.curOp.scrollToPos=t}function si(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=ga(e,t.from),r=ga(e,t.to);xa(e,n,r,t.margin)}}function xa(e,t,n,r){var i=Vi(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});Cn(e,i.scrollLeft,i.scrollTop)}function Ln(e,t){Math.abs(e.doc.scrollTop-t)<2||(z||to(e,{top:t}),Ca(e,t,!0),z&&to(e),An(e,100))}function Ca(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 Nr(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,Da(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Tn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Pi(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+er(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Fr=function(e,t,n){this.cm=n;var r=this.vert=C("div",[C("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=C("div",[C("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),me(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),me(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,v&&m<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fr.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}},Fr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fr.prototype.zeroWidthHack=function(){var e=K&&!H?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new kt,this.disableVert=new kt},Fr.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)},Fr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Mn=function(){};Mn.prototype.update=function(){return{bottom:0,right:0}},Mn.prototype.setScrollLeft=function(){},Mn.prototype.setScrollTop=function(){},Mn.prototype.clear=function(){};function $r(e,t){t||(t=Tn(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&&ai(e),La(e,Tn(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 Ta={native:Fr,null:Mn};function Ma(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&oe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ta[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),me(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"?Nr(e,t):Ln(e,t)},e),e.display.scrollbars.addClass&&nt(e.display.wrapper,e.display.scrollbars.addClass)}var tf=0;function Er(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:++tf,markArrays:null},Fs(e.curOp)}function Hr(e){var t=e.curOp;t&&Hs(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;rf(n)})}function rf(e){for(var t=e.ops,n=0;n<t.length;n++)nf(t[n]);for(var r=0;r<t.length;r++)of(t[r]);for(var i=0;i<t.length;i++)af(t[i]);for(var o=0;o<t.length;o++)lf(t[o]);for(var a=0;a<t.length;a++)sf(t[a])}function nf(e){var t=e.cm,n=t.display;uf(t),e.updateMaxLine&&Ii(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 fi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function of(e){e.updatedDisplay=e.mustUpdate&&eo(e.cm,e.update)}function af(e){var t=e.cm,n=t.display;e.updatedDisplay&&ai(t),e.barMeasure=Tn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=la(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+er(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Mr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function lf(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Nr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==Ue(bt(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&$r(t,e.barMeasure),e.updatedDisplay&&no(t,e.barMeasure),e.selectionChanged&&ji(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Sa(e.cm)}function sf(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Aa(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&Ca(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Nr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Vs(t,Le(r,e.scrollToPos.from),Le(r,e.scrollToPos.to),e.scrollToPos.margin);Js(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||Pe(o[l],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&Pe(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Et(e,t){if(e.curOp)return t();Er(e);try{return t()}finally{Hr(e)}}function lt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Er(e);try{return t.apply(e,arguments)}finally{Hr(e)}}}function wt(e){return function(){if(this.curOp)return e.apply(this,arguments);Er(this);try{return e.apply(this,arguments)}finally{Hr(this)}}}function st(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Er(t);try{return e.apply(this,arguments)}finally{Hr(t)}}}function An(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,pe(ff,e))}function ff(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=mn(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?Vt(t.mode,r.state):null,s=_o(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var f=o.styleClasses,y=s.classes;y?o.styleClasses=y:f&&(o.styleClasses=null);for(var k=!a||a.length!=o.styles.length||f!=y&&(!f||!y||f.bgClass!=y.bgClass||f.textClass!=y.textClass),E=0;!k&&E<a.length;++E)k=a[E]!=o.styles[E];k&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&Oi(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return An(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Et(e,function(){for(var o=0;o<i.length;o++)vr(e,i[o],"text")})}}var fi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=li(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Mr(e),this.force=n,this.dims=qi(e),this.events=[]};fi.prototype.signal=function(e,t){tt(e,t)&&this.events.push(arguments)},fi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Pe.apply(null,this.events[e])};function uf(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=er(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=er(e)+"px",t.scrollbarsClipped=!0)}function hf(e){if(e.hasFocus())return null;var t=Ue(bt(e));if(!t||!gt(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=ke(e).getSelection();r.anchorNode&&r.extend&&gt(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function cf(e){if(!(!e||!e.activeElt||e.activeElt==Ue(De(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&gt(document.body,e.anchorNode)&&gt(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 eo(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return mr(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&&ba(e)==0)return!1;Oa(e)&&(mr(e),t.dims=qi(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)),or&&(o=Hi(e.doc,o),a=jo(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;js(e,o,a),n.viewOffset=ar(ge(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=ba(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var f=hf(e);return s>4&&(n.lineDiv.style.display="none"),df(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,cf(f),U(n.cursorDiv),U(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,An(e,400)),n.updateLineNumbers=null,!0}function Aa(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Mr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Pi(e.display)-Ri(e),n.top)}),t.visible=li(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=li(e.display,e.doc,n));if(!eo(e,t))break;ai(e);var i=Tn(e);xn(e),$r(e,i),no(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 to(e,t){var n=new fi(e,t);if(eo(e,n)){ai(e),Aa(e,n);var r=Tn(e);xn(e),$r(e,r),no(e,r),n.finish()}}function df(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(q){var Y=q.nextSibling;return g&&K&&e.display.currentWheelTarget==q?q.style.display="none":q.parentNode.removeChild(q),Y}for(var s=r.view,f=r.viewFrom,y=0;y<s.length;y++){var k=s[y];if(!k.hidden)if(!k.node||k.node.parentNode!=o){var E=Rs(e,k,f,n);o.insertBefore(E,a)}else{for(;a!=k.node;)a=l(a);var N=i&&t!=null&&t<=f&&k.lineNumber;k.changes&&(xe(k.changes,"gutter")>-1&&(N=!1),ea(e,k,f,n)),N&&(U(k.lineNumber),k.lineNumber.appendChild(document.createTextNode(ee(e.options,f)))),a=k.node.nextSibling}f+=k.size}for(;a;)a=l(a)}function ro(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",at(e,"gutterChanged",e)}function no(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+er(e)+"px"}function Da(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Xi(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 Oa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=ee(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(C("div",[C("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ro(e.display),!0}return!1}function io(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 Na(e){var t=e.gutters,n=e.gutterSpecs;U(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,l=t.appendChild(C("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),o=="CodeMirror-linenumbers"&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ro(e)}function Dn(e){Na(e.display),Mt(e),Da(e)}function pf(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=C("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=C("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=pt("div",null,"CodeMirror-code"),i.selectionDiv=C("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=C("div",null,"CodeMirror-cursors"),i.measure=C("div",null,"CodeMirror-measure"),i.lineMeasure=C("div",null,"CodeMirror-measure"),i.lineSpace=pt("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=pt("div",[i.lineSpace],"CodeMirror-lines");i.mover=C("div",[o],null,"position: relative"),i.sizer=C("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=C("div",null,null,"position: absolute; height: "+Re+"px; width: 1px;"),i.gutters=C("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=C("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=C("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),b&&D>=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),v&&m<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!g&&!(z&&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=io(r.gutters,r.lineNumbers),Na(i),n.init(i)}var ui=0,sr=null;v?sr=-.53:z?sr=15:b?sr=-.7:_&&(sr=-1/3);function Fa(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 gf(e){var t=Fa(e);return t.x*=sr,t.y*=sr,t}function Ea(e,t){b&&D==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=Fa(t),r=n.x,i=n.y,o=sr;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,f=l.scrollHeight>l.clientHeight;if(r&&s||i&&f){if(i&&K&&g){e:for(var y=t.target,k=a.view;y!=l;y=y.parentNode)for(var E=0;E<k.length;E++)if(k[E].node==y){e.display.currentWheelTarget=y;break e}}if(r&&!z&&!F&&o!=null){i&&f&&Ln(e,Math.max(0,l.scrollTop+i*o)),Nr(e,Math.max(0,l.scrollLeft+r*o)),(!i||i&&f)&&Xe(t),a.wheelStartX=null;return}if(i&&o!=null){var N=i*o,q=e.doc.scrollTop,Y=q+a.wrapper.clientHeight;N<0?q=Math.max(0,q+N-50):Y=Math.min(e.doc.height,Y+N+50),to(e,{top:q,bottom:Y})}ui<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 te=l.scrollLeft-a.wheelStartX,le=l.scrollTop-a.wheelStartY,ue=le&&a.wheelDY&&le/a.wheelDY||te&&a.wheelDX&&te/a.wheelDX;a.wheelStartX=a.wheelStartY=null,ue&&(sr=(sr*ui+ue)/(ui+1),++ui)}},200)):(a.wheelDX+=r,a.wheelDY+=i))}}var Rt=function(e,t){this.ranges=e,this.primIndex=t};Rt.prototype.primary=function(){return this.ranges[this.primIndex]},Rt.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(!Fe(n.anchor,r.anchor)||!Fe(n.head,r.head))return!1}return!0},Rt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ee(ot(this.ranges[t].anchor),ot(this.ranges[t].head));return new Rt(e,this.primIndex)},Rt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Rt.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(fe(t,r.from())>=0&&fe(e,r.to())<=0)return n}return-1};var Ee=function(e,t){this.anchor=e,this.head=t};Ee.prototype.from=function(){return qr(this.anchor,this.head)},Ee.prototype.to=function(){return Tt(this.anchor,this.head)},Ee.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Qt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(E,N){return fe(E.from(),N.from())}),n=xe(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=fe(l.to(),a.from());if(r&&!a.empty()?s>0:s>=0){var f=qr(l.from(),a.from()),y=Tt(l.to(),a.to()),k=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new Ee(k?y:f,k?f:y))}}return new Rt(t,n)}function yr(e,t){return new Rt([new Ee(e,t||e)],0)}function br(e){return e.text?G(e.from.line+e.text.length-1,h(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ha(e,t){if(fe(e,t.from)<0)return e;if(fe(e,t.to)<=0)return br(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+=br(t).ch-t.to.ch),G(n,r)}function oo(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Ee(Ha(i.anchor,t),Ha(i.head,t)))}return Qt(e.cm,n,e.sel.primIndex)}function _a(e,t,n){return e.line==t.line?G(n.line,e.ch-t.ch+n.ch):G(n.line+(e.line-t.line),e.ch)}function vf(e,t,n){for(var r=[],i=G(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=_a(l.from,i,o),f=_a(br(l),i,o);if(i=l.to,o=f,n=="around"){var y=e.sel.ranges[a],k=fe(y.head,y.anchor)<0;r[a]=new Ee(k?f:s,k?s:f)}else r[a]=new Ee(s,s)}return new Rt(r,e.sel.primIndex)}function ao(e){e.doc.mode=Ur(e.options,e.doc.modeOption),On(e)}function On(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,An(e,100),e.state.modeGen++,e.curOp&&Mt(e)}function Ia(e,t){return t.from.ch==0&&t.to.ch==0&&h(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function lo(e,t,n,r){function i(ue){return n?n[ue]:null}function o(ue,se,he){xs(ue,se,he,r),at(ue,"change",ue,t)}function a(ue,se){for(var he=[],Se=ue;Se<se;++Se)he.push(new Xr(f[Se],i(Se),r));return he}var l=t.from,s=t.to,f=t.text,y=ge(e,l.line),k=ge(e,s.line),E=h(f),N=i(f.length-1),q=s.line-l.line;if(t.full)e.insert(0,a(0,f.length)),e.remove(f.length,e.size-f.length);else if(Ia(e,t)){var Y=a(0,f.length-1);o(k,k.text,N),q&&e.remove(l.line,q),Y.length&&e.insert(l.line,Y)}else if(y==k)if(f.length==1)o(y,y.text.slice(0,l.ch)+E+y.text.slice(s.ch),N);else{var te=a(1,f.length-1);te.push(new Xr(E+y.text.slice(s.ch),N,r)),o(y,y.text.slice(0,l.ch)+f[0],i(0)),e.insert(l.line+1,te)}else if(f.length==1)o(y,y.text.slice(0,l.ch)+f[0]+k.text.slice(s.ch),i(0)),e.remove(l.line+1,q);else{o(y,y.text.slice(0,l.ch)+f[0],i(0)),o(k,E+k.text.slice(s.ch),N);var le=a(1,f.length-1);q>1&&e.remove(l.line+1,q-1),e.insert(l.line+1,le)}at(e,"change",e,t)}function wr(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 f=a&&s.sharedHist;n&&!f||(t(s.doc,f),r(s.doc,i,f))}}}r(e,null,!0)}function Wa(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Yi(e),ao(e),Pa(e),e.options.direction=t.direction,e.options.lineWrapping||Ii(e),e.options.mode=t.modeOption,Mt(e)}function Pa(e){(e.doc.direction=="rtl"?nt:oe)(e.display.lineDiv,"CodeMirror-rtl")}function mf(e){Et(e,function(){Pa(e),Mt(e)})}function hi(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 so(e,t){var n={from:ot(t.from),to:br(t),text:ir(e,t.from,t.to)};return za(e,n,t.from.line,t.to.line+1),wr(e,function(r){return za(r,n,t.from.line,t.to.line+1)},!0),n}function Ra(e){for(;e.length;){var t=h(e);if(t.ranges)e.pop();else break}}function yf(e,t){if(t)return Ra(e.done),h(e.done);if(e.done.length&&!h(e.done).ranges)return h(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),h(e.done)}function Ba(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=yf(i,i.lastOp==r)))l=h(a.changes),fe(t.from,t.to)==0&&fe(t.from,l.to)==0?l.to=br(t):a.changes.push(so(e,t));else{var s=h(i.done);for((!s||!s.ranges)&&ci(e.sel,i.done),a={changes:[so(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||Pe(e,"historyAdded")}function bf(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 wf(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||bf(e,o,h(i.done),t))?i.done[i.done.length-1]=t:ci(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&Ra(i.undone)}function ci(e,t){var n=h(t);n&&n.ranges&&n.equals(e)||t.push(e)}function za(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 Sf(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 kf(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Sf(n[i]));return r}function Ua(e,t){var n=kf(e,t),r=Fi(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],f=0;f<o.length;++f)if(o[f].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function en(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?Rt.prototype.deepCopy.call(o):o);continue}var a=o.changes,l=[];r.push({changes:l});for(var s=0;s<a.length;++s){var f=a[s],y=void 0;if(l.push({from:f.from,to:f.to,text:f.text}),t)for(var k in f)(y=k.match(/^spans_(\d+)$/))&&xe(t,Number(y[1]))>-1&&(h(l)[k]=f[k],delete f[k])}}return r}function fo(e,t,n,r){if(r){var i=e.anchor;if(n){var o=fe(t,i)<0;o!=fe(n,i)<0?(i=t,t=n):o!=fe(t,n)<0&&(t=n)}return new Ee(i,t)}else return new Ee(n||t,t)}function di(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),mt(e,new Rt([fo(e.sel.primary(),t,n,i)],0),r)}function Ga(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]=fo(e.sel.ranges[o],t[o],null,i);var a=Qt(e.cm,r,e.sel.primIndex);mt(e,a,n)}function uo(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,mt(e,Qt(e.cm,i,e.sel.primIndex),r)}function Ka(e,t,n,r){mt(e,yr(t,n),r)}function xf(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 Ee(Le(e,i[o].anchor),Le(e,i[o].head))},origin:n&&n.origin};return Pe(e,"beforeSelectionChange",e,r),e.cm&&Pe(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Qt(e.cm,r.ranges,r.ranges.length-1):t}function qa(e,t,n){var r=e.history.done,i=h(r);i&&i.ranges?(r[r.length-1]=t,pi(e,t,n)):mt(e,t,n)}function mt(e,t,n){pi(e,t,n),wf(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function pi(e,t,n){(tt(e,"beforeSelectionChange")||e.cm&&tt(e.cm,"beforeSelectionChange"))&&(t=xf(e,t,n));var r=n&&n.bias||(fe(t.primary().head,e.sel.primary().head)<0?-1:1);Xa(e,Za(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Vr(e.cm)}function Xa(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ct(e.cm)),at(e,"cursorActivity",e))}function Ya(e){Xa(e,Za(e,e.sel,null,!1))}function Za(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=gi(e,a.anchor,l&&l.anchor,n,r),f=a.head==a.anchor?s:gi(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||f!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Ee(s,f))}return i?Qt(e.cm,i,t.primIndex):t}function tn(e,t,n,r,i){var o=ge(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,f="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,y="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(f?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(y?l.to>=t.ch:l.to>t.ch))){if(i&&(Pe(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var k=s.find(r<0?1:-1),E=void 0;if((r<0?y:f)&&(k=ja(e,k,-r,k&&k.line==t.line?o:null)),k&&k.line==t.line&&(E=fe(k,n))&&(r<0?E<0:E>0))return tn(e,k,t,r,i)}var N=s.find(r<0?-1:1);return(r<0?f:y)&&(N=ja(e,N,r,N.line==t.line?o:null)),N?tn(e,N,t,r,i):null}}return t}function gi(e,t,n,r,i){var o=r||1,a=tn(e,t,n,o,i)||!i&&tn(e,t,n,o,!0)||tn(e,t,n,-o,i)||!i&&tn(e,t,n,-o,!0);return a||(e.cantEdit=!0,G(e.first,0))}function ja(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Le(e,G(t.line-1)):null:n>0&&t.ch==(r||ge(e,t.line)).text.length?t.line<e.first+e.size-1?G(t.line+1,0):null:new G(t.line,t.ch+n)}function Qa(e){e.setSelection(G(e.firstLine(),0),G(e.lastLine()),$e)}function Ja(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=Le(e,i)),o&&(r.to=Le(e,o)),a&&(r.text=a),l!==void 0&&(r.origin=l)}),Pe(e,"beforeChange",e,r),e.cm&&Pe(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 rn(e,t,n){if(e.cm){if(!e.cm.curOp)return lt(e.cm,rn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((tt(e,"beforeChange")||e.cm&&tt(e.cm,"beforeChange"))&&(t=Ja(e,t,!0),!t))){var r=Uo&&!n&&bs(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Va(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Va(e,t)}}function Va(e,t){if(!(t.text.length==1&&t.text[0]==""&&fe(t.from,t.to)==0)){var n=oo(e,t);Ba(e,t,n,e.cm?e.cm.curOp.id:NaN),Nn(e,t,n,Fi(e,t));var r=[];wr(e,function(i,o){!o&&xe(r,i.history)==-1&&(rl(i.history,t),r.push(i.history)),Nn(i,t,null,Fi(i,t))})}}function vi(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,f=0;f<l.length&&(o=l[f],!(n?o.ranges&&!o.equals(e.sel):!o.ranges));f++);if(f!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=l.pop(),o.ranges){if(ci(o,s),n&&!o.equals(e.sel)){mt(e,o,{clearRedo:!1});return}a=o}else if(r){l.push(o);return}else break;var y=[];ci(a,s),s.push({changes:y,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var k=tt(e,"beforeChange")||e.cm&&tt(e.cm,"beforeChange"),E=function(Y){var te=o.changes[Y];if(te.origin=t,k&&!Ja(e,te,!1))return l.length=0,{};y.push(so(e,te));var le=Y?oo(e,te):h(l);Nn(e,te,le,Ua(e,te)),!Y&&e.cm&&e.cm.scrollIntoView({from:te.from,to:br(te)});var ue=[];wr(e,function(se,he){!he&&xe(ue,se.history)==-1&&(rl(se.history,te),ue.push(se.history)),Nn(se,te,null,Ua(se,te))})},N=o.changes.length-1;N>=0;--N){var q=E(N);if(q)return q.v}}}}function $a(e,t){if(t!=0&&(e.first+=t,e.sel=new Rt(x(e.sel.ranges,function(i){return new Ee(G(i.anchor.line+t,i.anchor.ch),G(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){Mt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)vr(e.cm,r,"gutter")}}function Nn(e,t,n,r){if(e.cm&&!e.cm.curOp)return lt(e.cm,Nn)(e,t,n,r);if(t.to.line<e.first){$a(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);$a(e,i),t={from:G(e.first,0),to:G(t.to.line+i,t.to.ch),text:[h(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:G(o,ge(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ir(e,t.from,t.to),n||(n=oo(e,t)),e.cm?Cf(e.cm,t,r):lo(e,t,r),pi(e,n,$e),e.cantEdit&&gi(e,G(e.firstLine(),0))&&(e.cantEdit=!1)}}function Cf(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=u(Zt(ge(r,o.line))),r.iter(s,a.line+1,function(N){if(N==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ct(e),lo(r,t,n,ya(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(N){var q=$n(N);q>i.maxLineLength&&(i.maxLine=N,i.maxLineLength=q,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),cs(r,o.line),An(e,400);var f=t.text.length-(a.line-o.line)-1;t.full?Mt(e):o.line==a.line&&t.text.length==1&&!Ia(e.doc,t)?vr(e,o.line,"text"):Mt(e,o.line,a.line+1,f);var y=tt(e,"changes"),k=tt(e,"change");if(k||y){var E={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};k&&at(e,"change",e,E),y&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(E)}e.display.selForContextMenu=null}function nn(e,t,n,r,i){var o;r||(r=n),fe(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),rn(e,{from:n,to:r,text:t,origin:i})}function el(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function tl(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++)el(o.ranges[l].anchor,t,n,r),el(o.ranges[l].head,t,n,r);continue}for(var s=0;s<o.changes.length;++s){var f=o.changes[s];if(n<f.from.line)f.from=G(f.from.line+r,f.from.ch),f.to=G(f.to.line+r,f.to.ch);else if(t<=f.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}function rl(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;tl(e.done,n,r,i),tl(e.undone,n,r,i)}function Fn(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=ge(e,Eo(e,t)):i=u(t),i==null?null:(r(o,i)&&e.cm&&vr(e.cm,i,n),o)}function En(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}En.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,Cs(i),at(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 Hn(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}Hn.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 En))){var l=[];this.collapse(l),this.children=[new En(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 En(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 Hn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=xe(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new Hn(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 _n=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};_n.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=u(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=Sn(this);Pt(n,Math.max(0,n.height-o)),e&&(Et(e,function(){nl(e,n,-o),vr(e,r,"widget")}),at(e,"lineWidgetCleared",e,this,r))}},_n.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Sn(this)-t;i&&(gr(this.doc,r)||Pt(r,r.height+i),n&&Et(n,function(){n.curOp.forceUpdate=!0,nl(n,r,i),at(n,"lineWidgetChanged",n,e,u(r))}))},Ft(_n);function nl(e,t,n){ar(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&$i(e,n)}function Lf(e,t,n,r){var i=new _n(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Fn(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&&!gr(e,a)){var s=ar(a)<e.scrollTop;Pt(a,a.height+Sn(i)),s&&$i(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&at(o,"lineWidgetAdded",o,i,typeof t=="number"?t:u(t)),i}var il=0,Sr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++il};Sr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Er(e),tt(this,"clear")){var n=this.find();n&&at(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=yn(a.markedSpans,this);e&&!this.collapsed?vr(e,u(a),"text"):e&&(l.to!=null&&(i=u(a)),l.from!=null&&(r=u(a))),a.markedSpans=gs(a.markedSpans,l),l.from==null&&this.collapsed&&!gr(this.doc,a)&&e&&Pt(a,jr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var f=Zt(this.lines[s]),y=$n(f);y>e.display.maxLineLength&&(e.display.maxLine=f,e.display.maxLineLength=y,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Mt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ya(e.doc)),e&&at(e,"markerCleared",e,this,r,i),t&&Hr(e),this.parent&&this.parent.clear()}},Sr.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=yn(o.markedSpans,this);if(a.from!=null&&(n=G(t?o:u(o),a.from),e==-1))return n;if(a.to!=null&&(r=G(t?o:u(o),a.to),e==1))return r}return n&&{from:n,to:r}},Sr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||Et(r,function(){var i=t.line,o=u(t.line),a=Bi(r,o);if(a&&(ua(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!gr(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=Sn(n)-l;s&&Pt(i,i.height+s)}at(r,"markerChanged",r,e)})},Sr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||xe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Sr.prototype.detachLine=function(e){if(this.lines.splice(xe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ft(Sr);function on(e,t,n,r,i){if(r&&r.shared)return Tf(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return lt(e.cm,on)(e,t,n,r,i);var o=new Sr(e,i),a=fe(t,n);if(r&&Ce(r,o,!1),a>0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=pt("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Zo(e,t.line,t,n,o)||t.line!=n.line&&Zo(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");ps()}o.addToHistory&&Ba(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,f;if(e.iter(l,n.line+1,function(k){s&&o.collapsed&&!s.options.lineWrapping&&Zt(k)==s.display.maxLine&&(f=!0),o.collapsed&&l!=t.line&&Pt(k,0),vs(k,new jn(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(k){gr(e,k)&&Pt(k,0)}),o.clearOnEnter&&me(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(ds(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++il,o.atomic=!0),s){if(f&&(s.curOp.updateMaxLine=!0),o.collapsed)Mt(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var y=t.line;y<=n.line;y++)vr(s,y,"text");o.atomic&&Ya(s.doc),at(s,"markerAdded",s,o)}return o}var In=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};In.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();at(this,"clear")}},In.prototype.find=function(e,t){return this.primary.find(e,t)},Ft(In);function Tf(e,t,n,r,i){r=Ce(r),r.shared=!1;var o=[on(e,t,n,r,i)],a=o[0],l=r.widgetNode;return wr(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),o.push(on(s,Le(s,t),Le(s,n),r,i));for(var f=0;f<s.linked.length;++f)if(s.linked[f].isParent)return;a=h(o)}),new In(o,a)}function ol(e){return e.findMarks(G(e.first,0),e.clipPos(G(e.lastLine())),function(t){return t.parent})}function Mf(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(fe(o,a)){var l=on(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Af(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];wr(i.primary.doc,function(s){return o.push(s)});for(var a=0;a<i.markers.length;a++){var l=i.markers[a];xe(o,l.doc)==-1&&(l.parent=null,i.markers.splice(a--,1))}},n=0;n<e.length;n++)t(n)}var Df=0,At=function(e,t,n,r,i){if(!(this instanceof At))return new At(e,t,n,r,i);n==null&&(n=0),Hn.call(this,[new En([new Xr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=G(n,0);this.sel=yr(o),this.history=new hi(null),this.id=++Df,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),lo(this,{from:o,to:o,text:e}),mt(this,yr(o),$e)};At.prototype=W(Hn.prototype,{constructor:At,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=vn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:st(function(e){var t=G(this.first,0),n=this.first+this.size-1;rn(this,{from:t,to:G(n,ge(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Cn(this.cm,0,0),mt(this,yr(t),$e)}),replaceRange:function(e,t,n,r){t=Le(this,t),n=n?Le(this,n):t,nn(this,e,t,n,r)},getRange:function(e,t,n){var r=ir(this,Le(this,e),Le(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(X(this,e))return ge(this,e)},getLineNumber:function(e){return u(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ge(this,e)),Zt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Le(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:st(function(e,t,n){Ka(this,Le(this,typeof e=="number"?G(e,t||0):e),null,n)}),setSelection:st(function(e,t,n){Ka(this,Le(this,e),Le(this,t||e),n)}),extendSelection:st(function(e,t,n){di(this,Le(this,e),t&&Le(this,t),n)}),extendSelections:st(function(e,t){Ga(this,Ho(this,e),t)}),extendSelectionsBy:st(function(e,t){var n=x(this.sel.ranges,e);Ga(this,Ho(this,n),t)}),setSelections:st(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Ee(Le(this,e[i].anchor),Le(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),mt(this,Qt(this.cm,r,t),n)}}),addSelection:st(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Ee(Le(this,e),Le(this,t||e))),mt(this,Qt(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=ir(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=ir(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:st(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"&&vf(this,r,t),s=r.length-1;s>=0;s--)rn(this,r[s]);l?qa(this,l):this.cm&&Vr(this.cm)}),undo:st(function(){vi(this,"undo")}),redo:st(function(){vi(this,"redo")}),undoSelection:st(function(){vi(this,"undo",!0)}),redoSelection:st(function(){vi(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 hi(this.history),wr(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:en(this.history.done),undone:en(this.history.undone)}},setHistory:function(e){var t=this.history=new hi(this.history);t.done=en(e.done.slice(0),null,!0),t.undone=en(e.undone.slice(0),null,!0)},setGutterMarker:st(function(e,t,n){return Fn(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&ne(i)&&(r.gutterMarkers=null),!0})}),clearGutter:st(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Fn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,ne(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!X(this,e)||(t=e,e=ge(this,e),!e))return null}else if(t=u(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:st(function(e,t,n){return Fn(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(re(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:st(function(e,t,n){return Fn(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(re(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:st(function(e,t,n){return Lf(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return on(this,Le(this,e),Le(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=Le(this,e),on(this,e,e,n,"bookmark")},findMarksAt:function(e){e=Le(this,e);var t=[],n=ge(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=Le(this,e),t=Le(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}),Le(this,G(n,t))},indexFromPos:function(e){e=Le(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 At(vn(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 At(vn(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}],Mf(r,ol(this)),r},unlinkDoc:function(e){if(e instanceof ze&&(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),Af(ol(this));break}}if(e.history==this.history){var r=[e.id];wr(e,function(i){return r.push(i.id)},!0),e.history=new hi(null),e.history.done=en(this.history.done,r),e.history.undone=en(this.history.undone,r)}},iterLinkedDocs:function(e){wr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ut(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:st(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&mf(this.cm))})}),At.prototype.eachLine=At.prototype.iter;var al=0;function Of(e){var t=this;if(ll(t),!(We(t,e)||lr(t.display,e))){Xe(e),v&&(al=+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&&lt(t,function(){n=Le(t.doc,n);var N={from:n,to:n,text:t.doc.splitLines(o.filter(function(q){return q!=null}).join(t.doc.lineSeparator())),origin:"paste"};rn(t.doc,N),qa(t.doc,yr(Le(t.doc,n),Le(t.doc,br(N))))})()},s=function(N,q){if(t.options.allowDropFileTypes&&xe(t.options.allowDropFileTypes,N.type)==-1){l();return}var Y=new FileReader;Y.onerror=function(){return l()},Y.onload=function(){var te=Y.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(te)){l();return}o[q]=te,l()},Y.readAsText(N)},f=0;f<r.length;f++)s(r[f],f);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 y=e.dataTransfer.getData("Text");if(y){var k;if(t.state.draggingText&&!t.state.draggingText.copy&&(k=t.listSelections()),pi(t.doc,yr(n,n)),k)for(var E=0;E<k.length;++E)nn(t.doc,"",k[E].anchor,k[E].head,"drag");t.replaceSelection(y,"around","paste"),t.display.input.focus()}}catch(N){}}}}function Nf(e,t){if(v&&(!e.state.draggingText||+new Date-al<100)){hr(t);return}if(!(We(e,t)||lr(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!_)){var n=C("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",F&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),F&&n.parentNode.removeChild(n)}}function Ff(e,t){var n=Dr(e,t);if(n){var r=document.createDocumentFragment();Zi(e,n,r),e.display.dragCursor||(e.display.dragCursor=C("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ie(e.display.dragCursor,r)}}function ll(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function sl(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 fl=!1;function Ef(){fl||(Hf(),fl=!0)}function Hf(){var e;me(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,sl(_f)},100))}),me(window,"blur",function(){return sl(Jr)})}function _f(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var kr={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++)kr[Wn+48]=kr[Wn+96]=String(Wn);for(var mi=65;mi<=90;mi++)kr[mi]=String.fromCharCode(mi);for(var Pn=1;Pn<=12;Pn++)kr[Pn+111]=kr[Pn+63235]="F"+Pn;var fr={};fr.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"},fr.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"},fr.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"},fr.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"]},fr.default=K?fr.macDefault:fr.pcDefault;function If(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 Wf(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=x(n.split(" "),If),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 f in t)e[f]=t[f];return e}function an(e,t,n,r){t=yi(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 an(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=an(e,t.fallthrough[o],n,r);if(a)return a}}}function ul(e){var t=typeof e=="string"?e:kr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hl(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(ce?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(ce?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function cl(e,t){if(F&&e.keyCode==34&&e.char)return!1;var n=kr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),hl(n,e,t))}function yi(e){return typeof e=="string"?fr[e]:e}function ln(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&fe(o.from,h(r).to)<=0;){var a=r.pop();if(fe(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Et(e,function(){for(var l=r.length-1;l>=0;l--)nn(e.doc,"",r[l].from,r[l].to,"+delete");Vr(e)})}function ho(e,t,n){var r=Ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function co(e,t,n){var r=ho(e,t.ch,n);return r==null?null:new G(t.line,r,n<0?"after":"before")}function po(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=be(n,t.doc.direction);if(o){var a=i<0?h(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",f;if(a.level>0||t.doc.direction=="rtl"){var y=Zr(t,n);f=i<0?n.text.length-1:0;var k=tr(t,y,f).top;f=Oe(function(E){return tr(t,y,E).top==k},i<0==(a.level==1)?a.from:a.to-1,f),s=="before"&&(f=ho(n,f,1))}else f=i<0?a.to:a.from;return new G(r,f,s)}}return new G(r,i<0?n.text.length:0,i<0?"before":"after")}function Pf(e,t,n,r){var i=be(t,e.doc.direction);if(!i)return co(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=Ke(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 co(t,n,r);var l=function(le,ue){return ho(t,le instanceof G?le.ch:le,ue)},s,f=function(le){return e.options.lineWrapping?(s=s||Zr(e,t),ma(e,t,s,le)):{begin:0,end:t.text.length}},y=f(n.sticky=="before"?l(n,-1):n.ch);if(e.doc.direction=="rtl"||a.level==1){var k=a.level==1==r<0,E=l(n,k?1:-1);if(E!=null&&(k?E<=a.to&&E<=y.end:E>=a.from&&E>=y.begin)){var N=k?"before":"after";return new G(n.line,E,N)}}var q=function(le,ue,se){for(var he=function(Ie,ft){return ft?new G(n.line,l(Ie,1),"before"):new G(n.line,Ie,"after")};le>=0&&le<i.length;le+=ue){var Se=i[le],ye=ue>0==(Se.level!=1),Me=ye?se.begin:l(se.end,-1);if(Se.from<=Me&&Me<Se.to||(Me=ye?Se.from:l(Se.to,-1),se.begin<=Me&&Me<se.end))return he(Me,ye)}},Y=q(o+r,r,y);if(Y)return Y;var te=r>0?y.end:l(y.begin,-1);return te!=null&&!(r>0&&te==t.text.length)&&(Y=q(r>0?0:i.length-1,r,f(te)),Y)?Y:null}var Rn={selectAll:Qa,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$e)},killLine:function(e){return ln(e,function(t){if(t.empty()){var n=ge(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:G(t.head.line+1,0)}:{from:t.head,to:G(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ln(e,function(t){return{from:G(t.from().line,0),to:Le(e.doc,G(t.to().line+1,0))}})},delLineLeft:function(e){return ln(e,function(t){return{from:G(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ln(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 ln(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(G(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(G(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return dl(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return pl(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Rf(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")},ht)},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")},ht)},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/)?pl(e,t.head):r},ht)},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=Te(e.getLine(o.line),o.ch,r);t.push(Gt(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Et(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=ge(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new G(i.line,i.ch-1)),i.ch>0)i=new G(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),G(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=ge(e.doc,i.line-1).text;a&&(i=new G(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),G(i.line-1,a.length-1),i,"+transpose"))}}n.push(new Ee(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Et(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);Vr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function dl(e,t){var n=ge(e.doc,t),r=Zt(n);return r!=n&&(t=u(r)),po(!0,e,r,t,1)}function Rf(e,t){var n=ge(e.doc,t),r=Ss(n);return r!=n&&(t=u(r)),po(!0,e,n,t,-1)}function pl(e,t){var n=dl(e,t.line),r=ge(e.doc,n.line),i=be(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 G(n.line,a?0:o,n.sticky)}return n}function bi(e,t,n){if(typeof t=="string"&&(t=Rn[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)!=vt}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Bf(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=an(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&an(t,e.options.extraKeys,n,e)||an(t,e.options.keyMap,n,e)}var zf=new kt;function Bn(e,t,n,r){var i=e.state.keySeq;if(i){if(ul(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:zf.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),gl(e,i+" "+t,n,r))return!0}return gl(e,t,n,r)}function gl(e,t,n,r){var i=Bf(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&at(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(Xe(n),ji(e)),!!i}function vl(e,t){var n=cl(t,!0);return n?t.shiftKey&&!e.state.keySeq?Bn(e,"Shift-"+n,t,function(r){return bi(e,r,!0)})||Bn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return bi(e,r)}):Bn(e,n,t,function(r){return bi(e,r)}):!1}function Uf(e,t,n){return Bn(e,"'"+n+"'",t,function(r){return bi(e,r,!0)})}var go=null;function ml(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=Ue(bt(t)),!We(t,e))){v&&m<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=vl(t,e);F&&(go=r?n:null,!r&&n==88&&!Yn&&(K?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),z&&!K&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Gf(t)}}function Gf(e){var t=e.display.lineDiv;nt(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(oe(t,"CodeMirror-crosshair"),et(document,"keyup",n),et(document,"mouseover",n))}me(document,"keyup",n),me(document,"mouseover",n)}function yl(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function bl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(lr(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||K&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(F&&n==go){go=null,Xe(e);return}if(!(F&&(!e.which||e.which<10)&&vl(t,e))){var i=String.fromCharCode(r==null?n:r);i!="\b"&&(Uf(t,e,i)||t.display.input.onKeyPress(e))}}}var Kf=400,vo=function(e,t,n){this.time=e,this.pos=t,this.button=n};vo.prototype.compare=function(e,t,n){return this.time+Kf>e&&fe(t,this.pos)==0&&n==this.button};var zn,Un;function qf(e,t){var n=+new Date;return Un&&Un.compare(n,e,t)?(zn=Un=null,"triple"):zn&&zn.compare(n,e,t)?(Un=new vo(n,e,t),zn=null,"double"):(zn=new vo(n,e,t),Un=null,"single")}function wl(e){var t=this,n=t.display;if(!(We(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,lr(n,e)){g||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!mo(t,e)){var r=Dr(t,e),i=Kt(e),o=r?qf(r,i):"single";ke(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Xf(t,i,r,o,e))&&(i==1?r?Zf(t,r,o,e):dn(e)==n.scroller&&Xe(e):i==2?(r&&di(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(de?t.display.input.onContextMenu(e):Qi(t)))}}}function Xf(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,Bn(e,hl(o,i),i,function(a){if(typeof a=="string"&&(a=Rn[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=vt}finally{e.state.suppressEdits=!1}return l})}function Yf(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=K?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(K?n.altKey:n.ctrlKey)),i}function Zf(e,t,n,r){v?setTimeout(pe(Sa,e),0):e.curOp.focus=Ue(bt(e));var i=Yf(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&Ai&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(fe((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(fe(a.to(),t)>0||t.xRel<0)?jf(e,r,t,i):Qf(e,r,t,i)}function jf(e,t,n,r){var i=e.display,o=!1,a=lt(e,function(f){g&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Qi(e)),et(i.wrapper.ownerDocument,"mouseup",a),et(i.wrapper.ownerDocument,"mousemove",l),et(i.scroller,"dragstart",s),et(i.scroller,"drop",a),o||(Xe(f),r.addNew||di(e.doc,n,null,null,r.extend),g&&!_||v&&m==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(f){o=o||Math.abs(t.clientX-f.clientX)+Math.abs(t.clientY-f.clientY)>=10},s=function(){return o=!0};g&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,me(i.wrapper.ownerDocument,"mouseup",a),me(i.wrapper.ownerDocument,"mousemove",l),me(i.scroller,"dragstart",s),me(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Sl(e,t,n){if(n=="char")return new Ee(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Ee(G(t.line,0),Le(e.doc,G(t.line+1,0)));var r=n(e,t);return new Ee(r.from,r.to)}function Qf(e,t,n,r){v&&Qi(e);var i=e.display,o=e.doc;Xe(t);var a,l,s=o.sel,f=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=f[l]:a=new Ee(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new Ee(n,n)),n=Dr(e,t,!0,!0),l=-1;else{var y=Sl(e,n,r.unit);r.extend?a=fo(a,y.anchor,y.head,r.extend):a=y}r.addNew?l==-1?(l=f.length,mt(o,Qt(e,f.concat([a]),l),{scroll:!1,origin:"*mouse"})):f.length>1&&f[l].empty()&&r.unit=="char"&&!r.extend?(mt(o,Qt(e,f.slice(0,l).concat(f.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):uo(o,l,a,xt):(l=0,mt(o,new Rt([a],0),xt),s=o.sel);var k=n;function E(se){if(fe(k,se)!=0)if(k=se,r.unit=="rectangle"){for(var he=[],Se=e.options.tabSize,ye=Te(ge(o,n.line).text,n.ch,Se),Me=Te(ge(o,se.line).text,se.ch,Se),Ie=Math.min(ye,Me),ft=Math.max(ye,Me),qe=Math.min(n.line,se.line),Ht=Math.min(e.lastLine(),Math.max(n.line,se.line));qe<=Ht;qe++){var Dt=ge(o,qe).text,Je=Be(Dt,Ie,Se);Ie==ft?he.push(new Ee(G(qe,Je),G(qe,Je))):Dt.length>Je&&he.push(new Ee(G(qe,Je),G(qe,Be(Dt,ft,Se))))}he.length||he.push(new Ee(n,n)),mt(o,Qt(e,s.ranges.slice(0,l).concat(he),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(se)}else{var Ot=a,dt=Sl(e,se,r.unit),rt=Ot.anchor,Ve;fe(dt.anchor,rt)>0?(Ve=dt.head,rt=qr(Ot.from(),dt.anchor)):(Ve=dt.anchor,rt=Tt(Ot.to(),dt.head));var Ze=s.ranges.slice(0);Ze[l]=Jf(e,new Ee(Le(o,rt),Ve)),mt(o,Qt(e,Ze,l),xt)}}var N=i.wrapper.getBoundingClientRect(),q=0;function Y(se){var he=++q,Se=Dr(e,se,!0,r.unit=="rectangle");if(Se)if(fe(Se,k)!=0){e.curOp.focus=Ue(bt(e)),E(Se);var ye=li(i,o);(Se.line>=ye.to||Se.line<ye.from)&&setTimeout(lt(e,function(){q==he&&Y(se)}),150)}else{var Me=se.clientY<N.top?-20:se.clientY>N.bottom?20:0;Me&&setTimeout(lt(e,function(){q==he&&(i.scroller.scrollTop+=Me,Y(se))}),50)}}function te(se){e.state.selectingText=!1,q=1/0,se&&(Xe(se),i.input.focus()),et(i.wrapper.ownerDocument,"mousemove",le),et(i.wrapper.ownerDocument,"mouseup",ue),o.history.lastSelOrigin=null}var le=lt(e,function(se){se.buttons===0||!Kt(se)?te(se):Y(se)}),ue=lt(e,te);e.state.selectingText=ue,me(i.wrapper.ownerDocument,"mousemove",le),me(i.wrapper.ownerDocument,"mouseup",ue)}function Jf(e,t){var n=t.anchor,r=t.head,i=ge(e.doc,n.line);if(fe(n,r)==0&&n.sticky==r.sticky)return t;var o=be(i);if(!o)return t;var a=Ke(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 f;if(r.line!=n.line)f=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var y=Ke(o,r.ch,r.sticky),k=y-a||(r.ch-n.ch)*(l.level==1?-1:1);y==s-1||y==s?f=k<0:f=k>0}var E=o[s+(f?-1:0)],N=f==(E.level==1),q=N?E.from:E.to,Y=N?"after":"before";return n.ch==q&&n.sticky==Y?t:new Ee(new G(n.line,q,Y),r)}function kl(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(E){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Xe(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!tt(e,n))return Lt(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var f=a.gutters.childNodes[s];if(f&&f.getBoundingClientRect().right>=i){var y=S(e.doc,o),k=e.display.gutterSpecs[s];return Pe(e,n,e,y,k.className,t),Lt(t)}}}function mo(e,t){return kl(e,t,"gutterClick",!0)}function xl(e,t){lr(e.display,t)||Vf(e,t)||We(e,t,"contextmenu")||de||e.display.input.onContextMenu(t)}function Vf(e,t){return tt(e,"gutterContextMenu")?kl(e,t,"gutterContextMenu",!1):!1}function Cl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),kn(e)}var sn={toString:function(){return"CodeMirror.Init"}},Ll={},wi={};function $f(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,f){f!=sn&&o(l,s,f)}:o)}e.defineOption=n,e.Init=sn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,ao(r)},!0),n("indentUnit",2,ao,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){On(r),kn(r),Mt(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 f=0;;){var y=s.text.indexOf(i,f);if(y==-1)break;f=y+i.length,o.push(G(a,y))}a++});for(var l=o.length-1;l>=0;l--)nn(r.doc,i,o[l],G(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!=sn&&r.refresh()}),n("specialCharPlaceholder",Ms,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",!J),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Cl(r),Dn(r)},!0),n("keyMap","default",function(r,i,o){var a=yi(i),l=o!=sn&&yi(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,tu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=io(i,r.options.lineNumbers),Dn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Xi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return $r(r)},!0),n("scrollbarStyle","native",function(r){Ma(r),$r(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=io(r.options.gutters,i),Dn(r)},!0),n("firstLineNumber",1,Dn,!0),n("lineNumberFormatter",function(r){return r},Dn,!0),n("showCursorWhenSelecting",!1,xn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Jr(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,eu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,xn,!0),n("singleCursorHeightPerLine",!0,xn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,On,!0),n("addModeClass",!1,On,!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,On,!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 eu(e,t,n){var r=n&&n!=sn;if(!t!=!r){var i=e.display.dragFunctions,o=t?me:et;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 tu(e){e.options.lineWrapping?(nt(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(oe(e.display.wrapper,"CodeMirror-wrap"),Ii(e)),Yi(e),Mt(e),kn(e),setTimeout(function(){return $r(e)},100)}function ze(e,t){var n=this;if(!(this instanceof ze))return new ze(e,t);this.options=t=t?Ce(t):{},Ce(Ll,t,!1);var r=t.value;typeof r=="string"?r=new At(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new ze.inputStyles[t.inputStyle](this),o=this.display=new pf(e,r,i,t);o.wrapper.CodeMirror=this,Cl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ma(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 kt,keySeq:null,specialChars:null},t.autofocus&&!B&&o.input.focus(),v&&m<11&&setTimeout(function(){return n.display.input.reset(!0)},20),ru(this),Ef(),Er(this),this.curOp.forceUpdate=!0,Wa(this,r),t.autofocus&&!B||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ji(n)},20):Jr(this);for(var a in wi)wi.hasOwnProperty(a)&&wi[a](this,t[a],sn);Oa(this),t.finishInit&&t.finishInit(this);for(var l=0;l<yo.length;++l)yo[l](this);Hr(this),g&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}ze.defaults=Ll,ze.optionHandlers=wi;function ru(e){var t=e.display;me(t.scroller,"mousedown",lt(e,wl)),v&&m<11?me(t.scroller,"dblclick",lt(e,function(s){if(!We(e,s)){var f=Dr(e,s);if(!(!f||mo(e,s)||lr(e.display,s))){Xe(s);var y=e.findWordAt(f);di(e.doc,y.anchor,y.head)}}})):me(t.scroller,"dblclick",function(s){return We(e,s)||Xe(s)}),me(t.scroller,"contextmenu",function(s){return xl(e,s)}),me(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||xl(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 f=s.touches[0];return f.radiusX<=1&&f.radiusY<=1}function a(s,f){if(f.left==null)return!0;var y=f.left-s.left,k=f.top-s.top;return y*y+k*k>20*20}me(t.scroller,"touchstart",function(s){if(!We(e,s)&&!o(s)&&!mo(e,s)){t.input.ensurePolled(),clearTimeout(n);var f=+new Date;t.activeTouch={start:f,moved:!1,prev:f-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),me(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),me(t.scroller,"touchend",function(s){var f=t.activeTouch;if(f&&!lr(t,s)&&f.left!=null&&!f.moved&&new Date-f.start<300){var y=e.coordsChar(t.activeTouch,"page"),k;!f.prev||a(f,f.prev)?k=new Ee(y,y):!f.prev.prev||a(f,f.prev.prev)?k=e.findWordAt(y):k=new Ee(G(y.line,0),Le(e.doc,G(y.line+1,0))),e.setSelection(k.anchor,k.head),e.focus(),Xe(s)}i()}),me(t.scroller,"touchcancel",i),me(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ln(e,t.scroller.scrollTop),Nr(e,t.scroller.scrollLeft,!0),Pe(e,"scroll",e))}),me(t.scroller,"mousewheel",function(s){return Ea(e,s)}),me(t.scroller,"DOMMouseScroll",function(s){return Ea(e,s)}),me(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){We(e,s)||hr(s)},over:function(s){We(e,s)||(Ff(e,s),hr(s))},start:function(s){return Nf(e,s)},drop:lt(e,Of),leave:function(s){We(e,s)||ll(e)}};var l=t.input.getField();me(l,"keyup",function(s){return yl.call(e,s)}),me(l,"keydown",lt(e,ml)),me(l,"keypress",lt(e,bl)),me(l,"focus",function(s){return Ji(e,s)}),me(l,"blur",function(s){return Jr(e,s)})}var yo=[];ze.defineInitHook=function(e){return yo.push(e)};function Gn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=mn(e,t).state:n="prev");var a=e.options.tabSize,l=ge(i,t),s=Te(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var f=l.text.match(/^\s*/)[0],y;if(!r&&!/\S/.test(l.text))y=0,n="not";else if(n=="smart"&&(y=i.mode.indent(o,l.text.slice(f.length),l.text),y==vt||y>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?y=Te(ge(i,t-1).text,null,a):y=0:n=="add"?y=s+e.options.indentUnit:n=="subtract"?y=s-e.options.indentUnit:typeof n=="number"&&(y=s+n),y=Math.max(0,y);var k="",E=0;if(e.options.indentWithTabs)for(var N=Math.floor(y/a);N;--N)E+=a,k+=" ";if(E<y&&(k+=Gt(y-E)),k!=f)return nn(i,k,G(t,0),G(t,f.length),"+input"),l.stateAfter=null,!0;for(var q=0;q<i.sel.ranges.length;q++){var Y=i.sel.ranges[q];if(Y.head.line==t&&Y.head.ch<f.length){var te=G(t,f.length);uo(i,q,new Ee(te,te));break}}}var Jt=null;function Si(e){Jt=e}function bo(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=Ut(t),f=null;if(l&&r.ranges.length>1)if(Jt&&Jt.text.join(`
`)==t){if(r.ranges.length%Jt.text.length==0){f=[];for(var y=0;y<Jt.text.length;y++)f.push(o.splitLines(Jt.text[y]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(f=x(s,function(le){return[le]}));for(var k=e.curOp.updateInput,E=r.ranges.length-1;E>=0;E--){var N=r.ranges[E],q=N.from(),Y=N.to();N.empty()&&(n&&n>0?q=G(q.line,q.ch-n):e.state.overwrite&&!l?Y=G(Y.line,Math.min(ge(o,Y.line).text.length,Y.ch+h(s).length)):l&&Jt&&Jt.lineWise&&Jt.text.join(`
`)==s.join(`
`)&&(q=Y=G(q.line,0)));var te={from:q,to:Y,text:f?f[E%f.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};rn(e.doc,te),at(e,"inputRead",e,te)}t&&!l&&Ml(e,t),Vr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=k),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Tl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Et(t,function(){return bo(t,n,0,null,"paste")}),!0}function Ml(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=Gn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ge(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Gn(e,i.head.line,"smart"));a&&at(e,"electricInput",e,i.head.line)}}}function Al(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:G(i,0),head:G(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function wo(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function Dl(){var e=C("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=C("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),L&&(e.style.border="1px solid black"),t}function nu(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){ke(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)&&lt(this,t[r])(this,i,a),Pe(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"](yi(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:wt(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");O(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(a){return a.priority}),this.state.modeGen++,Mt(this)}),removeOverlay:wt(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++,Mt(this);return}}}),indentLine:wt(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),X(this.doc,r)&&Gn(this,r,i,o)}),indentSelection:wt(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&&(Gn(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&Vr(this));else{var s=l.from(),f=l.to(),y=Math.max(o,s.line);o=Math.min(this.lastLine(),f.line-(f.ch?0:1))+1;for(var k=y;k<o;++k)Gn(this,k,r);var E=this.doc.sel.ranges;s.ch==0&&i.length==E.length&&E[a].from().ch>0&&uo(this.doc,a,new Ee(s,E[a].to()),$e)}}}),getTokenAt:function(r,i){return Ro(this,r,i)},getLineTokens:function(r,i){return Ro(this,G(r),i,!0)},getTokenTypeAt:function(r){r=Le(this.doc,r);var i=Io(this,ge(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var f=o+a>>1;if((f?i[f*2-1]:0)>=l)a=f;else if(i[f*2+1]<l)o=f+1;else{s=i[f*2+2];break}}var y=s?s.indexOf("overlay "):-1;return y<0?s:y==0?null:s.slice(0,y-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 f=a[l[i][s]];f&&o.push(f)}else l.helperType&&a[l.helperType]?o.push(a[l.helperType]):a[l.name]&&o.push(a[l.name]);for(var y=0;y<a._global.length;y++){var k=a._global[y];k.pred(l,this)&&xe(o,k.val)==-1&&o.push(k.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=Eo(o,r==null?o.first+o.size-1:r),mn(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=Le(this.doc,r):o=r?a.from():a.to(),jt(this,o,i||"page")},charCoords:function(r,i){return ni(this,Le(this.doc,r),i||"page")},coordsChar:function(r,i){return r=pa(this,r,i||"page"),Gi(this,r.left,r.top)},lineAtHeight:function(r,i){return r=pa(this,{top:r,left:0},i||"page").top,S(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=ge(this.doc,r)}else l=r;return ri(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-ar(l):0)},defaultTextHeight:function(){return jr(this.display)},defaultCharWidth:function(){return Qr(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=jt(this,Le(this.doc,r));var f=r.bottom,y=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),a=="over")f=r.top;else if(a=="above"||a=="near"){var k=Math.max(s.wrapper.clientHeight,this.doc.height),E=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>k)&&r.top>i.offsetHeight?f=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=k&&(f=r.bottom),y+i.offsetWidth>E&&(y=E-i.offsetWidth)}i.style.top=f+"px",i.style.left=i.style.right="",l=="right"?(y=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?y=0:l=="middle"&&(y=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=y+"px"),o&&$s(this,{left:y,top:f,right:y+i.offsetWidth,bottom:f+i.offsetHeight})},triggerOnKeyDown:wt(ml),triggerOnKeyPress:wt(bl),triggerOnKeyUp:yl,triggerOnMouseDown:wt(wl),execCommand:function(r){if(Rn.hasOwnProperty(r))return Rn[r].call(null,this)},triggerElectric:wt(function(r){Ml(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=Le(this.doc,r),f=0;f<i&&(s=So(this.doc,s,l,o,a),!s.hitSide);++f);return s},moveH:wt(function(r,i){var o=this;this.extendSelectionsBy(function(a){return o.display.shift||o.doc.extend||a.empty()?So(o.doc,a.head,r,i,o.options.rtlMoveVisually):r<0?a.from():a.to()},ht)}),deleteH:wt(function(r,i){var o=this.doc.sel,a=this.doc;o.somethingSelected()?a.replaceSelection("",null,"+delete"):ln(this,function(l){var s=So(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 f=Le(this.doc,r),y=0;y<i;++y){var k=jt(this,f,"div");if(s==null?s=k.left:k.left=s,f=Ol(this,k,l,o),f.hitSide)break}return f},moveV:wt(function(r,i){var o=this,a=this.doc,l=[],s=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(y){if(s)return r<0?y.from():y.to();var k=jt(o,y.head,"div");y.goalColumn!=null&&(k.left=y.goalColumn),l.push(k.left);var E=Ol(o,k,r,i);return i=="page"&&y==a.sel.primary()&&$i(o,ni(o,E,"div").top-k.top),E},ht),l.length)for(var f=0;f<a.sel.ranges.length;f++)a.sel.ranges[f].goalColumn=l[f]}),findWordAt:function(r){var i=this.doc,o=ge(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 f=o.charAt(a),y=V(f,s)?function(k){return V(k,s)}:/\s/.test(f)?function(k){return/\s/.test(k)}:function(k){return!/\s/.test(k)&&!V(k)};a>0&&y(o.charAt(a-1));)--a;for(;l<o.length&&y(o.charAt(l));)++l}return new Ee(G(r.line,a),G(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?nt(this.display.cursorDiv,"CodeMirror-overwrite"):oe(this.display.cursorDiv,"CodeMirror-overwrite"),Pe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Ue(bt(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:wt(function(r,i){Cn(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-er(this)-this.display.barHeight,width:r.scrollWidth-er(this)-this.display.barWidth,clientHeight:Ri(this),clientWidth:Mr(this)}},scrollIntoView:wt(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:G(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?ef(this,r):xa(this,r.from,r.to,r.margin)}),setSize:wt(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&&ha(this);var l=this.display.viewFrom;this.doc.iter(l,this.display.viewTo,function(s){if(s.widgets){for(var f=0;f<s.widgets.length;f++)if(s.widgets[f].noHScroll){vr(o,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,Pe(this,"refresh",this)}),operation:function(r){return Et(this,r)},startOperation:function(){return Er(this)},endOperation:function(){return Hr(this)},refresh:wt(function(){var r=this.display.cachedTextHeight;Mt(this),this.curOp.forceUpdate=!0,kn(this),Cn(this,this.doc.scrollLeft,this.doc.scrollTop),ro(this.display),(r==null||Math.abs(r-jr(this.display))>.5||this.options.lineWrapping)&&Yi(this),Pe(this,"refresh",this)}),swapDoc:wt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Wa(this,r),kn(this),this.display.input.reset(),Cn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,at(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}},Ft(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 So(e,t,n,r,i){var o=t,a=n,l=ge(e,t.line),s=i&&e.direction=="rtl"?-n:n;function f(){var ue=t.line+s;return ue<e.first||ue>=e.first+e.size?!1:(t=new G(ue,t.ch,t.sticky),l=ge(e,ue))}function y(ue){var se;if(r=="codepoint"){var he=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(he))se=null;else{var Se=n>0?he>=55296&&he<56320:he>=56320&&he<57343;se=new G(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(Se?2:1))),-n)}}else i?se=Pf(e.cm,l,t,n):se=co(l,t,n);if(se==null)if(!ue&&f())t=po(i,e.cm,l,t.line,s);else return!1;else t=se;return!0}if(r=="char"||r=="codepoint")y();else if(r=="column")y(!0);else if(r=="word"||r=="group")for(var k=null,E=r=="group",N=e.cm&&e.cm.getHelper(t,"wordChars"),q=!0;!(n<0&&!y(!q));q=!1){var Y=l.text.charAt(t.ch)||`
`,te=V(Y,N)?"w":E&&Y==`
`?"n":!E||/\s/.test(Y)?null:"p";if(E&&!q&&!te&&(te="s"),k&&k!=te){n<0&&(n=1,y(),t.sticky="after");break}if(te&&(k=te),n>0&&!y(!q))break}var le=gi(e,t,o,a,!0);return Fe(o,le)&&(le.hitSide=!0),le}function Ol(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,ke(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*jr(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 f;f=Gi(e,o,a),!!f.outside;){if(n<0?a<=0:a>=i.height){f.hitSide=!0;break}a+=n*5}return f}var _e=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new kt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};_e.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,wo(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}me(i,"paste",function(l){!o(l)||We(r,l)||Tl(l,r)||m<=11&&setTimeout(lt(r,function(){return t.updateFromDOM()}),20)}),me(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),me(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),me(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),me(i,"touchstart",function(){return n.forceCompositionEnd()}),me(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||We(r,l))){if(r.somethingSelected())Si({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=Al(r);Si({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,$e),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var f=Jt.text.join(`
`);if(l.clipboardData.setData("Text",f),l.clipboardData.getData("Text")==f){l.preventDefault();return}}var y=Dl(),k=y.firstChild;wo(k),r.display.lineSpace.insertBefore(y,r.display.lineSpace.firstChild),k.value=Jt.text.join(`
`);var E=Ue(De(i));Wt(k),setTimeout(function(){r.display.lineSpace.removeChild(y),E.focus(),E==i&&n.showPrimarySelection()},50)}}me(i,"copy",a),me(i,"cut",a)},_e.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},_e.prototype.prepareSelection=function(){var e=wa(this.cm,!1);return e.focus=Ue(De(this.div))==this.div,e},_e.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},_e.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},_e.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=ki(t,e.anchorNode,e.anchorOffset),a=ki(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&a&&!a.bad&&fe(qr(o,a),r)==0&&fe(Tt(o,a),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&Nl(t,r)||{node:l[0].measure.map[2],offset:0},f=i.line<t.display.viewTo&&Nl(t,i);if(!f){var y=l[l.length-1].measure,k=y.maps?y.maps[y.maps.length-1]:y.map;f={node:k[k.length-1],offset:k[k.length-2]-k[k.length-3]}}if(!s||!f){e.removeAllRanges();return}var E=e.rangeCount&&e.getRangeAt(0),N;try{N=Qe(s.node,s.offset,f.offset,f.node)}catch(q){}N&&(!z&&t.state.focused?(e.collapse(s.node,s.offset),N.collapsed||(e.removeAllRanges(),e.addRange(N))):(e.removeAllRanges(),e.addRange(N)),E&&e.anchorNode==null?e.addRange(E):z&&this.startGracePeriod()),this.rememberSelection()}},_e.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)},_e.prototype.showMultipleSelections=function(e){ie(this.cm.display.cursorDiv,e.cursors),ie(this.cm.display.selectionDiv,e.selection)},_e.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},_e.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return gt(this.div,t)},_e.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||Ue(De(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},_e.prototype.blur=function(){this.div.blur()},_e.prototype.getField=function(){return this.div},_e.prototype.supportsTouch=function(){return!0},_e.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Et(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)},_e.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},_e.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(A&&b&&this.cm.display.gutterSpecs.length&&iu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=ki(t,e.anchorNode,e.anchorOffset),r=ki(t,e.focusNode,e.focusOffset);n&&r&&Et(t,function(){mt(t.doc,yr(n,r),$e),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},_e.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=G(r.line-1,ge(e.doc,r.line-1).length)),i.ch==ge(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=G(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;r.line==t.viewFrom||(o=Or(e,r.line))==0?(a=u(t.view[0].line),l=t.view[0].node):(a=u(t.view[o].line),l=t.view[o-1].node.nextSibling);var s=Or(e,i.line),f,y;if(s==t.view.length-1?(f=t.viewTo-1,y=t.lineDiv.lastChild):(f=u(t.view[s+1].line)-1,y=t.view[s+1].node.previousSibling),!l)return!1;for(var k=e.doc.splitLines(ou(e,l,y,a,f)),E=ir(e.doc,G(a,0),G(f,ge(e.doc,f).text.length));k.length>1&&E.length>1;)if(h(k)==h(E))k.pop(),E.pop(),f--;else if(k[0]==E[0])k.shift(),E.shift(),a++;else break;for(var N=0,q=0,Y=k[0],te=E[0],le=Math.min(Y.length,te.length);N<le&&Y.charCodeAt(N)==te.charCodeAt(N);)++N;for(var ue=h(k),se=h(E),he=Math.min(ue.length-(k.length==1?N:0),se.length-(E.length==1?N:0));q<he&&ue.charCodeAt(ue.length-q-1)==se.charCodeAt(se.length-q-1);)++q;if(k.length==1&&E.length==1&&a==r.line)for(;N&&N>r.ch&&ue.charCodeAt(ue.length-q-1)==se.charCodeAt(se.length-q-1);)N--,q++;k[k.length-1]=ue.slice(0,ue.length-q).replace(/^\u200b+/,""),k[0]=k[0].slice(N).replace(/\u200b+$/,"");var Se=G(a,N),ye=G(f,E.length?h(E).length-q:0);if(k.length>1||k[0]||fe(Se,ye))return nn(e.doc,k,Se,ye,"+input"),!0},_e.prototype.ensurePolled=function(){this.forceCompositionEnd()},_e.prototype.reset=function(){this.forceCompositionEnd()},_e.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},_e.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))},_e.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Et(this.cm,function(){return Mt(e.cm)})},_e.prototype.setUneditable=function(e){e.contentEditable="false"},_e.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||lt(this.cm,bo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},_e.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},_e.prototype.onContextMenu=function(){},_e.prototype.resetPosition=function(){},_e.prototype.needsContentAttribute=!0;function Nl(e,t){var n=Bi(e,t.line);if(!n||n.hidden)return null;var r=ge(e.doc,t.line),i=aa(n,r,t.line),o=be(r,e.doc.direction),a="left";if(o){var l=Ke(o,t.ch);a=l%2?"right":"left"}var s=fa(i.map,t.ch,a);return s.offset=s.collapse=="right"?s.end:s.start,s}function iu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function fn(e,t){return t&&(e.bad=!0),e}function ou(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function f(N){return function(q){return q.id==N}}function y(){a&&(o+=l,s&&(o+=l),a=s=!1)}function k(N){N&&(y(),o+=N)}function E(N){if(N.nodeType==1){var q=N.getAttribute("cm-text");if(q){k(q);return}var Y=N.getAttribute("cm-marker"),te;if(Y){var le=e.findMarks(G(r,0),G(i+1,0),f(+Y));le.length&&(te=le[0].find(0))&&k(ir(e.doc,te.from,te.to).join(l));return}if(N.getAttribute("contenteditable")=="false")return;var ue=/^(pre|div|p|li|table|br)$/i.test(N.nodeName);if(!/^br$/i.test(N.nodeName)&&N.textContent.length==0)return;ue&&y();for(var se=0;se<N.childNodes.length;se++)E(N.childNodes[se]);/^(pre|p)$/i.test(N.nodeName)&&(s=!0),ue&&(a=!0)}else N.nodeType==3&&k(N.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;E(t),t!=n;)t=t.nextSibling,s=!1;return o}function ki(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return fn(e.clipPos(G(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 au(o,t,n)}}function au(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!gt(r,t))return fn(G(u(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?h(e.rest):e.line;return fn(G(u(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,f=s.maps;function y(te,le,ue){for(var se=-1;se<(f?f.length:0);se++)for(var he=se<0?s.map:f[se],Se=0;Se<he.length;Se+=3){var ye=he[Se+2];if(ye==te||ye==le){var Me=u(se<0?e.line:e.rest[se]),Ie=he[Se]+ue;return(ue<0||ye!=te)&&(Ie=he[Se+(ue?1:0)]),G(Me,Ie)}}}var k=y(a,l,n);if(k)return fn(k,i);for(var E=l.nextSibling,N=a?a.nodeValue.length-n:0;E;E=E.nextSibling){if(k=y(E,E.firstChild,0),k)return fn(G(k.line,k.ch-N),i);N+=E.textContent.length}for(var q=l.previousSibling,Y=n;q;q=q.previousSibling){if(k=y(q,q.firstChild,-1),k)return fn(G(k.line,k.ch+Y),i);Y+=q.textContent.length}}var je=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new kt,this.hasSelection=!1,this.composing=null,this.resetting=!1};je.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),L&&(i.style.width="0px"),me(i,"input",function(){v&&m>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),me(i,"paste",function(a){We(r,a)||Tl(a,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(a){if(!We(r,a)){if(r.somethingSelected())Si({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=Al(r);Si({lineWise:!0,text:l.text}),a.type=="cut"?r.setSelections(l.ranges,null,$e):(n.prevInput="",i.value=l.text.join(`
`),Wt(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}me(i,"cut",o),me(i,"copy",o),me(e.scroller,"paste",function(a){if(!(lr(e,a)||We(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)}}),me(e.lineSpace,"selectstart",function(a){lr(e,a)||Xe(a)}),me(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"})}}),me(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},je.prototype.createField=function(e){this.wrapper=Dl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;wo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},je.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},je.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=wa(e);if(e.options.moveInputWithCursor){var i=jt(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},je.prototype.showSelection=function(e){var t=this.cm,n=t.display;ie(n.cursorDiv,e.cursors),ie(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},je.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&&Wt(this.textarea),v&&m>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",v&&m>=9&&(this.hasSelection=null));this.resetting=!1}},je.prototype.getField=function(){return this.textarea},je.prototype.supportsTouch=function(){return!1},je.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!B||Ue(De(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},je.prototype.blur=function(){this.textarea.blur()},je.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},je.prototype.receivedFocus=function(){this.slowPoll()},je.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},je.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)},je.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||dr(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(v&&m>=9&&this.hasSelection===i||K&&/[\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=""),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 Et(t,function(){bo(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},je.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},je.prototype.onKeyPress=function(){v&&m>=9&&(this.hasSelection=null),this.fastPoll()},je.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||F)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&lt(n,mt)(n.doc,yr(o),$e);var s=i.style.cssText,f=t.wrapper.style.cssText,y=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-y.top-5)+"px; left: "+(e.clientX-y.left-5)+`px;
z-index: 1000; background: `+(v?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var k;g&&(k=i.ownerDocument.defaultView.scrollY),r.input.focus(),g&&i.ownerDocument.defaultView.scrollTo(null,k),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=N,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function E(){if(i.selectionStart!=null){var Y=n.somethingSelected(),te=""+(Y?i.value:"");i.value="⇚",i.value=te,t.prevInput=Y?"":"",i.selectionStart=1,i.selectionEnd=te.length,r.selForContextMenu=n.doc.sel}}function N(){if(t.contextMenuPending==N&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=s,v&&m<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!v||v&&m<9)&&E();var Y=0,te=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput==""?lt(n,Qa)(n):Y++<10?r.detectingSelectAll=setTimeout(te,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(te,200)}}if(v&&m>=9&&E(),de){hr(e);var q=function(){et(window,"mouseup",q),setTimeout(N,20)};me(window,"mouseup",q)}else setTimeout(N,50)},je.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},je.prototype.setUneditable=function(){},je.prototype.needsContentAttribute=!1;function lu(e,t){if(t=t?Ce(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=Ue(De(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(me(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(s){}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(et(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=ze(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function su(e){e.off=et,e.on=me,e.wheelEventPixels=gf,e.Doc=At,e.splitLines=Ut,e.countColumn=Te,e.findColumn=Be,e.isWordChar=j,e.Pass=vt,e.signal=Pe,e.Line=Xr,e.changeEnd=br,e.scrollbarModel=Ta,e.Pos=G,e.cmpPos=fe,e.modes=Br,e.mimeModes=Xt,e.resolveMode=zr,e.getMode=Ur,e.modeExtensions=pr,e.extendMode=Gr,e.copyState=Vt,e.startState=Kr,e.innerMode=gn,e.commands=Rn,e.keyMap=fr,e.keyName=cl,e.isModifierKey=ul,e.lookupKey=an,e.normalizeKeyMap=Wf,e.StringStream=Ye,e.SharedTextMarker=In,e.TextMarker=Sr,e.LineWidget=_n,e.e_preventDefault=Xe,e.e_stopPropagation=Pr,e.e_stop=hr,e.addClass=nt,e.contains=gt,e.rmClass=oe,e.keyNames=kr}$f(ze),nu(ze);var fu="iter insert remove copy getEditor constructor".split(" ");for(var xi in At.prototype)At.prototype.hasOwnProperty(xi)&&xe(fu,xi)<0&&(ze.prototype[xi]=function(e){return function(){return e.apply(this.doc,arguments)}}(At.prototype[xi]));return Ft(At),ze.inputStyles={textarea:je,contenteditable:_e},ze.defineMode=function(e){!ze.defaults.mode&&e!="null"&&(ze.defaults.mode=e),Yt.apply(this,arguments)},ze.defineMIME=Tr,ze.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ze.defineMIME("text/plain","null"),ze.defineExtension=function(e,t){ze.prototype[e]=t},ze.defineDocExtension=function(e,t){At.prototype[e]=t},ze.fromTextArea=lu,su(ze),ze.version="5.65.19",ze})}(Ti)),Ti.exports}var Rl;function Tu(){return Rl||(Rl=1,function(ae,R){(function(T){T(nr())})(function(T){var Z="CodeMirror-hint",z="CodeMirror-hint-active";T.showHint=function(w,L,A){if(!L)return w.showHint(A);A&&A.async&&(L.async=!0);var B={hint:L};if(A)for(var K in A)B[K]=A[K];return w.showHint(B)},T.defineExtension("showHint",function(w){w=v(this,this.getCursor("start"),w);var L=this.listSelections();if(!(L.length>1)){if(this.somethingSelected()){if(!w.hint.supportsSelection)return;for(var A=0;A<L.length;A++)if(L[A].head.line!=L[A].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var B=this.state.completionActive=new c(this,w);B.options.hint&&(T.signal(this,"startCompletion",this),B.update(!0))}}),T.defineExtension("closeHint",function(){this.state.completionActive&&this.state.completionActive.close()});function c(w,L){if(this.cm=w,this.options=L,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var A=this;w.on("cursorActivity",this.activityFunc=function(){A.cursorActivity()})}}var d=window.requestAnimationFrame||function(w){return setTimeout(w,1e3/60)},p=window.cancelAnimationFrame||clearTimeout;c.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&T.signal(this.data,"close"),this.widget&&this.widget.close(),T.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(w,L){var A=w.list[L],B=this;this.cm.operation(function(){A.hint?A.hint(B.cm,w,A):B.cm.replaceRange(m(A),A.from||w.from,A.to||w.to,"complete"),T.signal(w,"pick",A),B.cm.scrollIntoView()}),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(p(this.debounce),this.debounce=0);var w=this.startPos;this.data&&(w=this.data.from);var L=this.cm.getCursor(),A=this.cm.getLine(L.line);if(L.line!=this.startPos.line||A.length-L.ch!=this.startLen-this.startPos.ch||L.ch<w.ch||this.cm.somethingSelected()||!L.ch||this.options.closeCharacters.test(A.charAt(L.ch-1)))this.close();else{var B=this;this.debounce=d(function(){B.update()}),this.widget&&this.widget.disable()}},update:function(w){if(this.tick!=null){var L=this,A=++this.tick;F(this.options.hint,this.cm,this.options,function(B){L.tick==A&&L.finishUpdate(B,w)})}},finishUpdate:function(w,L){this.data&&T.signal(this.data,"update");var A=this.widget&&this.widget.picked||L&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=w,w&&w.list.length&&(A&&w.list.length==1?this.pick(w,0):(this.widget=new b(this,w),T.signal(w,"shown")))}};function v(w,L,A){var B=w.options.hintOptions,K={};for(var Q in H)K[Q]=H[Q];if(B)for(var Q in B)B[Q]!==void 0&&(K[Q]=B[Q]);if(A)for(var Q in A)A[Q]!==void 0&&(K[Q]=A[Q]);return K.hint.resolve&&(K.hint=K.hint.resolve(w,L)),K}function m(w){return typeof w=="string"?w:w.text}function g(w,L){var A={Up:function(){L.moveFocus(-1)},Down:function(){L.moveFocus(1)},PageUp:function(){L.moveFocus(-L.menuSize()+1,!0)},PageDown:function(){L.moveFocus(L.menuSize()-1,!0)},Home:function(){L.setFocus(0)},End:function(){L.setFocus(L.length-1)},Enter:L.pick,Tab:L.pick,Esc:L.close},B=/Mac/.test(navigator.platform);B&&(A["Ctrl-P"]=function(){L.moveFocus(-1)},A["Ctrl-N"]=function(){L.moveFocus(1)});var K=w.options.customKeys,Q=K?{}:A;function J(de,re){var oe;typeof re!="string"?oe=function(U){return re(U,L)}:A.hasOwnProperty(re)?oe=A[re]:oe=re,Q[de]=oe}if(K)for(var $ in K)K.hasOwnProperty($)&&J($,K[$]);var ce=w.options.extraKeys;if(ce)for(var $ in ce)ce.hasOwnProperty($)&&J($,ce[$]);return Q}function M(w,L){for(;L&&L!=w;){if(L.nodeName.toUpperCase()==="LI"&&L.parentNode==w)return L;L=L.parentNode}}function b(w,L){this.id="cm-complete-"+Math.floor(Math.random(1e6)),this.completion=w,this.data=L,this.picked=!1;var A=this,B=w.cm,K=B.getInputField().ownerDocument,Q=K.defaultView||K.parentWindow,J=this.hints=K.createElement("ul");J.setAttribute("role","listbox"),J.setAttribute("aria-expanded","true"),J.id=this.id;var $=w.cm.options.theme;J.className="CodeMirror-hints "+$,this.selectedHint=L.selectedHint||0;for(var ce=L.list,de=0;de<ce.length;++de){var re=J.appendChild(K.createElement("li")),oe=ce[de],U=Z+(de!=this.selectedHint?"":" "+z);oe.className!=null&&(U=oe.className+" "+U),re.className=U,de==this.selectedHint&&re.setAttribute("aria-selected","true"),re.id=this.id+"-"+de,re.setAttribute("role","option"),oe.render?oe.render(re,L,oe):re.appendChild(K.createTextNode(oe.displayText||m(oe))),re.hintId=de}var ie=w.options.container||K.body,C=B.cursorCoords(w.options.alignWithWord?L.from:null),pt=C.left,Qe=C.bottom,gt=!0,Ue=0,nt=0;if(ie!==K.body){var It=["absolute","relative","fixed"].indexOf(Q.getComputedStyle(ie).position)!==-1,Wt=It?ie:ie.offsetParent,it=Wt.getBoundingClientRect(),bt=K.body.getBoundingClientRect();Ue=it.left-bt.left-Wt.scrollLeft,nt=it.top-bt.top-Wt.scrollTop}J.style.left=pt-Ue+"px",J.style.top=Qe-nt+"px";var De=Q.innerWidth||Math.max(K.body.offsetWidth,K.documentElement.offsetWidth),ke=Q.innerHeight||Math.max(K.body.offsetHeight,K.documentElement.offsetHeight);ie.appendChild(J),B.getInputField().setAttribute("aria-autocomplete","list"),B.getInputField().setAttribute("aria-owns",this.id),B.getInputField().setAttribute("aria-activedescendant",this.id+"-"+this.selectedHint);var pe=w.options.moveOnOverlap?J.getBoundingClientRect():new DOMRect,Ce=w.options.paddingForScrollbar?J.scrollHeight>J.clientHeight+1:!1,Te;setTimeout(function(){Te=B.getScrollInfo()});var kt=pe.bottom-ke;if(kt>0){var xe=pe.bottom-pe.top,Re=pe.top-(C.bottom-C.top)-2;ke-pe.top<Re?(xe>Re&&(J.style.height=(xe=Re)+"px"),J.style.top=(Qe=C.top-xe)+nt+"px",gt=!1):J.style.height=ke-pe.top-2+"px"}var vt=pe.right-De;if(Ce&&(vt+=B.display.nativeBarWidth),vt>0&&(pe.right-pe.left>De&&(J.style.width=De-5+"px",vt-=pe.right-pe.left-De),J.style.left=(pt=Math.max(C.left-vt-Ue,0))+"px"),Ce)for(var $e=J.firstChild;$e;$e=$e.nextSibling)$e.style.paddingRight=B.display.nativeBarWidth+"px";if(B.addKeyMap(this.keyMap=g(w,{moveFocus:function(Be,Ge){A.changeActive(A.selectedHint+Be,Ge)},setFocus:function(Be){A.changeActive(Be)},menuSize:function(){return A.screenAmount()},length:ce.length,close:function(){w.close()},pick:function(){A.pick()},data:L})),w.options.closeOnUnfocus){var xt;B.on("blur",this.onBlur=function(){xt=setTimeout(function(){w.close()},100)}),B.on("focus",this.onFocus=function(){clearTimeout(xt)})}B.on("scroll",this.onScroll=function(){var Be=B.getScrollInfo(),Ge=B.getWrapperElement().getBoundingClientRect();Te||(Te=B.getScrollInfo());var Gt=Qe+Te.top-Be.top,h=Gt-(Q.pageYOffset||(K.documentElement||K.body).scrollTop);if(gt||(h+=J.offsetHeight),h<=Ge.top||h>=Ge.bottom)return w.close();J.style.top=Gt+"px",J.style.left=pt+Te.left-Be.left+"px"}),T.on(J,"dblclick",function(Be){var Ge=M(J,Be.target||Be.srcElement);Ge&&Ge.hintId!=null&&(A.changeActive(Ge.hintId),A.pick())}),T.on(J,"click",function(Be){var Ge=M(J,Be.target||Be.srcElement);Ge&&Ge.hintId!=null&&(A.changeActive(Ge.hintId),w.options.completeOnSingleClick&&A.pick())}),T.on(J,"mousedown",function(){setTimeout(function(){B.focus()},20)});var ht=this.getSelectedHintRange();return(ht.from!==0||ht.to!==0)&&this.scrollToActive(),T.signal(L,"select",ce[this.selectedHint],J.childNodes[this.selectedHint]),!0}b.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var w=this.completion.cm.getInputField();w.removeAttribute("aria-activedescendant"),w.removeAttribute("aria-owns");var L=this.completion.cm;this.completion.options.closeOnUnfocus&&(L.off("blur",this.onBlur),L.off("focus",this.onFocus)),L.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var w=this;this.keyMap={Enter:function(){w.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(w,L){if(w>=this.data.list.length?w=L?this.data.list.length-1:0:w<0&&(w=L?0:this.data.list.length-1),this.selectedHint!=w){var A=this.hints.childNodes[this.selectedHint];A&&(A.className=A.className.replace(" "+z,""),A.removeAttribute("aria-selected")),A=this.hints.childNodes[this.selectedHint=w],A.className+=" "+z,A.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",A.id),this.scrollToActive(),T.signal(this.data,"select",this.data.list[this.selectedHint],A)}},scrollToActive:function(){var w=this.getSelectedHintRange(),L=this.hints.childNodes[w.from],A=this.hints.childNodes[w.to],B=this.hints.firstChild;L.offsetTop<this.hints.scrollTop?this.hints.scrollTop=L.offsetTop-B.offsetTop:A.offsetTop+A.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=A.offsetTop+A.offsetHeight-this.hints.clientHeight+B.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var w=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-w),to:Math.min(this.data.list.length-1,this.selectedHint+w)}}};function D(w,L){if(!w.somethingSelected())return L;for(var A=[],B=0;B<L.length;B++)L[B].supportsSelection&&A.push(L[B]);return A}function F(w,L,A,B){if(w.async)w(L,B,A);else{var K=w(L,A);K&&K.then?K.then(B):B(K)}}function _(w,L){var A=w.getHelpers(L,"hint"),B;if(A.length){var K=function(Q,J,$){var ce=D(Q,A);function de(re){if(re==ce.length)return J(null);F(ce[re],Q,$,function(oe){oe&&oe.list.length>0?J(oe):de(re+1)})}de(0)};return K.async=!0,K.supportsSelection=!0,K}else return(B=w.getHelper(w.getCursor(),"hintWords"))?function(Q){return T.hint.fromList(Q,{words:B})}:T.hint.anyword?function(Q,J){return T.hint.anyword(Q,J)}:function(){}}T.registerHelper("hint","auto",{resolve:_}),T.registerHelper("hint","fromList",function(w,L){var A=w.getCursor(),B=w.getTokenAt(A),K,Q=T.Pos(A.line,B.start),J=A;B.start<A.ch&&/\w/.test(B.string.charAt(A.ch-B.start-1))?K=B.string.substr(0,A.ch-B.start):(K="",Q=A);for(var $=[],ce=0;ce<L.words.length;ce++){var de=L.words[ce];de.slice(0,K.length)==K&&$.push(de)}if($.length)return{list:$,from:Q,to:J}}),T.commands.autocomplete=T.showHint;var H={hint:T.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};T.defineOption("hintOptions",null)})}()),Wl.exports}Tu();var Bl={exports:{}},zl;function Mu(){return zl||(zl=1,function(ae,R){(function(T){T(nr())})(function(T){var Z=T.Pos;function z(w,L){for(var A=0,B=w.length;A<B;++A)L(w[A])}function c(w,L){if(!Array.prototype.indexOf){for(var A=w.length;A--;)if(w[A]===L)return!0;return!1}return w.indexOf(L)!=-1}function d(w,L,A,B){var K=w.getCursor(),Q=A(w,K);if(!/\b(?:string|comment)\b/.test(Q.type)){var J=T.innerMode(w.getMode(),Q.state);if(J.mode.helperType!=="json"){Q.state=J.state,/^[\w$_]*$/.test(Q.string)?Q.end>K.ch&&(Q.end=K.ch,Q.string=Q.string.slice(0,K.ch-Q.start)):Q={start:K.ch,end:K.ch,string:"",state:Q.state,type:Q.string=="."?"property":null};for(var $=Q;$.type=="property";){if($=A(w,Z(K.line,$.start)),$.string!=".")return;if($=A(w,Z(K.line,$.start)),!ce)var ce=[];ce.push($)}return{list:H(Q,ce,L,B),from:Z(K.line,Q.start),to:Z(K.line,Q.end)}}}}function p(w,L){return d(w,D,function(A,B){return A.getTokenAt(B)},L)}T.registerHelper("hint","javascript",p);function v(w,L){var A=w.getTokenAt(L);return L.ch==A.start+1&&A.string.charAt(0)=="."?(A.end=A.start,A.string=".",A.type="property"):/^\.[\w$_]*$/.test(A.string)&&(A.type="property",A.start++,A.string=A.string.replace(/\./,"")),A}function m(w,L){return d(w,F,v,L)}T.registerHelper("hint","coffeescript",m);var g="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),M="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),b="prototype apply call bind".split(" "),D="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),F="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ");function _(w,L){if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)for(var A in w)L(A);else for(var B=w;B;B=Object.getPrototypeOf(B))Object.getOwnPropertyNames(B).forEach(L)}function H(w,L,A,B){var K=[],Q=w.string,J=B&&B.globalScope||window;function $(C){C.lastIndexOf(Q,0)==0&&!c(K,C)&&K.push(C)}function ce(C){typeof C=="string"?z(g,$):C instanceof Array?z(M,$):C instanceof Function&&z(b,$),_(C,$)}if(L&&L.length){var de=L.pop(),re;for(de.type&&de.type.indexOf("variable")===0?(B&&B.additionalContext&&(re=B.additionalContext[de.string]),(!B||B.useGlobalScope!==!1)&&(re=re||J[de.string])):de.type=="string"?re="":de.type=="atom"?re=1:de.type=="function"&&(J.jQuery!=null&&(de.string=="$"||de.string=="jQuery")&&typeof J.jQuery=="function"?re=J.jQuery():J._!=null&&de.string=="_"&&typeof J._=="function"&&(re=J._()));re!=null&&L.length;)re=re[L.pop().string];re!=null&&ce(re)}else{for(var oe=w.state.localVars;oe;oe=oe.next)$(oe.name);for(var U=w.state.context;U;U=U.prev)for(var oe=U.vars;oe;oe=oe.next)$(oe.name);for(var oe=w.state.globalVars;oe;oe=oe.next)$(oe.name);if(B&&B.additionalContext!=null)for(var ie in B.additionalContext)$(ie);(!B||B.useGlobalScope!==!1)&&ce(J),z(A,$)}return K}})}()),Bl.exports}Mu();var Ul={exports:{}},Gl;function Au(){return Gl||(Gl=1,function(ae,R){(function(T){T(nr())})(function(T){T.defineMode("javascript",function(Z,z){var c=Z.indentUnit,d=z.statementIndent,p=z.jsonld,v=z.json||p,m=z.trackScope!==!1,g=z.typescript,M=z.wordCharacters||/[\w$\xa1-\uffff]/,b=function(){function u(ot){return{type:ot,style:"keyword"}}var S=u("keyword a"),X=u("keyword b"),ee=u("keyword c"),G=u("keyword d"),fe=u("operator"),Fe={type:"atom",style:"atom"};return{if:u("if"),while:S,with:S,else:X,do:X,try:X,finally:X,return:G,break:G,continue:G,new:u("new"),delete:ee,void:ee,throw:ee,debugger:u("debugger"),var:u("var"),const:u("var"),let:u("var"),function:u("function"),catch:u("catch"),for:u("for"),switch:u("switch"),case:u("case"),default:u("default"),in:fe,typeof:fe,instanceof:fe,true:Fe,false:Fe,null:Fe,undefined:Fe,NaN:Fe,Infinity:Fe,this:u("this"),class:u("class"),super:u("atom"),yield:ee,export:u("export"),import:u("import"),extends:ee,await:ee}}(),D=/[+\-*&%=<>!?|~^@]/,F=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function _(u){for(var S=!1,X,ee=!1;(X=u.next())!=null;){if(!S){if(X=="/"&&!ee)return;X=="["?ee=!0:ee&&X=="]"&&(ee=!1)}S=!S&&X=="\\"}}var H,w;function L(u,S,X){return H=u,w=X,S}function A(u,S){var X=u.next();if(X=='"'||X=="'")return S.tokenize=B(X),S.tokenize(u,S);if(X=="."&&u.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return L("number","number");if(X=="."&&u.match(".."))return L("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(X))return L(X);if(X=="="&&u.eat(">"))return L("=>","operator");if(X=="0"&&u.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return L("number","number");if(/\d/.test(X))return u.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),L("number","number");if(X=="/")return u.eat("*")?(S.tokenize=K,K(u,S)):u.eat("/")?(u.skipToEnd(),L("comment","comment")):Pt(u,S,1)?(_(u),u.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),L("regexp","string-2")):(u.eat("="),L("operator","operator",u.current()));if(X=="`")return S.tokenize=Q,Q(u,S);if(X=="#"&&u.peek()=="!")return u.skipToEnd(),L("meta","meta");if(X=="#"&&u.eatWhile(M))return L("variable","property");if(X=="<"&&u.match("!--")||X=="-"&&u.match("->")&&!/\S/.test(u.string.slice(0,u.start)))return u.skipToEnd(),L("comment","comment");if(D.test(X))return(X!=">"||!S.lexical||S.lexical.type!=">")&&(u.eat("=")?(X=="!"||X=="=")&&u.eat("="):/[<>*+\-|&?]/.test(X)&&(u.eat(X),X==">"&&u.eat(X))),X=="?"&&u.eat(".")?L("."):L("operator","operator",u.current());if(M.test(X)){u.eatWhile(M);var ee=u.current();if(S.lastType!="."){if(b.propertyIsEnumerable(ee)){var G=b[ee];return L(G.type,G.style,ee)}if(ee=="async"&&u.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return L("async","keyword",ee)}return L("variable","variable",ee)}}function B(u){return function(S,X){var ee=!1,G;if(p&&S.peek()=="@"&&S.match(F))return X.tokenize=A,L("jsonld-keyword","meta");for(;(G=S.next())!=null&&!(G==u&&!ee);)ee=!ee&&G=="\\";return ee||(X.tokenize=A),L("string","string")}}function K(u,S){for(var X=!1,ee;ee=u.next();){if(ee=="/"&&X){S.tokenize=A;break}X=ee=="*"}return L("comment","comment")}function Q(u,S){for(var X=!1,ee;(ee=u.next())!=null;){if(!X&&(ee=="`"||ee=="$"&&u.eat("{"))){S.tokenize=A;break}X=!X&&ee=="\\"}return L("quasi","string-2",u.current())}var J="([{}])";function $(u,S){S.fatArrowAt&&(S.fatArrowAt=null);var X=u.string.indexOf("=>",u.start);if(!(X<0)){if(g){var ee=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(u.string.slice(u.start,X));ee&&(X=ee.index)}for(var G=0,fe=!1,Fe=X-1;Fe>=0;--Fe){var ot=u.string.charAt(Fe),Tt=J.indexOf(ot);if(Tt>=0&&Tt<3){if(!G){++Fe;break}if(--G==0){ot=="("&&(fe=!0);break}}else if(Tt>=3&&Tt<6)++G;else if(M.test(ot))fe=!0;else if(/["'\/`]/.test(ot))for(;;--Fe){if(Fe==0)return;var qr=u.string.charAt(Fe-1);if(qr==ot&&u.string.charAt(Fe-2)!="\\"){Fe--;break}}else if(fe&&!G){++Fe;break}}fe&&!G&&(S.fatArrowAt=Fe)}}var ce={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function de(u,S,X,ee,G,fe){this.indented=u,this.column=S,this.type=X,this.prev=G,this.info=fe,ee!=null&&(this.align=ee)}function re(u,S){if(!m)return!1;for(var X=u.localVars;X;X=X.next)if(X.name==S)return!0;for(var ee=u.context;ee;ee=ee.prev)for(var X=ee.vars;X;X=X.next)if(X.name==S)return!0}function oe(u,S,X,ee,G){var fe=u.cc;for(U.state=u,U.stream=G,U.marked=null,U.cc=fe,U.style=S,u.lexical.hasOwnProperty("align")||(u.lexical.align=!0);;){var Fe=fe.length?fe.pop():v?xe:Te;if(Fe(X,ee)){for(;fe.length&&fe[fe.length-1].lex;)fe.pop()();return U.marked?U.marked:X=="variable"&&re(u,ee)?"variable-2":S}}}var U={state:null,marked:null,cc:null};function ie(){for(var u=arguments.length-1;u>=0;u--)U.cc.push(arguments[u])}function C(){return ie.apply(null,arguments),!0}function pt(u,S){for(var X=S;X;X=X.next)if(X.name==u)return!0;return!1}function Qe(u){var S=U.state;if(U.marked="def",!!m){if(S.context){if(S.lexical.info=="var"&&S.context&&S.context.block){var X=gt(u,S.context);if(X!=null){S.context=X;return}}else if(!pt(u,S.localVars)){S.localVars=new It(u,S.localVars);return}}z.globalVars&&!pt(u,S.globalVars)&&(S.globalVars=new It(u,S.globalVars))}}function gt(u,S){if(S)if(S.block){var X=gt(u,S.prev);return X?X==S.prev?S:new nt(X,S.vars,!0):null}else return pt(u,S.vars)?S:new nt(S.prev,new It(u,S.vars),!1);else return null}function Ue(u){return u=="public"||u=="private"||u=="protected"||u=="abstract"||u=="readonly"}function nt(u,S,X){this.prev=u,this.vars=S,this.block=X}function It(u,S){this.name=u,this.next=S}var Wt=new It("this",new It("arguments",null));function it(){U.state.context=new nt(U.state.context,U.state.localVars,!1),U.state.localVars=Wt}function bt(){U.state.context=new nt(U.state.context,U.state.localVars,!0),U.state.localVars=null}it.lex=bt.lex=!0;function De(){U.state.localVars=U.state.context.vars,U.state.context=U.state.context.prev}De.lex=!0;function ke(u,S){var X=function(){var ee=U.state,G=ee.indented;if(ee.lexical.type=="stat")G=ee.lexical.indented;else for(var fe=ee.lexical;fe&&fe.type==")"&&fe.align;fe=fe.prev)G=fe.indented;ee.lexical=new de(G,U.stream.column(),u,null,ee.lexical,S)};return X.lex=!0,X}function pe(){var u=U.state;u.lexical.prev&&(u.lexical.type==")"&&(u.indented=u.lexical.indented),u.lexical=u.lexical.prev)}pe.lex=!0;function Ce(u){function S(X){return X==u?C():u==";"||X=="}"||X==")"||X=="]"?ie():C(S)}return S}function Te(u,S){return u=="var"?C(ke("vardef",S),Pr,Ce(";"),pe):u=="keyword a"?C(ke("form"),vt,Te,pe):u=="keyword b"?C(ke("form"),Te,pe):u=="keyword d"?U.stream.match(/^\s*$/,!1)?C():C(ke("stat"),xt,Ce(";"),pe):u=="debugger"?C(Ce(";")):u=="{"?C(ke("}"),bt,Oe,pe,De):u==";"?C():u=="if"?(U.state.lexical.info=="else"&&U.state.cc[U.state.cc.length-1]==pe&&U.state.cc.pop()(),C(ke("form"),vt,Te,pe,Rr)):u=="function"?C(Ut):u=="for"?C(ke("form"),bt,Xn,Te,De,pe):u=="class"||g&&S=="interface"?(U.marked="keyword",C(ke("form",u=="class"?u:S),Br,pe)):u=="variable"?g&&S=="declare"?(U.marked="keyword",C(Te)):g&&(S=="module"||S=="enum"||S=="type")&&U.stream.match(/^\s*\w/,!1)?(U.marked="keyword",S=="enum"?C(ge):S=="type"?C(Yn,Ce("operator"),be,Ce(";")):C(ke("form"),Lt,Ce("{"),ke("}"),Oe,pe,pe)):g&&S=="namespace"?(U.marked="keyword",C(ke("form"),xe,Te,pe)):g&&S=="abstract"?(U.marked="keyword",C(Te)):C(ke("stat"),P):u=="switch"?C(ke("form"),vt,Ce("{"),ke("}","switch"),bt,Oe,pe,pe,De):u=="case"?C(xe,Ce(":")):u=="default"?C(Ce(":")):u=="catch"?C(ke("form"),it,kt,Te,pe,De):u=="export"?C(ke("stat"),zr,pe):u=="import"?C(ke("stat"),pr,pe):u=="async"?C(Te):S=="@"?C(xe,Te):ie(ke("stat"),xe,Ce(";"),pe)}function kt(u){if(u=="(")return C(qt,Ce(")"))}function xe(u,S){return $e(u,S,!1)}function Re(u,S){return $e(u,S,!0)}function vt(u){return u!="("?ie():C(ke(")"),xt,Ce(")"),pe)}function $e(u,S,X){if(U.state.fatArrowAt==U.stream.start){var ee=X?x:h;if(u=="(")return C(it,ke(")"),ve(qt,")"),pe,Ce("=>"),ee,De);if(u=="variable")return ie(it,Lt,Ce("=>"),ee,De)}var G=X?Be:ht;return ce.hasOwnProperty(u)?C(G):u=="function"?C(Ut,G):u=="class"||g&&S=="interface"?(U.marked="keyword",C(ke("form"),Di,pe)):u=="keyword c"||u=="async"?C(X?Re:xe):u=="("?C(ke(")"),xt,Ce(")"),pe,G):u=="operator"||u=="spread"?C(X?Re:xe):u=="["?C(ke("]"),Ye,pe,G):u=="{"?Ae(V,"}",null,G):u=="quasi"?ie(Ge,G):u=="new"?C(O(X)):C()}function xt(u){return u.match(/[;\}\)\],]/)?ie():ie(xe)}function ht(u,S){return u==","?C(xt):Be(u,S,!1)}function Be(u,S,X){var ee=X==!1?ht:Be,G=X==!1?xe:Re;if(u=="=>")return C(it,X?x:h,De);if(u=="operator")return/\+\+|--/.test(S)||g&&S=="!"?C(ee):g&&S=="<"&&U.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?C(ke(">"),ve(be,">"),pe,ee):S=="?"?C(xe,Ce(":"),G):C(G);if(u=="quasi")return ie(Ge,ee);if(u!=";"){if(u=="(")return Ae(Re,")","call",ee);if(u==".")return C(j,ee);if(u=="[")return C(ke("]"),xt,Ce("]"),pe,ee);if(g&&S=="as")return U.marked="keyword",C(be,ee);if(u=="regexp")return U.state.lastType=U.marked="operator",U.stream.backUp(U.stream.pos-U.stream.start-1),C(G)}}function Ge(u,S){return u!="quasi"?ie():S.slice(S.length-2)!="${"?C(Ge):C(xt,Gt)}function Gt(u){if(u=="}")return U.marked="string-2",U.state.tokenize=Q,C(Ge)}function h(u){return $(U.stream,U.state),ie(u=="{"?Te:xe)}function x(u){return $(U.stream,U.state),ie(u=="{"?Te:Re)}function O(u){return function(S){return S=="."?C(u?W:I):S=="variable"&&g?C(tt,u?Be:ht):ie(u?Re:xe)}}function I(u,S){if(S=="target")return U.marked="keyword",C(ht)}function W(u,S){if(S=="target")return U.marked="keyword",C(Be)}function P(u){return u==":"?C(pe,Te):ie(ht,Ce(";"),pe)}function j(u){if(u=="variable")return U.marked="property",C()}function V(u,S){if(u=="async")return U.marked="property",C(V);if(u=="variable"||U.style=="keyword"){if(U.marked="property",S=="get"||S=="set")return C(ne);var X;return g&&U.state.fatArrowAt==U.stream.start&&(X=U.stream.match(/^\s*:\s*/,!1))&&(U.state.fatArrowAt=U.stream.pos+X[0].length),C(we)}else{if(u=="number"||u=="string")return U.marked=p?"property":U.style+" property",C(we);if(u=="jsonld-keyword")return C(we);if(g&&Ue(S))return U.marked="keyword",C(V);if(u=="[")return C(xe,Ne,Ce("]"),we);if(u=="spread")return C(Re,we);if(S=="*")return U.marked="keyword",C(V);if(u==":")return ie(we)}}function ne(u){return u!="variable"?ie(we):(U.marked="property",C(Ut))}function we(u){if(u==":")return C(Re);if(u=="(")return ie(Ut)}function ve(u,S,X){function ee(G,fe){if(X?X.indexOf(G)>-1:G==","){var Fe=U.state.lexical;return Fe.info=="call"&&(Fe.pos=(Fe.pos||0)+1),C(function(ot,Tt){return ot==S||Tt==S?ie():ie(u)},ee)}return G==S||fe==S?C():X&&X.indexOf(";")>-1?ie(u):C(Ce(S))}return function(G,fe){return G==S||fe==S?C():ie(u,ee)}}function Ae(u,S,X){for(var ee=3;ee<arguments.length;ee++)U.cc.push(arguments[ee]);return C(ke(S,X),ve(u,S),pe)}function Oe(u){return u=="}"?C():ie(Te,Oe)}function Ne(u,S){if(g){if(u==":")return C(be);if(S=="?")return C(Ne)}}function He(u,S){if(g&&(u==":"||S=="in"))return C(be)}function Ke(u){if(g&&u==":")return U.stream.match(/^\s*\w+\s+is\b/,!1)?C(xe,Ct,be):C(be)}function Ct(u,S){if(S=="is")return U.marked="keyword",C()}function be(u,S){if(S=="keyof"||S=="typeof"||S=="infer"||S=="readonly")return U.marked="keyword",C(S=="typeof"?Re:be);if(u=="variable"||S=="void")return U.marked="type",C(ct);if(S=="|"||S=="&")return C(be);if(u=="string"||u=="number"||u=="atom")return C(ct);if(u=="[")return C(ke("]"),ve(be,"]",","),pe,ct);if(u=="{")return C(ke("}"),me,pe,ct);if(u=="(")return C(ve(We,")"),Lr,ct);if(u=="<")return C(ve(be,">"),be);if(u=="quasi")return ie(et,ct)}function Lr(u){if(u=="=>")return C(be)}function me(u){return u.match(/[\}\)\]]/)?C():u==","||u==";"?C(me):ie(zt,me)}function zt(u,S){if(u=="variable"||U.style=="keyword")return U.marked="property",C(zt);if(S=="?"||u=="number"||u=="string")return C(zt);if(u==":")return C(be);if(u=="[")return C(Ce("variable"),He,Ce("]"),zt);if(u=="(")return ie(dr,zt);if(!u.match(/[;\}\)\],]/))return C()}function et(u,S){return u!="quasi"?ie():S.slice(S.length-2)!="${"?C(et):C(be,Pe)}function Pe(u){if(u=="}")return U.marked="string-2",U.state.tokenize=Q,C(et)}function We(u,S){return u=="variable"&&U.stream.match(/^\s*[?:]/,!1)||S=="?"?C(We):u==":"?C(be):u=="spread"?C(We):ie(be)}function ct(u,S){if(S=="<")return C(ke(">"),ve(be,">"),pe,ct);if(S=="|"||u=="."||S=="&")return C(be);if(u=="[")return C(be,Ce("]"),ct);if(S=="extends"||S=="implements")return U.marked="keyword",C(be);if(S=="?")return C(be,Ce(":"),be)}function tt(u,S){if(S=="<")return C(ke(">"),ve(be,">"),pe,ct)}function Ft(){return ie(be,Xe)}function Xe(u,S){if(S=="=")return C(be)}function Pr(u,S){return S=="enum"?(U.marked="keyword",C(ge)):ie(Lt,Ne,Kt,Ai)}function Lt(u,S){if(g&&Ue(S))return U.marked="keyword",C(Lt);if(u=="variable")return Qe(S),C();if(u=="spread")return C(Lt);if(u=="[")return Ae(dn,"]");if(u=="{")return Ae(hr,"}")}function hr(u,S){return u=="variable"&&!U.stream.match(/^\s*:/,!1)?(Qe(S),C(Kt)):(u=="variable"&&(U.marked="property"),u=="spread"?C(Lt):u=="}"?ie():u=="["?C(xe,Ce("]"),Ce(":"),hr):C(Ce(":"),Lt,Kt))}function dn(){return ie(Lt,Kt)}function Kt(u,S){if(S=="=")return C(Re)}function Ai(u){if(u==",")return C(Pr)}function Rr(u,S){if(u=="keyword b"&&S=="else")return C(ke("form","else"),Te,pe)}function Xn(u,S){if(S=="await")return C(Xn);if(u=="(")return C(ke(")"),pn,pe)}function pn(u){return u=="var"?C(Pr,cr):u=="variable"?C(cr):ie(cr)}function cr(u,S){return u==")"?C():u==";"?C(cr):S=="in"||S=="of"?(U.marked="keyword",C(xe,cr)):ie(xe,cr)}function Ut(u,S){if(S=="*")return U.marked="keyword",C(Ut);if(u=="variable")return Qe(S),C(Ut);if(u=="(")return C(it,ke(")"),ve(qt,")"),pe,Ke,Te,De);if(g&&S=="<")return C(ke(">"),ve(Ft,">"),pe,Ut)}function dr(u,S){if(S=="*")return U.marked="keyword",C(dr);if(u=="variable")return Qe(S),C(dr);if(u=="(")return C(it,ke(")"),ve(qt,")"),pe,Ke,De);if(g&&S=="<")return C(ke(">"),ve(Ft,">"),pe,dr)}function Yn(u,S){if(u=="keyword"||u=="variable")return U.marked="type",C(Yn);if(S=="<")return C(ke(">"),ve(Ft,">"),pe)}function qt(u,S){return S=="@"&&C(xe,qt),u=="spread"?C(qt):g&&Ue(S)?(U.marked="keyword",C(qt)):g&&u=="this"?C(Ne,Kt):ie(Lt,Ne,Kt)}function Di(u,S){return u=="variable"?Br(u,S):Xt(u,S)}function Br(u,S){if(u=="variable")return Qe(S),C(Xt)}function Xt(u,S){if(S=="<")return C(ke(">"),ve(Ft,">"),pe,Xt);if(S=="extends"||S=="implements"||g&&u==",")return S=="implements"&&(U.marked="keyword"),C(g?be:xe,Xt);if(u=="{")return C(ke("}"),Yt,pe)}function Yt(u,S){if(u=="async"||u=="variable"&&(S=="static"||S=="get"||S=="set"||g&&Ue(S))&&U.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return U.marked="keyword",C(Yt);if(u=="variable"||U.style=="keyword")return U.marked="property",C(Tr,Yt);if(u=="number"||u=="string")return C(Tr,Yt);if(u=="[")return C(xe,Ne,Ce("]"),Tr,Yt);if(S=="*")return U.marked="keyword",C(Yt);if(g&&u=="(")return ie(dr,Yt);if(u==";"||u==",")return C(Yt);if(u=="}")return C();if(S=="@")return C(xe,Yt)}function Tr(u,S){if(S=="!"||S=="?")return C(Tr);if(u==":")return C(be,Kt);if(S=="=")return C(Re);var X=U.state.lexical.prev,ee=X&&X.info=="interface";return ie(ee?dr:Ut)}function zr(u,S){return S=="*"?(U.marked="keyword",C(Kr,Ce(";"))):S=="default"?(U.marked="keyword",C(xe,Ce(";"))):u=="{"?C(ve(Ur,"}"),Kr,Ce(";")):ie(Te)}function Ur(u,S){if(S=="as")return U.marked="keyword",C(Ce("variable"));if(u=="variable")return ie(Re,Ur)}function pr(u){return u=="string"?C():u=="("?ie(xe):u=="."?ie(ht):ie(Gr,Vt,Kr)}function Gr(u,S){return u=="{"?Ae(Gr,"}"):(u=="variable"&&Qe(S),S=="*"&&(U.marked="keyword"),C(gn))}function Vt(u){if(u==",")return C(Gr,Vt)}function gn(u,S){if(S=="as")return U.marked="keyword",C(Gr)}function Kr(u,S){if(S=="from")return U.marked="keyword",C(xe)}function Ye(u){return u=="]"?C():ie(ve(Re,"]"))}function ge(){return ie(ke("form"),Lt,Ce("{"),ke("}"),ve(ir,"}"),pe,pe)}function ir(){return ie(Lt,Kt)}function vn(u,S){return u.lastType=="operator"||u.lastType==","||D.test(S.charAt(0))||/[,.]/.test(S.charAt(0))}function Pt(u,S,X){return S.tokenize==A&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(S.lastType)||S.lastType=="quasi"&&/\{\s*$/.test(u.string.slice(0,u.pos-(X||0)))}return{startState:function(u){var S={tokenize:A,lastType:"sof",cc:[],lexical:new de((u||0)-c,0,"block",!1),localVars:z.localVars,context:z.localVars&&new nt(null,null,!1),indented:u||0};return z.globalVars&&typeof z.globalVars=="object"&&(S.globalVars=z.globalVars),S},token:function(u,S){if(u.sol()&&(S.lexical.hasOwnProperty("align")||(S.lexical.align=!1),S.indented=u.indentation(),$(u,S)),S.tokenize!=K&&u.eatSpace())return null;var X=S.tokenize(u,S);return H=="comment"?X:(S.lastType=H=="operator"&&(w=="++"||w=="--")?"incdec":H,oe(S,X,H,w,u))},indent:function(u,S){if(u.tokenize==K||u.tokenize==Q)return T.Pass;if(u.tokenize!=A)return 0;var X=S&&S.charAt(0),ee=u.lexical,G;if(!/^\s*else\b/.test(S))for(var fe=u.cc.length-1;fe>=0;--fe){var Fe=u.cc[fe];if(Fe==pe)ee=ee.prev;else if(Fe!=Rr&&Fe!=De)break}for(;(ee.type=="stat"||ee.type=="form")&&(X=="}"||(G=u.cc[u.cc.length-1])&&(G==ht||G==Be)&&!/^[,\.=+\-*:?[\(]/.test(S));)ee=ee.prev;d&&ee.type==")"&&ee.prev.type=="stat"&&(ee=ee.prev);var ot=ee.type,Tt=X==ot;return ot=="vardef"?ee.indented+(u.lastType=="operator"||u.lastType==","?ee.info.length+1:0):ot=="form"&&X=="{"?ee.indented:ot=="form"?ee.indented+c:ot=="stat"?ee.indented+(vn(u,S)?d||c:0):ee.info=="switch"&&!Tt&&z.doubleIndentSwitch!=!1?ee.indented+(/^(?:case|default)\b/.test(S)?c:2*c):ee.align?ee.column+(Tt?0:1):ee.indented+(Tt?0:c)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:v?null:"/*",blockCommentEnd:v?null:"*/",blockCommentContinue:v?null:" * ",lineComment:v?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:v?"json":"javascript",jsonldMode:p,jsonMode:v,expressionAllowed:Pt,skipExpression:function(u){oe(u,"atom","atom","true",new T.StringStream("",2,null))}}}),T.registerHelper("wordChars","javascript",/[\w$]/),T.defineMIME("text/javascript","javascript"),T.defineMIME("text/ecmascript","javascript"),T.defineMIME("application/javascript","javascript"),T.defineMIME("application/x-javascript","javascript"),T.defineMIME("application/ecmascript","javascript"),T.defineMIME("application/json",{name:"javascript",json:!0}),T.defineMIME("application/x-json",{name:"javascript",json:!0}),T.defineMIME("application/manifest+json",{name:"javascript",json:!0}),T.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),T.defineMIME("text/typescript",{name:"javascript",typescript:!0}),T.defineMIME("application/typescript",{name:"javascript",typescript:!0})})}()),Ul.exports}Au();var Kl={exports:{}},ql;function ls(){return ql||(ql=1,function(ae,R){(function(T){T(nr())})(function(T){function Z(p,v,m,g){if(m&&m.call){var M=m;m=null}else var M=d(p,m,"rangeFinder");typeof v=="number"&&(v=T.Pos(v,0));var b=d(p,m,"minFoldSize");function D(w){var L=M(p,v);if(!L||L.to.line-L.from.line<b)return null;if(g==="fold")return L;for(var A=p.findMarksAt(L.from),B=0;B<A.length;++B)if(A[B].__isFold){if(!w)return null;L.cleared=!0,A[B].clear()}return L}var F=D(!0);if(d(p,m,"scanUp"))for(;!F&&v.line>p.firstLine();)v=T.Pos(v.line-1,0),F=D(!1);if(!(!F||F.cleared||g==="unfold")){var _=z(p,m,F);T.on(_,"mousedown",function(w){H.clear(),T.e_preventDefault(w)});var H=p.markText(F.from,F.to,{replacedWith:_,clearOnEnter:d(p,m,"clearOnEnter"),__isFold:!0});H.on("clear",function(w,L){T.signal(p,"unfold",p,w,L)}),T.signal(p,"fold",p,F.from,F.to)}}function z(p,v,m){var g=d(p,v,"widget");if(typeof g=="function"&&(g=g(m.from,m.to)),typeof g=="string"){var M=document.createTextNode(g);g=document.createElement("span"),g.appendChild(M),g.className="CodeMirror-foldmarker"}else g&&(g=g.cloneNode(!0));return g}T.newFoldFunction=function(p,v){return function(m,g){Z(m,g,{rangeFinder:p,widget:v})}},T.defineExtension("foldCode",function(p,v,m){Z(this,p,v,m)}),T.defineExtension("isFolded",function(p){for(var v=this.findMarksAt(p),m=0;m<v.length;++m)if(v[m].__isFold)return!0}),T.commands.toggleFold=function(p){p.foldCode(p.getCursor())},T.commands.fold=function(p){p.foldCode(p.getCursor(),null,"fold")},T.commands.unfold=function(p){p.foldCode(p.getCursor(),{scanUp:!1},"unfold")},T.commands.foldAll=function(p){p.operation(function(){for(var v=p.firstLine(),m=p.lastLine();v<=m;v++)p.foldCode(T.Pos(v,0),{scanUp:!1},"fold")})},T.commands.unfoldAll=function(p){p.operation(function(){for(var v=p.firstLine(),m=p.lastLine();v<=m;v++)p.foldCode(T.Pos(v,0),{scanUp:!1},"unfold")})},T.registerHelper("fold","combine",function(){var p=Array.prototype.slice.call(arguments,0);return function(v,m){for(var g=0;g<p.length;++g){var M=p[g](v,m);if(M)return M}}}),T.registerHelper("fold","auto",function(p,v){for(var m=p.getHelpers(v,"fold"),g=0;g<m.length;g++){var M=m[g](p,v);if(M)return M}});var c={rangeFinder:T.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};T.defineOption("foldOptions",null);function d(p,v,m){if(v&&v[m]!==void 0)return v[m];var g=p.options.foldOptions;return g&&g[m]!==void 0?g[m]:c[m]}T.defineExtension("foldOption",function(p,v){return d(this,p,v)})})}()),Kl.exports}ls();var Xl={exports:{}},Yl;function Du(){return Yl||(Yl=1,function(ae,R){(function(T){T(nr(),ls())})(function(T){T.defineOption("foldGutter",!1,function(H,w,L){L&&L!=T.Init&&(H.clearGutter(H.state.foldGutter.options.gutter),H.state.foldGutter=null,H.off("gutterClick",M),H.off("changes",D),H.off("viewportChange",F),H.off("fold",_),H.off("unfold",_),H.off("swapDoc",D),H.off("optionChange",b)),w&&(H.state.foldGutter=new z(c(w)),g(H),H.on("gutterClick",M),H.on("changes",D),H.on("viewportChange",F),H.on("fold",_),H.on("unfold",_),H.on("swapDoc",D),H.on("optionChange",b))});var Z=T.Pos;function z(H){this.options=H,this.from=this.to=0}function c(H){return H===!0&&(H={}),H.gutter==null&&(H.gutter="CodeMirror-foldgutter"),H.indicatorOpen==null&&(H.indicatorOpen="CodeMirror-foldgutter-open"),H.indicatorFolded==null&&(H.indicatorFolded="CodeMirror-foldgutter-folded"),H}function d(H,w){for(var L=H.findMarks(Z(w,0),Z(w+1,0)),A=0;A<L.length;++A)if(L[A].__isFold){var B=L[A].find(-1);if(B&&B.line===w)return L[A]}}function p(H){if(typeof H=="string"){var w=document.createElement("div");return w.className=H+" CodeMirror-guttermarker-subtle",w}else return H.cloneNode(!0)}function v(H,w,L){var A=H.state.foldGutter.options,B=w-1,K=H.foldOption(A,"minFoldSize"),Q=H.foldOption(A,"rangeFinder"),J=typeof A.indicatorFolded=="string"&&m(A.indicatorFolded),$=typeof A.indicatorOpen=="string"&&m(A.indicatorOpen);H.eachLine(w,L,function(ce){++B;var de=null,re=ce.gutterMarkers;if(re&&(re=re[A.gutter]),d(H,B)){if(J&&re&&J.test(re.className))return;de=p(A.indicatorFolded)}else{var oe=Z(B,0),U=Q&&Q(H,oe);if(U&&U.to.line-U.from.line>=K){if($&&re&&$.test(re.className))return;de=p(A.indicatorOpen)}}!de&&!re||H.setGutterMarker(ce,A.gutter,de)})}function m(H){return new RegExp("(^|\\s)"+H+"(?:$|\\s)\\s*")}function g(H){var w=H.getViewport(),L=H.state.foldGutter;L&&(H.operation(function(){v(H,w.from,w.to)}),L.from=w.from,L.to=w.to)}function M(H,w,L){var A=H.state.foldGutter;if(A){var B=A.options;if(L==B.gutter){var K=d(H,w);K?K.clear():H.foldCode(Z(w,0),B)}}}function b(H,w){w=="mode"&&D(H)}function D(H){var w=H.state.foldGutter;if(w){var L=w.options;w.from=w.to=0,clearTimeout(w.changeUpdate),w.changeUpdate=setTimeout(function(){g(H)},L.foldOnChangeTimeSpan||600)}}function F(H){var w=H.state.foldGutter;if(w){var L=w.options;clearTimeout(w.changeUpdate),w.changeUpdate=setTimeout(function(){var A=H.getViewport();w.from==w.to||A.from-w.to>20||w.from-A.to>20?g(H):H.operation(function(){A.from<w.from&&(v(H,A.from,w.from),w.from=A.from),A.to>w.to&&(v(H,w.to,A.to),w.to=A.to)})},L.updateViewportTimeSpan||400)}}function _(H,w){var L=H.state.foldGutter;if(L){var A=w.line;A>=L.from&&A<L.to&&v(H,A,A+1)}}})}()),Xl.exports}Du();var Zl={exports:{}},jl;function Ou(){return jl||(jl=1,function(ae,R){(function(T){T(nr())})(function(T){function Z(z){return function(c,d){var p=d.line,v=c.getLine(p);function m(_){for(var H,w=d.ch,L=0;;){var A=w<=0?-1:v.lastIndexOf(_[0],w-1);if(A==-1){if(L==1)break;L=1,w=v.length;continue}if(L==1&&A<d.ch)break;if(H=c.getTokenTypeAt(T.Pos(p,A+1)),!/^(comment|string)/.test(H))return{ch:A+1,tokenType:H,pair:_};w=A-1}}function g(_){var H=1,w=c.lastLine(),L,A=_.ch,B;e:for(var K=p;K<=w;++K)for(var Q=c.getLine(K),J=K==p?A:0;;){var $=Q.indexOf(_.pair[0],J),ce=Q.indexOf(_.pair[1],J);if($<0&&($=Q.length),ce<0&&(ce=Q.length),J=Math.min($,ce),J==Q.length)break;if(c.getTokenTypeAt(T.Pos(K,J+1))==_.tokenType){if(J==$)++H;else if(!--H){L=K,B=J;break e}}++J}return L==null||p==L?null:{from:T.Pos(p,A),to:T.Pos(L,B)}}for(var M=[],b=0;b<z.length;b++){var D=m(z[b]);D&&M.push(D)}M.sort(function(_,H){return _.ch-H.ch});for(var b=0;b<M.length;b++){var F=g(M[b]);if(F)return F}return null}}T.registerHelper("fold","brace",Z([["{","}"],["[","]"]])),T.registerHelper("fold","brace-paren",Z([["{","}"],["[","]"],["(",")"]])),T.registerHelper("fold","import",function(z,c){function d(b){if(b<z.firstLine()||b>z.lastLine())return null;var D=z.getTokenAt(T.Pos(b,1));if(/\S/.test(D.string)||(D=z.getTokenAt(T.Pos(b,D.end+1))),D.type!="keyword"||D.string!="import")return null;for(var F=b,_=Math.min(z.lastLine(),b+10);F<=_;++F){var H=z.getLine(F),w=H.indexOf(";");if(w!=-1)return{startCh:D.end,end:T.Pos(F,w)}}}var p=c.line,v=d(p),m;if(!v||d(p-1)||(m=d(p-2))&&m.end.line==p-1)return null;for(var g=v.end;;){var M=d(g.line+1);if(M==null)break;g=M.end}return{from:z.clipPos(T.Pos(p,v.startCh+1)),to:g}}),T.registerHelper("fold","include",function(z,c){function d(M){if(M<z.firstLine()||M>z.lastLine())return null;var b=z.getTokenAt(T.Pos(M,1));if(/\S/.test(b.string)||(b=z.getTokenAt(T.Pos(M,b.end+1))),b.type=="meta"&&b.string.slice(0,8)=="#include")return b.start+8}var p=c.line,v=d(p);if(v==null||d(p-1)!=null)return null;for(var m=p;;){var g=d(m+1);if(g==null)break;++m}return{from:T.Pos(p,v+1),to:z.clipPos(T.Pos(m))}})})}()),Zl.exports}Ou();var Ql={exports:{}},Jl;function Nu(){return Jl||(Jl=1,function(ae,R){(function(T){T(nr())})(function(T){var Z="CodeMirror-activeline",z="CodeMirror-activeline-background",c="CodeMirror-activeline-gutter";T.defineOption("styleActiveLine",!1,function(g,M,b){var D=b==T.Init?!1:b;M!=D&&(D&&(g.off("beforeSelectionChange",m),d(g),delete g.state.activeLines),M&&(g.state.activeLines=[],v(g,g.listSelections()),g.on("beforeSelectionChange",m)))});function d(g){for(var M=0;M<g.state.activeLines.length;M++)g.removeLineClass(g.state.activeLines[M],"wrap",Z),g.removeLineClass(g.state.activeLines[M],"background",z),g.removeLineClass(g.state.activeLines[M],"gutter",c)}function p(g,M){if(g.length!=M.length)return!1;for(var b=0;b<g.length;b++)if(g[b]!=M[b])return!1;return!0}function v(g,M){for(var b=[],D=0;D<M.length;D++){var F=M[D],_=g.getOption("styleActiveLine");if(!(typeof _=="object"&&_.nonEmpty?F.anchor.line!=F.head.line:!F.empty())){var H=g.getLineHandleVisualStart(F.head.line);b[b.length-1]!=H&&b.push(H)}}p(g.state.activeLines,b)||g.operation(function(){d(g);for(var w=0;w<b.length;w++)g.addLineClass(b[w],"wrap",Z),g.addLineClass(b[w],"background",z),g.addLineClass(b[w],"gutter",c);g.state.activeLines=b})}function m(g,M){v(g,M.ranges)}})}()),Ql.exports}Nu();var Fu=nr();const ss=is(Fu);var Vl={exports:{}},$l;function Eu(){return $l||($l=1,function(ae,R){(function(T){T(nr())})(function(T){var Z=T.Pos,z="http://www.w3.org/2000/svg";function c(h,x){this.mv=h,this.type=x,this.classes=x=="left"?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}c.prototype={constructor:c,init:function(h,x,O){this.edit=this.mv.edit,(this.edit.state.diffViews||(this.edit.state.diffViews=[])).push(this),this.orig=T(h,Ce({value:x,readOnly:!this.mv.options.allowEditingOriginals},Ce(O))),this.mv.options.connect=="align"&&(this.edit.state.trackAlignable||(this.edit.state.trackAlignable=new vt(this.edit)),this.orig.state.trackAlignable=new vt(this.orig)),this.lockButton.title=this.edit.phrase("Toggle locked scrolling"),this.lockButton.setAttribute("aria-label",this.lockButton.title),this.orig.state.diffViews=[this];var I=O.chunkClassLocation||"background";Object.prototype.toString.call(I)!="[object Array]"&&(I=[I]),this.classes.classLocation=I,this.diff=pt(ie(x),ie(O.value),this.mv.options.ignoreWhitespace),this.chunks=Qe(this.diff),this.diffOutOfDate=this.dealigned=!1,this.needsScrollSync=null,this.showDifferences=O.showDifferences!==!1},registerEvents:function(h){this.forceUpdate=v(this),b(this,!0,!1),m(this,h)},setShowDifferences:function(h){h=h!==!1,h!=this.showDifferences&&(this.showDifferences=h,this.forceUpdate("full"))}};function d(h){h.diffOutOfDate&&(h.diff=pt(h.orig.getValue(),h.edit.getValue(),h.mv.options.ignoreWhitespace),h.chunks=Qe(h.diff),h.diffOutOfDate=!1,T.signal(h.edit,"updateDiff",h.diff))}var p=!1;function v(h){var x={from:0,to:0,marked:[]},O={from:0,to:0,marked:[]},I,W=!1;function P(ve){p=!0,W=!1,ve=="full"&&(h.svg&&ke(h.svg),h.copyButtons&&ke(h.copyButtons),F(h.edit,x.marked,h.classes),F(h.orig,O.marked,h.classes),x.from=x.to=O.from=O.to=0),d(h),h.showDifferences&&(_(h.edit,h.diff,x,DIFF_INSERT,h.classes),_(h.orig,h.diff,O,DIFF_DELETE,h.classes)),h.mv.options.connect=="align"&&J(h),L(h),h.needsScrollSync!=null&&g(h,h.needsScrollSync),p=!1}function j(ve){p||(h.dealigned=!0,V(ve))}function V(ve){p||W||(clearTimeout(I),ve===!0&&(W=!0),I=setTimeout(P,ve===!0?20:250))}function ne(ve,Ae){h.diffOutOfDate||(h.diffOutOfDate=!0,x.from=x.to=O.from=O.to=0),j(Ae.text.length-1!=Ae.to.line-Ae.from.line)}function we(){h.diffOutOfDate=!0,h.dealigned=!0,P("full")}return h.edit.on("change",ne),h.orig.on("change",ne),h.edit.on("swapDoc",we),h.orig.on("swapDoc",we),h.mv.options.connect=="align"&&(T.on(h.edit.state.trackAlignable,"realign",j),T.on(h.orig.state.trackAlignable,"realign",j)),h.edit.on("viewportChange",function(){V(!1)}),h.orig.on("viewportChange",function(){V(!1)}),P(),P}function m(h,x){h.edit.on("scroll",function(){g(h,!0)&&L(h)}),h.orig.on("scroll",function(){g(h,!1)&&L(h),x&&g(x,!0)&&L(x)})}function g(h,x){if(h.diffOutOfDate)return h.lockScroll&&h.needsScrollSync==null&&(h.needsScrollSync=x),!1;if(h.needsScrollSync=null,!h.lockScroll)return!0;var O,I,W=+new Date;if(x?(O=h.edit,I=h.orig):(O=h.orig,I=h.edit),O.state.scrollSetBy==h&&(O.state.scrollSetAt||0)+250>W)return!1;var P=O.getScrollInfo();if(h.mv.options.connect=="align")Ne=P.top;else{var j=.5*P.clientHeight,V=P.top+j,ne=O.lineAtHeight(V,"local"),we=nt(h.chunks,ne,x),ve=M(O,x?we.edit:we.orig),Ae=M(I,x?we.orig:we.edit),Oe=(V-ve.top)/(ve.bot-ve.top),Ne=Ae.top-j+Oe*(Ae.bot-Ae.top),He,Ke;if(Ne>P.top&&(Ke=P.top/j)<1)Ne=Ne*Ke+P.top*(1-Ke);else if((He=P.height-P.clientHeight-P.top)<j){var Ct=I.getScrollInfo(),be=Ct.height-Ct.clientHeight-Ne;be>He&&(Ke=He/j)<1&&(Ne=Ne*Ke+(Ct.height-Ct.clientHeight-He)*(1-Ke))}}return I.scrollTo(P.left,Ne),I.state.scrollSetAt=W,I.state.scrollSetBy=h,!0}function M(h,x){var O=x.after;return O==null&&(O=h.lastLine()+1),{top:h.heightAtLine(x.before||0,"local"),bot:h.heightAtLine(O,"local")}}function b(h,x,O){h.lockScroll=x,x&&O!=!1&&g(h,DIFF_INSERT)&&L(h),(x?T.addClass:T.rmClass)(h.lockButton,"CodeMirror-merge-scrolllock-enabled")}function D(h,x,O){for(var I=O.classLocation,W=0;W<I.length;W++)h.removeLineClass(x,I[W],O.chunk),h.removeLineClass(x,I[W],O.start),h.removeLineClass(x,I[W],O.end)}function F(h,x,O){for(var I=0;I<x.length;++I){var W=x[I];W instanceof T.TextMarker?W.clear():W.parent&&D(h,W,O)}x.length=0}function _(h,x,O,I,W){var P=h.getViewport();h.operation(function(){O.from==O.to||P.from-O.to>20||O.from-P.to>20?(F(h,O.marked,W),w(h,x,I,O.marked,P.from,P.to,W),O.from=P.from,O.to=P.to):(P.from<O.from&&(w(h,x,I,O.marked,P.from,O.from,W),O.from=P.from),P.to>O.to&&(w(h,x,I,O.marked,O.to,P.to,W),O.to=P.to))})}function H(h,x,O,I,W,P){for(var j=O.classLocation,V=h.getLineHandle(x),ne=0;ne<j.length;ne++)I&&h.addLineClass(V,j[ne],O.chunk),W&&h.addLineClass(V,j[ne],O.start),P&&h.addLineClass(V,j[ne],O.end);return V}function w(h,x,O,I,W,P,j){var V=Z(0,0),ne=Z(W,0),we=h.clipPos(Z(P-1)),ve=O==DIFF_DELETE?j.del:j.insert;function Ae(We,ct){for(var tt=Math.max(W,We),Ft=Math.min(P,ct),Xe=tt;Xe<Ft;++Xe)I.push(H(h,Xe,j,!0,Xe==We,Xe==ct-1));We==ct&&tt==ct&&Ft==ct&&(tt?I.push(H(h,tt-1,j,!1,!1,!0)):I.push(H(h,tt,j,!1,!0,!1)))}for(var Oe=0,Ne=!1,He=0;He<x.length;++He){var Ke=x[He],Ct=Ke[0],be=Ke[1];if(Ct==DIFF_EQUAL){var Lr=V.line+(Ue(x,He)?0:1);Te(V,be);var me=V.line+(gt(x,He)?1:0);me>Lr&&(Ne&&(Ae(Oe,Lr),Ne=!1),Oe=me)}else if(Ne=!0,Ct==O){var zt=Te(V,be,!0),et=xt(ne,V),Pe=$e(we,zt);ht(et,Pe)||I.push(h.markText(et,Pe,{className:ve})),V=zt}}Ne&&Ae(Oe,V.line+1)}function L(h){if(h.showDifferences){if(h.svg){ke(h.svg);var x=h.gap.offsetWidth;pe(h.svg,"width",x,"height",h.gap.offsetHeight)}h.copyButtons&&ke(h.copyButtons);for(var O=h.edit.getViewport(),I=h.orig.getViewport(),W=h.mv.wrap.getBoundingClientRect().top,P=W-h.edit.getScrollerElement().getBoundingClientRect().top+h.edit.getScrollInfo().top,j=W-h.orig.getScrollerElement().getBoundingClientRect().top+h.orig.getScrollInfo().top,V=0;V<h.chunks.length;V++){var ne=h.chunks[V];ne.editFrom<=O.to&&ne.editTo>=O.from&&ne.origFrom<=I.to&&ne.origTo>=I.from&&de(h,ne,j,P,x)}}}function A(h,x){for(var O=0,I=0,W=0;W<x.length;W++){var P=x[W];if(P.editTo>h&&P.editFrom<=h)return null;if(P.editFrom>h)break;O=P.editTo,I=P.origTo}return I+(h-O)}function B(h,x,O){for(var I=h.state.trackAlignable,W=h.firstLine(),P=0,j=[],V=0;;V++){for(var ne=x[V],we=ne?O?ne.origFrom:ne.editFrom:1e9;P<I.alignable.length;P+=2){var ve=I.alignable[P]+1;if(!(ve<=W))if(ve<=we)j.push(ve);else break}if(!ne)break;j.push(W=O?ne.origTo:ne.editTo)}return j}function K(h,x,O,I){var W=0,P=0,j=0,V=0;e:for(;;W++){var ne=h[W],we=x[P];if(!ne&&we==null)break;for(var ve=ne?ne[0]:1e9,Ae=we==null?1e9:we;j<O.length;){var Oe=O[j];if(Oe.origFrom<=Ae&&Oe.origTo>Ae){P++,W--;continue e}if(Oe.editTo>ve){if(Oe.editFrom<=ve)continue e;break}V+=Oe.origTo-Oe.origFrom-(Oe.editTo-Oe.editFrom),j++}if(ve==Ae-V)ne[I]=Ae,P++;else if(ve<Ae-V)ne[I]=ve+V;else{var Ne=[Ae-V,null,null];Ne[I]=Ae,h.splice(W,0,Ne),P++}}}function Q(h,x){var O=B(h.edit,h.chunks,!1),I=[];if(x)for(var W=0,P=0;W<x.chunks.length;W++){for(var j=x.chunks[W].editTo;P<O.length&&O[P]<j;)P++;(P==O.length||O[P]!=j)&&O.splice(P++,0,j)}for(var W=0;W<O.length;W++)I.push([O[W],null,null]);return K(I,B(h.orig,h.chunks,!0),h.chunks,1),x&&K(I,B(x.orig,x.chunks,!0),x.chunks,2),I}function J(h,x){if(!(!h.dealigned&&!x)){if(!h.orig.curOp)return h.orig.operation(function(){J(h,x)});h.dealigned=!1;var O=h.mv.left==h?h.mv.right:h.mv.left;O&&(d(O),O.dealigned=!1);for(var I=Q(h,O),W=h.mv.aligners,P=0;P<W.length;P++)W[P].clear();W.length=0;var j=[h.edit,h.orig],V=[],ne=[];O&&j.push(O.orig);for(var P=0;P<j.length;P++)V.push(j[P].getScrollInfo().top),ne.push(-j[P].getScrollerElement().getBoundingClientRect().top);(ne[0]!=ne[1]||j.length==3&&ne[1]!=ne[2])&&$(j,ne,[0,0,0],W);for(var we=0;we<I.length;we++)$(j,ne,I[we],W);for(var P=0;P<j.length;P++)j[P].scrollTo(null,V[P])}}function $(h,x,O,I){for(var W=-1e8,P=[],j=0;j<h.length;j++)if(O[j]!=null){var V=h[j].heightAtLine(O[j],"local")-x[j];P[j]=V,W=Math.max(W,V)}for(var j=0;j<h.length;j++)if(O[j]!=null){var ne=W-P[j];ne>1&&I.push(ce(h[j],O[j],ne))}}function ce(h,x,O){var I=!0;x>h.lastLine()&&(x--,I=!1);var W=document.createElement("div");return W.className="CodeMirror-merge-spacer",W.style.height=O+"px",W.style.minWidth="1px",h.addLineWidget(x,W,{height:O,above:I,mergeSpacer:!0,handleMouseEvents:!0})}function de(h,x,O,I,W){var P=h.type=="left",j=h.orig.heightAtLine(x.origFrom,"local",!0)-O;if(h.svg){var V=j,ne=h.edit.heightAtLine(x.editFrom,"local",!0)-I;if(P){var we=V;V=ne,ne=we}var ve=h.orig.heightAtLine(x.origTo,"local",!0)-O,Ae=h.edit.heightAtLine(x.editTo,"local",!0)-I;if(P){var we=ve;ve=Ae,Ae=we}var Oe=" C "+W/2+" "+ne+" "+W/2+" "+V+" "+(W+2)+" "+V,Ne=" C "+W/2+" "+ve+" "+W/2+" "+Ae+" -1 "+Ae;pe(h.svg.appendChild(document.createElementNS(z,"path")),"d","M -1 "+ne+Oe+" L "+(W+2)+" "+ve+Ne+" z","class",h.classes.connect)}if(h.copyButtons){var He=h.copyButtons.appendChild(De("div",h.type=="left"?"⇝":"⇜","CodeMirror-merge-copy")),Ke=h.mv.options.allowEditingOriginals;if(He.title=h.edit.phrase(Ke?"Push to left":"Revert chunk"),He.chunk=x,He.style.top=(x.origTo>x.origFrom?j:h.edit.heightAtLine(x.editFrom,"local")-I)+"px",He.setAttribute("role","button"),He.setAttribute("tabindex","0"),He.setAttribute("aria-label",He.title),Ke){var Ct=h.edit.heightAtLine(x.editFrom,"local")-I,be=h.copyButtons.appendChild(De("div",h.type=="right"?"⇝":"⇜","CodeMirror-merge-copy-reverse"));be.title="Push to right",be.chunk={editFrom:x.origFrom,editTo:x.origTo,origFrom:x.editFrom,origTo:x.editTo},be.style.top=Ct+"px",h.type=="right"?be.style.left="2px":be.style.right="2px",be.setAttribute("role","button"),be.setAttribute("tabindex","0"),be.setAttribute("aria-label",be.title)}}}function re(h,x,O,I){if(!h.diffOutOfDate){var W=I.origTo>O.lastLine()?Z(I.origFrom-1):Z(I.origFrom,0),P=Z(I.origTo,0),j=I.editTo>x.lastLine()?Z(I.editFrom-1):Z(I.editFrom,0),V=Z(I.editTo,0),ne=h.mv.options.revertChunk;ne?ne(h.mv,O,W,P,x,j,V):x.replaceRange(O.getRange(W,P),j,V)}}var oe=T.MergeView=function(h,x){if(!(this instanceof oe))return new oe(h,x);this.options=x;var O=x.origLeft,I=x.origRight==null?x.orig:x.origRight,W=O!=null,P=I!=null,j=1+(W?1:0)+(P?1:0),V=[],ne=this.left=null,we=this.right=null,ve=this;if(W){ne=this.left=new c(this,"left");var Ae=De("div",null,"CodeMirror-merge-pane CodeMirror-merge-left");V.push(Ae),V.push(U(ne))}var Oe=De("div",null,"CodeMirror-merge-pane CodeMirror-merge-editor");if(V.push(Oe),P){we=this.right=new c(this,"right"),V.push(U(we));var Ne=De("div",null,"CodeMirror-merge-pane CodeMirror-merge-right");V.push(Ne)}(P?Ne:Oe).className+=" CodeMirror-merge-pane-rightmost",V.push(De("div",null,null,"height: 0; clear: both;"));var He=this.wrap=h.appendChild(De("div",V,"CodeMirror-merge CodeMirror-merge-"+j+"pane"));this.edit=T(Oe,Ce(x)),ne&&ne.init(Ae,O,x),we&&we.init(Ne,I,x),x.collapseIdentical&&this.editor().operation(function(){bt(ve,x.collapseIdentical)}),x.connect=="align"&&(this.aligners=[],J(this.left||this.right,!0)),ne&&ne.registerEvents(we),we&&we.registerEvents(ne);var Ke=function(){ne&&L(ne),we&&L(we)};T.on(window,"resize",Ke);var Ct=setInterval(function(){for(var be=He.parentNode;be&&be!=document.body;be=be.parentNode);be||(clearInterval(Ct),T.off(window,"resize",Ke))},5e3)};function U(h){var x=h.lockButton=De("div",null,"CodeMirror-merge-scrolllock");x.setAttribute("role","button"),x.setAttribute("tabindex","0");var O=De("div",[x],"CodeMirror-merge-scrolllock-wrap");T.on(x,"click",function(){b(h,!h.lockScroll)}),T.on(x,"keyup",function(j){(j.key==="Enter"||j.code==="Space")&&b(h,!h.lockScroll)});var I=[O];if(h.mv.options.revertButtons!==!1){h.copyButtons=De("div",null,"CodeMirror-merge-copybuttons-"+h.type);var W=function(j){var V=j.target||j.srcElement;if(V.chunk){if(V.className=="CodeMirror-merge-copy-reverse"){re(h,h.orig,h.edit,V.chunk);return}re(h,h.edit,h.orig,V.chunk)}};T.on(h.copyButtons,"click",W),T.on(h.copyButtons,"keyup",function(j){(j.key==="Enter"||j.code==="Space")&&W(j)}),I.unshift(h.copyButtons)}if(h.mv.options.connect!="align"){var P=document.createElementNS&&document.createElementNS(z,"svg");P&&!P.createSVGRect&&(P=null),h.svg=P,P&&I.push(P)}return h.gap=De("div",I,"CodeMirror-merge-gap")}oe.prototype={constructor:oe,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(h){this.right&&this.right.setShowDifferences(h),this.left&&this.left.setShowDifferences(h)},rightChunks:function(){if(this.right)return d(this.right),this.right.chunks},leftChunks:function(){if(this.left)return d(this.left),this.left.chunks}};function ie(h){return typeof h=="string"?h:h.getValue()}var C;function pt(h,x,O){C||(C=new diff_match_patch);for(var I=C.diff_main(h,x),W=0;W<I.length;++W){var P=I[W];(O?!/[^ \t]/.test(P[1]):!P[1])?I.splice(W--,1):W&&I[W-1][0]==P[0]&&(I.splice(W--,1),I[W][1]+=P[1])}return I}function Qe(h){var x=[];if(!h.length)return x;for(var O=0,I=0,W=Z(0,0),P=Z(0,0),j=0;j<h.length;++j){var V=h[j],ne=V[0];if(ne==DIFF_EQUAL){var we=!Ue(h,j)||W.line<O||P.line<I?1:0,ve=W.line+we,Ae=P.line+we;Te(W,V[1],null,P);var Oe=gt(h,j)?1:0,Ne=W.line+Oe,He=P.line+Oe;Ne>ve&&(j&&x.push({origFrom:I,origTo:Ae,editFrom:O,editTo:ve}),O=Ne,I=He)}else Te(ne==DIFF_INSERT?W:P,V[1])}return(O<=W.line||I<=P.line)&&x.push({origFrom:I,origTo:P.line+1,editFrom:O,editTo:W.line+1}),x}function gt(h,x){if(x==h.length-1)return!0;var O=h[x+1][1];return O.length==1&&x<h.length-2||O.charCodeAt(0)!=10?!1:x==h.length-2?!0:(O=h[x+2][1],(O.length>1||x==h.length-3)&&O.charCodeAt(0)==10)}function Ue(h,x){if(x==0)return!0;var O=h[x-1][1];return O.charCodeAt(O.length-1)!=10?!1:x==1?!0:(O=h[x-2][1],O.charCodeAt(O.length-1)==10)}function nt(h,x,O){for(var I,W,P,j,V=0;V<h.length;V++){var ne=h[V],we=O?ne.editFrom:ne.origFrom,ve=O?ne.editTo:ne.origTo;W==null&&(we>x?(W=ne.editFrom,j=ne.origFrom):ve>x&&(W=ne.editTo,j=ne.origTo)),ve<=x?(I=ne.editTo,P=ne.origTo):we<=x&&(I=ne.editFrom,P=ne.origFrom)}return{edit:{before:I,after:W},orig:{before:P,after:j}}}function It(h,x,O){h.addLineClass(x,"wrap","CodeMirror-merge-collapsed-line");var I=document.createElement("span");I.className="CodeMirror-merge-collapsed-widget",I.title=h.phrase("Identical text collapsed. Click to expand.");var W=h.markText(Z(x,0),Z(O-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:I,clearOnEnter:!0});function P(){W.clear(),h.removeLineClass(x,"wrap","CodeMirror-merge-collapsed-line")}return W.explicitlyCleared&&P(),T.on(I,"click",P),W.on("clear",P),T.on(I,"click",P),{mark:W,clear:P}}function Wt(h,x){var O=[];function I(){for(var V=0;V<O.length;V++)O[V].clear()}for(var W=0;W<x.length;W++){var P=x[W],j=It(P.cm,P.line,P.line+h);O.push(j),j.mark.on("clear",I)}return O[0].mark}function it(h,x,O,I){for(var W=0;W<h.chunks.length;W++)for(var P=h.chunks[W],j=P.editFrom-x;j<P.editTo+x;j++){var V=j+O;V>=0&&V<I.length&&(I[V]=!1)}}function bt(h,x){typeof x!="number"&&(x=2);for(var O=[],I=h.editor(),W=I.firstLine(),P=W,j=I.lastLine();P<=j;P++)O.push(!0);h.left&&it(h.left,x,W,O),h.right&&it(h.right,x,W,O);for(var V=0;V<O.length;V++)if(O[V]){for(var ne=V+W,we=1;V<O.length-1&&O[V+1];V++,we++);if(we>x){var ve=[{line:ne,cm:I}];h.left&&ve.push({line:A(ne,h.left.chunks),cm:h.left.orig}),h.right&&ve.push({line:A(ne,h.right.chunks),cm:h.right.orig});var Ae=Wt(we,ve);h.options.onCollapse&&h.options.onCollapse(h,ne,we,Ae)}}}function De(h,x,O,I){var W=document.createElement(h);if(O&&(W.className=O),I&&(W.style.cssText=I),typeof x=="string")W.appendChild(document.createTextNode(x));else if(x)for(var P=0;P<x.length;++P)W.appendChild(x[P]);return W}function ke(h){for(var x=h.childNodes.length;x>0;--x)h.removeChild(h.firstChild)}function pe(h){for(var x=1;x<arguments.length;x+=2)h.setAttribute(arguments[x],arguments[x+1])}function Ce(h,x){x||(x={});for(var O in h)h.hasOwnProperty(O)&&(x[O]=h[O]);return x}function Te(h,x,O,I){for(var W=O?Z(h.line,h.ch):h,P=0;;){var j=x.indexOf(`
`,P);if(j==-1)break;++W.line,I&&++I.line,P=j+1}return W.ch=(P?0:W.ch)+(x.length-P),I&&(I.ch=(P?0:I.ch)+(x.length-P)),W}var kt=1,xe=2,Re=4;function vt(h){this.cm=h,this.alignable=[],this.height=h.doc.height;var x=this;h.on("markerAdded",function(O,I){if(I.collapsed){var W=I.find(1);W!=null&&x.set(W.line,Re)}}),h.on("markerCleared",function(O,I,W,P){P!=null&&I.collapsed&&x.check(P,Re,x.hasMarker)}),h.on("markerChanged",this.signal.bind(this)),h.on("lineWidgetAdded",function(O,I,W){I.mergeSpacer||(I.above?x.set(W-1,xe):x.set(W,kt))}),h.on("lineWidgetCleared",function(O,I,W){I.mergeSpacer||(I.above?x.check(W-1,xe,x.hasWidgetBelow):x.check(W,kt,x.hasWidget))}),h.on("lineWidgetChanged",this.signal.bind(this)),h.on("change",function(O,I){var W=I.from.line,P=I.to.line-I.from.line,j=I.text.length-1,V=W+j;(P||j)&&x.map(W,P,j),x.check(V,Re,x.hasMarker),(P||j)&&x.check(I.from.line,Re,x.hasMarker)}),h.on("viewportChange",function(){x.cm.doc.height!=x.height&&x.signal()})}vt.prototype={signal:function(){T.signal(this,"realign"),this.height=this.cm.doc.height},set:function(h,x){for(var O=-1;O<this.alignable.length;O+=2){var I=this.alignable[O]-h;if(I==0){if((this.alignable[O+1]&x)==x)return;this.alignable[O+1]|=x,this.signal();return}if(I>0)break}this.signal(),this.alignable.splice(O,0,h,x)},find:function(h){for(var x=0;x<this.alignable.length;x+=2)if(this.alignable[x]==h)return x;return-1},check:function(h,x,O){var I=this.find(h);if(!(I==-1||!(this.alignable[I+1]&x))&&!O.call(this,h)){this.signal();var W=this.alignable[I+1]&~x;W?this.alignable[I+1]=W:this.alignable.splice(I,2)}},hasMarker:function(h){var x=this.cm.getLineHandle(h);if(x.markedSpans){for(var O=0;O<x.markedSpans.length;O++)if(x.markedSpans[O].marker.collapsed&&x.markedSpans[O].to!=null)return!0}return!1},hasWidget:function(h){var x=this.cm.getLineHandle(h);if(x.widgets){for(var O=0;O<x.widgets.length;O++)if(!x.widgets[O].above&&!x.widgets[O].mergeSpacer)return!0}return!1},hasWidgetBelow:function(h){if(h==this.cm.lastLine())return!1;var x=this.cm.getLineHandle(h+1);if(x.widgets){for(var O=0;O<x.widgets.length;O++)if(x.widgets[O].above&&!x.widgets[O].mergeSpacer)return!0}return!1},map:function(h,x,O){for(var I=O-x,W=h+x,P=-1,j=-1,V=0;V<this.alignable.length;V+=2){var ne=this.alignable[V];ne==h&&this.alignable[V+1]&xe&&(P=V),ne==W&&this.alignable[V+1]&xe&&(j=V),!(ne<=h)&&(ne<W?this.alignable.splice(V--,2):this.alignable[V]+=I)}if(P>-1){var we=this.alignable[P+1];we==xe?this.alignable.splice(P,2):this.alignable[P+1]=we&-3}j>-1&&O&&this.set(h+O,xe)}};function $e(h,x){return(h.line-x.line||h.ch-x.ch)<0?h:x}function xt(h,x){return(h.line-x.line||h.ch-x.ch)>0?h:x}function ht(h,x){return h.line==x.line&&h.ch==x.ch}function Be(h,x,O){for(var I=h.length-1;I>=0;I--){var W=h[I],P=(O?W.origTo:W.editTo)-1;if(P<x)return P}}function Ge(h,x,O){for(var I=0;I<h.length;I++){var W=h[I],P=O?W.origFrom:W.editFrom;if(P>x)return P}}function Gt(h,x){var O=null,I=h.state.diffViews,W=h.getCursor().line;if(I)for(var P=0;P<I.length;P++){var j=I[P],V=h==j.orig;d(j);var ne=x<0?Be(j.chunks,W,V):Ge(j.chunks,W,V);ne!=null&&(O==null||(x<0?ne>O:ne<O))&&(O=ne)}if(O!=null)h.setCursor(O,0);else return T.Pass}T.commands.goNextDiff=function(h){return Gt(h,1)},T.commands.goPrevDiff=function(h){return Gt(h,-1)}})}()),Vl.exports}Eu();var Mo={exports:{}},es;function Hu(){return es||(es=1,function(ae){var R=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},T=-1,Z=1,z=0;R.Diff=function(c,d){return[c,d]},R.prototype.diff_main=function(c,d,p,v){typeof v=="undefined"&&(this.Diff_Timeout<=0?v=Number.MAX_VALUE:v=new Date().getTime()+this.Diff_Timeout*1e3);var m=v;if(c==null||d==null)throw new Error("Null input. (diff_main)");if(c==d)return c?[new R.Diff(z,c)]:[];typeof p=="undefined"&&(p=!0);var g=p,M=this.diff_commonPrefix(c,d),b=c.substring(0,M);c=c.substring(M),d=d.substring(M),M=this.diff_commonSuffix(c,d);var D=c.substring(c.length-M);c=c.substring(0,c.length-M),d=d.substring(0,d.length-M);var F=this.diff_compute_(c,d,g,m);return b&&F.unshift(new R.Diff(z,b)),D&&F.push(new R.Diff(z,D)),this.diff_cleanupMerge(F),F},R.prototype.diff_compute_=function(c,d,p,v){var m;if(!c)return[new R.Diff(Z,d)];if(!d)return[new R.Diff(T,c)];var g=c.length>d.length?c:d,M=c.length>d.length?d:c,b=g.indexOf(M);if(b!=-1)return m=[new R.Diff(Z,g.substring(0,b)),new R.Diff(z,M),new R.Diff(Z,g.substring(b+M.length))],c.length>d.length&&(m[0][0]=m[2][0]=T),m;if(M.length==1)return[new R.Diff(T,c),new R.Diff(Z,d)];var D=this.diff_halfMatch_(c,d);if(D){var F=D[0],_=D[1],H=D[2],w=D[3],L=D[4],A=this.diff_main(F,H,p,v),B=this.diff_main(_,w,p,v);return A.concat([new R.Diff(z,L)],B)}return p&&c.length>100&&d.length>100?this.diff_lineMode_(c,d,v):this.diff_bisect_(c,d,v)},R.prototype.diff_lineMode_=function(c,d,p){var v=this.diff_linesToChars_(c,d);c=v.chars1,d=v.chars2;var m=v.lineArray,g=this.diff_main(c,d,!1,p);this.diff_charsToLines_(g,m),this.diff_cleanupSemantic(g),g.push(new R.Diff(z,""));for(var M=0,b=0,D=0,F="",_="";M<g.length;){switch(g[M][0]){case Z:D++,_+=g[M][1];break;case T:b++,F+=g[M][1];break;case z:if(b>=1&&D>=1){g.splice(M-b-D,b+D),M=M-b-D;for(var H=this.diff_main(F,_,!1,p),w=H.length-1;w>=0;w--)g.splice(M,0,H[w]);M=M+H.length}D=0,b=0,F="",_="";break}M++}return g.pop(),g},R.prototype.diff_bisect_=function(c,d,p){for(var v=c.length,m=d.length,g=Math.ceil((v+m)/2),M=g,b=2*g,D=new Array(b),F=new Array(b),_=0;_<b;_++)D[_]=-1,F[_]=-1;D[M+1]=0,F[M+1]=0;for(var H=v-m,w=H%2!=0,L=0,A=0,B=0,K=0,Q=0;Q<g&&!(new Date().getTime()>p);Q++){for(var J=-Q+L;J<=Q-A;J+=2){var $=M+J,ce;J==-Q||J!=Q&&D[$-1]<D[$+1]?ce=D[$+1]:ce=D[$-1]+1;for(var de=ce-J;ce<v&&de<m&&c.charAt(ce)==d.charAt(de);)ce++,de++;if(D[$]=ce,ce>v)A+=2;else if(de>m)L+=2;else if(w){var re=M+H-J;if(re>=0&&re<b&&F[re]!=-1){var oe=v-F[re];if(ce>=oe)return this.diff_bisectSplit_(c,d,ce,de,p)}}}for(var U=-Q+B;U<=Q-K;U+=2){var re=M+U,oe;U==-Q||U!=Q&&F[re-1]<F[re+1]?oe=F[re+1]:oe=F[re-1]+1;for(var ie=oe-U;oe<v&&ie<m&&c.charAt(v-oe-1)==d.charAt(m-ie-1);)oe++,ie++;if(F[re]=oe,oe>v)K+=2;else if(ie>m)B+=2;else if(!w){var $=M+H-U;if($>=0&&$<b&&D[$]!=-1){var ce=D[$],de=M+ce-$;if(oe=v-oe,ce>=oe)return this.diff_bisectSplit_(c,d,ce,de,p)}}}}return[new R.Diff(T,c),new R.Diff(Z,d)]},R.prototype.diff_bisectSplit_=function(c,d,p,v,m){var g=c.substring(0,p),M=d.substring(0,v),b=c.substring(p),D=d.substring(v),F=this.diff_main(g,M,!1,m),_=this.diff_main(b,D,!1,m);return F.concat(_)},R.prototype.diff_linesToChars_=function(c,d){var p=[],v={};p[0]="";function m(D){for(var F="",_=0,H=-1,w=p.length;H<D.length-1;){H=D.indexOf(`
`,_),H==-1&&(H=D.length-1);var L=D.substring(_,H+1);(v.hasOwnProperty?v.hasOwnProperty(L):v[L]!==void 0)?F+=String.fromCharCode(v[L]):(w==g&&(L=D.substring(_),H=D.length),F+=String.fromCharCode(w),v[L]=w,p[w++]=L),_=H+1}return F}var g=4e4,M=m(c);g=65535;var b=m(d);return{chars1:M,chars2:b,lineArray:p}},R.prototype.diff_charsToLines_=function(c,d){for(var p=0;p<c.length;p++){for(var v=c[p][1],m=[],g=0;g<v.length;g++)m[g]=d[v.charCodeAt(g)];c[p][1]=m.join("")}},R.prototype.diff_commonPrefix=function(c,d){if(!c||!d||c.charAt(0)!=d.charAt(0))return 0;for(var p=0,v=Math.min(c.length,d.length),m=v,g=0;p<m;)c.substring(g,m)==d.substring(g,m)?(p=m,g=p):v=m,m=Math.floor((v-p)/2+p);return m},R.prototype.diff_commonSuffix=function(c,d){if(!c||!d||c.charAt(c.length-1)!=d.charAt(d.length-1))return 0;for(var p=0,v=Math.min(c.length,d.length),m=v,g=0;p<m;)c.substring(c.length-m,c.length-g)==d.substring(d.length-m,d.length-g)?(p=m,g=p):v=m,m=Math.floor((v-p)/2+p);return m},R.prototype.diff_commonOverlap_=function(c,d){var p=c.length,v=d.length;if(p==0||v==0)return 0;p>v?c=c.substring(p-v):p<v&&(d=d.substring(0,p));var m=Math.min(p,v);if(c==d)return m;for(var g=0,M=1;;){var b=c.substring(m-M),D=d.indexOf(b);if(D==-1)return g;M+=D,(D==0||c.substring(m-M)==d.substring(0,M))&&(g=M,M++)}},R.prototype.diff_halfMatch_=function(c,d){if(this.Diff_Timeout<=0)return null;var p=c.length>d.length?c:d,v=c.length>d.length?d:c;if(p.length<4||v.length*2<p.length)return null;var m=this;function g(A,B,K){for(var Q=A.substring(K,K+Math.floor(A.length/4)),J=-1,$="",ce,de,re,oe;(J=B.indexOf(Q,J+1))!=-1;){var U=m.diff_commonPrefix(A.substring(K),B.substring(J)),ie=m.diff_commonSuffix(A.substring(0,K),B.substring(0,J));$.length<ie+U&&($=B.substring(J-ie,J)+B.substring(J,J+U),ce=A.substring(0,K-ie),de=A.substring(K+U),re=B.substring(0,J-ie),oe=B.substring(J+U))}return $.length*2>=A.length?[ce,de,re,oe,$]:null}var M=g(p,v,Math.ceil(p.length/4)),b=g(p,v,Math.ceil(p.length/2)),D;if(!M&&!b)return null;b?M?D=M[4].length>b[4].length?M:b:D=b:D=M;var F,_,H,w;c.length>d.length?(F=D[0],_=D[1],H=D[2],w=D[3]):(H=D[0],w=D[1],F=D[2],_=D[3]);var L=D[4];return[F,_,H,w,L]},R.prototype.diff_cleanupSemantic=function(c){for(var d=!1,p=[],v=0,m=null,g=0,M=0,b=0,D=0,F=0;g<c.length;)c[g][0]==z?(p[v++]=g,M=D,b=F,D=0,F=0,m=c[g][1]):(c[g][0]==Z?D+=c[g][1].length:F+=c[g][1].length,m&&m.length<=Math.max(M,b)&&m.length<=Math.max(D,F)&&(c.splice(p[v-1],0,new R.Diff(T,m)),c[p[v-1]+1][0]=Z,v--,v--,g=v>0?p[v-1]:-1,M=0,b=0,D=0,F=0,m=null,d=!0)),g++;for(d&&this.diff_cleanupMerge(c),this.diff_cleanupSemanticLossless(c),g=1;g<c.length;){if(c[g-1][0]==T&&c[g][0]==Z){var _=c[g-1][1],H=c[g][1],w=this.diff_commonOverlap_(_,H),L=this.diff_commonOverlap_(H,_);w>=L?(w>=_.length/2||w>=H.length/2)&&(c.splice(g,0,new R.Diff(z,H.substring(0,w))),c[g-1][1]=_.substring(0,_.length-w),c[g+1][1]=H.substring(w),g++):(L>=_.length/2||L>=H.length/2)&&(c.splice(g,0,new R.Diff(z,_.substring(0,L))),c[g-1][0]=Z,c[g-1][1]=H.substring(0,H.length-L),c[g+1][0]=T,c[g+1][1]=_.substring(L),g++),g++}g++}},R.prototype.diff_cleanupSemanticLossless=function(c){function d(L,A){if(!L||!A)return 6;var B=L.charAt(L.length-1),K=A.charAt(0),Q=B.match(R.nonAlphaNumericRegex_),J=K.match(R.nonAlphaNumericRegex_),$=Q&&B.match(R.whitespaceRegex_),ce=J&&K.match(R.whitespaceRegex_),de=$&&B.match(R.linebreakRegex_),re=ce&&K.match(R.linebreakRegex_),oe=de&&L.match(R.blanklineEndRegex_),U=re&&A.match(R.blanklineStartRegex_);return oe||U?5:de||re?4:Q&&!$&&ce?3:$||ce?2:Q||J?1:0}for(var p=1;p<c.length-1;){if(c[p-1][0]==z&&c[p+1][0]==z){var v=c[p-1][1],m=c[p][1],g=c[p+1][1],M=this.diff_commonSuffix(v,m);if(M){var b=m.substring(m.length-M);v=v.substring(0,v.length-M),m=b+m.substring(0,m.length-M),g=b+g}for(var D=v,F=m,_=g,H=d(v,m)+d(m,g);m.charAt(0)===g.charAt(0);){v+=m.charAt(0),m=m.substring(1)+g.charAt(0),g=g.substring(1);var w=d(v,m)+d(m,g);w>=H&&(H=w,D=v,F=m,_=g)}c[p-1][1]!=D&&(D?c[p-1][1]=D:(c.splice(p-1,1),p--),c[p][1]=F,_?c[p+1][1]=_:(c.splice(p+1,1),p--))}p++}},R.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,R.whitespaceRegex_=/\s/,R.linebreakRegex_=/[\r\n]/,R.blanklineEndRegex_=/\n\r?\n$/,R.blanklineStartRegex_=/^\r?\n\r?\n/,R.prototype.diff_cleanupEfficiency=function(c){for(var d=!1,p=[],v=0,m=null,g=0,M=!1,b=!1,D=!1,F=!1;g<c.length;)c[g][0]==z?(c[g][1].length<this.Diff_EditCost&&(D||F)?(p[v++]=g,M=D,b=F,m=c[g][1]):(v=0,m=null),D=F=!1):(c[g][0]==T?F=!0:D=!0,m&&(M&&b&&D&&F||m.length<this.Diff_EditCost/2&&M+b+D+F==3)&&(c.splice(p[v-1],0,new R.Diff(T,m)),c[p[v-1]+1][0]=Z,v--,m=null,M&&b?(D=F=!0,v=0):(v--,g=v>0?p[v-1]:-1,D=F=!1),d=!0)),g++;d&&this.diff_cleanupMerge(c)},R.prototype.diff_cleanupMerge=function(c){c.push(new R.Diff(z,""));for(var d=0,p=0,v=0,m="",g="",M;d<c.length;)switch(c[d][0]){case Z:v++,g+=c[d][1],d++;break;case T:p++,m+=c[d][1],d++;break;case z:p+v>1?(p!==0&&v!==0&&(M=this.diff_commonPrefix(g,m),M!==0&&(d-p-v>0&&c[d-p-v-1][0]==z?c[d-p-v-1][1]+=g.substring(0,M):(c.splice(0,0,new R.Diff(z,g.substring(0,M))),d++),g=g.substring(M),m=m.substring(M)),M=this.diff_commonSuffix(g,m),M!==0&&(c[d][1]=g.substring(g.length-M)+c[d][1],g=g.substring(0,g.length-M),m=m.substring(0,m.length-M))),d-=p+v,c.splice(d,p+v),m.length&&(c.splice(d,0,new R.Diff(T,m)),d++),g.length&&(c.splice(d,0,new R.Diff(Z,g)),d++),d++):d!==0&&c[d-1][0]==z?(c[d-1][1]+=c[d][1],c.splice(d,1)):d++,v=0,p=0,m="",g="";break}c[c.length-1][1]===""&&c.pop();var b=!1;for(d=1;d<c.length-1;)c[d-1][0]==z&&c[d+1][0]==z&&(c[d][1].substring(c[d][1].length-c[d-1][1].length)==c[d-1][1]?(c[d][1]=c[d-1][1]+c[d][1].substring(0,c[d][1].length-c[d-1][1].length),c[d+1][1]=c[d-1][1]+c[d+1][1],c.splice(d-1,1),b=!0):c[d][1].substring(0,c[d+1][1].length)==c[d+1][1]&&(c[d-1][1]+=c[d+1][1],c[d][1]=c[d][1].substring(c[d+1][1].length)+c[d+1][1],c.splice(d+1,1),b=!0)),d++;b&&this.diff_cleanupMerge(c)},R.prototype.diff_xIndex=function(c,d){var p=0,v=0,m=0,g=0,M;for(M=0;M<c.length&&(c[M][0]!==Z&&(p+=c[M][1].length),c[M][0]!==T&&(v+=c[M][1].length),!(p>d));M++)m=p,g=v;return c.length!=M&&c[M][0]===T?g:g+(d-m)},R.prototype.diff_prettyHtml=function(c){for(var d=[],p=/&/g,v=/</g,m=/>/g,g=/\n/g,M=0;M<c.length;M++){var b=c[M][0],D=c[M][1],F=D.replace(p,"&amp;").replace(v,"&lt;").replace(m,"&gt;").replace(g,"&para;<br>");switch(b){case Z:d[M]='<ins style="background:#e6ffe6;">'+F+"</ins>";break;case T:d[M]='<del style="background:#ffe6e6;">'+F+"</del>";break;case z:d[M]="<span>"+F+"</span>";break}}return d.join("")},R.prototype.diff_text1=function(c){for(var d=[],p=0;p<c.length;p++)c[p][0]!==Z&&(d[p]=c[p][1]);return d.join("")},R.prototype.diff_text2=function(c){for(var d=[],p=0;p<c.length;p++)c[p][0]!==T&&(d[p]=c[p][1]);return d.join("")},R.prototype.diff_levenshtein=function(c){for(var d=0,p=0,v=0,m=0;m<c.length;m++){var g=c[m][0],M=c[m][1];switch(g){case Z:p+=M.length;break;case T:v+=M.length;break;case z:d+=Math.max(p,v),p=0,v=0;break}}return d+=Math.max(p,v),d},R.prototype.diff_toDelta=function(c){for(var d=[],p=0;p<c.length;p++)switch(c[p][0]){case Z:d[p]="+"+encodeURI(c[p][1]);break;case T:d[p]="-"+c[p][1].length;break;case z:d[p]="="+c[p][1].length;break}return d.join(" ").replace(/%20/g," ")},R.prototype.diff_fromDelta=function(c,d){for(var p=[],v=0,m=0,g=d.split(/\t/g),M=0;M<g.length;M++){var b=g[M].substring(1);switch(g[M].charAt(0)){case"+":try{p[v++]=new R.Diff(Z,decodeURI(b))}catch(_){throw new Error("Illegal escape in diff_fromDelta: "+b)}break;case"-":case"=":var D=parseInt(b,10);if(isNaN(D)||D<0)throw new Error("Invalid number in diff_fromDelta: "+b);var F=c.substring(m,m+=D);g[M].charAt(0)=="="?p[v++]=new R.Diff(z,F):p[v++]=new R.Diff(T,F);break;default:if(g[M])throw new Error("Invalid diff operation in diff_fromDelta: "+g[M])}}if(m!=c.length)throw new Error("Delta length ("+m+") does not equal source text length ("+c.length+").");return p},R.prototype.match_main=function(c,d,p){if(c==null||d==null||p==null)throw new Error("Null input. (match_main)");return p=Math.max(0,Math.min(p,c.length)),c==d?0:c.length?c.substring(p,p+d.length)==d?p:this.match_bitap_(c,d,p):-1},R.prototype.match_bitap_=function(c,d,p){if(d.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var v=this.match_alphabet_(d),m=this;function g(ce,de){var re=ce/d.length,oe=Math.abs(p-de);return m.Match_Distance?re+oe/m.Match_Distance:oe?1:re}var M=this.Match_Threshold,b=c.indexOf(d,p);b!=-1&&(M=Math.min(g(0,b),M),b=c.lastIndexOf(d,p+d.length),b!=-1&&(M=Math.min(g(0,b),M)));var D=1<<d.length-1;b=-1;for(var F,_,H=d.length+c.length,w,L=0;L<d.length;L++){for(F=0,_=H;F<_;)g(L,p+_)<=M?F=_:H=_,_=Math.floor((H-F)/2+F);H=_;var A=Math.max(1,p-_+1),B=Math.min(p+_,c.length)+d.length,K=Array(B+2);K[B+1]=(1<<L)-1;for(var Q=B;Q>=A;Q--){var J=v[c.charAt(Q-1)];if(L===0?K[Q]=(K[Q+1]<<1|1)&J:K[Q]=(K[Q+1]<<1|1)&J|((w[Q+1]|w[Q])<<1|1)|w[Q+1],K[Q]&D){var $=g(L,Q-1);if($<=M)if(M=$,b=Q-1,b>p)A=Math.max(1,2*p-b);else break}}if(g(L+1,p)>M)break;w=K}return b},R.prototype.match_alphabet_=function(c){for(var d={},p=0;p<c.length;p++)d[c.charAt(p)]=0;for(var p=0;p<c.length;p++)d[c.charAt(p)]|=1<<c.length-p-1;return d},R.prototype.patch_addContext_=function(c,d){if(d.length!=0){if(c.start2===null)throw Error("patch not initialized");for(var p=d.substring(c.start2,c.start2+c.length1),v=0;d.indexOf(p)!=d.lastIndexOf(p)&&p.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)v+=this.Patch_Margin,p=d.substring(c.start2-v,c.start2+c.length1+v);v+=this.Patch_Margin;var m=d.substring(c.start2-v,c.start2);m&&c.diffs.unshift(new R.Diff(z,m));var g=d.substring(c.start2+c.length1,c.start2+c.length1+v);g&&c.diffs.push(new R.Diff(z,g)),c.start1-=m.length,c.start2-=m.length,c.length1+=m.length+g.length,c.length2+=m.length+g.length}},R.prototype.patch_make=function(c,d,p){var v,m;if(typeof c=="string"&&typeof d=="string"&&typeof p=="undefined")v=c,m=this.diff_main(v,d,!0),m.length>2&&(this.diff_cleanupSemantic(m),this.diff_cleanupEfficiency(m));else if(c&&typeof c=="object"&&typeof d=="undefined"&&typeof p=="undefined")m=c,v=this.diff_text1(m);else if(typeof c=="string"&&d&&typeof d=="object"&&typeof p=="undefined")v=c,m=d;else if(typeof c=="string"&&typeof d=="string"&&p&&typeof p=="object")v=c,m=p;else throw new Error("Unknown call format to patch_make.");if(m.length===0)return[];for(var g=[],M=new R.patch_obj,b=0,D=0,F=0,_=v,H=v,w=0;w<m.length;w++){var L=m[w][0],A=m[w][1];switch(!b&&L!==z&&(M.start1=D,M.start2=F),L){case Z:M.diffs[b++]=m[w],M.length2+=A.length,H=H.substring(0,F)+A+H.substring(F);break;case T:M.length1+=A.length,M.diffs[b++]=m[w],H=H.substring(0,F)+H.substring(F+A.length);break;case z:A.length<=2*this.Patch_Margin&&b&&m.length!=w+1?(M.diffs[b++]=m[w],M.length1+=A.length,M.length2+=A.length):A.length>=2*this.Patch_Margin&&b&&(this.patch_addContext_(M,_),g.push(M),M=new R.patch_obj,b=0,_=H,D=F);break}L!==Z&&(D+=A.length),L!==T&&(F+=A.length)}return b&&(this.patch_addContext_(M,_),g.push(M)),g},R.prototype.patch_deepCopy=function(c){for(var d=[],p=0;p<c.length;p++){var v=c[p],m=new R.patch_obj;m.diffs=[];for(var g=0;g<v.diffs.length;g++)m.diffs[g]=new R.Diff(v.diffs[g][0],v.diffs[g][1]);m.start1=v.start1,m.start2=v.start2,m.length1=v.length1,m.length2=v.length2,d[p]=m}return d},R.prototype.patch_apply=function(c,d){if(c.length==0)return[d,[]];c=this.patch_deepCopy(c);var p=this.patch_addPadding(c);d=p+d+p,this.patch_splitMax(c);for(var v=0,m=[],g=0;g<c.length;g++){var M=c[g].start2+v,b=this.diff_text1(c[g].diffs),D,F=-1;if(b.length>this.Match_MaxBits?(D=this.match_main(d,b.substring(0,this.Match_MaxBits),M),D!=-1&&(F=this.match_main(d,b.substring(b.length-this.Match_MaxBits),M+b.length-this.Match_MaxBits),(F==-1||D>=F)&&(D=-1))):D=this.match_main(d,b,M),D==-1)m[g]=!1,v-=c[g].length2-c[g].length1;else{m[g]=!0,v=D-M;var _;if(F==-1?_=d.substring(D,D+b.length):_=d.substring(D,F+this.Match_MaxBits),b==_)d=d.substring(0,D)+this.diff_text2(c[g].diffs)+d.substring(D+b.length);else{var H=this.diff_main(b,_,!1);if(b.length>this.Match_MaxBits&&this.diff_levenshtein(H)/b.length>this.Patch_DeleteThreshold)m[g]=!1;else{this.diff_cleanupSemanticLossless(H);for(var w=0,L,A=0;A<c[g].diffs.length;A++){var B=c[g].diffs[A];B[0]!==z&&(L=this.diff_xIndex(H,w)),B[0]===Z?d=d.substring(0,D+L)+B[1]+d.substring(D+L):B[0]===T&&(d=d.substring(0,D+L)+d.substring(D+this.diff_xIndex(H,w+B[1].length))),B[0]!==T&&(w+=B[1].length)}}}}}return d=d.substring(p.length,d.length-p.length),[d,m]},R.prototype.patch_addPadding=function(c){for(var d=this.Patch_Margin,p="",v=1;v<=d;v++)p+=String.fromCharCode(v);for(var v=0;v<c.length;v++)c[v].start1+=d,c[v].start2+=d;var m=c[0],g=m.diffs;if(g.length==0||g[0][0]!=z)g.unshift(new R.Diff(z,p)),m.start1-=d,m.start2-=d,m.length1+=d,m.length2+=d;else if(d>g[0][1].length){var M=d-g[0][1].length;g[0][1]=p.substring(g[0][1].length)+g[0][1],m.start1-=M,m.start2-=M,m.length1+=M,m.length2+=M}if(m=c[c.length-1],g=m.diffs,g.length==0||g[g.length-1][0]!=z)g.push(new R.Diff(z,p)),m.length1+=d,m.length2+=d;else if(d>g[g.length-1][1].length){var M=d-g[g.length-1][1].length;g[g.length-1][1]+=p.substring(0,M),m.length1+=M,m.length2+=M}return p},R.prototype.patch_splitMax=function(c){for(var d=this.Match_MaxBits,p=0;p<c.length;p++)if(!(c[p].length1<=d)){var v=c[p];c.splice(p--,1);for(var m=v.start1,g=v.start2,M="";v.diffs.length!==0;){var b=new R.patch_obj,D=!0;for(b.start1=m-M.length,b.start2=g-M.length,M!==""&&(b.length1=b.length2=M.length,b.diffs.push(new R.Diff(z,M)));v.diffs.length!==0&&b.length1<d-this.Patch_Margin;){var F=v.diffs[0][0],_=v.diffs[0][1];F===Z?(b.length2+=_.length,g+=_.length,b.diffs.push(v.diffs.shift()),D=!1):F===T&&b.diffs.length==1&&b.diffs[0][0]==z&&_.length>2*d?(b.length1+=_.length,m+=_.length,D=!1,b.diffs.push(new R.Diff(F,_)),v.diffs.shift()):(_=_.substring(0,d-b.length1-this.Patch_Margin),b.length1+=_.length,m+=_.length,F===z?(b.length2+=_.length,g+=_.length):D=!1,b.diffs.push(new R.Diff(F,_)),_==v.diffs[0][1]?v.diffs.shift():v.diffs[0][1]=v.diffs[0][1].substring(_.length))}M=this.diff_text2(b.diffs),M=M.substring(M.length-this.Patch_Margin);var H=this.diff_text1(v.diffs).substring(0,this.Patch_Margin);H!==""&&(b.length1+=H.length,b.length2+=H.length,b.diffs.length!==0&&b.diffs[b.diffs.length-1][0]===z?b.diffs[b.diffs.length-1][1]+=H:b.diffs.push(new R.Diff(z,H))),D||c.splice(++p,0,b)}}},R.prototype.patch_toText=function(c){for(var d=[],p=0;p<c.length;p++)d[p]=c[p];return d.join("")},R.prototype.patch_fromText=function(c){var d=[];if(!c)return d;for(var p=c.split(`
`),v=0,m=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;v<p.length;){var g=p[v].match(m);if(!g)throw new Error("Invalid patch string: "+p[v]);var M=new R.patch_obj;for(d.push(M),M.start1=parseInt(g[1],10),g[2]===""?(M.start1--,M.length1=1):g[2]=="0"?M.length1=0:(M.start1--,M.length1=parseInt(g[2],10)),M.start2=parseInt(g[3],10),g[4]===""?(M.start2--,M.length2=1):g[4]=="0"?M.length2=0:(M.start2--,M.length2=parseInt(g[4],10)),v++;v<p.length;){var b=p[v].charAt(0);try{var D=decodeURI(p[v].substring(1))}catch(F){throw new Error("Illegal escape in patch_fromText: "+D)}if(b=="-")M.diffs.push(new R.Diff(T,D));else if(b=="+")M.diffs.push(new R.Diff(Z,D));else if(b==" ")M.diffs.push(new R.Diff(z,D));else{if(b=="@")break;if(b!=="")throw new Error('Invalid patch mode "'+b+'" in: '+D)}v++}}return d},R.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},R.patch_obj.prototype.toString=function(){var c,d;this.length1===0?c=this.start1+",0":this.length1==1?c=this.start1+1:c=this.start1+1+","+this.length1,this.length2===0?d=this.start2+",0":this.length2==1?d=this.start2+1:d=this.start2+1+","+this.length2;for(var p=["@@ -"+c+" +"+d+` @@
`],v,m=0;m<this.diffs.length;m++){switch(this.diffs[m][0]){case Z:v="+";break;case T:v="-";break;case z:v=" ";break}p[m+1]=v+encodeURI(this.diffs[m][1])+`
`}return p.join("").replace(/%20/g," ")},ae.exports=R,ae.exports.diff_match_patch=R,ae.exports.DIFF_DELETE=T,ae.exports.DIFF_INSERT=Z,ae.exports.DIFF_EQUAL=z}(Mo)),Mo.exports}var _u=Hu();const Iu=is(_u);var ts={exports:{}},rs;function Wu(){return rs||(rs=1,function(ae,R){(function(T){T(nr())})(function(T){T.defineSimpleMode=function(b,D){T.defineMode(b,function(F){return T.simpleMode(F,D)})},T.simpleMode=function(b,D){Z(D,"start");var F={},_=D.meta||{},H=!1;for(var w in D)if(w!=_&&D.hasOwnProperty(w))for(var L=F[w]=[],A=D[w],B=0;B<A.length;B++){var K=A[B];L.push(new d(K,D)),(K.indent||K.dedent)&&(H=!0)}var Q={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:H?[]:null}},copyState:function($){var ce={state:$.state,pending:$.pending,local:$.local,localState:null,indent:$.indent&&$.indent.slice(0)};$.localState&&(ce.localState=T.copyState($.local.mode,$.localState)),$.stack&&(ce.stack=$.stack.slice(0));for(var de=$.persistentStates;de;de=de.next)ce.persistentStates={mode:de.mode,spec:de.spec,state:de.state==$.localState?ce.localState:T.copyState(de.mode,de.state),next:ce.persistentStates};return ce},token:p(F,b),innerMode:function($){return $.local&&{mode:$.local.mode,state:$.localState}},indent:M(F,_)};if(_)for(var J in _)_.hasOwnProperty(J)&&(Q[J]=_[J]);return Q};function Z(b,D){if(!b.hasOwnProperty(D))throw new Error("Undefined state "+D+" in simple mode")}function z(b,D){if(!b)return/(?:)/;var F="";return b instanceof RegExp?(b.ignoreCase&&(F="i"),b.unicode&&(F+="u"),b=b.source):b=String(b),new RegExp((D===!1?"":"^")+"(?:"+b+")",F)}function c(b){if(!b)return null;if(b.apply)return b;if(typeof b=="string")return b.replace(/\./g," ");for(var D=[],F=0;F<b.length;F++)D.push(b[F]&&b[F].replace(/\./g," "));return D}function d(b,D){(b.next||b.push)&&Z(D,b.next||b.push),this.regex=z(b.regex),this.token=c(b.token),this.data=b}function p(b,D){return function(F,_){if(_.pending){var H=_.pending.shift();return _.pending.length==0&&(_.pending=null),F.pos+=H.text.length,H.token}if(_.local)if(_.local.end&&F.match(_.local.end)){var w=_.local.endToken||null;return _.local=_.localState=null,w}else{var w=_.local.mode.token(F,_.localState),L;return _.local.endScan&&(L=_.local.endScan.exec(F.current()))&&(F.pos=F.start+L.index),w}for(var A=b[_.state],B=0;B<A.length;B++){var K=A[B],Q=(!K.data.sol||F.sol())&&F.match(K.regex);if(Q){K.data.next?_.state=K.data.next:K.data.push?((_.stack||(_.stack=[])).push(_.state),_.state=K.data.push):K.data.pop&&_.stack&&_.stack.length&&(_.state=_.stack.pop()),K.data.mode&&m(D,_,K.data.mode,K.token),K.data.indent&&_.indent.push(F.indentation()+D.indentUnit),K.data.dedent&&_.indent.pop();var J=K.token;if(J&&J.apply&&(J=J(Q)),Q.length>2&&K.token&&typeof K.token!="string"){for(var $=2;$<Q.length;$++)Q[$]&&(_.pending||(_.pending=[])).push({text:Q[$],token:K.token[$-1]});return F.backUp(Q[0].length-(Q[1]?Q[1].length:0)),J[0]}else return J&&J.join?J[0]:J}}return F.next(),null}}function v(b,D){if(b===D)return!0;if(!b||typeof b!="object"||!D||typeof D!="object")return!1;var F=0;for(var _ in b)if(b.hasOwnProperty(_)){if(!D.hasOwnProperty(_)||!v(b[_],D[_]))return!1;F++}for(var _ in D)D.hasOwnProperty(_)&&F--;return F==0}function m(b,D,F,_){var H;if(F.persistent)for(var w=D.persistentStates;w&&!H;w=w.next)(F.spec?v(F.spec,w.spec):F.mode==w.mode)&&(H=w);var L=H?H.mode:F.mode||T.getMode(b,F.spec),A=H?H.state:T.startState(L);F.persistent&&!H&&(D.persistentStates={mode:L,spec:F.spec,state:A,next:D.persistentStates}),D.localState=A,D.local={mode:L,end:F.end&&z(F.end),endScan:F.end&&F.forceEnd!==!1&&z(F.end,!1),endToken:_&&_.join?_[_.length-1]:_}}function g(b,D){for(var F=0;F<D.length;F++)if(D[F]===b)return!0}function M(b,D){return function(F,_,H){if(F.local&&F.local.mode.indent)return F.local.mode.indent(F.localState,_,H);if(F.indent==null||F.local||D.dontIndentStates&&g(F.state,D.dontIndentStates)>-1)return T.Pass;var w=F.indent.length-1,L=b[F.state];e:for(;;){for(var A=0;A<L.length;A++){var B=L[A];if(B.data.dedent&&B.data.dedentIfLineStart!==!1){var K=B.regex.exec(_);if(K&&K[0]){w--,(B.next||B.push)&&(L=b[B.next||B.push]),_=_.slice(K[0].length);continue e}}}break}return w<0?0:F.indent[w]}}})}()),ts.exports}Wu();!window.CodeMirror&&(window.CodeMirror=ss);const qn=window.CodeMirror||ss,Pu=Kn({name:"DefaultMode",props:{name:{type:String,default:`cm-textarea-${+new Date}`},value:{type:String,default:""},content:{type:String,default:""},options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>null},placeholder:{type:String,default:""}},emits:{ready:ae=>ae,"update:cminstance":ae=>ae},setup(ae,{emit:R}){const T=_t(),Z=_t(null),z=()=>{Z.value=No(qn.fromTextArea(T.value,ae.options)),R("update:cminstance",Z.value);const c=Wr(()=>ae.cminstance,d=>{var p;d&&((p=ae.cminstance)==null||p.setValue(ae.value||ae.content)),R("ready",Bt(Z)),c==null||c()},{deep:!0})};return Oo(()=>{z()}),{textarea:T,initialize:z}}}),Fo=(ae,R)=>{const T=ae.__vccOpts||ae;for(const[Z,z]of R)T[Z]=z;return T},Ru=["name","placeholder"];function Bu(ae,R,T,Z,z,c){return cn(),Mi("textarea",{ref:"textarea",name:ae.$props.name,placeholder:ae.$props.placeholder},null,8,Ru)}const ns=Fo(Pu,[["render",Bu]]);window.diff_match_patch=Iu;window.DIFF_DELETE=-1;window.DIFF_INSERT=1;window.DIFF_EQUAL=0;const zu=Kn({name:"MergeMode",props:{options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})}},emits:["update:cminstance","ready"],setup(ae,{emit:R}){const T=_t(),Z=_t(),z=()=>{T.value=No(qn.MergeView(Z.value,ae.options)),R("update:cminstance",T.value),R("ready",T)};return Oo(()=>{z()}),{mergeView:Z,initialize:z}}}),Uu={ref:"mergeView"};function Gu(ae,R,T,Z,z,c){return cn(),Mi("div",Uu,null,512)}const Ku=Fo(zu,[["render",Gu]]);function qu(ae){const R=/#link#(.+)#link#/g,T=[];let Z;for(Z=R.exec(ae);Z;){const z=document.createElement("a"),c=JSON.parse(Z[1]),d=Object.entries(c);for(const[p,v]of d)z.setAttribute(p,v);z.className="editor_custom_link",z.innerHTML="logDownload",T.push({start:Z.index,end:Z.index+Z[0].length,node:z}),Z=R.exec(ae)}return T}function Xu(ae){const R=[];function T(){const Z=/#log<(\w*)>log#((.|\r\n|\n)*?)#log<(\w*)>log#/g;let z;for(z=Z.exec(ae);z;){const c=z[0].replace(/\r\n/g,`
`).split(`
`),d=z[2].replace(/\r\n/g,`
`).split(`
`),p=document.createElement("span"),v=z[1];p.className=`c-editor--log__${v}`;let m=0;for(let g=0;g<c.length;g++){const M=c[g],b=d[g],D=p.cloneNode(!1);D.innerText=b,R.push({start:z.index+m,end:z.index+m+M.length,node:D}),m=m+M.length+1}z=Z.exec(ae)}}return T(),R}const Li=[{regex:/(\[.*?\])([ \t]*)(<error>[ \t])(.+)/,token:["tag","","error.strong","error.strong"],sol:!0},{regex:/(\[.*?\])([ \t]*)(<info>)(.+)(.?)/,token:["tag","","bracket","bracket","hr"],sol:!0},{regex:/(\[.*?\])([ \t]*)(<warning>)(.+)(.?)/,token:["tag","","comment","comment","hr"],sol:!0}];qn.defineSimpleMode("fclog",{start:[...Li,{regex:/.*/,token:"hr"}],error:[...Li,{regex:/.*/,token:"error.strong"}],info:[...Li,{regex:/.*/,token:"bracket"}],warning:[...Li,{regex:/.*\[/,token:"comment"}]});qn.defineSimpleMode("log",{start:[{regex:/^[=]+[^=]*[=]+/,token:"strong"},{regex:/([^\w])([A-Z][\w]*)/,token:["","string"]},{regex:/(^[A-Z][\w]*)/,token:"string"}]});const Yu=Kn({name:"CodemirrorFclog",props:{value:{type:String,default:""},name:{type:String,default:`cm-textarea-${+new Date}`},options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["update:cminstance","ready"],setup(ae,{emit:R}){const T=_t(),Z=_t(null),z=(d=ae.cminstance)=>{d.getAllMarks().forEach(m=>m.clear());const p=d.getValue(),v=[].concat(qu(p)).concat(Xu(p));for(let m=0;m<v.length;m++){const g=v[m];d.markText(d.posFromIndex(g.start),d.posFromIndex(g.end),{replacedWith:g.node})}},c=()=>{var d;Z.value=No(qn.fromTextArea(T.value,ae.options)),R("update:cminstance",Bt(Z)),(d=Z.value)==null||d.on("change",z)};return Wr(()=>ae.cminstance,d=>{var p;d&&(z(ae.cminstance),(p=ae.cminstance)==null||p.setValue(ae.value),R("ready",Z))},{deep:!0,immediate:!0}),Oo(()=>{c()}),{initialize:c,textarea:T}}}),Zu=["name","placeholder"];function ju(ae,R,T,Z,z,c){return cn(),Mi("textarea",{ref:"textarea",name:ae.$props.name,placeholder:ae.$props.placeholder},null,8,Zu)}const Qu=Fo(Yu,[["render",ju]]),fs={"update:value":()=>!0,change:(ae,R)=>({value:ae,cm:R}),input:()=>!0,ready:ae=>ae},Ju=["changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],Vu=()=>{const ae={};return Ju.forEach(R=>{ae[R]=(...T)=>T}),ae},$u=Cr(Cr({},fs),Vu()),Ao={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2,styleActiveLine:!0};function eh(ae){Promise.resolve().then(()=>{const R=ae.getScrollInfo();ae.scrollTo(R.left,R.height)})}const th=({props:ae,cminstance:R,emit:T,internalInstance:Z,content:z})=>{const c=Do(()=>{var p;return ae.merge?(p=Bt(R))==null?void 0:p.editor():Bt(R)}),d=()=>{const p=[];return Object.keys(Z==null?void 0:Z.vnode.props).forEach(v=>{if(v.startsWith("on")){const m=v.replace(v[2],v[2].toLowerCase()).slice(2);!fs[m]&&p.push(m)}}),p};return{listenerEvents:()=>{c.value.on("change",v=>{const m=v.getValue();m===z.value&&m!==""||(z.value=m,T("update:value",z.value||""),T("input",z.value||" "),Promise.resolve().then(()=>{T("change",z.value,v)}),ae.keepCursorInEnd&&eh(v))});const p={};d().filter(v=>!p[v]&&(p[v]=!0)).forEach(v=>{c.value.on(v,(...m)=>{T(v,...m)})})}}};function rh({props:ae,cminstance:R,presetRef:T}){const Z=_t("100%"),z=_t("100%"),c=Do(()=>{var b;return ae.merge?(b=Bt(R))==null?void 0:b.editor():Bt(R)}),d=()=>{as(()=>{var b;(b=c.value)==null||b.refresh()})},p=b=>b?!(b&&isNaN(+b)):!1,v=(b=ae.width,D=ae.height)=>{var F;let _="100%",H="100%";p(b)?_=`${String(b)}px`:b&&(_=b),p(D)?H=`${String(D)}px`:D&&(H=D),Z.value=_,z.value=H,console.log("resize",_,H),(F=c.value)==null||F.setSize("100%","100%")},m=()=>{var b;const D=(b=c.value)==null?void 0:b.getWrapperElement();D==null||D.remove()},g=()=>{var b,D,F;const _=(b=c.value)==null?void 0:b.getDoc().getHistory();(D=T.value)==null||D.initialize(),m(),(F=c.value)==null||F.getDoc().setHistory(_)},M=()=>{const b=document.querySelector(".CodeMirror-gutters");return(b==null?void 0:b.style.left.replace("px",""))!=="0"};return{reload:g,refresh:d,resize:v,destroy:m,containerWidth:Z,containerHeight:z,reviseStyle:()=>{if(d(),!M())return;const b=setInterval(()=>{M()?d():clearInterval(b)},60),D=setTimeout(()=>{clearInterval(b),clearTimeout(D)},400)}}}const nh=Kn({__name:"index",props:{value:{type:String,default:""},options:{type:Object,default:()=>Ao},globalOptions:{type:Object,default:()=>Ao},placeholder:{type:String,default:""},border:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null},originalStyle:{type:Boolean,default:!1},keepCursorInEnd:{type:Boolean,default:!1},merge:{type:Boolean,default:!1},name:{type:String,default:""},marker:{type:Function,default:()=>null},unseenLines:{type:Array,default:()=>[]}},emits:$u,setup(ae,{expose:R,emit:T}){var Z,z,c;typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value(re){if(re==null)throw new TypeError("Cannot convert undefined or null to object");const oe=Object(re);for(let U=1;U<arguments.length;U++){const ie=arguments[U];if(ie!=null)for(const C in ie)Object.prototype.hasOwnProperty.call(ie,C)&&(oe[C]=ie[C])}return oe},writable:!0,configurable:!0});const d=ae,p=T,v=_t(null),m=_t(""),g=gu(ns),M=_t(Co(Cr(Cr(Cr({foldGutter:!0},Ao),d.globalOptions),d.options),{gutters:[...new Set(["CodeMirror-linenumbers","CodeMirror-foldgutter",...((Z=d.options)==null?void 0:Z.gutters)||[]])]})),b=vu(),D=d.name||((c=(z=b==null?void 0:b.parent)==null?void 0:z.type)==null?void 0:c.name)||void 0,F=_t(null),_=Do(()=>{var re;return d.merge?(re=Bt(v))==null?void 0:re.editor():Bt(v)}),{refresh:H,resize:w,destroy:L,containerHeight:A,containerWidth:B,reviseStyle:K}=rh({props:d,cminstance:v,presetRef:F}),{listenerEvents:Q}=th({props:d,cminstance:v,emit:p,internalInstance:b,content:m}),J=()=>{d.unseenLines!==void 0&&d.marker!==void 0&&d.unseenLines.forEach(re=>{var oe,U;const ie=(oe=v.value)==null?void 0:oe.lineInfo(re);(U=v.value)==null||U.setGutterMarker(re,"breakpoints",ie!=null&&ie.gutterMarkers?null:d.marker())})},$=re=>{var oe,U;const ie=(oe=v.value)==null?void 0:oe.getValue();re!==ie&&((U=v.value)==null||U.setValue(re),m.value=re,K()),J()},ce=()=>{Q(),J(),w(d.width,d.height),p("ready",v.value),Wr([()=>d.width,()=>d.height],([re,oe])=>{w(re,oe)},{deep:!0})},de=()=>{if(d.options.mode==="fclog"||d.options.mode==="log"){g.value=Qu;return}if(d.merge){g.value=Ku;return}g.value=ns};return Wr(()=>d.options,re=>{var oe;for(const U in d.options)(oe=_.value)==null||oe.setOption(U,Bt(re[U]))},{deep:!0}),Wr(()=>d.value,re=>{$(re)}),Wr(()=>d.merge,de,{immediate:!0}),mu(()=>{L()}),R({cminstance:v,resize:w,refresh:H,destroy:L}),(re,oe)=>(cn(),Mi("div",{class:Su(["codemirror-container",{merge:re.$props.merge,bordered:re.$props.border||re.$props.merge&&!d.originalStyle,"original-style":d.originalStyle}]),style:wu({height:Bt(A),width:Bt(B)})},[(cn(),os(bu(g.value),yu({ref_key:"presetRef",ref:F,cminstance:v.value,"onUpdate:cminstance":oe[0]||(oe[0]=U=>v.value=U),style:{height:"100%"}},Co(Cr(Cr({},re.$props),re.$attrs),{options:M.value,name:Bt(D),content:m.value}),{onReady:ce}),null,16,["cminstance"]))],6))}});function ih(ae,R){R===void 0&&(R={});var T=R.insertAt;if(typeof document!="undefined"){var Z=document.head||document.getElementsByTagName("head")[0],z=document.createElement("style");z.type="text/css",T==="top"&&Z.firstChild?Z.insertBefore(z,Z.firstChild):Z.appendChild(z),z.styleSheet?z.styleSheet.cssText=ae:z.appendChild(document.createTextNode(ae))}}ih(`.codemirror-container {
position: relative;
display: inline-block;
height: 100%;
width: fit-content;
font-size: 13px;
overflow: hidden;
}
.codemirror-container.bordered {
border: 1px solid #aaaaaa;
}
.codemirror-container .editor_custom_link {
cursor: pointer;
color: #1474f1;
text-decoration: underline;
}
.codemirror-container .editor_custom_link:hover {
color: #04b4fa;
}
.codemirror-container:not(.original-style) .CodeMirror-lines .CodeMirror-placeholder.CodeMirror-line-like {
color: #666;
}
.codemirror-container:not(.original-style) .CodeMirror,
.codemirror-container:not(.original-style) .CodeMirror-merge-pane {
height: 100%;
font-family: consolas !important;
}
.codemirror-container:not(.original-style) .CodeMirror-merge,
.codemirror-container:not(.original-style) .CodeMirror-merge-right .CodeMirror {
height: 100%;
border: none !important;
}
.codemirror-container:not(.original-style) .c-editor--log__error {
color: #bb0606;
font-weight: bold;
}
.codemirror-container:not(.original-style) .c-editor--log__info {
color: #333333;
font-weight: bold;
}
.codemirror-container:not(.original-style) .c-editor--log__warning {
color: #ee9900;
}
.codemirror-container:not(.original-style) .c-editor--log__success {
color: #669600;
}
.codemirror-container:not(.original-style) .cm-header,
.codemirror-container:not(.original-style) .cm-strong {
font-weight: bold;
}
`);const oh={class:"card-header"},ah={class:"font-medium"},lh=Kn({__name:"index",setup(ae){const{isDark:R}=ku(),T=_t(null),Z=xu({mode:"javascript",theme:R.value?"material-darker":"default",tabSize:4,readOnly:!1,autofocus:!0,autoRefresh:!0,lineNumbers:!0,lineWiseCopyCut:!0,gutters:["CodeMirror-lint-markers"],lint:!0,extraKeys:{Ctrl:"autocomplete",Tab:"autocomplete"},hintOptions:{completeSingle:!1}}),z=_t(`function sayHello() {
console.log("Hello, World!");
}
sayHello();`),c=d=>{T.value=d,d.on("keypress",()=>d.showHint())};return Wr(()=>R.value,d=>Hl(this,null,function*(){yield as(),d?T.value.setOption("theme","material-darker"):T.value.setOption("theme","default")})),(d,p)=>{const v=Il("el-link"),m=Il("el-card");return cn(),os(m,{shadow:"never"},{header:Ci(()=>[_l("div",oh,[_l("span",ah,[p[2]||(p[2]=To(" 代码编辑器组件,采用开源的 ")),Lo(v,{href:"https://rennzhang.github.io/codemirror-editor-vue3/zh-CN/guide/getting-started",target:"_blank",style:{margin:"0 4px 5px","font-size":"16px"}},{default:Ci(()=>p[1]||(p[1]=[To(" codemirror-editor-vue3 ")])),_:1})])]),Lo(v,{class:"mt-2",href:"https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/codemirror/index.vue",target:"_blank"},{default:Ci(()=>p[3]||(p[3]=[To(" 代码位置 src/views/codemirror/index.vue ")])),_:1})]),default:Ci(()=>[Lo(Bt(nh),{value:z.value,"onUpdate:value":p[0]||(p[0]=g=>z.value=g),width:"100%",height:"400px",options:Z,border:!0,onReady:c},null,8,["value","options"])]),_:1})}}}),uh=Cu(lh,[["__scopeId","data-v-b2d2637e"]]);export{uh as default};