%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /data/old/home/stash/atlassian-stash/static/bower/CodeMirror/lib/
Upload File :
Create Path :
Current File : //data/old/home/stash/atlassian-stash/static/bower/CodeMirror/lib/codemirror-min.js

window.CodeMirror=(function(){var Bi=/gecko\/\d/i.test(navigator.userAgent);var CF=/MSIE \d/.test(navigator.userAgent);var Bf=CF&&(document.documentMode==null||document.documentMode<8);var Be=CF&&(document.documentMode==null||document.documentMode<9);var CW=CF&&(document.documentMode==null||document.documentMode<10);var Dd=/Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent);var Cb=CF||Dd;var B8=/WebKit\//.test(navigator.userAgent);var Ce=B8&&/Qt\/\d+\.\d+/.test(navigator.userAgent);var CG=/Chrome\//.test(navigator.userAgent);var D2=/Opera\//.test(navigator.userAgent);var AH=/Apple Computer/.test(navigator.vendor);var Ag=/KHTML\//.test(navigator.userAgent);var Bt=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent);var CC=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);var Dz=/PhantomJS/.test(navigator.userAgent);var DY=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent);var Cw=DY||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);var BQ=DY||/Mac/.test(navigator.platform);var AP=/win/i.test(navigator.platform);var C9=D2&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);if(C9){C9=Number(C9[1])}if(C9&&C9>=15){D2=false;B8=true}var BE=BQ&&(Ce||D2&&(C9==null||C9<12.11));var Bx=Bi||(Cb&&!Be);var ER=false,Ac=false;function c(EX,EY){if(!(this instanceof c)){return new c(EX,EY)}this.options=EY=EY||{};for(var EZ in Da){if(!EY.hasOwnProperty(EZ)&&Da.hasOwnProperty(EZ)){EY[EZ]=Da[EZ]}}BY(EY);var Ed=typeof EY.value=="string"?0:EY.value.first;var Ec=this.display=F(EX,Ed);Ec.wrapper.CodeMirror=this;Cs(this);if(EY.autofocus&&!Cw){DC(this)}this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,focused:false,suppressEdits:false,pasteIncoming:false,cutIncoming:false,draggingText:false,highlight:new EW()};B2(this);if(EY.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}var Eb=EY.value;if(typeof Eb=="string"){Eb=new AB(EY.value,EY.mode)}B9(this,Cr)(this,Eb);if(CF){setTimeout(Bo(Dv,this,true),20)}EF(this);var Ee;try{Ee=(document.activeElement==Ec.input)}catch(Ea){}if(Ee||(EY.autofocus&&!Cw)){setTimeout(Bo(Bs,this),20)}else{AU(this)}B9(this,function(){for(var Eg in Aj){if(Aj.propertyIsEnumerable(Eg)){Aj[Eg](this,EY[Eg],BW)}}for(var Ef=0;Ef<Ad.length;++Ef){Ad[Ef](this)}})()}function F(EX,EZ){var Ea={};var EY=Ea.input=EK("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");if(B8){EY.style.width="1000px"}else{EY.setAttribute("wrap","off")}if(DY){EY.style.border="1px solid black"}EY.setAttribute("autocorrect","off");EY.setAttribute("autocapitalize","off");EY.setAttribute("spellcheck","false");Ea.inputDiv=EK("div",[EY],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");Ea.scrollbarH=EK("div",[EK("div",null,null,"height: 1px")],"CodeMirror-hscrollbar");Ea.scrollbarV=EK("div",[EK("div",null,null,"width: 1px")],"CodeMirror-vscrollbar");Ea.scrollbarFiller=EK("div",null,"CodeMirror-scrollbar-filler");Ea.gutterFiller=EK("div",null,"CodeMirror-gutter-filler");Ea.lineDiv=EK("div",null,"CodeMirror-code");Ea.selectionDiv=EK("div",null,null,"position: relative; z-index: 1");Ea.cursor=EK("div","\u00a0","CodeMirror-cursor");Ea.otherCursor=EK("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor");Ea.measure=EK("div",null,"CodeMirror-measure");Ea.lineSpace=EK("div",[Ea.measure,Ea.selectionDiv,Ea.lineDiv,Ea.cursor,Ea.otherCursor],null,"position: relative; outline: none");Ea.mover=EK("div",[EK("div",[Ea.lineSpace],"CodeMirror-lines")],null,"position: relative");Ea.sizer=EK("div",[Ea.mover],"CodeMirror-sizer");Ea.heightForcer=EK("div",null,null,"position: absolute; height: "+Ao+"px; width: 1px;");Ea.gutters=EK("div",null,"CodeMirror-gutters");Ea.lineGutter=null;Ea.scroller=EK("div",[Ea.sizer,Ea.heightForcer,Ea.gutters],"CodeMirror-scroll");Ea.scroller.setAttribute("tabIndex","-1");Ea.wrapper=EK("div",[Ea.inputDiv,Ea.scrollbarH,Ea.scrollbarV,Ea.scrollbarFiller,Ea.gutterFiller,Ea.scroller],"CodeMirror");if(Bf){Ea.gutters.style.zIndex=-1;Ea.scroller.style.paddingRight=0}if(EX.appendChild){EX.appendChild(Ea.wrapper)}else{EX(Ea.wrapper)}if(DY){EY.style.width="0px"}if(!B8){Ea.scroller.draggable=true}if(Ag){Ea.inputDiv.style.height="1px";Ea.inputDiv.style.position="absolute"}else{if(Bf){Ea.scrollbarH.style.minWidth=Ea.scrollbarV.style.minWidth="18px"}}Ea.viewOffset=Ea.lastSizeC=0;Ea.showingFrom=Ea.showingTo=EZ;Ea.lineNumWidth=Ea.lineNumInnerWidth=Ea.lineNumChars=null;Ea.prevInput="";Ea.alignWidgets=false;Ea.pollingFast=false;Ea.poll=new EW();Ea.cachedCharWidth=Ea.cachedTextHeight=Ea.cachedPaddingH=null;Ea.measureLineCache=[];Ea.measureLineCachePos=0;Ea.inaccurateSelection=false;Ea.maxLine=null;Ea.maxLineLength=0;Ea.maxLineChanged=false;Ea.wheelDX=Ea.wheelDY=Ea.wheelStartX=Ea.wheelStartY=null;return Ea}function Aw(EX){EX.doc.mode=c.getMode(EX.options,EX.doc.modeOption);C0(EX)}function C0(EX){EX.doc.iter(function(EY){if(EY.stateAfter){EY.stateAfter=null}if(EY.styles){EY.styles=null}});EX.doc.frontier=EX.doc.first;Cv(EX,100);EX.state.modeGen++;if(EX.curOp){r(EX)}}function DK(EX){if(EX.options.lineWrapping){EX.display.wrapper.className+=" CodeMirror-wrap";EX.display.sizer.style.minWidth=""}else{EX.display.wrapper.className=EX.display.wrapper.className.replace(" CodeMirror-wrap","");EN(EX)}m(EX);r(EX);u(EX);setTimeout(function(){DW(EX)},100)}function Ai(EX){var EZ=AV(EX.display),EY=EX.options.lineWrapping;var Ea=EY&&Math.max(5,EX.display.scroller.clientWidth/CZ(EX.display)-3);return function(Ec){if(D0(EX.doc,Ec)){return 0}var Eb=0;if(Ec.widgets){for(var Ed=0;Ed<Ec.widgets.length;Ed++){if(Ec.widgets[Ed].height){Eb+=Ec.widgets[Ed].height}}}if(EY){return Eb+(Math.ceil(Ec.text.length/Ea)||1)*EZ}else{return Eb+EZ}}}function m(EX){var EZ=EX.doc,EY=Ai(EX);EZ.iter(function(Ea){var Eb=EY(Ea);if(Eb!=Ea.height){EP(Ea,Eb)}})}function EU(EX){var EZ=Dg[EX.options.keyMap],EY=EZ.style;EX.display.wrapper.className=EX.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(EY?" cm-keymap-"+EY:"")}function B2(EX){EX.display.wrapper.className=EX.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+EX.options.theme.replace(/(^|\s)\s*/g," cm-s-");u(EX)}function CT(EX){Cs(EX);r(EX);setTimeout(function(){DG(EX)},20)}function Cs(EX){var EY=EX.display.gutters,Ec=EX.options.gutters;Cl(EY);for(var EZ=0;EZ<Ec.length;++EZ){var Ea=Ec[EZ];var Eb=EY.appendChild(EK("div",null,"CodeMirror-gutter "+Ea));if(Ea=="CodeMirror-linenumbers"){EX.display.lineGutter=Eb;Eb.style.width=(EX.display.lineNumWidth||1)+"px"}}EY.style.display=EZ?"":"none"}function C1(Eb,EZ){if(EZ.height==0){return 0}var EY=EZ.text.length,EX,Ec=EZ;while(EX=DO(Ec)){var Ea=EX.find();Ec=Dk(Eb,Ea.from.line);EY+=Ea.from.ch-Ea.to.ch}Ec=EZ;while(EX=C6(Ec)){var Ea=EX.find();EY-=Ec.text.length-Ea.from.ch;Ec=Dk(Eb,Ea.to.line);EY+=Ec.text.length-Ea.to.ch}return EY}function EN(EX){var EZ=EX.display,EY=EX.doc;EZ.maxLine=Dk(EY,EY.first);EZ.maxLineLength=C1(EY,EZ.maxLine);EZ.maxLineChanged=true;EY.iter(function(Eb){var Ea=C1(EY,Eb);if(Ea>EZ.maxLineLength){EZ.maxLineLength=Ea;EZ.maxLine=Eb}})}function BY(EX){var EY=CL(EX.gutters,"CodeMirror-linenumbers");if(EY==-1&&EX.lineNumbers){EX.gutters=EX.gutters.concat(["CodeMirror-linenumbers"])}else{if(EY>-1&&!EX.lineNumbers){EX.gutters=EX.gutters.slice(0);EX.gutters.splice(EY,1)}}}function DW(EX){var Ed=EX.display,EY=EX.doc.height;var Ea=EY+A7(Ed);Ed.sizer.style.minHeight=Ed.heightForcer.style.top=Ea+"px";Ed.gutters.style.height=Math.max(Ea,Ed.scroller.clientHeight-Ao)+"px";var Eb=Math.max(Ea,Ed.scroller.scrollHeight);var Ec=Ed.scroller.scrollWidth>(Ed.scroller.clientWidth+1);var EZ=Eb>(Ed.scroller.clientHeight+1);if(EZ){Ed.scrollbarV.style.display="block";Ed.scrollbarV.style.bottom=Ec?I(Ed.measure)+"px":"0";Ed.scrollbarV.firstChild.style.height=Math.max(0,Eb-Ed.scroller.clientHeight+Ed.scrollbarV.clientHeight)+"px"}else{Ed.scrollbarV.style.display="";Ed.scrollbarV.firstChild.style.height="0"}if(Ec){Ed.scrollbarH.style.display="block";Ed.scrollbarH.style.right=EZ?I(Ed.measure)+"px":"0";Ed.scrollbarH.firstChild.style.width=(Ed.scroller.scrollWidth-Ed.scroller.clientWidth+Ed.scrollbarH.clientWidth)+"px"}else{Ed.scrollbarH.style.display="";Ed.scrollbarH.firstChild.style.width="0"}if(Ec&&EZ){Ed.scrollbarFiller.style.display="block";Ed.scrollbarFiller.style.height=Ed.scrollbarFiller.style.width=I(Ed.measure)+"px"}else{Ed.scrollbarFiller.style.display=""}if(Ec&&EX.options.coverGutterNextToScrollbar&&EX.options.fixedGutter){Ed.gutterFiller.style.display="block";Ed.gutterFiller.style.height=I(Ed.measure)+"px";Ed.gutterFiller.style.width=Ed.gutters.offsetWidth+"px"}else{Ed.gutterFiller.style.display=""}if(Bt&&I(Ed.measure)===0){Ed.scrollbarV.style.minWidth=Ed.scrollbarH.style.minHeight=CC?"18px":"12px";Ed.scrollbarV.style.pointerEvents=Ed.scrollbarH.style.pointerEvents="none"}}function BP(Ec,Eb,Ea){var EZ=Ec.scroller.scrollTop,EX=Ec.wrapper.clientHeight;if(typeof Ea=="number"){EZ=Ea}else{if(Ea){EZ=Ea.top;EX=Ea.bottom-Ea.top}}EZ=Math.floor(EZ-De(Ec));var EY=Math.ceil(EZ+EX);return{from:A5(Eb,EZ),to:A5(Eb,EY)}}function DG(EX){var Ed=EX.display;if(!Ed.alignWidgets&&(!Ed.gutters.firstChild||!EX.options.fixedGutter)){return }var Ea=Ck(Ed)-Ed.scroller.scrollLeft+EX.doc.scrollLeft;var Ec=Ed.gutters.offsetWidth,EZ=Ea+"px";for(var Ee=Ed.lineDiv.firstChild;Ee;Ee=Ee.nextSibling){if(Ee.alignable){for(var Eb=0,EY=Ee.alignable;Eb<EY.length;++Eb){EY[Eb].style.left=EZ}}}if(EX.options.fixedGutter){Ed.gutters.style.left=(Ea+Ec)+"px"}}function Cn(EX){if(!EX.options.lineNumbers){return false}var Ec=EX.doc,EY=C4(EX.options,Ec.first+Ec.size-1),Eb=EX.display;if(EY.length!=Eb.lineNumChars){var Ed=Eb.measure.appendChild(EK("div",[EK("div",EY)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var EZ=Ed.firstChild.offsetWidth,Ea=Ed.offsetWidth-EZ;Eb.lineGutter.style.width="";Eb.lineNumInnerWidth=Math.max(EZ,Eb.lineGutter.offsetWidth-Ea);Eb.lineNumWidth=Eb.lineNumInnerWidth+Ea;Eb.lineNumChars=Eb.lineNumInnerWidth?EY.length:-1;Eb.lineGutter.style.width=Eb.lineNumWidth+"px";return true}return false}function C4(EX,EY){return String(EX.lineNumberFormatter(EY+EX.firstLineNumber))}function Ck(EX){return AO(EX.scroller).left-AO(EX.sizer).left}function Cc(Ec,Eb,Ef,Eg){var Ee=Ec.display.showingFrom,Ed=Ec.display.showingTo,Ea;var EX=BP(Ec.display,Ec.doc,Ef);for(var EZ=true;;EZ=false){var EY=Ec.display.scroller.clientWidth;if(!CJ(Ec,Eb,EX,Eg)){break}Ea=true;Eb=[];A2(Ec);DW(Ec);if(EZ&&Ec.options.lineWrapping&&EY!=Ec.display.scroller.clientWidth){Eg=true;continue}Eg=false;if(Ef){Ef=Math.min(Ec.display.scroller.scrollHeight-Ec.display.scroller.clientHeight,typeof Ef=="number"?Ef:Ef.top)}EX=BP(Ec.display,Ec.doc,Ef);if(EX.from>=Ec.display.showingFrom&&EX.to<=Ec.display.showingTo){break}}if(Ea){p(Ec,"update",Ec);if(Ec.display.showingFrom!=Ee||Ec.display.showingTo!=Ed){p(Ec,"viewportChange",Ec,Ec.display.showingFrom,Ec.display.showingTo)}}return Ea}function CJ(Eb,Ep,EY,En){var Eh=Eb.display,Eq=Eb.doc;if(!Eh.wrapper.offsetWidth){Eh.showingFrom=Eh.showingTo=Eq.first;Eh.viewOffset=0;return }if(!En&&Ep.length==0&&EY.from>Eh.showingFrom&&EY.to<Eh.showingTo){return }if(Cn(Eb)){Ep=[{from:Eq.first,to:Eq.first+Eq.size}]}var Em=Eh.sizer.style.marginLeft=Eh.gutters.offsetWidth+"px";Eh.scrollbarH.style.left=Eb.options.fixedGutter?Em:"0";var EZ=Infinity;if(Eb.options.lineNumbers){for(var Ei=0;Ei<Ep.length;++Ei){if(Ep[Ei].diff&&Ep[Ei].from<EZ){EZ=Ep[Ei].from}}}var Ea=Eq.first+Eq.size;var Eg=Math.max(EY.from-Eb.options.viewportMargin,Eq.first);var EX=Math.min(Ea,EY.to+Eb.options.viewportMargin);if(Eh.showingFrom<Eg&&Eg-Eh.showingFrom<20){Eg=Math.max(Eq.first,Eh.showingFrom)}if(Eh.showingTo>EX&&Eh.showingTo-EX<20){EX=Math.min(Ea,Eh.showingTo)}if(Ac){Eg=BC(V(Eq,Dk(Eq,Eg)));while(EX<Ea&&D0(Eq,Dk(Eq,EX))){++EX}}var Ek=[{from:Math.max(Eh.showingFrom,Eq.first),to:Math.min(Eh.showingTo,Ea)}];if(Ek[0].from>=Ek[0].to){Ek=[]}else{Ek=Du(Ek,Ep)}if(Ac){for(var Ei=0;Ei<Ek.length;++Ei){var Ed=Ek[Ei],El;while(El=C6(Dk(Eq,Ed.to-1))){var Eo=El.find().from.line;if(Eo>Ed.from){Ed.to=Eo}else{Ek.splice(Ei--,1);break}}}}var Ef=0;for(var Ei=0;Ei<Ek.length;++Ei){var Ed=Ek[Ei];if(Ed.from<Eg){Ed.from=Eg}if(Ed.to>EX){Ed.to=EX}if(Ed.from>=Ed.to){Ek.splice(Ei--,1)}else{Ef+=Ed.to-Ed.from}}if(!En&&Ef==EX-Eg&&Eg==Eh.showingFrom&&EX==Eh.showingTo){H(Eb);return }Ek.sort(function(Es,Er){return Es.from-Er.from});try{var Ec=document.activeElement}catch(Ej){}if(Ef<(EX-Eg)*0.7){Eh.lineDiv.style.display="none"}Bg(Eb,Eg,EX,Ek,EZ);Eh.lineDiv.style.display="";if(Ec&&document.activeElement!=Ec&&Ec.offsetHeight){Ec.focus()}var Ee=Eg!=Eh.showingFrom||EX!=Eh.showingTo||Eh.lastSizeC!=Eh.wrapper.clientHeight;if(Ee){Eh.lastSizeC=Eh.wrapper.clientHeight;Cv(Eb,400)}Eh.showingFrom=Eg;Eh.showingTo=EX;Eh.gutters.style.height="";Ae(Eb);H(Eb);return true}function Ae(Ef){var Ec=Ef.display;var EY=Ec.lineDiv.offsetTop;for(var EX=Ec.lineDiv.firstChild,Eg;EX;EX=EX.nextSibling){if(EX.lineObj){if(Bf){var Eb=EX.offsetTop+EX.offsetHeight;Eg=Eb-EY;EY=Eb}else{var Ea=AO(EX);Eg=Ea.bottom-Ea.top}var Ee=EX.lineObj.height-Eg;if(Eg<2){Eg=AV(Ec)}if(Ee>0.001||Ee<-0.001){EP(EX.lineObj,Eg);var Ed=EX.lineObj.widgets;if(Ed){for(var EZ=0;EZ<Ed.length;++EZ){Ed[EZ].height=Ed[EZ].node.offsetHeight}}}}}}function H(EX){var EY=EX.display.viewOffset=BB(EX,Dk(EX.doc,EX.display.showingFrom));EX.display.mover.style.top=EY+"px"}function Du(Eg,Ee){for(var Eb=0,EZ=Ee.length||0;Eb<EZ;++Eb){var Ed=Ee[Eb],EX=[],Ef=Ed.diff||0;for(var Ea=0,EY=Eg.length;Ea<EY;++Ea){var Ec=Eg[Ea];if(Ed.to<=Ec.from&&Ed.diff){EX.push({from:Ec.from+Ef,to:Ec.to+Ef})}else{if(Ed.to<=Ec.from||Ed.from>=Ec.to){EX.push(Ec)}else{if(Ed.from>Ec.from){EX.push({from:Ec.from,to:Ed.from})}if(Ed.to<Ec.to){EX.push({from:Ed.to+Ef,to:Ec.to+Ef})}}}}Eg=EX}return Eg}function Dh(EX){var Eb=EX.display,Ea={},EZ={};for(var Ec=Eb.gutters.firstChild,EY=0;Ec;Ec=Ec.nextSibling,++EY){Ea[EX.options.gutters[EY]]=Ec.offsetLeft;EZ[EX.options.gutters[EY]]=Ec.offsetWidth}return{fixedPos:Ck(Eb),gutterTotalWidth:Eb.gutters.offsetWidth,gutterLeft:Ea,gutterWidth:EZ,wrapperWidth:Eb.wrapper.clientWidth}}function Bg(Eg,Ed,Ee,Ej,EY){var Ef=Dh(Eg);var Ec=Eg.display,Ei=Eg.options.lineNumbers;if(!Ej.length&&(!B8||!Eg.display.currentWheelTarget)){Cl(Ec.lineDiv)}var EX=Ec.lineDiv,Eh=EX.firstChild;function Eb(El){var Ek=El.nextSibling;if(B8&&BQ&&Eg.display.currentWheelTarget==El){El.style.display="none";El.lineObj=null}else{El.parentNode.removeChild(El)}return Ek}var EZ=Ej.shift(),Ea=Ed;Eg.doc.iter(Ed,Ee,function(Et){if(EZ&&EZ.to==Ea){EZ=Ej.shift()}if(D0(Eg.doc,Et)){if(Et.height!=0){EP(Et,0)}if(Et.widgets&&Eh&&Eh.previousSibling){for(var Eo=0;Eo<Et.widgets.length;++Eo){var Eq=Et.widgets[Eo];if(Eq.showIfHidden){var Em=Eh.previousSibling;if(/pre/i.test(Em.nodeName)){var El=EK("div",null,null,"position: relative");Em.parentNode.replaceChild(El,Em);El.appendChild(Em);Em=El}var Er=Em.appendChild(EK("div",[Eq.node],"CodeMirror-linewidget"));if(!Eq.handleMouseEvents){Er.ignoreEvents=true}A4(Eq,Er,Em,Ef)}}}}else{if(EZ&&EZ.from<=Ea&&EZ.to>Ea){while(Eh.lineObj!=Et){Eh=Eb(Eh)}if(Ei&&EY<=Ea&&Eh.lineNumber){L(Eh.lineNumber,C4(Eg.options,Ea))}Eh=Eh.nextSibling}else{if(Et.widgets){for(var En=0,Es=Eh,Ep;Es&&En<20;++En,Es=Es.nextSibling){if(Es.lineObj==Et&&/div/i.test(Es.nodeName)){Ep=Es;break}}}var Ek=AJ(Eg,Et,Ea,Ef,Ep);if(Ek!=Ep){EX.insertBefore(Ek,Eh)}else{while(Eh!=Ep){Eh=Eb(Eh)}Eh=Eh.nextSibling}Ek.lineObj=Et}}++Ea});while(Eh){Eh=Eb(Eh)}}function AJ(Ee,Eg,Eh,Ek,EZ){var Ed=DQ(Ee,Eg),Eq=Ed.pre;var Et=Eg.gutterMarkers,Er=Ee.display,Ef;var EY=Ed.bgClass?Ed.bgClass+" "+(Eg.bgClass||""):Eg.bgClass;if(!Ee.options.lineNumbers&&!Et&&!EY&&!Eg.wrapClass&&!Eg.widgets){return Eq}if(EZ){EZ.alignable=null;var Eu=true,Ec=0,Ea=null;for(var Em=EZ.firstChild,El;Em;Em=El){El=Em.nextSibling;if(!/\bCodeMirror-linewidget\b/.test(Em.className)){EZ.removeChild(Em)}else{for(var Es=0;Es<Eg.widgets.length;++Es){var Eb=Eg.widgets[Es];if(Eb.node==Em.firstChild){if(!Eb.above&&!Ea){Ea=Em}A4(Eb,Em,EZ,Ek);++Ec;break}}if(Es==Eg.widgets.length){Eu=false;break}}}EZ.insertBefore(Eq,Ea);if(Eu&&Ec==Eg.widgets.length){Ef=EZ;EZ.className=Eg.wrapClass||""}}if(!Ef){Ef=EK("div",null,Eg.wrapClass,"position: relative");Ef.appendChild(Eq)}if(EY){Ef.insertBefore(EK("div",null,EY+" CodeMirror-linebackground"),Ef.firstChild)}if(Ee.options.lineNumbers||Et){var Eo=Ef.insertBefore(EK("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+(Ee.options.fixedGutter?Ek.fixedPos:-Ek.gutterTotalWidth)+"px"),Eq);if(Ee.options.fixedGutter){(Ef.alignable||(Ef.alignable=[])).push(Eo)}if(Ee.options.lineNumbers&&(!Et||!Et["CodeMirror-linenumbers"])){Ef.lineNumber=Eo.appendChild(EK("div",C4(Ee.options,Eh),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+Ek.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+Er.lineNumInnerWidth+"px"))}if(Et){for(var Ep=0;Ep<Ee.options.gutters.length;++Ep){var Ej=Ee.options.gutters[Ep],Ei=Et.hasOwnProperty(Ej)&&Et[Ej];if(Ei){Eo.appendChild(EK("div",[Ei],"CodeMirror-gutter-elt","left: "+Ek.gutterLeft[Ej]+"px; width: "+Ek.gutterWidth[Ej]+"px"))}}}}if(Bf){Ef.style.zIndex=2}if(Eg.widgets&&Ef!=EZ){for(var Es=0,EX=Eg.widgets;Es<EX.length;++Es){var Eb=EX[Es],En=EK("div",[Eb.node],"CodeMirror-linewidget");if(!Eb.handleMouseEvents){En.ignoreEvents=true}A4(Eb,En,Ef,Ek);if(Eb.above){Ef.insertBefore(En,Ee.options.lineNumbers&&Eg.height!=0?Eo:Eq)}else{Ef.appendChild(En)}p(Eb,"redraw")}}return Ef}function A4(Ea,EZ,EY,Eb){if(Ea.noHScroll){(EY.alignable||(EY.alignable=[])).push(EZ);var EX=Eb.wrapperWidth;EZ.style.left=Eb.fixedPos+"px";if(!Ea.coverGutter){EX-=Eb.gutterTotalWidth;EZ.style.paddingLeft=Eb.gutterTotalWidth+"px"}EZ.style.width=EX+"px"}if(Ea.coverGutter){EZ.style.zIndex=5;EZ.style.position="relative";if(!Ea.noHScroll){EZ.style.marginLeft=-Eb.gutterTotalWidth+"px"}}}function A2(EX){var Ea=EX.display;var Eb=D9(EX.doc.sel.from,EX.doc.sel.to);if(Eb||EX.options.showCursorWhenSelecting){d(EX)}else{Ea.cursor.style.display=Ea.otherCursor.style.display="none"}if(!Eb){w(EX)}else{Ea.selectionDiv.style.display="none"}if(EX.options.moveInputWithCursor){var Ec=Ci(EX,EX.doc.sel.head,"div");var EY=AO(Ea.wrapper),EZ=AO(Ea.lineDiv);Ea.inputDiv.style.top=Math.max(0,Math.min(Ea.wrapper.clientHeight-10,Ec.top+EZ.top-EY.top))+"px";Ea.inputDiv.style.left=Math.max(0,Math.min(Ea.wrapper.clientWidth-10,Ec.left+EZ.left-EY.left))+"px"}}function d(EX){var EY=EX.display,EZ=Ci(EX,EX.doc.sel.head,"div");EY.cursor.style.left=EZ.left+"px";EY.cursor.style.top=EZ.top+"px";EY.cursor.style.height=Math.max(0,EZ.bottom-EZ.top)*EX.options.cursorHeight+"px";EY.cursor.style.display="";if(EZ.other){EY.otherCursor.style.display="";EY.otherCursor.style.left=EZ.other.left+"px";EY.otherCursor.style.top=EZ.other.top+"px";EY.otherCursor.style.height=(EZ.other.bottom-EZ.other.top)*0.85+"px"}else{EY.otherCursor.style.display="none"}}function w(Ej){var Ee=Ej.display,Ei=Ej.doc,EX=Ej.doc.sel;var Ec=document.createDocumentFragment();var Eh=Dc(Ej.display),Eb=Eh.left,EY=Ee.lineSpace.offsetWidth-Eh.right;function El(Ep,Eo,En,Em){if(Eo<0){Eo=0}Ec.appendChild(EK("div",null,"CodeMirror-selected","position: absolute; left: "+Ep+"px; top: "+Eo+"px; width: "+(En==null?EY-Ep:En)+"px; height: "+(Em-Eo)+"px"))}function Eg(En,Ep,Es){var Eo=Dk(Ei,En);var Eq=Eo.text.length;var Et,Em;function Er(Ev,Eu){return Bz(Ej,l(En,Ev),"div",Eo,Eu)}Cm(A(Eo),Ep||0,Es==null?Eq:Es,function(E1,E0,Eu){var Ex=Er(E1,"left"),Ey,Ez,Ew;if(E1==E0){Ey=Ex;Ez=Ew=Ex.left}else{Ey=Er(E0-1,"right");if(Eu=="rtl"){var Ev=Ex;Ex=Ey;Ey=Ev}Ez=Ex.left;Ew=Ey.right}if(Ep==null&&E1==0){Ez=Eb}if(Ey.top-Ex.top>3){El(Ez,Ex.top,null,Ex.bottom);Ez=Eb;if(Ex.bottom<Ey.top){El(Ez,Ex.bottom,null,Ey.top)}}if(Es==null&&E0==Eq){Ew=EY}if(!Et||Ex.top<Et.top||Ex.top==Et.top&&Ex.left<Et.left){Et=Ex}if(!Em||Ey.bottom>Em.bottom||Ey.bottom==Em.bottom&&Ey.right>Em.right){Em=Ey}if(Ez<Eb+1){Ez=Eb}El(Ez,Ey.top,Ew-Ez,Ey.bottom)});return{start:Et,end:Em}}if(EX.from.line==EX.to.line){Eg(EX.from.line,EX.from.ch,EX.to.ch)}else{var Ea=Dk(Ei,EX.from.line),EZ=Dk(Ei,EX.to.line);var Ed=V(Ei,Ea)==V(Ei,EZ);var Ek=Eg(EX.from.line,EX.from.ch,Ed?Ea.text.length:null).end;var Ef=Eg(EX.to.line,Ed?0:null,EX.to.ch).start;if(Ed){if(Ek.top<Ef.top-2){El(Ek.right,Ek.top,null,Ek.bottom);El(Eb,Ef.top,Ef.left,Ef.bottom)}else{El(Ek.right,Ek.top,Ef.left-Ek.right,Ek.bottom)}}if(Ek.bottom<Ef.top){El(Eb,Ek.bottom,null,Ef.top)}}BF(Ee.selectionDiv,Ec);Ee.selectionDiv.style.display=""}function K(EX){if(!EX.state.focused){return }var EZ=EX.display;clearInterval(EZ.blinker);var EY=true;EZ.cursor.style.visibility=EZ.otherCursor.style.visibility="";if(EX.options.cursorBlinkRate>0){EZ.blinker=setInterval(function(){EZ.cursor.style.visibility=EZ.otherCursor.style.visibility=(EY=!EY)?"":"hidden"},EX.options.cursorBlinkRate)}}function Cv(EX,EY){if(EX.doc.mode.startState&&EX.doc.frontier<EX.display.showingTo){EX.state.highlight.set(EY,Bo(B3,EX))}}function B3(EX){var Ea=EX.doc;if(Ea.frontier<Ea.first){Ea.frontier=Ea.first}if(Ea.frontier>=EX.display.showingTo){return }var EY=+new Date+EX.options.workTime;var EZ=BO(Ea.mode,CX(EX,Ea.frontier));var Ec=[],Eb;Ea.iter(Ea.frontier,Math.min(Ea.first+Ea.size,EX.display.showingTo+500),function(Ed){if(Ea.frontier>=EX.display.showingFrom){var Ef=Ed.styles;Ed.styles=D5(EX,Ed,EZ,true);var Eg=!Ef||Ef.length!=Ed.styles.length;for(var Ee=0;!Eg&&Ee<Ef.length;++Ee){Eg=Ef[Ee]!=Ed.styles[Ee]}if(Eg){if(Eb&&Eb.end==Ea.frontier){Eb.end++}else{Ec.push(Eb={start:Ea.frontier,end:Ea.frontier+1})}}Ed.stateAfter=BO(Ea.mode,EZ)}else{CU(EX,Ed.text,EZ);Ed.stateAfter=Ea.frontier%5==0?BO(Ea.mode,EZ):null}++Ea.frontier;if(+new Date>EY){Cv(EX,EX.options.workDelay);return true}});if(Ec.length){B9(EX,function(){for(var Ed=0;Ed<Ec.length;++Ed){r(this,Ec[Ed].start,Ec[Ed].end)}})()}}function Bq(Ed,EX,Ea){var EY,Eb,Ec=Ed.doc;var EZ=Ea?-1:EX-(Ed.doc.mode.innerMode?1000:100);for(var Eg=EX;Eg>EZ;--Eg){if(Eg<=Ec.first){return Ec.first}var Ef=Dk(Ec,Eg-1);if(Ef.stateAfter&&(!Ea||Eg<=Ec.frontier)){return Eg}var Ee=BG(Ef.text,null,Ed.options.tabSize);if(Eb==null||EY>Ee){Eb=Eg-1;EY=Ee}}return Eb}function CX(EX,Ed,EY){var Eb=EX.doc,Ea=EX.display;if(!Eb.mode.startState){return true}var Ec=Bq(EX,Ed,EY),EZ=Ec>Eb.first&&Dk(Eb,Ec-1).stateAfter;if(!EZ){EZ=BM(Eb.mode)}else{EZ=BO(Eb.mode,EZ)}Eb.iter(Ec,Ed,function(Ee){CU(EX,Ee.text,EZ);var Ef=Ec==Ed-1||Ec%5==0||Ec>=Ea.showingFrom&&Ec<Ea.showingTo;Ee.stateAfter=Ef?BO(Eb.mode,EZ):null;++Ec});if(EY){Eb.frontier=Ec}return EZ}function De(EX){return EX.lineSpace.offsetTop}function A7(EX){return EX.mover.offsetHeight-EX.lineSpace.offsetHeight}function Dc(EZ){if(EZ.cachedPaddingH){return EZ.cachedPaddingH}var EY=BF(EZ.measure,EK("pre","x"));var EX=window.getComputedStyle?window.getComputedStyle(EY):EY.currentStyle;return EZ.cachedPaddingH={left:parseInt(EX.paddingLeft),right:parseInt(EX.paddingRight)}}function Cx(Ee,Ef,EY,Eb,Ec){var Ea=-1;Eb=Eb||A8(Ee,Ef);if(Eb.crude){var EZ=Eb.left+EY*Eb.width;return{left:EZ,right:EZ+Eb.width,top:Eb.top,bottom:Eb.bottom}}for(var Ed=EY;;Ed+=Ea){var EX=Eb[Ed];if(EX){break}if(Ea<0&&Ed==0){Ea=1}}Ec=Ed>EY?"left":Ed<EY?"right":Ec;if(Ec=="left"&&EX.leftSide){EX=EX.leftSide}else{if(Ec=="right"&&EX.rightSide){EX=EX.rightSide}}return{left:Ed<EY?EX.right:EX.left,right:Ed>EY?EX.left:EX.right,top:EX.top,bottom:EX.bottom}}function Db(EX,EY){var Ea=EX.display.measureLineCache;for(var Eb=0;Eb<Ea.length;++Eb){var EZ=Ea[Eb];if(EZ.text==EY.text&&EZ.markedSpans==EY.markedSpans&&EX.display.scroller.clientWidth==EZ.width&&EZ.classes==EY.textClass+"|"+EY.wrapClass){return EZ}}}function ED(EX,EY){var EZ=Db(EX,EY);if(EZ){EZ.text=EZ.measure=EZ.markedSpans=null}}function A8(EX,EY){var Ec=Db(EX,EY);if(Ec){return Ec.measure}var Eb=CI(EX,EY);var Ea=EX.display.measureLineCache;var EZ={text:EY.text,width:EX.display.scroller.clientWidth,markedSpans:EY.markedSpans,measure:Eb,classes:EY.textClass+"|"+EY.wrapClass};if(Ea.length==16){Ea[++EX.display.measureLineCachePos%16]=EZ}else{Ea.push(EZ)}return Eb}function CI(Ee,Eg){if(!Ee.options.lineWrapping&&Eg.text.length>=Ee.options.crudeMeasuringFrom){return EL(Ee,Eg)}var Em=Ee.display,Ec=v(Eg.text.length);var Ej=DQ(Ee,Eg,Ec,true).pre;if(CF&&!Bf&&!Ee.options.lineWrapping&&Ej.childNodes.length>100){var EZ=document.createDocumentFragment();var Eh=10,Ek=Ej.childNodes.length;for(var Eo=0,Ei=Math.ceil(Ek/Eh);Eo<Ei;++Eo){var Ef=EK("div",null,null,"display: inline-block");for(var En=0;En<Eh&&Ek;++En){Ef.appendChild(Ej.firstChild);--Ek}EZ.appendChild(Ef)}Ej.appendChild(EZ)}BF(Em.measure,Ej);var EY=AO(Em.lineDiv);var EX=[],Er=v(Eg.text.length),Eq=Ej.offsetHeight;if(Be&&Em.measure.first!=Ej){BF(Em.measure,Ej)}function Ep(Eu){var Ew=Eu.top-EY.top,Ey=Eu.bottom-EY.top;if(Ey>Eq){Ey=Eq}if(Ew<0){Ew=0}for(var Et=EX.length-2;Et>=0;Et-=2){var Ev=EX[Et],Ex=EX[Et+1];if(Ev>Ey||Ex<Ew){continue}if(Ev<=Ew&&Ex>=Ey||Ew<=Ev&&Ey>=Ex||Math.min(Ey,Ex)-Math.max(Ew,Ev)>=(Ey-Ew)>>1){EX[Et]=Math.min(Ew,Ev);EX[Et+1]=Math.max(Ey,Ex);break}}if(Et<0){Et=EX.length;EX.push(Ew,Ey)}return{left:Eu.left-EY.left,right:Eu.right-EY.left,top:Et,bottom:null}}function Es(Et){Et.bottom=EX[Et.top+1];Et.top=EX[Et.top]}for(var Eo=0,Eb;Eo<Ec.length;++Eo){if(Eb=Ec[Eo]){var El=Eb,Ea=null;if(/\bCodeMirror-widget\b/.test(Eb.className)&&Eb.getClientRects){if(Eb.firstChild.nodeType==1){El=Eb.firstChild}var Ed=El.getClientRects();if(Ed.length>1){Ea=Er[Eo]=Ep(Ed[0]);Ea.rightSide=Ep(Ed[Ed.length-1])}}if(!Ea){Ea=Er[Eo]=Ep(AO(El))}if(Eb.measureRight){Ea.right=AO(Eb.measureRight).left-EY.left}if(Eb.leftSide){Ea.leftSide=Ep(AO(Eb.leftSide))}}}Cl(Ee.display.measure);for(var Eo=0,Eb;Eo<Er.length;++Eo){if(Eb=Er[Eo]){Es(Eb);if(Eb.leftSide){Es(Eb.leftSide)}if(Eb.rightSide){Es(Eb.rightSide)}}}return Er}function EL(EX,EY){var Ec=new EO(EY.text.slice(0,100),null);if(EY.textClass){Ec.textClass=EY.textClass}var Ea=CI(EX,Ec);var Eb=Cx(EX,Ec,0,Ea,"left");var EZ=Cx(EX,Ec,99,Ea,"right");return{crude:true,top:Eb.top,left:Eb.left,bottom:Eb.bottom,width:(EZ.right-Eb.left)/100}}function DH(Ed,Ef){var Ee=false;if(Ef.markedSpans){for(var Eb=0;Eb<Ef.markedSpans;++Eb){var EX=Ef.markedSpans[Eb];if(EX.collapsed&&(EX.to==null||EX.to==Ef.text.length)){Ee=true}}}var EY=!Ee&&Db(Ed,Ef);if(EY||Ef.text.length>=Ed.options.crudeMeasuringFrom){return Cx(Ed,Ef,Ef.text.length,EY&&EY.measure,"right").right}var EZ=DQ(Ed,Ef,null,true).pre;var Ea=EZ.appendChild(As(Ed.display.measure));BF(Ed.display.measure,EZ);var Ec=AO(Ea);if(Ec.right==0&&Ec.bottom==0){Ea=EZ.appendChild(EK("span","\u00a0"));Ec=AO(Ea)}return Ec.left-AO(Ed.display.lineDiv).left}function u(EX){EX.display.measureLineCache.length=EX.display.measureLineCachePos=0;EX.display.cachedCharWidth=EX.display.cachedTextHeight=EX.display.cachedPaddingH=null;if(!EX.options.lineWrapping){EX.display.maxLineChanged=true}EX.display.lineNumChars=null}function Bn(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Bm(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function DP(Ed,Ea,Ec,EY){if(Ea.widgets){for(var EZ=0;EZ<Ea.widgets.length;++EZ){if(Ea.widgets[EZ].above){var Ef=B6(Ea.widgets[EZ]);Ec.top+=Ef;Ec.bottom+=Ef}}}if(EY=="line"){return Ec}if(!EY){EY="local"}var Eb=BB(Ed,Ea);if(EY=="local"){Eb+=De(Ed.display)}else{Eb-=Ed.display.viewOffset}if(EY=="page"||EY=="window"){var EX=AO(Ed.display.lineSpace);Eb+=EX.top+(EY=="window"?0:Bm());var Ee=EX.left+(EY=="window"?0:Bn());Ec.left+=Ee;Ec.right+=Ee}Ec.top+=Eb;Ec.bottom+=Eb;return Ec}function ET(EY,Eb,EZ){if(EZ=="div"){return Eb}var Ed=Eb.left,Ec=Eb.top;if(EZ=="page"){Ed-=Bn();Ec-=Bm()}else{if(EZ=="local"||!EZ){var Ea=AO(EY.display.sizer);Ed+=Ea.left;Ec+=Ea.top}}var EX=AO(EY.display.lineSpace);return{left:Ed-EX.left,top:Ec-EX.top}}function Bz(EX,Eb,Ea,EZ,EY){if(!EZ){EZ=Dk(EX.doc,Eb.line)}return DP(EX,EZ,Cx(EX,EZ,Eb.ch,null,EY),Ea)}function Ci(Eg,Ef,EZ,Ee,Ec){Ee=Ee||Dk(Eg.doc,Ef.line);if(!Ec){Ec=A8(Eg,Ee)}function Eb(Ek,Ej){var Ei=Cx(Eg,Ee,Ek,Ec,Ej?"right":"left");if(Ej){Ei.left=Ei.right}else{Ei.right=Ei.left}return DP(Eg,Ee,Ei,EZ)}function Eh(El,Ei){var Ej=Ed[Ei],Ek=Ej.level%2;if(El==CV(Ej)&&Ei&&Ej.level<Ed[Ei-1].level){Ej=Ed[--Ei];El=ES(Ej)-(Ej.level%2?0:1);Ek=true}else{if(El==ES(Ej)&&Ei<Ed.length-1&&Ej.level<Ed[Ei+1].level){Ej=Ed[++Ei];El=CV(Ej)-Ej.level%2;Ek=false}}if(Ek&&El==Ej.to&&El>Ej.from){return Eb(El-1)}return Eb(El,Ek)}var Ed=A(Ee),EX=Ef.ch;if(!Ed){return Eb(EX)}var EY=AK(Ed,EX);var Ea=Eh(EX,EY);if(DZ!=null){Ea.other=Eh(EX,DZ)}return Ea}function EJ(EX,EY,EZ,Eb){var Ea=new l(EX,EY);Ea.xRel=Eb;if(EZ){Ea.outside=true}return Ea}function EE(Ee,Eb,Ea){var Ed=Ee.doc;Ea+=Ee.display.viewOffset;if(Ea<0){return EJ(Ed.first,0,true,-1)}var EY=A5(Ed,Ea),Ef=Ed.first+Ed.size-1;if(EY>Ef){return EJ(Ed.first+Ed.size-1,Dk(Ed,Ef).text.length,true,1)}if(Eb<0){Eb=0}for(;;){var EZ=Dk(Ed,EY);var Eg=B7(Ee,EZ,EY,Eb,Ea);var Ec=C6(EZ);var EX=Ec&&Ec.find();if(Ec&&(Eg.ch>EX.from.ch||Eg.ch==EX.from.ch&&Eg.xRel>0)){EY=EX.to.line}else{return Eg}}}function B7(Eh,EZ,Ek,Ej,Ei){var Eg=Ei-BB(Eh,EZ);var Ed=false,Eq=2*Eh.display.wrapper.clientWidth;var Ep=A8(Eh,EZ);function Eu(Ew){var Ex=Ci(Eh,l(Ek,Ew),"line",EZ,Ep);Ed=true;if(Eg>Ex.bottom){return Ex.left-Eq}else{if(Eg<Ex.top){return Ex.left+Eq}else{Ed=false}}return Ex.left}var Em=A(EZ),Eo=EZ.text.length;var Er=Bu(EZ),Ea=B4(EZ);var En=Eu(Er),EX=Ed,EY=Eu(Ea),Ec=Ed;if(Ej>EY){return EJ(Ek,Ea,Ec,1)}for(;;){if(Em?Ea==Er||Ea==R(EZ,Er,1):Ea-Er<=1){var El=Ej<En||Ej-En<=EY-Ej?Er:Ea;var Et=Ej-(El==Er?En:EY);while(Dw(EZ.text.charAt(El))){++El}var Ef=EJ(Ek,El,El==Er?EX:Ec,Et<0?-1:Et?1:0);return Ef}var Ee=Math.ceil(Eo/2),Ev=Er+Ee;if(Em){Ev=Er;for(var Es=0;Es<Ee;++Es){Ev=R(EZ,Ev,1)}}var Eb=Eu(Ev);if(Eb>Ej){Ea=Ev;EY=Eb;if(Ec=Ed){EY+=1000}Eo=Ee}else{Er=Ev;En=Eb;EX=Ed;Eo-=Ee}}}var AL;function AV(EZ){if(EZ.cachedTextHeight!=null){return EZ.cachedTextHeight}if(AL==null){AL=EK("pre");for(var EY=0;EY<49;++EY){AL.appendChild(document.createTextNode("x"));AL.appendChild(EK("br"))}AL.appendChild(document.createTextNode("x"))}BF(EZ.measure,AL);var EX=AL.offsetHeight/50;if(EX>3){EZ.cachedTextHeight=EX}Cl(EZ.measure);return EX||1}function CZ(Ea){if(Ea.cachedCharWidth!=null){return Ea.cachedCharWidth}var EX=EK("span","x");var EZ=EK("pre",[EX]);BF(Ea.measure,EZ);var EY=EX.offsetWidth;if(EY>2){Ea.cachedCharWidth=EY}return EY||10}var Cp=0;function By(EX){EX.curOp={changes:[],forceUpdate:false,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:false,cursorActivity:false,updateMaxLine:false,updateScrollPos:false,id:++Cp};if(!Bl++){At=[]}}function x(El){var Ef=El.curOp,Ek=El.doc,Eg=El.display;El.curOp=null;if(Ef.updateMaxLine){EN(El)}if(Eg.maxLineChanged&&!El.options.lineWrapping&&Eg.maxLine){var EY=DH(El,Eg.maxLine);Eg.sizer.style.minWidth=Math.max(0,EY+3)+"px";Eg.maxLineChanged=false;var Ei=Math.max(0,Eg.sizer.offsetLeft+Eg.sizer.offsetWidth-Eg.scroller.clientWidth);if(Ei<Ek.scrollLeft&&!Ef.updateScrollPos){A3(El,Math.min(Eg.scroller.scrollLeft,Ei),true)}}var EZ,Ed;if(Ef.updateScrollPos){EZ=Ef.updateScrollPos}else{if(Ef.selectionChanged&&Eg.scroller.clientHeight){var Ej=Ci(El,Ek.sel.head);EZ=b(El,Ej.left,Ej.top,Ej.left,Ej.bottom)}}if(Ef.changes.length||Ef.forceUpdate||EZ&&EZ.scrollTop!=null){Ed=Cc(El,Ef.changes,EZ&&EZ.scrollTop,Ef.forceUpdate);if(El.display.scroller.offsetHeight){El.doc.scrollTop=El.display.scroller.scrollTop}}if(!Ed&&Ef.selectionChanged){A2(El)}if(Ef.updateScrollPos){var Eh=Math.max(0,Math.min(Eg.scroller.scrollHeight-Eg.scroller.clientHeight,EZ.scrollTop));var Ea=Math.max(0,Math.min(Eg.scroller.scrollWidth-Eg.scroller.clientWidth,EZ.scrollLeft));Eg.scroller.scrollTop=Eg.scrollbarV.scrollTop=Ek.scrollTop=Eh;Eg.scroller.scrollLeft=Eg.scrollbarH.scrollLeft=Ek.scrollLeft=Ea;DG(El);if(Ef.scrollToPos){Y(El,EA(El.doc,Ef.scrollToPos.from),EA(El.doc,Ef.scrollToPos.to),Ef.scrollToPos.margin)}}else{if(EZ){AF(El)}}if(Ef.selectionChanged){K(El)}if(El.state.focused&&Ef.updateInput){Dv(El,Ef.userSelChange)}var Ee=Ef.maybeHiddenMarkers,EX=Ef.maybeUnhiddenMarkers;if(Ee){for(var Ec=0;Ec<Ee.length;++Ec){if(!Ee[Ec].lines.length){AI(Ee[Ec],"hide")}}}if(EX){for(var Ec=0;Ec<EX.length;++Ec){if(EX[Ec].lines.length){AI(EX[Ec],"unhide")}}}var Eb;if(!--Bl){Eb=At;At=null}if(Ef.textChanged){AI(El,"change",El,Ef.textChanged)}if(Ef.cursorActivity){AI(El,"cursorActivity",El)}if(Eb){for(var Ec=0;Ec<Eb.length;++Ec){Eb[Ec]()}}}function B9(EX,EY){return function(){var Ea=EX||this,Eb=!Ea.curOp;if(Eb){By(Ea)}try{var EZ=EY.apply(Ea,arguments)}finally{if(Eb){x(Ea)}}return EZ}}function D4(EX){return function(){var EZ=this.cm&&!this.cm.curOp,EY;if(EZ){By(this.cm)}try{EY=EX.apply(this,arguments)}finally{if(EZ){x(this.cm)}}return EY}}function B1(EY,Ea){var EZ=!EY.curOp,EX;if(EZ){By(EY)}try{EX=Ea()}finally{if(EZ){x(EY)}}return EX}function r(EX,Ea,EZ,EY){if(Ea==null){Ea=EX.doc.first}if(EZ==null){EZ=EX.doc.first+EX.doc.size}EX.curOp.changes.push({from:Ea,to:EZ,diff:EY})}function Ar(EX){if(EX.display.pollingFast){return }EX.display.poll.set(EX.options.pollInterval,function(){Bb(EX);if(EX.state.focused){Ar(EX)}})}function X(EX){var EY=false;EX.display.pollingFast=true;function EZ(){var Ea=Bb(EX);if(!Ea&&!EY){EY=true;EX.display.poll.set(60,EZ)}else{EX.display.pollingFast=false;Ar(EX)}}EX.display.poll.set(20,EZ)}function Bb(El){var Eg=El.display.input,Ed=El.display.prevInput,Ek=El.doc,EX=Ek.sel;if(!El.state.focused||Ax(Eg)||t(El)||El.options.disableInput){return false}if(El.state.pasteIncoming&&El.state.fakedLastChar){Eg.value=Eg.value.substring(0,Eg.value.length-1);El.state.fakedLastChar=false}var Em=Eg.value;if(Em==Ed&&D9(EX.from,EX.to)){return false}if(Cb&&!Be&&El.display.inputHasSelection===Em){Dv(El,true);return false}var EZ=!El.curOp;if(EZ){By(El)}EX.shift=false;var Ef=0,EY=Math.min(Ed.length,Em.length);while(Ef<EY&&Ed.charCodeAt(Ef)==Em.charCodeAt(Ef)){++Ef}var Ej=EX.from,Ei=EX.to;var Eb=Em.slice(Ef);if(Ef<Ed.length){Ej=l(Ej.line,Ej.ch-(Ed.length-Ef))}else{if(El.state.overwrite&&D9(Ej,Ei)&&!El.state.pasteIncoming){Ei=l(Ei.line,Math.min(Dk(Ek,Ei.line).text.length,Ei.ch+Eb.length))}}var Ee=El.curOp.updateInput;var Eh={from:Ej,to:Ei,text:AX(Eb),origin:El.state.pasteIncoming?"paste":El.state.cutIncoming?"cut":"+input"};Ak(El.doc,Eh,"end");El.curOp.updateInput=Ee;p(El,"inputRead",El,Eh);if(Eb&&!El.state.pasteIncoming&&El.options.electricChars&&El.options.smartIndent&&EX.head.ch<100){var Ea=El.getModeAt(EX.head).electricChars;if(Ea){for(var Ec=0;Ec<Ea.length;Ec++){if(Eb.indexOf(Ea.charAt(Ec))>-1){o(El,EX.head.line,"smart");break}}}}if(Em.length>1000||Em.indexOf("\n")>-1){Eg.value=El.display.prevInput=""}else{El.display.prevInput=Em}if(EZ){x(El)}El.state.pasteIncoming=El.state.cutIncoming=false;return true}function Dv(EX,EZ){var EY,Ea,Ec=EX.doc;if(!D9(Ec.sel.from,Ec.sel.to)){EX.display.prevInput="";EY=CE&&(Ec.sel.to.line-Ec.sel.from.line>100||(Ea=EX.getSelection()).length>1000);var Eb=EY?"-":Ea||EX.getSelection();EX.display.input.value=Eb;if(EX.state.focused){Cd(EX.display.input)}if(Cb&&!Be){EX.display.inputHasSelection=Eb}}else{if(EZ){EX.display.prevInput=EX.display.input.value="";if(Cb&&!Be){EX.display.inputHasSelection=null}}}EX.display.inaccurateSelection=EY}function DC(EX){if(EX.options.readOnly!="nocursor"&&(!Cw||document.activeElement!=EX.display.input)){EX.display.input.focus()}}function O(EX){if(!EX.state.focused){DC(EX);Bs(EX)}}function t(EX){return EX.options.readOnly||EX.doc.cantEdit}function EF(EY){var Ed=EY.display;BK(Ed.scroller,"mousedown",B9(EY,C5));if(CF){BK(Ed.scroller,"dblclick",B9(EY,function(Eg){if(AS(EY,Eg)){return }var Eh=Bh(EY,Eg);if(!Eh||J(EY,Eg)||Af(EY.display,Eg)){return }Bv(Eg);var Ef=AC(Dk(EY.doc,Eh.line).text,Eh);EH(EY.doc,Ef.from,Ef.to)}))}else{BK(Ed.scroller,"dblclick",function(Ef){AS(EY,Ef)||Bv(Ef)})}BK(Ed.lineSpace,"selectstart",function(Ef){if(!Af(Ed,Ef)){Bv(Ef)}});if(!Bx){BK(Ed.scroller,"contextmenu",function(Ef){AE(EY,Ef)})}BK(Ed.scroller,"scroll",function(){if(Ed.scroller.clientHeight){g(EY,Ed.scroller.scrollTop);A3(EY,Ed.scroller.scrollLeft,true);AI(EY,"scroll",EY)}});BK(Ed.scrollbarV,"scroll",function(){if(Ed.scroller.clientHeight){g(EY,Ed.scrollbarV.scrollTop)}});BK(Ed.scrollbarH,"scroll",function(){if(Ed.scroller.clientHeight){A3(EY,Ed.scrollbarH.scrollLeft)}});BK(Ed.scroller,"mousewheel",function(Ef){B(EY,Ef)});BK(Ed.scroller,"DOMMouseScroll",function(Ef){B(EY,Ef)});function Ee(){if(EY.state.focused){setTimeout(Bo(DC,EY),0)}}BK(Ed.scrollbarH,"mousedown",Ee);BK(Ed.scrollbarV,"mousedown",Ee);BK(Ed.wrapper,"scroll",function(){Ed.wrapper.scrollTop=Ed.wrapper.scrollLeft=0});var EX;function Eb(){if(EX==null){EX=setTimeout(function(){EX=null;Ed.cachedCharWidth=Ed.cachedTextHeight=Ed.cachedPaddingH=C7=null;u(EY);B1(EY,Bo(r,EY))},100)}}BK(window,"resize",Eb);function Ea(){for(var Ef=Ed.wrapper.parentNode;Ef&&Ef!=document.body;Ef=Ef.parentNode){}if(Ef){setTimeout(Ea,5000)}else{Cu(window,"resize",Eb)}}setTimeout(Ea,5000);BK(Ed.input,"keyup",B9(EY,Am));BK(Ed.input,"input",function(){if(Cb&&!Be&&EY.display.inputHasSelection){EY.display.inputHasSelection=null}X(EY)});BK(Ed.input,"keydown",B9(EY,M));BK(Ed.input,"keypress",B9(EY,Bp));BK(Ed.input,"focus",Bo(Bs,EY));BK(Ed.input,"blur",Bo(AU,EY));function EZ(Ef){if(AS(EY,Ef)||EY.options.onDragEvent&&EY.options.onDragEvent(EY,z(Ef))){return }C3(Ef)}if(EY.options.dragDrop){BK(Ed.scroller,"dragstart",function(Ef){j(EY,Ef)});BK(Ed.scroller,"dragenter",EZ);BK(Ed.scroller,"dragover",EZ);BK(Ed.scroller,"drop",B9(EY,An))}BK(Ed.scroller,"paste",function(Ef){if(Af(Ed,Ef)){return }DC(EY);X(EY)});BK(Ed.input,"paste",function(){if(B8&&!EY.state.fakedLastChar&&!(new Date-EY.state.lastMiddleDown<200)){var Eg=Ed.input.selectionStart,Ef=Ed.input.selectionEnd;Ed.input.value+="$";Ed.input.selectionStart=Eg;Ed.input.selectionEnd=Ef;EY.state.fakedLastChar=true}EY.state.pasteIncoming=true;X(EY)});function Ec(Ef){if(Ed.inaccurateSelection){Ed.prevInput="";Ed.inaccurateSelection=false;Ed.input.value=EY.getSelection();Cd(Ed.input)}if(Ef.type=="cut"){EY.state.cutIncoming=true}}BK(Ed.input,"cut",Ec);BK(Ed.input,"copy",Ec);if(Ag){BK(Ed.sizer,"mouseup",function(){if(document.activeElement==Ed.input){Ed.input.blur()}DC(EY)})}}function Af(EY,EX){for(var EZ=e(EX);EZ!=EY.wrapper;EZ=EZ.parentNode){if(!EZ||EZ.ignoreEvents||EZ.parentNode==EY.sizer&&EZ!=EY.mover){return true}}}function Bh(EY,Ed,Ea){var Ec=EY.display;if(!Ea){var Eb=e(Ed);if(Eb==Ec.scrollbarH||Eb==Ec.scrollbarH.firstChild||Eb==Ec.scrollbarV||Eb==Ec.scrollbarV.firstChild||Eb==Ec.scrollbarFiller||Eb==Ec.gutterFiller){return null}}var EX,Ee,EZ=AO(Ec.lineSpace);try{EX=Ed.clientX;Ee=Ed.clientY}catch(Ed){return null}return EE(EY,EX-EZ.left,Ee-EZ.top)}var CN,CH;function C5(Ep){if(AS(this,Ep)){return }var Ea=this,Ek=Ea.display,Er=Ea.doc,Ei=Er.sel;Ei.shift=Ep.shiftKey;if(Af(Ek,Ep)){if(!B8){Ek.scroller.draggable=false;setTimeout(function(){Ek.scroller.draggable=true},100)}return }if(J(Ea,Ep)){return }var EZ=Bh(Ea,Ep);window.focus();switch(EC(Ep)){case 3:if(Bx){AE.call(Ea,Ea,Ep)}return ;case 2:if(B8){Ea.state.lastMiddleDown=+new Date}if(EZ){EH(Ea.doc,EZ)}setTimeout(Bo(DC,Ea),20);Bv(Ep);return }if(!EZ){if(e(Ep)==Ek.scroller){Bv(Ep)}return }setTimeout(Bo(O,Ea),0);var EX=+new Date,EY="single";if(CH&&CH.time>EX-400&&D9(CH.pos,EZ)){EY="triple";Bv(Ep);setTimeout(Bo(DC,Ea),20);Aq(Ea,EZ.line)}else{if(CN&&CN.time>EX-400&&D9(CN.pos,EZ)){EY="double";CH={time:EX,pos:EZ};Bv(Ep);var Em=AC(Dk(Er,EZ.line).text,EZ);EH(Ea.doc,Em.from,Em.to)}else{CN={time:EX,pos:EZ}}}var Eb=EZ;if(Ea.options.dragDrop&&DN&&!t(Ea)&&!D9(Ei.from,Ei.to)&&!Dl(EZ,Ei.from)&&!Dl(Ei.to,EZ)&&EY=="single"){var El=B9(Ea,function(Es){if(B8){Ek.scroller.draggable=false}Ea.state.draggingText=false;Cu(document,"mouseup",El);Cu(Ek.scroller,"drop",El);if(Math.abs(Ep.clientX-Es.clientX)+Math.abs(Ep.clientY-Es.clientY)<10){Bv(Es);EH(Ea.doc,EZ);DC(Ea);if(CF&&!Be){setTimeout(function(){document.body.focus();DC(Ea)},20)}}});if(B8){Ek.scroller.draggable=true}Ea.state.draggingText=El;if(Ek.scroller.dragDrop){Ek.scroller.dragDrop()}BK(document,"mouseup",El);BK(Ek.scroller,"drop",El);return }Bv(Ep);if(EY=="single"){EH(Ea.doc,EA(Er,EZ))}var Eq=Ei.from,Ef=Ei.to,Ej=EZ;function En(Et){if(D9(Ej,Et)){return }Ej=Et;if(EY=="single"){EH(Ea.doc,EA(Er,EZ),Et);return }Eq=EA(Er,Eq);Ef=EA(Er,Ef);if(EY=="double"){var Es=AC(Dk(Er,Et.line).text,Et);if(Dl(Et,Eq)){EH(Ea.doc,Es.from,Ef)}else{EH(Ea.doc,Eq,Es.to)}}else{if(EY=="triple"){if(Dl(Et,Eq)){EH(Ea.doc,Ef,EA(Er,l(Et.line,0)))}else{EH(Ea.doc,Eq,EA(Er,l(Et.line+1,0)))}}}}var Eg=AO(Ek.wrapper);var Ec=0;function Eo(Eu){var Es=++Ec;var Ew=Bh(Ea,Eu,true);if(!Ew){return }if(!D9(Ew,Eb)){O(Ea);Eb=Ew;En(Ew);var Ev=BP(Ek,Er);if(Ew.line>=Ev.to||Ew.line<Ev.from){setTimeout(B9(Ea,function(){if(Ec==Es){Eo(Eu)}}),150)}}else{var Et=Eu.clientY<Eg.top?-20:Eu.clientY>Eg.bottom?20:0;if(Et){setTimeout(B9(Ea,function(){if(Ec!=Es){return }Ek.scroller.scrollTop+=Et;Eo(Eu)}),50)}}}function Ee(Es){Ec=Infinity;Bv(Es);DC(Ea);Cu(document,"mousemove",Eh);Cu(document,"mouseup",Ed)}var Eh=B9(Ea,function(Es){if((Cb&&!CW)?!Es.buttons:!EC(Es)){Ee(Es)}else{Eo(Es)}});var Ed=B9(Ea,Ee);BK(document,"mousemove",Eh);BK(document,"mouseup",Ed)}function EV(Ei,Ee,Eg,Eh,Ea){try{var EY=Ee.clientX,EX=Ee.clientY}catch(Ee){return false}if(EY>=Math.floor(AO(Ei.display.gutters).right)){return false}if(Eh){Bv(Ee)}var Ef=Ei.display;var Ed=AO(Ef.lineDiv);if(EX>Ed.bottom||!Dq(Ei,Eg)){return BA(Ee)}EX-=Ed.top-Ef.viewOffset;for(var Eb=0;Eb<Ei.options.gutters.length;++Eb){var Ec=Ef.gutters.childNodes[Eb];if(Ec&&AO(Ec).right>=EY){var Ej=A5(Ei.doc,EX);var EZ=Ei.options.gutters[Eb];Ea(Ei,Eg,Ei,Ej,EZ,Ee);return BA(Ee)}}}function CK(EX,EY){if(!Dq(EX,"gutterContextMenu")){return false}return EV(EX,EY,"gutterContextMenu",false,AI)}function J(EX,EY){return EV(EX,EY,"gutterClick",true,p)}var q=0;function An(Ed){var Ef=this;if(AS(Ef,Ed)||Af(Ef.display,Ed)||(Ef.options.onDragEvent&&Ef.options.onDragEvent(Ef,z(Ed)))){return }Bv(Ed);if(Cb){q=+new Date}var Ee=Bh(Ef,Ed,true),EX=Ed.dataTransfer.files;if(!Ee||t(Ef)){return }if(EX&&EX.length&&window.FileReader&&window.File){var EZ=EX.length,Eh=Array(EZ),EY=0;var Ea=function(Ek,Ej){var Ei=new FileReader;Ei.onload=function(){Eh[Ej]=Ei.result;if(++EY==EZ){Ee=EA(Ef.doc,Ee);Ak(Ef.doc,{from:Ee,to:Ee,text:AX(Eh.join("\n")),origin:"paste"},"around")}};Ei.readAsText(Ek)};for(var Eb=0;Eb<EZ;++Eb){Ea(EX[Eb],Eb)}}else{if(Ef.state.draggingText&&!(Dl(Ee,Ef.doc.sel.from)||Dl(Ef.doc.sel.to,Ee))){Ef.state.draggingText(Ed);setTimeout(Bo(DC,Ef),20);return }try{var Eh=Ed.dataTransfer.getData("Text");if(Eh){var Eg=Ef.doc.sel.from,Ec=Ef.doc.sel.to;BH(Ef.doc,Ee,Ee);if(Ef.state.draggingText){AY(Ef.doc,"",Eg,Ec,"paste")}Ef.replaceSelection(Eh,null,"paste");DC(Ef)}}catch(Ed){}}}function j(EY,Ea){if(Cb&&(!EY.state.draggingText||+new Date-q<100)){C3(Ea);return }if(AS(EY,Ea)||Af(EY.display,Ea)){return }var EX=EY.getSelection();Ea.dataTransfer.setData("Text",EX);if(Ea.dataTransfer.setDragImage&&!AH){var EZ=EK("img",null,null,"position: fixed; left: 0; top: 0;");EZ.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(D2){EZ.width=EZ.height=1;EY.display.wrapper.appendChild(EZ);EZ._top=EZ.offsetTop}Ea.dataTransfer.setDragImage(EZ,0,0);if(D2){EZ.parentNode.removeChild(EZ)}}}function g(EX,EY){if(Math.abs(EX.doc.scrollTop-EY)<2){return }EX.doc.scrollTop=EY;if(!Bi){Cc(EX,[],EY)}if(EX.display.scroller.scrollTop!=EY){EX.display.scroller.scrollTop=EY}if(EX.display.scrollbarV.scrollTop!=EY){EX.display.scrollbarV.scrollTop=EY}if(Bi){Cc(EX,[])}Cv(EX,100)}function A3(EX,EZ,EY){if(EY?EZ==EX.doc.scrollLeft:Math.abs(EX.doc.scrollLeft-EZ)<2){return }EZ=Math.min(EZ,EX.display.scroller.scrollWidth-EX.display.scroller.clientWidth);EX.doc.scrollLeft=EZ;DG(EX);if(EX.display.scroller.scrollLeft!=EZ){EX.display.scroller.scrollLeft=EZ}if(EX.display.scrollbarH.scrollLeft!=EZ){EX.display.scrollbarH.scrollLeft=EZ}}var Dr=0,Ba=null;if(Cb){Ba=-0.53}else{if(Bi){Ba=15}else{if(CG){Ba=-0.7}else{if(AH){Ba=-1/3}}}}function B(Ed,EY){var Eg=EY.wheelDeltaX,Ef=EY.wheelDeltaY;if(Eg==null&&EY.detail&&EY.axis==EY.HORIZONTAL_AXIS){Eg=EY.detail}if(Ef==null&&EY.detail&&EY.axis==EY.VERTICAL_AXIS){Ef=EY.detail}else{if(Ef==null){Ef=EY.wheelDelta}}var Ea=Ed.display,Ec=Ea.scroller;if(!(Eg&&Ec.scrollWidth>Ec.clientWidth||Ef&&Ec.scrollHeight>Ec.clientHeight)){return }if(Ef&&BQ&&B8){for(var Ee=EY.target;Ee!=Ec;Ee=Ee.parentNode){if(Ee.lineObj){Ed.display.currentWheelTarget=Ee;break}}}if(Eg&&!Bi&&!D2&&Ba!=null){if(Ef){g(Ed,Math.max(0,Math.min(Ec.scrollTop+Ef*Ba,Ec.scrollHeight-Ec.clientHeight)))}A3(Ed,Math.max(0,Math.min(Ec.scrollLeft+Eg*Ba,Ec.scrollWidth-Ec.clientWidth)));Bv(EY);Ea.wheelStartX=null;return }if(Ef&&Ba!=null){var EX=Ef*Ba;var Eb=Ed.doc.scrollTop,EZ=Eb+Ea.wrapper.clientHeight;if(EX<0){Eb=Math.max(0,Eb+EX-50)}else{EZ=Math.min(Ed.doc.height,EZ+EX+50)}Cc(Ed,[],{top:Eb,bottom:EZ})}if(Dr<20){if(Ea.wheelStartX==null){Ea.wheelStartX=Ec.scrollLeft;Ea.wheelStartY=Ec.scrollTop;Ea.wheelDX=Eg;Ea.wheelDY=Ef;setTimeout(function(){if(Ea.wheelStartX==null){return }var Eh=Ec.scrollLeft-Ea.wheelStartX;var Ej=Ec.scrollTop-Ea.wheelStartY;var Ei=(Ej&&Ea.wheelDY&&Ej/Ea.wheelDY)||(Eh&&Ea.wheelDX&&Eh/Ea.wheelDX);Ea.wheelStartX=Ea.wheelStartY=null;if(!Ei){return }Ba=(Ba*Dr+Ei)/(Dr+1);++Dr},200)}else{Ea.wheelDX+=Eg;Ea.wheelDY+=Ef}}}function EG(EY,Eb,EX){if(typeof Eb=="string"){Eb=DE[Eb];if(!Eb){return false}}if(EY.display.pollingFast&&Bb(EY)){EY.display.pollingFast=false}var Ec=EY.doc,Ea=Ec.sel.shift,EZ=false;try{if(t(EY)){EY.state.suppressEdits=true}if(EX){Ec.sel.shift=false}EZ=Eb(EY)!=BV}finally{Ec.sel.shift=Ea;EY.state.suppressEdits=false}return EZ}function CR(EX){var EY=EX.state.keyMaps.slice(0);if(EX.options.extraKeys){EY.push(EX.options.extraKeys)}EY.push(EX.options.keyMap);return EY}var AA;function Do(EX,Ed){var EY=EI(EX.options.keyMap),Eb=EY.auto;clearTimeout(AA);if(Eb&&!DD(Ed)){AA=setTimeout(function(){if(EI(EX.options.keyMap)==EY){EX.options.keyMap=(Eb.call?Eb.call(null,EX):Eb);EU(EX)}},50)}var Ea=Dx(Ed,true),Ec=false;if(!Ea){return false}var EZ=CR(EX);if(Ed.shiftKey){Ec=G("Shift-"+Ea,EZ,function(Ee){return EG(EX,Ee,true)})||G(Ea,EZ,function(Ee){if(typeof Ee=="string"?/^go[A-Z]/.test(Ee):Ee.motion){return EG(EX,Ee)}})}else{Ec=G(Ea,EZ,function(Ee){return EG(EX,Ee)})}if(Ec){Bv(Ed);K(EX);if(Be){Ed.oldKeyCode=Ed.keyCode;Ed.keyCode=0}p(EX,"keyHandled",EX,Ea,Ed)}return Ec}function Cy(EX,Ea,EY){var EZ=G("'"+EY+"'",CR(EX),function(Eb){return EG(EX,Eb,true)});if(EZ){Bv(Ea);K(EX);p(EX,"keyHandled",EX,"'"+EY+"'",Ea)}return EZ}function Am(EY){var EX=this;if(AS(EX,EY)||EX.options.onKeyEvent&&EX.options.onKeyEvent(EX,z(EY))){return }if(EY.keyCode==16){EX.doc.sel.shift=false}}var CM=null;function M(Ea){var EX=this;O(EX);if(AS(EX,Ea)||EX.options.onKeyEvent&&EX.options.onKeyEvent(EX,z(Ea))){return }if(CF&&Ea.keyCode==27){Ea.returnValue=false}var EY=Ea.keyCode;EX.doc.sel.shift=EY==16||Ea.shiftKey;var EZ=Do(EX,Ea);if(D2){CM=EZ?EY:null;if(!EZ&&EY==88&&!CE&&(BQ?Ea.metaKey:Ea.ctrlKey)){EX.replaceSelection("")}}}function Bp(Eb){var EX=this;if(AS(EX,Eb)||EX.options.onKeyEvent&&EX.options.onKeyEvent(EX,z(Eb))){return }var Ea=Eb.keyCode,EY=Eb.charCode;if(D2&&Ea==CM){CM=null;Bv(Eb);return }if(((D2&&(!Eb.which||Eb.which<10))||Ag)&&Do(EX,Eb)){return }var EZ=String.fromCharCode(EY==null?Ea:EY);if(Cy(EX,Eb,EZ)){return }if(Cb&&!Be){EX.display.inputHasSelection=null}X(EX)}function Bs(EX){if(EX.options.readOnly=="nocursor"){return }if(!EX.state.focused){AI(EX,"focus",EX);EX.state.focused=true;if(EX.display.wrapper.className.search(/\bCodeMirror-focused\b/)==-1){EX.display.wrapper.className+=" CodeMirror-focused"}if(!EX.curOp){Dv(EX,true);if(B8){setTimeout(Bo(Dv,EX,true),0)}}}Ar(EX);K(EX)}function AU(EX){if(EX.state.focused){AI(EX,"blur",EX);EX.state.focused=false;EX.display.wrapper.className=EX.display.wrapper.className.replace(" CodeMirror-focused","")}clearInterval(EX.display.blinker);setTimeout(function(){if(!EX.state.focused){EX.doc.sel.shift=false}},150)}var D6;function AE(Eh,Ec){if(AS(Eh,Ec,"contextmenu")){return }var Ee=Eh.display,EY=Eh.doc.sel;if(Af(Ee,Ec)||CK(Eh,Ec)){return }var Eg=Bh(Eh,Ec),EX=Ee.scroller.scrollTop;if(!Eg||D2){return }var Eb=Eh.options.resetSelectionOnContextMenu;if(Eb&&(D9(EY.from,EY.to)||Dl(Eg,EY.from)||!Dl(Eg,EY.to))){B9(Eh,BH)(Eh.doc,Eg,Eg)}var Ed=Ee.input.style.cssText;Ee.inputDiv.style.position="absolute";Ee.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(Ec.clientY-5)+"px; left: "+(Ec.clientX-5)+"px; z-index: 1000; background: transparent; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);";DC(Eh);Dv(Eh,true);if(D9(EY.from,EY.to)){Ee.input.value=Ee.prevInput=" "}function Ea(){if(Ee.input.selectionStart!=null){var Ei=Ee.input.value="\u200b"+(D9(EY.from,EY.to)?"":Ee.input.value);Ee.prevInput="\u200b";Ee.input.selectionStart=1;Ee.input.selectionEnd=Ei.length}}function Ef(){Ee.inputDiv.style.position="relative";Ee.input.style.cssText=Ed;if(Be){Ee.scrollbarV.scrollTop=Ee.scroller.scrollTop=EX}Ar(Eh);if(Ee.input.selectionStart!=null){if(!Cb||Be){Ea()}clearTimeout(D6);var Ei=0,Ej=function(){if(Ee.prevInput=="\u200b"&&Ee.input.selectionStart==0){B9(Eh,DE.selectAll)(Eh)}else{if(Ei++<10){D6=setTimeout(Ej,500)}else{Dv(Eh)}}};D6=setTimeout(Ej,200)}}if(Cb&&!Be){Ea()}if(Bx){C3(Ec);var EZ=function(){Cu(window,"mouseup",EZ);setTimeout(Ef,20)};BK(window,"mouseup",EZ)}else{setTimeout(Ef,50)}}var B5=c.changeEnd=function(EX){if(!EX.text){return EX.to}return l(EX.from.line+EX.text.length-1,D8(EX.text).length+(EX.text.length==1?EX.from.ch:0))};function DF(Eb,Ed,Ec){if(!Dl(Ed.from,Ec)){return EA(Eb,Ec)}var Ea=(Ed.text.length-1)-(Ed.to.line-Ed.from.line);if(Ec.line>Ed.to.line+Ea){var EZ=Ec.line-Ea,EY=Eb.first+Eb.size-1;if(EZ>EY){return l(EY,Dk(Eb,EY).text.length)}return Dy(Ec,Dk(Eb,EZ).text.length)}if(Ec.line==Ed.to.line+Ea){return Dy(Ec,D8(Ed.text).length+(Ed.text.length==1?Ed.from.ch:0)+Dk(Eb,Ed.to.line).text.length-Ed.to.ch)}var EX=Ec.line-Ed.from.line;return Dy(Ec,Ed.text[EX].length+(EX?0:Ed.from.ch))}function Dp(EY,Eb,EZ){if(EZ&&typeof EZ=="object"){return{anchor:DF(EY,Eb,EZ.anchor),head:DF(EY,Eb,EZ.head)}}if(EZ=="start"){return{anchor:Eb.from,head:Eb.from}}var EX=B5(Eb);if(EZ=="around"){return{anchor:Eb.from,head:EX}}if(EZ=="end"){return{anchor:EX,head:EX}}var Ea=function(Ee){if(Dl(Ee,Eb.from)){return Ee}if(!Dl(Eb.to,Ee)){return EX}var Ec=Ee.line+Eb.text.length-(Eb.to.line-Eb.from.line)-1,Ed=Ee.ch;if(Ee.line==Eb.to.line){Ed+=EX.ch-Eb.to.ch}return l(Ec,Ed)};return{anchor:Ea(EY.sel.anchor),head:Ea(EY.sel.head)}}function Ch(EY,Ea,EZ){var EX={canceled:false,from:Ea.from,to:Ea.to,text:Ea.text,origin:Ea.origin,cancel:function(){this.canceled=true}};if(EZ){EX.update=function(Ee,Ed,Ec,Eb){if(Ee){this.from=EA(EY,Ee)}if(Ed){this.to=EA(EY,Ed)}if(Ec){this.text=Ec}if(Eb!==undefined){this.origin=Eb}}}AI(EY,"beforeChange",EY,EX);if(EY.cm){AI(EY.cm,"beforeChange",EY.cm,EX)}if(EX.canceled){return null}return{from:EX.from,to:EX.to,text:EX.text,origin:EX.origin}}function Ak(Ea,Ec,Eb,EZ){if(Ea.cm){if(!Ea.cm.curOp){return B9(Ea.cm,Ak)(Ea,Ec,Eb,EZ)}if(Ea.cm.state.suppressEdits){return }}if(Dq(Ea,"beforeChange")||Ea.cm&&Dq(Ea.cm,"beforeChange")){Ec=Ch(Ea,Ec,true);if(!Ec){return }}var EY=ER&&!EZ&&Bw(Ea,Ec.from,Ec.to);if(EY){for(var EX=EY.length-1;EX>=1;--EX){AQ(Ea,{from:EY[EX].from,to:EY[EX].to,text:[""]})}if(EY.length){AQ(Ea,{from:EY[0].from,to:EY[0].to,text:Ec.text},Eb)}}else{AQ(Ea,Ec,Eb)}}function AQ(EZ,Eb,Ea){if(Eb.text.length==1&&Eb.text[0]==""&&D9(Eb.from,Eb.to)){return }var EY=Dp(EZ,Eb,Ea);DJ(EZ,Eb,EY,EZ.cm?EZ.cm.curOp.id:NaN);Ct(EZ,Eb,EY,Cz(EZ,Eb));var EX=[];Co(EZ,function(Ed,Ec){if(!Ec&&CL(EX,Ed.history)==-1){Ca(Ed.history,Eb);EX.push(Ed.history)}Ct(Ed,Eb,null,Cz(Ed,Eb))})}function BS(Eg,Ed){if(Eg.cm&&Eg.cm.state.suppressEdits){return }var Ec=Eg.history;var EY=(Ed=="undo"?Ec.done:Ec.undone).pop();if(!EY){return }var Ee={changes:[],anchorBefore:EY.anchorAfter,headBefore:EY.headAfter,anchorAfter:EY.anchorBefore,headAfter:EY.headBefore,generation:Ec.generation};(Ed=="undo"?Ec.undone:Ec.done).push(Ee);Ec.generation=EY.generation||++Ec.maxGeneration;var EZ=Dq(Eg,"beforeChange")||Eg.cm&&Dq(Eg.cm,"beforeChange");for(var Ea=EY.changes.length-1;Ea>=0;--Ea){var Ef=EY.changes[Ea];Ef.origin=Ed;if(EZ&&!Ch(Eg,Ef,false)){(Ed=="undo"?Ec.done:Ec.undone).length=0;return }Ee.changes.push(CS(Eg,Ef));var EX=Ea?Dp(Eg,Ef,null):{anchor:EY.anchorBefore,head:EY.headBefore};Ct(Eg,Ef,EX,Cq(Eg,Ef));var Eb=[];Co(Eg,function(Ei,Eh){if(!Eh&&CL(Eb,Ei.history)==-1){Ca(Ei.history,Ef);Eb.push(Ei.history)}Ct(Ei,Ef,null,Cq(Ei,Ef))})}}function Ds(EX,EZ){function EY(Ea){return l(Ea.line+EZ,Ea.ch)}EX.first+=EZ;if(EX.cm){r(EX.cm,EX.first,EX.first,EZ)}EX.sel.head=EY(EX.sel.head);EX.sel.anchor=EY(EX.sel.anchor);EX.sel.from=EY(EX.sel.from);EX.sel.to=EY(EX.sel.to)}function Ct(Eb,Ec,Ea,EY){if(Eb.cm&&!Eb.cm.curOp){return B9(Eb.cm,Ct)(Eb,Ec,Ea,EY)}if(Ec.to.line<Eb.first){Ds(Eb,Ec.text.length-1-(Ec.to.line-Ec.from.line));return }if(Ec.from.line>Eb.lastLine()){return }if(Ec.from.line<Eb.first){var EX=Ec.text.length-1-(Eb.first-Ec.from.line);Ds(Eb,EX);Ec={from:l(Eb.first,0),to:l(Ec.to.line+EX,Ec.to.ch),text:[D8(Ec.text)],origin:Ec.origin}}var EZ=Eb.lastLine();if(Ec.to.line>EZ){Ec={from:Ec.from,to:l(EZ,Dk(Eb,EZ).text.length),text:[Ec.text[0]],origin:Ec.origin}}Ec.removed=EM(Eb,Ec.from,Ec.to);if(!Ea){Ea=Dp(Eb,Ec,null)}if(Eb.cm){AM(Eb.cm,Ec,EY,Ea)}else{D3(Eb,Ec,EY,Ea)}}function AM(Eh,Ed,Ea,EX){var Eg=Eh.doc,Ec=Eh.display,Ee=Ed.from,Ef=Ed.to;var EY=false,EZ=Ee.line;if(!Eh.options.lineWrapping){EZ=BC(V(Eg,Dk(Eg,Ee.line)));Eg.iter(EZ,Ef.line+1,function(Ek){if(Ek==Ec.maxLine){EY=true;return true}})}if(!Dl(Eg.sel.head,Ed.from)&&!Dl(Ed.to,Eg.sel.head)){Eh.curOp.cursorActivity=true}D3(Eg,Ed,Ea,EX,Ai(Eh));if(!Eh.options.lineWrapping){Eg.iter(EZ,Ee.line+Ed.text.length,function(El){var Ek=C1(Eg,El);if(Ek>Ec.maxLineLength){Ec.maxLine=El;Ec.maxLineLength=Ek;Ec.maxLineChanged=true;EY=false}});if(EY){Eh.curOp.updateMaxLine=true}}Eg.frontier=Math.min(Eg.frontier,Ee.line);Cv(Eh,400);var Ej=Ed.text.length-(Ef.line-Ee.line)-1;r(Eh,Ee.line,Ef.line+1,Ej);if(Dq(Eh,"change")){var Eb={from:Ee,to:Ef,text:Ed.text,removed:Ed.removed,origin:Ed.origin};if(Eh.curOp.textChanged){for(var Ei=Eh.curOp.textChanged;Ei.next;Ei=Ei.next){}Ei.next=Eb}else{Eh.curOp.textChanged=Eb}}}function AY(Ea,EZ,Ec,Eb,EX){if(!Eb){Eb=Ec}if(Dl(Eb,Ec)){var EY=Eb;Eb=Ec;Ec=EY}if(typeof EZ=="string"){EZ=AX(EZ)}Ak(Ea,{from:Ec,to:Eb,text:EZ,origin:EX},null)}function l(EX,EY){if(!(this instanceof l)){return new l(EX,EY)}this.line=EX;this.ch=EY}c.Pos=l;function D9(EY,EX){return EY.line==EX.line&&EY.ch==EX.ch}function Dl(EY,EX){return EY.line<EX.line||(EY.line==EX.line&&EY.ch<EX.ch)}function BZ(EY,EX){return EY.line-EX.line||EY.ch-EX.ch}function Bc(EX){return l(EX.line,EX.ch)}function CB(EX,EY){return Math.max(EX.first,Math.min(EY,EX.first+EX.size-1))}function EA(EY,EZ){if(EZ.line<EY.first){return l(EY.first,0)}var EX=EY.first+EY.size-1;if(EZ.line>EX){return l(EX,Dk(EY,EX).text.length)}return Dy(EZ,Dk(EY,EZ.line).text.length)}function Dy(EZ,EY){var EX=EZ.ch;if(EX==null||EX>EY){return l(EZ.line,EY)}else{if(EX<0){return l(EZ.line,0)}else{return EZ}}}function BT(EY,EX){return EX>=EY.first&&EX<EY.first+EY.size}function EH(Eb,Ec,EX,EY){if(Eb.sel.shift||Eb.sel.extend){var Ea=Eb.sel.anchor;if(EX){var EZ=Dl(Ec,Ea);if(EZ!=Dl(EX,Ea)){Ea=Ec;Ec=EX}else{if(EZ!=Dl(Ec,EX)){Ec=EX}}}BH(Eb,Ea,Ec,EY)}else{BH(Eb,Ec,EX||Ec,EY)}if(Eb.cm){Eb.cm.curOp.userSelChange=true}}function C(Ea,EX,EY){var EZ={anchor:EX,head:EY};AI(Ea,"beforeSelectionChange",Ea,EZ);if(Ea.cm){AI(Ea.cm,"beforeSelectionChange",Ea.cm,EZ)}EZ.anchor=EA(Ea,EZ.anchor);EZ.head=EA(Ea,EZ.head);return EZ}function BH(Ee,Eb,Ec,EZ,EY){if(!EY&&Dq(Ee,"beforeSelectionChange")||Ee.cm&&Dq(Ee.cm,"beforeSelectionChange")){var Ea=C(Ee,Eb,Ec);Ec=Ea.head;Eb=Ea.anchor}var Ed=Ee.sel;Ed.goalColumn=null;if(EZ==null){EZ=Dl(Ec,Ed.head)?-1:1}if(EY||!D9(Eb,Ed.anchor)){Eb=BI(Ee,Eb,EZ,EY!="push")}if(EY||!D9(Ec,Ed.head)){Ec=BI(Ee,Ec,EZ,EY!="push")}if(D9(Ed.anchor,Eb)&&D9(Ed.head,Ec)){return }Ed.anchor=Eb;Ed.head=Ec;var EX=Dl(Ec,Eb);Ed.from=EX?Ec:Eb;Ed.to=EX?Eb:Ec;if(Ee.cm){Ee.cm.curOp.updateInput=Ee.cm.curOp.selectionChanged=Ee.cm.curOp.cursorActivity=true}p(Ee,"cursorActivity",Ee)}function C8(EX){BH(EX.doc,EX.doc.sel.from,EX.doc.sel.to,null,"push")}function BI(Eg,Ef,Ec,Ed){var Eh=false,EZ=Ef;var Ea=Ec||1;Eg.cantEdit=false;search:for(;;){var Ei=Dk(Eg,EZ.line);if(Ei.markedSpans){for(var Eb=0;Eb<Ei.markedSpans.length;++Eb){var EX=Ei.markedSpans[Eb],EY=EX.marker;if((EX.from==null||(EY.inclusiveLeft?EX.from<=EZ.ch:EX.from<EZ.ch))&&(EX.to==null||(EY.inclusiveRight?EX.to>=EZ.ch:EX.to>EZ.ch))){if(Ed){AI(EY,"beforeCursorEnter");if(EY.explicitlyCleared){if(!Ei.markedSpans){break}else{--Eb;continue}}}if(!EY.atomic){continue}var Ee=EY.find()[Ea<0?"from":"to"];if(D9(Ee,EZ)){Ee.ch+=Ea;if(Ee.ch<0){if(Ee.line>Eg.first){Ee=EA(Eg,l(Ee.line-1))}else{Ee=null}}else{if(Ee.ch>Ei.text.length){if(Ee.line<Eg.first+Eg.size-1){Ee=l(Ee.line+1,0)}else{Ee=null}}}if(!Ee){if(Eh){if(!Ed){return BI(Eg,Ef,Ec,true)}Eg.cantEdit=true;return l(Eg.first,0)}Eh=true;Ee=Ef;Ea=-Ea}}EZ=Ee;continue search}}}return EZ}}function AF(EY){var Eb=Y(EY,EY.doc.sel.head,null,EY.options.cursorScrollMargin);if(!EY.state.focused){return }var Ec=EY.display,EZ=AO(Ec.sizer),EX=null;if(Eb.top+EZ.top<0){EX=true}else{if(Eb.bottom+EZ.top>(window.innerHeight||document.documentElement.clientHeight)){EX=false}}if(EX!=null&&!Dz){var Ea=EK("div","\u200b",null,"position: absolute; top: "+(Eb.top-Ec.viewOffset)+"px; height: "+(Eb.bottom-Eb.top+Ao)+"px; left: "+Eb.left+"px; width: 2px;");EY.display.lineSpace.appendChild(Ea);Ea.scrollIntoView(EX);EY.display.lineSpace.removeChild(Ea)}}function Y(Eg,Ee,Eb,Ea){if(Ea==null){Ea=0}for(;;){var Ec=false,Ef=Ci(Eg,Ee);var EX=!Eb||Eb==Ee?Ef:Ci(Eg,Eb);var EZ=b(Eg,Math.min(Ef.left,EX.left),Math.min(Ef.top,EX.top)-Ea,Math.max(Ef.left,EX.left),Math.max(Ef.bottom,EX.bottom)+Ea);var Ed=Eg.doc.scrollTop,EY=Eg.doc.scrollLeft;if(EZ.scrollTop!=null){g(Eg,EZ.scrollTop);if(Math.abs(Eg.doc.scrollTop-Ed)>1){Ec=true}}if(EZ.scrollLeft!=null){A3(Eg,EZ.scrollLeft);if(Math.abs(Eg.doc.scrollLeft-EY)>1){Ec=true}}if(!Ec){return Ef}}}function a(EX,EZ,Eb,EY,Ea){var Ec=b(EX,EZ,Eb,EY,Ea);if(Ec.scrollTop!=null){g(EX,Ec.scrollTop)}if(Ec.scrollLeft!=null){A3(EX,Ec.scrollLeft)}}function b(Ed,El,Ea,Ek,EZ){var Ei=Ed.display,Eh=AV(Ed.display);if(Ea<0){Ea=0}var EY=Ei.scroller.clientHeight-Ao,Eg=Ei.scroller.scrollTop,Ef={};var En=Ed.doc.height+A7(Ei);var Eo=Ea<Eh,Ej=EZ>En-Eh;if(Ea<Eg){Ef.scrollTop=Eo?0:Ea}else{if(EZ>Eg+EY){var Ee=Math.min(Ea,(Ej?En:EZ)-EY);if(Ee!=Eg){Ef.scrollTop=Ee}}}var Ec=Ei.scroller.clientWidth-Ao,EX=Ei.scroller.scrollLeft;El+=Ei.gutters.offsetWidth;Ek+=Ei.gutters.offsetWidth;var Eb=Ei.gutters.offsetWidth;var Em=El<Eb+10;if(El<EX+Eb||Em){if(Em){El=0}Ef.scrollLeft=Math.max(0,El-10-Eb)}else{if(Ek>Ec+EX-3){Ef.scrollLeft=Ek+10-Ec}}return Ef}function Z(EX,EZ,EY){EX.curOp.updateScrollPos={scrollLeft:EZ==null?EX.doc.scrollLeft:EZ,scrollTop:EY==null?EX.doc.scrollTop:EY}}function B0(EY,Ea,EZ){var Eb=EY.curOp.updateScrollPos||(EY.curOp.updateScrollPos={scrollLeft:EY.doc.scrollLeft,scrollTop:EY.doc.scrollTop});var EX=EY.display.scroller;Eb.scrollTop=Math.max(0,Math.min(EX.scrollHeight-EX.clientHeight,Eb.scrollTop+EZ));Eb.scrollLeft=Math.max(0,Math.min(EX.scrollWidth-EX.clientWidth,Eb.scrollLeft+Ea))}function o(Ej,Ea,Ei,EZ){var Eh=Ej.doc,EY;if(Ei==null){Ei="add"}if(Ei=="smart"){if(!Ej.doc.mode.indent){Ei="prev"}else{EY=CX(Ej,Ea)}}var Ed=Ej.options.tabSize;var Ek=Dk(Eh,Ea),Ec=BG(Ek.text,null,Ed);if(Ek.stateAfter){Ek.stateAfter=null}var EX=Ek.text.match(/^\s*/)[0],Ef;if(!EZ&&!/\S/.test(Ek.text)){Ef=0;Ei="not"}else{if(Ei=="smart"){Ef=Ej.doc.mode.indent(EY,Ek.text.slice(EX.length),Ek.text);if(Ef==BV){if(!EZ){return }Ei="prev"}}}if(Ei=="prev"){if(Ea>Eh.first){Ef=BG(Dk(Eh,Ea-1).text,null,Ed)}else{Ef=0}}else{if(Ei=="add"){Ef=Ec+Ej.options.indentUnit}else{if(Ei=="subtract"){Ef=Ec-Ej.options.indentUnit}else{if(typeof Ei=="number"){Ef=Ec+Ei}}}}Ef=Math.max(0,Ef);var Eg="",Ee=0;if(Ej.options.indentWithTabs){for(var Eb=Math.floor(Ef/Ed);Eb;--Eb){Ee+=Ed;Eg+="\t"}}if(Ee<Ef){Eg+=Bj(Ef-Ee)}if(Eg!=EX){AY(Ej.doc,Eg,l(Ea,0),l(Ea,EX.length),"+input")}else{if(Eh.sel.head.line==Ea&&Eh.sel.head.ch<EX.length){BH(Eh,l(Ea,EX.length),l(Ea,EX.length),1)}}Ek.stateAfter=null}function DA(EX,EZ,Ec){var Eb=EZ,EY=EZ,Ea=EX.doc;if(typeof EZ=="number"){EY=Dk(Ea,CB(Ea,EZ))}else{Eb=BC(EZ)}if(Eb==null){return null}if(Ec(EY,Eb)){r(EX,Eb,Eb+1)}else{return null}return EY}function Az(Eo,Ea,Ei,Eh,Ec){var Ef=Ea.line,Eg=Ea.ch,En=Ei;var EX=Dk(Eo,Ef);var El=true;function Em(){var Ep=Ef+Ei;if(Ep<Eo.first||Ep>=Eo.first+Eo.size){return(El=false)}Ef=Ep;return EX=Dk(Eo,Ep)}function Ek(Eq){var Ep=(Ec?R:s)(EX,Eg,Ei,true);if(Ep==null){if(!Eq&&Em()){if(Ec){Eg=(Ei<0?B4:Bu)(EX)}else{Eg=Ei<0?EX.text.length:0}}else{return(El=false)}}else{Eg=Ep}return true}if(Eh=="char"){Ek()}else{if(Eh=="column"){Ek(true)}else{if(Eh=="word"||Eh=="group"){var Ej=null,Ed=Eh=="group";for(var Eb=true;;Eb=false){if(Ei<0&&!Ek(!Eb)){break}var EY=EX.text.charAt(Eg)||"\n";var EZ=Br(EY)?"w":Ed&&EY=="\n"?"n":!Ed||/\s/.test(EY)?null:"p";if(Ed&&!Eb&&!EZ){EZ="s"}if(Ej&&Ej!=EZ){if(Ei<0){Ei=1;Ek()}break}if(EZ){Ej=EZ}if(Ei>0&&!Ek(!Eb)){break}}}}}var Ee=BI(Eo,l(Ef,Eg),En,true);if(!El){Ee.hitSide=true}return Ee}function Av(Ef,Ea,EX,Ee){var Ed=Ef.doc,Ec=Ea.left,Eb;if(Ee=="page"){var EZ=Math.min(Ef.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);Eb=Ea.top+EX*(EZ-(EX<0?1.5:0.5)*AV(Ef.display))}else{if(Ee=="line"){Eb=EX>0?Ea.bottom+3:Ea.top-3}}for(;;){var EY=EE(Ef,Ec,Eb);if(!EY.outside){break}if(EX<0?Eb<=0:Eb>=Ed.height){EY.hitSide=true;break}Eb+=EX*5}return EY}function AC(Ea,Ec){var Eb=Ec.ch,EZ=Ec.ch;if(Ea){if((Ec.xRel<0||EZ==Ea.length)&&Eb){--Eb}else{++EZ}var EY=Ea.charAt(Eb);var EX=Br(EY)?Br:/\s/.test(EY)?function(Ed){return/\s/.test(Ed)}:function(Ed){return !/\s/.test(Ed)&&!Br(Ed)};while(Eb>0&&EX(Ea.charAt(Eb-1))){--Eb}while(EZ<Ea.length&&EX(Ea.charAt(EZ))){++EZ}}return{from:l(Ec.line,Eb),to:l(Ec.line,EZ)}}function Aq(EX,EY){EH(EX.doc,l(EY,0),EA(EX.doc,l(EY+1,0)))}c.prototype={constructor:c,focus:function(){window.focus();DC(this);X(this)},setOption:function(EZ,Ea){var EY=this.options,EX=EY[EZ];if(EY[EZ]==Ea&&EZ!="mode"){return }EY[EZ]=Ea;if(Aj.hasOwnProperty(EZ)){B9(this,Aj[EZ])(this,Ea,EX)}},getOption:function(EX){return this.options[EX]},getDoc:function(){return this.doc},addKeyMap:function(EY,EX){this.state.keyMaps[EX?"push":"unshift"](EY)},removeKeyMap:function(EY){var EZ=this.state.keyMaps;for(var EX=0;EX<EZ.length;++EX){if(EZ[EX]==EY||(typeof EZ[EX]!="string"&&EZ[EX].name==EY)){EZ.splice(EX,1);return true}}},addOverlay:B9(null,function(EX,EY){var EZ=EX.token?EX:c.getMode(this.options,EX);if(EZ.startState){throw new Error("Overlays may not be stateful.")}this.state.overlays.push({mode:EZ,modeSpec:EX,opaque:EY&&EY.opaque});this.state.modeGen++;r(this)}),removeOverlay:B9(null,function(EX){var EZ=this.state.overlays;for(var EY=0;EY<EZ.length;++EY){var Ea=EZ[EY].modeSpec;if(Ea==EX||typeof EX=="string"&&Ea.name==EX){EZ.splice(EY,1);this.state.modeGen++;r(this);return }}}),indentLine:B9(null,function(EZ,EX,EY){if(typeof EX!="string"&&typeof EX!="number"){if(EX==null){EX=this.options.smartIndent?"smart":"prev"}else{EX=EX?"add":"subtract"}}if(BT(this.doc,EZ)){o(this,EZ,EX,EY)}}),indentSelection:B9(null,function(EY){var EZ=this.doc.sel;if(D9(EZ.from,EZ.to)){return o(this,EZ.from.line,EY,true)}var Ea=EZ.to.line-(EZ.to.ch?0:1);for(var EX=EZ.from.line;EX<=Ea;++EX){o(this,EX,EY)}}),getTokenAt:function(Ee,EY){var Eb=this.doc;Ee=EA(Eb,Ee);var Ea=CX(this,Ee.line,EY),Ed=this.doc.mode;var EX=Dk(Eb,Ee.line);var Ec=new DS(EX.text,this.options.tabSize);while(Ec.pos<Ee.ch&&!Ec.eol()){Ec.start=Ec.pos;var EZ=Ed.token(Ec,Ea)}return{start:Ec.start,end:Ec.pos,string:Ec.current(),className:EZ||null,type:EZ||null,state:Ea}},getTokenTypeAt:function(Ec){Ec=EA(this.doc,Ec);var EZ=CD(this,Dk(this.doc,Ec.line));var Ea=0,Eb=(EZ.length-1)/2,EY=Ec.ch;if(EY==0){return EZ[2]}for(;;){var EX=(Ea+Eb)>>1;if((EX?EZ[EX*2-1]:0)>=EY){Eb=EX}else{if(EZ[EX*2+1]<EY){Ea=EX+1}else{return EZ[EX*2+2]}}}},getModeAt:function(EY){var EX=this.doc.mode;if(!EX.innerMode){return EX}return c.innerMode(EX,this.getTokenAt(EY).state).mode},getHelper:function(EY,EX){return this.getHelpers(EY,EX)[0]},getHelpers:function(Ee,EZ){var Ea=[];if(!Dt.hasOwnProperty(EZ)){return Dt}var EX=Dt[EZ],Ed=this.getModeAt(Ee);if(typeof Ed[EZ]=="string"){if(EX[Ed[EZ]]){Ea.push(EX[Ed[EZ]])}}else{if(Ed[EZ]){for(var EY=0;EY<Ed[EZ].length;EY++){var Ec=EX[Ed[EZ][EY]];if(Ec){Ea.push(Ec)}}}else{if(Ed.helperType&&EX[Ed.helperType]){Ea.push(EX[Ed.helperType])}else{if(EX[Ed.name]){Ea.push(EX[Ed.name])}}}}for(var EY=0;EY<EX._global.length;EY++){var Eb=EX._global[EY];if(Eb.pred(Ed,this)&&CL(Ea,Eb.val)==-1){Ea.push(Eb.val)}}return Ea},getStateAfter:function(EY,EX){var EZ=this.doc;EY=CB(EZ,EY==null?EZ.first+EZ.size-1:EY);return CX(this,EY+1,EX)},cursorCoords:function(Ea,EY){var EZ,EX=this.doc.sel;if(Ea==null){EZ=EX.head}else{if(typeof Ea=="object"){EZ=EA(this.doc,Ea)}else{EZ=Ea?EX.from:EX.to}}return Ci(this,EZ,EY||"page")},charCoords:function(EY,EX){return Bz(this,EA(this.doc,EY),EX||"page")},coordsChar:function(EX,EY){EX=ET(this,EX,EY||"page");return EE(this,EX.left,EX.top)},lineAtHeight:function(EX,EY){EX=ET(this,{top:EX,left:0},EY||"page").top;return A5(this.doc,EX+this.display.viewOffset)},heightAtLine:function(EY,Eb){var EX=false,Ea=this.doc.first+this.doc.size-1;if(EY<this.doc.first){EY=this.doc.first}else{if(EY>Ea){EY=Ea;EX=true}}var EZ=Dk(this.doc,EY);return DP(this,Dk(this.doc,EY),{top:0,left:0},Eb||"page").top+(EX?EZ.height:0)},defaultTextHeight:function(){return AV(this.display)},defaultCharWidth:function(){return CZ(this.display)},setGutterMarker:B9(null,function(EX,EY,EZ){return DA(this,EX,function(Ea){var Eb=Ea.gutterMarkers||(Ea.gutterMarkers={});Eb[EY]=EZ;if(!EZ&&DT(Eb)){Ea.gutterMarkers=null}return true})}),clearGutter:B9(null,function(EZ){var EX=this,Ea=EX.doc,EY=Ea.first;Ea.iter(function(Eb){if(Eb.gutterMarkers&&Eb.gutterMarkers[EZ]){Eb.gutterMarkers[EZ]=null;r(EX,EY,EY+1);if(DT(Eb.gutterMarkers)){Eb.gutterMarkers=null}}++EY})}),addLineClass:B9(null,function(EZ,EY,EX){return DA(this,EZ,function(Ea){var Eb=EY=="text"?"textClass":EY=="background"?"bgClass":"wrapClass";if(!Ea[Eb]){Ea[Eb]=EX}else{if(new RegExp("(?:^|\\s)"+EX+"(?:$|\\s)").test(Ea[Eb])){return false}else{Ea[Eb]+=" "+EX}}return true})}),removeLineClass:B9(null,function(EZ,EY,EX){return DA(this,EZ,function(Eb){var Ee=EY=="text"?"textClass":EY=="background"?"bgClass":"wrapClass";var Ed=Eb[Ee];if(!Ed){return false}else{if(EX==null){Eb[Ee]=null}else{var Ec=Ed.match(new RegExp("(?:^|\\s+)"+EX+"(?:$|\\s+)"));if(!Ec){return false}var Ea=Ec.index+Ec[0].length;Eb[Ee]=Ed.slice(0,Ec.index)+(!Ec.index||Ea==Ed.length?"":" ")+Ed.slice(Ea)||null}}return true})}),addLineWidget:B9(null,function(EZ,EY,EX){return A6(this,EZ,EY,EX)}),removeLineWidget:function(EX){EX.clear()},lineInfo:function(EX){if(typeof EX=="number"){if(!BT(this.doc,EX)){return null}var EY=EX;EX=Dk(this.doc,EX);if(!EX){return null}}else{var EY=BC(EX);if(EY==null){return null}}return{line:EY,handle:EX,text:EX.text,gutterMarkers:EX.gutterMarkers,textClass:EX.textClass,bgClass:EX.bgClass,wrapClass:EX.wrapClass,widgets:EX.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(Ec,EZ,Ee,Ea,Eg){var Eb=this.display;Ec=Ci(this,EA(this.doc,Ec));var Ed=Ec.bottom,EY=Ec.left;EZ.style.position="absolute";Eb.sizer.appendChild(EZ);if(Ea=="over"){Ed=Ec.top}else{if(Ea=="above"||Ea=="near"){var EX=Math.max(Eb.wrapper.clientHeight,this.doc.height),Ef=Math.max(Eb.sizer.clientWidth,Eb.lineSpace.clientWidth);if((Ea=="above"||Ec.bottom+EZ.offsetHeight>EX)&&Ec.top>EZ.offsetHeight){Ed=Ec.top-EZ.offsetHeight}else{if(Ec.bottom+EZ.offsetHeight<=EX){Ed=Ec.bottom}}if(EY+EZ.offsetWidth>Ef){EY=Ef-EZ.offsetWidth}}}EZ.style.top=Ed+"px";EZ.style.left=EZ.style.right="";if(Eg=="right"){EY=Eb.sizer.clientWidth-EZ.offsetWidth;EZ.style.right="0px"}else{if(Eg=="left"){EY=0}else{if(Eg=="middle"){EY=(Eb.sizer.clientWidth-EZ.offsetWidth)/2}}EZ.style.left=EY+"px"}if(Ee){a(this,EY,Ed,EY+EZ.offsetWidth,Ed+EZ.offsetHeight)}},triggerOnKeyDown:B9(null,M),triggerOnKeyPress:B9(null,Bp),triggerOnKeyUp:B9(null,Am),execCommand:function(EX){if(DE.hasOwnProperty(EX)){return DE[EX](this)}},findPosH:function(Ed,Ea,Eb,EY){var EX=1;if(Ea<0){EX=-1;Ea=-Ea}for(var EZ=0,Ec=EA(this.doc,Ed);EZ<Ea;++EZ){Ec=Az(this.doc,Ec,EX,Eb,EY);if(Ec.hitSide){break}}return Ec},moveH:B9(null,function(EX,EY){var EZ=this.doc.sel,Ea;if(EZ.shift||EZ.extend||D9(EZ.from,EZ.to)){Ea=Az(this.doc,EZ.head,EX,EY,this.options.rtlMoveVisually)}else{Ea=EX<0?EZ.from:EZ.to}EH(this.doc,Ea,Ea,EX)}),deleteH:B9(null,function(EX,EY){var EZ=this.doc.sel;if(!D9(EZ.from,EZ.to)){AY(this.doc,"",EZ.from,EZ.to,"+delete")}else{AY(this.doc,"",EZ.from,Az(this.doc,EZ.head,EX,EY,false),"+delete")}this.curOp.userSelChange=true}),findPosV:function(Ec,EZ,Ed,Ef){var EX=1,Eb=Ef;if(EZ<0){EX=-1;EZ=-EZ}for(var EY=0,Ee=EA(this.doc,Ec);EY<EZ;++EY){var Ea=Ci(this,Ee,"div");if(Eb==null){Eb=Ea.left}else{Ea.left=Eb}Ee=Av(this,Ea,EX,Ed);if(Ee.hitSide){break}}return Ee},moveV:B9(null,function(EY,EZ){var Ea=this.doc.sel,Eb,EX;if(Ea.shift||Ea.extend||D9(Ea.from,Ea.to)){var Ec=Ci(this,Ea.head,"div");if(Ea.goalColumn!=null){Ec.left=Ea.goalColumn}Eb=Av(this,Ec,EY,EZ);if(EZ=="page"){B0(this,0,Bz(this,Eb,"div").top-Ec.top)}EX=Ec.left}else{Eb=EY<0?Ea.from:Ea.to}EH(this.doc,Eb,Eb,EY);if(EX!=null){Ea.goalColumn=EX}}),toggleOverwrite:function(EX){if(EX!=null&&EX==this.state.overwrite){return }if(this.state.overwrite=!this.state.overwrite){this.display.cursor.className+=" CodeMirror-overwrite"}else{this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite","")}AI(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return document.activeElement==this.display.input},scrollTo:B9(null,function(EX,EY){Z(this,EX,EY)}),getScrollInfo:function(){var EX=this.display.scroller,EY=Ao;return{left:EX.scrollLeft,top:EX.scrollTop,height:EX.scrollHeight-EY,width:EX.scrollWidth-EY,clientHeight:EX.clientHeight-EY,clientWidth:EX.clientWidth-EY}},scrollIntoView:B9(null,function(EY,Ea){if(EY==null){EY={from:this.doc.sel.head,to:null}}else{if(typeof EY=="number"){EY={from:l(EY,0),to:null}}else{if(EY.from==null){EY={from:EY,to:null}}}}if(!EY.to){EY.to=EY.from}if(!Ea){Ea=0}var EZ=EY;if(EY.from.line!=null){this.curOp.scrollToPos={from:EY.from,to:EY.to,margin:Ea};EZ={from:Ci(this,EY.from),to:Ci(this,EY.to)}}var EX=b(this,Math.min(EZ.from.left,EZ.to.left),Math.min(EZ.from.top,EZ.to.top)-Ea,Math.max(EZ.from.right,EZ.to.right),Math.max(EZ.from.bottom,EZ.to.bottom)+Ea);Z(this,EX.scrollLeft,EX.scrollTop)}),setSize:B9(null,function(EZ,EX){function EY(Ea){return typeof Ea=="number"||/^\d+$/.test(String(Ea))?Ea+"px":Ea}if(EZ!=null){this.display.wrapper.style.width=EY(EZ)}if(EX!=null){this.display.wrapper.style.height=EY(EX)}if(this.options.lineWrapping){this.display.measureLineCache.length=this.display.measureLineCachePos=0}this.curOp.forceUpdate=true;AI(this,"refresh",this)}),operation:function(EX){return B1(this,EX)},refresh:B9(null,function(){var EX=this.display.cachedTextHeight;u(this);Z(this,this.doc.scrollLeft,this.doc.scrollTop);r(this);if(EX==null||Math.abs(EX-AV(this.display))>0.5){m(this)}AI(this,"refresh",this)}),swapDoc:B9(null,function(EY){var EX=this.doc;EX.cm=null;Cr(this,EY);u(this);Dv(this,true);Z(this,EY.scrollLeft,EY.scrollTop);p(this,"swapDoc",this,EX);return EX}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};A0(c);var Aj=c.optionHandlers={};var Da=c.defaults={};function P(EX,Ea,EZ,EY){c.defaults[EX]=Ea;if(EZ){Aj[EX]=EY?function(Eb,Ed,Ec){if(Ec!=BW){EZ(Eb,Ed,Ec)}}:EZ}}var BW=c.Init={toString:function(){return"CodeMirror.Init"}};P("value","",function(EX,EY){EX.setValue(EY)},true);P("mode",null,function(EX,EY){EX.doc.modeOption=EY;Aw(EX)},true);P("indentUnit",2,Aw,true);P("indentWithTabs",false);P("smartIndent",true);P("tabSize",4,function(EX){C0(EX);u(EX);r(EX)},true);P("specialChars",/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(EX,EY){EX.options.specialChars=new RegExp(EY.source+(EY.test("\t")?"":"|\t"),"g");EX.refresh()},true);P("specialCharPlaceholder",Di,function(EX){EX.refresh()},true);P("electricChars",true);P("rtlMoveVisually",!AP);P("wholeLineUpdateBefore",true);P("theme","default",function(EX){B2(EX);CT(EX)},true);P("keyMap","default",EU);P("extraKeys",null);P("onKeyEvent",null);P("onDragEvent",null);P("lineWrapping",false,DK,true);P("gutters",[],function(EX){BY(EX.options);CT(EX)},true);P("fixedGutter",true,function(EX,EY){EX.display.gutters.style.left=EY?Ck(EX.display)+"px":"0";EX.refresh()},true);P("coverGutterNextToScrollbar",false,DW,true);P("lineNumbers",false,function(EX){BY(EX.options);CT(EX)},true);P("firstLineNumber",1,CT,true);P("lineNumberFormatter",function(EX){return EX},CT,true);P("showCursorWhenSelecting",false,A2,true);P("resetSelectionOnContextMenu",true);P("readOnly",false,function(EX,EY){if(EY=="nocursor"){AU(EX);EX.display.input.blur();EX.display.disabled=true}else{EX.display.disabled=false;if(!EY){Dv(EX,true)}}});P("disableInput",false,function(EX,EY){if(!EY){Dv(EX,true)}},true);P("dragDrop",true);P("cursorBlinkRate",530);P("cursorScrollMargin",0);P("cursorHeight",1);P("workTime",100);P("workDelay",100);P("flattenSpans",true,C0,true);P("addModeClass",false,C0,true);P("pollInterval",100);P("undoDepth",40,function(EX,EY){EX.doc.history.undoDepth=EY});P("historyEventDelay",500);P("viewportMargin",10,function(EX){EX.refresh()},true);P("maxHighlightLength",10000,C0,true);P("crudeMeasuringFrom",10000);P("moveInputWithCursor",true,function(EX,EY){if(!EY){EX.display.inputDiv.style.top=EX.display.inputDiv.style.left=0}});P("tabindex",null,function(EX,EY){EX.display.input.tabIndex=EY||""});P("autofocus",null);var CQ=c.modes={},AT=c.mimeModes={};c.defineMode=function(EX,EZ){if(!c.defaults.mode&&EX!="null"){c.defaults.mode=EX}if(arguments.length>2){EZ.dependencies=[];for(var EY=2;EY<arguments.length;++EY){EZ.dependencies.push(arguments[EY])}}CQ[EX]=EZ};c.defineMIME=function(EY,EX){AT[EY]=EX};c.resolveMode=function(EX){if(typeof EX=="string"&&AT.hasOwnProperty(EX)){EX=AT[EX]}else{if(EX&&typeof EX.name=="string"&&AT.hasOwnProperty(EX.name)){var EY=AT[EX.name];if(typeof EY=="string"){EY={name:EY}}EX=Bd(EY,EX);EX.name=EY.name}else{if(typeof EX=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(EX)){return c.resolveMode("application/xml")}}}if(typeof EX=="string"){return{name:EX}}else{return EX||{name:"null"}}};c.getMode=function(EY,EX){var EX=c.resolveMode(EX);var Ea=CQ[EX.name];if(!Ea){return c.getMode(EY,"text/plain")}var Eb=Ea(EY,EX);if(CO.hasOwnProperty(EX.name)){var EZ=CO[EX.name];for(var Ec in EZ){if(!EZ.hasOwnProperty(Ec)){continue}if(Eb.hasOwnProperty(Ec)){Eb["_"+Ec]=Eb[Ec]}Eb[Ec]=EZ[Ec]}}Eb.name=EX.name;if(EX.helperType){Eb.helperType=EX.helperType}if(EX.modeProps){for(var Ec in EX.modeProps){Eb[Ec]=EX.modeProps[Ec]}}return Eb};c.defineMode("null",function(){return{token:function(EX){EX.skipToEnd()}}});c.defineMIME("text/plain","null");var CO=c.modeExtensions={};c.extendMode=function(EZ,EY){var EX=CO.hasOwnProperty(EZ)?CO[EZ]:(CO[EZ]={});AN(EY,EX)};c.defineExtension=function(EX,EY){c.prototype[EX]=EY};c.defineDocExtension=function(EX,EY){AB.prototype[EX]=EY};c.defineOption=P;var Ad=[];c.defineInitHook=function(EX){Ad.push(EX)};var Dt=c.helpers={};c.registerHelper=function(EY,EX,EZ){if(!Dt.hasOwnProperty(EY)){Dt[EY]=c[EY]={_global:[]}}Dt[EY][EX]=EZ};c.registerGlobalHelper=function(EZ,EY,EX,Ea){c.registerHelper(EZ,EY,Ea);Dt[EZ]._global.push({pred:EX,val:Ea})};c.isWordChar=Br;function BO(Ea,EX){if(EX===true){return EX}if(Ea.copyState){return Ea.copyState(EX)}var EZ={};for(var Eb in EX){var EY=EX[Eb];if(EY instanceof Array){EY=EY.concat([])}EZ[Eb]=EY}return EZ}c.copyState=BO;function BM(EZ,EY,EX){return EZ.startState?EZ.startState(EY,EX):true}c.startState=BM;c.innerMode=function(EZ,EX){while(EZ.innerMode){var EY=EZ.innerMode(EX);if(!EY||EY.mode==EZ){break}EX=EY.state;EZ=EY.mode}return EY||{mode:EZ,state:EX}};var DE=c.commands={selectAll:function(EX){EX.setSelection(l(EX.firstLine(),0),l(EX.lastLine()))},killLine:function(EX){var Ea=EX.getCursor(true),EZ=EX.getCursor(false),EY=!D9(Ea,EZ);if(!EY&&EX.getLine(Ea.line).length==Ea.ch){EX.replaceRange("",Ea,l(Ea.line+1,0),"+delete")}else{EX.replaceRange("",Ea,EY?EZ:l(Ea.line),"+delete")}},deleteLine:function(EX){var EY=EX.getCursor().line;EX.replaceRange("",l(EY,0),l(EY+1,0),"+delete")},delLineLeft:function(EX){var EY=EX.getCursor();EX.replaceRange("",l(EY.line,0),EY,"+delete")},undo:function(EX){EX.undo()},redo:function(EX){EX.redo()},goDocStart:function(EX){EX.extendSelection(l(EX.firstLine(),0))},goDocEnd:function(EX){EX.extendSelection(l(EX.lastLine()))},goLineStart:function(EX){EX.extendSelection(Ay(EX,EX.getCursor().line))},goLineStartSmart:function(EY){var Ec=EY.getCursor(),Ed=Ay(EY,Ec.line);var EZ=EY.getLineHandle(Ed.line);var EX=A(EZ);if(!EX||EX[0].level==0){var Eb=Math.max(0,EZ.text.search(/\S/));var Ea=Ec.line==Ed.line&&Ec.ch<=Eb&&Ec.ch;EY.extendSelection(l(Ed.line,Ea?0:Eb))}else{EY.extendSelection(Ed)}},goLineEnd:function(EX){EX.extendSelection(Cf(EX,EX.getCursor().line))},goLineRight:function(EX){var EY=EX.charCoords(EX.getCursor(),"div").top+5;EX.extendSelection(EX.coordsChar({left:EX.display.lineDiv.offsetWidth+100,top:EY},"div"))},goLineLeft:function(EX){var EY=EX.charCoords(EX.getCursor(),"div").top+5;EX.extendSelection(EX.coordsChar({left:0,top:EY},"div"))},goLineUp:function(EX){EX.moveV(-1,"line")},goLineDown:function(EX){EX.moveV(1,"line")},goPageUp:function(EX){EX.moveV(-1,"page")},goPageDown:function(EX){EX.moveV(1,"page")},goCharLeft:function(EX){EX.moveH(-1,"char")},goCharRight:function(EX){EX.moveH(1,"char")},goColumnLeft:function(EX){EX.moveH(-1,"column")},goColumnRight:function(EX){EX.moveH(1,"column")},goWordLeft:function(EX){EX.moveH(-1,"word")},goGroupRight:function(EX){EX.moveH(1,"group")},goGroupLeft:function(EX){EX.moveH(-1,"group")},goWordRight:function(EX){EX.moveH(1,"word")},delCharBefore:function(EX){EX.deleteH(-1,"char")},delCharAfter:function(EX){EX.deleteH(1,"char")},delWordBefore:function(EX){EX.deleteH(-1,"word")},delWordAfter:function(EX){EX.deleteH(1,"word")},delGroupBefore:function(EX){EX.deleteH(-1,"group")},delGroupAfter:function(EX){EX.deleteH(1,"group")},indentAuto:function(EX){EX.indentSelection("smart")},indentMore:function(EX){EX.indentSelection("add")},indentLess:function(EX){EX.indentSelection("subtract")},insertTab:function(EX){EX.replaceSelection("\t","end","+input")},defaultTab:function(EX){if(EX.somethingSelected()){EX.indentSelection("add")}else{EX.replaceSelection("\t","end","+input")}},transposeChars:function(EX){var EZ=EX.getCursor(),EY=EX.getLine(EZ.line);if(EZ.ch>0&&EZ.ch<EY.length-1){EX.replaceRange(EY.charAt(EZ.ch)+EY.charAt(EZ.ch-1),l(EZ.line,EZ.ch-1),l(EZ.line,EZ.ch+1))}},newlineAndIndent:function(EX){B9(EX,function(){EX.replaceSelection("\n","end","+input");EX.indentLine(EX.getCursor().line,null,true)})()},toggleOverwrite:function(EX){EX.toggleOverwrite()}};var Dg=c.keyMap={};Dg.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"};Dg.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"};Dg.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft",fallthrough:["basic","emacsy"]};Dg["default"]=BQ?Dg.macDefault:Dg.pcDefault;Dg.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};function EI(EX){if(typeof EX=="string"){return Dg[EX]}else{return EX}}function G(EY,Ec,Ea){function Eb(Ei){Ei=EI(Ei);var Eg=Ei[EY];if(Eg===false){return"stop"}if(Eg!=null&&Ea(Eg)){return true}if(Ei.nofallthrough){return"stop"}var Ef=Ei.fallthrough;if(Ef==null){return false}if(Object.prototype.toString.call(Ef)!="[object Array]"){return Eb(Ef)}for(var Ee=0,Eh=Ef.length;Ee<Eh;++Ee){var Ed=Eb(Ef[Ee]);if(Ed){return Ed}}return false}for(var EZ=0;EZ<Ec.length;++EZ){var EX=Eb(Ec[EZ]);if(EX){return EX!="stop"}}}function DD(EY){var EX=Dm[EY.keyCode];return EX=="Ctrl"||EX=="Alt"||EX=="Shift"||EX=="Mod"}function Dx(EY,EZ){if(D2&&EY.keyCode==34&&EY["char"]){return false}var EX=Dm[EY.keyCode];if(EX==null||EY.altGraphKey){return false}if(EY.altKey){EX="Alt-"+EX}if(BE?EY.metaKey:EY.ctrlKey){EX="Ctrl-"+EX}if(BE?EY.ctrlKey:EY.metaKey){EX="Cmd-"+EX}if(!EZ&&EY.shiftKey){EX="Shift-"+EX}return EX}c.lookupKey=G;c.isModifierKey=DD;c.keyName=Dx;c.fromTextArea=function(Ee,Ef){if(!Ef){Ef={}}Ef.value=Ee.value;if(!Ef.tabindex&&Ee.tabindex){Ef.tabindex=Ee.tabindex}if(!Ef.placeholder&&Ee.placeholder){Ef.placeholder=Ee.placeholder}if(Ef.autofocus==null){var EX=document.body;try{EX=document.activeElement}catch(EZ){}Ef.autofocus=EX==Ee||Ee.getAttribute("autofocus")!=null&&EX==document.body}function Eb(){Ee.value=Ed.getValue()}if(Ee.form){BK(Ee.form,"submit",Eb);if(!Ef.leaveSubmitMethodAlone){var EY=Ee.form,Ec=EY.submit;try{var Ea=EY.submit=function(){Eb();EY.submit=Ec;EY.submit();EY.submit=Ea}}catch(EZ){}}}Ee.style.display="none";var Ed=c(function(Eg){Ee.parentNode.insertBefore(Eg,Ee.nextSibling)},Ef);Ed.save=Eb;Ed.getTextArea=function(){return Ee};Ed.toTextArea=function(){Eb();Ee.parentNode.removeChild(Ed.getWrapperElement());Ee.style.display="";if(Ee.form){Cu(Ee.form,"submit",Eb);if(typeof Ee.form.submit=="function"){Ee.form.submit=Ec}}};return Ed};function DS(EX,EY){this.pos=this.start=0;this.string=EX;this.tabSize=EY||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0}DS.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}},eat:function(EX){var EZ=this.string.charAt(this.pos);if(typeof EX=="string"){var EY=EZ==EX}else{var EY=EZ&&(EX.test?EX.test(EZ):EX(EZ))}if(EY){++this.pos;return EZ}},eatWhile:function(EX){var EY=this.pos;while(this.eat(EX)){}return this.pos>EY},eatSpace:function(){var EX=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>EX},skipToEnd:function(){this.pos=this.string.length},skipTo:function(EX){var EY=this.string.indexOf(EX,this.pos);if(EY>-1){this.pos=EY;return true}},backUp:function(EX){this.pos-=EX},column:function(){if(this.lastColumnPos<this.start){this.lastColumnValue=BG(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?BG(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return BG(this.string,null,this.tabSize)-(this.lineStart?BG(this.string,this.lineStart,this.tabSize):0)},match:function(Eb,EY,EX){if(typeof Eb=="string"){var Ec=function(Ed){return EX?Ed.toLowerCase():Ed};var Ea=this.string.substr(this.pos,Eb.length);if(Ec(Ea)==Ec(Eb)){if(EY!==false){this.pos+=Eb.length}return true}}else{var EZ=this.string.slice(this.pos).match(Eb);if(EZ&&EZ.index>0){return null}if(EZ&&EY!==false){this.pos+=EZ[0].length}return EZ}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(EY,EX){this.lineStart+=EY;try{return EX()}finally{this.lineStart-=EY}}};c.StringStream=DS;function i(EY,EX){this.lines=[];this.type=EX;this.doc=EY}c.TextMarker=i;A0(i);i.prototype.clear=function(){if(this.explicitlyCleared){return }var Ee=this.doc.cm,EY=Ee&&!Ee.curOp;if(EY){By(Ee)}if(Dq(this,"clear")){var Ef=this.find();if(Ef){p(this,"clear",Ef.from,Ef.to)}}var EZ=null,Ec=null;for(var Ea=0;Ea<this.lines.length;++Ea){var Eg=this.lines[Ea];var Ed=Df(Eg.markedSpans,this);if(Ed.to!=null){Ec=BC(Eg)}Eg.markedSpans=DL(Eg.markedSpans,Ed);if(Ed.from!=null){EZ=BC(Eg)}else{if(this.collapsed&&!D0(this.doc,Eg)&&Ee){EP(Eg,AV(Ee.display))}}}if(Ee&&this.collapsed&&!Ee.options.lineWrapping){for(var Ea=0;Ea<this.lines.length;++Ea){var EX=V(Ee.doc,this.lines[Ea]),Eb=C1(Ee.doc,EX);if(Eb>Ee.display.maxLineLength){Ee.display.maxLine=EX;Ee.display.maxLineLength=Eb;Ee.display.maxLineChanged=true}}}if(EZ!=null&&Ee){r(Ee,EZ,Ec+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(Ee){C8(Ee)}}p(Ee,"markerCleared",Ee,this);if(EY){x(Ee)}};i.prototype.find=function(Eb){var Ed,Ec;for(var EY=0;EY<this.lines.length;++EY){var EX=this.lines[EY];var EZ=Df(EX.markedSpans,this);if(EZ.from!=null||EZ.to!=null){var Ea=BC(EX);if(EZ.from!=null){Ed=l(Ea,EZ.from)}if(EZ.to!=null){Ec=l(Ea,EZ.to)}}}if(this.type=="bookmark"&&!Eb){return Ed}return Ed&&{from:Ed,to:Ec}};i.prototype.changed=function(){var Ea=this.find(),EX=this.doc.cm;if(!Ea||!EX){return }if(this.type!="bookmark"){Ea=Ea.from}var EY=Dk(this.doc,Ea.line);ED(EX,EY);if(Ea.line>=EX.display.showingFrom&&Ea.line<EX.display.showingTo){for(var EZ=EX.display.lineDiv.firstChild;EZ;EZ=EZ.nextSibling){if(EZ.lineObj==EY){if(EZ.offsetHeight!=EY.height){EP(EY,EZ.offsetHeight)}break}}B1(EX,function(){EX.curOp.selectionChanged=EX.curOp.forceUpdate=EX.curOp.updateMaxLine=true})}};i.prototype.attachLine=function(EX){if(!this.lines.length&&this.doc.cm){var EY=this.doc.cm.curOp;if(!EY.maybeHiddenMarkers||CL(EY.maybeHiddenMarkers,this)==-1){(EY.maybeUnhiddenMarkers||(EY.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(EX)};i.prototype.detachLine=function(EX){this.lines.splice(CL(this.lines,EX),1);if(!this.lines.length&&this.doc.cm){var EY=this.doc.cm.curOp;(EY.maybeHiddenMarkers||(EY.maybeHiddenMarkers=[])).push(this)}};var Aa=0;function DI(Ed,Eb,Ec,Ef,Ea){if(Ef&&Ef.shared){return h(Ed,Eb,Ec,Ef,Ea)}if(Ed.cm&&!Ed.cm.curOp){return B9(Ed.cm,DI)(Ed,Eb,Ec,Ef,Ea)}var EZ=new i(Ed,Ea);if(Ef){AN(Ef,EZ)}if(Dl(Ec,Eb)||D9(Eb,Ec)&&EZ.clearWhenEmpty!==false){return EZ}if(EZ.replacedWith){EZ.collapsed=true;EZ.replacedWith=EK("span",[EZ.replacedWith],"CodeMirror-widget");if(!Ef.handleMouseEvents){EZ.replacedWith.ignoreEvents=true}}if(EZ.collapsed){if(W(Ed,Eb.line,Eb,Ec,EZ)||Eb.line!=Ec.line&&W(Ed,Ec.line,Eb,Ec,EZ)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}Ac=true}if(EZ.addToHistory){DJ(Ed,{from:Eb,to:Ec,origin:"markText"},{head:Ed.sel.head,anchor:Ed.sel.anchor},NaN)}var EY=Eb.line,Ee=Ed.cm,EX;Ed.iter(EY,Ec.line+1,function(Eg){if(Ee&&EZ.collapsed&&!Ee.options.lineWrapping&&V(Ed,Eg)==Ee.display.maxLine){EX=true}var Eh={from:null,to:null,marker:EZ};if(EY==Eb.line){Eh.from=Eb.ch}if(EY==Ec.line){Eh.to=Ec.ch}if(EZ.collapsed&&EY!=Eb.line){EP(Eg,0)}BX(Eg,Eh);++EY});if(EZ.collapsed){Ed.iter(Eb.line,Ec.line+1,function(Eg){if(D0(Ed,Eg)){EP(Eg,0)}})}if(EZ.clearOnEnter){BK(EZ,"beforeCursorEnter",function(){EZ.clear()})}if(EZ.readOnly){ER=true;if(Ed.history.done.length||Ed.history.undone.length){Ed.clearHistory()}}if(EZ.collapsed){EZ.id=++Aa;EZ.atomic=true}if(Ee){if(EX){Ee.curOp.updateMaxLine=true}if(EZ.className||EZ.title||EZ.startStyle||EZ.endStyle||EZ.collapsed){r(Ee,Eb.line,Ec.line+1)}if(EZ.atomic){C8(Ee)}}p(Ee,"markerAdded",Ee,EZ);return EZ}function U(Ea,EY){this.markers=Ea;this.primary=EY;for(var EX=0,EZ=this;EX<Ea.length;++EX){Ea[EX].parent=this;BK(Ea[EX],"clear",function(){EZ.clear()})}}c.SharedTextMarker=U;A0(U);U.prototype.clear=function(){if(this.explicitlyCleared){return }this.explicitlyCleared=true;for(var EX=0;EX<this.markers.length;++EX){this.markers[EX].clear()}p(this,"clear")};U.prototype.find=function(){return this.primary.find()};function h(Eb,Ee,Ed,EX,EZ){EX=AN(EX);EX.shared=false;var Ec=[DI(Eb,Ee,Ed,EX,EZ)],EY=Ec[0];var Ea=EX.replacedWith;Co(Eb,function(Eg){if(Ea){EX.replacedWith=Ea.cloneNode(true)}Ec.push(DI(Eg,EA(Eg,Ee),EA(Eg,Ed),EX,EZ));for(var Ef=0;Ef<Eg.linked.length;++Ef){if(Eg.linked[Ef].isParent){return }}EY=D8(Ec)});return new U(Ec,EY)}function Df(EZ,EX){if(EZ){for(var EY=0;EY<EZ.length;++EY){var Ea=EZ[EY];if(Ea.marker==EX){return Ea}}}}function DL(EY,EZ){for(var Ea,EX=0;EX<EY.length;++EX){if(EY[EX]!=EZ){(Ea||(Ea=[])).push(EY[EX])}}return Ea}function BX(EX,EY){EX.markedSpans=EX.markedSpans?EX.markedSpans.concat([EY]):[EY];EY.marker.attachLine(EX)}function AR(EY,EZ,Ed){if(EY){for(var Eb=0,Ee;Eb<EY.length;++Eb){var Ef=EY[Eb],Ec=Ef.marker;var EX=Ef.from==null||(Ec.inclusiveLeft?Ef.from<=EZ:Ef.from<EZ);if(EX||Ef.from==EZ&&Ec.type=="bookmark"&&(!Ed||!Ef.marker.insertLeft)){var Ea=Ef.to==null||(Ec.inclusiveRight?Ef.to>=EZ:Ef.to>EZ);(Ee||(Ee=[])).push({from:Ef.from,to:Ea?null:Ef.to,marker:Ec})}}}return Ee}function AG(EY,Ea,Ed){if(EY){for(var Eb=0,Ee;Eb<EY.length;++Eb){var Ef=EY[Eb],Ec=Ef.marker;var EZ=Ef.to==null||(Ec.inclusiveRight?Ef.to>=Ea:Ef.to>Ea);if(EZ||Ef.from==Ea&&Ec.type=="bookmark"&&(!Ed||Ef.marker.insertLeft)){var EX=Ef.from==null||(Ec.inclusiveLeft?Ef.from<=Ea:Ef.from<Ea);(Ee||(Ee=[])).push({from:EX?null:Ef.from-Ea,to:Ef.to==null?null:Ef.to-Ea,marker:Ec})}}}return Ee}function Cz(Ej,Eg){var Ef=BT(Ej,Eg.from.line)&&Dk(Ej,Eg.from.line).markedSpans;var Em=BT(Ej,Eg.to.line)&&Dk(Ej,Eg.to.line).markedSpans;if(!Ef&&!Em){return null}var EY=Eg.from.ch,Eb=Eg.to.ch,Ee=D9(Eg.from,Eg.to);var Ed=AR(Ef,EY,Ee);var El=AG(Em,Eb,Ee);var Ek=Eg.text.length==1,EZ=D8(Eg.text).length+(Ek?EY:0);if(Ed){for(var Ea=0;Ea<Ed.length;++Ea){var Ei=Ed[Ea];if(Ei.to==null){var En=Df(El,Ei.marker);if(!En){Ei.to=EY}else{if(Ek){Ei.to=En.to==null?null:En.to+EZ}}}}}if(El){for(var Ea=0;Ea<El.length;++Ea){var Ei=El[Ea];if(Ei.to!=null){Ei.to+=EZ}if(Ei.from==null){var En=Df(Ed,Ei.marker);if(!En){Ei.from=EZ;if(Ek){(Ed||(Ed=[])).push(Ei)}}}else{Ei.from+=EZ;if(Ek){(Ed||(Ed=[])).push(Ei)}}}}if(Ed){Ed=N(Ed)}if(El&&El!=Ed){El=N(El)}var Ec=[Ed];if(!Ek){var Eh=Eg.text.length-2,EX;if(Eh>0&&Ed){for(var Ea=0;Ea<Ed.length;++Ea){if(Ed[Ea].to==null){(EX||(EX=[])).push({from:null,to:null,marker:Ed[Ea].marker})}}}for(var Ea=0;Ea<Eh;++Ea){Ec.push(EX)}Ec.push(El)}return Ec}function N(EY){for(var EX=0;EX<EY.length;++EX){var EZ=EY[EX];if(EZ.from!=null&&EZ.from==EZ.to&&EZ.marker.clearWhenEmpty!==false){EY.splice(EX--,1)}}if(!EY.length){return null}return EY}function Cq(Ef,Ed){var EX=BR(Ef,Ed);var Eg=Cz(Ef,Ed);if(!EX){return Eg}if(!Eg){return EX}for(var Ea=0;Ea<EX.length;++Ea){var Eb=EX[Ea],Ec=Eg[Ea];if(Eb&&Ec){spans:for(var EZ=0;EZ<Ec.length;++EZ){var Ee=Ec[EZ];for(var EY=0;EY<Eb.length;++EY){if(Eb[EY].marker==Ee.marker){continue spans}}Eb.push(Ee)}}else{if(Ec){EX[Ea]=Ec}}}return EX}function Bw(Eh,Ef,Eg){var Ea=null;Eh.iter(Ef.line,Eg.line+1,function(Ei){if(Ei.markedSpans){for(var Ej=0;Ej<Ei.markedSpans.length;++Ej){var Ek=Ei.markedSpans[Ej].marker;if(Ek.readOnly&&(!Ea||CL(Ea,Ek)==-1)){(Ea||(Ea=[])).push(Ek)}}}});if(!Ea){return null}var Eb=[{from:Ef,to:Eg}];for(var Ec=0;Ec<Ea.length;++Ec){var Ed=Ea[Ec],EY=Ed.find();for(var EZ=0;EZ<Eb.length;++EZ){var EX=Eb[EZ];if(Dl(EX.to,EY.from)||Dl(EY.to,EX.from)){continue}var Ee=[EZ,1];if(Dl(EX.from,EY.from)||!Ed.inclusiveLeft&&D9(EX.from,EY.from)){Ee.push({from:EX.from,to:EY.from})}if(Dl(EY.to,EX.to)||!Ed.inclusiveRight&&D9(EX.to,EY.to)){Ee.push({from:EY.to,to:EX.to})}Eb.splice.apply(Eb,Ee);EZ+=Ee.length-1}}return Eb}function S(EX){return EX.inclusiveLeft?-1:0}function BJ(EX){return EX.inclusiveRight?1:0}function Cg(Ea,EY){var Ec=Ea.lines.length-EY.lines.length;if(Ec!=0){return Ec}var EZ=Ea.find(),Ed=EY.find();var EX=BZ(EZ.from,Ed.from)||S(Ea)-S(EY);if(EX){return -EX}var Eb=BZ(EZ.to,Ed.to)||BJ(Ea)-BJ(EY);if(Eb){return Eb}return EY.id-Ea.id}function Ab(EY,Ec){var EX=Ac&&EY.markedSpans,Eb;if(EX){for(var Ea,EZ=0;EZ<EX.length;++EZ){Ea=EX[EZ];if(Ea.marker.collapsed&&(Ec?Ea.from:Ea.to)==null&&(!Eb||Cg(Eb,Ea.marker)<0)){Eb=Ea.marker}}}return Eb}function DO(EX){return Ab(EX,true)}function C6(EX){return Ab(EX,false)}function W(Ef,EZ,Ed,Ee,Eb){var Ei=Dk(Ef,EZ);var EX=Ac&&Ei.markedSpans;if(EX){for(var Ea=0;Ea<EX.length;++Ea){var EY=EX[Ea];if(!EY.marker.collapsed){continue}var Eh=EY.marker.find(true);var Eg=BZ(Eh.from,Ed)||S(EY.marker)-S(Eb);var Ec=BZ(Eh.to,Ee)||BJ(EY.marker)-BJ(Eb);if(Eg>=0&&Ec<=0||Eg<=0&&Ec>=0){continue}if(Eg<=0&&(BZ(Eh.to,Ed)||BJ(EY.marker)-S(Eb))>0||Eg>=0&&(BZ(Eh.from,Ee)||S(EY.marker)-BJ(Eb))<0){return true}}}}function V(EZ,EY){var EX;while(EX=DO(EY)){EY=Dk(EZ,EX.find().from.line)}return EY}function D0(Eb,EY){var EX=Ac&&EY.markedSpans;if(EX){for(var Ea,EZ=0;EZ<EX.length;++EZ){Ea=EX[EZ];if(!Ea.marker.collapsed){continue}if(Ea.from==null){return true}if(Ea.marker.replacedWith){continue}if(Ea.from==0&&Ea.marker.inclusiveLeft&&k(Eb,EY,Ea)){return true}}}}function k(Ed,EY,Ea){if(Ea.to==null){var EX=Ea.marker.find().to,Eb=Dk(Ed,EX.line);return k(Ed,Eb,Df(Eb.markedSpans,Ea.marker))}if(Ea.marker.inclusiveRight&&Ea.to==EY.text.length){return true}for(var Ec,EZ=0;EZ<EY.markedSpans.length;++EZ){Ec=EY.markedSpans[EZ];if(Ec.marker.collapsed&&!Ec.marker.replacedWith&&Ec.from==Ea.to&&(Ec.to==null||Ec.to!=Ea.from)&&(Ec.marker.inclusiveLeft||Ea.marker.inclusiveRight)&&k(Ed,EY,Ec)){return true}}}function EQ(EX){var EZ=EX.markedSpans;if(!EZ){return }for(var EY=0;EY<EZ.length;++EY){EZ[EY].marker.detachLine(EX)}EX.markedSpans=null}function CA(EX,EZ){if(!EZ){return }for(var EY=0;EY<EZ.length;++EY){EZ[EY].marker.attachLine(EX)}EX.markedSpans=EZ}var CY=c.LineWidget=function(EX,Ea,EY){if(EY){for(var EZ in EY){if(EY.hasOwnProperty(EZ)){this[EZ]=EY[EZ]}}}this.cm=EX;this.node=Ea};A0(CY);function f(EX){return function(){var EZ=!this.cm.curOp;if(EZ){By(this.cm)}try{var EY=EX.apply(this,arguments)}finally{if(EZ){x(this.cm)}}return EY}}CY.prototype.clear=f(function(){var EY=this.line.widgets,Ea=BC(this.line);if(Ea==null||!EY){return }for(var EZ=0;EZ<EY.length;++EZ){if(EY[EZ]==this){EY.splice(EZ--,1)}}if(!EY.length){this.line.widgets=null}var EX=BB(this.cm,this.line)<this.cm.doc.scrollTop;EP(this.line,Math.max(0,this.line.height-B6(this)));if(EX){B0(this.cm,0,-this.height)}r(this.cm,Ea,Ea+1)});CY.prototype.changed=f(function(){var EX=this.height;this.height=null;var EY=B6(this)-EX;if(!EY){return }EP(this.line,this.line.height+EY);var EZ=BC(this.line);r(this.cm,EZ,EZ+1)});function B6(EX){if(EX.height!=null){return EX.height}if(!EX.node.parentNode||EX.node.parentNode.nodeType!=1){BF(EX.cm.display.measure,EK("div",[EX.node],null,"position: relative"))}return EX.height=EX.node.offsetHeight}function A6(EX,Eb,EZ,EY){var Ea=new CY(EX,EZ,EY);if(Ea.noHScroll){EX.display.alignWidgets=true}DA(EX,Eb,function(Ed){var Ee=Ed.widgets||(Ed.widgets=[]);if(Ea.insertAt==null){Ee.push(Ea)}else{Ee.splice(Math.min(Ee.length-1,Math.max(0,Ea.insertAt)),0,Ea)}Ea.line=Ed;if(!D0(EX.doc,Ed)||Ea.showIfHidden){var Ec=BB(EX,Ed)<EX.doc.scrollTop;EP(Ed,Ed.height+B6(Ea));if(Ec){B0(EX,0,Ea.height)}EX.curOp.forceUpdate=true}return true});return Ea}var EO=c.Line=function(EZ,EY,EX){this.text=EZ;CA(this,EY);this.height=EX?EX(this):1};A0(EO);EO.prototype.lineNo=function(){return BC(this)};function C2(EY,Eb,EZ,EX){EY.text=Eb;if(EY.stateAfter){EY.stateAfter=null}if(EY.styles){EY.styles=null}if(EY.order!=null){EY.order=null}EQ(EY);CA(EY,EZ);var Ea=EX?EX(EY):1;if(Ea!=EY.height){EP(EY,Ea)}}function A1(EX){EX.parent=null;EQ(EX)}function T(Eg,Ei,Eb,EY,Ec,Ea){var EZ=Eb.flattenSpans;if(EZ==null){EZ=Eg.options.flattenSpans}var Ee=0,Ed=null;var Eh=new DS(Ei,Eg.options.tabSize),EX;if(Ei==""&&Eb.blankLine){Eb.blankLine(EY)}while(!Eh.eol()){if(Eh.pos>Eg.options.maxHighlightLength){EZ=false;if(Ea){CU(Eg,Ei,EY,Eh.pos)}Eh.pos=Ei.length;EX=null}else{EX=Eb.token(Eh,EY)}if(Eg.options.addModeClass){var Ej=c.innerMode(Eb,EY).mode.name;if(Ej){EX="m-"+(EX?Ej+" "+EX:Ej)}}if(!EZ||Ed!=EX){if(Ee<Eh.start){Ec(Eh.start,Ed)}Ee=Eh.start;Ed=EX}Eh.start=Eh.pos}while(Ee<Eh.pos){var Ef=Math.min(Eh.pos,Ee+50000);Ec(Ef,Ed);Ee=Ef}}function D5(Ed,Ef,EX,Ea){var Ee=[Ed.state.modeGen];T(Ed,Ef.text,Ed.doc.mode,EX,function(Eg,Eh){Ee.push(Eg,Eh)},Ea);for(var EY=0;EY<Ed.state.overlays.length;++EY){var Eb=Ed.state.overlays[EY],Ec=1,EZ=0;T(Ed,Ef.text,Eb.mode,true,function(Eg,Ei){var Ek=Ec;while(EZ<Eg){var Eh=Ee[Ec];if(Eh>Eg){Ee.splice(Ec,1,Eg,Ee[Ec+1],Eh)}Ec+=2;EZ=Math.min(Eg,Eh)}if(!Ei){return }if(Eb.opaque){Ee.splice(Ek,Ec-Ek,Eg,Ei);Ec=Ek+2}else{for(;Ek<Ec;Ek+=2){var Ej=Ee[Ek+1];Ee[Ek+1]=Ej?Ej+" "+Ei:Ei}}})}return Ee}function CD(EX,EY){if(!EY.styles||EY.styles[0]!=EX.state.modeGen){EY.styles=D5(EX,EY,EY.stateAfter=CX(EX,BC(EY)))}return EY.styles}function CU(EX,Ec,EZ,EY){var Eb=EX.doc.mode;var Ea=new DS(Ec,EX.options.tabSize);Ea.start=Ea.pos=EY||0;if(Ec==""&&Eb.blankLine){Eb.blankLine(EZ)}while(!Ea.eol()&&Ea.pos<=EX.options.maxHighlightLength){Eb.token(Ea,EZ);Ea.start=Ea.pos}}var Cj={},BN={};function DU(Ea,EZ){if(!Ea){return null}for(;;){var EY=Ea.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!EY){break}Ea=Ea.slice(0,EY.index)+Ea.slice(EY.index+EY[0].length);var Eb=EY[1]?"bgClass":"textClass";if(EZ[Eb]==null){EZ[Eb]=EY[2]}else{if(!(new RegExp("(?:^|s)"+EY[2]+"(?:$|s)")).test(EZ[Eb])){EZ[Eb]+=" "+EY[2]}}}if(/^\s*$/.test(Ea)){return null}var EX=EZ.cm.options.addModeClass?BN:Cj;return EX[Ea]||(EX[Ea]=Ea.replace(/\S+/g,"cm-$&"))}function DQ(Eg,Ek,EX,Ej){var Eh,El=Ek,Ec=true;while(Eh=DO(El)){El=Dk(Eg.doc,Eh.find().from.line)}var Ed={pre:EK("pre"),col:0,pos:0,measure:null,measuredSomething:false,cm:Eg,copyWidgets:Ej};do{if(El.text){Ec=false}Ed.measure=El==Ek&&EX;Ed.pos=0;Ed.addToken=Ed.measure?E:Q;if((Cb||B8)&&Eg.getOption("lineWrapping")){Ed.addToken=D7(Ed.addToken)}var Eb=Au(El,Ed,CD(Eg,El));if(EX&&El==Ek&&!Ed.measuredSomething){EX[0]=Ed.pre.appendChild(As(Eg.display.measure));Ed.measuredSomething=true}if(Eb){El=Dk(Eg.doc,Eb.to.line)}}while(Eb);if(EX&&!Ed.measuredSomething&&!EX[0]){EX[0]=Ed.pre.appendChild(Ec?EK("span","\u00a0"):As(Eg.display.measure))}if(!Ed.pre.firstChild&&!D0(Eg.doc,Ek)){Ed.pre.appendChild(document.createTextNode("\u00a0"))}var EY;if(EX&&Cb&&(EY=A(El))){var Ea=EY.length-1;if(EY[Ea].from==EY[Ea].to){--Ea}var Ei=EY[Ea],EZ=EY[Ea-1];if(Ei.from+1==Ei.to&&EZ&&Ei.level<EZ.level){var Ef=EX[Ed.pos-1];if(Ef){Ef.parentNode.insertBefore(Ef.measureRight=As(Eg.display.measure),Ef.nextSibling)}}}var Ee=Ed.textClass?Ed.textClass+" "+(Ek.textClass||""):Ek.textClass;if(Ee){Ed.pre.className=Ee}AI(Eg,"renderLine",Eg,Ek,Ed.pre);return Ed}function Di(EY){var EX=EK("span","\u2022","cm-invalidchar");EX.title="\\u"+EY.charCodeAt(0).toString(16);return EX}function Q(Eb,Ek,EX,Ea,El,Ej){if(!Ek){return }var Ef=Eb.cm.options.specialChars;if(!Ef.test(Ek)){Eb.col+=Ek.length;var Ee=document.createTextNode(Ek)}else{var Ee=document.createDocumentFragment(),Eh=0;while(true){Ef.lastIndex=Eh;var EY=Ef.exec(Ek);var Ed=EY?EY.index-Eh:Ek.length-Eh;if(Ed){Ee.appendChild(document.createTextNode(Ek.slice(Eh,Eh+Ed)));Eb.col+=Ed}if(!EY){break}Eh+=Ed+1;if(EY[0]=="\t"){var Ec=Eb.cm.options.tabSize,Eg=Ec-Eb.col%Ec;Ee.appendChild(EK("span",Bj(Eg),"cm-tab"));Eb.col+=Eg}else{var EZ=Eb.cm.options.specialCharPlaceholder(EY[0]);Ee.appendChild(EZ);Eb.col+=1}}}if(EX||Ea||El||Eb.measure){var Ei=EX||"";if(Ea){Ei+=Ea}if(El){Ei+=El}var EZ=EK("span",[Ee],Ei);if(Ej){EZ.title=Ej}return Eb.pre.appendChild(EZ)}Eb.pre.appendChild(Ee)}function E(Ee,Eh,EY,Eb,Ei){var Ed=Ee.cm.options.lineWrapping;for(var Ec=0;Ec<Eh.length;++Ec){var EZ=Ec==0,Eg=Ec+1;while(Eg<Eh.length&&Dw(Eh.charAt(Eg))){++Eg}var EX=Eh.slice(Ec,Eg);Ec=Eg-1;if(Ec&&Ed&&BU(Eh,Ec)){Ee.pre.appendChild(EK("wbr"))}var Ea=Ee.measure[Ee.pos];var Ef=Ee.measure[Ee.pos]=Q(Ee,EX,EY,EZ&&Eb,Ec==Eh.length-1&&Ei);if(Ea){Ef.leftSide=Ea.leftSide||Ea}if(CF&&Ed&&EX==" "&&Ec&&!/\s/.test(Eh.charAt(Ec-1))&&Ec<Eh.length-1&&!/\s/.test(Eh.charAt(Ec+1))){Ef.style.whiteSpace="normal"}Ee.pos+=EX.length}if(Eh.length){Ee.measuredSomething=true}}function D7(EX){function EY(EZ){var Ea=" ";for(var Eb=0;Eb<EZ.length-2;++Eb){Ea+=Eb%2?" ":"\u00a0"}Ea+=" ";return Ea}return function(Ea,Ee,Eb,EZ,Ed,Ec){return EX(Ea,Ee.replace(/ {3,}/g,EY),Eb,EZ,Ed,Ec)}}function n(EY,Eb,EX,Ea){var Ec=!Ea&&EX.replacedWith;if(Ec){if(EY.copyWidgets){Ec=Ec.cloneNode(true)}EY.pre.appendChild(Ec);if(EY.measure){if(Eb){EY.measure[EY.pos]=Ec}else{var EZ=As(EY.cm.display.measure);if(EX.type=="bookmark"&&!EX.insertLeft){EY.measure[EY.pos]=EY.pre.appendChild(EZ)}else{if(EY.measure[EY.pos]){return }else{EY.measure[EY.pos]=EY.pre.insertBefore(EZ,Ec)}}}EY.measuredSomething=true}}EY.pos+=Eb}function Au(Eg,Em,Ef){var Ec=Eg.markedSpans,Ee=Eg.text,Ek=0;if(!Ec){for(var Ep=1;Ep<Ef.length;Ep+=2){Em.addToken(Em,Ee.slice(Ek,Ek=Ef[Ep]),DU(Ef[Ep+1],Em))}return }var Eq=Ee.length,Eb=0,Ep=1,Ei="",Er;var Et=0,EX,Es,Ej,Eu,EZ;for(;;){if(Et==Eb){EX=Es=Ej=Eu="";EZ=null;Et=Infinity;var Ed=[];for(var En=0;En<Ec.length;++En){var Eo=Ec[En],El=Eo.marker;if(Eo.from<=Eb&&(Eo.to==null||Eo.to>Eb)){if(Eo.to!=null&&Et>Eo.to){Et=Eo.to;Es=""}if(El.className){EX+=" "+El.className}if(El.startStyle&&Eo.from==Eb){Ej+=" "+El.startStyle}if(El.endStyle&&Eo.to==Et){Es+=" "+El.endStyle}if(El.title&&!Eu){Eu=El.title}if(El.collapsed&&(!EZ||Cg(EZ.marker,El)<0)){EZ=Eo}}else{if(Eo.from>Eb&&Et>Eo.from){Et=Eo.from}}if(El.type=="bookmark"&&Eo.from==Eb&&El.replacedWith){Ed.push(El)}}if(EZ&&(EZ.from||0)==Eb){n(Em,(EZ.to==null?Eq:EZ.to)-Eb,EZ.marker,EZ.from==null);if(EZ.to==null){return EZ.marker.find()}}if(!EZ&&Ed.length){for(var En=0;En<Ed.length;++En){n(Em,0,Ed[En])}}}if(Eb>=Eq){break}var Eh=Math.min(Eq,Et);while(true){if(Ei){var EY=Eb+Ei.length;if(!EZ){var Ea=EY>Eh?Ei.slice(0,Eh-Eb):Ei;Em.addToken(Em,Ea,Er?Er+EX:EX,Ej,Eb+Ea.length==Et?Es:"",Eu)}if(EY>=Eh){Ei=Ei.slice(Eh-Eb);Eb=Eh;break}Eb=EY;Ej=""}Ei=Ee.slice(Ek,Ek=Ef[Ep++]);Er=DU(Ef[Ep++],Em)}}}function D3(Eo,Ef,Eb,Ej,Ed){function Ea(Ep){return Eb?Eb[Ep]:null}function Ee(Ep,Er,Eq){C2(Ep,Er,Eq,Ed);p(Ep,"change",Ep,Ef)}var Ek=Ef.from,EY=Ef.to,Eh=Ef.text;var Eg=Dk(Eo,Ek.line),EX=Dk(Eo,EY.line);var EZ=D8(Eh),Em=Ea(Eh.length-1),Ei=EY.line-Ek.line;if(Ek.ch==0&&EY.ch==0&&EZ==""&&(!Eo.cm||Eo.cm.options.wholeLineUpdateBefore)){for(var El=0,En=Eh.length-1,Ec=[];El<En;++El){Ec.push(new EO(Eh[El],Ea(El),Ed))}Ee(EX,EX.text,Em);if(Ei){Eo.remove(Ek.line,Ei)}if(Ec.length){Eo.insert(Ek.line,Ec)}}else{if(Eg==EX){if(Eh.length==1){Ee(Eg,Eg.text.slice(0,Ek.ch)+EZ+Eg.text.slice(EY.ch),Em)}else{for(var Ec=[],El=1,En=Eh.length-1;El<En;++El){Ec.push(new EO(Eh[El],Ea(El),Ed))}Ec.push(new EO(EZ+Eg.text.slice(EY.ch),Em,Ed));Ee(Eg,Eg.text.slice(0,Ek.ch)+Eh[0],Ea(0));Eo.insert(Ek.line+1,Ec)}}else{if(Eh.length==1){Ee(Eg,Eg.text.slice(0,Ek.ch)+Eh[0]+EX.text.slice(EY.ch),Ea(0));Eo.remove(Ek.line+1,Ei)}else{Ee(Eg,Eg.text.slice(0,Ek.ch)+Eh[0],Ea(0));Ee(EX,EZ+EX.text.slice(EY.ch),Em);for(var El=1,En=Eh.length-1,Ec=[];El<En;++El){Ec.push(new EO(Eh[El],Ea(El),Ed))}if(Ei>1){Eo.remove(Ek.line+1,Ei-1)}Eo.insert(Ek.line+1,Ec)}}}p(Eo,"change",Eo,Ef);BH(Eo,Ej.anchor,Ej.head,null,true)}function DX(EY){this.lines=EY;this.parent=null;for(var EZ=0,Ea=EY.length,EX=0;EZ<Ea;++EZ){EY[EZ].parent=this;EX+=EY[EZ].height}this.height=EX}DX.prototype={chunkSize:function(){return this.lines.length},removeInner:function(EX,Eb){for(var EZ=EX,Ea=EX+Eb;EZ<Ea;++EZ){var EY=this.lines[EZ];this.height-=EY.height;A1(EY);p(EY,"delete")}this.lines.splice(EX,Eb)},collapse:function(EX){EX.splice.apply(EX,[EX.length,0].concat(this.lines))},insertInner:function(EY,EZ,EX){this.height+=EX;this.lines=this.lines.slice(0,EY).concat(EZ).concat(this.lines.slice(EY));for(var Ea=0,Eb=EZ.length;Ea<Eb;++Ea){EZ[Ea].parent=this}},iterN:function(EX,Ea,EZ){for(var EY=EX+Ea;EX<EY;++EX){if(EZ(this.lines[EX])){return true}}}};function D1(Ea){this.children=Ea;var EZ=0,EX=0;for(var EY=0,Ec=Ea.length;EY<Ec;++EY){var Eb=Ea[EY];EZ+=Eb.chunkSize();EX+=Eb.height;Eb.parent=this}this.size=EZ;this.height=EX;this.parent=null}D1.prototype={chunkSize:function(){return this.size},removeInner:function(EX,Ee){this.size-=Ee;for(var EZ=0;EZ<this.children.length;++EZ){var Ed=this.children[EZ],Eb=Ed.chunkSize();if(EX<Eb){var Ea=Math.min(Ee,Eb-EX),Ec=Ed.height;Ed.removeInner(EX,Ea);this.height-=Ec-Ed.height;if(Eb==Ea){this.children.splice(EZ--,1);Ed.parent=null}if((Ee-=Ea)==0){break}EX=0}else{EX-=Eb}}if(this.size-Ee<25){var EY=[];this.collapse(EY);this.children=[new DX(EY)];this.children[0].parent=this}},collapse:function(EX){for(var EY=0,EZ=this.children.length;EY<EZ;++EY){this.children[EY].collapse(EX)}},insertInner:function(EY,Ef,Ee){this.size+=Ef.length;this.height+=Ee;for(var EZ=0,Eb=this.children.length;EZ<Eb;++EZ){var EX=this.children[EZ],Ec=EX.chunkSize();if(EY<=Ec){EX.insertInner(EY,Ef,Ee);if(EX.lines&&EX.lines.length>50){while(EX.lines.length>50){var Ea=EX.lines.splice(EX.lines.length-25,25);var Ed=new DX(Ea);EX.height-=Ed.height;this.children.splice(EZ+1,0,Ed);Ed.parent=this}this.maybeSpill()}break}EY-=Ec}},maybeSpill:function(){if(this.children.length<=10){return }var Ea=this;do{var EY=Ea.children.splice(Ea.children.length-5,5);var EZ=new D1(EY);if(!Ea.parent){var Eb=new D1(Ea.children);Eb.parent=Ea;Ea.children=[Eb,EZ];Ea=Eb}else{Ea.size-=EZ.size;Ea.height-=EZ.height;var EX=CL(Ea.parent.children,Ea);Ea.parent.children.splice(EX+1,0,EZ)}EZ.parent=Ea.parent}while(Ea.children.length>10);Ea.parent.maybeSpill()},iterN:function(EX,Ee,Ed){for(var EY=0,Eb=this.children.length;EY<Eb;++EY){var Ec=this.children[EY],Ea=Ec.chunkSize();if(EX<Ea){var EZ=Math.min(Ee,Ea-EX);if(Ec.iterN(EX,EZ,Ed)){return true}if((Ee-=EZ)==0){break}EX=0}else{EX-=Ea}}}};var Bk=0;var AB=c.Doc=function(EZ,EY,EX){if(!(this instanceof AB)){return new AB(EZ,EY,EX)}if(EX==null){EX=0}D1.call(this,[new DX([new EO("",null)])]);this.first=EX;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.history=AD();this.cleanGeneration=1;this.frontier=EX;var Ea=l(EX,0);this.sel={from:Ea,to:Ea,head:Ea,anchor:Ea,shift:false,extend:false,goalColumn:null};this.id=++Bk;this.modeOption=EY;if(typeof EZ=="string"){EZ=AX(EZ)}D3(this,{from:Ea,to:Ea,text:EZ},null,{head:Ea,anchor:Ea})};AB.prototype=Bd(D1.prototype,{constructor:AB,iter:function(EZ,EY,EX){if(EX){this.iterN(EZ-this.first,EY-EZ,EX)}else{this.iterN(this.first,this.first+this.size,EZ)}},insert:function(EY,EZ){var EX=0;for(var Ea=0,Eb=EZ.length;Ea<Eb;++Ea){EX+=EZ[Ea].height}this.insertInner(EY-this.first,EZ,EX)},remove:function(EX,EY){this.removeInner(EX-this.first,EY)},getValue:function(EY){var EX=AZ(this,this.first,this.first+this.size);if(EY===false){return EX}return EX.join(EY||"\n")},setValue:function(EY){var EZ=l(this.first,0),EX=this.first+this.size-1;Ak(this,{from:EZ,to:l(EX,Dk(this,EX).text.length),text:AX(EY),origin:"setValue"},{head:EZ,anchor:EZ},true)},replaceRange:function(EY,Ea,EZ,EX){Ea=EA(this,Ea);EZ=EZ?EA(this,EZ):Ea;AY(this,EY,Ea,EZ,EX)},getRange:function(Ea,EZ,EY){var EX=EM(this,EA(this,Ea),EA(this,EZ));if(EY===false){return EX}return EX.join(EY||"\n")},getLine:function(EY){var EX=this.getLineHandle(EY);return EX&&EX.text},setLine:function(EX,EY){if(BT(this,EX)){AY(this,EY,l(EX,0),EA(this,l(EX)))}},removeLine:function(EX){if(EX){AY(this,"",EA(this,l(EX-1)),EA(this,l(EX)))}else{AY(this,"",l(0,0),EA(this,l(1,0)))}},getLineHandle:function(EX){if(BT(this,EX)){return Dk(this,EX)}},getLineNumber:function(EX){return BC(EX)},getLineHandleVisualStart:function(EX){if(typeof EX=="number"){EX=Dk(this,EX)}return V(this,EX)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(EX){return EA(this,EX)},getCursor:function(EZ){var EX=this.sel,EY;if(EZ==null||EZ=="head"){EY=EX.head}else{if(EZ=="anchor"){EY=EX.anchor}else{if(EZ=="end"||EZ===false){EY=EX.to}else{EY=EX.from}}}return Bc(EY)},somethingSelected:function(){return !D9(this.sel.head,this.sel.anchor)},setCursor:D4(function(EX,EY,Ea){var EZ=EA(this,typeof EX=="number"?l(EX,EY||0):EX);if(Ea){EH(this,EZ)}else{BH(this,EZ,EZ)}}),setSelection:D4(function(EY,EZ,EX){BH(this,EA(this,EY),EA(this,EZ||EY),EX)}),extendSelection:D4(function(EZ,EY,EX){EH(this,EA(this,EZ),EY&&EA(this,EY),EX)}),getSelection:function(EX){return this.getRange(this.sel.from,this.sel.to,EX)},replaceSelection:function(EY,EZ,EX){Ak(this,{from:this.sel.from,to:this.sel.to,text:AX(EY),origin:EX},EZ||"around")},undo:D4(function(){BS(this,"undo")}),redo:D4(function(){BS(this,"redo")}),setExtending:function(EX){this.sel.extend=EX},historySize:function(){var EX=this.history;return{undo:EX.done.length,redo:EX.undone.length}},clearHistory:function(){this.history=AD(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(EX){if(EX){this.history.lastOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(EX){return this.history.generation==(EX||this.cleanGeneration)},getHistory:function(){return{done:BD(this.history.done),undone:BD(this.history.undone)}},setHistory:function(EY){var EX=this.history=AD(this.history.maxGeneration);EX.done=EY.done.slice(0);EX.undone=EY.undone.slice(0)},markText:function(EZ,EY,EX){return DI(this,EA(this,EZ),EA(this,EY),EX,"range")},setBookmark:function(EZ,EX){var EY={replacedWith:EX&&(EX.nodeType==null?EX.widget:EX),insertLeft:EX&&EX.insertLeft,clearWhenEmpty:false};EZ=EA(this,EZ);return DI(this,EZ,EZ,EY,"bookmark")},findMarksAt:function(Eb){Eb=EA(this,Eb);var Ea=[],EY=Dk(this,Eb.line).markedSpans;if(EY){for(var EX=0;EX<EY.length;++EX){var EZ=EY[EX];if((EZ.from==null||EZ.from<=Eb.ch)&&(EZ.to==null||EZ.to>=Eb.ch)){Ea.push(EZ.marker.parent||EZ.marker)}}}return Ea},findMarks:function(Ea,EZ){Ea=EA(this,Ea);EZ=EA(this,EZ);var EX=[],EY=Ea.line;this.iter(Ea.line,EZ.line+1,function(Eb){var Ed=Eb.markedSpans;if(Ed){for(var Ec=0;Ec<Ed.length;Ec++){var Ee=Ed[Ec];if(!(EY==Ea.line&&Ea.ch>Ee.to||Ee.from==null&&EY!=Ea.line||EY==EZ.line&&Ee.from>EZ.ch)){EX.push(Ee.marker.parent||Ee.marker)}}}++EY});return EX},getAllMarks:function(){var EX=[];this.iter(function(EZ){var EY=EZ.markedSpans;if(EY){for(var Ea=0;Ea<EY.length;++Ea){if(EY[Ea].from!=null){EX.push(EY[Ea].marker)}}}});return EX},posFromIndex:function(EY){var EX,EZ=this.first;this.iter(function(Ea){var Eb=Ea.text.length+1;if(Eb>EY){EX=EY;return true}EY-=Eb;++EZ});return EA(this,l(EZ,EX))},indexFromPos:function(EY){EY=EA(this,EY);var EX=EY.ch;if(EY.line<this.first||EY.ch<0){return 0}this.iter(this.first,EY.line,function(EZ){EX+=EZ.text.length+1});return EX},copy:function(EX){var EY=new AB(AZ(this,this.first,this.first+this.size),this.modeOption,this.first);EY.scrollTop=this.scrollTop;EY.scrollLeft=this.scrollLeft;EY.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:false,goalColumn:this.sel.goalColumn};if(EX){EY.history.undoDepth=this.history.undoDepth;EY.setHistory(this.getHistory())}return EY},linkedDoc:function(EX){if(!EX){EX={}}var Ea=this.first,EZ=this.first+this.size;if(EX.from!=null&&EX.from>Ea){Ea=EX.from}if(EX.to!=null&&EX.to<EZ){EZ=EX.to}var EY=new AB(AZ(this,Ea,EZ),EX.mode||this.modeOption,Ea);if(EX.sharedHist){EY.history=this.history}(this.linked||(this.linked=[])).push({doc:EY,sharedHist:EX.sharedHist});EY.linked=[{doc:this,isParent:true,sharedHist:EX.sharedHist}];return EY},unlinkDoc:function(EY){if(EY instanceof c){EY=EY.doc}if(this.linked){for(var EZ=0;EZ<this.linked.length;++EZ){var Ea=this.linked[EZ];if(Ea.doc!=EY){continue}this.linked.splice(EZ,1);EY.unlinkDoc(this);break}}if(EY.history==this.history){var EX=[EY.id];Co(EY,function(Eb){EX.push(Eb.id)},true);EY.history=AD();EY.history.done=BD(this.history.done,EX);EY.history.undone=BD(this.history.undone,EX)}},iterLinkedDocs:function(EX){Co(this,EX)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});AB.prototype.eachLine=AB.prototype.iter;var D="iter insert remove copy getEditor".split(" ");for(var A9 in AB.prototype){if(AB.prototype.hasOwnProperty(A9)&&CL(D,A9)<0){c.prototype[A9]=(function(EX){return function(){return EX.apply(this.doc,arguments)}})(AB.prototype[A9])}}A0(AB);function Co(Ea,EZ,EY){function EX(Eg,Ee,Ec){if(Eg.linked){for(var Ed=0;Ed<Eg.linked.length;++Ed){var Eb=Eg.linked[Ed];if(Eb.doc==Ee){continue}var Ef=Ec&&Eb.sharedHist;if(EY&&!Ef){continue}EZ(Eb.doc,Ef);EX(Eb.doc,Eg,Ef)}}}EX(Ea,null,true)}function Cr(EX,EY){if(EY.cm){throw new Error("This document is already in use.")}EX.doc=EY;EY.cm=EX;m(EX);Aw(EX);if(!EX.options.lineWrapping){EN(EX)}EX.options.mode=EY.modeOption;r(EX)}function Dk(EX,Eb){Eb-=EX.first;while(!EX.lines){for(var EY=0;;++EY){var Ea=EX.children[EY],EZ=Ea.chunkSize();if(Eb<EZ){EX=Ea;break}Eb-=EZ}}return EX.lines[Eb]}function EM(EZ,Eb,EX){var EY=[],Ea=Eb.line;EZ.iter(Eb.line,EX.line+1,function(Ec){var Ed=Ec.text;if(Ea==EX.line){Ed=Ed.slice(0,EX.ch)}if(Ea==Eb.line){Ed=Ed.slice(Eb.ch)}EY.push(Ed);++Ea});return EY}function AZ(EY,Ea,EZ){var EX=[];EY.iter(Ea,EZ,function(Eb){EX.push(Eb.text)});return EX}function EP(EY,EX){var EZ=EX-EY.height;for(var Ea=EY;Ea;Ea=Ea.parent){Ea.height+=EZ}}function BC(EX){if(EX.parent==null){return null}var Eb=EX.parent,Ea=CL(Eb.lines,EX);for(var EY=Eb.parent;EY;Eb=EY,EY=EY.parent){for(var EZ=0;;++EZ){if(EY.children[EZ]==Eb){break}Ea+=EY.children[EZ].chunkSize()}}return Ea+Eb.first}function A5(Ed,Eb){var EZ=Ed.first;outer:do{for(var Ea=0,Ec=Ed.children.length;Ea<Ec;++Ea){var EY=Ed.children[Ea],EX=EY.height;if(Eb<EX){Ed=EY;continue outer}Eb-=EX;EZ+=EY.chunkSize()}return EZ}while(!Ed.lines);for(var Ea=0,Ec=Ed.lines.length;Ea<Ec;++Ea){var Ef=Ed.lines[Ea],Ee=Ef.height;if(Eb<Ee){break}Eb-=Ee}return EZ+Ea}function BB(EX,Ea){Ea=V(EX.doc,Ea);var Ec=0,EZ=Ea.parent;for(var Eb=0;Eb<EZ.lines.length;++Eb){var EY=EZ.lines[Eb];if(EY==Ea){break}else{Ec+=EY.height}}for(var Ed=EZ.parent;Ed;EZ=Ed,Ed=EZ.parent){for(var Eb=0;Eb<Ed.children.length;++Eb){var Ee=Ed.children[Eb];if(Ee==EZ){break}else{Ec+=Ee.height}}}return Ec}function A(EY){var EX=EY.order;if(EX==null){EX=EY.order=Al(EY.text)}return EX}function AD(EX){return{done:[],undone:[],undoDepth:Infinity,lastTime:0,lastOp:null,lastOrigin:null,generation:EX||1,maxGeneration:EX||1}}function BL(EY,Ec,Eb,Ea){var EX=Ec["spans_"+EY.id],EZ=0;EY.iter(Math.max(EY.first,Eb),Math.min(EY.first+EY.size,Ea),function(Ed){if(Ed.markedSpans){(EX||(EX=Ec["spans_"+EY.id]={}))[EZ]=Ed.markedSpans}++EZ})}function CS(EX,Ea){var EZ={line:Ea.from.line,ch:Ea.from.ch};var EY={from:EZ,to:B5(Ea),text:EM(EX,Ea.from,Ea.to)};BL(EX,EY,Ea.from.line,Ea.to.line+1);Co(EX,function(Eb){BL(Eb,EY,Ea.from.line,Ea.to.line+1)},true);return EY}function DJ(Ec,Ee,Eb,EX){var Ea=Ec.history;Ea.undone.length=0;var EZ=+new Date,Ed=D8(Ea.done);if(Ed&&(Ea.lastOp==EX||Ea.lastOrigin==Ee.origin&&Ee.origin&&((Ee.origin.charAt(0)=="+"&&Ec.cm&&Ea.lastTime>EZ-Ec.cm.options.historyEventDelay)||Ee.origin.charAt(0)=="*"))){var EY=D8(Ed.changes);if(D9(Ee.from,Ee.to)&&D9(Ee.from,EY.to)){EY.to=B5(Ee)}else{Ed.changes.push(CS(Ec,Ee))}Ed.anchorAfter=Eb.anchor;Ed.headAfter=Eb.head}else{Ed={changes:[CS(Ec,Ee)],generation:Ea.generation,anchorBefore:Ec.sel.anchor,headBefore:Ec.sel.head,anchorAfter:Eb.anchor,headAfter:Eb.head};Ea.done.push(Ed);while(Ea.done.length>Ea.undoDepth){Ea.done.shift()}}Ea.generation=++Ea.maxGeneration;Ea.lastTime=EZ;Ea.lastOp=EX;Ea.lastOrigin=Ee.origin;if(!EY){AI(Ec,"historyAdded")}}function Ap(EZ){if(!EZ){return null}for(var EY=0,EX;EY<EZ.length;++EY){if(EZ[EY].marker.explicitlyCleared){if(!EX){EX=EZ.slice(0,EY)}}else{if(EX){EX.push(EZ[EY])}}}return !EX?EZ:EX.length?EX:null}function BR(Ea,Eb){var EZ=Eb["spans_"+Ea.id];if(!EZ){return null}for(var EY=0,EX=[];EY<Eb.text.length;++EY){EX.push(Ap(EZ[EY]))}return EX}function BD(Eh,Ea){for(var Ed=0,EY=[];Ed<Eh.length;++Ed){var EZ=Eh[Ed],Ef=EZ.changes,Eg=[];EY.push({changes:Eg,anchorBefore:EZ.anchorBefore,headBefore:EZ.headBefore,anchorAfter:EZ.anchorAfter,headAfter:EZ.headAfter});for(var Ec=0;Ec<Ef.length;++Ec){var Ee=Ef[Ec],Eb;Eg.push({from:Ee.from,to:Ee.to,text:Ee.text});if(Ea){for(var EX in Ee){if(Eb=EX.match(/^spans_(\d+)$/)){if(CL(Ea,Number(Eb[1]))>-1){D8(Eg)[EX]=Ee[EX];delete Ee[EX]}}}}}}return EY}function DV(Ea,EZ,EY,EX){if(EY<Ea.line){Ea.line+=EX}else{if(EZ<Ea.line){Ea.line=EZ;Ea.ch=0}}}function Dn(Ea,Ec,Ed,Ee){for(var EZ=0;EZ<Ea.length;++EZ){var EX=Ea[EZ],Eb=true;for(var EY=0;EY<EX.changes.length;++EY){var Ef=EX.changes[EY];if(!EX.copied){Ef.from=Bc(Ef.from);Ef.to=Bc(Ef.to)}if(Ed<Ef.from.line){Ef.from.line+=Ee;Ef.to.line+=Ee}else{if(Ec<=Ef.to.line){Eb=false;break}}}if(!EX.copied){EX.anchorBefore=Bc(EX.anchorBefore);EX.headBefore=Bc(EX.headBefore);EX.anchorAfter=Bc(EX.anchorAfter);EX.readAfter=Bc(EX.headAfter);EX.copied=true}if(!Eb){Ea.splice(0,EZ+1);EZ=0}else{DV(EX.anchorBefore);DV(EX.headBefore);DV(EX.anchorAfter);DV(EX.headAfter)}}}function Ca(EY,Eb){var Ea=Eb.from.line,EZ=Eb.to.line,EX=Eb.text.length-(EZ-Ea)-1;Dn(EY.done,Ea,EZ,EX);Dn(EY.undone,Ea,EZ,EX)}function DR(){C3(this)}function z(EX){if(!EX.stop){EX.stop=DR}return EX}function Bv(EX){if(EX.preventDefault){EX.preventDefault()}else{EX.returnValue=false}}function CP(EX){if(EX.stopPropagation){EX.stopPropagation()}else{EX.cancelBubble=true}}function BA(EX){return EX.defaultPrevented!=null?EX.defaultPrevented:EX.returnValue==false}function C3(EX){Bv(EX);CP(EX)}c.e_stop=C3;c.e_preventDefault=Bv;c.e_stopPropagation=CP;function e(EX){return EX.target||EX.srcElement}function EC(EY){var EX=EY.which;if(EX==null){if(EY.button&1){EX=1}else{if(EY.button&2){EX=3}else{if(EY.button&4){EX=2}}}}if(BQ&&EY.ctrlKey&&EX==1){EX=3}return EX}function BK(Ea,EY,EZ){if(Ea.addEventListener){Ea.addEventListener(EY,EZ,false)}else{if(Ea.attachEvent){Ea.attachEvent("on"+EY,EZ)}else{var Eb=Ea._handlers||(Ea._handlers={});var EX=Eb[EY]||(Eb[EY]=[]);EX.push(EZ)}}}function Cu(Eb,EZ,Ea){if(Eb.removeEventListener){Eb.removeEventListener(EZ,Ea,false)}else{if(Eb.detachEvent){Eb.detachEvent("on"+EZ,Ea)}else{var EX=Eb._handlers&&Eb._handlers[EZ];if(!EX){return }for(var EY=0;EY<EX.length;++EY){if(EX[EY]==Ea){EX.splice(EY,1);break}}}}}function AI(Eb,Ea){var EX=Eb._handlers&&Eb._handlers[Ea];if(!EX){return }var EY=Array.prototype.slice.call(arguments,2);for(var EZ=0;EZ<EX.length;++EZ){EX[EZ].apply(null,EY)}}var At,Bl=0;function p(Ec,Eb){var EX=Ec._handlers&&Ec._handlers[Eb];if(!EX){return }var EZ=Array.prototype.slice.call(arguments,2);if(!At){++Bl;At=[];setTimeout(DB,0)}function EY(Ed){return function(){Ed.apply(null,EZ)}}for(var Ea=0;Ea<EX.length;++Ea){At.push(EY(EX[Ea]))}}function AS(EX,EZ,EY){AI(EX,EY||EZ.type,EX,EZ);return BA(EZ)||EZ.codemirrorIgnore}function DB(){--Bl;var EX=At;At=null;for(var EY=0;EY<EX.length;++EY){EX[EY]()}}function Dq(EZ,EY){var EX=EZ._handlers&&EZ._handlers[EY];return EX&&EX.length>0}c.on=BK;c.off=Cu;c.signal=AI;function A0(EX){EX.prototype.on=function(EY,EZ){BK(this,EY,EZ)};EX.prototype.off=function(EY,EZ){Cu(this,EY,EZ)}}var Ao=30;var BV=c.Pass={toString:function(){return"CodeMirror.Pass"}};function EW(){this.id=null}EW.prototype={set:function(EX,EY){clearTimeout(this.id);this.id=setTimeout(EY,EX)}};function BG(EZ,EX,Eb,Ec,EY){if(EX==null){EX=EZ.search(/[^\s\u00a0]/);if(EX==-1){EX=EZ.length}}for(var Ea=Ec||0,Ed=EY||0;Ea<EX;++Ea){if(EZ.charAt(Ea)=="\t"){Ed+=Eb-(Ed%Eb)}else{++Ed}}return Ed}c.countColumn=BG;var AW=[""];function Bj(EX){while(AW.length<=EX){AW.push(D8(AW)+" ")}return AW[EX]}function D8(EX){return EX[EX.length-1]}function Cd(EY){if(DY){EY.selectionStart=0;EY.selectionEnd=EY.value.length}else{try{EY.select()}catch(EX){}}}function CL(Ea,EX){if(Ea.indexOf){return Ea.indexOf(EX)}for(var EY=0,EZ=Ea.length;EY<EZ;++EY){if(Ea[EY]==EX){return EY}}return -1}function Bd(Ea,EY){function EX(){}EX.prototype=Ea;var EZ=new EX();if(EY){AN(EY,EZ)}return EZ}function AN(EY,EX){if(!EX){EX={}}for(var EZ in EY){if(EY.hasOwnProperty(EZ)){EX[EZ]=EY[EZ]}}return EX}function v(EZ){for(var EX=[],EY=0;EY<EZ;++EY){EX.push(undefined)}return EX}function Bo(EY){var EX=Array.prototype.slice.call(arguments,1);return function(){return EY.apply(null,EX)}}var Ah=/[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Br(EX){return/\w/.test(EX)||EX>"\x80"&&(EX.toUpperCase()!=EX.toLowerCase()||Ah.test(EX))}function DT(EX){for(var EY in EX){if(EX.hasOwnProperty(EY)&&EX[EY]){return false}}return true}var DM=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Dw(EX){return EX.charCodeAt(0)>=768&&DM.test(EX)}function EK(EX,Eb,Ea,EZ){var Ec=document.createElement(EX);if(Ea){Ec.className=Ea}if(EZ){Ec.style.cssText=EZ}if(typeof Eb=="string"){L(Ec,Eb)}else{if(Eb){for(var EY=0;EY<Eb.length;++EY){Ec.appendChild(Eb[EY])}}}return Ec}function Cl(EY){for(var EX=EY.childNodes.length;EX>0;--EX){EY.removeChild(EY.firstChild)}return EY}function BF(EX,EY){return Cl(EX).appendChild(EY)}function L(EX,EY){if(Be){EX.innerHTML="";EX.appendChild(document.createTextNode(EY))}else{EX.textContent=EY}}function AO(EX){return EX.getBoundingClientRect()}c.replaceGetRect=function(EX){AO=EX};var DN=function(){if(Be){return false}var EX=EK("div");return"draggable" in EX||"dragDrop" in EX}();function BU(){return false}if(Bi){BU=function(EY,EX){return EY.charCodeAt(EX-1)==36&&EY.charCodeAt(EX)==39}}else{if(AH&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)){BU=function(EY,EX){return/\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(EY.slice(EX-1,EX+1))}}else{if(B8&&/Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)){BU=function(EZ,EX){var EY=EZ.charCodeAt(EX-1);return EY>=8208&&EY<=8212}}else{if(B8){BU=function(EY,EX){if(EX>1&&EY.charCodeAt(EX-1)==45){if(/\w/.test(EY.charAt(EX-2))&&/[^\-?\.]/.test(EY.charAt(EX))){return true}if(EX>2&&/[\d\.,]/.test(EY.charAt(EX-2))&&/[\d\.,]/.test(EY.charAt(EX))){return false}}return/[~!#%&*)=+}\]\\|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|\u2026[\w~`@#$%\^&*(_=+{[><]/.test(EY.slice(EX-1,EX+1))}}}}}var C7;function I(EX){if(C7!=null){return C7}var EY=EK("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");BF(EX,EY);if(EY.offsetWidth){C7=EY.offsetHeight-EY.clientHeight}return C7||0}var EB;function As(EX){if(EB==null){var EY=EK("span","\u200b");BF(EX,EK("span",[EY,document.createTextNode("x")]));if(EX.firstChild.offsetHeight!=0){EB=EY.offsetWidth<=1&&EY.offsetHeight>2&&!Bf}}if(EB){return EK("span","\u200b")}else{return EK("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")}}var AX="\n\nb".split(/\n/).length!=3?function(Ec){var Ed=0,EX=[],Eb=Ec.length;while(Ed<=Eb){var Ea=Ec.indexOf("\n",Ed);if(Ea==-1){Ea=Ec.length}var EZ=Ec.slice(Ed,Ec.charAt(Ea-1)=="\r"?Ea-1:Ea);var EY=EZ.indexOf("\r");if(EY!=-1){EX.push(EZ.slice(0,EY));Ed+=EY+1}else{EX.push(EZ);Ed=Ea+1}}return EX}:function(EX){return EX.split(/\r\n?|\n/)};c.splitLines=AX;var Ax=window.getSelection?function(EY){try{return EY.selectionStart!=EY.selectionEnd}catch(EX){return false}}:function(EZ){try{var EX=EZ.ownerDocument.selection.createRange()}catch(EY){}if(!EX||EX.parentElement()!=EZ){return false}return EX.compareEndPoints("StartToEnd",EX)!=0};var CE=(function(){var EX=EK("div");if("oncopy" in EX){return true}EX.setAttribute("oncopy","return;");return typeof EX.oncopy=="function"})();var Dm={3:"Enter",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",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};c.keyNames=Dm;(function(){for(var EX=0;EX<10;EX++){Dm[EX+48]=Dm[EX+96]=String(EX)}for(var EX=65;EX<=90;EX++){Dm[EX]=String.fromCharCode(EX)}for(var EX=1;EX<=12;EX++){Dm[EX+111]=Dm[EX+63235]="F"+EX}})();function Cm(EX,Ed,Ec,Eb){if(!EX){return Eb(Ed,Ec,"ltr")}var Ea=false;for(var EZ=0;EZ<EX.length;++EZ){var EY=EX[EZ];if(EY.from<Ec&&EY.to>Ed||Ed==Ec&&EY.to==Ed){Eb(Math.max(EY.from,Ed),Math.min(EY.to,Ec),EY.level==1?"rtl":"ltr");Ea=true}}if(!Ea){Eb(Ed,Ec,"ltr")}}function CV(EX){return EX.level%2?EX.to:EX.from}function ES(EX){return EX.level%2?EX.from:EX.to}function Bu(EY){var EX=A(EY);return EX?CV(EX[0]):0}function B4(EY){var EX=A(EY);if(!EX){return EY.text.length}return ES(D8(EX))}function Ay(EY,Eb){var EZ=Dk(EY.doc,Eb);var Ec=V(EY.doc,EZ);if(Ec!=EZ){Eb=BC(Ec)}var EX=A(Ec);var Ea=!EX?0:EX[0].level%2?B4(Ec):Bu(Ec);return l(Eb,Ea)}function Cf(EZ,Ec){var EY,Ea;while(EY=C6(Ea=Dk(EZ.doc,Ec))){Ec=EY.find().to.line}var EX=A(Ea);var Eb=!EX?Ea.text.length:EX[0].level%2?Bu(Ea):B4(Ea);return l(Ec,Eb)}function y(EY,EZ,EX){var Ea=EY[0].level;if(EZ==Ea){return true}if(EX==Ea){return false}return EZ<EX}var DZ;function AK(EX,Eb){DZ=null;for(var EY=0,EZ;EY<EX.length;++EY){var Ea=EX[EY];if(Ea.from<Eb&&Ea.to>Eb){return EY}if((Ea.from==Eb||Ea.to==Eb)){if(EZ==null){EZ=EY}else{if(y(EX,Ea.level,EX[EZ].level)){if(Ea.from!=Ea.to){DZ=EZ}return EY}else{if(Ea.from!=Ea.to){DZ=EY}return EZ}}}}return EZ}function Dj(EX,Ea,EY,EZ){if(!EZ){return Ea+EY}do{Ea+=EY}while(Ea>0&&Dw(EX.text.charAt(Ea)));return Ea}function R(EX,Ee,EZ,Ea){var Eb=A(EX);if(!Eb){return s(EX,Ee,EZ,Ea)}var Ed=AK(Eb,Ee),EY=Eb[Ed];var Ec=Dj(EX,Ee,EY.level%2?-EZ:EZ,Ea);for(;;){if(Ec>EY.from&&Ec<EY.to){return Ec}if(Ec==EY.from||Ec==EY.to){if(AK(Eb,Ec)==Ed){return Ec}EY=Eb[Ed+=EZ];return(EZ>0)==EY.level%2?EY.to:EY.from}else{EY=Eb[Ed+=EZ];if(!EY){return null}if((EZ>0)==EY.level%2){Ec=Dj(EX,EY.to,-1,Ea)}else{Ec=Dj(EX,EY.from,1,Ea)}}}}function s(EX,Eb,EY,EZ){var Ea=Eb+EY;if(EZ){while(Ea>0&&Dw(EX.text.charAt(Ea))){Ea+=EY}}return Ea<0||Ea>EX.text.length?null:Ea}var Al=(function(){var Ed="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL";var Eb="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr";function Ea(Eg){if(Eg<=255){return Ed.charAt(Eg)}else{if(1424<=Eg&&Eg<=1524){return"R"}else{if(1536<=Eg&&Eg<=1791){return Eb.charAt(Eg-1536)}else{if(1792<=Eg&&Eg<=2220){return"r"}else{return"L"}}}}}var EX=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var Ef=/[stwN]/,EZ=/[LRr]/,EY=/[Lb1n]/,Ec=/[1n]/;var Ee="L";return function(Eq){if(!EX.test(Eq)){return false}var Ew=Eq.length,Em=[];for(var Ev=0,Ei;Ev<Ew;++Ev){Em.push(Ei=Ea(Eq.charCodeAt(Ev)))}for(var Ev=0,Ep=Ee;Ev<Ew;++Ev){var Ei=Em[Ev];if(Ei=="m"){Em[Ev]=Ep}else{Ep=Ei}}for(var Ev=0,Eg=Ee;Ev<Ew;++Ev){var Ei=Em[Ev];if(Ei=="1"&&Eg=="r"){Em[Ev]="n"}else{if(EZ.test(Ei)){Eg=Ei;if(Ei=="r"){Em[Ev]="R"}}}}for(var Ev=1,Ep=Em[0];Ev<Ew-1;++Ev){var Ei=Em[Ev];if(Ei=="+"&&Ep=="1"&&Em[Ev+1]=="1"){Em[Ev]="1"}else{if(Ei==","&&Ep==Em[Ev+1]&&(Ep=="1"||Ep=="n")){Em[Ev]=Ep}}Ep=Ei}for(var Ev=0;Ev<Ew;++Ev){var Ei=Em[Ev];if(Ei==","){Em[Ev]="N"}else{if(Ei=="%"){for(var Ej=Ev+1;Ej<Ew&&Em[Ej]=="%";++Ej){}var Ex=(Ev&&Em[Ev-1]=="!")||(Ej<Ew&&Em[Ej]=="1")?"1":"N";for(var Et=Ev;Et<Ej;++Et){Em[Et]=Ex}Ev=Ej-1}}}for(var Ev=0,Eg=Ee;Ev<Ew;++Ev){var Ei=Em[Ev];if(Eg=="L"&&Ei=="1"){Em[Ev]="L"}else{if(EZ.test(Ei)){Eg=Ei}}}for(var Ev=0;Ev<Ew;++Ev){if(Ef.test(Em[Ev])){for(var Ej=Ev+1;Ej<Ew&&Ef.test(Em[Ej]);++Ej){}var En=(Ev?Em[Ev-1]:Ee)=="L";var Eh=(Ej<Ew?Em[Ej]:Ee)=="L";var Ex=En||Eh?"L":"R";for(var Et=Ev;Et<Ej;++Et){Em[Et]=Ex}Ev=Ej-1}}var Eu=[],Er;for(var Ev=0;Ev<Ew;){if(EY.test(Em[Ev])){var Ek=Ev;for(++Ev;Ev<Ew&&EY.test(Em[Ev]);++Ev){}Eu.push({from:Ek,to:Ev,level:0})}else{var El=Ev,Eo=Eu.length;for(++Ev;Ev<Ew&&Em[Ev]!="L";++Ev){}for(var Et=El;Et<Ev;){if(Ec.test(Em[Et])){if(El<Et){Eu.splice(Eo,0,{from:El,to:Et,level:1})}var Es=Et;for(++Et;Et<Ev&&Ec.test(Em[Et]);++Et){}Eu.splice(Eo,0,{from:Es,to:Et,level:2});El=Et}else{++Et}}if(El<Ev){Eu.splice(Eo,0,{from:El,to:Ev,level:1})}}}if(Eu[0].level==1&&(Er=Eq.match(/^\s+/))){Eu[0].from=Er[0].length;Eu.unshift({from:0,to:Er[0].length,level:0})}if(D8(Eu).level==1&&(Er=Eq.match(/\s+$/))){D8(Eu).to-=Er[0].length;Eu.push({from:Ew-Er[0].length,to:Ew,level:0})}if(Eu[0].level!=D8(Eu).level){Eu.push({from:Ew,to:Ew,level:Eu[0].level})}return Eu}})();c.version="3.22.1";return c})();

Zerion Mini Shell 1.0