MCPcopy
hub / github.com/vitest-dev/vitest / Of

Function Of

test/cli/test/fixtures/reporters/html/fail/assets/index-BUCFJtth.js:23–23  ·  view source on GitHub ↗
(n,i,a,l)

Source from the content-addressed store, hash-verified

21b`.split(/\n/).length!=3?function(n){for(var i=0,a=[],l=n.length;i<=l;){var u=n.indexOf(`
22`,i);u==-1&&(u=n.length);var m=n.slice(i,n.charAt(u-1)=="\r"?u-1:u),y=m.indexOf("\r");y!=-1?(a.push(m.slice(0,y)),i+=y+1):(a.push(m),i=u+1)}return a}:function(n){return n.split(/\r\n?|\n/)},Ri=window.getSelection?function(n){try{return n.selectionStart!=n.selectionEnd}catch{return!1}}:function(n){var i;try{i=n.ownerDocument.selection.createRange()}catch{}return!i||i.parentElement()!=n?!1:i.compareEndPoints("StartToEnd",i)!=0},Ka=(function(){var n=k("div");return"oncopy"in n?!0:(n.setAttribute("oncopy","return;"),typeof n.oncopy=="function")})(),wr=null;function vf(n){if(wr!=null)return wr;var i=C(n,k("span","x")),a=i.getBoundingClientRect(),l=B(i,0,1).getBoundingClientRect();return wr=Math.abs(a.left-l.left)>1}var Qo={},xr={};function kr(n,i){arguments.length>2&&(i.dependencies=Array.prototype.slice.call(arguments,2)),Qo[n]=i}function bo(n,i){xr[n]=i}function es(n){if(typeof n=="string"&&xr.hasOwnProperty(n))n=xr[n];else if(n&&typeof n.name=="string"&&xr.hasOwnProperty(n.name)){var i=xr[n.name];typeof i=="string"&&(i={name:i}),n=oe(i,n),n.name=i.name}else{if(typeof n=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(n))return es("application/xml");if(typeof n=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(n))return es("application/json")}return typeof n=="string"?{name:n}:n||{name:"null"}}function ts(n,i){i=es(i);var a=Qo[i.name];if(!a)return ts(n,"text/plain");var l=a(n,i);if($i.hasOwnProperty(i.name)){var u=$i[i.name];for(var m in u)u.hasOwnProperty(m)&&(l.hasOwnProperty(m)&&(l["_"+m]=l[m]),l[m]=u[m])}if(l.name=i.name,i.helperType&&(l.helperType=i.helperType),i.modeProps)for(var y in i.modeProps)l[y]=i.modeProps[y];return l}var $i={};function ns(n,i){var a=$i.hasOwnProperty(n)?$i[n]:$i[n]={};Y(i,a)}function Br(n,i){if(i===!0)return i;if(n.copyState)return n.copyState(i);var a={};for(var l in i){var u=i[l];u instanceof Array&&(u=u.concat([])),a[l]=u}return a}function al(n,i){for(var a;n.innerMode&&(a=n.innerMode(i),!(!a||a.mode==n));)i=a.state,n=a.mode;return a||{mode:n,state:i}}function rs(n,i,a){return n.startState?n.startState(i,a):!0}var $t=function(n,i,a){this.pos=this.start=0,this.string=n,this.tabSize=i||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=a};$t.prototype.eol=function(){return this.pos>=this.string.length},$t.prototype.sol=function(){return this.pos==this.lineStart},$t.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$t.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},$t.prototype.eat=function(n){var i=this.string.charAt(this.pos),a;if(typeof n=="string"?a=i==n:a=i&&(n.test?n.test(i):n(i)),a)return++this.pos,i},$t.prototype.eatWhile=function(n){for(var i=this.pos;this.eat(n););return this.pos>i},$t.prototype.eatSpace=function(){for(var n=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>n},$t.prototype.skipToEnd=function(){this.pos=this.string.length},$t.prototype.skipTo=function(n){var i=this.string.indexOf(n,this.pos);if(i>-1)return this.pos=i,!0},$t.prototype.backUp=function(n){this.pos-=n},$t.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=re(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?re(this.string,this.lineStart,this.tabSize):0)},$t.prototype.indentation=function(){return re(this.string,null,this.tabSize)-(this.lineStart?re(this.string,this.lineStart,this.tabSize):0)},$t.prototype.match=function(n,i,a){if(typeof n=="string"){var l=function(y){return a?y.toLowerCase():y},u=this.string.substr(this.pos,n.length);if(l(u)==l(n))return i!==!1&&(this.pos+=n.length),!0}else{var m=this.string.slice(this.pos).match(n);return m&&m.index>0?null:(m&&i!==!1&&(this.pos+=m[0].length),m)}},$t.prototype.current=function(){return this.string.slice(this.start,this.pos)},$t.prototype.hideFirstChars=function(n,i){this.lineStart+=n;try{return i()}finally{this.lineStart-=n}},$t.prototype.lookAhead=function(n){var i=this.lineOracle;return i&&i.lookAhead(n)},$t.prototype.baseToken=function(){var n=this.lineOracle;return n&&n.baseToken(this.pos)};function qe(n,i){if(i-=n.first,i<0||i>=n.size)throw new Error("There is no line "+(i+n.first)+" in the document.");for(var a=n;!a.lines;)for(var l=0;;++l){var u=a.children[l],m=u.chunkSize();if(i<m){a=u;break}i-=m}return a.lines[i]}function ii(n,i,a){var l=[],u=i.line;return n.iter(i.line,a.line+1,function(m){var y=m.text;u==a.line&&(y=y.slice(0,a.ch)),u==i.line&&(y=y.slice(i.ch)),l.push(y),++u}),l}function cl(n,i,a){var l=[];return n.iter(i,a,function(u){l.push(u.text)}),l}function Qn(n,i){var a=i-n.height;if(a)for(var l=n;l;l=l.parent)l.height+=a}function A(n){if(n.parent==null)return null;for(var i=n.parent,a=ae(i.lines,n),l=i.parent;l;i=l,l=l.parent)for(var u=0;l.children[u]!=i;++u)a+=l.children[u].chunkSize();return a+i.first}function U(n,i){var a=n.first;e:do{for(var l=0;l<n.children.length;++l){var u=n.children[l],m=u.height;if(i<m){n=u;continue e}i-=m,a+=u.chunkSize()}return a}while(!n.lines);for(var y=0;y<n.lines.length;++y){var x=n.lines[y],S=x.height;if(i<S)break;i-=S}return a+y}function me(n,i){return i>=n.first&&i<n.first+n.size}function _e(n,i){return String(n.lineNumberFormatter(i+n.firstLineNumber))}function fe(n,i,a){if(a===void 0&&(a=null),!(this instanceof fe))return new fe(n,i,a);this.line=n,this.ch=i,this.sticky=a}function Ie(n,i){return n.line-i.line||n.ch-i.ch}function pt(n,i){return n.sticky==i.sticky&&Ie(n,i)==0}function Zt(n){return fe(n.line,n.ch)}function Sn(n,i){return Ie(n,i)<0?i:n}function is(n,i){return Ie(n,i)<0?n:i}function Wp(n,i){return Math.max(n.first,Math.min(i,n.first+n.size-1))}function tt(n,i){if(i.line<n.first)return fe(n.first,0);var a=n.first+n.size-1;return i.line>a?fe(a,qe(n,a).text.length):I1(i,qe(n,i.line).text.length)}function I1(n,i){var a=n.ch;return a==null||a>i?fe(n.line,i):a<0?fe(n.line,0):n}function qp(n,i){for(var a=[],l=0;l<i.length;l++)a[l]=tt(n,i[l]);return a}var Xa=function(n,i){this.state=n,this.lookAhead=i},Wr=function(n,i,a,l){this.state=i,this.doc=n,this.line=a,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Wr.prototype.lookAhead=function(n){var i=this.doc.getLine(this.line+n);return i!=null&&n>this.maxLookAhead&&(this.maxLookAhead=n),i},Wr.prototype.baseToken=function(n){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=n;)this.baseTokenPos+=2;var i=this.baseTokens[this.baseTokenPos+1];return{type:i&&i.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-n}},Wr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Wr.fromSaved=function(n,i,a){return i instanceof Xa?new Wr(n,Br(n.mode,i.state),a,i.lookAhead):new Wr(n,Br(n.mode,i),a)},Wr.prototype.save=function(n){var i=n!==!1?Br(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Xa(i,this.maxLookAhead):i};function jp(n,i,a,l){var u=[n.state.modeGen],m={};Yp(n,i.text,n.doc.mode,a,function(T,H){return u.push(T,H)},m,l);for(var y=a.state,x=function(T){a.baseTokens=u;var H=n.state.overlays[T],V=1,se=0;a.state=!0,Yp(n,i.text,H.mode,a,function(te,pe){for(var we=V;se<te;){var Te=u[V];Te>te&&u.splice(V,1,te,u[V+1],Te),V+=2,se=Math.min(te,Te)}if(pe)if(H.opaque)u.splice(we,V-we,te,"overlay "+pe),V=we+2;else for(;we<V;we+=2){var Le=u[we+1];u[we+1]=(Le?Le+" ":"")+"overlay "+pe}},m),a.state=y,a.baseTokens=null,a.baseTokenPos=1},S=0;S<n.state.overlays.length;++S)x(S);return{styles:u,classes:m.bgClass||m.textClass?m:null}}function Up(n,i,a){if(!i.styles||i.styles[0]!=n.state.modeGen){var l=ul(n,A(i)),u=i.text.length>n.options.maxHighlightLength&&Br(n.doc.mode,l.state),m=jp(n,i,l);u&&(l.state=u),i.stateAfter=l.save(!u),i.styles=m.styles,m.classes?i.styleClasses=m.classes:i.styleClasses&&(i.styleClasses=null),a===n.doc.highlightFrontier&&(n.doc.modeFrontier=Math.max(n.doc.modeFrontier,++n.doc.highlightFrontier))}return i.styles}function ul(n,i,a){var l=n.doc,u=n.display;if(!l.mode.startState)return new Wr(l,!0,i);var m=D1(n,i,a),y=m>l.first&&qe(l,m-1).stateAfter,x=y?Wr.fromSaved(l,y,m):new Wr(l,rs(l.mode),m);return l.iter(m,i,function(S){yf(n,S.text,x);var T=x.line;S.stateAfter=T==i-1||T%5==0||T>=u.viewFrom&&T<u.viewTo?x.save():null,x.nextLine()}),a&&(l.modeFrontier=x.line),x}function yf(n,i,a,l){var u=n.doc.mode,m=new $t(i,n.options.tabSize,a);for(m.start=m.pos=l||0,i==""&&Vp(u,a.state);!m.eol();)bf(u,m,a.state),m.start=m.pos}function Vp(n,i){if(n.blankLine)return n.blankLine(i);if(n.innerMode){var a=al(n,i);if(a.mode.blankLine)return a.mode.blankLine(a.state)}}function bf(n,i,a,l){for(var u=0;u<10;u++){l&&(l[0]=al(n,a).mode);var m=n.token(i,a);if(i.pos>i.start)return m}throw new Error("Mode "+n.name+" failed to advance stream.")}var Gp=function(n,i,a){this.start=n.start,this.end=n.pos,this.string=n.current(),this.type=i||null,this.state=a};function Kp(n,i,a,l){var u=n.doc,m=u.mode,y;i=tt(u,i);var x=qe(u,i.line),S=ul(n,i.line,a),T=new $t(x.text,n.options.tabSize,S),H;for(l&&(H=[]);(l||T.pos<i.ch)&&!T.eol();)T.start=T.pos,y=bf(m,T,S.state),l&&H.push(new Gp(T,y,Br(u.mode,S.state)));return l?H:new Gp(T,y,S.state)}function Xp(n,i){if(n)for(;;){var a=n.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!a)break;n=n.slice(0,a.index)+n.slice(a.index+a[0].length);var l=a[1]?"bgClass":"textClass";i[l]==null?i[l]=a[2]:new RegExp("(?:^|\\s)"+a[2]+"(?:$|\\s)").test(i[l])||(i[l]+=" "+a[2])}return n}function Yp(n,i,a,l,u,m,y){var x=a.flattenSpans;x==null&&(x=n.options.flattenSpans);var S=0,T=null,H=new $t(i,n.options.tabSize,l),V,se=n.options.addModeClass&&[null];for(i==""&&Xp(Vp(a,l.state),m);!H.eol();){if(H.pos>n.options.maxHighlightLength?(x=!1,y&&yf(n,i,l,H.pos),H.pos=i.length,V=null):V=Xp(bf(a,H,l.state,se),m),se){var te=se[0].name;te&&(V="m-"+(V?te+" "+V:te))}if(!x||T!=V){for(;S<H.start;)S=Math.min(H.start,S+5e3),u(S,T);T=V}H.start=H.pos}for(;S<H.pos;){var pe=Math.min(H.pos,S+5e3);u(pe,T),S=pe}}function D1(n,i,a){for(var l,u,m=n.doc,y=a?-1:i-(n.doc.mode.innerMode?1e3:100),x=i;x>y;--x){if(x<=m.first)return m.first;var S=qe(m,x-1),T=S.stateAfter;if(T&&(!a||x+(T instanceof Xa?T.lookAhead:0)<=m.modeFrontier))return x;var H=re(S.text,null,n.options.tabSize);(u==null||l>H)&&(u=x-1,l=H)}return u}function z1(n,i){if(n.modeFrontier=Math.min(n.modeFrontier,i),!(n.highlightFrontier<i-10)){for(var a=n.first,l=i-1;l>a;l--){var u=qe(n,l).stateAfter;if(u&&(!(u instanceof Xa)||l+u.lookAhead<i)){a=l+1;break}}n.highlightFrontier=Math.min(n.highlightFrontier,a)}}var Zp=!1,oi=!1;function F1(){Zp=!0}function H1(){oi=!0}function Ya(n,i,a){this.marker=n,this.from=i,this.to=a}function fl(n,i){if(n)for(var a=0;a<n.length;++a){var l=n[a];if(l.marker==i)return l}}function B1(n,i){for(var a,l=0;l<n.length;++l)n[l]!=i&&(a||(a=[])).push(n[l]);return a}function W1(n,i,a){var l=a&&window.WeakSet&&(a.markedSpans||(a.markedSpans=new WeakSet));l&&n.markedSpans&&l.has(n.markedSpans)?n.markedSpans.push(i):(n.markedSpans=n.markedSpans?n.markedSpans.concat([i]):[i],l&&l.add(n.markedSpans)),i.marker.attachLine(n)}function q1(n,i,a){var l;if(n)for(var u=0;u<n.length;++u){var m=n[u],y=m.marker,x=m.from==null||(y.inclusiveLeft?m.from<=i:m.from<i);if(x||m.from==i&&y.type=="bookmark"&&(!a||!m.marker.insertLeft)){var S=m.to==null||(y.inclusiveRight?m.to>=i:m.to>i);(l||(l=[])).push(new Ya(y,m.from,S?null:m.to))}}return l}function j1(n,i,a){var l;if(n)for(var u=0;u<n.length;++u){var m=n[u],y=m.marker,x=m.to==null||(y.inclusiveRight?m.to>=i:m.to>i);if(x||m.from==i&&y.type=="bookmark"&&(!a||m.marker.insertLeft)){var S=m.from==null||(y.inclusiveLeft?m.from<=i:m.from<i);(l||(l=[])).push(new Ya(y,S?null:m.from-i,m.to==null?null:m.to-i))}}return l}function wf(n,i){if(i.full)return null;var a=me(n,i.from.line)&&qe(n,i.from.line).markedSpans,l=me(n,i.to.line)&&qe(n,i.to.line).markedSpans;if(!a&&!l)return null;var u=i.from.ch,m=i.to.ch,y=Ie(i.from,i.to)==0,x=q1(a,u,y),S=j1(l,m,y),T=i.text.length==1,H=xe(i.text).length+(T?u:0);if(x)for(var V=0;V<x.length;++V){var se=x[V];if(se.to==null){var te=fl(S,se.marker);te?T&&(se.to=te.to==null?null:te.to+H):se.to=u}}if(S)for(var pe=0;pe<S.length;++pe){var we=S[pe];if(we.to!=null&&(we.to+=H),we.from==null){var Te=fl(x,we.marker);Te||(we.from=H,T&&(x||(x=[])).push(we))}else we.from+=H,T&&(x||(x=[])).push(we)}x&&(x=Jp(x)),S&&S!=x&&(S=Jp(S));var Le=[x];if(!T){var De=i.text.length-2,Me;if(De>0&&x)for(var ze=0;ze<x.length;++ze)x[ze].to==null&&(Me||(Me=[])).push(new Ya(x[ze].marker,null,null));for(var Ye=0;Ye<De;++Ye)Le.push(Me);Le.push(S)}return Le}function Jp(n){for(var i=0;i<n.length;++i){var a=n[i];a.from!=null&&a.from==a.to&&a.marker.clearWhenEmpty!==!1&&n.splice(i--,1)}return n.length?n:null}function U1(n,i,a){var l=null;if(n.iter(i.line,a.line+1,function(te){if(te.markedSpans)for(var pe=0;pe<te.markedSpans.length;++pe){var we=te.markedSpans[pe].marker;we.readOnly&&(!l||ae(l,we)==-1)&&(l||(l=[])).push(we)}}),!l)return null;for(var u=[{from:i,to:a}],m=0;m<l.length;++m)for(var y=l[m],x=y.find(0),S=0;S<u.length;++S){var T=u[S];if(!(Ie(T.to,x.from)<0||Ie(T.from,x.to)>0)){var H=[S,1],V=Ie(T.from,x.from),se=Ie(T.to,x.to);(V<0||!y.inclusiveLeft&&!V)&&H.push({from:T.from,to:x.from}),(se>0||!y.inclusiveRight&&!se)&&H.push({from:x.to,to:T.to}),u.splice.apply(u,H),S+=H.length-3}}return u}function Qp(n){var i=n.markedSpans;if(i){for(var a=0;a<i.length;++a)i[a].marker.detachLine(n);n.markedSpans=null}}function eg(n,i){if(i){for(var a=0;a<i.length;++a)i[a].marker.attachLine(n);n.markedSpans=i}}function Za(n){return n.inclusiveLeft?-1:0}function Ja(n){return n.inclusiveRight?1:0}function xf(n,i){var a=n.lines.length-i.lines.length;if(a!=0)return a;var l=n.find(),u=i.find(),m=Ie(l.from,u.from)||Za(n)-Za(i);if(m)return-m;var y=Ie(l.to,u.to)||Ja(n)-Ja(i);return y||i.id-n.id}function tg(n,i){var a=oi&&n.markedSpans,l;if(a)for(var u=void 0,m=0;m<a.length;++m)u=a[m],u.marker.collapsed&&(i?u.from:u.to)==null&&(!l||xf(l,u.marker)<0)&&(l=u.marker);return l}function ng(n){return tg(n,!0)}function Qa(n){return tg(n,!1)}function V1(n,i){var a=oi&&n.markedSpans,l;if(a)for(var u=0;u<a.length;++u){var m=a[u];m.marker.collapsed&&(m.from==null||m.from<i)&&(m.to==null||m.to>i)&&(!l||xf(l,m.marker)<0)&&(l=m.marker)}return l}function rg(n,i,a,l,u){var m=qe(n,i),y=oi&&m.markedSpans;if(y)for(var x=0;x<y.length;++x){var S=y[x];if(S.marker.collapsed){var T=S.marker.find(0),H=Ie(T.from,a)||Za(S.marker)-Za(u),V=Ie(T.to,l)||Ja(S.marker)-Ja(u);if(!(H>=0&&V<=0||H<=0&&V>=0)&&(H<=0&&(S.marker.inclusiveRight&&u.inclusiveLeft?Ie(T.to,a)>=0:Ie(T.to,a)>0)||H>=0&&(S.marker.inclusiveRight&&u.inclusiveLeft?Ie(T.from,l)<=0:Ie(T.from,l)<0)))return!0}}}function Sr(n){for(var i;i=ng(n);)n=i.find(-1,!0).line;return n}function G1(n){for(var i;i=Qa(n);)n=i.find(1,!0).line;return n}function K1(n){for(var i,a;i=Qa(n);)n=i.find(1,!0).line,(a||(a=[])).push(n);return a}function kf(n,i){var a=qe(n,i),l=Sr(a);return a==l?i:A(l)}function ig(n,i){if(i>n.lastLine())return i;var a=qe(n,i),l;if(!Ii(n,a))return i;for(;l=Qa(a);)a=l.find(1,!0).line;return A(a)+1}function Ii(n,i){var a=oi&&i.markedSpans;if(a){for(var l=void 0,u=0;u<a.length;++u)if(l=a[u],!!l.marker.collapsed){if(l.from==null)return!0;if(!l.marker.widgetNode&&l.from==0&&l.marker.inclusiveLeft&&Sf(n,i,l))return!0}}}function Sf(n,i,a){if(a.to==null){var l=a.marker.find(1,!0);return Sf(n,l.line,fl(l.line.markedSpans,a.marker))}if(a.marker.inclusiveRight&&a.to==i.text.length)return!0;for(var u=void 0,m=0;m<i.markedSpans.length;++m)if(u=i.markedSpans[m],u.marker.collapsed&&!u.marker.widgetNode&&u.from==a.to&&(u.to==null||u.to!=a.from)&&(u.marker.inclusiveLeft||a.marker.inclusiveRight)&&Sf(n,i,u))return!0}function si(n){n=Sr(n);for(var i=0,a=n.parent,l=0;l<a.lines.length;++l){var u=a.lines[l];if(u==n)break;i+=u.height}for(var m=a.parent;m;a=m,m=a.parent)for(var y=0;y<m.children.length;++y){var x=m.children[y];if(x==a)break;i+=x.height}return i}function ec(n){if(n.height==0)return 0;for(var i=n.text.length,a,l=n;a=ng(l);){var u=a.find(0,!0);l=u.from.line,i+=u.from.ch-u.to.ch}for(l=n;a=Qa(l);){var m=a.find(0,!0);i-=l.text.length-m.from.ch,l=m.to.line,i+=l.text.length-m.to.ch}return i}function _f(n){var i=n.display,a=n.doc;i.maxLine=qe(a,a.first),i.maxLineLength=ec(i.maxLine),i.maxLineChanged=!0,a.iter(function(l){var u=ec(l);u>i.maxLineLength&&(i.maxLineLength=u,i.maxLine=l)})}var os=function(n,i,a){this.text=n,eg(this,i),this.height=a?a(this):1};os.prototype.lineNo=function(){return A(this)},yr(os);function X1(n,i,a,l){n.text=i,n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null),n.order!=null&&(n.order=null),Qp(n),eg(n,a);var u=l?l(n):1;u!=n.height&&Qn(n,u)}function Y1(n){n.parent=null,Qp(n)}var Z1={},J1={};function og(n,i){if(!n||/^\s*$/.test(n))return null;var a=i.addModeClass?J1:Z1;return a[n]||(a[n]=n.replace(/\S+/g,"cm-$&"))}function sg(n,i){var a=z("span",null,null,g?"padding-right: .1px":null),l={pre:z("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:n,trailingSpace:!1,splitSpaces:n.getOption("lineWrapping")};i.measure={};for(var u=0;u<=(i.rest?i.rest.length:0);u++){var m=u?i.rest[u-1]:i.line,y=void 0;l.pos=0,l.addToken=ek,Pi(n.display.measure)&&(y=lt(m,n.doc.direction))&&(l.addToken=nk(l.addToken,y)),l.map=[];var x=i!=n.display.externalMeasured&&A(m);rk(m,l,Up(n,m,x)),m.styleClasses&&(m.styleClasses.bgClass&&(l.bgClass=Be(m.styleClasses.bgClass,l.bgClass||"")),m.styleClasses.textClass&&(l.textClass=Be(m.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Ga(n.display.measure))),u==0?(i.measure.map=l.map,i.measure.cache={}):((i.measure.maps||(i.measure.maps=[])).push(l.map),(i.measure.caches||(i.measure.caches=[])).push({}))}if(g){var S=l.content.lastChild;(/\bcm-tab\b/.test(S.className)||S.querySelector&&S.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return Pt(n,"renderLine",n,i.line,l.pre),l.pre.className&&(l.textClass=Be(l.pre.className,l.textClass||"")),l}function Q1(n){var i=k("span","•","cm-invalidchar");return i.title="\\u"+n.charCodeAt(0).toString(16),i.setAttribute("aria-label",i.title),i}function ek(n,i,a,l,u,m,y){if(i){var x=n.splitSpaces?tk(i,n.trailingSpace):i,S=n.cm.state.specialChars,T=!1,H;if(!S.test(i))n.col+=i.length,H=document.createTextNode(x),n.map.push(n.pos,n.pos+i.length,H),h&&p<9&&(T=!0),n.pos+=i.length;else{H=document.createDocumentFragment();for(var V=0;;){S.lastIndex=V;var se=S.exec(i),te=se?se.index-V:i.length-V;if(te){var pe=document.createTextNode(x.slice(V,V+te));h&&p<9?H.appendChild(k("span",[pe])):H.appendChild(pe),n.map.push(n.pos,n.pos+te,pe),n.col+=te,n.pos+=te}if(!se)break;V+=te+1;var we=void 0;if(se[0]==" "){var Te=n.cm.options.tabSize,Le=Te-n.col%Te;we=H.appendChild(k("span",Ee(Le),"cm-tab")),we.setAttribute("role","presentation"),we.setAttribute("cm-text"," "),n.col+=Le}else se[0]=="\r"||se[0]==`
23`?(we=H.appendChild(k("span",se[0]=="\r"?"␍":"␤","cm-invalidchar")),we.setAttribute("cm-text",se[0]),n.col+=1):(we=n.cm.options.specialCharPlaceholder(se[0]),we.setAttribute("cm-text",se[0]),h&&p<9?H.appendChild(k("span",[we])):H.appendChild(we),n.col+=1);n.map.push(n.pos,n.pos+1,we),n.pos++}}if(n.trailingSpace=x.charCodeAt(i.length-1)==32,a||l||u||T||m||y){var De=a||"";l&&(De+=l),u&&(De+=u);var Me=k("span",[H],De,m);if(y)for(var ze in y)y.hasOwnProperty(ze)&&ze!="style"&&ze!="class"&&Me.setAttribute(ze,y[ze]);return n.content.appendChild(Me)}n.content.appendChild(H)}}function tk(n,i){if(n.length>1&&!/ /.test(n))return n;for(var a=i,l="",u=0;u<n.length;u++){var m=n.charAt(u);m==" "&&a&&(u==n.length-1||n.charCodeAt(u+1)==32)&&(m=" "),l+=m,a=m==" "}return l}function nk(n,i){return function(a,l,u,m,y,x,S){u=u?u+" cm-force-border":"cm-force-border";for(var T=a.pos,H=T+l.length;;){for(var V=void 0,se=0;se<i.length&&(V=i[se],!(V.to>T&&V.from<=T));se++);if(V.to>=H)return n(a,l,u,m,y,x,S);n(a,l.slice(0,V.to-T),u,m,null,x,S),m=null,l=l.slice(V.to-T),T=V.to}}}function lg(n,i,a,l){var u=!l&&a.widgetNode;u&&n.map.push(n.pos,n.pos+i,u),!l&&n.cm.display.input.needsContentAttribute&&(u||(u=n.content.appendChild(document.createElement("span"))),u.setAttribute("cm-marker",a.id)),u&&(n.cm.display.input.setUneditable(u),n.content.appendChild(u)),n.pos+=i,n.trailingSpace=!1}function rk(n,i,a){var l=n.markedSpans,u=n.text,m=0;if(!l){for(var y=1;y<a.length;y+=2)i.addToken(i,u.slice(m,m=a[y]),og(a[y+1],i.cm.options));return}for(var x=u.length,S=0,T=1,H="",V,se,te=0,pe,we,Te,Le,De;;){if(te==S){pe=we=Te=se="",De=null,Le=null,te=1/0;for(var Me=[],ze=void 0,Ye=0;Ye<l.length;++Ye){var Ue=l[Ye],st=Ue.marker;if(st.type=="bookmark"&&Ue.from==S&&st.widgetNode)Me.push(st);else if(Ue.from<=S&&(Ue.to==null||Ue.to>S||st.collapsed&&Ue.to==S&&Ue.from==S)){if(Ue.to!=null&&Ue.to!=S&&te>Ue.to&&(te=Ue.to,we=""),st.className&&(pe+=" "+st.className),st.css&&(se=(se?se+";":"")+st.css),st.startStyle&&Ue.from==S&&(Te+=" "+st.startStyle),st.endStyle&&Ue.to==te&&(ze||(ze=[])).push(st.endStyle,Ue.to),st.title&&((De||(De={})).title=st.title),st.attributes)for(var St in st.attributes)(De||(De={}))[St]=st.attributes[St];st.collapsed&&(!Le||xf(Le.marker,st)<0)&&(Le=Ue)}else Ue.from>S&&te>Ue.from&&(te=Ue.from)}if(ze)for(var tn=0;tn<ze.length;tn+=2)ze[tn+1]==te&&(we+=" "+ze[tn]);if(!Le||Le.from==S)for(var Ot=0;Ot<Me.length;++Ot)lg(i,0,Me[Ot]);if(Le&&(Le.from||0)==S){if(lg(i,(Le.to==null?x+1:Le.to)-S,Le.marker,Le.from==null),Le.to==null)return;Le.to==S&&(Le=!1)}}if(S>=x)break;for(var qn=Math.min(x,te);;){if(H){var Cn=S+H.length;if(!Le){var Ut=Cn>qn?H.slice(0,qn-S):H;i.addToken(i,Ut,V?V+pe:pe,Te,S+Ut.length==te?we:"",se,De)}if(Cn>=qn){H=H.slice(qn-S),S=qn;break}S=Cn,Te=""}H=u.slice(m,m=a[T++]),V=og(a[T++],i.cm.options)}}}function ag(n,i,a){this.line=i,this.rest=K1(i),this.size=this.rest?A(xe(this.rest))-a+1:1,this.node=this.text=null,this.hidden=Ii(n,i)}function tc(n,i,a){for(var l=[],u,m=i;m<a;m=u){var y=new ag(n.doc,qe(n.doc,m),m);u=m+y.size,l.push(y)}return l}var ss=null;function ik(n){ss?ss.ops.push(n):n.ownsGroup=ss={ops:[n],delayedCallbacks:[]}}function ok(n){var i=n.delayedCallbacks,a=0;do{for(;a<i.length;a++)i[a].call(null);for(var l=0;l<n.ops.length;l++){var u=n.ops[l];if(u.cursorActivityHandlers)for(;u.cursorActivityCalled<u.cursorActivityHandlers.length;)u.cursorActivityHandlers[u.cursorActivityCalled++].call(null,u.cm)}}while(a<i.length)}function sk(n,i){var a=n.ownsGroup;if(a)try{ok(a)}finally{ss=null,i(a)}}var dl=null;function Jt(n,i){var a=ri(n,i);if(a.length){var l=Array.prototype.slice.call(arguments,2),u;ss?u=ss.delayedCallbacks:dl?u=dl:(u=dl=[],setTimeout(lk,0));for(var m=function(x){u.push(function(){return a[x].apply(null,l)})},y=0;y<a.length;++y)m(y)}}function lk(){var n=dl;dl=null;for(var i=0;i<n.length;++i)n[i]()}function cg(n,i,a,l){for(var u=0;u<i.changes.length;u++){var m=i.changes[u];m=="text"?ck(n,i):m=="gutter"?fg(n,i,a,l):m=="class"?Tf(n,i):m=="widget"&&uk(n,i,l)}i.changes=null}function hl(n){return n.node==n.text&&(n.node=k("div",null,null,"position: relative"),n.text.parentNode&&n.text.parentNode.replaceChild(n.node,n.text),n.node.appendChild(n.text),h&&p<8&&(n.node.style.zIndex=2)),n.node}function ak(n,i){var a=i.bgClass?i.bgClass+" "+(i.line.bgClass||""):i.line.bgClass;if(a&&(a+=" CodeMirror-linebackground"),i.background)a?i.background.className=a:(i.background.parentNode.removeChild(i.background),i.background=null);else if(a){var l=hl(i);i.background=l.insertBefore(k("div",null,a),l.firstChild),n.display.input.setUneditable(i.background)}}function ug(n,i){var a=n.display.externalMeasured;return a&&a.line==i.line?(n.display.externalMeasured=null,i.measure=a.measure,a.built):sg(n,i)}function ck(n,i){var a=i.text.className,l=ug(n,i);i.text==i.node&&(i.node=l.pre),i.text.parentNode.replaceChild(l.pre,i.text),i.text=l.pre,l.bgClass!=i.bgClass||l.textClass!=i.textClass?(i.bgClass=l.bgClass,i.textClass=l.textClass,Tf(n,i)):a&&(i.text.className=a)}function Tf(n,i){ak(n,i),i.line.wrapClass?hl(i).className=i.line.wrapClass:i.node!=i.text&&(i.node.className="");var a=i.textClass?i.textClass+" "+(i.line.textClass||""):i.line.textClass;i.text.className=a||""}function fg(n,i,a,l){if(i.gutter&&(i.node.removeChild(i.gutter),i.gutter=null),i.gutterBackground&&(i.node.removeChild(i.gutterBackground),i.gutterBackground=null),i.line.gutterClass){var u=hl(i);i.gutterBackground=k("div",null,"CodeMirror-gutter-background "+i.line.gutterClass,"left: "+(n.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),n.display.input.setUneditable(i.gutterBackground),u.insertBefore(i.gutterBackground,i.text)}var m=i.line.gutterMarkers;if(n.options.lineNumbers||m){var y=hl(i),x=i.gutter=k("div",null,"CodeMirror-gutter-wrapper","left: "+(n.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(x.setAttribute("aria-hidden","true"),n.display.input.setUneditable(x),y.insertBefore(x,i.text),i.line.gutterClass&&(x.className+=" "+i.line.gutterClass),n.options.lineNumbers&&(!m||!m["CodeMirror-linenumbers"])&&(i.lineNumber=x.appendChild(k("div",_e(n.options,a),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+n.display.lineNumInnerWidth+"px"))),m)for(var S=0;S<n.display.gutterSpecs.length;++S){var T=n.display.gutterSpecs[S].className,H=m.hasOwnProperty(T)&&m[T];H&&x.appendChild(k("div",[H],"CodeMirror-gutter-elt","left: "+l.gutterLeft[T]+"px; width: "+l.gutterWidth[T]+"px"))}}}function uk(n,i,a){i.alignable&&(i.alignable=null);for(var l=j("CodeMirror-linewidget"),u=i.node.firstChild,m=void 0;u;u=m)m=u.nextSibling,l.test(u.className)&&i.node.removeChild(u);dg(n,i,a)}function fk(n,i,a,l){var u=ug(n,i);return i.text=i.node=u.pre,u.bgClass&&(i.bgClass=u.bgClass),u.textClass&&(i.textClass=u.textClass),Tf(n,i),fg(n,i,a,l),dg(n,i,l),i.node}function dg(n,i,a){if(hg(n,i.line,i,a,!0),i.rest)for(var l=0;l<i.rest.length;l++)hg(n,i.rest[l],i,a,!1)}function hg(n,i,a,l,u){if(i.widgets)for(var m=hl(a),y=0,x=i.widgets;y<x.length;++y){var S=x[y],T=k("div",[S.node],"CodeMirror-linewidget"+(S.className?" "+S.className:""));S.handleMouseEvents||T.setAttribute("cm-ignore-events","true"),dk(S,T,a,l),n.display.input.setUneditable(T),u&&S.above?m.insertBefore(T,a.gutter||a.text):m.appendChild(T),Jt(S,"redraw")}}function dk(n,i,a,l){if(n.noHScroll){(a.alignable||(a.alignable=[])).push(i);var u=l.wrapperWidth;i.style.left=l.fixedPos+"px",n.coverGutter||(u-=l.gutterTotalWidth,i.style.paddingLeft=l.gutterTotalWidth+"px"),i.style.width=u+"px"}n.coverGutter&&(i.style.zIndex=5,i.style.position="relative",n.noHScroll||(i.style.marginLeft=-l.gutterTotalWidth+"px"))}function pl(n){if(n.height!=null)return n.height;var i=n.doc.cm;if(!i)return 0;if(!ce(document.body,n.node)){var a="position: relative;";n.coverGutter&&(a+="margin-left: -"+i.display.gutters.offsetWidth+"px;"),n.noHScroll&&(a+="width: "+i.display.wrapper.clientWidth+"px;"),C(i.display.measure,k("div",[n.node],null,a))}return n.height=n.node.parentNode.offsetHeight}function li(n,i){for(var a=sl(i);a!=n.wrapper;a=a.parentNode)if(!a||a.nodeType==1&&a.getAttribute("cm-ignore-events")=="true"||a.parentNode==n.sizer&&a!=n.mover)return!0}function nc(n){return n.lineSpace.offsetTop}function Cf(n){return n.mover.offsetHeight-n.lineSpace.offsetHeight}function pg(n){if(n.cachedPaddingH)return n.cachedPaddingH;var i=C(n.measure,k("pre","x","CodeMirror-line-like")),a=window.getComputedStyle?window.getComputedStyle(i):i.currentStyle,l={left:parseInt(a.paddingLeft),right:parseInt(a.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(n.cachedPaddingH=l),l}function qr(n){return D-n.display.nativeBarWidth}function wo(n){return n.display.scroller.clientWidth-qr(n)-n.display.barWidth}function Ef(n){return n.display.scroller.clientHeight-qr(n)-n.display.barHeight}function hk(n,i,a){var l=n.options.lineWrapping,u=l&&wo(n);if(!i.measure.heights||l&&i.measure.width!=u){var m=i.measure.heights=[];if(l){i.measure.width=u;for(var y=i.text.firstChild.getClientRects(),x=0;x<y.length-1;x++){var S=y[x],T=y[x+1];Math.abs(S.bottom-T.bottom)>2&&m.push((S.bottom+T.top)/2-a.top)}}m.push(a.bottom-a.top)}}function gg(n,i,a){if(n.line==i)return{map:n.measure.map,cache:n.measure.cache};if(n.rest){for(var l=0;l<n.rest.length;l++)if(n.rest[l]==i)return{map:n.measure.maps[l],cache:n.measure.caches[l]};for(var u=0;u<n.rest.length;u++)if(A(n.rest[u])>a)return{map:n.measure.maps[u],cache:n.measure.caches[u],before:!0}}}function pk(n,i){i=Sr(i);var a=A(i),l=n.display.externalMeasured=new ag(n.doc,i,a);l.lineN=a;var u=l.built=sg(n,l);return l.text=u.pre,C(n.display.lineMeasure,u.pre),l}function mg(n,i,a,l){return jr(n,ls(n,i),a,l)}function Af(n,i){if(i>=n.display.viewFrom&&i<n.display.viewTo)return n.display.view[So(n,i)];var a=n.display.externalMeasured;if(a&&i>=a.lineN&&i<a.lineN+a.size)return a}function ls(n,i){var a=A(i),l=Af(n,a);l&&!l.text?l=null:l&&l.changes&&(cg(n,l,a,Pf(n)),n.curOp.forceUpdate=!0),l||(l=pk(n,i));var u=gg(l,i,a);return{line:i,view:l,rect:null,map:u.map,cache:u.cache,before:u.before,hasHeights:!1}}function jr(n,i,a,l,u){i.before&&(a=-1);var m=a+(l||""),y;return i.cache.hasOwnProperty(m)?y=i.cache[m]:(i.rect||(i.rect=i.view.text.getBoundingClientRect()),i.hasHeights||(hk(n,i.view,i.rect),i.hasHeights=!0),y=mk(n,i,a,l),y.bogus||(i.cache[m]=y)),{left:y.left,right:y.right,top:u?y.rtop:y.top,bottom:u?y.rbottom:y.bottom}}var vg={left:0,right:0,top:0,bottom:0};function yg(n,i,a){for(var l,u,m,y,x,S,T=0;T<n.length;T+=3)if(x=n[T],S=n[T+1],i<x?(u=0,m=1,y="left"):i<S?(u=i-x,m=u+1):(T==n.length-3||i==S&&n[T+3]>i)&&(m=S-x,u=m-1,i>=S&&(y="right")),u!=null){if(l=n[T+2],x==S&&a==(l.insertLeft?"left":"right")&&(y=a),a=="left"&&u==0)for(;T&&n[T-2]==n[T-3]&&n[T-1].insertLeft;)l=n[(T-=3)+2],y="left";if(a=="right"&&u==S-x)for(;T<n.length-3&&n[T+3]==n[T+4]&&!n[T+5].insertLeft;)l=n[(T+=3)+2],y="right";break}return{node:l,start:u,end:m,collapse:y,coverStart:x,coverEnd:S}}function gk(n,i){var a=vg;if(i=="left")for(var l=0;l<n.length&&(a=n[l]).left==a.right;l++);else for(var u=n.length-1;u>=0&&(a=n[u]).left==a.right;u--);return a}function mk(n,i,a,l){var u=yg(i.map,a,l),m=u.node,y=u.start,x=u.end,S=u.collapse,T;if(m.nodeType==3){for(var H=0;H<4;H++){for(;y&&ut(i.line.text.charAt(u.coverStart+y));)--y;for(;u.coverStart+x<u.coverEnd&&ut(i.line.text.charAt(u.coverStart+x));)++x;if(h&&p<9&&y==0&&x==u.coverEnd-u.coverStart?T=m.parentNode.getBoundingClientRect():T=gk(B(m,y,x).getClientRects(),l),T.left||T.right||y==0)break;x=y,y=y-1,S="right"}h&&p<11&&(T=vk(n.display.measure,T))}else{y>0&&(S=l="right");var V;n.options.lineWrapping&&(V=m.getClientRects()).length>1?T=V[l=="right"?V.length-1:0]:T=m.getBoundingClientRect()}if(h&&p<9&&!y&&(!T||!T.left&&!T.right)){var se=m.parentNode.getClientRects()[0];se?T={left:se.left,right:se.left+cs(n.display),top:se.top,bottom:se.bottom}:T=vg}for(var te=T.top-i.rect.top,pe=T.bottom-i.rect.top,we=(te+pe)/2,Te=i.view.measure.heights,Le=0;Le<Te.length-1&&!(we<Te[Le]);Le++);var De=Le?Te[Le-1]:0,Me=Te[Le],ze={left:(S=="right"?T.right:T.left)-i.rect.left,right:(S=="left"?T.left:T.right)-i.rect.left,top:De,bottom:Me};return!T.left&&!T.right&&(ze.bogus=!0),n.options.singleCursorHeightPerLine||(ze.rtop=te,ze.rbottom=pe),ze}function vk(n,i){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!vf(n))return i;var a=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:i.left*a,right:i.right*a,top:i.top*l,bottom:i.bottom*l}}function bg(n){if(n.measure&&(n.measure.cache={},n.measure.heights=null,n.rest))for(var i=0;i<n.rest.length;i++)n.measure.caches[i]={}}function wg(n){n.display.externalMeasure=null,O(n.display.lineMeasure);for(var i=0;i<n.display.view.length;i++)bg(n.display.view[i])}function gl(n){wg(n),n.display.cachedCharWidth=n.display.cachedTextHeight=n.display.cachedPaddingH=null,n.options.lineWrapping||(n.display.maxLineChanged=!0),n.display.lineNumChars=null}function xg(n){return b&&I?-(n.body.getBoundingClientRect().left-parseInt(getComputedStyle(n.body).marginLeft)):n.defaultView.pageXOffset||(n.documentElement||n.body).scrollLeft}function kg(n){return b&&I?-(n.body.getBoundingClientRect().top-parseInt(getComputedStyle(n.body).marginTop)):n.defaultView.pageYOffset||(n.documentElement||n.body).scrollTop}function Lf(n){var i=Sr(n),a=i.widgets,l=0;if(a)for(var u=0;u<a.length;++u)a[u].above&&(l+=pl(a[u]));return l}function rc(n,i,a,l,u){if(!u){var m=Lf(i);a.top+=m,a.bottom+=m}if(l=="line")return a;l||(l="local");var y=si(i);if(l=="local"?y+=nc(n.display):y-=n.display.viewOffset,l=="page"||l=="window"){var x=n.display.lineSpace.getBoundingClientRect();y+=x.top+(l=="window"?0:kg(Ke(n)));var S=x.left+(l=="window"?0:xg(Ke(n)));a.left+=S,a.right+=S}return a.top+=y,a.bottom+=y,a}function Sg(n,i,a){if(a=="div")return i;var l=i.left,u=i.top;if(a=="page")l-=xg(Ke(n)),u-=kg(Ke(n));else if(a=="local"||!a){var m=n.display.sizer.getBoundingClientRect();l+=m.left,u+=m.top}var y=n.display.lineSpace.getBoundingClientRect();return{left:l-y.left,top:u-y.top}}function ic(n,i,a,l,u){return l||(l=qe(n.doc,i.line)),rc(n,l,mg(n,l,i.ch,u),a)}function _r(n,i,a,l,u,m){l=l||qe(n.doc,i.line),u||(u=ls(n,l));function y(pe,we){var Te=jr(n,u,pe,we?"right":"left",m);return we?Te.left=Te.right:Te.right=Te.left,rc(n,l,Te,a)}var x=lt(l,n.doc.direction),S=i.ch,T=i.sticky;if(S>=l.text.length?(S=l.text.length,T="before"):S<=0&&(S=0,T="after"),!x)return y(T=="before"?S-1:S,T=="before");function H(pe,we,Te){var Le=x[we],De=Le.level==1;return y(Te?pe-1:pe,De!=Te)}var V=Bt(x,S,T),se=Hr,te=H(S,V,T=="before");return se!=null&&(te.other=H(S,se,T!="before")),te}function _g(n,i){var a=0;i=tt(n.doc,i),n.options.lineWrapping||(a=cs(n.display)*i.ch);var l=qe(n.doc,i.line),u=si(l)+nc(n.display);return{left:a,right:a,top:u,bottom:u+l.height}}function Mf(n,i,a,l,u){var m=fe(n,i,a);return m.xRel=u,l&&(m.outside=l),m}function Nf(n,i,a){var l=n.doc;if(a+=n.display.viewOffset,a<0)return Mf(l.first,0,null,-1,-1);var u=U(l,a),m=l.first+l.size-1;if(u>m)return Mf(l.first+l.size-1,qe(l,m).text.length,null,1,1);i<0&&(i=0);for(var y=qe(l,u);;){var x=yk(n,y,u,i,a),S=V1(y,x.ch+(x.xRel>0||x.outside>0?1:0));if(!S)return x;var T=S.find(1);if(T.line==u)return T;y=qe(l,u=T.line)}}function Tg(n,i,a,l){l-=Lf(i);var u=i.text.length,m=jt(function(y){return jr(n,a,y-1).bottom<=l},u,0);return u=jt(function(y){return jr(n,a,y).top>l},m,u),{begin:m,end:u}}function Cg(n,i,a,l){a||(a=ls(n,i));var u=rc(n,i,jr(n,a,l),"line").top;return Tg(n,i,a,u)}function Of(n,i,a,l){return n.bottom<=a?!1:n.top>a?!0:(l?n.left:n.right)>i}function yk(n,i,a,l,u){u-=si(i);var m=ls(n,i),y=Lf(i),x=0,S=i.text.length,T=!0,H=lt(i,n.doc.direction);if(H){var V=(n.options.lineWrapping?wk:bk)(n,i,a,m,H,l,u);T=V.level!=1,x=T?V.from:V.to-1,S=T?V.to:V.from-1}var se=null,te=null,pe=jt(function(Ye){var Ue=jr(n,m,Ye);return Ue.top+=y,Ue.bottom+=y,Of(Ue,l,u,!1)?(Ue.top<=u&&Ue.left<=l&&(se=Ye,te=Ue),!0):!1},x,S),we,Te,Le=!1;if(te){var De=l-te.left<te.right-l,Me=De==T;pe=se+(Me?0:1),Te=Me?"after":"before",we=De?te.left:te.right}else{!T&&(pe==S||pe==x)&&pe++,Te=pe==0?"after":pe==i.text.length?"before":jr(n,m,pe-(T?1:0)).bottom+y<=u==T?"after":"before";var ze=_r(n,fe(a,pe,Te),"line",i,m);we=ze.left,Le=u<ze.top?-1:u>=ze.bottom?1:0}return pe=Yt(i.text,pe,1),Mf(a,pe,Te,Le,l-we)}function bk(n,i,a,l,u,m,y){var x=jt(function(V){var se=u[V],te=se.level!=1;return Of(_r(n,fe(a,te?se.to:se.from,te?"before":"after"),"line",i,l),m,y,!0)},0,u.length-1),S=u[x];if(x>0){var T=S.level!=1,H=_r(n,fe(a,T?S.from:S.to,T?"after":"before"),"line",i,l);Of(H,m,y,!0)&&H.top>y&&(S=u[x-1])}return S}function wk(n,i,a,l,u,m,y){var x=Tg(n,i,l,y),S=x.begin,T=x.end;/\s/.test(i.text.charAt(T-1))&&T--;for(var H=null,V=null,se=0;se<u.length;se++){var te=u[se];if(!(te.from>=T||te.to<=S)){var pe=te.level!=1,we=jr(n,l,pe?Math.min(T,te.to)-1:Math.max(S,te.from)).right,Te=we<m?m-we+1e9:we-m;(!H||V>Te)&&(H=te,V=Te)}}return H||(H=u[u.length-1]),H.from<S&&(H={from:S,to:H.to,level:H.level}),H.to>T&&(H={from:H.from,to:T,level:H.level}),H}var xo;function as(n){if(n.cachedTextHeight!=null)return n.cachedTextHeight;if(xo==null){xo=k("pre",null,"CodeMirror-line-like");for(var i=0;i<49;++i)xo.appendChild(document.createTextNode("x")),xo.appendChild(k("br"));xo.appendChild(document.createTextNode("x"))}C(n.measure,xo);var a=xo.offsetHeight/50;return a>3&&(n.cachedTextHeight=a),O(n.measure),a||1}function cs(n){if(n.cachedCharWidth!=null)return n.cachedCharWidth;var i=k("span","xxxxxxxxxx"),a=k("pre",[i],"CodeMirror-line-like");C(n.measure,a);var l=i.getBoundingClientRect(),u=(l.right-l.left)/10;return u>2&&(n.cachedCharWidth=u),u||10}function Pf(n){for(var i=n.display,a={},l={},u=i.gutters.clientLeft,m=i.gutters.firstChild,y=0;m;m=m.nextSibling,++y){var x=n.display.gutterSpecs[y].className;a[x]=m.offsetLeft+m.clientLeft+u,l[x]=m.clientWidth}return{fixedPos:Rf(i),gutterTotalWidth:i.gutters.offsetWidth,gutterLeft:a,gutterWidth:l,wrapperWidth:i.wrapper.clientWidth}}function Rf(n){return n.scroller.getBoundingClientRect().left-n.sizer.getBoundingClientRect().left}function Eg(n){var i=as(n.display),a=n.options.lineWrapping,l=a&&Math.max(5,n.display.scroller.clientWidth/cs(n.display)-3);return function(u){if(Ii(n.doc,u))return 0;var m=0;if(u.widgets)for(var y=0;y<u.widgets.length;y++)u.widgets[y].height&&(m+=u.widgets[y].height);return a?m+(Math.ceil(u.text.length/l)||1)*i:m+i}}function $f(n){var i=n.doc,a=Eg(n);i.iter(function(l){var u=a(l);u!=l.height&&Qn(l,u)})}function ko(n,i,a,l){var u=n.display;if(!a&&sl(i).getAttribute("cm-not-content")=="true")return null;var m,y,x=u.lineSpace.getBoundingClientRect();try{m=i.clientX-x.left,y=i.clientY-x.top}catch{return null}var S=Nf(n,m,y),T;if(l&&S.xRel>0&&(T=qe(n.doc,S.line).text).length==S.ch){var H=re(T,T.length,n.options.tabSize)-T.length;S=fe(S.line,Math.max(0,Math.round((m-pg(n.display).left)/cs(n.display))-H))}return S}function So(n,i){if(i>=n.display.viewTo||(i-=n.display.viewFrom,i<0))return null;for(var a=n.display.view,l=0;l<a.length;l++)if(i-=a[l].size,i<0)return l}function _n(n,i,a,l){i==null&&(i=n.doc.first),a==null&&(a=n.doc.first+n.doc.size),l||(l=0);var u=n.display;if(l&&a<u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>i)&&(u.updateLineNumbers=i),n.curOp.viewChanged=!0,i>=u.viewTo)oi&&kf(n.doc,i)<u.viewTo&&zi(n);else if(a<=u.viewFrom)oi&&ig(n.doc,a+l)>u.viewFrom?zi(n):(u.viewFrom+=l,u.viewTo+=l);else if(i<=u.viewFrom&&a>=u.viewTo)zi(n);else if(i<=u.viewFrom){var m=oc(n,a,a+l,1);m?(u.view=u.view.slice(m.index),u.viewFrom=m.lineN,u.viewTo+=l):zi(n)}else if(a>=u.viewTo){var y=oc(n,i,i,-1);y?(u.view=u.view.slice(0,y.index),u.viewTo=y.lineN):zi(n)}else{var x=oc(n,i,i,-1),S=oc(n,a,a+l,1);x&&S?(u.view=u.view.slice(0,x.index).concat(tc(n,x.lineN,S.lineN)).concat(u.view.slice(S.index)),u.viewTo+=l):zi(n)}var T=u.externalMeasured;T&&(a<T.lineN?T.lineN+=l:i<T.lineN+T.size&&(u.externalMeasured=null))}function Di(n,i,a){n.curOp.viewChanged=!0;var l=n.display,u=n.display.externalMeasured;if(u&&i>=u.lineN&&i<u.lineN+u.size&&(l.externalMeasured=null),!(i<l.viewFrom||i>=l.viewTo)){var m=l.view[So(n,i)];if(m.node!=null){var y=m.changes||(m.changes=[]);ae(y,a)==-1&&y.push(a)}}}function zi(n){n.display.viewFrom=n.display.viewTo=n.doc.first,n.display.view=[],n.display.viewOffset=0}function oc(n,i,a,l){var u=So(n,i),m,y=n.display.view;if(!oi||a==n.doc.first+n.doc.size)return{index:u,lineN:a};for(var x=n.display.viewFrom,S=0;S<u;S++)x+=y[S].size;if(x!=i){if(l>0){if(u==y.length-1)return null;m=x+y[u].size-i,u++}else m=x-i;i+=m,a+=m}for(;kf(n.doc,a)!=a;){if(u==(l<0?0:y.length-1))return null;a+=l*y[u-(l<0?1:0)].size,u+=l}return{index:u,lineN:a}}function xk(n,i,a){var l=n.display,u=l.view;u.length==0||i>=l.viewTo||a<=l.viewFrom?(l.view=tc(n,i,a),l.viewFrom=i):(l.viewFrom>i?l.view=tc(n,i,l.viewFrom).concat(l.view):l.viewFrom<i&&(l.view=l.view.slice(So(n,i))),l.viewFrom=i,l.viewTo<a?l.view=l.view.concat(tc(n,l.viewTo,a)):l.viewTo>a&&(l.view=l.view.slice(0,So(n,a)))),l.viewTo=a}function Ag(n){for(var i=n.display.view,a=0,l=0;l<i.length;l++){var u=i[l];!u.hidden&&(!u.node||u.changes)&&++a}return a}function ml(n){n.display.input.showSelection(n.display.input.prepareSelection())}function Lg(n,i){i===void 0&&(i=!0);var a=n.doc,l={},u=l.cursors=document.createDocumentFragment(),m=l.selection=document.createDocumentFragment(),y=n.options.$customCursor;y&&(i=!0);for(var x=0;x<a.sel.ranges.length;x++)if(!(!i&&x==a.sel.primIndex)){var S=a.sel.ranges[x];if(!(S.from().line>=n.display.viewTo||S.to().line<n.display.viewFrom)){var T=S.empty();if(y){var H=y(n,S);H&&If(n,H,u)}else(T||n.options.showCursorWhenSelecting)&&If(n,S.head,u);T||kk(n,S,m)}}return l}function If(n,i,a){var l=_r(n,i,"div",null,null,!n.options.singleCursorHeightPerLine),u=a.appendChild(k("div"," ","CodeMirror-cursor"));if(u.style.left=l.left+"px",u.style.top=l.top+"px",u.style.height=Math.max(0,l.bottom-l.top)*n.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(n.getWrapperElement().className)){var m=ic(n,i,"div",null,null),y=m.right-m.left;u.style.width=(y>0?y:n.defaultCharWidth())+"px"}if(l.other){var x=a.appendChild(k("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));x.style.display="",x.style.left=l.other.left+"px",x.style.top=l.other.top+"px",x.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function sc(n,i){return n.top-i.top||n.left-i.left}function kk(n,i,a){var l=n.display,u=n.doc,m=document.createDocumentFragment(),y=pg(n.display),x=y.left,S=Math.max(l.sizerWidth,wo(n)-l.sizer.offsetLeft)-y.right,T=u.direction=="ltr";function H(Me,ze,Ye,Ue){ze<0&&(ze=0),ze=Math.round(ze),Ue=Math.round(Ue),m.appendChild(k("div",null,"CodeMirror-selected","position: absolute; left: "+Me+`px;
24 top: `+ze+"px; width: "+(Ye??S-Me)+`px;
25 height: `+(Ue-ze)+"px"))}function V(Me,ze,Ye){var Ue=qe(u,Me),st=Ue.text.length,St,tn;function Ot(Ut,En){return ic(n,fe(Me,Ut),"div",Ue,En)}function qn(Ut,En,sn){var Kt=Cg(n,Ue,null,Ut),Vt=En=="ltr"==(sn=="after")?"left":"right",It=sn=="after"?Kt.begin:Kt.end-(/\s/.test(Ue.text.charAt(Kt.end-1))?2:1);return Ot(It,Vt)[Vt]}var Cn=lt(Ue,u.direction);return Fn(Cn,ze||0,Ye??st,function(Ut,En,sn,Kt){var Vt=sn=="ltr",It=Ot(Ut,Vt?"left":"right"),An=Ot(En-1,Vt?"right":"left"),ks=ze==null&&Ut==0,ji=Ye==null&&En==st,fn=Kt==0,Ur=!Cn||Kt==Cn.length-1;if(An.top-It.top<=3){var nn=(T?ks:ji)&&fn,cd=(T?ji:ks)&&Ur,ui=nn?x:(Vt?It:An).left,Ao=cd?S:(Vt?An:It).right;H(ui,It.top,Ao-ui,It.bottom)}else{var Lo,yn,Ss,ud;Vt?(Lo=T&&ks&&fn?x:It.left,yn=T?S:qn(Ut,sn,"before"),Ss=T?x:qn(En,sn,"after"),ud=T&&ji&&Ur?S:An.right):(Lo=T?qn(Ut,sn,"before"):x,yn=!T&&ks&&fn?S:It.right,Ss=!T&&ji&&Ur?x:An.left,ud=T?qn(En,sn,"after"):S),H(Lo,It.top,yn-Lo,It.bottom),It.bottom<An.top&&H(x,It.bottom,null,An.top),H(Ss,An.top,ud-Ss,An.bottom)}(!St||sc(It,St)<0)&&(St=It),sc(An,St)<0&&(St=An),(!tn||sc(It,tn)<0)&&(tn=It),sc(An,tn)<0&&(tn=An)}),{start:St,end:tn}}var se=i.from(),te=i.to();if(se.line==te.line)V(se.line,se.ch,te.ch);else{var pe=qe(u,se.line),we=qe(u,te.line),Te=Sr(pe)==Sr(we),Le=V(se.line,se.ch,Te?pe.text.length+1:null).end,De=V(te.line,Te?0:null,te.ch).start;Te&&(Le.top<De.top-2?(H(Le.right,Le.top,null,Le.bottom),H(x,De.top,De.left,De.bottom)):H(Le.right,Le.top,De.left-Le.right,Le.bottom)),Le.bottom<De.top&&H(x,Le.bottom,null,De.top)}a.appendChild(m)}function Df(n){if(n.state.focused){var i=n.display;clearInterval(i.blinker);var a=!0;i.cursorDiv.style.visibility="",n.options.cursorBlinkRate>0?i.blinker=setInterval(function(){n.hasFocus()||us(n),i.cursorDiv.style.visibility=(a=!a)?"":"hidden"},n.options.cursorBlinkRate):n.options.cursorBlinkRate<0&&(i.cursorDiv.style.visibility="hidden")}}function Mg(n){n.hasFocus()||(n.display.input.focus(),n.state.focused||Ff(n))}function zf(n){n.state.delayingBlurEvent=!0,setTimeout(function(){n.state.delayingBlurEvent&&(n.state.delayingBlurEvent=!1,n.state.focused&&us(n))},100)}function Ff(n,i){n.state.delayingBlurEvent&&!n.state.draggingText&&(n.state.delayingBlurEvent=!1),n.options.readOnly!="nocursor"&&(n.state.focused||(Pt(n,"focus",n,i),n.state.focused=!0,Se(n.display.wrapper,"CodeMirror-focused"),!n.curOp&&n.display.selForContextMenu!=n.doc.sel&&(n.display.input.reset(),g&&setTimeout(function(){return n.display.input.reset(!0)},20)),n.display.input.receivedFocus()),Df(n))}function us(n,i){n.state.delayingBlurEvent||(n.state.focused&&(Pt(n,"blur",n,i),n.state.focused=!1,N(n.display.wrapper,"CodeMirror-focused")),clearInterval(n.display.blinker),setTimeout(function(){n.state.focused||(n.display.shift=!1)},150))}function lc(n){for(var i=n.display,a=i.lineDiv.offsetTop,l=Math.max(0,i.scroller.getBoundingClientRect().top),u=i.lineDiv.getBoundingClientRect().top,m=0,y=0;y<i.view.length;y++){var x=i.view[y],S=n.options.lineWrapping,T=void 0,H=0;if(!x.hidden){if(u+=x.line.height,h&&p<8){var V=x.node.offsetTop+x.node.offsetHeight;T=V-a,a=V}else{var se=x.node.getBoundingClientRect();T=se.bottom-se.top,!S&&x.text.firstChild&&(H=x.text.firstChild.getBoundingClientRect().right-se.left-1)}var te=x.line.height-T;if((te>.005||te<-.005)&&(u<l&&(m-=te),Qn(x.line,T),Ng(x.line),x.rest))for(var pe=0;pe<x.rest.length;pe++)Ng(x.rest[pe]);if(H>n.display.sizerWidth){var we=Math.ceil(H/cs(n.display));we>n.display.maxLineLength&&(n.display.maxLineLength=we,n.display.maxLine=x.line,n.display.maxLineChanged=!0)}}}Math.abs(m)>2&&(i.scroller.scrollTop+=m)}function Ng(n){if(n.widgets)for(var i=0;i<n.widgets.length;++i){var a=n.widgets[i],l=a.node.parentNode;l&&(a.height=l.offsetHeight)}}function ac(n,i,a){var l=a&&a.top!=null?Math.max(0,a.top):n.scroller.scrollTop;l=Math.floor(l-nc(n));var u=a&&a.bottom!=null?a.bottom:l+n.wrapper.clientHeight,m=U(i,l),y=U(i,u);if(a&&a.ensure){var x=a.ensure.from.line,S=a.ensure.to.line;x<m?(m=x,y=U(i,si(qe(i,x))+n.wrapper.clientHeight)):Math.min(S,i.lastLine())>=y&&(m=U(i,si(qe(i,S))-n.wrapper.clientHeight),y=S)}return{from:m,to:Math.max(y,m+1)}}function Sk(n,i){if(!Rt(n,"scrollCursorIntoView")){var a=n.display,l=a.sizer.getBoundingClientRect(),u=null,m=a.wrapper.ownerDocument;if(i.top+l.top<0?u=!0:i.bottom+l.top>(m.defaultView.innerHeight||m.documentElement.clientHeight)&&(u=!1),u!=null&&!M){var y=k("div","​",null,`position: absolute;
26 top: `+(i.top-a.viewOffset-nc(n.display))+`px;

Callers 2

ykFunction · 0.70
bkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected