玛氪宕·梦魔(Markdown Memo),使用Markdown的云端备忘录,百度IFE的RIA启航班的不合格的作业,才……才没有什么阴谋呢!
源gitee链接https://gitee.com/arathi/MarkdownMemo?_from=gitee_search
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
154 KiB
2 lines
154 KiB
/*! CodeMirror v4.12.0 | Copyright (C) 2014 by Marijn Haverbeke <marijnh@gmail.com> and others | MIT license: http://codemirror.net/LICENSE | https://github.com/codemirror/codemirror */
|
|
(function(a){if(typeof exports=="object"&&typeof module=="object"){module.exports=a()}else{if(typeof define=="function"&&define.amd){return define([],a)}else{this.CodeMirror=a()}}})(function(){var co=/gecko\/\d/i.test(navigator.userAgent);var eG=/MSIE \d/.test(navigator.userAgent);var bI=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);var dG=eG||bI;var k=dG&&(eG?document.documentMode||6:bI[1]);var cY=/WebKit\//.test(navigator.userAgent);var dJ=cY&&/Qt\/\d+\.\d+/.test(navigator.userAgent);var da=/Chrome\//.test(navigator.userAgent);var dY=/Opera\//.test(navigator.userAgent);var aA=/Apple Computer/.test(navigator.vendor);var a8=/KHTML\//.test(navigator.userAgent);var c5=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);var fr=/PhantomJS/.test(navigator.userAgent);var eX=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent);var ec=eX||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);var b6=eX||/Mac/.test(navigator.platform);var aM=/win/i.test(navigator.platform);var aV=dY&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);if(aV){aV=Number(aV[1])}if(aV&&aV>=15){dY=false;cY=true}var bP=b6&&(dJ||dY&&(aV==null||aV<12.11));var f0=co||(dG&&k>=9);var f3=false,a4=false;function I(f8,f9){if(!(this instanceof I)){return new I(f8,f9)}this.options=f9=f9?aK(f9):{};aK(eZ,f9,false);cd(f9);var gd=f9.value;if(typeof gd=="string"){gd=new ar(gd,f9.mode)}this.doc=gd;var gc=this.display=new eE(f8,gd);gc.wrapper.CodeMirror=this;d8(this);cM(this);if(f9.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}if(f9.autofocus&&!ec){ev(this)}aB(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,focused:false,suppressEdits:false,pasteIncoming:false,cutIncoming:false,draggingText:false,highlight:new f7(),keySeq:null};if(dG&&k<11){setTimeout(cv(fl,this,true),20)}fM(this);bg();cG(this);this.curOp.forceUpdate=true;d7(this,gd);if((f9.autofocus&&!ec)||dK()==gc.input){setTimeout(cv(cA,this),20)}else{aS(this)}for(var gb in bc){if(bc.hasOwnProperty(gb)){bc[gb](this,f9[gb],cb)}}d1(this);for(var ga=0;ga<a5.length;++ga){a5[ga](this)}al(this);if(cY&&f9.lineWrapping&&getComputedStyle(gc.lineDiv).textRendering=="optimizelegibility"){gc.lineDiv.style.textRendering="auto"}}function eE(f8,ga){var gb=this;var f9=gb.input=fT("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");if(cY){f9.style.width="1000px"}else{f9.setAttribute("wrap","off")}if(eX){f9.style.border="1px solid black"}f9.setAttribute("autocorrect","off");f9.setAttribute("autocapitalize","off");f9.setAttribute("spellcheck","false");gb.inputDiv=fT("div",[f9],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");gb.scrollbarFiller=fT("div",null,"CodeMirror-scrollbar-filler");gb.scrollbarFiller.setAttribute("not-content","true");gb.gutterFiller=fT("div",null,"CodeMirror-gutter-filler");gb.gutterFiller.setAttribute("not-content","true");gb.lineDiv=fT("div",null,"CodeMirror-code");gb.selectionDiv=fT("div",null,null,"position: relative; z-index: 1");gb.cursorDiv=fT("div",null,"CodeMirror-cursors");gb.measure=fT("div",null,"CodeMirror-measure");gb.lineMeasure=fT("div",null,"CodeMirror-measure");gb.lineSpace=fT("div",[gb.measure,gb.lineMeasure,gb.selectionDiv,gb.cursorDiv,gb.lineDiv],null,"position: relative; outline: none");gb.mover=fT("div",[fT("div",[gb.lineSpace],"CodeMirror-lines")],null,"position: relative");gb.sizer=fT("div",[gb.mover],"CodeMirror-sizer");gb.sizerWidth=null;gb.heightForcer=fT("div",null,null,"position: absolute; height: "+dF+"px; width: 1px;");gb.gutters=fT("div",null,"CodeMirror-gutters");gb.lineGutter=null;gb.scroller=fT("div",[gb.sizer,gb.heightForcer,gb.gutters],"CodeMirror-scroll");gb.scroller.setAttribute("tabIndex","-1");gb.wrapper=fT("div",[gb.inputDiv,gb.scrollbarFiller,gb.gutterFiller,gb.scroller],"CodeMirror");if(dG&&k<8){gb.gutters.style.zIndex=-1;gb.scroller.style.paddingRight=0}if(eX){f9.style.width="0px"}if(!cY){gb.scroller.draggable=true}if(a8){gb.inputDiv.style.height="1px";gb.inputDiv.style.position="absolute"}if(f8){if(f8.appendChild){f8.appendChild(gb.wrapper)}else{f8(gb.wrapper)}}gb.viewFrom=gb.viewTo=ga.first;gb.reportedViewFrom=gb.reportedViewTo=ga.first;gb.view=[];gb.renderedView=null;gb.externalMeasured=null;gb.viewOffset=0;gb.lastWrapHeight=gb.lastWrapWidth=0;gb.updateLineNumbers=null;gb.nativeBarWidth=gb.barHeight=gb.barWidth=0;gb.scrollbarsClipped=false;gb.lineNumWidth=gb.lineNumInnerWidth=gb.lineNumChars=null;gb.prevInput="";gb.alignWidgets=false;gb.pollingFast=false;gb.poll=new f7();gb.cachedCharWidth=gb.cachedTextHeight=gb.cachedPaddingH=null;gb.inaccurateSelection=false;gb.maxLine=null;gb.maxLineLength=0;gb.maxLineChanged=false;gb.wheelDX=gb.wheelDY=gb.wheelStartX=gb.wheelStartY=null;gb.shift=false;gb.selForContextMenu=null}function bq(f8){f8.doc.mode=I.getMode(f8.options,f8.doc.modeOption);eh(f8)}function eh(f8){f8.doc.iter(function(f9){if(f9.stateAfter){f9.stateAfter=null}if(f9.styles){f9.styles=null}});f8.doc.frontier=f8.doc.first;eb(f8,100);f8.state.modeGen++;if(f8.curOp){ag(f8)}}function eC(f8){if(f8.options.lineWrapping){fx(f8.display.wrapper,"CodeMirror-wrap");f8.display.sizer.style.minWidth="";f8.display.sizerWidth=null}else{f(f8.display.wrapper,"CodeMirror-wrap");g(f8)}Y(f8);ag(f8);aj(f8);setTimeout(function(){eU(f8)},100)}function bb(f8){var ga=aU(f8.display),f9=f8.options.lineWrapping;var gb=f9&&Math.max(5,f8.display.scroller.clientWidth/dz(f8.display)-3);return function(gd){if(ft(f8.doc,gd)){return 0}var gc=0;if(gd.widgets){for(var ge=0;ge<gd.widgets.length;ge++){if(gd.widgets[ge].height){gc+=gd.widgets[ge].height}}}if(f9){return gc+(Math.ceil(gd.text.length/gb)||1)*ga}else{return gc+ga}}}function Y(f8){var ga=f8.doc,f9=bb(f8);ga.iter(function(gb){var gc=f9(gb);if(gc!=gb.height){fW(gb,gc)}})}function cM(f8){f8.display.wrapper.className=f8.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+f8.options.theme.replace(/(^|\s)\s*/g," cm-s-");aj(f8)}function ds(f8){d8(f8);ag(f8);setTimeout(function(){eA(f8)},20)}function d8(f8){var f9=f8.display.gutters,gd=f8.options.gutters;dX(f9);for(var ga=0;ga<gd.length;++ga){var gb=gd[ga];var gc=f9.appendChild(fT("div",null,"CodeMirror-gutter "+gb));if(gb=="CodeMirror-linenumbers"){f8.display.lineGutter=gc;gc.style.width=(f8.display.lineNumWidth||1)+"px"}}f9.style.display=ga?"":"none";c2(f8)}function c2(f8){var f9=f8.display.gutters.offsetWidth;f8.display.sizer.style.marginLeft=f9+"px"}function ej(ga){if(ga.height==0){return 0}var f9=ga.text.length,f8,gc=ga;while(f8=eK(gc)){var gb=f8.find(0,true);gc=gb.from.line;f9+=gb.from.ch-gb.to.ch}gc=ga;while(f8=er(gc)){var gb=f8.find(0,true);f9-=gc.text.length-gb.from.ch;gc=gb.to.line;f9+=gc.text.length-gb.to.ch}return f9}function g(f8){var ga=f8.display,f9=f8.doc;ga.maxLine=fb(f9,f9.first);ga.maxLineLength=ej(ga.maxLine);ga.maxLineChanged=true;f9.iter(function(gc){var gb=ej(gc);if(gb>ga.maxLineLength){ga.maxLineLength=gb;ga.maxLine=gc}})}function cd(f8){var f9=df(f8.gutters,"CodeMirror-linenumbers");if(f9==-1&&f8.lineNumbers){f8.gutters=f8.gutters.concat(["CodeMirror-linenumbers"])}else{if(f9>-1&&!f8.lineNumbers){f8.gutters=f8.gutters.slice(0);f8.gutters.splice(f9,1)}}}function dw(f8){var gb=f8.display,ga=gb.gutters.offsetWidth;var f9=Math.round(f8.doc.height+bH(f8.display));return{clientHeight:gb.scroller.clientHeight,viewHeight:gb.wrapper.clientHeight,scrollWidth:gb.scroller.scrollWidth,clientWidth:gb.scroller.clientWidth,viewWidth:gb.wrapper.clientWidth,barLeft:f8.options.fixedGutter?ga:0,docHeight:f9,scrollHeight:f9+cR(f8)+gb.barHeight,nativeBarWidth:gb.nativeBarWidth,gutterWidth:ga}}function dh(ga,f9,f8){this.cm=f8;var gb=this.vert=fT("div",[fT("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var gc=this.horiz=fT("div",[fT("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");ga(gb);ga(gc);bW(gb,"scroll",function(){if(gb.clientHeight){f9(gb.scrollTop,"vertical")}});bW(gc,"scroll",function(){if(gc.clientWidth){f9(gc.scrollLeft,"horizontal")}});this.checkedOverlay=false;if(dG&&k<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}}dh.prototype=aK({update:function(gb){var gc=gb.scrollWidth>gb.clientWidth+1;var ga=gb.scrollHeight>gb.clientHeight+1;var gd=gb.nativeBarWidth;if(ga){this.vert.style.display="block";this.vert.style.bottom=gc?gd+"px":"0";var f9=gb.viewHeight-(gc?gd:0);this.vert.firstChild.style.height=Math.max(0,gb.scrollHeight-gb.clientHeight+f9)+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(gc){this.horiz.style.display="block";this.horiz.style.right=ga?gd+"px":"0";this.horiz.style.left=gb.barLeft+"px";var f8=gb.viewWidth-gb.barLeft-(ga?gd:0);this.horiz.firstChild.style.width=(gb.scrollWidth-gb.clientWidth+f8)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedOverlay&&gb.clientHeight>0){if(gd==0){this.overlayHack()}this.checkedOverlay=true}return{right:ga?gd:0,bottom:gc?gd:0}},setScrollLeft:function(f8){if(this.horiz.scrollLeft!=f8){this.horiz.scrollLeft=f8}},setScrollTop:function(f8){if(this.vert.scrollTop!=f8){this.vert.scrollTop=f8}},overlayHack:function(){var f8=b6&&!c5?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=f8;var f9=this;var ga=function(gb){if(M(gb)!=f9.vert&&M(gb)!=f9.horiz){c0(f9.cm,ep)(gb)}};bW(this.vert,"mousedown",ga);bW(this.horiz,"mousedown",ga)},clear:function(){var f8=this.horiz.parentNode;f8.removeChild(this.horiz);f8.removeChild(this.vert)}},dh.prototype);function e0(){}e0.prototype=aK({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},e0.prototype);I.scrollbarModel={"native":dh,"null":e0};function aB(f8){if(f8.display.scrollbars){f8.display.scrollbars.clear();if(f8.display.scrollbars.addClass){f(f8.display.wrapper,f8.display.scrollbars.addClass)}}f8.display.scrollbars=new I.scrollbarModel[f8.options.scrollbarStyle](function(f9){f8.display.wrapper.insertBefore(f9,f8.display.scrollbarFiller);bW(f9,"mousedown",function(){if(f8.state.focused){setTimeout(cv(ev,f8),0)}});f9.setAttribute("not-content","true")},function(ga,f9){if(f9=="horizontal"){bD(f8,ga)}else{O(f8,ga)}},f8);if(f8.display.scrollbars.addClass){fx(f8.display.wrapper,f8.display.scrollbars.addClass)}}function eU(ga,gc){if(!gc){gc=dw(ga)}var f9=ga.display.barWidth,f8=ga.display.barHeight;aR(ga,gc);for(var gb=0;gb<4&&f9!=ga.display.barWidth||f8!=ga.display.barHeight;gb++){if(f9!=ga.display.barWidth&&ga.options.lineWrapping){a6(ga)}aR(ga,dw(ga));f9=ga.display.barWidth;f8=ga.display.barHeight}}function aR(f8,f9){var gb=f8.display;var ga=gb.scrollbars.update(f9);gb.sizer.style.paddingRight=(gb.barWidth=ga.right)+"px";gb.sizer.style.paddingBottom=(gb.barHeight=ga.bottom)+"px";if(ga.right&&ga.bottom){gb.scrollbarFiller.style.display="block";gb.scrollbarFiller.style.height=ga.bottom+"px";gb.scrollbarFiller.style.width=ga.right+"px"}else{gb.scrollbarFiller.style.display=""}if(ga.bottom&&f8.options.coverGutterNextToScrollbar&&f8.options.fixedGutter){gb.gutterFiller.style.display="block";gb.gutterFiller.style.height=ga.bottom+"px";gb.gutterFiller.style.width=f9.gutterWidth+"px"}else{gb.gutterFiller.style.display=""}}function b5(gb,gf,ga){var gc=ga&&ga.top!=null?Math.max(0,ga.top):gb.scroller.scrollTop;gc=Math.floor(gc-e4(gb));var f8=ga&&ga.bottom!=null?ga.bottom:gc+gb.wrapper.clientHeight;var gd=bF(gf,gc),ge=bF(gf,f8);if(ga&&ga.ensure){var f9=ga.ensure.from.line,gg=ga.ensure.to.line;if(f9<gd){gd=f9;ge=bF(gf,bL(fb(gf,f9))+gb.wrapper.clientHeight)}else{if(Math.min(gg,gf.lastLine())>=ge){gd=bF(gf,bL(fb(gf,gg))-gb.wrapper.clientHeight);ge=gg}}}return{from:gd,to:Math.max(ge,gd+1)}}function eA(gg){var ge=gg.display,gf=ge.view;if(!ge.alignWidgets&&(!ge.gutters.firstChild||!gg.options.fixedGutter)){return}var gc=dT(ge)-ge.scroller.scrollLeft+gg.doc.scrollLeft;var f8=ge.gutters.offsetWidth,f9=gc+"px";for(var gb=0;gb<gf.length;gb++){if(!gf[gb].hidden){if(gg.options.fixedGutter&&gf[gb].gutter){gf[gb].gutter.style.left=f9}var gd=gf[gb].alignable;if(gd){for(var ga=0;ga<gd.length;ga++){gd[ga].style.left=f9}}}}if(gg.options.fixedGutter){ge.gutters.style.left=(gc+f8)+"px"}}function d1(f8){if(!f8.options.lineNumbers){return false}var gd=f8.doc,f9=eo(f8.options,gd.first+gd.size-1),gc=f8.display;if(f9.length!=gc.lineNumChars){var ge=gc.measure.appendChild(fT("div",[fT("div",f9)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var ga=ge.firstChild.offsetWidth,gb=ge.offsetWidth-ga;gc.lineGutter.style.width="";gc.lineNumInnerWidth=Math.max(ga,gc.lineGutter.offsetWidth-gb);gc.lineNumWidth=gc.lineNumInnerWidth+gb;gc.lineNumChars=gc.lineNumInnerWidth?f9.length:-1;gc.lineGutter.style.width=gc.lineNumWidth+"px";c2(f8);return true}return false}function eo(f8,f9){return String(f8.lineNumberFormatter(f9+f8.firstLineNumber))}function dT(f8){return f8.scroller.getBoundingClientRect().left-f8.sizer.getBoundingClientRect().left}function aG(f9,f8,ga){var gb=f9.display;this.viewport=f8;this.visible=b5(gb,f9.doc,f8);this.editorIsHidden=!gb.wrapper.offsetWidth;this.wrapperHeight=gb.wrapper.clientHeight;this.wrapperWidth=gb.wrapper.clientWidth;this.oldDisplayWidth=di(f9);this.force=ga;this.dims=e9(f9)}function K(f8){var f9=f8.display;if(!f9.scrollbarsClipped&&f9.scroller.offsetWidth){f9.nativeBarWidth=f9.scroller.offsetWidth-f9.scroller.clientWidth;f9.heightForcer.style.height=cR(f8)+"px";f9.sizer.style.marginBottom=-f9.nativeBarWidth+"px";f9.sizer.style.borderRightWidth=cR(f8)+"px";f9.scrollbarsClipped=true}}function C(gh,gb){var gc=gh.display,gg=gh.doc;if(gb.editorIsHidden){es(gh);return false}if(!gb.force&&gb.visible.from>=gc.viewFrom&&gb.visible.to<=gc.viewTo&&(gc.updateLineNumbers==null||gc.updateLineNumbers>=gc.viewTo)&&gc.renderedView==gc.view&&c9(gh)==0){return false}if(d1(gh)){es(gh);gb.dims=e9(gh)}var ga=gg.first+gg.size;var ge=Math.max(gb.visible.from-gh.options.viewportMargin,gg.first);var gf=Math.min(ga,gb.visible.to+gh.options.viewportMargin);if(gc.viewFrom<ge&&ge-gc.viewFrom<20){ge=Math.max(gg.first,gc.viewFrom)}if(gc.viewTo>gf&&gc.viewTo-gf<20){gf=Math.min(ga,gc.viewTo)}if(a4){ge=aT(gh.doc,ge);gf=dZ(gh.doc,gf)}var f9=ge!=gc.viewFrom||gf!=gc.viewTo||gc.lastWrapHeight!=gb.wrapperHeight||gc.lastWrapWidth!=gb.wrapperWidth;cP(gh,ge,gf);gc.viewOffset=bL(fb(gh.doc,gc.viewFrom));gh.display.mover.style.top=gc.viewOffset+"px";var f8=c9(gh);if(!f9&&f8==0&&!gb.force&&gc.renderedView==gc.view&&(gc.updateLineNumbers==null||gc.updateLineNumbers>=gc.viewTo)){return false}var gd=dK();if(f8>4){gc.lineDiv.style.display="none"}cm(gh,gc.updateLineNumbers,gb.dims);if(f8>4){gc.lineDiv.style.display=""}gc.renderedView=gc.view;if(gd&&dK()!=gd&&gd.offsetHeight){gd.focus()}dX(gc.cursorDiv);dX(gc.selectionDiv);gc.gutters.style.height=0;if(f9){gc.lastWrapHeight=gb.wrapperHeight;gc.lastWrapWidth=gb.wrapperWidth;eb(gh,400)}gc.updateLineNumbers=null;return true}function cj(f9,gd){var gb=gd.force,f8=gd.viewport;for(var gc=true;;gc=false){if(gc&&f9.options.lineWrapping&&gd.oldDisplayWidth!=di(f9)){gb=true}else{gb=false;if(f8&&f8.top!=null){f8={top:Math.min(f9.doc.height+bH(f9.display)-cT(f9),f8.top)}}gd.visible=b5(f9.display,f9.doc,f8);if(gd.visible.from>=f9.display.viewFrom&&gd.visible.to<=f9.display.viewTo){break}}if(!C(f9,gd)){break}a6(f9);var ga=dw(f9);bB(f9);dv(f9,ga);eU(f9,ga)}ad(f9,"update",f9);if(f9.display.viewFrom!=f9.display.reportedViewFrom||f9.display.viewTo!=f9.display.reportedViewTo){ad(f9,"viewportChange",f9,f9.display.viewFrom,f9.display.viewTo);f9.display.reportedViewFrom=f9.display.viewFrom;f9.display.reportedViewTo=f9.display.viewTo}}function dP(f9,f8){var gb=new aG(f9,f8);if(C(f9,gb)){a6(f9);cj(f9,gb);var ga=dw(f9);bB(f9);dv(f9,ga);eU(f9,ga)}}function dv(f8,f9){f8.display.sizer.style.minHeight=f9.docHeight+"px";var ga=f9.docHeight+f8.display.barHeight;f8.display.heightForcer.style.top=ga+"px";f8.display.gutters.style.height=Math.max(ga+cR(f8),f9.clientHeight)+"px"}function a6(gf){var gd=gf.display;var f9=gd.lineDiv.offsetTop;for(var ga=0;ga<gd.view.length;ga++){var gg=gd.view[ga],gh;if(gg.hidden){continue}if(dG&&k<8){var gc=gg.node.offsetTop+gg.node.offsetHeight;gh=gc-f9;f9=gc}else{var gb=gg.node.getBoundingClientRect();gh=gb.bottom-gb.top}var ge=gg.line.height-gh;if(gh<2){gh=aU(gd)}if(ge>0.001||ge<-0.001){fW(gg.line,gh);ca(gg.line);if(gg.rest){for(var f8=0;f8<gg.rest.length;f8++){ca(gg.rest[f8])}}}}}function ca(f8){if(f8.widgets){for(var f9=0;f9<f8.widgets.length;++f9){f8.widgets[f9].height=f8.widgets[f9].node.offsetHeight}}}function e9(f8){var gd=f8.display,gb={},ga={};var gc=gd.gutters.clientLeft;for(var ge=gd.gutters.firstChild,f9=0;ge;ge=ge.nextSibling,++f9){gb[f8.options.gutters[f9]]=ge.offsetLeft+ge.clientLeft+gc;ga[f8.options.gutters[f9]]=ge.clientWidth}return{fixedPos:dT(gd),gutterTotalWidth:gd.gutters.offsetWidth,gutterLeft:gb,gutterWidth:ga,wrapperWidth:gd.wrapper.clientWidth}}function cm(gj,ga,gi){var gf=gj.display,gl=gj.options.lineNumbers;var f8=gf.lineDiv,gk=f8.firstChild;function ge(gn){var gm=gn.nextSibling;if(cY&&b6&&gj.display.currentWheelTarget==gn){gn.style.display="none"}else{gn.parentNode.removeChild(gn)}return gm}var gg=gf.view,gd=gf.viewFrom;for(var gb=0;gb<gg.length;gb++){var gc=gg[gb];if(gc.hidden){}else{if(!gc.node){var f9=aD(gj,gc,gd,gi);f8.insertBefore(f9,gk)}else{while(gk!=gc.node){gk=ge(gk)}var gh=gl&&ga!=null&&ga<=gd&&gc.lineNumber;if(gc.changes){if(df(gc.changes,"gutter")>-1){gh=false}aa(gj,gc,gd,gi)}if(gh){dX(gc.lineNumber);gc.lineNumber.appendChild(document.createTextNode(eo(gj.options,gd)))}gk=gc.node.nextSibling}}gd+=gc.size}while(gk){gk=ge(gk)}}function aa(f8,ga,gc,gd){for(var f9=0;f9<ga.changes.length;f9++){var gb=ga.changes[f9];if(gb=="text"){fh(f8,ga)}else{if(gb=="gutter"){dd(f8,ga,gc,gd)}else{if(gb=="class"){dC(ga)}else{if(gb=="widget"){an(ga,gd)}}}}}ga.changes=null}function fF(f8){if(f8.node==f8.text){f8.node=fT("div",null,null,"position: relative");if(f8.text.parentNode){f8.text.parentNode.replaceChild(f8.node,f8.text)}f8.node.appendChild(f8.text);if(dG&&k<8){f8.node.style.zIndex=2}}return f8.node}function eq(f9){var f8=f9.bgClass?f9.bgClass+" "+(f9.line.bgClass||""):f9.line.bgClass;if(f8){f8+=" CodeMirror-linebackground"}if(f9.background){if(f8){f9.background.className=f8}else{f9.background.parentNode.removeChild(f9.background);f9.background=null}}else{if(f8){var ga=fF(f9);f9.background=ga.insertBefore(fT("div",null,f8),ga.firstChild)}}}function dR(f8,f9){var ga=f8.display.externalMeasured;if(ga&&ga.line==f9.line){f8.display.externalMeasured=null;f9.measure=ga.measure;return ga.built}return eN(f8,f9)}function fh(f8,gb){var f9=gb.text.className;var ga=dR(f8,gb);if(gb.text==gb.node){gb.node=ga.pre}gb.text.parentNode.replaceChild(ga.pre,gb.text);gb.text=ga.pre;if(ga.bgClass!=gb.bgClass||ga.textClass!=gb.textClass){gb.bgClass=ga.bgClass;gb.textClass=ga.textClass;dC(gb)}else{if(f9){gb.text.className=f9}}}function dC(f9){eq(f9);if(f9.line.wrapClass){fF(f9).className=f9.line.wrapClass}else{if(f9.node!=f9.text){f9.node.className=""}}var f8=f9.textClass?f9.textClass+" "+(f9.line.textClass||""):f9.line.textClass;f9.text.className=f8||""}function dd(gg,ge,gd,gf){if(ge.gutter){ge.node.removeChild(ge.gutter);ge.gutter=null}var gb=ge.line.gutterMarkers;if(gg.options.lineNumbers||gb){var f9=fF(ge);var gc=ge.gutter=f9.insertBefore(fT("div",null,"CodeMirror-gutter-wrapper","left: "+(gg.options.fixedGutter?gf.fixedPos:-gf.gutterTotalWidth)+"px; width: "+gf.gutterTotalWidth+"px"),ge.text);if(ge.line.gutterClass){gc.className+=" "+ge.line.gutterClass}if(gg.options.lineNumbers&&(!gb||!gb["CodeMirror-linenumbers"])){ge.lineNumber=gc.appendChild(fT("div",eo(gg.options,gd),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+gf.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+gg.display.lineNumInnerWidth+"px"))}if(gb){for(var ga=0;ga<gg.options.gutters.length;++ga){var f8=gg.options.gutters[ga],gh=gb.hasOwnProperty(f8)&&gb[f8];if(gh){gc.appendChild(fT("div",[gh],"CodeMirror-gutter-elt","left: "+gf.gutterLeft[f8]+"px; width: "+gf.gutterWidth[f8]+"px"))}}}}}function an(f8,gb){if(f8.alignable){f8.alignable=null}for(var ga=f8.node.firstChild,f9;ga;ga=f9){var f9=ga.nextSibling;if(ga.className=="CodeMirror-linewidget"){f8.node.removeChild(ga)}}fq(f8,gb)}function aD(f8,ga,gb,gc){var f9=dR(f8,ga);ga.text=ga.node=f9.pre;if(f9.bgClass){ga.bgClass=f9.bgClass}if(f9.textClass){ga.textClass=f9.textClass}dC(ga);dd(f8,ga,gb,gc);fq(ga,gc);return ga.node}function fq(f9,ga){fY(f9.line,f9,ga,true);if(f9.rest){for(var f8=0;f8<f9.rest.length;f8++){fY(f9.rest[f8],f9,ga,false)}}}function fY(gg,gd,gf,gb){if(!gg.widgets){return}var f8=fF(gd);for(var ga=0,ge=gg.widgets;ga<ge.length;++ga){var gc=ge[ga],f9=fT("div",[gc.node],"CodeMirror-linewidget");if(!gc.handleMouseEvents){f9.setAttribute("cm-ignore-events","true")}bE(gc,f9,gd,gf);if(gb&&gc.above){f8.insertBefore(f9,gd.gutter||gd.text)}else{f8.appendChild(f9)}ad(gc,"redraw")}}function bE(gb,ga,f8,gc){if(gb.noHScroll){(f8.alignable||(f8.alignable=[])).push(ga);var f9=gc.wrapperWidth;ga.style.left=gc.fixedPos+"px";if(!gb.coverGutter){f9-=gc.gutterTotalWidth;ga.style.paddingLeft=gc.gutterTotalWidth+"px"}ga.style.width=f9+"px"}if(gb.coverGutter){ga.style.zIndex=5;ga.style.position="relative";if(!gb.noHScroll){ga.style.marginLeft=-gc.gutterTotalWidth+"px"}}}var X=I.Pos=function(f8,f9){if(!(this instanceof X)){return new X(f8,f9)}this.line=f8;this.ch=f9};var ce=I.cmpPos=function(f9,f8){return f9.line-f8.line||f9.ch-f8.ch};function ci(f8){return X(f8.line,f8.ch)}function bw(f9,f8){return ce(f9,f8)<0?f8:f9}function aq(f9,f8){return ce(f9,f8)<0?f9:f8}function fU(f8,f9){this.ranges=f8;this.primIndex=f9}fU.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(f8){if(f8==this){return true}if(f8.primIndex!=this.primIndex||f8.ranges.length!=this.ranges.length){return false}for(var ga=0;ga<this.ranges.length;ga++){var f9=this.ranges[ga],gb=f8.ranges[ga];if(ce(f9.anchor,gb.anchor)!=0||ce(f9.head,gb.head)!=0){return false}}return true},deepCopy:function(){for(var f8=[],f9=0;f9<this.ranges.length;f9++){f8[f9]=new dU(ci(this.ranges[f9].anchor),ci(this.ranges[f9].head))}return new fU(f8,this.primIndex)},somethingSelected:function(){for(var f8=0;f8<this.ranges.length;f8++){if(!this.ranges[f8].empty()){return true}}return false},contains:function(gb,f8){if(!f8){f8=gb}for(var ga=0;ga<this.ranges.length;ga++){var f9=this.ranges[ga];if(ce(f8,f9.from())>=0&&ce(gb,f9.to())<=0){return ga}}return -1}};function dU(f8,f9){this.anchor=f8;this.head=f9}dU.prototype={from:function(){return aq(this.anchor,this.head)},to:function(){return bw(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};function cw(f8,gf){var ga=f8[gf];f8.sort(function(gi,gh){return ce(gi.from(),gh.from())});gf=df(f8,ga);for(var gc=1;gc<f8.length;gc++){var gg=f8[gc],f9=f8[gc-1];if(ce(f9.to(),gg.from())>=0){var gd=aq(f9.from(),gg.from()),ge=bw(f9.to(),gg.to());var gb=f9.empty()?gg.from()==gg.head:f9.from()==f9.head;if(gc<=gf){--gf}f8.splice(--gc,2,new dU(gb?ge:gd,gb?gd:ge))}}return new fU(f8,gf)}function eO(f8,f9){return new fU([new dU(f8,f9||f8)],0)}function c3(f8,f9){return Math.max(f8.first,Math.min(f9,f8.first+f8.size-1))}function fG(f9,ga){if(ga.line<f9.first){return X(f9.first,0)}var f8=f9.first+f9.size-1;if(ga.line>f8){return X(f8,fb(f9,f8).text.length)}return fp(ga,fb(f9,ga.line).text.length)}function fp(ga,f9){var f8=ga.ch;if(f8==null||f8>f9){return X(ga.line,f9)}else{if(f8<0){return X(ga.line,0)}else{return ga}}}function b8(f9,f8){return f8>=f9.first&&f8<f9.first+f9.size}function dV(ga,gb){for(var f8=[],f9=0;f9<gb.length;f9++){f8[f9]=fG(ga,gb[f9])}return f8}function fs(gd,f9,gc,f8){if(gd.cm&&gd.cm.display.shift||gd.extend){var gb=f9.anchor;if(f8){var ga=ce(gc,gb)<0;if(ga!=(ce(f8,gb)<0)){gb=gc;gc=f8}else{if(ga!=(ce(gc,f8)<0)){gc=f8}}}return new dU(gb,gc)}else{return new dU(f8||gc,gc)}}function fQ(gb,ga,f8,f9){bT(gb,new fU([fs(gb,gb.sel.primary(),ga,f8)],0),f9)}function av(gd,gc,ga){for(var f9=[],gb=0;gb<gd.sel.ranges.length;gb++){f9[gb]=fs(gd,gd.sel.ranges[gb],gc[gb],null)}var f8=cw(f9,gd.sel.primIndex);bT(gd,f8,ga)}function e(gc,gb,f9,ga){var f8=gc.sel.ranges.slice(0);f8[gb]=f9;bT(gc,cw(f8,gc.sel.primIndex),ga)}function G(gb,f9,ga,f8){bT(gb,eO(f9,ga),f8)}function c(ga,f8){var f9={ranges:f8.ranges,update:function(gb){this.ranges=[];for(var gc=0;gc<gb.length;gc++){this.ranges[gc]=new dU(fG(ga,gb[gc].anchor),fG(ga,gb[gc].head))}}};aC(ga,"beforeSelectionChange",ga,f9);if(ga.cm){aC(ga.cm,"beforeSelectionChange",ga.cm,f9)}if(f9.ranges!=f8.ranges){return cw(f9.ranges,f9.ranges.length-1)}else{return f8}}function e3(gc,gb,f9){var f8=gc.history.done,ga=fE(f8);if(ga&&ga.ranges){f8[f8.length-1]=gb;el(gc,gb,f9)}else{bT(gc,gb,f9)}}function bT(ga,f9,f8){el(ga,f9,f8);f2(ga,ga.sel,ga.cm?ga.cm.curOp.id:NaN,f8)}function el(gb,ga,f9){if(fe(gb,"beforeSelectionChange")||gb.cm&&fe(gb.cm,"beforeSelectionChange")){ga=c(gb,ga)}var f8=f9&&f9.bias||(ce(ga.primary().head,gb.sel.primary().head)<0?-1:1);c7(gb,n(gb,ga,f8,true));if(!(f9&&f9.scroll===false)&&gb.cm){fD(gb.cm)}}function c7(f9,f8){if(f8.equals(f9.sel)){return}f9.sel=f8;if(f9.cm){f9.cm.curOp.updateInput=f9.cm.curOp.selectionChanged=true;W(f9.cm)}ad(f9,"cursorActivity",f9)}function et(f8){c7(f8,n(f8,f8.sel,null,false),Z)}function n(gg,f8,gd,ge){var ga;for(var gb=0;gb<f8.ranges.length;gb++){var gc=f8.ranges[gb];var gf=bU(gg,gc.anchor,gd,ge);var f9=bU(gg,gc.head,gd,ge);if(ga||gf!=gc.anchor||f9!=gc.head){if(!ga){ga=f8.ranges.slice(0,gb)}ga[gb]=new dU(gf,f9)}}return ga?cw(ga,f8.primIndex):f8}function bU(gh,gg,gd,ge){var gi=false,ga=gg;var gb=gd||1;gh.cantEdit=false;search:for(;;){var gj=fb(gh,ga.line);if(gj.markedSpans){for(var gc=0;gc<gj.markedSpans.length;++gc){var f8=gj.markedSpans[gc],f9=f8.marker;if((f8.from==null||(f9.inclusiveLeft?f8.from<=ga.ch:f8.from<ga.ch))&&(f8.to==null||(f9.inclusiveRight?f8.to>=ga.ch:f8.to>ga.ch))){if(ge){aC(f9,"beforeCursorEnter");if(f9.explicitlyCleared){if(!gj.markedSpans){break}else{--gc;continue}}}if(!f9.atomic){continue}var gf=f9.find(gb<0?-1:1);if(ce(gf,ga)==0){gf.ch+=gb;if(gf.ch<0){if(gf.line>gh.first){gf=fG(gh,X(gf.line-1))}else{gf=null}}else{if(gf.ch>gj.text.length){if(gf.line<gh.first+gh.size-1){gf=X(gf.line+1,0)}else{gf=null}}}if(!gf){if(gi){if(!ge){return bU(gh,gg,gd,true)}gh.cantEdit=true;return X(gh.first,0)}gi=true;gf=gg;gb=-gb}}ga=gf;continue search}}}return ga}}function bk(gi){var ge=gi.display,gh=gi.doc,gj={};var gg=gj.cursors=document.createDocumentFragment();var ga=gj.selection=document.createDocumentFragment();for(var gc=0;gc<gh.sel.ranges.length;gc++){var gd=gh.sel.ranges[gc];var gb=gd.empty();if(gb||gi.options.showCursorWhenSelecting){A(gi,gd,gg)}if(!gb){bC(gi,gd,ga)}}if(gi.options.moveInputWithCursor){var gf=dQ(gi,gh.sel.primary().head,"div");var f8=ge.wrapper.getBoundingClientRect(),f9=ge.lineDiv.getBoundingClientRect();gj.teTop=Math.max(0,Math.min(ge.wrapper.clientHeight-10,gf.top+f9.top-f8.top));gj.teLeft=Math.max(0,Math.min(ge.wrapper.clientWidth-10,gf.left+f9.left-f8.left))}return gj}function ak(f8,f9){bQ(f8.display.cursorDiv,f9.cursors);bQ(f8.display.selectionDiv,f9.selection);if(f9.teTop!=null){f8.display.inputDiv.style.top=f9.teTop+"px";f8.display.inputDiv.style.left=f9.teLeft+"px"}}function bB(f8){ak(f8,bk(f8))}function A(f8,gb,ga){var gd=dQ(f8,gb.head,"div",null,null,!f8.options.singleCursorHeightPerLine);var gc=ga.appendChild(fT("div","\u00a0","CodeMirror-cursor"));gc.style.left=gd.left+"px";gc.style.top=gd.top+"px";gc.style.height=Math.max(0,gd.bottom-gd.top)*f8.options.cursorHeight+"px";if(gd.other){var f9=ga.appendChild(fT("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor"));f9.style.display="";f9.style.left=gd.other.left+"px";f9.style.top=gd.other.top+"px";f9.style.height=(gd.other.bottom-gd.other.top)*0.85+"px"}}function bC(gc,gi,gd){var gl=gc.display,gp=gc.doc;var f8=document.createDocumentFragment();var gh=e1(gc.display),gb=gh.left;var gm=Math.max(gl.sizerWidth,di(gc)-gl.sizer.offsetLeft)-gh.right;function gj(gt,gs,gr,gq){if(gs<0){gs=0}gs=Math.round(gs);gq=Math.round(gq);f8.appendChild(fT("div",null,"CodeMirror-selected","position: absolute; left: "+gt+"px; top: "+gs+"px; width: "+(gr==null?gm-gt:gr)+"px; height: "+(gq-gs)+"px"))}function f9(gr,gt,gw){var gs=fb(gp,gr);var gu=gs.text.length;var gx,gq;function gv(gz,gy){return cH(gc,X(gr,gz),"div",gs,gy)}d0(a(gs),gt||0,gw==null?gu:gw,function(gF,gE,gy){var gB=gv(gF,"left"),gC,gD,gA;if(gF==gE){gC=gB;gD=gA=gB.left}else{gC=gv(gE-1,"right");if(gy=="rtl"){var gz=gB;gB=gC;gC=gz}gD=gB.left;gA=gC.right}if(gt==null&&gF==0){gD=gb}if(gC.top-gB.top>3){gj(gD,gB.top,null,gB.bottom);gD=gb;if(gB.bottom<gC.top){gj(gD,gB.bottom,null,gC.top)}}if(gw==null&&gE==gu){gA=gm}if(!gx||gB.top<gx.top||gB.top==gx.top&&gB.left<gx.left){gx=gB}if(!gq||gC.bottom>gq.bottom||gC.bottom==gq.bottom&&gC.right>gq.right){gq=gC}if(gD<gb+1){gD=gb}gj(gD,gC.top,gA-gD,gC.bottom)});return{start:gx,end:gq}}var go=gi.from(),gn=gi.to();if(go.line==gn.line){f9(go.line,go.ch,gn.ch)}else{var ga=fb(gp,go.line),gf=fb(gp,gn.line);var ge=y(ga)==y(gf);var gg=f9(go.line,go.ch,ge?ga.text.length+1:null).end;var gk=f9(gn.line,ge?0:null,gn.ch).start;if(ge){if(gg.top<gk.top-2){gj(gg.right,gg.top,null,gg.bottom);gj(gb,gk.top,gk.left,gk.bottom)}else{gj(gg.right,gg.top,gk.left-gg.right,gg.bottom)}}if(gg.bottom<gk.top){gj(gb,gg.bottom,null,gk.top)}}gd.appendChild(f8)}function o(f8){if(!f8.state.focused){return}var ga=f8.display;clearInterval(ga.blinker);var f9=true;ga.cursorDiv.style.visibility="";if(f8.options.cursorBlinkRate>0){ga.blinker=setInterval(function(){ga.cursorDiv.style.visibility=(f9=!f9)?"":"hidden"},f8.options.cursorBlinkRate)}else{if(f8.options.cursorBlinkRate<0){ga.cursorDiv.style.visibility="hidden"}}}function eb(f8,f9){if(f8.doc.mode.startState&&f8.doc.frontier<f8.display.viewTo){f8.state.highlight.set(f9,cv(cN,f8))}}function cN(f8){var gc=f8.doc;if(gc.frontier<gc.first){gc.frontier=gc.first}if(gc.frontier>=f8.display.viewTo){return}var ga=+new Date+f8.options.workTime;var gb=b2(gc.mode,dx(f8,gc.frontier));var f9=[];gc.iter(gc.frontier,Math.min(gc.first+gc.size,f8.display.viewTo+500),function(gd){if(gc.frontier>=f8.display.viewFrom){var gg=gd.styles;var gi=fw(f8,gd,gb,true);gd.styles=gi.styles;var gf=gd.styleClasses,gh=gi.classes;if(gh){gd.styleClasses=gh}else{if(gf){gd.styleClasses=null}}var gj=!gg||gg.length!=gd.styles.length||gf!=gh&&(!gf||!gh||gf.bgClass!=gh.bgClass||gf.textClass!=gh.textClass);for(var ge=0;!gj&&ge<gg.length;++ge){gj=gg[ge]!=gd.styles[ge]}if(gj){f9.push(gc.frontier)}gd.stateAfter=b2(gc.mode,gb)}else{dt(f8,gd.text,gb);gd.stateAfter=gc.frontier%5==0?b2(gc.mode,gb):null}++gc.frontier;if(+new Date>ga){eb(f8,f8.options.workDelay);return true}});if(f9.length){cK(f8,function(){for(var gd=0;gd<f9.length;gd++){S(f8,f9[gd],"text")}})}}function cy(ge,f8,gb){var f9,gc,gd=ge.doc;var ga=gb?-1:f8-(ge.doc.mode.innerMode?1000:100);for(var gh=f8;gh>ga;--gh){if(gh<=gd.first){return gd.first}var gg=fb(gd,gh-1);if(gg.stateAfter&&(!gb||gh<=gd.frontier)){return gh}var gf=bS(gg.text,null,ge.options.tabSize);if(gc==null||f9>gf){gc=gh-1;f9=gf}}return gc}function dx(f8,ge,f9){var gc=f8.doc,gb=f8.display;if(!gc.mode.startState){return true}var gd=cy(f8,ge,f9),ga=gd>gc.first&&fb(gc,gd-1).stateAfter;if(!ga){ga=bZ(gc.mode)}else{ga=b2(gc.mode,ga)}gc.iter(gd,ge,function(gf){dt(f8,gf.text,ga);var gg=gd==ge-1||gd%5==0||gd>=gb.viewFrom&&gd<gb.viewTo;gf.stateAfter=gg?b2(gc.mode,ga):null;++gd});if(f9){gc.frontier=gd}return ga}function e4(f8){return f8.lineSpace.offsetTop}function bH(f8){return f8.mover.offsetHeight-f8.lineSpace.offsetHeight}function e1(gb){if(gb.cachedPaddingH){return gb.cachedPaddingH}var ga=bQ(gb.measure,fT("pre","x"));var f8=window.getComputedStyle?window.getComputedStyle(ga):ga.currentStyle;var f9={left:parseInt(f8.paddingLeft),right:parseInt(f8.paddingRight)};if(!isNaN(f9.left)&&!isNaN(f9.right)){gb.cachedPaddingH=f9}return f9}function cR(f8){return dF-f8.display.nativeBarWidth}function di(f8){return f8.display.scroller.clientWidth-cR(f8)-f8.display.barWidth}function cT(f8){return f8.display.scroller.clientHeight-cR(f8)-f8.display.barHeight}function ch(gf,gb,ge){var ga=gf.options.lineWrapping;var gc=ga&&di(gf);if(!gb.measure.heights||ga&&gb.measure.width!=gc){var gd=gb.measure.heights=[];if(ga){gb.measure.width=gc;var gh=gb.text.firstChild.getClientRects();for(var f8=0;f8<gh.length-1;f8++){var gg=gh[f8],f9=gh[f8+1];if(Math.abs(gg.bottom-f9.bottom)>2){gd.push((gg.bottom+f9.top)/2-ge.top)}}}gd.push(ge.bottom-ge.top)}}function ct(ga,f8,gb){if(ga.line==f8){return{map:ga.measure.map,cache:ga.measure.cache}}for(var f9=0;f9<ga.rest.length;f9++){if(ga.rest[f9]==f8){return{map:ga.measure.maps[f9],cache:ga.measure.caches[f9]}}}for(var f9=0;f9<ga.rest.length;f9++){if(bM(ga.rest[f9])>gb){return{map:ga.measure.maps[f9],cache:ga.measure.caches[f9],before:true}}}}function cZ(f8,ga){ga=y(ga);var gc=bM(ga);var f9=f8.display.externalMeasured=new bu(f8.doc,ga,gc);f9.lineN=gc;var gb=f9.built=eN(f8,f9);f9.text=gb.pre;bQ(f8.display.lineMeasure,gb.pre);return f9}function ed(f8,f9,gb,ga){return D(f8,a1(f8,f9),gb,ga)}function e7(f8,ga){if(ga>=f8.display.viewFrom&&ga<f8.display.viewTo){return f8.display.view[dn(f8,ga)]}var f9=f8.display.externalMeasured;if(f9&&ga>=f9.lineN&&ga<f9.lineN+f9.size){return f9}}function a1(f8,ga){var gb=bM(ga);var f9=e7(f8,gb);if(f9&&!f9.text){f9=null}else{if(f9&&f9.changes){aa(f8,f9,gb,e9(f8))}}if(!f9){f9=cZ(f8,ga)}var gc=ct(f9,ga,gb);return{line:ga,view:f9,rect:null,map:gc.map,cache:gc.cache,before:gc.before,hasHeights:false}}function D(f8,ge,gc,f9,gb){if(ge.before){gc=-1}var ga=gc+(f9||""),gd;if(ge.cache.hasOwnProperty(ga)){gd=ge.cache[ga]}else{if(!ge.rect){ge.rect=ge.view.text.getBoundingClientRect()}if(!ge.hasHeights){ch(f8,ge.view,ge.rect);ge.hasHeights=true}gd=j(f8,ge,gc,f9);if(!gd.bogus){ge.cache[ga]=gd}}return{left:gd.left,right:gd.right,top:gb?gd.rtop:gd.top,bottom:gb?gd.rbottom:gd.bottom}}var ex={left:0,right:0,top:0,bottom:0};function j(gf,gp,gh,gd){var gt=gp.map;var gm,gc,gb,f8;for(var go=0;go<gt.length;go+=3){var gr=gt[go],gn=gt[go+1];if(gh<gr){gc=0;gb=1;f8="left"}else{if(gh<gn){gc=gh-gr;gb=gc+1}else{if(go==gt.length-3||gh==gn&>[go+3]>gh){gb=gn-gr;gc=gb-1;if(gh>=gn){f8="right"}}}}if(gc!=null){gm=gt[go+2];if(gr==gn&&gd==(gm.insertLeft?"left":"right")){f8=gd}if(gd=="left"&&gc==0){while(go&>[go-2]==gt[go-3]&>[go-1].insertLeft){gm=gt[(go-=3)+2];f8="left"}}if(gd=="right"&&gc==gn-gr){while(go<gt.length-3&>[go+3]==gt[go+4]&&!gt[go+5].insertLeft){gm=gt[(go+=3)+2];f8="right"}}break}}var f9;if(gm.nodeType==3){for(var go=0;go<4;go++){while(gc&&fm(gp.line.text.charAt(gr+gc))){--gc}while(gr+gb<gn&&fm(gp.line.text.charAt(gr+gb))){++gb}if(dG&&k<9&&gc==0&&gb==gn-gr){f9=gm.parentNode.getBoundingClientRect()}else{if(dG&&gf.options.lineWrapping){var ga=cl(gm,gc,gb).getClientRects();if(ga.length){f9=ga[gd=="right"?ga.length-1:0]}else{f9=ex}}else{f9=cl(gm,gc,gb).getBoundingClientRect()||ex}}if(f9.left||f9.right||gc==0){break}gb=gc;gc=gc-1;f8="right"}if(dG&&k<11){f9=eJ(gf.display.measure,f9)}}else{if(gc>0){f8=gd="right"}var ga;if(gf.options.lineWrapping&&(ga=gm.getClientRects()).length>1){f9=ga[gd=="right"?ga.length-1:0]}else{f9=gm.getBoundingClientRect()}}if(dG&&k<9&&!gc&&(!f9||!f9.left&&!f9.right)){var ge=gm.parentNode.getClientRects()[0];if(ge){f9={left:ge.left,right:ge.left+dz(gf.display),top:ge.top,bottom:ge.bottom}}else{f9=ex}}var gk=f9.top-gp.rect.top,gi=f9.bottom-gp.rect.top;var gs=(gk+gi)/2;var gq=gp.view.measure.heights;for(var go=0;go<gq.length-1;go++){if(gs<gq[go]){break}}var gl=go?gq[go-1]:0,gj=gq[go];var gg={left:(f8=="right"?f9.right:f9.left)-gp.rect.left,right:(f8=="left"?f9.left:f9.right)-gp.rect.left,top:gl,bottom:gj};if(!f9.left&&!f9.right){gg.bogus=true}if(!gf.options.singleCursorHeightPerLine){gg.rtop=gk;gg.rbottom=gi}return gg}function eJ(ga,gb){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!aI(ga)){return gb}var f9=screen.logicalXDPI/screen.deviceXDPI;var f8=screen.logicalYDPI/screen.deviceYDPI;return{left:gb.left*f9,right:gb.right*f9,top:gb.top*f8,bottom:gb.bottom*f8}}function at(f9){if(f9.measure){f9.measure.cache={};f9.measure.heights=null;if(f9.rest){for(var f8=0;f8<f9.rest.length;f8++){f9.measure.caches[f8]={}}}}}function aL(f8){f8.display.externalMeasure=null;dX(f8.display.lineMeasure);for(var f9=0;f9<f8.display.view.length;f9++){at(f8.display.view[f9])}}function aj(f8){aL(f8);f8.display.cachedCharWidth=f8.display.cachedTextHeight=f8.display.cachedPaddingH=null;if(!f8.options.lineWrapping){f8.display.maxLineChanged=true}f8.display.lineNumChars=null}function cu(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function cs(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function eM(ge,gb,gd,f9){if(gb.widgets){for(var ga=0;ga<gb.widgets.length;++ga){if(gb.widgets[ga].above){var gg=cW(gb.widgets[ga]);gd.top+=gg;gd.bottom+=gg}}}if(f9=="line"){return gd}if(!f9){f9="local"}var gc=bL(gb);if(f9=="local"){gc+=e4(ge.display)}else{gc-=ge.display.viewOffset}if(f9=="page"||f9=="window"){var f8=ge.display.lineSpace.getBoundingClientRect();gc+=f8.top+(f9=="window"?0:cs());var gf=f8.left+(f9=="window"?0:cu());gd.left+=gf;gd.right+=gf}gd.top+=gc;gd.bottom+=gc;return gd}function f5(f9,gc,ga){if(ga=="div"){return gc}var ge=gc.left,gd=gc.top;if(ga=="page"){ge-=cu();gd-=cs()}else{if(ga=="local"||!ga){var gb=f9.display.sizer.getBoundingClientRect();ge+=gb.left;gd+=gb.top}}var f8=f9.display.lineSpace.getBoundingClientRect();return{left:ge-f8.left,top:gd-f8.top}}function cH(f8,gc,gb,ga,f9){if(!ga){ga=fb(f8.doc,gc.line)}return eM(f8,ga,ed(f8,ga,gc.ch,f9),gb)}function dQ(gh,gg,ga,ge,gj,gf){ge=ge||fb(gh.doc,gg.line);if(!gj){gj=a1(gh,ge)}function gc(gm,gl){var gk=D(gh,gj,gm,gl?"right":"left",gf);if(gl){gk.left=gk.right}else{gk.right=gk.left}return eM(gh,ge,gk,ga)}function gi(gn,gk){var gl=gd[gk],gm=gl.level%2;if(gn==du(gl)&&gk&&gl.level<gd[gk-1].level){gl=gd[--gk];gn=f4(gl)-(gl.level%2?0:1);gm=true}else{if(gn==f4(gl)&&gk<gd.length-1&&gl.level<gd[gk+1].level){gl=gd[++gk];gn=du(gl)-gl.level%2;gm=false}}if(gm&&gn==gl.to&&gn>gl.from){return gc(gn-1)}return gc(gn,gm)}var gd=a(ge),f8=gg.ch;if(!gd){return gc(f8)}var f9=aE(gd,f8);var gb=gi(f8,f9);if(eY!=null){gb.other=gi(f8,eY)}return gb}function dD(f8,gc){var gb=0,gc=fG(f8.doc,gc);if(!f8.options.lineWrapping){gb=dz(f8.display)*gc.ch}var f9=fb(f8.doc,gc.line);var ga=bL(f9)+e4(f8.display);return{left:gb,right:gb,top:ga,bottom:ga+f9.height}}function fS(f8,f9,ga,gc){var gb=X(f8,f9);gb.xRel=gc;if(ga){gb.outside=true}return gb}function fL(gf,gc,gb){var ge=gf.doc;gb+=gf.display.viewOffset;if(gb<0){return fS(ge.first,0,true,-1)}var ga=bF(ge,gb),gg=ge.first+ge.size-1;if(ga>gg){return fS(ge.first+ge.size-1,fb(ge,gg).text.length,true,1)}if(gc<0){gc=0}var f9=fb(ge,ga);for(;;){var gh=cX(gf,f9,ga,gc,gb);var gd=er(f9);var f8=gd&&gd.find(0,true);if(gd&&(gh.ch>f8.from.ch||gh.ch==f8.from.ch&&gh.xRel>0)){ga=bM(f9=f8.to.line)}else{return gh}}}function cX(gi,ga,gl,gk,gj){var gh=gj-bL(ga);var ge=false,gr=2*gi.display.wrapper.clientWidth;var go=a1(gi,ga);function gv(gx){var gy=dQ(gi,X(gl,gx),"line",ga,go);ge=true;if(gh>gy.bottom){return gy.left-gr}else{if(gh<gy.top){return gy.left+gr}else{ge=false}}return gy.left}var gn=a(ga),gq=ga.text.length;var gs=cD(ga),gb=cQ(ga);var gp=gv(gs),f8=ge,f9=gv(gb),gd=ge;if(gk>f9){return fS(gl,gb,gd,1)}for(;;){if(gn?gb==gs||gb==u(ga,gs,1):gb-gs<=1){var gm=gk<gp||gk-gp<=f9-gk?gs:gb;var gu=gk-(gm==gs?gp:f9);while(fm(ga.text.charAt(gm))){++gm}var gg=fS(gl,gm,gm==gs?f8:gd,gu<-1?-1:gu>1?1:0);return gg}var gf=Math.ceil(gq/2),gw=gs+gf;if(gn){gw=gs;for(var gt=0;gt<gf;++gt){gw=u(ga,gw,1)}}var gc=gv(gw);if(gc>gk){gb=gw;f9=gc;if(gd=ge){f9+=1000}gq=gf}else{gs=gw;gp=gc;f8=ge;gq-=gf}}}var aF;function aU(ga){if(ga.cachedTextHeight!=null){return ga.cachedTextHeight}if(aF==null){aF=fT("pre");for(var f9=0;f9<49;++f9){aF.appendChild(document.createTextNode("x"));aF.appendChild(fT("br"))}aF.appendChild(document.createTextNode("x"))}bQ(ga.measure,aF);var f8=aF.offsetHeight/50;if(f8>3){ga.cachedTextHeight=f8}dX(ga.measure);return f8||1}function dz(gc){if(gc.cachedCharWidth!=null){return gc.cachedCharWidth}var f8=fT("span","xxxxxxxxxx");var gb=fT("pre",[f8]);bQ(gc.measure,gb);var ga=f8.getBoundingClientRect(),f9=(ga.right-ga.left)/10;if(f9>2){gc.cachedCharWidth=f9}return f9||10}var bo=null;var d4=0;function cG(f8){f8.curOp={cm:f8,viewChanged:false,startHeight:f8.doc.height,forceUpdate:false,updateInput:null,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++d4};if(bo){bo.ops.push(f8.curOp)}else{f8.curOp.ownsGroup=bo={ops:[f8.curOp],delayedCallbacks:[]}}}function cS(gb){var ga=gb.delayedCallbacks,f9=0;do{for(;f9<ga.length;f9++){ga[f9]()}for(var f8=0;f8<gb.ops.length;f8++){var gc=gb.ops[f8];if(gc.cursorActivityHandlers){while(gc.cursorActivityCalled<gc.cursorActivityHandlers.length){gc.cursorActivityHandlers[gc.cursorActivityCalled++](gc.cm)}}}}while(f9<ga.length)}function al(f8){var gb=f8.curOp,ga=gb.ownsGroup;if(!ga){return}try{cS(ga)}finally{bo=null;for(var f9=0;f9<ga.ops.length;f9++){ga.ops[f9].cm.curOp=null}cI(ga)}}function cI(ga){var f9=ga.ops;for(var f8=0;f8<f9.length;f8++){b4(f9[f8])}for(var f8=0;f8<f9.length;f8++){ap(f9[f8])}for(var f8=0;f8<f9.length;f8++){b1(f9[f8])}for(var f8=0;f8<f9.length;f8++){ao(f9[f8])}for(var f8=0;f8<f9.length;f8++){eW(f9[f8])}}function b4(ga){var f8=ga.cm,f9=f8.display;K(f8);if(ga.updateMaxLine){g(f8)}ga.mustUpdate=ga.viewChanged||ga.forceUpdate||ga.scrollTop!=null||ga.scrollToPos&&(ga.scrollToPos.from.line<f9.viewFrom||ga.scrollToPos.to.line>=f9.viewTo)||f9.maxLineChanged&&f8.options.lineWrapping;ga.update=ga.mustUpdate&&new aG(f8,ga.mustUpdate&&{top:ga.scrollTop,ensure:ga.scrollToPos},ga.forceUpdate)}function ap(f8){f8.updatedDisplay=f8.mustUpdate&&C(f8.cm,f8.update)}function b1(ga){var f8=ga.cm,f9=f8.display;if(ga.updatedDisplay){a6(f8)}ga.barMeasure=dw(f8);if(f9.maxLineChanged&&!f8.options.lineWrapping){ga.adjustWidthTo=ed(f8,f9.maxLine,f9.maxLine.text.length).left+3;f8.display.sizerWidth=ga.adjustWidthTo;ga.barMeasure.scrollWidth=Math.max(f9.scroller.clientWidth,f9.sizer.offsetLeft+ga.adjustWidthTo+cR(f8)+f8.display.barWidth);ga.maxScrollLeft=Math.max(0,f9.sizer.offsetLeft+ga.adjustWidthTo-di(f8))}if(ga.updatedDisplay||ga.selectionChanged){ga.newSelectionNodes=bk(f8)}}function ao(f9){var f8=f9.cm;if(f9.adjustWidthTo!=null){f8.display.sizer.style.minWidth=f9.adjustWidthTo+"px";if(f9.maxScrollLeft<f8.doc.scrollLeft){bD(f8,Math.min(f8.display.scroller.scrollLeft,f9.maxScrollLeft),true)}f8.display.maxLineChanged=false}if(f9.newSelectionNodes){ak(f8,f9.newSelectionNodes)}if(f9.updatedDisplay){dv(f8,f9.barMeasure)}if(f9.updatedDisplay||f9.startHeight!=f8.doc.height){eU(f8,f9.barMeasure)}if(f9.selectionChanged){o(f8)}if(f8.state.focused&&f9.updateInput){fl(f8,f9.typing)}}function eW(gf){var f8=gf.cm,gd=f8.display,gc=f8.doc;if(gf.updatedDisplay){cj(f8,gf.update)}if(gd.wheelStartX!=null&&(gf.scrollTop!=null||gf.scrollLeft!=null||gf.scrollToPos)){gd.wheelStartX=gd.wheelStartY=null}if(gf.scrollTop!=null&&(gd.scroller.scrollTop!=gf.scrollTop||gf.forceScroll)){gc.scrollTop=Math.max(0,Math.min(gd.scroller.scrollHeight-gd.scroller.clientHeight,gf.scrollTop));gd.scrollbars.setScrollTop(gc.scrollTop);gd.scroller.scrollTop=gc.scrollTop}if(gf.scrollLeft!=null&&(gd.scroller.scrollLeft!=gf.scrollLeft||gf.forceScroll)){gc.scrollLeft=Math.max(0,Math.min(gd.scroller.scrollWidth-di(f8),gf.scrollLeft));gd.scrollbars.setScrollLeft(gc.scrollLeft);gd.scroller.scrollLeft=gc.scrollLeft;eA(f8)}if(gf.scrollToPos){var gb=E(f8,fG(gc,gf.scrollToPos.from),fG(gc,gf.scrollToPos.to),gf.scrollToPos.margin);if(gf.scrollToPos.isCursor&&f8.state.focused){d2(f8,gb)}}var ga=gf.maybeHiddenMarkers,ge=gf.maybeUnhiddenMarkers;if(ga){for(var f9=0;f9<ga.length;++f9){if(!ga[f9].lines.length){aC(ga[f9],"hide")}}}if(ge){for(var f9=0;f9<ge.length;++f9){if(ge[f9].lines.length){aC(ge[f9],"unhide")}}}if(gd.wrapper.offsetHeight){gc.scrollTop=f8.display.scroller.scrollTop}if(gf.changeObjs){aC(f8,"changes",f8,gf.changeObjs)}}function cK(f8,f9){if(f8.curOp){return f9()}cG(f8);try{return f9()}finally{al(f8)}}function c0(f8,f9){return function(){if(f8.curOp){return f9.apply(f8,arguments)}cG(f8);try{return f9.apply(f8,arguments)}finally{al(f8)}}}function c6(f8){return function(){if(this.curOp){return f8.apply(this,arguments)}cG(this);try{return f8.apply(this,arguments)}finally{al(this)}}}function cC(f8){return function(){var f9=this.cm;if(!f9||f9.curOp){return f8.apply(this,arguments)}cG(f9);try{return f8.apply(this,arguments)}finally{al(f9)}}}function bu(ga,f8,f9){this.line=f8;this.rest=h(f8);this.size=this.rest?bM(fE(this.rest))-f9+1:1;this.node=this.text=null;this.hidden=ft(ga,f8)}function eR(f8,ge,gd){var gc=[],ga;for(var gb=ge;gb<gd;gb=ga){var f9=new bu(f8.doc,fb(f8.doc,gb),gb);ga=gb+f9.size;gc.push(f9)}return gc}function ag(gf,gd,ge,gg){if(gd==null){gd=gf.doc.first}if(ge==null){ge=gf.doc.first+gf.doc.size}if(!gg){gg=0}var ga=gf.display;if(gg&&ge<ga.viewTo&&(ga.updateLineNumbers==null||ga.updateLineNumbers>gd)){ga.updateLineNumbers=gd}gf.curOp.viewChanged=true;if(gd>=ga.viewTo){if(a4&&aT(gf.doc,gd)<ga.viewTo){es(gf)}}else{if(ge<=ga.viewFrom){if(a4&&dZ(gf.doc,ge+gg)>ga.viewFrom){es(gf)}else{ga.viewFrom+=gg;ga.viewTo+=gg}}else{if(gd<=ga.viewFrom&&ge>=ga.viewTo){es(gf)}else{if(gd<=ga.viewFrom){var gc=dc(gf,ge,ge+gg,1);if(gc){ga.view=ga.view.slice(gc.index);ga.viewFrom=gc.lineN;ga.viewTo+=gg}else{es(gf)}}else{if(ge>=ga.viewTo){var gc=dc(gf,gd,gd,-1);if(gc){ga.view=ga.view.slice(0,gc.index);ga.viewTo=gc.lineN}else{es(gf)}}else{var gb=dc(gf,gd,gd,-1);var f9=dc(gf,ge,ge+gg,1);if(gb&&f9){ga.view=ga.view.slice(0,gb.index).concat(eR(gf,gb.lineN,f9.lineN)).concat(ga.view.slice(f9.index));ga.viewTo+=gg}else{es(gf)}}}}}}var f8=ga.externalMeasured;if(f8){if(ge<f8.lineN){f8.lineN+=gg}else{if(gd<f8.lineN+f8.size){ga.externalMeasured=null}}}}function S(f9,ga,gd){f9.curOp.viewChanged=true;var ge=f9.display,gc=f9.display.externalMeasured;if(gc&&ga>=gc.lineN&&ga<gc.lineN+gc.size){ge.externalMeasured=null}if(ga<ge.viewFrom||ga>=ge.viewTo){return}var gb=ge.view[dn(f9,ga)];if(gb.node==null){return}var f8=gb.changes||(gb.changes=[]);if(df(f8,gd)==-1){f8.push(gd)}}function es(f8){f8.display.viewFrom=f8.display.viewTo=f8.doc.first;f8.display.view=[];f8.display.viewOffset=0}function dn(f8,gb){if(gb>=f8.display.viewTo){return null}gb-=f8.display.viewFrom;if(gb<0){return null}var f9=f8.display.view;for(var ga=0;ga<f9.length;ga++){gb-=f9[ga].size;if(gb<0){return ga}}}function dc(gg,ga,gc,f9){var gd=dn(gg,ga),gf,ge=gg.display.view;if(!a4||gc==gg.doc.first+gg.doc.size){return{index:gd,lineN:gc}}for(var gb=0,f8=gg.display.viewFrom;gb<gd;gb++){f8+=ge[gb].size}if(f8!=ga){if(f9>0){if(gd==ge.length-1){return null}gf=(f8+ge[gd].size)-ga;gd++}else{gf=f8-ga}ga+=gf;gc+=gf}while(aT(gg.doc,gc)!=gc){if(gd==(f9<0?0:ge.length-1)){return null}gc+=f9*ge[gd-(f9<0?1:0)].size;gd+=f9}return{index:gd,lineN:gc}}function cP(f8,gc,gb){var ga=f8.display,f9=ga.view;if(f9.length==0||gc>=ga.viewTo||gb<=ga.viewFrom){ga.view=eR(f8,gc,gb);ga.viewFrom=gc}else{if(ga.viewFrom>gc){ga.view=eR(f8,gc,ga.viewFrom).concat(ga.view)}else{if(ga.viewFrom<gc){ga.view=ga.view.slice(dn(f8,gc))}}ga.viewFrom=gc;if(ga.viewTo<gb){ga.view=ga.view.concat(eR(f8,ga.viewTo,gb))}else{if(ga.viewTo>gb){ga.view=ga.view.slice(0,dn(f8,gb))}}}ga.viewTo=gb}function c9(f8){var f9=f8.display.view,gc=0;for(var gb=0;gb<f9.length;gb++){var ga=f9[gb];if(!ga.hidden&&(!ga.node||ga.changes)){++gc}}return gc}function bl(f8){if(f8.display.pollingFast){return}f8.display.poll.set(f8.options.pollInterval,function(){cg(f8);if(f8.state.focused){bl(f8)}})}function B(f8){var f9=false;f8.display.pollingFast=true;function ga(){var gb=cg(f8);if(!gb&&!f9){f9=true;f8.display.poll.set(60,ga)}else{f8.display.pollingFast=false;bl(f8)}}f8.display.poll.set(20,ga)}var bj=null;function cg(gc){var gd=gc.display.input,gg=gc.display.prevInput,gr=gc.doc;if(!gc.state.focused||(br(gd)&&!gg)||ai(gc)||gc.options.disableInput||gc.state.keySeq){return false}if(gc.state.pasteIncoming&&gc.state.fakedLastChar){gd.value=gd.value.substring(0,gd.value.length-1);gc.state.fakedLastChar=false}var gf=gd.value;if(gf==gg&&!gc.somethingSelected()){return false}if(dG&&k>=9&&gc.display.inputHasSelection===gf||b6&&/[\uf700-\uf7ff]/.test(gf)){fl(gc);return false}var gn=!gc.curOp;if(gn){cG(gc)}gc.display.shift=false;if(gf.charCodeAt(0)==8203&&gr.sel==gc.display.selForContextMenu&&!gg){gg="\u200b"}var gm=0,gj=Math.min(gg.length,gf.length);while(gm<gj&&gg.charCodeAt(gm)==gf.charCodeAt(gm)){++gm}var f9=gf.slice(gm),gh=aX(f9);var gq=null;if(gc.state.pasteIncoming&&gr.sel.ranges.length>1){if(bj&&bj.join("\n")==f9){gq=gr.sel.ranges.length%bj.length==0&&bR(bj,aX)}else{if(gh.length==gr.sel.ranges.length){gq=bR(gh,function(gs){return[gs]})}}}for(var go=gr.sel.ranges.length-1;go>=0;go--){var gi=gr.sel.ranges[go];var gk=gi.from(),f8=gi.to();if(gm<gg.length){gk=X(gk.line,gk.ch-(gg.length-gm))}else{if(gc.state.overwrite&&gi.empty()&&!gc.state.pasteIncoming){f8=X(f8.line,Math.min(fb(gr,f8.line).text.length,f8.ch+fE(gh).length))}}var gb=gc.curOp.updateInput;var gp={from:gk,to:f8,text:gq?gq[go%gq.length]:gh,origin:gc.state.pasteIncoming?"paste":gc.state.cutIncoming?"cut":"+input"};bd(gc.doc,gp);ad(gc,"inputRead",gc,gp);if(f9&&!gc.state.pasteIncoming&&gc.options.electricChars&&gc.options.smartIndent&&gi.head.ch<100&&(!go||gr.sel.ranges[go-1].head.line!=gi.head.line)){var ge=gc.getModeAt(gi.head);var ga=cV(gp);if(ge.electricChars){for(var gl=0;gl<ge.electricChars.length;gl++){if(f9.indexOf(ge.electricChars.charAt(gl))>-1){ac(gc,ga.line,"smart");break}}}else{if(ge.electricInput){if(ge.electricInput.test(fb(gr,ga.line).text.slice(0,ga.ch))){ac(gc,ga.line,"smart")}}}}}fD(gc);gc.curOp.updateInput=gb;gc.curOp.typing=true;if(gf.length>1000||gf.indexOf("\n")>-1){gd.value=gc.display.prevInput=""}else{gc.display.prevInput=gf}if(gn){al(gc)}gc.state.pasteIncoming=gc.state.cutIncoming=false;return true}function fl(f8,gc){if(f8.display.contextMenuPending){return}var f9,gb,ge=f8.doc;if(f8.somethingSelected()){f8.display.prevInput="";var ga=ge.sel.primary();f9=c8&&(ga.to().line-ga.from().line>100||(gb=f8.getSelection()).length>1000);var gd=f9?"-":gb||f8.getSelection();f8.display.input.value=gd;if(f8.state.focused){dH(f8.display.input)}if(dG&&k>=9){f8.display.inputHasSelection=gd}}else{if(!gc){f8.display.prevInput=f8.display.input.value="";if(dG&&k>=9){f8.display.inputHasSelection=null}}}f8.display.inaccurateSelection=f9}function ev(f8){if(f8.options.readOnly!="nocursor"&&(!ec||dK()!=f8.display.input)){f8.display.input.focus()}}function r(f8){if(!f8.state.focused){ev(f8);cA(f8)}}function ai(f8){return f8.options.readOnly||f8.doc.cantEdit}function fM(f8){var ga=f8.display;bW(ga.scroller,"mousedown",c0(f8,ep));if(dG&&k<11){bW(ga.scroller,"dblclick",c0(f8,function(gd){if(aO(f8,gd)){return}var ge=cn(f8,gd);if(!ge||l(f8,gd)||a7(f8.display,gd)){return}cE(gd);var gc=f8.findWordAt(ge);fQ(f8.doc,gc.anchor,gc.head)}))}else{bW(ga.scroller,"dblclick",function(gc){aO(f8,gc)||cE(gc)})}bW(ga.lineSpace,"selectstart",function(gc){if(!a7(ga,gc)){cE(gc)}});if(!f0){bW(ga.scroller,"contextmenu",function(gc){ax(f8,gc)})}bW(ga.scroller,"scroll",function(){if(ga.scroller.clientHeight){O(f8,ga.scroller.scrollTop);bD(f8,ga.scroller.scrollLeft,true);aC(f8,"scroll",f8)}});bW(ga.scroller,"mousewheel",function(gc){b(f8,gc)});bW(ga.scroller,"DOMMouseScroll",function(gc){b(f8,gc)});bW(ga.wrapper,"scroll",function(){ga.wrapper.scrollTop=ga.wrapper.scrollLeft=0});bW(ga.input,"keyup",function(gc){bf.call(f8,gc)});bW(ga.input,"input",function(){if(dG&&k>=9&&f8.display.inputHasSelection){f8.display.inputHasSelection=null}cg(f8)});bW(ga.input,"keydown",c0(f8,p));bW(ga.input,"keypress",c0(f8,cx));bW(ga.input,"focus",cv(cA,f8));bW(ga.input,"blur",cv(aS,f8));function f9(gc){if(!aO(f8,gc)){en(gc)}}if(f8.options.dragDrop){bW(ga.scroller,"dragstart",function(gc){R(f8,gc)});bW(ga.scroller,"dragenter",f9);bW(ga.scroller,"dragover",f9);bW(ga.scroller,"drop",c0(f8,bh))}bW(ga.scroller,"paste",function(gc){if(a7(ga,gc)){return}f8.state.pasteIncoming=true;ev(f8);B(f8)});bW(ga.input,"paste",function(){if(cY&&!f8.state.fakedLastChar&&!(new Date-f8.state.lastMiddleDown<200)){var gd=ga.input.selectionStart,gc=ga.input.selectionEnd;ga.input.value+="$";ga.input.selectionEnd=gc;ga.input.selectionStart=gd;f8.state.fakedLastChar=true}f8.state.pasteIncoming=true;B(f8)});function gb(gg){if(f8.somethingSelected()){bj=f8.getSelections();if(ga.inaccurateSelection){ga.prevInput="";ga.inaccurateSelection=false;ga.input.value=bj.join("\n");dH(ga.input)}}else{var gh=[],gd=[];for(var ge=0;ge<f8.doc.sel.ranges.length;ge++){var gc=f8.doc.sel.ranges[ge].head.line;var gf={anchor:X(gc,0),head:X(gc+1,0)};gd.push(gf);gh.push(f8.getRange(gf.anchor,gf.head))}if(gg.type=="cut"){f8.setSelections(gd,null,Z)}else{ga.prevInput="";ga.input.value=gh.join("\n");dH(ga.input)}bj=gh}if(gg.type=="cut"){f8.state.cutIncoming=true}}bW(ga.input,"cut",gb);bW(ga.input,"copy",gb);if(a8){bW(ga.sizer,"mouseup",function(){if(dK()==ga.input){ga.input.blur()}ev(f8)})}}function aQ(f8){var f9=f8.display;if(f9.lastWrapHeight==f9.wrapper.clientHeight&&f9.lastWrapWidth==f9.wrapper.clientWidth){return}f9.cachedCharWidth=f9.cachedTextHeight=f9.cachedPaddingH=null;f9.scrollbarsClipped=false;f8.setSize()}function a7(f9,f8){for(var ga=M(f8);ga!=f9.wrapper;ga=ga.parentNode){if(!ga||(ga.nodeType==1&&ga.getAttribute("cm-ignore-events")=="true")||(ga.parentNode==f9.sizer&&ga!=f9.mover)){return true}}}function cn(gh,gc,f9,ga){var gd=gh.display;if(!f9&&M(gc).getAttribute("not-content")=="true"){return null}var gg,ge,f8=gd.lineSpace.getBoundingClientRect();try{gg=gc.clientX-f8.left;ge=gc.clientY-f8.top}catch(gc){return null}var gf=fL(gh,gg,ge),gi;if(ga&&gf.xRel==1&&(gi=fb(gh.doc,gf.line).text).length==gf.ch){var gb=bS(gi,gi.length,gh.options.tabSize)-gi.length;gf=X(gf.line,Math.max(0,Math.round((gg-e1(gh.display).left)/dz(gh.display))-gb))}return gf}function ep(ga){if(aO(this,ga)){return}var f8=this,f9=f8.display;f9.shift=ga.shiftKey;if(a7(f9,ga)){if(!cY){f9.scroller.draggable=false;setTimeout(function(){f9.scroller.draggable=true},100)}return}if(l(f8,ga)){return}var gb=cn(f8,ga);window.focus();switch(fK(ga)){case 1:if(gb){aw(f8,ga,gb)}else{if(M(ga)==f9.scroller){cE(ga)}}break;case 2:if(cY){f8.state.lastMiddleDown=+new Date}if(gb){fQ(f8.doc,gb)}setTimeout(cv(ev,f8),20);cE(ga);break;case 3:if(f0){ax(f8,ga)}break}}var dk,db;function aw(f9,ge,gf){setTimeout(cv(r,f9),0);var ga=+new Date,gc;if(db&&db.time>ga-400&&ce(db.pos,gf)==0){gc="triple"}else{if(dk&&dk.time>ga-400&&ce(dk.pos,gf)==0){gc="double";db={time:ga,pos:gf}}else{gc="single";dk={time:ga,pos:gf}}}var gd=f9.doc.sel,f8=b6?ge.metaKey:ge.ctrlKey,gb;if(f9.options.dragDrop&&eH&&!ai(f9)&&gc=="single"&&(gb=gd.contains(gf))>-1&&!gd.ranges[gb].empty()){a0(f9,ge,gf,f8)}else{m(f9,ge,gf,gc,f8)}}function a0(ga,gc,gd,f9){var gb=ga.display;var f8=c0(ga,function(ge){if(cY){gb.scroller.draggable=false}ga.state.draggingText=false;d9(document,"mouseup",f8);d9(gb.scroller,"drop",f8);if(Math.abs(gc.clientX-ge.clientX)+Math.abs(gc.clientY-ge.clientY)<10){cE(ge);if(!f9){fQ(ga.doc,gd)}ev(ga);if(dG&&k==9){setTimeout(function(){document.body.focus();ev(ga)},20)}}});if(cY){gb.scroller.draggable=true}ga.state.draggingText=f8;if(gb.scroller.dragDrop){gb.scroller.dragDrop()}bW(document,"mouseup",f8);bW(gb.scroller,"drop",f8)}function m(gc,gq,gb,f9,ge){var gn=gc.display,gs=gc.doc;cE(gq);var ga,gr,gd=gs.sel,f8=gd.ranges;if(ge&&!gq.shiftKey){gr=gs.sel.contains(gb);if(gr>-1){ga=f8[gr]}else{ga=new dU(gb,gb)}}else{ga=gs.sel.primary()}if(gq.altKey){f9="rect";if(!ge){ga=new dU(gb,gb)}gb=cn(gc,gq,true,true);gr=-1}else{if(f9=="double"){var go=gc.findWordAt(gb);if(gc.display.shift||gs.extend){ga=fs(gs,ga,go.anchor,go.head)}else{ga=go}}else{if(f9=="triple"){var gh=new dU(X(gb.line,0),fG(gs,X(gb.line+1,0)));if(gc.display.shift||gs.extend){ga=fs(gs,ga,gh.anchor,gh.head)}else{ga=gh}}else{ga=fs(gs,ga,gb)}}}if(!ge){gr=0;bT(gs,new fU([ga],0),N);gd=gs.sel}else{if(gr==-1){gr=f8.length;bT(gs,cw(f8.concat([ga]),gr),{scroll:false,origin:"*mouse"})}else{if(f8.length>1&&f8[gr].empty()&&f9=="single"){bT(gs,cw(f8.slice(0,gr).concat(f8.slice(gr+1)),0));gd=gs.sel}else{e(gs,gr,ga,N)}}}var gm=gb;function gl(gD){if(ce(gm,gD)==0){return}gm=gD;if(f9=="rect"){var gu=[],gA=gc.options.tabSize;var gt=bS(fb(gs,gb.line).text,gb.ch,gA);var gG=bS(fb(gs,gD.line).text,gD.ch,gA);var gv=Math.min(gt,gG),gE=Math.max(gt,gG);for(var gH=Math.min(gb.line,gD.line),gx=Math.min(gc.lastLine(),Math.max(gb.line,gD.line));gH<=gx;gH++){var gF=fb(gs,gH).text,gw=em(gF,gv,gA);if(gv==gE){gu.push(new dU(X(gH,gw),X(gH,gw)))}else{if(gF.length>gw){gu.push(new dU(X(gH,gw),X(gH,em(gF,gE,gA))))}}}if(!gu.length){gu.push(new dU(gb,gb))}bT(gs,cw(gd.ranges.slice(0,gr).concat(gu),gr),{origin:"*mouse",scroll:false});gc.scrollIntoView(gD)}else{var gB=ga;var gy=gB.anchor,gC=gD;if(f9!="single"){if(f9=="double"){var gz=gc.findWordAt(gD)}else{var gz=new dU(X(gD.line,0),fG(gs,X(gD.line+1,0)))}if(ce(gz.anchor,gy)>0){gC=gz.head;gy=aq(gB.from(),gz.anchor)}else{gC=gz.anchor;gy=bw(gB.to(),gz.head)}}var gu=gd.ranges.slice(0);gu[gr]=new dU(fG(gs,gy),gC);bT(gs,cw(gu,gr),N)}}var gj=gn.wrapper.getBoundingClientRect();var gf=0;function gp(gv){var gt=++gf;var gx=cn(gc,gv,true,f9=="rect");if(!gx){return}if(ce(gx,gm)!=0){r(gc);gl(gx);var gw=b5(gn,gs);if(gx.line>=gw.to||gx.line<gw.from){setTimeout(c0(gc,function(){if(gf==gt){gp(gv)}}),150)}}else{var gu=gv.clientY<gj.top?-20:gv.clientY>gj.bottom?20:0;if(gu){setTimeout(c0(gc,function(){if(gf!=gt){return}gn.scroller.scrollTop+=gu;gp(gv)}),50)}}}function gi(gt){gf=Infinity;cE(gt);ev(gc);d9(document,"mousemove",gk);d9(document,"mouseup",gg);gs.history.lastSelOrigin=null}var gk=c0(gc,function(gt){if(!fK(gt)){gi(gt)}else{gp(gt)}});var gg=c0(gc,gi);bW(document,"mousemove",gk);bW(document,"mouseup",gg)}function f6(gj,gf,gh,gi,gb){try{var f9=gf.clientX,f8=gf.clientY}catch(gf){return false}if(f9>=Math.floor(gj.display.gutters.getBoundingClientRect().right)){return false}if(gi){cE(gf)}var gg=gj.display;var ge=gg.lineDiv.getBoundingClientRect();if(f8>ge.bottom||!fe(gj,gh)){return bK(gf)}f8-=ge.top-gg.viewOffset;for(var gc=0;gc<gj.options.gutters.length;++gc){var gd=gg.gutters.childNodes[gc];if(gd&&gd.getBoundingClientRect().right>=f9){var gk=bF(gj.doc,f8);var ga=gj.options.gutters[gc];gb(gj,gh,gj,gk,ga,gf);return bK(gf)}}}function l(f8,f9){return f6(f8,f9,"gutterClick",true,ad)}var af=0;function bh(ge){var gg=this;if(aO(gg,ge)||a7(gg.display,ge)){return}cE(ge);if(dG){af=+new Date}var gf=cn(gg,ge,true),f8=ge.dataTransfer.files;if(!gf||ai(gg)){return}if(f8&&f8.length&&window.FileReader&&window.File){var ga=f8.length,gh=Array(ga),f9=0;var gc=function(gk,gj){var gi=new FileReader;gi.onload=c0(gg,function(){gh[gj]=gi.result;if(++f9==ga){gf=fG(gg.doc,gf);var gl={from:gf,to:gf,text:aX(gh.join("\n")),origin:"paste"};bd(gg.doc,gl);e3(gg.doc,eO(gf,cV(gl)))}});gi.readAsText(gk)};for(var gd=0;gd<ga;++gd){gc(f8[gd],gd)}}else{if(gg.state.draggingText&&gg.doc.sel.contains(gf)>-1){gg.state.draggingText(ge);setTimeout(cv(ev,gg),20);return}try{var gh=ge.dataTransfer.getData("Text");if(gh){if(gg.state.draggingText&&!(b6?ge.metaKey:ge.ctrlKey)){var gb=gg.listSelections()}el(gg.doc,eO(gf,gf));if(gb){for(var gd=0;gd<gb.length;++gd){aY(gg.doc,"",gb[gd].anchor,gb[gd].head,"drag")}}gg.replaceSelection(gh,"around","paste");ev(gg)}}catch(ge){}}}function R(f8,ga){if(dG&&(!f8.state.draggingText||+new Date-af<100)){en(ga);return}if(aO(f8,ga)||a7(f8.display,ga)){return}ga.dataTransfer.setData("Text",f8.getSelection());if(ga.dataTransfer.setDragImage&&!aA){var f9=fT("img",null,null,"position: fixed; left: 0; top: 0;");f9.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(dY){f9.width=f9.height=1;f8.display.wrapper.appendChild(f9);f9._top=f9.offsetTop}ga.dataTransfer.setDragImage(f9,0,0);if(dY){f9.parentNode.removeChild(f9)}}}function O(f8,f9){if(Math.abs(f8.doc.scrollTop-f9)<2){return}f8.doc.scrollTop=f9;if(!co){dP(f8,{top:f9})}if(f8.display.scroller.scrollTop!=f9){f8.display.scroller.scrollTop=f9}f8.display.scrollbars.setScrollTop(f9);if(co){dP(f8)}eb(f8,100)}function bD(f8,ga,f9){if(f9?ga==f8.doc.scrollLeft:Math.abs(f8.doc.scrollLeft-ga)<2){return}ga=Math.min(ga,f8.display.scroller.scrollWidth-f8.display.scroller.clientWidth);f8.doc.scrollLeft=ga;eA(f8);if(f8.display.scroller.scrollLeft!=ga){f8.display.scroller.scrollLeft=ga}f8.display.scrollbars.setScrollLeft(ga)}var fi=0,cf=null;if(dG){cf=-0.53}else{if(co){cf=15}else{if(da){cf=-0.7}else{if(aA){cf=-1/3}}}}var cO=function(ga){var f9=ga.wheelDeltaX,f8=ga.wheelDeltaY;if(f9==null&&ga.detail&&ga.axis==ga.HORIZONTAL_AXIS){f9=ga.detail}if(f8==null&&ga.detail&&ga.axis==ga.VERTICAL_AXIS){f8=ga.detail}else{if(f8==null){f8=ga.wheelDelta}}return{x:f9,y:f8}};I.wheelEventPixels=function(f8){var f9=cO(f8);f9.x*=cf;f9.y*=cf;return f9};function b(gg,ga){var gh=cO(ga),gk=gh.x,gj=gh.y;var gc=gg.display,gf=gc.scroller;if(!(gk&&gf.scrollWidth>gf.clientWidth||gj&&gf.scrollHeight>gf.clientHeight)){return}if(gj&&b6&&cY){outer:for(var gi=ga.target,ge=gc.view;gi!=gf;gi=gi.parentNode){for(var f9=0;f9<ge.length;f9++){if(ge[f9].node==gi){gg.display.currentWheelTarget=gi;break outer}}}}if(gk&&!co&&!dY&&cf!=null){if(gj){O(gg,Math.max(0,Math.min(gf.scrollTop+gj*cf,gf.scrollHeight-gf.clientHeight)))}bD(gg,Math.max(0,Math.min(gf.scrollLeft+gk*cf,gf.scrollWidth-gf.clientWidth)));cE(ga);gc.wheelStartX=null;return}if(gj&&cf!=null){var f8=gj*cf;var gd=gg.doc.scrollTop,gb=gd+gc.wrapper.clientHeight;if(f8<0){gd=Math.max(0,gd+f8-50)}else{gb=Math.min(gg.doc.height,gb+f8+50)}dP(gg,{top:gd,bottom:gb})}if(fi<20){if(gc.wheelStartX==null){gc.wheelStartX=gf.scrollLeft;gc.wheelStartY=gf.scrollTop;gc.wheelDX=gk;gc.wheelDY=gj;setTimeout(function(){if(gc.wheelStartX==null){return}var gl=gf.scrollLeft-gc.wheelStartX;var gn=gf.scrollTop-gc.wheelStartY;var gm=(gn&&gc.wheelDY&&gn/gc.wheelDY)||(gl&&gc.wheelDX&&gl/gc.wheelDX);gc.wheelStartX=gc.wheelStartY=null;if(!gm){return}cf=(cf*fi+gm)/(fi+1);++fi},200)}else{gc.wheelDX+=gk;gc.wheelDY+=gj}}}function fN(f9,gc,f8){if(typeof gc=="string"){gc=ez[gc];if(!gc){return false}}if(f9.display.pollingFast&&cg(f9)){f9.display.pollingFast=false}var gb=f9.display.shift,ga=false;try{if(ai(f9)){f9.state.suppressEdits=true}if(f8){f9.display.shift=false}ga=gc(f9)!=b9}finally{f9.display.shift=gb;f9.state.suppressEdits=false}return ga}function d6(f9,ga,gc){for(var gb=0;gb<f9.state.keyMaps.length;gb++){var f8=i(ga,f9.state.keyMaps[gb],gc,f9);if(f8){return f8}}return(f9.options.extraKeys&&i(ga,f9.options.extraKeys,gc,f9))||i(ga,f9.options.keyMap,gc,f9)}var dI=new f7;function ba(f9,gb,gd,gc){var ga=f9.state.keySeq;if(ga){if(ey(gb)){return"handled"}dI.set(50,function(){if(f9.state.keySeq==ga){f9.state.keySeq=null;fl(f9)}});gb=ga+" "+gb}var f8=d6(f9,gb,gc);if(f8=="multi"){f9.state.keySeq=gb}if(f8=="handled"){ad(f9,"keyHandled",f9,gb,gd)}if(f8=="handled"||f8=="multi"){cE(gd);o(f9)}if(ga&&!f8&&/\'$/.test(gb)){cE(gd);return true}return !!f8}function ff(f8,ga){var f9=fo(ga,true);if(!f9){return false}if(ga.shiftKey&&!f8.state.keySeq){return ba(f8,"Shift-"+f9,ga,function(gb){return fN(f8,gb,true)})||ba(f8,f9,ga,function(gb){if(typeof gb=="string"?/^go[A-Z]/.test(gb):gb.motion){return fN(f8,gb)}})}else{return ba(f8,f9,ga,function(gb){return fN(f8,gb)})}}function ef(f8,ga,f9){return ba(f8,"'"+f9+"'",ga,function(gb){return fN(f8,gb,true)})}var dj=null;function p(gb){var f8=this;r(f8);if(aO(f8,gb)){return}if(dG&&k<11&&gb.keyCode==27){gb.returnValue=false}var f9=gb.keyCode;f8.display.shift=f9==16||gb.shiftKey;var ga=ff(f8,gb);if(dY){dj=ga?f9:null;if(!ga&&f9==88&&!c8&&(b6?gb.metaKey:gb.ctrlKey)){f8.replaceSelection("",null,"cut")}}if(f9==18&&!/\bCodeMirror-crosshair\b/.test(f8.display.lineDiv.className)){au(f8)}}function au(f9){var ga=f9.display.lineDiv;fx(ga,"CodeMirror-crosshair");function f8(gb){if(gb.keyCode==18||!gb.altKey){f(ga,"CodeMirror-crosshair");d9(document,"keyup",f8);d9(document,"mouseover",f8)}}bW(document,"keyup",f8);bW(document,"mouseover",f8)}function bf(f8){if(f8.keyCode==16){this.doc.sel.shift=false}aO(this,f8)}function cx(gc){var f8=this;if(aO(f8,gc)||gc.ctrlKey&&!gc.altKey||b6&&gc.metaKey){return}var gb=gc.keyCode,f9=gc.charCode;if(dY&&gb==dj){dj=null;cE(gc);return}if(((dY&&(!gc.which||gc.which<10))||a8)&&ff(f8,gc)){return}var ga=String.fromCharCode(f9==null?gb:f9);if(ef(f8,gc,ga)){return}if(dG&&k>=9){f8.display.inputHasSelection=null}B(f8)}function cA(f8){if(f8.options.readOnly=="nocursor"){return}if(!f8.state.focused){aC(f8,"focus",f8);f8.state.focused=true;fx(f8.display.wrapper,"CodeMirror-focused");if(!f8.curOp&&f8.display.selForContextMenu!=f8.doc.sel){fl(f8);if(cY){setTimeout(cv(fl,f8,true),0)}}}bl(f8);o(f8)}function aS(f8){if(f8.state.focused){aC(f8,"blur",f8);f8.state.focused=false;f(f8.display.wrapper,"CodeMirror-focused")}clearInterval(f8.display.blinker);setTimeout(function(){if(!f8.state.focused){f8.display.shift=false}},150)}function ax(gh,gc){if(aO(gh,gc,"contextmenu")){return}var ge=gh.display;if(a7(ge,gc)||de(gh,gc)){return}var gg=cn(gh,gc),f8=ge.scroller.scrollTop;if(!gg||dY){return}var gb=gh.options.resetSelectionOnContextMenu;if(gb&&gh.doc.sel.contains(gg)==-1){c0(gh,bT)(gh.doc,eO(gg),Z)}var gd=ge.input.style.cssText;ge.inputDiv.style.position="absolute";ge.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(gc.clientY-5)+"px; left: "+(gc.clientX-5)+"px; z-index: 1000; background: "+(dG?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(cY){var gi=window.scrollY}ev(gh);if(cY){window.scrollTo(null,gi)}fl(gh);if(!gh.somethingSelected()){ge.input.value=ge.prevInput=" "}ge.contextMenuPending=true;ge.selForContextMenu=gh.doc.sel;clearTimeout(ge.detectingSelectAll);function ga(){if(ge.input.selectionStart!=null){var gj=gh.somethingSelected();var gk=ge.input.value="\u200b"+(gj?ge.input.value:"");ge.prevInput=gj?"":"\u200b";ge.input.selectionStart=1;ge.input.selectionEnd=gk.length;ge.selForContextMenu=gh.doc.sel}}function gf(){ge.contextMenuPending=false;ge.inputDiv.style.position="relative";ge.input.style.cssText=gd;if(dG&&k<9){ge.scrollbars.setScrollTop(ge.scroller.scrollTop=f8)}bl(gh);if(ge.input.selectionStart!=null){if(!dG||(dG&&k<9)){ga()}var gj=0,gk=function(){if(ge.selForContextMenu==gh.doc.sel&&ge.input.selectionStart==0){c0(gh,ez.selectAll)(gh)}else{if(gj++<10){ge.detectingSelectAll=setTimeout(gk,500)}else{fl(gh)}}};ge.detectingSelectAll=setTimeout(gk,200)}}if(dG&&k>=9){ga()}if(f0){en(gc);var f9=function(){d9(window,"mouseup",f9);setTimeout(gf,20)};bW(window,"mouseup",f9)}else{setTimeout(gf,50)}}function de(f8,f9){if(!fe(f8,"gutterContextMenu")){return false}return f6(f8,f9,"gutterContextMenu",false,aC)}var cV=I.changeEnd=function(f8){if(!f8.text){return f8.to}return X(f8.from.line+f8.text.length-1,fE(f8.text).length+(f8.text.length==1?f8.from.ch:0))};function bY(gb,ga){if(ce(gb,ga.from)<0){return gb}if(ce(gb,ga.to)<=0){return cV(ga)}var f8=gb.line+ga.text.length-(ga.to.line-ga.from.line)-1,f9=gb.ch;if(gb.line==ga.to.line){f9+=cV(ga).ch-ga.to.ch}return X(f8,f9)}function fg(gb,gc){var f9=[];for(var ga=0;ga<gb.sel.ranges.length;ga++){var f8=gb.sel.ranges[ga];f9.push(new dU(bY(f8.anchor,gc),bY(f8.head,gc)))}return cw(f9,gb.sel.primIndex)}function bt(ga,f9,f8){if(ga.line==f9.line){return X(f8.line,ga.ch-f9.ch+f8.ch)}else{return X(f8.line+(ga.line-f9.line),ga.ch)}}function ae(gi,gf,f9){var ga=[];var f8=X(gi.first,0),gj=f8;for(var gc=0;gc<gf.length;gc++){var ge=gf[gc];var gh=bt(ge.from,f8,gj);var gg=bt(cV(ge),f8,gj);f8=ge.to;gj=gg;if(f9=="around"){var gd=gi.sel.ranges[gc],gb=ce(gd.head,gd.anchor)<0;ga[gc]=new dU(gb?gg:gh,gb?gh:gg)}else{ga[gc]=new dU(gh,gh)}}return new fU(ga,gi.sel.primIndex)}function dN(f9,gb,ga){var f8={canceled:false,from:gb.from,to:gb.to,text:gb.text,origin:gb.origin,cancel:function(){this.canceled=true}};if(ga){f8.update=function(gf,ge,gd,gc){if(gf){this.from=fG(f9,gf)}if(ge){this.to=fG(f9,ge)}if(gd){this.text=gd}if(gc!==undefined){this.origin=gc}}}aC(f9,"beforeChange",f9,f8);if(f9.cm){aC(f9.cm,"beforeChange",f9.cm,f8)}if(f8.canceled){return null}return{from:f8.from,to:f8.to,text:f8.text,origin:f8.origin}}function bd(gb,gc,ga){if(gb.cm){if(!gb.cm.curOp){return c0(gb.cm,bd)(gb,gc,ga)}if(gb.cm.state.suppressEdits){return}}if(fe(gb,"beforeChange")||gb.cm&&fe(gb.cm,"beforeChange")){gc=dN(gb,gc,true);if(!gc){return}}var f9=f3&&!ga&&cF(gb,gc.from,gc.to);if(f9){for(var f8=f9.length-1;f8>=0;--f8){L(gb,{from:f9[f8].from,to:f9[f8].to,text:f8?[""]:gc.text})}}else{L(gb,gc)}}function L(ga,gb){if(gb.text.length==1&&gb.text[0]==""&&ce(gb.from,gb.to)==0){return}var f9=fg(ga,gb);fJ(ga,gb,f9,ga.cm?ga.cm.curOp.id:NaN);ea(ga,gb,f9,eg(ga,gb));var f8=[];d3(ga,function(gd,gc){if(!gc&&df(f8,gd.history)==-1){dA(gd.history,gb);f8.push(gd.history)}ea(gd,gb,null,eg(gd,gb))})}function b7(gj,gh,gl){if(gj.cm&&gj.cm.state.suppressEdits){return}var gg=gj.history,ga,gc=gj.sel;var f8=gh=="undo"?gg.done:gg.undone,gk=gh=="undo"?gg.undone:gg.done;for(var gd=0;gd<f8.length;gd++){ga=f8[gd];if(gl?ga.ranges&&!ga.equals(gj.sel):!ga.ranges){break}}if(gd==f8.length){return}gg.lastOrigin=gg.lastSelOrigin=null;for(;;){ga=f8.pop();if(ga.ranges){cL(ga,gk);if(gl&&!ga.equals(gj.sel)){bT(gj,ga,{clearRedo:false});return}gc=ga}else{break}}var gf=[];cL(gc,gk);gk.push({changes:gf,generation:gg.generation});gg.generation=ga.generation||++gg.maxGeneration;var gb=fe(gj,"beforeChange")||gj.cm&&fe(gj.cm,"beforeChange");for(var gd=ga.changes.length-1;gd>=0;--gd){var gi=ga.changes[gd];gi.origin=gh;if(gb&&!dN(gj,gi,false)){f8.length=0;return}gf.push(dr(gj,gi));var f9=gd?fg(gj,gi):fE(f8);ea(gj,gi,f9,d5(gj,gi));if(!gd&&gj.cm){gj.cm.scrollIntoView({from:gi.from,to:cV(gi)})}var ge=[];d3(gj,function(gn,gm){if(!gm&&df(ge,gn.history)==-1){dA(gn.history,gi);ge.push(gn.history)}ea(gn,gi,null,d5(gn,gi))})}}function fj(f9,gb){if(gb==0){return}f9.first+=gb;f9.sel=new fU(bR(f9.sel.ranges,function(gc){return new dU(X(gc.anchor.line+gb,gc.anchor.ch),X(gc.head.line+gb,gc.head.ch))}),f9.sel.primIndex);if(f9.cm){ag(f9.cm,f9.first,f9.first-gb,gb);for(var ga=f9.cm.display,f8=ga.viewFrom;f8<ga.viewTo;f8++){S(f9.cm,f8,"gutter")}}}function ea(gc,gd,gb,f9){if(gc.cm&&!gc.cm.curOp){return c0(gc.cm,ea)(gc,gd,gb,f9)}if(gd.to.line<gc.first){fj(gc,gd.text.length-1-(gd.to.line-gd.from.line));return}if(gd.from.line>gc.lastLine()){return}if(gd.from.line<gc.first){var f8=gd.text.length-1-(gc.first-gd.from.line);fj(gc,f8);gd={from:X(gc.first,0),to:X(gd.to.line+f8,gd.to.ch),text:[fE(gd.text)],origin:gd.origin}}var ga=gc.lastLine();if(gd.to.line>ga){gd={from:gd.from,to:X(ga,fb(gc,ga).text.length),text:[gd.text[0]],origin:gd.origin}}gd.removed=fV(gc,gd.from,gd.to);if(!gb){gb=fg(gc,gd)}if(gc.cm){aH(gc.cm,gd,f9)}else{fv(gc,gd,f9)}el(gc,gb,Z)}function aH(gj,gf,gd){var gi=gj.doc,ge=gj.display,gg=gf.from,gh=gf.to;var f8=false,gc=gg.line;if(!gj.options.lineWrapping){gc=bM(y(fb(gi,gg.line)));gi.iter(gc,gh.line+1,function(gl){if(gl==ge.maxLine){f8=true;return true}})}if(gi.sel.contains(gf.from,gf.to)>-1){W(gj)}fv(gi,gf,gd,bb(gj));if(!gj.options.lineWrapping){gi.iter(gc,gg.line+gf.text.length,function(gm){var gl=ej(gm);if(gl>ge.maxLineLength){ge.maxLine=gm;ge.maxLineLength=gl;ge.maxLineChanged=true;f8=false}});if(f8){gj.curOp.updateMaxLine=true}}gi.frontier=Math.min(gi.frontier,gg.line);eb(gj,400);var gk=gf.text.length-(gh.line-gg.line)-1;if(gf.full){ag(gj)}else{if(gg.line==gh.line&&gf.text.length==1&&!dO(gj.doc,gf)){S(gj,gg.line,"text")}else{ag(gj,gg.line,gh.line+1,gk)}}var ga=fe(gj,"changes"),gb=fe(gj,"change");if(gb||ga){var f9={from:gg,to:gh,text:gf.text,removed:gf.removed,origin:gf.origin};if(gb){ad(gj,"change",gj,f9)}if(ga){(gj.curOp.changeObjs||(gj.curOp.changeObjs=[])).push(f9)}}gj.display.selForContextMenu=null}function aY(gb,ga,gd,gc,f8){if(!gc){gc=gd}if(ce(gc,gd)<0){var f9=gc;gc=gd;gd=f9}if(typeof ga=="string"){ga=aX(ga)}bd(gb,{from:gd,to:gc,text:ga,origin:f8})}function d2(f9,gc){if(aO(f9,"scrollCursorIntoView")){return}var gd=f9.display,ga=gd.sizer.getBoundingClientRect(),f8=null;if(gc.top+ga.top<0){f8=true}else{if(gc.bottom+ga.top>(window.innerHeight||document.documentElement.clientHeight)){f8=false}}if(f8!=null&&!fr){var gb=fT("div","\u200b",null,"position: absolute; top: "+(gc.top-gd.viewOffset-e4(f9.display))+"px; height: "+(gc.bottom-gc.top+cR(f9)+gd.barHeight)+"px; left: "+gc.left+"px; width: 2px;");f9.display.lineSpace.appendChild(gb);gb.scrollIntoView(f8);f9.display.lineSpace.removeChild(gb)}}function E(gi,gg,gc,gb){if(gb==null){gb=0}for(var gd=0;gd<5;gd++){var ge=false,gh=dQ(gi,gg);var f8=!gc||gc==gg?gh:dQ(gi,gc);var ga=H(gi,Math.min(gh.left,f8.left),Math.min(gh.top,f8.top)-gb,Math.max(gh.left,f8.left),Math.max(gh.bottom,f8.bottom)+gb);var gf=gi.doc.scrollTop,f9=gi.doc.scrollLeft;if(ga.scrollTop!=null){O(gi,ga.scrollTop);if(Math.abs(gi.doc.scrollTop-gf)>1){ge=true}}if(ga.scrollLeft!=null){bD(gi,ga.scrollLeft);if(Math.abs(gi.doc.scrollLeft-f9)>1){ge=true}}if(!ge){break}}return gh}function F(f8,ga,gc,f9,gb){var gd=H(f8,ga,gc,f9,gb);if(gd.scrollTop!=null){O(f8,gd.scrollTop)}if(gd.scrollLeft!=null){bD(f8,gd.scrollLeft)}}function H(gk,gb,gj,f9,gi){var gg=gk.display,ge=aU(gk.display);if(gj<0){gj=0}var gc=gk.curOp&&gk.curOp.scrollTop!=null?gk.curOp.scrollTop:gg.scroller.scrollTop;var gm=cT(gk),go={};if(gi-gj>gm){gi=gj+gm}var ga=gk.doc.height+bH(gg);var f8=gj<ge,gf=gi>ga-ge;if(gj<gc){go.scrollTop=f8?0:gj}else{if(gi>gc+gm){var gh=Math.min(gj,(gf?ga:gi)-gm);if(gh!=gc){go.scrollTop=gh}}}var gn=gk.curOp&&gk.curOp.scrollLeft!=null?gk.curOp.scrollLeft:gg.scroller.scrollLeft;var gl=di(gk)-(gk.options.fixedGutter?gg.gutters.offsetWidth:0);var gd=f9-gb>gl;if(gd){f9=gb+gl}if(gb<10){go.scrollLeft=0}else{if(gb<gn){go.scrollLeft=Math.max(0,gb-(gd?0:10))}else{if(f9>gl+gn-3){go.scrollLeft=f9+(gd?0:10)-gl}}}return go}function cJ(f8,ga,f9){if(ga!=null||f9!=null){fz(f8)}if(ga!=null){f8.curOp.scrollLeft=(f8.curOp.scrollLeft==null?f8.doc.scrollLeft:f8.curOp.scrollLeft)+ga}if(f9!=null){f8.curOp.scrollTop=(f8.curOp.scrollTop==null?f8.doc.scrollTop:f8.curOp.scrollTop)+f9}}function fD(f8){fz(f8);var f9=f8.getCursor(),gb=f9,ga=f9;if(!f8.options.lineWrapping){gb=f9.ch?X(f9.line,f9.ch-1):f9;ga=X(f9.line,f9.ch+1)}f8.curOp.scrollToPos={from:gb,to:ga,margin:f8.options.cursorScrollMargin,isCursor:true}}function fz(f8){var ga=f8.curOp.scrollToPos;if(ga){f8.curOp.scrollToPos=null;var gc=dD(f8,ga.from),gb=dD(f8,ga.to);var f9=H(f8,Math.min(gc.left,gb.left),Math.min(gc.top,gb.top)-ga.margin,Math.max(gc.right,gb.right),Math.max(gc.bottom,gb.bottom)+ga.margin);f8.scrollTo(f9.scrollLeft,f9.scrollTop)}}function ac(gl,gb,gk,ga){var gj=gl.doc,f9;if(gk==null){gk="add"}if(gk=="smart"){if(!gj.mode.indent){gk="prev"}else{f9=dx(gl,gb)}}var gf=gl.options.tabSize;var gm=fb(gj,gb),ge=bS(gm.text,null,gf);if(gm.stateAfter){gm.stateAfter=null}var f8=gm.text.match(/^\s*/)[0],gh;if(!ga&&!/\S/.test(gm.text)){gh=0;gk="not"}else{if(gk=="smart"){gh=gj.mode.indent(f9,gm.text.slice(f8.length),gm.text);if(gh==b9||gh>150){if(!ga){return}gk="prev"}}}if(gk=="prev"){if(gb>gj.first){gh=bS(fb(gj,gb-1).text,null,gf)}else{gh=0}}else{if(gk=="add"){gh=ge+gl.options.indentUnit}else{if(gk=="subtract"){gh=ge-gl.options.indentUnit}else{if(typeof gk=="number"){gh=ge+gk}}}}gh=Math.max(0,gh);var gi="",gg=0;if(gl.options.indentWithTabs){for(var gc=Math.floor(gh/gf);gc;--gc){gg+=gf;gi+="\t"}}if(gg<gh){gi+=cp(gh-gg)}if(gi!=f8){aY(gj,gi,X(gb,0),X(gb,f8.length),"+input")}else{for(var gc=0;gc<gj.sel.ranges.length;gc++){var gd=gj.sel.ranges[gc];if(gd.head.line==gb&&gd.head.ch<f8.length){var gg=X(gb,f8.length);e(gj,gc,new dU(gg,gg));break}}}gm.stateAfter=null}function eu(gb,ga,f8,gd){var gc=ga,f9=ga;if(typeof ga=="number"){f9=fb(gb,c3(gb,ga))}else{gc=bM(ga)}if(gc==null){return null}if(gd(f9,gc)&&gb.cm){S(gb.cm,gc,f8)}return f9}function eT(f8,ge){var f9=f8.doc.sel.ranges,gc=[];for(var gb=0;gb<f9.length;gb++){var ga=ge(f9[gb]);while(gc.length&&ce(ga.from,fE(gc).to)<=0){var gd=gc.pop();if(ce(gd.from,ga.from)<0){ga.from=gd.from;break}}gc.push(ga)}cK(f8,function(){for(var gf=gc.length-1;gf>=0;gf--){aY(f8.doc,"",gc[gf].from,gc[gf].to,"+delete")}fD(f8)})}function bv(gq,gc,gk,gj,ge){var gh=gc.line,gi=gc.ch,gp=gk;var f9=fb(gq,gh);var gn=true;function go(){var gr=gh+gk;if(gr<gq.first||gr>=gq.first+gq.size){return(gn=false)}gh=gr;return f9=fb(gq,gr)}function gm(gs){var gr=(ge?u:ah)(f9,gi,gk,true);if(gr==null){if(!gs&&go()){if(ge){gi=(gk<0?cQ:cD)(f9)}else{gi=gk<0?f9.text.length:0}}else{return(gn=false)}}else{gi=gr}return true}if(gj=="char"){gm()}else{if(gj=="column"){gm(true)}else{if(gj=="word"||gj=="group"){var gl=null,gf=gj=="group";var f8=gq.cm&&gq.cm.getHelper(gc,"wordChars");for(var gd=true;;gd=false){if(gk<0&&!gm(!gd)){break}var ga=f9.text.charAt(gi)||"\n";var gb=cz(ga,f8)?"w":gf&&ga=="\n"?"n":!gf||/\s/.test(ga)?null:"p";if(gf&&!gd&&!gb){gb="s"}if(gl&&gl!=gb){if(gk<0){gk=1;gm()}break}if(gb){gl=gb}if(gk>0&&!gm(!gd)){break}}}}}var gg=bU(gq,X(gh,gi),gp,true);if(!gn){gg.hitSide=true}return gg}function bp(gg,gb,f8,gf){var ge=gg.doc,gd=gb.left,gc;if(gf=="page"){var ga=Math.min(gg.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);gc=gb.top+f8*(ga-(f8<0?1.5:0.5)*aU(gg.display))}else{if(gf=="line"){gc=f8>0?gb.bottom+3:gb.top-3}}for(;;){var f9=fL(gg,gd,gc);if(!f9.outside){break}if(f8<0?gc<=0:gc>=ge.height){f9.hitSide=true;break}gc+=f8*5}return f9}I.prototype={constructor:I,focus:function(){window.focus();ev(this);B(this)},setOption:function(ga,gb){var f9=this.options,f8=f9[ga];if(f9[ga]==gb&&ga!="mode"){return}f9[ga]=gb;if(bc.hasOwnProperty(ga)){c0(this,bc[ga])(this,gb,f8)}},getOption:function(f8){return this.options[f8]},getDoc:function(){return this.doc},addKeyMap:function(f9,f8){this.state.keyMaps[f8?"push":"unshift"](fR(f9))},removeKeyMap:function(f9){var ga=this.state.keyMaps;for(var f8=0;f8<ga.length;++f8){if(ga[f8]==f9||ga[f8].name==f9){ga.splice(f8,1);return true}}},addOverlay:c6(function(f8,f9){var ga=f8.token?f8:I.getMode(this.options,f8);if(ga.startState){throw new Error("Overlays may not be stateful.")}this.state.overlays.push({mode:ga,modeSpec:f8,opaque:f9&&f9.opaque});this.state.modeGen++;ag(this)}),removeOverlay:c6(function(f8){var ga=this.state.overlays;for(var f9=0;f9<ga.length;++f9){var gb=ga[f9].modeSpec;if(gb==f8||typeof f8=="string"&&gb.name==f8){ga.splice(f9,1);this.state.modeGen++;ag(this);return}}}),indentLine:c6(function(ga,f8,f9){if(typeof f8!="string"&&typeof f8!="number"){if(f8==null){f8=this.options.smartIndent?"smart":"prev"}else{f8=f8?"add":"subtract"}}if(b8(this.doc,ga)){ac(this,ga,f8,f9)}}),indentSelection:c6(function(gh){var f8=this.doc.sel.ranges,gb=-1;for(var gd=0;gd<f8.length;gd++){var ge=f8[gd];if(!ge.empty()){var gf=ge.from(),gg=ge.to();var f9=Math.max(gb,gf.line);gb=Math.min(this.lastLine(),gg.line-(gg.ch?0:1))+1;for(var gc=f9;gc<gb;++gc){ac(this,gc,gh)}var ga=this.doc.sel.ranges;if(gf.ch==0&&f8.length==ga.length&&ga[gd].from().ch>0){e(this.doc,gd,new dU(gf,ga[gd].to()),Z)}}else{if(ge.head.line>gb){ac(this,ge.head.line,gh,true);gb=ge.head.line;if(gd==this.doc.sel.primIndex){fD(this)}}}}}),getTokenAt:function(f9,f8){return cq(this,f9,f8)},getLineTokens:function(f9,f8){return cq(this,X(f9),f8,true)},getTokenTypeAt:function(gf){gf=fG(this.doc,gf);var gb=c4(this,fb(this.doc,gf.line));var gd=0,ge=(gb.length-1)/2,ga=gf.ch;var f9;if(ga==0){f9=gb[2]}else{for(;;){var f8=(gd+ge)>>1;if((f8?gb[f8*2-1]:0)>=ga){ge=f8}else{if(gb[f8*2+1]<ga){gd=f8+1}else{f9=gb[f8*2+2];break}}}}var gc=f9?f9.indexOf("cm-overlay "):-1;return gc<0?f9:gc==0?null:f9.slice(0,gc-1)},getModeAt:function(f9){var f8=this.doc.mode;if(!f8.innerMode){return f8}return I.innerMode(f8,this.getTokenAt(f9).state).mode},getHelper:function(f9,f8){return this.getHelpers(f9,f8)[0]},getHelpers:function(gf,ga){var gb=[];if(!fk.hasOwnProperty(ga)){return fk}var f8=fk[ga],ge=this.getModeAt(gf);if(typeof ge[ga]=="string"){if(f8[ge[ga]]){gb.push(f8[ge[ga]])}}else{if(ge[ga]){for(var f9=0;f9<ge[ga].length;f9++){var gd=f8[ge[ga][f9]];if(gd){gb.push(gd)}}}else{if(ge.helperType&&f8[ge.helperType]){gb.push(f8[ge.helperType])}else{if(f8[ge.name]){gb.push(f8[ge.name])}}}}for(var f9=0;f9<f8._global.length;f9++){var gc=f8._global[f9];if(gc.pred(ge,this)&&df(gb,gc.val)==-1){gb.push(gc.val)}}return gb},getStateAfter:function(f9,f8){var ga=this.doc;f9=c3(ga,f9==null?ga.first+ga.size-1:f9);return dx(this,f9+1,f8)},cursorCoords:function(gb,f9){var ga,f8=this.doc.sel.primary();if(gb==null){ga=f8.head}else{if(typeof gb=="object"){ga=fG(this.doc,gb)}else{ga=gb?f8.from():f8.to()}}return dQ(this,ga,f9||"page")},charCoords:function(f9,f8){return cH(this,fG(this.doc,f9),f8||"page")},coordsChar:function(f8,f9){f8=f5(this,f8,f9||"page");return fL(this,f8.left,f8.top)},lineAtHeight:function(f8,f9){f8=f5(this,{top:f8,left:0},f9||"page").top;return bF(this.doc,f8+this.display.viewOffset)},heightAtLine:function(f9,gc){var f8=false,gb=this.doc.first+this.doc.size-1;if(f9<this.doc.first){f9=this.doc.first}else{if(f9>gb){f9=gb;f8=true}}var ga=fb(this.doc,f9);return eM(this,ga,{top:0,left:0},gc||"page").top+(f8?this.doc.height-bL(ga):0)},defaultTextHeight:function(){return aU(this.display)},defaultCharWidth:function(){return dz(this.display)},setGutterMarker:c6(function(f8,f9,ga){return eu(this.doc,f8,"gutter",function(gb){var gc=gb.gutterMarkers||(gb.gutterMarkers={});gc[f9]=ga;if(!ga&&eQ(gc)){gb.gutterMarkers=null}return true})}),clearGutter:c6(function(ga){var f8=this,gb=f8.doc,f9=gb.first;gb.iter(function(gc){if(gc.gutterMarkers&&gc.gutterMarkers[ga]){gc.gutterMarkers[ga]=null;S(f8,f9,"gutter");if(eQ(gc.gutterMarkers)){gc.gutterMarkers=null}}++f9})}),addLineWidget:c6(function(ga,f9,f8){return bG(this,ga,f9,f8)}),removeLineWidget:function(f8){f8.clear()},lineInfo:function(f8){if(typeof f8=="number"){if(!b8(this.doc,f8)){return null}var f9=f8;f8=fb(this.doc,f8);if(!f8){return null}}else{var f9=bM(f8);if(f9==null){return null}}return{line:f9,handle:f8,text:f8.text,gutterMarkers:f8.gutterMarkers,textClass:f8.textClass,bgClass:f8.bgClass,wrapClass:f8.wrapClass,widgets:f8.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(gd,ga,gf,gb,gh){var gc=this.display;gd=dQ(this,fG(this.doc,gd));var ge=gd.bottom,f9=gd.left;ga.style.position="absolute";ga.setAttribute("cm-ignore-events","true");gc.sizer.appendChild(ga);if(gb=="over"){ge=gd.top}else{if(gb=="above"||gb=="near"){var f8=Math.max(gc.wrapper.clientHeight,this.doc.height),gg=Math.max(gc.sizer.clientWidth,gc.lineSpace.clientWidth);if((gb=="above"||gd.bottom+ga.offsetHeight>f8)&&gd.top>ga.offsetHeight){ge=gd.top-ga.offsetHeight}else{if(gd.bottom+ga.offsetHeight<=f8){ge=gd.bottom}}if(f9+ga.offsetWidth>gg){f9=gg-ga.offsetWidth}}}ga.style.top=ge+"px";ga.style.left=ga.style.right="";if(gh=="right"){f9=gc.sizer.clientWidth-ga.offsetWidth;ga.style.right="0px"}else{if(gh=="left"){f9=0}else{if(gh=="middle"){f9=(gc.sizer.clientWidth-ga.offsetWidth)/2}}ga.style.left=f9+"px"}if(gf){F(this,f9,ge,f9+ga.offsetWidth,ge+ga.offsetHeight)}},triggerOnKeyDown:c6(p),triggerOnKeyPress:c6(cx),triggerOnKeyUp:bf,execCommand:function(f8){if(ez.hasOwnProperty(f8)){return ez[f8](this)}},findPosH:function(ge,gb,gc,f9){var f8=1;if(gb<0){f8=-1;gb=-gb}for(var ga=0,gd=fG(this.doc,ge);ga<gb;++ga){gd=bv(this.doc,gd,f8,gc,f9);if(gd.hitSide){break}}return gd},moveH:c6(function(f9,ga){var f8=this;f8.extendSelectionsBy(function(gb){if(f8.display.shift||f8.doc.extend||gb.empty()){return bv(f8.doc,gb.head,f9,ga,f8.options.rtlMoveVisually)}else{return f9<0?gb.from():gb.to()}},cU)}),deleteH:c6(function(f8,f9){var ga=this.doc.sel,gb=this.doc;if(ga.somethingSelected()){gb.replaceSelection("",null,"+delete")}else{eT(this,function(gd){var gc=bv(gb,gd.head,f8,f9,false);return f8<0?{from:gc,to:gd.head}:{from:gd.head,to:gc}})}}),findPosV:function(gd,ga,ge,gg){var f8=1,gc=gg;if(ga<0){f8=-1;ga=-ga}for(var f9=0,gf=fG(this.doc,gd);f9<ga;++f9){var gb=dQ(this,gf,"div");if(gc==null){gc=gb.left}else{gb.left=gc}gf=bp(this,gb,f8,ge);if(gf.hitSide){break}}return gf},moveV:c6(function(f9,gb){var f8=this,gd=this.doc,gc=[];var ge=!f8.display.shift&&!gd.extend&&gd.sel.somethingSelected();gd.extendSelectionsBy(function(gf){if(ge){return f9<0?gf.from():gf.to()}var gh=dQ(f8,gf.head,"div");if(gf.goalColumn!=null){gh.left=gf.goalColumn}gc.push(gh.left);var gg=bp(f8,gh,f9,gb);if(gb=="page"&&gf==gd.sel.primary()){cJ(f8,null,cH(f8,gg,"div").top-gh.top)}return gg},cU);if(gc.length){for(var ga=0;ga<gd.sel.ranges.length;ga++){gd.sel.ranges[ga].goalColumn=gc[ga]}}}),findWordAt:function(gf){var gd=this.doc,gb=fb(gd,gf.line).text;var ge=gf.ch,ga=gf.ch;if(gb){var gc=this.getHelper(gf,"wordChars");if((gf.xRel<0||ga==gb.length)&&ge){--ge}else{++ga}var f9=gb.charAt(ge);var f8=cz(f9,gc)?function(gg){return cz(gg,gc)}:/\s/.test(f9)?function(gg){return/\s/.test(gg)}:function(gg){return !/\s/.test(gg)&&!cz(gg)};while(ge>0&&f8(gb.charAt(ge-1))){--ge}while(ga<gb.length&&f8(gb.charAt(ga))){++ga}}return new dU(X(gf.line,ge),X(gf.line,ga))},toggleOverwrite:function(f8){if(f8!=null&&f8==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){fx(this.display.cursorDiv,"CodeMirror-overwrite")}else{f(this.display.cursorDiv,"CodeMirror-overwrite")}aC(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return dK()==this.display.input},scrollTo:c6(function(f8,f9){if(f8!=null||f9!=null){fz(this)}if(f8!=null){this.curOp.scrollLeft=f8}if(f9!=null){this.curOp.scrollTop=f9}}),getScrollInfo:function(){var f8=this.display.scroller;return{left:f8.scrollLeft,top:f8.scrollTop,height:f8.scrollHeight-cR(this)-this.display.barHeight,width:f8.scrollWidth-cR(this)-this.display.barWidth,clientHeight:cT(this),clientWidth:di(this)}},scrollIntoView:c6(function(f9,ga){if(f9==null){f9={from:this.doc.sel.primary().head,to:null};if(ga==null){ga=this.options.cursorScrollMargin}}else{if(typeof f9=="number"){f9={from:X(f9,0),to:null}}else{if(f9.from==null){f9={from:f9,to:null}}}}if(!f9.to){f9.to=f9.from}f9.margin=ga||0;if(f9.from.line!=null){fz(this);this.curOp.scrollToPos=f9}else{var f8=H(this,Math.min(f9.from.left,f9.to.left),Math.min(f9.from.top,f9.to.top)-f9.margin,Math.max(f9.from.right,f9.to.right),Math.max(f9.from.bottom,f9.to.bottom)+f9.margin);this.scrollTo(f8.scrollLeft,f8.scrollTop)}}),setSize:c6(function(gb,f9){var f8=this;function ga(gd){return typeof gd=="number"||/^\d+$/.test(String(gd))?gd+"px":gd}if(gb!=null){f8.display.wrapper.style.width=ga(gb)}if(f9!=null){f8.display.wrapper.style.height=ga(f9)}if(f8.options.lineWrapping){aL(this)}var gc=f8.display.viewFrom;f8.doc.iter(gc,f8.display.viewTo,function(gd){if(gd.widgets){for(var ge=0;ge<gd.widgets.length;ge++){if(gd.widgets[ge].noHScroll){S(f8,gc,"widget");break}}}++gc});f8.curOp.forceUpdate=true;aC(f8,"refresh",this)}),operation:function(f8){return cK(this,f8)},refresh:c6(function(){var f8=this.display.cachedTextHeight;ag(this);this.curOp.forceUpdate=true;aj(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);c2(this);if(f8==null||Math.abs(f8-aU(this.display))>0.5){Y(this)}aC(this,"refresh",this)}),swapDoc:c6(function(f9){var f8=this.doc;f8.cm=null;d7(this,f9);aj(this);fl(this);this.scrollTo(f9.scrollLeft,f9.scrollTop);this.curOp.forceScroll=true;ad(this,"swapDoc",this,f8);return f8}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};bx(I);var eZ=I.defaults={};var bc=I.optionHandlers={};function s(f8,gb,ga,f9){I.defaults[f8]=gb;if(ga){bc[f8]=f9?function(gc,ge,gd){if(gd!=cb){ga(gc,ge,gd)}}:ga}}var cb=I.Init={toString:function(){return"CodeMirror.Init"}};s("value","",function(f8,f9){f8.setValue(f9)},true);s("mode",null,function(f8,f9){f8.doc.modeOption=f9;bq(f8)},true);s("indentUnit",2,bq,true);s("indentWithTabs",false);s("smartIndent",true);s("tabSize",4,function(f8){eh(f8);aj(f8);ag(f8)},true);s("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(f8,f9){f8.options.specialChars=new RegExp(f9.source+(f9.test("\t")?"":"|\t"),"g");f8.refresh()},true);s("specialCharPlaceholder",e8,function(f8){f8.refresh()},true);s("electricChars",true);s("rtlMoveVisually",!aM);s("wholeLineUpdateBefore",true);s("theme","default",function(f8){cM(f8);ds(f8)},true);s("keyMap","default",function(f8,gc,f9){var ga=fR(gc);var gb=f9!=I.Init&&fR(f9);if(gb&&gb.detach){gb.detach(f8,ga)}if(ga.attach){ga.attach(f8,gb||null)}});s("extraKeys",null);s("lineWrapping",false,eC,true);s("gutters",[],function(f8){cd(f8.options);ds(f8)},true);s("fixedGutter",true,function(f8,f9){f8.display.gutters.style.left=f9?dT(f8.display)+"px":"0";f8.refresh()},true);s("coverGutterNextToScrollbar",false,function(f8){eU(f8)},true);s("scrollbarStyle","native",function(f8){aB(f8);eU(f8);f8.display.scrollbars.setScrollTop(f8.doc.scrollTop);f8.display.scrollbars.setScrollLeft(f8.doc.scrollLeft)},true);s("lineNumbers",false,function(f8){cd(f8.options);ds(f8)},true);s("firstLineNumber",1,ds,true);s("lineNumberFormatter",function(f8){return f8},ds,true);s("showCursorWhenSelecting",false,bB,true);s("resetSelectionOnContextMenu",true);s("readOnly",false,function(f8,f9){if(f9=="nocursor"){aS(f8);f8.display.input.blur();f8.display.disabled=true}else{f8.display.disabled=false;if(!f9){fl(f8)}}});s("disableInput",false,function(f8,f9){if(!f9){fl(f8)}},true);s("dragDrop",true);s("cursorBlinkRate",530);s("cursorScrollMargin",0);s("cursorHeight",1,bB,true);s("singleCursorHeightPerLine",true,bB,true);s("workTime",100);s("workDelay",100);s("flattenSpans",true,eh,true);s("addModeClass",false,eh,true);s("pollInterval",100);s("undoDepth",200,function(f8,f9){f8.doc.history.undoDepth=f9});s("historyEventDelay",1250);s("viewportMargin",10,function(f8){f8.refresh()},true);s("maxHighlightLength",10000,eh,true);s("moveInputWithCursor",true,function(f8,f9){if(!f9){f8.display.inputDiv.style.top=f8.display.inputDiv.style.left=0}});s("tabindex",null,function(f8,f9){f8.display.input.tabIndex=f9||""});s("autofocus",null);var dp=I.modes={},aP=I.mimeModes={};I.defineMode=function(f8,f9){if(!I.defaults.mode&&f8!="null"){I.defaults.mode=f8}if(arguments.length>2){f9.dependencies=Array.prototype.slice.call(arguments,2)}dp[f8]=f9};I.defineMIME=function(f9,f8){aP[f9]=f8};I.resolveMode=function(f8){if(typeof f8=="string"&&aP.hasOwnProperty(f8)){f8=aP[f8]}else{if(f8&&typeof f8.name=="string"&&aP.hasOwnProperty(f8.name)){var f9=aP[f8.name];if(typeof f9=="string"){f9={name:f9}}f8=ck(f9,f8);f8.name=f9.name}else{if(typeof f8=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(f8)){return I.resolveMode("application/xml")}}}if(typeof f8=="string"){return{name:f8}}else{return f8||{name:"null"}}};I.getMode=function(f9,f8){var f8=I.resolveMode(f8);var gb=dp[f8.name];if(!gb){return I.getMode(f9,"text/plain")}var gc=gb(f9,f8);if(dl.hasOwnProperty(f8.name)){var ga=dl[f8.name];for(var gd in ga){if(!ga.hasOwnProperty(gd)){continue}if(gc.hasOwnProperty(gd)){gc["_"+gd]=gc[gd]}gc[gd]=ga[gd]}}gc.name=f8.name;if(f8.helperType){gc.helperType=f8.helperType}if(f8.modeProps){for(var gd in f8.modeProps){gc[gd]=f8.modeProps[gd]}}return gc};I.defineMode("null",function(){return{token:function(f8){f8.skipToEnd()}}});I.defineMIME("text/plain","null");var dl=I.modeExtensions={};I.extendMode=function(ga,f9){var f8=dl.hasOwnProperty(ga)?dl[ga]:(dl[ga]={});aK(f9,f8)};I.defineExtension=function(f8,f9){I.prototype[f8]=f9};I.defineDocExtension=function(f8,f9){ar.prototype[f8]=f9};I.defineOption=s;var a5=[];I.defineInitHook=function(f8){a5.push(f8)};var fk=I.helpers={};I.registerHelper=function(f9,f8,ga){if(!fk.hasOwnProperty(f9)){fk[f9]=I[f9]={_global:[]}}fk[f9][f8]=ga};I.registerGlobalHelper=function(ga,f9,f8,gb){I.registerHelper(ga,f9,gb);fk[ga]._global.push({pred:f8,val:gb})};var b2=I.copyState=function(gb,f8){if(f8===true){return f8}if(gb.copyState){return gb.copyState(f8)}var ga={};for(var gc in f8){var f9=f8[gc];if(f9 instanceof Array){f9=f9.concat([])}ga[gc]=f9}return ga};var bZ=I.startState=function(ga,f9,f8){return ga.startState?ga.startState(f9,f8):true};I.innerMode=function(ga,f8){while(ga.innerMode){var f9=ga.innerMode(f8);if(!f9||f9.mode==ga){break}f8=f9.state;ga=f9.mode}return f9||{mode:ga,state:f8}};var ez=I.commands={selectAll:function(f8){f8.setSelection(X(f8.firstLine(),0),X(f8.lastLine()),Z)},singleSelection:function(f8){f8.setSelection(f8.getCursor("anchor"),f8.getCursor("head"),Z)},killLine:function(f8){eT(f8,function(ga){if(ga.empty()){var f9=fb(f8.doc,ga.head.line).text.length;if(ga.head.ch==f9&&ga.head.line<f8.lastLine()){return{from:ga.head,to:X(ga.head.line+1,0)}}else{return{from:ga.head,to:X(ga.head.line,f9)}}}else{return{from:ga.from(),to:ga.to()}}})},deleteLine:function(f8){eT(f8,function(f9){return{from:X(f9.from().line,0),to:fG(f8.doc,X(f9.to().line+1,0))}})},delLineLeft:function(f8){eT(f8,function(f9){return{from:X(f9.from().line,0),to:f9.from()}})},delWrappedLineLeft:function(f8){eT(f8,function(f9){var gb=f8.charCoords(f9.head,"div").top+5;var ga=f8.coordsChar({left:0,top:gb},"div");return{from:ga,to:f9.from()}})},delWrappedLineRight:function(f8){eT(f8,function(f9){var gb=f8.charCoords(f9.head,"div").top+5;var ga=f8.coordsChar({left:f8.display.lineDiv.offsetWidth+100,top:gb},"div");return{from:f9.from(),to:ga}})},undo:function(f8){f8.undo()},redo:function(f8){f8.redo()},undoSelection:function(f8){f8.undoSelection()},redoSelection:function(f8){f8.redoSelection()},goDocStart:function(f8){f8.extendSelection(X(f8.firstLine(),0))},goDocEnd:function(f8){f8.extendSelection(X(f8.lastLine()))},goLineStart:function(f8){f8.extendSelectionsBy(function(f9){return bs(f8,f9.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(f8){f8.extendSelectionsBy(function(f9){return dE(f8,f9.head)},{origin:"+move",bias:1})},goLineEnd:function(f8){f8.extendSelectionsBy(function(f9){return dL(f8,f9.head.line)},{origin:"+move",bias:-1})},goLineRight:function(f8){f8.extendSelectionsBy(function(f9){var ga=f8.charCoords(f9.head,"div").top+5;return f8.coordsChar({left:f8.display.lineDiv.offsetWidth+100,top:ga},"div")},cU)},goLineLeft:function(f8){f8.extendSelectionsBy(function(f9){var ga=f8.charCoords(f9.head,"div").top+5;return f8.coordsChar({left:0,top:ga},"div")},cU)},goLineLeftSmart:function(f8){f8.extendSelectionsBy(function(f9){var ga=f8.charCoords(f9.head,"div").top+5;var gb=f8.coordsChar({left:0,top:ga},"div");if(gb.ch<f8.getLine(gb.line).search(/\S/)){return dE(f8,f9.head)}return gb},cU)},goLineUp:function(f8){f8.moveV(-1,"line")},goLineDown:function(f8){f8.moveV(1,"line")},goPageUp:function(f8){f8.moveV(-1,"page")},goPageDown:function(f8){f8.moveV(1,"page")},goCharLeft:function(f8){f8.moveH(-1,"char")},goCharRight:function(f8){f8.moveH(1,"char")},goColumnLeft:function(f8){f8.moveH(-1,"column")},goColumnRight:function(f8){f8.moveH(1,"column")},goWordLeft:function(f8){f8.moveH(-1,"word")},goGroupRight:function(f8){f8.moveH(1,"group")},goGroupLeft:function(f8){f8.moveH(-1,"group")},goWordRight:function(f8){f8.moveH(1,"word")},delCharBefore:function(f8){f8.deleteH(-1,"char")},delCharAfter:function(f8){f8.deleteH(1,"char")},delWordBefore:function(f8){f8.deleteH(-1,"word")},delWordAfter:function(f8){f8.deleteH(1,"word")},delGroupBefore:function(f8){f8.deleteH(-1,"group")},delGroupAfter:function(f8){f8.deleteH(1,"group")},indentAuto:function(f8){f8.indentSelection("smart")},indentMore:function(f8){f8.indentSelection("add")},indentLess:function(f8){f8.indentSelection("subtract")},insertTab:function(f8){f8.replaceSelection("\t")},insertSoftTab:function(f8){var ga=[],f9=f8.listSelections(),gd=f8.options.tabSize;for(var gc=0;gc<f9.length;gc++){var ge=f9[gc].from();var gb=bS(f8.getLine(ge.line),ge.ch,gd);ga.push(new Array(gd-gb%gd+1).join(" "))}f8.replaceSelections(ga)},defaultTab:function(f8){if(f8.somethingSelected()){f8.indentSelection("add")}else{f8.execCommand("insertTab")}},transposeChars:function(f8){cK(f8,function(){var gb=f8.listSelections(),ga=[];for(var gc=0;gc<gb.length;gc++){var ge=gb[gc].head,f9=fb(f8.doc,ge.line).text;if(f9){if(ge.ch==f9.length){ge=new X(ge.line,ge.ch-1)}if(ge.ch>0){ge=new X(ge.line,ge.ch+1);f8.replaceRange(f9.charAt(ge.ch-1)+f9.charAt(ge.ch-2),X(ge.line,ge.ch-2),ge,"+transpose")}else{if(ge.line>f8.doc.first){var gd=fb(f8.doc,ge.line-1).text;if(gd){f8.replaceRange(f9.charAt(0)+"\n"+gd.charAt(gd.length-1),X(ge.line-1,gd.length-1),X(ge.line,1),"+transpose")}}}}ga.push(new dU(ge,ge))}f8.setSelections(ga)})},newlineAndIndent:function(f8){cK(f8,function(){var f9=f8.listSelections().length;for(var gb=0;gb<f9;gb++){var ga=f8.listSelections()[gb];f8.replaceRange("\n",ga.anchor,ga.head,"+input");f8.indentLine(ga.from().line+1,null,true);fD(f8)}})},toggleOverwrite:function(f8){f8.toggleOverwrite()}};var e6=I.keyMap={};e6.basic={"Left":"goCharLeft","Right":"goCharRight","Up":"goLineUp","Down":"goLineDown","End":"goLineEnd","Home":"goLineStartSmart","PageUp":"goPageUp","PageDown":"goPageDown","Delete":"delCharAfter","Backspace":"delCharBefore","Shift-Backspace":"delCharBefore","Tab":"defaultTab","Shift-Tab":"indentAuto","Enter":"newlineAndIndent","Insert":"toggleOverwrite","Esc":"singleSelection"};e6.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};e6.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"};e6.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};e6["default"]=b6?e6.macDefault:e6.pcDefault;function dq(f9){var gf=f9.split(/-(?!$)/),f9=gf[gf.length-1];var ge,gd,f8,gc;for(var gb=0;gb<gf.length-1;gb++){var ga=gf[gb];if(/^(cmd|meta|m)$/i.test(ga)){gc=true}else{if(/^a(lt)?$/i.test(ga)){ge=true}else{if(/^(c|ctrl|control)$/i.test(ga)){gd=true}else{if(/^s(hift)$/i.test(ga)){f8=true}else{throw new Error("Unrecognized modifier name: "+ga)}}}}}if(ge){f9="Alt-"+f9}if(gd){f9="Ctrl-"+f9}if(gc){f9="Cmd-"+f9}if(f8){f9="Shift-"+f9}return f9}I.normalizeKeyMap=function(gf){var f9={};for(var ge in gf){if(gf.hasOwnProperty(ge)){var gg=gf[ge];if(/^(name|fallthrough|(de|at)tach)$/.test(ge)){continue}if(gg=="..."){delete gf[ge];continue}var gh=bR(ge.split(" "),dq);for(var gd=0;gd<gh.length;gd++){var gb,ga;if(gd==gh.length-1){ga=ge;gb=gg}else{ga=gh.slice(0,gd+1).join(" ");gb="..."}var gc=f9[ga];if(!gc){f9[ga]=gb}else{if(gc!=gb){throw new Error("Inconsistent bindings for "+ga)}}}delete gf[ge]}}for(var f8 in f9){gf[f8]=f9[f8]}return gf};var i=I.lookupKey=function(gb,ge,gd,ga){ge=fR(ge);var gc=ge.call?ge.call(gb,ga):ge[gb];if(gc===false){return"nothing"}if(gc==="..."){return"multi"}if(gc!=null&&gd(gc)){return"handled"}if(ge.fallthrough){if(Object.prototype.toString.call(ge.fallthrough)!="[object Array]"){return i(gb,ge.fallthrough,gd,ga)}for(var f9=0;f9<ge.fallthrough.length;f9++){var f8=i(gb,ge.fallthrough[f9],gd,ga);if(f8){return f8}}}};var ey=I.isModifierKey=function(f9){var f8=typeof f9=="string"?f9:fc[f9.keyCode];return f8=="Ctrl"||f8=="Alt"||f8=="Shift"||f8=="Mod"};var fo=I.keyName=function(f9,gb){if(dY&&f9.keyCode==34&&f9["char"]){return false}var ga=fc[f9.keyCode],f8=ga;if(f8==null||f9.altGraphKey){return false}if(f9.altKey&&ga!="Alt"){f8="Alt-"+f8}if((bP?f9.metaKey:f9.ctrlKey)&&ga!="Ctrl"){f8="Ctrl-"+f8}if((bP?f9.ctrlKey:f9.metaKey)&&ga!="Cmd"){f8="Cmd-"+f8}if(!gb&&f9.shiftKey&&ga!="Shift"){f8="Shift-"+f8}return f8};function fR(f8){return typeof f8=="string"?e6[f8]:f8}I.fromTextArea=function(gf,gg){if(!gg){gg={}}gg.value=gf.value;if(!gg.tabindex&&gf.tabindex){gg.tabindex=gf.tabindex}if(!gg.placeholder&&gf.placeholder){gg.placeholder=gf.placeholder}if(gg.autofocus==null){var f8=dK();gg.autofocus=f8==gf||gf.getAttribute("autofocus")!=null&&f8==document.body}function gc(){gf.value=ge.getValue()}if(gf.form){bW(gf.form,"submit",gc);if(!gg.leaveSubmitMethodAlone){var f9=gf.form,gd=f9.submit;try{var gb=f9.submit=function(){gc();f9.submit=gd;f9.submit();f9.submit=gb}}catch(ga){}}}gf.style.display="none";var ge=I(function(gh){gf.parentNode.insertBefore(gh,gf.nextSibling)},gg);ge.save=gc;ge.getTextArea=function(){return gf};ge.toTextArea=function(){ge.toTextArea=isNaN;gc();gf.parentNode.removeChild(ge.getWrapperElement());gf.style.display="";if(gf.form){d9(gf.form,"submit",gc);if(typeof gf.form.submit=="function"){gf.form.submit=gd}}};return ge};var eP=I.StringStream=function(f8,f9){this.pos=this.start=0;this.string=f8;this.tabSize=f9||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0};eP.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(f8){var ga=this.string.charAt(this.pos);if(typeof f8=="string"){var f9=ga==f8}else{var f9=ga&&(f8.test?f8.test(ga):f8(ga))}if(f9){++this.pos;return ga}},eatWhile:function(f8){var f9=this.pos;while(this.eat(f8)){}return this.pos>f9},eatSpace:function(){var f8=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>f8},skipToEnd:function(){this.pos=this.string.length},skipTo:function(f8){var f9=this.string.indexOf(f8,this.pos);if(f9>-1){this.pos=f9;return true}},backUp:function(f8){this.pos-=f8},column:function(){if(this.lastColumnPos<this.start){this.lastColumnValue=bS(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?bS(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return bS(this.string,null,this.tabSize)-(this.lineStart?bS(this.string,this.lineStart,this.tabSize):0)},match:function(gc,f9,f8){if(typeof gc=="string"){var gd=function(ge){return f8?ge.toLowerCase():ge};var gb=this.string.substr(this.pos,gc.length);if(gd(gb)==gd(gc)){if(f9!==false){this.pos+=gc.length}return true}}else{var ga=this.string.slice(this.pos).match(gc);if(ga&&ga.index>0){return null}if(ga&&f9!==false){this.pos+=ga[0].length}return ga}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(f9,f8){this.lineStart+=f9;try{return f8()}finally{this.lineStart-=f9}}};var Q=I.TextMarker=function(f9,f8){this.lines=[];this.type=f8;this.doc=f9};bx(Q);Q.prototype.clear=function(){if(this.explicitlyCleared){return}var gf=this.doc.cm,f9=gf&&!gf.curOp;if(f9){cG(gf)}if(fe(this,"clear")){var gg=this.find();if(gg){ad(this,"clear",gg.from,gg.to)}}var ga=null,gd=null;for(var gb=0;gb<this.lines.length;++gb){var gh=this.lines[gb];var ge=e5(gh.markedSpans,this);if(gf&&!this.collapsed){S(gf,bM(gh),"text")}else{if(gf){if(ge.to!=null){gd=bM(gh)}if(ge.from!=null){ga=bM(gh)}}}gh.markedSpans=eD(gh.markedSpans,ge);if(ge.from==null&&this.collapsed&&!ft(this.doc,gh)&&gf){fW(gh,aU(gf.display))}}if(gf&&this.collapsed&&!gf.options.lineWrapping){for(var gb=0;gb<this.lines.length;++gb){var f8=y(this.lines[gb]),gc=ej(f8);if(gc>gf.display.maxLineLength){gf.display.maxLine=f8;gf.display.maxLineLength=gc;gf.display.maxLineChanged=true}}}if(ga!=null&&gf&&this.collapsed){ag(gf,ga,gd+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(gf){et(gf.doc)}}if(gf){ad(gf,"markerCleared",gf,this)}if(f9){al(gf)}if(this.parent){this.parent.clear()}};Q.prototype.find=function(gb,f9){if(gb==null&&this.type=="bookmark"){gb=1}var ge,gd;for(var ga=0;ga<this.lines.length;++ga){var f8=this.lines[ga];var gc=e5(f8.markedSpans,this);if(gc.from!=null){ge=X(f9?f8:bM(f8),gc.from);if(gb==-1){return ge}}if(gc.to!=null){gd=X(f9?f8:bM(f8),gc.to);if(gb==1){return gd}}}return ge&&{from:ge,to:gd}};Q.prototype.changed=function(){var ga=this.find(-1,true),f9=this,f8=this.doc.cm;if(!ga||!f8){return}cK(f8,function(){var gc=ga.line,gd=bM(ga.line);var gb=e7(f8,gd);if(gb){at(gb);f8.curOp.selectionChanged=f8.curOp.forceUpdate=true}f8.curOp.updateMaxLine=true;if(!ft(f9.doc,gc)&&f9.height!=null){var gf=f9.height;f9.height=null;var ge=cW(f9)-gf;if(ge){fW(gc,gc.height+ge)}}})};Q.prototype.attachLine=function(f8){if(!this.lines.length&&this.doc.cm){var f9=this.doc.cm.curOp;if(!f9.maybeHiddenMarkers||df(f9.maybeHiddenMarkers,this)==-1){(f9.maybeUnhiddenMarkers||(f9.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(f8)};Q.prototype.detachLine=function(f8){this.lines.splice(df(this.lines,f8),1);if(!this.lines.length&&this.doc.cm){var f9=this.doc.cm.curOp;(f9.maybeHiddenMarkers||(f9.maybeHiddenMarkers=[])).push(this)}};var a2=0;function eB(gg,ge,gf,gi,gc){if(gi&&gi.shared){return P(gg,ge,gf,gi,gc)}if(gg.cm&&!gg.cm.curOp){return c0(gg.cm,eB)(gg,ge,gf,gi,gc)}var gb=new Q(gg,gc),gh=ce(ge,gf);if(gi){aK(gi,gb,false)}if(gh>0||gh==0&&gb.clearWhenEmpty!==false){return gb}if(gb.replacedWith){gb.collapsed=true;gb.widgetNode=fT("span",[gb.replacedWith],"CodeMirror-widget");if(!gi.handleMouseEvents){gb.widgetNode.setAttribute("cm-ignore-events","true")}if(gi.insertLeft){gb.widgetNode.insertLeft=true}}if(gb.collapsed){if(z(gg,ge.line,ge,gf,gb)||ge.line!=gf.line&&z(gg,gf.line,ge,gf,gb)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}a4=true}if(gb.addToHistory){fJ(gg,{from:ge,to:gf,origin:"markText"},gg.sel,NaN)}var f9=ge.line,gd=gg.cm,f8;gg.iter(f9,gf.line+1,function(gj){if(gd&&gb.collapsed&&!gd.options.lineWrapping&&y(gj)==gd.display.maxLine){f8=true}if(gb.collapsed&&f9!=ge.line){fW(gj,0)}cc(gj,new ee(gb,f9==ge.line?ge.ch:null,f9==gf.line?gf.ch:null));++f9});if(gb.collapsed){gg.iter(ge.line,gf.line+1,function(gj){if(ft(gg,gj)){fW(gj,0)}})}if(gb.clearOnEnter){bW(gb,"beforeCursorEnter",function(){gb.clear()})}if(gb.readOnly){f3=true;if(gg.history.done.length||gg.history.undone.length){gg.clearHistory()}}if(gb.collapsed){gb.id=++a2;gb.atomic=true}if(gd){if(f8){gd.curOp.updateMaxLine=true}if(gb.collapsed){ag(gd,ge.line,gf.line+1)}else{if(gb.className||gb.title||gb.startStyle||gb.endStyle||gb.css){for(var ga=ge.line;ga<=gf.line;ga++){S(gd,ga,"text")}}}if(gb.atomic){et(gd.doc)}ad(gd,"markerAdded",gd,gb)}return gb}var x=I.SharedTextMarker=function(ga,f9){this.markers=ga;this.primary=f9;for(var f8=0;f8<ga.length;++f8){ga[f8].parent=this}};bx(x);x.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var f8=0;f8<this.markers.length;++f8){this.markers[f8].clear()}ad(this,"clear")};x.prototype.find=function(f9,f8){return this.primary.find(f9,f8)};function P(gc,gf,ge,f8,ga){f8=aK(f8);f8.shared=false;var gd=[eB(gc,gf,ge,f8,ga)],f9=gd[0];var gb=f8.widgetNode;d3(gc,function(gh){if(gb){f8.widgetNode=gb.cloneNode(true)}gd.push(eB(gh,fG(gh,gf),fG(gh,ge),f8,ga));for(var gg=0;gg<gh.linked.length;++gg){if(gh.linked[gg].isParent){return}}f9=fE(gd)});return new x(gd,f9)}function eL(f8){return f8.findMarks(X(f8.first,0),f8.clipPos(X(f8.lastLine())),function(f9){return f9.parent})}function dB(gd,ge){for(var gb=0;gb<ge.length;gb++){var f9=ge[gb],gf=f9.find();var f8=gd.clipPos(gf.from),gc=gd.clipPos(gf.to);if(ce(f8,gc)){var ga=eB(gd,f8,gc,f9.primary,f9.primary.type);f9.markers.push(ga);ga.parent=f9}}}function ek(gb){for(var ga=0;ga<gb.length;ga++){var f8=gb[ga],gd=[f8.primary.doc];d3(f8.primary.doc,function(ge){gd.push(ge)});for(var f9=0;f9<f8.markers.length;f9++){var gc=f8.markers[f9];if(df(gd,gc.doc)==-1){gc.parent=null;f8.markers.splice(f9--,1)}}}}function ee(f8,ga,f9){this.marker=f8;this.from=ga;this.to=f9}function e5(ga,f8){if(ga){for(var f9=0;f9<ga.length;++f9){var gb=ga[f9];if(gb.marker==f8){return gb}}}}function eD(f9,ga){for(var gb,f8=0;f8<f9.length;++f8){if(f9[f8]!=ga){(gb||(gb=[])).push(f9[f8])}}return gb}function cc(f8,f9){f8.markedSpans=f8.markedSpans?f8.markedSpans.concat([f9]):[f9];f9.marker.attachLine(f8)}function aN(f9,ga,ge){if(f9){for(var gc=0,gf;gc<f9.length;++gc){var gg=f9[gc],gd=gg.marker;var f8=gg.from==null||(gd.inclusiveLeft?gg.from<=ga:gg.from<ga);if(f8||gg.from==ga&&gd.type=="bookmark"&&(!ge||!gg.marker.insertLeft)){var gb=gg.to==null||(gd.inclusiveRight?gg.to>=ga:gg.to>ga);(gf||(gf=[])).push(new ee(gd,gg.from,gb?null:gg.to))}}}return gf}function az(f9,gb,ge){if(f9){for(var gc=0,gf;gc<f9.length;++gc){var gg=f9[gc],gd=gg.marker;var ga=gg.to==null||(gd.inclusiveRight?gg.to>=gb:gg.to>gb);if(ga||gg.from==gb&&gd.type=="bookmark"&&(!ge||gg.marker.insertLeft)){var f8=gg.from==null||(gd.inclusiveLeft?gg.from<=gb:gg.from<gb);(gf||(gf=[])).push(new ee(gd,f8?null:gg.from-gb,gg.to==null?null:gg.to-gb))}}}return gf}function eg(gk,gh){if(gh.full){return null}var gg=b8(gk,gh.from.line)&&fb(gk,gh.from.line).markedSpans;var gn=b8(gk,gh.to.line)&&fb(gk,gh.to.line).markedSpans;if(!gg&&!gn){return null}var f9=gh.from.ch,gc=gh.to.ch,gf=ce(gh.from,gh.to)==0;var ge=aN(gg,f9,gf);var gm=az(gn,gc,gf);var gl=gh.text.length==1,ga=fE(gh.text).length+(gl?f9:0);if(ge){for(var gb=0;gb<ge.length;++gb){var gj=ge[gb];if(gj.to==null){var go=e5(gm,gj.marker);if(!go){gj.to=f9}else{if(gl){gj.to=go.to==null?null:go.to+ga}}}}}if(gm){for(var gb=0;gb<gm.length;++gb){var gj=gm[gb];if(gj.to!=null){gj.to+=ga}if(gj.from==null){var go=e5(ge,gj.marker);if(!go){gj.from=ga;if(gl){(ge||(ge=[])).push(gj)}}}else{gj.from+=ga;if(gl){(ge||(ge=[])).push(gj)}}}}if(ge){ge=q(ge)}if(gm&&gm!=ge){gm=q(gm)}var gd=[ge];if(!gl){var gi=gh.text.length-2,f8;if(gi>0&&ge){for(var gb=0;gb<ge.length;++gb){if(ge[gb].to==null){(f8||(f8=[])).push(new ee(ge[gb].marker,null,null))}}}for(var gb=0;gb<gi;++gb){gd.push(f8)}gd.push(gm)}return gd}function q(f9){for(var f8=0;f8<f9.length;++f8){var ga=f9[f8];if(ga.from!=null&&ga.from==ga.to&&ga.marker.clearWhenEmpty!==false){f9.splice(f8--,1)}}if(!f9.length){return null}return f9}function d5(gg,ge){var f8=b3(gg,ge);var gh=eg(gg,ge);if(!f8){return gh}if(!gh){return f8}for(var gb=0;gb<f8.length;++gb){var gc=f8[gb],gd=gh[gb];if(gc&&gd){spans:for(var ga=0;ga<gd.length;++ga){var gf=gd[ga];for(var f9=0;f9<gc.length;++f9){if(gc[f9].marker==gf.marker){continue spans}}gc.push(gf)}}else{if(gd){f8[gb]=gd}}}return f8}function cF(gk,gi,gj){var gc=null;gk.iter(gi.line,gj.line+1,function(gl){if(gl.markedSpans){for(var gm=0;gm<gl.markedSpans.length;++gm){var gn=gl.markedSpans[gm].marker;if(gn.readOnly&&(!gc||df(gc,gn)==-1)){(gc||(gc=[])).push(gn)}}}});if(!gc){return null}var gd=[{from:gi,to:gj}];for(var ge=0;ge<gc.length;++ge){var gf=gc[ge],ga=gf.find(0);for(var gb=0;gb<gd.length;++gb){var f9=gd[gb];if(ce(f9.to,ga.from)<0||ce(f9.from,ga.to)>0){continue}var gh=[gb,1],f8=ce(f9.from,ga.from),gg=ce(f9.to,ga.to);if(f8<0||!gf.inclusiveLeft&&!f8){gh.push({from:f9.from,to:ga.from})}if(gg>0||!gf.inclusiveRight&&!gg){gh.push({from:ga.to,to:f9.to})}gd.splice.apply(gd,gh);gb+=gh.length-1}}return gd}function fZ(f8){var ga=f8.markedSpans;if(!ga){return}for(var f9=0;f9<ga.length;++f9){ga[f9].marker.detachLine(f8)}f8.markedSpans=null}function c1(f8,ga){if(!ga){return}for(var f9=0;f9<ga.length;++f9){ga[f9].marker.attachLine(f8)}f8.markedSpans=ga}function v(f8){return f8.inclusiveLeft?-1:0}function bV(f8){return f8.inclusiveRight?1:0}function dM(gb,f9){var gd=gb.lines.length-f9.lines.length;if(gd!=0){return gd}var ga=gb.find(),ge=f9.find();var f8=ce(ga.from,ge.from)||v(gb)-v(f9);if(f8){return -f8}var gc=ce(ga.to,ge.to)||bV(gb)-bV(f9);if(gc){return gc}return f9.id-gb.id}function a3(f9,gd){var f8=a4&&f9.markedSpans,gc;if(f8){for(var gb,ga=0;ga<f8.length;++ga){gb=f8[ga];if(gb.marker.collapsed&&(gd?gb.from:gb.to)==null&&(!gc||dM(gc,gb.marker)<0)){gc=gb.marker}}}return gc}function eK(f8){return a3(f8,true)}function er(f8){return a3(f8,false)}function z(gg,ga,ge,gf,gc){var gj=fb(gg,ga);var f8=a4&&gj.markedSpans;if(f8){for(var gb=0;gb<f8.length;++gb){var f9=f8[gb];if(!f9.marker.collapsed){continue}var gi=f9.marker.find(0);var gh=ce(gi.from,ge)||v(f9.marker)-v(gc);var gd=ce(gi.to,gf)||bV(f9.marker)-bV(gc);if(gh>=0&&gd<=0||gh<=0&&gd>=0){continue}if(gh<=0&&(ce(gi.to,ge)>0||(f9.marker.inclusiveRight&&gc.inclusiveLeft))||gh>=0&&(ce(gi.from,gf)<0||(f9.marker.inclusiveLeft&&gc.inclusiveRight))){return true}}}}function y(f9){var f8;while(f8=eK(f9)){f9=f8.find(-1,true).line}return f9}function h(ga){var f8,f9;while(f8=er(ga)){ga=f8.find(1,true).line;(f9||(f9=[])).push(ga)}return f9}function aT(gb,f9){var f8=fb(gb,f9),ga=y(f8);if(f8==ga){return f9}return bM(ga)}function dZ(gb,ga){if(ga>gb.lastLine()){return ga}var f9=fb(gb,ga),f8;if(!ft(gb,f9)){return ga}while(f8=er(f9)){f9=f8.find(1,true).line}return bM(f9)+1}function ft(gc,f9){var f8=a4&&f9.markedSpans;if(f8){for(var gb,ga=0;ga<f8.length;++ga){gb=f8[ga];if(!gb.marker.collapsed){continue}if(gb.from==null){return true}if(gb.marker.widgetNode){continue}if(gb.from==0&&gb.marker.inclusiveLeft&&U(gc,f9,gb)){return true}}}}function U(gd,f9,gb){if(gb.to==null){var f8=gb.marker.find(1,true);return U(gd,f8.line,e5(f8.line.markedSpans,gb.marker))}if(gb.marker.inclusiveRight&&gb.to==f9.text.length){return true}for(var gc,ga=0;ga<f9.markedSpans.length;++ga){gc=f9.markedSpans[ga];if(gc.marker.collapsed&&!gc.marker.widgetNode&&gc.from==gb.to&&(gc.to==null||gc.to!=gb.from)&&(gc.marker.inclusiveLeft||gb.marker.inclusiveRight)&&U(gd,f9,gc)){return true}}}var dy=I.LineWidget=function(f8,gb,f9){if(f9){for(var ga in f9){if(f9.hasOwnProperty(ga)){this[ga]=f9[ga]}}}this.cm=f8;this.node=gb};bx(dy);function dW(f8,f9,ga){if(bL(f9)<((f8.curOp&&f8.curOp.scrollTop)||f8.doc.scrollTop)){cJ(f8,null,ga)}}dy.prototype.clear=function(){var f9=this.cm,gb=this.line.widgets,ga=this.line,gd=bM(ga);if(gd==null||!gb){return}for(var gc=0;gc<gb.length;++gc){if(gb[gc]==this){gb.splice(gc--,1)}}if(!gb.length){ga.widgets=null}var f8=cW(this);cK(f9,function(){dW(f9,ga,-f8);S(f9,gd,"widget");fW(ga,Math.max(0,ga.height-f8))})};dy.prototype.changed=function(){var f9=this.height,f8=this.cm,ga=this.line;this.height=null;var gb=cW(this)-f9;if(!gb){return}cK(f8,function(){f8.curOp.forceUpdate=true;dW(f8,ga,gb);fW(ga,ga.height+gb)})};function cW(f9){if(f9.height!=null){return f9.height}if(!f1(document.body,f9.node)){var f8="position: relative;";if(f9.coverGutter){f8+="margin-left: -"+f9.cm.display.gutters.offsetWidth+"px;"}if(f9.noHScroll){f8+="width: "+f9.cm.display.wrapper.clientWidth+"px;"}bQ(f9.cm.display.measure,fT("div",[f9.node],null,f8))}return f9.height=f9.node.offsetHeight}function bG(f8,gc,ga,f9){var gb=new dy(f8,ga,f9);if(gb.noHScroll){f8.display.alignWidgets=true}eu(f8.doc,gc,"widget",function(ge){var gf=ge.widgets||(ge.widgets=[]);if(gb.insertAt==null){gf.push(gb)}else{gf.splice(Math.min(gf.length-1,Math.max(0,gb.insertAt)),0,gb)}gb.line=ge;if(!ft(f8.doc,ge)){var gd=bL(ge)<f8.doc.scrollTop;fW(ge,ge.height+cW(gb));if(gd){cJ(f8,null,gb.height)}f8.curOp.forceUpdate=true}return true});return gb}var fX=I.Line=function(ga,f9,f8){this.text=ga;c1(this,f9);this.height=f8?f8(this):1};bx(fX);fX.prototype.lineNo=function(){return bM(this)};function ei(f9,gc,ga,f8){f9.text=gc;if(f9.stateAfter){f9.stateAfter=null}if(f9.styles){f9.styles=null}if(f9.order!=null){f9.order=null}fZ(f9);c1(f9,ga);var gb=f8?f8(f9):1;if(gb!=f9.height){fW(f9,gb)}}function bA(f8){f8.parent=null;fZ(f8)}function dg(ga,f9){if(ga){for(;;){var f8=ga.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!f8){break}ga=ga.slice(0,f8.index)+ga.slice(f8.index+f8[0].length);var gb=f8[1]?"bgClass":"textClass";if(f9[gb]==null){f9[gb]=f8[2]}else{if(!(new RegExp("(?:^|s)"+f8[2]+"(?:$|s)")).test(f9[gb])){f9[gb]+=" "+f8[2]}}}}return ga}function fn(ga,f9){if(ga.blankLine){return ga.blankLine(f9)}if(!ga.innerMode){return}var f8=I.innerMode(ga,f9);if(f8.mode.blankLine){return f8.mode.blankLine(f8.state)}}function ew(gd,gc,gb,f8){for(var f9=0;f9<10;f9++){if(f8){f8[0]=I.innerMode(gd,gb).mode}var ga=gd.token(gc,gb);if(gc.pos>gc.start){return ga}}throw new Error("Mode "+gd.name+" failed to advance stream.")}function cq(gh,gf,gc,gb){function f8(gk){return{start:gi.start,end:gi.pos,string:gi.current(),type:ga||null,state:gk?b2(gg.mode,f9):f9}}var gg=gh.doc,gd=gg.mode,ga;gf=fG(gg,gf);var gj=fb(gg,gf.line),f9=dx(gh,gf.line,gc);var gi=new eP(gj.text,gh.options.tabSize),ge;if(gb){ge=[]}while((gb||gi.pos<gf.ch)&&!gi.eol()){gi.start=gi.pos;ga=ew(gd,gi,f9);if(gb){ge.push(f8(true))}}return gb?ge:f8()}function w(gi,gk,gd,f9,ge,gb,gc){var ga=gd.flattenSpans;if(ga==null){ga=gi.options.flattenSpans}var gg=0,gf=null;var gj=new eP(gk,gi.options.tabSize),f8;var gm=gi.options.addModeClass&&[null];if(gk==""){dg(fn(gd,f9),gb)}while(!gj.eol()){if(gj.pos>gi.options.maxHighlightLength){ga=false;if(gc){dt(gi,gk,f9,gj.pos)}gj.pos=gk.length;f8=null}else{f8=dg(ew(gd,gj,f9,gm),gb)}if(gm){var gl=gm[0].name;if(gl){f8="m-"+(f8?gl+" "+f8:gl)}}if(!ga||gf!=f8){while(gg<gj.start){gg=Math.min(gj.start,gg+50000);ge(gg,gf)}gf=f8}gj.start=gj.pos}while(gg<gj.pos){var gh=Math.min(gj.pos,gg+50000);ge(gh,gf);gg=gh}}function fw(gf,gh,f8,gc){var gg=[gf.state.modeGen],gb={};w(gf,gh.text,gf.doc.mode,f8,function(gi,gj){gg.push(gi,gj)},gb,gc);for(var f9=0;f9<gf.state.overlays.length;++f9){var gd=gf.state.overlays[f9],ge=1,ga=0;w(gf,gh.text,gd.mode,true,function(gi,gk){var gm=ge;while(ga<gi){var gj=gg[ge];if(gj>gi){gg.splice(ge,1,gi,gg[ge+1],gj)}ge+=2;ga=Math.min(gi,gj)}if(!gk){return}if(gd.opaque){gg.splice(gm,ge-gm,gi,"cm-overlay "+gk);ge=gm+2}else{for(;gm<ge;gm+=2){var gl=gg[gm+1];gg[gm+1]=(gl?gl+" ":"")+"cm-overlay "+gk}}},gb)}return{styles:gg,classes:gb.bgClass||gb.textClass?gb:null}}function c4(f9,ga,gb){if(!ga.styles||ga.styles[0]!=f9.state.modeGen){var f8=fw(f9,ga,ga.stateAfter=dx(f9,bM(ga)));ga.styles=f8.styles;if(f8.classes){ga.styleClasses=f8.classes}else{if(ga.styleClasses){ga.styleClasses=null}}if(gb===f9.doc.frontier){f9.doc.frontier++}}return ga.styles}function dt(f8,gd,ga,f9){var gc=f8.doc.mode;var gb=new eP(gd,f8.options.tabSize);gb.start=gb.pos=f9||0;if(gd==""){fn(gc,ga)}while(!gb.eol()&&gb.pos<=f8.options.maxHighlightLength){ew(gc,gb,ga);gb.start=gb.pos}}var dS={},b0={};function eS(ga,f9){if(!ga||/^\s*$/.test(ga)){return null}var f8=f9.addModeClass?b0:dS;return f8[ga]||(f8[ga]=ga.replace(/\S+/g,"cm-$&"))}function eN(f9,gd){var ge=fT("span",null,null,cY?"padding-right: .1px":null);var gb={pre:fT("pre",[ge]),content:ge,col:0,pos:0,cm:f9};gd.measure={};for(var gc=0;gc<=(gd.rest?gd.rest.length:0);gc++){var ga=gc?gd.rest[gc-1]:gd.line,f8;gb.pos=0;gb.addToken=t;if((dG||cY)&&f9.getOption("lineWrapping")){gb.addToken=fC(gb.addToken)}if(bN(f9.display.measure)&&(f8=a(ga))){gb.addToken=V(gb.addToken,f8)}gb.map=[];var gf=gd!=f9.display.externalMeasured&&bM(ga);bn(ga,gb,c4(f9,ga,gf));if(ga.styleClasses){if(ga.styleClasses.bgClass){gb.bgClass=fO(ga.styleClasses.bgClass,gb.bgClass||"")}if(ga.styleClasses.textClass){gb.textClass=fO(ga.styleClasses.textClass,gb.textClass||"")}}if(gb.map.length==0){gb.map.push(0,0,gb.content.appendChild(bm(f9.display.measure)))}if(gc==0){gd.measure.map=gb.map;gd.measure.cache={}}else{(gd.measure.maps||(gd.measure.maps=[])).push(gb.map);(gd.measure.caches||(gd.measure.caches=[])).push({})}}if(cY&&/\bcm-tab\b/.test(gb.content.lastChild.className)){gb.content.className="cm-tab-wrap-hack"}aC(f9,"renderLine",f9,gd.line,gb.pre);if(gb.pre.className){gb.textClass=fO(gb.pre.className,gb.textClass||"")}return gb}function e8(f9){var f8=fT("span","\u2022","cm-invalidchar");f8.title="\\u"+f9.charCodeAt(0).toString(16);return f8}function t(gj,ge,gn,gl,gh,gp,gd){if(!ge){return}var f8=gj.cm.options.specialChars,f9=false;if(!f8.test(ge)){gj.col+=ge.length;var gm=document.createTextNode(ge);gj.map.push(gj.pos,gj.pos+ge.length,gm);if(dG&&k<9){f9=true}gj.pos+=ge.length}else{var gm=document.createDocumentFragment(),gb=0;while(true){f8.lastIndex=gb;var gk=f8.exec(ge);var go=gk?gk.index-gb:ge.length-gb;if(go){var gg=document.createTextNode(ge.slice(gb,gb+go));if(dG&&k<9){gm.appendChild(fT("span",[gg]))}else{gm.appendChild(gg)}gj.map.push(gj.pos,gj.pos+go,gg);gj.col+=go;gj.pos+=go}if(!gk){break}gb+=go+1;if(gk[0]=="\t"){var gi=gj.cm.options.tabSize,gf=gi-gj.col%gi;var gg=gm.appendChild(fT("span",cp(gf),"cm-tab"));gj.col+=gf}else{var gg=gj.cm.options.specialCharPlaceholder(gk[0]);if(dG&&k<9){gm.appendChild(fT("span",[gg]))}else{gm.appendChild(gg)}gj.col+=1}gj.map.push(gj.pos,gj.pos+1,gg);gj.pos++}}if(gn||gl||gh||f9||gd){var ga=gn||"";if(gl){ga+=gl}if(gh){ga+=gh}var gc=fT("span",[gm],ga,gd);if(gp){gc.title=gp}return gj.content.appendChild(gc)}gj.content.appendChild(gm)}function fC(f8){function f9(ga){var gb=" ";for(var gc=0;gc<ga.length-2;++gc){gb+=gc%2?" ":"\u00a0"}gb+=" ";return gb}return function(gb,gf,gc,ga,ge,gd){f8(gb,gf.replace(/ {3,}/g,f9),gc,ga,ge,gd)}}function V(f9,f8){return function(gg,gi,ga,ge,gj,gh){ga=ga?ga+" cm-force-border":"cm-force-border";var gb=gg.pos,gd=gb+gi.length;for(;;){for(var gf=0;gf<f8.length;gf++){var gc=f8[gf];if(gc.to>gb&&gc.from<=gb){break}}if(gc.to>=gd){return f9(gg,gi,ga,ge,gj,gh)}f9(gg,gi.slice(0,gc.to-gb),ga,ge,null,gh);ge=null;gi=gi.slice(gc.to-gb);gb=gc.to}}}function ab(f9,gb,f8,ga){var gc=!ga&&f8.widgetNode;if(gc){f9.map.push(f9.pos,f9.pos+gb,gc);f9.content.appendChild(gc)}f9.pos+=gb}function bn(gh,go,gg){var gd=gh.markedSpans,gf=gh.text,gm=0;if(!gd){for(var gr=1;gr<gg.length;gr+=2){go.addToken(go,gf.slice(gm,gm=gg[gr]),eS(gg[gr+1],go.cm.options))}return}var gs=gf.length,gc=0,gr=1,gk="",gt,gi;var gv=0,f8,gu,gl,gw,ga;for(;;){if(gv==gc){f8=gu=gl=gw=gi="";ga=null;gv=Infinity;var ge=[];for(var gp=0;gp<gd.length;++gp){var gq=gd[gp],gn=gq.marker;if(gq.from<=gc&&(gq.to==null||gq.to>gc)){if(gq.to!=null&&gv>gq.to){gv=gq.to;gu=""}if(gn.className){f8+=" "+gn.className}if(gn.css){gi=gn.css}if(gn.startStyle&&gq.from==gc){gl+=" "+gn.startStyle}if(gn.endStyle&&gq.to==gv){gu+=" "+gn.endStyle}if(gn.title&&!gw){gw=gn.title}if(gn.collapsed&&(!ga||dM(ga.marker,gn)<0)){ga=gq}}else{if(gq.from>gc&&gv>gq.from){gv=gq.from}}if(gn.type=="bookmark"&&gq.from==gc&&gn.widgetNode){ge.push(gn)}}if(ga&&(ga.from||0)==gc){ab(go,(ga.to==null?gs+1:ga.to)-gc,ga.marker,ga.from==null);if(ga.to==null){return}}if(!ga&&ge.length){for(var gp=0;gp<ge.length;++gp){ab(go,0,ge[gp])}}}if(gc>=gs){break}var gj=Math.min(gs,gv);while(true){if(gk){var f9=gc+gk.length;if(!ga){var gb=f9>gj?gk.slice(0,gj-gc):gk;go.addToken(go,gb,gt?gt+f8:f8,gl,gc+gb.length==gv?gu:"",gw,gi)}if(f9>=gj){gk=gk.slice(gj-gc);gc=gj;break}gc=f9;gl=""}gk=gf.slice(gm,gm=gg[gr++]);gt=eS(gg[gr++],go.cm.options)}}}function dO(f8,f9){return f9.from.ch==0&&f9.to.ch==0&&fE(f9.text)==""&&(!f8.cm||f8.cm.options.wholeLineUpdateBefore)}function fv(gl,gg,f9,gc){function gm(go){return f9?f9[go]:null}function ga(go,gq,gp){ei(go,gq,gp,gc);ad(go,"change",go,gg)}function f8(gr,gp){for(var gq=gr,go=[];gq<gp;++gq){go.push(new fX(gn[gq],gm(gq),gc))}return go}var gk=gg.from,gj=gg.to,gn=gg.text;var gh=fb(gl,gk.line),gi=fb(gl,gj.line);var gf=fE(gn),gb=gm(gn.length-1),ge=gj.line-gk.line;if(gg.full){gl.insert(0,f8(0,gn.length));gl.remove(gn.length,gl.size-gn.length)}else{if(dO(gl,gg)){var gd=f8(0,gn.length-1);ga(gi,gi.text,gb);if(ge){gl.remove(gk.line,ge)}if(gd.length){gl.insert(gk.line,gd)}}else{if(gh==gi){if(gn.length==1){ga(gh,gh.text.slice(0,gk.ch)+gf+gh.text.slice(gj.ch),gb)}else{var gd=f8(1,gn.length-1);gd.push(new fX(gf+gh.text.slice(gj.ch),gb,gc));ga(gh,gh.text.slice(0,gk.ch)+gn[0],gm(0));gl.insert(gk.line+1,gd)}}else{if(gn.length==1){ga(gh,gh.text.slice(0,gk.ch)+gn[0]+gi.text.slice(gj.ch),gm(0));gl.remove(gk.line+1,ge)}else{ga(gh,gh.text.slice(0,gk.ch)+gn[0],gm(0));ga(gi,gf+gi.text.slice(gj.ch),gb);var gd=f8(1,gn.length-1);if(ge>1){gl.remove(gk.line+1,ge-1)}gl.insert(gk.line+1,gd)}}}}ad(gl,"change",gl,gg)}function eV(f9){this.lines=f9;this.parent=null;for(var ga=0,f8=0;ga<f9.length;++ga){f9[ga].parent=this;f8+=f9[ga].height}this.height=f8}eV.prototype={chunkSize:function(){return this.lines.length},removeInner:function(f8,gc){for(var ga=f8,gb=f8+gc;ga<gb;++ga){var f9=this.lines[ga];this.height-=f9.height;bA(f9);ad(f9,"delete")}this.lines.splice(f8,gc)},collapse:function(f8){f8.push.apply(f8,this.lines)},insertInner:function(f9,ga,f8){this.height+=f8;this.lines=this.lines.slice(0,f9).concat(ga).concat(this.lines.slice(f9));for(var gb=0;gb<ga.length;++gb){ga[gb].parent=this}},iterN:function(f8,gb,ga){for(var f9=f8+gb;f8<f9;++f8){if(ga(this.lines[f8])){return true}}}};function fu(gb){this.children=gb;var ga=0,f8=0;for(var f9=0;f9<gb.length;++f9){var gc=gb[f9];ga+=gc.chunkSize();f8+=gc.height;gc.parent=this}this.size=ga;this.height=f8;this.parent=null}fu.prototype={chunkSize:function(){return this.size},removeInner:function(f8,gf){this.size-=gf;for(var ga=0;ga<this.children.length;++ga){var ge=this.children[ga],gc=ge.chunkSize();if(f8<gc){var gb=Math.min(gf,gc-f8),gd=ge.height;ge.removeInner(f8,gb);this.height-=gd-ge.height;if(gc==gb){this.children.splice(ga--,1);ge.parent=null}if((gf-=gb)==0){break}f8=0}else{f8-=gc}}if(this.size-gf<25&&(this.children.length>1||!(this.children[0] instanceof eV))){var f9=[];this.collapse(f9);this.children=[new eV(f9)];this.children[0].parent=this}},collapse:function(f8){for(var f9=0;f9<this.children.length;++f9){this.children[f9].collapse(f8)}},insertInner:function(f9,ga,f8){this.size+=ga.length;this.height+=f8;for(var gd=0;gd<this.children.length;++gd){var gf=this.children[gd],ge=gf.chunkSize();if(f9<=ge){gf.insertInner(f9,ga,f8);if(gf.lines&&gf.lines.length>50){while(gf.lines.length>50){var gc=gf.lines.splice(gf.lines.length-25,25);var gb=new eV(gc);gf.height-=gb.height;this.children.splice(gd+1,0,gb);gb.parent=this}this.maybeSpill()}break}f9-=ge}},maybeSpill:function(){if(this.children.length<=10){return}var gb=this;do{var f9=gb.children.splice(gb.children.length-5,5);var ga=new fu(f9);if(!gb.parent){var gc=new fu(gb.children);gc.parent=gb;gb.children=[gc,ga];gb=gc}else{gb.size-=ga.size;gb.height-=ga.height;var f8=df(gb.parent.children,gb);gb.parent.children.splice(f8+1,0,ga)}ga.parent=gb.parent}while(gb.children.length>10);gb.parent.maybeSpill()},iterN:function(f8,ge,gd){for(var f9=0;f9<this.children.length;++f9){var gc=this.children[f9],gb=gc.chunkSize();if(f8<gb){var ga=Math.min(ge,gb-f8);if(gc.iterN(f8,ga,gd)){return true}if((ge-=ga)==0){break}f8=0}else{f8-=gb}}}};var cr=0;var ar=I.Doc=function(ga,f9,f8){if(!(this instanceof ar)){return new ar(ga,f9,f8)}if(f8==null){f8=0}fu.call(this,[new eV([new fX("",null)])]);this.first=f8;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.frontier=f8;var gb=X(f8,0);this.sel=eO(gb);this.history=new fP(null);this.id=++cr;this.modeOption=f9;if(typeof ga=="string"){ga=aX(ga)}fv(this,{from:gb,to:gb,text:ga});bT(this,eO(gb),Z)};ar.prototype=ck(fu.prototype,{constructor:ar,iter:function(ga,f9,f8){if(f8){this.iterN(ga-this.first,f9-ga,f8)}else{this.iterN(this.first,this.first+this.size,ga)}},insert:function(f9,ga){var f8=0;for(var gb=0;gb<ga.length;++gb){f8+=ga[gb].height}this.insertInner(f9-this.first,ga,f8)},remove:function(f8,f9){this.removeInner(f8-this.first,f9)},getValue:function(f9){var f8=aZ(this,this.first,this.first+this.size);if(f9===false){return f8}return f8.join(f9||"\n")},setValue:cC(function(f9){var ga=X(this.first,0),f8=this.first+this.size-1;bd(this,{from:ga,to:X(f8,fb(this,f8).text.length),text:aX(f9),origin:"setValue",full:true},true);bT(this,eO(ga))}),replaceRange:function(f9,gb,ga,f8){gb=fG(this,gb);ga=ga?fG(this,ga):gb;aY(this,f9,gb,ga,f8)},getRange:function(gb,ga,f9){var f8=fV(this,fG(this,gb),fG(this,ga));if(f9===false){return f8}return f8.join(f9||"\n")},getLine:function(f9){var f8=this.getLineHandle(f9);return f8&&f8.text},getLineHandle:function(f8){if(b8(this,f8)){return fb(this,f8)}},getLineNumber:function(f8){return bM(f8)},getLineHandleVisualStart:function(f8){if(typeof f8=="number"){f8=fb(this,f8)}return y(f8)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(f8){return fG(this,f8)},getCursor:function(ga){var f8=this.sel.primary(),f9;if(ga==null||ga=="head"){f9=f8.head}else{if(ga=="anchor"){f9=f8.anchor}else{if(ga=="end"||ga=="to"||ga===false){f9=f8.to()}else{f9=f8.from()}}}return f9},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:cC(function(f8,ga,f9){G(this,fG(this,typeof f8=="number"?X(f8,ga||0):f8),null,f9)}),setSelection:cC(function(f9,ga,f8){G(this,fG(this,f9),fG(this,ga||f9),f8)}),extendSelection:cC(function(ga,f8,f9){fQ(this,fG(this,ga),f8&&fG(this,f8),f9)}),extendSelections:cC(function(f9,f8){av(this,dV(this,f9,f8))}),extendSelectionsBy:cC(function(f9,f8){av(this,bR(this.sel.ranges,f9),f8)}),setSelections:cC(function(f8,gc,ga){if(!f8.length){return}for(var gb=0,f9=[];gb<f8.length;gb++){f9[gb]=new dU(fG(this,f8[gb].anchor),fG(this,f8[gb].head))}if(gc==null){gc=Math.min(f8.length-1,this.sel.primIndex)}bT(this,cw(f9,gc),ga)}),addSelection:cC(function(ga,gb,f9){var f8=this.sel.ranges.slice(0);f8.push(new dU(fG(this,ga),fG(this,gb||ga)));bT(this,cw(f8,f8.length-1),f9)}),getSelection:function(gc){var f9=this.sel.ranges,f8;for(var ga=0;ga<f9.length;ga++){var gb=fV(this,f9[ga].from(),f9[ga].to());f8=f8?f8.concat(gb):gb}if(gc===false){return f8}else{return f8.join(gc||"\n")}},getSelections:function(gc){var gb=[],f8=this.sel.ranges;for(var f9=0;f9<f8.length;f9++){var ga=fV(this,f8[f9].from(),f8[f9].to());if(gc!==false){ga=ga.join(gc||"\n")}gb[f9]=ga}return gb},replaceSelection:function(ga,gc,f8){var gb=[];for(var f9=0;f9<this.sel.ranges.length;f9++){gb[f9]=ga}this.replaceSelections(gb,gc,f8||"+input")},replaceSelections:cC(function(gd,gf,ga){var gc=[],ge=this.sel;for(var gb=0;gb<ge.ranges.length;gb++){var f9=ge.ranges[gb];gc[gb]={from:f9.from(),to:f9.to(),text:aX(gd[gb]),origin:ga}}var f8=gf&&gf!="end"&&ae(this,gc,gf);for(var gb=gc.length-1;gb>=0;gb--){bd(this,gc[gb])}if(f8){e3(this,f8)}else{if(this.cm){fD(this.cm)}}}),undo:cC(function(){b7(this,"undo")}),redo:cC(function(){b7(this,"redo")}),undoSelection:cC(function(){b7(this,"undo",true)}),redoSelection:cC(function(){b7(this,"redo",true)}),setExtending:function(f8){this.extend=f8},getExtending:function(){return this.extend},historySize:function(){var gb=this.history,f8=0,ga=0;for(var f9=0;f9<gb.done.length;f9++){if(!gb.done[f9].ranges){++f8}}for(var f9=0;f9<gb.undone.length;f9++){if(!gb.undone[f9].ranges){++ga}}return{undo:f8,redo:ga}},clearHistory:function(){this.history=new fP(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(f8){if(f8){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(f8){return this.history.generation==(f8||this.cleanGeneration)},getHistory:function(){return{done:bO(this.history.done),undone:bO(this.history.undone)}},setHistory:function(f9){var f8=this.history=new fP(this.history.maxGeneration);f8.done=bO(f9.done.slice(0),null,true);f8.undone=bO(f9.undone.slice(0),null,true)},addLineClass:cC(function(ga,f9,f8){return eu(this,ga,f9=="gutter"?"gutter":"class",function(gb){var gc=f9=="text"?"textClass":f9=="background"?"bgClass":f9=="gutter"?"gutterClass":"wrapClass";if(!gb[gc]){gb[gc]=f8}else{if(T(f8).test(gb[gc])){return false}else{gb[gc]+=" "+f8}}return true})}),removeLineClass:cC(function(ga,f9,f8){return eu(this,ga,f9=="gutter"?"gutter":"class",function(gc){var gf=f9=="text"?"textClass":f9=="background"?"bgClass":f9=="gutter"?"gutterClass":"wrapClass";var ge=gc[gf];if(!ge){return false}else{if(f8==null){gc[gf]=null}else{var gd=ge.match(T(f8));if(!gd){return false}var gb=gd.index+gd[0].length;gc[gf]=ge.slice(0,gd.index)+(!gd.index||gb==ge.length?"":" ")+ge.slice(gb)||null}}return true})}),markText:function(ga,f9,f8){return eB(this,fG(this,ga),fG(this,f9),f8,"range")},setBookmark:function(ga,f8){var f9={replacedWith:f8&&(f8.nodeType==null?f8.widget:f8),insertLeft:f8&&f8.insertLeft,clearWhenEmpty:false,shared:f8&&f8.shared};ga=fG(this,ga);return eB(this,ga,ga,f9,"bookmark")},findMarksAt:function(gc){gc=fG(this,gc);var gb=[],f9=fb(this,gc.line).markedSpans;if(f9){for(var f8=0;f8<f9.length;++f8){var ga=f9[f8];if((ga.from==null||ga.from<=gc.ch)&&(ga.to==null||ga.to>=gc.ch)){gb.push(ga.marker.parent||ga.marker)}}}return gb},findMarks:function(gc,gb,f8){gc=fG(this,gc);gb=fG(this,gb);var f9=[],ga=gc.line;this.iter(gc.line,gb.line+1,function(gd){var gf=gd.markedSpans;if(gf){for(var ge=0;ge<gf.length;ge++){var gg=gf[ge];if(!(ga==gc.line&&gc.ch>gg.to||gg.from==null&&ga!=gc.line||ga==gb.line&&gg.from>gb.ch)&&(!f8||f8(gg.marker))){f9.push(gg.marker.parent||gg.marker)}}}++ga});return f9},getAllMarks:function(){var f8=[];this.iter(function(ga){var f9=ga.markedSpans;if(f9){for(var gb=0;gb<f9.length;++gb){if(f9[gb].from!=null){f8.push(f9[gb].marker)}}}});return f8},posFromIndex:function(f9){var f8,ga=this.first;this.iter(function(gb){var gc=gb.text.length+1;if(gc>f9){f8=f9;return true}f9-=gc;++ga});return fG(this,X(ga,f8))},indexFromPos:function(f9){f9=fG(this,f9);var f8=f9.ch;if(f9.line<this.first||f9.ch<0){return 0}this.iter(this.first,f9.line,function(ga){f8+=ga.text.length+1});return f8},copy:function(f8){var f9=new ar(aZ(this,this.first,this.first+this.size),this.modeOption,this.first);f9.scrollTop=this.scrollTop;f9.scrollLeft=this.scrollLeft;f9.sel=this.sel;f9.extend=false;if(f8){f9.history.undoDepth=this.history.undoDepth;f9.setHistory(this.getHistory())}return f9},linkedDoc:function(f8){if(!f8){f8={}}var gb=this.first,ga=this.first+this.size;if(f8.from!=null&&f8.from>gb){gb=f8.from}if(f8.to!=null&&f8.to<ga){ga=f8.to}var f9=new ar(aZ(this,gb,ga),f8.mode||this.modeOption,gb);if(f8.sharedHist){f9.history=this.history}(this.linked||(this.linked=[])).push({doc:f9,sharedHist:f8.sharedHist});f9.linked=[{doc:this,isParent:true,sharedHist:f8.sharedHist}];dB(f9,eL(this));return f9},unlinkDoc:function(f9){if(f9 instanceof I){f9=f9.doc}if(this.linked){for(var ga=0;ga<this.linked.length;++ga){var gb=this.linked[ga];if(gb.doc!=f9){continue}this.linked.splice(ga,1);f9.unlinkDoc(this);ek(eL(this));break}}if(f9.history==this.history){var f8=[f9.id];d3(f9,function(gc){f8.push(gc.id)},true);f9.history=new fP(null);f9.history.done=bO(this.history.done,f8);f9.history.undone=bO(this.history.undone,f8)}},iterLinkedDocs:function(f8){d3(this,f8)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});ar.prototype.eachLine=ar.prototype.iter;var d="iter insert remove copy getEditor".split(" ");for(var bJ in ar.prototype){if(ar.prototype.hasOwnProperty(bJ)&&df(d,bJ)<0){I.prototype[bJ]=(function(f8){return function(){return f8.apply(this.doc,arguments)}})(ar.prototype[bJ])}}bx(ar);function d3(gb,ga,f9){function f8(gh,gf,gd){if(gh.linked){for(var ge=0;ge<gh.linked.length;++ge){var gc=gh.linked[ge];if(gc.doc==gf){continue}var gg=gd&&gc.sharedHist;if(f9&&!gg){continue}ga(gc.doc,gg);f8(gc.doc,gh,gg)}}}f8(gb,null,true)}function d7(f8,f9){if(f9.cm){throw new Error("This document is already in use.")}f8.doc=f9;f9.cm=f8;Y(f8);bq(f8);if(!f8.options.lineWrapping){g(f8)}f8.options.mode=f9.modeOption;ag(f8)}function fb(gb,gd){gd-=gb.first;if(gd<0||gd>=gb.size){throw new Error("There is no line "+(gd+gb.first)+" in the document.")}for(var f8=gb;!f8.lines;){for(var f9=0;;++f9){var gc=f8.children[f9],ga=gc.chunkSize();if(gd<ga){f8=gc;break}gd-=ga}}return f8.lines[gd]}function fV(ga,gc,f8){var f9=[],gb=gc.line;ga.iter(gc.line,f8.line+1,function(gd){var ge=gd.text;if(gb==f8.line){ge=ge.slice(0,f8.ch)}if(gb==gc.line){ge=ge.slice(gc.ch)}f9.push(ge);++gb});return f9}function aZ(f9,gb,ga){var f8=[];f9.iter(gb,ga,function(gc){f8.push(gc.text)});return f8}function fW(f9,f8){var ga=f8-f9.height;if(ga){for(var gb=f9;gb;gb=gb.parent){gb.height+=ga}}}function bM(f8){if(f8.parent==null){return null}var gc=f8.parent,gb=df(gc.lines,f8);for(var f9=gc.parent;f9;gc=f9,f9=f9.parent){for(var ga=0;;++ga){if(f9.children[ga]==gc){break}gb+=f9.children[ga].chunkSize()}}return gb+gc.first}function bF(ga,gd){var gf=ga.first;outer:do{for(var gb=0;gb<ga.children.length;++gb){var ge=ga.children[gb],gc=ge.height;if(gd<gc){ga=ge;continue outer}gd-=gc;gf+=ge.chunkSize()}return gf}while(!ga.lines);for(var gb=0;gb<ga.lines.length;++gb){var f9=ga.lines[gb],f8=f9.height;if(gd<f8){break}gd-=f8}return gf+gb}function bL(ga){ga=y(ga);var gc=0,f9=ga.parent;for(var gb=0;gb<f9.lines.length;++gb){var f8=f9.lines[gb];if(f8==ga){break}else{gc+=f8.height}}for(var gd=f9.parent;gd;f9=gd,gd=f9.parent){for(var gb=0;gb<gd.children.length;++gb){var ge=gd.children[gb];if(ge==f9){break}else{gc+=ge.height}}}return gc}function a(f9){var f8=f9.order;if(f8==null){f8=f9.order=be(f9.text)}return f8}function fP(f8){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=f8||1}function dr(f8,ga){var f9={from:ci(ga.from),to:cV(ga),text:fV(f8,ga.from,ga.to)};bX(f8,f9,ga.from.line,ga.to.line+1);d3(f8,function(gb){bX(gb,f9,ga.from.line,ga.to.line+1)},true);return f9}function fy(f9){while(f9.length){var f8=fE(f9);if(f8.ranges){f9.pop()}else{break}}}function eI(f9,f8){if(f8){fy(f9.done);return fE(f9.done)}else{if(f9.done.length&&!fE(f9.done).ranges){return fE(f9.done)}else{if(f9.done.length>1&&!f9.done[f9.done.length-2].ranges){f9.done.pop();return fE(f9.done)}}}}function fJ(ge,gc,f8,gb){var ga=ge.history;ga.undone.length=0;var f9=+new Date,gf;if((ga.lastOp==gb||ga.lastOrigin==gc.origin&&gc.origin&&((gc.origin.charAt(0)=="+"&&ge.cm&&ga.lastModTime>f9-ge.cm.options.historyEventDelay)||gc.origin.charAt(0)=="*"))&&(gf=eI(ga,ga.lastOp==gb))){var gg=fE(gf.changes);if(ce(gc.from,gc.to)==0&&ce(gc.from,gg.to)==0){gg.to=cV(gc)}else{gf.changes.push(dr(ge,gc))}}else{var gd=fE(ga.done);if(!gd||!gd.ranges){cL(ge.sel,ga.done)}gf={changes:[dr(ge,gc)],generation:ga.generation};ga.done.push(gf);while(ga.done.length>ga.undoDepth){ga.done.shift();if(!ga.done[0].ranges){ga.done.shift()}}}ga.done.push(f8);ga.generation=++ga.maxGeneration;ga.lastModTime=ga.lastSelTime=f9;ga.lastOp=ga.lastSelOp=gb;ga.lastOrigin=ga.lastSelOrigin=gc.origin;if(!gg){aC(ge,"historyAdded")}}function bz(gc,f8,ga,gb){var f9=f8.charAt(0);return f9=="*"||f9=="+"&&ga.ranges.length==gb.ranges.length&&ga.somethingSelected()==gb.somethingSelected()&&new Date-gc.history.lastSelTime<=(gc.cm?gc.cm.options.historyEventDelay:500)}function f2(gd,gb,f8,ga){var gc=gd.history,f9=ga&&ga.origin;if(f8==gc.lastSelOp||(f9&&gc.lastSelOrigin==f9&&(gc.lastModTime==gc.lastSelTime&&gc.lastOrigin==f9||bz(gd,f9,fE(gc.done),gb)))){gc.done[gc.done.length-1]=gb}else{cL(gb,gc.done)}gc.lastSelTime=+new Date;gc.lastSelOrigin=f9;gc.lastSelOp=f8;if(ga&&ga.clearRedo!==false){fy(gc.undone)}}function cL(f9,f8){var ga=fE(f8);if(!(ga&&ga.ranges&&ga.equals(f9))){f8.push(f9)}}function bX(f9,gd,gc,gb){var f8=gd["spans_"+f9.id],ga=0;f9.iter(Math.max(f9.first,gc),Math.min(f9.first+f9.size,gb),function(ge){if(ge.markedSpans){(f8||(f8=gd["spans_"+f9.id]={}))[ga]=ge.markedSpans}++ga})}function bi(ga){if(!ga){return null}for(var f9=0,f8;f9<ga.length;++f9){if(ga[f9].marker.explicitlyCleared){if(!f8){f8=ga.slice(0,f9)}}else{if(f8){f8.push(ga[f9])}}}return !f8?ga:f8.length?f8:null}function b3(gb,gc){var ga=gc["spans_"+gb.id];if(!ga){return null}for(var f9=0,f8=[];f9<gc.text.length;++f9){f8.push(bi(ga[f9]))}return f8}function bO(gj,gb,gi){for(var ge=0,f9=[];ge<gj.length;++ge){var ga=gj[ge];if(ga.ranges){f9.push(gi?fU.prototype.deepCopy.call(ga):ga);continue}var gg=ga.changes,gh=[];f9.push({changes:gh});for(var gd=0;gd<gg.length;++gd){var gf=gg[gd],gc;gh.push({from:gf.from,to:gf.to,text:gf.text});if(gb){for(var f8 in gf){if(gc=f8.match(/^spans_(\d+)$/)){if(df(gb,Number(gc[1]))>-1){fE(gh)[f8]=gf[f8];delete gf[f8]}}}}}}return f9}function J(gb,ga,f9,f8){if(f9<gb.line){gb.line+=f8}else{if(ga<gb.line){gb.line=ga;gb.ch=0}}}function fd(gb,gd,ge,gf){for(var ga=0;ga<gb.length;++ga){var f8=gb[ga],gc=true;if(f8.ranges){if(!f8.copied){f8=gb[ga]=f8.deepCopy();f8.copied=true}for(var f9=0;f9<f8.ranges.length;f9++){J(f8.ranges[f9].anchor,gd,ge,gf);J(f8.ranges[f9].head,gd,ge,gf)}continue}for(var f9=0;f9<f8.changes.length;++f9){var gg=f8.changes[f9];if(ge<gg.from.line){gg.from=X(gg.from.line+gf,gg.from.ch);gg.to=X(gg.to.line+gf,gg.to.ch)}else{if(gd<=gg.to.line){gc=false;break}}}if(!gc){gb.splice(0,ga+1);ga=0}}}function dA(f9,gc){var gb=gc.from.line,ga=gc.to.line,f8=gc.text.length-(ga-gb)-1;fd(f9.done,gb,ga,f8);fd(f9.undone,gb,ga,f8)}var cE=I.e_preventDefault=function(f8){if(f8.preventDefault){f8.preventDefault()}else{f8.returnValue=false}};var dm=I.e_stopPropagation=function(f8){if(f8.stopPropagation){f8.stopPropagation()}else{f8.cancelBubble=true}};function bK(f8){return f8.defaultPrevented!=null?f8.defaultPrevented:f8.returnValue==false}var en=I.e_stop=function(f8){cE(f8);dm(f8)};function M(f8){return f8.target||f8.srcElement}function fK(f9){var f8=f9.which;if(f8==null){if(f9.button&1){f8=1}else{if(f9.button&2){f8=3}else{if(f9.button&4){f8=2}}}}if(b6&&f9.ctrlKey&&f8==1){f8=3}return f8}var bW=I.on=function(gb,f9,ga){if(gb.addEventListener){gb.addEventListener(f9,ga,false)}else{if(gb.attachEvent){gb.attachEvent("on"+f9,ga)}else{var gc=gb._handlers||(gb._handlers={});var f8=gc[f9]||(gc[f9]=[]);f8.push(ga)}}};var d9=I.off=function(gc,ga,gb){if(gc.removeEventListener){gc.removeEventListener(ga,gb,false)}else{if(gc.detachEvent){gc.detachEvent("on"+ga,gb)}else{var f8=gc._handlers&&gc._handlers[ga];if(!f8){return}for(var f9=0;f9<f8.length;++f9){if(f8[f9]==gb){f8.splice(f9,1);break}}}}};var aC=I.signal=function(gc,gb){var f8=gc._handlers&&gc._handlers[gb];if(!f8){return}var f9=Array.prototype.slice.call(arguments,2);for(var ga=0;ga<f8.length;++ga){f8[ga].apply(null,f9)}};var by=null;function ad(ge,gc){var f8=ge._handlers&&ge._handlers[gc];if(!f8){return}var ga=Array.prototype.slice.call(arguments,2),gd;if(bo){gd=bo.delayedCallbacks}else{if(by){gd=by}else{gd=by=[];setTimeout(aJ,0)}}function f9(gf){return function(){gf.apply(null,ga)}}for(var gb=0;gb<f8.length;++gb){gd.push(f9(f8[gb]))}}function aJ(){var f8=by;by=null;for(var f9=0;f9<f8.length;++f9){f8[f9]()}}function aO(f8,ga,f9){if(typeof ga=="string"){ga={type:ga,preventDefault:function(){this.defaultPrevented=true}}}aC(f8,f9||ga.type,f8,ga);return bK(ga)||ga.codemirrorIgnore}function W(f9){var f8=f9._handlers&&f9._handlers.cursorActivity;if(!f8){return}var gb=f9.curOp.cursorActivityHandlers||(f9.curOp.cursorActivityHandlers=[]);for(var ga=0;ga<f8.length;++ga){if(df(gb,f8[ga])==-1){gb.push(f8[ga])}}}function fe(ga,f9){var f8=ga._handlers&&ga._handlers[f9];return f8&&f8.length>0}function bx(f8){f8.prototype.on=function(f9,ga){bW(this,f9,ga)};f8.prototype.off=function(f9,ga){d9(this,f9,ga)}}var dF=30;var b9=I.Pass={toString:function(){return"CodeMirror.Pass"}};var Z={scroll:false},N={origin:"*mouse"},cU={origin:"+move"};function f7(){this.id=null}f7.prototype.set=function(f8,f9){clearTimeout(this.id);this.id=setTimeout(f9,f8)};var bS=I.countColumn=function(gb,f9,gd,ge,ga){if(f9==null){f9=gb.search(/[^\s\u00a0]/);if(f9==-1){f9=gb.length}}for(var gc=ge||0,gf=ga||0;;){var f8=gb.indexOf("\t",gc);if(f8<0||f8>=f9){return gf+(f9-gc)}gf+=f8-gc;gf+=gd-(gf%gd);gc=f8+1}};function em(gc,gb,gd){for(var ge=0,ga=0;;){var f9=gc.indexOf("\t",ge);if(f9==-1){f9=gc.length}var f8=f9-ge;if(f9==gc.length||ga+f8>=gb){return ge+Math.min(f8,gb-ga)}ga+=f9-ge;ga+=gd-(ga%gd);ge=f9+1;if(ga>=gb){return ge}}}var aW=[""];function cp(f8){while(aW.length<=f8){aW.push(fE(aW)+" ")}return aW[f8]}function fE(f8){return f8[f8.length-1]}var dH=function(f8){f8.select()};if(eX){dH=function(f8){f8.selectionStart=0;f8.selectionEnd=f8.value.length}}else{if(dG){dH=function(f9){try{f9.select()}catch(f8){}}}}function df(ga,f8){for(var f9=0;f9<ga.length;++f9){if(ga[f9]==f8){return f9}}return -1}function bR(gb,ga){var f8=[];for(var f9=0;f9<gb.length;f9++){f8[f9]=ga(gb[f9],f9)}return f8}function ck(gb,f8){var ga;if(Object.create){ga=Object.create(gb)}else{var f9=function(){};f9.prototype=gb;ga=new f9()}if(f8){aK(f8,ga)}return ga}function aK(ga,f9,f8){if(!f9){f9={}}for(var gb in ga){if(ga.hasOwnProperty(gb)&&(f8!==false||!f9.hasOwnProperty(gb))){f9[gb]=ga[gb]}}return f9}function cv(f9){var f8=Array.prototype.slice.call(arguments,1);return function(){return f9.apply(null,f8)}}var a9=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;var fA=I.isWordChar=function(f8){return/\w/.test(f8)||f8>"\x80"&&(f8.toUpperCase()!=f8.toLowerCase()||a9.test(f8))};function cz(f8,f9){if(!f9){return fA(f8)}if(f9.source.indexOf("\\w")>-1&&fA(f8)){return true}return f9.test(f8)}function eQ(f8){for(var f9 in f8){if(f8.hasOwnProperty(f9)&&f8[f9]){return false}}return true}var eF=/[\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 fm(f8){return f8.charCodeAt(0)>=768&&eF.test(f8)}function fT(f8,gc,gb,ga){var gd=document.createElement(f8);if(gb){gd.className=gb}if(ga){gd.style.cssText=ga}if(typeof gc=="string"){gd.appendChild(document.createTextNode(gc))}else{if(gc){for(var f9=0;f9<gc.length;++f9){gd.appendChild(gc[f9])}}}return gd}var cl;if(document.createRange){cl=function(ga,gb,f8){var f9=document.createRange();f9.setEnd(ga,f8);f9.setStart(ga,gb);return f9}}else{cl=function(ga,gc,f8){var f9=document.body.createTextRange();try{f9.moveToElementText(ga.parentNode)}catch(gb){return f9}f9.collapse(true);f9.moveEnd("character",f8);f9.moveStart("character",gc);return f9}}function dX(f9){for(var f8=f9.childNodes.length;f8>0;--f8){f9.removeChild(f9.firstChild)}return f9}function bQ(f8,f9){return dX(f8).appendChild(f9)}function f1(f8,f9){if(f8.contains){return f8.contains(f9)}while(f9=f9.parentNode){if(f9==f8){return true}}}function dK(){return document.activeElement}if(dG&&k<11){dK=function(){try{return document.activeElement}catch(f8){return document.body}}}function T(f8){return new RegExp("(^|\\s)"+f8+"(?:$|\\s)\\s*")}var f=I.rmClass=function(ga,f8){var gb=ga.className;var f9=T(f8).exec(gb);if(f9){var gc=gb.slice(f9.index+f9[0].length);ga.className=gb.slice(0,f9.index)+(gc?f9[1]+gc:"")}};var fx=I.addClass=function(f9,f8){var ga=f9.className;if(!T(f8).test(ga)){f9.className+=(ga?" ":"")+f8}};function fO(ga,f8){var f9=ga.split(" ");for(var gb=0;gb<f9.length;gb++){if(f9[gb]&&!T(f9[gb]).test(f8)){f8+=" "+f9[gb]}}return f8}function ay(gb){if(!document.body.getElementsByClassName){return}var ga=document.body.getElementsByClassName("CodeMirror");for(var f9=0;f9<ga.length;f9++){var f8=ga[f9].CodeMirror;if(f8){gb(f8)}}}var cB=false;function bg(){if(cB){return}fB();cB=true}function fB(){var f8;bW(window,"resize",function(){if(f8==null){f8=setTimeout(function(){f8=null;ay(aQ)},100)}});bW(window,"blur",function(){ay(aS)})}var eH=function(){if(dG&&k<9){return false}var f8=fT("div");return"draggable" in f8||"dragDrop" in f8}();var fI;function bm(f8){if(fI==null){var f9=fT("span","\u200b");bQ(f8,fT("span",[f9,document.createTextNode("x")]));if(f8.firstChild.offsetHeight!=0){fI=f9.offsetWidth<=1&&f9.offsetHeight>2&&!(dG&&k<8)}}if(fI){return fT("span","\u200b")}else{return fT("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")}}var fH;function bN(gb){if(fH!=null){return fH}var f8=bQ(gb,document.createTextNode("A\u062eA"));var ga=cl(f8,0,1).getBoundingClientRect();if(!ga||ga.left==ga.right){return false}var f9=cl(f8,1,2).getBoundingClientRect();return fH=(f9.right-ga.right<3)}var aX=I.splitLines="\n\nb".split(/\n/).length!=3?function(gd){var ge=0,f8=[],gc=gd.length;while(ge<=gc){var gb=gd.indexOf("\n",ge);if(gb==-1){gb=gd.length}var ga=gd.slice(ge,gd.charAt(gb-1)=="\r"?gb-1:gb);var f9=ga.indexOf("\r");if(f9!=-1){f8.push(ga.slice(0,f9));ge+=f9+1}else{f8.push(ga);ge=gb+1}}return f8}:function(f8){return f8.split(/\r\n?|\n/)};var br=window.getSelection?function(f9){try{return f9.selectionStart!=f9.selectionEnd}catch(f8){return false}}:function(ga){try{var f8=ga.ownerDocument.selection.createRange()}catch(f9){}if(!f8||f8.parentElement()!=ga){return false}return f8.compareEndPoints("StartToEnd",f8)!=0};var c8=(function(){var f8=fT("div");if("oncopy" in f8){return true}f8.setAttribute("oncopy","return;");return typeof f8.oncopy=="function"})();var e2=null;function aI(f9){if(e2!=null){return e2}var ga=bQ(f9,fT("span","x"));var gb=ga.getBoundingClientRect();var f8=cl(ga,0,1).getBoundingClientRect();return e2=Math.abs(gb.left-f8.left)>1}var fc={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"};I.keyNames=fc;(function(){for(var f8=0;f8<10;f8++){fc[f8+48]=fc[f8+96]=String(f8)}for(var f8=65;f8<=90;f8++){fc[f8]=String.fromCharCode(f8)}for(var f8=1;f8<=12;f8++){fc[f8+111]=fc[f8+63235]="F"+f8}})();function d0(f8,ge,gd,gc){if(!f8){return gc(ge,gd,"ltr")}var gb=false;for(var ga=0;ga<f8.length;++ga){var f9=f8[ga];if(f9.from<gd&&f9.to>ge||ge==gd&&f9.to==ge){gc(Math.max(f9.from,ge),Math.min(f9.to,gd),f9.level==1?"rtl":"ltr");gb=true}}if(!gb){gc(ge,gd,"ltr")}}function du(f8){return f8.level%2?f8.to:f8.from}function f4(f8){return f8.level%2?f8.from:f8.to}function cD(f9){var f8=a(f9);return f8?du(f8[0]):0}function cQ(f9){var f8=a(f9);if(!f8){return f9.text.length}return f4(fE(f8))}function bs(f9,gc){var ga=fb(f9.doc,gc);var gd=y(ga);if(gd!=ga){gc=bM(gd)}var f8=a(gd);var gb=!f8?0:f8[0].level%2?cQ(gd):cD(gd);return X(gc,gb)}function dL(ga,gd){var f9,gb=fb(ga.doc,gd);while(f9=er(gb)){gb=f9.find(1,true).line;gd=null}var f8=a(gb);var gc=!f8?gb.text.length:f8[0].level%2?cD(gb):cQ(gb);return X(gd==null?bM(gb):gd,gc)}function dE(f9,ge){var gd=bs(f9,ge.line);var ga=fb(f9.doc,gd.line);var f8=a(ga);if(!f8||f8[0].level==0){var gc=Math.max(0,ga.text.search(/\S/));var gb=ge.line==gd.line&&ge.ch<=gc&&ge.ch;return X(gd.line,gb?0:gc)}return gd}function am(f9,ga,f8){var gb=f9[0].level;if(ga==gb){return true}if(f8==gb){return false}return ga<f8}var eY;function aE(f8,gc){eY=null;for(var f9=0,ga;f9<f8.length;++f9){var gb=f8[f9];if(gb.from<gc&&gb.to>gc){return f9}if((gb.from==gc||gb.to==gc)){if(ga==null){ga=f9}else{if(am(f8,gb.level,f8[ga].level)){if(gb.from!=gb.to){eY=ga}return f9}else{if(gb.from!=gb.to){eY=f9}return ga}}}}return ga}function fa(f8,gb,f9,ga){if(!ga){return gb+f9}do{gb+=f9}while(gb>0&&fm(f8.text.charAt(gb)));return gb}function u(f8,gf,ga,gb){var gc=a(f8);if(!gc){return ah(f8,gf,ga,gb)}var ge=aE(gc,gf),f9=gc[ge];var gd=fa(f8,gf,f9.level%2?-ga:ga,gb);for(;;){if(gd>f9.from&&gd<f9.to){return gd}if(gd==f9.from||gd==f9.to){if(aE(gc,gd)==ge){return gd}f9=gc[ge+=ga];return(ga>0)==f9.level%2?f9.to:f9.from}else{f9=gc[ge+=ga];if(!f9){return null}if((ga>0)==f9.level%2){gd=fa(f8,f9.to,-1,gb)}else{gd=fa(f8,f9.from,1,gb)}}}}function ah(f8,gc,f9,ga){var gb=gc+f9;if(ga){while(gb>0&&fm(f8.text.charAt(gb))){gb+=f9}}return gb<0||gb>f8.text.length?null:gb}var be=(function(){var ge="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var gc="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm";function gb(gi){if(gi<=247){return ge.charAt(gi)}else{if(1424<=gi&&gi<=1524){return"R"}else{if(1536<=gi&&gi<=1773){return gc.charAt(gi-1536)}else{if(1774<=gi&&gi<=2220){return"r"}else{if(8192<=gi&&gi<=8203){return"w"}else{if(gi==8204){return"b"}else{return"L"}}}}}}}var f8=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var gh=/[stwN]/,ga=/[LRr]/,f9=/[Lb1n]/,gd=/[1n]/;var gg="L";function gf(gk,gj,gi){this.level=gk;this.from=gj;this.to=gi}return function(gs){if(!f8.test(gs)){return false}var gy=gs.length,go=[];for(var gx=0,gk;gx<gy;++gx){go.push(gk=gb(gs.charCodeAt(gx)))}for(var gx=0,gr=gg;gx<gy;++gx){var gk=go[gx];if(gk=="m"){go[gx]=gr}else{gr=gk}}for(var gx=0,gi=gg;gx<gy;++gx){var gk=go[gx];if(gk=="1"&&gi=="r"){go[gx]="n"}else{if(ga.test(gk)){gi=gk;if(gk=="r"){go[gx]="R"}}}}for(var gx=1,gr=go[0];gx<gy-1;++gx){var gk=go[gx];if(gk=="+"&&gr=="1"&&go[gx+1]=="1"){go[gx]="1"}else{if(gk==","&&gr==go[gx+1]&&(gr=="1"||gr=="n")){go[gx]=gr}}gr=gk}for(var gx=0;gx<gy;++gx){var gk=go[gx];if(gk==","){go[gx]="N"}else{if(gk=="%"){for(var gl=gx+1;gl<gy&&go[gl]=="%";++gl){}var gz=(gx&&go[gx-1]=="!")||(gl<gy&&go[gl]=="1")?"1":"N";for(var gv=gx;gv<gl;++gv){go[gv]=gz}gx=gl-1}}}for(var gx=0,gi=gg;gx<gy;++gx){var gk=go[gx];if(gi=="L"&&gk=="1"){go[gx]="L"}else{if(ga.test(gk)){gi=gk}}}for(var gx=0;gx<gy;++gx){if(gh.test(go[gx])){for(var gl=gx+1;gl<gy&&gh.test(go[gl]);++gl){}var gp=(gx?go[gx-1]:gg)=="L";var gj=(gl<gy?go[gl]:gg)=="L";var gz=gp||gj?"L":"R";for(var gv=gx;gv<gl;++gv){go[gv]=gz}gx=gl-1}}var gw=[],gt;for(var gx=0;gx<gy;){if(f9.test(go[gx])){var gm=gx;for(++gx;gx<gy&&f9.test(go[gx]);++gx){}gw.push(new gf(0,gm,gx))}else{var gn=gx,gq=gw.length;for(++gx;gx<gy&&go[gx]!="L";++gx){}for(var gv=gn;gv<gx;){if(gd.test(go[gv])){if(gn<gv){gw.splice(gq,0,new gf(1,gn,gv))}var gu=gv;for(++gv;gv<gx&&gd.test(go[gv]);++gv){}gw.splice(gq,0,new gf(2,gu,gv));gn=gv}else{++gv}}if(gn<gx){gw.splice(gq,0,new gf(1,gn,gx))}}}if(gw[0].level==1&&(gt=gs.match(/^\s+/))){gw[0].from=gt[0].length;gw.unshift(new gf(0,0,gt[0].length))}if(fE(gw).level==1&&(gt=gs.match(/\s+$/))){fE(gw).to-=gt[0].length;gw.push(new gf(0,gy-gt[0].length,gy))}if(gw[0].level!=fE(gw).level){gw.push(new gf(gw[0].level,gy,gy))}return gw}})();I.version="4.12.0";return I});
|