1||s[0]||kI(k,c)){gT(f.doc,s,k,c,"+input");return true}},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){if(!this.composing){return}this.composing=null;if(!this.pollContent()){np(this.cm)}this.div.blur();this.div.focus()},readFromDOMSoon:function(){var a=this;if(this.readDOMTimeout!=null){return}this.readDOMTimeout=setTimeout(function(){a.readDOMTimeout=null;if(a.composing){return}if(a.cm.isReadOnly()||!a.pollContent()){lI(a.cm,function(){return np(a.cm)})}},80)},setUneditable:function(a){a.contentEditable="false"},onKeyPress:function(a){a.preventDefault();if(!this.cm.isReadOnly()){mQ(this.cm,g4)(this.cm,String.fromCharCode(a.charCode==null?a.keyCode:a.charCode),0)}},readOnlyChanged:function(a){this.div.contentEditable=String(a!="nocursor")},onContextMenu:g8,resetPosition:g8,needsContentAttribute:true},k7.prototype);function mq(d,f){var e=hp(d,f.line);if(!e||e.hidden){return null}var b=hm(d.doc,f.line);var j=jT(e,b,f.line);var h=ld(b),g="left";if(h){var a=n6(h,f.ch);g=a%2?"right":"left"}var c=n3(j.map,f.ch,g);c.offset=c.collapse=="right"?c.end:c.start;return c}function jH(b,a){if(a){b.bad=true}return b}function g3(c,e,d,h,k){var a="",j=false,b=c.doc.lineSeparator();function g(l){return function(m){return m.id==l}}function f(o){if(o.nodeType==1){var r=o.getAttribute("cm-text");if(r!=null){if(r==""){a+=o.textContent.replace(/\u200b/g,"")}else{a+=r}return}var p=o.getAttribute("cm-marker"),l;if(p){var n=c.findMarks(lA(h,0),lA(k+1,0),g(+p));if(n.length&&(l=n[0].find())){a+=gY(c.doc,l.from,l.to).join(b)}return}if(o.getAttribute("contenteditable")=="false"){return}for(var q=0;q=9&&a.hasSelection){a.hasSelection=null}g.poll()});nY(d,"paste",function(h){if(nT(e,h)||mz(h,e)){return}e.state.pasteIncoming=true;g.fastPoll()});function c(j){if(nT(e,j)){return}if(e.somethingSelected()){jJ({lineWise:false,text:e.getSelections()});if(g.inaccurateSelection){g.prevInput="";g.inaccurateSelection=false;d.value=lZ.text.join("\n");kf(d)}}else{if(!e.options.lineWiseCopyCut){return}else{var h=jf(e);jJ({lineWise:true,text:h.text});if(j.type=="cut"){e.setSelections(h.ranges,null,ln)}else{g.prevInput="";d.value=h.text.join("\n");kf(d)}}}if(j.type=="cut"){e.state.cutIncoming=true}}nY(d,"cut",c);nY(d,"copy",c);nY(f.scroller,"paste",function(h){if(my(f,h)||nT(e,h)){return}e.state.pasteIncoming=true;g.focus()});nY(f.lineSpace,"selectstart",function(h){if(!my(f,h)){l7(h)}});nY(d,"compositionstart",function(){var h=e.getCursor("from");if(g.composing){g.composing.range.clear()}g.composing={start:h,range:e.markText(h,e.getCursor("to"),{className:"CodeMirror-composing"})}});nY(d,"compositionend",function(){if(g.composing){g.poll();g.composing.range.clear();g.composing=null}})},prepareSelection:function(){var g=this.cm,b=g.display,c=g.doc;var e=i9(g);if(g.options.moveInputWithCursor){var a=lL(g,c.sel.primary().head,"div");var f=b.wrapper.getBoundingClientRect(),d=b.lineDiv.getBoundingClientRect();e.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+d.top-f.top));e.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+d.left-f.left))}return e},showSelection:function(b){var a=this.cm,c=a.display;mR(c.cursorDiv,b.cursors);mR(c.selectionDiv,b.selection);if(b.teTop!=null){this.wrapper.style.top=b.teTop+"px";this.wrapper.style.left=b.teLeft+"px"}},reset:function(e){if(this.contextMenuPending){return}var g,f,d=this.cm,b=d.doc;if(d.somethingSelected()){this.prevInput="";var a=b.sel.primary();g=jz&&(a.to().line-a.from().line>100||(f=d.getSelection()).length>1000);var c=g?"-":f||d.getSelection();this.textarea.value=c;if(d.state.focused){kf(this.textarea)}if(kj&&kH>=9){this.hasSelection=c}}else{if(!e){this.prevInput=this.textarea.value="";if(kj&&kH>=9){this.hasSelection=null}}}this.inaccurateSelection=g},getField:function(){return this.textarea},supportsTouch:function(){return false},focus:function(){if(this.cm.options.readOnly!="nocursor"&&(!ie||j3()!=this.textarea)){try{this.textarea.focus()}catch(a){}}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var a=this;if(this.pollingFast){return}this.polling.set(this.cm.options.pollInterval,function(){a.poll();if(a.cm.state.focused){a.slowPoll()}})},fastPoll:function(){var c=false,a=this;a.pollingFast=true;function b(){var d=a.poll();if(!d&&!c){c=true;a.polling.set(60,b)}else{a.pollingFast=false;a.slowPoll()}}a.polling.set(20,b)},poll:function(){var a=this;var f=this.cm,g=this.textarea,e=this.prevInput;if(this.contextMenuPending||!f.state.focused||(lv(g)&&!e&&!this.composing)||f.isReadOnly()||f.options.disableInput||f.state.keySeq){return false}var c=g.value;if(c==e&&!f.somethingSelected()){return false}if(kj&&kH>=9&&this.hasSelection===c||k9&&/[\uf700-\uf7ff]/.test(c)){f.display.input.reset();return false}if(f.doc.sel==f.display.selForContextMenu){var d=c.charCodeAt(0);if(d==8203&&!e){e="\u200b"}if(d==8666){this.reset();return this.cm.execCommand("undo")}}var b=0,h=Math.min(e.length,c.length);while(b1000||c.indexOf("\n")>-1){g.value=a.prevInput=""}else{a.prevInput=c}if(a.composing){a.composing.range.clear();a.composing.range=f.markText(a.composing.start,f.getCursor("to"),{className:"CodeMirror-composing"})}});return true},ensurePolled:function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}},onKeyPress:function(){if(kj&&kH>=9){this.hasSelection=null}this.fastPoll()},onContextMenu:function(l){var e=this,d=e.cm,j=d.display,p=e.textarea;var f=kg(d,l),g=j.scroller.scrollTop;if(!f||iL){return}var m=d.options.resetSelectionOnContextMenu;if(m&&d.doc.sel.contains(f)==-1){mQ(d,mL)(d.doc,j1(f),ln)}var k=p.style.cssText,a=e.wrapper.style.cssText;e.wrapper.style.cssText="position: absolute";var b=e.wrapper.getBoundingClientRect();p.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(l.clientY-b.top-5)+"px; left: "+(l.clientX-b.left-5)+"px;\n z-index: 1000; background: "+(kj?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var c;if(mU){c=window.scrollY}j.input.focus();if(mU){window.scrollTo(null,c)}j.input.reset();if(!d.somethingSelected()){p.value=e.prevInput=" "}e.contextMenuPending=true;j.selForContextMenu=d.doc.sel;clearTimeout(j.detectingSelectAll);function n(){if(p.selectionStart!=null){var r=d.somethingSelected();var q="\u200b"+(r?p.value:"");p.value="\u21da";p.value=q;e.prevInput=r?"":"\u200b";p.selectionStart=1;p.selectionEnd=q.length;j.selForContextMenu=d.doc.sel}}function h(){e.contextMenuPending=false;e.wrapper.style.cssText=a;p.style.cssText=k;if(kj&&kH<9){j.scrollbars.setScrollTop(j.scroller.scrollTop=g)}if(p.selectionStart!=null){if(!kj||(kj&&kH<9)){n()}var r=0,q=function(){if(j.selForContextMenu==d.doc.sel&&p.selectionStart==0&&p.selectionEnd>0&&e.prevInput=="\u200b"){mQ(d,nh)(d)}else{if(r++<10){j.detectingSelectAll=setTimeout(q,500)}else{j.input.reset()}}};j.detectingSelectAll=setTimeout(q,200)}}if(kj&&kH>=9){n()}if(hT){jK(l);var o=function(){ih(window,"mouseup",o);setTimeout(h,20)};nY(window,"mouseup",o)}else{setTimeout(h,50)}},readOnlyChanged:function(a){if(!a){this.reset()}},setUneditable:g8,needsContentAttribute:false},lt.prototype);function je(c,b){b=b?n0(b):{};b.value=c.value;if(!b.tabindex&&c.tabIndex){b.tabindex=c.tabIndex}if(!b.placeholder&&c.placeholder){b.placeholder=c.placeholder}if(b.autofocus==null){var a=j3();b.autofocus=a==c||c.getAttribute("autofocus")!=null&&a==document.body}function f(){c.value=d.getValue()}var e;if(c.form){nY(c.form,"submit",f);if(!b.leaveSubmitMethodAlone){var j=c.form;e=j.submit;try{var g=j.submit=function(){f();j.submit=e;j.submit();j.submit=g}}catch(h){}}}b.finishInit=function(k){k.save=f;k.getTextArea=function(){return c};k.toTextArea=function(){k.toTextArea=isNaN;f();c.parentNode.removeChild(k.getWrapperElement());c.style.display="";if(c.form){ih(c.form,"submit",f);if(typeof c.form.submit=="function"){c.form.submit=e}}}};c.style.display="none";var d=hx(function(k){return c.parentNode.insertBefore(k,c.nextSibling)},b);return d}function iZ(a){a.off=ih;a.on=nY;a.wheelEventPixels=mF;a.Doc=mT;a.splitLines=hd;a.countColumn=mV;a.findColumn=jM;a.isWordChar=h0;a.Pass=kU;a.signal=n9;a.Line=gW;a.changeEnd=m1;a.scrollbarModel=lX;a.Pos=lA;a.cmpPos=kI;a.modes=le;a.mimeModes=nQ;a.resolveMode=hP;a.getMode=h8;a.modeExtensions=iV;a.extendMode=jc;a.copyState=nK;a.startState=nR;a.innerMode=hX;a.commands=jg;a.keyMap=hq;a.keyName=iw;a.isModifierKey=jm;a.lookupKey=kN;a.normalizeKeyMap=l2;a.StringStream=hU;a.SharedTextMarker=jZ;a.TextMarker=lV;a.LineWidget=kO;a.e_preventDefault=l7;a.e_stopPropagation=iT;a.e_stop=jK;a.addClass=h6;a.contains=hR;a.rmClass=kS;a.keyNames=iQ}i0(hx);jX(hx);var k4="iter insert remove copy getEditor constructor".split(" ");for(var nd in mT.prototype){if(mT.prototype.hasOwnProperty(nd)&&jb(k4,nd)<0){hx.prototype[nd]=(function(a){return function(){return a.apply(this.doc,arguments)}})(mT.prototype[nd])}}nA(mT);hx.inputStyles={textarea:lt,contenteditable:k7};hx.defineMode=function(a){if(!hx.defaults.mode&&a!="null"){hx.defaults.mode=a}jE.apply(this,arguments)};hx.defineMIME=lT;hx.defineMode("null",function(){return({token:function(a){return a.skipToEnd()}})});hx.defineMIME("text/plain","null");hx.defineExtension=function(a,b){hx.prototype[a]=b};hx.defineDocExtension=function(a,b){mT.prototype[a]=b};hx.fromTextArea=je;iZ(hx);hx.version="5.21.0";return hx})));