1234567891011121314151617181920212223 |
- /* CodeMirror - Minified & Bundled
- Generated on 7/30/2015 with http://codemirror.net/doc/compress.html
- Version: 5.5
- CodeMirror Library:
- - codemirror.js
- Modes:
- - css.js
- - gfm.js
- - htmlmixed.js
- - javascript.js
- - markdown.js
- - php.js
- - sass.js
- - twig.js
- - xml.js
- - yaml.js
- Add-ons:
- - continuelist.js
- - overlay.js
- */
- (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 eK=/MSIE \d/.test(navigator.userAgent);var bJ=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);var dK=eK||bJ;var k=dK&&(eK?document.documentMode||6:bJ[1]);var c0=/WebKit\//.test(navigator.userAgent);var dN=c0&&/Qt\/\d+\.\d+/.test(navigator.userAgent);var dc=/Chrome\//.test(navigator.userAgent);var d3=/Opera\//.test(navigator.userAgent);var aC=/Apple Computer/.test(navigator.vendor);var c7=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);var fu=/PhantomJS/.test(navigator.userAgent);var e1=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent);var eg=e1||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);var b7=e1||/Mac/.test(navigator.platform);var aP=/win/i.test(navigator.platform);var aZ=d3&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);if(aZ){aZ=Number(aZ[1])}if(aZ&&aZ>=15){d3=false;c0=true}var bQ=b7&&(dN||d3&&(aZ==null||aZ<12.11));var ga=co||(dK&&k>=9);var gd=false,a7=false;function H(gj,gl){if(!(this instanceof H)){return new H(gj,gl)}this.options=gl=gl?aN(gl):{};aN(e3,gl,false);ce(gl);var gp=gl.value;if(typeof gp=="string"){gp=new at(gp,gl.mode,null,gl.lineSeparator)}this.doc=gp;var gk=new H.inputStyles[gl.inputStyle](this);var go=this.display=new eI(gj,gp,gk);go.wrapper.CodeMirror=this;ec(this);cO(this);if(gl.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}if(gl.autofocus&&!eg){go.input.focus()}aD(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,delayingBlurEvent:false,focused:false,suppressEdits:false,pasteIncoming:false,cutIncoming:false,draggingText:false,highlight:new gh(),keySeq:null,specialChars:null};var gi=this;if(dK&&k<11){setTimeout(function(){gi.display.input.reset(true)},20)}fQ(this);bj();cI(this);this.curOp.forceUpdate=true;eb(this,gp);if((gl.autofocus&&!eg)||gi.hasFocus()){setTimeout(cv(cB,this),20)}else{aV(this)}for(var gn in bf){if(bf.hasOwnProperty(gn)){bf[gn](this,gl[gn],cc)}}d5(this);if(gl.finishInit){gl.finishInit(this)}for(var gm=0;gm<a8.length;++gm){a8[gm](this)}am(this);if(c0&&gl.lineWrapping&&getComputedStyle(go.lineDiv).textRendering=="optimizelegibility"){go.lineDiv.style.textRendering="auto"}}function eI(gi,gk,gj){var gl=this;this.input=gj;gl.scrollbarFiller=f3("div",null,"CodeMirror-scrollbar-filler");gl.scrollbarFiller.setAttribute("cm-not-content","true");gl.gutterFiller=f3("div",null,"CodeMirror-gutter-filler");gl.gutterFiller.setAttribute("cm-not-content","true");gl.lineDiv=f3("div",null,"CodeMirror-code");gl.selectionDiv=f3("div",null,null,"position: relative; z-index: 1");gl.cursorDiv=f3("div",null,"CodeMirror-cursors");gl.measure=f3("div",null,"CodeMirror-measure");gl.lineMeasure=f3("div",null,"CodeMirror-measure");gl.lineSpace=f3("div",[gl.measure,gl.lineMeasure,gl.selectionDiv,gl.cursorDiv,gl.lineDiv],null,"position: relative; outline: none");gl.mover=f3("div",[f3("div",[gl.lineSpace],"CodeMirror-lines")],null,"position: relative");gl.sizer=f3("div",[gl.mover],"CodeMirror-sizer");gl.sizerWidth=null;gl.heightForcer=f3("div",null,null,"position: absolute; height: "+dJ+"px; width: 1px;");gl.gutters=f3("div",null,"CodeMirror-gutters");gl.lineGutter=null;gl.scroller=f3("div",[gl.sizer,gl.heightForcer,gl.gutters],"CodeMirror-scroll");gl.scroller.setAttribute("tabIndex","-1");gl.wrapper=f3("div",[gl.scrollbarFiller,gl.gutterFiller,gl.scroller],"CodeMirror");if(dK&&k<8){gl.gutters.style.zIndex=-1;gl.scroller.style.paddingRight=0}if(!c0&&!(co&&eg)){gl.scroller.draggable=true}if(gi){if(gi.appendChild){gi.appendChild(gl.wrapper)}else{gi(gl.wrapper)}}gl.viewFrom=gl.viewTo=gk.first;gl.reportedViewFrom=gl.reportedViewTo=gk.first;gl.view=[];gl.renderedView=null;gl.externalMeasured=null;gl.viewOffset=0;gl.lastWrapHeight=gl.lastWrapWidth=0;gl.updateLineNumbers=null;gl.nativeBarWidth=gl.barHeight=gl.barWidth=0;gl.scrollbarsClipped=false;gl.lineNumWidth=gl.lineNumInnerWidth=gl.lineNumChars=null;gl.alignWidgets=false;gl.cachedCharWidth=gl.cachedTextHeight=gl.cachedPaddingH=null;gl.maxLine=null;gl.maxLineLength=0;gl.maxLineChanged=false;gl.wheelDX=gl.wheelDY=gl.wheelStartX=gl.wheelStartY=null;gl.shift=false;gl.selForContextMenu=null;gl.activeTouch=null;gj.init(gl)}function br(gi){gi.doc.mode=H.getMode(gi.options,gi.doc.modeOption);el(gi)}function el(gi){gi.doc.iter(function(gj){if(gj.stateAfter){gj.stateAfter=null}if(gj.styles){gj.styles=null}});gi.doc.frontier=gi.doc.first;ef(gi,100);gi.state.modeGen++;if(gi.curOp){ah(gi)}}function eG(gi){if(gi.options.lineWrapping){fA(gi.display.wrapper,"CodeMirror-wrap");gi.display.sizer.style.minWidth="";gi.display.sizerWidth=null}else{f(gi.display.wrapper,"CodeMirror-wrap");h(gi)}X(gi);ah(gi);ak(gi);setTimeout(function(){eY(gi)},100)}function be(gi){var gk=aY(gi.display),gj=gi.options.lineWrapping;var gl=gj&&Math.max(5,gi.display.scroller.clientWidth/dD(gi.display)-3);return function(gn){if(fw(gi.doc,gn)){return 0}var gm=0;if(gn.widgets){for(var go=0;go<gn.widgets.length;go++){if(gn.widgets[go].height){gm+=gn.widgets[go].height}}}if(gj){return gm+(Math.ceil(gn.text.length/gl)||1)*gk}else{return gm+gk}}}function X(gi){var gk=gi.doc,gj=be(gi);gk.iter(function(gl){var gm=gj(gl);if(gm!=gl.height){f6(gl,gm)}})}function cO(gi){gi.display.wrapper.className=gi.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+gi.options.theme.replace(/(^|\s)\s*/g," cm-s-");ak(gi)}function dw(gi){ec(gi);ah(gi);setTimeout(function(){eE(gi)},20)}function ec(gi){var gj=gi.display.gutters,gn=gi.options.gutters;d1(gj);for(var gk=0;gk<gn.length;++gk){var gl=gn[gk];var gm=gj.appendChild(f3("div",null,"CodeMirror-gutter "+gl));if(gl=="CodeMirror-linenumbers"){gi.display.lineGutter=gm;gm.style.width=(gi.display.lineNumWidth||1)+"px"}}gj.style.display=gk?"":"none";c4(gi)}function c4(gi){var gj=gi.display.gutters.offsetWidth;gi.display.sizer.style.marginLeft=gj+"px"}function en(gk){if(gk.height==0){return 0}var gj=gk.text.length,gi,gm=gk;while(gi=eO(gm)){var gl=gi.find(0,true);gm=gl.from.line;gj+=gl.from.ch-gl.to.ch}gm=gk;while(gi=ew(gm)){var gl=gi.find(0,true);gj-=gm.text.length-gl.from.ch;gm=gl.to.line;gj+=gm.text.length-gl.to.ch}return gj}function h(gi){var gk=gi.display,gj=gi.doc;gk.maxLine=ff(gj,gj.first);gk.maxLineLength=en(gk.maxLine);gk.maxLineChanged=true;gj.iter(function(gm){var gl=en(gm);if(gl>gk.maxLineLength){gk.maxLineLength=gl;gk.maxLine=gm}})}function ce(gi){var gj=dh(gi.gutters,"CodeMirror-linenumbers");if(gj==-1&&gi.lineNumbers){gi.gutters=gi.gutters.concat(["CodeMirror-linenumbers"])}else{if(gj>-1&&!gi.lineNumbers){gi.gutters=gi.gutters.slice(0);gi.gutters.splice(gj,1)}}}function dA(gi){var gl=gi.display,gk=gl.gutters.offsetWidth;var gj=Math.round(gi.doc.height+bI(gi.display));return{clientHeight:gl.scroller.clientHeight,viewHeight:gl.wrapper.clientHeight,scrollWidth:gl.scroller.scrollWidth,clientWidth:gl.scroller.clientWidth,viewWidth:gl.wrapper.clientWidth,barLeft:gi.options.fixedGutter?gk:0,docHeight:gj,scrollHeight:gj+cT(gi)+gl.barHeight,nativeBarWidth:gl.nativeBarWidth,gutterWidth:gk}}function dk(gk,gj,gi){this.cm=gi;var gl=this.vert=f3("div",[f3("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var gm=this.horiz=f3("div",[f3("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");gk(gl);gk(gm);bX(gl,"scroll",function(){if(gl.clientHeight){gj(gl.scrollTop,"vertical")}});bX(gm,"scroll",function(){if(gm.clientWidth){gj(gm.scrollLeft,"horizontal")}});this.checkedOverlay=false;if(dK&&k<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}}dk.prototype=aN({update:function(gl){var gm=gl.scrollWidth>gl.clientWidth+1;var gk=gl.scrollHeight>gl.clientHeight+1;var gn=gl.nativeBarWidth;if(gk){this.vert.style.display="block";this.vert.style.bottom=gm?gn+"px":"0";var gj=gl.viewHeight-(gm?gn:0);this.vert.firstChild.style.height=Math.max(0,gl.scrollHeight-gl.clientHeight+gj)+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(gm){this.horiz.style.display="block";this.horiz.style.right=gk?gn+"px":"0";this.horiz.style.left=gl.barLeft+"px";var gi=gl.viewWidth-gl.barLeft-(gk?gn:0);this.horiz.firstChild.style.width=(gl.scrollWidth-gl.clientWidth+gi)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedOverlay&&gl.clientHeight>0){if(gn==0){this.overlayHack()}this.checkedOverlay=true}return{right:gk?gn:0,bottom:gm?gn:0}},setScrollLeft:function(gi){if(this.horiz.scrollLeft!=gi){this.horiz.scrollLeft=gi}},setScrollTop:function(gi){if(this.vert.scrollTop!=gi){this.vert.scrollTop=gi}},overlayHack:function(){var gi=b7&&!c7?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=gi;var gj=this;var gk=function(gl){if(L(gl)!=gj.vert&&L(gl)!=gj.horiz){c2(gj.cm,eu)(gl)}};bX(this.vert,"mousedown",gk);bX(this.horiz,"mousedown",gk)},clear:function(){var gi=this.horiz.parentNode;gi.removeChild(this.horiz);gi.removeChild(this.vert)}},dk.prototype);function e4(){}e4.prototype=aN({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},e4.prototype);H.scrollbarModel={"native":dk,"null":e4};function aD(gi){if(gi.display.scrollbars){gi.display.scrollbars.clear();if(gi.display.scrollbars.addClass){f(gi.display.wrapper,gi.display.scrollbars.addClass)}}gi.display.scrollbars=new H.scrollbarModel[gi.options.scrollbarStyle](function(gj){gi.display.wrapper.insertBefore(gj,gi.display.scrollbarFiller);bX(gj,"mousedown",function(){if(gi.state.focused){setTimeout(function(){gi.display.input.focus()},0)}});gj.setAttribute("cm-not-content","true")},function(gk,gj){if(gj=="horizontal"){bE(gi,gk)}else{N(gi,gk)}},gi);if(gi.display.scrollbars.addClass){fA(gi.display.wrapper,gi.display.scrollbars.addClass)}}function eY(gk,gm){if(!gm){gm=dA(gk)}var gj=gk.display.barWidth,gi=gk.display.barHeight;aU(gk,gm);for(var gl=0;gl<4&&gj!=gk.display.barWidth||gi!=gk.display.barHeight;gl++){if(gj!=gk.display.barWidth&&gk.options.lineWrapping){a9(gk)}aU(gk,dA(gk));gj=gk.display.barWidth;gi=gk.display.barHeight}}function aU(gi,gj){var gl=gi.display;var gk=gl.scrollbars.update(gj);gl.sizer.style.paddingRight=(gl.barWidth=gk.right)+"px";gl.sizer.style.paddingBottom=(gl.barHeight=gk.bottom)+"px";if(gk.right&&gk.bottom){gl.scrollbarFiller.style.display="block";gl.scrollbarFiller.style.height=gk.bottom+"px";gl.scrollbarFiller.style.width=gk.right+"px"}else{gl.scrollbarFiller.style.display=""}if(gk.bottom&&gi.options.coverGutterNextToScrollbar&&gi.options.fixedGutter){gl.gutterFiller.style.display="block";gl.gutterFiller.style.height=gk.bottom+"px";gl.gutterFiller.style.width=gj.gutterWidth+"px"}else{gl.gutterFiller.style.display=""}}function b6(gl,gp,gk){var gm=gk&&gk.top!=null?Math.max(0,gk.top):gl.scroller.scrollTop;gm=Math.floor(gm-e8(gl));var gi=gk&&gk.bottom!=null?gk.bottom:gm+gl.wrapper.clientHeight;var gn=bG(gp,gm),go=bG(gp,gi);if(gk&&gk.ensure){var gj=gk.ensure.from.line,gq=gk.ensure.to.line;if(gj<gn){gn=gj;go=bG(gp,bM(ff(gp,gj))+gl.wrapper.clientHeight)}else{if(Math.min(gq,gp.lastLine())>=go){gn=bG(gp,bM(ff(gp,gq))-gl.wrapper.clientHeight);go=gq}}}return{from:gn,to:Math.max(go,gn+1)}}function eE(gq){var go=gq.display,gp=go.view;if(!go.alignWidgets&&(!go.gutters.firstChild||!gq.options.fixedGutter)){return}var gm=dX(go)-go.scroller.scrollLeft+gq.doc.scrollLeft;var gi=go.gutters.offsetWidth,gj=gm+"px";for(var gl=0;gl<gp.length;gl++){if(!gp[gl].hidden){if(gq.options.fixedGutter&&gp[gl].gutter){gp[gl].gutter.style.left=gj}var gn=gp[gl].alignable;if(gn){for(var gk=0;gk<gn.length;gk++){gn[gk].style.left=gj}}}}if(gq.options.fixedGutter){go.gutters.style.left=(gm+gi)+"px"}}function d5(gi){if(!gi.options.lineNumbers){return false}var gn=gi.doc,gj=es(gi.options,gn.first+gn.size-1),gm=gi.display;if(gj.length!=gm.lineNumChars){var go=gm.measure.appendChild(f3("div",[f3("div",gj)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var gk=go.firstChild.offsetWidth,gl=go.offsetWidth-gk;gm.lineGutter.style.width="";gm.lineNumInnerWidth=Math.max(gk,gm.lineGutter.offsetWidth-gl)+1;gm.lineNumWidth=gm.lineNumInnerWidth+gl;gm.lineNumChars=gm.lineNumInnerWidth?gj.length:-1;gm.lineGutter.style.width=gm.lineNumWidth+"px";c4(gi);return true}return false}function es(gi,gj){return String(gi.lineNumberFormatter(gj+gi.firstLineNumber))}function dX(gi){return gi.scroller.getBoundingClientRect().left-gi.sizer.getBoundingClientRect().left}function aI(gj,gi,gk){var gl=gj.display;this.viewport=gi;this.visible=b6(gl,gj.doc,gi);this.editorIsHidden=!gl.wrapper.offsetWidth;this.wrapperHeight=gl.wrapper.clientHeight;this.wrapperWidth=gl.wrapper.clientWidth;this.oldDisplayWidth=dl(gj);this.force=gk;this.dims=fd(gj);this.events=[]}aI.prototype.signal=function(gj,gi){if(fi(gj,gi)){this.events.push(arguments)}};aI.prototype.finish=function(){for(var gi=0;gi<this.events.length;gi++){aE.apply(null,this.events[gi])}};function J(gi){var gj=gi.display;if(!gj.scrollbarsClipped&&gj.scroller.offsetWidth){gj.nativeBarWidth=gj.scroller.offsetWidth-gj.scroller.clientWidth;gj.heightForcer.style.height=cT(gi)+"px";gj.sizer.style.marginBottom=-gj.nativeBarWidth+"px";gj.sizer.style.borderRightWidth=cT(gi)+"px";gj.scrollbarsClipped=true}}function B(gr,gl){var gm=gr.display,gq=gr.doc;if(gl.editorIsHidden){ex(gr);return false}if(!gl.force&&gl.visible.from>=gm.viewFrom&&gl.visible.to<=gm.viewTo&&(gm.updateLineNumbers==null||gm.updateLineNumbers>=gm.viewTo)&&gm.renderedView==gm.view&&db(gr)==0){return false}if(d5(gr)){ex(gr);gl.dims=fd(gr)}var gk=gq.first+gq.size;var go=Math.max(gl.visible.from-gr.options.viewportMargin,gq.first);var gp=Math.min(gk,gl.visible.to+gr.options.viewportMargin);if(gm.viewFrom<go&&go-gm.viewFrom<20){go=Math.max(gq.first,gm.viewFrom)}if(gm.viewTo>gp&&gm.viewTo-gp<20){gp=Math.min(gk,gm.viewTo)}if(a7){go=aW(gr.doc,go);gp=d2(gr.doc,gp)}var gj=go!=gm.viewFrom||gp!=gm.viewTo||gm.lastWrapHeight!=gl.wrapperHeight||gm.lastWrapWidth!=gl.wrapperWidth;cR(gr,go,gp);gm.viewOffset=bM(ff(gr.doc,gm.viewFrom));gr.display.mover.style.top=gm.viewOffset+"px";var gi=db(gr);if(!gj&&gi==0&&!gl.force&&gm.renderedView==gm.view&&(gm.updateLineNumbers==null||gm.updateLineNumbers>=gm.viewTo)){return false}var gn=dO();if(gi>4){gm.lineDiv.style.display="none"}cm(gr,gm.updateLineNumbers,gl.dims);if(gi>4){gm.lineDiv.style.display=""}gm.renderedView=gm.view;if(gn&&dO()!=gn&&gn.offsetHeight){gn.focus()}d1(gm.cursorDiv);d1(gm.selectionDiv);gm.gutters.style.height=gm.sizer.style.minHeight=0;if(gj){gm.lastWrapHeight=gl.wrapperHeight;gm.lastWrapWidth=gl.wrapperWidth;ef(gr,400)}gm.updateLineNumbers=null;return true}function cj(gj,gm){var gi=gm.viewport;for(var gl=true;;gl=false){if(!gl||!gj.options.lineWrapping||gm.oldDisplayWidth==dl(gj)){if(gi&&gi.top!=null){gi={top:Math.min(gj.doc.height+bI(gj.display)-cV(gj),gi.top)}}gm.visible=b6(gj.display,gj.doc,gi);if(gm.visible.from>=gj.display.viewFrom&&gm.visible.to<=gj.display.viewTo){break}}if(!B(gj,gm)){break}a9(gj);var gk=dA(gj);bC(gj);dz(gj,gk);eY(gj,gk)}gm.signal(gj,"update",gj);if(gj.display.viewFrom!=gj.display.reportedViewFrom||gj.display.viewTo!=gj.display.reportedViewTo){gm.signal(gj,"viewportChange",gj,gj.display.viewFrom,gj.display.viewTo);gj.display.reportedViewFrom=gj.display.viewFrom;gj.display.reportedViewTo=gj.display.viewTo}}function dT(gj,gi){var gl=new aI(gj,gi);if(B(gj,gl)){a9(gj);cj(gj,gl);var gk=dA(gj);bC(gj);dz(gj,gk);eY(gj,gk);gl.finish()}}function dz(gi,gj){gi.display.sizer.style.minHeight=gj.docHeight+"px";var gk=gj.docHeight+gi.display.barHeight;gi.display.heightForcer.style.top=gk+"px";gi.display.gutters.style.height=Math.max(gk+cT(gi),gj.clientHeight)+"px"}function a9(gp){var gn=gp.display;var gj=gn.lineDiv.offsetTop;for(var gk=0;gk<gn.view.length;gk++){var gq=gn.view[gk],gr;if(gq.hidden){continue}if(dK&&k<8){var gm=gq.node.offsetTop+gq.node.offsetHeight;gr=gm-gj;gj=gm}else{var gl=gq.node.getBoundingClientRect();gr=gl.bottom-gl.top}var go=gq.line.height-gr;if(gr<2){gr=aY(gn)}if(go>0.001||go<-0.001){f6(gq.line,gr);cb(gq.line);if(gq.rest){for(var gi=0;gi<gq.rest.length;gi++){cb(gq.rest[gi])}}}}}function cb(gi){if(gi.widgets){for(var gj=0;gj<gi.widgets.length;++gj){gi.widgets[gj].height=gi.widgets[gj].node.offsetHeight}}}function fd(gi){var gn=gi.display,gl={},gk={};var gm=gn.gutters.clientLeft;for(var go=gn.gutters.firstChild,gj=0;go;go=go.nextSibling,++gj){gl[gi.options.gutters[gj]]=go.offsetLeft+go.clientLeft+gm;gk[gi.options.gutters[gj]]=go.clientWidth}return{fixedPos:dX(gn),gutterTotalWidth:gn.gutters.offsetWidth,gutterLeft:gl,gutterWidth:gk,wrapperWidth:gn.wrapper.clientWidth}}function cm(gt,gk,gs){var gp=gt.display,gv=gt.options.lineNumbers;var gi=gp.lineDiv,gu=gi.firstChild;function go(gx){var gw=gx.nextSibling;if(c0&&b7&>.display.currentWheelTarget==gx){gx.style.display="none"}else{gx.parentNode.removeChild(gx)}return gw}var gq=gp.view,gn=gp.viewFrom;for(var gl=0;gl<gq.length;gl++){var gm=gq[gl];if(gm.hidden){}else{if(!gm.node||gm.node.parentNode!=gi){var gj=aF(gt,gm,gn,gs);gi.insertBefore(gj,gu)}else{while(gu!=gm.node){gu=go(gu)}var gr=gv&&gk!=null&&gk<=gn&&gm.lineNumber;if(gm.changes){if(dh(gm.changes,"gutter")>-1){gr=false}ab(gt,gm,gn,gs)}if(gr){d1(gm.lineNumber);gm.lineNumber.appendChild(document.createTextNode(es(gt.options,gn)))}gu=gm.node.nextSibling}}gn+=gm.size}while(gu){gu=go(gu)}}function ab(gi,gk,gm,gn){for(var gj=0;gj<gk.changes.length;gj++){var gl=gk.changes[gj];if(gl=="text"){fl(gi,gk)}else{if(gl=="gutter"){df(gi,gk,gm,gn)}else{if(gl=="class"){dG(gk)}else{if(gl=="widget"){ao(gi,gk,gn)}}}}}gk.changes=null}function fH(gi){if(gi.node==gi.text){gi.node=f3("div",null,null,"position: relative");if(gi.text.parentNode){gi.text.parentNode.replaceChild(gi.node,gi.text)}gi.node.appendChild(gi.text);if(dK&&k<8){gi.node.style.zIndex=2}}return gi.node}function ev(gj){var gi=gj.bgClass?gj.bgClass+" "+(gj.line.bgClass||""):gj.line.bgClass;if(gi){gi+=" CodeMirror-linebackground"}if(gj.background){if(gi){gj.background.className=gi}else{gj.background.parentNode.removeChild(gj.background);gj.background=null}}else{if(gi){var gk=fH(gj);gj.background=gk.insertBefore(f3("div",null,gi),gk.firstChild)}}}function dV(gi,gj){var gk=gi.display.externalMeasured;if(gk&&gk.line==gj.line){gi.display.externalMeasured=null;gj.measure=gk.measure;return gk.built}return eR(gi,gj)}function fl(gi,gl){var gj=gl.text.className;var gk=dV(gi,gl);if(gl.text==gl.node){gl.node=gk.pre}gl.text.parentNode.replaceChild(gk.pre,gl.text);gl.text=gk.pre;if(gk.bgClass!=gl.bgClass||gk.textClass!=gl.textClass){gl.bgClass=gk.bgClass;gl.textClass=gk.textClass;dG(gl)}else{if(gj){gl.text.className=gj}}}function dG(gj){ev(gj);if(gj.line.wrapClass){fH(gj).className=gj.line.wrapClass}else{if(gj.node!=gj.text){gj.node.className=""}}var gi=gj.textClass?gj.textClass+" "+(gj.line.textClass||""):gj.line.textClass;gj.text.className=gi||""}function df(gq,go,gn,gp){if(go.gutter){go.node.removeChild(go.gutter);go.gutter=null}if(go.gutterBackground){go.node.removeChild(go.gutterBackground);go.gutterBackground=null}if(go.line.gutterClass){var gj=fH(go);go.gutterBackground=f3("div",null,"CodeMirror-gutter-background "+go.line.gutterClass,"left: "+(gq.options.fixedGutter?gp.fixedPos:-gp.gutterTotalWidth)+"px; width: "+gp.gutterTotalWidth+"px");gj.insertBefore(go.gutterBackground,go.text)}var gl=go.line.gutterMarkers;if(gq.options.lineNumbers||gl){var gj=fH(go);var gm=go.gutter=f3("div",null,"CodeMirror-gutter-wrapper","left: "+(gq.options.fixedGutter?gp.fixedPos:-gp.gutterTotalWidth)+"px");gq.display.input.setUneditable(gm);gj.insertBefore(gm,go.text);if(go.line.gutterClass){gm.className+=" "+go.line.gutterClass}if(gq.options.lineNumbers&&(!gl||!gl["CodeMirror-linenumbers"])){go.lineNumber=gm.appendChild(f3("div",es(gq.options,gn),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+gp.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+gq.display.lineNumInnerWidth+"px"))}if(gl){for(var gk=0;gk<gq.options.gutters.length;++gk){var gi=gq.options.gutters[gk],gr=gl.hasOwnProperty(gi)&&gl[gi];if(gr){gm.appendChild(f3("div",[gr],"CodeMirror-gutter-elt","left: "+gp.gutterLeft[gi]+"px; width: "+gp.gutterWidth[gi]+"px"))}}}}}function ao(gi,gj,gm){if(gj.alignable){gj.alignable=null}for(var gl=gj.node.firstChild,gk;gl;gl=gk){var gk=gl.nextSibling;if(gl.className=="CodeMirror-linewidget"){gj.node.removeChild(gl)}}ft(gi,gj,gm)}function aF(gi,gk,gl,gm){var gj=dV(gi,gk);gk.text=gk.node=gj.pre;if(gj.bgClass){gk.bgClass=gj.bgClass}if(gj.textClass){gk.textClass=gj.textClass}dG(gk);df(gi,gk,gl,gm);ft(gi,gk,gm);return gk.node}function ft(gi,gk,gl){f8(gi,gk.line,gk,gl,true);if(gk.rest){for(var gj=0;gj<gk.rest.length;gj++){f8(gi,gk.rest[gj],gk,gl,false)}}}function f8(gq,gr,gn,gp,gl){if(!gr.widgets){return}var gi=fH(gn);for(var gk=0,go=gr.widgets;gk<go.length;++gk){var gm=go[gk],gj=f3("div",[gm.node],"CodeMirror-linewidget");if(!gm.handleMouseEvents){gj.setAttribute("cm-ignore-events","true")}bF(gm,gj,gn,gp);gq.display.input.setUneditable(gj);if(gl&&gm.above){gi.insertBefore(gj,gn.gutter||gn.text)}else{gi.appendChild(gj)}ae(gm,"redraw")}}function bF(gl,gk,gi,gm){if(gl.noHScroll){(gi.alignable||(gi.alignable=[])).push(gk);var gj=gm.wrapperWidth;gk.style.left=gm.fixedPos+"px";if(!gl.coverGutter){gj-=gm.gutterTotalWidth;gk.style.paddingLeft=gm.gutterTotalWidth+"px"}gk.style.width=gj+"px"}if(gl.coverGutter){gk.style.zIndex=5;gk.style.position="relative";if(!gl.noHScroll){gk.style.marginLeft=-gm.gutterTotalWidth+"px"}}}var W=H.Pos=function(gi,gj){if(!(this instanceof W)){return new W(gi,gj)}this.line=gi;this.ch=gj};var cf=H.cmpPos=function(gj,gi){return gj.line-gi.line||gj.ch-gi.ch};function ci(gi){return W(gi.line,gi.ch)}function bx(gj,gi){return cf(gj,gi)<0?gi:gj}function ar(gj,gi){return cf(gj,gi)<0?gj:gi}function r(gi){if(!gi.state.focused){gi.display.input.focus();cB(gi)}}function aj(gi){return gi.options.readOnly||gi.doc.cantEdit}var bm=null;function fZ(gw,gm,gk,gj,gv){var gu=gw.doc;gw.display.shift=false;if(!gj){gj=gu.sel}var gl=gw.state.pasteIncoming||gv=="paste";var gp=gu.splitLines(gm),gi=null;if(gl&&gj.ranges.length>1){if(bm&&bm.join("\n")==gm){if(gj.ranges.length%bm.length==0){gi=[];for(var gn=0;gn<bm.length;gn++){gi.push(gu.splitLines(bm[gn]))}}}else{if(gp.length==gj.ranges.length){gi=bS(gp,function(gx){return[gx]})}}}for(var gn=gj.ranges.length-1;gn>=0;gn--){var go=gj.ranges[gn];var gt=go.from(),gs=go.to();if(go.empty()){if(gk&&gk>0){gt=W(gt.line,gt.ch-gk)}else{if(gw.state.overwrite&&!gl){gs=W(gs.line,Math.min(ff(gu,gs.line).text.length,gs.ch+fG(gp).length))}}}var gq=gw.curOp.updateInput;var gr={from:gt,to:gs,text:gi?gi[gn%gi.length]:gp,origin:gv||(gl?"paste":gw.state.cutIncoming?"cut":"+input")};bg(gw.doc,gr);ae(gw,"inputRead",gw,gr)}if(gm&&!gl){fW(gw,gm)}fF(gw);gw.curOp.updateInput=gq;gw.curOp.typing=true;gw.state.pasteIncoming=gw.state.cutIncoming=false}function ba(gk,gi){var gj=gk.clipboardData&&gk.clipboardData.getData("text/plain");if(gj){gk.preventDefault();cM(gi,function(){fZ(gi,gj,0,null,"paste")});return true}}function fW(gi,gm){if(!gi.options.electricChars||!gi.options.smartIndent){return}var gn=gi.doc.sel;for(var gl=gn.ranges.length-1;gl>=0;gl--){var gj=gn.ranges[gl];if(gj.head.ch>100||(gl&&gn.ranges[gl-1].head.line==gj.head.line)){continue}var go=gi.getModeAt(gj.head);var gp=false;if(go.electricChars){for(var gk=0;gk<go.electricChars.length;gk++){if(gm.indexOf(go.electricChars.charAt(gk))>-1){gp=ad(gi,gj.head.line,"smart");break}}}else{if(go.electricInput){if(go.electricInput.test(ff(gi.doc,gj.head.line).text.slice(0,gj.head.ch))){gp=ad(gi,gj.head.line,"smart")}}}if(gp){ae(gi,"electricInput",gi,gj.head.line)}}}function dj(gi){var gn=[],gk=[];for(var gl=0;gl<gi.doc.sel.ranges.length;gl++){var gj=gi.doc.sel.ranges[gl].head.line;var gm={anchor:W(gj,0),head:W(gj+1,0)};gk.push(gm);gn.push(gi.getRange(gm.anchor,gm.head))}return{text:gn,ranges:gk}}function fP(gi){gi.setAttribute("autocorrect","off");gi.setAttribute("autocapitalize","off");gi.setAttribute("spellcheck","false")}function Y(gi){this.cm=gi;this.prevInput="";this.pollingFast=false;this.polling=new gh();this.inaccurateSelection=false;this.hasSelection=false;this.composing=null}function aX(){var gi=f3("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");var gj=f3("div",[gi],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(c0){gi.style.width="1000px"}else{gi.setAttribute("wrap","off")}if(e1){gi.style.border="1px solid black"}fP(gi);return gj}Y.prototype=aN({init:function(gk){var gj=this,gi=this.cm;var gn=this.wrapper=aX();var gl=this.textarea=gn.firstChild;gk.wrapper.insertBefore(gn,gk.wrapper.firstChild);if(e1){gl.style.width="0px"}bX(gl,"input",function(){if(dK&&k>=9&&gj.hasSelection){gj.hasSelection=null}gj.poll()});bX(gl,"paste",function(go){if(ba(go,gi)){return true}gi.state.pasteIncoming=true;gj.fastPoll()});function gm(gp){if(gi.somethingSelected()){bm=gi.getSelections();if(gj.inaccurateSelection){gj.prevInput="";gj.inaccurateSelection=false;gl.value=bm.join("\n");dL(gl)}}else{if(!gi.options.lineWiseCopyCut){return}else{var go=dj(gi);bm=go.text;if(gp.type=="cut"){gi.setSelections(go.ranges,null,Z)}else{gj.prevInput="";gl.value=go.text.join("\n");dL(gl)}}}if(gp.type=="cut"){gi.state.cutIncoming=true}}bX(gl,"cut",gm);bX(gl,"copy",gm);bX(gk.scroller,"paste",function(go){if(bb(gk,go)){return}gi.state.pasteIncoming=true;gj.focus()});bX(gk.lineSpace,"selectstart",function(go){if(!bb(gk,go)){cG(go)}});bX(gl,"compositionstart",function(){var go=gi.getCursor("from");gj.composing={start:go,range:gi.markText(go,gi.getCursor("to"),{className:"CodeMirror-composing"})}});bX(gl,"compositionend",function(){if(gj.composing){gj.poll();gj.composing.range.clear();gj.composing=null}})},prepareSelection:function(){var gj=this.cm,gn=gj.display,gm=gj.doc;var gi=fI(gj);if(gj.options.moveInputWithCursor){var go=dU(gj,gm.sel.primary().head,"div");var gk=gn.wrapper.getBoundingClientRect(),gl=gn.lineDiv.getBoundingClientRect();gi.teTop=Math.max(0,Math.min(gn.wrapper.clientHeight-10,go.top+gl.top-gk.top));gi.teLeft=Math.max(0,Math.min(gn.wrapper.clientWidth-10,go.left+gl.left-gk.left))}return gi},showSelection:function(gk){var gi=this.cm,gj=gi.display;bR(gj.cursorDiv,gk.cursors);bR(gj.selectionDiv,gk.selection);if(gk.teTop!=null){this.wrapper.style.top=gk.teTop+"px";this.wrapper.style.left=gk.teLeft+"px"}},reset:function(gm){if(this.contextMenuPending){return}var gj,gl,gi=this.cm,go=gi.doc;if(gi.somethingSelected()){this.prevInput="";var gk=go.sel.primary();gj=da&&(gk.to().line-gk.from().line>100||(gl=gi.getSelection()).length>1000);var gn=gj?"-":gl||gi.getSelection();this.textarea.value=gn;if(gi.state.focused){dL(this.textarea)}if(dK&&k>=9){this.hasSelection=gn}}else{if(!gm){this.prevInput=this.textarea.value="";if(dK&&k>=9){this.hasSelection=null}}}this.inaccurateSelection=gj},getField:function(){return this.textarea},supportsTouch:function(){return false},focus:function(){if(this.cm.options.readOnly!="nocursor"&&(!eg||dO()!=this.textarea)){try{this.textarea.focus()}catch(gi){}}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var gi=this;if(gi.pollingFast){return}gi.polling.set(this.cm.options.pollInterval,function(){gi.poll();if(gi.cm.state.focused){gi.slowPoll()}})},fastPoll:function(){var gj=false,gi=this;gi.pollingFast=true;function gk(){var gl=gi.poll();if(!gl&&!gj){gj=true;gi.polling.set(60,gk)}else{gi.pollingFast=false;gi.slowPoll()}}gi.polling.set(20,gk)},poll:function(){var gi=this.cm,gl=this.textarea,gm=this.prevInput;if(this.contextMenuPending||!gi.state.focused||(bs(gl)&&!gm&&!this.composing)||aj(gi)||gi.options.disableInput||gi.state.keySeq){return false}var go=gl.value;if(go==gm&&!gi.somethingSelected()){return false}if(dK&&k>=9&&this.hasSelection===go||b7&&/[\uf700-\uf7ff]/.test(go)){gi.display.input.reset();return false}if(gi.doc.sel==gi.display.selForContextMenu){var gn=go.charCodeAt(0);if(gn==8203&&!gm){gm="\u200b"}if(gn==8666){this.reset();return this.cm.execCommand("undo")}}var gp=0,gj=Math.min(gm.length,go.length);while(gp<gj&&gm.charCodeAt(gp)==go.charCodeAt(gp)){++gp}var gk=this;cM(gi,function(){fZ(gi,go.slice(gp),gm.length-gp,null,gk.composing?"*compose":null);if(go.length>1000||go.indexOf("\n")>-1){gl.value=gk.prevInput=""}else{gk.prevInput=go}if(gk.composing){gk.composing.range.clear();gk.composing.range=gi.markText(gk.composing.start,gi.getCursor("to"),{className:"CodeMirror-composing"})}});return true},ensurePolled:function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}},onKeyPress:function(){if(dK&&k>=9){this.hasSelection=null}this.fastPoll()},onContextMenu:function(gn){var gs=this,gt=gs.cm,gp=gt.display,gj=gs.textarea;var gr=cn(gt,gn),gi=gp.scroller.scrollTop;if(!gr||d3){return}var gm=gt.options.resetSelectionOnContextMenu;if(gm&>.doc.sel.contains(gr)==-1){c2(gt,bU)(gt.doc,eS(gr),Z)}var go=gj.style.cssText;gs.wrapper.style.position="absolute";gj.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(gn.clientY-5)+"px; left: "+(gn.clientX-5)+"px; z-index: 1000; background: "+(dK?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(c0){var gu=window.scrollY}gp.input.focus();if(c0){window.scrollTo(null,gu)}gp.input.reset();if(!gt.somethingSelected()){gj.value=gs.prevInput=" "}gs.contextMenuPending=true;gp.selForContextMenu=gt.doc.sel;clearTimeout(gp.detectingSelectAll);function gl(){if(gj.selectionStart!=null){var gv=gt.somethingSelected();var gw="\u200b"+(gv?gj.value:"");gj.value="\u21da";gj.value=gw;gs.prevInput=gv?"":"\u200b";gj.selectionStart=1;gj.selectionEnd=gw.length;gp.selForContextMenu=gt.doc.sel}}function gq(){gs.contextMenuPending=false;gs.wrapper.style.position="relative";gj.style.cssText=go;if(dK&&k<9){gp.scrollbars.setScrollTop(gp.scroller.scrollTop=gi)}if(gj.selectionStart!=null){if(!dK||(dK&&k<9)){gl()}var gv=0,gw=function(){if(gp.selForContextMenu==gt.doc.sel&&gj.selectionStart==0&&gj.selectionEnd>0&&gs.prevInput=="\u200b"){c2(gt,eD.selectAll)(gt)}else{if(gv++<10){gp.detectingSelectAll=setTimeout(gw,500)}else{gp.input.reset()}}};gp.detectingSelectAll=setTimeout(gw,200)}}if(dK&&k>=9){gl()}if(ga){er(gn);var gk=function(){ed(window,"mouseup",gk);setTimeout(gq,20)};bX(window,"mouseup",gk)}else{setTimeout(gq,50)}},setUneditable:fV,needsContentAttribute:false},Y.prototype);function dv(gi){this.cm=gi;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new gh();this.gracePeriod=false}dv.prototype=aN({init:function(gl){var gk=this,gi=gk.cm;var gm=gk.div=gl.lineDiv;gm.contentEditable="true";fP(gm);bX(gm,"paste",function(gn){ba(gn,gi)});bX(gm,"compositionstart",function(gr){var gq=gr.data;gk.composing={sel:gi.doc.sel,data:gq,startData:gq};if(!gq){return}var go=gi.doc.sel.primary();var gn=gi.getLine(go.head.line);var gp=gn.indexOf(gq,Math.max(0,go.head.ch-gq.length));if(gp>-1&&gp<=go.head.ch){gk.composing.sel=eS(W(go.head.line,gp),W(go.head.line,gp+gq.length))}});bX(gm,"compositionupdate",function(gn){gk.composing.data=gn.data});bX(gm,"compositionend",function(go){var gn=gk.composing;if(!gn){return}if(go.data!=gn.startData&&!/\u200b/.test(go.data)){gn.data=go.data}setTimeout(function(){if(!gn.handled){gk.applyComposition(gn)}if(gk.composing==gn){gk.composing=null}},50)});bX(gm,"touchstart",function(){gk.forceCompositionEnd()});bX(gm,"input",function(){if(gk.composing){return}if(!gk.pollContent()){cM(gk.cm,function(){ah(gi)})}});function gj(gq){if(gi.somethingSelected()){bm=gi.getSelections();if(gq.type=="cut"){gi.replaceSelection("",null,"cut")}}else{if(!gi.options.lineWiseCopyCut){return}else{var go=dj(gi);bm=go.text;if(gq.type=="cut"){gi.operation(function(){gi.setSelections(go.ranges,0,Z);gi.replaceSelection("",null,"cut")})}}}if(gq.clipboardData&&!e1){gq.preventDefault();gq.clipboardData.clearData();gq.clipboardData.setData("text/plain",bm.join("\n"))}else{var gp=aX(),gr=gp.firstChild;gi.display.lineSpace.insertBefore(gp,gi.display.lineSpace.firstChild);gr.value=bm.join("\n");var gn=document.activeElement;dL(gr);setTimeout(function(){gi.display.lineSpace.removeChild(gp);gn.focus()},50)}}bX(gm,"copy",gj);bX(gm,"cut",gj)},prepareSelection:function(){var gi=fI(this.cm,false);gi.focus=this.cm.state.focused;return gi},showSelection:function(gi){if(!gi||!this.cm.display.view.length){return}if(gi.focus){this.showPrimarySelection()}this.showMultipleSelections(gi)},showPrimarySelection:function(){var gm=window.getSelection(),gp=this.cm.doc.sel.primary();var gn=az(this.cm,gm.anchorNode,gm.anchorOffset);var gr=az(this.cm,gm.focusNode,gm.focusOffset);if(gn&&!gn.bad&&gr&&!gr.bad&&cf(ar(gn,gr),gp.from())==0&&cf(bx(gn,gr),gp.to())==0){return}var gl=cz(this.cm,gp.from());var gq=cz(this.cm,gp.to());if(!gl&&!gq){return}var gt=this.cm.display.view;var go=gm.rangeCount&&gm.getRangeAt(0);if(!gl){gl={node:gt[0].measure.map[2],offset:0}}else{if(!gq){var gk=gt[gt.length-1].measure;var gj=gk.maps?gk.maps[gk.maps.length-1]:gk.map;gq={node:gj[gj.length-1],offset:gj[gj.length-2]-gj[gj.length-3]}}}try{var gi=cl(gl.node,gl.offset,gq.offset,gq.node)}catch(gs){}if(gi){gm.removeAllRanges();gm.addRange(gi);if(go&&gm.anchorNode==null){gm.addRange(go)}else{if(co){this.startGracePeriod()}}}this.rememberSelection()},startGracePeriod:function(){var gi=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){gi.gracePeriod=false;if(gi.selectionChanged()){gi.cm.operation(function(){gi.cm.curOp.selectionChanged=true})}},20)},showMultipleSelections:function(gi){bR(this.cm.display.cursorDiv,gi.cursors);bR(this.cm.display.selectionDiv,gi.selection)},rememberSelection:function(){var gi=window.getSelection();this.lastAnchorNode=gi.anchorNode;this.lastAnchorOffset=gi.anchorOffset;this.lastFocusNode=gi.focusNode;this.lastFocusOffset=gi.focusOffset},selectionInEditor:function(){var gj=window.getSelection();if(!gj.rangeCount){return false}var gi=gj.getRangeAt(0).commonAncestorContainer;return gb(this.div,gi)},focus:function(){if(this.cm.options.readOnly!="nocursor"){this.div.focus()}},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return true},receivedFocus:function(){var gi=this;if(this.selectionInEditor()){this.pollSelection()}else{cM(this.cm,function(){gi.cm.curOp.selectionChanged=true})}function gj(){if(gi.cm.state.focused){gi.pollSelection();gi.polling.set(gi.cm.options.pollInterval,gj)}}this.polling.set(this.cm.options.pollInterval,gj)},selectionChanged:function(){var gi=window.getSelection();return gi.anchorNode!=this.lastAnchorNode||gi.anchorOffset!=this.lastAnchorOffset||gi.focusNode!=this.lastFocusNode||gi.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var gl=window.getSelection(),gi=this.cm;this.rememberSelection();var gj=az(gi,gl.anchorNode,gl.anchorOffset);var gk=az(gi,gl.focusNode,gl.focusOffset);if(gj&&gk){cM(gi,function(){bU(gi.doc,eS(gj,gk),Z);if(gj.bad||gk.bad){gi.curOp.selectionChanged=true}})}}},pollContent:function(){var gs=this.cm,gC=gs.display,gA=gs.doc.sel.primary();var gB=gA.from(),gm=gA.to();if(gB.line<gC.viewFrom||gm.line>gC.viewTo-1){return false}var gp;if(gB.line==gC.viewFrom||(gp=dr(gs,gB.line))==0){var gn=bN(gC.view[0].line);var gr=gC.view[0].node}else{var gn=bN(gC.view[gp].line);var gr=gC.view[gp-1].node.nextSibling}var gz=dr(gs,gm.line);if(gz==gC.view.length-1){var gu=gC.viewTo-1;var gx=gC.lineDiv.lastChild}else{var gu=bN(gC.view[gz+1].line)-1;var gx=gC.view[gz+1].node.previousSibling}var gD=gs.doc.splitLines(f0(gs,gr,gx,gn,gu));var gw=f5(gs.doc,W(gn,0),W(gu,ff(gs.doc,gu).text.length));while(gD.length>1&&gw.length>1){if(fG(gD)==fG(gw)){gD.pop();gw.pop();gu--}else{if(gD[0]==gw[0]){gD.shift();gw.shift();gn++}else{break}}}var gy=0,gk=0;var gt=gD[0],gj=gw[0],gi=Math.min(gt.length,gj.length);while(gy<gi&>.charCodeAt(gy)==gj.charCodeAt(gy)){++gy}var gq=fG(gD),gE=fG(gw);var gl=Math.min(gq.length-(gD.length==1?gy:0),gE.length-(gw.length==1?gy:0));while(gk<gl&&gq.charCodeAt(gq.length-gk-1)==gE.charCodeAt(gE.length-gk-1)){++gk}gD[gD.length-1]=gq.slice(0,gq.length-gk);gD[0]=gD[0].slice(gy);var go=W(gn,gy);var gv=W(gu,gw.length?fG(gw).length-gk:0);if(gD.length>1||gD[0]||cf(go,gv)){a1(gs.doc,gD,go,gv,"+input");return true}},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){if(!this.composing||this.composing.handled){return}this.applyComposition(this.composing);this.composing.handled=true;this.div.blur();this.div.focus()},applyComposition:function(gi){if(gi.data&&gi.data!=gi.startData){c2(this.cm,fZ)(this.cm,gi.data,0,gi.sel)}},setUneditable:function(gi){gi.setAttribute("contenteditable","false")},onKeyPress:function(gi){gi.preventDefault();c2(this.cm,fZ)(this.cm,String.fromCharCode(gi.charCode==null?gi.keyCode:gi.charCode),0)},onContextMenu:fV,resetPosition:fV,needsContentAttribute:true},dv.prototype);function cz(go,gm){var gn=fb(go,gm.line);if(!gn||gn.hidden){return null}var gq=ff(go.doc,gm.line);var gj=ct(gn,gq,gm.line);var gk=a(gq),gl="left";if(gk){var gi=aG(gk,gm.ch);gl=gi%2?"right":"left"}var gp=aL(gj.map,gm.ch,gl);gp.offset=gp.collapse=="right"?gp.end:gp.start;return gp}function et(gj,gi){if(gi){gj.bad=true}return gj}function az(gi,gl,gn){var gm;if(gl==gi.display.lineDiv){gm=gi.display.lineDiv.childNodes[gn];if(!gm){return et(gi.clipPos(W(gi.display.viewTo-1)),true)}gl=null;gn=0}else{for(gm=gl;;gm=gm.parentNode){if(!gm||gm==gi.display.lineDiv){return null}if(gm.parentNode&&gm.parentNode==gi.display.lineDiv){break}}}for(var gk=0;gk<gi.display.view.length;gk++){var gj=gi.display.view[gk];if(gj.node==gm){return aa(gj,gl,gn)}}}function aa(gq,gm,go){var gk=gq.text.firstChild,gl=false;if(!gm||!gb(gk,gm)){return et(W(bN(gq.line),0),true)}if(gm==gk){gl=true;gm=gk.childNodes[go];go=0;if(!gm){var gw=gq.rest?fG(gq.rest):gq.line;return et(W(bN(gw),gw.text.length),gl)}}var gn=gm.nodeType==3?gm:null,gu=gm;if(!gn&&gm.childNodes.length==1&&gm.firstChild.nodeType==3){gn=gm.firstChild;if(go){go=gn.nodeValue.length}}while(gu.parentNode!=gk){gu=gu.parentNode}var gj=gq.measure,gs=gj.maps;function gp(gz,gE,gB){for(var gD=-1;gD<(gs?gs.length:0);gD++){var gy=gD<0?gj.map:gs[gD];for(var gC=0;gC<gy.length;gC+=3){var gA=gy[gC+2];if(gA==gz||gA==gE){var gF=bN(gD<0?gq.line:gq.rest[gD]);var gx=gy[gC]+gB;if(gB<0||gA!=gz){gx=gy[gC+(gB?1:0)]}return W(gF,gx)}}}}var gv=gp(gn,gu,go);if(gv){return et(gv,gl)}for(var gi=gu.nextSibling,gr=gn?gn.nodeValue.length-go:0;gi;gi=gi.nextSibling){gv=gp(gi,gi.firstChild,0);if(gv){return et(W(gv.line,gv.ch-gr),gl)}else{gr+=gi.textContent.length}}for(var gt=gu.previousSibling,gr=go;gt;gt=gt.previousSibling){gv=gp(gt,gt.firstChild,-1);if(gv){return et(W(gv.line,gv.ch+gr),gl)}else{gr+=gi.textContent.length}}}function f0(gq,go,gp,gl,gj){var gr="",gk=false,gi=gq.doc.lineSeparator();function gm(gs){return function(gt){return gt.id==gs}}function gn(gw){if(gw.nodeType==1){var gt=gw.getAttribute("cm-text");if(gt!=null){if(gt==""){gt=gw.textContent.replace(/\u200b/g,"")}gr+=gt;return}var gv=gw.getAttribute("cm-marker"),gs;if(gv){var gx=gq.findMarks(W(gl,0),W(gj+1,0),gm(+gv));if(gx.length&&(gs=gx[0].find())){gr+=f5(gq.doc,gs.from,gs.to).join(gi)}return}if(gw.getAttribute("contenteditable")=="false"){return}for(var gu=0;gu<gw.childNodes.length;gu++){gn(gw.childNodes[gu])}if(/^(pre|div|p)$/i.test(gw.nodeName)){gk=true}}else{if(gw.nodeType==3){var gy=gw.nodeValue;if(!gy){return}if(gk){gr+=gi;gk=false}gr+=gy}}}for(;;){gn(go);if(go==gp){break}go=go.nextSibling}return gr}H.inputStyles={textarea:Y,contenteditable:dv};function f4(gi,gj){this.ranges=gi;this.primIndex=gj}f4.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(gi){if(gi==this){return true}if(gi.primIndex!=this.primIndex||gi.ranges.length!=this.ranges.length){return false}for(var gk=0;gk<this.ranges.length;gk++){var gj=this.ranges[gk],gl=gi.ranges[gk];if(cf(gj.anchor,gl.anchor)!=0||cf(gj.head,gl.head)!=0){return false}}return true},deepCopy:function(){for(var gi=[],gj=0;gj<this.ranges.length;gj++){gi[gj]=new dY(ci(this.ranges[gj].anchor),ci(this.ranges[gj].head))}return new f4(gi,this.primIndex)},somethingSelected:function(){for(var gi=0;gi<this.ranges.length;gi++){if(!this.ranges[gi].empty()){return true}}return false},contains:function(gl,gi){if(!gi){gi=gl}for(var gk=0;gk<this.ranges.length;gk++){var gj=this.ranges[gk];if(cf(gi,gj.from())>=0&&cf(gl,gj.to())<=0){return gk}}return -1}};function dY(gi,gj){this.anchor=gi;this.head=gj}dY.prototype={from:function(){return ar(this.anchor,this.head)},to:function(){return bx(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};function cw(gi,gp){var gk=gi[gp];gi.sort(function(gs,gr){return cf(gs.from(),gr.from())});gp=dh(gi,gk);for(var gm=1;gm<gi.length;gm++){var gq=gi[gm],gj=gi[gm-1];if(cf(gj.to(),gq.from())>=0){var gn=ar(gj.from(),gq.from()),go=bx(gj.to(),gq.to());var gl=gj.empty()?gq.from()==gq.head:gj.from()==gj.head;if(gm<=gp){--gp}gi.splice(--gm,2,new dY(gl?go:gn,gl?gn:go))}}return new f4(gi,gp)}function eS(gi,gj){return new f4([new dY(gi,gj||gi)],0)}function c5(gi,gj){return Math.max(gi.first,Math.min(gj,gi.first+gi.size-1))}function fJ(gj,gk){if(gk.line<gj.first){return W(gj.first,0)}var gi=gj.first+gj.size-1;if(gk.line>gi){return W(gi,ff(gj,gi).text.length)}return fs(gk,ff(gj,gk.line).text.length)}function fs(gk,gj){var gi=gk.ch;if(gi==null||gi>gj){return W(gk.line,gj)}else{if(gi<0){return W(gk.line,0)}else{return gk}}}function b9(gj,gi){return gi>=gj.first&&gi<gj.first+gj.size}function d0(gk,gl){for(var gi=[],gj=0;gj<gl.length;gj++){gi[gj]=fJ(gk,gl[gj])}return gi}function fv(gn,gj,gm,gi){if(gn.cm&&gn.cm.display.shift||gn.extend){var gl=gj.anchor;if(gi){var gk=cf(gm,gl)<0;if(gk!=(cf(gi,gl)<0)){gl=gm;gm=gi}else{if(gk!=(cf(gm,gi)<0)){gm=gi}}}return new dY(gl,gm)}else{return new dY(gi||gm,gm)}}function fX(gl,gk,gi,gj){bU(gl,new f4([fv(gl,gl.sel.primary(),gk,gi)],0),gj)}function aw(gn,gm,gk){for(var gj=[],gl=0;gl<gn.sel.ranges.length;gl++){gj[gl]=fv(gn,gn.sel.ranges[gl],gm[gl],null)}var gi=cw(gj,gn.sel.primIndex);bU(gn,gi,gk)}function e(gm,gl,gj,gk){var gi=gm.sel.ranges.slice(0);gi[gl]=gj;bU(gm,cw(gi,gm.sel.primIndex),gk)}function F(gl,gj,gk,gi){bU(gl,eS(gj,gk),gi)}function c(gk,gi){var gj={ranges:gi.ranges,update:function(gl){this.ranges=[];for(var gm=0;gm<gl.length;gm++){this.ranges[gm]=new dY(fJ(gk,gl[gm].anchor),fJ(gk,gl[gm].head))}}};aE(gk,"beforeSelectionChange",gk,gj);if(gk.cm){aE(gk.cm,"beforeSelectionChange",gk.cm,gj)}if(gj.ranges!=gi.ranges){return cw(gj.ranges,gj.ranges.length-1)}else{return gi}}function e7(gm,gl,gj){var gi=gm.history.done,gk=fG(gi);if(gk&&gk.ranges){gi[gi.length-1]=gl;ep(gm,gl,gj)}else{bU(gm,gl,gj)}}function bU(gk,gj,gi){ep(gk,gj,gi);gc(gk,gk.sel,gk.cm?gk.cm.curOp.id:NaN,gi)}function ep(gl,gk,gj){if(fi(gl,"beforeSelectionChange")||gl.cm&&fi(gl.cm,"beforeSelectionChange")){gk=c(gl,gk)}var gi=gj&&gj.bias||(cf(gk.primary().head,gl.sel.primary().head)<0?-1:1);c9(gl,n(gl,gk,gi,true));if(!(gj&&gj.scroll===false)&&gl.cm){fF(gl.cm)}}function c9(gj,gi){if(gi.equals(gj.sel)){return}gj.sel=gi;if(gj.cm){gj.cm.curOp.updateInput=gj.cm.curOp.selectionChanged=true;V(gj.cm)}ae(gj,"cursorActivity",gj)}function ey(gi){c9(gi,n(gi,gi.sel,null,false),Z)}function n(gq,gi,gn,go){var gk;for(var gl=0;gl<gi.ranges.length;gl++){var gm=gi.ranges[gl];var gp=bV(gq,gm.anchor,gn,go);var gj=bV(gq,gm.head,gn,go);if(gk||gp!=gm.anchor||gj!=gm.head){if(!gk){gk=gi.ranges.slice(0,gl)}gk[gl]=new dY(gp,gj)}}return gk?cw(gk,gi.primIndex):gi}function bV(gr,gq,gn,go){var gs=false,gk=gq;var gl=gn||1;gr.cantEdit=false;search:for(;;){var gt=ff(gr,gk.line);if(gt.markedSpans){for(var gm=0;gm<gt.markedSpans.length;++gm){var gi=gt.markedSpans[gm],gj=gi.marker;if((gi.from==null||(gj.inclusiveLeft?gi.from<=gk.ch:gi.from<gk.ch))&&(gi.to==null||(gj.inclusiveRight?gi.to>=gk.ch:gi.to>gk.ch))){if(go){aE(gj,"beforeCursorEnter");if(gj.explicitlyCleared){if(!gt.markedSpans){break}else{--gm;continue}}}if(!gj.atomic){continue}var gp=gj.find(gl<0?-1:1);if(cf(gp,gk)==0){gp.ch+=gl;if(gp.ch<0){if(gp.line>gr.first){gp=fJ(gr,W(gp.line-1))}else{gp=null}}else{if(gp.ch>gt.text.length){if(gp.line<gr.first+gr.size-1){gp=W(gp.line+1,0)}else{gp=null}}}if(!gp){if(gs){if(!go){return bV(gr,gq,gn,true)}gr.cantEdit=true;return W(gr.first,0)}gs=true;gp=gq;gl=-gl}}gk=gp;continue search}}}return gk}}function bC(gi){gi.display.input.showSelection(gi.display.input.prepareSelection())}function fI(gp,gi){var go=gp.doc,gq={};var gn=gq.cursors=document.createDocumentFragment();var gj=gq.selection=document.createDocumentFragment();for(var gl=0;gl<go.sel.ranges.length;gl++){if(gi===false&&gl==go.sel.primIndex){continue}var gm=go.sel.ranges[gl];var gk=gm.empty();if(gk||gp.options.showCursorWhenSelecting){A(gp,gm,gn)}if(!gk){bD(gp,gm,gj)}}return gq}function A(gi,gl,gk){var gn=dU(gi,gl.head,"div",null,null,!gi.options.singleCursorHeightPerLine);var gm=gk.appendChild(f3("div","\u00a0","CodeMirror-cursor"));gm.style.left=gn.left+"px";gm.style.top=gn.top+"px";gm.style.height=Math.max(0,gn.bottom-gn.top)*gi.options.cursorHeight+"px";if(gn.other){var gj=gk.appendChild(f3("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor"));gj.style.display="";gj.style.left=gn.other.left+"px";gj.style.top=gn.other.top+"px";gj.style.height=(gn.other.bottom-gn.other.top)*0.85+"px"}}function bD(gm,gs,gn){var gv=gm.display,gz=gm.doc;var gi=document.createDocumentFragment();var gr=e5(gm.display),gl=gr.left;var gw=Math.max(gv.sizerWidth,dl(gm)-gv.sizer.offsetLeft)-gr.right;function gt(gD,gC,gB,gA){if(gC<0){gC=0}gC=Math.round(gC);gA=Math.round(gA);gi.appendChild(f3("div",null,"CodeMirror-selected","position: absolute; left: "+gD+"px; top: "+gC+"px; width: "+(gB==null?gw-gD:gB)+"px; height: "+(gA-gC)+"px"))}function gj(gB,gD,gG){var gC=ff(gz,gB);var gE=gC.text.length;var gH,gA;function gF(gJ,gI){return cJ(gm,W(gB,gJ),"div",gC,gI)}d4(a(gC),gD||0,gG==null?gE:gG,function(gP,gO,gI){var gL=gF(gP,"left"),gM,gN,gK;if(gP==gO){gM=gL;gN=gK=gL.left}else{gM=gF(gO-1,"right");if(gI=="rtl"){var gJ=gL;gL=gM;gM=gJ}gN=gL.left;gK=gM.right}if(gD==null&&gP==0){gN=gl}if(gM.top-gL.top>3){gt(gN,gL.top,null,gL.bottom);gN=gl;if(gL.bottom<gM.top){gt(gN,gL.bottom,null,gM.top)}}if(gG==null&&gO==gE){gK=gw}if(!gH||gL.top<gH.top||gL.top==gH.top&&gL.left<gH.left){gH=gL}if(!gA||gM.bottom>gA.bottom||gM.bottom==gA.bottom&&gM.right>gA.right){gA=gM}if(gN<gl+1){gN=gl}gt(gN,gM.top,gK-gN,gM.bottom)});return{start:gH,end:gA}}var gy=gs.from(),gx=gs.to();if(gy.line==gx.line){gj(gy.line,gy.ch,gx.ch)}else{var gk=ff(gz,gy.line),gp=ff(gz,gx.line);var go=y(gk)==y(gp);var gq=gj(gy.line,gy.ch,go?gk.text.length+1:null).end;var gu=gj(gx.line,go?0:null,gx.ch).start;if(go){if(gq.top<gu.top-2){gt(gq.right,gq.top,null,gq.bottom);gt(gl,gu.top,gu.left,gu.bottom)}else{gt(gq.right,gq.top,gu.left-gq.right,gq.bottom)}}if(gq.bottom<gu.top){gt(gl,gq.bottom,null,gu.top)}}gn.appendChild(gi)}function o(gi){if(!gi.state.focused){return}var gk=gi.display;clearInterval(gk.blinker);var gj=true;gk.cursorDiv.style.visibility="";if(gi.options.cursorBlinkRate>0){gk.blinker=setInterval(function(){gk.cursorDiv.style.visibility=(gj=!gj)?"":"hidden"},gi.options.cursorBlinkRate)}else{if(gi.options.cursorBlinkRate<0){gk.cursorDiv.style.visibility="hidden"}}}function ef(gi,gj){if(gi.doc.mode.startState&&gi.doc.frontier<gi.display.viewTo){gi.state.highlight.set(gj,cv(cP,gi))}}function cP(gi){var gm=gi.doc;if(gm.frontier<gm.first){gm.frontier=gm.first}if(gm.frontier>=gi.display.viewTo){return}var gk=+new Date+gi.options.workTime;var gl=b3(gm.mode,dC(gi,gm.frontier));var gj=[];gm.iter(gm.frontier,Math.min(gm.first+gm.size,gi.display.viewTo+500),function(gn){if(gm.frontier>=gi.display.viewFrom){var gq=gn.styles;var gs=fz(gi,gn,gl,true);gn.styles=gs.styles;var gp=gn.styleClasses,gr=gs.classes;if(gr){gn.styleClasses=gr}else{if(gp){gn.styleClasses=null}}var gt=!gq||gq.length!=gn.styles.length||gp!=gr&&(!gp||!gr||gp.bgClass!=gr.bgClass||gp.textClass!=gr.textClass);for(var go=0;!gt&&go<gq.length;++go){gt=gq[go]!=gn.styles[go]}if(gt){gj.push(gm.frontier)}gn.stateAfter=b3(gm.mode,gl)}else{dx(gi,gn.text,gl);gn.stateAfter=gm.frontier%5==0?b3(gm.mode,gl):null}++gm.frontier;if(+new Date>gk){ef(gi,gi.options.workDelay);return true}});if(gj.length){cM(gi,function(){for(var gn=0;gn<gj.length;gn++){R(gi,gj[gn],"text")}})}}function cy(go,gi,gl){var gj,gm,gn=go.doc;var gk=gl?-1:gi-(go.doc.mode.innerMode?1000:100);for(var gr=gi;gr>gk;--gr){if(gr<=gn.first){return gn.first}var gq=ff(gn,gr-1);if(gq.stateAfter&&(!gl||gr<=gn.frontier)){return gr}var gp=bT(gq.text,null,go.options.tabSize);if(gm==null||gj>gp){gm=gr-1;gj=gp}}return gm}function dC(gi,go,gj){var gm=gi.doc,gl=gi.display;if(!gm.mode.startState){return true}var gn=cy(gi,go,gj),gk=gn>gm.first&&ff(gm,gn-1).stateAfter;if(!gk){gk=b0(gm.mode)}else{gk=b3(gm.mode,gk)}gm.iter(gn,go,function(gp){dx(gi,gp.text,gk);var gq=gn==go-1||gn%5==0||gn>=gl.viewFrom&&gn<gl.viewTo;gp.stateAfter=gq?b3(gm.mode,gk):null;++gn});if(gj){gm.frontier=gn}return gk}function e8(gi){return gi.lineSpace.offsetTop}function bI(gi){return gi.mover.offsetHeight-gi.lineSpace.offsetHeight}function e5(gl){if(gl.cachedPaddingH){return gl.cachedPaddingH}var gk=bR(gl.measure,f3("pre","x"));var gi=window.getComputedStyle?window.getComputedStyle(gk):gk.currentStyle;var gj={left:parseInt(gi.paddingLeft),right:parseInt(gi.paddingRight)};if(!isNaN(gj.left)&&!isNaN(gj.right)){gl.cachedPaddingH=gj}return gj}function cT(gi){return dJ-gi.display.nativeBarWidth}function dl(gi){return gi.display.scroller.clientWidth-cT(gi)-gi.display.barWidth}function cV(gi){return gi.display.scroller.clientHeight-cT(gi)-gi.display.barHeight}function ch(gp,gl,go){var gk=gp.options.lineWrapping;var gm=gk&&dl(gp);if(!gl.measure.heights||gk&&gl.measure.width!=gm){var gn=gl.measure.heights=[];if(gk){gl.measure.width=gm;var gr=gl.text.firstChild.getClientRects();for(var gi=0;gi<gr.length-1;gi++){var gq=gr[gi],gj=gr[gi+1];if(Math.abs(gq.bottom-gj.bottom)>2){gn.push((gq.bottom+gj.top)/2-go.top)}}}gn.push(go.bottom-go.top)}}function ct(gk,gi,gl){if(gk.line==gi){return{map:gk.measure.map,cache:gk.measure.cache}}for(var gj=0;gj<gk.rest.length;gj++){if(gk.rest[gj]==gi){return{map:gk.measure.maps[gj],cache:gk.measure.caches[gj]}}}for(var gj=0;gj<gk.rest.length;gj++){if(bN(gk.rest[gj])>gl){return{map:gk.measure.maps[gj],cache:gk.measure.caches[gj],before:true}}}}function c1(gi,gk){gk=y(gk);var gm=bN(gk);var gj=gi.display.externalMeasured=new bv(gi.doc,gk,gm);gj.lineN=gm;var gl=gj.built=eR(gi,gj);gj.text=gl.pre;bR(gi.display.lineMeasure,gl.pre);return gj}function eh(gi,gj,gl,gk){return C(gi,a4(gi,gj),gl,gk)}function fb(gi,gk){if(gk>=gi.display.viewFrom&&gk<gi.display.viewTo){return gi.display.view[dr(gi,gk)]}var gj=gi.display.externalMeasured;if(gj&&gk>=gj.lineN&&gk<gj.lineN+gj.size){return gj}}function a4(gi,gk){var gl=bN(gk);var gj=fb(gi,gl);if(gj&&!gj.text){gj=null}else{if(gj&&gj.changes){ab(gi,gj,gl,fd(gi));gi.curOp.forceUpdate=true}}if(!gj){gj=c1(gi,gk)}var gm=ct(gj,gk,gl);return{line:gk,view:gj,rect:null,map:gm.map,cache:gm.cache,before:gm.before,hasHeights:false}}function C(gi,go,gm,gj,gl){if(go.before){gm=-1}var gk=gm+(gj||""),gn;if(go.cache.hasOwnProperty(gk)){gn=go.cache[gk]}else{if(!go.rect){go.rect=go.view.text.getBoundingClientRect()}if(!go.hasHeights){ch(gi,go.view,go.rect);go.hasHeights=true}gn=j(gi,go,gm,gj);if(!gn.bogus){go.cache[gk]=gn}}return{left:gn.left,right:gn.right,top:gl?gn.rtop:gn.top,bottom:gl?gn.rbottom:gn.bottom}}var eB={left:0,right:0,top:0,bottom:0};function aL(gj,gi,gp){var gl,gk,gn,gq;for(var go=0;go<gj.length;go+=3){var gm=gj[go],gr=gj[go+1];if(gi<gm){gk=0;gn=1;gq="left"}else{if(gi<gr){gk=gi-gm;gn=gk+1}else{if(go==gj.length-3||gi==gr&&gj[go+3]>gi){gn=gr-gm;gk=gn-1;if(gi>=gr){gq="right"}}}}if(gk!=null){gl=gj[go+2];if(gm==gr&&gp==(gl.insertLeft?"left":"right")){gq=gp}if(gp=="left"&&gk==0){while(go&&gj[go-2]==gj[go-3]&&gj[go-1].insertLeft){gl=gj[(go-=3)+2];gq="left"}}if(gp=="right"&&gk==gr-gm){while(go<gj.length-3&&gj[go+3]==gj[go+4]&&!gj[go+5].insertLeft){gl=gj[(go+=3)+2];gq="right"}}break}}return{node:gl,start:gk,end:gn,collapse:gq,coverStart:gm,coverEnd:gr}}function j(gp,gz,gs,gn){var gq=aL(gz.map,gs,gn);var gx=gq.node,gm=gq.start,gl=gq.end,gi=gq.collapse;var gj;if(gx.nodeType==3){for(var gy=0;gy<4;gy++){while(gm&&fp(gz.line.text.charAt(gq.coverStart+gm))){--gm}while(gq.coverStart+gl<gq.coverEnd&&fp(gz.line.text.charAt(gq.coverStart+gl))){++gl}if(dK&&k<9&&gm==0&&gl==gq.coverEnd-gq.coverStart){gj=gx.parentNode.getBoundingClientRect()}else{if(dK&&gp.options.lineWrapping){var gk=cl(gx,gm,gl).getClientRects();if(gk.length){gj=gk[gn=="right"?gk.length-1:0]}else{gj=eB}}else{gj=cl(gx,gm,gl).getBoundingClientRect()||eB}}if(gj.left||gj.right||gm==0){break}gl=gm;gm=gm-1;gi="right"}if(dK&&k<11){gj=eN(gp.display.measure,gj)}}else{if(gm>0){gi=gn="right"}var gk;if(gp.options.lineWrapping&&(gk=gx.getClientRects()).length>1){gj=gk[gn=="right"?gk.length-1:0]}else{gj=gx.getBoundingClientRect()}}if(dK&&k<9&&!gm&&(!gj||!gj.left&&!gj.right)){var go=gx.parentNode.getClientRects()[0];if(go){gj={left:go.left,right:go.left+dD(gp.display),top:go.top,bottom:go.bottom}}else{gj=eB}}var gv=gj.top-gz.rect.top,gt=gj.bottom-gz.rect.top;var gB=(gv+gt)/2;var gA=gz.view.measure.heights;for(var gy=0;gy<gA.length-1;gy++){if(gB<gA[gy]){break}}var gw=gy?gA[gy-1]:0,gu=gA[gy];var gr={left:(gi=="right"?gj.right:gj.left)-gz.rect.left,right:(gi=="left"?gj.left:gj.right)-gz.rect.left,top:gw,bottom:gu};if(!gj.left&&!gj.right){gr.bogus=true}if(!gp.options.singleCursorHeightPerLine){gr.rtop=gv;gr.rbottom=gt}return gr}function eN(gk,gl){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!aK(gk)){return gl}var gj=screen.logicalXDPI/screen.deviceXDPI;var gi=screen.logicalYDPI/screen.deviceYDPI;return{left:gl.left*gj,right:gl.right*gj,top:gl.top*gi,bottom:gl.bottom*gi}}function au(gj){if(gj.measure){gj.measure.cache={};gj.measure.heights=null;if(gj.rest){for(var gi=0;gi<gj.rest.length;gi++){gj.measure.caches[gi]={}}}}}function aO(gi){gi.display.externalMeasure=null;d1(gi.display.lineMeasure);for(var gj=0;gj<gi.display.view.length;gj++){au(gi.display.view[gj])}}function ak(gi){aO(gi);gi.display.cachedCharWidth=gi.display.cachedTextHeight=gi.display.cachedPaddingH=null;if(!gi.options.lineWrapping){gi.display.maxLineChanged=true}gi.display.lineNumChars=null}function cu(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function cs(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function eQ(go,gl,gn,gj){if(gl.widgets){for(var gk=0;gk<gl.widgets.length;++gk){if(gl.widgets[gk].above){var gq=cY(gl.widgets[gk]);gn.top+=gq;gn.bottom+=gq}}}if(gj=="line"){return gn}if(!gj){gj="local"}var gm=bM(gl);if(gj=="local"){gm+=e8(go.display)}else{gm-=go.display.viewOffset}if(gj=="page"||gj=="window"){var gi=go.display.lineSpace.getBoundingClientRect();gm+=gi.top+(gj=="window"?0:cs());var gp=gi.left+(gj=="window"?0:cu());gn.left+=gp;gn.right+=gp}gn.top+=gm;gn.bottom+=gm;return gn}function gf(gj,gm,gk){if(gk=="div"){return gm}var go=gm.left,gn=gm.top;if(gk=="page"){go-=cu();gn-=cs()}else{if(gk=="local"||!gk){var gl=gj.display.sizer.getBoundingClientRect();go+=gl.left;gn+=gl.top}}var gi=gj.display.lineSpace.getBoundingClientRect();return{left:go-gi.left,top:gn-gi.top}}function cJ(gi,gm,gl,gk,gj){if(!gk){gk=ff(gi.doc,gm.line)}return eQ(gi,gk,eh(gi,gk,gm.ch,gj),gl)}function dU(gr,gq,gk,go,gt,gp){go=go||ff(gr.doc,gq.line);if(!gt){gt=a4(gr,go)}function gm(gw,gv){var gu=C(gr,gt,gw,gv?"right":"left",gp);if(gv){gu.left=gu.right}else{gu.right=gu.left}return eQ(gr,go,gu,gk)}function gs(gx,gu){var gv=gn[gu],gw=gv.level%2;if(gx==dy(gv)&&gu&&gv.level<gn[gu-1].level){gv=gn[--gu];gx=ge(gv)-(gv.level%2?0:1);gw=true}else{if(gx==ge(gv)&&gu<gn.length-1&&gv.level<gn[gu+1].level){gv=gn[++gu];gx=dy(gv)-gv.level%2;gw=false}}if(gw&&gx==gv.to&&gx>gv.from){return gm(gx-1)}return gm(gx,gw)}var gn=a(go),gi=gq.ch;if(!gn){return gm(gi)}var gj=aG(gn,gi);var gl=gs(gi,gj);if(e2!=null){gl.other=gs(gi,e2)}return gl}function dH(gi,gm){var gl=0,gm=fJ(gi.doc,gm);if(!gi.options.lineWrapping){gl=dD(gi.display)*gm.ch}var gj=ff(gi.doc,gm.line);var gk=bM(gj)+e8(gi.display);return{left:gl,right:gl,top:gk,bottom:gk+gj.height}}function f2(gi,gj,gk,gm){var gl=W(gi,gj);gl.xRel=gm;if(gk){gl.outside=true}return gl}function fO(gp,gm,gl){var go=gp.doc;gl+=gp.display.viewOffset;if(gl<0){return f2(go.first,0,true,-1)}var gk=bG(go,gl),gq=go.first+go.size-1;if(gk>gq){return f2(go.first+go.size-1,ff(go,gq).text.length,true,1)}if(gm<0){gm=0}var gj=ff(go,gk);for(;;){var gr=cZ(gp,gj,gk,gm,gl);var gn=ew(gj);var gi=gn&&gn.find(0,true);if(gn&&(gr.ch>gi.from.ch||gr.ch==gi.from.ch&&gr.xRel>0)){gk=bN(gj=gi.to.line)}else{return gr}}}function cZ(gs,gk,gv,gu,gt){var gr=gt-bM(gk);var go=false,gB=2*gs.display.wrapper.clientWidth;var gy=a4(gs,gk);function gF(gH){var gI=dU(gs,W(gv,gH),"line",gk,gy);go=true;if(gr>gI.bottom){return gI.left-gB}else{if(gr<gI.top){return gI.left+gB}else{go=false}}return gI.left}var gx=a(gk),gA=gk.text.length;var gC=cE(gk),gl=cS(gk);var gz=gF(gC),gi=go,gj=gF(gl),gn=go;if(gu>gj){return f2(gv,gl,gn,1)}for(;;){if(gx?gl==gC||gl==u(gk,gC,1):gl-gC<=1){var gw=gu<gz||gu-gz<=gj-gu?gC:gl;var gE=gu-(gw==gC?gz:gj);while(fp(gk.text.charAt(gw))){++gw}var gq=f2(gv,gw,gw==gC?gi:gn,gE<-1?-1:gE>1?1:0);return gq}var gp=Math.ceil(gA/2),gG=gC+gp;if(gx){gG=gC;for(var gD=0;gD<gp;++gD){gG=u(gk,gG,1)}}var gm=gF(gG);if(gm>gu){gl=gG;gj=gm;if(gn=go){gj+=1000}gA=gp}else{gC=gG;gz=gm;gi=go;gA-=gp}}}var aH;function aY(gk){if(gk.cachedTextHeight!=null){return gk.cachedTextHeight}if(aH==null){aH=f3("pre");for(var gj=0;gj<49;++gj){aH.appendChild(document.createTextNode("x"));aH.appendChild(f3("br"))}aH.appendChild(document.createTextNode("x"))}bR(gk.measure,aH);var gi=aH.offsetHeight/50;if(gi>3){gk.cachedTextHeight=gi}d1(gk.measure);return gi||1}function dD(gm){if(gm.cachedCharWidth!=null){return gm.cachedCharWidth}var gi=f3("span","xxxxxxxxxx");var gl=f3("pre",[gi]);bR(gm.measure,gl);var gk=gi.getBoundingClientRect(),gj=(gk.right-gk.left)/10;if(gj>2){gm.cachedCharWidth=gj}return gj||10}var bp=null;var d8=0;function cI(gi){gi.curOp={cm:gi,viewChanged:false,startHeight:gi.doc.height,forceUpdate:false,updateInput:null,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:false,id:++d8};if(bp){bp.ops.push(gi.curOp)}else{gi.curOp.ownsGroup=bp={ops:[gi.curOp],delayedCallbacks:[]}}}function cU(gl){var gk=gl.delayedCallbacks,gj=0;do{for(;gj<gk.length;gj++){gk[gj]()}for(var gi=0;gi<gl.ops.length;gi++){var gm=gl.ops[gi];if(gm.cursorActivityHandlers){while(gm.cursorActivityCalled<gm.cursorActivityHandlers.length){gm.cursorActivityHandlers[gm.cursorActivityCalled++](gm.cm)}}}}while(gj<gk.length)}function am(gi){var gl=gi.curOp,gk=gl.ownsGroup;if(!gk){return}try{cU(gk)}finally{bp=null;for(var gj=0;gj<gk.ops.length;gj++){gk.ops[gj].cm.curOp=null}cK(gk)}}function cK(gk){var gj=gk.ops;for(var gi=0;gi<gj.length;gi++){b5(gj[gi])}for(var gi=0;gi<gj.length;gi++){aq(gj[gi])}for(var gi=0;gi<gj.length;gi++){b2(gj[gi])}for(var gi=0;gi<gj.length;gi++){ap(gj[gi])}for(var gi=0;gi<gj.length;gi++){e0(gj[gi])}}function b5(gk){var gi=gk.cm,gj=gi.display;J(gi);if(gk.updateMaxLine){h(gi)}gk.mustUpdate=gk.viewChanged||gk.forceUpdate||gk.scrollTop!=null||gk.scrollToPos&&(gk.scrollToPos.from.line<gj.viewFrom||gk.scrollToPos.to.line>=gj.viewTo)||gj.maxLineChanged&&gi.options.lineWrapping;gk.update=gk.mustUpdate&&new aI(gi,gk.mustUpdate&&{top:gk.scrollTop,ensure:gk.scrollToPos},gk.forceUpdate)}function aq(gi){gi.updatedDisplay=gi.mustUpdate&&B(gi.cm,gi.update)}function b2(gk){var gi=gk.cm,gj=gi.display;if(gk.updatedDisplay){a9(gi)}gk.barMeasure=dA(gi);if(gj.maxLineChanged&&!gi.options.lineWrapping){gk.adjustWidthTo=eh(gi,gj.maxLine,gj.maxLine.text.length).left+3;gi.display.sizerWidth=gk.adjustWidthTo;gk.barMeasure.scrollWidth=Math.max(gj.scroller.clientWidth,gj.sizer.offsetLeft+gk.adjustWidthTo+cT(gi)+gi.display.barWidth);gk.maxScrollLeft=Math.max(0,gj.sizer.offsetLeft+gk.adjustWidthTo-dl(gi))}if(gk.updatedDisplay||gk.selectionChanged){gk.preparedSelection=gj.input.prepareSelection()}}function ap(gj){var gi=gj.cm;if(gj.adjustWidthTo!=null){gi.display.sizer.style.minWidth=gj.adjustWidthTo+"px";if(gj.maxScrollLeft<gi.doc.scrollLeft){bE(gi,Math.min(gi.display.scroller.scrollLeft,gj.maxScrollLeft),true)}gi.display.maxLineChanged=false}if(gj.preparedSelection){gi.display.input.showSelection(gj.preparedSelection)}if(gj.updatedDisplay){dz(gi,gj.barMeasure)}if(gj.updatedDisplay||gj.startHeight!=gi.doc.height){eY(gi,gj.barMeasure)}if(gj.selectionChanged){o(gi)}if(gi.state.focused&&gj.updateInput){gi.display.input.reset(gj.typing)}if(gj.focus&&gj.focus==dO()){r(gj.cm)}}function e0(gp){var gi=gp.cm,gn=gi.display,gm=gi.doc;if(gp.updatedDisplay){cj(gi,gp.update)}if(gn.wheelStartX!=null&&(gp.scrollTop!=null||gp.scrollLeft!=null||gp.scrollToPos)){gn.wheelStartX=gn.wheelStartY=null}if(gp.scrollTop!=null&&(gn.scroller.scrollTop!=gp.scrollTop||gp.forceScroll)){gm.scrollTop=Math.max(0,Math.min(gn.scroller.scrollHeight-gn.scroller.clientHeight,gp.scrollTop));gn.scrollbars.setScrollTop(gm.scrollTop);gn.scroller.scrollTop=gm.scrollTop}if(gp.scrollLeft!=null&&(gn.scroller.scrollLeft!=gp.scrollLeft||gp.forceScroll)){gm.scrollLeft=Math.max(0,Math.min(gn.scroller.scrollWidth-dl(gi),gp.scrollLeft));gn.scrollbars.setScrollLeft(gm.scrollLeft);gn.scroller.scrollLeft=gm.scrollLeft;eE(gi)}if(gp.scrollToPos){var gl=D(gi,fJ(gm,gp.scrollToPos.from),fJ(gm,gp.scrollToPos.to),gp.scrollToPos.margin);if(gp.scrollToPos.isCursor&&gi.state.focused){d6(gi,gl)}}var gk=gp.maybeHiddenMarkers,go=gp.maybeUnhiddenMarkers;if(gk){for(var gj=0;gj<gk.length;++gj){if(!gk[gj].lines.length){aE(gk[gj],"hide")}}}if(go){for(var gj=0;gj<go.length;++gj){if(go[gj].lines.length){aE(go[gj],"unhide")}}}if(gn.wrapper.offsetHeight){gm.scrollTop=gi.display.scroller.scrollTop}if(gp.changeObjs){aE(gi,"changes",gi,gp.changeObjs)}if(gp.update){gp.update.finish()}}function cM(gi,gj){if(gi.curOp){return gj()}cI(gi);try{return gj()}finally{am(gi)}}function c2(gi,gj){return function(){if(gi.curOp){return gj.apply(gi,arguments)}cI(gi);try{return gj.apply(gi,arguments)}finally{am(gi)}}}function c8(gi){return function(){if(this.curOp){return gi.apply(this,arguments)}cI(this);try{return gi.apply(this,arguments)}finally{am(this)}}}function cD(gi){return function(){var gj=this.cm;if(!gj||gj.curOp){return gi.apply(this,arguments)}cI(gj);try{return gi.apply(this,arguments)}finally{am(gj)}}}function bv(gk,gi,gj){this.line=gi;this.rest=g(gi);this.size=this.rest?bN(fG(this.rest))-gj+1:1;this.node=this.text=null;this.hidden=fw(gk,gi)}function eV(gi,go,gn){var gm=[],gk;for(var gl=go;gl<gn;gl=gk){var gj=new bv(gi.doc,ff(gi.doc,gl),gl);gk=gl+gj.size;gm.push(gj)}return gm}function ah(gp,gn,go,gq){if(gn==null){gn=gp.doc.first}if(go==null){go=gp.doc.first+gp.doc.size}if(!gq){gq=0}var gk=gp.display;if(gq&&go<gk.viewTo&&(gk.updateLineNumbers==null||gk.updateLineNumbers>gn)){gk.updateLineNumbers=gn}gp.curOp.viewChanged=true;if(gn>=gk.viewTo){if(a7&&aW(gp.doc,gn)<gk.viewTo){ex(gp)}}else{if(go<=gk.viewFrom){if(a7&&d2(gp.doc,go+gq)>gk.viewFrom){ex(gp)}else{gk.viewFrom+=gq;gk.viewTo+=gq}}else{if(gn<=gk.viewFrom&&go>=gk.viewTo){ex(gp)}else{if(gn<=gk.viewFrom){var gm=de(gp,go,go+gq,1);if(gm){gk.view=gk.view.slice(gm.index);gk.viewFrom=gm.lineN;gk.viewTo+=gq}else{ex(gp)}}else{if(go>=gk.viewTo){var gm=de(gp,gn,gn,-1);if(gm){gk.view=gk.view.slice(0,gm.index);gk.viewTo=gm.lineN}else{ex(gp)}}else{var gl=de(gp,gn,gn,-1);var gj=de(gp,go,go+gq,1);if(gl&&gj){gk.view=gk.view.slice(0,gl.index).concat(eV(gp,gl.lineN,gj.lineN)).concat(gk.view.slice(gj.index));gk.viewTo+=gq}else{ex(gp)}}}}}}var gi=gk.externalMeasured;if(gi){if(go<gi.lineN){gi.lineN+=gq}else{if(gn<gi.lineN+gi.size){gk.externalMeasured=null}}}}function R(gj,gk,gn){gj.curOp.viewChanged=true;var go=gj.display,gm=gj.display.externalMeasured;if(gm&&gk>=gm.lineN&&gk<gm.lineN+gm.size){go.externalMeasured=null}if(gk<go.viewFrom||gk>=go.viewTo){return}var gl=go.view[dr(gj,gk)];if(gl.node==null){return}var gi=gl.changes||(gl.changes=[]);if(dh(gi,gn)==-1){gi.push(gn)}}function ex(gi){gi.display.viewFrom=gi.display.viewTo=gi.doc.first;gi.display.view=[];gi.display.viewOffset=0}function dr(gi,gl){if(gl>=gi.display.viewTo){return null}gl-=gi.display.viewFrom;if(gl<0){return null}var gj=gi.display.view;for(var gk=0;gk<gj.length;gk++){gl-=gj[gk].size;if(gl<0){return gk}}}function de(gq,gk,gm,gj){var gn=dr(gq,gk),gp,go=gq.display.view;if(!a7||gm==gq.doc.first+gq.doc.size){return{index:gn,lineN:gm}}for(var gl=0,gi=gq.display.viewFrom;gl<gn;gl++){gi+=go[gl].size}if(gi!=gk){if(gj>0){if(gn==go.length-1){return null}gp=(gi+go[gn].size)-gk;gn++}else{gp=gi-gk}gk+=gp;gm+=gp}while(aW(gq.doc,gm)!=gm){if(gn==(gj<0?0:go.length-1)){return null}gm+=gj*go[gn-(gj<0?1:0)].size;gn+=gj}return{index:gn,lineN:gm}}function cR(gi,gm,gl){var gk=gi.display,gj=gk.view;if(gj.length==0||gm>=gk.viewTo||gl<=gk.viewFrom){gk.view=eV(gi,gm,gl);gk.viewFrom=gm}else{if(gk.viewFrom>gm){gk.view=eV(gi,gm,gk.viewFrom).concat(gk.view)}else{if(gk.viewFrom<gm){gk.view=gk.view.slice(dr(gi,gm))}}gk.viewFrom=gm;if(gk.viewTo<gl){gk.view=gk.view.concat(eV(gi,gk.viewTo,gl))}else{if(gk.viewTo>gl){gk.view=gk.view.slice(0,dr(gi,gl))}}}gk.viewTo=gl}function db(gi){var gj=gi.display.view,gm=0;for(var gl=0;gl<gj.length;gl++){var gk=gj[gl];if(!gk.hidden&&(!gk.node||gk.changes)){++gm}}return gm}function fQ(gj){var gn=gj.display;bX(gn.scroller,"mousedown",c2(gj,eu));if(dK&&k<11){bX(gn.scroller,"dblclick",c2(gj,function(gr){if(aR(gj,gr)){return}var gs=cn(gj,gr);if(!gs||l(gj,gr)||bb(gj.display,gr)){return}cG(gr);var gq=gj.findWordAt(gs);fX(gj.doc,gq.anchor,gq.head)}))}else{bX(gn.scroller,"dblclick",function(gq){aR(gj,gq)||cG(gq)})}if(!ga){bX(gn.scroller,"contextmenu",function(gq){ay(gj,gq)})}var gp,gi={end:0};function go(){if(gn.activeTouch){gp=setTimeout(function(){gn.activeTouch=null},1000);gi=gn.activeTouch;gi.end=+new Date}}function gl(gq){if(gq.touches.length!=1){return false}var gr=gq.touches[0];return gr.radiusX<=1&&gr.radiusY<=1}function gk(gt,gq){if(gq.left==null){return true}var gs=gq.left-gt.left,gr=gq.top-gt.top;return gs*gs+gr*gr>20*20}bX(gn.scroller,"touchstart",function(gr){if(!gl(gr)){clearTimeout(gp);var gq=+new Date;gn.activeTouch={start:gq,moved:false,prev:gq-gi.end<=300?gi:null};if(gr.touches.length==1){gn.activeTouch.left=gr.touches[0].pageX;gn.activeTouch.top=gr.touches[0].pageY}}});bX(gn.scroller,"touchmove",function(){if(gn.activeTouch){gn.activeTouch.moved=true}});bX(gn.scroller,"touchend",function(gr){var gt=gn.activeTouch;if(gt&&!bb(gn,gr)&>.left!=null&&!gt.moved&&new Date-gt.start<300){var gs=gj.coordsChar(gn.activeTouch,"page"),gq;if(!gt.prev||gk(gt,gt.prev)){gq=new dY(gs,gs)}else{if(!gt.prev.prev||gk(gt,gt.prev.prev)){gq=gj.findWordAt(gs)}else{gq=new dY(W(gs.line,0),fJ(gj.doc,W(gs.line+1,0)))}}gj.setSelection(gq.anchor,gq.head);gj.focus();cG(gr)}go()});bX(gn.scroller,"touchcancel",go);bX(gn.scroller,"scroll",function(){if(gn.scroller.clientHeight){N(gj,gn.scroller.scrollTop);bE(gj,gn.scroller.scrollLeft,true);aE(gj,"scroll",gj)}});bX(gn.scroller,"mousewheel",function(gq){b(gj,gq)});bX(gn.scroller,"DOMMouseScroll",function(gq){b(gj,gq)});bX(gn.wrapper,"scroll",function(){gn.wrapper.scrollTop=gn.wrapper.scrollLeft=0});gn.dragFunctions={simple:function(gq){if(!aR(gj,gq)){er(gq)}},start:function(gq){Q(gj,gq)},drop:c2(gj,bk)};var gm=gn.input.getField();bX(gm,"keyup",function(gq){bi.call(gj,gq)});bX(gm,"keydown",c2(gj,p));bX(gm,"keypress",c2(gj,cx));bX(gm,"focus",cv(cB,gj));bX(gm,"blur",cv(aV,gj))}function f1(gj,gm,gk){var gn=gk&&gk!=H.Init;if(!gm!=!gn){var gl=gj.display.dragFunctions;var gi=gm?bX:ed;gi(gj.display.scroller,"dragstart",gl.start);gi(gj.display.scroller,"dragenter",gl.simple);gi(gj.display.scroller,"dragover",gl.simple);gi(gj.display.scroller,"drop",gl.drop)}}function aT(gi){var gj=gi.display;if(gj.lastWrapHeight==gj.wrapper.clientHeight&&gj.lastWrapWidth==gj.wrapper.clientWidth){return}gj.cachedCharWidth=gj.cachedTextHeight=gj.cachedPaddingH=null;gj.scrollbarsClipped=false;gi.setSize()}function bb(gj,gi){for(var gk=L(gi);gk!=gj.wrapper;gk=gk.parentNode){if(!gk||(gk.nodeType==1&&gk.getAttribute("cm-ignore-events")=="true")||(gk.parentNode==gj.sizer&&gk!=gj.mover)){return true}}}function cn(gr,gm,gj,gk){var gn=gr.display;if(!gj&&L(gm).getAttribute("cm-not-content")=="true"){return null}var gq,go,gi=gn.lineSpace.getBoundingClientRect();try{gq=gm.clientX-gi.left;go=gm.clientY-gi.top}catch(gm){return null}var gp=fO(gr,gq,go),gs;if(gk&&gp.xRel==1&&(gs=ff(gr.doc,gp.line).text).length==gp.ch){var gl=bT(gs,gs.length,gr.options.tabSize)-gs.length;gp=W(gp.line,Math.max(0,Math.round((gq-e5(gr.display).left)/dD(gr.display))-gl))}return gp}function eu(gk){var gi=this,gj=gi.display;if(gj.activeTouch&&gj.input.supportsTouch()||aR(gi,gk)){return}gj.shift=gk.shiftKey;if(bb(gj,gk)){if(!c0){gj.scroller.draggable=false;setTimeout(function(){gj.scroller.draggable=true},100)}return}if(l(gi,gk)){return}var gl=cn(gi,gk);window.focus();switch(fN(gk)){case 1:if(gl){ax(gi,gk,gl)}else{if(L(gk)==gj.scroller){cG(gk)}}break;case 2:if(c0){gi.state.lastMiddleDown=+new Date}if(gl){fX(gi.doc,gl)}setTimeout(function(){gj.input.focus()},20);cG(gk);break;case 3:if(ga){ay(gi,gk)}else{al(gi)}break}}var dn,dd;function ax(gj,go,gp){if(dK){setTimeout(cv(r,gj),0)}else{gj.curOp.focus=dO()}var gk=+new Date,gm;if(dd&&dd.time>gk-400&&cf(dd.pos,gp)==0){gm="triple"}else{if(dn&&dn.time>gk-400&&cf(dn.pos,gp)==0){gm="double";dd={time:gk,pos:gp}}else{gm="single";dn={time:gk,pos:gp}}}var gn=gj.doc.sel,gi=b7?go.metaKey:go.ctrlKey,gl;if(gj.options.dragDrop&&eL&&!aj(gj)&&gm=="single"&&(gl=gn.contains(gp))>-1&&(cf((gl=gn.ranges[gl]).from(),gp)<0||gp.xRel>0)&&(cf(gl.to(),gp)>0||gp.xRel<0)){a3(gj,go,gp,gi)}else{m(gj,go,gp,gm,gi)}}function a3(gk,gn,go,gj){var gm=gk.display,gl=+new Date;var gi=c2(gk,function(gp){if(c0){gm.scroller.draggable=false}gk.state.draggingText=false;ed(document,"mouseup",gi);ed(gm.scroller,"drop",gi);if(Math.abs(gn.clientX-gp.clientX)+Math.abs(gn.clientY-gp.clientY)<10){cG(gp);if(!gj&&+new Date-200<gl){fX(gk.doc,go)}if(c0||dK&&k==9){setTimeout(function(){document.body.focus();gm.input.focus()},20)}else{gm.input.focus()}}});if(c0){gm.scroller.draggable=true}gk.state.draggingText=gi;if(gm.scroller.dragDrop){gm.scroller.dragDrop()}bX(document,"mouseup",gi);bX(gm.scroller,"drop",gi)}function m(gm,gA,gl,gj,go){var gx=gm.display,gC=gm.doc;cG(gA);var gk,gB,gn=gC.sel,gi=gn.ranges;if(go&&!gA.shiftKey){gB=gC.sel.contains(gl);if(gB>-1){gk=gi[gB]}else{gk=new dY(gl,gl)}}else{gk=gC.sel.primary();gB=gC.sel.primIndex}if(gA.altKey){gj="rect";if(!go){gk=new dY(gl,gl)}gl=cn(gm,gA,true,true);gB=-1}else{if(gj=="double"){var gy=gm.findWordAt(gl);if(gm.display.shift||gC.extend){gk=fv(gC,gk,gy.anchor,gy.head)}else{gk=gy}}else{if(gj=="triple"){var gr=new dY(W(gl.line,0),fJ(gC,W(gl.line+1,0)));if(gm.display.shift||gC.extend){gk=fv(gC,gk,gr.anchor,gr.head)}else{gk=gr}}else{gk=fv(gC,gk,gl)}}}if(!go){gB=0;bU(gC,new f4([gk],0),M);gn=gC.sel}else{if(gB==-1){gB=gi.length;bU(gC,cw(gi.concat([gk]),gB),{scroll:false,origin:"*mouse"})}else{if(gi.length>1&&gi[gB].empty()&&gj=="single"&&!gA.shiftKey){bU(gC,cw(gi.slice(0,gB).concat(gi.slice(gB+1)),0));gn=gC.sel}else{e(gC,gB,gk,M)}}}var gw=gl;function gv(gN){if(cf(gw,gN)==0){return}gw=gN;if(gj=="rect"){var gE=[],gK=gm.options.tabSize;var gD=bT(ff(gC,gl.line).text,gl.ch,gK);var gQ=bT(ff(gC,gN.line).text,gN.ch,gK);var gF=Math.min(gD,gQ),gO=Math.max(gD,gQ);for(var gR=Math.min(gl.line,gN.line),gH=Math.min(gm.lastLine(),Math.max(gl.line,gN.line));gR<=gH;gR++){var gP=ff(gC,gR).text,gG=eq(gP,gF,gK);if(gF==gO){gE.push(new dY(W(gR,gG),W(gR,gG)))}else{if(gP.length>gG){gE.push(new dY(W(gR,gG),W(gR,eq(gP,gO,gK))))}}}if(!gE.length){gE.push(new dY(gl,gl))}bU(gC,cw(gn.ranges.slice(0,gB).concat(gE),gB),{origin:"*mouse",scroll:false});gm.scrollIntoView(gN)}else{var gL=gk;var gI=gL.anchor,gM=gN;if(gj!="single"){if(gj=="double"){var gJ=gm.findWordAt(gN)}else{var gJ=new dY(W(gN.line,0),fJ(gC,W(gN.line+1,0)))}if(cf(gJ.anchor,gI)>0){gM=gJ.head;gI=ar(gL.from(),gJ.anchor)}else{gM=gJ.anchor;gI=bx(gL.to(),gJ.head)}}var gE=gn.ranges.slice(0);gE[gB]=new dY(fJ(gC,gI),gM);bU(gC,cw(gE,gB),M)}}var gt=gx.wrapper.getBoundingClientRect();var gp=0;function gz(gF){var gD=++gp;var gH=cn(gm,gF,true,gj=="rect");if(!gH){return}if(cf(gH,gw)!=0){gm.curOp.focus=dO();gv(gH);var gG=b6(gx,gC);if(gH.line>=gG.to||gH.line<gG.from){setTimeout(c2(gm,function(){if(gp==gD){gz(gF)}}),150)}}else{var gE=gF.clientY<gt.top?-20:gF.clientY>gt.bottom?20:0;if(gE){setTimeout(c2(gm,function(){if(gp!=gD){return}gx.scroller.scrollTop+=gE;gz(gF)}),50)}}}function gs(gD){gp=Infinity;cG(gD);gx.input.focus();ed(document,"mousemove",gu);ed(document,"mouseup",gq);gC.history.lastSelOrigin=null}var gu=c2(gm,function(gD){if(!fN(gD)){gs(gD)}else{gz(gD)}});var gq=c2(gm,gs);bX(document,"mousemove",gu);bX(document,"mouseup",gq)}function gg(gt,gp,gr,gs,gl){try{var gj=gp.clientX,gi=gp.clientY}catch(gp){return false}if(gj>=Math.floor(gt.display.gutters.getBoundingClientRect().right)){return false}if(gs){cG(gp)}var gq=gt.display;var go=gq.lineDiv.getBoundingClientRect();if(gi>go.bottom||!fi(gt,gr)){return bL(gp)}gi-=go.top-gq.viewOffset;for(var gm=0;gm<gt.options.gutters.length;++gm){var gn=gq.gutters.childNodes[gm];if(gn&&gn.getBoundingClientRect().right>=gj){var gu=bG(gt.doc,gi);var gk=gt.options.gutters[gm];gl(gt,gr,gt,gu,gk,gp);return bL(gp)}}}function l(gi,gj){return gg(gi,gj,"gutterClick",true,ae)}var ag=0;function bk(go){var gq=this;if(aR(gq,go)||bb(gq.display,go)){return}cG(go);if(dK){ag=+new Date}var gp=cn(gq,go,true),gi=go.dataTransfer.files;if(!gp||aj(gq)){return}if(gi&&gi.length&&window.FileReader&&window.File){var gk=gi.length,gr=Array(gk),gj=0;var gm=function(gu,gt){var gs=new FileReader;gs.onload=c2(gq,function(){gr[gt]=gs.result;if(++gj==gk){gp=fJ(gq.doc,gp);var gv={from:gp,to:gp,text:gq.doc.splitLines(gr.join(gq.doc.lineSeparator())),origin:"paste"};bg(gq.doc,gv);e7(gq.doc,eS(gp,cX(gv)))}});gs.readAsText(gu)};for(var gn=0;gn<gk;++gn){gm(gi[gn],gn)}}else{if(gq.state.draggingText&&gq.doc.sel.contains(gp)>-1){gq.state.draggingText(go);setTimeout(function(){gq.display.input.focus()},20);return}try{var gr=go.dataTransfer.getData("Text");if(gr){if(gq.state.draggingText&&!(b7?go.altKey:go.ctrlKey)){var gl=gq.listSelections()}ep(gq.doc,eS(gp,gp));if(gl){for(var gn=0;gn<gl.length;++gn){a1(gq.doc,"",gl[gn].anchor,gl[gn].head,"drag")}}gq.replaceSelection(gr,"around","paste");gq.display.input.focus()}}catch(go){}}}function Q(gi,gk){if(dK&&(!gi.state.draggingText||+new Date-ag<100)){er(gk);return}if(aR(gi,gk)||bb(gi.display,gk)){return}gk.dataTransfer.setData("Text",gi.getSelection());if(gk.dataTransfer.setDragImage&&!aC){var gj=f3("img",null,null,"position: fixed; left: 0; top: 0;");gj.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(d3){gj.width=gj.height=1;gi.display.wrapper.appendChild(gj);gj._top=gj.offsetTop}gk.dataTransfer.setDragImage(gj,0,0);if(d3){gj.parentNode.removeChild(gj)}}}function N(gi,gj){if(Math.abs(gi.doc.scrollTop-gj)<2){return}gi.doc.scrollTop=gj;if(!co){dT(gi,{top:gj})}if(gi.display.scroller.scrollTop!=gj){gi.display.scroller.scrollTop=gj}gi.display.scrollbars.setScrollTop(gj);if(co){dT(gi)}ef(gi,100)}function bE(gi,gk,gj){if(gj?gk==gi.doc.scrollLeft:Math.abs(gi.doc.scrollLeft-gk)<2){return}gk=Math.min(gk,gi.display.scroller.scrollWidth-gi.display.scroller.clientWidth);gi.doc.scrollLeft=gk;eE(gi);if(gi.display.scroller.scrollLeft!=gk){gi.display.scroller.scrollLeft=gk}gi.display.scrollbars.setScrollLeft(gk)}var fm=0,cg=null;if(dK){cg=-0.53}else{if(co){cg=15}else{if(dc){cg=-0.7}else{if(aC){cg=-1/3}}}}var cQ=function(gk){var gj=gk.wheelDeltaX,gi=gk.wheelDeltaY;if(gj==null&&gk.detail&&gk.axis==gk.HORIZONTAL_AXIS){gj=gk.detail}if(gi==null&&gk.detail&&gk.axis==gk.VERTICAL_AXIS){gi=gk.detail}else{if(gi==null){gi=gk.wheelDelta}}return{x:gj,y:gi}};H.wheelEventPixels=function(gi){var gj=cQ(gi);gj.x*=cg;gj.y*=cg;return gj};function b(gq,gk){var gr=cQ(gk),gu=gr.x,gt=gr.y;var gm=gq.display,gp=gm.scroller;if(!(gu&&gp.scrollWidth>gp.clientWidth||gt&&gp.scrollHeight>gp.clientHeight)){return}if(gt&&b7&&c0){outer:for(var gs=gk.target,go=gm.view;gs!=gp;gs=gs.parentNode){for(var gj=0;gj<go.length;gj++){if(go[gj].node==gs){gq.display.currentWheelTarget=gs;break outer}}}}if(gu&&!co&&!d3&&cg!=null){if(gt){N(gq,Math.max(0,Math.min(gp.scrollTop+gt*cg,gp.scrollHeight-gp.clientHeight)))}bE(gq,Math.max(0,Math.min(gp.scrollLeft+gu*cg,gp.scrollWidth-gp.clientWidth)));cG(gk);gm.wheelStartX=null;return}if(gt&&cg!=null){var gi=gt*cg;var gn=gq.doc.scrollTop,gl=gn+gm.wrapper.clientHeight;if(gi<0){gn=Math.max(0,gn+gi-50)}else{gl=Math.min(gq.doc.height,gl+gi+50)}dT(gq,{top:gn,bottom:gl})}if(fm<20){if(gm.wheelStartX==null){gm.wheelStartX=gp.scrollLeft;gm.wheelStartY=gp.scrollTop;gm.wheelDX=gu;gm.wheelDY=gt;setTimeout(function(){if(gm.wheelStartX==null){return}var gv=gp.scrollLeft-gm.wheelStartX;var gx=gp.scrollTop-gm.wheelStartY;var gw=(gx&&gm.wheelDY&&gx/gm.wheelDY)||(gv&&gm.wheelDX&&gv/gm.wheelDX);gm.wheelStartX=gm.wheelStartY=null;if(!gw){return}cg=(cg*fm+gw)/(fm+1);++fm},200)}else{gm.wheelDX+=gu;gm.wheelDY+=gt}}}function fR(gj,gm,gi){if(typeof gm=="string"){gm=eD[gm];if(!gm){return false}}gj.display.input.ensurePolled();var gl=gj.display.shift,gk=false;try{if(aj(gj)){gj.state.suppressEdits=true}if(gi){gj.display.shift=false}gk=gm(gj)!=ca}finally{gj.display.shift=gl;gj.state.suppressEdits=false}return gk}function ea(gj,gk,gm){for(var gl=0;gl<gj.state.keyMaps.length;gl++){var gi=i(gk,gj.state.keyMaps[gl],gm,gj);if(gi){return gi}}return(gj.options.extraKeys&&i(gk,gj.options.extraKeys,gm,gj))||i(gk,gj.options.keyMap,gm,gj)}var dM=new gh;function bd(gj,gl,gn,gm){var gk=gj.state.keySeq;if(gk){if(eC(gl)){return"handled"}dM.set(50,function(){if(gj.state.keySeq==gk){gj.state.keySeq=null;gj.display.input.reset()}});gl=gk+" "+gl}var gi=ea(gj,gl,gm);if(gi=="multi"){gj.state.keySeq=gl}if(gi=="handled"){ae(gj,"keyHandled",gj,gl,gn)}if(gi=="handled"||gi=="multi"){cG(gn);o(gj)}if(gk&&!gi&&/\'$/.test(gl)){cG(gn);return true}return !!gi}function fj(gi,gk){var gj=fr(gk,true);if(!gj){return false}if(gk.shiftKey&&!gi.state.keySeq){return bd(gi,"Shift-"+gj,gk,function(gl){return fR(gi,gl,true)})||bd(gi,gj,gk,function(gl){if(typeof gl=="string"?/^go[A-Z]/.test(gl):gl.motion){return fR(gi,gl)}})}else{return bd(gi,gj,gk,function(gl){return fR(gi,gl)})}}function ej(gi,gk,gj){return bd(gi,"'"+gj+"'",gk,function(gl){return fR(gi,gl,true)})}var dm=null;function p(gl){var gi=this;gi.curOp.focus=dO();if(aR(gi,gl)){return}if(dK&&k<11&&gl.keyCode==27){gl.returnValue=false}var gj=gl.keyCode;gi.display.shift=gj==16||gl.shiftKey;var gk=fj(gi,gl);if(d3){dm=gk?gj:null;if(!gk&&gj==88&&!da&&(b7?gl.metaKey:gl.ctrlKey)){gi.replaceSelection("",null,"cut")}}if(gj==18&&!/\bCodeMirror-crosshair\b/.test(gi.display.lineDiv.className)){av(gi)}}function av(gj){var gk=gj.display.lineDiv;fA(gk,"CodeMirror-crosshair");function gi(gl){if(gl.keyCode==18||!gl.altKey){f(gk,"CodeMirror-crosshair");ed(document,"keyup",gi);ed(document,"mouseover",gi)}}bX(document,"keyup",gi);bX(document,"mouseover",gi)}function bi(gi){if(gi.keyCode==16){this.doc.sel.shift=false}aR(this,gi)}function cx(gm){var gi=this;if(bb(gi.display,gm)||aR(gi,gm)||gm.ctrlKey&&!gm.altKey||b7&&gm.metaKey){return}var gl=gm.keyCode,gj=gm.charCode;if(d3&&gl==dm){dm=null;cG(gm);return}if((d3&&(!gm.which||gm.which<10))&&fj(gi,gm)){return}var gk=String.fromCharCode(gj==null?gl:gj);if(ej(gi,gm,gk)){return}gi.display.input.onKeyPress(gm)}function al(gi){gi.state.delayingBlurEvent=true;setTimeout(function(){if(gi.state.delayingBlurEvent){gi.state.delayingBlurEvent=false;aV(gi)}},100)}function cB(gi){if(gi.state.delayingBlurEvent){gi.state.delayingBlurEvent=false}if(gi.options.readOnly=="nocursor"){return}if(!gi.state.focused){aE(gi,"focus",gi);gi.state.focused=true;fA(gi.display.wrapper,"CodeMirror-focused");if(!gi.curOp&&gi.display.selForContextMenu!=gi.doc.sel){gi.display.input.reset();if(c0){setTimeout(function(){gi.display.input.reset(true)},20)}}gi.display.input.receivedFocus()}o(gi)}function aV(gi){if(gi.state.delayingBlurEvent){return}if(gi.state.focused){aE(gi,"blur",gi);gi.state.focused=false;f(gi.display.wrapper,"CodeMirror-focused")}clearInterval(gi.display.blinker);setTimeout(function(){if(!gi.state.focused){gi.display.shift=false}},150)}function ay(gi,gj){if(bb(gi.display,gj)||dg(gi,gj)){return}gi.display.input.onContextMenu(gj)}function dg(gi,gj){if(!fi(gi,"gutterContextMenu")){return false}return gg(gi,gj,"gutterContextMenu",false,aE)}var cX=H.changeEnd=function(gi){if(!gi.text){return gi.to}return W(gi.from.line+gi.text.length-1,fG(gi.text).length+(gi.text.length==1?gi.from.ch:0))};function bZ(gl,gk){if(cf(gl,gk.from)<0){return gl}if(cf(gl,gk.to)<=0){return cX(gk)}var gi=gl.line+gk.text.length-(gk.to.line-gk.from.line)-1,gj=gl.ch;if(gl.line==gk.to.line){gj+=cX(gk).ch-gk.to.ch}return W(gi,gj)}function fk(gl,gm){var gj=[];for(var gk=0;gk<gl.sel.ranges.length;gk++){var gi=gl.sel.ranges[gk];gj.push(new dY(bZ(gi.anchor,gm),bZ(gi.head,gm)))}return cw(gj,gl.sel.primIndex)}function bu(gk,gj,gi){if(gk.line==gj.line){return W(gi.line,gk.ch-gj.ch+gi.ch)}else{return W(gi.line+(gk.line-gj.line),gk.ch)}}function af(gs,gp,gj){var gk=[];var gi=W(gs.first,0),gt=gi;for(var gm=0;gm<gp.length;gm++){var go=gp[gm];var gr=bu(go.from,gi,gt);var gq=bu(cX(go),gi,gt);gi=go.to;gt=gq;if(gj=="around"){var gn=gs.sel.ranges[gm],gl=cf(gn.head,gn.anchor)<0;gk[gm]=new dY(gl?gq:gr,gl?gr:gq)}else{gk[gm]=new dY(gr,gr)}}return new f4(gk,gs.sel.primIndex)}function dR(gj,gl,gk){var gi={canceled:false,from:gl.from,to:gl.to,text:gl.text,origin:gl.origin,cancel:function(){this.canceled=true}};if(gk){gi.update=function(gp,go,gn,gm){if(gp){this.from=fJ(gj,gp)}if(go){this.to=fJ(gj,go)}if(gn){this.text=gn}if(gm!==undefined){this.origin=gm}}}aE(gj,"beforeChange",gj,gi);if(gj.cm){aE(gj.cm,"beforeChange",gj.cm,gi)}if(gi.canceled){return null}return{from:gi.from,to:gi.to,text:gi.text,origin:gi.origin}}function bg(gl,gm,gk){if(gl.cm){if(!gl.cm.curOp){return c2(gl.cm,bg)(gl,gm,gk)}if(gl.cm.state.suppressEdits){return}}if(fi(gl,"beforeChange")||gl.cm&&fi(gl.cm,"beforeChange")){gm=dR(gl,gm,true);if(!gm){return}}var gj=gd&&!gk&&cH(gl,gm.from,gm.to);if(gj){for(var gi=gj.length-1;gi>=0;--gi){K(gl,{from:gj[gi].from,to:gj[gi].to,text:gi?[""]:gm.text})}}else{K(gl,gm)}}function K(gk,gl){if(gl.text.length==1&&gl.text[0]==""&&cf(gl.from,gl.to)==0){return}var gj=fk(gk,gl);fM(gk,gl,gj,gk.cm?gk.cm.curOp.id:NaN);ee(gk,gl,gj,ek(gk,gl));var gi=[];d7(gk,function(gn,gm){if(!gm&&dh(gi,gn.history)==-1){dE(gn.history,gl);gi.push(gn.history)}ee(gn,gl,null,ek(gn,gl))})}function b8(gt,gr,gv){if(gt.cm&>.cm.state.suppressEdits){return}var gq=gt.history,gk,gm=gt.sel;var gi=gr=="undo"?gq.done:gq.undone,gu=gr=="undo"?gq.undone:gq.done;for(var gn=0;gn<gi.length;gn++){gk=gi[gn];if(gv?gk.ranges&&!gk.equals(gt.sel):!gk.ranges){break}}if(gn==gi.length){return}gq.lastOrigin=gq.lastSelOrigin=null;for(;;){gk=gi.pop();if(gk.ranges){cN(gk,gu);if(gv&&!gk.equals(gt.sel)){bU(gt,gk,{clearRedo:false});return}gm=gk}else{break}}var gp=[];cN(gm,gu);gu.push({changes:gp,generation:gq.generation});gq.generation=gk.generation||++gq.maxGeneration;var gl=fi(gt,"beforeChange")||gt.cm&&fi(gt.cm,"beforeChange");for(var gn=gk.changes.length-1;gn>=0;--gn){var gs=gk.changes[gn];gs.origin=gr;if(gl&&!dR(gt,gs,false)){gi.length=0;return}gp.push(du(gt,gs));var gj=gn?fk(gt,gs):fG(gi);ee(gt,gs,gj,d9(gt,gs));if(!gn&>.cm){gt.cm.scrollIntoView({from:gs.from,to:cX(gs)})}var go=[];d7(gt,function(gx,gw){if(!gw&&dh(go,gx.history)==-1){dE(gx.history,gs);go.push(gx.history)}ee(gx,gs,null,d9(gx,gs))})}}function fn(gj,gl){if(gl==0){return}gj.first+=gl;gj.sel=new f4(bS(gj.sel.ranges,function(gm){return new dY(W(gm.anchor.line+gl,gm.anchor.ch),W(gm.head.line+gl,gm.head.ch))}),gj.sel.primIndex);if(gj.cm){ah(gj.cm,gj.first,gj.first-gl,gl);for(var gk=gj.cm.display,gi=gk.viewFrom;gi<gk.viewTo;gi++){R(gj.cm,gi,"gutter")}}}function ee(gm,gn,gl,gj){if(gm.cm&&!gm.cm.curOp){return c2(gm.cm,ee)(gm,gn,gl,gj)}if(gn.to.line<gm.first){fn(gm,gn.text.length-1-(gn.to.line-gn.from.line));return}if(gn.from.line>gm.lastLine()){return}if(gn.from.line<gm.first){var gi=gn.text.length-1-(gm.first-gn.from.line);fn(gm,gi);gn={from:W(gm.first,0),to:W(gn.to.line+gi,gn.to.ch),text:[fG(gn.text)],origin:gn.origin}}var gk=gm.lastLine();if(gn.to.line>gk){gn={from:gn.from,to:W(gk,ff(gm,gk).text.length),text:[gn.text[0]],origin:gn.origin}}gn.removed=f5(gm,gn.from,gn.to);if(!gl){gl=fk(gm,gn)}if(gm.cm){aJ(gm.cm,gn,gj)}else{fy(gm,gn,gj)}ep(gm,gl,Z)}function aJ(gt,gp,gn){var gs=gt.doc,go=gt.display,gq=gp.from,gr=gp.to;var gi=false,gm=gq.line;if(!gt.options.lineWrapping){gm=bN(y(ff(gs,gq.line)));gs.iter(gm,gr.line+1,function(gv){if(gv==go.maxLine){gi=true;return true}})}if(gs.sel.contains(gp.from,gp.to)>-1){V(gt)}fy(gs,gp,gn,be(gt));if(!gt.options.lineWrapping){gs.iter(gm,gq.line+gp.text.length,function(gw){var gv=en(gw);if(gv>go.maxLineLength){go.maxLine=gw;go.maxLineLength=gv;go.maxLineChanged=true;gi=false}});if(gi){gt.curOp.updateMaxLine=true}}gs.frontier=Math.min(gs.frontier,gq.line);ef(gt,400);var gu=gp.text.length-(gr.line-gq.line)-1;if(gp.full){ah(gt)}else{if(gq.line==gr.line&&gp.text.length==1&&!dS(gt.doc,gp)){R(gt,gq.line,"text")}else{ah(gt,gq.line,gr.line+1,gu)}}var gk=fi(gt,"changes"),gl=fi(gt,"change");if(gl||gk){var gj={from:gq,to:gr,text:gp.text,removed:gp.removed,origin:gp.origin};if(gl){ae(gt,"change",gt,gj)}if(gk){(gt.curOp.changeObjs||(gt.curOp.changeObjs=[])).push(gj)}}gt.display.selForContextMenu=null}function a1(gl,gk,gn,gm,gi){if(!gm){gm=gn}if(cf(gm,gn)<0){var gj=gm;gm=gn;gn=gj}if(typeof gk=="string"){gk=gl.splitLines(gk)}bg(gl,{from:gn,to:gm,text:gk,origin:gi})}function d6(gj,gm){if(aR(gj,"scrollCursorIntoView")){return}var gn=gj.display,gk=gn.sizer.getBoundingClientRect(),gi=null;if(gm.top+gk.top<0){gi=true}else{if(gm.bottom+gk.top>(window.innerHeight||document.documentElement.clientHeight)){gi=false}}if(gi!=null&&!fu){var gl=f3("div","\u200b",null,"position: absolute; top: "+(gm.top-gn.viewOffset-e8(gj.display))+"px; height: "+(gm.bottom-gm.top+cT(gj)+gn.barHeight)+"px; left: "+gm.left+"px; width: 2px;");gj.display.lineSpace.appendChild(gl);gl.scrollIntoView(gi);gj.display.lineSpace.removeChild(gl)}}function D(gs,gq,gm,gl){if(gl==null){gl=0}for(var gn=0;gn<5;gn++){var go=false,gr=dU(gs,gq);var gi=!gm||gm==gq?gr:dU(gs,gm);var gk=G(gs,Math.min(gr.left,gi.left),Math.min(gr.top,gi.top)-gl,Math.max(gr.left,gi.left),Math.max(gr.bottom,gi.bottom)+gl);var gp=gs.doc.scrollTop,gj=gs.doc.scrollLeft;if(gk.scrollTop!=null){N(gs,gk.scrollTop);if(Math.abs(gs.doc.scrollTop-gp)>1){go=true}}if(gk.scrollLeft!=null){bE(gs,gk.scrollLeft);if(Math.abs(gs.doc.scrollLeft-gj)>1){go=true}}if(!go){break}}return gr}function E(gi,gk,gm,gj,gl){var gn=G(gi,gk,gm,gj,gl);if(gn.scrollTop!=null){N(gi,gn.scrollTop)}if(gn.scrollLeft!=null){bE(gi,gn.scrollLeft)}}function G(gu,gl,gt,gj,gs){var gq=gu.display,go=aY(gu.display);if(gt<0){gt=0}var gm=gu.curOp&&gu.curOp.scrollTop!=null?gu.curOp.scrollTop:gq.scroller.scrollTop;var gw=cV(gu),gy={};if(gs-gt>gw){gs=gt+gw}var gk=gu.doc.height+bI(gq);var gi=gt<go,gp=gs>gk-go;if(gt<gm){gy.scrollTop=gi?0:gt}else{if(gs>gm+gw){var gr=Math.min(gt,(gp?gk:gs)-gw);if(gr!=gm){gy.scrollTop=gr}}}var gx=gu.curOp&&gu.curOp.scrollLeft!=null?gu.curOp.scrollLeft:gq.scroller.scrollLeft;var gv=dl(gu)-(gu.options.fixedGutter?gq.gutters.offsetWidth:0);var gn=gj-gl>gv;if(gn){gj=gl+gv}if(gl<10){gy.scrollLeft=0}else{if(gl<gx){gy.scrollLeft=Math.max(0,gl-(gn?0:10))}else{if(gj>gv+gx-3){gy.scrollLeft=gj+(gn?0:10)-gv}}}return gy}function cL(gi,gk,gj){if(gk!=null||gj!=null){fC(gi)}if(gk!=null){gi.curOp.scrollLeft=(gi.curOp.scrollLeft==null?gi.doc.scrollLeft:gi.curOp.scrollLeft)+gk}if(gj!=null){gi.curOp.scrollTop=(gi.curOp.scrollTop==null?gi.doc.scrollTop:gi.curOp.scrollTop)+gj}}function fF(gi){fC(gi);var gj=gi.getCursor(),gl=gj,gk=gj;if(!gi.options.lineWrapping){gl=gj.ch?W(gj.line,gj.ch-1):gj;gk=W(gj.line,gj.ch+1)}gi.curOp.scrollToPos={from:gl,to:gk,margin:gi.options.cursorScrollMargin,isCursor:true}}function fC(gi){var gk=gi.curOp.scrollToPos;if(gk){gi.curOp.scrollToPos=null;var gm=dH(gi,gk.from),gl=dH(gi,gk.to);var gj=G(gi,Math.min(gm.left,gl.left),Math.min(gm.top,gl.top)-gk.margin,Math.max(gm.right,gl.right),Math.max(gm.bottom,gl.bottom)+gk.margin);gi.scrollTo(gj.scrollLeft,gj.scrollTop)}}function ad(gv,gl,gu,gk){var gt=gv.doc,gj;if(gu==null){gu="add"}if(gu=="smart"){if(!gt.mode.indent){gu="prev"}else{gj=dC(gv,gl)}}var gp=gv.options.tabSize;var gw=ff(gt,gl),go=bT(gw.text,null,gp);if(gw.stateAfter){gw.stateAfter=null}var gi=gw.text.match(/^\s*/)[0],gr;if(!gk&&!/\S/.test(gw.text)){gr=0;gu="not"}else{if(gu=="smart"){gr=gt.mode.indent(gj,gw.text.slice(gi.length),gw.text);if(gr==ca||gr>150){if(!gk){return}gu="prev"}}}if(gu=="prev"){if(gl>gt.first){gr=bT(ff(gt,gl-1).text,null,gp)}else{gr=0}}else{if(gu=="add"){gr=go+gv.options.indentUnit}else{if(gu=="subtract"){gr=go-gv.options.indentUnit}else{if(typeof gu=="number"){gr=go+gu}}}}gr=Math.max(0,gr);var gs="",gq=0;if(gv.options.indentWithTabs){for(var gm=Math.floor(gr/gp);gm;--gm){gq+=gp;gs+="\t"}}if(gq<gr){gs+=cp(gr-gq)}if(gs!=gi){a1(gt,gs,W(gl,0),W(gl,gi.length),"+input");gw.stateAfter=null;return true}else{for(var gm=0;gm<gt.sel.ranges.length;gm++){var gn=gt.sel.ranges[gm];if(gn.head.line==gl&&gn.head.ch<gi.length){var gq=W(gl,gi.length);e(gt,gm,new dY(gq,gq));break}}}}function ez(gl,gk,gi,gn){var gm=gk,gj=gk;if(typeof gk=="number"){gj=ff(gl,c5(gl,gk))}else{gm=bN(gk)}if(gm==null){return null}if(gn(gj,gm)&&gl.cm){R(gl.cm,gm,gi)}return gj}function eX(gi,go){var gj=gi.doc.sel.ranges,gm=[];for(var gl=0;gl<gj.length;gl++){var gk=go(gj[gl]);while(gm.length&&cf(gk.from,fG(gm).to)<=0){var gn=gm.pop();if(cf(gn.from,gk.from)<0){gk.from=gn.from;break}}gm.push(gk)}cM(gi,function(){for(var gp=gm.length-1;gp>=0;gp--){a1(gi.doc,"",gm[gp].from,gm[gp].to,"+delete")}fF(gi)})}function bw(gA,gm,gu,gt,go){var gr=gm.line,gs=gm.ch,gz=gu;var gj=ff(gA,gr);var gx=true;function gy(){var gB=gr+gu;if(gB<gA.first||gB>=gA.first+gA.size){return(gx=false)}gr=gB;return gj=ff(gA,gB)}function gw(gC){var gB=(go?u:ai)(gj,gs,gu,true);if(gB==null){if(!gC&&gy()){if(go){gs=(gu<0?cS:cE)(gj)}else{gs=gu<0?gj.text.length:0}}else{return(gx=false)}}else{gs=gB}return true}if(gt=="char"){gw()}else{if(gt=="column"){gw(true)}else{if(gt=="word"||gt=="group"){var gv=null,gp=gt=="group";var gi=gA.cm&&gA.cm.getHelper(gm,"wordChars");for(var gn=true;;gn=false){if(gu<0&&!gw(!gn)){break}var gk=gj.text.charAt(gs)||"\n";var gl=cA(gk,gi)?"w":gp&&gk=="\n"?"n":!gp||/\s/.test(gk)?null:"p";if(gp&&!gn&&!gl){gl="s"}if(gv&&gv!=gl){if(gu<0){gu=1;gw()}break}if(gl){gv=gl}if(gu>0&&!gw(!gn)){break}}}}}var gq=bV(gA,W(gr,gs),gz,true);if(!gx){gq.hitSide=true}return gq}function bq(gq,gl,gi,gp){var go=gq.doc,gn=gl.left,gm;if(gp=="page"){var gk=Math.min(gq.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);gm=gl.top+gi*(gk-(gi<0?1.5:0.5)*aY(gq.display))}else{if(gp=="line"){gm=gi>0?gl.bottom+3:gl.top-3}}for(;;){var gj=fO(gq,gn,gm);if(!gj.outside){break}if(gi<0?gm<=0:gm>=go.height){gj.hitSide=true;break}gm+=gi*5}return gj}H.prototype={constructor:H,focus:function(){window.focus();this.display.input.focus()},setOption:function(gk,gl){var gj=this.options,gi=gj[gk];if(gj[gk]==gl&&gk!="mode"){return}gj[gk]=gl;if(bf.hasOwnProperty(gk)){c2(this,bf[gk])(this,gl,gi)}},getOption:function(gi){return this.options[gi]},getDoc:function(){return this.doc},addKeyMap:function(gj,gi){this.state.keyMaps[gi?"push":"unshift"](fY(gj))},removeKeyMap:function(gj){var gk=this.state.keyMaps;for(var gi=0;gi<gk.length;++gi){if(gk[gi]==gj||gk[gi].name==gj){gk.splice(gi,1);return true}}},addOverlay:c8(function(gi,gj){var gk=gi.token?gi:H.getMode(this.options,gi);if(gk.startState){throw new Error("Overlays may not be stateful.")}this.state.overlays.push({mode:gk,modeSpec:gi,opaque:gj&&gj.opaque});this.state.modeGen++;ah(this)}),removeOverlay:c8(function(gi){var gk=this.state.overlays;for(var gj=0;gj<gk.length;++gj){var gl=gk[gj].modeSpec;if(gl==gi||typeof gi=="string"&&gl.name==gi){gk.splice(gj,1);this.state.modeGen++;ah(this);return}}}),indentLine:c8(function(gk,gi,gj){if(typeof gi!="string"&&typeof gi!="number"){if(gi==null){gi=this.options.smartIndent?"smart":"prev"}else{gi=gi?"add":"subtract"}}if(b9(this.doc,gk)){ad(this,gk,gi,gj)}}),indentSelection:c8(function(gr){var gi=this.doc.sel.ranges,gl=-1;for(var gn=0;gn<gi.length;gn++){var go=gi[gn];if(!go.empty()){var gp=go.from(),gq=go.to();var gj=Math.max(gl,gp.line);gl=Math.min(this.lastLine(),gq.line-(gq.ch?0:1))+1;for(var gm=gj;gm<gl;++gm){ad(this,gm,gr)}var gk=this.doc.sel.ranges;if(gp.ch==0&&gi.length==gk.length&&gk[gn].from().ch>0){e(this.doc,gn,new dY(gp,gk[gn].to()),Z)}}else{if(go.head.line>gl){ad(this,go.head.line,gr,true);gl=go.head.line;if(gn==this.doc.sel.primIndex){fF(this)}}}}}),getTokenAt:function(gj,gi){return cq(this,gj,gi)},getLineTokens:function(gj,gi){return cq(this,W(gj),gi,true)},getTokenTypeAt:function(gp){gp=fJ(this.doc,gp);var gl=c6(this,ff(this.doc,gp.line));var gn=0,go=(gl.length-1)/2,gk=gp.ch;var gj;if(gk==0){gj=gl[2]}else{for(;;){var gi=(gn+go)>>1;if((gi?gl[gi*2-1]:0)>=gk){go=gi}else{if(gl[gi*2+1]<gk){gn=gi+1}else{gj=gl[gi*2+2];break}}}}var gm=gj?gj.indexOf("cm-overlay "):-1;return gm<0?gj:gm==0?null:gj.slice(0,gm-1)},getModeAt:function(gj){var gi=this.doc.mode;if(!gi.innerMode){return gi}return H.innerMode(gi,this.getTokenAt(gj).state).mode},getHelper:function(gj,gi){return this.getHelpers(gj,gi)[0]},getHelpers:function(gp,gk){var gl=[];if(!fo.hasOwnProperty(gk)){return gl}var gi=fo[gk],go=this.getModeAt(gp);if(typeof go[gk]=="string"){if(gi[go[gk]]){gl.push(gi[go[gk]])}}else{if(go[gk]){for(var gj=0;gj<go[gk].length;gj++){var gn=gi[go[gk][gj]];if(gn){gl.push(gn)}}}else{if(go.helperType&&gi[go.helperType]){gl.push(gi[go.helperType])}else{if(gi[go.name]){gl.push(gi[go.name])}}}}for(var gj=0;gj<gi._global.length;gj++){var gm=gi._global[gj];if(gm.pred(go,this)&&dh(gl,gm.val)==-1){gl.push(gm.val)}}return gl},getStateAfter:function(gj,gi){var gk=this.doc;gj=c5(gk,gj==null?gk.first+gk.size-1:gj);return dC(this,gj+1,gi)},cursorCoords:function(gl,gj){var gk,gi=this.doc.sel.primary();if(gl==null){gk=gi.head}else{if(typeof gl=="object"){gk=fJ(this.doc,gl)}else{gk=gl?gi.from():gi.to()}}return dU(this,gk,gj||"page")},charCoords:function(gj,gi){return cJ(this,fJ(this.doc,gj),gi||"page")},coordsChar:function(gi,gj){gi=gf(this,gi,gj||"page");return fO(this,gi.left,gi.top)},lineAtHeight:function(gi,gj){gi=gf(this,{top:gi,left:0},gj||"page").top;return bG(this.doc,gi+this.display.viewOffset)},heightAtLine:function(gj,gm){var gi=false,gk;if(typeof gj=="number"){var gl=this.doc.first+this.doc.size-1;if(gj<this.doc.first){gj=this.doc.first}else{if(gj>gl){gj=gl;gi=true}}gk=ff(this.doc,gj)}else{gk=gj}return eQ(this,gk,{top:0,left:0},gm||"page").top+(gi?this.doc.height-bM(gk):0)},defaultTextHeight:function(){return aY(this.display)},defaultCharWidth:function(){return dD(this.display)},setGutterMarker:c8(function(gi,gj,gk){return ez(this.doc,gi,"gutter",function(gl){var gm=gl.gutterMarkers||(gl.gutterMarkers={});gm[gj]=gk;if(!gk&&eU(gm)){gl.gutterMarkers=null}return true})}),clearGutter:c8(function(gk){var gi=this,gl=gi.doc,gj=gl.first;gl.iter(function(gm){if(gm.gutterMarkers&&gm.gutterMarkers[gk]){gm.gutterMarkers[gk]=null;R(gi,gj,"gutter");if(eU(gm.gutterMarkers)){gm.gutterMarkers=null}}++gj})}),lineInfo:function(gi){if(typeof gi=="number"){if(!b9(this.doc,gi)){return null}var gj=gi;gi=ff(this.doc,gi);if(!gi){return null}}else{var gj=bN(gi);if(gj==null){return null}}return{line:gj,handle:gi,text:gi.text,gutterMarkers:gi.gutterMarkers,textClass:gi.textClass,bgClass:gi.bgClass,wrapClass:gi.wrapClass,widgets:gi.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(gn,gk,gp,gl,gr){var gm=this.display;gn=dU(this,fJ(this.doc,gn));var go=gn.bottom,gj=gn.left;gk.style.position="absolute";gk.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(gk);gm.sizer.appendChild(gk);if(gl=="over"){go=gn.top}else{if(gl=="above"||gl=="near"){var gi=Math.max(gm.wrapper.clientHeight,this.doc.height),gq=Math.max(gm.sizer.clientWidth,gm.lineSpace.clientWidth);if((gl=="above"||gn.bottom+gk.offsetHeight>gi)&&gn.top>gk.offsetHeight){go=gn.top-gk.offsetHeight}else{if(gn.bottom+gk.offsetHeight<=gi){go=gn.bottom}}if(gj+gk.offsetWidth>gq){gj=gq-gk.offsetWidth}}}gk.style.top=go+"px";gk.style.left=gk.style.right="";if(gr=="right"){gj=gm.sizer.clientWidth-gk.offsetWidth;gk.style.right="0px"}else{if(gr=="left"){gj=0}else{if(gr=="middle"){gj=(gm.sizer.clientWidth-gk.offsetWidth)/2}}gk.style.left=gj+"px"}if(gp){E(this,gj,go,gj+gk.offsetWidth,go+gk.offsetHeight)}},triggerOnKeyDown:c8(p),triggerOnKeyPress:c8(cx),triggerOnKeyUp:bi,execCommand:function(gi){if(eD.hasOwnProperty(gi)){return eD[gi](this)}},triggerElectric:c8(function(gi){fW(this,gi)}),findPosH:function(go,gl,gm,gj){var gi=1;if(gl<0){gi=-1;gl=-gl}for(var gk=0,gn=fJ(this.doc,go);gk<gl;++gk){gn=bw(this.doc,gn,gi,gm,gj);if(gn.hitSide){break}}return gn},moveH:c8(function(gj,gk){var gi=this;gi.extendSelectionsBy(function(gl){if(gi.display.shift||gi.doc.extend||gl.empty()){return bw(gi.doc,gl.head,gj,gk,gi.options.rtlMoveVisually)}else{return gj<0?gl.from():gl.to()}},cW)}),deleteH:c8(function(gi,gj){var gk=this.doc.sel,gl=this.doc;if(gk.somethingSelected()){gl.replaceSelection("",null,"+delete")}else{eX(this,function(gn){var gm=bw(gl,gn.head,gi,gj,false);return gi<0?{from:gm,to:gn.head}:{from:gn.head,to:gm}})}}),findPosV:function(gn,gk,go,gq){var gi=1,gm=gq;if(gk<0){gi=-1;gk=-gk}for(var gj=0,gp=fJ(this.doc,gn);gj<gk;++gj){var gl=dU(this,gp,"div");if(gm==null){gm=gl.left}else{gl.left=gm}gp=bq(this,gl,gi,go);if(gp.hitSide){break}}return gp},moveV:c8(function(gj,gl){var gi=this,gn=this.doc,gm=[];var go=!gi.display.shift&&!gn.extend&&gn.sel.somethingSelected();gn.extendSelectionsBy(function(gp){if(go){return gj<0?gp.from():gp.to()}var gr=dU(gi,gp.head,"div");if(gp.goalColumn!=null){gr.left=gp.goalColumn}gm.push(gr.left);var gq=bq(gi,gr,gj,gl);if(gl=="page"&&gp==gn.sel.primary()){cL(gi,null,cJ(gi,gq,"div").top-gr.top)}return gq},cW);if(gm.length){for(var gk=0;gk<gn.sel.ranges.length;gk++){gn.sel.ranges[gk].goalColumn=gm[gk]}}}),findWordAt:function(gp){var gn=this.doc,gl=ff(gn,gp.line).text;var go=gp.ch,gk=gp.ch;if(gl){var gm=this.getHelper(gp,"wordChars");if((gp.xRel<0||gk==gl.length)&&go){--go}else{++gk}var gj=gl.charAt(go);var gi=cA(gj,gm)?function(gq){return cA(gq,gm)}:/\s/.test(gj)?function(gq){return/\s/.test(gq)}:function(gq){return !/\s/.test(gq)&&!cA(gq)};while(go>0&&gi(gl.charAt(go-1))){--go}while(gk<gl.length&&gi(gl.charAt(gk))){++gk}}return new dY(W(gp.line,go),W(gp.line,gk))},toggleOverwrite:function(gi){if(gi!=null&&gi==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){fA(this.display.cursorDiv,"CodeMirror-overwrite")}else{f(this.display.cursorDiv,"CodeMirror-overwrite")}aE(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==dO()},scrollTo:c8(function(gi,gj){if(gi!=null||gj!=null){fC(this)}if(gi!=null){this.curOp.scrollLeft=gi}if(gj!=null){this.curOp.scrollTop=gj}}),getScrollInfo:function(){var gi=this.display.scroller;return{left:gi.scrollLeft,top:gi.scrollTop,height:gi.scrollHeight-cT(this)-this.display.barHeight,width:gi.scrollWidth-cT(this)-this.display.barWidth,clientHeight:cV(this),clientWidth:dl(this)}},scrollIntoView:c8(function(gj,gk){if(gj==null){gj={from:this.doc.sel.primary().head,to:null};if(gk==null){gk=this.options.cursorScrollMargin}}else{if(typeof gj=="number"){gj={from:W(gj,0),to:null}}else{if(gj.from==null){gj={from:gj,to:null}}}}if(!gj.to){gj.to=gj.from}gj.margin=gk||0;if(gj.from.line!=null){fC(this);this.curOp.scrollToPos=gj}else{var gi=G(this,Math.min(gj.from.left,gj.to.left),Math.min(gj.from.top,gj.to.top)-gj.margin,Math.max(gj.from.right,gj.to.right),Math.max(gj.from.bottom,gj.to.bottom)+gj.margin);this.scrollTo(gi.scrollLeft,gi.scrollTop)}}),setSize:c8(function(gl,gj){var gi=this;function gk(gn){return typeof gn=="number"||/^\d+$/.test(String(gn))?gn+"px":gn}if(gl!=null){gi.display.wrapper.style.width=gk(gl)}if(gj!=null){gi.display.wrapper.style.height=gk(gj)}if(gi.options.lineWrapping){aO(this)}var gm=gi.display.viewFrom;gi.doc.iter(gm,gi.display.viewTo,function(gn){if(gn.widgets){for(var go=0;go<gn.widgets.length;go++){if(gn.widgets[go].noHScroll){R(gi,gm,"widget");break}}}++gm});gi.curOp.forceUpdate=true;aE(gi,"refresh",this)}),operation:function(gi){return cM(this,gi)},refresh:c8(function(){var gi=this.display.cachedTextHeight;ah(this);this.curOp.forceUpdate=true;ak(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);c4(this);if(gi==null||Math.abs(gi-aY(this.display))>0.5){X(this)}aE(this,"refresh",this)}),swapDoc:c8(function(gj){var gi=this.doc;gi.cm=null;eb(this,gj);ak(this);this.display.input.reset();this.scrollTo(gj.scrollLeft,gj.scrollTop);this.curOp.forceScroll=true;ae(this,"swapDoc",this,gi);return gi}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};by(H);var e3=H.defaults={};var bf=H.optionHandlers={};function s(gi,gl,gk,gj){H.defaults[gi]=gl;if(gk){bf[gi]=gj?function(gm,go,gn){if(gn!=cc){gk(gm,go,gn)}}:gk}}var cc=H.Init={toString:function(){return"CodeMirror.Init"}};s("value","",function(gi,gj){gi.setValue(gj)},true);s("mode",null,function(gi,gj){gi.doc.modeOption=gj;br(gi)},true);s("indentUnit",2,br,true);s("indentWithTabs",false);s("smartIndent",true);s("tabSize",4,function(gi){el(gi);ak(gi);ah(gi)},true);s("lineSeparator",null,function(gi,gl){gi.doc.lineSep=gl;if(!gl){return}var gk=[],gm=gi.doc.first;gi.doc.iter(function(gn){for(var gp=0;;){var go=gn.text.indexOf(gl,gp);if(go==-1){break}gp=go+gl.length;gk.push(W(gm,go))}gm++});for(var gj=gk.length-1;gj>=0;gj--){a1(gi.doc,gl,gk[gj],W(gk[gj].line,gk[gj].ch+gl.length))}});s("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(gi,gk,gj){gi.state.specialChars=new RegExp(gk.source+(gk.test("\t")?"":"|\t"),"g");if(gj!=H.Init){gi.refresh()}});s("specialCharPlaceholder",fc,function(gi){gi.refresh()},true);s("electricChars",true);s("inputStyle",eg?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},true);s("rtlMoveVisually",!aP);s("wholeLineUpdateBefore",true);s("theme","default",function(gi){cO(gi);dw(gi)},true);s("keyMap","default",function(gi,gm,gj){var gk=fY(gm);var gl=gj!=H.Init&&fY(gj);if(gl&&gl.detach){gl.detach(gi,gk)}if(gk.attach){gk.attach(gi,gl||null)}});s("extraKeys",null);s("lineWrapping",false,eG,true);s("gutters",[],function(gi){ce(gi.options);dw(gi)},true);s("fixedGutter",true,function(gi,gj){gi.display.gutters.style.left=gj?dX(gi.display)+"px":"0";gi.refresh()},true);s("coverGutterNextToScrollbar",false,function(gi){eY(gi)},true);s("scrollbarStyle","native",function(gi){aD(gi);eY(gi);gi.display.scrollbars.setScrollTop(gi.doc.scrollTop);gi.display.scrollbars.setScrollLeft(gi.doc.scrollLeft)},true);s("lineNumbers",false,function(gi){ce(gi.options);dw(gi)},true);s("firstLineNumber",1,dw,true);s("lineNumberFormatter",function(gi){return gi},dw,true);s("showCursorWhenSelecting",false,bC,true);s("resetSelectionOnContextMenu",true);s("lineWiseCopyCut",true);s("readOnly",false,function(gi,gj){if(gj=="nocursor"){aV(gi);gi.display.input.blur();gi.display.disabled=true}else{gi.display.disabled=false;if(!gj){gi.display.input.reset()}}});s("disableInput",false,function(gi,gj){if(!gj){gi.display.input.reset()}},true);s("dragDrop",true,f1);s("cursorBlinkRate",530);s("cursorScrollMargin",0);s("cursorHeight",1,bC,true);s("singleCursorHeightPerLine",true,bC,true);s("workTime",100);s("workDelay",100);s("flattenSpans",true,el,true);s("addModeClass",false,el,true);s("pollInterval",100);s("undoDepth",200,function(gi,gj){gi.doc.history.undoDepth=gj});s("historyEventDelay",1250);s("viewportMargin",10,function(gi){gi.refresh()},true);s("maxHighlightLength",10000,el,true);s("moveInputWithCursor",true,function(gi,gj){if(!gj){gi.display.input.resetPosition()}});s("tabindex",null,function(gi,gj){gi.display.input.getField().tabIndex=gj||""});s("autofocus",null);var ds=H.modes={},aS=H.mimeModes={};H.defineMode=function(gi,gj){if(!H.defaults.mode&&gi!="null"){H.defaults.mode=gi}if(arguments.length>2){gj.dependencies=Array.prototype.slice.call(arguments,2)}ds[gi]=gj};H.defineMIME=function(gj,gi){aS[gj]=gi};H.resolveMode=function(gi){if(typeof gi=="string"&&aS.hasOwnProperty(gi)){gi=aS[gi]}else{if(gi&&typeof gi.name=="string"&&aS.hasOwnProperty(gi.name)){var gj=aS[gi.name];if(typeof gj=="string"){gj={name:gj}}gi=ck(gj,gi);gi.name=gj.name}else{if(typeof gi=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(gi)){return H.resolveMode("application/xml")}}}if(typeof gi=="string"){return{name:gi}}else{return gi||{name:"null"}}};H.getMode=function(gj,gi){var gi=H.resolveMode(gi);var gl=ds[gi.name];if(!gl){return H.getMode(gj,"text/plain")}var gm=gl(gj,gi);if(dp.hasOwnProperty(gi.name)){var gk=dp[gi.name];for(var gn in gk){if(!gk.hasOwnProperty(gn)){continue}if(gm.hasOwnProperty(gn)){gm["_"+gn]=gm[gn]}gm[gn]=gk[gn]}}gm.name=gi.name;if(gi.helperType){gm.helperType=gi.helperType}if(gi.modeProps){for(var gn in gi.modeProps){gm[gn]=gi.modeProps[gn]}}return gm};H.defineMode("null",function(){return{token:function(gi){gi.skipToEnd()}}});H.defineMIME("text/plain","null");var dp=H.modeExtensions={};H.extendMode=function(gk,gj){var gi=dp.hasOwnProperty(gk)?dp[gk]:(dp[gk]={});aN(gj,gi)};H.defineExtension=function(gi,gj){H.prototype[gi]=gj};H.defineDocExtension=function(gi,gj){at.prototype[gi]=gj};H.defineOption=s;var a8=[];H.defineInitHook=function(gi){a8.push(gi)};var fo=H.helpers={};H.registerHelper=function(gj,gi,gk){if(!fo.hasOwnProperty(gj)){fo[gj]=H[gj]={_global:[]}}fo[gj][gi]=gk};H.registerGlobalHelper=function(gk,gj,gi,gl){H.registerHelper(gk,gj,gl);fo[gk]._global.push({pred:gi,val:gl})};var b3=H.copyState=function(gl,gi){if(gi===true){return gi}if(gl.copyState){return gl.copyState(gi)}var gk={};for(var gm in gi){var gj=gi[gm];if(gj instanceof Array){gj=gj.concat([])}gk[gm]=gj}return gk};var b0=H.startState=function(gk,gj,gi){return gk.startState?gk.startState(gj,gi):true};H.innerMode=function(gk,gi){while(gk.innerMode){var gj=gk.innerMode(gi);if(!gj||gj.mode==gk){break}gi=gj.state;gk=gj.mode}return gj||{mode:gk,state:gi}};var eD=H.commands={selectAll:function(gi){gi.setSelection(W(gi.firstLine(),0),W(gi.lastLine()),Z)},singleSelection:function(gi){gi.setSelection(gi.getCursor("anchor"),gi.getCursor("head"),Z)},killLine:function(gi){eX(gi,function(gk){if(gk.empty()){var gj=ff(gi.doc,gk.head.line).text.length;if(gk.head.ch==gj&&gk.head.line<gi.lastLine()){return{from:gk.head,to:W(gk.head.line+1,0)}}else{return{from:gk.head,to:W(gk.head.line,gj)}}}else{return{from:gk.from(),to:gk.to()}}})},deleteLine:function(gi){eX(gi,function(gj){return{from:W(gj.from().line,0),to:fJ(gi.doc,W(gj.to().line+1,0))}})},delLineLeft:function(gi){eX(gi,function(gj){return{from:W(gj.from().line,0),to:gj.from()}})},delWrappedLineLeft:function(gi){eX(gi,function(gj){var gl=gi.charCoords(gj.head,"div").top+5;var gk=gi.coordsChar({left:0,top:gl},"div");return{from:gk,to:gj.from()}})},delWrappedLineRight:function(gi){eX(gi,function(gj){var gl=gi.charCoords(gj.head,"div").top+5;var gk=gi.coordsChar({left:gi.display.lineDiv.offsetWidth+100,top:gl},"div");return{from:gj.from(),to:gk}})},undo:function(gi){gi.undo()},redo:function(gi){gi.redo()},undoSelection:function(gi){gi.undoSelection()},redoSelection:function(gi){gi.redoSelection()},goDocStart:function(gi){gi.extendSelection(W(gi.firstLine(),0))},goDocEnd:function(gi){gi.extendSelection(W(gi.lastLine()))},goLineStart:function(gi){gi.extendSelectionsBy(function(gj){return bt(gi,gj.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(gi){gi.extendSelectionsBy(function(gj){return dI(gi,gj.head)},{origin:"+move",bias:1})},goLineEnd:function(gi){gi.extendSelectionsBy(function(gj){return dP(gi,gj.head.line)},{origin:"+move",bias:-1})},goLineRight:function(gi){gi.extendSelectionsBy(function(gj){var gk=gi.charCoords(gj.head,"div").top+5;return gi.coordsChar({left:gi.display.lineDiv.offsetWidth+100,top:gk},"div")},cW)},goLineLeft:function(gi){gi.extendSelectionsBy(function(gj){var gk=gi.charCoords(gj.head,"div").top+5;return gi.coordsChar({left:0,top:gk},"div")},cW)},goLineLeftSmart:function(gi){gi.extendSelectionsBy(function(gj){var gk=gi.charCoords(gj.head,"div").top+5;var gl=gi.coordsChar({left:0,top:gk},"div");if(gl.ch<gi.getLine(gl.line).search(/\S/)){return dI(gi,gj.head)}return gl},cW)},goLineUp:function(gi){gi.moveV(-1,"line")},goLineDown:function(gi){gi.moveV(1,"line")},goPageUp:function(gi){gi.moveV(-1,"page")},goPageDown:function(gi){gi.moveV(1,"page")},goCharLeft:function(gi){gi.moveH(-1,"char")},goCharRight:function(gi){gi.moveH(1,"char")},goColumnLeft:function(gi){gi.moveH(-1,"column")},goColumnRight:function(gi){gi.moveH(1,"column")},goWordLeft:function(gi){gi.moveH(-1,"word")},goGroupRight:function(gi){gi.moveH(1,"group")},goGroupLeft:function(gi){gi.moveH(-1,"group")},goWordRight:function(gi){gi.moveH(1,"word")},delCharBefore:function(gi){gi.deleteH(-1,"char")},delCharAfter:function(gi){gi.deleteH(1,"char")},delWordBefore:function(gi){gi.deleteH(-1,"word")},delWordAfter:function(gi){gi.deleteH(1,"word")},delGroupBefore:function(gi){gi.deleteH(-1,"group")},delGroupAfter:function(gi){gi.deleteH(1,"group")},indentAuto:function(gi){gi.indentSelection("smart")},indentMore:function(gi){gi.indentSelection("add")},indentLess:function(gi){gi.indentSelection("subtract")},insertTab:function(gi){gi.replaceSelection("\t")},insertSoftTab:function(gi){var gk=[],gj=gi.listSelections(),gn=gi.options.tabSize;for(var gm=0;gm<gj.length;gm++){var go=gj[gm].from();var gl=bT(gi.getLine(go.line),go.ch,gn);gk.push(new Array(gn-gl%gn+1).join(" "))}gi.replaceSelections(gk)},defaultTab:function(gi){if(gi.somethingSelected()){gi.indentSelection("add")}else{gi.execCommand("insertTab")}},transposeChars:function(gi){cM(gi,function(){var gl=gi.listSelections(),gk=[];for(var gm=0;gm<gl.length;gm++){var go=gl[gm].head,gj=ff(gi.doc,go.line).text;if(gj){if(go.ch==gj.length){go=new W(go.line,go.ch-1)}if(go.ch>0){go=new W(go.line,go.ch+1);gi.replaceRange(gj.charAt(go.ch-1)+gj.charAt(go.ch-2),W(go.line,go.ch-2),go,"+transpose")}else{if(go.line>gi.doc.first){var gn=ff(gi.doc,go.line-1).text;if(gn){gi.replaceRange(gj.charAt(0)+gi.doc.lineSeparator()+gn.charAt(gn.length-1),W(go.line-1,gn.length-1),W(go.line,1),"+transpose")}}}}gk.push(new dY(go,go))}gi.setSelections(gk)})},newlineAndIndent:function(gi){cM(gi,function(){var gj=gi.listSelections().length;for(var gl=0;gl<gj;gl++){var gk=gi.listSelections()[gl];gi.replaceRange(gi.doc.lineSeparator(),gk.anchor,gk.head,"+input");gi.indentLine(gk.from().line+1,null,true);fF(gi)}})},toggleOverwrite:function(gi){gi.toggleOverwrite()}};var fa=H.keyMap={};fa.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"};fa.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"};fa.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"};fa.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"]};fa["default"]=b7?fa.macDefault:fa.pcDefault;function dt(gj){var gp=gj.split(/-(?!$)/),gj=gp[gp.length-1];var go,gn,gi,gm;for(var gl=0;gl<gp.length-1;gl++){var gk=gp[gl];if(/^(cmd|meta|m)$/i.test(gk)){gm=true}else{if(/^a(lt)?$/i.test(gk)){go=true}else{if(/^(c|ctrl|control)$/i.test(gk)){gn=true}else{if(/^s(hift)$/i.test(gk)){gi=true}else{throw new Error("Unrecognized modifier name: "+gk)}}}}}if(go){gj="Alt-"+gj}if(gn){gj="Ctrl-"+gj}if(gm){gj="Cmd-"+gj}if(gi){gj="Shift-"+gj}return gj}H.normalizeKeyMap=function(gp){var gj={};for(var go in gp){if(gp.hasOwnProperty(go)){var gq=gp[go];if(/^(name|fallthrough|(de|at)tach)$/.test(go)){continue}if(gq=="..."){delete gp[go];continue}var gr=bS(go.split(" "),dt);for(var gn=0;gn<gr.length;gn++){var gl,gk;if(gn==gr.length-1){gk=gr.join(" ");gl=gq}else{gk=gr.slice(0,gn+1).join(" ");gl="..."}var gm=gj[gk];if(!gm){gj[gk]=gl}else{if(gm!=gl){throw new Error("Inconsistent bindings for "+gk)}}}delete gp[go]}}for(var gi in gj){gp[gi]=gj[gi]}return gp};var i=H.lookupKey=function(gl,go,gn,gk){go=fY(go);var gm=go.call?go.call(gl,gk):go[gl];if(gm===false){return"nothing"}if(gm==="..."){return"multi"}if(gm!=null&&gn(gm)){return"handled"}if(go.fallthrough){if(Object.prototype.toString.call(go.fallthrough)!="[object Array]"){return i(gl,go.fallthrough,gn,gk)}for(var gj=0;gj<go.fallthrough.length;gj++){var gi=i(gl,go.fallthrough[gj],gn,gk);if(gi){return gi}}}};var eC=H.isModifierKey=function(gj){var gi=typeof gj=="string"?gj:fg[gj.keyCode];return gi=="Ctrl"||gi=="Alt"||gi=="Shift"||gi=="Mod"};var fr=H.keyName=function(gj,gl){if(d3&&gj.keyCode==34&&gj["char"]){return false}var gk=fg[gj.keyCode],gi=gk;if(gi==null||gj.altGraphKey){return false}if(gj.altKey&&gk!="Alt"){gi="Alt-"+gi}if((bQ?gj.metaKey:gj.ctrlKey)&&gk!="Ctrl"){gi="Ctrl-"+gi}if((bQ?gj.ctrlKey:gj.metaKey)&&gk!="Cmd"){gi="Cmd-"+gi}if(!gl&&gj.shiftKey&&gk!="Shift"){gi="Shift-"+gi}return gi};function fY(gi){return typeof gi=="string"?fa[gi]:gi}H.fromTextArea=function(gp,gq){gq=gq?aN(gq):{};gq.value=gp.value;if(!gq.tabindex&&gp.tabIndex){gq.tabindex=gp.tabIndex}if(!gq.placeholder&&gp.placeholder){gq.placeholder=gp.placeholder}if(gq.autofocus==null){var gi=dO();gq.autofocus=gi==gp||gp.getAttribute("autofocus")!=null&&gi==document.body}function gm(){gp.value=go.getValue()}if(gp.form){bX(gp.form,"submit",gm);if(!gq.leaveSubmitMethodAlone){var gj=gp.form,gn=gj.submit;try{var gl=gj.submit=function(){gm();gj.submit=gn;gj.submit();gj.submit=gl}}catch(gk){}}}gq.finishInit=function(gr){gr.save=gm;gr.getTextArea=function(){return gp};gr.toTextArea=function(){gr.toTextArea=isNaN;gm();gp.parentNode.removeChild(gr.getWrapperElement());gp.style.display="";if(gp.form){ed(gp.form,"submit",gm);if(typeof gp.form.submit=="function"){gp.form.submit=gn}}}};gp.style.display="none";var go=H(function(gr){gp.parentNode.insertBefore(gr,gp.nextSibling)},gq);return go};var eT=H.StringStream=function(gi,gj){this.pos=this.start=0;this.string=gi;this.tabSize=gj||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0};eT.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(gi){var gk=this.string.charAt(this.pos);if(typeof gi=="string"){var gj=gk==gi}else{var gj=gk&&(gi.test?gi.test(gk):gi(gk))}if(gj){++this.pos;return gk}},eatWhile:function(gi){var gj=this.pos;while(this.eat(gi)){}return this.pos>gj},eatSpace:function(){var gi=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>gi},skipToEnd:function(){this.pos=this.string.length},skipTo:function(gi){var gj=this.string.indexOf(gi,this.pos);if(gj>-1){this.pos=gj;return true}},backUp:function(gi){this.pos-=gi},column:function(){if(this.lastColumnPos<this.start){this.lastColumnValue=bT(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?bT(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return bT(this.string,null,this.tabSize)-(this.lineStart?bT(this.string,this.lineStart,this.tabSize):0)},match:function(gm,gj,gi){if(typeof gm=="string"){var gn=function(go){return gi?go.toLowerCase():go};var gl=this.string.substr(this.pos,gm.length);if(gn(gl)==gn(gm)){if(gj!==false){this.pos+=gm.length}return true}}else{var gk=this.string.slice(this.pos).match(gm);if(gk&&gk.index>0){return null}if(gk&&gj!==false){this.pos+=gk[0].length}return gk}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(gj,gi){this.lineStart+=gj;try{return gi()}finally{this.lineStart-=gj}}};var a5=0;var P=H.TextMarker=function(gj,gi){this.lines=[];this.type=gi;this.doc=gj;this.id=++a5};by(P);P.prototype.clear=function(){if(this.explicitlyCleared){return}var gp=this.doc.cm,gj=gp&&!gp.curOp;if(gj){cI(gp)}if(fi(this,"clear")){var gq=this.find();if(gq){ae(this,"clear",gq.from,gq.to)}}var gk=null,gn=null;for(var gl=0;gl<this.lines.length;++gl){var gr=this.lines[gl];var go=e9(gr.markedSpans,this);if(gp&&!this.collapsed){R(gp,bN(gr),"text")}else{if(gp){if(go.to!=null){gn=bN(gr)}if(go.from!=null){gk=bN(gr)}}}gr.markedSpans=eH(gr.markedSpans,go);if(go.from==null&&this.collapsed&&!fw(this.doc,gr)&&gp){f6(gr,aY(gp.display))}}if(gp&&this.collapsed&&!gp.options.lineWrapping){for(var gl=0;gl<this.lines.length;++gl){var gi=y(this.lines[gl]),gm=en(gi);if(gm>gp.display.maxLineLength){gp.display.maxLine=gi;gp.display.maxLineLength=gm;gp.display.maxLineChanged=true}}}if(gk!=null&&gp&&this.collapsed){ah(gp,gk,gn+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(gp){ey(gp.doc)}}if(gp){ae(gp,"markerCleared",gp,this)}if(gj){am(gp)}if(this.parent){this.parent.clear()}};P.prototype.find=function(gl,gj){if(gl==null&&this.type=="bookmark"){gl=1}var go,gn;for(var gk=0;gk<this.lines.length;++gk){var gi=this.lines[gk];var gm=e9(gi.markedSpans,this);if(gm.from!=null){go=W(gj?gi:bN(gi),gm.from);if(gl==-1){return go}}if(gm.to!=null){gn=W(gj?gi:bN(gi),gm.to);if(gl==1){return gn}}}return go&&{from:go,to:gn}};P.prototype.changed=function(){var gk=this.find(-1,true),gj=this,gi=this.doc.cm;if(!gk||!gi){return}cM(gi,function(){var gm=gk.line,gn=bN(gk.line);var gl=fb(gi,gn);if(gl){au(gl);gi.curOp.selectionChanged=gi.curOp.forceUpdate=true}gi.curOp.updateMaxLine=true;if(!fw(gj.doc,gm)&&gj.height!=null){var gp=gj.height;gj.height=null;var go=cY(gj)-gp;if(go){f6(gm,gm.height+go)}}})};P.prototype.attachLine=function(gi){if(!this.lines.length&&this.doc.cm){var gj=this.doc.cm.curOp;if(!gj.maybeHiddenMarkers||dh(gj.maybeHiddenMarkers,this)==-1){(gj.maybeUnhiddenMarkers||(gj.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(gi)};P.prototype.detachLine=function(gi){this.lines.splice(dh(this.lines,gi),1);if(!this.lines.length&&this.doc.cm){var gj=this.doc.cm.curOp;(gj.maybeHiddenMarkers||(gj.maybeHiddenMarkers=[])).push(this)}};var a5=0;function eF(gq,go,gp,gs,gm){if(gs&&gs.shared){return O(gq,go,gp,gs,gm)}if(gq.cm&&!gq.cm.curOp){return c2(gq.cm,eF)(gq,go,gp,gs,gm)}var gl=new P(gq,gm),gr=cf(go,gp);if(gs){aN(gs,gl,false)}if(gr>0||gr==0&&gl.clearWhenEmpty!==false){return gl}if(gl.replacedWith){gl.collapsed=true;gl.widgetNode=f3("span",[gl.replacedWith],"CodeMirror-widget");if(!gs.handleMouseEvents){gl.widgetNode.setAttribute("cm-ignore-events","true")}if(gs.insertLeft){gl.widgetNode.insertLeft=true}}if(gl.collapsed){if(z(gq,go.line,go,gp,gl)||go.line!=gp.line&&z(gq,gp.line,go,gp,gl)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}a7=true}if(gl.addToHistory){fM(gq,{from:go,to:gp,origin:"markText"},gq.sel,NaN)}var gj=go.line,gn=gq.cm,gi;gq.iter(gj,gp.line+1,function(gt){if(gn&&gl.collapsed&&!gn.options.lineWrapping&&y(gt)==gn.display.maxLine){gi=true}if(gl.collapsed&&gj!=go.line){f6(gt,0)}cd(gt,new ei(gl,gj==go.line?go.ch:null,gj==gp.line?gp.ch:null));++gj});if(gl.collapsed){gq.iter(go.line,gp.line+1,function(gt){if(fw(gq,gt)){f6(gt,0)}})}if(gl.clearOnEnter){bX(gl,"beforeCursorEnter",function(){gl.clear()})}if(gl.readOnly){gd=true;if(gq.history.done.length||gq.history.undone.length){gq.clearHistory()}}if(gl.collapsed){gl.id=++a5;gl.atomic=true}if(gn){if(gi){gn.curOp.updateMaxLine=true}if(gl.collapsed){ah(gn,go.line,gp.line+1)}else{if(gl.className||gl.title||gl.startStyle||gl.endStyle||gl.css){for(var gk=go.line;gk<=gp.line;gk++){R(gn,gk,"text")}}}if(gl.atomic){ey(gn.doc)}ae(gn,"markerAdded",gn,gl)}return gl}var x=H.SharedTextMarker=function(gk,gj){this.markers=gk;this.primary=gj;for(var gi=0;gi<gk.length;++gi){gk[gi].parent=this}};by(x);x.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var gi=0;gi<this.markers.length;++gi){this.markers[gi].clear()}ae(this,"clear")};x.prototype.find=function(gj,gi){return this.primary.find(gj,gi)};function O(gm,gp,go,gi,gk){gi=aN(gi);gi.shared=false;var gn=[eF(gm,gp,go,gi,gk)],gj=gn[0];var gl=gi.widgetNode;d7(gm,function(gr){if(gl){gi.widgetNode=gl.cloneNode(true)}gn.push(eF(gr,fJ(gr,gp),fJ(gr,go),gi,gk));for(var gq=0;gq<gr.linked.length;++gq){if(gr.linked[gq].isParent){return}}gj=fG(gn)});return new x(gn,gj)}function eP(gi){return gi.findMarks(W(gi.first,0),gi.clipPos(W(gi.lastLine())),function(gj){return gj.parent})}function dF(gn,go){for(var gl=0;gl<go.length;gl++){var gj=go[gl],gp=gj.find();var gi=gn.clipPos(gp.from),gm=gn.clipPos(gp.to);if(cf(gi,gm)){var gk=eF(gn,gi,gm,gj.primary,gj.primary.type);gj.markers.push(gk);gk.parent=gj}}}function eo(gl){for(var gk=0;gk<gl.length;gk++){var gi=gl[gk],gn=[gi.primary.doc];d7(gi.primary.doc,function(go){gn.push(go)});for(var gj=0;gj<gi.markers.length;gj++){var gm=gi.markers[gj];if(dh(gn,gm.doc)==-1){gm.parent=null;gi.markers.splice(gj--,1)}}}}function ei(gi,gk,gj){this.marker=gi;this.from=gk;this.to=gj}function e9(gk,gi){if(gk){for(var gj=0;gj<gk.length;++gj){var gl=gk[gj];if(gl.marker==gi){return gl}}}}function eH(gj,gk){for(var gl,gi=0;gi<gj.length;++gi){if(gj[gi]!=gk){(gl||(gl=[])).push(gj[gi])}}return gl}function cd(gi,gj){gi.markedSpans=gi.markedSpans?gi.markedSpans.concat([gj]):[gj];gj.marker.attachLine(gi)}function aQ(gj,gk,go){if(gj){for(var gm=0,gp;gm<gj.length;++gm){var gq=gj[gm],gn=gq.marker;var gi=gq.from==null||(gn.inclusiveLeft?gq.from<=gk:gq.from<gk);if(gi||gq.from==gk&&gn.type=="bookmark"&&(!go||!gq.marker.insertLeft)){var gl=gq.to==null||(gn.inclusiveRight?gq.to>=gk:gq.to>gk);(gp||(gp=[])).push(new ei(gn,gq.from,gl?null:gq.to))}}}return gp}function aB(gj,gl,go){if(gj){for(var gm=0,gp;gm<gj.length;++gm){var gq=gj[gm],gn=gq.marker;var gk=gq.to==null||(gn.inclusiveRight?gq.to>=gl:gq.to>gl);if(gk||gq.from==gl&&gn.type=="bookmark"&&(!go||gq.marker.insertLeft)){var gi=gq.from==null||(gn.inclusiveLeft?gq.from<=gl:gq.from<gl);(gp||(gp=[])).push(new ei(gn,gi?null:gq.from-gl,gq.to==null?null:gq.to-gl))}}}return gp}function ek(gu,gr){if(gr.full){return null}var gq=b9(gu,gr.from.line)&&ff(gu,gr.from.line).markedSpans;var gx=b9(gu,gr.to.line)&&ff(gu,gr.to.line).markedSpans;if(!gq&&!gx){return null}var gj=gr.from.ch,gm=gr.to.ch,gp=cf(gr.from,gr.to)==0;var go=aQ(gq,gj,gp);var gw=aB(gx,gm,gp);var gv=gr.text.length==1,gk=fG(gr.text).length+(gv?gj:0);if(go){for(var gl=0;gl<go.length;++gl){var gt=go[gl];if(gt.to==null){var gy=e9(gw,gt.marker);if(!gy){gt.to=gj}else{if(gv){gt.to=gy.to==null?null:gy.to+gk}}}}}if(gw){for(var gl=0;gl<gw.length;++gl){var gt=gw[gl];if(gt.to!=null){gt.to+=gk}if(gt.from==null){var gy=e9(go,gt.marker);if(!gy){gt.from=gk;if(gv){(go||(go=[])).push(gt)}}}else{gt.from+=gk;if(gv){(go||(go=[])).push(gt)}}}}if(go){go=q(go)}if(gw&&gw!=go){gw=q(gw)}var gn=[go];if(!gv){var gs=gr.text.length-2,gi;if(gs>0&&go){for(var gl=0;gl<go.length;++gl){if(go[gl].to==null){(gi||(gi=[])).push(new ei(go[gl].marker,null,null))}}}for(var gl=0;gl<gs;++gl){gn.push(gi)}gn.push(gw)}return gn}function q(gj){for(var gi=0;gi<gj.length;++gi){var gk=gj[gi];if(gk.from!=null&&gk.from==gk.to&&gk.marker.clearWhenEmpty!==false){gj.splice(gi--,1)}}if(!gj.length){return null}return gj}function d9(gq,go){var gi=b4(gq,go);var gr=ek(gq,go);if(!gi){return gr}if(!gr){return gi}for(var gl=0;gl<gi.length;++gl){var gm=gi[gl],gn=gr[gl];if(gm&&gn){spans:for(var gk=0;gk<gn.length;++gk){var gp=gn[gk];for(var gj=0;gj<gm.length;++gj){if(gm[gj].marker==gp.marker){continue spans}}gm.push(gp)}}else{if(gn){gi[gl]=gn}}}return gi}function cH(gu,gs,gt){var gm=null;gu.iter(gs.line,gt.line+1,function(gv){if(gv.markedSpans){for(var gw=0;gw<gv.markedSpans.length;++gw){var gx=gv.markedSpans[gw].marker;if(gx.readOnly&&(!gm||dh(gm,gx)==-1)){(gm||(gm=[])).push(gx)}}}});if(!gm){return null}var gn=[{from:gs,to:gt}];for(var go=0;go<gm.length;++go){var gp=gm[go],gk=gp.find(0);for(var gl=0;gl<gn.length;++gl){var gj=gn[gl];if(cf(gj.to,gk.from)<0||cf(gj.from,gk.to)>0){continue}var gr=[gl,1],gi=cf(gj.from,gk.from),gq=cf(gj.to,gk.to);if(gi<0||!gp.inclusiveLeft&&!gi){gr.push({from:gj.from,to:gk.from})}if(gq>0||!gp.inclusiveRight&&!gq){gr.push({from:gk.to,to:gj.to})}gn.splice.apply(gn,gr);gl+=gr.length-1}}return gn}function f9(gi){var gk=gi.markedSpans;if(!gk){return}for(var gj=0;gj<gk.length;++gj){gk[gj].marker.detachLine(gi)}gi.markedSpans=null}function c3(gi,gk){if(!gk){return}for(var gj=0;gj<gk.length;++gj){gk[gj].marker.attachLine(gi)}gi.markedSpans=gk}function v(gi){return gi.inclusiveLeft?-1:0}function bW(gi){return gi.inclusiveRight?1:0}function dQ(gl,gj){var gn=gl.lines.length-gj.lines.length;if(gn!=0){return gn}var gk=gl.find(),go=gj.find();var gi=cf(gk.from,go.from)||v(gl)-v(gj);if(gi){return -gi}var gm=cf(gk.to,go.to)||bW(gl)-bW(gj);if(gm){return gm}return gj.id-gl.id}function a6(gj,gn){var gi=a7&&gj.markedSpans,gm;if(gi){for(var gl,gk=0;gk<gi.length;++gk){gl=gi[gk];if(gl.marker.collapsed&&(gn?gl.from:gl.to)==null&&(!gm||dQ(gm,gl.marker)<0)){gm=gl.marker}}}return gm}function eO(gi){return a6(gi,true)}function ew(gi){return a6(gi,false)}function z(gq,gk,go,gp,gm){var gt=ff(gq,gk);var gi=a7&>.markedSpans;if(gi){for(var gl=0;gl<gi.length;++gl){var gj=gi[gl];if(!gj.marker.collapsed){continue}var gs=gj.marker.find(0);var gr=cf(gs.from,go)||v(gj.marker)-v(gm);var gn=cf(gs.to,gp)||bW(gj.marker)-bW(gm);if(gr>=0&&gn<=0||gr<=0&&gn>=0){continue}if(gr<=0&&(cf(gs.to,go)>0||(gj.marker.inclusiveRight&&gm.inclusiveLeft))||gr>=0&&(cf(gs.from,gp)<0||(gj.marker.inclusiveLeft&&gm.inclusiveRight))){return true}}}}function y(gj){var gi;while(gi=eO(gj)){gj=gi.find(-1,true).line}return gj}function g(gk){var gi,gj;while(gi=ew(gk)){gk=gi.find(1,true).line;(gj||(gj=[])).push(gk)}return gj}function aW(gl,gj){var gi=ff(gl,gj),gk=y(gi);if(gi==gk){return gj}return bN(gk)}function d2(gl,gk){if(gk>gl.lastLine()){return gk}var gj=ff(gl,gk),gi;if(!fw(gl,gj)){return gk}while(gi=ew(gj)){gj=gi.find(1,true).line}return bN(gj)+1}function fw(gm,gj){var gi=a7&&gj.markedSpans;if(gi){for(var gl,gk=0;gk<gi.length;++gk){gl=gi[gk];if(!gl.marker.collapsed){continue}if(gl.from==null){return true}if(gl.marker.widgetNode){continue}if(gl.from==0&&gl.marker.inclusiveLeft&&T(gm,gj,gl)){return true}}}}function T(gn,gj,gl){if(gl.to==null){var gi=gl.marker.find(1,true);return T(gn,gi.line,e9(gi.line.markedSpans,gl.marker))}if(gl.marker.inclusiveRight&&gl.to==gj.text.length){return true}for(var gm,gk=0;gk<gj.markedSpans.length;++gk){gm=gj.markedSpans[gk];if(gm.marker.collapsed&&!gm.marker.widgetNode&&gm.from==gl.to&&(gm.to==null||gm.to!=gl.from)&&(gm.marker.inclusiveLeft||gl.marker.inclusiveRight)&&T(gn,gj,gm)){return true}}}var dB=H.LineWidget=function(gl,gk,gi){if(gi){for(var gj in gi){if(gi.hasOwnProperty(gj)){this[gj]=gi[gj]}}}this.doc=gl;this.node=gk};by(dB);function dZ(gi,gj,gk){if(bM(gj)<((gi.curOp&&gi.curOp.scrollTop)||gi.doc.scrollTop)){cL(gi,null,gk)}}dB.prototype.clear=function(){var gj=this.doc.cm,gl=this.line.widgets,gk=this.line,gn=bN(gk);if(gn==null||!gl){return}for(var gm=0;gm<gl.length;++gm){if(gl[gm]==this){gl.splice(gm--,1)}}if(!gl.length){gk.widgets=null}var gi=cY(this);f6(gk,Math.max(0,gk.height-gi));if(gj){cM(gj,function(){dZ(gj,gk,-gi);R(gj,gn,"widget")})}};dB.prototype.changed=function(){var gj=this.height,gi=this.doc.cm,gk=this.line;this.height=null;var gl=cY(this)-gj;if(!gl){return}f6(gk,gk.height+gl);if(gi){cM(gi,function(){gi.curOp.forceUpdate=true;dZ(gi,gk,gl)})}};function cY(gk){if(gk.height!=null){return gk.height}var gi=gk.doc.cm;if(!gi){return 0}if(!gb(document.body,gk.node)){var gj="position: relative;";if(gk.coverGutter){gj+="margin-left: -"+gi.display.gutters.offsetWidth+"px;"}if(gk.noHScroll){gj+="width: "+gi.display.wrapper.clientWidth+"px;"}bR(gi.display.measure,f3("div",[gk.node],null,gj))}return gk.height=gk.node.offsetHeight}function bH(gn,gm,gk,gj){var gl=new dB(gn,gk,gj);var gi=gn.cm;if(gi&&gl.noHScroll){gi.display.alignWidgets=true}ez(gn,gm,"widget",function(gp){var gq=gp.widgets||(gp.widgets=[]);if(gl.insertAt==null){gq.push(gl)}else{gq.splice(Math.min(gq.length-1,Math.max(0,gl.insertAt)),0,gl)}gl.line=gp;if(gi&&!fw(gn,gp)){var go=bM(gp)<gn.scrollTop;f6(gp,gp.height+cY(gl));if(go){cL(gi,null,gl.height)}gi.curOp.forceUpdate=true}return true});return gl}var f7=H.Line=function(gk,gj,gi){this.text=gk;c3(this,gj);this.height=gi?gi(this):1};by(f7);f7.prototype.lineNo=function(){return bN(this)};function em(gj,gm,gk,gi){gj.text=gm;if(gj.stateAfter){gj.stateAfter=null}if(gj.styles){gj.styles=null}if(gj.order!=null){gj.order=null}f9(gj);c3(gj,gk);var gl=gi?gi(gj):1;if(gl!=gj.height){f6(gj,gl)}}function bB(gi){gi.parent=null;f9(gi)}function di(gk,gj){if(gk){for(;;){var gi=gk.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!gi){break}gk=gk.slice(0,gi.index)+gk.slice(gi.index+gi[0].length);var gl=gi[1]?"bgClass":"textClass";if(gj[gl]==null){gj[gl]=gi[2]}else{if(!(new RegExp("(?:^|s)"+gi[2]+"(?:$|s)")).test(gj[gl])){gj[gl]+=" "+gi[2]}}}}return gk}function fq(gk,gj){if(gk.blankLine){return gk.blankLine(gj)}if(!gk.innerMode){return}var gi=H.innerMode(gk,gj);if(gi.mode.blankLine){return gi.mode.blankLine(gi.state)}}function eA(gn,gm,gl,gi){for(var gj=0;gj<10;gj++){if(gi){gi[0]=H.innerMode(gn,gl).mode}var gk=gn.token(gm,gl);if(gm.pos>gm.start){return gk}}throw new Error("Mode "+gn.name+" failed to advance stream.")}function cq(gr,gp,gm,gl){function gi(gu){return{start:gs.start,end:gs.pos,string:gs.current(),type:gk||null,state:gu?b3(gq.mode,gj):gj}}var gq=gr.doc,gn=gq.mode,gk;gp=fJ(gq,gp);var gt=ff(gq,gp.line),gj=dC(gr,gp.line,gm);var gs=new eT(gt.text,gr.options.tabSize),go;if(gl){go=[]}while((gl||gs.pos<gp.ch)&&!gs.eol()){gs.start=gs.pos;gk=eA(gn,gs,gj);if(gl){go.push(gi(true))}}return gl?go:gi()}function w(gs,gu,gn,gj,go,gl,gm){var gk=gn.flattenSpans;if(gk==null){gk=gs.options.flattenSpans}var gq=0,gp=null;var gt=new eT(gu,gs.options.tabSize),gi;var gw=gs.options.addModeClass&&[null];if(gu==""){di(fq(gn,gj),gl)}while(!gt.eol()){if(gt.pos>gs.options.maxHighlightLength){gk=false;if(gm){dx(gs,gu,gj,gt.pos)}gt.pos=gu.length;gi=null}else{gi=di(eA(gn,gt,gj,gw),gl)}if(gw){var gv=gw[0].name;if(gv){gi="m-"+(gi?gv+" "+gi:gv)}}if(!gk||gp!=gi){while(gq<gt.start){gq=Math.min(gt.start,gq+50000);go(gq,gp)}gp=gi}gt.start=gt.pos}while(gq<gt.pos){var gr=Math.min(gt.pos,gq+50000);go(gr,gp);gq=gr}}function fz(gp,gr,gi,gm){var gq=[gp.state.modeGen],gl={};w(gp,gr.text,gp.doc.mode,gi,function(gs,gt){gq.push(gs,gt)},gl,gm);for(var gj=0;gj<gp.state.overlays.length;++gj){var gn=gp.state.overlays[gj],go=1,gk=0;w(gp,gr.text,gn.mode,true,function(gs,gu){var gw=go;while(gk<gs){var gt=gq[go];if(gt>gs){gq.splice(go,1,gs,gq[go+1],gt)}go+=2;gk=Math.min(gs,gt)}if(!gu){return}if(gn.opaque){gq.splice(gw,go-gw,gs,"cm-overlay "+gu);go=gw+2}else{for(;gw<go;gw+=2){var gv=gq[gw+1];gq[gw+1]=(gv?gv+" ":"")+"cm-overlay "+gu}}},gl)}return{styles:gq,classes:gl.bgClass||gl.textClass?gl:null}}function c6(gj,gk,gl){if(!gk.styles||gk.styles[0]!=gj.state.modeGen){var gi=fz(gj,gk,gk.stateAfter=dC(gj,bN(gk)));gk.styles=gi.styles;if(gi.classes){gk.styleClasses=gi.classes}else{if(gk.styleClasses){gk.styleClasses=null}}if(gl===gj.doc.frontier){gj.doc.frontier++}}return gk.styles}function dx(gi,gn,gk,gj){var gm=gi.doc.mode;var gl=new eT(gn,gi.options.tabSize);gl.start=gl.pos=gj||0;if(gn==""){fq(gm,gk)}while(!gl.eol()&&gl.pos<=gi.options.maxHighlightLength){eA(gm,gl,gk);gl.start=gl.pos}}var dW={},b1={};function eW(gk,gj){if(!gk||/^\s*$/.test(gk)){return null}var gi=gj.addModeClass?b1:dW;return gi[gk]||(gi[gk]=gk.replace(/\S+/g,"cm-$&"))}function eR(gj,gn){var go=f3("span",null,null,c0?"padding-right: .1px":null);var gl={pre:f3("pre",[go],"CodeMirror-line"),content:go,col:0,pos:0,cm:gj,splitSpaces:(dK||c0)&&gj.getOption("lineWrapping")};gn.measure={};for(var gm=0;gm<=(gn.rest?gn.rest.length:0);gm++){var gk=gm?gn.rest[gm-1]:gn.line,gi;gl.pos=0;gl.addToken=t;if(bO(gj.display.measure)&&(gi=a(gk))){gl.addToken=U(gl.addToken,gi)}gl.map=[];var gp=gn!=gj.display.externalMeasured&&bN(gk);bo(gk,gl,c6(gj,gk,gp));if(gk.styleClasses){if(gk.styleClasses.bgClass){gl.bgClass=fT(gk.styleClasses.bgClass,gl.bgClass||"")}if(gk.styleClasses.textClass){gl.textClass=fT(gk.styleClasses.textClass,gl.textClass||"")}}if(gl.map.length==0){gl.map.push(0,0,gl.content.appendChild(bn(gj.display.measure)))}if(gm==0){gn.measure.map=gl.map;gn.measure.cache={}}else{(gn.measure.maps||(gn.measure.maps=[])).push(gl.map);(gn.measure.caches||(gn.measure.caches=[])).push({})}}if(c0&&/\bcm-tab\b/.test(gl.content.lastChild.className)){gl.content.className="cm-tab-wrap-hack"}aE(gj,"renderLine",gj,gn.line,gl.pre);if(gl.pre.className){gl.textClass=fT(gl.pre.className,gl.textClass||"")}return gl}function fc(gj){var gi=f3("span","\u2022","cm-invalidchar");gi.title="\\u"+gj.charCodeAt(0).toString(16);gi.setAttribute("aria-label",gi.title);return gi}function t(gt,go,gy,gv,gr,gA,gn){if(!go){return}var gx=gt.splitSpaces?go.replace(/ {3,}/g,cF):go;var gi=gt.cm.state.specialChars,gj=false;if(!gi.test(go)){gt.col+=go.length;var gw=document.createTextNode(gx);gt.map.push(gt.pos,gt.pos+go.length,gw);if(dK&&k<9){gj=true}gt.pos+=go.length}else{var gw=document.createDocumentFragment(),gl=0;while(true){gi.lastIndex=gl;var gu=gi.exec(go);var gz=gu?gu.index-gl:go.length-gl;if(gz){var gq=document.createTextNode(gx.slice(gl,gl+gz));if(dK&&k<9){gw.appendChild(f3("span",[gq]))}else{gw.appendChild(gq)}gt.map.push(gt.pos,gt.pos+gz,gq);gt.col+=gz;gt.pos+=gz}if(!gu){break}gl+=gz+1;if(gu[0]=="\t"){var gs=gt.cm.options.tabSize,gp=gs-gt.col%gs;var gq=gw.appendChild(f3("span",cp(gp),"cm-tab"));gq.setAttribute("role","presentation");gq.setAttribute("cm-text","\t");gt.col+=gp}else{if(gu[0]=="\r"||gu[0]=="\n"){var gq=gw.appendChild(f3("span",gu[0]=="\r"?"␍":"","cm-invalidchar"));gq.setAttribute("cm-text",gu[0]);gt.col+=1}else{var gq=gt.cm.options.specialCharPlaceholder(gu[0]);gq.setAttribute("cm-text",gu[0]);if(dK&&k<9){gw.appendChild(f3("span",[gq]))}else{gw.appendChild(gq)}gt.col+=1}}gt.map.push(gt.pos,gt.pos+1,gq);gt.pos++}}if(gy||gv||gr||gj||gn){var gk=gy||"";if(gv){gk+=gv}if(gr){gk+=gr}var gm=f3("span",[gw],gk,gn);if(gA){gm.title=gA}return gt.content.appendChild(gm)}gt.content.appendChild(gw)}function cF(gi){var gj=" ";for(var gk=0;gk<gi.length-2;++gk){gj+=gk%2?" ":"\u00a0"}gj+=" ";return gj}function U(gj,gi){return function(gr,gt,gk,go,gu,gs,gq){gk=gk?gk+" cm-force-border":"cm-force-border";var gl=gr.pos,gn=gl+gt.length;for(;;){for(var gp=0;gp<gi.length;gp++){var gm=gi[gp];if(gm.to>gl&&gm.from<=gl){break}}if(gm.to>=gn){return gj(gr,gt,gk,go,gu,gs,gq)}gj(gr,gt.slice(0,gm.to-gl),gk,go,null,gs,gq);go=null;gt=gt.slice(gm.to-gl);gl=gm.to}}}function ac(gj,gl,gi,gk){var gm=!gk&&gi.widgetNode;if(gm){gj.map.push(gj.pos,gj.pos+gl,gm)}if(!gk&&gj.cm.display.input.needsContentAttribute){if(!gm){gm=gj.content.appendChild(document.createElement("span"))}gm.setAttribute("cm-marker",gi.id)}if(gm){gj.cm.display.input.setUneditable(gm);gj.content.appendChild(gm)}gj.pos+=gl}function bo(gr,gy,gq){var gn=gr.markedSpans,gp=gr.text,gw=0;if(!gn){for(var gB=1;gB<gq.length;gB+=2){gy.addToken(gy,gp.slice(gw,gw=gq[gB]),eW(gq[gB+1],gy.cm.options))}return}var gC=gp.length,gm=0,gB=1,gu="",gD,gs;var gF=0,gi,gE,gv,gG,gk;for(;;){if(gF==gm){gi=gE=gv=gG=gs="";gk=null;gF=Infinity;var go=[];for(var gz=0;gz<gn.length;++gz){var gA=gn[gz],gx=gA.marker;if(gx.type=="bookmark"&&gA.from==gm&&gx.widgetNode){go.push(gx)}else{if(gA.from<=gm&&(gA.to==null||gA.to>gm||gx.collapsed&&gA.to==gm&&gA.from==gm)){if(gA.to!=null&&gA.to!=gm&&gF>gA.to){gF=gA.to;gE=""}if(gx.className){gi+=" "+gx.className}if(gx.css){gs=gx.css}if(gx.startStyle&&gA.from==gm){gv+=" "+gx.startStyle}if(gx.endStyle&&gA.to==gF){gE+=" "+gx.endStyle}if(gx.title&&!gG){gG=gx.title}if(gx.collapsed&&(!gk||dQ(gk.marker,gx)<0)){gk=gA}}else{if(gA.from>gm&&gF>gA.from){gF=gA.from}}}}if(gk&&(gk.from||0)==gm){ac(gy,(gk.to==null?gC+1:gk.to)-gm,gk.marker,gk.from==null);if(gk.to==null){return}if(gk.to==gm){gk=false}}if(!gk&&go.length){for(var gz=0;gz<go.length;++gz){ac(gy,0,go[gz])}}}if(gm>=gC){break}var gt=Math.min(gC,gF);while(true){if(gu){var gj=gm+gu.length;if(!gk){var gl=gj>gt?gu.slice(0,gt-gm):gu;gy.addToken(gy,gl,gD?gD+gi:gi,gv,gm+gl.length==gF?gE:"",gG,gs)}if(gj>=gt){gu=gu.slice(gt-gm);gm=gt;break}gm=gj;gv=""}gu=gp.slice(gw,gw=gq[gB++]);gD=eW(gq[gB++],gy.cm.options)}}}function dS(gi,gj){return gj.from.ch==0&&gj.to.ch==0&&fG(gj.text)==""&&(!gi.cm||gi.cm.options.wholeLineUpdateBefore)}function fy(gv,gq,gj,gm){function gw(gy){return gj?gj[gy]:null}function gk(gy,gA,gz){em(gy,gA,gz,gm);ae(gy,"change",gy,gq)}function gi(gB,gz){for(var gA=gB,gy=[];gA<gz;++gA){gy.push(new f7(gx[gA],gw(gA),gm))}return gy}var gu=gq.from,gt=gq.to,gx=gq.text;var gr=ff(gv,gu.line),gs=ff(gv,gt.line);var gp=fG(gx),gl=gw(gx.length-1),go=gt.line-gu.line;if(gq.full){gv.insert(0,gi(0,gx.length));gv.remove(gx.length,gv.size-gx.length)}else{if(dS(gv,gq)){var gn=gi(0,gx.length-1);gk(gs,gs.text,gl);if(go){gv.remove(gu.line,go)}if(gn.length){gv.insert(gu.line,gn)}}else{if(gr==gs){if(gx.length==1){gk(gr,gr.text.slice(0,gu.ch)+gp+gr.text.slice(gt.ch),gl)}else{var gn=gi(1,gx.length-1);gn.push(new f7(gp+gr.text.slice(gt.ch),gl,gm));gk(gr,gr.text.slice(0,gu.ch)+gx[0],gw(0));gv.insert(gu.line+1,gn)}}else{if(gx.length==1){gk(gr,gr.text.slice(0,gu.ch)+gx[0]+gs.text.slice(gt.ch),gw(0));gv.remove(gu.line+1,go)}else{gk(gr,gr.text.slice(0,gu.ch)+gx[0],gw(0));gk(gs,gp+gs.text.slice(gt.ch),gl);var gn=gi(1,gx.length-1);if(go>1){gv.remove(gu.line+1,go-1)}gv.insert(gu.line+1,gn)}}}}ae(gv,"change",gv,gq)}function eZ(gj){this.lines=gj;this.parent=null;for(var gk=0,gi=0;gk<gj.length;++gk){gj[gk].parent=this;gi+=gj[gk].height}this.height=gi}eZ.prototype={chunkSize:function(){return this.lines.length},removeInner:function(gi,gm){for(var gk=gi,gl=gi+gm;gk<gl;++gk){var gj=this.lines[gk];this.height-=gj.height;bB(gj);ae(gj,"delete")}this.lines.splice(gi,gm)},collapse:function(gi){gi.push.apply(gi,this.lines)},insertInner:function(gj,gk,gi){this.height+=gi;this.lines=this.lines.slice(0,gj).concat(gk).concat(this.lines.slice(gj));for(var gl=0;gl<gk.length;++gl){gk[gl].parent=this}},iterN:function(gi,gl,gk){for(var gj=gi+gl;gi<gj;++gi){if(gk(this.lines[gi])){return true}}}};function fx(gl){this.children=gl;var gk=0,gi=0;for(var gj=0;gj<gl.length;++gj){var gm=gl[gj];gk+=gm.chunkSize();gi+=gm.height;gm.parent=this}this.size=gk;this.height=gi;this.parent=null}fx.prototype={chunkSize:function(){return this.size},removeInner:function(gi,gp){this.size-=gp;for(var gk=0;gk<this.children.length;++gk){var go=this.children[gk],gm=go.chunkSize();if(gi<gm){var gl=Math.min(gp,gm-gi),gn=go.height;go.removeInner(gi,gl);this.height-=gn-go.height;if(gm==gl){this.children.splice(gk--,1);go.parent=null}if((gp-=gl)==0){break}gi=0}else{gi-=gm}}if(this.size-gp<25&&(this.children.length>1||!(this.children[0] instanceof eZ))){var gj=[];this.collapse(gj);this.children=[new eZ(gj)];this.children[0].parent=this}},collapse:function(gi){for(var gj=0;gj<this.children.length;++gj){this.children[gj].collapse(gi)}},insertInner:function(gj,gk,gi){this.size+=gk.length;this.height+=gi;for(var gn=0;gn<this.children.length;++gn){var gp=this.children[gn],go=gp.chunkSize();if(gj<=go){gp.insertInner(gj,gk,gi);if(gp.lines&&gp.lines.length>50){while(gp.lines.length>50){var gm=gp.lines.splice(gp.lines.length-25,25);var gl=new eZ(gm);gp.height-=gl.height;this.children.splice(gn+1,0,gl);gl.parent=this}this.maybeSpill()}break}gj-=go}},maybeSpill:function(){if(this.children.length<=10){return}var gl=this;do{var gj=gl.children.splice(gl.children.length-5,5);var gk=new fx(gj);if(!gl.parent){var gm=new fx(gl.children);gm.parent=gl;gl.children=[gm,gk];gl=gm}else{gl.size-=gk.size;gl.height-=gk.height;var gi=dh(gl.parent.children,gl);gl.parent.children.splice(gi+1,0,gk)}gk.parent=gl.parent}while(gl.children.length>10);gl.parent.maybeSpill()},iterN:function(gi,go,gn){for(var gj=0;gj<this.children.length;++gj){var gm=this.children[gj],gl=gm.chunkSize();if(gi<gl){var gk=Math.min(go,gl-gi);if(gm.iterN(gi,gk,gn)){return true}if((go-=gk)==0){break}gi=0}else{gi-=gl}}}};var cr=0;var at=H.Doc=function(gl,gk,gi,gj){if(!(this instanceof at)){return new at(gl,gk,gi,gj)}if(gi==null){gi=0}fx.call(this,[new eZ([new f7("",null)])]);this.first=gi;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.frontier=gi;var gm=W(gi,0);this.sel=eS(gm);this.history=new fU(null);this.id=++cr;this.modeOption=gk;this.lineSep=gj;if(typeof gl=="string"){gl=this.splitLines(gl)}fy(this,{from:gm,to:gm,text:gl});bU(this,eS(gm),Z)};at.prototype=ck(fx.prototype,{constructor:at,iter:function(gk,gj,gi){if(gi){this.iterN(gk-this.first,gj-gk,gi)}else{this.iterN(this.first,this.first+this.size,gk)}},insert:function(gj,gk){var gi=0;for(var gl=0;gl<gk.length;++gl){gi+=gk[gl].height}this.insertInner(gj-this.first,gk,gi)},remove:function(gi,gj){this.removeInner(gi-this.first,gj)},getValue:function(gj){var gi=a2(this,this.first,this.first+this.size);if(gj===false){return gi}return gi.join(gj||this.lineSeparator())},setValue:cD(function(gj){var gk=W(this.first,0),gi=this.first+this.size-1;bg(this,{from:gk,to:W(gi,ff(this,gi).text.length),text:this.splitLines(gj),origin:"setValue",full:true},true);bU(this,eS(gk))}),replaceRange:function(gj,gl,gk,gi){gl=fJ(this,gl);gk=gk?fJ(this,gk):gl;a1(this,gj,gl,gk,gi)},getRange:function(gl,gk,gj){var gi=f5(this,fJ(this,gl),fJ(this,gk));if(gj===false){return gi}return gi.join(gj||this.lineSeparator())},getLine:function(gj){var gi=this.getLineHandle(gj);return gi&&gi.text},getLineHandle:function(gi){if(b9(this,gi)){return ff(this,gi)}},getLineNumber:function(gi){return bN(gi)},getLineHandleVisualStart:function(gi){if(typeof gi=="number"){gi=ff(this,gi)}return y(gi)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(gi){return fJ(this,gi)},getCursor:function(gk){var gi=this.sel.primary(),gj;if(gk==null||gk=="head"){gj=gi.head}else{if(gk=="anchor"){gj=gi.anchor}else{if(gk=="end"||gk=="to"||gk===false){gj=gi.to()}else{gj=gi.from()}}}return gj},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:cD(function(gi,gk,gj){F(this,fJ(this,typeof gi=="number"?W(gi,gk||0):gi),null,gj)}),setSelection:cD(function(gj,gk,gi){F(this,fJ(this,gj),fJ(this,gk||gj),gi)}),extendSelection:cD(function(gk,gi,gj){fX(this,fJ(this,gk),gi&&fJ(this,gi),gj)}),extendSelections:cD(function(gj,gi){aw(this,d0(this,gj,gi))}),extendSelectionsBy:cD(function(gj,gi){aw(this,bS(this.sel.ranges,gj),gi)}),setSelections:cD(function(gi,gm,gk){if(!gi.length){return}for(var gl=0,gj=[];gl<gi.length;gl++){gj[gl]=new dY(fJ(this,gi[gl].anchor),fJ(this,gi[gl].head))}if(gm==null){gm=Math.min(gi.length-1,this.sel.primIndex)}bU(this,cw(gj,gm),gk)}),addSelection:cD(function(gk,gl,gj){var gi=this.sel.ranges.slice(0);gi.push(new dY(fJ(this,gk),fJ(this,gl||gk)));bU(this,cw(gi,gi.length-1),gj)}),getSelection:function(gm){var gj=this.sel.ranges,gi;for(var gk=0;gk<gj.length;gk++){var gl=f5(this,gj[gk].from(),gj[gk].to());gi=gi?gi.concat(gl):gl}if(gm===false){return gi}else{return gi.join(gm||this.lineSeparator())}},getSelections:function(gm){var gl=[],gi=this.sel.ranges;for(var gj=0;gj<gi.length;gj++){var gk=f5(this,gi[gj].from(),gi[gj].to());if(gm!==false){gk=gk.join(gm||this.lineSeparator())}gl[gj]=gk}return gl},replaceSelection:function(gk,gm,gi){var gl=[];for(var gj=0;gj<this.sel.ranges.length;gj++){gl[gj]=gk}this.replaceSelections(gl,gm,gi||"+input")},replaceSelections:cD(function(gn,gp,gk){var gm=[],go=this.sel;for(var gl=0;gl<go.ranges.length;gl++){var gj=go.ranges[gl];gm[gl]={from:gj.from(),to:gj.to(),text:this.splitLines(gn[gl]),origin:gk}}var gi=gp&&gp!="end"&&af(this,gm,gp);for(var gl=gm.length-1;gl>=0;gl--){bg(this,gm[gl])}if(gi){e7(this,gi)}else{if(this.cm){fF(this.cm)}}}),undo:cD(function(){b8(this,"undo")}),redo:cD(function(){b8(this,"redo")}),undoSelection:cD(function(){b8(this,"undo",true)}),redoSelection:cD(function(){b8(this,"redo",true)}),setExtending:function(gi){this.extend=gi},getExtending:function(){return this.extend},historySize:function(){var gl=this.history,gi=0,gk=0;for(var gj=0;gj<gl.done.length;gj++){if(!gl.done[gj].ranges){++gi}}for(var gj=0;gj<gl.undone.length;gj++){if(!gl.undone[gj].ranges){++gk}}return{undo:gi,redo:gk}},clearHistory:function(){this.history=new fU(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(gi){if(gi){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(gi){return this.history.generation==(gi||this.cleanGeneration)},getHistory:function(){return{done:bP(this.history.done),undone:bP(this.history.undone)}},setHistory:function(gj){var gi=this.history=new fU(this.history.maxGeneration);gi.done=bP(gj.done.slice(0),null,true);gi.undone=bP(gj.undone.slice(0),null,true)},addLineClass:cD(function(gk,gj,gi){return ez(this,gk,gj=="gutter"?"gutter":"class",function(gl){var gm=gj=="text"?"textClass":gj=="background"?"bgClass":gj=="gutter"?"gutterClass":"wrapClass";if(!gl[gm]){gl[gm]=gi}else{if(S(gi).test(gl[gm])){return false}else{gl[gm]+=" "+gi}}return true})}),removeLineClass:cD(function(gk,gj,gi){return ez(this,gk,gj=="gutter"?"gutter":"class",function(gm){var gp=gj=="text"?"textClass":gj=="background"?"bgClass":gj=="gutter"?"gutterClass":"wrapClass";var go=gm[gp];if(!go){return false}else{if(gi==null){gm[gp]=null}else{var gn=go.match(S(gi));if(!gn){return false}var gl=gn.index+gn[0].length;gm[gp]=go.slice(0,gn.index)+(!gn.index||gl==go.length?"":" ")+go.slice(gl)||null}}return true})}),addLineWidget:cD(function(gk,gj,gi){return bH(this,gk,gj,gi)}),removeLineWidget:function(gi){gi.clear()},markText:function(gk,gj,gi){return eF(this,fJ(this,gk),fJ(this,gj),gi,"range")},setBookmark:function(gk,gi){var gj={replacedWith:gi&&(gi.nodeType==null?gi.widget:gi),insertLeft:gi&&gi.insertLeft,clearWhenEmpty:false,shared:gi&&gi.shared,handleMouseEvents:gi&&gi.handleMouseEvents};gk=fJ(this,gk);return eF(this,gk,gk,gj,"bookmark")},findMarksAt:function(gm){gm=fJ(this,gm);var gl=[],gj=ff(this,gm.line).markedSpans;if(gj){for(var gi=0;gi<gj.length;++gi){var gk=gj[gi];if((gk.from==null||gk.from<=gm.ch)&&(gk.to==null||gk.to>=gm.ch)){gl.push(gk.marker.parent||gk.marker)}}}return gl},findMarks:function(gm,gl,gi){gm=fJ(this,gm);gl=fJ(this,gl);var gj=[],gk=gm.line;this.iter(gm.line,gl.line+1,function(gn){var gp=gn.markedSpans;if(gp){for(var go=0;go<gp.length;go++){var gq=gp[go];if(!(gk==gm.line&&gm.ch>gq.to||gq.from==null&&gk!=gm.line||gk==gl.line&&gq.from>gl.ch)&&(!gi||gi(gq.marker))){gj.push(gq.marker.parent||gq.marker)}}}++gk});return gj},getAllMarks:function(){var gi=[];this.iter(function(gk){var gj=gk.markedSpans;if(gj){for(var gl=0;gl<gj.length;++gl){if(gj[gl].from!=null){gi.push(gj[gl].marker)}}}});return gi},posFromIndex:function(gj){var gi,gk=this.first;this.iter(function(gl){var gm=gl.text.length+1;if(gm>gj){gi=gj;return true}gj-=gm;++gk});return fJ(this,W(gk,gi))},indexFromPos:function(gj){gj=fJ(this,gj);var gi=gj.ch;if(gj.line<this.first||gj.ch<0){return 0}this.iter(this.first,gj.line,function(gk){gi+=gk.text.length+1});return gi},copy:function(gi){var gj=new at(a2(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);gj.scrollTop=this.scrollTop;gj.scrollLeft=this.scrollLeft;gj.sel=this.sel;gj.extend=false;if(gi){gj.history.undoDepth=this.history.undoDepth;gj.setHistory(this.getHistory())}return gj},linkedDoc:function(gi){if(!gi){gi={}}var gl=this.first,gk=this.first+this.size;if(gi.from!=null&&gi.from>gl){gl=gi.from}if(gi.to!=null&&gi.to<gk){gk=gi.to}var gj=new at(a2(this,gl,gk),gi.mode||this.modeOption,gl,this.lineSep);if(gi.sharedHist){gj.history=this.history}(this.linked||(this.linked=[])).push({doc:gj,sharedHist:gi.sharedHist});gj.linked=[{doc:this,isParent:true,sharedHist:gi.sharedHist}];dF(gj,eP(this));return gj},unlinkDoc:function(gj){if(gj instanceof H){gj=gj.doc}if(this.linked){for(var gk=0;gk<this.linked.length;++gk){var gl=this.linked[gk];if(gl.doc!=gj){continue}this.linked.splice(gk,1);gj.unlinkDoc(this);eo(eP(this));break}}if(gj.history==this.history){var gi=[gj.id];d7(gj,function(gm){gi.push(gm.id)},true);gj.history=new fU(null);gj.history.done=bP(this.history.done,gi);gj.history.undone=bP(this.history.undone,gi)}},iterLinkedDocs:function(gi){d7(this,gi)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(gi){if(this.lineSep){return gi.split(this.lineSep)}return fS(gi)},lineSeparator:function(){return this.lineSep||"\n"}});at.prototype.eachLine=at.prototype.iter;var d="iter insert remove copy getEditor constructor".split(" ");for(var bK in at.prototype){if(at.prototype.hasOwnProperty(bK)&&dh(d,bK)<0){H.prototype[bK]=(function(gi){return function(){return gi.apply(this.doc,arguments)}})(at.prototype[bK])}}by(at);function d7(gl,gk,gj){function gi(gr,gp,gn){if(gr.linked){for(var go=0;go<gr.linked.length;++go){var gm=gr.linked[go];if(gm.doc==gp){continue}var gq=gn&&gm.sharedHist;if(gj&&!gq){continue}gk(gm.doc,gq);gi(gm.doc,gr,gq)}}}gi(gl,null,true)}function eb(gi,gj){if(gj.cm){throw new Error("This document is already in use.")}gi.doc=gj;gj.cm=gi;X(gi);br(gi);if(!gi.options.lineWrapping){h(gi)}gi.options.mode=gj.modeOption;ah(gi)}function ff(gl,gn){gn-=gl.first;if(gn<0||gn>=gl.size){throw new Error("There is no line "+(gn+gl.first)+" in the document.")}for(var gi=gl;!gi.lines;){for(var gj=0;;++gj){var gm=gi.children[gj],gk=gm.chunkSize();if(gn<gk){gi=gm;break}gn-=gk}}return gi.lines[gn]}function f5(gk,gm,gi){var gj=[],gl=gm.line;gk.iter(gm.line,gi.line+1,function(gn){var go=gn.text;if(gl==gi.line){go=go.slice(0,gi.ch)}if(gl==gm.line){go=go.slice(gm.ch)}gj.push(go);++gl});return gj}function a2(gj,gl,gk){var gi=[];gj.iter(gl,gk,function(gm){gi.push(gm.text)});return gi}function f6(gj,gi){var gk=gi-gj.height;if(gk){for(var gl=gj;gl;gl=gl.parent){gl.height+=gk}}}function bN(gi){if(gi.parent==null){return null}var gm=gi.parent,gl=dh(gm.lines,gi);for(var gj=gm.parent;gj;gm=gj,gj=gj.parent){for(var gk=0;;++gk){if(gj.children[gk]==gm){break}gl+=gj.children[gk].chunkSize()}}return gl+gm.first}function bG(gk,gn){var gp=gk.first;outer:do{for(var gl=0;gl<gk.children.length;++gl){var go=gk.children[gl],gm=go.height;if(gn<gm){gk=go;continue outer}gn-=gm;gp+=go.chunkSize()}return gp}while(!gk.lines);for(var gl=0;gl<gk.lines.length;++gl){var gj=gk.lines[gl],gi=gj.height;if(gn<gi){break}gn-=gi}return gp+gl}function bM(gk){gk=y(gk);var gm=0,gj=gk.parent;for(var gl=0;gl<gj.lines.length;++gl){var gi=gj.lines[gl];if(gi==gk){break}else{gm+=gi.height}}for(var gn=gj.parent;gn;gj=gn,gn=gj.parent){for(var gl=0;gl<gn.children.length;++gl){var go=gn.children[gl];if(go==gj){break}else{gm+=go.height}}}return gm}function a(gj){var gi=gj.order;if(gi==null){gi=gj.order=bh(gj.text)}return gi}function fU(gi){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=gi||1}function du(gi,gk){var gj={from:ci(gk.from),to:cX(gk),text:f5(gi,gk.from,gk.to)};bY(gi,gj,gk.from.line,gk.to.line+1);d7(gi,function(gl){bY(gl,gj,gk.from.line,gk.to.line+1)},true);return gj}function fB(gj){while(gj.length){var gi=fG(gj);if(gi.ranges){gj.pop()}else{break}}}function eM(gj,gi){if(gi){fB(gj.done);return fG(gj.done)}else{if(gj.done.length&&!fG(gj.done).ranges){return fG(gj.done)}else{if(gj.done.length>1&&!gj.done[gj.done.length-2].ranges){gj.done.pop();return fG(gj.done)}}}}function fM(go,gm,gi,gl){var gk=go.history;gk.undone.length=0;var gj=+new Date,gp;if((gk.lastOp==gl||gk.lastOrigin==gm.origin&&gm.origin&&((gm.origin.charAt(0)=="+"&&go.cm&&gk.lastModTime>gj-go.cm.options.historyEventDelay)||gm.origin.charAt(0)=="*"))&&(gp=eM(gk,gk.lastOp==gl))){var gq=fG(gp.changes);if(cf(gm.from,gm.to)==0&&cf(gm.from,gq.to)==0){gq.to=cX(gm)}else{gp.changes.push(du(go,gm))}}else{var gn=fG(gk.done);if(!gn||!gn.ranges){cN(go.sel,gk.done)}gp={changes:[du(go,gm)],generation:gk.generation};gk.done.push(gp);while(gk.done.length>gk.undoDepth){gk.done.shift();if(!gk.done[0].ranges){gk.done.shift()}}}gk.done.push(gi);gk.generation=++gk.maxGeneration;gk.lastModTime=gk.lastSelTime=gj;gk.lastOp=gk.lastSelOp=gl;gk.lastOrigin=gk.lastSelOrigin=gm.origin;if(!gq){aE(go,"historyAdded")}}function bA(gm,gi,gk,gl){var gj=gi.charAt(0);return gj=="*"||gj=="+"&&gk.ranges.length==gl.ranges.length&&gk.somethingSelected()==gl.somethingSelected()&&new Date-gm.history.lastSelTime<=(gm.cm?gm.cm.options.historyEventDelay:500)}function gc(gn,gl,gi,gk){var gm=gn.history,gj=gk&&gk.origin;if(gi==gm.lastSelOp||(gj&&gm.lastSelOrigin==gj&&(gm.lastModTime==gm.lastSelTime&&gm.lastOrigin==gj||bA(gn,gj,fG(gm.done),gl)))){gm.done[gm.done.length-1]=gl}else{cN(gl,gm.done)}gm.lastSelTime=+new Date;gm.lastSelOrigin=gj;gm.lastSelOp=gi;if(gk&&gk.clearRedo!==false){fB(gm.undone)}}function cN(gj,gi){var gk=fG(gi);if(!(gk&&gk.ranges&&gk.equals(gj))){gi.push(gj)}}function bY(gj,gn,gm,gl){var gi=gn["spans_"+gj.id],gk=0;gj.iter(Math.max(gj.first,gm),Math.min(gj.first+gj.size,gl),function(go){if(go.markedSpans){(gi||(gi=gn["spans_"+gj.id]={}))[gk]=go.markedSpans}++gk})}function bl(gk){if(!gk){return null}for(var gj=0,gi;gj<gk.length;++gj){if(gk[gj].marker.explicitlyCleared){if(!gi){gi=gk.slice(0,gj)}}else{if(gi){gi.push(gk[gj])}}}return !gi?gk:gi.length?gi:null}function b4(gl,gm){var gk=gm["spans_"+gl.id];if(!gk){return null}for(var gj=0,gi=[];gj<gm.text.length;++gj){gi.push(bl(gk[gj]))}return gi}function bP(gt,gl,gs){for(var go=0,gj=[];go<gt.length;++go){var gk=gt[go];if(gk.ranges){gj.push(gs?f4.prototype.deepCopy.call(gk):gk);continue}var gq=gk.changes,gr=[];gj.push({changes:gr});for(var gn=0;gn<gq.length;++gn){var gp=gq[gn],gm;gr.push({from:gp.from,to:gp.to,text:gp.text});if(gl){for(var gi in gp){if(gm=gi.match(/^spans_(\d+)$/)){if(dh(gl,Number(gm[1]))>-1){fG(gr)[gi]=gp[gi];delete gp[gi]}}}}}}return gj}function I(gl,gk,gj,gi){if(gj<gl.line){gl.line+=gi}else{if(gk<gl.line){gl.line=gk;gl.ch=0}}}function fh(gl,gn,go,gp){for(var gk=0;gk<gl.length;++gk){var gi=gl[gk],gm=true;if(gi.ranges){if(!gi.copied){gi=gl[gk]=gi.deepCopy();gi.copied=true}for(var gj=0;gj<gi.ranges.length;gj++){I(gi.ranges[gj].anchor,gn,go,gp);I(gi.ranges[gj].head,gn,go,gp)}continue}for(var gj=0;gj<gi.changes.length;++gj){var gq=gi.changes[gj];if(go<gq.from.line){gq.from=W(gq.from.line+gp,gq.from.ch);gq.to=W(gq.to.line+gp,gq.to.ch)}else{if(gn<=gq.to.line){gm=false;break}}}if(!gm){gl.splice(0,gk+1);gk=0}}}function dE(gj,gm){var gl=gm.from.line,gk=gm.to.line,gi=gm.text.length-(gk-gl)-1;fh(gj.done,gl,gk,gi);fh(gj.undone,gl,gk,gi)}var cG=H.e_preventDefault=function(gi){if(gi.preventDefault){gi.preventDefault()}else{gi.returnValue=false}};var dq=H.e_stopPropagation=function(gi){if(gi.stopPropagation){gi.stopPropagation()}else{gi.cancelBubble=true}};function bL(gi){return gi.defaultPrevented!=null?gi.defaultPrevented:gi.returnValue==false}var er=H.e_stop=function(gi){cG(gi);dq(gi)};function L(gi){return gi.target||gi.srcElement}function fN(gj){var gi=gj.which;if(gi==null){if(gj.button&1){gi=1}else{if(gj.button&2){gi=3}else{if(gj.button&4){gi=2}}}}if(b7&&gj.ctrlKey&&gi==1){gi=3}return gi}var bX=H.on=function(gl,gj,gk){if(gl.addEventListener){gl.addEventListener(gj,gk,false)}else{if(gl.attachEvent){gl.attachEvent("on"+gj,gk)}else{var gm=gl._handlers||(gl._handlers={});var gi=gm[gj]||(gm[gj]=[]);gi.push(gk)}}};var ed=H.off=function(gm,gk,gl){if(gm.removeEventListener){gm.removeEventListener(gk,gl,false)}else{if(gm.detachEvent){gm.detachEvent("on"+gk,gl)}else{var gi=gm._handlers&&gm._handlers[gk];if(!gi){return}for(var gj=0;gj<gi.length;++gj){if(gi[gj]==gl){gi.splice(gj,1);break}}}}};var aE=H.signal=function(gm,gl){var gi=gm._handlers&&gm._handlers[gl];if(!gi){return}var gj=Array.prototype.slice.call(arguments,2);for(var gk=0;gk<gi.length;++gk){gi[gk].apply(null,gj)}};var bz=null;function ae(go,gm){var gi=go._handlers&&go._handlers[gm];if(!gi){return}var gk=Array.prototype.slice.call(arguments,2),gn;if(bp){gn=bp.delayedCallbacks}else{if(bz){gn=bz}else{gn=bz=[];setTimeout(aM,0)}}function gj(gp){return function(){gp.apply(null,gk)}}for(var gl=0;gl<gi.length;++gl){gn.push(gj(gi[gl]))}}function aM(){var gi=bz;bz=null;for(var gj=0;gj<gi.length;++gj){gi[gj]()}}function aR(gi,gk,gj){if(typeof gk=="string"){gk={type:gk,preventDefault:function(){this.defaultPrevented=true}}}aE(gi,gj||gk.type,gi,gk);return bL(gk)||gk.codemirrorIgnore}function V(gj){var gi=gj._handlers&&gj._handlers.cursorActivity;if(!gi){return}var gl=gj.curOp.cursorActivityHandlers||(gj.curOp.cursorActivityHandlers=[]);for(var gk=0;gk<gi.length;++gk){if(dh(gl,gi[gk])==-1){gl.push(gi[gk])}}}function fi(gk,gj){var gi=gk._handlers&&gk._handlers[gj];return gi&&gi.length>0}function by(gi){gi.prototype.on=function(gj,gk){bX(this,gj,gk)};gi.prototype.off=function(gj,gk){ed(this,gj,gk)}}var dJ=30;var ca=H.Pass={toString:function(){return"CodeMirror.Pass"}};var Z={scroll:false},M={origin:"*mouse"},cW={origin:"+move"};function gh(){this.id=null}gh.prototype.set=function(gi,gj){clearTimeout(this.id);this.id=setTimeout(gj,gi)};var bT=H.countColumn=function(gl,gj,gn,go,gk){if(gj==null){gj=gl.search(/[^\s\u00a0]/);if(gj==-1){gj=gl.length}}for(var gm=go||0,gp=gk||0;;){var gi=gl.indexOf("\t",gm);if(gi<0||gi>=gj){return gp+(gj-gm)}gp+=gi-gm;gp+=gn-(gp%gn);gm=gi+1}};function eq(gm,gl,gn){for(var go=0,gk=0;;){var gj=gm.indexOf("\t",go);if(gj==-1){gj=gm.length}var gi=gj-go;if(gj==gm.length||gk+gi>=gl){return go+Math.min(gi,gl-gk)}gk+=gj-go;gk+=gn-(gk%gn);go=gj+1;if(gk>=gl){return go}}}var a0=[""];function cp(gi){while(a0.length<=gi){a0.push(fG(a0)+" ")}return a0[gi]}function fG(gi){return gi[gi.length-1]}var dL=function(gi){gi.select()};if(e1){dL=function(gi){gi.selectionStart=0;gi.selectionEnd=gi.value.length}}else{if(dK){dL=function(gj){try{gj.select()}catch(gi){}}}}function dh(gk,gi){for(var gj=0;gj<gk.length;++gj){if(gk[gj]==gi){return gj}}return -1}function bS(gl,gk){var gi=[];for(var gj=0;gj<gl.length;gj++){gi[gj]=gk(gl[gj],gj)}return gi}function fV(){}function ck(gk,gi){var gj;if(Object.create){gj=Object.create(gk)}else{fV.prototype=gk;gj=new fV()}if(gi){aN(gi,gj)}return gj}function aN(gk,gj,gi){if(!gj){gj={}}for(var gl in gk){if(gk.hasOwnProperty(gl)&&(gi!==false||!gj.hasOwnProperty(gl))){gj[gl]=gk[gl]}}return gj}function cv(gj){var gi=Array.prototype.slice.call(arguments,1);return function(){return gj.apply(null,gi)}}var bc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;var fD=H.isWordChar=function(gi){return/\w/.test(gi)||gi>"\x80"&&(gi.toUpperCase()!=gi.toLowerCase()||bc.test(gi))};function cA(gi,gj){if(!gj){return fD(gi)}if(gj.source.indexOf("\\w")>-1&&fD(gi)){return true}return gj.test(gi)}function eU(gi){for(var gj in gi){if(gi.hasOwnProperty(gj)&&gi[gj]){return false}}return true}var eJ=/[\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 fp(gi){return gi.charCodeAt(0)>=768&&eJ.test(gi)}function f3(gi,gm,gl,gk){var gn=document.createElement(gi);if(gl){gn.className=gl}if(gk){gn.style.cssText=gk}if(typeof gm=="string"){gn.appendChild(document.createTextNode(gm))}else{if(gm){for(var gj=0;gj<gm.length;++gj){gn.appendChild(gm[gj])}}}return gn}var cl;if(document.createRange){cl=function(gl,gm,gj,gi){var gk=document.createRange();gk.setEnd(gi||gl,gj);gk.setStart(gl,gm);return gk}}else{cl=function(gk,gm,gi){var gj=document.body.createTextRange();try{gj.moveToElementText(gk.parentNode)}catch(gl){return gj}gj.collapse(true);gj.moveEnd("character",gi);gj.moveStart("character",gm);return gj}}function d1(gj){for(var gi=gj.childNodes.length;gi>0;--gi){gj.removeChild(gj.firstChild)}return gj}function bR(gi,gj){return d1(gi).appendChild(gj)}var gb=H.contains=function(gi,gj){if(gj.nodeType==3){gj=gj.parentNode}if(gi.contains){return gi.contains(gj)}do{if(gj.nodeType==11){gj=gj.host}if(gj==gi){return true}}while(gj=gj.parentNode)};function dO(){var gi=document.activeElement;while(gi&&gi.root&&gi.root.activeElement){gi=gi.root.activeElement}return gi}if(dK&&k<11){dO=function(){try{return document.activeElement}catch(gi){return document.body}}}function S(gi){return new RegExp("(^|\\s)"+gi+"(?:$|\\s)\\s*")}var f=H.rmClass=function(gk,gi){var gl=gk.className;var gj=S(gi).exec(gl);if(gj){var gm=gl.slice(gj.index+gj[0].length);gk.className=gl.slice(0,gj.index)+(gm?gj[1]+gm:"")}};var fA=H.addClass=function(gj,gi){var gk=gj.className;if(!S(gi).test(gk)){gj.className+=(gk?" ":"")+gi}};function fT(gk,gi){var gj=gk.split(" ");for(var gl=0;gl<gj.length;gl++){if(gj[gl]&&!S(gj[gl]).test(gi)){gi+=" "+gj[gl]}}return gi}function aA(gl){if(!document.body.getElementsByClassName){return}var gk=document.body.getElementsByClassName("CodeMirror");for(var gj=0;gj<gk.length;gj++){var gi=gk[gj].CodeMirror;if(gi){gl(gi)}}}var cC=false;function bj(){if(cC){return}fE();cC=true}function fE(){var gi;bX(window,"resize",function(){if(gi==null){gi=setTimeout(function(){gi=null;aA(aT)},100)}});bX(window,"blur",function(){aA(aV)})}var eL=function(){if(dK&&k<9){return false}var gi=f3("div");return"draggable" in gi||"dragDrop" in gi}();var fL;function bn(gi){if(fL==null){var gk=f3("span","\u200b");bR(gi,f3("span",[gk,document.createTextNode("x")]));if(gi.firstChild.offsetHeight!=0){fL=gk.offsetWidth<=1&&gk.offsetHeight>2&&!(dK&&k<8)}}var gj=fL?f3("span","\u200b"):f3("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px");gj.setAttribute("cm-text","");return gj}var fK;function bO(gl){if(fK!=null){return fK}var gi=bR(gl,document.createTextNode("A\u062eA"));var gk=cl(gi,0,1).getBoundingClientRect();if(!gk||gk.left==gk.right){return false}var gj=cl(gi,1,2).getBoundingClientRect();return fK=(gj.right-gk.right<3)}var fS=H.splitLines="\n\nb".split(/\n/).length!=3?function(gn){var go=0,gi=[],gm=gn.length;while(go<=gm){var gl=gn.indexOf("\n",go);if(gl==-1){gl=gn.length}var gk=gn.slice(go,gn.charAt(gl-1)=="\r"?gl-1:gl);var gj=gk.indexOf("\r");if(gj!=-1){gi.push(gk.slice(0,gj));go+=gj+1}else{gi.push(gk);go=gl+1}}return gi}:function(gi){return gi.split(/\r\n?|\n/)};var bs=window.getSelection?function(gj){try{return gj.selectionStart!=gj.selectionEnd}catch(gi){return false}}:function(gk){try{var gi=gk.ownerDocument.selection.createRange()}catch(gj){}if(!gi||gi.parentElement()!=gk){return false}return gi.compareEndPoints("StartToEnd",gi)!=0};var da=(function(){var gi=f3("div");if("oncopy" in gi){return true}gi.setAttribute("oncopy","return;");return typeof gi.oncopy=="function"})();var e6=null;function aK(gj){if(e6!=null){return e6}var gk=bR(gj,f3("span","x"));var gl=gk.getBoundingClientRect();var gi=cl(gk,0,1).getBoundingClientRect();return e6=Math.abs(gl.left-gi.left)>1}var fg={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"};H.keyNames=fg;(function(){for(var gi=0;gi<10;gi++){fg[gi+48]=fg[gi+96]=String(gi)}for(var gi=65;gi<=90;gi++){fg[gi]=String.fromCharCode(gi)}for(var gi=1;gi<=12;gi++){fg[gi+111]=fg[gi+63235]="F"+gi}})();function d4(gi,go,gn,gm){if(!gi){return gm(go,gn,"ltr")}var gl=false;for(var gk=0;gk<gi.length;++gk){var gj=gi[gk];if(gj.from<gn&&gj.to>go||go==gn&&gj.to==go){gm(Math.max(gj.from,go),Math.min(gj.to,gn),gj.level==1?"rtl":"ltr");gl=true}}if(!gl){gm(go,gn,"ltr")}}function dy(gi){return gi.level%2?gi.to:gi.from}function ge(gi){return gi.level%2?gi.from:gi.to}function cE(gj){var gi=a(gj);return gi?dy(gi[0]):0}function cS(gj){var gi=a(gj);if(!gi){return gj.text.length}return ge(fG(gi))}function bt(gj,gm){var gk=ff(gj.doc,gm);var gn=y(gk);if(gn!=gk){gm=bN(gn)}var gi=a(gn);var gl=!gi?0:gi[0].level%2?cS(gn):cE(gn);return W(gm,gl)}function dP(gk,gn){var gj,gl=ff(gk.doc,gn);while(gj=ew(gl)){gl=gj.find(1,true).line;gn=null}var gi=a(gl);var gm=!gi?gl.text.length:gi[0].level%2?cE(gl):cS(gl);return W(gn==null?bN(gl):gn,gm)}function dI(gj,go){var gn=bt(gj,go.line);var gk=ff(gj.doc,gn.line);var gi=a(gk);if(!gi||gi[0].level==0){var gm=Math.max(0,gk.text.search(/\S/));var gl=go.line==gn.line&&go.ch<=gm&&go.ch;return W(gn.line,gl?0:gm)}return gn}function an(gj,gk,gi){var gl=gj[0].level;if(gk==gl){return true}if(gi==gl){return false}return gk<gi}var e2;function aG(gi,gm){e2=null;for(var gj=0,gk;gj<gi.length;++gj){var gl=gi[gj];if(gl.from<gm&&gl.to>gm){return gj}if((gl.from==gm||gl.to==gm)){if(gk==null){gk=gj}else{if(an(gi,gl.level,gi[gk].level)){if(gl.from!=gl.to){e2=gk}return gj}else{if(gl.from!=gl.to){e2=gj}return gk}}}}return gk}function fe(gi,gl,gj,gk){if(!gk){return gl+gj}do{gl+=gj}while(gl>0&&fp(gi.text.charAt(gl)));return gl}function u(gi,gp,gk,gl){var gm=a(gi);if(!gm){return ai(gi,gp,gk,gl)}var go=aG(gm,gp),gj=gm[go];var gn=fe(gi,gp,gj.level%2?-gk:gk,gl);for(;;){if(gn>gj.from&&gn<gj.to){return gn}if(gn==gj.from||gn==gj.to){if(aG(gm,gn)==go){return gn}gj=gm[go+=gk];return(gk>0)==gj.level%2?gj.to:gj.from}else{gj=gm[go+=gk];if(!gj){return null}if((gk>0)==gj.level%2){gn=fe(gi,gj.to,-1,gl)}else{gn=fe(gi,gj.from,1,gl)}}}}function ai(gi,gm,gj,gk){var gl=gm+gj;if(gk){while(gl>0&&fp(gi.text.charAt(gl))){gl+=gj}}return gl<0||gl>gi.text.length?null:gl}var bh=(function(){var go="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var gm="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm";function gl(gs){if(gs<=247){return go.charAt(gs)}else{if(1424<=gs&&gs<=1524){return"R"}else{if(1536<=gs&&gs<=1773){return gm.charAt(gs-1536)}else{if(1774<=gs&&gs<=2220){return"r"}else{if(8192<=gs&&gs<=8203){return"w"}else{if(gs==8204){return"b"}else{return"L"}}}}}}}var gi=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var gr=/[stwN]/,gk=/[LRr]/,gj=/[Lb1n]/,gn=/[1n]/;var gq="L";function gp(gu,gt,gs){this.level=gu;this.from=gt;this.to=gs}return function(gC){if(!gi.test(gC)){return false}var gI=gC.length,gy=[];for(var gH=0,gu;gH<gI;++gH){gy.push(gu=gl(gC.charCodeAt(gH)))}for(var gH=0,gB=gq;gH<gI;++gH){var gu=gy[gH];if(gu=="m"){gy[gH]=gB}else{gB=gu}}for(var gH=0,gs=gq;gH<gI;++gH){var gu=gy[gH];if(gu=="1"&&gs=="r"){gy[gH]="n"}else{if(gk.test(gu)){gs=gu;if(gu=="r"){gy[gH]="R"}}}}for(var gH=1,gB=gy[0];gH<gI-1;++gH){var gu=gy[gH];if(gu=="+"&&gB=="1"&&gy[gH+1]=="1"){gy[gH]="1"}else{if(gu==","&&gB==gy[gH+1]&&(gB=="1"||gB=="n")){gy[gH]=gB}}gB=gu}for(var gH=0;gH<gI;++gH){var gu=gy[gH];if(gu==","){gy[gH]="N"}else{if(gu=="%"){for(var gv=gH+1;gv<gI&&gy[gv]=="%";++gv){}var gJ=(gH&&gy[gH-1]=="!")||(gv<gI&&gy[gv]=="1")?"1":"N";for(var gF=gH;gF<gv;++gF){gy[gF]=gJ}gH=gv-1}}}for(var gH=0,gs=gq;gH<gI;++gH){var gu=gy[gH];if(gs=="L"&&gu=="1"){gy[gH]="L"}else{if(gk.test(gu)){gs=gu}}}for(var gH=0;gH<gI;++gH){if(gr.test(gy[gH])){for(var gv=gH+1;gv<gI&&gr.test(gy[gv]);++gv){}var gz=(gH?gy[gH-1]:gq)=="L";var gt=(gv<gI?gy[gv]:gq)=="L";var gJ=gz||gt?"L":"R";for(var gF=gH;gF<gv;++gF){gy[gF]=gJ}gH=gv-1}}var gG=[],gD;for(var gH=0;gH<gI;){if(gj.test(gy[gH])){var gw=gH;for(++gH;gH<gI&&gj.test(gy[gH]);++gH){}gG.push(new gp(0,gw,gH))}else{var gx=gH,gA=gG.length;for(++gH;gH<gI&&gy[gH]!="L";++gH){}for(var gF=gx;gF<gH;){if(gn.test(gy[gF])){if(gx<gF){gG.splice(gA,0,new gp(1,gx,gF))}var gE=gF;for(++gF;gF<gH&&gn.test(gy[gF]);++gF){}gG.splice(gA,0,new gp(2,gE,gF));gx=gF}else{++gF}}if(gx<gH){gG.splice(gA,0,new gp(1,gx,gH))}}}if(gG[0].level==1&&(gD=gC.match(/^\s+/))){gG[0].from=gD[0].length;gG.unshift(new gp(0,0,gD[0].length))}if(fG(gG).level==1&&(gD=gC.match(/\s+$/))){fG(gG).to-=gD[0].length;gG.push(new gp(0,gI-gD[0].length,gI))}if(gG[0].level==2){gG.unshift(new gp(1,gG[0].to,gG[0].to))}if(gG[0].level!=fG(gG).level){gG.push(new gp(gG[0].level,gI,gI))}return gG}})();H.version="5.5.0";return H});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(p){p.defineMode("css",function(T,G){if(!G.propertyKeywords){G=p.resolveMode("text/css")}var M=T.indentUnit,y=G.tokenHooks,w=G.documentTypes||{},S=G.mediaTypes||{},I=G.mediaFeatures||{},F=G.propertyKeywords||{},z=G.nonStandardPropertyKeywords||{},B=G.fontProperties||{},R=G.counterDescriptors||{},L=G.colorKeywords||{},O=G.valueKeywords||{},J=G.allowNested;var A,K;function U(X,Y){A=Y;return X}function W(aa,Z){var Y=aa.next();if(y[Y]){var X=y[Y](aa,Z);if(X!==false){return X}}if(Y=="@"){aa.eatWhile(/[\w\\\-]/);return U("def",aa.current())}else{if(Y=="="||(Y=="~"||Y=="|")&&aa.eat("=")){return U(null,"compare")}else{if(Y=='"'||Y=="'"){Z.tokenize=H(Y);return Z.tokenize(aa,Z)}else{if(Y=="#"){aa.eatWhile(/[\w\\\-]/);return U("atom","hash")}else{if(Y=="!"){aa.match(/^\s*\w*/);return U("keyword","important")}else{if(/\d/.test(Y)||Y=="."&&aa.eat(/\d/)){aa.eatWhile(/[\w.%]/);return U("number","unit")}else{if(Y==="-"){if(/[\d.]/.test(aa.peek())){aa.eatWhile(/[\w.%]/);return U("number","unit")}else{if(aa.match(/^-[\w\\\-]+/)){aa.eatWhile(/[\w\\\-]/);if(aa.match(/^\s*:/,false)){return U("variable-2","variable-definition")}return U("variable-2","variable")}else{if(aa.match(/^\w+-/)){return U("meta","meta")}}}}else{if(/[,+>*\/]/.test(Y)){return U(null,"select-op")}else{if(Y=="."&&aa.match(/^-?[_a-z][_a-z0-9-]*/i)){return U("qualifier","qualifier")}else{if(/[:;{}\[\]\(\)]/.test(Y)){return U(null,Y)}else{if((Y=="u"&&aa.match(/rl(-prefix)?\(/))||(Y=="d"&&aa.match("omain("))||(Y=="r"&&aa.match("egexp("))){aa.backUp(1);Z.tokenize=V;return U("property","word")}else{if(/[\w\\\-]/.test(Y)){aa.eatWhile(/[\w\\\-]/);return U("property","word")}else{return U(null,null)}}}}}}}}}}}}}function H(X){return function(ab,Z){var aa=false,Y;while((Y=ab.next())!=null){if(Y==X&&!aa){if(X==")"){ab.backUp(1)}break}aa=!aa&&Y=="\\"}if(Y==X||!aa&&X!=")"){Z.tokenize=null}return U("string","string")}}function V(Y,X){Y.next();if(!Y.match(/\s*[\"\')]/,false)){X.tokenize=H(")")}else{X.tokenize=null}return U(null,"(")}function N(Y,X,Z){this.type=Y;this.indent=X;this.prev=Z}function D(Y,Z,X){Y.context=new N(X,Z.indentation()+M,Y.context);return X}function P(X){X.context=X.context.prev;return X.context.type}function x(X,Z,Y){return C[Y.context.type](X,Z,Y)}function Q(Y,aa,Z,ab){for(var X=ab||1;X>0;X--){Z.context=Z.context.prev}return x(Y,aa,Z)}function E(Y){var X=Y.current().toLowerCase();if(O.hasOwnProperty(X)){K="atom"}else{if(L.hasOwnProperty(X)){K="keyword"}else{K="variable"}}}var C={};C.top=function(X,Z,Y){if(X=="{"){return D(Y,Z,"block")}else{if(X=="}"&&Y.context.prev){return P(Y)}else{if(/@(media|supports|(-moz-)?document)/.test(X)){return D(Y,Z,"atBlock")}else{if(/@(font-face|counter-style)/.test(X)){Y.stateArg=X;return"restricted_atBlock_before"}else{if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(X)){return"keyframes"}else{if(X&&X.charAt(0)=="@"){return D(Y,Z,"at")}else{if(X=="hash"){K="builtin"}else{if(X=="word"){K="tag"}else{if(X=="variable-definition"){return"maybeprop"}else{if(X=="interpolation"){return D(Y,Z,"interpolation")}else{if(X==":"){return"pseudo"}else{if(J&&X=="("){return D(Y,Z,"parens")}}}}}}}}}}}}return Y.context.type};C.block=function(X,aa,Y){if(X=="word"){var Z=aa.current().toLowerCase();if(F.hasOwnProperty(Z)){K="property";return"maybeprop"}else{if(z.hasOwnProperty(Z)){K="string-2";return"maybeprop"}else{if(J){K=aa.match(/^\s*:(?:\s|$)/,false)?"property":"tag";return"block"}else{K+=" error";return"maybeprop"}}}}else{if(X=="meta"){return"block"}else{if(!J&&(X=="hash"||X=="qualifier")){K="error";return"block"}else{return C.top(X,aa,Y)}}}};C.maybeprop=function(X,Z,Y){if(X==":"){return D(Y,Z,"prop")}return x(X,Z,Y)};C.prop=function(X,Z,Y){if(X==";"){return P(Y)}if(X=="{"&&J){return D(Y,Z,"propBlock")}if(X=="}"||X=="{"){return Q(X,Z,Y)}if(X=="("){return D(Y,Z,"parens")}if(X=="hash"&&!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(Z.current())){K+=" error"}else{if(X=="word"){E(Z)}else{if(X=="interpolation"){return D(Y,Z,"interpolation")}}}return"prop"};C.propBlock=function(Y,X,Z){if(Y=="}"){return P(Z)}if(Y=="word"){K="property";return"maybeprop"}return Z.context.type};C.parens=function(X,Z,Y){if(X=="{"||X=="}"){return Q(X,Z,Y)}if(X==")"){return P(Y)}if(X=="("){return D(Y,Z,"parens")}if(X=="interpolation"){return D(Y,Z,"interpolation")}if(X=="word"){E(Z)}return"parens"};C.pseudo=function(X,Z,Y){if(X=="word"){K="variable-3";return Y.context.type}return x(X,Z,Y)};C.atBlock=function(X,aa,Y){if(X=="("){return D(Y,aa,"atBlock_parens")}if(X=="}"){return Q(X,aa,Y)}if(X=="{"){return P(Y)&&D(Y,aa,J?"block":"top")}if(X=="word"){var Z=aa.current().toLowerCase();if(Z=="only"||Z=="not"||Z=="and"||Z=="or"){K="keyword"}else{if(w.hasOwnProperty(Z)){K="tag"}else{if(S.hasOwnProperty(Z)){K="attribute"}else{if(I.hasOwnProperty(Z)){K="property"}else{if(F.hasOwnProperty(Z)){K="property"}else{if(z.hasOwnProperty(Z)){K="string-2"}else{if(O.hasOwnProperty(Z)){K="atom"}else{if(L.hasOwnProperty(Z)){K="keyword"}else{K="error"}}}}}}}}}return Y.context.type};C.atBlock_parens=function(X,Z,Y){if(X==")"){return P(Y)}if(X=="{"||X=="}"){return Q(X,Z,Y,2)}return C.atBlock(X,Z,Y)};C.restricted_atBlock_before=function(X,Z,Y){if(X=="{"){return D(Y,Z,"restricted_atBlock")}if(X=="word"&&Y.stateArg=="@counter-style"){K="variable";return"restricted_atBlock_before"}return x(X,Z,Y)};C.restricted_atBlock=function(X,Z,Y){if(X=="}"){Y.stateArg=null;return P(Y)}if(X=="word"){if((Y.stateArg=="@font-face"&&!B.hasOwnProperty(Z.current().toLowerCase()))||(Y.stateArg=="@counter-style"&&!R.hasOwnProperty(Z.current().toLowerCase()))){K="error"}else{K="property"}return"maybeprop"}return"restricted_atBlock"};C.keyframes=function(X,Z,Y){if(X=="word"){K="variable";return"keyframes"}if(X=="{"){return D(Y,Z,"top")}return x(X,Z,Y)};C.at=function(X,Z,Y){if(X==";"){return P(Y)}if(X=="{"||X=="}"){return Q(X,Z,Y)}if(X=="word"){K="tag"}else{if(X=="hash"){K="builtin"}}return"at"};C.interpolation=function(X,Z,Y){if(X=="}"){return P(Y)}if(X=="{"||X==";"){return Q(X,Z,Y)}if(X=="word"){K="variable"}else{if(X!="variable"&&X!="("&&X!=")"){K="error"}}return"interpolation"};return{startState:function(X){return{tokenize:null,state:"top",stateArg:null,context:new N("top",X||0,null)}},token:function(Z,Y){if(!Y.tokenize&&Z.eatSpace()){return null}var X=(Y.tokenize||W)(Z,Y);if(X&&typeof X=="object"){A=X[1];X=X[0]}K=X;Y.state=C[Y.state](A,Z,Y);return K},indent:function(ab,Z){var Y=ab.context,aa=Z&&Z.charAt(0);var X=Y.indent;if(Y.type=="prop"&&(aa=="}"||aa==")")){Y=Y.prev}if(Y.prev&&(aa=="}"&&(Y.type=="block"||Y.type=="top"||Y.type=="interpolation"||Y.type=="restricted_atBlock")||aa==")"&&(Y.type=="parens"||Y.type=="atBlock_parens")||aa=="{"&&(Y.type=="at"||Y.type=="atBlock"))){X=Y.indent-M;Y=Y.prev}return X},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});function g(y){var x={};for(var w=0;w<y.length;++w){x[y[w]]=true}return x}var k=["domain","regexp","url","url-prefix"],a=g(k);var b=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],t=g(b);var v=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],i=g(v);var d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],h=g(d);var m=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],e=g(m);var r=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],f=g(r);var o=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],s=g(o);var c=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],l=g(c);var j=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small"],q=g(j);var n=k.concat(b).concat(v).concat(d).concat(m).concat(c).concat(j);p.registerHelper("hintWords","css",n);function u(z,y){var w=false,x;while((x=z.next())!=null){if(w&&x=="/"){y.tokenize=null;break}w=(x=="*")}return["comment","comment"]}p.defineMIME("text/css",{documentTypes:a,mediaTypes:t,mediaFeatures:i,propertyKeywords:h,nonStandardPropertyKeywords:e,fontProperties:f,counterDescriptors:s,colorKeywords:l,valueKeywords:q,tokenHooks:{"/":function(x,w){if(!x.eat("*")){return false}w.tokenize=u;return u(x,w)}},name:"css"});p.defineMIME("text/x-scss",{mediaTypes:t,mediaFeatures:i,propertyKeywords:h,nonStandardPropertyKeywords:e,colorKeywords:l,valueKeywords:q,fontProperties:f,allowNested:true,tokenHooks:{"/":function(x,w){if(x.eat("/")){x.skipToEnd();return["comment","comment"]}else{if(x.eat("*")){w.tokenize=u;return u(x,w)}else{return["operator","operator"]}}},":":function(w){if(w.match(/\s*\{/)){return[null,"{"]}return false},"$":function(w){w.match(/^[\w-]+/);if(w.match(/^\s*:/,false)){return["variable-2","variable-definition"]}return["variable-2","variable"]},"#":function(w){if(!w.eat("{")){return false}return[null,"interpolation"]}},name:"css",helperType:"scss"});p.defineMIME("text/x-less",{mediaTypes:t,mediaFeatures:i,propertyKeywords:h,nonStandardPropertyKeywords:e,colorKeywords:l,valueKeywords:q,fontProperties:f,allowNested:true,tokenHooks:{"/":function(x,w){if(x.eat("/")){x.skipToEnd();return["comment","comment"]}else{if(x.eat("*")){w.tokenize=u;return u(x,w)}else{return["operator","operator"]}}},"@":function(w){if(w.eat("{")){return[null,"interpolation"]}if(w.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,false)){return false}w.eatWhile(/[\w\\\-]/);if(w.match(/^\s*:/,false)){return["variable-2","variable-definition"]}return["variable-2","variable"]},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("gfm",function(d,h){var c=0;function f(i){i.code=false;return null}var g={startState:function(){return{code:false,codeBlock:false,ateSpace:false}},copyState:function(i){return{code:i.code,codeBlock:i.codeBlock,ateSpace:i.ateSpace}},token:function(k,j){j.combineTokens=null;if(j.codeBlock){if(k.match(/^```/)){j.codeBlock=false;return null}k.skipToEnd();return null}if(k.sol()){j.code=false}if(k.sol()&&k.match(/^```/)){k.skipToEnd();j.codeBlock=true;return null}if(k.peek()==="`"){k.next();var i=k.pos;k.eatWhile("`");var l=1+k.pos-i;if(!j.code){c=l;j.code=true}else{if(l===c){j.code=false}}return null}else{if(j.code){k.next();return null}}if(k.eatSpace()){j.ateSpace=true;return null}if(k.sol()||j.ateSpace){j.ateSpace=false;if(k.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)){j.combineTokens=true;return"link"}else{if(k.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)){j.combineTokens=true;return"link"}}}if(k.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&k.string.slice(k.start-2,k.start)!="]("){j.combineTokens=true;return"link"}k.next();return null},blankLine:f};var e={underscoresBreakWords:false,taskLists:true,fencedCodeBlocks:true,strikethrough:true};for(var b in h){e[b]=h[b]}e.name="markdown";return a.overlayMode(a.getMode(d,e),g)},"markdown");a.defineMIME("text/x-gfm","gfm")});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("htmlmixed",function(c,d){var b=a.getMode(c,{name:"xml",htmlMode:true,multilineTagIndentFactor:d.multilineTagIndentFactor,multilineTagIndentPastTag:d.multilineTagIndentPastTag});var n=a.getMode(c,"css");var l=[],k=d&&d.scriptTypes;l.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:a.getMode(c,"javascript")});if(k){for(var e=0;e<k.length;++e){var j=k[e];l.push({matches:j.matches,mode:j.mode&&a.getMode(c,j.mode)})}}l.push({matches:/./,mode:a.getMode(c,"text/plain")});function f(t,r){var p=r.htmlState.tagName;if(p){p=p.toLowerCase()}var q=b.token(t,r.htmlState);if(p=="script"&&/\btag\b/.test(q)&&t.current()==">"){var u=t.string.slice(Math.max(0,t.pos-100),t.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);u=u?u[1]:"";if(u&&/[\"\']/.test(u.charAt(0))){u=u.slice(1,u.length-1)}for(var o=0;o<l.length;++o){var s=l[o];if(typeof s.matches=="string"?u==s.matches:s.matches.test(u)){if(s.mode){r.token=m;r.localMode=s.mode;r.localState=s.mode.startState&&s.mode.startState(b.indent(r.htmlState,""))}break}}}else{if(p=="style"&&/\btag\b/.test(q)&&t.current()==">"){r.token=g;r.localMode=n;r.localState=n.startState(b.indent(r.htmlState,""))}}return q}function h(r,i,o){var q=r.current();var p=q.search(i);if(p>-1){r.backUp(q.length-p)}else{if(q.match(/<\/?$/)){r.backUp(q.length);if(!r.match(i,false)){r.match(q)}}}return o}function m(o,i){if(o.match(/^<\/\s*script\s*>/i,false)){i.token=f;i.localState=i.localMode=null;return null}return h(o,/<\/\s*script\s*>/,i.localMode.token(o,i.localState))}function g(o,i){if(o.match(/^<\/\s*style\s*>/i,false)){i.token=f;i.localState=i.localMode=null;return null}return h(o,/<\/\s*style\s*>/,n.token(o,i.localState))}return{startState:function(){var i=b.startState();return{token:f,localMode:null,localState:null,htmlState:i}},copyState:function(o){if(o.localState){var i=a.copyState(o.localMode,o.localState)}return{token:o.token,localMode:o.localMode,localState:i,htmlState:a.copyState(b,o.htmlState)}},token:function(o,i){return i.token(o,i)},indent:function(o,i){if(!o.localMode||/^\s*<\//.test(i)){return b.indent(o.htmlState,i)}else{if(o.localMode.indent){return o.localMode.indent(o.localState,i)}else{return a.Pass}}},innerMode:function(i){return{state:i.localState||i.htmlState,mode:i.localMode||b}}}},"xml","javascript","css");a.defineMIME("text/html","htmlmixed")});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("javascript",function(Z,aj){var l=Z.indentUnit;var A=aj.statementIndent;var aB=aj.jsonld;var z=aj.json||aB;var g=aj.typescript;var au=aj.wordCharacters||/[\w$\xa1-\uffff]/;var ar=function(){function aR(aT){return{type:aT,style:"keyword"}}var aM=aR("keyword a"),aK=aR("keyword b"),aJ=aR("keyword c");var aL=aR("operator"),aP={type:"atom",style:"atom"};var aN={"if":aR("if"),"while":aM,"with":aM,"else":aK,"do":aK,"try":aK,"finally":aK,"return":aJ,"break":aJ,"continue":aJ,"new":aJ,"delete":aJ,"throw":aJ,"debugger":aJ,"var":aR("var"),"const":aR("var"),let:aR("var"),"function":aR("function"),"catch":aR("catch"),"for":aR("for"),"switch":aR("switch"),"case":aR("case"),"default":aR("default"),"in":aL,"typeof":aL,"instanceof":aL,"true":aP,"false":aP,"null":aP,"undefined":aP,"NaN":aP,"Infinity":aP,"this":aR("this"),module:aR("module"),"class":aR("class"),"super":aR("atom"),yield:aJ,"export":aR("export"),"import":aR("import"),"extends":aJ};if(g){var aS={type:"variable",style:"variable-3"};var aO={"interface":aR("interface"),"extends":aR("extends"),constructor:aR("constructor"),"public":aR("public"),"private":aR("private"),"protected":aR("protected"),"static":aR("static"),string:aS,number:aS,bool:aS,any:aS};for(var aQ in aO){aN[aQ]=aO[aQ]}}return aN}();var P=/[+\-*&%=<>!?|~^]/;var aq=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function F(aM){var aK=false,aJ,aL=false;while((aJ=aM.next())!=null){if(!aK){if(aJ=="/"&&!aL){return}if(aJ=="["){aL=true}else{if(aL&&aJ=="]"){aL=false}}}aK=!aK&&aJ=="\\"}}var S,G;function L(aL,aK,aJ){S=aL;G=aJ;return aK}function U(aN,aL){var aJ=aN.next();if(aJ=='"'||aJ=="'"){aL.tokenize=R(aJ);return aL.tokenize(aN,aL)}else{if(aJ=="."&&aN.match(/^\d+(?:[eE][+\-]?\d+)?/)){return L("number","number")}else{if(aJ=="."&&aN.match("..")){return L("spread","meta")}else{if(/[\[\]{}\(\),;\:\.]/.test(aJ)){return L(aJ)}else{if(aJ=="="&&aN.eat(">")){return L("=>","operator")}else{if(aJ=="0"&&aN.eat(/x/i)){aN.eatWhile(/[\da-f]/i);return L("number","number")}else{if(/\d/.test(aJ)){aN.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return L("number","number")}else{if(aJ=="/"){if(aN.eat("*")){aL.tokenize=aA;return aA(aN,aL)}else{if(aN.eat("/")){aN.skipToEnd();return L("comment","comment")}else{if(aL.lastType=="operator"||aL.lastType=="keyword c"||aL.lastType=="sof"||/^[\[{}\(,;:]$/.test(aL.lastType)){F(aN);aN.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return L("regexp","string-2")}else{aN.eatWhile(P);return L("operator","operator",aN.current())}}}}else{if(aJ=="`"){aL.tokenize=aC;return aC(aN,aL)}else{if(aJ=="#"){aN.skipToEnd();return L("error","error")}else{if(P.test(aJ)){aN.eatWhile(P);return L("operator","operator",aN.current())}else{if(au.test(aJ)){aN.eatWhile(au);var aM=aN.current(),aK=ar.propertyIsEnumerable(aM)&&ar[aM];return(aK&&aL.lastType!=".")?L(aK.type,aK.style,aM):L("variable","variable",aM)}}}}}}}}}}}}}function R(aJ){return function(aN,aL){var aM=false,aK;if(aB&&aN.peek()=="@"&&aN.match(aq)){aL.tokenize=U;return L("jsonld-keyword","meta")}while((aK=aN.next())!=null){if(aK==aJ&&!aM){break}aM=!aM&&aK=="\\"}if(!aM){aL.tokenize=U}return L("string","string")}}function aA(aM,aL){var aJ=false,aK;while(aK=aM.next()){if(aK=="/"&&aJ){aL.tokenize=U;break}aJ=(aK=="*")}return L("comment","comment")}function aC(aM,aK){var aL=false,aJ;while((aJ=aM.next())!=null){if(!aL&&(aJ=="`"||aJ=="$"&&aM.eat("{"))){aK.tokenize=U;break}aL=!aL&&aJ=="\\"}return L("quasi","string-2",aM.current())}var m="([{}])";function ax(aP,aM){if(aM.fatArrowAt){aM.fatArrowAt=null}var aL=aP.string.indexOf("=>",aP.start);if(aL<0){return}var aO=0,aK=false;for(var aQ=aL-1;aQ>=0;--aQ){var aJ=aP.string.charAt(aQ);var aN=m.indexOf(aJ);if(aN>=0&&aN<3){if(!aO){++aQ;break}if(--aO==0){break}}else{if(aN>=3&&aN<6){++aO}else{if(au.test(aJ)){aK=true}else{if(/["'\/]/.test(aJ)){return}else{if(aK&&!aO){++aQ;break}}}}}}if(aK&&!aO){aM.fatArrowAt=aQ}}var b={atom:true,number:true,variable:true,string:true,regexp:true,"this":true,"jsonld-keyword":true};function J(aO,aK,aJ,aN,aL,aM){this.indented=aO;this.column=aK;this.type=aJ;this.prev=aL;this.info=aM;if(aN!=null){this.align=aN}}function s(aM,aL){for(var aK=aM.localVars;aK;aK=aK.next){if(aK.name==aL){return true}}for(var aJ=aM.context;aJ;aJ=aJ.prev){for(var aK=aJ.vars;aK;aK=aK.next){if(aK.name==aL){return true}}}}function f(aN,aK,aJ,aM,aO){var aP=aN.cc;D.state=aN;D.stream=aO;D.marked=null,D.cc=aP;D.style=aK;if(!aN.lexical.hasOwnProperty("align")){aN.lexical.align=true}while(true){var aL=aP.length?aP.pop():z?an:aH;if(aL(aJ,aM)){while(aP.length&&aP[aP.length-1].lex){aP.pop()()}if(D.marked){return D.marked}if(aJ=="variable"&&s(aN,aM)){return"variable-2"}return aK}}}var D={state:null,column:null,marked:null,cc:null};function aa(){for(var aJ=arguments.length-1;aJ>=0;aJ--){D.cc.push(arguments[aJ])}}function ae(){aa.apply(null,arguments);return true}function aw(aK){function aJ(aN){for(var aM=aN;aM;aM=aM.next){if(aM.name==aK){return true}}return false}var aL=D.state;if(aL.context){D.marked="def";if(aJ(aL.localVars)){return}aL.localVars={name:aK,next:aL.localVars}}else{if(aJ(aL.globalVars)){return}if(aj.globalVars){aL.globalVars={name:aK,next:aL.globalVars}}}}var q={name:"this",next:{name:"arguments"}};function w(){D.state.context={prev:D.state.context,vars:D.state.localVars};D.state.localVars=q}function x(){D.state.localVars=D.state.context.vars;D.state.context=D.state.context.prev}function aF(aK,aL){var aJ=function(){var aO=D.state,aM=aO.indented;if(aO.lexical.type=="stat"){aM=aO.lexical.indented}else{for(var aN=aO.lexical;aN&&aN.type==")"&&aN.align;aN=aN.prev){aM=aN.indented}}aO.lexical=new J(aM,D.stream.column(),aK,null,aO.lexical,aL)};aJ.lex=true;return aJ}function h(){var aJ=D.state;if(aJ.lexical.prev){if(aJ.lexical.type==")"){aJ.indented=aJ.lexical.indented}aJ.lexical=aJ.lexical.prev}}h.lex=true;function r(aJ){function aK(aL){if(aL==aJ){return ae()}else{if(aJ==";"){return aa()}else{return ae(aK)}}}return aK}function aH(aJ,aK){if(aJ=="var"){return ae(aF("vardef",aK.length),d,r(";"),h)}if(aJ=="keyword a"){return ae(aF("form"),an,aH,h)}if(aJ=="keyword b"){return ae(aF("form"),aH,h)}if(aJ=="{"){return ae(aF("}"),y,h)}if(aJ==";"){return ae()}if(aJ=="if"){if(D.state.lexical.info=="else"&&D.state.cc[D.state.cc.length-1]==h){D.state.cc.pop()()}return ae(aF("form"),an,aH,h,e)}if(aJ=="function"){return ae(M)}if(aJ=="for"){return ae(aF("form"),u,aH,h)}if(aJ=="variable"){return ae(aF("stat"),aI)}if(aJ=="switch"){return ae(aF("form"),an,aF("}","switch"),r("{"),y,h,h)}if(aJ=="case"){return ae(an,r(":"))}if(aJ=="default"){return ae(r(":"))}if(aJ=="catch"){return ae(aF("form"),w,r("("),af,r(")"),aH,h,x)}if(aJ=="module"){return ae(aF("form"),w,H,x,h)}if(aJ=="class"){return ae(aF("form"),V,h)}if(aJ=="export"){return ae(aF("form"),aG,h)}if(aJ=="import"){return ae(aF("form"),ag,h)}return aa(aF("stat"),an,r(";"),h)}function an(aJ){return Y(aJ,false)}function aE(aJ){return Y(aJ,true)}function Y(aK,aM){if(D.state.fatArrowAt==D.stream.start){var aJ=aM?N:W;if(aK=="("){return ae(w,aF(")"),at(i,")"),h,r("=>"),aJ,x)}else{if(aK=="variable"){return aa(w,i,r("=>"),aJ,x)}}}var aL=aM?j:ab;if(b.hasOwnProperty(aK)){return ae(aL)}if(aK=="function"){return ae(M,aL)}if(aK=="keyword c"){return ae(aM?ak:ai)}if(aK=="("){return ae(aF(")"),ai,az,r(")"),h,aL)}if(aK=="operator"||aK=="spread"){return ae(aM?aE:an)}if(aK=="["){return ae(aF("]"),n,h,aL)}if(aK=="{"){return ay(t,"}",null,aL)}if(aK=="quasi"){return aa(Q,aL)}return ae()}function ai(aJ){if(aJ.match(/[;\}\)\],]/)){return aa()}return aa(an)}function ak(aJ){if(aJ.match(/[;\}\)\],]/)){return aa()}return aa(aE)}function ab(aJ,aK){if(aJ==","){return ae(an)}return j(aJ,aK,false)}function j(aJ,aL,aN){var aK=aN==false?ab:j;var aM=aN==false?an:aE;if(aJ=="=>"){return ae(w,aN?N:W,x)}if(aJ=="operator"){if(/\+\+|--/.test(aL)){return ae(aK)}if(aL=="?"){return ae(an,r(":"),aM)}return ae(aM)}if(aJ=="quasi"){return aa(Q,aK)}if(aJ==";"){return}if(aJ=="("){return ay(aE,")","call",aK)}if(aJ=="."){return ae(al,aK)}if(aJ=="["){return ae(aF("]"),ai,r("]"),h,aK)}}function Q(aJ,aK){if(aJ!="quasi"){return aa()}if(aK.slice(aK.length-2)!="${"){return ae(Q)}return ae(an,p)}function p(aJ){if(aJ=="}"){D.marked="string-2";D.state.tokenize=aC;return ae(Q)}}function W(aJ){ax(D.stream,D.state);return aa(aJ=="{"?aH:an)}function N(aJ){ax(D.stream,D.state);return aa(aJ=="{"?aH:aE)}function aI(aJ){if(aJ==":"){return ae(h,aH)}return aa(ab,r(";"),h)}function al(aJ){if(aJ=="variable"){D.marked="property";return ae()}}function t(aJ,aK){if(aJ=="variable"||D.style=="keyword"){D.marked="property";if(aK=="get"||aK=="set"){return ae(I)}return ae(K)}else{if(aJ=="number"||aJ=="string"){D.marked=aB?"property":(D.style+" property");return ae(K)}else{if(aJ=="jsonld-keyword"){return ae(K)}else{if(aJ=="["){return ae(an,r("]"),K)}}}}}function I(aJ){if(aJ!="variable"){return aa(K)}D.marked="property";return ae(M)}function K(aJ){if(aJ==":"){return ae(aE)}if(aJ=="("){return aa(M)}}function at(aL,aJ){function aK(aN){if(aN==","){var aM=D.state.lexical;if(aM.info=="call"){aM.pos=(aM.pos||0)+1}return ae(aL,aK)}if(aN==aJ){return ae()}return ae(r(aJ))}return function(aM){if(aM==aJ){return ae()}return aa(aL,aK)}}function ay(aM,aJ,aL){for(var aK=3;aK<arguments.length;aK++){D.cc.push(arguments[aK])}return ae(aF(aJ,aL),at(aM,aJ),h)}function y(aJ){if(aJ=="}"){return ae()}return aa(aH,y)}function T(aJ){if(g&&aJ==":"){return ae(ad)}}function av(aJ,aK){if(aK=="="){return ae(aE)}}function ad(aJ){if(aJ=="variable"){D.marked="variable-3";return ae()}}function d(){return aa(i,T,ac,X)}function i(aJ,aK){if(aJ=="variable"){aw(aK);return ae()}if(aJ=="["){return ay(i,"]")}if(aJ=="{"){return ay(aD,"}")}}function aD(aJ,aK){if(aJ=="variable"&&!D.stream.match(/^\s*:/,false)){aw(aK);return ae(ac)}if(aJ=="variable"){D.marked="property"}return ae(r(":"),i,ac)}function ac(aJ,aK){if(aK=="="){return ae(aE)}}function X(aJ){if(aJ==","){return ae(d)}}function e(aJ,aK){if(aJ=="keyword b"&&aK=="else"){return ae(aF("form","else"),aH,h)}}function u(aJ){if(aJ=="("){return ae(aF(")"),E,r(")"),h)}}function E(aJ){if(aJ=="var"){return ae(d,r(";"),C)}if(aJ==";"){return ae(C)}if(aJ=="variable"){return ae(v)}return aa(an,r(";"),C)}function v(aJ,aK){if(aK=="in"||aK=="of"){D.marked="keyword";return ae(an)}return ae(ab,C)}function C(aJ,aK){if(aJ==";"){return ae(B)}if(aK=="in"||aK=="of"){D.marked="keyword";return ae(an)}return aa(an,r(";"),B)}function B(aJ){if(aJ!=")"){ae(an)}}function M(aJ,aK){if(aK=="*"){D.marked="keyword";return ae(M)}if(aJ=="variable"){aw(aK);return ae(M)}if(aJ=="("){return ae(w,aF(")"),at(af,")"),h,aH,x)}}function af(aJ){if(aJ=="spread"){return ae(af)}return aa(i,T,av)}function V(aJ,aK){if(aJ=="variable"){aw(aK);return ae(O)}}function O(aJ,aK){if(aK=="extends"){return ae(an,O)}if(aJ=="{"){return ae(aF("}"),o,h)}}function o(aJ,aK){if(aJ=="variable"||D.style=="keyword"){if(aK=="static"){D.marked="keyword";return ae(o)}D.marked="property";if(aK=="get"||aK=="set"){return ae(c,M,o)}return ae(M,o)}if(aK=="*"){D.marked="keyword";return ae(o)}if(aJ==";"){return ae(o)}if(aJ=="}"){return ae()}}function c(aJ){if(aJ!="variable"){return aa()}D.marked="property";return ae()}function H(aJ,aK){if(aJ=="string"){return ae(aH)}if(aJ=="variable"){aw(aK);return ae(ah)}}function aG(aJ,aK){if(aK=="*"){D.marked="keyword";return ae(ah,r(";"))}if(aK=="default"){D.marked="keyword";return ae(an,r(";"))}return aa(aH)}function ag(aJ){if(aJ=="string"){return ae()}return aa(ap,ah)}function ap(aJ,aK){if(aJ=="{"){return ay(ap,"}")}if(aJ=="variable"){aw(aK)}if(aK=="*"){D.marked="keyword"}return ae(k)}function k(aJ,aK){if(aK=="as"){D.marked="keyword";return ae(ap)}}function ah(aJ,aK){if(aK=="from"){D.marked="keyword";return ae(an)}}function n(aJ){if(aJ=="]"){return ae()}return aa(aE,am)}function am(aJ){if(aJ=="for"){return aa(az,r("]"))}if(aJ==","){return ae(at(ak,"]"))}return aa(at(aE,"]"))}function az(aJ){if(aJ=="for"){return ae(u,az)}if(aJ=="if"){return ae(an,az)}}function ao(aK,aJ){return aK.lastType=="operator"||aK.lastType==","||P.test(aJ.charAt(0))||/[,.]/.test(aJ.charAt(0))}return{startState:function(aK){var aJ={tokenize:U,lastType:"sof",cc:[],lexical:new J((aK||0)-l,0,"block",false),localVars:aj.localVars,context:aj.localVars&&{vars:aj.localVars},indented:0};if(aj.globalVars&&typeof aj.globalVars=="object"){aJ.globalVars=aj.globalVars}return aJ},token:function(aL,aK){if(aL.sol()){if(!aK.lexical.hasOwnProperty("align")){aK.lexical.align=false}aK.indented=aL.indentation();ax(aL,aK)}if(aK.tokenize!=aA&&aL.eatSpace()){return null}var aJ=aK.tokenize(aL,aK);if(S=="comment"){return aJ}aK.lastType=S=="operator"&&(G=="++"||G=="--")?"incdec":S;return f(aK,aJ,S,G,aL)},indent:function(aP,aJ){if(aP.tokenize==aA){return a.Pass}if(aP.tokenize!=U){return 0}var aO=aJ&&aJ.charAt(0),aM=aP.lexical;if(!/^\s*else\b/.test(aJ)){for(var aL=aP.cc.length-1;aL>=0;--aL){var aQ=aP.cc[aL];if(aQ==h){aM=aM.prev}else{if(aQ!=e){break}}}}if(aM.type=="stat"&&aO=="}"){aM=aM.prev}if(A&&aM.type==")"&&aM.prev.type=="stat"){aM=aM.prev}var aN=aM.type,aK=aO==aN;if(aN=="vardef"){return aM.indented+(aP.lastType=="operator"||aP.lastType==","?aM.info+1:0)}else{if(aN=="form"&&aO=="{"){return aM.indented}else{if(aN=="form"){return aM.indented+l}else{if(aN=="stat"){return aM.indented+(ao(aP,aJ)?A||l:0)}else{if(aM.info=="switch"&&!aK&&aj.doubleIndentSwitch!=false){return aM.indented+(/^(?:case|default)\b/.test(aJ)?l:2*l)}else{if(aM.align){return aM.column+(aK?0:1)}else{return aM.indented+(aK?0:l)}}}}}}},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:z?null:"/*",blockCommentEnd:z?null:"*/",lineComment:z?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:z?"json":"javascript",jsonldMode:aB,jsonMode:z}});a.registerHelper("wordChars","javascript",/[\w$]/);a.defineMIME("text/javascript","javascript");a.defineMIME("text/ecmascript","javascript");a.defineMIME("application/javascript","javascript");a.defineMIME("application/x-javascript","javascript");a.defineMIME("application/ecmascript","javascript");a.defineMIME("application/json",{name:"javascript",json:true});a.defineMIME("application/x-json",{name:"javascript",json:true});a.defineMIME("application/ld+json",{name:"javascript",jsonld:true});a.defineMIME("text/typescript",{name:"javascript",typescript:true});a.defineMIME("application/typescript",{name:"javascript",typescript:true})});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"),require("../xml/xml"),require("../meta"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","../xml/xml","../meta"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("markdown",function(y,z){var p=a.modes.hasOwnProperty("xml");var j=a.getMode(y,p?{name:"xml",htmlMode:true}:"text/plain");function F(X){if(a.findModeByName){var Y=a.findModeByName(X);if(Y){X=Y.mime||Y.mimes[0]}}var Z=a.getMode(y,X);return Z.name=="null"?null:Z}if(z.highlightFormatting===undefined){z.highlightFormatting=false}if(z.maxBlockquoteDepth===undefined){z.maxBlockquoteDepth=0}if(z.underscoresBreakWords===undefined){z.underscoresBreakWords=true}if(z.fencedCodeBlocks===undefined){z.fencedCodeBlocks=false}if(z.taskLists===undefined){z.taskLists=false}if(z.strikethrough===undefined){z.strikethrough=false}var k=0;var i="header",g="comment",r="quote",Q="variable-2",N="variable-3",M="keyword",P="hr",h="tag",u="formatting",q="link",m="link",G="link",E="string",R="em",A="strong",n="strikethrough";var b=/^([*\-_])(?:\s*\1){2,}\s*$/,e=/^[*\-+]\s+/,C=/^[0-9]+([.)])\s+/,t=/^\[(x| )\](?=\s)/,T=/^(#+)(?: |$)/,W=/^ *(?:\={1,}|-{1,})\s*$/,B=/^[^#!\[\]*_\\<>` "'(~]+/;function U(Z,Y,X){Y.f=Y.inline=X;return X(Z,Y)}function D(Z,Y,X){Y.f=Y.block=X;return X(Z,Y)}function c(X){X.linkTitle=false;X.em=false;X.strong=false;X.strikethrough=false;X.quote=0;X.indentedCode=false;if(!p&&X.f==s){X.f=S;X.block=J}X.trailingSpace=0;X.trailingSpaceNewLine=false;X.thisLineHasContent=false;return null}function J(ad,ac){var ab=ad.sol();var Z=ac.list!==false,X=ac.indentedCode;ac.indentedCode=false;if(Z){if(ac.indentationDiff>=0){if(ac.indentationDiff<4){ac.indentation-=ac.indentationDiff}ac.list=null}else{if(ac.indentation>0){ac.list=null;ac.listDepth=Math.floor(ac.indentation/4)}else{ac.list=false;ac.listDepth=0}}}var Y=null;if(ac.indentationDiff>=4){ad.skipToEnd();if(X||!ac.prevLineHasContent){ac.indentation-=4;ac.indentedCode=true;return g}else{return null}}else{if(ad.eatSpace()){return null}else{if((Y=ad.match(T))&&Y[1].length<=6){ac.header=Y[1].length;if(z.highlightFormatting){ac.formatting="header"}ac.f=ac.inline;return w(ac)}else{if(ac.prevLineHasContent&&!ac.quote&&!Z&&!X&&(Y=ad.match(W))){ac.header=Y[0].charAt(0)=="="?1:2;if(z.highlightFormatting){ac.formatting="header"}ac.f=ac.inline;return w(ac)}else{if(ad.eat(">")){ac.quote=ab?1:ac.quote+1;if(z.highlightFormatting){ac.formatting="quote"}ad.eatSpace();return w(ac)}else{if(ad.peek()==="["){return U(ad,ac,d)}else{if(ad.match(b,true)){ac.hr=true;return P}else{if((!ac.prevLineHasContent||Z)&&(ad.match(e,false)||ad.match(C,false))){var aa=null;if(ad.match(e,true)){aa="ul"}else{ad.match(C,true);aa="ol"}ac.indentation+=4;ac.list=true;ac.listDepth++;if(z.taskLists&&ad.match(t,false)){ac.taskList=true}ac.f=ac.inline;if(z.highlightFormatting){ac.formatting=["list","list-"+aa]}return w(ac)}else{if(z.fencedCodeBlocks&&ad.match(/^```[ \t]*([\w+#]*)/,true)){ac.localMode=F(RegExp.$1);if(ac.localMode){ac.localState=ac.localMode.startState()}ac.f=ac.block=I;if(z.highlightFormatting){ac.formatting="code-block"}ac.code=true;return w(ac)}}}}}}}}}return U(ad,ac,ac.inline)}function s(Z,Y){var X=j.token(Z,Y.htmlState);if((p&&Y.htmlState.tagStart===null&&(!Y.htmlState.context&&Y.htmlState.tokenize.isInText))||(Y.md_inside&&Z.current().indexOf(">")>-1)){Y.f=S;Y.block=J;Y.htmlState=null}return X}function I(Y,X){if(Y.sol()&&Y.match("```",false)){X.localMode=X.localState=null;X.f=X.block=O;return null}else{if(X.localMode){return X.localMode.token(Y,X.localState)}else{Y.skipToEnd();return g}}}function O(Z,Y){Z.match("```");Y.block=J;Y.f=S;if(z.highlightFormatting){Y.formatting="code-block"}Y.code=true;var X=w(Y);Y.code=false;return X}function w(aa){var Z=[];if(aa.formatting){Z.push(u);if(typeof aa.formatting==="string"){aa.formatting=[aa.formatting]}for(var X=0;X<aa.formatting.length;X++){Z.push(u+"-"+aa.formatting[X]);if(aa.formatting[X]==="header"){Z.push(u+"-"+aa.formatting[X]+"-"+aa.header)}if(aa.formatting[X]==="quote"){if(!z.maxBlockquoteDepth||z.maxBlockquoteDepth>=aa.quote){Z.push(u+"-"+aa.formatting[X]+"-"+aa.quote)}else{Z.push("error")}}}}if(aa.taskOpen){Z.push("meta");return Z.length?Z.join(" "):null}if(aa.taskClosed){Z.push("property");return Z.length?Z.join(" "):null}if(aa.linkHref){Z.push(E,"url")}else{if(aa.strong){Z.push(A)}if(aa.em){Z.push(R)}if(aa.strikethrough){Z.push(n)}if(aa.linkText){Z.push(G)}if(aa.code){Z.push(g)}}if(aa.header){Z.push(i);Z.push(i+"-"+aa.header)}if(aa.quote){Z.push(r);if(!z.maxBlockquoteDepth||z.maxBlockquoteDepth>=aa.quote){Z.push(r+"-"+aa.quote)}else{Z.push(r+"-"+z.maxBlockquoteDepth)}}if(aa.list!==false){var Y=(aa.listDepth-1)%3;if(!Y){Z.push(Q)}else{if(Y===1){Z.push(N)}else{Z.push(M)}}}if(aa.trailingSpaceNewLine){Z.push("trailing-space-new-line")}else{if(aa.trailingSpace){Z.push("trailing-space-"+(aa.trailingSpace%2?"a":"b"))}}return Z.length?Z.join(" "):null}function o(Y,X){if(Y.match(B,true)){return w(X)}return undefined}function S(ac,ab){var am=ab.text(ac,ab);if(typeof am!=="undefined"){return am}if(ab.list){ab.list=null;return w(ab)}if(ab.taskList){var ai=ac.match(t,true)[1]!=="x";if(ai){ab.taskOpen=true}else{ab.taskClosed=true}if(z.highlightFormatting){ab.formatting="task"}ab.taskList=false;return w(ab)}ab.taskOpen=false;ab.taskClosed=false;if(ab.header&&ac.match(/^#+$/,true)){if(z.highlightFormatting){ab.formatting="header"}return w(ab)}var X=ac.sol();var af=ac.next();if(af==="\\"){ac.next();if(z.highlightFormatting){var Z=w(ab);return Z?Z+" formatting-escape":"formatting-escape"}}if(ab.linkTitle){ab.linkTitle=false;var al=af;if(af==="("){al=")"}al=(al+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var Y="^\\s*(?:[^"+al+"\\\\]+|\\\\\\\\|\\\\.)"+al;if(ac.match(new RegExp(Y),true)){return E}}if(af==="`"){var ak=ab.formatting;if(z.highlightFormatting){ab.formatting="code"}var ag=w(ab);var ah=ac.pos;ac.eatWhile("`");var an=1+ac.pos-ah;if(!ab.code){k=an;ab.code=true;return w(ab)}else{if(an===k){ab.code=false;return ag}ab.formatting=ak;return w(ab)}}else{if(ab.code){return w(ab)}}if(af==="!"&&ac.match(/\[[^\]]*\] ?(?:\(|\[)/,false)){ac.match(/\[[^\]]*\]/);ab.inline=ab.f=x;return h}if(af==="["&&ac.match(/.*\](\(.*\)| ?\[.*\])/,false)){ab.linkText=true;if(z.highlightFormatting){ab.formatting="link"}return w(ab)}if(af==="]"&&ab.linkText&&ac.match(/\(.*\)| ?\[.*\]/,false)){if(z.highlightFormatting){ab.formatting="link"}var Z=w(ab);ab.linkText=false;ab.inline=ab.f=x;return Z}if(af==="<"&&ac.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,false)){ab.f=ab.inline=L;if(z.highlightFormatting){ab.formatting="link"}var Z=w(ab);if(Z){Z+=" "}else{Z=""}return Z+q}if(af==="<"&&ac.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,false)){ab.f=ab.inline=L;if(z.highlightFormatting){ab.formatting="link"}var Z=w(ab);if(Z){Z+=" "}else{Z=""}return Z+m}if(af==="<"&&ac.match(/^(!--|\w)/,false)){var aa=ac.string.indexOf(">",ac.pos);if(aa!=-1){var aj=ac.string.substring(ac.start,aa);if(/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(aj)){ab.md_inside=true}}ac.backUp(1);ab.htmlState=a.startState(j);return D(ac,ab,s)}if(af==="<"&&ac.match(/^\/\w*?>/)){ab.md_inside=false;return"tag"}var ae=false;if(!z.underscoresBreakWords){if(af==="_"&&ac.peek()!=="_"&&ac.match(/(\w)/,false)){var ad=ac.pos-2;if(ad>=0){var ao=ac.string.charAt(ad);if(ao!=="_"&&ao.match(/(\w)/,false)){ae=true}}}}if(af==="*"||(af==="_"&&!ae)){if(X&&ac.peek()===" "){}else{if(ab.strong===af&&ac.eat(af)){if(z.highlightFormatting){ab.formatting="strong"}var ag=w(ab);ab.strong=false;return ag}else{if(!ab.strong&&ac.eat(af)){ab.strong=af;if(z.highlightFormatting){ab.formatting="strong"}return w(ab)}else{if(ab.em===af){if(z.highlightFormatting){ab.formatting="em"}var ag=w(ab);ab.em=false;return ag}else{if(!ab.em){ab.em=af;if(z.highlightFormatting){ab.formatting="em"}return w(ab)}}}}}}else{if(af===" "){if(ac.eat("*")||ac.eat("_")){if(ac.peek()===" "){return w(ab)}else{ac.backUp(1)}}}}if(z.strikethrough){if(af==="~"&&ac.eatWhile(af)){if(ab.strikethrough){if(z.highlightFormatting){ab.formatting="strikethrough"}var ag=w(ab);ab.strikethrough=false;return ag}else{if(ac.match(/^[^\s]/,false)){ab.strikethrough=true;if(z.highlightFormatting){ab.formatting="strikethrough"}return w(ab)}}}else{if(af===" "){if(ac.match(/^~~/,true)){if(ac.peek()===" "){return w(ab)}else{ac.backUp(2)}}}}}if(af===" "){if(ac.match(/ +$/,false)){ab.trailingSpace++}else{if(ab.trailingSpace){ab.trailingSpaceNewLine=true}}}return w(ab)}function L(aa,Z){var Y=aa.next();if(Y===">"){Z.f=Z.inline=S;if(z.highlightFormatting){Z.formatting="link"}var X=w(Z);if(X){X+=" "}else{X=""}return X+q}aa.match(/^[^>]+/,true);return q}function x(Z,Y){if(Z.eatSpace()){return null}var X=Z.next();if(X==="("||X==="["){Y.f=Y.inline=K(X==="("?")":"]");if(z.highlightFormatting){Y.formatting="link-string"}Y.linkHref=true;return w(Y)}return"error"}function K(X){return function(ab,aa){var Z=ab.next();if(Z===X){aa.f=aa.inline=S;if(z.highlightFormatting){aa.formatting="link-string"}var Y=w(aa);aa.linkHref=false;return Y}if(ab.match(v(X),true)){ab.backUp(1)}aa.linkHref=true;return w(aa)}}function d(Y,X){if(Y.match(/^[^\]]*\]:/,false)){X.f=H;Y.next();if(z.highlightFormatting){X.formatting="link"}X.linkText=true;return w(X)}return U(Y,X,S)}function H(Z,Y){if(Z.match(/^\]:/,true)){Y.f=Y.inline=f;if(z.highlightFormatting){Y.formatting="link"}var X=w(Y);Y.linkText=false;return X}Z.match(/^[^\]]+/,true);return G}function f(Y,X){if(Y.eatSpace()){return null}Y.match(/^[^\s]+/,true);if(Y.peek()===undefined){X.linkTitle=true}else{Y.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,true)}X.f=X.inline=S;return E+" url"}var V=[];function v(X){if(!V[X]){X=(X+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");V[X]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+X+")")}return V[X]}var l={startState:function(){return{f:J,prevLineHasContent:false,thisLineHasContent:false,block:J,htmlState:null,indentation:0,inline:S,text:o,formatting:false,linkText:false,linkHref:false,linkTitle:false,em:false,strong:false,header:0,hr:false,taskList:false,list:false,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:false,strikethrough:false}},copyState:function(X){return{f:X.f,prevLineHasContent:X.prevLineHasContent,thisLineHasContent:X.thisLineHasContent,block:X.block,htmlState:X.htmlState&&a.copyState(j,X.htmlState),indentation:X.indentation,localMode:X.localMode,localState:X.localMode?a.copyState(X.localMode,X.localState):null,inline:X.inline,text:X.text,formatting:false,linkTitle:X.linkTitle,em:X.em,strong:X.strong,strikethrough:X.strikethrough,header:X.header,hr:X.hr,taskList:X.taskList,list:X.list,listDepth:X.listDepth,quote:X.quote,indentedCode:X.indentedCode,trailingSpace:X.trailingSpace,trailingSpaceNewLine:X.trailingSpaceNewLine,md_inside:X.md_inside}},token:function(ab,aa){aa.formatting=false;if(ab.sol()){var X=!!aa.header||aa.hr;aa.header=0;aa.hr=false;if(ab.match(/^\s*$/,true)||X){aa.prevLineHasContent=false;c(aa);return X?this.token(ab,aa):null}else{aa.prevLineHasContent=aa.thisLineHasContent;aa.thisLineHasContent=true}aa.taskList=false;aa.code=false;aa.trailingSpace=0;aa.trailingSpaceNewLine=false;aa.f=aa.block;var Y=ab.match(/^\s*/,true)[0].replace(/\t/g," ").length;var ac=Math.floor((Y-aa.indentation)/4)*4;if(ac>4){ac=4}var Z=aa.indentation+ac;aa.indentationDiff=Z-aa.indentation;aa.indentation=Z;if(Y>0){return null}}return aa.f(ab,aa)},innerMode:function(X){if(X.block==s){return{state:X.htmlState,mode:j}}if(X.localState){return{state:X.localState,mode:X.localMode}}return{state:X,mode:l}},blankLine:c,getType:w,fold:"markdown"};return l},"xml");a.defineMIME("text/x-markdown","markdown")});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],a)}else{a(CodeMirror)}}})(function(d){function f(m){var k={},l=m.split(" ");for(var j=0;j<l.length;++j){k[l[j]]=true}return k}function e(l,j,k){if(l.length==0){return b(j)}return function(p,o){var n=l[0];for(var m=0;m<n.length;m++){if(p.match(n[m][0])){o.tokenize=e(l.slice(1),j);return n[m][1]}}o.tokenize=b(j,k);return"string"}}function b(k,j){return function(m,l){return c(m,l,k,j)}}function c(n,l,k,j){if(j!==false&&n.match("${",false)||n.match("{$",false)){l.tokenize=null;return"string"}if(j!==false&&n.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)){if(n.match("[",false)){l.tokenize=e([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],k,j)}if(n.match(/\-\>\w/,false)){l.tokenize=e([[["->",null]],[[/[\w]+/,"variable"]]],k,j)}return"variable-2"}var m=false;while(!n.eol()&&(m||j===false||(!n.match("{$",false)&&!n.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,false)))){if(!m&&n.match(k)){l.tokenize=null;l.tokStack.pop();l.tokStack.pop();break}m=n.next()=="\\"&&!m}return"string"}var h="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally";var i="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__";var a="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";d.registerHelper("hintWords","php",[h,i,a].join(" ").split(" "));d.registerHelper("wordChars","php",/[\w$]/);var g={name:"clike",helperType:"php",keywords:f(h),blockKeywords:f("catch do else elseif for foreach if switch try while finally"),defKeywords:f("class function interface namespace trait"),atoms:f(i),builtin:f(a),multiLineStrings:true,hooks:{"$":function(j){j.eatWhile(/[\w\$_]/);return"variable-2"},"<":function(m,k){if(m.match(/<</)){var j=m.eat("'");m.eatWhile(/[\w\.]/);var l=m.current().slice(3+(j?1:0));if(j){m.eat("'")}if(l){(k.tokStack||(k.tokStack=[])).push(l,0);k.tokenize=b(l,j?false:true);return"string"}}return false},"#":function(j){while(!j.eol()&&!j.match("?>",false)){j.next()}return"comment"},"/":function(j){if(j.eat("/")){while(!j.eol()&&!j.match("?>",false)){j.next()}return"comment"}return false},'"':function(j,k){(k.tokStack||(k.tokStack=[])).push('"',0);k.tokenize=b('"');return"string"},"{":function(j,k){if(k.tokStack&&k.tokStack.length){k.tokStack[k.tokStack.length-1]++}return false},"}":function(j,k){if(k.tokStack&&k.tokStack.length>0&&!--k.tokStack[k.tokStack.length-1]){k.tokenize=b(k.tokStack[k.tokStack.length-2])}return false}}};d.defineMode("php",function(l,m){var n=d.getMode(l,"text/html");var j=d.getMode(l,g);function k(u,s){var r=s.curMode==j;if(u.sol()&&s.pending&&s.pending!='"'&&s.pending!="'"){s.pending=null}if(!r){if(u.match(/^<\?\w*/)){s.curMode=j;s.curState=s.php;return"meta"}if(s.pending=='"'||s.pending=="'"){while(!u.eol()&&u.next()!=s.pending){}var q="string"}else{if(s.pending&&u.pos<s.pending.end){u.pos=s.pending.end;var q=s.pending.style}else{var q=n.token(u,s.curState)}}if(s.pending){s.pending=null}var t=u.current(),p=t.search(/<\?/),o;if(p!=-1){if(q=="string"&&(o=t.match(/[\'\"]$/))&&!/\?>/.test(t)){s.pending=o[0]}else{s.pending={end:u.pos,style:q}}u.backUp(t.length-p)}return q}else{if(r&&s.php.tokenize==null&&u.match("?>")){s.curMode=n;s.curState=s.html;return"meta"}else{return j.token(u,s.curState)}}}return{startState:function(){var o=d.startState(n),p=d.startState(j);return{html:o,php:p,curMode:m.startOpen?j:n,curState:m.startOpen?p:o,pending:null}},copyState:function(r){var p=r.html,q=d.copyState(n,p),t=r.php,o=d.copyState(j,t),s;if(r.curMode==n){s=q}else{s=o}return{html:q,php:o,curMode:r.curMode,curState:s,pending:r.pending}},token:k,indent:function(p,o){if((p.curMode!=j&&/^\s*<\//.test(o))||(p.curMode==j&&/^\?>/.test(o))){return n.indent(p.html,o)}return p.curMode.indent(p.curState,o)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(o){return{state:o.curState,mode:o.curMode}}}},"htmlmixed","clike");d.defineMIME("application/x-httpd-php","php");d.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:true});d.defineMIME("text/x-php",g)});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("sass",function(f){function p(q){return new RegExp("^"+q.join("|"))}var k=["true","false","null","auto"];var b=new RegExp("^"+k.join("|"));var i=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"];var n=p(i);var o=/^::?[a-zA-Z_][\w\-]*/;function m(s,r){var q=s.peek();if(q===")"){s.next();r.tokenizer=g;return"operator"}else{if(q==="("){s.next();s.eatSpace();return"operator"}else{if(q==="'"||q==='"'){r.tokenizer=h(s.next());return"string"}else{r.tokenizer=h(")",false);return"string"}}}}function l(q,r){return function(t,s){if(t.sol()&&t.indentation()<=q){s.tokenizer=g;return g(t,s)}if(r&&t.skipTo("*/")){t.next();t.next();s.tokenizer=g}else{t.skipToEnd()}return"comment"}}function h(q,s){if(s==null){s=true}function r(x,u){var w=x.next();var t=x.peek();var y=x.string.charAt(x.pos-2);var v=((w!=="\\"&&t===q)||(w===q&&y!=="\\"));if(v){if(w!==q&&s){x.next()}u.tokenizer=g;return"string"}else{if(w==="#"&&t==="{"){u.tokenizer=d(r);x.next();return"operator"}else{return"string"}}}return r}function d(q){return function(s,r){if(s.peek()==="}"){s.next();r.tokenizer=q;return"operator"}else{return g(s,r)}}}function e(r){if(r.indentCount==0){r.indentCount++;var s=r.scopes[0].offset;var q=s+f.indentUnit;r.scopes.unshift({offset:q})}}function j(q){if(q.scopes.length==1){return}q.scopes.shift()}function g(s,r){var q=s.peek();if(s.match("/*")){r.tokenizer=l(s.indentation(),true);return r.tokenizer(s,r)}if(s.match("//")){r.tokenizer=l(s.indentation(),false);return r.tokenizer(s,r)}if(s.match("#{")){r.tokenizer=d(g);return"operator"}if(q==='"'||q==="'"){s.next();r.tokenizer=h(q);return"string"}if(!r.cursorHalf){if(q==="."){s.next();if(s.match(/^[\w-]+/)){e(r);return"atom"}else{if(s.peek()==="#"){e(r);return"atom"}}}if(q==="#"){s.next();if(s.match(/^[\w-]+/)){e(r);return"atom"}if(s.peek()==="#"){e(r);return"atom"}}if(q==="$"){s.next();s.eatWhile(/[\w-]/);return"variable-2"}if(s.match(/^-?[0-9\.]+/)){return"number"}if(s.match(/^(px|em|in)\b/)){return"unit"}if(s.match(b)){return"keyword"}if(s.match(/^url/)&&s.peek()==="("){r.tokenizer=m;return"atom"}if(q==="="){if(s.match(/^=[\w-]+/)){e(r);return"meta"}}if(q==="+"){if(s.match(/^\+[\w-]+/)){return"variable-3"}}if(q==="@"){if(s.match(/@extend/)){if(!s.match(/\s*[\w]/)){j(r)}}}if(s.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)){e(r);return"meta"}if(q==="@"){s.next();s.eatWhile(/[\w-]/);return"meta"}if(s.eatWhile(/[\w-]/)){if(s.match(/ *: *[\w-\+\$#!\("']/,false)){return"property"}else{if(s.match(/ *:/,false)){e(r);r.cursorHalf=1;return"atom"}else{if(s.match(/ *,/,false)){return"atom"}else{e(r);return"atom"}}}}if(q===":"){if(s.match(o)){return"keyword"}s.next();r.cursorHalf=1;return"operator"}}else{if(q==="#"){s.next();if(s.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){if(!s.peek()){r.cursorHalf=0}return"number"}}if(s.match(/^-?[0-9\.]+/)){if(!s.peek()){r.cursorHalf=0}return"number"}if(s.match(/^(px|em|in)\b/)){if(!s.peek()){r.cursorHalf=0}return"unit"}if(s.match(b)){if(!s.peek()){r.cursorHalf=0}return"keyword"}if(s.match(/^url/)&&s.peek()==="("){r.tokenizer=m;if(!s.peek()){r.cursorHalf=0}return"atom"}if(q==="$"){s.next();s.eatWhile(/[\w-]/);if(!s.peek()){r.cursorHalf=0}return"variable-3"}if(q==="!"){s.next();if(!s.peek()){r.cursorHalf=0}return s.match(/^[\w]+/)?"keyword":"operator"}if(s.match(n)){if(!s.peek()){r.cursorHalf=0}return"operator"}if(s.eatWhile(/[\w-]/)){if(!s.peek()){r.cursorHalf=0}return"attribute"}if(!s.peek()){r.cursorHalf=0;return null}}if(s.match(n)){return"operator"}s.next();return null}function c(x,r){if(x.sol()){r.indentCount=0}var s=r.tokenizer(x,r);var w=x.current();if(w==="@return"||w==="}"){j(r)}if(s!==null){var t=x.pos-w.length;var v=t+(f.indentUnit*r.indentCount);var q=[];for(var u=0;u<r.scopes.length;u++){var y=r.scopes[u];if(y.offset<=v){q.push(y)}}r.scopes=q}return s}return{startState:function(){return{tokenizer:g,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(s,r){var q=c(s,r);r.lastToken={style:q,content:s.current()};return q},indent:function(q){return q.scopes[0].offset}}});a.defineMIME("text/x-sass","sass")});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("twig",function(){var d=["and","as","autoescape","endautoescape","block","do","endblock","else","elseif","extends","for","endfor","embed","endembed","filter","endfilter","flush","from","if","endif","in","is","include","import","not","or","set","spaceless","endspaceless","with","endwith","trans","endtrans","blocktrans","endblocktrans","macro","endmacro","use","verbatim","endverbatim"],c=/^[+\-*&%=<>!?|~^]/,b=/^[:\[\(\{]/,f=["true","false","null","empty","defined","divisibleby","divisible by","even","odd","iterable","sameas","same as"],e=/^(\d[+\-\*\/])?\d+(\.\d+)?/;d=new RegExp("(("+d.join(")|(")+"))\\b");f=new RegExp("(("+f.join(")|(")+"))\\b");function g(j,i){var h=j.peek();if(i.incomment){if(!j.skipTo("#}")){j.skipToEnd()}else{j.eatWhile(/\#|}/);i.incomment=false}return"comment"}else{if(i.intag){if(i.operator){i.operator=false;if(j.match(f)){return"atom"}if(j.match(e)){return"number"}}if(i.sign){i.sign=false;if(j.match(f)){return"atom"}if(j.match(e)){return"number"}}if(i.instring){if(h==i.instring){i.instring=false}j.next();return"string"}else{if(h=="'"||h=='"'){i.instring=h;j.next();return"string"}else{if(j.match(i.intag+"}")||j.eat("-")&&j.match(i.intag+"}")){i.intag=false;return"tag"}else{if(j.match(c)){i.operator=true;return"operator"}else{if(j.match(b)){i.sign=true}else{if(j.eat(" ")||j.sol()){if(j.match(d)){return"keyword"}if(j.match(f)){return"atom"}if(j.match(e)){return"number"}if(j.sol()){j.next()}}else{j.next()}}}}}}return"variable"}else{if(j.eat("{")){if(h=j.eat("#")){i.incomment=true;if(!j.skipTo("#}")){j.skipToEnd()}else{j.eatWhile(/\#|}/);i.incomment=false}return"comment"}else{if(h=j.eat(/\{|%/)){i.intag=h;if(h=="{"){i.intag="}"}j.eat("-");return"tag"}}}}}j.next()}return{startState:function(){return{}},token:function(i,h){return g(i,h)}}});a.defineMIME("text/x-twig","twig")});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("xml",function(y,k){var p=y.indentUnit;var x=k.multilineTagIndentFactor||1;var d=k.multilineTagIndentPastTag;if(d==null){d=true}var w=k.htmlMode?{autoSelfClosers:{area:true,base:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true,menuitem:true},implicitlyClosed:{dd:true,li:true,optgroup:true,option:true,p:true,rp:true,rt:true,tbody:true,td:true,tfoot:true,th:true,tr:true},contextGrabbers:{dd:{dd:true,dt:true},dt:{dd:true,dt:true},li:{li:true},option:{option:true,optgroup:true},optgroup:{optgroup:true},p:{address:true,article:true,aside:true,blockquote:true,dir:true,div:true,dl:true,fieldset:true,footer:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,header:true,hgroup:true,hr:true,menu:true,nav:true,ol:true,p:true,pre:true,section:true,table:true,ul:true},rp:{rp:true,rt:true},rt:{rp:true,rt:true},tbody:{tbody:true,tfoot:true},td:{td:true,th:true},tfoot:{tbody:true},th:{td:true,th:true},thead:{tbody:true,tfoot:true},tr:{tr:true}},doNotIndent:{pre:true},allowUnquoted:true,allowMissing:true,caseFold:true}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:false,allowMissing:false,caseFold:false};var c=k.alignCDATA;var f,g;function n(F,E){function C(G){E.tokenize=G;return G(F,E)}var D=F.next();if(D=="<"){if(F.eat("!")){if(F.eat("[")){if(F.match("CDATA[")){return C(v("atom","]]>"))}else{return null}}else{if(F.match("--")){return C(v("comment","-->"))}else{if(F.match("DOCTYPE",true,true)){F.eatWhile(/[\w\._\-]/);return C(z(1))}else{return null}}}}else{if(F.eat("?")){F.eatWhile(/[\w\._\-]/);E.tokenize=v("meta","?>");return"meta"}else{f=F.eat("/")?"closeTag":"openTag";E.tokenize=m;return"tag bracket"}}}else{if(D=="&"){var B;if(F.eat("#")){if(F.eat("x")){B=F.eatWhile(/[a-fA-F\d]/)&&F.eat(";")}else{B=F.eatWhile(/[\d]/)&&F.eat(";")}}else{B=F.eatWhile(/[\w\.\-:]/)&&F.eat(";")}return B?"atom":"error"}else{F.eatWhile(/[^&<]/);return null}}}n.isInText=true;function m(E,D){var C=E.next();if(C==">"||(C=="/"&&E.eat(">"))){D.tokenize=n;f=C==">"?"endTag":"selfcloseTag";return"tag bracket"}else{if(C=="="){f="equals";return null}else{if(C=="<"){D.tokenize=n;D.state=l;D.tagName=D.tagStart=null;var B=D.tokenize(E,D);return B?B+" tag error":"tag error"}else{if(/[\'\"]/.test(C)){D.tokenize=j(C);D.stringStartCol=E.column();return D.tokenize(E,D)}else{E.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}}}}}function j(B){var C=function(E,D){while(!E.eol()){if(E.next()==B){D.tokenize=m;break}}return"string"};C.isInAttribute=true;return C}function v(C,B){return function(E,D){while(!E.eol()){if(E.match(B)){D.tokenize=n;break}E.next()}return C}}function z(B){return function(E,D){var C;while((C=E.next())!=null){if(C=="<"){D.tokenize=z(B+1);return D.tokenize(E,D)}else{if(C==">"){if(B==1){D.tokenize=n;break}else{D.tokenize=z(B-1);return D.tokenize(E,D)}}}}return"meta"}}function r(C,B,D){this.prev=C.context;this.tagName=B;this.indent=C.indented;this.startOfLine=D;if(w.doNotIndent.hasOwnProperty(B)||(C.context&&C.context.noIndent)){this.noIndent=true}}function u(B){if(B.context){B.context=B.context.prev}}function q(D,C){var B;while(true){if(!D.context){return}B=D.context.tagName;if(!w.contextGrabbers.hasOwnProperty(B)||!w.contextGrabbers[B].hasOwnProperty(C)){return}u(D)}}function l(B,D,C){if(B=="openTag"){C.tagStart=D.column();return b}else{if(B=="closeTag"){return t}else{return l}}}function b(B,D,C){if(B=="word"){C.tagName=D.current();g="tag";return e}else{g="error";return b}}function t(C,E,D){if(C=="word"){var B=E.current();if(D.context&&D.context.tagName!=B&&w.implicitlyClosed.hasOwnProperty(D.context.tagName)){u(D)}if(D.context&&D.context.tagName==B){g="tag";return s}else{g="tag error";return A}}else{g="error";return A}}function s(C,B,D){if(C!="endTag"){g="error";return s}u(D);return l}function A(B,D,C){g="error";return s(B,D,C)}function e(E,C,F){if(E=="word"){g="attribute";return i}else{if(E=="endTag"||E=="selfcloseTag"){var D=F.tagName,B=F.tagStart;F.tagName=F.tagStart=null;if(E=="selfcloseTag"||w.autoSelfClosers.hasOwnProperty(D)){q(F,D)}else{q(F,D);F.context=new r(F,D,B==F.indented)}return l}}g="error";return e}function i(B,D,C){if(B=="equals"){return o}if(!w.allowMissing){g="error"}return e(B,D,C)}function o(B,D,C){if(B=="string"){return h}if(B=="word"&&w.allowUnquoted){g="string";return e}g="error";return e(B,D,C)}function h(B,D,C){if(B=="string"){return h}return e(B,D,C)}return{startState:function(){return{tokenize:n,state:l,indented:0,tagName:null,tagStart:null,context:null}},token:function(D,C){if(!C.tagName&&D.sol()){C.indented=D.indentation()}if(D.eatSpace()){return null}f=null;var B=C.tokenize(D,C);if((B||f)&&B!="comment"){g=null;C.state=C.state(f||B,D,C);if(g){B=g=="error"?B+" error":g}}return B},indent:function(G,C,F){var E=G.context;if(G.tokenize.isInAttribute){if(G.tagStart==G.indented){return G.stringStartCol+1}else{return G.indented+p}}if(E&&E.noIndent){return a.Pass}if(G.tokenize!=m&&G.tokenize!=n){return F?F.match(/^(\s*)/)[0].length:0}if(G.tagName){if(d){return G.tagStart+G.tagName.length+2}else{return G.tagStart+p*x}}if(c&&/<!\[CDATA\[/.test(C)){return 0}var B=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(B&&B[1]){while(E){if(E.tagName==B[2]){E=E.prev;break}else{if(w.implicitlyClosed.hasOwnProperty(E.tagName)){E=E.prev}else{break}}}}else{if(B){while(E){var D=w.contextGrabbers[E.tagName];if(D&&D.hasOwnProperty(B[2])){E=E.prev}else{break}}}}while(E&&!E.startOfLine){E=E.prev}if(E){return E.indent+p}else{return 0}},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:k.htmlMode?"html":"xml",helperType:k.htmlMode?"html":"xml"}});a.defineMIME("text/xml","xml");a.defineMIME("application/xml","xml");if(!a.mimeModes.hasOwnProperty("text/html")){a.defineMIME("text/html",{name:"xml",htmlMode:true})}});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("yaml",function(){var b=["true","false","on","off","yes","no"];var c=new RegExp("\\b(("+b.join(")|(")+"))$","i");return{token:function(g,f){var e=g.peek();var d=f.escaped;f.escaped=false;if(e=="#"&&(g.pos==0||/\s/.test(g.string.charAt(g.pos-1)))){g.skipToEnd();return"comment"}if(g.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/)){return"string"}if(f.literal&&g.indentation()>f.keyCol){g.skipToEnd();return"string"}else{if(f.literal){f.literal=false}}if(g.sol()){f.keyCol=0;f.pair=false;f.pairStart=false;if(g.match(/---/)){return"def"}if(g.match(/\.\.\./)){return"def"}if(g.match(/\s*-\s+/)){return"meta"}}if(g.match(/^(\{|\}|\[|\])/)){if(e=="{"){f.inlinePairs++}else{if(e=="}"){f.inlinePairs--}else{if(e=="["){f.inlineList++}else{f.inlineList--}}}return"meta"}if(f.inlineList>0&&!d&&e==","){g.next();return"meta"}if(f.inlinePairs>0&&!d&&e==","){f.keyCol=0;f.pair=false;f.pairStart=false;g.next();return"meta"}if(f.pairStart){if(g.match(/^\s*(\||\>)\s*/)){f.literal=true;return"meta"}if(g.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)){return"variable-2"}if(f.inlinePairs==0&&g.match(/^\s*-?[0-9\.\,]+\s?$/)){return"number"}if(f.inlinePairs>0&&g.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)){return"number"}if(g.match(c)){return"keyword"}}if(!f.pair&&g.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)){f.pair=true;f.keyCol=g.indentation();return"atom"}if(f.pair&&g.match(/^:\s*/)){f.pairStart=true;return"meta"}f.pairStart=false;f.escaped=(e=="\\");g.next();return null},startState:function(){return{pair:false,pairStart:false,keyCol:0,inlinePairs:0,inlineList:0,literal:false,escaped:false}}}});a.defineMIME("text/x-yaml","yaml")});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(b){var d=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,c=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,a=/[*+-]\s/;b.commands.newlineAndIndentContinueMarkdownList=function(q){if(q.getOption("disableInput")){return b.Pass}var g=q.listSelections(),k=[];for(var m=0;m<g.length;m++){var p=g[m].head;var h=q.getStateAfter(p.line);var o=h.list!==false;var l=h.quote!==0;var r=q.getLine(p.line),n=d.exec(r);if(!g[m].empty()||(!o&&!l)||!n){q.execCommand("newlineAndIndent");return}if(c.test(r)){q.replaceRange("",{line:p.line,ch:0},{line:p.line,ch:p.ch+1});k[m]="\n"}else{var j=n[1],f=n[5];var e=a.test(n[2])||n[2].indexOf(">")>=0?n[2]:(parseInt(n[3],10)+1)+n[4];k[m]="\n"+j+e+f}}q.replaceSelections(k)}});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.overlayMode=function(c,b,d){return{startState:function(){return{base:a.startState(c),overlay:a.startState(b),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(e){return{base:a.copyState(c,e.base),overlay:a.copyState(b,e.overlay),basePos:e.basePos,baseCur:null,overlayPos:e.overlayPos,overlayCur:null}},token:function(f,e){if(f!=e.streamSeen||Math.min(e.basePos,e.overlayPos)<f.start){e.streamSeen=f;e.basePos=e.overlayPos=f.start}if(f.start==e.basePos){e.baseCur=c.token(f,e.base);e.basePos=f.pos}if(f.start==e.overlayPos){f.pos=f.start;e.overlayCur=b.token(f,e.overlay);e.overlayPos=f.pos}f.pos=Math.min(e.basePos,e.overlayPos);if(e.overlayCur==null){return e.baseCur}else{if(e.baseCur!=null&&e.overlay.combineTokens||d&&e.overlay.combineTokens==null){return e.baseCur+" "+e.overlayCur}else{return e.overlayCur}}},indent:c.indent&&function(f,e){return c.indent(f.base,e)},electricChars:c.electricChars,innerMode:function(e){return{state:e.base,mode:c}},blankLine:function(e){if(c.blankLine){c.blankLine(e.base)}if(b.blankLine){b.blankLine(e.overlay)}}}}});
|