hedgedoc/public/vendor/codemirror/codemirror.min.js

16 lines
503 KiB
JavaScript
Raw Normal View History

!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);(this||window).CodeMirror=e()}}(function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?Di(r):{},Di(na,r,!1),p(r);var i=r.value;"string"==typeof i&&(i=new Ma(i,r.mode,null,r.lineSeparator)),this.doc=i;var o=new e.inputStyles[r.inputStyle](this),a=this.display=new t(n,i,o);a.wrapper.CodeMirror=this,c(this),s(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r.autofocus&&!zo&&a.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Oi,keySeq:null,specialChars:null};var l=this;xo&&wo<11&&setTimeout(function(){l.display.input.reset(!0)},20),$t(this),Yi(),wt(this),this.curOp.forceUpdate=!0,Qr(this,i),r.autofocus&&!zo||l.hasFocus()?setTimeout(Wi(bn,this),20):kn(this);for(var u in ra)ra.hasOwnProperty(u)&&ra[u](this,r[u],ia);w(this),r.finishInit&&r.finishInit(this);for(var f=0;f<la.length;++f)la[f](this);Ct(this),_o&&r.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}function t(e,t,n){var r=this;this.input=n,r.scrollbarFiller=$i("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=$i("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=$i("div",null,"CodeMirror-code"),r.selectionDiv=$i("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=$i("div",null,"CodeMirror-cursors"),r.measure=$i("div",null,"CodeMirror-measure"),r.lineMeasure=$i("div",null,"CodeMirror-measure"),r.lineSpace=$i("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=$i("div",[$i("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=$i("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=$i("div",null,null,"position: absolute; height: "+Ra+"px; width: 1px;"),r.gutters=$i("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=$i("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=$i("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),xo&&wo<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),_o||yo&&zo||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,We(e,100),e.state.modeGen++,e.curOp&&Rt(e)}function i(e){e.options.lineWrapping?(es(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ja(e.display.wrapper,"CodeMirror-wrap"),d(e)),a(e),Rt(e),ct(e),setTimeout(function(){y(e)},100)}function o(e){var t=kt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/xt(e.display)-3);return function(i){if(Cr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function a(e){var t=e.doc,n=o(e);t.iter(function(e){var t=n(e);t!=e.height&&ni(e,t)})}function s(e){e.d
o=ot(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function rt(e,t,n){for(var r,i,o,a,s=0;s<e.length;s+=3){var l=e[s],c=e[s+1];if(t<l?(i=0,o=1,a="left"):t<c?(i=t-l,o=i+1):(s==e.length-3||t==c&&e[s+3]>t)&&(o=c-l,i=o-1,t>=c&&(a="right")),null!=i){if(r=e[s+2],l==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)r=e[(s-=3)+2],a="left";if("right"==n&&i==c-l)for(;s<e.length-3&&e[s+3]==e[s+4]&&!e[s+5].insertLeft;)r=e[(s+=3)+2],a="right";break}}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:c}}function it(e,t){var n=Ko;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var r=e.length-1;r>=0&&(n=e[r]).left==n.right;r--);return n}function ot(e,t,n,r){var i,o=rt(t.map,n,r),a=o.node,s=o.start,l=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;s&&Hi(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+l<o.coverEnd&&Hi(t.line.text.charAt(o.coverStart+l));)++l;if(i=xo&&wo<9&&0==s&&l==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():it(Ka(a,s,l).getClientRects(),r),i.left||i.right||0==s)break;l=s,s-=1,c="right"}xo&&wo<11&&(i=at(e.display.measure,i))}else{s>0&&(c=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(xo&&wo<9&&!s&&(!i||!i.left&&!i.right)){var d=a.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+xt(e.display),top:d.top,bottom:d.bottom}:Ko}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,g=t.view.measure.heights,u=0;u<g.length-1&&!(m<g[u]);u++);var v=u?g[u-1]:0,y=g[u],b={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:v,bottom:y};return i.left||i.right||(b.bogus=!0),e.options.singleCursorHeightPerLine||(b.rtop=p,b.rbottom=h),b}function at(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!to(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function st(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function lt(e){e.display.externalMeasure=null,Ui(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)st(e.display.view[t])}function ct(e){lt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ut(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ft(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function dt(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=Lr(t.widgets[i]);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=oi(t);if("local"==r?a+=$e(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:ft());var l=s.left+("window"==r?0:ut());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function pt(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=ut(),i-=ft();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function ht(e,t,n,r,i){return r||(r=Jr(e.doc,t.line)),dt(e,r,Je(e,r,t.ch,i),n)}function mt(e,t,n,r,i,o){function a(t,a){var s=nt(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,dt(e,r,s,n)}function s(e,t){var n=l[t],r=n.level%2;return e==ro(n)&&t&&n.level<l[t-1].level?(n=l[--t],e=io(n)-(n.level%2?0:1),r=!0):e==io(n)&&t<l.length-1&&n.level<l[t+1].level&&(n=l[++t],e=ro(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?a(e-1):a(e,r)}r=r||Jr(e.doc,t.line),i||(i=tt(e,r));var l=ai(r),c=t.ch;if(!l)return a(c);var u=fo(l,c),f=s(c,u);return null!=ls&&(f.other=s(c,ls)),f}function gt(e,t){var n=0,t=ge(e.doc,t);e
}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ge(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),t<10?c.scrollLeft=0:t<h?c.scrollLeft=Math.max(0,t-(g?0:10)):r>m+h-3&&(c.scrollLeft=r+(g?0:10)-m),c}function Dn(e,t,n){null==t&&null==n||Bn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Wn(e){Bn(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?Wo(t.line,t.ch-1):t,r=Wo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Bn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=gt(e,t.from),r=gt(e,t.to),i=jn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Fn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=He(e,t):n="prev");var a=e.options.tabSize,s=Jr(o,t),l=Fa(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&(c=o.mode.indent(i,s.text.slice(u.length),s.text),c==ja||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Fa(Jr(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,f+="\t";if(d<c&&(f+=Ii(c-d)),f!=u)return Nn(o,f,Wo(t,0),Wo(t,u.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var h=o.sel.ranges[p];if(h.head.line==t&&h.head.ch<u.length){var d=Wo(t,u.length);_e(o,p,new de(d,d));break}}}function Hn(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Jr(e,me(e,t)):i=ri(t),null==i?null:(r(o,i)&&e.cm&&jt(e.cm,i,n),o)}function $n(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&Bo(o.from,Ni(r).to)<=0;){var a=r.pop();if(Bo(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}zt(e,function(){for(var t=r.length-1;t>=0;t--)Nn(e.doc,"",r[t].from,r[t].to,"+delete");Wn(e)})}function Un(e,t,n,r,i){function o(){var t=s+n;return!(t<e.first||t>=e.first+e.size)&&(s=t,u=Jr(e,t))}function a(e){var t=(i?ho:mo)(u,l,n,!0);if(null==t){if(e||!o())return!1;l=i?(n<0?ao:oo)(u):n<0?u.text.length:0}else l=t;return!0}var s=t.line,l=t.ch,c=n,u=Jr(e,s);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var f=null,d="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||a(!h);h=!1){var m=u.text.charAt(l)||"\n",g=Bi(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(!d||h||g||(g="s"),f&&f!=g){n<0&&(n=1,a());break}if(g&&(f=g),n>0&&!a(!h))break}var v=Ie(e,Wo(s,l),t,c,!0);return Bo(t,v)||(v.hitSide=!0),v}function Kn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(s-(n<0?1.5:.5)*kt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var l=yt(e,a,i);if(!l.outside)break;if(n<0?i<=0:i>=o.height){l.hitSide=!0;break}i+=5*n}return l}function Vn(t,n,r,i){e.defaults[t]=n,r&&(ra[t]=i?function(e,t,n){n!=ia&&r(e,t,n)}:r)}function Gn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Xn(e){return"string"==typeof e?pa[e]:e}function Zn(e,t,n,r,i){if(r&&r.shared)return Yn(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Ot(e.cm,Zn)(e,t,n,r,i);var o=new ba(e,i),a=Bo(t,n);if(r&&Di(r,o,!1),a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=$i("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignor
this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Oo&&!To?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Oi,this.disableVert=new Oi},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Di({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},S.prototype.signal=function(e,t){Ei(e,t)&&this.events.push(arguments)},S.prototype.finish=function(){for(var e=0;e<this.events.length;e++)qa.apply(null,this.events[e])};var Wo=e.Pos=function(e,t){return this instanceof Wo?(this.line=e,void(this.ch=t)):new Wo(e,t)},Bo=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Fo=null;re.prototype=Di({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Fo={lineWise:!1,text:r.getSelections()},n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,o.value=Fo.text.join("\n"),Ua(o));else{if(!r.options.lineWiseCopyCut)return;var t=te(r);Fo={lineWise:!0,text:t.text},"cut"==e.type?r.setSelections(t.ranges,null,Da):(n.prevInput="",o.value=t.text.join("\n"),Ua(o))}"cut"==e.type&&(r.state.cutIncoming=!0)}}var n=this,r=this.cm,i=this.wrapper=ie(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),Eo&&(o.style.width="0px"),Oa(o,"input",function(){xo&&wo>=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Oa(o,"paste",function(e){Ti(r,e)||J(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),Oa(o,"cut",t),Oa(o,"copy",t),Oa(e.scroller,"paste",function(t){Vt(e,t)||Ti(r,t)||(r.state.pasteIncoming=!0,n.focus())}),Oa(e.lineSpace,"selectstart",function(t){Vt(e,t)||Aa(t)}),Oa(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Oa(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=Pe(e);if(e.options.moveInputWithCursor){var i=mt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;Ki(n.cursorDiv,e.cursors),Ki(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=os&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.composing||(this.textarea.value=a),r.state.focused&&Ua(this.textarea),xo&&wo>=9&&(this.hasSelection=a)}else e||(this.composing||(this.prevInput=this.textarea.value=""),xo&&wo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!zo||Vi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1
if(o)if(i.ch==o.length&&(i=new Wo(i.line,i.ch-1)),i.ch>0)i=new Wo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Wo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Jr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Wo(i.line-1,a.length-1),Wo(i.line,1),"+transpose")}n.push(new de(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){zt(e,function(){for(var t=e.listSelections().length,n=0;n<t;n++){var r=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0)}Wn(e)})},openLine:function(e){e.replaceSelection("\n","start")},toggleOverwrite:function(e){e.toggleOverwrite()}},pa=e.keyMap={};pa.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"},pa.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"},pa.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","Ctrl-O":"openLine"},pa.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"]},pa["default"]=Oo?pa.macDefault:pa.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Pi(n.split(" "),Gn),o=0;o<i.length;o++){var a,s;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e};var ha=e.lookupKey=function(e,t,n,r){t=Xn(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return ha(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=ha(e,t.fallthrough[o],n,r);if(a)return a}}},ma=e.isModifierKey=function(e){var t="string"==typeof e?e:ss[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},ga=e.keyName=function(e,t){if(Mo&&34==e.keyCode&&e["char"])return!1;var n=ss[e.keyCode],r=n;return null!=r&&!e.altGraphKey&&(e.altKey&&"Alt"!=n&&(r="Alt-"+r),(Po?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+
next:r.persistentStates}),r.localState=u,r.local={mode:c,end:i.end&&n(i.end),endScan:i.end&&i.forceEnd!==!1&&n(i.end,!1),endToken:o&&o.join?o[o.length-1]:o}}function l(e,t){for(var n=0;n<t.length;n++)if(t[n]===e)return!0}function c(t,n){return function(r,i,o){if(r.local&&r.local.mode.indent)return r.local.mode.indent(r.localState,i,o);if(null==r.indent||r.local||n.dontIndentStates&&l(r.state,n.dontIndentStates)>-1)return e.Pass;var a=r.indent.length-1,s=t[r.state];e:for(;;){for(var c=0;c<s.length;c++){var u=s[c];if(u.data.dedent&&u.data.dedentIfLineStart!==!1){var f=u.regex.exec(i);if(f&&f[0]){a--,(u.next||u.push)&&(s=t[u.next||u.push]),i=i.slice(f[0].length);continue e}}}break}return a<0?0:r.indent[a]}}e.defineSimpleMode=function(t,n){e.defineMode(t,function(t){return e.simpleMode(t,n)})},e.simpleMode=function(n,r){t(r,"start");var a={},s=r.meta||{},l=!1;for(var u in r)if(u!=s&&r.hasOwnProperty(u))for(var f=a[u]=[],d=r[u],p=0;p<d.length;p++){var h=d[p];f.push(new i(h,r)),(h.indent||h.dedent)&&(l=!0)}var m={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:l?[]:null}},copyState:function(t){var n={state:t.state,pending:t.pending,local:t.local,localState:null,indent:t.indent&&t.indent.slice(0)};t.localState&&(n.localState=e.copyState(t.local.mode,t.localState)),t.stack&&(n.stack=t.stack.slice(0));for(var r=t.persistentStates;r;r=r.next)n.persistentStates={mode:r.mode,spec:r.spec,state:r.state==t.localState?n.localState:e.copyState(r.mode,r.state),next:n.persistentStates};return n},token:o(a,n),innerMode:function(e){return e.local&&{mode:e.local.mode,state:e.localState}},indent:c(a,s)};if(s)for(var g in s)s.hasOwnProperty(g)&&(m[g]=s[g]);return m}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.multiplexingMode=function(t){function n(e,t,n,r){if("string"==typeof t){var i=e.indexOf(t,n);return r&&i>-1?i+t.length:i}var o=t.exec(n?e.slice(n):e);return o?o.index+n+(r?o[0].length:0):-1}var r=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(i,o){if(o.innerActive){var a=o.innerActive,s=i.string;if(!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);var l=a.close?n(s,a.close,i.pos,a.parseDelimiters):-1;if(l==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle&&a.delimStyle+" "+a.delimStyle+"-close";l>-1&&(i.string=s.slice(0,l));var c=a.mode.token(i,o.inner);return l>-1&&(i.string=s),l==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(c=c?c+" "+a.innerStyle:a.innerStyle),c}for(var u=1/0,s=i.string,f=0;f<r.length;++f){var d=r[f],l=n(s,d.open,i.pos);if(l==i.pos)return d.parseDelimiters||i.match(d.open),o.innerActive=d,o.inner=e.startState(d.mode,t.indent?t.indent(o.outer,""):0),d.delimStyle&&d.delimStyle+" "+d.delimStyle+"-open";l!=-1&&l<u&&(u=l)}u!=1/0&&(i.string=s.slice(0,u));var p=t.token(i,o.outer);return u!=1/0&&(i.string=s),p},indent:function(n,r){var i=n.innerActive?n.innerActive.mode:t;return i.indent?i.indent(n.innerActive?n.inner:n.outer,r):e.Pass},blankLine:function(n){var i=n.innerActive?n.innerActive.mode:t;if(i.blankLine&&i.blankLine(n.innerActive?n.inner:n.outer),n.innerActive)"\n"===n.innerActive.close&&(n.innerActive=n.inner=null);else for(var o=0;o<r.length;++o){var a=r[o];"\n"===a.open&&(n.innerActive=a,n.inner=e.startState(a.mode,i.indent?i.indent(n.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict
o()}),c&&(a=setTimeout(o,c)),o})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,r,i){var o=e.getLineHandle(t.line),l=t.ch-1,c=l>=0&&s[o.text.charAt(l)]||s[o.text.charAt(++l)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(r&&u>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(a(t.line,l+1)),d=n(e,a(t.line,l+(u>0?1:0)),u,f||null,i);return null==d?null:{from:a(t.line,l),to:d&&d.pos,match:d&&d.ch==c.charAt(0),forward:u>0}}function n(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,l=i&&i.maxScanLines||1e3,c=[],u=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),d=t.line;d!=f;d+=n){var p=e.getLine(d);if(p){var h=n>0?0:p.length-1,m=n>0?p.length:-1;if(!(p.length>o))for(d==t.line&&(h=t.ch-(n<0?1:0));h!=m;h+=n){var g=p.charAt(h);if(u.test(g)&&(void 0===r||e.getTokenTypeAt(a(d,h+1))==r)){var v=s[g];if(">"==v.charAt(1)==n>0)c.push(g);else{if(!c.length)return{pos:a(d,h),ch:g};c.pop()}}}}}return d-n!=(n>0?e.lastLine():e.firstLine())&&null}function r(e,n,r){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),c=0;c<l.length;c++){var u=l[c].empty()&&t(e,l[c].head,!1,r);if(u&&e.getLine(u.from.line).length<=i){var f=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";s.push(e.markText(u.from,a(u.from.line,u.from.ch+1),{className:f})),u.to&&e.getLine(u.to.line).length<=i&&s.push(e.markText(u.to,a(u.to.line,u.to.ch+1),{className:f}))}}if(s.length){o&&e.state.focused&&e.focus();var d=function(){e.operation(function(){for(var e=0;e<s.length;e++)s[e].clear()})};if(!n)return d;setTimeout(d,800)}}function i(e){e.operation(function(){l&&(l(),l=null),l=r(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,s={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",i),l&&(l(),l=null)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",i))}),e.defineExtension("matchBrackets",function(){r(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,r){return t(this,e,n,r)}),e.defineExtension("scanForBracket",function(e,t,r,i){return n(this,e,t,r,i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:f[t]}function n(e){return function(t){return s(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var o=t(i,"pairs"),a=n.listSelections(),s=0;s<a.length;s++){if(!a[s].empty())return e.Pass;var l=c(n,a[s].head);if(!l||o.indexOf(l)%2!=0)return e.Pass}for(var s=a.length-1;s>=0;s--){var u=a[s].head;n.replaceRange("",d(u.line,u.ch-1),d(u.line,u.ch+1),"+delete")}}function o(n){var i=r(n),o=i&&t(i,"explode");if(!o||n.getOption("disableInput"))return e.Pass;for(var a=n.listSelections(),s=0;s<a.length;s++){if(!a[s].empty())return e.Pass;var l=c(n,a[s].head);if(!l||o.indexOf(l)%2!=0)return e.Pass}n.operation(function(){n.replaceSelection("\n\n",null),n.execCommand("goCharLeft"),a=n.listSelections();for(var e=0;e<a.length;e++){var t=a[e].head.line;n.indentLine(t,null,!0),n.indentLine(t+1,null,!0)}})}function a(t){var n=e.cmpPos(t.anchor,t.head)>0;return{anchor:new d(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new d(t.head.line,t.head.ch+(n?1:-1))}}function s(n,i){var o=r(n);if(!o||n.getOption("disableInput"))return e.Pass;var s=t(o,"pairs"),c=s.indexOf(i);if(c==-1)return e.Pass;for(var f,p=t(o,"triples"),h=s.charAt(c+1)==i,m=n.listSelections(),g=c%2==0,v=0;v<m.length;v++){var y,b=m[v],k=b.head,x=n.getRa
i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,M=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return M="equals",null;if("<"==n){t.tokenize=o,t.state=p,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=s(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function s(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function l(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(_.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function d(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!_.contextGrabbers.hasOwnProperty(n)||!_.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function p(e,t,n){return"openTag"==e?(n.tagStart=t.column(),h):"closeTag"==e?m:p}function h(e,t,n){return"word"==e?(n.tagName=t.current(),L="tag",y):(L="error",h)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&_.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||_.matchClosing===!1?(L="tag",g):(L="tag error",v)}return L="error",v}function g(e,t,n){return"endTag"!=e?(L="error",g):(f(n),p)}function v(e,t,n){return L="error",g(e,t,n)}function y(e,t,n){if("word"==e)return L="attribute",b;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||_.autoSelfClosers.hasOwnProperty(r)?d(n,r):(d(n,r),n.context=new u(n,r,i==n.indented)),p}return L="error",y}function b(e,t,n){return"equals"==e?k:(_.allowMissing||(L="error"),y(e,t,n))}function k(e,t,n){return"string"==e?x:"word"==e&&_.allowUnquoted?(L="string",y):(L="error",y(e,t,n))}function x(e,t,n){return"string"==e?x:y(e,t,n)}var w=r.indentUnit,_={},C=i.htmlMode?t:n;for(var S in C)_[S]=C[S];for(var S in i)_[S]=i[S];var M,L;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;M=null;var n=t.tokenize(e,t);return(n||M)&&"comment"!=n&&(L=null,t.state=t.state(M||n,e,t),L&&(n="error"==L?n+" error":L)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+w;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return _.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+w*(_.multilineTagIndentFactor||1);if(_.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var s=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(s&&s[1])for(;i;){if(i.tagName==s[2]){i=i.prev;break}if(!_.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(s)for(;i;){var l=_.contextGrabbers[i.tagName];if(!l||!l.hasOwnProperty(s[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+w:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:_.htmlMode?"html":"xml",helperType:_.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&
r("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?r(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):"u"==n&&e.match(/rl(-prefix)?\(/)||"d"==n&&e.match("omain(")||"r"==n&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,r("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),r(null,"(")}function s(e,t,n){this.type=e,this.indent=t,this.prev=n}function l(e,t,n,r){return e.context=new s(n,t.indentation()+(r===!1?0:g),e.context),n}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,n){return E[n.context.type](e,t,n)}function f(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function d(e){var t=e.current().toLowerCase();m=L.hasOwnProperty(t)?"atom":M.hasOwnProperty(t)?"keyword":"variable"}var p=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var h,m,g=t.indentUnit,v=n.tokenHooks,y=n.documentTypes||{},b=n.mediaTypes||{},k=n.mediaFeatures||{},x=n.mediaValueKeywords||{},w=n.propertyKeywords||{},_=n.nonStandardPropertyKeywords||{},C=n.fontProperties||{},S=n.counterDescriptors||{},M=n.colorKeywords||{},L=n.valueKeywords||{},T=n.allowNested,A=n.supportsAtComponent===!0,E={};return E.top=function(e,t,n){if("{"==e)return l(n,t,"block");if("}"==e&&n.context.prev)return c(n);if(A&&/@component/.test(e))return l(n,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return l(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return l(n,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(n,t,"at");if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(n,t,"interpolation");if(":"==e)return"pseudo";if(T&&"("==e)return l(n,t,"parens")}return n.context.type},E.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return w.hasOwnProperty(r)?(m="property","maybeprop"):_.hasOwnProperty(r)?(m="string-2","maybeprop"):T?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error","maybeprop")}return"meta"==e?"block":T||"hash"!=e&&"qualifier"!=e?E.top(e,t,n):(m="error","block")},E.maybeprop=function(e,t,n){return":"==e?l(n,t,"prop"):u(e,t,n)},E.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&T)return l(n,t,"propBlock");if("}"==e||"{"==e)return f(e,t,n);if("("==e)return l(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)d(t);else if("interpolation"==e)return l(n,t,"interpolation")}else m+=" error";return"prop"},E.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(m="property","maybeprop"):n.context.type},E.parens=function(e,t,n){return"{"==e||"}"==e?f(e,t,n):")"==e?c(n):"("==e?l(n,t,"parens"):"interpolation"==e?l(n,t,"interpolation"):("word"==e&&d(t),"parens")},E.pseudo=function(e,t,n){return"word"==e?(m="variable-3",n.context.type):u(e,t,n)},E.documentTypes=function(e,t,n){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",n.context.type):E.atBlock(e,t,n)},E.atBlock=function(e,t,n){if("("==e)return l(n,t,"atBlock_parens");if("}"==e||";"==e)return f(e,t,n);if("{"==e)return c(n)&&l(n,t,T?"block":"top");if("interpolation"==e)return l(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();m="only"==r||"not"==r||"and"==r||"or"==r?"keyword":b.hasOwnProperty(r)?"attribute":k.hasOwnProperty(r)?"proper
null;p=h=null;var s=(t.tokenize||c)(e,t);if("comment"==s||"meta"==s)return s;if(null==a.align&&(a.align=!0),I.test(p))for(;"statement"==t.context.type;)r(t);else if("{"==p)n(t,e.column(),"}");else if("["==p)n(t,e.column(),"]");else if("("==p)n(t,e.column(),")");else if("}"==p){for(;"statement"==a.type;)a=r(t);for("}"==a.type&&(a=r(t));"statement"==a.type;)a=r(t)}else p==a.type?r(t):M&&(("}"==a.type||"top"==a.type)&&";"!=p||"statement"==a.type&&"newstatement"==p)&&n(t,e.column(),"statement",e.current());if("variable"==s&&("def"==t.prevToken||l.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),C.token){var u=C.token(e,t,s);void 0!==u&&(s=u)}return"def"==s&&l.styleDefs===!1&&(s="variable"),t.startOfLine=!1,t.prevToken=h?"def":s||p,d(e,t),s},indent:function(t,n){if(t.tokenize!=c&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var r=t.context,i=n&&n.charAt(0);if("statement"==r.type&&"}"==i&&(r=r.prev),l.dontIndentStatements)for(;"statement"==r.type&&l.dontIndentStatements.test(r.info);)r=r.prev;if(C.indent){var o=C.indent(t,r,n);if("number"==typeof o)return o}var a=i==r.type,s=r.prev&&"switch"==r.prev.info;if(l.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==i?0:g):!r.align||v&&")"==r.type?")"!=r.type||a?r.indented+(a?0:m)+(a||!s||/^(?:case|default)\b/.test(n)?0:m):r.indented+g:r.column+(a?0:1)},electricInput:L?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var b="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",k="int long char short double float unsigned signed void size_t ptrdiff_t";m(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:a(b),types:a(k+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:a("case do else for if switch while struct"),defKeywords:a("struct"),typeFirstDefinitions:!0,atoms:a("null true false"),hooks:{"#":l,"*":c},modeProps:{fold:["brace","include"]}}),m(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:a(b+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:a(k+" bool wchar_t"),blockKeywords:a("catch class do else finally for if struct switch try while"),defKeywords:a("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:a("true false null"),dontIndentStatements:/^template$/,hooks:{"#":l,"*":c,u:f,U:f,L:f,R:f,0:u,1:u,2:u,3:u,4:u,5:u,6:u,7:u,8:u,9:u,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&d(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),m("text/x-java",{name:"clike",keywords:a("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while"),types:a("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:a("catch class do else finally for if switch try while"),defKeywords:a("class interface package enum"),typeFirstDefinitions:!0,atoms:a("true false null"),endStatement:/^[;:]$/,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),m("text/x-csharp",{name:"clike",keywords:a("abstract as async await base break case catch
var _=s.version&&3==parseInt(s.version,10);if(_){var C=s.singleOperators||/^[\+\-\*\/%&|\^~<>!@]/,S=s.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;x=x.concat(["nonlocal","False","True","None","async","await"]),w=w.concat(["ascii","bytes","exec","print"]);var M=new RegExp("^(([rbuf]|(br))?('{3}|\"{3}|['\"]))","i")}else{var C=s.singleOperators||/^[\+\-\*\/%&|\^~<>!]/,S=s.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;x=x.concat(["exec","print"]),w=w.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"]);var M=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var L=t(x),T=t(w),A={startState:function(e){return{tokenize:l,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=h(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+m:r},indent:function(t,r){if(t.tokenize!=l)return t.tokenize.isString?e.Pass:0;var i=n(t),o=i.type==r.charAt(0);return null!=i.align?i.align-(o?1:0):i.offset-(o?k:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"};return A}),e.defineMIME("text/x-python","python");var a=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:a("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r<n.length;r++)i[n[r]]=e}function t(e,t){if(e.eatSpace())return null;var a=e.sol(),s=e.next();if("\\"===s)return e.next(),null;if("'"===s||'"'===s||"`"===s)return t.tokens.unshift(n(s)),r(e,t);if("#"===s)return a&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if("$"===s)return t.tokens.unshift(o),r(e,t);if("+"===s||"="===s)return"operator";if("-"===s)return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(s)&&(e.eatWhile(/\d/),e.eol()||!/\w/.test(e.peek())))return"number";e.eatWhile(/[\w-]/);var l=e.current();return"="===e.peek()&&/\w+/.test(l)?"def":i.hasOwnProperty(l)?i[l]:null}function n(e){return function(t,n){for(var r,i=!1,a=!1;null!=(r=t.next());){if(r===e&&!a){i=!0;break}if("$"===r&&!a&&"'"!==e){a=!0,t.backUp(1),n.tokens.unshift(o);break}a=!a&&"\\"===r}return!i&&a||n.tokens.shift(),"`"===e||")"===e?"quote":"string"}}function r(e,n){return(n.tokens[0]||t)(e,n)}var i={};e("atom","true false"),e("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),e("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo tee telnet top touch vi vim wall wc wget who write yes zsh");var o=function(e,t){t.tokens.length>1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),"("===i?(t.tokens[0]=n(")"),r(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t,i){return 0==e.length?r(t):function(o,a){for(var s=e[0],l=0;l<s.length;l++)if(o.m
builtin:i("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:i("date time timestamp"),support:i("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:i("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:i("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-pgsql",{name:"sql",client:i("source"),keywords:i(o+"a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop cova
return{startState:function(e){return{tokenize:r,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;s=null;var n=t.tokenize(e,t),r=t.stack[t.stack.length-1];return"hash"==s&&"rule"==r?n="atom":"variable"==n&&("rule"==r?n="number":r&&"@media{"!=r||(n="tag")),"rule"==r&&/^[\{\};]$/.test(s)&&t.stack.pop(),"{"==s?"@media"==r?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==s?t.stack.pop():"@media"==s?t.stack.push("@media"):"{"==r&&"comment"!=s&&t.stack.push("rule"),n},indent:function(e,t){var n=e.stack.length;return/^\}/.test(t)&&(n-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+n*f},electricChars:"}"}}),e.defineMIME("text/x-nginx-conf","nginx")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.string.charAt(e.pos+(t||0))}function n(e,t){if(t){var n=e.pos-t;return e.string.substr(n>=0?n:0,t)}return e.string.substr(0,e.pos-1)}function r(e,t){var n=e.string.length,r=n-e.pos+1;return e.string.substr(e.pos,t&&t<n?t:r)}function i(e,t){var n,r=e.pos+t;r<=0?e.pos=0:r>=(n=e.string.length-1)?e.pos=n:e.pos=r}e.defineMode("perl",function(){function e(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var o,s=!1,l=0;o=e.next();){if(o===n[l]&&!s)return void 0!==n[++l]?(t.chain=n[l],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=a,r;s=!s&&"\\"==o}return r},t.tokenize(e,t)}function o(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=a),e.skipToEnd(),"string"},t.tokenize(e,t)}function a(a,u){if(a.eatSpace())return null;if(u.chain)return e(a,u,u.chain,u.style,u.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),o(a,u,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return o(a,u,"=cut");var f=a.next();if('"'==f||"'"==f){if(n(a,3)=="<<"+f){var d=a.pos;a.eatWhile(/\w/);var p=a.current().substr(1);if(p&&a.eat(f))return o(a,u,p);a.pos=d}return e(a,u,[f],"string")}if("q"==f){var h=t(a,-2);if(!h||!/\w/.test(h))if(h=t(a,0),"x"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],l,c);if("["==h)return i(a,2),e(a,u,["]"],l,c);if("{"==h)return i(a,2),e(a,u,["}"],l,c);if("<"==h)return i(a,2),e(a,u,[">"],l,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],l,c)}else if("q"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"string");if("["==h)return i(a,2),e(a,u,["]"],"string");if("{"==h)return i(a,2),e(a,u,["}"],"string");if("<"==h)return i(a,2),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"string")}else if("w"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"bracket");if("["==h)return i(a,2),e(a,u,["]"],"bracket");if("{"==h)return i(a,2),e(a,u,["}"],"bracket");if("<"==h)return i(a,2),e(a,u,[">"],"bracket");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"bracket")}else if("r"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],l,c);if("["==h)return i(a,2),e(a,u,["]"],l,c);if("{"==h)return i(a,2),e(a,u,["}"],l,c);if("<"==h)return i(a,2),e(a,u,[">"],l,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],l,c)}else if(/[\^'"!~\/(\[{<]/.test(h)){if("("==h)return i(a,1),e(a,u,[")"],"string");if("["==h)return i(a,1),e(a,u,["]"],"string");if("{"==h)return i(a,1),e(a,u,["}"],"string");if("<"==h)return i(a,1),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return e(a,u,[a.eat(h)],"string")}}if("m"==f){var h=t(a,-2);if((!h||!/\w/.test(h))&&(h=a.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(h))return e(a,u,[h],l,c);if("("==h)return e(a,u,[")"],l,c);if("["==h)return e(a,u,["]"],l,c);if("{"==h)return e(a,u,["}"],l,c);if("<"==h)return e(a,u,[">"],l,c)}}if("s"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("y"==f){var h=/[\/>\]})\w]/.test(t(a,-2)
data:!0,time:!0,mark:!0,br:!0,wbr:!0,hr:!0,li:!0,dt:!0,dd:!0,td:!0,th:!0,tr:!0,noinclude:!0,includeonly:!0,onlyinclude:!0};return{startState:function(){return{tokenize:E("",""),stack:[],InHtmlTag:[],isBold:!1,isItalic:!1,extName:!1,extMode:!1,extState:!1,nTemplate:0,nLink:0,nExt:0}},copyState:function(t){return{tokenize:t.tokenize,stack:t.stack.concat([]),InHtmlTag:t.InHtmlTag.concat([]),isBold:t.isBold,isItalic:t.isItalic,extName:t.extName,extMode:t.extMode,extState:t.extMode!==!1&&e.copyState(t.extMode,t.extState),nTemplate:t.nTemplate,nLink:t.nLink,nExt:t.nExt}},token:function(e,t){return t.tokenize(e,t)},blankLine:function(e){if(e.extName){if(e.extMode){var t="";return e.extMode.blankLine&&(t=" "+e.extMode.blankLine(e.extState)),"line-cm-mw-tag-"+e.extName+t}return"line-cm-mw-exttag"}}}}),e.defineMIME("text/mediawiki","mediawiki"),e.defineMode("mw-tag-pre",function(){return{startState:function(){return{}},token:n("mw-tag-pre","line-cm-mw-tag-pre")}}),e.defineMode("mw-tag-nowiki",function(){return{startState:function(){return{}},token:n("mw-tag-nowiki","line-cm-mw-tag-nowiki")}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line==t.line&&e.ch==t.ch}function n(e){N.push(e),N.length>50&&N.shift()}function r(e){return N.length?void(N[N.length-1]+=e):n(e)}function i(e){return N[N.length-(e?Math.min(e,1):1)]||""}function o(){return N.length>1&&N.pop(),i()}function a(e,i,o,a,s){null==s&&(s=e.getRange(i,o)),a&&q&&q.cm==e&&t(i,q.pos)&&e.isClean(q.gen)?r(s):n(s),e.replaceRange("",i,o,"+delete"),q=a?{cm:e,pos:i,gen:e.changeGeneration()}:null}function s(e,t,n){return e.findPosH(t,n,"char",!0)}function l(e,t,n){return e.findPosH(t,n,"word",!0)}function c(e,t,n){return e.findPosV(t,n,"line",e.doc.sel.goalColumn)}function u(e,t,n){return e.findPosV(t,n,"page",e.doc.sel.goalColumn)}function f(e,t,n){for(var r=t.line,i=e.getLine(r),o=/\S/.test(n<0?i.slice(0,t.ch):i.slice(t.ch)),a=e.firstLine(),s=e.lastLine();;){if(r+=n,r<a||r>s)return e.clipPos(I(r-n,n<0?0:null));i=e.getLine(r);var l=/\S/.test(i);if(l)o=!0;else if(o)return I(r,0)}}function d(e,t,n){for(var r=t.line,i=t.ch,o=e.getLine(t.line),a=!1;;){var s=o.charAt(i+(n<0?-1:0));if(s){if(a&&/[!?.]/.test(s))return I(r,i+(n>0?1:0));a||(a=/\w/.test(s)),i+=n}else{if(r==(n<0?e.firstLine():e.lastLine()))return I(r,i);if(o=e.getLine(r+n),!/\S/.test(o))return I(r,i);r+=n,i=n<0?o.length:0}}}function p(e,n,r){var i;if(e.findMatchingBracket&&(i=e.findMatchingBracket(n,!0))&&i.match&&(i.forward?1:-1)==r)return r>0?I(i.to.line,i.to.ch+1):i.to;for(var o=!0;;o=!1){var a=e.getTokenAt(n),s=I(n.line,r<0?a.start:a.end);if(!(o&&r>0&&a.end==n.ch)&&/\w/.test(a.string))return s;var l=e.findPosH(s,r,"char");if(t(s,l))return n;n=l}}function h(e,t){var n=e.state.emacsPrefix;return n?(w(e),"-"==n?-1:Number(n)):t?null:1}function m(e){var t="string"==typeof e?function(t){t.execCommand(e)}:e;return function(e){var n=h(e);t(e);for(var r=1;r<n;++r)t(e)}}function g(e,n,r,i){var o=h(e);o<0&&(i=-i,o=-o);for(var a=0;a<o;++a){var s=r(e,n,i);if(t(s,n))break;n=s}return n}function v(e,t){var n=function(n){n.extendSelection(g(n,n.getCursor(),e,t))};return n.motion=!0,n}function y(e,t,n){for(var r,i=e.listSelections(),o=i.length;o--;)r=i[o].head,a(e,r,g(e,r,t,n),!0)}function b(e){if(e.somethingSelected()){for(var t,n=e.listSelections(),r=n.length;r--;)t=n[r],a(e,t.anchor,t.head);return!0}}function k(e,t){return e.state.emacsPrefix?void("-"!=t&&(e.state.emacsPrefix+=t)):(e.state.emacsPrefix=t,e.on("keyHandled",x),void e.on("inputRead",_))}function x(e,t){e.state.emacsPrefixMap||P.hasOwnProperty(t)||w(e)}function w(e){e.state.emacsPrefix=null,e.off("keyHandled",x),e.off("inputRead",_)}function _(e,t){var n=h(e);if(n>1&&"+input"==t.origin){for(var r=t.text.join("\n"),i="",o=1;o<n;++o)i+=r;e.replaceSelection(i)}}function C(e){e.state.emacsPrefixMap=!0,e.addKeyMap(j),e.on("keyHandled",S),e.on("inputRead",S)}function S(e,t){("string"!=typeof t||!/^
toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],n=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],r=e.Pos,i=function(){function i(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",et),_(t),e.on(t.getInputField(),"paste",u(t))}function o(t){t.setOption("disableInput",!1),t.off("cursorActivity",et),e.off(t.getInputField(),"paste",u(t)),t.state.vim=null}function a(t,n){this==e.keyMap.vim&&e.rmClass(t.getWrapperElement(),"cm-fat-cursor"),n&&n.attach==s||o(t,!1)}function s(t,n){this==e.keyMap.vim&&e.addClass(t.getWrapperElement(),"cm-fat-cursor"),n&&n.attach==s||i(t)}function l(t,n){if(n){if(this[t])return this[t];var r=c(t);if(!r)return!1;var i=e.Vim.findKey(n,r);return"function"==typeof i&&e.signal(n,"vim-keypress",r),i}}function c(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),n=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==n.length)return!1;for(var r=!1,i=0;i<t.length;i++){var o=t[i];o in st?t[i]=st[o]:r=!0,o in lt&&(t[i]=lt[o])}return!!r&&(g(n)&&(t[t.length-1]=n.toLowerCase()),"<"+t.join("-")+">")}function u(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(R(e.getCursor(),0,1)),Mt.enterInsertMode(e,{},t))}),t.onPasteFn}function f(e,t){for(var n=[],r=e;r<e+t;r++)n.push(String.fromCharCode(r));return n}function d(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function p(e){return/^[a-z]$/.test(e)}function h(e){return"()[]{}".indexOf(e)!=-1}function m(e){return ct.test(e)}function g(e){return/^[A-Z]$/.test(e)}function v(e){return/^\s*$/.test(e)}function y(e,t){for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1}function b(e,t,n,r,i){if(void 0===t&&!i)throw Error("defaultValue is required unless callback is provided");if(n||(n="string"),vt[e]={type:n,defaultValue:t,callback:i},r)for(var o=0;o<r.length;o++)vt[r[o]]=vt[e];t&&k(e,t)}function k(e,t,n,r){var i=vt[e];r=r||{};var o=r.scope;if(!i)throw Error("Unknown option: "+e);if("boolean"==i.type){if(t&&t!==!0)throw Error("Invalid argument: "+e+"="+t);t!==!1&&(t=!0)}i.callback?("local"!==o&&i.callback(t,void 0),"global"!==o&&n&&i.callback(t,n)):("local"!==o&&(i.value="boolean"==i.type?!!t:t),"global"!==o&&n&&(n.state.vim.options[e]={value:t}))}function x(e,t,n){var r=vt[e];n=n||{};var i=n.scope;if(!r)throw Error("Unknown option: "+e);{if(!r.callback){var o="global"!==i&&t&&t.state.vim.options[e];return(o||"local"!==i&&r||{}).value}var o=t&&r.callback(void 0,t);if("global"!==i&&void 0!==o)return o;if("local"!==i)return r.callback()}}function w(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=bt()}function _(e){return e.state.vim||(e.state.vim={inputState:new S,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},fakeCursor:null,insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function C(){kt={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:yt(
kt.searchHistoryController.reset(),je(t,f),Fe(t),t.scrollTo(d.left,d.top),e.e_stop(n),M(t),i(),t.focus()):"Ctrl-U"==o&&(e.e_stop(n),i(""))}if(t.getSearchCursor){var l=r.searchArgs.forward,c=r.searchArgs.wholeWordOnly;Me(t).setReversed(!l);var u=l?"/":"?",f=Me(t).getQuery(),d=t.getScrollInfo();switch(r.searchArgs.querySrc){case"prompt":var p=kt.macroModeState;if(p.isPlaying){var h=p.replaySearchQueries.shift();i(h,!0,!1)}else Pe(t,{onClose:o,prefix:u,desc:zt,onKeyUp:a,onKeyDown:s});break;case"wordUnderCursor":var m=de(t,!1,!0,!1,!0),g=!0;if(m||(m=de(t,!1,!0,!1,!1),g=!1),!m)return;var h=t.getLine(m.start.line).substring(m.start.ch,m.end.ch);h=g&&c?"\\b"+h+"\\b":Y(h),kt.jumpList.cachedCursor=t.getCursor(),t.setCursor(m.start),i(h,!0,!1)}}},processEx:function(t,n,r){function i(e){kt.exCommandHistoryController.pushInput(e),kt.exCommandHistoryController.reset(),Nt.processCommand(t,e)}function o(n,r,i){var o,a=e.keyName(n);("Esc"==a||"Ctrl-C"==a||"Ctrl-["==a||"Backspace"==a&&""==r)&&(kt.exCommandHistoryController.pushInput(r),kt.exCommandHistoryController.reset(),e.e_stop(n),M(t),i(),t.focus()),"Up"==a||"Down"==a?(o="Up"==a,r=kt.exCommandHistoryController.nextMatch(r,o)||"",i(r)):"Ctrl-U"==a?(e.e_stop(n),i("")):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&kt.exCommandHistoryController.reset()}"keyToEx"==r.type?Nt.processCommand(t,r.exArgs.input):n.visualMode?Pe(t,{onClose:i,prefix:":",value:"'<,'>",onKeyDown:o}):Pe(t,{onClose:i,prefix:":",onKeyDown:o})},evalInput:function(e,t){var n,i,o,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},f=a.registerName,d=t.sel,p=H(t.visualMode?q(e,d.head):e.getCursor("head")),h=H(t.visualMode?q(e,d.anchor):e.getCursor("anchor")),m=H(p),g=H(h);if(c&&this.recordLastEdit(t,a),o=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat(),o>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===o)&&(o=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=o,M(e),s){var v=Ct[s](e,p,l,t);if(t.lastMotion=Ct[s],!v)return;if(l.toJumplist){var y=kt.jumpList,b=y.cachedCursor;b?(pe(e,b,v),delete y.cachedCursor):pe(e,p,v)}v instanceof Array?(i=v[0],n=v[1]):n=v,n||(n=H(p)),t.visualMode?(t.visualBlock&&n.ch===1/0||(n=q(e,n,t.visualBlock)),i&&(i=q(e,i,!0)),i=i||g,d.anchor=i,d.head=n,oe(e),ke(e,t,"<",U(i,n)?i:n),ke(e,t,">",U(i,n)?n:i)):c||(n=q(e,n),e.setCursor(n.line,n.ch))}if(c){if(u.lastSel){i=g;var k=u.lastSel,x=Math.abs(k.head.line-k.anchor.line),w=Math.abs(k.head.ch-k.anchor.ch);n=k.visualLine?r(g.line+x,g.ch):k.visualBlock?r(g.line+x,g.ch+w):k.head.line==k.anchor.line?r(g.line,g.ch+w):r(g.line+x,g.ch),t.visualMode=!0,t.visualLine=k.visualLine,t.visualBlock=k.visualBlock,d=t.sel={anchor:i,head:n},oe(e)}else t.visualMode&&(u.lastSel={anchor:H(d.anchor),head:H(d.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var _,C,S,L,T;if(t.visualMode){if(_=K(d.head,d.anchor),C=V(d.head,d.anchor),S=t.visualLine||u.linewise,L=t.visualBlock?"block":S?"line":"char",T=ae(e,{anchor:_,head:C},L),S){var A=T.ranges;if("block"==L)for(var E=0;E<A.length;E++)A[E].head.ch=X(e,A[E].head.line);else"line"==L&&(A[0].head=r(A[0].head.line+1,0))}}else{if(_=H(i||g),C=H(n||m),U(C,_)){var z=_;_=C,C=z}S=l.linewise||u.linewise,S?ue(e,_,C):l.forward&&ce(e,_,C),L="char";var O=!l.inclusive||S;T=ae(e,{anchor:_,head:C},L,O)}e.setSelections(T.ranges,T.primary),t.lastMotion=null,u.repeat=o,u.registerName=f,u.linewise=S;var I=St[c](e,u,T.ranges,g,n);t.visualMode&&le(e,null!=I),I&&e.setCursor(I)}},recordLastEdit:function(e,t,n){var r=kt.macroModeState;r.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=n,r.lastInsertModeChanges.changes=[],r.lastInsertModeChanges.expectCursorActivityForChange=!1)}},Ct={moveToTopLine:function(e,t,n){var i=$e(e).top+n.repeat-1;return r(i,fe(e.getLine(i)))},moveToMiddleLine:function(e){var t=$e(e),n=Math.floor(.5*(t.top+t.bottom));return r(n,fe(e.getLine(n)))},moveToBottomLine:function(e,t,n){var i=$e(e).bottom-n.repeat+1;return r(i,fe(e.getLine(i)))},expandToLine:function(e,t,n){var