index-8fd1420c.js 243 KB
var Ou=Object.defineProperty;var gl=Object.getOwnPropertySymbols;var Au=Object.prototype.hasOwnProperty,Du=Object.prototype.propertyIsEnumerable;var yl=(ye,Fe,W)=>Fe in ye?Ou(ye,Fe,{enumerable:!0,configurable:!0,writable:!0,value:W}):ye[Fe]=W,ml=(ye,Fe)=>{for(var W in Fe||(Fe={}))Au.call(Fe,W)&&yl(ye,W,Fe[W]);if(gl)for(var W of gl(Fe))Du.call(Fe,W)&&yl(ye,W,Fe[W]);return ye};var Wn=(ye,Fe,W)=>new Promise((Se,q)=>{var ue=E=>{try{oe(W.next(E))}catch(X){q(X)}},Ee=E=>{try{oe(W.throw(E))}catch(X){q(X)}},oe=E=>E.done?Se(E.value):Promise.resolve(E.value).then(ue,Ee);oe((W=W.apply(ye,Fe)).next())});import{z as Pu,U as Wu,_ as vo,ak as Eu,bj as zu,aj as Cl}from"./index.js";import{d as go,k as Hu,w as bl,q as wl,s as Fu,u as Tl,o as Iu,b as Bu,_ as yo,$ as Ll,e as Ru,f as _u,a9 as Ku}from"./vue-5a35c3f5.js";import{I as Ml,J as Nl}from"./antd-6b087f69.js";import{u as ju}from"./useWindowSizeFn-cc2fb57c.js";var po={exports:{}},xl;function En(){return xl||(xl=1,function(ye,Fe){(function(W,Se){ye.exports=Se()})(Ml,function(){var W=navigator.userAgent,Se=navigator.platform,q=/gecko\/\d/i.test(W),ue=/MSIE \d/.test(W),Ee=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(W),oe=/Edge\/(\d+)/.exec(W),E=ue||Ee||oe,X=E&&(ue?document.documentMode||6:+(oe||Ee)[1]),K=!oe&&/WebKit\//.test(W),D=K&&/Qt\/\d+\.\d+/.test(W),Z=!oe&&/Chrome\/(\d+)/.exec(W),pe=Z&&+Z[1],he=/Opera\//.test(W),ze=/Apple Computer/.test(navigator.vendor),Ie=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(W),Ae=/PhantomJS/.test(W),ae=ze&&(/Mobile\/\w+/.test(W)||navigator.maxTouchPoints>2),ee=/Android/.test(W),fe=ae||ee||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(W),me=ae||/Mac/.test(Se),Xe=/\bCrOS\b/.test(W),ut=/win/i.test(Se),Ke=he&&W.match(/Version\/(\d*\.\d*)/);Ke&&(Ke=Number(Ke[1])),Ke&&Ke>=15&&(he=!1,K=!0);var be=me&&(D||he&&(Ke==null||Ke<12.11)),te=q||E&&X>=9;function v(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var N=function(e,t){var n=e.className,r=v(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function m(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return m(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 z(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var M;document.createRange?M=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:M=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 R(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 le(e){var t;try{t=e.activeElement}catch(n){t=e.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function ve(e,t){var n=e.className;v(t).test(n)||(e.className+=(n?" ":"")+t)}function Ve(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!v(n[r]).test(t)&&(t+=" "+n[r]);return t}var et=function(e){e.select()};ae?et=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:E&&(et=function(e){try{e.select()}catch(t){}});function Me(e){return e.display.wrapper.ownerDocument}function tt(e){return Me(e).defaultView}function De(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Y(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 j(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 V=function(){this.id=null,this.f=null,this.time=0,this.handler=De(this.onTimeout,this)};V.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},V.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 U(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var L=50,P={toString:function(){return"CodeMirror.Pass"}},Q={scroll:!1},we={origin:"*mouse"},Oe={origin:"+move"};function Le(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 ce=[""];function He(e){for(;ce.length<=e;)ce.push(ie(ce)+" ");return ce[e]}function ie(e){return e[e.length-1]}function Re(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function It(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function xe(){}function w(e,t){var n;return Object.create?n=Object.create(e):(xe.prototype=e,n=new xe),t&&Y(t,n),n}var O=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function S(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||O.test(e))}function se(e,t){return t?t.source.indexOf("\\w")>-1&&S(e)?!0:t.test(e):S(e)}function rt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ir=/[\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 $r(e){return e.charCodeAt(0)>=768&&ir.test(e)}function Bt(e,t,n){for(;(n<0?t>0:t<e.length)&&$r(e.charAt(t));)t+=n;return t}function je(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 mr(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 Rt=null;function Ot(e,t,n){var r;Rt=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:Rt=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:Rt=i)}return r!=null?r:Rt}var yi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(u,d,h){this.level=u,this.from=d,this.to=h}return function(u,d){var h=d=="ltr"?"L":"R";if(u.length==0||d=="ltr"&&!r.test(u))return!1;for(var b=u.length,y=[],k=0;k<b;++k)y.push(n(u.charCodeAt(k)));for(var C=0,A=h;C<b;++C){var H=y[C];H=="m"?y[C]=A:A=H}for(var B=0,F=h;B<b;++B){var _=y[B];_=="1"&&F=="r"?y[B]="n":o.test(_)&&(F=_,_=="r"&&(y[B]="R"))}for(var $=1,J=y[0];$<b-1;++$){var de=y[$];de=="+"&&J=="1"&&y[$+1]=="1"?y[$]="1":de==","&&J==y[$+1]&&(J=="1"||J=="n")&&(y[$]=J),J=de}for(var Pe=0;Pe<b;++Pe){var at=y[Pe];if(at==",")y[Pe]="N";else if(at=="%"){var _e=void 0;for(_e=Pe+1;_e<b&&y[_e]=="%";++_e);for(var Lt=Pe&&y[Pe-1]=="!"||_e<b&&y[_e]=="1"?"1":"N",xt=Pe;xt<_e;++xt)y[xt]=Lt;Pe=_e-1}}for(var Je=0,kt=h;Je<b;++Je){var st=y[Je];kt=="L"&&st=="1"?y[Je]="L":o.test(st)&&(kt=st)}for(var $e=0;$e<b;++$e)if(i.test(y[$e])){var Ze=void 0;for(Ze=$e+1;Ze<b&&i.test(y[Ze]);++Ze);for(var qe=($e?y[$e-1]:h)=="L",St=(Ze<b?y[Ze]:h)=="L",Zr=qe==St?qe?"L":"R":h,yr=$e;yr<Ze;++yr)y[yr]=Zr;$e=Ze-1}for(var ht=[],Xt,lt=0;lt<b;)if(a.test(y[lt])){var co=lt;for(++lt;lt<b&&a.test(y[lt]);++lt);ht.push(new s(0,co,lt))}else{var nr=lt,Nr=ht.length,Or=d=="rtl"?1:0;for(++lt;lt<b&&y[lt]!="L";++lt);for(var yt=nr;yt<lt;)if(l.test(y[yt])){nr<yt&&(ht.splice(Nr,0,new s(1,nr,yt)),Nr+=Or);var Vr=yt;for(++yt;yt<lt&&l.test(y[yt]);++yt);ht.splice(Nr,0,new s(2,Vr,yt)),Nr+=Or,nr=yt}else++yt;nr<lt&&ht.splice(Nr,0,new s(1,nr,lt))}return d=="ltr"&&(ht[0].level==1&&(Xt=u.match(/^\s+/))&&(ht[0].from=Xt[0].length,ht.unshift(new s(0,0,Xt[0].length))),ie(ht).level==1&&(Xt=u.match(/\s+$/))&&(ie(ht).to-=Xt[0].length,ht.push(new s(0,b-Xt[0].length,b)))),d=="rtl"?ht.reverse():ht}}();function At(e,t){var n=e.order;return n==null&&(n=e.order=yi(e.text,t)),n}var zn=[],I=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]||zn).concat(n)}};function en(e,t){return e._handlers&&e._handlers[t]||zn}function ft(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=U(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function We(e,t){var n=en(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 Ue(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),We(e,n||t.type,e,t),tn(t)||t.codemirrorIgnore}function Hn(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)U(n,t[r])==-1&&n.push(t[r])}function pt(e,t){return en(e,t).length>0}function vt(e){e.prototype.on=function(t,n){I(this,t,n)},e.prototype.off=function(t,n){ft(this,t,n)}}function ct(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function br(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function tn(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Yt(e){ct(e),br(e)}function mt(e){return e.target||e.srcElement}function rn(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),me&&e.ctrlKey&&t==1&&(t=3),t}var mi=function(){if(E&&X<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Dt;function bi(e){if(Dt==null){var t=c("span","​");T(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Dt=t.offsetWidth<=1&&t.offsetHeight>2&&!(E&&X<8))}var n=Dt?c("span","​"):c("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Ar;function Fn(e){if(Ar!=null)return Ar;var t=T(e,document.createTextNode("AخA")),n=M(t,0,1).getBoundingClientRect(),r=M(t,1,2).getBoundingClientRect();return m(e),!n||n.left==n.right?!1:Ar=r.right-n.right<3}var nn=`

b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},or=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},_t=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Kt=null;function In(e){if(Kt!=null)return Kt;var t=T(e,c("span","x")),n=t.getBoundingClientRect(),r=M(t,0,1).getBoundingClientRect();return Kt=Math.abs(n.left-r.left)>1}var Wt={},ar={};function Bn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Wt[e]=t}function Dr(e,t){ar[e]=t}function Ct(e){if(typeof e=="string"&&ar.hasOwnProperty(e))e=ar[e];else if(e&&typeof e.name=="string"&&ar.hasOwnProperty(e.name)){var t=ar[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 Ct("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ct("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Jt(e,t){t=Ct(t);var n=Wt[t.name];if(!n)return Jt(e,"text/plain");var r=n(e,t);if(lr.hasOwnProperty(t.name)){var i=lr[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 lr={};function Rn(e,t){var n=lr.hasOwnProperty(e)?lr[e]:lr[e]={};Y(t,n)}function Zt(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 sr(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 on(e,t,n){return e.startState?e.startState(t,n):!0}var Ge=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};Ge.prototype.eol=function(){return this.pos>=this.string.length},Ge.prototype.sol=function(){return this.pos==this.lineStart},Ge.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ge.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ge.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},Ge.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ge.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ge.prototype.skipToEnd=function(){this.pos=this.string.length},Ge.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ge.prototype.backUp=function(e){this.pos-=e},Ge.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=j(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Ge.prototype.indentation=function(){return j(this.string,null,this.tabSize)-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Ge.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)}},Ge.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ge.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ge.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ge.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function G(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 Vt(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 Pr(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 Ce(e){if(e.parent==null)return null;for(var t=e.parent,n=U(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 jt(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return n+a}function f(e,t){return t>=e.first&&t<e.first+e.size}function p(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function 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 x(e,t){return e.line-t.line||e.ch-t.ch}function re(e,t){return e.sticky==t.sticky&&x(e,t)==0}function ge(e){return g(e.line,e.ch)}function ke(e,t){return x(e,t)<0?t:e}function Qe(e,t){return x(e,t)<0?e:t}function Mt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ne(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,G(e,n).text.length):Al(t,G(e,t.line).text.length)}function Al(e,t){var n=e.ch;return n==null||n>t?g(e.line,t):n<0?g(e.line,0):e}function mo(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ne(e,t[r]);return n}var _n=function(e,t){this.state=e,this.lookAhead=t},Ut=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ut.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}},Ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ut.fromSaved=function(e,t,n){return t instanceof _n?new Ut(e,Zt(e.mode,t.state),n,t.lookAhead):new Ut(e,Zt(e.mode,t),n)},Ut.prototype.save=function(e){var t=e!==!1?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new _n(t,this.maxLookAhead):t};function bo(e,t,n,r){var i=[e.state.modeGen],o={};To(e,t.text,e.doc.mode,n,function(u,d){return i.push(u,d)},o,r);for(var a=n.state,l=function(u){n.baseTokens=i;var d=e.state.overlays[u],h=1,b=0;n.state=!0,To(e,t.text,d.mode,n,function(y,k){for(var C=h;b<y;){var A=i[h];A>y&&i.splice(h,1,y,i[h+1],A),h+=2,b=Math.min(y,A)}if(k)if(d.opaque)i.splice(C,h-C,y,"overlay "+k),h=C+2;else for(;C<h;C+=2){var H=i[C+1];i[C+1]=(H?H+" ":"")+"overlay "+k}},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 wo(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=an(e,Ce(t)),i=t.text.length>e.options.maxHighlightLength&&Zt(e.doc.mode,r.state),o=bo(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function an(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Ut(r,!0,t);var o=Dl(e,t,n),a=o>r.first&&G(r,o-1).stateAfter,l=a?Ut.fromSaved(r,a,o):new Ut(r,on(r.mode),o);return r.iter(o,t,function(s){wi(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?l.save():null,l.nextLine()}),n&&(r.modeFrontier=l.line),l}function wi(e,t,n,r){var i=e.doc.mode,o=new Ge(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&xo(i,n.state);!o.eol();)xi(i,o,n.state),o.start=o.pos}function xo(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=sr(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function xi(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=sr(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 ko=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function So(e,t,n,r){var i=e.doc,o=i.mode,a;t=ne(i,t);var l=G(i,t.line),s=an(e,t.line,n),u=new Ge(l.text,e.options.tabSize,s),d;for(r&&(d=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,a=xi(o,u,s.state),r&&d.push(new ko(u,a,Zt(i.mode,s.state)));return r?d:new ko(u,a,s.state)}function Co(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 To(e,t,n,r,i,o,a){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,u=null,d=new Ge(t,e.options.tabSize,r),h,b=e.options.addModeClass&&[null];for(t==""&&Co(xo(n,r.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&wi(e,t,r,d.pos),d.pos=t.length,h=null):h=Co(xi(n,d,r.state,b),o),b){var y=b[0].name;y&&(h="m-"+(h?y+" "+h:y))}if(!l||u!=h){for(;s<d.start;)s=Math.min(d.start,s+5e3),i(s,u);u=h}d.start=d.pos}for(;s<d.pos;){var k=Math.min(d.pos,s+5e3);i(k,u),s=k}}function Dl(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=G(o,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof _n?u.lookAhead:0)<=o.modeFrontier))return l;var d=j(s.text,null,e.options.tabSize);(i==null||r>d)&&(i=l-1,r=d)}return i}function Pl(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=G(e,r).stateAfter;if(i&&(!(i instanceof _n)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Lo=!1,Qt=!1;function Wl(){Lo=!0}function El(){Qt=!0}function Kn(e,t,n){this.marker=e,this.from=t,this.to=n}function ln(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function zl(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Hl(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 Fl(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 Kn(a,o.from,s?null:o.to))}}return r}function Il(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 Kn(a,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function ki(e,t){if(t.full)return null;var n=f(e,t.from.line)&&G(e,t.from.line).markedSpans,r=f(e,t.to.line)&&G(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=x(t.from,t.to)==0,l=Fl(n,i,a),s=Il(r,o,a),u=t.text.length==1,d=ie(t.text).length+(u?i:0);if(l)for(var h=0;h<l.length;++h){var b=l[h];if(b.to==null){var y=ln(s,b.marker);y?u&&(b.to=y.to==null?null:y.to+d):b.to=i}}if(s)for(var k=0;k<s.length;++k){var C=s[k];if(C.to!=null&&(C.to+=d),C.from==null){var A=ln(l,C.marker);A||(C.from=d,u&&(l||(l=[])).push(C))}else C.from+=d,u&&(l||(l=[])).push(C)}l&&(l=Mo(l)),s&&s!=l&&(s=Mo(s));var H=[l];if(!u){var B=t.text.length-2,F;if(B>0&&l)for(var _=0;_<l.length;++_)l[_].to==null&&(F||(F=[])).push(new Kn(l[_].marker,null,null));for(var $=0;$<B;++$)H.push(F);H.push(s)}return H}function Mo(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 Bl(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(y){if(y.markedSpans)for(var k=0;k<y.markedSpans.length;++k){var C=y.markedSpans[k].marker;C.readOnly&&(!r||U(r,C)==-1)&&(r||(r=[])).push(C)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var u=i[s];if(!(x(u.to,l.from)<0||x(u.from,l.to)>0)){var d=[s,1],h=x(u.from,l.from),b=x(u.to,l.to);(h<0||!a.inclusiveLeft&&!h)&&d.push({from:u.from,to:l.from}),(b>0||!a.inclusiveRight&&!b)&&d.push({from:l.to,to:u.to}),i.splice.apply(i,d),s+=d.length-3}}return i}function No(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Oo(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function jn(e){return e.inclusiveLeft?-1:0}function Un(e){return e.inclusiveRight?1:0}function Si(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=x(r.from,i.from)||jn(e)-jn(t);if(o)return-o;var a=x(r.to,i.to)||Un(e)-Un(t);return a||t.id-e.id}function Ao(e,t){var n=Qt&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Si(r,i.marker)<0)&&(r=i.marker);return r}function Do(e){return Ao(e,!0)}function Gn(e){return Ao(e,!1)}function Rl(e,t){var n=Qt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||Si(r,o.marker)<0)&&(r=o.marker)}return r}function Po(e,t,n,r,i){var o=G(e,t),a=Qt&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var u=s.marker.find(0),d=x(u.from,n)||jn(s.marker)-jn(i),h=x(u.to,r)||Un(s.marker)-Un(i);if(!(d>=0&&h<=0||d<=0&&h>=0)&&(d<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?x(u.to,n)>=0:x(u.to,n)>0)||d>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?x(u.from,r)<=0:x(u.from,r)<0)))return!0}}}function Et(e){for(var t;t=Do(e);)e=t.find(-1,!0).line;return e}function _l(e){for(var t;t=Gn(e);)e=t.find(1,!0).line;return e}function Kl(e){for(var t,n;t=Gn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ci(e,t){var n=G(e,t),r=Et(n);return n==r?t:Ce(r)}function Wo(e,t){if(t>e.lastLine())return t;var n=G(e,t),r;if(!ur(e,n))return t;for(;r=Gn(n);)n=r.find(1,!0).line;return Ce(n)+1}function ur(e,t){var n=Qt&&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&&Ti(e,t,r))return!0}}}function Ti(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Ti(e,r.line,ln(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ti(e,t,i))return!0}function $t(e){e=Et(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function qn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Do(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Gn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function Li(e){var t=e.display,n=e.doc;t.maxLine=G(n,n.first),t.maxLineLength=qn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=qn(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Wr=function(e,t,n){this.text=e,Oo(this,t),this.height=n?n(this):1};Wr.prototype.lineNo=function(){return Ce(this)},vt(Wr);function jl(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),No(e),Oo(e,n);var i=r?r(e):1;i!=e.height&&Pt(e,i)}function Ul(e){e.parent=null,No(e)}var Gl={},ql={};function Eo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ql:Gl;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function zo(e,t){var n=z("span",null,null,K?"padding-right: .1px":null),r={pre:z("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=Yl,Fn(e.display.measure)&&(a=At(o,e.doc.direction))&&(r.addToken=Zl(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&Ce(o);Vl(o,r,wo(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Ve(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Ve(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(bi(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(K){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 We(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Ve(r.pre.className,r.textClass||"")),r}function Xl(e){var t=c("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Yl(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?Jl(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,d;if(!s.test(t))e.col+=t.length,d=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,d),E&&X<9&&(u=!0),e.pos+=t.length;else{d=document.createDocumentFragment();for(var h=0;;){s.lastIndex=h;var b=s.exec(t),y=b?b.index-h:t.length-h;if(y){var k=document.createTextNode(l.slice(h,h+y));E&&X<9?d.appendChild(c("span",[k])):d.appendChild(k),e.map.push(e.pos,e.pos+y,k),e.col+=y,e.pos+=y}if(!b)break;h+=y+1;var C=void 0;if(b[0]=="	"){var A=e.cm.options.tabSize,H=A-e.col%A;C=d.appendChild(c("span",He(H),"cm-tab")),C.setAttribute("role","presentation"),C.setAttribute("cm-text","	"),e.col+=H}else b[0]=="\r"||b[0]==`
`?(C=d.appendChild(c("span",b[0]=="\r"?"␍":"␤","cm-invalidchar")),C.setAttribute("cm-text",b[0]),e.col+=1):(C=e.cm.options.specialCharPlaceholder(b[0]),C.setAttribute("cm-text",b[0]),E&&X<9?d.appendChild(c("span",[C])):d.appendChild(C),e.col+=1);e.map.push(e.pos,e.pos+1,C),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var B=n||"";r&&(B+=r),i&&(B+=i);var F=c("span",[d],B,o);if(a)for(var _ in a)a.hasOwnProperty(_)&&_!="style"&&_!="class"&&F.setAttribute(_,a[_]);return e.content.appendChild(F)}e.content.appendChild(d)}}function Jl(e,t){if(e.length>1&&!/  /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o=" "),r+=o,n=o==" "}return r}function Zl(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,d=u+r.length;;){for(var h=void 0,b=0;b<t.length&&(h=t[b],!(h.to>u&&h.from<=u));b++);if(h.to>=d)return e(n,r,i,o,a,l,s);e(n,r.slice(0,h.to-u),i,o,null,l,s),o=null,r=r.slice(h.to-u),u=h.to}}}function Ho(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Vl(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;a<n.length;a+=2)t.addToken(t,i.slice(o,o=n[a]),Eo(n[a+1],t.cm.options));return}for(var l=i.length,s=0,u=1,d="",h,b,y=0,k,C,A,H,B;;){if(y==s){k=C=A=b="",B=null,H=null,y=1/0;for(var F=[],_=void 0,$=0;$<r.length;++$){var J=r[$],de=J.marker;if(de.type=="bookmark"&&J.from==s&&de.widgetNode)F.push(de);else if(J.from<=s&&(J.to==null||J.to>s||de.collapsed&&J.to==s&&J.from==s)){if(J.to!=null&&J.to!=s&&y>J.to&&(y=J.to,C=""),de.className&&(k+=" "+de.className),de.css&&(b=(b?b+";":"")+de.css),de.startStyle&&J.from==s&&(A+=" "+de.startStyle),de.endStyle&&J.to==y&&(_||(_=[])).push(de.endStyle,J.to),de.title&&((B||(B={})).title=de.title),de.attributes)for(var Pe in de.attributes)(B||(B={}))[Pe]=de.attributes[Pe];de.collapsed&&(!H||Si(H.marker,de)<0)&&(H=J)}else J.from>s&&y>J.from&&(y=J.from)}if(_)for(var at=0;at<_.length;at+=2)_[at+1]==y&&(C+=" "+_[at]);if(!H||H.from==s)for(var _e=0;_e<F.length;++_e)Ho(t,0,F[_e]);if(H&&(H.from||0)==s){if(Ho(t,(H.to==null?l+1:H.to)-s,H.marker,H.from==null),H.to==null)return;H.to==s&&(H=!1)}}if(s>=l)break;for(var Lt=Math.min(l,y);;){if(d){var xt=s+d.length;if(!H){var Je=xt>Lt?d.slice(0,Lt-s):d;t.addToken(t,Je,h?h+k:k,A,s+Je.length==y?C:"",b,B)}if(xt>=Lt){d=d.slice(Lt-s),s=Lt;break}s=xt,A=""}d=i.slice(o,o=n[u++]),h=Eo(n[u++],t.cm.options)}}}function Fo(e,t,n){this.line=t,this.rest=Kl(t),this.size=this.rest?Ce(ie(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ur(e,t)}function Xn(e,t,n){for(var r=[],i,o=t;o<n;o=i){var a=new Fo(e.doc,G(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Er=null;function Ql(e){Er?Er.ops.push(e):e.ownsGroup=Er={ops:[e],delayedCallbacks:[]}}function $l(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 es(e,t){var n=e.ownsGroup;if(n)try{$l(n)}finally{Er=null,t(n)}}var sn=null;function nt(e,t){var n=en(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Er?i=Er.delayedCallbacks:sn?i=sn:(i=sn=[],setTimeout(ts,0));for(var o=function(l){i.push(function(){return n[l].apply(null,r)})},a=0;a<n.length;++a)o(a)}}function ts(){var e=sn;sn=null;for(var t=0;t<e.length;++t)e[t]()}function Io(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?ns(e,t):o=="gutter"?Ro(e,t,n,r):o=="class"?Mi(e,t):o=="widget"&&is(e,t,r)}t.changes=null}function un(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),E&&X<8&&(e.node.style.zIndex=2)),e.node}function rs(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=un(t);t.background=r.insertBefore(c("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Bo(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):zo(e,t)}function ns(e,t){var n=t.text.className,r=Bo(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,Mi(e,t)):n&&(t.text.className=n)}function Mi(e,t){rs(e,t),t.line.wrapClass?un(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ro(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=un(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=un(t),l=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(l.setAttribute("aria-hidden","true"),e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=l.appendChild(c("div",p(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,d=o.hasOwnProperty(u)&&o[u];d&&l.appendChild(c("div",[d],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function is(e,t,n){t.alignable&&(t.alignable=null);for(var r=v("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);_o(e,t,n)}function os(e,t,n,r){var i=Bo(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Mi(e,t),Ro(e,t,n,r),_o(e,t,r),t.node}function _o(e,t,n){if(Ko(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Ko(e,t.rest[r],t,n,!1)}function Ko(e,t,n,r,i){if(t.widgets)for(var o=un(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],u=c("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),as(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),nt(s,"redraw")}}function as(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function fn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!R(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;"),T(t.display.measure,c("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function er(e,t){for(var n=mt(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Yn(e){return e.lineSpace.offsetTop}function Ni(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function jo(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(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 Gt(e){return L-e.display.nativeBarWidth}function wr(e){return e.display.scroller.clientWidth-Gt(e)-e.display.barWidth}function Oi(e){return e.display.scroller.clientHeight-Gt(e)-e.display.barHeight}function ls(e,t,n){var r=e.options.lineWrapping,i=r&&wr(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],u=a[l+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Uo(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(Ce(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function ss(e,t){t=Et(t);var n=Ce(t),r=e.display.externalMeasured=new Fo(e.doc,t,n);r.lineN=n;var i=r.built=zo(e,r);return r.text=i.pre,T(e.display.lineMeasure,i.pre),r}function Go(e,t,n,r){return qt(e,zr(e,t),n,r)}function Ai(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Sr(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=Ce(t),r=Ai(e,n);r&&!r.text?r=null:r&&r.changes&&(Io(e,r,n,zi(e)),e.curOp.forceUpdate=!0),r||(r=ss(e,t));var i=Uo(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function qt(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||(ls(e,t.view,t.rect),t.hasHeights=!0),a=fs(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 qo={left:0,right:0,top:0,bottom:0};function Xo(e,t,n){for(var r,i,o,a,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],a="left";if(n=="right"&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function us(e,t){var n=qo;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 fs(e,t,n,r){var i=Xo(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,u;if(o.nodeType==3){for(var d=0;d<4;d++){for(;a&&$r(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l<i.coverEnd&&$r(t.line.text.charAt(i.coverStart+l));)++l;if(E&&X<9&&a==0&&l==i.coverEnd-i.coverStart?u=o.parentNode.getBoundingClientRect():u=us(M(o,a,l).getClientRects(),r),u.left||u.right||a==0)break;l=a,a=a-1,s="right"}E&&X<11&&(u=cs(e.display.measure,u))}else{a>0&&(s=r="right");var h;e.options.lineWrapping&&(h=o.getClientRects()).length>1?u=h[r=="right"?h.length-1:0]:u=o.getBoundingClientRect()}if(E&&X<9&&!a&&(!u||!u.left&&!u.right)){var b=o.parentNode.getClientRects()[0];b?u={left:b.left,right:b.left+Fr(e.display),top:b.top,bottom:b.bottom}:u=qo}for(var y=u.top-t.rect.top,k=u.bottom-t.rect.top,C=(y+k)/2,A=t.view.measure.heights,H=0;H<A.length-1&&!(C<A[H]);H++);var B=H?A[H-1]:0,F=A[H],_={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:B,bottom:F};return!u.left&&!u.right&&(_.bogus=!0),e.options.singleCursorHeightPerLine||(_.rtop=y,_.rbottom=k),_}function cs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!In(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Yo(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Jo(e){e.display.externalMeasure=null,m(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Yo(e.display.view[t])}function cn(e){Jo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Zo(e){return Z&&ee?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Vo(e){return Z&&ee?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Di(e){var t=Et(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=fn(n[i]));return r}function Jn(e,t,n,r,i){if(!i){var o=Di(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var a=$t(t);if(r=="local"?a+=Yn(e.display):a-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+(r=="window"?0:Vo(Me(e)));var s=l.left+(r=="window"?0:Zo(Me(e)));n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function Qo(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=Zo(Me(e)),i-=Vo(Me(e));else if(n=="local"||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Zn(e,t,n,r,i){return r||(r=G(e.doc,t.line)),Jn(e,r,Go(e,r,t.ch,i),n)}function zt(e,t,n,r,i,o){r=r||G(e.doc,t.line),i||(i=zr(e,r));function a(k,C){var A=qt(e,i,k,C?"right":"left",o);return C?A.left=A.right:A.right=A.left,Jn(e,r,A,n)}var l=At(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a(u=="before"?s-1:s,u=="before");function d(k,C,A){var H=l[C],B=H.level==1;return a(A?k-1:k,B!=A)}var h=Ot(l,s,u),b=Rt,y=d(s,h,u=="before");return b!=null&&(y.other=d(s,b,u!="before")),y}function $o(e,t){var n=0;t=ne(e.doc,t),e.options.lineWrapping||(n=Fr(e.display)*t.ch);var r=G(e.doc,t.line),i=$t(r)+Yn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Pi(e,t,n,r,i){var o=g(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Wi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Pi(r.first,0,null,-1,-1);var i=jt(r,n),o=r.first+r.size-1;if(i>o)return Pi(r.first+r.size-1,G(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=G(r,i);;){var l=ds(e,a,i,t,n),s=Rl(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=G(r,i=u.line)}}function ea(e,t,n,r){r-=Di(t);var i=t.text.length,o=je(function(a){return qt(e,n,a-1).bottom<=r},i,0);return i=je(function(a){return qt(e,n,a).top>r},o,i),{begin:o,end:i}}function ta(e,t,n,r){n||(n=zr(e,t));var i=Jn(e,t,qt(e,n,r),"line").top;return ea(e,t,n,i)}function Ei(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function ds(e,t,n,r,i){i-=$t(t);var o=zr(e,t),a=Di(t),l=0,s=t.text.length,u=!0,d=At(t,e.doc.direction);if(d){var h=(e.options.lineWrapping?ps:hs)(e,t,n,o,d,r,i);u=h.level!=1,l=u?h.from:h.to-1,s=u?h.to:h.from-1}var b=null,y=null,k=je(function($){var J=qt(e,o,$);return J.top+=a,J.bottom+=a,Ei(J,r,i,!1)?(J.top<=i&&J.left<=r&&(b=$,y=J),!0):!1},l,s),C,A,H=!1;if(y){var B=r-y.left<y.right-r,F=B==u;k=b+(F?0:1),A=F?"after":"before",C=B?y.left:y.right}else{!u&&(k==s||k==l)&&k++,A=k==0?"after":k==t.text.length?"before":qt(e,o,k-(u?1:0)).bottom+a<=i==u?"after":"before";var _=zt(e,g(n,k,A),"line",t,o);C=_.left,H=i<_.top?-1:i>=_.bottom?1:0}return k=Bt(t.text,k,1),Pi(n,k,A,H,r-C)}function hs(e,t,n,r,i,o,a){var l=je(function(h){var b=i[h],y=b.level!=1;return Ei(zt(e,g(n,y?b.to:b.from,y?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,d=zt(e,g(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Ei(d,o,a,!0)&&d.top>a&&(s=i[l-1])}return s}function ps(e,t,n,r,i,o,a){var l=ea(e,t,r,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var d=null,h=null,b=0;b<i.length;b++){var y=i[b];if(!(y.from>=u||y.to<=s)){var k=y.level!=1,C=qt(e,r,k?Math.min(u,y.to)-1:Math.max(s,y.from)).right,A=C<o?o-C+1e9:C-o;(!d||h>A)&&(d=y,h=A)}}return d||(d=i[i.length-1]),d.from<s&&(d={from:s,to:d.to,level:d.level}),d.to>u&&(d={from:d.from,to:u,level:d.level}),d}var xr;function Hr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(xr==null){xr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)xr.appendChild(document.createTextNode("x")),xr.appendChild(c("br"));xr.appendChild(document.createTextNode("x"))}T(e.measure,xr);var n=xr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),m(e.measure),n||1}function Fr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");T(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function zi(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:Hi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Hi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ra(e){var t=Hr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Fr(e.display)-3);return function(i){if(ur(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 Fi(e){var t=e.doc,n=ra(e);t.iter(function(r){var i=n(r);i!=r.height&&Pt(r,i)})}function kr(e,t,n,r){var i=e.display;if(!n&&mt(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(h){return null}var s=Wi(e,o,a),u;if(r&&s.xRel>0&&(u=G(e.doc,s.line).text).length==s.ch){var d=j(u,u.length,e.options.tabSize)-u.length;s=g(s.line,Math.max(0,Math.round((o-jo(e.display).left)/Fr(e.display))-d))}return s}function Sr(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 bt(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)Qt&&Ci(e.doc,t)<i.viewTo&&cr(e);else if(n<=i.viewFrom)Qt&&Wo(e.doc,n+r)>i.viewFrom?cr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)cr(e);else if(t<=i.viewFrom){var o=Vn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):cr(e)}else if(n>=i.viewTo){var a=Vn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):cr(e)}else{var l=Vn(e,t,t,-1),s=Vn(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Xn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):cr(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function fr(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[Sr(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);U(a,n)==-1&&a.push(n)}}}function cr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Vn(e,t,n,r){var i=Sr(e,t),o,a=e.display.view;if(!Qt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s<i;s++)l+=a[s].size;if(l!=t){if(r>0){if(i==a.length-1)return null;o=l+a[i].size-t,i++}else o=l-t;t+=o,n+=o}for(;Ci(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function vs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Xn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Xn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Sr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Xn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Sr(e,n)))),r.viewTo=n}function na(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function dn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ia(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var l=0;l<n.sel.ranges.length;l++)if(!(!t&&l==n.sel.primIndex)){var s=n.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(a){var d=a(e,s);d&&Ii(e,d,i)}else(u||e.options.showCursorWhenSelecting)&&Ii(e,s.head,i);u||gs(e,s,o)}}return r}function Ii(e,t,n){var r=zt(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=Zn(e,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(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 Qn(e,t){return e.top-t.top||e.left-t.left}function gs(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=jo(e.display),l=a.left,s=Math.max(r.sizerWidth,wr(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function d(F,_,$,J){_<0&&(_=0),_=Math.round(_),J=Math.round(J),o.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+F+`px;
                             top: `+_+"px; width: "+($==null?s-F:$)+`px;
                             height: `+(J-_)+"px"))}function h(F,_,$){var J=G(i,F),de=J.text.length,Pe,at;function _e(Je,kt){return Zn(e,g(F,Je),"div",J,kt)}function Lt(Je,kt,st){var $e=ta(e,J,null,Je),Ze=kt=="ltr"==(st=="after")?"left":"right",qe=st=="after"?$e.begin:$e.end-(/\s/.test(J.text.charAt($e.end-1))?2:1);return _e(qe,Ze)[Ze]}var xt=At(J,i.direction);return mr(xt,_||0,$==null?de:$,function(Je,kt,st,$e){var Ze=st=="ltr",qe=_e(Je,Ze?"left":"right"),St=_e(kt-1,Ze?"right":"left"),Zr=_==null&&Je==0,yr=$==null&&kt==de,ht=$e==0,Xt=!xt||$e==xt.length-1;if(St.top-qe.top<=3){var lt=(u?Zr:yr)&&ht,co=(u?yr:Zr)&&Xt,nr=lt?l:(Ze?qe:St).left,Nr=co?s:(Ze?St:qe).right;d(nr,qe.top,Nr-nr,qe.bottom)}else{var Or,yt,Vr,ho;Ze?(Or=u&&Zr&&ht?l:qe.left,yt=u?s:Lt(Je,st,"before"),Vr=u?l:Lt(kt,st,"after"),ho=u&&yr&&Xt?s:St.right):(Or=u?Lt(Je,st,"before"):l,yt=!u&&Zr&&ht?s:qe.right,Vr=!u&&yr&&Xt?l:St.left,ho=u?Lt(kt,st,"after"):s),d(Or,qe.top,yt-Or,qe.bottom),qe.bottom<St.top&&d(l,qe.bottom,null,St.top),d(Vr,St.top,ho-Vr,St.bottom)}(!Pe||Qn(qe,Pe)<0)&&(Pe=qe),Qn(St,Pe)<0&&(Pe=St),(!at||Qn(qe,at)<0)&&(at=qe),Qn(St,at)<0&&(at=St)}),{start:Pe,end:at}}var b=t.from(),y=t.to();if(b.line==y.line)h(b.line,b.ch,y.ch);else{var k=G(i,b.line),C=G(i,y.line),A=Et(k)==Et(C),H=h(b.line,b.ch,A?k.text.length+1:null).end,B=h(y.line,A?0:null,y.ch).start;A&&(H.top<B.top-2?(d(H.right,H.top,null,H.bottom),d(l,B.top,B.left,B.bottom)):d(H.right,H.top,B.left-H.right,H.bottom)),H.bottom<B.top&&d(l,H.bottom,null,B.top)}n.appendChild(o)}function Bi(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()||Ir(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function oa(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||_i(e))}function Ri(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Ir(e))},100)}function _i(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(We(e,"focus",e,t),e.state.focused=!0,ve(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),K&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Bi(e))}function Ir(e,t){e.state.delayingBlurEvent||(e.state.focused&&(We(e,"blur",e,t),e.state.focused=!1,N(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function $n(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a<t.view.length;a++){var l=t.view[a],s=e.options.lineWrapping,u=void 0,d=0;if(!l.hidden){if(i+=l.line.height,E&&X<8){var h=l.node.offsetTop+l.node.offsetHeight;u=h-n,n=h}else{var b=l.node.getBoundingClientRect();u=b.bottom-b.top,!s&&l.text.firstChild&&(d=l.text.firstChild.getBoundingClientRect().right-b.left-1)}var y=l.line.height-u;if((y>.005||y<-.005)&&(i<r&&(o-=y),Pt(l.line,u),aa(l.line),l.rest))for(var k=0;k<l.rest.length;k++)aa(l.rest[k]);if(d>e.display.sizerWidth){var C=Math.ceil(d/Fr(e.display));C>e.display.maxLineLength&&(e.display.maxLineLength=C,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function aa(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 ei(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Yn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=jt(t,r),a=jt(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=jt(t,$t(G(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=jt(t,$t(G(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function ys(e,t){if(!Ue(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&&!Ae){var a=c("div","​",null,`position: absolute;
                         top: `+(t.top-n.viewOffset-Yn(e.display))+`px;
                         height: `+(t.bottom-t.top+Gt(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 ms(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=zt(e,t),s=!n||n==t?l:zt(e,n);i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r};var u=Ki(e,i),d=e.doc.scrollTop,h=e.doc.scrollLeft;if(u.scrollTop!=null&&(pn(e,u.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(a=!0)),u.scrollLeft!=null&&(Cr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return i}function bs(e,t){var n=Ki(e,t);n.scrollTop!=null&&pn(e,n.scrollTop),n.scrollLeft!=null&&Cr(e,n.scrollLeft)}function Ki(e,t){var n=e.display,r=Hr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Oi(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Ni(n),s=t.top<r,u=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var d=Math.min(t.top,(u?l:t.bottom)-o);d!=i&&(a.scrollTop=d)}var h=e.options.fixedGutter?0:n.gutters.offsetWidth,b=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-h,y=wr(e)-n.gutters.offsetWidth,k=t.right-t.left>y;return k&&(t.right=t.left+y),t.left<10?a.scrollLeft=0:t.left<b?a.scrollLeft=Math.max(0,t.left+h-(k?0:10)):t.right>y+b-3&&(a.scrollLeft=t.right+(k?0:10)-y),a}function ji(e,t){t!=null&&(ti(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Br(e){ti(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function hn(e,t,n){(t!=null||n!=null)&&ti(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function ws(e,t){ti(e),e.curOp.scrollToPos=t}function ti(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=$o(e,t.from),r=$o(e,t.to);la(e,n,r,t.margin)}}function la(e,t,n,r){var i=Ki(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});hn(e,i.scrollLeft,i.scrollTop)}function pn(e,t){Math.abs(e.doc.scrollTop-t)<2||(q||Gi(e,{top:t}),sa(e,t,!0),q&&Gi(e),yn(e,100))}function sa(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 Cr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,ha(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function vn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ni(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+Gt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Tr=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),I(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),I(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,E&&X<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Tr.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}},Tr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Tr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Tr.prototype.zeroWidthHack=function(){var e=me&&!Ie?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new V,this.disableVert=new V},Tr.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)},Tr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gn=function(){};gn.prototype.update=function(){return{bottom:0,right:0}},gn.prototype.setScrollLeft=function(){},gn.prototype.setScrollTop=function(){},gn.prototype.clear=function(){};function Rr(e,t){t||(t=vn(e));var n=e.display.barWidth,r=e.display.barHeight;ua(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&$n(e),ua(e,vn(e)),n=e.display.barWidth,r=e.display.barHeight}function ua(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 fa={native:Tr,null:gn};function ca(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new fa[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),I(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"?Cr(e,t):pn(e,t)},e),e.display.scrollbars.addClass&&ve(e.display.wrapper,e.display.scrollbars.addClass)}var xs=0;function Lr(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:++xs,markArrays:null},Ql(e.curOp)}function Mr(e){var t=e.curOp;t&&es(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;ks(n)})}function ks(e){for(var t=e.ops,n=0;n<t.length;n++)Ss(t[n]);for(var r=0;r<t.length;r++)Cs(t[r]);for(var i=0;i<t.length;i++)Ts(t[i]);for(var o=0;o<t.length;o++)Ls(t[o]);for(var a=0;a<t.length;a++)Ms(t[a])}function Ss(e){var t=e.cm,n=t.display;Os(t),e.updateMaxLine&&Li(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ri(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Cs(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function Ts(e){var t=e.cm,n=t.display;e.updatedDisplay&&$n(t),e.barMeasure=vn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Go(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+Gt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-wr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ls(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Cr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==le(Me(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Rr(t,e.barMeasure),e.updatedDisplay&&Xi(t,e.barMeasure),e.selectionChanged&&Bi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&oa(e.cm)}function Ms(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&da(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&sa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Cr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=ms(t,ne(r,e.scrollToPos.from),ne(r,e.scrollToPos.to),e.scrollToPos.margin);ys(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||We(o[l],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&We(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&We(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Tt(e,t){if(e.curOp)return t();Lr(e);try{return t()}finally{Mr(e)}}function it(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Lr(e);try{return t.apply(e,arguments)}finally{Mr(e)}}}function gt(e){return function(){if(this.curOp)return e.apply(this,arguments);Lr(this);try{return e.apply(this,arguments)}finally{Mr(this)}}}function ot(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Lr(t);try{return e.apply(this,arguments)}finally{Mr(t)}}}function yn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,De(Ns,e))}function Ns(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=an(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Zt(t.mode,r.state):null,s=bo(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var u=o.styleClasses,d=s.classes;d?o.styleClasses=d:u&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||u!=d&&(!u||!d||u.bgClass!=d.bgClass||u.textClass!=d.textClass),b=0;!h&&b<a.length;++b)h=a[b]!=o.styles[b];h&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&wi(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return yn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Tt(e,function(){for(var o=0;o<i.length;o++)fr(e,i[o],"text")})}}var ri=function(e,t,n){var r=e.display;this.viewport=t,this.visible=ei(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=wr(e),this.force=n,this.dims=zi(e),this.events=[]};ri.prototype.signal=function(e,t){pt(e,t)&&this.events.push(arguments)},ri.prototype.finish=function(){for(var e=0;e<this.events.length;e++)We.apply(null,this.events[e])};function Os(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Gt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Gt(e)+"px",t.scrollbarsClipped=!0)}function As(e){if(e.hasFocus())return null;var t=le(Me(e));if(!t||!R(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=tt(e).getSelection();r.anchorNode&&r.extend&&R(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Ds(e){if(!(!e||!e.activeElt||e.activeElt==le(e.activeElt.ownerDocument))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&R(document.body,e.anchorNode)&&R(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Ui(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return cr(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&&na(e)==0)return!1;pa(e)&&(cr(e),t.dims=zi(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)),Qt&&(o=Ci(e.doc,o),a=Wo(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;vs(e,o,a),n.viewOffset=$t(G(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=na(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=As(e);return s>4&&(n.lineDiv.style.display="none"),Ps(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ds(u),m(n.cursorDiv),m(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,yn(e,400)),n.updateLineNumbers=null,!0}function da(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==wr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Ni(e.display)-Oi(e),n.top)}),t.visible=ei(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ei(e.display,e.doc,n));if(!Ui(e,t))break;$n(e);var i=vn(e);dn(e),Rr(e,i),Xi(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 Gi(e,t){var n=new ri(e,t);if(Ui(e,n)){$n(e),da(e,n);var r=vn(e);dn(e),Rr(e,r),Xi(e,r),n.finish()}}function Ps(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(k){var C=k.nextSibling;return K&&me&&e.display.currentWheelTarget==k?k.style.display="none":k.parentNode.removeChild(k),C}for(var s=r.view,u=r.viewFrom,d=0;d<s.length;d++){var h=s[d];if(!h.hidden)if(!h.node||h.node.parentNode!=o){var b=os(e,h,u,n);o.insertBefore(b,a)}else{for(;a!=h.node;)a=l(a);var y=i&&t!=null&&t<=u&&h.lineNumber;h.changes&&(U(h.changes,"gutter")>-1&&(y=!1),Io(e,h,u,n)),y&&(m(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(p(e.options,u)))),a=h.node.nextSibling}u+=h.size}for(;a;)a=l(a)}function qi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",nt(e,"gutterChanged",e)}function Xi(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+Gt(e)+"px"}function ha(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Hi(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 pa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=p(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(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",qi(e.display),!0}return!1}function Yi(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 va(e){var t=e.gutters,n=e.gutterSpecs;m(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",qi(e)}function mn(e){va(e.display),bt(e),ha(e)}function Ws(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=z("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=z("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=z("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: "+L+"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"),Z&&pe>=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),E&&X<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!K&&!(q&&fe)&&(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=Yi(r.gutters,r.lineNumbers),va(i),n.init(i)}var ni=0,tr=null;E?tr=-.53:q?tr=15:Z?tr=-.7:ze&&(tr=-1/3);function ga(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 Es(e){var t=ga(e);return t.x*=tr,t.y*=tr,t}function ya(e,t){Z&&pe==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=ga(t),r=n.x,i=n.y,o=tr;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(r&&s||i&&u){if(i&&me&&K){e:for(var d=t.target,h=a.view;d!=l;d=d.parentNode)for(var b=0;b<h.length;b++)if(h[b].node==d){e.display.currentWheelTarget=d;break e}}if(r&&!q&&!he&&o!=null){i&&u&&pn(e,Math.max(0,l.scrollTop+i*o)),Cr(e,Math.max(0,l.scrollLeft+r*o)),(!i||i&&u)&&ct(t),a.wheelStartX=null;return}if(i&&o!=null){var y=i*o,k=e.doc.scrollTop,C=k+a.wrapper.clientHeight;y<0?k=Math.max(0,k+y-50):C=Math.min(e.doc.height,C+y+50),Gi(e,{top:k,bottom:C})}ni<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 A=l.scrollLeft-a.wheelStartX,H=l.scrollTop-a.wheelStartY,B=H&&a.wheelDY&&H/a.wheelDY||A&&a.wheelDX&&A/a.wheelDX;a.wheelStartX=a.wheelStartY=null,B&&(tr=(tr*ni+B)/(ni+1),++ni)}},200)):(a.wheelDX+=r,a.wheelDY+=i))}}var Nt=function(e,t){this.ranges=e,this.primIndex=t};Nt.prototype.primary=function(){return this.ranges[this.primIndex]},Nt.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(!re(n.anchor,r.anchor)||!re(n.head,r.head))return!1}return!0},Nt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Te(ge(this.ranges[t].anchor),ge(this.ranges[t].head));return new Nt(e,this.primIndex)},Nt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Nt.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(x(t,r.from())>=0&&x(e,r.to())<=0)return n}return-1};var Te=function(e,t){this.anchor=e,this.head=t};Te.prototype.from=function(){return Qe(this.anchor,this.head)},Te.prototype.to=function(){return ke(this.anchor,this.head)},Te.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ht(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(b,y){return x(b.from(),y.from())}),n=U(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=x(l.to(),a.from());if(r&&!a.empty()?s>0:s>=0){var u=Qe(l.from(),a.from()),d=ke(l.to(),a.to()),h=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new Te(h?d:u,h?u:d))}}return new Nt(t,n)}function dr(e,t){return new Nt([new Te(e,t||e)],0)}function hr(e){return e.text?g(e.from.line+e.text.length-1,ie(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ma(e,t){if(x(e,t.from)<0)return e;if(x(e,t.to)<=0)return hr(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+=hr(t).ch-t.to.ch),g(n,r)}function Ji(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Te(ma(i.anchor,t),ma(i.head,t)))}return Ht(e.cm,n,e.sel.primIndex)}function ba(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 zs(e,t,n){for(var r=[],i=g(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=ba(l.from,i,o),u=ba(hr(l),i,o);if(i=l.to,o=u,n=="around"){var d=e.sel.ranges[a],h=x(d.head,d.anchor)<0;r[a]=new Te(h?u:s,h?s:u)}else r[a]=new Te(s,s)}return new Nt(r,e.sel.primIndex)}function Zi(e){e.doc.mode=Jt(e.options,e.doc.modeOption),bn(e)}function bn(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,yn(e,100),e.state.modeGen++,e.curOp&&bt(e)}function wa(e,t){return t.from.ch==0&&t.to.ch==0&&ie(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Vi(e,t,n,r){function i(B){return n?n[B]:null}function o(B,F,_){jl(B,F,_,r),nt(B,"change",B,t)}function a(B,F){for(var _=[],$=B;$<F;++$)_.push(new Wr(u[$],i($),r));return _}var l=t.from,s=t.to,u=t.text,d=G(e,l.line),h=G(e,s.line),b=ie(u),y=i(u.length-1),k=s.line-l.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(wa(e,t)){var C=a(0,u.length-1);o(h,h.text,y),k&&e.remove(l.line,k),C.length&&e.insert(l.line,C)}else if(d==h)if(u.length==1)o(d,d.text.slice(0,l.ch)+b+d.text.slice(s.ch),y);else{var A=a(1,u.length-1);A.push(new Wr(b+d.text.slice(s.ch),y,r)),o(d,d.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,A)}else if(u.length==1)o(d,d.text.slice(0,l.ch)+u[0]+h.text.slice(s.ch),i(0)),e.remove(l.line+1,k);else{o(d,d.text.slice(0,l.ch)+u[0],i(0)),o(h,b+h.text.slice(s.ch),y);var H=a(1,u.length-1);k>1&&e.remove(l.line+1,k-1),e.insert(l.line+1,H)}nt(e,"change",e,t)}function pr(e,t,n){function r(i,o,a){if(i.linked)for(var l=0;l<i.linked.length;++l){var s=i.linked[l];if(s.doc!=o){var u=a&&s.sharedHist;n&&!u||(t(s.doc,u),r(s.doc,i,u))}}}r(e,null,!0)}function xa(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Fi(e),Zi(e),ka(e),e.options.direction=t.direction,e.options.lineWrapping||Li(e),e.options.mode=t.modeOption,bt(e)}function ka(e){(e.doc.direction=="rtl"?ve:N)(e.display.lineDiv,"CodeMirror-rtl")}function Hs(e){Tt(e,function(){ka(e),bt(e)})}function ii(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 Qi(e,t){var n={from:ge(t.from),to:hr(t),text:Vt(e,t.from,t.to)};return Ta(e,n,t.from.line,t.to.line+1),pr(e,function(r){return Ta(r,n,t.from.line,t.to.line+1)},!0),n}function Sa(e){for(;e.length;){var t=ie(e);if(t.ranges)e.pop();else break}}function Fs(e,t){if(t)return Sa(e.done),ie(e.done);if(e.done.length&&!ie(e.done).ranges)return ie(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ie(e.done)}function Ca(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=Fs(i,i.lastOp==r)))l=ie(a.changes),x(t.from,t.to)==0&&x(t.from,l.to)==0?l.to=hr(t):a.changes.push(Qi(e,t));else{var s=ie(i.done);for((!s||!s.ranges)&&oi(e.sel,i.done),a={changes:[Qi(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||We(e,"historyAdded")}function Is(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 Bs(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||Is(e,o,ie(i.done),t))?i.done[i.done.length-1]=t:oi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&Sa(i.undone)}function oi(e,t){var n=ie(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ta(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 Rs(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 _s(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Rs(n[i]));return r}function La(e,t){var n=_s(e,t),r=ki(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function _r(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?Nt.prototype.deepCopy.call(o):o);continue}var a=o.changes,l=[];r.push({changes:l});for(var s=0;s<a.length;++s){var u=a[s],d=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(d=h.match(/^spans_(\d+)$/))&&U(t,Number(d[1]))>-1&&(ie(l)[h]=u[h],delete u[h])}}return r}function $i(e,t,n,r){if(r){var i=e.anchor;if(n){var o=x(t,i)<0;o!=x(n,i)<0?(i=t,t=n):o!=x(t,n)<0&&(t=n)}return new Te(i,t)}else return new Te(n||t,t)}function ai(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),dt(e,new Nt([$i(e.sel.primary(),t,n,i)],0),r)}function Ma(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]=$i(e.sel.ranges[o],t[o],null,i);var a=Ht(e.cm,r,e.sel.primIndex);dt(e,a,n)}function eo(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,dt(e,Ht(e.cm,i,e.sel.primIndex),r)}function Na(e,t,n,r){dt(e,dr(t,n),r)}function Ks(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 Te(ne(e,i[o].anchor),ne(e,i[o].head))},origin:n&&n.origin};return We(e,"beforeSelectionChange",e,r),e.cm&&We(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ht(e.cm,r.ranges,r.ranges.length-1):t}function Oa(e,t,n){var r=e.history.done,i=ie(r);i&&i.ranges?(r[r.length-1]=t,li(e,t,n)):dt(e,t,n)}function dt(e,t,n){li(e,t,n),Bs(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function li(e,t,n){(pt(e,"beforeSelectionChange")||e.cm&&pt(e.cm,"beforeSelectionChange"))&&(t=Ks(e,t,n));var r=n&&n.bias||(x(t.primary().head,e.sel.primary().head)<0?-1:1);Aa(e,Pa(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Br(e.cm)}function Aa(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Hn(e.cm)),nt(e,"cursorActivity",e))}function Da(e){Aa(e,Pa(e,e.sel,null,!1))}function Pa(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=si(e,a.anchor,l&&l.anchor,n,r),u=a.head==a.anchor?s:si(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Te(s,u))}return i?Ht(e.cm,i,t.primIndex):t}function Kr(e,t,n,r,i){var o=G(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,d="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(u?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(d?l.to>=t.ch:l.to>t.ch))){if(i&&(We(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var h=s.find(r<0?1:-1),b=void 0;if((r<0?d:u)&&(h=Wa(e,h,-r,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(b=x(h,n))&&(r<0?b<0:b>0))return Kr(e,h,t,r,i)}var y=s.find(r<0?-1:1);return(r<0?u:d)&&(y=Wa(e,y,r,y.line==t.line?o:null)),y?Kr(e,y,t,r,i):null}}return t}function si(e,t,n,r,i){var o=r||1,a=Kr(e,t,n,o,i)||!i&&Kr(e,t,n,o,!0)||Kr(e,t,n,-o,i)||!i&&Kr(e,t,n,-o,!0);return a||(e.cantEdit=!0,g(e.first,0))}function Wa(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ne(e,g(t.line-1)):null:n>0&&t.ch==(r||G(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 Ea(e){e.setSelection(g(e.firstLine(),0),g(e.lastLine()),Q)}function za(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=ne(e,i)),o&&(r.to=ne(e,o)),a&&(r.text=a),l!==void 0&&(r.origin=l)}),We(e,"beforeChange",e,r),e.cm&&We(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 jr(e,t,n){if(e.cm){if(!e.cm.curOp)return it(e.cm,jr)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((pt(e,"beforeChange")||e.cm&&pt(e.cm,"beforeChange"))&&(t=za(e,t,!0),!t))){var r=Lo&&!n&&Bl(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Ha(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Ha(e,t)}}function Ha(e,t){if(!(t.text.length==1&&t.text[0]==""&&x(t.from,t.to)==0)){var n=Ji(e,t);Ca(e,t,n,e.cm?e.cm.curOp.id:NaN),wn(e,t,n,ki(e,t));var r=[];pr(e,function(i,o){!o&&U(r,i.history)==-1&&(Ra(i.history,t),r.push(i.history)),wn(i,t,null,ki(i,t))})}}function ui(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,a=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u<l.length&&(o=l[u],!(n?o.ranges&&!o.equals(e.sel):!o.ranges));u++);if(u!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=l.pop(),o.ranges){if(oi(o,s),n&&!o.equals(e.sel)){dt(e,o,{clearRedo:!1});return}a=o}else if(r){l.push(o);return}else break;var d=[];oi(a,s),s.push({changes:d,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var h=pt(e,"beforeChange")||e.cm&&pt(e.cm,"beforeChange"),b=function(C){var A=o.changes[C];if(A.origin=t,h&&!za(e,A,!1))return l.length=0,{};d.push(Qi(e,A));var H=C?Ji(e,A):ie(l);wn(e,A,H,La(e,A)),!C&&e.cm&&e.cm.scrollIntoView({from:A.from,to:hr(A)});var B=[];pr(e,function(F,_){!_&&U(B,F.history)==-1&&(Ra(F.history,A),B.push(F.history)),wn(F,A,null,La(F,A))})},y=o.changes.length-1;y>=0;--y){var k=b(y);if(k)return k.v}}}}function Fa(e,t){if(t!=0&&(e.first+=t,e.sel=new Nt(Re(e.sel.ranges,function(i){return new Te(g(i.anchor.line+t,i.anchor.ch),g(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){bt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)fr(e.cm,r,"gutter")}}function wn(e,t,n,r){if(e.cm&&!e.cm.curOp)return it(e.cm,wn)(e,t,n,r);if(t.to.line<e.first){Fa(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Fa(e,i),t={from:g(e.first,0),to:g(t.to.line+i,t.to.ch),text:[ie(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:g(o,G(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Vt(e,t.from,t.to),n||(n=Ji(e,t)),e.cm?js(e.cm,t,r):Vi(e,t,r),li(e,n,Q),e.cantEdit&&si(e,g(e.firstLine(),0))&&(e.cantEdit=!1)}}function js(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=Ce(Et(G(r,o.line))),r.iter(s,a.line+1,function(y){if(y==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Hn(e),Vi(r,t,n,ra(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(y){var k=qn(y);k>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=k,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Pl(r,o.line),yn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?bt(e):o.line==a.line&&t.text.length==1&&!wa(e.doc,t)?fr(e,o.line,"text"):bt(e,o.line,a.line+1,u);var d=pt(e,"changes"),h=pt(e,"change");if(h||d){var b={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};h&&nt(e,"change",e,b),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(b)}e.display.selForContextMenu=null}function Ur(e,t,n,r,i){var o;r||(r=n),x(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),jr(e,{from:n,to:r,text:t,origin:i})}function Ia(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ba(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++)Ia(o.ranges[l].anchor,t,n,r),Ia(o.ranges[l].head,t,n,r);continue}for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(n<u.from.line)u.from=g(u.from.line+r,u.from.ch),u.to=g(u.to.line+r,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}function Ra(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Ba(e.done,n,r,i),Ba(e.undone,n,r,i)}function xn(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=G(e,Mt(e,t)):i=Ce(t),i==null?null:(r(o,i)&&e.cm&&fr(e.cm,i,n),o)}function kn(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}kn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Ul(i),nt(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 Sn(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}Sn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof kn))){var l=[];this.collapse(l),this.children=[new kn(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new kn(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Sn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=U(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new Sn(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 Cn=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Cn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Ce(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=fn(this);Pt(n,Math.max(0,n.height-o)),e&&(Tt(e,function(){_a(e,n,-o),fr(e,r,"widget")}),nt(e,"lineWidgetCleared",e,this,r))}},Cn.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=fn(this)-t;i&&(ur(this.doc,r)||Pt(r,r.height+i),n&&Tt(n,function(){n.curOp.forceUpdate=!0,_a(n,r,i),nt(n,"lineWidgetChanged",n,e,Ce(r))}))},vt(Cn);function _a(e,t,n){$t(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ji(e,n)}function Us(e,t,n,r){var i=new Cn(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),xn(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&&!ur(e,a)){var s=$t(a)<e.scrollTop;Pt(a,a.height+fn(i)),s&&ji(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&nt(o,"lineWidgetAdded",o,i,typeof t=="number"?t:Ce(t)),i}var Ka=0,vr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ka};vr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Lr(e),pt(this,"clear")){var n=this.find();n&&nt(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=ln(a.markedSpans,this);e&&!this.collapsed?fr(e,Ce(a),"text"):e&&(l.to!=null&&(i=Ce(a)),l.from!=null&&(r=Ce(a))),a.markedSpans=zl(a.markedSpans,l),l.from==null&&this.collapsed&&!ur(this.doc,a)&&e&&Pt(a,Hr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=Et(this.lines[s]),d=qn(u);d>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=d,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&bt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Da(e.doc)),e&&nt(e,"markerCleared",e,this,r,i),t&&Mr(e),this.parent&&this.parent.clear()}},vr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=ln(o.markedSpans,this);if(a.from!=null&&(n=g(t?o:Ce(o),a.from),e==-1))return n;if(a.to!=null&&(r=g(t?o:Ce(o),a.to),e==1))return r}return n&&{from:n,to:r}},vr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||Tt(r,function(){var i=t.line,o=Ce(t.line),a=Ai(r,o);if(a&&(Yo(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!ur(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=fn(n)-l;s&&Pt(i,i.height+s)}nt(r,"markerChanged",r,e)})},vr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||U(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},vr.prototype.detachLine=function(e){if(this.lines.splice(U(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},vt(vr);function Gr(e,t,n,r,i){if(r&&r.shared)return Gs(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return it(e.cm,Gr)(e,t,n,r,i);var o=new vr(e,i),a=x(t,n);if(r&&Y(r,o,!1),a>0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=z("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Po(e,t.line,t,n,o)||t.line!=n.line&&Po(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");El()}o.addToHistory&&Ca(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,n.line+1,function(h){s&&o.collapsed&&!s.options.lineWrapping&&Et(h)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&Pt(h,0),Hl(h,new Kn(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(h){ur(e,h)&&Pt(h,0)}),o.clearOnEnter&&I(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Wl(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Ka,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)bt(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var d=t.line;d<=n.line;d++)fr(s,d,"text");o.atomic&&Da(s.doc),nt(s,"markerAdded",s,o)}return o}var Tn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Tn.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();nt(this,"clear")}},Tn.prototype.find=function(e,t){return this.primary.find(e,t)},vt(Tn);function Gs(e,t,n,r,i){r=Y(r),r.shared=!1;var o=[Gr(e,t,n,r,i)],a=o[0],l=r.widgetNode;return pr(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Gr(s,ne(s,t),ne(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;a=ie(o)}),new Tn(o,a)}function ja(e){return e.findMarks(g(e.first,0),e.clipPos(g(e.lastLine())),function(t){return t.parent})}function qs(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(x(o,a)){var l=Gr(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Xs(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];pr(i.primary.doc,function(s){return o.push(s)});for(var a=0;a<i.markers.length;a++){var l=i.markers[a];U(o,l.doc)==-1&&(l.parent=null,i.markers.splice(a--,1))}},n=0;n<e.length;n++)t(n)}var Ys=0,wt=function(e,t,n,r,i){if(!(this instanceof wt))return new wt(e,t,n,r,i);n==null&&(n=0),Sn.call(this,[new kn([new Wr("",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=dr(o),this.history=new ii(null),this.id=++Ys,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Vi(this,{from:o,to:o,text:e}),dt(this,dr(o),Q)};wt.prototype=w(Sn.prototype,{constructor:wt,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=Pr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ot(function(e){var t=g(this.first,0),n=this.first+this.size-1;jr(this,{from:t,to:g(n,G(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&hn(this.cm,0,0),dt(this,dr(t),Q)}),replaceRange:function(e,t,n,r){t=ne(this,t),n=n?ne(this,n):t,Ur(this,e,t,n,r)},getRange:function(e,t,n){var r=Vt(this,ne(this,e),ne(this,t));return n===!1?r:n===""?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(f(this,e))return G(this,e)},getLineNumber:function(e){return Ce(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=G(this,e)),Et(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ne(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:ot(function(e,t,n){Na(this,ne(this,typeof e=="number"?g(e,t||0):e),null,n)}),setSelection:ot(function(e,t,n){Na(this,ne(this,e),ne(this,t||e),n)}),extendSelection:ot(function(e,t,n){ai(this,ne(this,e),t&&ne(this,t),n)}),extendSelections:ot(function(e,t){Ma(this,mo(this,e),t)}),extendSelectionsBy:ot(function(e,t){var n=Re(this.sel.ranges,e);Ma(this,mo(this,n),t)}),setSelections:ot(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Te(ne(this,e[i].anchor),ne(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),dt(this,Ht(this.cm,r,t),n)}}),addSelection:ot(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Te(ne(this,e),ne(this,t||e))),dt(this,Ht(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=Vt(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=Vt(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:ot(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"&&zs(this,r,t),s=r.length-1;s>=0;s--)jr(this,r[s]);l?Oa(this,l):this.cm&&Br(this.cm)}),undo:ot(function(){ui(this,"undo")}),redo:ot(function(){ui(this,"redo")}),undoSelection:ot(function(){ui(this,"undo",!0)}),redoSelection:ot(function(){ui(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 ii(this.history),pr(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:_r(this.history.done),undone:_r(this.history.undone)}},setHistory:function(e){var t=this.history=new ii(this.history);t.done=_r(e.done.slice(0),null,!0),t.undone=_r(e.undone.slice(0),null,!0)},setGutterMarker:ot(function(e,t,n){return xn(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&rt(i)&&(r.gutterMarkers=null),!0})}),clearGutter:ot(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&xn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,rt(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!f(this,e)||(t=e,e=G(this,e),!e))return null}else if(t=Ce(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:ot(function(e,t,n){return xn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(v(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:ot(function(e,t,n){return xn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[i];if(o)if(n==null)r[i]=null;else{var a=o.match(v(n));if(!a)return!1;var l=a.index+a[0].length;r[i]=o.slice(0,a.index)+(!a.index||l==o.length?"":" ")+o.slice(l)||null}else return!1;return!0})}),addLineWidget:ot(function(e,t,n){return Us(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Gr(this,ne(this,e),ne(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=ne(this,e),Gr(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ne(this,e);var t=[],n=G(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=ne(this,e),t=ne(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}),ne(this,g(n,t))},indexFromPos:function(e){e=ne(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 wt(Pr(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 wt(Pr(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],qs(r,ja(this)),r},unlinkDoc:function(e){if(e instanceof Be&&(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),Xs(ja(this));break}}if(e.history==this.history){var r=[e.id];pr(e,function(i){return r.push(i.id)},!0),e.history=new ii(null),e.history.done=_r(this.history.done,r),e.history.undone=_r(this.history.undone,r)}},iterLinkedDocs:function(e){pr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):nn(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:ot(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Hs(this.cm))})}),wt.prototype.eachLine=wt.prototype.iter;var Ua=0;function Js(e){var t=this;if(Ga(t),!(Ue(t,e)||er(t.display,e))){ct(e),E&&(Ua=+new Date);var n=kr(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&&it(t,function(){n=ne(t.doc,n);var y={from:n,to:n,text:t.doc.splitLines(o.filter(function(k){return k!=null}).join(t.doc.lineSeparator())),origin:"paste"};jr(t.doc,y),Oa(t.doc,dr(ne(t.doc,n),ne(t.doc,hr(y))))})()},s=function(y,k){if(t.options.allowDropFileTypes&&U(t.options.allowDropFileTypes,y.type)==-1){l();return}var C=new FileReader;C.onerror=function(){return l()},C.onload=function(){var A=C.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(A)){l();return}o[k]=A,l()},C.readAsText(y)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var d=e.dataTransfer.getData("Text");if(d){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),li(t.doc,dr(n,n)),h)for(var b=0;b<h.length;++b)Ur(t.doc,"",h[b].anchor,h[b].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(y){}}}}function Zs(e,t){if(E&&(!e.state.draggingText||+new Date-Ua<100)){Yt(t);return}if(!(Ue(e,t)||er(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ze)){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",he&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),he&&n.parentNode.removeChild(n)}}function Vs(e,t){var n=kr(e,t);if(n){var r=document.createDocumentFragment();Ii(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)),T(e.display.dragCursor,r)}}function Ga(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function qa(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}}var Xa=!1;function Qs(){Xa||($s(),Xa=!0)}function $s(){var e;I(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,qa(eu)},100))}),I(window,"blur",function(){return qa(Ir)})}function eu(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var gr={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"},Ln=0;Ln<10;Ln++)gr[Ln+48]=gr[Ln+96]=String(Ln);for(var fi=65;fi<=90;fi++)gr[fi]=String.fromCharCode(fi);for(var Mn=1;Mn<=12;Mn++)gr[Mn+111]=gr[Mn+63235]="F"+Mn;var rr={};rr.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"},rr.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"},rr.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"},rr.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"]},rr.default=me?rr.macDefault:rr.pcDefault;function tu(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 ru(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=Re(n.split(" "),tu),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(!s)t[l]=a;else if(s!=a)throw new Error("Inconsistent bindings for "+l)}delete e[n]}for(var u in t)e[u]=t[u];return e}function qr(e,t,n,r){t=ci(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 qr(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=qr(e,t.fallthrough[o],n,r);if(a)return a}}}function Ya(e){var t=typeof e=="string"?e:gr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ja(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(be?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(be?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Za(e,t){if(he&&e.keyCode==34&&e.char)return!1;var n=gr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Ja(n,e,t))}function ci(e){return typeof e=="string"?rr[e]:e}function Xr(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&x(o.from,ie(r).to)<=0;){var a=r.pop();if(x(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Tt(e,function(){for(var l=r.length-1;l>=0;l--)Ur(e.doc,"",r[l].from,r[l].to,"+delete");Br(e)})}function to(e,t,n){var r=Bt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ro(e,t,n){var r=to(e,t.ch,n);return r==null?null:new g(t.line,r,n<0?"after":"before")}function no(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=At(n,t.doc.direction);if(o){var a=i<0?ie(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var d=zr(t,n);u=i<0?n.text.length-1:0;var h=qt(t,d,u).top;u=je(function(b){return qt(t,d,b).top==h},i<0==(a.level==1)?a.from:a.to-1,u),s=="before"&&(u=to(n,u,1))}else u=i<0?a.to:a.from;return new g(r,u,s)}}return new g(r,i<0?n.text.length:0,i<0?"before":"after")}function nu(e,t,n,r){var i=At(t,e.doc.direction);if(!i)return ro(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=Ot(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 ro(t,n,r);var l=function(H,B){return to(t,H instanceof g?H.ch:H,B)},s,u=function(H){return e.options.lineWrapping?(s=s||zr(e,t),ta(e,t,s,H)):{begin:0,end:t.text.length}},d=u(n.sticky=="before"?l(n,-1):n.ch);if(e.doc.direction=="rtl"||a.level==1){var h=a.level==1==r<0,b=l(n,h?1:-1);if(b!=null&&(h?b<=a.to&&b<=d.end:b>=a.from&&b>=d.begin)){var y=h?"before":"after";return new g(n.line,b,y)}}var k=function(H,B,F){for(var _=function(Pe,at){return at?new g(n.line,l(Pe,1),"before"):new g(n.line,Pe,"after")};H>=0&&H<i.length;H+=B){var $=i[H],J=B>0==($.level!=1),de=J?F.begin:l(F.end,-1);if($.from<=de&&de<$.to||(de=J?$.from:l($.to,-1),F.begin<=de&&de<F.end))return _(de,J)}},C=k(o+r,r,d);if(C)return C;var A=r>0?d.end:l(d.begin,-1);return A!=null&&!(r>0&&A==t.text.length)&&(C=k(r>0?0:i.length-1,r,u(A)),C)?C:null}var Nn={selectAll:Ea,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Q)},killLine:function(e){return Xr(e,function(t){if(t.empty()){var n=G(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 Xr(e,function(t){return{from:g(t.from().line,0),to:ne(e.doc,g(t.to().line+1,0))}})},delLineLeft:function(e){return Xr(e,function(t){return{from:g(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Xr(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 Xr(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 Va(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Qa(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return iu(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")},Oe)},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")},Oe)},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/)?Qa(e,t.head):r},Oe)},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=j(e.getLine(o.line),o.ch,r);t.push(He(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Tt(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=G(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=G(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 Te(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Tt(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);Br(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Va(e,t){var n=G(e.doc,t),r=Et(n);return r!=n&&(t=Ce(r)),no(!0,e,r,t,1)}function iu(e,t){var n=G(e.doc,t),r=_l(n);return r!=n&&(t=Ce(r)),no(!0,e,n,t,-1)}function Qa(e,t){var n=Va(e,t.line),r=G(e.doc,n.line),i=At(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 di(e,t,n){if(typeof t=="string"&&(t=Nn[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)!=P}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function ou(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=qr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&qr(t,e.options.extraKeys,n,e)||qr(t,e.options.keyMap,n,e)}var au=new V;function On(e,t,n,r){var i=e.state.keySeq;if(i){if(Ya(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:au.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),$a(e,i+" "+t,n,r))return!0}return $a(e,t,n,r)}function $a(e,t,n,r){var i=ou(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&nt(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(ct(n),Bi(e)),!!i}function el(e,t){var n=Za(t,!0);return n?t.shiftKey&&!e.state.keySeq?On(e,"Shift-"+n,t,function(r){return di(e,r,!0)})||On(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return di(e,r)}):On(e,n,t,function(r){return di(e,r)}):!1}function lu(e,t,n){return On(e,"'"+n+"'",t,function(r){return di(e,r,!0)})}var io=null;function tl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=le(Me(t)),!Ue(t,e))){E&&X<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=el(t,e);he&&(io=r?n:null,!r&&n==88&&!_t&&(me?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),q&&!me&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&su(t)}}function su(e){var t=e.display.lineDiv;ve(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(N(t,"CodeMirror-crosshair"),ft(document,"keyup",n),ft(document,"mouseover",n))}I(document,"keyup",n),I(document,"mouseover",n)}function rl(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ue(this,e)}function nl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(er(t.display,e)||Ue(t,e)||e.ctrlKey&&!e.altKey||me&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(he&&n==io){io=null,ct(e);return}if(!(he&&(!e.which||e.which<10)&&el(t,e))){var i=String.fromCharCode(r==null?n:r);i!="\b"&&(lu(t,e,i)||t.display.input.onKeyPress(e))}}}var uu=400,oo=function(e,t,n){this.time=e,this.pos=t,this.button=n};oo.prototype.compare=function(e,t,n){return this.time+uu>e&&x(t,this.pos)==0&&n==this.button};var An,Dn;function fu(e,t){var n=+new Date;return Dn&&Dn.compare(n,e,t)?(An=Dn=null,"triple"):An&&An.compare(n,e,t)?(Dn=new oo(n,e,t),An=null,"double"):(An=new oo(n,e,t),Dn=null,"single")}function il(e){var t=this,n=t.display;if(!(Ue(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,er(n,e)){K||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!ao(t,e)){var r=kr(t,e),i=rn(e),o=r?fu(r,i):"single";tt(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&cu(t,i,r,o,e))&&(i==1?r?hu(t,r,o,e):mt(e)==n.scroller&&ct(e):i==2?(r&&ai(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(te?t.display.input.onContextMenu(e):Ri(t)))}}}function cu(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,On(e,Ja(o,i),i,function(a){if(typeof a=="string"&&(a=Nn[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=P}finally{e.state.suppressEdits=!1}return l})}function du(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=Xe?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=me?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(me?n.altKey:n.ctrlKey)),i}function hu(e,t,n,r){E?setTimeout(De(oa,e),0):e.curOp.focus=le(Me(e));var i=du(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&mi&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(x((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(x(a.to(),t)>0||t.xRel<0)?pu(e,r,t,i):vu(e,r,t,i)}function pu(e,t,n,r){var i=e.display,o=!1,a=it(e,function(u){K&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ri(e)),ft(i.wrapper.ownerDocument,"mouseup",a),ft(i.wrapper.ownerDocument,"mousemove",l),ft(i.scroller,"dragstart",s),ft(i.scroller,"drop",a),o||(ct(u),r.addNew||ai(e.doc,n,null,null,r.extend),K&&!ze||E&&X==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};K&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,I(i.wrapper.ownerDocument,"mouseup",a),I(i.wrapper.ownerDocument,"mousemove",l),I(i.scroller,"dragstart",s),I(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ol(e,t,n){if(n=="char")return new Te(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Te(g(t.line,0),ne(e.doc,g(t.line+1,0)));var r=n(e,t);return new Te(r.from,r.to)}function vu(e,t,n,r){E&&Ri(e);var i=e.display,o=e.doc;ct(t);var a,l,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=u[l]:a=new Te(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new Te(n,n)),n=kr(e,t,!0,!0),l=-1;else{var d=ol(e,n,r.unit);r.extend?a=$i(a,d.anchor,d.head,r.extend):a=d}r.addNew?l==-1?(l=u.length,dt(o,Ht(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(dt(o,Ht(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):eo(o,l,a,we):(l=0,dt(o,new Nt([a],0),we),s=o.sel);var h=n;function b(F){if(x(h,F)!=0)if(h=F,r.unit=="rectangle"){for(var _=[],$=e.options.tabSize,J=j(G(o,n.line).text,n.ch,$),de=j(G(o,F.line).text,F.ch,$),Pe=Math.min(J,de),at=Math.max(J,de),_e=Math.min(n.line,F.line),Lt=Math.min(e.lastLine(),Math.max(n.line,F.line));_e<=Lt;_e++){var xt=G(o,_e).text,Je=Le(xt,Pe,$);Pe==at?_.push(new Te(g(_e,Je),g(_e,Je))):xt.length>Je&&_.push(new Te(g(_e,Je),g(_e,Le(xt,at,$))))}_.length||_.push(new Te(n,n)),dt(o,Ht(e,s.ranges.slice(0,l).concat(_),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(F)}else{var kt=a,st=ol(e,F,r.unit),$e=kt.anchor,Ze;x(st.anchor,$e)>0?(Ze=st.head,$e=Qe(kt.from(),st.anchor)):(Ze=st.anchor,$e=ke(kt.to(),st.head));var qe=s.ranges.slice(0);qe[l]=gu(e,new Te(ne(o,$e),Ze)),dt(o,Ht(e,qe,l),we)}}var y=i.wrapper.getBoundingClientRect(),k=0;function C(F){var _=++k,$=kr(e,F,!0,r.unit=="rectangle");if($)if(x($,h)!=0){e.curOp.focus=le(Me(e)),b($);var J=ei(i,o);($.line>=J.to||$.line<J.from)&&setTimeout(it(e,function(){k==_&&C(F)}),150)}else{var de=F.clientY<y.top?-20:F.clientY>y.bottom?20:0;de&&setTimeout(it(e,function(){k==_&&(i.scroller.scrollTop+=de,C(F))}),50)}}function A(F){e.state.selectingText=!1,k=1/0,F&&(ct(F),i.input.focus()),ft(i.wrapper.ownerDocument,"mousemove",H),ft(i.wrapper.ownerDocument,"mouseup",B),o.history.lastSelOrigin=null}var H=it(e,function(F){F.buttons===0||!rn(F)?A(F):C(F)}),B=it(e,A);e.state.selectingText=B,I(i.wrapper.ownerDocument,"mousemove",H),I(i.wrapper.ownerDocument,"mouseup",B)}function gu(e,t){var n=t.anchor,r=t.head,i=G(e.doc,n.line);if(x(n,r)==0&&n.sticky==r.sticky)return t;var o=At(i);if(!o)return t;var a=Ot(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=a+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var d=Ot(o,r.ch,r.sticky),h=d-a||(r.ch-n.ch)*(l.level==1?-1:1);d==s-1||d==s?u=h<0:u=h>0}var b=o[s+(u?-1:0)],y=u==(b.level==1),k=y?b.from:b.to,C=y?"after":"before";return n.ch==k&&n.sticky==C?t:new Te(new g(n.line,k,C),r)}function al(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(b){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ct(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!pt(e,n))return tn(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=a.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var d=jt(e.doc,o),h=e.display.gutterSpecs[s];return We(e,n,e,d,h.className,t),tn(t)}}}function ao(e,t){return al(e,t,"gutterClick",!0)}function ll(e,t){er(e.display,t)||yu(e,t)||Ue(e,t,"contextmenu")||te||e.display.input.onContextMenu(t)}function yu(e,t){return pt(e,"gutterContextMenu")?al(e,t,"gutterContextMenu",!1):!1}function sl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),cn(e)}var Yr={toString:function(){return"CodeMirror.Init"}},ul={},hi={};function mu(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,u){u!=Yr&&o(l,s,u)}:o)}e.defineOption=n,e.Init=Yr,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Zi(r)},!0),n("indentUnit",2,Zi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){bn(r),cn(r),bt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],a=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var d=s.text.indexOf(i,u);if(d==-1)break;u=d+i.length,o.push(g(a,d))}a++});for(var l=o.length-1;l>=0;l--)Ur(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!=Yr&&r.refresh()}),n("specialCharPlaceholder",Xl,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",fe?"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",!ut),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){sl(r),mn(r)},!0),n("keyMap","default",function(r,i,o){var a=ci(i),l=o!=Yr&&ci(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,wu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Yi(i,r.options.lineNumbers),mn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Hi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Rr(r)},!0),n("scrollbarStyle","native",function(r){ca(r),Rr(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=Yi(r.options.gutters,i),mn(r)},!0),n("firstLineNumber",1,mn,!0),n("lineNumberFormatter",function(r){return r},mn,!0),n("showCursorWhenSelecting",!1,dn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Ir(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,bu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,dn,!0),n("singleCursorHeightPerLine",!0,dn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,bn,!0),n("addModeClass",!1,bn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,bn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function bu(e,t,n){var r=n&&n!=Yr;if(!t!=!r){var i=e.display.dragFunctions,o=t?I:ft;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function wu(e){e.options.lineWrapping?(ve(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(N(e.display.wrapper,"CodeMirror-wrap"),Li(e)),Fi(e),bt(e),cn(e),setTimeout(function(){return Rr(e)},100)}function Be(e,t){var n=this;if(!(this instanceof Be))return new Be(e,t);this.options=t=t?Y(t):{},Y(ul,t,!1);var r=t.value;typeof r=="string"?r=new wt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Be.inputStyles[t.inputStyle](this),o=this.display=new Ws(e,r,i,t);o.wrapper.CodeMirror=this,sl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ca(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 V,keySeq:null,specialChars:null},t.autofocus&&!fe&&o.input.focus(),E&&X<11&&setTimeout(function(){return n.display.input.reset(!0)},20),xu(this),Qs(),Lr(this),this.curOp.forceUpdate=!0,xa(this,r),t.autofocus&&!fe||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&_i(n)},20):Ir(this);for(var a in hi)hi.hasOwnProperty(a)&&hi[a](this,t[a],Yr);pa(this),t.finishInit&&t.finishInit(this);for(var l=0;l<lo.length;++l)lo[l](this);Mr(this),K&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}Be.defaults=ul,Be.optionHandlers=hi;function xu(e){var t=e.display;I(t.scroller,"mousedown",it(e,il)),E&&X<11?I(t.scroller,"dblclick",it(e,function(s){if(!Ue(e,s)){var u=kr(e,s);if(!(!u||ao(e,s)||er(e.display,s))){ct(s);var d=e.findWordAt(u);ai(e.doc,d.anchor,d.head)}}})):I(t.scroller,"dblclick",function(s){return Ue(e,s)||ct(s)}),I(t.scroller,"contextmenu",function(s){return ll(e,s)}),I(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||ll(e,s)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function a(s,u){if(u.left==null)return!0;var d=u.left-s.left,h=u.top-s.top;return d*d+h*h>20*20}I(t.scroller,"touchstart",function(s){if(!Ue(e,s)&&!o(s)&&!ao(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),I(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),I(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!er(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var d=e.coordsChar(t.activeTouch,"page"),h;!u.prev||a(u,u.prev)?h=new Te(d,d):!u.prev.prev||a(u,u.prev.prev)?h=e.findWordAt(d):h=new Te(g(d.line,0),ne(e.doc,g(d.line+1,0))),e.setSelection(h.anchor,h.head),e.focus(),ct(s)}i()}),I(t.scroller,"touchcancel",i),I(t.scroller,"scroll",function(){t.scroller.clientHeight&&(pn(e,t.scroller.scrollTop),Cr(e,t.scroller.scrollLeft,!0),We(e,"scroll",e))}),I(t.scroller,"mousewheel",function(s){return ya(e,s)}),I(t.scroller,"DOMMouseScroll",function(s){return ya(e,s)}),I(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Ue(e,s)||Yt(s)},over:function(s){Ue(e,s)||(Vs(e,s),Yt(s))},start:function(s){return Zs(e,s)},drop:it(e,Js),leave:function(s){Ue(e,s)||Ga(e)}};var l=t.input.getField();I(l,"keyup",function(s){return rl.call(e,s)}),I(l,"keydown",it(e,tl)),I(l,"keypress",it(e,nl)),I(l,"focus",function(s){return _i(e,s)}),I(l,"blur",function(s){return Ir(e,s)})}var lo=[];Be.defineInitHook=function(e){return lo.push(e)};function Pn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=an(e,t).state:n="prev");var a=e.options.tabSize,l=G(i,t),s=j(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],d;if(!r&&!/\S/.test(l.text))d=0,n="not";else if(n=="smart"&&(d=i.mode.indent(o,l.text.slice(u.length),l.text),d==P||d>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?d=j(G(i,t-1).text,null,a):d=0:n=="add"?d=s+e.options.indentUnit:n=="subtract"?d=s-e.options.indentUnit:typeof n=="number"&&(d=s+n),d=Math.max(0,d);var h="",b=0;if(e.options.indentWithTabs)for(var y=Math.floor(d/a);y;--y)b+=a,h+="	";if(b<d&&(h+=He(d-b)),h!=u)return Ur(i,h,g(t,0),g(t,u.length),"+input"),l.stateAfter=null,!0;for(var k=0;k<i.sel.ranges.length;k++){var C=i.sel.ranges[k];if(C.head.line==t&&C.head.ch<u.length){var A=g(t,u.length);eo(i,k,new Te(A,A));break}}}var Ft=null;function pi(e){Ft=e}function so(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=nn(t),u=null;if(l&&r.ranges.length>1)if(Ft&&Ft.text.join(`
`)==t){if(r.ranges.length%Ft.text.length==0){u=[];for(var d=0;d<Ft.text.length;d++)u.push(o.splitLines(Ft.text[d]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=Re(s,function(H){return[H]}));for(var h=e.curOp.updateInput,b=r.ranges.length-1;b>=0;b--){var y=r.ranges[b],k=y.from(),C=y.to();y.empty()&&(n&&n>0?k=g(k.line,k.ch-n):e.state.overwrite&&!l?C=g(C.line,Math.min(G(o,C.line).text.length,C.ch+ie(s).length)):l&&Ft&&Ft.lineWise&&Ft.text.join(`
`)==s.join(`
`)&&(k=C=g(k.line,0)));var A={from:k,to:C,text:u?u[b%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};jr(e.doc,A),nt(e,"inputRead",e,A)}t&&!l&&cl(e,t),Br(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function fl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Tt(t,function(){return so(t,n,0,null,"paste")}),!0}function cl(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Pn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(G(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Pn(e,i.head.line,"smart"));a&&nt(e,"electricInput",e,i.head.line)}}}function dl(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 uo(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function hl(){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 K?e.style.width="1000px":e.setAttribute("wrap","off"),ae&&(e.style.border="1px solid black"),t}function ku(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){tt(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)&&it(this,t[r])(this,i,a),We(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"](ci(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:gt(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");It(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(a){return a.priority}),this.state.modeGen++,bt(this)}),removeOverlay:gt(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++,bt(this);return}}}),indentLine:gt(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),f(this.doc,r)&&Pn(this,r,i,o)}),indentSelection:gt(function(r){for(var i=this.doc.sel.ranges,o=-1,a=0;a<i.length;a++){var l=i[a];if(l.empty())l.head.line>o&&(Pn(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&Br(this));else{var s=l.from(),u=l.to(),d=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var h=d;h<o;++h)Pn(this,h,r);var b=this.doc.sel.ranges;s.ch==0&&i.length==b.length&&b[a].from().ch>0&&eo(this.doc,a,new Te(s,b[a].to()),Q)}}}),getTokenAt:function(r,i){return So(this,r,i)},getLineTokens:function(r,i){return So(this,g(r),i,!0)},getTokenTypeAt:function(r){r=ne(this.doc,r);var i=wo(this,G(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=o+a>>1;if((u?i[u*2-1]:0)>=l)a=u;else if(i[u*2+1]<l)o=u+1;else{s=i[u*2+2];break}}var d=s?s.indexOf("overlay "):-1;return d<0?s:d==0?null:s.slice(0,d-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var a=n[i],l=this.getModeAt(r);if(typeof l[i]=="string")a[l[i]]&&o.push(a[l[i]]);else if(l[i])for(var s=0;s<l[i].length;s++){var u=a[l[i][s]];u&&o.push(u)}else l.helperType&&a[l.helperType]?o.push(a[l.helperType]):a[l.name]&&o.push(a[l.name]);for(var d=0;d<a._global.length;d++){var h=a._global[d];h.pred(l,this)&&U(o,h.val)==-1&&o.push(h.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=Mt(o,r==null?o.first+o.size-1:r),an(this,r+1,i).state},cursorCoords:function(r,i){var o,a=this.doc.sel.primary();return r==null?o=a.head:typeof r=="object"?o=ne(this.doc,r):o=r?a.from():a.to(),zt(this,o,i||"page")},charCoords:function(r,i){return Zn(this,ne(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Qo(this,r,i||"page"),Wi(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Qo(this,{top:r,left:0},i||"page").top,jt(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=G(this.doc,r)}else l=r;return Jn(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-$t(l):0)},defaultTextHeight:function(){return Hr(this.display)},defaultCharWidth:function(){return Fr(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=zt(this,ne(this.doc,r));var u=r.bottom,d=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),a=="over")u=r.top;else if(a=="above"||a=="near"){var h=Math.max(s.wrapper.clientHeight,this.doc.height),b=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>h)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=h&&(u=r.bottom),d+i.offsetWidth>b&&(d=b-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(d=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?d=0:l=="middle"&&(d=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=d+"px"),o&&bs(this,{left:d,top:u,right:d+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:gt(tl),triggerOnKeyPress:gt(nl),triggerOnKeyUp:rl,triggerOnMouseDown:gt(il),execCommand:function(r){if(Nn.hasOwnProperty(r))return Nn[r].call(null,this)},triggerElectric:gt(function(r){cl(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=ne(this.doc,r),u=0;u<i&&(s=fo(this.doc,s,l,o,a),!s.hitSide);++u);return s},moveH:gt(function(r,i){var o=this;this.extendSelectionsBy(function(a){return o.display.shift||o.doc.extend||a.empty()?fo(o.doc,a.head,r,i,o.options.rtlMoveVisually):r<0?a.from():a.to()},Oe)}),deleteH:gt(function(r,i){var o=this.doc.sel,a=this.doc;o.somethingSelected()?a.replaceSelection("",null,"+delete"):Xr(this,function(l){var s=fo(a,l.head,r,i,!1);return r<0?{from:s,to:l.head}:{from:l.head,to:s}})}),findPosV:function(r,i,o,a){var l=1,s=a;i<0&&(l=-1,i=-i);for(var u=ne(this.doc,r),d=0;d<i;++d){var h=zt(this,u,"div");if(s==null?s=h.left:h.left=s,u=pl(this,h,l,o),u.hitSide)break}return u},moveV:gt(function(r,i){var o=this,a=this.doc,l=[],s=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(d){if(s)return r<0?d.from():d.to();var h=zt(o,d.head,"div");d.goalColumn!=null&&(h.left=d.goalColumn),l.push(h.left);var b=pl(o,h,r,i);return i=="page"&&d==a.sel.primary()&&ji(o,Zn(o,b,"div").top-h.top),b},Oe),l.length)for(var u=0;u<a.sel.ranges.length;u++)a.sel.ranges[u].goalColumn=l[u]}),findWordAt:function(r){var i=this.doc,o=G(i,r.line).text,a=r.ch,l=r.ch;if(o){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||l==o.length)&&a?--a:++l;for(var u=o.charAt(a),d=se(u,s)?function(h){return se(h,s)}:/\s/.test(u)?function(h){return/\s/.test(h)}:function(h){return!/\s/.test(h)&&!se(h)};a>0&&d(o.charAt(a-1));)--a;for(;l<o.length&&d(o.charAt(l));)++l}return new Te(g(r.line,a),g(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?ve(this.display.cursorDiv,"CodeMirror-overwrite"):N(this.display.cursorDiv,"CodeMirror-overwrite"),We(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==le(Me(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:gt(function(r,i){hn(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Gt(this)-this.display.barHeight,width:r.scrollWidth-Gt(this)-this.display.barWidth,clientHeight:Oi(this),clientWidth:wr(this)}},scrollIntoView:gt(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?ws(this,r):la(this,r.from,r.to,r.margin)}),setSize:gt(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&&Jo(this);var l=this.display.viewFrom;this.doc.iter(l,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){fr(o,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,We(this,"refresh",this)}),operation:function(r){return Tt(this,r)},startOperation:function(){return Lr(this)},endOperation:function(){return Mr(this)},refresh:gt(function(){var r=this.display.cachedTextHeight;bt(this),this.curOp.forceUpdate=!0,cn(this),hn(this,this.doc.scrollLeft,this.doc.scrollTop),qi(this.display),(r==null||Math.abs(r-Hr(this.display))>.5||this.options.lineWrapping)&&Fi(this),We(this,"refresh",this)}),swapDoc:gt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),xa(this,r),cn(this),this.display.input.reset(),hn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,nt(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}},vt(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 fo(e,t,n,r,i){var o=t,a=n,l=G(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var B=t.line+s;return B<e.first||B>=e.first+e.size?!1:(t=new g(B,t.ch,t.sticky),l=G(e,B))}function d(B){var F;if(r=="codepoint"){var _=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(_))F=null;else{var $=n>0?_>=55296&&_<56320:_>=56320&&_<57343;F=new g(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*($?2:1))),-n)}}else i?F=nu(e.cm,l,t,n):F=ro(l,t,n);if(F==null)if(!B&&u())t=no(i,e.cm,l,t.line,s);else return!1;else t=F;return!0}if(r=="char"||r=="codepoint")d();else if(r=="column")d(!0);else if(r=="word"||r=="group")for(var h=null,b=r=="group",y=e.cm&&e.cm.getHelper(t,"wordChars"),k=!0;!(n<0&&!d(!k));k=!1){var C=l.text.charAt(t.ch)||`
`,A=se(C,y)?"w":b&&C==`
`?"n":!b||/\s/.test(C)?null:"p";if(b&&!k&&!A&&(A="s"),h&&h!=A){n<0&&(n=1,d(),t.sticky="after");break}if(A&&(h=A),n>0&&!d(!k))break}var H=si(e,t,o,a,!0);return re(o,H)&&(H.hitSide=!0),H}function pl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,tt(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*Hr(e.display),3);a=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var u;u=Wi(e,o,a),!!u.outside;){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var Ne=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ne.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,uo(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}I(i,"paste",function(l){!o(l)||Ue(r,l)||fl(l,r)||X<=11&&setTimeout(it(r,function(){return t.updateFromDOM()}),20)}),I(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),I(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),I(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),I(i,"touchstart",function(){return n.forceCompositionEnd()}),I(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||Ue(r,l))){if(r.somethingSelected())pi({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=dl(r);pi({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Q),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=Ft.text.join(`
`);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var d=hl(),h=d.firstChild;uo(h),r.display.lineSpace.insertBefore(d,r.display.lineSpace.firstChild),h.value=Ft.text.join(`
`);var b=le(i.ownerDocument);et(h),setTimeout(function(){r.display.lineSpace.removeChild(d),b.focus(),b==i&&n.showPrimarySelection()},50)}}I(i,"copy",a),I(i,"cut",a)},Ne.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ne.prototype.prepareSelection=function(){var e=ia(this.cm,!1);return e.focus=le(this.div.ownerDocument)==this.div,e},Ne.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ne.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ne.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=vi(t,e.anchorNode,e.anchorOffset),a=vi(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&a&&!a.bad&&x(Qe(o,a),r)==0&&x(ke(o,a),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&vl(t,r)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&vl(t,i);if(!u){var d=l[l.length-1].measure,h=d.maps?d.maps[d.maps.length-1]:d.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(!s||!u){e.removeAllRanges();return}var b=e.rangeCount&&e.getRangeAt(0),y;try{y=M(s.node,s.offset,u.offset,u.node)}catch(k){}y&&(!q&&t.state.focused?(e.collapse(s.node,s.offset),y.collapsed||(e.removeAllRanges(),e.addRange(y))):(e.removeAllRanges(),e.addRange(y)),b&&e.anchorNode==null?e.addRange(b):q&&this.startGracePeriod()),this.rememberSelection()}},Ne.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)},Ne.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},Ne.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ne.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return R(this.div,t)},Ne.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||le(this.div.ownerDocument)!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ne.prototype.blur=function(){this.div.blur()},Ne.prototype.getField=function(){return this.div},Ne.prototype.supportsTouch=function(){return!0},Ne.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Tt(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)},Ne.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ne.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(ee&&Z&&this.cm.display.gutterSpecs.length&&Su(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=vi(t,e.anchorNode,e.anchorOffset),r=vi(t,e.focusNode,e.focusOffset);n&&r&&Tt(t,function(){dt(t.doc,dr(n,r),Q),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Ne.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,G(e.doc,r.line-1).length)),i.ch==G(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=Sr(e,r.line))==0?(a=Ce(t.view[0].line),l=t.view[0].node):(a=Ce(t.view[o].line),l=t.view[o-1].node.nextSibling);var s=Sr(e,i.line),u,d;if(s==t.view.length-1?(u=t.viewTo-1,d=t.lineDiv.lastChild):(u=Ce(t.view[s+1].line)-1,d=t.view[s+1].node.previousSibling),!l)return!1;for(var h=e.doc.splitLines(Cu(e,l,d,a,u)),b=Vt(e.doc,g(a,0),g(u,G(e.doc,u).text.length));h.length>1&&b.length>1;)if(ie(h)==ie(b))h.pop(),b.pop(),u--;else if(h[0]==b[0])h.shift(),b.shift(),a++;else break;for(var y=0,k=0,C=h[0],A=b[0],H=Math.min(C.length,A.length);y<H&&C.charCodeAt(y)==A.charCodeAt(y);)++y;for(var B=ie(h),F=ie(b),_=Math.min(B.length-(h.length==1?y:0),F.length-(b.length==1?y:0));k<_&&B.charCodeAt(B.length-k-1)==F.charCodeAt(F.length-k-1);)++k;if(h.length==1&&b.length==1&&a==r.line)for(;y&&y>r.ch&&B.charCodeAt(B.length-k-1)==F.charCodeAt(F.length-k-1);)y--,k++;h[h.length-1]=B.slice(0,B.length-k).replace(/^\u200b+/,""),h[0]=h[0].slice(y).replace(/\u200b+$/,"");var $=g(a,y),J=g(u,b.length?ie(b).length-k:0);if(h.length>1||h[0]||x($,J))return Ur(e.doc,h,$,J,"+input"),!0},Ne.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ne.prototype.reset=function(){this.forceCompositionEnd()},Ne.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ne.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))},Ne.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Tt(this.cm,function(){return bt(e.cm)})},Ne.prototype.setUneditable=function(e){e.contentEditable="false"},Ne.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||it(this.cm,so)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Ne.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ne.prototype.onContextMenu=function(){},Ne.prototype.resetPosition=function(){},Ne.prototype.needsContentAttribute=!0;function vl(e,t){var n=Ai(e,t.line);if(!n||n.hidden)return null;var r=G(e.doc,t.line),i=Uo(n,r,t.line),o=At(r,e.doc.direction),a="left";if(o){var l=Ot(o,t.ch);a=l%2?"right":"left"}var s=Xo(i.map,t.ch,a);return s.offset=s.collapse=="right"?s.end:s.start,s}function Su(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Jr(e,t){return t&&(e.bad=!0),e}function Cu(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function u(y){return function(k){return k.id==y}}function d(){a&&(o+=l,s&&(o+=l),a=s=!1)}function h(y){y&&(d(),o+=y)}function b(y){if(y.nodeType==1){var k=y.getAttribute("cm-text");if(k){h(k);return}var C=y.getAttribute("cm-marker"),A;if(C){var H=e.findMarks(g(r,0),g(i+1,0),u(+C));H.length&&(A=H[0].find(0))&&h(Vt(e.doc,A.from,A.to).join(l));return}if(y.getAttribute("contenteditable")=="false")return;var B=/^(pre|div|p|li|table|br)$/i.test(y.nodeName);if(!/^br$/i.test(y.nodeName)&&y.textContent.length==0)return;B&&d();for(var F=0;F<y.childNodes.length;F++)b(y.childNodes[F]);/^(pre|p)$/i.test(y.nodeName)&&(s=!0),B&&(a=!0)}else y.nodeType==3&&h(y.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;b(t),t!=n;)t=t.nextSibling,s=!1;return o}function vi(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Jr(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 Tu(o,t,n)}}function Tu(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!R(r,t))return Jr(g(Ce(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?ie(e.rest):e.line;return Jr(g(Ce(o),o.text.length),i)}var a=t.nodeType==3?t:null,l=t;for(!a&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(a=t.firstChild,n&&(n=a.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,u=s.maps;function d(A,H,B){for(var F=-1;F<(u?u.length:0);F++)for(var _=F<0?s.map:u[F],$=0;$<_.length;$+=3){var J=_[$+2];if(J==A||J==H){var de=Ce(F<0?e.line:e.rest[F]),Pe=_[$]+B;return(B<0||J!=A)&&(Pe=_[$+(B?1:0)]),g(de,Pe)}}}var h=d(a,l,n);if(h)return Jr(h,i);for(var b=l.nextSibling,y=a?a.nodeValue.length-n:0;b;b=b.nextSibling){if(h=d(b,b.firstChild,0),h)return Jr(g(h.line,h.ch-y),i);y+=b.textContent.length}for(var k=l.previousSibling,C=n;k;k=k.previousSibling){if(h=d(k,k.firstChild,-1),h)return Jr(g(h.line,h.ch+C),i);C+=k.textContent.length}}var Ye=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null,this.resetting=!1};Ye.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),ae&&(i.style.width="0px"),I(i,"input",function(){E&&X>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),I(i,"paste",function(a){Ue(r,a)||fl(a,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(a){if(!Ue(r,a)){if(r.somethingSelected())pi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=dl(r);pi({lineWise:!0,text:l.text}),a.type=="cut"?r.setSelections(l.ranges,null,Q):(n.prevInput="",i.value=l.text.join(`
`),et(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}I(i,"cut",o),I(i,"copy",o),I(e.scroller,"paste",function(a){if(!(er(e,a)||Ue(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)}}),I(e.lineSpace,"selectstart",function(a){er(e,a)||ct(a)}),I(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"})}}),I(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ye.prototype.createField=function(e){this.wrapper=hl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;uo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ye.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ye.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ia(e);if(e.options.moveInputWithCursor){var i=zt(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},Ye.prototype.showSelection=function(e){var t=this.cm,n=t.display;T(n.cursorDiv,e.cursors),T(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ye.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&&et(this.textarea),E&&X>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",E&&X>=9&&(this.hasSelection=null));this.resetting=!1}},Ye.prototype.getField=function(){return this.textarea},Ye.prototype.supportsTouch=function(){return!1},Ye.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!fe||le(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(e){}},Ye.prototype.blur=function(){this.textarea.blur()},Ye.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ye.prototype.receivedFocus=function(){this.slowPoll()},Ye.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ye.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)},Ye.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||or(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(E&&X>=9&&this.hasSelection===i||me&&/[\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 Tt(t,function(){so(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},Ye.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ye.prototype.onKeyPress=function(){E&&X>=9&&(this.hasSelection=null),this.fastPoll()},Ye.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=kr(n,e),a=r.scroller.scrollTop;if(!o||he)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&it(n,dt)(n.doc,dr(o),Q);var s=i.style.cssText,u=t.wrapper.style.cssText,d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
      top: `+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+`px;
      z-index: 1000; background: `+(E?"rgba(255, 255, 255, .05)":"transparent")+`;
      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var h;K&&(h=i.ownerDocument.defaultView.scrollY),r.input.focus(),K&&i.ownerDocument.defaultView.scrollTo(null,h),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function b(){if(i.selectionStart!=null){var C=n.somethingSelected(),A="​"+(C?i.value:"");i.value="⇚",i.value=A,t.prevInput=C?"":"​",i.selectionStart=1,i.selectionEnd=A.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,E&&X<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!E||E&&X<9)&&b();var C=0,A=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="​"?it(n,Ea)(n):C++<10?r.detectingSelectAll=setTimeout(A,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(A,200)}}if(E&&X>=9&&b(),te){Yt(e);var k=function(){ft(window,"mouseup",k),setTimeout(y,20)};I(window,"mouseup",k)}else setTimeout(y,50)},Ye.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ye.prototype.setUneditable=function(){},Ye.prototype.needsContentAttribute=!1;function Lu(e,t){if(t=t?Y(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=le(e.ownerDocument);t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(I(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&&(ft(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=Be(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function Mu(e){e.off=ft,e.on=I,e.wheelEventPixels=Es,e.Doc=wt,e.splitLines=nn,e.countColumn=j,e.findColumn=Le,e.isWordChar=S,e.Pass=P,e.signal=We,e.Line=Wr,e.changeEnd=hr,e.scrollbarModel=fa,e.Pos=g,e.cmpPos=x,e.modes=Wt,e.mimeModes=ar,e.resolveMode=Ct,e.getMode=Jt,e.modeExtensions=lr,e.extendMode=Rn,e.copyState=Zt,e.startState=on,e.innerMode=sr,e.commands=Nn,e.keyMap=rr,e.keyName=Za,e.isModifierKey=Ya,e.lookupKey=qr,e.normalizeKeyMap=ru,e.StringStream=Ge,e.SharedTextMarker=Tn,e.TextMarker=vr,e.LineWidget=Cn,e.e_preventDefault=ct,e.e_stopPropagation=br,e.e_stop=Yt,e.addClass=ve,e.contains=R,e.rmClass=N,e.keyNames=gr}mu(Be),ku(Be);var Nu="iter insert remove copy getEditor constructor".split(" ");for(var gi in wt.prototype)wt.prototype.hasOwnProperty(gi)&&U(Nu,gi)<0&&(Be.prototype[gi]=function(e){return function(){return e.apply(this.doc,arguments)}}(wt.prototype[gi]));return vt(wt),Be.inputStyles={textarea:Ye,contenteditable:Ne},Be.defineMode=function(e){!Be.defaults.mode&&e!="null"&&(Be.defaults.mode=e),Bn.apply(this,arguments)},Be.defineMIME=Dr,Be.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Be.defineMIME("text/plain","null"),Be.defineExtension=function(e,t){Be.prototype[e]=t},Be.defineDocExtension=function(e,t){wt.prototype[e]=t},Be.fromTextArea=Lu,Mu(Be),Be.version="5.65.12",Be})}(po)),po.exports}var Uu=En();const Gu=Nl(Uu);var Qr=(ye=>(ye.JSON="application/json",ye.HTML="htmlmixed",ye.JS="javascript",ye))(Qr||{});var qu={exports:{}};(function(ye,Fe){(function(W){W(En())})(function(W){W.defineMode("javascript",function(Se,q){var ue=Se.indentUnit,Ee=q.statementIndent,oe=q.jsonld,E=q.json||oe,X=q.trackScope!==!1,K=q.typescript,D=q.wordCharacters||/[\w$\xa1-\uffff]/,Z=function(){function f(Qe){return{type:Qe,style:"keyword"}}var p=f("keyword a"),g=f("keyword b"),x=f("keyword c"),re=f("keyword d"),ge=f("operator"),ke={type:"atom",style:"atom"};return{if:f("if"),while:p,with:p,else:g,do:g,try:g,finally:g,return:re,break:re,continue:re,new:f("new"),delete:x,void:x,throw:x,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:ge,typeof:ge,instanceof:ge,true:ke,false:ke,null:ke,undefined:ke,NaN:ke,Infinity:ke,this:f("this"),class:f("class"),super:f("atom"),yield:x,export:f("export"),import:f("import"),extends:x,await:x}}(),pe=/[+\-*&%=<>!?|~^@]/,he=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function ze(f){for(var p=!1,g,x=!1;(g=f.next())!=null;){if(!p){if(g=="/"&&!x)return;g=="["?x=!0:x&&g=="]"&&(x=!1)}p=!p&&g=="\\"}}var Ie,Ae;function ae(f,p,g){return Ie=f,Ae=g,p}function ee(f,p){var g=f.next();if(g=='"'||g=="'")return p.tokenize=fe(g),p.tokenize(f,p);if(g=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return ae("number","number");if(g=="."&&f.match(".."))return ae("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(g))return ae(g);if(g=="="&&f.eat(">"))return ae("=>","operator");if(g=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return ae("number","number");if(/\d/.test(g))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),ae("number","number");if(g=="/")return f.eat("*")?(p.tokenize=me,me(f,p)):f.eat("/")?(f.skipToEnd(),ae("comment","comment")):jt(f,p,1)?(ze(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),ae("regexp","string-2")):(f.eat("="),ae("operator","operator",f.current()));if(g=="`")return p.tokenize=Xe,Xe(f,p);if(g=="#"&&f.peek()=="!")return f.skipToEnd(),ae("meta","meta");if(g=="#"&&f.eatWhile(D))return ae("variable","property");if(g=="<"&&f.match("!--")||g=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),ae("comment","comment");if(pe.test(g))return(g!=">"||!p.lexical||p.lexical.type!=">")&&(f.eat("=")?(g=="!"||g=="=")&&f.eat("="):/[<>*+\-|&?]/.test(g)&&(f.eat(g),g==">"&&f.eat(g))),g=="?"&&f.eat(".")?ae("."):ae("operator","operator",f.current());if(D.test(g)){f.eatWhile(D);var x=f.current();if(p.lastType!="."){if(Z.propertyIsEnumerable(x)){var re=Z[x];return ae(re.type,re.style,x)}if(x=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return ae("async","keyword",x)}return ae("variable","variable",x)}}function fe(f){return function(p,g){var x=!1,re;if(oe&&p.peek()=="@"&&p.match(he))return g.tokenize=ee,ae("jsonld-keyword","meta");for(;(re=p.next())!=null&&!(re==f&&!x);)x=!x&&re=="\\";return x||(g.tokenize=ee),ae("string","string")}}function me(f,p){for(var g=!1,x;x=f.next();){if(x=="/"&&g){p.tokenize=ee;break}g=x=="*"}return ae("comment","comment")}function Xe(f,p){for(var g=!1,x;(x=f.next())!=null;){if(!g&&(x=="`"||x=="$"&&f.eat("{"))){p.tokenize=ee;break}g=!g&&x=="\\"}return ae("quasi","string-2",f.current())}var ut="([{}])";function Ke(f,p){p.fatArrowAt&&(p.fatArrowAt=null);var g=f.string.indexOf("=>",f.start);if(!(g<0)){if(K){var x=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,g));x&&(g=x.index)}for(var re=0,ge=!1,ke=g-1;ke>=0;--ke){var Qe=f.string.charAt(ke),Mt=ut.indexOf(Qe);if(Mt>=0&&Mt<3){if(!re){++ke;break}if(--re==0){Qe=="("&&(ge=!0);break}}else if(Mt>=3&&Mt<6)++re;else if(D.test(Qe))ge=!0;else if(/["'\/`]/.test(Qe))for(;;--ke){if(ke==0)return;var ne=f.string.charAt(ke-1);if(ne==Qe&&f.string.charAt(ke-2)!="\\"){ke--;break}}else if(ge&&!re){++ke;break}}ge&&!re&&(p.fatArrowAt=ke)}}var be={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function te(f,p,g,x,re,ge){this.indented=f,this.column=p,this.type=g,this.prev=re,this.info=ge,x!=null&&(this.align=x)}function v(f,p){if(!X)return!1;for(var g=f.localVars;g;g=g.next)if(g.name==p)return!0;for(var x=f.context;x;x=x.prev)for(var g=x.vars;g;g=g.next)if(g.name==p)return!0}function N(f,p,g,x,re){var ge=f.cc;for(m.state=f,m.stream=re,m.marked=null,m.cc=ge,m.style=p,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var ke=ge.length?ge.pop():E?P:U;if(ke(g,x)){for(;ge.length&&ge[ge.length-1].lex;)ge.pop()();return m.marked?m.marked:g=="variable"&&v(f,x)?"variable-2":p}}}var m={state:null,column:null,marked:null,cc:null};function T(){for(var f=arguments.length-1;f>=0;f--)m.cc.push(arguments[f])}function c(){return T.apply(null,arguments),!0}function z(f,p){for(var g=p;g;g=g.next)if(g.name==f)return!0;return!1}function M(f){var p=m.state;if(m.marked="def",!!X){if(p.context){if(p.lexical.info=="var"&&p.context&&p.context.block){var g=R(f,p.context);if(g!=null){p.context=g;return}}else if(!z(f,p.localVars)){p.localVars=new Ve(f,p.localVars);return}}q.globalVars&&!z(f,p.globalVars)&&(p.globalVars=new Ve(f,p.globalVars))}}function R(f,p){if(p)if(p.block){var g=R(f,p.prev);return g?g==p.prev?p:new ve(g,p.vars,!0):null}else return z(f,p.vars)?p:new ve(p.prev,new Ve(f,p.vars),!1);else return null}function le(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function ve(f,p,g){this.prev=f,this.vars=p,this.block=g}function Ve(f,p){this.name=f,this.next=p}var et=new Ve("this",new Ve("arguments",null));function Me(){m.state.context=new ve(m.state.context,m.state.localVars,!1),m.state.localVars=et}function tt(){m.state.context=new ve(m.state.context,m.state.localVars,!0),m.state.localVars=null}Me.lex=tt.lex=!0;function De(){m.state.localVars=m.state.context.vars,m.state.context=m.state.context.prev}De.lex=!0;function Y(f,p){var g=function(){var x=m.state,re=x.indented;if(x.lexical.type=="stat")re=x.lexical.indented;else for(var ge=x.lexical;ge&&ge.type==")"&&ge.align;ge=ge.prev)re=ge.indented;x.lexical=new te(re,m.stream.column(),f,null,x.lexical,p)};return g.lex=!0,g}function j(){var f=m.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}j.lex=!0;function V(f){function p(g){return g==f?c():f==";"||g=="}"||g==")"||g=="]"?T():c(p)}return p}function U(f,p){return f=="var"?c(Y("vardef",p),Yt,V(";"),j):f=="keyword a"?c(Y("form"),we,U,j):f=="keyword b"?c(Y("form"),U,j):f=="keyword d"?m.stream.match(/^\s*$/,!1)?c():c(Y("stat"),Le,V(";"),j):f=="debugger"?c(V(";")):f=="{"?c(Y("}"),tt,Rt,j,De):f==";"?c():f=="if"?(m.state.lexical.info=="else"&&m.state.cc[m.state.cc.length-1]==j&&m.state.cc.pop()(),c(Y("form"),we,U,j,Ar)):f=="function"?c(_t):f=="for"?c(Y("form"),tt,Fn,U,De,j):f=="class"||K&&p=="interface"?(m.marked="keyword",c(Y("form",f=="class"?f:p),Bn,j)):f=="variable"?K&&p=="declare"?(m.marked="keyword",c(U)):K&&(p=="module"||p=="enum"||p=="type")&&m.stream.match(/^\s*\w/,!1)?(m.marked="keyword",p=="enum"?c(Pr):p=="type"?c(In,V("operator"),I,V(";")):c(Y("form"),mt,V("{"),Y("}"),Rt,j,j)):K&&p=="namespace"?(m.marked="keyword",c(Y("form"),P,U,j)):K&&p=="abstract"?(m.marked="keyword",c(U)):c(Y("stat"),se):f=="switch"?c(Y("form"),we,V("{"),Y("}","switch"),tt,Rt,j,j,De):f=="case"?c(P,V(":")):f=="default"?c(V(":")):f=="catch"?c(Y("form"),Me,L,U,j,De):f=="export"?c(Y("stat"),lr,j):f=="import"?c(Y("stat"),Zt,j):f=="async"?c(U):p=="@"?c(P,U):T(Y("stat"),P,V(";"),j)}function L(f){if(f=="(")return c(Wt,V(")"))}function P(f,p){return Oe(f,p,!1)}function Q(f,p){return Oe(f,p,!0)}function we(f){return f!="("?T():c(Y(")"),Le,V(")"),j)}function Oe(f,p,g){if(m.state.fatArrowAt==m.stream.start){var x=g?xe:It;if(f=="(")return c(Me,Y(")"),je(Wt,")"),j,V("=>"),x,De);if(f=="variable")return T(Me,mt,V("=>"),x,De)}var re=g?He:ce;return be.hasOwnProperty(f)?c(re):f=="function"?c(_t,re):f=="class"||K&&p=="interface"?(m.marked="keyword",c(Y("form"),ar,j)):f=="keyword c"||f=="async"?c(g?Q:P):f=="("?c(Y(")"),Le,V(")"),j,re):f=="operator"||f=="spread"?c(g?Q:P):f=="["?c(Y("]"),Vt,j,re):f=="{"?mr(ir,"}",null,re):f=="quasi"?T(ie,re):f=="new"?c(w(g)):c()}function Le(f){return f.match(/[;\}\)\],]/)?T():T(P)}function ce(f,p){return f==","?c(Le):He(f,p,!1)}function He(f,p,g){var x=g==!1?ce:He,re=g==!1?P:Q;if(f=="=>")return c(Me,g?xe:It,De);if(f=="operator")return/\+\+|--/.test(p)||K&&p=="!"?c(x):K&&p=="<"&&m.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(Y(">"),je(I,">"),j,x):p=="?"?c(P,V(":"),re):c(re);if(f=="quasi")return T(ie,x);if(f!=";"){if(f=="(")return mr(Q,")","call",x);if(f==".")return c(rt,x);if(f=="[")return c(Y("]"),Le,V("]"),j,x);if(K&&p=="as")return m.marked="keyword",c(I,x);if(f=="regexp")return m.state.lastType=m.marked="operator",m.stream.backUp(m.stream.pos-m.stream.start-1),c(re)}}function ie(f,p){return f!="quasi"?T():p.slice(p.length-2)!="${"?c(ie):c(Le,Re)}function Re(f){if(f=="}")return m.marked="string-2",m.state.tokenize=Xe,c(ie)}function It(f){return Ke(m.stream,m.state),T(f=="{"?U:P)}function xe(f){return Ke(m.stream,m.state),T(f=="{"?U:Q)}function w(f){return function(p){return p=="."?c(f?S:O):p=="variable"&&K?c(ct,f?He:ce):T(f?Q:P)}}function O(f,p){if(p=="target")return m.marked="keyword",c(ce)}function S(f,p){if(p=="target")return m.marked="keyword",c(He)}function se(f){return f==":"?c(j,U):T(ce,V(";"),j)}function rt(f){if(f=="variable")return m.marked="property",c()}function ir(f,p){if(f=="async")return m.marked="property",c(ir);if(f=="variable"||m.style=="keyword"){if(m.marked="property",p=="get"||p=="set")return c($r);var g;return K&&m.state.fatArrowAt==m.stream.start&&(g=m.stream.match(/^\s*:\s*/,!1))&&(m.state.fatArrowAt=m.stream.pos+g[0].length),c(Bt)}else{if(f=="number"||f=="string")return m.marked=oe?"property":m.style+" property",c(Bt);if(f=="jsonld-keyword")return c(Bt);if(K&&le(p))return m.marked="keyword",c(ir);if(f=="[")return c(P,Ot,V("]"),Bt);if(f=="spread")return c(Q,Bt);if(p=="*")return m.marked="keyword",c(ir);if(f==":")return T(Bt)}}function $r(f){return f!="variable"?T(Bt):(m.marked="property",c(_t))}function Bt(f){if(f==":")return c(Q);if(f=="(")return T(_t)}function je(f,p,g){function x(re,ge){if(g?g.indexOf(re)>-1:re==","){var ke=m.state.lexical;return ke.info=="call"&&(ke.pos=(ke.pos||0)+1),c(function(Qe,Mt){return Qe==p||Mt==p?T():T(f)},x)}return re==p||ge==p?c():g&&g.indexOf(";")>-1?T(f):c(V(p))}return function(re,ge){return re==p||ge==p?c():T(f,x)}}function mr(f,p,g){for(var x=3;x<arguments.length;x++)m.cc.push(arguments[x]);return c(Y(p,g),je(f,p),j)}function Rt(f){return f=="}"?c():T(U,Rt)}function Ot(f,p){if(K){if(f==":")return c(I);if(p=="?")return c(Ot)}}function yi(f,p){if(K&&(f==":"||p=="in"))return c(I)}function At(f){if(K&&f==":")return m.stream.match(/^\s*\w+\s+is\b/,!1)?c(P,zn,I):c(I)}function zn(f,p){if(p=="is")return m.marked="keyword",c()}function I(f,p){if(p=="keyof"||p=="typeof"||p=="infer"||p=="readonly")return m.marked="keyword",c(p=="typeof"?Q:I);if(f=="variable"||p=="void")return m.marked="type",c(vt);if(p=="|"||p=="&")return c(I);if(f=="string"||f=="number"||f=="atom")return c(vt);if(f=="[")return c(Y("]"),je(I,"]",","),j,vt);if(f=="{")return c(Y("}"),ft,j,vt);if(f=="(")return c(je(pt,")"),en,vt);if(f=="<")return c(je(I,">"),I);if(f=="quasi")return T(Ue,vt)}function en(f){if(f=="=>")return c(I)}function ft(f){return f.match(/[\}\)\]]/)?c():f==","||f==";"?c(ft):T(We,ft)}function We(f,p){if(f=="variable"||m.style=="keyword")return m.marked="property",c(We);if(p=="?"||f=="number"||f=="string")return c(We);if(f==":")return c(I);if(f=="[")return c(V("variable"),yi,V("]"),We);if(f=="(")return T(Kt,We);if(!f.match(/[;\}\)\],]/))return c()}function Ue(f,p){return f!="quasi"?T():p.slice(p.length-2)!="${"?c(Ue):c(I,Hn)}function Hn(f){if(f=="}")return m.marked="string-2",m.state.tokenize=Xe,c(Ue)}function pt(f,p){return f=="variable"&&m.stream.match(/^\s*[?:]/,!1)||p=="?"?c(pt):f==":"?c(I):f=="spread"?c(pt):T(I)}function vt(f,p){if(p=="<")return c(Y(">"),je(I,">"),j,vt);if(p=="|"||f=="."||p=="&")return c(I);if(f=="[")return c(I,V("]"),vt);if(p=="extends"||p=="implements")return m.marked="keyword",c(I);if(p=="?")return c(I,V(":"),I)}function ct(f,p){if(p=="<")return c(Y(">"),je(I,">"),j,vt)}function br(){return T(I,tn)}function tn(f,p){if(p=="=")return c(I)}function Yt(f,p){return p=="enum"?(m.marked="keyword",c(Pr)):T(mt,Ot,Dt,bi)}function mt(f,p){if(K&&le(p))return m.marked="keyword",c(mt);if(f=="variable")return M(p),c();if(f=="spread")return c(mt);if(f=="[")return mr(mi,"]");if(f=="{")return mr(rn,"}")}function rn(f,p){return f=="variable"&&!m.stream.match(/^\s*:/,!1)?(M(p),c(Dt)):(f=="variable"&&(m.marked="property"),f=="spread"?c(mt):f=="}"?T():f=="["?c(P,V("]"),V(":"),rn):c(V(":"),mt,Dt))}function mi(){return T(mt,Dt)}function Dt(f,p){if(p=="=")return c(Q)}function bi(f){if(f==",")return c(Yt)}function Ar(f,p){if(f=="keyword b"&&p=="else")return c(Y("form","else"),U,j)}function Fn(f,p){if(p=="await")return c(Fn);if(f=="(")return c(Y(")"),nn,j)}function nn(f){return f=="var"?c(Yt,or):f=="variable"?c(or):T(or)}function or(f,p){return f==")"?c():f==";"?c(or):p=="in"||p=="of"?(m.marked="keyword",c(P,or)):T(P,or)}function _t(f,p){if(p=="*")return m.marked="keyword",c(_t);if(f=="variable")return M(p),c(_t);if(f=="(")return c(Me,Y(")"),je(Wt,")"),j,At,U,De);if(K&&p=="<")return c(Y(">"),je(br,">"),j,_t)}function Kt(f,p){if(p=="*")return m.marked="keyword",c(Kt);if(f=="variable")return M(p),c(Kt);if(f=="(")return c(Me,Y(")"),je(Wt,")"),j,At,De);if(K&&p=="<")return c(Y(">"),je(br,">"),j,Kt)}function In(f,p){if(f=="keyword"||f=="variable")return m.marked="type",c(In);if(p=="<")return c(Y(">"),je(br,">"),j)}function Wt(f,p){return p=="@"&&c(P,Wt),f=="spread"?c(Wt):K&&le(p)?(m.marked="keyword",c(Wt)):K&&f=="this"?c(Ot,Dt):T(mt,Ot,Dt)}function ar(f,p){return f=="variable"?Bn(f,p):Dr(f,p)}function Bn(f,p){if(f=="variable")return M(p),c(Dr)}function Dr(f,p){if(p=="<")return c(Y(">"),je(br,">"),j,Dr);if(p=="extends"||p=="implements"||K&&f==",")return p=="implements"&&(m.marked="keyword"),c(K?I:P,Dr);if(f=="{")return c(Y("}"),Ct,j)}function Ct(f,p){if(f=="async"||f=="variable"&&(p=="static"||p=="get"||p=="set"||K&&le(p))&&m.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return m.marked="keyword",c(Ct);if(f=="variable"||m.style=="keyword")return m.marked="property",c(Jt,Ct);if(f=="number"||f=="string")return c(Jt,Ct);if(f=="[")return c(P,Ot,V("]"),Jt,Ct);if(p=="*")return m.marked="keyword",c(Ct);if(K&&f=="(")return T(Kt,Ct);if(f==";"||f==",")return c(Ct);if(f=="}")return c();if(p=="@")return c(P,Ct)}function Jt(f,p){if(p=="!"||p=="?")return c(Jt);if(f==":")return c(I,Dt);if(p=="=")return c(Q);var g=m.state.lexical.prev,x=g&&g.info=="interface";return T(x?Kt:_t)}function lr(f,p){return p=="*"?(m.marked="keyword",c(G,V(";"))):p=="default"?(m.marked="keyword",c(P,V(";"))):f=="{"?c(je(Rn,"}"),G,V(";")):T(U)}function Rn(f,p){if(p=="as")return m.marked="keyword",c(V("variable"));if(f=="variable")return T(Q,Rn)}function Zt(f){return f=="string"?c():f=="("?T(P):f=="."?T(ce):T(sr,on,G)}function sr(f,p){return f=="{"?mr(sr,"}"):(f=="variable"&&M(p),p=="*"&&(m.marked="keyword"),c(Ge))}function on(f){if(f==",")return c(sr,on)}function Ge(f,p){if(p=="as")return m.marked="keyword",c(sr)}function G(f,p){if(p=="from")return m.marked="keyword",c(P)}function Vt(f){return f=="]"?c():T(je(Q,"]"))}function Pr(){return T(Y("form"),mt,V("{"),Y("}"),je(Pt,"}"),j,j)}function Pt(){return T(mt,Dt)}function Ce(f,p){return f.lastType=="operator"||f.lastType==","||pe.test(p.charAt(0))||/[,.]/.test(p.charAt(0))}function jt(f,p,g){return p.tokenize==ee&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(p.lastType)||p.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(g||0)))}return{startState:function(f){var p={tokenize:ee,lastType:"sof",cc:[],lexical:new te((f||0)-ue,0,"block",!1),localVars:q.localVars,context:q.localVars&&new ve(null,null,!1),indented:f||0};return q.globalVars&&typeof q.globalVars=="object"&&(p.globalVars=q.globalVars),p},token:function(f,p){if(f.sol()&&(p.lexical.hasOwnProperty("align")||(p.lexical.align=!1),p.indented=f.indentation(),Ke(f,p)),p.tokenize!=me&&f.eatSpace())return null;var g=p.tokenize(f,p);return Ie=="comment"?g:(p.lastType=Ie=="operator"&&(Ae=="++"||Ae=="--")?"incdec":Ie,N(p,g,Ie,Ae,f))},indent:function(f,p){if(f.tokenize==me||f.tokenize==Xe)return W.Pass;if(f.tokenize!=ee)return 0;var g=p&&p.charAt(0),x=f.lexical,re;if(!/^\s*else\b/.test(p))for(var ge=f.cc.length-1;ge>=0;--ge){var ke=f.cc[ge];if(ke==j)x=x.prev;else if(ke!=Ar&&ke!=De)break}for(;(x.type=="stat"||x.type=="form")&&(g=="}"||(re=f.cc[f.cc.length-1])&&(re==ce||re==He)&&!/^[,\.=+\-*:?[\(]/.test(p));)x=x.prev;Ee&&x.type==")"&&x.prev.type=="stat"&&(x=x.prev);var Qe=x.type,Mt=g==Qe;return Qe=="vardef"?x.indented+(f.lastType=="operator"||f.lastType==","?x.info.length+1:0):Qe=="form"&&g=="{"?x.indented:Qe=="form"?x.indented+ue:Qe=="stat"?x.indented+(Ce(f,p)?Ee||ue:0):x.info=="switch"&&!Mt&&q.doubleIndentSwitch!=!1?x.indented+(/^(?:case|default)\b/.test(p)?ue:2*ue):x.align?x.column+(Mt?0:1):x.indented+(Mt?0:ue)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:E?null:"/*",blockCommentEnd:E?null:"*/",blockCommentContinue:E?null:" * ",lineComment:E?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:E?"json":"javascript",jsonldMode:oe,jsonMode:E,expressionAllowed:jt,skipExpression:function(f){N(f,"atom","atom","true",new W.StringStream("",2,null))}}}),W.registerHelper("wordChars","javascript",/[\w$]/),W.defineMIME("text/javascript","javascript"),W.defineMIME("text/ecmascript","javascript"),W.defineMIME("application/javascript","javascript"),W.defineMIME("application/x-javascript","javascript"),W.defineMIME("application/ecmascript","javascript"),W.defineMIME("application/json",{name:"javascript",json:!0}),W.defineMIME("application/x-json",{name:"javascript",json:!0}),W.defineMIME("application/manifest+json",{name:"javascript",json:!0}),W.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),W.defineMIME("text/typescript",{name:"javascript",typescript:!0}),W.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})();var Xu=qu.exports,Yu={exports:{}};(function(ye,Fe){(function(W){W(En())})(function(W){W.defineMode("css",function(te,v){var N=v.inline;v.propertyKeywords||(v=W.resolveMode("text/css"));var m=te.indentUnit,T=v.tokenHooks,c=v.documentTypes||{},z=v.mediaTypes||{},M=v.mediaFeatures||{},R=v.mediaValueKeywords||{},le=v.propertyKeywords||{},ve=v.nonStandardPropertyKeywords||{},Ve=v.fontProperties||{},et=v.counterDescriptors||{},Me=v.colorKeywords||{},tt=v.valueKeywords||{},De=v.allowNested,Y=v.lineComment,j=v.supportsAtComponent===!0,V=te.highlightNonStandardPropertyKeywords!==!1,U,L;function P(w,O){return U=O,w}function Q(w,O){var S=w.next();if(T[S]){var se=T[S](w,O);if(se!==!1)return se}if(S=="@")return w.eatWhile(/[\w\\\-]/),P("def",w.current());if(S=="="||(S=="~"||S=="|")&&w.eat("="))return P(null,"compare");if(S=='"'||S=="'")return O.tokenize=we(S),O.tokenize(w,O);if(S=="#")return w.eatWhile(/[\w\\\-]/),P("atom","hash");if(S=="!")return w.match(/^\s*\w*/),P("keyword","important");if(/\d/.test(S)||S=="."&&w.eat(/\d/))return w.eatWhile(/[\w.%]/),P("number","unit");if(S==="-"){if(/[\d.]/.test(w.peek()))return w.eatWhile(/[\w.%]/),P("number","unit");if(w.match(/^-[\w\\\-]*/))return w.eatWhile(/[\w\\\-]/),w.match(/^\s*:/,!1)?P("variable-2","variable-definition"):P("variable-2","variable");if(w.match(/^\w+-/))return P("meta","meta")}else return/[,+>*\/]/.test(S)?P(null,"select-op"):S=="."&&w.match(/^-?[_a-z][_a-z0-9-]*/i)?P("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(S)?P(null,S):w.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(w.current())&&(O.tokenize=Oe),P("variable callee","variable")):/[\w\\\-]/.test(S)?(w.eatWhile(/[\w\\\-]/),P("property","word")):P(null,null)}function we(w){return function(O,S){for(var se=!1,rt;(rt=O.next())!=null;){if(rt==w&&!se){w==")"&&O.backUp(1);break}se=!se&&rt=="\\"}return(rt==w||!se&&w!=")")&&(S.tokenize=null),P("string","string")}}function Oe(w,O){return w.next(),w.match(/^\s*[\"\')]/,!1)?O.tokenize=null:O.tokenize=we(")"),P(null,"(")}function Le(w,O,S){this.type=w,this.indent=O,this.prev=S}function ce(w,O,S,se){return w.context=new Le(S,O.indentation()+(se===!1?0:m),w.context),S}function He(w){return w.context.prev&&(w.context=w.context.prev),w.context.type}function ie(w,O,S){return xe[S.context.type](w,O,S)}function Re(w,O,S,se){for(var rt=se||1;rt>0;rt--)S.context=S.context.prev;return ie(w,O,S)}function It(w){var O=w.current().toLowerCase();tt.hasOwnProperty(O)?L="atom":Me.hasOwnProperty(O)?L="keyword":L="variable"}var xe={};return xe.top=function(w,O,S){if(w=="{")return ce(S,O,"block");if(w=="}"&&S.context.prev)return He(S);if(j&&/@component/i.test(w))return ce(S,O,"atComponentBlock");if(/^@(-moz-)?document$/i.test(w))return ce(S,O,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(w))return ce(S,O,"atBlock");if(/^@(font-face|counter-style)/i.test(w))return S.stateArg=w,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(w))return"keyframes";if(w&&w.charAt(0)=="@")return ce(S,O,"at");if(w=="hash")L="builtin";else if(w=="word")L="tag";else{if(w=="variable-definition")return"maybeprop";if(w=="interpolation")return ce(S,O,"interpolation");if(w==":")return"pseudo";if(De&&w=="(")return ce(S,O,"parens")}return S.context.type},xe.block=function(w,O,S){if(w=="word"){var se=O.current().toLowerCase();return le.hasOwnProperty(se)?(L="property","maybeprop"):ve.hasOwnProperty(se)?(L=V?"string-2":"property","maybeprop"):De?(L=O.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(L+=" error","maybeprop")}else return w=="meta"?"block":!De&&(w=="hash"||w=="qualifier")?(L="error","block"):xe.top(w,O,S)},xe.maybeprop=function(w,O,S){return w==":"?ce(S,O,"prop"):ie(w,O,S)},xe.prop=function(w,O,S){if(w==";")return He(S);if(w=="{"&&De)return ce(S,O,"propBlock");if(w=="}"||w=="{")return Re(w,O,S);if(w=="(")return ce(S,O,"parens");if(w=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(O.current()))L+=" error";else if(w=="word")It(O);else if(w=="interpolation")return ce(S,O,"interpolation");return"prop"},xe.propBlock=function(w,O,S){return w=="}"?He(S):w=="word"?(L="property","maybeprop"):S.context.type},xe.parens=function(w,O,S){return w=="{"||w=="}"?Re(w,O,S):w==")"?He(S):w=="("?ce(S,O,"parens"):w=="interpolation"?ce(S,O,"interpolation"):(w=="word"&&It(O),"parens")},xe.pseudo=function(w,O,S){return w=="meta"?"pseudo":w=="word"?(L="variable-3",S.context.type):ie(w,O,S)},xe.documentTypes=function(w,O,S){return w=="word"&&c.hasOwnProperty(O.current())?(L="tag",S.context.type):xe.atBlock(w,O,S)},xe.atBlock=function(w,O,S){if(w=="(")return ce(S,O,"atBlock_parens");if(w=="}"||w==";")return Re(w,O,S);if(w=="{")return He(S)&&ce(S,O,De?"block":"top");if(w=="interpolation")return ce(S,O,"interpolation");if(w=="word"){var se=O.current().toLowerCase();se=="only"||se=="not"||se=="and"||se=="or"?L="keyword":z.hasOwnProperty(se)?L="attribute":M.hasOwnProperty(se)?L="property":R.hasOwnProperty(se)?L="keyword":le.hasOwnProperty(se)?L="property":ve.hasOwnProperty(se)?L=V?"string-2":"property":tt.hasOwnProperty(se)?L="atom":Me.hasOwnProperty(se)?L="keyword":L="error"}return S.context.type},xe.atComponentBlock=function(w,O,S){return w=="}"?Re(w,O,S):w=="{"?He(S)&&ce(S,O,De?"block":"top",!1):(w=="word"&&(L="error"),S.context.type)},xe.atBlock_parens=function(w,O,S){return w==")"?He(S):w=="{"||w=="}"?Re(w,O,S,2):xe.atBlock(w,O,S)},xe.restricted_atBlock_before=function(w,O,S){return w=="{"?ce(S,O,"restricted_atBlock"):w=="word"&&S.stateArg=="@counter-style"?(L="variable","restricted_atBlock_before"):ie(w,O,S)},xe.restricted_atBlock=function(w,O,S){return w=="}"?(S.stateArg=null,He(S)):w=="word"?(S.stateArg=="@font-face"&&!Ve.hasOwnProperty(O.current().toLowerCase())||S.stateArg=="@counter-style"&&!et.hasOwnProperty(O.current().toLowerCase())?L="error":L="property","maybeprop"):"restricted_atBlock"},xe.keyframes=function(w,O,S){return w=="word"?(L="variable","keyframes"):w=="{"?ce(S,O,"top"):ie(w,O,S)},xe.at=function(w,O,S){return w==";"?He(S):w=="{"||w=="}"?Re(w,O,S):(w=="word"?L="tag":w=="hash"&&(L="builtin"),"at")},xe.interpolation=function(w,O,S){return w=="}"?He(S):w=="{"||w==";"?Re(w,O,S):(w=="word"?L="variable":w!="variable"&&w!="("&&w!=")"&&(L="error"),"interpolation")},{startState:function(w){return{tokenize:null,state:N?"block":"top",stateArg:null,context:new Le(N?"block":"top",w||0,null)}},token:function(w,O){if(!O.tokenize&&w.eatSpace())return null;var S=(O.tokenize||Q)(w,O);return S&&typeof S=="object"&&(U=S[1],S=S[0]),L=S,U!="comment"&&(O.state=xe[O.state](U,w,O)),L},indent:function(w,O){var S=w.context,se=O&&O.charAt(0),rt=S.indent;return S.type=="prop"&&(se=="}"||se==")")&&(S=S.prev),S.prev&&(se=="}"&&(S.type=="block"||S.type=="top"||S.type=="interpolation"||S.type=="restricted_atBlock")?(S=S.prev,rt=S.indent):(se==")"&&(S.type=="parens"||S.type=="atBlock_parens")||se=="{"&&(S.type=="at"||S.type=="atBlock"))&&(rt=Math.max(0,S.indent-m))),rt},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:Y,fold:"brace"}});function Se(te){for(var v={},N=0;N<te.length;++N)v[te[N].toLowerCase()]=!0;return v}var q=["domain","regexp","url","url-prefix"],ue=Se(q),Ee=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],oe=Se(Ee),E=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],X=Se(E),K=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],D=Se(K),Z=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],pe=Se(Z),he=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],ze=Se(he),Ie=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],Ae=Se(Ie),ae=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],ee=Se(ae),fe=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],me=Se(fe),Xe=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],ut=Se(Xe),Ke=q.concat(Ee).concat(E).concat(K).concat(Z).concat(he).concat(fe).concat(Xe);W.registerHelper("hintWords","css",Ke);function be(te,v){for(var N=!1,m;(m=te.next())!=null;){if(N&&m=="/"){v.tokenize=null;break}N=m=="*"}return["comment","comment"]}W.defineMIME("text/css",{documentTypes:ue,mediaTypes:oe,mediaFeatures:X,mediaValueKeywords:D,propertyKeywords:pe,nonStandardPropertyKeywords:ze,fontProperties:Ae,counterDescriptors:ee,colorKeywords:me,valueKeywords:ut,tokenHooks:{"/":function(te,v){return te.eat("*")?(v.tokenize=be,be(te,v)):!1}},name:"css"}),W.defineMIME("text/x-scss",{mediaTypes:oe,mediaFeatures:X,mediaValueKeywords:D,propertyKeywords:pe,nonStandardPropertyKeywords:ze,colorKeywords:me,valueKeywords:ut,fontProperties:Ae,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(te,v){return te.eat("/")?(te.skipToEnd(),["comment","comment"]):te.eat("*")?(v.tokenize=be,be(te,v)):["operator","operator"]},":":function(te){return te.match(/^\s*\{/,!1)?[null,null]:!1},$:function(te){return te.match(/^[\w-]+/),te.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(te){return te.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),W.defineMIME("text/x-less",{mediaTypes:oe,mediaFeatures:X,mediaValueKeywords:D,propertyKeywords:pe,nonStandardPropertyKeywords:ze,colorKeywords:me,valueKeywords:ut,fontProperties:Ae,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(te,v){return te.eat("/")?(te.skipToEnd(),["comment","comment"]):te.eat("*")?(v.tokenize=be,be(te,v)):["operator","operator"]},"@":function(te){return te.eat("{")?[null,"interpolation"]:te.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)?!1:(te.eatWhile(/[\w\\\-]/),te.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),W.defineMIME("text/x-gss",{documentTypes:ue,mediaTypes:oe,mediaFeatures:X,propertyKeywords:pe,nonStandardPropertyKeywords:ze,fontProperties:Ae,counterDescriptors:ee,colorKeywords:me,valueKeywords:ut,supportsAtComponent:!0,tokenHooks:{"/":function(te,v){return te.eat("*")?(v.tokenize=be,be(te,v)):!1}},name:"css",helperType:"gss"})})})();var Ju=Yu.exports,kl={exports:{}},Sl;function Zu(){return Sl||(Sl=1,function(ye,Fe){(function(W){W(En())})(function(W){var Se={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},q={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};W.defineMode("xml",function(ue,Ee){var oe=ue.indentUnit,E={},X=Ee.htmlMode?Se:q;for(var K in X)E[K]=X[K];for(var K in Ee)E[K]=Ee[K];var D,Z;function pe(c,z){function M(ve){return z.tokenize=ve,ve(c,z)}var R=c.next();if(R=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?M(Ie("atom","]]>")):null:c.match("--")?M(Ie("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),M(Ae(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),z.tokenize=Ie("meta","?>"),"meta"):(D=c.eat("/")?"closeTag":"openTag",z.tokenize=he,"tag bracket");if(R=="&"){var le;return c.eat("#")?c.eat("x")?le=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):le=c.eatWhile(/[\d]/)&&c.eat(";"):le=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),le?"atom":"error"}else return c.eatWhile(/[^&<]/),null}pe.isInText=!0;function he(c,z){var M=c.next();if(M==">"||M=="/"&&c.eat(">"))return z.tokenize=pe,D=M==">"?"endTag":"selfcloseTag","tag bracket";if(M=="=")return D="equals",null;if(M=="<"){z.tokenize=pe,z.state=Xe,z.tagName=z.tagStart=null;var R=z.tokenize(c,z);return R?R+" tag error":"tag error"}else return/[\'\"]/.test(M)?(z.tokenize=ze(M),z.stringStartCol=c.column(),z.tokenize(c,z)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function ze(c){var z=function(M,R){for(;!M.eol();)if(M.next()==c){R.tokenize=he;break}return"string"};return z.isInAttribute=!0,z}function Ie(c,z){return function(M,R){for(;!M.eol();){if(M.match(z)){R.tokenize=pe;break}M.next()}return c}}function Ae(c){return function(z,M){for(var R;(R=z.next())!=null;){if(R=="<")return M.tokenize=Ae(c+1),M.tokenize(z,M);if(R==">")if(c==1){M.tokenize=pe;break}else return M.tokenize=Ae(c-1),M.tokenize(z,M)}return"meta"}}function ae(c){return c&&c.toLowerCase()}function ee(c,z,M){this.prev=c.context,this.tagName=z||"",this.indent=c.indented,this.startOfLine=M,(E.doNotIndent.hasOwnProperty(z)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function fe(c){c.context&&(c.context=c.context.prev)}function me(c,z){for(var M;;){if(!c.context||(M=c.context.tagName,!E.contextGrabbers.hasOwnProperty(ae(M))||!E.contextGrabbers[ae(M)].hasOwnProperty(ae(z))))return;fe(c)}}function Xe(c,z,M){return c=="openTag"?(M.tagStart=z.column(),ut):c=="closeTag"?Ke:Xe}function ut(c,z,M){return c=="word"?(M.tagName=z.current(),Z="tag",v):E.allowMissingTagName&&c=="endTag"?(Z="tag bracket",v(c,z,M)):(Z="error",ut)}function Ke(c,z,M){if(c=="word"){var R=z.current();return M.context&&M.context.tagName!=R&&E.implicitlyClosed.hasOwnProperty(ae(M.context.tagName))&&fe(M),M.context&&M.context.tagName==R||E.matchClosing===!1?(Z="tag",be):(Z="tag error",te)}else return E.allowMissingTagName&&c=="endTag"?(Z="tag bracket",be(c,z,M)):(Z="error",te)}function be(c,z,M){return c!="endTag"?(Z="error",be):(fe(M),Xe)}function te(c,z,M){return Z="error",be(c,z,M)}function v(c,z,M){if(c=="word")return Z="attribute",N;if(c=="endTag"||c=="selfcloseTag"){var R=M.tagName,le=M.tagStart;return M.tagName=M.tagStart=null,c=="selfcloseTag"||E.autoSelfClosers.hasOwnProperty(ae(R))?me(M,R):(me(M,R),M.context=new ee(M,R,le==M.indented)),Xe}return Z="error",v}function N(c,z,M){return c=="equals"?m:(E.allowMissing||(Z="error"),v(c,z,M))}function m(c,z,M){return c=="string"?T:c=="word"&&E.allowUnquoted?(Z="string",v):(Z="error",v(c,z,M))}function T(c,z,M){return c=="string"?T:v(c,z,M)}return{startState:function(c){var z={tokenize:pe,state:Xe,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(z.baseIndent=c),z},token:function(c,z){if(!z.tagName&&c.sol()&&(z.indented=c.indentation()),c.eatSpace())return null;D=null;var M=z.tokenize(c,z);return(M||D)&&M!="comment"&&(Z=null,z.state=z.state(D||M,c,z),Z&&(M=Z=="error"?M+" error":Z)),M},indent:function(c,z,M){var R=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+oe;if(R&&R.noIndent)return W.Pass;if(c.tokenize!=he&&c.tokenize!=pe)return M?M.match(/^(\s*)/)[0].length:0;if(c.tagName)return E.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+oe*(E.multilineTagIndentFactor||1);if(E.alignCDATA&&/<!\[CDATA\[/.test(z))return 0;var le=z&&/^<(\/)?([\w_:\.-]*)/.exec(z);if(le&&le[1])for(;R;)if(R.tagName==le[2]){R=R.prev;break}else if(E.implicitlyClosed.hasOwnProperty(ae(R.tagName)))R=R.prev;else break;else if(le)for(;R;){var ve=E.contextGrabbers[ae(R.tagName)];if(ve&&ve.hasOwnProperty(ae(le[2])))R=R.prev;else break}for(;R&&R.prev&&!R.startOfLine;)R=R.prev;return R?R.indent+oe:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:E.htmlMode?"html":"xml",helperType:E.htmlMode?"html":"xml",skipAttribute:function(c){c.state==m&&(c.state=v)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var z=[],M=c.context;M;M=M.prev)z.push(M.tagName);return z.reverse()}}}),W.defineMIME("text/xml","xml"),W.defineMIME("application/xml","xml"),W.mimeModes.hasOwnProperty("text/html")||W.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),kl.exports}(function(ye,Fe){(function(W){W(En(),Zu(),Xu,Ju)})(function(W){var Se={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function q(D,Z,pe){var he=D.current(),ze=he.search(Z);return ze>-1?D.backUp(he.length-ze):he.match(/<\/?$/)&&(D.backUp(he.length),D.match(Z,!1)||D.match(he)),pe}var ue={};function Ee(D){var Z=ue[D];return Z||(ue[D]=new RegExp("\\s+"+D+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function oe(D,Z){var pe=D.match(Ee(Z));return pe?/^\s*(.*?)\s*$/.exec(pe[2])[1]:""}function E(D,Z){return new RegExp((Z?"^":"")+"</\\s*"+D+"\\s*>","i")}function X(D,Z){for(var pe in D)for(var he=Z[pe]||(Z[pe]=[]),ze=D[pe],Ie=ze.length-1;Ie>=0;Ie--)he.unshift(ze[Ie])}function K(D,Z){for(var pe=0;pe<D.length;pe++){var he=D[pe];if(!he[0]||he[1].test(oe(Z,he[0])))return he[2]}}W.defineMode("htmlmixed",function(D,Z){var pe=W.getMode(D,{name:"xml",htmlMode:!0,multilineTagIndentFactor:Z.multilineTagIndentFactor,multilineTagIndentPastTag:Z.multilineTagIndentPastTag,allowMissingTagName:Z.allowMissingTagName}),he={},ze=Z&&Z.tags,Ie=Z&&Z.scriptTypes;if(X(Se,he),ze&&X(ze,he),Ie)for(var Ae=Ie.length-1;Ae>=0;Ae--)he.script.unshift(["type",Ie[Ae].matches,Ie[Ae].mode]);function ae(ee,fe){var me=pe.token(ee,fe.htmlState),Xe=/\btag\b/.test(me),ut;if(Xe&&!/[<>\s\/]/.test(ee.current())&&(ut=fe.htmlState.tagName&&fe.htmlState.tagName.toLowerCase())&&he.hasOwnProperty(ut))fe.inTag=ut+" ";else if(fe.inTag&&Xe&&/>$/.test(ee.current())){var Ke=/^([\S]+) (.*)/.exec(fe.inTag);fe.inTag=null;var be=ee.current()==">"&&K(he[Ke[1]],Ke[2]),te=W.getMode(D,be),v=E(Ke[1],!0),N=E(Ke[1],!1);fe.token=function(m,T){return m.match(v,!1)?(T.token=ae,T.localState=T.localMode=null,null):q(m,N,T.localMode.token(m,T.localState))},fe.localMode=te,fe.localState=W.startState(te,pe.indent(fe.htmlState,"",""))}else fe.inTag&&(fe.inTag+=ee.current(),ee.eol()&&(fe.inTag+=" "));return me}return{startState:function(){var ee=W.startState(pe);return{token:ae,inTag:null,localMode:null,localState:null,htmlState:ee}},copyState:function(ee){var fe;return ee.localState&&(fe=W.copyState(ee.localMode,ee.localState)),{token:ee.token,inTag:ee.inTag,localMode:ee.localMode,localState:fe,htmlState:W.copyState(pe,ee.htmlState)}},token:function(ee,fe){return fe.token(ee,fe)},indent:function(ee,fe,me){return!ee.localMode||/^\s*<\//.test(fe)?pe.indent(ee.htmlState,fe,me):ee.localMode.indent?ee.localMode.indent(ee.localState,fe,me):W.Pass},innerMode:function(ee){return{state:ee.localState||ee.htmlState,mode:ee.localMode||pe}}}},"xml","javascript","css"),W.defineMIME("text/html","htmlmixed")})})();const Vu=go({__name:"CodeMirror",props:{mode:{type:String,default:Qr.JSON,validator(ye){return Object.values(Qr).includes(ye)}},value:{type:String,default:""},readonly:{type:Boolean,default:!1}},emits:["change"],setup(ye,{emit:Fe}){const W=ye,Se=Hu();let q;const ue=Pu(E,100),Ee=Wu();bl(()=>W.value,K=>Wn(this,null,function*(){yield wl();const D=q==null?void 0:q.getValue();K!==D&&(q==null||q.setValue(K||""))}),{flush:"post"}),Fu(()=>{q==null||q.setOption("mode",W.mode)}),bl(()=>Ee.getDarkMode,()=>Wn(this,null,function*(){oe()}),{immediate:!0});function oe(){var K;(K=Tl(q))==null||K.setOption("theme",Ee.getDarkMode==="light"?"idea":"material-palenight")}function E(){q==null||q.refresh()}function X(){return Wn(this,null,function*(){const K={autoCloseBrackets:!0,autoCloseTags:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers"]};q=Gu(Se.value,ml({value:"",mode:W.mode,readOnly:W.readonly,tabSize:2,theme:"material-palenight",lineWrapping:!0,lineNumbers:!0},K)),q==null||q.setValue(W.value),oe(),q==null||q.on("change",()=>{Fe("change",q==null?void 0:q.getValue())})})}return Iu(()=>Wn(this,null,function*(){yield wl(),X(),ju(ue)})),Bu(()=>{q=null}),(K,D)=>(yo(),Ll("div",{class:"relative !h-full w-full overflow-hidden",ref_key:"el",ref:Se},null,512))}}),Qu=vo(Vu,[["__file","E:/allcode/erp/test7901/order-erp-front/src/components/CodeEditor/src/codemirror/CodeMirror.vue"]]),$u={class:"h-full"},ef=go({__name:"CodeEditor",props:{value:{type:[Object,String]},mode:{type:String,default:Qr.JSON,validator(ye){return Object.values(Qr).includes(ye)}},readonly:{type:Boolean},autoFormat:{type:Boolean,default:!0}},emits:["change","update:value","format-error"],setup(ye,{emit:Fe}){const W=ye,Se=Ru(()=>{const{value:ue,mode:Ee,autoFormat:oe}=W;if(!oe||Ee!==Qr.JSON)return ue;let E=ue;if(Eu(ue))try{E=JSON.parse(ue)}catch(X){return Fe("format-error",ue),ue}return JSON.stringify(E,null,2)});function q(ue){Fe("update:value",ue),Fe("change",ue)}return(ue,Ee)=>(yo(),Ll("div",$u,[_u(Qu,{value:Se.value,onChange:q,mode:ye.mode,readonly:ye.readonly},null,8,["value","mode","readonly"])]))}}),tf=vo(ef,[["__file","E:/allcode/erp/test7901/order-erp-front/src/components/CodeEditor/src/CodeEditor.vue"]]);var Ol={exports:{}};(function(ye,Fe){(function(W,Se){ye.exports=Se(zu)})(Ml,function(W){return function(){var Se={789:function(oe){oe.exports=W}},q={};function ue(oe){var E=q[oe];if(E!==void 0)return E.exports;var X=q[oe]={exports:{}};return Se[oe](X,X.exports,ue),X.exports}ue.d=function(oe,E){for(var X in E)ue.o(E,X)&&!ue.o(oe,X)&&Object.defineProperty(oe,X,{enumerable:!0,get:E[X]})},ue.o=function(oe,E){return Object.prototype.hasOwnProperty.call(oe,E)},ue.r=function(oe){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(oe,"__esModule",{value:!0})};var Ee={};return function(){function oe(v,N){(N==null||N>v.length)&&(N=v.length);for(var m=0,T=new Array(N);m<N;m++)T[m]=v[m];return T}function E(v,N){if(v){if(typeof v=="string")return oe(v,N);var m=Object.prototype.toString.call(v).slice(8,-1);return m==="Object"&&v.constructor&&(m=v.constructor.name),m==="Map"||m==="Set"?Array.from(v):m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m)?oe(v,N):void 0}}function X(v){return function(N){if(Array.isArray(N))return oe(N)}(v)||function(N){if(typeof Symbol!="undefined"&&N[Symbol.iterator]!=null||N["@@iterator"]!=null)return Array.from(N)}(v)||E(v)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function K(v,N,m){return N in v?Object.defineProperty(v,N,{value:m,enumerable:!0,configurable:!0,writable:!0}):v[N]=m,v}ue.r(Ee),ue.d(Ee,{default:function(){return te}});var D=ue(789),Z=(0,D.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var v=this.data,N=this.onClick;return(0,D.createVNode)("span",{class:"vjs-tree-brackets",onClick:N},[v])}}),pe=(0,D.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(v,N){var m=N.emit;return{uiType:(0,D.computed)(function(){return v.isMultiple?"checkbox":"radio"}),model:(0,D.computed)({get:function(){return v.checked},set:function(T){return m("update:modelValue",T)}})}},render:function(){var v=this.uiType,N=this.model,m=this.$emit;return(0,D.createVNode)("label",{class:["vjs-check-controller",N?"is-checked":""],onClick:function(T){return T.stopPropagation()}},[(0,D.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(v)},null),(0,D.createVNode)("input",{checked:N,class:"vjs-check-controller-original is-".concat(v),type:v,onChange:function(){return m("change",N)}},null)])}}),he=(0,D.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var v=this.nodeType,N=this.onClick,m=v==="objectStart"||v==="arrayStart";return m||v==="objectCollapsed"||v==="arrayCollapsed"?(0,D.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(m?"open":"close"),onClick:N},[(0,D.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,D.createVNode)("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},null)])]):null}});function ze(v){return ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(N){return typeof N}:function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},ze(v)}function Ie(v){return Object.prototype.toString.call(v).slice(8,-1).toLowerCase()}function Ae(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"root",m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,T=arguments.length>3?arguments[3]:void 0,c=T||{},z=c.key,M=c.index,R=c.type,le=R===void 0?"content":R,ve=c.showComma,Ve=ve!==void 0&&ve,et=c.length,Me=et===void 0?1:et,tt=Ie(v);if(tt==="array"){var De=ae(v.map(function(V,U,L){return Ae(V,"".concat(N,"[").concat(U,"]"),m+1,{index:U,showComma:U!==L.length-1,length:Me,type:le})}));return[Ae("[",N,m,{showComma:!1,key:z,length:v.length,type:"arrayStart"})[0]].concat(De,Ae("]",N,m,{showComma:Ve,length:v.length,type:"arrayEnd"})[0])}if(tt==="object"){var Y=Object.keys(v),j=ae(Y.map(function(V,U,L){return Ae(v[V],/^[a-zA-Z_]\w*$/.test(V)?"".concat(N,".").concat(V):"".concat(N,'["').concat(V,'"]'),m+1,{key:V,showComma:U!==L.length-1,length:Me,type:le})}));return[Ae("{",N,m,{showComma:!1,key:z,index:M,length:Y.length,type:"objectStart"})[0]].concat(j,Ae("}",N,m,{showComma:Ve,length:Y.length,type:"objectEnd"})[0])}return[{content:v,level:m,key:z,index:M,path:N,showComma:Ve,length:Me,type:le}]}function ae(v){if(typeof Array.prototype.flat=="function")return v.flat();for(var N=X(v),m=[];N.length;){var T=N.shift();Array.isArray(T)?N.unshift.apply(N,X(T)):m.push(T)}return m}function ee(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(v==null)return v;if(v instanceof Date)return new Date(v);if(v instanceof RegExp)return new RegExp(v);if(ze(v)!=="object")return v;if(N.get(v))return N.get(v);if(Array.isArray(v)){var m=v.map(function(z){return ee(z,N)});return N.set(v,m),m}var T={};for(var c in v)T[c]=ee(v[c],N);return N.set(v,T),T}function fe(v,N){var m=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);N&&(T=T.filter(function(c){return Object.getOwnPropertyDescriptor(v,c).enumerable})),m.push.apply(m,T)}return m}function me(v){for(var N=1;N<arguments.length;N++){var m=arguments[N]!=null?arguments[N]:{};N%2?fe(Object(m),!0).forEach(function(T){K(v,T,m[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(m)):fe(Object(m)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(m,T))})}return v}var Xe={showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},renderNodeKey:Function,renderNodeValue:Function,selectableType:String,showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},showLineNumber:{type:Boolean,default:!1},selectOnClickNode:{type:Boolean,default:!0},nodeSelectable:{type:Function,default:function(){return!0}},highlightSelectedNode:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!1},showKeyValueSpace:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},editableTrigger:{type:String,default:"click"},onNodeClick:{type:Function},onBracketsClick:{type:Function},onIconClick:{type:Function},onValueChange:{type:Function}},ut=(0,D.defineComponent)({name:"TreeNode",props:me(me({},Xe),{},{node:{type:Object,required:!0},collapsed:Boolean,checked:Boolean,style:Object,onSelectedChange:{type:Function}}),emits:["nodeClick","bracketsClick","iconClick","selectedChange","valueChange"],setup:function(v,N){var m=N.emit,T=(0,D.computed)(function(){return Ie(v.node.content)}),c=(0,D.computed)(function(){return"vjs-value vjs-value-".concat(T.value)}),z=(0,D.computed)(function(){return v.showDoubleQuotes?'"'.concat(v.node.key,'"'):v.node.key}),M=(0,D.computed)(function(){return v.selectableType==="multiple"}),R=(0,D.computed)(function(){return v.selectableType==="single"}),le=(0,D.computed)(function(){return v.nodeSelectable(v.node)&&(M.value||R.value)}),ve=(0,D.reactive)({editing:!1}),Ve=function(U){var L,P,Q=(P=(L=U.target)===null||L===void 0?void 0:L.value)==="null"?null:P==="undefined"?void 0:P==="true"||P!=="false"&&(P[0]+P[P.length-1]==='""'||P[0]+P[P.length-1]==="''"?P.slice(1,-1):typeof Number(P)=="number"&&!isNaN(Number(P))||P==="NaN"?Number(P):P);m("valueChange",Q,v.node.path)},et=(0,D.computed)(function(){var U,L=(U=v.node)===null||U===void 0?void 0:U.content;return L===null?L="null":L===void 0&&(L="undefined"),T.value==="string"?'"'.concat(L,'"'):L+""}),Me=function(){var U=v.renderNodeValue;return U?U({node:v.node,defaultValue:et.value}):et.value},tt=function(){m("bracketsClick",!v.collapsed,v.node.path)},De=function(){m("iconClick",!v.collapsed,v.node.path)},Y=function(){m("selectedChange",v.node)},j=function(){m("nodeClick",v.node),le.value&&v.selectOnClickNode&&m("selectedChange",v.node)},V=function(U){if(v.editable&&!ve.editing){ve.editing=!0;var L=function P(Q){var we;Q.target!==U.target&&((we=Q.target)===null||we===void 0?void 0:we.parentElement)!==U.target&&(ve.editing=!1,document.removeEventListener("click",P))};document.removeEventListener("click",L),document.addEventListener("click",L)}};return function(){var U,L=v.node;return(0,D.createVNode)("div",{class:{"vjs-tree-node":!0,"has-selector":v.showSelectController,"has-carets":v.showIcon,"is-highlight":v.highlightSelectedNode&&v.checked},onClick:j,style:v.style},[v.showLineNumber&&(0,D.createVNode)("span",{class:"vjs-node-index"},[L.id+1]),v.showSelectController&&le.value&&L.type!=="objectEnd"&&L.type!=="arrayEnd"&&(0,D.createVNode)(pe,{isMultiple:M.value,checked:v.checked,onChange:Y},null),(0,D.createVNode)("div",{class:"vjs-indent"},[Array.from(Array(L.level)).map(function(P,Q){return(0,D.createVNode)("div",{key:Q,class:{"vjs-indent-unit":!0,"has-line":v.showLine}},null)}),v.showIcon&&(0,D.createVNode)(he,{nodeType:L.type,onClick:De},null)]),L.key&&(0,D.createVNode)("span",{class:"vjs-key"},[(U=v.renderNodeKey,U?U({node:v.node,defaultKey:z.value||""}):z.value),(0,D.createVNode)("span",{class:"vjs-colon"},[":".concat(v.showKeyValueSpace?" ":"")])]),(0,D.createVNode)("span",null,[L.type!=="content"&&L.content?(0,D.createVNode)(Z,{data:L.content.toString(),onClick:tt},null):(0,D.createVNode)("span",{class:c.value,onClick:!v.editable||v.editableTrigger&&v.editableTrigger!=="click"?void 0:V,onDblclick:v.editable&&v.editableTrigger==="dblclick"?V:void 0},[v.editable&&ve.editing?(0,D.createVNode)("input",{value:et.value,onChange:Ve,style:{padding:"3px 8px",border:"1px solid #eee",boxShadow:"none",boxSizing:"border-box",borderRadius:5,fontFamily:"inherit"}},null):Me()]),L.showComma&&(0,D.createVNode)("span",null,[","]),v.showLength&&v.collapsed&&(0,D.createVNode)("span",{class:"vjs-comment"},[(0,D.createTextVNode)(" // "),L.length,(0,D.createTextVNode)(" items ")])])])}}});function Ke(v,N){var m=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);N&&(T=T.filter(function(c){return Object.getOwnPropertyDescriptor(v,c).enumerable})),m.push.apply(m,T)}return m}function be(v){for(var N=1;N<arguments.length;N++){var m=arguments[N]!=null?arguments[N]:{};N%2?Ke(Object(m),!0).forEach(function(T){K(v,T,m[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(m)):Ke(Object(m)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(m,T))})}return v}var te=(0,D.defineComponent)({name:"Tree",props:be(be({},Xe),{},{data:{type:[String,Number,Boolean,Array,Object],default:null},deep:{type:Number,default:1/0},pathCollapsible:{type:Function,default:function(){return!1}},rootPath:{type:String,default:"root"},virtual:{type:Boolean,default:!1},height:{type:Number,default:400},itemHeight:{type:Number,default:20},selectedValue:{type:[String,Array],default:function(){return""}},collapsedOnClickBrackets:{type:Boolean,default:!0},style:Object,onSelectedChange:{type:Function}}),slots:["renderNodeKey","renderNodeValue"],emits:["nodeClick","bracketsClick","iconClick","selectedChange","update:selectedValue","update:data"],setup:function(v,N){var m=N.emit,T=N.slots,c=(0,D.ref)(),z=(0,D.computed)(function(){return Ae(v.data,v.rootPath)}),M=function(L){return z.value.reduce(function(P,Q){var we,Oe=Q.level>=L,Le=(we=v.pathCollapsible)===null||we===void 0?void 0:we.call(v,Q);return Q.type!=="objectStart"&&Q.type!=="arrayStart"||!Oe&&!Le?P:be(be({},P),{},K({},Q.path,1))},{})},R=(0,D.reactive)({translateY:0,visibleData:null,hiddenPaths:M(v.deep)}),le=(0,D.computed)(function(){for(var L=null,P=[],Q=z.value.length,we=0;we<Q;we++){var Oe=be(be({},z.value[we]),{},{id:we}),Le=R.hiddenPaths[Oe.path];if(L&&L.path===Oe.path){var ce=L.type==="objectStart",He=be(be(be({},Oe),L),{},{showComma:Oe.showComma,content:ce?"{...}":"[...]",type:ce?"objectCollapsed":"arrayCollapsed"});L=null,P.push(He)}else{if(Le&&!L){L=Oe;continue}if(L)continue;P.push(Oe)}}return P}),ve=(0,D.computed)(function(){var L=v.selectedValue;return L&&v.selectableType==="multiple"&&Array.isArray(L)?L:[L]}),Ve=(0,D.computed)(function(){return!v.selectableType||v.selectOnClickNode||v.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."}),et=function(){var L=le.value;if(v.virtual){var P,Q=v.height/v.itemHeight,we=((P=c.value)===null||P===void 0?void 0:P.scrollTop)||0,Oe=Math.floor(we/v.itemHeight),Le=Oe<0?0:Oe+Q>L.length?L.length-Q:Oe;Le<0&&(Le=0);var ce=Le+Q;R.translateY=Le*v.itemHeight,R.visibleData=L.filter(function(He,ie){return ie>=Le&&ie<ce})}else R.visibleData=L},Me=function(){et()},tt=function(L){var P,Q,we=L.path,Oe=v.selectableType;if(Oe==="multiple"){var Le=ve.value.findIndex(function(Re){return Re===we}),ce=X(ve.value);Le!==-1?ce.splice(Le,1):ce.push(we),m("update:selectedValue",ce),m("selectedChange",ce,X(ve.value))}else if(Oe==="single"&&ve.value[0]!==we){var He=(P=ve.value,Q=1,function(Re){if(Array.isArray(Re))return Re}(P)||function(Re,It){var xe=Re==null?null:typeof Symbol!="undefined"&&Re[Symbol.iterator]||Re["@@iterator"];if(xe!=null){var w,O,S=[],se=!0,rt=!1;try{for(xe=xe.call(Re);!(se=(w=xe.next()).done)&&(S.push(w.value),!It||S.length!==It);se=!0);}catch(ir){rt=!0,O=ir}finally{try{se||xe.return==null||xe.return()}finally{if(rt)throw O}}return S}}(P,Q)||E(P,Q)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())[0],ie=we;m("update:selectedValue",ie),m("selectedChange",ie,He)}},De=function(L){m("nodeClick",L)},Y=function(L,P){if(L)R.hiddenPaths=be(be({},R.hiddenPaths),{},K({},P,1));else{var Q=be({},R.hiddenPaths);delete Q[P],R.hiddenPaths=Q}},j=function(L,P){v.collapsedOnClickBrackets&&Y(L,P),m("bracketsClick",L)},V=function(L,P){Y(L,P),m("iconClick",L)},U=function(L,P){var Q=ee(v.data),we=v.rootPath;new Function("data","val","data".concat(P.slice(we.length),"=val"))(Q,L),m("update:data",Q)};return(0,D.watchEffect)(function(){Ve.value&&function(L){throw new Error("[VueJSONPretty] ".concat(L))}(Ve.value)}),(0,D.watchEffect)(function(){le.value&&et()}),(0,D.watch)(function(){return v.deep},function(L){L&&(R.hiddenPaths=M(L))}),function(){var L,P,Q=(L=v.renderNodeKey)!==null&&L!==void 0?L:T.renderNodeKey,we=(P=v.renderNodeValue)!==null&&P!==void 0?P:T.renderNodeValue,Oe=R.visibleData&&R.visibleData.map(function(Le){return(0,D.createVNode)(ut,{key:Le.id,node:Le,collapsed:!!R.hiddenPaths[Le.path],showDoubleQuotes:v.showDoubleQuotes,showLength:v.showLength,checked:ve.value.includes(Le.path),selectableType:v.selectableType,showLine:v.showLine,showLineNumber:v.showLineNumber,showSelectController:v.showSelectController,selectOnClickNode:v.selectOnClickNode,nodeSelectable:v.nodeSelectable,highlightSelectedNode:v.highlightSelectedNode,editable:v.editable,editableTrigger:v.editableTrigger,showIcon:v.showIcon,showKeyValueSpace:v.showKeyValueSpace,renderNodeKey:Q,renderNodeValue:we,onNodeClick:De,onBracketsClick:j,onIconClick:V,onSelectedChange:tt,onValueChange:U,style:v.itemHeight&&v.itemHeight!==20?{lineHeight:"".concat(v.itemHeight,"px")}:{}},null)});return(0,D.createVNode)("div",{ref:c,class:{"vjs-tree":!0,"is-virtual":v.virtual},onScroll:v.virtual?Me:void 0,style:v.showLineNumber?be({paddingLeft:"".concat(12*Number(z.value.length.toString().length),"px")},v.style):v.style},[v.virtual?(0,D.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(v.height,"px")}},[(0,D.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(le.value.length*v.itemHeight,"px")}},[(0,D.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(R.translateY,"px)")}},[Oe])])]):Oe])}}})}(),Ee}()})})(Ol);var rf=Ol.exports;const nf=Nl(rf);const of=go({__name:"JsonPreview",props:{data:Object},setup(ye){return(Fe,W)=>(yo(),Ku(Tl(nf),{path:"res",deep:3,showLength:!0,data:ye.data},null,8,["data"]))}}),af=vo(of,[["__file","E:/allcode/erp/test7901/order-erp-front/src/components/CodeEditor/src/json-preview/JsonPreview.vue"]]),df=Cl(tf),hf=Cl(af);export{df as C,hf as J,Qr as M};