33 lines
306 KiB
JavaScript
33 lines
306 KiB
JavaScript
|
|
import{v as Ju}from"./defaultSettingsView-CJSZINFr.js";var vi={exports:{}},Zu=vi.exports,pa;function mt(){return pa||(pa=1,(function(ct,xt){(function(b,pe){ct.exports=pe()})(Zu,(function(){var b=navigator.userAgent,pe=navigator.platform,_=/gecko\/\d/i.test(b),te=/MSIE \d/.test(b),oe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(b),Q=/Edge\/(\d+)/.exec(b),k=te||oe||Q,I=k&&(te?document.documentMode||6:+(Q||oe)[1]),Y=!Q&&/WebKit\//.test(b),ne=Y&&/Qt\/\d+\.\d+/.test(b),S=!Q&&/Chrome\/(\d+)/.exec(b),R=S&&+S[1],A=/Opera\//.test(b),V=/Apple Computer/.test(navigator.vendor),ue=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(b),O=/PhantomJS/.test(b),w=V&&(/Mobile\/\w+/.test(b)||navigator.maxTouchPoints>2),M=/Android/.test(b),N=w||M||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(b),z=w||/Mac/.test(pe),X=/\bCrOS\b/.test(b),q=/win/i.test(pe),p=A&&b.match(/Version\/(\d*\.\d*)/);p&&(p=Number(p[1])),p&&p>=15&&(A=!1,Y=!0);var W=z&&(ne||A&&(p==null||p<12.11)),J=_||k&&I>=9;function P(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var $=function(e,t){var n=e.className,r=P(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 F(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function G(e,t){return F(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 T(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var C;document.createRange?C=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:C=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function g(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 y(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function j(e,t){var n=e.className;P(t).test(n)||(e.className+=(n?" ":"")+t)}function de(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!P(n[r]).test(t)&&(t+=" "+n[r]);return t}var v=function(e){e.select()};w?v=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:k&&(v=function(e){try{e.select()}catch{}});function d(e){return e.display.wrapper.ownerDocument}function fe(e){return Te(e.display.wrapper)}function Te(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function le(e){return d(e).defaultView}function xe(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Me(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 Fe(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf(" ",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var Ce=function(){this.id=null,this.f=null,this.time=0,this.handler=xe(this.onTimeout,this)};Ce.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ce.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 ve(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Oe=50,qe={toString:function(){return"CodeMirror.Pass"}},Ve={scroll:!1},dt={origin:"*mouse"},Pe={origin:"+move"};function _e(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Ue=[""];function et(e){for(;Ue.length<=e;)Ue.push(we(Ue)+" ");return Ue[e]}function we(e){return e[e.length-1]}function Ie(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function E(e,t,n){for(
|
|||
|
|
|
|||
|
|
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),l=o.indexOf("\r");l!=-1?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ur=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Wn=(function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),Wt=null;function yi(e){if(Wt!=null)return Wt;var t=G(e,c("span","x")),n=t.getBoundingClientRect(),r=C(t,0,1).getBoundingClientRect();return Wt=Math.abs(n.left-r.left)>1}var Pr={},Ht={};function _t(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pr[e]=t}function kr(e,t){Ht[e]=t}function Ir(e){if(typeof e=="string"&&Ht.hasOwnProperty(e))e=Ht[e];else if(e&&typeof e.name=="string"&&Ht.hasOwnProperty(e.name)){var t=Ht[e.name];typeof t=="string"&&(t={name:t}),e=K(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ir("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ir("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function zr(e,t){t=Ir(t);var n=Pr[t.name];if(!n)return zr(e,"text/plain");var r=n(e,t);if(fr.hasOwnProperty(t.name)){var i=fr[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 l in t.modeProps)r[l]=t.modeProps[l];return r}var fr={};function Br(e,t){var n=fr.hasOwnProperty(e)?fr[e]:fr[e]={};Me(t,n)}function Gt(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 sn(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 Rr(e,t,n){return e.startState?e.startState(t,n):!0}var Je=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};Je.prototype.eol=function(){return this.pos>=this.string.length},Je.prototype.sol=function(){return this.pos==this.lineStart},Je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Je.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Je.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},Je.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Je.prototype.skipToEnd=function(){this.pos=this.string.length},Je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Je.prototype.backUp=function(e){this.pos-=e},Je.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Fe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Fe(this.string,this.lineStart,this.tabSize):0)},Je.prototype.indentation=function(){return Fe(this.string,null,this.tabSize)-(this.lineStart?Fe(this.string,this.lineStart,this.tabSize):0)},Je.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(l){return n?l.toLowerCase():l},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)}},Je.prototype.current=function(){return this.string.slice(this.start,this.pos)},Je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Je.
|
|||
|
|
`?(Z=h.appendChild(c("span",D[0]=="\r"?"␍":"","cm-invalidchar")),Z.setAttribute("cm-text",D[0]),e.col+=1):(Z=e.cm.options.specialCharPlaceholder(D[0]),Z.setAttribute("cm-text",D[0]),k&&I<9?h.appendChild(c("span",[Z])):h.appendChild(Z),e.col+=1);e.map.push(e.pos,e.pos+1,Z),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,n||r||i||u||o||l){var he=n||"";r&&(he+=r),i&&(he+=i);var se=c("span",[h],he,o);if(l)for(var ge in l)l.hasOwnProperty(ge)&&ge!="style"&&ge!="class"&&se.setAttribute(ge,l[ge]);return e.content.appendChild(se)}e.content.appendChild(h)}}function vs(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 ms(e,t){return function(n,r,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,h=u+r.length;;){for(var x=void 0,D=0;D<t.length&&(x=t[D],!(x.to>u&&x.from<=u));D++);if(x.to>=h)return e(n,r,i,o,l,a,s);e(n,r.slice(0,x.to-u),i,o,null,a,s),o=null,r=r.slice(x.to-u),u=x.to}}}function Po(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 xs(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var l=1;l<n.length;l+=2)t.addToken(t,i.slice(o,o=n[l]),Eo(n[l+1],t.cm.options));return}for(var a=i.length,s=0,u=1,h="",x,D,L=0,H,Z,ie,ae,he;;){if(L==s){H=Z=ie=D="",he=null,ae=null,L=1/0;for(var se=[],ge=void 0,Le=0;Le<r.length;++Le){var ke=r[Le],Ee=ke.marker;if(Ee.type=="bookmark"&&ke.from==s&&Ee.widgetNode)se.push(Ee);else if(ke.from<=s&&(ke.to==null||ke.to>s||Ee.collapsed&&ke.to==s&&ke.from==s)){if(ke.to!=null&&ke.to!=s&&L>ke.to&&(L=ke.to,Z=""),Ee.className&&(H+=" "+Ee.className),Ee.css&&(D=(D?D+";":"")+Ee.css),Ee.startStyle&&ke.from==s&&(ie+=" "+Ee.startStyle),Ee.endStyle&&ke.to==L&&(ge||(ge=[])).push(Ee.endStyle,ke.to),Ee.title&&((he||(he={})).title=Ee.title),Ee.attributes)for(var Ke in Ee.attributes)(he||(he={}))[Ke]=Ee.attributes[Ke];Ee.collapsed&&(!ae||Si(ae.marker,Ee)<0)&&(ae=ke)}else ke.from>s&&L>ke.from&&(L=ke.from)}if(ge)for(var st=0;st<ge.length;st+=2)ge[st+1]==L&&(Z+=" "+ge[st]);if(!ae||ae.from==s)for(var Xe=0;Xe<se.length;++Xe)Po(t,0,se[Xe]);if(ae&&(ae.from||0)==s){if(Po(t,(ae.to==null?a+1:ae.to)-s,ae.marker,ae.from==null),ae.to==null)return;ae.to==s&&(ae=!1)}}if(s>=a)break;for(var Nt=Math.min(a,L);;){if(h){var Tt=s+h.length;if(!ae){var tt=Tt>Nt?h.slice(0,Nt-s):h;t.addToken(t,tt,x?x+H:H,ie,s+tt.length==L?Z:"",D,he)}if(Tt>=Nt){h=h.slice(Nt-s),s=Nt;break}s=Tt,ie=""}h=i.slice(o,o=n[u++]),x=Eo(n[u++],t.cm.options)}}}function Io(e,t,n){this.line=t,this.rest=us(t),this.size=this.rest?f(we(this.rest))-n+1:1,this.node=this.text=null,this.hidden=cr(e,t)}function Gn(e,t,n){for(var r=[],i,o=t;o<n;o=i){var l=new Io(e.doc,ye(e.doc,o),o);i=o+l.size,r.push(l)}return r}var _r=null;function ys(e){_r?_r.ops.push(e):e.ownsGroup=_r={ops:[e],delayedCallbacks:[]}}function bs(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 ks(e,t){var n=e.ownsGroup;if(n)try{bs(n)}finally{_r=null,t(n)}}var dn=null;function ot(e,t){var n=Zt(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;_r?i=_r.delayedCallbacks:dn?i=dn:(i=dn=[],setTimeout(ws,0));for(var o=function(a){i.push(function(){return n[a].apply(null,r)})},l=0;l<n.length;++l)o(l)}}function ws(){var e=dn;dn=null;for(var t=0;t<e.length;++t)e[t]()}function zo(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?Ls(e,t):o=="gutter"?Ro(e,t,n,r):o=="class"?Di(e,t):o=="widget"&&Ts(e,t,r)}t.changes=null}function hn(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&
|
|||
|
|
top: `+ge+"px; width: "+(Le??s-se)+`px;
|
|||
|
|
height: `+(ke-ge)+"px"))}function x(se,ge,Le){var ke=ye(i,se),Ee=ke.text.length,Ke,st;function Xe(tt,Ct){return Qn(e,B(se,tt),"div",ke,Ct)}function Nt(tt,Ct,ft){var nt=$o(e,ke,null,tt),rt=Ct=="ltr"==(ft=="after")?"left":"right",Ze=ft=="after"?nt.begin:nt.end-(/\s/.test(ke.text.charAt(nt.end-1))?2:1);return Xe(Ze,rt)[rt]}var Tt=Re(ke,i.direction);return or(Tt,ge||0,Le??Ee,function(tt,Ct,ft,nt){var rt=ft=="ltr",Ze=Xe(tt,rt?"left":"right"),Dt=Xe(Ct-1,rt?"right":"left"),nn=ge==null&&tt==0,yr=Le==null&&Ct==Ee,vt=nt==0,Jt=!Tt||nt==Tt.length-1;if(Dt.top-Ze.top<=3){var ut=(u?nn:yr)&&vt,co=(u?yr:nn)&&Jt,ir=ut?a:(rt?Ze:Dt).left,Ar=co?s:(rt?Dt:Ze).right;h(ir,Ze.top,Ar-ir,Ze.bottom)}else{var Nr,bt,on,ho;rt?(Nr=u&&nn&&vt?a:Ze.left,bt=u?s:Nt(tt,ft,"before"),on=u?a:Nt(Ct,ft,"after"),ho=u&&yr&&Jt?s:Dt.right):(Nr=u?Nt(tt,ft,"before"):a,bt=!u&&nn&&vt?s:Ze.right,on=!u&&yr&&Jt?a:Dt.left,ho=u?Nt(Ct,ft,"after"):s),h(Nr,Ze.top,bt-Nr,Ze.bottom),Ze.bottom<Dt.top&&h(a,Ze.bottom,null,Dt.top),h(on,Dt.top,ho-on,Dt.bottom)}(!Ke||Zn(Ze,Ke)<0)&&(Ke=Ze),Zn(Dt,Ke)<0&&(Ke=Dt),(!st||Zn(Ze,st)<0)&&(st=Ze),Zn(Dt,st)<0&&(st=Dt)}),{start:Ke,end:st}}var D=t.from(),L=t.to();if(D.line==L.line)x(D.line,D.ch,L.ch);else{var H=ye(i,D.line),Z=ye(i,L.line),ie=qt(H)==qt(Z),ae=x(D.line,D.ch,ie?H.text.length+1:null).end,he=x(L.line,ie?0:null,L.ch).start;ie&&(ae.top<he.top-2?(h(ae.right,ae.top,null,ae.bottom),h(a,he.top,he.left,he.bottom)):h(ae.right,ae.top,he.left-ae.right,ae.bottom)),ae.bottom<he.top&&h(a,ae.bottom,null,he.top)}n.appendChild(o)}function Wi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ur(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function nl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||_i(e))}function Hi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Ur(e))},100)}function _i(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ye(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),Y&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Wi(e))}function Ur(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ye(e,"blur",e,t),e.state.focused=!1,$(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Vn(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,l=0;l<t.view.length;l++){var a=t.view[l],s=e.options.lineWrapping,u=void 0,h=0;if(!a.hidden){if(i+=a.line.height,k&&I<8){var x=a.node.offsetTop+a.node.offsetHeight;u=x-n,n=x}else{var D=a.node.getBoundingClientRect();u=D.bottom-D.top,!s&&a.text.firstChild&&(h=a.text.firstChild.getBoundingClientRect().right-D.left-1)}var L=a.line.height-u;if((L>.005||L<-.005)&&(i<r&&(o-=L),Et(a.line,u),il(a.line),a.rest))for(var H=0;H<a.rest.length;H++)il(a.rest[H]);if(h>e.display.sizerWidth){var Z=Math.ceil(h/Kr(e.display));Z>e.display.maxLineLength&&(e.display.maxLineLength=Z,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function il(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 $n(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Xn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=m(t,r),l=m(t,i);if(n&&n.ensure){var a=n.ensure.from.line,s=n.ensure.to.line;a<o?(o=a,l=m(t,er(ye(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=m(t,er(ye(t,s))-e.wrapper.clientHeight),l=s)}return
|
|||
|
|
top: `+(t.top-n.viewOffset-Xn(e.display))+`px;
|
|||
|
|
height: `+(t.bottom-t.top+Yt(e)+n.barHeight)+`px;
|
|||
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function Ws(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?B(t.line,t.ch+1,"before"):t,t=t.ch?B(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=jt(e,t),s=!n||n==t?a:jt(e,n);i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=qi(e,i),h=e.doc.scrollTop,x=e.doc.scrollLeft;if(u.scrollTop!=null&&(xn(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(l=!0)),u.scrollLeft!=null&&(Cr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-x)>1&&(l=!0)),!l)break}return i}function Hs(e,t){var n=qi(e,t);n.scrollTop!=null&&xn(e,n.scrollTop),n.scrollLeft!=null&&Cr(e,n.scrollLeft)}function qi(e,t){var n=e.display,r=jr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Fi(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Mi(n),s=t.top<r,u=t.bottom>a-r;if(t.top<i)l.scrollTop=s?0:t.top;else if(t.bottom>i+o){var h=Math.min(t.top,(u?a:t.bottom)-o);h!=i&&(l.scrollTop=h)}var x=e.options.fixedGutter?0:n.gutters.offsetWidth,D=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-x,L=wr(e)-n.gutters.offsetWidth,H=t.right-t.left>L;return H&&(t.right=t.left+L),t.left<10?l.scrollLeft=0:t.left<D?l.scrollLeft=Math.max(0,t.left+x-(H?0:10)):t.right>L+D-3&&(l.scrollLeft=t.right+(H?0:10)-L),l}function ji(e,t){t!=null&&(ei(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Gr(e){ei(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function mn(e,t,n){(t!=null||n!=null)&&ei(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function _s(e,t){ei(e),e.curOp.scrollToPos=t}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Zo(e,t.from),r=Zo(e,t.to);ol(e,n,r,t.margin)}}function ol(e,t,n,r){var i=qi(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});mn(e,i.scrollLeft,i.scrollTop)}function xn(e,t){Math.abs(e.doc.scrollTop-t)<2||(_||Ui(e,{top:t}),ll(e,t,!0),_&&Ui(e),kn(e,100))}function ll(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,cl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function yn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Mi(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+Yt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Dr=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),Se(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Se(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,k&&I<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dr.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.h
|
|||
|
|
`},setDirection:at(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&nu(this.cm))})}),Lt.prototype.eachLine=Lt.prototype.iter;var ql=0;function vu(e){var t=this;if(jl(t),!(Qe(t,e)||tr(t.display,e))){pt(e),k&&(ql=+new Date);var n=Lr(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),l=0,a=function(){++l==i&<(t,function(){n=Ae(t.doc,n);var L={from:n,to:n,text:t.doc.splitLines(o.filter(function(H){return H!=null}).join(t.doc.lineSeparator())),origin:"paste"};Jr(t.doc,L),Dl(t.doc,pr(Ae(t.doc,n),Ae(t.doc,gr(L))))})()},s=function(L,H){if(t.options.allowDropFileTypes&&ve(t.options.allowDropFileTypes,L.type)==-1){a();return}var Z=new FileReader;Z.onerror=function(){return a()},Z.onload=function(){var ie=Z.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ie)){a();return}o[H]=ie,a()},Z.readAsText(L)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var h=e.dataTransfer.getData("Text");if(h){var x;if(t.state.draggingText&&!t.state.draggingText.copy&&(x=t.listSelections()),li(t.doc,pr(n,n)),x)for(var D=0;D<x.length;++D)Zr(t.doc,"",x[D].anchor,x[D].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch{}}}}function mu(e,t){if(k&&(!e.state.draggingText||+new Date-ql<100)){ar(t);return}if(!(Qe(e,t)||tr(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!V)){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",A&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),A&&n.parentNode.removeChild(n)}}function xu(e,t){var n=Lr(e,t);if(n){var r=document.createDocumentFragment();Ri(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)),G(e.display.dragCursor,r)}}function jl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Kl(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 Ul=!1;function yu(){Ul||(bu(),Ul=!0)}function bu(){var e;Se(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Kl(ku)},100))}),Se(window,"blur",function(){return Kl(Ur)})}function ku(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var xr={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"},An=0;An<10;An++)xr[An+48]=xr[An+96]=String(An);for(var ui=65;ui<=90;ui++)xr[ui]=String.fromCharCode(ui);for(var Nn=1;Nn<=12;Nn++)xr[Nn+111]=xr[Nn+63235]="F"+Nn;var nr={};nr.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"},nr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z"
|
|||
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ql(e,t){var n=ye(e.doc,t),r=qt(n);return r!=n&&(t=f(r)),no(!0,e,r,t,1)}function Tu(e,t){var n=ye(e.doc,t),r=ss(n);return r!=n&&(t=f(r)),no(!0,e,n,t,-1)}function Jl(e,t){var n=Ql(e,t.line),r=ye(e.doc,n.line),i=Re(r,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=o&&t.ch;return B(n.line,l?0:o,n.sticky)}return n}function ci(e,t,n){if(typeof t=="string"&&(t=En[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)!=qe}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Cu(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=$r(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&$r(t,e.options.extraKeys,n,e)||$r(t,e.options.keyMap,n,e)}var Du=new Ce;function On(e,t,n,r){var i=e.state.keySeq;if(i){if(Gl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Du.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Zl(e,i+" "+t,n,r))return!0}return Zl(e,t,n,r)}function Zl(e,t,n,r){var i=Cu(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&ot(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(pt(n),Wi(e)),!!i}function Vl(e,t){var n=Yl(t,!0);return n?t.shiftKey&&!e.state.keySeq?On(e,"Shift-"+n,t,function(r){return ci(e,r,!0)})||On(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ci(e,r)}):On(e,n,t,function(r){return ci(e,r)}):!1}function Mu(e,t,n){return On(e,"'"+n+"'",t,function(r){return ci(e,r,!0)})}var io=null;function $l(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=y(fe(t)),!Qe(t,e))){k&&I<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Vl(t,e);A&&(io=r?n:null,!r&&n==88&&!Wn&&(z?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),_&&!z&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fu(t)}}function Fu(e){var t=e.display.lineDiv;j(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&($(t,"CodeMirror-crosshair"),ht(document,"keyup",n),ht(document,"mouseover",n))}Se(document,"keyup",n),Se(document,"mouseover",n)}function ea(e){e.keyCode==16&&(this.doc.sel.shift=!1),Qe(this,e)}function ta(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(tr(t.display,e)||Qe(t,e)||e.ctrlKey&&!e.altKey||z&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(A&&n==io){io=null,pt(e);return}if(!(A&&(!e.which||e.which<10)&&Vl(t,e))){var i=String.fromCharCode(r??n);i!="\b"&&(Mu(t,e,i)||t.display.input.onKeyPress(e))}}}var Au=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+Au>e&&ce(t,this.pos)==0&&n==this.button};var Pn,In;function Nu(e,t){var n=+new Date;return In&&In.compare(n,e,t)?(Pn=In=null,"triple"):Pn&&Pn.compare(n,e,t)?(In=new oo(n,e,t),Pn=null,"double"):(Pn=new oo(n,e,t),In=null,"single")}function ra(e){var t=this,n=t.display;if(!(Qe(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,tr(n,e)){Y||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!lo(t,e)){var r=Lr(t,e),i=Rt(e),o=r?Nu(r,i):"single";le(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Eu(t,i,r,o,e))&&(i==1?r?Pu(t,r,o,e):ln(e)==n.scroller&&pt(e):i==2?(r&&oi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(J?t.display.input.onContextMenu(e):Hi(t)))}}}function Eu(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,Xl(o,i),i,function(l){if(typeof l=="string"&&(l=En[l]),!l)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=l(e,n)!=qe}finally{e.state.suppressEdits=!1}return a})}function Ou(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==nu
|
|||
|
|
`)==t){if(r.ranges.length%Ut.text.length==0){u=[];for(var h=0;h<Ut.text.length;h++)u.push(o.splitLines(Ut.text[h]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=Ie(s,function(ae){return[ae]}));for(var x=e.curOp.updateInput,D=r.ranges.length-1;D>=0;D--){var L=r.ranges[D],H=L.from(),Z=L.to();L.empty()&&(n&&n>0?H=B(H.line,H.ch-n):e.state.overwrite&&!a?Z=B(Z.line,Math.min(ye(o,Z.line).text.length,Z.ch+we(s).length)):a&&Ut&&Ut.lineWise&&Ut.text.join(`
|
|||
|
|
`)==s.join(`
|
|||
|
|
`)&&(H=Z=B(H.line,0)));var ie={from:H,to:Z,text:u?u[D%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Jr(e.doc,ie),ot(e,"inputRead",e,ie)}t&&!a&&ua(e,t),Gr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=x),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&At(t,function(){return so(t,n,0,null,"paste")}),!0}function ua(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),l=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=zn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ye(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=zn(e,i.head.line,"smart"));l&&ot(e,"electricInput",e,i.head.line)}}}function fa(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:B(i,0),head:B(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 ca(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Y?e.style.width="1000px":e.setAttribute("wrap","off"),w&&(e.style.border="1px solid black"),t}function ju(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){le(this).focus(),this.display.input.focus()},setOption:function(r,i){var o=this.options,l=o[r];o[r]==i&&r!="mode"||(o[r]=i,t.hasOwnProperty(r)&<(this,t[r])(this,i,l),Ye(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"](fi(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:yt(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");E(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(l){return l.priority}),this.state.modeGen++,St(this)}),removeOverlay:yt(function(r){for(var i=this.state.overlays,o=0;o<i.length;++o){var l=i[o].modeSpec;if(l==r||typeof r=="string"&&l.name==r){i.splice(o,1),this.state.modeGen++,St(this);return}}}),indentLine:yt(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),U(this.doc,r)&&zn(this,r,i,o)}),indentSelection:yt(function(r){for(var i=this.doc.sel.ranges,o=-1,l=0;l<i.length;l++){var a=i[l];if(a.empty())a.head.line>o&&(zn(this,a.head.line,r,!0),o=a.head.line,l==this.doc.sel.primIndex&&Gr(this));else{var s=a.from(),u=a.to(),h=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var x=h;x<o;++x)zn(this,x,r);var D=this.doc.sel.ranges;s.ch==0&&i.length==D.length&&D[l].from().ch>0&&eo(this.doc,l,new He(s,D[l].to()),Ve)}}}),getTokenAt:function(r,i){return ko(this,r,i)},getLineTokens:function(r,i){return ko(this,B(r),i,!0)},getTokenTypeAt:function(r){r=Ae(this.doc,r);var i=xo(this,ye(this.doc,r.line)),o=0,l=(i.length-1)/2,a=r.ch,s;if(a==0)s=i[2];else for(;;){var u=o+l>>1;if((u?i[u*2-1]:0)>=a)l=u;else if(i[u*2+1]<a)o=u+1;else{s=i[u*2+2];break}}var h=s?s.indexOf("overlay "):-1;return h<0?s:h==0?null:s.slice(0,h-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var l=n[i],a=this.getModeAt(r);if(typeof a[i]=="string")l[a[i]]&&o.pu
|
|||
|
|
`,ie=De(Z,L)?"w":D&&Z==`
|
|||
|
|
`?"n":!D||/\s/.test(Z)?null:"p";if(D&&!H&&!ie&&(ie="s"),x&&x!=ie){n<0&&(n=1,h(),t.sticky="after");break}if(ie&&(x=ie),n>0&&!h(!H))break}var ae=ai(e,t,o,l,!0);return We(o,ae)&&(ae.hitSide=!0),ae}function da(e,t,n,r){var i=e.doc,o=t.left,l;if(r=="page"){var a=Math.min(e.display.wrapper.clientHeight,le(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(a-.5*jr(e.display),3);l=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var u;u=Oi(e,o,l),!!u.outside;){if(n<0?l<=0:l>=i.height){u.hitSide=!0;break}l+=n*5}return u}var je=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ce,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};je.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(a){for(var s=a.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}Se(i,"paste",function(a){!o(a)||Qe(r,a)||sa(a,r)||I<=11&&setTimeout(lt(r,function(){return t.updateFromDOM()}),20)}),Se(i,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),Se(i,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),Se(i,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Se(i,"touchstart",function(){return n.forceCompositionEnd()}),Se(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(a){if(!(!o(a)||Qe(r,a))){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()}),a.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=fa(r);hi({lineWise:!0,text:s.text}),a.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Ve),r.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var u=Ut.text.join(`
|
|||
|
|
`);if(a.clipboardData.setData("Text",u),a.clipboardData.getData("Text")==u){a.preventDefault();return}}var h=ca(),x=h.firstChild;uo(x),r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),x.value=Ut.text.join(`
|
|||
|
|
`);var D=y(Te(i));v(x),setTimeout(function(){r.display.lineSpace.removeChild(h),D.focus(),D==i&&n.showPrimarySelection()},50)}}Se(i,"copy",l),Se(i,"cut",l)},je.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},je.prototype.prepareSelection=function(){var e=rl(this.cm,!1);return e.focus=y(Te(this.div))==this.div,e},je.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},je.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},je.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=pi(t,e.anchorNode,e.anchorOffset),l=pi(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&l&&!l.bad&&ce(Wr(o,l),r)==0&&ce(wt(o,l),i)==0)){var a=t.display.view,s=r.line>=t.display.viewFrom&&ha(t,r)||{node:a[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&ha(t,i);if(!u){var h=a[a.length-1].measure,x=h.maps?h.maps[h.maps.length-1]:h.map;u={node:x[x.length-1],offset:x[x.length-2]-x[x.length-3]}}if(!s||!u){e.removeAllRanges();return}var D=e.rangeCount&&e.getRangeAt(0),L;try{L=C(s.node,s.offset,u.offset,u.node)}catch{}L&&(!_&&t.state.focused?(e.collapse(s.node,s.offset),L.collapsed||(e.removeAllRanges(),e.addRange(L))):(e.removeAllRanges(),e.addRange(L)),D&&e.anchorNode==null?e.addRange(D):_&&this.startGracePeriod()),this.rememberSelection()}},je.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)},je.prototype.showMultipleSelections=function(e){G(this.cm.display.cursorDiv,e.cursors),G(this.cm.display.selectionDiv,e.selection)},je.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},je.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return g(this.div,t)},je.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||y(Te(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},je.prototype.blur=function(){this.div.blur()},je.prototype.getField=function(){return this.div},je.prototype.supportsTouch=function(){return!0},je.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):At(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)},je.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},je.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(M&&S&&this.cm.display.gutterSpecs.length&&Ku(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=pi(t,e.anchorNode,e.anchorOffset),r=pi(t,e.focusNode,e.focusOffset);n&&r&&At(t,function(){gt(t.doc,pr(n,r),Ve),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},je.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=B(r.line-1,ye(e.doc,r.line-1).length)),i.ch==ye(e.doc,i.line).t
|
|||
|
|
`),v(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}Se(i,"cut",o),Se(i,"copy",o),Se(e.scroller,"paste",function(l){if(!(tr(e,l)||Qe(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event("paste");a.clipboardData=l.clipboardData,i.dispatchEvent(a)}}),Se(e.lineSpace,"selectstart",function(l){tr(e,l)||pt(l)}),Se(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Se(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},$e.prototype.createField=function(e){this.wrapper=ca(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;uo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},$e.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},$e.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=rl(e);if(e.options.moveInputWithCursor){var i=jt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},$e.prototype.showSelection=function(e){var t=this.cm,n=t.display;G(n.cursorDiv,e.cursors),G(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},$e.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&&v(this.textarea),k&&I>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",k&&I>=9&&(this.hasSelection=null));this.resetting=!1}},$e.prototype.getField=function(){return this.textarea},$e.prototype.supportsTouch=function(){return!1},$e.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!N||y(Te(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},$e.prototype.blur=function(){this.textarea.blur()},$e.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$e.prototype.receivedFocus=function(){this.slowPoll()},$e.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},$e.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)},$e.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||ur(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(k&&I>=9&&this.hasSelection===i||z&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r=""),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(r.length,i.length);l<a&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return At(t,function(){so(t,i.slice(l),r.length-l,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},$e.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$e.prototype.onKeyPress=function(){k&&I>=9&&(this.hasSelection=null),this.fastPoll()},$e.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Lr(n,e),l=r.scroller.scrollTop;if(!o||A)return;var a=n.options.resetSelectionOnContextMenu;a&&n.doc.sel.contains(o)==-1&<(n,gt)(n.doc,pr(o),Ve);var s=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|||
|
|
top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px;
|
|||
|
|
z-index: 1000; background: `+(k?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|||
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var x;Y&&(x=i.ownerDocument.defaultView.scrollY),r.input.focus(),Y&&i.ownerDocument.defaultView.scrollTo(null,x),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=L,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function D(){if(i.selectionStart!=null){var Z=n.somethingSelected(),ie=""+(Z?i.value:"");i.value="⇚",i.value=ie,t.prevInput=Z?"":"",i.selectionStart=1,i.selectionEnd=ie.length,r.selForContextMenu=n.doc.sel}}function L(){if(t.contextMenuPending==L&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,k&&I<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!k||k&&I<9)&&D();var Z=0,ie=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput==""?lt(n,El)(n):Z++<10?r.detectingSelectAll=setTimeout(ie,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(ie,200)}}if(k&&I>=9&&D(),J){ar(e);var H=function(){ht(window,"mouseup",H),setTimeout(L,20)};Se(window,"mouseup",H)}else setTimeout(L,50)},$e.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},$e.prototype.setUneditable=function(){},$e.prototype.needsContentAttribute=!1;function Xu(e,t){if(t=t?Me(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=y(Te(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(Se(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var a=Ge(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function Yu(e){e.off=ht,e.on=Se,e.wheelEventPixels=tu,e.Doc=Lt,e.splitLines=zt,e.countColumn=Fe,e.findColumn=_e,e.isWordChar=me,e.Pass=qe,e.signal=Ye,e.Line=Hr,e.changeEnd=gr,e.scrollbarModel=sl,e.Pos=B,e.cmpPos=ce,e.modes=Pr,e.mimeModes=Ht,e.resolveMode=Ir,e.getMode=zr,e.modeExtensions=fr,e.extendMode=Br,e.copyState=Gt,e.startState=Rr,e.innerMode=sn,e.commands=En,e.keyMap=nr,e.keyName=Yl,e.isModifierKey=Gl,e.lookupKey=$r,e.normalizeKeyMap=Su,e.StringStream=Je,e.SharedTextMarker=Fn,e.TextMarker=mr,e.LineWidget=Mn,e.e_preventDefault=pt,e.e_stopPropagation=Er,e.e_stop=ar,e.addClass=j,e.contains=g,e.rmClass=$,e.keyNames=xr}Wu(Ge),ju(Ge);var Qu="iter insert remove copy getEditor constructor".split(" ");for(var gi in Lt.prototype)Lt.prototype.hasOwnProperty(gi)&&ve(Qu,gi)<0&&(Ge.prototype[gi]=(function(e){return function(){return e.apply(this.doc,arguments)}})(Lt.prototype[gi]));return Bt(Lt),Ge.inputStyles={textarea:$e,contenteditable:je},Ge.defineMode=function(e){!Ge.defaults.mode&&e!="null"&&(Ge.defaults.mode=e),_t.apply(this,arguments)},Ge.defineMIME=kr,Ge.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ge.defineMIME("text/plain","null"),Ge.defineExtension=function(e,t){Ge.prototype[e]=t},Ge.defineDocExtension=function(e,t){Lt.prototype[e]=t},Ge.fromTextArea=Xu,Yu(Ge),Ge.version="5.65.18",Ge}))})(vi)),vi.exports}var Vu=mt();const df=Ju(Vu);var ga={exports:{}},va;function Xa(){return va||(va=1,(function(ct,xt){(function(b){b(mt())})(function(b){b.defineMode("css",function(J,P){var $=P.inline;P.propertyKeywords||(P=b.resolveMode("text/css"));var F=J.indentUnit,G=P.tokenHooks,c=P.documentTypes||{},T=P.mediaTypes||{},C=P.mediaFeatures||{},g=P.mediaValueKeywords||{},y=P.propertyKeywords||{},j=P.nonStandardPropertyKeywords||{},de=P.fontProperties||{},v=P.counterDescriptors||{},d=P.co
|
|||
|
|
`;O.replaceSelection(q+q,null),S(O,-1),N=O.listSelections();for(var p=0;p<N.length;p++){var W=N[p].head.line;O.indentLine(W,null,!0),O.indentLine(W+1,null,!0)}})}function S(O,w){for(var M=[],N=O.listSelections(),z=0,X=0;X<N.length;X++){var q=N[X];q.head==O.getCursor()&&(z=X);var p=q.head.ch||w>0?{line:q.head.line,ch:q.head.ch+w}:{line:q.head.line-1};M.push({anchor:p,head:p})}O.setSelections(M,z)}function R(O){var w=b.cmpPos(O.anchor,O.head)>0;return{anchor:new _(O.anchor.line,O.anchor.ch+(w?-1:1)),head:new _(O.head.line,O.head.ch+(w?1:-1))}}function A(O,w){var M=I(O);if(!M||O.getOption("disableInput"))return b.Pass;var N=te(M,"pairs"),z=N.indexOf(w);if(z==-1)return b.Pass;for(var X=te(M,"closeBefore"),q=te(M,"triples"),p=N.charAt(z+1)==w,W=O.listSelections(),J=z%2==0,P,$=0;$<W.length;$++){var F=W[$],G=F.head,c,T=O.getRange(G,_(G.line,G.ch+1));if(J&&!F.empty())c="surround";else if((p||!J)&&T==w)p&&ue(O,G)?c="both":q.indexOf(w)>=0&&O.getRange(G,_(G.line,G.ch+3))==w+w+w?c="skipThree":c="skip";else if(p&&G.ch>1&&q.indexOf(w)>=0&&O.getRange(_(G.line,G.ch-2),G)==w+w){if(G.ch>2&&/\bstring/.test(O.getTokenTypeAt(_(G.line,G.ch-2))))return b.Pass;c="addFour"}else if(p){var C=G.ch==0?" ":O.getRange(_(G.line,G.ch-1),G);if(!b.isWordChar(T)&&C!=w&&!b.isWordChar(C))c="both";else return b.Pass}else if(J&&(T.length===0||/\s/.test(T)||X.indexOf(T)>-1))c="both";else return b.Pass;if(!P)P=c;else if(P!=c)return b.Pass}var g=z%2?N.charAt(z-1):w,y=z%2?w:N.charAt(z+1);O.operation(function(){if(P=="skip")S(O,1);else if(P=="skipThree")S(O,3);else if(P=="surround"){for(var j=O.getSelections(),de=0;de<j.length;de++)j[de]=g+j[de]+y;O.replaceSelections(j,"around"),j=O.listSelections().slice();for(var de=0;de<j.length;de++)j[de]=R(j[de]);O.setSelections(j)}else P=="both"?(O.replaceSelection(g+y,null),O.triggerElectric(g+y),S(O,-1)):P=="addFour"&&(O.replaceSelection(g+g+g+g,"before"),S(O,1))})}function V(O,w){var M=O.getRange(_(w.line,w.ch-1),_(w.line,w.ch+1));return M.length==2?M:null}function ue(O,w){var M=O.getTokenAt(_(w.line,w.ch+1));return/\bstring/.test(M.type)&&M.start==w.ch&&(w.ch==0||!/\bstring/.test(O.getTokenTypeAt(w)))}})})()),Ba.exports}sf();var Wa={exports:{}},Ha={exports:{}},_a;function Ja(){return _a||(_a=1,(function(ct,xt){(function(b){b(mt())})(function(b){var pe=b.Pos;function _(w){var M=w.flags;return M??(w.ignoreCase?"i":"")+(w.global?"g":"")+(w.multiline?"m":"")}function te(w,M){for(var N=_(w),z=N,X=0;X<M.length;X++)z.indexOf(M.charAt(X))==-1&&(z+=M.charAt(X));return N==z?w:new RegExp(w.source,z)}function oe(w){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(w.source)}function Q(w,M,N){M=te(M,"g");for(var z=N.line,X=N.ch,q=w.lastLine();z<=q;z++,X=0){M.lastIndex=X;var p=w.getLine(z),W=M.exec(p);if(W)return{from:pe(z,W.index),to:pe(z,W.index+W[0].length),match:W}}}function k(w,M,N){if(!oe(M))return Q(w,M,N);M=te(M,"gm");for(var z,X=1,q=N.line,p=w.lastLine();q<=p;){for(var W=0;W<X&&!(q>p);W++){var J=w.getLine(q++);z=z==null?J:z+`
|
|||
|
|
`+J}X=X*2,M.lastIndex=N.ch;var P=M.exec(z);if(P){var $=z.slice(0,P.index).split(`
|
|||
|
|
`),F=P[0].split(`
|
|||
|
|
`),G=N.line+$.length-1,c=$[$.length-1].length;return{from:pe(G,c),to:pe(G+F.length-1,F.length==1?c+F[0].length:F[F.length-1].length),match:P}}}}function I(w,M,N){for(var z,X=0;X<=w.length;){M.lastIndex=X;var q=M.exec(w);if(!q)break;var p=q.index+q[0].length;if(p>w.length-N)break;(!z||p>z.index+z[0].length)&&(z=q),X=q.index+1}return z}function Y(w,M,N){M=te(M,"g");for(var z=N.line,X=N.ch,q=w.firstLine();z>=q;z--,X=-1){var p=w.getLine(z),W=I(p,M,X<0?0:p.length-X);if(W)return{from:pe(z,W.index),to:pe(z,W.index+W[0].length),match:W}}}function ne(w,M,N){if(!oe(M))return Y(w,M,N);M=te(M,"gm");for(var z,X=1,q=w.getLine(N.line).length-N.ch,p=N.line,W=w.firstLine();p>=W;){for(var J=0;J<X&&p>=W;J++){var P=w.getLine(p--);z=z==null?P:P+`
|
|||
|
|
`+z}X*=2;var $=I(z,M,q);if($){var F=z.slice(0,$.index).split(`
|
|||
|
|
`),G=$[0].split(`
|
|||
|
|
`),c=p+F.length,T=F[F.length-1].length;return{from:pe(c,T),to:pe(c+G.length-1,G.length==1?T+G[0].length:G[G.length-1].length),match:$}}}}var S,R;String.prototype.normalize?(S=function(w){return w.normalize("NFD").toLowerCase()},R=function(w){return w.normalize("NFD")}):(S=function(w){return w.toLowerCase()},R=function(w){return w});function A(w,M,N,z){if(w.length==M.length)return N;for(var X=0,q=N+Math.max(0,w.length-M.length);;){if(X==q)return X;var p=X+q>>1,W=z(w.slice(0,p)).length;if(W==N)return p;W>N?q=p:X=p+1}}function V(w,M,N,z){if(!M.length)return null;var X=z?S:R,q=X(M).split(/\r|\n\r?/);e:for(var p=N.line,W=N.ch,J=w.lastLine()+1-q.length;p<=J;p++,W=0){var P=w.getLine(p).slice(W),$=X(P);if(q.length==1){var F=$.indexOf(q[0]);if(F==-1)continue e;var N=A(P,$,F,X)+W;return{from:pe(p,A(P,$,F,X)+W),to:pe(p,A(P,$,F+q[0].length,X)+W)}}else{var G=$.length-q[0].length;if($.slice(G)!=q[0])continue e;for(var c=1;c<q.length-1;c++)if(X(w.getLine(p+c))!=q[c])continue e;var T=w.getLine(p+q.length-1),C=X(T),g=q[q.length-1];if(C.slice(0,g.length)!=g)continue e;return{from:pe(p,A(P,$,G,X)+W),to:pe(p+q.length-1,A(T,C,g.length,X))}}}}function ue(w,M,N,z){if(!M.length)return null;var X=z?S:R,q=X(M).split(/\r|\n\r?/);e:for(var p=N.line,W=N.ch,J=w.firstLine()-1+q.length;p>=J;p--,W=-1){var P=w.getLine(p);W>-1&&(P=P.slice(0,W));var $=X(P);if(q.length==1){var F=$.lastIndexOf(q[0]);if(F==-1)continue e;return{from:pe(p,A(P,$,F,X)),to:pe(p,A(P,$,F+q[0].length,X))}}else{var G=q[q.length-1];if($.slice(0,G.length)!=G)continue e;for(var c=1,N=p-q.length+1;c<q.length-1;c++)if(X(w.getLine(N+c))!=q[c])continue e;var T=w.getLine(p+1-q.length),C=X(T);if(C.slice(C.length-q[0].length)!=q[0])continue e;return{from:pe(p+1-q.length,A(T,C,T.length-q[0].length,X)),to:pe(p,A(P,$,G.length,X))}}}}function O(w,M,N,z){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=w,N=N?w.clipPos(N):pe(0,0),this.pos={from:N,to:N};var X;typeof z=="object"?X=z.caseFold:(X=z,z=null),typeof M=="string"?(X==null&&(X=!1),this.matches=function(q,p){return(q?ue:V)(w,M,p,X)}):(M=te(M,"gm"),!z||z.multiline!==!1?this.matches=function(q,p){return(q?ne:k)(w,M,p)}:this.matches=function(q,p){return(q?Y:Q)(w,M,p)})}O.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(w){var M=this.doc.clipPos(w?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(M=pe(M.line,M.ch),w?(M.ch--,M.ch<0&&(M.line--,M.ch=(this.doc.getLine(M.line)||"").length)):(M.ch++,M.ch>(this.doc.getLine(M.line)||"").length&&(M.ch=0,M.line++)),b.cmpPos(M,this.doc.clipPos(M))!=0))return this.atOccurrence=!1;var N=this.matches(w,M);if(this.afterEmptyMatch=N&&b.cmpPos(N.from,N.to)==0,N)return this.pos=N,this.atOccurrence=!0,this.pos.match||!0;var z=pe(w?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:z,to:z},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(w,M){if(this.atOccurrence){var N=b.splitLines(w);this.doc.replaceRange(N,this.pos.from,this.pos.to,M),this.pos.to=pe(this.pos.from.line+N.length-1,N[N.length-1].length+(N.length==1?this.pos.from.ch:0))}}},b.defineExtension("getSearchCursor",function(w,M,N){return new O(this.doc,w,M,N)}),b.defineDocExtension("getSearchCursor",function(w,M,N){return new O(this,w,M,N)}),b.defineExtension("selectMatches",function(w,M){for(var N=[],z=this.getSearchCursor(w,this.getCursor("from"),M);z.findNext()&&!(b.cmpPos(z.to(),this.getCursor("to"))>0);)N.push({anchor:z.from(),head:z.to()});N.length&&this.setSelections(N,0)})})})()),Ha.exports}var qa={exports:{}},ja;function po(){return ja||(ja=1,(function(ct,xt){(function(b){b(mt())})(function(b){function pe(te,oe,Q){var k=te.getWrapperElement(),I;return I=k.appendChild(document.createElement("div")),Q?I.className="CodeMirror-dialog CodeMirror-dialog-bottom":I.className="CodeMirror-dialog CodeMirror-dialog-top",typeof oe=="string"?I.innerHTML=oe:I.appendChild(oe),b.addClass(k,"dialog-opened"),I}function _(te,oe){te.state.currentNotificationClos
|
|||
|
|
`:J=="r"?"\r":J=="t"?" ":J=="\\"?"\\":W})}function S(p){var W=p.match(/^\/(.*)\/([a-z]*)$/);if(W)try{p=new RegExp(W[1],W[2].indexOf("i")==-1?"":"i")}catch{}else p=ne(p);return(typeof p=="string"?p=="":p.test(""))&&(p=/x^/),p}function R(p,W,J){W.queryText=J,W.query=S(J),p.removeOverlay(W.overlay,oe(W.query)),W.overlay=pe(W.query,oe(W.query)),p.addOverlay(W.overlay),p.showMatchesOnScrollbar&&(W.annotate&&(W.annotate.clear(),W.annotate=null),W.annotate=p.showMatchesOnScrollbar(W.query,oe(W.query)))}function A(p,W,J,P){var $=te(p);if($.query)return V(p,W);var F=p.getSelection()||$.lastQuery;if(F instanceof RegExp&&F.source=="x^"&&(F=null),J&&p.openDialog){var G=null,c=function(T,C){b.e_stop(C),T&&(T!=$.queryText&&(R(p,$,T),$.posFrom=$.posTo=p.getCursor()),G&&(G.style.opacity=1),V(p,C.shiftKey,function(g,y){var j;y.line<3&&document.querySelector&&(j=p.display.wrapper.querySelector(".CodeMirror-dialog"))&&j.getBoundingClientRect().bottom-4>p.cursorCoords(y,"window").top&&((G=j).style.opacity=.4)}))};k(p,w(p),F,c,function(T,C){var g=b.keyName(T),y=p.getOption("extraKeys"),j=y&&y[g]||b.keyMap[p.getOption("keyMap")][g];j=="findNext"||j=="findPrev"||j=="findPersistentNext"||j=="findPersistentPrev"?(b.e_stop(T),R(p,te(p),C),p.execCommand(j)):(j=="find"||j=="findPersistent")&&(b.e_stop(T),c(C,T))}),P&&F&&(R(p,$,F),V(p,W))}else I(p,w(p),"Search for:",F,function(T){T&&!$.query&&p.operation(function(){R(p,$,T),$.posFrom=$.posTo=p.getCursor(),V(p,W)})})}function V(p,W,J){p.operation(function(){var P=te(p),$=Q(p,P.query,W?P.posFrom:P.posTo);!$.find(W)&&($=Q(p,P.query,W?b.Pos(p.lastLine()):b.Pos(p.firstLine(),0)),!$.find(W))||(p.setSelection($.from(),$.to()),p.scrollIntoView({from:$.from(),to:$.to()},20),P.posFrom=$.from(),P.posTo=$.to(),J&&J($.from(),$.to()))})}function ue(p){p.operation(function(){var W=te(p);W.lastQuery=W.query,W.query&&(W.query=W.queryText=null,p.removeOverlay(W.overlay),W.annotate&&(W.annotate.clear(),W.annotate=null))})}function O(p,W){var J=p?document.createElement(p):document.createDocumentFragment();for(var P in W)J[P]=W[P];for(var $=2;$<arguments.length;$++){var F=arguments[$];J.appendChild(typeof F=="string"?document.createTextNode(F):F)}return J}function w(p){var W=O("label",{className:"CodeMirror-search-label"},p.phrase("Search:"),O("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));return W.setAttribute("for","CodeMirror-search-field"),O("",null,W," ",O("span",{style:"color: #666",className:"CodeMirror-search-hint"},p.phrase("(Use /re/ syntax for regexp search)")))}function M(p){return O("",null," ",O("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",O("span",{style:"color: #666",className:"CodeMirror-search-hint"},p.phrase("(Use /re/ syntax for regexp search)")))}function N(p){return O("",null,O("span",{className:"CodeMirror-search-label"},p.phrase("With:"))," ",O("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}function z(p){return O("",null,O("span",{className:"CodeMirror-search-label"},p.phrase("Replace?"))," ",O("button",{},p.phrase("Yes"))," ",O("button",{},p.phrase("No"))," ",O("button",{},p.phrase("All"))," ",O("button",{},p.phrase("Stop")))}function X(p,W,J){p.operation(function(){for(var P=Q(p,W);P.findNext();)if(typeof W!="string"){var $=p.getRange(P.from(),P.to()).match(W);P.replace(J.replace(/\$(\d)/g,function(F,G){return $[G]}))}else P.replace(J)})}function q(p,W){if(!p.getOption("readOnly")){var J=p.getSelection()||te(p).lastQuery,P=W?p.phrase("Replace all:"):p.phrase("Replace:"),$=O("",null,O("span",{className:"CodeMirror-search-label"},P),M(p));I(p,$,P,J,function(F){F&&(F=S(F),I(p,N(p),p.phrase("Replace with:"),"",function(G){if(G=ne(G),W)X(p,F,G);else{ue(p);var c=Q(p,F,p.getCursor("from")),T=function(){var g=c.from(),y;!(y=c.findNext())&&(c=Q(p,F),!(y=c.findNext())||g&&c.from().line==g.line&&c.from().ch==g.ch)||(p.setSelection(c.from(),c.to()),p.scrollIntoView({from:c.from(),to:c.to()}),Y(p,z(p),p.phrase("Replace?"),[function(){C(y)},T,function(){X(p,F,G)}]))},C=functio
|